commit dd13d34074699bd4ce19ca973e878ee1a7d0dff2 Author: Banjo Kazooie Date: Fri Jul 15 17:09:41 2022 -0500 The first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..2252bc96 --- /dev/null +++ b/.gitignore @@ -0,0 +1,74 @@ +# ignore all rom files +baseroms/* +*.z64 +*.n64 +*.v64 + +#compiled or ripped asm +asm/nonmatchings +asm/*.s +asm/*/*.s +asm/core1/os +!asm/ultra +!asm/core1/ultra +build/* +build/ + +#binaries ripped from the ROMs +assets/ +assets/* +bin/ +bin/* +tools/bk_crc/bk_crc + +# This folder will hold modified asset binaries +# these assets will override the original game +# assets in the bin/ at compile time. +mod/ +mod/* + + +#compiled object files +*.slo +*.lo +*.o +*.obj + +#Precompiled Headers +*.gch +*.pch + +#compiled dynamic libraries +*.so +*.dylib +*.dll + +#static libraries +*.lai +*.la +*.a +*.lib + +#misc +__pycache__/ +*__pycache__/ +expected/ +.*/ +*.ld +*.map +*auto.txt +.splat_cache +.splat_cache* +diff_settings.py +ctx.c +nonmatchings/ +undefined_syms_auto* +undefined_funcs_auto* + +#progress reports +*.csv +symbol_addrs.us.v10.txt + +#secret folder +tmp/ +tmp/* diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..0f15f0ba --- /dev/null +++ b/.gitmodules @@ -0,0 +1,18 @@ +[submodule "tools/bk_tools"] + path = tools/bk_tools + url = https://github.com/MittenzHugg/bk_tools.git +[submodule "tools/asm-differ"] + path = tools/asm-differ + url = https://github.com/simonlindholm/asm-differ.git +[submodule "tools/asm-processor"] + path = tools/asm-processor + url = https://github.com/simonlindholm/asm-processor.git +[submodule "tools/n64splat"] + path = tools/n64splat + url = https://github.com/ethteck/splat +[submodule "tools/ido-static-recomp"] + path = tools/ido-static-recomp + url = https://github.com/Emill/ido-static-recomp.git +[submodule "tools/bk_asset_tool"] + path = tools/bk_asset_tool + url = https://github.com/MittenzHugg/bk_asset_tool.git diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..943029d7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM ubuntu:20.04 as build + +ENV DEBIAN_FRONTEND=noninteractive + +COPY packages.txt / +RUN apt-get update && apt-get install -y $(cat packages.txt) + +COPY requirements.txt / +RUN python3 -m pip install -r requirements.txt + +RUN mkdir /banjo +WORKDIR /banjo diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..72abaa04 --- /dev/null +++ b/Makefile @@ -0,0 +1,604 @@ +### Configuration ### +BASENAME := banjo +VERSION ?= us.v10 + +ifeq ($(VERSION),us.v10) + C_VERSION=0 +endif + +ifeq ($(VERSION),pal) + C_VERSION=1 +endif + +ifeq ($(VERSION),us.v11) + C_VERSION=2 +endif + +ifeq ($(VERSION),jp) + C_VERSION=3 +endif + +IN_CFLAGS ?= -DCODE2_CODE_CRC2=0 -DCODE2_DATA_CRC2=0 +### Tools ### + +# System tools +MKDIR := mkdir +CP := cp +CD := cd +RM := rm +CAT := cat +DIFF := diff + +# Build tools +CROSS := mips-linux-gnu- +CC := ido/ido5.3_recomp/cc +CPP := cpp +GCC := $(CROSS)gcc +AS := $(CROSS)as +LD := $(CROSS)ld -b elf32-tradbigmips +OBJDUMP := $(CROSS)objdump +OBJCOPY := $(CROSS)objcopy +PYTHON := python3 +GREP := grep -rl +SPLAT := $(PYTHON) tools/n64splat/split.py +PRINT := printf +PATCH_LIB_MATH := tools/patch_libultra_math +ASM_PROCESSOR_DIR := tools/asm-processor +BK_TOOLS := tools/bk_tools +BK_CRC := tools/bk_crc/bk_crc +BK_INFLATE := $(BK_TOOLS)/bk_inflate_code +BK_DEFLATE := $(BK_TOOLS)/bk_deflate_code +BK_ASSET_TOOL := tools/bk_asset_tool/bk_asset_tool +ASM_PROCESSOR := $(PYTHON) $(ASM_PROCESSOR_DIR)/asm_processor.py +SPLAT_INPUTS := $(PYTHON) tools/splat_inputs.py +PROGRESS := $(PYTHON) tools/progress.py +PROGRESS_READ := $(PYTHON) tools/progress_read.py + +### Files and Directories ### + +# Inputs +OVERLAYS := core1 core2 MM TTC CC BGS FP lair GV CCW RBB MMM SM fight cutscenes + +# Creates a list of all the source files for the given overlay (e.g. BGS_C_SRCS) +# Appends that list to OVERLAY_C_FILES +define get_overlay_sources + $(1)_C_SRCS := $(filter $(SRC_ROOT)/$(1)/%,$(ALL_C_SRCS)) + $(1)_ASM_SRCS := $(filter $(ASM_ROOT)/$(1)/%,$(ALL_ASM_SRCS)) + $(1)_BINS := $(filter $(BIN_ROOT)/$(1)/%,$(ALL_BINS)) + OVERLAY_C_SRCS += $$($(1)_C_SRCS) + OVERLAY_ASM_SRCS += $$($(1)_ASM_SRCS) + OVERLAY_BINS += $$($(1)_BINS) + # Overlay inputs + $(1)_NEW_FILES := $$(filter $(BIN_ROOT)/$(1)/%, $(NEW_BINS)) $$(filter $(SRC_ROOT)/$(1)/%, $(NEW_C_SRCS)) $$(filter $(ASM_ROOT)/$(1)/%, $(NEW_ASM_SRCS)) $$(filter $(ASM_ROOT)/data/$(1)/%, $(NEW_ASM_SRCS)) + OVERLAY_NEW_FILES += $$($(1)_NEW_FILES) +endef + +# Source files +SRC_ROOT := src +ASM_ROOT := asm +BIN_ROOT := bin +ASSET_ROOT := assets +SUBYAML := subyaml +NONMATCHINGS := nonmatchings +NONMATCHING_DIR := $(ASM_ROOT)/$(NONMATCHINGS) +BUILD_ROOT := build +BUILD_DIR := $(BUILD_ROOT)/$(VERSION) +ALL_ASSET_FILES := $(shell find $(ASSET_ROOT) -type f -iname '*.*' 2> /dev/null) +ALL_C_SRCS := $(shell find $(SRC_ROOT) -type f -iname '*.c' 2> /dev/null) +ALL_ASM_SRCS := $(filter-out $(ASM_ROOT)/$(NONMATCHINGS), $(shell find $(ASM_ROOT) -name $(NONMATCHINGS) -prune -o -iname '*.s' 2> /dev/null)) +ALL_BINS := $(shell find $(BIN_ROOT) -type f -iname '*.bin' 2> /dev/null) +# Files referenced in the splat files +YAML_CALL := $(SPLAT_INPUTS) $(BASENAME).$(VERSION).yaml $(addprefix $(SUBYAML)/, $(addsuffix .$(VERSION).yaml, $(OVERLAYS))) +YAML_SRCS := $(shell $(SPLAT_INPUTS) $(BASENAME).$(VERSION).yaml $(addprefix $(SUBYAML)/, $(addsuffix .$(VERSION).yaml, $(OVERLAYS)))) +YAML_C_SRCS := $(filter %.c, $(YAML_SRCS)) +YAML_ASM_SRCS := $(filter %.s, $(YAML_SRCS)) +YAML_BINS := $(filter %.bin, $(YAML_SRCS)) +# Files that need to be extracted +NEW_C_SRCS := $(filter-out $(ALL_C_SRCS), $(YAML_C_SRCS)) +NEW_ASM_SRCS := $(filter-out $(ALL_ASM_SRCS), $(YAML_ASM_SRCS)) +NEW_BINS := $(filter-out $(ALL_BINS), $(YAML_BINS)) +NEW_FILES := $(NEW_C_SRCS) $(NEW_ASM_SRCS) $(NEW_BINS) +$(foreach overlay,$(OVERLAYS),$(eval $(call get_overlay_sources,$(overlay)))) +# Files for the rom itself +MAIN_C_SRCS := $(filter-out $(OVERLAY_C_SRCS),$(ALL_C_SRCS)) +MAIN_ASM_SRCS := $(filter-out $(OVERLAY_ASM_SRCS),$(ALL_ASM_SRCS)) +MAIN_BINS := $(filter-out $(OVERLAY_BINS),$(ALL_BINS)) +# Files that need to be extracted for the rom itself +MAIN_NEW_FILES := $(filter-out $(OVERLAY_NEW_FILES), $(NEW_FILES)) +# Any source files that have GLOBAL_ASM in them or do not exist before splitting +GLOBAL_ASM_C_SRCS := $(shell $(GREP) GLOBAL_ASM $(SRC_ROOT) arg2) +define print2 + @$(PRINT) "$(GREEN)$(1) $(YELLOW)$(2)$(GREEN) -> $(BLUE)$(3)$(NO_COL)\n" +endef + +### Flags ### + +# Build tool flags +CFLAGS := -c -Wab,-r4300_mul -non_shared -G 0 -Xfullwarn -Xcpluscomm $(OPT_FLAGS) $(MIPSBIT) -D_FINALROM -DF3DEX_GBI -DVERSION='$(C_VERSION)' +CFLAGS += -woff 649,654,838,807 +CFLAGS += $(IN_CFLAGS) +CPPFLAGS := -D_FINALROM -DN_MICRO +INCLUDE_CFLAGS := -I . -I include -I include/2.0L -I include/2.0L/PR +OPT_FLAGS := -O2 +MIPSBIT := -mips2 +ASFLAGS := -EB -mtune=vr4300 -march=vr4300 -mabi=32 -I include +GCC_ASFLAGS := -c -x assembler-with-cpp -mabi=32 -ffreestanding -mtune=vr4300 -march=vr4300 -mfix4300 -G 0 -O -mno-shared -fno-PIC -mno-abicalls +LDFLAGS_COMMON := -T symbol_addrs.core1.$(VERSION).txt -T symbol_addrs.core2.$(VERSION).txt -T symbol_addrs.global.$(VERSION).txt -T undefined_syms.$(VERSION).txt -T undefined_syms.libultra.txt --no-check-sections --accept-unknown-input-arch +LDFLAGS := -T $(LD_SCRIPT) -Map $(ELF:.elf=.map) --no-check-sections --accept-unknown-input-arch -T undefined_syms.libultra.txt +BINOFLAGS := -I binary -O elf32-tradbigmips + +### Rules ### + +# Default target, all +all: verify + +# Shows progress for all overlays, boot, and total +progress: $(OVERLAY_PROG_CSVS) $(MAIN_PROG_CSV) $(TOTAL_PROG_CSV) + @$(foreach overlay,$(OVERLAYS),$(PROGRESS_READ) progress/progress.$(overlay).csv $(VERSION) $(overlay) &&) \ + $(PROGRESS_READ) $(MAIN_PROG_CSV) $(VERSION) bk_boot + @$(PROGRESS_READ) $(TOTAL_PROG_CSV) $(VERSION) total + +# Shows progress for a single overlay (e.g. progress-SM) +$(addprefix progress-,$(OVERLAYS)) : progress-% : progress/progress.%.csv + @$(PROGRESS_READ) $< $(VERSION) $* + +# Verify that the roms match, also sets up diff_settings +verify: $(Z64) + @$(DIFF) $(BASEROM) $(Z64) > /dev/null && \ + $(PRINT) "$(YELLOW) _\n _( )_\n [ ]_\n ) _ _)\n [_( )_]\n$(BLUE)$(BASENAME).$(VERSION).z64$(NO_COL): $(GREEN)OK$(NO_COL)\n" || \ + $(PRINT) "$(BLUE)$(BASEROM) $(RED)differs$(NO_COL)\n" + @$(PRINT) "def apply(config, args):\n" > diff_settings.py + @$(PRINT) "\tconfig[\"baseimg\"] = \"$(BASEROM)\"\n" >> diff_settings.py + @$(PRINT) "\tconfig[\"myimg\"] = \"$(Z64)\"\n" >> diff_settings.py + @$(PRINT) "\tconfig[\"mapfile\"] = \"$(Z64:.z64=.map)\"\n" >> diff_settings.py + @$(PRINT) "\tconfig[\"source_directories\"] = ['$(SRC_ROOT)', 'include']\n" >> diff_settings.py + @$(PRINT) "\tconfig[\"makeflags\"] = ['-s']\n" >> diff_settings.py + +# Musical note print for individual overlays +# Need to figure out how to print this only when building a single overlay +# $(YELLOW) ╒════╕\n │ │\n _│ _│\n └─┘ └─┘\n + +# Verify that any given overlay matches, also sets up diff_settings +verify-%: $(BUILD_DIR)/%.rzip.bin $(BIN_ROOT)/%.$(VERSION).rzip.bin $(BUILD_DIR)/%.full progress/progress_%.svg + @$(DIFF) $< $(BIN_ROOT)/$*.$(VERSION).rzip.bin > /dev/null && \ + $(PRINT) "$(BLUE)%-10s$(NO_COL): $(GREEN)OK$(NO_COL)\n" "$*" || \ + $(PRINT) "$(BLUE)$* $(RED)differs$(NO_COL)\n" + @$(PRINT) "def apply(config, args):\n" > diff_settings.py + @$(PRINT) "\tconfig[\"baseimg\"] = \"$(BUILD_DIR)/$*.$(VERSION).bin\"\n" >> diff_settings.py + @$(PRINT) "\tconfig[\"myimg\"] = \"$(BUILD_DIR)/$*.full\"\n" >> diff_settings.py + @$(PRINT) "\tconfig[\"mapfile\"] = \"$(BUILD_DIR)/$*.map\"\n" >> diff_settings.py + @$(PRINT) "\tconfig[\"source_directories\"] = ['$(SRC_ROOT)/$*', 'include']\n" >> diff_settings.py + @$(PRINT) "\tconfig[\"makeflags\"] = ['TARGET=$*','-s']\n" >> diff_settings.py + +$(OVERLAY_PROG_SVGS) : progress/progress_%.svg: progress/progress.%.csv + $(call print1,Creating progress svg for:,$*) + @$(PROGRESS_READ) $< $(VERSION) $* + +$(OVERLAY_PROG_CSVS) : progress/progress.%.csv: $(BUILD_DIR)/%.elf + $(call print1,Calculating progress for:,$*) + @$(PROGRESS) . $(BUILD_DIR)/$*.elf .$*_code --version $(VERSION) --subcode $* > $@ + +$(MAIN_PROG_SVG): $(MAIN_PROG_CSV) + $(call print1,Creating progress svg for:,boot) + @$(PROGRESS_READ) $< $(VERSION) bk_boot + +$(MAIN_PROG_CSV): $(ELF) + $(call print1,Calculating progress for:,boot) + @$(PROGRESS) . $< .boot_bk_boot --version $(VERSION) > $@ + +$(TOTAL_PROG_SVG): $(TOTAL_PROG_CSV) + $(call print0,Creating total progress svg) + @$(PROGRESS_READ) $< $(VERSION) total + +$(TOTAL_PROG_CSV): $(OVERLAY_PROG_CSVS) $(MAIN_PROG_CSV) + $(call print0,Calculating total progress) + @cat $^ > $@ + +# Verify that each overlay matches +verify-each: $(addprefix verify-,$(OVERLAYS)) + +# per-overlay rules +define overlay_rules + # .o -> .elf (overlay) + $(BUILD_DIR)/$(1).elf : $$($(1)_ALL_OBJS) $(1).ld + $(LD) -T $(1).ld -R core2.elf --allow-multiple-definition -Map $(BUILD_DIR)/$(1).map $$(LDFLAGS_COMMON) -T undefined_syms_auto.$(1).$(VERSION).txt -T undefined_funcs_auto.$(1).$(VERSION).txt -o $$@ + # split overlay + $(BUILD_DIR)/$(1)_SPLAT_TIMESTAMP : $(SUBYAML)/$(1).$(VERSION).yaml $(BUILD_DIR)/$(1).$(VERSION).bin $(SYMBOL_ADDRS) + $(call print1,Splitting bin:,$$<) + $(SPLAT) --target $(BUILD_DIR)/$(1).$(VERSION).bin $(SUBYAML)/$(1).$(VERSION).yaml --basedir . + @touch $$@ + @touch $(1).ld + # Dummy target to make sure extraction happens before compilation, mainly for extracted asm + $$($(1)_C_SRCS) $$($(1)_ASM_SRCS) $$($(1)_BINS) : | $(BUILD_DIR)/$(1)_SPLAT_TIMESTAMP + @: + # Dummy target to make sure extraction happens before processing extracted files and linking + $$($(1)_NEW_FILES) $(1).ld: $(BUILD_DIR)/$(1)_SPLAT_TIMESTAMP + @: +endef +$(foreach overlay,$(OVERLAYS),$(eval $(call overlay_rules,$(overlay)))) + +# Additional symbols for core2 +$(BUILD_DIR)/core2.elf: LDFLAGS_COMMON = -T symbol_addrs.core1.$(VERSION).txt -T symbol_addrs.core2.$(VERSION).txt -T symbol_addrs.global.$(VERSION).txt -T undefined_syms.$(VERSION).txt -T undefined_syms.libultra.txt --no-check-sections --accept-unknown-input-arch -T level_symbols.$(VERSION).txt +$(BUILD_DIR)/core2.temp.elf: LDFLAGS_COMMON = -T symbol_addrs.core1.$(VERSION).txt -T symbol_addrs.core2.$(VERSION).txt -T symbol_addrs.global.$(VERSION).txt -T undefined_syms.$(VERSION).txt -T undefined_syms.libultra.txt --no-check-sections --accept-unknown-input-arch -T level_symbols.$(VERSION).txt + +# mkdir +$(ALL_DIRS) : + $(call print1,Making folder:,$@) + @$(MKDIR) -p $@ + +# .s -> .o (assemble with gcc for preprocessor support) +$(BUILD_DIR)/%.s.o: %.s | $(ASM_BUILD_DIRS) + $(call print2,Assembling:,$<,$@) + @$(GCC) $(GCC_ASFLAGS) $(INCLUDE_CFLAGS) -o $@ $< + +# .bin -> .o +$(BIN_OBJS) : $(BUILD_DIR)/%.bin.o : %.bin | $(BIN_BUILD_DIRS) + $(call print2,Objcopying:,$<,$@) + @$(OBJCOPY) $(BINOFLAGS) $< $@ + +# .bin -> .o (overlay) +$(OVERLAY_RZIP_OBJS) : $(BUILD_DIR)/$(BIN_ROOT)/%.$(VERSION).rzip.bin.o : $(BUILD_DIR)/%.rzip.bin + $(call print2,Objcopying:,$<,$@) + @$(OBJCOPY) $(BINOFLAGS) $< $@ + +$(BUILD_DIR)/bk_boot.full: $(BUILD_DIR)/bk_boot.elf + @mips-linux-gnu-objcopy -I elf32-tradbigmips -O binary --only-section .boot_bk_boot $(BUILD_DIR)/bk_boot.elf $@ + +$(BUILD_DIR)/crc.bin : $(BUILD_DIR)/bk_boot.full $(BUILD_DIR)/core1.code $(BUILD_DIR)/core1.data $(BK_CRC) + @$(BK_CRC) $(BUILD_DIR)/bk_boot.full > $(BUILD_DIR)/crc.bin + @$(BK_CRC) $(BUILD_DIR)/core1.code >> $(BUILD_DIR)/crc.bin + @$(BK_CRC) $(BUILD_DIR)/core1.data >> $(BUILD_DIR)/crc.bin + +# .bin -> .o (overlay crc check) +$(CRC_OBJS) : $(BUILD_DIR)/crc.bin + $(call print2,Objcopying:,$<,$@) + @$(OBJCOPY) $(BINOFLAGS) $< $@ + +# .c -> .o +$(BUILD_DIR)/%.c.o : %.c | $(C_BUILD_DIRS) + $(call print2,Compiling:,$<,$@) + @$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_CFLAGS) $(OPT_FLAGS) $(MIPSBIT) -o $@ $< + +# .c -> .o (mips3) +$(MIPS3_OBJS) : $(BUILD_DIR)/%.c.o : %.c | $(C_BUILD_DIRS) + $(call print2,Compiling:,$<,$@) + @$(CC) -c -32 $(CFLAGS) $(CPPFLAGS) $(INCLUDE_CFLAGS) $(OPT_FLAGS) $(LOOP_UNROLL) $(MIPSBIT) -o $@ $< + @tools/set_o32abi_bit.py $@ + +# .c -> .o with asm processor +$(GLOBAL_ASM_C_OBJS) : $(BUILD_DIR)/%.c.o : %.c | $(C_BUILD_DIRS) + $(call print2,Compiling (with ASM Processor):,$<,$@) + @$(ASM_PROCESSOR) $(OPT_FLAGS) $< > $(BUILD_DIR)/$< + @$(CC) -32 $(CFLAGS) $(CPPFLAGS) $(INCLUDE_CFLAGS) $(OPT_FLAGS) $(MIPSBIT) -o $@ $(BUILD_DIR)/$< + @$(ASM_PROCESSOR) $(OPT_FLAGS) $< --post-process $@ \ + --assembler "$(AS) $(ASFLAGS)" --asm-prelude include/prelude.s + +# Split baserom +$(BUILD_DIR)/SPLAT_TIMESTAMP: $(BASENAME).$(VERSION).yaml $(SYMBOL_ADDRS) | $(BUILD_DIR) + $(call print1,Splitting rom:,$<) + @touch $@ + @$(SPLAT) $(BASENAME).$(VERSION).yaml + @touch $(LD_SCRIPT) +# Dummy target to make the LD script and overlay rzips depend on splat being run +# without causing it to be rerun once for every overlay +# Bin files are also dependent on the splat timestamp since they get overwritten on resplit +$(MAIN_NEW_FILES) $(LD_SCRIPT) $(MAIN_BINS) : $(BUILD_DIR)/SPLAT_TIMESTAMP + @: +# Dummy target to make sure extraction happens before compilation, mainly for extracted asm +$(MAIN_C_SRCS) $(MAIN_ASM_SRCS) : | $(BUILD_DIR)/SPLAT_TIMESTAMP + @: + +# .rzip.bin -> .bin +$(OVERLAY_BINS) : $(BUILD_DIR)/%.$(VERSION).bin : $(BIN_ROOT)/%.$(VERSION).rzip.bin $(BK_INFLATE) | $(BUILD_DIR) + $(call print1,Decompressing rzip:,$<) + @$(BK_INFLATE) $< $@ + +# Special rules to handle core2 code checksumming +ifneq ($(CORE2_CODE_CRC_C_OBJS),) + CORE2_TEMP_LD := core2.temp.ld + CORE2_CODE_CRC_C_TEMP_OBJS := $(CORE2_CODE_CRC_C_OBJS:.c.o=.c.o_) + core2_NON_CRC_OBJS := $(filter-out $(CORE2_CODE_CRC_C_OBJS),$(core2_ALL_OBJS)) + + # core2.ld -> core2.temp.ld + $(CORE2_TEMP_LD) : core2.ld + $(call print0,Creating linker script for initial core2 linking step) + @$(CP) $< $@ + $(foreach obj, $(CORE2_CODE_CRC_C_OBJS), sed -i 's:$(obj):$(obj)_:g' $@) + + # core2 .c -> .o with zero for core2 code CRC + $(CORE2_CODE_CRC_C_TEMP_OBJS) : $(BUILD_DIR)/%.c.o_ : %.c | $(C_BUILD_DIRS) + $(call print2,Compiling temp file:,$<,$@) + @$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_CFLAGS) $(OPT_FLAGS) $(MIPSBIT) -o $@ $< + + # core2 objects with zero for code CRC -> core2.temp.elf + $(BUILD_DIR)/core2.temp.elf : $(core2_NON_CRC_OBJS) $(CORE2_TEMP_LD) $(CORE2_CODE_CRC_C_TEMP_OBJS) + $(call print1,Linking elf:,$@) + @$(LD) -T $(CORE2_TEMP_LD) -Map $(BUILD_DIR)/core2.map $(LDFLAGS_COMMON) -T undefined_syms_auto.core2.$(VERSION).txt -T undefined_funcs_auto.core2.$(VERSION).txt -o $@ + + # core2.temp.elf -> core2.temp.code + $(BUILD_DIR)/core2.temp.code : $(BUILD_DIR)/core2.temp.elf + $(call print2,Converting initial core2 code:,$<,$@) + @$(OBJCOPY) -O binary --only-section .core2_code $< $@ + + # core2 code -> core2 code crc + $(BUILD_DIR)/core2.code.crc : $(BUILD_DIR)/core2.temp.code $(BK_CRC) + $(call print0,Calculating core2 code CRC) + @$(BK_CRC) -D CORE2_CODE $< > $@ + + # core2 .c -> .o with correct core2 code CRC + $(CORE2_CODE_CRC_C_OBJS) : $(BUILD_DIR)/%.c.o : %.c $(BUILD_DIR)/core2.code.crc | $(C_BUILD_DIRS) + $(call print2,Compiling:,$<,$@) + @$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_CFLAGS) $(OPT_FLAGS) $(MIPSBIT) $(shell cat $(BUILD_DIR)/core2.code.crc) -o $@ $< +endif + +# core2 data -> core2 data CRC +$(BUILD_DIR)/core2.data.crc : $(BUILD_DIR)/core2.data $(BK_CRC) + $(call print0,Calculating core2 data CRC) + @$(BK_CRC) -D CORE2_DATA $< > $@ + +# core1 .c -> .o with correct core2 data CRC +$(CORE2_DATA_CRC_C_OBJS) : $(BUILD_DIR)/%.o : % $(BUILD_DIR)/core2.data.crc | $(C_BUILD_DIRS) + $(call print2,Compiling file with core2 data CRC (with ASM Processor):,$<,$@) + @$(ASM_PROCESSOR) $(OPT_FLAGS) $< > $(BUILD_DIR)/$< + @$(CC) -32 $(CFLAGS) $(CPPFLAGS) $(INCLUDE_CFLAGS) $(OPT_FLAGS) $(MIPSBIT) $(shell cat $(BUILD_DIR)/core2.data.crc) -o $@ $(BUILD_DIR)/$< + @$(ASM_PROCESSOR) $(OPT_FLAGS) $< --post-process $@ \ + --assembler "$(AS) $(ASFLAGS)" --asm-prelude include/prelude.s + +# .elf -> .code +$(OVERLAY_CODE_BINS) : $(BUILD_DIR)/%.code : $(BUILD_DIR)/%.elf + $(call print2,Converting overlay code:,$<,$@) + @$(OBJCOPY) -I elf32-tradbigmips -O binary --only-section .$*_code --only-section .$*_mips3 $< $@ + +# .elf -> .data +$(OVERLAY_DATA_BINS) : $(BUILD_DIR)/%.data : $(BUILD_DIR)/%.elf + $(call print2,Converting overlay data:,$<,$@) + @$(OBJCOPY) -I elf32-tradbigmips -O binary --only-section .$*_data --only-section .*_data_* $< $@ + +# .elf -> .full +$(BUILD_DIR)/%.full : $(BUILD_DIR)/%.elf + @$(OBJCOPY) -I elf32-tradbigmips -O binary $< $@ + +# .data + .code -> .rzip.bin +$(BUILD_DIR)/%.rzip.bin : $(BUILD_DIR)/%.code $(BUILD_DIR)/%.data $(BK_DEFLATE) + $(call print1,Compressing overlay:,$@) + @cd $(BK_TOOLS) && ../../$(BK_DEFLATE) ../../$@ ../../$(BUILD_DIR)/$*.code ../../$(BUILD_DIR)/$*.data + +# .bin -> .yaml +$(ASSET_ROOT)/assets.yaml : $(BIN_ROOT)/assets.bin $(BK_ASSET_TOOL) + $(call print1,Extracting Assets:,$@) + $(BK_ASSET_TOOL) -e $< $(ASSET_ROOT) + +# .yaml -> .bin +ifneq (,$(shell which cargo)) +$(ASSET_BIN): $(ASSET_ROOT)/assets.yaml $(BK_ASSET_TOOL) $(ALL_ASSET_FILES) + $(call print2,Constructing Asset Binary:,$<,$@) + $(BK_ASSET_TOOL) -c $< $@ +else +$(ASSET_BIN): $(BIN_ROOT)/assets.bin + $(call print2,Copying Asset Binary (install cargo to construct instead):,$<,$@) + @$(CP) $< $@ +endif + +# .bin -> .o +$(ASSET_OBJS): $(ASSET_BIN) + $(call print2,Objcopying:,$<,$@) + @$(OBJCOPY) $(BINOFLAGS) $< $@ + +# .o -> .elf (game) +$(ELF): $(MAIN_ALL_OBJS) $(LD_SCRIPT) $(OVERLAY_RZIP_OBJS) $(addprefix $(BUILD_DIR)/, $(addsuffix .full, $(OVERLAYS))) $(ASSET_OBJS) + $(call print1,Linking elf:,$@) + @$(LD) $(LDFLAGS) -T undefined_syms_auto.$(VERSION).txt -o $@ + +$(BK_BOOT_LD_SCRIPT): $(LD_SCRIPT) + sed '\|$(CRC_OBJS)|d' $< > $@ + +# .o -> .elf (game) +$(BUILD_DIR)/bk_boot.elf: $(filter-out $(CRC_OBJS),$(MAIN_ALL_OBJS)) $(BK_BOOT_LD_SCRIPT) $(OVERLAY_RZIP_OBJS) $(addprefix $(BUILD_DIR)/, $(addsuffix .full, $(OVERLAYS))) + $(call print1,Linking elf:,$@) + @$(LD) -T $(BK_BOOT_LD_SCRIPT) -Map $(ELF:.elf=.map) --no-check-sections --accept-unknown-input-arch -T undefined_syms.libultra.txt -T undefined_syms_auto.$(VERSION).txt -o $@ + +# .elf -> .z64 +$(Z64) : $(ELF) $(OVERLAY_PROG_SVGS) $(MAIN_PROG_SVG) $(TOTAL_PROG_SVG) + $(call print1,Creating z64:,$@) + @$(OBJCOPY) $< $@ -O binary $(OCOPYFLAGS) + +$(BK_TOOLS)/gzip-1.2.4/gzip: $(BK_TOOLS)/gzip-1.2.4/Makefile + @$(CD) $(BK_TOOLS)/gzip-1.2.4 && $(MAKE) gzip + +$(BK_TOOLS)/gzip-1.2.4/Makefile: + @$(CD) $(BK_TOOLS)/gzip-1.2.4 && ./configure + +$(BK_ASSET_TOOL): + @$(CD) tools/bk_asset_tool && cargo build --release + @$(CP) tools/bk_asset_tool/target/release/bk_asset_tool $@ + +# Build tools +$(BK_TOOLS)/%: $(BK_TOOLS)/gzip-1.2.4/gzip + $(call print1,Compiling build tool:,$@) + @$(CD) $(BK_TOOLS) && $(MAKE) $* + +$(BK_CRC) : + g++ $@.cpp -o $@ + +# Combined symbol addresses file +$(SYMBOL_ADDRS): $(SYMBOL_ADDR_FILES) + $(call print0,Combining symbol address files) + @$(CAT) symbol_addrs.*.$(VERSION).txt > $@ + +# Shorthand rules for each overlay (e.g. SM) +$(OVERLAYS): %: verify-% + +clean: + $(call print0,Cleaning build artifacts) + @$(RM) -rf $(BUILD_ROOT) + @$(RM) -rf $(BIN_ROOT) + @$(RM) -rf $(NONMATCHING_DIR) + @$(RM) -rf $(ASM_ROOT)/*.s + @$(RM) -rf $(addprefix $(ASM_ROOT)/,$(filter-out core1,$(OVERLAYS))) + @$(RM) -rf $(ASM_ROOT)/core1/*.s + @$(RM) -rf $(ASM_ROOT)/core1/os + @$(RM) -f undefined_syms_auto* undefined_funcs_auto* + @$(RM) -f *.ld + @$(RM) -f $(SYMBOL_ADDRS) + +# Per-file flag definitions +build/$(VERSION)/src/core1/io/%.c.o: OPT_FLAGS = -O1 +build/$(VERSION)/src/core1/io/pimgr.c.o: OPT_FLAGS = -O1 +build/$(VERSION)/src/core1/done/io/%.c.o: OPT_FLAGS = -O1 +build/$(VERSION)/src/core1/os/%.c.o: OPT_FLAGS = -O1 +build/$(VERSION)/src/core1/code_2D2D0.c.o: OPT_FLAGS = -O1 +build/$(VERSION)/src/core1/done/os/%.c.o: OPT_FLAGS = -O1 +build/$(VERSION)/src/core1/code_21A10.c.o: INCLUDE_CFLAGS = -I . -I include -I include/2.0L -I include/2.0L/PR +build/$(VERSION)/src/core1/code_21A10.c.o: OPT_FLAGS = -O3 +build/$(VERSION)/src/core1/done/gu/%.c.o: OPT_FLAGS = -O3 +build/$(VERSION)/src/core1/done/gu/%.c.o: INCLUDE_CFLAGS = -I . -I include -I include/2.0L -I include/2.0L/PR +build/$(VERSION)/src/core1/gu/mtxutil.c.o: OPT_FLAGS = -O2 +build/$(VERSION)/src/core1/gu/rotate.c.o: OPT_FLAGS = -O2 +build/$(VERSION)/src/core1/done/audio/%.c.o: INCLUDE_CFLAGS = -I . -I include -I include/2.0L -I include/2.0L/PR +build/$(VERSION)/src/core1/done/audio/%.c.o: OPT_FLAGS = -O3 +# build/$(VERSION)/src/core1/code_21CB0.c.o: INCLUDE_CFLAGS = -I . -I include -I include/2.0L -I include/2.0L/PR +# build/$(VERSION)/src/core1/code_21CB0.c.o: OPT_FLAGS = -O3 +build/$(VERSION)/src/core1/done/io/sptask.c.o: OPT_FLAGS = -O1 +build/$(VERSION)/src/core1/done/ll.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/core1/done/ll.c.o: MIPSBIT := -mips3 -o32 + +build/$(VERSION)/src/bk_boot_27F0.c.o: OPT_FLAGS = -O2 +build/$(VERSION)/src/done/destroythread.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/pirawdma.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/thread.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/pimgr.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/getthreadid.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/setthreadpri.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/createthread.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/yieldthread.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/setglobalintmask.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/recvmesg.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/startthread.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/devmgr.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/sendmesg.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/pigetstat.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/si.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/resetglobalintmask.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/epirawwrite.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/epirawread.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/createmesgqueue.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/leodiskinit.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/virtualtophysical.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/ll.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/ll.c.o: MIPSBIT := -mips3 -o32 +build/$(VERSION)/src/done/sirawwrite.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/sirawread.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/initialize.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/pirawread.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/seteventmesg.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/siacs.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/cartrominit.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/leointerrupt.c.o: OPT_FLAGS := -O1 +build/$(VERSION)/src/done/epirawdma.c.o: OPT_FLAGS := -O1 + +# Disable implicit rules +MAKEFLAGS += -r + +# Disable built-in rules +.SUFFIXES: + +# Phony targets +.PHONY: all clean verify $(OVERLAYS) progress $(addprefix progress-,$(OVERLAYS)) + +# Set up pipefail +SHELL = /bin/bash -e -o pipefail + +# Debug variable print target +print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true diff --git a/README.md b/README.md new file mode 100644 index 00000000..be303e41 --- /dev/null +++ b/README.md @@ -0,0 +1,71 @@ +# banjo + + + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- + +## Building + +Grab tools + +```sh +git submodule update --init --recursive +``` + +Drop in `US v1.0` as `baserom.us.v10.z64` (sha1sum: `1fe1632098865f639e22c11b9a81ee8f29c75d7a`) + +To extract and build everything + +```sh +make +``` + +where the following are supported values of `` +- `core1` +- `core2` +- `MM` +- `TTC` +- `CC` +- `BGS` +- `FP` +- `lair` +- `GV` +- `CCW` +- `RBB` +- `MMM` +- `SM` +- `fight` +- `cutscenes` + +### Prerequisites + +Ubuntu 18.04 or higher. + +```sh +sudo apt-get update && sudo apt-get install -y $(cat packages.txt) + +python3 -m pip install -r requirements.txt +``` + +### Other versions + +Drop in `us.v11`, `jp`, or `pal` as `baserom..z64` e.g. `baserom.us.v11.z64` + +```sh +make VERSION=us.v11 +``` diff --git a/asm/core1/ultra/libm_vals.s b/asm/core1/ultra/libm_vals.s new file mode 100644 index 00000000..b88ad985 --- /dev/null +++ b/asm/core1/ultra/libm_vals.s @@ -0,0 +1,5 @@ + .rdata + .align 4 + .globl __libm_qnan_f +__libm_qnan_f: + .word 0x7F810000 diff --git a/asm/core1/ultra/setintmask.s b/asm/core1/ultra/setintmask.s new file mode 100644 index 00000000..a561e22f --- /dev/null +++ b/asm/core1/ultra/setintmask.s @@ -0,0 +1,135 @@ +#include +.include "macro.inc" +# assembler directives +.set noat # allow manual use of $at +.set gp=64 # allow use of 64-bit general purpose registers + +.rdata + +#define MI_INTR_MASK 0x3f +#define CLR_SP 0x0001 +#define SET_SP 0x0002 +#define CLR_SI 0x0004 +#define SET_SI 0x0008 +#define CLR_AI 0x0010 +#define SET_AI 0x0020 +#define CLR_VI 0x0040 +#define SET_VI 0x0080 +#define CLR_PI 0x0100 +#define SET_PI 0x0200 +#define CLR_DP 0x0400 +#define SET_DP 0x0800 + +EXPORT(__osRcpImTable) +/* LUT to convert between MI_INTR and MI_INTR_MASK */ +/* MI_INTR is status for each interrupt whereas */ +/* MI_INTR_MASK has seperate bits for set/clr */ +.half CLR_SP | CLR_SI | CLR_AI | CLR_VI | CLR_PI | CLR_DP +.half SET_SP | CLR_SI | CLR_AI | CLR_VI | CLR_PI | CLR_DP +.half CLR_SP | SET_SI | CLR_AI | CLR_VI | CLR_PI | CLR_DP +.half SET_SP | SET_SI | CLR_AI | CLR_VI | CLR_PI | CLR_DP +.half CLR_SP | CLR_SI | SET_AI | CLR_VI | CLR_PI | CLR_DP +.half SET_SP | CLR_SI | SET_AI | CLR_VI | CLR_PI | CLR_DP +.half CLR_SP | SET_SI | SET_AI | CLR_VI | CLR_PI | CLR_DP +.half SET_SP | SET_SI | SET_AI | CLR_VI | CLR_PI | CLR_DP +.half CLR_SP | CLR_SI | CLR_AI | SET_VI | CLR_PI | CLR_DP +.half SET_SP | CLR_SI | CLR_AI | SET_VI | CLR_PI | CLR_DP +.half CLR_SP | SET_SI | CLR_AI | SET_VI | CLR_PI | CLR_DP +.half SET_SP | SET_SI | CLR_AI | SET_VI | CLR_PI | CLR_DP +.half CLR_SP | CLR_SI | SET_AI | SET_VI | CLR_PI | CLR_DP +.half SET_SP | CLR_SI | SET_AI | SET_VI | CLR_PI | CLR_DP +.half CLR_SP | SET_SI | SET_AI | SET_VI | CLR_PI | CLR_DP +.half SET_SP | SET_SI | SET_AI | SET_VI | CLR_PI | CLR_DP +.half CLR_SP | CLR_SI | CLR_AI | CLR_VI | SET_PI | CLR_DP +.half SET_SP | CLR_SI | CLR_AI | CLR_VI | SET_PI | CLR_DP +.half CLR_SP | SET_SI | CLR_AI | CLR_VI | SET_PI | CLR_DP +.half SET_SP | SET_SI | CLR_AI | CLR_VI | SET_PI | CLR_DP +.half CLR_SP | CLR_SI | SET_AI | CLR_VI | SET_PI | CLR_DP +.half SET_SP | CLR_SI | SET_AI | CLR_VI | SET_PI | CLR_DP +.half CLR_SP | SET_SI | SET_AI | CLR_VI | SET_PI | CLR_DP +.half SET_SP | SET_SI | SET_AI | CLR_VI | SET_PI | CLR_DP +.half CLR_SP | CLR_SI | CLR_AI | SET_VI | SET_PI | CLR_DP +.half SET_SP | CLR_SI | CLR_AI | SET_VI | SET_PI | CLR_DP +.half CLR_SP | SET_SI | CLR_AI | SET_VI | SET_PI | CLR_DP +.half SET_SP | SET_SI | CLR_AI | SET_VI | SET_PI | CLR_DP +.half CLR_SP | CLR_SI | SET_AI | SET_VI | SET_PI | CLR_DP +.half SET_SP | CLR_SI | SET_AI | SET_VI | SET_PI | CLR_DP +.half CLR_SP | SET_SI | SET_AI | SET_VI | SET_PI | CLR_DP +.half SET_SP | SET_SI | SET_AI | SET_VI | SET_PI | CLR_DP +.half CLR_SP | CLR_SI | CLR_AI | CLR_VI | CLR_PI | SET_DP +.half SET_SP | CLR_SI | CLR_AI | CLR_VI | CLR_PI | SET_DP +.half CLR_SP | SET_SI | CLR_AI | CLR_VI | CLR_PI | SET_DP +.half SET_SP | SET_SI | CLR_AI | CLR_VI | CLR_PI | SET_DP +.half CLR_SP | CLR_SI | SET_AI | CLR_VI | CLR_PI | SET_DP +.half SET_SP | CLR_SI | SET_AI | CLR_VI | CLR_PI | SET_DP +.half CLR_SP | SET_SI | SET_AI | CLR_VI | CLR_PI | SET_DP +.half SET_SP | SET_SI | SET_AI | CLR_VI | CLR_PI | SET_DP +.half CLR_SP | CLR_SI | CLR_AI | SET_VI | CLR_PI | SET_DP +.half SET_SP | CLR_SI | CLR_AI | SET_VI | CLR_PI | SET_DP +.half CLR_SP | SET_SI | CLR_AI | SET_VI | CLR_PI | SET_DP +.half SET_SP | SET_SI | CLR_AI | SET_VI | CLR_PI | SET_DP +.half CLR_SP | CLR_SI | SET_AI | SET_VI | CLR_PI | SET_DP +.half SET_SP | CLR_SI | SET_AI | SET_VI | CLR_PI | SET_DP +.half CLR_SP | SET_SI | SET_AI | SET_VI | CLR_PI | SET_DP +.half SET_SP | SET_SI | SET_AI | SET_VI | CLR_PI | SET_DP +.half CLR_SP | CLR_SI | CLR_AI | CLR_VI | SET_PI | SET_DP +.half SET_SP | CLR_SI | CLR_AI | CLR_VI | SET_PI | SET_DP +.half CLR_SP | SET_SI | CLR_AI | CLR_VI | SET_PI | SET_DP +.half SET_SP | SET_SI | CLR_AI | CLR_VI | SET_PI | SET_DP +.half CLR_SP | CLR_SI | SET_AI | CLR_VI | SET_PI | SET_DP +.half SET_SP | CLR_SI | SET_AI | CLR_VI | SET_PI | SET_DP +.half CLR_SP | SET_SI | SET_AI | CLR_VI | SET_PI | SET_DP +.half SET_SP | SET_SI | SET_AI | CLR_VI | SET_PI | SET_DP +.half CLR_SP | CLR_SI | CLR_AI | SET_VI | SET_PI | SET_DP +.half SET_SP | CLR_SI | CLR_AI | SET_VI | SET_PI | SET_DP +.half CLR_SP | SET_SI | CLR_AI | SET_VI | SET_PI | SET_DP +.half SET_SP | SET_SI | CLR_AI | SET_VI | SET_PI | SET_DP +.half CLR_SP | CLR_SI | SET_AI | SET_VI | SET_PI | SET_DP +.half SET_SP | CLR_SI | SET_AI | SET_VI | SET_PI | SET_DP +.half CLR_SP | SET_SI | SET_AI | SET_VI | SET_PI | SET_DP +.half SET_SP | SET_SI | SET_AI | SET_VI | SET_PI | SET_DP +.text +.set noreorder +glabel osSetIntMask + mfc0 $t4, $12 + andi $v0, $t4, 0xff01 + lui $t0, %hi(__OSGlobalIntMask) + addiu $t0, $t0, %lo(__OSGlobalIntMask) + lw $t3, ($t0) + addiu $at, $zero, -1 + xor $t0, $t3, $at + andi $t0, $t0, 0xff00 + or $v0, $v0, $t0 + lui $t2, %hi(D_A430000C) + lw $t2, %lo(D_A430000C)($t2) + beqz $t2, setintmask_1 + srl $t1, $t3, 0x10 + addiu $at, $zero, -1 + xor $t1, $t1, $at + andi $t1, $t1, 0x3f + or $t2, $t2, $t1 +setintmask_1: + sll $t2, $t2, 0x10 + or $v0, $v0, $t2 + lui $at, 0x3f + and $t0, $a0, $at + and $t0, $t0, $t3 + srl $t0, $t0, 0xf + lui $t2, %hi(__osRcpImTable) + addu $t2, $t2, $t0 + lhu $t2, %lo(__osRcpImTable)($t2) + lui $at, %hi(D_A430000C) + sw $t2, %lo(D_A430000C)($at) + andi $t0, $a0, 0xff01 + andi $t1, $t3, 0xff00 + and $t0, $t0, $t1 + lui $at, 0xffff + ori $at, $at, 0xff + and $t4, $t4, $at + or $t4, $t4, $t0 + mtc0 $t4, $12 + nop + nop + jr $ra + nop +endlabel osSetIntMask diff --git a/asm/data/fight/code_180.data.s b/asm/data/fight/code_180.data.s new file mode 100644 index 00000000..d589d122 --- /dev/null +++ b/asm/data/fight/code_180.data.s @@ -0,0 +1,429 @@ +.include "macro.inc" + +.section .data + +dlabel D_80392100 +.double -500.0 + +dlabel jtbl_80392108 +.word L80387794_13A4, L803877F8_1408, L803878FC_150C, L803879A0_15B0, L80387A20_1630, L80387A98_16A8 + +dlabel D_80392120 +.float 0.95 + +dlabel D_80392124 +.float 1.05 + +dlabel D_80392128 +.float 5000.0 + +dlabel D_8039212C +.float 12000.0 + +dlabel D_80392130 +.float 1e8 + +dlabel jtbl_80392134 +.word L80388254_1E64, L80388558_2168, L80388558_2168, L80388268_1E78, L80388314_1F24, L8038837C_1F8C, L80388420_2030, L80388468_2078, L80388484_2094, L80388558_2168, L803884CC_20DC, L803884E0_20F0 + +dlabel D_80392164 +.float 0.95 + +dlabel D_80392168 +.float 1.05 + +dlabel D_8039216C +.float 5000.0 + +dlabel D_80392170 +.float 12000.0, 0.95 + +dlabel D_80392178 +.float 1.05 + +dlabel D_8039217C +.float 5000.0 + +dlabel D_80392180 +.float 12000.0 + +dlabel D_80392184 +.float 0.4 + +dlabel D_80392188 +.float 5000.0 + +dlabel D_8039218C +.float 12000.0, 2700.0 + +dlabel D_80392194 +.float 1150.0 + +dlabel D_80392198 +.float 0.95 + +dlabel D_8039219C +.float 1.05 + +dlabel D_803921A0 +.float 5000.0 + +dlabel D_803921A4 +.float 12000.0 + +dlabel D_803921A8 +.float 0.95 + +dlabel D_803921AC +.float 1.05 + +dlabel D_803921B0 +.float 5000.0 + +dlabel D_803921B4 +.float 12000.0 + +dlabel jtbl_803921B8 +.word L803887AC_23BC, L803888A8_24B8, L80388964_2574, L803889EC_25FC, L80388B24_2734, L80388DC4_29D4, L80388E84_2A94, L80388F5C_2B6C, L80388FC4_2BD4, L80389054_2C64, L803890C0_2CD0, L80389158_2D68 + +dlabel D_803921E8 +.double 0.3333333333333333 + +dlabel D_803921F0 +.double 3300.0, 0.7333333333333334 + +dlabel D_80392200 +.double 3300.0 + +dlabel D_80392208 +.double 0.66 + +dlabel D_80392210 +.double 0.65 + +dlabel jtbl_80392218 +.word L803893E8_2FF8, L803894CC_30DC, L803894F0_3100, L80389594_31A4, L803895D8_31E8, L80389638_3248, L80389660_3270 + +dlabel jtbl_80392234 +.word L8038975C_336C, L80389788_3398, L803897B4_33C4, L803897E0_33F0, L8038980C_341C + +dlabel D_80392248 +.float 1.54 + +dlabel jtbl_8039224C +.word L80389BD8_37E8, L80389CFC_390C, L80389D48_3958, L80389D80_3990, L80389E14_3A24, L80389E3C_3A4C, L80389F40_3B50 + +dlabel D_80392268 +.word 0x3F99999A, 0x00000000 + +dlabel D_80392270 +.double 0.1 + +dlabel D_80392278 +.double 0.8 + +dlabel jtbl_80392280 +.word L80389FEC_3BFC, L8038A4D4_40E4, L8038A01C_3C2C, L8038A4D4_40E4, L8038A1B4_3DC4, L8038A208_3E18, L8038A3D4_3FE4 + +dlabel D_8039229C +.float 2.2 + +dlabel D_803922A0 +.float 2.2 + +dlabel D_803922A4 +.float 2.2 + +dlabel D_803922A8 +.float 4.4 + +dlabel D_803922AC +.float 4.4 + +dlabel D_803922B0 +.float 4.4 + +dlabel D_803922B4 +.float 6.6 + +dlabel D_803922B8 +.float 6.6 + +dlabel D_803922BC +.float 6.6 + +dlabel D_803922C0 +.float 8.8 + +dlabel D_803922C4 +.float 8.8 + +dlabel D_803922C8 +.float 8.8 + +dlabel D_803922CC +.float 0.95 + +dlabel D_803922D0 +.float 1.05 + +dlabel D_803922D4 +.float 5000.0 + +dlabel D_803922D8 +.float 12000.0 + +dlabel D_803922DC +.float 0.6 + +dlabel D_803922E0 +.double 1.7, -1190.0 + +dlabel D_803922F0 +.float 1.7 + +dlabel D_803922F4 +.float 1.7 + +dlabel D_803922F8 +.float 1.7 + +dlabel D_803922FC +.float 1.7 + +dlabel D_80392300 +.float 0.95 + +dlabel D_80392304 +.float 1.05 + +dlabel D_80392308 +.float 0.95 + +dlabel D_8039230C +.float 1.05 + +dlabel jtbl_80392310 +.word L8038A778_4388, L8038A7D0_43E0, L8038A818_4428, L8038A8A0_44B0, L8038A8FC_450C, L8038A924_4534, L8038AA3C_464C + +dlabel D_8039232C +.float 0.95 + +dlabel D_80392330 +.float 1.05 + +dlabel D_80392334 +.float 0.95 + +dlabel D_80392338 +.float 1.05 + +dlabel D_8039233C +.float 0.95 + +dlabel D_80392340 +.float 1.05 + +dlabel D_80392344 +.float 0.95 + +dlabel D_80392348 +.float 1.05 + +dlabel D_8039234C +.float 0.95 + +dlabel D_80392350 +.float 1.05 + +dlabel D_80392354 +.float 0.95 + +dlabel D_80392358 +.float 1.05, 0.0 + +dlabel D_80392360 +.double 0.4 + +dlabel D_80392368 +.double 0.65 + +dlabel D_80392370 +.double 0.005 + +dlabel D_80392378 +.double 1.99 + +dlabel D_80392380 +.float 0.95 + +dlabel D_80392384 +.float 1.05 + +dlabel jtbl_80392388 +.word L8038ACE8_48F8, L8038AD90_49A0, L8038ADA0_49B0, L8038AF14_4B24, L8038AF70_4B80, L8038ADA8_49B8, L8038AE00_4A10, L8038AE5C_4A6C, L8038AF28_4B38 + +dlabel D_803923AC +.float 0.95 + +dlabel D_803923B0 +.float 1.05 + +dlabel D_803923B4 +.float 5000.0 + +dlabel D_803923B8 +.float 12000.0, 0.95 + +dlabel D_803923C0 +.float 1.05 + +dlabel D_803923C4 +.float 5000.0 + +dlabel D_803923C8 +.float 12000.0 + +dlabel D_803923CC +.float 0.95 + +dlabel D_803923D0 +.float 1.05 + +dlabel D_803923D4 +.float 5000.0 + +dlabel D_803923D8 +.float 12000.0 + +dlabel D_803923DC +.float 0.6 + +dlabel D_803923E0 +.float 0.6, 2.4 + +dlabel D_803923E8 +.float 2.4 + +dlabel D_803923EC +.float 4.4 + +dlabel D_803923F0 +.float 4.4 + +dlabel jtbl_803923F4 +.word L8038B290_4EA0, L8038B2A4_4EB4, L8038B2DC_4EEC, L8038B368_4F78, L8038B3B4_4FC4, L8038B460_5070, L8038B4FC_510C, L8038B564_5174, L8038B58C_519C + +dlabel D_80392418 +.double 0.56 + +dlabel D_80392420 +.double 0.99 + +dlabel D_80392428 +.float 4.8 + +dlabel jtbl_8039242C +.word L8038B874_5484, L8038B8D0_54E0, L8038B91C_552C, L8038B93C_554C, L8038B95C_556C + +dlabel D_80392440 +.float 0.95 + +dlabel D_80392444 +.float 1.05 + +dlabel D_80392448 +.float 5000.0 + +dlabel D_8039244C +.float 12000.0 + +dlabel D_80392450 +.float 0.6 + +dlabel jtbl_80392454 +.word L8038BF30_5B40, L8038BF40_5B50, L8038BF50_5B60, L8038BF60_5B70, L8038BF70_5B80, L8038BF80_5B90, 0 + +dlabel D_80392470 +.double 0.08 + +dlabel D_80392478 +.float 2.88, 0.0 + +dlabel D_80392480 +.double 0.35 + +dlabel D_80392488 +.double 0.65 + +dlabel D_80392490 +.float 0.3, 0.0 + +dlabel D_80392498 +.double 45.0 + +dlabel D_803924A0 +.double 0.3 + +dlabel D_803924A8 +.double 2.26 + +dlabel D_803924B0 +.double 182.04444 + +dlabel jtbl_803924B8 +.word L8038C92C_653C, L8038C980_6590, L8038CA48_6658, L8038CA48_6658, L8038CE68_6A78 + +dlabel D_803924CC +.float 0.95 + +dlabel D_803924D0 +.float 1.05 + +dlabel D_803924D4 +.float 5000.0 + +dlabel D_803924D8 +.float 0.95 + +dlabel D_803924DC +.float 1.05 + +dlabel D_803924E0 +.float 5000.0 + +dlabel D_803924E4 +.float 12000.0 + +dlabel D_803924E8 +.double 0.1 + +dlabel D_803924F0 +.double 0.8 + +dlabel D_803924F8 +.double 0.2 + +dlabel D_80392500 +.float 0.1 + +dlabel D_80392504 +.float 5000.0 + +dlabel D_80392508 +.float 12000.0 + +dlabel D_8039250C +.float 2500.0 + +dlabel D_80392510 +.double 0.98 + +dlabel D_80392518 +.float 1.15 + +dlabel D_8039251C +.float 0.1 + +dlabel D_80392520 +.float 2.26, 0.0, 0.0, 0.0 diff --git a/asm/ultra/exceptasm.s b/asm/ultra/exceptasm.s new file mode 100644 index 00000000..307ba0fa --- /dev/null +++ b/asm/ultra/exceptasm.s @@ -0,0 +1,707 @@ +#include +.include "macro.inc" + +# assembler directives +.set noat # allow manual use of $at +.set noreorder # don't insert nops after branches +.set gp=64 # allow use of 64-bit general purpose registers + +.data + +EXPORT(__osHwIntTable) +.word 0x0, 0x0, 0x0, 0x0, 0x0 + +.rdata +#define REDISPATCH 0x00 +#define SW1 0x04 +#define SW2 0x08 +#define RCP 0x0c +#define CART 0x10 +#define PRENMI 0x14 +#define IP6_HDLR 0x18 +#define IP7_HDLR 0x1c +#define COUNTER 0x20 +__osIntOffTable: +.byte REDISPATCH +.byte PRENMI +.byte IP6_HDLR +.byte IP6_HDLR +.byte IP7_HDLR +.byte IP7_HDLR +.byte IP7_HDLR +.byte IP7_HDLR +.byte COUNTER +.byte COUNTER +.byte IP6_HDLR +.byte IP6_HDLR +.byte IP7_HDLR +.byte IP7_HDLR +.byte IP7_HDLR +.byte IP7_HDLR +.byte REDISPATCH +.byte SW1 +.byte SW2 +.byte SW2 +.byte RCP +.byte RCP +.byte RCP +.byte RCP +.byte CART +.byte CART +.byte CART +.byte CART +.byte CART +.byte CART +.byte CART +.byte CART +__osIntTable: +.word redispatch, sw1, sw2, rcp, cart, prenmi, IP6_Hdlr, IP7_Hdlr, counter + +.text + +glabel __osExceptionPreamble +/* 2E60 80002260 3C1A8000 */ lui $k0, %hi(__osException) +/* 2E64 80002264 275A2280 */ addiu $k0, $k0, %lo(__osException) +/* 2E68 80002268 03400008 */ jr $k0 +/* 2E6C 8000226C 00000000 */ nop +endlabel __osExceptionPreamble + +# What is this? +glabel __osExceptionPreamble2 +/* 2E70 80002270 3C1A8000 */ lui $k0, %hi(__osException) +/* 2E74 80002274 275A2280 */ addiu $k0, $k0, %lo(__osException) +/* 2E78 80002278 03400008 */ jr $k0 +/* 2E7C 8000227C 00000000 */ nop +endlabel __osExceptionPreamble2 + +glabel __osException +/* 2E80 80002280 3C1A8000 */ lui $k0, %hi(__osThreadSave) +/* 2E84 80002284 275A72C0 */ addiu $k0, $k0, %lo(__osThreadSave) +/* 2E88 80002288 FF410020 */ sd $at, 0x20($k0) +/* 2E8C 8000228C 401B6000 */ mfc0 $k1, $12 +/* 2E90 80002290 AF5B0118 */ sw $k1, 0x118($k0) +/* 2E94 80002294 2401FFFC */ addiu $at, $zero, -4 +/* 2E98 80002298 0361D824 */ and $k1, $k1, $at +/* 2E9C 8000229C 409B6000 */ mtc0 $k1, $12 +/* 2EA0 800022A0 FF480058 */ sd $t0, 0x58($k0) +/* 2EA4 800022A4 FF490060 */ sd $t1, 0x60($k0) +/* 2EA8 800022A8 FF4A0068 */ sd $t2, 0x68($k0) +/* 2EAC 800022AC AF400018 */ sw $zero, 0x18($k0) +/* 2EB0 800022B0 40086800 */ mfc0 $t0, $13 +/* 2EB4 800022B4 03404025 */ or $t0, $k0, $zero +/* 2EB8 800022B8 3C1A8000 */ lui $k0, %hi(__osRunningThread) +/* 2EBC 800022BC 8F5A5130 */ lw $k0, %lo(__osRunningThread)($k0) +/* 2EC0 800022C0 DD090020 */ ld $t1, 0x20($t0) +/* 2EC4 800022C4 FF490020 */ sd $t1, 0x20($k0) +/* 2EC8 800022C8 DD090118 */ ld $t1, 0x118($t0) +/* 2ECC 800022CC FF490118 */ sd $t1, 0x118($k0) +/* 2ED0 800022D0 DD090058 */ ld $t1, 0x58($t0) +/* 2ED4 800022D4 FF490058 */ sd $t1, 0x58($k0) +/* 2ED8 800022D8 DD090060 */ ld $t1, 0x60($t0) +/* 2EDC 800022DC FF490060 */ sd $t1, 0x60($k0) +/* 2EE0 800022E0 DD090068 */ ld $t1, 0x68($t0) +/* 2EE4 800022E4 FF490068 */ sd $t1, 0x68($k0) +/* 2EE8 800022E8 8F5B0118 */ lw $k1, 0x118($k0) +/* 2EEC 800022EC 00004012 */ mflo $t0 +/* 2EF0 800022F0 FF480108 */ sd $t0, 0x108($k0) +/* 2EF4 800022F4 00004010 */ mfhi $t0 +/* 2EF8 800022F8 3369FF00 */ andi $t1, $k1, 0xff00 +/* 2EFC 800022FC FF420028 */ sd $v0, 0x28($k0) +/* 2F00 80002300 FF430030 */ sd $v1, 0x30($k0) +/* 2F04 80002304 FF440038 */ sd $a0, 0x38($k0) +/* 2F08 80002308 FF450040 */ sd $a1, 0x40($k0) +/* 2F0C 8000230C FF460048 */ sd $a2, 0x48($k0) +/* 2F10 80002310 FF470050 */ sd $a3, 0x50($k0) +/* 2F14 80002314 FF4B0070 */ sd $t3, 0x70($k0) +/* 2F18 80002318 FF4C0078 */ sd $t4, 0x78($k0) +/* 2F1C 8000231C FF4D0080 */ sd $t5, 0x80($k0) +/* 2F20 80002320 FF4E0088 */ sd $t6, 0x88($k0) +/* 2F24 80002324 FF4F0090 */ sd $t7, 0x90($k0) +/* 2F28 80002328 FF500098 */ sd $s0, 0x98($k0) +/* 2F2C 8000232C FF5100A0 */ sd $s1, 0xa0($k0) +/* 2F30 80002330 FF5200A8 */ sd $s2, 0xa8($k0) +/* 2F34 80002334 FF5300B0 */ sd $s3, 0xb0($k0) +/* 2F38 80002338 FF5400B8 */ sd $s4, 0xb8($k0) +/* 2F3C 8000233C FF5500C0 */ sd $s5, 0xc0($k0) +/* 2F40 80002340 FF5600C8 */ sd $s6, 0xc8($k0) +/* 2F44 80002344 FF5700D0 */ sd $s7, 0xd0($k0) +/* 2F48 80002348 FF5800D8 */ sd $t8, 0xd8($k0) +/* 2F4C 8000234C FF5900E0 */ sd $t9, 0xe0($k0) +/* 2F50 80002350 FF5C00E8 */ sd $gp, 0xe8($k0) +/* 2F54 80002354 FF5D00F0 */ sd $sp, 0xf0($k0) +/* 2F58 80002358 FF5E00F8 */ sd $fp, 0xf8($k0) +/* 2F5C 8000235C FF5F0100 */ sd $ra, 0x100($k0) +/* 2F60 80002360 1120000D */ beqz $t1, .L80002398 +/* 2F64 80002364 FF480110 */ sd $t0, 0x110($k0) +/* 2F68 80002368 3C088000 */ lui $t0, %hi(__OSGlobalIntMask) +/* 2F6C 8000236C 250850F0 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) +/* 2F70 80002370 8D080000 */ lw $t0, ($t0) +/* 2F74 80002374 2401FFFF */ addiu $at, $zero, -1 +/* 2F78 80002378 01014026 */ xor $t0, $t0, $at +/* 2F7C 8000237C 3C01FFFF */ lui $at, 0xffff +/* 2F80 80002380 3108FF00 */ andi $t0, $t0, 0xff00 +/* 2F84 80002384 342100FF */ ori $at, $at, 0xff +/* 2F88 80002388 01284825 */ or $t1, $t1, $t0 +/* 2F8C 8000238C 0361D824 */ and $k1, $k1, $at +/* 2F90 80002390 0369D825 */ or $k1, $k1, $t1 +/* 2F94 80002394 AF5B0118 */ sw $k1, 0x118($k0) +.L80002398: +/* 2F98 80002398 3C09A430 */ lui $t1, %hi(D_A430000C) +/* 2F9C 8000239C 8D29000C */ lw $t1, %lo(D_A430000C)($t1) +/* 2FA0 800023A0 5120000C */ beql $t1, $zero, .L800023D4 +/* 2FA4 800023A4 AF490128 */ sw $t1, 0x128($k0) +/* 2FA8 800023A8 3C088000 */ lui $t0, %hi(__OSGlobalIntMask) +/* 2FAC 800023AC 250850F0 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) +/* 2FB0 800023B0 8D080000 */ lw $t0, ($t0) +/* 2FB4 800023B4 8F4C0128 */ lw $t4, 0x128($k0) +/* 2FB8 800023B8 2401FFFF */ addiu $at, $zero, -1 +/* 2FBC 800023BC 00084402 */ srl $t0, $t0, 0x10 +/* 2FC0 800023C0 01014026 */ xor $t0, $t0, $at +/* 2FC4 800023C4 3108003F */ andi $t0, $t0, 0x3f +/* 2FC8 800023C8 010C4024 */ and $t0, $t0, $t4 +/* 2FCC 800023CC 01284825 */ or $t1, $t1, $t0 +/* 2FD0 800023D0 AF490128 */ sw $t1, 0x128($k0) +.L800023D4: +/* 2FD4 800023D4 40087000 */ mfc0 $t0, $14 +/* 2FD8 800023D8 AF48011C */ sw $t0, 0x11c($k0) +/* 2FDC 800023DC 8F480018 */ lw $t0, 0x18($k0) +/* 2FE0 800023E0 11000014 */ beqz $t0, .L80002434 +/* 2FE4 800023E4 00000000 */ nop +/* 2FE8 800023E8 4448F800 */ cfc1 $t0, $31 +/* 2FEC 800023EC 00000000 */ nop +/* 2FF0 800023F0 AF48012C */ sw $t0, 0x12c($k0) +/* 2FF4 800023F4 F7400130 */ sdc1 $f0, 0x130($k0) +/* 2FF8 800023F8 F7420138 */ sdc1 $f2, 0x138($k0) +/* 2FFC 800023FC F7440140 */ sdc1 $f4, 0x140($k0) +/* 3000 80002400 F7460148 */ sdc1 $f6, 0x148($k0) +/* 3004 80002404 F7480150 */ sdc1 $f8, 0x150($k0) +/* 3008 80002408 F74A0158 */ sdc1 $f10, 0x158($k0) +/* 300C 8000240C F74C0160 */ sdc1 $f12, 0x160($k0) +/* 3010 80002410 F74E0168 */ sdc1 $f14, 0x168($k0) +/* 3014 80002414 F7500170 */ sdc1 $f16, 0x170($k0) +/* 3018 80002418 F7520178 */ sdc1 $f18, 0x178($k0) +/* 301C 8000241C F7540180 */ sdc1 $f20, 0x180($k0) +/* 3020 80002420 F7560188 */ sdc1 $f22, 0x188($k0) +/* 3024 80002424 F7580190 */ sdc1 $f24, 0x190($k0) +/* 3028 80002428 F75A0198 */ sdc1 $f26, 0x198($k0) +/* 302C 8000242C F75C01A0 */ sdc1 $f28, 0x1a0($k0) +/* 3030 80002430 F75E01A8 */ sdc1 $f30, 0x1a8($k0) +.L80002434: +/* 3034 80002434 40086800 */ mfc0 $t0, $13 +/* 3038 80002438 AF480120 */ sw $t0, 0x120($k0) +/* 303C 8000243C 24090002 */ addiu $t1, $zero, 2 +/* 3040 80002440 A7490010 */ sh $t1, 0x10($k0) +/* 3044 80002444 3109007C */ andi $t1, $t0, 0x7c +/* 3048 80002448 240A0024 */ addiu $t2, $zero, 0x24 +/* 304C 8000244C 512A00B1 */ beql $t1, $t2, handle_break +/* 3050 80002450 24090001 */ addiu $t1, $zero, 1 +/* 3054 80002454 240A002C */ addiu $t2, $zero, 0x2c +/* 3058 80002458 112A00FF */ beq $t1, $t2, handle_CpU +/* 305C 8000245C 00000000 */ nop +/* 3060 80002460 240A0000 */ addiu $t2, $zero, 0 +/* 3064 80002464 152A00C3 */ bne $t1, $t2, .L80002774 +/* 3068 80002468 00000000 */ nop +/* 306C 8000246C 03688024 */ and $s0, $k1, $t0 +next_interrupt: +/* 3070 80002470 3209FF00 */ andi $t1, $s0, 0xff00 +/* 3074 80002474 00095302 */ srl $t2, $t1, 0xc +/* 3078 80002478 15400003 */ bnez $t2, .L80002488 +/* 307C 8000247C 00000000 */ nop +/* 3080 80002480 00095202 */ srl $t2, $t1, 8 +/* 3084 80002484 214A0010 */ addi $t2, $t2, 0x10 +.L80002488: +/* 3088 80002488 3C018000 */ lui $at, %hi(__osIntOffTable) +/* 308C 8000248C 002A0821 */ addu $at, $at, $t2 +/* 3090 80002490 902A5180 */ lbu $t2, %lo(__osIntOffTable)($at) +/* 3094 80002494 3C018000 */ lui $at, %hi(__osIntTable) +/* 3098 80002498 002A0821 */ addu $at, $at, $t2 +/* 309C 8000249C 8C2A51A0 */ lw $t2, %lo(__osIntTable)($at) +/* 30A0 800024A0 01400008 */ jr $t2 +/* 30A4 800024A4 00000000 */ nop +IP6_Hdlr: +/* 30A8 800024A8 2401DFFF */ addiu $at, $zero, -0x2001 +/* 30AC 800024AC 1000FFF0 */ b next_interrupt +/* 30B0 800024B0 02018024 */ and $s0, $s0, $at +IP7_Hdlr: +/* 30B4 800024B4 2401BFFF */ addiu $at, $zero, -0x4001 +/* 30B8 800024B8 1000FFED */ b next_interrupt +/* 30BC 800024BC 02018024 */ and $s0, $s0, $at +counter: +/* 30C0 800024C0 40095800 */ mfc0 $t1, $11 +/* 30C4 800024C4 40895800 */ mtc0 $t1, $11 +/* 30C8 800024C8 0C0009E9 */ jal send_mesg +/* 30CC 800024CC 24040018 */ addiu $a0, $zero, 0x18 +/* 30D0 800024D0 3C01FFFF */ lui $at, 0xffff +/* 30D4 800024D4 34217FFF */ ori $at, $at, 0x7fff +/* 30D8 800024D8 1000FFE5 */ b next_interrupt +/* 30DC 800024DC 02018024 */ and $s0, $s0, $at +cart: +/* 30E0 800024E0 2401F7FF */ addiu $at, $zero, -0x801 +/* 30E4 800024E4 02018024 */ and $s0, $s0, $at +/* 30E8 800024E8 240A0004 */ addiu $t2, $zero, 4 +/* 30EC 800024EC 3C018000 */ lui $at, %hi(__osHwIntTable) +/* 30F0 800024F0 002A0821 */ addu $at, $at, $t2 +/* 30F4 800024F4 8C2A5100 */ lw $t2, %lo(__osHwIntTable)($at) +/* 30F8 800024F8 3C1D8000 */ lui $sp, %hi(leoDiskStack) +/* 30FC 800024FC 27BD7470 */ addiu $sp, $sp, %lo(leoDiskStack) +/* 3100 80002500 24040010 */ addiu $a0, $zero, 0x10 +/* 3104 80002504 11400007 */ beqz $t2, .L80002524 +/* 3108 80002508 27BD0FF0 */ addiu $sp, $sp, 0xff0 +/* 310C 8000250C 0140F809 */ jalr $t2 +/* 3110 80002510 00000000 */ nop +/* 3114 80002514 10400003 */ beqz $v0, .L80002524 +/* 3118 80002518 00000000 */ nop +/* 311C 8000251C 10000082 */ b redispatch +/* 3120 80002520 00000000 */ nop +.L80002524: +/* 3124 80002524 0C0009E9 */ jal send_mesg +/* 3128 80002528 00000000 */ nop +/* 312C 8000252C 1000FFD1 */ b next_interrupt + 4 +/* 3130 80002530 3209FF00 */ andi $t1, $s0, 0xff00 +rcp: +/* 3134 80002534 3C088000 */ lui $t0, %hi(__OSGlobalIntMask) +/* 3138 80002538 250850F0 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) +/* 313C 8000253C 8D080000 */ lw $t0, ($t0) +/* 3140 80002540 3C11A430 */ lui $s1, %hi(D_A4300008) +/* 3144 80002544 8E310008 */ lw $s1, %lo(D_A4300008)($s1) +/* 3148 80002548 00084402 */ srl $t0, $t0, 0x10 +/* 314C 8000254C 02288824 */ and $s1, $s1, $t0 +/* 3150 80002550 32290001 */ andi $t1, $s1, 1 +/* 3154 80002554 51200014 */ beql $t1, $zero, .L800025A8 +/* 3158 80002558 32290008 */ andi $t1, $s1, 8 +/* 315C 8000255C 3C0CA404 */ lui $t4, %hi(D_A4040010) +/* 3160 80002560 8D8C0010 */ lw $t4, %lo(D_A4040010)($t4) +/* 3164 80002564 24090008 */ addiu $t1, $zero, 8 +/* 3168 80002568 3C01A404 */ lui $at, %hi(D_A4040010) +/* 316C 8000256C 318C0300 */ andi $t4, $t4, 0x300 +/* 3170 80002570 3231003E */ andi $s1, $s1, 0x3e +/* 3174 80002574 11800007 */ beqz $t4, .L80002594 +/* 3178 80002578 AC290010 */ sw $t1, %lo(D_A4040010)($at) +/* 317C 8000257C 0C0009E9 */ jal send_mesg +/* 3180 80002580 24040020 */ addiu $a0, $zero, 0x20 +/* 3184 80002584 52200039 */ beql $s1, $zero, .L8000266C +/* 3188 80002588 2401FBFF */ addiu $at, $zero, -0x401 +/* 318C 8000258C 10000006 */ b .L800025A8 +/* 3190 80002590 32290008 */ andi $t1, $s1, 8 +.L80002594: +/* 3194 80002594 0C0009E9 */ jal send_mesg +/* 3198 80002598 24040058 */ addiu $a0, $zero, 0x58 +/* 319C 8000259C 52200033 */ beql $s1, $zero, .L8000266C +/* 31A0 800025A0 2401FBFF */ addiu $at, $zero, -0x401 +/* 31A4 800025A4 32290008 */ andi $t1, $s1, 8 +.L800025A8: +/* 31A8 800025A8 11200007 */ beqz $t1, .L800025C8 +/* 31AC 800025AC 3C01A440 */ lui $at, %hi(D_A4400010) +/* 31B0 800025B0 32310037 */ andi $s1, $s1, 0x37 +/* 31B4 800025B4 AC200010 */ sw $zero, %lo(D_A4400010)($at) +/* 31B8 800025B8 0C0009E9 */ jal send_mesg +/* 31BC 800025BC 24040038 */ addiu $a0, $zero, 0x38 +/* 31C0 800025C0 5220002A */ beql $s1, $zero, .L8000266C +/* 31C4 800025C4 2401FBFF */ addiu $at, $zero, -0x401 +.L800025C8: +/* 31C8 800025C8 32290004 */ andi $t1, $s1, 4 +/* 31CC 800025CC 5120000A */ beql $t1, $zero, .L800025F8 +/* 31D0 800025D0 32290002 */ andi $t1, $s1, 2 +/* 31D4 800025D4 24090001 */ addiu $t1, $zero, 1 +/* 31D8 800025D8 3C01A450 */ lui $at, %hi(D_A450000C) +/* 31DC 800025DC 3231003B */ andi $s1, $s1, 0x3b +/* 31E0 800025E0 AC29000C */ sw $t1, %lo(D_A450000C)($at) +/* 31E4 800025E4 0C0009E9 */ jal send_mesg +/* 31E8 800025E8 24040030 */ addiu $a0, $zero, 0x30 +/* 31EC 800025EC 5220001F */ beql $s1, $zero, .L8000266C +/* 31F0 800025F0 2401FBFF */ addiu $at, $zero, -0x401 +/* 31F4 800025F4 32290002 */ andi $t1, $s1, 2 +.L800025F8: +/* 31F8 800025F8 11200007 */ beqz $t1, .L80002618 +/* 31FC 800025FC 3C01A480 */ lui $at, %hi(D_A4800018) +/* 3200 80002600 3231003D */ andi $s1, $s1, 0x3d +/* 3204 80002604 AC200018 */ sw $zero, %lo(D_A4800018)($at) +/* 3208 80002608 0C0009E9 */ jal send_mesg +/* 320C 8000260C 24040028 */ addiu $a0, $zero, 0x28 +/* 3210 80002610 52200016 */ beql $s1, $zero, .L8000266C +/* 3214 80002614 2401FBFF */ addiu $at, $zero, -0x401 +.L80002618: +/* 3218 80002618 32290010 */ andi $t1, $s1, 0x10 +/* 321C 8000261C 5120000A */ beql $t1, $zero, .L80002648 +/* 3220 80002620 32290020 */ andi $t1, $s1, 0x20 +/* 3224 80002624 24090002 */ addiu $t1, $zero, 2 +/* 3228 80002628 3C01A460 */ lui $at, %hi(D_A4600010) +/* 322C 8000262C 3231002F */ andi $s1, $s1, 0x2f +/* 3230 80002630 AC290010 */ sw $t1, %lo(D_A4600010)($at) +/* 3234 80002634 0C0009E9 */ jal send_mesg +/* 3238 80002638 24040040 */ addiu $a0, $zero, 0x40 +/* 323C 8000263C 5220000B */ beql $s1, $zero, .L8000266C +/* 3240 80002640 2401FBFF */ addiu $at, $zero, -0x401 +/* 3244 80002644 32290020 */ andi $t1, $s1, 0x20 +.L80002648: +/* 3248 80002648 51200008 */ beql $t1, $zero, .L8000266C +/* 324C 8000264C 2401FBFF */ addiu $at, $zero, -0x401 +/* 3250 80002650 24090800 */ addiu $t1, $zero, 0x800 +/* 3254 80002654 3C01A430 */ lui $at, 0xa430 +/* 3258 80002658 3231001F */ andi $s1, $s1, 0x1f +/* 325C 8000265C AC290000 */ sw $t1, ($at) +/* 3260 80002660 0C0009E9 */ jal send_mesg +/* 3264 80002664 24040048 */ addiu $a0, $zero, 0x48 +/* 3268 80002668 2401FBFF */ addiu $at, $zero, -0x401 +.L8000266C: +/* 326C 8000266C 1000FF80 */ b next_interrupt +/* 3270 80002670 02018024 */ and $s0, $s0, $at +prenmi: +/* 3274 80002674 8F5B0118 */ lw $k1, 0x118($k0) +/* 3278 80002678 2401EFFF */ addiu $at, $zero, -0x1001 +/* 327C 8000267C 3C098000 */ lui $t1, %hi(__osShutdown) +/* 3280 80002680 0361D824 */ and $k1, $k1, $at +/* 3284 80002684 AF5B0118 */ sw $k1, 0x118($k0) +/* 3288 80002688 252950EC */ addiu $t1, $t1, %lo(__osShutdown) +/* 328C 8000268C 8D2A0000 */ lw $t2, ($t1) +/* 3290 80002690 11400003 */ beqz $t2, firstnmi +/* 3294 80002694 2401EFFF */ addiu $at, $zero, -0x1001 +/* 3298 80002698 10000023 */ b redispatch +/* 329C 8000269C 02018024 */ and $s0, $s0, $at +firstnmi: +/* 32A0 800026A0 240A0001 */ addiu $t2, $zero, 1 +/* 32A4 800026A4 AD2A0000 */ sw $t2, ($t1) +/* 32A8 800026A8 0C0009E9 */ jal send_mesg +/* 32AC 800026AC 24040070 */ addiu $a0, $zero, 0x70 +/* 32B0 800026B0 3C0A8000 */ lui $t2, %hi(__osRunQueue) +/* 32B4 800026B4 8D4A5128 */ lw $t2, %lo(__osRunQueue)($t2) +/* 32B8 800026B8 2401EFFF */ addiu $at, $zero, -0x1001 +/* 32BC 800026BC 02018024 */ and $s0, $s0, $at +/* 32C0 800026C0 8D5B0118 */ lw $k1, 0x118($t2) +/* 32C4 800026C4 0361D824 */ and $k1, $k1, $at +/* 32C8 800026C8 10000017 */ b redispatch +/* 32CC 800026CC AD5B0118 */ sw $k1, 0x118($t2) +sw2: +/* 32D0 800026D0 2401FDFF */ addiu $at, $zero, -0x201 +/* 32D4 800026D4 01014024 */ and $t0, $t0, $at +/* 32D8 800026D8 40886800 */ mtc0 $t0, $13 +/* 32DC 800026DC 0C0009E9 */ jal send_mesg +/* 32E0 800026E0 24040008 */ addiu $a0, $zero, 8 +/* 32E4 800026E4 2401FDFF */ addiu $at, $zero, -0x201 +/* 32E8 800026E8 1000FF61 */ b next_interrupt +/* 32EC 800026EC 02018024 */ and $s0, $s0, $at +sw1: +/* 32F0 800026F0 2401FEFF */ addiu $at, $zero, -0x101 +/* 32F4 800026F4 01014024 */ and $t0, $t0, $at +/* 32F8 800026F8 40886800 */ mtc0 $t0, $13 +/* 32FC 800026FC 0C0009E9 */ jal send_mesg +/* 3300 80002700 24040000 */ addiu $a0, $zero, 0 +/* 3304 80002704 2401FEFF */ addiu $at, $zero, -0x101 +/* 3308 80002708 1000FF59 */ b next_interrupt +/* 330C 8000270C 02018024 */ and $s0, $s0, $at +/* 3310 80002710 24090001 */ addiu $t1, $zero, 1 +handle_break: +/* 3314 80002714 A7490012 */ sh $t1, 0x12($k0) +/* 3318 80002718 0C0009E9 */ jal send_mesg +/* 331C 8000271C 24040050 */ addiu $a0, $zero, 0x50 +/* 3320 80002720 10000001 */ b redispatch +/* 3324 80002724 00000000 */ nop +redispatch: +/* 3328 80002728 3C0A8000 */ lui $t2, %hi(__osRunQueue) +/* 332C 8000272C 8D4A5128 */ lw $t2, %lo(__osRunQueue)($t2) +/* 3330 80002730 8F490004 */ lw $t1, 4($k0) +/* 3334 80002734 8D4B0004 */ lw $t3, 4($t2) +/* 3338 80002738 012B082A */ slt $at, $t1, $t3 +/* 333C 8000273C 10200007 */ beqz $at, enqueueRunning +/* 3340 80002740 00000000 */ nop +/* 3344 80002744 3C048000 */ lui $a0, %hi(__osRunQueue) +/* 3348 80002748 03402825 */ or $a1, $k0, $zero +/* 334C 8000274C 0C000A63 */ jal __osEnqueueThread +/* 3350 80002750 24845128 */ addiu $a0, $a0, %lo(__osRunQueue) +/* 3354 80002754 08000A79 */ j __osDispatchThread +/* 3358 80002758 00000000 */ nop +enqueueRunning: +/* 335C 8000275C 3C098000 */ lui $t1, %hi(__osRunQueue) +/* 3360 80002760 25295128 */ addiu $t1, $t1, %lo(__osRunQueue) +/* 3364 80002764 8D2A0000 */ lw $t2, ($t1) +/* 3368 80002768 AF4A0000 */ sw $t2, ($k0) +/* 336C 8000276C 08000A79 */ j __osDispatchThread +/* 3370 80002770 AD3A0000 */ sw $k0, ($t1) +.L80002774: +/* 3374 80002774 3C018000 */ lui $at, %hi(__osFaultedThread) +/* 3378 80002778 AC3A5134 */ sw $k0, %lo(__osFaultedThread)($at) +/* 337C 8000277C 24090001 */ addiu $t1, $zero, 1 +/* 3380 80002780 A7490010 */ sh $t1, 0x10($k0) +/* 3384 80002784 24090002 */ addiu $t1, $zero, 2 +/* 3388 80002788 A7490012 */ sh $t1, 0x12($k0) +/* 338C 8000278C 400A4000 */ mfc0 $t2, $8 +/* 3390 80002790 AF4A0124 */ sw $t2, 0x124($k0) +/* 3394 80002794 0C0009E9 */ jal send_mesg +/* 3398 80002798 24040060 */ addiu $a0, $zero, 0x60 +/* 339C 8000279C 08000A79 */ j __osDispatchThread +/* 33A0 800027A0 00000000 */ nop +endlabel __osException + +glabel send_mesg +/* 33A4 800027A4 3C0A8001 */ lui $t2, %hi(__osEventStateTab) +/* 33A8 800027A8 254A8470 */ addiu $t2, $t2, %lo(__osEventStateTab) +/* 33AC 800027AC 01445021 */ addu $t2, $t2, $a0 +/* 33B0 800027B0 8D490000 */ lw $t1, ($t2) +/* 33B4 800027B4 03E09025 */ or $s2, $ra, $zero +/* 33B8 800027B8 11200025 */ beqz $t1, send_done +/* 33BC 800027BC 00000000 */ nop +/* 33C0 800027C0 8D2B0008 */ lw $t3, 8($t1) +/* 33C4 800027C4 8D2C0010 */ lw $t4, 0x10($t1) +/* 33C8 800027C8 016C082A */ slt $at, $t3, $t4 +/* 33CC 800027CC 10200020 */ beqz $at, send_done +/* 33D0 800027D0 00000000 */ nop +/* 33D4 800027D4 8D2D000C */ lw $t5, 0xc($t1) +/* 33D8 800027D8 01AB6821 */ addu $t5, $t5, $t3 +/* 33DC 800027DC 01AC001A */ div $zero, $t5, $t4 +/* 33E0 800027E0 15800002 */ bnez $t4, .L800027EC +/* 33E4 800027E4 00000000 */ nop +/* 33E8 800027E8 0007000D */ break 7 +.L800027EC: +/* 33EC 800027EC 2401FFFF */ addiu $at, $zero, -1 +/* 33F0 800027F0 15810004 */ bne $t4, $at, .L80002804 +/* 33F4 800027F4 3C018000 */ lui $at, 0x8000 +/* 33F8 800027F8 15A10002 */ bne $t5, $at, .L80002804 +/* 33FC 800027FC 00000000 */ nop +/* 3400 80002800 0006000D */ break 6 +.L80002804: +/* 3404 80002804 8D2C0014 */ lw $t4, 0x14($t1) +/* 3408 80002808 00006810 */ mfhi $t5 +/* 340C 8000280C 000D6880 */ sll $t5, $t5, 2 +/* 3410 80002810 018D6021 */ addu $t4, $t4, $t5 +/* 3414 80002814 8D4D0004 */ lw $t5, 4($t2) +/* 3418 80002818 256A0001 */ addiu $t2, $t3, 1 +/* 341C 8000281C AD8D0000 */ sw $t5, ($t4) +/* 3420 80002820 AD2A0008 */ sw $t2, 8($t1) +/* 3424 80002824 8D2A0000 */ lw $t2, ($t1) +/* 3428 80002828 8D4B0000 */ lw $t3, ($t2) +/* 342C 8000282C 11600008 */ beqz $t3, send_done +/* 3430 80002830 00000000 */ nop +/* 3434 80002834 0C000A75 */ jal __osPopThread +/* 3438 80002838 01202025 */ or $a0, $t1, $zero +/* 343C 8000283C 00405025 */ or $t2, $v0, $zero +/* 3440 80002840 3C048000 */ lui $a0, %hi(__osRunQueue) +/* 3444 80002844 01402825 */ or $a1, $t2, $zero +/* 3448 80002848 0C000A63 */ jal __osEnqueueThread +/* 344C 8000284C 24845128 */ addiu $a0, $a0, %lo(__osRunQueue) +send_done: +/* 3450 80002850 02400008 */ jr $s2 +/* 3454 80002854 00000000 */ nop +endlabel send_mesg + +glabel handle_CpU +/* 3458 80002858 3C013000 */ lui $at, 0x3000 +/* 345C 8000285C 01014824 */ and $t1, $t0, $at +/* 3460 80002860 00094F02 */ srl $t1, $t1, 0x1c +/* 3464 80002864 240A0001 */ addiu $t2, $zero, 1 +/* 3468 80002868 152AFFC2 */ bne $t1, $t2, .L80002774 +/* 346C 8000286C 00000000 */ nop +/* 3470 80002870 8F5B0118 */ lw $k1, 0x118($k0) +/* 3474 80002874 3C012000 */ lui $at, 0x2000 +/* 3478 80002878 24090001 */ addiu $t1, $zero, 1 +/* 347C 8000287C 0361D825 */ or $k1, $k1, $at +/* 3480 80002880 AF490018 */ sw $t1, 0x18($k0) +/* 3484 80002884 1000FFB5 */ b enqueueRunning +/* 3488 80002888 AF5B0118 */ sw $k1, 0x118($k0) +endlabel handle_CpU + +glabel __osEnqueueAndYield +/* 348C 8000288C 3C058000 */ lui $a1, %hi(__osRunningThread) +/* 3490 80002890 8CA55130 */ lw $a1, %lo(__osRunningThread)($a1) +/* 3494 80002894 40086000 */ mfc0 $t0, $12 +/* 3498 80002898 8CBB0018 */ lw $k1, 0x18($a1) +/* 349C 8000289C 35080002 */ ori $t0, $t0, 2 +/* 34A0 800028A0 ACA80118 */ sw $t0, 0x118($a1) +/* 34A4 800028A4 FCB00098 */ sd $s0, 0x98($a1) +/* 34A8 800028A8 FCB100A0 */ sd $s1, 0xa0($a1) +/* 34AC 800028AC FCB200A8 */ sd $s2, 0xa8($a1) +/* 34B0 800028B0 FCB300B0 */ sd $s3, 0xb0($a1) +/* 34B4 800028B4 FCB400B8 */ sd $s4, 0xb8($a1) +/* 34B8 800028B8 FCB500C0 */ sd $s5, 0xc0($a1) +/* 34BC 800028BC FCB600C8 */ sd $s6, 0xc8($a1) +/* 34C0 800028C0 FCB700D0 */ sd $s7, 0xd0($a1) +/* 34C4 800028C4 FCBC00E8 */ sd $gp, 0xe8($a1) +/* 34C8 800028C8 FCBD00F0 */ sd $sp, 0xf0($a1) +/* 34CC 800028CC FCBE00F8 */ sd $fp, 0xf8($a1) +/* 34D0 800028D0 FCBF0100 */ sd $ra, 0x100($a1) +/* 34D4 800028D4 13600009 */ beqz $k1, .L800028FC +/* 34D8 800028D8 ACBF011C */ sw $ra, 0x11c($a1) +/* 34DC 800028DC 445BF800 */ cfc1 $k1, $31 +/* 34E0 800028E0 F4B40180 */ sdc1 $f20, 0x180($a1) +/* 34E4 800028E4 F4B60188 */ sdc1 $f22, 0x188($a1) +/* 34E8 800028E8 F4B80190 */ sdc1 $f24, 0x190($a1) +/* 34EC 800028EC F4BA0198 */ sdc1 $f26, 0x198($a1) +/* 34F0 800028F0 F4BC01A0 */ sdc1 $f28, 0x1a0($a1) +/* 34F4 800028F4 F4BE01A8 */ sdc1 $f30, 0x1a8($a1) +/* 34F8 800028F8 ACBB012C */ sw $k1, 0x12c($a1) +.L800028FC: +/* 34FC 800028FC 8CBB0118 */ lw $k1, 0x118($a1) +/* 3500 80002900 3369FF00 */ andi $t1, $k1, 0xff00 +/* 3504 80002904 5120000E */ beql $t1, $zero, .L80002940 +/* 3508 80002908 3C1BA430 */ lui $k1, 0xa430 +/* 350C 8000290C 3C088000 */ lui $t0, %hi(__OSGlobalIntMask) +/* 3510 80002910 250850F0 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) +/* 3514 80002914 8D080000 */ lw $t0, ($t0) +/* 3518 80002918 2401FFFF */ addiu $at, $zero, -1 +/* 351C 8000291C 01014026 */ xor $t0, $t0, $at +/* 3520 80002920 3C01FFFF */ lui $at, 0xffff +/* 3524 80002924 3108FF00 */ andi $t0, $t0, 0xff00 +/* 3528 80002928 342100FF */ ori $at, $at, 0xff +/* 352C 8000292C 01284825 */ or $t1, $t1, $t0 +/* 3530 80002930 0361D824 */ and $k1, $k1, $at +/* 3534 80002934 0369D825 */ or $k1, $k1, $t1 +/* 3538 80002938 ACBB0118 */ sw $k1, 0x118($a1) +/* 353C 8000293C 3C1BA430 */ lui $k1, %hi(D_A430000C) +.L80002940: +/* 3540 80002940 8F7B000C */ lw $k1, %lo(D_A430000C)($k1) +/* 3544 80002944 1360000B */ beqz $k1, .L80002974 +/* 3548 80002948 00000000 */ nop +/* 354C 8000294C 3C1A8000 */ lui $k0, %hi(__OSGlobalIntMask) +/* 3550 80002950 275A50F0 */ addiu $k0, $k0, %lo(__OSGlobalIntMask) +/* 3554 80002954 8F5A0000 */ lw $k0, ($k0) +/* 3558 80002958 8CA80128 */ lw $t0, 0x128($a1) +/* 355C 8000295C 2401FFFF */ addiu $at, $zero, -1 +/* 3560 80002960 001AD402 */ srl $k0, $k0, 0x10 +/* 3564 80002964 0341D026 */ xor $k0, $k0, $at +/* 3568 80002968 335A003F */ andi $k0, $k0, 0x3f +/* 356C 8000296C 0348D024 */ and $k0, $k0, $t0 +/* 3570 80002970 037AD825 */ or $k1, $k1, $k0 +.L80002974: +/* 3574 80002974 10800003 */ beqz $a0, .L80002984 +/* 3578 80002978 ACBB0128 */ sw $k1, 0x128($a1) +/* 357C 8000297C 0C000A63 */ jal __osEnqueueThread +/* 3580 80002980 00000000 */ nop +.L80002984: +/* 3584 80002984 08000A79 */ j __osDispatchThread +/* 3588 80002988 00000000 */ nop +endlabel __osEnqueueAndYield + +glabel __osEnqueueThread +/* 358C 8000298C 8C980000 */ lw $t8, ($a0) +/* 3590 80002990 8CAF0004 */ lw $t7, 4($a1) +/* 3594 80002994 0080C825 */ or $t9, $a0, $zero +/* 3598 80002998 8F0E0004 */ lw $t6, 4($t8) +/* 359C 8000299C 01CF082A */ slt $at, $t6, $t7 +/* 35A0 800029A0 54200008 */ bnel $at, $zero, .L800029C4 +/* 35A4 800029A4 8F380000 */ lw $t8, ($t9) +/* 35A8 800029A8 0300C825 */ or $t9, $t8, $zero +.L800029AC: +/* 35AC 800029AC 8F180000 */ lw $t8, ($t8) +/* 35B0 800029B0 8F0E0004 */ lw $t6, 4($t8) +/* 35B4 800029B4 01CF082A */ slt $at, $t6, $t7 +/* 35B8 800029B8 5020FFFC */ beql $at, $zero, .L800029AC +/* 35BC 800029BC 0300C825 */ or $t9, $t8, $zero +/* 35C0 800029C0 8F380000 */ lw $t8, ($t9) +.L800029C4: +/* 35C4 800029C4 ACB80000 */ sw $t8, ($a1) +/* 35C8 800029C8 AF250000 */ sw $a1, ($t9) +/* 35CC 800029CC 03E00008 */ jr $ra +/* 35D0 800029D0 ACA40008 */ sw $a0, 8($a1) +endlabel __osEnqueueThread + +glabel __osPopThread +/* 35D4 800029D4 8C820000 */ lw $v0, ($a0) +/* 35D8 800029D8 8C590000 */ lw $t9, ($v0) +/* 35DC 800029DC 03E00008 */ jr $ra +/* 35E0 800029E0 AC990000 */ sw $t9, ($a0) +endlabel __osPopThread + +glabel __osDispatchThread +/* 35E4 800029E4 3C048000 */ lui $a0, %hi(__osRunQueue) +/* 35E8 800029E8 0C000A75 */ jal __osPopThread +/* 35EC 800029EC 24845128 */ addiu $a0, $a0, %lo(__osRunQueue) +/* 35F0 800029F0 3C018000 */ lui $at, %hi(__osRunningThread) +/* 35F4 800029F4 AC225130 */ sw $v0, %lo(__osRunningThread)($at) +/* 35F8 800029F8 24080004 */ addiu $t0, $zero, 4 +/* 35FC 800029FC A4480010 */ sh $t0, 0x10($v0) +/* 3600 80002A00 0040D025 */ or $k0, $v0, $zero +/* 3604 80002A04 3C088000 */ lui $t0, %hi(__OSGlobalIntMask) +/* 3608 80002A08 8F5B0118 */ lw $k1, 0x118($k0) +/* 360C 80002A0C 250850F0 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) +/* 3610 80002A10 8D080000 */ lw $t0, ($t0) +/* 3614 80002A14 3C01FFFF */ lui $at, 0xffff +/* 3618 80002A18 3369FF00 */ andi $t1, $k1, 0xff00 +/* 361C 80002A1C 342100FF */ ori $at, $at, 0xff +/* 3620 80002A20 3108FF00 */ andi $t0, $t0, 0xff00 +/* 3624 80002A24 01284824 */ and $t1, $t1, $t0 +/* 3628 80002A28 0361D824 */ and $k1, $k1, $at +/* 362C 80002A2C 0369D825 */ or $k1, $k1, $t1 +/* 3630 80002A30 409B6000 */ mtc0 $k1, $12 +/* 3634 80002A34 DF5B0108 */ ld $k1, 0x108($k0) +/* 3638 80002A38 DF410020 */ ld $at, 0x20($k0) +/* 363C 80002A3C DF420028 */ ld $v0, 0x28($k0) +/* 3640 80002A40 03600013 */ mtlo $k1 +/* 3644 80002A44 DF5B0110 */ ld $k1, 0x110($k0) +/* 3648 80002A48 DF430030 */ ld $v1, 0x30($k0) +/* 364C 80002A4C DF440038 */ ld $a0, 0x38($k0) +/* 3650 80002A50 DF450040 */ ld $a1, 0x40($k0) +/* 3654 80002A54 DF460048 */ ld $a2, 0x48($k0) +/* 3658 80002A58 DF470050 */ ld $a3, 0x50($k0) +/* 365C 80002A5C DF480058 */ ld $t0, 0x58($k0) +/* 3660 80002A60 DF490060 */ ld $t1, 0x60($k0) +/* 3664 80002A64 DF4A0068 */ ld $t2, 0x68($k0) +/* 3668 80002A68 DF4B0070 */ ld $t3, 0x70($k0) +/* 366C 80002A6C DF4C0078 */ ld $t4, 0x78($k0) +/* 3670 80002A70 DF4D0080 */ ld $t5, 0x80($k0) +/* 3674 80002A74 DF4E0088 */ ld $t6, 0x88($k0) +/* 3678 80002A78 DF4F0090 */ ld $t7, 0x90($k0) +/* 367C 80002A7C DF500098 */ ld $s0, 0x98($k0) +/* 3680 80002A80 DF5100A0 */ ld $s1, 0xa0($k0) +/* 3684 80002A84 DF5200A8 */ ld $s2, 0xa8($k0) +/* 3688 80002A88 DF5300B0 */ ld $s3, 0xb0($k0) +/* 368C 80002A8C DF5400B8 */ ld $s4, 0xb8($k0) +/* 3690 80002A90 DF5500C0 */ ld $s5, 0xc0($k0) +/* 3694 80002A94 DF5600C8 */ ld $s6, 0xc8($k0) +/* 3698 80002A98 DF5700D0 */ ld $s7, 0xd0($k0) +/* 369C 80002A9C DF5800D8 */ ld $t8, 0xd8($k0) +/* 36A0 80002AA0 DF5900E0 */ ld $t9, 0xe0($k0) +/* 36A4 80002AA4 DF5C00E8 */ ld $gp, 0xe8($k0) +/* 36A8 80002AA8 03600011 */ mthi $k1 +/* 36AC 80002AAC DF5D00F0 */ ld $sp, 0xf0($k0) +/* 36B0 80002AB0 DF5E00F8 */ ld $fp, 0xf8($k0) +/* 36B4 80002AB4 DF5F0100 */ ld $ra, 0x100($k0) +/* 36B8 80002AB8 8F5B011C */ lw $k1, 0x11c($k0) +/* 36BC 80002ABC 409B7000 */ mtc0 $k1, $14 +/* 36C0 80002AC0 8F5B0018 */ lw $k1, 0x18($k0) +/* 36C4 80002AC4 13600013 */ beqz $k1, .L80002B14 +/* 36C8 80002AC8 00000000 */ nop +/* 36CC 80002ACC 8F5B012C */ lw $k1, 0x12c($k0) +/* 36D0 80002AD0 44DBF800 */ ctc1 $k1, $31 +/* 36D4 80002AD4 D7400130 */ ldc1 $f0, 0x130($k0) +/* 36D8 80002AD8 D7420138 */ ldc1 $f2, 0x138($k0) +/* 36DC 80002ADC D7440140 */ ldc1 $f4, 0x140($k0) +/* 36E0 80002AE0 D7460148 */ ldc1 $f6, 0x148($k0) +/* 36E4 80002AE4 D7480150 */ ldc1 $f8, 0x150($k0) +/* 36E8 80002AE8 D74A0158 */ ldc1 $f10, 0x158($k0) +/* 36EC 80002AEC D74C0160 */ ldc1 $f12, 0x160($k0) +/* 36F0 80002AF0 D74E0168 */ ldc1 $f14, 0x168($k0) +/* 36F4 80002AF4 D7500170 */ ldc1 $f16, 0x170($k0) +/* 36F8 80002AF8 D7520178 */ ldc1 $f18, 0x178($k0) +/* 36FC 80002AFC D7540180 */ ldc1 $f20, 0x180($k0) +/* 3700 80002B00 D7560188 */ ldc1 $f22, 0x188($k0) +/* 3704 80002B04 D7580190 */ ldc1 $f24, 0x190($k0) +/* 3708 80002B08 D75A0198 */ ldc1 $f26, 0x198($k0) +/* 370C 80002B0C D75C01A0 */ ldc1 $f28, 0x1a0($k0) +/* 3710 80002B10 D75E01A8 */ ldc1 $f30, 0x1a8($k0) +.L80002B14: +/* 3714 80002B14 8F5B0128 */ lw $k1, 0x128($k0) +/* 3718 80002B18 3C1A8000 */ lui $k0, %hi(__OSGlobalIntMask) +/* 371C 80002B1C 275A50F0 */ addiu $k0, $k0, %lo(__OSGlobalIntMask) +/* 3720 80002B20 8F5A0000 */ lw $k0, ($k0) +/* 3724 80002B24 001AD402 */ srl $k0, $k0, 0x10 +/* 3728 80002B28 037AD824 */ and $k1, $k1, $k0 +/* 372C 80002B2C 001BD840 */ sll $k1, $k1, 1 +/* 3730 80002B30 3C1A8000 */ lui $k0, %hi(__osRcpImTable) +/* 3734 80002B34 275A51D0 */ addiu $k0, $k0, %lo(__osRcpImTable) +/* 3738 80002B38 037AD821 */ addu $k1, $k1, $k0 +/* 373C 80002B3C 977B0000 */ lhu $k1, ($k1) +/* 3740 80002B40 3C1AA430 */ lui $k0, %hi(D_A430000C) +/* 3744 80002B44 275A000C */ addiu $k0, $k0, %lo(D_A430000C) +/* 3748 80002B48 AF5B0000 */ sw $k1, ($k0) +/* 374C 80002B4C 00000000 */ nop +/* 3750 80002B50 00000000 */ nop +/* 3754 80002B54 00000000 */ nop +/* 3758 80002B58 00000000 */ nop +/* 375C 80002B5C 42000018 */ eret +endlabel __osDispatchThread + +glabel __osCleanupThread +/* 3760 80002B60 0C000EB4 */ jal osDestroyThread +/* 3764 80002B64 00002025 */ or $a0, $zero, $zero +/* 3768 80002B68 00000000 */ nop +/* 376C 80002B6C 00000000 */ nop +endlabel __osCleanupThread diff --git a/asm/ultra/setintmask.s b/asm/ultra/setintmask.s new file mode 100644 index 00000000..5af09ba5 --- /dev/null +++ b/asm/ultra/setintmask.s @@ -0,0 +1,135 @@ +#include +.include "macro.inc" +# assembler directives +.set noat # allow manual use of $at +.set gp=64 # allow use of 64-bit general purpose registers + +.rdata + +#define MI_INTR_MASK 0x3f +#define CLR_SP 0x0001 +#define SET_SP 0x0002 +#define CLR_SI 0x0004 +#define SET_SI 0x0008 +#define CLR_AI 0x0010 +#define SET_AI 0x0020 +#define CLR_VI 0x0040 +#define SET_VI 0x0080 +#define CLR_PI 0x0100 +#define SET_PI 0x0200 +#define CLR_DP 0x0400 +#define SET_DP 0x0800 + +EXPORT(__osRcpImTable) +/* LUT to convert between MI_INTR and MI_INTR_MASK */ +/* MI_INTR is status for each interrupt whereas */ +/* MI_INTR_MASK has seperate bits for set/clr */ +.half CLR_SP | CLR_SI | CLR_AI | CLR_VI | CLR_PI | CLR_DP +.half SET_SP | CLR_SI | CLR_AI | CLR_VI | CLR_PI | CLR_DP +.half CLR_SP | SET_SI | CLR_AI | CLR_VI | CLR_PI | CLR_DP +.half SET_SP | SET_SI | CLR_AI | CLR_VI | CLR_PI | CLR_DP +.half CLR_SP | CLR_SI | SET_AI | CLR_VI | CLR_PI | CLR_DP +.half SET_SP | CLR_SI | SET_AI | CLR_VI | CLR_PI | CLR_DP +.half CLR_SP | SET_SI | SET_AI | CLR_VI | CLR_PI | CLR_DP +.half SET_SP | SET_SI | SET_AI | CLR_VI | CLR_PI | CLR_DP +.half CLR_SP | CLR_SI | CLR_AI | SET_VI | CLR_PI | CLR_DP +.half SET_SP | CLR_SI | CLR_AI | SET_VI | CLR_PI | CLR_DP +.half CLR_SP | SET_SI | CLR_AI | SET_VI | CLR_PI | CLR_DP +.half SET_SP | SET_SI | CLR_AI | SET_VI | CLR_PI | CLR_DP +.half CLR_SP | CLR_SI | SET_AI | SET_VI | CLR_PI | CLR_DP +.half SET_SP | CLR_SI | SET_AI | SET_VI | CLR_PI | CLR_DP +.half CLR_SP | SET_SI | SET_AI | SET_VI | CLR_PI | CLR_DP +.half SET_SP | SET_SI | SET_AI | SET_VI | CLR_PI | CLR_DP +.half CLR_SP | CLR_SI | CLR_AI | CLR_VI | SET_PI | CLR_DP +.half SET_SP | CLR_SI | CLR_AI | CLR_VI | SET_PI | CLR_DP +.half CLR_SP | SET_SI | CLR_AI | CLR_VI | SET_PI | CLR_DP +.half SET_SP | SET_SI | CLR_AI | CLR_VI | SET_PI | CLR_DP +.half CLR_SP | CLR_SI | SET_AI | CLR_VI | SET_PI | CLR_DP +.half SET_SP | CLR_SI | SET_AI | CLR_VI | SET_PI | CLR_DP +.half CLR_SP | SET_SI | SET_AI | CLR_VI | SET_PI | CLR_DP +.half SET_SP | SET_SI | SET_AI | CLR_VI | SET_PI | CLR_DP +.half CLR_SP | CLR_SI | CLR_AI | SET_VI | SET_PI | CLR_DP +.half SET_SP | CLR_SI | CLR_AI | SET_VI | SET_PI | CLR_DP +.half CLR_SP | SET_SI | CLR_AI | SET_VI | SET_PI | CLR_DP +.half SET_SP | SET_SI | CLR_AI | SET_VI | SET_PI | CLR_DP +.half CLR_SP | CLR_SI | SET_AI | SET_VI | SET_PI | CLR_DP +.half SET_SP | CLR_SI | SET_AI | SET_VI | SET_PI | CLR_DP +.half CLR_SP | SET_SI | SET_AI | SET_VI | SET_PI | CLR_DP +.half SET_SP | SET_SI | SET_AI | SET_VI | SET_PI | CLR_DP +.half CLR_SP | CLR_SI | CLR_AI | CLR_VI | CLR_PI | SET_DP +.half SET_SP | CLR_SI | CLR_AI | CLR_VI | CLR_PI | SET_DP +.half CLR_SP | SET_SI | CLR_AI | CLR_VI | CLR_PI | SET_DP +.half SET_SP | SET_SI | CLR_AI | CLR_VI | CLR_PI | SET_DP +.half CLR_SP | CLR_SI | SET_AI | CLR_VI | CLR_PI | SET_DP +.half SET_SP | CLR_SI | SET_AI | CLR_VI | CLR_PI | SET_DP +.half CLR_SP | SET_SI | SET_AI | CLR_VI | CLR_PI | SET_DP +.half SET_SP | SET_SI | SET_AI | CLR_VI | CLR_PI | SET_DP +.half CLR_SP | CLR_SI | CLR_AI | SET_VI | CLR_PI | SET_DP +.half SET_SP | CLR_SI | CLR_AI | SET_VI | CLR_PI | SET_DP +.half CLR_SP | SET_SI | CLR_AI | SET_VI | CLR_PI | SET_DP +.half SET_SP | SET_SI | CLR_AI | SET_VI | CLR_PI | SET_DP +.half CLR_SP | CLR_SI | SET_AI | SET_VI | CLR_PI | SET_DP +.half SET_SP | CLR_SI | SET_AI | SET_VI | CLR_PI | SET_DP +.half CLR_SP | SET_SI | SET_AI | SET_VI | CLR_PI | SET_DP +.half SET_SP | SET_SI | SET_AI | SET_VI | CLR_PI | SET_DP +.half CLR_SP | CLR_SI | CLR_AI | CLR_VI | SET_PI | SET_DP +.half SET_SP | CLR_SI | CLR_AI | CLR_VI | SET_PI | SET_DP +.half CLR_SP | SET_SI | CLR_AI | CLR_VI | SET_PI | SET_DP +.half SET_SP | SET_SI | CLR_AI | CLR_VI | SET_PI | SET_DP +.half CLR_SP | CLR_SI | SET_AI | CLR_VI | SET_PI | SET_DP +.half SET_SP | CLR_SI | SET_AI | CLR_VI | SET_PI | SET_DP +.half CLR_SP | SET_SI | SET_AI | CLR_VI | SET_PI | SET_DP +.half SET_SP | SET_SI | SET_AI | CLR_VI | SET_PI | SET_DP +.half CLR_SP | CLR_SI | CLR_AI | SET_VI | SET_PI | SET_DP +.half SET_SP | CLR_SI | CLR_AI | SET_VI | SET_PI | SET_DP +.half CLR_SP | SET_SI | CLR_AI | SET_VI | SET_PI | SET_DP +.half SET_SP | SET_SI | CLR_AI | SET_VI | SET_PI | SET_DP +.half CLR_SP | CLR_SI | SET_AI | SET_VI | SET_PI | SET_DP +.half SET_SP | CLR_SI | SET_AI | SET_VI | SET_PI | SET_DP +.half CLR_SP | SET_SI | SET_AI | SET_VI | SET_PI | SET_DP +.half SET_SP | SET_SI | SET_AI | SET_VI | SET_PI | SET_DP +.text +.set noreorder +glabel func_80003A30 +/* 4630 80003A30 400C6000 */ mfc0 $t4, $12 +/* 4634 80003A34 3182FF01 */ andi $v0, $t4, 0xff01 +/* 4638 80003A38 3C088000 */ lui $t0, %hi(__OSGlobalIntMask) +/* 463C 80003A3C 250850F0 */ addiu $t0, $t0, %lo(__OSGlobalIntMask) +/* 4640 80003A40 8D0B0000 */ lw $t3, ($t0) +/* 4644 80003A44 2401FFFF */ addiu $at, $zero, -1 +/* 4648 80003A48 01614026 */ xor $t0, $t3, $at +/* 464C 80003A4C 3108FF00 */ andi $t0, $t0, 0xff00 +/* 4650 80003A50 00481025 */ or $v0, $v0, $t0 +/* 4654 80003A54 3C0AA430 */ lui $t2, %hi(D_A430000C) +/* 4658 80003A58 8D4A000C */ lw $t2, %lo(D_A430000C)($t2) +/* 465C 80003A5C 11400005 */ beqz $t2, .L80003A74 +/* 4660 80003A60 000B4C02 */ srl $t1, $t3, 0x10 +/* 4664 80003A64 2401FFFF */ addiu $at, $zero, -1 +/* 4668 80003A68 01214826 */ xor $t1, $t1, $at +/* 466C 80003A6C 3129003F */ andi $t1, $t1, 0x3f +/* 4670 80003A70 01495025 */ or $t2, $t2, $t1 +.L80003A74: +/* 4674 80003A74 000A5400 */ sll $t2, $t2, 0x10 +/* 4678 80003A78 004A1025 */ or $v0, $v0, $t2 +/* 467C 80003A7C 3C01003F */ lui $at, 0x3f +/* 4680 80003A80 00814024 */ and $t0, $a0, $at +/* 4684 80003A84 010B4024 */ and $t0, $t0, $t3 +/* 4688 80003A88 000843C2 */ srl $t0, $t0, 0xf +/* 468C 80003A8C 3C0A8000 */ lui $t2, %hi(__osRcpImTable) +/* 4690 80003A90 01485021 */ addu $t2, $t2, $t0 +/* 4694 80003A94 954A51D0 */ lhu $t2, %lo(__osRcpImTable)($t2) +/* 4698 80003A98 3C01A430 */ lui $at, %hi(D_A430000C) +/* 469C 80003A9C AC2A000C */ sw $t2, %lo(D_A430000C)($at) +/* 46A0 80003AA0 3088FF01 */ andi $t0, $a0, 0xff01 +/* 46A4 80003AA4 3169FF00 */ andi $t1, $t3, 0xff00 +/* 46A8 80003AA8 01094024 */ and $t0, $t0, $t1 +/* 46AC 80003AAC 3C01FFFF */ lui $at, 0xffff +/* 46B0 80003AB0 342100FF */ ori $at, $at, 0xff +/* 46B4 80003AB4 01816024 */ and $t4, $t4, $at +/* 46B8 80003AB8 01886025 */ or $t4, $t4, $t0 +/* 46BC 80003ABC 408C6000 */ mtc0 $t4, $12 +/* 46C0 80003AC0 00000000 */ nop +/* 46C4 80003AC4 00000000 */ nop +/* 46C8 80003AC8 03E00008 */ jr $ra +/* 46CC 80003ACC 00000000 */ nop +endlabel func_80003A30 diff --git a/banjo.jp.yaml b/banjo.jp.yaml new file mode 100644 index 00000000..1773c085 --- /dev/null +++ b/banjo.jp.yaml @@ -0,0 +1,86 @@ +options: + basename: banjo + find_file_boundaries: true + compiler: "\"IDO\"" + undefined_syms_path: undefined_syms.jp.txt +segments: + - name: header + type: header + start: 0x00000000 + subsegments: + - [0x00000000, header, header] + - name: boot + type: bin + start: 0x00000040 + - name: bk_boot + type: code + start: 0x00001000 + vram: 0x80000400 + subsegments: + - [0x00001000, asm] + - name: assets + type: bin + start: 0x00005E90 + subsegments: + - [0x00005E90, bin, assets] + - name: soundfont1 + type: bin + start: 0x00DA80A0 + subsegments: + - [0x00DA80A0, bin, soundfont1.ctl] + - [0x00DB8E90, bin, soundfont1.tbl] + - name: soundfont2 + type: bin + start: 0x00EC7890 + subsegments: + - [0x00EC7890, bin, soundfont2.ctl] + - [0x00ED16F0, bin, soundfont2.tbl] + - name: core1.jp.rzip + type: bin + start: 0x00F3CC30 + - name: core2.jp.rzip + type: bin + start: 0x00F5B1A0 + - name: level2.jp.rzip + type: bin + start: 0x00FC8190 + - name: level9.jp.rzip + type: bin + start: 0x00FCA100 + - name: level6.jp.rzip + type: bin + start: 0x00FCD300 + - name: level1.jp.rzip + type: bin + start: 0x00FD2AB0 + - name: level0.jp.rzip + type: bin + start: 0x00FD6710 + - name: level3.jp.rzip + type: bin + start: 0x00FD8740 + - name: level8.jp.rzip + type: bin + start: 0x00FDDC80 + - name: level4.jp.rzip + type: bin + start: 0x00FE2E60 + - name: level10.jp.rzip + type: bin + start: 0x00FE8A90 + - name: level12.jp.rzip + type: bin + start: 0x00FEB1A0 + - name: level5.jp.rzip + type: bin + start: 0x00FED3D0 + - name: level11.jp.rzip + type: bin + start: 0x00FF46E0 + - name: level7.jp.rzip + type: bin + start: 0x00FFA4D0 + - name: emptyLvl.jp.rzip + type: bin + start: 0x00FFED30 + - [0x01000000] \ No newline at end of file diff --git a/banjo.pal.yaml b/banjo.pal.yaml new file mode 100644 index 00000000..355b9b42 --- /dev/null +++ b/banjo.pal.yaml @@ -0,0 +1,185 @@ +options: + basename: banjo + find_file_boundaries: True + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.boot.pal.txt + undefined_funcs_auto_path: undefined_funcs_auto.pal.txt + undefined_syms_auto_path: undefined_syms_auto.pal.txt + base_path: . + target_path: baserom.pal.z64 + asset_path: bin + build_path: build/pal +segments: +- [0x0, bin, binner] +# - name: header +# type: header +# start: 0x00000000 +# - name: boot +# type: code +# start: 0x00000040 +# vram: 0xA4000040 +# subsegments: +# - [0x0040, asm, boot] +# - [0x0B70, bin, boot2] +# - name: entry +# type: code +# start: 0x1000 +# vram: 0x80000400 +# subsegments: +# - [0x1000, hasm, entry] +# - name: boot/bk_boot +# type: code +# start: 0x1050 +# vram: 0x80000450 +# subsegments: +# - [0x1050, c, done/bk_boot_1050] +# - [0x1150, c, done/rarezip] +# - [0x12B0, c, done/inflate] +# - [0x27F0, c, done/overlays] +# - [0x2970, c, done/initialize] +# - [0x2C00, c, done/pirawdma] +# - [0x2CE0, c, done/pigetstat] +# - [0x2CF0, hasm, bzero] +# - [0x2D90, hasm, setsr] +# - [0x2DA0, hasm, getsr] +# - [0x2DB0, hasm, setfpccsr] +# - [0x2DC0, c, done/sirawread] +# - [0x2E10, c, done/sirawwrite] +# - [0x2E60, hasm, ultra/exceptasm] +# - [0x3770, hasm, writebackdcache] +# - [0x37F0, hasm, invalicache] +# - [0x3870, hasm, maptlbrdb] +# - [0x38D0, c, done/pirawread] +# - [0x3930, c, done/ll] +# - [0x3BF0, bin, padding3BF0] # Empty space +# - [0x3C50, c, done/virtualtophysical] +# - [0x3CD0, c, done/si] +# - [0x3D00, c, done/thread] +# - [0x3D40, c, done/leointerrupt] +# - [0x45C0, c, done/seteventmesg] +# - [0x4630, hasm, ultra/setintmask] +# - [0x46D0, c, done/destroythread] +# - [0x47D0, hasm, probetlb] +# - [0x4890, c, done/leodiskinit] +# - [0x4990, c, done/epirawdma] +# - [0x4BC0, hasm, interrupt] +# - [0x4C00, c, done/pimgr] +# - [0x4D90, c, done/cartrominit] +# - [0x4E90, c, done/createmesgqueue] +# - [0x4EC0, c, done/piacs] +# - [0x4F80, c, done/getthreadpri] +# - [0x4FA0, c, done/setthreadpri] +# - [0x5080, c, done/createthread] +# - [0x51D0, c, done/devmgr] +# - [0x5660, c, done/startthread] +# - [0x57B0, c, done/sendmesg] +# - [0x5900, c, done/recvmesg] +# - [0x5A40, c, done/resetglobalintmask] +# - [0x5AA0, c, done/epirawwrite] +# - [0x5AF0, c, done/epirawread] +# - [0x5B40, c, done/setglobalintmask] +# - [0x5B90, c, done/yieldthread] +# - [0x5BE0, c, done/kdebugserver] +# - [0x5BE0, .data, done/inflate] +# - [0x5CE0, .data, done/initialize] +# - [0x5D00, .data, ultra/exceptasm] +# - [0x5D20, .data, done/thread] +# - [0x5D40, .data, done/pimgr] +# - [0x5D70, .data, done/piacs] +# - [0x5D80, .rodata, ultra/exceptasm] +# - [0x5DD0, .rodata, ultra/setintmask] +# - [0x5E50, .rodata, done/devmgr] +# - [0x5E70, .bss, done/bk_boot_1050] +# - [0x5E70, .bss, done/rarezip] +# - [0x5E70, .bss, done/inflate] +# - [0x5E70, .bss, done/initialize] +# - [0x5E70, .bss, done/kdebugserver] +# - [0x5E70, .bss, done/leointerrupt] +# - [0x5E70, .bss, done/seteventmesg] +# - [0x5E70, .bss, done/leodiskinit] +# - [0x5E70, .bss, done/pimgr] +# - [0x5E70, .bss, done/cartrominit] +# - [0x5E70, .bss, done/piacs] +# - name: crc +# type: bin +# start: 0x5E70 +# subsegments: +# - [0x5E70, bin, crc] +# - name: assets +# type: bin +# start: 0x5E90 +# subsegments: +# - [0x5E90, bin, assets] +# - name: soundfont1 +# type: bin +# start: 0x00DA8DF0 +# subsegments: +# - [0x00DA8DF0, bin, soundfont1.ctl] +# - [0x00DB9BE0, bin, soundfont1.tbl] +# - name: soundfont2 +# type: bin +# start: 0x00EC85E0 +# subsegments: +# - [0x00EC85E0, bin, soundfont2.ctl] +# - [0x00ED2440, bin, soundfont2.tbl] +# - name: core1.pal.rzip +# type: bin +# start: 0x00F3D980 +# - name: core2.pal.rzip +# type: bin +# start: 0x00F5BEC0 +# - name: CC.pal.rzip +# type: bin +# start: 0x00FC8460 +# - name: MMM.pal.rzip +# type: bin +# start: 0x00FCA3C0 +# - name: GV.pal.rzip +# type: bin +# start: 0x00FCD5C0 +# - name: TTC.pal.rzip +# type: bin +# start: 0x00FD2CC0 +# - name: MM.pal.rzip +# type: bin +# start: 0x00FD6900 +# - name: BGS.pal.rzip +# type: bin +# start: 0x00FD8930 +# - name: RBB.pal.rzip +# type: bin +# start: 0x00FDDE80 +# - name: FP.pal.rzip +# type: bin +# start: 0x00FE3060 +- name: SM.pal.rzip + type: bin + start: 0x00FE8CA0 +- name: cutscenes.pal.rzip + type: bin + start: 0x00FEB540 +# - name: lair.pal.rzip +# type: bin +# start: 0x00FED780 +# - name: fight.pal.rzip +# type: bin +# start: 0x00FF4A50 +# - name: CCW.pal.rzip +# type: bin +# start: 0x00FFA830 +# - name: emptyLvl.pal.rzip +# type: bin +# start: 0x00FFF090 +- [0x01000000] \ No newline at end of file diff --git a/banjo.us.v10.yaml b/banjo.us.v10.yaml new file mode 100644 index 00000000..dadd6fb0 --- /dev/null +++ b/banjo.us.v10.yaml @@ -0,0 +1,199 @@ +sha1: 1fe1632098865f639e22c11b9a81ee8f29c75d7a +options: + basename: banjo + find_file_boundaries: True + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.boot.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.us.v10.txt + base_path: . + target_path: baserom.us.v10.z64 + asset_path: bin + build_path: build/us.v10 +segments: +- name: header + type: header + start: 0x00000000 +- name: boot + type: code + start: 0x0040 + vram: 0xA4000040 + subsegments: + - [0x0040, asm, boot] + - [0x0B70, bin, boot2] +- name: entry + type: code + start: 0x1000 + vram: 0x80000400 + subsegments: + - [0x1000, hasm, entry] +- name: boot/bk_boot + type: code + start: 0x1050 + vram: 0x80000450 + subsegments: + - [0x1050, c, done/bk_boot_1050] + - [0x1150, c, done/rarezip] + - [0x12B0, c, done/inflate] + - [0x27F0, c, done/overlays] + - [0x2970, c, done/initialize] + - [0x2C00, c, done/pirawdma] + - [0x2CE0, c, done/pigetstat] + - [0x2CF0, hasm, bzero] + - [0x2D90, hasm, setsr] + - [0x2DA0, hasm, getsr] + - [0x2DB0, hasm, setfpccsr] + - [0x2DC0, c, done/sirawread] + - [0x2E10, c, done/sirawwrite] + - [0x2E60, hasm, ultra/exceptasm] + - [0x3770, hasm, writebackdcache] + - [0x37F0, hasm, invalicache] + - [0x3870, hasm, maptlbrdb] + - [0x38D0, c, done/pirawread] + - [0x3930, c, done/ll] + - [0x3BF0, bin, padding3BF0] # Empty space + - [0x3C50, c, done/virtualtophysical] + - [0x3CD0, c, done/si] + - [0x3D00, c, done/thread] + - [0x3D40, c, done/leointerrupt] + - [0x45C0, c, done/seteventmesg] + - [0x4630, hasm, ultra/setintmask] + - [0x46D0, c, done/destroythread] + - [0x47D0, hasm, probetlb] + - [0x4890, c, done/leodiskinit] + - [0x4990, c, done/epirawdma] + - [0x4BC0, hasm, interrupt] + - [0x4C00, c, done/pimgr] + - [0x4D90, c, done/cartrominit] + - [0x4E90, c, done/createmesgqueue] + - [0x4EC0, c, done/piacs] + - [0x4F80, c, done/getthreadpri] + - [0x4FA0, c, done/setthreadpri] + - [0x5080, c, done/createthread] + - [0x51D0, c, done/devmgr] + - [0x5660, c, done/startthread] + - [0x57B0, c, done/sendmesg] + - [0x5900, c, done/recvmesg] + - [0x5A40, c, done/resetglobalintmask] + - [0x5AA0, c, done/epirawwrite] + - [0x5AF0, c, done/epirawread] + - [0x5B40, c, done/setglobalintmask] + - [0x5B90, c, done/yieldthread] + - [0x5BE0, c, done/kdebugserver] + - [0x5BE0, .data, done/inflate] + - [0x5CE0, .data, done/initialize] + - [0x5D00, .data, ultra/exceptasm] + - [0x5D20, .data, done/thread] + - [0x5D40, .data, done/pimgr] + - [0x5D70, .data, done/piacs] + - [0x5D80, .rodata, ultra/exceptasm] + - [0x5DD0, .rodata, ultra/setintmask] + - [0x5E50, .rodata, done/devmgr] + - [0x5E70, .bss, done/bk_boot_1050] + - [0x5E70, .bss, done/rarezip] + - [0x5E70, .bss, done/inflate] + - [0x5E70, .bss, done/initialize] + - [0x5E70, .bss, done/kdebugserver] + - [0x5E70, .bss, done/leointerrupt] + - [0x5E70, .bss, done/seteventmesg] + - [0x5E70, .bss, done/leodiskinit] + - [0x5E70, .bss, done/pimgr] + - [0x5E70, .bss, done/cartrominit] + - [0x5E70, .bss, done/piacs] +- name: crc + type: bin + start: 0x5E70 + subsegments: + - [0x5E70, bin, crc] +- name: assets + type: bin + start: 0x5E90 + subsegments: + - [0x5E90, bin, assets] +- name: soundfont1 + type: bin + start: 0xD846C0 + subsegments: + - [0xD846C0, bin, soundfont1.ctl] + - [0xD954B0, bin, soundfont1.tbl] +- name: soundfont2 + type: bin + start: 0xEA3EB0 + subsegments: + - [0xEA3EB0, bin, soundfont2.ctl] + - [0xEADE60, bin, soundfont2.tbl] +- name: core1.us.v10.rzip + type: bin #type: rzip_code #compressed code + start: 0xF19250 + #vram: 0x8023DA20 +- name: core2.us.v10.rzip + type: bin #type: rzip_code #compressed code + start: 0xF37F90 + #vram: 0x80286F90 +- name: CC.us.v10.rzip + type: bin #type: rzip_code/overlay #compressed code + start: 0xFA3FD0 + #vram: 0x803863F0 +- name: MMM.us.v10.rzip + type: bin #type: rzip_code/overlay #compressed code + start: 0xFA5F50 + #vram: 0x803863F0 +- name: GV.us.v10.rzip + type: bin #type: rzip_code/overlay #compressed code + start: 0xFA9150 + #vram: 0x803863F0 +- name: TTC.us.v10.rzip + type: bin #type: rzip_code/overlay #compressed code + start: 0xFAE860 + #vram: 0x803863F0 +- name: MM.us.v10.rzip + type: bin #type: rzip_code/overlay #compressed code + start: 0xFB24A0 + #vram: 0x803863F0 +- name: BGS.us.v10.rzip + type: bin #type: rzip_code/overlay #compressed code + start: 0xFB44E0 + #vram: 0x803863F0 +- name: RBB.us.v10.rzip + type: bin #type: rzip_code/overlay #compressed code + start: 0xFB9A30 + #vram: 0x803863F0 +- name: FP.us.v10.rzip + type: bin #type: rzip_code/overlay #compressed code + start: 0xFBEBE0 + #vram: 0x803863F0 +- name: SM.us.v10.rzip + type: bin #type: rzip_code/overlay #compressed code + start: 0xFC4810 + #vram: 0x803863F0 +- name: cutscenes.us.v10.rzip + type: bin #type: rzip_code/overlay #compressed code + start: 0xFC6F20 + #vram: 0x803863F0 +- name: lair.us.v10.rzip + type: bin #type: rzip_code/overlay #compressed code + start: 0xFC9150 + #vram: 0x803863F0 +- name: fight.us.v10.rzip + type: bin #type: rzip_code/overlay #compressed code + start: 0xFD0420 + #vram: 0x803863F0 +- name: CCW.us.v10.rzip + type: bin #type: rzip_code/overlay #compressed code + start: 0xFD6190 + #vram: 0x803863F0 +- [0xFDAA10, bin, emptyLvl.us.v10.rzip] +- [0xFDAA30, bin, trailer] # 0xff to end +- [0x1000000] # end of ROM diff --git a/banjo.us.v11.yaml b/banjo.us.v11.yaml new file mode 100644 index 00000000..f8c9bf00 --- /dev/null +++ b/banjo.us.v11.yaml @@ -0,0 +1,87 @@ +options: + basename: banjo + find_file_boundaries: True + compiler: "IDO" + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: header + type: header + start: 0x00000000 + subsegments: + - [0x00000000, header, header] + - name: boot + type: bin + start: 0x00000040 + - name: bk_boot + type: code + start: 0x00001000 + vram: 0x80000400 + subsegments: + - [0x00001000, asm] + - name: assets + type: bin + start: 0x00005E90 + subsegments: + - [0x00005E90, bin, assets] + - name: soundfont1 + type: bin + start: 0x00D87CA0 + subsegments: + - [0x00D87CA0, bin, soundfont1.ctl] + - [0x00D98A90, bin, soundfont1.tbl] + - name: soundfont2 + type: bin + start: 0x00EA7490 + subsegments: + - [0x00EA7490, bin, soundfont2.ctl] + - [0x00EB12F0, bin, soundfont2.tbl] + - name: core1.us.v11.rzip + type: bin + start: 0x00F1C830 + - name: core2.us.v11.rzip + type: bin + start: 0x00F3ADB0 + - name: level2.us.v11.rzip + type: bin + start: 0x00FA6F80 + - name: level9.us.v11.rzip + type: bin + start: 0x00FA8EE0 + - name: level6.us.v11.rzip + type: bin + start: 0x00FAC0E0 + - name: level1.us.v11.rzip + type: bin + start: 0x00FB1810 + - name: level0.us.v11.rzip + type: bin + start: 0x00FB5450 + - name: level3.us.v11.rzip + type: bin + start: 0x00FB7480 + - name: level8.us.v11.rzip + type: bin + start: 0x00FBC9C0 + - name: level4.us.v11.rzip + type: bin + start: 0x00FC1BA0 + - name: level10.us.v11.rzip + type: bin + start: 0x00FC77E0 + - name: level12.us.v11.rzip + type: bin + start: 0x00FC9EF0 + - name: level5.us.v11.rzip + type: bin + start: 0x00FCC120 + - name: level11.us.v11.rzip + type: bin + start: 0x00FD3400 + - name: level7.us.v11.rzip + type: bin + start: 0x00FD91F0 + - name: emptyLvl.us.v11.rzip + type: bin + start: 0x00FDDA80 + - [0x01000000] \ No newline at end of file diff --git a/diff b/diff new file mode 100755 index 00000000..16411599 --- /dev/null +++ b/diff @@ -0,0 +1,5 @@ +#!/bin/bash + +python3 ./tools/asm-differ/diff.py -wm3 $1 + + diff --git a/ido/ido5.3_recomp/Makefile b/ido/ido5.3_recomp/Makefile new file mode 100644 index 00000000..84a5de31 --- /dev/null +++ b/ido/ido5.3_recomp/Makefile @@ -0,0 +1,37 @@ +IRIX_ROOT := ../ido5.3_compiler + +cc: OPT_CFLAGS := -O2 +cfe: OPT_CFLAGS := -O2 +uopt: OPT_CFLAGS := -O2 +ugen: OPT_CFLAGS := -O2 +as1: OPT_CFLAGS := -O2 +acpp: OPT_CFLAGS := -O2 + +RECOMP := recomp + +ugen_c.c: RECOMP_FLAGS := --conservative + +all: cc cfe uopt ugen as1 acpp copt ujoin uld umerge usplit err.english.cc + +clean: + $(RM) cc* cfe* uopt* ugen* as1* acpp* copt* ujoin* uld* umerge* usplit* err.english.cc $(RECOMP) libc_impl.o + +$(RECOMP): recomp.cpp + $(CXX) $^ -o $@ -std=c++11 -O2 -Wno-switch `pkg-config --cflags --libs capstone` + +libc_impl.o: libc_impl.c libc_impl.h + $(CC) $< -c -fno-strict-aliasing -O2 -DIDO53 + +err.english.cc: $(IRIX_ROOT)/usr/lib/err.english.cc + cp $^ $@ + +cc_c.c: $(IRIX_ROOT)/usr/bin/cc $(RECOMP) + ./$(RECOMP) $(RECOMP_FLAGS) $< > $@ + +%_c.c: $(IRIX_ROOT)/usr/lib/% $(RECOMP) + ./$(RECOMP) $(RECOMP_FLAGS) $< > $@ + +%: %_c.c libc_impl.o + $(CC) libc_impl.o $< -o $@ $(OPT_CFLAGS) -fno-strict-aliasing -lm -no-pie + +.PHONY: all clean diff --git a/ido/ido5.3_recomp/acpp b/ido/ido5.3_recomp/acpp new file mode 100755 index 00000000..6dcb6c09 Binary files /dev/null and b/ido/ido5.3_recomp/acpp differ diff --git a/ido/ido5.3_recomp/as1 b/ido/ido5.3_recomp/as1 new file mode 100755 index 00000000..89050762 Binary files /dev/null and b/ido/ido5.3_recomp/as1 differ diff --git a/ido/ido5.3_recomp/cc b/ido/ido5.3_recomp/cc new file mode 100755 index 00000000..97d28e9f Binary files /dev/null and b/ido/ido5.3_recomp/cc differ diff --git a/ido/ido5.3_recomp/cc_c.c b/ido/ido5.3_recomp/cc_c.c new file mode 100644 index 00000000..cfc8b127 --- /dev/null +++ b/ido/ido5.3_recomp/cc_c.c @@ -0,0 +1,70220 @@ +#include "header.h" +static const uint32_t rodata[] = { +0x706c3100,0x706c6900,0x636f6200,0x696c0000,0x73740000,0x616e6c00,0x632b2b00,0x63630000, +0x63787800,0x43000000,0x63707000,0x43585800,0x43505000,0x2e630000,0x202d6c6d,0x0, +0x202d6c70,0x0,0x202d6c46,0x37370000,0x202d6c49,0x37370000,0x202d6c55,0x37370000, +0x202d6c69,0x73616d00,0x202d6c65,0x78630000,0x202d6c64,0x77000000,0x202d6c70,0x726f6600, +0x202d6c78,0x6d616c6c,0x6f630000,0x202d6c6d,0x6c640000,0x6c697374,0x0,0x6b656570, +0x0,0x6c697374,0x0,0x6b656570,0x0,0x30000000,0x2f000000,0x2f000000, +0x61637274,0x312e6f00,0x63727431,0x2e6f0000,0x6d637274,0x312e6f00,0x2f757372,0x2f62696e, +0x2f6d3400,0x2f757372,0x2f62696e,0x2f726174,0x666f7200,0x63630000,0x2f000000,0x70630000, +0x2f000000,0x66373700,0x2f000000,0x63630000,0x2f000000,0x706c3100,0x2f000000,0x636f626f, +0x6c000000,0x2f000000,0x5347495f,0x53565234,0x0,0x5347495f,0x43430000,0x456e7669, +0x726f6e6d,0x656e7420,0x76617269,0x61626c65,0x20534749,0x5f434320,0x69732065,0x6d707479, +0x3a206967,0x6e6f7265,0x640a0000,0x2d63636b,0x72000000,0x70000000,0x2d616e73,0x69000000, +0x70000000,0x2d78616e,0x73690000,0x70000000,0x2d616e73,0x69706f73,0x69780000,0x70000000, +0x456e7669,0x726f6e6d,0x656e7420,0x76617269,0x61626c65,0x20534749,0x5f434320,0x636f6e74, +0x656e7473,0x20756e72,0x65636f67,0x6e697a61,0x626c6520,0x616e6420,0x69676e6f,0x7265643b, +0x20222573,0x22206e6f,0x74206f6e,0x65206f66,0x3a202d63,0x636b7220,0x2d616e73,0x69202d78, +0x616e7369,0x202d616e,0x7369706f,0x7369780a,0x0,0x2f000000,0x63630000,0x63630000, +0x63630000,0x70630000,0x70630000,0x70630000,0x66373700,0x66373700,0x66373700,0x61730000, +0x61730000,0x61730000,0x706c3100,0x706c3100,0x706c3100,0x636f626f,0x6c000000,0x636f626f, +0x6c000000,0x636f626f,0x6c000000,0x6e63632e,0x616c7400,0x6e63632e,0x616c7400,0x6e636300, +0x4e43432e,0x616c7400,0x4e43432e,0x616c7400,0x476f7420,0x68657265,0xa000000,0x4e43432e, +0x616c7400,0x4443432e,0x616c7400,0x4443432e,0x616c7400,0x4443432e,0x616c7400,0x6e636300, +0x6e636300,0x6e636300,0x4e434300,0x4e434300,0x4e434300,0x44434300,0x44434300,0x44434300, +0x2f000000,0x63630000,0x63630000,0x63630000,0x70630000,0x70630000,0x70630000,0x66373700, +0x66373700,0x66373700,0x61730000,0x61730000,0x61730000,0x706c3100,0x706c3100,0x706c3100, +0x636f626f,0x6c000000,0x636f626f,0x6c000000,0x636f626f,0x6c000000,0x6e63632e,0x616c7400, +0x6e63632e,0x616c7400,0x6e636300,0x4e43432e,0x616c7400,0x4e43432e,0x616c7400,0x4e43432e, +0x616c7400,0x4443432e,0x616c7400,0x4443432e,0x616c7400,0x4443432e,0x616c7400,0x6e636300, +0x6e636300,0x6e636300,0x4e434300,0x4e434300,0x4e434300,0x44434300,0x44434300,0x44434300, +0x4443435f,0x5354445f,0x50415448,0x53000000,0x434f4d50,0x5f544152,0x4745545f,0x524f4f54, +0x0,0x2f000000,0x2f000000,0x544f4f4c,0x524f4f54,0x0,0x2f000000,0x2f000000, +0x6c69622f,0x616c6967,0x6e000000,0x544d5044,0x49520000,0x2f746d70,0x2f000000,0x2f000000, +0x63746d74,0x73745858,0x58585858,0x0,0x77000000,0x63633a20,0x63616e27,0x74207772, +0x69746520,0x746f2024,0x544d5044,0x49523a20,0x25730000,0x524c535f,0x49445f4f,0x424a4543, +0x54000000,0x2d6e6f6e,0x5f736861,0x72656400,0x38000000,0x2d697269,0x78340000,0x38000000, +0x2d636f66,0x66000000,0x38000000,0x2d6d6970,0x73330000,0x38000000,0x2d657863,0x70740000, +0x38000000,0x2d616269,0x0,0x2d4f3300,0x2d6e6f73,0x74646c69,0x62000000,0x2d454220, +0x6f72202d,0x454c206d,0x75737420,0x70726563,0x65646520,0x616e7920,0x2d422066,0x6c616773, +0xa000000,0x2d454220,0x6f72202d,0x454c206d,0x75737420,0x70726563,0x65646520,0x616e7920, +0x2d422066,0x6c616773,0xa000000,0x7573722f,0x6c69622f,0x6e6f6e73,0x68617265,0x64000000, +0x7573722f,0x6c69622f,0x61626900,0x7573722f,0x6c696200,0x6c696200,0x68000000,0x2f000000, +0x7573722f,0x696e636c,0x7564652f,0x43430000,0x7573722f,0x696e636c,0x75646500,0x2d737464, +0x30000000,0x73767234,0x0,0x0,0x2d595376,0x0,0x2d59537a,0x0, +0x2d637673,0x5f6e6f73,0x72630000,0x2d637673,0x0,0x2c000000,0x7573722f,0x35696e63, +0x6c756465,0x0,0x7573722f,0x696e636c,0x7564652f,0x43430000,0x7573722f,0x696e636c, +0x75646500,0x68000000,0x2d6e6f6e,0x5f736861,0x72656400,0x2d6e6f6e,0x5f736861,0x72656400, +0x2d6e6f6e,0x5f736861,0x72656400,0x2d6e6f6e,0x5f736861,0x72656400,0x2d63616c,0x6c5f7368, +0x61726564,0x0,0x2d63616c,0x6c5f7368,0x61726564,0x0,0x6e6f2073,0x6f757263, +0x652c206f,0x626a6563,0x74206f72,0x2075636f,0x64652066,0x696c6520,0x73706563,0x69666965, +0x640a0000,0x2d773100,0x2d770000,0x6e6f2073,0x6f757263,0x65206669,0x6c650a00,0x61637274, +0x312e6f00,0x72000000,0x272d6c63,0x5f732720,0x73706563,0x69666965,0x642e2053,0x68617265, +0x64207665,0x7273696f,0x6e206f66,0x2043206c,0x69627261,0x72792064,0x6f657320,0x6e6f7420, +0x636f6e66,0x6f726d20,0x746f2041,0x4e534920,0x58332e31,0x35392d31,0x3938392e,0xa000000, +0x30000000,0x2d4b5049,0x43202874,0x68652064,0x65666175,0x6c742920,0x6973206f,0x6e6c7920, +0x636f6d70,0x61746962,0x6c652077,0x69746820,0x2d472030,0x2c206368,0x616e6769,0x6e672074, +0x6f202d47,0x20302e20,0xa000000,0x30000000,0x2d6e6f6e,0x5f736861,0x72656420,0x6973206e, +0x6f742063,0x6f6d7061,0x7469626c,0x65207769,0x7468202d,0x6162692c,0x20636861,0x6e67696e, +0x6720746f,0x202d6162,0x692e0a00,0x30000000,0x2d445f4d,0x49505345,0x42000000,0x2d444d49, +0x50534542,0x0,0x2d445f5f,0x53544443,0x5f5f3d31,0x0,0x2d445f50,0x4f534958, +0x5f534f55,0x5243453d,0x31000000,0x2d454200,0x2d454200,0x2d454200,0x2d454200,0x2d454200, +0x2d454200,0x2d454200,0x2d454200,0x2d454200,0x2d454200,0x2d445f4d,0x49505345,0x4c000000, +0x2d445f4d,0x49505345,0x4c000000,0x2d444d49,0x5053454c,0x0,0x2d445f5f,0x53544443, +0x5f5f3d31,0x0,0x2d445f50,0x4f534958,0x5f534f55,0x5243453d,0x31000000,0x2d454c00, +0x2d454c00,0x2d454c00,0x2d454c00,0x2d454c00,0x2d454c00,0x2d454c00,0x2d454c00,0x2d454c00, +0x2d454c00,0x2d454c00,0x2d586730,0x0,0x2d673000,0x2d673000,0x2d673000,0x2d673000, +0x2d673000,0x2d673000,0x2d673000,0x2d673000,0x2d673000,0x2d673000,0x2d673000,0x2d5a6730, +0x0,0x2d5a6731,0x0,0x2d586731,0x0,0x2d673100,0x2d5a6732,0x0, +0x2d586732,0x0,0x2d673200,0x2d5a6733,0x0,0x2d586733,0x0,0x2d673300, +0x63616e27,0x74207573,0x65202d6d,0x702f2d70,0x66612077,0x69746820,0x2d64646f,0x70740a00, +0x2d6d6970,0x73332069,0x6d706c69,0x6573202d,0x36346269,0x742c2077,0x68696368,0x20697320, +0x6e6f7420,0x73757070,0x6f727465,0x642e0a00,0x49524958,0x34206e6f,0x74207375,0x70706f72, +0x74656420,0x696e2044,0x656c7461,0x2d432b2b,0xa000000,0x49524958,0x3420616e,0x64202d73, +0x61206e6f,0x74207375,0x70706f72,0x74656420,0x746f6765,0x74686572,0xa000000,0x2d736861, +0x72656420,0x63616e20,0x62652073,0x70656369,0x66696564,0x206f6e6c,0x79207768,0x656e2061, +0x206c696e,0x6b206973,0x20746f20,0x62652070,0x6572666f,0x726d6564,0xa000000,0x2d462061, +0x6e64202d,0x736d6172,0x74206361,0x6e6e6f74,0x20626520,0x73706563,0x69666965,0x6420746f, +0x67657468,0x65723a20,0x2d736d61,0x72742069,0x676e6f72,0x65640a00,0x4443435f,0x464f5243, +0x455f4f50,0x54000000,0x2d44756e,0x69780000,0x63616e27,0x74206d69,0x78202d6d,0x69707332, +0x20776974,0x68202d64,0x776f7063,0x6f64650a,0x0,0x2d446d69,0x70733d32,0x0, +0x2d446d69,0x70733d33,0x0,0x2d446d69,0x70733d31,0x0,0x2d44686f,0x73745f6d, +0x69707300,0x2d363462,0x69740000,0x2d363462,0x69740000,0x2d64776f,0x70636f64,0x65000000, +0x2d64776f,0x70636f64,0x65000000,0x2d6d6970,0x73330000,0x2d6d6970,0x73330000,0x4d000000, +0x2d64776f,0x70636f64,0x65000000,0x2d64776f,0x70636f64,0x65000000,0x2d6d6970,0x73330000, +0x2d6d6970,0x73330000,0x4d000000,0x2d4f3000,0x2d4f3100,0x2d4f3200,0x2d4f3300,0x2d4f3400, +0x2d617574,0x6f6d6174,0x69630000,0x2d737461,0x74696300,0x2d737461,0x74696300,0x436f6e66, +0x6c696374,0x696e6720,0x666c6167,0x733b202d,0x6e6f6c6f,0x636b2061,0x6e64202d,0x6c70696c, +0x6f636b20,0x63616e27,0x7420626f,0x74682062,0x65207370,0x65636966,0x6965640a,0x0, +0x6f6e6c79,0x206f6e65,0x20736f75,0x72636520,0x66696c65,0x2063616e,0x20626520,0x73706563, +0x69666965,0x64207769,0x74682025,0x730a0000,0x61730000,0x77000000,0x25732025,0x73257325, +0x730a0000,0x2d632000,0x0,0x0,0x25730a00,0x63616e6e,0x6f74206f,0x70656e20, +0x636f6d6d,0x616e6466,0x696c6520,0x27257327,0xa000000,0x752e6f75,0x742e3f00,0x2e3f0000, +0x25733a0a,0x0,0x2e540000,0x704b666a,0x736d766f,0x63616274,0x797a0000,0x704b666a, +0x736d766f,0x63616274,0x797a0000,0x704b666a,0x736d766f,0x63616274,0x797a0000,0x704b666a, +0x736d766f,0x63616274,0x797a0000,0x70666a73,0x6d766f63,0x61627479,0x7a000000,0x70666a73, +0x6d766f63,0x61627479,0x7a000000,0x70666a73,0x6d766f63,0x61627479,0x7a000000,0x70666a73, +0x6d766f63,0x61627479,0x7a000000,0x7066656b,0x6a736d76,0x6f636162,0x74797a00,0x7066656b, +0x6a736d76,0x6f636162,0x74797a00,0x7066656b,0x6a736d76,0x6f636162,0x74797a00,0x7066656b, +0x6a736d76,0x6f636162,0x74797a00,0x70656b6a,0x736d766f,0x63616274,0x797a0000,0x70666a73, +0x6d766f63,0x61627479,0x7a000000,0x66000000,0x75746f62,0x0,0x63616e27,0x74206f76, +0x65727772,0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025, +0x73200a00,0x70000000,0x70000000,0x70000000,0x70000000,0x2d363462,0x6974206f,0x7074696f, +0x6e206973,0x206e6f74,0x20696d70,0x6c656d65,0x6e746564,0x20776974,0x68206363,0x6f6d206f, +0x72206163,0x636f6d2e,0xa000000,0x63707000,0x61637070,0x0,0x2d445f4d,0x4950535f, +0x46505345,0x543d3136,0x0,0x2d445f4d,0x4950535f,0x4953413d,0x31000000,0x2d445f4d, +0x4950535f,0x4953413d,0x32000000,0x2d445f4d,0x4950535f,0x4953413d,0x33000000,0x2d445f41, +0x42494f33,0x323d3100,0x2d445f4d,0x4950535f,0x53494d3d,0x5f414249,0x4f333200,0x2d445f4d, +0x4950535f,0x535a494e,0x543d3332,0x0,0x2d445f4d,0x4950535f,0x535a4c4f,0x4e473d33, +0x32000000,0x2d445f4d,0x4950535f,0x535a5054,0x523d3332,0x0,0x2d445f4d,0x4950535f, +0x46505345,0x543d3332,0x0,0x2d445f4d,0x4950535f,0x4953413d,0x5f4d4950,0x535f4953, +0x415f4d49,0x50533300,0x2d445f4d,0x4950535f,0x53494d3d,0x5f4d4950,0x535f5349,0x4d5f4142, +0x49363400,0x2d445f4d,0x4950535f,0x535a494e,0x543d3332,0x0,0x2d445f4d,0x4950535f, +0x535a4c4f,0x4e473d36,0x34000000,0x2d445f4d,0x4950535f,0x535a5054,0x523d3634,0x0, +0x556e6b6e,0x6f776e20,0x76616c75,0x6520666f,0x72206d69,0x70735f61,0x62693a20,0x25642e0a, +0x0,0x2d6e6f73,0x7464696e,0x63000000,0x2d445f5f,0x45585445,0x4e53494f,0x4e535f5f, +0x0,0x2d57616c,0x6c000000,0x2d747261,0x64697469,0x6f6e616c,0x0,0x2d747269, +0x67726170,0x68730000,0x2d756e64,0x65660000,0x2d700000,0x2d445f5f,0x45585445,0x4e53494f, +0x4e535f5f,0x0,0x2d594500,0x2d610000,0x2d445f5f,0x45585445,0x4e53494f,0x4e535f5f, +0x0,0x2d445f4c,0x414e4755,0x4147455f,0x435f504c,0x55535f50,0x4c55533d,0x31000000, +0x2d445f5f,0x63706c75,0x73706c75,0x733d3100,0x2d445f5f,0x414e5349,0x5f435050,0x5f5f3d31, +0x0,0x2d445f44,0x454c5441,0x5f455854,0x454e5349,0x4f4e533d,0x31000000,0x2d444c41, +0x4e475541,0x47455f43,0x0,0x2d445f4c,0x414e4755,0x4147455f,0x43000000,0x2d445f4c, +0x414e4755,0x4147455f,0x50575243,0x0,0x2d747269,0x67726170,0x68730000,0x2d444c41, +0x4e475541,0x47455f50,0x41534341,0x4c000000,0x2d445f4c,0x414e4755,0x4147455f,0x50415343, +0x414c0000,0x2d510000,0x2d444c41,0x4e475541,0x47455f46,0x4f525452,0x414e0000,0x2d445f4c, +0x414e4755,0x4147455f,0x464f5254,0x52414e00,0x2d444c41,0x4e475541,0x47455f41,0x5353454d, +0x424c5900,0x2d445f4c,0x414e4755,0x4147455f,0x41535345,0x4d424c59,0x0,0x2d444c41, +0x4e475541,0x47455f50,0x4c310000,0x2d445f4c,0x414e4755,0x4147455f,0x504c3100,0x2d444c41, +0x4e475541,0x47455f43,0x4f424f4c,0x0,0x2d445f4c,0x414e4755,0x4147455f,0x434f424f, +0x4c000000,0x2d445f5f,0x494e4c49,0x4e455f49,0x4e545249,0x4e534943,0x53000000,0x2d447367, +0x69000000,0x2d445356,0x52330000,0x2d445f5f,0x53565233,0x0,0x2d445f5f,0x73676900, +0x2d445f5f,0x73676900,0x2d445f5f,0x53565233,0x0,0x2d240000,0x2d646f6c,0x6c617200, +0x2d240000,0x2d44756e,0x69780000,0x2d446d69,0x70730000,0x2d44686f,0x73745f6d,0x69707300, +0x2d445f5f,0x756e6978,0x0,0x2d445f5f,0x686f7374,0x5f6d6970,0x73000000,0x2d445f53, +0x5652345f,0x534f5552,0x43450000,0x2d445f4d,0x4f444552,0x4e5f4300,0x2d445f53,0x47495f53, +0x4f555243,0x45000000,0x2d445f50,0x49430000,0x2d445f5f,0x44534f5f,0x5f000000,0x2d445f5f, +0x756e6978,0x0,0x2d445f5f,0x686f7374,0x5f6d6970,0x73000000,0x2d445f53,0x5652345f, +0x534f5552,0x43450000,0x2d445f4d,0x4f444552,0x4e5f4300,0x2d445f50,0x49430000,0x2d445f5f, +0x44534f5f,0x5f000000,0x2d445359,0x53545950,0x455f0000,0x2d445f53,0x59535459,0x50455f00, +0x2d445359,0x53545950,0x455f5359,0x53560000,0x2d445f53,0x59535459,0x50455f53,0x59535600, +0x2d445f5f,0x36344249,0x54000000,0x2d445f4c,0x4f4e474c,0x4f4e4700,0x2d445f5f,0x6d697073, +0x3d320000,0x2d445f5f,0x6d697073,0x3d330000,0x2d445f5f,0x6d697073,0x3d310000,0x2f757372, +0x2f697269,0x78342f00,0x7573722f,0x696e636c,0x75646500,0x2f000000,0x2d490000,0x2d490000, +0x2d490000,0x2d490000,0x2e690000,0x63616e27,0x74206f76,0x65727772,0x69746520,0x61207772, +0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025,0x73200a00,0x2d4b0000,0x2d450000, +0x70000000,0x70000000,0x2d450000,0x2d445f4c,0x414e4755,0x4147455f,0x43000000,0x2d445f43, +0x46450000,0x2d444c41,0x4e475541,0x47455f50,0x41534341,0x4c000000,0x2d445f4c,0x414e4755, +0x4147455f,0x50415343,0x414c0000,0x2d510000,0x2d444c41,0x4e475541,0x47455f46,0x4f525452, +0x414e0000,0x2d445f4c,0x414e4755,0x4147455f,0x464f5254,0x52414e00,0x2d737464,0x30000000, +0x2d444c41,0x4e475541,0x47455f41,0x5353454d,0x424c5900,0x2d445f4c,0x414e4755,0x4147455f, +0x41535345,0x4d424c59,0x0,0x2d444c41,0x4e475541,0x47455f50,0x4c310000,0x2d445f4c, +0x414e4755,0x4147455f,0x504c3100,0x2d444c41,0x4e475541,0x47455f43,0x4f424f4c,0x0, +0x2d445f4c,0x414e4755,0x4147455f,0x434f424f,0x4c000000,0x2d445f5f,0x756e6978,0x0, +0x2d445f5f,0x36344249,0x54000000,0x2d445f4c,0x4f4e474c,0x4f4e4700,0x2d445f5f,0x6d697073, +0x3d320000,0x2d445f5f,0x6d697073,0x3d330000,0x2d445f5f,0x6d697073,0x3d310000,0x2d445f5f, +0x686f7374,0x5f6d6970,0x73000000,0x2d445f50,0x49430000,0x2d445f5f,0x44534f5f,0x5f000000, +0x2d445f53,0x59535459,0x50455f53,0x56523400,0x2f000000,0x2d490000,0x2d490000,0x2d490000, +0x2d737464,0x31000000,0x2d737464,0x0,0x2d737464,0x30000000,0x2d760000,0x2d597700, +0x612e6f75,0x74000000,0x2d594e00,0x2d594400,0x2d4b0000,0x2d6d0000,0x2e690000,0x63616e27, +0x74206f76,0x65727772,0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669, +0x6c652025,0x73200a00,0x70000000,0x2d736f70,0x7420616e,0x64202d70,0x63612062,0x6f746820, +0x73706563,0x69666965,0x643b202d,0x736f7074,0x2069676e,0x6f726564,0x2e0a0000,0x636f7074, +0x0,0x2d6c6f6f,0x70756e72,0x6f6c6c00,0x30000000,0x2d493d00,0x4d000000,0x2d434d50, +0x3d000000,0x2d63703d,0x69000000,0x2d73793d,0x6b000000,0x49000000,0x2d760000,0x63707000, +0x61637070,0x0,0x2d6c0000,0x2d6e6f73,0x7464696e,0x63000000,0x70000000,0x2d6c6f6f, +0x70756e72,0x6f6c6c00,0x30000000,0x70636100,0x2d493d00,0x4d000000,0x2d434d50,0x3d000000, +0x4c000000,0x2d4c3d00,0x2d6c6f3d,0x6c730000,0x2d63703d,0x69000000,0x2d73793d,0x6b000000, +0x63707000,0x61637070,0x0,0x49000000,0x2d760000,0x2d6c0000,0x2d6e6f73,0x7464696e, +0x63000000,0x70000000,0x2d760000,0x2d4f0000,0x2d620000,0x2d6e0000,0x2d5a7a00,0x2d5a4f00, +0x2d5a5300,0x2d517a00,0x2d516e00,0x2d730000,0x2d750000,0x2d597700,0x2d594a00,0x2d594400, +0x2d4b0000,0x2d6d0000,0x2d597000,0x2d595200,0x612e6f75,0x74000000,0x2d594e00,0x2d747573, +0x65640000,0x2d74616c,0x6c000000,0x2d540000,0x2d594f00,0x2d420000,0x2d5a6300,0x2d594700, +0x2d000000,0x50000000,0x2d4b0000,0x2d616e73,0x69000000,0x2d63636b,0x72000000,0x2d78616e, +0x73690000,0x63616e27,0x74206f76,0x65727772,0x69746520,0x61207772,0x6974652d,0x70726f74, +0x65637465,0x64206669,0x6c652025,0x73200a00,0x2d6e6f63,0x70700000,0x2d6e6f63,0x70700000, +0x2d587600,0x2d445f43,0x46450000,0x2d416d61,0x6368696e,0x65286d69,0x70732900,0x2d417379, +0x7374656d,0x28756e69,0x78290000,0x2d470000,0x2d737464,0x31000000,0x2d737464,0x0, +0x2d737464,0x30000000,0x2d587072,0x6f746f74,0x79706573,0x0,0x2d585300,0x2d58636d, +0x643a0000,0x2d635f69,0x6e6c696e,0x65000000,0x62746f75,0x0,0x63616e27,0x74206f76, +0x65727772,0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025, +0x73200a00,0x6163636f,0x6d000000,0x63636f6d,0x0,0x2d587600,0x2d584d50,0x0, +0x2d58646f,0x6c6c6172,0x0,0x2d587265,0x616c5f66,0x70000000,0x2d587072,0x6f746f74, +0x79706573,0x0,0x2d587861,0x6e736900,0x2d58616e,0x73690000,0x63616e27,0x74206f76, +0x65727772,0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025, +0x73200a00,0x2d585300,0x2d635f69,0x6e6c696e,0x65000000,0x62746f75,0x0,0x63616e27, +0x74206f76,0x65727772,0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669, +0x6c652025,0x73200a00,0x75706173,0x0,0x2d760000,0x2d470000,0x63616e27,0x74206f76, +0x65727772,0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025, +0x73200a00,0x2d740000,0x62746f75,0x0,0x63616e27,0x74206f76,0x65727772,0x69746520, +0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025,0x73200a00,0x706c3166, +0x65000000,0x2d760000,0x2d6f0000,0x2d730000,0x2d700000,0x2d650000,0x756c7069,0x0, +0x2d760000,0x2d730000,0x2d6f0000,0x2d740000,0x62746f75,0x0,0x636f6266,0x65000000, +0x2d760000,0x2d6f0000,0x2d730000,0x2d700000,0x2d706400,0x2d646400,0x2d650000,0x6d340000, +0x65666c20,0x6e6f7420,0x73757070,0x6f727465,0x642e2043,0x616e6e6f,0x74207573,0x65202e65, +0x2066696c,0x65730a00,0x72617466,0x6f720000,0x2d736f70,0x7420616e,0x64202d70,0x66612062, +0x6f746820,0x73706563,0x69666965,0x643b202d,0x736f7074,0x2069676e,0x6f726564,0x2e0a0000, +0x2d6c6f6f,0x70756e72,0x6f6c6c00,0x30000000,0x666f7074,0x20646f65,0x73206e6f,0x74207265, +0x636f676e,0x697a6520,0x74686520,0x2d693220,0x6f707469,0x6f6e0a00,0x666f7074,0x20646f65, +0x73206e6f,0x74207265,0x636f676e,0x697a6520,0x74686520,0x2d363620,0x6f707469,0x6f6e0a00, +0x666f7074,0x20646f65,0x73206e6f,0x74207265,0x636f676e,0x697a6520,0x74686520,0x2d75206f, +0x7074696f,0x6e0a0000,0x666f7074,0x20646f65,0x73206e6f,0x74207375,0x70706f72,0x74207468, +0x65202d62,0x61636b73,0x6c617368,0x206f7074,0x696f6e0a,0x0,0x666f7074,0x20646f65, +0x73206e6f,0x74207375,0x70706f72,0x74207468,0x65202d55,0x206f7074,0x696f6e0a,0x0, +0x666f7074,0x0,0x6c000000,0x2d4c3d00,0x6d000000,0x2d463d00,0x2d493d00,0x2d736361, +0x6e3d3132,0x30000000,0x2d736361,0x6e3d3133,0x32000000,0x2d736176,0x653d616c,0x6c000000, +0x2d6f6e65,0x74726970,0x0,0x2d646c69,0x6e657300,0x2d737570,0x70726573,0x733d7700, +0x2d6c6f3d,0x6c6e6f00,0x2d637573,0x746f6d65,0x723d0000,0x2d6f7269,0x67696e61,0x6c5f6669, +0x6c656e61,0x6d653d00,0x2d696e63,0x6c756465,0x3d2f7573,0x722f696e,0x636c7564,0x65000000, +0x2d63703d,0x69000000,0x2d6c6f6f,0x70756e72,0x6f6c6c00,0x30000000,0x50464120,0x646f6573, +0x206e6f74,0x20726563,0x6f676e69,0x7a652074,0x6865202d,0x6932206f,0x7074696f,0x6e0a0000, +0x50464120,0x646f6573,0x206e6f74,0x20726563,0x6f676e69,0x7a652074,0x6865202d,0x3636206f, +0x7074696f,0x6e0a0000,0x50464120,0x646f6573,0x206e6f74,0x20726563,0x6f676e69,0x7a652074, +0x6865202d,0x75206f70,0x74696f6e,0xa000000,0x50464120,0x646f6573,0x206e6f74,0x20737570, +0x706f7274,0x20746865,0x202d6261,0x636b736c,0x61736820,0x6f707469,0x6f6e0a00,0x50464120, +0x646f6573,0x206e6f74,0x20737570,0x706f7274,0x20746865,0x202d5520,0x6f707469,0x6f6e0a00, +0x70666100,0x6c000000,0x2d4c3d00,0x6d000000,0x2d463d00,0x2d493d00,0x2d736361,0x6e3d3132, +0x30000000,0x2d736361,0x6e3d3133,0x32000000,0x2d736176,0x653d616c,0x6c000000,0x2d6f6e65, +0x74726970,0x0,0x2d646c69,0x6e657300,0x2d737570,0x70726573,0x733d7700,0x2d6c6f3d, +0x6c6e6f00,0x2d6c6f3d,0x6c6f0000,0x2d616e61,0x6c797369,0x733d0000,0x2d6e6f61,0x6e616c79, +0x73697300,0x2d637573,0x746f6d65,0x723d0000,0x2d6f7269,0x67696e61,0x6c5f6669,0x6c656e61, +0x6d653d00,0x2d696e63,0x6c756465,0x3d2f7573,0x722f696e,0x636c7564,0x65000000,0x2d63703d, +0x69000000,0x2d703d31,0x0,0x2d75723d,0x31000000,0x2d706661,0x70726570,0x6173732c, +0x0,0x43616e27,0x74207061,0x72736520,0x2d706661,0x70726570,0x61737320,0x6f707469, +0x6f6e0a00,0x2d706661,0x70726570,0x61737300,0x42616420,0x70666170,0x72657061,0x73732073, +0x796e7461,0x783a206e,0x6f206172,0x67206166,0x74657220,0x636f6d6d,0x610a0000,0x66636f6d, +0x0,0x2d616c69,0x676e5f63,0x6f6d6d6f,0x6e000000,0x2d4d5000,0x2d73686f,0x77646972, +0x74000000,0x2d760000,0x2d585300,0x2d6e6f63,0x6f646500,0x2d587500,0x63616e27,0x74206f76, +0x65727772,0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025, +0x73200a00,0x2d740000,0x756a6f69,0x6e000000,0x2d760000,0x2d6f0000,0x2d6e6f6e,0x5f736861, +0x72656400,0x756c6400,0x2f000000,0x2f000000,0x2d4c0000,0x7573722f,0x6c69622f,0x6e6f6e73, +0x68617265,0x642f0000,0x2d4c0000,0x7573722f,0x6c69622f,0x0,0x2f000000,0x2d4c0000, +0x7573722f,0x6c69622f,0x0,0x6d697073,0x322f6e6f,0x6e736861,0x72656400,0x2d4c0000, +0x7573722f,0x6c69622f,0x0,0x6d697073,0x32000000,0x2d4c0000,0x7573722f,0x6c69622f, +0x0,0x6d697073,0x322f6e6f,0x6e736861,0x72656400,0x2d4c0000,0x7573722f,0x6c69622f, +0x0,0x6d697073,0x32000000,0x2d535953,0x54595045,0x5f535652,0x34000000,0x2d5f5359, +0x53545950,0x455f5356,0x52340000,0x2d726571,0x75697265,0x5f64796e,0x616d6963,0x5f6c696e, +0x6b000000,0x5f726c64,0x5f6e6577,0x5f696e74,0x65726661,0x63650000,0x2d6b4200,0x2d4c0000, +0x2d4c0000,0x2f757372,0x2f697269,0x78342f00,0x7573722f,0x6c69622f,0x6e6f6e73,0x68617265, +0x642f0000,0x7573722f,0x6c69622f,0x6e6f6e73,0x68617265,0x642f0000,0x7573722f,0x6c69622f, +0x6e6f6e73,0x68617265,0x642f0000,0x6372746e,0x2e6f0000,0x2d4c0000,0x2f757372,0x2f697269, +0x78342f00,0x7573722f,0x6c69622f,0x0,0x7573722f,0x6c69622f,0x0,0x7573722f, +0x6c69622f,0x0,0x6372746e,0x2e6f0000,0x2d6e6f5f,0x4175746f,0x476e756d,0x0, +0x2d707265,0x73657276,0x655f6465,0x61645f63,0x6f646500,0x73767233,0x0,0x2d6c6273, +0x64000000,0x2d6c7465,0x726d6361,0x70000000,0x2d6c6b61,0x70696f00,0x2d6c6b61,0x70696f00, +0x2d6c635f,0x73000000,0x2d6c6300,0x2d6c6d70,0x63000000,0x2d6c635f,0x73000000,0x2d6c635f, +0x73000000,0x2d6c635f,0x73000000,0x72000000,0x2d6c6300,0x2d6c6d00,0x2d6c6661,0x73746d00, +0x2d6b6f00,0x7573706c,0x69740000,0x2d760000,0x63616e27,0x74206f76,0x65727772,0x69746520, +0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025,0x73200a00,0x2d6f0000, +0x2d740000,0x756d6572,0x67650000,0x2d760000,0x2d6f0000,0x63616e27,0x74206f76,0x65727772, +0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025,0x73200a00, +0x2d740000,0x756c6f6f,0x70000000,0x2d760000,0x2d6f0000,0x63616e27,0x74206f76,0x65727772, +0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025,0x73200a00, +0x2d740000,0x756f7074,0x30000000,0x2d760000,0x2d470000,0x63616e27,0x74206f76,0x65727772, +0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025,0x73200a00, +0x2d740000,0x64646f70,0x74000000,0x2d760000,0x2d470000,0x63616e27,0x74206f76,0x65727772, +0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025,0x73200a00, +0x2d650000,0x756f7074,0x0,0x2d760000,0x2d470000,0x2d6e6f50,0x616c6961,0x73000000, +0x2d6b7069,0x636f7074,0x0,0x2d6e6f6b,0x7069636f,0x70740000,0x63616e27,0x74206f76, +0x65727772,0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025, +0x73200a00,0x2d740000,0x62746f75,0x0,0x7567656e,0x0,0x2d760000,0x2d470000, +0x2d706963,0x31000000,0x2d706963,0x32000000,0x2d6f0000,0x2d6c0000,0x63616e27,0x74206f76, +0x65727772,0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025, +0x73200a00,0x2d6f0000,0x63616e27,0x74206f76,0x65727772,0x69746520,0x61207772,0x6974652d, +0x70726f74,0x65637465,0x64206669,0x6c652025,0x73200a00,0x2d6f0000,0x63616e27,0x74206f76, +0x65727772,0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025, +0x73200a00,0x63616e27,0x74206f76,0x65727772,0x69746520,0x61207772,0x6974652d,0x70726f74, +0x65637465,0x64206669,0x6c652025,0x73200a00,0x2d6c0000,0x2d6f0000,0x63616e27,0x74206f76, +0x65727772,0x69746520,0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025, +0x73200a00,0x2d740000,0x2d74656d,0x70000000,0x61733000,0x2d760000,0x2d470000,0x2d6f0000, +0x2e470000,0x63616e27,0x74206f76,0x65727772,0x69746520,0x61207772,0x6974652d,0x70726f74, +0x65637465,0x64206669,0x6c652025,0x73200a00,0x63616e27,0x74206f76,0x65727772,0x69746520, +0x61207772,0x6974652d,0x70726f74,0x65637465,0x64206669,0x6c652025,0x73200a00,0x2d740000, +0x61733100,0x2d746670,0x0,0x2d6e6f61,0x6c696173,0x6f6b0000,0x2d616c69,0x676e5f63, +0x6f6d6d6f,0x6e000000,0x2d706963,0x30000000,0x2d636f66,0x66000000,0x2d656c66,0x0, +0x2d706963,0x31000000,0x2d706963,0x32000000,0x2d636f66,0x66000000,0x2d636f66,0x66000000, +0x2d656c66,0x0,0x2d760000,0x2d6e6f67,0x6c6f6261,0x6c000000,0x2d470000,0x2d703000, +0x2d703100,0x2d6f0000,0x612e6f75,0x74000000,0x2d740000,0x2d650000,0x25732064,0x6f657320, +0x6e6f7420,0x65786973,0x74206f72,0x20697320,0x6e6f7420,0x73746174,0x2832292d,0x61626c65, +0x2e204e6f,0x74206465,0x6c657465,0x64202869,0x66206974,0x20657869,0x73747329,0x20657665, +0x6e207468,0x6f756768,0x20617331,0x20666169,0x6c65642e,0xa000000,0x25732069,0x73206e6f, +0x74206120,0x72656775,0x6c617220,0x66696c65,0x2c206e6f,0x74206465,0x6c657465,0x64206576, +0x656e2074,0x686f7567,0x68206173,0x31206661,0x696c6564,0x2e0a0000,0x66000000,0x63616e27, +0x74206d69,0x78202d6d,0x69707332,0x20776974,0x68207368,0x61726564,0x2c207472,0x79207573, +0x696e6720,0x2d6e6f6e,0x5f736861,0x7265640a,0x0,0x63616e27,0x74206d69,0x78207563, +0x6f646520,0x33322d62,0x6974202d,0x6d697073,0x33207769,0x74682073,0x68617265,0x640a0000, +0x63616e27,0x74206d69,0x78202d63,0x6f666620,0x77697468,0x20736861,0x7265642c,0x20747279, +0x20757369,0x6e67202d,0x6e6f6e5f,0x73686172,0x65640a00,0x63616e27,0x74206d69,0x78202d65, +0x78637074,0x20776974,0x68207368,0x61726564,0x2c207472,0x79207573,0x696e6720,0x2d6e6f6e, +0x5f736861,0x7265640a,0x0,0x63616e27,0x74206d69,0x78202d73,0x68617265,0x64207769, +0x7468202d,0x6e6f6e5f,0x73686172,0x65640a00,0x63616e27,0x74206d69,0x78202d73,0x68617265, +0x64207769,0x7468202d,0x636f7264,0xa000000,0x6564675f,0x7072656c,0x696e6b00,0x2d665347, +0x49000000,0x2d760000,0x6c640000,0x2d4b5049,0x43000000,0x2d6e6f6e,0x5f736861,0x72656400, +0x2d747261,0x6e736974,0x6976655f,0x6c696e6b,0x0,0x2d66756c,0x6c5f7472,0x616e7369, +0x74697665,0x5f6c696e,0x6b000000,0x2d6e6f5f,0x7472616e,0x73697469,0x76655f6c,0x696e6b00, +0x2d717569,0x636b7374,0x6172745f,0x696e666f,0x0,0x2d656c66,0x0,0x2d616c6c, +0x6f775f6a,0x756d705f,0x61745f65,0x6f700000,0x2d64656c,0x74610000,0x2d6f0000,0x2d6f0000, +0x2d454200,0x2d454c00,0x2f000000,0x2d4c0000,0x7573722f,0x6c69622f,0x44434300,0x2d4c0000, +0x7573722f,0x6c69622f,0x6e6f6e73,0x68617265,0x642f0000,0x2d4c0000,0x7573722f,0x6c69622f, +0x0,0x2d4c0000,0x7573722f,0x6c69622f,0x44434300,0x2d736861,0x72656400,0x2d4c0000, +0x2d4c0000,0x2f757372,0x2f697269,0x78342f00,0x7573722f,0x6c69622f,0x6e6f6e73,0x68617265, +0x642f0000,0x7573722f,0x6c69622f,0x6e6f6e73,0x68617265,0x642f0000,0x7573722f,0x6c69622f, +0x6e6f6e73,0x68617265,0x642f0000,0x6372746e,0x2e6f0000,0x2d4c0000,0x2f757372,0x2f697269, +0x78342f00,0x7573722f,0x6c69622f,0x0,0x7573722f,0x6c69622f,0x0,0x7573722f, +0x6c69622f,0x0,0x6372746e,0x2e6f0000,0x2d535953,0x54595045,0x5f535652,0x34000000, +0x2d5f5359,0x53545950,0x455f5356,0x52340000,0x2d726571,0x75697265,0x5f64796e,0x616d6963, +0x5f6c696e,0x6b000000,0x5f726c64,0x5f6e6577,0x5f696e74,0x65726661,0x63650000,0x2d69676e, +0x6f72655f,0x756e7265,0x736f6c76,0x65640000,0x2d6e6f5f,0x756e7265,0x736f6c76,0x65640000, +0x2d69676e,0x6f72655f,0x756e7265,0x736f6c76,0x65640000,0x2d6e6f5f,0x756e7265,0x736f6c76, +0x65640000,0x2d4c0000,0x2d420000,0x2d720000,0x2d640000,0x2d7a0000,0x2d470000,0x2d577800, +0x2c000000,0x2d470000,0x2f000000,0x2d4c0000,0x7573722f,0x6c69622f,0x0,0x6d697073, +0x322f6e6f,0x6e736861,0x72656400,0x2d4c0000,0x7573722f,0x6c69622f,0x0,0x6d697073, +0x32000000,0x2d4c0000,0x7573722f,0x6c69622f,0x0,0x6d697073,0x322f6e6f,0x6e736861, +0x72656400,0x2d4c0000,0x7573722f,0x6c69622f,0x0,0x6d697073,0x32000000,0x2d6c4300, +0x2d6c6300,0x2d6e6f63,0x6f756e74,0x0,0x2d636f75,0x6e740000,0x2d63636b,0x72000000, +0x2d6e6f63,0x6f756e74,0x0,0x2d6c7465,0x726d6361,0x70000000,0x72000000,0x2d6c6b61, +0x70696f00,0x2d6c6b61,0x70696f00,0x2d6c635f,0x73000000,0x2d6c6300,0x2d6c6d70,0x63000000, +0x2d6c635f,0x73000000,0x2d6c635f,0x73000000,0x2d6c6300,0x2d6c6d70,0x63000000,0x2d6c4300, +0x2d6c635f,0x73000000,0x2d6c635f,0x73000000,0x2d6c6300,0x612e6f75,0x74000000,0x632b2b66, +0x696c7400,0x612e6f75,0x74000000,0x636f7264,0x0,0x2d760000,0x612e6f75,0x74000000, +0x2d6f0000,0x2e666200,0x2d737973,0x74797065,0x0,0x2d737973,0x74797065,0x206d7573, +0x74206861,0x76652061,0x6e206172,0x67756d65,0x6e740a00,0x73767234,0x0,0x6f6e6c79, +0x20737973,0x74797065,0x20737672,0x3420616c,0x6c6f7765,0x640a0000,0x73767234,0x0, +0x62736434,0x33000000,0x73767233,0x0,0x73797376,0x0,0x2f000000,0x72000000, +0x54686973,0x20737973,0x74797065,0x20646f65,0x736e2774,0x20657869,0x7374206f,0x6e207468, +0x6973206d,0x61636869,0x6e653b20,0x6368616e,0x67656420,0x73797374,0x79706520,0x746f2073, +0x7672332e,0xa000000,0x73767233,0x0,0x2f000000,0x2f000000,0x7573722f,0x6c69622f, +0x0,0x636f6d70,0x2e636f6e,0x66696700,0x72000000,0x5347495f,0x49524958,0x34000000, +0x2f757372,0x2f697269,0x78342f00,0x0,0x38000000,0x2f757372,0x2f697269,0x78342f00, +0x704b666a,0x7273756c,0x6d766f63,0x61627479,0x7a000000,0x2d232069,0x73206e6f,0x74207375, +0x70706f72,0x7465642e,0x20557365,0x202d7620,0x746f2073,0x65652063,0x6f6d7069,0x6c657220, +0x70617373,0x65736e00,0x2d333262,0x69740000,0x2d333200,0x2d35206e,0x6f742073,0x7570706f, +0x72746564,0xa000000,0x2d35206d,0x75737420,0x70726563,0x65646520,0x616e7920,0x2d422066, +0x6c616773,0xa000000,0x7573722f,0x35696e63,0x6c756465,0x0,0x68000000,0x2d363600, +0x2d363462,0x69740000,0x2d363462,0x6974206f,0x7074696f,0x6e206973,0x206e6f74,0x20796574, +0x20696d70,0x6c656d65,0x6e746564,0x2c206967,0x6e6f7265,0xa000000,0x2d363462,0x69742063, +0x616e206e,0x6f742062,0x65207573,0x65642077,0x69746820,0x2d73776f,0x70636f64,0x650a0000, +0x2d410000,0x6c642072,0x65717569,0x72657320,0x2d412074,0x6f206861,0x76652061,0x6e206172, +0x67756d65,0x6e740a00,0x2d417574,0x6f476e75,0x6d000000,0x30000000,0x30000000,0x2d412d00, +0x73746174,0x69630000,0x64796e61,0x6d696300,0x73796d62,0x6f6c6963,0x0,0x2d43475f, +0x454d4954,0x3a000000,0x2d43475f,0x454d4954,0x206f7074,0x696f6e73,0x20617265,0x2069676e, +0x6f726564,0xa000000,0x2d440000,0x2d442074,0x616b656e,0x20617320,0x656d7074,0x79206370, +0x70202d44,0x2c206e6f,0x74206c64,0x28312920,0x2d442068,0x65786e75,0x6d0a0000,0x2d440000, +0x6c642072,0x65717569,0x72657320,0x2d442074,0x6f206861,0x76652061,0x6e206172,0x67756d65, +0x6e740a00,0x2d454220,0x6f72202d,0x454c206d,0x75737420,0x70726563,0x65646520,0x616e7920, +0x2d422066,0x6c616773,0xa000000,0x2d454220,0x6f72202d,0x454c206d,0x75737420,0x70726563, +0x65646520,0x616e7920,0x2d422066,0x6c616773,0xa000000,0x2d47434d,0x3a000000,0x2d47434d, +0x206f7074,0x696f6e73,0x20617265,0x2069676e,0x6f726564,0xa000000,0x2d472063,0x616e206e, +0x6f742062,0x65207573,0x65642077,0x69746820,0x2d646e20,0xa000000,0x2d472072,0x65717569, +0x72657320,0x61206465,0x63696d61,0x6c206e75,0x6d626572,0x20617267,0x756d656e,0x740a0000, +0x30000000,0x30000000,0x6e6f6e2d,0x64696769,0x74206368,0x61726163,0x74657220,0x696e202d, +0x47202573,0xa000000,0x664b4d64,0x6b6a7573,0x6d6f6361,0x62000000,0x556e6b6e,0x6f776e20, +0x63686172,0x61637465,0x7220696e,0x2025730a,0x0,0x2d490000,0x2d490000,0x2d490000, +0x2d4a7366,0x6d000000,0x6d696e61,0x62690000,0x66706500,0x2d4b6670,0x65000000,0x73640000, +0x2d4b7364,0x0,0x737a0000,0x2d4b737a,0x0,0x6d617500,0x2d4b6d61,0x75000000, +0x50494300,0x43616e27,0x74206d69,0x78202d4b,0x50494320,0x616e6420,0x2d6e6f6e,0x5f736861, +0x7265642c,0x20636861,0x6e676520,0x746f202d,0x6e6f6e5f,0x73686172,0x65640a00,0x6d696e61, +0x62690000,0x66706500,0x2d4b6670,0x65000000,0x73640000,0x2d4b7364,0x0,0x737a0000, +0x2d4b737a,0x0,0x6d617500,0x2d4b6d61,0x75000000,0x50494300,0x43616e27,0x74206d69, +0x78202d4b,0x50494320,0x616e6420,0x2d6e6f6e,0x5f736861,0x7265642c,0x20636861,0x6e676520, +0x746f202d,0x6e6f6e5f,0x73686172,0x65640a00,0x2d4b5049,0x43000000,0x43616e27,0x74206d69, +0x78202d4b,0x50494320,0x616e6420,0x2d6e6f6e,0x5f736861,0x7265642c,0x20636861,0x6e676520, +0x746f202d,0x6e6f6e5f,0x73686172,0x65640a00,0x75706461,0x74650000,0x69676e6f,0x72650000, +0x69676e6f,0x72656469,0x72000000,0x74617267,0x65740000,0x2573206d,0x75737420,0x62652066, +0x6f6c6c6f,0x77656420,0x62792061,0x2066696c,0x65206e61,0x6d650a00,0x2d4f6c69,0x6d697400, +0x35303030,0x0,0x30000000,0x2d4f6c69,0x6d697400,0x2d4f6c69,0x6d697420,0x6d757374, +0x20686176,0x6520616e,0x20617267,0x756d656e,0x740a0000,0x6e6f6e2d,0x64696769,0x74206368, +0x61726163,0x74657220,0x696e202d,0x4f6c696d,0x69742025,0x730a0000,0x2d4f5054,0x3a000000, +0x2d4f5054,0x206f7074,0x696f6e73,0x20617265,0x2069676e,0x6f726564,0xa000000,0x2d517900, +0x2d516e00,0x2d535750,0x3a000000,0x2d535750,0x206f7074,0x696f6e73,0x20617265,0x2069676e, +0x6f726564,0xa000000,0x2d540000,0x6c642072,0x65717569,0x72657320,0x2d542074,0x6f206861, +0x76652061,0x6e206172,0x67756d65,0x6e740a00,0x2d544152,0x473a0000,0x2d544152,0x47206f70, +0x74696f6e,0x73206172,0x65206967,0x6e6f7265,0x640a0000,0x2d54454e,0x563a0000,0x2d54454e, +0x56206f70,0x74696f6e,0x73206172,0x65206967,0x6e6f7265,0x640a0000,0x2d562069,0x73206e6f, +0x74207375,0x70706f72,0x7465642e,0xa000000,0x2d565300,0x2d565300,0x6c642072,0x65717569, +0x72657320,0x2d565320,0x746f2068,0x61766520,0x616e2061,0x7267756d,0x656e740a,0x0, +0x2d574b20,0x6f6e6c79,0x2076616c,0x69642069,0x6e20464f,0x52545241,0x4e206f72,0x20432063, +0x6f6d7069,0x6c617469,0x6f6e732e,0xa000000,0x6c6f6f70,0x756e726f,0x6c6c0000,0x2d472072, +0x65717569,0x72657320,0x61206465,0x63696d61,0x6c206e75,0x6d626572,0x20617267,0x756d656e, +0x740a0000,0x30000000,0x30000000,0x6e6f6e2d,0x64696769,0x74206368,0x61726163,0x74657220, +0x696e202d,0x47202573,0xa000000,0x524f4f54,0x44495200,0x524f4f54,0x44495220,0x656e7620, +0x76617220,0x69676e6f,0x7265642c,0x20757365,0x20434f4d,0x505f5441,0x52474554,0x5f524f4f, +0x5420616e,0x6420434f,0x4d505f48,0x4f53545f,0x524f4f54,0xa000000,0x2d442074,0x616b656e, +0x20617320,0x656d7074,0x79206370,0x70202d44,0x2c206e6f,0x74206c64,0x28312920,0x2d442068, +0x65786e75,0x6d0a0000,0x2d440000,0x6c642072,0x65717569,0x72657320,0x2d442074,0x6f206861, +0x76652061,0x6e206172,0x67756d65,0x6e740a00,0x2c000000,0x2d4b0000,0x2c000000,0x2d410000, +0x6c642072,0x65717569,0x72657320,0x2d412074,0x6f206861,0x76652061,0x6e206172,0x67756d65, +0x6e740a00,0x556e6b6e,0x6f776e20,0x70617373,0x20636861,0x72616374,0x65722069,0x6e202573, +0xa000000,0x2d586370,0x6c757363,0x6f6d6d00,0x2d587400,0x2d737464,0x30000000,0x2d586300, +0x2d737464,0x31000000,0x2d586100,0x2d737464,0x0,0x2d587072,0x6f746f74,0x79706573, +0x0,0x2d586e64,0x6c6f6361,0x6c646174,0x61000000,0x2d586c6f,0x63616c64,0x61746100, +0x2d586e64,0x626c6f63,0x6b000000,0x2d58626c,0x6f636b00,0x2d58616c,0x69676e62,0x73730000, +0x2d586e6f,0x616c6967,0x6e627373,0x0,0x2d586361,0x63686573,0x697a6500,0x2d586361, +0x6368656c,0x696e6573,0x697a6500,0x2d586465,0x666d6f76,0x656d6178,0x0,0x2d587365, +0x74616c69,0x676e0000,0x2d58626c,0x6f636b72,0x616e6765,0x0,0x2573206d,0x75737420, +0x68617665,0x20616e20,0x61726775,0x6d656e74,0xa000000,0x2d616c6c,0x0,0x2d617574, +0x6f5f696e,0x636c7564,0x65000000,0x2d616e73,0x69000000,0x70000000,0x2d616e73,0x69706f73, +0x69780000,0x70000000,0x2d616269,0x0,0x2d445f41,0x42495f53,0x4f555243,0x45000000, +0x2d616269,0x0,0x2d616269,0x0,0x2d616370,0x70000000,0x696e7661,0x6c696420, +0x6f707469,0x6f6e2025,0x7320666f,0x72204465,0x6c74612f,0x432b2b25,0x73202d20,0x69676e6f, +0x7265640a,0x0,0x0,0x70000000,0x2d616c69,0x676e3800,0x2d616c69,0x676e3136, +0x0,0x2d616c69,0x676e3332,0x0,0x2d616c69,0x676e3634,0x0,0x2d616c69, +0x676e5f63,0x6f6d6d6f,0x6e000000,0x2d616c69,0x676e3800,0x2d616c69,0x676e3136,0x0, +0x2d616c69,0x676e3332,0x0,0x2d616c69,0x676e3634,0x0,0x2d617574,0x6f6d6174, +0x69630000,0x2d616e73,0x69000000,0x2d617063,0x0,0x2d616c69,0x676e3800,0x2d616c69, +0x676e3136,0x0,0x2d616c69,0x676e3332,0x0,0x2d616c69,0x676e3634,0x0, +0x2d616a65,0x6f700000,0x2d6e6f5f,0x72343030,0x305f6669,0x78000000,0x2d626573,0x74476e75, +0x6d000000,0x2d627974,0x65726563,0x6c656e00,0x2d626163,0x6b736c61,0x73680000,0x2d63636b, +0x72000000,0x2d636665,0x0,0x696e7661,0x6c696420,0x6f707469,0x6f6e2025,0x7320666f, +0x72204465,0x6c74612f,0x432b2b25,0x73202d20,0x69676e6f,0x7265640a,0x0,0x0, +0x70000000,0x2d636f6d,0x6d6f6e00,0x696e7661,0x6c696420,0x6f707469,0x6f6e2025,0x7320666f, +0x72204465,0x6c74612f,0x432b2b25,0x73202d20,0x69676e6f,0x7265640a,0x0,0x0, +0x2d58636f,0x6d6d6f6e,0x0,0x2d636163,0x6865737a,0x0,0x2d636163,0x6865737a, +0x206d7573,0x74206861,0x76652061,0x6e206172,0x67756d65,0x6e740a00,0x6e6f6e2d,0x64696769, +0x74206368,0x61726163,0x74657220,0x696e202d,0x47202573,0xa000000,0x2d63706c,0x75730000, +0x2d63706c,0x75730000,0x2d637070,0x0,0x2d637070,0x20697320,0x64656661,0x756c740a, +0x0,0x2d636f72,0x64000000,0x2d636f66,0x66000000,0x2d63616c,0x6c5f7368,0x61726564, +0x0,0x2d636f75,0x6e740000,0x2d636f75,0x6e74616c,0x6c000000,0x2d63616c,0x6c5f7368, +0x61726564,0x0,0x2d637274,0x30000000,0x63727430,0x2e6f0000,0x6d637274,0x302e6f00, +0x72000000,0x2d637274,0x31000000,0x61637274,0x312e6f00,0x63727431,0x2e6f0000,0x6d637274, +0x312e6f00,0x72000000,0x2d636173,0x6573656e,0x73650000,0x2d636861,0x6e67655f,0x636f6e73, +0x74000000,0x2d636861,0x6e67655f,0x636f6e73,0x74000000,0x2d636f6c,0x31323000,0x2d636f6c, +0x37320000,0x2d636861,0x72617267,0x31000000,0x2d636875,0x6e6b0000,0x2d636865,0x636b5f62, +0x6f756e64,0x73000000,0x2d636f6c,0x31323000,0x2d636865,0x636b5f62,0x6f756e64,0x73000000, +0x2d430000,0x2d636875,0x6e6b3d00,0x2d636875,0x6e6b3d00,0x2d636875,0x6e6b3d00,0x2d6d705f, +0x6368756e,0x6b3d0000,0x2d636875,0x6e6b3d00,0x2d636f6c,0x0,0x2d636f6d,0x705f7472, +0x756e6300,0x2d636865,0x636b5f72,0x65676973,0x74727900,0x2d636865,0x636b5f72,0x65676973, +0x74727920,0x72657175,0x69726573,0x20612066,0x696c656e,0x616d6520,0x61726775,0x6d656e74, +0xa000000,0x2d646f6c,0x6c617200,0x2d646f6c,0x6c617200,0x2d646f6c,0x6c617200,0x2d646f6c, +0x6c617200,0x2d58646f,0x6c6c6172,0x0,0x2d64646f,0x7074696e,0x666f0000,0x2d647900, +0x2d646e00,0x2d646e20,0x63616e20,0x6e6f7420,0x62652075,0x73656420,0x77697468,0x202d4720, +0xa000000,0x2d64646f,0x70740000,0x2d645f6c,0x696e6573,0x0,0x2d646566,0x65787400, +0x2d646c69,0x6e650000,0x2d646566,0x65787400,0x2d64656c,0x61795f6c,0x6f616400,0x2d646566, +0x61756c74,0x5f64656c,0x61795f6c,0x6f616400,0x2d657863,0x70740000,0x2d657863,0x70742069, +0x73206e6f,0x74207375,0x70706f72,0x74656420,0x696e2073,0x76723420,0x656e762e,0xa000000, +0x2d656c66,0x0,0x2d657870,0x6f727400,0x2d657870,0x6f727473,0x0,0x2d657870, +0x6f727465,0x645f7379,0x6d626f6c,0x0,0x2d657870,0x6f727465,0x645f7379,0x6d626f6c, +0x20726571,0x75697265,0x73206120,0x73796d62,0x6f6c2061,0x7267756d,0x656e740a,0x0, +0x2d657870,0x6f727473,0x5f66696c,0x65000000,0x2d657870,0x6f727473,0x5f66696c,0x65207265, +0x71756972,0x65732061,0x2066696c,0x656e616d,0x65206172,0x67756d65,0x6e740a00,0x2d657863, +0x6c756465,0x0,0x2d657863,0x6c756465,0x20726571,0x75697265,0x73206120,0x66696c65, +0x6e616d65,0x20617267,0x756d656e,0x740a0000,0x2d650000,0x6c642072,0x65717569,0x72657320, +0x2d652074,0x6f206861,0x76652061,0x6e206172,0x67756d65,0x6e740a00,0x2d657861,0x63745f76, +0x65727369,0x6f6e0000,0x2d656c66,0x0,0x2d657874,0x656e645f,0x736f7572,0x63650000, +0x2d657870,0x616e645f,0x696e636c,0x75646500,0x2d656469,0x74000000,0x74686520,0x636f7272, +0x65637420,0x2d656469,0x74206f70,0x74696f6e,0x20737962,0x74617820,0x6973202d,0x65646974, +0x5b302d39,0x5d0a0000,0x45444954,0x4f520000,0x656d6163,0x73000000,0x76690000,0x44495350, +0x4c415900,0x25732069,0x676e6f72,0x65642066,0x6f722062,0x61636b67,0x726f756e,0x6420636f, +0x6d70696c,0x6520696e,0x206e6f6e,0x2d582065,0x6e766972,0x6f6e6d65,0x6e740a00,0x2d66756c, +0x6c5f7472,0x616e7374,0x6976655f,0x6c696e6b,0x0,0x2d666565,0x64626163,0x6b000000, +0x2d666565,0x64626163,0x6b206d75,0x73742068,0x61766520,0x616e2061,0x7267756d,0x656e740a, +0x0,0x2d66756c,0x6c61736f,0x70740000,0x2d666f72,0x63655f6c,0x6f616400,0x2d66756c, +0x6c776172,0x6e000000,0x2d586675,0x6c6c7761,0x726e0000,0x2d766572,0x626f7365,0x0, +0x2d77696d,0x706c6963,0x69740000,0x2d667261,0x6d65706f,0x696e7465,0x72000000,0x2d666c6f, +0x61740000,0x2d666c6f,0x61740000,0x2d666c6f,0x61740000,0x2d58666c,0x6f617400,0x2d666c6f, +0x61740000,0x2d667363,0x37340000,0x2d660000,0x2d662072,0x65717569,0x72657320,0x616e2061, +0x7267756d,0x656e7420,0x6f662031,0x2c20322c,0x2033206f,0x7220340a,0x0,0x2d660000, +0x6c642072,0x65717569,0x72657320,0x2d662074,0x6f206861,0x76652061,0x6e206172,0x67756d65, +0x6e740a00,0x2d686f73,0x74636163,0x68650000,0x2d68656c,0x70000000,0x2d68656c,0x70206973, +0x2069676e,0x6f726564,0x2e0a0000,0x2d686964,0x65730000,0x2d686964,0x64656e5f,0x73796d62, +0x6f6c0000,0x2d686964,0x64656e5f,0x73796d62,0x6f6c2072,0x65717569,0x72657320,0x61207379, +0x6d626f6c,0x20617267,0x756d656e,0x740a0000,0x2d686964,0x65735f66,0x696c6500,0x2d686964, +0x65735f66,0x696c6520,0x72657175,0x69726573,0x20612066,0x696c656e,0x616d6520,0x61726775, +0x6d656e74,0xa000000,0x2f000000,0x2d690000,0x6c642072,0x65717569,0x72657320,0x2d692074, +0x6f206861,0x76652061,0x6e206172,0x67756d65,0x6e740a00,0x2d696e6c,0x696e655f,0x746f0000, +0x2d696e6c,0x696e655f,0x746f206d,0x75737420,0x68617665,0x20616e20,0x61726775,0x6d656e74, +0xa000000,0x6e6f6e2d,0x64696769,0x74206368,0x61726163,0x74657220,0x696e202d,0x47202573, +0xa000000,0x2d69676e,0x6f72655f,0x756e7265,0x736f6c76,0x65640000,0x2d69676e,0x6f72655f, +0x6d696e6f,0x72000000,0x2d697269,0x78340000,0x2f757372,0x2f697269,0x78342f00,0x38000000, +0x0,0x704b666a,0x7273756c,0x6d766f63,0x61627479,0x7a000000,0x2d693200,0x2d693400, +0x2d693800,0x2d697061,0x74680000,0x2d697061,0x74680000,0x2d697061,0x7468206d,0x75737420, +0x68617665,0x20616e20,0x61726775,0x6d656e74,0xa000000,0x2d697375,0x66666978,0x0, +0x2d697375,0x66666978,0x0,0x2d697375,0x66666978,0x206d7573,0x74206861,0x76652061, +0x6e206172,0x67756d65,0x6e740a00,0x2d6a616c,0x72000000,0x2d6a6d70,0x6f707400,0x2d6b7069, +0x636f7074,0x0,0x2d6b6f20,0x776f756c,0x64206f76,0x65727772,0x69746520,0x25730a00, +0x2d6b7000,0x2d6b7500,0x69737469,0x6e670000,0x2d6c676c,0x5f730000,0x2d6c5831,0x315f7300, +0x2d6c635f,0x73000000,0x2d6d7000,0x272d6d70,0x27206d75,0x73742070,0x72656365,0x65642061, +0x6e79202d,0x4220666c,0x6167732e,0xa000000,0x66590000,0x2d6d6665,0x78740000,0x2d6d6170, +0x0,0x2d6d6970,0x73310000,0x63616e27,0x74206d69,0x78202d6d,0x69707331,0x20776974, +0x68202d64,0x776f7063,0x6f64650a,0x0,0x2d6d6970,0x73320000,0x63616e27,0x74206d69, +0x78202d6d,0x69707332,0x20776974,0x68202d6d,0x6970735b,0x312c335d,0xa000000,0x4d000000, +0x2d6d6970,0x73330000,0x63616e27,0x74206d69,0x78202d6d,0x69707333,0x20776974,0x68202d6d, +0x6970735b,0x312c325d,0xa000000,0x2d6d6970,0x73332073,0x686f756c,0x64206e6f,0x74206265, +0x20757365,0x6420666f,0x72207563,0x6f646520,0x33322d62,0x69742063,0x6f6d7069,0x6c65730a, +0x0,0x2d6d6970,0x73332063,0x616e6e6f,0x74206265,0x20757365,0x6420666f,0x72207563, +0x6f646520,0x33322d62,0x69742063,0x6f6d7069,0x6c65730a,0x0,0x4d000000,0x2d6e6f6e, +0x5f736861,0x72656400,0x2d6e6f6e,0x5f736861,0x72656400,0x2d6d6970,0x73340000,0x2d6d6970, +0x73342063,0x616e6e6f,0x74206265,0x20757365,0x6420666f,0x72207563,0x6f646520,0x33322d62, +0x69742063,0x6f6d7069,0x6c65730a,0x0,0x2d6d705f,0x6b656570,0x0,0x2d6d705f, +0x6b656570,0x0,0x20556e6b,0x6e6f776e,0x20666c61,0x673a2025,0x730a0000,0x2d6d705f, +0x73636865,0x64747970,0x653d0000,0x2d6d705f,0x73636865,0x64747970,0x653d0000,0x2d6d705f, +0x73636865,0x64747970,0x653d0000,0x2d6e6f6b,0x7069636f,0x70740000,0x2d6e6f5f,0x756e7265, +0x736f6c76,0x65640000,0x2d6e6f5f,0x7472616e,0x73697469,0x76655f6c,0x696e6b00,0x2d6e6f69, +0x6e6c696e,0x65000000,0x2d6e6f75,0x6f707430,0x0,0x2d6e6f61,0x6c696173,0x6f6b0000, +0x2d6e6f73,0x7464696e,0x63000000,0x2d6e6f73,0x74646c69,0x62000000,0x2d6e6f70,0x726f746f, +0x74797065,0x73000000,0x2d6e6f63,0x6f756e74,0x0,0x2d6e4e00,0x2d6e6f6a,0x6d706f70, +0x74000000,0x2d6e6f6e,0x5f736861,0x72656400,0x2d6e6f6e,0x5f736861,0x72656400,0x2d6e6f6e, +0x5f736861,0x72656400,0x2d6e6f5f,0x61726368,0x69766500,0x2d6e6f5f,0x6d706300,0x2d6e6f65, +0x7874656e,0x645f736f,0x75726365,0x0,0x2d6e6f69,0x34000000,0x2d6e6f69,0x73616d00, +0x2d6e6f65,0x78706f70,0x74000000,0x2d6e6f66,0x37370000,0x2d6e6f6c,0x6f636b00,0x2d6e6f6d, +0x66646174,0x61000000,0x2d6e6f72,0x6d646174,0x61000000,0x2d6e6f63,0x70700000,0x696e7661, +0x6c696420,0x6f707469,0x6f6e2025,0x7320666f,0x72204465,0x6c74612f,0x432b2b25,0x73202d20, +0x69676e6f,0x7265640a,0x0,0x0,0x2d6e6f63,0x6f646500,0x2d6e6f5f,0x7072656c, +0x696e6b00,0x2d6e6f5f,0x6175746f,0x5f696e63,0x6c756465,0x0,0x2d6e6f6e,0x65000000, +0x2d6e6f66,0x696c7400,0x2d6e6f5f,0x64656c74,0x61000000,0x2d59444e,0x0,0x5f657870, +0x72000000,0x2d594445,0x0,0x5f696e63,0x6c756465,0x0,0x2d594449,0x0, +0x2573206d,0x75737420,0x68617665,0x20616e20,0x61726775,0x6d656e74,0xa000000,0x2573206d, +0x75737420,0x68617665,0x20616e20,0x61726775,0x6d656e74,0xa000000,0x2d6f6c64,0x5f726c00, +0x2d6f6c64,0x5f726c00,0x2d6f6c64,0x63707000,0x696e7661,0x6c696420,0x6f707469,0x6f6e2025, +0x7320666f,0x72204465,0x6c74612f,0x432b2b25,0x73202d20,0x69676e6f,0x7265640a,0x0, +0x0,0x2d6f3332,0x0,0x2d6f626a,0x6563746c,0x69737400,0x2d6f626a,0x6563746c, +0x69737420,0x6d757374,0x20626520,0x67697665,0x6e206120,0x66696c65,0x20617267,0x756d656e, +0x740a0000,0x2d6f2025,0x73207265,0x73656d62,0x6c657320,0x74686520,0x6e616d65,0x206f6620, +0x6120736f,0x75726365,0x2066696c,0x652c2064,0x6973616c,0x6c6f7765,0x640a0000,0x2d6f206d, +0x75737420,0x68617665,0x20616e20,0x61726775,0x6d656e74,0xa000000,0x2d6f6e65,0x74726970, +0x0,0x2d310000,0x2d70726f,0x746f7479,0x70657300,0x696e7661,0x6c696420,0x6f707469, +0x6f6e2025,0x7320666f,0x72204465,0x6c74612f,0x432b2b25,0x73202d20,0x69676e6f,0x7265640a, +0x0,0x0,0x2d706564,0x616e7469,0x63000000,0x696e7661,0x6c696420,0x6f707469, +0x6f6e2025,0x7320666f,0x72204465,0x6c74612f,0x432b2b25,0x73202d20,0x69676e6f,0x7265640a, +0x0,0x0,0x2d700000,0x2d706661,0x0,0x2d706661,0x70726570,0x6173732c, +0x0,0x2d706361,0x0,0x2d706361,0x206d7573,0x74207072,0x65636565,0x6420616e, +0x79202d42,0x20666c61,0x67732e0a,0x0,0x664b5900,0x2d707400,0x76000000,0x6e6f6e65, +0x0,0x75736564,0x0,0x61000000,0x616c6c00,0x2e630000,0x2e636300,0x2e632b2b, +0x0,0x2e430000,0x2e637878,0x0,0x2e435858,0x0,0x2e637070,0x0, +0x2e435050,0x0,0x756e7375,0x70706f72,0x74656420,0x73756666,0x69782069,0x6e202573, +0xa000000,0x69676e6f,0x72656420,0x756e7375,0x70706f72,0x74656420,0x6f707469,0x6f6e2025, +0x730a0000,0x2d707265,0x6c696e6b,0x0,0x2d703020,0x6f72202d,0x7031206d,0x75737420, +0x70726563,0x65646520,0x616e7920,0x2d422066,0x6c616773,0xa000000,0x25732068,0x61732062, +0x65656e20,0x73757065,0x72736564,0x65642c20,0x73656520,0x70726f66,0x20283129,0x20616e64, +0x20706978,0x69652028,0x31290a00,0x726e0000,0x2d717569,0x636b7374,0x6172745f,0x696e666f, +0x0,0x2d716c00,0x2d717000,0x2d723430,0x30300000,0x2d723630,0x30300000,0x2d726571, +0x75697265,0x5f6d696e,0x6f720000,0x2d726d5f,0x64656164,0x5f636f64,0x65000000,0x2d727061, +0x74680000,0x2d726461,0x74615f73,0x68617265,0x64000000,0x2d726461,0x74615f77,0x72697461, +0x626c6500,0x2d723800,0x2d72616e,0x67650000,0x2d726d61,0x6e736900,0x2d726d65,0x78740000, +0x2d737472,0x69637449,0x45454500,0x2d736100,0x2c000000,0x6e6f7372,0x63000000,0x53746174, +0x69632061,0x6e616c79,0x73697320,0x64697265,0x63746f72,0x7920616c,0x72656164,0x79207370, +0x65636966,0x6965640a,0x0,0x2f000000,0x2c000000,0x2d73615f,0x66730000,0x63767374, +0x61746963,0x2e66696c,0x65736574,0x0,0x2d736574,0x5f766572,0x73696f6e,0x0, +0x2d736574,0x5f766572,0x73696f6e,0x20726571,0x75697265,0x7320616e,0x20617267,0x756d656e, +0x740a0000,0x2d736f6e,0x616d6500,0x2d736f6e,0x616d6520,0x72657175,0x69726573,0x20616e20, +0x61726775,0x6d656e74,0xa000000,0x2d737973,0x74797065,0x0,0x2d737973,0x74797065, +0x206d7573,0x74206861,0x76652061,0x6e206172,0x67756d65,0x6e740a00,0x6f6e6c79,0x206f6e65, +0x202d7379,0x73747970,0x65206f70,0x74696f6e,0x20616c6c,0x6f776564,0xa000000,0x2d737973, +0x74797065,0x206d7573,0x74207072,0x65636564,0x6520616e,0x79202d42,0x20666c61,0x67730a00, +0x73767234,0x0,0x2d656c66,0x0,0x2d656c66,0x0,0x4f6e6c79,0x20737973, +0x74797065,0x20737672,0x3420616c,0x6c6f7765,0x640a0000,0x73767234,0x0,0x62736434, +0x33000000,0x73767233,0x0,0x73797376,0x0,0x2f000000,0x72000000,0x54686973, +0x20737973,0x74797065,0x20646f65,0x736e2774,0x20657869,0x7374206f,0x6e207468,0x6973206d, +0x61636869,0x6e653b20,0x6368616e,0x67656420,0x73797374,0x79706520,0x746f2073,0x7672332e, +0xa000000,0x73767233,0x0,0x2f000000,0x7573722f,0x35696e63,0x6c756465,0x0, +0x7573722f,0x696e636c,0x7564652f,0x43430000,0x7573722f,0x696e636c,0x75646500,0x68000000, +0x2d73776f,0x70636f64,0x65000000,0x2d73776f,0x70636f64,0x65206361,0x6e206e6f,0x74206265, +0x20757365,0x64207769,0x7468202d,0x64776f70,0x636f6465,0x2f2d3634,0x6269740a,0x0, +0x2d736f70,0x74206f6e,0x6c792061,0x7661696c,0x61626c65,0x20776974,0x6820466f,0x72747261, +0x6e20616e,0x6420433b,0x206f7074,0x696f6e20,0x69676e6f,0x7265642e,0xa000000,0x696e7661, +0x6c696420,0x6f707469,0x6f6e2025,0x7320666f,0x72204465,0x6c74612f,0x432b2b25,0x73202d20, +0x69676e6f,0x7265640a,0x0,0x0,0x2d73686f,0x77000000,0x2d73686f,0x77300000, +0x2d73686f,0x776d0000,0x2d736d61,0x72740000,0x2d736861,0x72656400,0x2d737464,0x30000000, +0x2d737464,0x0,0x2d737464,0x31000000,0x2d736967,0x6e656400,0x2d736967,0x6e656400, +0x2d736967,0x6e656400,0x2d587369,0x676e6564,0x0,0x2d737464,0x0,0x2d737464, +0x30000000,0x2d737464,0x31000000,0x2d737464,0x0,0x2d737461,0x74696300,0x2d736861, +0x72655f00,0x696f0000,0x616c6c00,0x2d737464,0x0,0x2d737570,0x705f636f,0x62383500, +0x2d737570,0x705f636f,0x64000000,0x2d737570,0x705f726d,0x0,0x2d736967,0x6e656400, +0x2d747261,0x6e736974,0x6976655f,0x6c696e6b,0x0,0x2d747261,0x70757600,0x2d746670, +0x0,0x2d747261,0x64697469,0x6f6e616c,0x0,0x2573206e,0x6f742073,0x7570706f, +0x72746564,0xa000000,0x2573206e,0x6f742073,0x7570706f,0x72746564,0xa000000,0x2573206e, +0x6f742073,0x7570706f,0x72746564,0xa000000,0x2573206e,0x6f742073,0x7570706f,0x72746564, +0xa000000,0x2573206e,0x6f742073,0x7570706f,0x72746564,0xa000000,0x2573206e,0x6f742073, +0x7570706f,0x72746564,0xa000000,0x2573206e,0x6f742073,0x7570706f,0x72746564,0xa000000, +0x2573206e,0x6f742073,0x7570706f,0x72746564,0xa000000,0x2573206e,0x6f742073,0x7570706f, +0x72746564,0xa000000,0x2d5a4700,0x2d5a6720,0x6973206f,0x62736f6c,0x65746520,0x616e6420, +0x69732069,0x676e6f72,0x65642e0a,0x0,0x70657268,0x61707320,0x7265706c,0x61636520, +0x2d5a6720,0x77697468,0x202d6c67,0x6c5f732e,0x20536565,0x20796f75,0x72206772,0x61706869, +0x63732064,0x6f63756d,0x656e7461,0x74696f6e,0x2e0a0000,0x70657268,0x61707320,0x7265706c, +0x61636520,0x2d5a6720,0x77697468,0x202d6c66,0x676c202d,0x6c676c5f,0x73202053,0x65652066, +0x37372831,0x292e0a00,0x70657268,0x61707320,0x7265706c,0x61636520,0x2d5a6720,0x77697468, +0x202d6c70,0x676c202f,0x7573722f,0x6c69622f,0x70326373,0x74722e6f,0x202d6c67,0x6c5f7320, +0x20536565,0x20706328,0x31292e0a,0x0,0x2d5a7220,0x6973206f,0x62736f6c,0x65746520, +0x616e6420,0x69732069,0x676e6f72,0x65642e0a,0x0,0x2d737464,0x0,0x2d737464, +0x0,0x2d737464,0x0,0x2d737464,0x0,0x2d737464,0x0,0x2573206e, +0x6f742073,0x7570706f,0x72746564,0xa000000,0x556e6b6e,0x6f776e20,0x63686172,0x61637465, +0x7220696e,0x2025730a,0x0,0x25732069,0x73206465,0x6661756c,0x740a0000,0x25732069, +0x73206465,0x6661756c,0x740a0000,0x556e6b6e,0x6f776e20,0x63686172,0x61637465,0x7220696e, +0x2025730a,0x0,0x2d756f70,0x74300000,0x2d750000,0x6c642072,0x65717569,0x72657320, +0x2d752074,0x6f206861,0x76652061,0x6e206172,0x67756d65,0x6e740a00,0x2d756e72,0x6f6c6c00, +0x54686973,0x20666c61,0x67206973,0x206e6f20,0x6c6f6e67,0x65722073,0x7570706f,0x72746564, +0xa000000,0x2d757365,0x66706964,0x78000000,0x2d757365,0x5f726561,0x64777269,0x74655f63, +0x6f6e7374,0x0,0x2d597230,0x0,0x2d757365,0x5f726561,0x64777269,0x74655f63, +0x6f6e7374,0x0,0x2d757365,0x5f726561,0x646f6e6c,0x795f636f,0x6e737400,0x2d597231, +0x0,0x2d757365,0x5f726561,0x646f6e6c,0x795f636f,0x6e737400,0x2d757064,0x6174655f, +0x72656769,0x73747279,0x0,0x2d757064,0x6174655f,0x72656769,0x73747279,0x20726571, +0x75697265,0x73206120,0x66696c65,0x6e616d65,0x20617267,0x756d656e,0x740a0000,0x2d766f6c, +0x6174696c,0x65000000,0x2d766f6c,0x6174696c,0x65206973,0x206e6f20,0x6c6f6e67,0x65722073, +0x7570706f,0x72746564,0x3b207573,0x65207468,0x6520766f,0x6c617469,0x6c652071,0x75616c69, +0x66696572,0x20696e73,0x74656164,0xa000000,0x2d766172,0x61726773,0x0,0x2d587661, +0x72617267,0x73000000,0x2d766572,0x626f7365,0x0,0x2d766572,0x626f7365,0x0, +0x2d766d73,0x0,0x2d766172,0x61726773,0x0,0x2d763200,0x696e7661,0x6c696420, +0x6f707469,0x6f6e2025,0x7320666f,0x72204465,0x6c74612f,0x432b2b25,0x73202d20,0x69676e6f, +0x7265640a,0x0,0x0,0x2d776c69,0x6e740000,0x696e7661,0x6c696420,0x6f707469, +0x6f6e2025,0x7320666f,0x72204465,0x6c74612f,0x432b2b25,0x73202d20,0x69676e6f,0x7265640a, +0x0,0x0,0x2d776f66,0x66000000,0x6f707469,0x6f6e7300,0x2d776f66,0x66207265, +0x71756972,0x65732061,0x20636f6d,0x6d612d73,0x65706172,0x61746564,0x206c6973,0x74206f66, +0x20657272,0x6f72206e,0x756d6265,0x7273202d,0x2069676e,0x6f726564,0xa000000,0x2d58776f, +0x66660000,0x2d595700,0x2d776f66,0x66207265,0x71756972,0x65732061,0x20776172,0x6e696e67, +0x206e756d,0x62657220,0x286f7220,0x61206c69,0x7374206f,0x66207468,0x656d290a,0x0, +0x556e6b6e,0x6f776e20,0x666c6167,0x3a202573,0xa000000,0x556e6b6e,0x6f776e20,0x666c6167, +0x3a202573,0xa000000,0x696e7661,0x6c696420,0x6f707469,0x6f6e2025,0x7320666f,0x72204465, +0x6c74612f,0x432b2b25,0x73202d20,0x69676e6f,0x7265640a,0x0,0x0,0x2d78616e, +0x73690000,0x70000000,0x2d78676f,0x74000000,0x2d626967,0x5f676f74,0x0,0x696e7661, +0x6c696420,0x6f707469,0x6f6e2025,0x7320666f,0x72204465,0x6c74612f,0x432b2b25,0x73202d20, +0x69676e6f,0x7265640a,0x0,0x0,0x2d6a0000,0x6d616c66,0x6f726d65,0x64206f72, +0x20756e6b,0x6e6f776e,0x206f7074,0x696f6e3a,0x2025730a,0x0,0x6d616c66,0x6f726d65, +0x64206f72,0x20756e6b,0x6e6f776e,0x206f7074,0x696f6e3a,0x2025730a,0x0,0x2d4d4469, +0x676e6f72,0x65000000,0x2d594d00,0x2d597400,0x2d4d4475,0x70646174,0x65000000,0x2d4d4474, +0x61726765,0x74000000,0x2d4d4469,0x676e6f72,0x65000000,0x2d4d4475,0x70646174,0x65000000, +0x2d4d4474,0x61726765,0x74000000,0x752e6f75,0x742e6f00,0x612e6f75,0x74000000,0x2d4d4475, +0x70646174,0x65000000,0x2d4d4475,0x70646174,0x65000000,0x496e7465,0x726e616c,0x0, +0x4572726f,0x72000000,0x5761726e,0x696e6700,0x496e666f,0x0,0x46697800,0x0, +0x25733a20,0x4572726f,0x723a2065,0x72726f72,0x2028292c,0x2025643a,0x204f7574,0x206f6620, +0x6d656d6f,0x72790a00,0x25733a20,0x25730a00,0x25733a20,0x0,0x25733a20,0x25733a20, +0x0,0x25732c20,0x6c696e65,0x2025643a,0x20000000,0x25733a20,0x0,0x25732c20, +0x6c696e65,0x2025643a,0x20000000,0x25733a20,0x0,0x0,0x0,0x68706665, +0x6b6a7573,0x6d766f64,0x71636162,0x6c797a72,0x50314558,0x434f6e4d,0x46495355,0x744b5977, +0x0,0x30000000,0x50453143,0x4f4d4649,0x5553586e,0x57000000,0x7573722f,0x35696e63, +0x6c756465,0x0,0x7573722f,0x696e636c,0x7564652f,0x61626900,0x7573722f,0x696e636c, +0x7564652f,0x43430000,0x7573722f,0x696e636c,0x75646500,0x7573722f,0x35696e63,0x6c756465, +0x0,0x7573722f,0x696e636c,0x7564652f,0x61626900,0x7573722f,0x696e636c,0x7564652f, +0x43430000,0x7573722f,0x696e636c,0x75646500,0x63707000,0x61637070,0x0,0x7573722f, +0x6c69622f,0x0,0x63707000,0x61637070,0x0,0x6d706300,0x6163636f,0x6d000000, +0x63636f6d,0x0,0x65646763,0x7066652e,0x616c7400,0x65646763,0x70666500,0x63666500, +0x75706173,0x0,0x66636f6d,0x0,0x706c3166,0x65000000,0x636f6266,0x65000000, +0x7573722f,0x6c69622f,0x0,0x6d706300,0x7573722f,0x6c69622f,0x0,0x6163636f, +0x6d000000,0x63636f6d,0x0,0x7573722f,0x6c69622f,0x4443432f,0x0,0x65646763, +0x7066652e,0x616c7400,0x65646763,0x70666500,0x63666500,0x7573722f,0x6c69622f,0x0, +0x65646763,0x7066652e,0x616c7400,0x65646763,0x70666500,0x63666500,0x7573722f,0x6c69622f, +0x0,0x75706173,0x0,0x7573722f,0x6c69622f,0x0,0x66636f6d,0x0, +0x7573722f,0x6c69622f,0x0,0x706c3166,0x65000000,0x7573722f,0x6c69622f,0x0, +0x636f6266,0x65000000,0x706c3165,0x72726f72,0x0,0x7573722f,0x6c69622f,0x0, +0x706c3165,0x72726f72,0x0,0x756c7069,0x0,0x7573722f,0x6c69622f,0x0, +0x756c7069,0x0,0x756a6f69,0x6e000000,0x7573722f,0x6c69622f,0x0,0x756a6f69, +0x6e000000,0x756c6400,0x7573722f,0x6c69622f,0x0,0x756c6400,0x7573706c,0x69740000, +0x7573722f,0x6c69622f,0x0,0x7573706c,0x69740000,0x756f7074,0x30000000,0x7573722f, +0x6c69622f,0x0,0x756f7074,0x30000000,0x64646f70,0x74000000,0x7573722f,0x6c69622f, +0x0,0x64646f70,0x74000000,0x756d6572,0x67650000,0x7573722f,0x6c69622f,0x0, +0x756d6572,0x67650000,0x756c6f6f,0x70000000,0x7573722f,0x6c69622f,0x0,0x756c6f6f, +0x70000000,0x756f7074,0x0,0x7573722f,0x6c69622f,0x4443432f,0x0,0x756f7074, +0x0,0x7573722f,0x6c69622f,0x0,0x756f7074,0x0,0x7567656e,0x0, +0x7573722f,0x6c69622f,0x4443432f,0x0,0x7567656e,0x0,0x7573722f,0x6c69622f, +0x0,0x7567656e,0x0,0x61733000,0x7573722f,0x6c69622f,0x0,0x61733000, +0x61733100,0x7573722f,0x6c69622f,0x4443432f,0x0,0x61733100,0x7573722f,0x6c69622f, +0x0,0x61733100,0x6564675f,0x7072656c,0x696e6b00,0x7573722f,0x6c69622f,0x4443432f, +0x0,0x6564675f,0x7072656c,0x696e6b00,0x6c640000,0x632b2b70,0x61746368,0x0, +0x632b2b66,0x696c7400,0x7573722f,0x6c69622f,0x4443432f,0x0,0x6c640000,0x7573722f, +0x62696e2f,0x0,0x6c640000,0x7573722f,0x6c69622f,0x0,0x6c640000,0x7573722f, +0x6c69622f,0x4443432f,0x0,0x632b2b70,0x61746368,0x0,0x7573722f,0x6c69622f, +0x4443432f,0x0,0x632b2b66,0x696c7400,0x62746f75,0x0,0x75746f62,0x0, +0x7573722f,0x6c69622f,0x0,0x62746f75,0x0,0x7573722f,0x6c69622f,0x0, +0x75746f62,0x0,0x66746f63,0x0,0x7573722f,0x6c69622f,0x0,0x66746f63, +0x0,0x636f7264,0x0,0x7573722f,0x62696e2f,0x0,0x636f7264,0x0, +0x632b2b69,0x6e69742e,0x6f000000,0x64656c74,0x615f696e,0x69742e6f,0x0,0x6372746e, +0x2e6f0000,0x632b2b69,0x6e69742e,0x6f000000,0x64656c74,0x615f696e,0x69742e6f,0x0, +0x6372746e,0x2e6f0000,0x6372746e,0x2e6f0000,0x632b2b69,0x6e69742e,0x6f000000,0x64656c74, +0x615f696e,0x69742e6f,0x0,0x6372746e,0x2e6f0000,0x632b2b69,0x6e69742e,0x6f000000, +0x64656c74,0x615f696e,0x69742e6f,0x0,0x6372746e,0x2e6f0000,0x632b2b69,0x6e69742e, +0x6f000000,0x64656c74,0x615f696e,0x69742e6f,0x0,0x6372746e,0x2e6f0000,0x632b2b69, +0x6e69742e,0x6f000000,0x64656c74,0x615f696e,0x69742e6f,0x0,0x6372746e,0x2e6f0000, +0x632b2b69,0x6e69742e,0x6f000000,0x64656c74,0x615f696e,0x69742e6f,0x0,0x6372746e, +0x2e6f0000,0x632b2b69,0x6e69742e,0x6f000000,0x64656c74,0x615f696e,0x69742e6f,0x0, +0x2d4c0000,0x2d420000,0x2d4c0000,0x6c696270,0x2e620000,0x2d6c7000,0x7573722f,0x6c69622f, +0x6e6f6e73,0x68617265,0x642f0000,0x6c696270,0x2e620000,0x7573722f,0x6c69622f,0x0, +0x6c696270,0x2e620000,0x6c696270,0x6c312e62,0x0,0x2d6c706c,0x31000000,0x7573722f, +0x6c69622f,0x6e6f6e73,0x68617265,0x642f0000,0x6c696270,0x6c312e62,0x0,0x7573722f, +0x6c69622f,0x0,0x6c696270,0x6c312e62,0x0,0x2d4c0000,0x2d420000,0x2d4c0000, +0x2d420000,0x2d4c0000,0x2d4c0000,0x6c696265,0x78632e62,0x0,0x2d4c0000,0x2d420000, +0x2d4c0000,0x2d420000,0x2d6c6578,0x63000000,0x2d6c6d6c,0x64000000,0x7573722f,0x6c69622f, +0x6e6f6e73,0x68617265,0x642f0000,0x6c696265,0x78632e62,0x0,0x7573722f,0x6c69622f, +0x0,0x6c696265,0x78632e62,0x0,0x2d4c0000,0x2d420000,0x2d4c0000,0x6c696264, +0x772e6100,0x6c696264,0x772e6200,0x2d4c0000,0x7573722f,0x6c69622f,0x6e6f6e73,0x68617265, +0x642f0000,0x202d4200,0x2d4c0000,0x7573722f,0x6c69622f,0x0,0x202d4200,0x2d4c0000, +0x7573722f,0x6c69622f,0x0,0x2d4c0000,0x7573722f,0x6c69622f,0x0,0x7573722f, +0x6c69622f,0x6e6f6e73,0x68617265,0x642f0000,0x6c696264,0x772e6100,0x7573722f,0x6c69622f, +0x6e6f6e73,0x68617265,0x642f0000,0x6c696264,0x772e6200,0x7573722f,0x6c69622f,0x0, +0x6c696264,0x772e6100,0x7573722f,0x6c69622f,0x0,0x6c696264,0x772e6200,0x2d4c0000, +0x202d4200,0x2d4c0000,0x6c696278,0x6d616c6c,0x6f632e62,0x0,0x2d6c786d,0x616c6c6f, +0x63000000,0x7573722f,0x6c69622f,0x6e6f6e73,0x68617265,0x642f0000,0x6c696278,0x6d616c6c, +0x6f632e62,0x0,0x7573722f,0x6c69622f,0x0,0x6c696278,0x6d616c6c,0x6f632e62, +0x0,0x6c696273,0x6f72742e,0x62000000,0x2d6c736f,0x72740000,0x7573722f,0x6c69622f, +0x6e6f6e73,0x68617265,0x642f0000,0x6c696273,0x6f72742e,0x62000000,0x7573722f,0x6c69622f, +0x0,0x6c696273,0x6f72742e,0x62000000,0x2d4c0000,0x202d4200,0x2d4c0000,0x6c696270, +0x726f662e,0x61000000,0x6c696270,0x726f662e,0x61000000,0x202d4200,0x2d4c0000,0x6c69626d, +0x2e620000,0x6c69626d,0x5f6d6970,0x73322e61,0x0,0x6c69626d,0x5f6d6970,0x73322e62, +0x0,0x6c69626d,0x5f6d6970,0x73332e61,0x0,0x6c69626d,0x5f6d6970,0x73332e62, +0x0,0x2d6c6d00,0x7573722f,0x6c69622f,0x6e6f6e73,0x68617265,0x642f0000,0x6c69626d, +0x2e620000,0x7573722f,0x6c69622f,0x0,0x6c69626d,0x2e620000,0x7573722f,0x6c69622f, +0x6e6f6e73,0x68617265,0x642f0000,0x6c69626d,0x5f6d6970,0x73322e61,0x0,0x7573722f, +0x6c69622f,0x6e6f6e73,0x68617265,0x642f0000,0x6c69626d,0x5f6d6970,0x73322e62,0x0, +0x7573722f,0x6c69622f,0x0,0x6c69626d,0x5f6d6970,0x73322e61,0x0,0x7573722f, +0x6c69622f,0x0,0x6c69626d,0x5f6d6970,0x73322e62,0x0,0x7573722f,0x6c69622f, +0x6e6f6e73,0x68617265,0x642f0000,0x6c69626d,0x5f6d6970,0x73332e61,0x0,0x7573722f, +0x6c69622f,0x6e6f6e73,0x68617265,0x642f0000,0x6c69626d,0x5f6d6970,0x73332e62,0x0, +0x7573722f,0x6c69622f,0x0,0x6c69626d,0x5f6d6970,0x73332e61,0x0,0x7573722f, +0x6c69622f,0x0,0x6c69626d,0x5f6d6970,0x73332e62,0x0,0x2d4c0000,0x202d4200, +0x2d4c0000,0x6c696246,0x37372e62,0x0,0x2d6c6674,0x6e000000,0x2d6c4637,0x37000000, +0x7573722f,0x6c69622f,0x6e6f6e73,0x68617265,0x642f0000,0x6c696246,0x37372e62,0x0, +0x7573722f,0x6c69622f,0x0,0x6c696246,0x37372e62,0x0,0x2d4c0000,0x202d4200, +0x2d4c0000,0x6c696249,0x37372e62,0x0,0x2d6c4937,0x37000000,0x7573722f,0x6c69622f, +0x6e6f6e73,0x68617265,0x642f0000,0x6c696249,0x37372e62,0x0,0x7573722f,0x6c69622f, +0x0,0x6c696249,0x37372e62,0x0,0x2d4c0000,0x202d4200,0x2d4c0000,0x6c696269, +0x73616d2e,0x62000000,0x2d6c6973,0x616d0000,0x7573722f,0x6c69622f,0x6e6f6e73,0x68617265, +0x642f0000,0x6c696269,0x73616d2e,0x62000000,0x7573722f,0x6c69622f,0x0,0x6c696269, +0x73616d2e,0x62000000,0x2d4c0000,0x202d4200,0x2d4c0000,0x6c696255,0x37372e62,0x0, +0x2d6c5537,0x37000000,0x7573722f,0x6c69622f,0x6e6f6e73,0x68617265,0x642f0000,0x6c696255, +0x37372e62,0x0,0x7573722f,0x6c69622f,0x0,0x6c696255,0x37372e62,0x0, +0x666f7074,0x0,0x636f7074,0x0,0x70666100,0x70636100,0x7573722f,0x6c69622f, +0x0,0x666f7074,0x0,0x7573722f,0x6c69622f,0x0,0x636f7074,0x0, +0x7573722f,0x6c69622f,0x0,0x70666100,0x7573722f,0x6c69622f,0x0,0x70636100, +0x6c696249,0x37375f6d,0x702e6100,0x6c696263,0x5f6d702e,0x61000000,0x2d6c4937,0x375f6d70, +0x0,0x2d6c635f,0x6d700000,0x556e6b6e,0x6f776e20,0x63686172,0x61637465,0x7220696e, +0x202d7425,0x630a0000,0x7573722f,0x356c6962,0x0,0x2f757372,0x2f697269,0x78342f00, +0x2f000000,0x65622f00,0x656c2f00,0x72503145,0x58434f6e,0x4d464953,0x55000000,0x5f473000, +0x5f473000,0x5f473000,0x5f473000,0x5f473000,0x5f473000,0x5f473000,0x5f473000,0x5f473000, +0x5f473000,0x5f473000,0x5f473000,0x5f473000,0x6c696270,0x0,0x2e610000,0x6c696265, +0x78630000,0x2e610000,0x6c696270,0x6c310000,0x2e610000,0x6c696263,0x6f620000,0x2e610000, +0x6c696273,0x6f727400,0x2e610000,0x6c69626d,0x0,0x2e610000,0x6c696246,0x37370000, +0x2e610000,0x6c696249,0x37370000,0x2e610000,0x6c696255,0x37370000,0x2e610000,0x6c696269, +0x73616d00,0x2e610000,0x6c696270,0x726f6600,0x2e610000,0x6c696278,0x6d616c6c,0x6f630000, +0x2e610000,0x6d6b7374,0x72202829,0x0,0x6f757420,0x6f66206d,0x656d6f72,0x790a0000, +0x25730a00,0x6d6b6c69,0x73742028,0x29000000,0x6f757420,0x6f66206d,0x656d6f72,0x790a0000, +0x25730a00,0x61646473,0x74722829,0x0,0x6f757420,0x6f66206d,0x656d6f72,0x790a0000, +0x25730a00,0x61646473,0x70616365,0x64737472,0x28290000,0x6f757420,0x6f66206d,0x656d6f72, +0x790a0000,0x25730a00,0x6e657773,0x74723a20,0x756e6162,0x6c652074,0x6f206d61,0x6c6c6f63, +0x20666f72,0x20737472,0x696e6720,0x25730a00,0x73617665,0x5f706c61,0x63652829,0x0, +0x6f757420,0x6f66206d,0x656d6f72,0x790a0000,0x25730a00,0x7365745f,0x706c6163,0x65202829, +0x0,0x706c6163,0x65206f75,0x74206f66,0x2072616e,0x67650000,0x6164646c,0x69737420, +0x28290000,0x6f757420,0x6f66206d,0x656d6f72,0x790a0000,0x25730a00,0x6164646c,0x69737420, +0x28290000,0x6f757420,0x6f66206d,0x656d6f72,0x790a0000,0x25730a00,0x666f7200,0x464f5200, +0x6d6b7375,0x66202829,0x0,0x70617373,0x65642061,0x6e20756e,0x6b6e6f77,0x6e207375, +0x66666978,0x2076616c,0x75653a20,0x25730a00,0x6d6b7375,0x66202829,0x0,0x42616420, +0x66696c65,0x206e616d,0x652c206e,0x6f207375,0x66666978,0x3a202573,0xa000000,0x73617665, +0x73747220,0x28290000,0x6f757420,0x6f66206d,0x656d6f72,0x790a0000,0x25730a00,0x63746d73, +0x74585858,0x58585800,0x63746d75,0x58585858,0x58580000,0x63746d70,0x58585858,0x58580000, +0x63746d66,0x58585858,0x58580000,0x63746d6c,0x75585858,0x58585800,0x63746d73,0x58585858, +0x58580000,0x63746d6d,0x58585858,0x58580000,0x63746d6f,0x58585858,0x58580000,0x63746d6f, +0x73585858,0x58585800,0x63746d63,0x62585858,0x58585800,0x63746d63,0x58585858,0x58580000, +0x63746d61,0x58585858,0x58580000,0x63746d62,0x58585858,0x58580000,0x63746d6c,0x58585858, +0x58580000,0x63746d6d,0x34585858,0x58585800,0x63746d67,0x74585858,0x58585800,0x63746d69, +0x6c585858,0x58585800,0x63746d6c,0x74585858,0x58585800,0x63746d70,0x31585858,0x58585800, +0x63746d70,0x64585858,0x58585800,0x63746d64,0x64585858,0x58585800,0x63746d6c,0x6f585858, +0x58585800,0x63746d63,0x69585858,0x58585800,0x63746d76,0x58585858,0x58580000,0x63746d65, +0x72725858,0x58585858,0x0,0x63746d65,0x6d585858,0x58585800,0x63746d65,0x58585858, +0x58580000,0x63746d64,0x58585858,0x58580000,0x63746d71,0x58585858,0x58580000,0x63746d71, +0x73585858,0x58585800,0x63746d65,0x6c665858,0x58585800,0x63746d6b,0x58585858,0x58580000, +0x63746d63,0x6d645858,0x58585858,0x0,0x63746d66,0x696c7458,0x58585858,0x58000000, +0x25732000,0x25732000,0x3c202573,0x20000000,0x3e202573,0x20000000,0xa000000,0x70697065, +0x20666169,0x6c656420,0x666f7220,0x2d73686f,0x776d0000,0x6e6f206d,0x6f726520,0x70726f63, +0x65737365,0x730a0000,0x25730a00,0x63616e27,0x74206f70,0x656e2069,0x6e707574,0x2066696c, +0x653a2025,0x730a0000,0x25730a00,0x63616e27,0x74206372,0x65617465,0x206f7574,0x70757420, +0x66696c65,0x3a202573,0xa000000,0x25730a00,0x63616e27,0x74206372,0x65617465,0x20657272, +0x6f722066,0x696c653a,0x2025730a,0x0,0x25730a00,0x25732069,0x73206e6f,0x7420696e, +0x7374616c,0x6c656420,0x28636f75,0x6c64206e,0x6f742066,0x696e6420,0x2573292e,0xa000000, +0x2573206d,0x6179206e,0x6f742062,0x6520696e,0x7374616c,0x6c656420,0x28636f75,0x6c64206e, +0x6f742066,0x696e6420,0x2573292e,0xa000000,0x63616e27,0x74206669,0x6e64206f,0x72206578, +0x65633a20,0x25730a00,0x25730a00,0x50494f43,0x4d41505f,0x53474900,0x50494f43,0x53455849, +0x54000000,0x53544f50,0x50454420,0x7369676e,0x616c2072,0x65636569,0x76656420,0x66726f6d, +0x3a202573,0x20000000,0x20285369,0x676e616c,0x20256429,0x20000000,0x2050726f,0x63657373, +0x20202564,0x20616261,0x6e646f6e,0x65640a00,0x46617461,0x6c206572,0x726f7220,0x696e3a20, +0x25732000,0x20636869,0x6c642064,0x69656420,0x64756520,0x746f2073,0x69676e61,0x6c202564, +0x2e0a0000,0x50726f62,0x61626c79,0x20636175,0x73656420,0x62792072,0x756e6e69,0x6e67206f, +0x7574206f,0x66207377,0x61702073,0x70616365,0x202d2d20,0x63686563,0x6b202f75,0x73722f61, +0x646d2f53,0x59534c4f,0x472e0a00,0x46617461,0x6c206572,0x726f7220,0x696e3a20,0x25732000, +0x20536967,0x6e616c20,0x25642000,0x2d20636f,0x72652064,0x756d7065,0x640a0000,0xa000000, +0x666f726b,0x20746f20,0x65646974,0x20666169,0x6c65640a,0x0,0x25730a00,0x2d6c0000, +0x2d660000,0x6572722d,0x77696e64,0x6f770000,0x2b310000,0x78746572,0x6d000000,0x78746572, +0x6d000000,0x2d646973,0x706c6179,0x0,0x2d6c7300,0x2d650000,0x2b310000,0x6661696c, +0x65642074,0x6f206578,0x65633a20,0x25730a00,0x25730a00,0x46617461,0x6c206572,0x726f7220, +0x696e3a20,0x25732000,0x20536967,0x6e616c20,0x25642000,0x2d20636f,0x72652064,0x756d7065, +0x640a0000,0xa000000,0x3a204572,0x726f723a,0x20000000,0x2c206c69,0x6e652000,0x4572726f, +0x72206f6e,0x206c696e,0x65200000,0x4552524f,0x52200000,0x204c494e,0x45200000,0x25730a00, +0x25732020,0x28257329,0xa000000,0x70630000,0x25732020,0x28257329,0xa000000,0x61730000, +0x25732020,0x28257329,0xa000000,0x66373700,0x25732020,0x28257329,0xa000000,0x706c3100, +0x25732020,0x28257329,0xa000000,0x636f626f,0x6c000000,0x25732020,0x28257329,0xa000000, +0x63630000,0x94d6970,0x7320436f,0x6d707574,0x65722053,0x79737465,0x6d732025,0x642e2564, +0xa000000,0x252e3266,0x7520252e,0x32667320,0x25753a25,0x30342e31,0x6620252e,0x30662525, +0xa000000,0x2f444343,0x0,0x2f000000,0x7573722f,0x6c69622f,0x61626900,0x2f000000, +0x7573722f,0x6c69622f,0x6e6f6e73,0x68617265,0x64000000,0x2f000000,0x7573722f,0x6c696200, +0x2e000000,0x2e000000,0x2f000000,0x2f000000,0x2e000000,0x6163636f,0x6d000000,0x2f757372, +0x2f6c6962,0x2f616363,0x6f6d0000,0x414e5349,0x20430000,0x63636f6d,0x0,0x2f757372, +0x2f6c6962,0x2f63636f,0x6d000000,0x414e5349,0x20430000,0x61637070,0x0,0x2f757372, +0x2f6c6962,0x2f616370,0x70000000,0x414e5349,0x20430000,0x63707000,0x2f757372,0x2f6c6962, +0x2f637070,0x0,0x44657665,0x6c6f706d,0x656e7420,0x6f707469,0x6f6e0000,0x66636f6d, +0x0,0x2f757372,0x2f6c6962,0x2f66636f,0x6d000000,0x466f7274,0x72616e00,0x666f7074, +0x0,0x2f757372,0x2f6c6962,0x2f666f70,0x74000000,0x466f7274,0x72616e00,0x70666100, +0x2f757372,0x2f6c6962,0x2f706661,0x0,0x506f7765,0x7220466f,0x72747261,0x6e000000, +0x6163636f,0x6d5f6d70,0x0,0x2f757372,0x2f6c6962,0x2f616363,0x6f6d5f6d,0x70000000, +0x506f7765,0x72204300,0x63636f6d,0x5f6d7000,0x2f757372,0x2f6c6962,0x2f63636f,0x6d5f6d70, +0x0,0x506f7765,0x72204300,0x70636100,0x2f757372,0x2f6c6962,0x2f706361,0x0, +0x506f7765,0x72204300,0x636f7074,0x0,0x2f757372,0x2f6c6962,0x2f636f70,0x74000000, +0x414e5349,0x20430000,0x75706173,0x0,0x2f757372,0x2f6c6962,0x2f757061,0x73000000, +0x50617363,0x616c0000,0x706c3166,0x65000000,0x2f757372,0x2f6c6962,0x2f706c31,0x66650000, +0x504c2f31,0x0,0x706c3165,0x72726f72,0x0,0x2f757372,0x2f6c6962,0x2f706c31, +0x6572726f,0x72000000,0x504c2f31,0x0,0x61733000,0x2f757372,0x2f6c6962,0x2f617330, +0x0,0x44657665,0x6c6f706d,0x656e7420,0x6f707469,0x6f6e0000,0x61733100,0x2f757372, +0x2f6c6962,0x2f617331,0x0,0x44657665,0x6c6f706d,0x656e7420,0x6f707469,0x6f6e0000, +0x6c640000,0x2f757372,0x2f6c6962,0x2f6c6400,0x44657665,0x6c6f706d,0x656e7420,0x6f707469, +0x6f6e0000,0x636f6266,0x65000000,0x2f757372,0x2f6c6962,0x2f636f62,0x66650000,0x434f424f, +0x4c000000,0x65646763,0x70666500,0x2f757372,0x2f6c6962,0x2f444343,0x2f656467,0x63706665, +0x0,0x44656c74,0x6120432b,0x2b000000,0x65646763,0x7066652e,0x616c7400,0x2f757372, +0x2f6c6962,0x2f444343,0x2f656467,0x63706665,0x2e616c74,0x0,0x44656c74,0x6120432b, +0x2b000000,0x2d637878,0x0,0x25733a20,0x0,0x66756c6c,0x5f706174,0x68000000, +0x2f000000,0x2e256400,0x0,0x63767374,0x61746963,0x2e66696c,0x65736574,0x0, +0x63767374,0x61746963,0x2e66696c,0x65736574,0x0,0x53746174,0x69632066,0x696c6573, +0x65743a20,0x25732025,0x73000000,0x20257300,0xa000000,0x772b0000,0x7265636f,0x72645f73, +0x74617469,0x635f6669,0x6c657365,0x74000000,0x636f756c,0x64206e6f,0x74206f70,0x656e2063, +0x76737461,0x74696320,0x66696c65,0x73657420,0x74656d70,0x2066696c,0x65202573,0xa000000, +0x7265636f,0x72645f73,0x74617469,0x635f6669,0x6c657365,0x74000000,0x636f756c,0x64206e6f, +0x74206f70,0x656e206f,0x72206372,0x65617465,0x20637673,0x74617469,0x63206669,0x6c657365, +0x74206669,0x6c652025,0x730a0000,0x7265636f,0x72645f73,0x74617469,0x635f6669,0x6c657365, +0x74000000,0x6572726f,0x7220696e,0x206c6f63,0x6b696e67,0x20637673,0x74617469,0x63206669, +0x6c657365,0x74206669,0x6c652025,0x730a0000,0x7265636f,0x72645f73,0x74617469,0x635f6669, +0x6c657365,0x74000000,0x636f756c,0x64206e6f,0x74206673,0x74617420,0x63767374,0x61746963, +0x2066696c,0x65736574,0x2066696c,0x65202573,0xa000000,0x2d637673,0x74617469,0x630a0000, +0x722b0000,0x7265636f,0x72645f73,0x74617469,0x635f6669,0x6c657365,0x74000000,0x636f756c, +0x64206e6f,0x74206664,0x6f70656e,0x20637673,0x74617469,0x63206669,0x6c657365,0x74206669, +0x6c652025,0x730a0000,0x25732025,0x73000000,0x20257300,0xa000000,0x7265636f,0x72645f73, +0x74617469,0x635f6669,0x6c657365,0x74000000,0x6572726f,0x7220696e,0x20777269,0x74696e67, +0x20637673,0x74617469,0x63206669,0x6c657365,0x74206669,0x6c652025,0x730a0000,0x25733a20, +0x746f7563,0x68202573,0xa000000,0x25733a20,0x746f7563,0x68202573,0x0,0x2d420000, +0x2d6f0000,0x2d6f0000,0x20202000,0x69690000,0x2e696900,0x2f69695f,0x66696c65,0x732f0000, +0x2e4e4557,0x0,0x72000000,0x25733a20,0x75706461,0x74655f69,0x6e737461,0x6e746961, +0x74696f6e,0x5f696e66,0x6f5f6669,0x6c652025,0x730a0000,0x77000000,0x75706461,0x74655f69, +0x6e737461,0x6e746961,0x74696f6e,0x5f696e66,0x6f5f6669,0x6c650000,0x6572726f,0x7220696e, +0x20637265,0x6174696e,0x67206669,0x6c652025,0x730a0000,0x434d444c,0x494e453d,0x25732025, +0x73257325,0x730a0000,0x2d632000,0x0,0x0,0x5057443d,0x25730a00,0x2d2d2d2d, +0xa000000,0x75706461,0x74655f69,0x6e737461,0x6e746961,0x74696f6e,0x5f696e66,0x6f5f6669, +0x6c650000,0x6572726f,0x7220696e,0x2072656e,0x616d696e,0x67202573,0x20746f20,0x25730a00, +0x2f70726f,0x632f252d,0x64000000,0x4f70656e,0x696e6720,0x2f70726f,0x63000000,0x50494f43, +0x53454e54,0x52590000,0x50494f43,0x5753544f,0x50000000,0x70726f67,0x72616d20,0x68616c74, +0x65642070,0x72656d61,0x74757265,0x6c790000,0x70726f67,0x72616d20,0x68616c74,0x65642069, +0x6e207772,0x6f6e6720,0x73797374,0x656d2063,0x616c6c00,0x756e6b6e,0x6f776e20,0x70726f62, +0x6c656d0a,0x0,0x72656164,0x206f6e20,0x70697065,0x20666169,0x6c656400,0x77726974, +0x65206f6e,0x20706970,0x65206661,0x696c6564,0x0,0x2d73686f,0x776d3a20,0x556e6964, +0x656e7469,0x66696564,0x3a207365,0x676d656e,0x74202564,0xa000000,0x70725f76,0x61646472, +0x5b25645d,0x3d20256c,0x780a0000,0x70725f73,0x697a655b,0x25645d3d,0x20256c78,0xa000000, +0x70725f6f,0x66665b25,0x645d3d20,0x256c780a,0x0,0x70725f6d,0x666c6167,0x735b2564, +0x5d3d2025,0x6c780a00,0x70725f76,0x73697a65,0x5b25645d,0x3d20256c,0x780a0000,0x70725f70, +0x73697a65,0x5b25645d,0x3d20256c,0x780a0000,0x70725f77,0x73697a65,0x5b25645d,0x3d20256c, +0x780a0000,0x70725f72,0x73697a65,0x5b25645d,0x3d20256c,0x780a0000,0x70725f6d,0x73697a65, +0x5b25645d,0x3d20256c,0x780a0000,0x70725f64,0x65765b25,0x645d3d20,0x256c780a,0x0, +0x70725f69,0x6e6f5b25,0x645d3d20,0x256c780a,0x0,0xa000000,0x25732070,0x68617365, +0x206d656d,0x3a20256c,0x64542025,0x6c644420,0x256c6442,0x20256c64,0x5320256c,0x64742025, +0x6c646420,0x256c6462,0x20256c64,0x6d3d2025,0x6c644b0a,0x0,0x74657874,0x5f73697a, +0x653d2025,0x6c64204b,0x62797465,0x730a0000,0x64617461,0x5f73697a,0x653d2025,0x6c64204b, +0x62797465,0x730a0000,0x62726b5f,0x73697a65,0x3d20256c,0x64204b62,0x79746573,0xa000000, +0x73746163,0x6b5f7369,0x7a653d20,0x256c6420,0x4b627974,0x65730a00,0x736f5f74,0x6578745f, +0x73697a65,0x3d20256c,0x64204b62,0x79746573,0xa000000,0x736f5f64,0x6174615f,0x73697a65, +0x3d20256c,0x64204b62,0x79746573,0xa000000,0x736f5f62,0x726b5f73,0x697a653d,0x20256c64, +0x204b6279,0x7465730a,0x0,0x6d6d6170,0x5f73697a,0x653d2025,0x6c64204b,0x62797465, +0x730a0000,0x544f5441,0x4c5f5349,0x5a453d20,0x256c6420,0x4b627974,0x65730a00,0xf03f9c68, +0xf03f9c74,0xf03f9c80,0xf03f9c8c,0xf03f9c98,0xf03fa83c,0xf03fac30,0xf03fac30,0xf03fa984, +0xf03fac30,0xf03fac30,0xf03fa7e4,0xf03fac30,0xf03fac30,0xf03fac30,0xf03fac30,0xf03fac30, +0xf03fac30,0xf03fa8e4,0xf03fac30,0xf03fac30,0xf03fa78c,0xf0405024,0xf03fb21c,0xf04079c4, +0xf03fb21c,0xf03fb21c,0xf0408fac,0xf03fb21c,0xf03fb21c,0xf03fb21c,0xf03fb21c,0xf03fb21c, +0xf0406d34,0xf03fb21c,0xf04080d4,0xf03fb21c,0xf04079c4,0xf03fb21c,0xf04069c0,0xf03fb21c, +0xf03fb040,0xf04079c4,0xf03fb21c,0xf03fb21c,0xf03fb21c,0xf03fb21c,0xf03fb21c,0xf03fb21c, +0xf03fb21c,0xf03fb21c,0xf03fb21c,0xf03fb21c,0xf03fb21c,0xf03fb21c,0xf03faefc,0xf03fb21c, +0xf0402de0,0xf03fafe0,0xf03fb21c,0xf03fb21c,0xf03faf54,0xf03fb21c,0xf03fb21c,0xf03fb21c, +0xf03fb21c,0xf03fb21c,0xf03fb21c,0xf03faf90,0xf03fb21c,0xf0402de0,0xf0402de0,0xf03fb21c, +0xf0406680,0xf03fe05c,0xf0401370,0xf0403134,0xf03faf90,0xf0401b78,0xf04026fc,0xf03fbb80, +0xf03fbe98,0xf03fbdac,0xf03fbdac,0xf03fbe98,0xf03fbe98,0xf03fbe98,0xf03fbe98,0xf03fbe98, +0xf03fbe98,0xf03fbe98,0xf03fbe98,0xf03fbe98,0xf03fbd54,0xf03fbe98,0xf03fbdac,0xf03fbde8, +0xf03fd064,0xf03fd218,0xf03fd110,0xf03fd110,0xf03fd218,0xf03fd218,0xf03fd218,0xf03fd218, +0xf03fd218,0xf03fd218,0xf03fd218,0xf03fd218,0xf03fd218,0xf03fd0b8,0xf03fd218,0xf03fd110, +0xf03fd14c,0xf03fe05c,0xf03fded8,0xf0403134,0xf0403134,0xf03fded8,0xf03fded8,0xf03fded8, +0xf03fded8,0xf03fded8,0xf03fded8,0xf03fded8,0xf03fded8,0xf03fded8,0xf0401370,0xf03fded8, +0xf0403134,0xf0408b04,0xf03fe05c,0xf03fe05c,0xf0403134,0xf0403134,0xf03fe05c,0xf03fe05c, +0xf03fe05c,0xf03fe05c,0xf03fe05c,0xf03fe05c,0xf03fe05c,0xf03fe05c,0xf03fe05c,0xf0401370, +0xf03fe05c,0xf0403134,0xf0408b04,0xf040ca80,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50, +0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041920c,0xf041ad50,0xf041ad50, +0xf041ad50,0xf040cab4,0xf041ad50,0xf040cb20,0xf041ad50,0xf040cb90,0xf040cce4,0xf041ad50, +0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50, +0xf041ad50,0xf040ce14,0xf040d008,0xf040d188,0xf040d2d8,0xf040d57c,0xf040d770,0xf040d850, +0xf040db84,0xf040dce8,0xf040def4,0xf040df20,0xf040e888,0xf040e99c,0xf040ecb4,0xf040ed64, +0xf040f2c0,0xf040f348,0xf040f3cc,0xf040f430,0xf040f4d4,0xf040f660,0xf040f738,0xf040f860, +0xf041058c,0xf041ad50,0xf0418c58,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50, +0xf041ad50,0xf04109dc,0xf04113cc,0xf041151c,0xf0412254,0xf041275c,0xf0413148,0xf04137d0, +0xf04138ec,0xf0413c90,0xf0414324,0xf041441c,0xf0414660,0xf04147e0,0xf0415510,0xf0416118, +0xf04165cc,0xf0416fc4,0xf041705c,0xf0417430,0xf04189d4,0xf0419330,0xf0419798,0xf0419a98, +0xf041a34c,0xf041a300,0xf041a48c,0xf040fa74,0xf0410498,0xf040fca0,0xf0410498,0xf0410498, +0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498, +0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498, +0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf040f9b0,0xf0410498, +0xf040fdec,0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498, +0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf0410498, +0xf0410498,0xf0410498,0xf0410498,0xf0410498,0xf040fd38,0xf040fd5c,0xf040fd14,0xf040fc7c, +0xf0410498,0xf040fa74,0xf0410498,0xf0410498,0xf0410498,0xf040fbc8,0xf040fba4,0xf040fd80, +0xf040fc34,0xf0410498,0xf040fcc4,0xf040f98c,0xf040fc58,0xf0410498,0xf040fc10,0xf0410498, +0xf040fbec,0xf0410498,0xf040fb80,0xf040fe10,0xf040fda4,0xf040fdc8,0xf04103fc,0xf04104f4, +0xf04104f4,0xf0410114,0xf04104f4,0xf04104f4,0xf040fe54,0xf04104f4,0xf04104f4,0xf04104f4, +0xf041036c,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4, +0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4, +0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04102f4, +0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4, +0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4,0xf04104f4, +0xf04104f4,0xf04104f4,0xf04104f4,0xf0410094,0xf0418ca0,0xf04191ac,0xf0418ce8,0xf04191ac, +0xf04191ac,0xf0418d30,0xf0418f28,0xf04191ac,0xf04191ac,0xf04191ac,0xf04191ac,0xf04191ac, +0xf04191ac,0xf0418d78,0xf04191ac,0xf0418dc0,0xf04191ac,0xf0418ee0,0xf04191ac,0xf04191ac, +0xf0418e08,0xf04191ac,0xf04191ac,0xf04191ac,0xf04191ac,0xf04191ac,0xf04191ac,0xf04191ac, +0xf04191ac,0xf04191ac,0xf04191ac,0xf04191ac,0xf04191ac,0xf04191ac,0xf04191ac,0xf04191ac, +0xf04191ac,0xf0418e50,0xf0418f58,0xf04191ac,0xf0418e98,0xf04191ac,0xf04191ac,0xf04191ac, +0xf04191ac,0xf04191ac,0xf04191ac,0xf04191ac,0xf0418f48,0xf0419094,0xf04191ac,0xf04191ac, +0xf04191ac,0xf04190c8,0xf04191ac,0xf04191ac,0xf04191ac,0xf0419164,0xf041a714,0xf041ad50, +0xf041ad50,0xf041ae04,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50, +0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50, +0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ae04,0xf041ad50, +0xf041ad50,0xf041a680,0xf041a690,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50, +0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041ad50,0xf041a57c,0xf041ad50,0xf041ad50, +0xf041ad50,0xf041ad50,0xf041ad50,0xf041a670,0xf041a660,0xf041ddbc,0xf041f608,0xf041f608, +0xf041f608,0xf041f608,0xf041f608,0xf041f608,0xf041f608,0xf041f608,0xf041f608,0xf041f608, +0xf041f608,0xf041f608,0xf041f608,0xf041f608,0xf041f608,0xf041f608,0xf041f608,0xf041f658, +0xf041f608,0xf041ded0,0xf041edcc,0xf041f608,0xf041f608,0xf041ef60,0xf041f608,0xf041f3ec, +0xf041f608,0xf041e904,0xf041f608,0xf041e6b8,0xf041dc38,0xf041f608,0xf041f608,0xf041f0e4, +0xf041f608,0xf041f268,0xf041f608,0xf041e168,0xf041e534,0xf041f57c,0xf041f608,0xf041f608, +0xf041f608,0xf041f608,0xf041f608,0xf041f608,0xf041f608,0xf041cc70,0xf041cd28,0xf041cb20, +0xf041c7a8,0xf041c354,0xf041bc28,0xf041f608,0xf041b87c,0xf041f608,0xf041c4c4,0xf041c40c, +0xf041cf30,0xf041c860,0xf041e7cc,0xf041c9d0,0xf041bb08,0xf041c6f0,0xf041d4d8,0xf041c638, +0xf041d218,0xf041c57c,0xf041c918,0xf041ce78,0xf041f608,0xf041d368,0xf041d420,0xf041f868, +0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78, +0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78, +0xf041fa78,0xf041f898,0xf041fa78,0xf041f838,0xf041f928,0xf041fa78,0xf041fa78,0xf041f958, +0xf041fa78,0xf041fa78,0xf041fa78,0xf041f8f8,0xf041fa78,0xf041f8c8,0xf041f808,0xf041fa78, +0xf041fa78,0xf041f9b8,0xf041fa78,0xf041f988,0xf041fa78,0xf041f9e8,0xf041fa18,0xf041fa78, +0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78, +0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78, +0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa78,0xf041fa48,0xf041fb74,0xf041fd54,0xf041fd54, +0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54, +0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fba4, +0xf041fd54,0xf041fb44,0xf041fc34,0xf041fd54,0xf041fd54,0xf041fc64,0xf041fd54,0xf041fd54, +0xf041fd54,0xf041fc04,0xf041fd54,0xf041fbd4,0xf041fb14,0xf041fd54,0xf041fd54,0xf041fcc4, +0xf041fd54,0xf041fc94,0xf041fd54,0xf041fd54,0xf041fd24,0xf041fd54,0xf041fd54,0xf041fd54, +0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54, +0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54,0xf041fd54, +0xf041fd54,0xf041fd54,0xf041fcf4,0xf042311c,0xf042311c,0xf04232dc,0xf0423590,0xf0423400, +0xf0423400,0x0,0x0,0x0,0x40282329,0x24486561,0x6465723a,0x20495249, +0x5820352e,0x333a3130,0x32313537,0x32303333,0x20627569,0x6c742031,0x312f3033,0x2f393420, +0x61742070,0x69676865,0x6172743a,0x2f6a6f69,0x73742f35,0x2e334d52,0x2f726f6f,0x74202400, +}; +static const uint32_t data[] = { +0x0,0x3,0x0,0x10000560,0x1,0x10000564,0x1,0x10000568, +0x2,0x1000056c,0x3,0x10000570,0x4,0x10000574,0x5,0x10000578, +0x6,0x1000057c,0x6,0x10000580,0x6,0x10000584,0x6,0x10000588, +0x6,0x1000058c,0x6,0x10000590,0x6,0x10000594,0x7,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x1,0x0,0x0,0x10000598,0x100005a0,0x100005a8,0x100005b0,0x100005b8, +0x100005c0,0x100005c8,0x100005d0,0x0,0x0,0x0,0x100005d8,0x100005e0, +0x100005ec,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x1,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x1,0x0,0x1,0x0, +0x0,0x0,0x1,0x0,0x1,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x1,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0, +0x0,0x0,0x0,0x1,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x1,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x1,0x0,0x0,0x0,0x0,0x1,0x0, +0x0,0x0,0x0,0x100005f4,0x10003,0x100005fc,0x10007,0x0, +0x0,0x10000604,0x10003,0x1000060c,0x10007,0x0,0x0,0x0, +0x1,0x0,0x0,0x0,0x0,0x0,0x1,0x1, +0x10000614,0x0,0x0,0xffffffff,0x0,0xffffffff,0x0,0x0, +0x0,0x0,0x10000618,0x1000061c,0x10008310,0x1900,0x0,0x0, +0x0,0x0,0x10005234,0x10005240,0x10005248,0x10005250,0x10005258,0x1000525c, +0x10006754,0x1000675c,0x1000676c,0x10006774,0x1000677c,0x1000678c,0x10006794,0x1000679c, +0x100067ac,0x100067b4,0x100067b8,0x100067c8,0x100067dc,0x100067e4,0x100067f4,0x100067fc, +0x10006804,0x10006814,0x1000681c,0x10006820,0x10006830,0x10006840,0x1000684c,0x10006860, +0x10006868,0x10006870,0x10006884,0x1000688c,0x10006890,0x100068a0,0x100068a8,0x100068b0, +0x100068c0,0x100068c8,0x100068d0,0x100068e0,0x100068e8,0x100068f0,0x10006900,0x10006908, +0x10006914,0x10006928,0x10006930,0x10006934,0x10006944,0x10006958,0x1000695c,0x1000696c, +0x10006980,0x10006984,0x10006990,0x100069a4,0x100069ac,0x100069bc,0x100069c4,0x100069cc, +0x100069e4,0x100069f0,0x100069fc,0x10006a18,0x0,0x0,0x0,0x0, +}; +static uint32_t f_main(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_process_config(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_add_info(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_parse_command(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_get_host_chiptype(uint8_t *mem, uint32_t sp); +static void f_error(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_relocate_passes(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_newrunlib(uint8_t *mem, uint32_t sp); +static void f_compose_G0_libs(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_mkstr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_mklist(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_addstr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_addspacedstr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_newstr(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_save_place(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_set_place(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_addlist(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_adduldlist(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_nodup(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_getsuf(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_mksuf(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_savestr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_mktempstr(uint8_t *mem, uint32_t sp); +static uint32_t f_run(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_edit_src(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_get_lino(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_show_err(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_handler(uint8_t *mem, uint32_t sp); +static void f_cleanup(uint8_t *mem, uint32_t sp); +static void f_whats(uint8_t *mem, uint32_t sp); +static void f_settimes(uint8_t *mem, uint32_t sp); +static void f_dotime(uint8_t *mem, uint32_t sp); +static uint32_t func_4339c8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_isdir(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_regular_not_writeable(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_regular_file(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_basename(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_dirname(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t func_434094(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_add_cxx_symbol_options(uint8_t *mem, uint32_t sp); +static void f_init_curr_dir(uint8_t *mem, uint32_t sp); +static uint32_t f_full_path(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_add_static_opt(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_record_static_fileset(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_touch(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_add_prelinker_objects(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_quoted_length(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_quote_shell_arg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_save_off_command_line(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_skip_old_ii_controls(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_make_ii_file_name(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_update_instantiation_info_file(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t func_4362cc(uint8_t *mem, uint32_t sp, uint32_t a0); +static void func_4365b8(uint8_t *mem, uint32_t sp); +static void func_436680(uint8_t *mem, uint32_t sp); +static void func_43673c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_gethostsex(uint8_t *mem, uint32_t sp); +uint64_t trampoline(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3, uint32_t fp_dest) { +switch (fp_dest) { +case 0x433218: f_handler(mem, sp); return 0; +default: abort();} +} +int run(uint8_t *mem, int argc, char *argv[]) { +mmap_initial_data_range(mem, 0xff00000, 0x1000b000); +memcpy(mem + 0x10000560, rodata, 0x75e0); +memcpy(mem + 0x10000000, data, 0x560); +MEM_S32(0x1000a600) = argc; +MEM_S32(0xffffff0) = argc; +uint32_t al = argc * 4; for (int i = 0; i < argc; i++) al += strlen(argv[i]) + 1; +uint32_t arg_addr = wrapper_malloc(mem, al); +MEM_U32(0x1000a604) = arg_addr; +MEM_U32(0xffffff4) = arg_addr; +uint32_t arg_strpos = arg_addr + argc * 4; +for (int i = 0; i < argc; i++) {MEM_U32(arg_addr + i * 4) = arg_strpos; uint32_t p = 0; do { MEM_S8(arg_strpos) = argv[i][p]; ++arg_strpos; } while (argv[i][p++] != '\0');} +setup_libc_data(mem); +int ret = f_main(mem, 0xffffff0, argc, arg_addr); +return ret; +} + +static uint32_t f_main(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L405b30: +//main: +//nop; +//nop; +//nop; +sp = sp + 0xfffffea0; +MEM_U32(sp + 356) = a1; +t6 = MEM_U32(sp + 356); +// fdead 40008063 MEM_U32(sp + 68) = ra; +// fdead 40008063 MEM_U32(sp + 64) = gp; +MEM_U32(sp + 352) = a0; +// fdead 40008063 MEM_U32(sp + 60) = s5; +// fdead 40008063 MEM_U32(sp + 56) = s4; +// fdead 40008063 MEM_U32(sp + 52) = s3; +// fdead 40008063 MEM_U32(sp + 48) = s2; +// fdead 40008063 MEM_U32(sp + 44) = s1; +// fdead 40008063 MEM_U32(sp + 40) = s0; +MEM_U32(sp + 332) = zero; +MEM_U32(sp + 328) = zero; +MEM_U32(sp + 324) = zero; +at = 0x1000a31c; +t8 = 0x10000004; +t7 = MEM_U32(t6 + 0); +t8 = MEM_U32(t8 + 0); +MEM_U32(at + 0) = t7; +at = 0x1; +if (t8 == at) {at = 0x2; +goto L405ba0;} +at = 0x2; +if (t8 != at) {//nop; +goto L405bb4;} +//nop; +L405ba0: +t9 = 0x10000620; +at = 0x1000a254; +t9 = t9; +MEM_U32(at + 0) = t9; +goto L405bc4; +MEM_U32(at + 0) = t9; +L405bb4: +t0 = 0x10000628; +at = 0x1000a254; +t0 = t0; +MEM_U32(at + 0) = t0; +L405bc4: +t1 = 0x10000630; +at = 0x1000a258; +t1 = t1; +t2 = 0x10000638; +MEM_U32(at + 0) = t1; +at = 0x1000a194; +t2 = t2; +t3 = 0x10000644; +MEM_U32(at + 0) = t2; +at = 0x1000a190; +//nop; +a0 = 0x1000a260; +t3 = t3; +MEM_U32(at + 0) = t3; +f_mklist(mem, sp, a0); +goto L405c00; +MEM_U32(at + 0) = t3; +L405c00: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a270; +//nop; +f_mklist(mem, sp, a0); +goto L405c18; +//nop; +L405c18: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a310; +//nop; +f_mklist(mem, sp, a0); +goto L405c30; +//nop; +L405c30: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a2c0; +//nop; +f_mklist(mem, sp, a0); +goto L405c48; +//nop; +L405c48: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a320; +//nop; +f_mklist(mem, sp, a0); +goto L405c60; +//nop; +L405c60: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a330; +//nop; +f_mklist(mem, sp, a0); +goto L405c78; +//nop; +L405c78: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a408; +//nop; +f_mklist(mem, sp, a0); +goto L405c90; +//nop; +L405c90: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a418; +//nop; +f_mklist(mem, sp, a0); +goto L405ca8; +//nop; +L405ca8: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a428; +//nop; +f_mklist(mem, sp, a0); +goto L405cc0; +//nop; +L405cc0: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a360; +//nop; +f_mklist(mem, sp, a0); +goto L405cd8; +//nop; +L405cd8: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a370; +//nop; +f_mklist(mem, sp, a0); +goto L405cf0; +//nop; +L405cf0: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a438; +//nop; +f_mklist(mem, sp, a0); +goto L405d08; +//nop; +L405d08: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a448; +//nop; +f_mklist(mem, sp, a0); +goto L405d20; +//nop; +L405d20: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a280; +//nop; +f_mklist(mem, sp, a0); +goto L405d38; +//nop; +L405d38: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a5a8; +//nop; +f_mklist(mem, sp, a0); +goto L405d50; +//nop; +L405d50: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a290; +//nop; +f_mklist(mem, sp, a0); +goto L405d68; +//nop; +L405d68: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a2d0; +//nop; +f_mklist(mem, sp, a0); +goto L405d80; +//nop; +L405d80: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a2a0; +//nop; +f_mklist(mem, sp, a0); +goto L405d98; +//nop; +L405d98: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a2b0; +//nop; +f_mklist(mem, sp, a0); +goto L405db0; +//nop; +L405db0: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a2e0; +//nop; +f_mklist(mem, sp, a0); +goto L405dc8; +//nop; +L405dc8: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a2f0; +//nop; +f_mklist(mem, sp, a0); +goto L405de0; +//nop; +L405de0: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a300; +//nop; +f_mklist(mem, sp, a0); +goto L405df8; +//nop; +L405df8: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a5b8; +//nop; +f_mklist(mem, sp, a0); +goto L405e10; +//nop; +L405e10: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a5d0; +//nop; +f_mklist(mem, sp, a0); +goto L405e28; +//nop; +L405e28: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a5e0; +//nop; +f_mklist(mem, sp, a0); +goto L405e40; +//nop; +L405e40: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a460; +//nop; +f_mklist(mem, sp, a0); +goto L405e58; +//nop; +L405e58: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a470; +//nop; +f_mklist(mem, sp, a0); +goto L405e70; +//nop; +L405e70: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a480; +//nop; +f_mklist(mem, sp, a0); +goto L405e88; +//nop; +L405e88: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a490; +//nop; +f_mklist(mem, sp, a0); +goto L405ea0; +//nop; +L405ea0: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a4a0; +//nop; +f_mklist(mem, sp, a0); +goto L405eb8; +//nop; +L405eb8: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a4b0; +//nop; +f_mklist(mem, sp, a0); +goto L405ed0; +//nop; +L405ed0: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a4c0; +//nop; +f_mklist(mem, sp, a0); +goto L405ee8; +//nop; +L405ee8: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a4d0; +//nop; +f_mklist(mem, sp, a0); +goto L405f00; +//nop; +L405f00: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a4f0; +//nop; +f_mklist(mem, sp, a0); +goto L405f18; +//nop; +L405f18: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a4e0; +//nop; +f_mklist(mem, sp, a0); +goto L405f30; +//nop; +L405f30: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a500; +//nop; +f_mklist(mem, sp, a0); +goto L405f48; +//nop; +L405f48: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a510; +//nop; +f_mklist(mem, sp, a0); +goto L405f60; +//nop; +L405f60: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a520; +//nop; +f_mklist(mem, sp, a0); +goto L405f78; +//nop; +L405f78: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a530; +//nop; +f_mklist(mem, sp, a0); +goto L405f90; +//nop; +L405f90: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a540; +//nop; +f_mklist(mem, sp, a0); +goto L405fa8; +//nop; +L405fa8: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +//nop; +f_mklist(mem, sp, a0); +goto L405fc0; +//nop; +L405fc0: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a550; +//nop; +f_mklist(mem, sp, a0); +goto L405fd8; +//nop; +L405fd8: +// bdead 40040103 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x10000654; +a1 = 0x10000658; +//nop; +a0 = a0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L405ff8; +a1 = a1; +L405ff8: +// bdead 4004010b gp = MEM_U32(sp + 64); +a2 = zero; +t4 = 0x1000a340; +a0 = 0x1000065c; +MEM_U32(t4 + 4) = v0; +//nop; +a1 = 0x10000660; +a0 = a0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L406020; +a1 = a1; +L406020: +// bdead 4004010b gp = MEM_U32(sp + 64); +a2 = zero; +t5 = 0x1000a340; +a0 = 0x10000664; +MEM_U32(t5 + 8) = v0; +//nop; +a1 = 0x10000668; +a0 = a0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L406048; +a1 = a1; +L406048: +// bdead 4004010b gp = MEM_U32(sp + 64); +a2 = zero; +t6 = 0x1000a340; +a0 = 0x1000066c; +MEM_U32(t6 + 12) = v0; +//nop; +a1 = 0x10000670; +a0 = a0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L406070; +a1 = a1; +L406070: +// bdead 4004010b gp = MEM_U32(sp + 64); +a2 = zero; +t7 = 0x1000a340; +a0 = 0x10000674; +MEM_U32(t7 + 16) = v0; +//nop; +a1 = 0x10000678; +a0 = a0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L406098; +a1 = a1; +L406098: +// bdead 4004010b gp = MEM_U32(sp + 64); +a2 = zero; +t8 = 0x1000a340; +a0 = 0x1000067c; +MEM_U32(t8 + 20) = v0; +//nop; +a1 = 0x10000684; +a0 = a0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4060c0; +a1 = a1; +L4060c0: +// bdead 4004000b gp = MEM_U32(sp + 64); +//nop; +t9 = 0x1000a340; +t0 = 0x10000384; +MEM_U32(t9 + 24) = v0; +at = 0x10000348; +//nop; +a0 = 0x10000688; +t0 = MEM_U32(t0 + 0); +a0 = a0; +MEM_U32(at + 0) = t0; +v0 = wrapper_getenv(mem, a0); +goto L4060f0; +MEM_U32(at + 0) = t0; +L4060f0: +MEM_U32(sp + 320) = v0; +t1 = MEM_U32(sp + 320); +// bdead 40040403 gp = MEM_U32(sp + 64); +if (t1 == 0) {at = 0x10000420; +goto L40610c;} +at = 0x10000420; +t2 = 0x1; +MEM_U32(at + 0) = t2; +L40610c: +a0 = 0x10000694; +//nop; +a0 = a0; +//nop; +v0 = wrapper_getenv(mem, a0); +goto L406120; +//nop; +L406120: +MEM_U32(sp + 316) = v0; +t3 = MEM_U32(sp + 316); +// bdead 40041003 gp = MEM_U32(sp + 64); +if (t3 == 0) {//nop; +goto L4063fc;} +//nop; +t4 = MEM_U8(t3 + 0); +t5 = 0xfb504f0; +//nop; +t6 = t4 + t5; +t7 = MEM_U8(t6 + 1); +//nop; +t8 = t7 & 0x8; +if (t8 == 0) {//nop; +goto L406190;} +//nop; +L406158: +t9 = MEM_U32(sp + 316); +t3 = 0xfb504f0; +t0 = t9 + 0x1; +MEM_U32(sp + 316) = t0; +t1 = MEM_U32(sp + 316); +//nop; +t2 = MEM_U8(t1 + 0); +//nop; +t4 = t2 + t3; +t5 = MEM_U8(t4 + 1); +//nop; +t6 = t5 & 0x8; +if (t6 != 0) {//nop; +goto L406158;} +//nop; +L406190: +//nop; +a0 = MEM_U32(sp + 316); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L4061a0; +//nop; +L4061a0: +MEM_U32(sp + 308) = v0; +t7 = MEM_U32(sp + 308); +// bdead 40050003 gp = MEM_U32(sp + 64); +if ((int)t7 > 0) {//nop; +goto L4061e8;} +//nop; +t8 = 0x1000069c; +//nop; +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4061dc; +MEM_U32(sp + 16) = zero; +L4061dc: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +goto L4063fc; +//nop; +L4061e8: +t9 = MEM_U32(sp + 308); +t0 = MEM_U32(sp + 316); +t4 = 0xfb504f0; +t1 = t9 + t0; +t2 = t1 + 0xffffffff; +MEM_U32(sp + 312) = t2; +t3 = MEM_U8(t1 + -1); +//nop; +t5 = t3 + t4; +t6 = MEM_U8(t5 + 1); +//nop; +t7 = t6 & 0x8; +if (t7 == 0) {//nop; +goto L406258;} +//nop; +L406220: +t8 = MEM_U32(sp + 312); +t1 = 0xfb504f0; +t9 = t8 + 0xffffffff; +MEM_U32(sp + 312) = t9; +t0 = MEM_U32(sp + 312); +//nop; +t2 = MEM_U8(t0 + 0); +//nop; +t3 = t2 + t1; +t4 = MEM_U8(t3 + 1); +//nop; +t5 = t4 & 0x8; +if (t5 != 0) {//nop; +goto L406220;} +//nop; +L406258: +t6 = MEM_U32(sp + 312); +a1 = 0x100006cc; +t7 = t6 + 0x1; +MEM_U32(sp + 312) = t7; +MEM_U8(t7 + 0) = (uint8_t)zero; +//nop; +a0 = MEM_U32(sp + 316); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L40627c; +a1 = a1; +L40627c: +// bdead 4004000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000004; +goto L4062bc;} +at = 0x10000004; +a0 = 0x100006d4; +MEM_U32(at + 0) = zero; +at = 0x100003e8; +//nop; +t8 = 0x2; +a1 = zero; +a2 = zero; +a0 = a0; +MEM_U32(at + 0) = t8; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L4062b0; +MEM_U32(at + 0) = t8; +L4062b0: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +goto L4063fc; +//nop; +L4062bc: +a1 = 0x100006d8; +//nop; +a0 = MEM_U32(sp + 316); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4062d0; +a1 = a1; +L4062d0: +// bdead 4004000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000004; +goto L406314;} +at = 0x10000004; +t9 = 0x1; +MEM_U32(at + 0) = t9; +at = 0x100003e8; +//nop; +a0 = 0x100006e0; +t0 = 0x3; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t0; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L406308; +a0 = a0; +L406308: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +goto L4063fc; +//nop; +L406314: +a1 = 0x100006e4; +//nop; +a0 = MEM_U32(sp + 316); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L406328; +a1 = a1; +L406328: +// bdead 4004000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000004; +goto L40636c;} +at = 0x10000004; +t2 = 0x3; +MEM_U32(at + 0) = t2; +at = 0x100003e8; +a0 = 0x100006ec; +//nop; +t1 = 0x3; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t1; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L406360; +a0 = a0; +L406360: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +goto L4063fc; +//nop; +L40636c: +a1 = 0x100006f0; +//nop; +a0 = MEM_U32(sp + 316); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L406380; +a1 = a1; +L406380: +// bdead 4004000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000004; +goto L4063c4;} +at = 0x10000004; +t3 = 0x2; +MEM_U32(at + 0) = t3; +at = 0x100003e8; +a0 = 0x100006fc; +//nop; +t4 = 0x3; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t4; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L4063b8; +a0 = a0; +L4063b8: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +goto L4063fc; +//nop; +L4063c4: +t5 = 0x10000700; +t6 = MEM_U32(sp + 316); +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t6; +f_error(mem, sp, a0, a1, a2, a3); +goto L4063f4; +MEM_U32(sp + 24) = t6; +L4063f4: +// bdead 40040003 gp = MEM_U32(sp + 64); +MEM_U32(sp + 316) = zero; +L4063fc: +a0 = 0x1000a31c; +at = 0x1000a36c; +//nop; +t7 = 0x1; +a0 = MEM_U32(a0 + 0); +a1 = 0x2f; +MEM_U32(at + 0) = t7; +v0 = wrapper_strrchr(mem, a0, a1); +goto L40641c; +MEM_U32(at + 0) = t7; +L40641c: +// bdead 4004010b gp = MEM_U32(sp + 64); +s2 = v0; +if (s2 != 0) {//nop; +goto L406b44;} +//nop; +a0 = 0x1000a31c; +a1 = 0x10000774; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L406448; +a1 = a1; +L406448: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +t8 = 0x1000a340; +a0 = 0x1000077c; +MEM_U32(t8 + 0) = v0; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L40646c; +//nop; +L40646c: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a0 = 0x1000a31c; +a1 = 0x10000778; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406490; +a1 = a1; +L406490: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L4064d8;} +at = 0x1000a36c; +t9 = 0x1; +MEM_U32(at + 0) = t9; +//nop; +a0 = 0x10000780; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L4064b4; +a0 = a0; +L4064b4: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +t0 = 0x1000a31c; +at = 0x1000a1b4; +t0 = MEM_U32(t0 + 0); +//nop; +t2 = v0 + t0; +MEM_U32(at + 0) = t2; +goto L407154; +MEM_U32(at + 0) = t2; +L4064d8: +a0 = 0x10000788; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L4064ec; +//nop; +L4064ec: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a0 = 0x1000a31c; +a1 = 0x10000784; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406510; +a1 = a1; +L406510: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406558;} +at = 0x1000a36c; +a0 = 0x1000078c; +//nop; +t1 = 0x2; +MEM_U32(at + 0) = t1; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406534; +a0 = a0; +L406534: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +t3 = 0x1000a31c; +at = 0x1000a1b4; +t3 = MEM_U32(t3 + 0); +//nop; +t4 = v0 + t3; +MEM_U32(at + 0) = t4; +goto L407154; +MEM_U32(at + 0) = t4; +L406558: +a0 = 0x10000794; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L40656c; +//nop; +L40656c: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a0 = 0x1000a31c; +a1 = 0x10000790; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406590; +a1 = a1; +L406590: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L4065d8;} +at = 0x1000a36c; +a0 = 0x10000798; +//nop; +t5 = 0x3; +MEM_U32(at + 0) = t5; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L4065b4; +a0 = a0; +L4065b4: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +t6 = 0x1000a31c; +at = 0x1000a1b4; +t6 = MEM_U32(t6 + 0); +//nop; +t7 = v0 + t6; +MEM_U32(at + 0) = t7; +goto L407154; +MEM_U32(at + 0) = t7; +L4065d8: +a0 = 0x100007a0; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L4065ec; +//nop; +L4065ec: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a0 = 0x1000a31c; +a1 = 0x1000079c; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406610; +a1 = a1; +L406610: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406674;} +at = 0x1000a36c; +a0 = 0x100007a4; +//nop; +t8 = 0x4; +MEM_U32(at + 0) = t8; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406634; +a0 = a0; +L406634: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +t9 = 0x1000a31c; +at = 0x1000a1b4; +t9 = MEM_U32(t9 + 0); +t2 = 0x1000a340; +t0 = v0 + t9; +MEM_U32(at + 0) = t0; +//nop; +a1 = MEM_U32(t2 + 4); +a0 = MEM_U32(t2 + 0); +//nop; +v0 = wrapper_strcpy(mem, a0, a1); +goto L406668; +//nop; +L406668: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +goto L407154; +//nop; +L406674: +a0 = 0x100007ac; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406688; +//nop; +L406688: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a0 = 0x1000a31c; +a1 = 0x100007a8; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L4066ac; +a1 = a1; +L4066ac: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L4066f4;} +at = 0x1000a36c; +a0 = 0x100007b0; +//nop; +t1 = 0x5; +MEM_U32(at + 0) = t1; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L4066d0; +a0 = a0; +L4066d0: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +t3 = 0x1000a31c; +at = 0x1000a1b4; +t3 = MEM_U32(t3 + 0); +//nop; +t4 = v0 + t3; +MEM_U32(at + 0) = t4; +goto L407154; +MEM_U32(at + 0) = t4; +L4066f4: +a0 = 0x100007bc; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406708; +//nop; +L406708: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a0 = 0x1000a31c; +a1 = 0x100007b4; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L40672c; +a1 = a1; +L40672c: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406774;} +at = 0x1000a36c; +a0 = 0x100007c4; +//nop; +t5 = 0x6; +MEM_U32(at + 0) = t5; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406750; +a0 = a0; +L406750: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +t6 = 0x1000a31c; +at = 0x1000a1b4; +t6 = MEM_U32(t6 + 0); +//nop; +t7 = v0 + t6; +MEM_U32(at + 0) = t7; +goto L407154; +MEM_U32(at + 0) = t7; +L406774: +a0 = 0x100007d4; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406788; +//nop; +L406788: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a0 = 0x1000a31c; +a1 = 0x100007cc; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L4067ac; +a1 = a1; +L4067ac: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406818;} +at = 0x1000a36c; +t8 = 0x1; +MEM_U32(at + 0) = t8; +at = 0x10000008; +t9 = 0x1; +MEM_U32(at + 0) = t9; +at = 0x100003f8; +t0 = 0x1; +MEM_U32(at + 0) = t0; +at = 0x10000000; +//nop; +a0 = 0x100007dc; +t2 = 0x1; +MEM_U32(at + 0) = t2; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L4067f4; +a0 = a0; +L4067f4: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +t1 = 0x1000a31c; +at = 0x1000a1b4; +t1 = MEM_U32(t1 + 0); +//nop; +t3 = v0 + t1; +MEM_U32(at + 0) = t3; +goto L407154; +MEM_U32(at + 0) = t3; +L406818: +a0 = 0x100007e8; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L40682c; +//nop; +L40682c: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a0 = 0x1000a31c; +a1 = 0x100007e0; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406850; +a1 = a1; +L406850: +// bdead 400c01cb gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L4068d8;} +at = 0x1000a36c; +t4 = 0x1; +MEM_U32(at + 0) = t4; +at = 0x10000008; +t5 = 0x2; +MEM_U32(at + 0) = t5; +at = 0x100003f8; +t6 = 0x1; +MEM_U32(at + 0) = t6; +at = 0x10000000; +a0 = 0x100007f0; +//nop; +t7 = 0x1; +MEM_U32(at + 0) = t7; +a0 = a0; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_printf(mem, a0, sp); +goto L406898; +a0 = a0; +L406898: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x100007fc; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L4068b4; +//nop; +L4068b4: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +t8 = 0x1000a31c; +at = 0x1000a1b4; +t8 = MEM_U32(t8 + 0); +//nop; +t9 = v0 + t8; +MEM_U32(at + 0) = t9; +goto L407154; +MEM_U32(at + 0) = t9; +L4068d8: +a0 = 0x1000080c; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L4068ec; +//nop; +L4068ec: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a0 = 0x1000a31c; +a1 = 0x10000804; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406910; +a1 = a1; +L406910: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L40697c;} +at = 0x1000a36c; +t0 = 0x1; +MEM_U32(at + 0) = t0; +at = 0x10000008; +t2 = 0x3; +MEM_U32(at + 0) = t2; +at = 0x100003f8; +t1 = 0x1; +MEM_U32(at + 0) = t1; +at = 0x10000000; +a0 = 0x10000814; +//nop; +t3 = 0x1; +MEM_U32(at + 0) = t3; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406958; +a0 = a0; +L406958: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +t4 = 0x1000a31c; +at = 0x1000a1b4; +t4 = MEM_U32(t4 + 0); +//nop; +t5 = v0 + t4; +MEM_U32(at + 0) = t5; +goto L407154; +MEM_U32(at + 0) = t5; +L40697c: +a0 = 0x10000820; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406990; +//nop; +L406990: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a0 = 0x1000a31c; +a1 = 0x1000081c; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L4069b4; +a1 = a1; +L4069b4: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406a14;} +at = 0x1000a36c; +t6 = 0x1; +MEM_U32(at + 0) = t6; +at = 0x10000008; +t7 = 0x1; +MEM_U32(at + 0) = t7; +at = 0x100003f8; +a0 = 0x10000824; +//nop; +t8 = 0x1; +MEM_U32(at + 0) = t8; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L4069f0; +a0 = a0; +L4069f0: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +t9 = 0x1000a31c; +at = 0x1000a1b4; +t9 = MEM_U32(t9 + 0); +//nop; +t0 = v0 + t9; +MEM_U32(at + 0) = t0; +goto L407154; +MEM_U32(at + 0) = t0; +L406a14: +a0 = 0x1000082c; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406a28; +//nop; +L406a28: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a0 = 0x1000a31c; +a1 = 0x10000828; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406a4c; +a1 = a1; +L406a4c: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406aac;} +at = 0x1000a36c; +t2 = 0x1; +MEM_U32(at + 0) = t2; +at = 0x10000008; +t1 = 0x2; +MEM_U32(at + 0) = t1; +at = 0x100003f8; +a0 = 0x10000830; +//nop; +t3 = 0x1; +MEM_U32(at + 0) = t3; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406a88; +a0 = a0; +L406a88: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +t4 = 0x1000a31c; +at = 0x1000a1b4; +t4 = MEM_U32(t4 + 0); +//nop; +t5 = v0 + t4; +MEM_U32(at + 0) = t5; +goto L407154; +MEM_U32(at + 0) = t5; +L406aac: +a0 = 0x10000838; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406ac0; +//nop; +L406ac0: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a0 = 0x1000a31c; +a1 = 0x10000834; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406ae4; +a1 = a1; +L406ae4: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L407154;} +at = 0x1000a36c; +t6 = 0x1; +MEM_U32(at + 0) = t6; +at = 0x10000008; +t7 = 0x3; +MEM_U32(at + 0) = t7; +at = 0x100003f8; +a0 = 0x1000083c; +//nop; +t8 = 0x1; +MEM_U32(at + 0) = t8; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406b20; +a0 = a0; +L406b20: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +t9 = 0x1000a31c; +at = 0x1000a1b4; +t9 = MEM_U32(t9 + 0); +//nop; +t0 = v0 + t9; +MEM_U32(at + 0) = t0; +goto L407154; +MEM_U32(at + 0) = t0; +L406b44: +a1 = 0x10000840; +//nop; +s2 = s2 + 0x1; +a0 = s2; +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L406b60; +a1 = a1; +L406b60: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +t2 = 0x1000a340; +a0 = 0x10000848; +MEM_U32(t2 + 0) = v0; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406b84; +//nop; +L406b84: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a1 = 0x10000844; +//nop; +a2 = s4; +a0 = s2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406ba4; +a1 = a1; +L406ba4: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406bdc;} +at = 0x1000a36c; +a0 = 0x1000084c; +//nop; +t1 = 0x1; +MEM_U32(at + 0) = t1; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406bc8; +a0 = a0; +L406bc8: +// bdead 400c000b gp = MEM_U32(sp + 64); +t3 = v0 + s2; +at = 0x1000a1b4; +MEM_U32(at + 0) = t3; +goto L407154; +MEM_U32(at + 0) = t3; +L406bdc: +a0 = 0x10000854; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406bf0; +//nop; +L406bf0: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a1 = 0x10000850; +//nop; +a2 = s4; +a0 = s2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406c10; +a1 = a1; +L406c10: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406c48;} +at = 0x1000a36c; +a0 = 0x10000858; +//nop; +t4 = 0x2; +MEM_U32(at + 0) = t4; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406c34; +a0 = a0; +L406c34: +// bdead 400c000b gp = MEM_U32(sp + 64); +t5 = v0 + s2; +at = 0x1000a1b4; +MEM_U32(at + 0) = t5; +goto L407154; +MEM_U32(at + 0) = t5; +L406c48: +a0 = 0x10000860; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406c5c; +//nop; +L406c5c: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a1 = 0x1000085c; +//nop; +a2 = s4; +a0 = s2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406c7c; +a1 = a1; +L406c7c: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406cb4;} +at = 0x1000a36c; +a0 = 0x10000864; +//nop; +t6 = 0x3; +MEM_U32(at + 0) = t6; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406ca0; +a0 = a0; +L406ca0: +// bdead 400c000b gp = MEM_U32(sp + 64); +t7 = v0 + s2; +at = 0x1000a1b4; +MEM_U32(at + 0) = t7; +goto L407154; +MEM_U32(at + 0) = t7; +L406cb4: +a0 = 0x1000086c; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406cc8; +//nop; +L406cc8: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a1 = 0x10000868; +//nop; +a2 = s4; +a0 = s2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406ce8; +a1 = a1; +L406ce8: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406d40;} +at = 0x1000a36c; +a0 = 0x10000870; +//nop; +t8 = 0x4; +MEM_U32(at + 0) = t8; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406d0c; +a0 = a0; +L406d0c: +// bdead 400c000b gp = MEM_U32(sp + 64); +t9 = v0 + s2; +at = 0x1000a1b4; +t0 = 0x1000a340; +MEM_U32(at + 0) = t9; +//nop; +a1 = MEM_U32(t0 + 4); +a0 = MEM_U32(t0 + 0); +//nop; +v0 = wrapper_strcpy(mem, a0, a1); +goto L406d34; +//nop; +L406d34: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +goto L407154; +//nop; +L406d40: +a0 = 0x10000878; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406d54; +//nop; +L406d54: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a1 = 0x10000874; +//nop; +a2 = s4; +a0 = s2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406d74; +a1 = a1; +L406d74: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406dac;} +at = 0x1000a36c; +a0 = 0x1000087c; +//nop; +t2 = 0x5; +MEM_U32(at + 0) = t2; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406d98; +a0 = a0; +L406d98: +// bdead 400c000b gp = MEM_U32(sp + 64); +t1 = v0 + s2; +at = 0x1000a1b4; +MEM_U32(at + 0) = t1; +goto L407154; +MEM_U32(at + 0) = t1; +L406dac: +a0 = 0x10000888; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406dc0; +//nop; +L406dc0: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a1 = 0x10000880; +//nop; +a2 = s4; +a0 = s2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406de0; +a1 = a1; +L406de0: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406e18;} +at = 0x1000a36c; +a0 = 0x10000890; +//nop; +t3 = 0x6; +MEM_U32(at + 0) = t3; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406e04; +a0 = a0; +L406e04: +// bdead 400c000b gp = MEM_U32(sp + 64); +t4 = v0 + s2; +at = 0x1000a1b4; +MEM_U32(at + 0) = t4; +goto L407154; +MEM_U32(at + 0) = t4; +L406e18: +a0 = 0x100008a0; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406e2c; +//nop; +L406e2c: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a1 = 0x10000898; +//nop; +a2 = s4; +a0 = s2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406e4c; +a1 = a1; +L406e4c: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406ea8;} +at = 0x1000a36c; +t5 = 0x1; +MEM_U32(at + 0) = t5; +at = 0x10000008; +t6 = 0x1; +MEM_U32(at + 0) = t6; +at = 0x100003f8; +t7 = 0x1; +MEM_U32(at + 0) = t7; +at = 0x10000000; +a0 = 0x100008a8; +//nop; +t8 = 0x1; +MEM_U32(at + 0) = t8; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406e94; +a0 = a0; +L406e94: +// bdead 400c000b gp = MEM_U32(sp + 64); +t9 = v0 + s2; +at = 0x1000a1b4; +MEM_U32(at + 0) = t9; +goto L407154; +MEM_U32(at + 0) = t9; +L406ea8: +a0 = 0x100008b4; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406ebc; +//nop; +L406ebc: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a1 = 0x100008ac; +//nop; +a2 = s4; +a0 = s2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406edc; +a1 = a1; +L406edc: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406f38;} +at = 0x1000a36c; +t0 = 0x1; +MEM_U32(at + 0) = t0; +at = 0x10000008; +t2 = 0x2; +MEM_U32(at + 0) = t2; +at = 0x100003f8; +t1 = 0x1; +MEM_U32(at + 0) = t1; +at = 0x10000000; +a0 = 0x100008bc; +//nop; +t3 = 0x1; +MEM_U32(at + 0) = t3; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406f24; +a0 = a0; +L406f24: +// bdead 400c000b gp = MEM_U32(sp + 64); +t4 = v0 + s2; +at = 0x1000a1b4; +MEM_U32(at + 0) = t4; +goto L407154; +MEM_U32(at + 0) = t4; +L406f38: +a0 = 0x100008cc; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406f4c; +//nop; +L406f4c: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a1 = 0x100008c4; +//nop; +a2 = s4; +a0 = s2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406f6c; +a1 = a1; +L406f6c: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L406fc8;} +at = 0x1000a36c; +t5 = 0x1; +MEM_U32(at + 0) = t5; +at = 0x10000008; +t6 = 0x3; +MEM_U32(at + 0) = t6; +at = 0x100003f8; +t7 = 0x1; +MEM_U32(at + 0) = t7; +at = 0x10000000; +a0 = 0x100008d4; +//nop; +t8 = 0x1; +MEM_U32(at + 0) = t8; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L406fb4; +a0 = a0; +L406fb4: +// bdead 400c000b gp = MEM_U32(sp + 64); +t9 = v0 + s2; +at = 0x1000a1b4; +MEM_U32(at + 0) = t9; +goto L407154; +MEM_U32(at + 0) = t9; +L406fc8: +a0 = 0x100008e0; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L406fdc; +//nop; +L406fdc: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a1 = 0x100008dc; +//nop; +a2 = s4; +a0 = s2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L406ffc; +a1 = a1; +L406ffc: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L40704c;} +at = 0x1000a36c; +t0 = 0x1; +MEM_U32(at + 0) = t0; +at = 0x10000008; +t2 = 0x1; +MEM_U32(at + 0) = t2; +at = 0x100003f8; +a0 = 0x100008e4; +//nop; +t1 = 0x1; +MEM_U32(at + 0) = t1; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L407038; +a0 = a0; +L407038: +// bdead 400c000b gp = MEM_U32(sp + 64); +t3 = v0 + s2; +at = 0x1000a1b4; +MEM_U32(at + 0) = t3; +goto L407154; +MEM_U32(at + 0) = t3; +L40704c: +a0 = 0x100008ec; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L407060; +//nop; +L407060: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a1 = 0x100008e8; +//nop; +a2 = s4; +a0 = s2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L407080; +a1 = a1; +L407080: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L4070d0;} +at = 0x1000a36c; +t4 = 0x1; +MEM_U32(at + 0) = t4; +at = 0x10000008; +t5 = 0x2; +MEM_U32(at + 0) = t5; +at = 0x100003f8; +a0 = 0x100008f0; +//nop; +t6 = 0x1; +MEM_U32(at + 0) = t6; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L4070bc; +a0 = a0; +L4070bc: +// bdead 400c000b gp = MEM_U32(sp + 64); +t7 = v0 + s2; +at = 0x1000a1b4; +MEM_U32(at + 0) = t7; +goto L407154; +MEM_U32(at + 0) = t7; +L4070d0: +a0 = 0x100008f8; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L4070e4; +//nop; +L4070e4: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +a1 = 0x100008f4; +//nop; +a2 = s4; +a0 = s2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L407104; +a1 = a1; +L407104: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a36c; +goto L407154;} +at = 0x1000a36c; +t8 = 0x1; +MEM_U32(at + 0) = t8; +at = 0x10000008; +t9 = 0x3; +MEM_U32(at + 0) = t9; +at = 0x100003f8; +//nop; +a0 = 0x100008fc; +t0 = 0x1; +MEM_U32(at + 0) = t0; +a0 = a0; +v0 = wrapper_strlen(mem, a0); +goto L407140; +a0 = a0; +L407140: +// bdead 400c000b gp = MEM_U32(sp + 64); +t2 = v0 + s2; +at = 0x1000a1b4; +//nop; +MEM_U32(at + 0) = t2; +L407154: +at = 0x1000a1b4; +a0 = 0x10000900; +//nop; +MEM_U32(at + 0) = zero; +a0 = a0; +v0 = wrapper_getenv(mem, a0); +goto L40716c; +a0 = a0; +L40716c: +MEM_U32(sp + 304) = v0; +t1 = MEM_U32(sp + 304); +// bdead 400c0403 gp = MEM_U32(sp + 64); +s4 = t1 < 0x1; +if (s4 != 0) {//nop; +goto L4071b0;} +//nop; +s4 = MEM_U8(t1 + 0); +//nop; +t3 = s4 < 0x1; +s4 = t3; +if (s4 != 0) {//nop; +goto L4071b0;} +//nop; +s4 = MEM_U8(t1 + 0); +//nop; +t4 = s4 ^ 0x30; +t4 = t4 < 0x1; +s4 = t4; +L4071b0: +at = 0x10000210; +t5 = 0x1000a36c; +MEM_U32(at + 0) = s4; +t5 = MEM_U32(t5 + 0); +at = 0x1; +if (t5 != at) {//nop; +goto L4071e8;} +//nop; +//nop; +a0 = MEM_U32(sp + 352); +a1 = MEM_U32(sp + 356); +//nop; +f_save_off_command_line(mem, sp, a0, a1); +goto L4071e0; +//nop; +L4071e0: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L4071e8: +a0 = 0x10000910; +//nop; +a0 = a0; +//nop; +v0 = wrapper_getenv(mem, a0); +goto L4071fc; +//nop; +L4071fc: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a25c; +t6 = 0x1000a25c; +MEM_U32(at + 0) = v0; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L407234;} +//nop; +t7 = 0x10000924; +at = 0x1000a25c; +t7 = t7; +MEM_U32(at + 0) = t7; +goto L4072a0; +MEM_U32(at + 0) = t7; +L407234: +a0 = 0x1000a25c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L407248; +//nop; +L407248: +// bdead 400c010b gp = MEM_U32(sp + 64); +at = 0x2f; +t8 = 0x1000a25c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +t9 = v0 + t8; +t0 = MEM_U8(t9 + -1); +//nop; +if (t0 == at) {//nop; +goto L4072a0;} +//nop; +a1 = 0x10000928; +//nop; +a0 = t8; +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40728c; +a1 = a1; +L40728c: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a25c; +//nop; +MEM_U32(at + 0) = v0; +L4072a0: +a0 = 0x1000092c; +//nop; +a0 = a0; +//nop; +v0 = wrapper_getenv(mem, a0); +goto L4072b4; +//nop; +L4072b4: +// bdead 400c010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a26c; +t2 = 0x1000a26c; +MEM_U32(at + 0) = v0; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L4072ec;} +//nop; +t3 = 0x10000938; +at = 0x1000a26c; +t3 = t3; +MEM_U32(at + 0) = t3; +goto L407358; +MEM_U32(at + 0) = t3; +L4072ec: +a0 = 0x1000a26c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L407300; +//nop; +L407300: +// bdead 400c010b gp = MEM_U32(sp + 64); +at = 0x2f; +t1 = 0x1000a26c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +t4 = v0 + t1; +t5 = MEM_U8(t4 + -1); +//nop; +if (t5 == at) {//nop; +goto L407358;} +//nop; +a1 = 0x1000093c; +//nop; +a0 = t1; +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L407344; +a1 = a1; +L407344: +// bdead 400c010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a26c; +//nop; +MEM_U32(at + 0) = v0; +L407358: +a0 = 0x1000a26c; +a1 = 0x10000940; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L407374; +a1 = a1; +L407374: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a19c; +a0 = 0x1000094c; +//nop; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = wrapper_getenv(mem, a0); +goto L407394; +a0 = a0; +L407394: +// bdead 400c010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a2fc; +t6 = 0x1000a2fc; +MEM_U32(at + 0) = v0; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L4073cc;} +//nop; +t7 = 0x10000954; +at = 0x1000a2fc; +t7 = t7; +MEM_U32(at + 0) = t7; +goto L407438; +MEM_U32(at + 0) = t7; +L4073cc: +a0 = 0x1000a2fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L4073e0; +//nop; +L4073e0: +// bdead 400c010b gp = MEM_U32(sp + 64); +at = 0x2f; +t9 = 0x1000a2fc; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +t0 = v0 + t9; +t8 = MEM_U8(t0 + -1); +//nop; +if (t8 == at) {//nop; +goto L407438;} +//nop; +a0 = t9; +//nop; +a1 = 0x1000095c; +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L407424; +a1 = a1; +L407424: +// bdead 400c010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a2fc; +//nop; +MEM_U32(at + 0) = v0; +L407438: +a0 = 0x1000a2fc; +a1 = 0x10000960; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L407454; +a1 = a1; +L407454: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = s4; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L40746c; +//nop; +L40746c: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a0 = 0x1000a1f4; +a1 = 0x10000970; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_fopen(mem, a0, a1); +goto L407494; +a1 = a1; +L407494: +// bdead 400c010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a238; +t2 = 0x1000a238; +MEM_U32(at + 0) = v0; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L407510;} +//nop; +a2 = 0x1000a2fc; +a1 = 0x10000974; +//nop; +a0 = 0x10009c28; +a2 = MEM_U32(a2 + 0); +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_sprintf(mem, a0, a1, sp); +goto L4074d4; +a1 = a1; +L4074d4: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x10009c28; +//nop; +wrapper_perror(mem, a0); +goto L4074ec; +//nop; +L4074ec: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L407504; +//nop; +L407504: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +goto L407548; +//nop; +L407510: +a0 = 0x1000a238; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_fclose(mem, a0); +goto L407524; +//nop; +L407524: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L407540; +//nop; +L407540: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L407548: +a0 = 0x10000994; +//nop; +a0 = a0; +//nop; +v0 = wrapper_getenv(mem, a0); +goto L40755c; +//nop; +L40755c: +// bdead 400c000b gp = MEM_U32(sp + 64); +t3 = MEM_U32(sp + 352); +at = 0x1000a30c; +s0 = 0x1; +MEM_U32(at + 0) = v0; +at = (int)s0 < (int)t3; +if (at == 0) {//nop; +goto L407798;} +//nop; +L40757c: +t4 = MEM_U32(sp + 356); +t5 = s0 << 2; +a1 = 0x100009a4; +//nop; +t1 = t4 + t5; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L40759c; +a1 = a1; +L40759c: +// bdead 400e000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4075dc;} +//nop; +t7 = 0x10000230; +at = 0x10000324; +t7 = MEM_U32(t7 + 0); +t6 = 0x1; +MEM_U32(at + 0) = t6; +at = (int)t7 < (int)0x3; +if (at == 0) {//nop; +goto L407798;} +//nop; +t0 = 0x100009b0; +at = 0x10000400; +t0 = t0; +MEM_U32(at + 0) = t0; +goto L407798; +MEM_U32(at + 0) = t0; +L4075dc: +t8 = MEM_U32(sp + 356); +t9 = s0 << 2; +t2 = t8 + t9; +//nop; +a1 = 0x100009b4; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4075fc; +a1 = a1; +L4075fc: +// bdead 400e000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000424; +goto L407624;} +at = 0x10000424; +t3 = 0x1; +t4 = 0x100009bc; +MEM_U32(at + 0) = t3; +at = 0x10000400; +t4 = t4; +MEM_U32(at + 0) = t4; +goto L407798; +MEM_U32(at + 0) = t4; +L407624: +t5 = MEM_U32(sp + 356); +t1 = s0 << 2; +a1 = 0x100009c0; +//nop; +t6 = t5 + t1; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L407644; +a1 = a1; +L407644: +// bdead 400e000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x100002dc; +goto L407674;} +at = 0x100002dc; +t7 = 0x1; +MEM_U32(at + 0) = t7; +at = 0x10000340; +t0 = 0x100009c8; +MEM_U32(at + 0) = zero; +at = 0x10000400; +t0 = t0; +MEM_U32(at + 0) = t0; +goto L407798; +MEM_U32(at + 0) = t0; +L407674: +t8 = MEM_U32(sp + 356); +t9 = s0 << 2; +t2 = t8 + t9; +//nop; +a1 = 0x100009cc; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L407694; +a1 = a1; +L407694: +// bdead 400e000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x100002f4; +goto L4076c4;} +at = 0x100002f4; +t3 = 0x1; +t4 = 0x100009d4; +MEM_U32(at + 0) = t3; +at = 0x10000400; +t4 = t4; +MEM_U32(at + 0) = t4; +at = 0x10000340; +MEM_U32(at + 0) = zero; +goto L407798; +MEM_U32(at + 0) = zero; +L4076c4: +t5 = MEM_U32(sp + 356); +t1 = s0 << 2; +a1 = 0x100009d8; +//nop; +t6 = t5 + t1; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4076e4; +a1 = a1; +L4076e4: +// bdead 400e000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000034c; +goto L407714;} +at = 0x1000034c; +t7 = 0x1; +MEM_U32(at + 0) = t7; +at = 0x10000340; +t0 = 0x100009e0; +MEM_U32(at + 0) = zero; +at = 0x10000400; +t0 = t0; +MEM_U32(at + 0) = t0; +goto L407798; +MEM_U32(at + 0) = t0; +L407714: +t8 = MEM_U32(sp + 356); +t9 = s0 << 2; +t2 = t8 + t9; +//nop; +a1 = 0x100009e4; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L407734; +a1 = a1; +L407734: +// bdead 400e000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000037c; +goto L40774c;} +at = 0x1000037c; +t3 = 0x1; +MEM_U32(at + 0) = t3; +goto L407798; +MEM_U32(at + 0) = t3; +L40774c: +t4 = MEM_U32(sp + 356); +t5 = s0 << 2; +a1 = 0x100009ec; +//nop; +t1 = t4 + t5; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L40776c; +a1 = a1; +L40776c: +// bdead 400e000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000230; +goto L407784;} +at = 0x10000230; +t6 = 0x3; +MEM_U32(at + 0) = t6; +goto L407798; +MEM_U32(at + 0) = t6; +L407784: +t7 = MEM_U32(sp + 352); +s0 = s0 + 0x1; +at = (int)s0 < (int)t7; +if (at != 0) {//nop; +goto L40757c;} +//nop; +L407798: +t0 = 0x1000a36c; +at = 0x1; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == at) {at = 0x2; +goto L4077c4;} +at = 0x2; +if (t0 == at) {at = 0x3; +goto L4077c4;} +at = 0x3; +if (t0 == at) {at = 0x4; +goto L4077c4;} +at = 0x4; +if (t0 != at) {at = 0x1000a1a0; +goto L4077dc;} +L4077c4: +at = 0x1000a1a0; +t8 = 0x1; +MEM_U32(at + 0) = t8; +at = 0x1000a1a4; +MEM_U32(at + 0) = zero; +goto L4077f4; +MEM_U32(at + 0) = zero; +L4077dc: +at = 0x1000a1a0; +t9 = 0x1; +MEM_U32(at + 0) = zero; +at = 0x1000a1a4; +//nop; +MEM_U32(at + 0) = t9; +L4077f4: +t2 = 0x1000a340; +at = 0x1000a32c; +//nop; +t3 = MEM_U32(t2 + 0); +a0 = 0x1000a588; +MEM_U32(at + 0) = t3; +f_mklist(mem, sp, a0); +goto L407810; +MEM_U32(at + 0) = t3; +L407810: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a598; +//nop; +f_mklist(mem, sp, a0); +goto L407828; +//nop; +L407828: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a578; +//nop; +f_mklist(mem, sp, a0); +goto L407840; +//nop; +L407840: +t4 = MEM_U32(sp + 352); +s0 = 0x1; +// bdead 400e2103 gp = MEM_U32(sp + 64); +at = (int)s0 < (int)t4; +if (at == 0) {//nop; +goto L407c1c;} +//nop; +L407858: +t5 = MEM_U32(sp + 356); +t1 = s0 << 2; +t6 = t5 + t1; +t7 = MEM_U32(t6 + 0); +at = 0x2d; +t0 = MEM_U8(t7 + 0); +//nop; +if (t0 != at) {//nop; +goto L407c08;} +//nop; +t8 = s0 << 2; +t9 = t5 + t8; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x100009f0; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L407898; +a1 = a1; +L407898: +// bdead 400e018b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4078b0;} +//nop; +t2 = 0x1; +MEM_U32(sp + 332) = t2; +goto L407c08; +MEM_U32(sp + 332) = t2; +L4078b0: +t3 = MEM_U32(sp + 356); +t4 = s0 << 2; +t1 = t3 + t4; +t6 = MEM_U32(t1 + 0); +at = 0x45; +s4 = MEM_U8(t6 + 1); +//nop; +if (s4 == at) {at = 0x4c; +goto L4078e4;} +at = 0x4c; +if (s4 == at) {//nop; +goto L407a90;} +//nop; +//nop; +goto L407c08; +//nop; +L4078e4: +t7 = MEM_U32(sp + 356); +t0 = s0 << 2; +t5 = t7 + t0; +t8 = MEM_U32(t5 + 0); +//nop; +t9 = MEM_U8(t8 + 3); +//nop; +if (t9 != 0) {//nop; +goto L407c08;} +//nop; +t2 = s0 << 2; +t3 = t7 + t2; +t4 = MEM_U32(t3 + 0); +at = 0x42; +t1 = MEM_U8(t4 + 2); +//nop; +if (t1 == at) {//nop; +goto L407948;} +//nop; +t6 = s0 << 2; +t0 = t7 + t6; +t5 = MEM_U32(t0 + 0); +at = 0x4c; +t8 = MEM_U8(t5 + 2); +//nop; +if (t8 != at) {//nop; +goto L407c08;} +//nop; +L407948: +t9 = MEM_U32(sp + 356); +t2 = s0 << 2; +t3 = t9 + t2; +t4 = MEM_U32(t3 + 0); +at = 0x42; +t1 = MEM_U8(t4 + 2); +//nop; +if (t1 != at) {//nop; +goto L4079f0;} +//nop; +t7 = 0x1000027c; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L4079e4;} +//nop; +t6 = 0x1000041c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L4079e4;} +//nop; +t0 = 0x100009fc; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4079c4; +MEM_U32(sp + 16) = zero; +L4079c4: +// bdead 400e0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4079dc; +//nop; +L4079dc: +// bdead 400e0003 gp = MEM_U32(sp + 64); +//nop; +L4079e4: +at = 0x1000041c; +MEM_U32(at + 0) = zero; +goto L407a74; +MEM_U32(at + 0) = zero; +L4079f0: +t5 = 0x1000027c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L407a68;} +//nop; +t8 = 0x1000041c; +at = 0x1; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == at) {//nop; +goto L407a68;} +//nop; +t9 = 0x10000a24; +a0 = 0x1; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L407a48; +MEM_U32(sp + 16) = zero; +L407a48: +// bdead 400e0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L407a60; +//nop; +L407a60: +// bdead 400e0003 gp = MEM_U32(sp + 64); +//nop; +L407a68: +at = 0x1000041c; +t2 = 0x1; +MEM_U32(at + 0) = t2; +L407a74: +//nop; +//nop; +//nop; +f_newrunlib(mem, sp); +goto L407a84; +//nop; +L407a84: +// bdead 400e0103 gp = MEM_U32(sp + 64); +//nop; +goto L407c08; +//nop; +L407a90: +t3 = MEM_U32(sp + 356); +t4 = s0 << 2; +t1 = t3 + t4; +t7 = MEM_U32(t1 + 0); +//nop; +t6 = MEM_U8(t7 + 2); +//nop; +if (t6 != 0) {//nop; +goto L407b44;} +//nop; +t0 = MEM_U32(sp + 352); +t5 = s0 + 0x1; +at = (int)t5 < (int)t0; +if (at == 0) {//nop; +goto L407b0c;} +//nop; +t8 = s0 << 2; +t9 = t3 + t8; +t2 = MEM_U32(t9 + 4); +at = 0x2d; +t4 = MEM_U8(t2 + 0); +//nop; +if (t4 == at) {//nop; +goto L407b0c;} +//nop; +t1 = s0 << 2; +//nop; +t7 = t3 + t1; +a0 = MEM_U32(t7 + 4); +//nop; +v0 = f_isdir(mem, sp, a0); +goto L407b00; +//nop; +L407b00: +// bdead 400e018b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L407b18;} +//nop; +L407b0c: +t6 = 0x1; +MEM_U32(sp + 332) = t6; +goto L407c08; +MEM_U32(sp + 332) = t6; +L407b18: +t0 = MEM_U32(sp + 356); +s0 = s0 + 0x1; +t5 = s0 << 2; +//nop; +t8 = t0 + t5; +a0 = MEM_U32(t8 + 0); +a1 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L407b38; +a1 = zero; +L407b38: +// bdead 400e000b gp = MEM_U32(sp + 64); +MEM_U32(sp + 300) = v0; +goto L407b6c; +MEM_U32(sp + 300) = v0; +L407b44: +t9 = MEM_U32(sp + 356); +t2 = s0 << 2; +t4 = t9 + t2; +a0 = MEM_U32(t4 + 0); +//nop; +a1 = zero; +a0 = a0 + 0x2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L407b64; +a0 = a0 + 0x2; +L407b64: +// bdead 400e000b gp = MEM_U32(sp + 64); +MEM_U32(sp + 300) = v0; +L407b6c: +//nop; +a0 = MEM_U32(sp + 300); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L407b7c; +//nop; +L407b7c: +t3 = MEM_U32(sp + 300); +// bdead 400e100b gp = MEM_U32(sp + 64); +t1 = v0 + t3; +t7 = MEM_U8(t1 + -1); +at = 0x2f; +if (t7 != at) {//nop; +goto L407bbc;} +//nop; +//nop; +a0 = t3; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L407ba8; +//nop; +L407ba8: +t6 = MEM_U32(sp + 300); +s4 = v0; +// bdead 402e8003 gp = MEM_U32(sp + 64); +t0 = t6 + s4; +MEM_U8(t0 + -1) = (uint8_t)zero; +L407bbc: +//nop; +a0 = 0x1000a578; +a1 = MEM_U32(sp + 300); +//nop; +f_addstr(mem, sp, a0, a1); +goto L407bd0; +//nop; +L407bd0: +// bdead 400e0003 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 300); +//nop; +a0 = 0x1000a588; +//nop; +f_addstr(mem, sp, a0, a1); +goto L407be8; +//nop; +L407be8: +// bdead 400e0003 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 300); +//nop; +a0 = 0x1000a598; +//nop; +f_addstr(mem, sp, a0, a1); +goto L407c00; +//nop; +L407c00: +// bdead 400e0103 gp = MEM_U32(sp + 64); +//nop; +L407c08: +t5 = MEM_U32(sp + 352); +s0 = s0 + 0x1; +at = (int)s0 < (int)t5; +if (at != 0) {//nop; +goto L407858;} +//nop; +L407c1c: +t8 = MEM_U32(sp + 332); +//nop; +if (t8 != 0) {//nop; +goto L407d98;} +//nop; +t9 = 0x10000324; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L407c8c;} +//nop; +t2 = 0x100002dc; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L407c8c;} +//nop; +t4 = 0x100002f4; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L407c8c;} +//nop; +t1 = 0x1000034c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L407ccc;} +//nop; +L407c8c: +a0 = 0x1000a25c; +a1 = 0x10000a4c; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L407ca8; +a1 = a1; +L407ca8: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a588; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L407cc0; +a1 = s4; +L407cc0: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +goto L407d98; +//nop; +L407ccc: +t7 = 0x1000037c; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L407d24;} +//nop; +a0 = 0x1000a25c; +a1 = 0x10000a60; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L407d00; +a1 = a1; +L407d00: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a598; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L407d18; +a1 = s4; +L407d18: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +goto L407d98; +//nop; +L407d24: +a0 = 0x1000a25c; +a1 = 0x10000a6c; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L407d40; +a1 = a1; +L407d40: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a578; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L407d58; +a1 = s4; +L407d58: +// bdead 400c0103 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x1000a25c; +a1 = 0x10000a74; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L407d78; +a1 = a1; +L407d78: +// bdead 400c000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a578; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L407d90; +a1 = s4; +L407d90: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L407d98: +a0 = 0x1000a1ac; +a2 = 0x1000a1b4; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +a1 = zero; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L407db4; +a1 = zero; +L407db4: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = zero; +a2 = 0x1000a1b4; +a0 = 0x10000a78; +//nop; +a2 = MEM_U32(a2 + 0); +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L407dd4; +a0 = a0; +L407dd4: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a25c; +a0 = 0x10000a7c; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +v0 = wrapper_strcmp(mem, a0, a1); +goto L407df4; +a0 = a0; +L407df4: +// bdead 400c010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L407e58;} +//nop; +a0 = 0x1000a25c; +a1 = 0x10000a80; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L407e1c; +a1 = a1; +L407e1c: +// bdead 400c010b gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x1000a25c; +at = 0x1000008c; +a1 = 0x10000a90; +//nop; +a0 = MEM_U32(a0 + 0); +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L407e44; +a1 = a1; +L407e44: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +at = 0x10000084; +//nop; +MEM_U32(at + 0) = v0; +L407e58: +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {at = 0x100002b0; +goto L407e78;} +at = 0x100002b0; +MEM_U32(at + 0) = zero; +goto L407e88; +MEM_U32(at + 0) = zero; +L407e78: +t6 = 0x10000a9c; +at = 0x100001e0; +t6 = t6; +MEM_U32(at + 0) = t6; +L407e88: +t0 = 0x10000aa4; +at = 0x1000a27c; +t0 = t0; +MEM_U32(at + 0) = t0; +at = 0x10000370; +//nop; +t5 = 0x1; +a0 = MEM_U32(sp + 352); +a1 = MEM_U32(sp + 356); +MEM_U32(at + 0) = t5; +f_process_config(mem, sp, a0, a1); +goto L407eb4; +MEM_U32(at + 0) = t5; +L407eb4: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a0 = MEM_U32(sp + 352); +a1 = MEM_U32(sp + 356); +//nop; +a0 = a0 + 0xffffffff; +a1 = a1 + 0x4; +f_parse_command(mem, sp, a0, a1); +goto L407ed0; +a1 = a1 + 0x4; +L407ed0: +// bdead 400c0103 gp = MEM_U32(sp + 64); +//nop; +t8 = 0x100001fc; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L40803c;} +//nop; +t9 = 0x10000204; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L407f18;} +//nop; +t2 = 0x10000aac; +at = 0x10000204; +t2 = t2; +MEM_U32(at + 0) = t2; +L407f18: +t4 = 0x10000200; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L407f3c;} +//nop; +s4 = 0x10000ab0; +s4 = s4; +goto L407f48; +s4 = s4; +L407f3c: +s4 = 0x10000ab8; +//nop; +s4 = s4; +L407f48: +a1 = 0x10000204; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = s4; +a2 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L407f60; +a2 = zero; +L407f60: +// bdead 400c000b gp = MEM_U32(sp + 64); +at = 0x1; +t1 = 0x1000a36c; +MEM_U32(sp + 328) = v0; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L407fa0;} +//nop; +//nop; +a0 = 0x1000a2f0; +a1 = MEM_U32(sp + 328); +//nop; +f_addstr(mem, sp, a0, a1); +goto L407f94; +//nop; +L407f94: +// bdead 400c0103 gp = MEM_U32(sp + 64); +//nop; +goto L40803c; +//nop; +L407fa0: +t7 = 0x10000200; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L407fcc;} +//nop; +t3 = 0x10000ac0; +//nop; +t3 = t3; +MEM_U32(sp + 324) = t3; +goto L407fdc; +MEM_U32(sp + 324) = t3; +L407fcc: +t6 = 0x10000acc; +//nop; +t6 = t6; +MEM_U32(sp + 324) = t6; +L407fdc: +t0 = 0x10000204; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +t5 = MEM_U8(t0 + 0); +//nop; +if (t5 == 0) {//nop; +goto L408020;} +//nop; +a1 = 0x10000ad4; +//nop; +a0 = MEM_U32(sp + 324); +a2 = t0; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L408018; +a1 = a1; +L408018: +// bdead 400c000b gp = MEM_U32(sp + 64); +MEM_U32(sp + 324) = v0; +L408020: +//nop; +a0 = 0x1000a330; +a1 = MEM_U32(sp + 324); +//nop; +f_addstr(mem, sp, a0, a1); +goto L408034; +//nop; +L408034: +// bdead 400c0103 gp = MEM_U32(sp + 64); +//nop; +L40803c: +t8 = 0x1000035c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L408144;} +//nop; +t9 = 0x10000280; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L40809c;} +//nop; +a0 = 0x1000a25c; +a1 = 0x10000ad8; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L408088; +a1 = a1; +L408088: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +at = 0x10000084; +MEM_U32(at + 0) = v0; +goto L4080f4; +MEM_U32(at + 0) = v0; +L40809c: +a0 = 0x1000a25c; +a1 = 0x10000ae8; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4080b8; +a1 = a1; +L4080b8: +// bdead 400c010b gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x1000a25c; +at = 0x1000008c; +a1 = 0x10000af8; +//nop; +a0 = MEM_U32(a0 + 0); +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4080e0; +a1 = a1; +L4080e0: +// bdead 400c000b gp = MEM_U32(sp + 64); +//nop; +at = 0x10000084; +//nop; +MEM_U32(at + 0) = v0; +L4080f4: +t2 = 0x1000a1b4; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L40812c;} +//nop; +a0 = 0x10000b04; +//nop; +a1 = zero; +a2 = t2; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L408124; +a0 = a0; +L408124: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L40812c: +//nop; +//nop; +//nop; +f_newrunlib(mem, sp); +goto L40813c; +//nop; +L40813c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L408144: +t4 = 0x100002f0; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L40818c;} +//nop; +t1 = 0x100002f4; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L40818c;} +//nop; +t7 = 0x1000030c; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40827c;} +//nop; +L40818c: +t3 = 0x10000340; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L40827c;} +//nop; +t6 = 0x10000324; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L4081ec;} +//nop; +t5 = 0x10000348; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L4081ec;} +//nop; +t0 = 0x10000384; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L40827c;} +//nop; +L4081ec: +t8 = 0x10000324; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {at = 0x10000324; +goto L408218;} +at = 0x10000324; +t9 = 0x1; +MEM_U32(at + 0) = t9; +at = 0x10000318; +t2 = 0x1; +MEM_U32(at + 0) = t2; +L408218: +at = 0x10000384; +t4 = 0x1000031c; +MEM_U32(at + 0) = zero; +at = 0x10000348; +t4 = MEM_U32(t4 + 0); +MEM_U32(at + 0) = zero; +if (t4 != 0) {//nop; +goto L40827c;} +//nop; +a1 = 0x10000b08; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40824c; +a1 = a1; +L40824c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000b14; +//nop; +a0 = 0x1000a2c0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408268; +a1 = a1; +L408268: +// bdead 400c0003 gp = MEM_U32(sp + 64); +t1 = 0x1; +at = 0x1000031c; +//nop; +MEM_U32(at + 0) = t1; +L40827c: +t7 = 0x10000324; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L4082f0;} +//nop; +t3 = 0x1000031c; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L4082f0;} +//nop; +a1 = 0x10000b20; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4082c0; +a1 = a1; +L4082c0: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000b2c; +//nop; +a0 = 0x1000a2c0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4082dc; +a1 = a1; +L4082dc: +// bdead 400c0003 gp = MEM_U32(sp + 64); +t6 = 0x1; +at = 0x1000031c; +MEM_U32(at + 0) = t6; +goto L408340; +MEM_U32(at + 0) = t6; +L4082f0: +t5 = 0x10000348; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L408340;} +//nop; +a1 = 0x10000b38; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40831c; +a1 = a1; +L40831c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000b48; +//nop; +a0 = 0x1000a2c0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408338; +a1 = a1; +L408338: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L408340: +t0 = 0x1000023c; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L4083e8;} +//nop; +t8 = 0x1000a520; +//nop; +t8 = MEM_U32(t8 + 4); +//nop; +if (t8 != 0) {//nop; +goto L4083e8;} +//nop; +t9 = 0x1000a540; +//nop; +t9 = MEM_U32(t9 + 4); +//nop; +if (t9 != 0) {//nop; +goto L4083e8;} +//nop; +t2 = 0x1000a530; +//nop; +t2 = MEM_U32(t2 + 4); +//nop; +if (t2 != 0) {//nop; +goto L4083e8;} +//nop; +t4 = 0x10000b58; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4083c8; +MEM_U32(sp + 16) = zero; +L4083c8: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4083e0; +//nop; +L4083e0: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L4083e8: +t1 = 0x10000398; +at = 0x1; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L408420;} +//nop; +a1 = 0x10000b84; +//nop; +a0 = 0x1000a330; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408414; +a1 = a1; +L408414: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +goto L408454; +//nop; +L408420: +t7 = 0x10000398; +at = 0x2; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L408454;} +//nop; +a1 = 0x10000b88; +//nop; +a0 = 0x1000a330; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40844c; +a1 = a1; +L40844c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L408454: +t3 = 0x10000394; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L4084cc;} +//nop; +t6 = 0x10000228; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L40849c;} +//nop; +t5 = 0x1000022c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L4084cc;} +//nop; +L40849c: +t0 = 0x10000b8c; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4084c4; +MEM_U32(sp + 16) = zero; +L4084c4: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L4084cc: +t8 = 0x1000a150; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L408510;} +//nop; +t9 = 0x1000021c; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L408510;} +//nop; +t2 = t8 & 0x1; +if (t2 == 0) {at = 0x1000a150; +goto L408510;} +at = 0x1000a150; +t4 = t8 | 0x4; +MEM_U32(at + 0) = t4; +L408510: +t1 = 0x1000a188; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L408554;} +//nop; +t7 = 0x1000021c; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L408554;} +//nop; +t3 = t1 & 0x1; +if (t3 == 0) {at = 0x1000a188; +goto L408554;} +at = 0x1000a188; +t6 = t1 | 0x4; +MEM_U32(at + 0) = t6; +L408554: +t5 = 0x10000004; +at = 0x1; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == at) {at = 0x2; +goto L408574;} +at = 0x2; +if (t5 != at) {//nop; +goto L408590;} +//nop; +L408574: +t0 = 0x10000b9c; +at = 0x1000a254; +t0 = t0; +MEM_U32(at + 0) = t0; +at = 0x100001e8; +t9 = 0x1; +MEM_U32(at + 0) = t9; +L408590: +a0 = 0x10000ba4; +//nop; +a1 = zero; +a2 = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L4085a8; +a0 = a0; +L4085a8: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +t2 = 0x1000a570; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L408630;} +//nop; +t8 = 0x1000a36c; +at = 0x1; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L408630;} +//nop; +t4 = 0x10000004; +at = 0x1; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == at) {at = 0x2; +goto L408600;} +at = 0x2; +if (t4 != at) {//nop; +goto L408630;} +//nop; +L408600: +t7 = 0x10000ba8; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L408628; +MEM_U32(sp + 16) = zero; +L408628: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L408630: +t3 = 0x10000230; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +at = (int)t3 < (int)0x3; +if (at != 0) {//nop; +goto L40864c;} +//nop; +L40864c: +t1 = 0x10000340; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L4086e4;} +//nop; +a0 = 0x10000400; +a1 = 0x10000c00; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L40867c; +a1 = a1; +L40867c: +// bdead 400c000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4086e4;} +//nop; +t6 = 0x10000230; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +at = (int)t6 < (int)0x3; +if (at == 0) {//nop; +goto L4086e4;} +//nop; +t5 = 0x10000c04; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4086cc; +MEM_U32(sp + 16) = zero; +L4086cc: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +t0 = 0x10000c4c; +at = 0x10000400; +t0 = t0; +MEM_U32(at + 0) = t0; +L4086e4: +t9 = 0x1000037c; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L408768;} +//nop; +t2 = 0x10000324; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L408768;} +//nop; +t8 = 0x10000c50; +//nop; +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L40873c; +MEM_U32(sp + 16) = zero; +L40873c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +t4 = 0x1; +at = 0x10000324; +t7 = 0x10000c8c; +MEM_U32(at + 0) = zero; +at = 0x10000340; +t7 = t7; +MEM_U32(at + 0) = t4; +at = 0x10000400; +//nop; +MEM_U32(at + 0) = t7; +L408768: +//nop; +//nop; +//nop; +f_get_host_chiptype(mem, sp); +goto L408778; +//nop; +L408778: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +t3 = 0x1000041c; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L4089e4;} +//nop; +a1 = 0x10000c90; +//nop; +a0 = 0x1000a270; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4087ac; +a1 = a1; +L4087ac: +// bdead 400c0003 gp = MEM_U32(sp + 64); +at = 0x1; +t1 = 0x1000a36c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L4087ec;} +//nop; +t6 = 0x10000004; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {at = 0x3; +goto L4087ec;} +at = 0x3; +if (t6 != at) {//nop; +goto L408808;} +//nop; +L4087ec: +a1 = 0x10000c9c; +//nop; +a0 = 0x1000a270; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408800; +a1 = a1; +L408800: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L408808: +t5 = 0x1000a36c; +at = 0x1; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L40887c;} +//nop; +t0 = 0x10000004; +at = 0x1; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == at) {at = 0x2; +goto L408860;} +at = 0x2; +if (t0 == at) {at = 0x3; +goto L408860;} +at = 0x3; +if (t0 != at) {//nop; +goto L40887c;} +//nop; +t9 = 0x10000424; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L40887c;} +//nop; +L408860: +a1 = 0x10000ca8; +//nop; +a0 = 0x1000a270; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408874; +a1 = a1; +L408874: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L40887c: +t2 = 0x1000a36c; +at = 0x1; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L4088c8;} +//nop; +t8 = 0x10000004; +at = 0x2; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L4088c8;} +//nop; +a1 = 0x10000cb8; +//nop; +a0 = 0x1000a270; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4088c0; +a1 = a1; +L4088c0: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L4088c8: +a1 = 0x10000ccc; +//nop; +a0 = 0x1000a310; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4088dc; +a1 = a1; +L4088dc: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000cd0; +//nop; +a0 = 0x1000a320; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4088f8; +a1 = a1; +L4088f8: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000cd4; +//nop; +a0 = 0x1000a330; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408914; +a1 = a1; +L408914: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000cd8; +//nop; +a0 = 0x1000a408; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408930; +a1 = a1; +L408930: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000cdc; +//nop; +a0 = 0x1000a428; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40894c; +a1 = a1; +L40894c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000ce0; +//nop; +a0 = 0x1000a418; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408968; +a1 = a1; +L408968: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000ce4; +//nop; +a0 = 0x1000a470; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408984; +a1 = a1; +L408984: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000ce8; +//nop; +a0 = 0x1000a4b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4089a0; +a1 = a1; +L4089a0: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000cec; +//nop; +a0 = 0x1000a4c0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4089bc; +a1 = a1; +L4089bc: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000cf0; +//nop; +a0 = 0x1000a4d0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4089d8; +a1 = a1; +L4089d8: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +goto L408c64; +//nop; +L4089e4: +a1 = 0x10000cf4; +//nop; +a0 = 0x1000a270; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4089f8; +a1 = a1; +L4089f8: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d00; +//nop; +a0 = 0x1000a270; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408a14; +a1 = a1; +L408a14: +// bdead 400c0003 gp = MEM_U32(sp + 64); +at = 0x1; +t4 = 0x1000a36c; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L408a54;} +//nop; +t7 = 0x10000004; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {at = 0x3; +goto L408a54;} +at = 0x3; +if (t7 != at) {//nop; +goto L408a70;} +//nop; +L408a54: +a1 = 0x10000d0c; +//nop; +a0 = 0x1000a270; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408a68; +a1 = a1; +L408a68: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L408a70: +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L408ae4;} +//nop; +t1 = 0x10000004; +at = 0x1; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == at) {at = 0x2; +goto L408ac8;} +at = 0x2; +if (t1 == at) {at = 0x3; +goto L408ac8;} +at = 0x3; +if (t1 != at) {//nop; +goto L408ae4;} +//nop; +t6 = 0x10000424; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L408ae4;} +//nop; +L408ac8: +a1 = 0x10000d18; +//nop; +a0 = 0x1000a270; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408adc; +a1 = a1; +L408adc: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L408ae4: +t5 = 0x1000a36c; +at = 0x1; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L408b30;} +//nop; +t0 = 0x10000004; +at = 0x2; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L408b30;} +//nop; +a1 = 0x10000d28; +//nop; +a0 = 0x1000a270; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408b28; +a1 = a1; +L408b28: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L408b30: +a1 = 0x10000d3c; +//nop; +a0 = 0x1000a310; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408b44; +a1 = a1; +L408b44: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d40; +//nop; +a0 = 0x1000a320; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408b60; +a1 = a1; +L408b60: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d44; +//nop; +a0 = 0x1000a330; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408b7c; +a1 = a1; +L408b7c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d48; +//nop; +a0 = 0x1000a408; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408b98; +a1 = a1; +L408b98: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d4c; +//nop; +a0 = 0x1000a428; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408bb4; +a1 = a1; +L408bb4: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d50; +//nop; +a0 = 0x1000a418; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408bd0; +a1 = a1; +L408bd0: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d54; +//nop; +a0 = 0x1000a4c0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408bec; +a1 = a1; +L408bec: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d58; +//nop; +a0 = 0x1000a470; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408c08; +a1 = a1; +L408c08: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d5c; +//nop; +a0 = 0x1000a4b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408c24; +a1 = a1; +L408c24: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d60; +//nop; +a0 = 0x1000a4d0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408c40; +a1 = a1; +L408c40: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d64; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408c5c; +a1 = a1; +L408c5c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L408c64: +s4 = 0x1000021c; +//nop; +s4 = MEM_U32(s4 + 0); +//nop; +if (s4 == 0) {at = 0x1; +goto L408c9c;} +at = 0x1; +if (s4 == at) {at = 0x2; +goto L408e24;} +at = 0x2; +if (s4 == at) {at = 0x3; +goto L408e7c;} +at = 0x3; +if (s4 == at) {//nop; +goto L408ed4;} +//nop; +//nop; +goto L408f3c; +//nop; +L408c9c: +a1 = 0x10000d68; +//nop; +a0 = 0x1000a310; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408cb0; +a1 = a1; +L408cb0: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d70; +//nop; +a0 = 0x1000a320; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408ccc; +a1 = a1; +L408ccc: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d74; +//nop; +a0 = 0x1000a330; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408ce8; +a1 = a1; +L408ce8: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d78; +//nop; +a0 = 0x1000a428; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408d04; +a1 = a1; +L408d04: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d7c; +//nop; +a0 = 0x1000a490; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408d20; +a1 = a1; +L408d20: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d80; +//nop; +a0 = 0x1000a4a0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408d3c; +a1 = a1; +L408d3c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d84; +//nop; +a0 = 0x1000a4b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408d58; +a1 = a1; +L408d58: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d88; +//nop; +a0 = 0x1000a470; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408d74; +a1 = a1; +L408d74: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d8c; +//nop; +a0 = 0x1000a480; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408d90; +a1 = a1; +L408d90: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d90; +//nop; +a0 = 0x1000a4c0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408dac; +a1 = a1; +L408dac: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d94; +//nop; +a0 = 0x1000a4d0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408dc8; +a1 = a1; +L408dc8: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000d98; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408de4; +a1 = a1; +L408de4: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +t9 = 0x10000124; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L408f3c;} +//nop; +a1 = 0x10000d9c; +//nop; +a0 = 0x1000a2f0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408e18; +a1 = a1; +L408e18: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +goto L408f3c; +//nop; +L408e24: +a1 = 0x10000da4; +//nop; +a0 = 0x1000a2f0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408e38; +a1 = a1; +L408e38: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000dac; +//nop; +a0 = 0x1000a310; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408e54; +a1 = a1; +L408e54: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x10000db4; +//nop; +a0 = a0; +//nop; +f_add_info(mem, sp, a0); +goto L408e70; +//nop; +L408e70: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +goto L408f3c; +//nop; +L408e7c: +a1 = 0x10000db8; +//nop; +a0 = 0x1000a2f0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408e90; +a1 = a1; +L408e90: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000dc0; +//nop; +a0 = 0x1000a310; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408eac; +a1 = a1; +L408eac: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x10000dc8; +//nop; +a0 = a0; +//nop; +f_add_info(mem, sp, a0); +goto L408ec8; +//nop; +L408ec8: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +goto L408f3c; +//nop; +L408ed4: +t2 = 0x1000021c; +at = 0x1000021c; +t2 = MEM_U32(t2 + 0); +a1 = 0x10000dcc; +//nop; +a0 = 0x1000a2f0; +t8 = t2 + 0x1; +MEM_U32(at + 0) = t8; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408efc; +a1 = a1; +L408efc: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000dd4; +//nop; +a0 = 0x1000a310; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L408f18; +a1 = a1; +L408f18: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x10000ddc; +//nop; +a0 = a0; +//nop; +f_add_info(mem, sp, a0); +goto L408f34; +//nop; +L408f34: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L408f3c: +t4 = 0x1000a150; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L408fb4;} +//nop; +t7 = 0x100002c0; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L408fb4;} +//nop; +t3 = 0x10000de0; +//nop; +t3 = t3; +MEM_U32(sp + 20) = t3; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L408f94; +MEM_U32(sp + 16) = zero; +L408f94: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L408fac; +//nop; +L408fac: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L408fb4: +t1 = 0x100002f4; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L40902c;} +//nop; +t6 = 0x10000310; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L40902c;} +//nop; +t5 = 0x10000e00; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L40900c; +MEM_U32(sp + 16) = zero; +L40900c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L409024; +//nop; +L409024: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L40902c: +t0 = 0x10000424; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L4090bc;} +//nop; +t9 = 0x1000a36c; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L4090bc;} +//nop; +t2 = 0x10000008; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L4090bc;} +//nop; +t8 = 0x10000e30; +//nop; +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L40909c; +MEM_U32(sp + 16) = zero; +L40909c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4090b4; +//nop; +L4090b4: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L4090bc: +t4 = 0x10000424; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L40914c;} +//nop; +t7 = 0x1000a36c; +at = 0x3; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L40914c;} +//nop; +t3 = 0x100001fc; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L40914c;} +//nop; +t1 = 0x10000e54; +//nop; +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L40912c; +MEM_U32(sp + 16) = zero; +L40912c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L409144; +//nop; +L409144: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L40914c: +t6 = 0x10000228; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L4091c4;} +//nop; +t5 = 0x1000022c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L4091c4;} +//nop; +t0 = 0x10000124; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L4091c4;} +//nop; +t9 = 0x10000214; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L4091c4;} +//nop; +t2 = 0x10000218; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L409224;} +//nop; +L4091c4: +t8 = 0x10000254; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L409224;} +//nop; +t4 = 0x10000e7c; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L409204; +MEM_U32(sp + 16) = zero; +L409204: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40921c; +//nop; +L40921c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L409224: +t7 = 0x10000228; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L40928c;} +//nop; +t3 = 0x10000124; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L40928c;} +//nop; +t1 = 0x1000a520; +at = 0x1; +t1 = MEM_U32(t1 + 4); +//nop; +if (t1 != at) {//nop; +goto L40928c;} +//nop; +t6 = 0x1000a540; +at = 0x1; +t6 = MEM_U32(t6 + 4); +//nop; +if (t6 != at) {at = 0x1000a184; +goto L40928c;} +at = 0x1000a184; +t5 = 0x1; +MEM_U32(at + 0) = t5; +L40928c: +t0 = 0x1000a36c; +at = 0x1; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L409330;} +//nop; +t9 = 0x10000008; +at = 0x2; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == at) {at = 0x3; +goto L4092c4;} +at = 0x3; +if (t9 != at) {//nop; +goto L409330;} +//nop; +L4092c4: +t2 = 0x1000026c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L409330;} +//nop; +t8 = 0x10000108; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L409330;} +//nop; +t4 = 0x10000ebc; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L40931c; +MEM_U32(sp + 16) = zero; +L40931c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +at = 0x10000108; +//nop; +MEM_U32(at + 0) = zero; +L409330: +t7 = 0x1000a184; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L409368;} +//nop; +t3 = 0x10000118; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {at = 0x10000110; +goto L409368;} +at = 0x10000110; +t1 = 0x1; +MEM_U32(at + 0) = t1; +L409368: +t6 = 0x1000a36c; +at = 0x1; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L40944c;} +//nop; +t5 = 0x10000008; +at = 0x3; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L40944c;} +//nop; +a0 = 0x10000ef8; +//nop; +a0 = a0; +//nop; +v0 = wrapper_getenv(mem, a0); +goto L4093ac; +//nop; +L4093ac: +// bdead 400c000b gp = MEM_U32(sp + 64); +t0 = 0x1; +t9 = 0x10000230; +MEM_U32(sp + 296) = v0; +t9 = MEM_U32(t9 + 0); +MEM_U32(sp + 292) = t0; +at = (int)t9 < (int)0x3; +if (at != 0) {at = 0x10000230; +goto L4093e4;} +at = 0x10000230; +t2 = 0x2; +MEM_U32(at + 0) = t2; +at = 0x10000408; +//nop; +MEM_U32(at + 0) = zero; +L4093e4: +t8 = MEM_U32(sp + 296); +//nop; +if (t8 == 0) {//nop; +goto L409428;} +//nop; +t4 = MEM_U8(t8 + 0); +//nop; +at = (int)t4 < (int)0x30; +if (at != 0) {at = (int)t4 < (int)0x34; +goto L409428;} +at = (int)t4 < (int)0x34; +if (at == 0) {//nop; +goto L409428;} +//nop; +t7 = MEM_U8(t8 + 1); +//nop; +if (t7 != 0) {//nop; +goto L409428;} +//nop; +t3 = t4 + 0xffffffd0; +MEM_U32(sp + 292) = t3; +L409428: +t1 = 0x10000230; +t6 = MEM_U32(sp + 292); +t1 = MEM_U32(t1 + 0); +//nop; +at = (int)t6 < (int)t1; +if (at == 0) {at = 0x10000230; +goto L40944c;} +at = 0x10000230; +//nop; +MEM_U32(at + 0) = t6; +L40944c: +a1 = 0x10000f08; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L409460; +a1 = a1; +L409460: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +t5 = 0x10000354; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L409568;} +//nop; +t0 = 0x100002f0; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L409514;} +//nop; +t9 = 0x10000304; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L4094f8;} +//nop; +t2 = 0x10000f10; +//nop; +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4094d8; +MEM_U32(sp + 16) = zero; +L4094d8: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4094f0; +//nop; +L4094f0: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L4094f8: +a1 = 0x10000f34; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40950c; +a1 = a1; +L40950c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L409514: +t8 = 0x100002f4; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L40954c;} +//nop; +a1 = 0x10000f40; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L409540; +a1 = a1; +L409540: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +goto L409568; +//nop; +L40954c: +a1 = 0x10000f4c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L409560; +a1 = a1; +L409560: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L409568: +a1 = 0x10000f58; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40957c; +a1 = a1; +L40957c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +t7 = 0x1000030c; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L409690;} +//nop; +a1 = 0x10000f64; +//nop; +a0 = 0x1000a310; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4095b0; +a1 = a1; +L4095b0: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x10000f6c; +//nop; +a0 = a0; +//nop; +f_add_info(mem, sp, a0); +goto L4095cc; +//nop; +L4095cc: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000f74; +//nop; +a0 = 0x1000a310; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4095e8; +a1 = a1; +L4095e8: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x10000f80; +//nop; +a0 = a0; +//nop; +f_add_info(mem, sp, a0); +goto L409604; +//nop; +L409604: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +t4 = 0x100002f4; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {at = 0x10000414; +goto L409760;} +at = 0x10000414; +t3 = 0x2; +MEM_U32(at + 0) = t3; +at = 0x100002f4; +a1 = 0x10000f8c; +//nop; +t1 = 0x1; +a0 = 0x1000a310; +MEM_U32(at + 0) = t1; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40964c; +a1 = a1; +L40964c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x10000f94; +//nop; +a0 = a0; +//nop; +f_add_info(mem, sp, a0); +goto L409668; +//nop; +L409668: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = zero; +a0 = 0x10000f9c; +//nop; +a2 = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L409684; +a0 = a0; +L409684: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +goto L409760; +//nop; +L409690: +t6 = 0x10000304; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L409760;} +//nop; +a1 = 0x10000fa0; +//nop; +a0 = 0x1000a310; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4096bc; +a1 = a1; +L4096bc: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x10000fac; +//nop; +a0 = a0; +//nop; +f_add_info(mem, sp, a0); +goto L4096d8; +//nop; +L4096d8: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +t5 = 0x100002f4; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {at = 0x10000414; +goto L409760;} +at = 0x10000414; +t0 = 0x2; +MEM_U32(at + 0) = t0; +at = 0x100002f4; +t9 = 0x1; +MEM_U32(at + 0) = t9; +//nop; +a1 = 0x10000fb8; +a0 = 0x1000a310; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L409720; +a1 = a1; +L409720: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x10000fc0; +//nop; +a0 = a0; +//nop; +f_add_info(mem, sp, a0); +goto L40973c; +//nop; +L40973c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = zero; +a0 = 0x10000fc8; +//nop; +a2 = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L409758; +a0 = a0; +L409758: +// bdead 400c0003 gp = MEM_U32(sp + 64); +//nop; +L409760: +t2 = 0x10000230; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +at = t2 < 0x5; +if (at == 0) {//nop; +goto L4097d4;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000705c[] = { +&&L409798, +&&L4097a4, +&&L4097b0, +&&L4097bc, +&&L4097c8, +}; +dest = Lswitch1000705c[t2]; +//nop; +goto *dest; +//nop; +L409798: +s2 = 0x10000fcc; +s2 = s2; +goto L4097d4; +s2 = s2; +L4097a4: +s2 = 0x10000fd0; +s2 = s2; +goto L4097d4; +s2 = s2; +L4097b0: +s2 = 0x10000fd4; +s2 = s2; +goto L4097d4; +s2 = s2; +L4097bc: +s2 = 0x10000fd8; +s2 = s2; +goto L4097d4; +s2 = s2; +L4097c8: +s2 = 0x10000fdc; +//nop; +s2 = s2; +L4097d4: +//nop; +a0 = 0x1000a310; +a1 = s2; +f_addstr(mem, sp, a0, a1); +goto L4097e4; +a1 = s2; +L4097e4: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = s2; +//nop; +a0 = 0x1000a320; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4097fc; +//nop; +L4097fc: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = s2; +//nop; +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L409814; +//nop; +L409814: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = s2; +//nop; +a0 = 0x1000a408; +//nop; +f_addstr(mem, sp, a0, a1); +goto L40982c; +//nop; +L40982c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = s2; +//nop; +a0 = 0x1000a428; +//nop; +f_addstr(mem, sp, a0, a1); +goto L409844; +//nop; +L409844: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = s2; +//nop; +a0 = 0x1000a418; +//nop; +f_addstr(mem, sp, a0, a1); +goto L40985c; +//nop; +L40985c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = s2; +//nop; +a0 = 0x1000a490; +//nop; +f_addstr(mem, sp, a0, a1); +goto L409874; +//nop; +L409874: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = s2; +//nop; +a0 = 0x1000a4a0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L40988c; +//nop; +L40988c: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = s2; +//nop; +a0 = 0x1000a4b0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4098a4; +//nop; +L4098a4: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = s2; +//nop; +a0 = 0x1000a470; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4098bc; +//nop; +L4098bc: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = s2; +//nop; +a0 = 0x1000a480; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4098d4; +//nop; +L4098d4: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = s2; +//nop; +a0 = 0x1000a4c0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4098ec; +//nop; +L4098ec: +// bdead 400c0003 gp = MEM_U32(sp + 64); +a1 = s2; +//nop; +a0 = 0x1000a4d0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L409904; +//nop; +L409904: +// bdead 40040103 gp = MEM_U32(sp + 64); +at = 0x3; +t8 = 0x1000a36c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L409994;} +//nop; +t7 = 0x10000284; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40995c;} +//nop; +a1 = 0x10000fe0; +//nop; +a0 = 0x1000a330; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L409950; +a1 = a1; +L409950: +// bdead 40040103 gp = MEM_U32(sp + 64); +//nop; +goto L409994; +//nop; +L40995c: +a1 = 0x10000fec; +//nop; +a0 = 0x1000a330; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L409970; +a1 = a1; +L409970: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000ff4; +//nop; +a0 = 0x1000a4b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40998c; +a1 = a1; +L40998c: +// bdead 40040103 gp = MEM_U32(sp + 64); +//nop; +L409994: +t4 = 0x1000023c; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L4099c4;} +//nop; +//nop; +//nop; +//nop; +f_whats(mem, sp); +goto L4099bc; +//nop; +L4099bc: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +L4099c4: +t3 = 0x10000404; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L4099f4;} +//nop; +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L4099ec; +//nop; +L4099ec: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +L4099f4: +//nop; +a0 = 0x2; +a1 = 0x1; +v0 = wrapper_sigset(mem, a0, trampoline, a1, sp); +goto L409a04; +a1 = 0x1; +L409a04: +// bdead 4004000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 == at) {//nop; +goto L409a2c;} +//nop; +//nop; +a1 = 0x433218; // function pointer +a0 = 0x2; +v0 = wrapper_sigset(mem, a0, trampoline, a1, sp); +goto L409a24; +a0 = 0x2; +L409a24: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +L409a2c: +//nop; +a0 = 0xf; +a1 = 0x1; +v0 = wrapper_sigset(mem, a0, trampoline, a1, sp); +goto L409a3c; +a1 = 0x1; +L409a3c: +// bdead 4004000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 == at) {//nop; +goto L409a64;} +//nop; +//nop; +a1 = 0x433218; // function pointer +a0 = 0xf; +v0 = wrapper_sigset(mem, a0, trampoline, a1, sp); +goto L409a5c; +a0 = 0xf; +L409a5c: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +L409a64: +//nop; +a0 = 0xd; +a1 = 0x1; +v0 = wrapper_sigset(mem, a0, trampoline, a1, sp); +goto L409a74; +a1 = 0x1; +L409a74: +// bdead 4004010b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 == at) {//nop; +goto L409a9c;} +//nop; +//nop; +a1 = 0x433218; // function pointer +a0 = 0xd; +v0 = wrapper_sigset(mem, a0, trampoline, a1, sp); +goto L409a94; +a0 = 0xd; +L409a94: +// bdead 40040103 gp = MEM_U32(sp + 64); +//nop; +L409a9c: +t1 = 0x1000a36c; +at = 0x6; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L409b2c;} +//nop; +t6 = 0x10000298; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L409b2c;} +//nop; +t5 = 0x10000294; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L409b2c;} +//nop; +t0 = 0x10000ffc; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L409b0c; +MEM_U32(sp + 16) = zero; +L409b0c: +// bdead 40040003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L409b24; +//nop; +L409b24: +// bdead 40040103 gp = MEM_U32(sp + 64); +//nop; +L409b2c: +t9 = 0x1000a520; +//nop; +t9 = MEM_U32(t9 + 4); +//nop; +at = (int)t9 < (int)0x2; +if (at != 0) {//nop; +goto L409be4;} +//nop; +t2 = 0x1000a36c; +at = 0x4; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L409be4;} +//nop; +t8 = 0x10000214; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L409be4;} +//nop; +t7 = 0x10000218; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L409be4;} +//nop; +t4 = 0x10001040; +t3 = 0x10001070; +//nop; +t4 = t4; +t3 = t3; +MEM_U32(sp + 24) = t3; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L409bc4; +MEM_U32(sp + 16) = zero; +L409bc4: +// bdead 40040003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L409bdc; +//nop; +L409bdc: +// bdead 40040103 gp = MEM_U32(sp + 64); +//nop; +L409be4: +//nop; +//nop; +//nop; +f_mktempstr(mem, sp); +goto L409bf4; +//nop; +L409bf4: +// bdead 40040103 gp = MEM_U32(sp + 64); +at = 0x1; +t1 = 0x1000a36c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L409dd0;} +//nop; +t6 = 0x1000021c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +at = (int)t6 < (int)0x2; +if (at != 0) {//nop; +goto L409dd0;} +//nop; +t5 = 0x1000a380; +a1 = 0x10001074; +//nop; +a0 = MEM_U32(t5 + 132); +a1 = a1; +v0 = wrapper_fopen(mem, a0, a1); +goto L409c48; +a1 = a1; +L409c48: +MEM_U32(sp + 288) = v0; +t0 = MEM_U32(sp + 288); +// bdead 40040203 gp = MEM_U32(sp + 64); +if (t0 == 0) {//nop; +goto L409d94;} +//nop; +t9 = 0x1000a520; +at = 0x1; +t9 = MEM_U32(t9 + 4); +//nop; +if (t9 != at) {//nop; +goto L409c98;} +//nop; +t2 = 0x10000228; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L409c98;} +//nop; +s5 = 0x10001084; +s5 = s5; +goto L409ca4; +s5 = s5; +L409c98: +s5 = 0x10001088; +//nop; +s5 = s5; +L409ca4: +t8 = 0x1000a520; +at = 0x1; +t8 = MEM_U32(t8 + 4); +//nop; +if (t8 != at) {//nop; +goto L409cd4;} +//nop; +t7 = 0x10000228; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L409cec;} +//nop; +L409cd4: +t4 = 0x1000a49c; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L409cf8;} +//nop; +L409cec: +s4 = 0x1000108c; +s4 = s4; +goto L409d08; +s4 = s4; +L409cf8: +s4 = 0x1000a49c; +//nop; +s4 = MEM_U32(s4 + 0); +//nop; +L409d08: +t3 = 0x1000a48c; +a2 = 0x1000a31c; +a1 = 0x10001078; +//nop; +t3 = MEM_U32(t3 + 0); +a0 = MEM_U32(sp + 288); +a2 = MEM_U32(a2 + 0); +a3 = s5; +MEM_U32(sp + 16) = s4; +a1 = a1; +MEM_U32(sp + 20) = t3; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L409d38; +MEM_U32(sp + 20) = t3; +L409d38: +// bdead 40040003 gp = MEM_U32(sp + 64); +//nop; +//nop; +//nop; +//nop; +f_init_curr_dir(mem, sp); +goto L409d50; +//nop; +L409d50: +// bdead 40040103 gp = MEM_U32(sp + 64); +a0 = MEM_U32(sp + 288); +a2 = 0x10000438; +a1 = 0x10001090; +//nop; +a2 = MEM_U32(a2 + 0); +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L409d70; +a1 = a1; +L409d70: +// bdead 40040003 gp = MEM_U32(sp + 64); +a0 = MEM_U32(sp + 288); +//nop; +//nop; +//nop; +v0 = wrapper_fclose(mem, a0); +goto L409d88; +//nop; +L409d88: +// bdead 40040103 gp = MEM_U32(sp + 64); +//nop; +goto L409dd0; +//nop; +L409d94: +t1 = 0x10001094; +t6 = 0x1000a380; +t1 = t1; +MEM_U32(sp + 20) = t1; +MEM_U32(sp + 16) = zero; +//nop; +t5 = MEM_U32(t6 + 132); +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t5; +f_error(mem, sp, a0, a1, a2, a3); +goto L409dc8; +MEM_U32(sp + 24) = t5; +L409dc8: +// bdead 40040103 gp = MEM_U32(sp + 64); +//nop; +L409dd0: +t0 = 0x1000a520; +s0 = zero; +t0 = MEM_U32(t0 + 4); +//nop; +at = (int)s0 < (int)t0; +if (at != 0) {//nop; +goto L409e00;} +//nop; +t9 = 0x10000408; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {at = 0x10000128; +goto L4197b0;} +L409e00: +at = 0x10000128; +t2 = 0x100001fc; +t8 = 0x1000a520; +MEM_U32(at + 0) = zero; +at = 0x10000320; +t2 = MEM_U32(t2 + 0); +t8 = MEM_U32(t8 + 4); +MEM_U32(sp + 280) = zero; +MEM_U32(at + 0) = zero; +if (s0 != t8) {MEM_U32(sp + 284) = t2; +goto L409fc8;} +MEM_U32(sp + 284) = t2; +t7 = 0x10000404; +at = 0x10000408; +t7 = MEM_U32(t7 + 0); +MEM_U32(at + 0) = zero; +if (t7 != 0) {//nop; +goto L41977c;} +//nop; +t4 = 0x1000a214; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L409e7c;} +//nop; +a1 = 0x100010b4; +//nop; +a0 = 0x1000a520; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L409e70; +a1 = a1; +L409e70: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L409f10; +//nop; +L409e7c: +a0 = 0x1000a214; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_getsuf(mem, sp, a0); +goto L409e90; +//nop; +L409e90: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L409ed4;} +//nop; +a0 = 0x1000a214; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = 0x3f; +v0 = f_mksuf(mem, sp, a0, a1); +goto L409eb0; +a1 = 0x3f; +L409eb0: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a520; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L409ec8; +a1 = s4; +L409ec8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L409f10; +//nop; +L409ed4: +a0 = 0x1000a214; +a1 = 0x100010bc; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L409ef0; +a1 = a1; +L409ef0: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a520; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L409f08; +a1 = s4; +L409f08: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L409f10: +at = 0x1000a24c; +t1 = 0x1000a1e6; +t3 = 0x3f; +t1 = MEM_U8(t1 + 0); +MEM_U8(at + 0) = (uint8_t)t3; +at = 0x73; +if (t1 == at) {at = 0x6d; +goto L409f60;} +at = 0x6d; +if (t1 == at) {at = 0x6f; +goto L409f60;} +at = 0x6f; +if (t1 == at) {at = 0x63; +goto L409f60;} +at = 0x63; +if (t1 == at) {//nop; +goto L409f60;} +//nop; +t6 = 0x10000240; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L409fa8;} +//nop; +L409f60: +t5 = 0x1000a520; +t0 = s0 << 2; +t5 = MEM_U32(t5 + 8); +a1 = 0x54; +t9 = t5 + t0; +a0 = MEM_U32(t9 + 0); +//nop; +//nop; +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L409f88; +//nop; +L409f88: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1fc; +//nop; +MEM_U32(at + 0) = v0; +at = 0x1000a250; +MEM_U32(at + 0) = zero; +goto L414ec0; +MEM_U32(at + 0) = zero; +L409fa8: +t2 = 0x1000a380; +at = 0x1000a1fc; +t8 = MEM_U32(t2 + 0); +t7 = 0x1; +MEM_U32(at + 0) = t8; +at = 0x1000a250; +MEM_U32(at + 0) = t7; +goto L414ec0; +MEM_U32(at + 0) = t7; +L409fc8: +t4 = 0x1000a520; +//nop; +t4 = MEM_U32(t4 + 4); +//nop; +at = (int)t4 < (int)0x2; +if (at != 0) {//nop; +goto L40a018;} +//nop; +t3 = 0x1000a520; +t1 = s0 << 2; +t3 = MEM_U32(t3 + 8); +a0 = 0xfb528e4; +a1 = 0x100010c0; +//nop; +t6 = t3 + t1; +a2 = MEM_U32(t6 + 0); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L40a010; +a1 = a1; +L40a010: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40a018: +t5 = 0x1000a520; +t0 = s0 << 2; +t5 = MEM_U32(t5 + 8); +at = 0x1000a1f0; +t9 = t5 + t0; +t2 = MEM_U32(t9 + 0); +t8 = 0x1000a36c; +MEM_U32(at + 0) = t2; +t8 = MEM_U32(t8 + 0); +at = 0x4; +if (t8 == at) {//nop; +goto L40a090;} +//nop; +t7 = s0 << 2; +//nop; +t4 = t5 + t7; +a0 = MEM_U32(t4 + 0); +//nop; +v0 = f_getsuf(mem, sp, a0); +goto L40a060; +//nop; +L40a060: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a24c; +t3 = 0x1000a24c; +MEM_U8(at + 0) = (uint8_t)v0; +t3 = MEM_U8(t3 + 0); +at = 0x6d; +if (t3 != at) {at = 0x1000a24c; +goto L40a09c;} +at = 0x1000a24c; +t1 = 0x66; +MEM_U8(at + 0) = (uint8_t)t1; +goto L40a09c; +MEM_U8(at + 0) = (uint8_t)t1; +L40a090: +at = 0x1000a24c; +t6 = 0x73; +MEM_U8(at + 0) = (uint8_t)t6; +L40a09c: +t0 = 0x1000a1e6; +at = 0x66; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 == at) {at = 0x73; +goto L40a150;} +at = 0x73; +if (t0 == at) {at = 0x6d; +goto L40a150;} +at = 0x6d; +if (t0 == at) {at = 0x6f; +goto L40a150;} +at = 0x6f; +if (t0 == at) {at = 0x6b; +goto L40a150;} +at = 0x6b; +if (t0 == at) {at = 0x63; +goto L40a150;} +at = 0x63; +if (t0 == at) {//nop; +goto L40a150;} +//nop; +t9 = 0x10000240; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L40a150;} +//nop; +t2 = 0x1000a24c; +at = 0x42; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == at) {at = 0x55; +goto L40a150;} +at = 0x55; +if (t2 == at) {at = 0x4f; +goto L40a150;} +at = 0x4f; +if (t2 == at) {at = 0x47; +goto L40a150;} +at = 0x47; +if (t2 == at) {at = 0x53; +goto L40a150;} +at = 0x53; +if (t2 == at) {at = 0x4d; +goto L40a150;} +at = 0x4d; +if (t2 == at) {at = 0x6; +goto L40a150;} +at = 0x6; +if (s1 == at) {at = 0x56; +goto L40a150;} +at = 0x56; +if (t2 == at) {at = 0x44; +goto L40a150;} +at = 0x44; +if (t2 == at) {at = 0x51; +goto L40a150;} +at = 0x51; +if (t2 != at) {at = 0x1000a250; +goto L40a20c;} +L40a150: +at = 0x1000a250; +t8 = 0x1000a36c; +MEM_U32(at + 0) = zero; +t8 = MEM_U32(t8 + 0); +at = 0x4; +if (t8 != at) {//nop; +goto L40a1d4;} +//nop; +t5 = 0x1000a520; +t7 = s0 << 2; +t5 = MEM_U32(t5 + 8); +//nop; +t4 = t5 + t7; +a0 = MEM_U32(t4 + 0); +//nop; +v0 = f_getsuf(mem, sp, a0); +goto L40a18c; +//nop; +L40a18c: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L40a1d4;} +//nop; +t3 = 0x1000a520; +t1 = s0 << 2; +t3 = MEM_U32(t3 + 8); +a1 = 0x100010c8; +//nop; +t6 = t3 + t1; +a0 = MEM_U32(t6 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40a1c0; +a1 = a1; +L40a1c0: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1fc; +MEM_U32(at + 0) = v0; +goto L40a22c; +MEM_U32(at + 0) = v0; +L40a1d4: +t0 = 0x1000a520; +t9 = s0 << 2; +t0 = MEM_U32(t0 + 8); +a1 = 0x54; +t2 = t0 + t9; +//nop; +a0 = MEM_U32(t2 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40a1f8; +//nop; +L40a1f8: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1fc; +MEM_U32(at + 0) = v0; +goto L40a22c; +MEM_U32(at + 0) = v0; +L40a20c: +at = 0x1000a250; +t8 = 0x1; +t5 = 0x1000a380; +MEM_U32(at + 0) = t8; +at = 0x1000a1fc; +t7 = MEM_U32(t5 + 0); +//nop; +MEM_U32(at + 0) = t7; +L40a22c: +s4 = 0x1000a24c; +//nop; +s4 = MEM_U8(s4 + 0); +//nop; +at = (int)s4 < (int)0x4; +if (at != 0) {at = (int)s4 < (int)0x47; +goto L40a298;} +at = (int)s4 < (int)0x47; +if (at != 0) {//nop; +goto L40a27c;} +//nop; +t4 = s4 + 0xffffff9d; +at = t4 < 0x11; +if (at == 0) {//nop; +goto L40a760;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10007070[] = { +&&L40a36c, +&&L40a760, +&&L40a760, +&&L40a4b4, +&&L40a760, +&&L40a760, +&&L40a314, +&&L40a760, +&&L40a760, +&&L40a760, +&&L40a760, +&&L40a760, +&&L40a760, +&&L40a414, +&&L40a760, +&&L40a760, +&&L40a2bc, +}; +dest = Lswitch10007070[t4]; +//nop; +goto *dest; +//nop; +L40a27c: +at = 0x6; +if (s4 == at) {at = 0x46; +goto L40a36c;} +at = 0x46; +if (s4 == at) {//nop; +goto L40a4b4;} +//nop; +//nop; +goto L40a760; +//nop; +L40a298: +at = 0x1; +if (s4 == at) {at = 0x2; +goto L40a554;} +at = 0x2; +if (s4 == at) {at = 0x3; +goto L40a5f4;} +at = 0x3; +if (s4 == at) {//nop; +goto L40a694;} +//nop; +//nop; +goto L40a760; +//nop; +L40a2bc: +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L40a314;} +//nop; +t1 = 0x1000a340; +t0 = 0x1000a32c; +t6 = MEM_U32(t1 + 0); +t0 = MEM_U32(t0 + 0); +//nop; +if (t6 == t0) {at = 0x1000a32c; +goto L40a314;} +at = 0x1000a32c; +a0 = 0x100010cc; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t6; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a30c; +a0 = a0; +L40a30c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40a314: +t9 = 0x1000a36c; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L40a36c;} +//nop; +t2 = 0x1000a340; +t5 = 0x1000a32c; +t8 = MEM_U32(t2 + 0); +t5 = MEM_U32(t5 + 0); +//nop; +if (t8 == t5) {at = 0x1000a32c; +goto L40a36c;} +at = 0x1000a32c; +a0 = 0x100010dc; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t8; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a364; +a0 = a0; +L40a364: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40a36c: +t7 = 0x1000a36c; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == at) {//nop; +goto L40a3c8;} +//nop; +t4 = 0x1000a340; +t1 = 0x1000a32c; +t3 = MEM_U32(t4 + 4); +t1 = MEM_U32(t1 + 0); +//nop; +if (t3 == t1) {at = 0x1000a32c; +goto L40a408;} +at = 0x1000a32c; +a0 = 0x100010ec; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t3; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a3bc; +a0 = a0; +L40a3bc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40a408; +//nop; +L40a3c8: +t0 = 0x1000a340; +t9 = 0x1000a32c; +t6 = MEM_U32(t0 + 0); +t9 = MEM_U32(t9 + 0); +//nop; +if (t6 == t9) {at = 0x1000a32c; +goto L40a408;} +at = 0x1000a32c; +a0 = 0x100010fc; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t6; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a400; +a0 = a0; +L40a400: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40a408: +at = 0x100003e4; +MEM_U32(at + 0) = zero; +goto L40a760; +MEM_U32(at + 0) = zero; +L40a414: +t2 = 0x1000a36c; +at = 0x2; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == at) {//nop; +goto L40a470;} +//nop; +t5 = 0x1000a340; +t7 = 0x1000a32c; +t8 = MEM_U32(t5 + 8); +t7 = MEM_U32(t7 + 0); +//nop; +if (t8 == t7) {at = 0x1000a32c; +goto L40a760;} +at = 0x1000a32c; +a0 = 0x1000110c; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t8; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a464; +a0 = a0; +L40a464: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40a760; +//nop; +L40a470: +t4 = 0x1000a340; +t3 = 0x1000a32c; +t1 = MEM_U32(t4 + 0); +t3 = MEM_U32(t3 + 0); +//nop; +if (t1 == t3) {at = 0x1000a32c; +goto L40a760;} +at = 0x1000a32c; +a0 = 0x1000111c; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t1; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a4a8; +a0 = a0; +L40a4a8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40a760; +//nop; +L40a4b4: +t0 = 0x1000a36c; +at = 0x3; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == at) {//nop; +goto L40a510;} +//nop; +t9 = 0x1000a340; +t2 = 0x1000a32c; +t6 = MEM_U32(t9 + 12); +t2 = MEM_U32(t2 + 0); +//nop; +if (t6 == t2) {at = 0x1000a32c; +goto L40a760;} +at = 0x1000a32c; +a0 = 0x1000112c; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t6; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a504; +a0 = a0; +L40a504: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40a760; +//nop; +L40a510: +t5 = 0x1000a340; +t8 = 0x1000a32c; +t7 = MEM_U32(t5 + 0); +t8 = MEM_U32(t8 + 0); +//nop; +if (t7 == t8) {at = 0x1000a32c; +goto L40a760;} +at = 0x1000a32c; +a0 = 0x1000113c; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t7; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a548; +a0 = a0; +L40a548: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40a760; +//nop; +L40a554: +t4 = 0x1000a36c; +at = 0x5; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == at) {//nop; +goto L40a5b0;} +//nop; +t3 = 0x1000a340; +t0 = 0x1000a32c; +t1 = MEM_U32(t3 + 20); +t0 = MEM_U32(t0 + 0); +//nop; +if (t1 == t0) {at = 0x1000a32c; +goto L40a760;} +at = 0x1000a32c; +a0 = 0x1000114c; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t1; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a5a4; +a0 = a0; +L40a5a4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40a760; +//nop; +L40a5b0: +t9 = 0x1000a340; +t6 = 0x1000a32c; +t2 = MEM_U32(t9 + 0); +t6 = MEM_U32(t6 + 0); +//nop; +if (t2 == t6) {at = 0x1000a32c; +goto L40a760;} +at = 0x1000a32c; +a0 = 0x1000115c; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t2; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a5e8; +a0 = a0; +L40a5e8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40a760; +//nop; +L40a5f4: +t5 = 0x1000a36c; +at = 0x6; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == at) {//nop; +goto L40a650;} +//nop; +t8 = 0x1000a340; +t4 = 0x1000a32c; +t7 = MEM_U32(t8 + 24); +t4 = MEM_U32(t4 + 0); +//nop; +if (t7 == t4) {at = 0x1000a32c; +goto L40a760;} +at = 0x1000a32c; +a0 = 0x1000116c; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t7; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a644; +a0 = a0; +L40a644: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40a760; +//nop; +L40a650: +t3 = 0x1000a340; +t1 = 0x1000a32c; +t0 = MEM_U32(t3 + 0); +t1 = MEM_U32(t1 + 0); +//nop; +if (t0 == t1) {at = 0x1000a32c; +goto L40a760;} +at = 0x1000a32c; +a0 = 0x1000117c; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t0; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a688; +a0 = a0; +L40a688: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40a760; +//nop; +L40a694: +t9 = 0x1000a36c; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == at) {at = 0x5; +goto L40a720;} +at = 0x5; +if (t9 == at) {at = 0x6; +goto L40a720;} +at = 0x6; +if (t9 == at) {//nop; +goto L40a720;} +//nop; +t6 = 0x1000a340; +t5 = 0x1000a32c; +t2 = MEM_U32(t6 + 4); +t5 = MEM_U32(t5 + 0); +//nop; +if (t2 == t5) {//nop; +goto L40a760;} +//nop; +t8 = MEM_U32(t6 + 20); +//nop; +if (t8 == t5) {//nop; +goto L40a760;} +//nop; +t4 = MEM_U32(t6 + 24); +//nop; +if (t4 == t5) {at = 0x1000a32c; +goto L40a760;} +at = 0x1000a32c; +a0 = 0x1000118c; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t2; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a714; +a0 = a0; +L40a714: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40a760; +//nop; +L40a720: +t7 = 0x1000a340; +t1 = 0x1000a32c; +t3 = MEM_U32(t7 + 0); +t1 = MEM_U32(t1 + 0); +//nop; +if (t3 == t1) {at = 0x1000a32c; +goto L40a760;} +at = 0x1000a32c; +a0 = 0x1000119c; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t3; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a758; +a0 = a0; +L40a758: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40a760: +t0 = 0x1000a36c; +at = 0x3; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L40a7d4;} +//nop; +t9 = 0x100001fc; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L40a7d4;} +//nop; +t8 = 0x1000a24c; +at = 0x66; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == at) {at = 0x46; +goto L40a7d4;} +at = 0x46; +if (t8 == at) {at = 0x100001fc; +goto L40a7d4;} +at = 0x100001fc; +a0 = 0x100011ac; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40a7cc; +a0 = a0; +L40a7cc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40a7d4: +t6 = 0x100001fc; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L40a84c;} +//nop; +t4 = 0x1000a36c; +at = 0x3; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == at) {at = 0x1; +goto L40a824;} +at = 0x1; +if (t4 != at) {//nop; +goto L40a84c;} +//nop; +t5 = 0x10000008; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40a84c;} +//nop; +L40a824: +t2 = 0x1000a520; +t7 = s0 << 2; +t2 = MEM_U32(t2 + 8); +//nop; +t1 = t2 + t7; +a0 = MEM_U32(t1 + 0); +//nop; +f_record_static_fileset(mem, sp, a0); +goto L40a844; +//nop; +L40a844: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40a84c: +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L40a8e0;} +//nop; +t0 = 0x10000008; +at = 0x1; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L40a8e0;} +//nop; +s4 = 0x10000004; +//nop; +s4 = MEM_U32(s4 + 0); +//nop; +if (s4 == 0) {at = 0x1; +goto L40a8d4;} +at = 0x1; +if (s4 == at) {at = 0x2; +goto L40a8b4;} +at = 0x2; +if (s4 == at) {at = 0x3; +goto L40a8b4;} +at = 0x3; +if (s4 == at) {//nop; +goto L40a8c4;} +//nop; +//nop; +goto L40a8d4; +//nop; +L40a8b4: +at = 0x100003fc; +t9 = 0x2; +MEM_U32(at + 0) = t9; +goto L40a8e0; +MEM_U32(at + 0) = t9; +L40a8c4: +at = 0x100003fc; +t8 = 0x1; +MEM_U32(at + 0) = t8; +goto L40a8e0; +MEM_U32(at + 0) = t8; +L40a8d4: +at = 0x100003fc; +t6 = 0x3; +MEM_U32(at + 0) = t6; +L40a8e0: +t4 = 0x100003e4; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L40a974;} +//nop; +t5 = 0x10000424; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40a944;} +//nop; +t2 = 0x10000004; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {at = 0x100003e4; +goto L40a934;} +at = 0x100003e4; +t7 = 0x1; +MEM_U32(at + 0) = t7; +goto L40a974; +MEM_U32(at + 0) = t7; +L40a934: +at = 0x100003e4; +t1 = 0x2; +MEM_U32(at + 0) = t1; +goto L40a974; +MEM_U32(at + 0) = t1; +L40a944: +t3 = 0x10000004; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {at = 0x100003e4; +goto L40a968;} +at = 0x100003e4; +t0 = 0x3; +MEM_U32(at + 0) = t0; +goto L40a974; +MEM_U32(at + 0) = t0; +L40a968: +at = 0x100003e4; +t9 = 0x3; +MEM_U32(at + 0) = t9; +L40a974: +t8 = 0x10000214; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L40a9a4;} +//nop; +t6 = 0x1000a24c; +at = 0x61; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L40ad4c;} +//nop; +L40a9a4: +s4 = 0x1000a24c; +//nop; +s4 = MEM_U8(s4 + 0); +//nop; +at = (int)s4 < (int)0x4; +if (at != 0) {at = (int)s4 < (int)0x7; +goto L40aa08;} +at = (int)s4 < (int)0x7; +if (at != 0) {//nop; +goto L40a9f4;} +//nop; +t4 = s4 + 0xffffffbe; +at = t4 < 0x34; +if (at == 0) {//nop; +goto L40ad4c;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100070b4[] = { +&&L414b54, +&&L40ad4c, +&&L4174f4, +&&L40ad4c, +&&L40ad4c, +&&L418adc, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L416864, +&&L40ad4c, +&&L417c04, +&&L40ad4c, +&&L4174f4, +&&L40ad4c, +&&L4164f0, +&&L40ad4c, +&&L40ab70, +&&L4174f4, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40aa2c, +&&L40ad4c, +&&L412910, +&&L40ab10, +&&L40ad4c, +&&L40ad4c, +&&L40aa84, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40ad4c, +&&L40aac0, +&&L40ad4c, +&&L412910, +&&L412910, +&&L40ad4c, +&&L4161b0, +}; +dest = Lswitch100070b4[t4]; +//nop; +goto *dest; +//nop; +L40a9f4: +at = 0x6; +if (s4 == at) {//nop; +goto L40aa2c;} +//nop; +//nop; +goto L40ad4c; +//nop; +L40aa08: +at = 0x1; +if (s4 == at) {at = 0x2; +goto L40ab30;} +at = 0x2; +if (s4 == at) {at = 0x3; +goto L40ab50;} +at = 0x3; +if (s4 == at) {//nop; +goto L411c50;} +//nop; +//nop; +goto L40ad4c; +//nop; +L40aa2c: +t5 = 0x100002ac; +at = 0x1; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == at) {at = 0x100002b0; +goto L40aa4c;} +at = 0x100002b0; +//nop; +MEM_U32(at + 0) = zero; +L40aa4c: +t2 = 0x1000a1a0; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L40ad4c;} +//nop; +t7 = 0x1000a1a4; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40db8c;} +//nop; +//nop; +goto L40ad4c; +//nop; +L40aa84: +t1 = 0x1000a36c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +t3 = t1 + 0xffffffff; +at = t3 < 0x6; +if (at == 0) {//nop; +goto L40aac0;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10007184[] = { +&&L40db8c, +&&L410ea0, +&&L412c64, +&&L40aac0, +&&L4116a8, +&&L41222c, +}; +dest = Lswitch10007184[t3]; +//nop; +goto *dest; +//nop; +L40aac0: +t0 = 0x10000270; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L410ea0;} +//nop; +t9 = 0x1000a1a0; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L40ad4c;} +//nop; +t8 = 0x1000a1a4; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L40ad4c;} +//nop; +//nop; +goto L410ea0; +//nop; +L40ab10: +t6 = 0x1000a1a0; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L412c64;} +//nop; +//nop; +goto L40ad4c; +//nop; +L40ab30: +t4 = 0x1000a1a0; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L4116a8;} +//nop; +//nop; +goto L40ad4c; +//nop; +L40ab50: +t5 = 0x1000a1a0; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L41222c;} +//nop; +//nop; +goto L40ad4c; +//nop; +L40ab70: +at = 0x1000a560; +a1 = 0x100011b0; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ab8c; +a1 = a1; +L40ab8c: +// bdead 40060003 gp = MEM_U32(sp + 64); +t7 = s0 << 2; +t2 = 0x1000a520; +//nop; +t2 = MEM_U32(t2 + 8); +a0 = 0x1000a560; +t1 = t2 + t7; +a1 = MEM_U32(t1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L40abb4; +//nop; +L40abb4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t3 = 0x10000240; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L40ac0c;} +//nop; +t0 = 0x1000a520; +t9 = s0 << 2; +t0 = MEM_U32(t0 + 8); +a1 = 0x42; +t8 = t0 + t9; +//nop; +a0 = MEM_U32(t8 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40abf8; +//nop; +L40abf8: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40ac20; +MEM_U32(at + 0) = v0; +L40ac0c: +t6 = 0x1000a380; +at = 0x1000a1f4; +t4 = MEM_U32(t6 + 4); +//nop; +MEM_U32(at + 0) = t4; +L40ac20: +t5 = 0x1000a1f4; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40acac;} +//nop; +//nop; +a0 = t5; +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L40ac48; +//nop; +L40ac48: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L40acac;} +//nop; +t7 = 0x1000a1f4; +t2 = 0x100011b8; +//nop; +t7 = MEM_U32(t7 + 0); +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t7; +f_error(mem, sp, a0, a1, a2, a3); +goto L40ac8c; +MEM_U32(sp + 24) = t7; +L40ac8c: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40aca4; +//nop; +L40aca4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40acac: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L40acc4; +//nop; +L40acc4: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000f8; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L40acec; +MEM_U32(sp + 16) = zero; +L40acec: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L40ad38;} +//nop; +t1 = 0x10000404; +t0 = 0x10000240; +t1 = MEM_U32(t1 + 0); +at = 0x10000404; +t0 = MEM_U32(t0 + 0); +t3 = t1 + 0x1; +if (t0 != 0) {MEM_U32(at + 0) = t3; +goto L41977c;} +MEM_U32(at + 0) = t3; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40ad2c; +//nop; +L40ad2c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L40ad38: +t9 = 0x1000a1f4; +at = 0x1000a1f0; +t9 = MEM_U32(t9 + 0); +MEM_U32(at + 0) = t9; +goto L414b54; +MEM_U32(at + 0) = t9; +L40ad4c: +at = 0x10000354; +t8 = 0x100003e8; +MEM_U32(at + 0) = zero; +at = 0x1000a560; +t6 = 0x10000214; +MEM_U32(at + 4) = zero; +at = 0x1000a560; +t8 = MEM_U32(t8 + 0); +t6 = MEM_U32(t6 + 0); +MEM_U32(at + 4) = zero; +if (t6 == 0) {MEM_U32(sp + 276) = t8; +goto L40ada0;} +MEM_U32(sp + 276) = t8; +t4 = 0x10000424; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {at = 0x100003e4; +goto L40ada0;} +at = 0x100003e4; +t5 = 0x3; +MEM_U32(at + 0) = t5; +goto L40adc0; +MEM_U32(at + 0) = t5; +L40ada0: +t2 = 0x1000a24c; +at = 0x73; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 != at) {at = 0x100003e4; +goto L40adc0;} +at = 0x100003e4; +t7 = 0x4; +MEM_U32(at + 0) = t7; +L40adc0: +t1 = 0x1000a24c; +at = 0x63; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 == at) {at = 0x6; +goto L40ae30;} +at = 0x6; +if (t1 == at) {//nop; +goto L40ae30;} +//nop; +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L40aea4;} +//nop; +t0 = 0x10000124; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L40aea4;} +//nop; +t9 = 0x100001fc; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {at = 0x68; +goto L40aea4;} +at = 0x68; +if (t1 != at) {//nop; +goto L40aea4;} +//nop; +L40ae30: +t8 = 0x100003e8; +at = 0x2; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L40ae74;} +//nop; +t6 = 0x100002b4; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L40afe4;} +//nop; +t4 = 0x10000004; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {at = 0x100003e8; +goto L40afe4;} +L40ae74: +at = 0x100003e8; +a0 = 0x100011e4; +//nop; +t5 = 0x1; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t5; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40ae98; +a0 = a0; +L40ae98: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40afe4; +//nop; +L40aea4: +t2 = 0x1000a24c; +at = 0x68; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L40af18;} +//nop; +t7 = 0x1000a36c; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L40af18;} +//nop; +t3 = 0x100003e8; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {at = 0x100003e8; +goto L40afe4;} +at = 0x100003e8; +a0 = 0x100011e8; +//nop; +t0 = 0x1; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t0; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40af0c; +a0 = a0; +L40af0c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40afe4; +//nop; +L40af18: +t9 = 0x1000a36c; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L40afa4;} +//nop; +t1 = 0x10000214; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L40afe4;} +//nop; +t8 = 0x10000218; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L40afe4;} +//nop; +t6 = 0x100003e8; +at = 0x3; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {at = 0x100003e8; +goto L40afe4;} +at = 0x100003e8; +a0 = 0x100011ec; +//nop; +t4 = 0x2; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t4; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40af98; +a0 = a0; +L40af98: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40afe4; +//nop; +L40afa4: +t5 = 0x100003e8; +at = 0x3; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {at = 0x100003e8; +goto L40afe4;} +at = 0x100003e8; +a0 = 0x100011f0; +//nop; +t2 = 0x2; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t2; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40afdc; +a0 = a0; +L40afdc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40afe4: +t7 = 0x100003e4; +at = 0x3; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == at) {at = 0x4; +goto L40b004;} +at = 0x4; +if (t7 != at) {//nop; +goto L40b068;} +//nop; +L40b004: +t3 = 0x1000043c; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L40b068;} +//nop; +t0 = 0x1000a188; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +t9 = t0 & 0x1; +if (t9 != 0) {//nop; +goto L40b068;} +//nop; +t1 = t0 & 0x8; +if (t1 != 0) {//nop; +goto L40b068;} +//nop; +a1 = 0x100000a0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L40b05c; +//nop; +L40b05c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40b130; +//nop; +L40b068: +t8 = 0x1000030c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L40b0c8;} +//nop; +t6 = 0x100011f4; +//nop; +t6 = t6; +MEM_U32(sp + 20) = t6; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L40b0a8; +MEM_U32(sp + 16) = zero; +L40b0a8: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40b0c0; +//nop; +L40b0c0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40b0c8: +t4 = 0x10000008; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L40b130;} +//nop; +t5 = 0x100003e8; +at = 0x1; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == at) {at = 0x3; +goto L40b10c;} +at = 0x3; +if (t5 == at) {//nop; +goto L40b10c;} +//nop; +s4 = 0x1000122c; +s4 = s4; +goto L40b118; +s4 = s4; +L40b10c: +s4 = 0x10001230; +//nop; +s4 = s4; +L40b118: +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40b128; +a1 = s4; +L40b128: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40b130: +t2 = 0x100003e0; +at = 0x1; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L40b280;} +//nop; +a1 = 0x10001238; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b15c; +a1 = a1; +L40b15c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t7 = 0x100002ec; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40b19c;} +//nop; +a1 = 0x1000124c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b190; +a1 = a1; +L40b190: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40b1f0; +//nop; +L40b19c: +t3 = 0x100002f0; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L40b1d4;} +//nop; +a1 = 0x1000125c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b1c8; +a1 = a1; +L40b1c8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40b1f0; +//nop; +L40b1d4: +a1 = 0x1000126c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b1e8; +a1 = a1; +L40b1e8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40b1f0: +a1 = 0x1000127c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b204; +a1 = a1; +L40b204: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001288; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b220; +a1 = a1; +L40b220: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000129c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b23c; +a1 = a1; +L40b23c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100012b0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b258; +a1 = a1; +L40b258: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100012c4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b274; +a1 = a1; +L40b274: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40b3b0; +//nop; +L40b280: +t9 = 0x100003e0; +at = 0x2; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L40b344;} +//nop; +a1 = 0x100012d8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b2ac; +a1 = a1; +L40b2ac: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100012ec; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b2c8; +a1 = a1; +L40b2c8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001308; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b2e4; +a1 = a1; +L40b2e4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001324; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b300; +a1 = a1; +L40b300: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001338; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b31c; +a1 = a1; +L40b31c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000134c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b338; +a1 = a1; +L40b338: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40b3b0; +//nop; +L40b344: +t0 = 0x100003e0; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L40b3b0;} +//nop; +t8 = 0x100003e0; +t1 = 0x10001360; +//nop; +t8 = MEM_U32(t8 + 0); +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t8; +f_error(mem, sp, a0, a1, a2, a3); +goto L40b390; +MEM_U32(sp + 24) = t8; +L40b390: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40b3a8; +//nop; +L40b3a8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40b3b0: +t6 = 0x10000008; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L40b5a4;} +//nop; +t4 = 0x10000288; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L40b414;} +//nop; +t5 = 0x100003e4; +at = 0x3; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == at) {//nop; +goto L40b414;} +//nop; +a1 = 0x10001384; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b40c; +a1 = a1; +L40b40c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40b414: +t2 = 0x100003e8; +at = 0x1; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L40b554;} +//nop; +t7 = 0x10000004; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {at = 0x3; +goto L40b44c;} +at = 0x3; +if (t7 != at) {//nop; +goto L40b468;} +//nop; +L40b44c: +a1 = 0x10001390; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b460; +a1 = a1; +L40b460: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40b468: +t3 = 0x100003e4; +at = 0x3; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == at) {//nop; +goto L40b554;} +//nop; +t9 = 0x1000a198; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L40b4b4;} +//nop; +a1 = 0x100013a4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b4ac; +a1 = a1; +L40b4ac: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40b4b4: +t0 = 0x100003ec; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L40b4e8;} +//nop; +a1 = 0x100013ac; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b4e0; +a1 = a1; +L40b4e0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40b4e8: +a1 = 0x100013bc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b4fc; +a1 = a1; +L40b4fc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x10000004; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L40b554;} +//nop; +a1 = 0x100013c8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b530; +a1 = a1; +L40b530: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100013d0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b54c; +a1 = a1; +L40b54c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40b554: +t8 = 0x100003e8; +at = 0x2; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L40b630;} +//nop; +t6 = 0x100003e4; +at = 0x3; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L40b630;} +//nop; +a1 = 0x100013d4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b598; +a1 = a1; +L40b598: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40b630; +//nop; +L40b5a4: +a1 = 0x100013e8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b5b8; +a1 = a1; +L40b5b8: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x2; +t4 = 0x100003fc; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L40b5f4;} +//nop; +a1 = 0x100013ec; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b5ec; +a1 = a1; +L40b5ec: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40b5f4: +t5 = 0x100003fc; +at = 0x1; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == at) {at = 0x3; +goto L40b614;} +at = 0x3; +if (t5 != at) {//nop; +goto L40b630;} +//nop; +L40b614: +a1 = 0x100013f0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b628; +a1 = a1; +L40b628: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40b630: +s4 = 0x1000a24c; +//nop; +s4 = MEM_U8(s4 + 0); +//nop; +at = (int)s4 < (int)0x7; +if (at != 0) {at = (int)s4 < (int)0x47; +goto L40b694;} +at = (int)s4 < (int)0x47; +if (at != 0) {//nop; +goto L40b680;} +//nop; +t2 = s4 + 0xffffff9d; +at = t2 < 0x11; +if (at == 0) {//nop; +goto L40b9c8;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000719c[] = { +&&L40b6b0, +&&L40b9c8, +&&L40b8dc, +&&L40b8dc, +&&L40b9c8, +&&L40b9c8, +&&L40b9c8, +&&L40b9c8, +&&L40b9c8, +&&L40b9c8, +&&L40b9c8, +&&L40b9c8, +&&L40b9c8, +&&L40b884, +&&L40b9c8, +&&L40b8dc, +&&L40b918, +}; +dest = Lswitch1000719c[t2]; +//nop; +goto *dest; +//nop; +L40b680: +at = 0x46; +if (s4 == at) {//nop; +goto L40b8dc;} +//nop; +//nop; +goto L40b9c8; +//nop; +L40b694: +at = 0x1; +if (s4 == at) {at = 0x2; +goto L40b954;} +at = 0x2; +if (s4 == at) {at = 0x6; +goto L40b990;} +at = 0x6; +if (s4 != at) {//nop; +goto L40b9c8;} +//nop; +L40b6b0: +t7 = 0x1000a36c; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L40b78c;} +//nop; +t3 = 0x10000008; +at = 0x2; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == at) {at = 0x3; +goto L40b6e8;} +at = 0x3; +if (t3 != at) {//nop; +goto L40b78c;} +//nop; +L40b6e8: +a1 = 0x10001404; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b6fc; +a1 = a1; +L40b6fc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001420; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b718; +a1 = a1; +L40b718: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001430; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b734; +a1 = a1; +L40b734: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x1; +t9 = 0x1000a36c; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L40b9c8;} +//nop; +t0 = 0x10000008; +at = 0x3; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L40b9c8;} +//nop; +a1 = 0x10001444; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b780; +a1 = a1; +L40b780: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40b9c8; +//nop; +L40b78c: +t1 = 0x10000004; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {at = 0x3; +goto L40b7ac;} +at = 0x3; +if (t1 != at) {//nop; +goto L40b7c8;} +//nop; +L40b7ac: +a1 = 0x1000145c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b7c0; +a1 = a1; +L40b7c0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40b7c8: +a1 = 0x1000146c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b7dc; +a1 = a1; +L40b7dc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t8 = 0x1000a188; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L40b818;} +//nop; +a1 = 0x1000147c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b810; +a1 = a1; +L40b810: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40b818: +t6 = 0x1000a188; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +t4 = t6 & 0x1; +if (t4 != 0) {//nop; +goto L40b84c;} +//nop; +t5 = 0x1000043c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40b9c8;} +//nop; +L40b84c: +t2 = 0x100003e8; +at = 0x1; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L40b9c8;} +//nop; +a1 = 0x10001490; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b878; +a1 = a1; +L40b878: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40b9c8; +//nop; +L40b884: +a1 = 0x1000149c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b898; +a1 = a1; +L40b898: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100014b0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b8b4; +a1 = a1; +L40b8b4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100014c4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b8d0; +a1 = a1; +L40b8d0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40b9c8; +//nop; +L40b8dc: +a1 = 0x100014c8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b8f0; +a1 = a1; +L40b8f0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100014dc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b90c; +a1 = a1; +L40b90c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40b9c8; +//nop; +L40b918: +a1 = 0x100014f0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b92c; +a1 = a1; +L40b92c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001504; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b948; +a1 = a1; +L40b948: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40b9c8; +//nop; +L40b954: +a1 = 0x1000151c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b968; +a1 = a1; +L40b968: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000152c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b984; +a1 = a1; +L40b984: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40b9c8; +//nop; +L40b990: +a1 = 0x1000153c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b9a4; +a1 = a1; +L40b9a4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001550; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b9c0; +a1 = a1; +L40b9c0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40b9c8: +t7 = 0x10000004; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {at = 0x3; +goto L40b9e8;} +at = 0x3; +if (t7 != at) {//nop; +goto L40ba90;} +//nop; +L40b9e8: +a1 = 0x10001564; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40b9fc; +a1 = a1; +L40b9fc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000157c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ba18; +a1 = a1; +L40ba18: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t3 = 0x10000370; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L40ba70;} +//nop; +a1 = 0x10001584; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ba4c; +a1 = a1; +L40ba4c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000158c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ba68; +a1 = a1; +L40ba68: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40ba70: +a1 = 0x10001598; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ba84; +a1 = a1; +L40ba84: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40bae0; +//nop; +L40ba90: +a1 = 0x100015a0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40baa4; +a1 = a1; +L40baa4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t9 = 0x10000370; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L40bae0;} +//nop; +a1 = 0x100015a8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bad8; +a1 = a1; +L40bad8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40bae0: +t0 = 0x100003e4; +at = 0x3; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == at) {//nop; +goto L40bb9c;} +//nop; +t1 = 0x1000a14c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L40bb9c;} +//nop; +t8 = 0x10000008; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L40bb80;} +//nop; +t6 = 0x100003e8; +at = 0x1; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L40bb60;} +//nop; +a1 = 0x100015b4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bb54; +a1 = a1; +L40bb54: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40bb9c; +//nop; +L40bb60: +a1 = 0x100015b8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bb74; +a1 = a1; +L40bb74: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40bb9c; +//nop; +L40bb80: +a1 = 0x100015c0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bb94; +a1 = a1; +L40bb94: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40bb9c: +t4 = 0x10000004; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {at = 0x3; +goto L40bbbc;} +at = 0x3; +if (t4 != at) {//nop; +goto L40bd40;} +//nop; +L40bbbc: +a1 = 0x100015c4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bbd0; +a1 = a1; +L40bbd0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100015cc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bbec; +a1 = a1; +L40bbec: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100015d4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bc08; +a1 = a1; +L40bc08: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100015e0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bc24; +a1 = a1; +L40bc24: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100015ec; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bc40; +a1 = a1; +L40bc40: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t5 = 0x10000424; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L40bcec;} +//nop; +t2 = 0x10000370; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L40bcb4;} +//nop; +t7 = 0x10000004; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == at) {at = 0x2; +goto L40bcb4;} +at = 0x2; +if (t7 == at) {//nop; +goto L40bcb4;} +//nop; +a1 = 0x100015fc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bcac; +a1 = a1; +L40bcac: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40bcb4: +a1 = 0x1000160c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bcc8; +a1 = a1; +L40bcc8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001618; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bce4; +a1 = a1; +L40bce4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40bcec: +t3 = 0x10000340; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L40bd20;} +//nop; +a1 = 0x10001628; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bd18; +a1 = a1; +L40bd18: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40bd20: +a1 = 0x10001630; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bd34; +a1 = a1; +L40bd34: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40be50; +//nop; +L40bd40: +a1 = 0x1000163c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bd54; +a1 = a1; +L40bd54: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001648; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bd70; +a1 = a1; +L40bd70: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t9 = 0x10000424; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L40be00;} +//nop; +t0 = 0x10000370; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L40bde4;} +//nop; +t1 = 0x10000004; +at = 0x1; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == at) {at = 0x2; +goto L40bde4;} +at = 0x2; +if (t1 == at) {//nop; +goto L40bde4;} +//nop; +a1 = 0x10001658; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bddc; +a1 = a1; +L40bddc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40bde4: +a1 = 0x10001668; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bdf8; +a1 = a1; +L40bdf8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40be00: +t8 = 0x10000340; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L40be34;} +//nop; +a1 = 0x10001674; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40be2c; +a1 = a1; +L40be2c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40be34: +a1 = 0x1000167c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40be48; +a1 = a1; +L40be48: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40be50: +t6 = 0x1000a27c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L40bf50;} +//nop; +t4 = 0x10000424; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L40bf50;} +//nop; +s2 = t6; +t5 = MEM_U8(s2 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40beb8;} +//nop; +L40be94: +//nop; +a0 = MEM_U8(s2 + 0); +//nop; +v0 = wrapper_toupper(a0); +goto L40bea4; +//nop; +L40bea4: +t2 = MEM_U8(s2 + 1); +// bdead 400e090b gp = MEM_U32(sp + 64); +MEM_U8(s2 + 0) = (uint8_t)v0; +if (t2 != 0) {s2 = s2 + 0x1; +goto L40be94;} +s2 = s2 + 0x1; +L40beb8: +t7 = 0x10000004; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {at = 0x3; +goto L40bed8;} +at = 0x3; +if (t7 != at) {//nop; +goto L40bf14;} +//nop; +L40bed8: +a1 = 0x1000a27c; +a0 = 0x10001688; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40bef4; +a0 = a0; +L40bef4: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40bf0c; +a1 = s4; +L40bf0c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40bf14: +a1 = 0x1000a27c; +a0 = 0x10001694; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40bf30; +a0 = a0; +L40bf30: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40bf48; +a1 = s4; +L40bf48: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40bf50: +t3 = 0x10000370; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L40bfc0;} +//nop; +t9 = 0x10000004; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {at = 0x3; +goto L40bf88;} +at = 0x3; +if (t9 != at) {//nop; +goto L40bfa4;} +//nop; +L40bf88: +a1 = 0x100016a0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bf9c; +a1 = a1; +L40bf9c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40bfa4: +a1 = 0x100016b0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bfb8; +a1 = a1; +L40bfb8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40bfc0: +t0 = 0x1000030c; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L40bff4;} +//nop; +a1 = 0x100016c0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40bfec; +a1 = a1; +L40bfec: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40bff4: +t1 = 0x10000004; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {at = 0x3; +goto L40c014;} +at = 0x3; +if (t1 != at) {//nop; +goto L40c054;} +//nop; +L40c014: +t8 = 0x10000320; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L40c054;} +//nop; +a1 = 0x100016cc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40c040; +a1 = a1; +L40c040: +// bdead 40060103 gp = MEM_U32(sp + 64); +t4 = 0x1; +at = 0x10000320; +//nop; +MEM_U32(at + 0) = t4; +L40c054: +t6 = 0x10000354; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L40c16c;} +//nop; +t5 = 0x100002f0; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40c118;} +//nop; +t2 = 0x10000348; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L40c0b4;} +//nop; +t7 = 0x10000384; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40c0f8;} +//nop; +L40c0b4: +t3 = 0x10000340; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {at = 0x10000318; +goto L40c0f8;} +at = 0x10000318; +t9 = 0x1; +MEM_U32(at + 0) = t9; +at = 0x10000324; +t0 = 0x1; +MEM_U32(at + 0) = t0; +at = 0x10000384; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10000348; +//nop; +MEM_U32(at + 0) = zero; +L40c0f8: +a1 = 0x100016d8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40c10c; +a1 = a1; +L40c10c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40c16c; +//nop; +L40c118: +t1 = 0x100002f4; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L40c150;} +//nop; +a1 = 0x100016e4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40c144; +a1 = a1; +L40c144: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40c16c; +//nop; +L40c150: +a1 = 0x100016f0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40c164; +a1 = a1; +L40c164: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40c16c: +t4 = 0x10000424; +at = 0x10000354; +t4 = MEM_U32(t4 + 0); +t8 = 0x1; +if (t4 == 0) {MEM_U32(at + 0) = t8; +goto L40c1b4;} +MEM_U32(at + 0) = t8; +a0 = 0x100016fc; +a1 = 0x10001708; +//nop; +a2 = zero; +a0 = a0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40c1a0; +a1 = a1; +L40c1a0: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x10000084; +//nop; +MEM_U32(at + 0) = v0; +L40c1b4: +t6 = 0x10000084; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L40c208;} +//nop; +a0 = 0x1000a25c; +a1 = 0x10001714; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L40c1e4; +a1 = a1; +L40c1e4: +// bdead 4006000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L40c220;} +//nop; +t5 = 0x1000a27c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L40c220;} +//nop; +L40c208: +t2 = 0x10000280; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L40c29c;} +//nop; +L40c220: +t7 = 0x1000a36c; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L40c250;} +//nop; +t3 = 0x10000008; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L40c29c;} +//nop; +L40c250: +t9 = 0x1000a36c; +at = 0x3; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L40c280;} +//nop; +t0 = 0x100001fc; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L40c29c;} +//nop; +L40c280: +a1 = 0x10001718; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40c294; +a1 = a1; +L40c294: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40c29c: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a270; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40c2b0; +//nop; +L40c2b0: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x1; +t1 = 0x100003e8; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L40c2ec;} +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a290; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40c2e4; +//nop; +L40c2e4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40c2ec: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a260; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40c300; +//nop; +L40c300: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t8 = 0x10000288; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L40c464;} +//nop; +t4 = 0x1000037c; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L40c388;} +//nop; +t6 = 0x10000088; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L40c388;} +//nop; +a0 = 0x1000171c; +//nop; +a1 = t6; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40c368; +a0 = a0; +L40c368: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40c380; +a1 = s4; +L40c380: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40c388: +t5 = 0x1000008c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40c414;} +//nop; +t2 = 0x1000a36c; +at = 0x1; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L40c414;} +//nop; +t7 = 0x10000008; +at = 0x2; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == at) {at = 0x3; +goto L40c3d8;} +at = 0x3; +if (t7 != at) {//nop; +goto L40c414;} +//nop; +L40c3d8: +a1 = 0x1000008c; +a0 = 0x10001720; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40c3f4; +a0 = a0; +L40c3f4: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40c40c; +a1 = s4; +L40c40c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40c414: +t3 = 0x10000084; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L40c464;} +//nop; +a0 = 0x10001724; +//nop; +a1 = t3; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40c444; +a0 = a0; +L40c444: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40c45c; +a1 = s4; +L40c45c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40c464: +t9 = 0x10000218; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L40c538;} +//nop; +t0 = 0x1000a36c; +at = 0x4; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L40c4fc;} +//nop; +t1 = 0x1000a520; +t8 = s0 << 2; +t1 = MEM_U32(t1 + 8); +//nop; +t4 = t1 + t8; +a0 = MEM_U32(t4 + 0); +//nop; +v0 = f_getsuf(mem, sp, a0); +goto L40c4b4; +//nop; +L40c4b4: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L40c4fc;} +//nop; +t6 = 0x1000a520; +t5 = s0 << 2; +t6 = MEM_U32(t6 + 8); +a1 = 0x10001728; +//nop; +t2 = t6 + t5; +a0 = MEM_U32(t2 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40c4e8; +a1 = a1; +L40c4e8: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40c680; +MEM_U32(at + 0) = v0; +L40c4fc: +t7 = 0x1000a520; +t3 = s0 << 2; +t7 = MEM_U32(t7 + 8); +a1 = 0x69; +t9 = t7 + t3; +a0 = MEM_U32(t9 + 0); +//nop; +//nop; +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40c524; +//nop; +L40c524: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40c680; +MEM_U32(at + 0) = v0; +L40c538: +t0 = 0x10000214; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {at = 0x1000a1f4; +goto L40c558;} +at = 0x1000a1f4; +MEM_U32(at + 0) = zero; +goto L40c680; +MEM_U32(at + 0) = zero; +L40c558: +t1 = 0x1000a1e6; +at = 0x4b; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 == at) {//nop; +goto L40c588;} +//nop; +t8 = 0x10000240; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L40c66c;} +//nop; +L40c588: +t4 = 0x100003e4; +at = 0x3; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L40c638;} +//nop; +t6 = 0x1000043c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L40c638;} +//nop; +t5 = 0x100003dc; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L40c638;} +//nop; +t2 = 0x1000a188; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L40c638;} +//nop; +t7 = 0x1000a36c; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L40c638;} +//nop; +t3 = 0x1000a520; +t9 = s0 << 2; +t3 = MEM_U32(t3 + 8); +a1 = 0x42; +t0 = t3 + t9; +//nop; +a0 = MEM_U32(t0 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40c624; +//nop; +L40c624: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40c680; +MEM_U32(at + 0) = v0; +L40c638: +t1 = 0x1000a520; +t8 = s0 << 2; +t1 = MEM_U32(t1 + 8); +//nop; +t4 = t1 + t8; +a0 = MEM_U32(t4 + 0); +a1 = 0x69; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40c658; +a1 = 0x69; +L40c658: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40c680; +MEM_U32(at + 0) = v0; +L40c66c: +t6 = 0x1000a380; +at = 0x1000a1f4; +t5 = MEM_U32(t6 + 8); +//nop; +MEM_U32(at + 0) = t5; +L40c680: +t2 = 0x1000a1f4; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L40c70c;} +//nop; +//nop; +a0 = t2; +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L40c6a8; +//nop; +L40c6a8: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L40c70c;} +//nop; +t3 = 0x1000a1f4; +t7 = 0x1000172c; +//nop; +t3 = MEM_U32(t3 + 0); +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L40c6ec; +MEM_U32(sp + 24) = t3; +L40c6ec: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40c704; +//nop; +L40c704: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40c70c: +t9 = 0x1000a36c; +at = 0x3; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L40c78c;} +//nop; +t0 = 0x100001fc; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L40c78c;} +//nop; +a1 = 0x10001758; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40c750; +a1 = a1; +L40c750: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000175c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40c76c; +a1 = a1; +L40c76c: +// bdead 40060003 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 328); +//nop; +a0 = 0x1000a560; +//nop; +f_addstr(mem, sp, a0, a1); +goto L40c784; +//nop; +L40c784: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40c78c: +t1 = 0x10000008; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L40c7c4;} +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L40c7bc; +//nop; +L40c7bc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40c7c4: +t8 = 0x100003e4; +at = 0x3; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == at) {at = 0x4; +goto L40c7e4;} +at = 0x4; +if (t8 != at) {//nop; +goto L40c874;} +//nop; +L40c7e4: +t4 = 0x1000a36c; +at = 0x1; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == at) {at = 0x4; +goto L40c804;} +at = 0x4; +if (t4 != at) {//nop; +goto L40c874;} +//nop; +L40c804: +t6 = 0x1000043c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L40c874;} +//nop; +t5 = 0x1000a188; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +t2 = t5 & 0x1; +if (t2 != 0) {//nop; +goto L40c874;} +//nop; +t7 = t5 & 0x8; +if (t7 != 0) {//nop; +goto L40c874;} +//nop; +t3 = 0x100003dc; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L40c874;} +//nop; +t9 = 0x100002b4; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L40c9e4;} +//nop; +L40c874: +t0 = 0x1000a36c; +at = 0x3; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L40c8b8;} +//nop; +t1 = 0x100001fc; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L40c8b8;} +//nop; +s4 = 0x100000a0; +//nop; +s4 = MEM_U32(s4 + 0); +//nop; +goto L40c8c8; +//nop; +L40c8b8: +s4 = 0x10000094; +//nop; +s4 = MEM_U32(s4 + 0); +//nop; +L40c8c8: +a1 = 0x1000a560; +a3 = 0x1000a1f4; +//nop; +a1 = MEM_U32(a1 + 8); +a3 = MEM_U32(a3 + 0); +a0 = s4; +a2 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L40c8ec; +MEM_U32(sp + 16) = zero; +L40c8ec: +// bdead 4006000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L40da08;} +//nop; +t8 = 0x10000404; +t6 = 0x10000214; +t8 = MEM_U32(t8 + 0); +at = 0x10000404; +t6 = MEM_U32(t6 + 0); +t4 = t8 + 0x1; +if (t6 != 0) {MEM_U32(at + 0) = t4; +goto L40c99c;} +MEM_U32(at + 0) = t4; +t2 = 0x1000a24c; +at = 0x65; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == at) {at = 0x72; +goto L40c938;} +at = 0x72; +if (t2 != at) {//nop; +goto L40c950;} +//nop; +L40c938: +t5 = 0x10000240; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40c980;} +//nop; +L40c950: +t7 = 0x1000a24c; +at = 0x73; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L40c99c;} +//nop; +t3 = 0x10000268; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L40c99c;} +//nop; +L40c980: +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40c994; +//nop; +L40c994: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40c99c: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40c9b0; +//nop; +L40c9b0: +// bdead 40060003 gp = MEM_U32(sp + 64); +t9 = MEM_U32(sp + 276); +at = 0x100003e8; +a0 = 0x10001760; +MEM_U32(at + 0) = t9; +//nop; +a1 = zero; +a2 = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40c9d8; +a0 = a0; +L40c9d8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L40c9e4: +t0 = MEM_U32(sp + 276); +at = 0x100003e8; +a0 = 0x10001764; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t0; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40ca08; +a0 = a0; +L40ca08: +// bdead 40060103 gp = MEM_U32(sp + 64); +at = 0x63; +t1 = 0x1000a24c; +//nop; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 == at) {at = 0x6; +goto L40ca80;} +at = 0x6; +if (t1 == at) {//nop; +goto L40ca80;} +//nop; +t8 = 0x1000a36c; +at = 0x1; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L40cab0;} +//nop; +t4 = 0x10000124; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L40cab0;} +//nop; +t6 = 0x100001fc; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {at = 0x68; +goto L40cab0;} +at = 0x68; +if (t1 != at) {//nop; +goto L40cab0;} +//nop; +L40ca80: +t2 = 0x10000218; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L40cab0;} +//nop; +t5 = 0x10000214; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40ea14;} +//nop; +L40cab0: +t7 = 0x10000244; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L40cae4;} +//nop; +a1 = 0x10001768; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cadc; +a1 = a1; +L40cadc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40cae4: +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L40cb14;} +//nop; +t9 = 0x10000008; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L40cfe4;} +//nop; +L40cb14: +s4 = 0x1000a24c; +//nop; +s4 = MEM_U8(s4 + 0); +//nop; +at = (int)s4 < (int)0x3; +if (at != 0) {at = (int)s4 < (int)0x47; +goto L40cb78;} +at = (int)s4 < (int)0x47; +if (at != 0) {//nop; +goto L40cb64;} +//nop; +t0 = s4 + 0xffffff9d; +at = t0 < 0x11; +if (at == 0) {//nop; +goto L40cd48;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100071e0[] = { +&&L40cb94, +&&L40cd48, +&&L40cc40, +&&L40cc40, +&&L40cd48, +&&L40cd48, +&&L40cd48, +&&L40cd48, +&&L40cd48, +&&L40cd48, +&&L40cd48, +&&L40cd48, +&&L40cd48, +&&L40cbe8, +&&L40cd48, +&&L40cc40, +&&L40cc7c, +}; +dest = Lswitch100071e0[t0]; +//nop; +goto *dest; +//nop; +L40cb64: +at = 0x46; +if (s4 == at) {//nop; +goto L40cc40;} +//nop; +//nop; +goto L40cd48; +//nop; +L40cb78: +at = 0x1; +if (s4 == at) {at = 0x2; +goto L40ccd4;} +at = 0x2; +if (s4 == at) {//nop; +goto L40cd10;} +//nop; +//nop; +goto L40cd48; +//nop; +L40cb94: +a1 = 0x1000176c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cba8; +a1 = a1; +L40cba8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t8 = 0x100002b0; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L40cd48;} +//nop; +a1 = 0x1000177c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cbdc; +a1 = a1; +L40cbdc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40cd48; +//nop; +L40cbe8: +a1 = 0x10001784; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cbfc; +a1 = a1; +L40cbfc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001798; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cc18; +a1 = a1; +L40cc18: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100017ac; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cc34; +a1 = a1; +L40cc34: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40cd48; +//nop; +L40cc40: +a1 = 0x100017b0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cc54; +a1 = a1; +L40cc54: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100017c4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cc70; +a1 = a1; +L40cc70: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40cd48; +//nop; +L40cc7c: +a1 = 0x100017d8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cc90; +a1 = a1; +L40cc90: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100017e0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ccac; +a1 = a1; +L40ccac: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100017f4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ccc8; +a1 = a1; +L40ccc8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40cd48; +//nop; +L40ccd4: +a1 = 0x1000180c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cce8; +a1 = a1; +L40cce8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000181c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cd04; +a1 = a1; +L40cd04: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40cd48; +//nop; +L40cd10: +a1 = 0x1000182c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cd24; +a1 = a1; +L40cd24: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001840; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cd40; +a1 = a1; +L40cd40: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40cd48: +a1 = 0x10001854; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cd5c; +a1 = a1; +L40cd5c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t4 = 0x1000030c; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L40cd98;} +//nop; +a1 = 0x10001860; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cd90; +a1 = a1; +L40cd90: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40cd98: +t6 = 0x10000004; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {at = 0x3; +goto L40cdb8;} +at = 0x3; +if (t6 != at) {//nop; +goto L40cdf8;} +//nop; +L40cdb8: +t1 = 0x10000320; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L40cdf8;} +//nop; +a1 = 0x1000186c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cde4; +a1 = a1; +L40cde4: +// bdead 40060003 gp = MEM_U32(sp + 64); +t2 = 0x1; +at = 0x10000320; +//nop; +MEM_U32(at + 0) = t2; +L40cdf8: +t5 = 0x10000354; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L40cef8;} +//nop; +t7 = 0x100002f0; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40cea4;} +//nop; +t3 = 0x10000348; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L40ce54;} +//nop; +t9 = 0x10000384; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {at = 0x10000318; +goto L40ce84;} +L40ce54: +at = 0x10000318; +t0 = 0x1; +MEM_U32(at + 0) = t0; +at = 0x10000324; +t8 = 0x1; +MEM_U32(at + 0) = t8; +at = 0x10000384; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10000348; +//nop; +MEM_U32(at + 0) = zero; +L40ce84: +a1 = 0x10001878; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ce98; +a1 = a1; +L40ce98: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40cef8; +//nop; +L40cea4: +t4 = 0x100002f4; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L40cedc;} +//nop; +a1 = 0x10001884; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ced0; +a1 = a1; +L40ced0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40cef8; +//nop; +L40cedc: +a1 = 0x10001890; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cef0; +a1 = a1; +L40cef0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40cef8: +at = 0x10000354; +a1 = 0x1000189c; +//nop; +t6 = 0x1; +a0 = 0x1000a560; +MEM_U32(at + 0) = t6; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cf18; +a1 = a1; +L40cf18: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x10000340; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L40cf54;} +//nop; +a1 = 0x100018ac; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cf4c; +a1 = a1; +L40cf4c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40cf54: +a1 = 0x100018b4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cf68; +a1 = a1; +L40cf68: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t2 = 0x1000a27c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L40cfc8;} +//nop; +s2 = t2; +t5 = MEM_U8(s2 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40cfe4;} +//nop; +L40cf9c: +//nop; +a0 = MEM_U8(s2 + 0); +//nop; +v0 = wrapper_toupper(a0); +goto L40cfac; +//nop; +L40cfac: +t7 = MEM_U8(s2 + 1); +// bdead 400f010b gp = MEM_U32(sp + 64); +MEM_U8(s2 + 0) = (uint8_t)v0; +if (t7 != 0) {s2 = s2 + 0x1; +goto L40cf9c;} +s2 = s2 + 0x1; +//nop; +goto L40cfe4; +//nop; +L40cfc8: +a1 = 0x100018c0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40cfdc; +a1 = a1; +L40cfdc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40cfe4: +t3 = 0x10000214; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L40d1ec;} +//nop; +t9 = 0x10000218; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L40d1ec;} +//nop; +t0 = 0x10000084; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L40d068;} +//nop; +a0 = 0x1000a25c; +a1 = 0x100018d0; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L40d044; +a1 = a1; +L40d044: +// bdead 4006000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L40d080;} +//nop; +t8 = 0x1000a27c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L40d080;} +//nop; +L40d068: +t4 = 0x10000280; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L40d0b4;} +//nop; +L40d080: +t6 = 0x10000008; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L40d0b4;} +//nop; +a1 = 0x100018d4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40d0ac; +a1 = a1; +L40d0ac: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40d0b4: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a270; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40d0c8; +//nop; +L40d0c8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a260; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40d0e4; +//nop; +L40d0e4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x100001e0; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L40d11c;} +//nop; +//nop; +a0 = 0x1000a560; +a1 = t1; +f_addstr(mem, sp, a0, a1); +goto L40d114; +a1 = t1; +L40d114: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40d11c: +t2 = 0x10000288; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L40d1ec;} +//nop; +t5 = 0x1000037c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40d19c;} +//nop; +t7 = 0x10000088; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40d19c;} +//nop; +a0 = 0x100018d8; +//nop; +a1 = t7; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40d17c; +a0 = a0; +L40d17c: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40d194; +a1 = s4; +L40d194: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40d19c: +t3 = 0x10000084; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L40d1ec;} +//nop; +a0 = 0x100018dc; +//nop; +a1 = t3; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40d1cc; +a0 = a0; +L40d1cc: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40d1e4; +a1 = s4; +L40d1e4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40d1ec: +t9 = 0x10000218; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L40d21c;} +//nop; +t0 = 0x10000214; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L40d2e0;} +//nop; +L40d21c: +t8 = 0x10000008; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L40d2e0;} +//nop; +t4 = 0x10000004; +at = 0x1; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == at) {at = 0x2; +goto L40d254;} +at = 0x2; +if (t4 != at) {//nop; +goto L40d274;} +//nop; +L40d254: +a1 = 0x100018e0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40d268; +a1 = a1; +L40d268: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40d2e0; +//nop; +L40d274: +t6 = 0x10000004; +at = 0x3; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L40d2ac;} +//nop; +a1 = 0x100018e8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40d2a0; +a1 = a1; +L40d2a0: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40d2e0; +//nop; +L40d2ac: +t1 = 0x10000004; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L40d2e0;} +//nop; +a1 = 0x100018f0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40d2d8; +a1 = a1; +L40d2d8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40d2e0: +t2 = 0x1000a36c; +at = 0x1; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L40d52c;} +//nop; +t5 = 0x10000008; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40d52c;} +//nop; +t7 = 0x10000234; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40d344;} +//nop; +a1 = 0x100018f8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40d33c; +a1 = a1; +L40d33c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40d344: +t3 = 0x1000a198; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L40d378;} +//nop; +a1 = 0x100018fc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40d370; +a1 = a1; +L40d370: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40d378: +t9 = 0x1000a520; +at = 0x1; +t9 = MEM_U32(t9 + 4); +//nop; +if (t9 != at) {//nop; +goto L40d408;} +//nop; +t0 = 0x1000a1ec; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L40d3b0;} +//nop; +MEM_U32(sp + 280) = t0; +goto L40d430; +MEM_U32(sp + 280) = t0; +L40d3b0: +t8 = 0x10000228; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L40d3dc;} +//nop; +t4 = 0x10001900; +//nop; +t4 = t4; +MEM_U32(sp + 280) = t4; +goto L40d430; +MEM_U32(sp + 280) = t4; +L40d3dc: +t6 = 0x1000a520; +t1 = s0 << 2; +t6 = MEM_U32(t6 + 8); +//nop; +t2 = t6 + t1; +a0 = MEM_U32(t2 + 0); +a1 = 0x6f; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40d3fc; +a1 = 0x6f; +L40d3fc: +// bdead 4006010b gp = MEM_U32(sp + 64); +MEM_U32(sp + 280) = v0; +goto L40d430; +MEM_U32(sp + 280) = v0; +L40d408: +t5 = 0x1000a520; +t7 = s0 << 2; +t5 = MEM_U32(t5 + 8); +//nop; +t3 = t5 + t7; +a0 = MEM_U32(t3 + 0); +a1 = 0x6f; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40d428; +a1 = 0x6f; +L40d428: +// bdead 4006010b gp = MEM_U32(sp + 64); +MEM_U32(sp + 280) = v0; +L40d430: +a0 = 0x10001908; +//nop; +a1 = MEM_U32(sp + 280); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40d448; +a0 = a0; +L40d448: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40d460; +a1 = s4; +L40d460: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x2; +t9 = 0x10000008; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == at) {//nop; +goto L40d50c;} +//nop; +t0 = 0x10000008; +at = 0x3; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L40d4b8;} +//nop; +a1 = 0x1000190c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40d4ac; +a1 = a1; +L40d4ac: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40d50c; +//nop; +L40d4b8: +t8 = 0x100003fc; +at = 0x3; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L40d4f0;} +//nop; +a1 = 0x10001910; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40d4e4; +a1 = a1; +L40d4e4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40d50c; +//nop; +L40d4f0: +a1 = 0x10001914; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40d504; +a1 = a1; +L40d504: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40d50c: +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L40d524; +//nop; +L40d524: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40d52c: +t4 = 0x10000218; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L40d5f8;} +//nop; +t6 = 0x1000a36c; +at = 0x4; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L40d5c4;} +//nop; +t1 = 0x1000a520; +t2 = s0 << 2; +t1 = MEM_U32(t1 + 8); +//nop; +t5 = t1 + t2; +a0 = MEM_U32(t5 + 0); +//nop; +v0 = f_getsuf(mem, sp, a0); +goto L40d57c; +//nop; +L40d57c: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L40d5c4;} +//nop; +t7 = 0x1000a520; +t3 = s0 << 2; +t7 = MEM_U32(t7 + 8); +a1 = 0x10001918; +t9 = t7 + t3; +a0 = MEM_U32(t9 + 0); +//nop; +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40d5b0; +a1 = a1; +L40d5b0: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40d62c; +MEM_U32(at + 0) = v0; +L40d5c4: +t0 = 0x1000a520; +t8 = s0 << 2; +t0 = MEM_U32(t0 + 8); +//nop; +t4 = t0 + t8; +a0 = MEM_U32(t4 + 0); +a1 = 0x69; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40d5e4; +a1 = 0x69; +L40d5e4: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40d62c; +MEM_U32(at + 0) = v0; +L40d5f8: +t6 = 0x10000214; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {at = 0x1000a1f4; +goto L40d618;} +at = 0x1000a1f4; +MEM_U32(at + 0) = zero; +goto L40d62c; +MEM_U32(at + 0) = zero; +L40d618: +t1 = 0x1000a380; +at = 0x1000a1f4; +t2 = MEM_U32(t1 + 8); +//nop; +MEM_U32(at + 0) = t2; +L40d62c: +t5 = 0x1000a1f4; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40d6b8;} +//nop; +//nop; +a0 = t5; +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L40d654; +//nop; +L40d654: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L40d6b8;} +//nop; +t3 = 0x1000a1f4; +t7 = 0x1000191c; +//nop; +t3 = MEM_U32(t3 + 0); +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L40d698; +MEM_U32(sp + 24) = t3; +L40d698: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40d6b0; +//nop; +L40d6b0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40d6b8: +t9 = 0x100002b0; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L40d760;} +//nop; +t0 = 0x100002b4; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L40d724;} +//nop; +a0 = 0x10000094; +a1 = 0x1000a560; +a3 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = MEM_U32(a3 + 0); +a2 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L40d710; +MEM_U32(sp + 16) = zero; +L40d710: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1e8; +MEM_U32(at + 0) = v0; +goto L40d7f0; +MEM_U32(at + 0) = v0; +L40d724: +a0 = 0x10000094; +a1 = 0x1000a560; +a3 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = MEM_U32(a3 + 0); +a2 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L40d74c; +MEM_U32(sp + 16) = zero; +L40d74c: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1e8; +MEM_U32(at + 0) = v0; +goto L40d7f0; +MEM_U32(at + 0) = v0; +L40d760: +t8 = 0x100002b4; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L40d7b4;} +//nop; +a0 = 0x10000094; +a1 = 0x1000a560; +a3 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = MEM_U32(a3 + 0); +a2 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L40d7a0; +MEM_U32(sp + 16) = zero; +L40d7a0: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1e8; +MEM_U32(at + 0) = v0; +goto L40d7f0; +MEM_U32(at + 0) = v0; +L40d7b4: +a0 = 0x100000a0; +a1 = 0x1000a560; +a3 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = MEM_U32(a3 + 0); +a2 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L40d7dc; +MEM_U32(sp + 16) = zero; +L40d7dc: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1e8; +//nop; +MEM_U32(at + 0) = v0; +L40d7f0: +t4 = 0x1000a1e8; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L40d8cc;} +//nop; +t6 = 0x10000404; +t2 = 0x10000214; +t6 = MEM_U32(t6 + 0); +at = 0x10000404; +t2 = MEM_U32(t2 + 0); +t1 = t6 + 0x1; +if (t2 != 0) {MEM_U32(at + 0) = t1; +goto L40d8ac;} +MEM_U32(at + 0) = t1; +t5 = 0x1000a24c; +at = 0x65; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {at = 0x72; +goto L40d848;} +at = 0x72; +if (t5 != at) {//nop; +goto L40d860;} +//nop; +L40d848: +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40d890;} +//nop; +L40d860: +t3 = 0x1000a24c; +at = 0x73; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L40d8ac;} +//nop; +t9 = 0x10000268; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L40d8ac;} +//nop; +L40d890: +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40d8a4; +//nop; +L40d8a4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40d8ac: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40d8c0; +//nop; +L40d8c0: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L40d8cc: +t0 = 0x10000218; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L41977c;} +//nop; +t8 = 0x10000214; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L41977c;} +//nop; +t4 = 0x1000a24c; +at = 0x65; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == at) {at = 0x72; +goto L40d91c;} +at = 0x72; +if (t4 != at) {//nop; +goto L40d934;} +//nop; +L40d91c: +t6 = 0x10000240; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L40d964;} +//nop; +L40d934: +t1 = 0x1000a24c; +at = 0x73; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L40d980;} +//nop; +t2 = 0x10000268; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L40d980;} +//nop; +L40d964: +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40d978; +//nop; +L40d978: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40d980: +t5 = 0x1000a1f4; +at = 0x1000a1f0; +t5 = MEM_U32(t5 + 0); +s4 = 0x1000a24c; +MEM_U32(at + 0) = t5; +at = 0x10000354; +s4 = MEM_U8(s4 + 0); +MEM_U32(at + 0) = zero; +at = (int)s4 < (int)0x3; +if (at != 0) {at = (int)s4 < (int)0x47; +goto L40d9f4;} +at = (int)s4 < (int)0x47; +if (at != 0) {//nop; +goto L40d9e0;} +//nop; +t7 = s4 + 0xffffff9d; +at = t7 < 0x11; +if (at == 0) {//nop; +goto L40da08;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10007224[] = { +&&L40db8c, +&&L40da08, +&&L412c64, +&&L412c64, +&&L40da08, +&&L40da08, +&&L40da08, +&&L40da08, +&&L40da08, +&&L40da08, +&&L40da08, +&&L40da08, +&&L40da08, +&&L410ea0, +&&L40da08, +&&L412c64, +&&L418634, +}; +dest = Lswitch10007224[t7]; +//nop; +goto *dest; +//nop; +L40d9e0: +at = 0x46; +if (s4 == at) {//nop; +goto L412c64;} +//nop; +//nop; +goto L40da08; +//nop; +L40d9f4: +at = 0x1; +if (s4 == at) {at = 0x2; +goto L4116a8;} +at = 0x2; +if (s4 == at) {//nop; +goto L41222c;} +//nop; +L40da08: +t3 = MEM_U32(sp + 276); +at = 0x100003e8; +a0 = 0x10001948; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t3; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40da2c; +a0 = a0; +L40da2c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t9 = 0x10000008; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L40db14;} +//nop; +t0 = 0x10000218; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L41977c;} +//nop; +t8 = 0x10000214; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L41977c;} +//nop; +t4 = 0x1000a24c; +at = 0x65; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == at) {at = 0x72; +goto L40da9c;} +at = 0x72; +if (t4 != at) {//nop; +goto L40dab4;} +//nop; +L40da9c: +t6 = 0x10000240; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L40dae4;} +//nop; +L40dab4: +t1 = 0x1000a24c; +at = 0x73; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L40db00;} +//nop; +t2 = 0x10000268; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L40db00;} +//nop; +L40dae4: +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40daf8; +//nop; +L40daf8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40db00: +t5 = 0x1000a1f4; +at = 0x1000a1f0; +t5 = MEM_U32(t5 + 0); +//nop; +MEM_U32(at + 0) = t5; +L40db14: +s4 = 0x1000a24c; +at = 0x10000354; +s4 = MEM_U8(s4 + 0); +MEM_U32(at + 0) = zero; +at = (int)s4 < (int)0x7; +if (at != 0) {at = (int)s4 < (int)0x47; +goto L40db78;} +at = (int)s4 < (int)0x47; +if (at != 0) {//nop; +goto L40db64;} +//nop; +t7 = s4 + 0xffffff9d; +at = t7 < 0x11; +if (at == 0) {//nop; +goto L40db8c;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10007268[] = { +&&L40db8c, +&&L40db8c, +&&L412c64, +&&L412c64, +&&L40db8c, +&&L40db8c, +&&L40db8c, +&&L40db8c, +&&L40db8c, +&&L40db8c, +&&L40db8c, +&&L40db8c, +&&L40db8c, +&&L410ea0, +&&L40db8c, +&&L412c64, +&&L418634, +}; +dest = Lswitch10007268[t7]; +//nop; +goto *dest; +//nop; +L40db64: +at = 0x46; +if (s4 == at) {//nop; +goto L412c64;} +//nop; +//nop; +goto L40db8c; +//nop; +L40db78: +at = 0x1; +if (s4 == at) {at = 0x2; +goto L4116a8;} +at = 0x2; +if (s4 == at) {//nop; +goto L41222c;} +//nop; +L40db8c: +t3 = 0x1000043c; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L40e260;} +//nop; +t9 = 0x1000a188; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +t0 = t9 & 0x1; +if (t0 == 0) {//nop; +goto L40dbf4;} +//nop; +t8 = 0x1000194c; +//nop; +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L40dbe8; +MEM_U32(sp + 16) = zero; +L40dbe8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40e260; +//nop; +L40dbf4: +at = 0x1000a560; +a1 = 0x1000197c; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40dc10; +a1 = a1; +L40dc10: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t4 = 0x10000230; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +at = (int)t4 < (int)0x2; +if (at != 0) {//nop; +goto L40dc84;} +//nop; +t6 = 0x10000264; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L40dc84;} +//nop; +a1 = 0x10001984; +//nop; +a0 = 0x1000a4b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40dc60; +a1 = a1; +L40dc60: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001990; +//nop; +a0 = 0x1000a4b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40dc7c; +a1 = a1; +L40dc7c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40dc84: +a1 = 0x1000a1f0; +a0 = 0x10001994; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40dca0; +a0 = a0; +L40dca0: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40dcb8; +a1 = s4; +L40dcb8: +// bdead 40060103 gp = MEM_U32(sp + 64); +at = 0x4b; +t1 = 0x1000a1e6; +//nop; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 == at) {//nop; +goto L40dcf0;} +//nop; +t2 = 0x10000240; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L40dd24;} +//nop; +L40dcf0: +t5 = 0x1000a520; +t7 = s0 << 2; +t5 = MEM_U32(t5 + 8); +//nop; +t3 = t5 + t7; +a0 = MEM_U32(t3 + 0); +a1 = 0x4d; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40dd10; +a1 = 0x4d; +L40dd10: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40dd54; +MEM_U32(at + 0) = v0; +L40dd24: +t9 = 0x1000a380; +a1 = 0x10001998; +a0 = MEM_U32(t9 + 124); +//nop; +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40dd40; +a1 = a1; +L40dd40: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +L40dd54: +a1 = 0x1000a1f4; +a0 = 0x1000199c; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40dd70; +a0 = a0; +L40dd70: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40dd88; +a1 = s4; +L40dd88: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100019a4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40dda4; +a1 = a1; +L40dda4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t0 = 0x10000004; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L40dde0;} +//nop; +a1 = 0x100019ac; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ddd8; +a1 = a1; +L40ddd8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40dde0: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a5e0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40ddf4; +//nop; +L40ddf4: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100001f8; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L40de1c; +MEM_U32(sp + 16) = zero; +L40de1c: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L40dee4;} +//nop; +t8 = 0x10000404; +t6 = 0x1000a1a0; +t8 = MEM_U32(t8 + 0); +at = 0x10000404; +t6 = MEM_U32(t6 + 0); +t4 = t8 + 0x1; +if (t6 == 0) {MEM_U32(at + 0) = t4; +goto L40de94;} +MEM_U32(at + 0) = t4; +t1 = 0x1000a24c; +at = 0x69; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 == at) {//nop; +goto L40de94;} +//nop; +t2 = 0x10000240; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L40de94;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40de8c; +//nop; +L40de8c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40de94: +t5 = 0x1000a1e6; +at = 0x4b; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L40dec4;} +//nop; +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41977c;} +//nop; +L40dec4: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40ded8; +//nop; +L40ded8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L40dee4: +t3 = 0x1000a1a0; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L40df48;} +//nop; +t9 = 0x1000a24c; +at = 0x69; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == at) {//nop; +goto L40df48;} +//nop; +t0 = 0x10000240; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L40df48;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40df40; +//nop; +L40df40: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40df48: +t8 = 0x1000a1f4; +at = 0x1000a1f0; +t4 = 0x100003e4; +t8 = MEM_U32(t8 + 0); +t4 = MEM_U32(t4 + 0); +MEM_U32(at + 0) = t8; +at = 0x3; +if (t4 != at) {//nop; +goto L40df88;} +//nop; +t6 = 0x1000a188; +at = 0x10000; +t6 = MEM_U32(t6 + 0); +//nop; +t1 = t6 & at; +if (t1 == 0) {//nop; +goto L40ea14;} +//nop; +L40df88: +t2 = 0x1000a1e6; +at = 0x4b; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == at) {//nop; +goto L41977c;} +//nop; +t5 = 0x1000a1e6; +at = 0x4b; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {//nop; +goto L40dfd0;} +//nop; +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40e008;} +//nop; +L40dfd0: +t3 = 0x1000a520; +t9 = s0 << 2; +t3 = MEM_U32(t3 + 8); +a1 = 0x49; +t0 = t3 + t9; +//nop; +a0 = MEM_U32(t0 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40dff4; +//nop; +L40dff4: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40e038; +MEM_U32(at + 0) = v0; +L40e008: +t8 = 0x1000a380; +a1 = 0x100019b4; +//nop; +a0 = MEM_U32(t8 + 124); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40e024; +a1 = a1; +L40e024: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +L40e038: +t4 = 0x10000234; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L40e06c;} +//nop; +a1 = 0x100019b8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40e064; +a1 = a1; +L40e064: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40e06c: +at = 0x1000a560; +t6 = 0x100003e8; +MEM_U32(at + 4) = zero; +t6 = MEM_U32(t6 + 0); +at = 0x1; +if (t6 == at) {at = 0x3; +goto L40e09c;} +at = 0x3; +if (t6 == at) {//nop; +goto L40e09c;} +//nop; +s4 = 0x100019bc; +s4 = s4; +goto L40e0a8; +s4 = s4; +L40e09c: +s4 = 0x100019c0; +//nop; +s4 = s4; +L40e0a8: +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40e0b8; +a1 = s4; +L40e0b8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L40e0d8; +//nop; +L40e0d8: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x2; +t1 = 0x100003e8; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == at) {at = 0x100003e8; +goto L40e104;} +at = 0x100003e8; +t2 = 0x1; +MEM_U32(at + 0) = t2; +goto L40e120; +MEM_U32(at + 0) = t2; +L40e104: +a1 = 0x100019c8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40e118; +a1 = a1; +L40e118: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40e120: +t5 = 0x10000288; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40e154;} +//nop; +a1 = 0x100019cc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40e14c; +a1 = a1; +L40e14c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40e154: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a2d0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40e168; +//nop; +L40e168: +// bdead 40060003 gp = MEM_U32(sp + 64); +a1 = zero; +a0 = 0x100019d8; +//nop; +a2 = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40e184; +a0 = a0; +L40e184: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x10000094; +a1 = 0x1000a560; +a3 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = MEM_U32(a3 + 0); +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L40e1b0; +MEM_U32(sp + 16) = zero; +L40e1b0: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L40e218;} +//nop; +t7 = 0x10000404; +t9 = 0x10000240; +t7 = MEM_U32(t7 + 0); +at = 0x10000404; +t9 = MEM_U32(t9 + 0); +t3 = t7 + 0x1; +if (t9 != 0) {MEM_U32(at + 0) = t3; +goto L40e1f8;} +MEM_U32(at + 0) = t3; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40e1f0; +//nop; +L40e1f0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40e1f8: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40e20c; +//nop; +L40e20c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L40e218: +t0 = 0x10000240; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L40e24c;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40e244; +//nop; +L40e244: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40e24c: +t8 = 0x1000a1f4; +at = 0x1000a1f0; +t8 = MEM_U32(t8 + 0); +MEM_U32(at + 0) = t8; +goto L40ea14; +MEM_U32(at + 0) = t8; +L40e260: +t4 = 0x1000a1e6; +at = 0x4b; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == at) {//nop; +goto L40e290;} +//nop; +t6 = 0x10000240; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L40e2a8;} +//nop; +L40e290: +t1 = 0x1000a188; +at = 0x1000a188; +t1 = MEM_U32(t1 + 0); +//nop; +t2 = t1 | 0x6; +MEM_U32(at + 0) = t2; +L40e2a8: +t5 = 0x1000a188; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +t7 = t5 & 0x1; +if (t7 == 0) {//nop; +goto L40ea14;} +//nop; +t3 = 0x10000230; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +at = (int)t3 < (int)0x2; +if (at != 0) {//nop; +goto L40e330;} +//nop; +t9 = 0x10000264; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L40e330;} +//nop; +a1 = 0x100019dc; +//nop; +a0 = 0x1000a4b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40e30c; +a1 = a1; +L40e30c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100019e8; +//nop; +a0 = 0x1000a4b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40e328; +a1 = a1; +L40e328: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40e330: +at = 0x1000a560; +a1 = 0x100019ec; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40e34c; +a1 = a1; +L40e34c: +// bdead 40060103 gp = MEM_U32(sp + 64); +a2 = zero; +a1 = 0x1000a1f0; +a0 = 0x100019f0; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40e36c; +a0 = a0; +L40e36c: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40e384; +a1 = s4; +L40e384: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t0 = 0x1000a188; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +t8 = t0 & 0x4; +if (t8 == 0) {//nop; +goto L40e3dc;} +//nop; +t4 = 0x1000a520; +t6 = s0 << 2; +t4 = MEM_U32(t4 + 8); +//nop; +t1 = t4 + t6; +a0 = MEM_U32(t1 + 0); +a1 = 0x4d; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40e3c8; +a1 = 0x4d; +L40e3c8: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40e40c; +MEM_U32(at + 0) = v0; +L40e3dc: +t2 = 0x1000a380; +a1 = 0x100019f4; +//nop; +a0 = MEM_U32(t2 + 124); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40e3f8; +a1 = a1; +L40e3f8: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +L40e40c: +a1 = 0x1000a1f4; +a0 = 0x100019f8; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40e428; +a0 = a0; +L40e428: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40e440; +a1 = s4; +L40e440: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t5 = 0x1000a188; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +t7 = t5 & 0x2; +if (t7 == 0) {//nop; +goto L40e494;} +//nop; +t3 = 0x1000a520; +t9 = s0 << 2; +t3 = MEM_U32(t3 + 8); +a1 = 0x4c; +t0 = t3 + t9; +//nop; +a0 = MEM_U32(t0 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40e488; +//nop; +L40e488: +// bdead 4006010b gp = MEM_U32(sp + 64); +MEM_U32(sp + 272) = v0; +goto L40e4b8; +MEM_U32(sp + 272) = v0; +L40e494: +t8 = 0x1000a380; +a1 = 0x10001a00; +//nop; +a0 = MEM_U32(t8 + 124); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40e4b0; +a1 = a1; +L40e4b0: +// bdead 4006010b gp = MEM_U32(sp + 64); +MEM_U32(sp + 272) = v0; +L40e4b8: +a0 = 0x10001a04; +//nop; +a1 = MEM_U32(sp + 272); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40e4d0; +a0 = a0; +L40e4d0: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40e4e8; +a1 = s4; +L40e4e8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001a08; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40e504; +a1 = a1; +L40e504: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001a10; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40e520; +a1 = a1; +L40e520: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t4 = 0x10000004; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L40e55c;} +//nop; +a1 = 0x10001a18; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40e554; +a1 = a1; +L40e554: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40e55c: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a5d0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40e570; +//nop; +L40e570: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100001ec; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L40e598; +MEM_U32(sp + 16) = zero; +L40e598: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L40e64c;} +//nop; +t6 = 0x10000404; +t2 = 0x1000a1a0; +t6 = MEM_U32(t6 + 0); +at = 0x10000404; +t2 = MEM_U32(t2 + 0); +t1 = t6 + 0x1; +if (t2 == 0) {MEM_U32(at + 0) = t1; +goto L40e610;} +MEM_U32(at + 0) = t1; +t5 = 0x1000a24c; +at = 0x69; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {//nop; +goto L40e610;} +//nop; +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L40e610;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40e608; +//nop; +L40e608: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40e610: +t3 = 0x1000a188; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +t9 = t3 & 0x4; +if (t9 != 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40e640; +//nop; +L40e640: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L40e64c: +t0 = 0x1000a188; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +t8 = t0 & 0x2; +if (t8 != 0) {//nop; +goto L40e680;} +//nop; +//nop; +a0 = MEM_U32(sp + 272); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40e678; +//nop; +L40e678: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40e680: +t4 = 0x1000a1a0; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L40e6e4;} +//nop; +t6 = 0x1000a24c; +at = 0x69; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == at) {//nop; +goto L40e6e4;} +//nop; +t1 = 0x10000240; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L40e6e4;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40e6dc; +//nop; +L40e6dc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40e6e4: +t2 = 0x1000a1f4; +at = 0x1000a1f0; +t5 = 0x1000a1e6; +t2 = MEM_U32(t2 + 0); +t5 = MEM_U8(t5 + 0); +MEM_U32(at + 0) = t2; +at = 0x4b; +if (t5 == at) {at = 0x1000a560; +goto L41977c;} +at = 0x1000a560; +t7 = 0x100003e8; +MEM_U32(at + 4) = zero; +t7 = MEM_U32(t7 + 0); +at = 0x1; +if (t7 == at) {at = 0x3; +goto L40e734;} +at = 0x3; +if (t7 == at) {//nop; +goto L40e734;} +//nop; +s4 = 0x10001a20; +s4 = s4; +goto L40e740; +s4 = s4; +L40e734: +s4 = 0x10001a24; +//nop; +s4 = s4; +L40e740: +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40e750; +a1 = s4; +L40e750: +// bdead 40060103 gp = MEM_U32(sp + 64); +at = 0x4b; +t3 = 0x1000a1e6; +//nop; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 == at) {//nop; +goto L40e788;} +//nop; +t9 = 0x10000240; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L40e7bc;} +//nop; +L40e788: +t0 = 0x1000a520; +t8 = s0 << 2; +t0 = MEM_U32(t0 + 8); +//nop; +t4 = t0 + t8; +a0 = MEM_U32(t4 + 0); +a1 = 0x49; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40e7a8; +a1 = 0x49; +L40e7a8: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40e7ec; +MEM_U32(at + 0) = v0; +L40e7bc: +t6 = 0x1000a380; +a1 = 0x10001a2c; +//nop; +a0 = MEM_U32(t6 + 124); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40e7d8; +a1 = a1; +L40e7d8: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +L40e7ec: +t1 = 0x10000234; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L40e820;} +//nop; +a1 = 0x10001a30; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40e818; +a1 = a1; +L40e818: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40e820: +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L40e838; +//nop; +L40e838: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x2; +t2 = 0x100003e8; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == at) {at = 0x100003e8; +goto L40e864;} +at = 0x100003e8; +t5 = 0x1; +MEM_U32(at + 0) = t5; +goto L40e880; +MEM_U32(at + 0) = t5; +L40e864: +a1 = 0x10001a34; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40e878; +a1 = a1; +L40e878: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40e880: +t7 = 0x10000288; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40e8b4;} +//nop; +a1 = 0x10001a38; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40e8ac; +a1 = a1; +L40e8ac: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40e8b4: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a2d0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40e8c8; +//nop; +L40e8c8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a260; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40e8e4; +//nop; +L40e8e4: +// bdead 40060003 gp = MEM_U32(sp + 64); +a1 = zero; +a0 = 0x10001a44; +//nop; +a2 = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L40e900; +a0 = a0; +L40e900: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x10000094; +a1 = 0x1000a560; +a3 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = MEM_U32(a3 + 0); +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L40e92c; +MEM_U32(sp + 16) = zero; +L40e92c: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L40e9b0;} +//nop; +t3 = 0x10000404; +t0 = 0x10000240; +t3 = MEM_U32(t3 + 0); +at = 0x10000404; +t0 = MEM_U32(t0 + 0); +t9 = t3 + 0x1; +if (t0 != 0) {MEM_U32(at + 0) = t9; +goto L40e990;} +MEM_U32(at + 0) = t9; +t8 = 0x1000a188; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +t4 = t8 & 0x4; +if (t4 != 0) {//nop; +goto L40e990;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40e988; +//nop; +L40e988: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40e990: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40e9a4; +//nop; +L40e9a4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L40e9b0: +t6 = 0x10000240; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L40ea00;} +//nop; +t1 = 0x1000a188; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +t2 = t1 & 0x4; +if (t2 != 0) {//nop; +goto L40ea00;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40e9f8; +//nop; +L40e9f8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40ea00: +t5 = 0x1000a1f4; +at = 0x1000a1f0; +t5 = MEM_U32(t5 + 0); +//nop; +MEM_U32(at + 0) = t5; +L40ea14: +t7 = 0x1000a36c; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L40f30c;} +//nop; +t3 = 0x10000008; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L40f30c;} +//nop; +t9 = 0x1000a1a0; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L40eabc;} +//nop; +t0 = 0x100002b4; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L40eabc;} +//nop; +t8 = 0x1000043c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L40eabc;} +//nop; +t4 = 0x1000a24c; +at = 0x69; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == at) {//nop; +goto L40eabc;} +//nop; +t6 = 0x100003dc; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L40eae0;} +//nop; +L40eabc: +a1 = 0x100000a0; +at = 0x1000a560; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +MEM_U32(at + 4) = zero; +f_addstr(mem, sp, a0, a1); +goto L40ead8; +MEM_U32(at + 4) = zero; +L40ead8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40eae0: +t1 = 0x10000234; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L40eb14;} +//nop; +a1 = 0x10001a48; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40eb0c; +a1 = a1; +L40eb0c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40eb14: +t2 = 0x1000a36c; +at = 0x1; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L40ebb4;} +//nop; +t5 = 0x10000008; +at = 0x2; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == at) {at = 0x3; +goto L40eb4c;} +at = 0x3; +if (t5 != at) {//nop; +goto L40ebb4;} +//nop; +L40eb4c: +t7 = 0x10000248; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40eb80;} +//nop; +a1 = 0x10001a4c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40eb78; +a1 = a1; +L40eb78: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40eb80: +t3 = 0x10000250; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L40ebb4;} +//nop; +a1 = 0x10001a50; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ebac; +a1 = a1; +L40ebac: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40ebb4: +t9 = 0x10000124; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L40ebe8;} +//nop; +a1 = 0x10001a54; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ebe0; +a1 = a1; +L40ebe0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40ebe8: +t0 = 0x1000026c; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L40ec70;} +//nop; +a1 = 0x10001a58; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ec14; +a1 = a1; +L40ec14: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001a5c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ec30; +a1 = a1; +L40ec30: +// bdead 40060103 gp = MEM_U32(sp + 64); +a2 = zero; +a1 = 0x1000a1fc; +a0 = 0x10001a60; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40ec50; +a0 = a0; +L40ec50: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40ec68; +a1 = s4; +L40ec68: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40ec70: +t8 = 0x1000a36c; +at = 0x1; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L40ed14;} +//nop; +t4 = 0x10000008; +at = 0x2; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == at) {at = 0x3; +goto L40eca8;} +at = 0x3; +if (t4 != at) {//nop; +goto L40ed14;} +//nop; +L40eca8: +t6 = 0x10000230; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +at = (int)t6 < (int)0x3; +if (at != 0) {//nop; +goto L40ece0;} +//nop; +a1 = 0x10001a64; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ecd8; +a1 = a1; +L40ecd8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40ece0: +t1 = 0x10000324; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L40ed14;} +//nop; +a1 = 0x10001a68; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ed0c; +a1 = a1; +L40ed0c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40ed14: +t2 = 0x1000025c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L40ed4c;} +//nop; +a1 = 0x10001a6c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ed40; +a1 = a1; +L40ed40: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40ed68; +//nop; +L40ed4c: +a1 = 0x10001a70; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ed60; +a1 = a1; +L40ed60: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40ed68: +t5 = 0x1000a198; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40ed9c;} +//nop; +a1 = 0x10001a74; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ed94; +a1 = a1; +L40ed94: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40ed9c: +t7 = 0x1000024c; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40edd0;} +//nop; +a1 = 0x10001a78; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40edc8; +a1 = a1; +L40edc8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40edd0: +t3 = 0x10000008; +at = 0x2; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == at) {//nop; +goto L40ee74;} +//nop; +t9 = 0x10000008; +at = 0x3; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L40ee20;} +//nop; +a1 = 0x10001a7c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ee14; +a1 = a1; +L40ee14: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40ee74; +//nop; +L40ee20: +t0 = 0x100003fc; +at = 0x3; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L40ee58;} +//nop; +a1 = 0x10001a80; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ee4c; +a1 = a1; +L40ee4c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40ee74; +//nop; +L40ee58: +a1 = 0x10001a84; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ee6c; +a1 = a1; +L40ee6c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40ee74: +t8 = 0x1000a24c; +at = 0x69; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L40eea8;} +//nop; +a1 = 0x10001a88; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40eea0; +a1 = a1; +L40eea0: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40eea8: +t4 = 0x10000108; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L40eefc;} +//nop; +a1 = 0x1000010c; +a0 = 0x10001a8c; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40eedc; +a0 = a0; +L40eedc: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40eef4; +a1 = s4; +L40eef4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40eefc: +t6 = 0x1000a520; +at = 0x1; +t6 = MEM_U32(t6 + 4); +//nop; +if (t6 != at) {//nop; +goto L40ef94;} +//nop; +t1 = 0x1000a1ec; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L40ef34;} +//nop; +MEM_U32(sp + 280) = t1; +goto L40efbc; +MEM_U32(sp + 280) = t1; +L40ef34: +t2 = 0x10000228; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L40ef60;} +//nop; +t5 = 0x10001a90; +//nop; +t5 = t5; +MEM_U32(sp + 280) = t5; +goto L40efbc; +MEM_U32(sp + 280) = t5; +L40ef60: +t7 = 0x1000a520; +t3 = s0 << 2; +t7 = MEM_U32(t7 + 8); +a1 = 0x6f; +t9 = t7 + t3; +a0 = MEM_U32(t9 + 0); +//nop; +//nop; +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40ef88; +//nop; +L40ef88: +// bdead 4006010b gp = MEM_U32(sp + 64); +MEM_U32(sp + 280) = v0; +goto L40efbc; +MEM_U32(sp + 280) = v0; +L40ef94: +t0 = 0x1000a520; +t8 = s0 << 2; +t0 = MEM_U32(t0 + 8); +//nop; +t4 = t0 + t8; +a0 = MEM_U32(t4 + 0); +a1 = 0x6f; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40efb4; +a1 = 0x6f; +L40efb4: +// bdead 4006010b gp = MEM_U32(sp + 64); +MEM_U32(sp + 280) = v0; +L40efbc: +a0 = 0x10001a98; +//nop; +a1 = MEM_U32(sp + 280); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40efd4; +a0 = a0; +L40efd4: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40efec; +a1 = s4; +L40efec: +// bdead 40060103 gp = MEM_U32(sp + 64); +at = 0x1; +t6 = 0x1000a36c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L40f1e8;} +//nop; +t1 = 0x10000008; +at = 0x2; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == at) {at = 0x3; +goto L40f02c;} +at = 0x3; +if (t1 != at) {//nop; +goto L40f1e8;} +//nop; +L40f02c: +s4 = 0x1000a184; +//nop; +s4 = MEM_U32(s4 + 0); +//nop; +if (s4 == 0) {at = 0x1; +goto L40f098;} +at = 0x1; +if (s4 == at) {at = 0x2; +goto L40f05c;} +at = 0x2; +if (s4 == at) {//nop; +goto L40f07c;} +//nop; +//nop; +goto L40f098; +//nop; +L40f05c: +a1 = 0x10001a9c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40f070; +a1 = a1; +L40f070: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40f098; +//nop; +L40f07c: +a1 = 0x10001aa4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40f090; +a1 = a1; +L40f090: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40f098: +t2 = 0x10000110; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L40f0d0;} +//nop; +a1 = 0x10001aac; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40f0c4; +a1 = a1; +L40f0c4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40f1b4; +//nop; +L40f0d0: +t5 = 0x1000a1ec; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40f120;} +//nop; +t7 = 0x10000228; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40f120;} +//nop; +t3 = 0x1000a520; +at = 0x1; +t3 = MEM_U32(t3 + 4); +//nop; +if (t3 != at) {//nop; +goto L40f120;} +//nop; +MEM_U32(sp + 268) = t5; +goto L40f14c; +MEM_U32(sp + 268) = t5; +L40f120: +t9 = 0x1000a520; +t0 = s0 << 2; +t9 = MEM_U32(t9 + 8); +a1 = 0x6f; +t8 = t9 + t0; +//nop; +a0 = MEM_U32(t8 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40f144; +//nop; +L40f144: +// bdead 4006000b gp = MEM_U32(sp + 64); +MEM_U32(sp + 268) = v0; +L40f14c: +//nop; +a0 = MEM_U32(sp + 268); +//nop; +v0 = f_make_ii_file_name(mem, sp, a0); +goto L40f15c; +//nop; +L40f15c: +// bdead 4006010b gp = MEM_U32(sp + 64); +MEM_U32(sp + 264) = v0; +a0 = 0x10001ab0; +//nop; +a1 = MEM_U32(sp + 264); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40f17c; +a0 = a0; +L40f17c: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40f194; +a1 = s4; +L40f194: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = MEM_U32(sp + 264); +//nop; +//nop; +//nop; +wrapper_free(mem, a0); +goto L40f1ac; +//nop; +L40f1ac: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40f1b4: +t4 = 0x10000120; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L40f1e8;} +//nop; +a1 = 0x10001ab4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40f1e0; +a1 = a1; +L40f1e0: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40f1e8: +t6 = 0x1000021c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +at = (int)t6 < (int)0x2; +if (at != 0) {//nop; +goto L40f240;} +//nop; +t1 = 0x1000a380; +a0 = 0x10001ab8; +//nop; +a1 = MEM_U32(t1 + 132); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40f220; +a0 = a0; +L40f220: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40f238; +a1 = s4; +L40f238: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40f240: +a1 = 0x10000400; +a0 = 0x10001abc; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40f25c; +a0 = a0; +L40f25c: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40f274; +a1 = s4; +L40f274: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a2f0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40f290; +//nop; +L40f290: +// bdead 40060183 gp = MEM_U32(sp + 64); +//nop; +t2 = 0x1000026c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L40f2e8;} +//nop; +a0 = 0x10001ac0; +//nop; +a1 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40f2c4; +a0 = a0; +L40f2c4: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40f2dc; +a1 = s4; +L40f2dc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40f308; +//nop; +L40f2e8: +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L40f300; +//nop; +L40f300: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40f308: +// bdead 40060103 s2 = zero; +L40f30c: +t7 = 0x100003e4; +at = 0x3; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L410450;} +//nop; +t3 = 0x1000a188; +at = 0x10000; +t3 = MEM_U32(t3 + 0); +//nop; +t5 = t3 & at; +if (t5 == 0) {//nop; +goto L40f630;} +//nop; +t9 = 0x1000a1e6; +at = 0x4d; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == at) {//nop; +goto L40f37c;} +//nop; +t0 = 0x10000240; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L40f37c;} +//nop; +t8 = t3 & 0x4; +if (t8 == 0) {//nop; +goto L40f3b0;} +//nop; +L40f37c: +t4 = 0x1000a520; +t6 = s0 << 2; +t4 = MEM_U32(t4 + 8); +//nop; +t1 = t4 + t6; +a0 = MEM_U32(t1 + 0); +a1 = 0x50; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40f39c; +a1 = 0x50; +L40f39c: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40f3e0; +MEM_U32(at + 0) = v0; +L40f3b0: +t2 = 0x1000a380; +a1 = 0x10001ac4; +//nop; +a0 = MEM_U32(t2 + 124); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40f3cc; +a1 = a1; +L40f3cc: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +L40f3e0: +a1 = 0x1000009c; +at = 0x1000a560; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +MEM_U32(at + 4) = zero; +f_addstr(mem, sp, a0, a1); +goto L40f3fc; +MEM_U32(at + 4) = zero; +L40f3fc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L40f41c; +//nop; +L40f41c: +// bdead 40060103 gp = MEM_U32(sp + 64); +a2 = zero; +a1 = 0x1000a1f4; +a0 = 0x10001ac8; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40f43c; +a0 = a0; +L40f43c: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40f454; +a1 = s4; +L40f454: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x1; +t7 = 0x10000004; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == at) {at = 0x2; +goto L40f47c;} +at = 0x2; +if (t7 != at) {//nop; +goto L40f49c;} +//nop; +L40f47c: +a1 = 0x10001acc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40f490; +a1 = a1; +L40f490: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40f4f0; +//nop; +L40f49c: +t5 = 0x10000004; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L40f4d4;} +//nop; +a1 = 0x10001ad4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40f4c8; +a1 = a1; +L40f4c8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L40f4f0; +//nop; +L40f4d4: +a1 = 0x10001adc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40f4e8; +a1 = a1; +L40f4e8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40f4f0: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a2a0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40f504; +//nop; +L40f504: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +t9 = 0x1000a1f8; +a0 = 0x1000009c; +t9 = MEM_U32(t9 + 0); +a1 = 0x1000a560; +MEM_U32(sp + 16) = t9; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L40f534; +a3 = zero; +L40f534: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +t0 = 0x10000240; +at = 0x1000a1e8; +t0 = MEM_U32(t0 + 0); +MEM_U32(at + 0) = v0; +if (t0 != 0) {//nop; +goto L40f570;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40f568; +//nop; +L40f568: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40f570: +t3 = 0x1000a1e8; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L40f604;} +//nop; +t8 = 0x10000404; +at = 0x10000404; +t8 = MEM_U32(t8 + 0); +t6 = 0x1000a1e6; +t4 = t8 + 0x1; +t6 = MEM_U8(t6 + 0); +MEM_U32(at + 0) = t4; +at = 0x4d; +if (t6 == at) {//nop; +goto L41977c;} +//nop; +t1 = 0x10000240; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L41977c;} +//nop; +t2 = 0x1000a188; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +t7 = t2 & 0x4; +if (t7 != 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40f5f8; +//nop; +L40f5f8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L40f604: +t5 = 0x1000a1e6; +at = 0x4d; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {//nop; +goto L41977c;} +//nop; +t9 = 0x1000a1f4; +at = 0x1000a1f0; +t9 = MEM_U32(t9 + 0); +//nop; +MEM_U32(at + 0) = t9; +L40f630: +t0 = 0x1000a1a0; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L40f6c4;} +//nop; +t3 = 0x100002b4; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L40f6c4;} +//nop; +t8 = 0x1000043c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L40f6c4;} +//nop; +t4 = 0x1000a24c; +at = 0x69; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == at) {//nop; +goto L40f6c4;} +//nop; +t6 = 0x100003dc; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L40f6c4;} +//nop; +t1 = 0x1000a188; +at = 0x10000; +t1 = MEM_U32(t1 + 0); +//nop; +t2 = t1 & at; +if (t2 == 0) {//nop; +goto L40f720;} +//nop; +L40f6c4: +t7 = 0x10000008; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L40f720;} +//nop; +a1 = 0x100000a0; +at = 0x1000a560; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +MEM_U32(at + 4) = zero; +f_addstr(mem, sp, a0, a1); +goto L40f6f8; +MEM_U32(at + 4) = zero; +L40f6f8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L40f718; +//nop; +L40f718: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40f720: +t5 = 0x1000a1e6; +at = 0x66; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L40f798;} +//nop; +t9 = 0x10000278; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L40f764;} +//nop; +t0 = 0x1000a380; +at = 0x1000a1f4; +t3 = MEM_U32(t0 + 12); +MEM_U32(at + 0) = t3; +goto L40f898; +MEM_U32(at + 0) = t3; +L40f764: +t8 = 0x1000a520; +t4 = s0 << 2; +t8 = MEM_U32(t8 + 8); +//nop; +t6 = t8 + t4; +a0 = MEM_U32(t6 + 0); +a1 = 0x42; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40f784; +a1 = 0x42; +L40f784: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40f898; +MEM_U32(at + 0) = v0; +L40f798: +t1 = 0x1000026c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L40f7c8;} +//nop; +t2 = 0x10000258; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L40f7dc;} +//nop; +L40f7c8: +t7 = 0x10000124; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {at = 0x1000a1f4; +goto L40f7e8;} +L40f7dc: +at = 0x1000a1f4; +MEM_U32(at + 0) = zero; +goto L40f898; +MEM_U32(at + 0) = zero; +L40f7e8: +t5 = 0x10000258; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40f838;} +//nop; +t9 = 0x1000a520; +t0 = s0 << 2; +t9 = MEM_U32(t9 + 8); +a1 = 0x7; +t3 = t9 + t0; +//nop; +a0 = MEM_U32(t3 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40f824; +//nop; +L40f824: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40f898; +MEM_U32(at + 0) = v0; +L40f838: +t8 = 0x10000240; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L40f884;} +//nop; +t4 = 0x1000a520; +t6 = s0 << 2; +t4 = MEM_U32(t4 + 8); +//nop; +t1 = t4 + t6; +a0 = MEM_U32(t1 + 0); +a1 = 0x42; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40f870; +a1 = 0x42; +L40f870: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L40f898; +MEM_U32(at + 0) = v0; +L40f884: +t2 = 0x1000a380; +at = 0x1000a1f4; +t7 = MEM_U32(t2 + 12); +//nop; +MEM_U32(at + 0) = t7; +L40f898: +t5 = 0x1000a1f4; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40f924;} +//nop; +//nop; +a0 = t5; +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L40f8c0; +//nop; +L40f8c0: +// bdead 4006010b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L40f924;} +//nop; +t9 = 0x10001ae4; +t0 = 0x1000a1f4; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +t0 = MEM_U32(t0 + 0); +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t0; +f_error(mem, sp, a0, a1, a2, a3); +goto L40f904; +MEM_U32(sp + 24) = t0; +L40f904: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40f91c; +//nop; +L40f91c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40f924: +t3 = 0x1000a1a0; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L40f984;} +//nop; +t8 = 0x1000a24c; +at = 0x69; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == at) {//nop; +goto L40f984;} +//nop; +t4 = 0x100003dc; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L40f984;} +//nop; +t6 = 0x100002b4; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L40fa2c;} +//nop; +L40f984: +t1 = 0x1000043c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L40fa2c;} +//nop; +t2 = 0x1000a1a4; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L40f9f8;} +//nop; +t7 = 0x1000a24c; +at = 0x63; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 == at) {at = 0x73; +goto L40f9dc;} +at = 0x73; +if (t7 == at) {at = 0x70; +goto L40f9dc;} +at = 0x70; +if (t7 != at) {//nop; +goto L40f9f8;} +//nop; +L40f9dc: +a1 = 0x10001b10; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40f9f0; +a1 = a1; +L40f9f0: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40f9f8: +t5 = 0x1000a24c; +//nop; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 != s0) {//nop; +goto L40fa2c;} +//nop; +a1 = 0x10001b18; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40fa24; +a1 = a1; +L40fa24: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40fa2c: +t9 = 0x10000008; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L40fd1c;} +//nop; +t0 = 0x10000234; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L40fa78;} +//nop; +a1 = 0x10001b20; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40fa70; +a1 = a1; +L40fa70: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40fa78: +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L40fb8c;} +//nop; +t8 = 0x1000043c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L40fb34;} +//nop; +t4 = 0x1000a188; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +t6 = t4 & 0x1; +if (t6 != 0) {//nop; +goto L40fb34;} +//nop; +a1 = 0x10001b24; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40fad8; +a1 = a1; +L40fad8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001b2c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40faf4; +a1 = a1; +L40faf4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001b3c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40fb10; +a1 = a1; +L40fb10: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a2b0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40fb2c; +//nop; +L40fb2c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40fb34: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a2c0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40fb48; +//nop; +L40fb48: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001b4c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40fb64; +a1 = a1; +L40fb64: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000400; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L40fb84; +//nop; +L40fb84: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40fb8c: +t1 = 0x10000004; +at = 0x1; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == at) {at = 0x2; +goto L40fbac;} +at = 0x2; +if (t1 != at) {//nop; +goto L40fbcc;} +//nop; +L40fbac: +a1 = 0x10001b50; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40fbc0; +a1 = a1; +L40fbc0: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40fc38; +//nop; +L40fbcc: +t2 = 0x10000004; +at = 0x3; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L40fc04;} +//nop; +a1 = 0x10001b58; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40fbf8; +a1 = a1; +L40fbf8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L40fc38; +//nop; +L40fc04: +t7 = 0x10000004; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L40fc38;} +//nop; +a1 = 0x10001b60; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40fc30; +a1 = a1; +L40fc30: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40fc38: +t5 = 0x100003a0; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L40fc6c;} +//nop; +a1 = 0x10001b68; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40fc64; +a1 = a1; +L40fc64: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L40fc6c: +a1 = 0x1000a1fc; +a0 = 0x10001b78; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40fc88; +a0 = a0; +L40fc88: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40fca0; +a1 = s4; +L40fca0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a310; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40fcbc; +//nop; +L40fcbc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t9 = 0x1000021c; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +at = (int)t9 < (int)0x2; +if (at != 0) {//nop; +goto L40fd1c;} +//nop; +t0 = 0x1000a380; +a0 = 0x10001b7c; +//nop; +a1 = MEM_U32(t0 + 132); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L40fcfc; +a0 = a0; +L40fcfc: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L40fd14; +a1 = s4; +L40fd14: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40fd1c: +t3 = 0x1000043c; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L40fd50;} +//nop; +t8 = 0x1000a188; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +t4 = t8 & 0x1; +if (t4 == 0) {//nop; +goto L40fd6c;} +//nop; +L40fd50: +t6 = 0x1000a380; +//nop; +a0 = MEM_U32(t6 + 8); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L40fd64; +//nop; +L40fd64: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40fd6c: +t1 = 0x1000043c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L40fda0;} +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a260; +//nop; +f_addlist(mem, sp, a0, a1); +goto L40fd98; +//nop; +L40fd98: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L40fda0: +t2 = 0x1000026c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L40fdcc;} +//nop; +s4 = 0x1000a1f0; +//nop; +s4 = MEM_U32(s4 + 0); +//nop; +goto L40fdd0; +//nop; +L40fdcc: +s4 = zero; +L40fdd0: +t7 = 0x1000a1f8; +a0 = 0x100000a0; +a1 = 0x1000a560; +a3 = 0x1000a1f4; +//nop; +t7 = MEM_U32(t7 + 0); +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = MEM_U32(a3 + 0); +a2 = s4; +MEM_U32(sp + 16) = t7; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L40fe00; +MEM_U32(sp + 16) = t7; +L40fe00: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +t5 = 0x10000108; +at = 0x1000a1e8; +t5 = MEM_U32(t5 + 0); +MEM_U32(at + 0) = v0; +if (t5 == 0) {//nop; +goto L40ff80;} +//nop; +t9 = 0x1000a1e8; +at = 0xfa; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {at = 0x1000a1e8; +goto L40ff80;} +at = 0x1000a1e8; +t3 = 0x1000a1ec; +MEM_U32(at + 0) = zero; +at = 0x10000128; +t3 = MEM_U32(t3 + 0); +t0 = 0x1; +if (t3 == 0) {MEM_U32(at + 0) = t0; +goto L40fe8c;} +MEM_U32(at + 0) = t0; +t8 = 0x10000228; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L40fe8c;} +//nop; +t4 = 0x1000a520; +at = 0x1; +t4 = MEM_U32(t4 + 4); +//nop; +if (t4 != at) {//nop; +goto L40fe8c;} +//nop; +MEM_U32(sp + 260) = t3; +goto L40ff1c; +MEM_U32(sp + 260) = t3; +L40fe8c: +t6 = 0x1000a24c; +at = 0x3f; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L40fef0;} +//nop; +t1 = 0x1000a1e6; +at = 0x62; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 == at) {//nop; +goto L40fef0;} +//nop; +t2 = 0x10000240; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L40fef0;} +//nop; +t7 = 0x1000a380; +at = 0x10000410; +t5 = MEM_U32(t7 + 48); +//nop; +MEM_U32(sp + 260) = t5; +MEM_U32(at + 0) = t5; +goto L40ff1c; +MEM_U32(at + 0) = t5; +L40fef0: +t9 = 0x1000a520; +t0 = s0 << 2; +t9 = MEM_U32(t9 + 8); +a1 = 0x6f; +t8 = t9 + t0; +//nop; +a0 = MEM_U32(t8 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L40ff14; +//nop; +L40ff14: +// bdead 4006000b gp = MEM_U32(sp + 64); +MEM_U32(sp + 260) = v0; +L40ff1c: +//nop; +a0 = MEM_U32(sp + 280); +//nop; +v0 = f_touch(mem, sp, a0); +goto L40ff2c; +//nop; +L40ff2c: +// bdead 4006010b gp = MEM_U32(sp + 64); +if ((int)v0 >= 0) {//nop; +goto L40ff50;} +//nop; +t4 = 0x10000404; +at = 0x10000404; +t4 = MEM_U32(t4 + 0); +//nop; +t3 = t4 + 0x1; +MEM_U32(at + 0) = t3; +L40ff50: +t6 = 0x1000a520; +at = 0x1; +t6 = MEM_U32(t6 + 4); +//nop; +if (t6 != at) {//nop; +goto L40ff80;} +//nop; +t1 = 0x10000228; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L41b960;} +//nop; +L40ff80: +t2 = 0x1000026c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L41977c;} +//nop; +t7 = 0x1000a1e8; +at = 0xff; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {at = 0x10000374; +goto L40ffd8;} +at = 0x10000374; +a1 = 0x10001b84; +//nop; +t5 = 0x1; +a0 = 0x1000a470; +MEM_U32(at + 0) = t5; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L40ffcc; +a1 = a1; +L40ffcc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L4100d0; +//nop; +L40ffd8: +t9 = 0x1000a1e8; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L4100d0;} +//nop; +t0 = 0x10000404; +at = 0x10000404; +t0 = MEM_U32(t0 + 0); +t4 = 0x100002b0; +t8 = t0 + 0x1; +t4 = MEM_U32(t4 + 0); +MEM_U32(at + 0) = t8; +at = 0x1; +if (t4 != at) {//nop; +goto L41007c;} +//nop; +t3 = 0x1000a1a0; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L41007c;} +//nop; +t6 = 0x1000a24c; +at = 0x69; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == at) {//nop; +goto L41007c;} +//nop; +t1 = 0x10000008; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L41007c;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410074; +//nop; +L410074: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L41007c: +t2 = 0x10000240; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4100a8; +//nop; +L4100a8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4100c4; +//nop; +L4100c4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L4100d0: +t7 = 0x1000043c; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L410100;} +//nop; +t5 = 0x10000240; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L410130;} +//nop; +L410100: +t9 = 0x100003dc; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L410130;} +//nop; +t0 = 0x100002b4; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L41014c;} +//nop; +L410130: +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410144; +//nop; +L410144: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L41014c: +t8 = 0x1000a1f4; +at = 0x1000a1f0; +t4 = 0x1000a1e6; +t8 = MEM_U32(t8 + 0); +t4 = MEM_U8(t4 + 0); +MEM_U32(at + 0) = t8; +at = 0x66; +if (t4 != at) {//nop; +goto L410394;} +//nop; +t3 = 0x10000278; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {at = 0x1000a560; +goto L410394;} +at = 0x1000a560; +a1 = 0x10001b90; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4101a0; +a1 = a1; +L4101a0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4101c0; +//nop; +L4101c0: +// bdead 40060003 gp = MEM_U32(sp + 64); +t1 = s0 << 2; +t6 = 0x1000a520; +//nop; +t6 = MEM_U32(t6 + 8); +a1 = 0x55; +t2 = t6 + t1; +a0 = MEM_U32(t2 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L4101e8; +//nop; +L4101e8: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +t7 = 0x1000a1f4; +MEM_U32(at + 0) = v0; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L410280;} +//nop; +//nop; +a0 = t7; +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L41021c; +//nop; +L41021c: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L410280;} +//nop; +t9 = 0x1000a1f4; +t5 = 0x10001b98; +t9 = MEM_U32(t9 + 0); +t5 = t5; +MEM_U32(sp + 24) = t9; +//nop; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L410260; +MEM_U32(sp + 16) = zero; +L410260: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L410278; +//nop; +L410278: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L410280: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L410298; +//nop; +L410298: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000f4; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L4102c0; +MEM_U32(sp + 16) = zero; +L4102c0: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41035c;} +//nop; +t0 = 0x10000404; +t4 = 0x10000240; +t0 = MEM_U32(t0 + 0); +at = 0x10000404; +t4 = MEM_U32(t4 + 0); +t8 = t0 + 0x1; +if (t4 != 0) {MEM_U32(at + 0) = t8; +goto L410324;} +MEM_U32(at + 0) = t8; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410300; +//nop; +L410300: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41031c; +//nop; +L41031c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L410324: +t3 = 0x1000a250; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410350; +//nop; +L410350: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L41035c: +t6 = 0x10000240; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410388; +//nop; +L410388: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L410394: +t1 = 0x1000a1f4; +at = 0x1000a1f0; +t2 = 0x1000a1e6; +t1 = MEM_U32(t1 + 0); +t2 = MEM_U8(t2 + 0); +MEM_U32(at + 0) = t1; +at = 0x66; +if (t2 == at) {//nop; +goto L41977c;} +//nop; +t7 = 0x1000a36c; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L414b54;} +//nop; +t5 = 0x10000008; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L414b54;} +//nop; +t9 = 0x10000214; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L410430;} +//nop; +t0 = 0x10000124; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L410430;} +//nop; +t8 = 0x10000128; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L414b54;} +//nop; +L410430: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410444; +//nop; +L410444: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L410450: +t4 = 0x10000004; +at = 0x1000a560; +t4 = MEM_U32(t4 + 0); +MEM_U32(at + 4) = zero; +if (t4 == 0) {//nop; +goto L410474;} +//nop; +s4 = 0x10001bc4; +s4 = s4; +goto L410480; +s4 = s4; +L410474: +s4 = 0x10001bcc; +//nop; +s4 = s4; +L410480: +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L410490; +a1 = s4; +L410490: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t3 = 0x10000234; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L4104cc;} +//nop; +a1 = 0x10001bd4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4104c4; +a1 = a1; +L4104c4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4104cc: +t6 = 0x1000a188; +at = 0x10000; +t6 = MEM_U32(t6 + 0); +//nop; +t1 = t6 & at; +if (t1 == 0) {//nop; +goto L410504;} +//nop; +a1 = 0x10001bd8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4104fc; +a1 = a1; +L4104fc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L410504: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a310; +//nop; +f_addlist(mem, sp, a0, a1); +goto L410518; +//nop; +L410518: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t2 = 0x1000a14c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L410554;} +//nop; +a1 = 0x10001be0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41054c; +a1 = a1; +L41054c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L410554: +t7 = 0x1000a148; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L410588;} +//nop; +a1 = 0x10001bec; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L410580; +a1 = a1; +L410580: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L410588: +t5 = 0x100003a0; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L4105b8;} +//nop; +t9 = 0x10000004; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L4105d4;} +//nop; +L4105b8: +a1 = 0x10001bf8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4105cc; +a1 = a1; +L4105cc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4105d4: +t0 = 0x10000004; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {at = 0x3; +goto L41064c;} +at = 0x3; +if (t0 != at) {//nop; +goto L410614;} +//nop; +a1 = 0x10001c08; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L410608; +a1 = a1; +L410608: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L410630; +//nop; +L410614: +a1 = 0x10001c10; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L410628; +a1 = a1; +L410628: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L410630: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a2b0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L410644; +//nop; +L410644: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L41064c: +t8 = 0x1000a1e6; +at = 0x66; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L4106c4;} +//nop; +t4 = 0x10000278; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L410690;} +//nop; +t3 = 0x1000a380; +at = 0x1000a1f4; +t6 = MEM_U32(t3 + 12); +MEM_U32(at + 0) = t6; +goto L410728; +MEM_U32(at + 0) = t6; +L410690: +t1 = 0x1000a520; +t2 = s0 << 2; +t1 = MEM_U32(t1 + 8); +//nop; +t7 = t1 + t2; +a0 = MEM_U32(t7 + 0); +a1 = 0x42; +v0 = f_mksuf(mem, sp, a0, a1); +goto L4106b0; +a1 = 0x42; +L4106b0: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L410728; +MEM_U32(at + 0) = v0; +L4106c4: +t5 = 0x10000240; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L410714;} +//nop; +t9 = 0x1000a520; +t0 = s0 << 2; +t9 = MEM_U32(t9 + 8); +a1 = 0x42; +t8 = t9 + t0; +//nop; +a0 = MEM_U32(t8 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L410700; +//nop; +L410700: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L410728; +MEM_U32(at + 0) = v0; +L410714: +t4 = 0x1000a380; +at = 0x1000a1f4; +t3 = MEM_U32(t4 + 12); +//nop; +MEM_U32(at + 0) = t3; +L410728: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L41073c; +//nop; +L41073c: +// bdead 4006010b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L4107a0;} +//nop; +t1 = 0x1000a1f4; +t6 = 0x10001c18; +//nop; +t1 = MEM_U32(t1 + 0); +t6 = t6; +MEM_U32(sp + 20) = t6; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t1; +f_error(mem, sp, a0, a1, a2, a3); +goto L410780; +MEM_U32(sp + 24) = t1; +L410780: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L410798; +//nop; +L410798: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L4107a0: +a1 = 0x1000a1fc; +a0 = 0x10001c44; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4107bc; +a0 = a0; +L4107bc: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L4107d4; +a1 = s4; +L4107d4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t2 = 0x10000240; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L410838;} +//nop; +t7 = 0x1000a1a0; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L410838;} +//nop; +t5 = 0x1000a24c; +at = 0x69; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {//nop; +goto L410838;} +//nop; +s2 = 0x1000a1f0; +//nop; +s2 = MEM_U32(s2 + 0); +//nop; +goto L410858; +//nop; +L410838: +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L410850; +//nop; +L410850: +// bdead 40060003 gp = MEM_U32(sp + 64); +s2 = zero; +L410858: +t9 = 0x1000a1f8; +a0 = 0x10000098; +t9 = MEM_U32(t9 + 0); +a1 = 0x1000a560; +a3 = 0x1000a1f4; +MEM_U32(sp + 16) = t9; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = MEM_U32(a3 + 0); +a2 = s2; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L410888; +a2 = s2; +L410888: +// bdead 4006018b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1e8; +t0 = 0x1000a1e8; +MEM_U32(at + 0) = v0; +t0 = MEM_U32(t0 + 0); +at = 0xff; +if (t0 != at) {at = 0x10000374; +goto L4108d4;} +at = 0x10000374; +a1 = 0x10001c48; +//nop; +t8 = 0x1; +a0 = 0x1000a470; +MEM_U32(at + 0) = t8; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4108c8; +a1 = a1; +L4108c8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L410b34; +//nop; +L4108d4: +t4 = 0x1000a1e8; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L410b34;} +//nop; +t3 = 0x100002a8; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L410a74;} +//nop; +t6 = 0x1000a244; +t1 = 0x1000a248; +t6 = MEM_U32(t6 + 0); +t1 = MEM_U32(t1 + 0); +//nop; +at = (int)t6 < (int)t1; +if (at == 0) {//nop; +goto L410a58;} +//nop; +t7 = 0x1000a520; +at = 0x1000a244; +t7 = MEM_U32(t7 + 8); +t2 = t6 + 0x1; +t5 = s0 << 2; +MEM_U32(at + 0) = t2; +t9 = t7 + t5; +a0 = 0x1000a23c; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = 0x1; +v0 = f_edit_src(mem, sp, a0, a1, a2); +goto L410958; +a2 = 0x1; +L410958: +// bdead 4006008b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L410998;} +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_show_err(mem, sp, a0); +goto L410978; +//nop; +L410978: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L410990; +//nop; +L410990: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L410998: +t0 = 0x1000a1a0; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L4109e4;} +//nop; +t8 = 0x1000a24c; +at = 0x69; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == at) {//nop; +goto L4109e4;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4109dc; +//nop; +L4109dc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4109e4: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4109f8; +//nop; +L4109f8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410a14; +//nop; +L410a14: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410a30; +//nop; +L410a30: +// bdead 40060103 gp = MEM_U32(sp + 64); +t3 = s0 << 2; +t4 = 0x1000a520; +at = 0x1000a1f0; +t4 = MEM_U32(t4 + 8); +//nop; +t1 = t4 + t3; +t6 = MEM_U32(t1 + 0); +MEM_U32(at + 0) = t6; +goto L40a8e0; +MEM_U32(at + 0) = t6; +L410a58: +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_show_err(mem, sp, a0); +goto L410a6c; +//nop; +L410a6c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L410a74: +t2 = 0x10000404; +t5 = 0x10000240; +t2 = MEM_U32(t2 + 0); +at = 0x10000404; +t5 = MEM_U32(t5 + 0); +t7 = t2 + 0x1; +if (t5 != 0) {MEM_U32(at + 0) = t7; +goto L410ae0;} +MEM_U32(at + 0) = t7; +t9 = 0x1000a1a0; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L410ae0;} +//nop; +t0 = 0x1000a24c; +at = 0x69; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 == at) {//nop; +goto L410ae0;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410ad8; +//nop; +L410ad8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L410ae0: +t8 = 0x10000240; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410b0c; +//nop; +L410b0c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410b28; +//nop; +L410b28: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L410b34: +t4 = 0x100002a8; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L410b68;} +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410b60; +//nop; +L410b60: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L410b68: +t3 = 0x10000240; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L410bcc;} +//nop; +t1 = 0x1000a1a0; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L410bcc;} +//nop; +t6 = 0x1000a24c; +at = 0x69; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == at) {//nop; +goto L410bcc;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410bc4; +//nop; +L410bc4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L410bcc: +t2 = 0x1000a1f4; +at = 0x1000a1f0; +t7 = 0x1000a1e6; +t2 = MEM_U32(t2 + 0); +t7 = MEM_U8(t7 + 0); +MEM_U32(at + 0) = t2; +at = 0x66; +if (t7 != at) {//nop; +goto L410e08;} +//nop; +t5 = 0x10000278; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {at = 0x1000a560; +goto L410e08;} +at = 0x1000a560; +a1 = 0x10001c54; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L410c20; +a1 = a1; +L410c20: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L410c40; +//nop; +L410c40: +// bdead 40060003 gp = MEM_U32(sp + 64); +t0 = s0 << 2; +t9 = 0x1000a520; +a1 = 0x55; +t9 = MEM_U32(t9 + 8); +//nop; +t8 = t9 + t0; +//nop; +a0 = MEM_U32(t8 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L410c6c; +//nop; +L410c6c: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a0 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L410c90; +//nop; +L410c90: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L410cf4;} +//nop; +t3 = 0x1000a1f4; +t4 = 0x10001c5c; +//nop; +t3 = MEM_U32(t3 + 0); +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L410cd4; +MEM_U32(sp + 24) = t3; +L410cd4: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L410cec; +//nop; +L410cec: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L410cf4: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L410d0c; +//nop; +L410d0c: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000f4; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L410d34; +MEM_U32(sp + 16) = zero; +L410d34: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L410dd0;} +//nop; +t1 = 0x10000404; +t2 = 0x10000240; +t1 = MEM_U32(t1 + 0); +at = 0x10000404; +t2 = MEM_U32(t2 + 0); +t6 = t1 + 0x1; +if (t2 != 0) {MEM_U32(at + 0) = t6; +goto L410d98;} +MEM_U32(at + 0) = t6; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410d74; +//nop; +L410d74: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410d90; +//nop; +L410d90: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L410d98: +t7 = 0x1000a250; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410dc4; +//nop; +L410dc4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L410dd0: +t5 = 0x10000240; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L410dfc; +//nop; +L410dfc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L410e08: +t9 = 0x1000a1e6; +at = 0x66; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == at) {//nop; +goto L41977c;} +//nop; +t0 = 0x1000a36c; +at = 0x1; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L414b54;} +//nop; +t8 = 0x10000008; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L414b54;} +//nop; +t4 = 0x10000214; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L41977c;} +//nop; +t3 = 0x10000124; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L41977c;} +//nop; +t1 = 0x10000128; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L414b54;} +//nop; +//nop; +goto L41977c; +//nop; +L410ea0: +at = 0x1000a560; +a1 = 0x10001c88; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L410ebc; +a1 = a1; +L410ebc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t6 = 0x10000234; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L410ef8;} +//nop; +a1 = 0x10001c90; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L410ef0; +a1 = a1; +L410ef0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L410ef8: +a1 = 0x10001c94; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L410f0c; +a1 = a1; +L410f0c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000400; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L410f2c; +//nop; +L410f2c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a320; +//nop; +f_addlist(mem, sp, a0, a1); +goto L410f48; +//nop; +L410f48: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L410f68; +//nop; +L410f68: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x66; +t2 = 0x1000a1e6; +//nop; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L410fa0;} +//nop; +t7 = 0x10000278; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L410fb8;} +//nop; +L410fa0: +t5 = 0x10000240; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L411068;} +//nop; +L410fb8: +t9 = 0x1000a520; +t0 = s0 << 2; +t9 = MEM_U32(t9 + 8); +a1 = 0x42; +t8 = t9 + t0; +//nop; +a0 = MEM_U32(t8 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L410fdc; +//nop; +L410fdc: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a0 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L411000; +//nop; +L411000: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L41107c;} +//nop; +t3 = 0x1000a1f4; +t4 = 0x10001c98; +//nop; +t3 = MEM_U32(t3 + 0); +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L411044; +MEM_U32(sp + 24) = t3; +L411044: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41105c; +//nop; +L41105c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L41107c; +//nop; +L411068: +t1 = 0x1000a380; +at = 0x1000a1f4; +t6 = MEM_U32(t1 + 12); +//nop; +MEM_U32(at + 0) = t6; +L41107c: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L411094; +//nop; +L411094: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001cc4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4110b0; +a1 = a1; +L4110b0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1fc; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4110d0; +//nop; +L4110d0: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +t2 = 0x1000a1f8; +a0 = 0x100000a4; +a1 = 0x1000a560; +//nop; +t2 = MEM_U32(t2 + 0); +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = t2; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L411100; +MEM_U32(sp + 16) = t2; +L411100: +// bdead 4006018b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41139c;} +//nop; +t7 = 0x100002a8; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L4112c4;} +//nop; +t5 = 0x1000a244; +t9 = 0x1000a248; +t5 = MEM_U32(t5 + 0); +t9 = MEM_U32(t9 + 0); +//nop; +at = (int)t5 < (int)t9; +if (at == 0) {//nop; +goto L4112a8;} +//nop; +t8 = 0x1000a520; +at = 0x1000a244; +t8 = MEM_U32(t8 + 8); +a0 = 0x1000a23c; +t0 = t5 + 0x1; +t4 = s0 << 2; +//nop; +MEM_U32(at + 0) = t0; +t3 = t8 + t4; +a1 = MEM_U32(t3 + 0); +a0 = MEM_U32(a0 + 0); +a2 = 0x2; +v0 = f_edit_src(mem, sp, a0, a1, a2); +goto L411178; +a2 = 0x2; +L411178: +// bdead 4006008b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4111b8;} +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_show_err(mem, sp, a0); +goto L411198; +//nop; +L411198: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4111b0; +//nop; +L4111b0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4111b8: +t1 = 0x10000270; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L411234;} +//nop; +t6 = 0x1000a1a0; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L411234;} +//nop; +t2 = 0x1000a24c; +at = 0x69; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == at) {//nop; +goto L411234;} +//nop; +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L411234;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41122c; +//nop; +L41122c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L411234: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411248; +//nop; +L411248: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411264; +//nop; +L411264: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411280; +//nop; +L411280: +// bdead 40060103 gp = MEM_U32(sp + 64); +t5 = s0 << 2; +t9 = 0x1000a520; +at = 0x1000a1f0; +t9 = MEM_U32(t9 + 8); +//nop; +t0 = t9 + t5; +t8 = MEM_U32(t0 + 0); +MEM_U32(at + 0) = t8; +goto L40a8e0; +MEM_U32(at + 0) = t8; +L4112a8: +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_show_err(mem, sp, a0); +goto L4112bc; +//nop; +L4112bc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L4112c4: +t4 = 0x10000404; +t1 = 0x10000270; +t4 = MEM_U32(t4 + 0); +at = 0x10000404; +t1 = MEM_U32(t1 + 0); +t3 = t4 + 0x1; +if (t1 != 0) {MEM_U32(at + 0) = t3; +goto L411348;} +MEM_U32(at + 0) = t3; +t6 = 0x1000a1a0; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L411348;} +//nop; +t2 = 0x1000a24c; +at = 0x69; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == at) {//nop; +goto L411348;} +//nop; +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L411348;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411340; +//nop; +L411340: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L411348: +t9 = 0x10000240; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411374; +//nop; +L411374: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411390; +//nop; +L411390: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L41139c: +t5 = 0x100002a8; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L4113d0;} +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4113c8; +//nop; +L4113c8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L4113d0: +t0 = 0x10000270; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L41144c;} +//nop; +t8 = 0x1000a1a0; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L41144c;} +//nop; +t4 = 0x1000a24c; +at = 0x69; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == at) {//nop; +goto L41144c;} +//nop; +t3 = 0x10000240; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L41144c;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411444; +//nop; +L411444: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L41144c: +t1 = 0x1000a1f4; +at = 0x1000a1f0; +t6 = 0x1000a1e6; +t1 = MEM_U32(t1 + 0); +t6 = MEM_U8(t6 + 0); +MEM_U32(at + 0) = t1; +at = 0x66; +if (t6 != at) {//nop; +goto L411688;} +//nop; +t2 = 0x10000278; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {at = 0x1000a560; +goto L411688;} +at = 0x1000a560; +a1 = 0x10001cc8; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4114a0; +a1 = a1; +L4114a0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4114c0; +//nop; +L4114c0: +// bdead 40060003 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t7 = 0x1000a520; +a1 = 0x55; +t7 = MEM_U32(t7 + 8); +//nop; +t5 = t7 + t9; +//nop; +a0 = MEM_U32(t5 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L4114ec; +//nop; +L4114ec: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a0 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L411510; +//nop; +L411510: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L411574;} +//nop; +t8 = 0x1000a1f4; +t0 = 0x10001cd0; +//nop; +t8 = MEM_U32(t8 + 0); +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t8; +f_error(mem, sp, a0, a1, a2, a3); +goto L411554; +MEM_U32(sp + 24) = t8; +L411554: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41156c; +//nop; +L41156c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L411574: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41158c; +//nop; +L41158c: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000f4; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L4115b4; +MEM_U32(sp + 16) = zero; +L4115b4: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L411650;} +//nop; +t4 = 0x10000404; +t1 = 0x10000240; +t4 = MEM_U32(t4 + 0); +at = 0x10000404; +t1 = MEM_U32(t1 + 0); +t3 = t4 + 0x1; +if (t1 != 0) {MEM_U32(at + 0) = t3; +goto L411618;} +MEM_U32(at + 0) = t3; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4115f4; +//nop; +L4115f4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411610; +//nop; +L411610: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L411618: +t6 = 0x1000a250; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411644; +//nop; +L411644: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L411650: +t2 = 0x10000240; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41167c; +//nop; +L41167c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L411688: +t7 = 0x1000a1e6; +at = 0x66; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L414b54;} +//nop; +//nop; +goto L41977c; +//nop; +L4116a8: +at = 0x1000a560; +a1 = 0x10001cfc; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4116c4; +a1 = a1; +L4116c4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t9 = 0x10000234; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L411700;} +//nop; +a1 = 0x10001d04; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4116f8; +a1 = a1; +L4116f8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L411700: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a408; +//nop; +f_addlist(mem, sp, a0, a1); +goto L411714; +//nop; +L411714: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L411734; +//nop; +L411734: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x66; +t5 = 0x1000a1e6; +//nop; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {//nop; +goto L41176c;} +//nop; +t0 = 0x10000240; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L4117cc;} +//nop; +L41176c: +t8 = 0x1000a520; +t4 = s0 << 2; +t8 = MEM_U32(t8 + 8); +//nop; +t3 = t8 + t4; +a0 = MEM_U32(t3 + 0); +a1 = 0x3; +v0 = f_mksuf(mem, sp, a0, a1); +goto L41178c; +a1 = 0x3; +L41178c: +// bdead 4006000b gp = MEM_U32(sp + 64); +t6 = s0 << 2; +t1 = 0x1000a520; +at = 0x1000a1f4; +t1 = MEM_U32(t1 + 8); +//nop; +MEM_U32(at + 0) = v0; +t2 = t1 + t6; +a0 = MEM_U32(t2 + 0); +a1 = 0x4; +v0 = f_mksuf(mem, sp, a0, a1); +goto L4117b8; +a1 = 0x4; +L4117b8: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a218; +MEM_U32(at + 0) = v0; +goto L4117f0; +MEM_U32(at + 0) = v0; +L4117cc: +t7 = 0x1000a380; +at = 0x1000a1f4; +t9 = MEM_U32(t7 + 64); +//nop; +MEM_U32(at + 0) = t9; +at = 0x1000a218; +t5 = MEM_U32(t7 + 68); +//nop; +MEM_U32(at + 0) = t5; +L4117f0: +t0 = 0x1000a380; +at = 0x1000a21c; +a1 = 0x10001d08; +//nop; +t8 = MEM_U32(t0 + 72); +a0 = 0x1000a560; +a1 = a1; +MEM_U32(at + 0) = t8; +f_addstr(mem, sp, a0, a1); +goto L411814; +MEM_U32(at + 0) = t8; +L411814: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L411834; +//nop; +L411834: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001d0c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L411850; +a1 = a1; +L411850: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a218; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L411870; +//nop; +L411870: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001d10; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41188c; +a1 = a1; +L41188c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a21c; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4118ac; +//nop; +L4118ac: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001d14; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4118c8; +a1 = a1; +L4118c8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100000b0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4118e8; +//nop; +L4118e8: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000ac; +a1 = 0x1000a560; +a3 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = MEM_U32(a3 + 0); +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L411914; +MEM_U32(sp + 16) = zero; +L411914: +// bdead 4006008b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L411b88;} +//nop; +t4 = 0x100002a8; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L411ac4;} +//nop; +t3 = 0x1000a244; +t1 = 0x1000a248; +t3 = MEM_U32(t3 + 0); +t1 = MEM_U32(t1 + 0); +//nop; +at = (int)t3 < (int)t1; +if (at == 0) {//nop; +goto L411aa8;} +//nop; +t2 = 0x1000a520; +at = 0x1000a244; +t2 = MEM_U32(t2 + 8); +t9 = s0 << 2; +a0 = 0x1000a23c; +t6 = t3 + 0x1; +t7 = t2 + t9; +//nop; +MEM_U32(at + 0) = t6; +a1 = MEM_U32(t7 + 0); +a0 = MEM_U32(a0 + 0); +a2 = 0x5; +v0 = f_edit_src(mem, sp, a0, a1, a2); +goto L41198c; +a2 = 0x5; +L41198c: +// bdead 4006008b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4119cc;} +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_show_err(mem, sp, a0); +goto L4119ac; +//nop; +L4119ac: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4119c4; +//nop; +L4119c4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4119cc: +t5 = 0x1000a1a0; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L411a18;} +//nop; +t0 = 0x1000a24c; +at = 0x69; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 == at) {//nop; +goto L411a18;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411a10; +//nop; +L411a10: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L411a18: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411a2c; +//nop; +L411a2c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411a48; +//nop; +L411a48: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a218; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411a64; +//nop; +L411a64: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a21c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411a80; +//nop; +L411a80: +// bdead 40060103 gp = MEM_U32(sp + 64); +t4 = s0 << 2; +t8 = 0x1000a520; +at = 0x1000a1f0; +t8 = MEM_U32(t8 + 8); +//nop; +t1 = t8 + t4; +t3 = MEM_U32(t1 + 0); +MEM_U32(at + 0) = t3; +goto L40a8e0; +MEM_U32(at + 0) = t3; +L411aa8: +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_show_err(mem, sp, a0); +goto L411abc; +//nop; +L411abc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L411ac4: +t6 = 0x10000404; +t9 = 0x1000a1a0; +t6 = MEM_U32(t6 + 0); +at = 0x10000404; +t9 = MEM_U32(t9 + 0); +t2 = t6 + 0x1; +if (t9 == 0) {MEM_U32(at + 0) = t2; +goto L411b18;} +MEM_U32(at + 0) = t2; +t7 = 0x1000a24c; +at = 0x69; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 == at) {//nop; +goto L411b18;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411b10; +//nop; +L411b10: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L411b18: +t5 = 0x10000240; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L411b68;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411b44; +//nop; +L411b44: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a218; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411b60; +//nop; +L411b60: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L411b68: +a0 = 0x1000a21c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411b7c; +//nop; +L411b7c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L411b88: +t0 = 0x100002a8; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L411bbc;} +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411bb4; +//nop; +L411bb4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L411bbc: +a0 = 0x1000a21c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411bd0; +//nop; +L411bd0: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t8 = 0x1000a1a0; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L411c24;} +//nop; +t4 = 0x1000a24c; +at = 0x69; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == at) {//nop; +goto L411c24;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411c1c; +//nop; +L411c1c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L411c24: +t1 = 0x1000a1e6; +at = 0x66; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 == at) {//nop; +goto L41977c;} +//nop; +t3 = 0x1000a1f4; +at = 0x1000a1f0; +t3 = MEM_U32(t3 + 0); +//nop; +MEM_U32(at + 0) = t3; +L411c50: +at = 0x1000a560; +a1 = 0x10001d18; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L411c6c; +a1 = a1; +L411c6c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t6 = 0x10000234; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L411ca8;} +//nop; +a1 = 0x10001d20; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L411ca0; +a1 = a1; +L411ca0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L411ca8: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a428; +//nop; +f_addlist(mem, sp, a0, a1); +goto L411cbc; +//nop; +L411cbc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L411cdc; +//nop; +L411cdc: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x6b; +t2 = 0x1000a1e6; +//nop; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L411d14;} +//nop; +t9 = 0x10000278; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L411d2c;} +//nop; +L411d14: +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L411d60;} +//nop; +L411d2c: +t5 = 0x1000a520; +t0 = s0 << 2; +t5 = MEM_U32(t5 + 8); +//nop; +t8 = t5 + t0; +a0 = MEM_U32(t8 + 0); +a1 = 0x42; +v0 = f_mksuf(mem, sp, a0, a1); +goto L411d4c; +a1 = 0x42; +L411d4c: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L411d74; +MEM_U32(at + 0) = v0; +L411d60: +t4 = 0x1000a380; +at = 0x1000a1f4; +t1 = MEM_U32(t4 + 12); +//nop; +MEM_U32(at + 0) = t1; +L411d74: +t3 = 0x1000a24c; +at = 0x3; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 == at) {//nop; +goto L411da4;} +//nop; +t6 = 0x10000240; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L411ddc;} +//nop; +L411da4: +t2 = 0x1000a520; +t9 = s0 << 2; +t2 = MEM_U32(t2 + 8); +a1 = 0x4; +t7 = t2 + t9; +//nop; +a0 = MEM_U32(t7 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L411dc8; +//nop; +L411dc8: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a218; +MEM_U32(at + 0) = v0; +goto L411df0; +MEM_U32(at + 0) = v0; +L411ddc: +t5 = 0x1000a380; +at = 0x1000a218; +t0 = MEM_U32(t5 + 68); +//nop; +MEM_U32(at + 0) = t0; +L411df0: +a1 = 0x10001d24; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L411e04; +a1 = a1; +L411e04: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a218; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L411e24; +//nop; +L411e24: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001d28; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L411e40; +a1 = a1; +L411e40: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L411e60; +//nop; +L411e60: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001d2c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L411e7c; +a1 = a1; +L411e7c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1fc; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L411e9c; +//nop; +L411e9c: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000b4; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L411ec4; +MEM_U32(sp + 16) = zero; +L411ec4: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L411fb4;} +//nop; +t8 = 0x10000404; +at = 0x10000404; +t8 = MEM_U32(t8 + 0); +t1 = 0x1000a24c; +t4 = t8 + 0x1; +t1 = MEM_U8(t1 + 0); +MEM_U32(at + 0) = t4; +at = 0x3; +if (t1 == at) {//nop; +goto L411f14;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411f0c; +//nop; +L411f0c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L411f14: +t3 = 0x10000240; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L411f7c;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411f40; +//nop; +L411f40: +// bdead 40060103 gp = MEM_U32(sp + 64); +at = 0x3; +t6 = 0x1000a24c; +//nop; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == at) {//nop; +goto L411f7c;} +//nop; +a0 = 0x1000a218; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411f74; +//nop; +L411f74: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L411f7c: +t2 = 0x1000a250; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411fa8; +//nop; +L411fa8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L411fb4: +t9 = 0x1000a24c; +at = 0x3; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == at) {//nop; +goto L412000;} +//nop; +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L412000;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L411ff8; +//nop; +L411ff8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L412000: +t5 = 0x10000240; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L41204c;} +//nop; +t0 = 0x1000a24c; +at = 0x3; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 == at) {//nop; +goto L41204c;} +//nop; +a0 = 0x1000a218; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L412044; +//nop; +L412044: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L41204c: +t8 = 0x1000a1f4; +at = 0x1000a1f0; +t4 = 0x1000a1e6; +t8 = MEM_U32(t8 + 0); +t4 = MEM_U8(t4 + 0); +MEM_U32(at + 0) = t8; +at = 0x6b; +if (t4 != at) {//nop; +goto L41220c;} +//nop; +t1 = 0x10000278; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {at = 0x1000a560; +goto L41220c;} +at = 0x1000a560; +a1 = 0x10001d30; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4120a0; +a1 = a1; +L4120a0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4120c0; +//nop; +L4120c0: +// bdead 40060003 gp = MEM_U32(sp + 64); +t6 = s0 << 2; +t3 = 0x1000a520; +//nop; +t3 = MEM_U32(t3 + 8); +a1 = 0x55; +t2 = t3 + t6; +a0 = MEM_U32(t2 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L4120e8; +//nop; +L4120e8: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a1 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L412110; +//nop; +L412110: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000f4; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L412138; +MEM_U32(sp + 16) = zero; +L412138: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4121d4;} +//nop; +t9 = 0x10000404; +t5 = 0x10000240; +t9 = MEM_U32(t9 + 0); +at = 0x10000404; +t5 = MEM_U32(t5 + 0); +t7 = t9 + 0x1; +if (t5 != 0) {MEM_U32(at + 0) = t7; +goto L41219c;} +MEM_U32(at + 0) = t7; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L412178; +//nop; +L412178: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L412194; +//nop; +L412194: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L41219c: +t0 = 0x1000a250; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4121c8; +//nop; +L4121c8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L4121d4: +t8 = 0x10000240; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L412200; +//nop; +L412200: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L41220c: +t4 = 0x1000a1e6; +at = 0x6b; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L414b54;} +//nop; +//nop; +goto L41977c; +//nop; +L41222c: +at = 0x1000a560; +a1 = 0x10001d38; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L412248; +a1 = a1; +L412248: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x10000234; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L412284;} +//nop; +a1 = 0x10001d40; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41227c; +a1 = a1; +L41227c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L412284: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a418; +//nop; +f_addlist(mem, sp, a0, a1); +goto L412298; +//nop; +L412298: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4122b8; +//nop; +L4122b8: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x66; +t3 = 0x1000a1e6; +//nop; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 == at) {//nop; +goto L4122f0;} +//nop; +t6 = 0x10000240; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L412354;} +//nop; +L4122f0: +t2 = 0x1000a520; +t9 = s0 << 2; +t2 = MEM_U32(t2 + 8); +a1 = 0x3; +t7 = t2 + t9; +//nop; +a0 = MEM_U32(t7 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L412314; +//nop; +L412314: +// bdead 4006000b gp = MEM_U32(sp + 64); +t0 = s0 << 2; +t5 = 0x1000a520; +at = 0x1000a1f4; +t5 = MEM_U32(t5 + 8); +//nop; +MEM_U32(at + 0) = v0; +t8 = t5 + t0; +a0 = MEM_U32(t8 + 0); +a1 = 0x4; +v0 = f_mksuf(mem, sp, a0, a1); +goto L412340; +a1 = 0x4; +L412340: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a218; +MEM_U32(at + 0) = v0; +goto L412378; +MEM_U32(at + 0) = v0; +L412354: +t4 = 0x1000a380; +at = 0x1000a1f4; +t1 = MEM_U32(t4 + 64); +//nop; +MEM_U32(at + 0) = t1; +at = 0x1000a218; +t3 = MEM_U32(t4 + 68); +//nop; +MEM_U32(at + 0) = t3; +L412378: +t6 = 0x1000a380; +at = 0x1000a21c; +t2 = MEM_U32(t6 + 72); +a1 = 0x10001d44; +MEM_U32(at + 0) = t2; +at = 0x1000a224; +t9 = MEM_U32(t6 + 80); +a0 = 0x1000a560; +MEM_U32(at + 0) = t9; +at = 0x1000a220; +//nop; +t7 = MEM_U32(t6 + 76); +a1 = a1; +MEM_U32(at + 0) = t7; +f_addstr(mem, sp, a0, a1); +goto L4123b4; +MEM_U32(at + 0) = t7; +L4123b4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4123d4; +//nop; +L4123d4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001d48; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4123f0; +a1 = a1; +L4123f0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a218; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L412410; +//nop; +L412410: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001d4c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41242c; +a1 = a1; +L41242c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a21c; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41244c; +//nop; +L41244c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001d50; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L412468; +a1 = a1; +L412468: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a224; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L412488; +//nop; +L412488: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001d54; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4124a4; +a1 = a1; +L4124a4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a220; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4124c4; +//nop; +L4124c4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001d58; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4124e0; +a1 = a1; +L4124e0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100000b0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L412500; +//nop; +L412500: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000b8; +a1 = 0x1000a560; +a3 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = MEM_U32(a3 + 0); +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L41252c; +MEM_U32(sp + 16) = zero; +L41252c: +// bdead 4006008b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L412810;} +//nop; +t5 = 0x100002a8; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L412714;} +//nop; +t0 = 0x1000a244; +t8 = 0x1000a248; +t0 = MEM_U32(t0 + 0); +t8 = MEM_U32(t8 + 0); +//nop; +at = (int)t0 < (int)t8; +if (at == 0) {//nop; +goto L4126f8;} +//nop; +t4 = 0x1000a520; +at = 0x1000a244; +t4 = MEM_U32(t4 + 8); +a0 = 0x1000a23c; +t1 = t0 + 0x1; +t3 = s0 << 2; +//nop; +MEM_U32(at + 0) = t1; +t2 = t4 + t3; +a1 = MEM_U32(t2 + 0); +a0 = MEM_U32(a0 + 0); +a2 = 0x6; +v0 = f_edit_src(mem, sp, a0, a1, a2); +goto L4125a4; +a2 = 0x6; +L4125a4: +// bdead 4006008b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4125e4;} +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_show_err(mem, sp, a0); +goto L4125c4; +//nop; +L4125c4: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4125dc; +//nop; +L4125dc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4125e4: +t9 = 0x1000a1a0; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L412630;} +//nop; +t6 = 0x1000a24c; +at = 0x69; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == at) {//nop; +goto L412630;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L412628; +//nop; +L412628: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L412630: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L412644; +//nop; +L412644: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L412660; +//nop; +L412660: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a218; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41267c; +//nop; +L41267c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a21c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L412698; +//nop; +L412698: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a224; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4126b4; +//nop; +L4126b4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a220; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4126d0; +//nop; +L4126d0: +// bdead 40060103 gp = MEM_U32(sp + 64); +t5 = s0 << 2; +t7 = 0x1000a520; +at = 0x1000a1f0; +t7 = MEM_U32(t7 + 8); +//nop; +t8 = t7 + t5; +t0 = MEM_U32(t8 + 0); +MEM_U32(at + 0) = t0; +goto L40a8e0; +MEM_U32(at + 0) = t0; +L4126f8: +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_show_err(mem, sp, a0); +goto L41270c; +//nop; +L41270c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L412714: +t1 = 0x10000404; +t3 = 0x1000a1a0; +t1 = MEM_U32(t1 + 0); +at = 0x10000404; +t3 = MEM_U32(t3 + 0); +t4 = t1 + 0x1; +if (t3 == 0) {MEM_U32(at + 0) = t4; +goto L412768;} +MEM_U32(at + 0) = t4; +t2 = 0x1000a24c; +at = 0x69; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == at) {//nop; +goto L412768;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L412760; +//nop; +L412760: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L412768: +t9 = 0x10000240; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L4127b8;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L412794; +//nop; +L412794: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a218; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4127b0; +//nop; +L4127b0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4127b8: +a0 = 0x1000a21c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4127cc; +//nop; +L4127cc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a224; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4127e8; +//nop; +L4127e8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a220; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L412804; +//nop; +L412804: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L412810: +t6 = 0x100002a8; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L412844;} +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41283c; +//nop; +L41283c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L412844: +t7 = 0x1000a1a0; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L412890;} +//nop; +t5 = 0x1000a24c; +at = 0x69; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {//nop; +goto L412890;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L412888; +//nop; +L412888: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L412890: +a0 = 0x1000a21c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4128a4; +//nop; +L4128a4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a224; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4128c0; +//nop; +L4128c0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a220; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4128dc; +//nop; +L4128dc: +// bdead 40060103 gp = MEM_U32(sp + 64); +at = 0x66; +t8 = 0x1000a1e6; +//nop; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == at) {//nop; +goto L41977c;} +//nop; +t0 = 0x1000a1f4; +at = 0x1000a1f0; +t0 = MEM_U32(t0 + 0); +MEM_U32(at + 0) = t0; +goto L411c50; +MEM_U32(at + 0) = t0; +L412910: +t1 = 0x10000268; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {at = 0x1000a560; +goto L412a68;} +at = 0x1000a560; +a1 = 0x10001d5c; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L412940; +a1 = a1; +L412940: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L412960; +//nop; +L412960: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x4; +t4 = 0x1000a36c; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == at) {//nop; +goto L412998;} +//nop; +t3 = 0x1000a24c; +at = 0x73; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L4129ac;} +//nop; +L412998: +t2 = 0x1000a380; +at = 0x1000a1f4; +t9 = MEM_U32(t2 + 56); +MEM_U32(at + 0) = t9; +goto L4129e0; +MEM_U32(at + 0) = t9; +L4129ac: +t6 = 0x1000a520; +t7 = s0 << 2; +t6 = MEM_U32(t6 + 8); +//nop; +t5 = t6 + t7; +a0 = MEM_U32(t5 + 0); +a1 = 0x70; +v0 = f_mksuf(mem, sp, a0, a1); +goto L4129cc; +a1 = 0x70; +L4129cc: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +L4129e0: +a0 = 0x1000a194; +a1 = 0x1000a560; +a3 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = MEM_U32(a3 + 0); +a2 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L412a08; +MEM_U32(sp + 16) = zero; +L412a08: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L412a54;} +//nop; +t8 = 0x10000404; +t1 = 0x10000240; +t8 = MEM_U32(t8 + 0); +at = 0x10000404; +t1 = MEM_U32(t1 + 0); +t0 = t8 + 0x1; +if (t1 != 0) {MEM_U32(at + 0) = t0; +goto L41977c;} +MEM_U32(at + 0) = t0; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L412a48; +//nop; +L412a48: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L412a54: +t4 = 0x1000a1f4; +at = 0x1000a1f0; +t4 = MEM_U32(t4 + 0); +//nop; +MEM_U32(at + 0) = t4; +L412a68: +s4 = 0x1000a24c; +at = 0x65; +s4 = MEM_U8(s4 + 0); +//nop; +if (s4 == at) {at = 0x72; +goto L412ac8;} +at = 0x72; +if (s4 == at) {at = 0x73; +goto L412b10;} +at = 0x73; +if (s4 != at) {//nop; +goto L412ac8;} +//nop; +t3 = 0x1000a1a0; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L40ad4c;} +//nop; +t2 = 0x1000a1a4; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L418634;} +//nop; +//nop; +goto L40ad4c; +//nop; +L412ac8: +t9 = 0x10001d60; +a0 = 0x1; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L412af0; +MEM_U32(sp + 16) = zero; +L412af0: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L412b08; +//nop; +L412b08: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L412b10: +at = 0x1000a560; +a1 = 0x10001d88; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L412b2c; +a1 = a1; +L412b2c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a370; +//nop; +f_addlist(mem, sp, a0, a1); +goto L412b48; +//nop; +L412b48: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L412b68; +//nop; +L412b68: +// bdead 40060003 gp = MEM_U32(sp + 64); +t7 = s0 << 2; +t6 = 0x1000a520; +//nop; +t6 = MEM_U32(t6 + 8); +a1 = 0x66; +t5 = t6 + t7; +a0 = MEM_U32(t5 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L412b90; +//nop; +L412b90: +// bdead 4006000b gp = MEM_U32(sp + 64); +a2 = zero; +at = 0x1000a1f4; +a0 = 0x1000a190; +a1 = 0x1000a560; +a3 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = MEM_U32(a3 + 0); +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L412bc4; +MEM_U32(sp + 16) = zero; +L412bc4: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L412bf8;} +//nop; +t8 = 0x10000404; +t1 = 0x10000240; +t8 = MEM_U32(t8 + 0); +at = 0x10000404; +t1 = MEM_U32(t1 + 0); +t0 = t8 + 0x1; +if (t1 != 0) {MEM_U32(at + 0) = t0; +goto L41977c;} +MEM_U32(at + 0) = t0; +//nop; +goto L41977c; +//nop; +L412bf8: +t4 = 0x10000268; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L412c2c;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L412c24; +//nop; +L412c24: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L412c2c: +t3 = 0x1000a1f4; +t2 = 0x1000026c; +at = 0x1000a1f0; +t3 = MEM_U32(t3 + 0); +t2 = MEM_U32(t2 + 0); +MEM_U32(at + 0) = t3; +if (t2 != 0) {//nop; +goto L41977c;} +//nop; +t9 = 0x1000a1a0; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L40ad4c;} +//nop; +L412c64: +MEM_U32(sp + 256) = zero; +MEM_U32(sp + 252) = zero; +t6 = 0x31; +t7 = sp + 0xf0; +t8 = 0x1000043c; +MEM_U8(t7 + 0) = (uint8_t)t6; +t5 = sp + 0xf0; +MEM_U8(t5 + 1) = (uint8_t)zero; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L413558;} +//nop; +t0 = 0x1000a150; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +t1 = t0 & 0x1; +if (t1 == 0) {//nop; +goto L412ce4;} +//nop; +t4 = 0x10001d90; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L412cd8; +MEM_U32(sp + 16) = zero; +L412cd8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L413558; +//nop; +L412ce4: +t3 = 0x10000230; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +at = (int)t3 < (int)0x2; +if (at != 0) {//nop; +goto L412d50;} +//nop; +t2 = 0x10000264; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L412d50;} +//nop; +a1 = 0x10001dc0; +//nop; +a0 = 0x1000a4b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L412d2c; +a1 = a1; +L412d2c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001dcc; +//nop; +a0 = 0x1000a4b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L412d48; +a1 = a1; +L412d48: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L412d50: +t9 = 0x1000a168; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L412db0;} +//nop; +t6 = 0x10000398; +at = 0x2; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == at) {//nop; +goto L412db0;} +//nop; +t7 = 0x10001dd0; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L412da8; +MEM_U32(sp + 16) = zero; +L412da8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L412db0: +t5 = 0x1000a164; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L412e10;} +//nop; +t8 = 0x10000398; +at = 0x2; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == at) {//nop; +goto L412e10;} +//nop; +t0 = 0x10001df8; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L412e08; +MEM_U32(sp + 16) = zero; +L412e08: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L412e10: +t1 = 0x1000a174; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L412e70;} +//nop; +t4 = 0x10000398; +at = 0x2; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == at) {//nop; +goto L412e70;} +//nop; +t3 = 0x10001e20; +//nop; +t3 = t3; +MEM_U32(sp + 20) = t3; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L412e68; +MEM_U32(sp + 16) = zero; +L412e68: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L412e70: +t2 = 0x1000a178; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L412ed0;} +//nop; +t9 = 0x10000398; +at = 0x2; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == at) {//nop; +goto L412ed0;} +//nop; +t6 = 0x10001e48; +//nop; +t6 = t6; +MEM_U32(sp + 20) = t6; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L412ec8; +MEM_U32(sp + 16) = zero; +L412ec8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L412ed0: +t7 = 0x1000a160; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L412f30;} +//nop; +t5 = 0x10001e78; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L412f10; +MEM_U32(sp + 16) = zero; +L412f10: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L412f28; +//nop; +L412f28: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L412f30: +at = 0x1000a560; +a1 = 0x10001ea0; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L412f4c; +a1 = a1; +L412f4c: +// bdead 40060103 gp = MEM_U32(sp + 64); +a2 = zero; +t8 = 0x1000a380; +a1 = 0x10001ea8; +//nop; +a0 = MEM_U32(t8 + 124); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L412f6c; +a1 = a1; +L412f6c: +// bdead 4006010b gp = MEM_U32(sp + 64); +MEM_U32(sp + 244) = v0; +a0 = 0x10001eac; +//nop; +a1 = MEM_U32(sp + 244); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L412f8c; +a0 = a0; +L412f8c: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L412fa4; +a1 = s4; +L412fa4: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x4b; +t0 = 0x1000a1e6; +//nop; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 == at) {//nop; +goto L412fdc;} +//nop; +t1 = 0x10000240; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L413010;} +//nop; +L412fdc: +t4 = 0x1000a520; +t3 = s0 << 2; +t4 = MEM_U32(t4 + 8); +//nop; +t2 = t4 + t3; +a0 = MEM_U32(t2 + 0); +a1 = 0x6d; +v0 = f_mksuf(mem, sp, a0, a1); +goto L412ffc; +a1 = 0x6d; +L412ffc: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L413044; +MEM_U32(at + 0) = v0; +L413010: +t9 = 0x1000a380; +a1 = 0x10001eb0; +a0 = MEM_U32(t9 + 124); +//nop; +a2 = sp + 0xf0; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L413030; +a1 = a1; +L413030: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +L413044: +a1 = 0x1000a1f4; +a0 = 0x10001eb4; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L413060; +a0 = a0; +L413060: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L413078; +a1 = s4; +L413078: +// bdead 40060103 gp = MEM_U32(sp + 64); +a2 = zero; +a1 = 0x1000a1f0; +a0 = 0x10001eb8; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L413098; +a0 = a0; +L413098: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L4130b0; +a1 = s4; +L4130b0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t6 = 0x1000a16c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L4130ec;} +//nop; +a1 = 0x10001ebc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4130e4; +a1 = a1; +L4130e4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4130ec: +t7 = 0x1000a170; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L413120;} +//nop; +a1 = 0x10001ec8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413118; +a1 = a1; +L413118: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413120: +t5 = 0x10000284; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L413154;} +//nop; +a1 = 0x10001ed4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41314c; +a1 = a1; +L41314c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413154: +t8 = 0x1000a154; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L413188;} +//nop; +a1 = 0x10001ee0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413180; +a1 = a1; +L413180: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413188: +t0 = 0x1000a15c; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L4131bc;} +//nop; +a1 = 0x10001eec; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4131b4; +a1 = a1; +L4131b4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4131bc: +t1 = 0x10000398; +at = 0x2; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L4131f0;} +//nop; +a1 = 0x10001ef4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4131e8; +a1 = a1; +L4131e8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4131f0: +t4 = 0x10000234; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L413224;} +//nop; +a1 = 0x10001f00; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41321c; +a1 = a1; +L41321c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413224: +t3 = 0x10000424; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L4132a8;} +//nop; +t2 = 0x1000a520; +t9 = s0 << 2; +t2 = MEM_U32(t2 + 8); +a1 = 0x1000a24c; +t6 = t2 + t9; +//nop; +a0 = MEM_U32(t6 + 0); +a1 = MEM_U8(a1 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L413264; +//nop; +L413264: +// bdead 4006010b gp = MEM_U32(sp + 64); +s5 = v0; +a0 = 0x10001f08; +//nop; +a1 = s5; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L413284; +a0 = a0; +L413284: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41329c; +a1 = s4; +L41329c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L413310; +//nop; +L4132a8: +t7 = 0x1000a520; +a1 = 0x1000a24c; +t7 = MEM_U32(t7 + 8); +t5 = s0 << 2; +//nop; +t8 = t7 + t5; +a0 = MEM_U32(t8 + 0); +a1 = MEM_U8(a1 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L4132d0; +//nop; +L4132d0: +// bdead 4006010b gp = MEM_U32(sp + 64); +s5 = v0; +a0 = 0x10001f14; +//nop; +a1 = s5; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4132f0; +a0 = a0; +L4132f0: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L413308; +a1 = s4; +L413308: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413310: +a1 = 0x10001f28; +//nop; +a0 = 0x1000a560; +// bdead 40060063 a2 = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413328; +a1 = a1; +L413328: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001f40; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413344; +a1 = a1; +L413344: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a5e0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L413360; +//nop; +L413360: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100001f4; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L413388; +MEM_U32(sp + 16) = zero; +L413388: +// bdead 4006000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L413488;} +//nop; +t0 = 0x10000404; +t4 = 0x1000a1a0; +t0 = MEM_U32(t0 + 0); +at = 0x10000404; +t4 = MEM_U32(t4 + 0); +t1 = t0 + 0x1; +if (t4 != 0) {MEM_U32(at + 0) = t1; +goto L4133d4;} +MEM_U32(at + 0) = t1; +t3 = 0x1000a24c; +at = 0x65; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 == at) {at = 0x72; +goto L4133d4;} +at = 0x72; +if (t3 != at) {//nop; +goto L413420;} +//nop; +L4133d4: +t2 = 0x1000a24c; +at = 0x69; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == at) {//nop; +goto L413420;} +//nop; +t9 = 0x10000240; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L413420;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L413418; +//nop; +L413418: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413420: +t6 = 0x1000a1e6; +at = 0x4b; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L413450;} +//nop; +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41346c;} +//nop; +L413450: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L413464; +//nop; +L413464: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L41346c: +//nop; +a0 = MEM_U32(sp + 244); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41347c; +//nop; +L41347c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L413488: +t5 = 0x1000a1a0; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L4134c8;} +//nop; +t8 = 0x1000a24c; +at = 0x65; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == at) {at = 0x72; +goto L4134c8;} +at = 0x72; +if (t8 == at) {at = 0x46; +goto L4134c8;} +at = 0x46; +if (t8 != at) {//nop; +goto L413514;} +//nop; +L4134c8: +t0 = 0x1000a24c; +at = 0x69; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 == at) {//nop; +goto L413514;} +//nop; +t1 = 0x10000240; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L413514;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41350c; +//nop; +L41350c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413514: +//nop; +a0 = MEM_U32(sp + 244); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L413524; +//nop; +L413524: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t4 = 0x1000a1f4; +at = 0x1000a1f0; +t3 = 0x1000a1e6; +t4 = MEM_U32(t4 + 0); +t3 = MEM_U8(t3 + 0); +MEM_U32(at + 0) = t4; +at = 0x4b; +if (t3 != at) {//nop; +goto L4142ac;} +//nop; +//nop; +goto L41977c; +//nop; +L413558: +t2 = 0x1000a1e6; +at = 0x4b; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == at) {//nop; +goto L413588;} +//nop; +t9 = 0x10000240; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L4135a0;} +//nop; +L413588: +t6 = 0x1000a150; +at = 0x1000a150; +t6 = MEM_U32(t6 + 0); +//nop; +t7 = t6 | 0x6; +MEM_U32(at + 0) = t7; +L4135a0: +t5 = 0x1000a150; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +t8 = t5 & 0x1; +if (t8 == 0) {//nop; +goto L4142ac;} +//nop; +t0 = 0x10000230; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +at = (int)t0 < (int)0x2; +if (at != 0) {//nop; +goto L413628;} +//nop; +t1 = 0x10000264; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L413628;} +//nop; +a1 = 0x10001f48; +//nop; +a0 = 0x1000a4b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413604; +a1 = a1; +L413604: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10001f54; +//nop; +a0 = 0x1000a4b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413620; +a1 = a1; +L413620: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413628: +t4 = 0x1000a168; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L413688;} +//nop; +t3 = 0x10000398; +at = 0x2; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == at) {//nop; +goto L413688;} +//nop; +t2 = 0x10001f58; +//nop; +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L413680; +MEM_U32(sp + 16) = zero; +L413680: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413688: +t9 = 0x1000a164; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L4136e8;} +//nop; +t6 = 0x10000398; +at = 0x2; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == at) {//nop; +goto L4136e8;} +//nop; +t7 = 0x10001f80; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4136e0; +MEM_U32(sp + 16) = zero; +L4136e0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4136e8: +t5 = 0x1000a174; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L413748;} +//nop; +t8 = 0x10000398; +at = 0x2; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == at) {//nop; +goto L413748;} +//nop; +t0 = 0x10001fa8; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L413740; +MEM_U32(sp + 16) = zero; +L413740: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413748: +t1 = 0x1000a178; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L4137a8;} +//nop; +t4 = 0x10000398; +at = 0x2; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == at) {//nop; +goto L4137a8;} +//nop; +t3 = 0x10001fd0; +//nop; +t3 = t3; +MEM_U32(sp + 20) = t3; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4137a0; +MEM_U32(sp + 16) = zero; +L4137a0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4137a8: +t2 = 0x1000a160; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L413808;} +//nop; +t9 = 0x10001ffc; +a0 = 0x1; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4137e8; +MEM_U32(sp + 16) = zero; +L4137e8: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L413800; +//nop; +L413800: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413808: +at = 0x1000a560; +a1 = 0x10002020; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413824; +a1 = a1; +L413824: +// bdead 40060003 gp = MEM_U32(sp + 64); +t6 = MEM_U32(sp + 252); +t8 = 0x1000a150; +t5 = sp + 0xf0; +t7 = t6 + 0x31; +MEM_U8(t5 + 0) = (uint8_t)t7; +t8 = MEM_U32(t8 + 0); +//nop; +t0 = t8 & 0x2; +if (t0 == 0) {//nop; +goto L4138b4;} +//nop; +t1 = 0x1000a520; +t4 = s0 << 2; +t1 = MEM_U32(t1 + 8); +//nop; +t3 = t1 + t4; +a0 = MEM_U32(t3 + 0); +a1 = 0x6c; +v0 = f_mksuf(mem, sp, a0, a1); +goto L413870; +a1 = 0x6c; +L413870: +// bdead 4006010b gp = MEM_U32(sp + 64); +t9 = MEM_U32(sp + 252); +t2 = 0x100003a8; +MEM_U32(sp + 248) = v0; +t2 = MEM_U32(t2 + 0); +//nop; +at = (int)t9 < (int)t2; +if (at == 0) {//nop; +goto L4138dc;} +//nop; +//nop; +a0 = MEM_U32(sp + 248); +a1 = sp + 0xf0; +a2 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4138a8; +a2 = zero; +L4138a8: +// bdead 4006010b gp = MEM_U32(sp + 64); +MEM_U32(sp + 248) = v0; +goto L4138dc; +MEM_U32(sp + 248) = v0; +L4138b4: +t6 = 0x1000a380; +a1 = 0x10002024; +//nop; +a0 = MEM_U32(t6 + 124); +a2 = sp + 0xf0; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4138d4; +a1 = a1; +L4138d4: +// bdead 4006010b gp = MEM_U32(sp + 64); +MEM_U32(sp + 248) = v0; +L4138dc: +a0 = 0x10002028; +//nop; +a1 = MEM_U32(sp + 248); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4138f4; +a0 = a0; +L4138f4: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41390c; +a1 = s4; +L41390c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t7 = 0x1000a150; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +t5 = t7 & 0x4; +if (t5 == 0) {//nop; +goto L4139a0;} +//nop; +t8 = 0x1000a520; +t0 = s0 << 2; +t8 = MEM_U32(t8 + 8); +//nop; +t1 = t8 + t0; +a0 = MEM_U32(t1 + 0); +a1 = 0x6d; +v0 = f_mksuf(mem, sp, a0, a1); +goto L413950; +a1 = 0x6d; +L413950: +// bdead 4006010b gp = MEM_U32(sp + 64); +t3 = MEM_U32(sp + 252); +t4 = 0x100003a8; +at = 0x1000a1f4; +t4 = MEM_U32(t4 + 0); +MEM_U32(at + 0) = v0; +at = (int)t3 < (int)t4; +if (at == 0) {//nop; +goto L4139d4;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = sp + 0xf0; +a2 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41398c; +a2 = zero; +L41398c: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L4139d4; +MEM_U32(at + 0) = v0; +L4139a0: +t2 = 0x1000a380; +a1 = 0x1000202c; +//nop; +a0 = MEM_U32(t2 + 124); +a2 = sp + 0xf0; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4139c0; +a1 = a1; +L4139c0: +// bdead 4006010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +L4139d4: +a1 = 0x1000a1f4; +a0 = 0x10002030; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4139f0; +a0 = a0; +L4139f0: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L413a08; +a1 = s4; +L413a08: +// bdead 40060103 gp = MEM_U32(sp + 64); +a2 = zero; +a1 = 0x1000a1f0; +a0 = 0x10002034; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L413a28; +a0 = a0; +L413a28: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L413a40; +a1 = s4; +L413a40: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t9 = 0x1000a16c; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L413a7c;} +//nop; +a1 = 0x10002038; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413a74; +a1 = a1; +L413a74: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413a7c: +t6 = 0x1000a170; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L413ab0;} +//nop; +a1 = 0x10002044; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413aa8; +a1 = a1; +L413aa8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413ab0: +t7 = 0x10000284; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L413ae4;} +//nop; +a1 = 0x10002050; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413adc; +a1 = a1; +L413adc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413ae4: +t5 = 0x1000a154; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L413b18;} +//nop; +a1 = 0x1000205c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413b10; +a1 = a1; +L413b10: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413b18: +t8 = 0x1000a15c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L413b4c;} +//nop; +a1 = 0x10002068; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413b44; +a1 = a1; +L413b44: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413b4c: +t0 = 0x10000398; +at = 0x2; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L413b80;} +//nop; +a1 = 0x10002070; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413b78; +a1 = a1; +L413b78: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413b80: +t1 = 0x10000234; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L413bb8;} +//nop; +a1 = 0x1000207c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413bac; +a1 = a1; +L413bac: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L413bd4; +//nop; +L413bb8: +a1 = 0x10002084; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413bcc; +a1 = a1; +L413bcc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413bd4: +t4 = 0x1000a150; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +t3 = t4 & 0x2; +if (t3 == 0) {//nop; +goto L413c58;} +//nop; +t2 = 0x1000a520; +t9 = s0 << 2; +t2 = MEM_U32(t2 + 8); +a1 = 0x5; +t6 = t2 + t9; +//nop; +a0 = MEM_U32(t6 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L413c14; +//nop; +L413c14: +// bdead 4006010b gp = MEM_U32(sp + 64); +s5 = v0; +a0 = 0x1000208c; +//nop; +a1 = s5; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L413c34; +a0 = a0; +L413c34: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L413c4c; +a1 = s4; +L413c4c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L413c8c; +//nop; +L413c58: +t7 = 0x10000424; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L413c8c;} +//nop; +a1 = 0x10002098; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413c84; +a1 = a1; +L413c84: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413c8c: +t5 = 0x10000424; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L413d10;} +//nop; +t8 = 0x1000a520; +a1 = 0x1000a24c; +t8 = MEM_U32(t8 + 8); +t0 = s0 << 2; +//nop; +t1 = t8 + t0; +a0 = MEM_U32(t1 + 0); +a1 = MEM_U8(a1 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L413ccc; +//nop; +L413ccc: +// bdead 4006010b gp = MEM_U32(sp + 64); +s5 = v0; +a0 = 0x100020a4; +//nop; +a1 = s5; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L413cec; +a0 = a0; +L413cec: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L413d04; +a1 = s4; +L413d04: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L413d78; +//nop; +L413d10: +t4 = 0x1000a520; +a1 = 0x1000a24c; +t4 = MEM_U32(t4 + 8); +t3 = s0 << 2; +//nop; +t2 = t4 + t3; +a0 = MEM_U32(t2 + 0); +a1 = MEM_U8(a1 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L413d38; +//nop; +L413d38: +// bdead 4006010b gp = MEM_U32(sp + 64); +s5 = v0; +a0 = 0x100020b0; +//nop; +a1 = s5; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L413d58; +a0 = a0; +L413d58: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L413d70; +a1 = s4; +L413d70: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413d78: +a1 = 0x100020c4; +//nop; +a0 = 0x1000a560; +// bdead 40060063 a2 = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413d90; +a1 = a1; +L413d90: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100020dc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413dac; +a1 = a1; +L413dac: +// bdead 40060003 gp = MEM_U32(sp + 64); +t6 = MEM_U32(sp + 252); +t9 = 0x100003a8; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +at = (int)t6 < (int)t9; +if (at != 0) {//nop; +goto L413df0;} +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a5b8; +//nop; +f_addlist(mem, sp, a0, a1); +goto L413de4; +//nop; +L413de4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L414058; +//nop; +L413df0: +a1 = 0x100020e4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413e04; +a1 = a1; +L413e04: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100020ec; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L413e20; +a1 = a1; +L413e20: +t7 = MEM_U32(sp + 256); +// bdead 40070003 gp = MEM_U32(sp + 64); +t8 = MEM_U32(sp + 356); +t5 = t7 + 0x1; +t0 = t5 << 2; +a1 = 0x100020f4; +//nop; +MEM_U32(sp + 256) = t5; +t1 = t8 + t0; +a0 = MEM_U32(t1 + 0); +a2 = 0xc; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L413e54; +a1 = a1; +L413e54: +// bdead 4006000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L413f04;} +//nop; +L413e60: +t4 = MEM_U32(sp + 256); +t2 = MEM_U32(sp + 356); +t3 = t4 + 0x1; +t9 = t3 << 2; +MEM_U32(sp + 256) = t3; +t6 = t2 + t9; +t7 = MEM_U32(t6 + 0); +//nop; +if (t7 != 0) {//nop; +goto L413ed0;} +//nop; +t5 = 0x10002104; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L413eb0; +MEM_U32(sp + 16) = zero; +L413eb0: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L413ec8; +//nop; +L413ec8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L413ed0: +t0 = MEM_U32(sp + 256); +t8 = MEM_U32(sp + 356); +t1 = t0 << 2; +a1 = 0x100020f4; +//nop; +t4 = t8 + t1; +a0 = MEM_U32(t4 + 0); +a2 = 0xc; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L413ef8; +a1 = a1; +L413ef8: +// bdead 4006000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L413e60;} +//nop; +L413f04: +a0 = 0x10002124; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L413f18; +//nop; +L413f18: +t2 = MEM_U32(sp + 256); +t3 = MEM_U32(sp + 356); +t9 = t2 << 2; +t6 = t3 + t9; +t7 = MEM_U32(t6 + 0); +// bdead 4007018b gp = MEM_U32(sp + 64); +t5 = v0 + t7; +MEM_U32(sp + 232) = t5; +L413f38: +t0 = MEM_U32(sp + 232); +//nop; +t8 = t0 + 0x1; +MEM_U32(sp + 236) = t8; +t1 = MEM_U8(t0 + 1); +//nop; +if (t1 != 0) {//nop; +goto L413fa0;} +//nop; +t4 = 0x10002130; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L413f80; +MEM_U32(sp + 16) = zero; +L413f80: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L413f98; +//nop; +L413f98: +// bdead 40060183 gp = MEM_U32(sp + 64); +//nop; +L413fa0: +t2 = MEM_U32(sp + 236); +at = 0x2c; +t3 = t2 + 0x1; +MEM_U32(sp + 232) = t3; +t9 = MEM_U8(t2 + 1); +//nop; +if (t9 == at) {//nop; +goto L413ff8;} +//nop; +if (t9 == 0) {//nop; +goto L413ff8;} +//nop; +L413fc8: +t6 = MEM_U32(sp + 232); +at = 0x2c; +t7 = t6 + 0x1; +MEM_U32(sp + 232) = t7; +t5 = MEM_U32(sp + 232); +//nop; +t8 = MEM_U8(t5 + 0); +//nop; +if (t8 == at) {//nop; +goto L413ff8;} +//nop; +if (t8 != 0) {//nop; +goto L413fc8;} +//nop; +L413ff8: +t0 = MEM_U32(sp + 232); +a1 = zero; +t1 = MEM_U8(t0 + 0); +//nop; +MEM_U8(sp + 231) = (uint8_t)t1; +MEM_U8(t0 + 0) = (uint8_t)zero; +//nop; +a0 = MEM_U32(sp + 236); +//nop; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L414020; +//nop; +L414020: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L414038; +a1 = s4; +L414038: +t4 = MEM_U8(sp + 231); +// bdead 40062183 gp = MEM_U32(sp + 64); +if (t4 == 0) {//nop; +goto L414058;} +//nop; +t3 = MEM_U8(sp + 231); +t2 = MEM_U32(sp + 232); +MEM_U8(t2 + 0) = (uint8_t)t3; +goto L413f38; +MEM_U8(t2 + 0) = (uint8_t)t3; +L414058: +a0 = 0x1000a5c4; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L41407c; +MEM_U32(sp + 16) = zero; +L41407c: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L414150;} +//nop; +t9 = 0x10000404; +t7 = 0x1000a1a0; +t9 = MEM_U32(t9 + 0); +at = 0x10000404; +t7 = MEM_U32(t7 + 0); +t6 = t9 + 0x1; +if (t7 != 0) {MEM_U32(at + 0) = t6; +goto L4140c8;} +MEM_U32(at + 0) = t6; +t5 = 0x1000a24c; +at = 0x65; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {at = 0x72; +goto L4140c8;} +at = 0x72; +if (t5 != at) {//nop; +goto L414114;} +//nop; +L4140c8: +t8 = 0x1000a24c; +at = 0x69; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == at) {//nop; +goto L414114;} +//nop; +t1 = 0x10000240; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L414114;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41410c; +//nop; +L41410c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L414114: +t0 = 0x1000a150; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +t4 = t0 & 0x4; +if (t4 != 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L414144; +//nop; +L414144: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L414150: +t3 = 0x1000a150; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +t2 = t3 & 0x2; +if (t2 != 0) {//nop; +goto L414184;} +//nop; +//nop; +a0 = MEM_U32(sp + 248); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41417c; +//nop; +L41417c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L414184: +t9 = MEM_U32(sp + 252); +//nop; +if (t9 != 0) {//nop; +goto L414224;} +//nop; +t6 = 0x1000a1a0; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L4141d4;} +//nop; +t7 = 0x1000a24c; +at = 0x65; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 == at) {at = 0x72; +goto L4141d4;} +at = 0x72; +if (t7 == at) {at = 0x46; +goto L4141d4;} +at = 0x46; +if (t7 != at) {//nop; +goto L41425c;} +//nop; +L4141d4: +t5 = 0x1000a24c; +at = 0x69; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {//nop; +goto L41425c;} +//nop; +t8 = 0x10000240; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L41425c;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L414218; +//nop; +L414218: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41425c; +//nop; +L414224: +t1 = 0x1000a150; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +t0 = t1 & 0x4; +if (t0 != 0) {//nop; +goto L41425c;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L414254; +//nop; +L414254: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L41425c: +t2 = 0x100003a8; +t4 = MEM_U32(sp + 252); +t2 = MEM_U32(t2 + 0); +t3 = t4 + 0x1; +at = (int)t2 < (int)t3; +if (at != 0) {MEM_U32(sp + 252) = t3; +goto L41428c;} +MEM_U32(sp + 252) = t3; +t9 = 0x1000a1f4; +at = 0x1000a1f0; +t9 = MEM_U32(t9 + 0); +MEM_U32(at + 0) = t9; +goto L413808; +MEM_U32(at + 0) = t9; +L41428c: +t6 = 0x1000a1f4; +at = 0x1000a1f0; +t7 = 0x1000a1e6; +t6 = MEM_U32(t6 + 0); +t7 = MEM_U8(t7 + 0); +MEM_U32(at + 0) = t6; +at = 0x4b; +if (t7 == at) {at = 0x1000a560; +goto L41977c;} +L4142ac: +at = 0x1000a560; +a1 = 0x1000215c; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4142c8; +a1 = a1; +L4142c8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t5 = 0x1000a144; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L414300;} +//nop; +//nop; +a0 = 0x1000a560; +a1 = t5; +f_addstr(mem, sp, a0, a1); +goto L4142f8; +a1 = t5; +L4142f8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L414300: +t8 = 0x1000a140; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if ((int)t8 <= 0) {//nop; +goto L414334;} +//nop; +a1 = 0x10002164; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41432c; +a1 = a1; +L41432c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L414334: +t1 = 0x1000a150; +at = 0x10000; +t1 = MEM_U32(t1 + 0); +//nop; +t0 = t1 & at; +if (t0 == 0) {//nop; +goto L41436c;} +//nop; +a1 = 0x10002174; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L414364; +a1 = a1; +L414364: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L41436c: +t4 = 0x100003a4; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L4143a0;} +//nop; +a1 = 0x10002178; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L414398; +a1 = a1; +L414398: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4143a0: +t2 = 0x10000234; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L4143d4;} +//nop; +a1 = 0x10002184; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4143cc; +a1 = a1; +L4143cc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4143d4: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a330; +//nop; +f_addlist(mem, sp, a0, a1); +goto L4143e8; +//nop; +L4143e8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t3 = 0x10000124; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L414444;} +//nop; +a1 = 0x1000a1fc; +a0 = 0x10002188; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L414424; +a0 = a0; +L414424: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41443c; +a1 = s4; +L41443c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L414444: +t9 = 0x10000124; +s3 = zero; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L414484;} +//nop; +a1 = 0x1000218c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L414470; +a1 = a1; +L414470: +// bdead 40160003 gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = zero; +goto L414600; +MEM_U32(at + 0) = zero; +L414484: +t6 = 0x1000a1e6; +at = 0x66; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L414524;} +//nop; +t7 = 0x1000a520; +t5 = s0 << 2; +t7 = MEM_U32(t7 + 8); +//nop; +t8 = t7 + t5; +a0 = MEM_U32(t8 + 0); +a1 = 0x42; +v0 = f_mksuf(mem, sp, a0, a1); +goto L4144bc; +a1 = 0x42; +L4144bc: +// bdead 4016000b gp = MEM_U32(sp + 64); +//nop; +t1 = 0x10000278; +at = 0x1000a1f4; +t1 = MEM_U32(t1 + 0); +MEM_U32(at + 0) = v0; +if (t1 == 0) {//nop; +goto L414600;} +//nop; +a1 = 0x10002194; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4144f0; +a1 = a1; +L4144f0: +// bdead 40060003 gp = MEM_U32(sp + 64); +t4 = s0 << 2; +t0 = 0x1000a520; +//nop; +t0 = MEM_U32(t0 + 8); +a1 = 0x55; +t2 = t0 + t4; +a0 = MEM_U32(t2 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L414518; +//nop; +L414518: +// bdead 4006000b gp = MEM_U32(sp + 64); +s3 = v0; +goto L414600; +s3 = v0; +L414524: +t3 = 0x10000240; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L4145ec;} +//nop; +t9 = 0x1000a520; +t6 = s0 << 2; +t9 = MEM_U32(t9 + 8); +a1 = 0x42; +t7 = t9 + t6; +//nop; +a0 = MEM_U32(t7 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L414560; +//nop; +L414560: +// bdead 4016000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a0 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L414584; +//nop; +L414584: +// bdead 4016000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L414600;} +//nop; +t8 = 0x1000a1f4; +t5 = 0x10002198; +//nop; +t8 = MEM_U32(t8 + 0); +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t8; +f_error(mem, sp, a0, a1, a2, a3); +goto L4145c8; +MEM_U32(sp + 24) = t8; +L4145c8: +// bdead 40160003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4145e0; +//nop; +L4145e0: +// bdead 40160003 gp = MEM_U32(sp + 64); +//nop; +goto L414600; +//nop; +L4145ec: +t1 = 0x1000a380; +at = 0x1000a1f4; +t0 = MEM_U32(t1 + 12); +//nop; +MEM_U32(at + 0) = t0; +L414600: +t4 = 0x1000a1f4; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L414654;} +//nop; +a1 = 0x100021c4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41462c; +a1 = a1; +L41462c: +// bdead 40160003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41464c; +//nop; +L41464c: +// bdead 40160003 gp = MEM_U32(sp + 64); +//nop; +L414654: +t2 = 0x1000a1a0; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L4146a0;} +//nop; +t3 = 0x1000a24c; +at = 0x69; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 == at) {at = 0x6d; +goto L4146a0;} +at = 0x6d; +if (t3 == at) {//nop; +goto L4146a0;} +//nop; +s2 = 0x1000a1f0; +//nop; +s2 = MEM_U32(s2 + 0); +//nop; +goto L4146c0; +//nop; +L4146a0: +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4146b8; +//nop; +L4146b8: +// bdead 40160003 gp = MEM_U32(sp + 64); +s2 = zero; +L4146c0: +t9 = 0x1000a1f8; +a0 = 0x100000a8; +t9 = MEM_U32(t9 + 0); +a1 = 0x1000a560; +MEM_U32(sp + 16) = t9; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a2 = s2; +a3 = s3; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L4146ec; +a3 = s3; +L4146ec: +// bdead 4006018b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4149c8;} +//nop; +t6 = 0x100002a8; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L4148a8;} +//nop; +t7 = 0x1000a244; +t5 = 0x1000a248; +t7 = MEM_U32(t7 + 0); +t5 = MEM_U32(t5 + 0); +//nop; +at = (int)t7 < (int)t5; +if (at == 0) {//nop; +goto L41488c;} +//nop; +t1 = 0x1000a520; +at = 0x1000a244; +t1 = MEM_U32(t1 + 8); +a0 = 0x1000a23c; +t8 = t7 + 0x1; +t0 = s0 << 2; +//nop; +MEM_U32(at + 0) = t8; +t4 = t1 + t0; +a1 = MEM_U32(t4 + 0); +a0 = MEM_U32(a0 + 0); +a2 = 0x3; +v0 = f_edit_src(mem, sp, a0, a1, a2); +goto L414764; +a2 = 0x3; +L414764: +// bdead 4006008b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4147a4;} +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_show_err(mem, sp, a0); +goto L414784; +//nop; +L414784: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41479c; +//nop; +L41479c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4147a4: +t2 = 0x1000a1a0; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L4147dc;} +//nop; +t3 = 0x1000a24c; +at = 0x65; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 == at) {at = 0x72; +goto L4147dc;} +at = 0x72; +if (t3 != at) {//nop; +goto L414818;} +//nop; +L4147dc: +t9 = 0x1000a24c; +at = 0x69; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == at) {at = 0x66; +goto L414818;} +at = 0x66; +if (t9 == at) {//nop; +goto L414818;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L414810; +//nop; +L414810: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L414818: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41482c; +//nop; +L41482c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L414848; +//nop; +L414848: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L414864; +//nop; +L414864: +// bdead 40060103 gp = MEM_U32(sp + 64); +t5 = s0 << 2; +t6 = 0x1000a520; +at = 0x1000a1f0; +t6 = MEM_U32(t6 + 8); +//nop; +t7 = t6 + t5; +t8 = MEM_U32(t7 + 0); +MEM_U32(at + 0) = t8; +goto L40a8e0; +MEM_U32(at + 0) = t8; +L41488c: +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_show_err(mem, sp, a0); +goto L4148a0; +//nop; +L4148a0: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L4148a8: +t1 = 0x10000404; +t4 = 0x1000a1a0; +t1 = MEM_U32(t1 + 0); +at = 0x10000404; +t4 = MEM_U32(t4 + 0); +t0 = t1 + 0x1; +if (t4 != 0) {MEM_U32(at + 0) = t0; +goto L414904;} +MEM_U32(at + 0) = t0; +t2 = 0x1000a150; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +t3 = t2 & 0x1; +if (t3 != 0) {//nop; +goto L414904;} +//nop; +t9 = 0x1000a24c; +at = 0x65; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == at) {at = 0x72; +goto L414904;} +at = 0x72; +if (t9 != at) {//nop; +goto L414974;} +//nop; +L414904: +t6 = 0x1000a24c; +at = 0x69; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == at) {at = 0x6d; +goto L414974;} +at = 0x6d; +if (t6 == at) {//nop; +goto L414974;} +//nop; +t5 = 0x10000240; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L414974;} +//nop; +t7 = 0x1000a150; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +t8 = t7 & 0x4; +if (t8 != 0) {//nop; +goto L414974;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41496c; +//nop; +L41496c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L414974: +t1 = 0x10000240; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4149a0; +//nop; +L4149a0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4149bc; +//nop; +L4149bc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L4149c8: +t0 = 0x100002a8; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L4149fc;} +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4149f4; +//nop; +L4149f4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L4149fc: +t4 = 0x10000124; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L414a4c;} +//nop; +t2 = 0x1000a1a0; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L414a40; +//nop; +L414a40: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L414a4c: +t3 = 0x1000a1a0; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L414ac0;} +//nop; +t9 = 0x1000a150; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +t6 = t9 & 0x1; +if (t6 != 0) {//nop; +goto L414ac0;} +//nop; +t5 = 0x1000043c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L414ac0;} +//nop; +t7 = 0x1000a24c; +at = 0x65; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 == at) {at = 0x72; +goto L414ac0;} +at = 0x72; +if (t7 == at) {at = 0x46; +goto L414ac0;} +at = 0x46; +if (t7 != at) {//nop; +goto L414b30;} +//nop; +L414ac0: +t8 = 0x1000a24c; +at = 0x69; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == at) {at = 0x6d; +goto L414b30;} +at = 0x6d; +if (t8 == at) {//nop; +goto L414b30;} +//nop; +t1 = 0x10000240; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L414b30;} +//nop; +t0 = 0x1000a150; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +t4 = t0 & 0x4; +if (t4 != 0) {//nop; +goto L414b30;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L414b28; +//nop; +L414b28: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L414b30: +t2 = 0x1000a1f4; +at = 0x1000a1f0; +t3 = 0x1000a1e6; +t2 = MEM_U32(t2 + 0); +t3 = MEM_U8(t3 + 0); +MEM_U32(at + 0) = t2; +at = 0x66; +if (t3 == at) {//nop; +goto L41977c;} +//nop; +L414b54: +t9 = 0x10000230; +at = 0x3; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == at) {at = 0x4; +goto L414bac;} +at = 0x4; +if (t9 == at) {//nop; +goto L414bac;} +//nop; +t6 = 0x10000224; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L414bac;} +//nop; +t5 = 0x10000374; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L4164f0;} +//nop; +//nop; +goto L416864; +//nop; +L414bac: +at = 0x1000a560; +a1 = 0x100021c8; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L414bc8; +a1 = a1; +L414bc8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t7 = 0x10000234; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L414c04;} +//nop; +a1 = 0x100021d0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L414bfc; +a1 = a1; +L414bfc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L414c04: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a438; +//nop; +f_addlist(mem, sp, a0, a1); +goto L414c18; +//nop; +L414c18: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t8 = 0x1000a1ec; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L414c70;} +//nop; +t1 = 0x10000224; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L414c70;} +//nop; +t0 = 0x1000a520; +at = 0x1; +t0 = MEM_U32(t0 + 4); +//nop; +if (t0 != at) {at = 0x1000a1f4; +goto L414c70;} +at = 0x1000a1f4; +MEM_U32(at + 0) = t8; +goto L414ca4; +MEM_U32(at + 0) = t8; +L414c70: +t4 = 0x1000a520; +t2 = s0 << 2; +t4 = MEM_U32(t4 + 8); +//nop; +t3 = t4 + t2; +a0 = MEM_U32(t3 + 0); +a1 = 0x75; +v0 = f_mksuf(mem, sp, a0, a1); +goto L414c90; +a1 = 0x75; +L414c90: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +L414ca4: +a1 = 0x100021d4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L414cb8; +a1 = a1; +L414cb8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L414cd8; +//nop; +L414cd8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L414cf8; +//nop; +L414cf8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1fc; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L414d18; +//nop; +L414d18: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000bc; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L414d40; +MEM_U32(sp + 16) = zero; +L414d40: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L414df4;} +//nop; +t9 = 0x10000404; +t5 = 0x10000240; +t9 = MEM_U32(t9 + 0); +at = 0x10000404; +t5 = MEM_U32(t5 + 0); +t6 = t9 + 0x1; +if (t5 != 0) {MEM_U32(at + 0) = t6; +goto L41977c;} +MEM_U32(at + 0) = t6; +t7 = 0x1000a24c; +at = 0x42; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 == at) {//nop; +goto L414da0;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L414d98; +//nop; +L414d98: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L414da0: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L414db4; +//nop; +L414db4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x1000a250; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L414de8; +//nop; +L414de8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L414df4: +t0 = 0x10000228; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L414e2c;} +//nop; +t8 = 0x10000230; +at = 0x3; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == at) {at = 0x4; +goto L414e2c;} +at = 0x4; +if (t8 != at) {//nop; +goto L416864;} +//nop; +L414e2c: +t4 = 0x10000240; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L414eac;} +//nop; +t2 = 0x1000a24c; +at = 0x42; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == at) {//nop; +goto L414e78;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L414e70; +//nop; +L414e70: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L414e78: +t3 = 0x1000a250; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L414eac;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L414ea4; +//nop; +L414ea4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L414eac: +t9 = 0x1000a1f4; +at = 0x1000a1f0; +t9 = MEM_U32(t9 + 0); +MEM_U32(at + 0) = t9; +goto L41977c; +MEM_U32(at + 0) = t9; +L414ec0: +t6 = 0x10000324; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L414f18;} +//nop; +t5 = 0x1000031c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L414f18;} +//nop; +a1 = 0x100021d8; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L414f04; +a1 = a1; +L414f04: +// bdead 40060003 gp = MEM_U32(sp + 64); +t7 = 0x1; +at = 0x1000031c; +//nop; +MEM_U32(at + 0) = t7; +L414f18: +at = 0x1000a560; +a1 = 0x100021e4; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L414f34; +a1 = a1; +L414f34: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x10000280; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L414f78;} +//nop; +a1 = 0x1000a25c; +a0 = 0x100021e8; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +v0 = wrapper_strcmp(mem, a0, a1); +goto L414f6c; +a0 = a0; +L414f6c: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L415080;} +//nop; +L414f78: +t0 = 0x10000260; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L415080;} +//nop; +a1 = 0x1000a25c; +a0 = 0x100021ec; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +v0 = wrapper_strcmp(mem, a0, a1); +goto L414fa8; +a0 = a0; +L414fa8: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L415080;} +//nop; +t8 = 0x10000324; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L415028;} +//nop; +t4 = 0x1000a32c; +a1 = 0x1000a25c; +a2 = 0x10000428; +a0 = 0x100021f0; +a3 = 0x100021f4; +//nop; +t4 = MEM_U32(t4 + 0); +a1 = MEM_U32(a1 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a0 = a0; +a3 = a3; +MEM_U32(sp + 16) = t4; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L415004; +MEM_U32(sp + 16) = t4; +L415004: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41501c; +a1 = s4; +L41501c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L415080; +//nop; +L415028: +t2 = 0x1000a32c; +a1 = 0x1000a25c; +a2 = 0x10000428; +a0 = 0x10002208; +a3 = 0x1000220c; +//nop; +t2 = MEM_U32(t2 + 0); +a1 = MEM_U32(a1 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a0 = a0; +a3 = a3; +MEM_U32(sp + 16) = t2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L415060; +MEM_U32(sp + 16) = t2; +L415060: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L415078; +a1 = s4; +L415078: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L415080: +t3 = 0x100002f0; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L415280;} +//nop; +t9 = MEM_U32(sp + 332); +//nop; +if (t9 != 0) {//nop; +goto L415280;} +//nop; +a1 = 0x1000a25c; +a0 = 0x10002218; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4150c0; +a0 = a0; +L4150c0: +// bdead 4006000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4151b4;} +//nop; +t6 = 0x10000324; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41514c;} +//nop; +t5 = 0x1000a32c; +a1 = 0x1000a25c; +a2 = 0x10000428; +t7 = 0x1000222c; +a0 = 0x1000221c; +a3 = 0x10002220; +//nop; +t5 = MEM_U32(t5 + 0); +a1 = MEM_U32(a1 + 0); +a2 = MEM_U32(a2 + 0); +t7 = t7; +MEM_U32(sp + 20) = t7; +MEM_U32(sp + 24) = zero; +a0 = a0; +a3 = a3; +MEM_U32(sp + 16) = t5; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L415128; +MEM_U32(sp + 16) = t5; +L415128: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L415140; +a1 = s4; +L415140: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L415280; +//nop; +L41514c: +t1 = 0x1000a32c; +a1 = 0x1000a25c; +a2 = 0x10000428; +t0 = 0x1000224c; +a0 = 0x1000223c; +a3 = 0x10002240; +//nop; +t1 = MEM_U32(t1 + 0); +a1 = MEM_U32(a1 + 0); +a2 = MEM_U32(a2 + 0); +t0 = t0; +MEM_U32(sp + 20) = t0; +MEM_U32(sp + 24) = zero; +a0 = a0; +a3 = a3; +MEM_U32(sp + 16) = t1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L415190; +MEM_U32(sp + 16) = t1; +L415190: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L4151a8; +a1 = s4; +L4151a8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L415280; +//nop; +L4151b4: +t8 = 0x10000324; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L415228;} +//nop; +a1 = 0x10000428; +a3 = 0x1000a32c; +t4 = 0x10002264; +a0 = 0x10002254; +a2 = 0x10002258; +//nop; +a1 = MEM_U32(a1 + 0); +a3 = MEM_U32(a3 + 0); +t4 = t4; +MEM_U32(sp + 16) = t4; +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L415204; +a2 = a2; +L415204: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41521c; +a1 = s4; +L41521c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L415280; +//nop; +L415228: +a1 = 0x10000428; +a3 = 0x1000a32c; +t2 = 0x10002284; +a0 = 0x10002274; +a2 = 0x10002278; +//nop; +a1 = MEM_U32(a1 + 0); +a3 = MEM_U32(a3 + 0); +t2 = t2; +MEM_U32(sp + 16) = t2; +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L415260; +a2 = a2; +L415260: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L415278; +a1 = s4; +L415278: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L415280: +t3 = 0x10000370; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L415370;} +//nop; +t9 = 0x100003e4; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L4152e8;} +//nop; +a0 = 0x1000228c; +//nop; +a1 = zero; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4152c8; +a0 = a0; +L4152c8: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L4152e0; +a1 = s4; +L4152e0: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L4152e8: +a0 = 0x1000229c; +//nop; +a1 = zero; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L415300; +a0 = a0; +L415300: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L415318; +a1 = s4; +L415318: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t6 = 0x10000348; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L415370;} +//nop; +a1 = 0x100022ac; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41534c; +a1 = a1; +L41534c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100022c4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415368; +a1 = a1; +L415368: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L415370: +t5 = 0x1000a1b8; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L4153d0;} +//nop; +t7 = MEM_U8(t5 + 0); +//nop; +if (t7 == 0) {//nop; +goto L4153d0;} +//nop; +a0 = 0x100022d8; +//nop; +a1 = t5; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4153b0; +a0 = a0; +L4153b0: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L4153c8; +a1 = s4; +L4153c8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4153d0: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a448; +//nop; +f_addlist(mem, sp, a0, a1); +goto L4153e4; +//nop; +L4153e4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a4e0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L415400; +//nop; +L415400: +// bdead 40060183 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x10000424; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L4155bc;} +//nop; +a0 = 0x100022dc; +//nop; +a1 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L415434; +a0 = a0; +L415434: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41544c; +a1 = s4; +L41544c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t0 = 0x10000324; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L415514;} +//nop; +a0 = 0x100022e0; +a1 = 0x100022e4; +a2 = 0x100022f0; +//nop; +a3 = zero; +a0 = a0; +a1 = a1; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L415490; +a2 = a2; +L415490: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L4154a8; +a1 = s4; +L4154a8: +// bdead 40060003 gp = MEM_U32(sp + 64); +a3 = zero; +a0 = 0x1000a26c; +a2 = 0x1000a254; +a1 = 0x10002304; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4154d0; +a1 = a1; +L4154d0: +// bdead 4006000b gp = MEM_U32(sp + 64); +a3 = zero; +a0 = 0x1000a26c; +at = 0x10000164; +a1 = 0x10002318; +a2 = 0x1000232c; +//nop; +a0 = MEM_U32(a0 + 0); +MEM_U32(at + 0) = v0; +a1 = a1; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L415500; +a2 = a2; +L415500: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x10000168; +MEM_U32(at + 0) = v0; +goto L4155bc; +MEM_U32(at + 0) = v0; +L415514: +a0 = 0x10002334; +a1 = 0x10002338; +a2 = 0x10002344; +//nop; +a3 = zero; +a0 = a0; +a1 = a1; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L415538; +a2 = a2; +L415538: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L415550; +a1 = s4; +L415550: +// bdead 40060003 gp = MEM_U32(sp + 64); +a3 = zero; +a0 = 0x1000a26c; +a2 = 0x1000a254; +a1 = 0x10002350; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L415578; +a1 = a1; +L415578: +// bdead 4006000b gp = MEM_U32(sp + 64); +a3 = zero; +a0 = 0x1000a26c; +at = 0x10000164; +a1 = 0x1000235c; +a2 = 0x10002368; +//nop; +a0 = MEM_U32(a0 + 0); +MEM_U32(at + 0) = v0; +a1 = a1; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4155a8; +a2 = a2; +L4155a8: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x10000168; +//nop; +MEM_U32(at + 0) = v0; +L4155bc: +t8 = 0x10000228; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L415630;} +//nop; +a1 = 0x10000164; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4155ec; +//nop; +L4155ec: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t4 = 0x10000220; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L415680;} +//nop; +a1 = 0x100001d4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L415624; +//nop; +L415624: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L415680; +//nop; +L415630: +a1 = 0x10002370; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415644; +a1 = a1; +L415644: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t2 = 0x1000033c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L415680;} +//nop; +a1 = 0x10002380; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415678; +a1 = a1; +L415678: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415680: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a530; +a2 = 0x1000a540; +//nop; +f_adduldlist(mem, sp, a0, a1, a2); +goto L415698; +//nop; +L415698: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t3 = 0x10000228; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L415f5c;} +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a2e0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L4156cc; +//nop; +L4156cc: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x2; +t9 = 0x1000a36c; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == at) {//nop; +goto L415704;} +//nop; +t6 = 0x10000388; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L415858;} +//nop; +L415704: +a0 = 0x10000174; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_newstr(mem, sp, a0); +goto L415718; +//nop; +L415718: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addspacedstr(mem, sp, a0, a1); +goto L415730; +a1 = s4; +L415730: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x100001d8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_newstr(mem, sp, a0); +goto L41574c; +//nop; +L41574c: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addspacedstr(mem, sp, a0, a1); +goto L415764; +a1 = s4; +L415764: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x100001bc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_newstr(mem, sp, a0); +goto L415780; +//nop; +L415780: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addspacedstr(mem, sp, a0, a1); +goto L415798; +a1 = s4; +L415798: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x100001e4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_newstr(mem, sp, a0); +goto L4157b4; +//nop; +L4157b4: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addspacedstr(mem, sp, a0, a1); +goto L4157cc; +a1 = s4; +L4157cc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t7 = 0x10000384; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L415804;} +//nop; +t5 = 0x10000348; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L415858;} +//nop; +L415804: +t1 = 0x1000a27c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L415858;} +//nop; +a1 = 0x10002394; +//nop; +a0 = t1; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L415830; +a1 = a1; +L415830: +// bdead 4006000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L415858;} +//nop; +a1 = 0x1000239c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addspacedstr(mem, sp, a0, a1); +goto L415850; +a1 = a1; +L415850: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415858: +t0 = 0x1000a36c; +at = 0x3; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == at) {//nop; +goto L415888;} +//nop; +t8 = 0x1000038c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L415a74;} +//nop; +L415888: +t4 = 0x1000a150; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L4158c0;} +//nop; +a1 = 0x1000a5c8; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4158b8; +//nop; +L4158b8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4158c0: +t2 = 0x10000324; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L4158f0;} +//nop; +t3 = 0x10000424; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L415928;} +//nop; +L4158f0: +a0 = 0x10000184; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_newstr(mem, sp, a0); +goto L415904; +//nop; +L415904: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addspacedstr(mem, sp, a0, a1); +goto L41591c; +a1 = s4; +L41591c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L415948; +//nop; +L415928: +a1 = 0x10000198; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L415940; +//nop; +L415940: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415948: +t9 = 0x10000324; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L415978;} +//nop; +t6 = 0x10000424; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L4159ac;} +//nop; +L415978: +a0 = 0x1000018c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_newstr(mem, sp, a0); +goto L41598c; +//nop; +L41598c: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addspacedstr(mem, sp, a0, a1); +goto L4159a4; +a1 = s4; +L4159a4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4159ac: +t7 = 0x10000324; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L4159dc;} +//nop; +t5 = 0x10000424; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L415a10;} +//nop; +L4159dc: +a0 = 0x10000194; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_newstr(mem, sp, a0); +goto L4159f0; +//nop; +L4159f0: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addspacedstr(mem, sp, a0, a1); +goto L415a08; +a1 = s4; +L415a08: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415a10: +t1 = 0x10000324; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L415a40;} +//nop; +t0 = 0x10000424; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L415a74;} +//nop; +L415a40: +a0 = 0x100001a0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_newstr(mem, sp, a0); +goto L415a54; +//nop; +L415a54: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addspacedstr(mem, sp, a0, a1); +goto L415a6c; +a1 = s4; +L415a6c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415a74: +t8 = 0x1000a36c; +at = 0x5; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L415b28;} +//nop; +a1 = 0x100001b4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L415aa4; +//nop; +L415aa4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100001d8; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L415ac4; +//nop; +L415ac4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100023a4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415ae0; +a1 = a1; +L415ae0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100001bc; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L415b00; +//nop; +L415b00: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100001e4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L415b20; +//nop; +L415b20: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415b28: +t4 = 0x1000a36c; +at = 0x2; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == at) {at = 0x3; +goto L415ba0;} +at = 0x3; +if (t4 == at) {//nop; +goto L415ba0;} +//nop; +t2 = 0x10000388; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L415ba0;} +//nop; +t3 = 0x1000038c; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L415ba0;} +//nop; +t9 = 0x1000a134; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {at = 0x5; +goto L415ba0;} +at = 0x5; +if (t4 == at) {at = 0x6; +goto L415ba0;} +at = 0x6; +if (t4 != at) {//nop; +goto L415bec;} +//nop; +L415ba0: +t6 = 0x1000a28c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L415bec;} +//nop; +a0 = 0x1000017c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_newstr(mem, sp, a0); +goto L415bcc; +//nop; +L415bcc: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addspacedstr(mem, sp, a0, a1); +goto L415be4; +a1 = s4; +L415be4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415bec: +t7 = 0x10000220; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L415c38;} +//nop; +a0 = 0x100001d4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_newstr(mem, sp, a0); +goto L415c18; +//nop; +L415c18: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addspacedstr(mem, sp, a0, a1); +goto L415c30; +a1 = s4; +L415c30: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415c38: +t5 = 0x1000a188; +at = 0x10000; +t5 = MEM_U32(t5 + 0); +//nop; +t1 = t5 & at; +if (t1 == 0) {//nop; +goto L415ca8;} +//nop; +a1 = 0x100001f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L415c6c; +//nop; +L415c6c: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x1; +t0 = 0x1000a36c; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L415ca8;} +//nop; +a1 = 0x100023b0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415ca0; +a1 = a1; +L415ca0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415ca8: +t8 = 0x1000043c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L415cf4;} +//nop; +t2 = 0x1000a36c; +at = 0x1; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L415cf4;} +//nop; +a1 = 0x100023b8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415cec; +a1 = a1; +L415cec: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415cf4: +t3 = 0x1000a36c; +at = 0x3; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L415e1c;} +//nop; +t9 = 0x1000039c; +at = 0x2; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L415d60;} +//nop; +a1 = 0x100023c0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415d38; +a1 = a1; +L415d38: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100023c8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415d54; +a1 = a1; +L415d54: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L415e50; +//nop; +L415d60: +t4 = 0x10000424; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L415dac;} +//nop; +t6 = 0x1000a5b4; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L415dac;} +//nop; +a1 = 0x100023cc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415da4; +a1 = a1; +L415da4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415dac: +t7 = 0x1000a56c; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L415de4;} +//nop; +a1 = 0x100023d4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415dd8; +a1 = a1; +L415dd8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L415e50; +//nop; +L415de4: +t5 = 0x1000a570; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L415e50;} +//nop; +a1 = 0x100023dc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415e10; +a1 = a1; +L415e10: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L415e50; +//nop; +L415e1c: +t1 = 0x1000a56c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L415e50;} +//nop; +a1 = 0x100023e4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415e48; +a1 = a1; +L415e48: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415e50: +t0 = 0x1000030c; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L415ed8;} +//nop; +a0 = 0x100001a8; +a1 = 0x100023ec; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_fopen(mem, a0, a1); +goto L415e80; +a1 = a1; +L415e80: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a234; +t8 = 0x1000a234; +MEM_U32(at + 0) = v0; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L415ed8;} +//nop; +a0 = 0x100001ac; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_newstr(mem, sp, a0); +goto L415eb8; +//nop; +L415eb8: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addspacedstr(mem, sp, a0, a1); +goto L415ed0; +a1 = s4; +L415ed0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415ed8: +a1 = 0x100023f0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415eec; +a1 = a1; +L415eec: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t2 = 0x100002a0; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L415f28;} +//nop; +a1 = 0x100023f4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415f20; +a1 = a1; +L415f20: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415f28: +t3 = 0x100002a4; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L415f5c;} +//nop; +a1 = 0x100023f8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415f54; +a1 = a1; +L415f54: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415f5c: +t9 = 0x10000228; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L415fac;} +//nop; +t4 = 0x100001e8; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L415fac;} +//nop; +a1 = 0x10000168; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L415fa4; +//nop; +L415fa4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415fac: +t6 = 0x1000a30c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L415fdc;} +//nop; +//nop; +a0 = 0x1000a560; +a1 = t6; +f_addstr(mem, sp, a0, a1); +goto L415fd4; +a1 = t6; +L415fd4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L415fdc: +a1 = 0x10002400; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L415ff0; +a1 = a1; +L415ff0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t7 = 0x1000a214; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {at = 0x1000a1f4; +goto L416018;} +at = 0x1000a1f4; +MEM_U32(at + 0) = t7; +goto L416090; +MEM_U32(at + 0) = t7; +L416018: +t5 = 0x1000a1e6; +at = 0x75; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {//nop; +goto L416048;} +//nop; +t1 = 0x10000240; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L41607c;} +//nop; +L416048: +t0 = 0x1000a520; +t8 = s0 << 2; +t0 = MEM_U32(t0 + 8); +//nop; +t2 = t0 + t8; +a0 = MEM_U32(t2 + 0); +a1 = 0x75; +v0 = f_mksuf(mem, sp, a0, a1); +goto L416068; +a1 = 0x75; +L416068: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L416090; +MEM_U32(at + 0) = v0; +L41607c: +t3 = 0x1000a380; +at = 0x1000a1f4; +t9 = MEM_U32(t3 + 16); +//nop; +MEM_U32(at + 0) = t9; +L416090: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4160a8; +//nop; +L4160a8: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000c4; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L4160d0; +MEM_U32(sp + 16) = zero; +L4160d0: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41611c;} +//nop; +t4 = 0x10000404; +t7 = 0x10000240; +t4 = MEM_U32(t4 + 0); +at = 0x10000404; +t7 = MEM_U32(t7 + 0); +t6 = t4 + 0x1; +if (t7 != 0) {MEM_U32(at + 0) = t6; +goto L41977c;} +MEM_U32(at + 0) = t6; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416110; +//nop; +L416110: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L41611c: +t5 = 0x1000a1f4; +at = 0x1000a1f0; +t1 = 0x1000a530; +t5 = MEM_U32(t5 + 0); +t1 = MEM_U32(t1 + 4); +MEM_U32(at + 0) = t5; +at = 0x1; +if (t1 != at) {//nop; +goto L41619c;} +//nop; +t0 = 0x1000a520; +at = 0x2; +t0 = MEM_U32(t0 + 4); +//nop; +if (t0 != at) {//nop; +goto L41619c;} +//nop; +t8 = 0x10000230; +at = 0x3; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == at) {at = 0x4; +goto L416178;} +at = 0x4; +if (t8 != at) {//nop; +goto L41619c;} +//nop; +L416178: +t2 = 0x1000a530; +//nop; +t2 = MEM_U32(t2 + 8); +//nop; +a0 = MEM_U32(t2 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416194; +//nop; +L416194: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L41619c: +t3 = 0x1000a1e6; +at = 0x75; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 == at) {at = 0x1000a560; +goto L41977c;} +L4161b0: +at = 0x1000a560; +a1 = 0x10002404; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4161cc; +a1 = a1; +L4161cc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t9 = 0x10000234; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L416208;} +//nop; +a1 = 0x1000240c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L416200; +a1 = a1; +L416200: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L416208: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a460; +//nop; +f_addlist(mem, sp, a0, a1); +goto L41621c; +//nop; +L41621c: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x73; +t4 = 0x1000a1e6; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == at) {//nop; +goto L416254;} +//nop; +t6 = 0x10000240; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L416300;} +//nop; +L416254: +t7 = 0x1000a520; +t5 = s0 << 2; +t7 = MEM_U32(t7 + 8); +//nop; +t1 = t7 + t5; +a0 = MEM_U32(t1 + 0); +a1 = 0x53; +v0 = f_mksuf(mem, sp, a0, a1); +goto L416274; +a1 = 0x53; +L416274: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a0 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L416298; +//nop; +L416298: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L416314;} +//nop; +t8 = 0x1000a1f4; +t0 = 0x10002410; +//nop; +t8 = MEM_U32(t8 + 0); +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t8; +f_error(mem, sp, a0, a1, a2, a3); +goto L4162dc; +MEM_U32(sp + 24) = t8; +L4162dc: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4162f4; +//nop; +L4162f4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L416314; +//nop; +L416300: +t2 = 0x1000a380; +at = 0x1000a1f4; +t3 = MEM_U32(t2 + 20); +//nop; +MEM_U32(at + 0) = t3; +L416314: +a1 = 0x1000243c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L416328; +a1 = a1; +L416328: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L416348; +//nop; +L416348: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10002440; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L416364; +a1 = a1; +L416364: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1fc; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L416384; +//nop; +L416384: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4163a4; +//nop; +L4163a4: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000c0; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L4163cc; +MEM_U32(sp + 16) = zero; +L4163cc: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L416468;} +//nop; +t9 = 0x10000404; +t6 = 0x10000240; +t9 = MEM_U32(t9 + 0); +at = 0x10000404; +t6 = MEM_U32(t6 + 0); +t4 = t9 + 0x1; +if (t6 != 0) {MEM_U32(at + 0) = t4; +goto L416430;} +MEM_U32(at + 0) = t4; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41640c; +//nop; +L41640c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416428; +//nop; +L416428: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L416430: +t7 = 0x1000a250; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41645c; +//nop; +L41645c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L416468: +t5 = 0x10000240; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L4164cc;} +//nop; +t1 = 0x1000a24c; +at = 0x75; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 == at) {//nop; +goto L4164cc;} +//nop; +t0 = 0x1000a214; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L4164cc;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4164c4; +//nop; +L4164c4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L4164cc: +t8 = 0x1000a1f4; +at = 0x1000a1f0; +t2 = 0x1000a1e6; +t8 = MEM_U32(t8 + 0); +t2 = MEM_U8(t2 + 0); +MEM_U32(at + 0) = t8; +at = 0x73; +if (t2 == at) {//nop; +goto L41977c;} +//nop; +L4164f0: +t3 = 0x10000230; +at = 0x3; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == at) {at = 0x4; +goto L416524;} +at = 0x4; +if (t3 == at) {//nop; +goto L416524;} +//nop; +t9 = 0x10000374; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {at = 0x1000a560; +goto L416864;} +L416524: +at = 0x1000a560; +a1 = 0x10002444; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L416540; +a1 = a1; +L416540: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t4 = 0x10000234; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L41657c;} +//nop; +a1 = 0x1000244c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L416574; +a1 = a1; +L416574: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L41657c: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a470; +//nop; +f_addlist(mem, sp, a0, a1); +goto L416590; +//nop; +L416590: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4165b0; +//nop; +L4165b0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10002450; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4165cc; +a1 = a1; +L4165cc: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x6d; +t6 = 0x1000a1e6; +//nop; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == at) {//nop; +goto L416604;} +//nop; +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L4166b0;} +//nop; +L416604: +t5 = 0x1000a520; +t1 = s0 << 2; +t5 = MEM_U32(t5 + 8); +//nop; +t0 = t5 + t1; +a0 = MEM_U32(t0 + 0); +a1 = 0x4d; +v0 = f_mksuf(mem, sp, a0, a1); +goto L416624; +a1 = 0x4d; +L416624: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a0 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L416648; +//nop; +L416648: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L4166c4;} +//nop; +t2 = 0x1000a1f4; +t8 = 0x10002454; +//nop; +t2 = MEM_U32(t2 + 0); +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t2; +f_error(mem, sp, a0, a1, a2, a3); +goto L41668c; +MEM_U32(sp + 24) = t2; +L41668c: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4166a4; +//nop; +L4166a4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L4166c4; +//nop; +L4166b0: +t3 = 0x1000a380; +at = 0x1000a1f4; +t9 = MEM_U32(t3 + 24); +//nop; +MEM_U32(at + 0) = t9; +L4166c4: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4166dc; +//nop; +L4166dc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10002480; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4166f8; +a1 = a1; +L4166f8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1fc; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L416718; +//nop; +L416718: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000c8; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L416740; +MEM_U32(sp + 16) = zero; +L416740: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4167f4;} +//nop; +t4 = 0x10000404; +t7 = 0x10000240; +t4 = MEM_U32(t4 + 0); +at = 0x10000404; +t7 = MEM_U32(t7 + 0); +t6 = t4 + 0x1; +if (t7 != 0) {MEM_U32(at + 0) = t6; +goto L41977c;} +MEM_U32(at + 0) = t6; +t5 = 0x1000a24c; +at = 0x53; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {//nop; +goto L4167a0;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416798; +//nop; +L416798: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4167a0: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4167b4; +//nop; +L4167b4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x1000a250; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4167e8; +//nop; +L4167e8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L4167f4: +t0 = 0x10000240; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L416840;} +//nop; +t8 = 0x1000a24c; +at = 0x53; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == at) {//nop; +goto L416840;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416838; +//nop; +L416838: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L416840: +t2 = 0x1000a1f4; +at = 0x1000a1f0; +t3 = 0x1000a1e6; +t2 = MEM_U32(t2 + 0); +t3 = MEM_U8(t3 + 0); +MEM_U32(at + 0) = t2; +at = 0x6d; +if (t3 == at) {//nop; +goto L41977c;} +//nop; +L416864: +t9 = 0x1000029c; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {at = 0x1000a560; +goto L416be8;} +at = 0x1000a560; +a1 = 0x10002484; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L416894; +a1 = a1; +L416894: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t4 = 0x10000234; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L4168d0;} +//nop; +a1 = 0x1000248c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4168c8; +a1 = a1; +L4168c8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4168d0: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a480; +//nop; +f_addlist(mem, sp, a0, a1); +goto L4168e4; +//nop; +L4168e4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L416904; +//nop; +L416904: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10002490; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L416920; +a1 = a1; +L416920: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x76; +t6 = 0x1000a1e6; +//nop; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == at) {//nop; +goto L416958;} +//nop; +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L416a48;} +//nop; +L416958: +t5 = 0x1000a1e6; +at = 0x76; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {//nop; +goto L416988;} +//nop; +t1 = 0x10000240; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L416a34;} +//nop; +L416988: +t0 = 0x1000a520; +t8 = s0 << 2; +t0 = MEM_U32(t0 + 8); +//nop; +t2 = t0 + t8; +a0 = MEM_U32(t2 + 0); +a1 = 0x56; +v0 = f_mksuf(mem, sp, a0, a1); +goto L4169a8; +a1 = 0x56; +L4169a8: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a0 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L4169cc; +//nop; +L4169cc: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L416a48;} +//nop; +t9 = 0x1000a1f4; +t3 = 0x10002494; +t9 = MEM_U32(t9 + 0); +t3 = t3; +MEM_U32(sp + 24) = t9; +//nop; +MEM_U32(sp + 20) = t3; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L416a10; +MEM_U32(sp + 16) = zero; +L416a10: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L416a28; +//nop; +L416a28: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L416a48; +//nop; +L416a34: +t4 = 0x1000a380; +at = 0x1000a1f4; +t6 = MEM_U32(t4 + 92); +//nop; +MEM_U32(at + 0) = t6; +L416a48: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L416a60; +//nop; +L416a60: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100024c0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L416a7c; +a1 = a1; +L416a7c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1fc; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L416a9c; +//nop; +L416a9c: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000cc; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L416ac4; +MEM_U32(sp + 16) = zero; +L416ac4: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L416b78;} +//nop; +t7 = 0x10000404; +t1 = 0x10000240; +t7 = MEM_U32(t7 + 0); +at = 0x10000404; +t1 = MEM_U32(t1 + 0); +t5 = t7 + 0x1; +if (t1 != 0) {MEM_U32(at + 0) = t5; +goto L41977c;} +MEM_U32(at + 0) = t5; +t0 = 0x1000a24c; +at = 0x4d; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 == at) {//nop; +goto L416b24;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416b1c; +//nop; +L416b1c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L416b24: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416b38; +//nop; +L416b38: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t8 = 0x1000a250; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416b6c; +//nop; +L416b6c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L416b78: +t2 = 0x10000240; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L416bc4;} +//nop; +t3 = 0x1000a24c; +at = 0x4d; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 == at) {//nop; +goto L416bc4;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416bbc; +//nop; +L416bbc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L416bc4: +t9 = 0x1000a1f4; +at = 0x1000a1f0; +t4 = 0x1000a1e6; +t9 = MEM_U32(t9 + 0); +t4 = MEM_U8(t4 + 0); +MEM_U32(at + 0) = t9; +at = 0x76; +if (t4 == at) {//nop; +goto L41977c;} +//nop; +L416be8: +t6 = 0x100002c4; +at = 0x1; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L417028;} +//nop; +t7 = 0x1000a36c; +at = 0x3; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L417028;} +//nop; +t5 = 0x10000230; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +at = (int)t5 < (int)0x2; +if (at != 0) {at = 0x1000a560; +goto L417028;} +at = 0x1000a560; +a1 = 0x100024c4; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L416c4c; +a1 = a1; +L416c4c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x10000234; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L416c88;} +//nop; +a1 = 0x100024cc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L416c80; +a1 = a1; +L416c80: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L416c88: +a1 = 0x100024d0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L416c9c; +a1 = a1; +L416c9c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000400; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L416cbc; +//nop; +L416cbc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a490; +//nop; +f_addlist(mem, sp, a0, a1); +goto L416cd8; +//nop; +L416cd8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L416cf8; +//nop; +L416cf8: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x71; +t0 = 0x1000a1e6; +//nop; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 == at) {//nop; +goto L416d30;} +//nop; +t8 = 0x10000240; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L416de4;} +//nop; +L416d30: +t2 = 0x1000a520; +t3 = s0 << 2; +t2 = MEM_U32(t2 + 8); +a1 = 0x51; +t9 = t2 + t3; +a0 = MEM_U32(t9 + 0); +//nop; +//nop; +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L416d58; +//nop; +L416d58: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a0 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L416d7c; +//nop; +L416d7c: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L416df8;} +//nop; +t6 = 0x1000a1f4; +t4 = 0x100024d4; +//nop; +t6 = MEM_U32(t6 + 0); +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t6; +f_error(mem, sp, a0, a1, a2, a3); +goto L416dc0; +MEM_U32(sp + 24) = t6; +L416dc0: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L416dd8; +//nop; +L416dd8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L416df8; +//nop; +L416de4: +t7 = 0x1000a380; +at = 0x1000a1f4; +t5 = MEM_U32(t7 + 112); +//nop; +MEM_U32(at + 0) = t5; +L416df8: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L416e10; +//nop; +L416e10: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10002500; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L416e2c; +a1 = a1; +L416e2c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1fc; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L416e4c; +//nop; +L416e4c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x1000a380; +at = 0x1000a200; +t0 = MEM_U32(t1 + 116); +//nop; +a0 = 0x1000a560; +MEM_U32(at + 0) = t0; +a1 = t0; +f_addstr(mem, sp, a0, a1); +goto L416e74; +a1 = t0; +L416e74: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000d0; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L416e9c; +MEM_U32(sp + 16) = zero; +L416e9c: +// bdead 4006000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L416f84;} +//nop; +t8 = 0x10000404; +t3 = 0x10000240; +t8 = MEM_U32(t8 + 0); +at = 0x10000404; +t3 = MEM_U32(t3 + 0); +t2 = t8 + 0x1; +if (t3 != 0) {MEM_U32(at + 0) = t2; +goto L416f64;} +MEM_U32(at + 0) = t2; +t9 = 0x1000a24c; +at = 0x4d; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == at) {at = 0x42; +goto L416f14;} +at = 0x42; +if (t9 == at) {at = 0x53; +goto L416f14;} +at = 0x53; +if (t9 == at) {at = 0x51; +goto L416f14;} +at = 0x51; +if (t9 == at) {//nop; +goto L416f14;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416f0c; +//nop; +L416f0c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L416f14: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416f28; +//nop; +L416f28: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t4 = 0x1000a250; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L416f64;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416f5c; +//nop; +L416f5c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L416f64: +a0 = 0x1000a200; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416f78; +//nop; +L416f78: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L416f84: +t6 = 0x10000240; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L416fe8;} +//nop; +t7 = 0x1000a24c; +at = 0x4d; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 == at) {at = 0x42; +goto L416fe8;} +at = 0x42; +if (t7 == at) {at = 0x53; +goto L416fe8;} +at = 0x53; +if (t7 == at) {at = 0x51; +goto L416fe8;} +at = 0x51; +if (t7 == at) {//nop; +goto L416fe8;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416fe0; +//nop; +L416fe0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L416fe8: +a0 = 0x1000a200; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L416ffc; +//nop; +L416ffc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t5 = 0x1000a1f4; +at = 0x1000a1f0; +t1 = 0x1000a1e6; +t5 = MEM_U32(t5 + 0); +t1 = MEM_U8(t1 + 0); +MEM_U32(at + 0) = t5; +at = 0x71; +if (t1 == at) {//nop; +goto L41977c;} +//nop; +L417028: +t0 = 0x100002c0; +at = 0x1; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L4174f4;} +//nop; +t8 = 0x1000a36c; +at = 0x3; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L4174f4;} +//nop; +t2 = 0x10000230; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +at = (int)t2 < (int)0x2; +if (at != 0) {at = 0x1000a560; +goto L4174f4;} +at = 0x1000a560; +a1 = 0x10002504; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41708c; +a1 = a1; +L41708c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t3 = 0x10000234; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L4170c8;} +//nop; +a1 = 0x1000250c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4170c0; +a1 = a1; +L4170c0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4170c8: +a1 = 0x10002510; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4170dc; +a1 = a1; +L4170dc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000400; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4170fc; +//nop; +L4170fc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a4a0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L417118; +//nop; +L417118: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L417138; +//nop; +L417138: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x64; +t9 = 0x1000a1e6; +//nop; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L417170;} +//nop; +t4 = 0x10000278; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L417188;} +//nop; +L417170: +t6 = 0x10000240; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L417234;} +//nop; +L417188: +t7 = 0x1000a520; +t5 = s0 << 2; +t7 = MEM_U32(t7 + 8); +//nop; +t1 = t7 + t5; +a0 = MEM_U32(t1 + 0); +a1 = 0x44; +v0 = f_mksuf(mem, sp, a0, a1); +goto L4171a8; +a1 = 0x44; +L4171a8: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a0 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L4171cc; +//nop; +L4171cc: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L417248;} +//nop; +t8 = 0x1000a1f4; +t0 = 0x10002514; +//nop; +t8 = MEM_U32(t8 + 0); +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t8; +f_error(mem, sp, a0, a1, a2, a3); +goto L417210; +MEM_U32(sp + 24) = t8; +L417210: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L417228; +//nop; +L417228: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L417248; +//nop; +L417234: +t2 = 0x1000a380; +at = 0x1000a1f4; +t3 = MEM_U32(t2 + 108); +//nop; +MEM_U32(at + 0) = t3; +L417248: +t9 = 0x10000360; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L417328;} +//nop; +a1 = 0x10002540; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417274; +a1 = a1; +L417274: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x64; +t4 = 0x1000a1e6; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L4172ac;} +//nop; +t6 = 0x10000278; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L4172c4;} +//nop; +L4172ac: +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L417308;} +//nop; +L4172c4: +t5 = 0x1000a520; +t1 = s0 << 2; +t5 = MEM_U32(t5 + 8); +//nop; +t0 = t5 + t1; +a0 = MEM_U32(t0 + 0); +a1 = 0x45; +v0 = f_mksuf(mem, sp, a0, a1); +goto L4172e4; +a1 = 0x45; +L4172e4: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L4172fc; +a1 = s4; +L4172fc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L417328; +//nop; +L417308: +t8 = 0x1000a380; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(t8 + 104); +//nop; +f_addstr(mem, sp, a0, a1); +goto L417320; +//nop; +L417320: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L417328: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L417340; +//nop; +L417340: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000d4; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L417368; +MEM_U32(sp + 16) = zero; +L417368: +// bdead 4006000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L417450;} +//nop; +t2 = 0x10000404; +t9 = 0x10000240; +t2 = MEM_U32(t2 + 0); +at = 0x10000404; +t9 = MEM_U32(t9 + 0); +t3 = t2 + 0x1; +if (t9 != 0) {MEM_U32(at + 0) = t3; +goto L417430;} +MEM_U32(at + 0) = t3; +t4 = 0x1000a24c; +at = 0x42; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == at) {at = 0x53; +goto L4173e0;} +at = 0x53; +if (t4 == at) {at = 0x4d; +goto L4173e0;} +at = 0x4d; +if (t4 == at) {at = 0x51; +goto L4173e0;} +at = 0x51; +if (t4 == at) {//nop; +goto L4173e0;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4173d8; +//nop; +L4173d8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4173e0: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4173f4; +//nop; +L4173f4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t6 = 0x1000a250; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L417430;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L417428; +//nop; +L417428: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L417430: +a0 = 0x1000a204; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L417444; +//nop; +L417444: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L417450: +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L4174b4;} +//nop; +t5 = 0x1000a24c; +at = 0x42; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {at = 0x53; +goto L4174b4;} +at = 0x53; +if (t5 == at) {at = 0x4d; +goto L4174b4;} +at = 0x4d; +if (t5 == at) {at = 0x51; +goto L4174b4;} +at = 0x51; +if (t5 == at) {//nop; +goto L4174b4;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4174ac; +//nop; +L4174ac: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4174b4: +a0 = 0x1000a204; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4174c8; +//nop; +L4174c8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x1000a1f4; +at = 0x1000a1f0; +t0 = 0x1000a1e6; +t1 = MEM_U32(t1 + 0); +t0 = MEM_U8(t0 + 0); +MEM_U32(at + 0) = t1; +at = 0x64; +if (t0 == at) {//nop; +goto L41977c;} +//nop; +L4174f4: +t8 = 0x10000230; +at = 0x2; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == at) {at = 0x3; +goto L417518;} +at = 0x3; +if (t8 == at) {at = 0x4; +goto L417518;} +at = 0x4; +if (t8 != at) {at = 0x1000a560; +goto L417c04;} +L417518: +at = 0x1000a560; +a1 = 0x10002544; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417534; +a1 = a1; +L417534: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t2 = 0x10000234; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L417570;} +//nop; +a1 = 0x1000254c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417568; +a1 = a1; +L417568: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L417570: +a1 = 0x10002550; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417584; +a1 = a1; +L417584: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000400; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4175a4; +//nop; +L4175a4: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x10000; +t3 = 0x1000a150; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +t9 = t3 & at; +if (t9 == 0) {//nop; +goto L417604;} +//nop; +t4 = 0x1000a24c; +at = 0x66; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == at) {at = 0x46; +goto L4175e8;} +at = 0x46; +if (t4 != at) {//nop; +goto L417604;} +//nop; +L4175e8: +a1 = 0x10002554; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4175fc; +a1 = a1; +L4175fc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L417604: +t6 = 0x10000424; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L417684;} +//nop; +t7 = 0x100002d0; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L417650;} +//nop; +a1 = 0x10002560; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417648; +a1 = a1; +L417648: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L417650: +t5 = 0x100002d4; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L417684;} +//nop; +a1 = 0x1000256c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41767c; +a1 = a1; +L41767c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L417684: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a4b0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L417698; +//nop; +L417698: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4176b8; +//nop; +L4176b8: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x6f; +t1 = 0x1000a1e6; +//nop; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L4176f0;} +//nop; +t0 = 0x10000278; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L417708;} +//nop; +L4176f0: +t8 = 0x10000240; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L4177bc;} +//nop; +L417708: +t2 = 0x1000a520; +t3 = s0 << 2; +t2 = MEM_U32(t2 + 8); +a1 = 0x4f; +t9 = t2 + t3; +a0 = MEM_U32(t9 + 0); +//nop; +//nop; +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L417730; +//nop; +L417730: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a0 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L417754; +//nop; +L417754: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L4177d0;} +//nop; +t6 = 0x1000a1f4; +t4 = 0x10002578; +//nop; +t6 = MEM_U32(t6 + 0); +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t6; +f_error(mem, sp, a0, a1, a2, a3); +goto L417798; +MEM_U32(sp + 24) = t6; +L417798: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4177b0; +//nop; +L4177b0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L4177d0; +//nop; +L4177bc: +t7 = 0x1000a380; +at = 0x1000a1f4; +t5 = MEM_U32(t7 + 28); +//nop; +MEM_U32(at + 0) = t5; +L4177d0: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4177e8; +//nop; +L4177e8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100025a4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417804; +a1 = a1; +L417804: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1fc; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L417824; +//nop; +L417824: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x1000a380; +at = 0x1000a208; +t0 = MEM_U32(t1 + 32); +//nop; +a0 = 0x1000a560; +MEM_U32(at + 0) = t0; +a1 = t0; +f_addstr(mem, sp, a0, a1); +goto L41784c; +a1 = t0; +L41784c: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000d8; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L417874; +MEM_U32(sp + 16) = zero; +L417874: +// bdead 4006000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41796c;} +//nop; +t8 = 0x10000404; +t3 = 0x10000240; +t8 = MEM_U32(t8 + 0); +at = 0x10000404; +t3 = MEM_U32(t3 + 0); +t2 = t8 + 0x1; +if (t3 != 0) {MEM_U32(at + 0) = t2; +goto L41794c;} +MEM_U32(at + 0) = t2; +t9 = 0x1000a24c; +at = 0x42; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == at) {at = 0x53; +goto L4178fc;} +at = 0x53; +if (t9 == at) {at = 0x51; +goto L4178fc;} +at = 0x51; +if (t9 == at) {at = 0x44; +goto L4178fc;} +at = 0x44; +if (t9 == at) {at = 0x4d; +goto L4178fc;} +at = 0x4d; +if (t9 == at) {at = 0x56; +goto L4178fc;} +at = 0x56; +if (t9 == at) {//nop; +goto L4178fc;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4178f4; +//nop; +L4178f4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4178fc: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L417910; +//nop; +L417910: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t4 = 0x1000a250; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L41794c;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L417944; +//nop; +L417944: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L41794c: +a0 = 0x1000a208; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L417960; +//nop; +L417960: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L41796c: +t6 = 0x10000240; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L4179e0;} +//nop; +t7 = 0x1000a24c; +at = 0x42; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 == at) {at = 0x53; +goto L4179e0;} +at = 0x53; +if (t7 == at) {at = 0x51; +goto L4179e0;} +at = 0x51; +if (t7 == at) {at = 0x44; +goto L4179e0;} +at = 0x44; +if (t7 == at) {at = 0x4d; +goto L4179e0;} +at = 0x4d; +if (t7 == at) {at = 0x56; +goto L4179e0;} +at = 0x56; +if (t7 == at) {//nop; +goto L4179e0;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4179d8; +//nop; +L4179d8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4179e0: +a0 = 0x1000a208; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4179f4; +//nop; +L4179f4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t5 = 0x1000a1f4; +at = 0x1000a1f0; +t1 = 0x1000a1e6; +t5 = MEM_U32(t5 + 0); +t1 = MEM_U8(t1 + 0); +MEM_U32(at + 0) = t5; +at = 0x6f; +if (t1 != at) {//nop; +goto L417bf0;} +//nop; +t0 = 0x10000278; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {at = 0x1000a560; +goto L417bf0;} +at = 0x1000a560; +a1 = 0x100025a8; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417a50; +a1 = a1; +L417a50: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L417a70; +//nop; +L417a70: +// bdead 40060003 gp = MEM_U32(sp + 64); +t2 = s0 << 2; +t8 = 0x1000a520; +//nop; +t8 = MEM_U32(t8 + 8); +a1 = 0x55; +t3 = t8 + t2; +a0 = MEM_U32(t3 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L417a98; +//nop; +L417a98: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a1 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L417ac0; +//nop; +L417ac0: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000f4; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L417ae8; +MEM_U32(sp + 16) = zero; +L417ae8: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L417b84;} +//nop; +t9 = 0x10000404; +t6 = 0x10000240; +t9 = MEM_U32(t9 + 0); +at = 0x10000404; +t6 = MEM_U32(t6 + 0); +t4 = t9 + 0x1; +if (t6 != 0) {MEM_U32(at + 0) = t4; +goto L41977c;} +MEM_U32(at + 0) = t4; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L417b28; +//nop; +L417b28: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L417b44; +//nop; +L417b44: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t7 = 0x1000a250; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L417b78; +//nop; +L417b78: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L417b84: +t5 = 0x10000240; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L417bb0; +//nop; +L417bb0: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x1000a250; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L417be4; +//nop; +L417be4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L417bf0: +t0 = 0x1000a1e6; +at = 0x6f; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 == at) {at = 0x1000a560; +goto L41977c;} +L417c04: +at = 0x1000a560; +a1 = 0x100025b0; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417c20; +a1 = a1; +L417c20: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t8 = 0x10000234; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L417c5c;} +//nop; +a1 = 0x100025b8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417c54; +a1 = a1; +L417c54: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L417c5c: +a1 = 0x100025bc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417c70; +a1 = a1; +L417c70: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000400; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L417c90; +//nop; +L417c90: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t2 = 0x10000340; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L417d38;} +//nop; +t3 = 0x100002dc; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L417d38;} +//nop; +t9 = 0x10000424; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L417d38;} +//nop; +t4 = 0x10000230; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +at = (int)t4 < (int)0x3; +if (at != 0) {//nop; +goto L417d1c;} +//nop; +a1 = 0x100025c0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417d10; +a1 = a1; +L417d10: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L417d38; +//nop; +L417d1c: +a1 = 0x100025c8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417d30; +a1 = a1; +L417d30: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L417d38: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a4c0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L417d4c; +//nop; +L417d4c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L417d6c; +//nop; +L417d6c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t6 = 0x1000022c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L417f18;} +//nop; +a1 = 0x100025d0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417da0; +a1 = a1; +L417da0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L417e04;} +//nop; +t5 = 0x1000a520; +t1 = s0 << 2; +t5 = MEM_U32(t5 + 8); +//nop; +t0 = t5 + t1; +a0 = MEM_U32(t0 + 0); +a1 = 0x47; +v0 = f_mksuf(mem, sp, a0, a1); +goto L417de0; +a1 = 0x47; +L417de0: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L417df8; +a1 = s4; +L417df8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L417e2c; +//nop; +L417e04: +t8 = 0x1000a380; +at = 0x1000a210; +t2 = MEM_U32(t8 + 36); +//nop; +a0 = 0x1000a560; +MEM_U32(at + 0) = t2; +a1 = t2; +f_addstr(mem, sp, a0, a1); +goto L417e24; +a1 = t2; +L417e24: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L417e2c: +a1 = 0x100025d4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417e40; +a1 = a1; +L417e40: +// bdead 40060003 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t3 = 0x1000a520; +a1 = 0x73; +t3 = MEM_U32(t3 + 8); +//nop; +t4 = t3 + t9; +//nop; +a0 = MEM_U32(t4 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L417e6c; +//nop; +L417e6c: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a0 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L417e90; +//nop; +L417e90: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L417ef4;} +//nop; +t7 = 0x1000a1f4; +t6 = 0x100025d8; +//nop; +t7 = MEM_U32(t7 + 0); +t6 = t6; +MEM_U32(sp + 20) = t6; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t7; +f_error(mem, sp, a0, a1, a2, a3); +goto L417ed4; +MEM_U32(sp + 24) = t7; +L417ed4: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L417eec; +//nop; +L417eec: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L417ef4: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L417f0c; +//nop; +L417f0c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L4182f0; +//nop; +L417f18: +t5 = 0x1000a1e6; +at = 0x63; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L418018;} +//nop; +a1 = 0x10002604; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L417f44; +a1 = a1; +L417f44: +// bdead 40060003 gp = MEM_U32(sp + 64); +t0 = s0 << 2; +t1 = 0x1000a520; +//nop; +t1 = MEM_U32(t1 + 8); +a1 = 0x47; +t8 = t1 + t0; +a0 = MEM_U32(t8 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L417f6c; +//nop; +L417f6c: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a0 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L417f90; +//nop; +L417f90: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L417ff4;} +//nop; +t3 = 0x1000a1f4; +t2 = 0x10002608; +//nop; +t3 = MEM_U32(t3 + 0); +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L417fd4; +MEM_U32(sp + 24) = t3; +L417fd4: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L417fec; +//nop; +L417fec: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L417ff4: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41800c; +//nop; +L41800c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L4182f0; +//nop; +L418018: +t9 = 0x10000240; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L418234;} +//nop; +a1 = 0x10002634; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418044; +a1 = a1; +L418044: +// bdead 40060003 gp = MEM_U32(sp + 64); +t6 = s0 << 2; +t4 = 0x1000a520; +//nop; +t4 = MEM_U32(t4 + 8); +a1 = 0x47; +t7 = t4 + t6; +a0 = MEM_U32(t7 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L41806c; +//nop; +L41806c: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +a0 = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L418090; +//nop; +L418090: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L4180f4;} +//nop; +t1 = 0x1000a1f4; +t5 = 0x10002638; +//nop; +t1 = MEM_U32(t1 + 0); +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t1; +f_error(mem, sp, a0, a1, a2, a3); +goto L4180d4; +MEM_U32(sp + 24) = t1; +L4180d4: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4180ec; +//nop; +L4180ec: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4180f4: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41810c; +//nop; +L41810c: +// bdead 40060003 gp = MEM_U32(sp + 64); +t8 = s0 << 2; +t0 = 0x1000a520; +//nop; +t0 = MEM_U32(t0 + 8); +a1 = 0x73; +t2 = t0 + t8; +a0 = MEM_U32(t2 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L418134; +//nop; +L418134: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = s4; +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L41814c; +//nop; +L41814c: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L4181d4;} +//nop; +t3 = 0x1000a520; +t9 = s0 << 2; +t3 = MEM_U32(t3 + 8); +a1 = 0x73; +t4 = t3 + t9; +//nop; +a0 = MEM_U32(t4 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L418180; +//nop; +L418180: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +t6 = 0x10002664; +//nop; +t6 = t6; +MEM_U32(sp + 20) = t6; +MEM_U32(sp + 24) = s4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4181b4; +MEM_U32(sp + 16) = zero; +L4181b4: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4181cc; +//nop; +L4181cc: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4181d4: +a1 = 0x10002690; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4181e8; +a1 = a1; +L4181e8: +// bdead 40060003 gp = MEM_U32(sp + 64); +t5 = s0 << 2; +t7 = 0x1000a520; +//nop; +t7 = MEM_U32(t7 + 8); +a1 = 0x73; +t1 = t7 + t5; +a0 = MEM_U32(t1 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L418210; +//nop; +L418210: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L418228; +a1 = s4; +L418228: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L4182f0; +//nop; +L418234: +a1 = 0x10002694; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418248; +a1 = a1; +L418248: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t0 = 0x1000a380; +at = 0x1000a1f4; +t8 = MEM_U32(t0 + 40); +//nop; +MEM_U32(at + 0) = t8; +a0 = t8; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L41826c; +a0 = t8; +L41826c: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L4182d0;} +//nop; +t3 = 0x1000a1f4; +t2 = 0x10002698; +//nop; +t3 = MEM_U32(t3 + 0); +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L4182b0; +MEM_U32(sp + 24) = t3; +L4182b0: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4182c8; +//nop; +L4182c8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4182d0: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4182e8; +//nop; +L4182e8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4182f0: +a1 = 0x100026c4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418304; +a1 = a1; +L418304: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1fc; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L418324; +//nop; +L418324: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100026c8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418340; +a1 = a1; +L418340: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t9 = 0x1000a380; +at = 0x1000a20c; +t4 = MEM_U32(t9 + 60); +//nop; +a0 = 0x1000a560; +MEM_U32(at + 0) = t4; +a1 = t4; +f_addstr(mem, sp, a0, a1); +goto L418368; +a1 = t4; +L418368: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000dc; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L418390; +MEM_U32(sp + 16) = zero; +L418390: +// bdead 4006000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4184c0;} +//nop; +t6 = 0x10000404; +t5 = 0x10000240; +t6 = MEM_U32(t6 + 0); +at = 0x10000404; +t5 = MEM_U32(t5 + 0); +t7 = t6 + 0x1; +if (t5 != 0) {MEM_U32(at + 0) = t7; +goto L41846c;} +MEM_U32(at + 0) = t7; +t1 = 0x1000a24c; +at = 0x42; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 == at) {at = 0x4f; +goto L418418;} +at = 0x4f; +if (t1 == at) {at = 0x51; +goto L418418;} +at = 0x51; +if (t1 == at) {at = 0x44; +goto L418418;} +at = 0x44; +if (t1 == at) {at = 0x4d; +goto L418418;} +at = 0x4d; +if (t1 == at) {at = 0x56; +goto L418418;} +at = 0x56; +if (t1 == at) {//nop; +goto L418418;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L418410; +//nop; +L418410: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L418418: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41842c; +//nop; +L41842c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t0 = 0x1000a250; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L4184a0;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L418460; +//nop; +L418460: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L4184a0; +//nop; +L41846c: +t8 = 0x1000022c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L4184a0;} +//nop; +a0 = 0x1000a210; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L418498; +//nop; +L418498: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4184a0: +a0 = 0x1000a20c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4184b4; +//nop; +L4184b4: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L4184c0: +a0 = 0x1000a20c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4184d4; +//nop; +L4184d4: +// bdead 40060103 gp = MEM_U32(sp + 64); +at = 0x42; +t2 = 0x1000a24c; +//nop; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == at) {at = 0x53; +goto L41851c;} +at = 0x53; +if (t2 == at) {at = 0x51; +goto L41851c;} +at = 0x51; +if (t2 == at) {at = 0x44; +goto L41851c;} +at = 0x44; +if (t2 == at) {at = 0x4d; +goto L41851c;} +at = 0x4d; +if (t2 == at) {at = 0x56; +goto L41851c;} +at = 0x56; +if (t2 != at) {//nop; +goto L418538;} +//nop; +L41851c: +t3 = 0x10000230; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +at = (int)t3 < (int)0x2; +if (at != 0) {//nop; +goto L418584;} +//nop; +L418538: +t9 = 0x1000a24c; +at = 0x4f; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == at) {//nop; +goto L418584;} +//nop; +t4 = 0x10000240; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L418584;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41857c; +//nop; +L41857c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L418584: +t6 = 0x1000022c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L418608;} +//nop; +t7 = 0x10000240; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L41977c;} +//nop; +t5 = 0x1000a250; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L4185e8;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4185e0; +//nop; +L4185e0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4185e8: +a0 = 0x1000a210; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4185fc; +//nop; +L4185fc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L418608: +t1 = 0x1000a1e6; +at = 0x63; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 == at) {//nop; +goto L41977c;} +//nop; +t0 = 0x1000a1f4; +at = 0x1000a1f0; +t0 = MEM_U32(t0 + 0); +//nop; +MEM_U32(at + 0) = t0; +L418634: +t8 = 0x1000a24c; +at = 0x73; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 != at) {at = 0x1000a560; +goto L418adc;} +at = 0x1000a560; +a1 = 0x100026d0; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418664; +a1 = a1; +L418664: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t2 = 0x10000234; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L4186a0;} +//nop; +a1 = 0x100026d4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418698; +a1 = a1; +L418698: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4186a0: +a1 = 0x100026d8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4186b4; +a1 = a1; +L4186b4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000400; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L4186d4; +//nop; +L4186d4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a4d0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L4186f0; +//nop; +L4186f0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L418710; +//nop; +L418710: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100026dc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41872c; +a1 = a1; +L41872c: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x61; +t3 = 0x1000a1e6; +//nop; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 == at) {//nop; +goto L418764;} +//nop; +t9 = 0x10000240; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L41889c;} +//nop; +L418764: +t4 = 0x1000a36c; +at = 0x4; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L4187e4;} +//nop; +t6 = 0x1000a520; +t7 = s0 << 2; +t6 = MEM_U32(t6 + 8); +//nop; +t5 = t6 + t7; +a0 = MEM_U32(t5 + 0); +//nop; +v0 = f_getsuf(mem, sp, a0); +goto L41879c; +//nop; +L41879c: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4187e4;} +//nop; +t1 = 0x1000a520; +t0 = s0 << 2; +t1 = MEM_U32(t1 + 8); +a1 = 0x100026e0; +//nop; +t8 = t1 + t0; +a0 = MEM_U32(t8 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4187d0; +a1 = a1; +L4187d0: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +MEM_U32(at + 0) = v0; +goto L418820; +MEM_U32(at + 0) = v0; +L4187e4: +t2 = 0x1000a520; +t3 = s0 << 2; +t2 = MEM_U32(t2 + 8); +a1 = 0x47; +t9 = t2 + t3; +a0 = MEM_U32(t9 + 0); +//nop; +//nop; +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L41880c; +//nop; +L41880c: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +L418820: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L418834; +//nop; +L418834: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L41891c;} +//nop; +t6 = 0x1000a1f4; +t4 = 0x100026e4; +//nop; +t6 = MEM_U32(t6 + 0); +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t6; +f_error(mem, sp, a0, a1, a2, a3); +goto L418878; +MEM_U32(sp + 24) = t6; +L418878: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L418890; +//nop; +L418890: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L41891c; +//nop; +L41889c: +t7 = 0x1000a380; +at = 0x1000a1f4; +t5 = MEM_U32(t7 + 44); +//nop; +MEM_U32(at + 0) = t5; +a0 = t5; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L4188b8; +a0 = t5; +L4188b8: +// bdead 4006000b gp = MEM_U32(sp + 64); +at = 0x1; +if (v0 != at) {//nop; +goto L41891c;} +//nop; +t0 = 0x1000a1f4; +t1 = 0x10002710; +//nop; +t0 = MEM_U32(t0 + 0); +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t0; +f_error(mem, sp, a0, a1, a2, a3); +goto L4188fc; +MEM_U32(sp + 24) = t0; +L4188fc: +// bdead 40060003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L418914; +//nop; +L418914: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L41891c: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L418934; +//nop; +L418934: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000273c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418950; +a1 = a1; +L418950: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1fc; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L418970; +//nop; +L418970: +// bdead 40060003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x100000e0; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L418998; +MEM_U32(sp + 16) = zero; +L418998: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L418a64;} +//nop; +t8 = 0x10000404; +t3 = 0x1000a1a0; +t8 = MEM_U32(t8 + 0); +at = 0x10000404; +t3 = MEM_U32(t3 + 0); +t2 = t8 + 0x1; +if (t3 != 0) {MEM_U32(at + 0) = t2; +goto L4189dc;} +MEM_U32(at + 0) = t2; +t9 = 0x10000268; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L4189f8;} +//nop; +L4189dc: +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4189f0; +//nop; +L4189f0: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L4189f8: +t4 = 0x10000240; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L418a24; +//nop; +L418a24: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +t6 = 0x1000a250; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L418a58; +//nop; +L418a58: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L418a64: +t7 = 0x1000a1a0; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L418a94;} +//nop; +t5 = 0x10000268; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L418ab0;} +//nop; +L418a94: +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L418aa8; +//nop; +L418aa8: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L418ab0: +t1 = 0x1000a1e6; +at = 0x61; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 == at) {//nop; +goto L41977c;} +//nop; +t0 = 0x1000a1f4; +at = 0x1000a1f0; +t0 = MEM_U32(t0 + 0); +//nop; +MEM_U32(at + 0) = t0; +L418adc: +at = 0x1000a560; +a1 = 0x10002740; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418af8; +a1 = a1; +L418af8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t8 = 0x10000378; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L418b34;} +//nop; +a1 = 0x10002744; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418b2c; +a1 = a1; +L418b2c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L418b34: +t2 = 0x1000a130; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L418b68;} +//nop; +a1 = 0x1000274c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418b60; +a1 = a1; +L418b60: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L418b68: +t3 = 0x1000a144; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L418b98;} +//nop; +//nop; +a0 = 0x1000a560; +a1 = t3; +f_addstr(mem, sp, a0, a1); +goto L418b90; +a1 = t3; +L418b90: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L418b98: +t9 = 0x1000a140; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if ((int)t9 <= 0) {//nop; +goto L418bcc;} +//nop; +a1 = 0x10002758; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418bc4; +a1 = a1; +L418bc4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L418bcc: +t4 = 0x1000a36c; +at = 0x4; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == at) {//nop; +goto L418bfc;} +//nop; +t6 = 0x1000a24c; +at = 0x73; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L418c48;} +//nop; +L418bfc: +t7 = 0x10000344; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L418c48;} +//nop; +t5 = 0x10000424; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L418c48;} +//nop; +a1 = 0x10002768; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418c40; +a1 = a1; +L418c40: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L418c48: +t1 = 0x100002dc; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L418c88;} +//nop; +a1 = 0x10002770; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418c74; +a1 = a1; +L418c74: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +at = 0x10000340; +MEM_U32(at + 0) = zero; +goto L418ddc; +MEM_U32(at + 0) = zero; +L418c88: +t0 = 0x10000340; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L418d70;} +//nop; +t8 = 0x10000424; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L418ddc;} +//nop; +t2 = 0x100002dc; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L418d48;} +//nop; +a1 = 0x10002778; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418ce4; +a1 = a1; +L418ce4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t3 = 0x10000230; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +at = (int)t3 < (int)0x3; +if (at != 0) {//nop; +goto L418d28;} +//nop; +a1 = 0x10002780; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418d1c; +a1 = a1; +L418d1c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L418ddc; +//nop; +L418d28: +a1 = 0x10002788; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418d3c; +a1 = a1; +L418d3c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L418ddc; +//nop; +L418d48: +a1 = 0x10002790; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418d5c; +a1 = a1; +L418d5c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +at = 0x10000340; +MEM_U32(at + 0) = zero; +goto L418ddc; +MEM_U32(at + 0) = zero; +L418d70: +t9 = 0x10000424; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L418ddc;} +//nop; +t4 = 0x100002dc; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L418dc0;} +//nop; +a1 = 0x10002798; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418db4; +a1 = a1; +L418db4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L418ddc; +//nop; +L418dc0: +a1 = 0x100027a0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418dd4; +a1 = a1; +L418dd4: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L418ddc: +t6 = 0x10000234; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L418e10;} +//nop; +a1 = 0x100027a8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418e08; +a1 = a1; +L418e08: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L418e10: +t7 = 0x10000314; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L418e78;} +//nop; +t5 = 0x1000a24c; +at = 0x73; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L418e78;} +//nop; +t1 = 0x10000230; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +at = (int)t1 < (int)0x2; +if (at != 0) {//nop; +goto L418e78;} +//nop; +a1 = 0x100027ac; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418e70; +a1 = a1; +L418e70: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L418e78: +a1 = 0x100027b8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418e8c; +a1 = a1; +L418e8c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000400; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L418eac; +//nop; +L418eac: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +s4 = 0x10000220; +//nop; +s4 = MEM_U32(s4 + 0); +//nop; +if (s4 == 0) {at = 0x1; +goto L418edc;} +at = 0x1; +if (s4 == at) {//nop; +goto L418efc;} +//nop; +//nop; +goto L418f18; +//nop; +L418edc: +a1 = 0x100027bc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418ef0; +a1 = a1; +L418ef0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L418f18; +//nop; +L418efc: +a1 = 0x100027c0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418f10; +a1 = a1; +L418f10: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L418f18: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a4d0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L418f2c; +//nop; +L418f2c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a4f0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L418f48; +//nop; +L418f48: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +t0 = 0x10000424; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L418f84;} +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a280; +//nop; +f_addlist(mem, sp, a0, a1); +goto L418f7c; +//nop; +L418f7c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L418f84: +a1 = 0x1000a1f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L418f9c; +//nop; +L418f9c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100027c4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L418fb8; +a1 = a1; +L418fb8: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x4; +t8 = 0x1000a36c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L41900c;} +//nop; +t2 = 0x1000a1ec; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {at = 0x1000a1f4; +goto L418ff8;} +at = 0x1000a1f4; +MEM_U32(at + 0) = t2; +goto L419200; +MEM_U32(at + 0) = t2; +L418ff8: +t3 = 0x100027c8; +at = 0x1000a1f4; +t3 = t3; +MEM_U32(at + 0) = t3; +goto L419200; +MEM_U32(at + 0) = t3; +L41900c: +t9 = 0x1000a1ec; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L419080;} +//nop; +t4 = 0x10000228; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L419080;} +//nop; +t6 = 0x10000230; +at = 0x3; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == at) {//nop; +goto L41906c;} +//nop; +t7 = 0x1000a520; +at = 0x1; +t7 = MEM_U32(t7 + 4); +//nop; +if (t7 != at) {//nop; +goto L419080;} +//nop; +L41906c: +t5 = 0x1000a1ec; +at = 0x1000a1f4; +t5 = MEM_U32(t5 + 0); +MEM_U32(at + 0) = t5; +goto L419200; +MEM_U32(at + 0) = t5; +L419080: +t1 = 0x1000a24c; +at = 0x3f; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L419194;} +//nop; +t0 = 0x1000a1e6; +at = 0x62; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 == at) {//nop; +goto L419194;} +//nop; +t8 = 0x10000240; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L419194;} +//nop; +t2 = 0x10000228; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L419100;} +//nop; +t3 = 0x1000a380; +at = 0x1000a1f4; +t9 = MEM_U32(t3 + 48); +//nop; +MEM_U32(at + 0) = t9; +at = 0x10000410; +MEM_U32(at + 0) = t9; +goto L4191c8; +MEM_U32(at + 0) = t9; +L419100: +t4 = 0x1000a520; +at = 0x2; +t4 = MEM_U32(t4 + 4); +//nop; +if (t4 != at) {//nop; +goto L419154;} +//nop; +t6 = 0x1000a520; +//nop; +t6 = MEM_U32(t6 + 8); +a1 = 0x6f; +a0 = MEM_U32(t6 + 0); +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L419134; +//nop; +L419134: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +at = 0x10000410; +MEM_U32(at + 0) = zero; +goto L4191c8; +MEM_U32(at + 0) = zero; +L419154: +t7 = 0x1000a520; +t5 = s0 << 2; +t7 = MEM_U32(t7 + 8); +//nop; +t1 = t7 + t5; +a0 = MEM_U32(t1 + 0); +a1 = 0x6f; +v0 = f_mksuf(mem, sp, a0, a1); +goto L419174; +a1 = 0x6f; +L419174: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +at = 0x10000410; +MEM_U32(at + 0) = zero; +goto L4191c8; +MEM_U32(at + 0) = zero; +L419194: +t0 = 0x1000a520; +t8 = s0 << 2; +t0 = MEM_U32(t0 + 8); +//nop; +t2 = t0 + t8; +a0 = MEM_U32(t2 + 0); +a1 = 0x6f; +v0 = f_mksuf(mem, sp, a0, a1); +goto L4191b4; +a1 = 0x6f; +L4191b4: +// bdead 4006000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1f4; +//nop; +MEM_U32(at + 0) = v0; +L4191c8: +t3 = 0x1000040c; +at = 0xffffffff; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == at) {//nop; +goto L419200;} +//nop; +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a540; +a1 = MEM_U32(a1 + 0); +a2 = t3; +f_set_place(mem, sp, a0, a1, a2); +goto L4191f8; +a2 = t3; +L4191f8: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L419200: +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L419218; +//nop; +L419218: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100027d0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L419234; +a1 = a1; +L419234: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1fc; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L419254; +//nop; +L419254: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x1; +t9 = 0x100002c0; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L41938c;} +//nop; +t4 = 0x1000a36c; +at = 0x3; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L41938c;} +//nop; +t6 = 0x10000360; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41938c;} +//nop; +t7 = 0x10000230; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +at = (int)t7 < (int)0x2; +if (at != 0) {//nop; +goto L41938c;} +//nop; +a1 = 0x100027d4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4192d4; +a1 = a1; +L4192d4: +// bdead 40060003 gp = MEM_U32(sp + 64); +at = 0x62; +t5 = 0x1000a1e6; +//nop; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L41930c;} +//nop; +t1 = 0x10000278; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L419324;} +//nop; +L41930c: +t0 = 0x10000240; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L419368;} +//nop; +L419324: +t8 = 0x1000a520; +t2 = s0 << 2; +t8 = MEM_U32(t8 + 8); +//nop; +t3 = t8 + t2; +a0 = MEM_U32(t3 + 0); +a1 = 0x45; +v0 = f_mksuf(mem, sp, a0, a1); +goto L419344; +a1 = 0x45; +L419344: +// bdead 4006000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41935c; +a1 = s4; +L41935c: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +goto L41938c; +//nop; +L419368: +t9 = 0x1000a380; +a0 = 0x1000a560; +a1 = MEM_U32(t9 + 104); +//nop; +//nop; +//nop; +f_addstr(mem, sp, a0, a1); +goto L419384; +//nop; +L419384: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L41938c: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_not_writeable(mem, sp, a0); +goto L4193a0; +//nop; +L4193a0: +// bdead 4006000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4193c8;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4193c0; +//nop; +L4193c0: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L4193c8: +a0 = 0x100000e4; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L4193ec; +MEM_U32(sp + 16) = zero; +L4193ec: +// bdead 4006010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41958c;} +//nop; +t4 = 0x10000404; +t7 = 0x10000240; +t4 = MEM_U32(t4 + 0); +at = 0x10000404; +t7 = MEM_U32(t7 + 0); +t6 = t4 + 0x1; +if (t7 != 0) {MEM_U32(at + 0) = t6; +goto L419558;} +MEM_U32(at + 0) = t6; +t5 = 0x1000a24c; +at = 0x47; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {//nop; +goto L41944c;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L419444; +//nop; +L419444: +// bdead 40060003 gp = MEM_U32(sp + 64); +//nop; +L41944c: +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_regular_file(mem, sp, a0); +goto L419460; +//nop; +L419460: +MEM_U32(sp + 224) = v0; +t1 = MEM_U32(sp + 224); +// bdead 40060403 gp = MEM_U32(sp + 64); +at = 0x1; +if (t1 != at) {//nop; +goto L419498;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41948c; +//nop; +L41948c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L419524; +//nop; +L419498: +t0 = MEM_U32(sp + 224); +//nop; +if (t0 == 0) {//nop; +goto L4194e8;} +//nop; +t2 = 0x1000a1f4; +t8 = 0x100027d8; +//nop; +t2 = MEM_U32(t2 + 0); +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t2; +f_error(mem, sp, a0, a1, a2, a3); +goto L4194dc; +MEM_U32(sp + 24) = t2; +L4194dc: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L419524; +//nop; +L4194e8: +t9 = 0x1000a1f4; +t3 = 0x10002838; +t9 = MEM_U32(t9 + 0); +t3 = t3; +MEM_U32(sp + 24) = t9; +//nop; +MEM_U32(sp + 20) = t3; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41951c; +MEM_U32(sp + 16) = zero; +L41951c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L419524: +t4 = 0x1000a250; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L419558;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L419550; +//nop; +L419550: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L419558: +t6 = 0x10000410; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41977c;} +//nop; +//nop; +a0 = t6; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L419580; +//nop; +L419580: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +goto L41977c; +//nop; +L41958c: +t7 = 0x100002c0; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L41960c;} +//nop; +t5 = 0x1000a36c; +at = 0x3; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L41960c;} +//nop; +t1 = 0x10000360; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L41960c;} +//nop; +t0 = 0x10000230; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +at = (int)t0 < (int)0x2; +if (at != 0) {//nop; +goto L41960c;} +//nop; +t8 = 0x1000a380; +//nop; +a0 = MEM_U32(t8 + 104); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L419604; +//nop; +L419604: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L41960c: +t2 = 0x1000a24c; +at = 0x47; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == at) {//nop; +goto L419658;} +//nop; +t3 = 0x10000240; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L419658;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L419650; +//nop; +L419650: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L419658: +t9 = 0x1000a250; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L4196a4;} +//nop; +t4 = 0x10000240; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L4196a4;} +//nop; +a0 = 0x1000a1fc; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41969c; +//nop; +L41969c: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L4196a4: +t6 = 0x1000a36c; +at = 0x3; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L419710;} +//nop; +t7 = MEM_U32(sp + 284); +//nop; +if (t7 == 0) {//nop; +goto L419710;} +//nop; +t5 = 0x1000a24c; +at = 0x66; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == at) {at = 0x46; +goto L419710;} +at = 0x46; +if (t5 == at) {at = 0x100001fc; +goto L419710;} +at = 0x100001fc; +a0 = 0x10002878; +//nop; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t7; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L419708; +a0 = a0; +L419708: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L419710: +t1 = 0x1000a36c; +at = 0x1; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L41977c;} +//nop; +t0 = 0x10000008; +at = 0x2; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == at) {at = 0x3; +goto L419748;} +at = 0x3; +if (t0 != at) {//nop; +goto L41977c;} +//nop; +L419748: +t8 = 0x10000110; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L41977c;} +//nop; +a0 = 0x1000a1f4; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_update_instantiation_info_file(mem, sp, a0); +goto L419774; +//nop; +L419774: +// bdead 40060103 gp = MEM_U32(sp + 64); +//nop; +L41977c: +t2 = 0x1000a520; +s0 = s0 + 0x1; +t2 = MEM_U32(t2 + 4); +//nop; +at = (int)s0 < (int)t2; +if (at != 0) {//nop; +goto L409e00;} +//nop; +t3 = 0x10000408; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L409e00;} +//nop; +L4197b0: +at = 0x1000a24c; +t9 = 0x1000a36c; +MEM_U8(at + 0) = (uint8_t)zero; +t9 = MEM_U32(t9 + 0); +at = 0x4; +if (t9 != at) {//nop; +goto L419818;} +//nop; +t4 = 0x10000404; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L419800;} +//nop; +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L4197f4; +//nop; +L4197f4: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L419818; +//nop; +L419800: +//nop; +a0 = zero; +//nop; +wrapper_exit(mem, a0); +goto L419810; +//nop; +L419810: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L419818: +t6 = 0x10000228; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L41bc40;} +//nop; +t5 = 0x1000022c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L41bc40;} +//nop; +t7 = 0x10000214; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L41bc40;} +//nop; +t1 = 0x10000218; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L41bc40;} +//nop; +t0 = 0x10000224; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L41bc40;} +//nop; +t8 = 0x10000404; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L41bc40;} +//nop; +t2 = 0x1000a540; +//nop; +t2 = MEM_U32(t2 + 4); +//nop; +if (t2 == 0) {//nop; +goto L41bc40;} +//nop; +t3 = 0x1000a1e6; +//nop; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L41bc40;} +//nop; +t9 = 0x10000124; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L41bc40;} +//nop; +t4 = 0x10000318; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L419980;} +//nop; +t6 = 0x100002f0; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L419980;} +//nop; +t5 = 0x10000340; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L419980;} +//nop; +t7 = 0x1000287c; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L419960; +MEM_U32(sp + 16) = zero; +L419960: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +at = 0x10000384; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10000348; +//nop; +MEM_U32(at + 0) = zero; +L419980: +t1 = 0x10000318; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L419a00;} +//nop; +t0 = 0x100002f4; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L419a00;} +//nop; +t8 = 0x100028b4; +//nop; +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4199d8; +MEM_U32(sp + 16) = zero; +L4199d8: +// bdead 40000003 gp = MEM_U32(sp + 64); +a0 = 0x2; +at = 0x10000384; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10000348; +MEM_U32(at + 0) = zero; +wrapper_exit(mem, a0); +goto L4199f8; +MEM_U32(at + 0) = zero; +L4199f8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L419a00: +t2 = 0x10000318; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L419a80;} +//nop; +t3 = 0x100002dc; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L419a80;} +//nop; +t9 = 0x100028e0; +a0 = 0x1; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L419a58; +MEM_U32(sp + 16) = zero; +L419a58: +// bdead 40000003 gp = MEM_U32(sp + 64); +a0 = 0x2; +at = 0x10000384; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10000348; +MEM_U32(at + 0) = zero; +wrapper_exit(mem, a0); +goto L419a78; +MEM_U32(at + 0) = zero; +L419a78: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L419a80: +t4 = 0x10000318; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L419b00;} +//nop; +t6 = 0x1000034c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L419b00;} +//nop; +t5 = 0x10002914; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L419ad8; +MEM_U32(sp + 16) = zero; +L419ad8: +// bdead 40000003 gp = MEM_U32(sp + 64); +a0 = 0x2; +at = 0x10000384; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10000348; +MEM_U32(at + 0) = zero; +wrapper_exit(mem, a0); +goto L419af8; +MEM_U32(at + 0) = zero; +L419af8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L419b00: +t7 = 0x10000318; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L419b30;} +//nop; +t1 = 0x10000324; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L419b90;} +//nop; +L419b30: +t0 = 0x10000254; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L419b90;} +//nop; +t8 = 0x1000294c; +//nop; +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L419b70; +MEM_U32(sp + 16) = zero; +L419b70: +// bdead 40000003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L419b88; +//nop; +L419b88: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L419b90: +t2 = 0x1000028c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L419c08;} +//nop; +t3 = 0x10000254; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L419c08;} +//nop; +t9 = 0x10002970; +a0 = 0x1; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L419be8; +MEM_U32(sp + 16) = zero; +L419be8: +// bdead 40000003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L419c00; +//nop; +L419c00: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L419c08: +t4 = 0x1000a36c; +at = 0x1; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L419d60;} +//nop; +t6 = 0x10000008; +at = 0x2; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == at) {at = 0x3; +goto L419c40;} +at = 0x3; +if (t6 != at) {//nop; +goto L419d60;} +//nop; +L419c40: +t5 = 0x10000110; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {at = 0x1000a560; +goto L419d60;} +at = 0x1000a560; +a1 = 0x10002990; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L419c70; +a1 = a1; +L419c70: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000299c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L419c8c; +a1 = a1; +L419c8c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a300; +//nop; +f_addlist(mem, sp, a0, a1); +goto L419ca8; +//nop; +L419ca8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +t7 = 0x10000234; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L419ce0;} +//nop; +t1 = 0x1000011c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L419cfc;} +//nop; +L419ce0: +a1 = 0x100029a4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L419cf4; +a1 = a1; +L419cf4: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L419cfc: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a540; +//nop; +f_add_prelinker_objects(mem, sp, a0, a1); +goto L419d10; +//nop; +L419d10: +// bdead 40000003 gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x10000104; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L419d38; +MEM_U32(sp + 16) = zero; +L419d38: +// bdead 4000000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L419d60;} +//nop; +t0 = 0x10000404; +at = 0x10000404; +t0 = MEM_U32(t0 + 0); +//nop; +t8 = t0 + 0x1; +MEM_U32(at + 0) = t8; +goto L41b960; +MEM_U32(at + 0) = t8; +L419d60: +at = 0x1000a560; +a1 = 0x100029a8; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L419d7c; +a1 = a1; +L419d7c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +t2 = 0x10000340; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L419de8;} +//nop; +t3 = 0x10000424; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L419de8;} +//nop; +t9 = 0x100002dc; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L419de8;} +//nop; +a1 = 0x100029ac; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L419de0; +a1 = a1; +L419de0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L419de8: +t4 = 0x10000324; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L419e70;} +//nop; +t6 = 0x1000031c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L419e70;} +//nop; +t5 = 0x100002f0; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L419f2c;} +//nop; +t7 = 0x100002f4; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L419f2c;} +//nop; +a1 = 0x100029b4; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L419e5c; +a1 = a1; +L419e5c: +// bdead 40000003 gp = MEM_U32(sp + 64); +t1 = 0x1; +at = 0x1000031c; +MEM_U32(at + 0) = t1; +goto L419f2c; +MEM_U32(at + 0) = t1; +L419e70: +t0 = 0x10000348; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L419f2c;} +//nop; +t8 = 0x1000032c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L419ec0;} +//nop; +a1 = 0x100029c0; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L419eb4; +a1 = a1; +L419eb4: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L419f2c; +//nop; +L419ec0: +t2 = 0x10000330; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L419ef8;} +//nop; +a1 = 0x100029d4; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L419eec; +a1 = a1; +L419eec: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L419f2c; +//nop; +L419ef8: +t3 = 0x10000334; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L419f2c;} +//nop; +a1 = 0x100029ec; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L419f24; +a1 = a1; +L419f24: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L419f2c: +t9 = 0x10000338; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L419f60;} +//nop; +a1 = 0x10002a00; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L419f58; +a1 = a1; +L419f58: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L419f60: +t4 = 0x100002d8; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L419fac;} +//nop; +t6 = 0x100002dc; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L419fac;} +//nop; +a1 = 0x10002a14; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L419fa4; +a1 = a1; +L419fa4: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L419fac: +t5 = 0x10000378; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L419fe0;} +//nop; +a1 = 0x10002a1c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L419fd8; +a1 = a1; +L419fd8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L419fe0: +t7 = 0x1000a36c; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L41a02c;} +//nop; +t1 = 0x10000008; +at = 0x3; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L41a02c;} +//nop; +a1 = 0x10002a30; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a024; +a1 = a1; +L41a024: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41a02c: +t0 = 0x1000028c; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L41a08c;} +//nop; +a1 = 0x10002a38; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a058; +a1 = a1; +L41a058: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +t8 = 0x1000a380; +at = 0x1000a1f4; +t2 = MEM_U32(t8 + 88); +//nop; +a0 = 0x1000a560; +MEM_U32(at + 0) = t2; +a1 = t2; +f_addstr(mem, sp, a0, a1); +goto L41a080; +a1 = t2; +L41a080: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41a0e0; +//nop; +L41a08c: +t3 = 0x1000a1ec; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L41a0e0;} +//nop; +a1 = 0x10002a3c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a0b8; +a1 = a1; +L41a0b8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1ec; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41a0d8; +//nop; +L41a0d8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41a0e0: +//nop; +//nop; +//nop; +v0 = f_gethostsex(mem, sp); +goto L41a0f0; +//nop; +L41a0f0: +// bdead 4000000b gp = MEM_U32(sp + 64); +//nop; +t9 = 0x1000041c; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (v0 == t9) {//nop; +goto L41a154;} +//nop; +if (t9 != 0) {//nop; +goto L41a138;} +//nop; +a1 = 0x10002a40; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a12c; +a1 = a1; +L41a12c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41a154; +//nop; +L41a138: +a1 = 0x10002a44; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a14c; +a1 = a1; +L41a14c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41a154: +a1 = 0x1000a25c; +a0 = 0x10002a48; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41a16c; +a0 = a0; +L41a16c: +// bdead 4000018b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41a2e8;} +//nop; +t4 = 0x10000260; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L41a37c;} +//nop; +t6 = 0x1000a36c; +at = 0x1; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L41a218;} +//nop; +t5 = 0x10000008; +at = 0x3; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L41a218;} +//nop; +t7 = 0x1000a32c; +a1 = 0x1000a25c; +a2 = 0x10000428; +a0 = 0x10002a4c; +a3 = 0x10002a50; +//nop; +t7 = MEM_U32(t7 + 0); +a1 = MEM_U32(a1 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a0 = a0; +a3 = a3; +MEM_U32(sp + 16) = t7; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a1f8; +MEM_U32(sp + 16) = t7; +L41a1f8: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41a210; +a1 = s4; +L41a210: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41a218: +t1 = 0x10000324; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L41a28c;} +//nop; +t0 = 0x1000a32c; +a1 = 0x1000a25c; +a2 = 0x10000428; +a0 = 0x10002a5c; +a3 = 0x10002a60; +//nop; +t0 = MEM_U32(t0 + 0); +a1 = MEM_U32(a1 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a0 = a0; +a3 = a3; +MEM_U32(sp + 16) = t0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a268; +MEM_U32(sp + 16) = t0; +L41a268: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41a280; +a1 = s4; +L41a280: +// bdead 40000183 gp = MEM_U32(sp + 64); +//nop; +goto L41a37c; +//nop; +L41a28c: +t8 = 0x1000a32c; +a1 = 0x1000a25c; +a2 = 0x10000428; +a0 = 0x10002a74; +a3 = 0x10002a78; +//nop; +t8 = MEM_U32(t8 + 0); +a1 = MEM_U32(a1 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a0 = a0; +a3 = a3; +MEM_U32(sp + 16) = t8; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a2c4; +MEM_U32(sp + 16) = t8; +L41a2c4: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41a2dc; +a1 = s4; +L41a2dc: +// bdead 40000183 gp = MEM_U32(sp + 64); +//nop; +goto L41a37c; +//nop; +L41a2e8: +t2 = 0x10000260; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L41a37c;} +//nop; +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L41a37c;} +//nop; +t9 = 0x10000008; +at = 0x3; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L41a37c;} +//nop; +a1 = 0x10000428; +a3 = 0x1000a32c; +a0 = 0x10002a84; +a2 = 0x10002a88; +//nop; +a1 = MEM_U32(a1 + 0); +a3 = MEM_U32(a3 + 0); +MEM_U32(sp + 16) = zero; +a0 = a0; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a35c; +a2 = a2; +L41a35c: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41a374; +a1 = s4; +L41a374: +// bdead 40000183 gp = MEM_U32(sp + 64); +//nop; +L41a37c: +t4 = 0x10000254; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L41a3b0;} +//nop; +a1 = 0x10002a94; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a3a8; +a1 = a1; +L41a3a8: +// bdead 40000183 gp = MEM_U32(sp + 64); +//nop; +L41a3b0: +t6 = 0x10000424; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41a564;} +//nop; +a0 = 0x10002a9c; +//nop; +a1 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a3dc; +a0 = a0; +L41a3dc: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41a3f4; +a1 = s4; +L41a3f4: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +t5 = 0x10000324; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L41a4bc;} +//nop; +a0 = 0x10002aa0; +a1 = 0x10002aa4; +a2 = 0x10002ab0; +//nop; +a3 = zero; +a0 = a0; +a1 = a1; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a438; +a2 = a2; +L41a438: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41a450; +a1 = s4; +L41a450: +// bdead 40000003 gp = MEM_U32(sp + 64); +a3 = zero; +a0 = 0x1000a26c; +a2 = 0x1000a254; +a1 = 0x10002ac4; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a478; +a1 = a1; +L41a478: +// bdead 4000000b gp = MEM_U32(sp + 64); +a3 = zero; +a0 = 0x1000a26c; +at = 0x10000164; +a1 = 0x10002ad8; +a2 = 0x10002aec; +//nop; +a0 = MEM_U32(a0 + 0); +MEM_U32(at + 0) = v0; +a1 = a1; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a4a8; +a2 = a2; +L41a4a8: +// bdead 4000010b gp = MEM_U32(sp + 64); +//nop; +at = 0x10000168; +MEM_U32(at + 0) = v0; +goto L41a564; +MEM_U32(at + 0) = v0; +L41a4bc: +a0 = 0x10002af4; +a1 = 0x10002af8; +a2 = 0x10002b04; +//nop; +a3 = zero; +a0 = a0; +a1 = a1; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a4e0; +a2 = a2; +L41a4e0: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41a4f8; +a1 = s4; +L41a4f8: +// bdead 40000003 gp = MEM_U32(sp + 64); +a3 = zero; +a0 = 0x1000a26c; +a2 = 0x1000a254; +a1 = 0x10002b10; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a520; +a1 = a1; +L41a520: +// bdead 4000000b gp = MEM_U32(sp + 64); +a3 = zero; +a0 = 0x1000a26c; +at = 0x10000164; +a1 = 0x10002b1c; +a2 = 0x10002b28; +//nop; +a0 = MEM_U32(a0 + 0); +MEM_U32(at + 0) = v0; +a1 = a1; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a550; +a2 = a2; +L41a550: +// bdead 4000010b gp = MEM_U32(sp + 64); +//nop; +at = 0x10000168; +//nop; +MEM_U32(at + 0) = v0; +L41a564: +t7 = 0x10000370; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41a718;} +//nop; +t1 = 0x100003e4; +at = 0x1; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L41a5cc;} +//nop; +a0 = 0x10002b30; +//nop; +a1 = zero; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a5ac; +a0 = a0; +L41a5ac: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41a5c4; +a1 = s4; +L41a5c4: +// bdead 40000103 gp = MEM_U32(sp + 64); +//nop; +L41a5cc: +a0 = 0x10002b40; +//nop; +a1 = zero; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a5e4; +a0 = a0; +L41a5e4: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41a5fc; +a1 = s4; +L41a5fc: +// bdead 40000103 gp = MEM_U32(sp + 64); +//nop; +t0 = 0x10000348; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L41a718;} +//nop; +a1 = 0x10002b50; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a630; +a1 = a1; +L41a630: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10002b68; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a64c; +a1 = a1; +L41a64c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +t8 = 0x100002f8; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L41a68c;} +//nop; +a1 = 0x10002b7c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a680; +a1 = a1; +L41a680: +// bdead 40000103 gp = MEM_U32(sp + 64); +//nop; +goto L41a718; +//nop; +L41a68c: +t2 = 0x100002fc; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L41a6c4;} +//nop; +a1 = 0x10002b90; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a6b8; +a1 = a1; +L41a6b8: +// bdead 40000103 gp = MEM_U32(sp + 64); +//nop; +goto L41a718; +//nop; +L41a6c4: +t3 = 0x10000420; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L41a6fc;} +//nop; +a1 = 0x10002ba0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a6f0; +a1 = a1; +L41a6f0: +// bdead 40000103 gp = MEM_U32(sp + 64); +//nop; +goto L41a718; +//nop; +L41a6fc: +a1 = 0x10002bb4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a710; +a1 = a1; +L41a710: +// bdead 40000103 gp = MEM_U32(sp + 64); +//nop; +L41a718: +t9 = 0x10000280; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L41a76c;} +//nop; +a1 = 0x10000428; +a0 = 0x10002bc4; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a74c; +a0 = a0; +L41a74c: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41a764; +a1 = s4; +L41a764: +// bdead 40000103 gp = MEM_U32(sp + 64); +//nop; +L41a76c: +t4 = 0x1000a1b8; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L41a7cc;} +//nop; +t6 = MEM_U8(t4 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41a7cc;} +//nop; +a0 = 0x10002bc8; +//nop; +a1 = t4; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a7ac; +a0 = a0; +L41a7ac: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41a7c4; +a1 = s4; +L41a7c4: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41a7cc: +t5 = 0x1000028c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L41a838;} +//nop; +a1 = 0x10002bcc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a7f8; +a1 = a1; +L41a7f8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10002bd0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a814; +a1 = a1; +L41a814: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10002bd4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a830; +a1 = a1; +L41a830: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41a838: +t7 = 0x10000424; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41a870;} +//nop; +a1 = 0x10002bd8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41a864; +a1 = a1; +L41a864: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41a8b4; +//nop; +L41a870: +a0 = 0x10002bdc; +a1 = 0x10002be0; +a2 = 0x10002be4; +//nop; +a3 = zero; +a0 = a0; +a1 = a1; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a894; +a2 = a2; +L41a894: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41a8ac; +a1 = s4; +L41a8ac: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41a8b4: +a1 = 0x10000400; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41a8cc; +//nop; +L41a8cc: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a4e0; +//nop; +f_addlist(mem, sp, a0, a1); +goto L41a8e8; +//nop; +L41a8e8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x100002f0; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L41aaf0;} +//nop; +t0 = MEM_U32(sp + 332); +//nop; +if (t0 != 0) {//nop; +goto L41aaf0;} +//nop; +a1 = 0x1000a25c; +a0 = 0x10002be8; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41a930; +a0 = a0; +L41a930: +// bdead 4000000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41aa24;} +//nop; +t8 = 0x10000324; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L41a9bc;} +//nop; +t2 = 0x1000a32c; +a1 = 0x1000a25c; +a2 = 0x10000428; +t3 = 0x10002bfc; +a0 = 0x10002bec; +a3 = 0x10002bf0; +//nop; +t2 = MEM_U32(t2 + 0); +a1 = MEM_U32(a1 + 0); +a2 = MEM_U32(a2 + 0); +t3 = t3; +MEM_U32(sp + 20) = t3; +MEM_U32(sp + 24) = zero; +a0 = a0; +a3 = a3; +MEM_U32(sp + 16) = t2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41a998; +MEM_U32(sp + 16) = t2; +L41a998: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41a9b0; +a1 = s4; +L41a9b0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41aaf0; +//nop; +L41a9bc: +t9 = 0x1000a32c; +a1 = 0x1000a25c; +t9 = MEM_U32(t9 + 0); +a2 = 0x10000428; +t6 = 0x10002c1c; +MEM_U32(sp + 16) = t9; +//nop; +a0 = 0x10002c0c; +a3 = 0x10002c10; +a1 = MEM_U32(a1 + 0); +a2 = MEM_U32(a2 + 0); +t6 = t6; +MEM_U32(sp + 20) = t6; +MEM_U32(sp + 24) = zero; +a0 = a0; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41aa00; +a3 = a3; +L41aa00: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41aa18; +a1 = s4; +L41aa18: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41aaf0; +//nop; +L41aa24: +t4 = 0x10000324; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L41aa98;} +//nop; +a1 = 0x10000428; +a3 = 0x1000a32c; +t5 = 0x10002c34; +a0 = 0x10002c24; +a2 = 0x10002c28; +//nop; +a1 = MEM_U32(a1 + 0); +a3 = MEM_U32(a3 + 0); +t5 = t5; +MEM_U32(sp + 16) = t5; +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41aa74; +a2 = a2; +L41aa74: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41aa8c; +a1 = s4; +L41aa8c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41aaf0; +//nop; +L41aa98: +a1 = 0x10000428; +a3 = 0x1000a32c; +t7 = 0x10002c54; +a0 = 0x10002c44; +a2 = 0x10002c48; +//nop; +a1 = MEM_U32(a1 + 0); +a3 = MEM_U32(a3 + 0); +t7 = t7; +MEM_U32(sp + 16) = t7; +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41aad0; +a2 = a2; +L41aad0: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41aae8; +a1 = s4; +L41aae8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41aaf0: +t1 = 0x10000254; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L41ac58;} +//nop; +t0 = 0x1000a36c; +at = 0x1; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L41ab78;} +//nop; +t8 = 0x10000008; +at = 0x2; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == at) {at = 0x3; +goto L41ab40;} +at = 0x3; +if (t8 != at) {//nop; +goto L41ab78;} +//nop; +L41ab40: +//nop; +//nop; +//nop; +f_add_cxx_symbol_options(mem, sp); +goto L41ab50; +//nop; +L41ab50: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000016c; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ab70; +//nop; +L41ab70: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41ab78: +t2 = 0x1000a36c; +at = 0x1; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L41abc8;} +//nop; +t3 = 0x10000008; +at = 0x3; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L41abc8;} +//nop; +a1 = 0x10000170; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41abc0; +//nop; +L41abc0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41abc8: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a540; +//nop; +f_addlist(mem, sp, a0, a1); +goto L41abdc; +//nop; +L41abdc: +// bdead 40000003 gp = MEM_U32(sp + 64); +at = 0x1; +t9 = 0x1000a36c; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L41ac38;} +//nop; +t6 = 0x10000008; +at = 0x2; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == at) {at = 0x3; +goto L41ac1c;} +at = 0x3; +if (t6 != at) {//nop; +goto L41ac38;} +//nop; +L41ac1c: +a1 = 0x10002c5c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41ac30; +a1 = a1; +L41ac30: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41ac38: +a1 = 0x10002c60; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41ac4c; +a1 = a1; +L41ac4c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41b6c8; +//nop; +L41ac58: +a1 = 0x10002c64; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41ac6c; +a1 = a1; +L41ac6c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000164; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ac8c; +//nop; +L41ac8c: +// bdead 40000003 gp = MEM_U32(sp + 64); +at = 0x1; +t4 = 0x1000a36c; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L41ad04;} +//nop; +t5 = 0x10000008; +at = 0x2; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == at) {at = 0x3; +goto L41accc;} +at = 0x3; +if (t5 != at) {//nop; +goto L41ad04;} +//nop; +L41accc: +//nop; +//nop; +//nop; +f_add_cxx_symbol_options(mem, sp); +goto L41acdc; +//nop; +L41acdc: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000016c; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41acfc; +//nop; +L41acfc: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41ad04: +t7 = 0x1000a36c; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L41ad54;} +//nop; +t1 = 0x10000008; +at = 0x3; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L41ad54;} +//nop; +a1 = 0x10000170; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ad4c; +//nop; +L41ad4c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41ad54: +t0 = 0x10000220; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L41ad8c;} +//nop; +a1 = 0x100001d4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ad84; +//nop; +L41ad84: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41ad8c: +a1 = 0x10002c70; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41ada0; +a1 = a1; +L41ada0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a540; +//nop; +f_addlist(mem, sp, a0, a1); +goto L41adbc; +//nop; +L41adbc: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a5a8; +//nop; +f_addlist(mem, sp, a0, a1); +goto L41add8; +//nop; +L41add8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +t8 = 0x10000004; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L41ae2c;} +//nop; +t2 = 0x1000a36c; +at = 0x1; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L41ae2c;} +//nop; +a1 = 0x10002c78; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41ae24; +a1 = a1; +L41ae24: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41ae2c: +a1 = 0x10002c80; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41ae40; +a1 = a1; +L41ae40: +// bdead 40000003 gp = MEM_U32(sp + 64); +at = 0x2; +t3 = 0x1000a36c; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == at) {//nop; +goto L41ae78;} +//nop; +t9 = 0x10000388; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L41aef8;} +//nop; +L41ae78: +a1 = 0x10000174; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41ae90; +//nop; +L41ae90: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100001d8; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41aeb0; +//nop; +L41aeb0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100001bc; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41aed0; +//nop; +L41aed0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100001e4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41aef0; +//nop; +L41aef0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41aef8: +t6 = 0x1000a36c; +at = 0x3; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == at) {//nop; +goto L41af28;} +//nop; +t4 = 0x1000038c; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L41b12c;} +//nop; +L41af28: +t5 = 0x1000a150; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L41af60;} +//nop; +a1 = 0x1000a5c8; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41af58; +//nop; +L41af58: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41af60: +t7 = 0x10000324; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L41af90;} +//nop; +t1 = 0x10000424; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L41b0ec;} +//nop; +L41af90: +a1 = 0x10000184; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41afa8; +//nop; +L41afa8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000017c; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41afc8; +//nop; +L41afc8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10000194; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41afe8; +//nop; +L41afe8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +t0 = 0x1000039c; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L41b0a8;} +//nop; +a0 = 0x1000018c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L41b01c; +//nop; +L41b01c: +// bdead 4000000b gp = MEM_U32(sp + 64); +MEM_U32(sp + 220) = v0; +a0 = MEM_U32(sp + 220); +//nop; +a0 = a0 + 0x2; +//nop; +v0 = wrapper_malloc(mem, a0); +goto L41b038; +//nop; +L41b038: +// bdead 4000000b gp = MEM_U32(sp + 64); +MEM_U32(sp + 216) = v0; +a1 = 0x1000018c; +//nop; +a0 = MEM_U32(sp + 216); +a2 = MEM_U32(sp + 220); +a1 = MEM_U32(a1 + 0); +//nop; +v0 = wrapper_memcpy(mem, a0, a1, a2); +goto L41b05c; +//nop; +L41b05c: +t2 = MEM_U32(sp + 216); +t3 = MEM_U32(sp + 220); +// bdead 40001803 gp = MEM_U32(sp + 64); +t8 = 0x5f; +t9 = t2 + t3; +MEM_U8(t9 + 0) = (uint8_t)t8; +t4 = MEM_U32(sp + 216); +t5 = MEM_U32(sp + 220); +t6 = 0x73; +t7 = t4 + t5; +MEM_U8(t7 + 1) = (uint8_t)t6; +t1 = MEM_U32(sp + 216); +t0 = MEM_U32(sp + 220); +at = 0x1000018c; +t2 = t1 + t0; +MEM_U8(t2 + 2) = (uint8_t)zero; +t3 = MEM_U32(sp + 216); +//nop; +MEM_U32(at + 0) = t3; +L41b0a8: +a1 = 0x1000018c; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41b0c0; +//nop; +L41b0c0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100001a0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41b0e0; +//nop; +L41b0e0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41b12c; +//nop; +L41b0ec: +a1 = 0x10000198; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41b104; +//nop; +L41b104: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000017c; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41b124; +//nop; +L41b124: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b12c: +t8 = 0x1000a36c; +at = 0x5; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L41b1e0;} +//nop; +a1 = 0x100001b4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41b15c; +//nop; +L41b15c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100001d8; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41b17c; +//nop; +L41b17c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10002c8c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b198; +a1 = a1; +L41b198: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100001bc; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41b1b8; +//nop; +L41b1b8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100001e4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41b1d8; +//nop; +L41b1d8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b1e0: +t9 = 0x1000a36c; +at = 0x2; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == at) {//nop; +goto L41b268;} +//nop; +t4 = 0x1000038c; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {at = 0x3; +goto L41b218;} +at = 0x3; +if (t9 != at) {//nop; +goto L41b268;} +//nop; +L41b218: +t5 = 0x10000388; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L41b268;} +//nop; +t6 = 0x1000a134; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L41b268;} +//nop; +t7 = 0x1000a36c; +at = 0x5; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == at) {at = 0x6; +goto L41b268;} +at = 0x6; +if (t7 != at) {//nop; +goto L41b288;} +//nop; +L41b268: +a1 = 0x1000017c; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41b280; +//nop; +L41b280: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b288: +t1 = 0x10000220; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L41b2c0;} +//nop; +a1 = 0x100001d4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41b2b8; +//nop; +L41b2b8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b2c0: +t0 = 0x1000030c; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L41b334;} +//nop; +a0 = 0x100001a8; +a1 = 0x10002c98; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_fopen(mem, a0, a1); +goto L41b2f0; +a1 = a1; +L41b2f0: +// bdead 4000000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a234; +t2 = 0x1000a234; +MEM_U32(at + 0) = v0; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L41b334;} +//nop; +a1 = 0x100001ac; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addspacedstr(mem, sp, a0, a1); +goto L41b32c; +//nop; +L41b32c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b334: +t3 = 0x1000a188; +at = 0x10000; +t3 = MEM_U32(t3 + 0); +//nop; +t8 = t3 & at; +if (t8 == 0) {//nop; +goto L41b3a4;} +//nop; +a1 = 0x100001f0; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41b368; +//nop; +L41b368: +// bdead 40000003 gp = MEM_U32(sp + 64); +at = 0x1; +t4 = 0x1000a36c; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L41b3a4;} +//nop; +a1 = 0x10002c9c; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b39c; +a1 = a1; +L41b39c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b3a4: +t9 = 0x1000043c; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L41b3f0;} +//nop; +t5 = 0x1000a36c; +at = 0x1; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L41b3f0;} +//nop; +a1 = 0x10002ca4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b3e8; +a1 = a1; +L41b3e8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b3f0: +t6 = 0x1000a36c; +at = 0x3; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L41b534;} +//nop; +t7 = 0x1000039c; +at = 0x2; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L41b45c;} +//nop; +a1 = 0x10002cac; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b434; +a1 = a1; +L41b434: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10002cb4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b450; +a1 = a1; +L41b450: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41b660; +//nop; +L41b45c: +t1 = 0x10000424; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L41b4a8;} +//nop; +t0 = 0x1000a5b4; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L41b4a8;} +//nop; +a1 = 0x10002cb8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b4a0; +a1 = a1; +L41b4a0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b4a8: +t2 = 0x1000a56c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L41b4e0;} +//nop; +a1 = 0x10002cc0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b4d4; +a1 = a1; +L41b4d4: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41b514; +//nop; +L41b4e0: +t3 = 0x1000a570; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L41b514;} +//nop; +a1 = 0x10002cc8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b50c; +a1 = a1; +L41b50c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b514: +a1 = 0x10002cd0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b528; +a1 = a1; +L41b528: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41b660; +//nop; +L41b534: +t8 = 0x10000424; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L41b584;} +//nop; +t4 = 0x1000a188; +at = 0x10000; +t4 = MEM_U32(t4 + 0); +//nop; +t9 = t4 & at; +if (t9 == 0) {//nop; +goto L41b584;} +//nop; +a1 = 0x10002cd4; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b57c; +a1 = a1; +L41b57c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b584: +t5 = 0x1000a36c; +at = 0x1; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L41b5d8;} +//nop; +t6 = 0x10000008; +at = 0x2; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == at) {at = 0x3; +goto L41b5bc;} +at = 0x3; +if (t6 != at) {//nop; +goto L41b5d8;} +//nop; +L41b5bc: +a1 = 0x10002cdc; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b5d0; +a1 = a1; +L41b5d0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b5d8: +t7 = 0x1000a56c; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41b610;} +//nop; +a1 = 0x10002ce0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b604; +a1 = a1; +L41b604: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41b644; +//nop; +L41b610: +t1 = 0x1000a570; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L41b644;} +//nop; +a1 = 0x10002ce8; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b63c; +a1 = a1; +L41b63c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b644: +a1 = 0x10002cf0; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b658; +a1 = a1; +L41b658: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b660: +t0 = 0x100001e8; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L41b698;} +//nop; +a1 = 0x10000168; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41b690; +//nop; +L41b690: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b698: +t2 = 0x1000a30c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L41b6c8;} +//nop; +//nop; +a0 = 0x1000a560; +a1 = t2; +f_addstr(mem, sp, a0, a1); +goto L41b6c0; +a1 = t2; +L41b6c0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b6c8: +at = 0x1000a1f0; +t3 = 0x1000a380; +a0 = 0x100000e8; +a1 = 0x1000a560; +MEM_U32(at + 0) = zero; +//nop; +t8 = MEM_U32(t3 + 128); +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = t8; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L41b6fc; +MEM_U32(sp + 16) = t8; +L41b6fc: +// bdead 4000000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41b7a8;} +//nop; +t4 = 0x10000404; +t5 = 0x10000240; +t4 = MEM_U32(t4 + 0); +at = 0x10000404; +t5 = MEM_U32(t5 + 0); +t9 = t4 + 0x1; +if (t5 != 0) {MEM_U32(at + 0) = t9; +goto L41b7a8;} +MEM_U32(at + 0) = t9; +t6 = 0x1000a1ec; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41b75c;} +//nop; +//nop; +a0 = t6; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41b750; +//nop; +L41b750: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41b778; +//nop; +L41b75c: +a0 = 0x10002cf4; +//nop; +a0 = a0; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41b770; +//nop; +L41b770: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b778: +t7 = 0x10000410; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41b7a8;} +//nop; +//nop; +a0 = t7; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41b7a0; +//nop; +L41b7a0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b7a8: +t1 = 0x1000a380; +//nop; +t0 = MEM_U32(t1 + 128); +//nop; +if (t0 == 0) {//nop; +goto L41b854;} +//nop; +//nop; +a0 = t0; +a1 = sp + 0x50; +v0 = wrapper_stat(mem, a0, a1); +goto L41b7d0; +a1 = sp + 0x50; +L41b7d0: +// bdead 4000000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41b838;} +//nop; +t2 = MEM_U32(sp + 128); +//nop; +if ((int)t2 <= 0) {at = 0x1000a560; +goto L41b838;} +at = 0x1000a560; +a1 = 0x10002cfc; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b804; +a1 = a1; +L41b804: +// bdead 40000003 gp = MEM_U32(sp + 64); +a3 = zero; +a0 = 0x10000100; +a1 = 0x1000a560; +t3 = 0x1000a380; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a2 = MEM_U32(t3 + 128); +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L41b830; +MEM_U32(sp + 16) = zero; +L41b830: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b838: +t8 = 0x1000a380; +//nop; +a0 = MEM_U32(t8 + 128); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41b84c; +//nop; +L41b84c: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b854: +t4 = 0x10000404; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L41b960;} +//nop; +t9 = 0x1000a36c; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L41b960;} +//nop; +t5 = 0x10000008; +at = 0x2; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == at) {at = 0x3; +goto L41b8a4;} +at = 0x3; +if (t5 != at) {//nop; +goto L41b960;} +//nop; +L41b8a4: +a1 = 0x100000fc; +at = 0x1000a560; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +MEM_U32(at + 4) = zero; +f_addstr(mem, sp, a0, a1); +goto L41b8c0; +MEM_U32(at + 4) = zero; +L41b8c0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +t6 = 0x1000a1ec; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41b8fc;} +//nop; +//nop; +a0 = 0x1000a560; +a1 = t6; +f_addstr(mem, sp, a0, a1); +goto L41b8f0; +a1 = t6; +L41b8f0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41b918; +//nop; +L41b8fc: +a1 = 0x10002d04; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b910; +a1 = a1; +L41b910: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b918: +a0 = 0x100000fc; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L41b93c; +MEM_U32(sp + 16) = zero; +L41b93c: +// bdead 4000000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41b960;} +//nop; +t7 = 0x10000404; +at = 0x10000404; +t7 = MEM_U32(t7 + 0); +//nop; +t1 = t7 + 0x1; +MEM_U32(at + 0) = t1; +L41b960: +t0 = 0x1000028c; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L41bb9c;} +//nop; +t2 = 0x10000404; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {at = 0x1000a560; +goto L41bb9c;} +at = 0x1000a560; +a1 = 0x10002d0c; +//nop; +a0 = 0x1000a560; +MEM_U32(at + 4) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b9a8; +a1 = a1; +L41b9a8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +t3 = 0x10000234; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L41b9e4;} +//nop; +a1 = 0x10002d14; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41b9dc; +a1 = a1; +L41b9dc: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41b9e4: +//nop; +a0 = 0x1000a560; +a1 = 0x1000a510; +//nop; +f_addlist(mem, sp, a0, a1); +goto L41b9f8; +//nop; +L41b9f8: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +t8 = 0x1000a1ec; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {at = 0x1000a1f4; +goto L41ba20;} +at = 0x1000a1f4; +MEM_U32(at + 0) = t8; +goto L41ba30; +MEM_U32(at + 0) = t8; +L41ba20: +t4 = 0x10002d18; +at = 0x1000a1f4; +t4 = t4; +MEM_U32(at + 0) = t4; +L41ba30: +a1 = 0x10002d20; +//nop; +a0 = 0x1000a560; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41ba44; +a1 = a1; +L41ba44: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1f4; +//nop; +a0 = 0x1000a560; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ba64; +//nop; +L41ba64: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +t9 = 0x1000a380; +a0 = 0x1000a560; +a1 = MEM_U32(t9 + 88); +//nop; +//nop; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ba88; +//nop; +L41ba88: +// bdead 40000103 gp = MEM_U32(sp + 64); +//nop; +t5 = 0x1000a550; +//nop; +t5 = MEM_U32(t5 + 4); +//nop; +if (t5 == 0) {//nop; +goto L41bac8;} +//nop; +//nop; +a0 = 0x1000a560; +a1 = 0x1000a550; +//nop; +f_addlist(mem, sp, a0, a1); +goto L41babc; +//nop; +L41babc: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41bb04; +//nop; +L41bac8: +a0 = 0x1000a1f4; +a1 = 0x10002d24; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41bae4; +a1 = a1; +L41bae4: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a560; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41bafc; +a1 = s4; +L41bafc: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41bb04: +a0 = 0x100000f0; +a1 = 0x1000a560; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +v0 = f_run(mem, sp, a0, a1, a2, a3); +goto L41bb28; +MEM_U32(sp + 16) = zero; +L41bb28: +// bdead 4000000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41bb80;} +//nop; +t6 = 0x10000404; +a0 = 0x1000a1f4; +t6 = MEM_U32(t6 + 0); +at = 0x10000404; +//nop; +a0 = MEM_U32(a0 + 0); +t7 = t6 + 0x1; +MEM_U32(at + 0) = t7; +v0 = wrapper_unlink(mem, a0); +goto L41bb58; +MEM_U32(at + 0) = t7; +L41bb58: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +t1 = 0x1000a380; +//nop; +a0 = MEM_U32(t1 + 88); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41bb74; +//nop; +L41bb74: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +goto L41bb9c; +//nop; +L41bb80: +t0 = 0x1000a380; +//nop; +a0 = MEM_U32(t0 + 88); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41bb94; +//nop; +L41bb94: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41bb9c: +t2 = 0x10000404; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L41bc40;} +//nop; +t3 = 0x1000a520; +at = 0x1; +t3 = MEM_U32(t3 + 4); +//nop; +if (t3 != at) {//nop; +goto L41bc40;} +//nop; +t8 = 0x10000418; +at = 0x1; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L41bc40;} +//nop; +t4 = 0x10000240; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L41bc40;} +//nop; +t9 = 0x1000a520; +a1 = 0x6f; +t9 = MEM_U32(t9 + 8); +//nop; +a0 = MEM_U32(t9 + 0); +//nop; +//nop; +//nop; +v0 = f_mksuf(mem, sp, a0, a1); +goto L41bc20; +//nop; +L41bc20: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = s4; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41bc38; +//nop; +L41bc38: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41bc40: +t5 = 0x10000410; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L41bc70;} +//nop; +//nop; +a0 = t5; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41bc68; +//nop; +L41bc68: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41bc70: +t6 = 0x100002a8; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41bcd8;} +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41bc9c; +//nop; +L41bc9c: +// bdead 40000003 gp = MEM_U32(sp + 64); +at = 0x2; +t7 = 0x100002a8; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L41bcd8;} +//nop; +t1 = 0x1000a380; +//nop; +a0 = MEM_U32(t1 + 100); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41bcd0; +//nop; +L41bcd0: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41bcd8: +t0 = 0x1000a36c; +at = 0x1; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L41bd28;} +//nop; +t2 = 0x1000021c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +at = (int)t2 < (int)0x2; +if (at != 0) {//nop; +goto L41bd28;} +//nop; +t3 = 0x1000a380; +//nop; +a0 = MEM_U32(t3 + 132); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L41bd20; +//nop; +L41bd20: +// bdead 40000003 gp = MEM_U32(sp + 64); +//nop; +L41bd28: +t8 = 0x10000404; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L41bd58;} +//nop; +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L41bd50; +//nop; +L41bd50: +// bdead 3 gp = MEM_U32(sp + 64); +//nop; +L41bd58: +// bdead 3 ra = MEM_U32(sp + 68); +// bdead 3 s0 = MEM_U32(sp + 40); +// bdead 3 s1 = MEM_U32(sp + 44); +// bdead 3 s2 = MEM_U32(sp + 48); +// bdead 3 s3 = MEM_U32(sp + 52); +// bdead 3 s4 = MEM_U32(sp + 56); +// bdead 3 s5 = MEM_U32(sp + 60); +// bdead 3 sp = sp + 0x160; +v0 = zero; +return v0; +v0 = zero; +} + +static void f_process_config(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41bd80: +//process_config: +//nop; +//nop; +//nop; +sp = sp + 0xffffeeb0; +t6 = 0x1000a25c; +MEM_U32(sp + 4432) = a0; +t7 = MEM_U32(sp + 4432); +// fdead 4001806b MEM_U32(sp + 28) = s0; +t6 = MEM_U32(t6 + 0); +s0 = 0x1; +at = (int)s0 < (int)t7; +// fdead 4003806f MEM_U32(sp + 44) = ra; +// fdead 4003806f MEM_U32(sp + 40) = gp; +MEM_U32(sp + 4436) = a1; +// fdead 4003806f MEM_U32(sp + 36) = s2; +// fdead 4003806f MEM_U32(sp + 32) = s1; +if (at == 0) {MEM_U32(sp + 4420) = t6; +goto L41c074;} +MEM_U32(sp + 4420) = t6; +L41bdc8: +t8 = MEM_U32(sp + 4436); +t9 = s0 << 2; +t0 = t8 + t9; +//nop; +a1 = 0x10002d28; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41bde8; +a1 = a1; +L41bde8: +// bdead 4002000b gp = MEM_U32(sp + 40); +if (v0 != 0) {//nop; +goto L41c060;} +//nop; +t1 = MEM_U32(sp + 4432); +s0 = s0 + 0x1; +at = (int)s0 < (int)t1; +if (at != 0) {//nop; +goto L41be50;} +//nop; +t2 = 0x10002d34; +//nop; +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41be30; +MEM_U32(sp + 16) = zero; +L41be30: +// bdead 40020003 gp = MEM_U32(sp + 40); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41be48; +//nop; +L41be48: +// bdead 40020003 gp = MEM_U32(sp + 40); +//nop; +L41be50: +at = 0x1000035c; +t4 = MEM_U32(sp + 4436); +t3 = 0x1; +t5 = s0 << 2; +MEM_U32(at + 0) = t3; +t6 = t4 + t5; +t7 = MEM_U32(t6 + 0); +at = 0x1000a27c; +a1 = 0x10002d54; +//nop; +a0 = t7; +MEM_U32(at + 0) = t7; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41be88; +a1 = a1; +L41be88: +// bdead 4000000b gp = MEM_U32(sp + 40); +if (v0 != 0) {at = 0x10000370; +goto L41bea0;} +at = 0x10000370; +t8 = 0x1; +MEM_U32(at + 0) = t8; +goto L41bee8; +MEM_U32(at + 0) = t8; +L41bea0: +t9 = 0x10002d5c; +a0 = 0x1; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41bec8; +MEM_U32(sp + 16) = zero; +L41bec8: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41bee0; +//nop; +L41bee0: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L41bee8: +a0 = 0x1000a27c; +a1 = 0x10002d78; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41bf00; +a1 = a1; +L41bf00: +// bdead 4000000b gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L41c018;} +//nop; +a0 = 0x1000a27c; +a1 = 0x10002d80; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41bf24; +a1 = a1; +L41bf24: +// bdead 4000000b gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L41c018;} +//nop; +a0 = 0x1000a27c; +a1 = 0x10002d88; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41bf48; +a1 = a1; +L41bf48: +// bdead 4000000b gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L41c018;} +//nop; +a0 = 0x1000a27c; +a1 = 0x10002d90; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41bf6c; +a1 = a1; +L41bf6c: +// bdead 4000000b gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L41c018;} +//nop; +a1 = 0x1000a27c; +a0 = 0x10002d98; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +v0 = wrapper_strcat(mem, a0, a1); +goto L41bf90; +a0 = a0; +L41bf90: +// bdead 4000000b gp = MEM_U32(sp + 40); +s2 = v0; +a1 = 0x10002d9c; +//nop; +a0 = s2; +a1 = a1; +v0 = wrapper_fopen(mem, a0, a1); +goto L41bfac; +a1 = a1; +L41bfac: +// bdead 4000000b gp = MEM_U32(sp + 40); +if (v0 != 0) {//nop; +goto L41c018;} +//nop; +t0 = 0x1000036c; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L41c018;} +//nop; +t1 = 0x10002da0; +//nop; +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41bff8; +MEM_U32(sp + 16) = zero; +L41bff8: +// bdead 40000003 gp = MEM_U32(sp + 40); +t2 = 0x1; +at = 0x1000036c; +t3 = 0x10002de8; +MEM_U32(at + 0) = t2; +at = 0x1000a27c; +t3 = t3; +MEM_U32(at + 0) = t3; +L41c018: +t4 = 0x10000370; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L41c074;} +//nop; +a0 = 0x1000a25c; +a1 = 0x1000a27c; +a2 = 0x10002df0; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 0); +a3 = zero; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41c054; +a2 = a2; +L41c054: +// bdead 4000000b gp = MEM_U32(sp + 40); +MEM_U32(sp + 4420) = v0; +goto L41c074; +MEM_U32(sp + 4420) = v0; +L41c060: +t5 = MEM_U32(sp + 4432); +s0 = s0 + 0x1; +at = (int)s0 < (int)t5; +if (at != 0) {//nop; +goto L41bdc8;} +//nop; +L41c074: +t6 = 0x1000035c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L41c0b8;} +//nop; +a0 = 0x1000a25c; +a1 = 0x1000a27c; +a2 = 0x10002df4; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 0); +a3 = zero; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41c0b0; +a2 = a2; +L41c0b0: +// bdead 4000000b gp = MEM_U32(sp + 40); +MEM_U32(sp + 4420) = v0; +L41c0b8: +a2 = 0x1000a32c; +at = 0x1000035c; +a1 = 0x10002df8; +a3 = 0x10002e04; +//nop; +a0 = MEM_U32(sp + 4420); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 16) = zero; +MEM_U32(at + 0) = zero; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41c0e8; +a3 = a3; +L41c0e8: +// bdead 4000000b gp = MEM_U32(sp + 40); +MEM_U32(sp + 4416) = v0; +a1 = 0x10002e10; +//nop; +a0 = MEM_U32(sp + 4416); +a1 = a1; +v0 = wrapper_fopen(mem, a0, a1); +goto L41c104; +a1 = a1; +L41c104: +MEM_U32(sp + 4412) = v0; +t7 = MEM_U32(sp + 4412); +// bdead 40010003 gp = MEM_U32(sp + 40); +if (t7 == 0) {//nop; +goto L41c2d8;} +//nop; +//nop; +a2 = MEM_U32(sp + 4412); +a0 = sp + 0x13c; +a1 = 0x1000; +v0 = wrapper_fgets(mem, a0, a1, a2); +goto L41c12c; +a1 = 0x1000; +L41c12c: +// bdead 4000000b gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L41c2d8;} +//nop; +//nop; +a0 = sp + 0x13c; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L41c148; +//nop; +L41c148: +s2 = v0; +t8 = sp + 0x13c; +t9 = s2 + t8; +t0 = MEM_U8(t9 + -1); +// bdead 42000203 gp = MEM_U32(sp + 40); +at = 0xa; +if (t0 != at) {//nop; +goto L41c18c;} +//nop; +//nop; +a0 = t8; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L41c178; +//nop; +L41c178: +s2 = v0; +t1 = sp + 0x13c; +t2 = s2 + t1; +// bdead 40000803 gp = MEM_U32(sp + 40); +MEM_U8(t2 + -1) = (uint8_t)zero; +L41c18c: +s1 = sp + 0x13c; +MEM_U32(sp + 312) = zero; +t3 = MEM_U8(s1 + 0); +// bdead 40041003 s0 = zero; +if (t3 == 0) {//nop; +goto L41c2c0;} +//nop; +L41c1a4: +t4 = MEM_U8(s1 + 0); +//nop; +if (t4 == 0) {//nop; +goto L41c204;} +//nop; +t5 = MEM_U8(s1 + 0); +at = 0x20; +if (t5 == at) {//nop; +goto L41c1d4;} +//nop; +t6 = MEM_U8(s1 + 0); +at = 0x9; +if (t6 != at) {//nop; +goto L41c204;} +//nop; +L41c1d4: +t7 = MEM_U8(s1 + 1); +s1 = s1 + 0x1; +if (t7 == 0) {//nop; +goto L41c204;} +//nop; +t9 = MEM_U8(s1 + 0); +at = 0x20; +if (t9 == at) {//nop; +goto L41c1d4;} +//nop; +t0 = MEM_U8(s1 + 0); +at = 0x9; +if (t0 == at) {//nop; +goto L41c1d4;} +//nop; +L41c204: +t8 = MEM_U8(s1 + 0); +//nop; +if (t8 == 0) {//nop; +goto L41c238;} +//nop; +t1 = MEM_U32(sp + 312); +t3 = sp + 0x38; +t2 = t1 << 2; +t4 = t2 + t3; +MEM_U32(t4 + 0) = s1; +t5 = MEM_U32(sp + 312); +//nop; +t6 = t5 + 0x1; +MEM_U32(sp + 312) = t6; +L41c238: +t7 = MEM_U8(s1 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41c298;} +//nop; +t9 = MEM_U8(s1 + 0); +at = 0x20; +if (t9 == at) {//nop; +goto L41c298;} +//nop; +t0 = MEM_U8(s1 + 0); +at = 0x9; +if (t0 == at) {//nop; +goto L41c298;} +//nop; +L41c268: +t8 = MEM_U8(s1 + 1); +s1 = s1 + 0x1; +if (t8 == 0) {//nop; +goto L41c298;} +//nop; +t1 = MEM_U8(s1 + 0); +at = 0x20; +if (t1 == at) {//nop; +goto L41c298;} +//nop; +t2 = MEM_U8(s1 + 0); +at = 0x9; +if (t2 != at) {//nop; +goto L41c268;} +//nop; +L41c298: +t3 = MEM_U8(s1 + 0); +//nop; +if (t3 == 0) {//nop; +goto L41c2b0;} +//nop; +MEM_U8(s1 + 0) = (uint8_t)zero; +s1 = s1 + 0x1; +L41c2b0: +t4 = MEM_U8(s1 + 0); +//nop; +if (t4 != 0) {//nop; +goto L41c1a4;} +//nop; +L41c2c0: +//nop; +a0 = MEM_U32(sp + 312); +a1 = sp + 0x38; +f_parse_command(mem, sp, a0, a1); +goto L41c2d0; +a1 = sp + 0x38; +L41c2d0: +// bdead 1 gp = MEM_U32(sp + 40); +//nop; +L41c2d8: +// bdead 1 ra = MEM_U32(sp + 44); +// bdead 1 s0 = MEM_U32(sp + 28); +// bdead 1 s1 = MEM_U32(sp + 32); +// bdead 1 s2 = MEM_U32(sp + 36); +// bdead 1 sp = sp + 0x1150; +return; +// bdead 1 sp = sp + 0x1150; +} + +static void f_add_info(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41c2f0: +//add_info: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 32) = a0; +//nop; +// fdead 4000002b MEM_U32(sp + 28) = ra; +a1 = MEM_U32(sp + 32); +a0 = 0x1000a320; +// fdead 4000006b MEM_U32(sp + 24) = gp; +f_addstr(mem, sp, a0, a1); +goto L41c31c; +// fdead 4000006b MEM_U32(sp + 24) = gp; +L41c31c: +// bdead 40000001 gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41c334; +//nop; +L41c334: +// bdead 40000001 gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +a0 = 0x1000a428; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41c34c; +//nop; +L41c34c: +// bdead 40000001 gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +a0 = 0x1000a490; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41c364; +//nop; +L41c364: +// bdead 40000001 gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +a0 = 0x1000a4a0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41c37c; +//nop; +L41c37c: +// bdead 40000001 gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +a0 = 0x1000a4b0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41c394; +//nop; +L41c394: +// bdead 40000001 gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +a0 = 0x1000a470; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41c3ac; +//nop; +L41c3ac: +// bdead 40000001 gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +a0 = 0x1000a480; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41c3c4; +//nop; +L41c3c4: +// bdead 40000001 gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +a0 = 0x1000a4c0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41c3dc; +//nop; +L41c3dc: +// bdead 40000001 gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +a0 = 0x1000a4d0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41c3f4; +//nop; +L41c3f4: +// bdead 40000001 gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41c40c; +//nop; +L41c40c: +// bdead 1 ra = MEM_U32(sp + 28); +// bdead 1 gp = MEM_U32(sp + 24); +// bdead 1 sp = sp + 0x20; +return; +// bdead 1 sp = sp + 0x20; +} + +static void f_parse_command(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41c41c: +//parse_command: +//nop; +//nop; +//nop; +sp = sp + 0xfffffeb0; +MEM_U32(sp + 336) = a0; +a0 = 0x10002e14; +//nop; +// fdead 4000006b MEM_U32(sp + 68) = ra; +t6 = 0x1; +// fdead 4000806b MEM_U32(sp + 64) = gp; +MEM_U32(sp + 340) = a1; +// fdead 4000806b MEM_U32(sp + 60) = s5; +// fdead 4000806b MEM_U32(sp + 56) = s4; +// fdead 4000806b MEM_U32(sp + 52) = s3; +// fdead 4000806b MEM_U32(sp + 48) = s2; +// fdead 4000806b MEM_U32(sp + 44) = s1; +// fdead 4000806b MEM_U32(sp + 40) = s0; +MEM_U32(sp + 316) = zero; +MEM_U32(sp + 312) = zero; +MEM_U32(sp + 308) = zero; +MEM_U32(sp + 304) = t6; +a0 = a0; +v0 = wrapper_getenv(mem, a0); +goto L41c478; +a0 = a0; +L41c478: +MEM_U32(sp + 300) = v0; +t7 = MEM_U32(sp + 300); +// bdead 40010103 gp = MEM_U32(sp + 64); +if (t7 == 0) {at = 0x10000424; +goto L41c534;} +at = 0x10000424; +t8 = 0x1; +t9 = 0x10002e20; +MEM_U32(at + 0) = t8; +at = 0x1000a26c; +t9 = t9; +t0 = 0x10002e2c; +MEM_U32(at + 0) = t9; +at = 0x1000a27c; +t0 = t0; +MEM_U32(at + 0) = t0; +at = 0x100002d8; +t1 = 0x10002e30; +MEM_U32(at + 0) = zero; +at = 0x10000370; +t1 = t1; +MEM_U32(at + 0) = zero; +at = 0x10000348; +t2 = 0x10002e34; +MEM_U32(at + 0) = zero; +at = 0x10000324; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10000318; +a0 = 0x10002e40; +MEM_U32(at + 0) = zero; +at = 0x10000384; +t2 = t2; +MEM_U32(at + 0) = zero; +at = 0x10000400; +a1 = zero; +MEM_U32(at + 0) = t1; +at = 0x10000340; +a2 = zero; +MEM_U32(at + 0) = zero; +at = 0x100003e0; +a0 = a0; +MEM_U32(at + 0) = zero; +at = 0x10000428; +MEM_U32(at + 0) = t2; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L41c52c; +MEM_U32(at + 0) = t2; +L41c52c: +// bdead 40000103 gp = MEM_U32(sp + 64); +//nop; +L41c534: +t3 = MEM_U32(sp + 336); +s0 = zero; +at = (int)s0 < (int)t3; +if (at == 0) {//nop; +goto L42a948;} +//nop; +L41c548: +t4 = MEM_U32(sp + 340); +t5 = s0 << 2; +t6 = t4 + t5; +t7 = MEM_U32(t6 + 0); +at = 0x2d; +t8 = MEM_U8(t7 + 0); +//nop; +if (t8 != at) {//nop; +goto L42a008;} +//nop; +t9 = s0 << 2; +t0 = t4 + t9; +t1 = MEM_U32(t0 + 0); +//nop; +t2 = MEM_U8(t1 + 1); +//nop; +t3 = t2 + 0xffffffdd; +at = t3 < 0x58; +if (at == 0) {//nop; +goto L42a880;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100072ac[] = { +&&L41c5b0, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L428d3c, +&&L42a880, +&&L42a880, +&&L42a880, +&&L41c5e4, +&&L42a880, +&&L41c650, +&&L42a880, +&&L41c6c0, +&&L41c814, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L41c944, +&&L41cb38, +&&L41ccb8, +&&L41ce08, +&&L41d0ac, +&&L41d2a0, +&&L41d380, +&&L41d6b4, +&&L41d818, +&&L41da24, +&&L41da50, +&&L41e3b8, +&&L41e4cc, +&&L41e7e4, +&&L41e894, +&&L41edf0, +&&L41ee78, +&&L41eefc, +&&L41ef60, +&&L41f004, +&&L41f190, +&&L41f268, +&&L41f390, +&&L4200bc, +&&L42a880, +&&L428788, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42050c, +&&L420efc, +&&L42104c, +&&L421d84, +&&L42228c, +&&L422c78, +&&L423300, +&&L42341c, +&&L4237c0, +&&L423e54, +&&L423f4c, +&&L424190, +&&L424310, +&&L425040, +&&L425c48, +&&L4260fc, +&&L426af4, +&&L426b8c, +&&L426f60, +&&L428504, +&&L428e60, +&&L4292c8, +&&L4295c8, +&&L429e7c, +&&L429e30, +&&L429fbc, +}; +dest = Lswitch100072ac[t3]; +//nop; +goto *dest; +//nop; +L41c5b0: +t5 = 0x10002e54; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41c5d8; +MEM_U32(sp + 16) = zero; +L41c5d8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41c5e4: +t6 = 0x1000a36c; +at = 0x3; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L42a880;} +//nop; +t7 = MEM_U32(sp + 340); +t8 = s0 << 2; +t4 = t7 + t8; +t9 = MEM_U32(t4 + 0); +//nop; +t0 = MEM_U8(t9 + 2); +//nop; +if (t0 != 0) {at = 0x1000a154; +goto L42a880;} +at = 0x1000a154; +t1 = 0x1; +t2 = s0 << 2; +//nop; +t3 = t7 + t2; +MEM_U32(at + 0) = t1; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41c644; +//nop; +L41c644: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41c650: +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10002e88; +//nop; +t8 = t5 + t6; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41c670; +a1 = a1; +L41c670: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41c6a4;} +//nop; +t4 = MEM_U32(sp + 340); +t9 = s0 << 2; +t0 = t4 + t9; +//nop; +a1 = 0x10002e90; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41c69c; +a1 = a1; +L41c69c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000310; +goto L42a934;} +L41c6a4: +at = 0x10000310; +t1 = 0x1; +MEM_U32(at + 0) = t1; +at = 0x100003e0; +t7 = 0x1; +MEM_U32(at + 0) = t7; +goto L42a934; +MEM_U32(at + 0) = t7; +L41c6c0: +t2 = 0x10002e94; +//nop; +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41c6e8; +MEM_U32(sp + 16) = zero; +L41c6e8: +t3 = MEM_U32(sp + 340); +t5 = s0 << 2; +t6 = t3 + t5; +t8 = MEM_U32(t6 + 0); +// bdead 42020103 gp = MEM_U32(sp + 64); +t4 = MEM_U8(t8 + 2); +//nop; +if (t4 != 0) {//nop; +goto L42a880;} +//nop; +t9 = 0x1000027c; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L41c788;} +//nop; +t0 = 0x10000280; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L42a934;} +//nop; +t1 = 0x10002ea8; +//nop; +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41c764; +MEM_U32(sp + 16) = zero; +L41c764: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41c77c; +//nop; +L41c77c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41c788: +t7 = 0x10000280; +a0 = 0x1000a25c; +t7 = MEM_U32(t7 + 0); +at = 0x10000280; +a1 = 0x10002ec8; +//nop; +a0 = MEM_U32(a0 + 0); +t2 = t7 + 0x1; +a2 = zero; +MEM_U32(at + 0) = t2; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41c7b8; +a1 = a1; +L41c7b8: +// bdead 4002000b gp = MEM_U32(sp + 64); +//nop; +t3 = 0x1000a1b4; +at = 0x10000084; +t3 = MEM_U32(t3 + 0); +MEM_U32(at + 0) = v0; +if (t3 == 0) {//nop; +goto L41c7f8;} +//nop; +a0 = 0x10002ed8; +//nop; +a1 = zero; +a2 = t3; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L41c7f0; +a0 = a0; +L41c7f0: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L41c7f8: +//nop; +//nop; +//nop; +f_newrunlib(mem, sp); +goto L41c808; +//nop; +L41c808: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41c814: +t5 = 0x1000a36c; +at = 0x3; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L41c884;} +//nop; +t6 = MEM_U32(sp + 340); +t8 = s0 << 2; +a1 = 0x10002edc; +//nop; +t4 = t6 + t8; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41c84c; +a1 = a1; +L41c84c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41c884;} +//nop; +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t1 = t9 + t0; +//nop; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41c878; +//nop; +L41c878: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41c884: +t7 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x10002ee0; +//nop; +t3 = t7 + t2; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41c8a4; +a1 = a1; +L41c8a4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t5 = 0x10002ee8; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41c8d8; +MEM_U32(sp + 16) = zero; +L41c8d8: +// bdead 40020103 gp = MEM_U32(sp + 64); +t6 = 0x1; +t8 = 0x10000300; +at = 0x10000308; +t8 = MEM_U32(t8 + 0); +MEM_U32(at + 0) = t6; +if (t8 == 0) {//nop; +goto L42a934;} +//nop; +t4 = 0x10002f18; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41c920; +MEM_U32(sp + 16) = zero; +L41c920: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41c938; +//nop; +L41c938: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41c944: +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t1 = t9 + t0; +t7 = MEM_U32(t1 + 0); +//nop; +t2 = MEM_U8(t7 + 2); +//nop; +if (t2 != 0) {//nop; +goto L41ca08;} +//nop; +t3 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t3; +if (at == 0) {//nop; +goto L41c9c0;} +//nop; +a1 = 0x10002f40; +//nop; +a0 = 0x1000a540; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41c990; +a1 = a1; +L41c990: +// bdead 40020003 gp = MEM_U32(sp + 64); +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t8 = t5 + t6; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41c9b4; +//nop; +L41c9b4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41c9c0: +t4 = 0x10002f44; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41c9e8; +MEM_U32(sp + 16) = zero; +L41c9e8: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41ca00; +//nop; +L41ca00: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L41ca08: +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t1 = t9 + t0; +//nop; +a1 = 0x10002f68; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41ca28; +a1 = a1; +L41ca28: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41ca94;} +//nop; +t7 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t3 = t7 + t2; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a448; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ca54; +//nop; +L41ca54: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x10000400; +a1 = 0x10002f74; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41ca74; +a1 = a1; +L41ca74: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +t5 = 0x10002f78; +at = 0x10000400; +t5 = t5; +MEM_U32(at + 0) = t5; +goto L42a934; +MEM_U32(at + 0) = t5; +L41ca94: +t6 = MEM_U32(sp + 340); +t8 = s0 << 2; +t4 = t6 + t8; +t9 = MEM_U32(t4 + 0); +at = 0x41; +t0 = MEM_U8(t9 + 1); +//nop; +if (t0 != at) {//nop; +goto L41cae0;} +//nop; +t1 = s0 << 2; +//nop; +t7 = t6 + t1; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a270; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41cad4; +//nop; +L41cad4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41cae0: +t2 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10002f7c; +//nop; +t5 = t2 + t3; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41cb00; +a1 = a1; +L41cb00: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t8 = MEM_U32(sp + 340); +t4 = s0 << 2; +t9 = t8 + t4; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a270; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41cb2c; +//nop; +L41cb2c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41cb38: +t0 = MEM_U32(sp + 340); +t6 = s0 << 2; +t1 = t0 + t6; +t7 = MEM_U32(t1 + 0); +//nop; +t2 = MEM_U8(t7 + 2); +//nop; +if (t2 != 0) {//nop; +goto L41cc48;} +//nop; +t3 = MEM_U32(sp + 336); +//nop; +t5 = t3 + 0xffffffff; +at = (int)s0 < (int)t5; +if (at == 0) {//nop; +goto L41cc48;} +//nop; +t8 = s0 << 2; +a1 = 0x10002f80; +//nop; +t4 = t0 + t8; +a0 = MEM_U32(t4 + 4); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41cb90; +a1 = a1; +L41cb90: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41cbf4;} +//nop; +t9 = MEM_U32(sp + 340); +t6 = s0 << 2; +t1 = t9 + t6; +//nop; +a1 = 0x10002f88; +a0 = MEM_U32(t1 + 4); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41cbbc; +a1 = a1; +L41cbbc: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41cbf4;} +//nop; +t7 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x10002f90; +//nop; +t3 = t7 + t2; +a0 = MEM_U32(t3 + 4); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41cbe8; +a1 = a1; +L41cbe8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41cc48;} +//nop; +L41cbf4: +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t8 = t5 + t0; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41cc14; +//nop; +L41cc14: +t4 = MEM_U32(sp + 340); +s0 = s0 + 0x1; +// bdead 40022003 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t6 = t4 + t9; +//nop; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41cc3c; +//nop; +L41cc3c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41cc48: +at = 0x1000027c; +t7 = MEM_U32(sp + 340); +t1 = 0x1; +t2 = s0 << 2; +MEM_U32(at + 0) = t1; +t3 = t7 + t2; +t5 = MEM_U32(t3 + 0); +a0 = 0x1000a1ac; +a1 = 0x1000a1b0; +//nop; +t0 = t5 + 0x2; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 0); +MEM_U32(sp + 296) = t0; +a2 = t0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L41cc88; +a2 = t0; +L41cc88: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +t8 = 0x1000a1ac; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L42a934;} +//nop; +t4 = MEM_U32(sp + 296); +at = 0x1000a1b4; +MEM_U32(at + 0) = t4; +goto L42a934; +MEM_U32(at + 0) = t4; +L41ccb8: +t9 = MEM_U32(sp + 340); +t6 = s0 << 2; +t1 = t9 + t6; +t7 = MEM_U32(t1 + 0); +//nop; +t2 = MEM_U8(t7 + 2); +//nop; +if (t2 != 0) {//nop; +goto L41cda4;} +//nop; +t3 = 0x1000a36c; +at = 0x3; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L41cd1c;} +//nop; +t5 = s0 << 2; +t0 = t9 + t5; +//nop; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41cd10; +//nop; +L41cd10: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41cd1c: +t8 = 0x1000a36c; +at = 0x2; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L41cd60;} +//nop; +t4 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t1 = t4 + t6; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a320; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41cd54; +//nop; +L41cd54: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41cd60: +t7 = 0x1000a36c; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L41cda4;} +//nop; +t2 = MEM_U32(sp + 340); +t3 = s0 << 2; +t9 = t2 + t3; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a270; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41cd98; +//nop; +L41cd98: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41cda4: +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x10002f9c; +//nop; +t8 = t5 + t0; +a0 = MEM_U32(t8 + 0); +a2 = 0x5; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41cdc8; +a1 = a1; +L41cdc8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t4 = 0x10002fa8; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41cdfc; +MEM_U32(sp + 16) = zero; +L41cdfc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41ce08: +t6 = MEM_U32(sp + 340); +t1 = s0 << 2; +t7 = t6 + t1; +t2 = MEM_U32(t7 + 0); +//nop; +t3 = MEM_U8(t2 + 2); +//nop; +if (t3 != 0) {//nop; +goto L41d060;} +//nop; +t9 = 0x10000420; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L41cea4;} +//nop; +t5 = s0 << 2; +a0 = 0x10002fc8; +//nop; +t0 = t6 + t5; +a1 = MEM_U32(t0 + 4); +a0 = a0; +v0 = wrapper_strcat(mem, a0, a1); +goto L41ce60; +a0 = a0; +L41ce60: +// bdead 4002000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a260; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41ce78; +a1 = s4; +L41ce78: +// bdead 40020003 gp = MEM_U32(sp + 64); +t8 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t1 = t8 + t4; +a0 = MEM_U32(t1 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L41ce98; +//nop; +L41ce98: +// bdead 40020103 gp = MEM_U32(sp + 64); +s0 = s0 + 0x1; +goto L42a934; +s0 = s0 + 0x1; +L41cea4: +t7 = MEM_U32(sp + 336); +t2 = s0 + 0x1; +at = (int)t2 < (int)t7; +if (at == 0) {//nop; +goto L41cfc0;} +//nop; +t3 = MEM_U32(sp + 340); +t9 = s0 << 2; +t6 = t3 + t9; +//nop; +a0 = MEM_U32(t6 + 4); +a1 = sp + 0x120; +a2 = 0x10; +v0 = wrapper_strtoul(mem, a0, a1, a2); +goto L41ced8; +a2 = 0x10; +L41ced8: +// bdead 4002000b gp = MEM_U32(sp + 64); +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +MEM_U32(sp + 292) = v0; +t8 = t5 + t0; +a0 = MEM_U32(t8 + 4); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L41cefc; +//nop; +L41cefc: +t4 = MEM_U32(sp + 340); +t1 = s0 << 2; +t7 = t4 + t1; +t2 = MEM_U32(t7 + 4); +t3 = MEM_U32(sp + 288); +// bdead 4002380b gp = MEM_U32(sp + 64); +t9 = t3 - t2; +if (v0 != t9) {//nop; +goto L41cf8c;} +//nop; +t6 = MEM_U32(sp + 292); +//nop; +if (t6 != 0) {//nop; +goto L41cf48;} +//nop; +t5 = s0 << 2; +t0 = t4 + t5; +t8 = MEM_U32(t0 + 4); +//nop; +if (t8 == t3) {//nop; +goto L41cf8c;} +//nop; +L41cf48: +t1 = MEM_U32(sp + 340); +t7 = s0 << 2; +t2 = t1 + t7; +t9 = MEM_U32(t2 + 4); +at = 0x2d; +t6 = MEM_U8(t9 + 0); +//nop; +if (t6 == at) {//nop; +goto L41cf8c;} +//nop; +t4 = s0 << 2; +t5 = t1 + t4; +t0 = MEM_U32(t5 + 4); +at = 0x2b; +t8 = MEM_U8(t0 + 0); +//nop; +if (t8 != at) {//nop; +goto L41cfc0;} +//nop; +L41cf8c: +t3 = 0x10002fcc; +//nop; +t3 = t3; +MEM_U32(sp + 20) = t3; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41cfb4; +MEM_U32(sp + 16) = zero; +L41cfb4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41cfc0: +t7 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t7; +if (at == 0) {//nop; +goto L41d018;} +//nop; +a1 = 0x10002ffc; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41cfe8; +a1 = a1; +L41cfe8: +t2 = MEM_U32(sp + 340); +// bdead 40020803 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t6 = t2 + t9; +//nop; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41d00c; +//nop; +L41d00c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41d018: +t1 = 0x10003000; +//nop; +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41d040; +MEM_U32(sp + 16) = zero; +L41d040: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41d058; +//nop; +L41d058: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L41d060: +t4 = MEM_U32(sp + 340); +t5 = s0 << 2; +//nop; +t0 = t4 + t5; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a260; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41d080; +//nop; +L41d080: +// bdead 40020003 gp = MEM_U32(sp + 64); +t8 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t7 = t8 + t3; +a0 = MEM_U32(t7 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L41d0a0; +//nop; +L41d0a0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41d0ac: +t2 = MEM_U32(sp + 340); +t9 = s0 << 2; +t6 = t2 + t9; +t1 = MEM_U32(t6 + 0); +//nop; +t4 = MEM_U8(t1 + 2); +//nop; +if (t4 != 0) {//nop; +goto L41d0f4;} +//nop; +t5 = 0x10000214; +at = 0x10000214; +t5 = MEM_U32(t5 + 0); +t8 = 0x1; +t0 = t5 + 0x1; +MEM_U32(at + 0) = t0; +at = 0x1000a1a0; +MEM_U32(at + 0) = t8; +goto L42a934; +MEM_U32(at + 0) = t8; +L41d0f4: +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +t2 = t3 + t7; +t9 = MEM_U32(t2 + 0); +//nop; +t6 = MEM_U8(t9 + 3); +//nop; +if (t6 != 0) {//nop; +goto L42a880;} +//nop; +t1 = s0 << 2; +t4 = t3 + t1; +t5 = MEM_U32(t4 + 0); +at = 0x42; +t0 = MEM_U8(t5 + 2); +//nop; +if (t0 == at) {//nop; +goto L41d158;} +//nop; +t8 = s0 << 2; +t7 = t3 + t8; +t2 = MEM_U32(t7 + 0); +at = 0x4c; +t9 = MEM_U8(t2 + 2); +//nop; +if (t9 != at) {//nop; +goto L42a880;} +//nop; +L41d158: +t6 = MEM_U32(sp + 340); +t1 = s0 << 2; +t4 = t6 + t1; +t5 = MEM_U32(t4 + 0); +at = 0x42; +t0 = MEM_U8(t5 + 2); +//nop; +if (t0 != at) {//nop; +goto L41d200;} +//nop; +t3 = 0x1000027c; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L41d1f4;} +//nop; +t8 = 0x1000041c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L41d1f4;} +//nop; +t7 = 0x10003024; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41d1d4; +MEM_U32(sp + 16) = zero; +L41d1d4: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41d1ec; +//nop; +L41d1ec: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L41d1f4: +at = 0x1000041c; +MEM_U32(at + 0) = zero; +goto L41d284; +MEM_U32(at + 0) = zero; +L41d200: +t2 = 0x1000027c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L41d278;} +//nop; +t9 = 0x1000041c; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == at) {//nop; +goto L41d278;} +//nop; +t6 = 0x1000304c; +//nop; +t6 = t6; +MEM_U32(sp + 20) = t6; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41d258; +MEM_U32(sp + 16) = zero; +L41d258: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41d270; +//nop; +L41d270: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L41d278: +at = 0x1000041c; +t1 = 0x1; +MEM_U32(at + 0) = t1; +L41d284: +//nop; +//nop; +//nop; +f_newrunlib(mem, sp); +goto L41d294; +//nop; +L41d294: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41d2a0: +t4 = MEM_U32(sp + 340); +t5 = s0 << 2; +t0 = t4 + t5; +t3 = MEM_U32(t0 + 0); +//nop; +t8 = MEM_U8(t3 + 2); +//nop; +if (t8 != 0) {//nop; +goto L42a880;} +//nop; +t7 = 0x1000a36c; +at = 0x3; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L41d2f8;} +//nop; +t2 = 0x1000026c; +at = 0x1000026c; +t2 = MEM_U32(t2 + 0); +//nop; +t9 = t2 + 0x1; +MEM_U32(at + 0) = t9; +goto L42a934; +MEM_U32(at + 0) = t9; +L41d2f8: +t6 = 0x1000a36c; +at = 0x1; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L41d354;} +//nop; +t1 = 0x10000008; +at = 0x2; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == at) {at = 0x3; +goto L41d32c;} +at = 0x3; +if (t1 != at) {at = 0x10000228; +goto L41d354;} +L41d32c: +at = 0x10000228; +t4 = 0x1; +MEM_U32(at + 0) = t4; +at = 0x1000026c; +t5 = 0x1; +MEM_U32(at + 0) = t5; +at = 0x1000a184; +t0 = 0x1; +MEM_U32(at + 0) = t0; +goto L42a934; +MEM_U32(at + 0) = t0; +L41d354: +t3 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t7 = t3 + t8; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41d374; +//nop; +L41d374: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41d380: +t2 = MEM_U32(sp + 340); +t9 = s0 << 2; +t6 = t2 + t9; +//nop; +a1 = 0x10003074; +a0 = MEM_U32(t6 + 0); +a2 = 0x5; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41d3a4; +a1 = a1; +L41d3a4: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41d3e4;} +//nop; +t1 = 0x1000307c; +//nop; +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41d3d8; +MEM_U32(sp + 16) = zero; +L41d3d8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41d3e4: +t4 = MEM_U32(sp + 340); +t5 = s0 << 2; +t0 = t4 + t5; +t3 = MEM_U32(t0 + 0); +//nop; +t8 = MEM_U8(t3 + 2); +//nop; +if (t8 != 0) {//nop; +goto L41d560;} +//nop; +t7 = 0x10000420; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41d4b8;} +//nop; +t2 = 0x100003f4; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L41d480;} +//nop; +t9 = 0x10003098; +a0 = 0x1; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41d460; +MEM_U32(sp + 16) = zero; +L41d460: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41d478; +//nop; +L41d478: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L41d480: +at = 0x100003f0; +t1 = MEM_U32(sp + 340); +t6 = 0x1; +t4 = s0 << 2; +//nop; +MEM_U32(at + 0) = t6; +t5 = t1 + t4; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41d4ac; +//nop; +L41d4ac: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41d4b8: +t0 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t0; +if (at != 0) {//nop; +goto L41d514;} +//nop; +t3 = 0x100030b8; +//nop; +t3 = t3; +MEM_U32(sp + 20) = t3; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41d4f4; +MEM_U32(sp + 16) = zero; +L41d4f4: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41d50c; +//nop; +L41d50c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L41d514: +t8 = 0x10000230; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +at = (int)t8 < (int)0x3; +if (at == 0) {//nop; +goto L41d54c;} +//nop; +t7 = MEM_U32(sp + 340); +t2 = s0 << 2; +t9 = t7 + t2; +t6 = MEM_U32(t9 + 0); +at = 0x10000400; +MEM_U32(at + 0) = t6; +goto L41d5c4; +MEM_U32(at + 0) = t6; +L41d54c: +t1 = 0x100030e0; +at = 0x10000400; +t1 = t1; +MEM_U32(at + 0) = t1; +goto L41d5c4; +MEM_U32(at + 0) = t1; +L41d560: +t4 = 0x10000420; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L42a934;} +//nop; +t5 = 0x10000230; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +at = (int)t5 < (int)0x3; +if (at == 0) {//nop; +goto L41d5b4;} +//nop; +t0 = MEM_U32(sp + 340); +t3 = s0 << 2; +t8 = t0 + t3; +t7 = MEM_U32(t8 + 0); +at = 0x10000400; +t2 = t7 + 0x2; +MEM_U32(at + 0) = t2; +goto L41d5c4; +MEM_U32(at + 0) = t2; +L41d5b4: +t9 = 0x100030e4; +at = 0x10000400; +t9 = t9; +MEM_U32(at + 0) = t9; +L41d5c4: +s2 = 0x10000400; +//nop; +s2 = MEM_U32(s2 + 0); +//nop; +t6 = MEM_U8(s2 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41d66c;} +//nop; +L41d5e4: +t1 = MEM_U8(s2 + 0); +t4 = 0xfb504f0; +//nop; +t5 = t1 + t4; +t0 = MEM_U8(t5 + 1); +//nop; +t3 = t0 & 0x4; +if (t3 != 0) {//nop; +goto L41d65c;} +//nop; +t7 = 0x10000400; +t8 = 0x100030e8; +//nop; +t7 = MEM_U32(t7 + 0); +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t7; +f_error(mem, sp, a0, a1, a2, a3); +goto L41d63c; +MEM_U32(sp + 24) = t7; +L41d63c: +// bdead 400a0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41d654; +//nop; +L41d654: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +L41d65c: +t2 = MEM_U8(s2 + 1); +s2 = s2 + 0x1; +if (t2 != 0) {//nop; +goto L41d5e4;} +//nop; +L41d66c: +t9 = 0x10000328; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L42a934;} +//nop; +a0 = 0x1000a1ac; +a1 = 0x1000a1b0; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 0); +a2 = zero; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L41d6a0; +a2 = zero; +L41d6a0: +// bdead 40020103 gp = MEM_U32(sp + 64); +t6 = 0x1; +at = 0x10000328; +MEM_U32(at + 0) = t6; +goto L42a934; +MEM_U32(at + 0) = t6; +L41d6b4: +t1 = MEM_U32(sp + 340); +t4 = s0 << 2; +t5 = t1 + t4; +t0 = MEM_U32(t5 + 0); +//nop; +t3 = MEM_U8(t0 + 2); +//nop; +if (t3 != 0) {//nop; +goto L41d718;} +//nop; +t8 = s0 << 2; +//nop; +t7 = t1 + t8; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a270; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41d6f4; +//nop; +L41d6f4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +t2 = 0x10000214; +at = 0x10000214; +t2 = MEM_U32(t2 + 0); +//nop; +t9 = t2 + 0x1; +MEM_U32(at + 0) = t9; +goto L42a934; +MEM_U32(at + 0) = t9; +L41d718: +t6 = MEM_U32(sp + 340); +t4 = s0 << 2; +t5 = t6 + t4; +t0 = MEM_U32(t5 + 0); +//nop; +t3 = MEM_U8(t0 + 3); +//nop; +if (t3 != 0) {//nop; +goto L42a880;} +//nop; +t1 = MEM_U32(sp + 340); +t8 = s0 << 2; +t7 = t1 + t8; +t2 = MEM_U32(t7 + 0); +at = 0x1000a1e6; +s2 = 0x10003108; +t9 = MEM_U8(t2 + 2); +s2 = s2; +MEM_U8(at + 0) = (uint8_t)t9; +t6 = MEM_U8(s2 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41d7a8;} +//nop; +t4 = MEM_U8(s2 + 0); +//nop; +if (t4 == t9) {//nop; +goto L41d7a8;} +//nop; +L41d780: +t5 = MEM_U8(s2 + 1); +s2 = s2 + 0x1; +if (t5 == 0) {//nop; +goto L41d7a8;} +//nop; +t3 = 0x1000a1e6; +t0 = MEM_U8(s2 + 0); +t3 = MEM_U8(t3 + 0); +//nop; +if (t0 != t3) {//nop; +goto L41d780;} +//nop; +L41d7a8: +t1 = MEM_U8(s2 + 0); +//nop; +if (t1 != 0) {//nop; +goto L42a934;} +//nop; +t8 = 0x10003118; +t7 = MEM_U32(sp + 340); +t2 = s0 << 2; +t8 = t8; +MEM_U32(sp + 20) = t8; +MEM_U32(sp + 16) = zero; +t6 = t7 + t2; +t4 = MEM_U32(t6 + 0); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t4; +f_error(mem, sp, a0, a1, a2, a3); +goto L41d7f4; +MEM_U32(sp + 24) = t4; +L41d7f4: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41d80c; +//nop; +L41d80c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41d818: +t9 = MEM_U32(sp + 340); +t5 = s0 << 2; +t0 = t9 + t5; +t3 = MEM_U32(t0 + 0); +//nop; +t1 = MEM_U8(t3 + 2); +//nop; +if (t1 != 0) {//nop; +goto L41d978;} +//nop; +t8 = s0 << 2; +t7 = t9 + t8; +t2 = MEM_U32(t7 + 4); +//nop; +if (t2 == 0) {//nop; +goto L41d874;} +//nop; +t6 = s0 << 2; +t4 = t9 + t6; +t5 = MEM_U32(t4 + 4); +at = 0x2d; +t0 = MEM_U8(t5 + 0); +//nop; +if (t0 == at) {//nop; +goto L41d89c;} +//nop; +L41d874: +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +//nop; +t8 = t3 + t1; +a0 = MEM_U32(t8 + 4); +//nop; +v0 = f_isdir(mem, sp, a0); +goto L41d890; +//nop; +L41d890: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41d8b8;} +//nop; +L41d89c: +t7 = 0x10000288; +at = 0x10000288; +t7 = MEM_U32(t7 + 0); +//nop; +t2 = t7 + 0x1; +MEM_U32(at + 0) = t2; +goto L42a934; +MEM_U32(at + 0) = t2; +L41d8b8: +t9 = MEM_U32(sp + 340); +s0 = s0 + 0x1; +t6 = s0 << 2; +t4 = t9 + t6; +//nop; +a0 = 0x10003134; +a1 = MEM_U32(t4 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41d8e0; +a0 = a0; +L41d8e0: +// bdead 4002000b gp = MEM_U32(sp + 64); +MEM_U32(sp + 284) = v0; +//nop; +a1 = MEM_U32(sp + 284); +a0 = 0x1000a270; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41d8fc; +//nop; +L41d8fc: +// bdead 40020003 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 284); +//nop; +a0 = 0x1000a2d0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41d914; +//nop; +L41d914: +// bdead 40020003 gp = MEM_U32(sp + 64); +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t3 = t5 + t0; +a0 = MEM_U32(t3 + 0); +//nop; +v0 = f_full_path(mem, sp, a0); +goto L41d934; +//nop; +L41d934: +// bdead 4002010b gp = MEM_U32(sp + 64); +s5 = v0; +a0 = 0x10003138; +//nop; +a1 = s5; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41d954; +a0 = a0; +L41d954: +// bdead 4002000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = s4; +//nop; +f_add_static_opt(mem, sp, a0); +goto L41d96c; +//nop; +L41d96c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41d978: +t1 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t7 = t1 + t8; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a270; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41d998; +//nop; +L41d998: +t2 = MEM_U32(sp + 340); +// bdead 40020803 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t6 = t2 + t9; +//nop; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a2d0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41d9bc; +//nop; +L41d9bc: +t4 = MEM_U32(sp + 340); +// bdead 40022003 gp = MEM_U32(sp + 64); +t5 = s0 << 2; +t0 = t4 + t5; +a0 = MEM_U32(t0 + 0); +//nop; +a0 = a0 + 0x2; +//nop; +v0 = f_full_path(mem, sp, a0); +goto L41d9e0; +//nop; +L41d9e0: +// bdead 4002010b gp = MEM_U32(sp + 64); +s5 = v0; +a0 = 0x1000313c; +//nop; +a1 = s5; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41da00; +a0 = a0; +L41da00: +// bdead 4002000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = s4; +//nop; +f_add_static_opt(mem, sp, a0); +goto L41da18; +//nop; +L41da18: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41da24: +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x10003140; +//nop; +t8 = t3 + t1; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41da44; +a1 = a1; +L41da44: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +L41da50: +t7 = 0x10000420; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41de60;} +//nop; +t2 = MEM_U32(sp + 340); +t9 = s0 << 2; +t6 = t2 + t9; +t4 = MEM_U32(t6 + 0); +at = 0x1000a1dc; +t5 = t4 + 0x2; +MEM_U32(at + 0) = t5; +t0 = MEM_U8(t5 + 0); +//nop; +if (t0 != 0) {//nop; +goto L41daac;} +//nop; +t3 = s0 << 2; +t1 = t2 + t3; +t8 = MEM_U32(t1 + 0); +at = 0x1000a1dc; +t7 = t8 + 0x3; +MEM_U32(at + 0) = t7; +L41daac: +t9 = 0x1000a1dc; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +t6 = MEM_U8(t9 + 0); +//nop; +if (t6 != 0) {at = 0x2c; +goto L41dad4;} +at = 0x2c; +if (t6 != at) {//nop; +goto L42a934;} +//nop; +L41dad4: +s2 = 0x1000a1dc; +at = 0x1000a1a8; +s2 = MEM_U32(s2 + 0); +MEM_U32(at + 0) = zero; +t4 = MEM_U8(s2 + 0); +at = 0x2c; +if (t4 == at) {//nop; +goto L41db50;} +//nop; +t5 = MEM_U8(s2 + 0); +//nop; +if (t5 == 0) {//nop; +goto L41db50;} +//nop; +L41db04: +t2 = 0x1000a1a8; +t3 = 0x1000a1e0; +t2 = MEM_U32(t2 + 0); +t0 = MEM_U8(s2 + 0); +t8 = 0x1000a1a8; +t1 = t2 + t3; +MEM_U8(t1 + 0) = (uint8_t)t0; +t8 = MEM_U32(t8 + 0); +at = 0x1000a1a8; +t7 = t8 + 0x1; +MEM_U32(at + 0) = t7; +t9 = MEM_U8(s2 + 1); +at = 0x2c; +if (t9 == at) {s2 = s2 + 0x1; +goto L41db50;} +s2 = s2 + 0x1; +t6 = MEM_U8(s2 + 0); +//nop; +if (t6 != 0) {//nop; +goto L41db04;} +//nop; +L41db50: +at = 0x1000a1dc; +a1 = 0x10003148; +//nop; +a0 = 0x1000a1e0; +a2 = 0x6; +MEM_U32(at + 0) = s2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41db70; +a1 = a1; +L41db70: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x100002cc; +goto L41db88;} +at = 0x100002cc; +t4 = 0x1; +MEM_U32(at + 0) = t4; +goto L41dd28; +MEM_U32(at + 0) = t4; +L41db88: +a1 = 0x10003150; +//nop; +a0 = 0x1000a1e0; +a2 = 0x3; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41dba0; +a1 = a1; +L41dba0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41dbcc;} +//nop; +a1 = 0x10003154; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41dbc0; +a1 = a1; +L41dbc0: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L41dd28; +//nop; +L41dbcc: +a1 = 0x1000315c; +//nop; +a0 = 0x1000a1e0; +a2 = 0x2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41dbe4; +a1 = a1; +L41dbe4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41dc10;} +//nop; +a1 = 0x10003160; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41dc04; +a1 = a1; +L41dc04: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L41dd28; +//nop; +L41dc10: +a1 = 0x10003168; +//nop; +a0 = 0x1000a1e0; +a2 = 0x2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41dc28; +a1 = a1; +L41dc28: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41dc54;} +//nop; +a1 = 0x1000316c; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41dc48; +a1 = a1; +L41dc48: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L41dd28; +//nop; +L41dc54: +a1 = 0x10003174; +//nop; +a0 = 0x1000a1e0; +a2 = 0x3; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41dc6c; +a1 = a1; +L41dc6c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41dc98;} +//nop; +a1 = 0x10003178; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41dc8c; +a1 = a1; +L41dc8c: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L41dd28; +//nop; +L41dc98: +a1 = 0x10003180; +//nop; +a0 = 0x1000a1e0; +a2 = 0x3; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41dcb0; +a1 = a1; +L41dcb0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t5 = 0x10000324; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L41dd10;} +//nop; +t2 = 0x10003184; +//nop; +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41dcfc; +MEM_U32(sp + 16) = zero; +L41dcfc: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +at = 0x10000340; +MEM_U32(at + 0) = zero; +goto L41dd28; +MEM_U32(at + 0) = zero; +L41dd10: +at = 0x10000340; +t3 = 0x1; +MEM_U32(at + 0) = t3; +at = 0x10000344; +t0 = 0x1; +MEM_U32(at + 0) = t0; +L41dd28: +at = 0x1000a1a8; +//nop; +a0 = 0x1000a1e0; +MEM_U32(at + 0) = zero; +v0 = wrapper_strlen(mem, a0); +goto L41dd3c; +MEM_U32(at + 0) = zero; +L41dd3c: +// bdead 4002010b gp = MEM_U32(sp + 64); +//nop; +t1 = 0x1000a1a8; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +at = t1 < v0; +if (at == 0) {//nop; +goto L41ddbc;} +//nop; +L41dd60: +t7 = 0x1000a1a8; +t9 = 0x1000a1e0; +t7 = MEM_U32(t7 + 0); +t4 = 0x1000a1a8; +t8 = 0x20; +t6 = t7 + t9; +MEM_U8(t6 + 0) = (uint8_t)t8; +t4 = MEM_U32(t4 + 0); +//nop; +at = 0x1000a1a8; +a0 = 0x1000a1e0; +t5 = t4 + 0x1; +MEM_U32(at + 0) = t5; +v0 = wrapper_strlen(mem, a0); +goto L41dd98; +MEM_U32(at + 0) = t5; +L41dd98: +// bdead 4002010b gp = MEM_U32(sp + 64); +//nop; +t2 = 0x1000a1a8; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +at = t2 < v0; +if (at != 0) {//nop; +goto L41dd60;} +//nop; +L41ddbc: +t3 = 0x1000a1dc; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L41de2c;} +//nop; +t0 = MEM_U8(t3 + 0); +at = 0x2c; +if (t0 != at) {//nop; +goto L41de2c;} +//nop; +if (t0 == 0) {//nop; +goto L41de2c;} +//nop; +L41ddec: +t1 = 0x1000a1dc; +at = 0x1000a1dc; +t1 = MEM_U32(t1 + 0); +t9 = 0x1000a1dc; +t7 = t1 + 0x1; +MEM_U32(at + 0) = t7; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L41de2c;} +//nop; +t8 = MEM_U8(t9 + 0); +at = 0x2c; +if (t8 != at) {//nop; +goto L41de2c;} +//nop; +if (t8 != 0) {//nop; +goto L41ddec;} +//nop; +L41de2c: +t6 = 0x1000a1dc; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +t4 = MEM_U8(t6 + 0); +//nop; +if (t4 != 0) {//nop; +goto L41dad4;} +//nop; +at = 0x2c; +if (t4 == at) {//nop; +goto L41dad4;} +//nop; +//nop; +goto L42a934; +//nop; +L41de60: +t5 = 0x10000370; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L41e290;} +//nop; +t2 = MEM_U32(sp + 340); +t3 = s0 << 2; +t0 = t2 + t3; +t1 = MEM_U32(t0 + 0); +at = 0x1000a1dc; +t7 = t1 + 0x2; +MEM_U32(at + 0) = t7; +t9 = MEM_U8(t7 + 0); +//nop; +if (t9 != 0) {//nop; +goto L41dedc;} +//nop; +t8 = 0x10000240; +at = 0x10000240; +t8 = MEM_U32(t8 + 0); +t4 = s0 << 2; +t6 = t8 + 0x1; +//nop; +t5 = t2 + t4; +MEM_U32(at + 0) = t6; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ded4; +//nop; +L41ded4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L41dedc: +t3 = 0x1000a1dc; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +t0 = MEM_U8(t3 + 0); +//nop; +if (t0 != 0) {at = 0x2c; +goto L41df04;} +at = 0x2c; +if (t0 != at) {//nop; +goto L42a934;} +//nop; +L41df04: +s2 = 0x1000a1dc; +at = 0x1000a1a8; +s2 = MEM_U32(s2 + 0); +MEM_U32(at + 0) = zero; +t1 = MEM_U8(s2 + 0); +at = 0x2c; +if (t1 == at) {//nop; +goto L41df80;} +//nop; +t7 = MEM_U8(s2 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41df80;} +//nop; +L41df34: +t8 = 0x1000a1a8; +t6 = 0x1000a1e0; +t8 = MEM_U32(t8 + 0); +t9 = MEM_U8(s2 + 0); +t4 = 0x1000a1a8; +t2 = t8 + t6; +MEM_U8(t2 + 0) = (uint8_t)t9; +t4 = MEM_U32(t4 + 0); +at = 0x1000a1a8; +t5 = t4 + 0x1; +MEM_U32(at + 0) = t5; +t3 = MEM_U8(s2 + 1); +at = 0x2c; +if (t3 == at) {s2 = s2 + 0x1; +goto L41df80;} +s2 = s2 + 0x1; +t0 = MEM_U8(s2 + 0); +//nop; +if (t0 != 0) {//nop; +goto L41df34;} +//nop; +L41df80: +at = 0x1000a1dc; +a1 = 0x100031bc; +//nop; +a0 = 0x1000a1e0; +a2 = 0x6; +MEM_U32(at + 0) = s2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41dfa0; +a1 = a1; +L41dfa0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x100002cc; +goto L41dfb8;} +at = 0x100002cc; +t1 = 0x1; +MEM_U32(at + 0) = t1; +goto L41e158; +MEM_U32(at + 0) = t1; +L41dfb8: +a1 = 0x100031c4; +//nop; +a0 = 0x1000a1e0; +a2 = 0x3; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41dfd0; +a1 = a1; +L41dfd0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41dffc;} +//nop; +a1 = 0x100031c8; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41dff0; +a1 = a1; +L41dff0: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L41e158; +//nop; +L41dffc: +a1 = 0x100031d0; +//nop; +a0 = 0x1000a1e0; +a2 = 0x2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41e014; +a1 = a1; +L41e014: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41e040;} +//nop; +a1 = 0x100031d4; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41e034; +a1 = a1; +L41e034: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L41e158; +//nop; +L41e040: +a1 = 0x100031dc; +//nop; +a0 = 0x1000a1e0; +a2 = 0x2; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41e058; +a1 = a1; +L41e058: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41e084;} +//nop; +a1 = 0x100031e0; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41e078; +a1 = a1; +L41e078: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L41e158; +//nop; +L41e084: +a1 = 0x100031e8; +//nop; +a0 = 0x1000a1e0; +a2 = 0x3; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41e09c; +a1 = a1; +L41e09c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41e0c8;} +//nop; +a1 = 0x100031ec; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41e0bc; +a1 = a1; +L41e0bc: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L41e158; +//nop; +L41e0c8: +a1 = 0x100031f4; +//nop; +a0 = 0x1000a1e0; +a2 = 0x3; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41e0e0; +a1 = a1; +L41e0e0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t7 = 0x10000324; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41e140;} +//nop; +t8 = 0x100031f8; +//nop; +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41e12c; +MEM_U32(sp + 16) = zero; +L41e12c: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +at = 0x10000340; +MEM_U32(at + 0) = zero; +goto L41e158; +MEM_U32(at + 0) = zero; +L41e140: +at = 0x10000340; +t6 = 0x1; +MEM_U32(at + 0) = t6; +at = 0x10000344; +t9 = 0x1; +MEM_U32(at + 0) = t9; +L41e158: +at = 0x1000a1a8; +//nop; +a0 = 0x1000a1e0; +MEM_U32(at + 0) = zero; +v0 = wrapper_strlen(mem, a0); +goto L41e16c; +MEM_U32(at + 0) = zero; +L41e16c: +// bdead 4002010b gp = MEM_U32(sp + 64); +//nop; +t2 = 0x1000a1a8; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +at = t2 < v0; +if (at == 0) {//nop; +goto L41e1ec;} +//nop; +L41e190: +t5 = 0x1000a1a8; +t3 = 0x1000a1e0; +t5 = MEM_U32(t5 + 0); +t1 = 0x1000a1a8; +t4 = 0x20; +t0 = t5 + t3; +MEM_U8(t0 + 0) = (uint8_t)t4; +t1 = MEM_U32(t1 + 0); +//nop; +at = 0x1000a1a8; +a0 = 0x1000a1e0; +t7 = t1 + 0x1; +MEM_U32(at + 0) = t7; +v0 = wrapper_strlen(mem, a0); +goto L41e1c8; +MEM_U32(at + 0) = t7; +L41e1c8: +// bdead 4002010b gp = MEM_U32(sp + 64); +//nop; +t8 = 0x1000a1a8; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +at = t8 < v0; +if (at != 0) {//nop; +goto L41e190;} +//nop; +L41e1ec: +t6 = 0x1000a1dc; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41e25c;} +//nop; +t9 = MEM_U8(t6 + 0); +at = 0x2c; +if (t9 != at) {//nop; +goto L41e25c;} +//nop; +if (t9 == 0) {//nop; +goto L41e25c;} +//nop; +L41e21c: +t2 = 0x1000a1dc; +at = 0x1000a1dc; +t2 = MEM_U32(t2 + 0); +t3 = 0x1000a1dc; +t5 = t2 + 0x1; +MEM_U32(at + 0) = t5; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L41e25c;} +//nop; +t4 = MEM_U8(t3 + 0); +at = 0x2c; +if (t4 != at) {//nop; +goto L41e25c;} +//nop; +if (t4 != 0) {//nop; +goto L41e21c;} +//nop; +L41e25c: +t0 = 0x1000a1dc; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +t1 = MEM_U8(t0 + 0); +//nop; +if (t1 != 0) {//nop; +goto L41df04;} +//nop; +at = 0x2c; +if (t1 == at) {//nop; +goto L41df04;} +//nop; +//nop; +goto L42a934; +//nop; +L41e290: +t7 = MEM_U32(sp + 340); +t8 = s0 << 2; +t6 = t7 + t8; +t9 = MEM_U32(t6 + 0); +//nop; +t2 = MEM_U8(t9 + 2); +//nop; +if (t2 == 0) {//nop; +goto L41e378;} +//nop; +t5 = s0 << 2; +a1 = 0x10003230; +//nop; +t3 = t7 + t5; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41e2d0; +a1 = a1; +L41e2d0: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41e34c;} +//nop; +t4 = 0x10000324; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L41e330;} +//nop; +t0 = 0x10003238; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41e31c; +MEM_U32(sp + 16) = zero; +L41e31c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +at = 0x10000340; +MEM_U32(at + 0) = zero; +goto L42a934; +MEM_U32(at + 0) = zero; +L41e330: +at = 0x10000340; +t1 = 0x1; +MEM_U32(at + 0) = t1; +at = 0x10000344; +t8 = 0x1; +MEM_U32(at + 0) = t8; +goto L42a934; +MEM_U32(at + 0) = t8; +L41e34c: +t6 = MEM_U32(sp + 340); +t9 = s0 << 2; +t2 = t6 + t9; +//nop; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e36c; +//nop; +L41e36c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41e378: +t7 = 0x10000240; +at = 0x10000240; +t7 = MEM_U32(t7 + 0); +t3 = MEM_U32(sp + 340); +t4 = s0 << 2; +t5 = t7 + 0x1; +//nop; +MEM_U32(at + 0) = t5; +t0 = t3 + t4; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e3ac; +//nop; +L41e3ac: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41e3b8: +t1 = MEM_U32(sp + 340); +t8 = s0 << 2; +t6 = t1 + t8; +t9 = MEM_U32(t6 + 0); +//nop; +t2 = MEM_U8(t9 + 2); +//nop; +if (t2 != 0) {//nop; +goto L41e494;} +//nop; +t7 = MEM_U32(sp + 336); +t5 = s0 + 0x1; +at = (int)t5 < (int)t7; +if (at == 0) {//nop; +goto L41e494;} +//nop; +t3 = s0 << 2; +t4 = t1 + t3; +t0 = MEM_U32(t4 + 4); +at = 0x2d; +t8 = MEM_U8(t0 + 0); +//nop; +if (t8 == at) {//nop; +goto L41e494;} +//nop; +t6 = s0 << 2; +t9 = t1 + t6; +a0 = MEM_U32(t9 + 4); +//nop; +//nop; +//nop; +v0 = f_isdir(mem, sp, a0); +goto L41e42c; +//nop; +L41e42c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41e494;} +//nop; +t2 = MEM_U32(sp + 340); +s0 = s0 + 0x1; +t7 = s0 << 2; +t3 = s0 << 2; +//nop; +t4 = t2 + t3; +t5 = t2 + t7; +a0 = MEM_U32(t5 + -4); +a1 = MEM_U32(t4 + 0); +a2 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41e464; +a2 = zero; +L41e464: +// bdead 4002000b gp = MEM_U32(sp + 64); +MEM_U32(sp + 280) = v0; +//nop; +a1 = MEM_U32(sp + 280); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e480; +//nop; +L41e480: +// bdead 40020103 gp = MEM_U32(sp + 64); +t0 = 0x1; +at = 0x10000260; +MEM_U32(at + 0) = t0; +goto L42a934; +MEM_U32(at + 0) = t0; +L41e494: +at = 0x10000260; +t1 = MEM_U32(sp + 340); +t8 = 0x1; +t6 = s0 << 2; +MEM_U32(at + 0) = t8; +t9 = t1 + t6; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e4c0; +//nop; +L41e4c0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41e4cc: +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +t2 = t7 + t5; +t3 = MEM_U32(t2 + 0); +at = 0x44; +t4 = MEM_U8(t3 + 2); +//nop; +if (t4 != at) {//nop; +goto L41e76c;} +//nop; +t0 = s0 << 2; +t8 = t7 + t0; +a0 = MEM_U32(t8 + 0); +a1 = 0x10003270; +//nop; +a0 = a0 + 0x3; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41e510; +a1 = a1; +L41e510: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41e534;} +//nop; +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +t9 = t1 + t6; +t5 = MEM_U32(t9 + 4); +MEM_U32(sp + 316) = t5; +goto L41e6f8; +MEM_U32(sp + 316) = t5; +L41e534: +t2 = MEM_U32(sp + 340); +t3 = s0 << 2; +t4 = t2 + t3; +a0 = MEM_U32(t4 + 0); +a1 = 0x10003278; +//nop; +a0 = a0 + 0x3; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41e558; +a1 = a1; +L41e558: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41e5b4;} +//nop; +t7 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t8 = t7 + t0; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e584; +//nop; +L41e584: +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +// bdead 40028403 gp = MEM_U32(sp + 64); +t9 = t1 + t6; +a1 = MEM_U32(t9 + 4); +//nop; +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e5a8; +//nop; +L41e5a8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L41e6f8; +//nop; +L41e5b4: +t5 = MEM_U32(sp + 340); +t2 = s0 << 2; +t3 = t5 + t2; +a0 = MEM_U32(t3 + 0); +a1 = 0x10003280; +//nop; +a0 = a0 + 0x3; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41e5d8; +a1 = a1; +L41e5d8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41e634;} +//nop; +t4 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t0 = t4 + t7; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e604; +//nop; +L41e604: +// bdead 40020003 gp = MEM_U32(sp + 64); +t8 = MEM_U32(sp + 340); +t1 = s0 << 2; +//nop; +t6 = t8 + t1; +a1 = MEM_U32(t6 + 4); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e628; +//nop; +L41e628: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L41e6f8; +//nop; +L41e634: +t9 = MEM_U32(sp + 340); +t5 = s0 << 2; +t2 = t9 + t5; +a0 = MEM_U32(t2 + 0); +//nop; +a1 = 0x1000328c; +a0 = a0 + 0x3; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41e658; +a1 = a1; +L41e658: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L41e6ac;} +//nop; +t4 = 0x10000008; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L41e6ac;} +//nop; +t7 = MEM_U32(sp + 340); +t0 = s0 << 2; +t8 = t7 + t0; +t1 = MEM_U32(t8 + 4); +MEM_U32(sp + 308) = t1; +goto L41e6f8; +MEM_U32(sp + 308) = t1; +L41e6ac: +t6 = MEM_U32(sp + 340); +t9 = s0 << 2; +t5 = t6 + t9; +//nop; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a270; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e6cc; +//nop; +L41e6cc: +// bdead 40020003 gp = MEM_U32(sp + 64); +t2 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t4 = t2 + t3; +a1 = MEM_U32(t4 + 4); +a0 = 0x1000a270; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e6f0; +//nop; +L41e6f0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L41e6f8: +t7 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t7; +if (at != 0) {//nop; +goto L42a934;} +//nop; +t0 = 0x10003294; +t8 = MEM_U32(sp + 340); +t1 = s0 << 2; +t0 = t0; +MEM_U32(sp + 20) = t0; +MEM_U32(sp + 16) = zero; +t6 = t8 + t1; +t9 = MEM_U32(t6 + -4); +a0 = 0x1; +MEM_U32(sp + 24) = t9; +//nop; +a1 = zero; +a2 = zero; +a3 = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41e748; +a3 = zero; +L41e748: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41e760; +//nop; +L41e760: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41e76c: +t5 = MEM_U32(sp + 340); +t2 = s0 << 2; +t3 = t5 + t2; +t4 = MEM_U32(t3 + 0); +//nop; +t7 = MEM_U8(t4 + 2); +//nop; +if (t7 != 0) {//nop; +goto L42a880;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t1 = t0 + t8; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a270; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e7b0; +//nop; +L41e7b0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +t6 = 0x10000214; +at = 0x10000214; +t6 = MEM_U32(t6 + 0); +t5 = 0x10000244; +t9 = t6 + 0x1; +t5 = MEM_U32(t5 + 0); +MEM_U32(at + 0) = t9; +at = 0x10000244; +t2 = t5 + 0x1; +MEM_U32(at + 0) = t2; +goto L42a934; +MEM_U32(at + 0) = t2; +L41e7e4: +t3 = MEM_U32(sp + 340); +t4 = s0 << 2; +t7 = t3 + t4; +t0 = MEM_U32(t7 + 0); +//nop; +t8 = MEM_U8(t0 + 2); +//nop; +if (t8 != 0) {//nop; +goto L41e830;} +//nop; +t1 = s0 << 2; +//nop; +t6 = t3 + t1; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e824; +//nop; +L41e824: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41e830: +t9 = 0x1000a36c; +at = 0x3; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L42a880;} +//nop; +t5 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t4 = t5 + t2; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e868; +//nop; +L41e868: +// bdead 40020003 gp = MEM_U32(sp + 64); +t7 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t8 = t7 + t0; +a0 = MEM_U32(t8 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L41e888; +//nop; +L41e888: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41e894: +at = 0x1000a12c; +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +MEM_U32(at + 0) = zero; +t6 = t3 + t1; +t9 = MEM_U32(t6 + 0); +//nop; +t5 = MEM_U8(t9 + 2); +//nop; +if (t5 != 0) {at = 0x10000230; +goto L41e8f0;} +at = 0x10000230; +t7 = 0x1000a128; +t2 = 0x2; +MEM_U32(at + 0) = t2; +at = 0x1000a12c; +t7 = MEM_U32(t7 + 0); +t4 = 0x1; +if (t7 == 0) {MEM_U32(at + 0) = t4; +goto L42a934;} +MEM_U32(at + 0) = t4; +at = 0x10000230; +t0 = 0x1; +MEM_U32(at + 0) = t0; +goto L42a934; +MEM_U32(at + 0) = t0; +L41e8f0: +t8 = MEM_U32(sp + 340); +t3 = s0 << 2; +t1 = t8 + t3; +t6 = MEM_U32(t1 + 0); +//nop; +t9 = MEM_U8(t6 + 3); +//nop; +if (t9 != 0) {//nop; +goto L41eae0;} +//nop; +t5 = s0 << 2; +t2 = t8 + t5; +t4 = MEM_U32(t2 + 0); +//nop; +t7 = MEM_U8(t4 + 2); +//nop; +at = (int)t7 < (int)0x30; +if (at != 0) {//nop; +goto L42a880;} +//nop; +t0 = s0 << 2; +t3 = t8 + t0; +t1 = MEM_U32(t3 + 0); +//nop; +t6 = MEM_U8(t1 + 2); +//nop; +at = (int)t6 < (int)0x35; +if (at == 0) {//nop; +goto L42a880;} +//nop; +t9 = s0 << 2; +t5 = t8 + t9; +t2 = MEM_U32(t5 + 0); +at = 0x10000230; +t4 = MEM_U8(t2 + 2); +//nop; +t7 = t4 + 0xffffffd0; +MEM_U32(at + 0) = t7; +at = 0x3; +if (t7 != at) {//nop; +goto L41eaa0;} +//nop; +t0 = 0x100032b8; +t3 = 0x100032c0; +t1 = 0x100032c8; +at = 0x10000400; +//nop; +a0 = 0x1000a470; +t0 = t0; +t3 = t3; +t1 = t1; +MEM_U32(sp + 276) = t0; +MEM_U32(sp + 272) = t3; +a1 = t0; +MEM_U32(at + 0) = t1; +f_addstr(mem, sp, a0, a1); +goto L41e9c0; +MEM_U32(at + 0) = t1; +L41e9c0: +// bdead 40020003 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 272); +//nop; +a0 = 0x1000a470; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e9d8; +//nop; +L41e9d8: +// bdead 40020003 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 276); +//nop; +a0 = 0x1000a4b0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41e9f0; +//nop; +L41e9f0: +// bdead 40020003 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 272); +//nop; +a0 = 0x1000a4b0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ea08; +//nop; +L41ea08: +// bdead 40020003 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 276); +//nop; +a0 = 0x1000a4a0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ea20; +//nop; +L41ea20: +// bdead 40020003 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 272); +//nop; +a0 = 0x1000a4a0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ea38; +//nop; +L41ea38: +// bdead 40020003 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 276); +//nop; +a0 = 0x1000a490; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ea50; +//nop; +L41ea50: +// bdead 40020003 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 272); +//nop; +a0 = 0x1000a490; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ea68; +//nop; +L41ea68: +// bdead 40020003 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 276); +//nop; +a0 = 0x1000a280; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ea80; +//nop; +L41ea80: +// bdead 40020003 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 272); +//nop; +a0 = 0x1000a280; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ea98; +//nop; +L41ea98: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L41eaa0: +t6 = 0x10000230; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +at = (int)t6 < (int)0x3; +if (at != 0) {//nop; +goto L42a934;} +//nop; +t8 = 0x10000224; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {at = 0x10000408; +goto L42a934;} +at = 0x10000408; +t9 = 0x1; +MEM_U32(at + 0) = t9; +goto L42a934; +MEM_U32(at + 0) = t9; +L41eae0: +t5 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x100032cc; +//nop; +t4 = t5 + t2; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41eb00; +a1 = a1; +L41eb00: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41ed8c;} +//nop; +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t1 = t7 + t3; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a470; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41eb2c; +//nop; +L41eb2c: +// bdead 40020003 gp = MEM_U32(sp + 64); +t0 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t8 = t0 + t6; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a4b0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41eb50; +//nop; +L41eb50: +t9 = MEM_U32(sp + 340); +// bdead 44020003 gp = MEM_U32(sp + 64); +t5 = s0 << 2; +t2 = t9 + t5; +//nop; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a4a0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41eb74; +//nop; +L41eb74: +// bdead 40020003 gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t3 = t4 + t7; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a490; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41eb98; +//nop; +L41eb98: +// bdead 40020003 gp = MEM_U32(sp + 64); +t1 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t6 = t1 + t0; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a280; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ebbc; +//nop; +L41ebbc: +t8 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +// bdead 42020003 gp = MEM_U32(sp + 64); +at = (int)s0 < (int)t8; +if (at != 0) {//nop; +goto L41ec1c;} +//nop; +t9 = 0x100032d4; +a0 = 0x1; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41ebfc; +MEM_U32(sp + 16) = zero; +L41ebfc: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41ec14; +//nop; +L41ec14: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L41ec1c: +t5 = MEM_U32(sp + 340); +t2 = s0 << 2; +t4 = t5 + t2; +s2 = MEM_U32(t4 + 0); +//nop; +t7 = MEM_U8(s2 + 0); +//nop; +if (t7 == 0) {//nop; +goto L41ecd0;} +//nop; +L41ec40: +t3 = MEM_U8(s2 + 0); +t1 = 0xfb504f0; +//nop; +t0 = t3 + t1; +t6 = MEM_U8(t0 + 1); +//nop; +t8 = t6 & 0x4; +if (t8 != 0) {//nop; +goto L41ecc0;} +//nop; +t9 = 0x100032f4; +t5 = MEM_U32(sp + 340); +t9 = t9; +MEM_U32(sp + 20) = t9; +t2 = s0 << 2; +MEM_U32(sp + 16) = zero; +t4 = t5 + t2; +t7 = MEM_U32(t4 + 0); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t7; +f_error(mem, sp, a0, a1, a2, a3); +goto L41eca0; +MEM_U32(sp + 24) = t7; +L41eca0: +// bdead 400a0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41ecb8; +//nop; +L41ecb8: +// bdead 400a0003 gp = MEM_U32(sp + 64); +//nop; +L41ecc0: +t3 = MEM_U8(s2 + 1); +s2 = s2 + 0x1; +if (t3 != 0) {//nop; +goto L41ec40;} +//nop; +L41ecd0: +t1 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t6 = t1 + t0; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a470; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ecf0; +//nop; +L41ecf0: +t8 = MEM_U32(sp + 340); +// bdead 42020003 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t5 = t8 + t9; +//nop; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a4b0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ed14; +//nop; +L41ed14: +// bdead 40020003 gp = MEM_U32(sp + 64); +t2 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t7 = t2 + t4; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a4a0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ed38; +//nop; +L41ed38: +// bdead 40020003 gp = MEM_U32(sp + 64); +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +//nop; +t0 = t3 + t1; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a490; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ed5c; +//nop; +L41ed5c: +t6 = MEM_U32(sp + 340); +t8 = s0 << 2; +// bdead 42028003 gp = MEM_U32(sp + 64); +t9 = t6 + t8; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a280; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ed80; +//nop; +L41ed80: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41ed8c: +t5 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x10003318; +//nop; +t4 = t5 + t2; +a0 = MEM_U32(t4 + 0); +a2 = 0x5; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41edb0; +a1 = a1; +L41edb0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t7 = 0x10003320; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41ede4; +MEM_U32(sp + 16) = zero; +L41ede4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41edf0: +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +t0 = t3 + t1; +t6 = MEM_U32(t0 + 0); +//nop; +t8 = MEM_U8(t6 + 2); +//nop; +if (t8 != 0) {at = 0x1000a1a0; +goto L42a880;} +at = 0x1000a1a0; +t5 = MEM_U32(sp + 340); +t9 = 0x1; +t2 = s0 << 2; +MEM_U32(at + 0) = t9; +//nop; +t4 = t5 + t2; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a270; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41ee3c; +//nop; +L41ee3c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +t7 = 0x10000214; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L42a934;} +//nop; +t3 = 0x10000218; +at = 0x10000218; +t3 = MEM_U32(t3 + 0); +//nop; +t1 = t3 + 0x1; +MEM_U32(at + 0) = t1; +goto L42a934; +MEM_U32(at + 0) = t1; +L41ee78: +t0 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x1000333c; +//nop; +t8 = t0 + t6; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41ee98; +a1 = a1; +L41ee98: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +t9 = MEM_U32(sp + 340); +t5 = s0 << 2; +t2 = t9 + t5; +//nop; +a1 = 0x10003340; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41eec4; +a1 = a1; +L41eec4: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +t4 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t3 = t4 + t7; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a270; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41eef0; +//nop; +L41eef0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41eefc: +t1 = 0x1000a36c; +at = 0x3; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L42a880;} +//nop; +t0 = MEM_U32(sp + 340); +t6 = s0 << 2; +t8 = t0 + t6; +a1 = MEM_U32(t8 + 0); +//nop; +a0 = 0x1000a370; +a1 = a1 + 0x2; +f_addstr(mem, sp, a0, a1); +goto L41ef34; +a1 = a1 + 0x2; +L41ef34: +t9 = MEM_U32(sp + 340); +// bdead 44020003 gp = MEM_U32(sp + 64); +t5 = s0 << 2; +t2 = t9 + t5; +//nop; +a0 = MEM_U32(t2 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L41ef54; +//nop; +L41ef54: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41ef60: +t4 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10003344; +//nop; +t3 = t4 + t7; +a0 = MEM_U32(t3 + 0); +a2 = 0x5; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41ef84; +a1 = a1; +L41ef84: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41efc4;} +//nop; +t1 = 0x1000334c; +//nop; +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41efb8; +MEM_U32(sp + 16) = zero; +L41efb8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41efc4: +t0 = MEM_U32(sp + 340); +t6 = s0 << 2; +t8 = t0 + t6; +t9 = MEM_U32(t8 + 0); +//nop; +t5 = MEM_U8(t9 + 2); +//nop; +if (t5 != 0) {//nop; +goto L42a880;} +//nop; +t2 = 0x1000022c; +at = 0x1000022c; +t2 = MEM_U32(t2 + 0); +//nop; +t4 = t2 + 0x1; +MEM_U32(at + 0) = t4; +goto L42a934; +MEM_U32(at + 0) = t4; +L41f004: +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +t1 = t7 + t3; +t0 = MEM_U32(t1 + 0); +//nop; +t6 = MEM_U8(t0 + 2); +//nop; +if (t6 != 0) {//nop; +goto L41f0c8;} +//nop; +t8 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t8; +if (at == 0) {//nop; +goto L41f080;} +//nop; +a1 = 0x10003368; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41f050; +a1 = a1; +L41f050: +t9 = MEM_U32(sp + 340); +// bdead 44020003 gp = MEM_U32(sp + 64); +t5 = s0 << 2; +t2 = t9 + t5; +//nop; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f074; +//nop; +L41f074: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41f080: +t4 = 0x1000336c; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41f0a8; +MEM_U32(sp + 16) = zero; +L41f0a8: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41f0c0; +//nop; +L41f0c0: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L41f0c8: +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10003390; +//nop; +t1 = t7 + t3; +a0 = MEM_U32(t1 + 0); +a2 = 0x6; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41f0ec; +a1 = a1; +L41f0ec: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L41f12c;} +//nop; +t0 = 0x10003398; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41f120; +MEM_U32(sp + 16) = zero; +L41f120: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41f12c: +t6 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t6 + t8; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x100033b4; +a2 = 0x6; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L41f150; +a1 = a1; +L41f150: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t5 = 0x100033bc; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41f184; +MEM_U32(sp + 16) = zero; +L41f184: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41f190: +t2 = 0x1000a36c; +at = 0x3; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L41f21c;} +//nop; +t4 = MEM_U32(sp + 340); +t7 = s0 << 2; +t3 = t4 + t7; +t1 = MEM_U32(t3 + 0); +//nop; +t0 = MEM_U8(t1 + 2); +//nop; +if (t0 != 0) {//nop; +goto L41f21c;} +//nop; +t6 = s0 << 2; +//nop; +t8 = t4 + t6; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f1e8; +//nop; +L41f1e8: +t9 = MEM_U32(sp + 340); +// bdead 44020003 gp = MEM_U32(sp + 64); +t5 = s0 << 2; +t2 = t9 + t5; +//nop; +a0 = MEM_U32(t2 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L41f208; +//nop; +L41f208: +// bdead 40020103 gp = MEM_U32(sp + 64); +t7 = 0x1; +at = 0x1000a160; +MEM_U32(at + 0) = t7; +goto L42a934; +MEM_U32(at + 0) = t7; +L41f21c: +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +//nop; +t0 = t3 + t1; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a260; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f23c; +//nop; +L41f23c: +// bdead 40020003 gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t8 = t4 + t6; +a0 = MEM_U32(t8 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L41f25c; +//nop; +L41f25c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41f268: +t9 = MEM_U32(sp + 340); +t5 = s0 << 2; +t2 = t9 + t5; +t7 = MEM_U32(t2 + 0); +//nop; +t3 = MEM_U8(t7 + 2); +//nop; +if (t3 != 0) {//nop; +goto L41f2c0;} +//nop; +t1 = 0x100033d8; +//nop; +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41f2b4; +MEM_U32(sp + 16) = zero; +L41f2b4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41f2c0: +t0 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x100033f0; +//nop; +t6 = t0 + t4; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41f2e0; +a1 = a1; +L41f2e0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t8 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t8; +if (at == 0) {//nop; +goto L41f344;} +//nop; +a1 = 0x100033f4; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41f314; +a1 = a1; +L41f314: +t9 = MEM_U32(sp + 340); +// bdead 44020003 gp = MEM_U32(sp + 64); +t5 = s0 << 2; +t2 = t9 + t5; +//nop; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f338; +//nop; +L41f338: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L41f344: +t7 = 0x100033f8; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41f36c; +MEM_U32(sp + 16) = zero; +L41f36c: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41f384; +//nop; +L41f384: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L42a880; +//nop; +L41f390: +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +t0 = t3 + t1; +t4 = MEM_U32(t0 + 0); +at = 0x1000a1d8; +t6 = t4 + 0x2; +MEM_U32(at + 0) = t6; +t8 = MEM_U8(t6 + 0); +//nop; +if (t8 == 0) {//nop; +goto L42a880;} +//nop; +t9 = MEM_U32(sp + 340); +t5 = s0 << 2; +t2 = t9 + t5; +t7 = MEM_U32(t2 + 0); +at = 0x1000a1d4; +t3 = t7 + 0x3; +MEM_U32(at + 0) = t3; +t1 = MEM_U8(t3 + 0); +at = 0x2c; +if (t1 == at) {//nop; +goto L41f430;} +//nop; +L41f3e8: +t0 = 0x1000a1d4; +at = 0x1000a1d4; +t0 = MEM_U32(t0 + 0); +//nop; +s4 = MEM_U8(t0 + 0); +t6 = t0 + 0x1; +t4 = s4 < 0x1; +s4 = t4; +if (s4 != 0) {MEM_U32(at + 0) = t6; +goto L42a880;} +MEM_U32(at + 0) = t6; +t8 = 0x1000a1d4; +at = 0x2c; +t8 = MEM_U32(t8 + 0); +//nop; +t9 = MEM_U8(t8 + 0); +//nop; +if (t9 != at) {//nop; +goto L41f3e8;} +//nop; +L41f430: +t5 = 0x1000a1d4; +at = 0x2c; +t5 = MEM_U32(t5 + 0); +//nop; +t2 = MEM_U8(t5 + 0); +//nop; +if (t2 != at) {//nop; +goto L42a934;} +//nop; +L41f450: +t7 = 0x1000a1d4; +t3 = 0x1000a1d4; +t7 = MEM_U32(t7 + 0); +s2 = 0x1000a1d8; +MEM_U8(t7 + 0) = (uint8_t)zero; +t3 = MEM_U32(t3 + 0); +at = 0x1000a1d4; +s2 = MEM_U32(s2 + 0); +t1 = t3 + 0x1; +MEM_U32(at + 0) = t1; +t4 = MEM_U8(s2 + 0); +//nop; +if (t4 == 0) {//nop; +goto L420034;} +//nop; +L41f488: +t0 = MEM_U8(s2 + 0); +//nop; +t6 = t0 + 0xffffffd0; +at = t6 < 0x4b; +if (at == 0) {//nop; +goto L41ffc8;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000740c[] = { +&&L41f5a4, +&&L41ffc8, +&&L41f7d0, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41f4e0, +&&L41ffc8, +&&L41f91c, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41f868, +&&L41f88c, +&&L41f844, +&&L41f7ac, +&&L41ffc8, +&&L41f5a4, +&&L41ffc8, +&&L41ffc8, +&&L41ffc8, +&&L41f6f8, +&&L41f6d4, +&&L41f8b0, +&&L41f764, +&&L41ffc8, +&&L41f7f4, +&&L41f4bc, +&&L41f788, +&&L41ffc8, +&&L41f740, +&&L41ffc8, +&&L41f71c, +&&L41ffc8, +&&L41f6b0, +&&L41f940, +&&L41f8d4, +&&L41f8f8, +}; +dest = Lswitch1000740c[t6]; +//nop; +goto *dest; +//nop; +L41f4bc: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a270; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f4d4; +//nop; +L41f4d4: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f4e0: +t8 = 0x1000a36c; +at = 0x3; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L41f51c;} +//nop; +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a5b8; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f510; +//nop; +L41f510: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f51c: +t9 = 0x1000a36c; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L41f558;} +//nop; +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a5d0; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f54c; +//nop; +L41f54c: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f558: +t5 = 0x10003420; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41f580; +MEM_U32(sp + 16) = zero; +L41f580: +// bdead 400a0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41f598; +//nop; +L41f598: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f5a4: +s4 = 0x1000a36c; +at = 0x2; +s4 = MEM_U32(s4 + 0); +//nop; +if (s4 == at) {at = 0x3; +goto L41f5dc;} +at = 0x3; +if (s4 == at) {at = 0x5; +goto L41f600;} +at = 0x5; +if (s4 == at) {at = 0x6; +goto L41f624;} +at = 0x6; +if (s4 == at) {//nop; +goto L41f648;} +//nop; +//nop; +goto L41f66c; +//nop; +L41f5dc: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a320; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f5f4; +//nop; +L41f5f4: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f600: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a330; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f618; +//nop; +L41f618: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f624: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a408; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f63c; +//nop; +L41f63c: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f648: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a418; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f660; +//nop; +L41f660: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f66c: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a310; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f684; +//nop; +L41f684: +// bdead 400a0003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a2f0; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f6a4; +//nop; +L41f6a4: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f6b0: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a300; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f6c8; +//nop; +L41f6c8: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f6d4: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a428; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f6ec; +//nop; +L41f6ec: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f6f8: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a438; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f710; +//nop; +L41f710: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f71c: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a448; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f734; +//nop; +L41f734: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f740: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a460; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f758; +//nop; +L41f758: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f764: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a470; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f77c; +//nop; +L41f77c: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f788: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a490; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f7a0; +//nop; +L41f7a0: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f7ac: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a4a0; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f7c4; +//nop; +L41f7c4: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f7d0: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a4b0; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f7e8; +//nop; +L41f7e8: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f7f4: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a4b0; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f80c; +//nop; +L41f80c: +// bdead 400a0003 gp = MEM_U32(sp + 64); +//nop; +a0 = 0x1000a1d4; +a1 = 0x10003450; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strstr(mem, a0, a1); +goto L41f82c; +a1 = a1; +L41f82c: +// bdead 400a010b gp = MEM_U32(sp + 64); +if (v0 == 0) {at = 0x10000264; +goto L420024;} +at = 0x10000264; +t2 = 0x1; +MEM_U32(at + 0) = t2; +goto L420024; +MEM_U32(at + 0) = t2; +L41f844: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a4c0; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f85c; +//nop; +L41f85c: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f868: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a4d0; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f880; +//nop; +L41f880: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f88c: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a4d0; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f8a4; +//nop; +L41f8a4: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f8b0: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a4e0; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f8c8; +//nop; +L41f8c8: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f8d4: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a500; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f8ec; +//nop; +L41f8ec: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f8f8: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a510; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f910; +//nop; +L41f910: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f91c: +a1 = 0x1000a1d4; +//nop; +a0 = 0x1000a2a0; +a1 = MEM_U32(a1 + 0); +//nop; +f_addstr(mem, sp, a0, a1); +goto L41f934; +//nop; +L41f934: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41f940: +t7 = 0x1000a1d4; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +t3 = MEM_U8(t7 + 1); +//nop; +t1 = t3 + 0xffffffbf; +at = t1 < 0x36; +if (at == 0) {//nop; +goto L420024;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10007538[] = { +&&L41ff2c, +&&L420024, +&&L420024, +&&L41fc44, +&&L420024, +&&L420024, +&&L41f984, +&&L420024, +&&L420024, +&&L420024, +&&L41fe9c, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L41fe24, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L420024, +&&L41fbc4, +}; +dest = Lswitch10007538[t1]; +//nop; +goto *dest; +//nop; +L41f984: +t4 = 0x1000a1d4; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +t0 = MEM_U8(t4 + 2); +//nop; +if (t0 != 0) {//nop; +goto L41fa4c;} +//nop; +t6 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t6; +if (at != 0) {//nop; +goto L41fa00;} +//nop; +t8 = 0x1000345c; +//nop; +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41f9e0; +MEM_U32(sp + 16) = zero; +L41f9e0: +// bdead 400a0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41f9f8; +//nop; +L41f9f8: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +L41fa00: +t9 = 0x10000230; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +at = (int)t9 < (int)0x3; +if (at == 0) {//nop; +goto L41fa38;} +//nop; +t5 = MEM_U32(sp + 340); +t2 = s0 << 2; +t7 = t5 + t2; +t3 = MEM_U32(t7 + 0); +at = 0x10000400; +MEM_U32(at + 0) = t3; +goto L41fa94; +MEM_U32(at + 0) = t3; +L41fa38: +t1 = 0x10003484; +at = 0x10000400; +t1 = t1; +MEM_U32(at + 0) = t1; +goto L41fa94; +MEM_U32(at + 0) = t1; +L41fa4c: +t4 = 0x10000230; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +at = (int)t4 < (int)0x3; +if (at == 0) {//nop; +goto L41fa84;} +//nop; +t0 = 0x1000a1d4; +at = 0x10000400; +t0 = MEM_U32(t0 + 0); +//nop; +t6 = t0 + 0x2; +MEM_U32(at + 0) = t6; +goto L41fa94; +MEM_U32(at + 0) = t6; +L41fa84: +t8 = 0x10003488; +at = 0x10000400; +t8 = t8; +MEM_U32(at + 0) = t8; +L41fa94: +s3 = 0x10000400; +at = 0x2c; +s3 = MEM_U32(s3 + 0); +//nop; +t9 = MEM_U8(s3 + 0); +//nop; +if (t9 == at) {//nop; +goto L41fb70;} +//nop; +t5 = MEM_U8(s3 + 0); +//nop; +if (t5 == 0) {//nop; +goto L41fb70;} +//nop; +L41fac4: +t2 = MEM_U8(s3 + 0); +t7 = 0xfb504f0; +//nop; +t3 = t2 + t7; +t1 = MEM_U8(t3 + 1); +//nop; +t4 = t1 & 0x4; +if (t4 != 0) {//nop; +goto L41fb3c;} +//nop; +t6 = 0x10000400; +t0 = 0x1000348c; +//nop; +t6 = MEM_U32(t6 + 0); +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t6; +f_error(mem, sp, a0, a1, a2, a3); +goto L41fb1c; +MEM_U32(sp + 24) = t6; +L41fb1c: +// bdead 401a0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41fb34; +//nop; +L41fb34: +// bdead 401a0103 gp = MEM_U32(sp + 64); +//nop; +L41fb3c: +t8 = MEM_U8(s3 + 0); +at = 0x2c; +if (t8 == at) {//nop; +goto L41fb50;} +//nop; +s3 = s3 + 0x1; +L41fb50: +t9 = MEM_U8(s3 + 0); +at = 0x2c; +if (t9 == at) {//nop; +goto L41fb70;} +//nop; +t5 = MEM_U8(s3 + 0); +//nop; +if (t5 != 0) {//nop; +goto L41fac4;} +//nop; +L41fb70: +t2 = 0x10000328; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L41fbb8;} +//nop; +a0 = 0x1000a1ac; +a1 = 0x1000a1b0; +at = 0x10000328; +//nop; +t7 = 0x1; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 0); +a2 = zero; +MEM_U32(at + 0) = t7; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L41fbb0; +MEM_U32(at + 0) = t7; +L41fbb0: +// bdead 401a0103 gp = MEM_U32(sp + 64); +//nop; +L41fbb8: +at = 0x1000a1d4; +MEM_U32(at + 0) = s3; +goto L420024; +MEM_U32(at + 0) = s3; +L41fbc4: +t3 = 0x1000a1d4; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +t1 = MEM_U8(t3 + 2); +//nop; +if (t1 == 0) {at = 0x2c; +goto L41fbe8;} +at = 0x2c; +if (t1 != at) {at = 0x10000234; +goto L420024;} +L41fbe8: +at = 0x10000234; +a0 = 0x100034ac; +//nop; +t4 = 0x1; +MEM_U32(at + 0) = t4; +a0 = a0; +v0 = wrapper_getenv(mem, a0); +goto L41fc04; +a0 = a0; +L41fc04: +// bdead 400a010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L420024;} +//nop; +t0 = 0x100034b4; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41fc38; +MEM_U32(sp + 16) = zero; +L41fc38: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41fc44: +t6 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t6 + t8; +t5 = MEM_U32(t9 + 0); +//nop; +t2 = MEM_U8(t5 + 2); +//nop; +if (t2 != 0) {//nop; +goto L41fe24;} +//nop; +t7 = MEM_U32(sp + 336); +t3 = s0 + 0x1; +at = (int)t3 < (int)t7; +if (at == 0) {//nop; +goto L41fd84;} +//nop; +t1 = s0 << 2; +//nop; +t4 = t6 + t1; +a0 = MEM_U32(t4 + 4); +a1 = sp + 0x108; +a2 = 0x10; +v0 = wrapper_strtoul(mem, a0, a1, a2); +goto L41fc98; +a2 = 0x10; +L41fc98: +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +// bdead 420a020b gp = MEM_U32(sp + 64); +MEM_U32(sp + 268) = v0; +t9 = t0 + t8; +a0 = MEM_U32(t9 + 4); +//nop; +//nop; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L41fcc0; +//nop; +L41fcc0: +t5 = MEM_U32(sp + 340); +t2 = s0 << 2; +t7 = t5 + t2; +t3 = MEM_U32(t7 + 4); +t6 = MEM_U32(sp + 264); +// bdead 400ad00b gp = MEM_U32(sp + 64); +t1 = t6 - t3; +if (v0 != t1) {//nop; +goto L41fd50;} +//nop; +t4 = MEM_U32(sp + 268); +//nop; +if (t4 != 0) {//nop; +goto L41fd0c;} +//nop; +t0 = s0 << 2; +t8 = t5 + t0; +t9 = MEM_U32(t8 + 4); +//nop; +if (t9 == t6) {//nop; +goto L41fd50;} +//nop; +L41fd0c: +t2 = MEM_U32(sp + 340); +t7 = s0 << 2; +t3 = t2 + t7; +t1 = MEM_U32(t3 + 4); +at = 0x2d; +t4 = MEM_U8(t1 + 0); +//nop; +if (t4 == at) {//nop; +goto L41fd50;} +//nop; +t5 = s0 << 2; +t0 = t2 + t5; +t8 = MEM_U32(t0 + 4); +at = 0x2b; +t9 = MEM_U8(t8 + 0); +//nop; +if (t9 != at) {//nop; +goto L41fd84;} +//nop; +L41fd50: +t6 = 0x100034f8; +//nop; +t6 = t6; +MEM_U32(sp + 20) = t6; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41fd78; +MEM_U32(sp + 16) = zero; +L41fd78: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41fd84: +t7 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t7; +if (at == 0) {//nop; +goto L41fddc;} +//nop; +a1 = 0x10003528; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41fdac; +a1 = a1; +L41fdac: +// bdead 400a0003 gp = MEM_U32(sp + 64); +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +//nop; +t4 = t3 + t1; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L41fdd0; +//nop; +L41fdd0: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41fddc: +t2 = 0x1000352c; +//nop; +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41fe04; +MEM_U32(sp + 16) = zero; +L41fe04: +// bdead 400a0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41fe1c; +//nop; +L41fe1c: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +L41fe24: +t5 = 0x1000a1d4; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +t0 = MEM_U8(t5 + 2); +//nop; +if (t0 == 0) {at = 0x2c; +goto L41fe4c;} +at = 0x2c; +if (t0 != at) {//nop; +goto L420024;} +//nop; +L41fe4c: +t8 = MEM_U32(sp + 340); +t9 = s0 << 2; +a2 = 0x1000a1d4; +t6 = t8 + t9; +//nop; +a1 = 0x10003550; +a0 = MEM_U32(t6 + 0); +a2 = MEM_U32(a2 + 0); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41fe78; +a1 = a1; +L41fe78: +// bdead 400a000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a4e0; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41fe90; +a1 = s4; +L41fe90: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41fe9c: +a0 = 0x1000a1d4; +a1 = 0x10003554; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L41feb4; +a1 = a1; +L41feb4: +// bdead 400a010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L41ff10;} +//nop; +t7 = MEM_U32(sp + 340); +a2 = 0x1000a1d4; +t3 = s0 << 2; +a1 = 0x10003558; +//nop; +t1 = t7 + t3; +a0 = MEM_U32(t1 + 0); +a2 = MEM_U32(a2 + 0); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L41feec; +a1 = a1; +L41feec: +// bdead 400a000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a4e0; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L41ff04; +a1 = s4; +L41ff04: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41ff10: +t4 = 0x10000240; +at = 0x10000240; +t4 = MEM_U32(t4 + 0); +//nop; +t2 = t4 + 0x1; +MEM_U32(at + 0) = t2; +goto L420024; +MEM_U32(at + 0) = t2; +L41ff2c: +t5 = 0x1000a1d4; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +t0 = MEM_U8(t5 + 2); +//nop; +if (t0 != 0) {//nop; +goto L420024;} +//nop; +t8 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t8; +if (at == 0) {//nop; +goto L41ff7c;} +//nop; +a1 = 0x1000355c; +//nop; +a0 = 0x1000a540; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L41ff74; +a1 = a1; +L41ff74: +// bdead 400a0003 gp = MEM_U32(sp + 64); +//nop; +L41ff7c: +t9 = 0x10003560; +a0 = 0x1; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L41ffa4; +MEM_U32(sp + 16) = zero; +L41ffa4: +// bdead 400a0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L41ffbc; +//nop; +L41ffbc: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +goto L420024; +//nop; +L41ffc8: +t6 = 0x10003584; +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +t6 = t6; +MEM_U32(sp + 20) = t6; +MEM_U32(sp + 16) = zero; +t1 = t7 + t3; +t4 = MEM_U32(t1 + 0); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t4; +f_error(mem, sp, a0, a1, a2, a3); +goto L420004; +MEM_U32(sp + 24) = t4; +L420004: +// bdead 400a0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L42001c; +//nop; +L42001c: +// bdead 400a0103 gp = MEM_U32(sp + 64); +//nop; +L420024: +t2 = MEM_U8(s2 + 1); +s2 = s2 + 0x1; +if (t2 != 0) {//nop; +goto L41f488;} +//nop; +L420034: +t5 = 0x1000a1d4; +at = 0x2c; +t5 = MEM_U32(t5 + 0); +//nop; +t0 = MEM_U8(t5 + 0); +//nop; +if (t0 == at) {//nop; +goto L420094;} +//nop; +if (t0 == 0) {//nop; +goto L420094;} +//nop; +L42005c: +t8 = 0x1000a1d4; +at = 0x1000a1d4; +t8 = MEM_U32(t8 + 0); +t6 = 0x1000a1d4; +t9 = t8 + 0x1; +MEM_U32(at + 0) = t9; +t6 = MEM_U32(t6 + 0); +at = 0x2c; +t7 = MEM_U8(t6 + 0); +//nop; +if (t7 == at) {//nop; +goto L420094;} +//nop; +if (t7 != 0) {//nop; +goto L42005c;} +//nop; +L420094: +t3 = 0x1000a1d4; +at = 0x2c; +t3 = MEM_U32(t3 + 0); +//nop; +t1 = MEM_U8(t3 + 0); +//nop; +if (t1 == at) {//nop; +goto L41f450;} +//nop; +//nop; +goto L42a934; +//nop; +L4200bc: +t4 = 0x1000a36c; +at = 0x1; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L420224;} +//nop; +t2 = MEM_U32(sp + 340); +t5 = s0 << 2; +a1 = 0x100035a4; +//nop; +t0 = t2 + t5; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4200f4; +a1 = a1; +L4200f4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42012c;} +//nop; +t8 = MEM_U32(sp + 340); +t9 = s0 << 2; +t6 = t8 + t9; +//nop; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a310; +//nop; +f_addstr(mem, sp, a0, a1); +goto L420120; +//nop; +L420120: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42012c: +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x100035b0; +//nop; +t1 = t7 + t3; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42014c; +a1 = a1; +L42014c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000270; +goto L42017c;} +at = 0x10000270; +a1 = 0x100035b4; +//nop; +a0 = 0x1000a310; +MEM_U32(at + 0) = zero; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L420170; +a1 = a1; +L420170: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42017c: +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x100035bc; +//nop; +t5 = t4 + t2; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42019c; +a1 = a1; +L42019c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000270; +goto L4201d0;} +at = 0x10000270; +a1 = 0x100035c0; +//nop; +t0 = 0x1; +a0 = 0x1000a310; +MEM_U32(at + 0) = t0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4201c4; +a1 = a1; +L4201c4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4201d0: +t8 = MEM_U32(sp + 340); +t9 = s0 << 2; +t6 = t8 + t9; +//nop; +a1 = 0x100035c8; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4201f0; +a1 = a1; +L4201f0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000270; +goto L420224;} +at = 0x10000270; +a1 = 0x100035cc; +//nop; +t7 = 0x1; +a0 = 0x1000a310; +MEM_U32(at + 0) = t7; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L420218; +a1 = a1; +L420218: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L420224: +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x100035d4; +//nop; +t4 = t3 + t1; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420244; +a1 = a1; +L420244: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42027c;} +//nop; +t2 = MEM_U32(sp + 340); +t5 = s0 << 2; +//nop; +t0 = t2 + t5; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a310; +//nop; +f_addstr(mem, sp, a0, a1); +goto L420270; +//nop; +L420270: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42027c: +t8 = MEM_U32(sp + 340); +t9 = s0 << 2; +t6 = t8 + t9; +//nop; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42029c; +//nop; +L42029c: +// bdead 40020003 gp = MEM_U32(sp + 64); +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x100035e4; +//nop; +t1 = t7 + t3; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4202c0; +a1 = a1; +L4202c0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L420484;} +//nop; +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x100035f4; +//nop; +t5 = t4 + t2; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4202ec; +a1 = a1; +L4202ec: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L420484;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10003600; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420318; +a1 = a1; +L420318: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L420484;} +//nop; +t6 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x1000360c; +//nop; +t3 = t6 + t7; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420344; +a1 = a1; +L420344: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L420484;} +//nop; +t1 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x10003614; +//nop; +t2 = t1 + t4; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420370; +a1 = a1; +L420370: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L420484;} +//nop; +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x10003620; +//nop; +t8 = t5 + t0; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42039c; +a1 = a1; +L42039c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L420484;} +//nop; +t9 = MEM_U32(sp + 340); +t6 = s0 << 2; +t7 = t9 + t6; +//nop; +a1 = 0x10003630; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4203c8; +a1 = a1; +L4203c8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L420484;} +//nop; +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x1000363c; +//nop; +t4 = t3 + t1; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4203f4; +a1 = a1; +L4203f4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L420484;} +//nop; +t2 = MEM_U32(sp + 340); +t5 = s0 << 2; +a1 = 0x1000364c; +//nop; +t0 = t2 + t5; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420420; +a1 = a1; +L420420: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L420484;} +//nop; +t8 = MEM_U32(sp + 340); +t9 = s0 << 2; +t6 = t8 + t9; +//nop; +a1 = 0x1000365c; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42044c; +a1 = a1; +L42044c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L420484;} +//nop; +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10003668; +//nop; +t1 = t7 + t3; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420478; +a1 = a1; +L420478: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a934;} +//nop; +L420484: +t4 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t4; +if (at == 0) {//nop; +goto L4204c4;} +//nop; +t2 = MEM_U32(sp + 340); +t5 = s0 << 2; +//nop; +t0 = t2 + t5; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4204b8; +//nop; +L4204b8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4204c4: +t8 = 0x10003678; +t9 = MEM_U32(sp + 340); +t6 = s0 << 2; +t8 = t8; +t7 = t9 + t6; +MEM_U32(sp + 20) = t8; +MEM_U32(sp + 16) = zero; +t3 = MEM_U32(t7 + -4); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L420500; +MEM_U32(sp + 24) = t3; +L420500: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42050c: +t1 = 0x1000a36c; +at = 0x1; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L42057c;} +//nop; +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x10003694; +//nop; +t5 = t4 + t2; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420544; +a1 = a1; +L420544: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42057c;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L420570; +//nop; +L420570: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42057c: +t6 = 0x1000a36c; +at = 0x1; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L4205ec;} +//nop; +t7 = 0x10000008; +at = 0x2; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == at) {at = 0x3; +goto L4205b4;} +at = 0x3; +if (t7 != at) {//nop; +goto L4205ec;} +//nop; +L4205b4: +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x1000369c; +//nop; +t4 = t3 + t1; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4205d4; +a1 = a1; +L4205d4: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000120; +goto L4205ec;} +at = 0x10000120; +t2 = 0x1; +MEM_U32(at + 0) = t2; +goto L42a934; +MEM_U32(at + 0) = t2; +L4205ec: +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x100036ac; +//nop; +t8 = t5 + t0; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42060c; +a1 = a1; +L42060c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4206a4;} +//nop; +t9 = 0x100003e4; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {at = 0x100003e4; +goto L420638;} +at = 0x100003e4; +//nop; +MEM_U32(at + 0) = zero; +L420638: +at = 0x10000004; +t7 = 0x100003e8; +t6 = 0x1; +t7 = MEM_U32(t7 + 0); +MEM_U32(at + 0) = t6; +at = 0x1; +if (t7 == at) {at = 0x100003e8; +goto L420660;} +at = 0x100003e8; +t3 = 0x3; +MEM_U32(at + 0) = t3; +L420660: +a0 = 0x100036b4; +//nop; +a1 = zero; +a2 = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L420678; +a0 = a0; +L420678: +// bdead 40020003 gp = MEM_U32(sp + 64); +t1 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t2 = t1 + t4; +a0 = MEM_U32(t2 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L420698; +//nop; +L420698: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4206a4: +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x100036b8; +//nop; +t8 = t5 + t0; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4206c4; +a1 = a1; +L4206c4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42075c;} +//nop; +t9 = 0x100003e4; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {at = 0x100003e4; +goto L4206f0;} +at = 0x100003e4; +//nop; +MEM_U32(at + 0) = zero; +L4206f0: +at = 0x10000004; +t7 = 0x100003e8; +t6 = 0x2; +t7 = MEM_U32(t7 + 0); +MEM_U32(at + 0) = t6; +at = 0x1; +if (t7 == at) {at = 0x100003e8; +goto L420718;} +at = 0x100003e8; +t3 = 0x3; +MEM_U32(at + 0) = t3; +L420718: +a0 = 0x100036c4; +//nop; +a1 = zero; +a2 = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L420730; +a0 = a0; +L420730: +// bdead 40020003 gp = MEM_U32(sp + 64); +t1 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t2 = t1 + t4; +a0 = MEM_U32(t2 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L420750; +//nop; +L420750: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42075c: +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x100036c8; +//nop; +t8 = t5 + t0; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42077c; +a1 = a1; +L42077c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000037c; +goto L4207e8;} +at = 0x1000037c; +t9 = 0x1; +MEM_U32(at + 0) = t9; +//nop; +a1 = 0x100036d0; +a0 = 0x1000a270; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4207a4; +a1 = a1; +L4207a4: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100036e0; +//nop; +a0 = 0x1000a4d0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4207c0; +a1 = a1; +L4207c0: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100036e8; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4207dc; +a1 = a1; +L4207dc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4207e8: +t6 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x100036f0; +//nop; +t3 = t6 + t7; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420808; +a1 = a1; +L420808: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4208d4;} +//nop; +t1 = 0x1000a36c; +at = 0x1; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L420898;} +//nop; +t4 = 0x10000008; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L420898;} +//nop; +t2 = 0x100036f8; +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +t2 = t2; +MEM_U32(sp + 20) = t2; +MEM_U32(sp + 16) = zero; +t8 = t5 + t0; +t9 = MEM_U32(t8 + 0); +t6 = 0x10003728; +MEM_U32(sp + 24) = t9; +//nop; +t6 = t6; +MEM_U32(sp + 28) = t6; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L42088c; +a3 = zero; +L42088c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L420898: +at = 0x100003e8; +t7 = 0x1; +MEM_U32(at + 0) = t7; +at = 0x100003dc; +a0 = 0x1000372c; +//nop; +t3 = 0x1; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t3; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L4208c8; +a0 = a0; +L4208c8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4208d4: +t1 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x10003730; +//nop; +t2 = t1 + t4; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4208f4; +a1 = a1; +L4208f4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a13c; +goto L420938;} +at = 0x1000a13c; +t0 = 0x1000a36c; +t5 = 0x8; +t0 = MEM_U32(t0 + 0); +MEM_U32(at + 0) = t5; +at = 0x3; +if (t0 != at) {//nop; +goto L420a9c;} +//nop; +t8 = 0x1000a140; +at = 0x1000a140; +t8 = MEM_U32(t8 + 0); +//nop; +t9 = t8 + 0x1; +MEM_U32(at + 0) = t9; +goto L420a9c; +MEM_U32(at + 0) = t9; +L420938: +t6 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10003738; +//nop; +t3 = t6 + t7; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420958; +a1 = a1; +L420958: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a13c; +goto L42099c;} +at = 0x1000a13c; +t4 = 0x1000a36c; +t1 = 0x10; +t4 = MEM_U32(t4 + 0); +MEM_U32(at + 0) = t1; +at = 0x3; +if (t4 != at) {//nop; +goto L420a9c;} +//nop; +t2 = 0x1000a140; +at = 0x1000a140; +t2 = MEM_U32(t2 + 0); +//nop; +t5 = t2 + 0x1; +MEM_U32(at + 0) = t5; +goto L420a9c; +MEM_U32(at + 0) = t5; +L42099c: +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10003744; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4209bc; +a1 = a1; +L4209bc: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a13c; +goto L420a00;} +at = 0x1000a13c; +t7 = 0x1000a36c; +t6 = 0x20; +t7 = MEM_U32(t7 + 0); +MEM_U32(at + 0) = t6; +at = 0x3; +if (t7 != at) {//nop; +goto L420a9c;} +//nop; +t3 = 0x1000a140; +at = 0x1000a140; +t3 = MEM_U32(t3 + 0); +//nop; +t1 = t3 + 0x1; +MEM_U32(at + 0) = t1; +goto L420a9c; +MEM_U32(at + 0) = t1; +L420a00: +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x10003750; +//nop; +t5 = t4 + t2; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420a20; +a1 = a1; +L420a20: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a13c; +goto L420a64;} +at = 0x1000a13c; +t8 = 0x1000a36c; +t0 = 0x40; +t8 = MEM_U32(t8 + 0); +MEM_U32(at + 0) = t0; +at = 0x3; +if (t8 != at) {//nop; +goto L420a9c;} +//nop; +t9 = 0x1000a140; +at = 0x1000a140; +t9 = MEM_U32(t9 + 0); +//nop; +t6 = t9 + 0x1; +MEM_U32(at + 0) = t6; +goto L420a9c; +MEM_U32(at + 0) = t6; +L420a64: +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x1000375c; +//nop; +t1 = t7 + t3; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420a84; +a1 = a1; +L420a84: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a140; +goto L420a9c;} +at = 0x1000a140; +t4 = 0x1; +MEM_U32(at + 0) = t4; +goto L42a934; +MEM_U32(at + 0) = t4; +L420a9c: +t2 = 0x1000a36c; +at = 0x3; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L420c10;} +//nop; +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x1000376c; +//nop; +t8 = t5 + t0; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420ad4; +a1 = a1; +L420ad4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L420b64;} +//nop; +t9 = MEM_U32(sp + 340); +t6 = s0 << 2; +t7 = t9 + t6; +//nop; +a1 = 0x10003774; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420b00; +a1 = a1; +L420b00: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L420b64;} +//nop; +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x10003780; +//nop; +t4 = t3 + t1; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420b2c; +a1 = a1; +L420b2c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L420b64;} +//nop; +t2 = MEM_U32(sp + 340); +t5 = s0 << 2; +a1 = 0x1000378c; +//nop; +t0 = t2 + t5; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420b58; +a1 = a1; +L420b58: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L420bd8;} +//nop; +L420b64: +t8 = MEM_U32(sp + 340); +t9 = s0 << 2; +t6 = t8 + t9; +//nop; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L420b84; +//nop; +L420b84: +// bdead 40020003 gp = MEM_U32(sp + 64); +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t1 = t7 + t3; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a4c0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L420ba8; +//nop; +L420ba8: +// bdead 40020003 gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t5 = t4 + t2; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a4d0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L420bcc; +//nop; +L420bcc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L420bd8: +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10003798; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420bf8; +a1 = a1; +L420bf8: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000284; +goto L420c10;} +at = 0x10000284; +t6 = 0x1; +MEM_U32(at + 0) = t6; +goto L42a934; +MEM_U32(at + 0) = t6; +L420c10: +t7 = 0x1000a36c; +at = 0x6; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L420c60;} +//nop; +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x100037a4; +//nop; +t4 = t3 + t1; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420c48; +a1 = a1; +L420c48: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000290; +goto L420c60;} +at = 0x10000290; +t2 = 0x1; +MEM_U32(at + 0) = t2; +goto L42a934; +MEM_U32(at + 0) = t2; +L420c60: +t5 = 0x1000a36c; +at = 0x2; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L420cf4;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x100037ac; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420c98; +a1 = a1; +L420c98: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L420cf4;} +//nop; +t6 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t3 = t6 + t7; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a320; +//nop; +f_addstr(mem, sp, a0, a1); +goto L420cc4; +//nop; +L420cc4: +// bdead 40020003 gp = MEM_U32(sp + 64); +t1 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t2 = t1 + t4; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a4c0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L420ce8; +//nop; +L420ce8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L420cf4: +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x100037b4; +//nop; +t8 = t5 + t0; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420d14; +a1 = a1; +L420d14: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a13c; +goto L420d58;} +at = 0x1000a13c; +t6 = MEM_U32(sp + 340); +t9 = 0x8; +t7 = s0 << 2; +MEM_U32(at + 0) = t9; +//nop; +t3 = t6 + t7; +a0 = MEM_U32(t3 + 0); +a1 = zero; +v0 = f_savestr(mem, sp, a0, a1); +goto L420d44; +a1 = zero; +L420d44: +// bdead 4002010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a144; +MEM_U32(at + 0) = v0; +goto L42a934; +MEM_U32(at + 0) = v0; +L420d58: +t1 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x100037bc; +//nop; +t2 = t1 + t4; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420d78; +a1 = a1; +L420d78: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a13c; +goto L420dc0;} +at = 0x1000a13c; +t0 = MEM_U32(sp + 340); +t5 = 0x10; +t8 = s0 << 2; +MEM_U32(at + 0) = t5; +t9 = t0 + t8; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = zero; +//nop; +v0 = f_savestr(mem, sp, a0, a1); +goto L420dac; +//nop; +L420dac: +// bdead 4002010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a144; +MEM_U32(at + 0) = v0; +goto L42a934; +MEM_U32(at + 0) = v0; +L420dc0: +t6 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x100037c8; +//nop; +t3 = t6 + t7; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420de0; +a1 = a1; +L420de0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a13c; +goto L420e24;} +at = 0x1000a13c; +t4 = MEM_U32(sp + 340); +t1 = 0x20; +t2 = s0 << 2; +//nop; +MEM_U32(at + 0) = t1; +t5 = t4 + t2; +a0 = MEM_U32(t5 + 0); +a1 = zero; +v0 = f_savestr(mem, sp, a0, a1); +goto L420e10; +a1 = zero; +L420e10: +// bdead 4002010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a144; +MEM_U32(at + 0) = v0; +goto L42a934; +MEM_U32(at + 0) = v0; +L420e24: +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x100037d4; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420e44; +a1 = a1; +L420e44: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a13c; +goto L420e88;} +at = 0x1000a13c; +t7 = MEM_U32(sp + 340); +t6 = 0x40; +t3 = s0 << 2; +//nop; +MEM_U32(at + 0) = t6; +t1 = t7 + t3; +a0 = MEM_U32(t1 + 0); +a1 = zero; +v0 = f_savestr(mem, sp, a0, a1); +goto L420e74; +a1 = zero; +L420e74: +// bdead 4002010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a144; +MEM_U32(at + 0) = v0; +goto L42a934; +MEM_U32(at + 0) = v0; +L420e88: +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x100037e0; +//nop; +t5 = t4 + t2; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420ea8; +a1 = a1; +L420ea8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L420ed4; +//nop; +L420ed4: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100037e8; +//nop; +a0 = 0x1000a510; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L420ef0; +a1 = a1; +L420ef0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L420efc: +t6 = MEM_U32(sp + 340); +t7 = s0 << 2; +t3 = t6 + t7; +t1 = MEM_U32(t3 + 0); +//nop; +t4 = MEM_U8(t1 + 2); +//nop; +if (t4 == 0) {//nop; +goto L420f48;} +//nop; +t2 = s0 << 2; +a1 = 0x100037f8; +//nop; +t5 = t6 + t2; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420f3c; +a1 = a1; +L420f3c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L420f74;} +//nop; +L420f48: +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L420f68; +//nop; +L420f68: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L420f74: +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10003804; +//nop; +t1 = t7 + t3; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420f94; +a1 = a1; +L420f94: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L420fcc;} +//nop; +t4 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t2 = t4 + t6; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L420fc0; +//nop; +L420fc0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L420fcc: +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x10003810; +//nop; +t8 = t5 + t0; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L420fec; +a1 = a1; +L420fec: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a178; +goto L421000;} +at = 0x1000a178; +t9 = 0x1; +MEM_U32(at + 0) = t9; +L421000: +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t1 = t7 + t3; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L421020; +//nop; +L421020: +// bdead 40020003 gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t2 = t4 + t6; +a0 = MEM_U32(t2 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L421040; +//nop; +L421040: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42104c: +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +t8 = t5 + t0; +t9 = MEM_U32(t8 + 0); +//nop; +t7 = MEM_U8(t9 + 2); +//nop; +if (t7 != 0) {//nop; +goto L42108c;} +//nop; +t3 = 0x10000228; +at = 0x10000228; +t3 = MEM_U32(t3 + 0); +//nop; +t1 = t3 + 0x1; +MEM_U32(at + 0) = t1; +goto L42a934; +MEM_U32(at + 0) = t1; +L42108c: +t4 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x1000381c; +//nop; +t2 = t4 + t6; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4210ac; +a1 = a1; +L4210ac: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000004; +goto L421100;} +at = 0x10000004; +t5 = 0x100003e8; +MEM_U32(at + 0) = zero; +t5 = MEM_U32(t5 + 0); +at = 0x1; +if (t5 == at) {at = 0x100003e8; +goto L4210d8;} +at = 0x100003e8; +t0 = 0x2; +MEM_U32(at + 0) = t0; +L4210d8: +t8 = MEM_U32(sp + 340); +t9 = s0 << 2; +t7 = t8 + t9; +//nop; +a0 = MEM_U32(t7 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L4210f4; +//nop; +L4210f4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L421100: +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x10003824; +//nop; +t4 = t3 + t1; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421120; +a1 = a1; +L421120: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4211e0;} +//nop; +t6 = 0x1000a36c; +at = 0x1; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L4211b0;} +//nop; +t2 = 0x10000008; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L4211b0;} +//nop; +t5 = 0x1000382c; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t5 = t5; +MEM_U32(sp + 20) = t5; +MEM_U32(sp + 16) = zero; +t9 = t0 + t8; +t7 = MEM_U32(t9 + 0); +t3 = 0x1000385c; +//nop; +t3 = t3; +MEM_U32(sp + 28) = t3; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t7; +f_error(mem, sp, a0, a1, a2, a3); +goto L4211a4; +MEM_U32(sp + 24) = t7; +L4211a4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4211b0: +at = 0x100003e4; +a0 = 0x10003860; +//nop; +t1 = 0x3; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t1; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L4211d4; +a0 = a0; +L4211d4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4211e0: +t4 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10003864; +//nop; +t2 = t4 + t6; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421200; +a1 = a1; +L421200: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4212b0;} +//nop; +t5 = 0x1000a36c; +at = 0x1; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L421290;} +//nop; +t0 = 0x10000008; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L421290;} +//nop; +t8 = 0x1000386c; +t9 = MEM_U32(sp + 340); +t7 = s0 << 2; +t8 = t8; +t3 = t9 + t7; +t4 = 0x1000389c; +MEM_U32(sp + 20) = t8; +MEM_U32(sp + 16) = zero; +t1 = MEM_U32(t3 + 0); +//nop; +t4 = t4; +MEM_U32(sp + 28) = t4; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t1; +f_error(mem, sp, a0, a1, a2, a3); +goto L421284; +MEM_U32(sp + 24) = t1; +L421284: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L421290: +a1 = 0x100038a0; +//nop; +a0 = 0x1000a2b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4212a4; +a1 = a1; +L4212a4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4212b0: +t6 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x100038ac; +//nop; +t5 = t6 + t2; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4212d0; +a1 = a1; +L4212d0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L421438;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a4a0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4212fc; +//nop; +L4212fc: +t7 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +// bdead 40030003 gp = MEM_U32(sp + 64); +at = (int)s0 < (int)t7; +if (at != 0) {//nop; +goto L42135c;} +//nop; +t3 = 0x100038b8; +//nop; +t3 = t3; +MEM_U32(sp + 20) = t3; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L42133c; +MEM_U32(sp + 16) = zero; +L42133c: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L421354; +//nop; +L421354: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L42135c: +s2 = 0x10000400; +//nop; +s2 = MEM_U32(s2 + 0); +//nop; +t1 = MEM_U8(s2 + 0); +//nop; +if (t1 == 0) {//nop; +goto L42140c;} +//nop; +L42137c: +t4 = MEM_U8(s2 + 0); +t6 = 0xfb504f0; +//nop; +t2 = t4 + t6; +t5 = MEM_U8(t2 + 1); +//nop; +t0 = t5 & 0x4; +if (t0 != 0) {//nop; +goto L4213fc;} +//nop; +t8 = 0x100038d8; +t9 = MEM_U32(sp + 340); +t7 = s0 << 2; +t8 = t8; +t3 = t9 + t7; +MEM_U32(sp + 20) = t8; +MEM_U32(sp + 16) = zero; +t1 = MEM_U32(t3 + 0); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t1; +f_error(mem, sp, a0, a1, a2, a3); +goto L4213dc; +MEM_U32(sp + 24) = t1; +L4213dc: +// bdead 400a0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4213f4; +//nop; +L4213f4: +// bdead 400a0003 gp = MEM_U32(sp + 64); +//nop; +L4213fc: +t4 = MEM_U8(s2 + 1); +s2 = s2 + 0x1; +if (t4 != 0) {//nop; +goto L42137c;} +//nop; +L42140c: +t6 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t5 = t6 + t2; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a4a0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42142c; +//nop; +L42142c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L421438: +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x100038f8; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421458; +a1 = a1; +L421458: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000274; +goto L42148c;} +at = 0x10000274; +a1 = 0x10003900; +//nop; +t7 = 0x1; +a0 = 0x1000a310; +MEM_U32(at + 0) = t7; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L421480; +a1 = a1; +L421480: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42148c: +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x10003908; +//nop; +t4 = t3 + t1; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4214ac; +a1 = a1; +L4214ac: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4214ec;} +//nop; +t6 = 0x10003910; +//nop; +t6 = t6; +MEM_U32(sp + 20) = t6; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4214e0; +MEM_U32(sp + 16) = zero; +L4214e0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4214ec: +t2 = MEM_U32(sp + 340); +t5 = s0 << 2; +a1 = 0x10003924; +//nop; +t0 = t2 + t5; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42150c; +a1 = a1; +L42150c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000028c; +goto L421524;} +at = 0x1000028c; +t8 = 0x1; +MEM_U32(at + 0) = t8; +goto L42a934; +MEM_U32(at + 0) = t8; +L421524: +t9 = MEM_U32(sp + 340); +t7 = s0 << 2; +t3 = t9 + t7; +//nop; +a1 = 0x1000392c; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421544; +a1 = a1; +L421544: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4215d8;} +//nop; +t1 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t6 = t1 + t4; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L421570; +//nop; +L421570: +// bdead 40020103 gp = MEM_U32(sp + 64); +t2 = 0x1; +at = 0x100002dc; +t5 = 0x10000384; +MEM_U32(at + 0) = t2; +t5 = MEM_U32(t5 + 0); +at = 0x1; +if (t5 != at) {//nop; +goto L42a934;} +//nop; +t0 = 0x10000324; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {at = 0x10000318; +goto L4215c0;} +at = 0x10000318; +t8 = 0x1; +MEM_U32(at + 0) = t8; +at = 0x10000324; +t9 = 0x1; +MEM_U32(at + 0) = t9; +L4215c0: +at = 0x10000384; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10000348; +MEM_U32(at + 0) = zero; +goto L42a934; +MEM_U32(at + 0) = zero; +L4215d8: +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10003934; +//nop; +t1 = t7 + t3; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4215f8; +a1 = a1; +L4215f8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L421688;} +//nop; +t4 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10003944; +//nop; +t2 = t4 + t6; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421624; +a1 = a1; +L421624: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42165c;} +//nop; +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x1000394c; +//nop; +t8 = t5 + t0; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421650; +a1 = a1; +L421650: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L421688;} +//nop; +L42165c: +t9 = MEM_U32(sp + 340); +t7 = s0 << 2; +t3 = t9 + t7; +//nop; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42167c; +//nop; +L42167c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L421688: +t1 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x10003958; +//nop; +t6 = t1 + t4; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4216a8; +a1 = a1; +L4216a8: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000324; +goto L4216c8;} +at = 0x10000324; +t2 = 0x1; +MEM_U32(at + 0) = zero; +at = 0x10000348; +MEM_U32(at + 0) = t2; +goto L42a934; +MEM_U32(at + 0) = t2; +L4216c8: +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x10003968; +//nop; +t8 = t5 + t0; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4216e8; +a1 = a1; +L4216e8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L421740;} +//nop; +t9 = 0x10003970; +at = 0x1000a254; +t9 = t9; +t7 = 0x10003978; +MEM_U32(at + 0) = t9; +at = 0x1000a258; +t7 = t7; +MEM_U32(at + 0) = t7; +at = 0x100001e8; +//nop; +a0 = 0x10003980; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L421734; +a0 = a0; +L421734: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L421740: +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x10003984; +//nop; +t4 = t3 + t1; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421760; +a1 = a1; +L421760: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4217f0;} +//nop; +t6 = 0x10000004; +at = 0x1; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == at) {at = 0x2; +goto L42178c;} +at = 0x2; +if (t6 != at) {//nop; +goto L4217a0;} +//nop; +L42178c: +t2 = 0x1000398c; +at = 0x1000a254; +t2 = t2; +MEM_U32(at + 0) = t2; +goto L4217b0; +MEM_U32(at + 0) = t2; +L4217a0: +t5 = 0x10003994; +at = 0x1000a254; +t5 = t5; +MEM_U32(at + 0) = t5; +L4217b0: +t0 = 0x1000399c; +at = 0x1000a258; +t0 = t0; +MEM_U32(at + 0) = t0; +at = 0x100001e8; +a0 = 0x100039a4; +//nop; +t8 = 0x1; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t8; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L4217e4; +a0 = a0; +L4217e4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4217f0: +t9 = 0x1000a36c; +at = 0x2; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L421860;} +//nop; +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x100039a8; +//nop; +t1 = t7 + t3; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421828; +a1 = a1; +L421828: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L421860;} +//nop; +t4 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t2 = t4 + t6; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a320; +//nop; +f_addstr(mem, sp, a0, a1); +goto L421854; +//nop; +L421854: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L421860: +t5 = 0x1000a36c; +at = 0x3; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L4218c4;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x100039b4; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421898; +a1 = a1; +L421898: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4218c4;} +//nop; +a1 = 0x100039c4; +//nop; +a0 = 0x1000a330; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4218b8; +a1 = a1; +L4218b8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4218c4: +t7 = 0x1000a36c; +at = 0x3; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L421c24;} +//nop; +t3 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x100039d4; +//nop; +t4 = t3 + t1; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4218fc; +a1 = a1; +L4218fc: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4219b8;} +//nop; +t6 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x100039dc; +//nop; +t5 = t6 + t2; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421928; +a1 = a1; +L421928: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4219b8;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x100039e4; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421954; +a1 = a1; +L421954: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4219b8;} +//nop; +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x100039f0; +//nop; +t1 = t7 + t3; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421980; +a1 = a1; +L421980: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4219b8;} +//nop; +t4 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x100039f8; +//nop; +t2 = t4 + t6; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4219ac; +a1 = a1; +L4219ac: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L421c24;} +//nop; +L4219b8: +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x10003a08; +//nop; +t8 = t5 + t0; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4219d8; +a1 = a1; +L4219d8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a16c; +goto L4219ec;} +at = 0x1000a16c; +t9 = 0x1; +MEM_U32(at + 0) = t9; +L4219ec: +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10003a10; +//nop; +t1 = t7 + t3; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421a0c; +a1 = a1; +L421a0c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L421a38;} +//nop; +a1 = 0x10003a20; +//nop; +a0 = 0x1000a330; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L421a2c; +a1 = a1; +L421a2c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L421a38: +a0 = 0x10003a2c; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L421a4c; +//nop; +L421a4c: +// bdead 4002000b gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10003a24; +//nop; +t2 = t4 + t6; +a0 = MEM_U32(t2 + 0); +s4 = v0; +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L421a78; +a1 = a1; +L421a78: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L421ba4;} +//nop; +a0 = 0x10003a34; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L421a98; +//nop; +L421a98: +t5 = MEM_U32(sp + 340); +t0 = s0 << 2; +t8 = t5 + t0; +t9 = MEM_U32(t8 + 0); +// bdead 4402000b gp = MEM_U32(sp + 64); +t7 = v0 + t9; +MEM_U32(sp + 260) = t7; +t3 = MEM_U32(sp + 260); +//nop; +t1 = MEM_U8(t3 + 0); +//nop; +if (t1 == 0) {//nop; +goto L421b3c;} +//nop; +L421acc: +t4 = MEM_U32(sp + 260); +t2 = 0xfb504f0; +t6 = MEM_U8(t4 + 0); +//nop; +t5 = t6 + t2; +t0 = MEM_U8(t5 + 1); +//nop; +t8 = t0 & 0x1; +if (t8 == 0) {//nop; +goto L421b00;} +//nop; +t9 = MEM_U8(t5 + 258); +MEM_U8(t4 + 0) = (uint8_t)t9; +goto L421b14; +MEM_U8(t4 + 0) = (uint8_t)t9; +L421b00: +t7 = MEM_U32(sp + 260); +//nop; +t3 = MEM_U8(t7 + 0); +//nop; +MEM_U8(t7 + 0) = (uint8_t)t3; +L421b14: +t1 = MEM_U32(sp + 260); +//nop; +t6 = t1 + 0x1; +MEM_U32(sp + 260) = t6; +t2 = MEM_U32(sp + 260); +//nop; +t0 = MEM_U8(t2 + 0); +//nop; +if (t0 != 0) {//nop; +goto L421acc;} +//nop; +L421b3c: +a0 = 0x10003a48; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L421b50; +//nop; +L421b50: +t8 = MEM_U32(sp + 340); +// bdead 4202010b gp = MEM_U32(sp + 64); +t5 = s0 << 2; +t9 = t8 + t5; +t4 = MEM_U32(t9 + 0); +//nop; +a0 = 0x10003a3c; +s5 = v0; +a2 = zero; +a1 = s5 + t4; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L421b80; +a0 = a0; +L421b80: +// bdead 4002000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a330; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L421b98; +a1 = s4; +L421b98: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L421ba4: +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t1 = t3 + t7; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L421bc4; +//nop; +L421bc4: +// bdead 40020003 gp = MEM_U32(sp + 64); +t6 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x10003a50; +//nop; +t0 = t6 + t2; +a0 = MEM_U32(t0 + 0); +a2 = 0x4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L421bec; +a1 = a1; +L421bec: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a934;} +//nop; +t8 = MEM_U32(sp + 340); +t5 = s0 << 2; +t9 = t8 + t5; +a0 = MEM_U32(t9 + 0); +//nop; +//nop; +//nop; +f_add_static_opt(mem, sp, a0); +goto L421c18; +//nop; +L421c18: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L421c24: +t4 = 0x1000a36c; +at = 0x6; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L421c94;} +//nop; +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10003a58; +//nop; +t1 = t3 + t7; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421c5c; +a1 = a1; +L421c5c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L421c94;} +//nop; +t6 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t0 = t6 + t2; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a418; +//nop; +f_addstr(mem, sp, a0, a1); +goto L421c88; +//nop; +L421c88: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L421c94: +t8 = 0x1000a36c; +at = 0x1; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L42a880;} +//nop; +t5 = MEM_U32(sp + 340); +t9 = s0 << 2; +t4 = t5 + t9; +//nop; +a1 = 0x10003a64; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421ccc; +a1 = a1; +L421ccc: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t3 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t3; +if (at != 0) {//nop; +goto L421d34;} +//nop; +t7 = 0x10003a74; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L421d14; +MEM_U32(sp + 16) = zero; +L421d14: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L421d2c; +//nop; +L421d2c: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L421d34: +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t2 = t1 + t6; +a1 = MEM_U32(t2 + -4); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L421d54; +//nop; +L421d54: +// bdead 40020003 gp = MEM_U32(sp + 64); +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t5 = t0 + t8; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L421d78; +//nop; +L421d78: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L421d84: +t9 = 0x1000a36c; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L421e74;} +//nop; +t4 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10003aa4; +//nop; +t7 = t4 + t3; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421dbc; +a1 = a1; +L421dbc: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L421e74;} +//nop; +a1 = 0x10003aac; +//nop; +a0 = 0x1000a5d0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L421ddc; +a1 = a1; +L421ddc: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10003ab4; +//nop; +a0 = 0x1000a2a0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L421df8; +a1 = a1; +L421df8: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10003abc; +//nop; +a0 = 0x1000a5e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L421e14; +a1 = a1; +L421e14: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10003ac4; +//nop; +a0 = 0x1000a2c0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L421e30; +a1 = a1; +L421e30: +// bdead 40020003 gp = MEM_U32(sp + 64); +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t2 = t1 + t6; +a0 = MEM_U32(t2 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L421e50; +//nop; +L421e50: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +t0 = 0x1000a14c; +at = 0x1000a14c; +t0 = MEM_U32(t0 + 0); +//nop; +t8 = t0 + 0x1; +MEM_U32(at + 0) = t8; +goto L42a934; +MEM_U32(at + 0) = t8; +L421e74: +t5 = MEM_U32(sp + 340); +t9 = s0 << 2; +t4 = t5 + t9; +t3 = MEM_U32(t4 + 0); +//nop; +t7 = MEM_U8(t3 + 2); +//nop; +if (t7 != 0) {//nop; +goto L421ec0;} +//nop; +t1 = s0 << 2; +//nop; +t6 = t5 + t1; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L421eb4; +//nop; +L421eb4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L421ec0: +t2 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x10003ad0; +//nop; +t8 = t2 + t0; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421ee0; +a1 = a1; +L421ee0: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000360; +goto L421ef8;} +at = 0x10000360; +t9 = 0x1; +MEM_U32(at + 0) = t9; +goto L42a934; +MEM_U32(at + 0) = t9; +L421ef8: +t4 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10003adc; +//nop; +t7 = t4 + t3; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421f18; +a1 = a1; +L421f18: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L421f50;} +//nop; +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x10003ae0; +//nop; +t6 = t5 + t1; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L421f44; +a1 = a1; +L421f44: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L421fe8;} +//nop; +L421f50: +t2 = 0x100003f0; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L421fb0;} +//nop; +t0 = 0x10003ae4; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L421f90; +MEM_U32(sp + 16) = zero; +L421f90: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L421fa8; +//nop; +L421fa8: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L421fb0: +t9 = MEM_U32(sp + 340); +at = 0x100003f4; +t4 = s0 << 2; +t8 = 0x1; +t3 = t9 + t4; +//nop; +MEM_U32(at + 0) = t8; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L421fdc; +//nop; +L421fdc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L421fe8: +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +a1 = 0x10003b04; +//nop; +t1 = t7 + t5; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422008; +a1 = a1; +L422008: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x100002c0; +goto L422020;} +at = 0x100002c0; +t6 = 0x1; +MEM_U32(at + 0) = t6; +goto L42a934; +MEM_U32(at + 0) = t6; +L422020: +t2 = 0x1000a36c; +at = 0x3; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L4220b8;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10003b0c; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422058; +a1 = a1; +L422058: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a15c; +goto L4220b8;} +at = 0x1000a15c; +t3 = MEM_U32(sp + 340); +t4 = 0x1; +t7 = s0 << 2; +//nop; +MEM_U32(at + 0) = t4; +t5 = t3 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42208c; +//nop; +L42208c: +// bdead 40020003 gp = MEM_U32(sp + 64); +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t2 = t1 + t6; +a0 = MEM_U32(t2 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L4220ac; +//nop; +L4220ac: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4220b8: +t0 = 0x1000a36c; +at = 0x5; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L422128;} +//nop; +t8 = MEM_U32(sp + 340); +t9 = s0 << 2; +t4 = t8 + t9; +//nop; +a1 = 0x10003b18; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4220f0; +a1 = a1; +L4220f0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L422128;} +//nop; +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t5 = t3 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a428; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42211c; +//nop; +L42211c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L422128: +t1 = 0x1000a36c; +at = 0x6; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L4221c4;} +//nop; +t6 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x10003b20; +//nop; +t0 = t6 + t2; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422160; +a1 = a1; +L422160: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L422198;} +//nop; +t8 = MEM_U32(sp + 340); +t9 = s0 << 2; +t4 = t8 + t9; +//nop; +a1 = 0x10003b28; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42218c; +a1 = a1; +L42218c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4221c4;} +//nop; +L422198: +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t5 = t3 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a418; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4221b8; +//nop; +L4221b8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4221c4: +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10003b30; +//nop; +t2 = t1 + t6; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4221e4; +a1 = a1; +L4221e4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42221c;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L422210; +//nop; +L422210: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42221c: +t4 = 0x1000a36c; +at = 0x1; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L42a880;} +//nop; +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10003b3c; +//nop; +t5 = t3 + t7; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422254; +a1 = a1; +L422254: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t2 = t1 + t6; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L422280; +//nop; +L422280: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42228c: +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10003b50; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4222ac; +a1 = a1; +L4222ac: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L422300;} +//nop; +t4 = 0x10003b58; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4222e0; +MEM_U32(sp + 16) = zero; +L4222e0: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4222f8; +//nop; +L4222f8: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L422300: +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L4226e8;} +//nop; +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +a1 = 0x10003b80; +//nop; +t1 = t7 + t5; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422338; +a1 = a1; +L422338: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L422370;} +//nop; +t6 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t0 = t6 + t2; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L422364; +//nop; +L422364: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L422370: +t8 = MEM_U32(sp + 340); +t9 = s0 << 2; +t4 = t8 + t9; +//nop; +a1 = 0x10003b88; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422390; +a1 = a1; +L422390: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4223c8;} +//nop; +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10003b90; +//nop; +t5 = t3 + t7; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4223bc; +a1 = a1; +L4223bc: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4223f4;} +//nop; +L4223c8: +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t2 = t1 + t6; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4223e8; +//nop; +L4223e8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4223f4: +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10003b9c; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422414; +a1 = a1; +L422414: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4224f0;} +//nop; +t4 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t4; +if (at == 0) {//nop; +goto L422458;} +//nop; +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +t5 = t3 + t7; +t1 = MEM_U32(t5 + 0); +at = 0x2d; +t6 = MEM_U8(t1 + 0); +//nop; +if (t6 != at) {//nop; +goto L4224a0;} +//nop; +L422458: +t2 = 0x10003bb0; +//nop; +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L422480; +MEM_U32(sp + 16) = zero; +L422480: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L422498; +//nop; +L422498: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L4224a0: +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a1 = MEM_U32(t9 + -4); +//nop; +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4224c0; +//nop; +L4224c0: +// bdead 40020003 gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t7 = t4 + t3; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4224e4; +//nop; +L4224e4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4224f0: +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x10003be0; +//nop; +t6 = t5 + t1; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422510; +a1 = a1; +L422510: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4225ec;} +//nop; +t2 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t2; +if (at == 0) {//nop; +goto L422554;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +t4 = MEM_U32(t9 + 0); +at = 0x2d; +t3 = MEM_U8(t4 + 0); +//nop; +if (t3 != at) {//nop; +goto L42259c;} +//nop; +L422554: +t7 = 0x10003bf0; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L42257c; +MEM_U32(sp + 16) = zero; +L42257c: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L422594; +//nop; +L422594: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L42259c: +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +//nop; +t6 = t5 + t1; +a1 = MEM_U32(t6 + -4); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4225bc; +//nop; +L4225bc: +// bdead 40020003 gp = MEM_U32(sp + 64); +t2 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t8 = t2 + t0; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4225e0; +//nop; +L4225e0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4225ec: +t9 = MEM_U32(sp + 340); +t4 = s0 << 2; +t3 = t9 + t4; +//nop; +a1 = 0x10003c1c; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42260c; +a1 = a1; +L42260c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4226e8;} +//nop; +t7 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t7; +if (at == 0) {//nop; +goto L422650;} +//nop; +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +t6 = t5 + t1; +t2 = MEM_U32(t6 + 0); +at = 0x2d; +t0 = MEM_U8(t2 + 0); +//nop; +if (t0 != at) {//nop; +goto L422698;} +//nop; +L422650: +t8 = 0x10003c28; +//nop; +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L422678; +MEM_U32(sp + 16) = zero; +L422678: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L422690; +//nop; +L422690: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L422698: +t9 = MEM_U32(sp + 340); +t4 = s0 << 2; +t3 = t9 + t4; +//nop; +a1 = MEM_U32(t3 + -4); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4226b8; +//nop; +L4226b8: +// bdead 40020003 gp = MEM_U32(sp + 64); +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +//nop; +t1 = t7 + t5; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4226dc; +//nop; +L4226dc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4226e8: +t6 = MEM_U32(sp + 340); +t2 = s0 << 2; +t0 = t6 + t2; +t8 = MEM_U32(t0 + 0); +//nop; +t9 = MEM_U8(t8 + 2); +//nop; +if (t9 != 0) {//nop; +goto L4227ac;} +//nop; +t4 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t4; +if (at == 0) {//nop; +goto L422764;} +//nop; +a1 = 0x10003c50; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L422734; +a1 = a1; +L422734: +// bdead 40020003 gp = MEM_U32(sp + 64); +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t5 = t3 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L422758; +//nop; +L422758: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L422764: +t1 = 0x10003c54; +//nop; +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L42278c; +MEM_U32(sp + 16) = zero; +L42278c: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4227a4; +//nop; +L4227a4: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L4227ac: +t6 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x10003c78; +//nop; +t0 = t6 + t2; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4227cc; +a1 = a1; +L4227cc: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L422804;} +//nop; +t8 = MEM_U32(sp + 340); +t9 = s0 << 2; +t4 = t8 + t9; +//nop; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4227f8; +//nop; +L4227f8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L422804: +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10003c88; +//nop; +t5 = t3 + t7; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422824; +a1 = a1; +L422824: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x100002d8; +goto L422894;} +at = 0x100002d8; +t1 = 0x1; +MEM_U32(at + 0) = t1; +at = 0x100002e0; +t2 = MEM_U32(sp + 340); +t6 = 0x1; +t0 = s0 << 2; +//nop; +MEM_U32(at + 0) = t6; +t8 = t2 + t0; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a4d0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L422864; +//nop; +L422864: +t9 = MEM_U32(sp + 340); +// bdead 44020003 gp = MEM_U32(sp + 64); +t4 = s0 << 2; +t3 = t9 + t4; +//nop; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L422888; +//nop; +L422888: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L422894: +t7 = 0x1000a36c; +at = 0x3; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L42292c;} +//nop; +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x10003c90; +//nop; +t6 = t5 + t1; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4228cc; +a1 = a1; +L4228cc: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a170; +goto L42292c;} +at = 0x1000a170; +t0 = MEM_U32(sp + 340); +t2 = 0x1; +t8 = s0 << 2; +MEM_U32(at + 0) = t2; +t9 = t0 + t8; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L422900; +//nop; +L422900: +// bdead 40020003 gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t7 = t4 + t3; +a0 = MEM_U32(t7 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L422920; +//nop; +L422920: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42292c: +t5 = 0x1000a36c; +at = 0x3; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L42299c;} +//nop; +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10003ca0; +//nop; +t2 = t1 + t6; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422964; +a1 = a1; +L422964: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42299c;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +t9 = t0 + t8; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L422990; +//nop; +L422990: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42299c: +t4 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10003cb0; +//nop; +t7 = t4 + t3; +a0 = MEM_U32(t7 + 0); +a2 = 0x5; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L4229c0; +a1 = a1; +L4229c0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +t6 = t5 + t1; +t2 = MEM_U32(t6 + 0); +//nop; +t0 = MEM_U8(t2 + 5); +//nop; +if (t0 != 0) {at = 0x1000a248; +goto L4229fc;} +at = 0x1000a248; +t8 = 0x100; +MEM_U32(at + 0) = t8; +goto L422abc; +MEM_U32(at + 0) = t8; +L4229fc: +t9 = MEM_U32(sp + 340); +t4 = s0 << 2; +t3 = t9 + t4; +t7 = MEM_U32(t3 + 0); +t1 = 0xfb504f0; +t5 = MEM_U8(t7 + 5); +//nop; +t6 = t5 + t1; +t2 = MEM_U8(t6 + 1); +//nop; +t0 = t2 & 0x4; +if (t0 == 0) {//nop; +goto L422a74;} +//nop; +t8 = s0 << 2; +t4 = t9 + t8; +t3 = MEM_U32(t4 + 0); +//nop; +t7 = MEM_U8(t3 + 6); +//nop; +if (t7 != 0) {//nop; +goto L422a74;} +//nop; +t5 = s0 << 2; +t1 = t9 + t5; +t6 = MEM_U32(t1 + 0); +at = 0x1000a248; +t2 = MEM_U8(t6 + 5); +//nop; +t0 = t2 + 0xffffffd0; +MEM_U32(at + 0) = t0; +goto L422abc; +MEM_U32(at + 0) = t0; +L422a74: +t8 = 0x10003cb8; +//nop; +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L422a9c; +MEM_U32(sp + 16) = zero; +L422a9c: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L422ab4; +//nop; +L422ab4: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L422abc: +at = 0x100002a8; +a0 = 0x10003ce8; +//nop; +t4 = 0x1; +MEM_U32(at + 0) = t4; +a0 = a0; +v0 = wrapper_getenv(mem, a0); +goto L422ad8; +a0 = a0; +L422ad8: +// bdead 4002000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a23c; +t3 = 0x1000a23c; +MEM_U32(at + 0) = v0; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L422b6c;} +//nop; +//nop; +s2 = t3; +a0 = s2; +v0 = wrapper_strlen(mem, a0); +goto L422b0c; +a0 = s2; +L422b0c: +// bdead 400a000b gp = MEM_U32(sp + 64); +at = v0 < 0x5; +if (at != 0) {//nop; +goto L422b6c;} +//nop; +L422b1c: +a1 = 0x10003cf0; +//nop; +a0 = s2; +a2 = 0x5; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L422b34; +a1 = a1; +L422b34: +// bdead 400a000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x100002a8; +goto L422b4c;} +at = 0x100002a8; +t7 = 0x2; +MEM_U32(at + 0) = t7; +goto L422b6c; +MEM_U32(at + 0) = t7; +L422b4c: +//nop; +s2 = s2 + 0x1; +a0 = s2; +v0 = wrapper_strlen(mem, a0); +goto L422b5c; +a0 = s2; +L422b5c: +// bdead 400a000b gp = MEM_U32(sp + 64); +at = v0 < 0x5; +if (at == 0) {//nop; +goto L422b1c;} +//nop; +L422b6c: +t9 = 0x100002a8; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L422bac;} +//nop; +t5 = 0x1000a23c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L422bac;} +//nop; +t1 = 0x10003cf8; +at = 0x1000a23c; +t1 = t1; +MEM_U32(at + 0) = t1; +L422bac: +a0 = 0x10003cfc; +//nop; +a0 = a0; +//nop; +v0 = wrapper_getenv(mem, a0); +goto L422bc0; +//nop; +L422bc0: +// bdead 4002010b gp = MEM_U32(sp + 64); +a1 = 0x40040000; +at = 0x1000a240; +//nop; +a1 = a1 | 0x7477; +a0 = 0x2; +a2 = sp + 0x100; +MEM_U32(at + 0) = v0; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_ioctl(mem, a0, a1, sp); +goto L422be4; +MEM_U32(at + 0) = v0; +L422be4: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a934;} +//nop; +//nop; +//nop; +//nop; +v0 = wrapper_getpgrp(mem); +goto L422c00; +//nop; +L422c00: +t6 = MEM_U32(sp + 256); +// bdead 4002810b gp = MEM_U32(sp + 64); +if (v0 != t6) {//nop; +goto L42a934;} +//nop; +t2 = 0x1000a240; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L42a934;} +//nop; +t0 = 0x10003d04; +at = 0x100002a8; +t8 = MEM_U32(sp + 340); +t4 = s0 << 2; +t0 = t0; +MEM_U32(sp + 20) = t0; +MEM_U32(sp + 16) = zero; +MEM_U32(at + 0) = zero; +t3 = t8 + t4; +t7 = MEM_U32(t3 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t7; +f_error(mem, sp, a0, a1, a2, a3); +goto L422c6c; +MEM_U32(sp + 24) = t7; +L422c6c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L422c78: +t9 = MEM_U32(sp + 340); +t5 = s0 << 2; +t1 = t9 + t5; +//nop; +a1 = 0x10003d3c; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422c98; +a1 = a1; +L422c98: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000330; +goto L422cc4;} +at = 0x10000330; +t6 = 0x1; +MEM_U32(at + 0) = t6; +at = 0x1000032c; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10000334; +MEM_U32(at + 0) = zero; +goto L42a934; +MEM_U32(at + 0) = zero; +L422cc4: +t2 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x10003d54; +//nop; +t8 = t2 + t0; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422ce4; +a1 = a1; +L422ce4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L422d78;} +//nop; +t4 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t4; +if (at == 0) {//nop; +goto L422d30;} +//nop; +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +t9 = t3 + t7; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a550; +//nop; +f_addstr(mem, sp, a0, a1); +goto L422d24; +//nop; +L422d24: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L422d30: +t5 = 0x10003d60; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L422d58; +MEM_U32(sp + 16) = zero; +L422d58: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L422d70; +//nop; +L422d70: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L422d78: +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10003d84; +//nop; +t2 = t1 + t6; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422d98; +a1 = a1; +L422d98: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000314; +goto L422db0;} +at = 0x10000314; +t0 = 0x1; +MEM_U32(at + 0) = t0; +goto L42a934; +MEM_U32(at + 0) = t0; +L422db0: +t8 = 0x1000a36c; +at = 0x1; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L422e20;} +//nop; +t4 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10003d90; +//nop; +t7 = t4 + t3; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422de8; +a1 = a1; +L422de8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L422e20;} +//nop; +t9 = MEM_U32(sp + 340); +t5 = s0 << 2; +t1 = t9 + t5; +//nop; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L422e14; +//nop; +L422e14: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L422e20: +t6 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x10003d9c; +//nop; +t0 = t6 + t2; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422e40; +a1 = a1; +L422e40: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a198; +goto L422ec0;} +at = 0x1000a198; +t4 = 0x1000a36c; +t8 = 0x1; +t4 = MEM_U32(t4 + 0); +MEM_U32(at + 0) = t8; +at = 0x1; +if (t4 != at) {//nop; +goto L422ec0;} +//nop; +a1 = 0x10003da8; +//nop; +a0 = 0x1000a2b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L422e7c; +a1 = a1; +L422e7c: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10003db4; +//nop; +a0 = 0x1000a2c0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L422e98; +a1 = a1; +L422e98: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10003dc0; +//nop; +a0 = 0x1000a2c0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L422eb4; +a1 = a1; +L422eb4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L422ec0: +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +t9 = t3 + t7; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10003dcc; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422ee0; +a1 = a1; +L422ee0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L422fb8;} +//nop; +t5 = 0x1000a36c; +at = 0x1; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L422f30;} +//nop; +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t2 = t1 + t6; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a310; +//nop; +f_addstr(mem, sp, a0, a1); +goto L422f24; +//nop; +L422f24: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L422f30: +t0 = 0x1000a36c; +at = 0x2; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L422f74;} +//nop; +t8 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t3 = t8 + t4; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a320; +//nop; +f_addstr(mem, sp, a0, a1); +goto L422f68; +//nop; +L422f68: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L422f74: +t7 = 0x1000a36c; +at = 0x3; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L42a880;} +//nop; +t9 = MEM_U32(sp + 340); +t5 = s0 << 2; +t1 = t9 + t5; +//nop; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L422fac; +//nop; +L422fac: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L422fb8: +t6 = 0x1000a36c; +at = 0x1; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L423054;} +//nop; +t2 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x10003ddc; +//nop; +t8 = t2 + t0; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L422ff0; +a1 = a1; +L422ff0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L423054;} +//nop; +a1 = 0x10003de4; +//nop; +a0 = 0x1000a5d0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L423010; +a1 = a1; +L423010: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10003dec; +//nop; +a0 = 0x1000a5e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L42302c; +a1 = a1; +L42302c: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10003df4; +//nop; +a0 = 0x1000a310; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L423048; +a1 = a1; +L423048: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L423054: +t4 = 0x1000a36c; +at = 0x4; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == at) {at = 0x2; +goto L423074;} +at = 0x2; +if (t4 != at) {//nop; +goto L4230a0;} +//nop; +L423074: +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +t9 = t3 + t7; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10003dfc; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423094; +a1 = a1; +L423094: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +L4230a0: +t5 = 0x1000a36c; +at = 0x6; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L423238;} +//nop; +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10003e04; +//nop; +t2 = t1 + t6; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4230d8; +a1 = a1; +L4230d8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L423110;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t4 = t0 + t8; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a418; +//nop; +f_addstr(mem, sp, a0, a1); +goto L423104; +//nop; +L423104: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L423110: +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +t9 = t3 + t7; +t5 = MEM_U32(t9 + 0); +//nop; +t1 = MEM_U8(t5 + 2); +//nop; +if (t1 != 0) {//nop; +goto L42a880;} +//nop; +t6 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t6; +if (at == 0) {//nop; +goto L4231f0;} +//nop; +a1 = 0x10003e0c; +//nop; +a0 = 0x1000a418; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L42315c; +a1 = a1; +L42315c: +t2 = MEM_U32(sp + 340); +t0 = s0 << 2; +t8 = t2 + t0; +t4 = MEM_U32(t8 + 0); +// bdead 40022803 gp = MEM_U32(sp + 64); +t3 = MEM_U8(t4 + 1); +//nop; +if (t3 != 0) {//nop; +goto L4231f0;} +//nop; +t7 = s0 << 2; +t9 = t2 + t7; +t5 = MEM_U32(t9 + 0); +//nop; +t1 = MEM_U8(t5 + 0); +//nop; +at = (int)t1 < (int)0x31; +if (at != 0) {//nop; +goto L4231f0;} +//nop; +t6 = s0 << 2; +t0 = t2 + t6; +t8 = MEM_U32(t0 + 0); +//nop; +t4 = MEM_U8(t8 + 0); +//nop; +at = (int)t4 < (int)0x35; +if (at == 0) {//nop; +goto L4231f0;} +//nop; +t3 = s0 << 2; +//nop; +t7 = t2 + t3; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a418; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4231e4; +//nop; +L4231e4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4231f0: +t9 = 0x10003e10; +a0 = 0x1; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L423218; +MEM_U32(sp + 16) = zero; +L423218: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L423230; +//nop; +L423230: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L423238: +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +t6 = t5 + t1; +t0 = MEM_U32(t6 + 0); +//nop; +t8 = MEM_U8(t0 + 2); +//nop; +if (t8 != 0) {//nop; +goto L42a880;} +//nop; +t4 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t4; +if (at == 0) {//nop; +goto L4232b4;} +//nop; +a1 = 0x10003e3c; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L423284; +a1 = a1; +L423284: +// bdead 40020003 gp = MEM_U32(sp + 64); +t2 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t7 = t2 + t3; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4232a8; +//nop; +L4232a8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4232b4: +t9 = 0x10003e40; +a0 = 0x1; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4232dc; +MEM_U32(sp + 16) = zero; +L4232dc: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4232f4; +//nop; +L4232f4: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L42a880; +//nop; +L423300: +at = 0x1000a128; +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +MEM_U32(at + 0) = zero; +t6 = t5 + t1; +t0 = MEM_U32(t6 + 0); +//nop; +t8 = MEM_U8(t0 + 2); +//nop; +if (t8 != 0) {at = 0x1000021c; +goto L42335c;} +at = 0x1000021c; +t3 = 0x1000a12c; +t4 = 0x2; +MEM_U32(at + 0) = t4; +at = 0x1000a128; +t3 = MEM_U32(t3 + 0); +t2 = 0x1; +if (t3 == 0) {MEM_U32(at + 0) = t2; +goto L42a934;} +MEM_U32(at + 0) = t2; +at = 0x10000230; +t7 = 0x1; +MEM_U32(at + 0) = t7; +goto L42a934; +MEM_U32(at + 0) = t7; +L42335c: +t9 = MEM_U32(sp + 340); +t5 = s0 << 2; +t1 = t9 + t5; +t6 = MEM_U32(t1 + 0); +//nop; +t0 = MEM_U8(t6 + 3); +//nop; +if (t0 != 0) {//nop; +goto L42a880;} +//nop; +t8 = s0 << 2; +t4 = t9 + t8; +t2 = MEM_U32(t4 + 0); +//nop; +t3 = MEM_U8(t2 + 2); +//nop; +at = (int)t3 < (int)0x30; +if (at != 0) {//nop; +goto L42a880;} +//nop; +t7 = s0 << 2; +t5 = t9 + t7; +t1 = MEM_U32(t5 + 0); +//nop; +t6 = MEM_U8(t1 + 2); +//nop; +at = (int)t6 < (int)0x34; +if (at == 0) {//nop; +goto L42a880;} +//nop; +t0 = s0 << 2; +t8 = t9 + t0; +t4 = MEM_U32(t8 + 0); +at = 0x1000021c; +t2 = MEM_U8(t4 + 2); +//nop; +t3 = t2 + 0xffffffd0; +MEM_U32(at + 0) = t3; +at = 0x2; +if (t3 != at) {//nop; +goto L42a934;} +//nop; +t5 = 0x1000a12c; +at = 0x1000a128; +t5 = MEM_U32(t5 + 0); +t7 = 0x1; +if (t5 == 0) {MEM_U32(at + 0) = t7; +goto L42a934;} +MEM_U32(at + 0) = t7; +at = 0x10000230; +t1 = 0x1; +MEM_U32(at + 0) = t1; +goto L42a934; +MEM_U32(at + 0) = t1; +L42341c: +t6 = MEM_U32(sp + 340); +t9 = s0 << 2; +t0 = t6 + t9; +//nop; +a1 = 0x10003e64; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42343c; +a1 = a1; +L42343c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L423474;} +//nop; +t8 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t2 = t8 + t4; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a4a0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L423468; +//nop; +L423468: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L423474: +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10003e70; +//nop; +t5 = t3 + t7; +a0 = MEM_U32(t5 + 0); +a2 = 0x5; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L423498; +a1 = a1; +L423498: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4234d8;} +//nop; +t1 = 0x10003e78; +//nop; +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4234cc; +MEM_U32(sp + 16) = zero; +L4234cc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4234d8: +t6 = 0x1000a36c; +at = 0x1; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L423740;} +//nop; +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t8 = t9 + t0; +//nop; +a1 = 0x10003e8c; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423510; +a1 = a1; +L423510: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L423548;} +//nop; +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t3 = t4 + t2; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42353c; +//nop; +L42353c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L423548: +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +a1 = 0x10003e94; +//nop; +t1 = t7 + t5; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423568; +a1 = a1; +L423568: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L423644;} +//nop; +t6 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t6; +if (at == 0) {//nop; +goto L4235ac;} +//nop; +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t8 = t9 + t0; +t4 = MEM_U32(t8 + 0); +at = 0x2d; +t2 = MEM_U8(t4 + 0); +//nop; +if (t2 != at) {//nop; +goto L4235f4;} +//nop; +L4235ac: +t3 = 0x10003ea4; +//nop; +t3 = t3; +MEM_U32(sp + 20) = t3; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4235d4; +MEM_U32(sp + 16) = zero; +L4235d4: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4235ec; +//nop; +L4235ec: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L4235f4: +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +//nop; +t1 = t7 + t5; +a1 = MEM_U32(t1 + -4); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L423614; +//nop; +L423614: +t6 = MEM_U32(sp + 340); +// bdead 40028003 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t0 = t6 + t9; +//nop; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L423638; +//nop; +L423638: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L423644: +t8 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x10003ed0; +//nop; +t2 = t8 + t4; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423664; +a1 = a1; +L423664: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L423740;} +//nop; +t3 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t3; +if (at == 0) {//nop; +goto L4236a8;} +//nop; +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +t1 = t7 + t5; +t6 = MEM_U32(t1 + 0); +at = 0x2d; +t9 = MEM_U8(t6 + 0); +//nop; +if (t9 != at) {//nop; +goto L4236f0;} +//nop; +L4236a8: +t0 = 0x10003edc; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4236d0; +MEM_U32(sp + 16) = zero; +L4236d0: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4236e8; +//nop; +L4236e8: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L4236f0: +t8 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t2 = t8 + t4; +a1 = MEM_U32(t2 + -4); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L423710; +//nop; +L423710: +// bdead 40020003 gp = MEM_U32(sp + 64); +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t5 = t3 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L423734; +//nop; +L423734: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L423740: +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +t9 = t1 + t6; +t0 = MEM_U32(t9 + 0); +at = 0x1000a1b0; +//nop; +t8 = t0 + 0x2; +a0 = t8; +MEM_U32(at + 0) = t8; +v0 = wrapper_strlen(mem, a0); +goto L423768; +MEM_U32(at + 0) = t8; +L423768: +// bdead 4002010b gp = MEM_U32(sp + 64); +at = 0x2f; +t4 = 0x1000a1b0; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +t2 = v0 + t4; +t3 = MEM_U8(t2 + -1); +//nop; +if (t3 == at) {//nop; +goto L42a934;} +//nop; +a1 = 0x10003f08; +//nop; +a0 = t4; +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4237ac; +a1 = a1; +L4237ac: +// bdead 4002010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a1b0; +MEM_U32(at + 0) = v0; +goto L42a934; +MEM_U32(at + 0) = v0; +L4237c0: +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +t1 = t7 + t5; +t6 = MEM_U32(t1 + 0); +//nop; +t9 = MEM_U8(t6 + 2); +//nop; +if (t9 != 0) {//nop; +goto L423884;} +//nop; +t0 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t0; +if (at == 0) {//nop; +goto L42383c;} +//nop; +a1 = 0x10003f0c; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L42380c; +a1 = a1; +L42380c: +// bdead 40020003 gp = MEM_U32(sp + 64); +t8 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t3 = t8 + t2; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L423830; +//nop; +L423830: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42383c: +t4 = 0x10003f10; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L423864; +MEM_U32(sp + 16) = zero; +L423864: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L42387c; +//nop; +L42387c: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L423884: +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +a1 = 0x10003f34; +//nop; +t1 = t7 + t5; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4238a4; +a1 = a1; +L4238a4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L423a0c;} +//nop; +t6 = MEM_U32(sp + 340); +t9 = s0 << 2; +t0 = t6 + t9; +//nop; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a470; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4238d0; +//nop; +L4238d0: +t8 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +// bdead 42020003 gp = MEM_U32(sp + 64); +at = (int)s0 < (int)t8; +if (at != 0) {//nop; +goto L423930;} +//nop; +t2 = 0x10003f40; +//nop; +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L423910; +MEM_U32(sp + 16) = zero; +L423910: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L423928; +//nop; +L423928: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L423930: +s2 = 0x10000400; +//nop; +s2 = MEM_U32(s2 + 0); +//nop; +t3 = MEM_U8(s2 + 0); +//nop; +if (t3 == 0) {//nop; +goto L4239e0;} +//nop; +L423950: +t4 = MEM_U8(s2 + 0); +t7 = 0xfb504f0; +//nop; +t5 = t4 + t7; +t1 = MEM_U8(t5 + 1); +//nop; +t6 = t1 & 0x4; +if (t6 != 0) {//nop; +goto L4239d0;} +//nop; +t9 = 0x10003f64; +t0 = MEM_U32(sp + 340); +t9 = t9; +MEM_U32(sp + 20) = t9; +t8 = s0 << 2; +MEM_U32(sp + 16) = zero; +t2 = t0 + t8; +t3 = MEM_U32(t2 + 0); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L4239b0; +MEM_U32(sp + 24) = t3; +L4239b0: +// bdead 400a0003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4239c8; +//nop; +L4239c8: +// bdead 400a0003 gp = MEM_U32(sp + 64); +//nop; +L4239d0: +t4 = MEM_U8(s2 + 1); +s2 = s2 + 0x1; +if (t4 != 0) {//nop; +goto L423950;} +//nop; +L4239e0: +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +//nop; +t1 = t7 + t5; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a470; +//nop; +f_addstr(mem, sp, a0, a1); +goto L423a00; +//nop; +L423a00: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L423a0c: +t6 = MEM_U32(sp + 340); +t9 = s0 << 2; +t0 = t6 + t9; +//nop; +a1 = 0x10003f84; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423a2c; +a1 = a1; +L423a2c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x100002f8; +goto L423a44;} +at = 0x100002f8; +t8 = 0x1; +MEM_U32(at + 0) = t8; +goto L42a934; +MEM_U32(at + 0) = t8; +L423a44: +t2 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10003f98; +//nop; +t4 = t2 + t3; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423a64; +a1 = a1; +L423a64: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L423a9c;} +//nop; +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +//nop; +t1 = t7 + t5; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L423a90; +//nop; +L423a90: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L423a9c: +t6 = MEM_U32(sp + 340); +t9 = s0 << 2; +t0 = t6 + t9; +//nop; +a1 = 0x10003fa8; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423abc; +a1 = a1; +L423abc: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000424; +goto L423b8c;} +at = 0x10000424; +t8 = 0x1; +t2 = 0x10003fb0; +MEM_U32(at + 0) = t8; +at = 0x1000a26c; +t2 = t2; +t3 = 0x10003fbc; +MEM_U32(at + 0) = t2; +at = 0x10000400; +t3 = t3; +t4 = 0x10003fc0; +MEM_U32(at + 0) = t3; +at = 0x1000a27c; +t4 = t4; +MEM_U32(at + 0) = t4; +at = 0x100002d8; +a0 = 0x10003fc4; +MEM_U32(at + 0) = zero; +at = 0x10000370; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10000340; +a1 = zero; +MEM_U32(at + 0) = zero; +at = 0x10000384; +a2 = zero; +MEM_U32(at + 0) = zero; +at = 0x10000348; +a0 = a0; +MEM_U32(at + 0) = zero; +at = 0x10000324; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10000318; +//nop; +MEM_U32(at + 0) = zero; +at = 0x100003e0; +MEM_U32(at + 0) = zero; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L423b60; +MEM_U32(at + 0) = zero; +L423b60: +// bdead 40020003 gp = MEM_U32(sp + 64); +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +//nop; +t1 = t7 + t5; +a0 = MEM_U32(t1 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L423b80; +//nop; +L423b80: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L423b8c: +t6 = 0x1000a36c; +at = 0x3; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L423bfc;} +//nop; +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t8 = t9 + t0; +//nop; +a1 = 0x10003fd8; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423bc4; +a1 = a1; +L423bc4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L423c28;} +//nop; +t2 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10003fdc; +//nop; +t4 = t2 + t3; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423bf0; +a1 = a1; +L423bf0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L423c28;} +//nop; +L423bfc: +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +a1 = 0x10003fe0; +//nop; +t1 = t7 + t5; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423c1c; +a1 = a1; +L423c1c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L423ca0;} +//nop; +L423c28: +t6 = MEM_U32(sp + 340); +t9 = s0 << 2; +t0 = t6 + t9; +t8 = MEM_U32(t0 + 0); +at = 0x32; +t2 = MEM_U8(t8 + 2); +//nop; +if (t2 == at) {//nop; +goto L423c68;} +//nop; +t3 = s0 << 2; +t4 = t6 + t3; +t7 = MEM_U32(t4 + 0); +at = 0x38; +t5 = MEM_U8(t7 + 2); +//nop; +if (t5 != at) {at = 0x1000a168; +goto L423c74;} +L423c68: +at = 0x1000a168; +t1 = 0x1; +MEM_U32(at + 0) = t1; +L423c74: +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t8 = t9 + t0; +//nop; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L423c94; +//nop; +L423c94: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L423ca0: +t2 = 0x1000a36c; +at = 0x5; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L42a880;} +//nop; +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10003fe4; +//nop; +t4 = t6 + t3; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423cd8; +a1 = a1; +L423cd8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L423d84;} +//nop; +t7 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t7; +if (at == 0) {//nop; +goto L423d3c;} +//nop; +a1 = 0x10003fec; +//nop; +a0 = 0x1000a408; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L423d0c; +a1 = a1; +L423d0c: +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +// bdead 40024403 gp = MEM_U32(sp + 64); +t9 = t5 + t1; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a408; +//nop; +f_addstr(mem, sp, a0, a1); +goto L423d30; +//nop; +L423d30: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L423d3c: +t0 = 0x10003ff4; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L423d64; +MEM_U32(sp + 16) = zero; +L423d64: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L423d7c; +//nop; +L423d7c: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L423d84: +t8 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x10004014; +//nop; +t6 = t8 + t2; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423da4; +a1 = a1; +L423da4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t3 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t3; +if (at == 0) {//nop; +goto L423e08;} +//nop; +a1 = 0x10004020; +//nop; +a0 = 0x1000a408; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L423dd8; +a1 = a1; +L423dd8: +// bdead 40020003 gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t5 = t4 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a408; +//nop; +f_addstr(mem, sp, a0, a1); +goto L423dfc; +//nop; +L423dfc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L423e08: +t1 = 0x1000402c; +//nop; +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L423e30; +MEM_U32(sp + 16) = zero; +L423e30: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L423e48; +//nop; +L423e48: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L42a880; +//nop; +L423e54: +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t8 = t9 + t0; +t2 = MEM_U32(t8 + 0); +//nop; +t6 = MEM_U8(t2 + 2); +//nop; +if (t6 != 0) {//nop; +goto L423e9c;} +//nop; +t3 = 0x10000224; +at = 0x10000224; +t3 = MEM_U32(t3 + 0); +//nop; +t4 = t3 + 0x1; +MEM_U32(at + 0) = t4; +at = 0x10000408; +MEM_U32(at + 0) = zero; +goto L42a934; +MEM_U32(at + 0) = zero; +L423e9c: +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +a1 = 0x1000404c; +//nop; +t1 = t7 + t5; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423ebc; +a1 = a1; +L423ebc: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L423ef4;} +//nop; +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t8 = t9 + t0; +//nop; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a4c0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L423ee8; +//nop; +L423ee8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L423ef4: +t2 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10004054; +//nop; +t3 = t2 + t6; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423f14; +a1 = a1; +L423f14: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t4 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t5 = t4 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L423f40; +//nop; +L423f40: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L423f4c: +t1 = MEM_U32(sp + 340); +t9 = s0 << 2; +t0 = t1 + t9; +//nop; +a1 = 0x1000405c; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L423f6c; +a1 = a1; +L423f6c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x100002d0; +goto L423f84;} +at = 0x100002d0; +t8 = 0x1; +MEM_U32(at + 0) = t8; +goto L42a934; +MEM_U32(at + 0) = t8; +L423f84: +t2 = MEM_U32(sp + 340); +t6 = s0 << 2; +t3 = t2 + t6; +t4 = MEM_U32(t3 + 0); +at = 0x6f; +s4 = MEM_U8(t4 + 2); +//nop; +if (s4 == at) {at = 0x70; +goto L423fc0;} +at = 0x70; +if (s4 == at) {at = 0x75; +goto L4240b4;} +at = 0x75; +if (s4 == at) {//nop; +goto L42410c;} +//nop; +//nop; +goto L424164; +//nop; +L423fc0: +t7 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t7; +if (at == 0) {//nop; +goto L42a934;} +//nop; +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +t9 = t5 + t1; +t0 = MEM_U32(t9 + 0); +at = 0x1000a214; +//nop; +a0 = t0; +MEM_U32(at + 0) = t0; +v0 = f_getsuf(mem, sp, a0); +goto L423ff8; +MEM_U32(at + 0) = t0; +L423ff8: +// bdead 4002010b gp = MEM_U32(sp + 64); +s1 = v0 & 0xff; +at = 0x63; +if (s1 == at) {at = 0x70; +goto L424054;} +at = 0x70; +if (s1 == at) {at = 0x66; +goto L424054;} +at = 0x66; +if (s1 == at) {at = 0x46; +goto L424054;} +at = 0x46; +if (s1 == at) {at = 0x72; +goto L424054;} +at = 0x72; +if (s1 == at) {at = 0x65; +goto L424054;} +at = 0x65; +if (s1 == at) {at = 0x6; +goto L424054;} +at = 0x6; +if (s1 == at) {at = 0x73; +goto L424054;} +at = 0x73; +if (s1 == at) {at = 0x1; +goto L424054;} +at = 0x1; +if (s1 == at) {at = 0x2; +goto L424054;} +at = 0x2; +if (s1 != at) {//nop; +goto L42a934;} +//nop; +L424054: +t8 = 0x10004068; +t2 = MEM_U32(sp + 340); +t6 = s0 << 2; +t8 = t8; +MEM_U32(sp + 20) = t8; +MEM_U32(sp + 16) = zero; +t3 = t2 + t6; +t4 = MEM_U32(t3 + 0); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t4; +f_error(mem, sp, a0, a1, a2, a3); +goto L424090; +MEM_U32(sp + 24) = t4; +L424090: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4240a8; +//nop; +L4240a8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4240b4: +t7 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t7; +if (at == 0) {//nop; +goto L42a934;} +//nop; +a1 = 0x10004080; +//nop; +a0 = 0x1000a448; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4240dc; +a1 = a1; +L4240dc: +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +// bdead 40024403 gp = MEM_U32(sp + 64); +t9 = t5 + t1; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a448; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424100; +//nop; +L424100: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42410c: +t0 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t0; +if (at == 0) {//nop; +goto L42a934;} +//nop; +a1 = 0x10004084; +//nop; +a0 = 0x1000a448; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L424134; +a1 = a1; +L424134: +// bdead 40020003 gp = MEM_U32(sp + 64); +t8 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t6 = t8 + t2; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a448; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424158; +//nop; +L424158: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L424164: +t3 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t7 = t3 + t4; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a530; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424184; +//nop; +L424184: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L424190: +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +t9 = t5 + t1; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x10004088; +a1 = a1 + 0x2; +a0 = a0; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4241b4; +a0 = a0; +L4241b4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4241ec;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t2 = t0 + t8; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4241e0; +//nop; +L4241e0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4241ec: +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +t4 = t6 + t3; +t7 = MEM_U32(t4 + 0); +at = 0x6d; +t5 = MEM_U8(t7 + 2); +//nop; +if (t5 != at) {//nop; +goto L424248;} +//nop; +t1 = s0 << 2; +t9 = t6 + t1; +t0 = MEM_U32(t9 + 0); +//nop; +t8 = MEM_U8(t0 + 3); +//nop; +if (t8 != 0) {//nop; +goto L424248;} +//nop; +t2 = 0x10000390; +at = 0x10000390; +t2 = MEM_U32(t2 + 0); +//nop; +t3 = t2 + 0x1; +MEM_U32(at + 0) = t3; +L424248: +t4 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t5 = t4 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424268; +//nop; +L424268: +t6 = MEM_U32(sp + 340); +// bdead 40028003 gp = MEM_U32(sp + 64); +t1 = s0 << 2; +t9 = t6 + t1; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10004090; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42428c; +a1 = a1; +L42428c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4242c8;} +//nop; +t0 = 0x1000a56c; +at = 0x1000a56c; +t0 = MEM_U32(t0 + 0); +a1 = 0x10004098; +//nop; +a0 = 0x1000a540; +t8 = t0 + 0x1; +MEM_U32(at + 0) = t8; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4242c0; +a1 = a1; +L4242c0: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L4242c8: +t2 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x100040a0; +//nop; +t4 = t2 + t3; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4242e8; +a1 = a1; +L4242e8: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a934;} +//nop; +t7 = 0x1000a570; +at = 0x1000a570; +t7 = MEM_U32(t7 + 0); +//nop; +t5 = t7 + 0x1; +MEM_U32(at + 0) = t5; +goto L42a934; +MEM_U32(at + 0) = t5; +L424310: +t6 = 0x1000a36c; +at = 0x1; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L4243ec;} +//nop; +t1 = MEM_U32(sp + 340); +t9 = s0 << 2; +t0 = t1 + t9; +//nop; +a1 = 0x100040a8; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L424348; +a1 = a1; +L424348: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4243ec;} +//nop; +t8 = 0x1000a188; +at = 0x10000; +t8 = MEM_U32(t8 + 0); +t3 = 0x1000027c; +at = at | 0x8; +t2 = t8 | at; +at = 0x1000a188; +t3 = MEM_U32(t3 + 0); +MEM_U32(at + 0) = t2; +if (t3 == 0) {//nop; +goto L4243c8;} +//nop; +t4 = 0x100040ac; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4243a8; +MEM_U32(sp + 16) = zero; +L4243a8: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4243c0; +//nop; +L4243c0: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L4243c8: +a0 = 0x100040d0; +//nop; +a1 = zero; +a2 = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L4243e0; +a0 = a0; +L4243e0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4243ec: +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +t6 = t7 + t5; +t1 = MEM_U32(t6 + 0); +//nop; +t9 = MEM_U8(t1 + 2); +//nop; +if (t9 != 0) {//nop; +goto L4244b8;} +//nop; +t0 = 0x1000a36c; +at = 0x4; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == at) {at = 0x3; +goto L424430;} +at = 0x3; +if (t0 != at) {//nop; +goto L42444c;} +//nop; +L424430: +t8 = 0x10000268; +at = 0x10000268; +t8 = MEM_U32(t8 + 0); +//nop; +t2 = t8 + 0x1; +MEM_U32(at + 0) = t2; +goto L424474; +MEM_U32(at + 0) = t2; +L42444c: +t3 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t7 = t3 + t4; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42446c; +//nop; +L42446c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L424474: +t5 = 0x1000a36c; +at = 0x3; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L42a934;} +//nop; +t6 = MEM_U32(sp + 340); +t1 = s0 << 2; +t9 = t6 + t1; +a0 = MEM_U32(t9 + 0); +//nop; +//nop; +//nop; +f_add_static_opt(mem, sp, a0); +goto L4244ac; +//nop; +L4244ac: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4244b8: +t0 = 0x1000a36c; +at = 0x6; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L424580;} +//nop; +t8 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x100040d4; +//nop; +t3 = t8 + t2; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4244f0; +a1 = a1; +L4244f0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L424528;} +//nop; +t4 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t5 = t4 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a418; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42451c; +//nop; +L42451c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L424528: +t6 = MEM_U32(sp + 340); +t1 = s0 << 2; +t9 = t6 + t1; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x100040dc; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L424548; +a1 = a1; +L424548: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L424580;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t2 = t0 + t8; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a418; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424574; +//nop; +L424574: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L424580: +t3 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x100040e4; +//nop; +t7 = t3 + t4; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4245a0; +a1 = a1; +L4245a0: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42461c;} +//nop; +t5 = 0x10000304; +at = 0x10000414; +t5 = MEM_U32(t5 + 0); +MEM_U32(at + 0) = zero; +if (t5 == 0) {//nop; +goto L42460c;} +//nop; +t6 = 0x100040ec; +//nop; +t6 = t6; +MEM_U32(sp + 20) = t6; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4245ec; +MEM_U32(sp + 16) = zero; +L4245ec: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L424604; +//nop; +L424604: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L42460c: +at = 0x100002e8; +t1 = 0x1; +MEM_U32(at + 0) = t1; +goto L42a934; +MEM_U32(at + 0) = t1; +L42461c: +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t8 = t9 + t0; +//nop; +a1 = 0x10004110; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42463c; +a1 = a1; +L42463c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x100002ec; +goto L42494c;} +at = 0x100002ec; +t3 = 0x100002e8; +MEM_U32(at + 0) = zero; +at = 0x100002f0; +t3 = MEM_U32(t3 + 0); +t2 = 0x1; +if (t3 != 0) {MEM_U32(at + 0) = t2; +goto L42467c;} +MEM_U32(at + 0) = t2; +t4 = 0x100002f4; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L4246c4;} +//nop; +L42467c: +t7 = 0x10004118; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4246a4; +MEM_U32(sp + 16) = zero; +L4246a4: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4246bc; +//nop; +L4246bc: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L4246c4: +a0 = 0x1000413c; +//nop; +a1 = zero; +a2 = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L4246dc; +a0 = a0; +L4246dc: +// bdead 40020003 gp = MEM_U32(sp + 64); +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t1 = t5 + t6; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a310; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424700; +//nop; +L424700: +t9 = MEM_U32(sp + 340); +// bdead 44020003 gp = MEM_U32(sp + 64); +t0 = s0 << 2; +t8 = t9 + t0; +//nop; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a320; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424724; +//nop; +L424724: +// bdead 40020003 gp = MEM_U32(sp + 64); +t2 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t4 = t2 + t3; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424748; +//nop; +L424748: +// bdead 40020003 gp = MEM_U32(sp + 64); +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +//nop; +t6 = t7 + t5; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a408; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42476c; +//nop; +L42476c: +t1 = MEM_U32(sp + 340); +// bdead 40020403 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t0 = t1 + t9; +//nop; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a418; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424790; +//nop; +L424790: +// bdead 40020003 gp = MEM_U32(sp + 64); +t8 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t3 = t8 + t2; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a428; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4247b4; +//nop; +L4247b4: +// bdead 40020003 gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t5 = t4 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a360; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4247d8; +//nop; +L4247d8: +t6 = MEM_U32(sp + 340); +t1 = s0 << 2; +// bdead 40028403 gp = MEM_U32(sp + 64); +t9 = t6 + t1; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a370; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4247fc; +//nop; +L4247fc: +// bdead 40020003 gp = MEM_U32(sp + 64); +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t2 = t0 + t8; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a438; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424820; +//nop; +L424820: +// bdead 40020003 gp = MEM_U32(sp + 64); +t3 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t7 = t3 + t4; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a460; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424844; +//nop; +L424844: +// bdead 40020003 gp = MEM_U32(sp + 64); +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t1 = t5 + t6; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a470; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424868; +//nop; +L424868: +t9 = MEM_U32(sp + 340); +// bdead 44020003 gp = MEM_U32(sp + 64); +t0 = s0 << 2; +t8 = t9 + t0; +//nop; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a480; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42488c; +//nop; +L42488c: +// bdead 40020003 gp = MEM_U32(sp + 64); +t2 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t4 = t2 + t3; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a4b0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4248b0; +//nop; +L4248b0: +// bdead 40020003 gp = MEM_U32(sp + 64); +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +//nop; +t6 = t7 + t5; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a4c0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4248d4; +//nop; +L4248d4: +t1 = MEM_U32(sp + 340); +// bdead 40020403 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t0 = t1 + t9; +//nop; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a4d0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4248f8; +//nop; +L4248f8: +// bdead 40020003 gp = MEM_U32(sp + 64); +t8 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t3 = t8 + t2; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42491c; +//nop; +L42491c: +// bdead 40020003 gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t5 = t4 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a500; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424940; +//nop; +L424940: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42494c: +t6 = MEM_U32(sp + 340); +t1 = s0 << 2; +t9 = t6 + t1; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10004140; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42496c; +a1 = a1; +L42496c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L424d2c;} +//nop; +t0 = 0x100002e8; +at = 0x100002ec; +t0 = MEM_U32(t0 + 0); +MEM_U32(at + 0) = zero; +if (t0 != 0) {//nop; +goto L4249a8;} +//nop; +t8 = 0x100002f0; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L4249f0;} +//nop; +L4249a8: +t2 = 0x10004148; +//nop; +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4249d0; +MEM_U32(sp + 16) = zero; +L4249d0: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4249e8; +//nop; +L4249e8: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L4249f0: +t3 = 0x1000a36c; +at = 0x4; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == at) {at = 0x1; +goto L424a10;} +at = 0x1; +if (t3 != at) {//nop; +goto L424a44;} +//nop; +L424a10: +t4 = 0x1000416c; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L424a38; +MEM_U32(sp + 16) = zero; +L424a38: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L424a8c; +//nop; +L424a44: +t7 = 0x100041a4; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L424a6c; +MEM_U32(sp + 16) = zero; +L424a6c: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L424a84; +//nop; +L424a84: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L424a8c: +at = 0x10000414; +t5 = 0x2; +MEM_U32(at + 0) = t5; +at = 0x100002f4; +t6 = 0x1; +MEM_U32(at + 0) = t6; +at = 0x10000304; +a0 = 0x100041d8; +//nop; +t1 = 0x1; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t1; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L424ac8; +a0 = a0; +L424ac8: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +t9 = 0x1000031c; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L424b2c;} +//nop; +a1 = 0x100041dc; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L424afc; +a1 = a1; +L424afc: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x100041e8; +//nop; +a0 = 0x1000a2c0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L424b18; +a1 = a1; +L424b18: +// bdead 40020003 gp = MEM_U32(sp + 64); +t0 = 0x1; +at = 0x1000031c; +//nop; +MEM_U32(at + 0) = t0; +L424b2c: +t8 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t3 = t8 + t2; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a310; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424b4c; +//nop; +L424b4c: +// bdead 40020003 gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t5 = t4 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a320; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424b70; +//nop; +L424b70: +t6 = MEM_U32(sp + 340); +t1 = s0 << 2; +// bdead 40028403 gp = MEM_U32(sp + 64); +t9 = t6 + t1; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424b94; +//nop; +L424b94: +// bdead 40020003 gp = MEM_U32(sp + 64); +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t2 = t0 + t8; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a408; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424bb8; +//nop; +L424bb8: +// bdead 40020003 gp = MEM_U32(sp + 64); +t3 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t7 = t3 + t4; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a418; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424bdc; +//nop; +L424bdc: +// bdead 40020003 gp = MEM_U32(sp + 64); +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t1 = t5 + t6; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a428; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424c00; +//nop; +L424c00: +t9 = MEM_U32(sp + 340); +// bdead 44020003 gp = MEM_U32(sp + 64); +t0 = s0 << 2; +t8 = t9 + t0; +//nop; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a360; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424c24; +//nop; +L424c24: +// bdead 40020003 gp = MEM_U32(sp + 64); +t2 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t4 = t2 + t3; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a370; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424c48; +//nop; +L424c48: +// bdead 40020003 gp = MEM_U32(sp + 64); +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +//nop; +t6 = t7 + t5; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a4a0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424c6c; +//nop; +L424c6c: +t1 = MEM_U32(sp + 340); +// bdead 40020403 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t0 = t1 + t9; +//nop; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a4b0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424c90; +//nop; +L424c90: +// bdead 40020003 gp = MEM_U32(sp + 64); +t8 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t3 = t8 + t2; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a4c0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424cb4; +//nop; +L424cb4: +// bdead 40020003 gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t5 = t4 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a4d0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424cd8; +//nop; +L424cd8: +t6 = MEM_U32(sp + 340); +t1 = s0 << 2; +// bdead 40028403 gp = MEM_U32(sp + 64); +t9 = t6 + t1; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424cfc; +//nop; +L424cfc: +// bdead 40020003 gp = MEM_U32(sp + 64); +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t2 = t0 + t8; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a500; +//nop; +f_addstr(mem, sp, a0, a1); +goto L424d20; +//nop; +L424d20: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L424d2c: +t3 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x100041f4; +//nop; +t7 = t3 + t4; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L424d4c; +a1 = a1; +L424d4c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L424da0;} +//nop; +t5 = 0x100041fc; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L424d80; +MEM_U32(sp + 16) = zero; +L424d80: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L424d98; +//nop; +L424d98: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L424da0: +t6 = 0x1000a36c; +at = 0x3; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L42a880;} +//nop; +t1 = MEM_U32(sp + 340); +t9 = s0 << 2; +t0 = t1 + t9; +t8 = MEM_U32(t0 + 0); +at = 0x70; +t2 = MEM_U8(t8 + 2); +//nop; +if (t2 != at) {//nop; +goto L424e1c;} +//nop; +t3 = s0 << 2; +t4 = t1 + t3; +t7 = MEM_U32(t4 + 0); +//nop; +t5 = MEM_U8(t7 + 3); +//nop; +if (t5 != 0) {//nop; +goto L424e1c;} +//nop; +t6 = 0x1000a150; +at = 0x10000; +t6 = MEM_U32(t6 + 0); +//nop; +t9 = t6 | at; +at = 0x1000a150; +MEM_U32(at + 0) = t9; +goto L42a934; +MEM_U32(at + 0) = t9; +L424e1c: +a0 = 0x1000423c; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L424e30; +//nop; +L424e30: +// bdead 4002000b gp = MEM_U32(sp + 64); +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +a1 = 0x10004230; +//nop; +t2 = t0 + t8; +a0 = MEM_U32(t2 + 0); +s4 = v0; +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L424e5c; +a1 = a1; +L424e5c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L424f10;} +//nop; +t1 = MEM_U32(sp + 340); +t3 = s0 << 2; +t4 = t1 + t3; +t7 = MEM_U32(t4 + 0); +//nop; +t5 = MEM_U8(t7 + 8); +//nop; +if (t5 == 0) {//nop; +goto L424ee4;} +//nop; +t6 = 0x10004248; +t9 = s0 << 2; +t0 = t1 + t9; +t6 = t6; +MEM_U32(sp + 20) = t6; +MEM_U32(sp + 16) = zero; +t8 = MEM_U32(t0 + 0); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t8; +f_error(mem, sp, a0, a1, a2, a3); +goto L424ec4; +MEM_U32(sp + 24) = t8; +L424ec4: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L424edc; +//nop; +L424edc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L424ee4: +t2 = 0x1000a150; +at = 0x10000; +t2 = MEM_U32(t2 + 0); +t4 = 0x1; +t3 = t2 | at; +at = 0x1000a150; +//nop; +MEM_U32(at + 0) = t3; +at = 0x100003a4; +MEM_U32(at + 0) = t4; +goto L42a934; +MEM_U32(at + 0) = t4; +L424f10: +a0 = 0x1000426c; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L424f24; +//nop; +L424f24: +// bdead 4002000b gp = MEM_U32(sp + 64); +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +a1 = 0x1000425c; +//nop; +t6 = t7 + t5; +a0 = MEM_U32(t6 + 0); +s4 = v0; +a2 = s4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L424f50; +a1 = a1; +L424f50: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +a0 = 0x1000427c; +//nop; +a0 = a0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L424f70; +//nop; +L424f70: +t1 = MEM_U32(sp + 340); +t9 = s0 << 2; +t0 = t1 + t9; +t8 = MEM_U32(t0 + 0); +// bdead 4202000b gp = MEM_U32(sp + 64); +t2 = v0 + t8; +MEM_U32(sp + 252) = t2; +t3 = MEM_U32(sp + 252); +//nop; +t4 = MEM_U8(t3 + 0); +//nop; +if (t4 == 0) {//nop; +goto L425014;} +//nop; +L424fa4: +t7 = MEM_U32(sp + 252); +t6 = 0xfb504f0; +t5 = MEM_U8(t7 + 0); +//nop; +t1 = t5 + t6; +t9 = MEM_U8(t1 + 1); +//nop; +t0 = t9 & 0x1; +if (t0 == 0) {//nop; +goto L424fd8;} +//nop; +t8 = MEM_U8(t1 + 258); +MEM_U8(t7 + 0) = (uint8_t)t8; +goto L424fec; +MEM_U8(t7 + 0) = (uint8_t)t8; +L424fd8: +t2 = MEM_U32(sp + 252); +//nop; +t3 = MEM_U8(t2 + 0); +//nop; +MEM_U8(t2 + 0) = (uint8_t)t3; +L424fec: +t4 = MEM_U32(sp + 252); +//nop; +t5 = t4 + 0x1; +MEM_U32(sp + 252) = t5; +t6 = MEM_U32(sp + 252); +//nop; +t9 = MEM_U8(t6 + 0); +//nop; +if (t9 != 0) {//nop; +goto L424fa4;} +//nop; +L425014: +t0 = MEM_U32(sp + 340); +t1 = s0 << 2; +//nop; +t8 = t0 + t1; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L425034; +//nop; +L425034: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L425040: +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x1000428c; +//nop; +t2 = t7 + t3; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425060; +a1 = a1; +L425060: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x100002d4; +goto L425078;} +at = 0x100002d4; +t4 = 0x1; +MEM_U32(at + 0) = t4; +goto L42a934; +MEM_U32(at + 0) = t4; +L425078: +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +t9 = t5 + t6; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10004298; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425098; +a1 = a1; +L425098: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x100002fc; +goto L4250b0;} +at = 0x100002fc; +t0 = 0x1; +MEM_U32(at + 0) = t0; +goto L42a934; +MEM_U32(at + 0) = t0; +L4250b0: +t1 = MEM_U32(sp + 340); +t8 = s0 << 2; +a1 = 0x100042a8; +//nop; +t7 = t1 + t8; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4250d0; +a1 = a1; +L4250d0: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000032c; +goto L4250fc;} +at = 0x1000032c; +t3 = 0x1; +MEM_U32(at + 0) = zero; +at = 0x10000330; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10000334; +MEM_U32(at + 0) = t3; +goto L42a934; +MEM_U32(at + 0) = t3; +L4250fc: +t2 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x100042bc; +//nop; +t5 = t2 + t4; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42511c; +a1 = a1; +L42511c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L425154;} +//nop; +t6 = MEM_U32(sp + 340); +t9 = s0 << 2; +t0 = t6 + t9; +//nop; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a470; +//nop; +f_addstr(mem, sp, a0, a1); +goto L425148; +//nop; +L425148: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L425154: +t1 = MEM_U32(sp + 340); +t8 = s0 << 2; +a1 = 0x100042c8; +//nop; +t7 = t1 + t8; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425174; +a1 = a1; +L425174: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x100002c4; +goto L425188;} +at = 0x100002c4; +MEM_U32(at + 0) = zero; +goto L42a934; +MEM_U32(at + 0) = zero; +L425188: +t3 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x100042d4; +//nop; +t4 = t3 + t2; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4251a8; +a1 = a1; +L4251a8: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a130; +goto L4251c0;} +at = 0x1000a130; +t5 = 0x1; +MEM_U32(at + 0) = t5; +goto L42a934; +MEM_U32(at + 0) = t5; +L4251c0: +t6 = MEM_U32(sp + 340); +t9 = s0 << 2; +t0 = t6 + t9; +//nop; +a1 = 0x100042e0; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4251e0; +a1 = a1; +L4251e0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000288; +goto L42521c;} +at = 0x10000288; +t8 = MEM_U32(sp + 340); +t1 = 0x1; +t7 = s0 << 2; +//nop; +MEM_U32(at + 0) = t1; +t3 = t8 + t7; +a0 = MEM_U32(t3 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L425210; +//nop; +L425210: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42521c: +t2 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x100042ec; +//nop; +t5 = t2 + t4; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42523c; +a1 = a1; +L42523c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L425274;} +//nop; +t6 = MEM_U32(sp + 340); +t9 = s0 << 2; +t0 = t6 + t9; +//nop; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L425268; +//nop; +L425268: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L425274: +t1 = MEM_U32(sp + 340); +t8 = s0 << 2; +a1 = 0x100042f8; +//nop; +t7 = t1 + t8; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425294; +a1 = a1; +L425294: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x100003a0; +goto L4252a8;} +at = 0x100003a0; +MEM_U32(at + 0) = zero; +goto L42a934; +MEM_U32(at + 0) = zero; +L4252a8: +t3 = MEM_U32(sp + 340); +t2 = s0 << 2; +t4 = t3 + t2; +t5 = MEM_U32(t4 + 0); +//nop; +t6 = MEM_U8(t5 + 2); +//nop; +if (t6 == 0) {//nop; +goto L42534c;} +//nop; +t9 = s0 << 2; +t0 = t3 + t9; +//nop; +a1 = 0x10004308; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4252e8; +a1 = a1; +L4252e8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42534c;} +//nop; +t1 = MEM_U32(sp + 340); +t8 = s0 << 2; +a1 = 0x10004314; +//nop; +t7 = t1 + t8; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425314; +a1 = a1; +L425314: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42534c;} +//nop; +t2 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x10004318; +//nop; +t5 = t2 + t4; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425340; +a1 = a1; +L425340: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L425378;} +//nop; +L42534c: +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +t9 = t6 + t3; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42536c; +//nop; +L42536c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L425378: +t0 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x10004324; +//nop; +t8 = t0 + t1; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425398; +a1 = a1; +L425398: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000318; +goto L425420;} +at = 0x10000318; +t7 = 0x1; +MEM_U32(at + 0) = zero; +at = 0x10000324; +t2 = 0x1000031c; +MEM_U32(at + 0) = t7; +at = 0x10000384; +t2 = MEM_U32(t2 + 0); +MEM_U32(at + 0) = zero; +at = 0x10000348; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10000340; +if (t2 != 0) {MEM_U32(at + 0) = zero; +goto L42a934;} +MEM_U32(at + 0) = zero; +a1 = 0x10004330; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4253f0; +a1 = a1; +L4253f0: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x1000433c; +//nop; +a0 = 0x1000a2c0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L42540c; +a1 = a1; +L42540c: +// bdead 40020103 gp = MEM_U32(sp + 64); +t4 = 0x1; +at = 0x1000031c; +MEM_U32(at + 0) = t4; +goto L42a934; +MEM_U32(at + 0) = t4; +L425420: +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10004348; +//nop; +t3 = t5 + t6; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425440; +a1 = a1; +L425440: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L425478;} +//nop; +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t1 = t9 + t0; +//nop; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42546c; +//nop; +L42546c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L425478: +t8 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10004354; +//nop; +t2 = t8 + t7; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425498; +a1 = a1; +L425498: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a5b4; +goto L4254b0;} +at = 0x1000a5b4; +t4 = 0x1; +MEM_U32(at + 0) = t4; +goto L42a934; +MEM_U32(at + 0) = t4; +L4254b0: +t5 = 0x1000a36c; +at = 0x3; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L4255f0;} +//nop; +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +t9 = t6 + t3; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x1000435c; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4254e8; +a1 = a1; +L4254e8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4255a4;} +//nop; +t0 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x10004370; +//nop; +t8 = t0 + t1; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425514; +a1 = a1; +L425514: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4255a4;} +//nop; +t7 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x10004378; +//nop; +t4 = t7 + t2; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425540; +a1 = a1; +L425540: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4255a4;} +//nop; +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10004380; +//nop; +t3 = t5 + t6; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42556c; +a1 = a1; +L42556c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4255a4;} +//nop; +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t1 = t9 + t0; +//nop; +a1 = 0x1000438c; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425598; +a1 = a1; +L425598: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4255f0;} +//nop; +L4255a4: +t8 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t2 = t8 + t7; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4255c4; +//nop; +L4255c4: +// bdead 40020003 gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t5 = s0 << 2; +//nop; +t6 = t4 + t5; +a0 = MEM_U32(t6 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L4255e4; +//nop; +L4255e4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4255f0: +t3 = 0x1000a36c; +at = 0x6; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L4256c4;} +//nop; +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t1 = t9 + t0; +//nop; +a1 = 0x10004394; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425628; +a1 = a1; +L425628: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000298; +goto L425640;} +at = 0x10000298; +t8 = 0x1; +MEM_U32(at + 0) = t8; +goto L42a934; +MEM_U32(at + 0) = t8; +L425640: +t7 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x1000439c; +//nop; +t4 = t7 + t2; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425660; +a1 = a1; +L425660: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L425698;} +//nop; +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x100043a8; +//nop; +t3 = t5 + t6; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42568c; +a1 = a1; +L42568c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +L425698: +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t1 = t9 + t0; +//nop; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a418; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4256b8; +//nop; +L4256b8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4256c4: +t8 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x100043b4; +//nop; +t2 = t8 + t7; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4256e4; +a1 = a1; +L4256e4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4257a4;} +//nop; +t4 = 0x1000a36c; +at = 0x1; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L425774;} +//nop; +t5 = 0x10000008; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L425774;} +//nop; +t6 = 0x100043bc; +t3 = MEM_U32(sp + 340); +t9 = s0 << 2; +t6 = t6; +t0 = t3 + t9; +t8 = 0x100043ec; +MEM_U32(sp + 20) = t6; +MEM_U32(sp + 16) = zero; +t1 = MEM_U32(t0 + 0); +//nop; +t8 = t8; +MEM_U32(sp + 28) = t8; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t1; +f_error(mem, sp, a0, a1, a2, a3); +goto L425768; +MEM_U32(sp + 24) = t1; +L425768: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L425774: +at = 0x1000a1a0; +t7 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +MEM_U32(at + 0) = zero; +t4 = t7 + t2; +a0 = MEM_U32(t4 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L425798; +//nop; +L425798: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4257a4: +t5 = 0x1000a36c; +at = 0x3; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == at) {at = 0x1; +goto L4257dc;} +at = 0x1; +if (t5 != at) {//nop; +goto L4258b0;} +//nop; +t6 = 0x10000008; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L4258b0;} +//nop; +L4257dc: +t3 = MEM_U32(sp + 340); +t9 = s0 << 2; +t0 = t3 + t9; +//nop; +a1 = 0x100043f0; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4257fc; +a1 = a1; +L4257fc: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000124; +goto L425820;} +at = 0x10000124; +t1 = 0x1; +MEM_U32(at + 0) = t1; +at = 0x10000228; +t8 = 0x1; +MEM_U32(at + 0) = t8; +goto L42a934; +MEM_U32(at + 0) = t8; +L425820: +t7 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x100043f8; +//nop; +t4 = t7 + t2; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425840; +a1 = a1; +L425840: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000110; +goto L425858;} +at = 0x10000110; +t5 = 0x1; +MEM_U32(at + 0) = t5; +goto L42a934; +MEM_U32(at + 0) = t5; +L425858: +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +t9 = t6 + t3; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10004404; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425878; +a1 = a1; +L425878: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000120; +goto L4258b0;} +at = 0x10000120; +t0 = MEM_U32(sp + 340); +t1 = s0 << 2; +//nop; +MEM_U32(at + 0) = zero; +t8 = t0 + t1; +a0 = MEM_U32(t8 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L4258a4; +//nop; +L4258a4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4258b0: +t7 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x10004418; +//nop; +t4 = t7 + t2; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4258d0; +a1 = a1; +L4258d0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L425908;} +//nop; +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t3 = t5 + t6; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4258fc; +//nop; +L4258fc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L425908: +t9 = 0x1000a36c; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L42599c;} +//nop; +t0 = 0x10000008; +at = 0x2; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == at) {at = 0x3; +goto L425940;} +at = 0x3; +if (t0 != at) {//nop; +goto L42599c;} +//nop; +L425940: +t1 = MEM_U32(sp + 340); +t8 = s0 << 2; +a1 = 0x10004420; +//nop; +t7 = t1 + t8; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425960; +a1 = a1; +L425960: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000114; +goto L42599c;} +at = 0x10000114; +t4 = MEM_U32(sp + 340); +t2 = 0x1; +t5 = s0 << 2; +//nop; +MEM_U32(at + 0) = t2; +t6 = t4 + t5; +a0 = MEM_U32(t6 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L425990; +//nop; +L425990: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42599c: +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L42a880;} +//nop; +t9 = 0x10000008; +at = 0x3; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L42a880;} +//nop; +t0 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x10004428; +//nop; +t8 = t0 + t1; +a0 = MEM_U32(t8 + 0); +a2 = 0x9; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L4259f0; +a1 = a1; +L4259f0: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t7 = MEM_U32(sp + 340); +t2 = s0 << 2; +t4 = t7 + t2; +t5 = MEM_U32(t4 + 0); +//nop; +t6 = MEM_U8(t5 + 9); +//nop; +if (t6 != 0) {//nop; +goto L425a34;} +//nop; +t3 = 0x10004434; +//nop; +t3 = t3; +MEM_U32(sp + 248) = t3; +goto L425ac0; +MEM_U32(sp + 248) = t3; +L425a34: +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t1 = t9 + t0; +a0 = MEM_U32(t1 + 0); +//nop; +a1 = 0x1000443c; +a0 = a0 + 0x9; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425a58; +a1 = a1; +L425a58: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L425a78;} +//nop; +t8 = 0x10004444; +//nop; +t8 = t8; +MEM_U32(sp + 248) = t8; +goto L425ac0; +MEM_U32(sp + 248) = t8; +L425a78: +t7 = MEM_U32(sp + 340); +t2 = s0 << 2; +t4 = t7 + t2; +a0 = MEM_U32(t4 + 0); +a1 = 0x1000444c; +//nop; +a0 = a0 + 0x9; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425a9c; +a1 = a1; +L425a9c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L425abc;} +//nop; +t5 = 0x10004458; +//nop; +t5 = t5; +MEM_U32(sp + 248) = t5; +goto L425ac0; +MEM_U32(sp + 248) = t5; +L425abc: +MEM_U32(sp + 248) = zero; +L425ac0: +t6 = MEM_U32(sp + 248); +//nop; +if (t6 == 0) {//nop; +goto L42a880;} +//nop; +t3 = MEM_U32(sp + 336); +//nop; +t9 = t3 + 0xffffffff; +at = (int)s0 < (int)t9; +if (at != 0) {//nop; +goto L425b44;} +//nop; +t0 = 0x10004460; +t1 = MEM_U32(sp + 340); +t8 = s0 << 2; +t0 = t0; +MEM_U32(sp + 20) = t0; +MEM_U32(sp + 16) = zero; +t7 = t1 + t8; +t2 = MEM_U32(t7 + 0); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t2; +f_error(mem, sp, a0, a1, a2, a3); +goto L425b24; +MEM_U32(sp + 24) = t2; +L425b24: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L425b3c; +//nop; +L425b3c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L425b44: +t4 = MEM_U32(sp + 340); +s0 = s0 + 0x1; +t5 = s0 << 2; +t6 = t4 + t5; +t3 = MEM_U32(t6 + 0); +at = 0x2d; +t9 = MEM_U8(t3 + 0); +//nop; +if (t9 != at) {//nop; +goto L425bc4;} +//nop; +t0 = 0x1000447c; +t1 = s0 << 2; +t0 = t0; +MEM_U32(sp + 20) = t0; +t8 = t4 + t1; +MEM_U32(sp + 16) = zero; +t7 = MEM_U32(t8 + -4); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t7; +f_error(mem, sp, a0, a1, a2, a3); +goto L425ba4; +MEM_U32(sp + 24) = t7; +L425ba4: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L425bbc; +//nop; +L425bbc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L425bc4: +t2 = MEM_U32(sp + 340); +t5 = s0 << 2; +//nop; +t6 = t2 + t5; +a1 = MEM_U32(t6 + 0); +a0 = MEM_U32(sp + 248); +a2 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L425be4; +a2 = zero; +L425be4: +// bdead 4002000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a2f0; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L425bfc; +a1 = s4; +L425bfc: +t3 = MEM_U32(sp + 340); +// bdead 40021003 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t0 = t3 + t9; +//nop; +a0 = MEM_U32(t0 + -4); +//nop; +f_add_static_opt(mem, sp, a0); +goto L425c1c; +//nop; +L425c1c: +// bdead 40020003 gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t1 = s0 << 2; +//nop; +t8 = t4 + t1; +a0 = MEM_U32(t8 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L425c3c; +//nop; +L425c3c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L425c48: +t7 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x10004498; +//nop; +t5 = t7 + t2; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425c68; +a1 = a1; +L425c68: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L425c94;} +//nop; +a1 = 0x100044a0; +//nop; +a0 = 0x1000a330; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L425c88; +a1 = a1; +L425c88: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L425c94: +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +t9 = t6 + t3; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x100044a8; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425cb4; +a1 = a1; +L425cb4: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L425dac;} +//nop; +t0 = 0x1000a36c; +at = 0x1; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L425d44;} +//nop; +t4 = 0x10000008; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L425d44;} +//nop; +t1 = 0x100044b0; +t8 = MEM_U32(sp + 340); +t7 = s0 << 2; +t1 = t1; +t6 = 0x100044e0; +MEM_U32(sp + 20) = t1; +MEM_U32(sp + 16) = zero; +t2 = t8 + t7; +t5 = MEM_U32(t2 + 0); +//nop; +t6 = t6; +MEM_U32(sp + 28) = t6; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t5; +f_error(mem, sp, a0, a1, a2, a3); +goto L425d38; +MEM_U32(sp + 24) = t5; +L425d38: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L425d44: +at = 0x100002b4; +t9 = 0x1000a36c; +t3 = 0x1; +t9 = MEM_U32(t9 + 0); +MEM_U32(at + 0) = t3; +at = 0x1; +if (t9 != at) {//nop; +goto L42a934;} +//nop; +t0 = 0x100002bc; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L42a934;} +//nop; +a0 = 0x1000a1ac; +a1 = 0x1000a1b0; +a2 = 0x1000a1b4; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 0); +a2 = MEM_U32(a2 + 0); +//nop; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L425da0; +//nop; +L425da0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L425dac: +t4 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x100044e4; +//nop; +t8 = t4 + t1; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425dcc; +a1 = a1; +L425dcc: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000310; +goto L425df0;} +at = 0x10000310; +t7 = 0x1; +MEM_U32(at + 0) = t7; +at = 0x100003e0; +t2 = 0x1; +MEM_U32(at + 0) = t2; +goto L42a934; +MEM_U32(at + 0) = t2; +L425df0: +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x100044ec; +//nop; +t3 = t5 + t6; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L425e10; +a1 = a1; +L425e10: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L425edc;} +//nop; +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t4 = t9 + t0; +t1 = MEM_U32(t4 + 4); +//nop; +if (t1 == 0) {//nop; +goto L425ea8;} +//nop; +t8 = s0 << 2; +t7 = t9 + t8; +t2 = MEM_U32(t7 + 4); +at = 0x2d; +t5 = MEM_U8(t2 + 0); +//nop; +if (t5 == at) {//nop; +goto L425ea8;} +//nop; +t6 = s0 << 2; +t3 = t9 + t6; +//nop; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L425e74; +//nop; +L425e74: +// bdead 40020003 gp = MEM_U32(sp + 64); +t0 = MEM_U32(sp + 340); +s0 = s0 + 0x1; +t4 = s0 << 2; +//nop; +t1 = t0 + t4; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L425e9c; +//nop; +L425e9c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L425ea8: +t8 = 0x100044f8; +//nop; +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L425ed0; +MEM_U32(sp + 16) = zero; +L425ed0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L425edc: +t7 = MEM_U32(sp + 340); +t2 = s0 << 2; +t5 = t7 + t2; +t9 = MEM_U32(t5 + 0); +//nop; +t6 = MEM_U8(t9 + 2); +//nop; +if (t6 != 0) {//nop; +goto L426090;} +//nop; +t3 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t3; +if (at == 0) {//nop; +goto L426048;} +//nop; +t0 = s0 << 2; +t4 = t7 + t0; +t1 = MEM_U32(t4 + 0); +at = 0x1000a1ec; +//nop; +a0 = t1; +MEM_U32(at + 0) = t1; +v0 = f_getsuf(mem, sp, a0); +goto L425f34; +MEM_U32(at + 0) = t1; +L425f34: +// bdead 4002010b gp = MEM_U32(sp + 64); +s1 = v0 & 0xff; +at = 0x63; +if (s1 == at) {at = 0x70; +goto L425fc8;} +at = 0x70; +if (s1 == at) {at = 0x66; +goto L425fc8;} +at = 0x66; +if (s1 == at) {at = 0x46; +goto L425fc8;} +at = 0x46; +if (s1 == at) {at = 0x72; +goto L425fc8;} +at = 0x72; +if (s1 == at) {at = 0x65; +goto L425fc8;} +at = 0x65; +if (s1 == at) {//nop; +goto L425fc8;} +//nop; +t8 = 0x1000a36c; +at = 0x1; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L425fac;} +//nop; +t2 = 0x10000008; +at = 0x2; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == at) {at = 0x3; +goto L425fa4;} +at = 0x3; +if (t2 != at) {at = 0x6; +goto L425fac;} +L425fa4: +at = 0x6; +if (s1 == at) {at = 0x73; +goto L425fc8;} +L425fac: +at = 0x73; +if (s1 == at) {at = 0x1; +goto L425fc8;} +at = 0x1; +if (s1 == at) {at = 0x2; +goto L425fc8;} +at = 0x2; +if (s1 != at) {//nop; +goto L42a934;} +//nop; +L425fc8: +a0 = 0x1000a1ec; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = sp + 0x70; +v0 = wrapper_stat(mem, a0, a1); +goto L425fdc; +a1 = sp + 0x70; +L425fdc: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a934;} +//nop; +t5 = 0x10004524; +t9 = MEM_U32(sp + 340); +t6 = s0 << 2; +t5 = t5; +t3 = t9 + t6; +MEM_U32(sp + 20) = t5; +MEM_U32(sp + 16) = zero; +t7 = MEM_U32(t3 + 0); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t7; +f_error(mem, sp, a0, a1, a2, a3); +goto L426024; +MEM_U32(sp + 24) = t7; +L426024: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L42603c; +//nop; +L42603c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L426048: +t0 = 0x1000455c; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L426070; +MEM_U32(sp + 16) = zero; +L426070: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L426088; +//nop; +L426088: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L426090: +t4 = 0x1000a36c; +at = 0x3; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L42a880;} +//nop; +t1 = MEM_U32(sp + 340); +t8 = s0 << 2; +a1 = 0x10004578; +//nop; +t2 = t1 + t8; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4260c8; +a1 = a1; +L4260c8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +a1 = 0x10004584; +//nop; +a0 = 0x1000a330; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4260e8; +a1 = a1; +L4260e8: +// bdead 40020103 gp = MEM_U32(sp + 64); +t5 = 0x1; +at = 0x1000a154; +MEM_U32(at + 0) = t5; +goto L42a934; +MEM_U32(at + 0) = t5; +L4260fc: +t9 = MEM_U32(sp + 340); +t6 = s0 << 2; +t3 = t9 + t6; +//nop; +a1 = 0x10004588; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42611c; +a1 = a1; +L42611c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4261bc;} +//nop; +t7 = 0x1000a36c; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L4261ac;} +//nop; +t0 = 0x10000008; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L4261ac;} +//nop; +t4 = 0x10004594; +t1 = MEM_U32(sp + 340); +t9 = 0x100045c4; +t8 = s0 << 2; +t4 = t4; +MEM_U32(sp + 20) = t4; +MEM_U32(sp + 16) = zero; +t2 = t1 + t8; +t5 = MEM_U32(t2 + 0); +t9 = t9; +MEM_U32(sp + 28) = t9; +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t5; +f_error(mem, sp, a0, a1, a2, a3); +goto L4261a0; +MEM_U32(sp + 24) = t5; +L4261a0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4261ac: +at = 0x100003a0; +t6 = 0x1; +MEM_U32(at + 0) = t6; +goto L42a934; +MEM_U32(at + 0) = t6; +L4261bc: +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L4262a4;} +//nop; +t7 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x100045c8; +//nop; +t4 = t7 + t0; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4261f4; +a1 = a1; +L4261f4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4262a4;} +//nop; +t1 = 0x1000a36c; +at = 0x1; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L426284;} +//nop; +t8 = 0x10000008; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L426284;} +//nop; +t2 = 0x100045d4; +t5 = MEM_U32(sp + 340); +t9 = s0 << 2; +t2 = t2; +t6 = t5 + t9; +t7 = 0x10004604; +MEM_U32(sp + 20) = t2; +MEM_U32(sp + 16) = zero; +t3 = MEM_U32(t6 + 0); +//nop; +t7 = t7; +MEM_U32(sp + 28) = t7; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L426278; +MEM_U32(sp + 24) = t3; +L426278: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L426284: +a1 = 0x10004608; +//nop; +a0 = 0x1000a290; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L426298; +a1 = a1; +L426298: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4262a4: +t0 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x1000460c; +//nop; +t1 = t0 + t4; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4262c4; +a1 = a1; +L4262c4: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4263d0;} +//nop; +t8 = 0x1000a150; +at = 0x10000; +t8 = MEM_U32(t8 + 0); +at = at | 0x1; +t2 = t8 | at; +at = 0x1000a150; +t5 = MEM_U32(sp + 336); +t9 = s0 + 0x1; +MEM_U32(at + 0) = t2; +at = (int)t9 < (int)t5; +if (at == 0) {//nop; +goto L42a934;} +//nop; +t6 = 0x100003ac; +//nop; +MEM_U32(sp + 108) = t6; +t3 = MEM_U32(t6 + 0); +//nop; +if (t3 == 0) {//nop; +goto L426394;} +//nop; +t7 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t4 = t7 + t0; +a0 = MEM_U32(t4 + 4); +a1 = t3; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426338; +a1 = t3; +L426338: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L426394;} +//nop; +L426344: +t1 = MEM_U32(sp + 108); +//nop; +t8 = t1 + 0x8; +MEM_U32(sp + 108) = t8; +t2 = MEM_U32(sp + 108); +//nop; +t5 = MEM_U32(t2 + 0); +//nop; +if (t5 == 0) {//nop; +goto L426394;} +//nop; +t9 = MEM_U32(sp + 340); +t6 = s0 << 2; +t7 = t9 + t6; +//nop; +a0 = MEM_U32(t7 + 4); +a1 = t5; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426388; +a1 = t5; +L426388: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L426344;} +//nop; +L426394: +t0 = MEM_U32(sp + 108); +//nop; +t4 = MEM_U32(t0 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42a934;} +//nop; +t3 = 0x1000a150; +t1 = MEM_U32(sp + 108); +t3 = MEM_U32(t3 + 0); +t8 = MEM_U32(t1 + 4); +at = 0x1000a150; +t2 = t3 | t8; +s0 = s0 + 0x1; +MEM_U32(at + 0) = t2; +goto L42a934; +MEM_U32(at + 0) = t2; +L4263d0: +t9 = MEM_U32(sp + 340); +t6 = s0 << 2; +t7 = t9 + t6; +//nop; +a1 = 0x10004614; +a0 = MEM_U32(t7 + 0); +a2 = 0xc; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L4263f4; +a1 = a1; +L4263f4: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L426434;} +//nop; +t5 = 0x1000a150; +at = 0x10000; +t5 = MEM_U32(t5 + 0); +at = at | 0x1; +t0 = t5 | at; +at = 0x1000a150; +t4 = 0x100003a8; +MEM_U32(at + 0) = t0; +t4 = MEM_U32(t4 + 0); +at = 0x100003a8; +t1 = t4 + 0x1; +MEM_U32(at + 0) = t1; +goto L42a934; +MEM_U32(at + 0) = t1; +L426434: +t3 = MEM_U32(sp + 340); +t8 = s0 << 2; +a1 = 0x10004624; +//nop; +t2 = t3 + t8; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426454; +a1 = a1; +L426454: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4265d8;} +//nop; +t9 = 0x1000a188; +at = 0x10000; +t9 = MEM_U32(t9 + 0); +t7 = 0x1000027c; +at = at | 0x1; +t6 = t9 | at; +at = 0x1000a188; +t7 = MEM_U32(t7 + 0); +MEM_U32(at + 0) = t6; +if (t7 == 0) {//nop; +goto L4264d4;} +//nop; +t5 = 0x1000462c; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4264b4; +MEM_U32(sp + 16) = zero; +L4264b4: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4264cc; +//nop; +L4264cc: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L4264d4: +a0 = 0x10004650; +//nop; +a1 = zero; +a2 = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L4264ec; +a0 = a0; +L4264ec: +t0 = MEM_U32(sp + 336); +t4 = s0 + 0x1; +// bdead 40022303 gp = MEM_U32(sp + 64); +at = (int)t4 < (int)t0; +if (at == 0) {//nop; +goto L42a934;} +//nop; +t1 = 0x100003c4; +//nop; +MEM_U32(sp + 104) = t1; +t3 = MEM_U32(t1 + 0); +//nop; +if (t3 == 0) {//nop; +goto L42659c;} +//nop; +t8 = MEM_U32(sp + 340); +t2 = s0 << 2; +t9 = t8 + t2; +a0 = MEM_U32(t9 + 4); +//nop; +a1 = t3; +//nop; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426540; +//nop; +L426540: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42659c;} +//nop; +L42654c: +t6 = MEM_U32(sp + 104); +//nop; +t7 = t6 + 0x8; +MEM_U32(sp + 104) = t7; +t5 = MEM_U32(sp + 104); +//nop; +t0 = MEM_U32(t5 + 0); +//nop; +if (t0 == 0) {//nop; +goto L42659c;} +//nop; +t4 = MEM_U32(sp + 340); +t1 = s0 << 2; +//nop; +t8 = t4 + t1; +a0 = MEM_U32(t8 + 4); +a1 = t0; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426590; +a1 = t0; +L426590: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42654c;} +//nop; +L42659c: +t2 = MEM_U32(sp + 104); +//nop; +t9 = MEM_U32(t2 + 0); +//nop; +if (t9 == 0) {//nop; +goto L42a934;} +//nop; +t3 = 0x1000a188; +t6 = MEM_U32(sp + 104); +t3 = MEM_U32(t3 + 0); +t7 = MEM_U32(t6 + 4); +at = 0x1000a188; +t5 = t3 | t7; +s0 = s0 + 0x1; +MEM_U32(at + 0) = t5; +goto L42a934; +MEM_U32(at + 0) = t5; +L4265d8: +t4 = 0x1000a36c; +at = 0x1; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L426930;} +//nop; +t1 = 0x10000008; +at = 0x2; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == at) {at = 0x3; +goto L426610;} +at = 0x3; +if (t1 != at) {//nop; +goto L426930;} +//nop; +L426610: +t8 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x10004654; +//nop; +t2 = t8 + t0; +a0 = MEM_U32(t2 + 0); +a2 = 0x3; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L426634; +a1 = a1; +L426634: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4268f8;} +//nop; +t9 = MEM_U32(sp + 340); +t6 = s0 << 2; +t3 = t9 + t6; +t7 = MEM_U32(t3 + 0); +//nop; +a1 = 0x10004658; +t5 = t7 + 0x3; +MEM_U32(sp + 100) = t5; +a0 = t5; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42666c; +a1 = a1; +L42666c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L426694;} +//nop; +t4 = 0x1000011c; +at = 0x1000011c; +t4 = MEM_U32(t4 + 0); +//nop; +t1 = t4 + 0x1; +MEM_U32(at + 0) = t1; +goto L42a934; +MEM_U32(at + 0) = t1; +L426694: +a1 = 0x1000465c; +//nop; +a0 = MEM_U32(sp + 100); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4266a8; +a1 = a1; +L4266a8: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a184; +goto L4266bc;} +at = 0x1000a184; +MEM_U32(at + 0) = zero; +goto L42a934; +MEM_U32(at + 0) = zero; +L4266bc: +a1 = 0x10004664; +//nop; +a0 = MEM_U32(sp + 100); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4266d0; +a1 = a1; +L4266d0: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a184; +goto L4266e8;} +at = 0x1000a184; +t8 = 0x1; +MEM_U32(at + 0) = t8; +goto L42a934; +MEM_U32(at + 0) = t8; +L4266e8: +a1 = 0x1000466c; +//nop; +a0 = MEM_U32(sp + 100); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4266fc; +a1 = a1; +L4266fc: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L426724;} +//nop; +a1 = 0x10004670; +//nop; +a0 = MEM_U32(sp + 100); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42671c; +a1 = a1; +L42671c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000a184; +goto L426734;} +L426724: +at = 0x1000a184; +t0 = 0x2; +MEM_U32(at + 0) = t0; +goto L42a934; +MEM_U32(at + 0) = t0; +L426734: +t2 = MEM_U32(sp + 100); +at = 0x65; +t9 = MEM_U8(t2 + 0); +//nop; +if (t9 != at) {//nop; +goto L4268b0;} +//nop; +a1 = 0x10004674; +//nop; +a0 = t2 + 0x1; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426760; +a1 = a1; +L426760: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +a0 = MEM_U32(sp + 100); +a1 = 0x10004678; +//nop; +a0 = a0 + 0x1; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426784; +a1 = a1; +L426784: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +a0 = MEM_U32(sp + 100); +a1 = 0x1000467c; +//nop; +a0 = a0 + 0x1; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4267a8; +a1 = a1; +L4267a8: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +a0 = MEM_U32(sp + 100); +a1 = 0x10004684; +//nop; +a0 = a0 + 0x1; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4267cc; +a1 = a1; +L4267cc: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +a0 = MEM_U32(sp + 100); +a1 = 0x10004688; +//nop; +a0 = a0 + 0x1; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4267f0; +a1 = a1; +L4267f0: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +a0 = MEM_U32(sp + 100); +a1 = 0x10004690; +//nop; +a0 = a0 + 0x1; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426814; +a1 = a1; +L426814: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +a0 = MEM_U32(sp + 100); +a1 = 0x10004698; +//nop; +a0 = a0 + 0x1; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426838; +a1 = a1; +L426838: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +a0 = MEM_U32(sp + 100); +a1 = 0x100046a0; +//nop; +a0 = a0 + 0x1; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42685c; +a1 = a1; +L42685c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +t6 = 0x100046a8; +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +t6 = t6; +MEM_U32(sp + 20) = t6; +MEM_U32(sp + 16) = zero; +t5 = t3 + t7; +t4 = MEM_U32(t5 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t4; +f_error(mem, sp, a0, a1, a2, a3); +goto L4268a4; +MEM_U32(sp + 24) = t4; +L4268a4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4268b0: +t1 = 0x100046c4; +t8 = MEM_U32(sp + 340); +t0 = s0 << 2; +t1 = t1; +MEM_U32(sp + 20) = t1; +MEM_U32(sp + 16) = zero; +t9 = t8 + t0; +t2 = MEM_U32(t9 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t2; +f_error(mem, sp, a0, a1, a2, a3); +goto L4268ec; +MEM_U32(sp + 24) = t2; +L4268ec: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4268f8: +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x100046e4; +//nop; +t7 = t6 + t3; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426918; +a1 = a1; +L426918: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000118; +goto L426930;} +at = 0x10000118; +t5 = 0x1; +MEM_U32(at + 0) = t5; +goto L42a934; +MEM_U32(at + 0) = t5; +L426930: +t4 = MEM_U32(sp + 340); +t1 = s0 << 2; +t8 = t4 + t1; +t0 = MEM_U32(t8 + 0); +//nop; +t9 = MEM_U8(t0 + 2); +//nop; +if (t9 != 0) {at = 0x10000220; +goto L426960;} +at = 0x10000220; +t2 = 0x1; +MEM_U32(at + 0) = t2; +goto L4269f0; +MEM_U32(at + 0) = t2; +L426960: +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +t7 = t6 + t3; +t5 = MEM_U32(t7 + 0); +//nop; +t4 = MEM_U8(t5 + 3); +//nop; +if (t4 != 0) {//nop; +goto L42a880;} +//nop; +t1 = MEM_U32(sp + 340); +t8 = s0 << 2; +t0 = t1 + t8; +t9 = MEM_U32(t0 + 0); +//nop; +t2 = MEM_U8(t9 + 2); +//nop; +at = (int)t2 < (int)0x30; +if (at != 0) {//nop; +goto L42a880;} +//nop; +t6 = s0 << 2; +t3 = t1 + t6; +t7 = MEM_U32(t3 + 0); +//nop; +t5 = MEM_U8(t7 + 2); +//nop; +at = (int)t5 < (int)0x34; +if (at == 0) {//nop; +goto L42a880;} +//nop; +t4 = s0 << 2; +t8 = t1 + t4; +t0 = MEM_U32(t8 + 0); +at = 0x10000220; +t9 = MEM_U8(t0 + 2); +//nop; +t2 = t9 + 0xffffffd0; +MEM_U32(at + 0) = t2; +L4269f0: +t6 = 0x10000220; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {at = 0x1; +goto L426a10;} +at = 0x1; +if (t6 != at) {//nop; +goto L426a74;} +//nop; +L426a10: +t3 = 0x1000027c; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L426ad0;} +//nop; +t7 = 0x100046f0; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L426a50; +MEM_U32(sp + 16) = zero; +L426a50: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L426a68; +//nop; +L426a68: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L426ad0; +//nop; +L426a74: +t5 = 0x10004718; +t1 = MEM_U32(sp + 340); +t4 = s0 << 2; +t5 = t5; +MEM_U32(sp + 20) = t5; +MEM_U32(sp + 16) = zero; +t8 = t1 + t4; +t0 = MEM_U32(t8 + 0); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t0; +f_error(mem, sp, a0, a1, a2, a3); +goto L426ab0; +MEM_U32(sp + 24) = t0; +L426ab0: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L426ac8; +//nop; +L426ac8: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L426ad0: +a0 = 0x1000474c; +//nop; +a1 = zero; +a2 = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L426ae8; +a0 = a0; +L426ae8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L426af4: +t9 = MEM_U32(sp + 340); +t2 = s0 << 2; +t6 = t9 + t2; +//nop; +a1 = 0x10004750; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426b14; +a1 = a1; +L426b14: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000338; +goto L426b2c;} +at = 0x10000338; +t3 = 0x1; +MEM_U32(at + 0) = t3; +goto L42a934; +MEM_U32(at + 0) = t3; +L426b2c: +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +a1 = 0x10004764; +//nop; +t1 = t7 + t5; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426b4c; +a1 = a1; +L426b4c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +t4 = MEM_U32(sp + 340); +t8 = s0 << 2; +a1 = 0x10004768; +//nop; +t0 = t4 + t8; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426b78; +a1 = a1; +L426b78: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +//nop; +goto L42a934; +//nop; +L426b8c: +t9 = MEM_U32(sp + 340); +t2 = s0 << 2; +t6 = t9 + t2; +//nop; +a1 = 0x1000476c; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426bac; +a1 = a1; +L426bac: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L426be4;} +//nop; +t3 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10004774; +//nop; +t5 = t3 + t7; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426bd8; +a1 = a1; +L426bd8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L426c10;} +//nop; +L426be4: +t1 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t8 = t1 + t4; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a4d0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L426c04; +//nop; +L426c04: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L426c10: +t0 = MEM_U32(sp + 340); +t9 = s0 << 2; +t2 = t0 + t9; +t6 = MEM_U32(t2 + 0); +//nop; +t3 = MEM_U8(t6 + 2); +//nop; +if (t3 != 0) {//nop; +goto L426c5c;} +//nop; +t7 = s0 << 2; +//nop; +t5 = t0 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L426c50; +//nop; +L426c50: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L426c5c: +t1 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x1000477c; +//nop; +t8 = t1 + t4; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426c7c; +a1 = a1; +L426c7c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L426cb4;} +//nop; +t9 = MEM_U32(sp + 340); +t2 = s0 << 2; +t6 = t9 + t2; +//nop; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L426ca8; +//nop; +L426ca8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L426cb4: +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x1000478c; +//nop; +t7 = t3 + t0; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426cd4; +a1 = a1; +L426cd4: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000033c; +goto L426cec;} +at = 0x1000033c; +t5 = 0x1; +MEM_U32(at + 0) = t5; +goto L42a934; +MEM_U32(at + 0) = t5; +L426cec: +t1 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x1000479c; +//nop; +t8 = t1 + t4; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426d0c; +a1 = a1; +L426d0c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L426da4;} +//nop; +t9 = MEM_U32(sp + 340); +t2 = s0 << 2; +t6 = t9 + t2; +t3 = MEM_U32(t6 + 4); +//nop; +if (t3 == 0) {//nop; +goto L426da4;} +//nop; +t0 = s0 << 2; +t7 = t9 + t0; +t5 = MEM_U32(t7 + 4); +at = 0x2d; +t1 = MEM_U8(t5 + 0); +//nop; +if (t1 == at) {//nop; +goto L426da4;} +//nop; +t4 = s0 << 2; +t8 = t9 + t4; +//nop; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L426d70; +//nop; +L426d70: +// bdead 40020003 gp = MEM_U32(sp + 64); +t2 = MEM_U32(sp + 340); +s0 = s0 + 0x1; +t6 = s0 << 2; +//nop; +t3 = t2 + t6; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L426d98; +//nop; +L426d98: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L426da4: +t0 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x100047a4; +//nop; +t5 = t0 + t7; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426dc4; +a1 = a1; +L426dc4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L426dfc;} +//nop; +t1 = MEM_U32(sp + 340); +t9 = s0 << 2; +t4 = t1 + t9; +//nop; +a1 = 0x100047b4; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426df0; +a1 = a1; +L426df0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L426e28;} +//nop; +L426dfc: +t8 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t6 = t8 + t2; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L426e1c; +//nop; +L426e1c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L426e28: +t3 = 0x1000a36c; +at = 0x3; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L426e98;} +//nop; +t0 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x100047c4; +//nop; +t5 = t0 + t7; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426e60; +a1 = a1; +L426e60: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L426e98;} +//nop; +t1 = MEM_U32(sp + 340); +t9 = s0 << 2; +t4 = t1 + t9; +//nop; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L426e8c; +//nop; +L426e8c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L426e98: +t8 = 0x1000a36c; +at = 0x6; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L42a880;} +//nop; +t2 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x100047c8; +//nop; +t3 = t2 + t6; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426ed0; +a1 = a1; +L426ed0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L426f34;} +//nop; +t0 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x100047d0; +//nop; +t5 = t0 + t7; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426efc; +a1 = a1; +L426efc: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L426f34;} +//nop; +t1 = MEM_U32(sp + 340); +t9 = s0 << 2; +t4 = t1 + t9; +//nop; +a1 = 0x100047d8; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426f28; +a1 = a1; +L426f28: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +L426f34: +t8 = MEM_U32(sp + 340); +t2 = s0 << 2; +//nop; +t6 = t8 + t2; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a418; +//nop; +f_addstr(mem, sp, a0, a1); +goto L426f54; +//nop; +L426f54: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L426f60: +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +t7 = t3 + t0; +t5 = MEM_U32(t7 + 0); +//nop; +t1 = MEM_U8(t5 + 2); +//nop; +if (t1 != 0) {//nop; +goto L426fac;} +//nop; +t9 = s0 << 2; +t4 = t3 + t9; +//nop; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L426fa0; +//nop; +L426fa0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L426fac: +t8 = MEM_U32(sp + 340); +t2 = s0 << 2; +a1 = 0x100047e0; +//nop; +t6 = t8 + t2; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L426fcc; +a1 = a1; +L426fcc: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L427004;} +//nop; +t0 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t5 = t0 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a4b0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L426ff8; +//nop; +L426ff8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L427004: +t1 = 0x1000a36c; +at = 0x1; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L427034;} +//nop; +t3 = 0x10000008; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L42704c;} +//nop; +L427034: +t9 = 0x1000a36c; +at = 0x3; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L427250;} +//nop; +L42704c: +t4 = MEM_U32(sp + 340); +t8 = s0 << 2; +a1 = 0x100047ec; +//nop; +t2 = t4 + t8; +a0 = MEM_U32(t2 + 0); +a2 = 0x3; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L427070; +a1 = a1; +L427070: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L427250;} +//nop; +t6 = MEM_U32(sp + 340); +t0 = s0 << 2; +t7 = t6 + t0; +t5 = MEM_U32(t7 + 0); +//nop; +t1 = MEM_U8(t5 + 3); +//nop; +if (t1 == 0) {//nop; +goto L4270bc;} +//nop; +t3 = s0 << 2; +t9 = t6 + t3; +t4 = MEM_U32(t9 + 0); +at = 0x2c; +t8 = MEM_U8(t4 + 3); +//nop; +if (t8 != at) {at = 0x100001fc; +goto L427250;} +L4270bc: +at = 0x100001fc; +t0 = MEM_U32(sp + 340); +t2 = 0x1; +t7 = s0 << 2; +MEM_U32(at + 0) = t2; +t5 = t0 + t7; +t1 = MEM_U32(t5 + 0); +at = 0x2c; +t6 = MEM_U8(t1 + 3); +//nop; +if (t6 != at) {//nop; +goto L42a934;} +//nop; +t3 = s0 << 2; +t9 = t0 + t3; +t4 = MEM_U32(t9 + 0); +//nop; +t8 = MEM_U8(t4 + 4); +//nop; +if (t8 == 0) {//nop; +goto L42a934;} +//nop; +t2 = s0 << 2; +t7 = t0 + t2; +a0 = MEM_U32(t7 + 0); +a1 = 0x100047f0; +//nop; +a0 = a0 + 0x4; +a1 = a1; +v0 = wrapper_strtok(mem, a0, a1); +goto L42712c; +a1 = a1; +L42712c: +MEM_U32(sp + 96) = v0; +t5 = MEM_U32(sp + 96); +// bdead 40024103 gp = MEM_U32(sp + 64); +if (t5 == 0) {//nop; +goto L42a934;} +//nop; +L427140: +a1 = 0x100047f4; +//nop; +a0 = MEM_U32(sp + 96); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L427154; +a1 = a1; +L427154: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000200; +goto L42716c;} +at = 0x10000200; +t1 = 0x1; +MEM_U32(at + 0) = t1; +goto L427220; +MEM_U32(at + 0) = t1; +L42716c: +t6 = 0x10000204; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L4271b8;} +//nop; +t3 = 0x100047fc; +//nop; +t3 = t3; +MEM_U32(sp + 20) = t3; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4271ac; +MEM_U32(sp + 16) = zero; +L4271ac: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L427220; +//nop; +L4271b8: +t9 = MEM_U32(sp + 96); +at = 0x10000204; +a0 = t9; +MEM_U32(at + 0) = t9; +//nop; +//nop; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L4271d8; +//nop; +L4271d8: +t4 = MEM_U32(sp + 96); +// bdead 4002210b gp = MEM_U32(sp + 64); +t8 = v0 + t4; +t0 = MEM_U8(t8 + -1); +at = 0x2f; +if (t0 == at) {//nop; +goto L427220;} +//nop; +a1 = 0x1000482c; +//nop; +a0 = t4; +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42720c; +a1 = a1; +L42720c: +// bdead 4002000b gp = MEM_U32(sp + 64); +//nop; +at = 0x10000204; +//nop; +MEM_U32(at + 0) = v0; +L427220: +a1 = 0x10004830; +//nop; +a0 = zero; +a1 = a1; +v0 = wrapper_strtok(mem, a0, a1); +goto L427234; +a1 = a1; +L427234: +MEM_U32(sp + 96) = v0; +t2 = MEM_U32(sp + 96); +// bdead 40020903 gp = MEM_U32(sp + 64); +if (t2 != 0) {//nop; +goto L427140;} +//nop; +//nop; +goto L42a934; +//nop; +L427250: +t7 = 0x1000a36c; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L427280;} +//nop; +t5 = 0x10000008; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L427298;} +//nop; +L427280: +t1 = 0x1000a36c; +at = 0x3; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L4273a4;} +//nop; +L427298: +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +t9 = t6 + t3; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10004834; +a2 = 0x6; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L4272bc; +a1 = a1; +L4272bc: +// bdead 4002018b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4273a4;} +//nop; +t8 = MEM_U32(sp + 340); +t0 = s0 << 2; +t4 = t8 + t0; +t2 = MEM_U32(t4 + 0); +//nop; +t7 = MEM_U8(t2 + 6); +//nop; +if (t7 == 0) {//nop; +goto L42730c;} +//nop; +t5 = s0 << 2; +t1 = t8 + t5; +t6 = MEM_U32(t1 + 0); +at = 0x2c; +t3 = MEM_U8(t6 + 6); +//nop; +if (t3 != at) {//nop; +goto L4273a4;} +//nop; +L42730c: +t9 = MEM_U32(sp + 340); +t0 = s0 << 2; +t4 = t9 + t0; +t2 = MEM_U32(t4 + 0); +at = 0x2c; +t7 = MEM_U8(t2 + 6); +//nop; +if (t7 != at) {//nop; +goto L427360;} +//nop; +t8 = s0 << 2; +t5 = t9 + t8; +a0 = MEM_U32(t5 + 0); +//nop; +a1 = zero; +a0 = a0 + 0x7; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42734c; +a0 = a0 + 0x7; +L42734c: +// bdead 4002010b gp = MEM_U32(sp + 64); +//nop; +at = 0x10000208; +MEM_U32(at + 0) = v0; +goto L427388; +MEM_U32(at + 0) = v0; +L427360: +a0 = 0x1000483c; +//nop; +a1 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L427374; +a0 = a0; +L427374: +// bdead 4002010b gp = MEM_U32(sp + 64); +//nop; +at = 0x10000208; +//nop; +MEM_U32(at + 0) = v0; +L427388: +t1 = 0x1000020c; +at = 0x1000020c; +t1 = MEM_U32(t1 + 0); +//nop; +t6 = t1 + 0x1; +MEM_U32(at + 0) = t6; +goto L42a934; +MEM_U32(at + 0) = t6; +L4273a4: +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L427494;} +//nop; +t0 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x10004850; +//nop; +t2 = t0 + t4; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4273dc; +a1 = a1; +L4273dc: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L427494;} +//nop; +t7 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t7; +if (at != 0) {//nop; +goto L427444;} +//nop; +t9 = 0x10004860; +a0 = 0x1; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L427424; +MEM_U32(sp + 16) = zero; +L427424: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L42743c; +//nop; +L42743c: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L427444: +t8 = MEM_U32(sp + 340); +t5 = s0 << 2; +//nop; +t1 = t8 + t5; +a1 = MEM_U32(t1 + -4); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L427464; +//nop; +L427464: +// bdead 40020003 gp = MEM_U32(sp + 64); +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t0 = t6 + t3; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L427488; +//nop; +L427488: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L427494: +t4 = 0x1000a36c; +at = 0x1; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L427584;} +//nop; +t2 = MEM_U32(sp + 340); +t7 = s0 << 2; +t9 = t2 + t7; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10004884; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4274cc; +a1 = a1; +L4274cc: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L427584;} +//nop; +t8 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t8; +if (at != 0) {//nop; +goto L427534;} +//nop; +t5 = 0x1000488c; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L427514; +MEM_U32(sp + 16) = zero; +L427514: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L42752c; +//nop; +L42752c: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L427534: +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t3 = t1 + t6; +a1 = MEM_U32(t3 + -4); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L427554; +//nop; +L427554: +// bdead 40020003 gp = MEM_U32(sp + 64); +t0 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t2 = t0 + t4; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L427578; +//nop; +L427578: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L427584: +t7 = MEM_U32(sp + 340); +t9 = s0 << 2; +t8 = t7 + t9; +//nop; +a1 = 0x100048ac; +a0 = MEM_U32(t8 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4275a4; +a1 = a1; +L4275a4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L427ac0;} +//nop; +t5 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t5; +if (at != 0) {//nop; +goto L42760c;} +//nop; +t1 = 0x100048b8; +//nop; +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4275ec; +MEM_U32(sp + 16) = zero; +L4275ec: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L427604; +//nop; +L427604: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L42760c: +t6 = 0x1000035c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L4276ac;} +//nop; +t3 = MEM_U32(sp + 340); +a0 = 0x1000a27c; +t0 = s0 << 2; +//nop; +t4 = t3 + t0; +a1 = MEM_U32(t4 + 0); +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_strcmp(mem, a0, a1); +goto L427648; +//nop; +L427648: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4276a0;} +//nop; +t2 = 0x100048d8; +//nop; +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L42767c; +MEM_U32(sp + 16) = zero; +L42767c: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L427694; +//nop; +L427694: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L4276ac; +//nop; +L4276a0: +at = 0x10000368; +t7 = 0x1; +MEM_U32(at + 0) = t7; +L4276ac: +t9 = MEM_U32(sp + 340); +t8 = s0 << 2; +t5 = t9 + t8; +t1 = MEM_U32(t5 + 0); +at = 0x1000a27c; +t3 = 0x1000027c; +MEM_U32(at + 0) = t1; +at = 0x1000035c; +t3 = MEM_U32(t3 + 0); +t6 = 0x1; +if (t3 == 0) {MEM_U32(at + 0) = t6; +goto L427740;} +MEM_U32(at + 0) = t6; +t0 = 0x10000364; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L427740;} +//nop; +t4 = 0x100048fc; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L42771c; +MEM_U32(sp + 16) = zero; +L42771c: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L427734; +//nop; +L427734: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L42774c; +//nop; +L427740: +at = 0x10000364; +t2 = 0x1; +MEM_U32(at + 0) = t2; +L42774c: +t7 = 0x10000368; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L427a98;} +//nop; +a0 = 0x1000a27c; +a1 = 0x10004920; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42777c; +a1 = a1; +L42777c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4277e8;} +//nop; +t8 = 0x100002d8; +at = 0x10000370; +t8 = MEM_U32(t8 + 0); +t9 = 0x1; +if (t8 != 0) {MEM_U32(at + 0) = t9; +goto L4277d8;} +MEM_U32(at + 0) = t9; +a1 = 0x10004928; +//nop; +a0 = 0x1000a4d0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4277b4; +a1 = a1; +L4277b4: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10004930; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4277d0; +a1 = a1; +L4277d0: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L4277d8: +at = 0x100002d8; +t5 = 0x1; +MEM_U32(at + 0) = t5; +goto L427830; +MEM_U32(at + 0) = t5; +L4277e8: +t1 = 0x10004938; +//nop; +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L427810; +MEM_U32(sp + 16) = zero; +L427810: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L427828; +//nop; +L427828: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L427830: +a0 = 0x1000a27c; +a1 = 0x10004954; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L427848; +a1 = a1; +L427848: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L427958;} +//nop; +a0 = 0x1000a27c; +a1 = 0x1000495c; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42786c; +a1 = a1; +L42786c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L427958;} +//nop; +a0 = 0x1000a27c; +a1 = 0x10004964; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L427890; +a1 = a1; +L427890: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L427958;} +//nop; +a0 = 0x1000a27c; +a1 = 0x1000496c; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4278b4; +a1 = a1; +L4278b4: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L427958;} +//nop; +a1 = 0x1000a27c; +a0 = 0x10004974; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +v0 = wrapper_strcat(mem, a0, a1); +goto L4278d8; +a0 = a0; +L4278d8: +// bdead 4002000b gp = MEM_U32(sp + 64); +s4 = v0; +a1 = 0x10004978; +//nop; +a0 = s4; +a1 = a1; +v0 = wrapper_fopen(mem, a0, a1); +goto L4278f4; +a1 = a1; +L4278f4: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L427958;} +//nop; +t6 = 0x1000036c; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L427948;} +//nop; +t3 = 0x1000497c; +//nop; +t3 = t3; +MEM_U32(sp + 20) = t3; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L427940; +MEM_U32(sp + 16) = zero; +L427940: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L427948: +t0 = 0x100049c4; +at = 0x1000a27c; +t0 = t0; +MEM_U32(at + 0) = t0; +L427958: +t4 = 0x10000370; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L4279a8;} +//nop; +a0 = 0x1000a25c; +a1 = 0x1000a27c; +a2 = 0x100049cc; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 0); +a3 = zero; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L427994; +a2 = a2; +L427994: +// bdead 4002010b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000a25c; +//nop; +MEM_U32(at + 0) = v0; +L4279a8: +t2 = 0x10000280; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L4279f0;} +//nop; +a0 = 0x1000a25c; +a1 = 0x100049d0; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4279dc; +a1 = a1; +L4279dc: +// bdead 4002000b gp = MEM_U32(sp + 64); +//nop; +at = 0x10000084; +MEM_U32(at + 0) = v0; +goto L427a48; +MEM_U32(at + 0) = v0; +L4279f0: +a0 = 0x1000a25c; +a1 = 0x100049e0; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L427a0c; +a1 = a1; +L427a0c: +// bdead 4002010b gp = MEM_U32(sp + 64); +a2 = zero; +a0 = 0x1000a25c; +at = 0x1000008c; +a1 = 0x100049f0; +//nop; +a0 = MEM_U32(a0 + 0); +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L427a34; +a1 = a1; +L427a34: +// bdead 4002000b gp = MEM_U32(sp + 64); +//nop; +at = 0x10000084; +//nop; +MEM_U32(at + 0) = v0; +L427a48: +t7 = 0x1000a1b4; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L427a80;} +//nop; +a0 = 0x100049fc; +//nop; +a1 = zero; +a2 = t7; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L427a78; +a0 = a0; +L427a78: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L427a80: +//nop; +//nop; +//nop; +f_newrunlib(mem, sp); +goto L427a90; +//nop; +L427a90: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L427a98: +t9 = MEM_U32(sp + 340); +t8 = s0 << 2; +t5 = t9 + t8; +//nop; +a0 = MEM_U32(t5 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L427ab4; +//nop; +L427ab4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L427ac0: +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10004a00; +//nop; +t3 = t1 + t6; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L427ae0; +a1 = a1; +L427ae0: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L427b74;} +//nop; +t0 = 0x10000304; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L427b1c;} +//nop; +t4 = 0x1000030c; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L427b64;} +//nop; +L427b1c: +t2 = 0x10004a0c; +//nop; +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L427b44; +MEM_U32(sp + 16) = zero; +L427b44: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L427b5c; +//nop; +L427b5c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L427b64: +at = 0x10000300; +t7 = 0x1; +MEM_U32(at + 0) = t7; +goto L42a934; +MEM_U32(at + 0) = t7; +L427b74: +t9 = MEM_U32(sp + 340); +t8 = s0 << 2; +t5 = t9 + t8; +t1 = MEM_U32(t5 + 0); +at = 0x6f; +t6 = MEM_U8(t1 + 2); +//nop; +if (t6 != at) {//nop; +goto L427da4;} +//nop; +t3 = s0 << 2; +t0 = t9 + t3; +t4 = MEM_U32(t0 + 0); +at = 0x70; +t2 = MEM_U8(t4 + 3); +//nop; +if (t2 != at) {//nop; +goto L427da4;} +//nop; +t7 = s0 << 2; +t8 = t9 + t7; +t5 = MEM_U32(t8 + 0); +at = 0x74; +t1 = MEM_U8(t5 + 4); +//nop; +if (t1 != at) {//nop; +goto L427da4;} +//nop; +t6 = 0x1000a36c; +at = 0x1; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == at) {at = 0x3; +goto L427c2c;} +at = 0x3; +if (t6 == at) {//nop; +goto L427c2c;} +//nop; +t3 = 0x10004a40; +//nop; +t3 = t3; +MEM_U32(sp + 20) = t3; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L427c20; +MEM_U32(sp + 16) = zero; +L427c20: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L427c2c: +t0 = 0x1000a36c; +at = 0x1; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L427cb0;} +//nop; +t4 = 0x10000008; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L427cb0;} +//nop; +t2 = 0x10004a7c; +t9 = MEM_U32(sp + 340); +t7 = s0 << 2; +t2 = t2; +t8 = t9 + t7; +t1 = 0x10004aac; +MEM_U32(sp + 20) = t2; +MEM_U32(sp + 16) = zero; +t5 = MEM_U32(t8 + 0); +//nop; +t1 = t1; +MEM_U32(sp + 28) = t1; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t5; +f_error(mem, sp, a0, a1, a2, a3); +goto L427ca4; +MEM_U32(sp + 24) = t5; +L427ca4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L427cb0: +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +t0 = t6 + t3; +t4 = MEM_U32(t0 + 0); +at = 0x1000a1d4; +t2 = t4 + 0x5; +MEM_U32(at + 0) = t2; +t9 = MEM_U8(t2 + 0); +at = 0x2c; +if (t9 != at) {//nop; +goto L427d94;} +//nop; +L427cdc: +t7 = 0x1000a1d4; +t8 = 0x1000a1d4; +t7 = MEM_U32(t7 + 0); +at = 0x1000a1d4; +MEM_U8(t7 + 0) = (uint8_t)zero; +t8 = MEM_U32(t8 + 0); +//nop; +a0 = 0x1000a5e0; +t5 = t8 + 0x1; +a1 = t5; +MEM_U32(at + 0) = t5; +f_addstr(mem, sp, a0, a1); +goto L427d0c; +MEM_U32(at + 0) = t5; +L427d0c: +// bdead 40020103 gp = MEM_U32(sp + 64); +at = 0x2c; +t1 = 0x1000a1d4; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +t6 = MEM_U8(t1 + 0); +//nop; +if (t6 == at) {//nop; +goto L427d74;} +//nop; +if (t6 == 0) {//nop; +goto L427d74;} +//nop; +L427d3c: +t3 = 0x1000a1d4; +at = 0x1000a1d4; +t3 = MEM_U32(t3 + 0); +t4 = 0x1000a1d4; +t0 = t3 + 0x1; +MEM_U32(at + 0) = t0; +t4 = MEM_U32(t4 + 0); +at = 0x2c; +t2 = MEM_U8(t4 + 0); +//nop; +if (t2 == at) {//nop; +goto L427d74;} +//nop; +if (t2 != 0) {//nop; +goto L427d3c;} +//nop; +L427d74: +t9 = 0x1000a1d4; +at = 0x2c; +t9 = MEM_U32(t9 + 0); +//nop; +t7 = MEM_U8(t9 + 0); +//nop; +if (t7 == at) {//nop; +goto L427cdc;} +//nop; +L427d94: +at = 0x1000043c; +t8 = 0x1; +MEM_U32(at + 0) = t8; +goto L42a934; +MEM_U32(at + 0) = t8; +L427da4: +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x10004ab0; +//nop; +t6 = t5 + t1; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L427dc4; +a1 = a1; +L427dc4: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000234; +goto L427ddc;} +at = 0x10000234; +t3 = 0x1; +MEM_U32(at + 0) = t3; +goto L42a934; +MEM_U32(at + 0) = t3; +L427ddc: +t0 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x10004ab8; +//nop; +t2 = t0 + t4; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L427dfc; +a1 = a1; +L427dfc: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000234; +goto L427e1c;} +at = 0x10000234; +t9 = 0x1; +MEM_U32(at + 0) = t9; +at = 0x10000238; +MEM_U32(at + 0) = zero; +goto L42a934; +MEM_U32(at + 0) = zero; +L427e1c: +t7 = MEM_U32(sp + 340); +t8 = s0 << 2; +a1 = 0x10004ac0; +//nop; +t5 = t7 + t8; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L427e3c; +a1 = a1; +L427e3c: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L427e64;} +//nop; +t1 = 0x10000380; +at = 0x10000380; +t1 = MEM_U32(t1 + 0); +//nop; +t6 = t1 + 0x1; +MEM_U32(at + 0) = t6; +goto L42a934; +MEM_U32(at + 0) = t6; +L427e64: +t3 = 0x1000a36c; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +t0 = t3 ^ 0x1; +t0 = t0 < 0x1; +if (t0 == 0) {//nop; +goto L42815c;} +//nop; +if (t0 == 0) {//nop; +goto L427f70;} +//nop; +t4 = 0x10000008; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L427f70;} +//nop; +t2 = MEM_U32(sp + 340); +t9 = s0 << 2; +t7 = t2 + t9; +//nop; +a1 = 0x10004ac8; +a0 = MEM_U32(t7 + 0); +a2 = 0x6; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L427ec8; +a1 = a1; +L427ec8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L427f70;} +//nop; +t8 = MEM_U32(sp + 340); +t5 = s0 << 2; +t1 = t8 + t5; +t6 = MEM_U32(t1 + 0); +at = 0x2c; +t3 = MEM_U8(t6 + 6); +//nop; +if (t3 != at) {//nop; +goto L427f34;} +//nop; +t0 = s0 << 2; +t4 = t8 + t0; +t2 = MEM_U32(t4 + 0); +//nop; +t9 = MEM_U8(t2 + 7); +//nop; +if (t9 == 0) {//nop; +goto L427f34;} +//nop; +t7 = s0 << 2; +t5 = t8 + t7; +t1 = MEM_U32(t5 + 0); +at = 0x1000010c; +t6 = t1 + 0x7; +MEM_U32(at + 0) = t6; +goto L427f40; +MEM_U32(at + 0) = t6; +L427f34: +at = 0x1000010c; +//nop; +MEM_U32(at + 0) = zero; +L427f40: +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t4 = t3 + t0; +a0 = MEM_U32(t4 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L427f5c; +//nop; +L427f5c: +// bdead 40020103 gp = MEM_U32(sp + 64); +t2 = 0x1; +at = 0x10000108; +MEM_U32(at + 0) = t2; +goto L42a934; +MEM_U32(at + 0) = t2; +L427f70: +t9 = MEM_U32(sp + 340); +t8 = s0 << 2; +t7 = t9 + t8; +//nop; +a1 = 0x10004ad0; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L427f90; +a1 = a1; +L427f90: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000348; +goto L427fb8;} +at = 0x10000348; +t5 = 0x10000254; +MEM_U32(at + 0) = zero; +t5 = MEM_U32(t5 + 0); +at = 0x10000254; +t1 = t5 + 0x1; +MEM_U32(at + 0) = t1; +goto L42a934; +MEM_U32(at + 0) = t1; +L427fb8: +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10004ad8; +//nop; +t0 = t6 + t3; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L427fd8; +a1 = a1; +L427fd8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000270; +goto L428014;} +at = 0x10000270; +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +MEM_U32(at + 0) = zero; +t9 = t4 + t2; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a310; +//nop; +f_addstr(mem, sp, a0, a1); +goto L428008; +//nop; +L428008: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428014: +t8 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10004ae0; +//nop; +t5 = t8 + t7; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L428034; +a1 = a1; +L428034: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L428068;} +//nop; +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10004ae8; +//nop; +t3 = t1 + t6; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L428060; +a1 = a1; +L428060: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000270; +goto L4280a0;} +L428068: +at = 0x10000270; +t4 = MEM_U32(sp + 340); +t0 = 0x1; +t2 = s0 << 2; +MEM_U32(at + 0) = t0; +t9 = t4 + t2; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a310; +//nop; +f_addstr(mem, sp, a0, a1); +goto L428094; +//nop; +L428094: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4280a0: +t8 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10004af0; +//nop; +t5 = t8 + t7; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4280c0; +a1 = a1; +L4280c0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42815c;} +//nop; +a1 = 0x10004af8; +//nop; +a0 = 0x1000a5d0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4280e0; +a1 = a1; +L4280e0: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10004b00; +//nop; +a0 = 0x1000a5e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4280fc; +a1 = a1; +L4280fc: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10004b08; +//nop; +a0 = 0x1000a310; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L428118; +a1 = a1; +L428118: +// bdead 40020103 gp = MEM_U32(sp + 64); +at = 0x1; +t1 = 0x1000a36c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L42a934;} +//nop; +t6 = 0x10000008; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {at = 0x1000025c; +goto L42a934;} +at = 0x1000025c; +t3 = 0x1; +MEM_U32(at + 0) = t3; +goto L42a934; +MEM_U32(at + 0) = t3; +L42815c: +t0 = 0x1000a36c; +at = 0x4; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L42822c;} +//nop; +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +t9 = t4 + t2; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10004b14; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L428194; +a1 = a1; +L428194: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4281f4;} +//nop; +t8 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10004b1c; +//nop; +t5 = t8 + t7; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4281c0; +a1 = a1; +L4281c0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L4281f4;} +//nop; +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10004b24; +//nop; +t3 = t1 + t6; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4281ec; +a1 = a1; +L4281ec: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000270; +goto L42822c;} +L4281f4: +at = 0x10000270; +t4 = MEM_U32(sp + 340); +t0 = 0x1; +t2 = s0 << 2; +MEM_U32(at + 0) = t0; +t9 = t4 + t2; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a310; +//nop; +f_addstr(mem, sp, a0, a1); +goto L428220; +//nop; +L428220: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42822c: +t8 = 0x1000a36c; +at = 0x3; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L428378;} +//nop; +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +a1 = 0x10004b2c; +//nop; +t1 = t7 + t5; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L428264; +a1 = a1; +L428264: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42829c;} +//nop; +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t0 = t6 + t3; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L428290; +//nop; +L428290: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42829c: +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +t9 = t4 + t2; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10004b34; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4282bc; +a1 = a1; +L4282bc: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000284; +goto L4282d0;} +at = 0x10000284; +MEM_U32(at + 0) = zero; +goto L42a934; +MEM_U32(at + 0) = zero; +L4282d0: +t8 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10004b3c; +//nop; +t5 = t8 + t7; +a0 = MEM_U32(t5 + 0); +a2 = 0x7; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L4282f4; +a1 = a1; +L4282f4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L428378;} +//nop; +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +t3 = t1 + t6; +a0 = MEM_U32(t3 + 0); +a1 = 0x10004b44; +//nop; +a0 = a0 + 0x7; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L428324; +a1 = a1; +L428324: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000039c; +goto L42833c;} +at = 0x1000039c; +t0 = 0x1; +MEM_U32(at + 0) = t0; +goto L42a934; +MEM_U32(at + 0) = t0; +L42833c: +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +t9 = t4 + t2; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10004b48; +a0 = a0 + 0x7; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L428360; +a1 = a1; +L428360: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x1000039c; +goto L428378;} +at = 0x1000039c; +t8 = 0x2; +MEM_U32(at + 0) = t8; +goto L42a934; +MEM_U32(at + 0) = t8; +L428378: +t7 = 0x1000a36c; +at = 0x2; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L4283f0;} +//nop; +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +a1 = 0x10004b4c; +//nop; +t6 = t5 + t1; +a0 = MEM_U32(t6 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4283b0; +a1 = a1; +L4283b0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000270; +goto L4283f0;} +at = 0x10000270; +t0 = MEM_U32(sp + 340); +t3 = 0x1; +t4 = s0 << 2; +//nop; +MEM_U32(at + 0) = t3; +t2 = t0 + t4; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a320; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4283e4; +//nop; +L4283e4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4283f0: +t9 = 0x1000a36c; +at = 0x6; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L4284b8;} +//nop; +t8 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10004b54; +//nop; +t5 = t8 + t7; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L428428; +a1 = a1; +L428428: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42848c;} +//nop; +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10004b60; +//nop; +t3 = t1 + t6; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L428454; +a1 = a1; +L428454: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42848c;} +//nop; +t0 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x10004b6c; +//nop; +t2 = t0 + t4; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L428480; +a1 = a1; +L428480: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4284b8;} +//nop; +L42848c: +t9 = MEM_U32(sp + 340); +t8 = s0 << 2; +t7 = t9 + t8; +//nop; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a418; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4284ac; +//nop; +L4284ac: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4284b8: +t5 = 0x1000a36c; +at = 0x4; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L42a880;} +//nop; +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10004b78; +//nop; +t3 = t1 + t6; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4284f0; +a1 = a1; +L4284f0: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +//nop; +goto L42a934; +//nop; +L428504: +t0 = MEM_U32(sp + 340); +t4 = s0 << 2; +a1 = 0x10004b80; +//nop; +t2 = t0 + t4; +a0 = MEM_U32(t2 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L428524; +a1 = a1; +L428524: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000330; +goto L428550;} +at = 0x10000330; +t9 = 0x1; +MEM_U32(at + 0) = zero; +at = 0x1000032c; +//nop; +MEM_U32(at + 0) = t9; +at = 0x10000334; +MEM_U32(at + 0) = zero; +goto L42a934; +MEM_U32(at + 0) = zero; +L428550: +t8 = MEM_U32(sp + 340); +t7 = s0 << 2; +a1 = 0x10004b94; +//nop; +t5 = t8 + t7; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L428570; +a1 = a1; +L428570: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000350; +goto L4286d0;} +at = 0x10000350; +t6 = MEM_U32(sp + 340); +t1 = 0x1; +t3 = s0 << 2; +//nop; +MEM_U32(at + 0) = t1; +t0 = t6 + t3; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a320; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4285a4; +//nop; +L4285a4: +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +// bdead 40022803 gp = MEM_U32(sp + 64); +t9 = t4 + t2; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4285c8; +//nop; +L4285c8: +// bdead 40020003 gp = MEM_U32(sp + 64); +t8 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t5 = t8 + t7; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a408; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4285ec; +//nop; +L4285ec: +// bdead 40020003 gp = MEM_U32(sp + 64); +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t3 = t1 + t6; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a418; +//nop; +f_addstr(mem, sp, a0, a1); +goto L428610; +//nop; +L428610: +// bdead 40020003 gp = MEM_U32(sp + 64); +t0 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t2 = t0 + t4; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a428; +//nop; +f_addstr(mem, sp, a0, a1); +goto L428634; +//nop; +L428634: +t9 = MEM_U32(sp + 340); +// bdead 44020003 gp = MEM_U32(sp + 64); +t8 = s0 << 2; +t7 = t9 + t8; +//nop; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a360; +//nop; +f_addstr(mem, sp, a0, a1); +goto L428658; +//nop; +L428658: +// bdead 40020003 gp = MEM_U32(sp + 64); +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +//nop; +t6 = t5 + t1; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a370; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42867c; +//nop; +L42867c: +// bdead 40020003 gp = MEM_U32(sp + 64); +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t4 = t3 + t0; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a4c0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4286a0; +//nop; +L4286a0: +t2 = MEM_U32(sp + 340); +// bdead 40020803 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t8 = t2 + t9; +//nop; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a4d0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4286c4; +//nop; +L4286c4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4286d0: +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +a1 = 0x10004b9c; +//nop; +t1 = t7 + t5; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4286f0; +a1 = a1; +L4286f0: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {at = 0x10000378; +goto L428708;} +at = 0x10000378; +t6 = 0x1; +MEM_U32(at + 0) = t6; +goto L42a934; +MEM_U32(at + 0) = t6; +L428708: +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x10004ba4; +//nop; +t4 = t3 + t0; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L428728; +a1 = a1; +L428728: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L428750;} +//nop; +t2 = 0x100003ec; +at = 0x100003ec; +t2 = MEM_U32(t2 + 0); +//nop; +t9 = t2 + 0x1; +MEM_U32(at + 0) = t9; +goto L42a934; +MEM_U32(at + 0) = t9; +L428750: +t8 = MEM_U32(sp + 340); +t7 = s0 << 2; +t5 = t8 + t7; +t1 = MEM_U32(t5 + 0); +at = 0x1000a1ac; +//nop; +a0 = 0x1000a1c0; +t6 = t1 + 0x2; +a1 = t6; +MEM_U32(at + 0) = t6; +v0 = wrapper_strcat(mem, a0, a1); +goto L42877c; +MEM_U32(at + 0) = t6; +L42877c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428788: +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +t4 = t3 + t0; +t2 = MEM_U32(t4 + 0); +//nop; +t9 = MEM_U8(t2 + 2); +//nop; +t8 = t9 + 0xffffffbf; +at = t8 < 0x3a; +if (at == 0) {//nop; +goto L428cdc;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10007610[] = { +&&L4287d0, +&&L428cdc, +&&L428818, +&&L428cdc, +&&L428cdc, +&&L428860, +&&L428a58, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L4288a8, +&&L428cdc, +&&L4288f0, +&&L428cdc, +&&L428a10, +&&L428cdc, +&&L428cdc, +&&L428938, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428980, +&&L428a88, +&&L428cdc, +&&L4289c8, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428a78, +&&L428bc4, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428bf8, +&&L428cdc, +&&L428cdc, +&&L428cdc, +&&L428c94, +}; +dest = Lswitch10007610[t8]; +//nop; +goto *dest; +//nop; +L4287d0: +t7 = 0x10004bb4; +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +t7 = t7; +MEM_U32(sp + 20) = t7; +MEM_U32(sp + 16) = zero; +t6 = t5 + t1; +t3 = MEM_U32(t6 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L42880c; +MEM_U32(sp + 24) = t3; +L42880c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428818: +t0 = 0x10004bc8; +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +t0 = t0; +MEM_U32(sp + 20) = t0; +MEM_U32(sp + 16) = zero; +t9 = t4 + t2; +t8 = MEM_U32(t9 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t8; +f_error(mem, sp, a0, a1, a2, a3); +goto L428854; +MEM_U32(sp + 24) = t8; +L428854: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428860: +t7 = 0x10004bdc; +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +t7 = t7; +MEM_U32(sp + 20) = t7; +MEM_U32(sp + 16) = zero; +t6 = t5 + t1; +t3 = MEM_U32(t6 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L42889c; +MEM_U32(sp + 24) = t3; +L42889c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4288a8: +t0 = 0x10004bf0; +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +t0 = t0; +MEM_U32(sp + 20) = t0; +MEM_U32(sp + 16) = zero; +t9 = t4 + t2; +t8 = MEM_U32(t9 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t8; +f_error(mem, sp, a0, a1, a2, a3); +goto L4288e4; +MEM_U32(sp + 24) = t8; +L4288e4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4288f0: +t7 = 0x10004c04; +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +t7 = t7; +MEM_U32(sp + 20) = t7; +MEM_U32(sp + 16) = zero; +t6 = t5 + t1; +t3 = MEM_U32(t6 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L42892c; +MEM_U32(sp + 24) = t3; +L42892c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428938: +t0 = 0x10004c18; +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +t0 = t0; +MEM_U32(sp + 20) = t0; +MEM_U32(sp + 16) = zero; +t9 = t4 + t2; +t8 = MEM_U32(t9 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t8; +f_error(mem, sp, a0, a1, a2, a3); +goto L428974; +MEM_U32(sp + 24) = t8; +L428974: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428980: +t7 = 0x10004c2c; +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +t7 = t7; +MEM_U32(sp + 20) = t7; +MEM_U32(sp + 16) = zero; +t6 = t5 + t1; +t3 = MEM_U32(t6 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L4289bc; +MEM_U32(sp + 24) = t3; +L4289bc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4289c8: +t0 = 0x10004c40; +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +t0 = t0; +MEM_U32(sp + 20) = t0; +MEM_U32(sp + 16) = zero; +t9 = t4 + t2; +t8 = MEM_U32(t9 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t8; +f_error(mem, sp, a0, a1, a2, a3); +goto L428a04; +MEM_U32(sp + 24) = t8; +L428a04: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428a10: +t7 = 0x10004c54; +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +t7 = t7; +MEM_U32(sp + 20) = t7; +MEM_U32(sp + 16) = zero; +t6 = t5 + t1; +t3 = MEM_U32(t6 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L428a4c; +MEM_U32(sp + 24) = t3; +L428a4c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428a58: +a1 = 0x10004c68; +//nop; +a0 = 0x1000a5a8; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L428a6c; +a1 = a1; +L428a6c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428a78: +at = 0x10000234; +t0 = 0x1; +MEM_U32(at + 0) = t0; +goto L42a934; +MEM_U32(at + 0) = t0; +L428a88: +t4 = 0x10004c6c; +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L428ab0; +MEM_U32(sp + 16) = zero; +L428ab0: +// bdead 40020103 gp = MEM_U32(sp + 64); +at = 0x1; +t2 = 0x1000a36c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L428b00;} +//nop; +t9 = 0x10004c90; +a0 = 0x2; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L428af8; +MEM_U32(sp + 16) = zero; +L428af8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L428b00: +t8 = 0x1000038c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L428b30;} +//nop; +t7 = 0x1000a36c; +at = 0x3; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L428b60;} +//nop; +L428b30: +t5 = 0x10004cd4; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L428b58; +MEM_U32(sp + 16) = zero; +L428b58: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L428b60: +t1 = 0x10000388; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L428b90;} +//nop; +t6 = 0x1000a36c; +at = 0x2; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L42a934;} +//nop; +L428b90: +t3 = 0x10004d08; +//nop; +t3 = t3; +MEM_U32(sp + 20) = t3; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L428bb8; +MEM_U32(sp + 16) = zero; +L428bb8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428bc4: +t0 = 0x10004d50; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L428bec; +MEM_U32(sp + 16) = zero; +L428bec: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428bf8: +at = 0x10000270; +a1 = 0x10004d74; +//nop; +t4 = 0x1; +a0 = 0x1000a310; +MEM_U32(at + 0) = t4; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L428c18; +a1 = a1; +L428c18: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10004d7c; +//nop; +a0 = 0x1000a320; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L428c34; +a1 = a1; +L428c34: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10004d84; +//nop; +a0 = 0x1000a330; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L428c50; +a1 = a1; +L428c50: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10004d8c; +//nop; +a0 = 0x1000a408; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L428c6c; +a1 = a1; +L428c6c: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +a1 = 0x10004d94; +//nop; +a0 = 0x1000a418; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L428c88; +a1 = a1; +L428c88: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428c94: +t2 = 0x10004d9c; +t9 = MEM_U32(sp + 340); +t8 = s0 << 2; +t2 = t2; +t7 = t9 + t8; +MEM_U32(sp + 20) = t2; +MEM_U32(sp + 16) = zero; +t5 = MEM_U32(t7 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t5; +f_error(mem, sp, a0, a1, a2, a3); +goto L428cd0; +MEM_U32(sp + 24) = t5; +L428cd0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428cdc: +t1 = 0x10004db0; +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +t1 = t1; +MEM_U32(sp + 20) = t1; +MEM_U32(sp + 16) = zero; +t0 = t6 + t3; +t4 = MEM_U32(t0 + 0); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t4; +f_error(mem, sp, a0, a1, a2, a3); +goto L428d18; +MEM_U32(sp + 24) = t4; +L428d18: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L428d30; +//nop; +L428d30: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428d3c: +t2 = MEM_U32(sp + 340); +t9 = s0 << 2; +t8 = t2 + t9; +t7 = MEM_U32(t8 + 0); +at = 0x6e; +s4 = MEM_U8(t7 + 2); +//nop; +if (s4 == at) {at = 0x78; +goto L428d70;} +at = 0x78; +if (s4 == at) {//nop; +goto L428db8;} +//nop; +//nop; +goto L428e00; +//nop; +L428d70: +t5 = 0x10004dcc; +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +t5 = t5; +MEM_U32(sp + 20) = t5; +MEM_U32(sp + 16) = zero; +t3 = t1 + t6; +t0 = MEM_U32(t3 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t0; +f_error(mem, sp, a0, a1, a2, a3); +goto L428dac; +MEM_U32(sp + 24) = t0; +L428dac: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428db8: +t4 = 0x10004ddc; +t2 = MEM_U32(sp + 340); +t9 = s0 << 2; +t4 = t4; +t8 = t2 + t9; +MEM_U32(sp + 20) = t4; +MEM_U32(sp + 16) = zero; +t7 = MEM_U32(t8 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t7; +f_error(mem, sp, a0, a1, a2, a3); +goto L428df4; +MEM_U32(sp + 24) = t7; +L428df4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428e00: +t5 = 0x10004dec; +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +t5 = t5; +MEM_U32(sp + 20) = t5; +MEM_U32(sp + 16) = zero; +t3 = t1 + t6; +t0 = MEM_U32(t3 + 0); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t0; +f_error(mem, sp, a0, a1, a2, a3); +goto L428e3c; +MEM_U32(sp + 24) = t0; +L428e3c: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L428e54; +//nop; +L428e54: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428e60: +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +t9 = t4 + t2; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10004e08; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L428e80; +a1 = a1; +L428e80: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +t8 = MEM_U32(sp + 340); +t7 = s0 << 2; +t5 = t8 + t7; +t1 = MEM_U32(t5 + 0); +//nop; +t6 = MEM_U8(t1 + 2); +//nop; +if (t6 != 0) {//nop; +goto L428fb8;} +//nop; +t3 = 0x1000a36c; +at = 0x3; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {at = 0x1000a174; +goto L428f18;} +at = 0x1000a174; +t0 = 0x1; +t4 = s0 << 2; +//nop; +t2 = t8 + t4; +MEM_U32(at + 0) = t0; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L428eec; +//nop; +L428eec: +t9 = MEM_U32(sp + 340); +// bdead 44020003 gp = MEM_U32(sp + 64); +t7 = s0 << 2; +t5 = t9 + t7; +//nop; +a0 = MEM_U32(t5 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L428f0c; +//nop; +L428f0c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428f18: +t1 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t1; +if (at == 0) {//nop; +goto L428f70;} +//nop; +a1 = 0x10004e10; +//nop; +a0 = 0x1000a540; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L428f40; +a1 = a1; +L428f40: +// bdead 40020003 gp = MEM_U32(sp + 64); +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t0 = t6 + t3; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L428f64; +//nop; +L428f64: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L428f70: +t8 = 0x10004e14; +//nop; +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L428f98; +MEM_U32(sp + 16) = zero; +L428f98: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L428fb0; +//nop; +L428fb0: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L428fb8: +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +t9 = t4 + t2; +a0 = MEM_U32(t9 + 0); +//nop; +a1 = 0x10004e38; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L428fd8; +a1 = a1; +L428fd8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L429030;} +//nop; +t7 = 0x10004e40; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L42900c; +MEM_U32(sp + 16) = zero; +L42900c: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L429024; +//nop; +L429024: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +goto L4290a0; +//nop; +L429030: +t5 = 0x1000a36c; +at = 0x3; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L4290a0;} +//nop; +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10004e64; +//nop; +t3 = t1 + t6; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L429068; +a1 = a1; +L429068: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4290a0;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t4 = t0 + t8; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429094; +//nop; +L429094: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4290a0: +t2 = MEM_U32(sp + 340); +t9 = s0 << 2; +t7 = t2 + t9; +//nop; +a1 = 0x10004e70; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4290c0; +a1 = a1; +L4290c0: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42913c;} +//nop; +t5 = 0x1000a36c; +at = 0x1; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L42911c;} +//nop; +t1 = 0x10000008; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L42911c;} +//nop; +a1 = 0x10004e88; +//nop; +a0 = 0x1000a2f0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L429110; +a1 = a1; +L429110: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42911c: +a1 = 0x10004e90; +//nop; +a0 = 0x1000a2b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L429130; +a1 = a1; +L429130: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42913c: +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10004ea8; +//nop; +t0 = t6 + t3; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42915c; +a1 = a1; +L42915c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4291d8;} +//nop; +t8 = 0x1000a36c; +at = 0x1; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L4291b8;} +//nop; +t4 = 0x10000008; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L4291b8;} +//nop; +a1 = 0x10004ebc; +//nop; +a0 = 0x1000a2f0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4291ac; +a1 = a1; +L4291ac: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4291b8: +a1 = 0x10004ec4; +//nop; +a0 = 0x1000a2b0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4291cc; +a1 = a1; +L4291cc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4291d8: +t2 = 0x1000a36c; +at = 0x1; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L42a880;} +//nop; +t9 = MEM_U32(sp + 340); +t7 = s0 << 2; +t5 = t9 + t7; +//nop; +a1 = 0x10004ed8; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L429210; +a1 = a1; +L429210: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t1 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t1; +if (at != 0) {//nop; +goto L429278;} +//nop; +t6 = 0x10004eec; +//nop; +t6 = t6; +MEM_U32(sp + 20) = t6; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L429258; +MEM_U32(sp + 16) = zero; +L429258: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L429270; +//nop; +L429270: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L429278: +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t8 = t3 + t0; +a1 = MEM_U32(t8 + -4); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429298; +//nop; +L429298: +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +// bdead 40022803 gp = MEM_U32(sp + 64); +t9 = t4 + t2; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4292bc; +//nop; +L4292bc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4292c8: +t7 = MEM_U32(sp + 340); +t5 = s0 << 2; +t1 = t7 + t5; +t6 = MEM_U32(t1 + 0); +//nop; +t3 = MEM_U8(t6 + 2); +//nop; +if (t3 != 0) {//nop; +goto L429310;} +//nop; +t0 = 0x10000420; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != 0) {at = 0x10000234; +goto L42a934;} +at = 0x10000234; +t8 = 0x1; +MEM_U32(at + 0) = t8; +goto L42a934; +MEM_U32(at + 0) = t8; +L429310: +t4 = 0x1000a36c; +at = 0x1; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L429420;} +//nop; +t2 = MEM_U32(sp + 340); +t9 = s0 << 2; +t7 = t2 + t9; +//nop; +a1 = 0x10004f1c; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L429348; +a1 = a1; +L429348: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L429388;} +//nop; +t5 = 0x10004f28; +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L42937c; +MEM_U32(sp + 16) = zero; +L42937c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L429388: +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10004f70; +//nop; +t3 = t1 + t6; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4293a8; +a1 = a1; +L4293a8: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4293d4;} +//nop; +a1 = 0x10004f7c; +//nop; +a0 = 0x1000a310; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4293c8; +a1 = a1; +L4293c8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4293d4: +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +a1 = 0x10004f88; +//nop; +t4 = t0 + t8; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4293f4; +a1 = a1; +L4293f4: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L429420;} +//nop; +a1 = 0x10004f94; +//nop; +a0 = 0x1000a310; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L429414; +a1 = a1; +L429414: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L429420: +t2 = 0x1000a36c; +at = 0x3; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L4294e0;} +//nop; +t9 = MEM_U32(sp + 340); +t7 = s0 << 2; +t5 = t9 + t7; +//nop; +a1 = 0x10004fa0; +a0 = MEM_U32(t5 + 0); +a2 = 0x4; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L42945c; +a1 = a1; +L42945c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L429494;} +//nop; +t1 = MEM_U32(sp + 340); +t6 = s0 << 2; +a1 = 0x10004fa8; +//nop; +t3 = t1 + t6; +a0 = MEM_U32(t3 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L429488; +a1 = a1; +L429488: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4294e0;} +//nop; +L429494: +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t4 = t0 + t8; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4294b4; +//nop; +L4294b4: +t2 = MEM_U32(sp + 340); +// bdead 40020803 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t7 = t2 + t9; +//nop; +a0 = MEM_U32(t7 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L4294d4; +//nop; +L4294d4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4294e0: +t5 = 0x1000a36c; +at = 0x1; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L42a880;} +//nop; +t1 = 0x10000008; +at = 0x2; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == at) {at = 0x3; +goto L429518;} +at = 0x3; +if (t1 != at) {//nop; +goto L42a880;} +//nop; +L429518: +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10004fb4; +//nop; +t0 = t6 + t3; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L429538; +a1 = a1; +L429538: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a880;} +//nop; +t8 = 0x1000a36c; +at = 0x1; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L42a934;} +//nop; +t4 = 0x10000008; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42a934;} +//nop; +t2 = 0x10004fb8; +t9 = MEM_U32(sp + 340); +t7 = s0 << 2; +t2 = t2; +t5 = t9 + t7; +t6 = 0x10004fe8; +MEM_U32(sp + 20) = t2; +MEM_U32(sp + 16) = zero; +t1 = MEM_U32(t5 + 0); +//nop; +t6 = t6; +MEM_U32(sp + 28) = t6; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t1; +f_error(mem, sp, a0, a1, a2, a3); +goto L4295bc; +MEM_U32(sp + 24) = t1; +L4295bc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4295c8: +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L4296c0;} +//nop; +t0 = MEM_U32(sp + 340); +t8 = s0 << 2; +a1 = 0x10004fec; +//nop; +t4 = t0 + t8; +a0 = MEM_U32(t4 + 0); +a2 = 0x6; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L429604; +a1 = a1; +L429604: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L4296c0;} +//nop; +t2 = 0x1000a36c; +at = 0x1; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L429694;} +//nop; +t9 = 0x10000008; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L429694;} +//nop; +t7 = 0x10004ff4; +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +t7 = t7; +t0 = 0x10005024; +MEM_U32(sp + 20) = t7; +MEM_U32(sp + 16) = zero; +t6 = t5 + t1; +t3 = MEM_U32(t6 + 0); +//nop; +t0 = t0; +MEM_U32(sp + 28) = t0; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L429688; +MEM_U32(sp + 24) = t3; +L429688: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L429694: +t8 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t2 = t8 + t4; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a310; +//nop; +f_addstr(mem, sp, a0, a1); +goto L4296b4; +//nop; +L4296b4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4296c0: +t9 = MEM_U32(sp + 340); +t7 = s0 << 2; +t5 = t9 + t7; +//nop; +a1 = 0x10005028; +a0 = MEM_U32(t5 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4296e0; +a1 = a1; +L4296e0: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L429884;} +//nop; +t1 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t1; +if (at == 0) {//nop; +goto L42983c;} +//nop; +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10005030; +//nop; +t0 = t6 + t3; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L429720; +a1 = a1; +L429720: +// bdead 4002010b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L429734;} +//nop; +MEM_U32(sp + 304) = zero; +goto L42a934; +MEM_U32(sp + 304) = zero; +L429734: +t8 = MEM_U32(sp + 340); +t4 = s0 << 2; +t2 = t8 + t4; +t9 = MEM_U32(t2 + 0); +//nop; +t7 = MEM_U8(t9 + 0); +//nop; +at = (int)t7 < (int)0x30; +if (at != 0) {//nop; +goto L429780;} +//nop; +t5 = s0 << 2; +t1 = t8 + t5; +t6 = MEM_U32(t1 + 0); +//nop; +t3 = MEM_U8(t6 + 0); +//nop; +at = (int)t3 < (int)0x3a; +if (at != 0) {//nop; +goto L4297b4;} +//nop; +L429780: +t0 = 0x10005038; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4297a8; +MEM_U32(sp + 16) = zero; +L4297a8: +// bdead 40020103 gp = MEM_U32(sp + 64); +s0 = s0 + 0xffffffff; +goto L42a934; +s0 = s0 + 0xffffffff; +L4297b4: +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +t9 = t4 + t2; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000507c; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4297d8; +a0 = a0; +L4297d8: +// bdead 4002000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a2b0; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L4297f0; +a1 = s4; +L4297f0: +// bdead 40020103 gp = MEM_U32(sp + 64); +t7 = MEM_U32(sp + 340); +t8 = s0 << 2; +a0 = 0x10005084; +//nop; +t5 = t7 + t8; +a1 = MEM_U32(t5 + 0); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L429818; +a0 = a0; +L429818: +// bdead 4002000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a2f0; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L429830; +a1 = s4; +L429830: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42983c: +t1 = 0x10005088; +//nop; +t1 = t1; +MEM_U32(sp + 20) = t1; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L429864; +MEM_U32(sp + 16) = zero; +L429864: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L42987c; +//nop; +L42987c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L429884: +t6 = MEM_U32(sp + 340); +t3 = s0 << 2; +t0 = t6 + t3; +t4 = MEM_U32(t0 + 0); +at = 0x31; +t2 = MEM_U8(t4 + 2); +//nop; +if (t2 != at) {//nop; +goto L429934;} +//nop; +t9 = s0 << 2; +t7 = t6 + t9; +t8 = MEM_U32(t7 + 0); +//nop; +t5 = MEM_U8(t8 + 3); +//nop; +if (t5 != 0) {//nop; +goto L429934;} +//nop; +t1 = 0x1000a36c; +at = 0x3; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == at) {//nop; +goto L429924;} +//nop; +t3 = 0x100050c0; +t0 = s0 << 2; +t3 = t3; +MEM_U32(sp + 20) = t3; +t4 = t6 + t0; +MEM_U32(sp + 16) = zero; +t2 = MEM_U32(t4 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t2; +f_error(mem, sp, a0, a1, a2, a3); +goto L429918; +MEM_U32(sp + 24) = t2; +L429918: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L429924: +at = 0x10000398; +t9 = 0x1; +MEM_U32(at + 0) = t9; +goto L42a934; +MEM_U32(at + 0) = t9; +L429934: +t7 = MEM_U32(sp + 340); +t8 = s0 << 2; +t5 = t7 + t8; +t1 = MEM_U32(t5 + 0); +at = 0x30; +t3 = MEM_U8(t1 + 2); +//nop; +if (t3 != at) {//nop; +goto L4299e0;} +//nop; +t6 = s0 << 2; +t0 = t7 + t6; +t4 = MEM_U32(t0 + 0); +//nop; +t2 = MEM_U8(t4 + 3); +//nop; +if (t2 != 0) {//nop; +goto L4299e0;} +//nop; +t9 = 0x1000a36c; +at = 0x3; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == at) {//nop; +goto L4299d4;} +//nop; +t8 = 0x100050d4; +t5 = s0 << 2; +t8 = t8; +MEM_U32(sp + 20) = t8; +t1 = t7 + t5; +MEM_U32(sp + 16) = zero; +t3 = MEM_U32(t1 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L4299c8; +MEM_U32(sp + 24) = t3; +L4299c8: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L4299d4: +at = 0x10000398; +MEM_U32(at + 0) = zero; +goto L42a934; +MEM_U32(at + 0) = zero; +L4299e0: +t6 = MEM_U32(sp + 340); +t0 = s0 << 2; +t4 = t6 + t0; +t2 = MEM_U32(t4 + 0); +at = 0x36; +t9 = MEM_U8(t2 + 2); +//nop; +if (t9 != at) {//nop; +goto L429a70;} +//nop; +t8 = 0x1000a36c; +at = 0x3; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L429a44;} +//nop; +t7 = s0 << 2; +t5 = t6 + t7; +t1 = MEM_U32(t5 + 0); +at = 0x36; +t3 = MEM_U8(t1 + 2); +//nop; +if (t3 != at) {at = 0x1000a164; +goto L429a44;} +at = 0x1000a164; +t0 = 0x1; +MEM_U32(at + 0) = t0; +L429a44: +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +t9 = t4 + t2; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a330; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429a64; +//nop; +L429a64: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L429a70: +t8 = MEM_U32(sp + 340); +t6 = s0 << 2; +t7 = t8 + t6; +t5 = MEM_U32(t7 + 0); +//nop; +t1 = MEM_U8(t5 + 2); +//nop; +if (t1 == 0) {//nop; +goto L429b14;} +//nop; +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L429b14;} +//nop; +t0 = 0x10000008; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L429b14;} +//nop; +t4 = 0x100050e8; +t2 = s0 << 2; +t4 = t4; +MEM_U32(sp + 20) = t4; +t9 = t8 + t2; +MEM_U32(sp + 16) = zero; +t6 = MEM_U32(t9 + 0); +t7 = 0x10005118; +//nop; +t7 = t7; +MEM_U32(sp + 28) = t7; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t6; +f_error(mem, sp, a0, a1, a2, a3); +goto L429b08; +MEM_U32(sp + 24) = t6; +L429b08: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L429b14: +t5 = MEM_U32(sp + 340); +t1 = s0 << 2; +t3 = t5 + t1; +t0 = MEM_U32(t3 + 0); +//nop; +t4 = MEM_U8(t0 + 2); +//nop; +if (t4 == 0) {//nop; +goto L429bb8;} +//nop; +t8 = s0 << 2; +t2 = t5 + t8; +t9 = MEM_U32(t2 + 0); +//nop; +t6 = MEM_U8(t9 + 3); +//nop; +if (t6 != 0) {//nop; +goto L42a880;} +//nop; +t7 = s0 << 2; +t1 = t5 + t7; +t3 = MEM_U32(t1 + 0); +at = 0x31; +t0 = MEM_U8(t3 + 2); +//nop; +if (t0 == at) {//nop; +goto L429bb8;} +//nop; +t4 = s0 << 2; +t8 = t5 + t4; +t2 = MEM_U32(t8 + 0); +at = 0x32; +t9 = MEM_U8(t2 + 2); +//nop; +if (t9 == at) {//nop; +goto L429bb8;} +//nop; +t6 = s0 << 2; +t7 = t5 + t6; +t1 = MEM_U32(t7 + 0); +at = 0x33; +t3 = MEM_U8(t1 + 2); +//nop; +if (t3 != at) {//nop; +goto L42a880;} +//nop; +L429bb8: +t0 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t8 = t0 + t4; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a270; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429bd8; +//nop; +L429bd8: +t2 = MEM_U32(sp + 340); +// bdead 40020803 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t5 = t2 + t9; +//nop; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a310; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429bfc; +//nop; +L429bfc: +// bdead 40020003 gp = MEM_U32(sp + 64); +t6 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t1 = t6 + t7; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a2f0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429c20; +//nop; +L429c20: +// bdead 40020003 gp = MEM_U32(sp + 64); +t0 = MEM_U32(sp + 340); +at = 0x10000398; +t3 = 0x2; +t4 = s0 << 2; +//nop; +t8 = t0 + t4; +MEM_U32(at + 0) = t3; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a320; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429c50; +//nop; +L429c50: +t2 = MEM_U32(sp + 340); +// bdead 40020803 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t5 = t2 + t9; +//nop; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a408; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429c74; +//nop; +L429c74: +// bdead 40020003 gp = MEM_U32(sp + 64); +t6 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t1 = t6 + t7; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a418; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429c98; +//nop; +L429c98: +// bdead 40020003 gp = MEM_U32(sp + 64); +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t4 = t3 + t0; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a428; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429cbc; +//nop; +L429cbc: +t8 = MEM_U32(sp + 340); +t2 = s0 << 2; +// bdead 42020803 gp = MEM_U32(sp + 64); +t9 = t8 + t2; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a448; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429ce0; +//nop; +L429ce0: +// bdead 40020003 gp = MEM_U32(sp + 64); +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t7 = t5 + t6; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a490; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429d04; +//nop; +L429d04: +// bdead 40020003 gp = MEM_U32(sp + 64); +t1 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t0 = t1 + t3; +a1 = MEM_U32(t0 + 0); +a0 = 0x1000a4a0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429d28; +//nop; +L429d28: +// bdead 40020003 gp = MEM_U32(sp + 64); +t4 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t2 = t4 + t8; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a480; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429d4c; +//nop; +L429d4c: +t9 = MEM_U32(sp + 340); +// bdead 44020003 gp = MEM_U32(sp + 64); +t5 = s0 << 2; +t6 = t9 + t5; +//nop; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a4b0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429d70; +//nop; +L429d70: +// bdead 40020003 gp = MEM_U32(sp + 64); +t7 = MEM_U32(sp + 340); +t1 = s0 << 2; +//nop; +t3 = t7 + t1; +a1 = MEM_U32(t3 + 0); +a0 = 0x1000a4c0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429d94; +//nop; +L429d94: +// bdead 40020003 gp = MEM_U32(sp + 64); +t0 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t8 = t0 + t4; +a1 = MEM_U32(t8 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429db8; +//nop; +L429db8: +t2 = MEM_U32(sp + 340); +// bdead 40020803 gp = MEM_U32(sp + 64); +t9 = s0 << 2; +t5 = t2 + t9; +//nop; +a1 = MEM_U32(t5 + 0); +a0 = 0x1000a4d0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429ddc; +//nop; +L429ddc: +// bdead 40020003 gp = MEM_U32(sp + 64); +t6 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t1 = t6 + t7; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429e00; +//nop; +L429e00: +// bdead 40020003 gp = MEM_U32(sp + 64); +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t4 = t3 + t0; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a500; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429e24; +//nop; +L429e24: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L429e30: +t8 = MEM_U32(sp + 340); +t2 = s0 << 2; +t9 = t8 + t2; +t5 = MEM_U32(t9 + 0); +//nop; +t6 = MEM_U8(t5 + 2); +//nop; +if (t6 == 0) {//nop; +goto L42a880;} +//nop; +t7 = s0 << 2; +//nop; +t1 = t8 + t7; +a1 = MEM_U32(t1 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429e70; +//nop; +L429e70: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L429e7c: +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +a1 = 0x1000511c; +//nop; +t4 = t3 + t0; +a0 = MEM_U32(t4 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L429e9c; +a1 = a1; +L429e9c: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L429f24;} +//nop; +t2 = 0x100003e4; +at = 0x1; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {at = 0x100003e4; +goto L429ec8;} +at = 0x100003e4; +//nop; +MEM_U32(at + 0) = zero; +L429ec8: +at = 0x10000004; +t9 = 0x3; +MEM_U32(at + 0) = t9; +at = 0x100003e8; +//nop; +a0 = 0x10005124; +t5 = 0x3; +a1 = zero; +a2 = zero; +MEM_U32(at + 0) = t5; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L429ef8; +a0 = a0; +L429ef8: +// bdead 40020003 gp = MEM_U32(sp + 64); +t6 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t7 = t6 + t8; +a0 = MEM_U32(t7 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L429f18; +//nop; +L429f18: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L429f24: +t1 = MEM_U32(sp + 340); +t3 = s0 << 2; +a1 = 0x10005128; +//nop; +t0 = t1 + t3; +a0 = MEM_U32(t0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L429f44; +a1 = a1; +L429f44: +// bdead 4002000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L429f70;} +//nop; +a1 = 0x10005130; +//nop; +a0 = 0x1000a4d0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L429f64; +a1 = a1; +L429f64: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L429f70: +t4 = MEM_U32(sp + 340); +t2 = s0 << 2; +t9 = t4 + t2; +t5 = MEM_U32(t9 + 0); +//nop; +t6 = MEM_U8(t5 + 2); +//nop; +if (t6 != 0) {//nop; +goto L42a880;} +//nop; +t8 = s0 << 2; +//nop; +t7 = t4 + t8; +a1 = MEM_U32(t7 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429fb0; +//nop; +L429fb0: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L429fbc: +t1 = MEM_U32(sp + 340); +t3 = s0 << 2; +t0 = t1 + t3; +t2 = MEM_U32(t0 + 0); +//nop; +t9 = MEM_U8(t2 + 2); +//nop; +if (t9 != 0) {//nop; +goto L42a880;} +//nop; +t5 = s0 << 2; +//nop; +t6 = t1 + t5; +a1 = MEM_U32(t6 + 0); +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L429ffc; +//nop; +L429ffc: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42a008: +t4 = MEM_U32(sp + 340); +t8 = s0 << 2; +t7 = t4 + t8; +t3 = MEM_U32(t7 + 0); +at = 0x2b; +t0 = MEM_U8(t3 + 0); +//nop; +if (t0 != at) {//nop; +goto L42a278;} +//nop; +t2 = 0x1000a36c; +at = 0x1; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L42a278;} +//nop; +t9 = 0x10000008; +at = 0x2; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == at) {at = 0x3; +goto L42a064;} +at = 0x3; +if (t9 != at) {//nop; +goto L42a278;} +//nop; +L42a064: +t1 = MEM_U32(sp + 340); +t5 = s0 << 2; +t6 = t1 + t5; +t4 = MEM_U32(t6 + 0); +//nop; +t8 = MEM_U8(t4 + 1); +//nop; +t7 = t8 + 0xffffffb7; +at = t7 < 0x2f; +if (at == 0) {//nop; +goto L42a880;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100076f8[] = { +&&L42a244, +&&L42a880, +&&L42a880, +&&L42a934, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a934, +&&L42a880, +&&L42a880, +&&L42a1b0, +&&L42a1c0, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a0ac, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a880, +&&L42a1a0, +&&L42a190, +}; +dest = Lswitch100076f8[t7]; +//nop; +goto *dest; +//nop; +L42a0ac: +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +t2 = t3 + t0; +t9 = MEM_U32(t2 + 0); +//nop; +t1 = MEM_U8(t9 + 2); +//nop; +if (t1 != 0) {at = 0x10000248; +goto L42a0d8;} +at = 0x10000248; +MEM_U32(at + 0) = zero; +goto L42a168; +MEM_U32(at + 0) = zero; +L42a0d8: +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +t4 = t5 + t6; +t8 = MEM_U32(t4 + 0); +at = 0x70; +t7 = MEM_U8(t8 + 2); +//nop; +if (t7 != at) {at = 0x10000248; +goto L42a110;} +at = 0x10000248; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10000250; +MEM_U32(at + 0) = zero; +goto L42a168; +MEM_U32(at + 0) = zero; +L42a110: +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +t2 = t3 + t0; +t9 = MEM_U32(t2 + 0); +at = 0x61; +t1 = MEM_U8(t9 + 2); +//nop; +if (t1 != at) {at = 0x10000248; +goto L42a13c;} +at = 0x10000248; +MEM_U32(at + 0) = zero; +goto L42a168; +MEM_U32(at + 0) = zero; +L42a13c: +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +t4 = t5 + t6; +t8 = MEM_U32(t4 + 0); +at = 0x63; +t7 = MEM_U8(t8 + 2); +//nop; +if (t7 != at) {at = 0x10000250; +goto L42a168;} +at = 0x10000250; +//nop; +MEM_U32(at + 0) = zero; +L42a168: +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t2 = t3 + t0; +a0 = MEM_U32(t2 + 0); +//nop; +f_add_static_opt(mem, sp, a0); +goto L42a184; +//nop; +L42a184: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42a190: +at = 0x1000a198; +t9 = 0x1; +MEM_U32(at + 0) = t9; +goto L42a934; +MEM_U32(at + 0) = t9; +L42a1a0: +at = 0x10000234; +t1 = 0x1; +MEM_U32(at + 0) = t1; +goto L42a934; +MEM_U32(at + 0) = t1; +L42a1b0: +at = 0x1000024c; +t5 = 0x1; +MEM_U32(at + 0) = t5; +goto L42a934; +MEM_U32(at + 0) = t5; +L42a1c0: +t6 = 0x1000a36c; +at = 0x1; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L42a244;} +//nop; +t4 = 0x10000008; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42a244;} +//nop; +t8 = 0x1000513c; +t7 = MEM_U32(sp + 340); +t9 = 0x1000516c; +t3 = s0 << 2; +t8 = t8; +MEM_U32(sp + 20) = t8; +MEM_U32(sp + 16) = zero; +t0 = t7 + t3; +t2 = MEM_U32(t0 + 0); +t9 = t9; +MEM_U32(sp + 28) = t9; +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t2; +f_error(mem, sp, a0, a1, a2, a3); +goto L42a238; +MEM_U32(sp + 24) = t2; +L42a238: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42a244: +at = 0x10000228; +t1 = 0x1; +MEM_U32(at + 0) = t1; +at = 0x10000258; +t5 = 0x1; +MEM_U32(at + 0) = t5; +at = 0x1000026c; +t6 = 0x1; +MEM_U32(at + 0) = t6; +at = 0x1000a184; +t4 = 0x1; +MEM_U32(at + 0) = t4; +goto L42a934; +MEM_U32(at + 0) = t4; +L42a278: +t8 = MEM_U32(sp + 340); +t7 = s0 << 2; +//nop; +t3 = t8 + t7; +a0 = MEM_U32(t3 + 0); +//nop; +v0 = f_getsuf(mem, sp, a0); +goto L42a294; +//nop; +L42a294: +// bdead 4002010b gp = MEM_U32(sp + 64); +s1 = v0 & 0xff; +at = 0x6d; +if (s1 != at) {//nop; +goto L42a2ac;} +//nop; +s1 = 0x66; +L42a2ac: +at = 0x70; +if (s1 != at) {at = 0x10000388; +goto L42a2c0;} +at = 0x10000388; +t0 = 0x1; +MEM_U32(at + 0) = t0; +L42a2c0: +at = 0x66; +if (s1 != at) {at = 0x1000038c; +goto L42a2d4;} +at = 0x1000038c; +t2 = 0x1; +MEM_U32(at + 0) = t2; +L42a2d4: +at = 0x1; +if (s1 != at) {at = 0x1000a134; +goto L42a2e8;} +at = 0x1000a134; +t9 = 0x1; +MEM_U32(at + 0) = t9; +L42a2e8: +at = 0x63; +if (s1 == at) {at = 0x70; +goto L42a414;} +at = 0x70; +if (s1 == at) {at = 0x66; +goto L42a414;} +at = 0x66; +if (s1 == at) {at = 0x46; +goto L42a414;} +at = 0x46; +if (s1 == at) {at = 0x72; +goto L42a414;} +at = 0x72; +if (s1 == at) {at = 0x65; +goto L42a414;} +at = 0x65; +if (s1 == at) {at = 0x42; +goto L42a414;} +at = 0x42; +if (s1 == at) {at = 0x55; +goto L42a414;} +at = 0x55; +if (s1 == at) {at = 0x73; +goto L42a414;} +at = 0x73; +if (s1 == at) {at = 0x4f; +goto L42a414;} +at = 0x4f; +if (s1 == at) {at = 0x47; +goto L42a414;} +at = 0x47; +if (s1 == at) {at = 0x53; +goto L42a414;} +at = 0x53; +if (s1 == at) {at = 0x4d; +goto L42a414;} +at = 0x4d; +if (s1 == at) {at = 0x56; +goto L42a414;} +at = 0x56; +if (s1 == at) {at = 0x69; +goto L42a414;} +at = 0x69; +if (s1 == at) {at = 0x1; +goto L42a414;} +at = 0x1; +if (s1 == at) {at = 0x44; +goto L42a414;} +at = 0x44; +if (s1 == at) {at = 0x3; +goto L42a414;} +at = 0x3; +if (s1 == at) {at = 0x2; +goto L42a414;} +at = 0x2; +if (s1 == at) {at = 0x75; +goto L42a414;} +at = 0x75; +if (s1 == at) {at = 0x6; +goto L42a414;} +at = 0x6; +if (s1 == at) {//nop; +goto L42a414;} +//nop; +t1 = 0x1000a36c; +at = 0x1; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L42a3e4;} +//nop; +t5 = 0x10000124; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L42a3e4;} +//nop; +t6 = 0x100001fc; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {at = 0x68; +goto L42a3e4;} +at = 0x68; +if (s1 == at) {//nop; +goto L42a414;} +//nop; +L42a3e4: +t4 = 0x10000214; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L42a414;} +//nop; +t8 = 0x1000a36c; +at = 0x4; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L42a780;} +//nop; +L42a414: +t7 = 0x10000394; +at = 0x10000394; +t7 = MEM_U32(t7 + 0); +t2 = MEM_U32(sp + 336); +t3 = t7 + 0x1; +MEM_U32(at + 0) = t3; +t0 = 0x1; +at = (int)t2 < (int)0x2; +if (at != 0) {MEM_U32(sp + 92) = t0; +goto L42a4b4;} +MEM_U32(sp + 92) = t0; +L42a43c: +t1 = MEM_U32(sp + 92); +t9 = MEM_U32(sp + 340); +t5 = t1 << 2; +t6 = t9 + t5; +t4 = MEM_U32(t6 + 0); +at = 0x6a; +t8 = MEM_U8(t4 + 1); +//nop; +if (t8 != at) {//nop; +goto L42a49c;} +//nop; +a1 = 0x10005170; +//nop; +a0 = t4; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42a478; +a1 = a1; +L42a478: +// bdead 4006000b gp = MEM_U32(sp + 64); +if (v0 != 0) {//nop; +goto L42a49c;} +//nop; +t7 = 0x10000224; +at = 0x10000224; +t7 = MEM_U32(t7 + 0); +//nop; +t3 = t7 + 0x1; +MEM_U32(at + 0) = t3; +L42a49c: +t0 = MEM_U32(sp + 92); +t1 = MEM_U32(sp + 336); +t2 = t0 + 0x1; +at = (int)t2 < (int)t1; +if (at != 0) {MEM_U32(sp + 92) = t2; +goto L42a43c;} +MEM_U32(sp + 92) = t2; +L42a4b4: +t9 = 0x10000230; +at = 0x3; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == at) {at = 0x4; +goto L42a4d4;} +at = 0x4; +if (t9 != at) {//nop; +goto L42a68c;} +//nop; +L42a4d4: +t5 = 0x10000224; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {at = 0x63; +goto L42a68c;} +at = 0x63; +if (s1 == at) {at = 0x70; +goto L42a560;} +at = 0x70; +if (s1 == at) {at = 0x66; +goto L42a560;} +at = 0x66; +if (s1 == at) {at = 0x46; +goto L42a560;} +at = 0x46; +if (s1 == at) {at = 0x72; +goto L42a560;} +at = 0x72; +if (s1 == at) {at = 0x65; +goto L42a560;} +at = 0x65; +if (s1 == at) {at = 0x42; +goto L42a560;} +at = 0x42; +if (s1 == at) {at = 0x55; +goto L42a560;} +at = 0x55; +if (s1 == at) {at = 0x69; +goto L42a560;} +at = 0x69; +if (s1 == at) {at = 0x1; +goto L42a560;} +at = 0x1; +if (s1 == at) {at = 0x3; +goto L42a560;} +at = 0x3; +if (s1 == at) {at = 0x2; +goto L42a560;} +at = 0x2; +if (s1 == at) {at = 0x6; +goto L42a560;} +at = 0x6; +if (s1 == at) {at = 0x75; +goto L42a560;} +at = 0x75; +if (s1 == at) {at = 0x44; +goto L42a560;} +at = 0x44; +if (s1 != at) {at = 0x75; +goto L42a68c;} +L42a560: +at = 0x75; +if (s1 == at) {//nop; +goto L42a5b8;} +//nop; +t6 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t4 = t6 + t8; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a520; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42a58c; +//nop; +L42a58c: +// bdead 40020003 gp = MEM_U32(sp + 64); +t7 = MEM_U32(sp + 340); +t3 = s0 << 2; +//nop; +t0 = t7 + t3; +a0 = MEM_U32(t0 + 0); +a1 = 0x75; +v0 = f_mksuf(mem, sp, a0, a1); +goto L42a5ac; +a1 = 0x75; +L42a5ac: +// bdead 4002000b gp = MEM_U32(sp + 64); +s2 = v0; +goto L42a5cc; +s2 = v0; +L42a5b8: +t2 = MEM_U32(sp + 340); +t1 = s0 << 2; +t9 = t2 + t1; +s2 = MEM_U32(t9 + 0); +//nop; +L42a5cc: +at = 0x10000408; +t6 = 0x1000040c; +t5 = 0x1; +t6 = MEM_U32(t6 + 0); +MEM_U32(at + 0) = t5; +at = 0xffffffff; +if (t6 != at) {//nop; +goto L42a610;} +//nop; +//nop; +a0 = 0x1000a540; +//nop; +v0 = f_save_place(mem, sp, a0); +goto L42a5fc; +//nop; +L42a5fc: +// bdead 400a000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000040c; +//nop; +MEM_U32(at + 0) = v0; +L42a610: +//nop; +a0 = 0x1000a530; +a1 = s2; +v0 = f_nodup(mem, sp, a0, a1); +goto L42a620; +a1 = s2; +L42a620: +// bdead 400a000b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a644;} +//nop; +//nop; +a0 = 0x1000a530; +a1 = s2; +f_addstr(mem, sp, a0, a1); +goto L42a63c; +a1 = s2; +L42a63c: +// bdead 40020003 gp = MEM_U32(sp + 64); +//nop; +L42a644: +t8 = MEM_U32(sp + 340); +t4 = s0 << 2; +//nop; +t7 = t8 + t4; +a0 = MEM_U32(t7 + 0); +a1 = 0x6f; +v0 = f_mksuf(mem, sp, a0, a1); +goto L42a660; +a1 = 0x6f; +L42a660: +// bdead 4002000b gp = MEM_U32(sp + 64); +s2 = v0; +//nop; +a0 = 0x1000a540; +a1 = s2; +v0 = f_nodup(mem, sp, a0, a1); +goto L42a678; +a1 = s2; +L42a678: +// bdead 400a010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +MEM_U32(sp + 312) = s2; +goto L42a934; +MEM_U32(sp + 312) = s2; +L42a68c: +t3 = 0x10000214; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L42a754;} +//nop; +t0 = 0x1000a36c; +at = 0x4; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == at) {//nop; +goto L42a754;} +//nop; +t2 = MEM_U32(sp + 340); +t1 = s0 << 2; +t9 = t2 + t1; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = 0x1000a520; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42a6dc; +//nop; +L42a6dc: +// bdead 40020003 gp = MEM_U32(sp + 64); +t5 = MEM_U32(sp + 340); +t6 = s0 << 2; +//nop; +t8 = t5 + t6; +a0 = MEM_U32(t8 + 0); +a1 = 0x6f; +v0 = f_mksuf(mem, sp, a0, a1); +goto L42a6fc; +a1 = 0x6f; +L42a6fc: +// bdead 4002000b gp = MEM_U32(sp + 64); +s2 = v0; +//nop; +a0 = 0x1000a540; +a1 = s2; +v0 = f_nodup(mem, sp, a0, a1); +goto L42a714; +a1 = s2; +L42a714: +// bdead 400a010b gp = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L42a934;} +//nop; +//nop; +a0 = 0x1000a540; +a1 = s2; +f_addstr(mem, sp, a0, a1); +goto L42a730; +a1 = s2; +L42a730: +// bdead 400a0103 gp = MEM_U32(sp + 64); +MEM_U32(sp + 312) = s2; +t4 = 0x10000418; +at = 0x10000418; +t4 = MEM_U32(t4 + 0); +//nop; +t7 = t4 + 0x1; +MEM_U32(at + 0) = t7; +goto L42a934; +MEM_U32(at + 0) = t7; +L42a754: +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t2 = t3 + t0; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a520; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42a774; +//nop; +L42a774: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42a780: +at = 0x62; +if (s1 != at) {//nop; +goto L42a834;} +//nop; +t1 = 0x10000230; +at = 0x3; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == at) {at = 0x4; +goto L42a7ac;} +at = 0x4; +if (t1 != at) {//nop; +goto L42a934;} +//nop; +L42a7ac: +t9 = 0x10000224; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L42a934;} +//nop; +t5 = 0x1000040c; +at = 0xffffffff; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L42a800;} +//nop; +//nop; +a0 = 0x1000a540; +//nop; +v0 = f_save_place(mem, sp, a0); +goto L42a7ec; +//nop; +L42a7ec: +// bdead 4002000b gp = MEM_U32(sp + 64); +//nop; +at = 0x1000040c; +//nop; +MEM_U32(at + 0) = v0; +L42a800: +t6 = MEM_U32(sp + 340); +t8 = s0 << 2; +//nop; +t4 = t6 + t8; +a1 = MEM_U32(t4 + 0); +a0 = 0x1000a530; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42a820; +//nop; +L42a820: +// bdead 40020103 gp = MEM_U32(sp + 64); +t7 = 0x1; +at = 0x10000408; +MEM_U32(at + 0) = t7; +goto L42a934; +MEM_U32(at + 0) = t7; +L42a834: +t3 = MEM_U32(sp + 340); +t0 = s0 << 2; +//nop; +t2 = t3 + t0; +a1 = MEM_U32(t2 + 0); +a0 = 0x1000a540; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42a854; +//nop; +L42a854: +// bdead 40060103 gp = MEM_U32(sp + 64); +at = 0x6f; +if (s1 != at) {//nop; +goto L42a934;} +//nop; +t1 = 0x10000418; +at = 0x10000418; +t1 = MEM_U32(t1 + 0); +//nop; +t9 = t1 + 0x1; +MEM_U32(at + 0) = t9; +goto L42a934; +MEM_U32(at + 0) = t9; +L42a880: +t5 = MEM_U32(sp + 304); +//nop; +if (t5 == 0) {//nop; +goto L42a8f0;} +//nop; +t6 = 0x10005174; +t8 = MEM_U32(sp + 340); +t4 = s0 << 2; +t6 = t6; +MEM_U32(sp + 20) = t6; +MEM_U32(sp + 16) = zero; +t7 = t8 + t4; +t3 = MEM_U32(t7 + 0); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L42a8cc; +MEM_U32(sp + 24) = t3; +L42a8cc: +// bdead 40020003 gp = MEM_U32(sp + 64); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L42a8e4; +//nop; +L42a8e4: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +goto L42a934; +//nop; +L42a8f0: +t0 = 0x10005198; +t2 = MEM_U32(sp + 340); +t1 = s0 << 2; +t0 = t0; +MEM_U32(sp + 20) = t0; +MEM_U32(sp + 16) = zero; +t9 = t2 + t1; +t5 = MEM_U32(t9 + 0); +//nop; +a0 = 0x2; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t5; +f_error(mem, sp, a0, a1, a2, a3); +goto L42a92c; +MEM_U32(sp + 24) = t5; +L42a92c: +// bdead 40020103 gp = MEM_U32(sp + 64); +//nop; +L42a934: +t6 = MEM_U32(sp + 336); +s0 = s0 + 0x1; +at = (int)s0 < (int)t6; +if (at != 0) {//nop; +goto L41c548;} +//nop; +L42a948: +t8 = MEM_U32(sp + 316); +//nop; +if (t8 == 0) {//nop; +goto L42ae5c;} +//nop; +t4 = 0x1000a520; +at = 0x1; +t4 = MEM_U32(t4 + 4); +//nop; +if (t4 != at) {//nop; +goto L42aa8c;} +//nop; +t7 = 0x1000a520; +//nop; +t7 = MEM_U32(t7 + 8); +//nop; +a0 = MEM_U32(t7 + 0); +//nop; +v0 = wrapper_strdup(mem, a0); +goto L42a98c; +//nop; +L42a98c: +MEM_U32(sp + 88) = v0; +t3 = MEM_U32(sp + 88); +// bdead 40001103 gp = MEM_U32(sp + 64); +if (t3 != 0) {//nop; +goto L42a9ac;} +//nop; +t0 = MEM_U32(sp + 312); +MEM_U32(sp + 88) = t0; +goto L42aa8c; +MEM_U32(sp + 88) = t0; +L42a9ac: +//nop; +a0 = MEM_U32(sp + 88); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L42a9bc; +//nop; +L42a9bc: +MEM_U32(sp + 84) = v0; +t2 = MEM_U32(sp + 84); +// bdead 40000903 gp = MEM_U32(sp + 64); +at = (int)t2 < (int)0x3; +if (at != 0) {//nop; +goto L42aa8c;} +//nop; +t1 = MEM_U32(sp + 88); +at = 0x2e; +t9 = t2 + t1; +t5 = MEM_U8(t9 + -2); +//nop; +if (t5 != at) {//nop; +goto L42aa8c;} +//nop; +t6 = 0x10000214; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L42aa18;} +//nop; +t8 = 0x69; +t4 = t1 + t2; +MEM_U8(t4 + -1) = (uint8_t)t8; +goto L42aa8c; +MEM_U8(t4 + -1) = (uint8_t)t8; +L42aa18: +t7 = 0x1000022c; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L42aa48;} +//nop; +t0 = MEM_U32(sp + 88); +t9 = MEM_U32(sp + 84); +t3 = 0x73; +t5 = t0 + t9; +MEM_U8(t5 + -1) = (uint8_t)t3; +goto L42aa8c; +MEM_U8(t5 + -1) = (uint8_t)t3; +L42aa48: +t6 = 0x10000224; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L42aa78;} +//nop; +t2 = MEM_U32(sp + 88); +t8 = MEM_U32(sp + 84); +t1 = 0x75; +t4 = t2 + t8; +MEM_U8(t4 + -1) = (uint8_t)t1; +goto L42aa8c; +MEM_U8(t4 + -1) = (uint8_t)t1; +L42aa78: +t7 = MEM_U32(sp + 88); +t0 = MEM_U32(sp + 84); +//nop; +t9 = t7 + t0; +MEM_U8(t9 + -2) = (uint8_t)zero; +L42aa8c: +t3 = 0x1000a36c; +at = 0x1; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L42aabc;} +//nop; +t5 = 0x10000008; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L42aaec;} +//nop; +L42aabc: +t6 = 0x1000a36c; +at = 0x3; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L42ac18;} +//nop; +t2 = 0x100001fc; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42ac18;} +//nop; +L42aaec: +t8 = 0x1000a520; +at = 0x1; +t8 = MEM_U32(t8 + 4); +//nop; +if (t8 != at) {//nop; +goto L42ab68;} +//nop; +t1 = 0x1000a1ec; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L42ab34;} +//nop; +t4 = 0x10000228; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L42ab68;} +//nop; +L42ab34: +a1 = 0x100051bc; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L42ab48; +a1 = a1; +L42ab48: +// bdead 40000003 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 312); +//nop; +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42ab60; +//nop; +L42ab60: +// bdead 40000103 gp = MEM_U32(sp + 64); +//nop; +L42ab68: +a0 = 0x100051c8; +//nop; +a1 = MEM_U32(sp + 316); +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ab80; +a0 = a0; +L42ab80: +// bdead 4000000b gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a270; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L42ab98; +a1 = s4; +L42ab98: +t7 = MEM_U32(sp + 308); +// bdead 40010103 gp = MEM_U32(sp + 64); +if (t7 == 0) {//nop; +goto L42abe0;} +//nop; +a0 = 0x100051cc; +//nop; +a1 = t7; +a2 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42abc0; +a0 = a0; +L42abc0: +// bdead 40000009 gp = MEM_U32(sp + 64); +s4 = v0; +//nop; +a0 = 0x1000a270; +a1 = s4; +f_addstr(mem, sp, a0, a1); +goto L42abd8; +a1 = s4; +L42abd8: +// bdead 40000001 gp = MEM_U32(sp + 64); +//nop; +L42abe0: +a1 = 0x100051d0; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L42abf4; +a1 = a1; +L42abf4: +// bdead 40000001 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 316); +//nop; +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42ac0c; +//nop; +L42ac0c: +// bdead 1 gp = MEM_U32(sp + 64); +//nop; +goto L42ae5c; +//nop; +L42ac18: +t0 = 0x1000a520; +at = 0x1; +t0 = MEM_U32(t0 + 4); +//nop; +if (t0 != at) {//nop; +goto L42ad00;} +//nop; +t9 = 0x1000a1ec; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L42ac60;} +//nop; +t3 = 0x10000228; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L42ad00;} +//nop; +L42ac60: +a1 = 0x100051dc; +//nop; +a0 = 0x1000a270; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L42ac74; +a1 = a1; +L42ac74: +// bdead 40000001 gp = MEM_U32(sp + 64); +//nop; +t5 = 0x1000a1ec; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L42acb0;} +//nop; +//nop; +a0 = 0x1000a270; +a1 = t5; +f_addstr(mem, sp, a0, a1); +goto L42aca4; +a1 = t5; +L42aca4: +// bdead 40000001 gp = MEM_U32(sp + 64); +//nop; +goto L42accc; +//nop; +L42acb0: +//nop; +a0 = 0x1000a270; +a1 = MEM_U32(sp + 88); +//nop; +f_addstr(mem, sp, a0, a1); +goto L42acc4; +//nop; +L42acc4: +// bdead 40000001 gp = MEM_U32(sp + 64); +//nop; +L42accc: +a1 = 0x100051e8; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L42ace0; +a1 = a1; +L42ace0: +// bdead 40000001 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 312); +//nop; +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42acf8; +//nop; +L42acf8: +// bdead 40000001 gp = MEM_U32(sp + 64); +//nop; +L42ad00: +a1 = 0x100051f4; +//nop; +a0 = 0x1000a270; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L42ad14; +a1 = a1; +L42ad14: +// bdead 40000001 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 316); +//nop; +a0 = 0x1000a270; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42ad2c; +//nop; +L42ad2c: +// bdead 40000001 gp = MEM_U32(sp + 64); +at = 0x3; +t6 = 0x10000230; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L42ae28;} +//nop; +a1 = 0x10005200; +//nop; +a0 = 0x1000a448; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L42ad60; +a1 = a1; +L42ad60: +// bdead 40000001 gp = MEM_U32(sp + 64); +//nop; +t2 = 0x1000a1ec; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42ad9c;} +//nop; +//nop; +a0 = 0x1000a448; +a1 = t2; +f_addstr(mem, sp, a0, a1); +goto L42ad90; +a1 = t2; +L42ad90: +// bdead 40000001 gp = MEM_U32(sp + 64); +//nop; +goto L42adf0; +//nop; +L42ad9c: +t8 = 0x10000228; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L42add4;} +//nop; +a1 = 0x1000520c; +//nop; +a0 = 0x1000a448; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L42adc8; +a1 = a1; +L42adc8: +// bdead 40000001 gp = MEM_U32(sp + 64); +//nop; +goto L42adf0; +//nop; +L42add4: +a1 = 0x10005214; +//nop; +a0 = 0x1000a448; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L42ade8; +a1 = a1; +L42ade8: +// bdead 40000001 gp = MEM_U32(sp + 64); +//nop; +L42adf0: +a1 = 0x1000521c; +//nop; +a0 = 0x1000a448; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L42ae04; +a1 = a1; +L42ae04: +// bdead 40000001 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 316); +//nop; +a0 = 0x1000a448; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42ae1c; +//nop; +L42ae1c: +// bdead 1 gp = MEM_U32(sp + 64); +//nop; +goto L42ae5c; +//nop; +L42ae28: +a1 = 0x10005228; +//nop; +a0 = 0x1000a4e0; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L42ae3c; +a1 = a1; +L42ae3c: +// bdead 40000001 gp = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 316); +//nop; +a0 = 0x1000a4e0; +//nop; +f_addstr(mem, sp, a0, a1); +goto L42ae54; +//nop; +L42ae54: +// bdead 1 gp = MEM_U32(sp + 64); +//nop; +L42ae5c: +// bdead 1 ra = MEM_U32(sp + 68); +// bdead 1 s0 = MEM_U32(sp + 40); +// bdead 1 s1 = MEM_U32(sp + 44); +// bdead 1 s2 = MEM_U32(sp + 48); +// bdead 1 s3 = MEM_U32(sp + 52); +// bdead 1 s4 = MEM_U32(sp + 56); +// bdead 1 s5 = MEM_U32(sp + 60); +// bdead 1 sp = sp + 0x150; +return; +// bdead 1 sp = sp + 0x150; +} + +static void f_get_host_chiptype(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42ae80: +//get_host_chiptype: +//nop; +//nop; +//nop; +//nop; +return; +//nop; +} + +static void f_error(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L42ae94: +//error: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +t6 = 0x1000023c; +// fdead 400081eb MEM_U32(sp + 44) = ra; +t6 = MEM_U32(t6 + 0); +// fdead 400081eb MEM_U32(sp + 40) = gp; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +MEM_U32(sp + 64) = a2; +if (t6 != 0) {MEM_U32(sp + 68) = a3; +goto L42b08c;} +MEM_U32(sp + 68) = a3; +t7 = 0x10000440; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L42b08c;} +//nop; +a0 = 0x1000a31c; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = 0x2f; +v0 = wrapper_strrchr(mem, a0, a1); +goto L42aef4; +a1 = 0x2f; +L42aef4: +// bdead 4000000b gp = MEM_U32(sp + 40); +//nop; +at = 0x10000440; +t8 = 0x10000440; +MEM_U32(at + 0) = v0; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L42af2c;} +//nop; +t9 = 0x1000a31c; +at = 0x10000440; +t9 = MEM_U32(t9 + 0); +MEM_U32(at + 0) = t9; +goto L42af44; +MEM_U32(at + 0) = t9; +L42af2c: +t0 = 0x10000440; +at = 0x10000440; +t0 = MEM_U32(t0 + 0); +//nop; +t1 = t0 + 0x1; +MEM_U32(at + 0) = t1; +L42af44: +a0 = 0x10000440; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L42af58; +//nop; +L42af58: +// bdead 4000000b gp = MEM_U32(sp + 40); +MEM_U32(sp + 52) = v0; +a0 = MEM_U32(sp + 52); +//nop; +a0 = a0 + 0x2; +//nop; +v0 = wrapper_malloc(mem, a0); +goto L42af74; +//nop; +L42af74: +// bdead 4000010b gp = MEM_U32(sp + 40); +//nop; +at = 0x10000444; +t2 = 0x10000444; +MEM_U32(at + 0) = v0; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L42b034;} +//nop; +a2 = 0x10000440; +a0 = 0xfb528e4; +a1 = 0x10005260; +//nop; +a2 = MEM_U32(a2 + 0); +a3 = 0x3281; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L42afbc; +a1 = a1; +L42afbc: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +t3 = 0xfb52720; +t4 = 0xfb50300; +t3 = MEM_U32(t3 + 0); +t4 = MEM_U32(t4 + 0); +//nop; +at = (int)t3 < (int)t4; +if (at == 0) {//nop; +goto L42b01c;} +//nop; +t6 = 0xfb500a0; +a2 = 0x10000440; +t5 = t3 << 2; +a0 = 0xfb528e4; +a1 = 0x10005288; +//nop; +t7 = t5 + t6; +a3 = MEM_U32(t7 + 0); +a2 = MEM_U32(a2 + 0); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L42b014; +a1 = a1; +L42b014: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L42b01c: +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L42b02c; +//nop; +L42b02c: +// bdead 40000103 gp = MEM_U32(sp + 40); +//nop; +L42b034: +t8 = MEM_U32(sp + 52); +MEM_U32(sp + 48) = zero; +if ((int)t8 <= 0) {//nop; +goto L42b074;} +//nop; +L42b044: +t0 = 0x10000444; +t1 = MEM_U32(sp + 48); +t0 = MEM_U32(t0 + 0); +t9 = 0x20; +t2 = t0 + t1; +MEM_U8(t2 + 0) = (uint8_t)t9; +t4 = MEM_U32(sp + 48); +t5 = MEM_U32(sp + 52); +t3 = t4 + 0x1; +at = (int)t3 < (int)t5; +if (at != 0) {MEM_U32(sp + 48) = t3; +goto L42b044;} +MEM_U32(sp + 48) = t3; +L42b074: +t6 = 0x10000444; +t7 = MEM_U32(sp + 48); +t6 = MEM_U32(t6 + 0); +//nop; +t8 = t6 + t7; +MEM_U8(t8 + 0) = (uint8_t)zero; +L42b08c: +t0 = MEM_U32(sp + 56); +at = 0x5; +if (t0 != at) {//nop; +goto L42b0c8;} +//nop; +a2 = 0x10000444; +a0 = 0xfb528e4; +a1 = 0x10005290; +//nop; +a2 = MEM_U32(a2 + 0); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L42b0bc; +a1 = a1; +L42b0bc: +// bdead 40000101 gp = MEM_U32(sp + 40); +//nop; +goto L42b108; +//nop; +L42b0c8: +t1 = MEM_U32(sp + 56); +t2 = 0x10000448; +t9 = t1 << 2; +t2 = t2; +a2 = 0x10000440; +t4 = t9 + t2; +//nop; +a0 = 0xfb528e4; +a1 = 0x10005298; +a3 = MEM_U32(t4 + 0); +a2 = MEM_U32(a2 + 0); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L42b100; +a1 = a1; +L42b100: +// bdead 40000101 gp = MEM_U32(sp + 40); +//nop; +L42b108: +t3 = MEM_U32(sp + 60); +//nop; +if (t3 == 0) {//nop; +goto L42b178;} +//nop; +t5 = MEM_U32(sp + 64); +//nop; +if (t5 == 0) {//nop; +goto L42b154;} +//nop; +a0 = 0xfb528e4; +a1 = 0x100052a4; +//nop; +a2 = t3; +a3 = t5; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L42b148; +a1 = a1; +L42b148: +// bdead 40000101 gp = MEM_U32(sp + 40); +//nop; +goto L42b178; +//nop; +L42b154: +a0 = 0xfb528e4; +a1 = 0x100052b4; +//nop; +a2 = MEM_U32(sp + 60); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L42b170; +a1 = a1; +L42b170: +// bdead 40000101 gp = MEM_U32(sp + 40); +//nop; +L42b178: +t6 = MEM_U32(sp + 68); +//nop; +if (t6 == 0) {//nop; +goto L42b1e8;} +//nop; +t7 = MEM_U32(sp + 72); +//nop; +if (t7 == 0) {//nop; +goto L42b1c4;} +//nop; +a0 = 0xfb528e4; +a1 = 0x100052bc; +//nop; +a2 = t6; +a3 = t7; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L42b1b8; +a1 = a1; +L42b1b8: +// bdead 40000001 gp = MEM_U32(sp + 40); +//nop; +goto L42b1e8; +//nop; +L42b1c4: +a0 = 0xfb528e4; +a1 = 0x100052cc; +//nop; +a2 = MEM_U32(sp + 68); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L42b1e0; +a1 = a1; +L42b1e0: +// bdead 40000001 gp = MEM_U32(sp + 40); +//nop; +L42b1e8: +t8 = MEM_U32(sp + 76); +//nop; +if (t8 != 0) {//nop; +goto L42b208;} +//nop; +t0 = 0x100052d4; +//nop; +t0 = t0; +MEM_U32(sp + 76) = t0; +L42b208: +t9 = MEM_U32(sp + 92); +a0 = 0xfb528e4; +MEM_U32(sp + 20) = t9; +//nop; +t1 = MEM_U32(sp + 88); +t2 = MEM_U32(sp + 96); +t4 = MEM_U32(sp + 100); +a1 = MEM_U32(sp + 76); +a2 = MEM_U32(sp + 80); +a3 = MEM_U32(sp + 84); +a0 = a0 + 0x20; +MEM_U32(sp + 16) = t1; +MEM_U32(sp + 24) = t2; +MEM_U32(sp + 28) = t4; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L42b244; +MEM_U32(sp + 28) = t4; +L42b244: +// bdead 1 ra = MEM_U32(sp + 44); +// bdead 1 gp = MEM_U32(sp + 40); +// bdead 1 sp = sp + 0x38; +return; +// bdead 1 sp = sp + 0x38; +} + +static void f_relocate_passes(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L42b254: +//relocate_passes: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb0; +t6 = 0x100052d8; +MEM_U32(sp + 88) = a2; +at = 0x1000a32c; +t7 = MEM_U32(sp + 88); +t6 = t6; +// fdead 400180ef MEM_U32(sp + 60) = ra; +// fdead 400180ef MEM_U32(sp + 56) = gp; +MEM_U32(sp + 80) = a0; +MEM_U32(sp + 84) = a1; +// fdead 400180ef MEM_U32(sp + 52) = s3; +// fdead 400180ef MEM_U32(sp + 48) = s2; +// fdead 400180ef MEM_U32(sp + 44) = s1; +if (t7 != 0) {MEM_U32(at + 0) = t6; +goto L42b2b0;} +MEM_U32(at + 0) = t6; +t8 = 0x1000a1b4; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +MEM_U32(sp + 88) = t8; +L42b2b0: +t9 = MEM_U32(sp + 80); +//nop; +if (t9 != 0) {//nop; +goto L42b2d8;} +//nop; +s1 = 0x100052dc; +t0 = MEM_U32(sp + 88); +at = 0x1000a1b8; +s1 = s1; +MEM_U32(at + 0) = t0; +goto L42b2e0; +MEM_U32(at + 0) = t0; +L42b2d8: +s1 = MEM_U32(sp + 80); +//nop; +L42b2e0: +a0 = 0x10000400; +a1 = 0x10005304; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L42b2f8; +a1 = a1; +L42b2f8: +// bdead 4004010b gp = MEM_U32(sp + 56); +if (v0 != 0) {//nop; +goto L42b338;} +//nop; +t1 = 0x100002e4; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {at = 0x100002e4; +goto L42b338;} +at = 0x100002e4; +a0 = 0x10005308; +//nop; +MEM_U32(at + 0) = zero; +a0 = a0; +f_compose_G0_libs(mem, sp, a0); +goto L42b330; +a0 = a0; +L42b330: +// bdead 40040103 gp = MEM_U32(sp + 56); +//nop; +L42b338: +t2 = MEM_U8(s1 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42f198;} +//nop; +L42b348: +t3 = MEM_U32(sp + 84); +//nop; +if (t3 != 0) {//nop; +goto L42b378;} +//nop; +//nop; +a0 = 0x1000a1c0; +a1 = MEM_U8(s1 + 0); +//nop; +v0 = wrapper_strchr(mem, a0, a1); +goto L42b36c; +//nop; +L42b36c: +// bdead 4004010b gp = MEM_U32(sp + 56); +if (v0 != 0) {//nop; +goto L42f188;} +//nop; +L42b378: +t4 = MEM_U8(s1 + 0); +//nop; +t5 = t4 + 0xffffffcf; +at = t5 < 0x4a; +if (at == 0) {//nop; +goto L42f138;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100077b4[] = { +&&L42d8ec, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f188, +&&L42f138, +&&L42da00, +&&L42e8fc, +&&L42f138, +&&L42f138, +&&L42ea90, +&&L42f138, +&&L42ef1c, +&&L42f138, +&&L42e434, +&&L42f138, +&&L42e1e8, +&&L42d768, +&&L42f138, +&&L42f138, +&&L42ec14, +&&L42f138, +&&L42ed98, +&&L42f138, +&&L42dc98, +&&L42e064, +&&L42f0ac, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42f138, +&&L42c7a0, +&&L42c858, +&&L42c650, +&&L42c2d8, +&&L42be84, +&&L42b758, +&&L42f138, +&&L42b3ac, +&&L42f138, +&&L42bff4, +&&L42bf3c, +&&L42ca60, +&&L42c390, +&&L42e2fc, +&&L42c500, +&&L42b638, +&&L42c220, +&&L42d008, +&&L42c168, +&&L42cd48, +&&L42c0ac, +&&L42c448, +&&L42c9a8, +&&L42f138, +&&L42ce98, +&&L42cf50, +}; +dest = Lswitch100077b4[t5]; +//nop; +goto *dest; +//nop; +L42b3ac: +t6 = 0x10000088; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L42b3dc;} +//nop; +//nop; +a0 = t6; +//nop; +wrapper_free(mem, a0); +goto L42b3d4; +//nop; +L42b3d4: +// bdead 40040103 gp = MEM_U32(sp + 56); +//nop; +L42b3dc: +t7 = 0x10000090; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L42b40c;} +//nop; +//nop; +a0 = t7; +//nop; +wrapper_free(mem, a0); +goto L42b404; +//nop; +L42b404: +// bdead 40040103 gp = MEM_U32(sp + 56); +//nop; +L42b40c: +t8 = MEM_U32(sp + 80); +//nop; +if (t8 != 0) {//nop; +goto L42b43c;} +//nop; +t9 = MEM_U32(sp + 88); +//nop; +if (t9 == 0) {//nop; +goto L42b62c;} +//nop; +t0 = MEM_U8(t9 + 0); +//nop; +if (t0 == 0) {//nop; +goto L42b62c;} +//nop; +L42b43c: +t1 = MEM_U32(sp + 84); +//nop; +if (t1 == 0) {//nop; +goto L42b534;} +//nop; +t2 = 0x10000280; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42b494;} +//nop; +a1 = 0x10005318; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t1; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42b480; +a1 = a1; +L42b480: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000088; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42b494: +t3 = 0x1000037c; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L42b4dc;} +//nop; +a1 = 0x10005328; +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42b4c8; +a1 = a1; +L42b4c8: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000088; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42b4dc: +a1 = 0x10005338; +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42b4f8; +a1 = a1; +L42b4f8: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x10000090; +a1 = 0x10005348; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42b520; +a1 = a1; +L42b520: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000088; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42b534: +t4 = 0x10000280; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42b580;} +//nop; +a0 = 0x1000a25c; +a1 = 0x10005354; +//nop; +a2 = MEM_U32(sp + 88); +a0 = MEM_U32(a0 + 0); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42b56c; +a1 = a1; +L42b56c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000088; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42b580: +t5 = 0x1000037c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L42b5cc;} +//nop; +a0 = 0x1000a25c; +a1 = 0x10005364; +//nop; +a2 = MEM_U32(sp + 88); +a0 = MEM_U32(a0 + 0); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42b5b8; +a1 = a1; +L42b5b8: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000088; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42b5cc: +a0 = 0x1000a25c; +a1 = 0x10005374; +//nop; +a2 = MEM_U32(sp + 88); +a0 = MEM_U32(a0 + 0); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42b5ec; +a1 = a1; +L42b5ec: +// bdead 4004000b gp = MEM_U32(sp + 56); +a2 = MEM_U32(sp + 88); +a0 = 0x1000a25c; +at = 0x10000090; +a1 = 0x10005384; +//nop; +a0 = MEM_U32(a0 + 0); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42b618; +a1 = a1; +L42b618: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000088; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42b62c: +at = 0x10000088; +MEM_U32(at + 0) = zero; +goto L42f188; +MEM_U32(at + 0) = zero; +L42b638: +t6 = 0x10000094; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L42b668;} +//nop; +//nop; +a0 = t6; +//nop; +wrapper_free(mem, a0); +goto L42b660; +//nop; +L42b660: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42b668: +t7 = MEM_U32(sp + 84); +//nop; +if (t7 == 0) {//nop; +goto L42b6dc;} +//nop; +t8 = 0x100003e8; +at = 0x1; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == at) {at = 0x3; +goto L42b6a4;} +at = 0x3; +if (t8 == at) {//nop; +goto L42b6a4;} +//nop; +s2 = 0x10005390; +s2 = s2; +goto L42b6b0; +s2 = s2; +L42b6a4: +s2 = 0x10005394; +//nop; +s2 = s2; +L42b6b0: +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a1 = s2; +a3 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42b6c8; +a3 = zero; +L42b6c8: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000094; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42b6dc: +t9 = 0x100003e8; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == at) {at = 0x3; +goto L42b708;} +at = 0x3; +if (t9 == at) {//nop; +goto L42b708;} +//nop; +s2 = 0x100053a8; +s2 = s2; +goto L42b714; +s2 = s2; +L42b708: +s2 = 0x100053ac; +//nop; +s2 = s2; +L42b714: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x1000539c; +t0 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +a3 = s2; +MEM_U32(sp + 20) = zero; +a1 = a1; +MEM_U32(sp + 16) = t0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42b744; +MEM_U32(sp + 16) = t0; +L42b744: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000094; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42b758: +t2 = 0x1000009c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42b788;} +//nop; +//nop; +a0 = t2; +//nop; +wrapper_free(mem, a0); +goto L42b780; +//nop; +L42b780: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42b788: +t1 = 0x10000098; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L42b7b8;} +//nop; +//nop; +a0 = t1; +//nop; +wrapper_free(mem, a0); +goto L42b7b0; +//nop; +L42b7b0: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42b7b8: +t3 = 0x100000a0; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L42b7e8;} +//nop; +//nop; +a0 = t3; +//nop; +wrapper_free(mem, a0); +goto L42b7e0; +//nop; +L42b7e0: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42b7e8: +t4 = 0x100000a4; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42b818;} +//nop; +//nop; +a0 = t4; +//nop; +wrapper_free(mem, a0); +goto L42b810; +//nop; +L42b810: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42b818: +t5 = 0x100000a8; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L42b848;} +//nop; +//nop; +a0 = t5; +//nop; +wrapper_free(mem, a0); +goto L42b840; +//nop; +L42b840: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42b848: +t6 = 0x100000ac; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L42b878;} +//nop; +//nop; +a0 = t6; +//nop; +wrapper_free(mem, a0); +goto L42b870; +//nop; +L42b870: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42b878: +t7 = 0x100000b8; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L42b8a8;} +//nop; +//nop; +a0 = t7; +//nop; +wrapper_free(mem, a0); +goto L42b8a0; +//nop; +L42b8a0: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42b8a8: +t8 = MEM_U32(sp + 84); +//nop; +if (t8 == 0) {//nop; +goto L42baac;} +//nop; +t9 = 0x1000a188; +at = 0x10000; +t9 = MEM_U32(t9 + 0); +//nop; +t0 = t9 & at; +if (t0 == 0) {//nop; +goto L42b904;} +//nop; +a1 = 0x100053b4; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t8; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42b8f0; +a1 = a1; +L42b8f0: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x1000009c; +//nop; +MEM_U32(at + 0) = v0; +L42b904: +t2 = 0x10000004; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42b928;} +//nop; +s2 = 0x100053b8; +s2 = s2; +goto L42b934; +s2 = s2; +L42b928: +s2 = 0x100053c0; +//nop; +s2 = s2; +L42b934: +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a1 = s2; +a3 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42b94c; +a3 = zero; +L42b94c: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +t1 = 0x10000008; +at = 0x10000098; +t1 = MEM_U32(t1 + 0); +MEM_U32(at + 0) = v0; +if (t1 != 0) {//nop; +goto L42b99c;} +//nop; +t3 = 0x1000a36c; +at = 0x3; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L42b9d4;} +//nop; +t4 = 0x100001fc; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42b9d4;} +//nop; +L42b99c: +t5 = 0x10000000; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L42b9c0;} +//nop; +s3 = 0x100053c8; +s3 = s3; +goto L42b9cc; +s3 = s3; +L42b9c0: +s3 = 0x100053d4; +//nop; +s3 = s3; +L42b9cc: +s2 = s3; +goto L42b9e0; +s2 = s3; +L42b9d4: +s2 = 0x100053dc; +//nop; +s2 = s2; +L42b9e0: +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a1 = s2; +a3 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42b9f8; +a3 = zero; +L42b9f8: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x100000a0; +a1 = 0x100053e0; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ba20; +a1 = a1; +L42ba20: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x100000a4; +a1 = 0x100053e8; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ba48; +a1 = a1; +L42ba48: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x100000a8; +a1 = 0x100053f0; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ba70; +a1 = a1; +L42ba70: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x100000ac; +a1 = 0x100053f8; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ba98; +a1 = a1; +L42ba98: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000b8; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42baac: +t6 = 0x1000a188; +at = 0x10000; +t6 = MEM_U32(t6 + 0); +//nop; +t7 = t6 & at; +if (t7 == 0) {//nop; +goto L42bb10;} +//nop; +t9 = MEM_U32(sp + 88); +a0 = 0x1000a26c; +a2 = 0x1000a32c; +MEM_U32(sp + 16) = t9; +//nop; +a1 = 0x10005400; +a3 = 0x1000540c; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42bafc; +a3 = a3; +L42bafc: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x1000009c; +//nop; +MEM_U32(at + 0) = v0; +L42bb10: +t0 = 0x10000004; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L42bb34;} +//nop; +s2 = 0x1000541c; +s2 = s2; +goto L42bb40; +s2 = s2; +L42bb34: +s2 = 0x10005424; +//nop; +s2 = s2; +L42bb40: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x10005410; +t8 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +a3 = s2; +MEM_U32(sp + 20) = zero; +a1 = a1; +MEM_U32(sp + 16) = t8; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42bb70; +MEM_U32(sp + 16) = t8; +L42bb70: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000098; +t2 = 0x1000a36c; +MEM_U32(at + 0) = v0; +t2 = MEM_U32(t2 + 0); +at = 0x1; +if (t2 != at) {//nop; +goto L42bbac;} +//nop; +t1 = 0x10000008; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L42bbdc;} +//nop; +L42bbac: +t3 = 0x1000a36c; +at = 0x3; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L42bcac;} +//nop; +t4 = 0x100001fc; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42bcac;} +//nop; +L42bbdc: +t5 = 0x10000008; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L42bc24;} +//nop; +t6 = 0x1000a36c; +at = 0x3; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L42bc5c;} +//nop; +t7 = 0x100001fc; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L42bc5c;} +//nop; +L42bc24: +t9 = 0x10000000; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L42bc48;} +//nop; +s3 = 0x1000543c; +s3 = s3; +goto L42bc54; +s3 = s3; +L42bc48: +s3 = 0x10005448; +//nop; +s3 = s3; +L42bc54: +s2 = s3; +goto L42bc68; +s2 = s3; +L42bc5c: +s2 = 0x10005450; +//nop; +s2 = s2; +L42bc68: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x1000542c; +t0 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +a3 = s2; +MEM_U32(sp + 20) = zero; +a1 = a1; +MEM_U32(sp + 16) = t0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42bc98; +MEM_U32(sp + 16) = t0; +L42bc98: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000a0; +MEM_U32(at + 0) = v0; +goto L42bd7c; +MEM_U32(at + 0) = v0; +L42bcac: +t8 = 0x10000008; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L42bcf4;} +//nop; +t2 = 0x1000a36c; +at = 0x3; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L42bd2c;} +//nop; +t1 = 0x100001fc; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L42bd2c;} +//nop; +L42bcf4: +t3 = 0x10000000; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L42bd18;} +//nop; +s3 = 0x10005460; +s3 = s3; +goto L42bd24; +s3 = s3; +L42bd18: +s3 = 0x1000546c; +//nop; +s3 = s3; +L42bd24: +s2 = s3; +goto L42bd38; +s2 = s3; +L42bd2c: +s2 = 0x10005474; +//nop; +s2 = s2; +L42bd38: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x10005454; +t4 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +a3 = s2; +MEM_U32(sp + 20) = zero; +a1 = a1; +MEM_U32(sp + 16) = t4; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42bd68; +MEM_U32(sp + 16) = t4; +L42bd68: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000a0; +//nop; +MEM_U32(at + 0) = v0; +L42bd7c: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x10005478; +a3 = 0x10005484; +t5 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t5; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42bdb0; +MEM_U32(sp + 16) = t5; +L42bdb0: +// bdead 4004000b gp = MEM_U32(sp + 56); +t6 = MEM_U32(sp + 88); +a0 = 0x1000a26c; +a2 = 0x1000a32c; +at = 0x100000a4; +a1 = 0x1000548c; +a3 = 0x10005498; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +MEM_U32(sp + 16) = t6; +MEM_U32(at + 0) = v0; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42bdf0; +a3 = a3; +L42bdf0: +// bdead 4004000b gp = MEM_U32(sp + 56); +t7 = MEM_U32(sp + 88); +a0 = 0x1000a26c; +a2 = 0x1000a32c; +at = 0x100000a8; +a1 = 0x100054a0; +a3 = 0x100054ac; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +MEM_U32(sp + 16) = t7; +MEM_U32(at + 0) = v0; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42be30; +a3 = a3; +L42be30: +// bdead 4004000b gp = MEM_U32(sp + 56); +t9 = MEM_U32(sp + 88); +a0 = 0x1000a26c; +a2 = 0x1000a32c; +MEM_U32(sp + 16) = t9; +at = 0x100000ac; +//nop; +a1 = 0x100054b4; +a3 = 0x100054c0; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42be70; +a3 = a3; +L42be70: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000b8; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42be84: +t0 = 0x100000b0; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L42beb4;} +//nop; +//nop; +a0 = t0; +//nop; +wrapper_free(mem, a0); +goto L42beac; +//nop; +L42beac: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42beb4: +t8 = MEM_U32(sp + 84); +//nop; +if (t8 == 0) {//nop; +goto L42bef4;} +//nop; +a1 = 0x100054c8; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t8; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42bee0; +a1 = a1; +L42bee0: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000b0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42bef4: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x100054d4; +a3 = 0x100054e0; +t2 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42bf28; +MEM_U32(sp + 16) = t2; +L42bf28: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000b0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42bf3c: +t1 = 0x100000b4; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L42bf6c;} +//nop; +//nop; +a0 = t1; +//nop; +wrapper_free(mem, a0); +goto L42bf64; +//nop; +L42bf64: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42bf6c: +t3 = MEM_U32(sp + 84); +//nop; +if (t3 == 0) {//nop; +goto L42bfac;} +//nop; +a1 = 0x100054ec; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t3; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42bf98; +a1 = a1; +L42bf98: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000b4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42bfac: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x100054f4; +a3 = 0x10005500; +t4 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t4; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42bfe0; +MEM_U32(sp + 16) = t4; +L42bfe0: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000b4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42bff4: +t5 = 0x100000bc; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L42c024;} +//nop; +//nop; +a0 = t5; +//nop; +wrapper_free(mem, a0); +goto L42c01c; +//nop; +L42c01c: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42c024: +t6 = MEM_U32(sp + 84); +//nop; +if (t6 == 0) {//nop; +goto L42c064;} +//nop; +a1 = 0x10005508; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t6; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c050; +a1 = a1; +L42c050: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000bc; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c064: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x10005510; +a3 = 0x1000551c; +t7 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t7; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c098; +MEM_U32(sp + 16) = t7; +L42c098: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000bc; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c0ac: +t9 = 0x100000c4; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L42c0e0;} +//nop; +a0 = t9; +//nop; +//nop; +//nop; +wrapper_free(mem, a0); +goto L42c0d8; +//nop; +L42c0d8: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42c0e0: +t0 = MEM_U32(sp + 84); +//nop; +if (t0 == 0) {//nop; +goto L42c120;} +//nop; +a1 = 0x10005524; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t0; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c10c; +a1 = a1; +L42c10c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000c4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c120: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x10005528; +a3 = 0x10005534; +t8 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t8; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c154; +MEM_U32(sp + 16) = t8; +L42c154: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000c4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c168: +t2 = 0x100000c0; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42c198;} +//nop; +//nop; +a0 = t2; +//nop; +wrapper_free(mem, a0); +goto L42c190; +//nop; +L42c190: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42c198: +t1 = MEM_U32(sp + 84); +//nop; +if (t1 == 0) {//nop; +goto L42c1d8;} +//nop; +a1 = 0x10005538; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t1; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c1c4; +a1 = a1; +L42c1c4: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000c0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c1d8: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x10005540; +a3 = 0x1000554c; +t3 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c20c; +MEM_U32(sp + 16) = t3; +L42c20c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000c0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c220: +t4 = 0x100000d0; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42c250;} +//nop; +//nop; +a0 = t4; +//nop; +wrapper_free(mem, a0); +goto L42c248; +//nop; +L42c248: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42c250: +t5 = MEM_U32(sp + 84); +//nop; +if (t5 == 0) {//nop; +goto L42c290;} +//nop; +a1 = 0x10005554; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t5; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c27c; +a1 = a1; +L42c27c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000d0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c290: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x1000555c; +a3 = 0x10005568; +t6 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t6; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c2c4; +MEM_U32(sp + 16) = t6; +L42c2c4: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000d0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c2d8: +t7 = 0x100000d4; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L42c308;} +//nop; +//nop; +a0 = t7; +//nop; +wrapper_free(mem, a0); +goto L42c300; +//nop; +L42c300: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42c308: +t9 = MEM_U32(sp + 84); +//nop; +if (t9 == 0) {//nop; +goto L42c348;} +//nop; +a0 = t9; +//nop; +a1 = 0x10005570; +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c334; +a1 = a1; +L42c334: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000d4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c348: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x10005578; +a3 = 0x10005584; +t0 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c37c; +MEM_U32(sp + 16) = t0; +L42c37c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000d4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c390: +t8 = 0x100000c8; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L42c3c0;} +//nop; +//nop; +a0 = t8; +//nop; +wrapper_free(mem, a0); +goto L42c3b8; +//nop; +L42c3b8: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42c3c0: +t2 = MEM_U32(sp + 84); +//nop; +if (t2 == 0) {//nop; +goto L42c400;} +//nop; +a1 = 0x1000558c; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t2; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c3ec; +a1 = a1; +L42c3ec: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000c8; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c400: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x10005594; +a3 = 0x100055a0; +t1 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c434; +MEM_U32(sp + 16) = t1; +L42c434: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000c8; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c448: +t3 = 0x100000cc; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L42c478;} +//nop; +//nop; +a0 = t3; +//nop; +wrapper_free(mem, a0); +goto L42c470; +//nop; +L42c470: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42c478: +t4 = MEM_U32(sp + 84); +//nop; +if (t4 == 0) {//nop; +goto L42c4b8;} +//nop; +a1 = 0x100055a8; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t4; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c4a4; +a1 = a1; +L42c4a4: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000cc; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c4b8: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x100055b0; +a3 = 0x100055bc; +t5 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t5; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c4ec; +MEM_U32(sp + 16) = t5; +L42c4ec: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000cc; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c500: +t6 = 0x100000d8; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L42c530;} +//nop; +//nop; +a0 = t6; +//nop; +wrapper_free(mem, a0); +goto L42c528; +//nop; +L42c528: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42c530: +t7 = MEM_U32(sp + 84); +//nop; +if (t7 == 0) {//nop; +goto L42c570;} +//nop; +a1 = 0x100055c4; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t7; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c55c; +a1 = a1; +L42c55c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000d8; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c570: +t9 = 0x1000a36c; +at = 0x1; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L42c608;} +//nop; +t0 = 0x10000008; +at = 0x2; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == at) {at = 0x3; +goto L42c5a8;} +at = 0x3; +if (t0 != at) {//nop; +goto L42c608;} +//nop; +L42c5a8: +t8 = 0x10000210; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L42c608;} +//nop; +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x100055cc; +a3 = 0x100055dc; +t2 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c5f4; +MEM_U32(sp + 16) = t2; +L42c5f4: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000d8; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c608: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x100055e4; +a3 = 0x100055f0; +t1 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c63c; +MEM_U32(sp + 16) = t1; +L42c63c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000d8; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c650: +t3 = 0x100000dc; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L42c680;} +//nop; +//nop; +a0 = t3; +//nop; +wrapper_free(mem, a0); +goto L42c678; +//nop; +L42c678: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42c680: +t4 = MEM_U32(sp + 84); +//nop; +if (t4 == 0) {//nop; +goto L42c6c0;} +//nop; +a1 = 0x100055f8; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t4; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c6ac; +a1 = a1; +L42c6ac: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000dc; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c6c0: +t5 = 0x1000a36c; +at = 0x1; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L42c758;} +//nop; +t6 = 0x10000008; +at = 0x2; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == at) {at = 0x3; +goto L42c6f8;} +at = 0x3; +if (t6 != at) {//nop; +goto L42c758;} +//nop; +L42c6f8: +t7 = 0x10000210; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L42c758;} +//nop; +t9 = MEM_U32(sp + 88); +a0 = 0x1000a26c; +a2 = 0x1000a32c; +MEM_U32(sp + 16) = t9; +//nop; +a1 = 0x10005600; +a3 = 0x10005610; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c744; +a3 = a3; +L42c744: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000dc; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c758: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x10005618; +a3 = 0x10005624; +t0 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c78c; +MEM_U32(sp + 16) = t0; +L42c78c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000dc; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c7a0: +t8 = 0x100000e0; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L42c7d0;} +//nop; +//nop; +a0 = t8; +//nop; +wrapper_free(mem, a0); +goto L42c7c8; +//nop; +L42c7c8: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42c7d0: +t2 = MEM_U32(sp + 84); +//nop; +if (t2 == 0) {//nop; +goto L42c810;} +//nop; +a1 = 0x1000562c; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t2; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c7fc; +a1 = a1; +L42c7fc: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000e0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c810: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x10005630; +a3 = 0x1000563c; +t1 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c844; +MEM_U32(sp + 16) = t1; +L42c844: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000e0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c858: +t3 = 0x100000e4; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L42c888;} +//nop; +//nop; +a0 = t3; +//nop; +wrapper_free(mem, a0); +goto L42c880; +//nop; +L42c880: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42c888: +t4 = MEM_U32(sp + 84); +//nop; +if (t4 == 0) {//nop; +goto L42c8c8;} +//nop; +a1 = 0x10005640; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t4; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c8b4; +a1 = a1; +L42c8b4: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000e4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c8c8: +t5 = 0x1000a36c; +at = 0x1; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L42c960;} +//nop; +t6 = 0x10000008; +at = 0x2; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == at) {at = 0x3; +goto L42c900;} +at = 0x3; +if (t6 != at) {//nop; +goto L42c960;} +//nop; +L42c900: +t7 = 0x10000210; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L42c960;} +//nop; +t9 = MEM_U32(sp + 88); +a0 = 0x1000a26c; +a2 = 0x1000a32c; +MEM_U32(sp + 16) = t9; +//nop; +a1 = 0x10005644; +a3 = 0x10005654; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c94c; +a3 = a3; +L42c94c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000e4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c960: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x10005658; +a3 = 0x10005664; +t0 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42c994; +MEM_U32(sp + 16) = t0; +L42c994: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000e4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42c9a8: +t8 = 0x10000104; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L42c9d8;} +//nop; +//nop; +a0 = t8; +//nop; +wrapper_free(mem, a0); +goto L42c9d0; +//nop; +L42c9d0: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42c9d8: +t2 = MEM_U32(sp + 84); +//nop; +if (t2 == 0) {//nop; +goto L42ca18;} +//nop; +a1 = 0x10005668; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t2; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ca04; +a1 = a1; +L42ca04: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000104; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42ca18: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x10005674; +a3 = 0x10005684; +t1 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ca4c; +MEM_U32(sp + 16) = t1; +L42ca4c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000104; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42ca60: +t3 = 0x100000e8; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L42ca90;} +//nop; +//nop; +a0 = t3; +//nop; +wrapper_free(mem, a0); +goto L42ca88; +//nop; +L42ca88: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42ca90: +t4 = 0x100000fc; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42cac0;} +//nop; +//nop; +a0 = t4; +//nop; +wrapper_free(mem, a0); +goto L42cab8; +//nop; +L42cab8: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42cac0: +t5 = 0x10000100; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L42caf0;} +//nop; +//nop; +a0 = t5; +//nop; +wrapper_free(mem, a0); +goto L42cae8; +//nop; +L42cae8: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42caf0: +t6 = MEM_U32(sp + 84); +//nop; +if (t6 == 0) {//nop; +goto L42cb80;} +//nop; +a1 = 0x10005690; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t6; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42cb1c; +a1 = a1; +L42cb1c: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x100000e8; +a1 = 0x10005694; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42cb44; +a1 = a1; +L42cb44: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x100000fc; +a1 = 0x100056a0; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42cb6c; +a1 = a1; +L42cb6c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000100; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42cb80: +t7 = 0x1000a36c; +at = 0x1; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L42cc18;} +//nop; +t9 = 0x10000008; +at = 0x2; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == at) {at = 0x3; +goto L42cbb8;} +at = 0x3; +if (t9 != at) {//nop; +goto L42cc18;} +//nop; +L42cbb8: +t0 = 0x10000210; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L42cc18;} +//nop; +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x100056a8; +a3 = 0x100056b8; +t8 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t8; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42cc04; +MEM_U32(sp + 16) = t8; +L42cc04: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000e8; +MEM_U32(at + 0) = v0; +goto L42ccc0; +MEM_U32(at + 0) = v0; +L42cc18: +t2 = 0x10000424; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42cc78;} +//nop; +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x100056bc; +a3 = 0x100056c8; +t1 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42cc64; +MEM_U32(sp + 16) = t1; +L42cc64: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000e8; +MEM_U32(at + 0) = v0; +goto L42ccc0; +MEM_U32(at + 0) = v0; +L42cc78: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x100056cc; +a3 = 0x100056d8; +t3 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ccac; +MEM_U32(sp + 16) = t3; +L42ccac: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000e8; +//nop; +MEM_U32(at + 0) = v0; +L42ccc0: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x100056dc; +a3 = 0x100056ec; +t4 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t4; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ccf4; +MEM_U32(sp + 16) = t4; +L42ccf4: +// bdead 4004000b gp = MEM_U32(sp + 56); +t5 = MEM_U32(sp + 88); +a0 = 0x1000a26c; +a2 = 0x1000a32c; +at = 0x100000fc; +a1 = 0x100056f8; +a3 = 0x10005708; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +MEM_U32(sp + 16) = t5; +MEM_U32(at + 0) = v0; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42cd34; +a3 = a3; +L42cd34: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000100; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42cd48: +t6 = 0x100000f4; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L42cd78;} +//nop; +//nop; +a0 = t6; +//nop; +wrapper_free(mem, a0); +goto L42cd70; +//nop; +L42cd70: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42cd78: +t7 = 0x100000f8; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L42cda8;} +//nop; +//nop; +a0 = t7; +//nop; +wrapper_free(mem, a0); +goto L42cda0; +//nop; +L42cda0: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42cda8: +t9 = MEM_U32(sp + 84); +//nop; +if (t9 == 0) {//nop; +goto L42ce10;} +//nop; +a0 = t9; +//nop; +a1 = 0x10005710; +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42cdd4; +a1 = a1; +L42cdd4: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x100000f4; +a1 = 0x10005718; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42cdfc; +a1 = a1; +L42cdfc: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000f8; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42ce10: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x10005720; +a3 = 0x1000572c; +t0 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ce44; +MEM_U32(sp + 16) = t0; +L42ce44: +// bdead 4004000b gp = MEM_U32(sp + 56); +t8 = MEM_U32(sp + 88); +a0 = 0x1000a26c; +a2 = 0x1000a32c; +at = 0x100000f4; +a1 = 0x10005734; +a3 = 0x10005740; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +MEM_U32(sp + 16) = t8; +MEM_U32(at + 0) = v0; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ce84; +a3 = a3; +L42ce84: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000f8; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42ce98: +t2 = 0x100000ec; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42cec8;} +//nop; +//nop; +a0 = t2; +//nop; +wrapper_free(mem, a0); +goto L42cec0; +//nop; +L42cec0: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42cec8: +t1 = MEM_U32(sp + 84); +//nop; +if (t1 == 0) {//nop; +goto L42cf08;} +//nop; +a1 = 0x10005748; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t1; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42cef4; +a1 = a1; +L42cef4: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000ec; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42cf08: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x10005750; +a3 = 0x1000575c; +t3 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42cf3c; +MEM_U32(sp + 16) = t3; +L42cf3c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000ec; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42cf50: +t4 = 0x100000f0; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42cf80;} +//nop; +//nop; +a0 = t4; +//nop; +wrapper_free(mem, a0); +goto L42cf78; +//nop; +L42cf78: +// bdead 40040003 gp = MEM_U32(sp + 56); +//nop; +L42cf80: +t5 = MEM_U32(sp + 84); +//nop; +if (t5 == 0) {//nop; +goto L42cfc0;} +//nop; +a1 = 0x10005764; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t5; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42cfac; +a1 = a1; +L42cfac: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000f0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42cfc0: +a0 = 0x1000a26c; +a2 = 0x1000a32c; +a1 = 0x1000576c; +a3 = 0x10005778; +t6 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t6; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42cff4; +MEM_U32(sp + 16) = t6; +L42cff4: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100000f0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42d008: +t7 = MEM_U32(sp + 84); +//nop; +if (t7 == 0) {//nop; +goto L42d180;} +//nop; +t9 = 0x10000220; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L42d0d8;} +//nop; +a1 = 0x1000a258; +//nop; +a2 = MEM_U32(sp + 88); +a1 = MEM_U32(a1 + 0); +a0 = t7; +a3 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d04c; +a3 = zero; +L42d04c: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x10000164; +a1 = 0x10005780; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d074; +a1 = a1; +L42d074: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x1000016c; +a1 = 0x1000578c; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d09c; +a1 = a1; +L42d09c: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x10000170; +a1 = 0x1000579c; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d0c4; +a1 = a1; +L42d0c4: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000168; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42d0d8: +a1 = 0x1000a254; +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a1 = MEM_U32(a1 + 0); +a3 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d0f4; +a3 = zero; +L42d0f4: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x10000164; +a1 = 0x100057a4; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d11c; +a1 = a1; +L42d11c: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x1000016c; +a1 = 0x100057b0; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d144; +a1 = a1; +L42d144: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x10000170; +a1 = 0x100057c0; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d16c; +a1 = a1; +L42d16c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000168; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42d180: +t0 = 0x10000220; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L42d510;} +//nop; +t8 = 0x1000037c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L42d2c8;} +//nop; +a0 = 0x1000a258; +//nop; +a1 = MEM_U32(sp + 88); +a0 = MEM_U32(a0 + 0); +a2 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d1c8; +a2 = zero; +L42d1c8: +// bdead 4004000b gp = MEM_U32(sp + 56); +s2 = v0; +a1 = 0x1000a598; +//nop; +a1 = MEM_U32(a1 + 8); +// fdead 601c004f t9 = t9; +a0 = s2; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d1e8; +a0 = s2; +L42d1e8: +// bdead 4004010b gp = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 88); +at = 0x10000164; +a0 = 0x100057c8; +//nop; +a2 = zero; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d20c; +a0 = a0; +L42d20c: +// bdead 4004000b gp = MEM_U32(sp + 56); +s2 = v0; +a1 = 0x1000a598; +//nop; +a1 = MEM_U32(a1 + 8); +// fdead 601c004f t9 = t9; +a0 = s2; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d22c; +a0 = s2; +L42d22c: +// bdead 4004010b gp = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 88); +at = 0x10000168; +a0 = 0x100057d0; +//nop; +a2 = zero; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d250; +a0 = a0; +L42d250: +// bdead 4004000b gp = MEM_U32(sp + 56); +s2 = v0; +a1 = 0x1000a598; +//nop; +a1 = MEM_U32(a1 + 8); +// fdead 601c004f t9 = t9; +a0 = s2; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d270; +a0 = s2; +L42d270: +// bdead 4004010b gp = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 88); +at = 0x1000016c; +a0 = 0x100057dc; +//nop; +a2 = zero; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d294; +a0 = a0; +L42d294: +// bdead 4004000b gp = MEM_U32(sp + 56); +s2 = v0; +a1 = 0x1000a598; +//nop; +a1 = MEM_U32(a1 + 8); +// fdead 601c004f t9 = t9; +a0 = s2; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d2b4; +a0 = s2; +L42d2b4: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000170; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42d2c8: +t2 = 0x10000324; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42d3f8;} +//nop; +a0 = 0x1000a258; +//nop; +a1 = MEM_U32(sp + 88); +a0 = MEM_U32(a0 + 0); +a2 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d2f8; +a2 = zero; +L42d2f8: +// bdead 4004000b gp = MEM_U32(sp + 56); +s2 = v0; +a1 = 0x1000a588; +//nop; +a1 = MEM_U32(a1 + 8); +// fdead 601c004f t9 = t9; +a0 = s2; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d318; +a0 = s2; +L42d318: +// bdead 4004010b gp = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 88); +at = 0x10000164; +a0 = 0x100057ec; +//nop; +a2 = zero; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d33c; +a0 = a0; +L42d33c: +// bdead 4004000b gp = MEM_U32(sp + 56); +s2 = v0; +a1 = 0x1000a588; +//nop; +a1 = MEM_U32(a1 + 8); +// fdead 601c004f t9 = t9; +a0 = s2; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d35c; +a0 = s2; +L42d35c: +// bdead 4004010b gp = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 88); +at = 0x10000168; +a0 = 0x100057f4; +//nop; +a2 = zero; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d380; +a0 = a0; +L42d380: +// bdead 4004000b gp = MEM_U32(sp + 56); +s2 = v0; +a1 = 0x1000a588; +//nop; +a1 = MEM_U32(a1 + 8); +// fdead 601c004f t9 = t9; +a0 = s2; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d3a0; +a0 = s2; +L42d3a0: +// bdead 4004010b gp = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 88); +at = 0x1000016c; +a0 = 0x10005800; +//nop; +a2 = zero; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d3c4; +a0 = a0; +L42d3c4: +// bdead 4004000b gp = MEM_U32(sp + 56); +s2 = v0; +a1 = 0x1000a588; +//nop; +a1 = MEM_U32(a1 + 8); +// fdead 601c004f t9 = t9; +a0 = s2; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d3e4; +a0 = s2; +L42d3e4: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000170; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42d3f8: +a0 = 0x1000a258; +//nop; +a1 = MEM_U32(sp + 88); +a0 = MEM_U32(a0 + 0); +a2 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d410; +a2 = zero; +L42d410: +// bdead 4004000b gp = MEM_U32(sp + 56); +s2 = v0; +a1 = 0x1000a578; +//nop; +a1 = MEM_U32(a1 + 8); +// fdead 601c004f t9 = t9; +a0 = s2; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d430; +a0 = s2; +L42d430: +// bdead 4004010b gp = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 88); +at = 0x10000164; +a0 = 0x10005810; +//nop; +a2 = zero; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d454; +a0 = a0; +L42d454: +// bdead 4004000b gp = MEM_U32(sp + 56); +s2 = v0; +a1 = 0x1000a578; +//nop; +a1 = MEM_U32(a1 + 8); +// fdead 601c004f t9 = t9; +a0 = s2; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d474; +a0 = s2; +L42d474: +// bdead 4004010b gp = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 88); +at = 0x10000168; +a0 = 0x10005818; +//nop; +a2 = zero; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d498; +a0 = a0; +L42d498: +// bdead 4004000b gp = MEM_U32(sp + 56); +s2 = v0; +a1 = 0x1000a578; +//nop; +a1 = MEM_U32(a1 + 8); +// fdead 601c004f t9 = t9; +a0 = s2; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d4b8; +a0 = s2; +L42d4b8: +// bdead 4004010b gp = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 88); +at = 0x1000016c; +a0 = 0x10005824; +//nop; +a2 = zero; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d4dc; +a0 = a0; +L42d4dc: +// bdead 4004000b gp = MEM_U32(sp + 56); +s2 = v0; +a1 = 0x1000a578; +//nop; +a1 = MEM_U32(a1 + 8); +// fdead 601c004f t9 = t9; +a0 = s2; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d4fc; +a0 = s2; +L42d4fc: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000170; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42d510: +t1 = 0x1000037c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L42d5e0;} +//nop; +a0 = 0x1000a254; +a1 = 0x1000a598; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +// bdead 40040063 t9 = t9; +//nop; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d548; +//nop; +L42d548: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +a1 = 0x1000a598; +//nop; +at = 0x10000164; +a0 = 0x10005834; +a1 = MEM_U32(a1 + 8); +// fdead 601c006f t9 = t9; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d574; +a0 = a0; +L42d574: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +a1 = 0x1000a598; +//nop; +at = 0x10000168; +a0 = 0x1000583c; +a1 = MEM_U32(a1 + 8); +// fdead 601c006f t9 = t9; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d5a0; +a0 = a0; +L42d5a0: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +a1 = 0x1000a598; +//nop; +at = 0x1000016c; +a0 = 0x10005848; +a1 = MEM_U32(a1 + 8); +// fdead 601c006f t9 = t9; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d5cc; +a0 = a0; +L42d5cc: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000170; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42d5e0: +t3 = 0x10000324; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L42d6b0;} +//nop; +a0 = 0x1000a254; +a1 = 0x1000a588; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +// bdead 40040063 t9 = t9; +//nop; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d618; +//nop; +L42d618: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +a1 = 0x1000a588; +//nop; +at = 0x10000164; +a0 = 0x10005858; +a1 = MEM_U32(a1 + 8); +// fdead 601c006f t9 = t9; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d644; +a0 = a0; +L42d644: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +a1 = 0x1000a588; +//nop; +at = 0x10000168; +a0 = 0x10005860; +a1 = MEM_U32(a1 + 8); +// fdead 601c006f t9 = t9; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d670; +a0 = a0; +L42d670: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +a1 = 0x1000a588; +//nop; +at = 0x1000016c; +a0 = 0x1000586c; +a1 = MEM_U32(a1 + 8); +// fdead 601c006f t9 = t9; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d69c; +a0 = a0; +L42d69c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000170; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42d6b0: +a0 = 0x1000a254; +a1 = 0x1000a578; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 8); +// bdead 40040063 t9 = t9; +//nop; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d6d0; +//nop; +L42d6d0: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +a1 = 0x1000a578; +//nop; +at = 0x10000164; +a0 = 0x1000587c; +a1 = MEM_U32(a1 + 8); +// fdead 601c006f t9 = t9; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d6fc; +a0 = a0; +L42d6fc: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +a1 = 0x1000a578; +//nop; +at = 0x10000168; +a0 = 0x10005884; +a1 = MEM_U32(a1 + 8); +// fdead 601c006f t9 = t9; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d728; +a0 = a0; +L42d728: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +a1 = 0x1000a578; +//nop; +at = 0x1000016c; +a0 = 0x10005890; +a1 = MEM_U32(a1 + 8); +// fdead 601c006f t9 = t9; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42d754; +a0 = a0; +L42d754: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000170; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42d768: +t4 = MEM_U32(sp + 84); +//nop; +if (t4 == 0) {//nop; +goto L42d840;} +//nop; +t5 = MEM_U32(sp + 88); +//nop; +if (t5 == 0) {//nop; +goto L42d7dc;} +//nop; +t6 = MEM_U8(t5 + 0); +//nop; +if (t6 == 0) {//nop; +goto L42d7dc;} +//nop; +t9 = 0x10000130; +a0 = 0x100058a0; +t9 = MEM_U32(t9 + 0); +a2 = 0x100058a4; +MEM_U32(sp + 16) = t9; +//nop; +a1 = t4; +a3 = t5; +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d7c8; +a2 = a2; +L42d7c8: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000174; +MEM_U32(at + 0) = v0; +goto L42d810; +MEM_U32(at + 0) = v0; +L42d7dc: +a2 = 0x10000130; +a0 = 0x100058a8; +//nop; +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(a2 + 0); +a3 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d7fc; +a0 = a0; +L42d7fc: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000174; +//nop; +MEM_U32(at + 0) = v0; +L42d810: +a1 = 0x100058ac; +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d82c; +a1 = a1; +L42d82c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000178; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42d840: +t0 = 0x10000324; +t7 = 0x100058b4; +at = 0x10000174; +t0 = MEM_U32(t0 + 0); +t7 = t7; +if (t0 == 0) {MEM_U32(at + 0) = t7; +goto L42d8a4;} +MEM_U32(at + 0) = t7; +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x100058b8; +a3 = 0x100058cc; +t8 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t8; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d890; +MEM_U32(sp + 16) = t8; +L42d890: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000178; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42d8a4: +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x100058d4; +a3 = 0x100058e0; +t2 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d8d8; +MEM_U32(sp + 16) = t2; +L42d8d8: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000178; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42d8ec: +t1 = MEM_U32(sp + 84); +//nop; +if (t1 == 0) {//nop; +goto L42d954;} +//nop; +a1 = 0x1000014c; +//nop; +a2 = MEM_U32(sp + 88); +a1 = MEM_U32(a1 + 0); +a0 = t1; +a3 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d918; +a3 = zero; +L42d918: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x100001b4; +a1 = 0x100058e8; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d940; +a1 = a1; +L42d940: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001b8; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42d954: +t6 = 0x10000324; +t3 = 0x100058f4; +at = 0x100001b4; +t6 = MEM_U32(t6 + 0); +t3 = t3; +if (t6 == 0) {MEM_U32(at + 0) = t3; +goto L42d9b8;} +MEM_U32(at + 0) = t3; +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x100058fc; +a3 = 0x10005910; +t4 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t4; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d9a4; +MEM_U32(sp + 16) = t4; +L42d9a4: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001b8; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42d9b8: +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x1000591c; +a3 = 0x10005928; +t5 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t5; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42d9ec; +MEM_U32(sp + 16) = t5; +L42d9ec: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001b8; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42da00: +t9 = MEM_U32(sp + 84); +//nop; +if (t9 == 0) {//nop; +goto L42db40;} +//nop; +t7 = MEM_U32(sp + 88); +//nop; +if (t7 == 0) {//nop; +goto L42dab0;} +//nop; +t0 = MEM_U8(t7 + 0); +//nop; +if (t0 == 0) {//nop; +goto L42dab0;} +//nop; +t8 = 0x10000144; +a1 = t9; +//nop; +a0 = 0x10005934; +a2 = 0x10005938; +t8 = MEM_U32(t8 + 0); +a3 = t7; +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +MEM_U32(sp + 16) = t8; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42da60; +MEM_U32(sp + 16) = t8; +L42da60: +// bdead 4004000b gp = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 84); +t2 = 0x10000160; +at = 0x100001bc; +a0 = 0x1000593c; +a2 = 0x10005940; +//nop; +t2 = MEM_U32(t2 + 0); +a3 = MEM_U32(sp + 88); +MEM_U32(sp + 20) = zero; +MEM_U32(at + 0) = v0; +a0 = a0; +a2 = a2; +MEM_U32(sp + 16) = t2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42da9c; +MEM_U32(sp + 16) = t2; +L42da9c: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001e4; +MEM_U32(at + 0) = v0; +goto L42db10; +MEM_U32(at + 0) = v0; +L42dab0: +a2 = 0x10000144; +a0 = 0x10005944; +//nop; +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(a2 + 0); +a3 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42dad0; +a0 = a0; +L42dad0: +// bdead 4004000b gp = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 84); +a2 = 0x10000160; +at = 0x100001bc; +a0 = 0x10005948; +//nop; +a2 = MEM_U32(a2 + 0); +a3 = zero; +MEM_U32(at + 0) = v0; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42dafc; +a0 = a0; +L42dafc: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001e4; +//nop; +MEM_U32(at + 0) = v0; +L42db10: +a1 = 0x1000594c; +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42db2c; +a1 = a1; +L42db2c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001c0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42db40: +t1 = MEM_U32(sp + 88); +//nop; +if (t1 == 0) {//nop; +goto L42dbd0;} +//nop; +t3 = MEM_U8(t1 + 0); +//nop; +if (t3 == 0) {//nop; +goto L42dbd0;} +//nop; +a3 = 0x10000144; +a0 = 0x10005958; +a1 = 0x1000595c; +//nop; +a3 = MEM_U32(a3 + 0); +a2 = t1; +MEM_U32(sp + 16) = zero; +a0 = a0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42db88; +a1 = a1; +L42db88: +// bdead 4004000b gp = MEM_U32(sp + 56); +a2 = MEM_U32(sp + 88); +a3 = 0x10000160; +at = 0x100001bc; +a0 = 0x10005960; +a1 = 0x10005964; +//nop; +a3 = MEM_U32(a3 + 0); +MEM_U32(sp + 16) = zero; +MEM_U32(at + 0) = v0; +a0 = a0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42dbbc; +a1 = a1; +L42dbbc: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001e4; +MEM_U32(at + 0) = v0; +goto L42dbf0; +MEM_U32(at + 0) = v0; +L42dbd0: +t6 = 0x10005968; +at = 0x100001bc; +t6 = t6; +t4 = 0x10005970; +MEM_U32(at + 0) = t6; +at = 0x100001e4; +t4 = t4; +MEM_U32(at + 0) = t4; +L42dbf0: +t5 = 0x10000324; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L42dc50;} +//nop; +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005978; +a3 = 0x1000598c; +t0 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42dc3c; +MEM_U32(sp + 16) = t0; +L42dc3c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001c0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42dc50: +t9 = MEM_U32(sp + 88); +a0 = 0x1000a25c; +a2 = 0x1000a32c; +MEM_U32(sp + 16) = t9; +//nop; +a1 = 0x10005998; +a3 = 0x100059a4; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42dc84; +a3 = a3; +L42dc84: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001c0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42dc98: +t7 = MEM_U32(sp + 84); +//nop; +if (t7 == 0) {//nop; +goto L42dd98;} +//nop; +t8 = MEM_U32(sp + 88); +//nop; +if (t8 == 0) {//nop; +goto L42dd0c;} +//nop; +t2 = MEM_U8(t8 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42dd0c;} +//nop; +t3 = 0x10000148; +a0 = 0x100059b0; +a2 = 0x100059b4; +//nop; +t3 = MEM_U32(t3 + 0); +a1 = t7; +a3 = t8; +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +MEM_U32(sp + 16) = t3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42dcf8; +MEM_U32(sp + 16) = t3; +L42dcf8: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001ac; +MEM_U32(at + 0) = v0; +goto L42dd40; +MEM_U32(at + 0) = v0; +L42dd0c: +a2 = 0x10000148; +a0 = 0x100059b8; +//nop; +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(a2 + 0); +a3 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42dd2c; +a0 = a0; +L42dd2c: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001ac; +//nop; +MEM_U32(at + 0) = v0; +L42dd40: +a1 = 0x100059bc; +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42dd5c; +a1 = a1; +L42dd5c: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x100001a8; +a1 = 0x100059c4; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42dd84; +a1 = a1; +L42dd84: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001b0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42dd98: +t1 = MEM_U32(sp + 88); +//nop; +if (t1 == 0) {//nop; +goto L42de8c;} +//nop; +t6 = MEM_U8(t1 + 0); +//nop; +if (t6 == 0) {//nop; +goto L42de8c;} +//nop; +t4 = 0x10000324; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42de2c;} +//nop; +t0 = 0x10000148; +a1 = 0x1000a25c; +a3 = 0x1000a32c; +t5 = 0x100059e4; +a0 = 0x100059cc; +a2 = 0x100059d0; +//nop; +t0 = MEM_U32(t0 + 0); +a1 = MEM_U32(a1 + 0); +a3 = MEM_U32(a3 + 0); +t5 = t5; +MEM_U32(sp + 16) = t5; +MEM_U32(sp + 20) = t1; +MEM_U32(sp + 28) = zero; +a0 = a0; +a2 = a2; +MEM_U32(sp + 24) = t0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42de18; +MEM_U32(sp + 24) = t0; +L42de18: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001ac; +MEM_U32(at + 0) = v0; +goto L42df3c; +MEM_U32(at + 0) = v0; +L42de2c: +t9 = 0x100059f8; +t7 = 0x10000148; +t9 = t9; +a1 = 0x1000a25c; +a3 = 0x1000a32c; +MEM_U32(sp + 16) = t9; +//nop; +a0 = 0x100059e8; +a2 = 0x100059ec; +t2 = MEM_U32(sp + 88); +t7 = MEM_U32(t7 + 0); +a1 = MEM_U32(a1 + 0); +a3 = MEM_U32(a3 + 0); +MEM_U32(sp + 28) = zero; +a0 = a0; +a2 = a2; +MEM_U32(sp + 20) = t2; +MEM_U32(sp + 24) = t7; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42de78; +MEM_U32(sp + 24) = t7; +L42de78: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001ac; +MEM_U32(at + 0) = v0; +goto L42df3c; +MEM_U32(at + 0) = v0; +L42de8c: +t8 = 0x10000324; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L42def0;} +//nop; +t3 = 0x10000148; +a1 = 0x1000a25c; +a3 = 0x1000a32c; +a0 = 0x100059fc; +a2 = 0x10005a00; +//nop; +t3 = MEM_U32(t3 + 0); +a1 = MEM_U32(a1 + 0); +a3 = MEM_U32(a3 + 0); +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +MEM_U32(sp + 16) = t3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42dedc; +MEM_U32(sp + 16) = t3; +L42dedc: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001ac; +MEM_U32(at + 0) = v0; +goto L42df3c; +MEM_U32(at + 0) = v0; +L42def0: +t6 = 0x10000148; +a1 = 0x1000a25c; +a3 = 0x1000a32c; +a0 = 0x10005a0c; +a2 = 0x10005a10; +//nop; +t6 = MEM_U32(t6 + 0); +a1 = MEM_U32(a1 + 0); +a3 = MEM_U32(a3 + 0); +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +MEM_U32(sp + 16) = t6; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42df28; +MEM_U32(sp + 16) = t6; +L42df28: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001ac; +//nop; +MEM_U32(at + 0) = v0; +L42df3c: +t4 = 0x10000324; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42dfdc;} +//nop; +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005a1c; +a3 = 0x10005a30; +t5 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t5; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42df88; +MEM_U32(sp + 16) = t5; +L42df88: +// bdead 4004000b gp = MEM_U32(sp + 56); +t1 = MEM_U32(sp + 88); +a0 = 0x1000a25c; +a2 = 0x1000a32c; +at = 0x100001a8; +a1 = 0x10005a38; +a3 = 0x10005a4c; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +MEM_U32(sp + 16) = t1; +MEM_U32(at + 0) = v0; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42dfc8; +a3 = a3; +L42dfc8: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001b0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42dfdc: +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005a54; +a3 = 0x10005a60; +t0 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e010; +MEM_U32(sp + 16) = t0; +L42e010: +// bdead 4004000b gp = MEM_U32(sp + 56); +t9 = MEM_U32(sp + 88); +a0 = 0x1000a25c; +a2 = 0x1000a32c; +MEM_U32(sp + 16) = t9; +at = 0x100001a8; +//nop; +a1 = 0x10005a68; +a3 = 0x10005a74; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e050; +a3 = a3; +L42e050: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001b0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e064: +t2 = MEM_U32(sp + 84); +//nop; +if (t2 == 0) {//nop; +goto L42e13c;} +//nop; +t7 = MEM_U32(sp + 88); +//nop; +if (t7 == 0) {//nop; +goto L42e0d8;} +//nop; +t8 = MEM_U8(t7 + 0); +//nop; +if (t8 == 0) {//nop; +goto L42e0d8;} +//nop; +t3 = 0x1000015c; +a0 = 0x10005a7c; +a2 = 0x10005a80; +//nop; +t3 = MEM_U32(t3 + 0); +a1 = t2; +a3 = t7; +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +MEM_U32(sp + 16) = t3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e0c4; +MEM_U32(sp + 16) = t3; +L42e0c4: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001d8; +MEM_U32(at + 0) = v0; +goto L42e10c; +MEM_U32(at + 0) = v0; +L42e0d8: +a2 = 0x1000015c; +a0 = 0x10005a84; +//nop; +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(a2 + 0); +a3 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e0f8; +a0 = a0; +L42e0f8: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001d8; +//nop; +MEM_U32(at + 0) = v0; +L42e10c: +a1 = 0x10005a88; +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e128; +a1 = a1; +L42e128: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001dc; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e13c: +t4 = 0x10000324; +t6 = 0x10005a98; +at = 0x100001d8; +t4 = MEM_U32(t4 + 0); +t6 = t6; +if (t4 == 0) {MEM_U32(at + 0) = t6; +goto L42e1a0;} +MEM_U32(at + 0) = t6; +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005aa4; +a3 = 0x10005ab8; +t5 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t5; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e18c; +MEM_U32(sp + 16) = t5; +L42e18c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001dc; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e1a0: +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005ac8; +a3 = 0x10005ad4; +t1 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e1d4; +MEM_U32(sp + 16) = t1; +L42e1d4: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001dc; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e1e8: +t0 = MEM_U32(sp + 84); +//nop; +if (t0 == 0) {//nop; +goto L42e250;} +//nop; +a1 = 0x10000154; +//nop; +a2 = MEM_U32(sp + 88); +a1 = MEM_U32(a1 + 0); +a0 = t0; +a3 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e214; +a3 = zero; +L42e214: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x100001cc; +a1 = 0x10005ae4; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e23c; +a1 = a1; +L42e23c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001d0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e250: +t8 = 0x10000324; +t9 = 0x10005af0; +at = 0x100001cc; +t8 = MEM_U32(t8 + 0); +t9 = t9; +if (t8 == 0) {MEM_U32(at + 0) = t9; +goto L42e2b4;} +MEM_U32(at + 0) = t9; +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005af8; +a3 = 0x10005b0c; +t2 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e2a0; +MEM_U32(sp + 16) = t2; +L42e2a0: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001d0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e2b4: +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005b18; +a3 = 0x10005b24; +t7 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t7; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e2e8; +MEM_U32(sp + 16) = t7; +L42e2e8: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001d0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e2fc: +t3 = 0x10000220; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L42f188;} +//nop; +t6 = MEM_U32(sp + 84); +//nop; +if (t6 == 0) {//nop; +goto L42e3bc;} +//nop; +t4 = MEM_U32(sp + 88); +//nop; +if (t4 == 0) {//nop; +goto L42e388;} +//nop; +t5 = MEM_U8(t4 + 0); +//nop; +if (t5 == 0) {//nop; +goto L42e388;} +//nop; +t1 = 0x10000158; +a0 = 0x10005b30; +a2 = 0x10005b34; +//nop; +t1 = MEM_U32(t1 + 0); +a1 = t6; +a3 = t4; +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +MEM_U32(sp + 16) = t1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e374; +MEM_U32(sp + 16) = t1; +L42e374: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001d4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e388: +a2 = 0x10000158; +a0 = 0x10005b38; +//nop; +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(a2 + 0); +a3 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e3a8; +a0 = a0; +L42e3a8: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001d4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e3bc: +t0 = 0x10000324; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L42e404;} +//nop; +a1 = 0x1000a588; +//nop; +a0 = 0x10005b3c; +a1 = MEM_U32(a1 + 8); +// bdead 40040063 t9 = t9; +a0 = a0; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42e3f0; +a0 = a0; +L42e3f0: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001d4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e404: +a1 = 0x1000a578; +//nop; +a0 = 0x10005b48; +a1 = MEM_U32(a1 + 8); +// bdead 40040063 t9 = t9; +a0 = a0; +v0 = func_4339c8(mem, sp, a0, a1); +goto L42e420; +a0 = a0; +L42e420: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001d4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e434: +t9 = MEM_U32(sp + 84); +//nop; +if (t9 == 0) {//nop; +goto L42e5d8;} +//nop; +s2 = 0x10000414; +//nop; +s2 = MEM_U32(s2 + 0); +//nop; +if (s2 == 0) {at = 0x1; +goto L42e46c;} +at = 0x1; +if (s2 == at) {at = 0x2; +goto L42e528;} +at = 0x2; +if (s2 == at) {//nop; +goto L42e580;} +//nop; +L42e46c: +t8 = MEM_U32(sp + 88); +//nop; +if (t8 == 0) {//nop; +goto L42e4c4;} +//nop; +t2 = MEM_U8(t8 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42e4c4;} +//nop; +a3 = 0x1000012c; +a1 = 0x10005b54; +//nop; +a0 = MEM_U32(sp + 84); +a3 = MEM_U32(a3 + 0); +a2 = t8; +MEM_U32(sp + 16) = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e4b0; +a1 = a1; +L42e4b0: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x1000017c; +MEM_U32(at + 0) = v0; +goto L42e4f8; +MEM_U32(at + 0) = v0; +L42e4c4: +a2 = 0x1000012c; +a0 = 0x10005b58; +//nop; +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(a2 + 0); +a3 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e4e4; +a0 = a0; +L42e4e4: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x1000017c; +//nop; +MEM_U32(at + 0) = v0; +L42e4f8: +a1 = 0x10005b5c; +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e514; +a1 = a1; +L42e514: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000180; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e528: +a1 = 0x10005b64; +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e544; +a1 = a1; +L42e544: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x1000017c; +a1 = 0x10005b74; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e56c; +a1 = a1; +L42e56c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000180; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e580: +a1 = 0x10005b84; +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e59c; +a1 = a1; +L42e59c: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x1000017c; +a1 = 0x10005b94; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e5c4; +a1 = a1; +L42e5c4: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000180; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e5d8: +s2 = 0x10000414; +//nop; +s2 = MEM_U32(s2 + 0); +//nop; +if (s2 == 0) {at = 0x1; +goto L42e600;} +at = 0x1; +if (s2 == at) {at = 0x2; +goto L42e6ac;} +at = 0x2; +if (s2 == at) {//nop; +goto L42e7d4;} +//nop; +L42e600: +t3 = 0x10000324; +t7 = 0x10005ba4; +at = 0x1000017c; +t3 = MEM_U32(t3 + 0); +t7 = t7; +if (t3 == 0) {MEM_U32(at + 0) = t7; +goto L42e664;} +MEM_U32(at + 0) = t7; +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005ba8; +a3 = 0x10005bbc; +t5 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t5; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e650; +MEM_U32(sp + 16) = t5; +L42e650: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000180; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e664: +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005bc4; +a3 = 0x10005bd0; +t6 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t6; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e698; +MEM_U32(sp + 16) = t6; +L42e698: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000180; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e6ac: +t4 = 0x10000324; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42e74c;} +//nop; +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005bd8; +a3 = 0x10005bec; +t1 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e6f8; +MEM_U32(sp + 16) = t1; +L42e6f8: +// bdead 4004000b gp = MEM_U32(sp + 56); +t0 = MEM_U32(sp + 88); +a0 = 0x1000a25c; +a2 = 0x1000a32c; +at = 0x1000017c; +a1 = 0x10005bfc; +a3 = 0x10005c10; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +MEM_U32(sp + 16) = t0; +MEM_U32(at + 0) = v0; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e738; +a3 = a3; +L42e738: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000180; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e74c: +t9 = MEM_U32(sp + 88); +a0 = 0x1000a25c; +a2 = 0x1000a32c; +MEM_U32(sp + 16) = t9; +//nop; +a1 = 0x10005c20; +a3 = 0x10005c2c; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e780; +a3 = a3; +L42e780: +// bdead 4004000b gp = MEM_U32(sp + 56); +t2 = MEM_U32(sp + 88); +a0 = 0x1000a25c; +a2 = 0x1000a32c; +at = 0x1000017c; +a1 = 0x10005c3c; +a3 = 0x10005c48; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +MEM_U32(sp + 16) = t2; +MEM_U32(at + 0) = v0; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e7c0; +a3 = a3; +L42e7c0: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000180; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e7d4: +t8 = 0x10000324; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L42e874;} +//nop; +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005c58; +a3 = 0x10005c6c; +t7 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t7; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e820; +MEM_U32(sp + 16) = t7; +L42e820: +// bdead 4004000b gp = MEM_U32(sp + 56); +t3 = MEM_U32(sp + 88); +a0 = 0x1000a25c; +a2 = 0x1000a32c; +at = 0x1000017c; +a1 = 0x10005c7c; +a3 = 0x10005c90; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +MEM_U32(sp + 16) = t3; +MEM_U32(at + 0) = v0; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e860; +a3 = a3; +L42e860: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000180; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e874: +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005ca0; +a3 = 0x10005cac; +t5 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t5; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e8a8; +MEM_U32(sp + 16) = t5; +L42e8a8: +// bdead 4004000b gp = MEM_U32(sp + 56); +t6 = MEM_U32(sp + 88); +a0 = 0x1000a25c; +a2 = 0x1000a32c; +at = 0x1000017c; +a1 = 0x10005cbc; +a3 = 0x10005cc8; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +MEM_U32(sp + 16) = t6; +MEM_U32(at + 0) = v0; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e8e8; +a3 = a3; +L42e8e8: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000180; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e8fc: +t4 = MEM_U32(sp + 84); +//nop; +if (t4 == 0) {//nop; +goto L42e9d4;} +//nop; +t1 = MEM_U32(sp + 88); +//nop; +if (t1 == 0) {//nop; +goto L42e970;} +//nop; +t0 = MEM_U8(t1 + 0); +//nop; +if (t0 == 0) {//nop; +goto L42e970;} +//nop; +t9 = 0x10000134; +a0 = 0x10005cd8; +t9 = MEM_U32(t9 + 0); +a2 = 0x10005cdc; +MEM_U32(sp + 16) = t9; +//nop; +a1 = t4; +a3 = t1; +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e95c; +a2 = a2; +L42e95c: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000184; +MEM_U32(at + 0) = v0; +goto L42e9a4; +MEM_U32(at + 0) = v0; +L42e970: +a2 = 0x10000134; +a0 = 0x10005ce0; +//nop; +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(a2 + 0); +a3 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e990; +a0 = a0; +L42e990: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000184; +//nop; +MEM_U32(at + 0) = v0; +L42e9a4: +a1 = 0x10005ce4; +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42e9c0; +a1 = a1; +L42e9c0: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000188; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42e9d4: +t2 = 0x10005cf0; +at = 0x10000198; +t7 = 0x10000324; +t2 = t2; +t8 = 0x10005cf8; +MEM_U32(at + 0) = t2; +at = 0x10000184; +t7 = MEM_U32(t7 + 0); +t8 = t8; +if (t7 == 0) {MEM_U32(at + 0) = t8; +goto L42ea48;} +MEM_U32(at + 0) = t8; +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005d00; +a3 = 0x10005d14; +t3 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ea34; +MEM_U32(sp + 16) = t3; +L42ea34: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000188; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42ea48: +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005d20; +a3 = 0x10005d2c; +t5 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t5; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ea7c; +MEM_U32(sp + 16) = t5; +L42ea7c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000188; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42ea90: +t6 = MEM_U32(sp + 84); +//nop; +if (t6 == 0) {//nop; +goto L42eb68;} +//nop; +t0 = MEM_U32(sp + 88); +//nop; +if (t0 == 0) {//nop; +goto L42eb04;} +//nop; +t4 = MEM_U8(t0 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42eb04;} +//nop; +t1 = 0x10000138; +a0 = 0x10005d38; +a2 = 0x10005d3c; +//nop; +t1 = MEM_U32(t1 + 0); +a1 = t6; +a3 = t0; +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +MEM_U32(sp + 16) = t1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42eaf0; +MEM_U32(sp + 16) = t1; +L42eaf0: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x1000018c; +MEM_U32(at + 0) = v0; +goto L42eb38; +MEM_U32(at + 0) = v0; +L42eb04: +a2 = 0x10000138; +a0 = 0x10005d40; +//nop; +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(a2 + 0); +a3 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42eb24; +a0 = a0; +L42eb24: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x1000018c; +//nop; +MEM_U32(at + 0) = v0; +L42eb38: +a1 = 0x10005d44; +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42eb54; +a1 = a1; +L42eb54: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000190; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42eb68: +t2 = 0x10000324; +t9 = 0x10005d50; +at = 0x1000018c; +t2 = MEM_U32(t2 + 0); +t9 = t9; +if (t2 == 0) {MEM_U32(at + 0) = t9; +goto L42ebcc;} +MEM_U32(at + 0) = t9; +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005d58; +a3 = 0x10005d6c; +t8 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t8; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ebb8; +MEM_U32(sp + 16) = t8; +L42ebb8: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000190; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42ebcc: +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005d78; +a3 = 0x10005d84; +t7 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t7; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ec00; +MEM_U32(sp + 16) = t7; +L42ec00: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000190; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42ec14: +t3 = MEM_U32(sp + 84); +//nop; +if (t3 == 0) {//nop; +goto L42ecec;} +//nop; +t5 = MEM_U32(sp + 88); +//nop; +if (t5 == 0) {//nop; +goto L42ec88;} +//nop; +t4 = MEM_U8(t5 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42ec88;} +//nop; +t6 = 0x10000140; +a0 = 0x10005d90; +a2 = 0x10005d94; +//nop; +t6 = MEM_U32(t6 + 0); +a1 = t3; +a3 = t5; +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +MEM_U32(sp + 16) = t6; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ec74; +MEM_U32(sp + 16) = t6; +L42ec74: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001a0; +MEM_U32(at + 0) = v0; +goto L42ecbc; +MEM_U32(at + 0) = v0; +L42ec88: +a2 = 0x10000140; +a0 = 0x10005d98; +//nop; +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(a2 + 0); +a3 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42eca8; +a0 = a0; +L42eca8: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001a0; +//nop; +MEM_U32(at + 0) = v0; +L42ecbc: +a1 = 0x10005d9c; +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ecd8; +a1 = a1; +L42ecd8: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001a4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42ecec: +t1 = 0x10000324; +t0 = 0x10005da8; +at = 0x100001a0; +t1 = MEM_U32(t1 + 0); +t0 = t0; +if (t1 == 0) {MEM_U32(at + 0) = t0; +goto L42ed50;} +MEM_U32(at + 0) = t0; +t9 = MEM_U32(sp + 88); +a0 = 0x1000a25c; +a2 = 0x1000a32c; +MEM_U32(sp + 16) = t9; +//nop; +a1 = 0x10005db0; +a3 = 0x10005dc4; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ed3c; +a3 = a3; +L42ed3c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001a4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42ed50: +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005dd0; +a3 = 0x10005ddc; +t2 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ed84; +MEM_U32(sp + 16) = t2; +L42ed84: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001a4; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42ed98: +t8 = MEM_U32(sp + 84); +//nop; +if (t8 == 0) {//nop; +goto L42ee70;} +//nop; +t7 = MEM_U32(sp + 88); +//nop; +if (t7 == 0) {//nop; +goto L42ee0c;} +//nop; +t4 = MEM_U8(t7 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42ee0c;} +//nop; +t3 = 0x1000013c; +a0 = 0x10005de8; +a2 = 0x10005dec; +//nop; +t3 = MEM_U32(t3 + 0); +a1 = t8; +a3 = t7; +MEM_U32(sp + 20) = zero; +a0 = a0; +a2 = a2; +MEM_U32(sp + 16) = t3; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42edf8; +MEM_U32(sp + 16) = t3; +L42edf8: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000194; +MEM_U32(at + 0) = v0; +goto L42ee40; +MEM_U32(at + 0) = v0; +L42ee0c: +a2 = 0x1000013c; +a0 = 0x10005df0; +//nop; +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(a2 + 0); +a3 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ee2c; +a0 = a0; +L42ee2c: +// bdead 4004000b gp = MEM_U32(sp + 56); +//nop; +at = 0x10000194; +//nop; +MEM_U32(at + 0) = v0; +L42ee40: +a1 = 0x10005df4; +//nop; +a0 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ee5c; +a1 = a1; +L42ee5c: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x1000019c; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42ee70: +t6 = 0x10000324; +t5 = 0x10005e00; +at = 0x10000194; +t6 = MEM_U32(t6 + 0); +t5 = t5; +if (t6 == 0) {MEM_U32(at + 0) = t5; +goto L42eed4;} +MEM_U32(at + 0) = t5; +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005e08; +a3 = 0x10005e1c; +t0 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42eec0; +MEM_U32(sp + 16) = t0; +L42eec0: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x1000019c; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42eed4: +a0 = 0x1000a25c; +a2 = 0x1000a32c; +a1 = 0x10005e28; +a3 = 0x10005e34; +t1 = MEM_U32(sp + 88); +//nop; +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 20) = zero; +a1 = a1; +a3 = a3; +MEM_U32(sp + 16) = t1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ef08; +MEM_U32(sp + 16) = t1; +L42ef08: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x1000019c; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42ef1c: +t9 = MEM_U32(sp + 84); +//nop; +if (t9 == 0) {//nop; +goto L42efd4;} +//nop; +a0 = t9; +//nop; +a1 = 0x10005e40; +a2 = MEM_U32(sp + 88); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ef48; +a1 = a1; +L42ef48: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x100001f4; +a1 = 0x10005e48; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ef70; +a1 = a1; +L42ef70: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x100001f8; +a1 = 0x10005e50; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42ef98; +a1 = a1; +L42ef98: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x1000a5c4; +a1 = 0x10005e54; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42efc0; +a1 = a1; +L42efc0: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001ec; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42efd4: +a0 = 0x1000a26c; +a1 = 0x10005e58; +a2 = 0x10005e64; +//nop; +a3 = MEM_U32(sp + 88); +a0 = MEM_U32(a0 + 0); +MEM_U32(sp + 16) = zero; +a1 = a1; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42effc; +a2 = a2; +L42effc: +// bdead 4004000b gp = MEM_U32(sp + 56); +a3 = MEM_U32(sp + 88); +a0 = 0x1000a26c; +at = 0x100001f4; +a1 = 0x10005e6c; +a2 = 0x10005e78; +//nop; +a0 = MEM_U32(a0 + 0); +MEM_U32(sp + 16) = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f030; +a2 = a2; +L42f030: +// bdead 4004000b gp = MEM_U32(sp + 56); +a3 = MEM_U32(sp + 88); +a0 = 0x1000a26c; +at = 0x100001f8; +a1 = 0x10005e80; +a2 = 0x10005e8c; +//nop; +a0 = MEM_U32(a0 + 0); +MEM_U32(sp + 16) = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f064; +a2 = a2; +L42f064: +// bdead 4004000b gp = MEM_U32(sp + 56); +a3 = MEM_U32(sp + 88); +a0 = 0x1000a26c; +at = 0x1000a5c4; +a1 = 0x10005e90; +a2 = 0x10005e9c; +//nop; +a0 = MEM_U32(a0 + 0); +MEM_U32(sp + 16) = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +a2 = a2; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f098; +a2 = a2; +L42f098: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001ec; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42f0ac: +t2 = MEM_U32(sp + 84); +//nop; +if (t2 == 0) {//nop; +goto L42f114;} +//nop; +a1 = 0x10005ea0; +//nop; +a2 = MEM_U32(sp + 88); +a0 = t2; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f0d8; +a1 = a1; +L42f0d8: +// bdead 4004000b gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 84); +at = 0x1000a5c8; +a1 = 0x10005eac; +//nop; +a2 = MEM_U32(sp + 88); +a3 = zero; +MEM_U32(at + 0) = v0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f100; +a1 = a1; +L42f100: +// bdead 4004010b gp = MEM_U32(sp + 56); +//nop; +at = 0x100001f0; +MEM_U32(at + 0) = v0; +goto L42f188; +MEM_U32(at + 0) = v0; +L42f114: +t4 = 0x10005eb8; +at = 0x1000a5c8; +t4 = t4; +t8 = 0x10005ec4; +MEM_U32(at + 0) = t4; +at = 0x100001f0; +t8 = t8; +MEM_U32(at + 0) = t8; +goto L42f188; +MEM_U32(at + 0) = t8; +L42f138: +t7 = 0x10005ecc; +MEM_U32(sp + 16) = zero; +t7 = t7; +MEM_U32(sp + 20) = t7; +t3 = MEM_U8(s1 + 0); +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L42f168; +MEM_U32(sp + 24) = t3; +L42f168: +// bdead 40040003 gp = MEM_U32(sp + 56); +a0 = 0x2; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L42f180; +//nop; +L42f180: +// bdead 40040103 gp = MEM_U32(sp + 56); +//nop; +L42f188: +t5 = MEM_U8(s1 + 1); +s1 = s1 + 0x1; +if (t5 != 0) {//nop; +goto L42b348;} +//nop; +L42f198: +// bdead 1 ra = MEM_U32(sp + 60); +// bdead 1 s1 = MEM_U32(sp + 44); +// bdead 1 s2 = MEM_U32(sp + 48); +// bdead 1 s3 = MEM_U32(sp + 52); +// bdead 1 sp = sp + 0x50; +return; +// bdead 1 sp = sp + 0x50; +} + +static void f_newrunlib(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42f1b0: +//newrunlib: +//nop; +//nop; +//nop; +t6 = 0x10000280; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +// fdead 4000800b MEM_U32(sp + 28) = ra; +if (t6 == 0) {// fdead 4000800b MEM_U32(sp + 24) = gp; +goto L42f1e8;} +// fdead 4000800b MEM_U32(sp + 24) = gp; +t7 = 0x10005ee8; +at = 0x1000042c; +t7 = t7; +MEM_U32(at + 0) = t7; +goto L42f224; +MEM_U32(at + 0) = t7; +L42f1e8: +t8 = 0x10000424; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L42f214;} +//nop; +t9 = 0x10005ef4; +at = 0x1000042c; +t9 = t9; +MEM_U32(at + 0) = t9; +goto L42f224; +MEM_U32(at + 0) = t9; +L42f214: +t0 = 0x10005f00; +at = 0x1000042c; +t0 = t0; +MEM_U32(at + 0) = t0; +L42f224: +//nop; +//nop; +//nop; +v0 = f_gethostsex(mem, sp); +goto L42f234; +//nop; +L42f234: +// bdead 4000000b gp = MEM_U32(sp + 24); +//nop; +t1 = 0x1000041c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (v0 != t1) {//nop; +goto L42f268;} +//nop; +t2 = 0x1000042c; +at = 0x10000428; +t2 = MEM_U32(t2 + 0); +MEM_U32(at + 0) = t2; +goto L42f2a4; +MEM_U32(at + 0) = t2; +L42f268: +t3 = 0x1000041c; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L42f294;} +//nop; +t4 = 0x10005f04; +at = 0x10000428; +t4 = t4; +MEM_U32(at + 0) = t4; +goto L42f2a4; +MEM_U32(at + 0) = t4; +L42f294: +t5 = 0x10005f08; +at = 0x10000428; +t5 = t5; +MEM_U32(at + 0) = t5; +L42f2a4: +a0 = 0x10005f0c; +//nop; +a1 = zero; +a2 = zero; +a0 = a0; +f_relocate_passes(mem, sp, a0, a1, a2); +goto L42f2bc; +a0 = a0; +L42f2bc: +// bdead 1 ra = MEM_U32(sp + 28); +// bdead 1 gp = MEM_U32(sp + 24); +// bdead 1 sp = sp + 0x20; +return; +// bdead 1 sp = sp + 0x20; +} + +static void f_compose_G0_libs(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42f2cc: +//compose_G0_libs: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 32) = a0; +t6 = MEM_U32(sp + 32); +// fdead 4000802b MEM_U32(sp + 28) = ra; +// fdead 4000802b MEM_U32(sp + 24) = gp; +t7 = MEM_U8(t6 + 0); +//nop; +if (t7 == 0) {//nop; +goto L42f5c8;} +//nop; +L42f2fc: +t8 = MEM_U32(sp + 32); +//nop; +t9 = MEM_U8(t8 + 0); +//nop; +t0 = t9 + 0xffffffcf; +at = t0 < 0x3e; +if (at == 0) {//nop; +goto L42f5a8;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100078dc[] = { +&&L42f398, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f3c8, +&&L42f5a8, +&&L42f368, +&&L42f458, +&&L42f5a8, +&&L42f5a8, +&&L42f488, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f428, +&&L42f5a8, +&&L42f3f8, +&&L42f338, +&&L42f5a8, +&&L42f5a8, +&&L42f4e8, +&&L42f5a8, +&&L42f4b8, +&&L42f5a8, +&&L42f518, +&&L42f548, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f5a8, +&&L42f578, +}; +dest = Lswitch100078dc[t0]; +//nop; +goto *dest; +//nop; +L42f338: +a0 = 0x10000130; +a1 = 0x10005f1c; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f354; +a1 = a1; +L42f354: +// bdead 4000010b gp = MEM_U32(sp + 24); +//nop; +at = 0x10000130; +MEM_U32(at + 0) = v0; +goto L42f5a8; +MEM_U32(at + 0) = v0; +L42f368: +a0 = 0x10000144; +a1 = 0x10005f20; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f384; +a1 = a1; +L42f384: +// bdead 4000010b gp = MEM_U32(sp + 24); +//nop; +at = 0x10000144; +MEM_U32(at + 0) = v0; +goto L42f5a8; +MEM_U32(at + 0) = v0; +L42f398: +a0 = 0x1000014c; +a1 = 0x10005f24; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f3b4; +a1 = a1; +L42f3b4: +// bdead 4000010b gp = MEM_U32(sp + 24); +//nop; +at = 0x1000014c; +MEM_U32(at + 0) = v0; +goto L42f5a8; +MEM_U32(at + 0) = v0; +L42f3c8: +a0 = 0x10000150; +a1 = 0x10005f28; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f3e4; +a1 = a1; +L42f3e4: +// bdead 4000010b gp = MEM_U32(sp + 24); +//nop; +at = 0x10000150; +MEM_U32(at + 0) = v0; +goto L42f5a8; +MEM_U32(at + 0) = v0; +L42f3f8: +a0 = 0x10000154; +a1 = 0x10005f2c; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f414; +a1 = a1; +L42f414: +// bdead 4000010b gp = MEM_U32(sp + 24); +//nop; +at = 0x10000154; +MEM_U32(at + 0) = v0; +goto L42f5a8; +MEM_U32(at + 0) = v0; +L42f428: +a0 = 0x1000012c; +a1 = 0x10005f30; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f444; +a1 = a1; +L42f444: +// bdead 4000010b gp = MEM_U32(sp + 24); +//nop; +at = 0x1000012c; +MEM_U32(at + 0) = v0; +goto L42f5a8; +MEM_U32(at + 0) = v0; +L42f458: +a0 = 0x10000134; +a1 = 0x10005f34; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f474; +a1 = a1; +L42f474: +// bdead 4000010b gp = MEM_U32(sp + 24); +//nop; +at = 0x10000134; +MEM_U32(at + 0) = v0; +goto L42f5a8; +MEM_U32(at + 0) = v0; +L42f488: +a0 = 0x10000138; +a1 = 0x10005f38; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f4a4; +a1 = a1; +L42f4a4: +// bdead 4000010b gp = MEM_U32(sp + 24); +//nop; +at = 0x10000138; +MEM_U32(at + 0) = v0; +goto L42f5a8; +MEM_U32(at + 0) = v0; +L42f4b8: +a0 = 0x1000013c; +a1 = 0x10005f3c; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f4d4; +a1 = a1; +L42f4d4: +// bdead 4000010b gp = MEM_U32(sp + 24); +//nop; +at = 0x1000013c; +MEM_U32(at + 0) = v0; +goto L42f5a8; +MEM_U32(at + 0) = v0; +L42f4e8: +a0 = 0x10000140; +a1 = 0x10005f40; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f504; +a1 = a1; +L42f504: +// bdead 4000010b gp = MEM_U32(sp + 24); +//nop; +at = 0x10000140; +MEM_U32(at + 0) = v0; +goto L42f5a8; +MEM_U32(at + 0) = v0; +L42f518: +a0 = 0x10000148; +a1 = 0x10005f44; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f534; +a1 = a1; +L42f534: +// bdead 4000010b gp = MEM_U32(sp + 24); +//nop; +at = 0x10000148; +MEM_U32(at + 0) = v0; +goto L42f5a8; +MEM_U32(at + 0) = v0; +L42f548: +a0 = 0x1000015c; +a1 = 0x10005f48; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f564; +a1 = a1; +L42f564: +// bdead 4000010b gp = MEM_U32(sp + 24); +//nop; +at = 0x1000015c; +MEM_U32(at + 0) = v0; +goto L42f5a8; +MEM_U32(at + 0) = v0; +L42f578: +a0 = 0x10000158; +a1 = 0x10005f4c; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L42f594; +a1 = a1; +L42f594: +// bdead 4000010b gp = MEM_U32(sp + 24); +//nop; +at = 0x10000158; +//nop; +MEM_U32(at + 0) = v0; +L42f5a8: +t1 = MEM_U32(sp + 32); +//nop; +t2 = t1 + 0x1; +MEM_U32(sp + 32) = t2; +t3 = MEM_U8(t2 + 0); +//nop; +if (t3 != 0) {//nop; +goto L42f2fc;} +//nop; +L42f5c8: +// bdead 1 ra = MEM_U32(sp + 28); +// bdead 1 sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t f_mkstr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L42f8b4: +//mkstr: +//nop; +//nop; +//nop; +sp = sp + 0xffffff88; +t6 = sp + 0x78; +t7 = t6 + 0xffffffff; +t8 = t7 + 0x3; +at = 0xfffffffc; +t9 = t8 & at; +MEM_U32(sp + 72) = t7; +t0 = t9 + 0x4; +// fdead 460183ef MEM_U32(sp + 60) = ra; +// fdead 460183ef MEM_U32(sp + 56) = gp; +MEM_U32(sp + 120) = a0; +MEM_U32(sp + 124) = a1; +MEM_U32(sp + 128) = a2; +MEM_U32(sp + 132) = a3; +MEM_U32(sp + 96) = f12.w[1]; +MEM_U32(sp + 100) = f12.w[0]; +MEM_U32(sp + 88) = f14.w[1]; +MEM_U32(sp + 92) = f14.w[0]; +// fdead 460183ef MEM_U32(sp + 52) = s3; +// fdead 460183ef MEM_U32(sp + 48) = s2; +// fdead 460183ef MEM_U32(sp + 44) = s1; +// fdead 460183ef MEM_U32(sp + 40) = s0; +MEM_U32(sp + 72) = t0; +s1 = MEM_U32(t9 + 0); +s2 = 0x1; +if (s1 == 0) {//nop; +goto L42f968;} +//nop; +L42f92c: +//nop; +a0 = s1; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L42f93c; +//nop; +L42f93c: +t1 = MEM_U32(sp + 72); +at = 0xfffffffc; +t2 = t1 + 0x3; +t3 = t2 & at; +t4 = t3 + 0x4; +MEM_U32(sp + 72) = t4; +s1 = MEM_U32(t3 + 0); +// bdead 400c000b gp = MEM_U32(sp + 56); +s3 = v0; +if (s1 != 0) {s2 = s2 + s3; +goto L42f92c;} +s2 = s2 + s3; +L42f968: +//nop; +a0 = s2; +//nop; +v0 = wrapper_malloc(mem, a0); +goto L42f978; +//nop; +L42f978: +// bdead 4000000b gp = MEM_U32(sp + 56); +s0 = v0; +if (s0 != 0) {//nop; +goto L42fa3c;} +//nop; +t6 = 0x10005ff0; +a3 = 0x10005fe4; +//nop; +t5 = 0x3717; +t6 = t6; +MEM_U32(sp + 20) = t6; +MEM_U32(sp + 16) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = a3; +f_error(mem, sp, a0, a1, a2, a3); +goto L42f9b8; +a3 = a3; +L42f9b8: +// bdead 40020003 gp = MEM_U32(sp + 56); +//nop; +t7 = 0xfb52720; +t8 = 0xfb50300; +t7 = MEM_U32(t7 + 0); +t8 = MEM_U32(t8 + 0); +//nop; +at = (int)t7 < (int)t8; +if (at == 0) {//nop; +goto L42fa24;} +//nop; +t0 = 0x10006000; +t1 = 0xfb500a0; +t9 = t7 << 2; +t0 = t0; +t2 = t9 + t1; +MEM_U32(sp + 20) = t0; +MEM_U32(sp + 16) = zero; +t4 = MEM_U32(t2 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t4; +f_error(mem, sp, a0, a1, a2, a3); +goto L42fa1c; +MEM_U32(sp + 24) = t4; +L42fa1c: +// bdead 40020003 gp = MEM_U32(sp + 56); +//nop; +L42fa24: +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L42fa34; +//nop; +L42fa34: +// bdead 40020003 gp = MEM_U32(sp + 56); +//nop; +L42fa3c: +t3 = sp + 0x78; +t5 = t3 + 0xffffffff; +t6 = t5 + 0x3; +at = 0xfffffffc; +MEM_U8(s0 + 0) = (uint8_t)zero; +t8 = t6 & at; +MEM_U32(sp + 72) = t5; +t0 = t8 + 0x4; +MEM_U32(sp + 72) = t0; +s1 = MEM_U32(t8 + 0); +//nop; +if (s1 == 0) {//nop; +goto L42faa8;} +//nop; +L42fa70: +//nop; +a0 = s0; +a1 = s1; +v0 = wrapper_strcat(mem, a0, a1); +goto L42fa80; +a1 = s1; +L42fa80: +t7 = MEM_U32(sp + 72); +at = 0xfffffffc; +t9 = t7 + 0x3; +t1 = t9 & at; +t2 = t1 + 0x4; +MEM_U32(sp + 72) = t2; +s1 = MEM_U32(t1 + 0); +// bdead 40060001 gp = MEM_U32(sp + 56); +if (s1 != 0) {//nop; +goto L42fa70;} +//nop; +L42faa8: +// bdead 20001 ra = MEM_U32(sp + 60); +v0 = s0; +// bdead 9 s0 = MEM_U32(sp + 40); +// bdead 9 s1 = MEM_U32(sp + 44); +// bdead 9 s2 = MEM_U32(sp + 48); +// bdead 9 s3 = MEM_U32(sp + 52); +// bdead 9 sp = sp + 0x78; +return v0; +// bdead 9 sp = sp + 0x78; +} + +static void f_mklist(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42fac8: +//mklist: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +//nop; +// fdead 4000006b MEM_U32(sp + 44) = ra; +MEM_U32(sp + 56) = a0; +// fdead 4000006b MEM_U32(sp + 40) = gp; +// fdead 4000006b MEM_U32(sp + 36) = s0; +a0 = 0x50; +v0 = wrapper_malloc(mem, a0); +goto L42faf4; +a0 = 0x50; +L42faf4: +t6 = MEM_U32(sp + 56); +// bdead 4000800b gp = MEM_U32(sp + 40); +s0 = v0; +if (s0 != 0) {MEM_U32(t6 + 8) = s0; +goto L42fbbc;} +MEM_U32(t6 + 8) = s0; +t8 = 0x10006010; +a3 = 0x10006004; +//nop; +t7 = 0x373c; +t8 = t8; +MEM_U32(sp + 20) = t8; +MEM_U32(sp + 16) = t7; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = a3; +f_error(mem, sp, a0, a1, a2, a3); +goto L42fb38; +a3 = a3; +L42fb38: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +t9 = 0xfb52720; +t0 = 0xfb50300; +t9 = MEM_U32(t9 + 0); +t0 = MEM_U32(t0 + 0); +//nop; +at = (int)t9 < (int)t0; +if (at == 0) {//nop; +goto L42fba4;} +//nop; +t1 = 0x10006020; +t3 = 0xfb500a0; +t2 = t9 << 2; +t1 = t1; +MEM_U32(sp + 20) = t1; +MEM_U32(sp + 16) = zero; +t4 = t2 + t3; +t5 = MEM_U32(t4 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t5; +f_error(mem, sp, a0, a1, a2, a3); +goto L42fb9c; +MEM_U32(sp + 24) = t5; +L42fb9c: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L42fba4: +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L42fbb4; +//nop; +L42fbb4: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L42fbbc: +t7 = MEM_U32(sp + 56); +t6 = 0x14; +MEM_U32(t7 + 0) = t6; +t8 = MEM_U32(sp + 56); +//nop; +MEM_U32(t8 + 4) = zero; +t0 = MEM_U32(sp + 56); +//nop; +t1 = MEM_U32(t0 + 8); +//nop; +MEM_U32(t1 + 0) = zero; +// bdead 1 ra = MEM_U32(sp + 44); +// bdead 1 s0 = MEM_U32(sp + 36); +// bdead 1 sp = sp + 0x38; +return; +// bdead 1 sp = sp + 0x38; +} + +static void f_addstr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42fbf8: +//addstr: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 56) = a0; +t6 = MEM_U32(sp + 56); +// fdead 400080eb MEM_U32(sp + 44) = ra; +// fdead 400080eb MEM_U32(sp + 40) = gp; +MEM_U32(sp + 60) = a1; +// fdead 400080eb MEM_U32(sp + 36) = s0; +t8 = MEM_U32(t6 + 4); +t7 = MEM_U32(t6 + 0); +t9 = t8 + 0x1; +at = (int)t9 < (int)t7; +if (at != 0) {//nop; +goto L42fd2c;} +//nop; +//nop; +a0 = MEM_U32(t6 + 8); +a1 = t7 << 2; +a1 = a1 + 0x50; +v0 = wrapper_realloc(mem, a0, a1); +goto L42fc4c; +a1 = a1 + 0x50; +L42fc4c: +t0 = MEM_U32(sp + 56); +// bdead 4000020b gp = MEM_U32(sp + 40); +s0 = v0; +if (s0 != 0) {MEM_U32(t0 + 8) = s0; +goto L42fd14;} +MEM_U32(t0 + 8) = s0; +t2 = 0x10006030; +a3 = 0x10006024; +//nop; +t1 = 0x375e; +t2 = t2; +MEM_U32(sp + 20) = t2; +MEM_U32(sp + 16) = t1; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = a3; +f_error(mem, sp, a0, a1, a2, a3); +goto L42fc90; +a3 = a3; +L42fc90: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +t3 = 0xfb52720; +t4 = 0xfb50300; +t3 = MEM_U32(t3 + 0); +t4 = MEM_U32(t4 + 0); +//nop; +at = (int)t3 < (int)t4; +if (at == 0) {//nop; +goto L42fcfc;} +//nop; +t5 = 0x10006040; +t9 = 0xfb500a0; +t8 = t3 << 2; +t5 = t5; +t6 = t8 + t9; +MEM_U32(sp + 20) = t5; +MEM_U32(sp + 16) = zero; +t7 = MEM_U32(t6 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t7; +f_error(mem, sp, a0, a1, a2, a3); +goto L42fcf4; +MEM_U32(sp + 24) = t7; +L42fcf4: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L42fcfc: +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L42fd0c; +//nop; +L42fd0c: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L42fd14: +t0 = MEM_U32(sp + 56); +//nop; +t1 = MEM_U32(t0 + 0); +//nop; +t2 = t1 + 0x14; +MEM_U32(t0 + 0) = t2; +L42fd2c: +t5 = MEM_U32(sp + 56); +t4 = MEM_U32(sp + 60); +t8 = MEM_U32(t5 + 4); +t3 = MEM_U32(t5 + 8); +t9 = t8 << 2; +t6 = t3 + t9; +MEM_U32(t6 + 0) = t4; +t7 = MEM_U32(sp + 56); +//nop; +t1 = MEM_U32(t7 + 4); +//nop; +t2 = t1 + 0x1; +MEM_U32(t7 + 4) = t2; +t0 = MEM_U32(sp + 56); +//nop; +t8 = MEM_U32(t0 + 4); +t5 = MEM_U32(t0 + 8); +t3 = t8 << 2; +t9 = t5 + t3; +MEM_U32(t9 + 0) = zero; +// bdead 1 ra = MEM_U32(sp + 44); +// bdead 1 s0 = MEM_U32(sp + 36); +// bdead 1 sp = sp + 0x38; +return; +// bdead 1 sp = sp + 0x38; +} + +static void f_addspacedstr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42fd8c: +//addspacedstr: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 60) = a1; +t6 = MEM_U32(sp + 60); +// fdead 4000806b MEM_U32(sp + 44) = ra; +// fdead 4000806b MEM_U32(sp + 40) = gp; +MEM_U32(sp + 56) = a0; +// fdead 4000806b MEM_U32(sp + 36) = s0; +MEM_U32(sp + 52) = t6; +L42fdb8: +//nop; +a0 = MEM_U32(sp + 52); +a1 = 0x20; +v0 = wrapper_strchr(mem, a0, a1); +goto L42fdc8; +a1 = 0x20; +L42fdc8: +MEM_U32(sp + 52) = v0; +t7 = MEM_U32(sp + 52); +// bdead 40010003 gp = MEM_U32(sp + 40); +if (t7 == 0) {//nop; +goto L42fdf0;} +//nop; +MEM_U8(t7 + 0) = (uint8_t)zero; +t8 = MEM_U32(sp + 52); +//nop; +t9 = t8 + 0x1; +MEM_U32(sp + 52) = t9; +L42fdf0: +t0 = MEM_U32(sp + 56); +//nop; +t2 = MEM_U32(t0 + 4); +t1 = MEM_U32(t0 + 0); +t3 = t2 + 0x1; +at = (int)t3 < (int)t1; +if (at != 0) {//nop; +goto L42ff04;} +//nop; +//nop; +a0 = MEM_U32(t0 + 8); +a1 = t1 << 2; +a1 = a1 + 0x50; +v0 = wrapper_realloc(mem, a0, a1); +goto L42fe24; +a1 = a1 + 0x50; +L42fe24: +t4 = MEM_U32(sp + 56); +// bdead 4000200b gp = MEM_U32(sp + 40); +s0 = v0; +if (s0 != 0) {MEM_U32(t4 + 8) = s0; +goto L42feec;} +MEM_U32(t4 + 8) = s0; +t6 = 0x10006054; +a3 = 0x10006044; +//nop; +t5 = 0x378a; +t6 = t6; +MEM_U32(sp + 20) = t6; +MEM_U32(sp + 16) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = a3; +f_error(mem, sp, a0, a1, a2, a3); +goto L42fe68; +a3 = a3; +L42fe68: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +t7 = 0xfb52720; +t8 = 0xfb50300; +t7 = MEM_U32(t7 + 0); +t8 = MEM_U32(t8 + 0); +//nop; +at = (int)t7 < (int)t8; +if (at == 0) {//nop; +goto L42fed4;} +//nop; +t9 = 0x10006064; +t3 = 0xfb500a0; +t9 = t9; +MEM_U32(sp + 20) = t9; +t2 = t7 << 2; +MEM_U32(sp + 16) = zero; +t0 = t2 + t3; +t1 = MEM_U32(t0 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t1; +f_error(mem, sp, a0, a1, a2, a3); +goto L42fecc; +MEM_U32(sp + 24) = t1; +L42fecc: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L42fed4: +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L42fee4; +//nop; +L42fee4: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L42feec: +t4 = MEM_U32(sp + 56); +//nop; +t5 = MEM_U32(t4 + 0); +//nop; +t6 = t5 + 0x14; +MEM_U32(t4 + 0) = t6; +L42ff04: +t9 = MEM_U32(sp + 56); +t8 = MEM_U32(sp + 60); +t2 = MEM_U32(t9 + 4); +t7 = MEM_U32(t9 + 8); +t3 = t2 << 2; +t0 = t7 + t3; +MEM_U32(t0 + 0) = t8; +t1 = MEM_U32(sp + 56); +//nop; +t5 = MEM_U32(t1 + 4); +//nop; +t6 = t5 + 0x1; +MEM_U32(t1 + 4) = t6; +t4 = MEM_U32(sp + 56); +//nop; +t2 = MEM_U32(t4 + 4); +t9 = MEM_U32(t4 + 8); +t7 = t2 << 2; +t3 = t9 + t7; +MEM_U32(t3 + 0) = zero; +t8 = MEM_U32(sp + 52); +//nop; +if (t8 != 0) {MEM_U32(sp + 60) = t8; +goto L42fdb8;} +MEM_U32(sp + 60) = t8; +// bdead 1 ra = MEM_U32(sp + 44); +// bdead 1 s0 = MEM_U32(sp + 36); +// bdead 1 sp = sp + 0x38; +return; +// bdead 1 sp = sp + 0x38; +} + +static uint32_t f_newstr(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42ff74: +//newstr: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 40) = a0; +// fdead 4000002b MEM_U32(sp + 28) = ra; +a0 = MEM_U32(sp + 40); +// fdead 4000002b MEM_U32(sp + 24) = gp; +// fdead 4000002b MEM_U32(sp + 20) = s0; +v0 = wrapper_strlen(mem, a0); +goto L42ffa0; +// fdead 4000002b MEM_U32(sp + 20) = s0; +L42ffa0: +// bdead 40000009 gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0 + 0x1; +//nop; +v0 = wrapper_malloc(mem, a0); +goto L42ffb8; +//nop; +L42ffb8: +MEM_U32(sp + 36) = v0; +t6 = MEM_U32(sp + 36); +// bdead 40008181 gp = MEM_U32(sp + 24); +if (t6 == 0) {//nop; +goto L42ffe8;} +//nop; +//nop; +a1 = MEM_U32(sp + 40); +a0 = t6; +v0 = wrapper_strcpy(mem, a0, a1); +goto L42ffdc; +a0 = t6; +L42ffdc: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +goto L430004; +//nop; +L42ffe8: +a0 = 0x10006068; +//nop; +a1 = MEM_U32(sp + 40); +a0 = a0; +f_error(mem, sp, a0, a1, a2, a3); +goto L42fffc; +a0 = a0; +L42fffc: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L430004: +// bdead 40000001 ra = MEM_U32(sp + 28); +v0 = MEM_U32(sp + 36); +// bdead 9 s0 = MEM_U32(sp + 20); +// bdead 9 sp = sp + 0x28; +return v0; +// bdead 9 sp = sp + 0x28; +} + +static uint32_t f_save_place(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L430018: +//save_place: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 56) = a0; +t6 = MEM_U32(sp + 56); +// fdead 4000802b MEM_U32(sp + 44) = ra; +// fdead 4000802b MEM_U32(sp + 40) = gp; +// fdead 4000802b MEM_U32(sp + 36) = s0; +t8 = MEM_U32(t6 + 4); +t7 = MEM_U32(t6 + 0); +t9 = t8 + 0x1; +at = (int)t9 < (int)t7; +if (at != 0) {//nop; +goto L430148;} +//nop; +//nop; +a0 = MEM_U32(t6 + 8); +a1 = t7 << 2; +a1 = a1 + 0x50; +v0 = wrapper_realloc(mem, a0, a1); +goto L430068; +a1 = a1 + 0x50; +L430068: +t0 = MEM_U32(sp + 56); +// bdead 4000020b gp = MEM_U32(sp + 40); +s0 = v0; +if (s0 != 0) {MEM_U32(t0 + 8) = s0; +goto L430130;} +MEM_U32(t0 + 8) = s0; +t2 = 0x100060a0; +a3 = 0x10006090; +//nop; +t1 = 0x37bf; +t2 = t2; +MEM_U32(sp + 20) = t2; +MEM_U32(sp + 16) = t1; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = a3; +f_error(mem, sp, a0, a1, a2, a3); +goto L4300ac; +a3 = a3; +L4300ac: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +t3 = 0xfb52720; +t4 = 0xfb50300; +t3 = MEM_U32(t3 + 0); +t4 = MEM_U32(t4 + 0); +//nop; +at = (int)t3 < (int)t4; +if (at == 0) {//nop; +goto L430118;} +//nop; +t5 = 0x100060b0; +t9 = 0xfb500a0; +t8 = t3 << 2; +t5 = t5; +t6 = t8 + t9; +MEM_U32(sp + 20) = t5; +MEM_U32(sp + 16) = zero; +t7 = MEM_U32(t6 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t7; +f_error(mem, sp, a0, a1, a2, a3); +goto L430110; +MEM_U32(sp + 24) = t7; +L430110: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L430118: +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L430128; +//nop; +L430128: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L430130: +t0 = MEM_U32(sp + 56); +//nop; +t1 = MEM_U32(t0 + 0); +//nop; +t2 = t1 + 0x14; +MEM_U32(t0 + 0) = t2; +L430148: +t4 = MEM_U32(sp + 56); +//nop; +t5 = MEM_U32(t4 + 4); +//nop; +MEM_U32(sp + 52) = t5; +t3 = MEM_U32(t4 + 4); +//nop; +t8 = t3 + 0x1; +MEM_U32(t4 + 4) = t8; +t9 = MEM_U32(sp + 56); +//nop; +t7 = MEM_U32(t9 + 4); +t6 = MEM_U32(t9 + 8); +t1 = t7 << 2; +t2 = t6 + t1; +MEM_U32(t2 + 0) = zero; +// bdead 40000001 ra = MEM_U32(sp + 44); +// bdead 40000001 s0 = MEM_U32(sp + 36); +v0 = MEM_U32(sp + 52); +// bdead 9 sp = sp + 0x38; +return v0; +// bdead 9 sp = sp + 0x38; +} + +static void f_set_place(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L43019c: +//set_place: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 48) = a2; +t6 = MEM_U32(sp + 48); +// fdead 400080eb MEM_U32(sp + 36) = ra; +// fdead 400080eb MEM_U32(sp + 32) = gp; +MEM_U32(sp + 40) = a0; +if ((int)t6 < 0) {MEM_U32(sp + 44) = a1; +goto L4301e4;} +MEM_U32(sp + 44) = a1; +t7 = MEM_U32(sp + 40); +//nop; +t8 = MEM_U32(t7 + 4); +//nop; +at = (int)t6 < (int)t8; +if (at != 0) {//nop; +goto L430234;} +//nop; +L4301e4: +t9 = 0x37de; +t0 = 0x100060c4; +MEM_U32(sp + 16) = t9; +//nop; +a3 = 0x100060b4; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = zero; +a1 = zero; +a2 = zero; +a3 = a3; +f_error(mem, sp, a0, a1, a2, a3); +goto L430214; +a3 = a3; +L430214: +// bdead 40000001 gp = MEM_U32(sp + 32); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L43022c; +//nop; +L43022c: +// bdead 40000001 gp = MEM_U32(sp + 32); +//nop; +L430234: +t2 = MEM_U32(sp + 40); +t4 = MEM_U32(sp + 48); +t3 = MEM_U32(t2 + 8); +t1 = MEM_U32(sp + 44); +t5 = t4 << 2; +t7 = t3 + t5; +MEM_U32(t7 + 0) = t1; +// bdead 1 ra = MEM_U32(sp + 36); +// bdead 1 sp = sp + 0x28; +//nop; +return; +//nop; +} + +static void f_addlist(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L430260: +//addlist: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +t9 = MEM_U32(sp + 60); +t6 = MEM_U32(sp + 56); +// fdead 4400806b MEM_U32(sp + 44) = ra; +// fdead 4400806b MEM_U32(sp + 40) = gp; +// fdead 4400806b MEM_U32(sp + 36) = s0; +t0 = MEM_U32(t9 + 4); +t8 = MEM_U32(t6 + 4); +t7 = MEM_U32(t6 + 0); +t1 = t8 + t0; +t2 = t1 + 0x1; +at = (int)t2 < (int)t7; +if (at != 0) {//nop; +goto L4303b4;} +//nop; +t3 = MEM_U32(t9 + 0); +//nop; +a1 = t7 + t3; +t4 = a1 << 2; +a1 = t4; +a0 = MEM_U32(t6 + 8); +a1 = a1 + 0x50; +v0 = wrapper_realloc(mem, a0, a1); +goto L4302cc; +a1 = a1 + 0x50; +L4302cc: +t5 = MEM_U32(sp + 56); +// bdead 4000400b gp = MEM_U32(sp + 40); +s0 = v0; +if (s0 != 0) {MEM_U32(t5 + 8) = s0; +goto L430394;} +MEM_U32(t5 + 8) = s0; +t0 = 0x100060e4; +a3 = 0x100060d8; +//nop; +t8 = 0x37fc; +t0 = t0; +MEM_U32(sp + 20) = t0; +MEM_U32(sp + 16) = t8; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = a3; +f_error(mem, sp, a0, a1, a2, a3); +goto L430310; +a3 = a3; +L430310: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +t1 = 0xfb52720; +t2 = 0xfb50300; +t1 = MEM_U32(t1 + 0); +t2 = MEM_U32(t2 + 0); +//nop; +at = (int)t1 < (int)t2; +if (at == 0) {//nop; +goto L43037c;} +//nop; +t6 = 0x100060f4; +t7 = 0xfb500a0; +t9 = t1 << 2; +t6 = t6; +t3 = t9 + t7; +MEM_U32(sp + 20) = t6; +MEM_U32(sp + 16) = zero; +t4 = MEM_U32(t3 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t4; +f_error(mem, sp, a0, a1, a2, a3); +goto L430374; +MEM_U32(sp + 24) = t4; +L430374: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L43037c: +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L43038c; +//nop; +L43038c: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L430394: +t5 = MEM_U32(sp + 56); +t0 = MEM_U32(sp + 60); +t8 = MEM_U32(t5 + 0); +t2 = MEM_U32(t0 + 0); +//nop; +t6 = t8 + t2; +t1 = t6 + 0x14; +MEM_U32(t5 + 0) = t1; +L4303b4: +t9 = MEM_U32(sp + 60); +MEM_U32(sp + 52) = zero; +t7 = MEM_U32(t9 + 4); +//nop; +if ((int)t7 <= 0) {//nop; +goto L430448;} +//nop; +L4303cc: +t3 = MEM_U32(sp + 60); +t0 = MEM_U32(sp + 52); +t4 = MEM_U32(t3 + 8); +t8 = t0 << 2; +t2 = t4 + t8; +t6 = MEM_U32(t2 + 0); +//nop; +if (t6 == 0) {//nop; +goto L430424;} +//nop; +t1 = MEM_U32(sp + 56); +//nop; +t9 = MEM_U32(t1 + 4); +t5 = MEM_U32(t1 + 8); +t7 = t9 << 2; +t3 = t5 + t7; +MEM_U32(t3 + 0) = t6; +t0 = MEM_U32(sp + 56); +//nop; +t4 = MEM_U32(t0 + 4); +//nop; +t8 = t4 + 0x1; +MEM_U32(t0 + 4) = t8; +L430424: +t2 = MEM_U32(sp + 52); +t9 = MEM_U32(sp + 60); +t1 = t2 + 0x1; +MEM_U32(sp + 52) = t1; +t5 = MEM_U32(t9 + 4); +//nop; +at = (int)t1 < (int)t5; +if (at != 0) {//nop; +goto L4303cc;} +//nop; +L430448: +t7 = MEM_U32(sp + 56); +//nop; +t3 = MEM_U32(t7 + 4); +t6 = MEM_U32(t7 + 8); +t4 = t3 << 2; +t8 = t6 + t4; +MEM_U32(t8 + 0) = zero; +// bdead 1 ra = MEM_U32(sp + 44); +// bdead 1 s0 = MEM_U32(sp + 36); +// bdead 1 sp = sp + 0x38; +return; +// bdead 1 sp = sp + 0x38; +} + +static void f_adduldlist(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L430474: +//adduldlist: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +t9 = MEM_U32(sp + 68); +t6 = MEM_U32(sp + 64); +// fdead 440080eb MEM_U32(sp + 44) = ra; +// fdead 440080eb MEM_U32(sp + 40) = gp; +// fdead 440080eb MEM_U32(sp + 36) = s0; +t2 = MEM_U32(sp + 72); +t0 = MEM_U32(t9 + 4); +t8 = MEM_U32(t6 + 4); +t3 = MEM_U32(t2 + 4); +t1 = t8 + t0; +t7 = MEM_U32(t6 + 0); +t4 = t1 + t3; +t5 = t4 + 0x1; +at = (int)t5 < (int)t7; +if (at != 0) {//nop; +goto L4305e8;} +//nop; +t8 = MEM_U32(t9 + 0); +t1 = MEM_U32(t2 + 0); +t0 = t7 + t8; +a1 = t0 + t1; +//nop; +t3 = a1 << 2; +a1 = t3; +a0 = MEM_U32(t6 + 8); +a1 = a1 + 0x50; +v0 = wrapper_realloc(mem, a0, a1); +goto L4304f8; +a1 = a1 + 0x50; +L4304f8: +t4 = MEM_U32(sp + 64); +// bdead 4000200b gp = MEM_U32(sp + 40); +s0 = v0; +if (s0 != 0) {MEM_U32(t4 + 8) = s0; +goto L4305c0;} +MEM_U32(t4 + 8) = s0; +t6 = 0x10006104; +a3 = 0x100060f8; +//nop; +t5 = 0x3823; +t6 = t6; +MEM_U32(sp + 20) = t6; +MEM_U32(sp + 16) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = a3; +f_error(mem, sp, a0, a1, a2, a3); +goto L43053c; +a3 = a3; +L43053c: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +t9 = 0xfb52720; +t7 = 0xfb50300; +t9 = MEM_U32(t9 + 0); +t7 = MEM_U32(t7 + 0); +//nop; +at = (int)t9 < (int)t7; +if (at == 0) {//nop; +goto L4305a8;} +//nop; +t8 = 0x10006114; +t0 = 0xfb500a0; +t2 = t9 << 2; +t8 = t8; +MEM_U32(sp + 20) = t8; +MEM_U32(sp + 16) = zero; +t1 = t2 + t0; +t3 = MEM_U32(t1 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L4305a0; +MEM_U32(sp + 24) = t3; +L4305a0: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L4305a8: +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L4305b8; +//nop; +L4305b8: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L4305c0: +t4 = MEM_U32(sp + 68); +t6 = MEM_U32(sp + 72); +t9 = MEM_U32(sp + 64); +t5 = MEM_U32(t4 + 0); +t7 = MEM_U32(t6 + 0); +t2 = MEM_U32(t9 + 0); +t8 = t5 + t7; +t0 = t2 + t8; +t1 = t0 + 0x14; +MEM_U32(t9 + 0) = t1; +L4305e8: +t3 = MEM_U32(sp + 72); +MEM_U32(sp + 60) = zero; +t4 = MEM_U32(t3 + 4); +//nop; +if ((int)t4 <= 0) {//nop; +goto L4306a0;} +//nop; +t6 = MEM_U32(t3 + 8); +//nop; +t5 = MEM_U32(t6 + 0); +//nop; +if (t5 == 0) {//nop; +goto L4306a0;} +//nop; +L430618: +t7 = MEM_U32(sp + 72); +t8 = MEM_U32(sp + 60); +t4 = MEM_U32(sp + 64); +t2 = MEM_U32(t7 + 8); +t6 = MEM_U32(t4 + 4); +t0 = t8 << 2; +t3 = MEM_U32(t4 + 8); +t1 = t2 + t0; +t9 = MEM_U32(t1 + 0); +t5 = t6 << 2; +t7 = t3 + t5; +MEM_U32(t7 + 0) = t9; +t8 = MEM_U32(sp + 64); +//nop; +t2 = MEM_U32(t8 + 4); +//nop; +t0 = t2 + 0x1; +MEM_U32(t8 + 4) = t0; +t1 = MEM_U32(sp + 60); +t6 = MEM_U32(sp + 72); +t4 = t1 + 0x1; +MEM_U32(sp + 60) = t4; +t3 = MEM_U32(t6 + 4); +//nop; +at = (int)t4 < (int)t3; +if (at == 0) {//nop; +goto L4306a0;} +//nop; +t5 = MEM_U32(t6 + 8); +t9 = t4 << 2; +t7 = t5 + t9; +t2 = MEM_U32(t7 + 0); +//nop; +if (t2 != 0) {//nop; +goto L430618;} +//nop; +L4306a0: +t0 = MEM_U32(sp + 68); +MEM_U32(sp + 56) = zero; +t8 = MEM_U32(t0 + 4); +//nop; +if ((int)t8 <= 0) {//nop; +goto L430734;} +//nop; +L4306b8: +t1 = MEM_U32(sp + 68); +t6 = MEM_U32(sp + 56); +t3 = MEM_U32(t1 + 8); +t4 = t6 << 2; +t5 = t3 + t4; +t9 = MEM_U32(t5 + 0); +//nop; +if (t9 == 0) {//nop; +goto L430710;} +//nop; +t7 = MEM_U32(sp + 64); +//nop; +t0 = MEM_U32(t7 + 4); +t2 = MEM_U32(t7 + 8); +t8 = t0 << 2; +t1 = t2 + t8; +MEM_U32(t1 + 0) = t9; +t6 = MEM_U32(sp + 64); +//nop; +t3 = MEM_U32(t6 + 4); +//nop; +t4 = t3 + 0x1; +MEM_U32(t6 + 4) = t4; +L430710: +t5 = MEM_U32(sp + 56); +t0 = MEM_U32(sp + 68); +t7 = t5 + 0x1; +MEM_U32(sp + 56) = t7; +t2 = MEM_U32(t0 + 4); +//nop; +at = (int)t7 < (int)t2; +if (at != 0) {//nop; +goto L4306b8;} +//nop; +L430734: +t9 = MEM_U32(sp + 72); +t8 = MEM_U32(sp + 60); +t1 = MEM_U32(t9 + 4); +//nop; +at = (int)t8 < (int)t1; +if (at == 0) {//nop; +goto L4307cc;} +//nop; +L430750: +t3 = MEM_U32(sp + 72); +t6 = MEM_U32(sp + 60); +t4 = MEM_U32(t3 + 8); +t5 = t6 << 2; +t0 = t4 + t5; +t7 = MEM_U32(t0 + 0); +//nop; +if (t7 == 0) {//nop; +goto L4307a8;} +//nop; +t2 = MEM_U32(sp + 64); +//nop; +t8 = MEM_U32(t2 + 4); +t9 = MEM_U32(t2 + 8); +t1 = t8 << 2; +t3 = t9 + t1; +MEM_U32(t3 + 0) = t7; +t6 = MEM_U32(sp + 64); +//nop; +t4 = MEM_U32(t6 + 4); +//nop; +t5 = t4 + 0x1; +MEM_U32(t6 + 4) = t5; +L4307a8: +t0 = MEM_U32(sp + 60); +t8 = MEM_U32(sp + 72); +t2 = t0 + 0x1; +MEM_U32(sp + 60) = t2; +t9 = MEM_U32(t8 + 4); +//nop; +at = (int)t2 < (int)t9; +if (at != 0) {//nop; +goto L430750;} +//nop; +L4307cc: +t1 = MEM_U32(sp + 64); +//nop; +t3 = MEM_U32(t1 + 4); +t7 = MEM_U32(t1 + 8); +t4 = t3 << 2; +t5 = t7 + t4; +MEM_U32(t5 + 0) = zero; +// bdead 1 ra = MEM_U32(sp + 44); +// bdead 1 s0 = MEM_U32(sp + 36); +// bdead 1 sp = sp + 0x40; +return; +// bdead 1 sp = sp + 0x40; +} + +static uint32_t f_nodup(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4307f8: +//nodup: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 48) = a0; +t6 = MEM_U32(sp + 48); +// fdead 4000806b MEM_U32(sp + 36) = ra; +// fdead 4000806b MEM_U32(sp + 32) = gp; +MEM_U32(sp + 52) = a1; +// fdead 4000806b MEM_U32(sp + 28) = s1; +// fdead 4000806b MEM_U32(sp + 24) = s0; +t7 = MEM_U32(t6 + 4); +s0 = zero; +at = (int)s0 < (int)t7; +if (at == 0) {//nop; +goto L43089c;} +//nop; +L430838: +t8 = MEM_U32(sp + 48); +t0 = s0 << 2; +t9 = MEM_U32(t8 + 8); +//nop; +t1 = t9 + t0; +s1 = MEM_U32(t1 + 0); +//nop; +if (s1 == 0) {//nop; +goto L430880;} +//nop; +//nop; +a1 = MEM_U32(sp + 52); +a0 = s1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L43086c; +a0 = s1; +L43086c: +// bdead 4002000b gp = MEM_U32(sp + 32); +if (v0 != 0) {//nop; +goto L430880;} +//nop; +v0 = zero; +goto L4308a0; +v0 = zero; +L430880: +t2 = MEM_U32(sp + 48); +s0 = s0 + 0x1; +t3 = MEM_U32(t2 + 4); +//nop; +at = (int)s0 < (int)t3; +if (at != 0) {//nop; +goto L430838;} +//nop; +L43089c: +v0 = 0x1; +L4308a0: +// bdead 9 ra = MEM_U32(sp + 36); +// bdead 9 s0 = MEM_U32(sp + 24); +// bdead 9 s1 = MEM_U32(sp + 28); +// bdead 9 sp = sp + 0x30; +return v0; +// bdead 9 sp = sp + 0x30; +} + +static uint32_t f_getsuf(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4308b4: +//getsuf: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 56) = a0; +t6 = MEM_U32(sp + 56); +// fdead 400081eb MEM_U32(sp + 28) = ra; +// fdead 400081eb MEM_U32(sp + 24) = gp; +// fdead 400081eb MEM_U32(sp + 20) = s0; +MEM_U32(sp + 52) = zero; +MEM_U32(sp + 40) = t6; +t7 = MEM_U8(t6 + 0); +t8 = t6 + 0x1; +s0 = t7; +MEM_U32(sp + 56) = t8; +if (s0 == 0) {MEM_U8(sp + 47) = (uint8_t)t7; +goto L430948;} +MEM_U8(sp + 47) = (uint8_t)t7; +L4308f8: +t9 = MEM_U8(sp + 47); +at = 0x2f; +if (t9 != at) {//nop; +goto L430918;} +//nop; +t0 = MEM_U32(sp + 56); +MEM_U32(sp + 52) = zero; +MEM_U32(sp + 40) = t0; +goto L430928; +MEM_U32(sp + 40) = t0; +L430918: +t1 = MEM_U32(sp + 52); +//nop; +t2 = t1 + 0x1; +MEM_U32(sp + 52) = t2; +L430928: +t3 = MEM_U32(sp + 56); +//nop; +t4 = MEM_U8(t3 + 0); +t5 = t3 + 0x1; +s0 = t4; +MEM_U32(sp + 56) = t5; +if (s0 != 0) {MEM_U8(sp + 47) = (uint8_t)t4; +goto L4308f8;} +MEM_U8(sp + 47) = (uint8_t)t4; +L430948: +t7 = MEM_U32(sp + 52); +//nop; +at = (int)t7 < (int)0x3; +if (at == 0) {//nop; +goto L430964;} +//nop; +v0 = zero; +goto L430afc; +v0 = zero; +L430964: +t6 = MEM_U32(sp + 56); +at = 0x2e; +t8 = MEM_U8(t6 + -3); +//nop; +if (t8 != at) {//nop; +goto L4309a8;} +//nop; +t9 = MEM_U8(t6 + -2); +at = 0x43; +if (t9 != at) {//nop; +goto L430994;} +//nop; +v0 = 0x6; +goto L430afc; +v0 = 0x6; +L430994: +t0 = MEM_U32(sp + 56); +//nop; +v0 = MEM_U8(t0 + -2); +//nop; +goto L430afc; +//nop; +L4309a8: +t1 = MEM_U32(sp + 52); +//nop; +t2 = t1 + 0xfffffffe; +if ((int)t2 <= 0) {MEM_U32(sp + 48) = t2; +goto L4309f0;} +MEM_U32(sp + 48) = t2; +L4309bc: +t4 = MEM_U32(sp + 40); +t3 = MEM_U32(sp + 48); +at = 0x2e; +t5 = t4 + t3; +t7 = MEM_U8(t5 + 0); +//nop; +if (t7 == at) {//nop; +goto L4309f0;} +//nop; +t8 = MEM_U32(sp + 48); +//nop; +t6 = t8 + 0xffffffff; +if ((int)t6 > 0) {MEM_U32(sp + 48) = t6; +goto L4309bc;} +MEM_U32(sp + 48) = t6; +L4309f0: +t9 = MEM_U32(sp + 48); +//nop; +if (t9 != 0) {//nop; +goto L430a08;} +//nop; +v0 = zero; +goto L430afc; +v0 = zero; +L430a08: +t0 = MEM_U32(sp + 48); +t1 = MEM_U32(sp + 40); +t3 = 0x1000000c; +t2 = t0 + t1; +t4 = t2 + 0x1; +MEM_U32(sp + 40) = t4; +MEM_U32(sp + 48) = zero; +t5 = MEM_U32(t3 + 0); +//nop; +if (t5 == 0) {//nop; +goto L430aa8;} +//nop; +L430a34: +t7 = MEM_U32(sp + 48); +t6 = 0x1000000c; +t8 = t7 << 3; +t9 = t8 + t6; +a1 = MEM_U32(t9 + 0); +//nop; +a0 = MEM_U32(sp + 40); +//nop; +v0 = wrapper_strcmp(mem, a0, a1); +goto L430a58; +//nop; +L430a58: +// bdead 4000000b gp = MEM_U32(sp + 24); +if (v0 != 0) {//nop; +goto L430a80;} +//nop; +t0 = MEM_U32(sp + 48); +t2 = 0x1000000c; +t1 = t0 << 3; +t4 = t1 + t2; +v0 = MEM_U8(t4 + 7); +//nop; +goto L430afc; +//nop; +L430a80: +t3 = MEM_U32(sp + 48); +t8 = 0x1000000c; +t5 = t3 + 0x1; +t7 = t5 << 3; +MEM_U32(sp + 48) = t5; +t6 = t7 + t8; +t9 = MEM_U32(t6 + 0); +//nop; +if (t9 != 0) {//nop; +goto L430a34;} +//nop; +L430aa8: +a1 = 0x10006118; +//nop; +a0 = MEM_U32(sp + 40); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L430abc; +a1 = a1; +L430abc: +// bdead 4000000b gp = MEM_U32(sp + 24); +if (v0 != 0) {//nop; +goto L430ad0;} +//nop; +v0 = 0x66; +goto L430afc; +v0 = 0x66; +L430ad0: +a1 = 0x1000611c; +//nop; +a0 = MEM_U32(sp + 40); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L430ae4; +a1 = a1; +L430ae4: +// bdead b gp = MEM_U32(sp + 24); +if (v0 != 0) {//nop; +goto L430af8;} +//nop; +v0 = 0x46; +goto L430afc; +v0 = 0x46; +L430af8: +v0 = zero; +L430afc: +// bdead 9 ra = MEM_U32(sp + 28); +// bdead 9 s0 = MEM_U32(sp + 20); +// bdead 9 sp = sp + 0x38; +return v0; +// bdead 9 sp = sp + 0x38; +} + +static uint32_t f_mksuf(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L430b0c: +//mksuf: +//nop; +//nop; +//nop; +sp = sp + 0xffffffa8; +MEM_U32(sp + 92) = a1; +t6 = MEM_U8(sp + 95); +// fdead 4000806b MEM_U32(sp + 44) = ra; +at = (int)t6 < (int)0x8; +// fdead 4000806f MEM_U32(sp + 40) = gp; +MEM_U32(sp + 88) = a0; +// fdead 4000806f MEM_U32(sp + 36) = s0; +if (at == 0) {MEM_U32(sp + 60) = zero; +goto L430c34;} +MEM_U32(sp + 60) = zero; +t7 = 0x1000000c; +MEM_U32(sp + 84) = zero; +t8 = MEM_U32(t7 + 0); +//nop; +if (t8 == 0) {//nop; +goto L430bb0;} +//nop; +L430b58: +t9 = MEM_U32(sp + 84); +t1 = 0x1000000c; +t0 = t9 << 3; +t2 = t0 + t1; +t3 = MEM_U32(t2 + 4); +t4 = MEM_U8(sp + 95); +//nop; +if (t3 != t4) {//nop; +goto L430b88;} +//nop; +t5 = MEM_U32(t2 + 0); +MEM_U32(sp + 60) = t5; +goto L430bb0; +MEM_U32(sp + 60) = t5; +L430b88: +t6 = MEM_U32(sp + 84); +t9 = 0x1000000c; +t7 = t6 + 0x1; +t8 = t7 << 3; +MEM_U32(sp + 84) = t7; +t0 = t8 + t9; +t1 = MEM_U32(t0 + 0); +//nop; +if (t1 != 0) {//nop; +goto L430b58;} +//nop; +L430bb0: +t3 = MEM_U32(sp + 60); +//nop; +if (t3 != 0) {//nop; +goto L430c18;} +//nop; +t2 = 0x1000612c; +a3 = 0x10006120; +t5 = MEM_U8(sp + 95); +//nop; +t4 = 0x38b2; +t2 = t2; +MEM_U32(sp + 20) = t2; +MEM_U32(sp + 16) = t4; +a0 = zero; +a1 = zero; +a2 = zero; +a3 = a3; +MEM_U32(sp + 24) = t5; +f_error(mem, sp, a0, a1, a2, a3); +goto L430bf8; +MEM_U32(sp + 24) = t5; +L430bf8: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = 0x4; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L430c10; +//nop; +L430c10: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L430c18: +//nop; +a0 = MEM_U32(sp + 60); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L430c28; +//nop; +L430c28: +// bdead 4000000b gp = MEM_U32(sp + 40); +MEM_U32(sp + 76) = v0; +goto L430c38; +MEM_U32(sp + 76) = v0; +L430c34: +MEM_U32(sp + 76) = zero; +L430c38: +//nop; +a0 = MEM_U32(sp + 88); +a1 = MEM_U32(sp + 76); +MEM_U32(sp + 84) = zero; +v0 = f_savestr(mem, sp, a0, a1); +goto L430c4c; +MEM_U32(sp + 84) = zero; +L430c4c: +MEM_U32(sp + 72) = v0; +t6 = MEM_U32(sp + 72); +// bdead 40008003 gp = MEM_U32(sp + 40); +MEM_U32(sp + 68) = t6; +MEM_U32(sp + 64) = t6; +t7 = MEM_U8(t6 + 0); +t8 = t6 + 0x1; +s0 = t7; +MEM_U32(sp + 68) = t8; +if (s0 == 0) {MEM_U8(sp + 59) = (uint8_t)t7; +goto L430cc8;} +MEM_U8(sp + 59) = (uint8_t)t7; +L430c78: +t9 = MEM_U8(sp + 59); +at = 0x2f; +if (t9 != at) {//nop; +goto L430c98;} +//nop; +t0 = MEM_U32(sp + 68); +MEM_U32(sp + 84) = zero; +MEM_U32(sp + 64) = t0; +goto L430ca8; +MEM_U32(sp + 64) = t0; +L430c98: +t1 = MEM_U32(sp + 84); +//nop; +t3 = t1 + 0x1; +MEM_U32(sp + 84) = t3; +L430ca8: +t4 = MEM_U32(sp + 68); +//nop; +t2 = MEM_U8(t4 + 0); +t5 = t4 + 0x1; +s0 = t2; +MEM_U32(sp + 68) = t5; +if (s0 != 0) {MEM_U8(sp + 59) = (uint8_t)t2; +goto L430c78;} +MEM_U8(sp + 59) = (uint8_t)t2; +L430cc8: +t7 = MEM_U32(sp + 84); +//nop; +at = (int)t7 < (int)0x3; +if (at != 0) {//nop; +goto L430d40;} +//nop; +t6 = MEM_U32(sp + 68); +at = 0x2e; +t8 = MEM_U8(t6 + -3); +//nop; +if (t8 != at) {//nop; +goto L430d40;} +//nop; +t9 = MEM_U8(sp + 95); +//nop; +at = (int)t9 < (int)0x8; +if (at == 0) {//nop; +goto L430d24;} +//nop; +//nop; +a1 = MEM_U32(sp + 60); +a0 = t6 + 0xfffffffe; +v0 = wrapper_strcpy(mem, a0, a1); +goto L430d18; +a0 = t6 + 0xfffffffe; +L430d18: +// bdead 40000001 gp = MEM_U32(sp + 40); +//nop; +goto L430e4c; +//nop; +L430d24: +t0 = MEM_U8(sp + 95); +t1 = MEM_U32(sp + 68); +//nop; +MEM_U8(t1 + -2) = (uint8_t)t0; +t3 = MEM_U32(sp + 68); +MEM_U8(t3 + -1) = (uint8_t)zero; +goto L430e4c; +MEM_U8(t3 + -1) = (uint8_t)zero; +L430d40: +t2 = MEM_U32(sp + 84); +//nop; +t4 = t2 + 0xfffffffe; +if ((int)t4 <= 0) {MEM_U32(sp + 80) = t4; +goto L430d88;} +MEM_U32(sp + 80) = t4; +L430d54: +t5 = MEM_U32(sp + 64); +t7 = MEM_U32(sp + 80); +at = 0x2e; +t8 = t5 + t7; +t9 = MEM_U8(t8 + 0); +//nop; +if (t9 == at) {//nop; +goto L430d88;} +//nop; +t6 = MEM_U32(sp + 80); +//nop; +t0 = t6 + 0xffffffff; +if ((int)t0 > 0) {MEM_U32(sp + 80) = t0; +goto L430d54;} +MEM_U32(sp + 80) = t0; +L430d88: +t1 = MEM_U32(sp + 80); +//nop; +if (t1 != 0) {//nop; +goto L430df0;} +//nop; +t2 = 0x1000615c; +a3 = 0x10006150; +t4 = MEM_U32(sp + 88); +//nop; +t3 = 0x38d9; +t2 = t2; +MEM_U32(sp + 20) = t2; +MEM_U32(sp + 16) = t3; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = a3; +MEM_U32(sp + 24) = t4; +f_error(mem, sp, a0, a1, a2, a3); +goto L430dd0; +MEM_U32(sp + 24) = t4; +L430dd0: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = 0x4; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L430de8; +//nop; +L430de8: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L430df0: +t5 = MEM_U32(sp + 80); +t7 = MEM_U32(sp + 64); +t6 = MEM_U8(sp + 95); +t8 = t5 + t7; +t9 = t8 + 0x1; +at = (int)t6 < (int)0x8; +if (at == 0) {MEM_U32(sp + 64) = t9; +goto L430e30;} +MEM_U32(sp + 64) = t9; +a0 = t9; +//nop; +a1 = MEM_U32(sp + 60); +//nop; +v0 = wrapper_strcpy(mem, a0, a1); +goto L430e24; +//nop; +L430e24: +// bdead 40000001 gp = MEM_U32(sp + 40); +//nop; +goto L430e4c; +//nop; +L430e30: +t0 = MEM_U8(sp + 95); +t1 = MEM_U32(sp + 64); +//nop; +MEM_U8(t1 + 0) = (uint8_t)t0; +t3 = MEM_U32(sp + 64); +//nop; +MEM_U8(t3 + 1) = (uint8_t)zero; +L430e4c: +t2 = MEM_U32(sp + 72); +//nop; +MEM_U32(sp + 68) = t2; +t4 = MEM_U8(t2 + 0); +//nop; +if (t4 == 0) {//nop; +goto L430ea8;} +//nop; +L430e68: +t5 = MEM_U32(sp + 72); +//nop; +s0 = MEM_U8(t5 + 0); +t8 = t5 + 0x1; +t7 = s0 ^ 0x2f; +t7 = t7 < 0x1; +s0 = t7; +if (s0 == 0) {MEM_U32(sp + 72) = t8; +goto L430e90;} +MEM_U32(sp + 72) = t8; +MEM_U32(sp + 68) = t8; +L430e90: +t6 = MEM_U32(sp + 72); +//nop; +t9 = MEM_U8(t6 + 0); +//nop; +if (t9 != 0) {//nop; +goto L430e68;} +//nop; +L430ea8: +// bdead 40000001 ra = MEM_U32(sp + 44); +v0 = MEM_U32(sp + 68); +// bdead 9 s0 = MEM_U32(sp + 36); +// bdead 9 sp = sp + 0x58; +return v0; +// bdead 9 sp = sp + 0x58; +} + +static uint32_t f_savestr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L430ebc: +//savestr: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +//nop; +MEM_U32(sp + 56) = a0; +// fdead 4000006b MEM_U32(sp + 44) = ra; +a0 = MEM_U32(sp + 56); +// fdead 4000006b MEM_U32(sp + 40) = gp; +MEM_U32(sp + 60) = a1; +// fdead 4000006b MEM_U32(sp + 36) = s0; +v0 = wrapper_strlen(mem, a0); +goto L430eec; +// fdead 4000006b MEM_U32(sp + 36) = s0; +L430eec: +// bdead 4000000b gp = MEM_U32(sp + 40); +t6 = MEM_U32(sp + 60); +//nop; +s0 = v0; +a0 = s0 + t6; +a0 = a0 + 0x1; +v0 = wrapper_malloc(mem, a0); +goto L430f08; +a0 = a0 + 0x1; +L430f08: +MEM_U32(sp + 52) = v0; +t7 = MEM_U32(sp + 52); +// bdead 40010003 gp = MEM_U32(sp + 40); +if (t7 != 0) {//nop; +goto L430fd0;} +//nop; +t9 = 0x10006188; +a3 = 0x1000617c; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +t8 = 0x38fe; +MEM_U32(sp + 16) = t8; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = a3; +f_error(mem, sp, a0, a1, a2, a3); +goto L430f4c; +a3 = a3; +L430f4c: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +t0 = 0xfb52720; +t1 = 0xfb50300; +t0 = MEM_U32(t0 + 0); +t1 = MEM_U32(t1 + 0); +//nop; +at = (int)t0 < (int)t1; +if (at == 0) {//nop; +goto L430fb8;} +//nop; +t2 = 0x10006198; +t4 = 0xfb500a0; +t3 = t0 << 2; +t2 = t2; +MEM_U32(sp + 20) = t2; +MEM_U32(sp + 16) = zero; +t5 = t3 + t4; +t6 = MEM_U32(t5 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t6; +f_error(mem, sp, a0, a1, a2, a3); +goto L430fb0; +MEM_U32(sp + 24) = t6; +L430fb0: +// bdead 40000001 gp = MEM_U32(sp + 40); +//nop; +L430fb8: +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L430fc8; +//nop; +L430fc8: +// bdead 40000001 gp = MEM_U32(sp + 40); +//nop; +L430fd0: +//nop; +a0 = MEM_U32(sp + 52); +a1 = MEM_U32(sp + 56); +//nop; +v0 = wrapper_strcpy(mem, a0, a1); +goto L430fe4; +//nop; +L430fe4: +// bdead 40000001 ra = MEM_U32(sp + 44); +// bdead 40000001 gp = MEM_U32(sp + 40); +v0 = MEM_U32(sp + 52); +// bdead 9 s0 = MEM_U32(sp + 36); +// bdead 9 sp = sp + 0x38; +return v0; +// bdead 9 sp = sp + 0x38; +} + +static void f_mktempstr(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L430ffc: +//mktempstr: +//nop; +//nop; +//nop; +a0 = 0x1000a2fc; +a1 = 0x1000619c; +//nop; +sp = sp + 0xffffffd8; +// fdead 4000006b MEM_U32(sp + 28) = ra; +a0 = MEM_U32(a0 + 0); +// fdead 4000006b MEM_U32(sp + 24) = gp; +// fdead 4000006b MEM_U32(sp + 20) = s0; +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431034; +a1 = a1; +L431034: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43104c; +//nop; +L43104c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t6 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t6 + 0) = v0; +//nop; +a1 = 0x100061a8; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431074; +a1 = a1; +L431074: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43108c; +//nop; +L43108c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t7 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t7 + 4) = v0; +//nop; +a1 = 0x100061b4; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4310b4; +a1 = a1; +L4310b4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L4310cc; +//nop; +L4310cc: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t8 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t8 + 8) = v0; +//nop; +a1 = 0x100061c0; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4310f4; +a1 = a1; +L4310f4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43110c; +//nop; +L43110c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t9 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t9 + 12) = v0; +//nop; +a1 = 0x100061cc; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431134; +a1 = a1; +L431134: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43114c; +//nop; +L43114c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t0 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t0 + 16) = v0; +//nop; +a1 = 0x100061d8; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431174; +a1 = a1; +L431174: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43118c; +//nop; +L43118c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t1 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t1 + 20) = v0; +//nop; +a1 = 0x100061e4; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4311b4; +a1 = a1; +L4311b4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L4311cc; +//nop; +L4311cc: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t2 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t2 + 24) = v0; +//nop; +a1 = 0x100061f0; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4311f4; +a1 = a1; +L4311f4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43120c; +//nop; +L43120c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t3 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t3 + 28) = v0; +//nop; +a1 = 0x100061fc; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431234; +a1 = a1; +L431234: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43124c; +//nop; +L43124c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t4 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t4 + 32) = v0; +//nop; +a1 = 0x10006208; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431274; +a1 = a1; +L431274: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43128c; +//nop; +L43128c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t5 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t5 + 36) = v0; +//nop; +a1 = 0x10006214; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4312b4; +a1 = a1; +L4312b4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L4312cc; +//nop; +L4312cc: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t6 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t6 + 40) = v0; +//nop; +a1 = 0x10006220; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4312f4; +a1 = a1; +L4312f4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43130c; +//nop; +L43130c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t7 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t7 + 44) = v0; +//nop; +a1 = 0x1000622c; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431334; +a1 = a1; +L431334: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43134c; +//nop; +L43134c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t8 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t8 + 48) = v0; +//nop; +a1 = 0x10006238; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431374; +a1 = a1; +L431374: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43138c; +//nop; +L43138c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t9 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t9 + 52) = v0; +//nop; +a1 = 0x10006244; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4313b4; +a1 = a1; +L4313b4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L4313cc; +//nop; +L4313cc: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t0 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t0 + 56) = v0; +//nop; +a1 = 0x10006250; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4313f4; +a1 = a1; +L4313f4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43140c; +//nop; +L43140c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t1 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t1 + 60) = v0; +//nop; +a1 = 0x1000625c; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431434; +a1 = a1; +L431434: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43144c; +//nop; +L43144c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t2 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t2 + 64) = v0; +//nop; +a1 = 0x10006268; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431474; +a1 = a1; +L431474: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43148c; +//nop; +L43148c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t3 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t3 + 68) = v0; +//nop; +a1 = 0x10006274; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4314b4; +a1 = a1; +L4314b4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L4314cc; +//nop; +L4314cc: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t4 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t4 + 72) = v0; +//nop; +a1 = 0x10006280; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4314f4; +a1 = a1; +L4314f4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43150c; +//nop; +L43150c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t5 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t5 + 80) = v0; +//nop; +a1 = 0x1000628c; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431534; +a1 = a1; +L431534: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43154c; +//nop; +L43154c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t6 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t6 + 76) = v0; +//nop; +a1 = 0x10006298; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431574; +a1 = a1; +L431574: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43158c; +//nop; +L43158c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t7 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t7 + 84) = v0; +//nop; +a1 = 0x100062a4; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4315b4; +a1 = a1; +L4315b4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L4315cc; +//nop; +L4315cc: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t8 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t8 + 88) = v0; +//nop; +a1 = 0x100062b0; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4315f4; +a1 = a1; +L4315f4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43160c; +//nop; +L43160c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t9 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t9 + 92) = v0; +//nop; +a1 = 0x100062bc; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431634; +a1 = a1; +L431634: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43164c; +//nop; +L43164c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t0 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t0 + 96) = v0; +//nop; +a1 = 0x100062cc; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431674; +a1 = a1; +L431674: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43168c; +//nop; +L43168c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t1 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t1 + 100) = v0; +//nop; +a1 = 0x100062d8; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4316b4; +a1 = a1; +L4316b4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L4316cc; +//nop; +L4316cc: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t2 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t2 + 104) = v0; +//nop; +a1 = 0x100062e4; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4316f4; +a1 = a1; +L4316f4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43170c; +//nop; +L43170c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t3 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t3 + 108) = v0; +//nop; +a1 = 0x100062f0; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431734; +a1 = a1; +L431734: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43174c; +//nop; +L43174c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t4 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t4 + 112) = v0; +//nop; +a1 = 0x100062fc; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431774; +a1 = a1; +L431774: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43178c; +//nop; +L43178c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t5 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t5 + 116) = v0; +//nop; +a1 = 0x10006308; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4317b4; +a1 = a1; +L4317b4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L4317cc; +//nop; +L4317cc: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t6 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t6 + 120) = v0; +//nop; +a1 = 0x10006314; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4317f4; +a1 = a1; +L4317f4: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43180c; +//nop; +L43180c: +// bdead 4000010b gp = MEM_U32(sp + 24); +a2 = zero; +t7 = 0x1000a380; +a0 = 0x1000a2fc; +MEM_U32(t7 + 124) = v0; +//nop; +a1 = 0x10006320; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L431834; +a1 = a1; +L431834: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L43184c; +//nop; +L43184c: +// bdead 4000000b gp = MEM_U32(sp + 24); +at = 0x1; +t8 = 0x1000a380; +t9 = 0x1000a36c; +MEM_U32(t8 + 132) = v0; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L431910;} +//nop; +t0 = 0x10000008; +at = 0x2; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == at) {at = 0x3; +goto L431890;} +at = 0x3; +if (t0 != at) {//nop; +goto L431910;} +//nop; +L431890: +t1 = 0x10000114; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L431910;} +//nop; +a0 = 0x10000100; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = 0x10; +v0 = wrapper_access(mem, a0, a1); +goto L4318bc; +a1 = 0x10; +L4318bc: +// bdead 4000010b gp = MEM_U32(sp + 24); +if (v0 != 0) {//nop; +goto L431910;} +//nop; +a0 = 0x1000a2fc; +a1 = 0x10006330; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4318e4; +a1 = a1; +L4318e4: +// bdead 40000009 gp = MEM_U32(sp + 24); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L4318fc; +//nop; +L4318fc: +// bdead 9 gp = MEM_U32(sp + 24); +//nop; +t2 = 0x1000a380; +MEM_U32(t2 + 128) = v0; +goto L43191c; +MEM_U32(t2 + 128) = v0; +L431910: +t3 = 0x1000a380; +//nop; +MEM_U32(t3 + 128) = zero; +L43191c: +// bdead 1 ra = MEM_U32(sp + 28); +// bdead 1 s0 = MEM_U32(sp + 20); +// bdead 1 sp = sp + 0x28; +return; +// bdead 1 sp = sp + 0x28; +} + +static uint32_t f_run(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L43192c: +//run: +//nop; +//nop; +//nop; +sp = sp + 0xffffff58; +t6 = 0x10000234; +// fdead 400081eb MEM_U32(sp + 44) = ra; +t6 = MEM_U32(t6 + 0); +// fdead 400081eb MEM_U32(sp + 40) = gp; +MEM_U32(sp + 168) = a0; +MEM_U32(sp + 172) = a1; +MEM_U32(sp + 176) = a2; +MEM_U32(sp + 180) = a3; +if (t6 == 0) {// fdead 400081eb MEM_U32(sp + 36) = s0; +goto L431a80;} +// fdead 400081eb MEM_U32(sp + 36) = s0; +a0 = 0xfb528e4; +a1 = 0x10006340; +//nop; +a2 = MEM_U32(sp + 168); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L431980; +a1 = a1; +L431980: +t7 = MEM_U32(sp + 172); +// bdead 40010183 gp = MEM_U32(sp + 40); +t8 = t7 + 0x4; +MEM_U32(sp + 164) = t8; +t9 = MEM_U32(t7 + 4); +//nop; +if (t9 == 0) {//nop; +goto L4319e0;} +//nop; +L4319a0: +t0 = MEM_U32(sp + 164); +a0 = 0xfb528e4; +a1 = 0x10006344; +//nop; +a2 = MEM_U32(t0 + 0); +t1 = t0 + 0x4; +MEM_U32(sp + 164) = t1; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L4319c8; +a1 = a1; +L4319c8: +t2 = MEM_U32(sp + 164); +// bdead 40000983 gp = MEM_U32(sp + 40); +t3 = MEM_U32(t2 + 0); +//nop; +if (t3 != 0) {//nop; +goto L4319a0;} +//nop; +L4319e0: +t4 = MEM_U32(sp + 176); +//nop; +if (t4 == 0) {//nop; +goto L431a14;} +//nop; +a0 = 0xfb528e4; +a1 = 0x10006348; +//nop; +a2 = t4; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L431a0c; +a1 = a1; +L431a0c: +// bdead 40000183 gp = MEM_U32(sp + 40); +//nop; +L431a14: +t5 = MEM_U32(sp + 180); +//nop; +if (t5 == 0) {//nop; +goto L431a48;} +//nop; +a0 = 0xfb528e4; +a1 = 0x10006350; +//nop; +a2 = t5; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L431a40; +a1 = a1; +L431a40: +// bdead 40000183 gp = MEM_U32(sp + 40); +//nop; +L431a48: +a0 = 0xfb528e4; +a1 = 0x10006358; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L431a60; +a1 = a1; +L431a60: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +//nop; +//nop; +//nop; +f_settimes(mem, sp); +goto L431a78; +//nop; +L431a78: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L431a80: +t6 = 0x10000238; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L431aa0;} +//nop; +v0 = zero; +goto L432650; +v0 = zero; +L431aa0: +t8 = 0x10000380; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L431b0c;} +//nop; +a0 = 0x1000a458; +//nop; +a0 = a0; +//nop; +v0 = wrapper_pipe(mem, a0); +goto L431acc; +//nop; +L431acc: +// bdead 4000000b gp = MEM_U32(sp + 40); +if ((int)v0 >= 0) {//nop; +goto L431b0c;} +//nop; +t7 = 0x1000635c; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L431b00; +MEM_U32(sp + 16) = zero; +L431b00: +// bdead 1 gp = MEM_U32(sp + 40); +v0 = 0xffffffff; +goto L432650; +v0 = 0xffffffff; +L431b0c: +//nop; +//nop; +//nop; +v0 = wrapper_fork(mem); +goto L431b1c; +//nop; +L431b1c: +MEM_U32(sp + 160) = v0; +t9 = MEM_U32(sp + 160); +// bdead 44000083 gp = MEM_U32(sp + 40); +at = 0xffffffff; +if (t9 != at) {//nop; +goto L431bd0;} +//nop; +t0 = 0x10006374; +//nop; +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L431b5c; +MEM_U32(sp + 16) = zero; +L431b5c: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +t1 = 0xfb52720; +t2 = 0xfb50300; +t1 = MEM_U32(t1 + 0); +t2 = MEM_U32(t2 + 0); +//nop; +at = (int)t1 < (int)t2; +if (at == 0) {//nop; +goto L431bc8;} +//nop; +t3 = 0x10006388; +t5 = 0xfb500a0; +t4 = t1 << 2; +t3 = t3; +MEM_U32(sp + 20) = t3; +MEM_U32(sp + 16) = zero; +t6 = t4 + t5; +t8 = MEM_U32(t6 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t8; +f_error(mem, sp, a0, a1, a2, a3); +goto L431bc0; +MEM_U32(sp + 24) = t8; +L431bc0: +// bdead 1 gp = MEM_U32(sp + 40); +//nop; +L431bc8: +v0 = 0xffffffff; +goto L432650; +v0 = 0xffffffff; +L431bd0: +t7 = MEM_U32(sp + 160); +//nop; +if (t7 != 0) {//nop; +goto L432174;} +//nop; +t9 = 0x10000380; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L431c14;} +//nop; +//nop; +//nop; +// bdead 40000003 t9 = t9; +//nop; +func_4365b8(mem, sp); +goto L431c0c; +//nop; +L431c0c: +// bdead 40000083 gp = MEM_U32(sp + 40); +//nop; +L431c14: +t0 = MEM_U32(sp + 176); +//nop; +if (t0 == 0) {//nop; +goto L431d38;} +//nop; +//nop; +a0 = t0; +a1 = zero; +v0 = wrapper_open(mem, a0, a1, a2); +goto L431c34; +a1 = zero; +L431c34: +MEM_U32(sp + 148) = v0; +t2 = MEM_U32(sp + 148); +// bdead 40000803 gp = MEM_U32(sp + 40); +at = 0xffffffff; +if (t2 != at) {//nop; +goto L431d18;} +//nop; +t3 = 0x1000638c; +t1 = MEM_U32(sp + 176); +//nop; +t3 = t3; +MEM_U32(sp + 20) = t3; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t1; +f_error(mem, sp, a0, a1, a2, a3); +goto L431c7c; +MEM_U32(sp + 24) = t1; +L431c7c: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +t4 = 0xfb52720; +t5 = 0xfb50300; +t4 = MEM_U32(t4 + 0); +t5 = MEM_U32(t5 + 0); +//nop; +at = (int)t4 < (int)t5; +if (at == 0) {//nop; +goto L431ce8;} +//nop; +t6 = 0x100063a8; +t7 = 0xfb500a0; +t8 = t4 << 2; +t6 = t6; +MEM_U32(sp + 20) = t6; +MEM_U32(sp + 16) = zero; +t9 = t8 + t7; +t0 = MEM_U32(t9 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t0; +f_error(mem, sp, a0, a1, a2, a3); +goto L431ce0; +MEM_U32(sp + 24) = t0; +L431ce0: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L431ce8: +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L431cf8; +//nop; +L431cf8: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L431d10; +//nop; +L431d10: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L431d18: +t2 = 0xfb528e4; +//nop; +a0 = MEM_U32(sp + 148); +a1 = MEM_U8(t2 + 13); +//nop; +v0 = wrapper_dup2(mem, a0, a1); +goto L431d30; +//nop; +L431d30: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L431d38: +t3 = MEM_U32(sp + 180); +//nop; +if (t3 == 0) {//nop; +goto L431e5c;} +//nop; +//nop; +a0 = t3; +a1 = 0x1b6; +v0 = wrapper_creat(mem, a0, a1); +goto L431d58; +a1 = 0x1b6; +L431d58: +MEM_U32(sp + 144) = v0; +t1 = MEM_U32(sp + 144); +// bdead 40000403 gp = MEM_U32(sp + 40); +at = 0xffffffff; +if (t1 != at) {//nop; +goto L431e3c;} +//nop; +t5 = 0x100063ac; +t6 = MEM_U32(sp + 180); +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t6; +f_error(mem, sp, a0, a1, a2, a3); +goto L431da0; +MEM_U32(sp + 24) = t6; +L431da0: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +t4 = 0xfb52720; +t8 = 0xfb50300; +t4 = MEM_U32(t4 + 0); +t8 = MEM_U32(t8 + 0); +//nop; +at = (int)t4 < (int)t8; +if (at == 0) {//nop; +goto L431e0c;} +//nop; +t7 = 0x100063cc; +t0 = 0xfb500a0; +t9 = t4 << 2; +t7 = t7; +t2 = t9 + t0; +MEM_U32(sp + 20) = t7; +MEM_U32(sp + 16) = zero; +t3 = MEM_U32(t2 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L431e04; +MEM_U32(sp + 24) = t3; +L431e04: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L431e0c: +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L431e1c; +//nop; +L431e1c: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L431e34; +//nop; +L431e34: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L431e3c: +t1 = 0xfb528e4; +//nop; +a0 = MEM_U32(sp + 144); +a1 = MEM_U8(t1 + 29); +//nop; +v0 = wrapper_dup2(mem, a0, a1); +goto L431e54; +//nop; +L431e54: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L431e5c: +t5 = MEM_U32(sp + 184); +//nop; +if (t5 == 0) {//nop; +goto L431f80;} +//nop; +//nop; +a0 = t5; +a1 = 0x1b6; +v0 = wrapper_creat(mem, a0, a1); +goto L431e7c; +a1 = 0x1b6; +L431e7c: +MEM_U32(sp + 140) = v0; +t6 = MEM_U32(sp + 140); +// bdead 40008003 gp = MEM_U32(sp + 40); +at = 0xffffffff; +if (t6 != at) {//nop; +goto L431f60;} +//nop; +t8 = 0x100063d0; +t7 = MEM_U32(sp + 184); +//nop; +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t7; +f_error(mem, sp, a0, a1, a2, a3); +goto L431ec4; +MEM_U32(sp + 24) = t7; +L431ec4: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +t4 = 0xfb52720; +t9 = 0xfb50300; +t4 = MEM_U32(t4 + 0); +t9 = MEM_U32(t9 + 0); +//nop; +at = (int)t4 < (int)t9; +if (at == 0) {//nop; +goto L431f30;} +//nop; +t0 = 0x100063f0; +t3 = 0xfb500a0; +t2 = t4 << 2; +t0 = t0; +MEM_U32(sp + 20) = t0; +MEM_U32(sp + 16) = zero; +t1 = t2 + t3; +t5 = MEM_U32(t1 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t5; +f_error(mem, sp, a0, a1, a2, a3); +goto L431f28; +MEM_U32(sp + 24) = t5; +L431f28: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L431f30: +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L431f40; +//nop; +L431f40: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L431f58; +//nop; +L431f58: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L431f60: +t6 = 0xfb528e4; +//nop; +a0 = MEM_U32(sp + 140); +a1 = MEM_U8(t6 + 45); +//nop; +v0 = wrapper_dup2(mem, a0, a1); +goto L431f78; +//nop; +L431f78: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L431f80: +//nop; +a0 = MEM_U32(sp + 168); +a1 = MEM_U32(sp + 172); +//nop; +v0 = wrapper_execvp(mem, a0, a1); +goto L431f94; +//nop; +L431f94: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = MEM_U32(sp + 168); +//nop; +a1 = 0x1; +// fdead 6000006f t9 = t9; +//nop; +v0 = func_434094(mem, sp, a0, a1); +goto L431fb0; +//nop; +L431fb0: +// bdead 4000000b gp = MEM_U32(sp + 40); +at = 0x2; +t8 = 0xfb52720; +MEM_U32(sp + 120) = v0; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L432020;} +//nop; +t7 = MEM_U32(sp + 120); +//nop; +if (t7 == 0) {//nop; +goto L432020;} +//nop; +t9 = 0x100063f4; +t0 = MEM_U32(sp + 168); +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t7; +MEM_U32(sp + 28) = t0; +f_error(mem, sp, a0, a1, a2, a3); +goto L432014; +MEM_U32(sp + 28) = t0; +L432014: +// bdead 40000001 gp = MEM_U32(sp + 40); +//nop; +goto L432140; +//nop; +L432020: +//nop; +a0 = MEM_U32(sp + 168); +// fdead 6201002f t9 = t9; +a1 = zero; +v0 = func_434094(mem, sp, a0, a1); +goto L432034; +a1 = zero; +L432034: +// bdead 4000000b gp = MEM_U32(sp + 40); +at = 0x2; +t4 = 0xfb52720; +MEM_U32(sp + 120) = v0; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L4320a4;} +//nop; +t2 = MEM_U32(sp + 120); +//nop; +if (t2 == 0) {//nop; +goto L4320a4;} +//nop; +t3 = 0x10006420; +t1 = MEM_U32(sp + 168); +//nop; +t3 = t3; +MEM_U32(sp + 20) = t3; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t2; +MEM_U32(sp + 28) = t1; +f_error(mem, sp, a0, a1, a2, a3); +goto L432098; +MEM_U32(sp + 28) = t1; +L432098: +// bdead 40000001 gp = MEM_U32(sp + 40); +//nop; +goto L432140; +//nop; +L4320a4: +t5 = 0x10006450; +t6 = MEM_U32(sp + 168); +//nop; +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t6; +f_error(mem, sp, a0, a1, a2, a3); +goto L4320d4; +MEM_U32(sp + 24) = t6; +L4320d4: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +t8 = 0xfb52720; +t9 = 0xfb50300; +t8 = MEM_U32(t8 + 0); +t9 = MEM_U32(t9 + 0); +//nop; +at = (int)t8 < (int)t9; +if (at == 0) {//nop; +goto L432140;} +//nop; +t7 = 0x10006468; +t4 = 0xfb500a0; +t0 = t8 << 2; +t7 = t7; +MEM_U32(sp + 20) = t7; +MEM_U32(sp + 16) = zero; +t3 = t0 + t4; +t2 = MEM_U32(t3 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t2; +f_error(mem, sp, a0, a1, a2, a3); +goto L432138; +MEM_U32(sp + 24) = t2; +L432138: +// bdead 40000001 gp = MEM_U32(sp + 40); +//nop; +L432140: +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L432150; +//nop; +L432150: +// bdead 40000001 gp = MEM_U32(sp + 40); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L432168; +//nop; +L432168: +// bdead 9 gp = MEM_U32(sp + 40); +//nop; +goto L432650; +//nop; +L432174: +//nop; +a0 = 0x2; +a1 = 0x1; +v0 = wrapper_sigset(mem, a0, trampoline, a1, sp); +goto L432184; +a1 = 0x1; +L432184: +// bdead 4000000b gp = MEM_U32(sp + 40); +MEM_U32(sp + 132) = v0; +//nop; +a0 = 0xf; +a1 = 0x1; +v0 = wrapper_sigset(mem, a0, trampoline, a1, sp); +goto L43219c; +a1 = 0x1; +L43219c: +// bdead 4000010b gp = MEM_U32(sp + 40); +MEM_U32(sp + 136) = v0; +t1 = 0x10000380; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L4322ec;} +//nop; +//nop; +a0 = MEM_U32(sp + 160); +// fdead 6000042f t9 = t9; +//nop; +v0 = func_4362cc(mem, sp, a0); +goto L4321d0; +//nop; +L4321d0: +// bdead 4000010b gp = MEM_U32(sp + 40); +MEM_U32(sp + 116) = v0; +a2 = 0x10000430; +//nop; +a0 = MEM_U32(sp + 116); +a1 = 0x71f9; +a2 = a2; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_ioctl(mem, a0, a1, sp); +goto L4321f0; +a2 = a2; +L4321f0: +MEM_U32(sp + 124) = v0; +t5 = MEM_U32(sp + 124); +// bdead 40004103 gp = MEM_U32(sp + 40); +if ((int)t5 >= 0) {//nop; +goto L43223c;} +//nop; +a0 = 0x1000646c; +//nop; +a0 = a0; +//nop; +wrapper_perror(mem, a0); +goto L432218; +//nop; +L432218: +// bdead 40000001 gp = MEM_U32(sp + 40); +a0 = MEM_U32(sp + 160); +//nop; +a1 = 0x9; +//nop; +v0 = wrapper_kill(mem, a0, a1); +goto L432230; +//nop; +L432230: +// bdead 1 gp = MEM_U32(sp + 40); +v0 = 0xffffffff; +goto L432650; +v0 = 0xffffffff; +L43223c: +s0 = 0x10; +if (s0 == 0) {//nop; +goto L432260;} +//nop; +L432248: +s0 = s0 + 0xffffffff; +t6 = s0 << 2; +t9 = sp + 0x34; +t7 = t6 + t9; +if (s0 != 0) {MEM_U32(t7 + 0) = zero; +goto L432248;} +MEM_U32(t7 + 0) = zero; +L432260: +//nop; +a0 = MEM_U32(sp + 116); +a1 = 0x7114; +a2 = sp + 0x34; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_ioctl(mem, a0, a1, sp); +goto L432274; +a2 = sp + 0x34; +L432274: +// bdead 4000010b gp = MEM_U32(sp + 40); +if ((int)v0 >= 0) {//nop; +goto L4322b8;} +//nop; +a0 = 0x10006478; +//nop; +a0 = a0; +//nop; +wrapper_perror(mem, a0); +goto L432294; +//nop; +L432294: +// bdead 40000001 gp = MEM_U32(sp + 40); +a0 = MEM_U32(sp + 160); +//nop; +a1 = 0x9; +//nop; +v0 = wrapper_kill(mem, a0, a1); +goto L4322ac; +//nop; +L4322ac: +// bdead 1 gp = MEM_U32(sp + 40); +v0 = 0xffffffff; +goto L432650; +v0 = 0xffffffff; +L4322b8: +//nop; +a0 = MEM_U32(sp + 116); +a1 = 0x7104; +a2 = zero; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_ioctl(mem, a0, a1, sp); +goto L4322cc; +a2 = zero; +L4322cc: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = MEM_U32(sp + 116); +//nop; +//nop; +//nop; +v0 = wrapper_close(mem, a0); +goto L4322e4; +//nop; +L4322e4: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L4322ec: +//nop; +a0 = sp + 0x80; +//nop; +v0 = wrapper_wait(mem, a0); +goto L4322fc; +//nop; +L4322fc: +MEM_U32(sp + 156) = v0; +t8 = MEM_U32(sp + 156); +t0 = MEM_U32(sp + 160); +// bdead 42000203 gp = MEM_U32(sp + 40); +if (t8 == t0) {//nop; +goto L432354;} +//nop; +L432314: +t4 = MEM_U32(sp + 156); +at = 0xffffffff; +if (t4 != at) {//nop; +goto L43232c;} +//nop; +v0 = 0xffffffff; +goto L432650; +v0 = 0xffffffff; +L43232c: +//nop; +a0 = sp + 0x80; +//nop; +v0 = wrapper_wait(mem, a0); +goto L43233c; +//nop; +L43233c: +MEM_U32(sp + 156) = v0; +t3 = MEM_U32(sp + 156); +t2 = MEM_U32(sp + 160); +// bdead 40001803 gp = MEM_U32(sp + 40); +if (t3 != t2) {//nop; +goto L432314;} +//nop; +L432354: +//nop; +a1 = MEM_U32(sp + 132); +a0 = 0x2; +v0 = wrapper_sigset(mem, a0, trampoline, a1, sp); +goto L432364; +a0 = 0x2; +L432364: +// bdead 40000003 gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 136); +//nop; +a0 = 0xf; +//nop; +v0 = wrapper_sigset(mem, a0, trampoline, a1, sp); +goto L43237c; +//nop; +L43237c: +// bdead 40000103 gp = MEM_U32(sp + 40); +//nop; +t1 = 0x10000234; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L4323b4;} +//nop; +//nop; +//nop; +//nop; +f_dotime(mem, sp); +goto L4323ac; +//nop; +L4323ac: +// bdead 40000103 gp = MEM_U32(sp + 40); +//nop; +L4323b4: +t5 = 0x10000380; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L4323ec;} +//nop; +//nop; +a0 = MEM_U32(sp + 168); +a1 = MEM_U32(sp + 124); +// fdead 6002446f t9 = t9; +//nop; +func_43673c(mem, sp, a0, a1); +goto L4323e4; +//nop; +L4323e4: +// bdead 40000103 gp = MEM_U32(sp + 40); +//nop; +L4323ec: +t6 = sp + 0x80; +t9 = MEM_U32(t6 + 0); +at = 0x7f; +t7 = t9 & 0xff; +if (t7 != at) {//nop; +goto L432484;} +//nop; +t8 = (int)t9 >> 8; +t0 = t8 & 0xff; +if (t0 == 0) {//nop; +goto L432484;} +//nop; +a0 = 0xfb528e4; +a1 = 0x10006484; +//nop; +a2 = MEM_U32(sp + 168); +MEM_U32(sp + 152) = t0; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L432434; +a1 = a1; +L432434: +// bdead 40000101 gp = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 152); +a0 = 0xfb528e4; +a1 = 0x100064a8; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L432454; +a1 = a1; +L432454: +// bdead 40000101 gp = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 156); +a0 = 0xfb528e4; +a1 = 0x100064b8; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L432474; +a1 = a1; +L432474: +// bdead 40000001 gp = MEM_U32(sp + 40); +v0 = MEM_U32(sp + 152); +//nop; +goto L432650; +//nop; +L432484: +t4 = sp + 0x80; +t3 = MEM_U32(t4 + 0); +//nop; +t2 = t3 & 0xff; +if (t2 != 0) {//nop; +goto L4324ac;} +//nop; +v0 = (int)t3 >> 8; +t1 = v0 & 0xff; +v0 = t1; +goto L432650; +v0 = t1; +L4324ac: +t5 = sp + 0x80; +t6 = MEM_U32(t5 + 0); +//nop; +t7 = t6 & 0xff; +if ((int)t7 <= 0) {//nop; +goto L43264c;} +//nop; +t9 = (int)t6 >> 8; +t8 = t9 & 0xff; +if (t8 != 0) {//nop; +goto L43264c;} +//nop; +a0 = 0xfb528e4; +a1 = 0x100064d0; +//nop; +t0 = t6 & 0x7f; +a2 = MEM_U32(sp + 168); +MEM_U32(sp + 152) = t0; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L4324f8; +a1 = a1; +L4324f8: +// bdead 40000181 gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 152); +a0 = 0x100064e4; +//nop; +a0 = a0; +//nop; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_printf(mem, a0, sp); +goto L432514; +//nop; +L432514: +t4 = MEM_U32(sp + 152); +// bdead 400021c1 gp = MEM_U32(sp + 40); +at = 0x9; +if (t4 != at) {//nop; +goto L43255c;} +//nop; +a0 = 0x10006504; +//nop; +a0 = a0; +//nop; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_printf(mem, a0, sp); +goto L43253c; +//nop; +L43253c: +// bdead 40000001 gp = MEM_U32(sp + 40); +a0 = MEM_U32(sp + 152); +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L432554; +//nop; +L432554: +// bdead 40000101 gp = MEM_U32(sp + 40); +//nop; +L43255c: +t2 = MEM_U32(sp + 152); +at = 0x2; +if (t2 != at) {//nop; +goto L43259c;} +//nop; +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L43257c; +//nop; +L43257c: +// bdead 40000001 gp = MEM_U32(sp + 40); +a0 = 0x3; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L432594; +//nop; +L432594: +// bdead 40000101 gp = MEM_U32(sp + 40); +//nop; +L43259c: +a0 = 0xfb528e4; +a1 = 0x1000654c; +//nop; +a2 = MEM_U32(sp + 168); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L4325b8; +a1 = a1; +L4325b8: +// bdead 40000101 gp = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 152); +a0 = 0xfb528e4; +a1 = 0x10006560; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L4325d8; +a1 = a1; +L4325d8: +t3 = MEM_U32(sp + 128); +// bdead 40001181 gp = MEM_U32(sp + 40); +t1 = t3 & 0x80; +if (t1 == 0) {//nop; +goto L432610;} +//nop; +a0 = 0xfb528e4; +a1 = 0x1000656c; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L432604; +a1 = a1; +L432604: +// bdead 40000001 gp = MEM_U32(sp + 40); +//nop; +goto L432630; +//nop; +L432610: +a0 = 0xfb528e4; +a1 = 0x1000657c; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L432628; +a1 = a1; +L432628: +// bdead 40000001 gp = MEM_U32(sp + 40); +//nop; +L432630: +//nop; +a0 = MEM_U32(sp + 152); +//nop; +wrapper_exit(mem, a0); +goto L432640; +//nop; +L432640: +// bdead 9 gp = MEM_U32(sp + 40); +//nop; +goto L432650; +//nop; +L43264c: +v0 = zero; +L432650: +// bdead 9 ra = MEM_U32(sp + 44); +// bdead 9 s0 = MEM_U32(sp + 36); +// bdead 9 sp = sp + 0xa8; +return v0; +// bdead 9 sp = sp + 0xa8; +} + +static uint32_t f_edit_src(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L432660: +//edit_src: +//nop; +//nop; +//nop; +sp = sp + 0xffffff98; +//nop; +// fdead 400000eb MEM_U32(sp + 60) = ra; +// fdead 400000eb MEM_U32(sp + 56) = gp; +MEM_U32(sp + 104) = a0; +MEM_U32(sp + 108) = a1; +MEM_U32(sp + 112) = a2; +v0 = wrapper_fork(mem); +goto L43268c; +MEM_U32(sp + 112) = a2; +L43268c: +MEM_U32(sp + 84) = v0; +t6 = MEM_U32(sp + 84); +// bdead 40008003 gp = MEM_U32(sp + 56); +at = 0xffffffff; +if (t6 != at) {//nop; +goto L432740;} +//nop; +t7 = 0x10006580; +//nop; +t7 = t7; +MEM_U32(sp + 20) = t7; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_error(mem, sp, a0, a1, a2, a3); +goto L4326cc; +MEM_U32(sp + 16) = zero; +L4326cc: +// bdead 40000003 gp = MEM_U32(sp + 56); +//nop; +t8 = 0xfb52720; +t9 = 0xfb50300; +t8 = MEM_U32(t8 + 0); +t9 = MEM_U32(t9 + 0); +//nop; +at = (int)t8 < (int)t9; +if (at == 0) {//nop; +goto L432738;} +//nop; +t0 = 0x10006598; +t2 = 0xfb500a0; +t1 = t8 << 2; +t0 = t0; +MEM_U32(sp + 20) = t0; +MEM_U32(sp + 16) = zero; +t3 = t1 + t2; +t4 = MEM_U32(t3 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t4; +f_error(mem, sp, a0, a1, a2, a3); +goto L432730; +MEM_U32(sp + 24) = t4; +L432730: +// bdead 1 gp = MEM_U32(sp + 56); +//nop; +L432738: +v0 = 0xffffffff; +goto L432b4c; +v0 = 0xffffffff; +L432740: +t5 = MEM_U32(sp + 84); +//nop; +if (t5 != 0) {//nop; +goto L43295c;} +//nop; +t6 = 0x100002a8; +at = 0x2; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L4327dc;} +//nop; +//nop; +a1 = MEM_U32(sp + 108); +a2 = MEM_U32(sp + 112); +a0 = sp + 0x58; +f_get_lino(mem, sp, a0, a1, a2); +goto L43277c; +a0 = sp + 0x58; +L43277c: +// bdead 40000003 gp = MEM_U32(sp + 56); +t7 = MEM_U32(sp + 104); +t9 = 0x1000659c; +t0 = 0x1000a380; +t9 = t9; +MEM_U32(sp + 16) = t9; +t8 = MEM_U32(t0 + 100); +t1 = 0x100065a0; +t2 = 0x100065a4; +//nop; +a3 = MEM_U32(sp + 108); +t1 = t1; +t2 = t2; +MEM_U32(sp + 28) = t2; +MEM_U32(sp + 24) = t1; +MEM_U32(sp + 32) = zero; +a2 = sp + 0x58; +a0 = t7; +a1 = t7; +MEM_U32(sp + 20) = t8; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_execlp(mem, a0, sp); +goto L4327d0; +MEM_U32(sp + 20) = t8; +L4327d0: +// bdead 40000003 gp = MEM_U32(sp + 56); +//nop; +goto L4328a4; +//nop; +L4327dc: +t3 = 0x1000a240; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L432830;} +//nop; +t4 = MEM_U32(sp + 104); +a3 = 0x1000a1f8; +a2 = 0x100065b0; +t5 = MEM_U32(sp + 108); +//nop; +a3 = MEM_U32(a3 + 0); +MEM_U32(sp + 20) = zero; +a0 = t4; +a1 = t4; +a2 = a2; +MEM_U32(sp + 16) = t5; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_execlp(mem, a0, sp); +goto L432824; +MEM_U32(sp + 16) = t5; +L432824: +// bdead 40000003 gp = MEM_U32(sp + 56); +//nop; +goto L4328a4; +//nop; +L432830: +t9 = MEM_U32(sp + 104); +t8 = 0x1000a1f8; +a3 = 0x1000a240; +t6 = 0x100065d0; +t7 = 0x100065d4; +t0 = 0x100065d8; +MEM_U32(sp + 24) = t9; +//nop; +a0 = 0x100065b4; +a1 = 0x100065bc; +a2 = 0x100065c4; +t1 = MEM_U32(sp + 108); +t8 = MEM_U32(t8 + 0); +a3 = MEM_U32(a3 + 0); +t6 = t6; +t7 = t7; +t0 = t0; +MEM_U32(sp + 28) = t0; +MEM_U32(sp + 20) = t7; +MEM_U32(sp + 16) = t6; +MEM_U32(sp + 40) = zero; +a0 = a0; +a1 = a1; +a2 = a2; +MEM_U32(sp + 36) = t1; +MEM_U32(sp + 32) = t8; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_execlp(mem, a0, sp); +goto L43289c; +MEM_U32(sp + 32) = t8; +L43289c: +// bdead 40000003 gp = MEM_U32(sp + 56); +//nop; +L4328a4: +t2 = 0x100065dc; +t3 = MEM_U32(sp + 104); +//nop; +t2 = t2; +MEM_U32(sp + 20) = t2; +a0 = 0x1; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 24) = t3; +f_error(mem, sp, a0, a1, a2, a3); +goto L4328d4; +MEM_U32(sp + 24) = t3; +L4328d4: +// bdead 40000003 gp = MEM_U32(sp + 56); +//nop; +t4 = 0xfb52720; +t5 = 0xfb50300; +t4 = MEM_U32(t4 + 0); +t5 = MEM_U32(t5 + 0); +//nop; +at = (int)t4 < (int)t5; +if (at == 0) {//nop; +goto L432940;} +//nop; +t6 = 0x100065f0; +t9 = 0xfb500a0; +t7 = t4 << 2; +t6 = t6; +t0 = t7 + t9; +MEM_U32(sp + 20) = t6; +MEM_U32(sp + 16) = zero; +t8 = MEM_U32(t0 + 0); +//nop; +a0 = 0x5; +a1 = zero; +a2 = zero; +a3 = zero; +MEM_U32(sp + 24) = t8; +f_error(mem, sp, a0, a1, a2, a3); +goto L432938; +MEM_U32(sp + 24) = t8; +L432938: +// bdead 40000001 gp = MEM_U32(sp + 56); +//nop; +L432940: +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L432950; +//nop; +L432950: +// bdead 9 gp = MEM_U32(sp + 56); +//nop; +goto L432b4c; +//nop; +L43295c: +//nop; +a0 = 0x2; +a1 = 0x1; +v0 = wrapper_sigset(mem, a0, trampoline, a1, sp); +goto L43296c; +a1 = 0x1; +L43296c: +// bdead 40000009 gp = MEM_U32(sp + 56); +MEM_U32(sp + 68) = v0; +//nop; +a0 = 0xf; +a1 = 0x1; +v0 = wrapper_sigset(mem, a0, trampoline, a1, sp); +goto L432984; +a1 = 0x1; +L432984: +// bdead 40000009 gp = MEM_U32(sp + 56); +MEM_U32(sp + 72) = v0; +//nop; +a0 = sp + 0x40; +//nop; +v0 = wrapper_wait(mem, a0); +goto L43299c; +//nop; +L43299c: +MEM_U32(sp + 80) = v0; +t1 = MEM_U32(sp + 80); +t2 = MEM_U32(sp + 84); +// bdead 40000c01 gp = MEM_U32(sp + 56); +if (t1 == t2) {//nop; +goto L4329f4;} +//nop; +L4329b4: +t3 = MEM_U32(sp + 80); +at = 0xffffffff; +if (t3 != at) {//nop; +goto L4329cc;} +//nop; +v0 = 0xffffffff; +goto L432b4c; +v0 = 0xffffffff; +L4329cc: +//nop; +a0 = sp + 0x40; +//nop; +v0 = wrapper_wait(mem, a0); +goto L4329dc; +//nop; +L4329dc: +MEM_U32(sp + 80) = v0; +t5 = MEM_U32(sp + 80); +t6 = MEM_U32(sp + 84); +// bdead 4000c001 gp = MEM_U32(sp + 56); +if (t5 != t6) {//nop; +goto L4329b4;} +//nop; +L4329f4: +//nop; +a1 = MEM_U32(sp + 68); +a0 = 0x2; +v0 = wrapper_sigset(mem, a0, trampoline, a1, sp); +goto L432a04; +a0 = 0x2; +L432a04: +// bdead 40000001 gp = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 72); +//nop; +a0 = 0xf; +//nop; +v0 = wrapper_sigset(mem, a0, trampoline, a1, sp); +goto L432a1c; +//nop; +L432a1c: +t4 = MEM_U32(sp + 64); +// bdead 40002101 gp = MEM_U32(sp + 56); +t7 = t4 & 0xff; +if (t7 == 0) {MEM_U32(sp + 76) = t7; +goto L432afc;} +MEM_U32(sp + 76) = t7; +at = 0x2; +if (t7 == at) {//nop; +goto L432afc;} +//nop; +a0 = 0xfb528e4; +a1 = 0x100065f4; +//nop; +a2 = MEM_U32(sp + 104); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L432a58; +a1 = a1; +L432a58: +// bdead 40000181 gp = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 76); +a0 = 0x10006608; +//nop; +a0 = a0; +//nop; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_printf(mem, a0, sp); +goto L432a74; +//nop; +L432a74: +t9 = MEM_U32(sp + 64); +// bdead 44000181 gp = MEM_U32(sp + 56); +t0 = t9 & 0x80; +if (t0 == 0) {//nop; +goto L432aac;} +//nop; +a0 = 0xfb528e4; +a1 = 0x10006614; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L432aa0; +a1 = a1; +L432aa0: +// bdead 40000001 gp = MEM_U32(sp + 56); +//nop; +goto L432acc; +//nop; +L432aac: +a0 = 0xfb528e4; +a1 = 0x10006624; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L432ac4; +a1 = a1; +L432ac4: +// bdead 40000001 gp = MEM_U32(sp + 56); +//nop; +L432acc: +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L432adc; +//nop; +L432adc: +// bdead 40000001 gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 76); +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L432af4; +//nop; +L432af4: +// bdead 40000001 gp = MEM_U32(sp + 56); +//nop; +L432afc: +t8 = MEM_U32(sp + 76); +at = 0x2; +if (t8 != at) {//nop; +goto L432b3c;} +//nop; +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L432b1c; +//nop; +L432b1c: +// bdead 40000001 gp = MEM_U32(sp + 56); +a0 = 0x3; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L432b34; +//nop; +L432b34: +// bdead 40000001 gp = MEM_U32(sp + 56); +//nop; +L432b3c: +v0 = MEM_U32(sp + 64); +//nop; +t1 = v0 & 0xff00; +v0 = t1; +L432b4c: +// bdead 9 ra = MEM_U32(sp + 60); +// bdead 9 sp = sp + 0x68; +//nop; +return v0; +//nop; +} + +static void f_get_lino(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L432b5c: +//get_lino: +//nop; +//nop; +//nop; +sp = sp + 0xfffff7c0; +MEM_U32(sp + 2112) = a0; +t6 = MEM_U32(sp + 2112); +// fdead 400080eb MEM_U32(sp + 36) = ra; +// fdead 400080eb MEM_U32(sp + 32) = gp; +MEM_U32(sp + 2116) = a1; +MEM_U32(sp + 2120) = a2; +// fdead 400080eb MEM_U32(sp + 28) = s1; +// fdead 400080eb MEM_U32(sp + 24) = s0; +t7 = 0x2b; +MEM_U32(sp + 2100) = t6; +MEM_U8(t6 + 0) = (uint8_t)t7; +t8 = MEM_U32(sp + 2100); +a0 = 0x1000a1f8; +t9 = t8 + 0x1; +MEM_U32(sp + 2100) = t9; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = zero; +v0 = wrapper_open(mem, a0, a1, a2); +goto L432bb8; +a1 = zero; +L432bb8: +// bdead 4000000b gp = MEM_U32(sp + 32); +MEM_U32(sp + 2108) = v0; +//nop; +a0 = MEM_U32(sp + 2108); +a1 = sp + 0x30; +a2 = 0x800; +v0 = wrapper_read(mem, a0, a1, a2); +goto L432bd4; +a2 = 0x800; +L432bd4: +// bdead 4000000b gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 2108); +//nop; +MEM_U32(sp + 2104) = v0; +//nop; +v0 = wrapper_close(mem, a0); +goto L432bec; +//nop; +L432bec: +t0 = MEM_U32(sp + 2104); +// bdead 40000203 gp = MEM_U32(sp + 32); +at = (int)t0 < (int)0x800; +if (at == 0) {//nop; +goto L432c10;} +//nop; +t1 = sp + 0x30; +t2 = t0 + t1; +MEM_U8(t2 + 0) = (uint8_t)zero; +goto L432c18; +MEM_U8(t2 + 0) = (uint8_t)zero; +L432c10: +t3 = sp + 0x30; +MEM_U8(t3 + 2047) = (uint8_t)zero; +L432c18: +t4 = MEM_U32(sp + 2120); +//nop; +t5 = t4 + 0xffffffff; +at = t5 < 0x6; +if (at == 0) {//nop; +goto L4330c0;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10007acc[] = { +&&L432c4c, +&&L432c4c, +&&L432e0c, +&&L4330c0, +&&L432f30, +&&L432f30, +}; +dest = Lswitch10007acc[t5]; +//nop; +goto *dest; +//nop; +L432c4c: +t6 = MEM_U32(sp + 2104); +t7 = sp + 0x30; +t8 = t6 + t7; +at = t7 < t8; +if (at == 0) {MEM_U32(sp + 2096) = t7; +goto L4330c0;} +MEM_U32(sp + 2096) = t7; +L432c64: +a1 = 0x10006628; +//nop; +a0 = MEM_U32(sp + 2096); +a2 = 0x9; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L432c7c; +a1 = a1; +L432c7c: +// bdead 4000000b gp = MEM_U32(sp + 32); +if (v0 != 0) {//nop; +goto L432de4;} +//nop; +//nop; +a0 = MEM_U32(sp + 2096); +a1 = 0x2c; +v0 = wrapper_strchr(mem, a0, a1); +goto L432c98; +a1 = 0x2c; +L432c98: +MEM_U32(sp + 2096) = v0; +t9 = MEM_U32(sp + 2096); +// bdead 44000003 gp = MEM_U32(sp + 32); +if (t9 == 0) {//nop; +goto L432de4;} +//nop; +//nop; +a0 = MEM_U32(sp + 2116); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L432cbc; +//nop; +L432cbc: +// bdead 4000000b gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 2116); +//nop; +s1 = v0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L432cd4; +//nop; +L432cd4: +// bdead 4004000b gp = MEM_U32(sp + 32); +t0 = MEM_U32(sp + 2096); +//nop; +s0 = v0; +a1 = MEM_U32(sp + 2116); +a2 = s0; +a0 = t0 - s1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L432cf4; +a0 = t0 - s1; +L432cf4: +// bdead 4000000b gp = MEM_U32(sp + 32); +if (v0 != 0) {//nop; +goto L432de4;} +//nop; +a1 = 0x10006634; +//nop; +a0 = MEM_U32(sp + 2096); +a2 = 0x7; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L432d18; +a1 = a1; +L432d18: +// bdead 4000000b gp = MEM_U32(sp + 32); +if (v0 != 0) {//nop; +goto L432de4;} +//nop; +t1 = MEM_U32(sp + 2096); +t4 = 0xfb504f0; +t2 = t1 + 0x7; +MEM_U32(sp + 2096) = t2; +t3 = MEM_U8(t2 + 0); +//nop; +t5 = t3 + t4; +t6 = MEM_U8(t5 + 1); +//nop; +t7 = t6 & 0x4; +if (t7 == 0) {//nop; +goto L4330c0;} +//nop; +t8 = MEM_U32(sp + 2100); +t9 = MEM_U32(sp + 2112); +//nop; +t0 = t8 - t9; +at = (int)t0 < (int)0xb; +if (at == 0) {//nop; +goto L4330c0;} +//nop; +L432d70: +t1 = MEM_U32(sp + 2096); +t3 = MEM_U32(sp + 2100); +t2 = MEM_U8(t1 + 0); +t0 = 0xfb504f0; +MEM_U8(t3 + 0) = (uint8_t)t2; +t6 = MEM_U32(sp + 2096); +t4 = MEM_U32(sp + 2100); +t7 = t6 + 0x1; +MEM_U32(sp + 2096) = t7; +t8 = MEM_U32(sp + 2096); +t5 = t4 + 0x1; +MEM_U32(sp + 2100) = t5; +t9 = MEM_U8(t8 + 0); +//nop; +t1 = t9 + t0; +t2 = MEM_U8(t1 + 1); +//nop; +t3 = t2 & 0x4; +if (t3 == 0) {//nop; +goto L4330c0;} +//nop; +t4 = MEM_U32(sp + 2100); +t5 = MEM_U32(sp + 2112); +//nop; +t6 = t4 - t5; +at = (int)t6 < (int)0xb; +if (at != 0) {//nop; +goto L432d70;} +//nop; +//nop; +goto L4330c0; +//nop; +L432de4: +t7 = MEM_U32(sp + 2096); +t9 = MEM_U32(sp + 2104); +t0 = sp + 0x30; +t8 = t7 + 0x1; +t1 = t9 + t0; +at = t8 < t1; +if (at != 0) {MEM_U32(sp + 2096) = t8; +goto L432c64;} +MEM_U32(sp + 2096) = t8; +//nop; +goto L4330c0; +//nop; +L432e0c: +t3 = MEM_U32(sp + 2104); +t2 = sp + 0x30; +t4 = t3 + t2; +at = t2 < t4; +if (at == 0) {MEM_U32(sp + 2096) = t2; +goto L4330c0;} +MEM_U32(sp + 2096) = t2; +L432e24: +a1 = 0x1000663c; +//nop; +a0 = MEM_U32(sp + 2096); +a2 = 0xe; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L432e3c; +a1 = a1; +L432e3c: +// bdead 4000000b gp = MEM_U32(sp + 32); +if (v0 != 0) {//nop; +goto L432f08;} +//nop; +t5 = MEM_U32(sp + 2096); +t9 = 0xfb504f0; +t6 = t5 + 0xe; +MEM_U32(sp + 2096) = t6; +t7 = MEM_U8(t6 + 0); +//nop; +t0 = t7 + t9; +t8 = MEM_U8(t0 + 1); +//nop; +t1 = t8 & 0x4; +if (t1 == 0) {//nop; +goto L4330c0;} +//nop; +t3 = MEM_U32(sp + 2100); +t2 = MEM_U32(sp + 2112); +//nop; +t4 = t3 - t2; +at = (int)t4 < (int)0xb; +if (at == 0) {//nop; +goto L4330c0;} +//nop; +L432e94: +t5 = MEM_U32(sp + 2096); +t7 = MEM_U32(sp + 2100); +t6 = MEM_U8(t5 + 0); +t4 = 0xfb504f0; +MEM_U8(t7 + 0) = (uint8_t)t6; +t8 = MEM_U32(sp + 2096); +t9 = MEM_U32(sp + 2100); +t1 = t8 + 0x1; +MEM_U32(sp + 2096) = t1; +t3 = MEM_U32(sp + 2096); +t0 = t9 + 0x1; +MEM_U32(sp + 2100) = t0; +t2 = MEM_U8(t3 + 0); +//nop; +t5 = t2 + t4; +t6 = MEM_U8(t5 + 1); +//nop; +t7 = t6 & 0x4; +if (t7 == 0) {//nop; +goto L4330c0;} +//nop; +t9 = MEM_U32(sp + 2100); +t0 = MEM_U32(sp + 2112); +//nop; +t8 = t9 - t0; +at = (int)t8 < (int)0xb; +if (at != 0) {//nop; +goto L432e94;} +//nop; +//nop; +goto L4330c0; +//nop; +L432f08: +t1 = MEM_U32(sp + 2096); +t2 = MEM_U32(sp + 2104); +t4 = sp + 0x30; +t3 = t1 + 0x1; +t5 = t2 + t4; +at = t3 < t5; +if (at != 0) {MEM_U32(sp + 2096) = t3; +goto L432e24;} +MEM_U32(sp + 2096) = t3; +//nop; +goto L4330c0; +//nop; +L432f30: +t7 = MEM_U32(sp + 2104); +t6 = sp + 0x30; +t9 = t7 + t6; +at = t6 < t9; +if (at == 0) {MEM_U32(sp + 2096) = t6; +goto L432fa0;} +MEM_U32(sp + 2096) = t6; +L432f48: +a1 = 0x1000664c; +//nop; +a0 = MEM_U32(sp + 2096); +a2 = 0x6; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L432f60; +a1 = a1; +L432f60: +// bdead 4000000b gp = MEM_U32(sp + 32); +if (v0 != 0) {//nop; +goto L432f80;} +//nop; +t0 = MEM_U32(sp + 2096); +//nop; +t8 = t0 + 0x6; +MEM_U32(sp + 2096) = t8; +goto L432fa0; +MEM_U32(sp + 2096) = t8; +L432f80: +t1 = MEM_U32(sp + 2096); +t4 = MEM_U32(sp + 2104); +t3 = sp + 0x30; +t2 = t1 + 0x1; +t5 = t4 + t3; +at = t2 < t5; +if (at != 0) {MEM_U32(sp + 2096) = t2; +goto L432f48;} +MEM_U32(sp + 2096) = t2; +L432fa0: +t6 = MEM_U32(sp + 2104); +t7 = MEM_U32(sp + 2096); +t9 = sp + 0x30; +t0 = t6 + t9; +at = t7 < t0; +if (at == 0) {//nop; +goto L4330c0;} +//nop; +L432fbc: +a1 = 0x10006654; +//nop; +a0 = MEM_U32(sp + 2096); +a2 = 0x6; +a1 = a1; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L432fd4; +a1 = a1; +L432fd4: +// bdead 4000000b gp = MEM_U32(sp + 32); +if (v0 != 0) {//nop; +goto L4330a0;} +//nop; +t8 = MEM_U32(sp + 2096); +t3 = 0xfb504f0; +t1 = t8 + 0x6; +MEM_U32(sp + 2096) = t1; +t4 = MEM_U8(t1 + 0); +//nop; +t2 = t4 + t3; +t5 = MEM_U8(t2 + 1); +//nop; +t6 = t5 & 0x4; +if (t6 == 0) {//nop; +goto L4330c0;} +//nop; +t9 = MEM_U32(sp + 2100); +t7 = MEM_U32(sp + 2112); +//nop; +t0 = t9 - t7; +at = (int)t0 < (int)0xb; +if (at == 0) {//nop; +goto L4330c0;} +//nop; +L43302c: +t8 = MEM_U32(sp + 2096); +t4 = MEM_U32(sp + 2100); +t1 = MEM_U8(t8 + 0); +t0 = 0xfb504f0; +MEM_U8(t4 + 0) = (uint8_t)t1; +t5 = MEM_U32(sp + 2096); +t3 = MEM_U32(sp + 2100); +t6 = t5 + 0x1; +MEM_U32(sp + 2096) = t6; +t9 = MEM_U32(sp + 2096); +t2 = t3 + 0x1; +MEM_U32(sp + 2100) = t2; +t7 = MEM_U8(t9 + 0); +//nop; +t8 = t7 + t0; +t1 = MEM_U8(t8 + 1); +//nop; +t4 = t1 & 0x4; +if (t4 == 0) {//nop; +goto L4330c0;} +//nop; +t3 = MEM_U32(sp + 2100); +t2 = MEM_U32(sp + 2112); +//nop; +t5 = t3 - t2; +at = (int)t5 < (int)0xb; +if (at != 0) {//nop; +goto L43302c;} +//nop; +//nop; +goto L4330c0; +//nop; +L4330a0: +t6 = MEM_U32(sp + 2096); +t7 = MEM_U32(sp + 2104); +t0 = sp + 0x30; +t9 = t6 + 0x1; +t8 = t7 + t0; +at = t9 < t8; +if (at != 0) {MEM_U32(sp + 2096) = t9; +goto L432fbc;} +MEM_U32(sp + 2096) = t9; +L4330c0: +t4 = MEM_U32(sp + 2112); +t1 = MEM_U32(sp + 2100); +t3 = t4 + 0x1; +at = t3 < t1; +if (at == 0) {//nop; +goto L4330e0;} +//nop; +MEM_U8(t1 + 0) = (uint8_t)zero; +goto L4330f8; +MEM_U8(t1 + 0) = (uint8_t)zero; +L4330e0: +t5 = MEM_U32(sp + 2100); +t2 = 0x31; +MEM_U8(t5 + 0) = (uint8_t)t2; +t6 = MEM_U32(sp + 2100); +//nop; +MEM_U8(t6 + 1) = (uint8_t)zero; +L4330f8: +// bdead 1 ra = MEM_U32(sp + 36); +// bdead 1 s0 = MEM_U32(sp + 24); +// bdead 1 s1 = MEM_U32(sp + 28); +// bdead 1 sp = sp + 0x840; +return; +// bdead 1 sp = sp + 0x840; +} + +static void f_show_err(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43310c: +//show_err: +//nop; +//nop; +//nop; +at = 0x10000; +at = at | 0x28; +sp = sp - at; +at = 0x10000; +at = at + sp; +// fdead 4000002f MEM_U32(sp + 28) = ra; +// fdead 4000002f MEM_U32(sp + 24) = gp; +MEM_U32(at + 40) = a0; +a0 = 0x10000; +//nop; +a0 = a0 + sp; +a0 = MEM_U32(a0 + 40); +a1 = zero; +v0 = wrapper_open(mem, a0, a1, a2); +goto L433150; +a1 = zero; +L433150: +// bdead 4000000b gp = MEM_U32(sp + 24); +at = 0x10000; +at = at + sp; +MEM_U32(at + 36) = v0; +a0 = 0x10000; +//nop; +a0 = a0 + sp; +a0 = MEM_U32(a0 + 36); +a1 = sp + 0x20; +a2 = 0x10000; +v0 = wrapper_read(mem, a0, a1, a2); +goto L43317c; +a2 = 0x10000; +L43317c: +// bdead 4000000b gp = MEM_U32(sp + 24); +at = 0x10000; +at = at + sp; +MEM_U32(at + 32) = v0; +a0 = 0x10000; +//nop; +a0 = a0 + sp; +a0 = MEM_U32(a0 + 36); +//nop; +v0 = wrapper_close(mem, a0); +goto L4331a4; +//nop; +L4331a4: +t6 = 0x10000; +t6 = t6 + sp; +t6 = MEM_U32(t6 + 32); +at = 0x10000; +// bdead 40008107 gp = MEM_U32(sp + 24); +at = (int)t6 < (int)at; +if (at == 0) {//nop; +goto L4331d4;} +//nop; +t7 = sp + 0x20; +t8 = t6 + t7; +MEM_U8(t8 + 0) = (uint8_t)zero; +goto L4331e4; +MEM_U8(t8 + 0) = (uint8_t)zero; +L4331d4: +t9 = sp + 0x20; +at = 0x10000; +at = at + t9; +MEM_U8(at + -1) = (uint8_t)zero; +L4331e4: +a0 = 0xfb528e4; +a1 = 0x1000665c; +//nop; +a2 = sp + 0x20; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L433200; +a1 = a1; +L433200: +// bdead 1 ra = MEM_U32(sp + 28); +// bdead 1 at = 0x10000; +// bdead 1 gp = MEM_U32(sp + 24); +// bdead 1 at = at | 0x28; +// bdead 1 sp = sp + at; +return; +// bdead 1 sp = sp + at; +} + +static void f_handler(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L433218: +//handler: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +// fdead 400001e3 MEM_U32(sp + 28) = ra; +// fdead 400001e3 MEM_U32(sp + 24) = gp; +f_cleanup(mem, sp); +goto L433238; +// fdead 400001e3 MEM_U32(sp + 24) = gp; +L433238: +// bdead 40000001 gp = MEM_U32(sp + 24); +a0 = 0x3; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L433250; +//nop; +L433250: +// bdead 19 ra = MEM_U32(sp + 28); +// bdead 19 gp = MEM_U32(sp + 24); +// bdead 19 sp = sp + 0x20; +return; +// bdead 19 sp = sp + 0x20; +} + +static void f_cleanup(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L433260: +//cleanup: +//nop; +//nop; +//nop; +t6 = 0x10000240; +sp = sp + 0xffffffd8; +t6 = MEM_U32(t6 + 0); +// fdead 400081eb MEM_U32(sp + 28) = ra; +if (t6 != 0) {// fdead 400081eb MEM_U32(sp + 24) = gp; +goto L43363c;} +// fdead 400081eb MEM_U32(sp + 24) = gp; +t7 = 0x1000a1f4; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L4332b4;} +//nop; +//nop; +a0 = t7; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4332ac; +//nop; +L4332ac: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L4332b4: +t8 = 0x1000a1f0; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L433344;} +//nop; +//nop; +a0 = t8; +//nop; +v0 = f_getsuf(mem, sp, a0); +goto L4332dc; +//nop; +L4332dc: +MEM_U8(sp + 39) = (uint8_t)v0; +t9 = MEM_U8(sp + 39); +// bdead 44000001 gp = MEM_U32(sp + 24); +if (t9 == 0) {//nop; +goto L433310;} +//nop; +t0 = 0x1000a24c; +//nop; +t0 = MEM_U8(t0 + 0); +//nop; +if (t9 == t0) {at = 0x6d; +goto L433344;} +at = 0x6d; +if (t9 == at) {//nop; +goto L433344;} +//nop; +L433310: +t1 = 0x10000214; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L433344;} +//nop; +a0 = 0x1000a1f0; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L43333c; +//nop; +L43333c: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L433344: +t2 = 0x1000a250; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L43338c;} +//nop; +t3 = 0x1000a1fc; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L43338c;} +//nop; +//nop; +a0 = t3; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L433384; +//nop; +L433384: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L43338c: +t4 = 0x1000a218; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L4333bc;} +//nop; +//nop; +a0 = t4; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4333b4; +//nop; +L4333b4: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L4333bc: +t5 = 0x1000a21c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L4333ec;} +//nop; +//nop; +a0 = t5; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4333e4; +//nop; +L4333e4: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L4333ec: +t6 = 0x1000a224; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L43341c;} +//nop; +//nop; +a0 = t6; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L433414; +//nop; +L433414: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L43341c: +t7 = 0x1000a220; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L43344c;} +//nop; +//nop; +a0 = t7; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L433444; +//nop; +L433444: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L43344c: +t8 = 0x1000a200; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L43347c;} +//nop; +//nop; +a0 = t8; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L433474; +//nop; +L433474: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L43347c: +t0 = 0x1000a204; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L4334ac;} +//nop; +//nop; +a0 = t0; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4334a4; +//nop; +L4334a4: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L4334ac: +t9 = 0x1000a208; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L4334e0;} +//nop; +a0 = t9; +//nop; +//nop; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4334d8; +//nop; +L4334d8: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L4334e0: +t1 = 0x1000a20c; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L433510;} +//nop; +//nop; +a0 = t1; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L433508; +//nop; +L433508: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L433510: +t2 = 0x1000a210; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L433540;} +//nop; +//nop; +a0 = t2; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L433538; +//nop; +L433538: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L433540: +t3 = 0x1000a228; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L433570;} +//nop; +//nop; +a0 = t3; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L433568; +//nop; +L433568: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L433570: +t4 = 0x10000410; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L4335a0;} +//nop; +//nop; +a0 = t4; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L433598; +//nop; +L433598: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L4335a0: +t5 = 0x100002a8; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L433608;} +//nop; +a0 = 0x1000a1f8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4335cc; +//nop; +L4335cc: +// bdead 40000001 gp = MEM_U32(sp + 24); +at = 0x2; +t6 = 0x100002a8; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L433608;} +//nop; +t7 = 0x1000a380; +//nop; +a0 = MEM_U32(t7 + 100); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L433600; +//nop; +L433600: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L433608: +t8 = 0x1000a36c; +at = 0x1; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L43363c;} +//nop; +t0 = 0x1000a380; +//nop; +a0 = MEM_U32(t0 + 132); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L433634; +//nop; +L433634: +// bdead 1 gp = MEM_U32(sp + 24); +//nop; +L43363c: +// bdead 1 ra = MEM_U32(sp + 28); +// bdead 1 sp = sp + 0x28; +//nop; +return; +//nop; +} + +static void f_whats(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43364c: +//whats: +//nop; +//nop; +//nop; +t6 = 0x10000404; +t7 = 0x1000a36c; +t6 = MEM_U32(t6 + 0); +t7 = MEM_U32(t7 + 0); +sp = sp + 0xffffffd8; +at = 0x2; +// fdead 4001800f MEM_U32(sp + 28) = ra; +// fdead 4001800f MEM_U32(sp + 24) = gp; +if (t7 != at) {MEM_U32(sp + 36) = t6; +goto L4336ac;} +MEM_U32(sp + 36) = t6; +a1 = 0x1000a31c; +a0 = 0x10006660; +a2 = 0x1000666c; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +a2 = a2; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_printf(mem, a0, sp); +goto L4336a0; +a2 = a2; +L4336a0: +// bdead 40000101 gp = MEM_U32(sp + 24); +//nop; +goto L4337e4; +//nop; +L4336ac: +t8 = 0x1000a36c; +at = 0x4; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L4336f0;} +//nop; +a1 = 0x1000a31c; +a0 = 0x10006670; +a2 = 0x1000667c; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +a2 = a2; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_printf(mem, a0, sp); +goto L4336e4; +a2 = a2; +L4336e4: +// bdead 40000101 gp = MEM_U32(sp + 24); +//nop; +goto L4337e4; +//nop; +L4336f0: +t9 = 0x1000a36c; +at = 0x3; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L433734;} +//nop; +a1 = 0x1000a31c; +a0 = 0x10006680; +a2 = 0x1000668c; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +a2 = a2; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_printf(mem, a0, sp); +goto L433728; +a2 = a2; +L433728: +// bdead 40000101 gp = MEM_U32(sp + 24); +//nop; +goto L4337e4; +//nop; +L433734: +t0 = 0x1000a36c; +at = 0x5; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L433778;} +//nop; +a1 = 0x1000a31c; +a0 = 0x10006690; +a2 = 0x1000669c; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +a2 = a2; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_printf(mem, a0, sp); +goto L43376c; +a2 = a2; +L43376c: +// bdead 40000101 gp = MEM_U32(sp + 24); +//nop; +goto L4337e4; +//nop; +L433778: +t1 = 0x1000a36c; +at = 0x6; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L4337bc;} +//nop; +a1 = 0x1000a31c; +a0 = 0x100066a0; +a2 = 0x100066ac; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +a2 = a2; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_printf(mem, a0, sp); +goto L4337b0; +a2 = a2; +L4337b0: +// bdead 40000101 gp = MEM_U32(sp + 24); +//nop; +goto L4337e4; +//nop; +L4337bc: +a1 = 0x1000a31c; +a0 = 0x100066b4; +a2 = 0x100066c0; +//nop; +a1 = MEM_U32(a1 + 0); +a0 = a0; +a2 = a2; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_printf(mem, a0, sp); +goto L4337dc; +a2 = a2; +L4337dc: +// bdead 40000101 gp = MEM_U32(sp + 24); +//nop; +L4337e4: +a0 = 0x100066c4; +//nop; +a1 = 0x3; +a2 = 0x13; +a0 = a0; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_printf(mem, a0, sp); +goto L4337fc; +a0 = a0; +L4337fc: +// bdead 1 ra = MEM_U32(sp + 28); +// bdead 1 gp = MEM_U32(sp + 24); +// bdead 1 sp = sp + 0x28; +return; +// bdead 1 sp = sp + 0x28; +} + +static void f_settimes(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43380c: +//settimes: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +// fdead 4000000b MEM_U32(sp + 28) = ra; +a0 = 0x10009c18; +// fdead 4000002b MEM_U32(sp + 24) = gp; +v0 = wrapper_times(mem, a0); +goto L433830; +// fdead 4000002b MEM_U32(sp + 24) = gp; +L433830: +// bdead 9 gp = MEM_U32(sp + 24); +// bdead 9 ra = MEM_U32(sp + 28); +at = 0x10009c10; +// bdead d sp = sp + 0x20; +MEM_U32(at + 0) = v0; +return; +MEM_U32(at + 0) = v0; +} + +static void f_dotime(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L433848: +//dotime: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffff90; +// fdead 4000000b MEM_U32(sp + 60) = ra; +// fdead 4000000b MEM_U32(sp + 56) = gp; +a0 = sp + 0x40; +v0 = wrapper_times(mem, a0); +goto L43386c; +a0 = sp + 0x40; +L43386c: +// bdead 4000000b gp = MEM_U32(sp + 56); +t6 = MEM_U32(sp + 64); +t9 = 0x10009c18; +t7 = MEM_U32(sp + 72); +t1 = 0x10009c18; +t9 = MEM_U32(t9 + 0); +t1 = MEM_U32(t1 + 8); +t8 = t6 + t7; +t0 = t8 - t9; +t2 = t0 - t1; +t1 = 0x10009c10; +MEM_U32(sp + 108) = v0; +t0 = MEM_U32(sp + 108); +t1 = MEM_U32(t1 + 0); +f4.w[0] = t2; +t3 = MEM_U32(sp + 68); +t4 = MEM_U32(sp + 76); +at = 0x40590000; +t2 = t0 - t1; +MEM_U32(sp + 104) = t2; +t5 = t3 + t4; +f8.w[1] = at; +f4.w[1] = at; +t3 = MEM_U32(sp + 104); +at = 0x1770; +lo = (int)t3 / (int)at; hi = (int)t3 % (int)at; +t6 = 0x10009c18; +t8 = 0x10009c18; +t6 = MEM_U32(t6 + 4); +t8 = MEM_U32(t8 + 12); +t7 = t5 - t6; +t5 = MEM_U32(sp + 104); +t9 = t7 - t8; +f6.d = (int)f4.w[0]; +f16.w[0] = t9; +f8.w[0] = zero; +f18.d = (int)f16.w[0]; +f4.w[0] = zero; +t7 = MEM_U32(sp + 104); +f10.d = f6.d / f8.d; +//nop; +a0 = 0xfb528e4; +a1 = 0x100066e4; +a0 = a0 + 0x20; +a1 = a1; +f6.d = f18.d / f4.d; +f18.w[0] = zero; +t4 = lo; +MEM_U32(sp + 92) = f10.w[0]; +MEM_U32(sp + 88) = f10.w[1]; +lo = (int)t5 / (int)at; hi = (int)t5 % (int)at; +at = 0x40590000; +f18.w[1] = at; +a3 = f10.w[0]; +a2 = f10.w[1]; +MEM_U32(sp + 24) = t4; +MEM_U32(sp + 84) = f6.w[0]; +MEM_U32(sp + 80) = f6.w[1]; +MEM_U32(sp + 20) = f6.w[0]; +MEM_U32(sp + 16) = f6.w[1]; +t6 = hi; +f8.w[0] = t6; +//nop; +f16.d = (int)f8.w[0]; +//nop; +f4.d = f16.d / f18.d; +f16.w[0] = t7; +f8.d = f10.d + f6.d; +f16.w[1] = at; +f18.d = (int)f16.w[0]; +f16.w[0] = zero; +MEM_U32(sp + 36) = f4.w[0]; +MEM_U32(sp + 32) = f4.w[1]; +f4.w[1] = at; +f4.w[0] = zero; +//nop; +f10.d = f18.d / f4.d; +//nop; +f6.d = f8.d / f10.d; +f18.d = f6.d * f16.d; +MEM_U32(sp + 44) = f18.w[0]; +MEM_U32(sp + 40) = f18.w[1]; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L4339b8; +MEM_U32(sp + 40) = f18.w[1]; +L4339b8: +// bdead 1 ra = MEM_U32(sp + 60); +// bdead 1 gp = MEM_U32(sp + 56); +// bdead 1 sp = sp + 0x70; +return; +// bdead 1 sp = sp + 0x70; +} + +static uint32_t func_4339c8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4339c8: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 60) = a1; +t6 = MEM_U32(sp + 60); +// fdead 4000806b MEM_U32(sp + 36) = ra; +// fdead 4000806b MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a0; +// fdead 4000806b MEM_U32(sp + 28) = s0; +t7 = MEM_U32(t6 + 0); +//nop; +if (t7 == 0) {//nop; +goto L433b48;} +//nop; +L433a00: +t8 = 0x1000a36c; +at = 0x1; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L433ab4;} +//nop; +t9 = 0x10000008; +at = 0x2; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == at) {at = 0x3; +goto L433a38;} +at = 0x3; +if (t9 != at) {//nop; +goto L433ab4;} +//nop; +L433a38: +t0 = MEM_U32(sp + 60); +a2 = 0x10000428; +a1 = 0x10006704; +//nop; +a3 = MEM_U32(sp + 56); +a0 = MEM_U32(t0 + 0); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 16) = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L433a60; +a1 = a1; +L433a60: +// bdead 4000000b gp = MEM_U32(sp + 32); +s0 = v0; +//nop; +MEM_U32(sp + 48) = s0; +a0 = MEM_U32(sp + 48); +a1 = zero; +a2 = zero; +v0 = wrapper_open(mem, a0, a1, a2); +goto L433a80; +a2 = zero; +L433a80: +MEM_U32(sp + 52) = v0; +t1 = MEM_U32(sp + 52); +// bdead 40000403 gp = MEM_U32(sp + 32); +if ((int)t1 < 0) {//nop; +goto L433ab4;} +//nop; +//nop; +a0 = t1; +//nop; +v0 = wrapper_close(mem, a0); +goto L433aa4; +//nop; +L433aa4: +// bdead 40000001 gp = MEM_U32(sp + 32); +v0 = MEM_U32(sp + 48); +//nop; +goto L433c18; +//nop; +L433ab4: +t2 = MEM_U32(sp + 60); +a1 = 0x10000428; +//nop; +a2 = MEM_U32(sp + 56); +a0 = MEM_U32(t2 + 0); +a1 = MEM_U32(a1 + 0); +a3 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L433ad4; +a3 = zero; +L433ad4: +// bdead 4000000b gp = MEM_U32(sp + 32); +s0 = v0; +//nop; +MEM_U32(sp + 48) = s0; +a0 = MEM_U32(sp + 48); +a1 = zero; +a2 = zero; +v0 = wrapper_open(mem, a0, a1, a2); +goto L433af4; +a2 = zero; +L433af4: +MEM_U32(sp + 52) = v0; +t3 = MEM_U32(sp + 52); +// bdead 40001003 gp = MEM_U32(sp + 32); +if ((int)t3 < 0) {//nop; +goto L433b28;} +//nop; +//nop; +a0 = t3; +//nop; +v0 = wrapper_close(mem, a0); +goto L433b18; +//nop; +L433b18: +// bdead 40000001 gp = MEM_U32(sp + 32); +v0 = MEM_U32(sp + 48); +//nop; +goto L433c18; +//nop; +L433b28: +t4 = MEM_U32(sp + 60); +//nop; +t5 = t4 + 0x4; +MEM_U32(sp + 60) = t5; +t6 = MEM_U32(t5 + 0); +//nop; +if (t6 != 0) {//nop; +goto L433a00;} +//nop; +L433b48: +t7 = 0x1000037c; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L433b94;} +//nop; +a2 = 0x10000428; +a0 = 0x1000670c; +a1 = 0x10006710; +//nop; +a3 = MEM_U32(sp + 56); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 16) = zero; +a0 = a0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L433b88; +a1 = a1; +L433b88: +// bdead 40000009 gp = MEM_U32(sp + 32); +MEM_U32(sp + 48) = v0; +goto L433c10; +MEM_U32(sp + 48) = v0; +L433b94: +t8 = 0x10000324; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L433be0;} +//nop; +a2 = 0x10000428; +a0 = 0x1000671c; +a1 = 0x10006720; +//nop; +a3 = MEM_U32(sp + 56); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 16) = zero; +a0 = a0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L433bd4; +a1 = a1; +L433bd4: +// bdead 40000009 gp = MEM_U32(sp + 32); +MEM_U32(sp + 48) = v0; +goto L433c10; +MEM_U32(sp + 48) = v0; +L433be0: +a2 = 0x10000428; +a0 = 0x10006734; +a1 = 0x10006738; +//nop; +a3 = MEM_U32(sp + 56); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 16) = zero; +a0 = a0; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L433c08; +a1 = a1; +L433c08: +// bdead 40000009 gp = MEM_U32(sp + 32); +MEM_U32(sp + 48) = v0; +L433c10: +v0 = MEM_U32(sp + 48); +//nop; +L433c18: +// bdead 9 ra = MEM_U32(sp + 36); +// bdead 9 s0 = MEM_U32(sp + 28); +// bdead 9 sp = sp + 0x38; +return v0; +// bdead 9 sp = sp + 0x38; +} + +static uint32_t f_isdir(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L433c28: +//isdir: +//nop; +//nop; +//nop; +sp = sp + 0xffffff50; +//nop; +MEM_U32(sp + 176) = a0; +// fdead 4000002b MEM_U32(sp + 28) = ra; +a0 = MEM_U32(sp + 176); +// fdead 4000002b MEM_U32(sp + 24) = gp; +a1 = sp + 0x24; +v0 = wrapper_stat(mem, a0, a1); +goto L433c54; +a1 = sp + 0x24; +L433c54: +MEM_U32(sp + 172) = v0; +t6 = MEM_U32(sp + 172); +// bdead 40008003 gp = MEM_U32(sp + 24); +at = 0xffffffff; +if (t6 != at) {//nop; +goto L433c74;} +//nop; +v0 = zero; +goto L433c94; +v0 = zero; +L433c74: +t7 = MEM_U32(sp + 56); +at = 0x4000; +t8 = t7 & 0xf000; +if (t8 != at) {//nop; +goto L433c90;} +//nop; +v0 = 0x1; +goto L433c94; +v0 = 0x1; +L433c90: +v0 = zero; +L433c94: +// bdead 9 ra = MEM_U32(sp + 28); +// bdead 9 sp = sp + 0xb0; +//nop; +return v0; +//nop; +} + +static uint32_t f_regular_not_writeable(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L433ca4: +//regular_not_writeable: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 40) = a0; +// fdead 4000002b MEM_U32(sp + 28) = ra; +a0 = MEM_U32(sp + 40); +// fdead 4000002b MEM_U32(sp + 24) = gp; +v0 = f_regular_file(mem, sp, a0); +goto L433ccc; +// fdead 4000002b MEM_U32(sp + 24) = gp; +L433ccc: +// bdead 4000000b gp = MEM_U32(sp + 24); +at = 0x1; +if (v0 == at) {//nop; +goto L433ce4;} +//nop; +v0 = zero; +goto L433d2c; +v0 = zero; +L433ce4: +//nop; +a0 = MEM_U32(sp + 40); +a1 = 0x2; +a2 = 0x1b6; +v0 = wrapper_open(mem, a0, a1, a2); +goto L433cf8; +a2 = 0x1b6; +L433cf8: +MEM_U32(sp + 36) = v0; +t6 = MEM_U32(sp + 36); +// bdead 40008003 gp = MEM_U32(sp + 24); +if ((int)t6 < 0) {//nop; +goto L433d28;} +//nop; +//nop; +a0 = t6; +//nop; +v0 = wrapper_close(mem, a0); +goto L433d1c; +//nop; +L433d1c: +// bdead 3 gp = MEM_U32(sp + 24); +v0 = zero; +goto L433d2c; +v0 = zero; +L433d28: +v0 = 0x1; +L433d2c: +// bdead 9 ra = MEM_U32(sp + 28); +// bdead 9 sp = sp + 0x28; +//nop; +return v0; +//nop; +} + +static uint32_t f_regular_file(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L433d3c: +//regular_file: +//nop; +//nop; +//nop; +sp = sp + 0xffffff50; +//nop; +MEM_U32(sp + 176) = a0; +// fdead 4000002b MEM_U32(sp + 28) = ra; +a0 = MEM_U32(sp + 176); +// fdead 4000002b MEM_U32(sp + 24) = gp; +a1 = sp + 0x24; +v0 = wrapper_stat(mem, a0, a1); +goto L433d68; +a1 = sp + 0x24; +L433d68: +MEM_U32(sp + 172) = v0; +t6 = MEM_U32(sp + 172); +// bdead 40008003 gp = MEM_U32(sp + 24); +at = 0xffffffff; +if (t6 != at) {//nop; +goto L433d88;} +//nop; +v0 = 0xffffffff; +goto L433da8; +v0 = 0xffffffff; +L433d88: +t7 = MEM_U32(sp + 56); +at = 0x8000; +t8 = t7 & 0xf000; +if (t8 == at) {//nop; +goto L433da4;} +//nop; +v0 = zero; +goto L433da8; +v0 = zero; +L433da4: +v0 = 0x1; +L433da8: +// bdead 9 ra = MEM_U32(sp + 28); +// bdead 9 sp = sp + 0xb0; +//nop; +return v0; +//nop; +} + +static uint32_t f_basename(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L433db8: +//basename: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 56) = a0; +// fdead 4000002b MEM_U32(sp + 24) = s1; +s1 = 0x10009d28; +t6 = MEM_U32(sp + 56); +// fdead 4004802b MEM_U32(sp + 36) = ra; +// fdead 4004802b MEM_U32(sp + 32) = gp; +// fdead 4004802b MEM_U32(sp + 28) = s2; +// fdead 4004802b MEM_U32(sp + 20) = s0; +if (t6 == 0) {s1 = s1; +goto L433e00;} +s1 = s1; +t7 = MEM_U8(t6 + 0); +//nop; +if (t7 != 0) {//nop; +goto L433e24;} +//nop; +L433e00: +t8 = 0x10006740; +v0 = s1; +t8 = t8; +at = MEM_U8(t8 + 0); +//nop; +MEM_U8(v0 + 0) = (uint8_t)at; +t0 = MEM_U8(t8 + 1); +MEM_U8(v0 + 1) = (uint8_t)t0; +goto L433eb8; +MEM_U8(v0 + 1) = (uint8_t)t0; +L433e24: +//nop; +a1 = MEM_U32(sp + 56); +a0 = s1; +v0 = wrapper_strcpy(mem, a0, a1); +goto L433e34; +a0 = s1; +L433e34: +// bdead 4004000b gp = MEM_U32(sp + 32); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L433e4c; +//nop; +L433e4c: +s2 = v0; +s0 = s0 + s2; +// bdead 60003 gp = MEM_U32(sp + 32); +if (s0 == s1) {//nop; +goto L433e88;} +//nop; +t1 = MEM_U8(s0 + -1); +at = 0x2f; +if (t1 != at) {s0 = s0 + 0xffffffff; +goto L433e88;} +s0 = s0 + 0xffffffff; +L433e70: +if (s0 == s1) {MEM_U8(s0 + 0) = (uint8_t)zero; +goto L433e88;} +MEM_U8(s0 + 0) = (uint8_t)zero; +t2 = MEM_U8(s0 + -1); +at = 0x2f; +if (t2 == at) {s0 = s0 + 0xffffffff; +goto L433e70;} +s0 = s0 + 0xffffffff; +L433e88: +if (s0 == s1) {//nop; +goto L433eb4;} +//nop; +L433e90: +t3 = MEM_U8(s0 + -1); +at = 0x2f; +if (t3 != at) {s0 = s0 + 0xffffffff; +goto L433eac;} +s0 = s0 + 0xffffffff; +s0 = s0 + 0x1; +v0 = s0; +goto L433eb8; +v0 = s0; +L433eac: +if (s0 != s1) {//nop; +goto L433e90;} +//nop; +L433eb4: +v0 = s0; +L433eb8: +// bdead 9 ra = MEM_U32(sp + 36); +// bdead 9 s0 = MEM_U32(sp + 20); +// bdead 9 s1 = MEM_U32(sp + 24); +// bdead 9 s2 = MEM_U32(sp + 28); +// bdead 9 sp = sp + 0x38; +return v0; +// bdead 9 sp = sp + 0x38; +} + +static uint32_t f_dirname(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L433ed0: +//dirname: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 56) = a0; +// fdead 4000002b MEM_U32(sp + 24) = s1; +s1 = 0x10009d28; +t6 = MEM_U32(sp + 56); +// fdead 4004802b MEM_U32(sp + 36) = ra; +// fdead 4004802b MEM_U32(sp + 32) = gp; +// fdead 4004802b MEM_U32(sp + 28) = s2; +// fdead 4004802b MEM_U32(sp + 20) = s0; +if (t6 == 0) {s1 = s1; +goto L433f18;} +s1 = s1; +t7 = MEM_U8(t6 + 0); +//nop; +if (t7 != 0) {//nop; +goto L433f3c;} +//nop; +L433f18: +t8 = 0x10006744; +v0 = s1; +t8 = t8; +at = MEM_U8(t8 + 0); +//nop; +MEM_U8(v0 + 0) = (uint8_t)at; +t0 = MEM_U8(t8 + 1); +MEM_U8(v0 + 1) = (uint8_t)t0; +goto L43407c; +MEM_U8(v0 + 1) = (uint8_t)t0; +L433f3c: +//nop; +a1 = MEM_U32(sp + 56); +a0 = s1; +v0 = wrapper_strcpy(mem, a0, a1); +goto L433f4c; +a0 = s1; +L433f4c: +// bdead 4004000b gp = MEM_U32(sp + 32); +s0 = v0; +//nop; +a0 = s0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L433f64; +//nop; +L433f64: +s2 = v0; +s0 = s0 + s2; +// bdead 60003 gp = MEM_U32(sp + 32); +if (s0 == s1) {//nop; +goto L433fa0;} +//nop; +t1 = MEM_U8(s0 + -1); +at = 0x2f; +if (t1 != at) {s0 = s0 + 0xffffffff; +goto L433fa0;} +s0 = s0 + 0xffffffff; +L433f88: +if (s0 == s1) {//nop; +goto L433fa0;} +//nop; +t2 = MEM_U8(s0 + -1); +at = 0x2f; +if (t2 == at) {s0 = s0 + 0xffffffff; +goto L433f88;} +s0 = s0 + 0xffffffff; +L433fa0: +if (s0 != s1) {//nop; +goto L433fdc;} +//nop; +t3 = MEM_U8(s0 + 0); +at = 0x2f; +if (t3 != at) {//nop; +goto L433fdc;} +//nop; +t4 = 0x10006748; +v0 = s1; +t4 = t4; +at = MEM_U8(t4 + 0); +//nop; +MEM_U8(v0 + 0) = (uint8_t)at; +t6 = MEM_U8(t4 + 1); +MEM_U8(v0 + 1) = (uint8_t)t6; +goto L43407c; +MEM_U8(v0 + 1) = (uint8_t)t6; +L433fdc: +if (s0 == s1) {//nop; +goto L434058;} +//nop; +L433fe4: +t7 = MEM_U8(s0 + -1); +at = 0x2f; +if (t7 != at) {s0 = s0 + 0xffffffff; +goto L434050;} +s0 = s0 + 0xffffffff; +if (s0 != s1) {//nop; +goto L434020;} +//nop; +t9 = 0x1000674c; +v0 = s1; +t9 = t9; +at = MEM_U8(t9 + 0); +//nop; +MEM_U8(v0 + 0) = (uint8_t)at; +t0 = MEM_U8(t9 + 1); +MEM_U8(v0 + 1) = (uint8_t)t0; +goto L43407c; +MEM_U8(v0 + 1) = (uint8_t)t0; +L434020: +t1 = MEM_U8(s0 + 0); +at = 0x2f; +if (t1 != at) {//nop; +goto L434040;} +//nop; +L434030: +t2 = MEM_U8(s0 + -1); +at = 0x2f; +if (t2 == at) {s0 = s0 + 0xffffffff; +goto L434030;} +s0 = s0 + 0xffffffff; +L434040: +s0 = s0 + 0x1; +MEM_U8(s0 + 0) = (uint8_t)zero; +v0 = s1; +goto L43407c; +v0 = s1; +L434050: +if (s0 != s1) {//nop; +goto L433fe4;} +//nop; +L434058: +t3 = 0x10006750; +v0 = s1; +t3 = t3; +at = MEM_U8(t3 + 0); +//nop; +MEM_U8(v0 + 0) = (uint8_t)at; +t4 = MEM_U8(t3 + 1); +//nop; +MEM_U8(v0 + 1) = (uint8_t)t4; +L43407c: +// bdead 9 ra = MEM_U32(sp + 36); +// bdead 9 s0 = MEM_U32(sp + 20); +// bdead 9 s1 = MEM_U32(sp + 24); +// bdead 9 s2 = MEM_U32(sp + 28); +// bdead 9 sp = sp + 0x38; +return v0; +// bdead 9 sp = sp + 0x38; +} + +static uint32_t func_434094(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L434094: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 52) = a1; +t6 = MEM_U32(sp + 52); +// fdead 4000806b MEM_U32(sp + 28) = ra; +// fdead 4000806b MEM_U32(sp + 24) = gp; +if (t6 == 0) {MEM_U32(sp + 48) = a0; +goto L4340c8;} +MEM_U32(sp + 48) = a0; +t7 = MEM_U32(sp + 48); +MEM_U32(sp + 36) = t7; +goto L4340f4; +MEM_U32(sp + 36) = t7; +L4340c8: +//nop; +a0 = MEM_U32(sp + 48); +a1 = 0x2f; +v0 = wrapper_strrchr(mem, a0, a1); +goto L4340d8; +a1 = 0x2f; +L4340d8: +MEM_U32(sp + 36) = v0; +t8 = MEM_U32(sp + 36); +// bdead 42000003 gp = MEM_U32(sp + 24); +if (t8 == 0) {//nop; +goto L4340f4;} +//nop; +t9 = t8 + 0x1; +MEM_U32(sp + 36) = t9; +L4340f4: +t0 = 0x14; +MEM_U32(sp + 40) = t0; +MEM_U32(sp + 44) = zero; +L434100: +t1 = MEM_U32(sp + 52); +//nop; +if (t1 == 0) {//nop; +goto L434134;} +//nop; +t2 = MEM_U32(sp + 44); +t4 = 0x10000460; +t3 = t2 << 2; +t3 = t3 - t2; +t3 = t3 << 2; +t5 = t3 + t4; +t6 = MEM_U32(t5 + 4); +MEM_U32(sp + 32) = t6; +goto L434158; +MEM_U32(sp + 32) = t6; +L434134: +t7 = MEM_U32(sp + 44); +t9 = 0x10000460; +t8 = t7 << 2; +t8 = t8 - t7; +t8 = t8 << 2; +t0 = t8 + t9; +t1 = MEM_U32(t0 + 0); +//nop; +MEM_U32(sp + 32) = t1; +L434158: +//nop; +a0 = MEM_U32(sp + 36); +a1 = MEM_U32(sp + 32); +//nop; +v0 = wrapper_strcmp(mem, a0, a1); +goto L43416c; +//nop; +L43416c: +// bdead 4000000b gp = MEM_U32(sp + 24); +if (v0 != 0) {//nop; +goto L43419c;} +//nop; +t2 = MEM_U32(sp + 44); +t4 = 0x10000460; +t3 = t2 << 2; +t3 = t3 - t2; +t3 = t3 << 2; +t5 = t3 + t4; +v0 = MEM_U32(t5 + 8); +//nop; +goto L4341b8; +//nop; +L43419c: +t6 = MEM_U32(sp + 44); +t8 = MEM_U32(sp + 40); +t7 = t6 + 0x1; +at = (int)t7 < (int)t8; +if (at != 0) {MEM_U32(sp + 44) = t7; +goto L434100;} +MEM_U32(sp + 44) = t7; +v0 = zero; +L4341b8: +// bdead 9 ra = MEM_U32(sp + 28); +// bdead 9 sp = sp + 0x30; +//nop; +return v0; +//nop; +} + +static void f_add_cxx_symbol_options(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4341c8: +//add_cxx_symbol_options: +//nop; +//nop; +//nop; +a1 = 0x10006a24; +//nop; +sp = sp + 0xffffffe0; +// fdead 4000004b MEM_U32(sp + 28) = ra; +a0 = 0x1000a560; +// fdead 4000006b MEM_U32(sp + 24) = gp; +a1 = a1; +f_addstr(mem, sp, a0, a1); +goto L4341f4; +a1 = a1; +L4341f4: +// bdead 1 ra = MEM_U32(sp + 28); +// bdead 1 gp = MEM_U32(sp + 24); +// bdead 1 sp = sp + 0x20; +// bdead 1 v0 = zero; +return; +// bdead 1 v0 = zero; +} + +static void f_init_curr_dir(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L434208: +//init_curr_dir: +//nop; +//nop; +//nop; +t6 = 0x10000558; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +// fdead 4000802b MEM_U32(sp + 28) = ra; +if (t6 != 0) {// fdead 4000802b MEM_U32(sp + 24) = gp; +goto L434290;} +// fdead 4000802b MEM_U32(sp + 24) = gp; +a0 = 0x1000a31c; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = 0x2f; +v0 = wrapper_strrchr(mem, a0, a1); +goto L434240; +a1 = 0x2f; +L434240: +// bdead 4000000b gp = MEM_U32(sp + 24); +//nop; +at = 0x10000558; +t7 = 0x10000558; +MEM_U32(at + 0) = v0; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L434278;} +//nop; +t8 = 0x1000a31c; +at = 0x10000558; +t8 = MEM_U32(t8 + 0); +MEM_U32(at + 0) = t8; +goto L434290; +MEM_U32(at + 0) = t8; +L434278: +t9 = 0x10000558; +at = 0x10000558; +t9 = MEM_U32(t9 + 0); +//nop; +t0 = t9 + 0x1; +MEM_U32(at + 0) = t0; +L434290: +t1 = 0x10000438; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L434350;} +//nop; +//nop; +a0 = zero; +a1 = 0x400; +v0 = wrapper_getcwd(mem, a0, a1); +goto L4342b8; +a1 = 0x400; +L4342b8: +// bdead 40000109 gp = MEM_U32(sp + 24); +//nop; +at = 0x10000438; +t2 = 0x10000438; +MEM_U32(at + 0) = v0; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L434350;} +//nop; +a2 = 0x10000558; +a0 = 0xfb528e4; +a1 = 0x10006a2c; +//nop; +a2 = MEM_U32(a2 + 0); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L4342fc; +a1 = a1; +L4342fc: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +a0 = 0x10006a34; +//nop; +a0 = a0; +//nop; +wrapper_perror(mem, a0); +goto L434318; +//nop; +L434318: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L434330; +//nop; +L434330: +// bdead 40000001 gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L434348; +//nop; +L434348: +// bdead 1 gp = MEM_U32(sp + 24); +//nop; +L434350: +// bdead 1 ra = MEM_U32(sp + 28); +// bdead 1 sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t f_full_path(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L434360: +//full_path: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +// fdead 4000002b MEM_U32(sp + 28) = ra; +// fdead 4000002b MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +f_init_curr_dir(mem, sp); +goto L434384; +MEM_U32(sp + 40) = a0; +L434384: +t6 = MEM_U32(sp + 40); +// bdead 40008183 gp = MEM_U32(sp + 24); +t7 = MEM_U8(t6 + 0); +at = 0x2f; +if (t7 != at) {//nop; +goto L4343b8;} +//nop; +//nop; +a0 = t6; +a1 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4343ac; +a1 = zero; +L4343ac: +// bdead 40000009 gp = MEM_U32(sp + 24); +MEM_U32(sp + 36) = v0; +goto L4343e0; +MEM_U32(sp + 36) = v0; +L4343b8: +a0 = 0x10000438; +a1 = 0x10006a40; +//nop; +a2 = MEM_U32(sp + 40); +a0 = MEM_U32(a0 + 0); +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4343d8; +a1 = a1; +L4343d8: +// bdead 40000009 gp = MEM_U32(sp + 24); +MEM_U32(sp + 36) = v0; +L4343e0: +// bdead 40000001 ra = MEM_U32(sp + 28); +v0 = MEM_U32(sp + 36); +// bdead 9 sp = sp + 0x28; +return v0; +// bdead 9 sp = sp + 0x28; +} + +static void f_add_static_opt(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4343f0: +//add_static_opt: +//nop; +//nop; +//nop; +t6 = 0x1000020c; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +// fdead 4000802b MEM_U32(sp + 28) = ra; +// fdead 4000802b MEM_U32(sp + 24) = gp; +if (t6 != 0) {MEM_U32(sp + 32) = a0; +goto L434434;} +MEM_U32(sp + 32) = a0; +//nop; +a0 = 0x1000a5f0; +a1 = MEM_U32(sp + 32); +//nop; +f_addstr(mem, sp, a0, a1); +goto L43442c; +//nop; +L43442c: +// bdead 1 gp = MEM_U32(sp + 24); +//nop; +L434434: +// bdead 1 ra = MEM_U32(sp + 28); +// bdead 1 sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void f_record_static_fileset(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L434444: +//record_static_fileset: +//nop; +//nop; +//nop; +sp = sp + 0xffffd718; +//nop; +// fdead 4000002b MEM_U32(sp + 44) = ra; +// fdead 4000002b MEM_U32(sp + 40) = gp; +MEM_U32(sp + 10472) = a0; +// fdead 4000002b MEM_U32(sp + 36) = s0; +v0 = wrapper_getpid(); +goto L43446c; +// fdead 4000002b MEM_U32(sp + 36) = s0; +L43446c: +// bdead 4000010b gp = MEM_U32(sp + 40); +s0 = v0; +a1 = 0x10006a44; +//nop; +a2 = s0; +a0 = sp + 0xbc; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_sprintf(mem, a0, a1, sp); +goto L43448c; +a1 = a1; +L43448c: +// bdead 40000183 gp = MEM_U32(sp + 40); +//nop; +t6 = 0x10000204; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L4344bc;} +//nop; +t7 = 0x10006a48; +at = 0x10000204; +t7 = t7; +MEM_U32(at + 0) = t7; +L4344bc: +t8 = 0x10000208; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L4344fc;} +//nop; +a0 = 0x10006a4c; +//nop; +a1 = zero; +a0 = a0; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4344e8; +a0 = a0; +L4344e8: +// bdead 4000018b gp = MEM_U32(sp + 40); +//nop; +at = 0x10000208; +//nop; +MEM_U32(at + 0) = v0; +L4344fc: +t9 = 0x10000208; +at = 0x2f; +t9 = MEM_U32(t9 + 0); +//nop; +t0 = MEM_U8(t9 + 0); +//nop; +if (t0 == at) {//nop; +goto L43453c;} +//nop; +t1 = 0x10000204; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +t2 = MEM_U8(t1 + 0); +//nop; +if (t2 != 0) {//nop; +goto L434564;} +//nop; +L43453c: +a0 = 0x10000208; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L434550; +a1 = zero; +L434550: +// bdead 4000000b gp = MEM_U32(sp + 40); +//nop; +at = 0x10000550; +MEM_U32(at + 0) = v0; +goto L434594; +MEM_U32(at + 0) = v0; +L434564: +a0 = 0x10000204; +a1 = 0x10000208; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 0); +a2 = zero; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L434580; +a2 = zero; +L434580: +// bdead 4000000b gp = MEM_U32(sp + 40); +//nop; +at = 0x10000550; +//nop; +MEM_U32(at + 0) = v0; +L434594: +a0 = 0x1000a2fc; +a1 = 0x10006a60; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = sp + 0xbc; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L4345b4; +a1 = a1; +L4345b4: +// bdead 4000000b gp = MEM_U32(sp + 40); +a0 = MEM_U32(sp + 10472); +at = 0x10000554; +//nop; +MEM_U32(at + 0) = v0; +//nop; +v0 = f_full_path(mem, sp, a0); +goto L4345d0; +//nop; +L4345d0: +// bdead 4000000b gp = MEM_U32(sp + 40); +MEM_U32(sp + 212) = v0; +//nop; +a0 = MEM_U32(sp + 212); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L4345e8; +//nop; +L4345e8: +// bdead 4000000b gp = MEM_U32(sp + 40); +MEM_U32(sp + 208) = v0; +t3 = 0x10000234; +//nop; +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L4346c0;} +//nop; +a3 = 0x10000558; +a0 = 0xfb528e4; +a1 = 0x10006a74; +//nop; +a2 = MEM_U32(sp + 212); +a3 = MEM_U32(a3 + 0); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L43462c; +a1 = a1; +L43462c: +// bdead 40000183 gp = MEM_U32(sp + 40); +MEM_U32(sp + 10468) = zero; +t4 = 0x1000a5f0; +//nop; +t4 = MEM_U32(t4 + 4); +//nop; +if ((int)t4 <= 0) {//nop; +goto L4346a0;} +//nop; +L43464c: +t5 = 0x1000a5f0; +t6 = MEM_U32(sp + 10468); +t5 = MEM_U32(t5 + 8); +t7 = t6 << 2; +a0 = 0xfb528e4; +a1 = 0x10006a8c; +//nop; +t8 = t5 + t7; +a2 = MEM_U32(t8 + 0); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L43467c; +a1 = a1; +L43467c: +// bdead 40000183 gp = MEM_U32(sp + 40); +t9 = MEM_U32(sp + 10468); +t1 = 0x1000a5f0; +t0 = t9 + 0x1; +t1 = MEM_U32(t1 + 4); +MEM_U32(sp + 10468) = t0; +at = (int)t0 < (int)t1; +if (at != 0) {//nop; +goto L43464c;} +//nop; +L4346a0: +a0 = 0xfb528e4; +a1 = 0x10006a90; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L4346b8; +a1 = a1; +L4346b8: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L4346c0: +a0 = 0x10000554; +a1 = 0x10006a94; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_fopen(mem, a0, a1); +goto L4346d8; +a1 = a1; +L4346d8: +MEM_U32(sp + 10464) = v0; +t2 = MEM_U32(sp + 10464); +// bdead 40000803 gp = MEM_U32(sp + 40); +if (t2 != 0) {//nop; +goto L434778;} +//nop; +t4 = 0x10000554; +t3 = 0x10006ab0; +a3 = 0x10006a98; +//nop; +t4 = MEM_U32(t4 + 0); +t3 = t3; +MEM_U32(sp + 20) = t3; +a0 = 0x1; +a1 = zero; +a2 = zero; +MEM_U32(sp + 16) = zero; +a3 = a3; +MEM_U32(sp + 24) = t4; +f_error(mem, sp, a0, a1, a2, a3); +goto L434724; +MEM_U32(sp + 24) = t4; +L434724: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +a0 = 0x10000558; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +wrapper_perror(mem, a0); +goto L434740; +//nop; +L434740: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L434758; +//nop; +L434758: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L434770; +//nop; +L434770: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L434778: +a0 = 0x10000550; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = 0x102; +a2 = 0x1b6; +v0 = wrapper_open(mem, a0, a1, a2); +goto L434790; +a2 = 0x1b6; +L434790: +MEM_U32(sp + 10456) = v0; +t6 = MEM_U32(sp + 10456); +// bdead 40008003 gp = MEM_U32(sp + 40); +if ((int)t6 >= 0) {//nop; +goto L43484c;} +//nop; +t7 = 0x10000550; +t5 = 0x10006af8; +a3 = 0x10006ae0; +//nop; +t7 = MEM_U32(t7 + 0); +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +MEM_U32(sp + 16) = zero; +a3 = a3; +MEM_U32(sp + 24) = t7; +f_error(mem, sp, a0, a1, a2, a3); +goto L4347dc; +MEM_U32(sp + 24) = t7; +L4347dc: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +a0 = 0x10000558; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +wrapper_perror(mem, a0); +goto L4347f8; +//nop; +L4347f8: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +a0 = 0x10000554; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L434814; +//nop; +L434814: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L43482c; +//nop; +L43482c: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L434844; +//nop; +L434844: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L43484c: +//nop; +a0 = MEM_U32(sp + 10456); +a1 = 0x2; +v0 = wrapper_flock(mem, a0, a1); +goto L43485c; +a1 = 0x2; +L43485c: +// bdead 4000000b gp = MEM_U32(sp + 40); +if ((int)v0 >= 0) {//nop; +goto L434910;} +//nop; +t9 = 0x10000550; +t8 = 0x10006b44; +t9 = MEM_U32(t9 + 0); +a3 = 0x10006b2c; +MEM_U32(sp + 24) = t9; +//nop; +t8 = t8; +MEM_U32(sp + 20) = t8; +a0 = 0x1; +a1 = zero; +a2 = zero; +MEM_U32(sp + 16) = zero; +a3 = a3; +f_error(mem, sp, a0, a1, a2, a3); +goto L4348a0; +a3 = a3; +L4348a0: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +a0 = 0x10000558; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +wrapper_perror(mem, a0); +goto L4348bc; +//nop; +L4348bc: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +a0 = 0x10000554; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4348d8; +//nop; +L4348d8: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L4348f0; +//nop; +L4348f0: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L434908; +//nop; +L434908: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L434910: +//nop; +a0 = MEM_U32(sp + 10456); +a1 = sp + 0x34; +v0 = wrapper_fstat(mem, a0, a1); +goto L434920; +a1 = sp + 0x34; +L434920: +// bdead 4000018b gp = MEM_U32(sp + 40); +if ((int)v0 >= 0) {//nop; +goto L4349d4;} +//nop; +t1 = 0x10000550; +t0 = 0x10006b88; +a3 = 0x10006b70; +//nop; +t1 = MEM_U32(t1 + 0); +t0 = t0; +MEM_U32(sp + 20) = t0; +a0 = 0x1; +a1 = zero; +a2 = zero; +MEM_U32(sp + 16) = zero; +a3 = a3; +MEM_U32(sp + 24) = t1; +f_error(mem, sp, a0, a1, a2, a3); +goto L434964; +MEM_U32(sp + 24) = t1; +L434964: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +a0 = 0x10000558; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +wrapper_perror(mem, a0); +goto L434980; +//nop; +L434980: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +a0 = 0x10000554; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L43499c; +//nop; +L43499c: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L4349b4; +//nop; +L4349b4: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4349cc; +//nop; +L4349cc: +// bdead 40000183 gp = MEM_U32(sp + 40); +//nop; +L4349d4: +t2 = MEM_U32(sp + 100); +//nop; +if (t2 != 0) {//nop; +goto L434a00;} +//nop; +a1 = 0x10006bb4; +//nop; +a0 = MEM_U32(sp + 10464); +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L4349f8; +a1 = a1; +L4349f8: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L434a00: +a1 = 0x10006bc0; +//nop; +a0 = MEM_U32(sp + 10456); +a1 = a1; +v0 = wrapper_fdopen(mem, a0, a1); +goto L434a14; +a1 = a1; +L434a14: +MEM_U32(sp + 10460) = v0; +t3 = MEM_U32(sp + 10460); +// bdead 40001003 gp = MEM_U32(sp + 40); +if (t3 != 0) {//nop; +goto L434ad0;} +//nop; +t6 = 0x10000550; +t4 = 0x10006bdc; +a3 = 0x10006bc4; +//nop; +t6 = MEM_U32(t6 + 0); +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +MEM_U32(sp + 16) = zero; +a3 = a3; +MEM_U32(sp + 24) = t6; +f_error(mem, sp, a0, a1, a2, a3); +goto L434a60; +MEM_U32(sp + 24) = t6; +L434a60: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +a0 = 0x10000558; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +wrapper_perror(mem, a0); +goto L434a7c; +//nop; +L434a7c: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +a0 = 0x10000554; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L434a98; +//nop; +L434a98: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L434ab0; +//nop; +L434ab0: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L434ac8; +//nop; +L434ac8: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L434ad0: +//nop; +a2 = MEM_U32(sp + 10460); +a0 = sp + 0xd8; +a1 = 0x2800; +v0 = wrapper_fgets(mem, a0, a1, a2); +goto L434ae4; +a1 = 0x2800; +L434ae4: +// bdead 4000000b gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L434b78;} +//nop; +L434af0: +//nop; +a1 = MEM_U32(sp + 212); +a2 = MEM_U32(sp + 208); +a0 = sp + 0xd8; +v0 = wrapper_strncmp(mem, a0, a1, a2); +goto L434b04; +a0 = sp + 0xd8; +L434b04: +// bdead 4000000b gp = MEM_U32(sp + 40); +if (v0 != 0) {//nop; +goto L434b40;} +//nop; +t5 = MEM_U32(sp + 208); +t7 = sp + 0xd8; +t8 = t5 + t7; +t9 = MEM_U8(t8 + 0); +t0 = 0xfb504f0; +//nop; +t1 = t9 + t0; +t2 = MEM_U8(t1 + 1); +//nop; +t3 = t2 & 0x8; +if (t3 != 0) {//nop; +goto L434b58;} +//nop; +L434b40: +//nop; +a1 = MEM_U32(sp + 10464); +a0 = sp + 0xd8; +v0 = wrapper_fputs(mem, a0, a1); +goto L434b50; +a0 = sp + 0xd8; +L434b50: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L434b58: +//nop; +a2 = MEM_U32(sp + 10460); +a0 = sp + 0xd8; +a1 = 0x2800; +v0 = wrapper_fgets(mem, a0, a1, a2); +goto L434b6c; +a1 = 0x2800; +L434b6c: +// bdead 4000000b gp = MEM_U32(sp + 40); +if (v0 != 0) {//nop; +goto L434af0;} +//nop; +L434b78: +a3 = 0x10000558; +a1 = 0x10006c08; +//nop; +a0 = MEM_U32(sp + 10464); +a2 = MEM_U32(sp + 212); +a3 = MEM_U32(a3 + 0); +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L434b98; +a1 = a1; +L434b98: +// bdead 40000183 gp = MEM_U32(sp + 40); +MEM_U32(sp + 10468) = zero; +t4 = 0x1000a5f0; +//nop; +t4 = MEM_U32(t4 + 4); +//nop; +if ((int)t4 <= 0) {//nop; +goto L434c08;} +//nop; +L434bb8: +t6 = 0x1000a5f0; +t5 = MEM_U32(sp + 10468); +t6 = MEM_U32(t6 + 8); +t7 = t5 << 2; +a1 = 0x10006c10; +//nop; +t8 = t6 + t7; +a2 = MEM_U32(t8 + 0); +a0 = MEM_U32(sp + 10464); +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L434be4; +a1 = a1; +L434be4: +// bdead 40000183 gp = MEM_U32(sp + 40); +t9 = MEM_U32(sp + 10468); +t1 = 0x1000a5f0; +t0 = t9 + 0x1; +t1 = MEM_U32(t1 + 4); +MEM_U32(sp + 10468) = t0; +at = (int)t0 < (int)t1; +if (at != 0) {//nop; +goto L434bb8;} +//nop; +L434c08: +a1 = 0x10006c14; +//nop; +a0 = MEM_U32(sp + 10464); +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L434c1c; +a1 = a1; +L434c1c: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = MEM_U32(sp + 212); +//nop; +//nop; +//nop; +wrapper_free(mem, a0); +goto L434c34; +//nop; +L434c34: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = MEM_U32(sp + 10460); +//nop; +//nop; +//nop; +wrapper_rewind(mem, a0); +goto L434c4c; +//nop; +L434c4c: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = MEM_U32(sp + 10464); +//nop; +//nop; +//nop; +wrapper_rewind(mem, a0); +goto L434c64; +//nop; +L434c64: +// bdead 40000003 gp = MEM_U32(sp + 40); +t2 = MEM_U32(sp + 10460); +//nop; +a0 = MEM_U8(t2 + 13); +a1 = zero; +v0 = wrapper_ftruncate(mem, a0, a1); +goto L434c7c; +a1 = zero; +L434c7c: +// bdead 40000003 gp = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 10464); +//nop; +a0 = sp + 0xd8; +a1 = 0x1; +a2 = 0x2800; +v0 = wrapper_fread(mem, a0, a1, a2, a3); +goto L434c98; +a2 = 0x2800; +L434c98: +MEM_U32(sp + 10468) = v0; +t3 = MEM_U32(sp + 10468); +// bdead 40001003 gp = MEM_U32(sp + 40); +if ((int)t3 <= 0) {//nop; +goto L434da8;} +//nop; +L434cac: +//nop; +a2 = MEM_U32(sp + 10468); +a3 = MEM_U32(sp + 10460); +a0 = sp + 0xd8; +a1 = 0x1; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L434cc4; +a1 = 0x1; +L434cc4: +t4 = MEM_U32(sp + 10468); +// bdead 4000200b gp = MEM_U32(sp + 40); +if (v0 == t4) {//nop; +goto L434d7c;} +//nop; +t6 = 0x10000550; +t5 = 0x10006c30; +a3 = 0x10006c18; +//nop; +t6 = MEM_U32(t6 + 0); +t5 = t5; +MEM_U32(sp + 20) = t5; +a0 = 0x1; +a1 = zero; +a2 = zero; +MEM_U32(sp + 16) = zero; +a3 = a3; +MEM_U32(sp + 24) = t6; +f_error(mem, sp, a0, a1, a2, a3); +goto L434d0c; +MEM_U32(sp + 24) = t6; +L434d0c: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +a0 = 0x10000558; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +wrapper_perror(mem, a0); +goto L434d28; +//nop; +L434d28: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +a0 = 0x10000554; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L434d44; +//nop; +L434d44: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L434d5c; +//nop; +L434d5c: +// bdead 40000003 gp = MEM_U32(sp + 40); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L434d74; +//nop; +L434d74: +// bdead 40000003 gp = MEM_U32(sp + 40); +//nop; +L434d7c: +//nop; +a3 = MEM_U32(sp + 10464); +a0 = sp + 0xd8; +a1 = 0x1; +a2 = 0x2800; +v0 = wrapper_fread(mem, a0, a1, a2, a3); +goto L434d94; +a2 = 0x2800; +L434d94: +MEM_U32(sp + 10468) = v0; +t7 = MEM_U32(sp + 10468); +// bdead 40010003 gp = MEM_U32(sp + 40); +if ((int)t7 > 0) {//nop; +goto L434cac;} +//nop; +L434da8: +//nop; +a0 = MEM_U32(sp + 10460); +//nop; +v0 = wrapper_fclose(mem, a0); +goto L434db8; +//nop; +L434db8: +// bdead 40000001 gp = MEM_U32(sp + 40); +a0 = MEM_U32(sp + 10464); +//nop; +//nop; +//nop; +v0 = wrapper_fclose(mem, a0); +goto L434dd0; +//nop; +L434dd0: +// bdead 40000001 gp = MEM_U32(sp + 40); +//nop; +a0 = 0x10000554; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_unlink(mem, a0); +goto L434dec; +//nop; +L434dec: +// bdead 40000001 gp = MEM_U32(sp + 40); +//nop; +a0 = 0x10000550; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +wrapper_free(mem, a0); +goto L434e08; +//nop; +L434e08: +// bdead 40000001 gp = MEM_U32(sp + 40); +//nop; +a0 = 0x10000554; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +wrapper_free(mem, a0); +goto L434e24; +//nop; +L434e24: +// bdead 1 ra = MEM_U32(sp + 44); +// bdead 1 gp = MEM_U32(sp + 40); +// bdead 1 s0 = MEM_U32(sp + 36); +// bdead 1 sp = sp + 0x28e8; +return; +// bdead 1 sp = sp + 0x28e8; +} + +static uint32_t f_touch(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L434e38: +//touch: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +// fdead 4000002b MEM_U32(sp + 36) = ra; +MEM_U32(sp + 64) = a0; +// fdead 4000002b MEM_U32(sp + 32) = gp; +// fdead 4000002b MEM_U32(sp + 28) = s1; +// fdead 4000002b MEM_U32(sp + 24) = s0; +a0 = zero; +v0 = wrapper_time(mem, a0); +goto L434e68; +a0 = zero; +L434e68: +// bdead 4000000b gp = MEM_U32(sp + 32); +MEM_U32(sp + 60) = v0; +//nop; +//nop; +//nop; +f_init_curr_dir(mem, sp); +goto L434e80; +//nop; +L434e80: +// bdead 40000003 gp = MEM_U32(sp + 32); +//nop; +t6 = 0x10000234; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L434ecc;} +//nop; +a2 = 0x10000558; +a0 = 0xfb528e4; +a1 = 0x10006c5c; +//nop; +a3 = MEM_U32(sp + 64); +a2 = MEM_U32(a2 + 0); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L434ec4; +a1 = a1; +L434ec4: +// bdead 40000003 gp = MEM_U32(sp + 32); +//nop; +L434ecc: +t7 = MEM_U32(sp + 60); +//nop; +a0 = MEM_U32(sp + 64); +a1 = sp + 0x34; +MEM_U32(sp + 56) = t7; +MEM_U32(sp + 52) = t7; +v0 = wrapper_utime(mem, a0, a1); +goto L434ee8; +MEM_U32(sp + 52) = t7; +L434ee8: +// bdead 4000000b gp = MEM_U32(sp + 32); +if ((int)v0 >= 0) {//nop; +goto L434f9c;} +//nop; +//nop; +a0 = MEM_U32(sp + 64); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L434f04; +//nop; +L434f04: +// bdead 40000009 gp = MEM_U32(sp + 32); +s1 = v0; +a0 = 0x10000558; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L434f20; +//nop; +L434f20: +// bdead 40040009 gp = MEM_U32(sp + 32); +s0 = v0; +//nop; +a0 = s0 + s1; +a0 = a0 + 0xa; +v0 = wrapper_malloc(mem, a0); +goto L434f38; +a0 = a0 + 0xa; +L434f38: +// bdead 40000009 gp = MEM_U32(sp + 32); +MEM_U32(sp + 48) = v0; +a2 = 0x10000558; +a1 = 0x10006c6c; +//nop; +a0 = MEM_U32(sp + 48); +a3 = MEM_U32(sp + 64); +a2 = MEM_U32(a2 + 0); +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_sprintf(mem, a0, a1, sp); +goto L434f60; +a1 = a1; +L434f60: +// bdead 40000001 gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 48); +//nop; +//nop; +//nop; +wrapper_perror(mem, a0); +goto L434f78; +//nop; +L434f78: +// bdead 40000001 gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 48); +//nop; +//nop; +//nop; +wrapper_free(mem, a0); +goto L434f90; +//nop; +L434f90: +// bdead 1 gp = MEM_U32(sp + 32); +v0 = 0xffffffff; +goto L434fa0; +v0 = 0xffffffff; +L434f9c: +v0 = zero; +L434fa0: +// bdead 9 ra = MEM_U32(sp + 36); +// bdead 9 s0 = MEM_U32(sp + 24); +// bdead 9 s1 = MEM_U32(sp + 28); +// bdead 9 sp = sp + 0x40; +return v0; +// bdead 9 sp = sp + 0x40; +} + +static void f_add_prelinker_objects(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L434fb4: +//add_prelinker_objects: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 44) = a1; +t6 = MEM_U32(sp + 44); +// fdead 4000806b MEM_U32(sp + 28) = ra; +// fdead 4000806b MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 36) = zero; +t7 = MEM_U32(t6 + 4); +//nop; +if ((int)t7 <= 0) {//nop; +goto L4350a0;} +//nop; +L434fec: +t8 = MEM_U32(sp + 44); +t0 = MEM_U32(sp + 36); +t9 = MEM_U32(t8 + 8); +t1 = t0 << 2; +t2 = t9 + t1; +t3 = MEM_U32(t2 + 0); +at = 0x2d; +t4 = MEM_U8(t3 + 0); +//nop; +if (t4 != at) {//nop; +goto L43504c;} +//nop; +a1 = 0x10006c7c; +//nop; +a0 = t3; +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L43502c; +a1 = a1; +L43502c: +// bdead 40000009 gp = MEM_U32(sp + 24); +if (v0 != 0) {//nop; +goto L43507c;} +//nop; +t5 = MEM_U32(sp + 36); +//nop; +t6 = t5 + 0x1; +MEM_U32(sp + 36) = t6; +goto L43507c; +MEM_U32(sp + 36) = t6; +L43504c: +t7 = MEM_U32(sp + 44); +t0 = MEM_U32(sp + 36); +t8 = MEM_U32(t7 + 8); +t9 = t0 << 2; +t1 = t8 + t9; +//nop; +a1 = MEM_U32(t1 + 0); +a0 = MEM_U32(sp + 40); +//nop; +f_addstr(mem, sp, a0, a1); +goto L435074; +//nop; +L435074: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L43507c: +t2 = MEM_U32(sp + 36); +t3 = MEM_U32(sp + 44); +t4 = t2 + 0x1; +MEM_U32(sp + 36) = t4; +t5 = MEM_U32(t3 + 4); +//nop; +at = (int)t4 < (int)t5; +if (at != 0) {//nop; +goto L434fec;} +//nop; +L4350a0: +// bdead 1 ra = MEM_U32(sp + 28); +// bdead 1 sp = sp + 0x28; +//nop; +return; +//nop; +} + +static uint32_t f_quoted_length(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4350b0: +//quoted_length: +//nop; +//nop; +//nop; +sp = sp + 0xfffffff0; +MEM_U32(sp + 12) = zero; +MEM_U32(a1 + 0) = zero; +t6 = MEM_U8(a0 + 0); +a0 = a0 + 0x1; +MEM_U8(sp + 11) = (uint8_t)t6; +a2 = MEM_U8(sp + 11); +//nop; +if (a2 == 0) {//nop; +goto L435218;} +//nop; +L4350e4: +t7 = MEM_U32(a1 + 0); +//nop; +if (t7 != 0) {//nop; +goto L4351b4;} +//nop; +t8 = MEM_U8(sp + 11); +at = 0x27; +if (t8 == at) {at = 0x7c; +goto L43519c;} +at = 0x7c; +if (t8 == at) {at = 0x26; +goto L43519c;} +at = 0x26; +if (t8 == at) {at = 0x2a; +goto L43519c;} +at = 0x2a; +if (t8 == at) {at = 0x3f; +goto L43519c;} +at = 0x3f; +if (t8 == at) {at = 0x5b; +goto L43519c;} +at = 0x5b; +if (t8 == at) {at = 0x5d; +goto L43519c;} +at = 0x5d; +if (t8 == at) {at = 0x3b; +goto L43519c;} +at = 0x3b; +if (t8 == at) {at = 0x21; +goto L43519c;} +at = 0x21; +if (t8 == at) {at = 0x28; +goto L43519c;} +at = 0x28; +if (t8 == at) {at = 0x29; +goto L43519c;} +at = 0x29; +if (t8 == at) {at = 0x5e; +goto L43519c;} +at = 0x5e; +if (t8 == at) {at = 0x3c; +goto L43519c;} +at = 0x3c; +if (t8 == at) {at = 0x3e; +goto L43519c;} +at = 0x3e; +if (t8 == at) {at = (int)t8 < (int)0x21; +goto L43519c;} +at = (int)t8 < (int)0x21; +if (at != 0) {at = 0x9; +goto L43519c;} +at = 0x9; +if (t8 == at) {at = 0x22; +goto L43519c;} +at = 0x22; +if (t8 == at) {at = 0x5c; +goto L43519c;} +at = 0x5c; +if (t8 == at) {at = 0x60; +goto L43519c;} +at = 0x60; +if (t8 == at) {at = 0x24; +goto L43519c;} +at = 0x24; +if (t8 != at) {//nop; +goto L4351b4;} +//nop; +L43519c: +t9 = 0x1; +MEM_U32(a1 + 0) = t9; +t0 = MEM_U32(sp + 12); +//nop; +t1 = t0 + 0x2; +MEM_U32(sp + 12) = t1; +L4351b4: +t2 = MEM_U8(sp + 11); +at = 0x22; +if (t2 == at) {at = 0x5c; +goto L4351dc;} +at = 0x5c; +if (t2 == at) {at = 0x60; +goto L4351dc;} +at = 0x60; +if (t2 == at) {at = 0x24; +goto L4351dc;} +at = 0x24; +if (t2 != at) {//nop; +goto L4351ec;} +//nop; +L4351dc: +t3 = MEM_U32(sp + 12); +//nop; +t4 = t3 + 0x1; +MEM_U32(sp + 12) = t4; +L4351ec: +t5 = MEM_U32(sp + 12); +a0 = a0 + 0x1; +t6 = t5 + 0x1; +MEM_U32(sp + 12) = t6; +t7 = MEM_U8(a0 + -1); +//nop; +MEM_U8(sp + 11) = (uint8_t)t7; +a2 = MEM_U8(sp + 11); +//nop; +if (a2 != 0) {//nop; +goto L4350e4;} +//nop; +L435218: +v0 = MEM_U32(sp + 12); +// bdead 9 sp = sp + 0x10; +return v0; +// bdead 9 sp = sp + 0x10; +} + +static uint32_t f_quote_shell_arg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L435224: +//quote_shell_arg: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 48) = a0; +// fdead 4000006b MEM_U32(sp + 28) = ra; +MEM_U32(sp + 52) = a1; +a0 = MEM_U32(sp + 48); +// fdead 4000006b MEM_U32(sp + 24) = gp; +// fdead 4000006b MEM_U32(sp + 20) = s0; +MEM_U32(sp + 40) = zero; +a1 = sp + 0x28; +v0 = f_quoted_length(mem, sp, a0, a1); +goto L43525c; +a1 = sp + 0x28; +L43525c: +t6 = MEM_U32(sp + 40); +// bdead 40008009 gp = MEM_U32(sp + 24); +if (t6 == 0) {MEM_U32(sp + 36) = v0; +goto L435288;} +MEM_U32(sp + 36) = v0; +t8 = MEM_U32(sp + 52); +t7 = 0x22; +MEM_U8(t8 + 0) = (uint8_t)t7; +t9 = MEM_U32(sp + 52); +//nop; +t0 = t9 + 0x1; +MEM_U32(sp + 52) = t0; +L435288: +t1 = MEM_U32(sp + 48); +//nop; +t2 = MEM_U8(t1 + 0); +t3 = t1 + 0x1; +s0 = t2; +MEM_U32(sp + 48) = t3; +if (s0 == 0) {MEM_U8(sp + 47) = (uint8_t)t2; +goto L435324;} +MEM_U8(sp + 47) = (uint8_t)t2; +L4352a8: +t4 = MEM_U8(sp + 47); +at = 0x22; +if (t4 == at) {at = 0x5c; +goto L4352d0;} +at = 0x5c; +if (t4 == at) {at = 0x60; +goto L4352d0;} +at = 0x60; +if (t4 == at) {at = 0x24; +goto L4352d0;} +at = 0x24; +if (t4 != at) {//nop; +goto L4352ec;} +//nop; +L4352d0: +t6 = MEM_U32(sp + 52); +t5 = 0x5c; +MEM_U8(t6 + 0) = (uint8_t)t5; +t7 = MEM_U32(sp + 52); +//nop; +t8 = t7 + 0x1; +MEM_U32(sp + 52) = t8; +L4352ec: +t9 = MEM_U8(sp + 47); +t0 = MEM_U32(sp + 52); +//nop; +MEM_U8(t0 + 0) = (uint8_t)t9; +t2 = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 48); +t1 = t2 + 0x1; +MEM_U32(sp + 52) = t1; +t4 = MEM_U8(t3 + 0); +t5 = t3 + 0x1; +s0 = t4; +MEM_U32(sp + 48) = t5; +if (s0 != 0) {MEM_U8(sp + 47) = (uint8_t)t4; +goto L4352a8;} +MEM_U8(sp + 47) = (uint8_t)t4; +L435324: +t6 = MEM_U32(sp + 40); +//nop; +if (t6 == 0) {//nop; +goto L435350;} +//nop; +t8 = MEM_U32(sp + 52); +t7 = 0x22; +MEM_U8(t8 + 0) = (uint8_t)t7; +t9 = MEM_U32(sp + 52); +//nop; +t0 = t9 + 0x1; +MEM_U32(sp + 52) = t0; +L435350: +// bdead 40000001 ra = MEM_U32(sp + 28); +v0 = MEM_U32(sp + 36); +// bdead 9 s0 = MEM_U32(sp + 20); +// bdead 9 sp = sp + 0x30; +return v0; +// bdead 9 sp = sp + 0x30; +} + +static void f_save_off_command_line(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L435364: +//save_off_command_line: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 64) = a0; +t7 = MEM_U32(sp + 64); +t6 = 0x1; +at = (int)t7 < (int)0x2; +// fdead 4001806f MEM_U32(sp + 28) = ra; +// fdead 4001806f MEM_U32(sp + 24) = gp; +MEM_U32(sp + 68) = a1; +// fdead 4001806f MEM_U32(sp + 20) = s0; +MEM_U32(sp + 60) = zero; +MEM_U32(sp + 56) = zero; +MEM_U32(sp + 52) = zero; +if (at != 0) {MEM_U32(sp + 48) = t6; +goto L4354bc;} +MEM_U32(sp + 48) = t6; +L4353a8: +t9 = MEM_U32(sp + 48); +t8 = MEM_U32(sp + 68); +t0 = t9 << 2; +//nop; +a1 = 0x10006c80; +t1 = t8 + t0; +a0 = MEM_U32(t1 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L4353cc; +a1 = a1; +L4353cc: +// bdead 4000000b gp = MEM_U32(sp + 24); +if (v0 != 0) {//nop; +goto L43546c;} +//nop; +t3 = MEM_U32(sp + 64); +t2 = MEM_U32(sp + 48); +t4 = t3 + 0xffffffff; +at = (int)t2 < (int)t4; +if (at == 0) {//nop; +goto L43546c;} +//nop; +t5 = MEM_U32(sp + 68); +t6 = t2 << 2; +//nop; +t7 = t5 + t6; +a0 = MEM_U32(t7 + 0); +a1 = sp + 0x34; +v0 = f_quoted_length(mem, sp, a0, a1); +goto L43540c; +a1 = sp + 0x34; +L43540c: +t9 = MEM_U32(sp + 56); +t3 = MEM_U32(sp + 48); +s0 = v0; +// bdead 44021003 gp = MEM_U32(sp + 24); +t1 = MEM_U32(sp + 68); +t8 = t9 + s0; +t0 = t8 + 0x1; +t4 = t3 << 2; +//nop; +MEM_U32(sp + 56) = t0; +t2 = t1 + t4; +a0 = MEM_U32(t2 + 4); +a1 = sp + 0x34; +v0 = f_quoted_length(mem, sp, a0, a1); +goto L435444; +a1 = sp + 0x34; +L435444: +t5 = MEM_U32(sp + 56); +t9 = MEM_U32(sp + 48); +s0 = v0; +t6 = t5 + s0; +t7 = t6 + 0x1; +// bdead 44010003 gp = MEM_U32(sp + 24); +t8 = t9 + 0x1; +MEM_U32(sp + 56) = t7; +MEM_U32(sp + 48) = t8; +goto L4354a4; +MEM_U32(sp + 48) = t8; +L43546c: +t3 = MEM_U32(sp + 48); +t0 = MEM_U32(sp + 68); +t1 = t3 << 2; +//nop; +t4 = t0 + t1; +a0 = MEM_U32(t4 + 0); +a1 = sp + 0x34; +v0 = f_quoted_length(mem, sp, a0, a1); +goto L43548c; +a1 = sp + 0x34; +L43548c: +t2 = MEM_U32(sp + 60); +s0 = v0; +t5 = t2 + s0; +t6 = t5 + 0x1; +// bdead 40008003 gp = MEM_U32(sp + 24); +MEM_U32(sp + 60) = t6; +L4354a4: +t7 = MEM_U32(sp + 48); +t8 = MEM_U32(sp + 64); +t9 = t7 + 0x1; +at = (int)t9 < (int)t8; +if (at != 0) {MEM_U32(sp + 48) = t9; +goto L4353a8;} +MEM_U32(sp + 48) = t9; +L4354bc: +a0 = MEM_U32(sp + 60); +//nop; +a0 = a0 + 0x1; +//nop; +v0 = wrapper_malloc(mem, a0); +goto L4354d0; +//nop; +L4354d0: +// bdead 4000000b gp = MEM_U32(sp + 24); +MEM_U32(sp + 44) = v0; +t3 = MEM_U32(sp + 44); +t0 = MEM_U32(sp + 56); +at = 0x1000a48c; +if (t0 == 0) {MEM_U32(at + 0) = t3; +goto L435510;} +MEM_U32(at + 0) = t3; +//nop; +a0 = t0 + 0x1; +//nop; +v0 = wrapper_malloc(mem, a0); +goto L4354fc; +//nop; +L4354fc: +// bdead 4000000b gp = MEM_U32(sp + 24); +//nop; +at = 0x1000a49c; +//nop; +MEM_U32(at + 0) = v0; +L435510: +t4 = MEM_U32(sp + 64); +t1 = 0x1; +at = (int)t4 < (int)0x2; +if (at != 0) {MEM_U32(sp + 48) = t1; +goto L435688;} +MEM_U32(sp + 48) = t1; +L435524: +t5 = MEM_U32(sp + 48); +t2 = MEM_U32(sp + 68); +t6 = t5 << 2; +a1 = 0x10006c84; +//nop; +t7 = t2 + t6; +a0 = MEM_U32(t7 + 0); +a1 = a1; +v0 = wrapper_strcmp(mem, a0, a1); +goto L435548; +a1 = a1; +L435548: +// bdead 4000000b gp = MEM_U32(sp + 24); +if (v0 != 0) {//nop; +goto L435620;} +//nop; +t8 = MEM_U32(sp + 64); +t9 = MEM_U32(sp + 48); +t3 = t8 + 0xffffffff; +at = (int)t9 < (int)t3; +if (at == 0) {//nop; +goto L435620;} +//nop; +t0 = 0x1000a49c; +t1 = MEM_U32(sp + 68); +t0 = MEM_U32(t0 + 0); +t4 = t9 << 2; +//nop; +t5 = t1 + t4; +MEM_U32(sp + 40) = t0; +a0 = MEM_U32(t5 + 0); +a1 = t0; +v0 = f_quote_shell_arg(mem, sp, a0, a1); +goto L435594; +a1 = t0; +L435594: +t2 = MEM_U32(sp + 40); +s0 = v0; +t6 = t2 + s0; +// bdead 40008003 gp = MEM_U32(sp + 24); +MEM_U32(sp + 40) = t6; +t7 = 0x20; +MEM_U8(t6 + 0) = (uint8_t)t7; +t1 = MEM_U32(sp + 48); +t8 = MEM_U32(sp + 40); +t9 = MEM_U32(sp + 68); +t4 = t1 << 2; +t3 = t8 + 0x1; +t5 = t9 + t4; +//nop; +MEM_U32(sp + 40) = t3; +a0 = MEM_U32(t5 + 4); +a1 = t3; +v0 = f_quote_shell_arg(mem, sp, a0, a1); +goto L4355dc; +a1 = t3; +L4355dc: +t0 = MEM_U32(sp + 40); +s0 = v0; +t2 = t0 + s0; +MEM_U32(sp + 40) = t2; +// bdead 40000803 gp = MEM_U32(sp + 24); +t7 = 0x20; +MEM_U8(t2 + 0) = (uint8_t)t7; +t6 = MEM_U32(sp + 40); +//nop; +t8 = t6 + 0x1; +MEM_U32(sp + 40) = t8; +MEM_U8(t8 + 0) = (uint8_t)zero; +t1 = MEM_U32(sp + 48); +//nop; +t9 = t1 + 0x1; +MEM_U32(sp + 48) = t9; +goto L435670; +MEM_U32(sp + 48) = t9; +L435620: +t5 = MEM_U32(sp + 48); +t4 = MEM_U32(sp + 68); +t3 = t5 << 2; +//nop; +t0 = t4 + t3; +a0 = MEM_U32(t0 + 0); +a1 = MEM_U32(sp + 44); +//nop; +v0 = f_quote_shell_arg(mem, sp, a0, a1); +goto L435644; +//nop; +L435644: +t7 = MEM_U32(sp + 44); +s0 = v0; +t2 = t7 + s0; +MEM_U32(sp + 44) = t2; +// bdead 40000803 gp = MEM_U32(sp + 24); +t6 = 0x20; +MEM_U8(t2 + 0) = (uint8_t)t6; +t8 = MEM_U32(sp + 44); +//nop; +t1 = t8 + 0x1; +MEM_U32(sp + 44) = t1; +L435670: +t9 = MEM_U32(sp + 48); +t4 = MEM_U32(sp + 64); +t5 = t9 + 0x1; +at = (int)t5 < (int)t4; +if (at != 0) {MEM_U32(sp + 48) = t5; +goto L435524;} +MEM_U32(sp + 48) = t5; +L435688: +t3 = MEM_U32(sp + 44); +//nop; +MEM_U8(t3 + -1) = (uint8_t)zero; +// bdead 1 ra = MEM_U32(sp + 28); +// bdead 1 s0 = MEM_U32(sp + 20); +// bdead 1 sp = sp + 0x40; +return; +// bdead 1 sp = sp + 0x40; +} + +static void f_skip_old_ii_controls(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4356a4: +//skip_old_ii_controls: +//nop; +//nop; +//nop; +sp = sp + 0xffffffa8; +t6 = 0xfb51f00; +// fdead 4000802b MEM_U32(sp + 52) = ra; +t6 = MEM_U32(t6 + 0); +// fdead 4000802b MEM_U32(sp + 48) = gp; +MEM_U32(sp + 88) = a0; +// fdead 4000802b MEM_U32(sp + 44) = s5; +// fdead 4000802b MEM_U32(sp + 40) = s4; +// fdead 4000802b MEM_U32(sp + 36) = s3; +// fdead 4000802b MEM_U32(sp + 32) = s2; +// fdead 4000802b MEM_U32(sp + 28) = s1; +// fdead 4000802b MEM_U32(sp + 24) = s0; +if (t6 == 0) {MEM_U32(sp + 80) = zero; +goto L435704;} +MEM_U32(sp + 80) = zero; +//nop; +a0 = MEM_U32(sp + 88); +//nop; +v0 = wrapper___semgetc(mem, a0); +goto L4356f8; +//nop; +L4356f8: +// bdead 40000009 gp = MEM_U32(sp + 48); +MEM_U32(sp + 84) = v0; +goto L435770; +MEM_U32(sp + 84) = v0; +L435704: +t7 = MEM_U32(sp + 88); +//nop; +t8 = MEM_U32(t7 + 0); +//nop; +t9 = t8 + 0xffffffff; +MEM_U32(t7 + 0) = t9; +t0 = MEM_U32(sp + 88); +//nop; +t1 = MEM_U32(t0 + 0); +//nop; +if ((int)t1 >= 0) {//nop; +goto L435750;} +//nop; +//nop; +a0 = t0; +//nop; +v0 = wrapper___filbuf(mem, a0); +goto L435744; +//nop; +L435744: +// bdead 40000009 gp = MEM_U32(sp + 48); +s0 = v0; +goto L43576c; +s0 = v0; +L435750: +t2 = MEM_U32(sp + 88); +//nop; +t3 = MEM_U32(t2 + 4); +t4 = MEM_U32(t2 + 4); +s0 = MEM_U8(t3 + 0); +t5 = t4 + 0x1; +MEM_U32(t2 + 4) = t5; +L43576c: +MEM_U32(sp + 84) = s0; +L435770: +t6 = MEM_U32(sp + 84); +at = 0xffffffff; +if (t6 == at) {//nop; +goto L435b54;} +//nop; +L435780: +t8 = MEM_U32(sp + 84); +at = 0x2d; +if (t8 != at) {//nop; +goto L4359b4;} +//nop; +t9 = 0xfb51f00; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L4357c4;} +//nop; +//nop; +a0 = MEM_U32(sp + 88); +//nop; +v0 = wrapper___semgetc(mem, a0); +goto L4357b8; +//nop; +L4357b8: +// bdead 40000009 gp = MEM_U32(sp + 48); +s0 = v0; +goto L435830; +s0 = v0; +L4357c4: +t7 = MEM_U32(sp + 88); +//nop; +t1 = MEM_U32(t7 + 0); +//nop; +t0 = t1 + 0xffffffff; +MEM_U32(t7 + 0) = t0; +t3 = MEM_U32(sp + 88); +//nop; +t4 = MEM_U32(t3 + 0); +//nop; +if ((int)t4 >= 0) {//nop; +goto L435810;} +//nop; +//nop; +a0 = t3; +//nop; +v0 = wrapper___filbuf(mem, a0); +goto L435804; +//nop; +L435804: +// bdead 40000009 gp = MEM_U32(sp + 48); +s1 = v0; +goto L43582c; +s1 = v0; +L435810: +t5 = MEM_U32(sp + 88); +//nop; +t2 = MEM_U32(t5 + 4); +t6 = MEM_U32(t5 + 4); +s1 = MEM_U8(t2 + 0); +t8 = t6 + 0x1; +MEM_U32(t5 + 4) = t8; +L43582c: +s0 = s1; +L435830: +MEM_U32(sp + 84) = s0; +t9 = MEM_U32(sp + 84); +at = 0x2d; +if (t9 != at) {//nop; +goto L4359b4;} +//nop; +t1 = 0xfb51f00; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L435878;} +//nop; +//nop; +a0 = MEM_U32(sp + 88); +//nop; +v0 = wrapper___semgetc(mem, a0); +goto L43586c; +//nop; +L43586c: +// bdead 40000009 gp = MEM_U32(sp + 48); +s2 = v0; +goto L4358e4; +s2 = v0; +L435878: +t0 = MEM_U32(sp + 88); +//nop; +t7 = MEM_U32(t0 + 0); +//nop; +t4 = t7 + 0xffffffff; +MEM_U32(t0 + 0) = t4; +t3 = MEM_U32(sp + 88); +//nop; +t2 = MEM_U32(t3 + 0); +//nop; +if ((int)t2 >= 0) {//nop; +goto L4358c4;} +//nop; +//nop; +a0 = t3; +//nop; +v0 = wrapper___filbuf(mem, a0); +goto L4358b8; +//nop; +L4358b8: +// bdead 40000009 gp = MEM_U32(sp + 48); +s3 = v0; +goto L4358e0; +s3 = v0; +L4358c4: +t6 = MEM_U32(sp + 88); +//nop; +t8 = MEM_U32(t6 + 4); +t5 = MEM_U32(t6 + 4); +s3 = MEM_U8(t8 + 0); +t9 = t5 + 0x1; +MEM_U32(t6 + 4) = t9; +L4358e0: +s2 = s3; +L4358e4: +MEM_U32(sp + 84) = s2; +t1 = MEM_U32(sp + 84); +at = 0x2d; +if (t1 != at) {//nop; +goto L4359b4;} +//nop; +t7 = 0xfb51f00; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L43592c;} +//nop; +//nop; +a0 = MEM_U32(sp + 88); +//nop; +v0 = wrapper___semgetc(mem, a0); +goto L435920; +//nop; +L435920: +// bdead 40000009 gp = MEM_U32(sp + 48); +s4 = v0; +goto L435998; +s4 = v0; +L43592c: +t4 = MEM_U32(sp + 88); +//nop; +t0 = MEM_U32(t4 + 0); +//nop; +t2 = t0 + 0xffffffff; +MEM_U32(t4 + 0) = t2; +t3 = MEM_U32(sp + 88); +//nop; +t8 = MEM_U32(t3 + 0); +//nop; +if ((int)t8 >= 0) {//nop; +goto L435978;} +//nop; +//nop; +a0 = t3; +//nop; +v0 = wrapper___filbuf(mem, a0); +goto L43596c; +//nop; +L43596c: +// bdead 40000009 gp = MEM_U32(sp + 48); +s5 = v0; +goto L435994; +s5 = v0; +L435978: +t5 = MEM_U32(sp + 88); +//nop; +t9 = MEM_U32(t5 + 4); +t6 = MEM_U32(t5 + 4); +s5 = MEM_U8(t9 + 0); +t1 = t6 + 0x1; +MEM_U32(t5 + 4) = t1; +L435994: +s4 = s5; +L435998: +MEM_U32(sp + 84) = s4; +t7 = MEM_U32(sp + 84); +at = 0x2d; +if (t7 != at) {//nop; +goto L4359b4;} +//nop; +t0 = 0x1; +MEM_U32(sp + 80) = t0; +L4359b4: +t2 = MEM_U32(sp + 84); +at = 0xa; +if (t2 == at) {at = 0xffffffff; +goto L435a84;} +at = 0xffffffff; +if (t2 == at) {//nop; +goto L435a84;} +//nop; +L4359cc: +t4 = 0xfb51f00; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L435a00;} +//nop; +//nop; +a0 = MEM_U32(sp + 88); +//nop; +v0 = wrapper___semgetc(mem, a0); +goto L4359f4; +//nop; +L4359f4: +// bdead 40000009 gp = MEM_U32(sp + 48); +MEM_U32(sp + 84) = v0; +goto L435a6c; +MEM_U32(sp + 84) = v0; +L435a00: +t8 = MEM_U32(sp + 88); +//nop; +t3 = MEM_U32(t8 + 0); +//nop; +t9 = t3 + 0xffffffff; +MEM_U32(t8 + 0) = t9; +t6 = MEM_U32(sp + 88); +//nop; +t1 = MEM_U32(t6 + 0); +//nop; +if ((int)t1 >= 0) {//nop; +goto L435a4c;} +//nop; +//nop; +a0 = t6; +//nop; +v0 = wrapper___filbuf(mem, a0); +goto L435a40; +//nop; +L435a40: +// bdead 40000009 gp = MEM_U32(sp + 48); +s0 = v0; +goto L435a68; +s0 = v0; +L435a4c: +t5 = MEM_U32(sp + 88); +//nop; +t7 = MEM_U32(t5 + 4); +t0 = MEM_U32(t5 + 4); +s0 = MEM_U8(t7 + 0); +t2 = t0 + 0x1; +MEM_U32(t5 + 4) = t2; +L435a68: +MEM_U32(sp + 84) = s0; +L435a6c: +t4 = MEM_U32(sp + 84); +at = 0xa; +if (t4 == at) {at = 0xffffffff; +goto L435a84;} +at = 0xffffffff; +if (t4 != at) {//nop; +goto L4359cc;} +//nop; +L435a84: +t3 = MEM_U32(sp + 80); +//nop; +if (t3 != 0) {//nop; +goto L435b54;} +//nop; +t9 = MEM_U32(sp + 84); +at = 0xa; +if (t9 != at) {//nop; +goto L435b44;} +//nop; +t8 = 0xfb51f00; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L435ad8;} +//nop; +//nop; +a0 = MEM_U32(sp + 88); +//nop; +v0 = wrapper___semgetc(mem, a0); +goto L435acc; +//nop; +L435acc: +// bdead 40000009 gp = MEM_U32(sp + 48); +MEM_U32(sp + 84) = v0; +goto L435b44; +MEM_U32(sp + 84) = v0; +L435ad8: +t1 = MEM_U32(sp + 88); +//nop; +t6 = MEM_U32(t1 + 0); +//nop; +t7 = t6 + 0xffffffff; +MEM_U32(t1 + 0) = t7; +t0 = MEM_U32(sp + 88); +//nop; +t2 = MEM_U32(t0 + 0); +//nop; +if ((int)t2 >= 0) {//nop; +goto L435b24;} +//nop; +//nop; +a0 = t0; +//nop; +v0 = wrapper___filbuf(mem, a0); +goto L435b18; +//nop; +L435b18: +// bdead 40000009 gp = MEM_U32(sp + 48); +s0 = v0; +goto L435b40; +s0 = v0; +L435b24: +t5 = MEM_U32(sp + 88); +//nop; +t4 = MEM_U32(t5 + 4); +t3 = MEM_U32(t5 + 4); +s0 = MEM_U8(t4 + 0); +t9 = t3 + 0x1; +MEM_U32(t5 + 4) = t9; +L435b40: +MEM_U32(sp + 84) = s0; +L435b44: +t8 = MEM_U32(sp + 84); +at = 0xffffffff; +if (t8 != at) {//nop; +goto L435780;} +//nop; +L435b54: +t6 = MEM_U32(sp + 84); +at = 0xffffffff; +if (t6 != at) {//nop; +goto L435b7c;} +//nop; +//nop; +a0 = MEM_U32(sp + 88); +//nop; +wrapper_rewind(mem, a0); +goto L435b74; +//nop; +L435b74: +// bdead 1 gp = MEM_U32(sp + 48); +//nop; +L435b7c: +// bdead 1 ra = MEM_U32(sp + 52); +// bdead 1 s0 = MEM_U32(sp + 24); +// bdead 1 s1 = MEM_U32(sp + 28); +// bdead 1 s2 = MEM_U32(sp + 32); +// bdead 1 s3 = MEM_U32(sp + 36); +// bdead 1 s4 = MEM_U32(sp + 40); +// bdead 1 s5 = MEM_U32(sp + 44); +// bdead 1 sp = sp + 0x58; +return; +// bdead 1 sp = sp + 0x58; +} + +static uint32_t f_make_ii_file_name(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L435ba0: +//make_ii_file_name: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 48) = a0; +// fdead 4000002b MEM_U32(sp + 28) = ra; +a0 = MEM_U32(sp + 48); +// fdead 4000002b MEM_U32(sp + 24) = gp; +// fdead 4000002b MEM_U32(sp + 20) = s0; +v0 = f_basename(mem, sp, a0); +goto L435bcc; +// fdead 4000002b MEM_U32(sp + 20) = s0; +L435bcc: +// bdead 4000000b gp = MEM_U32(sp + 24); +MEM_U32(sp + 44) = v0; +//nop; +a0 = MEM_U32(sp + 44); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L435be4; +//nop; +L435be4: +// bdead 4000010b gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 44); +a1 = 0x10006c88; +//nop; +MEM_U32(sp + 40) = v0; +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L435c04; +a1 = a1; +L435c04: +MEM_U32(sp + 44) = v0; +t7 = MEM_U32(sp + 44); +t6 = MEM_U32(sp + 40); +// bdead 40018003 gp = MEM_U32(sp + 24); +t8 = t6 + t7; +t9 = MEM_U8(t8 + -2); +at = 0x2e; +if (t9 != at) {//nop; +goto L435c68;} +//nop; +t0 = MEM_U8(t8 + -1); +at = 0x6f; +if (t0 != at) {//nop; +goto L435c68;} +//nop; +t1 = 0x10006c8c; +//nop; +t1 = t1; +at = MEM_U8(t1 + 0); +//nop; +MEM_U8(t8 + -1) = (uint8_t)at; +t3 = MEM_U8(t1 + 1); +//nop; +MEM_U8(t8 + 0) = (uint8_t)t3; +at = MEM_U8(t1 + 2); +MEM_U8(t8 + 1) = (uint8_t)at; +goto L435c8c; +MEM_U8(t8 + 1) = (uint8_t)at; +L435c68: +t7 = 0x10006c90; +t4 = MEM_U32(sp + 44); +t7 = t7; +t5 = MEM_U32(sp + 40); +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t6 = t4 + t5; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +L435c8c: +//nop; +a0 = MEM_U32(sp + 48); +//nop; +v0 = f_dirname(mem, sp, a0); +goto L435c9c; +//nop; +L435c9c: +// bdead 4000000b gp = MEM_U32(sp + 24); +s0 = v0; +a1 = 0x10006c94; +//nop; +a2 = MEM_U32(sp + 44); +a0 = s0; +a3 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L435cc0; +a1 = a1; +L435cc0: +// bdead 9 ra = MEM_U32(sp + 28); +// bdead 9 gp = MEM_U32(sp + 24); +// bdead 9 s0 = MEM_U32(sp + 20); +// bdead 9 sp = sp + 0x30; +return v0; +// bdead 9 sp = sp + 0x30; +} + +static void f_update_instantiation_info_file(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L435cd4: +//update_instantiation_info_file: +//nop; +//nop; +//nop; +sp = sp + 0xffffffa8; +//nop; +MEM_U32(sp + 88) = a0; +// fdead 4000002b MEM_U32(sp + 52) = ra; +a0 = MEM_U32(sp + 88); +// fdead 4000002b MEM_U32(sp + 48) = gp; +// fdead 4000002b MEM_U32(sp + 44) = s1; +// fdead 4000002b MEM_U32(sp + 40) = s0; +v0 = f_make_ii_file_name(mem, sp, a0); +goto L435d04; +// fdead 4000002b MEM_U32(sp + 40) = s0; +L435d04: +// bdead 4000010b gp = MEM_U32(sp + 48); +MEM_U32(sp + 84) = v0; +a1 = 0x10006ca0; +//nop; +a0 = MEM_U32(sp + 84); +a2 = zero; +a1 = a1; +v0 = f_mkstr(mem, sp, a0, a1, a2, a3); +goto L435d24; +a1 = a1; +L435d24: +// bdead 4000000b gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 84); +a1 = 0x10006ca8; +//nop; +MEM_U32(sp + 80) = v0; +a1 = a1; +v0 = wrapper_fopen(mem, a0, a1); +goto L435d40; +a1 = a1; +L435d40: +MEM_U32(sp + 76) = v0; +t6 = MEM_U32(sp + 76); +// bdead 40008003 gp = MEM_U32(sp + 48); +if (t6 == 0) {//nop; +goto L43628c;} +//nop; +//nop; +//nop; +//nop; +f_init_curr_dir(mem, sp); +goto L435d64; +//nop; +L435d64: +// bdead 40000003 gp = MEM_U32(sp + 48); +//nop; +t7 = 0x10000234; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L435db0;} +//nop; +a2 = 0x10000558; +a0 = 0xfb528e4; +a1 = 0x10006cac; +//nop; +a3 = MEM_U32(sp + 84); +a2 = MEM_U32(a2 + 0); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L435da8; +a1 = a1; +L435da8: +// bdead 40000003 gp = MEM_U32(sp + 48); +//nop; +L435db0: +a1 = 0x10006cd4; +//nop; +a0 = MEM_U32(sp + 80); +a1 = a1; +v0 = wrapper_fopen(mem, a0, a1); +goto L435dc4; +a1 = a1; +L435dc4: +MEM_U32(sp + 72) = v0; +t8 = MEM_U32(sp + 72); +// bdead 42000003 gp = MEM_U32(sp + 48); +if (t8 != 0) {//nop; +goto L435e60;} +//nop; +t9 = 0x10006cf8; +a3 = 0x10006cd8; +t9 = t9; +MEM_U32(sp + 20) = t9; +//nop; +t0 = MEM_U32(sp + 80); +a0 = 0x1; +a1 = zero; +a2 = zero; +MEM_U32(sp + 16) = zero; +a3 = a3; +MEM_U32(sp + 24) = t0; +f_error(mem, sp, a0, a1, a2, a3); +goto L435e0c; +MEM_U32(sp + 24) = t0; +L435e0c: +// bdead 40000003 gp = MEM_U32(sp + 48); +//nop; +a0 = 0x10000558; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +wrapper_perror(mem, a0); +goto L435e28; +//nop; +L435e28: +// bdead 40000003 gp = MEM_U32(sp + 48); +//nop; +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L435e40; +//nop; +L435e40: +// bdead 40000003 gp = MEM_U32(sp + 48); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L435e58; +//nop; +L435e58: +// bdead 40000003 gp = MEM_U32(sp + 48); +//nop; +L435e60: +//nop; +a0 = MEM_U32(sp + 76); +//nop; +f_skip_old_ii_controls(mem, sp, a0); +goto L435e70; +//nop; +L435e70: +// bdead 40000003 gp = MEM_U32(sp + 48); +at = 0x1; +t1 = 0x1000a520; +//nop; +t1 = MEM_U32(t1 + 4); +//nop; +if (t1 != at) {//nop; +goto L435eb4;} +//nop; +t2 = 0x10000228; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L435eb4;} +//nop; +s1 = 0x10006d28; +s1 = s1; +goto L435ec0; +s1 = s1; +L435eb4: +s1 = 0x10006d2c; +//nop; +s1 = s1; +L435ec0: +t3 = 0x1000a520; +at = 0x1; +t3 = MEM_U32(t3 + 4); +//nop; +if (t3 != at) {//nop; +goto L435ef0;} +//nop; +t4 = 0x10000228; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L435f08;} +//nop; +L435ef0: +t5 = 0x1000a49c; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L435f14;} +//nop; +L435f08: +s0 = 0x10006d30; +s0 = s0; +goto L435f24; +s0 = s0; +L435f14: +s0 = 0x1000a49c; +//nop; +s0 = MEM_U32(s0 + 0); +//nop; +L435f24: +t6 = 0x1000a48c; +a2 = 0x1000a31c; +a1 = 0x10006d14; +//nop; +t6 = MEM_U32(t6 + 0); +a0 = MEM_U32(sp + 72); +a2 = MEM_U32(a2 + 0); +a3 = s1; +MEM_U32(sp + 16) = s0; +a1 = a1; +MEM_U32(sp + 20) = t6; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L435f54; +MEM_U32(sp + 20) = t6; +L435f54: +// bdead 40000103 gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 72); +a2 = 0x10000438; +a1 = 0x10006d34; +//nop; +a2 = MEM_U32(a2 + 0); +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L435f74; +a1 = a1; +L435f74: +// bdead 40000183 gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 72); +a1 = 0x10006d3c; +//nop; +a1 = a1; +//nop; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L435f90; +//nop; +L435f90: +// bdead 40000003 gp = MEM_U32(sp + 48); +//nop; +t7 = 0xfb51f00; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L435fcc;} +//nop; +//nop; +a0 = MEM_U32(sp + 76); +//nop; +v0 = wrapper___semgetc(mem, a0); +goto L435fc0; +//nop; +L435fc0: +// bdead 4000000b gp = MEM_U32(sp + 48); +s0 = v0; +goto L436038; +s0 = v0; +L435fcc: +t8 = MEM_U32(sp + 76); +//nop; +t9 = MEM_U32(t8 + 0); +//nop; +t0 = t9 + 0xffffffff; +MEM_U32(t8 + 0) = t0; +t1 = MEM_U32(sp + 76); +//nop; +t2 = MEM_U32(t1 + 0); +//nop; +if ((int)t2 >= 0) {//nop; +goto L436018;} +//nop; +//nop; +a0 = t1; +//nop; +v0 = wrapper___filbuf(mem, a0); +goto L43600c; +//nop; +L43600c: +// bdead 4000000b gp = MEM_U32(sp + 48); +s1 = v0; +goto L436034; +s1 = v0; +L436018: +t3 = MEM_U32(sp + 76); +//nop; +t4 = MEM_U32(t3 + 4); +t5 = MEM_U32(t3 + 4); +s1 = MEM_U8(t4 + 0); +t6 = t5 + 0x1; +MEM_U32(t3 + 4) = t6; +L436034: +s0 = s1; +L436038: +MEM_U32(sp + 68) = s0; +t7 = MEM_U32(sp + 68); +at = 0xffffffff; +if (t7 == at) {//nop; +goto L4361b0;} +//nop; +L43604c: +t9 = 0xfb51f00; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L436084;} +//nop; +//nop; +a0 = MEM_U32(sp + 68); +a1 = MEM_U32(sp + 72); +//nop; +v0 = wrapper___semputc(mem, a0, a1); +goto L436078; +//nop; +L436078: +// bdead 40000003 gp = MEM_U32(sp + 48); +//nop; +goto L4360fc; +//nop; +L436084: +t0 = MEM_U32(sp + 72); +//nop; +t8 = MEM_U32(t0 + 0); +//nop; +t2 = t8 + 0xffffffff; +MEM_U32(t0 + 0) = t2; +t1 = MEM_U32(sp + 72); +//nop; +t4 = MEM_U32(t1 + 0); +//nop; +if ((int)t4 >= 0) {//nop; +goto L4360d0;} +//nop; +//nop; +a0 = MEM_U32(sp + 68); +a1 = t1; +v0 = wrapper___flsbuf(mem, a0, a1); +goto L4360c4; +a1 = t1; +L4360c4: +// bdead 40000003 gp = MEM_U32(sp + 48); +//nop; +goto L4360fc; +//nop; +L4360d0: +t6 = MEM_U32(sp + 72); +t5 = MEM_U32(sp + 68); +t3 = MEM_U32(t6 + 4); +//nop; +MEM_U8(t3 + 0) = (uint8_t)t5; +t7 = MEM_U32(sp + 72); +//nop; +t9 = MEM_U32(t7 + 4); +//nop; +t8 = t9 + 0x1; +MEM_U32(t7 + 4) = t8; +L4360fc: +t2 = 0xfb51f00; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L436130;} +//nop; +//nop; +a0 = MEM_U32(sp + 76); +//nop; +v0 = wrapper___semgetc(mem, a0); +goto L436124; +//nop; +L436124: +// bdead 4000000b gp = MEM_U32(sp + 48); +s0 = v0; +goto L43619c; +s0 = v0; +L436130: +t0 = MEM_U32(sp + 76); +//nop; +t4 = MEM_U32(t0 + 0); +//nop; +t1 = t4 + 0xffffffff; +MEM_U32(t0 + 0) = t1; +t6 = MEM_U32(sp + 76); +//nop; +t5 = MEM_U32(t6 + 0); +//nop; +if ((int)t5 >= 0) {//nop; +goto L43617c;} +//nop; +//nop; +a0 = t6; +//nop; +v0 = wrapper___filbuf(mem, a0); +goto L436170; +//nop; +L436170: +// bdead 4000000b gp = MEM_U32(sp + 48); +s1 = v0; +goto L436198; +s1 = v0; +L43617c: +t3 = MEM_U32(sp + 76); +//nop; +t9 = MEM_U32(t3 + 4); +t8 = MEM_U32(t3 + 4); +s1 = MEM_U8(t9 + 0); +t7 = t8 + 0x1; +MEM_U32(t3 + 4) = t7; +L436198: +s0 = s1; +L43619c: +MEM_U32(sp + 68) = s0; +t2 = MEM_U32(sp + 68); +at = 0xffffffff; +if (t2 != at) {//nop; +goto L43604c;} +//nop; +L4361b0: +//nop; +a0 = MEM_U32(sp + 76); +//nop; +v0 = wrapper_fclose(mem, a0); +goto L4361c0; +//nop; +L4361c0: +// bdead 40000003 gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 72); +//nop; +//nop; +//nop; +v0 = wrapper_fclose(mem, a0); +goto L4361d8; +//nop; +L4361d8: +// bdead 40000003 gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 80); +//nop; +a1 = MEM_U32(sp + 84); +//nop; +v0 = wrapper_rename(mem, a0, a1); +goto L4361f0; +//nop; +L4361f0: +// bdead 4000000b gp = MEM_U32(sp + 48); +if ((int)v0 >= 0) {//nop; +goto L43628c;} +//nop; +t4 = 0x10006d64; +a3 = 0x10006d44; +t1 = MEM_U32(sp + 80); +t0 = MEM_U32(sp + 84); +//nop; +t4 = t4; +MEM_U32(sp + 20) = t4; +a0 = 0x1; +a1 = zero; +a2 = zero; +MEM_U32(sp + 16) = zero; +a3 = a3; +MEM_U32(sp + 24) = t1; +MEM_U32(sp + 28) = t0; +f_error(mem, sp, a0, a1, a2, a3); +goto L436238; +MEM_U32(sp + 28) = t0; +L436238: +// bdead 40000001 gp = MEM_U32(sp + 48); +//nop; +a0 = 0x10000558; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +wrapper_perror(mem, a0); +goto L436254; +//nop; +L436254: +// bdead 40000001 gp = MEM_U32(sp + 48); +//nop; +//nop; +//nop; +//nop; +f_cleanup(mem, sp); +goto L43626c; +//nop; +L43626c: +// bdead 40000001 gp = MEM_U32(sp + 48); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L436284; +//nop; +L436284: +// bdead 40000001 gp = MEM_U32(sp + 48); +//nop; +L43628c: +//nop; +a0 = MEM_U32(sp + 84); +//nop; +wrapper_free(mem, a0); +goto L43629c; +//nop; +L43629c: +// bdead 40000001 gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 80); +//nop; +//nop; +//nop; +wrapper_free(mem, a0); +goto L4362b4; +//nop; +L4362b4: +// bdead 1 ra = MEM_U32(sp + 52); +// bdead 1 gp = MEM_U32(sp + 48); +// bdead 1 s0 = MEM_U32(sp + 40); +// bdead 1 s1 = MEM_U32(sp + 44); +// bdead 1 sp = sp + 0x58; +return; +// bdead 1 sp = sp + 0x58; +} + +static uint32_t func_4362cc(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4362cc: +//nop; +//nop; +//nop; +sp = sp + 0xfffffd60; +a1 = 0x10006d80; +//nop; +MEM_U32(sp + 672) = a0; +// fdead 4000006b MEM_U32(sp + 28) = ra; +a2 = MEM_U32(sp + 672); +// fdead 400000eb MEM_U32(sp + 24) = gp; +// fdead 400000eb MEM_U32(sp + 20) = s0; +MEM_U32(sp + 100) = zero; +a0 = sp + 0x288; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_sprintf(mem, a0, a1, sp); +goto L436308; +a1 = a1; +L436308: +// bdead 40000083 gp = MEM_U32(sp + 24); +a0 = sp + 0x288; +//nop; +a1 = 0x402; +//nop; +v0 = wrapper_open(mem, a0, a1, a2); +goto L436320; +//nop; +L436320: +MEM_U32(sp + 668) = v0; +t6 = MEM_U32(sp + 668); +// bdead 40008103 gp = MEM_U32(sp + 24); +at = 0xffffffff; +if (t6 != at) {//nop; +goto L436384;} +//nop; +a0 = 0x10006d8c; +//nop; +a0 = a0; +//nop; +wrapper_perror(mem, a0); +goto L43634c; +//nop; +L43634c: +// bdead 40000003 gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 672); +//nop; +a1 = 0x9; +//nop; +v0 = wrapper_kill(mem, a0, a1); +goto L436364; +//nop; +L436364: +// bdead 40000003 gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L43637c; +//nop; +L43637c: +// bdead 40000103 gp = MEM_U32(sp + 24); +//nop; +L436384: +s0 = 0x10; +if (s0 == 0) {//nop; +goto L4363a8;} +//nop; +L436390: +s0 = s0 + 0xffffffff; +t7 = s0 << 2; +t8 = sp + 0x24; +t9 = t7 + t8; +if (s0 != 0) {MEM_U32(t9 + 0) = zero; +goto L436390;} +MEM_U32(t9 + 0) = zero; +L4363a8: +t0 = sp + 0x24; +t1 = MEM_U32(t0 + 0); +a1 = 0x7112; +t2 = t1 | 0x2; +MEM_U32(t0 + 0) = t2; +//nop; +a0 = MEM_U32(sp + 668); +a2 = sp + 0x24; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_ioctl(mem, a0, a1, sp); +goto L4363cc; +a2 = sp + 0x24; +L4363cc: +// bdead 40000009 gp = MEM_U32(sp + 24); +if ((int)v0 >= 0) {//nop; +goto L436424;} +//nop; +a0 = 0x10006d9c; +//nop; +a0 = a0; +//nop; +wrapper_perror(mem, a0); +goto L4363ec; +//nop; +L4363ec: +// bdead 40000001 gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 672); +//nop; +a1 = 0x9; +//nop; +v0 = wrapper_kill(mem, a0, a1); +goto L436404; +//nop; +L436404: +// bdead 40000001 gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L43641c; +//nop; +L43641c: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L436424: +//nop; +//nop; +// fdead 6002000f t9 = t9; +//nop; +func_436680(mem, sp); +goto L436438; +//nop; +L436438: +// bdead 40000101 gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 668); +//nop; +a1 = 0x7103; +a2 = sp + 0x68; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_ioctl(mem, a0, a1, sp); +goto L436450; +a2 = sp + 0x68; +L436450: +// bdead 40000009 gp = MEM_U32(sp + 24); +if ((int)v0 >= 0) {//nop; +goto L4364a8;} +//nop; +a0 = 0x10006da8; +//nop; +a0 = a0; +//nop; +wrapper_perror(mem, a0); +goto L436470; +//nop; +L436470: +// bdead 40000001 gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 672); +//nop; +a1 = 0x9; +//nop; +v0 = wrapper_kill(mem, a0, a1); +goto L436488; +//nop; +L436488: +// bdead 40000001 gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4364a0; +//nop; +L4364a0: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L4364a8: +t3 = MEM_S16(sp + 108); +at = 0x3; +if (t3 == at) {//nop; +goto L436504;} +//nop; +a0 = 0x10006db4; +//nop; +a0 = a0; +//nop; +wrapper_perror(mem, a0); +goto L4364cc; +//nop; +L4364cc: +// bdead 40000001 gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 672); +//nop; +a1 = 0x9; +//nop; +v0 = wrapper_kill(mem, a0, a1); +goto L4364e4; +//nop; +L4364e4: +// bdead 40000001 gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4364fc; +//nop; +L4364fc: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L436504: +t4 = MEM_S16(sp + 110); +at = 0x2; +if (t4 == at) {//nop; +goto L436560;} +//nop; +a0 = 0x10006dd0; +//nop; +a0 = a0; +//nop; +wrapper_perror(mem, a0); +goto L436528; +//nop; +L436528: +// bdead 40000001 gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 672); +//nop; +a1 = 0x9; +//nop; +v0 = wrapper_kill(mem, a0, a1); +goto L436540; +//nop; +L436540: +// bdead 40000001 gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L436558; +//nop; +L436558: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L436560: +t5 = MEM_U32(sp + 328); +//nop; +if (t5 == 0) {//nop; +goto L4365a4;} +//nop; +a0 = 0x10006df4; +//nop; +a0 = a0; +//nop; +wrapper_perror(mem, a0); +goto L436584; +//nop; +L436584: +// bdead 40000001 gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L43659c; +//nop; +L43659c: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L4365a4: +// bdead 40000001 ra = MEM_U32(sp + 28); +v0 = MEM_U32(sp + 668); +// bdead 9 s0 = MEM_U32(sp + 20); +// bdead 9 sp = sp + 0x2a0; +return v0; +// bdead 9 sp = sp + 0x2a0; +} + +static void func_4365b8(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4365b8: +//nop; +//nop; +//nop; +t6 = 0x1000a458; +sp = sp + 0xffffffd8; +//nop; +// fdead 4000800b MEM_U32(sp + 28) = ra; +// fdead 4000800b MEM_U32(sp + 24) = gp; +t6 = t6; +a0 = MEM_U32(t6 + 4); +//nop; +v0 = wrapper_close(mem, a0); +goto L4365e8; +//nop; +L4365e8: +// bdead 40000003 gp = MEM_U32(sp + 24); +a1 = sp + 0x27; +t7 = 0x1000a458; +//nop; +t7 = t7; +a0 = MEM_U32(t7 + 0); +a2 = 0x1; +v0 = wrapper_read(mem, a0, a1, a2); +goto L436608; +a2 = 0x1; +L436608: +t8 = v0 ^ 0x1; +t8 = zero < t8; +MEM_U32(sp + 32) = t8; +t9 = MEM_U32(sp + 32); +// bdead 44000001 gp = MEM_U32(sp + 24); +if (t9 == 0) {//nop; +goto L436658;} +//nop; +a0 = 0x10006e08; +//nop; +a0 = a0; +//nop; +wrapper_perror(mem, a0); +goto L436638; +//nop; +L436638: +// bdead 40000001 gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L436650; +//nop; +L436650: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L436658: +t0 = 0x1000a458; +//nop; +t0 = t0; +a0 = MEM_U32(t0 + 0); +//nop; +v0 = wrapper_close(mem, a0); +goto L436670; +//nop; +L436670: +// bdead 1 ra = MEM_U32(sp + 28); +// bdead 1 gp = MEM_U32(sp + 24); +// bdead 1 sp = sp + 0x28; +return; +// bdead 1 sp = sp + 0x28; +} + +static void func_436680(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L436680: +//nop; +//nop; +//nop; +t6 = 0x1000a458; +sp = sp + 0xffffffd8; +//nop; +// fdead 4000800b MEM_U32(sp + 28) = ra; +// fdead 4000800b MEM_U32(sp + 24) = gp; +t6 = t6; +a0 = MEM_U32(t6 + 0); +//nop; +v0 = wrapper_close(mem, a0); +goto L4366b0; +//nop; +L4366b0: +// bdead 40000001 gp = MEM_U32(sp + 24); +a1 = sp + 0x27; +t7 = 0x1000a458; +//nop; +t7 = t7; +a0 = MEM_U32(t7 + 4); +a2 = 0x1; +v0 = wrapper_write(mem, a0, a1, a2); +goto L4366d0; +a2 = 0x1; +L4366d0: +// bdead 40000009 gp = MEM_U32(sp + 24); +at = 0x1; +if (v0 == at) {//nop; +goto L436714;} +//nop; +a0 = 0x10006e1c; +//nop; +a0 = a0; +//nop; +wrapper_perror(mem, a0); +goto L4366f4; +//nop; +L4366f4: +// bdead 40000001 gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L43670c; +//nop; +L43670c: +// bdead 40000001 gp = MEM_U32(sp + 24); +//nop; +L436714: +t8 = 0x1000a458; +//nop; +t8 = t8; +a0 = MEM_U32(t8 + 4); +//nop; +v0 = wrapper_close(mem, a0); +goto L43672c; +//nop; +L43672c: +// bdead 1 ra = MEM_U32(sp + 28); +// bdead 1 gp = MEM_U32(sp + 24); +// bdead 1 sp = sp + 0x28; +return; +// bdead 1 sp = sp + 0x28; +} + +static void func_43673c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43673c: +//nop; +//nop; +//nop; +sp = sp + 0xffffff88; +t6 = 0x10000380; +//nop; +t6 = MEM_U32(t6 + 0); +at = 0x1; +// fdead 4000806f MEM_U32(sp + 60) = ra; +t7 = (int)at < (int)t6; +// fdead 4001806f MEM_U32(sp + 56) = gp; +MEM_U32(sp + 120) = a0; +MEM_U32(sp + 124) = a1; +MEM_U32(sp + 68) = t7; +MEM_U32(sp + 72) = zero; +MEM_U32(sp + 76) = zero; +MEM_U32(sp + 80) = zero; +MEM_U32(sp + 84) = zero; +MEM_U32(sp + 88) = zero; +MEM_U32(sp + 92) = zero; +MEM_U32(sp + 96) = zero; +MEM_U32(sp + 100) = zero; +v0 = wrapper_getpagesize(mem); +goto L436798; +MEM_U32(sp + 100) = zero; +L436798: +t8 = MEM_U32(sp + 124); +// bdead 4200010b gp = MEM_U32(sp + 56); +MEM_U32(sp + 104) = v0; +if ((int)t8 <= 0) {MEM_U32(sp + 116) = zero; +goto L436d14;} +MEM_U32(sp + 116) = zero; +L4367ac: +t9 = MEM_U32(sp + 116); +t1 = 0x10008310; +t0 = t9 << 6; +t1 = t1; +MEM_U32(sp + 112) = zero; +t2 = t0 + t1; +t3 = MEM_U32(t2 + 12); +at = 0x80d; +t4 = t3 & 0xffff; +if (t4 != at) {MEM_U32(sp + 108) = t4; +goto L4367fc;} +MEM_U32(sp + 108) = t4; +t5 = MEM_U32(t2 + 16); +t6 = MEM_U32(sp + 104); +t8 = MEM_U32(sp + 100); +lo = t5 * t6; +hi = (uint32_t)((uint64_t)t5 * (uint64_t)t6 >> 32); +t0 = 0x1; +MEM_U32(sp + 112) = t0; +t7 = lo; +t9 = t8 + t7; +MEM_U32(sp + 100) = t9; +L4367fc: +t1 = MEM_U32(sp + 108); +at = 0xd; +if (t1 != at) {//nop; +goto L436844;} +//nop; +t3 = MEM_U32(sp + 116); +t2 = 0x10008310; +t4 = t3 << 6; +t2 = t2; +t5 = t4 + t2; +t6 = MEM_U32(t5 + 16); +t8 = MEM_U32(sp + 104); +t9 = MEM_U32(sp + 84); +lo = t6 * t8; +hi = (uint32_t)((uint64_t)t6 * (uint64_t)t8 >> 32); +t1 = 0x1; +MEM_U32(sp + 112) = t1; +t7 = lo; +t0 = t9 + t7; +MEM_U32(sp + 84) = t0; +L436844: +t3 = MEM_U32(sp + 108); +at = 0x2003; +if (t3 != at) {//nop; +goto L4368a0;} +//nop; +t4 = MEM_U32(sp + 116); +t5 = 0x10008310; +t2 = t4 << 6; +t5 = t5; +t6 = t2 + t5; +t8 = MEM_U32(t6 + 0); +at = 0x10000000; +at = t8 < at; +if (at == 0) {//nop; +goto L4368a0;} +//nop; +t9 = MEM_U32(t6 + 16); +t7 = MEM_U32(sp + 104); +t1 = MEM_U32(sp + 80); +lo = t9 * t7; +hi = (uint32_t)((uint64_t)t9 * (uint64_t)t7 >> 32); +t4 = 0x1; +MEM_U32(sp + 112) = t4; +t0 = lo; +t3 = t1 + t0; +MEM_U32(sp + 80) = t3; +L4368a0: +t2 = MEM_U32(sp + 108); +at = 0x3; +if (t2 == at) {at = 0x1; +goto L4368c8;} +at = 0x1; +if (t2 == at) {at = 0xb; +goto L4368c8;} +at = 0xb; +if (t2 == at) {at = 0x9; +goto L4368c8;} +at = 0x9; +if (t2 != at) {//nop; +goto L436914;} +//nop; +L4368c8: +t5 = MEM_U32(sp + 116); +t6 = 0x10008310; +t8 = t5 << 6; +t6 = t6; +t9 = t8 + t6; +t7 = MEM_U32(t9 + 0); +at = 0x10000000; +at = t7 < at; +if (at == 0) {//nop; +goto L436914;} +//nop; +t1 = MEM_U32(t9 + 16); +t0 = MEM_U32(sp + 104); +t4 = MEM_U32(sp + 72); +lo = t1 * t0; +hi = (uint32_t)((uint64_t)t1 * (uint64_t)t0 >> 32); +t5 = 0x1; +MEM_U32(sp + 112) = t5; +t3 = lo; +t2 = t4 + t3; +MEM_U32(sp + 72) = t2; +L436914: +t8 = MEM_U32(sp + 108); +at = 0xfffff7ff; +t6 = t8 & at; +at = 0x2003; +if (t6 != at) {MEM_U32(sp + 108) = t6; +goto L436978;} +MEM_U32(sp + 108) = t6; +t7 = MEM_U32(sp + 116); +t1 = 0x10008310; +t9 = t7 << 6; +t1 = t1; +t0 = t9 + t1; +t4 = MEM_U32(t0 + 0); +at = 0x10000000; +at = t4 < at; +if (at != 0) {//nop; +goto L436978;} +//nop; +t3 = MEM_U32(t0 + 16); +t2 = MEM_U32(sp + 104); +t8 = MEM_U32(sp + 96); +lo = t3 * t2; +hi = (uint32_t)((uint64_t)t3 * (uint64_t)t2 >> 32); +t7 = 0x1; +MEM_U32(sp + 112) = t7; +t5 = lo; +t6 = t8 + t5; +MEM_U32(sp + 96) = t6; +L436978: +t9 = MEM_U32(sp + 108); +at = 0x2013; +if (t9 != at) {//nop; +goto L4369d4;} +//nop; +t1 = MEM_U32(sp + 116); +t0 = 0x10008310; +t4 = t1 << 6; +t0 = t0; +t3 = t4 + t0; +t2 = MEM_U32(t3 + 0); +at = 0x10000000; +at = t2 < at; +if (at != 0) {//nop; +goto L4369d4;} +//nop; +t8 = MEM_U32(t3 + 16); +t5 = MEM_U32(sp + 104); +t7 = MEM_U32(sp + 92); +lo = t8 * t5; +hi = (uint32_t)((uint64_t)t8 * (uint64_t)t5 >> 32); +t1 = 0x1; +MEM_U32(sp + 112) = t1; +t6 = lo; +t9 = t7 + t6; +MEM_U32(sp + 92) = t9; +L4369d4: +t4 = MEM_U32(sp + 108); +at = 0x23; +if (t4 != at) {//nop; +goto L436a1c;} +//nop; +t0 = MEM_U32(sp + 116); +t3 = 0x10008310; +t2 = t0 << 6; +t3 = t3; +t8 = t2 + t3; +t5 = MEM_U32(t8 + 16); +t7 = MEM_U32(sp + 104); +t9 = MEM_U32(sp + 88); +lo = t5 * t7; +hi = (uint32_t)((uint64_t)t5 * (uint64_t)t7 >> 32); +t4 = 0x1; +MEM_U32(sp + 112) = t4; +t6 = lo; +t1 = t9 + t6; +MEM_U32(sp + 88) = t1; +L436a1c: +t0 = MEM_U32(sp + 112); +//nop; +if (t0 != 0) {//nop; +goto L436a50;} +//nop; +a0 = 0xfb528e4; +a1 = 0x10006e34; +//nop; +a2 = MEM_U32(sp + 116); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436a48; +a1 = a1; +L436a48: +// bdead 40000103 gp = MEM_U32(sp + 56); +//nop; +L436a50: +t2 = MEM_U32(sp + 68); +//nop; +if (t2 != 0) {//nop; +goto L436a70;} +//nop; +t3 = MEM_U32(sp + 112); +//nop; +if (t3 != 0) {//nop; +goto L436cfc;} +//nop; +L436a70: +t8 = MEM_U32(sp + 116); +t7 = 0x10008310; +t5 = t8 << 6; +t7 = t7; +t9 = t5 + t7; +a3 = MEM_U32(t9 + 0); +//nop; +a0 = 0xfb528e4; +a1 = 0x10006e58; +a2 = t8; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436aa4; +a1 = a1; +L436aa4: +// bdead 40000003 gp = MEM_U32(sp + 56); +t6 = MEM_U32(sp + 116); +t4 = 0x10008310; +t1 = t6 << 6; +t4 = t4; +a0 = 0xfb528e4; +a1 = 0x10006e6c; +//nop; +t0 = t1 + t4; +a3 = MEM_U32(t0 + 4); +a2 = t6; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436adc; +a1 = a1; +L436adc: +// bdead 40000003 gp = MEM_U32(sp + 56); +t2 = MEM_U32(sp + 116); +t8 = 0x10008310; +t3 = t2 << 6; +t8 = t8; +a0 = 0xfb528e4; +a1 = 0x10006e80; +//nop; +t5 = t3 + t8; +a3 = MEM_U32(t5 + 8); +a2 = t2; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436b14; +a1 = a1; +L436b14: +// bdead 40000003 gp = MEM_U32(sp + 56); +t7 = MEM_U32(sp + 116); +t6 = 0x10008310; +t9 = t7 << 6; +t6 = t6; +t1 = t9 + t6; +//nop; +a0 = 0xfb528e4; +a1 = 0x10006e94; +a3 = MEM_U32(t1 + 12); +a2 = t7; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436b4c; +a1 = a1; +L436b4c: +// bdead 40000003 gp = MEM_U32(sp + 56); +t4 = MEM_U32(sp + 116); +t2 = 0x10008310; +t0 = t4 << 6; +t2 = t2; +a0 = 0xfb528e4; +a1 = 0x10006ea8; +//nop; +t3 = t0 + t2; +a3 = MEM_U32(t3 + 16); +a2 = t4; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436b84; +a1 = a1; +L436b84: +// bdead 40000003 gp = MEM_U32(sp + 56); +t8 = MEM_U32(sp + 116); +t7 = 0x10008310; +t5 = t8 << 6; +t7 = t7; +t9 = t5 + t7; +a3 = MEM_U32(t9 + 20); +//nop; +a0 = 0xfb528e4; +a1 = 0x10006ebc; +a2 = t8; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436bbc; +a1 = a1; +L436bbc: +// bdead 40000003 gp = MEM_U32(sp + 56); +t6 = MEM_U32(sp + 116); +t4 = 0x10008310; +t1 = t6 << 6; +t4 = t4; +a0 = 0xfb528e4; +a1 = 0x10006ed0; +//nop; +t0 = t1 + t4; +a3 = MEM_U32(t0 + 24); +a2 = t6; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436bf4; +a1 = a1; +L436bf4: +// bdead 40000003 gp = MEM_U32(sp + 56); +t2 = MEM_U32(sp + 116); +t8 = 0x10008310; +t3 = t2 << 6; +t8 = t8; +a0 = 0xfb528e4; +a1 = 0x10006ee4; +//nop; +t5 = t3 + t8; +a3 = MEM_U32(t5 + 28); +a2 = t2; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436c2c; +a1 = a1; +L436c2c: +// bdead 40000003 gp = MEM_U32(sp + 56); +t7 = MEM_U32(sp + 116); +t6 = 0x10008310; +t9 = t7 << 6; +t6 = t6; +t1 = t9 + t6; +//nop; +a0 = 0xfb528e4; +a1 = 0x10006ef8; +a3 = MEM_U32(t1 + 32); +a2 = t7; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436c64; +a1 = a1; +L436c64: +// bdead 40000003 gp = MEM_U32(sp + 56); +t4 = MEM_U32(sp + 116); +t2 = 0x10008310; +t0 = t4 << 6; +t2 = t2; +a0 = 0xfb528e4; +a1 = 0x10006f0c; +//nop; +t3 = t0 + t2; +a3 = MEM_U32(t3 + 36); +a2 = t4; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436c9c; +a1 = a1; +L436c9c: +// bdead 40000003 gp = MEM_U32(sp + 56); +t8 = MEM_U32(sp + 116); +t7 = 0x10008310; +t5 = t8 << 6; +t7 = t7; +t9 = t5 + t7; +a3 = MEM_U32(t9 + 40); +//nop; +a0 = 0xfb528e4; +a1 = 0x10006f20; +a2 = t8; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436cd4; +a1 = a1; +L436cd4: +// bdead 40000183 gp = MEM_U32(sp + 56); +//nop; +a0 = 0xfb528e4; +a1 = 0x10006f34; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436cf4; +a1 = a1; +L436cf4: +// bdead 40000103 gp = MEM_U32(sp + 56); +//nop; +L436cfc: +t6 = MEM_U32(sp + 116); +t4 = MEM_U32(sp + 124); +t1 = t6 + 0x1; +at = (int)t1 < (int)t4; +if (at != 0) {MEM_U32(sp + 116) = t1; +goto L4367ac;} +MEM_U32(sp + 116) = t1; +L436d14: +t8 = MEM_U32(sp + 92); +t2 = MEM_U32(sp + 96); +t6 = MEM_U32(sp + 84); +t7 = MEM_U32(sp + 88); +t5 = t8 >> 10; +t4 = MEM_U32(sp + 80); +MEM_U32(sp + 20) = t5; +t3 = t2 >> 10; +t1 = t6 >> 10; +t5 = MEM_U32(sp + 76); +MEM_U32(sp + 28) = t1; +MEM_U32(sp + 16) = t3; +t9 = t7 >> 10; +t1 = MEM_U32(sp + 72); +MEM_U32(sp + 24) = t9; +t3 = t4 >> 10; +t0 = MEM_U32(sp + 100); +MEM_U32(sp + 32) = t3; +t9 = t5 >> 10; +MEM_U32(sp + 36) = t9; +t3 = t1 >> 10; +MEM_U32(sp + 40) = t3; +t9 = t0 + t2; +t3 = t9 + t8; +a3 = t0 >> 10; +t0 = t3 + t7; +t2 = t0 + t6; +t9 = t2 + t4; +t8 = t9 + t5; +//nop; +a0 = 0xfb528e4; +a1 = 0x10006f38; +t3 = t8 + t1; +t7 = t3 >> 10; +a2 = MEM_U32(sp + 120); +MEM_U32(sp + 44) = t7; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436db0; +a1 = a1; +L436db0: +t0 = MEM_U32(sp + 68); +// bdead 40000301 gp = MEM_U32(sp + 56); +if (t0 == 0) {//nop; +goto L436f64;} +//nop; +a2 = MEM_U32(sp + 100); +a0 = 0xfb528e4; +a1 = 0x10006f78; +//nop; +t6 = a2 >> 10; +a2 = t6; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436de4; +a1 = a1; +L436de4: +// bdead 40000101 gp = MEM_U32(sp + 56); +a2 = MEM_U32(sp + 96); +a0 = 0xfb528e4; +a1 = 0x10006f90; +//nop; +t2 = a2 >> 10; +a2 = t2; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436e0c; +a1 = a1; +L436e0c: +// bdead 40000101 gp = MEM_U32(sp + 56); +a2 = MEM_U32(sp + 92); +a0 = 0xfb528e4; +a1 = 0x10006fa8; +//nop; +t4 = a2 >> 10; +a2 = t4; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436e34; +a1 = a1; +L436e34: +// bdead 40000101 gp = MEM_U32(sp + 56); +a2 = MEM_U32(sp + 88); +a0 = 0xfb528e4; +t9 = a2 >> 10; +a2 = t9; +//nop; +a1 = 0x10006fc0; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436e5c; +a1 = a1; +L436e5c: +// bdead 40000101 gp = MEM_U32(sp + 56); +a2 = MEM_U32(sp + 84); +a0 = 0xfb528e4; +a1 = 0x10006fd8; +//nop; +t5 = a2 >> 10; +a2 = t5; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436e84; +a1 = a1; +L436e84: +// bdead 40000101 gp = MEM_U32(sp + 56); +a2 = MEM_U32(sp + 80); +a0 = 0xfb528e4; +a1 = 0x10006ff4; +//nop; +t8 = a2 >> 10; +a2 = t8; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436eac; +a1 = a1; +L436eac: +// bdead 40000101 gp = MEM_U32(sp + 56); +a2 = MEM_U32(sp + 76); +a0 = 0xfb528e4; +a1 = 0x10007010; +//nop; +t1 = a2 >> 10; +a2 = t1; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436ed4; +a1 = a1; +L436ed4: +// bdead 40000101 gp = MEM_U32(sp + 56); +a2 = MEM_U32(sp + 72); +a0 = 0xfb528e4; +a1 = 0x1000702c; +//nop; +t3 = a2 >> 10; +a2 = t3; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436efc; +a1 = a1; +L436efc: +t7 = MEM_U32(sp + 100); +t0 = MEM_U32(sp + 96); +t2 = MEM_U32(sp + 92); +t9 = MEM_U32(sp + 88); +t6 = t7 + t0; +t8 = MEM_U32(sp + 84); +t4 = t6 + t2; +// bdead 46002101 gp = MEM_U32(sp + 56); +t3 = MEM_U32(sp + 80); +t5 = t4 + t9; +t0 = MEM_U32(sp + 76); +t1 = t5 + t8; +t2 = MEM_U32(sp + 72); +t7 = t1 + t3; +t6 = t7 + t0; +//nop; +a0 = 0xfb528e4; +a1 = 0x10007044; +a2 = t6 + t2; +t4 = a2 >> 10; +a2 = t4; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L436f5c; +a1 = a1; +L436f5c: +// bdead 1 gp = MEM_U32(sp + 56); +//nop; +L436f64: +// bdead 1 ra = MEM_U32(sp + 60); +// bdead 1 sp = sp + 0x78; +//nop; +return; +//nop; +//nop; +//nop; +//nop; +} + +static uint32_t f_gethostsex(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, +s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L436f80: +//gethostsex: +sp = sp + 0xfffffff8; +t6 = 0x1; +MEM_U32(sp + 4) = t6; +t7 = MEM_S8(sp + 4); +at = 0x1; +if (t7 != at) {v0 = zero; +goto L436fa4;} +v0 = zero; +v0 = 0x1; +goto L436fa4; +v0 = 0x1; +L436fa4: +// bdead 9 sp = sp + 0x8; +return v0; +// bdead 9 sp = sp + 0x8; +//nop; +} diff --git a/ido/ido5.3_recomp/cfe b/ido/ido5.3_recomp/cfe new file mode 100755 index 00000000..87efb3db Binary files /dev/null and b/ido/ido5.3_recomp/cfe differ diff --git a/ido/ido5.3_recomp/copt b/ido/ido5.3_recomp/copt new file mode 100755 index 00000000..435dc8b9 Binary files /dev/null and b/ido/ido5.3_recomp/copt differ diff --git a/ido/ido5.3_recomp/elf.h b/ido/ido5.3_recomp/elf.h new file mode 100644 index 00000000..91ba5fe2 --- /dev/null +++ b/ido/ido5.3_recomp/elf.h @@ -0,0 +1,99 @@ +#ifndef ELF_H +#define ELF_H + +#include + +#define EI_DATA 5 +#define EI_NIDENT 16 +#define SHT_SYMTAB 2 +#define SHT_DYNAMIC 6 +#define SHT_REL 9 +#define SHT_DYNSYM 11 +#define SHT_MIPS_REGINFO 0x70000006 +#define STN_UNDEF 0 +#define STT_OBJECT 1 +#define STT_FUNC 2 +#define DT_PLTGOT 3 +#define DT_MIPS_LOCAL_GOTNO 0x7000000a +#define DT_MIPS_SYMTABNO 0x70000011 +#define DT_MIPS_GOTSYM 0x70000013 + +#define ELF32_R_SYM(info) ((info) >> 8) +#define ELF32_R_TYPE(info) ((info) & 0xff) + +#define ELF32_ST_TYPE(info) ((info) & 0xf) + +#define R_MIPS_26 4 +#define R_MIPS_HI16 5 +#define R_MIPS_LO16 6 + +#define SHN_UNDEF 0 +#define SHN_COMMON 0xfff2 +#define SHN_MIPS_ACOMMON 0xff00 +#define SHN_MIPS_TEXT 0xff01 +#define SHN_MIPS_DATA 0xff02 + +typedef uint32_t Elf32_Addr; +typedef uint32_t Elf32_Off; + +typedef struct { + uint8_t e_ident[EI_NIDENT]; + uint16_t e_type; + uint16_t e_machine; + uint32_t e_version; + Elf32_Addr e_entry; + Elf32_Off e_phoff; + Elf32_Off e_shoff; + uint32_t e_flags; + uint16_t e_ehsize; + uint16_t e_phentsize; + uint16_t e_phnum; + uint16_t e_shentsize; + uint16_t e_shnum; + uint16_t e_shstrndx; +} Elf32_Ehdr; + +typedef struct { + uint32_t sh_name; + uint32_t sh_type; + uint32_t sh_flags; + Elf32_Addr sh_addr; + Elf32_Off sh_offset; + uint32_t sh_size; + uint32_t sh_link; + uint32_t sh_info; + uint32_t sh_addralign; + uint32_t sh_entsize; +} Elf32_Shdr; + +typedef struct { + uint32_t st_name; + Elf32_Addr st_value; + uint32_t st_size; + uint8_t st_info; + uint8_t st_other; + uint16_t st_shndx; +} Elf32_Sym; + +typedef struct { + Elf32_Addr r_offset; + uint32_t r_info; +} Elf32_Rel; + +typedef struct +{ + uint32_t ri_gprmask; /* General registers used. */ + uint32_t ri_cprmask[4]; /* Coprocessor registers used. */ + int32_t ri_gp_value; /* $gp register value. */ +} Elf32_RegInfo; + +typedef struct +{ + int32_t d_tag; /* Dynamic entry type */ + union { + uint32_t d_val; /* Integer value */ + Elf32_Addr d_ptr; /* Address value */ + } d_un; +} Elf32_Dyn; + +#endif diff --git a/ido/ido5.3_recomp/err.english.cc b/ido/ido5.3_recomp/err.english.cc new file mode 100644 index 00000000..6976e38a --- /dev/null +++ b/ido/ido5.3_recomp/err.english.cc @@ -0,0 +1,1260 @@ +@ + 358 358 358 + 6464 6482 6553 + 6553 6593 6728 + 6728 6746 6803 + 6803 6808 6808 + 6808 6818 6818 + 6818 6826 6826 + 6826 6847 6847 + 6847 6875 6922 + 6922 6930 6930 + 6930 6939 6939 + 6939 6948 6948 + 6948 6974 7120 + 7120 7149 7204 + 7210 7248 7311 + 7317 7350 7442 + 7450 7497 7627 + 7635 7709 7930 + 7938 7975 8063 + 8071 8113 8253 + 8261 8289 8289 + 8298 8338 8445 + 8460 8502 8635 + 8650 8690 8819 + 8834 8857 8965 + 8965 9008 9113 + 9119 9142 9227 + 9235 9282 9451 + 9451 9462 9462 + 9462 9477 9477 + 9477 9497 9497 + 9497 9545 9545 + 9545 9584 9584 + 9584 9604 9662 + 9662 9682 9720 + 9720 9749 9749 + 9749 9788 9788 + 9788 9802 9802 + 9802 9829 9829 + 9829 9861 9861 + 9861 9904 9904 + 9904 9920 9920 + 9920 9962 9962 + 9962 9988 9988 + 9988 10014 10014 +10014 10035 10035 +10035 10054 10097 +10097 10115 10115 +10115 10147 10147 +10147 10183 10183 +10183 10208 10208 +10208 10236 10236 +10236 10269 10269 +10269 10304 10304 +10304 10328 10328 +10328 10351 10351 +10351 10371 10371 +10371 10402 10402 +10402 10447 10447 +10447 10497 10497 +10497 10533 10533 +10533 10598 10598 +10606 10630 10630 +10640 10671 10671 +10690 10719 10719 +10728 10752 10795 +10795 10837 10837 +10837 10876 10876 +10876 10900 10900 +10900 10948 10948 +10960 11021 11103 +11103 11128 11128 +11128 11153 11153 +11153 11216 11216 +11216 11239 11239 +11239 11303 11303 +11303 11347 11347 +11357 11393 11393 +11393 11432 11432 +11442 11494 11494 +11494 11536 11536 +11536 11595 11595 +11595 11622 11622 +11622 11684 11684 +11684 11726 11726 +11738 11778 11778 +11782 11813 11813 +11813 11850 11850 +11850 11900 12087 +12111 12120 12120 +12120 12129 12129 +12129 12158 12158 +12158 12192 12192 +12192 12237 12237 +12237 12273 12273 +12273 12326 12326 +12330 12366 12366 +12366 12423 12423 +12427 12482 12482 +12486 12560 12560 +12568 12631 12631 +12637 12691 12691 +12691 12743 12743 +12743 12785 12785 +12785 12826 12826 +12826 12865 12865 +12865 12883 12883 +12883 12946 12946 +12956 12995 12995 +13005 13066 13066 +13077 13163 13163 +13163 13211 13211 +13211 13270 13270 +13270 13318 13318 +13318 13350 13350 +13350 13387 13387 +13387 13428 13428 +13428 13464 13533 +13533 13580 13737 +13737 13776 13854 +13854 13913 13913 +13913 13950 13950 +13950 14118 14118 +14118 14150 14150 +14150 14163 14194 +14194 14224 14255 +14255 14275 14319 +14319 14353 14458 +14466 14484 14530 +14534 14567 14567 +14567 14635 14682 +14690 14742 14742 +14742 14789 14789 +14801 14875 14875 +14886 14947 14947 +14947 14992 14992 +14992 15035 15085 +15085 15134 15205 +15214 15267 15448 +15454 15496 16810 +16822 16875 16960 +16972 17053 17179 +17191 17236 17332 +17344 17491 17841 +17853 17939 18304 +18316 18471 18774 +18786 18952 19323 +19335 19364 19496 +19500 19527 19598 +19598 19613 19776 +19797 19808 19837 +19837 19862 19862 +19868 19927 20026 +20034 20075 20179 +20187 20223 20223 +20223 20290 20382 +20392 20441 20589 +20601 20656 20656 +20656 20699 20818 +20826 20860 21038 +21046 21094 21191 +21203 21236 21314 +21326 21395 21457 +21469 21502 21502 +21502 21587 21731 +21756 21789 21864 +21875 21901 21976 +22013 22059 22220 +22257 22397 22561 +22561 22595 22595 +22603 22623 22623 +22631 22667 22828 +22865 22919 22994 +23031 23059 23120 +23132 23201 23201 +23212 23274 23274 +23285 23345 23345 +23356 23393 23393 +23399 23431 23532 +23542 23587 23646 +23656 23697 23745 +23755 23796 23844 +23854 23876 23928 +23942 23971 24153 +24160 24243 24243 +24247 24273 24743 +24755 24784 24984 +24996 25034 25034 +25034 25075 25273 +25281 25332 25410 +25420 25467 25544 +25554 25583 25744 +25754 25783 26061 +26071 26111 26185 +26194 26239 26525 +26535 26568 26914 +26924 26951 26998 +27008 27035 27082 +27093 27120 27167 +27178 27206 27251 +27261 27289 27334 +27345 27391 27931 +27938 27959 28007 +28019 28037 28037 +28043 28069 28069 +28077 28147 28199 +28207 28266 28266 +28274 28306 28306 +28314 28339 28339 +28347 28404 28510 +28518 28567 28682 +28690 28728 28728 +28736 28782 29023 +29033 29085 29234 +29246 29303 29383 +29395 29432 29570 +29592 29631 29644 +29644 29693 29758 +29767 29810 29875 +29875 29911 29976 +29984 30014 30014 +30027 30086 30151 +30157 30223 30293 +30301 30369 30445 +30457 30511 30568 +30580 30630 30743 +30755 30812 30874 +30886 30959 31035 +31043 31076 31175 +31183 31243 31243 +31251 31323 31323 +31331 31433 31433 +31445 31544 31686 +31698 31740 31740 +31740 31783 31783 +31783 31824 31824 +31824 31873 31996 +32008 32056 32164 +32176 32210 32210 +32229 32271 32271 +32279 32323 32569 +32581 32642 32718 +32739 32779 32916 +32926 32953 33047 +33057 33116 33315 +33325 33373 33373 +33373 33407 33469 +33494 33527 33527 +33536 33573 33573 +33584 33650 33697 +33705 33763 33763 +33763 33797 33797 +33797 33829 33906 +33915 33976 33976 +33985 34016 34098 +34098 34133 34198 +34198 34261 34261 +34269 34312 34312 +34324 34363 34438 +34444 34530 34530 +34538 34596 34626 +34636 34675 34754 +34764 34821 34821 +34821 34867 34950 +34959 35016 35135 +35145 35198 35198 +35208 35266 35344 +35355 35382 35537 +35547 35576 35629 +35637 35705 35705 +35713 35764 35764 +35764 35784 35876 +35888 35932 35950 +35950 36013 36138 +36150 36191 36280 +36286 36314 36419 +36431 36516 36516 +36516 36554 36642 +36642 36689 36808 +36818 36881 37105 +37113 37183 37204 +37204 37225 37225 +37225 37255 37348 +37348 37388 37388 +37388 37454 37454 +37454 37518 37518 +37518 37584 37584 +37584 37717 37717 +37717 37752 37752 +37752 37783 37889 +37901 37928 38034 +38046 38115 38115 +38115 38140 38187 +38195 38219 38339 +38351 38422 38422 +38422 38486 38486 +38486 38555 38555 +38555 38619 38619 +38619 38641 38641 +38641 38758 38758 +38758 38929 38929 +38929 38975 39043 +39055 39084 39133 +39133 39175 39265 +39275 39310 39494 +39504 39547 39576 +39587 39614 39668 +39674 39697 39797 +39797 39845 40094 +40094 40158 40264 +40264 40369 40523 +40523 40593 40593 +40593 40629 40876 +40876 40911 40971 +40977 41026 41026 +41038 41077 41077 +41077 41116 41116 +41116 41156 41156 +41156 41195 41195 +41195 41237 41237 +41237 41285 41285 +41285 41304 41304 +41304 41371 41371 +41371 41429 41429 +41429 41491 41491 +41491 41519 41519 +41519 41572 41572 +41572 41642 41642 +41642 41676 41676 +41676 41713 41713 +41713 41751 41751 +41751 41792 41792 +41792 41856 41856 +41856 41881 41881 +41881 41936 41936 +41936 41977 41977 +41977 42018 42018 +42018 42090 42090 +42090 42162 42162 +42162 42205 42205 +42205 42267 42267 +42267 42294 42294 +42294 42309 42309 +42309 42338 42386 +42393 42425 42522 +42530 42577 42577 +42577 42623 42623 +42623 42643 42725 +42725 42748 42748 +42748 42829 42897 +42901 42952 42952 +42952 42978 43025 +43025 43116 43116 +43116 43171 43171 +43171 43204 43376 +43386 43453 43471 +43471 43547 43780 +43798 43921 44116 +44120 44120 44120 +Out of memory: %s +There is no more memory left in the system for compiling this program. +Internal Error Unknown Error Message %s +1) An internal error, while attempting to print an unavailable message +2) The error message file is inaccessible or has other problems +Unknown Signal %s +1) An unknown signal has been caught +2) 2 Nested signals +line +Warning: +Fatal: +Source not available +Too many errors... goodbye. +There is a limit of 30 errors before aborting. +Error: +reserved +reserved +Unknown Control Statement +1) The line begins with a '#' and is not of the form: + # "" +2) Please compile this program with the preprocessor enabled. +Unknown character %s ignored +The character is not part of the source character set. +2.2.1 +Unknown control character \%s ignored +The control character is not part of the source character set. +2.2.1 +Illegal character %s in exponent +1) Digits or sign expected after 'e' or 'E'. +2) Digits are expected after sign in exponent. +3.1.3.1 +Constant is out of range and may be truncated. +The constant is too large to be accurately represented and may be +truncated. The limits are in the system include file limits.h. +2.2.4.2 +Constant is out of range for a 32-bit data type, but accepted as written. +The constant is too large to fit in a 32-bit data type, but will be +accurately represented in a wider data type. The value may be truncated, +depending on its context. The limits are in the system include file +limits.h. +2.2.4.2 +Character constant size out of range +1) No characters in a character constant. +2) More than 4 bytes in a character constant. +3.1.3.4 +Wide character constant size out of range +1) No characters in the multibyte sequence (0 assumed). +2) More than 1 byte in the multi-byte sequence (only the first byte was converted). +3.1.3.4 +Invalid multibyte character +4.10.7.2 +Newline in string or character constant +1) Terminate your string or character constant with closing quotes. +2) Put a backslash before the newline. +3.1.3.4, 3.1.4 +Octal character escape too large: %s > %s +1) Terminate end of octal sequence with a non-octal character. +2) Select a character value within the limits. +Value may be truncated +3.1.3.4, 3.1.4 +Hex character escape too large: %s > %s +1) Terminate end of hex sequence with a non-hex character. +2) Select a character value within the limits. +Value may be truncated +3.1.3.4, 3.1.4 +Unexpected End-of-file +1) Unterminated string or character constant +2) Missing closing comment marker (*/) +3) File system problems +Unrecognized escape sequence in string \%s +Recognized escape sequences are \a, \b, \f, \n, \r, \t, and \v. +Character will be treated as un-escaped. +3.9.2 +Illegal octal digit %s +Octal constants, beginning with 0, must only have digits between 0 and 7, +inclusive. +3.1.3.2 +Unable to open temporary file for compiling %s +1) TMPDIR environment variable is set to a directory that you have no + permissions for. +2) The file system is full. +3) System errors beyond the scope of the compiler. +%s: Hangup +%s: Interrupt +%s: Quit (ASCII FS) +%s: Illegal instruction (not reset when caught) +%s: Trace trap (not reset when caught) +%s: IOT instruction +Also SIGABRT, used by abort, replace SIGIOT in the future +%s: EMT instruction +Also SIGXCPU, Exceeded CPU time limit +%s: Floating point exception +%s: Kill (cannot be caught or ignored) +%s: Bus error +%s: Segmentation violation +%s: Bad argument to system call +%s: Write on a pipe with no one to read it +%s: Alarm clock +%s: Software termination signal from kill +%s: User defined signal 1 +%s: User defined signal 2 +%s: Death of a child +Power-fail restart +%s: Also SIGXFSZ, exceeded file size limit +%s: Window change +%s: Handset, line status change +%s: Sendablestop signalnot from tty +%s: Stop signal from tty +%s: Pollable event occurred +%s: Input/Output possible signal +%s: Urgent condition on IO channel +%s: Window size changes +%s: Virtual time alarm +%s: Profiling alarm +%s: Continue a stopped process +%s: To readers pgrp upon background tty read +%s: Like TTIN for output if (tp->t_local<OSTOP) +%s: Resource lost (eg, record-lock) +'auto' and 'register' are not allowed in an external declaration +3.7(10) +must have function type +3.7.1(30) +Functions cannot return arrays +3.7.1(33), 3.3.2.2 +Declaration list not allowed +3.7.1(5) +Too many input files %s +The command line may contain only one file +cpp internal error: input stack underflow +cpp internal error: if stack underflow +Cannot open the file %s +No new-line character at the end of the file %s +2.1.1.2(30) +Fatal: Exceeded the limit of nesting level for #include file +Fatal: Exceeded the limit of nesting level for #include file. This limit +is 200. +Fail to read the file %s +Cannot write the file %s +%s: %s: An if directive is not terminated properly in the file +%s: %s: nested comment +%s:%s: Illegal macro name %s; macro name shall be an identifier +%s:%s: Illegal preprocessing token sequence +3.8.3(35) +%s:%s: Illegal macro parameter name +%s:%s: Non-unique macro parameter name +3.8.3(18) +%s:%s: Missing ')' in parameter list for #define %s +%s:%s: Missing ')' in macro instantiation +%s:%s: Bad punctuator in the parameter list for #define %s +%s:%s: Macro %s redefined. +%s:%s: # operator should be followed by a macro argument name +%s:%s: Badly formed constant expression%s +3.4(9), 3.8 +%s:%s: Division by zero in #if or #elif +3.8 +unknown command line option %s +extraneous input/output file name %s +%s: %s: Unterminated string or character constant +A preprocessing string or character constant token was not +terminated. Note that preprocessing directives are processed +after the source file has been divided into preprocessing tokens. +2.1.1.2(30) 3.1(18) 3.8 +%s: %s: +%s: %s: +%s: %s: Unterminated comment +%s: %s: Unknown directive type %s +%s: %s: #elif or #else after #else directive +%s: %s: Bad identifier after the %s +%s: %s: #%s accepts only one identifier as parameter +3.8 +%s: %s: Bad identifier after the %s +%s: %s: text following #%s violates the ANSI C standard. +3.8 +%s: %s: Bad character %s occurs after the # directive. +3.8 +%s: %s: the ## operator shall not be the %s token in the replacement list +3.8.3.3 +%s: %s: the defined operator takes identifier as operand only. +3.8.1 +%s: %s: Not in a conditional directive while using %s +%s: %s: Illegal filename specification for #include +%s: %s: Invalid file name %s for #include +%s: %s: Cannot open file %s for #include +%s: %s: Bad argument for #line command +%s: %s: #error %s +%s: %s: Tried to redefine predefined macro %s, attempt ignored +3.8.7(22) +%s: %s: Undefining predefined macro %s +3.8.7(22) +%s: %s: Undefined the ANSI standard library defined macro %s +4.1.2.1(9) +%s: %s: The number of arguments in the macro invocation does not match the definition +%s: %s: Illegal character %s in preprocessor if +%s: %s: Illegal character %s for number in preprocessor if +%s: %s: No string is allowed in preprocessor if +%s: %s: Not supported pragma %s +%s: %s: Not supported #pragma format +%s: %s: ANSI C does not allow #ident; %s +%s: %s: Not supported #ident format +This cpp extension accepts the following format: +#ident "any string" +%s: %s: Not supported #assert/#unassert format +This cpp extension accepts the following format: +#assert identifier +#assert identifier ( pp-tokens ) +#unassert identifier +#unassert identifier ( pp-tokens ) +%s: %s: Bad assertion predicate format +The correct syntax for this cpp extension is: +#assert identifier ( pp-token ) +%s: %s: directive is an upward-compatible ANSI C extension +%s: This option requires an argument +%s: %s: A macro has expanded recursively more than %s times. Further expansion will be disabled! Use command-line option: -Wp,-max_rec_depth=depth to recurse deeper. +A status return from cpp to cfe +Syntax Error +The token read was unexpected. +Syntax Error -- cannot backup +The token read was unexpected. +Yacc stack overflow +The expression is too complicated to parse. +Trailing comma in enumerator list +The use of a trailing comma in an enumerator list is not standard C. There +may be portability problems. +3.5.2.2 +Empty declaration +Empty declarations are invalid in standard C. +3.5 +%s declared, but not referenced. +redeclaration of '%s'; previous declaration at line %s in file '%s' +Identifier redeclared in the same scope/block. +3.1.2.3 +'%s' undefined; reoccurrences will not be reported. +Non-function name referenced in function call. +3.3.2.2(18) +The number of arguments doesn't agree with the number in the declaration. +3.3.2.2(5) +'%s' section name longer than 8 characters. Name truncated. +'%s' is already placed by pragma alloc_text. +Cannot write ucode file while compiling %s +1) The file system is full +2) Permissions problem +Must have corresponding formal argument for '%s' +Parameter found in the declaration part, but not in the argument list. +3.7.1(7) +Non-prototype declaration is an obsolescent feature. +The use of function definitions with separate parameter identifier +and declaration lists (not prototype-format parameter type and +identifier declarators) is an obsolescent feature. +3.9.5 +Incompatible function declarations for %s +For two function types to be compatible, both shall specify compatible +return types. Moreover, the parameter type lists, if both are present, +shall agree in the number of parameters and in use of the ellipsis +terminator; corresponding parameters shall have compatible types. If +one type has a parameter type list and the other type is specified by +a function declarator that is not part of a function definition and +contains an empty identifier list, the parameter list shall not have +an ellipsis terminator and the type of each parameter shall be +compatible with they type that results from application of the default +argument promotions. If one type has a parameter type list and the +other is specified by a function definition that contains a (possibly +empty) identifier list, both shall agree in the number of parameters, +and the type of each prototype parameter shall be compatible with the +type that results from application of the default argument promotions +to the type of the corresponding identifier. (For each parameter +declared with function or array type, its type for these comparisons +is the one that results from conversion to a pointer type. For each +parameter declared with qualified type, its type for these comparisons +is the unqualified version of its declared type.) There you have it! +3.5.4.3(15) +Incompatible function return type for this function. +For two function types to be compatible, both shall specify compatible +return types. +3.5.4.3(15) +The number of parameters for function is different from the previous declaration +The parameter type lists, if both are present, shall agree in the +number of parameters and in use of the ellipsis terminator. +3.5.4.3(15) +Incompatible type for the function parameter +If both parameter type lists are present, corresponding +parameters shall have compatible types. +3.5.4.3(15) +Function %s is redeclared with an incompatible argument type (after default argument promotion), which could lead to undefined run-time behaviour. +The redeclaration could cause arguments at a call site to be passed +inconsistently with what the function implementation expects, and +parameters would therefore be accessed erroneously when executing the +function body. Note that a float argument is promoted to a double +when passed (potentially through fp registers) to an unprototyped +function. +3.5.4.3(15) +prototype and non-prototype declaration found for %s, ellipsis terminator not allowed +If one type has a parameter type list and the other type is specified +by a function declarator that is not part of a function definition and +contains an empty identifier list, the parameter list shall not have +an ellipsis terminator and the type of each parameter shall be +compatible with they type that results from application of the default +argument promotions. +3.5.4.3(15) +prototype and non-prototype declaration found for %s, the type of this parameter is not compatible with the type after applying default argument promotion +If one type has a parameter type list and the other type is specified +by a function declarator that is not part of a function definition and +contains an empty identifier list, the type of each parameter shall be +compatible with the type that results from application of the default +argument promotions. +3.5.4.3(15) +prototype declaration and non-prototype definition found for %s, the type of this parameter is not compatible with the type after applying default argument promotion +If one type has a parameter type list and the other is specified by a +function definition that contains a (possibly empty) identifier list, +both shall agree in the number of parameters, and the type of each +prototype parameter shall be compatible with the type that results +from application of the default argument promotions to the type of the +corresponding identifier. +3.5.4.3(15) +Empty declaration specifiers +Standard C requires at least a storage class specifier, type specifier, +or a type qualifier in declarations. 'extern int' assumed. +3.5 +Can't write to the file %s +1) The output file cannot be opened for writing. +2) Out of file space. +Duplicate '%s' +typedef, extern, static, auto, register, const, volatile may not +appear more than once in the same specifier list or qualifier list. +Duplicate occurrence ignored. +3.5.1(10) , 3.5.3(5) +Null input +There is nothing to compile. +Illegal type combination +3.5.2 +Missing ';' at end of structure / union member declaration +In standard C, each member declaration must be terminated by a ';'. A +terminating ';' is assumed. +3.5.2.1 +Missing member name in structure / union +In standard C, each member declaration have a member name. The missing +member is assumed to not exist. +3.5.2.1 +This variable is initialized twice. +Neither 'const' or 'volatile' have any effect on function results. +Qualifiers only apply to expressions designating an object that +can be altered or examined. +3.5.3(10) +An integer constant expression is required here. +The expression that defines the value of an enumeration constant +shall be an integral constant expression that has a value +representable as an int. +3.5.2.2(28) +(previous declaration of '%s' at line %s in file '%s') +Must be an integer type greater than zero. +The array size must be either a char, signed or unsigned integer or +an enumerated type with a value greater than zero. +3.5.4.2 +Array size cannot be a long long. +Arrays with more than 2^32 elements are not yet supported. +The array size must be either a char, signed or unsigned integer or +an enumerated type with a value greater than zero. +3.5.4.2 +bit-field '%s' width is not an integer constant +The expression that specifies the width of a bit-field shall be an +integral constant expression. +3.5.2.1(15) +bit-field '%s' width is negative +The expression that specifies the width of a bit-field shall be +non-negative. +3.5.2.1(15) +bit-field '%s' type required to be int, unsigned int, or signed int. +A bit-field shall have type int, unsigned int, or signed int. +3.5.2.1(30) +bit-field %s's type not integer. +Non-scalar type or pointer type to a non-object for increment or decrement operator. +The operand of the prefix/postfix increment or decrement operator shall have scalar type; if it is of pointer type, it must point to an object. +3.3.2.4(37), 3.3.3.1(25) +Assign value to a function type. +An assignment operator shall have a modifiable lvalue as its left operand. +3.2.2.1(5) +Assign value to an array. +An assignment operator shall have a modifiable lvalue as its left operand. +3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5) +Change value for variable of incomplete type. +The operand of increment and decrement operator shall be a modifiable +scalar lvalue. An assignment operator shall have a modifiable lvalue +as its left operand. +3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5) +The left-hand side of the '.' operator must be an addressable lvalue, when a bit-field is not contained within a unit of 32 bits alignment. +This is a restriction in our implementation, which can be worked +around by always accessing long long bit-fields indirectly (i.e. +by means of the '->' operator). +This expression is not an lvalue. +3.2.2.1 +Modified an rvalue. +3.2.2.1 +Change value for constant variable. +The operand of increment and decrement operators shall be modifiable +scalar lvalues. An assignment operator shall have a modifiable lvalue +as its left operand. +3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5) +Change value for constant field of a struct or union. +An assignment operator shall have a modifiable lvalue as its left operand. +3.3.2.4(36), 3.3.3.1(24), 3.2.2.1(5) +Dereferenced a non-pointer. +The operand of the unary * operator shall have pointer type. +3.3.3.2(39) +The operand of the unary + or - operator shall have arithmetic type. +3.3.3.3(6) +The operand of the unary ~ operator shall have integral type. +3.3.3.3(6) +The operand of the unary ! operator shall have scalar type. +3.3.3.3(6) +Constants must have arithmetic type. +3.1.3 +Bad type name for cast operator +The type name for the cast operator should either be void or a +qualified or unqualified scalar type. +3.3.4(22) +Improper cast of non-scalar type expression. +The operand for the cast operator shall be of scalar type. +3.3.4(23) +Cast a pointer into a non-integral type. +A pointer may be converted to an integral type. +3.3.4(31) +Cast a non-integral type into a pointer. +An integral type may be converted to a pointer. +3.3.4(31) +Duplicate member '%s' +Two members of a struct may not have the same name. +3.1.2.2(7,25) +Invalid constant expression. +Constant expressions shall not contain assignment, increment, decrement, +function-call, or comma operators, except when they are contained within +the operand of the sizeof operator. +3.4(9) +Constant expressions must be derived from a constant value or a constant +variable. +3.4 +Dangerous operand of '&'. +The operand of the unary & operator shall be either a function +designator or an lvalue that designates an object that is not a +bit-field and is not declared with the register storage-class +specifier. This operand is NOT an lvalue, but we let it pass. +Note that a segmentation error with possible core dump will result +when the resulting address does not denote a valid (declared) +storage location. This feature will be discontinued in future +releases of the compiler! +3.3.3.2(36) +Unacceptable operand of '&'. +The operand of the unary & operator shall be either a function +designator or an lvalue that designates an object that is not a +bit-field and is not declared with the register storage-class +specifier. +3.3.3.2(36) +'&' before array or function; ignored +Unacceptable operand of sizeof operator. +The sizeof operator shall not be applied to an expression that has +function type or an incomplete type, to the parenthesized name of such +a type, or to an lvalue that designates a bit-field object. +3.3.3.4 +Unacceptable operand of a multiplicative operator. +Each of the operands of a multiplicative operator shall have arithmetic type. +3.3.5(18) +Unacceptable operand of the remainder operator +Each of the operands of the remainder (%) operator shall have integral type. +3.3.5(18) +Unacceptable operand of '+'. +For the + operator, either both operands shall have arithmetic type, or +one operand shall be a pointer to an object type and the other shall +have integral type. +3.3.6(39) +Unacceptable operand of '-'. +For the subtraction operator, one of the following shall hold: both operands +have arithmetic type; operands are pointers to qualified or unqualified +versions of compatible object types; or the left operand is a pointer +to an object type and the right operand has integral type. +3.3.6(39) +Unacceptable operand of shift operator. +Each of the operands of bitwise shift operators shall have integral type. +3.3.7(9) +Unacceptable operand of relational operator. +For relational operators, one of the following shall hold: both +operands have arithmetic type; both operands are pointers to qualified +or unqualified versions of compatible object types; or both operands +are pointers to qualified or unqualified versions of compatible +incomplete types. +3.3.8(32) +Unacceptable operand of == or != +For the == or != operator, one of the following shall hold: both operands +are pointers to qualified or unqualified versions of compatible types; one +operand is a pointer to an object or incomplete type and the other is a +pointer to a qualified or unqualified version of void; or one operand is +a pointer and the other is a null pointer constant. +3.3.9(21) +Unacceptable operand of &. +Each of the operands shall have integral type. +3.3.10(7) +Unacceptable operand of ^. +Each of the operands shall have integral type. +3.3.11(18) +Unacceptable operand of |. +Each of the operands shall have integral type. +3.3.12(30) +Unacceptable operand of &&. +Each of the operands shall have scalar type. +3.3.13(7) +Unacceptable operand of ||. +Each of the operands shall have scalar type. +3.3.14(20) +Unacceptable operand of conditional operator. +The first operand of conditional operator shall have scalar type. One +of the following shall hold for the second and third operands: +both operands have arithmetic type; both operands have compatible +structure or union types; both operands have void type; both operands +are pointers to qualified or unqualified versions of compatible types; +one operand is a pointer and the other is a null pointer constant; or +one operand is pointer to an object or incomplete type and the other +is a pointer to a qualified or unqualified version of void. +3.3.15 +Duplicate label '%s' +A label name can only occur once in a function. +3.1.2.1(25) +Division by zero. +3.3.5 +Subscripting a non-array. +3.3.2.1 +Subscripting an array of incomplete type which is not an object type. +The element of the array shall have an object type. +3.3.2.1 +Should only subscript an array with an integral expression +3.3.2.1 +Subscripting an unbounded array +3.3.2.1 +Array index out of range +3.3.2.1 +Selector requires struct/union pointer as left hand side +In K&R mode the expression is implicitly converted to the '.' selector +for a struct/union left-hand side. +3.3.2.3 +Selector requires struct/union as left hand side +In K&R mode the expression is implicitly converted to the '->' selector +for a struct/union pointer left-hand side. +3.3.2.3 +member of structure or union required +3.3.2.3 +types have different qualifier specifications +For two qualified types to be compatible, both shall have the +identically qualified version of a compatible type; qualified +and unqualified versions of a type are distinct types. For two +types to be compatible their types must be the same. +3.5.3(26) +Incompatible array type due to different array size +For two array types to be compatible, both shall have compatible element +types; if both size specifiers are present, they shall have the +same value. +3.5.4.2(11) +Incompatible array type due to incompatible element type +For two array types to be compatible, both shall have compatible element +types. +3.5.4.2(11) +Incompatible pointer type assignment +The type pointed to by the left-hand side of simple assignment +statement is incompatible with the type pointed to by the right-hand side. +3.3.16.1, 3.5.4.1(21) +Incompatible base type of pointer type +K&R feature. +Type %s of %s is incompatible with type %s of %s +Incompatible types can be resolved by casting or by other means. +3.3.16.1 +illegal combination of pointer and integer +Assigning an integral expression to a pointer is a bad practice. +Type for %s is incompatible with %s +Incompatible types can be resolved by casting or by other means. +3.1.2.6 +Bad operand type for += or -= +3.3.16.2(26) +A case or default label appears outside a switch statement +A case or default label shall appear only in a switch statement. +3.6.1 +The controlling expression of the if statement is not scalar type +The controlling expression of an if statement shall have scalar type. +3.6.4.1 +The controlling expression of switch statement is not integral type +The controlling expression of an switch statement shall have integral type. +3.6.4.2(20) +The case label is not an integral constant expression +The case label shall be an integral constant expression. +3.6.4.2(22) +Duplicate case label in the same switch statement +No two of the case constant expressions in the same switch statement +shall have the same value after conversion. +3.6.4.2(22) +More than one default label in the same switch statement +There may be at most one default label in a switch statement. +3.6.4.2(23) +The controlling expression of the iteration statement is not scalar +type +The controlling expression of a iteration statement shall have scalar +type. +3.6.5.1 +label '%s' used, but not defined +The identifier in a goto statement shall name a label located +somewhere in the enclosing function. +3.6.6.1 +A continue statement shall appear only in or as a loop body +3.6.6.2 +A break statement shall appear only in or as a switch body or loop body +3.6.6.3 +A return statement with an expression should not appear +in a function '%s', whose return type is void +3.6.6.4(24) +A return statement without an expression appears in a +function '%s', whose return type is not void +If a return statement without an expression is executed, and the value +of the function call is used by the caller, the behavior is undefined. +3.6.6.4(33) +Internal Error: statement stack underflow +Long double not supported; double assumed. +Long float not standard; double assumed. +Only 'register' allowed in parameter declaration +The only storage-class specifier that shall occur in a parameter +declaration is 'register'; illegal storage class ignored. +3.5.4.3(25) +Name(s) without types in a function declaration +An old-style function declaration is not allowed to have names +in the parameter list; useless names ignored +3.5.4.3(26) +Functions cannot return functions +3.7.1(33), 3.3.2.2 +Functions cannot return a non-object type +3.3.2.2 +enum declaration must contain enum literals +Although structs or unions may delay the declaration of their members, +a similar construction with enum does not exist and is not necessary, +as there can be no mutual dependencies between the declaration of an +enumerated type and any other type. +3.5.2.3(27) +Register qualification has no effect for this type of object +Register declarations for array, struct, and function types have +no effect. +3.5.1(16), 3.5.1(19) +Functions cannot be declared 'register' +The declaration of an identifier for a function that has block +scope shall have no explicit storage-class specifier other than +'extern'. +3.5.1(19) +'%s' cannot be initialized +The type of the entity to be initialized shall be an object type +or an array of unknown size. +3.5.7(32) +Cannot initialize 'extern' variable '%s' within a function +If the declaration of an identifier has block scope, and the +identifier has 'extern' or 'static' linkage, the declaration +shall have no initializer for the identifier; initialization +allowed anyway. +3.5.7(35) +initializing an 'extern' is an ANSI C extension +conflicting declarations for '%s' +'static' and 'extern' declarations conflict. Which is meant? +3.1.2.2(15), 3.1.2.2(27) +Too many initial values for '%s' +3.5.7(1) +incompatible types in initialization +3.3.16(35) +redefinition of '%s'; previous definition at line %s in file '%s' +Identifier redeclared in the same scope/block. +3.1.2.3 +bit-fields as members of a union are an ANSI C invention. +storage size for '%s' isn't known +type mismatch in initialization +Missing braces in a union initialization or illegally formed +initialization. +3.5.7(5) +union '%s' only allowed one initializer for the first member +3.5.7(5) +width of '%s' exceeds its type +the specified bitfield width is too large to be contained within a +bitfield type. +structure has no member named '%s' +This is allowed for compatibility with AT&T pcc-based compilers. +Reference of an expression of void type or an incomplete type. +3.2.2.1 +element size of an array shall not be zero +3.2.2.5(25) +invalid combination of type specifiers +Although order is unimportant, not all type specifiers can occur together. +3.5.2 +declaration must at least declare an identifier, tag, or the member of an enumeration +3.5(16) +at most one storage class may be given in the declaration +Duplicate occurrence ignored. +3.5.1(10) +size of function's return type is zero +The return type of a function must be void or an object type other than array. +3.7.1(33) +Expecting an integral return type from the main function +identifier missing from parameter declaration +Prototypes for function definitions require identifiers in parameter +declarations. +3.7.1(4) +only 'register' allowed for storage class for parameters +The declarations in the declaration list shall contain no storage class +other than 'register', and no initializations. +3.7.1(10) +parameters declarations can not have initializations +3.7.1(10) +only one instance of 'void' allowed in the parameter list +'void' must occur by itself (specifying that the function has no parameters). +3.5.4.3(1) +%s must have function type +1) An argument list must be explicitly present in the declarator; it cannot + be inherited from a typedef (3.5.4.3). +2) The declarator is not a function. +3.7.1(30) +Illegal hexadecimal constant +You have no digits after the 0x or 0X. 0x0 assumed. +3.1.3.2 +value overflows its type in this context. Value is set to be '%s'! +3.2.1.4 +value is outside range representable for type '%s' +missing member name +K&R mode permits a missing member name; otherwise, only bitfields can omit +the member name. +3.5.2.1(10) +useless keyword or type name in declaration +Type was ignored. +'%s' declared within and is limited to this function prototype +Possible program error, since parameter type checking will always fail +unless the type declaration is visible to the caller. +3.1.2.1(35) +Extra spaces within operator, %s assumed +In ANSI C, the compound assignment operator cannot have embedded +white space characters. +3.1.5 +missing size for array '%s' +Incomplete types permitted for identifiers with internal or +external linkage, but not automatic linkage. +3.1.2.5(10) +can't jump into (from outside of) the body of a 'try' or into either type of handler +'%s' missing, please #include excpt.h +excpt.h required to declare exception statements, intrinsics or compiler +runtime names. +local function declarations cannot be 'static' +A function declaration can only contain the storage-class 'static' +if it is at file scope. Declaration made 'extern'. +3.5.1(19) +static function '%s' declared and referenced, but not defined. +If an identifier declared with internal linkage is used in an +expression (other than as a part of the operand of a sizeof +operator), there shall be exactly one external definition for +the identifier in the translation unit. +3.7(12) +pragma argument '%s' must be declared prior to being used in a pragma +Pragma name ignored. +Pragma not supported +'%s' not enabled as intrinsic +It may have already appeared in a function pragma, or never occurred in +an intrinsic pragma. +'%s' is already enabled as an intrinsic +weak definition for '%s' is later redefined; pragma weak ignored. +definition of primary name '%s' not found; pragma weak ignored. +definition of secondary name '%s' not found; pragma weak ignored. +primary name '%s' is declared as a common or external, and is not defined +with initial value within this file; pragma weak ignored. +useless '%s' storage class ignored +array of functions not allowed +The element type must be an object type representing a region +of data storage which can represent values. +3.1.2.5(23) +array of voids not allowed +The element type must be an object type representing a region +of data storage which can represent values. +3.1.2.5(23) +argument for pragma pack must be an integer constant; pragma ignored +'%s' has wrong tag type. +Identifier redeclared in the same scope/block. +3.1.2.3 +missing dimension bound +For multidimensional arrays, the constant bounds of the array may be +omitted only for the first member of the sequence. +3.1.2.5(23) +Internal error in parameters to function substr; loc: '%s'; len: '%s'. +Internal error in parameters to function insertstr; indx: '%s'. +Internal error in function get_tag_name; input is a non-tagged type. +Internal error in function gen_type_str -- not a type tree '%s' +Cannot open file '%s' +Prototype should be moved after tag or a typedef declaration. +Please look for comments in the extracted header file. +The extracted header file includes prototypes for static functions, +which should be removed, if you wish to include the header in a source file +other than the originator. +ANSI C requires formal parameter before "..." +This extension is meant to be used for compatibility with varargs.h +3.5.4.3(35) +syntax error: "&..." invalid +extension used to access "..." formal arguments. +function '%s' initialized like a variable +The type of entity to be initialized shall be an object type or an +array of unknown size. +3.5.7(31) +initializer not an array aggregate +The initializer for an object that has aggregate type shall be a +brace-enclosed list of initializers for the members of the aggregate, +written in increasing subscript or member order. +3.5.7(20) +'%s' type is incomplete; cannot initialize +Was the struct ever defined? +3.5.7.(31) +'%s' is not standard ANSI. +This keyword/type is not defined in strict ANSI mode. +3.1.1 +not a legal asm string +The first operand of an asm string should be, after argument substitution, +a legal assembly string. +The -float option will be ignored in ANSI mode. +The -float option is ignored, since otherwise program semantics would +violate the ANSI standard. In particular, fp constants are always +'double' with ANSI-C, while with -float the type of fp constants will +depend on the context and may be 'float'. +ANSI C support unavailable with C compiler bundled with RISC/os +The C compiler bundled with RISC/os does not support ANSI C. ANSI +C support requires a separate license. +Ignored invalid warning number(s) in -woff option, %s%s ! +Warning numbers must be in the range %s to %s. +The set of warning numbers in cfe is disjoint from the set of warning numbers +in accom, since accom warnings cannot be mapped one-to-one to cfe warnings. +'%s' not handled as an intrinsic due to incompatible argument types . +'__unalign' only qualifies pointers +'__unalign' indicates the object pointed at by pointer is unaligned (e.g., +int * __unalign p). This is an extension to ANSI C and like 'volatile' +and 'const' can follow the '*' in pointer declarations, but unlike both +cannot qualify a base type. +index expression is an anachronism +ANSI C++ doesn't support array index expressions in delete. +5.3.4 +member cannot be of function or incomplete type. +3.5.2.1(12) +Illegal lint option, '%s', is ignored. +cannot open header message buffer file +cannot write header message buffer file +cannot read header message buffer file +cannot seek in header message buffer file +struct/union/enum '%s' is used, but not defined +static '%s' unused +nonportable character comparison (chars may be signed or unsigned) +redundant comparison of unsigned with constant expression +redundant statement, control flow cannot reach this statement +'%s' may be used before set +function parameter '%s' is not used in function '%s' +'%s' can be const qualified, since it is not set within its lifetime. +'%s' is not used in function '%s' +'%s' set but unused in function '%s' +control may fall through %s statement +function '%s' has return(e); and return; +function '%s' may return random value to place of invocation %s +label without goto: '%s' +width of %s constant is smaller than size of type (%s) +explicit conversion from '%s' to '%s' %s +implicit conversion from '%s' to '%s' %s +'%s' may be indistinguishable from '%s' due to internal name truncation +Promoted formal parameter and promoted argument have incompatible types +No prototype for the definition of '%s' %s +References to '%s' are substituted by its literal initializer + (as included in %s) +============== +unsupported language linkage +string-literal specifies an unsupported linkage +7.4(1) +No prototype for the call to %s +To achieve better type-checking, there should be a full prototype for +the function being called. +3.5.4.3 +'inline' only applies to function declarations +leave statment can occur only within try body +Microsoft extension +Use of a Microsoft extension detected without usage of the +compiler option -msft. +No parameter mentioned +A file with no declarations or definitions is accepted as an extension to ANSI C +The translation unit must contain at least one external definition. +3.7 +Incompatible signed and unsigned version of a type +Yacc initialization error +Internal error: yacc cannot initialize itself. +The cfe option %s may not be in future releases. We suggest that you not use this option! +Incompatible char and unsigned char versions of a type +Lshift with undefined behaviour. +Lshift with a negative right operand, or a right operand that is greater +than or equal to the width in bits of the promoted left operand, results +in undefined behaviour. +3.3.7(11) +useless type name in declaration, possibly a semicolon is missing. +Type was ignored. +constant initializer expression is invalid (refers to automatic variables). +All the expressions in an initializer for an object that has static storage +duration or in the initializer list for an object that has aggregate or +union type shall be constant expressions. Otherwise, unexpected results +may occur. +3.5.7(32) and 3.4 +invalid explicit or implicit conversion of an address constant to an integral value in a constant initializing expression. +An address constant in a constant initializing expression can neither +initialize a bit-field nor be directly or indirectly converted to an +integral type of size different from an address type. +6.4 diff --git a/ido/ido5.3_recomp/header.h b/ido/ido5.3_recomp/header.h new file mode 100644 index 00000000..b4cd0d31 --- /dev/null +++ b/ido/ido5.3_recomp/header.h @@ -0,0 +1,30 @@ +#include +#include +#include +#include +#include +#include + +#include "libc_impl.h" +#include "helpers.h" + +#define RM_RN 0 +#define RM_RZ 1 +#define RM_RP 2 +#define RM_RM 3 + +union FloatReg { + float f[2]; + uint32_t w[2]; + double d; +}; + +#define cvt_w_d(f) \ + ((fcsr & RM_RZ) ? ((isnan(f) || f <= -2147483649.0 || f >= 2147483648.0) ? (fcsr |= 0x40, 2147483647) : (int)f) : (assert(0), 0)) + +#define cvt_w_s(f) cvt_w_d((double)f) + +static union FloatReg f0 = {{0, 0}}, f2 = {{0, 0}}, f4 = {{0, 0}}, f6 = {{0, 0}}, f8 = {{0, 0}}, +f10 = {{0, 0}}, f12 = {{0, 0}}, f14 = {{0, 0}}, f16 = {{0, 0}}, f18 = {{0, 0}}, f20 = {{0, 0}}, +f22 = {{0, 0}}, f24 = {{0, 0}}, f26 = {{0, 0}}, f28 = {{0, 0}}, f30 = {{0, 0}}; +static uint32_t fcsr = 1; diff --git a/ido/ido5.3_recomp/helpers.h b/ido/ido5.3_recomp/helpers.h new file mode 100644 index 00000000..b2bd2351 --- /dev/null +++ b/ido/ido5.3_recomp/helpers.h @@ -0,0 +1,13 @@ +#ifndef HELPERS_H +#define HELPERS_H + +#include + +#define MEM_U32(a) (*(uint32_t *)(mem + a)) +#define MEM_S32(a) (*(int32_t *)(mem + a)) +#define MEM_U16(a) (*(uint16_t *)(mem + ((a) ^ 2))) +#define MEM_S16(a) (*(int16_t *)(mem + ((a) ^ 2))) +#define MEM_U8(a) (*(uint8_t *)(mem + ((a) ^ 3))) +#define MEM_S8(a) (*(int8_t *)(mem + ((a) ^ 3))) + +#endif diff --git a/ido/ido5.3_recomp/libc_impl.c b/ido/ido5.3_recomp/libc_impl.c new file mode 100644 index 00000000..929d58fa --- /dev/null +++ b/ido/ido5.3_recomp/libc_impl.c @@ -0,0 +1,2543 @@ +#define _GNU_SOURCE // for sigset +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __CYGWIN__ +#include +#endif +#ifdef __APPLE__ + #include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "libc_impl.h" +#include "helpers.h" + +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MAX(a, b) ((a) > (b) ? (a) : (b)) + +#define STRING(param) size_t param##_len = wrapper_strlen(mem, param##_addr); \ + char param[param##_len + 1]; \ + for (size_t i = 0; i <= param##_len; i++) { \ + param[i] = MEM_S8(param##_addr + i); \ + } + +#if !defined(IDO53) && !defined(IDO71) +#define IDO71 +#endif + +#define MEM_REGION_START 0xfb00000 +#define MEM_REGION_SIZE (512 * 1024 * 1024) + +#ifdef IDO53 +// IDO 5.3 +#define IOB_ADDR 0x0fb528e4 +#define ERRNO_ADDR 0x0fb52720 +#define CTYPE_ADDR 0x0fb504f0 +#define LIBC_ADDR 0x0fb50000 +#define LIBC_SIZE 0x3000 +#endif + +#ifdef IDO71 +// IDO 7.1 +#define IOB_ADDR 0x0fb4ee44 +#define ERRNO_ADDR 0x0fb4ec80 +#define CTYPE_ADDR 0x0fb4cba0 +#define LIBC_ADDR 0x0fb4c000 +#define LIBC_SIZE 0x3000 +#endif + +#define STDIN_ADDR IOB_ADDR +#define STDOUT_ADDR (IOB_ADDR + 0x10) +#define STDERR_ADDR (IOB_ADDR + 0x20) +#define STDIN ((struct FILE_irix *)&MEM_U32(STDIN_ADDR)) +#define STDOUT ((struct FILE_irix *)&MEM_U32(STDOUT_ADDR)) +#define STDERR ((struct FILE_irix *)&MEM_U32(STDERR_ADDR)) + +#define MALLOC_BINS_ADDR custom_libc_data_addr +#define STRTOK_DATA_ADDR (MALLOC_BINS_ADDR + (30 - 3) * 4) +#define INTBUF_ADDR (STRTOK_DATA_ADDR + 4) + +#define SIGNAL_HANDLER_STACK_START LIBC_ADDR + +#define NFILE 100 + +#define IOFBF 0000 /* full buffered */ +#define IOLBF 0100 /* line buffered */ +#define IONBF 0004 /* not buffered */ +#define IOEOF 0020 /* EOF reached on read */ +#define IOERR 0040 /* I/O error from system */ + +#define IOREAD 0001 /* currently reading */ +#define IOWRT 0002 /* currently writing */ +#define IORW 0200 /* opened for reading and writing */ +#define IOMYBUF 0010 /* stdio malloc()'d buffer */ + +#define STDIO_BUFSIZE 16384 + +struct timespec_t_irix { + int tv_sec; + int tv_nsec; +}; + +struct FILE_irix { + int _cnt; + uint32_t _ptr_addr; + uint32_t _base_addr; + uint8_t pad[2]; + uint8_t _file; + uint8_t _flag; +}; + +static struct { + struct { + uint64_t (*trampoline)(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3, uint32_t fp_dest); + uint8_t *mem; + uint32_t fp_dest; + } handlers[65]; + volatile uint32_t recursion_level; +} signal_context; + +static uint32_t cur_sbrk; +static uint32_t bufendtab[NFILE]; // this version contains the size and not the end ptr +static uint32_t custom_libc_data_addr; + +#define _U 01 /* Upper case */ +#define _L 02 /* Lower case */ +#define _N 04 /* Numeral (digit) */ +#define _S 010 /* Spacing character */ +#define _P 020 /* Punctuation */ +#define _C 040 /* Control character */ +#define _B 0100 /* Blank */ +#define _X 0200 /* heXadecimal digit */ + +static char ctype[] = { 0, + +/* 0 1 2 3 4 5 6 7 */ + +/* 0*/ _C, _C, _C, _C, _C, _C, _C, _C, +/* 10*/ _C, _S|_C, _S|_C, _S|_C, _S|_C, _S|_C, _C, _C, +/* 20*/ _C, _C, _C, _C, _C, _C, _C, _C, +/* 30*/ _C, _C, _C, _C, _C, _C, _C, _C, +/* 40*/ _S|_B, _P, _P, _P, _P, _P, _P, _P, +/* 50*/ _P, _P, _P, _P, _P, _P, _P, _P, +/* 60*/ _N|_X, _N|_X, _N|_X, _N|_X, _N|_X, _N|_X, _N|_X, _N|_X, +/* 70*/ _N|_X, _N|_X, _P, _P, _P, _P, _P, _P, +/*100*/ _P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U, +/*110*/ _U, _U, _U, _U, _U, _U, _U, _U, +/*120*/ _U, _U, _U, _U, _U, _U, _U, _U, +/*130*/ _U, _U, _U, _P, _P, _P, _P, _P, +/*140*/ _P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L, +/*150*/ _L, _L, _L, _L, _L, _L, _L, _L, +/*160*/ _L, _L, _L, _L, _L, _L, _L, _L, +/*170*/ _L, _L, _L, _P, _P, _P, _P, _C, +/*200*/ 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +#define REDIRECT_USR_LIB + +#ifdef REDIRECT_USR_LIB +static char bin_dir[PATH_MAX + 1]; +#endif +static int g_file_max = 3; + +#ifdef __CYGWIN__ +static size_t g_Pagesize; +#endif + +static uint8_t *memory_map(size_t length) +{ +#ifdef __CYGWIN__ + uint8_t *mem = mmap(0, length, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); + g_Pagesize = sysconf(_SC_PAGESIZE); + assert(((uintptr_t)mem & (g_Pagesize-1)) == 0); +#else + uint8_t *mem = mmap(0, length, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); +#endif + if (mem == MAP_FAILED) { + perror("mmap"); + exit(1); + } + return mem; +} + +static void memory_allocate(uint8_t *mem, uint32_t start, uint32_t end) +{ + assert(start >= MEM_REGION_START); + assert(end <= MEM_REGION_START + MEM_REGION_SIZE); +#ifdef __CYGWIN__ + uintptr_t _start = ((uintptr_t)mem + start) & ~(g_Pagesize-1); + uintptr_t _end = ((uintptr_t)mem + end + (g_Pagesize-1)) & ~(g_Pagesize-1); + + if(mprotect((void*)_start, _end - _start, PROT_READ | PROT_WRITE) < 0) { + perror("mprotect"); + exit(1); + } +#else + if (mmap(mem + start, end - start, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0) == MAP_FAILED) { + perror("mmap"); + exit(1); + } +#endif +} + +static void memory_unmap(uint8_t *mem, size_t length) +{ + if (munmap(mem, length)) { + perror("munmap"); + exit(1); + } +} + + +static void free_all_file_bufs(uint8_t *mem) { + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(IOB_ADDR); + for (int i = 0; i < g_file_max; i++) { + if (f[i]._flag & IOMYBUF) { + wrapper_free(mem, f[i]._base_addr); + } + } +} + +static void find_bin_dir(void) { +#ifdef REDIRECT_USR_LIB + // gets the current executable's path + char path[PATH_MAX + 1] = {0}; +#ifdef __CYGWIN__ + uint32_t size = GetModuleFileName(NULL, path, PATH_MAX); + if (size == 0 || size == PATH_MAX) { + return; + } +#elif defined __APPLE__ + uint32_t size = PATH_MAX; + if (_NSGetExecutablePath(path, &size) < 0) { + return; + } +#else + ssize_t size = readlink("/proc/self/exe", path, PATH_MAX); + if (size < 0 || size == PATH_MAX) { + return; + } +#endif + + strcpy(bin_dir, dirname(path)); +#endif +} + +int main(int argc, char *argv[]) { + int ret; + + find_bin_dir(); + + uint8_t *mem = memory_map(MEM_REGION_SIZE); + mem -= MEM_REGION_START; + int run(uint8_t *mem, int argc, char *argv[]); + ret = run(mem, argc, argv); + wrapper_fflush(mem, 0); + free_all_file_bufs(mem); + mem += MEM_REGION_START; + memory_unmap(mem, MEM_REGION_SIZE); + return ret; +} + +void mmap_initial_data_range(uint8_t *mem, uint32_t start, uint32_t end) { + custom_libc_data_addr = end; + end += 4096; + memory_allocate(mem, start, end); + cur_sbrk = end; +} + +void setup_libc_data(uint8_t *mem) { + memory_allocate(mem, LIBC_ADDR, (LIBC_ADDR + LIBC_SIZE)); + for (size_t i = 0; i < sizeof(ctype); i++) { + MEM_S8(CTYPE_ADDR + i) = ctype[i]; + } + STDIN->_flag = IOREAD; + STDIN->_file = 0; + STDOUT->_flag = IOWRT; + STDOUT->_file = 1; + STDERR->_flag = IOWRT | IONBF; + STDERR->_file = 2; +} + +static uint32_t strcpy1(uint8_t *mem, uint32_t dest_addr, const char *str) { + for (;;) { + char c = *str; + ++str; + MEM_S8(dest_addr) = c; + ++dest_addr; + if (c == '\0') { + return dest_addr - 1; + } + } +} + +static uint32_t strcpy2(uint8_t *mem, uint32_t dest_addr, uint32_t src_addr) { + for (;;) { + char c = MEM_S8(src_addr); + ++src_addr; + MEM_S8(dest_addr) = c; + ++dest_addr; + if (c == '\0') { + return dest_addr - 1; + } + } +} + +uint32_t wrapper_sbrk(uint8_t *mem, int increment) { + uint32_t old = cur_sbrk; + memory_allocate(mem, old, (old + increment)); + cur_sbrk += increment; + return old; +} + +#if 0 +uint32_t wrapper_malloc(uint8_t *mem, uint32_t size) { + uint32_t orig_size = size; + size += 8; + size = (size + 0xfff) & ~0xfff; + uint32_t ret = wrapper_sbrk(mem, size); + MEM_U32(ret) = orig_size; + return ret + 8; +} + +uint32_t wrapper_calloc(uint8_t *mem, uint32_t num, uint32_t size) { + uint64_t new_size = (uint64_t)num * size; + assert(new_size == (uint32_t)new_size); + uint32_t ret = wrapper_malloc(mem, new_size); + return wrapper_memset(mem, ret, 0, new_size); +} + +uint32_t wrapper_realloc(uint8_t *mem, uint32_t data_addr, uint32_t size) { + if (data_addr == 0) { + return wrapper_malloc(mem, size); + } + uint32_t orig_size = MEM_U32(data_addr - 8); + if (size < orig_size || orig_size < 4088 && size < 4088) { + MEM_U32(data_addr - 8) = size; + return data_addr; + } + uint32_t new_addr = wrapper_malloc(mem, size); + return wrapper_memcpy(mem, new_addr, data_addr, MIN(size, orig_size)); +} + +void wrapper_free(uint8_t *mem, uint32_t data_addr) { + // NOP +} +#else + +/* +Simple bin-based malloc algorithm + +The memory is divided into bins of item sizes 8, 16, 32, 64, 128, ..., 2^30. +Size requests are divided into these bin sizes and each bin is handled +completely separate from other bins. + +For each bin there is a linked list of free'd items. +Linked list node: +struct FreeListNode { + struct Node *next; + size_t free_space_after; + uint8_t data[bin_item_size]; +}; +At most one value of next and space_after is non-zero. +If a node exists in the linked list, it is the memory node to return. +struct AllocatedNode { + int bin; + uint32_t current_size; + uint8_t data[bin_item_size]; +}; +The returned address is the data element. +When the last list node is returned, and free_space_after is big enough +for a new node, a new node is created having free_space_after set to +(free_space_after - (8 + bin_item_size)), and is appended to the list. + +If the list was empty, a new memory chunk is requested from the system +of 65536 bytes, or at least (8 + bin_item_size), rounded up to nearest +page size boundary. It can also be smaller if it leaves holes bigger than +4096 bytes that can never be used. This chunk is then inserted to the list, +and the algorithm restarts. + +This algorithm, for each bin, never uses more than twice as much as is +maximally in use (plus 65536 bytes). +The malloc/free calls run in O(1) and calloc/realloc calls run in O(size). +*/ + +size_t mem_used; +size_t mem_allocated; +size_t max_mem_used; +size_t num_sbrks; +size_t num_allocs; +uint32_t wrapper_malloc(uint8_t *mem, uint32_t size) { + int bin = -1; + for (int i = 3; i < 30; i++) { + if (size <= (1 << i)) { + bin = i; + break; + } + } + if (bin == -1) { + return 0; + } + ++num_allocs; + mem_used += size; + max_mem_used = MAX(mem_used, max_mem_used); + uint32_t item_size = 1 << bin; + uint32_t list_ptr = MALLOC_BINS_ADDR + (bin - 3) * 4; + uint32_t node_ptr = MEM_U32(list_ptr); + if (node_ptr == 0) { + uint32_t sbrk_request = 0x10000; + if (8 + item_size > sbrk_request) { + sbrk_request = 8 + item_size; + sbrk_request = (sbrk_request + 0xfff) & ~0xfff; + } + uint32_t left_over = sbrk_request % (8 + item_size); + sbrk_request -= left_over & ~0xfff; + mem_allocated += sbrk_request; + ++num_sbrks; + node_ptr = wrapper_sbrk(mem, sbrk_request); + MEM_U32(node_ptr + 4) = sbrk_request - (8 + item_size); + } + uint32_t next = MEM_U32(node_ptr); + if (next == 0) { + uint32_t free_space_after = MEM_U32(node_ptr + 4); + if (free_space_after >= 8 + item_size) { + next = node_ptr + 8 + item_size; + MEM_U32(next + 4) = free_space_after - (8 + item_size); + } + } else { + assert(MEM_U32(node_ptr + 4) == 0); + } + MEM_U32(list_ptr) = next; + MEM_U32(node_ptr) = bin; + MEM_U32(node_ptr + 4) = size; + return node_ptr + 8; +} + +uint32_t wrapper_calloc(uint8_t *mem, uint32_t num, uint32_t size) { + uint64_t new_size = (uint64_t)num * size; + assert(new_size == (uint32_t)new_size); + uint32_t ret = wrapper_malloc(mem, new_size); + return wrapper_memset(mem, ret, 0, new_size); +} + +uint32_t wrapper_realloc(uint8_t *mem, uint32_t data_addr, uint32_t size) { + if (data_addr == 0) { + return wrapper_malloc(mem, size); + } else { + uint32_t node_ptr = data_addr - 8; + int bin = MEM_U32(node_ptr); + uint32_t old_size = MEM_U32(node_ptr + 4); + uint32_t max_size = 1 << bin; + assert(bin >= 3 && bin < 30); + assert(old_size <= max_size); + if (size <= max_size) { + mem_used = mem_used - old_size + size; + MEM_U32(node_ptr + 4) = size; + return data_addr; + } else { + uint32_t new_addr = wrapper_malloc(mem, size); + wrapper_memcpy(mem, new_addr, data_addr, old_size); + wrapper_free(mem, data_addr); + return new_addr; + } + } +} + +void wrapper_free(uint8_t *mem, uint32_t data_addr) { + uint32_t node_ptr = data_addr - 8; + int bin = MEM_U32(node_ptr); + uint32_t size = MEM_U32(node_ptr + 4); + uint32_t list_ptr = MALLOC_BINS_ADDR + (bin - 3) * 4; + assert(bin >= 3 && bin < 30); + assert(size <= (1 << bin)); + MEM_U32(node_ptr) = MEM_U32(list_ptr); + MEM_U32(node_ptr + 4) = 0; + MEM_U32(list_ptr) = node_ptr; + mem_used -= size; +} +#endif + +int wrapper_fscanf(uint8_t *mem, uint32_t fp_addr, uint32_t format_addr, uint32_t sp) { + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + STRING(format) // for debug + + int ret = 0; + char c; + int ch; + sp += 2 * 4; + for (;;) { + c = MEM_S8(format_addr); + ++format_addr; + if (c == '%') { + c = MEM_S8(format_addr); + ++format_addr; + if (c == '%') { + goto percent; + } + for (;;) { + ch = wrapper_fgetc(mem, fp_addr); + if (ch == -1) { + return ret; + } + if (!isspace(ch)) { + //wrapper_ungetc(mem, ch, fp_addr); + break; + } + } + bool l = false; + continue_format: + switch (c) { + case 'l': + assert(!l && "ll not implemented in fscanf"); + l = true; + c = MEM_S8(format_addr); + ++format_addr; + goto continue_format; + case 'd': + { + int64_t num = 0; + int sign = 1; + bool found_first = false; + if (ch == '-') { + sign = -1; + ch = wrapper_fgetc(mem, fp_addr); + if (ch == -1) { + return ret; + } + } + for (;;) { + if (isdigit(ch)) { + num *= 10; + num += ch - '0'; + found_first = true; + ch = wrapper_fgetc(mem, fp_addr); + if (ch == -1) { + break; + } + } else { + wrapper_ungetc(mem, ch, fp_addr); + break; + } + } + if (found_first) { + uint32_t int_addr = MEM_U32(sp); + sp += 4; + MEM_S32(int_addr) = (int)(num * sign); + ++ret; + } else { + return ret; + } + break; + } + default: + assert(0 && "fscanf format not implemented"); + } + } else if (c == '\0') { + break; + } else { + percent: + ch = wrapper_fgetc(mem, fp_addr); + if (ch == -1) { + break; + } + if ((char)ch != c) { + break; + } + } + } + + return ret; +} + +int wrapper_printf(uint8_t *mem, uint32_t format_addr, uint32_t sp) { + STRING(format) + if (!strcmp(format, " child died due to signal %d.\n")) { + printf(format, MEM_U32(sp + 4)); + return 1; + } + assert(0 && "printf not implemented"); + return 0; +} + +int wrapper_sprintf(uint8_t *mem, uint32_t str_addr, uint32_t format_addr, uint32_t sp) { + STRING(format) // for debug + char temp[32]; + + if (!strcmp(format, "%.16e")) { + union { + uint32_t w[2]; + double d; + } d; + d.w[1] = MEM_U32(sp + 2 * 4); + d.w[0] = MEM_U32(sp + 3 * 4); + sprintf(temp, "%.16e", d.d); + strcpy1(mem, str_addr, temp); + return 1; + } + if (!strcmp(format, "\\%03o")) { + sprintf(temp, "\\%03o", MEM_U32(sp + 2 * 4)); + strcpy1(mem, str_addr, temp); + return 1; + } + if (!strcmp(format, "%*ld=")) { + sprintf(temp, "%*d=", MEM_U32(sp + 2 * 4), MEM_U32(sp + 3 * 4)); + strcpy1(mem, str_addr, temp); + return 1; + } + + uint32_t orig_str_addr = str_addr; + uint32_t pos = 0; + int ret = 0; + char c; + sp += 2 * 4; + for (;;) { + c = MEM_S8(format_addr + pos); + ++pos; + if (c == '%') { + bool l = false; + c = MEM_S8(format_addr + pos); + ++pos; + uint32_t zeros = 0; + bool zero_prefix = false; + continue_format: + switch (c) { + case '0': + do { + c = MEM_S8(format_addr + pos); + ++pos; + if (c >= '0' && c <= '9') { + zeros *= 10; + zeros += c - '0'; + } + } while (c >= '0' && c <= '9'); + goto continue_format; + case '#': + c = MEM_S8(format_addr + pos); + ++pos; + zero_prefix = true; + goto continue_format; + break; + case 'l': + assert(!l && "ll not implemented in fscanf"); + c = MEM_S8(format_addr + pos); + ++pos; + l = true; + goto continue_format; + break; + case 'd': + if (zeros != 0) { + char temp1[32]; + sprintf(temp1, "%%0%dd", zeros); + sprintf(temp, temp1, MEM_S32(sp)); + } else { + sprintf(temp, "%d", MEM_S32(sp)); + } + sp += 4; + str_addr = strcpy1(mem, str_addr, temp); + ++ret; + break; + case 'o': + if (zero_prefix) { + sprintf(temp, "%#o", MEM_S32(sp)); + } else { + sprintf(temp, "%o", MEM_S32(sp)); + } + sp += 4; + str_addr = strcpy1(mem, str_addr, temp); + ++ret; + break; + case 'x': + if (zero_prefix) { + sprintf(temp, "%#x", MEM_S32(sp)); + } else { + sprintf(temp, "%x", MEM_S32(sp)); + } + sp += 4; + str_addr = strcpy1(mem, str_addr, temp); + ++ret; + break; + case 'u': + sprintf(temp, "%u", MEM_S32(sp)); + sp += 4; + str_addr = strcpy1(mem, str_addr, temp); + ++ret; + break; + case 's': + str_addr = strcpy2(mem, str_addr, MEM_U32(sp)); + sp += 4; + ++ret; + break; + case 'c': + MEM_S8(str_addr) = (char)MEM_U32(sp); + ++str_addr; + sp += 4; + ++ret; + break; + case '%': + MEM_S8(str_addr) = '%'; + ++str_addr; + break; + default: + fprintf(stderr, "%s\n", format); + assert(0 && "non-implemented sprintf format"); + } + } else if (c == '\0') { + break; + } else { + MEM_S8(str_addr) = c; + ++str_addr; + } + } + + MEM_S8(str_addr) = '\0'; + STRING(orig_str) // for debug + //printf("result: '%s' '%s'\n", format, orig_str); + return ret; +} + +int wrapper_fprintf(uint8_t *mem, uint32_t fp_addr, uint32_t format_addr, uint32_t sp) { + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + STRING(format) + sp += 8; + /*if (!strcmp(format, "%s")) { + uint32_t s_addr = MEM_U32(sp); + STRING(s) + if (fp_addr == STDERR_ADDR) { + fprintf(stderr, "%s", s); + fflush(stderr); + return 1; + } + } + if (!strcmp(format, "%s: %s: ")) { + uint32_t s1_addr = MEM_U32(sp), s2_addr = MEM_U32(sp + 4); + STRING(s1) + STRING(s2) + if (fp_addr == STDERR_ADDR) { + fprintf(stderr, "%s: %s: ", s1, s2); + fflush(stderr); + return 1; + } + }*/ + int ret = 0; + for (;;) { + uint32_t pos = format_addr; + char ch = MEM_S8(pos); + while (ch != '%' && ch != '\0') { + ++pos; + ch = MEM_S8(pos); + } + if (format_addr != pos) { + if (wrapper_fwrite(mem, format_addr, 1, pos - format_addr, fp_addr) != pos - format_addr) { + break; + } + } + if (ch == '\0') { + break; + } + ++pos; + ch = MEM_S8(pos); + switch (ch) { + case 'd': + { + char buf[32]; + sprintf(buf, "%d", MEM_U32(sp)); + strcpy1(mem, INTBUF_ADDR, buf); + if (wrapper_fputs(mem, INTBUF_ADDR, fp_addr) == -1) { + return ret; + } + sp += 4; + ++ret; + break; + } + case 's': + { + if (wrapper_fputs(mem, MEM_U32(sp), fp_addr) == -1) { + return ret; + } + sp += 4; + ++ret; + break; + } + case 'c': + { + char buf[32]; + sprintf(buf, "%c", MEM_U32(sp)); + strcpy1(mem, INTBUF_ADDR, buf); + if (wrapper_fputs(mem, INTBUF_ADDR, fp_addr) == -1) { + return ret; + } + sp += 4; + ++ret; + break; + } + default: + fprintf(stderr, "missing format: '%s'\n", format); + assert(0 && "non-implemented fprintf format"); + } + format_addr = ++pos; + } + return ret; +} + +int wrapper__doprnt(uint8_t *mem, uint32_t format_addr, uint32_t params_addr, uint32_t fp_addr) { + assert(0 && "_doprnt not implemented"); + return 0; +} + +uint32_t wrapper_strlen(uint8_t *mem, uint32_t str_addr) { + uint32_t len = 0; + while (MEM_S8(str_addr) != '\0') { + ++str_addr; + ++len; + } + return len; +} + +int wrapper_open(uint8_t *mem, uint32_t pathname_addr, int flags, int mode) { + STRING(pathname) + int f = flags & O_ACCMODE; + if (flags & 0x100) { + f |= O_CREAT; + } + if (flags & 0x200) { + f |= O_TRUNC; + } + if (flags & 0x400) { + f |= O_EXCL; + } + if (flags & 0x800) { + f |= O_NOCTTY; + } + if (flags & 0x08) { + f |= O_APPEND; + } + int fd = open(pathname, f, mode); + MEM_U32(ERRNO_ADDR) = errno; + return fd; +} + +int wrapper_creat(uint8_t *mem, uint32_t pathname_addr, int mode) { + STRING(pathname) + int ret = creat(pathname, mode); + if (ret < 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +int wrapper_access(uint8_t *mem, uint32_t pathname_addr, int mode) { + STRING(pathname) + int ret = access(pathname, mode); + if (ret != 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +int wrapper_rename(uint8_t *mem, uint32_t oldpath_addr, uint32_t newpath_addr) { + STRING(oldpath) + STRING(newpath) + int ret = rename(oldpath, newpath); + if (ret != 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +int wrapper_utime(uint8_t *mem, uint32_t filename_addr, uint32_t times_addr) { + STRING(filename) + struct utimbuf buf = {0, 0}; + int ret = utime(filename, times_addr == 0 ? NULL : &buf); + if (ret == 0) { + if (times_addr != 0) { + MEM_U32(times_addr + 0) = buf.actime; + MEM_U32(times_addr + 4) = buf.modtime; + } + } else { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +int wrapper_flock(uint8_t *mem, int fd, int operation) { + int ret = flock(fd, operation); + if (ret != 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +int wrapper_chmod(uint8_t *mem, uint32_t path_addr, uint32_t mode) { + STRING(path) + int ret = chmod(path, mode); + if (ret < 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +int wrapper_umask(int mode) { + return umask(mode); +} + +uint32_t wrapper_ecvt(uint8_t *mem, double number, int ndigits, uint32_t decpt_addr, uint32_t sign_addr) { + assert(0); +} + +uint32_t wrapper_fcvt(uint8_t *mem, double number, int ndigits, uint32_t decpt_addr, uint32_t sign_addr) { + assert(0); +} + +double wrapper_sqrt(double v) { + return sqrt(v); +} + +float wrapper_sqrtf(float v) { + return sqrtf(v); +} + +int wrapper_atoi(uint8_t *mem, uint32_t nptr_addr) { + STRING(nptr) + return atoi(nptr); +} + +int wrapper_atol(uint8_t *mem, uint32_t nptr_addr) { + return wrapper_atoi(mem, nptr_addr); +} + +double wrapper_atof(uint8_t *mem, uint32_t nptr_addr) { + STRING(nptr); + return atof(nptr); +} + +int wrapper_strtol(uint8_t *mem, uint32_t nptr_addr, uint32_t endptr_addr, int base) { + STRING(nptr) + char *endptr = NULL; + int64_t res = strtoll(nptr, endptr_addr != 0 ? &endptr : NULL, base); + if (res > INT_MAX) { + MEM_U32(ERRNO_ADDR) = ERANGE; + res = INT_MAX; + } + if (res < INT_MIN) { + MEM_U32(ERRNO_ADDR) = ERANGE; + res = INT_MIN; + } + if (endptr != NULL) { + MEM_U32(endptr_addr) = nptr_addr + (uint32_t)(endptr - nptr); + } + return res; +} + +uint32_t wrapper_strtoul(uint8_t *mem, uint32_t nptr_addr, uint32_t endptr_addr, int base) { + STRING(nptr) + char *endptr = NULL; + uint64_t res = strtoull(nptr, endptr_addr != 0 ? &endptr : NULL, base); + if (res > INT_MAX) { + MEM_U32(ERRNO_ADDR) = ERANGE; + res = INT_MAX; + } + if (endptr != NULL) { + MEM_U32(endptr_addr) = nptr_addr + (uint32_t)(endptr - nptr); + } + return res; +} + +double wrapper_strtod(uint8_t *mem, uint32_t nptr_addr, uint32_t endptr_addr) { + STRING(nptr) + char *endptr = NULL; + errno = 0; + double res = strtod(nptr, endptr_addr != 0 ? &endptr : NULL); + if (errno != 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + if (endptr != NULL) { + MEM_U32(endptr_addr) = nptr_addr + (uint32_t)(endptr - nptr); + } + return res; +} + +uint32_t wrapper_strchr(uint8_t *mem, uint32_t str_addr, int c) { + c = c & 0xff; + for (;;) { + unsigned char ch = MEM_U8(str_addr); + if (ch == c) { + return str_addr; + } + if (ch == '\0') { + return 0; + } + ++str_addr; + } +} + +uint32_t wrapper_strrchr(uint8_t *mem, uint32_t str_addr, int c) { + c = c & 0xff; + uint32_t ret = 0; + for (;;) { + unsigned char ch = MEM_U8(str_addr); + if (ch == c) { + ret = str_addr; + } + if (ch == '\0') { + return ret; + } + ++str_addr; + } +} + +uint32_t wrapper_strcspn(uint8_t *mem, uint32_t str_addr, uint32_t invalid_addr) { + STRING(invalid) + uint32_t n = strlen(invalid); + uint32_t pos = 0; + char c; + while ((c = MEM_S8(str_addr)) != 0) { + for (int i = 0; i < n; i++) { + if (c == invalid[i]) { + return pos; + } + } + ++pos; + ++str_addr; + } + return pos; +} + +uint32_t wrapper_strpbrk(uint8_t *mem, uint32_t str_addr, uint32_t accept_addr) { + STRING(accept) + uint32_t n = strlen(accept); + char c; + while ((c = MEM_S8(str_addr)) != 0) { + for (int i = 0; i < n; i++) { + if (c == accept[i]) { + return str_addr; + } + } + ++str_addr; + } + return 0; +} + +static void stat_common(uint8_t *mem, uint32_t buf_addr, struct stat *statbuf) { + struct irix_stat { + int st_dev; + int pad1[3]; + int st_ino; + int st_mode; + int st_nlink; + int st_uid; + int st_gid; + int st_rdev; + int pad2[2]; + int st_size; + int pad3; + struct timespec_t_irix st_atim; + struct timespec_t_irix st_mtim; + struct timespec_t_irix st_ctim; + int st_blksize; + int st_blocks; + } s; + s.st_dev = statbuf->st_dev; + s.st_ino = statbuf->st_ino; + s.st_mode = statbuf->st_mode; + s.st_nlink = statbuf->st_nlink; + s.st_uid = statbuf->st_uid; + s.st_gid = statbuf->st_gid; + s.st_rdev = statbuf->st_rdev; + s.st_size = statbuf->st_size; +#ifdef __APPLE__ + s.st_atim.tv_sec = statbuf->st_atimespec.tv_sec; + s.st_atim.tv_nsec = statbuf->st_atimespec.tv_nsec; + s.st_mtim.tv_sec = statbuf->st_mtimespec.tv_sec; + s.st_mtim.tv_nsec = statbuf->st_mtimespec.tv_nsec; + s.st_ctim.tv_sec = statbuf->st_ctimespec.tv_sec; + s.st_ctim.tv_nsec = statbuf->st_ctimespec.tv_nsec; +#else + s.st_atim.tv_sec = statbuf->st_atim.tv_sec; + s.st_atim.tv_nsec = statbuf->st_atim.tv_nsec; + s.st_mtim.tv_sec = statbuf->st_mtim.tv_sec; + s.st_mtim.tv_nsec = statbuf->st_mtim.tv_nsec; + s.st_ctim.tv_sec = statbuf->st_ctim.tv_sec; + s.st_ctim.tv_nsec = statbuf->st_ctim.tv_nsec; +#endif + memcpy(&MEM_U32(buf_addr), &s, sizeof(s)); +} + +int wrapper_fstat(uint8_t *mem, int fildes, uint32_t buf_addr) { + struct stat statbuf; + if (fstat(fildes, &statbuf) < 0) { + MEM_U32(ERRNO_ADDR) = errno; + return -1; + } else { + stat_common(mem, buf_addr, &statbuf); + return 0; + } +} + +int wrapper_stat(uint8_t *mem, uint32_t pathname_addr, uint32_t buf_addr) { + STRING(pathname) + struct stat statbuf; + if (stat(pathname, &statbuf) < 0) { + MEM_U32(ERRNO_ADDR) = errno; + return -1; + } else { + stat_common(mem, buf_addr, &statbuf); + return 0; + } +} + +int wrapper_ftruncate(uint8_t *mem, int fd, int length) { + int ret = ftruncate(fd, length); + if (ret != 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +void wrapper_bcopy(uint8_t *mem, uint32_t src_addr, uint32_t dst_addr, uint32_t len) { + wrapper_memcpy(mem, dst_addr, src_addr, len); +} + +uint32_t wrapper_memcpy(uint8_t *mem, uint32_t dst_addr, uint32_t src_addr, uint32_t len) { + uint32_t saved = dst_addr; + if (dst_addr % 4 == 0 && src_addr % 4 == 0 && len % 4 == 0) { + memcpy(&MEM_U32(dst_addr), &MEM_U32(src_addr), len); + } else { + while (len--) { + MEM_U8(dst_addr) = MEM_U8(src_addr); + ++dst_addr; + ++src_addr; + } + } + return saved; +} + +uint32_t wrapper_memccpy(uint8_t *mem, uint32_t dst_addr, uint32_t src_addr, int c, uint32_t len) { + while (len--) { + uint8_t ch = MEM_U8(src_addr); + MEM_U8(dst_addr) = ch; + ++dst_addr; + ++src_addr; + if (ch == c) { + return dst_addr; + } + } + return 0; +} + +int wrapper_read(uint8_t *mem, int fd, uint32_t buf_addr, uint32_t nbytes) { + uint8_t *buf = (uint8_t *)malloc(nbytes); + ssize_t ret = read(fd, buf, nbytes); + if (ret < 0) { + MEM_U32(ERRNO_ADDR) = errno; + } else { + for (ssize_t i = 0; i < ret; i++) { + MEM_U8(buf_addr + i) = buf[i]; + } + } + free(buf); + return (int)ret; +} + +int wrapper_write(uint8_t *mem, int fd, uint32_t buf_addr, uint32_t nbytes) { + uint8_t *buf = (uint8_t *)malloc(nbytes); + for (size_t i = 0; i < nbytes; i++) { + buf[i] = MEM_U8(buf_addr + i); + } + ssize_t ret = write(fd, buf, nbytes); + if (ret < 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + free(buf); + return (int)ret; +} + +static uint32_t init_file(uint8_t *mem, int fd, int i, const char *path, const char *mode) { + int flags = O_RDONLY; + if (strcmp(mode, "r") == 0 || strcmp(mode, "rb") == 0) { + flags = O_RDONLY; + } else if (strcmp(mode, "w") == 0 || strcmp(mode, "wb") == 0) { + flags = O_WRONLY | O_CREAT | O_TRUNC; + } else if (strcmp(mode, "a") == 0 || strcmp(mode, "ab") == 0) { + flags = O_WRONLY | O_CREAT | O_APPEND; + } else if (strcmp(mode, "r+") == 0 || strcmp(mode, "r+b") == 0) { + flags = O_RDWR; + } else if (strcmp(mode, "w+") == 0 || strcmp(mode, "w+b") == 0) { + flags = O_RDWR | O_CREAT | O_TRUNC; + } else if (strcmp(mode, "a+") == 0 || strcmp(mode, "a+b") == 0) { + flags = O_RDWR | O_CREAT | O_APPEND; + } + if (fd == -1) { + +#ifdef REDIRECT_USR_LIB + char fixed_path[PATH_MAX + 1]; + if (!strcmp(path, "/usr/lib/err.english.cc") && bin_dir[0] != '\0') { + int n = snprintf(fixed_path, sizeof(fixed_path), "%s/err.english.cc", bin_dir); + if (n >= 0 && n < sizeof(fixed_path)) { + path = fixed_path; + } + } +#endif + fd = open(path, flags, 0666); + if (fd < 0) { + MEM_U32(ERRNO_ADDR) = errno; + return 0; + } + } + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(IOB_ADDR); + uint32_t ret = 0; + if (i == -1) { + for (i = 3; i < NFILE; i++) { + if (f[i]._flag == 0) { + break; + } + } + } + assert(i < NFILE); + g_file_max = i + 1; + ret = IOB_ADDR + i * sizeof(struct FILE_irix); + f[i]._cnt = 0; + f[i]._ptr_addr = 0; + f[i]._base_addr = 0; + f[i]._file = fd; + f[i]._flag = (flags & O_ACCMODE) == O_RDONLY ? IOREAD : 0; + f[i]._flag |= (flags & O_ACCMODE) == O_WRONLY ? IOWRT : 0; + f[i]._flag |= (flags & O_ACCMODE) == O_RDWR ? IORW : 0; + bufendtab[i] = 0; + return ret; +} + +uint32_t wrapper_fopen(uint8_t *mem, uint32_t path_addr, uint32_t mode_addr) { + STRING(path) + STRING(mode) + return init_file(mem, -1, -1, path, mode); +} + +uint32_t wrapper_freopen(uint8_t *mem, uint32_t path_addr, uint32_t mode_addr, uint32_t fp_addr) { + STRING(path) + STRING(mode) + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + wrapper_fclose(mem, fp_addr); + return init_file(mem, -1, f - (struct FILE_irix *)&MEM_U32(IOB_ADDR), path, mode); +} + +int wrapper_fclose(uint8_t *mem, uint32_t fp_addr) { + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + wrapper_fflush(mem, fp_addr); + if (f->_flag & IOMYBUF) { + wrapper_free(mem, f->_base_addr); + } + f->_flag = 0; + close(f->_file); + return 0; +} + +static int flush_all(uint8_t *mem) { + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(IOB_ADDR); + int ret = 0; + for (int i = 0; i < g_file_max; i++) { + if (f[i]._flag & IOWRT) { + ret |= wrapper_fflush(mem, IOB_ADDR + i * sizeof(struct FILE_irix)); + } + } + return ret; +} + +int wrapper_fflush(uint8_t *mem, uint32_t fp_addr) { + if (fp_addr == 0) { + // Flush all + return flush_all(mem); + } + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + if (f->_flag & IOWRT) { + int p = 0; + int to_flush = f->_ptr_addr - f->_base_addr; + int c = to_flush; + while (c > 0) { + int r = wrapper_write(mem, f->_file, f->_base_addr + p, c); + if (r < 0) { + f->_file |= IOERR; + return -1; + } + p += r; + c -= r; + } + f->_ptr_addr = f->_base_addr; + f->_cnt += to_flush; + } + return 0; +} + +int wrapper_ftell(uint8_t *mem, uint32_t fp_addr) { + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + int adjust; + if (f->_cnt < 0) { + f->_cnt = 0; + } + if (f->_flag & IOREAD) { + adjust = -f->_cnt; + } else if (f->_flag & (IOWRT | IORW)) { + adjust = 0; + if ((f->_flag & IOWRT) && f->_base_addr != 0 && (f->_flag & IONBF) == 0) { + adjust = f->_ptr_addr - f->_base_addr; + } + } else { + return -1; + } + int res = wrapper_lseek(mem, f->_file, 0, 1); + if (res >= 0) { + res += adjust; + } + return res; +} + +void wrapper_rewind(uint8_t *mem, uint32_t fp_addr) { + (void)wrapper_fseek(mem, fp_addr, 0, SEEK_SET); + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + f->_flag &= ~IOERR; +} + +int wrapper_fseek(uint8_t *mem, uint32_t fp_addr, int offset, int origin) { + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + int c, p; + f->_flag &= ~IOEOF; + if (f->_flag & IOREAD) { + if (origin < SEEK_END && f->_base_addr && !(f->_flag & IONBF)) { + c = f->_cnt; + p = offset; + if (origin == SEEK_SET) { + p += c - lseek(f->_file, 0L, SEEK_CUR); + } else { + offset -= c; + } + if (!(f->_flag & IORW) && c > 0 && p <= c && p >= f->_base_addr - f->_ptr_addr) { + f->_ptr_addr += p; + f->_cnt -= p; + return 0; + } + } + if (f->_flag & IORW) { + f->_ptr_addr = f->_base_addr; + f->_flag &= ~IOREAD; + } + p = lseek(f->_file, offset, origin); + f->_cnt = 0; + } else if (f->_flag & (IOWRT | IORW)) { + wrapper_fflush(mem, fp_addr); + if (f->_flag & IORW) { + f->_cnt = 0; + f->_flag &= ~IOWRT; + f->_ptr_addr = f->_base_addr; + } + p = lseek(f->_file, offset, origin); + } + if (p < 0) { + MEM_U32(ERRNO_ADDR) = errno; + return p; + } + return 0; +} + +int wrapper_lseek(uint8_t *mem, int fd, int offset, int whence) { + int ret = (int)lseek(fd, offset, whence); + if (ret == -1) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +int wrapper_dup(uint8_t *mem, int fd) { + fd = dup(fd); + if (fd < 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + return fd; +} + +int wrapper_dup2(uint8_t *mem, int oldfd, int newfd) { + int fd = dup2(oldfd, newfd); + if (fd < 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + return fd; +} + +int wrapper_pipe(uint8_t *mem, uint32_t pipefd_addr) { + int pipefd[2]; + int ret = pipe(pipefd); + if (ret == 0) { + MEM_U32(pipefd_addr + 0) = pipefd[0]; + MEM_U32(pipefd_addr + 4) = pipefd[1]; + } else { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +void wrapper_perror(uint8_t *mem, uint32_t str_addr) { + STRING(str) + perror(str); +} + +int wrapper_fdopen(uint8_t *mem, int fd, uint32_t mode_addr) { + STRING(mode) + return init_file(mem, fd, -1, NULL, mode); +} + +uint32_t wrapper_memset(uint8_t *mem, uint32_t dest_addr, int byte, uint32_t n) { + uint32_t saved = dest_addr; + if (dest_addr % 4 == 0 && n % 4 == 0) { + memset(&MEM_U32(dest_addr), byte, n); + } else { + while (n--) { + MEM_U8(dest_addr) = (uint8_t)byte; + ++dest_addr; + } + } + return saved; +} + +int wrapper_bcmp(uint8_t *mem, uint32_t s1_addr, uint32_t s2_addr, uint32_t n) { + while (n--) { + if (MEM_U8(s1_addr) != MEM_U8(s2_addr)) { + return 1; + } + ++s1_addr; + ++s2_addr; + } + return 0; +} + +int wrapper_memcmp(uint8_t *mem, uint32_t s1_addr, uint32_t s2_addr, uint32_t n) { + while (n--) { + unsigned char c1 = MEM_U8(s1_addr); + unsigned char c2 = MEM_U8(s2_addr); + if (c1 < c2) { + return -1; + } + if (c1 > c2) { + return 1; + } + ++s1_addr; + ++s2_addr; + } + return 0; +} + +int wrapper_getpid(void) { + return getpid(); +} + +int wrapper_getpgrp(uint8_t *mem) { + int ret = getpgrp(); + if (ret == -1) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +int wrapper_remove(uint8_t *mem, uint32_t path_addr) { + STRING(path) + int ret = remove(path); + if (ret < 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +int wrapper_unlink(uint8_t *mem, uint32_t path_addr) { + if (path_addr == 0) { + fprintf(stderr, "Warning: unlink with NULL as arguement\n"); + MEM_U32(ERRNO_ADDR) = EFAULT; + return -1; + } + STRING(path) + int ret = unlink(path); + if (ret < 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +int wrapper_close(uint8_t *mem, int fd) { + int ret = close(fd); + if (ret < 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +int wrapper_strcmp(uint8_t *mem, uint32_t s1_addr, uint32_t s2_addr) { + for (;;) { + char c1 = MEM_S8(s1_addr); + char c2 = MEM_S8(s2_addr); + if (c1 != c2) { + return c1 < c2 ? -1 : 1; + } + if (c1 == '\0') { + return 0; + } + ++s1_addr; + ++s2_addr; + } +} + +int wrapper_strncmp(uint8_t *mem, uint32_t s1_addr, uint32_t s2_addr, uint32_t n) { + if (n == 0) { + return 0; + } + for (;;) { + char c1 = MEM_S8(s1_addr); + char c2 = MEM_S8(s2_addr); + if (c1 != c2) { + return c1 < c2 ? -1 : 1; + } + if (--n == 0 || c1 == '\0') { + return 0; + } + ++s1_addr; + ++s2_addr; + } +} + +uint32_t wrapper_strcpy(uint8_t *mem, uint32_t dest_addr, uint32_t src_addr) { + uint32_t saved = dest_addr; + for (;;) { + char c = MEM_S8(src_addr); + ++src_addr; + MEM_S8(dest_addr) = c; + ++dest_addr; + if (c == '\0') { + return saved; + } + } +} + +uint32_t wrapper_strncpy(uint8_t *mem, uint32_t dest_addr, uint32_t src_addr, uint32_t n) { + uint32_t i; + for (i = 0; i < n && MEM_S8(src_addr) != '\0'; i++) { + MEM_S8(dest_addr + i) = MEM_S8(src_addr + i); + } + for (; i < n; i++) { + MEM_S8(dest_addr + i) = '\0'; + } + return dest_addr; +} + +uint32_t wrapper_strcat(uint8_t *mem, uint32_t dest_addr, uint32_t src_addr) { + uint32_t saved = dest_addr; + while (MEM_S8(dest_addr) != '\0') { + ++dest_addr; + } + while (MEM_S8(src_addr) != '\0') { + MEM_S8(dest_addr) = MEM_S8(src_addr); + ++src_addr; + ++dest_addr; + } + MEM_S8(dest_addr) = '\0'; + return saved; +} + +uint32_t wrapper_strncat(uint8_t *mem, uint32_t dest_addr, uint32_t src_addr, uint32_t n) { + uint32_t saved = dest_addr; + while (MEM_S8(dest_addr) != '\0') { + ++dest_addr; + } + while (n-- && MEM_S8(src_addr) != '\0') { + MEM_S8(dest_addr) = MEM_S8(src_addr); + ++src_addr; + ++dest_addr; + } + MEM_S8(dest_addr) = '\0'; + return saved; +} + +uint32_t wrapper_strtok(uint8_t *mem, uint32_t str_addr, uint32_t delimiters_addr) { + if (str_addr == 0) { + str_addr = MEM_U32(STRTOK_DATA_ADDR); + } + if (str_addr == 0) { + // nothing remaining + return 0; + } + uint32_t p; + for (p = str_addr; MEM_S8(p) != '\0'; p++) { + uint32_t q; + for (q = delimiters_addr; MEM_S8(q) != '\0' && MEM_S8(q) != MEM_S8(p); q++) { + } + if (MEM_S8(q) == '\0') { + break; + } + } + if (MEM_S8(p) == '\0') { + return 0; + } + uint32_t ret = p; + for (;;) { + uint32_t q; + for (q = delimiters_addr; MEM_S8(q) != '\0' && MEM_S8(q) != MEM_S8(p); q++) { + } + if (MEM_S8(q) != '\0') { + MEM_S8(p) = '\0'; + MEM_U32(STRTOK_DATA_ADDR) = ++p; + return ret; + } + char next = MEM_S8(p); + ++p; + if (next == '\0') { + MEM_U32(STRTOK_DATA_ADDR) = 0; + return ret; + } + } +} + +uint32_t wrapper_strstr(uint8_t *mem, uint32_t str1_addr, uint32_t str2_addr) { + for (;;) { + if (MEM_S8(str1_addr) == '\0') { + return 0; + } + uint32_t s1 = str1_addr; + uint32_t s2 = str2_addr; + for (;;) { + char c2 = MEM_S8(s2); + if (c2 == '\0') { + return str1_addr; + } + if (MEM_S8(s1) == c2) { + ++s1; + ++s2; + } else { + break; + } + } + ++str1_addr; + } +} + +uint32_t wrapper_strdup(uint8_t *mem, uint32_t str_addr) { + uint32_t len = wrapper_strlen(mem, str_addr) + 1; + uint32_t ret = wrapper_malloc(mem, len); + if (ret == 0) { + MEM_U32(ERRNO_ADDR) = ENOMEM; + return 0; + } + return wrapper_memcpy(mem, ret, str_addr, len); +} + +int wrapper_toupper(int c) { + return toupper(c); +} + +int wrapper_tolower(int c) { + return tolower(c); +} + +int wrapper_gethostname(uint8_t *mem, uint32_t name_addr, uint32_t len) { + char buf[256] = {0}; + if (len > 256) { + len = 256; + } + int ret = gethostname(buf, len); + if (ret < 0) { + MEM_U32(ERRNO_ADDR) = errno; + } else { + for (uint32_t i = 0; i < len; i++) { + MEM_S8(name_addr + i) = buf[i]; + } + } + return ret; +} + +int wrapper_isatty(uint8_t *mem, int fd) { + int ret = isatty(fd); + if (ret == 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +uint32_t wrapper_strftime(uint8_t *mem, uint32_t ptr_addr, uint32_t maxsize, uint32_t format_addr, uint32_t timeptr_addr) { + //assert(0 && "strftime not implemented"); + MEM_S8(ptr_addr) = 0; + return 0; +} + +int wrapper_times(uint8_t *mem, uint32_t buffer_addr) { + struct tms_irix { + int tms_utime; + int tms_stime; + int tms_cutime; + int tms_cstime; + } r; + struct tms t; + clock_t ret = times(&t); + if (ret == (clock_t)-1) { + MEM_U32(ERRNO_ADDR) = errno; + } else { + r.tms_utime = t.tms_utime; + r.tms_stime = t.tms_stime; + r.tms_cutime = t.tms_cutime; + r.tms_cstime = t.tms_cstime; + } + return (int)ret; +} + +int wrapper_clock(void) { + return (int)clock(); +} + +uint32_t wrapper_ctime(uint8_t *mem, uint32_t timep_addr) { + time_t t = MEM_S32(timep_addr); + char *res = ctime(&t); + size_t len = strlen(res) + 1; + uint32_t ret_addr = wrapper_malloc(mem, len); + uint32_t pos = ret_addr; + while (len--) { + MEM_S8(pos) = *res; + ++pos; + ++res; + } + return ret_addr; + //assert(0 && "ctime not implemented"); + //return 0; +} + +uint32_t wrapper_localtime(uint8_t *mem, uint32_t timep_addr) { + time_t t = MEM_S32(timep_addr); + struct irix_tm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; + }; + uint32_t ret = wrapper_malloc(mem, sizeof(struct irix_tm)); + struct irix_tm *r = (struct irix_tm *)&MEM_U32(ret); + struct tm *l = localtime(&t); + r->tm_sec = l->tm_sec; + r->tm_min = l->tm_min; + r->tm_hour = l->tm_hour; + r->tm_mday = l->tm_mday; + r->tm_mon = l->tm_mon; + r->tm_year = l->tm_year; + r->tm_wday = l->tm_wday; + r->tm_yday = l->tm_yday; + r->tm_isdst = l->tm_isdst; + return ret; +} + +int wrapper_setvbuf(uint8_t *mem, uint32_t fp_addr, uint32_t buf_addr, int mode, uint32_t size) { + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + wrapper_fflush(mem, fp_addr); + if ((f->_flag & IOMYBUF) && f->_base_addr != 0) { + wrapper_free(mem, f->_base_addr); + } + size &= ~0xf; + f->_flag &= ~IOMYBUF; + f->_base_addr = buf_addr; + f->_ptr_addr = buf_addr; + f->_cnt = 0; + bufendtab[(fp_addr - IOB_ADDR) / sizeof(struct FILE_irix)] = size; + return 0; +} + +int wrapper___semgetc(uint8_t *mem, uint32_t fp_addr) { + assert(0); +} + +int wrapper___semputc(uint8_t *mem, int c, uint32_t fp_addr) { + assert(0); +} + +int wrapper_fgetc(uint8_t *mem, uint32_t fp_addr) { + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + if (--f->_cnt < 0) { + return wrapper___filbuf(mem, fp_addr); + } else { + int ret = MEM_U8(f->_ptr_addr); + ++f->_ptr_addr; + return ret; + } +} + +int wrapper_fgets(uint8_t *mem, uint32_t str_addr, int count, uint32_t fp_addr) { + bool modified = false; + uint32_t saved = str_addr; + for (count--; count > 0; count--) { + int ch = wrapper_fgetc(mem, fp_addr); + if (ch == -1) { + MEM_S8(str_addr) = '\0'; + return modified ? saved : 0; + } + modified = true; + MEM_S8(str_addr) = (char)ch; + ++str_addr; + if (ch == '\n') { + break; + } + } + MEM_S8(str_addr) = '\0'; + return saved; +} + +static void file_assign_buffer(uint8_t *mem, struct FILE_irix *f) { + f->_base_addr = wrapper_malloc(mem, STDIO_BUFSIZE); + f->_ptr_addr = f->_base_addr; + f->_flag |= IOMYBUF; + f->_cnt = 0; + bufendtab[f - (struct FILE_irix *)&MEM_U32(IOB_ADDR)] = STDIO_BUFSIZE; +} + +int wrapper___filbuf(uint8_t *mem, uint32_t fp_addr) { + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + if (!(f->_flag & IOREAD)) { + if (f->_flag & IORW) { + f->_flag |= IOREAD; + } else { + MEM_U32(ERRNO_ADDR) = 9; // EBADF + return -1; + } + } + if (f->_base_addr == 0) { + file_assign_buffer(mem, f); + } + uint32_t size = bufendtab[(fp_addr - IOB_ADDR) / sizeof(struct FILE_irix)]; + int nread = wrapper_read(mem, f->_file, f->_base_addr, size); + int ret = -1; + if (nread > 0) { + f->_ptr_addr = f->_base_addr; + f->_cnt = nread; + ret = MEM_U8(f->_ptr_addr); + ++f->_ptr_addr; + --f->_cnt; + } else if (nread == 0) { + f->_flag |= IOEOF; + } else { + f->_flag |= IOERR; + } + return ret; +} + +int wrapper___flsbuf(uint8_t *mem, int ch, uint32_t fp_addr) { + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + if (wrapper_fflush(mem, fp_addr) != 0) { + return -1; + } + if (f->_base_addr == 0) { + file_assign_buffer(mem, f); + f->_cnt = bufendtab[f - (struct FILE_irix *)&MEM_U32(IOB_ADDR)]; + } + MEM_U8(f->_ptr_addr) = ch; + ++f->_ptr_addr; + --f->_cnt; + if (f->_flag & IONBF) { + if (wrapper_fflush(mem, fp_addr) != 0) { + return -1; + } + f->_cnt = 0; + } + return ch; +} + +int wrapper_ungetc(uint8_t *mem, int ch, uint32_t fp_addr) { + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + if (ch == -1 || f->_ptr_addr == f->_base_addr) { + return -1; + } + --f->_ptr_addr; + MEM_U8(f->_ptr_addr) = (uint8_t)ch; + ++f->_cnt; + f->_flag &= ~IOEOF; + return ch; +} + +uint32_t wrapper_gets(uint8_t *mem, uint32_t str_addr) { + uint32_t p, str0 = str_addr; + int n; + + for (;;) { + if (STDIN->_cnt <= 0) { + if (wrapper___filbuf(mem, STDIN_ADDR) == -1) { + if (str0 == str_addr) { + return 0; + } + break; + } + --STDIN->_ptr_addr; + ++STDIN->_cnt; + } + n = STDIN->_cnt; + if ((p = wrapper_memccpy(mem, str_addr, STDIN->_ptr_addr, '\n', n)) != 0) { + n = p - str_addr; + } + str_addr += n; + STDIN->_cnt -= n; + STDIN->_ptr_addr += n; + // bufsync + if (p != 0) { + // found '\n' in buffer + --str_addr; + break; + } + } + MEM_S8(str_addr) = '\0'; + return str0; +} + +uint32_t wrapper_fread(uint8_t *mem, uint32_t data_addr, uint32_t size, uint32_t count, uint32_t fp_addr) { + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + int nleft = count * size; + int n; + for (;;) { + if (f->_cnt <= 0) { + if (wrapper___filbuf(mem, fp_addr) == -1) { + return count - (nleft + size - 1) / size; + } + --f->_ptr_addr; + ++f->_cnt; + } + n = MIN(nleft, f->_cnt); + data_addr = wrapper_memcpy(mem, data_addr, f->_ptr_addr, n) + n; + f->_cnt -= n; + f->_ptr_addr += n; + if ((nleft -= n) <= 0) { + return count; + } + } +} + +uint32_t wrapper_fwrite(uint8_t *mem, uint32_t data_addr, uint32_t size, uint32_t count, uint32_t fp_addr) { + struct FILE_irix *f = (struct FILE_irix *)&MEM_U32(fp_addr); + if (size > 0 && count > 0 && f->_base_addr == 0) { + file_assign_buffer(mem, f); + f->_cnt = bufendtab[f - (struct FILE_irix *)&MEM_U32(IOB_ADDR)]; + f->_flag |= IOWRT; + } + uint32_t num_written = 0; + while (count--) { + uint32_t s = size; + while (s > 0) { + uint32_t to_write = f->_cnt; + if (s < to_write) { + to_write = s; + } + if (f->_cnt == 0) { + if (wrapper_fflush(mem, fp_addr) != 0) { + return num_written; + } + } + wrapper_memcpy(mem, f->_ptr_addr, data_addr, to_write); + data_addr += to_write; + f->_ptr_addr += to_write; + f->_cnt -= to_write; + s -= to_write; + } + num_written++; + } + if (f->_flag & IONBF) { + wrapper_fflush(mem, fp_addr); // TODO check error return value + } + return num_written; +} + +int wrapper_fputs(uint8_t *mem, uint32_t str_addr, uint32_t fp_addr) { + uint32_t len = wrapper_strlen(mem, str_addr); + uint32_t ret = wrapper_fwrite(mem, str_addr, 1, len, fp_addr); + return ret == 0 && len != 0 ? -1 : 0; +} + +int wrapper_puts(uint8_t *mem, uint32_t str_addr) { + int ret = wrapper_fputs(mem, str_addr, STDOUT_ADDR); + if (ret != 0) { + return ret; + } + struct FILE_irix *f = STDOUT; + if (--f->_cnt < 0) { + if (wrapper___flsbuf(mem, '\n', STDOUT_ADDR) != '\n') { + return -1; + } + } else { + MEM_S8(f->_ptr_addr) = '\n'; + ++f->_ptr_addr; + } + return 0; +} + +uint32_t wrapper_getcwd(uint8_t *mem, uint32_t buf_addr, uint32_t size) { + char buf[size]; + if (getcwd(buf, size) == NULL) { + MEM_U32(ERRNO_ADDR) = errno; + return 0; + } else { + if (buf_addr == 0) { + buf_addr = wrapper_malloc(mem, size); + } + strcpy1(mem, buf_addr, buf); + return buf_addr; + } +} + +int wrapper_time(uint8_t *mem, uint32_t tloc_addr) { + time_t ret = time(NULL); + if (ret == (time_t)-1) { + MEM_U32(ERRNO_ADDR) = errno; + } else if (tloc_addr != 0) { + MEM_S32(tloc_addr) = ret; + } + return ret; +} + +void wrapper_bzero(uint8_t *mem, uint32_t str_addr, uint32_t n) { + while (n--) { + MEM_U8(str_addr) = 0; + ++str_addr; + } +} + +int wrapper_fp_class_d(double d) { + union { + uint32_t w[2]; + double d; + } bits; + bits.d = d; + uint32_t a2 = bits.w[1]; + uint32_t a1 = a2 >> 20; + uint32_t a0 = a1; + a2 &= 0xfffff; + uint32_t a3 = bits.w[0]; + a1 &= 0x7ff; + a0 &= 0x800; + if (a1 == 0x7ff) { + if (a2 == 0 && a3 == 0) { + return a0 == 0 ? 2 : 3; + } + a0 = a2 & 0x80000; + return a0 == 0 ? 1 : 0; + } + if (a1 == 0) { + if (a2 == 0 && a3 == 0) { + return a0 == 0 ? 8 : 9; + } + return a0 == 0 ? 6 : 7; + } + return a0 == 0 ? 4 : 5; +} + +double wrapper_ldexp(double d, int i) { + return ldexp(d, i); +} + +int64_t wrapper___ll_mul(int64_t a0, int64_t a1) { + return a0 * a1; +} + +int64_t wrapper___ll_div(int64_t a0, int64_t a1) { + return a0 / a1; +} + +int64_t wrapper___ll_rem(uint64_t a0, int64_t a1) { + return a0 % a1; +} + +int64_t wrapper___ll_lshift(int64_t a0, uint64_t shift) { + return a0 << (shift & 0x3f); +} + +int64_t wrapper___ll_rshift(int64_t a0, uint64_t shift) { + return a0 >> (shift & 0x3f); +} + +uint64_t wrapper___ull_div(uint64_t a0, uint64_t a1) { + return a0 / a1; +} + +uint64_t wrapper___ull_rem(uint64_t a0, uint64_t a1) { + return a0 % a1; +} + +uint64_t wrapper___ull_rshift(uint64_t a0, uint64_t shift) { + return a0 >> (shift & 0x3f); +} + +uint64_t wrapper___d_to_ull(double d) { + return d; +} + +int64_t wrapper___d_to_ll(double d) { + return d; +} + +uint64_t wrapper___f_to_ull(float f) { + return f; +} + +int64_t wrapper___f_to_ll(float f) { + return f; +} + +float wrapper___ull_to_f(uint64_t v) { + return v; +} + +float wrapper___ll_to_f(int64_t v) { + return v; +} + +double wrapper___ull_to_d(uint64_t v) { + return v; +} + +double wrapper___ll_to_d(int64_t v) { + return v; +} + +void wrapper_abort(uint8_t *mem) { + abort(); +} + +void wrapper_exit(uint8_t *mem, int status) { + exit(status); +} + +void wrapper__exit(uint8_t *mem, int status) { + assert(0 && "_exit not implemented"); // exit() is already overridden +} + +void wrapper__cleanup(uint8_t *mem) { +} + +uint32_t wrapper__rld_new_interface(uint8_t *mem, uint32_t operation, uint32_t sp) { + assert(0 && "_rld_new_interface not implemented"); + return 0; +} + +void wrapper__exithandle(uint8_t *mem) { + assert(0 && "_exithandle not implemented"); +} + +int wrapper__prctl(uint8_t *mem, int operation, uint32_t sp) { + assert(0 && "_prctl not implemented"); + return 0; +} + +double wrapper__atod(uint8_t *mem, uint32_t buffer_addr, int ndigits, int dexp) { + // ftp://atoum.hst.nerim.net/irix/src/irix-6.5.5-src/6.5.5/m/irix/lib/libc/src/math/atod.c + assert(0 && "_atod not implemented"); + return 0.0; +} + +int wrapper_pathconf(uint8_t *mem, uint32_t path_addr, int name) { + STRING(path) + if (name == 5) { + errno = 0; + int ret = pathconf(path, _PC_PATH_MAX); + if (errno != 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; + } + assert(0 && "pathconf not implemented for the specific 'name'"); + return 0; +} + +uint32_t wrapper_getenv(uint8_t *mem, uint32_t name_addr) { + // Return null for everything, for now + return 0; +} + +uint32_t wrapper_gettxt(uint8_t *mem, uint32_t msgid_addr, uint32_t default_str_addr) { + // Return default for now + return default_str_addr; +} + +uint32_t wrapper_setlocale(uint8_t *mem, int category, uint32_t locale_addr) { + assert(locale_addr != 0); + STRING(locale) + assert(category == 6); // LC_ALL + char *ret = setlocale(LC_ALL, locale); + // Let's hope the caller doesn't use the return value + return 0; +} + +uint32_t wrapper_mmap(uint8_t *mem, uint32_t addr, uint32_t length, int prot, int flags, int fd, int offset) { + assert(0 && "mmap not implemented"); + return 0; +} + +int wrapper_munmap(uint8_t *mem, uint32_t addr, uint32_t length) { + assert(0 && "munmap not implemented"); + return 0; +} + +int wrapper_mprotect(uint8_t *mem, uint32_t addr, uint32_t length, int prot) { + assert(0 && "mprotect not implemented"); + return 0; +} + +int wrapper_sysconf(uint8_t *mem, int name) { + assert(0 && "sysconf not implemented"); + return 0; +} + +int wrapper_getpagesize(uint8_t *mem) { + return 4096; +} + +int wrapper_strerror(uint8_t *mem, int errnum) { + errno = errnum; + perror("strerror"); + assert(0 && "strerror not implemented"); + return 0; +} + +int wrapper_ioctl(uint8_t *mem, int fd, uint32_t request, uint32_t sp) { + assert(0 && "ioctl not implemented"); + return 0; +} + +int wrapper_fcntl(uint8_t *mem, int fd, int cmd, uint32_t sp) { + assert(0 && "fcntl not implemented"); + return 0; +} + +static void signal_handler(int signum) { + uint32_t level = signal_context.recursion_level++; + uint8_t *mem = signal_context.handlers[signum].mem; + uint32_t fp_dest = signal_context.handlers[signum].fp_dest; + uint32_t sp = SIGNAL_HANDLER_STACK_START - 16 - level * 0x1000; + signal_context.handlers[signum].trampoline(mem, sp, signum, 0, 0, 0, fp_dest); + signal_context.recursion_level--; +} + +uint32_t wrapper_signal(uint8_t *mem, int signum, uint64_t (*trampoline)(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3, uint32_t fp_dest), uint32_t handler_addr, uint32_t sp) { + //assert(0 && "signal not implemented"); + return 0; +} + +uint32_t wrapper_sigset(uint8_t *mem, int signum, uint64_t (*trampoline)(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3, uint32_t fp_dest), uint32_t disp_addr, uint32_t sp) { + void (*handler)(int) = signal_handler; + + if ((int)disp_addr >= -1 && (int)disp_addr <= 1) { + // SIG_DFL etc. + handler = (void (*)(int))(intptr_t)(int)disp_addr; + } + + switch (signum) { + case 2: + signum = SIGINT; + break; + case 13: + signum = SIGPIPE; + break; + case 15: + signum = SIGTERM; + break; + default: + assert(0 && "sigset with this signum not implemented"); + break; + } + + signal_context.handlers[signum].trampoline = trampoline; + signal_context.handlers[signum].mem = mem; + signal_context.handlers[signum].fp_dest = disp_addr; + + return (uint32_t)(uintptr_t)sigset(signum, handler); // for now only support SIG_DFL etc. as return value +} + +int wrapper_get_fpc_csr(uint8_t *mem) { + //assert(0 && "get_fpc_csr not implemented"); + return 0; +} + +int wrapper_set_fpc_csr(uint8_t *mem, int csr) { + //assert(0 && "set_fpc_csr not implemented"); + return 0; +} + +int wrapper_setjmp(uint8_t *mem, uint32_t addr) { + return 0; +} + +void wrapper_longjmp(uint8_t *mem, uint32_t addr, int status) { + assert(0 && "longjmp not implemented"); +} + +uint32_t wrapper_tempnam(uint8_t *mem, uint32_t dir_addr, uint32_t pfx_addr) { + STRING(dir) + STRING(pfx) + char *ret = tempnam(dir, pfx); + char *ret_saved = ret; + if (ret == NULL) { + MEM_U32(ERRNO_ADDR) = errno; + return 0; + } + size_t len = strlen(ret) + 1; + uint32_t ret_addr = wrapper_malloc(mem, len); + uint32_t pos = ret_addr; + while (len--) { + MEM_S8(pos) = *ret; + ++pos; + ++ret; + } + free(ret_saved); + return ret_addr; +} + +uint32_t wrapper_tmpnam(uint8_t *mem, uint32_t str_addr) { + char buf[1024]; + assert(str_addr != 0 && "s NULL not implemented for tmpnam"); + char *ret = tmpnam(buf); + if (ret == NULL) { + return 0; + } else { + strcpy1(mem, str_addr, ret); + return str_addr; + } +} + +uint32_t wrapper_mktemp(uint8_t *mem, uint32_t template_addr) { + STRING(template) + mktemp(template); + strcpy1(mem, template_addr, template); + return template_addr; +} + +int wrapper_mkstemp(uint8_t *mem, uint32_t name_addr) { + STRING(name) + int fd = mkstemp(name); + if (fd < 0) { + MEM_U32(ERRNO_ADDR) = errno; + } else { + strcpy1(mem, name_addr, name); + } + return fd; +} + +uint32_t wrapper_tmpfile(uint8_t *mem) { + // create and fopen a temporary file that is removed when the program exits + char name[] = "/tmp/copt_temp_XXXXXX"; + int fd = mkstemp(name); + if (fd < 0) { + MEM_U32(ERRNO_ADDR) = errno; + return 0; + } + + // the file will be removed from disk when it's closed later + unlink(name); + + // fdopen: + uint32_t ret = init_file(mem, fd, -1, NULL, "w+"); + if (ret == 0) { + close(fd); + } + return ret; +} + +int wrapper_wait(uint8_t *mem, uint32_t wstatus_addr) { + int wstatus; + pid_t ret = wait(&wstatus); + MEM_S32(wstatus_addr) = wstatus; + return ret; +} + +int wrapper_kill(uint8_t *mem, int pid, int sig) { + int ret = kill(pid, sig); + if (ret != 0) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +int wrapper_execlp(uint8_t *mem, uint32_t file_addr, uint32_t sp) { + uint32_t argv_addr = sp + 4; + return wrapper_execvp(mem, file_addr, argv_addr); +} + +int wrapper_execv(uint8_t *mem, uint32_t pathname_addr, uint32_t argv_addr) { + STRING(pathname) + uint32_t argc = 0; + while (MEM_U32(argv_addr + argc * 4) != 0) { + ++argc; + } + char *argv[argc + 1]; + for (uint32_t i = 0; i < argc; i++) { + uint32_t str_addr = MEM_U32(argv_addr + i * 4); + uint32_t len = wrapper_strlen(mem, str_addr) + 1; + argv[i] = (char *)malloc(len); + char *pos = argv[i]; + while (len--) { + *pos++ = MEM_S8(str_addr); + ++str_addr; + } + } + argv[argc] = NULL; + execv(pathname, argv); + MEM_U32(ERRNO_ADDR) = errno; + for (uint32_t i = 0; i < argc; i++) { + free(argv[i]); + } + return -1; +} + +int wrapper_execvp(uint8_t *mem, uint32_t file_addr, uint32_t argv_addr) { + STRING(file) + uint32_t argc = 0; + while (MEM_U32(argv_addr + argc * 4) != 0) { + ++argc; + } + char *argv[argc + 1]; + for (uint32_t i = 0; i < argc; i++) { + uint32_t str_addr = MEM_U32(argv_addr + i * 4); + uint32_t len = wrapper_strlen(mem, str_addr) + 1; + argv[i] = (char *)malloc(len); + char *pos = argv[i]; + while (len--) { + *pos++ = MEM_S8(str_addr); + ++str_addr; + } + } + argv[argc] = NULL; + +#ifdef REDIRECT_USR_LIB + if (!strncmp(file, "/usr/lib/", 9) && bin_dir[0] != '\0') { + char fixed_path[PATH_MAX + 1]; +#ifdef __CYGWIN__ + int n = snprintf(fixed_path, sizeof(fixed_path), "%s/%s.exe", bin_dir, file + 9); +#else + int n = snprintf(fixed_path, sizeof(fixed_path), "%s/%s", bin_dir, file + 9); +#endif + if (n > 0 && n < sizeof(fixed_path)) { + execvp(fixed_path, argv); + } else { + execvp(file, argv); + } + } else { + execvp(file, argv); + } +#else + execvp(file, argv); +#endif + + MEM_U32(ERRNO_ADDR) = errno; + for (uint32_t i = 0; i < argc; i++) { + free(argv[i]); + } + return -1; +} + +int wrapper_fork(uint8_t *mem) { + int ret = fork(); + if (ret == -1) { + MEM_U32(ERRNO_ADDR) = errno; + } + return ret; +} + +int wrapper_system(uint8_t *mem, uint32_t command_addr) { + STRING(command) + return system(command); // no errno +} + +static int name_compare(uint8_t *mem, uint32_t a_addr, uint32_t b_addr) { + //printf("pc=0x00438180\n"); + return wrapper_strcmp(mem, MEM_U32(a_addr), MEM_U32(b_addr)); +} + +static uint32_t tsearch_tfind(uint8_t *mem, uint32_t key_addr, uint32_t rootp_addr, uint32_t compar_addr, bool insert) { + //assert(compar_addr == 0x438180); // name_compare in as1 + + if (rootp_addr == 0) { + return 0; + } + while (MEM_U32(rootp_addr) != 0) { + uint32_t node_addr = MEM_U32(rootp_addr); + int r = name_compare(mem, key_addr, MEM_U32(node_addr)); + if (r == 0) { + return node_addr; + } + rootp_addr = r < 0 ? node_addr + 4 : node_addr + 8; + } + if (insert) { + uint32_t node_addr = wrapper_malloc(mem, 12); + if (node_addr != 0) { + MEM_U32(rootp_addr) = node_addr; + MEM_U32(node_addr) = key_addr; + MEM_U32(node_addr + 4) = 0; + MEM_U32(node_addr + 8) = 0; + return node_addr; + } + } + return 0; +} + +uint32_t wrapper_tsearch(uint8_t *mem, uint32_t key_addr, uint32_t rootp_addr, uint32_t compar_addr) { + return tsearch_tfind(mem, key_addr, rootp_addr, compar_addr, true); +} + +uint32_t wrapper_tfind(uint8_t *mem, uint32_t key_addr, uint32_t rootp_addr, uint32_t compar_addr) { + return tsearch_tfind(mem, key_addr, rootp_addr, compar_addr, false); +} + +uint32_t wrapper_qsort(uint8_t *mem, uint32_t base_addr, uint32_t num, uint32_t size, uint64_t (*trampoline)(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3, uint32_t fp_dest), uint32_t compare_addr, uint32_t sp) { + assert(0 && "qsort not implemented"); + return 0; +} + +uint32_t wrapper_regcmp(uint8_t *mem, uint32_t string1_addr, uint32_t sp) { + STRING(string1); + fprintf(stderr, "regex string: %s\n", string1); + assert(0 && "regcmp not implemented"); + return 0; +} + +uint32_t wrapper_regex(uint8_t *mem, uint32_t re_addr, uint32_t subject_addr, uint32_t sp) { + STRING(subject); + assert(0 && "regex not implemented"); + return 0; +} + +void wrapper___assert(uint8_t *mem, uint32_t assertion_addr, uint32_t file_addr, int line) { + STRING(assertion) + STRING(file) + __assert(assertion, file, line); +} diff --git a/ido/ido5.3_recomp/libc_impl.h b/ido/ido5.3_recomp/libc_impl.h new file mode 100644 index 00000000..0f1d920f --- /dev/null +++ b/ido/ido5.3_recomp/libc_impl.h @@ -0,0 +1,163 @@ +#include + +void mmap_initial_data_range(uint8_t *mem, uint32_t start, uint32_t end); +void setup_libc_data(uint8_t *mem); + +uint32_t wrapper_sbrk(uint8_t *mem, int increment); +uint32_t wrapper_malloc(uint8_t *mem, uint32_t size); +uint32_t wrapper_calloc(uint8_t *mem, uint32_t num, uint32_t size); +uint32_t wrapper_realloc(uint8_t *mem, uint32_t data_addr, uint32_t size); +int wrapper_fscanf(uint8_t *mem, uint32_t fp_addr, uint32_t format_addr, uint32_t sp); +int wrapper_printf(uint8_t *mem, uint32_t format_addr, uint32_t sp); +int wrapper_sprintf(uint8_t *mem, uint32_t str_addr, uint32_t format_addr, uint32_t sp); +int wrapper_fprintf(uint8_t *mem, uint32_t fp_addr, uint32_t format_addr, uint32_t sp); +int wrapper__doprnt(uint8_t *mem, uint32_t format_addr, uint32_t params_addr, uint32_t fp_addr); +void wrapper_free(uint8_t *mem, uint32_t data_addr); +uint32_t wrapper_strlen(uint8_t *mem, uint32_t str_addr); +int wrapper_open(uint8_t *mem, uint32_t pathname_addr, int flags, int mode); +int wrapper_creat(uint8_t *mem, uint32_t pathname_addr, int mode); +int wrapper_access(uint8_t *mem, uint32_t pathname_addr, int mode); +int wrapper_rename(uint8_t *mem, uint32_t oldpath_addr, uint32_t newpath_addr); +int wrapper_utime(uint8_t *mem, uint32_t filename_addr, uint32_t times_addr); +int wrapper_flock(uint8_t *mem, int fd, int operation); +int wrapper_chmod(uint8_t *mem, uint32_t path_addr, uint32_t mode); +int wrapper_umask(int mode); +uint32_t wrapper_ecvt(uint8_t *mem, double number, int ndigits, uint32_t decpt_addr, uint32_t sign_addr); +uint32_t wrapper_fcvt(uint8_t *mem, double number, int ndigits, uint32_t decpt_addr, uint32_t sign_addr); +double wrapper_sqrt(double v); +float wrapper_sqrtf(float v); +int wrapper_atoi(uint8_t *mem, uint32_t nptr_addr); +int wrapper_atol(uint8_t *mem, uint32_t nptr_addr); +double wrapper_atof(uint8_t *mem, uint32_t nptr_addr); +int wrapper_strtol(uint8_t *mem, uint32_t nptr_addr, uint32_t endptr_addr, int base); +uint32_t wrapper_strtoul(uint8_t *mem, uint32_t nptr_addr, uint32_t endptr_addr, int base); +double wrapper_strtod(uint8_t *mem, uint32_t nptr_addr, uint32_t endptr_addr); +uint32_t wrapper_strchr(uint8_t *mem, uint32_t str_addr, int c); +uint32_t wrapper_strrchr(uint8_t *mem, uint32_t str_addr, int c); +uint32_t wrapper_strcspn(uint8_t *mem, uint32_t str_addr, uint32_t invalid_addr); +uint32_t wrapper_strpbrk(uint8_t *mem, uint32_t str_addr, uint32_t accept_addr); +int wrapper_fstat(uint8_t *mem, int fildes, uint32_t buf_addr); +int wrapper_stat(uint8_t *mem, uint32_t pathname_addr, uint32_t buf_addr); +int wrapper_ftruncate(uint8_t *mem, int fd, int length); +void wrapper_bcopy(uint8_t *mem, uint32_t src_addr, uint32_t dst_addr, uint32_t len); +uint32_t wrapper_memcpy(uint8_t *mem, uint32_t dst_addr, uint32_t src_addr, uint32_t len); +uint32_t wrapper_memccpy(uint8_t *mem, uint32_t dst_addr, uint32_t src_addr, int c, uint32_t len); +int wrapper_read(uint8_t *mem, int fd, uint32_t buf_addr, uint32_t nbytes); +int wrapper_write(uint8_t *mem, int fd, uint32_t buf_addr, uint32_t nbytes); +uint32_t wrapper_fopen(uint8_t *mem, uint32_t path_addr, uint32_t mode_addr); +uint32_t wrapper_freopen(uint8_t *mem, uint32_t path_addr, uint32_t mode_addr, uint32_t fp_addr); +int wrapper_fclose(uint8_t *mem, uint32_t fp_addr); +int wrapper_fflush(uint8_t *mem, uint32_t fp_addr); +int wrapper_ftell(uint8_t *mem, uint32_t fp_addr); +void wrapper_rewind(uint8_t *mem, uint32_t fp_addr); +int wrapper_fseek(uint8_t *mem, uint32_t fp_addr, int offset, int origin); +int wrapper_lseek(uint8_t *mem, int fd, int offset, int whence); +int wrapper_dup(uint8_t *mem, int fd); +int wrapper_dup2(uint8_t *mem, int oldfd, int newfd); +int wrapper_pipe(uint8_t *mem, uint32_t pipefd_addr); +void wrapper_perror(uint8_t *mem, uint32_t str_addr); +int wrapper_fdopen(uint8_t *mem, int fd, uint32_t mode_addr); +uint32_t wrapper_memset(uint8_t *mem, uint32_t dest_addr, int byte, uint32_t n); +int wrapper_bcmp(uint8_t *mem, uint32_t s1_addr, uint32_t s2_addr, uint32_t n); +int wrapper_memcmp(uint8_t *mem, uint32_t s1_addr, uint32_t s2_addr, uint32_t n); +int wrapper_getpid(void); +int wrapper_getpgrp(uint8_t *mem); +int wrapper_remove(uint8_t *mem, uint32_t path_addr); +int wrapper_unlink(uint8_t *mem, uint32_t path_addr); +int wrapper_close(uint8_t *mem, int fd); +int wrapper_strcmp(uint8_t *mem, uint32_t s1_addr, uint32_t s2_addr); +int wrapper_strncmp(uint8_t *mem, uint32_t s1_addr, uint32_t s2_addr, uint32_t n); +uint32_t wrapper_strcpy(uint8_t *mem, uint32_t dest_addr, uint32_t src_addr); +uint32_t wrapper_strncpy(uint8_t *mem, uint32_t dest_addr, uint32_t src_addr, uint32_t n); +uint32_t wrapper_strcat(uint8_t *mem, uint32_t dest_addr, uint32_t src_addr); +uint32_t wrapper_strncat(uint8_t *mem, uint32_t dest_addr, uint32_t src_addr, uint32_t n); +uint32_t wrapper_strtok(uint8_t *mem, uint32_t str_addr, uint32_t delimiters_addr); +uint32_t wrapper_strstr(uint8_t *mem, uint32_t str1_addr, uint32_t str2_addr); +uint32_t wrapper_strdup(uint8_t *mem, uint32_t str_addr); +int wrapper_toupper(int c); +int wrapper_tolower(int c); +int wrapper_gethostname(uint8_t *mem, uint32_t name_addr, uint32_t len); +int wrapper_isatty(uint8_t *mem, int fd); +int wrapper_times(uint8_t *mem, uint32_t buffer_addr); +uint32_t wrapper_strftime(uint8_t *mem, uint32_t ptr_addr, uint32_t maxsize, uint32_t format_addr, uint32_t timeptr_addr); +int wrapper_clock(void); +uint32_t wrapper_ctime(uint8_t *mem, uint32_t timep_addr); +uint32_t wrapper_localtime(uint8_t *mem, uint32_t timep_addr); +int wrapper_setvbuf(uint8_t *mem, uint32_t fp_addr, uint32_t buf_addr, int mode, uint32_t size); +int wrapper___semgetc(uint8_t *mem, uint32_t fp_addr); +int wrapper___semputc(uint8_t *mem, int c, uint32_t fp_addr); +int wrapper_fgetc(uint8_t *mem, uint32_t fp_addr); +int wrapper_fgets(uint8_t *mem, uint32_t str_addr, int count, uint32_t fp_addr); +int wrapper___filbuf(uint8_t *mem, uint32_t fp_addr); +int wrapper___flsbuf(uint8_t *mem, int ch, uint32_t fp_addr); +int wrapper_ungetc(uint8_t *mem, int ch, uint32_t fp_addr); +uint32_t wrapper_gets(uint8_t *mem, uint32_t str_addr); +uint32_t wrapper_fread(uint8_t *mem, uint32_t data_addr, uint32_t size, uint32_t count, uint32_t fp_addr); +uint32_t wrapper_fwrite(uint8_t *mem, uint32_t data_addr, uint32_t size, uint32_t count, uint32_t fp_addr); +int wrapper_fputs(uint8_t *mem, uint32_t str_addr, uint32_t fp_addr); +int wrapper_puts(uint8_t *mem, uint32_t str_addr); +uint32_t wrapper_getcwd(uint8_t *mem, uint32_t buf_addr, uint32_t size); +int wrapper_time(uint8_t *mem, uint32_t tloc_addr); +void wrapper_bzero(uint8_t *mem, uint32_t str_addr, uint32_t n); +int wrapper_fp_class_d(double d); +double wrapper_ldexp(double d, int i); +int64_t wrapper___ll_mul(int64_t a0, int64_t a1); +int64_t wrapper___ll_div(int64_t a0, int64_t a1); +int64_t wrapper___ll_rem(uint64_t a0, int64_t a1); +int64_t wrapper___ll_lshift(int64_t a0, uint64_t shift); +int64_t wrapper___ll_rshift(int64_t a0, uint64_t shift); +uint64_t wrapper___ull_div(uint64_t a0, uint64_t a1); +uint64_t wrapper___ull_rem(uint64_t a0, uint64_t a1); +uint64_t wrapper___ull_rshift(uint64_t a0, uint64_t shift); +uint64_t wrapper___d_to_ull(double d); +int64_t wrapper___d_to_ll(double d); +uint64_t wrapper___f_to_ull(float f); +int64_t wrapper___f_to_ll(float f); +float wrapper___ull_to_f(uint64_t v); +float wrapper___ll_to_f(int64_t v); +double wrapper___ull_to_d(uint64_t v); +double wrapper___ll_to_d(int64_t v); +void wrapper_abort(uint8_t *mem); +void wrapper_exit(uint8_t *mem, int status); +void wrapper__exit(uint8_t *mem, int status); +void wrapper__cleanup(uint8_t *mem); +uint32_t wrapper__rld_new_interface(uint8_t *mem, uint32_t operation, uint32_t sp); +void wrapper__exithandle(uint8_t *mem); +int wrapper__prctl(uint8_t *mem, int operation, uint32_t sp); +double wrapper__atod(uint8_t *mem, uint32_t buffer_addr, int ndigits, int dexp); +int wrapper_pathconf(uint8_t *mem, uint32_t path_addr, int name); +uint32_t wrapper_getenv(uint8_t *mem, uint32_t name_addr); +uint32_t wrapper_gettxt(uint8_t *mem, uint32_t msgid_addr, uint32_t default_str_addr); +uint32_t wrapper_setlocale(uint8_t *mem, int category, uint32_t locale_addr); +uint32_t wrapper_mmap(uint8_t *mem, uint32_t addr, uint32_t length, int prot, int flags, int fd, int offset); +int wrapper_munmap(uint8_t *mem, uint32_t addr, uint32_t length); +int wrapper_mprotect(uint8_t *mem, uint32_t addr, uint32_t length, int prot); +int wrapper_sysconf(uint8_t *mem, int name); +int wrapper_getpagesize(uint8_t *mem); +int wrapper_strerror(uint8_t *mem, int errnum); +int wrapper_ioctl(uint8_t *mem, int fd, uint32_t request, uint32_t sp); +int wrapper_fcntl(uint8_t *mem, int fd, int cmd, uint32_t sp); +uint32_t wrapper_signal(uint8_t *mem, int signum, uint64_t (*trampoline)(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3, uint32_t fp_dest), uint32_t handler_addr, uint32_t sp); +uint32_t wrapper_sigset(uint8_t *mem, int signum, uint64_t (*trampoline)(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3, uint32_t fp_dest), uint32_t disp_addr, uint32_t sp); +int wrapper_get_fpc_csr(uint8_t *mem); +int wrapper_set_fpc_csr(uint8_t *mem, int csr); +int wrapper_setjmp(uint8_t *mem, uint32_t addr); +void wrapper_longjmp(uint8_t *mem, uint32_t addr, int status); +uint32_t wrapper_tempnam(uint8_t *mem, uint32_t dir_addr, uint32_t pfx_addr); +uint32_t wrapper_tmpnam(uint8_t *mem, uint32_t str_addr); +uint32_t wrapper_mktemp(uint8_t *mem, uint32_t template_addr); +int wrapper_mkstemp(uint8_t *mem, uint32_t name_addr); +uint32_t wrapper_tmpfile(uint8_t *mem); +int wrapper_wait(uint8_t *mem, uint32_t wstatus_addr); +int wrapper_kill(uint8_t *mem, int pid, int sig); +int wrapper_execlp(uint8_t *mem, uint32_t file_addr, uint32_t sp); +int wrapper_execv(uint8_t *mem, uint32_t pathname_addr, uint32_t argv_addr); +int wrapper_execvp(uint8_t *mem, uint32_t file_addr, uint32_t argv_addr); +int wrapper_fork(uint8_t *mem); +int wrapper_system(uint8_t *mem, uint32_t command_addr); +uint32_t wrapper_tsearch(uint8_t *mem, uint32_t key_addr, uint32_t rootp_addr, uint32_t compar_addr); +uint32_t wrapper_tfind(uint8_t *mem, uint32_t key_addr, uint32_t rootp_addr, uint32_t compar_addr); +uint32_t wrapper_qsort(uint8_t *mem, uint32_t base_addr, uint32_t num, uint32_t size, uint64_t (*trampoline)(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3, uint32_t fp_dest), uint32_t compare_addr, uint32_t sp); +uint32_t wrapper_regcmp(uint8_t *mem, uint32_t string1_addr, uint32_t sp); +uint32_t wrapper_regex(uint8_t *mem, uint32_t re_addr, uint32_t subject_addr, uint32_t sp); +void wrapper___assert(uint8_t *mem, uint32_t assertion_addr, uint32_t file_addr, int line); diff --git a/ido/ido5.3_recomp/recomp b/ido/ido5.3_recomp/recomp new file mode 100755 index 00000000..b73f06d8 Binary files /dev/null and b/ido/ido5.3_recomp/recomp differ diff --git a/ido/ido5.3_recomp/recomp.cpp b/ido/ido5.3_recomp/recomp.cpp new file mode 100644 index 00000000..59543056 --- /dev/null +++ b/ido/ido5.3_recomp/recomp.cpp @@ -0,0 +1,2933 @@ +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "elf.h" + +#define INSPECT_FUNCTION_POINTERS 0 // set this to 1 when testing a new program, to verify that no false function pointers are found + +#ifndef TRACE +#define TRACE 0 +#endif + +#define LABELS_64_BIT 1 + +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) + +#define u32be(x) (uint32_t)(((x & 0xff) << 24) + ((x & 0xff00) << 8) + ((x & 0xff0000) >> 8) + ((uint32_t)(x) >> 24)) +#define u16be(x) (uint16_t)(((x & 0xff) << 8) + ((x & 0xff00) >> 8)) +#define read_u32_be(buf) (uint32_t)(((buf)[0] << 24) + ((buf)[1] << 16) + ((buf)[2] << 8) + ((buf)[3])) + +using namespace std; + +struct Edge { + uint32_t i; + uint8_t function_entry: 1; + uint8_t function_exit: 1; + uint8_t extern_function: 1; + uint8_t function_pointer: 1; +}; + +struct Insn { + uint32_t id; + uint8_t op_count; + string mnemonic; + string op_str; + cs_mips_op operands[8]; + + uint8_t is_jump: 1; + uint8_t is_global_got_memop: 1; + uint8_t no_following_successor: 1; + int linked_insn; + union { + uint32_t linked_value; + float linked_float; + }; + uint32_t jtbl_addr; + uint32_t num_cases; + mips_reg index_reg; + vector successors; + vector predecessors; + uint64_t b_liveout; + uint64_t b_livein; + uint64_t f_livein; + uint64_t f_liveout; +}; + +struct Function { + vector returns; //points to delay slots + uint32_t end_addr; //address after end + uint32_t nargs; + uint32_t nret; + bool v0_in; + bool referenced_by_function_pointer; +}; + +static bool conservative; + +static csh handle; + +static const uint8_t *text_section; +static uint32_t text_section_len; +static uint32_t text_vaddr; + +static const uint8_t *rodata_section; +static uint32_t rodata_section_len; +static uint32_t rodata_vaddr; + +static const uint8_t *data_section; +static uint32_t data_section_len; +static uint32_t data_vaddr; + +static uint32_t bss_section_len; +static uint32_t bss_vaddr; + +static vector insns; +static set label_addresses; +static vector got_globals; +static vector got_locals; +static uint32_t gp_value; +static uint32_t gp_value_adj; + +static map symbol_names; + +static vector> data_function_pointers; +static set li_function_pointers; +static map functions; +static uint32_t main_addr; +static uint32_t mcount_addr; +static uint32_t procedure_table_start; +static uint32_t procedure_table_len; + +#define FLAG_NO_MEM 1 +#define FLAG_VARARG 2 + +static const struct { + const char *name; + const char *params; + int flags; +} extern_functions[] = { + {"exit", "vi"}, // override exit from application + {"abort", "v"}, + {"sbrk", "pi"}, + {"malloc", "pu"}, + {"calloc", "puu"}, + {"realloc", "ppu"}, + {"free", "vp"}, + {"fscanf", "ipp", FLAG_VARARG}, + {"printf", "ip", FLAG_VARARG}, + {"sprintf", "ipp", FLAG_VARARG}, + {"fprintf", "ipp", FLAG_VARARG}, + {"_doprnt", "ippp"}, + {"strlen", "up"}, + {"open", "ipii"}, + {"creat", "ipi"}, + {"access", "ipi"}, + {"rename", "ipp"}, + {"utime", "ipp"}, + {"flock", "iii"}, + {"chmod", "ipu"}, + {"umask", "ii", FLAG_NO_MEM}, + {"ecvt", "pdipp"}, + {"fcvt", "pdipp"}, + {"sqrt", "dd", FLAG_NO_MEM}, + {"sqrtf", "ff", FLAG_NO_MEM}, + {"atoi", "ip"}, + {"atol", "ip"}, + {"atof", "dp"}, + {"strtol", "ippi"}, + {"strtoul", "uppi"}, + {"strtod", "dpp"}, + {"strchr", "ppi"}, + {"strrchr", "ppi"}, + {"strcspn", "upp"}, + {"strpbrk", "ppp"}, + {"fstat", "iip"}, + {"stat", "ipp"}, + {"ftruncate", "iii"}, + {"bcopy", "vppu"}, + {"memcpy", "pppu"}, + {"memccpy", "pppiu"}, + {"read", "iipu"}, + {"write", "iipu"}, + {"fopen", "ppp"}, + {"freopen", "pppp"}, + {"fclose", "ip"}, + {"ftell", "ip"}, + {"rewind", "vp"}, + {"fseek", "ipii"}, + {"lseek", "iiii"}, + {"fflush", "ip"}, + {"dup", "ii"}, + {"dup2", "iii"}, + {"pipe", "ip"}, + {"perror", "vp"}, + {"fdopen", "iip"}, + {"memset", "ppiu"}, + {"bcmp", "ippu"}, + {"memcmp", "ippu"}, + {"getpid", "i", FLAG_NO_MEM}, + {"getpgrp", "i"}, + {"remove", "ip"}, + {"unlink", "ip"}, + {"close", "ii"}, + {"strcmp", "ipp"}, + {"strncmp", "ippu"}, + {"strcpy", "ppp"}, + {"strncpy", "pppu"}, + {"strcat", "ppp"}, + {"strncat", "pppu"}, + {"strtok", "ppp"}, + {"strstr", "ppp"}, + {"strdup", "pp"}, + {"toupper", "ii", FLAG_NO_MEM}, + {"tolower", "ii", FLAG_NO_MEM}, + {"gethostname", "ipu"}, + {"isatty", "ii"}, + {"strftime", "upupp"}, + {"times", "ip"}, + {"clock", "i", FLAG_NO_MEM}, + {"ctime", "pp"}, + {"localtime", "pp"}, + {"setvbuf", "ippiu"}, + {"__semgetc", "ip"}, + {"__semputc", "iip"}, + {"fgetc", "ip"}, + {"fgets", "ipip"}, + {"__filbuf", "ip"}, + {"__flsbuf", "iip"}, + {"ungetc", "iip"}, + {"gets", "pp"}, + {"fread", "upuup"}, + {"fwrite", "upuup"}, + {"fputs", "ipp"}, + {"puts", "ip"}, + {"getcwd", "ppu"}, + {"time", "ip"}, + {"bzero", "vpu"}, + {"fp_class_d", "id", FLAG_NO_MEM}, + {"ldexp", "ddi", FLAG_NO_MEM}, + {"__ll_mul", "lll", FLAG_NO_MEM}, + {"__ll_div", "lll", FLAG_NO_MEM}, + {"__ll_rem", "ljl", FLAG_NO_MEM}, + {"__ll_lshift", "llj", FLAG_NO_MEM}, + {"__ll_rshift", "llj", FLAG_NO_MEM}, + {"__ull_div", "jjj", FLAG_NO_MEM}, + {"__ull_rem", "jjj", FLAG_NO_MEM}, + {"__ull_rshift", "jjj", FLAG_NO_MEM}, + {"__d_to_ull", "jd", FLAG_NO_MEM}, + {"__d_to_ll", "ld", FLAG_NO_MEM}, + {"__f_to_ull", "jf", FLAG_NO_MEM}, + {"__f_to_ll", "lf", FLAG_NO_MEM}, + {"__ull_to_f", "fj", FLAG_NO_MEM}, + {"__ll_to_f", "fl", FLAG_NO_MEM}, + {"__ull_to_d", "dj", FLAG_NO_MEM}, + {"__ll_to_d", "dl", FLAG_NO_MEM}, + {"_exit", "vi"}, + {"_cleanup", "v"}, + {"_rld_new_interface", "pu", FLAG_VARARG}, + {"_exithandle", "v"}, + {"_prctl", "ii", FLAG_VARARG}, + {"_atod", "dpii"}, + {"pathconf", "ipi"}, + {"getenv", "pp"}, + {"gettxt", "ppp"}, + {"setlocale", "pip"}, + {"mmap", "ppuiiii"}, + {"munmap", "ipu"}, + {"mprotect", "ipui"}, + {"sysconf", "ii"}, + {"getpagesize", "i"}, + {"strerror", "pi"}, + {"ioctl", "iiu", FLAG_VARARG}, + {"fcntl", "iii", FLAG_VARARG}, + {"signal", "pit"}, + {"sigset", "pit"}, + {"get_fpc_csr", "i"}, + {"set_fpc_csr", "ii"}, + {"setjmp", "ip"}, + {"longjmp", "vpi"}, + {"tempnam", "ppp"}, + {"tmpnam", "pp"}, + {"mktemp", "pp"}, + {"mkstemp", "ip"}, + {"tmpfile", "p"}, + {"wait", "ip"}, + {"kill", "iii"}, + {"execlp", "ip", FLAG_VARARG}, + {"execv", "ipp"}, + {"execvp", "ipp"}, + {"fork", "i"}, + {"system", "ip"}, + {"tsearch", "pppp"}, + {"tfind", "pppp"}, + {"qsort", "vpuut"}, + {"regcmp", "pp", FLAG_VARARG}, + {"regex", "ppp", FLAG_VARARG}, + {"__assert", "vppi"}, +}; + +static void disassemble(void) { + csh handle; + cs_insn *disasm; + static size_t disasm_size; + assert(cs_open(CS_ARCH_MIPS, (cs_mode)(CS_MODE_MIPS64 | CS_MODE_BIG_ENDIAN), &handle) == CS_ERR_OK); + cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON); + disasm_size = cs_disasm(handle, text_section, text_section_len, text_vaddr, 0, &disasm); + for (size_t i = 0; i < disasm_size; i++) { + insns.push_back(Insn()); + Insn& insn = insns.back(); + insn.id = disasm[i].id; + insn.mnemonic = disasm[i].mnemonic; + insn.op_str = disasm[i].op_str; + if (disasm[i].detail != nullptr && disasm[i].detail->mips.op_count > 0) { + insn.op_count = disasm[i].detail->mips.op_count; + memcpy(insn.operands, disasm[i].detail->mips.operands, sizeof(insn.operands)); + } + insn.is_jump = cs_insn_group(handle, &disasm[i], MIPS_GRP_JUMP) || insn.id == MIPS_INS_JAL || insn.id == MIPS_INS_BAL || insn.id == MIPS_INS_JALR; + insn.linked_insn = -1; + } + cs_free(disasm, disasm_size); + cs_close(&handle); + + { + // Add dummy instruction to avoid out of bounds + insns.push_back(Insn()); + Insn& insn = insns.back(); + insn.id = MIPS_INS_NOP; + insn.mnemonic = "nop"; + insn.no_following_successor = true; + } +} + +static void add_function(uint32_t addr) { + if (addr >= text_vaddr && addr < text_vaddr + text_section_len) { + functions[addr]; + } +} + +static map::iterator find_function(uint32_t addr) { + if (functions.size() == 0) { + return functions.end(); + } + auto it = functions.upper_bound(addr); + if (it == functions.begin()) { + return functions.end(); + } + --it; + return it; +} + +// try to find a matching LUI for a given register +static void link_with_lui(int offset, uint32_t reg, int mem_imm) +{ +#define MAX_LOOKBACK 128 + // don't attempt to compute addresses for zero offset + // end search after some sane max number of instructions + int end_search = MAX(0, offset - MAX_LOOKBACK); + for (int search = offset - 1; search >= end_search; search--) { + // use an `if` instead of `case` block to allow breaking out of the `for` loop + if (insns[search].id == MIPS_INS_LUI) { + uint32_t rd = insns[search].operands[0].reg; + if (reg == rd) { + break; + } + } else if (insns[search].id == MIPS_INS_LW || + insns[search].id == MIPS_INS_LD || + insns[search].id == MIPS_INS_ADDIU || + //insns[search].id == MIPS_INS_ADDU || used in jump tables for offset + insns[search].id == MIPS_INS_ADD || + insns[search].id == MIPS_INS_SUB || + insns[search].id == MIPS_INS_SUBU) { + uint32_t rd = insns[search].operands[0].reg; + if (reg == rd) { + if (insns[search].id == MIPS_INS_LW && insns[search].operands[1].mem.base == MIPS_REG_GP) { + int mem_imm0 = (int)insns[search].operands[1].mem.disp; + uint32_t got_entry = (mem_imm0 + gp_value_adj) / sizeof(uint32_t); + if (got_entry < got_locals.size()) { + // used for static functions + char buf[32]; + uint32_t addr = got_locals[got_entry] + mem_imm; + insns[search].linked_insn = offset; + insns[search].linked_value = addr; + insns[offset].linked_insn = search; + insns[offset].linked_value = addr; + + //vaddr_references[addr].insert(text_vaddr + offset * 4); + + insns[search].id = MIPS_INS_LI; + insns[search].mnemonic = "li"; + sprintf(buf, "$%s, 0x%x", cs_reg_name(handle, rd), addr); + insns[search].op_str = buf; + insns[search].operands[1].type = MIPS_OP_IMM; + insns[search].operands[1].imm = addr; + + switch (insns[offset].id) { + case MIPS_INS_ADDIU: + insns[offset].id = MIPS_INS_MOVE; + insns[offset].operands[1].type = MIPS_OP_REG; + insns[offset].mnemonic = "move"; + sprintf(buf, "$%s, $%s", cs_reg_name(handle, insns[offset].operands[0].reg), cs_reg_name(handle, rd)); + insns[offset].op_str = buf; + if (addr >= text_vaddr && addr < text_vaddr + text_section_len) { + add_function(addr); + } + break; + case MIPS_INS_LB: + case MIPS_INS_LBU: + case MIPS_INS_SB: + case MIPS_INS_LH: + case MIPS_INS_LHU: + case MIPS_INS_SH: + case MIPS_INS_LW: + case MIPS_INS_SW: + case MIPS_INS_LDC1: + case MIPS_INS_LWC1: + case MIPS_INS_SWC1: + insns[offset].operands[1].mem.disp = 0; + sprintf(buf, "$%s, ($%s)", cs_reg_name(handle, insns[offset].operands[0].reg), cs_reg_name(handle, rd)); + insns[offset].op_str = buf; + break; + default: + assert(0); + } + } + break; + } else { + // ignore: reg is pointer, offset is probably struct data member + break; + } + } + } else if (insns[search].id == MIPS_INS_JR && + insns[search].operands[0].reg == MIPS_REG_RA && offset - search >= 2) { + // stop looking when previous `jr ra` is hit, + // but ignore if `offset` is branch delay slot for this `jr ra` + break; + } + } +} + +// for a given `jalr t9`, find the matching t9 load +static void link_with_jalr(int offset) +{ + // end search after some sane max number of instructions + int end_search = MAX(0, offset - MAX_LOOKBACK); + for (int search = offset - 1; search >= end_search; search--) { + if (insns[search].operands[0].reg == MIPS_REG_T9) { + if (insns[search].id == MIPS_INS_LW || insns[search].id == MIPS_INS_LI) { + if (insns[search].is_global_got_memop || insns[search].id == MIPS_INS_LI) { + char buf[32]; + sprintf(buf, "0x%x", insns[search].linked_value); + insns[search].linked_insn = offset; + insns[offset].linked_insn = search; + insns[offset].linked_value = insns[search].linked_value; + //insns[offset].label = insns[search].label; + //function_entry_points.insert(insns[search].linked_value); + insns[offset].id = MIPS_INS_JAL; + insns[offset].mnemonic = "jal"; + insns[offset].op_str = buf; + insns[offset].operands[0].type = MIPS_OP_IMM; + insns[offset].operands[0].imm = insns[search].linked_value; + insns[search].id = MIPS_INS_NOP; + insns[search].mnemonic = "nop"; + insns[search].op_str = ""; + insns[search].is_global_got_memop = false; + add_function(insns[search].linked_value); + } + break; + } else if (insns[search].id == MIPS_INS_ADDIU) { + if (insns[search].linked_insn != -1) { + //function_entry_points.insert(insns[search].linked_value); + uint32_t first = insns[search].linked_insn; + insns[search].linked_insn = offset; + insns[offset].linked_insn = first; + insns[offset].linked_value = insns[search].linked_value; + } + break; + } else if (insns[search].id == MIPS_INS_LI) { + if (insns[search].linked_insn != -1) { + //function_entry_points.insert(insns[search].linked_value); + uint32_t first = insns[search].linked_insn; + insns[search].linked_insn = offset; + insns[offset].linked_insn = first; + insns[offset].linked_value = insns[search].linked_value; + insns[search].id = MIPS_INS_NOP; + insns[search].mnemonic = "nop"; + insns[search].op_str = ""; + } + break; + } else if (insns[search].id == MIPS_INS_LD || + insns[search].id == MIPS_INS_ADDU || + insns[search].id == MIPS_INS_ADD || + insns[search].id == MIPS_INS_SUB || + insns[search].id == MIPS_INS_SUBU) { + break; + } + } else if (insns[search].id == MIPS_INS_JR && + insns[search].operands[0].reg == MIPS_REG_RA) + { + // stop looking when previous `jr ra` is hit + break; + } + } +} + +static void pass1(void) { + for (size_t i = 0; i < insns.size(); i++) { + Insn& insn = insns[i]; + if (insn.id == MIPS_INS_BAL) { + insn.id = MIPS_INS_JAL; + insn.mnemonic = "jal"; + } + if (insn.is_jump) { + if (insn.id == MIPS_INS_JAL || insn.id == MIPS_INS_J) { + uint32_t target = (uint32_t)insn.operands[0].imm; + label_addresses.insert(target); + add_function(target); + } else if (insn.id == MIPS_INS_JR) { + // sltiu $at, $ty, z + // sw $reg, offset($sp) (very seldom, one or more, usually in func entry) + // lw $gp, offset($sp) (if PIC, and very seldom) + // beqz $at, .L + // some other instruction (not always) + // lui $at, %hi(jtbl) + // sll $tx, $ty, 2 + // addu $at, $at, $tx + // lw $tx, %lo(jtbl)($at) + // nop (code compiled with 5.3) + // addu $tx, $tx, $gp (if PIC) + // jr $tx + + // IDO 7.1: + //lw at,offset(gp) + //andi t9,t8,0x3f + //sll t9,t9,0x2 + //addu at,at,t9 + //lw t9,offset(at) + //addu t9,t9,gp + //jr t9 + + // IDO 5.3: + //lw at,offset(gp) + //andi t3,t2,0x3f + //sll t3,t3,0x2 + //addu at,at,t3 + //something + //lw t3,offset(at) + //something + //addu t3,t3,gp + //jr t3 + if (i >= 7 && rodata_section != NULL) { + bool is_pic = insns[i - 1].id == MIPS_INS_ADDU && insns[i - 1].operands[2].reg == MIPS_REG_GP; + bool has_nop = insns[i - is_pic - 1].id == MIPS_INS_NOP; + bool has_extra = insns[i - is_pic - has_nop - 5].id != MIPS_INS_BEQZ; + int lw = i - is_pic - has_nop - 1; + if (insns[lw].id != MIPS_INS_LW) { + --lw; + } + if (insns[lw].id == MIPS_INS_LW && insns[lw].linked_insn != -1) { + int sltiu_index = -1; + int andi_index = -1; + uint32_t addu_index = lw - 1; + uint32_t num_cases; + bool found = false; + bool and_variant = false; + int end = 14; + if (insns[addu_index].id != MIPS_INS_ADDU) { + --addu_index; + } + mips_reg index_reg = (mips_reg)insns[addu_index - 1].operands[1].reg; + if (insns[addu_index].id != MIPS_INS_ADDU) { + goto skip; + } + if (insns[addu_index - 1].id != MIPS_INS_SLL) { + goto skip; + } + if (insns[addu_index - 1].operands[0].reg != insn.operands[0].reg) { + goto skip; + } + for (int j = 3; j <= 4; j++) { + if (insns[lw - j].id == MIPS_INS_ANDI) { + andi_index = lw - j; + break; + } + } + if (i == 368393) { + // In copt + end = 18; + } + for (int j = 5; j <= end; j++) { + if (insns[lw - has_extra - j].id == MIPS_INS_SLTIU && + insns[lw - has_extra - j].operands[0].reg == MIPS_REG_AT) + { + sltiu_index = j; + break; + } + if (insns[lw - has_extra - j].id == MIPS_INS_JR) { + // Prevent going into a previous switch + break; + } + } + if (sltiu_index != -1) { + andi_index = -1; + } + if (sltiu_index != -1 && insns[lw - has_extra - sltiu_index].id == MIPS_INS_SLTIU) { + num_cases = insns[lw - has_extra - sltiu_index].operands[2].imm; + found = true; + } else if (andi_index != -1) { + num_cases = insns[andi_index].operands[2].imm + 1; + found = true; + and_variant = true; + } else if (i == 219382) { + // Special hard case in copt where the initial sltiu is in another basic block + found = true; + num_cases = 13; + } else if (i == 370995) { + // Special hard case in copt where the initial sltiu is in another basic block + found = true; + num_cases = 12; + } + if (found) { + uint32_t jtbl_addr = insns[lw].linked_value; + if (is_pic) { + insns[i - 1].id = MIPS_INS_NOP; + } + //printf("jump table at %08x, size %u\n", jtbl_addr, num_cases); + insn.jtbl_addr = jtbl_addr; + insn.num_cases = num_cases; + insn.index_reg = index_reg; + insns[lw].id = MIPS_INS_NOP; + insns[addu_index].id = MIPS_INS_NOP; + insns[addu_index - 1].id = MIPS_INS_NOP; + if (!and_variant) { + insns[addu_index - 2].id = MIPS_INS_NOP; + } + + if (jtbl_addr < rodata_vaddr || jtbl_addr + num_cases * sizeof(uint32_t) > rodata_vaddr + rodata_section_len) { + fprintf(stderr, "jump table outside rodata\n"); + exit(EXIT_FAILURE); + } + for (uint32_t i = 0; i < num_cases; i++) { + uint32_t target_addr = read_u32_be(rodata_section + (jtbl_addr - rodata_vaddr) + i * sizeof(uint32_t)); + target_addr += gp_value; + //printf("%08X\n", target_addr); + label_addresses.insert(target_addr); + } + } + skip:; + } + } + } else { + for (int j = 0; j < insn.op_count; j++) { + if (insn.operands[j].type == MIPS_OP_IMM) { + uint32_t target = (uint32_t)insn.operands[j].imm; + label_addresses.insert(target); + } + } + } + } + switch (insns[i].id) { + // find floating point LI + case MIPS_INS_MTC1: + { + unsigned int rt = insns[i].operands[0].reg; + for (int s = i - 1; s >= 0; s--) { + if (insns[s].id == MIPS_INS_LUI && insns[s].operands[0].reg == rt) { + float f; + uint32_t lui_imm = (uint32_t)(insns[s].operands[1].imm << 16); + memcpy(&f, &lui_imm, sizeof(f)); + insns[s].operands[1].imm <<= 16; + // link up the LUI with this instruction and the float + insns[s].linked_insn = i; + insns[s].linked_float = f; + // rewrite LUI instruction to be LI + insns[s].id = MIPS_INS_LI; + insns[s].mnemonic = "li"; + break; + } else if (insns[s].id == MIPS_INS_LW || + insns[s].id == MIPS_INS_LD || + insns[s].id == MIPS_INS_LH || + insns[s].id == MIPS_INS_LHU || + insns[s].id == MIPS_INS_LB || + insns[s].id == MIPS_INS_LBU || + insns[s].id == MIPS_INS_ADDIU || + insns[s].id == MIPS_INS_ADD || + insns[s].id == MIPS_INS_SUB || + insns[s].id == MIPS_INS_SUBU) { + unsigned int rd = insns[s].operands[0].reg; + if (rt == rd) { + break; + } + } else if (insns[s].id == MIPS_INS_JR && + insns[s].operands[0].reg == MIPS_REG_RA) { + // stop looking when previous `jr ra` is hit + break; + } + } + break; + } + case MIPS_INS_SD: + case MIPS_INS_SW: + case MIPS_INS_SH: + case MIPS_INS_SB: + case MIPS_INS_LB: + case MIPS_INS_LBU: + case MIPS_INS_LD: + case MIPS_INS_LDL: + case MIPS_INS_LDR: + case MIPS_INS_LH: + case MIPS_INS_LHU: + case MIPS_INS_LW: + case MIPS_INS_LWU: + case MIPS_INS_LDC1: + case MIPS_INS_LWC1: + case MIPS_INS_LWC2: + case MIPS_INS_LWC3: + case MIPS_INS_SWC1: + case MIPS_INS_SWC2: + case MIPS_INS_SWC3: + { + unsigned int mem_rs = insns[i].operands[1].mem.base; + int mem_imm = (int)insns[i].operands[1].mem.disp; + if (mem_rs == MIPS_REG_GP) { + unsigned int got_entry = (mem_imm + gp_value_adj) / sizeof(unsigned int); + if (got_entry >= got_locals.size()) { + got_entry -= got_locals.size(); + if (got_entry < got_globals.size()) { + assert(insn.id == MIPS_INS_LW); + //printf("gp 0x%08x %s\n", mem_imm, got_globals[got_entry].name); + unsigned int dest_vaddr = got_globals[got_entry]; + insns[i].is_global_got_memop = true; + insns[i].linked_value = dest_vaddr; + //insns[i].label = got_globals[got_entry].name; + + //vaddr_references[dest_vaddr].insert(vaddr + i * 4); + //disasm_add_data_addr(state, dest_vaddr); + insns[i].id = MIPS_INS_LI; + insns[i].operands[1].imm = dest_vaddr; + char buf[32]; + sprintf(buf, "$%s, 0x%x", cs_reg_name(handle, insn.operands[0].reg), dest_vaddr); + insns[i].op_str = buf; + } + } + } else { + link_with_lui(i, mem_rs, mem_imm); + } + break; + } + case MIPS_INS_ADDIU: + case MIPS_INS_ORI: + { + unsigned int rd = insns[i].operands[0].reg; + unsigned int rs = insns[i].operands[1].reg; + int64_t imm = insns[i].operands[2].imm; + if (rs == MIPS_REG_ZERO) { // becomes LI + char buf[32]; + insns[i].id = MIPS_INS_LI; + insns[i].operands[1].imm = imm; + insns[i].mnemonic = "li"; + sprintf(buf, "$%s, %" PRIi64, cs_reg_name(handle, rd), imm); + insns[i].op_str = buf; + } else if (/*rd == rs &&*/ rd != MIPS_REG_GP) { // only look for LUI if rd and rs are the same + link_with_lui(i, rs, (int)imm); + } + break; + } + case MIPS_INS_JALR: + { + unsigned int r = insn.operands[0].reg; + if (r == MIPS_REG_T9) { + link_with_jalr(i); + if (insn.linked_insn != -1) { + char buf[32]; + sprintf(buf, "0x%x", insn.linked_value); + insn.id = MIPS_INS_JAL; + insn.mnemonic = "jal"; + insn.op_str = buf; + insn.operands[0].type = MIPS_OP_IMM; + insn.operands[0].imm = insn.linked_value; + label_addresses.insert(insn.linked_value); + add_function(insn.linked_value); + } + } + break; + } + } + if (insn.id == MIPS_INS_ADDU && insn.operands[0].reg == MIPS_REG_GP && insn.operands[1].reg == MIPS_REG_GP && insn.operands[2].reg == MIPS_REG_T9 && i >= 2) { + //state->function_entry_points.insert(vaddr + (i - 2) * 4); + for (int j = i - 2; j <= i; j++) { + insns[j].id = MIPS_INS_NOP; + insns[j].mnemonic = "nop"; + insns[j].op_str = ""; + } + } + } +} + +static uint32_t addr_to_i(uint32_t addr) { + return (addr - text_vaddr) / 4; +} + +static void pass2(void) { + // Find returns in each function + for (size_t i = 0; i < insns.size(); i++) { + uint32_t addr = text_vaddr + i * 4; + Insn& insn = insns[i]; + if (insn.id == MIPS_INS_JR && insn.operands[0].reg == MIPS_REG_RA) { + auto it = find_function(addr); + assert(it != functions.end()); + it->second.returns.push_back(addr + 4); + } + if (insn.is_global_got_memop && text_vaddr <= insn.operands[1].imm && insn.operands[1].imm < text_vaddr + text_section_len) { + uint32_t faddr = insn.operands[1].imm; + li_function_pointers.insert(faddr); + functions[faddr].referenced_by_function_pointer = true; +#if INSPECT_FUNCTION_POINTERS + fprintf(stderr, "li function pointer: 0x%x at 0x%x\n", faddr, addr); +#endif + } + } + for (auto it = functions.begin(); it != functions.end(); ++it) { + if (it->second.returns.size() == 0) { + uint32_t i = addr_to_i(it->first); + auto str_it = symbol_names.find(it->first); + if (str_it != symbol_names.end() && str_it->second == "__start") { + + } else if (str_it != symbol_names.end() && str_it->second == "xmalloc") { + // orig 5.3: + /* + 496bf4: 3c1c0fb9 lui gp,0xfb9 + 496bf8: 279c366c addiu gp,gp,13932 + 496bfc: 0399e021 addu gp,gp,t9 + 496c00: 27bdffd8 addiu sp,sp,-40 + 496c04: 8f858de8 lw a1,-29208(gp) + 496c08: 10000006 b 496c24 + 496c0c: afbf0020 sw ra,32(sp) + */ + + // jal alloc_new + // lui $a1, malloc_scb + // jr $ra + // nop + uint32_t alloc_new_addr = text_vaddr + (i + 7) * 4; + insns[i].id = MIPS_INS_JAL; + insns[i].op_count = 1; + insns[i].mnemonic = "jal"; + insns[i].op_str = "alloc_new"; + insns[i].operands[0].imm = alloc_new_addr; + assert(symbol_names.count(alloc_new_addr) && symbol_names[alloc_new_addr] == "alloc_new"); + i++; + if (insns[i + 5].id == MIPS_INS_LI) { + // 7.1 + insns[i] = insns[i + 5]; + } else { + // 5.3 + insns[i] = insns[i + 3]; + } + i++; + insns[i].id = MIPS_INS_JR; + insns[i].op_count = 1; + insns[i].mnemonic = "jr"; + insns[i].op_str = "$ra"; + insns[i].operands[0].reg = MIPS_REG_RA; + it->second.returns.push_back(text_vaddr + i * 4 + 4); + i++; + for (uint32_t j = 0; j < 4; j++) { + insns[i].id = MIPS_INS_NOP; + insns[i].op_count = 0; + insns[i].mnemonic = "nop"; + i++; + } + } else if (str_it != symbol_names.end() && str_it->second == "xfree") { + // jal alloc_dispose + // lui $a1, malloc_scb + // jr $ra + // nop + uint32_t alloc_dispose_addr = text_vaddr + (i + 4) * 4; + if (symbol_names.count(alloc_dispose_addr + 4) && symbol_names[alloc_dispose_addr + 4] == "alloc_dispose") { + alloc_dispose_addr += 4; + } + insns[i].id = MIPS_INS_JAL; + insns[i].op_count = 1; + insns[i].mnemonic = "jal"; + insns[i].op_str = "alloc_dispose"; + insns[i].operands[0].imm = alloc_dispose_addr; + assert(symbol_names.count(alloc_dispose_addr) && symbol_names[alloc_dispose_addr] == "alloc_dispose"); + i++; + insns[i] = insns[i + 2]; + i++; + insns[i].id = MIPS_INS_JR; + insns[i].op_count = 1; + insns[i].mnemonic = "jr"; + insns[i].op_str = "$ra"; + insns[i].operands[0].reg = MIPS_REG_RA; + it->second.returns.push_back(text_vaddr + i * 4 + 4); + i++; + insns[i].id = MIPS_INS_NOP; + insns[i].op_count = 0; + insns[i].mnemonic = "nop"; + } else if (insns[i].id == MIPS_INS_LW && insns[i + 1].id == MIPS_INS_MOVE && insns[i + 2].id == MIPS_INS_JALR) { + /* + 408f50: 8f998010 lw t9,-32752(gp) + 408f54: 03e07821 move t7,ra + 408f58: 0320f809 jalr t9 + */ + } else if (it->first > mcount_addr) { + fprintf(stderr, "no ret: 0x%x\n", it->first); + abort(); + } + } + auto next = it; + ++next; + if (next == functions.end()) { + it->second.end_addr = text_vaddr + text_section_len; + } else { + it->second.end_addr = next->first; + } + } +} + +static void add_edge(uint32_t from, uint32_t to, bool function_entry = false, bool function_exit = false, bool extern_function = false, bool function_pointer = false) { + Edge fe = Edge(), be = Edge(); + fe.i = to; + be.i = from; + fe.function_entry = function_entry; + be.function_entry = function_entry; + fe.function_exit = function_exit; + be.function_exit = function_exit; + fe.extern_function = extern_function; + be.extern_function = extern_function; + fe.function_pointer = function_pointer; + be.function_pointer = function_pointer; + insns[from].successors.push_back(fe); + insns[to].predecessors.push_back(be); +} + +static void pass3(void) { + // Build graph + for (size_t i = 0; i < insns.size(); i++) { + uint32_t addr = text_vaddr + i * 4; + Insn& insn = insns[i]; + if (insn.no_following_successor) { + continue; + } + switch (insn.id) { + case MIPS_INS_BEQ: + case MIPS_INS_BGEZ: + case MIPS_INS_BGTZ: + case MIPS_INS_BLEZ: + case MIPS_INS_BLTZ: + case MIPS_INS_BNE: + case MIPS_INS_BEQZ: + case MIPS_INS_BNEZ: + case MIPS_INS_BC1F: + case MIPS_INS_BC1T: + add_edge(i, i + 1); + add_edge(i + 1, addr_to_i((uint32_t)insn.operands[insn.op_count - 1].imm)); + break; + + case MIPS_INS_BEQL: + case MIPS_INS_BGEZL: + case MIPS_INS_BGTZL: + case MIPS_INS_BLEZL: + case MIPS_INS_BLTZL: + case MIPS_INS_BNEL: + case MIPS_INS_BC1FL: + case MIPS_INS_BC1TL: + add_edge(i, i + 1); + add_edge(i, i + 2); + add_edge(i + 1, addr_to_i((uint32_t)insn.operands[insn.op_count - 1].imm)); + insns[i + 1].no_following_successor = true; // don't inspect delay slot + break; + + case MIPS_INS_B: + case MIPS_INS_J: + add_edge(i, i + 1); + add_edge(i + 1, addr_to_i((uint32_t)insn.operands[0].imm)); + insns[i + 1].no_following_successor = true; // don't inspect delay slot + break; + + case MIPS_INS_JR: { + add_edge(i, i + 1); + if (insn.jtbl_addr != 0) { + uint32_t jtbl_pos = insn.jtbl_addr - rodata_vaddr; + assert(jtbl_pos < rodata_section_len && jtbl_pos + insn.num_cases * 4 <= rodata_section_len); + for (uint32_t j = 0; j < insn.num_cases; j++) { + uint32_t dest_addr = read_u32_be(rodata_section + jtbl_pos + j * 4) + gp_value; + add_edge(i + 1, addr_to_i(dest_addr)); + } + } else { + assert(insn.operands[0].reg == MIPS_REG_RA && "jump to address in register not supported"); + } + insns[i + 1].no_following_successor = true; // don't inspect delay slot + break; + } + + case MIPS_INS_JAL: { + add_edge(i, i + 1); + uint32_t dest = (uint32_t)insn.operands[0].imm; + if (dest > mcount_addr && dest >= text_vaddr && dest < text_vaddr + text_section_len) { + add_edge(i + 1, addr_to_i(dest), true); + auto it = functions.find(dest); + assert(it != functions.end()); + for (uint32_t ret_instr : it->second.returns) { + add_edge(addr_to_i(ret_instr), i + 2, false, true); + } + } else { + add_edge(i + 1, i + 2, false, false, true); + } + insns[i + 1].no_following_successor = true; // don't inspect delay slot + break; + } + + case MIPS_INS_JALR: + // function pointer + add_edge(i, i + 1); + add_edge(i + 1, i + 2, false, false, false, true); + insns[i + 1].no_following_successor = true; // don't inspect delay slot + break; + + default: + add_edge(i, i + 1); + break; + } + } +} + +static uint64_t map_reg(int32_t reg) { + if (reg > MIPS_REG_31) { + if (reg == MIPS_REG_HI) { + reg = MIPS_REG_31 + 1; + } else if (reg == MIPS_REG_LO) { + reg = MIPS_REG_31 + 2; + } else { + return 0; + } + } + return (uint64_t)1 << (reg - MIPS_REG_0 + 1); +} + +static uint64_t temporary_regs(void) { + return + map_reg(MIPS_REG_T0) | + map_reg(MIPS_REG_T1) | + map_reg(MIPS_REG_T2) | + map_reg(MIPS_REG_T3) | + map_reg(MIPS_REG_T4) | + map_reg(MIPS_REG_T5) | + map_reg(MIPS_REG_T6) | + map_reg(MIPS_REG_T7) | + map_reg(MIPS_REG_T8) | + map_reg(MIPS_REG_T9); +} + +typedef enum { + TYPE_NOP, + TYPE_1S, + TYPE_2S, + TYPE_1D, + TYPE_1D_1S, + TYPE_1D_2S, + TYPE_D_LO_HI_2S, + TYPE_1S_POS1 +} TYPE; +static TYPE insn_to_type(Insn& i) { + switch (i.id) { + case MIPS_INS_ADD: + case MIPS_INS_ADDU: + if (i.mnemonic != "add.s" && i.mnemonic != "add.d") { + return TYPE_1D_2S; + } else { + return TYPE_NOP; + } + + case MIPS_INS_ADDI: + case MIPS_INS_ADDIU: + case MIPS_INS_ANDI: + case MIPS_INS_ORI: + case MIPS_INS_LB: + case MIPS_INS_LBU: + case MIPS_INS_LH: + case MIPS_INS_LHU: + case MIPS_INS_LW: + case MIPS_INS_LWL: + //case MIPS_INS_LWR: + case MIPS_INS_MOVE: + case MIPS_INS_NEGU: + case MIPS_INS_NOT: + case MIPS_INS_SLL: + case MIPS_INS_SLTI: + case MIPS_INS_SLTIU: + case MIPS_INS_SRA: + case MIPS_INS_SRL: + case MIPS_INS_XORI: + return TYPE_1D_1S; + + case MIPS_INS_MFHI: + i.operands[1].reg = MIPS_REG_HI; + return TYPE_1D_1S; + + case MIPS_INS_MFLO: + i.operands[1].reg = MIPS_REG_LO; + return TYPE_1D_1S; + + case MIPS_INS_AND: + case MIPS_INS_OR: + case MIPS_INS_NOR: + case MIPS_INS_SLLV: + case MIPS_INS_SLT: + case MIPS_INS_SLTU: + case MIPS_INS_SRAV: + case MIPS_INS_SRLV: + case MIPS_INS_SUBU: + case MIPS_INS_XOR: + return TYPE_1D_2S; + + case MIPS_INS_CFC1: + case MIPS_INS_MFC1: + case MIPS_INS_LI: + case MIPS_INS_LUI: + return TYPE_1D; + + case MIPS_INS_CTC1: + case MIPS_INS_BGEZ: + case MIPS_INS_BGEZL: + case MIPS_INS_BGTZ: + case MIPS_INS_BGTZL: + case MIPS_INS_BLEZ: + case MIPS_INS_BLEZL: + case MIPS_INS_BLTZ: + case MIPS_INS_BLTZL: + case MIPS_INS_BEQZ: + case MIPS_INS_BNEZ: + case MIPS_INS_MTC1: + return TYPE_1S; + + case MIPS_INS_BEQ: + case MIPS_INS_BEQL: + case MIPS_INS_BNE: + case MIPS_INS_BNEL: + case MIPS_INS_SB: + case MIPS_INS_SH: + case MIPS_INS_SW: + case MIPS_INS_SWL: + //case MIPS_INS_SWR: + case MIPS_INS_TNE: + case MIPS_INS_TEQ: + case MIPS_INS_TGE: + case MIPS_INS_TGEU: + case MIPS_INS_TLT: + return TYPE_2S; + + case MIPS_INS_DIV: + if (i.mnemonic != "div.s" && i.mnemonic != "div.d") { + return TYPE_D_LO_HI_2S; + } else { + return TYPE_NOP; + } + + case MIPS_INS_DIVU: + case MIPS_INS_MULT: + case MIPS_INS_MULTU: + return TYPE_D_LO_HI_2S; + + case MIPS_INS_NEG: + if (i.mnemonic != "neg.s" && i.mnemonic != "neg.d") { + return TYPE_1D_1S; + } else { + return TYPE_NOP; + } + + case MIPS_INS_JALR: + return TYPE_1S; + + case MIPS_INS_JR: + if (i.jtbl_addr != 0) { + i.operands[0].reg = i.index_reg; + } + if (i.operands[0].reg == MIPS_REG_RA) { + return TYPE_NOP; + } + return TYPE_1S; + + case MIPS_INS_LWC1: + case MIPS_INS_LDC1: + case MIPS_INS_SWC1: + case MIPS_INS_SDC1: + return TYPE_1S_POS1; + + default: + return TYPE_NOP; + } +} + +static void pass4(void) { + vector q; + uint64_t livein_func_start = 1U | map_reg(MIPS_REG_A0) | map_reg(MIPS_REG_A1) | map_reg(MIPS_REG_SP) | map_reg(MIPS_REG_ZERO); + + q.push_back(main_addr); + insns[addr_to_i(main_addr)].f_livein = livein_func_start; + + for (auto& it : data_function_pointers) { + q.push_back(it.second); + insns[addr_to_i(it.second)].f_livein = livein_func_start | map_reg(MIPS_REG_A2) | map_reg(MIPS_REG_A3); + } + for (auto& addr : li_function_pointers) { + q.push_back(addr); + insns[addr_to_i(addr)].f_livein = livein_func_start | map_reg(MIPS_REG_A2) | map_reg(MIPS_REG_A3); + } + + while (!q.empty()) { + uint32_t addr = q.back(); + q.pop_back(); + uint32_t idx = addr_to_i(addr); + Insn& i = insns[idx]; + uint64_t live = i.f_livein | 1; + switch (insn_to_type(i)) { + case TYPE_1D: + live |= map_reg(i.operands[0].reg); + break; + + case TYPE_1D_1S: + if (live & map_reg(i.operands[1].reg)) { + live |= map_reg(i.operands[0].reg); + } + break; + + case TYPE_1D_2S: + if ((live & map_reg(i.operands[1].reg)) && (live & map_reg(i.operands[2].reg))) { + live |= map_reg(i.operands[0].reg); + } + break; + + case TYPE_D_LO_HI_2S: + if ((live & map_reg(i.operands[0].reg)) && (live & map_reg(i.operands[1].reg))) { + live |= map_reg(MIPS_REG_LO); + live |= map_reg(MIPS_REG_HI); + } + break; + } + if ((i.f_liveout | live) == i.f_liveout) { + // No new bits + continue; + } + live |= i.f_liveout; + i.f_liveout = live; + + bool function_entry = false; + for (Edge& e : i.successors) { + uint64_t new_live = live; + if (e.function_exit) { + new_live &= 1U | map_reg(MIPS_REG_V0) | map_reg(MIPS_REG_V1) | map_reg(MIPS_REG_ZERO); + } else if (e.function_entry) { + new_live &= 1U | map_reg(MIPS_REG_V0) | map_reg(MIPS_REG_A0) | map_reg(MIPS_REG_A1) | + map_reg(MIPS_REG_A2) | map_reg(MIPS_REG_A3) | map_reg(MIPS_REG_SP) | map_reg(MIPS_REG_ZERO); + function_entry = true; + } else if (e.extern_function) { + string name; + bool is_extern_function = false; + size_t extern_function_id; + auto it = symbol_names.find(insns[idx - 1].operands[0].imm); + if (it != symbol_names.end()) { + name = it->second; + for (size_t i = 0; i < sizeof(extern_functions) / sizeof(extern_functions[0]); i++) { + if (name == extern_functions[i].name) { + is_extern_function = true; + extern_function_id = i; + break; + } + } + if (!is_extern_function) { + fprintf(stderr, "missing extern function: %s\n", name.c_str()); + } + } + assert(is_extern_function); + auto& fn = extern_functions[extern_function_id]; + char ret_type = fn.params[0]; + new_live &= ~(map_reg(MIPS_REG_V0) | map_reg(MIPS_REG_A0) | map_reg(MIPS_REG_A1) | + map_reg(MIPS_REG_A2) | map_reg(MIPS_REG_A3) | map_reg(MIPS_REG_V1) | temporary_regs()); + switch (ret_type) { + case 'i': + case 'u': + case 'p': + new_live |= map_reg(MIPS_REG_V0); + break; + case 'f': + break; + case 'd': + break; + case 'v': + break; + case 'l': + case 'j': + new_live |= map_reg(MIPS_REG_V0) | map_reg(MIPS_REG_V1); + break; + } + } else if (e.function_pointer) { + new_live &= ~(map_reg(MIPS_REG_V0) | map_reg(MIPS_REG_A0) | map_reg(MIPS_REG_A1) | + map_reg(MIPS_REG_A2) | map_reg(MIPS_REG_A3) | map_reg(MIPS_REG_V1) | temporary_regs()); + new_live |= map_reg(MIPS_REG_V0) | map_reg(MIPS_REG_V1); + } + if ((insns[e.i].f_livein | new_live) != insns[e.i].f_livein) { + insns[e.i].f_livein |= new_live; + q.push_back(text_vaddr + e.i * 4); + } + } + if (function_entry) { + // add one edge that skips the function call, for callee-saved register liveness propagation + live &= ~(map_reg(MIPS_REG_V0) | map_reg(MIPS_REG_A0) | map_reg(MIPS_REG_A1) | + map_reg(MIPS_REG_A2) | map_reg(MIPS_REG_A3) | map_reg(MIPS_REG_V1) | temporary_regs()); + if ((insns[idx + 1].f_livein | live) != insns[idx + 1].f_livein) { + insns[idx + 1].f_livein |= live; + q.push_back(text_vaddr + (idx + 1) * 4); + } + } + } +} + +static void pass5(void) { + vector q; + + assert(functions.count(main_addr)); + + q = functions[main_addr].returns; + for (auto addr : q) { + insns[addr_to_i(addr)].b_liveout = 1U | map_reg(MIPS_REG_V0); + } + for (auto& it : data_function_pointers) { + for (auto addr : functions[it.second].returns) { + q.push_back(addr); + insns[addr_to_i(addr)].b_liveout = 1U | map_reg(MIPS_REG_V0) | map_reg(MIPS_REG_V1); + } + } + for (auto& func_addr : li_function_pointers) { + for (auto addr : functions[func_addr].returns) { + q.push_back(addr); + insns[addr_to_i(addr)].b_liveout = 1U | map_reg(MIPS_REG_V0) | map_reg(MIPS_REG_V1); + } + } + for (size_t i = 0; i < insns.size(); i++) { + if (insns[i].f_livein != 0) { + // Instruction is reachable + q.push_back(text_vaddr + i * 4); + } + } + + while (!q.empty()) { + uint32_t addr = q.back(); + q.pop_back(); + uint32_t idx = addr_to_i(addr); + Insn& i = insns[idx]; + uint64_t live = i.b_liveout | 1; + switch (insn_to_type(i)) { + case TYPE_1S: + live |= map_reg(i.operands[0].reg); + break; + + case TYPE_1S_POS1: + live |= map_reg(i.operands[1].reg); + break; + + case TYPE_2S: + live |= map_reg(i.operands[0].reg); + live |= map_reg(i.operands[1].reg); + break; + + case TYPE_1D: + live &= ~map_reg(i.operands[0].reg); + break; + + case TYPE_1D_1S: + if (live & map_reg(i.operands[0].reg)) { + live &= ~map_reg(i.operands[0].reg); + live |= map_reg(i.operands[1].reg); + } + break; + + case TYPE_1D_2S: + if (live & map_reg(i.operands[0].reg)) { + live &= ~map_reg(i.operands[0].reg); + live |= map_reg(i.operands[1].reg); + live |= map_reg(i.operands[2].reg); + } + break; + + case TYPE_D_LO_HI_2S: { + bool used = (live & map_reg(MIPS_REG_LO)) || (live & map_reg(MIPS_REG_HI)); + live &= ~map_reg(MIPS_REG_LO); + live &= ~map_reg(MIPS_REG_HI); + if (used) { + live |= map_reg(i.operands[0].reg); + live |= map_reg(i.operands[1].reg); + } + break; + } + } + if ((i.b_livein | live) == i.b_livein) { + // No new bits + continue; + } + live |= i.b_livein; + i.b_livein = live; + + bool function_exit = false; + for (Edge& e : i.predecessors) { + uint64_t new_live = live; + if (e.function_exit) { + new_live &= 1U | map_reg(MIPS_REG_V0) | map_reg(MIPS_REG_V1); + function_exit = true; + } else if (e.function_entry) { + new_live &= 1U | map_reg(MIPS_REG_V0) | map_reg(MIPS_REG_A0) | map_reg(MIPS_REG_A1) | + map_reg(MIPS_REG_A2) | map_reg(MIPS_REG_A3) | map_reg(MIPS_REG_SP); + } else if (e.extern_function) { + string name; + bool is_extern_function = false; + size_t extern_function_id; + auto it = symbol_names.find(insns[idx - 2].operands[0].imm); + if (it != symbol_names.end()) { + name = it->second; + for (size_t i = 0; i < sizeof(extern_functions) / sizeof(extern_functions[0]); i++) { + if (name == extern_functions[i].name) { + is_extern_function = true; + extern_function_id = i; + break; + } + } + } + assert(is_extern_function); + auto& fn = extern_functions[extern_function_id]; + uint64_t args = 1U; + if (fn.flags & FLAG_VARARG) { + // Assume the worst, that all four registers are used + for (int j = 0; j < 4; j++) { + args |= map_reg(MIPS_REG_A0 + j); + } + } + int pos = 0; + int pos_float = 0; + bool only_floats_so_far = true; + for (const char *p = fn.params + 1; *p != '\0'; ++p) { + switch (*p) { + case 'i': + case 'u': + case 'p': + case 't': + only_floats_so_far = false; + if (pos < 4) { + args |= map_reg(MIPS_REG_A0 + pos); + } + ++pos; + break; + case 'f': + if (only_floats_so_far && pos_float < 4) { + pos_float += 2; + } else if (pos < 4) { + args |= map_reg(MIPS_REG_A0 + pos); + } + ++pos; + break; + case 'd': + if (pos % 1 != 0) { + ++pos; + } + if (only_floats_so_far && pos_float < 4) { + pos_float += 2; + } else if (pos < 4) { + args |= map_reg(MIPS_REG_A0 + pos) | map_reg(MIPS_REG_A0 + pos + 1); + } + pos += 2; + break; + case 'l': + case 'j': + if (pos % 1 != 0) { + ++pos; + } + only_floats_so_far = false; + if (pos < 4) { + args |= map_reg(MIPS_REG_A0 + pos) | map_reg(MIPS_REG_A0 + pos + 1); + } + pos += 2; + break; + } + } + args |= map_reg(MIPS_REG_SP); + new_live &= ~(map_reg(MIPS_REG_V0) | map_reg(MIPS_REG_A0) | map_reg(MIPS_REG_A1) | + map_reg(MIPS_REG_A2) | map_reg(MIPS_REG_A3) | map_reg(MIPS_REG_V1) | temporary_regs()); + new_live |= args; + } else if (e.function_pointer) { + new_live &= ~(map_reg(MIPS_REG_V0) | map_reg(MIPS_REG_A0) | map_reg(MIPS_REG_A1) | + map_reg(MIPS_REG_A2) | map_reg(MIPS_REG_A3) | map_reg(MIPS_REG_V1) | temporary_regs()); + new_live |= map_reg(MIPS_REG_A0) | map_reg(MIPS_REG_A1) | map_reg(MIPS_REG_A2) | map_reg(MIPS_REG_A3); + } + if ((insns[e.i].b_liveout | new_live) != insns[e.i].b_liveout) { + insns[e.i].b_liveout |= new_live; + q.push_back(text_vaddr + e.i * 4); + } + } + if (function_exit) { + // add one edge that skips the function call, for callee-saved register liveness propagation + live &= ~(map_reg(MIPS_REG_V0) | map_reg(MIPS_REG_A0) | map_reg(MIPS_REG_A1) | + map_reg(MIPS_REG_A2) | map_reg(MIPS_REG_A3) | map_reg(MIPS_REG_V1) | temporary_regs()); + if ((insns[idx - 1].b_liveout | live) != insns[idx - 1].b_liveout) { + insns[idx - 1].b_liveout |= live; + q.push_back(text_vaddr + (idx - 1) * 4); + } + } + } +} + +static void pass6(void) { + for (auto& it : functions) { + uint32_t addr = it.first; + Function& f = it.second; + for (uint32_t ret : f.returns) { + Insn& i = insns[addr_to_i(ret)]; + if (i.f_liveout & i.b_liveout & map_reg(MIPS_REG_V1)) { + f.nret = 2; + } else if ((i.f_liveout & i.b_liveout & map_reg(MIPS_REG_V0)) && f.nret == 0) { + f.nret = 1; + } + } + Insn& insn = insns.at(addr_to_i(addr)); + for (int i = 0; i < 4; i++) { + if (insn.f_livein & insn.b_livein & map_reg(MIPS_REG_A0 + i)) { + f.nargs = 1 + i; + } + } + f.v0_in = (insn.f_livein & insn.b_livein & map_reg(MIPS_REG_V0)) != 0 && !f.referenced_by_function_pointer; + } +} + +static void dump(void) { + for (size_t i = 0; i < insns.size(); i++) { + Insn& insn = insns[i]; + uint32_t vaddr = text_vaddr + i * 4; + if (label_addresses.count(vaddr)) { + if (symbol_names.count(vaddr)) { + printf("L%08x: //%s\n", vaddr, symbol_names[vaddr].c_str()); + } else { + printf("L%08x:\n", vaddr); + } + } + printf("\t%s %s\n", insn.mnemonic.c_str(), insn.op_str.c_str()); + } +} + +static const char *r(uint32_t reg) { + return cs_reg_name(handle, reg); +} + +static const char *wr(uint32_t reg) { + static const char *regs[] = { + "f0.w[0]", "f0.w[1]", + "f2.w[0]", "f2.w[1]", + "f4.w[0]", "f4.w[1]", + "f6.w[0]", "f6.w[1]", + "f8.w[0]", "f8.w[1]", + "f10.w[0]", "f10.w[1]", + "f12.w[0]", "f12.w[1]", + "f14.w[0]", "f14.w[1]", + "f16.w[0]", "f16.w[1]", + "f18.w[0]", "f18.w[1]", + "f20.w[0]", "f20.w[1]", + "f22.w[0]", "f22.w[1]", + "f24.w[0]", "f24.w[1]", + "f26.w[0]", "f26.w[1]", + "f28.w[0]", "f28.w[1]", + "f30.w[0]", "f30.w[1]" + }; + assert(reg >= MIPS_REG_F0 && reg <= MIPS_REG_F31); + return regs[reg - MIPS_REG_F0]; +} + +static const char *fr(uint32_t reg) { + static const char *regs[] = { + "f0.f[0]", "f0.f[1]", + "f2.f[0]", "f2.f[1]", + "f4.f[0]", "f4.f[1]", + "f6.f[0]", "f6.f[1]", + "f8.f[0]", "f8.f[1]", + "f10.f[0]", "f10.f[1]", + "f12.f[0]", "f12.f[1]", + "f14.f[0]", "f14.f[1]", + "f16.f[0]", "f16.f[1]", + "f18.f[0]", "f18.f[1]", + "f20.f[0]", "f20.f[1]", + "f22.f[0]", "f22.f[1]", + "f24.f[0]", "f24.f[1]", + "f26.f[0]", "f26.f[1]", + "f28.f[0]", "f28.f[1]", + "f30.f[0]", "f30.f[1]" + }; + assert(reg >= MIPS_REG_F0 && reg <= MIPS_REG_F31); + return regs[reg - MIPS_REG_F0]; +} + +static const char *dr(uint32_t reg) { + static const char *regs[] = { + "f0.d", + "f2.d", + "f4.d", + "f6.d", + "f8.d", + "f10.d", + "f12.d", + "f14.d", + "f16.d", + "f18.d", + "f20.d", + "f22.d", + "f24.d", + "f26.d", + "f28.d", + "f30.d" + }; + assert(reg >= MIPS_REG_F0 && reg <= MIPS_REG_F31 && (reg - MIPS_REG_F0) % 2 == 0); + return regs[(reg - MIPS_REG_F0) / 2]; +} + +static void dump_instr(int i); + +static void dump_cond_branch(int i, const char *lhs, const char *op, const char *rhs) { + Insn& insn = insns[i]; + const char *cast1 = ""; + const char *cast2 = ""; + if (strcmp(op, "==") && strcmp(op, "!=")) { + cast1 = "(int)"; + if (strcmp(rhs, "0")) { + cast2 = "(int)"; + } + } + printf("if (%s%s %s %s%s) {", cast1, lhs, op, cast2, rhs); + dump_instr(i + 1); + printf("goto L%x;}\n", (uint32_t)insn.operands[insn.op_count - 1].imm); +} + +static void dump_cond_branch_likely(int i, const char *lhs, const char *op, const char *rhs) { + uint32_t target = text_vaddr + (i + 2) * 4; + dump_cond_branch(i, lhs, op, rhs); + if (!TRACE) { + printf("else goto L%x;\n", target); + } else { + printf("else {printf(\"pc=0x%08x (ignored)\\n\"); goto L%x;}\n", text_vaddr + (i + 1) * 4, target); + } + label_addresses.insert(target); +} + +static void dump_instr(int i) { + const char *symbol_name = NULL; + if (symbol_names.count(text_vaddr + i * 4) != 0) { + symbol_name = symbol_names[text_vaddr + i * 4].c_str(); + printf("//%s:\n", symbol_name); + } + if (TRACE) { + printf("++cnt; printf(\"pc=0x%08x%s%s\\n\"); ", text_vaddr + i * 4, symbol_name ? " " : "", symbol_name ? symbol_name : ""); + } + Insn& insn = insns[i]; + if (!insn.is_jump && !conservative) { + switch (insn_to_type(insn)) { + case TYPE_1S: + if (!(insn.f_livein & map_reg(insn.operands[0].reg))) { + printf("// fdead %llx ", (unsigned long long)insn.f_livein); + } + break; + case TYPE_1S_POS1: + if (!(insn.f_livein & map_reg(insn.operands[1].reg))) { + printf("// fdead %llx ", (unsigned long long)insn.f_livein); + } + break; + case TYPE_2S: + if (!(insn.f_livein & map_reg(insn.operands[0].reg)) || !(insn.f_livein & map_reg(insn.operands[1].reg))) { + printf("// fdead %llx ", (unsigned long long)insn.f_livein); + } + break; + case TYPE_1D_2S: + if (!(insn.f_livein & map_reg(insn.operands[2].reg))) { + printf("// fdead %llx ", (unsigned long long)insn.f_livein); + break; + } + // fallthrough + case TYPE_1D_1S: + if (!(insn.f_livein & map_reg(insn.operands[1].reg))) { + printf("// fdead %llx ", (unsigned long long)insn.f_livein); + break; + } + // fallthrough + case TYPE_1D: + if (!(insn.b_liveout & map_reg(insn.operands[0].reg))) { + printf("// bdead %llx ", (unsigned long long)insn.b_liveout); + } + break; + case TYPE_D_LO_HI_2S: + if (!(insn.f_livein & map_reg(insn.operands[0].reg)) || !(insn.f_livein & map_reg(insn.operands[1].reg))) { + printf("// fdead %llx ", (unsigned long long)insn.f_livein); + break; + } + if (!(insn.b_liveout & (map_reg(MIPS_REG_LO) | map_reg(MIPS_REG_HI)))) { + printf("// bdead %llx ", (unsigned long long)insn.b_liveout); + } + break; + } + } + switch (insn.id) { + case MIPS_INS_ADD: + case MIPS_INS_ADDU: + if (insn.mnemonic == "add.s") { + printf("%s = %s + %s;\n", fr(insn.operands[0].reg), fr(insn.operands[1].reg), fr(insn.operands[2].reg)); + } else if (insn.mnemonic == "add.d") { + printf("%s = %s + %s;\n", dr(insn.operands[0].reg), dr(insn.operands[1].reg), dr(insn.operands[2].reg)); + } else { + printf("%s = %s + %s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), r(insn.operands[2].reg)); + } + break; + case MIPS_INS_ADDI: + case MIPS_INS_ADDIU: + printf("%s = %s + 0x%x;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), (uint32_t)insn.operands[2].imm); + break; + case MIPS_INS_AND: + printf("%s = %s & %s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), r(insn.operands[2].reg)); + break; + case MIPS_INS_ANDI: + printf("%s = %s & 0x%x;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), (uint32_t)insn.operands[2].imm); + break; + case MIPS_INS_BEQ: + dump_cond_branch(i, r(insn.operands[0].reg), "==", r(insn.operands[1].reg)); + break; + case MIPS_INS_BEQL: + dump_cond_branch_likely(i, r(insn.operands[0].reg), "==", r(insn.operands[1].reg)); + break; + case MIPS_INS_BGEZ: + dump_cond_branch(i, r(insn.operands[0].reg), ">=", "0"); + break; + case MIPS_INS_BGEZL: + dump_cond_branch_likely(i, r(insn.operands[0].reg), ">=", "0"); + break; + case MIPS_INS_BGTZ: + dump_cond_branch(i, r(insn.operands[0].reg), ">", "0"); + break; + case MIPS_INS_BGTZL: + dump_cond_branch_likely(i, r(insn.operands[0].reg), ">", "0"); + break; + case MIPS_INS_BLEZ: + dump_cond_branch(i, r(insn.operands[0].reg), "<=", "0"); + break; + case MIPS_INS_BLEZL: + dump_cond_branch_likely(i, r(insn.operands[0].reg), "<=", "0"); + break; + case MIPS_INS_BLTZ: + dump_cond_branch(i, r(insn.operands[0].reg), "<", "0"); + break; + case MIPS_INS_BLTZL: + dump_cond_branch_likely(i, r(insn.operands[0].reg), "<", "0"); + break; + case MIPS_INS_BNE: + dump_cond_branch(i, r(insn.operands[0].reg), "!=", r(insn.operands[1].reg)); + break; + case MIPS_INS_BNEL: + dump_cond_branch_likely(i, r(insn.operands[0].reg), "!=", insn.mnemonic == "bnezl" ? "0" : r(insn.operands[1].reg)); + break; + case MIPS_INS_BREAK: + printf("abort();\n"); + break; + case MIPS_INS_BEQZ: + dump_cond_branch(i, r(insn.operands[0].reg), "==", "0"); + break; + /*case MIPS_INS_BEQZL: + dump_cond_branch_likely(i, r(insn.operands[0].reg), "==", "0"); + break;*/ + case MIPS_INS_B: + dump_instr(i + 1); + printf("goto L%x;\n", (int32_t)insn.operands[0].imm); + break; + case MIPS_INS_BC1F: + case MIPS_INS_BC1T: + printf("if (%scf) {", insn.id == MIPS_INS_BC1F ? "!" : ""); + dump_instr(i + 1); + printf("goto L%x;}\n", (int32_t)insn.operands[0].imm); + break; + case MIPS_INS_BC1FL: + case MIPS_INS_BC1TL: + { + uint32_t target = text_vaddr + (i + 2) * 4; + printf("if (%scf) {", insn.id == MIPS_INS_BC1FL ? "!" : ""); + dump_instr(i + 1); + printf("goto L%x;}\n", (int32_t)insn.operands[0].imm); + if (!TRACE) { + printf("else goto L%x;\n", target); + } else { + printf("else {printf(\"pc=0x%08x (ignored)\\n\"); goto L%x;}\n", text_vaddr + (i + 1) * 4, target); + } + label_addresses.insert(target); + break; + } + case MIPS_INS_BNEZ: + dump_cond_branch(i, r(insn.operands[0].reg), "!=", "0"); + break; + /*case MIPS_INS_BNEZL: + dump_cond_branch_likely(i, r(insn.operands[0].reg), "!=", "0"); + break;*/ + case MIPS_INS_C: + if (insn.mnemonic == "c.lt.s") { + printf("cf = %s < %s;\n", fr(insn.operands[0].reg), fr(insn.operands[1].reg)); + } else if (insn.mnemonic == "c.le.s") { + printf("cf = %s <= %s;\n", fr(insn.operands[0].reg), fr(insn.operands[1].reg)); + } else if (insn.mnemonic == "c.eq.s") { + printf("cf = %s == %s;\n", fr(insn.operands[0].reg), fr(insn.operands[1].reg)); + } else if (insn.mnemonic == "c.lt.d") { + printf("cf = %s < %s;\n", dr(insn.operands[0].reg), dr(insn.operands[1].reg)); + } else if (insn.mnemonic == "c.le.d") { + printf("cf = %s <= %s;\n", dr(insn.operands[0].reg), dr(insn.operands[1].reg)); + } else if (insn.mnemonic == "c.eq.d") { + printf("cf = %s == %s;\n", dr(insn.operands[0].reg), dr(insn.operands[1].reg)); + } + break; + case MIPS_INS_CVT: + if (insn.mnemonic == "cvt.s.w") { + printf("%s = (int)%s;\n", fr(insn.operands[0].reg), wr(insn.operands[1].reg)); + } else if (insn.mnemonic == "cvt.d.w") { + printf("%s = (int)%s;\n", dr(insn.operands[0].reg), wr(insn.operands[1].reg)); + } else if (insn.mnemonic == "cvt.d.s") { + printf("%s = %s;\n", dr(insn.operands[0].reg), fr(insn.operands[1].reg)); + } else if (insn.mnemonic == "cvt.s.d") { + printf("%s = %s;\n", fr(insn.operands[0].reg), dr(insn.operands[1].reg)); + } else if (insn.mnemonic == "cvt.w.d") { + printf("%s = cvt_w_d(%s);\n", wr(insn.operands[0].reg), dr(insn.operands[1].reg)); + } else if (insn.mnemonic == "cvt.w.s") { + printf("%s = cvt_w_s(%s);\n", wr(insn.operands[0].reg), fr(insn.operands[1].reg)); + } else { + goto unimplemented; + } + break; + case MIPS_INS_CFC1: + assert(insn.operands[1].reg == MIPS_REG_31); + printf("%s = fcsr;\n", r(insn.operands[0].reg)); + break; + case MIPS_INS_CTC1: + assert(insn.operands[1].reg == MIPS_REG_31); + printf("fcsr = %s;\n", r(insn.operands[0].reg)); + break; + case MIPS_INS_DIV: + if (insn.mnemonic == "div.s") { + assert(insn.op_count == 3); + printf("%s = %s / %s;\n", fr(insn.operands[0].reg), fr(insn.operands[1].reg), fr(insn.operands[2].reg)); + } else if (insn.mnemonic == "div.d") { + assert(insn.op_count == 3); + printf("%s = %s / %s;\n", dr(insn.operands[0].reg), dr(insn.operands[1].reg), dr(insn.operands[2].reg)); + } else { + assert(insn.op_count == 2); + printf("lo = (int)%s / (int)%s; ", r(insn.operands[0].reg), r(insn.operands[1].reg)); + printf("hi = (int)%s %% (int)%s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg)); + } + break; + case MIPS_INS_DIVU: + assert(insn.op_count == 2); + printf("lo = %s / %s; ", r(insn.operands[0].reg), r(insn.operands[1].reg)); + printf("hi = %s %% %s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg)); + break; + case MIPS_INS_MOV: + if (insn.mnemonic == "mov.s") { + printf("%s = %s;\n", fr(insn.operands[0].reg), fr(insn.operands[1].reg)); + } else if (insn.mnemonic == "mov.d") { + printf("%s = %s;\n", dr(insn.operands[0].reg), dr(insn.operands[1].reg)); + } else { + goto unimplemented; + } + break; + case MIPS_INS_MUL: + if (insn.mnemonic == "mul.s") { + printf("%s = %s * %s;\n", fr(insn.operands[0].reg), fr(insn.operands[1].reg), fr(insn.operands[2].reg)); + } else if (insn.mnemonic == "mul.d") { + printf("%s = %s * %s;\n", dr(insn.operands[0].reg), dr(insn.operands[1].reg), dr(insn.operands[2].reg)); + } else { + goto unimplemented; + } + break; + case MIPS_INS_NEG: + if (insn.mnemonic == "neg.s") { + printf("%s = -%s;\n", fr(insn.operands[0].reg), fr(insn.operands[1].reg)); + } else if (insn.mnemonic == "neg.d") { + printf("%s = -%s;\n", dr(insn.operands[0].reg), dr(insn.operands[1].reg)); + } else { + printf("%s = -%s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg)); + } + break; + case MIPS_INS_SUB: + if (insn.mnemonic == "sub.s") { + printf("%s = %s - %s;\n", fr(insn.operands[0].reg), fr(insn.operands[1].reg), fr(insn.operands[2].reg)); + } else if (insn.mnemonic == "sub.d") { + printf("%s = %s - %s;\n", dr(insn.operands[0].reg), dr(insn.operands[1].reg), dr(insn.operands[2].reg)); + } else { + goto unimplemented; + } + break; + case MIPS_INS_J: + dump_instr(i + 1); + printf("goto L%x;\n", (uint32_t)insn.operands[0].imm); + break; + case MIPS_INS_JAL: + { + string name; + bool is_extern_function = false; + size_t extern_function_id; + auto it = symbol_names.find(insn.operands[0].imm); + if (it != symbol_names.end()) { + name = it->second; + for (size_t i = 0; i < sizeof(extern_functions) / sizeof(extern_functions[0]); i++) { + if (name == extern_functions[i].name) { + is_extern_function = true; + extern_function_id = i; + break; + } + } + } + dump_instr(i + 1); + if (is_extern_function) { + auto& fn = extern_functions[extern_function_id]; + if (fn.flags & FLAG_VARARG) { + for (int j = 0; j < 4; j++) { + printf("MEM_U32(sp + %d) = %s;\n", j * 4, r(MIPS_REG_A0 + j)); + } + } + char ret_type = fn.params[0]; + if (ret_type != 'v') { + switch (ret_type) { + case 'i': + case 'u': + case 'p': + printf("%s = ", r(MIPS_REG_V0)); + break; + case 'f': + printf("%s = ", fr(MIPS_REG_F0)); + break; + case 'd': + printf("%s = ", dr(MIPS_REG_F0)); + break; + case 'l': + case 'j': + printf("temp64 = "); + break; + } + } + printf("wrapper_%s(", name.c_str()); + bool first = true; + if (!(fn.flags & FLAG_NO_MEM)) { + printf("mem"); + first = false; + } + int pos = 0; + int pos_float = 0; + bool only_floats_so_far = true; + bool needs_sp = false; + for (const char *p = fn.params + 1; *p != '\0'; ++p) { + if (!first) { + printf(", "); + } + first = false; + switch (*p) { + case 't': + printf("trampoline, "); + needs_sp = true; + // fallthrough + case 'i': + case 'u': + case 'p': + only_floats_so_far = false; + if (pos < 4) { + printf("%s", r(MIPS_REG_A0 + pos)); + } else { + printf("MEM_%c32(sp + %d)", *p == 'i' ? 'S' : 'U', pos * 4); + } + ++pos; + break; + case 'f': + if (only_floats_so_far && pos_float < 4) { + printf("%s", fr(MIPS_REG_F12 + pos_float)); + pos_float += 2; + } else if (pos < 4) { + printf("BITCAST_U32_TO_F32(%s)", r(MIPS_REG_A0 + pos)); + } else { + printf("BITCAST_U32_TO_F32(MEM_U32(sp + %d))", pos * 4); + } + ++pos; + break; + case 'd': + if (pos % 1 != 0) { + ++pos; + } + if (only_floats_so_far && pos_float < 4) { + printf("%s", dr(MIPS_REG_F12 + pos_float)); + pos_float += 2; + } else if (pos < 4) { + printf("BITCAST_U64_TO_F64(((uint64_t)%s << 32) | (uint64_t)%s)", r(MIPS_REG_A0 + pos), r(MIPS_REG_A0 + pos + 1)); + } else { + printf("BITCAST_U64_TO_F64(((uint64_t)MEM_U32(sp + %d) << 32) | (uint64_t)MEM_U32(sp + %d))", pos * 4, (pos + 1) * 4); + } + pos += 2; + break; + case 'l': + case 'j': + if (pos % 1 != 0) { + ++pos; + } + only_floats_so_far = false; + if (*p == 'l') { + printf("(int64_t)"); + } + if (pos < 4) { + printf("(((uint64_t)%s << 32) | (uint64_t)%s)", r(MIPS_REG_A0 + pos), r(MIPS_REG_A0 + pos + 1)); + } else { + printf("(((uint64_t)MEM_U32(sp + %d) << 32) | (uint64_t)MEM_U32(sp + %d))", pos * 4, (pos + 1) * 4); + } + pos += 2; + break; + } + } + if ((fn.flags & FLAG_VARARG) || needs_sp) { + printf("%s%s", first ? "" : ", ", r(MIPS_REG_SP)); + } + printf(");\n"); + if (ret_type == 'l' || ret_type == 'j') { + printf("%s = (uint32_t)(temp64 >> 32);\n", r(MIPS_REG_V0)); + printf("%s = (uint32_t)temp64;\n", r(MIPS_REG_V1)); + } + if (!name.empty()) { + //printf("printf(\"%s %%x\\n\", %s);\n", name.c_str(), r(MIPS_REG_A0)); + } + } else { + Function& f = functions.find((uint32_t)insn.operands[0].imm)->second; + if (f.nret == 1) { + printf("v0 = "); + } else if (f.nret == 2) { + printf("temp64 = "); + } + if (!name.empty()) { + //printf("printf(\"%s %%x\\n\", %s);\n", name.c_str(), r(MIPS_REG_A0)); + printf("f_%s", name.c_str()); + } else { + printf("func_%x", (uint32_t)insn.operands[0].imm); + } + printf("(mem, sp"); + if (f.v0_in) { + printf(", %s", r(MIPS_REG_V0)); + } + for (uint32_t i = 0; i < f.nargs; i++) { + printf(", %s", r(MIPS_REG_A0 + i)); + } + printf(");\n"); + if (f.nret == 2) { + printf("%s = (uint32_t)(temp64 >> 32);\n", r(MIPS_REG_V0)); + printf("%s = (uint32_t)temp64;\n", r(MIPS_REG_V1)); + } + } + printf("goto L%x;\n", text_vaddr + (i + 2) * 4); + label_addresses.insert(text_vaddr + (i + 2) * 4); + break; + } + case MIPS_INS_JALR: + printf("fp_dest = %s;\n", r(insn.operands[0].reg)); + dump_instr(i + 1); + printf("temp64 = trampoline(mem, sp, %s, %s, %s, %s, fp_dest);\n", + r(MIPS_REG_A0), r(MIPS_REG_A1), r(MIPS_REG_A2), r(MIPS_REG_A3)); + printf("%s = (uint32_t)(temp64 >> 32);\n", r(MIPS_REG_V0)); + printf("%s = (uint32_t)temp64;\n", r(MIPS_REG_V1)); + printf("goto L%x;\n", text_vaddr + (i + 2) * 4); + label_addresses.insert(text_vaddr + (i + 2) * 4); + break; + case MIPS_INS_JR: + if (insn.jtbl_addr != 0) { + uint32_t jtbl_pos = insn.jtbl_addr - rodata_vaddr; + assert(jtbl_pos < rodata_section_len && jtbl_pos + insn.num_cases * 4 <= rodata_section_len); +#if 1 + printf(";static void *const Lswitch%x[] = {\n", insn.jtbl_addr); + for (uint32_t i = 0; i < insn.num_cases; i++) { + uint32_t dest_addr = read_u32_be(rodata_section + jtbl_pos + i * 4) + gp_value; + printf("&&L%x,\n", dest_addr); + label_addresses.insert(dest_addr); + } + printf("};\n"); + printf("dest = Lswitch%x[%s];\n", insn.jtbl_addr, r(insn.index_reg)); + dump_instr(i + 1); + printf("goto *dest;\n"); +#else + assert(insns[i + 1].id == MIPS_INS_NOP); + printf("switch (%s) {\n", r(insn.index_reg)); + for (uint32_t i = 0; i < insn.num_cases; i++) { + uint32_t dest_addr = read_u32_be(rodata_section + jtbl_pos + i * 4) + gp_value; + printf("case %u: goto L%x;\n", i, dest_addr); + label_addresses.insert(dest_addr); + } + printf("}\n"); +#endif + } else { + if (insn.operands[0].reg != MIPS_REG_RA) { + printf("UNSUPPORTED JR %s %s\n", insn.op_str.c_str(), r(insn.operands[0].reg)); + } else { + dump_instr(i + 1); + switch (find_function(text_vaddr + i * 4)->second.nret) { + case 0: + printf("return;\n"); + break; + case 1: + printf("return v0;\n"); + break; + case 2: + printf("return ((uint64_t)v0 << 32) | v1;\n"); + break; + } + } + } + break; + case MIPS_INS_LB: + printf("%s = MEM_S8(%s + %d);\n", r(insn.operands[0].reg), r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp); + break; + case MIPS_INS_LBU: + printf("%s = MEM_U8(%s + %d);\n", r(insn.operands[0].reg), r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp); + break; + case MIPS_INS_LH: + printf("%s = MEM_S16(%s + %d);\n", r(insn.operands[0].reg), r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp); + break; + case MIPS_INS_LHU: + printf("%s = MEM_U16(%s + %d);\n", r(insn.operands[0].reg), r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp); + break; + case MIPS_INS_LUI: + printf("%s = 0x%x;\n", r(insn.operands[0].reg), ((uint32_t)insn.operands[1].imm) << 16); + break; + case MIPS_INS_LW: + printf("%s = MEM_U32(%s + %d);\n", r(insn.operands[0].reg), r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp); + break; + case MIPS_INS_LWC1: + printf("%s = MEM_U32(%s + %d);\n", wr(insn.operands[0].reg), r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp); + break; + case MIPS_INS_LDC1: + assert((insn.operands[0].reg - MIPS_REG_F0) % 2 == 0); + printf("%s = MEM_U32(%s + %d);\n", wr(insn.operands[0].reg + 1), r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp); + printf("%s = MEM_U32(%s + %d + 4);\n", wr(insn.operands[0].reg), r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp); + break; + case MIPS_INS_LWL: + { + const char *reg = r(insn.operands[0].reg); + printf("%s = %s + %d; ", reg, r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp); + printf("%s = (MEM_U8(%s) << 24) | (MEM_U8(%s + 1) << 16) | (MEM_U8(%s + 2) << 8) | MEM_U8(%s + 3);\n", reg, reg, reg, reg, reg); + break; + } + case MIPS_INS_LWR: + printf("//lwr %s\n", insn.op_str.c_str()); + break; + case MIPS_INS_LI: + if (insn.is_global_got_memop && text_vaddr <= insn.operands[1].imm && insn.operands[1].imm < text_vaddr + text_section_len) { + printf("%s = 0x%x; // function pointer\n", r(insn.operands[0].reg), (uint32_t)insn.operands[1].imm); + label_addresses.insert((uint32_t)insn.operands[1].imm); + } else { + printf("%s = 0x%x;\n", r(insn.operands[0].reg), (uint32_t)insn.operands[1].imm); + } + break; + case MIPS_INS_MFC1: + printf("%s = %s;\n", r(insn.operands[0].reg), wr(insn.operands[1].reg)); + break; + case MIPS_INS_MFHI: + printf("%s = hi;\n", r(insn.operands[0].reg)); + break; + case MIPS_INS_MFLO: + printf("%s = lo;\n", r(insn.operands[0].reg)); + break; + case MIPS_INS_MOVE: + printf("%s = %s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg)); + break; + case MIPS_INS_MTC1: + printf("%s = %s;\n", wr(insn.operands[1].reg), r(insn.operands[0].reg)); + break; + case MIPS_INS_MULT: + printf("lo = %s * %s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg)); + printf("hi = (uint32_t)((int64_t)(int)%s * (int64_t)(int)%s >> 32);\n", r(insn.operands[0].reg), r(insn.operands[1].reg)); + break; + case MIPS_INS_MULTU: + printf("lo = %s * %s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg)); + printf("hi = (uint32_t)((uint64_t)%s * (uint64_t)%s >> 32);\n", r(insn.operands[0].reg), r(insn.operands[1].reg)); + break; + case MIPS_INS_NEGU: + printf("%s = -%s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg)); + break; + case MIPS_INS_NOR: + printf("%s = ~(%s | %s);\n", r(insn.operands[0].reg), r(insn.operands[1].reg), r(insn.operands[2].reg)); + break; + case MIPS_INS_NOT: + printf("%s = ~%s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg)); + break; + case MIPS_INS_OR: + printf("%s = %s | %s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), r(insn.operands[2].reg)); + break; + case MIPS_INS_ORI: + printf("%s = %s | 0x%x;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), (uint32_t)insn.operands[2].imm); + break; + case MIPS_INS_SB: + printf("MEM_U8(%s + %d) = (uint8_t)%s;\n", r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp, r(insn.operands[0].reg)); + break; + case MIPS_INS_SH: + printf("MEM_U16(%s + %d) = (uint16_t)%s;\n", r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp, r(insn.operands[0].reg)); + break; + case MIPS_INS_SLL: + printf("%s = %s << %d;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), (uint32_t)insn.operands[2].imm); + break; + case MIPS_INS_SLLV: + printf("%s = %s << (%s & 0x1f);\n", r(insn.operands[0].reg), r(insn.operands[1].reg), r(insn.operands[2].reg)); + break; + case MIPS_INS_SLT: + printf("%s = (int)%s < (int)%s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), r(insn.operands[2].reg)); + break; + case MIPS_INS_SLTI: + printf("%s = (int)%s < (int)0x%x;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), (uint32_t)insn.operands[2].imm); + break; + case MIPS_INS_SLTIU: + printf("%s = %s < 0x%x;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), (uint32_t)insn.operands[2].imm); + break; + case MIPS_INS_SLTU: + printf("%s = %s < %s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), r(insn.operands[2].reg)); + break; + case MIPS_INS_SRA: + printf("%s = (int)%s >> %d;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), (uint32_t)insn.operands[2].imm); + break; + case MIPS_INS_SRAV: + printf("%s = (int)%s >> (%s & 0x1f);\n", r(insn.operands[0].reg), r(insn.operands[1].reg), r(insn.operands[2].reg)); + break; + case MIPS_INS_SRL: + printf("%s = %s >> %d;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), (uint32_t)insn.operands[2].imm); + break; + case MIPS_INS_SRLV: + printf("%s = %s >> (%s & 0x1f);\n", r(insn.operands[0].reg), r(insn.operands[1].reg), r(insn.operands[2].reg)); + break; + case MIPS_INS_SUBU: + printf("%s = %s - %s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), r(insn.operands[2].reg)); + break; + case MIPS_INS_SW: + printf("MEM_U32(%s + %d) = %s;\n", r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp, r(insn.operands[0].reg)); + break; + case MIPS_INS_SWC1: + printf("MEM_U32(%s + %d) = %s;\n", r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp, wr(insn.operands[0].reg)); + break; + case MIPS_INS_SDC1: + assert((insn.operands[0].reg - MIPS_REG_F0) % 2 == 0); + printf("MEM_U32(%s + %d) = %s;\n", r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp, wr(insn.operands[0].reg + 1)); + printf("MEM_U32(%s + %d + 4) = %s;\n", r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp, wr(insn.operands[0].reg)); + break; + case MIPS_INS_SWL: + for (int i = 0; i < 4; i++) { + printf("MEM_U8(%s + %d + %d) = (uint8_t)(%s >> %d);\n", r(insn.operands[1].mem.base), (int)insn.operands[1].mem.disp, i, r(insn.operands[0].reg), (3 - i) * 8); + } + break; + case MIPS_INS_SWR: + printf("//swr %s\n", insn.op_str.c_str()); + break; + case MIPS_INS_TRUNC: + if (insn.mnemonic == "trunc.w.s") { + printf("%s = (int)%s;\n", wr(insn.operands[0].reg), fr(insn.operands[1].reg)); + } else if (insn.mnemonic == "trunc.w.d") { + printf("%s = (int)%s;\n", wr(insn.operands[0].reg), dr(insn.operands[1].reg)); + } else { + goto unimplemented; + } + break; + case MIPS_INS_XOR: + printf("%s = %s ^ %s;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), r(insn.operands[2].reg)); + break; + case MIPS_INS_XORI: + printf("%s = %s ^ 0x%x;\n", r(insn.operands[0].reg), r(insn.operands[1].reg), (uint32_t)insn.operands[2].imm); + break; + case MIPS_INS_TNE: + printf("assert(%s == %s && \"tne %d\");\n", r(insn.operands[0].reg), r(insn.operands[1].reg), (int)insn.operands[2].imm); + break; + case MIPS_INS_TEQ: + printf("assert(%s != %s && \"teq %d\");\n", r(insn.operands[0].reg), r(insn.operands[1].reg), (int)insn.operands[2].imm); + break; + case MIPS_INS_TGE: + printf("assert((int)%s < (int)%s && \"tge %d\");\n", r(insn.operands[0].reg), r(insn.operands[1].reg), (int)insn.operands[2].imm); + break; + case MIPS_INS_TGEU: + printf("assert(%s < %s && \"tgeu %d\");\n", r(insn.operands[0].reg), r(insn.operands[1].reg), (int)insn.operands[2].imm); + break; + case MIPS_INS_TLT: + printf("assert((int)%s >= (int)%s && \"tlt %d\");\n", r(insn.operands[0].reg), r(insn.operands[1].reg), (int)insn.operands[2].imm); + break; + case MIPS_INS_NOP: + printf("//nop;\n"); + break; + default: + unimplemented: + printf("UNIMPLEMENTED %s %s\n", insn.mnemonic.c_str(), insn.op_str.c_str()); + break; + } +} + +static void inspect_data_function_pointers(vector>& ret, const uint8_t *section, uint32_t section_vaddr, uint32_t len) { + for (uint32_t i = 0; i < len; i += 4) { + uint32_t addr = read_u32_be(section + i); + if (addr == 0x430b00 || addr == 0x433b00) { + // in as1, not function pointers (normal integers) + continue; + } + if (addr == 0x4a0000) { + // in copt + continue; + } + if (section_vaddr + i >= procedure_table_start && section_vaddr + i < procedure_table_start + procedure_table_len) { + // some linking table with a "all" functions, in as1 5.3 + continue; + } + if (addr >= text_vaddr && addr < text_vaddr + text_section_len && addr % 4 == 0) { +#if INSPECT_FUNCTION_POINTERS + fprintf(stderr, "assuming function pointer 0x%x at 0x%x\n", addr, section_vaddr + i); +#endif + ret.push_back(make_pair(section_vaddr + i, addr)); + label_addresses.insert(addr); + functions[addr].referenced_by_function_pointer = true; + } + } +} + +static void dump_function_signature(Function& f, uint32_t vaddr) { + printf("static "); + switch (f.nret) { + case 0: + printf("void "); + break; + case 1: + printf("uint32_t "); + break; + case 2: + printf("uint64_t "); + break; + } + auto name_it = symbol_names.find(vaddr); + if (name_it != symbol_names.end()) { + printf("f_%s", name_it->second.c_str()); + } else { + printf("func_%x", vaddr); + } + printf("(uint8_t *mem, uint32_t sp"); + if (f.v0_in) { + printf(", uint32_t %s", r(MIPS_REG_V0)); + } + for (uint32_t i = 0; i < f.nargs; i++) { + printf(", uint32_t %s", r(MIPS_REG_A0 + i)); + } + printf(")"); +} + +static void dump_c(void) { + map symbol_names_inv; + for (auto& it : symbol_names) { + symbol_names_inv[it.second] = it.first; + } + + uint32_t min_addr = ~0; + uint32_t max_addr = 0; + + if (data_section_len > 0) { + min_addr = MIN(min_addr, data_vaddr); + max_addr = MAX(max_addr, data_vaddr + data_section_len); + } + if (rodata_section_len > 0) { + min_addr = MIN(min_addr, rodata_vaddr); + max_addr = MAX(max_addr, rodata_vaddr + rodata_section_len); + } + if (bss_section_len) { + min_addr = MIN(min_addr, bss_vaddr); + max_addr = MAX(max_addr, bss_vaddr + bss_section_len); + } + + min_addr = min_addr & ~0xfff; + max_addr = (max_addr + 0xfff) & ~0xfff; + + uint32_t stack_bottom = min_addr; + min_addr -= 1 * 1024 * 1024; // 1 MB stack + stack_bottom -= 16; // for main's stack frame + + printf("#include \"header.h\"\n"); + if (conservative) { + printf("static uint32_t s0, s1, s2, s3, s4, s5, s6, s7, fp;\n"); + } + printf("static const uint32_t rodata[] = {\n"); + for (size_t i = 0; i < rodata_section_len; i += 4) { + printf("0x%x,%s", read_u32_be(rodata_section + i), i % 32 == 28 ? "\n" : ""); + } + printf("};\n"); + printf("static const uint32_t data[] = {\n"); + for (size_t i = 0; i < data_section_len; i += 4) { + printf("0x%x,%s", read_u32_be(data_section + i), i % 32 == 28 ? "\n" : ""); + } + printf("};\n"); + + /*if (!data_function_pointers.empty()) { + printf("static const struct { uint32_t orig_addr; void *recompiled_addr; } data_function_pointers[] = {\n"); + for (auto item : data_function_pointers) { + printf("{0x%x, &&L%x},\n", item.first, item.second); + } + printf("};\n"); + }*/ + + if (TRACE) { + printf("static unsigned long long int cnt = 0;\n"); + } + + for (auto& f_it : functions) { + if (insns[addr_to_i(f_it.first)].f_livein != 0) { + // Function is used + dump_function_signature(f_it.second, f_it.first); + printf(";\n"); + } + } + + if (!data_function_pointers.empty() || !li_function_pointers.empty()) { + printf("uint64_t trampoline(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3, uint32_t fp_dest) {\n"); + printf("switch (fp_dest) {\n"); + for (auto& it : functions) { + Function& f = it.second; + if (f.referenced_by_function_pointer) { + printf("case 0x%x: ", it.first); + if (f.nret == 1) { + printf("return (uint64_t)"); + } else if (f.nret == 2) { + printf("return "); + } + auto name_it = symbol_names.find(it.first); + if (name_it != symbol_names.end()) { + printf("f_%s", name_it->second.c_str()); + } else { + printf("func_%x", it.first); + } + printf("(mem, sp"); + for (int i = 0; i < f.nargs; i++) { + printf(", a%d", i); + } + printf(")"); + if (f.nret == 1) { + printf(" << 32"); + } + printf(";"); + if (f.nret == 0) { + printf(" return 0;"); + } + printf("\n"); + } + } + printf("default: abort();"); + printf("}\n"); + printf("}\n"); + } + + printf("int run(uint8_t *mem, int argc, char *argv[]) {\n"); + printf("mmap_initial_data_range(mem, 0x%x, 0x%x);\n", min_addr, max_addr); + + printf("memcpy(mem + 0x%x, rodata, 0x%x);\n", rodata_vaddr, rodata_section_len); + printf("memcpy(mem + 0x%x, data, 0x%x);\n", data_vaddr, data_section_len); + + /*if (!data_function_pointers.empty()) { + if (!LABELS_64_BIT) { + printf("for (int i = 0; i < %d; i++) MEM_U32(data_function_pointers[i].orig_addr) = (uint32_t)(uintptr_t)data_function_pointers[i].recompiled_addr;\n", (int)data_function_pointers.size()); + } else { + printf("for (int i = 0; i < %d; i++) MEM_U32(data_function_pointers[i].orig_addr) = (uint32_t)((uintptr_t)data_function_pointers[i].recompiled_addr - (uintptr_t)&&Loffset);\n", (int)data_function_pointers.size()); + } + }*/ + + printf("MEM_S32(0x%x) = argc;\n", symbol_names_inv.at("__Argc")); + printf("MEM_S32(0x%x) = argc;\n", stack_bottom); + printf("uint32_t al = argc * 4; for (int i = 0; i < argc; i++) al += strlen(argv[i]) + 1;\n"); + printf("uint32_t arg_addr = wrapper_malloc(mem, al);\n"); + printf("MEM_U32(0x%x) = arg_addr;\n", symbol_names_inv.at("__Argv")); + printf("MEM_U32(0x%x) = arg_addr;\n", stack_bottom + 4); + printf("uint32_t arg_strpos = arg_addr + argc * 4;\n"); + printf("for (int i = 0; i < argc; i++) {MEM_U32(arg_addr + i * 4) = arg_strpos; uint32_t p = 0; do { MEM_S8(arg_strpos) = argv[i][p]; ++arg_strpos; } while (argv[i][p++] != '\\0');}\n"); + + printf("setup_libc_data(mem);\n"); + + //printf("gp = 0x%x;\n", gp_value); // only to recreate the outcome when ugen reads uninitialized stack memory + + printf("int ret = f_main(mem, 0x%x", stack_bottom); + Function& main_func = functions[main_addr]; + if (main_func.nargs >= 1) { + printf(", argc"); + } + if (main_func.nargs >= 2) { + printf(", arg_addr"); + } + printf(");\n"); + if (TRACE) { + printf("end: fprintf(stderr, \"cnt: %%llu\\n\", cnt);\n"); + } + printf("return ret;\n"); + printf("}\n"); + + for (auto& f_it : functions) { + Function& f = f_it.second; + uint32_t start_addr = f_it.first; + uint32_t end_addr = f.end_addr; + + if (insns[addr_to_i(start_addr)].f_livein == 0) { + // Non-used function, skip + continue; + } + + printf("\n"); + dump_function_signature(f, start_addr); + printf(" {\n"); + printf("const uint32_t zero = 0;\n"); + if (!conservative) { + printf("uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0,\n"); + printf("t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0,\n"); + printf("s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0;\n"); + } else { + printf("uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0,\n"); + printf("t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000;\n"); + } + printf("uint32_t lo = 0, hi = 0;\n"); + printf("int cf = 0;\n"); + printf("uint64_t temp64;\n"); + printf("uint32_t fp_dest;\n"); + printf("void *dest;\n"); + if (!f.v0_in) { + printf("uint32_t v0 = 0;\n"); + } + for (uint32_t j = f.nargs; j < 4; j++) { + printf("uint32_t %s = 0;\n", r(MIPS_REG_A0 + j)); + } + + for (size_t i = addr_to_i(start_addr), end_i = addr_to_i(end_addr); i < end_i; i++) { + Insn& insn = insns[i]; + uint32_t vaddr = text_vaddr + i * 4; + if (label_addresses.count(vaddr)) { + printf("L%x:\n", vaddr); + } + dump_instr(i); + } + + printf("}\n"); + } + /*for (size_t i = 0; i < insns.size(); i++) { + Insn& insn = insns[i]; + uint32_t vaddr = text_vaddr + i * 4; + auto fn_it = functions.find(vaddr); + if (fn_it != functions.end()) { + Function& f = fn_it->second; + printf("}\n\n"); + switch (f.nret) { + case 0: + printf("void "); + break; + case 1: + printf("uint32_t "); + break; + case 2: + printf("uint64_t "); + break; + } + auto name_it = symbol_names.find(vaddr); + if (name_it != symbol_names.end()) { + printf("%s", name_it->second.c_str()); + } else { + printf("func_%x", vaddr); + } + printf("(uint8_t *mem, uint32_t sp"); + if (f.v0_in) { + printf(", uint32_t %s", r(MIPS_REG_V0)); + } + for (uint32_t i = 0; i < f.nargs; i++) { + printf(", uint32_t %s", r(MIPS_REG_A0 + i)); + } + printf(") {\n"); + printf("const uint32_t zero = 0;\n"); + printf("uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0,\n"); + printf("t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0,\n"); + printf("s6 = 0, s7 = 0, t8 = 0, t9 = 0, gp = 0, fp = 0, s8 = 0, ra = 0;\n"); + printf("uint32_t lo = 0, hi = 0;\n"); + printf("int cf = 0;\n"); + if (!f.v0_in) { + printf("uint32_t v0 = 0;\n"); + } + for (uint32_t j = f.nargs; j < 4; j++) { + printf("uint32_t %s = 0;\n", r(MIPS_REG_A0 + j)); + } + } + if (label_addresses.count(vaddr)) { + printf("L%x:\n", vaddr); + } + dump_instr(i); + }*/ +} + +static void parse_elf(const uint8_t *data, size_t file_len) { + Elf32_Ehdr *ehdr; + Elf32_Shdr *shdr, *str_shdr, *sym_shdr = NULL, *dynsym_shdr, *dynamic_shdr, *reginfo_shdr, *got_shdr, *sym_strtab, *sym_dynstr; + int text_section_index = -1; + int symtab_section_index = -1; + int dynsym_section_index = -1; + int reginfo_section_index = -1; + int dynamic_section_index = -1; + int got_section_index = -1; + int rodata_section_index = -1; + int data_section_index = -1; + int bss_section_index = -1; + uint32_t text_offset = 0; + uint32_t vaddr_adj = 0; + + if (file_len < 4 || data[0] != 0x7f || data[1] != 'E' || data[2] != 'L' || data[3] != 'F') { + fprintf(stderr, "Not an ELF file.\n"); + exit(EXIT_FAILURE); + } + + ehdr = (Elf32_Ehdr *) data; + if (ehdr->e_ident[EI_DATA] != 2 || u16be(ehdr->e_machine) != 8) { + fprintf(stderr, "Not big-endian MIPS.\n"); + exit(EXIT_FAILURE); + } + + if (u16be(ehdr->e_shstrndx) == 0) { + // (We could look at program headers instead in this case.) + fprintf(stderr, "Missing section headers; stripped binaries are not yet supported.\n"); + exit(EXIT_FAILURE); + } + +#define SECTION(index) (Elf32_Shdr *)(data + u32be(ehdr->e_shoff) + (index) * u16be(ehdr->e_shentsize)) +#define STR(strtab, offset) (const char *)(data + u32be(strtab->sh_offset) + offset) + + str_shdr = SECTION(u16be(ehdr->e_shstrndx)); + for (int i = 0; i < u16be(ehdr->e_shnum); i++) { + shdr = SECTION(i); + const char *name = STR(str_shdr, u32be(shdr->sh_name)); + if (strcmp(name, ".text") == 0) { + text_offset = u32be(shdr->sh_offset); + text_vaddr = u32be(shdr->sh_addr); + vaddr_adj = text_vaddr - u32be(shdr->sh_addr); + text_section_len = u32be(shdr->sh_size); + text_section = data + text_offset; + text_section_index = i; + } + if (u32be(shdr->sh_type) == SHT_SYMTAB) { + symtab_section_index = i; + } + if (u32be(shdr->sh_type) == SHT_DYNSYM) { + dynsym_section_index = i; + } + if (u32be(shdr->sh_type) == SHT_MIPS_REGINFO) { + reginfo_section_index = i; + } + if (u32be(shdr->sh_type) == SHT_DYNAMIC) { + dynamic_section_index = i; + } + if (strcmp(name, ".got") == 0) { + got_section_index = i; + } + if (strcmp(name, ".rodata") == 0) { + rodata_section_index = i; + } + if (strcmp(name, ".data") == 0) { + data_section_index = i; + } + if (strcmp(name, ".bss") == 0) { + bss_section_index = i; + } + } + + if (text_section_index == -1) { + fprintf(stderr, "Missing .text section.\n"); + exit(EXIT_FAILURE); + } + + if (symtab_section_index == -1 && dynsym_section_index == -1) { + fprintf(stderr, "Missing .symtab or .dynsym section.\n"); + exit(EXIT_FAILURE); + } + + if (dynsym_section_index != -1) { + if (reginfo_section_index == -1) { + fprintf(stderr, "Missing .reginfo section.\n"); + exit(EXIT_FAILURE); + } + if (dynamic_section_index == -1) { + fprintf(stderr, "Missing .dynamic section.\n"); + exit(EXIT_FAILURE); + } + if (got_section_index == -1) { + fprintf(stderr, "Missing .got section.\n"); + exit(EXIT_FAILURE); + } + } + + if (rodata_section_index != -1) { + shdr = SECTION(rodata_section_index); + uint32_t size = u32be(shdr->sh_size); + rodata_section = data + u32be(shdr->sh_offset); + rodata_section_len = size; + rodata_vaddr = u32be(shdr->sh_addr); + } + + if (data_section_index != -1) { + shdr = SECTION(data_section_index); + uint32_t size = u32be(shdr->sh_size); + data_section = data + u32be(shdr->sh_offset); + data_section_len = size; + data_vaddr = u32be(shdr->sh_addr); + } + + if (bss_section_index != -1) { + shdr = SECTION(bss_section_index); + uint32_t size = u32be(shdr->sh_size); + bss_section_len = size; + bss_vaddr = u32be(shdr->sh_addr); + } + + + // add symbols + if (symtab_section_index != -1) { + sym_shdr = SECTION(symtab_section_index); + sym_strtab = SECTION(u32be(sym_shdr->sh_link)); + assert(0 && ".symtab not supported - use a program with .dynsym instead"); + + assert(u32be(sym_shdr->sh_entsize) == sizeof(Elf32_Sym)); + for (uint32_t i = 0; i < u32be(sym_shdr->sh_size); i += sizeof(Elf32_Sym)) { + Elf32_Sym *sym = (Elf32_Sym *)(data + u32be(sym_shdr->sh_offset) + i); + const char *name = STR(sym_strtab, u32be(sym->st_name)); + uint32_t addr = u32be(sym->st_value); + if (u16be(sym->st_shndx) != text_section_index || name[0] == '.') { + continue; + } + addr += vaddr_adj; + //disasm_label_add(state, name, addr, u32be(sym->st_size), true); + } + } + + if (dynsym_section_index != -1) { + dynsym_shdr = SECTION(dynsym_section_index); + sym_dynstr = SECTION(u32be(dynsym_shdr->sh_link)); + reginfo_shdr = SECTION(reginfo_section_index); + dynamic_shdr = SECTION(dynamic_section_index); + got_shdr = SECTION(got_section_index); + + Elf32_RegInfo *reg_info = (Elf32_RegInfo *)(data + u32be(reginfo_shdr->sh_offset)); + uint32_t gp_base = u32be(reg_info->ri_gp_value); // gp should have this value through the program run + uint32_t got_start = 0; + uint32_t local_got_no = 0; + uint32_t first_got_sym = 0; + uint32_t dynsym_no = 0; // section size can't be used due to alignment 16 padding + + assert(u32be(dynamic_shdr->sh_entsize) == sizeof(Elf32_Dyn)); + for (uint32_t i = 0; i < u32be(dynamic_shdr->sh_size); i += sizeof(Elf32_Dyn)) { + Elf32_Dyn *dyn = (Elf32_Dyn *)(data + u32be(dynamic_shdr->sh_offset) + i); + if (u32be(dyn->d_tag) == DT_PLTGOT) { + got_start = u32be(dyn->d_un.d_ptr); + } + if (u32be(dyn->d_tag) == DT_MIPS_LOCAL_GOTNO) { + local_got_no = u32be(dyn->d_un.d_val); + } + if (u32be(dyn->d_tag) == DT_MIPS_GOTSYM) { + first_got_sym = u32be(dyn->d_un.d_val); + } + if (u32be(dyn->d_tag) == DT_MIPS_SYMTABNO) { + dynsym_no = u32be(dyn->d_un.d_val); + } + } + + assert(got_start != 0); + + // value to add to asm gp offset, for example 32752, if -32752(gp) refers to the first entry in got. + uint32_t gp_adj = gp_base - got_start; + assert(gp_adj < 0x10000); + + assert(u32be(dynsym_shdr->sh_entsize) == sizeof(Elf32_Sym)); + uint32_t global_got_no = dynsym_no - first_got_sym; + //global_got_entry *global_entries = (global_got_entry *)calloc(global_got_no, sizeof(global_got_entry)); + got_globals.resize(global_got_no); + + uint32_t common_start = ~0U; + vector common_order; + + for (uint32_t i = 0; i < dynsym_no; i++) { + Elf32_Sym *sym = (Elf32_Sym *)(data + u32be(dynsym_shdr->sh_offset) + i * sizeof(Elf32_Sym)); + const char *name = STR(sym_dynstr, u32be(sym->st_name)); + uint32_t addr = u32be(sym->st_value); + addr += vaddr_adj; + uint8_t type = ELF32_ST_TYPE(sym->st_info); + if (!strcmp(name, "_procedure_table")) { + procedure_table_start = addr; + } else if (!strcmp(name, "_procedure_table_size")) { + procedure_table_len = 40 * u32be(sym->st_value); + } + if ((u16be(sym->st_shndx) == SHN_MIPS_TEXT && type == STT_FUNC) || + (type == STT_OBJECT && (u16be(sym->st_shndx) == SHN_MIPS_ACOMMON || u16be(sym->st_shndx) == SHN_MIPS_DATA))) + { + //disasm_label_add(state, name, addr, u32be(sym->st_size), true); + if (type == STT_OBJECT) { + } + if (u16be(sym->st_shndx) == SHN_MIPS_ACOMMON) { + if (addr < common_start) { + common_start = addr; + } + common_order.push_back(name); + } + if (type == STT_FUNC) { + add_function(addr); + if (strcmp(name, "main") == 0) { + main_addr = addr; + } + if (strcmp(name, "_mcount") == 0) { + mcount_addr = addr; + } + symbol_names[addr] = name; + } + } + if (i >= first_got_sym) { + uint32_t got_value = u32be(*(uint32_t *)(data + u32be(got_shdr->sh_offset) + (local_got_no + (i - first_got_sym)) * sizeof(uint32_t))); + if (u16be(sym->st_shndx) == SHN_MIPS_TEXT && type == STT_FUNC) { + //got_globals[i - first_got_sym] = got_value; + //label_addresses.insert(got_value); + got_globals[i - first_got_sym] = addr; // to include the 3 instr gp header thing + label_addresses.insert(addr); + } else if (type == STT_OBJECT && (u16be(sym->st_shndx) == SHN_UNDEF || u16be(sym->st_shndx) == SHN_COMMON)) { + // symbol defined externally (for example in libc) + got_globals[i - first_got_sym] = got_value; + } else { + got_globals[i - first_got_sym] = addr; + } + symbol_names[got_globals[i - first_got_sym]] = name; + } + } + + uint32_t *local_entries = (uint32_t *)calloc(local_got_no, sizeof(uint32_t)); + got_locals.resize(local_got_no); + for (uint32_t i = 0; i < local_got_no; i++) { + uint32_t *entry = (uint32_t *)(data + u32be(got_shdr->sh_offset) + i * sizeof(uint32_t)); + got_locals[i] = u32be(*entry); + } + + gp_value = gp_base; + gp_value_adj = gp_adj; + //disasm_got_entries_set(state, gp_base, gp_adj, local_entries, local_got_no, global_entries, global_got_no); + + //out_range.common_start = common_start; + //out_range.common_order.swap(common_order); + } + + // add relocations + for (int i = 0; i < u16be(ehdr->e_shnum); i++) { + Elf32_Rel *prevHi = NULL; + shdr = SECTION(i); + if (u32be(shdr->sh_type) != SHT_REL || u32be(shdr->sh_info) != (uint32_t) text_section_index) + continue; + + if (sym_shdr == NULL) { + fprintf(stderr, "Relocations without .symtab section\n"); + exit(EXIT_FAILURE); + } + + assert(u32be(shdr->sh_link) == (uint32_t) symtab_section_index); + assert(u32be(shdr->sh_entsize) == sizeof(Elf32_Rel)); + for (uint32_t i = 0; i < u32be(shdr->sh_size); i += sizeof(Elf32_Rel)) { + Elf32_Rel *rel = (Elf32_Rel *)(data + u32be(shdr->sh_offset) + i); + uint32_t offset = text_offset + u32be(rel->r_offset); + uint32_t symIndex = ELF32_R_SYM(u32be(rel->r_info)); + uint32_t rtype = ELF32_R_TYPE(u32be(rel->r_info)); + const char *symName = "0"; + if (symIndex != STN_UNDEF) { + Elf32_Sym *sym = (Elf32_Sym *)(data + u32be(sym_shdr->sh_offset) + symIndex * sizeof(Elf32_Sym)); + symName = STR(sym_strtab, u32be(sym->st_name)); + } + + if (rtype == R_MIPS_HI16) { + if (prevHi != NULL) { + fprintf(stderr, "Consecutive R_MIPS_HI16.\n"); + exit(EXIT_FAILURE); + } + prevHi = rel; + continue; + } + if (rtype == R_MIPS_LO16) { + int32_t addend = (int16_t)((data[offset + 2] << 8) + data[offset + 3]); + if (prevHi != NULL) { + uint32_t offset2 = text_offset + u32be(prevHi->r_offset); + addend += (uint32_t)((data[offset2 + 2] << 8) + data[offset2 + 3]) << 16; + //add_reloc(state, offset2, symName, addend, out_range.vaddr); + } + prevHi = NULL; + //add_reloc(state, offset, symName, addend, out_range.vaddr); + } + else if (rtype == R_MIPS_26) { + int32_t addend = (u32be(*(uint32_t*)(data + offset)) & ((1 << 26) - 1)) << 2; + if (addend >= (1 << 27)) { + addend -= 1 << 28; + } + //add_reloc(state, offset, symName, addend, out_range.vaddr); + } + else { + fprintf(stderr, "Bad relocation type %d.\n", rtype); + exit(EXIT_FAILURE); + } + } + if (prevHi != NULL) { + fprintf(stderr, "R_MIPS_HI16 without matching R_MIPS_LO16.\n"); + exit(EXIT_FAILURE); + } + } +} +#undef SECTION +#undef STR + +size_t read_file(const char *file_name, uint8_t **data) { + FILE *in; + uint8_t *in_buf = NULL; + long file_size; + long bytes_read; + in = fopen(file_name, "rb"); + assert(in != nullptr); + + // allocate buffer to read from offset to end of file + fseek(in, 0, SEEK_END); + file_size = ftell(in); + assert(file_size != -1L); + + in_buf = (uint8_t *)malloc(file_size); + fseek(in, 0, SEEK_SET); + + // read bytes + bytes_read = fread(in_buf, 1, file_size, in); + assert(bytes_read == file_size); + + fclose(in); + *data = in_buf; + return bytes_read; +} + +int main(int argc, char *argv[]) { + const char *filename = argv[1]; + if (strcmp(filename, "--conservative") == 0) { + conservative = true; + filename = argv[2]; + } + + uint8_t *data; + size_t len = read_file(filename, &data); + parse_elf(data, len); + assert(cs_open(CS_ARCH_MIPS, (cs_mode)(CS_MODE_MIPS64 | CS_MODE_BIG_ENDIAN), &handle) == CS_ERR_OK); + cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON); + disassemble(); + inspect_data_function_pointers(data_function_pointers, rodata_section, rodata_vaddr, rodata_section_len); + inspect_data_function_pointers(data_function_pointers, data_section, data_vaddr, data_section_len); + pass1(); + pass2(); + pass3(); + pass4(); + pass5(); + pass6(); + //dump(); + dump_c(); + free(data); + cs_close(&handle); +} + diff --git a/ido/ido5.3_recomp/ugen b/ido/ido5.3_recomp/ugen new file mode 100755 index 00000000..7bed21ed Binary files /dev/null and b/ido/ido5.3_recomp/ugen differ diff --git a/ido/ido5.3_recomp/ugen_c.c b/ido/ido5.3_recomp/ugen_c.c new file mode 100644 index 00000000..35b074b7 --- /dev/null +++ b/ido/ido5.3_recomp/ugen_c.c @@ -0,0 +1,133401 @@ +#include "header.h" +static uint32_t s0, s1, s2, s3, s4, s5, s6, s7, fp; +static const uint32_t rodata[] = { +0x77000000,0x7567656e,0x3a20696e,0x7465726e,0x616c2065,0x72726f72,0x206f7065,0x6e696e67, +0x2025733a,0x20202573,0xa000000,0x28756e6b,0x6e6f776e,0x29000000,0x7567656e,0x3a20696e, +0x7465726e,0x616c2065,0x72726f72,0x20777269,0x74696e67,0x2062696e,0x61736d20,0x746f2025, +0x733a2020,0x25730a00,0x28756e6b,0x6e6f776e,0x29000000,0x73756767,0x65737469,0x6f6e3a20, +0x20796f75,0x206d6179,0x2077616e,0x7420746f,0x20757365,0x20544d50,0x44495220,0x746f2063, +0x68616e67,0x65207768,0x65726520,0x74656d70,0x6f726172,0x79206669,0x6c657320,0x61726520, +0x77726974,0x74656e0a,0x0,0x7567656e,0x3a20696e,0x7465726e,0x616c2065,0x72726f72, +0x20777269,0x74696e67,0x2062696e,0x61736d20,0x746f2025,0x733a2020,0x25730a00,0x28756e6b, +0x6e6f776e,0x29000000,0x7567656e,0x3a20696e,0x7465726e,0x616c3a20,0x63616e6e,0x6f74206f, +0x70656e20,0x25730a00,0x7567656e,0x3a20696e,0x7465726e,0x616c3a20,0x63616e6e,0x6f74206f, +0x70656e20,0x25730a00,0x7567656e,0x3a20696e,0x7465726e,0x616c3a20,0x6572726f,0x7220696e, +0x20736565,0x6b0a0000,0x7567656e,0x3a20696e,0x7465726e,0x616c2065,0x72726f72,0x20726561, +0x64696e67,0x2066726f,0x6d202573,0x3a202025,0x730a0000,0x28756e6b,0x6e6f776e,0x29000000, +0x7567656e,0x3a20696e,0x7465726e,0x616c2065,0x72726f72,0x20777269,0x74696e67,0x20746f20, +0x25733a20,0x0,0x25730a00,0x6572726e,0x6f206973,0x2025640a,0x0,0x0, +0x7567656e,0x3a207761,0x726e696e,0x673a206c,0x696e6520,0x25643a20,0x25730a00,0x64697669, +0x64652062,0x79207a65,0x726f0000,0x64697669,0x64652062,0x79207a65,0x726f0000,0xf03f3b68, +0xf03f3668,0xf03f4068,0xf03f4068,0xf03f390c,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068, +0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068, +0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068, +0xf03f35bc,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f3788,0xf03f4054,0xf03f4068,0xf03f4068, +0xf03f4068,0xf03f4068,0xf03f3e74,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f3c54, +0xf03f3ce0,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068, +0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068, +0xf03f4068,0xf03f4068,0xf03f4068,0xf03f3930,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068, +0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068, +0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f3d64,0xf03f3df0,0xf03f4068,0xf03f3aa0, +0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f3f94,0xf03f3ed4,0xf03f3870,0xf03f4068, +0xf03f4068,0xf03f4068,0xf03f3748,0xf03f4068,0xf03f4068,0xf03f3b0c,0xf03f3ea4,0xf03f4068, +0xf03f3a84,0xf03f3c08,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068, +0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068, +0xf03f4068,0xf03f4068,0xf03f3978,0xf03f39d0,0xf03f4068,0xf03f3ad0,0xf03f4068,0xf03f4068, +0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f36d8,0xf03f4068,0xf03f4068,0xf03f4068, +0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068, +0xf03f4068,0xf03f4068,0xf03f4068,0xf03f4068,0xf03f3954,0xf03f41a0,0xf03f40f8,0xf03f40f8, +0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8, +0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8, +0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f4148,0xf03f4148,0xf03f40f8, +0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f4148, +0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8, +0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f40f8,0xf03f4128, +0x24242020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202424,0x5c586169,0x6f2e702c,0x202c206f,0x72727220,0x74797065,0x20696e73,0x74727563, +0x74696f6e,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202061, +0x696f2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x2020202c,0x202c202c,0x202c202c,0x202c202c,0x202c202c, +0x202c202c,0x202c202c,0x202c202c,0x20000000,0xf03f4a70,0xf03f4bf4,0xf03f4cd4,0xf03f5048, +0xf03f5144,0xf03f521c,0xf03f52b4,0xf03f52e8,0xf03f534c,0xf03f5420,0xf03f5498,0xf03f54b4, +0xf03f55c4,0xf03f5328,0x20236669,0x6c65206e,0x616d6520,0x6973206e,0x756c6c20,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20206169,0x6f2e7020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20206169,0x6f2e702c,0x202c202c,0x202c202c,0x20000000,0xf03f5fe8, +0xf03f64dc,0xf03f5c58,0xf03f5cd8,0xf03f5cd8,0xf03f5d4c,0xf03f5efc,0xf03f5efc,0xf03f66e0, +0xf03f5c7c,0xf03f5cf4,0xf03f5c7c,0xf03f5d4c,0xf03f630c,0xf03f5d4c,0xf03f64dc,0xf03f5f90, +0xf03f65e0,0xf03f5c58,0xf03f65a4,0xf03f5d4c,0xf03f66bc,0xf03f5fe8,0xf03f66e0,0xf03f66e0, +0xf03f6294,0xf03f61e0,0xf03f62e8,0xf03f62e8,0xf03f66bc,0xf03f6330,0xf03f64dc,0xf03f66bc, +0xf03f66bc,0xf03f5fe8,0xf03f60d0,0xf03f623c,0xf03f623c,0xf03f66bc,0xf03f66bc,0xf03f6184, +0xf03f6004,0xf03f66bc,0xf03f5efc,0xf03f6294,0xf03f6384,0xf03f6400,0xf03f6400,0xf03f6660, +0xf03f66bc,0xf03f66bc,0xf03f648c,0xf03f648c,0xf03f648c,0xf03f648c,0xf03f5c58,0xf03f66e0, +0xf03f5e20,0xf03f663c,0xf03f6518,0x0,0x6275696c,0x642e7062,0x75696c64,0x2e700000, +0xf03f6d54,0xf03f6d88,0xf03f6e4c,0xf03f6e4c,0xf03f6f00,0xf03f7234,0xf03f7350,0xf03f7234, +0xf03f7234,0xf03f7234,0xf03f7350,0xf03f718c,0xf03f7350,0xf03f718c,0xf03f7234,0xf03f7350, +0xf03f7350,0xf03f7298,0xf03f7234,0xf03f7350,0xf03f7234,0x62616420,0x696e7075,0x7420746f, +0x20756765,0x6e3a2020,0x756e6578,0x70656374,0x65642075,0x2d636f64,0x65202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x6275696c,0x642e7020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x62616420,0x696e7075,0x7420746f, +0x20756765,0x6e3a2020,0x656e642d,0x6f662d66,0x696c6520,0x7365656e,0x20756e65,0x78706563, +0x7465646c,0x79202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x6275696c,0x642e7020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x43616e6e,0x6f742063,0x6f6e7469, +0x6e756520,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x6275696c,0x642e7020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x466f756e,0x64205561,0x6f732075, +0x2d636f64,0x6520696e,0x20756e65,0x78706563,0x74656420,0x73706f74,0x2e205065,0x72686170, +0x73207661,0x6c756520,0x72657475,0x726e6564,0x2066726f,0x6d20616c,0x6c6f6361,0x28332920, +0x77617320,0x6e6f7420,0x61737369,0x676e6564,0x20746f20,0x73696d70,0x6c652076,0x61726961, +0x626c652e,0x20285365,0x6520616c,0x6c6f6361,0x206d616e,0x20706167,0x65294361,0x6e6e6f74, +0x20636f6e,0x74696e75,0x65202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20206275,0x696c642e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x2020496e,0x7465726e, +0x616c2065,0x72726f72,0x20647565,0x20746f20,0x70726f62,0x61626c65,0x20432073,0x6f757263, +0x65206572,0x726f722e,0x20506c65,0x61736520,0x7265636f,0x6d70696c,0x6520796f,0x75722043, +0x20636f64,0x65207769,0x74682074,0x6865202d,0x70726f74,0x6f747970,0x65732066,0x6c616720, +0x746f2063,0x63283129,0x6e6f6e20,0x554a5020,0x752d636f,0x64652069,0x6e206a75,0x6d702074, +0x61626c65,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6275696c,0x642e7020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x4c444546,0x20626566,0x6f726520,0x4c414220,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6275696c,0x642e7020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0xf03fc1c4,0xf03fc1c4,0xf03fc20c,0xf03fc2b8,0xf03fc2b8,0xf03fc2b8, +0xf03fbe14,0xf03fc2b8,0xf03fc2b8,0xf03fc2b8,0xf03fbfc0,0xf03fb500,0xf03fba1c,0xf03fb500, +0xf03f8554,0xf03fba1c,0xf03fa20c,0xf03f7f9c,0xf03f810c,0xf03f8190,0xf03fba1c,0xf03fcb88, +0xf03fcb88,0xf03fb500,0xf03fb500,0xf03fb500,0xf03fb298,0xf03fc900,0xf03f8f9c,0xf03f7ef4, +0xf03f8200,0xf03f7f9c,0xf03f7ef4,0xf03f7ef4,0xf03fa054,0xf03fb410,0xf03fb500,0xf03fb660, +0xf03f8944,0xf03fba1c,0xf03fba1c,0xf03fb970,0xf03f8590,0xf03f81c8,0xf03f842c,0xf03fca78, +0xf03fba1c,0xf03f7f9c,0xf03fcb88,0xf03f8bd4,0xf03f7f38,0xf03fba1c,0xf03fba1c,0xf03f7f9c, +0xf03f7f9c,0xf03fa0c4,0xf03fc440,0xf03fba1c,0xf03fba1c,0xf03fba1c,0xf03f8b54,0xf03fb500, +0xf03fcb88,0xf03fba1c,0xf03fba1c,0xf03fb800,0xf03fb5c4,0xf03fba1c,0xf03f808c,0xf03fba1c, +0xf03fba1c,0xf03fba1c,0xf03fb6f4,0xf03fa630,0xf03fa780,0xf03fcb88,0xf03fba1c,0xf03f8d6c, +0xf03f7ef4,0xf03fc9b0,0xf03fc9a4,0xf03fadac,0xf03fae2c,0xf03fb180,0xf03faf4c,0xf03f8e48, +0xf03fb180,0xf03f7ef4,0xf03fba1c,0xf03fba1c,0xf03f7ef4,0xf03fb500,0xf03f8200,0xf03fb180, +0xf03f7f9c,0xf03f7ef4,0xf03fba1c,0xf03fba1c,0xf03fba1c,0xf03fa168,0xf03fcb88,0xf03f9da0, +0xf03fba1c,0xf03f9d68,0xf03fba1c,0xf03fb544,0xf03fba1c,0xf03f7ef4,0xf03fb500,0xf03fb500, +0xf03f8334,0xf03f9da0,0xf03f88fc,0xf03f9da0,0xf03fc7fc,0xf03f8200,0xf03fba1c,0xf03f8a9c, +0xf03facac,0xf03fab08,0xf03faa5c,0xf03fb500,0xf03f9fcc,0xf03fa9b4,0xf03f80ec,0xf03fb500, +0xf03fba1c,0xf03fba1c,0xf03fba1c,0xf03fb500,0xf03fb500,0xf03f8010,0xf03f7ef4,0xf03f8158, +0xf03fa20c,0xf03fa20c,0xf03fba1c,0xf03fc780,0xf03f8bd4,0xf03fb308,0xf03fb308,0xf03fb308, +0xf03fb308,0xf03fb308,0xf03fb308,0xf03fb500,0xf03f7ef4,0xf03f8af0,0xf03f8a64,0xf03fba1c, +0xf03f8a28,0xf03f9590,0xf03fba1c,0xf03fc8ec,0xf03fc9ec,0xf03fca40,0xf03fcb88,0xf03fcb88, +0xf03fb914,0xf03fa8ec,0xf03fb124,0xf03f7fb8,0xf03fa054,0xf03f7f9c,0xf03f7f9c,0x0, +0x496e7375,0x66666963,0x69616e74,0x206d656d,0x6f727920,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x656d6974,0x2e702020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x496e7375,0x66666963,0x69616e74,0x206d656d,0x6f727920,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x656d6974,0x2e702020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x6c6f6361,0x6c206c61,0x62656c20,0x6f757420,0x6f662072,0x616e6765,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x656d6974,0x2e702020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x656d6974,0x5f726f62,0x3a20656d,0x69745f72,0x61623a20,0x656d6974,0x5f726162,0x3a20656d, +0x69745f72,0x6c6c623a,0x20656d69,0x745f7261,0x3a20656d,0x69745f72,0x693a2020,0x20202020, +0x20202020,0x20202020,0x20202065,0x6d69745f,0x7266693a,0x20656d69,0x745f726c,0x3a20656d, +0x69745f72,0x72723a20,0x656d6974,0x5f727269,0x3a20656d,0x69745f72,0x7272693a,0x20656d69, +0x745f7272,0x3a20656d,0x69745f61,0x3a20656d,0x69745f72,0x3a20656d,0x69745f69,0x3a20656d, +0x69745f72,0x726c3a20,0x656d6974,0x5f72726c,0x6c3a2065,0x6d69745f,0x726c3a20,0x656d6974, +0x5f726c6c,0x3a20656d,0x69745f6c,0x3a20656d,0x69745f6c,0x6c3a2065,0x6d69745f,0x72696c3a, +0x20656d69,0x745f7269,0x6c6c3a20,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0xf04020dc,0xf0402108,0xf0403850,0xf04038d4,0xf04038d4, +0xf04038a8,0x0,0x0,0x0,0xf0404cec,0xf0404e04,0xf0404e2c,0xf0404e54, +0xf0404d14,0xf0404d3c,0xf0404e54,0xf0404db4,0xf0404ddc,0xf0404e54,0xf0404d64,0xf0404d8c, +0xf0404e54,0xf0404cc4,0xf0405614,0xf0405748,0xf0405774,0xf04057a0,0xf0405640,0xf040566c, +0xf04057a0,0xf04056f0,0xf040571c,0xf04057a0,0xf0405698,0xf04056c4,0xf04057a0,0xf04055e8, +0xf0405dc4,0xf0405dec,0xf0405d74,0xf0405d9c,0xf0405d4c,0xf0405d24,0xf0406358,0xf0406380, +0xf0406308,0xf0406330,0xf04062e0,0xf04062b8,0xf0407aec,0xf0407aec,0xf0407aac,0xf0407b8c, +0xf0407bdc,0xf0407bb4,0xf0407c04,0xf0407bb4,0xf0407ca4,0xf0407c54,0xf0407c2c,0xf0407b3c, +0xf0407c7c,0xf0407c2c,0xf0407b8c,0xf0407b64,0xf0407b64,0xf0407b14,0xf0407b14,0xf0407ca4, +0xf0407ca4,0xf0407aac,0xf0407aec,0xf0407b14,0xf040951c,0xf040951c,0xf0409258,0xf0409430, +0xf0409344,0xf04095dc,0xf0409644,0xf0409610,0xf0409678,0xf0409610,0xf0409748,0xf04096e0, +0xf04096ac,0xf0409584,0xf0409714,0xf04096ac,0xf04095dc,0xf04095b0,0xf04095b0,0xf0409550, +0xf0409550,0xf0409748,0xf0409748,0xf0409344,0xf040951c,0xf0409550,0x0,0x0, +0x73746163,0x6b206c69,0x6d697420,0x626c6f63,0x6b206e75,0x6d626572,0x206e6f74,0x20666f75, +0x6e642020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x656e7472,0x795f6578,0x69742e70,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x66696c65,0x206e756d,0x62657220,0x6d697373, +0x696e6720,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x656e7472,0x795f6578,0x69742e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x696c6c65,0x67616c20,0x64617461,0x20747970, +0x65202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x6576616c,0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x65787465,0x6e646564,0x20666c6f,0x6174696e, +0x6720706f,0x696e7420,0x6e6f7420,0x79657420,0x73757070,0x6f727465,0x64202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x6576616c,0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0xf040ced8,0xf040ced0,0xf040cff0,0xf040cff0, +0xf040cee0,0x696c6c65,0x67616c20,0x64617461,0x20747970,0x65202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c,0x2e702020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x65787465,0x6e646564,0x20666c6f,0x6174696e,0x6720706f,0x696e7420,0x6e6f7420, +0x79657420,0x73757070,0x6f727465,0x64202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c,0x2e702020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0xf040d17c,0xf040d164,0xf040d2a4,0xf040d2a4,0xf040d194,0xf040d470,0xf040d510, +0xf040d4c0,0xf040d59c,0xf040d63c,0xf040d5ec,0xf040d7f0,0xf040daec,0xf040daec,0xf040daec, +0xf040daec,0xf040d7f0,0xf040d7f0,0xf040d7f0,0xf040d7f0,0xf040daec,0xf040d7dc,0xf040dcc4, +0xf040e128,0xf040e128,0xf040e128,0xf040e128,0xf040dcc4,0xf040dcc4,0xf040dcc4,0xf040dcc4, +0xf040e128,0xf040dcb0,0x756e6b6e,0x6f776e20,0x74656d70,0x6f726172,0x79207479,0x70652020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c,0x2e702020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x65787465,0x6e646564,0x20666c6f,0x6174696e,0x6720706f,0x696e7420, +0x74797065,0x206e6f74,0x20796574,0x20737570,0x706f7274,0x65642020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c,0x2e702020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0xf040e550,0xf040e5f4,0xf040e550,0xf040e550,0xf040e550,0xf040e5a0, +0xf040e550,0xf040e5a0,0xf040e550,0xf040e5f4,0xf040e550,0xf040e5f4,0xf040e3d0,0xf040e3d0, +0xf040e550,0xf040e5a0,0xf040e440,0x74726565,0x206e6f64,0x65206e6f,0x74206576,0x616c7561, +0x74656420,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c, +0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x74726565,0x206e6f64,0x65206e6f,0x74206576,0x616c7561, +0x74656420,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c, +0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x74726565,0x206e6f64,0x65206e6f,0x74206576,0x616c7561, +0x74656420,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c, +0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x756e6b6e,0x6f776e20,0x72656769,0x73746572,0x20747970, +0x65202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c, +0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x696c6c65,0x67616c20,0x64617461,0x20747970,0x6520696e, +0x206c6f61,0x642f7374,0x6f726520,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c, +0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x696c6c65,0x67616c20,0x73697a65,0x20696e20,0x6c6f6164, +0x2f73746f,0x72652020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c, +0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x696c6c65,0x67616c20,0x73697a65,0x20696e20,0x6c6f6164, +0x2f73746f,0x72652020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c, +0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x696c6c65,0x67616c20,0x73697a65,0x20696e20,0x6c6f6164, +0x2f73746f,0x72652020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c, +0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x696c6c65,0x67616c20,0x73697a65,0x20696e20,0x6c6f6164, +0x2f73746f,0x72652020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c, +0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x696c6c65,0x67616c20,0x73697a65,0x20696e20,0x6c6f6164, +0x2f73746f,0x72652020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c, +0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x696c6c65,0x67616c20,0x73697a65,0x20696e20,0x6c6f6164, +0x2f73746f,0x72652020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c, +0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0xf0410038,0xf04101e8,0xf0410038,0xf0410038,0xf0410038, +0xf040fd28,0xf040fa48,0xf040fe9c,0xf040fba4,0xf0410038,0xf0410038,0xf04101e8,0xf04101dc, +0xf04101d0,0xf0410038,0xf0410038,0x696c6c65,0x67616c20,0x6d656d6f,0x72792074,0x79706520, +0x696e206c,0x6f61642f,0x73746f72,0x65202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c, +0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0xf0410378,0xf0410378,0xf0410658,0xf04104f8,0xf0410624, +0x6576616c,0x2e70556e,0x6b6e6f77,0x6e206d65,0x6d6f7279,0x20747970,0x6520696e,0x204c4441, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20206576,0x616c2e70,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x2020556e,0x6b6e6f77,0x6e206d65,0x6d6f7279,0x20747970,0x6520696e,0x204c4441, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20206576,0x616c2e70,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20206576,0x616c2e70,0xf0412d38,0xf0412d4c,0xf0412da4,0xf0412d60,0xf0412e14, +0xf0412e14,0xf0412f40,0xf0412f08,0xf04130cc,0xf04130cc,0xf04131dc,0xf04131b0,0xf0413dc8, +0xf0413a58,0xf0413aa0,0xf0413b88,0x696c6c65,0x67616c20,0x696e6469,0x72656374,0x206f7063, +0x6f646520,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x6576616c, +0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0xf0413ebc,0xf0413f64,0xf0413f64,0xf0413f8c,0xf0413f8c, +0xf0413f8c,0xf0413f64,0xf0413f64,0xf0413f8c,0xf0413f8c,0xf0413ebc,0xf0413ebc,0xf0413f8c, +0xf0413ebc,0x6576616c,0x2e700000,0xf04143d8,0xf0414520,0xf0414520,0xf0414558,0xf0414558, +0xf0414558,0xf04144e8,0xf04144e8,0xf0414558,0xf0414558,0xf0414460,0xf0414d00,0xf0414be4, +0xf0414db8,0xf0414be4,0xf0415c0c,0xf0415c04,0xf0415c58,0xf0415c50,0xf0415cb0,0xf0415cc0, +0xf0415cc0,0xf0415cc0,0xf0415cb0,0xf0415c98,0xf0415ca0,0xf0415ca8,0xf0415cb0,0xf0415cc0, +0xf0415cc0,0xf0415cc0,0xf0415cb8,0xf0415cc0,0xf0415cc0,0xf0415ca8,0xf0415d10,0xf0415d20, +0xf0415d20,0xf0415d20,0xf0415d10,0xf0415cf8,0xf0415d00,0xf0415d08,0xf0415d10,0xf0415d20, +0xf0415d20,0xf0415d20,0xf0415d20,0xf0415d18,0xf0415d20,0xf0415d08,0xf0415bd0,0xf0415d28, +0xf0415d28,0xf0415d28,0xf0415bd0,0xf0415c1c,0xf0415bd0,0xf0415c1c,0xf0415bd0,0xf0415d28, +0xf0415d28,0xf0415d28,0xf0415cc8,0xf0415c68,0xf0415d28,0xf0415c1c,0xf0415d5c,0xf0415d7c, +0xf0415d7c,0xf0415d7c,0xf0415d5c,0xf0415d6c,0xf0415d64,0xf0415d74,0xf0415d5c,0xf0415ddc, +0xf0415dfc,0xf0415dfc,0xf0415dfc,0xf0415ddc,0xf0415dec,0xf0415de4,0xf0415df4,0xf0415ddc, +0x20726566,0x5f636f75,0x6e74203d,0x20207265,0x67203d20,0x206f7063,0x203d2063,0x75727265, +0x6e745f6c,0x696e6520,0x3d20756e,0x65787065,0x63746564,0x20752d63,0x6f646520,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20206576,0x616c2e70, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x2020302e,0x30202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x2020696c,0x6c656761,0x6c207479,0x70652072,0x65747970,0x696e6720, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20206576,0x616c2e70, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x2020696c,0x6c656761,0x6c207479,0x70652063,0x6f6e7665,0x7273696f, +0x6e732020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20206576,0x616c2e70, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x2020556e,0x6b6e6f77,0x6e206d65,0x6d6f7279,0x20747970,0x6520696e, +0x204c4441,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20206576,0x616c2e70, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x2020756e,0x6b6e6f77,0x6e206d65,0x6d6f7279,0x20747970,0x6520696e, +0x20444546,0x2075636f,0x64652020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20206576,0x616c2e70, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20206765,0x6e657261,0x74655f61,0x6761696e,0xf0416be0,0xf0416c08, +0xf0416be0,0xf0416c08,0xf0416c08,0xf0416c08,0xf0416c08,0xf0416bd8,0xf0416bd0,0xf0417140, +0xf0416eec,0xf0417194,0xf0417194,0xf0417194,0xf0416f20,0xf041aaf4,0xf041aaf4,0xf041ad7c, +0xf041ad1c,0xf041b11c,0xf041b2a0,0xf041d63c,0xf04168cc,0xf041b2a0,0xf041c850,0xf041d63c, +0xf04161b0,0xf041c508,0xf041d63c,0xf041c58c,0xf0419034,0xf041c12c,0xf041c12c,0xf041c090, +0xf041c060,0xf041cf3c,0xf041c3f4,0xf041d63c,0xf041c4f4,0xf041d63c,0xf041d63c,0xf041d63c, +0xf041837c,0xf041bb8c,0xf041b9cc,0xf041d63c,0xf0416ea8,0xf041d63c,0xf041b2a0,0xf041d63c, +0xf0416974,0xf041c534,0xf0416200,0xf041d63c,0xf041b2a0,0xf041d63c,0xf041d63c,0xf0418d24, +0xf041d63c,0xf041b2a0,0xf041b2a0,0xf041d63c,0xf041d63c,0xf041865c,0xf041d63c,0xf041c230, +0xf041c230,0xf041c230,0xf0418fd8,0xf041d63c,0xf041d63c,0xf041c230,0xf041c230,0xf0419708, +0xf041d63c,0xf041c230,0xf041d63c,0xf041d63c,0xf041d63c,0xf041b2a0,0xf0419708,0xf0419ef4, +0xf0419ef4,0xf041d63c,0xf041d63c,0xf04173f4,0xf041d63c,0xf041cfac,0xf041d63c,0xf041ae9c, +0xf041aa9c,0xf041d63c,0xf0419080,0xf041d63c,0xf041cc70,0xf041d63c,0xf041b2a0,0xf041b2a0, +0xf041d63c,0xf041af14,0xf0415fc4,0xf0419414,0xf041d63c,0xf041d63c,0xf0418840,0xf0418840, +0xf041b768,0xf041c25c,0xf041d63c,0xf0417d20,0xf041b2a0,0xf0417b68,0xf041d63c,0xf041b11c, +0xf041b2a0,0xf041c4e0,0xf041afac,0xf041d63c,0xf0416088,0xf0417ea0,0xf041d63c,0xf0417d20, +0xf041d63c,0xf04172b4,0xf041b2a0,0xf041d63c,0xf041d63c,0xf041d63c,0xf041d63c,0xf041c560, +0xf04182a0,0xf041d63c,0xf041d63c,0xf041d63c,0xf041b2a0,0xf041b2a0,0xf041d0f0,0xf041d63c, +0xf041cfdc,0xf0416e54,0xf041d63c,0xf041d8f8,0xf041754c,0xf041ccfc,0xf041b2a0,0xf041d63c, +0xf0418cf0,0xf041cda0,0xf041cda0,0xf041cda0,0xf041cda0,0xf041cda0,0xf041cda0,0xf041bdc0, +0xf041d63c,0xf0418d58,0xf04160c8,0xf041d63c,0xf04172e0,0xf041c288,0xf041b2a0,0xf041d63c, +0xf041d088,0xf041d0bc,0xf041d63c,0xf041d63c,0xf0419c94,0xf041a718,0xf041932c,0xf0416e7c, +0xf041837c,0x34323934,0x39363732,0x39362e30,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x32313437,0x34383336,0x34382e30,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x39323233,0x33373230,0x33363835,0x34373735,0x3830382e,0x30202020,0x20202020, +0x20202020,0x0,0x0,0x0,0x496e7375,0x66666963,0x69616e74,0x206d656d, +0x6f727920,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x6c616265,0x6c6f7074,0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x204c204f,0x55543a20,0x4c20494e,0x3a547265, +0x65206475,0x6d702061,0x66746572,0x20326e64,0x206c6162,0x656c2070,0x68617365,0x3a547265, +0x65206475,0x6d702061,0x66746572,0x2063726f,0x7373206a,0x756d7069,0x6e675472,0x65652064, +0x756d7020,0x61667465,0x72203173,0x74206c61,0x62656c20,0x70686173,0x653a5472,0x65652064, +0x756d7020,0x61667465,0x72203173,0x74206c6f,0x63616c6f,0x70743a00,0x0,0x0, +0x496e7375,0x66666963,0x69616e74,0x206d656d,0x6f727920,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x6c69745f,0x6d67722e,0x70202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x696c6c65,0x67616c20,0x64617461,0x20747970,0x65202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x6c69745f,0x6d67722e,0x70202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0xf04219f4,0xf0421aac,0xf0421aac,0xf0421a58,0xf0421a74,0xf0421a90,0x0,0x0, +0x756e6b6e,0x6f776e20,0x752d636f,0x64652020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x6c6f6f70,0x5f686561,0x6465722e,0x70202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0xf04225dc,0xf0422620,0xf0422928,0xf0422928,0xf0422620,0xf0422620,0xf04221c0,0xf0422710, +0xf0422710,0xf04226f0,0xf04226f0,0xf04227f8,0xf04227f8,0xf0421f8c,0xf0422690,0xf0422620, +0xf0422928,0xf0422928,0xf0422160,0xf0422928,0xf0422620,0xf0422620,0xf0422928,0xf0422928, +0xf04220c8,0xf0422928,0xf0422770,0xf0422770,0xf0422770,0xf04221a0,0xf0422928,0xf0422928, +0xf0422770,0xf0422770,0xf0422214,0xf0422928,0xf0422770,0xf0422928,0xf0422928,0xf0422928, +0xf0422620,0xf0422370,0xf0422440,0xf04222ac,0xf0422928,0xf0422928,0xf0422800,0xf0422928, +0xf0422a90,0xf0422928,0xf04225d4,0xf042253c,0xf0422928,0xf04221e0,0xf0422928,0xf0422928, +0xf0422928,0xf0422620,0xf0422620,0xf0422928,0xf04225dc,0xf0422928,0xf0421d10,0xf0422928, +0xf0422928,0xf0422620,0xf0422620,0xf0422620,0xf0422770,0xf0422928,0xf0422928,0xf0422620, +0xf0421f70,0xf0422928,0xf04225dc,0xf0422620,0xf04227f8,0xf04225dc,0xf0422928,0xf0422928, +0xf0421ebc,0xf0422928,0xf0422928,0xf0422928,0xf0422928,0xf0422620,0xf0422928,0xf0422928, +0xf0422928,0xf0422928,0xf0422690,0xf0422928,0xf0422928,0xf0422928,0xf0422928,0xf0422620, +0xf0422620,0xf0421dd0,0xf0422928,0xf0422620,0xf0422928,0xf0422160,0xf0422690,0xf0422928, +0xf0422180,0xf0422928,0xf0422928,0xf0422928,0xf04227f8,0xf0422620,0x756e6b6e,0x6f776e20, +0x752d636f,0x64652020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x6c6f6f70,0x5f686561,0x6465722e,0x70202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0xf0422b60,0xf0422ba0, +0xf0422bdc,0xf0422bdc,0xf0422ba0,0xf0422ba0,0xf0422b60,0xf0422b60,0xf0422b60,0xf0422b60, +0xf0422b60,0xf0422b58,0xf0422b60,0xf0422ba0,0xf0422bdc,0xf0422bdc,0xf0422ba0,0xf0422bdc, +0xf0422ba0,0xf0422ba0,0xf0422bdc,0xf0422bdc,0xf0422b60,0xf0422bdc,0xf0422ba0,0xf0422ba0, +0xf0422ba0,0xf0422b60,0xf0422bdc,0xf0422bdc,0xf0422ba0,0xf0422ba0,0xf0422b60,0xf0422bdc, +0xf0422ba0,0xf0422bdc,0xf0422bdc,0xf0422bdc,0xf0422ba0,0xf0422b60,0xf0422ba0,0xf0422ba0, +0xf0422b58,0xf0422b58,0xf0422bdc,0xf0422b58,0xf0422bdc,0xf0422bdc,0xf0422bdc,0xf0422ba0, +0xf0422ba0,0xf0422bdc,0xf0422b60,0xf0422bdc,0xf0422b58,0xf0422bdc,0xf0422bdc,0xf0422ba0, +0xf0422ba0,0xf0422ba0,0xf0422ba0,0xf0422bdc,0xf0422bdc,0xf0422ba0,0xf0422b58,0xf0422bdc, +0xf0422b60,0xf0422ba0,0xf0422bdc,0xf0422b60,0xf0422bdc,0xf0422bdc,0xf0422b60,0xf0422bdc, +0xf0422bdc,0xf0422bdc,0xf0422bdc,0xf0422ba0,0xf0422bdc,0xf0422bdc,0xf0422bdc,0xf0422bdc, +0xf0422b60,0xf0422bdc,0xf0422bdc,0xf0422bdc,0xf0422bdc,0xf0422ba0,0xf0422ba0,0xf0422b60, +0xf0422bdc,0xf0422ba0,0xf0422bdc,0xf0422ba0,0xf0422b60,0xf0422bdc,0xf0422b80,0x0, +0x6f70742e,0x70000000,0xf0423aec,0xf0423b24,0xf0423b90,0xf0423b90,0xf0423b90,0x0, +0x4e656564,0x65642072,0x65676973,0x7465723a,0x20616c6c,0x20706572,0x6d616e74,0x656e746c, +0x7920616c,0x6c6f6361,0x7465643a,0x20696d70,0x6f737369,0x626c6520,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x2c207573,0x61676520,0x3a20206b,0x696e6420,0x72656769,0x73746572,0x20726567,0x5f6c6973, +0x743a2072,0x65676973,0x74657220,0x636f6e74,0x656e7420,0x69732065,0x6d707479,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202072,0x65675f6d,0x67722e70,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x696c6c65,0x67616c20,0x72656769,0x73746572,0x20747970,0x65202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202072,0x65675f6d,0x67722e70,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x72656769,0x73746572,0x206b696e,0x6420203d,0x20726567,0x203d2000,0xf0425954, +0xf042597c,0xf04259a4,0xf04259cc,0xf04259cc,0xf0425954,0xf0425954,0x72656769,0x73746572, +0x206e6f74,0x206f6e20,0x75736564,0x2f667265,0x65206c69,0x73742020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x66702072,0x65676973, +0x74657220,0x6e6f7420,0x6f6e2075,0x7365642f,0x66726565,0x206c6973,0x74202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x72656769,0x73746572, +0x206e6f74,0x206f6e20,0x75736564,0x2f667265,0x65206c69,0x73742020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x72656769,0x73746572, +0x20636f6e,0x74656e74,0x20697320,0x656d7074,0x79202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x75736167,0x6520636f, +0x756e7420,0x69732030,0x2c206361,0x6e6e6f74,0x20646563,0x72656d65,0x6e742020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x75736167,0x6520636f, +0x756e7420,0x69732030,0x2c206361,0x6e6e6f74,0x20646563,0x72656d65,0x6e742020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x72656769,0x73746572, +0x20746f20,0x62652072,0x656d6f76,0x6564206e,0x6f74206f,0x6e206672,0x6565206c,0x69737420, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x72656769,0x73746572, +0x20746f20,0x62652072,0x656d6f76,0x6564206e,0x6f74206f,0x6e207573,0x6564206c,0x69737420, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x66702072,0x65676973, +0x74657220,0x746f2062,0x65207265,0x6d6f7665,0x64206e6f,0x74206f6e,0x20667265,0x65206c69, +0x73742020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x72656769,0x73746572, +0x206e6f74,0x20667265,0x65202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x66702072,0x65676973, +0x74657220,0x6e6f7420,0x66726565,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x72656769,0x73746572, +0x206e6f74,0x20667265,0x65202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x72656769,0x73746572, +0x206e6f74,0x20667265,0x65202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x66702072,0x65676973, +0x74657220,0x6e6f7420,0x66726565,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x66702072,0x65676973, +0x74657273,0x206c6566,0x7420696e,0x20757365,0x20617420,0x62622062,0x6f756e64,0x61727920, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x67702072,0x65676973, +0x74657273,0x206c6566,0x7420696e,0x20757365,0x20617420,0x62622062,0x6f756e64,0x61727920, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x636f756c,0x64206e6f, +0x74207265,0x6d6f7665,0x20726567,0x69737465,0x72206672,0x6f6d2066,0x705f7265,0x67735f75, +0x73656420,0x6c697374,0x21202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x636f756c,0x64206e6f, +0x74207265,0x6d6f7665,0x20726567,0x69737465,0x72206672,0x6f6d2072,0x6567735f,0x75736564, +0x206c6973,0x74212020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7265675f,0x6d67722e,0x70202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x0,0x0, +0x20202020,0x20202020,0x20202020,0x20202020,0x2c206c69,0x6e652020,0x3a202028,0x7567656e, +0x20696e74,0x65726e61,0x6c206669,0x6c65203a,0x20617420,0x796f7572,0x20736f75,0x72636520, +0x6c696e65,0x20756765,0x6e3a2041,0x73736572,0x74696f6e,0x20666169,0x6c656420,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202072,0x65706f72, +0x742e7020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202000,0x0,0x696c6c65,0x67616c20,0x64617461,0x20617265, +0x61207370,0x65636966,0x69656420,0x666f7220,0x73796d62,0x6f6c2020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x73796d62,0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x496e7375,0x66666963,0x69616e74,0x206d656d, +0x6f727920,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x73796d62,0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x696c6c65,0x67616c20,0x73796d62,0x6f6c2074, +0x79706520,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x73796d62,0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x45786365,0x7074696f,0x6e207661,0x72696162, +0x6c652073,0x796d626f,0x6c206e6f,0x7420666f,0x756e6420,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x73796d62,0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x496e7375,0x66666963,0x69616e74,0x206d656d, +0x6f727920,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x73796d62,0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x616c6961,0x73656420,0x73796d62,0x6f6c206e, +0x6f742066,0x6f756e64,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x73796d62,0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0xf0429330,0xf0429960,0xf0429960,0xf0429634, +0xf0429960,0xf0429960,0xf0429634,0xf0429960,0xf0429960,0xf0429634,0xf0429800,0xf0429784, +0xf0429960,0xf0429634,0xf0429ab8,0x696e6974,0x69616c69,0x7a617469,0x6f6e206f,0x66206f76, +0x65726c61,0x7070696e,0x67206461,0x74612e20,0x4e6f7420,0x68616e64,0x6c656420,0x636f7272, +0x6563746c,0x79202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x73796d62, +0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x496e6974,0x69616c69,0x7a617469,0x6f6e206f,0x66206f76, +0x65726c61,0x7070696e,0x67206461,0x74612e20,0x4e6f7420,0x68616e64,0x6c656420,0x636f7272, +0x6563746c,0x79202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x73796d62, +0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x496c6c65,0x67616c20,0x636f6d70,0x6c65785f,0x696e6974, +0x3a202069,0x6c6c6567,0x616c206f,0x7665726c,0x61707069,0x6e672046,0x4f525452,0x414e2044, +0x41544120,0x73746174,0x656d656e,0x74733f20,0x20202020,0x20202020,0x20202020,0x73796d62, +0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x696c6c65,0x67616c20,0x696e6974,0x73202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x73796d62, +0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x496e7375,0x66666963,0x69616e74,0x206d656d,0x6f727920, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x73796d62, +0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0xf042a8a4,0xf042a918,0xf042a8a4,0xf042a8a4,0xf042a918, +0xf042a918,0xf042a8a4,0xf042a8a4,0xf042a918,0xf042a918,0xf042a8a4,0x73796d62,0x6f6c2e70, +0xf042ae8c,0xf042aee0,0xf042aefc,0xf042af18,0xf042af34,0xf042af50,0x696c6c65,0x67616c20, +0x76616c75,0x6520696e,0x202e7370,0x61636520,0x2d20696c,0x6c656761,0x6c20696e,0x69746961, +0x6c697a61,0x74696f6e,0x20626f75,0x6e647320,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x73796d62,0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x466f7274,0x72616e20, +0x6572726f,0x72202d20,0x4475706c,0x69636174,0x6520696e,0x69746961,0x6c697a61,0x74696f6e, +0x202d2d20,0x696c6c65,0x67616c20,0x44415441,0x20737461,0x74656d65,0x6e747320,0x20202020, +0x20202020,0x20202020,0x73796d62,0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x496c6c65,0x67616c20, +0x73686966,0x7420696e,0x20494e49,0x542e2053,0x68696674,0x2069676e,0x6f726564,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x73796d62,0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x696c6c65,0x67616c20, +0x76616c75,0x6520696e,0x202e7370,0x61636520,0x2d20696c,0x6c656761,0x6c20696e,0x69746961, +0x6c697a61,0x74696f6e,0x20626f75,0x6e647320,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x73796d62,0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x466f7274,0x72616e20, +0x6572726f,0x72202d20,0x4475706c,0x69636174,0x6520696e,0x69746961,0x6c697a61,0x74696f6e, +0x20286f76,0x656c6170,0x70696e67,0x20444154,0x41207374,0x6174656d,0x656e7473,0x29202020, +0x20202020,0x20202020,0x73796d62,0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x696c6c65,0x67616c20, +0x73796d62,0x6f6c2074,0x79706520,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x73796d62,0x6f6c2e70,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0xf042b890,0xf042b8f4, +0xf042bc10,0xf042b8f4,0xf042bc10,0xf042bc10,0xf042b9d8,0xf042bb04,0xf042bc10,0xf042bab0, +0x73796d62,0x6f6c206e,0x6f742066,0x6f756e64,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x73796d62,0x6f6c2e70,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x6c616265,0x6c206e6f,0x7420666f,0x756e6420,0x696e2073,0x796d626f,0x6c207461,0x626c6520, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x73796d62,0x6f6c2e70,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x496e7375,0x66666963,0x69616e74,0x206d656d,0x6f727920,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x74656d70,0x5f6d6772,0x2e702020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x696c6c65,0x67616c20,0x73697a65,0x2074656d,0x706f7261,0x72792020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x74656d70,0x5f6d6772,0x2e702020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x696c6c65,0x67616c20,0x73697a65,0x2074656d,0x706f7261,0x72792020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x74656d70,0x5f6d6772,0x2e702020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x74656d70,0x6f726172,0x79206e6f,0x7420666f,0x756e6420,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x74656d70,0x5f6d6772,0x2e702020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x74656d70,0x6f726172,0x79206e6f,0x7420666f,0x756e6420,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x74656d70,0x5f6d6772,0x2e702020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x74656d70,0x6f726172,0x79206e6f,0x7420666f,0x756e6420,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x74656d70,0x5f6d6772,0x2e702020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x7472616e,0x736c6174,0x652e7000,0xf042ceb4,0xf042cea8,0xf042cec0,0xf042ce9c,0x696c6c65, +0x67616c20,0x752d636f,0x64652020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x7472616e,0x736c6174,0x652e7020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0xf042dd38, +0xf042dd5c,0xf042d7dc,0xf042ddd0,0xf042d750,0x696c6c65,0x67616c20,0x752d636f,0x64652020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x7472616e,0x736c6174,0x652e7020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0xf042e618,0xf042e650,0xf042e130,0xf042e6dc, +0xf042e0bc,0x696c6c65,0x67616c20,0x64617461,0x20747970,0x6520666f,0x72207371,0x72742069, +0x6e737472,0x75637469,0x6f6e2020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x7472616e,0x736c6174,0x652e7020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0xf042f368,0xf042f284,0xf042f1a0,0xf042f444,0xf042ee40,0xf043077c,0xf04303fc, +0xf043001c,0xf042efe8,0xf0431b10,0xf0431d48,0xf0431d48,0xf0431d48,0xf0431d48,0xf042efe8, +0xf042eb34,0xf042edac,0xf042edac,0xf042ecb4,0xf042ec14,0xf0431bec,0xf042f9f4,0xf042ee40, +0xf0430458,0xf0431d48,0xf043015c,0xf0430a80,0xf042efe8,0xf0431d48,0xf0431d48,0xf0431d48, +0xf042f82c,0xf0431d48,0xf042efe8,0xf0431d48,0xf0431d48,0xf042eb58,0xf0431d48,0xf042efe8, +0xf042efe8,0xf0431d48,0xf0431d48,0xf0430040,0xf0431d48,0xf043039c,0xf043039c,0xf043039c, +0xf042eae0,0xf0430640,0xf0431d48,0xf043039c,0xf043039c,0xf0431510,0xf0431d48,0xf043039c, +0xf0431d48,0xf0430dc4,0xf0430a4c,0xf042efe8,0xf0431510,0xf043168c,0xf043168c,0xf0431d48, +0xf0431d48,0xf043001c,0xf0431d48,0xf0431d48,0xf0431d48,0xf0431d48,0xf04306cc,0xf0431b6c, +0xf04306ec,0xf0431d48,0xf0431b30,0xf0431d48,0xf042efe8,0xf042efe8,0xf0431d48,0xf042ee40, +0xf042ea54,0xf04300e4,0xf0431d48,0xf0431d48,0xf042efe8,0xf042efe8,0xf042efe8,0xf043039c, +0xf0431d48,0xf042ee40,0xf042efe8,0xf0431174,0xf0430bb8,0xf042ee40,0xf042efe8,0xf0431d48, +0xf042ee40,0xf0430990,0xf042f990,0xf0431180,0xf0431d48,0xf042ee40,0xf0431d48,0xf0431d48, +0xf042efe8,0xf0431d48,0xf0431d48,0xf0431d48,0xf0431d48,0xf042ee40,0xf0431d48,0xf0431d48, +0xf0431d48,0xf0430ae0,0xf042efe8,0xf042efe8,0xf0431c38,0xf042ee40,0xf042ee40,0xf0431d48, +0xf0431d48,0xf0431d48,0xf0431180,0xf0431b98,0xf042efe8,0xf0431d48,0xf042eb58,0xf042ee40, +0xf0431d48,0xf0431d48,0xf0431d48,0xf0430a18,0xf0430138,0xf0431af0,0xf042efe8,0xf0431640, +0xf043193c,0xf04306ec,0xf0431d48,0xf042f9f4,0x696c6c65,0x67616c20,0x752d636f,0x64652020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x7472616e,0x736c6174,0x652e7020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0xf0431ff0,0xf04322ec,0xf0432188,0xf0432644, +0xf0432274,0xf0432048,0xf0432048,0xf0431fb4,0xf0432114,0xf04320a0,0xf0432644,0xf0432644, +0xf0432274,0xf04322ec,0xf04321dc,0xf0432644,0xf0432644,0xf0432644,0xf0432414,0xf0432644, +0xf0432644,0xf0432644,0xf0432274,0xf0432380,0xf0432274,0xf0432414,0xf04324fc,0xf0431f38, +0xf0432274,0xf0432274,0xf0432644,0xf0431fb4,0xf0432644,0xf0432644,0xf0432644,0xf0432644, +0xf0432274,0xf0432274,0xf04322ec,0xf0432644,0xf0432644,0xf0432644,0xf04322ec,0xf0432644, +0xf0432274,0xf0431ff0,0xf0432274,0xf0432644,0xf0431fb4,0xf0432274,0xf0432274,0xf0432644, +0xf0431fb4,0xf0431fb4,0xf0432114,0xf0432644,0xf0432644,0xf0432644,0xf0432380,0xf0432644, +0xf0432644,0xf0432274,0x6f666673,0x65742f6c,0x656e6774,0x68206d69,0x736d6174,0x63682062, +0x65747765,0x656e2076,0x72656720,0x616e6420,0x72656665,0x72656e63,0x65202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x7472616e,0x736c6174, +0x652e7020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x61747465,0x6d707420,0x746f2061,0x63636573,0x7320756e,0x64656669, +0x6e656420,0x6d656d6f,0x7279206c,0x6f636174,0x696f6e20,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x7472616e,0x736c6174, +0x652e7020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x6f666673,0x65742f6c,0x656e6774,0x68206d69,0x736d6174,0x63682062, +0x65747765,0x656e2076,0x72656720,0x616e6420,0x72656665,0x72656e63,0x65202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x7472616e,0x736c6174, +0x652e7020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x61747465,0x6d707420,0x746f2061,0x63636573,0x7320756e,0x64656669, +0x6e656420,0x6d656d6f,0x7279206c,0x6f636174,0x696f6e20,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x7472616e,0x736c6174, +0x652e7020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x696c6c65,0x67616c20,0x76726567,0x20747970,0x65202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x7472616e,0x736c6174, +0x652e7020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x65787465,0x6e646564,0x20666c6f,0x6174206e,0x6f742079,0x65742073, +0x7570706f,0x72746564,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x7472616e,0x736c6174, +0x652e7020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0xf043371c,0xf0433b00,0xf043371c,0xf043371c,0xf043371c,0xf04339b4, +0xf043371c,0xf04339b4,0xf043371c,0xf043371c,0xf043371c,0xf0433b00,0xf0433628,0xf0433628, +0xf043371c,0xf04339b4,0xf04338a4,0x696c6c65,0x67616c20,0x752d636f,0x64652020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x7472616e, +0x736c6174,0x652e7020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0xf0434118,0xf0434124,0xf0434118,0xf0434170,0xf0434124, +0xf0434124,0xf0434110,0xf0434118,0xf0434118,0xf0434118,0xf0434118,0xf0434118,0xf0434118, +0xf0434118,0xf0434170,0xf0434124,0xf0434124,0xf0434124,0xf0434124,0xf0434170,0xf0434170, +0xf0434170,0xf0434170,0xf0434124,0xf0434124,0xf0434124,0xf0434170,0xf0434118,0xf0434170, +0xf0434124,0xf0434124,0xf0434118,0xf0434118,0xf0434124,0xf0434170,0xf0434124,0xf0434124, +0xf0434124,0xf0434118,0xf0434170,0xf0434170,0xf0434170,0xf0434124,0xf0434110,0xf0434170, +0xf0434170,0xf0434170,0xf0434110,0xf0434110,0xf0434170,0xf0434110,0xf0434170,0xf0434110, +0xf0434170,0xf0434124,0xf0434124,0xf0434170,0xf0434118,0xf0434170,0xf04340ac,0xf0434170, +0xf0434170,0xf0434124,0xf0434124,0xf0434124,0xf0434170,0xf0434170,0xf0434170,0xf0434124, +0xf0434170,0xf0434124,0xf0434118,0xf0434124,0xf0434170,0xf0434118,0xf0434118,0xf0434118, +0xf0434170,0xf0434170,0xf0434170,0xf0434118,0xf0434124,0xf0434124,0xf0434124,0xf0434118, +0xf0434118,0xf0434118,0xf0434170,0xf0434170,0xf0434170,0xf0434124,0xf0434170,0xf0434170, +0xf0434124,0xf0434118,0xf0434170,0xf0434110,0x20697661,0x6c3d2036,0x342d6269,0x742d6976, +0x616c3d20,0x20697661,0x6c3d2065,0x78746572,0x6e616c3d,0x20706f70,0x3d207075,0x73683d20, +0x6f666673,0x6574323d,0x206f6666,0x7365743d,0x206c656e,0x6774683d,0x20626c6f,0x636b6e6f, +0x3d206931,0x3d206c65,0x786c6576,0x3d206d74,0x7970653d,0x20647479,0x7065323d,0x20647479, +0x70653d20,0x7072696f,0x723d206e,0x6578743d,0x206f7032,0x3d206f70,0x313d2072,0x65673d20, +0x4e6f7420,0x76697369,0x74656420,0x7265665f,0x636f756e,0x74323d20,0x7265665f,0x636f756e, +0x743d0000,0x0,0x0,0x0,0x42505420,0x68657265,0xf043625c,0xf043625c, +0xf0436310,0xf0436310,0xf0436310,0xf0436310,0xf043625c,0xf043625c,0xf043625c,0xf0436310, +0xf0436310,0xf0436310,0xf043625c,0xf043625c,0xf0436310,0xf0436310,0xf043625c,0xf0436310, +0xf043625c,0xf04363b8,0xf04363b8,0xf0436468,0xf0436468,0xf0436468,0xf0436468,0xf04363b8, +0xf04363b8,0xf04363b8,0xf0436468,0xf0436468,0xf0436468,0xf04363b8,0xf04363b8,0xf0436468, +0xf0436468,0xf04363b8,0xf0436468,0xf04363b8,0x7265665f,0x636f756e,0x74206f76,0x6572666c, +0x6f772020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x74726565,0x5f757469,0x6c732e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x496e7375,0x66666963,0x69616e74,0x206d656d, +0x6f727920,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x74726565,0x5f757469,0x6c732e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0xf0436e20,0xf0436e20,0xf0436e28,0xf0436e28, +0xf0436e28,0xf0436e28,0xf0436e20,0xf0436e20,0xf0436e20,0xf0436e28,0xf0436e28,0xf0436e28, +0xf0436e20,0xf0436e20,0xf0436e28,0xf0436e28,0xf0436e20,0xf0436e28,0xf0436e20,0xf0436e0c, +0xf0436e0c,0xf0436e28,0xf0436e28,0xf0436e28,0xf0436e0c,0xf0436e28,0xf0436e20,0xf0436e20, +0xf0436e28,0xf0436e20,0xf0436e20,0xf0436e28,0xf0436e28,0xf0436e20,0x0,0x0, +0x696c6c65,0x67616c20,0x72656769,0x73746572,0x20747970,0x65202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x7567656e,0x2e702020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x696e7375,0x66666963,0x69656e74,0x20636f64,0x65206765,0x6e657261,0x746f7220,0x72656769, +0x73746572,0x73202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x7567656e,0x2e702020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0xf043740c,0xf043755c,0xf043755c,0xf043755c,0xf0437550,0xf043755c,0xf0437418,0x696c6c65, +0x67616c20,0x72656769,0x73746572,0x20747970,0x65202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x7567656e,0x2e702020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x696e7375, +0x66666963,0x69656e74,0x20636f64,0x65206765,0x6e657261,0x746f7220,0x66702072,0x65676973, +0x74657273,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x7567656e,0x2e702020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x696e7375, +0x66666963,0x69656e74,0x20636f64,0x65206765,0x6e657261,0x746f7220,0x66702072,0x65676973, +0x74657273,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x7567656e,0x2e702020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0xf04376f0, +0xf0437988,0xf0437988,0xf0437988,0xf0437834,0xf0437988,0xf04376fc,0x54726565,0x2064756d, +0x70206166,0x74657220,0x54726565,0x2064756d,0x70206166,0x74657220,0x4e6f2073,0x75697461, +0x626c6520,0x66696c65,0x2063616e,0x20626520,0x63726561,0x74656420,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x7567656e,0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x2f746d70,0x2f756765, +0x6e746d70,0x58585858,0x58582020,0x20202020,0x20202020,0x20202020,0x5472616e,0x736c6174, +0x65202020,0x4275696c,0x64202020,0x20202020,0x7567656e,0x3a43616e,0x6e6f7420,0x72656164, +0x2073796d,0x626f6c20,0x7461626c,0x65206669,0x6c656670,0x33327265,0x67732069,0x73206f6e, +0x6c79206c,0x6567616c,0x20666f72,0x206d6970,0x73332061,0x6e642066,0x75747572,0x65206172, +0x63686974,0x65637475,0x72657320,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20207567,0x656e2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x2020746f,0x6f206d61,0x6e792066,0x70207265, +0x67697374,0x65727320,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20207567,0x656e2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x2020746f,0x6f206d61,0x6e792072,0x65676973, +0x74657273,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20207567,0x656e2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20204d75,0x73742073,0x70656369,0x6679202e, +0x46206669,0x6c65206e,0x6f742075,0x6e646572,0x73746f6f,0x646e756d,0x65726963,0x20617267, +0x756d656e,0x74207265,0x71756972,0x65642066,0x6f72202d,0x63686563,0x6b737461,0x636b2d63, +0x6865636b,0x73746163,0x6b202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202d63, +0x70616c69,0x61732020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202d61, +0x6c69676e,0x36342020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202d61, +0x6c69676e,0x33322020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202d61, +0x6c69676e,0x31362020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202d61, +0x6c69676e,0x38202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202d70, +0x69633220,0x696d706c,0x69657320,0x2d472030,0x2e202d47,0x206f7074,0x696f6e20,0x69676e6f, +0x7265642d,0x70696332,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x2020202d,0x70696320,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x2020202d,0x70696331,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x2020202d,0x70696330,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x2020202d,0x6d73636f,0x66662020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x2020202d,0x6d697073,0x33202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x2020202d,0x6d697073,0x32202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x2020202d,0x6d697073,0x31202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x2020202d,0x6e6f756e,0x7369676e,0x6564636f,0x6e762020,0x20202020,0x20202020,0x20202020, +0x2020202d,0x6e6f7461,0x696c6f70,0x74202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x2020202d,0x6e6f6370,0x616c6961,0x73202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x2020202d,0x6e6f6f66,0x66736574,0x6f707420,0x20202020,0x20202020,0x20202020,0x20202020, +0x2020202d,0x66703332,0x72656773,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x2020202d,0x70696332,0x20696d70,0x6c696573,0x202d4720,0x302e202d,0x47206f70,0x74696f6e, +0x2069676e,0x6f726564,0x6e756d65,0x72696320,0x61726775,0x6d656e74,0x20726571,0x75697265, +0x6420666f,0x72202d47,0x6e756d65,0x72696320,0x61726775,0x6d656e74,0x20726571,0x75697265, +0x6420666f,0x72202d4f,0x6e756d65,0x72696320,0x61726775,0x6d656e74,0x20726571,0x75697265, +0x6420666f,0x72202d67,0x2d646f6d,0x74616720,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x2d64776f,0x70636f64,0x65202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x66696c65,0x6e616d65,0x20726571,0x75697265,0x64206166,0x74657220, +0x2d656669,0x6c656e61,0x6d652072,0x65717569,0x72656420,0x61667465,0x72202d74,0x66696c65, +0x6e616d65,0x20726571,0x75697265,0x64206166,0x74657220,0x2d74656d,0x7066696c,0x656e616d, +0x65207265,0x71756972,0x65642061,0x66746572,0x202d6c66,0x696c656e,0x616d6520,0x72657175, +0x69726564,0x20616674,0x6572202d,0x7566696c,0x656e616d,0x65207265,0x71756972,0x65642061, +0x66746572,0x202d6f55,0x73616765,0x2069733a,0x20756765,0x6e205b2d,0x6f206269,0x6e66696c, +0x655d205b,0x2d6c206c,0x69737466,0x696c655d,0x205b2d65,0x2064756d,0x7066696c,0x655d205b, +0x2d742073,0x796d626f,0x6c66696c,0x656e616d,0x655d205b,0x2d645d20,0x5b2d7472,0x61707576, +0x5d205b2d,0x4720736d,0x616c6c73,0x697a655d,0x205b2d70,0x5d206669,0x6c652e46,0xf0439c4c, +0xf0439c5c,0xf0439c68,0xf04389f4,0xf0438e50,0xf0438b10,0xf0439f78,0xf0439f78,0xf0439f78, +0xf0439f78,0xf0438e38,0xf0439f78,0xf0439f78,0xf0438a9c,0xf04398a4,0xf0439f78,0xf0439c88, +0xf0438828,0xf0438730,0xf0438cd0,0xf0438a28,0xf0439f78,0xf0439f78,0xf043831c,0xf0439f78, +0xf04384dc,0xf04391c8,0xf0438e84,0xf0438358,0xf043950c,0xf0439f78,0xf0438c44,0xf0439f78, +0xf0438584,0xf04383f4,0xf0438e6c,0xf0439c14,0x20202020,0x20202020,0x20202020,0x20202020, +0x76616c5f,0x7574696c,0x2e706e75,0x6c6c2076,0x616c7565,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20207661,0x6c5f7574, +0x696c2e70,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20200000,0xf043b058,0xf043b168,0xf043b168,0xf043b168,0xf043b1bc, +0xf043b254,0xf043b254,0xf043b254,0xf043b470,0xf043b2c0,0x756e6b6e,0x6f776e20,0x64617461, +0x20747970,0x65202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x76616c5f,0x7574696c,0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x65787465,0x6e646564,0x20666c6f, +0x6174696e,0x6720706f,0x696e7420,0x6e6f7420,0x79657420,0x73757070,0x6f727465,0x64202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x76616c5f,0x7574696c,0x2e702020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0x20202020, +0x20202020,0x20202020,0x20202020,0x20202020,0x20202020,0xf043b5c4,0xf043b70c,0xf043b5ec, +0xf043b70c,0xf043b5c4,0xf043b580,0xf043b580,0xf043b580,0xf043b580,0xf043b5e4,0xf043b5ec, +0xf043b70c,0xf043b5dc,0xf043b5d4,0xf043b5f4,0xf043b5cc,0xf043b5fc,0x0,0x0, +0x4f53594d,0x4b53594d,0x4d53594d,0x52435546,0x4c445243,0x49525354,0x49524c44,0x49535449, +0x494c4449,0x5349474e,0x5353594d,0x4c454e44,0x4c54524d,0x4c424459,0x4c42474e,0x55424420, +0x54504c45,0x54504745,0x54504754,0x54504c54,0x54504e45,0x54504551,0x43473220,0x43473120, +0x494a5020,0x56524547,0x554e414c,0x4d504d56,0x504d4f56,0x49535354,0x49534c44,0x49435546, +0x4c4e4f54,0x53485220,0x53484c20,0x4c53594d,0x4753594d,0x4653594d,0x4553594d,0x4353594d, +0x584f5220,0x584a5020,0x554e4920,0x554a5020,0x54595020,0x544a5020,0x53575020,0x53554220, +0x53545350,0x53545220,0x53545020,0x53544550,0x53515254,0x53515220,0x53475320,0x4853594d, +0x4153594d,0x53444546,0x52535452,0x52504152,0x524e4420,0x524c4f44,0x524c4443,0x524c4441, +0x52455420,0x52454753,0x504f5020,0x50444546,0x50415220,0x4f50544e,0x58504152,0x4f444420, +0x4e4f5420,0x4e4f5020,0x4e455120,0x4e454720,0x4d555320,0x4d544147,0x4d535420,0x4d505920, +0x4d4f5620,0x52454d20,0x4d4f4420,0x4d415820,0x4d494e20,0x4c4f4420,0x4c4f4320,0x4c455820, +0x4c455320,0x4c455120,0x4c444150,0x4c445350,0x4c444320,0x4c444120,0x494c4441,0x4c434120, +0x4c424420,0x4c444546,0x4c414220,0x49584120,0x49535452,0x494f5220,0x494e5420,0x494e4e20, +0x494e4954,0x494e4320,0x494e4551,0x494c4f44,0x494c4553,0x494c4551,0x49475254,0x49474551, +0x49455155,0x49445820,0x46494c4c,0x47525420,0x47455120,0x464a5020,0x45515520,0x41454e54, +0x454e5420,0x454e4442,0x454e4420,0x44555020,0x44495620,0x44494620,0x44454620,0x44454320, +0x4356544c,0x43565420,0x43555020,0x434f4d4d,0x4354524c,0x43554244,0x434c4244,0x434c4142, +0x43494120,0x43484b4e,0x43484b4c,0x43484b48,0x43484b54,0x42535542,0x42474e42,0x42474e20, +0x414f5320,0x414e4420,0x414c4941,0x41444a20,0x41444420,0x41425320,0x0,0x0, +0x75707574,0x3a206f75,0x74707574,0x2066696c,0x65206e6f,0x7420696e,0x69746961,0x6c697a65, +0x640a0000,0x77726974,0x696e6720,0x6f757420,0x66696c65,0x0,0x75707574,0x3a206f75, +0x74707574,0x2066696c,0x65206e6f,0x7420696e,0x69746961,0x6c697a65,0x640a0000,0x77726974, +0x696e6720,0x6f757420,0x66696c65,0x0,0x75707574,0x3a206f75,0x74707574,0x2066696c, +0x65206e6f,0x7420696e,0x69746961,0x6c697a65,0x640a0000,0x75707574,0x3a206361,0x6e6e6f74, +0x20756e6c,0x696e6b20,0x62656361,0x75736520,0x75707574,0x696e6974,0x66642077,0x61732075, +0x7365640a,0x0,0x75676574,0x3a20696e,0x70757420,0x66696c65,0x206e6f74,0x20696e69, +0x7469616c,0x697a6564,0xa000000,0x72656164,0x20746f6f,0x206d7563,0x68206672,0x6f6d2067, +0x65742062,0x75666665,0x720a0000,0x72656164,0x696e6720,0x696e2066,0x696c6500,0x696e7075, +0x74206275,0x66666572,0x206f6e20,0x6e6f6e2d,0x696e7420,0x626f756e,0x6472790a,0x0, +0x75676574,0x3a20696e,0x70757420,0x66696c65,0x206e6f74,0x20696e69,0x7469616c,0x697a6564, +0xa000000,0x0,0x0,0x0,0x73745f66,0x696c6562,0x6567696e,0x3a207472, +0x69656420,0x746f2065,0x6e642074,0x6f6f206d,0x616e7920,0x66696c65,0x73202825,0x73290a00, +0x73745f74,0x65787462,0x6c6f636b,0x3a20626c,0x6f636b20,0x70656e64,0x696e6720,0x73657420, +0x696e2069,0x6c6c6567,0x616c2063,0x6173650a,0x0,0x73745f66,0x696c655f,0x69646e3a, +0x20697374,0x61636b20,0x756e6465,0x72666c6f,0x77202825,0x73290a00,0x0,0x0, +0x62616420,0x6d616769,0x6320696e,0x20686472,0x2e206578,0x70656374,0x65642030,0x7825782c, +0x20676f74,0x20307825,0x780a0000,0x73745f72,0x65616473,0x743a2064,0x656e7365,0x206e756d, +0x62657220,0x696e636f,0x6d706174,0x69626c65,0x2066726f,0x6d207665,0x7273696f,0x6e73206c, +0x65737320,0x7468616e,0x20312e33,0x302c2070,0x6c656173,0x65207265,0x636f6d70,0x696c6520, +0x66726f6d,0x20736372,0x61746368,0x20616e64,0x20757365,0x20636f6d,0x70617469,0x626c6520, +0x636f6d70,0x6f6e656e,0x74730a00,0x73745f72,0x6561643a,0x20657272,0x6f722073,0x65656b69, +0x6e670a00,0x73745f72,0x6561643a,0x20657272,0x6f722072,0x65616469,0x6e670a00,0x63616e6e, +0x6f74206f,0x70656e20,0x73796d62,0x6f6c2074,0x61626c65,0x2066696c,0x65202573,0xa000000, +0x77000000,0x73745f77,0x72697465,0x73743a20,0x63616e6e,0x6f742077,0x72697465,0x20746f20, +0x66696c65,0x206e756d,0x62657220,0x25640a00,0x63616e6e,0x6f742077,0x72697465,0x20726f75, +0x6e642062,0x79746573,0x20666f72,0x206c696e,0x65730a00,0x63616e6e,0x6f742077,0x72697465, +0x20726f75,0x6e642062,0x79746573,0x20666f72,0x20737472,0x696e6773,0xa000000,0x63616e6e, +0x6f742077,0x72697465,0x20726f75,0x6e642062,0x79746573,0x20666f72,0x20737472,0x696e6773, +0xa000000,0x63616e6e,0x6f742077,0x72697465,0x2073796d,0x626f6c20,0x68656164,0x65720a00, +0x73745f66,0x64616464,0x3a206e75,0x6d626572,0x206f6620,0x66696c65,0x73202825,0x64292065, +0x78636565,0x6473206d,0x61782028,0x2564290a,0x0,0x73745f66,0x64616464,0x3a20616c, +0x6c6f6361,0x74696f6e,0x20626f74,0x63682028,0x25642066,0x64732061,0x6e642025,0x64206366, +0x64732920,0x696e2025,0x730a0000,0x0,0x3c2f3444,0x65627567,0x2f3e0000,0x3a000000, +0x3a000000,0x73745f66,0x64616464,0x3a20636f,0x756c6420,0x6e6f7420,0x6d616c6c,0x6f632070, +0x61746820,0x6e616d65,0x21212025,0x640a0000,0x73745f66,0x64616464,0x3a20636f,0x756c6420, +0x6e6f7420,0x6d616c6c,0x6f632070,0x61746820,0x6e616d65,0x21202564,0xa000000,0x43616e6e, +0x6f742073,0x745f6664,0x6164643a,0x2063616e,0x6e6f7420,0x6d616c6c,0x6f632025,0x64206279, +0x74657320,0x746f2068,0x6f6c6420,0x66696c65,0x206e616d,0x650a0000,0x2f000000,0x256c7500, +0x2d310000,0x256c7500,0x73745f73,0x74726164,0x643a2061,0x7267756d,0x656e7420,0x6973206e, +0x696c0a00,0x73745f70,0x6175785f,0x6966645f,0x69617578,0x3a206966,0x64202825,0x6429206f, +0x72206961,0x75782028,0x25642920,0x6f757420,0x6f662072,0x616e6765,0xa000000,0x73745f70, +0x6175785f,0x6966645f,0x69617578,0x3a206966,0x64202825,0x6429206f,0x7220696c,0x696e6520, +0x28256429,0x206f7574,0x206f6620,0x72616e67,0x650a0000,0x73745f6d,0x616c6c6f,0x633a2063, +0x616e6e6f,0x7420616c,0x6c6f6361,0x74652069,0x74656d20,0x6f662031,0x20627974,0x65207769, +0x7468206d,0x616c6c6f,0x63283329,0xa000000,0x73745f6d,0x616c6c6f,0x633a2063,0x616e6e6f, +0x7420616c,0x6c6f6361,0x74652069,0x74656d20,0x6f662025,0x6c642062,0x79746573,0x20776974, +0x68206d61,0x6c6c6f63,0x2833290a,0x0,0x73745f6d,0x616c6c6f,0x633a2063,0x616e6e6f, +0x74206772,0x6f772069,0x74656d20,0x746f2025,0x6c642062,0x79746573,0x20776974,0x68207265, +0x616c6c6f,0x63283329,0xa000000,0x0,0x73745f70,0x6366645f,0x6966643a,0x20696664, +0x20282564,0x29206f75,0x74206f66,0x2072616e,0x67650a00,0x73745f70,0x73796d5f,0x6966645f, +0x6973796d,0x3a206966,0x64202825,0x6429206f,0x72206973,0x796d2028,0x25642920,0x6f757420, +0x6f662072,0x616e6765,0xa000000,0x73745f70,0x6175785f,0x69617578,0x3a206961,0x75782028, +0x25642920,0x6f757420,0x6f662072,0x616e6765,0xa000000,0x0,0x0,0x0, +0x25733a20,0x496e7465,0x726e616c,0x3a200000,0xa000000,0x0,0x0,0x0, +0x73745f63,0x75696e69,0x743a2063,0x616e6e6f,0x7420616c,0x6c6f6361,0x74652063,0x75727265, +0x6e742063,0x6864720a,0x0,0x73745f65,0x78746164,0x643a2079,0x6f752064,0x69646e27, +0x7420696e,0x69746961,0x6c697a65,0x20776974,0x68206375,0x696e6974,0x206f7220,0x72656164, +0x73740a00,0x73745f70,0x6578745f,0x69657874,0x3a20696e,0x64657820,0x6f757420,0x6f662072, +0x616e6765,0x20282564,0x290a0000,0x73745f69,0x646e5f69,0x6e646578,0x5f666578,0x743a2079, +0x6f752064,0x69646e27,0x7420696e,0x69746961,0x6c697a65,0x20776974,0x68206375,0x696e6974, +0x206f7220,0x72656164,0x73740a00,0x73745f70,0x646e5f69,0x646e3a20,0x69646e20,0x28256429, +0x206c6573,0x73207468,0x616e2030,0x206f7220,0x67726561,0x74657220,0x7468616e,0x206d6178, +0x20282564,0x290a0000,0x0,0x0,0x73745f65,0x78747374,0x72616464,0x3a20796f, +0x75206469,0x646e2774,0x20696e69,0x7469616c,0x697a6520,0x77697468,0x20637569,0x6e697420, +0x6f722072,0x65616473,0x740a0000,0x73745f65,0x78747374,0x72616464,0x3a206172,0x67756d65, +0x6e742069,0x73206e69,0x6c0a0000,0x73745f69,0x646e5f64,0x6e3a2079,0x6f752064,0x69646e27, +0x7420696e,0x69746961,0x6c697a65,0x20776974,0x68206375,0x696e6974,0x206f7220,0x72656164, +0x73740a00,0x73745f69,0x646e5f72,0x6e64783a,0x20796f75,0x20646964,0x6e277420,0x696e6974, +0x69616c69,0x7a652077,0x69746820,0x6375696e,0x6974206f,0x72207265,0x61647374,0xa000000, +0x73745f72,0x6e64785f,0x69646e3a,0x2069646e,0x20282564,0x29206772,0x65617465,0x72207468, +0x616e206d,0x61782028,0x2564290a,0x0,0x73745f72,0x6e64785f,0x69646e3a,0x206f6c64, +0x20696e74,0x65726661,0x63652063,0x616e2774,0x20707574,0x20726664,0x28256429,0x20696e74, +0x6f20726e,0x64782c20,0x75736520,0x73745f70,0x646e5f69,0x646e2069,0x6e737465,0x61640a00, +0x73745f73,0x65746964,0x6e3a2069,0x646e7372,0x63202825,0x6429206f,0x72206964,0x6e646573, +0x74202825,0x6429206f,0x7574206f,0x66207261,0x6e67650a,0x0,0x73745f70,0x6578745f, +0x646e3a20,0x72666420,0x6669656c,0x64202825,0x64292069,0x736e2774,0x20657175,0x616c2074, +0x6f205354,0x5f455854,0x49464428,0x2564290a,0x0,0x73745f70,0x6578745f,0x646e3a20, +0x696e6465,0x78206f75,0x74206f66,0x2072616e,0x67652028,0x2564290a,0x0,0x6c69626d, +0x6c640000,0x6c69626d,0x6c643a20,0x496e7465,0x726e616c,0x3a206361,0x6e6e6f74,0x20616c6c, +0x6f636174,0x6520746f,0x20696e69,0x7469616c,0x697a6520,0x636f6d70,0x6f6e656e,0x74206e61, +0x6d652066,0x6f72206c,0x69626d6c,0x64206572,0x726f7273,0xa000000,0x0,0x0, +0x74726965,0x6420746f,0x20726570,0x6c616365,0x20726e64,0x78206175,0x78202825,0x64292074, +0x68617420,0x66697473,0x20696e74,0x6f206f6e,0x6520776f,0x72642028,0x25642c20,0x25642920, +0x77697468,0x206f6e65,0x20746861,0x74206361,0x6e277420,0x2825642c,0x2564290a,0x0, +0x73776170,0x206f6620,0x61757873,0x206e6f74,0x20737570,0x706f7274,0x65642077,0x68656e20, +0x64657374,0x73657820,0x213d2068,0x6f737473,0x65780a00,0xf044c774,0xf044c890,0xf044c908, +0xf044c908,0xf044c908,0xf044c908,0xf044c908,0x25733a20,0x4572726f,0x723a2000,0xa000000, +0xa000000,0x25733a20,0x5761726e,0x696e673a,0x20000000,0xa000000,0x0,0x0, +0x25733a20,0x496e7465,0x726e616c,0x3a200000,0xa000000,0x25733a20,0x4572726f,0x723a2000, +0xa000000,0x5f6d645f,0x73745f6d,0x616c6c6f,0x633a2063,0x616e6e6f,0x7420616c,0x6c6f6361, +0x74652069,0x74656d20,0x6f662031,0x20627974,0x65207769,0x7468206d,0x616c6c6f,0x63283329, +0xa000000,0x5f6d645f,0x73745f6d,0x616c6c6f,0x633a2063,0x616e6e6f,0x7420616c,0x6c6f6361, +0x74652069,0x74656d20,0x6f662025,0x6c642062,0x79746573,0x20776974,0x68206d61,0x6c6c6f63, +0x2833290a,0x0,0x5f6d645f,0x73745f6d,0x616c6c6f,0x633a2063,0x616e6e6f,0x74206772, +0x6f772069,0x74656d20,0x746f2025,0x6c642062,0x79746573,0x20776974,0x68207265,0x616c6c6f, +0x63283329,0xa000000,0x0,0x0,0x2f746d70,0x2f706173,0x25642e25,0x64000000, +0x67657420,0x63616c6c,0x6564206f,0x6e206120,0x66696c65,0x206f7065,0x6e20666f,0x72207772, +0x6974696e,0x672e0a00,0x42756666,0x6572206e,0x6f742061,0x206d756c,0x7469706c,0x65206f66, +0x20726563,0x6f726420,0x73697a65,0x2e0a0000,0x45786365,0x65647320,0x72616e67,0x6520696e, +0x20726561,0x645f6368,0x61723b20,0x696e7075,0x74206973,0x20272563,0x272e0a00,0x5761726e, +0x696e673a,0x20726561,0x646c6e20,0x61747465,0x6d707465,0x64206672,0x6f6d2075,0x6e6f7065, +0x6e656420,0x66696c65,0x2e0a0000,0x5761726e,0x696e673a,0x20726561,0x64206f66,0x20612073, +0x7472696e,0x67206174,0x74656d70,0x74656420,0x66726f6d,0x20756e6f,0x70656e65,0x64206669, +0x6c652e0a,0x0,0x5761726e,0x696e673a,0x20726561,0x64206f66,0x20612062,0x6f6f6c65, +0x616e2061,0x7474656d,0x70746564,0x2066726f,0x6d20756e,0x6f70656e,0x65642066,0x696c652e, +0xa000000,0x66616c73,0x65000000,0x74727565,0x0,0x496c6c65,0x67616c20,0x626f6f6c, +0x65616e20,0x76616c75,0x65202725,0x73272e0a,0x0,0x5761726e,0x696e673a,0x20726561, +0x64206f66,0x20656e75,0x6d657261,0x74656420,0x74797065,0x20617474,0x656d7074,0x65642066, +0x726f6d20,0x756e6f70,0x656e6564,0x2066696c,0x652e0a00,0x456e756d,0x65726174,0x65642076, +0x616c7565,0x20272573,0x27206e6f,0x74207769,0x7468696e,0x20747970,0x652e0a00,0x5761726e, +0x696e673a,0x20726561,0x64206f66,0x20696e74,0x65676572,0x20617474,0x656d7074,0x65642066, +0x726f6d20,0x756e6f70,0x656e6564,0x2066696c,0x652e0a00,0x44696769,0x74206578,0x70656374, +0x65642069,0x6e207265,0x61645f69,0x6e746567,0x65723b20,0x696e7075,0x74206973,0x20272563, +0x272e0a00,0x44696769,0x74206578,0x70656374,0x65642069,0x6e207265,0x61645f69,0x6e746567, +0x65723b20,0x696e7075,0x74206973,0x20272563,0x272e0a00,0x4f766572,0x666c6f77,0x20696e20, +0x72656164,0x5f696e74,0x65676572,0x2e0a0000,0x45786365,0x65647320,0x72616e67,0x6520696e, +0x20726561,0x645f696e,0x74656765,0x723b2069,0x6e707574,0x20697320,0x27256427,0x2e0a0000, +0x5761726e,0x696e673a,0x20726561,0x64206f66,0x20636172,0x64696e61,0x6c206174,0x74656d70, +0x74656420,0x66726f6d,0x20756e6f,0x70656e65,0x64206669,0x6c652e0a,0x0,0x44696769, +0x74206578,0x70656374,0x65642069,0x6e207265,0x61645f63,0x61726469,0x6e616c3b,0x20696e70, +0x75742069,0x73202725,0x63272e0a,0x0,0x44696769,0x74206578,0x70656374,0x65642069, +0x6e207265,0x61645f63,0x61726469,0x6e616c3b,0x20696e70,0x75742069,0x73202725,0x63272e0a, +0x0,0x4f766572,0x666c6f77,0x20696e20,0x72656164,0x5f636172,0x64696e61,0x6c2e0a00, +0x5761726e,0x696e673a,0x20726561,0x64206f66,0x20646f75,0x626c6520,0x61747465,0x6d707465, +0x64206672,0x6f6d2075,0x6e6f7065,0x6e656420,0x66696c65,0x2e0a0000,0x44696769,0x74206578, +0x70656374,0x65642069,0x6e207265,0x61645f64,0x6f75626c,0x653b2069,0x6e707574,0x20697320, +0x27256327,0x2e0a0000,0x44696769,0x74206578,0x70656374,0x65642069,0x6e207265,0x61645f64, +0x6f75626c,0x653b2069,0x6e707574,0x20697320,0x27256327,0x2e0a0000,0x44696769,0x74206578, +0x70656374,0x65642069,0x6e206578,0x706f6e65,0x6e742069,0x6e207265,0x61645f64,0x6f75626c, +0x653b2069,0x6e707574,0x20697320,0x27256327,0x2e0a0000,0x5761726e,0x696e673a,0x20726561, +0x64206f66,0x20696e74,0x36342061,0x7474656d,0x70746564,0x2066726f,0x6d20756e,0x6f70656e, +0x65642066,0x696c652e,0xa000000,0x44696769,0x74206578,0x70656374,0x65642069,0x6e207265, +0x61645f69,0x6e746567,0x65723634,0x3b20696e,0x70757420,0x69732027,0x2563272e,0xa000000, +0x44696769,0x74206578,0x70656374,0x65642069,0x6e207265,0x61645f69,0x6e746567,0x65723634, +0x3b20696e,0x70757420,0x69732027,0x2563272e,0xa000000,0x4f766572,0x666c6f77,0x20696e20, +0x72656164,0x5f696e74,0x65676572,0x36342e0a,0x0,0x45786365,0x65647320,0x72616e67, +0x6520696e,0x20726561,0x645f696e,0x74656765,0x7236343b,0x20696e70,0x75742069,0x73202725, +0x64272e0a,0x0,0x5761726e,0x696e673a,0x20726561,0x64206f66,0x20636172,0x64696e61, +0x6c206174,0x74656d70,0x74656420,0x66726f6d,0x20756e6f,0x70656e65,0x64206669,0x6c652e0a, +0x0,0x44696769,0x74206578,0x70656374,0x65642069,0x6e207265,0x61645f63,0x61726469, +0x6e616c36,0x343b2069,0x6e707574,0x20697320,0x27256327,0x2e0a0000,0x44696769,0x74206578, +0x70656374,0x65642069,0x6e207265,0x61645f63,0x61726469,0x6e616c36,0x343b2069,0x6e707574, +0x20697320,0x27256327,0x2e0a0000,0x4f766572,0x666c6f77,0x20696e20,0x72656164,0x5f636172, +0x64696e61,0x6c36342e,0xa000000,0x0,0x2f746d70,0x2f706173,0x25642e25,0x64000000, +0x72000000,0x72000000,0x0,0x0,0x77726974,0x656c6e20,0x63616c6c,0x6564206f, +0x6e206669,0x6c65206e,0x6f74206f,0x70656e20,0x666f7220,0x77726974,0x696e672e,0xa000000, +0x456e756d,0x65726174,0x65642076,0x616c7565,0x20272564,0x27206e6f,0x74207769,0x7468696e, +0x20747970,0x652e0a00,0x696c6c65,0x67616c20,0x72616469,0x78207370,0x65636966,0x69656420, +0x666f7220,0x696e7465,0x67657220,0x77726974,0x653a2025,0x640a0000,0x696c6c65,0x67616c20, +0x72616469,0x78207370,0x65636966,0x69656420,0x666f7220,0x63617264,0x696e616c,0x20777269, +0x74653a20,0x25640a00,0x20302e00,0x652b3030,0x30000000,0x20302e00,0x652b3030,0x30000000, +0x74727565,0x0,0x66616c73,0x65000000,0x696c6c65,0x67616c20,0x72616469,0x78207370, +0x65636966,0x69656420,0x666f7220,0x63617264,0x696e616c,0x36342077,0x72697465,0x3a202564, +0xa000000,0x696c6c65,0x67616c20,0x72616469,0x78207370,0x65636966,0x69656420,0x666f7220, +0x696e7465,0x67657236,0x34207772,0x6974653a,0x2025640a,0x0,0x0,0x0, +0x4e6f2063,0x61736520,0x6d617463,0x68657320,0x76616c75,0x6520696e,0x20636173,0x65207374, +0x6174656d,0x656e7420,0x6f6e2070,0x61676520,0x2564206c,0x696e6520,0x25642066,0x696c6520, +0x25732e0a,0x0,0x61737365,0x7274696f,0x6e206661,0x696c6564,0x20257320,0xa000000, +0x2f746d70,0x2f706173,0x25642e25,0x64000000,0x77000000,0x5065726d,0x69737369,0x6f6e2044, +0x656e6965,0x642c2072,0x65777269,0x74652074,0x6f206120,0x70726f74,0x65637465,0x64206669, +0x6c650a00,0x77000000,0x0,0x0,0x40282329,0x24486561,0x6465723a,0x20495249, +0x5820352e,0x333a3130,0x32313537,0x32303333,0x20627569,0x6c742031,0x312f3033,0x2f393420, +0x61742070,0x69676865,0x6172743a,0x2f6a6f69,0x73742f35,0x2e334d52,0x2f726f6f,0x74202400, +}; +static const uint32_t data[] = { +0x24302020,0x20243120,0x20202432,0x20202024,0x33202020,0x24342020,0x20243520,0x20202436, +0x20202024,0x37202020,0x24382020,0x20243920,0x20202431,0x30202024,0x31312020,0x24313220, +0x20243133,0x20202431,0x34202024,0x31352020,0x24313620,0x20243137,0x20202431,0x38202024, +0x31392020,0x24323020,0x20243231,0x20202432,0x32202024,0x32332020,0x24323420,0x20243235, +0x20202432,0x36202024,0x32372020,0x24677020,0x20247370,0x20202433,0x30202024,0x33312020, +0x24663020,0x20246631,0x20202466,0x32202024,0x66332020,0x24663420,0x20246635,0x20202466, +0x36202024,0x66372020,0x24663820,0x20246639,0x20202466,0x31302024,0x66313120,0x24663132, +0x20246631,0x33202466,0x31342024,0x66313520,0x24663136,0x20246631,0x37202466,0x31382024, +0x66313920,0x24663230,0x20246632,0x31202466,0x32322024,0x66323320,0x24663234,0x20246632, +0x35202466,0x32362024,0x66323720,0x24663238,0x20246632,0x39202466,0x33302024,0x66333120, +0x24666363,0x30246663,0x63312466,0x63633224,0x66636333,0x24666363,0x34246663,0x63352466, +0x63633624,0x66636337,0x24302020,0x20000000,0x6c616265,0x6c202020,0x20202020,0x73796d20, +0x20202020,0x20202020,0x2e676c6f,0x626c2020,0x20202020,0x2e63706c,0x6f616420,0x20202020, +0x2e616c69,0x676e2020,0x20202020,0x2e617363,0x69692020,0x20202020,0x2e617363,0x69697a20, +0x20202020,0x2e627974,0x65202020,0x20202020,0x2e636f6d,0x6d202020,0x20202020,0x2e6c636f, +0x6d6d2020,0x20202020,0x2e646174,0x61202020,0x20202020,0x2e646f75,0x626c6520,0x20202020, +0x2e66696c,0x65202020,0x20202020,0x2e666c6f,0x61742020,0x20202020,0x2e68616c,0x66202020, +0x20202020,0x2e637072,0x6573746f,0x72652020,0x2e677077,0x6f726420,0x20202020,0x2e637061, +0x64642020,0x20202020,0x2e776561,0x6b657874,0x20202020,0x2e6c6f6f,0x706e6f20,0x20202020, +0x2e737061,0x63652020,0x20202020,0x2e746578,0x74202020,0x20202020,0x2e776f72,0x64202020, +0x20202020,0x636f6465,0x20202020,0x20202020,0x2e656e64,0x20202020,0x20202020,0x2e736461, +0x74612020,0x20202020,0x2e726461,0x74612020,0x20202020,0x2e656e74,0x20202020,0x20202020, +0x2e6c6f63,0x20202020,0x20202020,0x2e62676e,0x62202020,0x20202020,0x2e656e64,0x62202020, +0x20202020,0x2e61736d,0x30202020,0x20202020,0x2e736574,0x20202020,0x20202020,0x2e637061, +0x6c696173,0x20202020,0x2e726570,0x20202020,0x20202020,0x2e656e64,0x72657020,0x20202020, +0x2e6c6162,0x20202020,0x20202020,0x2e767265,0x67202020,0x20202020,0x2e6d6173,0x6b202020, +0x20202020,0x2e666d61,0x736b2020,0x20202020,0x2e657272,0x20202020,0x20202020,0x2e676c6f, +0x62616273,0x20202020,0x2e766572,0x7374616d,0x70202020,0x2e667261,0x6d652020,0x20202020, +0x2e657874,0x656e6465,0x64202020,0x2e657874,0x65726e20,0x20202020,0x2e61656e,0x74202020, +0x20202020,0x2e6f7074,0x696f6e20,0x20202020,0x2e6e6f61,0x6c696173,0x20202020,0x2e616c69, +0x61732020,0x20202020,0x2e6d7461,0x67202020,0x20202020,0x2e6d616c,0x69617320,0x20202020, +0x2e636f6d,0x6d202020,0x20202020,0x2e6c6976,0x65726567,0x20202020,0x2e676a61,0x6c646566, +0x20202020,0x2e676a61,0x6c6c6976,0x65202020,0x2e676a72,0x6c697665,0x20202020,0x2e736869, +0x66745f61,0x64647220,0x2e726573,0x74657874,0x20202020,0x2e64776f,0x72642020,0x20202020, +0x2e70726f,0x6c6f6775,0x65202020,0x2e656461,0x74612020,0x20202020,0x2e636f6d,0x6d202020, +0x20202020,0x756e6465,0x66696e65,0x64202020,0x72656f72,0x64657220,0x20202020,0x6e6f7265, +0x6f726465,0x72202020,0x6d616372,0x6f202020,0x20202020,0x6e6f6d61,0x63726f20,0x20202020, +0x61742020,0x20202020,0x20202020,0x6e6f6174,0x20202020,0x20202020,0x6d6f7665,0x20202020, +0x20202020,0x6e6f6d6f,0x76652020,0x20202020,0x626f7074,0x20202020,0x20202020,0x6e6f626f, +0x70742020,0x20202020,0x766f6c61,0x74696c65,0x20202020,0x6e6f766f,0x6c617469,0x6c652020, +0x7472616e,0x73666f72,0x6d202020,0x6e6f7472,0x616e7366,0x6f726d20,0x7265706f,0x73697469, +0x6f6e2020,0x6e6f7265,0x706f7369,0x74696f6e,0x756e6465,0x66696e65,0x64204f20,0x20202020, +0x20202020,0x70696320,0x20202020,0x20200000,0x61627320,0x20202020,0x20206164,0x64202020, +0x20202020,0x61646475,0x20202020,0x2020616e,0x64202020,0x20202020,0x62202020,0x20202020, +0x20206263,0x30662020,0x20202020,0x62633074,0x20202020,0x20206263,0x31662020,0x20202020, +0x62633174,0x20202020,0x20206263,0x32662020,0x20202020,0x62633274,0x20202020,0x20206261, +0x64202020,0x20202020,0x62616420,0x20202020,0x20206265,0x71202020,0x20202020,0x62676520, +0x20202020,0x20206267,0x65752020,0x20202020,0x6267657a,0x20202020,0x20206267,0x74202020, +0x20202020,0x62677475,0x20202020,0x20206267,0x747a2020,0x20202020,0x626c6520,0x20202020, +0x2020626c,0x65752020,0x20202020,0x626c657a,0x20202020,0x2020626c,0x74202020,0x20202020, +0x626c7475,0x20202020,0x2020626c,0x747a2020,0x20202020,0x626e6520,0x20202020,0x20206272, +0x65616b20,0x20202020,0x63302020,0x20202020,0x20206331,0x20202020,0x20202020,0x63322020, +0x20202020,0x20206261,0x64202020,0x20202020,0x64697620,0x20202020,0x20206469,0x76752020, +0x20202020,0x6a202020,0x20202020,0x20206a61,0x6c202020,0x20202020,0x6c612020,0x20202020, +0x20206c62,0x20202020,0x20202020,0x6c627520,0x20202020,0x20206c68,0x20202020,0x20202020, +0x6c687520,0x20202020,0x20206c69,0x20202020,0x20202020,0x6c772020,0x20202020,0x20206a72, +0x20202020,0x20202020,0x6c776331,0x20202020,0x20206c77,0x63322020,0x20202020,0x62616420, +0x20202020,0x20206d66,0x68692020,0x20202020,0x6d666c6f,0x20202020,0x20206d6f,0x76652020, +0x20202020,0x6a616c72,0x20202020,0x20207377,0x63312020,0x20202020,0x73776332,0x20202020, +0x20206261,0x64202020,0x20202020,0x6d746869,0x20202020,0x20206d74,0x6c6f2020,0x20202020, +0x6d756c20,0x20202020,0x20206d75,0x6c6f2020,0x20202020,0x6d756c6f,0x75202020,0x20206d75, +0x6c742020,0x20202020,0x6d756c74,0x75202020,0x20206e65,0x67202020,0x20202020,0x6e6f7020, +0x20202020,0x20206e6f,0x72202020,0x20202020,0x6f722020,0x20202020,0x20207265,0x6d202020, +0x20202020,0x72656d75,0x20202020,0x20207266,0x65202020,0x20202020,0x726f6c20,0x20202020, +0x2020726f,0x72202020,0x20202020,0x73622020,0x20202020,0x20207365,0x71202020,0x20202020, +0x73676520,0x20202020,0x20207367,0x65752020,0x20202020,0x73677420,0x20202020,0x20207367, +0x74752020,0x20202020,0x73682020,0x20202020,0x2020736c,0x65202020,0x20202020,0x736c6575, +0x20202020,0x2020736c,0x6c202020,0x20202020,0x736c7420,0x20202020,0x2020736c,0x74752020, +0x20202020,0x736e6520,0x20202020,0x20207372,0x61202020,0x20202020,0x73726c20,0x20202020, +0x20207375,0x62202020,0x20202020,0x73756275,0x20202020,0x20207377,0x20202020,0x20202020, +0x73797363,0x616c6c20,0x2020786f,0x72202020,0x20202020,0x6e6f7420,0x20202020,0x20206c77, +0x6c202020,0x20202020,0x6c777220,0x20202020,0x20207377,0x6c202020,0x20202020,0x73777220, +0x20202020,0x20207663,0x616c6c20,0x20202020,0x6d666330,0x20202020,0x20206d66,0x63312020, +0x20202020,0x6d666332,0x20202020,0x20206261,0x64202020,0x20202020,0x6d746330,0x20202020, +0x20206d74,0x63312020,0x20202020,0x6d746332,0x20202020,0x20206261,0x64202020,0x20202020, +0x746c6272,0x20202020,0x2020746c,0x62776920,0x20202020,0x746c6277,0x72202020,0x2020746c, +0x62702020,0x20202020,0x6c642020,0x20202020,0x20207364,0x20202020,0x20202020,0x7a313130, +0x20202020,0x20206c64,0x63312020,0x20202020,0x6c646332,0x20202020,0x20206261,0x64202020, +0x20202020,0x746c6270,0x31202020,0x20207364,0x63312020,0x20202020,0x73647332,0x20202020, +0x20206261,0x64202020,0x20202020,0x6c2e7320,0x20202020,0x20206c2e,0x64202020,0x20202020, +0x6c2e6520,0x20202020,0x2020732e,0x73202020,0x20202020,0x732e6420,0x20202020,0x2020732e, +0x65202020,0x20202020,0x6164642e,0x73202020,0x20206164,0x642e6420,0x20202020,0x6164642e, +0x65202020,0x20207375,0x622e7320,0x20202020,0x7375622e,0x64202020,0x20207375,0x622e6520, +0x20202020,0x6d756c2e,0x73202020,0x20206d75,0x6c2e6420,0x20202020,0x6d756c2e,0x65202020, +0x20206469,0x762e7320,0x20202020,0x6469762e,0x64202020,0x20206469,0x762e6520,0x20202020, +0x73717274,0x2e732020,0x20207371,0x72742e64,0x20202020,0x73717274,0x2e652020,0x20206d6f, +0x762e7320,0x20202020,0x6d6f762e,0x64202020,0x20206d6f,0x762e6520,0x20202020,0x6162732e, +0x73202020,0x20206162,0x732e6420,0x20202020,0x6162732e,0x65202020,0x20206376,0x742e732e, +0x64202020,0x6376742e,0x732e6520,0x20206376,0x742e732e,0x77202020,0x6376742e,0x642e7320, +0x20206376,0x742e642e,0x65202020,0x6376742e,0x642e7720,0x20206376,0x742e652e,0x73202020, +0x6376742e,0x652e6420,0x20206376,0x742e652e,0x77202020,0x6376742e,0x772e7320,0x20206376, +0x742e772e,0x64202020,0x6376742e,0x772e6520,0x2020632e,0x662e7320,0x20202020,0x632e662e, +0x64202020,0x2020632e,0x662e6520,0x20202020,0x632e756e,0x2e732020,0x2020632e,0x756e2e64, +0x20202020,0x632e756e,0x2e652020,0x2020632e,0x65712e73,0x20202020,0x632e6571,0x2e642020, +0x2020632e,0x65712e65,0x20202020,0x632e7565,0x712e7320,0x2020632e,0x7565712e,0x64202020, +0x632e7565,0x712e6520,0x2020632e,0x6f6c742e,0x73202020,0x632e6f6c,0x742e6420,0x2020632e, +0x6f6c742e,0x65202020,0x632e756c,0x742e7320,0x2020632e,0x756c742e,0x64202020,0x632e756c, +0x742e6520,0x2020632e,0x6f6c652e,0x73202020,0x652e6f6c,0x652e6420,0x2020632e,0x6f6c652e, +0x65202020,0x632e756c,0x652e7320,0x2020632e,0x756c652e,0x64202020,0x632e756c,0x652e6520, +0x2020632e,0x73662e73,0x20202020,0x632e7366,0x2e642020,0x2020632e,0x73662e65,0x20202020, +0x632e6e67,0x6c652e73,0x2020632e,0x6e676c65,0x2e642020,0x632e6e67,0x6c652e65,0x2020632e, +0x7365712e,0x73202020,0x632e7365,0x712e6420,0x2020632e,0x7365712e,0x65202020,0x632e6e67, +0x6c2e7320,0x2020632e,0x6e676c2e,0x64202020,0x632e6e67,0x6c2e6520,0x2020632e,0x6c742e73, +0x20202020,0x632e6c74,0x2e642020,0x2020632e,0x6c742e65,0x20202020,0x632e6e67,0x652e7320, +0x2020632e,0x6e67652e,0x64202020,0x632e6e67,0x652e6520,0x2020632e,0x6c652e73,0x20202020, +0x632e6c65,0x2e642020,0x2020632e,0x6c652e65,0x20202020,0x632e6e67,0x742e7320,0x2020632e, +0x6e67742e,0x64202020,0x632e6e67,0x742e6420,0x20206c75,0x69202020,0x20202020,0x756c7720, +0x20202020,0x2020756c,0x68202020,0x20202020,0x756c6875,0x20202020,0x20207573,0x77202020, +0x20202020,0x75736820,0x20202020,0x20206164,0x64692020,0x20202020,0x61646469,0x75202020, +0x2020736c,0x74692020,0x20202020,0x736c7469,0x75202020,0x2020616e,0x64692020,0x20202020, +0x6f726920,0x20202020,0x2020786f,0x72692020,0x20202020,0x7a323138,0x20202020,0x20206e65, +0x67752020,0x20202020,0x6265717a,0x20202020,0x2020626e,0x657a2020,0x20202020,0x6e65672e, +0x73202020,0x20206e65,0x672e6420,0x20202020,0x6e65672e,0x65202020,0x20206366,0x63312020, +0x20202020,0x63746331,0x20202020,0x20206261,0x6c202020,0x20202020,0x6267657a,0x616c2020, +0x2020626c,0x747a616c,0x20202020,0x6d746331,0x2e642020,0x20206d66,0x63312e64,0x20202020, +0x7472756e,0x632e772e,0x73207472,0x756e632e,0x772e6420,0x7472756e,0x632e772e,0x6520726f, +0x756e642e,0x772e7320,0x726f756e,0x642e772e,0x6420726f,0x756e642e,0x772e6520,0x6164646f, +0x75202020,0x20207375,0x626f7520,0x20202020,0x7472756e,0x63752e77,0x2e737472,0x756e6375, +0x2e772e64,0x7472756e,0x63752e77,0x2e65726f,0x756e6475,0x2e772e73,0x726f756e,0x64752e77, +0x2e64726f,0x756e6475,0x2e772e65,0x63666330,0x20202020,0x20206366,0x63322020,0x20202020, +0x62616420,0x20202020,0x20206374,0x63302020,0x20202020,0x63746332,0x20202020,0x20206261, +0x64202020,0x20202020,0x6c692e73,0x20202020,0x20206c69,0x2e642020,0x20202020,0x6c692e65, +0x20202020,0x2020746c,0x74202020,0x20202020,0x746c7475,0x20202020,0x20207467,0x65202020, +0x20202020,0x74676575,0x20202020,0x20207465,0x71202020,0x20202020,0x746e6520,0x20202020, +0x20206c6c,0x20202020,0x20202020,0x73632020,0x20202020,0x20206365,0x696c2e77,0x2e732020, +0x6365696c,0x2e772e64,0x20206365,0x696c2e77,0x2e652020,0x6365696c,0x752e772e,0x73206365, +0x696c752e,0x772e6420,0x6365696c,0x752e772e,0x6520666c,0x6f6f722e,0x772e7320,0x666c6f6f, +0x722e772e,0x6420666c,0x6f6f722e,0x772e6520,0x666c6f6f,0x72752e77,0x2e73666c,0x6f6f7275, +0x2e772e64,0x666c6f6f,0x72752e77,0x2e656265,0x716c2020,0x20202020,0x6265717a,0x6c202020, +0x2020626e,0x656c2020,0x20202020,0x626e657a,0x6c202020,0x2020626c,0x656c2020,0x20202020, +0x626c6575,0x6c202020,0x2020626c,0x657a6c20,0x20202020,0x7a626774,0x6c202020,0x20206267, +0x74756c20,0x20202020,0x6267747a,0x6c202020,0x2020626c,0x746c2020,0x20202020,0x626c7475, +0x6c202020,0x2020626c,0x747a6c20,0x20202020,0x626c747a,0x616c6c20,0x20206267,0x656c2020, +0x20202020,0x62676575,0x6c202020,0x20206267,0x657a6c20,0x20202020,0x6267657a,0x616c6c20, +0x20206263,0x30666c20,0x20202020,0x62633074,0x6c202020,0x20206263,0x31666c20,0x20202020, +0x62633174,0x6c202020,0x20206263,0x32666c20,0x20202020,0x62633274,0x6c202020,0x20206261, +0x64202020,0x20202020,0x62616420,0x20202020,0x20206c64,0x6c202020,0x20202020,0x6c647220, +0x20202020,0x20206c6c,0x64202020,0x20202020,0x6c777520,0x20202020,0x20207364,0x6c202020, +0x20202020,0x73647220,0x20202020,0x20207363,0x64202020,0x20202020,0x64616464,0x69202020, +0x20206461,0x64646975,0x20202020,0x64616464,0x20202020,0x20206461,0x64647520,0x20202020, +0x64737562,0x20202020,0x20206473,0x75627520,0x20202020,0x64736c6c,0x20202020,0x20206473, +0x726c2020,0x20202020,0x64737261,0x20202020,0x20206473,0x6c6c7620,0x20202020,0x6473726c, +0x76202020,0x20206473,0x72617620,0x20202020,0x646d756c,0x74202020,0x2020646d,0x756c7475, +0x20202020,0x64646976,0x20202020,0x20206464,0x69767520,0x20202020,0x6c736331,0x20202020, +0x20207373,0x63312020,0x20202020,0x646d7463,0x31202020,0x2020646d,0x66633120,0x20202020, +0x646d7463,0x30202020,0x2020646d,0x66633020,0x20202020,0x646d7463,0x32202020,0x2020646d, +0x66633220,0x20202020,0x646c6920,0x20202020,0x2020646c,0x61202020,0x20202020,0x65726574, +0x20202020,0x20207472,0x756e632e,0x6c2e7320,0x7a726f75,0x6e642e6c,0x2e736365,0x696c2e6c, +0x2e732020,0x666c6f6f,0x722e6c2e,0x73207472,0x756e632e,0x6c2e6420,0x7a726f75,0x6e642e6c, +0x2e646365,0x696c2e6c,0x2e642020,0x666c6f6f,0x722e6c2e,0x64207472,0x756e632e,0x6c2e6520, +0x726f756e,0x642e6c2e,0x65206365,0x696c2e6c,0x2e652020,0x666c6f6f,0x722e6c2e,0x65206376, +0x742e6c2e,0x73202020,0x6376742e,0x6c2e6420,0x20206376,0x742e6c2e,0x65202020,0x6376742e, +0x6c2e7720,0x20206376,0x742e732e,0x6c202020,0x6376742e,0x642e6c20,0x20206376,0x742e652e, +0x6c202020,0x6376742e,0x772e6c20,0x20206361,0x63686520,0x20202020,0x63696120,0x20202020, +0x2020756c,0x64202020,0x20202020,0x75736420,0x20202020,0x20206461,0x62732020,0x20202020, +0x646e6567,0x20202020,0x2020646e,0x65677520,0x20202020,0x646d756c,0x20202020,0x2020646d, +0x756c6f20,0x20202020,0x646d756c,0x6f752020,0x20206472,0x656d2020,0x20202020,0x6472656d, +0x75202020,0x20206472,0x6f6c2020,0x20202020,0x64726f72,0x20202020,0x20206461,0x64646f75, +0x20202020,0x64737562,0x6f752020,0x20206261,0x64202020,0x20202020,0x62616420,0x20202020, +0x20206261,0x64202020,0x20202020,0x62616420,0x20202020,0x20206261,0x64202020,0x20202020, +0x62616420,0x20202020,0x20206261,0x64202020,0x20202020,0x62616420,0x20202020,0x20206261, +0x64202020,0x20202020,0x62616420,0x20202020,0x20206261,0x64202020,0x20202020,0x62616420, +0x20202020,0x20206261,0x64202020,0x20202020,0x62616420,0x20202020,0x20206261,0x64202020, +0x20202020,0x62616420,0x20202020,0x20206261,0x64202020,0x20202020,0x62616420,0x20202020, +0x20206261,0x64202020,0x20202020,0x62616420,0x20202020,0x20206261,0x64202020,0x20202020, +0x62616420,0x20202020,0x20206261,0x64202020,0x20202020,0x62616420,0x20202020,0x20206261, +0x64202020,0x20202020,0x62616420,0x20202020,0x20206261,0x64202020,0x20202020,0x62616420, +0x20202020,0x20206261,0x64202020,0x20202020,0x62616420,0x20202020,0x20206261,0x64202020, +0x20202020,0x62616420,0x20202020,0x20206261,0x64202020,0x20202020,0x62616420,0x20202020, +0x20206261,0x64202020,0x20202020,0x62616420,0x20202020,0x20206261,0x64202020,0x20202020, +0x62616420,0x20202020,0x20206261,0x64202020,0x20202020,0x62616420,0x20202020,0x20206261, +0x64202020,0x20202020,0x62616420,0x20202020,0x20206261,0x64202020,0x20202020,0x62616420, +0x20202020,0x20206261,0x64202020,0x20202020,0x62616420,0x20202020,0x20206261,0x64202020, +0x20202020,0x62616420,0x20202020,0x20206261,0x64202020,0x20202020,0x62616420,0x20202020, +0x20206261,0x64202020,0x20202020,0x62616420,0x20202020,0x20206261,0x64202020,0x20202020, +0x62616420,0x20202020,0x20206261,0x64202020,0x20202020,0x62616420,0x20202020,0x20206261, +0x64202020,0x20202020,0x62616420,0x20202020,0x20206261,0x64202020,0x20202020,0x30313233, +0x34353637,0x38394142,0x43444546,0xfffffffe,0x0,0xffffffff,0xffffffff,0xfffffffe, +0xbaa10000,0x0,0xbaa10000,0xbaa10000,0xbaa10000,0x5010000,0xbaa00000,0x5010000, +0xbaa00000,0x0,0xbaa10000,0x0,0x80000,0x40000,0x0,0xbd210000, +0x8000,0x0,0xba210000,0x0,0xbaa10000,0xbaa10000,0xbaa10000,0x5010000, +0xba200000,0x5010000,0x38a00000,0x0,0xbaa10000,0x0,0x80000,0x40000, +0x0,0xbd210000,0x8000,0x0,0x5f4e4d29,0x28230000,0x0,0x201, +0x2080,0x10,0x0,0x0,0x7a616273,0x202020,0x7a616464,0x202020, +0x7a616464,0x75002020,0x7a616e64,0x202020,0x7a620020,0x7a626330,0x66002020,0x7a626330, +0x74002020,0x7a626331,0x66002020,0x7a626331,0x74002020,0x7a626332,0x66002020,0x7a626332, +0x74002020,0x7a6c676f,0x74610020,0x7a313200,0x7a626571,0x202020,0x7a626765,0x202020, +0x7a626765,0x75002020,0x7a626765,0x7a002020,0x7a626774,0x202020,0x7a626774,0x75002020, +0x7a626774,0x7a002020,0x7a626c65,0x202020,0x7a626c65,0x75002020,0x7a626c65,0x7a002020, +0x7a626c74,0x202020,0x7a626c74,0x75002020,0x7a626c74,0x7a002020,0x7a626e65,0x202020, +0x7a627265,0x616b0020,0x7a633000,0x7a633100,0x7a633200,0x7a333100,0x7a646976,0x202020, +0x7a646976,0x75002020,0x7a6a0020,0x7a6a616c,0x202020,0x7a6c6100,0x7a6c6200,0x7a6c6275, +0x202020,0x7a6c6800,0x7a6c6875,0x202020,0x7a6c6900,0x7a6c7700,0x7a6a7200,0x7a6c7763, +0x31002020,0x7a6c7763,0x32002020,0x7a707265,0x66002020,0x7a6d6668,0x69002020,0x7a6d666c, +0x6f002020,0x7a6d6f76,0x65002020,0x7a6a616c,0x72002020,0x7a737763,0x31002020,0x7a737763, +0x32002020,0x7a353300,0x7a6d7468,0x69002020,0x7a6d746c,0x6f002020,0x7a6d756c,0x202020, +0x7a6d756c,0x6f002020,0x7a6d756c,0x6f750020,0x7a6d756c,0x74002020,0x7a6d756c,0x74750020, +0x7a6e6567,0x202020,0x7a6e6f70,0x202020,0x7a6e6f72,0x202020,0x7a6f7200,0x7a72656d, +0x202020,0x7a72656d,0x75002020,0x7a726665,0x202020,0x7a726f6c,0x202020,0x7a726f72, +0x202020,0x7a736200,0x7a736571,0x202020,0x7a736765,0x202020,0x7a736765,0x75002020, +0x7a736774,0x202020,0x7a736774,0x75002020,0x7a736800,0x7a736c65,0x202020,0x7a736c65, +0x75002020,0x7a736c6c,0x202020,0x7a736c74,0x202020,0x7a736c74,0x75002020,0x7a736e65, +0x202020,0x7a737261,0x202020,0x7a73726c,0x202020,0x7a737562,0x202020,0x7a737562, +0x75002020,0x7a737700,0x7a737973,0x63616c6c,0x202020,0x7a786f72,0x202020,0x7a6e6f74, +0x202020,0x7a6c776c,0x202020,0x7a6c7772,0x202020,0x7a73776c,0x202020,0x7a737772, +0x202020,0x7a766361,0x6c6c0020,0x7a6d6663,0x30002020,0x7a6d6663,0x31002020,0x7a6d6663, +0x32002020,0x7a393900,0x7a6d7463,0x30002020,0x7a6d7463,0x31002020,0x7a6d7463,0x32002020, +0x7a73796e,0x63002020,0x7a746c62,0x72002020,0x7a746c62,0x77690020,0x7a746c62,0x77720020, +0x7a746c62,0x70002020,0x7a6c6400,0x7a736400,0x7a313130,0x202020,0x7a6c6463,0x31002020, +0x7a6c6463,0x32002020,0x7a746c62,0x72310020,0x7a746c62,0x70310020,0x7a736463,0x31002020, +0x7a736463,0x32002020,0x7a313137,0x202020,0x666c5f73,0x202020,0x666c5f64,0x202020, +0x666c5f65,0x202020,0x66735f73,0x202020,0x66735f64,0x202020,0x66735f65,0x202020, +0x66616464,0x5f730020,0x66616464,0x5f640020,0x66616464,0x5f650020,0x66737562,0x5f730020, +0x66737562,0x5f640020,0x66737562,0x5f650020,0x666d756c,0x5f730020,0x666d756c,0x5f640020, +0x666d756c,0x5f650020,0x66646976,0x5f730020,0x66646976,0x5f640020,0x66646976,0x5f650020, +0x66737172,0x745f7300,0x66737172,0x745f6400,0x66737172,0x745f6500,0x666d6f76,0x5f730020, +0x666d6f76,0x5f640020,0x666d6f76,0x5f650020,0x66616273,0x5f730020,0x66616273,0x5f640020, +0x66616273,0x5f650020,0x66637674,0x5f735f64,0x202020,0x66637674,0x5f735f65,0x202020, +0x66637674,0x5f735f77,0x202020,0x66637674,0x5f645f73,0x202020,0x66637674,0x5f645f65, +0x202020,0x66637674,0x5f645f77,0x202020,0x66637674,0x5f655f73,0x202020,0x66637674, +0x5f655f64,0x202020,0x66637674,0x5f655f77,0x202020,0x66637674,0x5f775f73,0x202020, +0x66637674,0x5f775f64,0x202020,0x66637674,0x5f775f65,0x202020,0x66635f66,0x5f730020, +0x66635f66,0x5f640020,0x66635f66,0x5f650020,0x66635f75,0x6e5f7300,0x66635f75,0x6e5f6400, +0x66635f75,0x6e5f6500,0x66635f65,0x715f7300,0x66635f65,0x715f6400,0x66635f65,0x715f6500, +0x66635f75,0x65715f73,0x202020,0x66635f75,0x65715f64,0x202020,0x66635f75,0x65715f65, +0x202020,0x66635f6f,0x6c745f73,0x202020,0x66635f6f,0x6c745f64,0x202020,0x66635f6f, +0x6c745f65,0x202020,0x66635f75,0x6c745f73,0x202020,0x66635f75,0x6c745f64,0x202020, +0x66635f75,0x6c745f65,0x202020,0x66635f6f,0x6c655f73,0x202020,0x66635f6f,0x6c655f64, +0x202020,0x66635f6f,0x6c655f65,0x202020,0x66635f75,0x6c655f73,0x202020,0x66635f75, +0x6c655f64,0x202020,0x66635f75,0x6c655f65,0x202020,0x66635f73,0x665f7300,0x66635f73, +0x665f6400,0x66635f73,0x665f6500,0x66635f6e,0x676c655f,0x73002020,0x66635f6e,0x676c655f, +0x64002020,0x66635f6e,0x676c655f,0x65002020,0x66635f73,0x65715f73,0x202020,0x66635f73, +0x65715f64,0x202020,0x66635f73,0x65715f65,0x202020,0x66635f6e,0x676c5f73,0x202020, +0x66635f6e,0x676c5f64,0x202020,0x66635f6e,0x676c5f65,0x202020,0x66635f6c,0x745f7300, +0x66635f6c,0x745f6400,0x66635f6c,0x745f6500,0x66635f6e,0x67655f73,0x202020,0x66635f6e, +0x67655f64,0x202020,0x66635f6e,0x67655f65,0x202020,0x66635f6c,0x655f7300,0x66635f6c, +0x655f6400,0x66635f6c,0x655f6500,0x66635f6e,0x67745f73,0x202020,0x66635f6e,0x67745f64, +0x202020,0x66635f6e,0x67745f65,0x202020,0x7a6c7569,0x202020,0x7a756c77,0x202020, +0x7a756c68,0x202020,0x7a756c68,0x75002020,0x7a757377,0x202020,0x7a757368,0x202020, +0x7a616464,0x69002020,0x7a616464,0x69750020,0x7a736c74,0x69002020,0x7a736c74,0x69750020, +0x7a616e64,0x69002020,0x7a6f7269,0x202020,0x7a786f72,0x69002020,0x7a323138,0x202020, +0x7a6e6567,0x75002020,0x7a626571,0x7a002020,0x7a626e65,0x7a002020,0x666e6567,0x5f730020, +0x666e6567,0x5f640020,0x666e6567,0x5f650020,0x7a636663,0x31002020,0x7a637463,0x31002020, +0x7a62616c,0x202020,0x7a626765,0x7a616c00,0x7a626c74,0x7a616c00,0x7a6d7463,0x315f6400, +0x7a6d6663,0x315f6400,0x7a747275,0x6e635f77,0x5f730020,0x7a747275,0x6e635f77,0x5f640020, +0x7a747275,0x6e635f77,0x5f650020,0x7a726f75,0x6e645f77,0x5f730020,0x7a726f75,0x6e645f77, +0x5f640020,0x7a726f75,0x6e645f77,0x5f650020,0x7a616464,0x6f750020,0x7a737562,0x6f750020, +0x7a747275,0x6e63755f,0x775f7300,0x7a747275,0x6e63755f,0x775f6400,0x7a747275,0x6e63755f, +0x775f6500,0x7a726f75,0x6e64755f,0x775f7300,0x7a726f75,0x6e64755f,0x775f6400,0x7a726f75, +0x6e64755f,0x775f6500,0x7a636663,0x30002020,0x7a636663,0x32002020,0x7a323438,0x202020, +0x7a637463,0x30002020,0x7a637463,0x32002020,0x7a323531,0x202020,0x666c695f,0x73002020, +0x666c695f,0x64002020,0x666c695f,0x65002020,0x7a746c74,0x202020,0x7a746c74,0x75002020, +0x7a746765,0x202020,0x7a746765,0x75002020,0x7a746571,0x202020,0x7a746e65,0x202020, +0x7a6c6c00,0x7a736300,0x7a636569,0x6c5f775f,0x73002020,0x7a636569,0x6c5f775f,0x64002020, +0x7a636569,0x6c5f775f,0x65002020,0x7a636569,0x6c755f77,0x5f730020,0x7a636569,0x6c755f77, +0x5f640020,0x7a636569,0x6c755f77,0x5f650020,0x7a666c6f,0x6f725f77,0x5f730020,0x7a666c6f, +0x6f725f77,0x5f640020,0x7a666c6f,0x6f725f77,0x5f650020,0x7a666c6f,0x6f72755f,0x775f7300, +0x7a666c6f,0x6f72755f,0x775f6400,0x7a666c6f,0x6f72755f,0x775f6500,0x7a626571,0x6c002020, +0x7a626571,0x7a6c0020,0x7a626e65,0x6c002020,0x7a626e65,0x7a6c0020,0x7a626c65,0x6c002020, +0x7a626c65,0x756c0020,0x7a626c65,0x7a6c0020,0x7a626774,0x6c002020,0x7a626774,0x756c0020, +0x7a626774,0x7a6c0020,0x7a626c74,0x6c002020,0x7a626c74,0x756c0020,0x7a626c74,0x7a6c0020, +0x7a626c74,0x7a616c6c,0x202020,0x7a626765,0x6c002020,0x7a626765,0x756c0020,0x7a626765, +0x7a6c0020,0x7a626765,0x7a616c6c,0x202020,0x7a626330,0x666c0020,0x7a626330,0x746c0020, +0x7a626331,0x666c0020,0x7a626331,0x746c0020,0x7a626332,0x666c0020,0x7a626332,0x746c0020, +0x7a323939,0x202020,0x7a333030,0x202020,0x7a6c646c,0x202020,0x7a6c6472,0x202020, +0x7a6c6c64,0x202020,0x7a6c7775,0x202020,0x7a73646c,0x202020,0x7a736472,0x202020, +0x7a736364,0x202020,0x7a646164,0x64690020,0x7a646164,0x64697500,0x7a646164,0x64002020, +0x7a646164,0x64750020,0x7a647375,0x62002020,0x7a647375,0x62750020,0x7a64736c,0x6c002020, +0x7a647372,0x6c002020,0x7a647372,0x61002020,0x7a64736c,0x6c760020,0x7a647372,0x6c760020, +0x7a647372,0x61760020,0x7a646d75,0x6c740020,0x7a646d75,0x6c747500,0x7a646469,0x76002020, +0x7a646469,0x76750020,0x7a6c7363,0x31002020,0x7a737363,0x31002020,0x7a646d74,0x63310020, +0x7a646d66,0x63310020,0x7a646d74,0x63300020,0x7a646d66,0x63300020,0x7a646d74,0x63320020, +0x7a646d66,0x63320020,0x7a646c69,0x202020,0x7a646c61,0x202020,0x7a657265,0x74002020, +0x7a747275,0x6e635f6c,0x5f730020,0x7a726f75,0x6e645f6c,0x5f730020,0x7a636569,0x6c5f6c5f, +0x73002020,0x7a666c6f,0x6f725f6c,0x5f730020,0x7a747275,0x6e635f6c,0x5f640020,0x7a726f75, +0x6e645f6c,0x5f640020,0x7a636569,0x6c5f6c5f,0x64002020,0x7a666c6f,0x6f725f6c,0x5f640020, +0x7a747275,0x6e635f6c,0x5f650020,0x7a726f75,0x6e645f6c,0x5f650020,0x7a636569,0x6c5f6c5f, +0x65002020,0x7a666c6f,0x6f725f6c,0x5f650020,0x66637674,0x5f6c5f73,0x202020,0x66637674, +0x5f6c5f64,0x202020,0x66637674,0x5f6c5f65,0x202020,0x66637674,0x5f6c5f77,0x202020, +0x66637674,0x5f735f6c,0x202020,0x66637674,0x5f645f6c,0x202020,0x66637674,0x5f655f6c, +0x202020,0x66637674,0x5f775f6c,0x202020,0x7a636163,0x68650020,0x7a636961,0x202020, +0x7a756c64,0x202020,0x7a757364,0x202020,0x7a646162,0x73002020,0x7a646e65,0x67002020, +0x7a646e65,0x67750020,0x7a646d75,0x6c002020,0x7a646d75,0x6c6f0020,0x7a646d75,0x6c6f7500, +0x7a647265,0x6d002020,0x7a647265,0x6d750020,0x7a64726f,0x6c002020,0x7a64726f,0x72002020, +0x7a646164,0x646f7500,0x7a647375,0x626f7500,0x7a756c77,0x75002020,0x7a6d6f76,0x74002020, +0x7a6d6f76,0x66002020,0x7a6d6f76,0x6e002020,0x7a6d6f76,0x7a002020,0x666d6164,0x645f7300, +0x666d6164,0x645f6400,0x666d6164,0x645f6500,0x666d7375,0x625f7300,0x666d7375,0x625f6400, +0x666d7375,0x625f6500,0x666e6d61,0x64645f73,0x202020,0x666e6d61,0x64645f64,0x202020, +0x666e6d61,0x64645f65,0x202020,0x666e6d73,0x75625f73,0x202020,0x666e6d73,0x75625f64, +0x202020,0x666e6d73,0x75625f65,0x202020,0x66726563,0x69705f73,0x202020,0x66726563, +0x69705f64,0x202020,0x66727371,0x72745f73,0x202020,0x66727371,0x72745f64,0x202020, +0x666d6f76,0x745f7300,0x666d6f76,0x745f6400,0x666d6f76,0x665f7300,0x666d6f76,0x665f6400, +0x666d6f76,0x6e5f7300,0x666d6f76,0x6e5f6400,0x666d6f76,0x7a5f7300,0x666d6f76,0x7a5f6400, +0x7a6c7778,0x63310020,0x7a6c6478,0x63310020,0x7a737778,0x63310020,0x7a736478,0x63310020, +0x7a706665,0x74636800,0x7a646374,0x72002020,0x7a646374,0x77002020,0x7a746c62,0x77002020, +0x7a6e6164,0x61002020,0x7a73736e,0x6f700020,0x7a64736c,0x6c333200,0x7a647372,0x6c333200, +0x7a647372,0x61333200,0x7a626333,0x66002020,0x7a626333,0x74002020,0x7a633300,0x7a6c7763, +0x33002020,0x7a737763,0x33002020,0x7a6d6663,0x33002020,0x7a6d7463,0x33002020,0x7a636663, +0x33002020,0x7a637463,0x33002020,0x7a736c6c,0x76002020,0x7a73726c,0x76002020,0x7a737261, +0x76002020,0x7a6d6670,0x63002020,0x7a6d7470,0x63002020,0x7a6d6670,0x73002020,0x7a6d7470, +0x73002020,0x7a626164,0x2020,0x78723000,0x78723100,0x78723200,0x78723300,0x78723400, +0x78723500,0x78723600,0x78723700,0x78723800,0x78723900,0x78723130,0x202020,0x78723131, +0x202020,0x78723132,0x202020,0x78723133,0x202020,0x78723134,0x202020,0x78723135, +0x202020,0x78723136,0x202020,0x78723137,0x202020,0x78723138,0x202020,0x78723139, +0x202020,0x78723230,0x202020,0x78723231,0x202020,0x78723232,0x202020,0x78723233, +0x202020,0x78723234,0x202020,0x78723235,0x202020,0x78723236,0x202020,0x78723237, +0x202020,0x78723238,0x202020,0x78723239,0x202020,0x78723330,0x202020,0x78723331, +0x202020,0x78667230,0x202020,0x78667231,0x202020,0x78667232,0x202020,0x78667233, +0x202020,0x78667234,0x202020,0x78667235,0x202020,0x78667236,0x202020,0x78667237, +0x202020,0x78667238,0x202020,0x78667239,0x202020,0x78667231,0x30002020,0x78667231, +0x31002020,0x78667231,0x32002020,0x78667231,0x33002020,0x78667231,0x34002020,0x78667231, +0x35002020,0x78667231,0x36002020,0x78667231,0x37002020,0x78667231,0x38002020,0x78667231, +0x39002020,0x78667232,0x30002020,0x78667232,0x31002020,0x78667232,0x32002020,0x78667232, +0x33002020,0x78667232,0x34002020,0x78667232,0x35002020,0x78667232,0x36002020,0x78667232, +0x37002020,0x78667232,0x38002020,0x78667232,0x39002020,0x78667233,0x30002020,0x78667233, +0x31002020,0x78666363,0x30002020,0x78666363,0x31002020,0x78666363,0x32002020,0x78666363, +0x33002020,0x78666363,0x34002020,0x78666363,0x35002020,0x78666363,0x36002020,0x78666363, +0x37002020,0x786e6f72,0x65670000,0x10000,0x80000000,0x10000,0x80000000,0x0, +0x0,0x0,0x0,0x0,0x8e007c,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad0085,0x1ad01ad,0x1ad01ad,0x1ad00a3,0x1ad01ad,0x1ad01ad, +0xc700c1,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad00fc,0x1ad01ad,0x1ad00c7,0xc101ad,0x1ad01ad,0x1ad01ad,0x1ad00c1,0xc701ad, +0x1ad01ad,0x1ad0082,0x1ad01ad,0xde00a3,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0088, +0x1ad01ad,0x1ad01ad,0x1ad007f,0x1ad01ad,0xa300c7,0xc100c7,0xc100a3,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x8f007d,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad0086,0x1ad01ad,0x1ad01ad,0x1ad00a4,0x1ad01ad,0x1ad01ad,0xc800c2,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad00fd,0x1ad01ad, +0x1ad00c8,0xc201ad,0x1ad01ad,0x1ad01ad,0x1ad00c2,0xc801ad,0x1ad01ad,0x1ad0083, +0x1ad01ad,0xdf00a4,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0089,0x1ad01ad,0x1ad01ad, +0x1ad0080,0x1ad01ad,0xa400c8,0xc200c8,0xc200a4,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad000d,0x1ad01ad,0x1ad01ad,0xe0011,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0014,0x1701ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad001a, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad000d, +0x1ad01ad,0x1ad01ad,0xf0012,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0015,0x1801ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad001a,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad001a,0x170018,0x1ad0014,0x1501ad,0x110012,0x1ad000e, +0xf01ad,0xd01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0101,0x10200ff,0x1000104,0x10301ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0103,0x1ad01ad,0x1ad01ad,0x10101ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0xff01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad0104,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad0103,0x1ad01ad,0x1ad01ad,0x10201ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x10001ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad0104,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x2000002, +0x2000200,0x2000000,0x3020003,0x0,0x2a01ad,0x2a002a,0x2a006c,0x2a006c, +0x2a01ad,0x2a01ad,0x770076,0x2a006c,0x1ad01ad,0x5701ad,0x570057,0x57006d, +0x57006d,0x5701ad,0x5701ad,0x7a0079,0x57006d,0x1ad01ad,0x250026,0x270028, +0x2a0130,0x6c0076,0x770000,0x460046,0x4c004c,0x570057,0x6d0079,0x7a0000, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x2a0057,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0076,0x1ad01ad,0x7901ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x5b01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad005d,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x5b005d,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x5c01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad005e,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x5c005e,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0025, +0x1ad00cf,0xd001ad,0xce01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x4601ad,0x1ad01ad,0x1ad01ad,0xd201ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad00d1,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1650166,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x17301ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x3e003e,0x3e003e,0x3e003e,0x3e003e, +0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e, +0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e, +0x3e003e,0x3e003e,0x3e003e,0x3e004d,0x50003e,0x3e003e,0x4d0050,0x3e003e, +0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e, +0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e, +0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e, +0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e, +0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e, +0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e,0x3e003e, +0x3e003e,0x3e003e,0x2,0x1ad01ad,0x301ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x14000e,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad0020,0x1ad01ad,0x1ad01ad,0x1ad0047,0x1ad01ad,0x1ad01ad,0x48004a,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x4001ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad004d,0x5001ad,0x4701ad,0x1ad01ad,0x1ad000e,0x140041,0x1ad01ad,0x1ad0038, +0x1ad01ad,0xdb0052,0x1ad005a,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0041,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad004f,0x5301ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad0056,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad0059,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x2,0x1ad01ad,0x301ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x15000f,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0021,0x1ad01ad, +0x1ad01ad,0x1ad0047,0x1ad01ad,0x1ad01ad,0x49004b,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x4001ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad004e,0x5101ad, +0x4701ad,0x1ad01ad,0x1ad000f,0x150042,0x1ad01ad,0x1ad0038,0x1ad01ad,0xdb0052, +0x1ad005a,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0042,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad004f,0x5401ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0056,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0059,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1,0x1ad01ad, +0x301ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x14000e,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0020,0x1ad01ad,0x1ad01ad,0x1ad0047, +0x1ad01ad,0x1ad01ad,0x48004a,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x4001ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad004d,0x5001ad,0x4701ad,0x1ad01ad, +0x1ad000e,0x140041,0x1ad01ad,0x1ad0039,0x1ad01ad,0x3d0052,0x1ad005a,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad0041,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad004f, +0x5301ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0055,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0059,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0xee,0x1ad01ad,0x301ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x15000f,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad0021,0x1ad01ad,0x1ad01ad,0x1ad0047,0x1ad01ad,0x1ad01ad, +0x49004b,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x4001ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad004e,0x5101ad,0x4701ad,0x1ad01ad,0x1ad000f,0x150042, +0x1ad01ad,0x1ad003a,0x1ad01ad,0x3d0052,0x1ad005a,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad0042,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad004f,0x5401ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad00ef,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad0059,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1670137,0x1ad01ad,0x301ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x14000e,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad0142,0x1ad01ad,0x1ad01ad,0x1ad0047,0x1ad01ad,0x1ad01ad,0x48004a,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x4001ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad004d,0x5001ad,0x4701ad,0x1ad01ad,0x1ad000e,0x14016d,0x1ad01ad,0x1ad016a, +0x1ad01ad,0x1690052,0x1ad005a,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad016d,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad013a,0x13c01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad0139,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad0059,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1670137,0x1ad01ad,0x301ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x15000f,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0143,0x1ad01ad, +0x1ad01ad,0x1ad0047,0x1ad01ad,0x1ad01ad,0x49004b,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x4001ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad004e,0x5101ad, +0x4701ad,0x1ad01ad,0x1ad000f,0x15016e,0x1ad01ad,0x1ad016a,0x1ad01ad,0x1690052, +0x1ad005a,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad016e,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad013a,0x13b01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0139,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0059,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1670136,0x1ad01ad, +0x301ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x14000e,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0142,0x1ad01ad,0x1ad01ad,0x1ad0047, +0x1ad01ad,0x1ad01ad,0x48004a,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x4001ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad004d,0x5001ad,0x4701ad,0x1ad01ad, +0x1ad000e,0x14016d,0x1ad01ad,0x1ad016b,0x1ad01ad,0x1680052,0x1ad005a,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad016d,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad013a, +0x13c01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0138,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad0059,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1670171,0x1ad01ad,0x301ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x15000f,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad0143,0x1ad01ad,0x1ad01ad,0x1ad0047,0x1ad01ad,0x1ad01ad, +0x49004b,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x4001ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad004e,0x5101ad,0x4701ad,0x1ad01ad,0x1ad000f,0x15016e, +0x1ad01ad,0x1ad016c,0x1ad01ad,0x1680052,0x1ad005a,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad016e,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad013a,0x13b01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad0172,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x1ad0059,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad,0x1ad01ad, +0x1ad01ad,0x1ad01ad,0x3f0000,0x0,0xffffffff,0x0,0x75616273,0x202020, +0x75616464,0x202020,0x7561646a,0x202020,0x7561656e,0x74002020,0x75616e64,0x202020, +0x75616f73,0x202020,0x75617379,0x6d002020,0x7562676e,0x202020,0x7562676e,0x62002020, +0x75627375,0x62002020,0x75636731,0x202020,0x75636732,0x202020,0x7563686b,0x68002020, +0x7563686b,0x6c002020,0x7563686b,0x6e002020,0x7563686b,0x74002020,0x75636961,0x202020, +0x75636c61,0x62002020,0x75636c62,0x64002020,0x75636f6d,0x6d002020,0x75637379,0x6d002020, +0x75637472,0x6c002020,0x75637562,0x64002020,0x75637570,0x202020,0x75637674,0x202020, +0x75637674,0x6c002020,0x75646563,0x202020,0x75646566,0x202020,0x75646966,0x202020, +0x75646976,0x202020,0x75647570,0x202020,0x75656e64,0x202020,0x75656e64,0x62002020, +0x75656e74,0x202020,0x75656f66,0x202020,0x75657175,0x202020,0x75657379,0x6d002020, +0x7566696c,0x6c002020,0x75666a70,0x202020,0x75667379,0x6d002020,0x75676571,0x202020, +0x75677274,0x202020,0x75677379,0x6d002020,0x75687379,0x6d002020,0x75696375,0x66002020, +0x75696478,0x202020,0x75696571,0x75002020,0x75696765,0x71002020,0x75696772,0x74002020, +0x75696a70,0x202020,0x75696c64,0x61002020,0x75696c64,0x76002020,0x75696c65,0x71002020, +0x75696c65,0x73002020,0x75696c6f,0x64002020,0x75696e63,0x202020,0x75696e65,0x71002020, +0x75696e69,0x74002020,0x75696e6e,0x202020,0x75696e74,0x202020,0x75696f72,0x202020, +0x7569736c,0x64002020,0x75697373,0x74002020,0x75697374,0x72002020,0x75697374,0x76002020, +0x75697861,0x202020,0x756c6162,0x202020,0x756c6264,0x202020,0x756c6264,0x79002020, +0x756c6267,0x6e002020,0x756c6361,0x202020,0x756c6461,0x202020,0x756c6461,0x70002020, +0x756c6463,0x202020,0x756c6465,0x66002020,0x756c6473,0x70002020,0x756c656e,0x64002020, +0x756c6571,0x202020,0x756c6573,0x202020,0x756c6578,0x202020,0x756c6e6f,0x74002020, +0x756c6f63,0x202020,0x756c6f64,0x202020,0x756c7379,0x6d002020,0x756c7472,0x6d002020, +0x756d6178,0x202020,0x756d696e,0x202020,0x756d6f64,0x202020,0x756d6f76,0x202020, +0x756d6f76,0x76002020,0x756d706d,0x76002020,0x756d7079,0x202020,0x756d7374,0x202020, +0x756d7573,0x202020,0x756e6567,0x202020,0x756e6571,0x202020,0x756e6f70,0x202020, +0x756e6f74,0x202020,0x756f6464,0x202020,0x756f7074,0x6e002020,0x75706172,0x202020, +0x75706465,0x66002020,0x75706d6f,0x76002020,0x75706f70,0x202020,0x75726567,0x73002020, +0x7572656d,0x202020,0x75726574,0x202020,0x75726c64,0x61002020,0x75726c64,0x63002020, +0x75726c6f,0x64002020,0x75726e64,0x202020,0x75727061,0x72002020,0x75727374,0x72002020, +0x75736465,0x66002020,0x75736773,0x202020,0x7573686c,0x202020,0x75736872,0x202020, +0x75736967,0x6e002020,0x75737172,0x202020,0x75737172,0x74002020,0x75737379,0x6d002020, +0x75737465,0x70002020,0x75737470,0x202020,0x75737472,0x202020,0x75737473,0x70002020, +0x75737562,0x202020,0x75737770,0x202020,0x75746a70,0x202020,0x75747065,0x71002020, +0x75747067,0x65002020,0x75747067,0x74002020,0x7574706c,0x65002020,0x7574706c,0x74002020, +0x7574706e,0x65002020,0x75747970,0x202020,0x75756264,0x202020,0x75756a70,0x202020, +0x75756e61,0x6c002020,0x75756e69,0x202020,0x75767265,0x67002020,0x75786a70,0x202020, +0x75786f72,0x202020,0x75787061,0x72002020,0x756d7461,0x67002020,0x75616c69,0x61002020, +0x75696c64,0x69002020,0x75697374,0x69002020,0x7569726c,0x64002020,0x75697273,0x74002020, +0x756c6472,0x63002020,0x756d7379,0x6d002020,0x75726375,0x66002020,0x756b7379,0x6d002020, +0x756f7379,0x6d002020,0x7569726c,0x76002020,0x75697273,0x76000020,0x78723000,0x78723100, +0x78723200,0x78723300,0x78723400,0x78723500,0x78723600,0x78723700,0x78723800,0x78723900, +0x78723130,0x202020,0x78723131,0x202020,0x78723132,0x202020,0x78723133,0x202020, +0x78723134,0x202020,0x78723135,0x202020,0x78723136,0x202020,0x78723137,0x202020, +0x78723138,0x202020,0x78723139,0x202020,0x78723230,0x202020,0x78723231,0x202020, +0x78723232,0x202020,0x78723233,0x202020,0x78723234,0x202020,0x78723235,0x202020, +0x78723236,0x202020,0x78723237,0x202020,0x78723238,0x202020,0x78723239,0x202020, +0x78723330,0x202020,0x78723331,0x202020,0x78667230,0x202020,0x78667231,0x202020, +0x78667232,0x202020,0x78667233,0x202020,0x78667234,0x202020,0x78667235,0x202020, +0x78667236,0x202020,0x78667237,0x202020,0x78667238,0x202020,0x78667239,0x202020, +0x78667231,0x30002020,0x78667231,0x31002020,0x78667231,0x32002020,0x78667231,0x33002020, +0x78667231,0x34002020,0x78667231,0x35002020,0x78667231,0x36002020,0x78667231,0x37002020, +0x78667231,0x38002020,0x78667231,0x39002020,0x78667232,0x30002020,0x78667232,0x31002020, +0x78667232,0x32002020,0x78667232,0x33002020,0x78667232,0x34002020,0x78667232,0x35002020, +0x78667232,0x36002020,0x78667232,0x37002020,0x78667232,0x38002020,0x78667232,0x39002020, +0x78667233,0x30002020,0x78667233,0x31002020,0x78666363,0x30002020,0x78666363,0x31002020, +0x78666363,0x32002020,0x78666363,0x33002020,0x78666363,0x34002020,0x78666363,0x35002020, +0x78666363,0x36002020,0x78666363,0x37002020,0x786e6f72,0x65670000,0x801010,0x80000000, +0x20014000,0x90004000,0x1800000,0x80000,0x1800000,0x80000,0x38c80,0xa0, +0x2000000,0x10104000,0x42004000,0x20000000,0x1,0x880000,0x10104000,0x40000000, +0x20000000,0x40000000,0x0,0x0,0x4,0x10c00000,0x60001,0x11805010, +0xc0000000,0x14000,0x94804000,0x400000,0x801010,0x80000000,0x10000,0x10004000, +0x400000,0x11004001,0x60000000,0x20000000,0x20,0x801010,0x80000000,0x20014000, +0x90004000,0x400000,0x10000000,0x40000000,0x20000000,0x10000000,0x40000000,0x20000000, +0x10000000,0x40000000,0x20000000,0x0,0x80000,0x800011,0x80000000,0x10000, +0x10000020,0x0,0x0,0x0,0x10004010,0x40000000,0x0,0x10800000, +0x180000,0x801000,0x80000000,0x4000,0x80000000,0x0,0x60606060,0x60606060, +0x60606060,0x60606060,0x60606060,0x60606060,0x60606060,0x60606060,0x6060605f,0x60606060, +0x4e4d6060,0x60606060,0x60606060,0x60606060,0x60606060,0x60606060,0x60606060,0x60606060, +0x60606060,0x60292860,0x60606060,0x60606060,0x60606060,0x60606023,0x60606060,0x60606060, +0x60606060,0x60606060,0x60606060,0x60606060,0x60606060,0x60606060,0x60606060,0x60606060, +0x60606060,0x60606060,0x60606060,0x60606060,0x60606060,0x2000000,0x0,0x1, +0x10c00000,0x60001,0x0,0x0,0xc010000,0x100000,0x8100,0x80000, +0x0,0x0,0x100,0x8100,0x80000,0x0,0x0,0x100, +0x1000101,0x1060106,0x1000100,0x3020106,0x4000000,0x0,0x4,0x4, +0x8,0x10,0x10,0x8,0x4,0x0,0x8,0x4, +0x8,0x10,0x10,0x8,0x8,0xe0f1819,0x24302020,0x20243120, +0x20202432,0x20202024,0x33202020,0x24342020,0x20243520,0x20202436,0x20202024,0x37202020, +0x24382020,0x20243920,0x20202431,0x30202024,0x31312020,0x24313220,0x20243133,0x20202431, +0x34202024,0x31352020,0x24313620,0x20243137,0x20202431,0x38202024,0x31392020,0x24323020, +0x20243231,0x20202432,0x32202024,0x32332020,0x24323420,0x20243235,0x20202432,0x36202024, +0x32372020,0x24677020,0x20247370,0x20202433,0x30202024,0x33312020,0x24663020,0x20246631, +0x20202466,0x32202024,0x66332020,0x24663420,0x20246635,0x20202466,0x36202024,0x66372020, +0x24663820,0x20246639,0x20202466,0x31302024,0x66313120,0x24663132,0x20246631,0x33202466, +0x31342024,0x66313520,0x24663136,0x20246631,0x37202466,0x31382024,0x66313920,0x24663230, +0x20246632,0x31202466,0x32322024,0x66323320,0x24663234,0x20246632,0x35202466,0x32362024, +0x66323720,0x24663238,0x20246632,0x39202466,0x33302024,0x66333120,0x24666363,0x30246663, +0x63312466,0x63633224,0x66636333,0x24666363,0x34246663,0x63352466,0x63633624,0x66636337, +0x6e6f6e65,0x20000000,0x78723000,0x78723100,0x78723200,0x78723300,0x78723400,0x78723500, +0x78723600,0x78723700,0x78723800,0x78723900,0x78723130,0x202020,0x78723131,0x202020, +0x78723132,0x202020,0x78723133,0x202020,0x78723134,0x202020,0x78723135,0x202020, +0x78723136,0x202020,0x78723137,0x202020,0x78723138,0x202020,0x78723139,0x202020, +0x78723230,0x202020,0x78723231,0x202020,0x78723232,0x202020,0x78723233,0x202020, +0x78723234,0x202020,0x78723235,0x202020,0x78723236,0x202020,0x78723237,0x202020, +0x78723238,0x202020,0x78723239,0x202020,0x78723330,0x202020,0x78723331,0x202020, +0x78667230,0x202020,0x78667231,0x202020,0x78667232,0x202020,0x78667233,0x202020, +0x78667234,0x202020,0x78667235,0x202020,0x78667236,0x202020,0x78667237,0x202020, +0x78667238,0x202020,0x78667239,0x202020,0x78667231,0x30002020,0x78667231,0x31002020, +0x78667231,0x32002020,0x78667231,0x33002020,0x78667231,0x34002020,0x78667231,0x35002020, +0x78667231,0x36002020,0x78667231,0x37002020,0x78667231,0x38002020,0x78667231,0x39002020, +0x78667232,0x30002020,0x78667232,0x31002020,0x78667232,0x32002020,0x78667232,0x33002020, +0x78667232,0x34002020,0x78667232,0x35002020,0x78667232,0x36002020,0x78667232,0x37002020, +0x78667232,0x38002020,0x78667232,0x39002020,0x78667233,0x30002020,0x78667233,0x31002020, +0x78666363,0x30002020,0x78666363,0x31002020,0x78666363,0x32002020,0x78666363,0x33002020, +0x78666363,0x34002020,0x78666363,0x35002020,0x78666363,0x36002020,0x78666363,0x37002020, +0x786e6f72,0x65670000,0x6e6f5f72,0x65670020,0x695f7265,0x67002020,0x665f7265,0x67002020, +0x645f7265,0x67002020,0x785f7265,0x67002020,0x715f7265,0x67002020,0x64695f72,0x65670020, +0x64695f73,0x5f726567,0x2020,0x0,0x66697820,0x20202020,0x2020696e,0x666f2020, +0x20202020,0x7761726e,0x696e6720,0x20206572,0x726f7220,0x20202020,0x696e7465,0x726e616c, +0x20200000,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x1010000,0x1000000,0x0,0x1010100,0x0,0x0,0x1010000,0x10000, +0x1,0x0,0x1010000,0x0,0x0,0x0,0x0,0x1000000, +0x0,0x0,0x0,0x10100,0x1000000,0x10101,0x1,0x101, +0x10000,0x0,0x10000,0x100,0x1,0x1000101,0x0,0x10000, +0x0,0x100,0x0,0x10000,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x10203,0x4050607,0x8090000,0x0,0xa0b0c, +0xd0e0f00,0x0,0x0,0x0,0x0,0x0,0x0,0xa0b0c, +0xd0e0f00,0x0,0x0,0x0,0x0,0x0,0x0,0x60016060, +0x4606060,0x60606060,0x60606060,0x60606060,0x60606060,0x60606060,0x60606060,0x60606023, +0x60606060,0x4d4e6060,0x60606060,0x60606060,0x60606060,0x60606060,0x3c606060,0x60606060, +0x60606060,0x60606060,0x60282960,0x60606060,0x60555660,0x6060605b,0x6060605f,0x60606060, +0x60606060,0x60606060,0x60606060,0x60606060,0x60606060,0x60606060,0x60606060,0x60606060, +0x60606060,0x60606060,0x608d6060,0x60606060,0x60606060,0x60606060,0x0,0x10000000, +0x1,0x2006,0x1002020,0xe058010,0x801010,0x80000000,0x14000,0x90004000, +0x10000000,0x1,0x4,0x2000,0x10104000,0x42004000,0x20000000,0x80000001, +0x880000,0x10104000,0x40000000,0x20000000,0x80000000,0x4,0x2000,0x2, +0x0,0x10,0x4,0x2000,0x200,0x2000,0x0,0x0, +0x61627320,0x61646420,0x61646a20,0x61656e74,0x616e6420,0x616f7320,0x6173796d,0x62676e20, +0x62676e62,0x666f6f20,0x636f6e64,0x6c766172,0x63686b68,0x63686b6c,0x63686b6e,0x63686b74, +0x63696120,0x636c6162,0x666f6f20,0x636f6d6d,0x6373796d,0x666f6f20,0x666f6f20,0x63757020, +0x63767420,0x6376746c,0x64656320,0x64656620,0x64696620,0x64697620,0x64757020,0x656e6420, +0x656e6462,0x656e7420,0x656f6620,0x65717520,0x6573796d,0x666f6f20,0x666a7020,0x6673796d, +0x67657120,0x67727420,0x6773796d,0x6873796d,0x69637566,0x69647820,0x69657175,0x69676571, +0x69677274,0x696a7020,0x696c6461,0x666f6f20,0x696c6571,0x696c6573,0x696c6f64,0x696e6320, +0x696e6571,0x696e6974,0x696e6e20,0x696e7420,0x696f7220,0x69736c64,0x69737374,0x69737472, +0x666f6f20,0x69786120,0x6c616220,0x666f6f20,0x6c626479,0x666f6f20,0x6c636120,0x6c646120, +0x6c646170,0x6c646320,0x666f6f20,0x6c647370,0x666f6f20,0x6c657120,0x6c657320,0x6c657820, +0x6c6e6f74,0x6c6f6320,0x6c6f6420,0x6c73796d,0x666f6f20,0x6d617820,0x6d696e20,0x6d6f6420, +0x6d6f7620,0x666f6f20,0x6d706d76,0x6d707920,0x6d737420,0x6d757320,0x6e656720,0x6e657120, +0x6e6f7020,0x6e6f7420,0x6f646420,0x6f70746e,0x70617220,0x70646566,0x706d6f76,0x706f7020, +0x72656773,0x72656d20,0x72657420,0x726c6461,0x726c6463,0x726c6f64,0x726e6420,0x72706172, +0x72737472,0x73646566,0x73677320,0x73686c20,0x73687220,0x7369676e,0x73717220,0x73717274, +0x666f6f20,0x666f6f20,0x73747020,0x73747220,0x73747370,0x73756220,0x73777020,0x746a7020, +0x666f6f20,0x666f6f20,0x666f6f20,0x666f6f20,0x666f6f20,0x666f6f20,0x74797020,0x666f6f20, +0x756a7020,0x666f6f20,0x756e6920,0x76726567,0x786a7020,0x786f7220,0x666f6f20,0x6d746167, +0x616c6961,0x666f6f20,0x666f6f20,0x69726c64,0x69727374,0x6c647263,0x6d73796d,0x72637566, +0x6b73796d,0x666f6f20,0x666f6f20,0x666f6f20,0x41434647,0x48494a4b,0x4c4d4e50,0x51525357, +0x585a0000,0x5a4d5052,0x5341544b,0x0,0x78723000,0x78723100,0x78723200,0x78723300, +0x78723400,0x78723500,0x78723600,0x78723700,0x78723800,0x78723900,0x78723130,0x202020, +0x78723131,0x202020,0x78723132,0x202020,0x78723133,0x202020,0x78723134,0x202020, +0x78723135,0x202020,0x78723136,0x202020,0x78723137,0x202020,0x78723138,0x202020, +0x78723139,0x202020,0x78723230,0x202020,0x78723231,0x202020,0x78723232,0x202020, +0x78723233,0x202020,0x78723234,0x202020,0x78723235,0x202020,0x78723236,0x202020, +0x78723237,0x202020,0x78723238,0x202020,0x78723239,0x202020,0x78723330,0x202020, +0x78723331,0x202020,0x78667230,0x202020,0x78667231,0x202020,0x78667232,0x202020, +0x78667233,0x202020,0x78667234,0x202020,0x78667235,0x202020,0x78667236,0x202020, +0x78667237,0x202020,0x78667238,0x202020,0x78667239,0x202020,0x78667231,0x30002020, +0x78667231,0x31002020,0x78667231,0x32002020,0x78667231,0x33002020,0x78667231,0x34002020, +0x78667231,0x35002020,0x78667231,0x36002020,0x78667231,0x37002020,0x78667231,0x38002020, +0x78667231,0x39002020,0x78667232,0x30002020,0x78667232,0x31002020,0x78667232,0x32002020, +0x78667232,0x33002020,0x78667232,0x34002020,0x78667232,0x35002020,0x78667232,0x36002020, +0x78667232,0x37002020,0x78667232,0x38002020,0x78667232,0x39002020,0x78667233,0x30002020, +0x78667233,0x31002020,0x78666363,0x30002020,0x78666363,0x31002020,0x78666363,0x32002020, +0x78666363,0x33002020,0x78666363,0x34002020,0x78666363,0x35002020,0x78666363,0x36002020, +0x78666363,0x37002020,0x786e6f72,0x65670000,0x10000000,0x40000000,0x10000100,0x40080000, +0x2040,0x1000000,0xc000000,0x100000,0x21000000,0x2247,0x1002020,0xe858010, +0x101800,0x2100c838,0x123aff7,0x234030a4,0x1e85e010,0x381c00,0x118c0940,0xc9202267, +0x43017020,0xe85c010,0x119b80,0x4000,0x2000000,0x20000000,0x1,0x800000, +0x10008100,0x40000201,0x280160a8,0x2858010,0x19800,0x10,0x2046,0x1002020, +0xe058010,0x100000,0x80,0x0,0x0,0x20002,0x2000000,0xf80c81ee, +0x50cfafff,0x42d6a7b7,0x6f47be16,0x23c1d00,0x10004000,0x42000000,0x20000000,0x80000001, +0x880000,0x10104000,0x40000000,0x20000000,0x80000000,0x0,0x0,0x0, +0x0,0x10104000,0x42004000,0x20000000,0x80000001,0x880000,0x10104000,0x40000000, +0x20000000,0x80000000,0x10104000,0x42004000,0x20000000,0x80000001,0x880000,0x10104000, +0x40000000,0x20000000,0x80000000,0x0,0x10004000,0x42000000,0x20000000,0x1, +0x880000,0x10004000,0x40000000,0x20000000,0x70e163b,0xd0b0516,0x7000000,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x10203,0x4050607,0x8090000,0x0,0xa0b0c, +0xd0e0f00,0x0,0x0,0x0,0x0,0x0,0x0,0xa0b0c, +0xd0e0f00,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x18,0x4038cb0,0x2400084,0x6000,0x200000,0x2000,0x1000000,0x48000, +0x1201,0x80000000,0x80000,0x20000000,0x6,0x2020,0xe910010,0x100000, +0x18,0x4038cb0,0x2400084,0x6000,0x200000,0x40000,0x40000000,0x2000, +0x1000000,0x48000,0x1201,0x80000000,0x80000,0x20000000,0x6,0x2020, +0xe910010,0x100000,0x0,0x0,0x10010440,0xffffffff,0xffffffff,0xffffffff, +0x0,0x0,0x0,0x0,0x70090000,0x63616e6e,0x6f742077,0x72697465, +0x20706669,0x656c6400,0x63616e6e,0x6f742077,0x72697465,0x20637572,0x20746162,0x6c650a00, +0x726f7574,0x696e653a,0x20796f75,0x20646964,0x6e277420,0x696e6974,0x69616c69,0x7a652077, +0x69746820,0x73745f63,0x75696e69,0x74206f72,0x2073745f,0x72656164,0x73740a00,0x726f7574, +0x696e653a,0x206e6f20,0x63757272,0x656e7420,0x726f7574,0x696e652c,0x20736565,0x20666461, +0x6464206f,0x72207365,0x7466640a,0x0,0x726f7574,0x696e653a,0x2063616e,0x6e6f7420, +0x61646420,0x746f2074,0x68697320,0x656e7472,0x79206974,0x20776173,0x20726561,0x64696e20, +0x66726f6d,0x20646973,0x6b0a0000,0x0,0x0,0x0,0x0,0x0, +0x726f7574,0x696e653a,0x20796f75,0x20646964,0x6e277420,0x696e6974,0x69616c69,0x7a652077, +0x69746820,0x73745f63,0x75696e69,0x74206f72,0x2073745f,0x72656164,0x73740a00,0x726f7574, +0x696e653a,0x206e6f20,0x63757272,0x656e7420,0x726f7574,0x696e652c,0x20736565,0x20666461, +0x6464206f,0x72207365,0x7466640a,0x0,0x726f7574,0x696e653a,0x2063616e,0x6e6f7420, +0x61646420,0x746f2074,0x68697320,0x656e7472,0x79206974,0x20776173,0x20726561,0x64696e20, +0x66726f6d,0x20646973,0x6b0a0000,0x0,0x1000eb5c,0x0,0x0,0x0, +0x726f7574,0x696e653a,0x20796f75,0x20646964,0x6e277420,0x696e6974,0x69616c69,0x7a652077, +0x69746820,0x73745f63,0x75696e69,0x74206f72,0x2073745f,0x72656164,0x73740a00,0x726f7574, +0x696e653a,0x206e6f20,0x63757272,0x656e7420,0x726f7574,0x696e652c,0x20736565,0x20666461, +0x6464206f,0x72207365,0x7466640a,0x0,0xffffffff,0xffffffff,0xffffffff,0xffffffff, +0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff,0xffffffff, +0x10203,0x4050607,0x809ffff,0xffffffff,0xff0a0b0c,0xd0e0f10,0x11121314,0x15161718, +0x191a1b1c,0x1d1e1f20,0x212223ff,0xffffffff,0xff0a0b0c,0xd0e0f10,0x11121314,0x15161718, +0x191a1b1c,0x1d1e1f20,0x212223ff,0xffffffff,0x30313233,0x34353637,0x38396162,0x63646566, +0x6768696a,0x6b6c6d6e,0x6f707172,0x73747576,0x7778797a,0x0,0x0,0x0, +0xfb52904,0x0,0x0,0x0,0xfb528f4,0x0,0x0,0x0, +0xfb546b0,0xfb556c0,0x0,0x0,0x0,0x1000000,0x0,0xfb556c0, +0x0,0x2010000,0x0,0xfb54390,0x0,0x6020000,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, +}; +static void f_open_bin_file(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_close_bin_file(uint8_t *mem, uint32_t sp); +static void f_output_inst_bin(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_cat_files(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_warning(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t func_40a9f0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t func_40aaa8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_fold_constant(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_fold_identities(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_fold_idempotents(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_put_integer_ws(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_put_sym(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_hex8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_put_hex10(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_hex_2(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_put_alpha(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_put_string(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_write_instruction(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_print_source(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_write_directive(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_output_inst_ascii(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_set_domtag(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_get_domtag(uint8_t *mem, uint32_t sp); +static uint32_t f_search_label(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_find_label(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_init_build(uint8_t *mem, uint32_t sp); +static void func_40dff0(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static void func_40e008(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static void func_40e048(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void func_40e07c(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static void func_40e238(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static uint32_t func_40e688(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static void func_40eac0(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static void func_40eda4(uint8_t *mem, uint32_t sp, uint32_t v0); +static void func_40ee60(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static void func_40ee98(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static void func_40ef9c(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static void func_40f0bc(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static uint32_t func_40f138(uint8_t *mem, uint32_t sp, uint32_t a0); +static void func_40f23c(uint8_t *mem, uint32_t sp, uint32_t v0); +static uint32_t f_build_tree(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_save_i_ptrs(uint8_t *mem, uint32_t sp); +static void f_restore_i_ptrs(uint8_t *mem, uint32_t sp); +static void f_init_ibuffer(uint8_t *mem, uint32_t sp); +static void f_grow_ibuffer(uint8_t *mem, uint32_t sp); +static uint32_t f_create_local_label(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_emit_vers(uint8_t *mem, uint32_t sp); +static void f_emit_rob(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_rab(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_rrab(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_rllb(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_ra(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_ri_(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_rii(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_rfi(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_emit_rrfi(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_emit_rrr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_rri_(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_rrri(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_rr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_emit_a(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_r(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_emit_i(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_emit_rrll(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_rll(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_emit_ll(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_emit_rill(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_define_label(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_emit_itext(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_demit_itext(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_emit_dir0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_emit_dir1(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_emit_dir2(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_alias(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_emit_regmask(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_emit_loopno(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_emit_dir_ll(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_demit_rob_(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_demit_ri(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_demit_rr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_demit_a(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_demit_regmask(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_demit_rrr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_demit_rri(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_demit_rrll(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_demit_i(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_demit_ra(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_demit_dir0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_demit_dir1(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_demit_dir2(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_demit_edata(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_demit_weakext(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_emit_cpload(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_ddefine_label(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_define_exception_label(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_append_i(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_append_d(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_clear_ibuffer(uint8_t *mem, uint32_t sp); +static void f_emit_vreg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_emit_pic(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_demit_cpalias(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_emit_cpalias(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_emit_cpadd(uint8_t *mem, uint32_t sp, uint32_t a0); +static void func_41b774(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41b7e4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41b87c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41b9b0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41bae4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41bc18(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41bd4c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41be80(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41bfb4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41c0e8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_emit_branch_rrll(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41c48c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41c4f8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41c590(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41c644(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41c6f8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41c7ac(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41c860(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41c914(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41c9c8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41ca7c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_branch_rill(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41ce78(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41cef0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41cf8c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41d048(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41d104(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41d1c0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_emit_trap_rri(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41d450(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41d4bc(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41d550(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41d600(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41d6b0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_41d760(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_emit_trap_ri(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41d9e4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41db80(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41dd04(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41e128(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41e5c8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41e6fc(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41e878(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41e9f4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41eb70(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41ecec(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41ee68(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_dw_emit_rrr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41f360(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41f54c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41f740(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41f9b4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41fcd4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_41fea8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_420024(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_4201a0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_42031c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_420498(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_420614(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_dw_emit_rri(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_420ec8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_421088(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_4210f0(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_4211b8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_dw_emit_rr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_gen_entry_exit(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_gen_entry(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_clear_saved_regs(uint8_t *mem, uint32_t sp); +static uint32_t f_is_empty_saved_regs(uint8_t *mem, uint32_t sp); +static void f_home_parameters(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_gen_reg_save_restore(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_gen_reg_save(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_demit_mask(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_demit_frame(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_emit_file(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_optimize_level(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_is_end_return(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_move_dreg_to_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_move_two_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_fasm(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_fop(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_uop_to_asm(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_jump(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_trap(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_is_saved_reg(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_is_parm_reg(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_is_fp_reg(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_restore_from_temp(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_reg(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_binary_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_flt_reg(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t func_426744(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_binary_flt_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_get_dest(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_move_to_dest(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_lsopc(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_loadstore(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_427d64(uint8_t *mem, uint32_t sp, uint32_t v0); +static void func_427e78(uint8_t *mem, uint32_t sp, uint32_t v0); +static void f_iloadistore(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_4287e4(uint8_t *mem, uint32_t sp, uint32_t v0); +static void f_rloadrstore(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_loadstore_for_two_words(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_unaligned_loadstore_for_fp_word(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_unaligned_loadstore_for_two_fp_w(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_loadstore_for_two_fp_words(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_42928c(uint8_t *mem, uint32_t sp, uint32_t v0); +static void func_42939c(uint8_t *mem, uint32_t sp, uint32_t v0); +static void func_429470(uint8_t *mem, uint32_t sp, uint32_t v0); +static void f_unaligned_loadstore(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_eval_2ops(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_eval_fp_cond(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_eval_fp_min_max(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_eval2(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_ureg(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_copy(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_eval_mov(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_get_ops(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_eval_irel(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_save_vreg(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_pass_in_register(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_load_parm_vreg(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_in_parm_regs(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_gen_regs(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_get_saved_regs_size(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_unhome_parms(uint8_t *mem, uint32_t sp); +static void f_home_parms(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_clean_tree(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_clear_pmov_regs(uint8_t *mem, uint32_t sp); +static void f_save_pmov_reg(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_load_pmov_regs(uint8_t *mem, uint32_t sp); +static uint32_t f_cvt_tab(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_rnd_tab(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_eval(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_init_eval(uint8_t *mem, uint32_t sp); +static void f_load_fp_literal(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_eval_int_flt_cvt(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_eval_flt_int_cvt(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void func_436008(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void func_4362e0(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1); +static void func_4363a8(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1); +static void func_436484(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void func_4365b0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_eval_int_int_cvt(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_eval_flt_flt_cvt(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_add_overflow(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_sub_overflow(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_is_constant(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint64_t f_llconst(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_fold(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_fold1(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_frame_offset(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_frame_offset1(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_st_feinit(uint8_t *mem, uint32_t sp); +static void f_swap_tree(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_swap_int(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void func_437238(uint8_t *mem, uint32_t sp, uint32_t a0); +static void func_43732c(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static void func_4378c4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void func_437a80(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static void func_437d94(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static void func_437f4c(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static uint32_t func_437fc8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t func_43800c(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t func_438064(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t func_4380bc(uint8_t *mem, uint32_t sp, uint32_t a0); +static void func_438128(uint8_t *mem, uint32_t sp, uint32_t a0); +static void func_4382d4(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static void f_labelopt(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_reset_pool(uint8_t *mem, uint32_t sp); +static void f_select_data_section(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_emit_list(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_output_pool(uint8_t *mem, uint32_t sp); +static uint32_t f_new_lit(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_add_to_list_no_check(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_valu_equ(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_add_to_list(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_add_to_pool(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_insert(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_append(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_make_new_label(uint8_t *mem, uint32_t sp); +static uint32_t f_make_new_jump(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_cmp_tree(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_cmp_tree_again(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_move_label(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_get_prior_stm(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_get_prior_stm1(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_find_br(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_match_uconds(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_cmp_br(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_match_conds(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_cross_jump(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_set_opts(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_pass_in_reg(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_parm_reg(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_map_pdefs_to_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_map_pars_to_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_check_amt(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_check_amt_ref(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_fix_amt_ref(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_find_non_special_reg(uint8_t *mem, uint32_t sp); +static uint32_t f_kind_of_register(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_init_regs(uint8_t *mem, uint32_t sp); +static void f_fill_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_copy_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_list_is_empty(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_print_regs(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_remove_direg(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_get_head(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_remove_head(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_append_to_list(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_remove_from_list(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_spill(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_spill_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_get_one_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_get_two_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_get_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_get_reg1(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_get_fp_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_get_fp_reg1(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_can_get_two_regs(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_spill_two_regs(uint8_t *mem, uint32_t sp); +static uint32_t f_get_two_free_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_get_one_free_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_get_free_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_get_free_fp_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_content_of(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_inc_usage(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_dec_usage(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_free_reg(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_free_fp_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_force_free_reg(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_add_to_free_list(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_add_to_fp_free_list(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_remove_from_free_list(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_remove_from_fp_free_list(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_is_available(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_check_no_used(uint8_t *mem, uint32_t sp); +static uint32_t f_usage_count(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_move_to_end_fp_list(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_move_to_end_gp_list(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_report_error(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_has_errors(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_sym_hash(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_get_data_area(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_get_sym_type(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_make_new_sym(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_change_sym_type(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_lookup_sym(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_clear_sym_tab(uint8_t *mem, uint32_t sp); +static void f_gen_sym(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_set_size(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_some_init_overlap(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_complex_init_duplicate_p(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_complex_insert_init(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_append_init(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_add_init(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_choose_area(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_force_alignment(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_emit_init(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_emit_symbol(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_output_decls(uint8_t *mem, uint32_t sp); +static void f_output_entry_point(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_set_mtag(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_get_mtag(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_get_sym_kind(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_init_temps(uint8_t *mem, uint32_t sp); +static uint32_t f_lookup_temp(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_make_new_temp(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_find_free_temp(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_gen_store(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_spill_to_temp(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_free_temp(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_temp_offset(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_temp_usage_count(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_get_temp_area_size(uint8_t *mem, uint32_t sp); +static void f_set_temps_offset(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_force_casting(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_is_power_of_two(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_get_set_const(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_gen_set_str(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_gen_set_istr(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_gen_set_equ(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_set_rewrite(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_set_rewrite_indexed(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_translate_tree(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_translate(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_cse_equ(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_cse(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_overlap(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_free_tree_and_cse(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_check_vreg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_find_vreg_mtag(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_check_reg(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_assign_vreg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_load_cse(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_uses(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_add_store(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_is_reg(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_translate_cvtl(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_need_check_hl(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_build_ucond0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_check_loads_exprs(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_indent_tree(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_print_ucode(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_print_node_1(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_print_node(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void func_44d214(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1); +static void f_print_tree(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_initialize_tree(uint8_t *mem, uint32_t sp); +static uint32_t f_gen_label_id(uint8_t *mem, uint32_t sp); +static uint32_t f_new_tree(uint8_t *mem, uint32_t sp); +static uint32_t f_build_u(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_build_u1(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_build_u2(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_build_op(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_build_1op(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_build_2op(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_free_node(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_free_tree(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_delete_statement(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_dup_tree(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_next_mark(uint8_t *mem, uint32_t sp); +static uint32_t f_ivalue(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_dwvalue(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_rvalue(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_is_zero(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_result_type(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t func_44e4d4(uint8_t *mem, uint32_t sp, uint32_t v0); +static uint32_t f_const_equal(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_u_tree(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t func_44e8d0(uint8_t *mem, uint32_t sp, uint32_t a0); +static void func_44e934(uint8_t *mem, uint32_t sp, uint32_t a0); +static void func_44e9dc(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void func_44ecc0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void func_44f0ec(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_44f2a4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_44f344(uint8_t *mem, uint32_t sp, uint32_t v0); +static void func_44f558(uint8_t *mem, uint32_t sp, uint32_t v0); +static uint32_t func_44f58c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_main(uint8_t *mem, uint32_t sp); +static void f_emit_composite_val(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_emit_val(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_emit_label_val(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_find_val_type(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void func_452e50(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_readuinstr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_initur(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_inituwrite(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_fnamelen(uint8_t *mem, uint32_t sp); +static void f_uwrite(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_454190(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1); +static void func_4541e0(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0); +static void f_uini(uint8_t *mem, uint32_t sp); +static void f_uputinit(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_uputint(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_ugetinit(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_ugetint(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_ugeteof(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_st_str_idn(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_st_fglobal_idn(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_st_readbinary(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_st_readst(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t func_45d47c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_st_writest(uint8_t *mem, uint32_t sp); +static uint32_t f_st_currentifd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_st_ifdmax(uint8_t *mem, uint32_t sp); +static void f_st_setfd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_st_fdadd(uint8_t *mem, uint32_t sp); +static uint32_t f_st_auxadd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_st_pdadd(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_st_stradd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_st_paux_ifd_iaux(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_st_str_iss(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_st_malloc(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_st_symadd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_st_ifd_pcfd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_st_pcfd_ifd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_st_psym_ifd_isym(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_st_paux_iaux(uint8_t *mem, uint32_t sp); +static uint32_t f_st_str_ifd_iss(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_st_internal(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_st_pext_iext(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_st_idn_index_fext(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_st_pdn_idn(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_st_str_extiss(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_st_idn_dn(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_st_setidn(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_st_iaux_copyty(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_st_auxisymadd(uint8_t *mem, uint32_t sp); +static void f_st_auxrndxadd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_swap_hdr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_swap_fd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_swap_fi(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_swap_sym(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_swap_ext(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_swap_pd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_swap_dn(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_swap_opt(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_gethostsex(uint8_t *mem, uint32_t sp); +static void f_st_error(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f_ldfsymorder(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_st_warning(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f__md_st_internal(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f__md_st_error(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f__md_st_str_extiss(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f__md_st_currentifd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static uint32_t f__md_st_malloc(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_exit(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_get(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_eof(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_eoln(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_peek_char(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_next_char(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_calc_size(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_reset(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void func_468f18(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void func_4690a8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_writeln(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_write_char(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f_write_string(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_write_enum(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_write_integer(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_write_cardinal(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_write_int64(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_caseerror(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static uint32_t f_new(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_dispose(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_rewrite(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3); +static void f_get_arg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2); +static void f__getbuf(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static void f_xfree(uint8_t *mem, uint32_t sp); +static void f_alloc_dispose(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_xmalloc(uint8_t *mem, uint32_t sp, uint32_t a0); +static uint32_t f_alloc_new(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_alloc_page(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_alloc_free(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_alloc_scb(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_alloc_mark(uint8_t *mem, uint32_t sp, uint32_t a0); +static void f_alloc_release(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +static uint32_t f_alloc_next_scb(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1); +int run(uint8_t *mem, int argc, char *argv[]) { +mmap_initial_data_range(mem, 0xff00000, 0x1001c000); +memcpy(mem + 0x10006be0, rodata, 0x8a20); +memcpy(mem + 0x10000000, data, 0x6be0); +MEM_S32(0x10018df0) = argc; +MEM_S32(0xffffff0) = argc; +uint32_t al = argc * 4; for (int i = 0; i < argc; i++) al += strlen(argv[i]) + 1; +uint32_t arg_addr = wrapper_malloc(mem, al); +MEM_U32(0x10018df4) = arg_addr; +MEM_U32(0xffffff4) = arg_addr; +uint32_t arg_strpos = arg_addr + argc * 4; +for (int i = 0; i < argc; i++) {MEM_U32(arg_addr + i * 4) = arg_strpos; uint32_t p = 0; do { MEM_S8(arg_strpos) = argv[i][p]; ++arg_strpos; } while (argv[i][p++] != '\0');} +setup_libc_data(mem); +int ret = f_main(mem, 0xffffff0); +return ret; +} + +static void f_open_bin_file(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40a260: +//open_bin_file: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 32) = a0; +a0 = 0x10010218; +//nop; +MEM_U32(sp + 28) = ra; +a1 = MEM_U32(sp + 32); +MEM_U32(sp + 24) = gp; +a0 = a0; +v0 = wrapper_strcpy(mem, a0, a1); +goto L40a290; +a0 = a0; +L40a290: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +a1 = 0x10006be0; +//nop; +a1 = a1; +//nop; +v0 = wrapper_fopen(mem, a0, a1); +goto L40a2ac; +//nop; +L40a2ac: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x10010210; +//nop; +v1 = v1; +if (v0 != 0) {MEM_U32(v1 + 0) = v0; +goto L40a344;} +MEM_U32(v1 + 0) = v0; +v0 = 0xfb52720; +t7 = 0xfb50300; +v0 = MEM_U32(v0 + 0); +t7 = MEM_U32(t7 + 0); +a2 = MEM_U32(sp + 32); +at = (int)v0 < (int)t7; +if (at == 0) {//nop; +goto L40a300;} +//nop; +t9 = 0xfb500a0; +t8 = v0 << 2; +t0 = t8 + t9; +a3 = MEM_U32(t0 + 0); +//nop; +goto L40a30c; +//nop; +L40a300: +a3 = 0x10006c0c; +//nop; +a3 = a3; +L40a30c: +a0 = 0xfb528e4; +a1 = 0x10006be4; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L40a324; +a1 = a1; +L40a324: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40a33c; +//nop; +L40a33c: +gp = MEM_U32(sp + 24); +//nop; +L40a344: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void f_close_bin_file(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40a354: +//close_bin_file: +//nop; +//nop; +//nop; +a0 = 0x10010210; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +a0 = MEM_U32(a0 + 0); +MEM_U32(sp + 24) = gp; +v0 = wrapper_fclose(mem, a0); +goto L40a37c; +MEM_U32(sp + 24) = gp; +L40a37c: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_output_inst_bin(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L40a38c: +//output_inst_bin: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +s0 = a3; +s1 = a2; +MEM_U32(sp + 60) = ra; +MEM_U32(sp + 56) = fp; +MEM_U32(sp + 52) = gp; +MEM_U32(sp + 48) = s7; +MEM_U32(sp + 44) = s6; +MEM_U32(sp + 40) = s5; +MEM_U32(sp + 36) = s4; +MEM_U32(sp + 32) = s3; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 64) = a0; +if (a3 == 0) {MEM_U32(sp + 68) = a1; +goto L40a4d4;} +MEM_U32(sp + 68) = a1; +s7 = 0x10006c48; +s6 = 0x10006c54; +s5 = 0x10006c18; +s3 = 0x10010210; +s2 = 0xfb528e4; +fp = 0xfb52720; +s4 = 0x1; +s7 = s7; +s6 = s6; +s5 = s5; +s3 = s3; +s2 = s2 + 0x20; +L40a40c: +//nop; +a3 = MEM_U32(s3 + 0); +a0 = s1; +a1 = 0x10; +a2 = s4; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L40a424; +a2 = s4; +L40a424: +gp = MEM_U32(sp + 52); +if (v0 == s4) {a0 = s2; +goto L40a4c8;} +a0 = s2; +t6 = 0xfb50300; +v0 = MEM_U32(fp + 0); +t6 = MEM_U32(t6 + 0); +a3 = s7; +at = (int)v0 < (int)t6; +if (at == 0) {//nop; +goto L40a464;} +//nop; +t8 = 0xfb500a0; +t7 = v0 << 2; +t9 = t7 + t8; +a3 = MEM_U32(t9 + 0); +//nop; +goto L40a464; +//nop; +L40a464: +a2 = 0x10010218; +//nop; +a1 = s5; +a2 = a2; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L40a478; +a2 = a2; +L40a478: +gp = MEM_U32(sp + 52); +a0 = s2; +//nop; +a1 = s6; +//nop; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L40a490; +//nop; +L40a490: +gp = MEM_U32(sp + 52); +a0 = s2; +//nop; +//nop; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L40a4a8; +//nop; +L40a4a8: +gp = MEM_U32(sp + 52); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40a4c0; +//nop; +L40a4c0: +gp = MEM_U32(sp + 52); +//nop; +L40a4c8: +s0 = s0 + 0xffffffff; +if (s0 != 0) {s1 = s1 + 0xfffffff0; +goto L40a40c;} +s1 = s1 + 0xfffffff0; +L40a4d4: +s3 = 0x10010210; +s2 = 0xfb528e4; +//nop; +s3 = s3; +fp = 0xfb52720; +a3 = MEM_U32(s3 + 0); +a0 = MEM_U32(sp + 64); +a2 = MEM_U32(sp + 68); +a1 = 0x10; +s2 = s2 + 0x20; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L40a500; +s2 = s2 + 0x20; +L40a500: +t0 = MEM_U32(sp + 68); +gp = MEM_U32(sp + 52); +if (v0 == t0) {a0 = s2; +goto L40a5a0;} +a0 = s2; +t1 = 0xfb50300; +v0 = MEM_U32(fp + 0); +t1 = MEM_U32(t1 + 0); +//nop; +at = (int)v0 < (int)t1; +if (at == 0) {//nop; +goto L40a544;} +//nop; +t3 = 0xfb500a0; +t2 = v0 << 2; +t4 = t2 + t3; +a3 = MEM_U32(t4 + 0); +//nop; +goto L40a550; +//nop; +L40a544: +a3 = 0x10006cdc; +//nop; +a3 = a3; +L40a550: +a1 = 0x10006cac; +a2 = 0x10010218; +//nop; +a1 = a1; +a2 = a2; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L40a568; +a2 = a2; +L40a568: +gp = MEM_U32(sp + 52); +a0 = s2; +//nop; +//nop; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L40a580; +//nop; +L40a580: +gp = MEM_U32(sp + 52); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40a598; +//nop; +L40a598: +gp = MEM_U32(sp + 52); +//nop; +L40a5a0: +ra = MEM_U32(sp + 60); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +s3 = MEM_U32(sp + 32); +s4 = MEM_U32(sp + 36); +s5 = MEM_U32(sp + 40); +s6 = MEM_U32(sp + 44); +s7 = MEM_U32(sp + 48); +fp = MEM_U32(sp + 56); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void f_cat_files(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40a5d0: +//cat_files: +//nop; +//nop; +//nop; +sp = sp + 0xffffdfa8; +//nop; +MEM_U32(sp + 60) = ra; +MEM_U32(sp + 8284) = a1; +MEM_U32(sp + 56) = gp; +MEM_U32(sp + 52) = s7; +MEM_U32(sp + 48) = s6; +MEM_U32(sp + 44) = s5; +MEM_U32(sp + 40) = s4; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 8280) = a0; +a1 = 0x9; +v0 = wrapper_open(mem, a0, a1, a2); +goto L40a61c; +a1 = 0x9; +L40a61c: +gp = MEM_U32(sp + 56); +if ((int)v0 >= 0) {s7 = v0; +goto L40a680;} +s7 = v0; +s2 = 0xfb528e4; +a1 = 0x10006ce8; +//nop; +a2 = MEM_U32(sp + 8280); +s2 = s2 + 0x20; +a0 = s2; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L40a648; +a1 = a1; +L40a648: +gp = MEM_U32(sp + 56); +a0 = s2; +//nop; +//nop; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L40a660; +//nop; +L40a660: +gp = MEM_U32(sp + 56); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40a678; +//nop; +L40a678: +gp = MEM_U32(sp + 56); +//nop; +L40a680: +s2 = 0xfb528e4; +//nop; +a0 = MEM_U32(sp + 8284); +a1 = zero; +s2 = s2 + 0x20; +v0 = wrapper_open(mem, a0, a1, a2); +goto L40a698; +s2 = s2 + 0x20; +L40a698: +gp = MEM_U32(sp + 56); +if ((int)v0 >= 0) {MEM_U32(sp + 80) = v0; +goto L40a6f4;} +MEM_U32(sp + 80) = v0; +a1 = 0x10006d08; +//nop; +a2 = MEM_U32(sp + 8284); +a0 = s2; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L40a6bc; +a1 = a1; +L40a6bc: +gp = MEM_U32(sp + 56); +a0 = s2; +//nop; +//nop; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L40a6d4; +//nop; +L40a6d4: +gp = MEM_U32(sp + 56); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40a6ec; +//nop; +L40a6ec: +gp = MEM_U32(sp + 56); +//nop; +L40a6f4: +//nop; +a0 = s7; +a1 = zero; +a2 = 0x2; +v0 = wrapper_lseek(mem, a0, a1, a2); +goto L40a708; +a2 = 0x2; +L40a708: +gp = MEM_U32(sp + 56); +if ((int)v0 >= 0) {//nop; +goto L40a760;} +//nop; +a1 = 0x10006d28; +//nop; +a0 = s2; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L40a728; +a1 = a1; +L40a728: +gp = MEM_U32(sp + 56); +a0 = s2; +//nop; +//nop; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L40a740; +//nop; +L40a740: +gp = MEM_U32(sp + 56); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40a758; +//nop; +L40a758: +gp = MEM_U32(sp + 56); +//nop; +L40a760: +//nop; +s4 = sp + 0x58; +a0 = MEM_U32(sp + 80); +a1 = s4; +a2 = 0x2000; +v0 = wrapper_read(mem, a0, a1, a2); +goto L40a778; +a2 = 0x2000; +L40a778: +gp = MEM_U32(sp + 56); +if (v0 == 0) {s1 = v0; +goto L40a92c;} +s1 = v0; +s6 = 0xfb500a0; +s5 = 0xfb50300; +s3 = 0xfb52720; +//nop; +L40a794: +if ((int)v0 >= 0) {a0 = s2; +goto L40a81c;} +a0 = s2; +a3 = MEM_U32(s3 + 0); +t6 = MEM_U32(s5 + 0); +a2 = MEM_U32(sp + 8284); +at = (int)a3 < (int)t6; +if (at == 0) {t7 = a3 << 2; +goto L40a7c4;} +t7 = a3 << 2; +t8 = s6 + t7; +s0 = MEM_U32(t8 + 0); +//nop; +goto L40a7d0; +//nop; +L40a7c4: +s0 = 0x10006d74; +//nop; +s0 = s0; +L40a7d0: +a1 = 0x10006d48; +//nop; +a3 = s0; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L40a7e4; +a1 = a1; +L40a7e4: +gp = MEM_U32(sp + 56); +a0 = s2; +//nop; +//nop; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L40a7fc; +//nop; +L40a7fc: +gp = MEM_U32(sp + 56); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40a814; +//nop; +L40a814: +gp = MEM_U32(sp + 56); +//nop; +L40a81c: +//nop; +a0 = s7; +a1 = s4; +a2 = s1; +v0 = wrapper_write(mem, a0, a1, a2); +goto L40a830; +a2 = s1; +L40a830: +gp = MEM_U32(sp + 56); +if (v0 == s1) {//nop; +goto L40a90c;} +//nop; +t9 = MEM_U32(s3 + 0); +a0 = s7; +if (t9 != 0) {//nop; +goto L40a864;} +//nop; +//nop; +a1 = s4 + v0; +a2 = s1 - v0; +v0 = wrapper_write(mem, a0, a1, a2); +goto L40a85c; +a2 = s1 - v0; +L40a85c: +gp = MEM_U32(sp + 56); +//nop; +L40a864: +a1 = 0x10006d80; +//nop; +a2 = MEM_U32(sp + 8280); +a0 = s2; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L40a87c; +a1 = a1; +L40a87c: +a3 = MEM_U32(s3 + 0); +t0 = MEM_U32(s5 + 0); +gp = MEM_U32(sp + 56); +at = (int)a3 < (int)t0; +if (at == 0) {a0 = s2; +goto L40a8c0;} +a0 = s2; +t1 = a3 << 2; +a1 = 0x10006da8; +//nop; +t2 = s6 + t1; +a2 = MEM_U32(t2 + 0); +a0 = s2; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L40a8b4; +a1 = a1; +L40a8b4: +gp = MEM_U32(sp + 56); +//nop; +goto L40a8dc; +//nop; +L40a8c0: +a1 = 0x10006dac; +//nop; +a2 = a3; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L40a8d4; +a1 = a1; +L40a8d4: +gp = MEM_U32(sp + 56); +//nop; +L40a8dc: +//nop; +a0 = s2; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L40a8ec; +//nop; +L40a8ec: +gp = MEM_U32(sp + 56); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L40a904; +//nop; +L40a904: +gp = MEM_U32(sp + 56); +//nop; +L40a90c: +//nop; +a0 = MEM_U32(sp + 80); +a1 = s4; +a2 = 0x2000; +v0 = wrapper_read(mem, a0, a1, a2); +goto L40a920; +a2 = 0x2000; +L40a920: +gp = MEM_U32(sp + 56); +if (v0 != 0) {s1 = v0; +goto L40a794;} +s1 = v0; +L40a92c: +//nop; +a0 = s7; +//nop; +v0 = wrapper_close(mem, a0); +goto L40a93c; +//nop; +L40a93c: +gp = MEM_U32(sp + 56); +a0 = MEM_U32(sp + 80); +//nop; +//nop; +//nop; +v0 = wrapper_close(mem, a0); +goto L40a954; +//nop; +L40a954: +ra = MEM_U32(sp + 60); +gp = MEM_U32(sp + 56); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +s4 = MEM_U32(sp + 40); +s5 = MEM_U32(sp + 44); +s6 = MEM_U32(sp + 48); +s7 = MEM_U32(sp + 52); +sp = sp + 0x2058; +return; +sp = sp + 0x2058; +//nop; +//nop; +//nop; +} + +static void f_warning(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40a990: +//warning: +//nop; +//nop; +//nop; +t6 = 0x10018dfc; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if (t6 == 0) {a3 = a0; +goto L40a9e0;} +a3 = a0; +a2 = 0x10018e00; +a0 = 0xfb528e4; +a1 = 0x10006dc0; +//nop; +a2 = MEM_U32(a2 + 0); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L40a9d8; +a1 = a1; +L40a9d8: +gp = MEM_U32(sp + 24); +//nop; +L40a9e0: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t func_40a9f0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L40a9f0: +t6 = MEM_U32(sp + 16); +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +if (t6 == 0) {MEM_U32(sp + 12) = a3; +goto L40aa70;} +MEM_U32(sp + 12) = a3; +t2 = a0 ^ a2; +v0 = (int)zero < (int)t2; +t8 = a0; +t9 = a1; +t0 = a2; +t1 = a3; +if ((int)v0 > 0) {t3 = a1 ^ a3; +goto L40aa38;} +t3 = a1 ^ a3; +if ((int)t2 < 0) {//nop; +goto L40aa38;} +//nop; +v0 = t3 < 0x0; +v0 = v0 ^ 0x1; +L40aa38: +if (v0 == 0) {t5 = t9 + t1; +goto L40aaa0;} +t5 = t9 + t1; +at = t5 < t1; +t4 = at + t8; +t4 = t4 + t0; +t6 = t4 ^ t8; +v0 = (int)t6 < (int)0x0; +if ((int)v0 > 0) {t7 = t5 ^ t9; +goto L40aa68;} +t7 = t5 ^ t9; +if ((int)t6 > 0) {//nop; +goto L40aa68;} +//nop; +v0 = t7 < 0x0; +L40aa68: +//nop; +return v0; +//nop; +L40aa70: +t2 = MEM_U32(sp + 0); +t4 = MEM_U32(sp + 8); +t3 = MEM_U32(sp + 4); +t0 = ~t2; +t5 = MEM_U32(sp + 12); +v0 = t0 < t4; +if ((int)v0 > 0) {t1 = ~t3; +goto L40aaa0;} +t1 = ~t3; +at = t4 < t0; +if (at != 0) {//nop; +goto L40aaa0;} +//nop; +v0 = t1 < t5; +L40aaa0: +//nop; +return v0; +//nop; +} + +static uint32_t func_40aaa8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L40aaa8: +t6 = MEM_U32(sp + 16); +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +if (t6 == 0) {MEM_U32(sp + 12) = a3; +goto L40ab24;} +MEM_U32(sp + 12) = a3; +t2 = a0 ^ a2; +v0 = (int)t2 < (int)0x0; +t8 = a0; +t9 = a1; +t0 = a2; +t1 = a3; +if ((int)v0 > 0) {t3 = a1 ^ a3; +goto L40aaec;} +t3 = a1 ^ a3; +if ((int)t2 > 0) {//nop; +goto L40aaec;} +//nop; +v0 = t3 < 0x0; +L40aaec: +if (v0 == 0) {at = t9 < t1; +goto L40ab4c;} +at = t9 < t1; +t4 = t8 - t0; +t4 = t4 - at; +t6 = t4 ^ t8; +v0 = (int)t6 < (int)0x0; +t5 = t9 - t1; +if ((int)v0 > 0) {t7 = t5 ^ t9; +goto L40ab1c;} +t7 = t5 ^ t9; +if ((int)t6 > 0) {//nop; +goto L40ab1c;} +//nop; +v0 = t7 < 0x0; +L40ab1c: +//nop; +return v0; +//nop; +L40ab24: +t2 = MEM_U32(sp + 0); +t0 = MEM_U32(sp + 8); +t3 = MEM_U32(sp + 4); +t1 = MEM_U32(sp + 12); +v0 = t2 < t0; +if ((int)v0 > 0) {at = t0 < t2; +goto L40ab4c;} +at = t0 < t2; +if (at != 0) {//nop; +goto L40ab4c;} +//nop; +v0 = t3 < t1; +L40ab4c: +//nop; +return v0; +//nop; +} + +static uint32_t f_fold_constant(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L40ab54: +//fold_constant: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb8; +t6 = MEM_U32(sp + 88); +t7 = MEM_U32(sp + 92); +at = a0 < 0x8e; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 80) = a2; +MEM_U32(sp + 84) = a3; +MEM_U32(sp + 40) = t6; +if (at == 0) {MEM_U32(sp + 44) = t7; +goto L40b658;} +MEM_U32(sp + 44) = t7; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10006dfc[] = { +&&L40b158, +&&L40ac58, +&&L40b658, +&&L40b658, +&&L40aefc, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40abac, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40ad78, +&&L40b644, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b464, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b244, +&&L40b2d0, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40af20, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b354, +&&L40b3e0, +&&L40b658, +&&L40b090, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b584, +&&L40b4c4, +&&L40ae60, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40ad38, +&&L40b658, +&&L40b658, +&&L40b0fc, +&&L40b494, +&&L40b658, +&&L40b074, +&&L40b1f8, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40af68, +&&L40afc0, +&&L40b658, +&&L40b0c0, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40acc8, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40b658, +&&L40af44, +}; +dest = Lswitch10006dfc[a0]; +//nop; +goto *dest; +//nop; +L40abac: +t9 = MEM_U32(sp + 104); +a2 = MEM_U32(sp + 88); +if (t9 == 0) {a0 = 0x0; +goto L40abc4;} +a0 = 0x0; +v0 = zero; +goto L40b678; +v0 = zero; +L40abc4: +//nop; +a3 = MEM_U32(sp + 92); +a1 = 0x1; +temp64 = wrapper___ll_lshift((int64_t)(((uint64_t)a0 << 32) | (uint64_t)a1), (((uint64_t)a2 << 32) | (uint64_t)a3)); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L40abd4; +a1 = 0x1; +L40abd4: +t2 = MEM_U32(sp + 80); +t3 = MEM_U32(sp + 84); +at = v1 < 0x1; +t0 = MEM_U32(sp + 96); +t4 = v0 - at; +t5 = v1 + 0xffffffff; +gp = MEM_U32(sp + 32); +t6 = t2 & t4; +t7 = t3 & t5; +MEM_U32(sp + 68) = t7; +if (t0 == 0) {MEM_U32(sp + 64) = t6; +goto L40b660;} +MEM_U32(sp + 64) = t6; +a3 = MEM_U32(sp + 92); +a2 = MEM_U32(sp + 88); +//nop; +at = a3 < 0x1; +a0 = 0x0; +a1 = 0x1; +a3 = a3 + 0xffffffff; +a2 = a2 - at; +temp64 = wrapper___ll_lshift((int64_t)(((uint64_t)a0 << 32) | (uint64_t)a1), (((uint64_t)a2 << 32) | (uint64_t)a3)); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L40ac28; +a2 = a2 - at; +L40ac28: +t8 = MEM_U32(sp + 64); +t9 = MEM_U32(sp + 68); +t2 = t8 ^ v0; +t3 = t9 ^ v1; +at = t3 < v1; +t4 = t2 - v0; +gp = MEM_U32(sp + 32); +t4 = t4 - at; +t5 = t3 - v1; +MEM_U32(sp + 68) = t5; +MEM_U32(sp + 64) = t4; +goto L40b660; +MEM_U32(sp + 64) = t4; +L40ac58: +t1 = MEM_U32(sp + 104); +t0 = MEM_U32(sp + 96); +if (t1 == 0) {t7 = MEM_U32(sp + 84); +goto L40aca0;} +t7 = MEM_U32(sp + 84); +//nop; +a0 = MEM_U32(sp + 80); +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = MEM_U32(sp + 92); +t9 = t9; +MEM_U32(sp + 16) = t0; +v0 = func_40a9f0(mem, sp, a0, a1, a2, a3); +goto L40ac88; +MEM_U32(sp + 16) = t0; +L40ac88: +gp = MEM_U32(sp + 32); +if (v0 == 0) {t7 = MEM_U32(sp + 84); +goto L40aca0;} +t7 = MEM_U32(sp + 84); +v0 = zero; +goto L40b678; +v0 = zero; +t7 = MEM_U32(sp + 84); +L40aca0: +t9 = MEM_U32(sp + 92); +t6 = MEM_U32(sp + 80); +t3 = t7 + t9; +t8 = MEM_U32(sp + 88); +at = t3 < t9; +t2 = at + t6; +t2 = t2 + t8; +MEM_U32(sp + 64) = t2; +MEM_U32(sp + 68) = t3; +goto L40b660; +MEM_U32(sp + 68) = t3; +L40acc8: +t4 = MEM_U32(sp + 104); +t0 = MEM_U32(sp + 96); +if (t4 == 0) {t6 = MEM_U32(sp + 80); +goto L40ad10;} +t6 = MEM_U32(sp + 80); +//nop; +a0 = MEM_U32(sp + 80); +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = MEM_U32(sp + 92); +t9 = t9; +MEM_U32(sp + 16) = t0; +v0 = func_40aaa8(mem, sp, a0, a1, a2, a3); +goto L40acf8; +MEM_U32(sp + 16) = t0; +L40acf8: +gp = MEM_U32(sp + 32); +if (v0 == 0) {t6 = MEM_U32(sp + 80); +goto L40ad10;} +t6 = MEM_U32(sp + 80); +v0 = zero; +goto L40b678; +v0 = zero; +t6 = MEM_U32(sp + 80); +L40ad10: +t7 = MEM_U32(sp + 84); +t8 = MEM_U32(sp + 88); +t9 = MEM_U32(sp + 92); +t2 = t6 - t8; +at = t7 < t9; +t2 = t2 - at; +t3 = t7 - t9; +MEM_U32(sp + 68) = t3; +MEM_U32(sp + 64) = t2; +goto L40b660; +MEM_U32(sp + 64) = t2; +L40ad38: +t5 = MEM_U32(sp + 104); +a0 = MEM_U32(sp + 80); +if (t5 == 0) {//nop; +goto L40ad50;} +//nop; +v0 = zero; +goto L40b678; +v0 = zero; +L40ad50: +//nop; +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = MEM_U32(sp + 92); +//nop; +temp64 = wrapper___ll_mul((int64_t)(((uint64_t)a0 << 32) | (uint64_t)a1), (int64_t)(((uint64_t)a2 << 32) | (uint64_t)a3)); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L40ad68; +//nop; +L40ad68: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 64) = v0; +MEM_U32(sp + 68) = v1; +goto L40b660; +MEM_U32(sp + 68) = v1; +L40ad78: +t4 = MEM_U32(sp + 88); +t5 = MEM_U32(sp + 92); +if (t4 != 0) {t0 = MEM_U32(sp + 96); +goto L40adb4;} +t0 = MEM_U32(sp + 96); +if (t5 != 0) {t0 = MEM_U32(sp + 96); +goto L40adb4;} +t0 = MEM_U32(sp + 96); +a0 = 0x10006ddc; +//nop; +a0 = a0; +//nop; +f_warning(mem, sp, a0); +goto L40ada4; +//nop; +L40ada4: +gp = MEM_U32(sp + 32); +v0 = zero; +goto L40b678; +v0 = zero; +t0 = MEM_U32(sp + 96); +L40adb4: +a0 = MEM_U32(sp + 80); +if (t0 == 0) {//nop; +goto L40ae38;} +//nop; +t1 = MEM_U32(sp + 104); +t6 = MEM_U32(sp + 80); +if (t1 == 0) {at = 0xffffffff; +goto L40ae0c;} +at = 0xffffffff; +t7 = MEM_U32(sp + 84); +if (t6 != at) {at = 0x80000000; +goto L40ae0c;} +at = 0x80000000; +if (t7 != at) {v1 = sp + 0x58; +goto L40ae0c;} +v1 = sp + 0x58; +t8 = MEM_U32(v1 + 0); +v0 = 0xffffffff; +if (v0 != t8) {//nop; +goto L40ae0c;} +//nop; +t9 = MEM_U32(v1 + 4); +//nop; +if (v0 != t9) {//nop; +goto L40ae0c;} +//nop; +v0 = zero; +goto L40b678; +v0 = zero; +L40ae0c: +//nop; +a0 = MEM_U32(sp + 80); +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = MEM_U32(sp + 92); +//nop; +temp64 = wrapper___ll_div((int64_t)(((uint64_t)a0 << 32) | (uint64_t)a1), (int64_t)(((uint64_t)a2 << 32) | (uint64_t)a3)); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L40ae28; +//nop; +L40ae28: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 64) = v0; +MEM_U32(sp + 68) = v1; +goto L40b660; +MEM_U32(sp + 68) = v1; +L40ae38: +//nop; +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 44); +//nop; +temp64 = wrapper___ull_div((((uint64_t)a0 << 32) | (uint64_t)a1), (((uint64_t)a2 << 32) | (uint64_t)a3)); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L40ae50; +//nop; +L40ae50: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 64) = v0; +MEM_U32(sp + 68) = v1; +goto L40b660; +MEM_U32(sp + 68) = v1; +L40ae60: +t2 = MEM_U32(sp + 88); +t3 = MEM_U32(sp + 92); +if (t2 != 0) {t0 = MEM_U32(sp + 96); +goto L40ae9c;} +t0 = MEM_U32(sp + 96); +if (t3 != 0) {t0 = MEM_U32(sp + 96); +goto L40ae9c;} +t0 = MEM_U32(sp + 96); +a0 = 0x10006dec; +//nop; +a0 = a0; +//nop; +f_warning(mem, sp, a0); +goto L40ae8c; +//nop; +L40ae8c: +gp = MEM_U32(sp + 32); +v0 = zero; +goto L40b678; +v0 = zero; +t0 = MEM_U32(sp + 96); +L40ae9c: +a0 = MEM_U32(sp + 80); +if (t0 == 0) {//nop; +goto L40aed4;} +//nop; +//nop; +a0 = MEM_U32(sp + 80); +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = MEM_U32(sp + 92); +//nop; +temp64 = wrapper___ll_rem((((uint64_t)a0 << 32) | (uint64_t)a1), (int64_t)(((uint64_t)a2 << 32) | (uint64_t)a3)); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L40aec4; +//nop; +L40aec4: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 64) = v0; +MEM_U32(sp + 68) = v1; +goto L40b660; +MEM_U32(sp + 68) = v1; +L40aed4: +//nop; +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 44); +//nop; +temp64 = wrapper___ull_rem((((uint64_t)a0 << 32) | (uint64_t)a1), (((uint64_t)a2 << 32) | (uint64_t)a3)); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L40aeec; +//nop; +L40aeec: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 64) = v0; +MEM_U32(sp + 68) = v1; +goto L40b660; +MEM_U32(sp + 68) = v1; +L40aefc: +t4 = MEM_U32(sp + 80); +t5 = MEM_U32(sp + 84); +t6 = MEM_U32(sp + 88); +t7 = MEM_U32(sp + 92); +t8 = t4 & t6; +t9 = t5 & t7; +MEM_U32(sp + 68) = t9; +MEM_U32(sp + 64) = t8; +goto L40b660; +MEM_U32(sp + 64) = t8; +L40af20: +t2 = MEM_U32(sp + 80); +t3 = MEM_U32(sp + 84); +t4 = MEM_U32(sp + 88); +t5 = MEM_U32(sp + 92); +t6 = t2 | t4; +t7 = t3 | t5; +MEM_U32(sp + 68) = t7; +MEM_U32(sp + 64) = t6; +goto L40b660; +MEM_U32(sp + 64) = t6; +L40af44: +t8 = MEM_U32(sp + 80); +t9 = MEM_U32(sp + 84); +t2 = MEM_U32(sp + 88); +t3 = MEM_U32(sp + 92); +t4 = t8 ^ t2; +t5 = t9 ^ t3; +MEM_U32(sp + 68) = t5; +MEM_U32(sp + 64) = t4; +goto L40b660; +MEM_U32(sp + 64) = t4; +L40af68: +t1 = MEM_U32(sp + 100); +a0 = MEM_U32(sp + 80); +if (t1 == 0) {//nop; +goto L40af98;} +//nop; +t7 = MEM_U32(sp + 84); +t9 = MEM_U32(sp + 92); +//nop; +t4 = t7 << (t9 & 0x1f); +t6 = (int)t4 >> 31; +MEM_U32(sp + 64) = t6; +MEM_U32(sp + 68) = t4; +goto L40b660; +MEM_U32(sp + 68) = t4; +L40af98: +//nop; +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = MEM_U32(sp + 92); +//nop; +temp64 = wrapper___ll_lshift((int64_t)(((uint64_t)a0 << 32) | (uint64_t)a1), (((uint64_t)a2 << 32) | (uint64_t)a3)); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L40afb0; +//nop; +L40afb0: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 64) = v0; +MEM_U32(sp + 68) = v1; +goto L40b660; +MEM_U32(sp + 68) = v1; +L40afc0: +t5 = MEM_U32(sp + 100); +t0 = MEM_U32(sp + 96); +if (t5 == 0) {//nop; +goto L40b014;} +//nop; +t0 = MEM_U32(sp + 96); +t9 = MEM_U32(sp + 84); +if (t0 == 0) {t2 = 0x0; +goto L40b000;} +t2 = 0x0; +t3 = MEM_U32(sp + 84); +t9 = MEM_U32(sp + 92); +//nop; +t6 = (int)t3 >> (t9 & 0x1f); +t2 = (int)t6 >> 31; +MEM_U32(sp + 64) = t2; +MEM_U32(sp + 68) = t6; +goto L40b660; +MEM_U32(sp + 68) = t6; +L40b000: +t5 = MEM_U32(sp + 92); +MEM_U32(sp + 64) = t2; +t6 = t9 >> (t5 & 0x1f); +MEM_U32(sp + 68) = t6; +goto L40b660; +MEM_U32(sp + 68) = t6; +L40b014: +if (t0 == 0) {//nop; +goto L40b048;} +//nop; +//nop; +a0 = MEM_U32(sp + 80); +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 88); +a3 = MEM_U32(sp + 92); +//nop; +temp64 = wrapper___ll_rshift((int64_t)(((uint64_t)a0 << 32) | (uint64_t)a1), (((uint64_t)a2 << 32) | (uint64_t)a3)); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L40b038; +//nop; +L40b038: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 64) = v0; +MEM_U32(sp + 68) = v1; +goto L40b660; +MEM_U32(sp + 68) = v1; +L40b048: +//nop; +a0 = MEM_U32(sp + 80); +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 44); +//nop; +temp64 = wrapper___ull_rshift((((uint64_t)a0 << 32) | (uint64_t)a1), (((uint64_t)a2 << 32) | (uint64_t)a3)); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L40b064; +//nop; +L40b064: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 64) = v0; +MEM_U32(sp + 68) = v1; +goto L40b660; +MEM_U32(sp + 68) = v1; +L40b074: +t8 = MEM_U32(sp + 80); +t9 = MEM_U32(sp + 84); +t4 = ~t8; +t5 = ~t9; +MEM_U32(sp + 68) = t5; +MEM_U32(sp + 64) = t4; +goto L40b660; +MEM_U32(sp + 64) = t4; +L40b090: +t6 = MEM_U32(sp + 80); +t7 = MEM_U32(sp + 84); +t2 = 0x0; +at = 0x0; +at = at ^ t6; +t2 = t2 ^ t7; +t2 = t2 | at; +t9 = t2 < 0x1; +t8 = (int)t9 >> 31; +MEM_U32(sp + 64) = t8; +MEM_U32(sp + 68) = t9; +goto L40b660; +MEM_U32(sp + 68) = t9; +L40b0c0: +t1 = MEM_U32(sp + 104); +a2 = MEM_U32(sp + 80); +if (t1 == 0) {a3 = MEM_U32(sp + 84); +goto L40b0dc;} +a3 = MEM_U32(sp + 84); +v0 = zero; +goto L40b678; +v0 = zero; +a3 = MEM_U32(sp + 84); +L40b0dc: +//nop; +a0 = a2; +a1 = a3; +temp64 = wrapper___ll_mul((int64_t)(((uint64_t)a0 << 32) | (uint64_t)a1), (int64_t)(((uint64_t)a2 << 32) | (uint64_t)a3)); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L40b0ec; +a1 = a3; +L40b0ec: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 64) = v0; +MEM_U32(sp + 68) = v1; +goto L40b660; +MEM_U32(sp + 68) = v1; +L40b0fc: +t6 = MEM_U32(sp + 104); +t0 = MEM_U32(sp + 96); +if (t6 == 0) {t8 = MEM_U32(sp + 80); +goto L40b138;} +t8 = MEM_U32(sp + 80); +if (t0 == 0) {at = 0xffffffff; +goto L40b134;} +at = 0xffffffff; +t2 = MEM_U32(sp + 80); +t3 = MEM_U32(sp + 84); +if (t2 != at) {at = 0x80000000; +goto L40b134;} +at = 0x80000000; +if (t3 != at) {t8 = MEM_U32(sp + 80); +goto L40b138;} +t8 = MEM_U32(sp + 80); +v0 = zero; +goto L40b678; +v0 = zero; +L40b134: +t8 = MEM_U32(sp + 80); +L40b138: +t9 = MEM_U32(sp + 84); +t4 = ~t8; +at = t9 < 0x1; +t4 = t4 + at; +t5 = -t9; +MEM_U32(sp + 68) = t5; +MEM_U32(sp + 64) = t4; +goto L40b660; +MEM_U32(sp + 64) = t4; +L40b158: +t0 = MEM_U32(sp + 96); +t6 = MEM_U32(sp + 80); +if (t0 == 0) {at = 0xffffffff; +goto L40b1a4;} +at = 0xffffffff; +t7 = MEM_U32(sp + 84); +if (t6 != at) {at = 0x80000000; +goto L40b1a4;} +at = 0x80000000; +if (t7 != at) {//nop; +goto L40b1a4;} +//nop; +t1 = MEM_U32(sp + 104); +t2 = MEM_U32(sp + 80); +if (t1 == 0) {t3 = MEM_U32(sp + 84); +goto L40b198;} +t3 = MEM_U32(sp + 84); +v0 = zero; +goto L40b678; +v0 = zero; +t3 = MEM_U32(sp + 84); +L40b198: +MEM_U32(sp + 64) = t2; +MEM_U32(sp + 68) = t3; +goto L40b660; +MEM_U32(sp + 68) = t3; +L40b1a4: +if (t0 == 0) {t6 = MEM_U32(sp + 80); +goto L40b1e8;} +t6 = MEM_U32(sp + 80); +t8 = MEM_U32(sp + 80); +t9 = MEM_U32(sp + 84); +if ((int)t8 > 0) {t6 = MEM_U32(sp + 80); +goto L40b1e8;} +t6 = MEM_U32(sp + 80); +if ((int)t8 < 0) {at = t9 < 0x1; +goto L40b1cc;} +at = t9 < 0x1; +t6 = MEM_U32(sp + 80); +goto L40b1e8; +t6 = MEM_U32(sp + 80); +L40b1cc: +t4 = ~t8; +t4 = t4 + at; +t5 = -t9; +MEM_U32(sp + 68) = t5; +MEM_U32(sp + 64) = t4; +goto L40b660; +MEM_U32(sp + 64) = t4; +t6 = MEM_U32(sp + 80); +L40b1e8: +t7 = MEM_U32(sp + 84); +MEM_U32(sp + 64) = t6; +MEM_U32(sp + 68) = t7; +goto L40b660; +MEM_U32(sp + 68) = t7; +L40b1f8: +//nop; +a0 = MEM_U32(sp + 80); +a1 = MEM_U32(sp + 84); +a2 = 0x0; +a3 = 0x2; +temp64 = wrapper___ll_rem((((uint64_t)a0 << 32) | (uint64_t)a1), (int64_t)(((uint64_t)a2 << 32) | (uint64_t)a3)); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L40b210; +a3 = 0x2; +L40b210: +gp = MEM_U32(sp + 32); +if (v0 != 0) {t8 = 0x0; +goto L40b234;} +t8 = 0x0; +if (v1 != 0) {t2 = 0x0; +goto L40b234;} +t2 = 0x0; +t3 = 0x0; +MEM_U32(sp + 68) = t3; +MEM_U32(sp + 64) = t2; +goto L40b660; +MEM_U32(sp + 64) = t2; +L40b234: +t9 = 0x1; +MEM_U32(sp + 68) = t9; +MEM_U32(sp + 64) = t8; +goto L40b660; +MEM_U32(sp + 64) = t8; +L40b244: +t0 = MEM_U32(sp + 96); +t4 = MEM_U32(sp + 80); +if (t0 == 0) {t6 = MEM_U32(sp + 88); +goto L40b298;} +t6 = MEM_U32(sp + 88); +t4 = MEM_U32(sp + 80); +t6 = MEM_U32(sp + 88); +t5 = MEM_U32(sp + 84); +t7 = MEM_U32(sp + 92); +t2 = (int)t6 < (int)t4; +if ((int)t2 > 0) {at = (int)t4 < (int)t6; +goto L40b280;} +at = (int)t4 < (int)t6; +if (at != 0) {t8 = (int)t2 >> 31; +goto L40b284;} +t8 = (int)t2 >> 31; +t2 = t5 < t7; +t2 = t2 ^ 0x1; +L40b280: +t8 = (int)t2 >> 31; +L40b284: +MEM_U32(sp + 64) = t8; +t9 = t2; +MEM_U32(sp + 68) = t2; +goto L40b660; +MEM_U32(sp + 68) = t2; +t6 = MEM_U32(sp + 88); +L40b298: +t5 = MEM_U32(sp + 84); +t7 = MEM_U32(sp + 92); +t2 = t6 < t4; +if ((int)t2 > 0) {at = t4 < t6; +goto L40b2bc;} +at = t4 < t6; +if (at != 0) {t8 = (int)t2 >> 31; +goto L40b2c0;} +t8 = (int)t2 >> 31; +t2 = t5 < t7; +t2 = t2 ^ 0x1; +L40b2bc: +t8 = (int)t2 >> 31; +L40b2c0: +MEM_U32(sp + 64) = t8; +t9 = t2; +MEM_U32(sp + 68) = t2; +goto L40b660; +MEM_U32(sp + 68) = t2; +L40b2d0: +t0 = MEM_U32(sp + 96); +t4 = MEM_U32(sp + 88); +if (t0 == 0) {t6 = MEM_U32(sp + 80); +goto L40b320;} +t6 = MEM_U32(sp + 80); +t4 = MEM_U32(sp + 88); +t6 = MEM_U32(sp + 80); +t5 = MEM_U32(sp + 92); +t7 = MEM_U32(sp + 84); +t2 = (int)t4 < (int)t6; +if ((int)t2 > 0) {at = (int)t6 < (int)t4; +goto L40b308;} +at = (int)t6 < (int)t4; +if (at != 0) {t8 = (int)t2 >> 31; +goto L40b30c;} +t8 = (int)t2 >> 31; +t2 = t5 < t7; +L40b308: +t8 = (int)t2 >> 31; +L40b30c: +MEM_U32(sp + 64) = t8; +t9 = t2; +MEM_U32(sp + 68) = t2; +goto L40b660; +MEM_U32(sp + 68) = t2; +t6 = MEM_U32(sp + 80); +L40b320: +t5 = MEM_U32(sp + 92); +t7 = MEM_U32(sp + 84); +t2 = t4 < t6; +if ((int)t2 > 0) {at = t6 < t4; +goto L40b340;} +at = t6 < t4; +if (at != 0) {t8 = (int)t2 >> 31; +goto L40b344;} +t8 = (int)t2 >> 31; +t2 = t5 < t7; +L40b340: +t8 = (int)t2 >> 31; +L40b344: +MEM_U32(sp + 64) = t8; +t9 = t2; +MEM_U32(sp + 68) = t2; +goto L40b660; +MEM_U32(sp + 68) = t2; +L40b354: +t0 = MEM_U32(sp + 96); +t4 = MEM_U32(sp + 88); +if (t0 == 0) {t6 = MEM_U32(sp + 80); +goto L40b3a8;} +t6 = MEM_U32(sp + 80); +t4 = MEM_U32(sp + 88); +t6 = MEM_U32(sp + 80); +t5 = MEM_U32(sp + 92); +t7 = MEM_U32(sp + 84); +t2 = (int)t6 < (int)t4; +if ((int)t2 > 0) {at = (int)t4 < (int)t6; +goto L40b390;} +at = (int)t4 < (int)t6; +if (at != 0) {t8 = (int)t2 >> 31; +goto L40b394;} +t8 = (int)t2 >> 31; +t2 = t5 < t7; +t2 = t2 ^ 0x1; +L40b390: +t8 = (int)t2 >> 31; +L40b394: +MEM_U32(sp + 64) = t8; +t9 = t2; +MEM_U32(sp + 68) = t2; +goto L40b660; +MEM_U32(sp + 68) = t2; +t6 = MEM_U32(sp + 80); +L40b3a8: +t5 = MEM_U32(sp + 92); +t7 = MEM_U32(sp + 84); +t2 = t6 < t4; +if ((int)t2 > 0) {at = t4 < t6; +goto L40b3cc;} +at = t4 < t6; +if (at != 0) {t8 = (int)t2 >> 31; +goto L40b3d0;} +t8 = (int)t2 >> 31; +t2 = t5 < t7; +t2 = t2 ^ 0x1; +L40b3cc: +t8 = (int)t2 >> 31; +L40b3d0: +MEM_U32(sp + 64) = t8; +t9 = t2; +MEM_U32(sp + 68) = t2; +goto L40b660; +MEM_U32(sp + 68) = t2; +L40b3e0: +t0 = MEM_U32(sp + 96); +t4 = MEM_U32(sp + 80); +if (t0 == 0) {t6 = MEM_U32(sp + 88); +goto L40b430;} +t6 = MEM_U32(sp + 88); +t4 = MEM_U32(sp + 80); +t6 = MEM_U32(sp + 88); +t5 = MEM_U32(sp + 84); +t7 = MEM_U32(sp + 92); +t2 = (int)t4 < (int)t6; +if ((int)t2 > 0) {at = (int)t6 < (int)t4; +goto L40b418;} +at = (int)t6 < (int)t4; +if (at != 0) {t8 = (int)t2 >> 31; +goto L40b41c;} +t8 = (int)t2 >> 31; +t2 = t5 < t7; +L40b418: +t8 = (int)t2 >> 31; +L40b41c: +MEM_U32(sp + 64) = t8; +t9 = t2; +MEM_U32(sp + 68) = t2; +goto L40b660; +MEM_U32(sp + 68) = t2; +t6 = MEM_U32(sp + 88); +L40b430: +t5 = MEM_U32(sp + 84); +t7 = MEM_U32(sp + 92); +t2 = t4 < t6; +if ((int)t2 > 0) {at = t6 < t4; +goto L40b450;} +at = t6 < t4; +if (at != 0) {t8 = (int)t2 >> 31; +goto L40b454;} +t8 = (int)t2 >> 31; +t2 = t5 < t7; +L40b450: +t8 = (int)t2 >> 31; +L40b454: +MEM_U32(sp + 64) = t8; +t9 = t2; +MEM_U32(sp + 68) = t2; +goto L40b660; +MEM_U32(sp + 68) = t2; +L40b464: +t4 = MEM_U32(sp + 80); +t5 = MEM_U32(sp + 84); +t6 = MEM_U32(sp + 88); +t7 = MEM_U32(sp + 92); +at = t4 ^ t6; +t2 = t5 ^ t7; +t2 = t2 | at; +t9 = t2 < 0x1; +t8 = (int)t9 >> 31; +MEM_U32(sp + 64) = t8; +MEM_U32(sp + 68) = t9; +goto L40b660; +MEM_U32(sp + 68) = t9; +L40b494: +t4 = MEM_U32(sp + 80); +t5 = MEM_U32(sp + 84); +t6 = MEM_U32(sp + 88); +t7 = MEM_U32(sp + 92); +at = t4 ^ t6; +t2 = t5 ^ t7; +t2 = t2 | at; +t9 = zero < t2; +t8 = (int)t9 >> 31; +MEM_U32(sp + 64) = t8; +MEM_U32(sp + 68) = t9; +goto L40b660; +MEM_U32(sp + 68) = t9; +L40b4c4: +t0 = MEM_U32(sp + 96); +t2 = MEM_U32(sp + 88); +if (t0 == 0) {t8 = MEM_U32(sp + 80); +goto L40b538;} +t8 = MEM_U32(sp + 80); +t4 = MEM_U32(sp + 88); +t6 = MEM_U32(sp + 80); +t5 = MEM_U32(sp + 92); +t7 = MEM_U32(sp + 84); +t2 = (int)t6 < (int)t4; +if ((int)t2 > 0) {at = (int)t4 < (int)t6; +goto L40b500;} +at = (int)t4 < (int)t6; +if (at != 0) {t8 = (int)t2 >> 31; +goto L40b504;} +t8 = (int)t2 >> 31; +t2 = t5 < t7; +t2 = t2 ^ 0x1; +L40b500: +t8 = (int)t2 >> 31; +L40b504: +if (t8 != 0) {t9 = t2; +goto L40b514;} +t9 = t2; +if (t2 == 0) {t4 = MEM_U32(sp + 88); +goto L40b524;} +t4 = MEM_U32(sp + 88); +L40b514: +MEM_U32(sp + 64) = t6; +MEM_U32(sp + 68) = t7; +goto L40b660; +MEM_U32(sp + 68) = t7; +t4 = MEM_U32(sp + 88); +L40b524: +t5 = MEM_U32(sp + 92); +MEM_U32(sp + 64) = t4; +MEM_U32(sp + 68) = t5; +goto L40b660; +MEM_U32(sp + 68) = t5; +t8 = MEM_U32(sp + 80); +L40b538: +t3 = MEM_U32(sp + 92); +t9 = MEM_U32(sp + 84); +at = t2 < t8; +if (at != 0) {at = t8 < t2; +goto L40b570;} +at = t8 < t2; +if (at != 0) {at = t3 < t9; +goto L40b55c;} +at = t3 < t9; +if (at != 0) {t4 = MEM_U32(sp + 88); +goto L40b574;} +t4 = MEM_U32(sp + 88); +L40b55c: +t6 = MEM_U32(sp + 80); +t7 = MEM_U32(sp + 84); +MEM_U32(sp + 64) = t6; +MEM_U32(sp + 68) = t7; +goto L40b660; +MEM_U32(sp + 68) = t7; +L40b570: +t4 = MEM_U32(sp + 88); +L40b574: +t5 = MEM_U32(sp + 92); +MEM_U32(sp + 64) = t4; +MEM_U32(sp + 68) = t5; +goto L40b660; +MEM_U32(sp + 68) = t5; +L40b584: +t0 = MEM_U32(sp + 96); +t6 = MEM_U32(sp + 80); +if (t0 == 0) {t4 = MEM_U32(sp + 88); +goto L40b5f8;} +t4 = MEM_U32(sp + 88); +t2 = MEM_U32(sp + 80); +t8 = MEM_U32(sp + 88); +t3 = MEM_U32(sp + 84); +t9 = MEM_U32(sp + 92); +t6 = (int)t8 < (int)t2; +if ((int)t6 > 0) {at = (int)t2 < (int)t8; +goto L40b5c0;} +at = (int)t2 < (int)t8; +if (at != 0) {t4 = (int)t6 >> 31; +goto L40b5c4;} +t4 = (int)t6 >> 31; +t6 = t3 < t9; +t6 = t6 ^ 0x1; +L40b5c0: +t4 = (int)t6 >> 31; +L40b5c4: +if (t4 != 0) {//nop; +goto L40b5d4;} +//nop; +if (t6 == 0) {t8 = MEM_U32(sp + 88); +goto L40b5e4;} +t8 = MEM_U32(sp + 88); +L40b5d4: +MEM_U32(sp + 64) = t2; +MEM_U32(sp + 68) = t3; +goto L40b660; +MEM_U32(sp + 68) = t3; +t8 = MEM_U32(sp + 88); +L40b5e4: +t9 = MEM_U32(sp + 92); +MEM_U32(sp + 64) = t8; +MEM_U32(sp + 68) = t9; +goto L40b660; +MEM_U32(sp + 68) = t9; +t4 = MEM_U32(sp + 88); +L40b5f8: +t7 = MEM_U32(sp + 84); +t5 = MEM_U32(sp + 92); +at = t6 < t4; +if (at != 0) {at = t4 < t6; +goto L40b630;} +at = t4 < t6; +if (at != 0) {at = t7 < t5; +goto L40b61c;} +at = t7 < t5; +if (at != 0) {t8 = MEM_U32(sp + 88); +goto L40b634;} +t8 = MEM_U32(sp + 88); +L40b61c: +t2 = MEM_U32(sp + 80); +t3 = MEM_U32(sp + 84); +MEM_U32(sp + 64) = t2; +MEM_U32(sp + 68) = t3; +goto L40b660; +MEM_U32(sp + 68) = t3; +L40b630: +t8 = MEM_U32(sp + 88); +L40b634: +t9 = MEM_U32(sp + 92); +MEM_U32(sp + 64) = t8; +MEM_U32(sp + 68) = t9; +goto L40b660; +MEM_U32(sp + 68) = t9; +L40b644: +t6 = MEM_U32(sp + 80); +t7 = MEM_U32(sp + 84); +MEM_U32(sp + 64) = t6; +MEM_U32(sp + 68) = t7; +goto L40b660; +MEM_U32(sp + 68) = t7; +L40b658: +v0 = zero; +goto L40b678; +v0 = zero; +L40b660: +t1 = MEM_U32(sp + 108); +t4 = MEM_U32(sp + 64); +t5 = MEM_U32(sp + 68); +v0 = 0x1; +MEM_U32(t1 + 0) = t4; +MEM_U32(t1 + 4) = t5; +L40b678: +ra = MEM_U32(sp + 36); +sp = sp + 0x48; +//nop; +return v0; +//nop; +} + +static uint32_t f_fold_identities(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L40b688: +//fold_identities: +//nop; +//nop; +//nop; +at = (int)a0 < (int)0x1e; +MEM_U32(sp + 8) = a2; +if (at != 0) {MEM_U32(sp + 12) = a3; +goto L40b6f0;} +MEM_U32(sp + 12) = a3; +at = (int)a0 < (int)0x3d; +if (at != 0) {t6 = a0 + 0xffffffa5; +goto L40b6dc;} +t6 = a0 + 0xffffffa5; +at = t6 < 0x33; +if (at == 0) {//nop; +goto L40b6e8;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10007034[] = { +&&L40b790, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b738, +&&L40b738, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b738, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b6e8, +&&L40b718, +}; +dest = Lswitch10007034[t6]; +//nop; +goto *dest; +//nop; +L40b6dc: +at = 0x3c; +if (a0 == at) {t8 = MEM_U32(sp + 8); +goto L40b71c;} +t8 = MEM_U32(sp + 8); +L40b6e8: +v0 = zero; +return v0; +v0 = zero; +L40b6f0: +at = 0x1; +if (a0 == at) {at = 0x4; +goto L40b718;} +at = 0x4; +if (a0 == at) {v1 = sp + 0x8; +goto L40b768;} +v1 = sp + 0x8; +at = 0x1d; +if (a0 == at) {t6 = MEM_U32(sp + 8); +goto L40b7b4;} +t6 = MEM_U32(sp + 8); +v0 = zero; +return v0; +v0 = zero; +L40b718: +t8 = MEM_U32(sp + 8); +L40b71c: +t9 = MEM_U32(sp + 12); +if (t8 != 0) {v0 = zero; +goto L40b7e4;} +v0 = zero; +if (t9 != 0) {v0 = zero; +goto L40b7e4;} +v0 = zero; +v0 = 0x1; +return v0; +v0 = 0x1; +L40b738: +t0 = MEM_U32(sp + 8); +t1 = MEM_U32(sp + 12); +if (t0 != 0) {v0 = zero; +goto L40b7e4;} +v0 = zero; +if (t1 != 0) {v0 = zero; +goto L40b7e4;} +v0 = zero; +t7 = MEM_U32(sp + 16); +//nop; +if (t7 == 0) {v0 = zero; +goto L40b7e4;} +v0 = zero; +v0 = 0x1; +return v0; +v0 = 0x1; +L40b768: +t2 = MEM_U32(v1 + 0); +v0 = 0xffffffff; +if (v0 != t2) {//nop; +goto L40b7e0;} +//nop; +t3 = MEM_U32(v1 + 4); +//nop; +if (v0 != t3) {v0 = zero; +goto L40b7e4;} +v0 = zero; +v0 = 0x1; +return v0; +v0 = 0x1; +L40b790: +t4 = MEM_U32(sp + 8); +t5 = MEM_U32(sp + 12); +if (t4 != 0) {at = 0x1; +goto L40b7e0;} +at = 0x1; +if (t5 != at) {v0 = zero; +goto L40b7e4;} +v0 = zero; +v0 = 0x1; +return v0; +v0 = 0x1; +t6 = MEM_U32(sp + 8); +L40b7b4: +t7 = MEM_U32(sp + 12); +if (t6 != 0) {at = 0x1; +goto L40b7e0;} +at = 0x1; +if (t7 != at) {v0 = zero; +goto L40b7e4;} +v0 = zero; +t8 = MEM_U32(sp + 16); +//nop; +if (t8 == 0) {v0 = zero; +goto L40b7e4;} +v0 = zero; +v0 = 0x1; +return v0; +v0 = 0x1; +L40b7e0: +v0 = zero; +L40b7e4: +//nop; +return v0; +//nop; +} + +static uint32_t f_fold_idempotents(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L40b7ec: +//fold_idempotents: +at = 0x4; +MEM_U32(sp + 8) = a2; +if (a0 == at) {MEM_U32(sp + 12) = a3; +goto L40b82c;} +MEM_U32(sp + 12) = a3; +at = 0x3c; +if (a0 == at) {v1 = sp + 0x8; +goto L40b85c;} +v1 = sp + 0x8; +at = 0x57; +if (a0 == at) {at = 0x5b; +goto L40b890;} +at = 0x5b; +if (a0 == at) {at = 0x69; +goto L40b82c;} +at = 0x69; +if (a0 == at) {t6 = MEM_U32(sp + 8); +goto L40b894;} +t6 = MEM_U32(sp + 8); +v0 = zero; +return v0; +v0 = zero; +L40b82c: +t6 = MEM_U32(sp + 8); +t7 = MEM_U32(sp + 12); +if (t6 != 0) {v0 = zero; +goto L40b8d8;} +v0 = zero; +if (t7 != 0) {t8 = 0x0; +goto L40b8d4;} +t8 = 0x0; +t0 = MEM_U32(sp + 20); +t9 = 0x0; +v0 = 0x1; +MEM_U32(t0 + 4) = t9; +MEM_U32(t0 + 0) = t8; +return v0; +MEM_U32(t0 + 0) = t8; +L40b85c: +t1 = MEM_U32(v1 + 0); +v0 = 0xffffffff; +if (v0 != t1) {//nop; +goto L40b8d4;} +//nop; +t2 = MEM_U32(v1 + 4); +t4 = 0xffffffff; +if (v0 != t2) {t5 = 0xffffffff; +goto L40b8d4;} +t5 = 0xffffffff; +t3 = MEM_U32(sp + 20); +v0 = 0x1; +MEM_U32(t3 + 0) = t4; +MEM_U32(t3 + 4) = t5; +return v0; +MEM_U32(t3 + 4) = t5; +L40b890: +t6 = MEM_U32(sp + 8); +L40b894: +t7 = MEM_U32(sp + 12); +if (t6 != 0) {at = 0x1; +goto L40b8d4;} +at = 0x1; +if (t7 != at) {v0 = zero; +goto L40b8d8;} +v0 = zero; +t8 = MEM_U32(sp + 16); +t0 = 0x0; +if (t8 == 0) {t1 = 0x0; +goto L40b8d4;} +t1 = 0x0; +t9 = MEM_U32(sp + 20); +v0 = 0x1; +MEM_U32(t9 + 0) = t0; +MEM_U32(t9 + 4) = t1; +return v0; +MEM_U32(t9 + 4) = t1; +v0 = zero; +return v0; +v0 = zero; +L40b8d4: +v0 = zero; +L40b8d8: +//nop; +return v0; +//nop; +} + +static void f_put_integer_ws(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40b8e0: +//put_integer_ws: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +if (a1 == 0) {MEM_U32(sp + 36) = a1; +goto L40b94c;} +MEM_U32(sp + 36) = a1; +if ((int)a1 <= 0) {a2 = 0x1; +goto L40b928;} +a2 = 0x1; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = 0x2b; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40b920; +a3 = 0xa; +L40b920: +gp = MEM_U32(sp + 24); +//nop; +L40b928: +t9 = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 36); +a0 = MEM_U32(t9 + 0); +//nop; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40b944; +a3 = 0xa; +L40b944: +gp = MEM_U32(sp + 24); +//nop; +L40b94c: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void f_put_sym(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40b95c: +//put_sym: +//nop; +//nop; +//nop; +sp = sp + 0xfffffbc0; +MEM_U32(sp + 20) = s0; +s0 = a1; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if (a1 == 0) {MEM_U32(sp + 1088) = a0; +goto L40bb6c;} +MEM_U32(sp + 1088) = a0; +if ((int)a1 >= 0) {a2 = 0x1; +goto L40b9d4;} +a2 = 0x1; +a0 = MEM_U32(a0 + 0); +//nop; +a1 = 0x24; +a3 = 0xa; +MEM_U32(sp + 52) = a0; +f_write_char(mem, sp, a0, a1, a2); +goto L40b9a4; +MEM_U32(sp + 52) = a0; +L40b9a4: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 52); +if ((int)s0 >= 0) {a1 = s0; +goto L40b9b8;} +a1 = s0; +a1 = -s0; +L40b9b8: +//nop; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40b9c8; +a3 = 0xa; +L40b9c8: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L40bb70; +ra = MEM_U32(sp + 28); +L40b9d4: +//nop; +a0 = s0; +//nop; +v0 = f_st_fglobal_idn(mem, sp, a0); +goto L40b9e4; +//nop; +L40b9e4: +gp = MEM_U32(sp + 24); +at = 0x1; +if (v0 == at) {//nop; +goto L40ba50;} +//nop; +t7 = 0x10018e98; +at = 0x3; +t7 = MEM_U32(t7 + 0); +t8 = MEM_U32(sp + 1088); +if (t7 == at) {a2 = 0x2; +goto L40ba50;} +a2 = 0x2; +a0 = MEM_U32(t8 + 0); +a1 = 0x10007502; +//nop; +a3 = 0x2; +MEM_U32(sp + 52) = a0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40ba28; +a1 = a1; +L40ba28: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 52); +//nop; +a1 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40ba44; +a3 = 0xa; +L40ba44: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L40bb70; +ra = MEM_U32(sp + 28); +L40ba50: +t0 = 0x10007102; +t9 = sp + 0x40; +t0 = t0; +t3 = t0 + 0x3fc; +L40ba60: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t9 = t9 + 0xc; +MEM_U8(t9 + -8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + -8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + -8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + -8 + 3) = (uint8_t)(at >> 0); +//swr $at, -5($t9) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t9 + -4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + -4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + -4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + -4 + 3) = (uint8_t)(at >> 0); +if (t0 != t3) {//swr $at, -1($t9) +goto L40ba60;} +//swr $at, -1($t9) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +a0 = s0; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +//nop; +//nop; +//nop; +v0 = f_st_str_idn(mem, sp, a0, a1, a2, a3); +goto L40bac4; +//nop; +L40bac4: +gp = MEM_U32(sp + 24); +at = 0xffffffff; +if (v0 != at) {a2 = 0x2; +goto L40bb1c;} +a2 = 0x2; +t4 = MEM_U32(sp + 1088); +a1 = 0x10007100; +//nop; +a0 = MEM_U32(t4 + 0); +a3 = 0x2; +a1 = a1; +MEM_U32(sp + 52) = a0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40baf4; +MEM_U32(sp + 52) = a0; +L40baf4: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 52); +//nop; +a1 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40bb10; +a3 = 0xa; +L40bb10: +gp = MEM_U32(sp + 24); +t6 = MEM_U32(sp + 1088); +goto L40bb4c; +t6 = MEM_U32(sp + 1088); +L40bb1c: +t5 = MEM_U8(v0 + 0); +v1 = v0 + 0x1; +if (t5 == 0) {t6 = MEM_U32(sp + 1088); +goto L40bb4c;} +t6 = MEM_U32(sp + 1088); +a1 = MEM_U8(v1 + -1); +a0 = sp + 0x40; +L40bb34: +MEM_U8(a0 + 0) = (uint8_t)a1; +a1 = MEM_U8(v1 + 0); +a0 = a0 + 0x1; +if (a1 != 0) {v1 = v1 + 0x1; +goto L40bb34;} +v1 = v1 + 0x1; +t6 = MEM_U32(sp + 1088); +L40bb4c: +//nop; +a0 = MEM_U32(t6 + 0); +a1 = sp + 0x40; +a2 = 0x400; +a3 = zero; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40bb64; +a3 = zero; +L40bb64: +gp = MEM_U32(sp + 24); +//nop; +L40bb6c: +ra = MEM_U32(sp + 28); +L40bb70: +s0 = MEM_U32(sp + 20); +sp = sp + 0x440; +return; +sp = sp + 0x440; +} + +static void f_hex8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40bb7c: +//hex8: +//nop; +//nop; +//nop; +t2 = 0x30; +t3 = 0x78; +v0 = 0x1000161c; +MEM_U8(a1 + 0) = (uint8_t)t2; +MEM_U8(a1 + 1) = (uint8_t)t3; +v1 = 0x1c; +a2 = a1 + 0x3; +a3 = 0x18; +t0 = 0x14; +t1 = 0x10; +t4 = 0xfffffff0; +L40bbb4: +t7 = (int)a0 >> (v1 & 0x1f); +t8 = t7 & 0xf; +t9 = v0 + t8; +t5 = MEM_U8(t9 + 0); +t7 = (int)a0 >> (a3 & 0x1f); +t8 = t7 & 0xf; +t9 = v0 + t8; +MEM_U8(a2 + -1) = (uint8_t)t5; +t5 = MEM_U8(t9 + 0); +t7 = (int)a0 >> (t0 & 0x1f); +t8 = t7 & 0xf; +t9 = v0 + t8; +MEM_U8(a2 + 0) = (uint8_t)t5; +t5 = MEM_U8(t9 + 0); +t7 = (int)a0 >> (t1 & 0x1f); +t8 = t7 & 0xf; +t9 = v0 + t8; +MEM_U8(a2 + 1) = (uint8_t)t5; +t5 = MEM_U8(t9 + 0); +t1 = t1 + 0xfffffff0; +t0 = t0 + 0xfffffff0; +a3 = a3 + 0xfffffff0; +v1 = v1 + 0xfffffff0; +a2 = a2 + 0x4; +if (t4 != t1) {MEM_U8(a2 + -2) = (uint8_t)t5; +goto L40bbb4;} +MEM_U8(a2 + -2) = (uint8_t)t5; +MEM_U8(a1 + 0) = (uint8_t)t2; +MEM_U8(a1 + 1) = (uint8_t)t3; +return; +MEM_U8(a1 + 1) = (uint8_t)t3; +} + +static void f_put_hex10(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40bc28: +//put_hex10: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 28) = ra; +a0 = a1; +MEM_U32(sp + 24) = gp; +a1 = sp + 0x26; +f_hex8(mem, sp, a0, a1); +goto L40bc54; +a1 = sp + 0x26; +L40bc54: +gp = MEM_U32(sp + 24); +t6 = MEM_U32(sp + 48); +//nop; +a0 = MEM_U32(t6 + 0); +a1 = sp + 0x26; +a2 = 0xa; +a3 = 0xa; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40bc74; +a3 = 0xa; +L40bc74: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void f_hex_2(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40bc84: +//hex_2: +//nop; +//nop; +//nop; +v1 = 0x1000161c; +v0 = a0 >> 4; +t6 = v0 & 0xff; +t7 = v1 + t6; +t8 = MEM_U8(t7 + 0); +t0 = t6 << 4; +MEM_U32(sp + 0) = a0; +t1 = -t0; +t9 = v1 + a0; +t2 = t9 + t1; +MEM_U8(a1 + 0) = (uint8_t)t8; +t3 = MEM_U8(t2 + 0); +MEM_U8(a1 + 1) = (uint8_t)t3; +return; +MEM_U8(a1 + 1) = (uint8_t)t3; +} + +static void f_put_alpha(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40bcc8: +//put_alpha: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 20) = s0; +s0 = a1 & 0xff; +t6 = s0 + 0xffffffe0; +t7 = t6 < 0x60; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +if (t7 == 0) {MEM_U32(sp + 44) = a1; +goto L40bd20;} +MEM_U32(sp + 44) = a1; +t0 = 0x10001634; +t8 = (int)t6 >> 5; +t9 = t8 << 2; +t0 = t0; +t1 = t0 + t9; +t2 = MEM_U32(t1 + 0); +//nop; +t3 = t2 << (t6 & 0x1f); +t7 = (int)t3 < (int)0x0; +L40bd20: +if (t7 == 0) {at = 0x22; +goto L40bd38;} +at = 0x22; +if (s0 == at) {at = 0x5c; +goto L40bd38;} +at = 0x5c; +if (s0 != at) {a1 = s0; +goto L40bd98;} +a1 = s0; +L40bd38: +//nop; +a0 = s0; +a1 = sp + 0x26; +f_hex_2(mem, sp, a0, a1); +goto L40bd48; +a1 = sp + 0x26; +L40bd48: +gp = MEM_U32(sp + 24); +t5 = MEM_U32(sp + 40); +a1 = 0x10007504; +//nop; +a0 = MEM_U32(t5 + 0); +a2 = 0x2; +a3 = 0x2; +a1 = a1; +MEM_U32(sp + 32) = a0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40bd70; +MEM_U32(sp + 32) = a0; +L40bd70: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +a1 = sp + 0x26; +a2 = 0x2; +a3 = 0x2; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40bd8c; +a3 = 0x2; +L40bd8c: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L40bdbc; +ra = MEM_U32(sp + 28); +L40bd98: +t8 = MEM_U32(sp + 40); +//nop; +a0 = MEM_U32(t8 + 0); +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40bdb0; +a3 = 0xa; +L40bdb0: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L40bdbc: +s0 = MEM_U32(sp + 20); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_put_string(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40bdc8: +//put_string: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 68) = a1; +t6 = MEM_U8(sp + 71); +MEM_U32(sp + 44) = s5; +s5 = a0; +MEM_U32(sp + 60) = ra; +MEM_U32(sp + 56) = gp; +MEM_U32(sp + 52) = s7; +MEM_U32(sp + 48) = s6; +MEM_U32(sp + 40) = s4; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +if (t6 == 0) {MEM_U32(sp + 24) = s0; +goto L40be30;} +MEM_U32(sp + 24) = s0; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = 0x22; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40be28; +a3 = 0xa; +L40be28: +gp = MEM_U32(sp + 56); +//nop; +L40be30: +s4 = 0x10018ef0; +s6 = 0x1; +t7 = MEM_U32(s4 + 0); +s3 = 0x11; +t8 = MEM_U32(t7 + 4); +//nop; +v0 = MEM_U16(t8 + 10); +//nop; +v1 = v0 + 0xffffffff; +if ((int)v1 >= 0) {t9 = (int)v1 >> 4; +goto L40be64;} +t9 = (int)v1 >> 4; +at = v1 + 0xf; +t9 = (int)at >> 4; +L40be64: +v1 = t9 + 0x1; +if (v1 == 0) {s7 = v1 + 0x1; +goto L40bee0;} +s7 = v1 + 0x1; +s2 = v0; +L40be74: +//nop; +a0 = MEM_U32(s4 + 0); +a1 = 0x10; +f_get(mem, sp, a0, a1); +goto L40be84; +a1 = 0x10; +L40be84: +s1 = s6 << 4; +gp = MEM_U32(sp + 56); +s1 = s1 + 0xfffffff0; +s0 = 0x1; +t0 = s1 + s0; +L40be98: +at = (int)s2 < (int)t0; +if (at != 0) {t4 = MEM_U8(sp + 71); +goto L40bee4;} +t4 = MEM_U8(sp + 71); +t1 = MEM_U32(s4 + 0); +//nop; +t2 = MEM_U32(t1 + 4); +a0 = s5; +t3 = t2 + s0; +a1 = MEM_U8(t3 + -1); +//nop; +f_put_alpha(mem, sp, a0, a1); +goto L40bec4; +//nop; +L40bec4: +gp = MEM_U32(sp + 56); +s0 = s0 + 0x1; +if (s0 != s3) {t0 = s1 + s0; +goto L40be98;} +t0 = s1 + s0; +s6 = s6 + 0x1; +if (s6 != s7) {//nop; +goto L40be74;} +//nop; +L40bee0: +t4 = MEM_U8(sp + 71); +L40bee4: +a1 = 0x22; +if (t4 == 0) {a2 = 0x1; +goto L40bf08;} +a2 = 0x1; +//nop; +a0 = MEM_U32(s5 + 0); +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40bf00; +a3 = 0xa; +L40bf00: +gp = MEM_U32(sp + 56); +//nop; +L40bf08: +ra = MEM_U32(sp + 60); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +s4 = MEM_U32(sp + 40); +s5 = MEM_U32(sp + 44); +s6 = MEM_U32(sp + 48); +s7 = MEM_U32(sp + 52); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void f_write_instruction(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40bf34: +//write_instruction: +//nop; +//nop; +//nop; +sp = sp + 0xffffff08; +MEM_U32(sp + 212) = ra; +MEM_U32(sp + 208) = fp; +MEM_U32(sp + 204) = gp; +MEM_U32(sp + 200) = s7; +MEM_U32(sp + 196) = s6; +MEM_U32(sp + 192) = s5; +MEM_U32(sp + 188) = s4; +MEM_U32(sp + 184) = s3; +MEM_U32(sp + 180) = s2; +MEM_U32(sp + 176) = s1; +MEM_U32(sp + 172) = s0; +s6 = MEM_U32(a0 + 0); +//nop; +fp = a0; +a1 = 0x9; +a2 = 0x1; +a3 = 0xa; +a0 = s6; +f_write_char(mem, sp, a0, a1, a2); +goto L40bf90; +a0 = s6; +L40bf90: +gp = MEM_U32(sp + 204); +s1 = 0x164; +s5 = 0x10018ef0; +at = 0x14c; +s4 = MEM_U32(s5 + 0); +//nop; +v1 = MEM_U32(s4 + 4); +//nop; +v0 = MEM_U16(v1 + 6); +//nop; +t6 = v0 << 22; +t7 = t6 >> 23; +if (s1 == t7) {//nop; +goto L40c020;} +//nop; +if (t7 == at) {t8 = t7 << 2; +goto L40c020;} +t8 = t7 << 2; +t9 = 0x10000550; +t8 = t8 + t7; +t8 = t8 << 1; +a1 = t8 + t9; +//nop; +s6 = MEM_U32(fp + 0); +a2 = 0xa; +a3 = zero; +a0 = s6; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40bff8; +a0 = s6; +L40bff8: +gp = MEM_U32(sp + 204); +a0 = s6; +//nop; +a1 = 0x9; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40c014; +a3 = 0xa; +L40c014: +gp = MEM_U32(sp + 204); +v1 = MEM_U32(s4 + 4); +//nop; +L40c020: +v0 = MEM_U32(v1 + 8); +s0 = v1; +t0 = v0 << 14; +t1 = t0 >> 28; +t2 = t1 & 0xff; +at = t2 < 0xe; +if (at == 0) {a0 = 0x1; +goto L40cc68;} +a0 = 0x1; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100075d0[] = { +&&L40c060, +&&L40c1e4, +&&L40c2c4, +&&L40c638, +&&L40c734, +&&L40c80c, +&&L40c8a4, +&&L40c8d8, +&&L40c93c, +&&L40ca10, +&&L40ca88, +&&L40caa4, +&&L40cbb4, +&&L40c918, +}; +dest = Lswitch100075d0[t2]; +//nop; +goto *dest; +//nop; +L40c060: +t4 = MEM_U8(s0 + 8); +s3 = 0x5; +t5 = t4 << 24; +t6 = t5 >> 25; +lo = t6 * s3; +hi = (uint32_t)((uint64_t)t6 * (uint64_t)s3 >> 32); +s2 = 0x10000000; +//nop; +a0 = MEM_U32(fp + 0); +a2 = s3; +a3 = zero; +t7 = lo; +a1 = s2 + t7; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c098; +//nop; +L40c098: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x100075cb; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c0b8; +a1 = a1; +L40c0b8: +a1 = MEM_U32(s0 + 0); +gp = MEM_U32(sp + 204); +if (a1 == 0) {//nop; +goto L40c0fc;} +//nop; +//nop; +a0 = fp; +//nop; +f_put_sym(mem, sp, a0, a1); +goto L40c0d8; +//nop; +L40c0d8: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s0 + 12); +//nop; +a0 = fp; +//nop; +f_put_integer_ws(mem, sp, a0, a1); +goto L40c0f0; +//nop; +L40c0f0: +gp = MEM_U32(sp + 204); +//nop; +goto L40c11c; +//nop; +L40c0fc: +//nop; +a0 = MEM_U32(fp + 0); +a1 = MEM_U32(s0 + 12); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40c114; +a3 = 0xa; +L40c114: +gp = MEM_U32(sp + 204); +//nop; +L40c11c: +//nop; +a0 = MEM_U32(fp + 0); +a1 = 0x28; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40c134; +a3 = 0xa; +L40c134: +t8 = MEM_U16(s0 + 8); +gp = MEM_U32(sp + 204); +t9 = t8 << 23; +t0 = t9 >> 25; +lo = t0 * s3; +hi = (uint32_t)((uint64_t)t0 * (uint64_t)s3 >> 32); +//nop; +a0 = MEM_U32(fp + 0); +a2 = s3; +a3 = zero; +t1 = lo; +a1 = s2 + t1; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c168; +//nop; +L40c168: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +//nop; +a1 = 0x29; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40c184; +a3 = 0xa; +L40c184: +t2 = MEM_U16(s0 + 10); +gp = MEM_U32(sp + 204); +t3 = t2 & 0x3fff; +if (t3 == 0) {//nop; +goto L40cc88;} +//nop; +a1 = 0x100075c9; +//nop; +a0 = MEM_U32(fp + 0); +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c1b4; +a1 = a1; +L40c1b4: +gp = MEM_U32(sp + 204); +a1 = MEM_U16(s0 + 10); +//nop; +a0 = MEM_U32(fp + 0); +t4 = a1 & 0x3fff; +a1 = t4; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40c1d8; +a3 = 0xa; +L40c1d8: +gp = MEM_U32(sp + 204); +//nop; +goto L40cc88; +//nop; +L40c1e4: +t5 = MEM_U8(s0 + 8); +a2 = 0x5; +t6 = t5 << 24; +t7 = t6 >> 25; +lo = t7 * a2; +hi = (uint32_t)((uint64_t)t7 * (uint64_t)a2 >> 32); +s2 = 0x10000000; +//nop; +a0 = MEM_U32(fp + 0); +a3 = zero; +t8 = lo; +a1 = s2 + t8; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c218; +//nop; +L40c218: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x100075c7; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c238; +a1 = a1; +L40c238: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s0 + 0); +//nop; +a0 = fp; +//nop; +f_put_sym(mem, sp, a0, a1); +goto L40c250; +//nop; +L40c250: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s0 + 12); +//nop; +a0 = fp; +//nop; +f_put_integer_ws(mem, sp, a0, a1); +goto L40c268; +//nop; +L40c268: +t9 = MEM_U16(s0 + 10); +gp = MEM_U32(sp + 204); +t0 = t9 & 0x3fff; +if (t0 == 0) {a2 = 0x2; +goto L40cc88;} +a2 = 0x2; +a1 = 0x100075c5; +//nop; +a0 = MEM_U32(fp + 0); +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c294; +a1 = a1; +L40c294: +gp = MEM_U32(sp + 204); +a1 = MEM_U16(s0 + 10); +//nop; +a0 = MEM_U32(fp + 0); +t1 = a1 & 0x3fff; +a1 = t1; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40c2b8; +a3 = 0xa; +L40c2b8: +gp = MEM_U32(sp + 204); +//nop; +goto L40cc88; +//nop; +L40c2c4: +v0 = MEM_U16(s0 + 6); +at = 0x3e; +t2 = v0 << 22; +t3 = t2 >> 23; +if (t3 == at) {v0 = t3; +goto L40cc88;} +v0 = t3; +at = 0xfc; +if (t3 == at) {at = 0xfd; +goto L40c2f0;} +at = 0xfd; +if (t3 != at) {//nop; +goto L40c3f4;} +//nop; +L40c2f0: +t4 = MEM_U8(s0 + 8); +a2 = 0x5; +t5 = t4 << 24; +t6 = t5 >> 25; +lo = t6 * a2; +hi = (uint32_t)((uint64_t)t6 * (uint64_t)a2 >> 32); +s2 = 0x10000000; +//nop; +a0 = MEM_U32(fp + 0); +a3 = zero; +t7 = lo; +a1 = s2 + t7; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c324; +//nop; +L40c324: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x100075c3; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c344; +a1 = a1; +L40c344: +t8 = MEM_U32(s4 + 4); +gp = MEM_U32(sp + 204); +s3 = MEM_U32(t8 + 12); +s7 = 0x1; +v0 = s3 + 0xffffffff; +if ((int)v0 >= 0) {t9 = (int)v0 >> 4; +goto L40c368;} +t9 = (int)v0 >> 4; +at = v0 + 0xf; +t9 = (int)at >> 4; +L40c368: +v0 = t9 + 0x1; +if (v0 == 0) {t0 = v0 + 0x1; +goto L40cc88;} +t0 = v0 + 0x1; +MEM_U32(sp + 220) = t0; +s2 = 0x11; +L40c37c: +//nop; +a0 = MEM_U32(s5 + 0); +a1 = 0x10; +f_get(mem, sp, a0, a1); +goto L40c38c; +a1 = 0x10; +L40c38c: +s1 = s7 << 4; +gp = MEM_U32(sp + 204); +s1 = s1 + 0xfffffff0; +s0 = 0x1; +t1 = s1 + s0; +L40c3a0: +at = (int)s3 < (int)t1; +if (at != 0) {//nop; +goto L40cc88;} +//nop; +t2 = MEM_U32(s5 + 0); +//nop; +t3 = MEM_U32(t2 + 4); +a0 = fp; +t4 = t3 + s0; +a1 = MEM_U8(t4 + -1); +//nop; +f_put_alpha(mem, sp, a0, a1); +goto L40c3cc; +//nop; +L40c3cc: +gp = MEM_U32(sp + 204); +s0 = s0 + 0x1; +if (s0 != s2) {t1 = s1 + s0; +goto L40c3a0;} +t1 = s1 + s0; +t5 = MEM_U32(sp + 220); +s7 = s7 + 0x1; +if (s7 != t5) {//nop; +goto L40c37c;} +//nop; +//nop; +goto L40cc88; +//nop; +L40c3f4: +if (s1 != v0) {at = 0x14c; +goto L40c4a8;} +at = 0x14c; +s3 = MEM_U32(v1 + 12); +s7 = 0x1; +v0 = s3 + 0xffffffff; +if ((int)v0 >= 0) {t6 = (int)v0 >> 4; +goto L40c418;} +t6 = (int)v0 >> 4; +at = v0 + 0xf; +t6 = (int)at >> 4; +L40c418: +v0 = t6 + 0x1; +if (v0 == 0) {t7 = v0 + 0x1; +goto L40cc88;} +t7 = v0 + 0x1; +MEM_U32(sp + 220) = t7; +s2 = 0x11; +L40c42c: +//nop; +a0 = s4; +a1 = 0x10; +f_get(mem, sp, a0, a1); +goto L40c43c; +a1 = 0x10; +L40c43c: +s1 = s7 << 4; +gp = MEM_U32(sp + 204); +s1 = s1 + 0xfffffff0; +s0 = 0x1; +t8 = s1 + s0; +L40c450: +at = (int)s3 < (int)t8; +if (at != 0) {//nop; +goto L40cc88;} +//nop; +s4 = MEM_U32(s5 + 0); +a0 = MEM_U32(fp + 0); +t9 = MEM_U32(s4 + 4); +a2 = 0x1; +t0 = t9 + s0; +//nop; +a1 = MEM_U8(t0 + -1); +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40c480; +a3 = 0xa; +L40c480: +gp = MEM_U32(sp + 204); +s0 = s0 + 0x1; +if (s0 != s2) {t8 = s1 + s0; +goto L40c450;} +t8 = s1 + s0; +t1 = MEM_U32(sp + 220); +s7 = s7 + 0x1; +if (s7 != t1) {//nop; +goto L40c42c;} +//nop; +//nop; +goto L40cc88; +//nop; +L40c4a8: +if (v0 != at) {//nop; +goto L40c5bc;} +//nop; +s1 = 0x10001630; +a2 = 0xa; +t2 = MEM_U8(s1 + 0); +a3 = zero; +if (t2 == 0) {t6 = 0x1; +goto L40c5a8;} +t6 = 0x1; +t3 = MEM_U16(v1 + 6); +s6 = MEM_U32(fp + 0); +t4 = t3 << 22; +t5 = t4 >> 23; +t6 = t5 << 2; +t7 = 0x10000550; +//nop; +t6 = t6 + t5; +t6 = t6 << 1; +a0 = s6; +a1 = t6 + t7; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c4f8; +a1 = t6 + t7; +L40c4f8: +gp = MEM_U32(sp + 204); +a0 = s6; +//nop; +a1 = 0x9; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40c514; +a3 = 0xa; +L40c514: +t8 = MEM_U8(s0 + 8); +a2 = 0x5; +t9 = t8 << 24; +t0 = t9 >> 25; +lo = t0 * a2; +hi = (uint32_t)((uint64_t)t0 * (uint64_t)a2 >> 32); +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +s2 = 0x10000000; +//nop; +a3 = zero; +t1 = lo; +a1 = s2 + t1; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c54c; +//nop; +L40c54c: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x100075c1; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c56c; +a1 = a1; +L40c56c: +gp = MEM_U32(sp + 204); +a3 = MEM_U32(s0 + 12); +v0 = 0x10019308; +t3 = 0x1; +MEM_U32(v0 + 4) = a3; +//nop; +a0 = MEM_U32(fp + 0); +t4 = 0xa; +a2 = MEM_U32(v0 + 0); +MEM_U32(sp + 20) = t4; +MEM_U32(sp + 16) = t3; +f_write_int64(mem, sp, a0, a1, a2, a3); +goto L40c59c; +MEM_U32(sp + 16) = t3; +L40c59c: +gp = MEM_U32(sp + 204); +MEM_U8(s1 + 0) = (uint8_t)zero; +goto L40cc88; +MEM_U8(s1 + 0) = (uint8_t)zero; +L40c5a8: +v0 = 0x10019308; +t5 = MEM_U32(s0 + 12); +MEM_U8(s1 + 0) = (uint8_t)t6; +MEM_U32(v0 + 0) = t5; +goto L40cc88; +MEM_U32(v0 + 0) = t5; +L40c5bc: +t7 = MEM_U8(s0 + 8); +a2 = 0x5; +t8 = t7 << 24; +t9 = t8 >> 25; +lo = t9 * a2; +hi = (uint32_t)((uint64_t)t9 * (uint64_t)a2 >> 32); +s2 = 0x10000000; +//nop; +a0 = MEM_U32(fp + 0); +a3 = zero; +t0 = lo; +a1 = s2 + t0; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c5f0; +//nop; +L40c5f0: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x100075bf; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c610; +a1 = a1; +L40c610: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +//nop; +a1 = MEM_U32(s0 + 12); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40c62c; +a3 = 0xa; +L40c62c: +gp = MEM_U32(sp + 204); +//nop; +goto L40cc88; +//nop; +L40c638: +v0 = MEM_U8(s0 + 8); +at = 0x48; +t1 = v0 << 24; +t2 = t1 >> 25; +if (t2 == at) {a2 = 0x5; +goto L40c69c;} +a2 = 0x5; +lo = t2 * a2; +hi = (uint32_t)((uint64_t)t2 * (uint64_t)a2 >> 32); +s2 = 0x10000000; +//nop; +a0 = MEM_U32(fp + 0); +a3 = zero; +t3 = lo; +a1 = s2 + t3; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c674; +//nop; +L40c674: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x100075bd; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c694; +a1 = a1; +L40c694: +gp = MEM_U32(sp + 204); +//nop; +L40c69c: +t4 = MEM_U16(s0 + 8); +s3 = 0x5; +t5 = t4 << 23; +t6 = t5 >> 25; +lo = t6 * s3; +hi = (uint32_t)((uint64_t)t6 * (uint64_t)s3 >> 32); +s2 = 0x10000000; +//nop; +a0 = MEM_U32(fp + 0); +a2 = s3; +a3 = zero; +t7 = lo; +a1 = s2 + t7; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c6d4; +//nop; +L40c6d4: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x100075bb; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c6f4; +a1 = a1; +L40c6f4: +t8 = MEM_U16(s0 + 10); +gp = MEM_U32(sp + 204); +t9 = t8 << 18; +t0 = t9 >> 25; +lo = t0 * s3; +hi = (uint32_t)((uint64_t)t0 * (uint64_t)s3 >> 32); +//nop; +a0 = MEM_U32(fp + 0); +a2 = s3; +a3 = zero; +t1 = lo; +a1 = s2 + t1; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c728; +//nop; +L40c728: +gp = MEM_U32(sp + 204); +//nop; +goto L40cc88; +//nop; +L40c734: +t2 = MEM_U8(s0 + 8); +s3 = 0x5; +t3 = t2 << 24; +t4 = t3 >> 25; +lo = t4 * s3; +hi = (uint32_t)((uint64_t)t4 * (uint64_t)s3 >> 32); +s2 = 0x10000000; +//nop; +a0 = MEM_U32(fp + 0); +a2 = s3; +a3 = zero; +t5 = lo; +a1 = s2 + t5; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c76c; +//nop; +L40c76c: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x100075b9; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c78c; +a1 = a1; +L40c78c: +t6 = MEM_U16(s0 + 8); +gp = MEM_U32(sp + 204); +t7 = t6 << 23; +t8 = t7 >> 25; +lo = t8 * s3; +hi = (uint32_t)((uint64_t)t8 * (uint64_t)s3 >> 32); +a0 = MEM_U32(fp + 0); +a2 = s3; +a3 = zero; +t9 = lo; +a1 = s2 + t9; +//nop; +//nop; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c7c4; +//nop; +L40c7c4: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x100075b7; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c7e4; +a1 = a1; +L40c7e4: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +//nop; +a1 = MEM_U32(s0 + 12); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40c800; +a3 = 0xa; +L40c800: +gp = MEM_U32(sp + 204); +//nop; +goto L40cc88; +//nop; +L40c80c: +t0 = MEM_U8(s0 + 8); +s3 = 0x5; +t1 = t0 << 24; +t2 = t1 >> 25; +lo = t2 * s3; +hi = (uint32_t)((uint64_t)t2 * (uint64_t)s3 >> 32); +s2 = 0x10000000; +//nop; +a0 = MEM_U32(fp + 0); +a2 = s3; +a3 = zero; +t3 = lo; +a1 = s2 + t3; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c844; +//nop; +L40c844: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x100075b5; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c864; +a1 = a1; +L40c864: +t4 = MEM_U16(s0 + 8); +gp = MEM_U32(sp + 204); +t5 = t4 << 23; +t6 = t5 >> 25; +lo = t6 * s3; +hi = (uint32_t)((uint64_t)t6 * (uint64_t)s3 >> 32); +//nop; +a0 = MEM_U32(fp + 0); +a2 = s3; +a3 = zero; +t7 = lo; +a1 = s2 + t7; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c898; +//nop; +L40c898: +gp = MEM_U32(sp + 204); +//nop; +goto L40cc88; +//nop; +L40c8a4: +//nop; +a1 = MEM_U32(s0 + 0); +a0 = fp; +f_put_sym(mem, sp, a0, a1); +goto L40c8b4; +a0 = fp; +L40c8b4: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s0 + 12); +//nop; +a0 = fp; +//nop; +f_put_integer_ws(mem, sp, a0, a1); +goto L40c8cc; +//nop; +L40c8cc: +gp = MEM_U32(sp + 204); +//nop; +goto L40cc88; +//nop; +L40c8d8: +t8 = MEM_U8(s0 + 8); +a2 = 0x5; +t9 = t8 << 24; +t0 = t9 >> 25; +lo = t0 * a2; +hi = (uint32_t)((uint64_t)t0 * (uint64_t)a2 >> 32); +s2 = 0x10000000; +//nop; +a0 = MEM_U32(fp + 0); +a3 = zero; +t1 = lo; +a1 = s2 + t1; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c90c; +//nop; +L40c90c: +gp = MEM_U32(sp + 204); +//nop; +goto L40cc88; +//nop; +L40c918: +//nop; +a0 = MEM_U32(fp + 0); +a1 = MEM_U32(s0 + 12); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40c930; +a3 = 0xa; +L40c930: +gp = MEM_U32(sp + 204); +//nop; +goto L40cc88; +//nop; +L40c93c: +t2 = MEM_U8(s0 + 8); +s3 = 0x5; +t3 = t2 << 24; +t4 = t3 >> 25; +lo = t4 * s3; +hi = (uint32_t)((uint64_t)t4 * (uint64_t)s3 >> 32); +s2 = 0x10000000; +//nop; +a0 = MEM_U32(fp + 0); +a2 = s3; +a3 = zero; +t5 = lo; +a1 = s2 + t5; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c974; +//nop; +L40c974: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x100075b3; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c994; +a1 = a1; +L40c994: +t6 = MEM_U16(s0 + 8); +gp = MEM_U32(sp + 204); +t7 = t6 << 23; +t8 = t7 >> 25; +lo = t8 * s3; +hi = (uint32_t)((uint64_t)t8 * (uint64_t)s3 >> 32); +a0 = MEM_U32(fp + 0); +a2 = s3; +a3 = zero; +t9 = lo; +a1 = s2 + t9; +//nop; +//nop; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c9cc; +//nop; +L40c9cc: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x100075b1; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40c9ec; +a1 = a1; +L40c9ec: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s0 + 0); +//nop; +a0 = fp; +//nop; +f_put_sym(mem, sp, a0, a1); +goto L40ca04; +//nop; +L40ca04: +gp = MEM_U32(sp + 204); +//nop; +goto L40cc88; +//nop; +L40ca10: +t0 = MEM_U8(s0 + 8); +a2 = 0x5; +t1 = t0 << 24; +t2 = t1 >> 25; +lo = t2 * a2; +hi = (uint32_t)((uint64_t)t2 * (uint64_t)a2 >> 32); +s2 = 0x10000000; +//nop; +a0 = MEM_U32(fp + 0); +a3 = zero; +t3 = lo; +a1 = s2 + t3; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40ca44; +//nop; +L40ca44: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x100075af; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40ca64; +a1 = a1; +L40ca64: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s0 + 0); +//nop; +a0 = fp; +//nop; +f_put_sym(mem, sp, a0, a1); +goto L40ca7c; +//nop; +L40ca7c: +gp = MEM_U32(sp + 204); +//nop; +goto L40cc88; +//nop; +L40ca88: +//nop; +a1 = MEM_U32(s0 + 0); +a0 = fp; +f_put_sym(mem, sp, a0, a1); +goto L40ca98; +a0 = fp; +L40ca98: +gp = MEM_U32(sp + 204); +//nop; +goto L40cc88; +//nop; +L40caa4: +t4 = 0x1000755f; +a0 = 0x4; +t4 = t4; +t6 = t4 + 0x48; +a1 = 0x3a9; +t7 = sp; +L40cabc: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t7 = t7 + 0xc; +MEM_U8(t7 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t7) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t7 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 4 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 7($t7) +goto L40cabc;} +//swr $at, 7($t7) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t8 = 0x1000750f; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +t8 = t8; +MEM_U8(t7 + 12 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t7 + 12 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t7 + 12 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t7 + 12 + 3) = (uint8_t)(t6 >> 0); +t0 = t8 + 0x48; +t1 = sp; +//swr $t6, 0xf($t7) +L40cb2c: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t1 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t1) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t1 = t1 + 0xc; +MEM_U8(t1 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t1) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t1 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 84 + 3) = (uint8_t)(at >> 0); +if (t8 != t0) {//swr $at, 0x57($t1) +goto L40cb2c;} +//swr $at, 0x57($t1) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +//nop; +MEM_U8(t1 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t1) +t0 = t8 + 4; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 7($t8) +//nop; +MEM_U8(t1 + 92 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(t1 + 92 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(t1 + 92 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(t1 + 92 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0x5f($t1) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L40cba8; +//nop; +L40cba8: +gp = MEM_U32(sp + 204); +//nop; +goto L40cc88; +//nop; +L40cbb4: +t2 = MEM_U8(s0 + 8); +a2 = 0x5; +t3 = t2 << 24; +t5 = t3 >> 25; +lo = t5 * a2; +hi = (uint32_t)((uint64_t)t5 * (uint64_t)a2 >> 32); +s2 = 0x10000000; +//nop; +a0 = MEM_U32(fp + 0); +a3 = zero; +t6 = lo; +a1 = s2 + t6; +//nop; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40cbe8; +//nop; +L40cbe8: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x1000750d; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40cc08; +a1 = a1; +L40cc08: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +//nop; +a1 = MEM_U32(s0 + 12); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40cc24; +a3 = 0xa; +L40cc24: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(fp + 0); +a1 = 0x1000750b; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40cc44; +a1 = a1; +L40cc44: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s0 + 0); +//nop; +a0 = fp; +//nop; +f_put_sym(mem, sp, a0, a1); +goto L40cc5c; +//nop; +L40cc5c: +gp = MEM_U32(sp + 204); +//nop; +goto L40cc88; +//nop; +L40cc68: +a2 = 0x10007506; +//nop; +a1 = 0x31e; +a3 = 0x5; +a2 = a2; +f_caseerror(mem, sp, a0, a1, a2, a3); +goto L40cc80; +a2 = a2; +L40cc80: +gp = MEM_U32(sp + 204); +//nop; +L40cc88: +//nop; +a0 = MEM_U32(fp + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L40cc98; +//nop; +L40cc98: +ra = MEM_U32(sp + 212); +gp = MEM_U32(sp + 204); +s0 = MEM_U32(sp + 172); +s1 = MEM_U32(sp + 176); +s2 = MEM_U32(sp + 180); +s3 = MEM_U32(sp + 184); +s4 = MEM_U32(sp + 188); +s5 = MEM_U32(sp + 192); +s6 = MEM_U32(sp + 196); +s7 = MEM_U32(sp + 200); +fp = MEM_U32(sp + 208); +sp = sp + 0xf8; +return; +sp = sp + 0xf8; +} + +static void f_print_source(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L40cccc: +//print_source: +//nop; +//nop; +//nop; +sp = sp + 0xffffff30; +v0 = 0x1000162c; +MEM_U32(sp + 196) = s5; +t6 = MEM_U32(v0 + 0); +MEM_U32(sp + 188) = s3; +s3 = a0; +s5 = a2; +MEM_U32(sp + 204) = ra; +MEM_U32(sp + 200) = gp; +MEM_U32(sp + 192) = s4; +MEM_U32(sp + 184) = s2; +MEM_U32(sp + 180) = s1; +if (a1 == t6) {MEM_U32(sp + 176) = s0; +goto L40cea4;} +MEM_U32(sp + 176) = s0; +if (a1 != 0) {MEM_U32(v0 + 0) = a1; +goto L40cd1c;} +MEM_U32(v0 + 0) = a1; +a1 = 0x2; +L40cd1c: +//nop; +a0 = a1; +//nop; +v0 = f_st_str_idn(mem, sp, a0, a1, a2, a3); +goto L40cd2c; +//nop; +L40cd2c: +gp = MEM_U32(sp + 200); +a2 = 0x20; +v1 = 0x10018f00; +t2 = sp; +a0 = v1 + 0x400; +L40cd40: +v1 = v1 + 0x1; +if (v1 != a0) {MEM_U8(v1 + -1) = (uint8_t)a2; +goto L40cd40;} +MEM_U8(v1 + -1) = (uint8_t)a2; +t7 = MEM_U8(v0 + 0); +a0 = v0 + 0x1; +if (t7 == 0) {t6 = sp; +goto L40cd7c;} +t6 = sp; +v1 = 0x10018f00; +a1 = MEM_U8(a0 + -1); +//nop; +L40cd68: +MEM_U8(v1 + 0) = (uint8_t)a1; +a1 = MEM_U8(a0 + 0); +v1 = v1 + 0x1; +if (a1 != 0) {a0 = a0 + 0x1; +goto L40cd68;} +a0 = a0 + 0x1; +L40cd7c: +t8 = 0x10018f00; +a0 = 0x4; +t8 = MEM_U8(t8 + 0); +t7 = 0x7fff0000; +if (a2 != t8) {//nop; +goto L40ce98;} +//nop; +t9 = 0x1000765a; +a1 = 0x3cf; +t9 = t9; +t1 = t9 + 0x48; +L40cda4: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t2 = t2 + 0xc; +MEM_U8(t2 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t2) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t2 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 4 + 3) = (uint8_t)(at >> 0); +if (t9 != t1) {//swr $at, 7($t2) +goto L40cda4;} +//swr $at, 7($t2) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t3 = 0x1000760a; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +t1 = t9 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t9) +t3 = t3; +MEM_U8(t2 + 12 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t2 + 12 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t2 + 12 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t2 + 12 + 3) = (uint8_t)(t1 >> 0); +t5 = t3 + 0x48; +//swr $t1, 0xf($t2) +L40ce10: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t6 = t6 + 0xc; +MEM_U8(t6 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t6) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t6 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 84 + 3) = (uint8_t)(at >> 0); +if (t3 != t5) {//swr $at, 0x57($t6) +goto L40ce10;} +//swr $at, 0x57($t6) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +//nop; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +//nop; +MEM_U8(t6 + 92 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t6 + 92 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t6 + 92 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t6 + 92 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x5f($t6) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L40ce8c; +//nop; +L40ce8c: +gp = MEM_U32(sp + 200); +ra = MEM_U32(sp + 204); +goto L40d0e0; +ra = MEM_U32(sp + 204); +L40ce98: +s4 = 0x10018ef8; +t7 = t7 | 0xffff; +MEM_U32(s4 + 0) = t7; +L40cea4: +s4 = 0x10018ef8; +a2 = 0x400; +s2 = MEM_U32(s4 + 0); +a3 = zero; +t8 = s2 + 0xffffffff; +at = (int)s5 < (int)t8; +if (at == 0) {t1 = s5 - s2; +goto L40cf04;} +t1 = s5 - s2; +s1 = 0x10019300; +//nop; +a1 = 0x10018f00; +a0 = s1; +f_reset(mem, sp, a0, a1, a2, a3); +goto L40ced8; +a0 = s1; +L40ced8: +gp = MEM_U32(sp + 200); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +v0 = f_eof(mem, sp, a0); +goto L40cef0; +//nop; +L40cef0: +gp = MEM_U32(sp + 200); +if (v0 != 0) {s2 = 0x1; +goto L40d0dc;} +s2 = 0x1; +MEM_U32(s4 + 0) = s2; +t1 = s5 - s2; +L40cf04: +s1 = 0x10019300; +at = (int)t1 < (int)0x6; +if (at != 0) {at = (int)s5 < (int)s2; +goto L40cfac;} +at = (int)s5 < (int)s2; +L40cf14: +//nop; +a0 = MEM_U32(s1 + 0); +//nop; +v0 = f_eof(mem, sp, a0); +goto L40cf24; +//nop; +L40cf24: +gp = MEM_U32(sp + 200); +if (v0 != 0) {ra = MEM_U32(sp + 204); +goto L40d0e0;} +ra = MEM_U32(sp + 204); +//nop; +a0 = MEM_U32(s1 + 0); +//nop; +v0 = f_eoln(mem, sp, a0); +goto L40cf40; +//nop; +L40cf40: +gp = MEM_U32(sp + 200); +if (v0 != 0) {//nop; +goto L40cf80;} +//nop; +L40cf4c: +//nop; +a0 = MEM_U32(s1 + 0); +//nop; +f_next_char(mem, sp, a0); +goto L40cf5c; +//nop; +L40cf5c: +gp = MEM_U32(sp + 200); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +v0 = f_eoln(mem, sp, a0); +goto L40cf74; +//nop; +L40cf74: +gp = MEM_U32(sp + 200); +if (v0 == 0) {//nop; +goto L40cf4c;} +//nop; +L40cf80: +//nop; +a0 = MEM_U32(s1 + 0); +//nop; +f_next_char(mem, sp, a0); +goto L40cf90; +//nop; +L40cf90: +t9 = MEM_U32(s4 + 0); +gp = MEM_U32(sp + 200); +s2 = t9 + 0x1; +at = (int)s2 < (int)s5; +if (at != 0) {MEM_U32(s4 + 0) = s2; +goto L40cf14;} +MEM_U32(s4 + 0) = s2; +at = (int)s5 < (int)s2; +L40cfac: +if (at != 0) {ra = MEM_U32(sp + 204); +goto L40d0e0;} +ra = MEM_U32(sp + 204); +L40cfb4: +s0 = MEM_U32(s3 + 0); +a1 = 0x10007608; +//nop; +a2 = 0x2; +a3 = 0x2; +a0 = s0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40cfd4; +a1 = a1; +L40cfd4: +gp = MEM_U32(sp + 200); +a0 = s0; +//nop; +a1 = s2; +a2 = 0x4; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40cff0; +a3 = 0xa; +L40cff0: +gp = MEM_U32(sp + 200); +a0 = s0; +//nop; +a1 = 0x9; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d00c; +a3 = 0xa; +L40d00c: +gp = MEM_U32(sp + 200); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +v0 = f_eoln(mem, sp, a0); +goto L40d024; +//nop; +L40d024: +gp = MEM_U32(sp + 200); +if (v0 != 0) {//nop; +goto L40d09c;} +//nop; +L40d030: +//nop; +s0 = MEM_U32(s3 + 0); +a0 = MEM_U32(s1 + 0); +//nop; +v0 = f_peek_char(mem, sp, a0); +goto L40d044; +//nop; +L40d044: +gp = MEM_U32(sp + 200); +a0 = s0; +//nop; +a1 = v0; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d060; +a3 = 0xa; +L40d060: +gp = MEM_U32(sp + 200); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +f_next_char(mem, sp, a0); +goto L40d078; +//nop; +L40d078: +gp = MEM_U32(sp + 200); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +v0 = f_eoln(mem, sp, a0); +goto L40d090; +//nop; +L40d090: +gp = MEM_U32(sp + 200); +if (v0 == 0) {//nop; +goto L40d030;} +//nop; +L40d09c: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L40d0ac; +//nop; +L40d0ac: +gp = MEM_U32(sp + 200); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +f_next_char(mem, sp, a0); +goto L40d0c4; +//nop; +L40d0c4: +t4 = MEM_U32(s4 + 0); +gp = MEM_U32(sp + 200); +s2 = t4 + 0x1; +at = (int)s5 < (int)s2; +if (at == 0) {MEM_U32(s4 + 0) = s2; +goto L40cfb4;} +MEM_U32(s4 + 0) = s2; +L40d0dc: +ra = MEM_U32(sp + 204); +L40d0e0: +s0 = MEM_U32(sp + 176); +s1 = MEM_U32(sp + 180); +s2 = MEM_U32(sp + 184); +s3 = MEM_U32(sp + 188); +s4 = MEM_U32(sp + 192); +s5 = MEM_U32(sp + 196); +sp = sp + 0xd0; +return; +sp = sp + 0xd0; +} + +static void f_write_directive(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40d100: +//write_directive: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb8; +v1 = 0x10018ef0; +MEM_U32(sp + 44) = ra; +v1 = MEM_U32(v1 + 0); +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s2; +MEM_U32(sp + 32) = s1; +MEM_U32(sp + 28) = s0; +s2 = MEM_U32(v1 + 4); +at = 0x1; +v0 = MEM_U8(s2 + 5); +s1 = a0; +t6 = v0 & 0x3f; +if (t6 == at) {ra = MEM_U32(sp + 44); +goto L40dd18;} +ra = MEM_U32(sp + 44); +if (t6 != 0) {a1 = 0x9; +goto L40d1a0;} +a1 = 0x9; +//nop; +a1 = MEM_U32(s2 + 0); +//nop; +f_put_sym(mem, sp, a0, a1); +goto L40d160; +//nop; +L40d160: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x3a; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d17c; +a3 = 0xa; +L40d17c: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L40d194; +//nop; +L40d194: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L40dd18; +ra = MEM_U32(sp + 44); +L40d1a0: +//nop; +a0 = MEM_U32(s1 + 0); +MEM_U32(sp + 52) = v1; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d1b8; +a3 = 0xa; +L40d1b8: +t7 = MEM_U8(s2 + 5); +gp = MEM_U32(sp + 40); +t8 = t7 & 0x3f; +t9 = t8 << 2; +t0 = 0x10000170; +t9 = t9 - t8; +t9 = t9 << 2; +a1 = t9 + t0; +s0 = MEM_U32(s1 + 0); +//nop; +a2 = 0xc; +a3 = zero; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40d1f0; +a0 = s0; +L40d1f0: +gp = MEM_U32(sp + 40); +a0 = s0; +//nop; +a1 = 0x9; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d20c; +a3 = 0xa; +L40d20c: +t1 = MEM_U8(s2 + 5); +gp = MEM_U32(sp + 40); +t2 = t1 & 0x3f; +t3 = t2 + 0xfffffffe; +at = t3 < 0x3c; +if (at == 0) {//nop; +goto L40dcac;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100076bc[] = { +&&L40d5d8, +&&L40dacc, +&&L40d248, +&&L40d2c8, +&&L40d2c8, +&&L40d33c, +&&L40d4ec, +&&L40d4ec, +&&L40dcd0, +&&L40d26c, +&&L40d2e4, +&&L40d26c, +&&L40d33c, +&&L40d8fc, +&&L40d33c, +&&L40dacc, +&&L40d580, +&&L40dbd0, +&&L40d248, +&&L40db94, +&&L40d33c, +&&L40dcac, +&&L40d5d8, +&&L40dcd0, +&&L40dcd0, +&&L40d884, +&&L40d7d0, +&&L40d8d8, +&&L40d8d8, +&&L40dcac, +&&L40d920, +&&L40dacc, +&&L40dcac, +&&L40dcac, +&&L40d5d8, +&&L40d6c0, +&&L40d82c, +&&L40d82c, +&&L40dcac, +&&L40dcac, +&&L40d774, +&&L40d5f4, +&&L40dcac, +&&L40d4ec, +&&L40d884, +&&L40d974, +&&L40d9f0, +&&L40d9f0, +&&L40dc50, +&&L40dcac, +&&L40dcac, +&&L40da7c, +&&L40da7c, +&&L40da7c, +&&L40da7c, +&&L40d248, +&&L40dcd0, +&&L40d410, +&&L40dc2c, +&&L40db08, +}; +dest = Lswitch100076bc[t3]; +//nop; +goto *dest; +//nop; +L40d248: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = MEM_U32(s2 + 8); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d260; +a3 = 0xa; +L40d260: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d26c: +t4 = MEM_U32(s2 + 12); +//nop; +a0 = s1; +a1 = zero; +MEM_U32(sp + 68) = t4; +f_put_string(mem, sp, a0, a1); +goto L40d284; +MEM_U32(sp + 68) = t4; +L40d284: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x3a; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d2a0; +a3 = 0xa; +L40d2a0: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = MEM_U32(sp + 68); +a2 = 0x1; +a3 = 0xa; +f_write_cardinal(mem, sp, a0, a1, a2, a3); +goto L40d2bc; +a3 = 0xa; +L40d2bc: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d2c8: +//nop; +a0 = s1; +a1 = 0x1; +f_put_string(mem, sp, a0, a1); +goto L40d2d8; +a1 = 0x1; +L40d2d8: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d2e4: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = MEM_U32(s2 + 0); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d2fc; +a3 = 0xa; +L40d2fc: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d318; +a3 = 0xa; +L40d318: +gp = MEM_U32(sp + 40); +a0 = s1; +//nop; +a1 = 0x1; +//nop; +f_put_string(mem, sp, a0, a1); +goto L40d330; +//nop; +L40d330: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d33c: +a1 = MEM_U32(s2 + 0); +a2 = 0x1; +if (a1 != 0) {//nop; +goto L40d3dc;} +//nop; +//nop; +a0 = MEM_U32(s1 + 0); +a1 = MEM_U32(s2 + 8); +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d360; +a3 = 0xa; +L40d360: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d37c; +a3 = 0xa; +L40d37c: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x3a; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d398; +a3 = 0xa; +L40d398: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d3b4; +a3 = 0xa; +L40d3b4: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = MEM_U32(s2 + 12); +a2 = 0x1; +a3 = 0xa; +f_write_cardinal(mem, sp, a0, a1, a2, a3); +goto L40d3d0; +a3 = 0xa; +L40d3d0: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d3dc: +//nop; +a0 = s1; +//nop; +f_put_sym(mem, sp, a0, a1); +goto L40d3ec; +//nop; +L40d3ec: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(s2 + 8); +//nop; +a0 = s1; +//nop; +f_put_integer_ws(mem, sp, a0, a1); +goto L40d404; +//nop; +L40d404: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d410: +t5 = MEM_U32(s2 + 8); +at = 0x10019308; +//nop; +a0 = MEM_U32(sp + 52); +a1 = 0x10; +MEM_U32(at + 0) = t5; +f_get(mem, sp, a0, a1); +goto L40d42c; +MEM_U32(at + 0) = t5; +L40d42c: +gp = MEM_U32(sp + 40); +t9 = 0x1; +t6 = 0x10018ef0; +v0 = 0x10019308; +t6 = MEM_U32(t6 + 0); +t0 = 0xa; +t7 = MEM_U32(t6 + 4); +a2 = MEM_U32(v0 + 0); +a3 = MEM_U32(t7 + 8); +//nop; +MEM_U32(v0 + 4) = a3; +a0 = MEM_U32(s1 + 0); +MEM_U32(sp + 16) = t9; +//nop; +MEM_U32(sp + 20) = t0; +//nop; +f_write_int64(mem, sp, a0, a1, a2, a3); +goto L40d470; +//nop; +L40d470: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d48c; +a3 = 0xa; +L40d48c: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x3a; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d4a8; +a3 = 0xa; +L40d4a8: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d4c4; +a3 = 0xa; +L40d4c4: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = MEM_U32(s2 + 12); +a2 = 0x1; +a3 = 0xa; +f_write_cardinal(mem, sp, a0, a1, a2, a3); +goto L40d4e0; +a3 = 0xa; +L40d4e0: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d4ec: +//nop; +a1 = MEM_U32(s2 + 0); +a0 = s1; +f_put_sym(mem, sp, a0, a1); +goto L40d4fc; +a0 = s1; +L40d4fc: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d518; +a3 = 0xa; +L40d518: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = MEM_U32(s2 + 8); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d534; +a3 = 0xa; +L40d534: +t1 = MEM_U32(s2 + 12); +gp = MEM_U32(sp + 40); +if (t1 == 0) {a1 = 0x20; +goto L40dcd0;} +a1 = 0x20; +//nop; +a0 = MEM_U32(s1 + 0); +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d558; +a3 = 0xa; +L40d558: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x53; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d574; +a3 = 0xa; +L40d574: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d580: +//nop; +a1 = MEM_U32(s2 + 0); +a0 = s1; +f_put_sym(mem, sp, a0, a1); +goto L40d590; +a0 = s1; +L40d590: +t2 = MEM_U32(s2 + 8); +gp = MEM_U32(sp + 40); +if (t2 == 0) {a1 = 0x2c; +goto L40dcd0;} +a1 = 0x2c; +//nop; +a0 = MEM_U32(s1 + 0); +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d5b4; +a3 = 0xa; +L40d5b4: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(s2 + 8); +//nop; +a0 = s1; +//nop; +f_put_sym(mem, sp, a0, a1); +goto L40d5cc; +//nop; +L40d5cc: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d5d8: +//nop; +a1 = MEM_U32(s2 + 0); +a0 = s1; +f_put_sym(mem, sp, a0, a1); +goto L40d5e8; +a0 = s1; +L40d5e8: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d5f4: +t3 = MEM_U8(s2 + 12); +t7 = 0x10000000; +t4 = t3 << 24; +t5 = t4 >> 25; +//nop; +t6 = t5 << 2; +t6 = t6 + t5; +a0 = MEM_U32(s1 + 0); +a2 = 0x5; +a3 = zero; +a1 = t6 + t7; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40d624; +a1 = t6 + t7; +L40d624: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +a1 = 0x100076b7; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40d644; +a1 = a1; +L40d644: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = MEM_U32(s2 + 8); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d660; +a3 = 0xa; +L40d660: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +a1 = 0x100076b5; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40d680; +a1 = a1; +L40d680: +t8 = MEM_U16(s2 + 12); +gp = MEM_U32(sp + 40); +t9 = t8 << 23; +t0 = t9 >> 25; +//nop; +t2 = 0x10000000; +t1 = t0 << 2; +t1 = t1 + t0; +a0 = MEM_U32(s1 + 0); +a2 = 0x5; +a3 = zero; +a1 = t1 + t2; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40d6b4; +a1 = t1 + t2; +L40d6b4: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d6c0: +t3 = MEM_U8(s2 + 8); +t7 = 0x10000000; +t4 = t3 << 24; +t5 = t4 >> 25; +//nop; +t6 = t5 << 2; +t6 = t6 + t5; +a0 = MEM_U32(s1 + 0); +a2 = 0x5; +a3 = zero; +a1 = t6 + t7; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40d6f0; +a1 = t6 + t7; +L40d6f0: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +a1 = 0x100076b3; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40d710; +a1 = a1; +L40d710: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = MEM_U32(s2 + 12); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d72c; +a3 = 0xa; +L40d72c: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +a1 = 0x100076b1; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40d74c; +a1 = a1; +L40d74c: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = MEM_U32(s2 + 0); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d768; +a3 = 0xa; +L40d768: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d774: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = MEM_U32(s2 + 8); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d78c; +a3 = 0xa; +L40d78c: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d7a8; +a3 = 0xa; +L40d7a8: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = MEM_U32(s2 + 12); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d7c4; +a3 = 0xa; +L40d7c4: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d7d0: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = MEM_U32(s2 + 8); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d7e8; +a3 = 0xa; +L40d7e8: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d804; +a3 = 0xa; +L40d804: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = MEM_U32(s2 + 12); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d820; +a3 = 0xa; +L40d820: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d82c: +//nop; +a1 = MEM_U32(s2 + 8); +a0 = s1; +f_put_hex10(mem, sp, a0, a1); +goto L40d83c; +a0 = s1; +L40d83c: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +a1 = 0x100076af; +//nop; +a2 = 0x2; +a3 = 0x2; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40d85c; +a1 = a1; +L40d85c: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = MEM_U32(s2 + 12); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d878; +a3 = 0xa; +L40d878: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d884: +//nop; +a1 = MEM_U32(s2 + 0); +a0 = s1; +f_put_sym(mem, sp, a0, a1); +goto L40d894; +a0 = s1; +L40d894: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d8b0; +a3 = 0xa; +L40d8b0: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = MEM_U32(s2 + 8); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d8cc; +a3 = 0xa; +L40d8cc: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d8d8: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = MEM_U32(s2 + 0); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d8f0; +a3 = 0xa; +L40d8f0: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d8fc: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = MEM_U32(s2 + 8); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d914; +a3 = 0xa; +L40d914: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d920: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40d938; +a3 = 0xa; +L40d938: +t8 = MEM_U32(s2 + 8); +gp = MEM_U32(sp + 40); +t9 = t8 << 2; +t0 = 0x10000464; +t9 = t9 - t8; +t9 = t9 << 2; +a1 = t9 + t0; +//nop; +a0 = MEM_U32(s1 + 0); +a2 = 0xc; +a3 = zero; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40d968; +a3 = zero; +L40d968: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d974: +t1 = MEM_U8(s2 + 6); +t5 = 0x10000530; +t2 = t1 << 24; +t3 = t2 >> 30; +t4 = t3 << 2; +//nop; +t4 = t4 + t3; +t4 = t4 << 1; +a0 = MEM_U32(s1 + 0); +a2 = 0xa; +a3 = zero; +a1 = t4 + t5; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40d9a8; +a1 = t4 + t5; +L40d9a8: +v0 = MEM_U8(s2 + 6); +gp = MEM_U32(sp + 40); +t6 = v0 << 24; +t7 = t6 >> 30; +at = 0x1; +if (t7 == at) {a2 = 0x1; +goto L40d9d0;} +a2 = 0x1; +at = 0x2; +if (t7 != at) {//nop; +goto L40dcd0;} +//nop; +L40d9d0: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = MEM_U32(s2 + 12); +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40d9e4; +a3 = 0xa; +L40d9e4: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40d9f0: +t8 = MEM_U8(s2 + 6); +t2 = 0x10000000; +t9 = t8 << 24; +t0 = t9 >> 25; +//nop; +t1 = t0 << 2; +t1 = t1 + t0; +a0 = MEM_U32(s1 + 0); +a2 = 0x5; +a3 = zero; +a1 = t1 + t2; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40da20; +a1 = t1 + t2; +L40da20: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x2c; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40da3c; +a3 = 0xa; +L40da3c: +t3 = MEM_U16(s2 + 6); +gp = MEM_U32(sp + 40); +t4 = t3 << 23; +t5 = t4 >> 25; +t7 = 0x10000000; +//nop; +t6 = t5 << 2; +t6 = t6 + t5; +a0 = MEM_U32(s1 + 0); +a2 = 0x5; +a3 = zero; +a1 = t6 + t7; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40da70; +a1 = t6 + t7; +L40da70: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40da7c: +//nop; +a1 = MEM_U32(s2 + 8); +a0 = s1; +f_put_hex10(mem, sp, a0, a1); +goto L40da8c; +a0 = s1; +L40da8c: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x2c; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40daa8; +a3 = 0xa; +L40daa8: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(s2 + 12); +//nop; +a0 = s1; +//nop; +f_put_hex10(mem, sp, a0, a1); +goto L40dac0; +//nop; +L40dac0: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40dacc: +t8 = MEM_U8(s2 + 8); +t2 = 0x10000000; +t9 = t8 << 24; +t0 = t9 >> 25; +//nop; +t1 = t0 << 2; +t1 = t1 + t0; +a0 = MEM_U32(s1 + 0); +a2 = 0x5; +a3 = zero; +a1 = t1 + t2; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40dafc; +a1 = t1 + t2; +L40dafc: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40db08: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = MEM_U32(s2 + 8); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40db20; +a3 = 0xa; +L40db20: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40db3c; +a3 = 0xa; +L40db3c: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(s2 + 0); +//nop; +a0 = s1; +//nop; +f_put_sym(mem, sp, a0, a1); +goto L40db54; +//nop; +L40db54: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40db70; +a3 = 0xa; +L40db70: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(s2 + 12); +//nop; +a0 = s1; +//nop; +f_put_sym(mem, sp, a0, a1); +goto L40db88; +//nop; +L40db88: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40db94: +t3 = MEM_U32(sp + 52); +//nop; +t4 = MEM_U32(t3 + 4); +//nop; +t5 = MEM_U32(t4 + 8); +//nop; +if (t5 == 0) {//nop; +goto L40dcd0;} +//nop; +//nop; +a0 = s1; +a1 = zero; +f_put_string(mem, sp, a0, a1); +goto L40dbc4; +a1 = zero; +L40dbc4: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40dbd0: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = MEM_U32(s2 + 8); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40dbe8; +a3 = 0xa; +L40dbe8: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40dc04; +a3 = 0xa; +L40dc04: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = MEM_U32(s2 + 12); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40dc20; +a3 = 0xa; +L40dc20: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40dc2c: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = MEM_U32(s2 + 8); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40dc44; +a3 = 0xa; +L40dc44: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40dc50: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = MEM_U32(s2 + 8); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40dc68; +a3 = 0xa; +L40dc68: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = 0x2c; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L40dc84; +a3 = 0xa; +L40dc84: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +a1 = MEM_U32(s2 + 12); +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L40dca0; +a3 = 0xa; +L40dca0: +gp = MEM_U32(sp + 40); +//nop; +goto L40dcd0; +//nop; +L40dcac: +a2 = 0x100076aa; +//nop; +a0 = 0x1; +a1 = 0x40c; +a3 = 0x5; +a2 = a2; +f_caseerror(mem, sp, a0, a1, a2, a3); +goto L40dcc8; +a2 = a2; +L40dcc8: +gp = MEM_U32(sp + 40); +//nop; +L40dcd0: +//nop; +a0 = MEM_U32(s1 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L40dce0; +//nop; +L40dce0: +t6 = MEM_U8(s2 + 5); +gp = MEM_U32(sp + 40); +at = 0x1c; +t7 = t6 & 0x3f; +if (t7 != at) {ra = MEM_U32(sp + 44); +goto L40dd18;} +ra = MEM_U32(sp + 44); +//nop; +a1 = MEM_U32(s2 + 8); +a2 = MEM_U32(s2 + 12); +a0 = s1; +f_print_source(mem, sp, a0, a1, a2); +goto L40dd0c; +a0 = s1; +L40dd0c: +gp = MEM_U32(sp + 40); +//nop; +ra = MEM_U32(sp + 44); +L40dd18: +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +sp = sp + 0x48; +return; +sp = sp + 0x48; +} + +static void f_output_inst_ascii(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40dd2c: +//output_inst_ascii: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +s0 = 0x10018ef0; +//nop; +s1 = a1; +a1 = a0; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s2; +a2 = 0x400; +a3 = 0x10; +a0 = s0; +f_reset(mem, sp, a0, a1, a2, a3); +goto L40dd74; +a0 = s0; +L40dd74: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s0 + 0); +//nop; +//nop; +//nop; +v0 = f_eof(mem, sp, a0); +goto L40dd8c; +//nop; +L40dd8c: +gp = MEM_U32(sp + 32); +if (v0 != 0) {s2 = 0x17; +goto L40de24;} +s2 = 0x17; +L40dd98: +t6 = MEM_U32(s0 + 0); +//nop; +t7 = MEM_U32(t6 + 4); +//nop; +t8 = MEM_U8(t7 + 5); +//nop; +t9 = t8 & 0x3f; +if (s2 != t9) {//nop; +goto L40ddd8;} +//nop; +//nop; +a0 = s1; +//nop; +f_write_instruction(mem, sp, a0); +goto L40ddcc; +//nop; +L40ddcc: +gp = MEM_U32(sp + 32); +//nop; +goto L40ddf0; +//nop; +L40ddd8: +//nop; +a0 = s1; +//nop; +f_write_directive(mem, sp, a0); +goto L40dde8; +//nop; +L40dde8: +gp = MEM_U32(sp + 32); +//nop; +L40ddf0: +//nop; +a0 = MEM_U32(s0 + 0); +a1 = 0x10; +f_get(mem, sp, a0, a1); +goto L40de00; +a1 = 0x10; +L40de00: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s0 + 0); +//nop; +//nop; +//nop; +v0 = f_eof(mem, sp, a0); +goto L40de18; +//nop; +L40de18: +gp = MEM_U32(sp + 32); +if (v0 == 0) {//nop; +goto L40dd98;} +//nop; +L40de24: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +//nop; +} + +static void f_set_domtag(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40de40: +//set_domtag: +//nop; +//nop; +//nop; +at = 0x100197a8; +MEM_U32(sp + 0) = a0; +MEM_U8(at + 0) = (uint8_t)a0; +return; +MEM_U8(at + 0) = (uint8_t)a0; +} + +static uint32_t f_get_domtag(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40de5c: +//get_domtag: +//nop; +//nop; +//nop; +v1 = 0x100197a8; +//nop; +v0 = MEM_U8(v1 + 0); +//nop; +return v0; +//nop; +} + +static uint32_t f_search_label(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40de7c: +//search_label: +//nop; +//nop; +//nop; +at = 0xfd; +lo = a0 / at; hi = a0 % at; +t6 = hi; +if ((int)t6 >= 0) {//nop; +goto L40dea0;} +//nop; +t6 = t6 + 0xfd; +L40dea0: +t9 = 0x100193b0; +t7 = t6 & 0xff; +t8 = t7 << 2; +t0 = t8 + t9; +v1 = MEM_U32(t0 + 0); +//nop; +if (v1 == 0) {//nop; +goto L40dee0;} +//nop; +L40dec0: +t1 = MEM_U32(v1 + 36); +//nop; +if (a0 == t1) {//nop; +goto L40dee0;} +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +if (v1 != 0) {//nop; +goto L40dec0;} +//nop; +L40dee0: +v0 = v1; +return v0; +v0 = v1; +} + +static uint32_t f_find_label(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40dee8: +//find_label: +//nop; +//nop; +//nop; +at = 0xfd; +lo = a0 / at; hi = a0 % at; +sp = sp + 0xffffffd0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +a1 = a0; +t6 = hi; +if ((int)t6 >= 0) {//nop; +goto L40df1c;} +//nop; +t6 = t6 + 0xfd; +L40df1c: +t9 = 0x100193b0; +t7 = t6 & 0xff; +t8 = t7 << 2; +a2 = t8 + t9; +v1 = MEM_U32(a2 + 0); +//nop; +if (v1 == 0) {//nop; +goto L40df64;} +//nop; +L40df3c: +t0 = MEM_U32(v1 + 36); +//nop; +if (a1 != t0) {//nop; +goto L40df54;} +//nop; +v0 = v1; +goto L40dfa0; +v0 = v1; +L40df54: +v1 = MEM_U32(v1 + 0); +//nop; +if (v1 != 0) {//nop; +goto L40df3c;} +//nop; +L40df64: +//nop; +a0 = 0x42; +MEM_U32(sp + 48) = a1; +MEM_U32(sp + 32) = a2; +v0 = f_build_op(mem, sp, a0); +goto L40df78; +MEM_U32(sp + 32) = a2; +L40df78: +a2 = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +gp = MEM_U32(sp + 24); +MEM_U16(v0 + 34) = (uint16_t)zero; +MEM_U32(v0 + 40) = zero; +MEM_U32(v0 + 36) = a1; +t1 = MEM_U32(a2 + 0); +//nop; +MEM_U32(v0 + 0) = t1; +MEM_U32(a2 + 0) = v0; +L40dfa0: +ra = MEM_U32(sp + 28); +sp = sp + 0x30; +//nop; +return v0; +//nop; +} + +static void f_init_build(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40dfb0: +//init_build: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +a0 = 0x400; +a1 = zero; +v0 = f_new(mem, sp, a0, a1); +goto L40dfd8; +a1 = zero; +L40dfd8: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +at = 0x100197a4; +sp = sp + 0x20; +MEM_U32(at + 0) = v0; +return; +MEM_U32(at + 0) = v0; +} + +static void func_40dff0(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40dff0: +v1 = MEM_U32(v0 + -5212); +//nop; +MEM_U32(v1 + 8) = a0; +MEM_U32(a0 + 12) = v1; +MEM_U32(v0 + -5212) = a0; +return; +MEM_U32(v0 + -5212) = a0; +} + +static void func_40e008(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40e008: +v1 = MEM_U32(v0 + -5212); +//nop; +MEM_U32(v1 + 8) = a0; +a1 = MEM_U32(a0 + 8); +MEM_U32(a0 + 12) = v1; +if (a1 == 0) {//nop; +goto L40e040;} +//nop; +L40e024: +MEM_U32(a1 + 12) = a0; +a0 = MEM_U32(a0 + 8); +//nop; +a1 = MEM_U32(a0 + 8); +//nop; +if (a1 != 0) {//nop; +goto L40e024;} +//nop; +L40e040: +MEM_U32(v0 + -5212) = a0; +return; +MEM_U32(v0 + -5212) = a0; +} + +static void func_40e048(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40e048: +v0 = MEM_U32(a0 + 8); +MEM_U32(a0 + 8) = a1; +v1 = MEM_U32(a1 + 8); +//nop; +if (v1 == 0) {//nop; +goto L40e074;} +//nop; +L40e060: +a1 = v1; +v1 = MEM_U32(v1 + 8); +//nop; +if (v1 != 0) {//nop; +goto L40e060;} +//nop; +L40e074: +MEM_U32(a1 + 8) = v0; +return; +MEM_U32(a1 + 8) = v0; +} + +static void func_40e07c(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40e07c: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb8; +t6 = v0 + 0xffffeba7; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +MEM_U32(sp + 72) = a0; +t7 = t6 + a0; +t8 = MEM_U8(t7 + 0); +at = 0x8; +if (t8 != at) {s1 = v0; +goto L40e0c8;} +s1 = v0; +t9 = 0x8; +MEM_U8(sp + 67) = (uint8_t)t9; +goto L40e0d0; +MEM_U8(sp + 67) = (uint8_t)t9; +L40e0c8: +t0 = 0x6; +MEM_U8(sp + 67) = (uint8_t)t0; +L40e0d0: +s2 = a0 << 2; +t1 = s1 + 0xfffff9b4; +s0 = t1 + s2; +a3 = MEM_U32(s0 + 0); +t3 = s1 + 0xfffff374; +if (a3 != 0) {t4 = t3 + s2; +goto L40e118;} +t4 = t3 + s2; +t2 = s1 + 0xfffff374; +//nop; +v0 = t2 + s2; +a2 = MEM_U32(v0 + 0); +a0 = MEM_U8(sp + 67); +MEM_U32(sp + 44) = v0; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L40e10c; +a1 = zero; +L40e10c: +gp = MEM_U32(sp + 32); +MEM_U32(s0 + 0) = v0; +goto L40e20c; +MEM_U32(s0 + 0) = v0; +L40e118: +MEM_U32(sp + 44) = t4; +a2 = MEM_U32(t4 + 0); +//nop; +if (a2 == 0) {t4 = MEM_U32(sp + 44); +goto L40e210;} +t4 = MEM_U32(sp + 44); +a0 = MEM_U8(a3 + 33); +at = 0x7800000; +t5 = a0 & 0x1f; +t6 = t5 < 0x20; +t7 = -t6; +t8 = t7 & at; +t9 = t8 << (t5 & 0x1f); +if ((int)t9 >= 0) {a0 = t5; +goto L40e1c0;} +a0 = t5; +if ((int)a2 >= 0) {//nop; +goto L40e18c;} +//nop; +//nop; +a1 = 0xffffffff; +MEM_U32(sp + 48) = a3; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L40e168; +MEM_U32(sp + 48) = a3; +L40e168: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +//nop; +a0 = 0x1; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L40e180; +a2 = v0; +L40e180: +gp = MEM_U32(sp + 32); +MEM_U32(s0 + 0) = v0; +goto L40e1f4; +MEM_U32(s0 + 0) = v0; +L40e18c: +//nop; +a1 = zero; +MEM_U32(sp + 48) = a3; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L40e19c; +MEM_U32(sp + 48) = a3; +L40e19c: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +//nop; +a0 = 0x1; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L40e1b4; +a2 = v0; +L40e1b4: +gp = MEM_U32(sp + 32); +MEM_U32(s0 + 0) = v0; +goto L40e1f4; +MEM_U32(s0 + 0) = v0; +L40e1c0: +//nop; +a0 = MEM_U8(sp + 67); +a1 = zero; +MEM_U32(sp + 48) = a3; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L40e1d4; +MEM_U32(sp + 48) = a3; +L40e1d4: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +//nop; +a0 = 0x1; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L40e1ec; +a2 = v0; +L40e1ec: +gp = MEM_U32(sp + 32); +MEM_U32(s0 + 0) = v0; +L40e1f4: +t0 = s1 + 0xffffed34; +t1 = t0 + s2; +t2 = MEM_U32(t1 + 0); +t3 = MEM_U32(s0 + 0); +//nop; +MEM_U16(t3 + 34) = (uint16_t)t2; +L40e20c: +t4 = MEM_U32(sp + 44); +L40e210: +t5 = s1 + 0xffffed34; +t6 = t5 + s2; +MEM_U32(t4 + 0) = zero; +MEM_U32(t6 + 0) = zero; +ra = MEM_U32(sp + 36); +s2 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 24); +s0 = MEM_U32(sp + 20); +sp = sp + 0x48; +return; +sp = sp + 0x48; +} + +static void func_40e238(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40e238: +//nop; +//nop; +//nop; +sp = sp + 0xffffffa8; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 20) = s0; +t6 = MEM_U8(v0 + -5354); +s0 = a0; +if (t6 == 0) {a1 = v0; +goto L40e26c;} +a1 = v0; +t7 = 0x1; +MEM_U8(v0 + -5355) = (uint8_t)t7; +L40e26c: +v0 = MEM_U8(s0 + 32); +at = v0 < 0x53; +goto L40e624; +at = v0 < 0x53; +L40e278: +t9 = 0x100193a0; +t8 = MEM_U32(s0 + 44); +t9 = MEM_U32(t9 + 0); +//nop; +v0 = t8 - t9; +if ((int)v0 >= 0) {//nop; +goto L40e298;} +//nop; +v0 = -v0; +L40e298: +if ((int)v0 >= 0) {t4 = (int)v0 >> 2; +goto L40e2a8;} +t4 = (int)v0 >> 2; +at = v0 + 0x3; +t4 = (int)at >> 2; +L40e2a8: +if ((int)t4 >= 0) {a0 = t4; +goto L40e2b4;} +a0 = t4; +a0 = 0x0; +L40e2b4: +t5 = MEM_U32(s0 + 40); +v1 = a0; +t6 = v0 + t5; +t7 = t6 + 0xffffffff; +if ((int)t7 >= 0) {t8 = (int)t7 >> 2; +goto L40e2d4;} +t8 = (int)t7 >> 2; +at = t7 + 0x3; +t8 = (int)at >> 2; +L40e2d4: +at = (int)t8 < (int)0x4; +if (at != 0) {t1 = t8; +goto L40e2e4;} +t1 = t8; +t1 = 0x3; +L40e2e4: +at = (int)t1 < (int)a0; +if (at != 0) {t0 = v1 << 2; +goto L40e678;} +t0 = v1 << 2; +t0 = t0 - v1; +t3 = t1 << 2; +t3 = t3 - t1; +t0 = t0 << 2; +t9 = a1 + 0xffffead8; +t2 = 0x10018e80; +v0 = t9 + t0; +t3 = t3 << 2; +L40e310: +v1 = MEM_U8(v0 + 0); +a0 = 0x1; +at = v1 < 0x5; +if (at == 0) {a1 = 0x1a6; +goto L40e504;} +a1 = 0x1a6; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100077c0[] = { +&&L40e344, +&&L40e378, +&&L40e43c, +&&L40e43c, +&&L40e4f0, +}; +dest = Lswitch100077c0[v1]; +//nop; +goto *dest; +//nop; +L40e344: +t6 = MEM_U8(s0 + 33); +a3 = MEM_U16(s0 + 34); +t8 = MEM_U32(s0 + 44); +t9 = MEM_U32(s0 + 40); +t5 = 0x1; +t7 = t6 & 0x1f; +t4 = a3 & 0x1; +MEM_U8(v0 + 0) = (uint8_t)t5; +MEM_U8(v0 + 1) = (uint8_t)t7; +a3 = t4; +MEM_U32(v0 + 4) = t8; +MEM_U32(v0 + 8) = t9; +goto L40e54c; +MEM_U32(v0 + 8) = t9; +L40e378: +a2 = MEM_U8(s0 + 33); +a3 = MEM_U16(s0 + 34); +t7 = MEM_U8(v0 + 1); +a0 = MEM_U32(s0 + 40); +t5 = a2 & 0x1f; +t6 = a3 & 0x1; +a3 = t6; +if (t5 != t7) {a2 = t5; +goto L40e3c0;} +a2 = t5; +t8 = MEM_U32(s0 + 44); +t9 = MEM_U32(v0 + 4); +//nop; +if (t8 != t9) {//nop; +goto L40e3c0;} +//nop; +t4 = MEM_U32(v0 + 8); +//nop; +if (a0 == t4) {//nop; +goto L40e54c;} +//nop; +L40e3c0: +t6 = MEM_U8(t2 + 0); +t5 = 0x2; +if (t6 == 0) {MEM_U8(v0 + 0) = (uint8_t)t5; +goto L40e3f0;} +MEM_U8(v0 + 0) = (uint8_t)t5; +t7 = MEM_U32(v0 + 8); +//nop; +at = (int)a0 < (int)t7; +if (at == 0) {//nop; +goto L40e3e8;} +//nop; +t7 = a0; +L40e3e8: +MEM_U32(v0 + 8) = t7; +goto L40e418; +MEM_U32(v0 + 8) = t7; +L40e3f0: +v1 = MEM_U32(s0 + 44); +t9 = MEM_U32(v0 + 8); +t4 = MEM_U32(v0 + 4); +t8 = a0 + v1; +t5 = t9 + t4; +at = (int)t8 < (int)t5; +if (at == 0) {t6 = a2 < 0x20; +goto L40e41c;} +t6 = a2 < 0x20; +MEM_U32(v0 + 8) = a0; +MEM_U32(v0 + 4) = v1; +L40e418: +t6 = a2 < 0x20; +L40e41c: +t7 = -t6; +at = 0x2800000; +t9 = t7 & at; +t4 = t9 << (a2 & 0x1f); +if ((int)t4 < 0) {//nop; +goto L40e54c;} +//nop; +MEM_U8(v0 + 1) = (uint8_t)a2; +goto L40e54c; +MEM_U8(v0 + 1) = (uint8_t)a2; +L40e43c: +a2 = MEM_U8(s0 + 33); +a3 = MEM_U16(s0 + 34); +t6 = MEM_U8(v0 + 1); +a0 = MEM_U32(s0 + 40); +t8 = a2 & 0x1f; +t5 = a3 & 0x1; +a3 = t5; +if (t8 != t6) {a2 = t8; +goto L40e484;} +a2 = t8; +t7 = MEM_U32(s0 + 44); +t9 = MEM_U32(v0 + 4); +//nop; +if (t7 != t9) {//nop; +goto L40e484;} +//nop; +t4 = MEM_U32(v0 + 8); +//nop; +if (a0 == t4) {//nop; +goto L40e54c;} +//nop; +L40e484: +t8 = MEM_U8(t2 + 0); +a1 = MEM_U32(v0 + 8); +if (t8 == 0) {t4 = a2 < 0x20; +goto L40e4ac;} +t4 = a2 < 0x20; +at = (int)a0 < (int)a1; +if (at == 0) {t5 = a1; +goto L40e4a4;} +t5 = a1; +t5 = a0; +L40e4a4: +MEM_U32(v0 + 8) = t5; +goto L40e4d0; +MEM_U32(v0 + 8) = t5; +L40e4ac: +v1 = MEM_U32(s0 + 44); +t7 = MEM_U32(v0 + 4); +t6 = a0 + v1; +t9 = a1 + t7; +at = (int)t6 < (int)t9; +if (at == 0) {t8 = -t4; +goto L40e4d4;} +t8 = -t4; +MEM_U32(v0 + 8) = a0; +MEM_U32(v0 + 4) = v1; +L40e4d0: +t8 = -t4; +L40e4d4: +at = 0x2800000; +t5 = t8 & at; +t7 = t5 << (a2 & 0x1f); +if ((int)t7 < 0) {//nop; +goto L40e54c;} +//nop; +MEM_U8(v0 + 1) = (uint8_t)a2; +goto L40e54c; +MEM_U8(v0 + 1) = (uint8_t)a2; +L40e4f0: +a3 = MEM_U16(s0 + 34); +//nop; +t6 = a3 & 0x1; +a3 = t6; +goto L40e54c; +a3 = t6; +L40e504: +a2 = 0x100077b7; +//nop; +a3 = 0x7; +MEM_U32(sp + 52) = v0; +MEM_U32(sp + 56) = t0; +MEM_U32(sp + 76) = t1; +MEM_U32(sp + 36) = t3; +a2 = a2; +f_caseerror(mem, sp, a0, a1, a2, a3); +goto L40e528; +a2 = a2; +L40e528: +gp = MEM_U32(sp + 24); +a3 = MEM_U16(s0 + 34); +v0 = MEM_U32(sp + 52); +t9 = a3 & 0x1; +t0 = MEM_U32(sp + 56); +t1 = MEM_U32(sp + 76); +t3 = MEM_U32(sp + 36); +t2 = 0x10018e80; +a3 = t9; +L40e54c: +if (a3 == 0) {t0 = t0 + 0xc; +goto L40e55c;} +t0 = t0 + 0xc; +t4 = 0x4; +MEM_U8(v0 + 0) = (uint8_t)t4; +L40e55c: +at = (int)t3 < (int)t0; +if (at == 0) {v0 = v0 + 0xc; +goto L40e310;} +v0 = v0 + 0xc; +ra = MEM_U32(sp + 28); +goto L40e67c; +ra = MEM_U32(sp + 28); +L40e570: +t5 = 0x100193a0; +t8 = MEM_U32(s0 + 48); +t5 = MEM_U32(t5 + 0); +//nop; +v0 = t8 - t5; +if ((int)v0 >= 0) {t5 = a1 + 0xffffead8; +goto L40e590;} +t5 = a1 + 0xffffead8; +v0 = -v0; +L40e590: +if ((int)v0 >= 0) {t7 = (int)v0 >> 2; +goto L40e5a0;} +t7 = (int)v0 >> 2; +at = v0 + 0x3; +t7 = (int)at >> 2; +L40e5a0: +if ((int)t7 >= 0) {a0 = t7; +goto L40e5ac;} +a0 = t7; +a0 = 0x0; +L40e5ac: +t6 = MEM_U32(s0 + 40); +v1 = a0; +t9 = v0 + t6; +t4 = t9 + 0xffffffff; +if ((int)t4 >= 0) {t8 = (int)t4 >> 2; +goto L40e5cc;} +t8 = (int)t4 >> 2; +at = t4 + 0x3; +t8 = (int)at >> 2; +L40e5cc: +at = (int)t8 < (int)0x4; +if (at != 0) {t1 = t8; +goto L40e5dc;} +t1 = t8; +t1 = 0x3; +L40e5dc: +at = (int)t1 < (int)a0; +if (at != 0) {t7 = v1 << 2; +goto L40e678;} +t7 = v1 << 2; +a2 = MEM_U8(s0 + 33); +t7 = t7 - v1; +t7 = t7 << 2; +t6 = a2 & 0x1f; +a2 = t6; +v0 = t5 + t7; +a0 = 0x3; +L40e604: +v1 = v1 + 0x1; +at = (int)t1 < (int)v1; +MEM_U8(v0 + 0) = (uint8_t)a0; +MEM_U8(v0 + 1) = (uint8_t)a2; +if (at == 0) {v0 = v0 + 0xc; +goto L40e604;} +v0 = v0 + 0xc; +ra = MEM_U32(sp + 28); +goto L40e67c; +ra = MEM_U32(sp + 28); +L40e624: +if (at != 0) {a0 = 0x1; +goto L40e640;} +a0 = 0x1; +at = 0x7b; +if (v0 == at) {//nop; +goto L40e278;} +//nop; +//nop; +goto L40e658; +//nop; +L40e640: +at = 0x47; +if (v0 == at) {//nop; +goto L40e570;} +//nop; +at = 0x52; +if (v0 == at) {//nop; +goto L40e278;} +//nop; +L40e658: +a2 = 0x100077b0; +//nop; +a1 = 0x19f; +a3 = 0x7; +a2 = a2; +f_caseerror(mem, sp, a0, a1, a2, a3); +goto L40e670; +a2 = a2; +L40e670: +gp = MEM_U32(sp + 24); +//nop; +L40e678: +ra = MEM_U32(sp + 28); +L40e67c: +s0 = MEM_U32(sp + 20); +sp = sp + 0x58; +return; +sp = sp + 0x58; +} + +static uint32_t func_40e688(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40e688: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t7 = 0x100193a0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +t0 = MEM_U32(a0 + 44); +t7 = MEM_U32(t7 + 0); +t3 = v0; +v1 = t0 - t7; +if ((int)v1 >= 0) {t6 = a0; +goto L40e6c4;} +t6 = a0; +v1 = -v1; +L40e6c4: +t1 = MEM_U32(t6 + 40); +//nop; +a3 = v1 + t1; +a3 = a3 + 0xffffffff; +if ((int)a3 >= 0) {t8 = (int)a3 >> 2; +goto L40e6e4;} +t8 = (int)a3 >> 2; +at = a3 + 0x3; +t8 = (int)at >> 2; +L40e6e4: +a3 = t8; +if ((int)v1 >= 0) {a1 = (int)v1 >> 2; +goto L40e6f8;} +a1 = (int)v1 >> 2; +at = v1 + 0x3; +a1 = (int)at >> 2; +L40e6f8: +if ((int)a1 < 0) {at = (int)a3 < (int)0x4; +goto L40e708;} +at = (int)a3 < (int)0x4; +if (at != 0) {t4 = 0xc; +goto L40e710;} +t4 = 0xc; +L40e708: +v0 = zero; +goto L40eab0; +v0 = zero; +L40e710: +lo = a1 * t4; +hi = (uint32_t)((uint64_t)a1 * (uint64_t)t4 >> 32); +a0 = t3 + 0xffffead8; +at = 0x4; +t5 = MEM_U32(sp + 40); +t9 = lo; +v1 = a0 + t9; +t2 = MEM_U8(v1 + 0); +//nop; +if (t2 != at) {//nop; +goto L40e740;} +//nop; +v0 = zero; +goto L40eab0; +v0 = zero; +L40e740: +a2 = MEM_U8(t5 + 33); +//nop; +t7 = a2 & 0x1f; +v0 = t7 & 0xff; +at = v0 < 0x10; +if (at == 0) {a2 = t7; +goto L40e940;} +a2 = t7; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100077d4[] = { +&&L40e824, +&&L40e940, +&&L40e824, +&&L40e824, +&&L40e824, +&&L40e940, +&&L40e77c, +&&L40e940, +&&L40e77c, +&&L40e824, +&&L40e940, +&&L40e940, +&&L40e888, +&&L40e824, +&&L40e940, +&&L40e824, +}; +dest = Lswitch100077d4[v0]; +//nop; +goto *dest; +//nop; +L40e77c: +if (a1 == a3) {//nop; +goto L40e78c;} +//nop; +v0 = zero; +goto L40eab0; +v0 = zero; +L40e78c: +a0 = MEM_U32(v1 + 8); +at = 0x4; +if (a0 == at) {a1 = a0; +goto L40e810;} +a1 = a0; +t8 = MEM_U8(t3 + -5325); +//nop; +if (t8 != 0) {at = 0x3; +goto L40e814;} +at = 0x3; +t9 = 0x10018e80; +//nop; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L40e7e4;} +//nop; +v0 = MEM_U32(v1 + 4); +//nop; +if (t0 != v0) {//nop; +goto L40e7dc;} +//nop; +if (t1 == a1) {t6 = MEM_U32(sp + 40); +goto L40e804;} +t6 = MEM_U32(sp + 40); +L40e7dc: +v0 = zero; +goto L40eab0; +v0 = zero; +L40e7e4: +v0 = MEM_U32(v1 + 4); +t5 = t0 + t1; +t7 = v0 + a0; +if (t5 == t7) {t6 = MEM_U32(sp + 40); +goto L40e804;} +t6 = MEM_U32(sp + 40); +v0 = zero; +goto L40eab0; +v0 = zero; +t6 = MEM_U32(sp + 40); +L40e804: +//nop; +MEM_U32(t6 + 44) = v0; +MEM_U32(t6 + 40) = a1; +L40e810: +at = 0x3; +L40e814: +if (t2 != at) {//nop; +goto L40e948;} +//nop; +v0 = zero; +goto L40eab0; +v0 = zero; +L40e824: +if (a1 != a3) {//nop; +goto L40e85c;} +//nop; +t8 = MEM_U8(v1 + 1); +//nop; +if (a2 != t8) {//nop; +goto L40e85c;} +//nop; +t9 = MEM_U32(v1 + 4); +//nop; +if (t0 != t9) {//nop; +goto L40e85c;} +//nop; +t5 = MEM_U32(v1 + 8); +//nop; +if (t1 == t5) {at = 0x3; +goto L40e878;} +at = 0x3; +L40e85c: +t7 = MEM_U8(t3 + -5325); +//nop; +if (t7 != 0) {at = 0x3; +goto L40e878;} +at = 0x3; +v0 = zero; +goto L40eab0; +v0 = zero; +at = 0x3; +L40e878: +if (t2 != at) {//nop; +goto L40e948;} +//nop; +v0 = zero; +goto L40eab0; +v0 = zero; +L40e888: +t6 = a1 + 0x1; +if (t6 != a3) {//nop; +goto L40e914;} +//nop; +t8 = MEM_U8(v1 + 1); +a1 = 0xc; +if (a1 != t8) {//nop; +goto L40e914;} +//nop; +t9 = MEM_U32(v1 + 4); +//nop; +if (t0 != t9) {//nop; +goto L40e914;} +//nop; +t5 = MEM_U32(v1 + 8); +a2 = 0x8; +if (a2 != t5) {//nop; +goto L40e914;} +//nop; +lo = a3 * t4; +hi = (uint32_t)((uint64_t)a3 * (uint64_t)t4 >> 32); +at = 0x2; +t7 = lo; +v0 = a0 + t7; +t6 = MEM_U8(v0 + 0); +//nop; +if (t6 == at) {//nop; +goto L40e914;} +//nop; +t8 = MEM_U8(v0 + 1); +//nop; +if (a1 != t8) {//nop; +goto L40e914;} +//nop; +t9 = MEM_U32(v0 + 4); +//nop; +if (t0 != t9) {//nop; +goto L40e914;} +//nop; +t5 = MEM_U32(v0 + 8); +//nop; +if (a2 == t5) {at = 0x3; +goto L40e930;} +at = 0x3; +L40e914: +t7 = MEM_U8(t3 + -5325); +//nop; +if (t7 != 0) {at = 0x3; +goto L40e930;} +at = 0x3; +v0 = zero; +goto L40eab0; +v0 = zero; +at = 0x3; +L40e930: +if (t2 != at) {//nop; +goto L40e948;} +//nop; +v0 = zero; +goto L40eab0; +v0 = zero; +L40e940: +v0 = zero; +goto L40eab0; +v0 = zero; +L40e948: +//nop; +a0 = MEM_U32(sp + 40); +MEM_U32(sp + 36) = t3; +v0 = f_parm_reg(mem, sp, a0); +goto L40e958; +MEM_U32(sp + 36) = t3; +L40e958: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 40); +a0 = 0x10018ed0; +t3 = MEM_U32(sp + 36); +a0 = MEM_U8(a0 + 0); +//nop; +v1 = a0 < 0x1; +if (v1 == 0) {//nop; +goto L40e9a0;} +//nop; +t6 = MEM_U8(a1 + 33); +at = 0xba800000; +t8 = t6 & 0x1f; +t9 = t8 < 0x20; +t5 = -t9; +t7 = t5 & at; +v1 = t7 << (t8 & 0x1f); +t6 = (int)v1 < (int)0x0; +v1 = t6; +L40e9a0: +if (v1 != 0) {//nop; +goto L40eaac;} +//nop; +v1 = a0 ^ 0x1; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L40e9dc;} +//nop; +t9 = MEM_U8(a1 + 33); +at = 0x3d010000; +t5 = t9 & 0x1f; +t7 = t5 < 0x20; +t8 = -t7; +t6 = t8 & at; +v1 = t6 << (t5 & 0x1f); +t9 = (int)v1 < (int)0x0; +v1 = t9; +L40e9dc: +if (v1 != 0) {//nop; +goto L40eaac;} +//nop; +a2 = MEM_U8(a1 + 33); +//nop; +t7 = a2 & 0x1f; +v1 = t7 ^ 0x9; +v1 = v1 < 0x1; +if (v1 == 0) {a2 = t7; +goto L40ea18;} +a2 = t7; +t8 = 0x1001934c; +t6 = MEM_U32(a1 + 40); +t8 = MEM_U32(t8 + 0); +//nop; +v1 = t8 ^ t6; +v1 = v1 < 0x1; +L40ea18: +if (v1 != 0) {//nop; +goto L40eaac;} +//nop; +v1 = a2 ^ 0xe; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L40ea48;} +//nop; +t5 = 0x1001934c; +t9 = MEM_U32(a1 + 40); +t5 = MEM_U32(t5 + 0); +//nop; +v1 = (int)t5 < (int)t9; +v1 = v1 ^ 0x1; +L40ea48: +if (v1 != 0) {//nop; +goto L40eaac;} +//nop; +v1 = MEM_U8(t3 + -5325); +t7 = a2 < 0x20; +if (v1 != 0) {t8 = -t7; +goto L40eaac;} +t8 = -t7; +at = 0xc0000; +at = at | 0x8000; +t6 = t8 & at; +v1 = t6 << (a2 & 0x1f); +t5 = (int)v1 < (int)0x0; +if (t5 == 0) {v1 = t5; +goto L40eaac;} +v1 = t5; +a0 = v0 < 0x2c; +v1 = a0 ^ 0x1; +if (v1 == 0) {//nop; +goto L40eaac;} +//nop; +t9 = 0x10019314; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +t7 = t9 << 1; +t8 = t7 + 0x2a; +v1 = t8 < v0; +v1 = v1 ^ 0x1; +L40eaac: +v0 = v1; +L40eab0: +ra = MEM_U32(sp + 28); +sp = sp + 0x28; +//nop; +return v0; +//nop; +} + +static void func_40eac0(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40eac0: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 52) = v0; +a1 = MEM_U32(v0 + -5268); +s1 = a0; +if (a1 != 0) {t6 = v0; +goto L40eafc;} +t6 = v0; +MEM_U32(v0 + -5268) = s1; +goto L40ed90; +MEM_U32(v0 + -5268) = s1; +L40eafc: +t7 = MEM_U8(s1 + 33); +v1 = 0x2; +t8 = t7 << 24; +t9 = t8 >> 29; +a2 = zero; +if (v1 != t9) {s0 = a1; +goto L40ec08;} +s0 = a1; +if (a1 == 0) {//nop; +goto L40ed78;} +//nop; +t0 = MEM_U8(a1 + 33); +//nop; +t1 = t0 << 24; +t2 = t1 >> 29; +if (v1 != t2) {//nop; +goto L40ed78;} +//nop; +L40eb38: +//nop; +a0 = s1; +a1 = s0; +MEM_U32(sp + 44) = a2; +v0 = f_overlap(mem, sp, a0, a1); +goto L40eb4c; +MEM_U32(sp + 44) = a2; +L40eb4c: +gp = MEM_U32(sp + 32); +a2 = MEM_U32(sp + 44); +if (v0 == 0) {v1 = 0x2; +goto L40eb84;} +v1 = 0x2; +t3 = MEM_U32(s0 + 48); +v1 = 0xffffffff; +if (v1 != t3) {ra = MEM_U32(sp + 36); +goto L40ed94;} +ra = MEM_U32(sp + 36); +v0 = MEM_U32(s1 + 48); +//nop; +if (v1 == v0) {ra = MEM_U32(sp + 36); +goto L40ed94;} +ra = MEM_U32(sp + 36); +MEM_U32(s0 + 48) = v0; +goto L40ed90; +MEM_U32(s0 + 48) = v0; +L40eb84: +t4 = 0x10019398; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L40ebbc;} +//nop; +t5 = MEM_U32(s0 + 44); +t6 = MEM_U32(s1 + 44); +//nop; +at = (int)t5 < (int)t6; +if (at == 0) {//nop; +goto L40ebd4;} +//nop; +//nop; +goto L40ed78; +//nop; +L40ebbc: +t7 = MEM_U32(s1 + 44); +t8 = MEM_U32(s0 + 44); +//nop; +at = (int)t7 < (int)t8; +if (at != 0) {//nop; +goto L40ed78;} +//nop; +L40ebd4: +a2 = s0; +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 == 0) {//nop; +goto L40ed78;} +//nop; +t9 = MEM_U8(s0 + 33); +//nop; +t0 = t9 << 24; +t1 = t0 >> 29; +if (v1 == t1) {//nop; +goto L40eb38;} +//nop; +//nop; +goto L40ed78; +//nop; +L40ec08: +if (a1 == 0) {//nop; +goto L40ec54;} +//nop; +t2 = MEM_U8(a1 + 33); +//nop; +t3 = t2 << 24; +t4 = t3 >> 29; +if (v1 != t4) {//nop; +goto L40ec54;} +//nop; +L40ec28: +a2 = s0; +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 == 0) {//nop; +goto L40ec54;} +//nop; +t5 = MEM_U8(s0 + 33); +//nop; +t6 = t5 << 24; +t7 = t6 >> 29; +if (v1 == t7) {//nop; +goto L40ec28;} +//nop; +L40ec54: +t8 = 0x10019398; +//nop; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L40ecbc;} +//nop; +if (s0 == 0) {//nop; +goto L40ed04;} +//nop; +v0 = MEM_U32(s1 + 44); +t9 = MEM_U32(s0 + 44); +//nop; +at = (int)t9 < (int)v0; +if (at == 0) {//nop; +goto L40ed04;} +//nop; +L40ec8c: +a2 = s0; +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 == 0) {//nop; +goto L40ed04;} +//nop; +t0 = MEM_U32(s0 + 44); +//nop; +at = (int)t0 < (int)v0; +if (at != 0) {//nop; +goto L40ec8c;} +//nop; +//nop; +goto L40ed04; +//nop; +L40ecbc: +if (s0 == 0) {//nop; +goto L40ed04;} +//nop; +v0 = MEM_U32(s1 + 44); +t1 = MEM_U32(s0 + 44); +//nop; +at = (int)v0 < (int)t1; +if (at == 0) {//nop; +goto L40ed04;} +//nop; +L40ecdc: +a2 = s0; +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 == 0) {//nop; +goto L40ed04;} +//nop; +t2 = MEM_U32(s0 + 44); +//nop; +at = (int)v0 < (int)t2; +if (at != 0) {//nop; +goto L40ecdc;} +//nop; +L40ed04: +if (s0 == 0) {v0 = s0 < 0x1; +goto L40ed34;} +v0 = s0 < 0x1; +t3 = MEM_U32(s0 + 44); +t4 = MEM_U32(s1 + 44); +//nop; +if (t3 != t4) {//nop; +goto L40ed34;} +//nop; +t5 = MEM_U32(s0 + 36); +t6 = MEM_U32(s1 + 36); +//nop; +if (t5 == t6) {//nop; +goto L40ed90;} +//nop; +L40ed34: +if (v0 != 0) {v1 = v0; +goto L40ed6c;} +v1 = v0; +t7 = MEM_U32(s0 + 44); +t8 = MEM_U32(s1 + 44); +//nop; +v1 = t7 ^ t8; +v1 = zero < v1; +if (v1 != 0) {//nop; +goto L40ed6c;} +//nop; +t9 = MEM_U32(s0 + 36); +t0 = MEM_U32(s1 + 36); +//nop; +v1 = t9 ^ t0; +v1 = zero < v1; +L40ed6c: +if (v1 != 0) {//nop; +goto L40ed78;} +//nop; +abort(); +L40ed78: +if (a2 != 0) {MEM_U32(s1 + 8) = s0; +goto L40ed8c;} +MEM_U32(s1 + 8) = s0; +t1 = MEM_U32(sp + 52); +MEM_U32(t1 + -5268) = s1; +goto L40ed90; +MEM_U32(t1 + -5268) = s1; +L40ed8c: +MEM_U32(a2 + 8) = s1; +L40ed90: +ra = MEM_U32(sp + 36); +L40ed94: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void func_40eda4(uint8_t *mem, uint32_t sp, uint32_t v0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40eda4: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +s0 = MEM_U32(v0 + -5272); +s1 = v0; +if (s0 == 0) {s2 = 0x8b; +goto L40ee48;} +s2 = 0x8b; +L40edd8: +//nop; +a0 = s0; +t9 = t9; +v0 = s1; +v0 = func_40e688(mem, sp, v0, a0); +goto L40edec; +v0 = s1; +L40edec: +gp = MEM_U32(sp + 32); +if (v0 == 0) {//nop; +goto L40ee38;} +//nop; +//nop; +a0 = s0 + 0x20; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L40ee08; +//nop; +L40ee08: +gp = MEM_U32(sp + 32); +MEM_U8(v0 + 32) = (uint8_t)s2; +MEM_U16(v0 + 34) = (uint16_t)zero; +t6 = MEM_U32(s0 + 48); +//nop; +a0 = v0; +MEM_U32(v0 + 48) = t6; +t9 = t9; +v0 = s1; +func_40eac0(mem, sp, v0, a0); +goto L40ee30; +v0 = s1; +L40ee30: +gp = MEM_U32(sp + 32); +//nop; +L40ee38: +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 != 0) {//nop; +goto L40edd8;} +//nop; +L40ee48: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_40ee60(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40ee60: +if (a0 == 0) {//nop; +goto L40ee90;} +//nop; +v1 = MEM_U32(v0 + -5368); +//nop; +t6 = v1 + 0x1; +L40ee74: +MEM_U32(v0 + -5368) = t6; +v1 = v1 + 0x1; +MEM_U32(a0 + 52) = v1; +a0 = MEM_U32(a0 + 8); +//nop; +if (a0 != 0) {t6 = v1 + 0x1; +goto L40ee74;} +t6 = v1 + 0x1; +L40ee90: +//nop; +return; +//nop; +} + +static void func_40ee98(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40ee98: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +s0 = a0; +s1 = v0; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s4; +MEM_U32(sp + 32) = s3; +MEM_U32(sp + 28) = s2; +if (a0 == 0) {v1 = zero; +goto L40ef28;} +v1 = zero; +s4 = 0x8f; +s3 = 0x6; +s2 = 0x27; +L40eee0: +t6 = MEM_U8(s0 + 32); +//nop; +if (s2 != t6) {//nop; +goto L40ef08;} +//nop; +//nop; +a0 = MEM_U32(s0 + 36); +a1 = s1 + 0xffffeb08; +f_set_mtag(mem, sp, a0, a1); +goto L40ef00; +a1 = s1 + 0xffffeb08; +L40ef00: +gp = MEM_U32(sp + 40); +MEM_U16(s0 + 34) = (uint16_t)s3; +L40ef08: +t7 = MEM_U32(s1 + -5368); +MEM_U8(s0 + 32) = (uint8_t)s4; +v1 = s0; +MEM_U32(s0 + 36) = t7; +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 != 0) {//nop; +goto L40eee0;} +//nop; +L40ef28: +s3 = 0x10018e64; +s4 = 0x8f; +t8 = MEM_U32(s3 + 0); +//nop; +if (t8 != 0) {ra = MEM_U32(sp + 44); +goto L40ef80;} +ra = MEM_U32(sp + 44); +s0 = MEM_U32(s1 + -5368); +//nop; +MEM_U32(sp + 48) = v1; +s2 = s0; +v0 = f_new_tree(mem, sp); +goto L40ef54; +s2 = s0; +L40ef54: +v1 = MEM_U32(sp + 48); +gp = MEM_U32(sp + 40); +t9 = 0x3; +MEM_U8(v0 + 32) = (uint8_t)s4; +MEM_U16(v0 + 34) = (uint16_t)t9; +MEM_U32(v0 + 36) = s2; +MEM_U32(s3 + 0) = s0; +t0 = s0 + 0x1; +MEM_U32(s1 + -5368) = t0; +MEM_U32(v1 + 8) = v0; +ra = MEM_U32(sp + 44); +L40ef80: +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +s3 = MEM_U32(sp + 32); +s4 = MEM_U32(sp + 36); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void func_40ef9c(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40ef9c: +//nop; +//nop; +//nop; +v1 = MEM_U32(v0 + -5272); +//nop; +if (v1 != 0) {//nop; +goto L40efc4;} +//nop; +MEM_U32(v0 + -5272) = a0; +MEM_U32(v0 + -5276) = a0; +return; +MEM_U32(v0 + -5276) = a0; +L40efc4: +a1 = MEM_U32(v1 + 44); +a2 = MEM_U32(a0 + 44); +//nop; +if (a1 == a2) {//nop; +goto L40f0b4;} +//nop; +a3 = 0x10019398; +at = (int)a2 < (int)a1; +a3 = MEM_U8(a3 + 0); +//nop; +if (a3 == 0) {//nop; +goto L40f008;} +//nop; +at = (int)a1 < (int)a2; +if (at == 0) {//nop; +goto L40f048;} +//nop; +MEM_U32(a0 + 8) = v1; +MEM_U32(v0 + -5272) = a0; +return; +MEM_U32(v0 + -5272) = a0; +L40f008: +if (at == 0) {//nop; +goto L40f01c;} +//nop; +MEM_U32(a0 + 8) = v1; +MEM_U32(v0 + -5272) = a0; +return; +MEM_U32(v0 + -5272) = a0; +L40f01c: +a1 = MEM_U32(v0 + -5276); +//nop; +t0 = MEM_U32(a1 + 44); +//nop; +if (t0 == a2) {at = (int)t0 < (int)a2; +goto L40f0b4;} +at = (int)t0 < (int)a2; +if (at == 0) {//nop; +goto L40f048;} +//nop; +MEM_U32(a1 + 8) = a0; +MEM_U32(v0 + -5276) = a0; +return; +MEM_U32(v0 + -5276) = a0; +L40f048: +a1 = MEM_U32(v1 + 8); +v0 = v1; +if (a1 == 0) {//nop; +goto L40f0b0;} +//nop; +L40f058: +v1 = MEM_U32(a1 + 44); +//nop; +if (v1 == a2) {//nop; +goto L40f0b4;} +//nop; +if (a3 == 0) {at = (int)v1 < (int)a2; +goto L40f084;} +at = (int)v1 < (int)a2; +if (at == 0) {//nop; +goto L40f09c;} +//nop; +MEM_U32(v0 + 8) = a0; +MEM_U32(a0 + 8) = a1; +return; +MEM_U32(a0 + 8) = a1; +L40f084: +at = (int)a2 < (int)v1; +if (at == 0) {//nop; +goto L40f09c;} +//nop; +MEM_U32(v0 + 8) = a0; +MEM_U32(a0 + 8) = a1; +return; +MEM_U32(a0 + 8) = a1; +L40f09c: +v0 = a1; +a1 = MEM_U32(a1 + 8); +//nop; +if (a1 != 0) {//nop; +goto L40f058;} +//nop; +L40f0b0: +MEM_U32(v0 + 8) = a0; +L40f0b4: +//nop; +return; +//nop; +} + +static void func_40f0bc(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40f0bc: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 36) = v0; +t6 = MEM_U8(a0 + 32); +t7 = 0x42; +a1 = a0; +if (t6 == t7) {//nop; +goto L40f0f0;} +//nop; +abort(); +L40f0f0: +//nop; +a0 = 0x60; +MEM_U32(sp + 40) = a1; +v0 = f_build_op(mem, sp, a0); +goto L40f100; +MEM_U32(sp + 40) = a1; +L40f100: +a1 = MEM_U32(sp + 40); +v1 = MEM_U32(sp + 36); +t8 = MEM_U32(a1 + 36); +gp = MEM_U32(sp + 24); +MEM_U32(v0 + 0) = a1; +MEM_U32(v0 + 36) = t8; +t9 = MEM_U32(v1 + -5288); +//nop; +MEM_U32(v0 + 8) = t9; +MEM_U32(v1 + -5288) = v0; +ra = MEM_U32(sp + 28); +sp = sp + 0x28; +//nop; +return; +//nop; +} + +static uint32_t func_40f138(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40f138: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a0; +s1 = v0; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +L40f160: +if (s0 != 0) {//nop; +goto L40f170;} +//nop; +v0 = zero; +goto L40f228; +v0 = zero; +L40f170: +t6 = MEM_U8(s0 + 32); +//nop; +t7 = t6 + 0xffffffe0; +t8 = t7 < 0x60; +if (t8 == 0) {//nop; +goto L40f1ac;} +//nop; +t1 = 0x100016dc; +t9 = (int)t7 >> 5; +t0 = t9 << 2; +t1 = t1; +t2 = t1 + t0; +t3 = MEM_U32(t2 + 0); +//nop; +t4 = t3 << (t7 & 0x1f); +t8 = (int)t4 < (int)0x0; +L40f1ac: +if (t8 == 0) {//nop; +goto L40f1d0;} +//nop; +t6 = MEM_U16(s0 + 34); +//nop; +t9 = t6 & 0x1; +if (t9 == 0) {//nop; +goto L40f1d0;} +//nop; +v0 = 0x1; +goto L40f228; +v0 = 0x1; +L40f1d0: +a0 = MEM_U32(s0 + 0); +//nop; +if (a0 == 0) {v0 = zero; +goto L40f228;} +v0 = zero; +//nop; +v0 = s1; +t9 = t9; +//nop; +v0 = func_40f138(mem, sp, a0); +goto L40f1f4; +//nop; +L40f1f4: +v1 = MEM_U32(s0 + 4); +gp = MEM_U32(sp + 32); +if (v1 == 0) {a0 = v0 & 0xff; +goto L40f21c;} +a0 = v0 & 0xff; +if (v0 != 0) {//nop; +goto L40f214;} +//nop; +s0 = v1; +goto L40f160; +s0 = v1; +L40f214: +v0 = a0; +goto L40f228; +v0 = a0; +L40f21c: +v0 = a0; +goto L40f228; +v0 = a0; +v0 = zero; +L40f228: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x28; +return v0; +sp = sp + 0x28; +} + +static void func_40f23c(uint8_t *mem, uint32_t sp, uint32_t v0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40f23c: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 60) = ra; +MEM_U32(sp + 56) = fp; +MEM_U32(sp + 52) = gp; +MEM_U32(sp + 48) = s7; +MEM_U32(sp + 44) = s6; +MEM_U32(sp + 40) = s5; +MEM_U32(sp + 36) = s4; +MEM_U32(sp + 32) = s3; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +t6 = MEM_U8(v0 + -5417); +s3 = v0; +if (t6 != 0) {ra = MEM_U32(sp + 60); +goto L40f3d4;} +ra = MEM_U32(sp + 60); +v0 = MEM_U32(v0 + -5272); +//nop; +if (v0 == 0) {s2 = v0; +goto L40f3d0;} +s2 = v0; +t7 = MEM_U32(v0 + 48); +at = 0xffffffff; +if (t7 == at) {fp = 0x7b; +goto L40f3d0;} +fp = 0x7b; +s6 = 0x10019358; +s7 = 0x52; +s5 = 0x1; +s4 = 0xffffff1f; +L40f2b8: +t8 = MEM_U16(s2 + 34); +//nop; +if (s5 == t8) {//nop; +goto L40f3b0;} +//nop; +v0 = MEM_U32(s3 + -5216); +s0 = s2 + 0x20; +if (v0 != 0) {//nop; +goto L40f300;} +//nop; +if (v0 != 0) {//nop; +goto L40f338;} +//nop; +t9 = MEM_U8(s6 + 0); +//nop; +if (t9 != 0) {//nop; +goto L40f338;} +//nop; +t0 = MEM_U8(s3 + -5325); +//nop; +if (t0 != 0) {//nop; +goto L40f338;} +//nop; +L40f300: +v0 = MEM_U32(s3 + -5268); +//nop; +if (v0 == 0) {//nop; +goto L40f338;} +//nop; +v1 = MEM_U32(s2 + 48); +//nop; +L40f318: +t1 = MEM_U32(v0 + 48); +//nop; +if (v1 == t1) {//nop; +goto L40f3b0;} +//nop; +v0 = MEM_U32(v0 + 8); +//nop; +if (v0 != 0) {//nop; +goto L40f318;} +//nop; +L40f338: +//nop; +s1 = MEM_U32(s3 + -5292); +a0 = s0; +v0 = f_build_u(mem, sp, a0); +goto L40f348; +a0 = s0; +L40f348: +gp = MEM_U32(sp + 52); +t2 = MEM_U8(v0 + 33); +MEM_U8(v0 + 32) = (uint8_t)s7; +t3 = t2 & s4; +t4 = t3 | 0x40; +MEM_U16(v0 + 34) = (uint16_t)zero; +MEM_U8(v0 + 33) = (uint8_t)t4; +MEM_U32(v0 + 48) = zero; +//nop; +a0 = s0; +a1 = v0; +v0 = f_build_u1(mem, sp, a0, a1); +goto L40f378; +a1 = v0; +L40f378: +t5 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 52); +t6 = t5 & s4; +t7 = t6 | 0x60; +MEM_U8(v0 + 32) = (uint8_t)fp; +MEM_U16(v0 + 34) = (uint16_t)zero; +MEM_U8(v0 + 33) = (uint8_t)t7; +t8 = MEM_U32(s2 + 48); +MEM_U32(v0 + 48) = zero; +MEM_U32(v0 + 44) = t8; +t9 = MEM_U32(s1 + 8); +//nop; +MEM_U32(v0 + 8) = t9; +MEM_U32(s1 + 8) = v0; +L40f3b0: +s2 = MEM_U32(s2 + 8); +//nop; +if (s2 == 0) {ra = MEM_U32(sp + 60); +goto L40f3d4;} +ra = MEM_U32(sp + 60); +t0 = MEM_U32(s2 + 48); +at = 0xffffffff; +if (t0 != at) {//nop; +goto L40f2b8;} +//nop; +L40f3d0: +ra = MEM_U32(sp + 60); +L40f3d4: +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +s3 = MEM_U32(sp + 32); +s4 = MEM_U32(sp + 36); +s5 = MEM_U32(sp + 40); +s6 = MEM_U32(sp + 44); +s7 = MEM_U32(sp + 48); +fp = MEM_U32(sp + 56); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static uint32_t f_build_tree(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L40f400: +//build_tree: +//nop; +//nop; +//nop; +sp = sp + 0xffffe9b0; +at = 0x100193b0; +v0 = 0x100193b0; +v1 = 0x100193b0; +MEM_U32(sp + 176) = s1; +MEM_U32(sp + 212) = ra; +MEM_U32(sp + 208) = fp; +MEM_U32(sp + 204) = gp; +MEM_U32(sp + 200) = s7; +MEM_U32(sp + 196) = s6; +MEM_U32(sp + 192) = s5; +MEM_U32(sp + 188) = s4; +MEM_U32(sp + 184) = s3; +MEM_U32(sp + 180) = s2; +MEM_U32(sp + 172) = s0; +MEM_U32(sp + 5712) = a0; +MEM_U32(sp + 296) = zero; +MEM_U32(sp + 300) = zero; +MEM_U32(sp + 304) = zero; +MEM_U32(sp + 308) = zero; +MEM_U32(sp + 312) = zero; +MEM_U32(sp + 316) = zero; +MEM_U32(sp + 320) = zero; +MEM_U32(sp + 324) = zero; +MEM_U32(sp + 328) = zero; +MEM_U32(sp + 332) = zero; +MEM_U32(sp + 336) = zero; +MEM_U32(sp + 340) = zero; +MEM_U32(sp + 456) = zero; +MEM_U32(sp + 460) = zero; +MEM_U32(sp + 464) = zero; +MEM_U32(sp + 472) = zero; +MEM_U32(sp + 476) = zero; +MEM_U32(sp + 480) = zero; +MEM_U32(sp + 484) = zero; +s1 = 0x1; +MEM_U32(sp + 468) = zero; +MEM_U32(at + 0) = zero; +v0 = v0 + 0x4; +v1 = v1 + 0x3f4; +L40f4ac: +v0 = v0 + 0x10; +MEM_U32(v0 + -16) = zero; +MEM_U32(v0 + -12) = zero; +MEM_U32(v0 + -8) = zero; +if (v0 != v1) {MEM_U32(v0 + -4) = zero; +goto L40f4ac;} +MEM_U32(v0 + -4) = zero; +//nop; +a0 = 0x400; +a1 = zero; +v0 = f_new(mem, sp, a0, a1); +goto L40f4d4; +a1 = zero; +L40f4d4: +gp = MEM_U32(sp + 204); +MEM_U32(sp + 452) = v0; +MEM_U32(sp + 500) = zero; +MEM_U16(sp + 5704) = (uint16_t)zero; +L40f4e4: +//nop; +a1 = MEM_U32(sp + 452); +a0 = sp + 0x1c8; +f_readuinstr(mem, sp, a0, a1, a2, a3); +goto L40f4f4; +a0 = sp + 0x1c8; +L40f4f4: +v0 = MEM_U8(sp + 456); +gp = MEM_U32(sp + 204); +at = v0 < 0x9a; +if (at == 0) {//nop; +goto L414178;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10007cf4[] = { +&&L412af0, +&&L41300c, +&&L412af0, +&&L40fb44, +&&L41300c, +&&L4117fc, +&&L40f58c, +&&L40f6fc, +&&L40f780, +&&L41300c, +&&L414178, +&&L414178, +&&L412af0, +&&L412af0, +&&L412af0, +&&L412888, +&&L413ef0, +&&L41058c, +&&L40f4e4, +&&L40f7f0, +&&L40f58c, +&&L40f4e4, +&&L40f4e4, +&&L411644, +&&L412a00, +&&L412af0, +&&L412c50, +&&L40ff34, +&&L41300c, +&&L41300c, +&&L412f60, +&&L40fb80, +&&L40f7b8, +&&L40fa1c, +&&L414068, +&&L41300c, +&&L40f58c, +&&L414178, +&&L4101c4, +&&L40f528, +&&L41300c, +&&L41300c, +&&L40f58c, +&&L40f58c, +&&L4116b4, +&&L413a30, +&&L41300c, +&&L41300c, +&&L41300c, +&&L410144, +&&L412af0, +&&L414178, +&&L41300c, +&&L41300c, +&&L412df0, +&&L412bb4, +&&L41300c, +&&L40f67c, +&&L41300c, +&&L41300c, +&&L41300c, +&&L412ce4, +&&L411c20, +&&L411d70, +&&L414178, +&&L41300c, +&&L41035c, +&&L40f4e4, +&&L413fa0, +&&L413f94, +&&L41239c, +&&L41241c, +&&L412770, +&&L41253c, +&&L410438, +&&L412770, +&&L40f4e4, +&&L41300c, +&&L41300c, +&&L40f4e4, +&&L412af0, +&&L40f7f0, +&&L412770, +&&L40f58c, +&&L40f4e4, +&&L41300c, +&&L41300c, +&&L41300c, +&&L411758, +&&L414178, +&&L411390, +&&L41300c, +&&L411358, +&&L41300c, +&&L412b34, +&&L41300c, +&&L40f4e4, +&&L412af0, +&&L412af0, +&&L40f924, +&&L411390, +&&L40feec, +&&L411390, +&&L413dec, +&&L40f7f0, +&&L41300c, +&&L41008c, +&&L41229c, +&&L4120f8, +&&L41204c, +&&L412af0, +&&L4115bc, +&&L411fa4, +&&L40f6dc, +&&L412af0, +&&L41300c, +&&L41300c, +&&L41300c, +&&L412af0, +&&L412af0, +&&L40f600, +&&L40f4e4, +&&L40f748, +&&L4117fc, +&&L4117fc, +&&L41300c, +&&L413d70, +&&L4101c4, +&&L4128f8, +&&L4128f8, +&&L4128f8, +&&L4128f8, +&&L4128f8, +&&L4128f8, +&&L412af0, +&&L40f4e4, +&&L4100e0, +&&L410054, +&&L41300c, +&&L410018, +&&L410b80, +&&L41300c, +&&L413edc, +&&L413fdc, +&&L414030, +&&L414178, +&&L414178, +&&L412f04, +&&L411edc, +&&L412714, +&&L40f5a8, +&&L411644, +&&L40f58c, +&&L40f58c, +}; +dest = Lswitch10007cf4[v0]; +//nop; +goto *dest; +//nop; +L40f528: +//nop; +a0 = sp + 0x1c8; +//nop; +f_gen_sym(mem, sp, a0); +goto L40f538; +//nop; +L40f538: +gp = MEM_U32(sp + 204); +//nop; +t7 = 0x100197a8; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L40f4e4;} +//nop; +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L40f568; +//nop; +L40f568: +gp = MEM_U32(sp + 204); +//nop; +v1 = 0x100016d8; +//nop; +t8 = MEM_U32(v1 + 0); +//nop; +MEM_U32(v0 + 8) = t8; +MEM_U32(v1 + 0) = v0; +goto L40f4e4; +MEM_U32(v1 + 0) = v0; +L40f58c: +//nop; +a0 = sp + 0x1c8; +//nop; +f_gen_sym(mem, sp, a0); +goto L40f59c; +//nop; +L40f59c: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L40f5a8: +//nop; +a0 = sp + 0x1c8; +//nop; +f_gen_sym(mem, sp, a0); +goto L40f5b8; +//nop; +L40f5b8: +gp = MEM_U32(sp + 204); +a0 = sp + 0x1c8; +//nop; +//nop; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L40f5d0; +//nop; +L40f5d0: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L40f5ec; +//nop; +L40f5ec: +gp = MEM_U32(sp + 204); +t9 = 0x1; +at = 0x10018ee8; +MEM_U8(at + 0) = (uint8_t)t9; +goto L40f4e4; +MEM_U8(at + 0) = (uint8_t)t9; +L40f600: +t2 = MEM_U32(sp + 472); +t1 = MEM_U32(sp + 452); +at = (int)t2 < (int)0x9; +if (at != 0) {MEM_U32(sp + 476) = t1; +goto L40f620;} +MEM_U32(sp + 476) = t1; +t3 = 0x8; +MEM_U32(sp + 472) = t3; +MEM_U8(t1 + 8) = (uint8_t)zero; +L40f620: +//nop; +a0 = 0x400; +a1 = zero; +v0 = f_new(mem, sp, a0, a1); +goto L40f630; +a1 = zero; +L40f630: +gp = MEM_U32(sp + 204); +MEM_U32(sp + 452) = v0; +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L40f648; +//nop; +L40f648: +gp = MEM_U32(sp + 204); +t4 = MEM_U8(v0 + 33); +//nop; +t5 = t4 & 0xffe0; +t6 = t5 | 0x9; +MEM_U8(v0 + 33) = (uint8_t)t6; +a0 = v0; +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L40f670; +v0 = sp + 0x1650; +L40f670: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L40f67c: +t7 = MEM_U8(sp + 457); +at = 0x4e0000; +t8 = t7 & 0x1f; +t9 = t8 < 0x20; +t2 = -t9; +at = at | 0x8000; +t3 = t2 & at; +t1 = t3 << (t8 & 0x1f); +if ((int)t1 >= 0) {a0 = 0x400; +goto L40f6c0;} +a0 = 0x400; +t4 = MEM_U32(sp + 452); +//nop; +a1 = zero; +MEM_U32(sp + 484) = t4; +v0 = f_new(mem, sp, a0, a1); +goto L40f6b8; +MEM_U32(sp + 484) = t4; +L40f6b8: +gp = MEM_U32(sp + 204); +MEM_U32(sp + 452) = v0; +L40f6c0: +//nop; +a0 = sp + 0x1c8; +//nop; +f_add_init(mem, sp, a0); +goto L40f6d0; +//nop; +L40f6d0: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L40f6dc: +//nop; +a0 = MEM_U32(sp + 460); +a1 = MEM_U32(sp + 464); +//nop; +f_set_size(mem, sp, a0, a1); +goto L40f6f0; +//nop; +L40f6f0: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L40f6fc: +t5 = MEM_U32(sp + 464); +at = 0x10018e8c; +t0 = MEM_U32(sp + 468); +MEM_U32(at + 0) = t5; +at = 0x10018e90; +//nop; +MEM_U32(at + 0) = t0; +at = 0x100193a0; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10019398; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001939c; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10019374; +MEM_U8(at + 0) = (uint8_t)zero; +goto L40f4e4; +MEM_U8(at + 0) = (uint8_t)zero; +L40f748: +a0 = 0x100016d8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +if (a0 == 0) {//nop; +goto L40f778;} +//nop; +//nop; +//nop; +//nop; +f_free_tree(mem, sp, a0); +goto L40f770; +//nop; +L40f770: +gp = MEM_U32(sp + 204); +//nop; +L40f778: +v0 = zero; +goto L4142d8; +v0 = zero; +L40f780: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L40f790; +//nop; +L40f790: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L40f7ac; +//nop; +L40f7ac: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L40f7b8: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L40f7c8; +//nop; +L40f7c8: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L40f7e4; +//nop; +L40f7e4: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L40f7f0: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L40f800; +//nop; +L40f800: +t6 = MEM_U32(sp + 500); +gp = MEM_U32(sp + 204); +if (t6 != 0) {s3 = v0; +goto L40f81c;} +s3 = v0; +MEM_U32(sp + 500) = v0; +MEM_U32(sp + 5708) = v0; +goto L40f838; +MEM_U32(sp + 5708) = v0; +L40f81c: +//nop; +a0 = s3; +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L40f830; +v0 = sp + 0x1650; +L40f830: +gp = MEM_U32(sp + 204); +//nop; +L40f838: +t7 = MEM_U8(sp + 456); +at = 0x51; +if (t7 != at) {t2 = MEM_U8(sp + 456); +goto L40f85c;} +t2 = MEM_U8(sp + 456); +t9 = MEM_U32(sp + 460); +at = 0x10018e00; +MEM_U32(at + 0) = t9; +goto L40f4e4; +MEM_U32(at + 0) = t9; +t2 = MEM_U8(sp + 456); +L40f85c: +at = 0x13; +if (t2 != at) {t7 = 0x1; +goto L40f908;} +t7 = 0x1; +t3 = MEM_U32(sp + 452); +t8 = MEM_U8(sp + 5715); +t1 = MEM_U32(sp + 500); +if (t8 == 0) {MEM_U32(sp + 476) = t3; +goto L40f4e4;} +MEM_U32(sp + 476) = t3; +v0 = MEM_U32(t1 + 12); +//nop; +if (v0 == 0) {//nop; +goto L40f4e4;} +//nop; +t4 = MEM_U8(v0 + 32); +at = 0x21; +if (t4 != at) {a1 = 0x20; +goto L40f4e4;} +a1 = 0x20; +s0 = MEM_U32(sp + 472); +at = 0x20; +v0 = t3 + s0; +t5 = MEM_U8(v0 + -1); +a2 = 0x1; +if (t5 != at) {a3 = 0xa; +goto L40f8cc;} +a3 = 0xa; +v1 = 0x20; +L40f8bc: +t6 = MEM_U8(v0 + -2); +s0 = s0 + 0xffffffff; +if (v1 == t6) {v0 = v0 + 0xffffffff; +goto L40f8bc;} +v0 = v0 + 0xffffffff; +L40f8cc: +s1 = 0x10006560; +//nop; +s1 = MEM_U32(s1 + 0); +a0 = s1; +f_write_char(mem, sp, a0, a1, a2); +goto L40f8e0; +a0 = s1; +L40f8e0: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(sp + 452); +//nop; +a0 = s1; +a2 = 0x400; +a3 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L40f8fc; +a3 = s0; +L40f8fc: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L40f908: +at = 0x10019358; +t9 = 0x1; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001935c; +MEM_U8(sp + 295) = (uint8_t)t9; +MEM_U8(at + 0) = (uint8_t)t7; +goto L40f4e4; +MEM_U8(at + 0) = (uint8_t)t7; +L40f924: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L40f934; +//nop; +L40f934: +t2 = MEM_U32(sp + 428); +gp = MEM_U32(sp + 204); +MEM_U32(v0 + 8) = t2; +t8 = MEM_U32(sp + 460); +at = 0x1; +if (t8 != at) {MEM_U32(sp + 428) = v0; +goto L40f95c;} +MEM_U32(sp + 428) = v0; +t1 = MEM_U32(sp + 464); +MEM_U32(sp + 380) = t1; +goto L40f4e4; +MEM_U32(sp + 380) = t1; +L40f95c: +v1 = MEM_U32(v0 + 36); +at = 0x4; +if (v1 != at) {t4 = 0x1; +goto L40f984;} +t4 = 0x1; +at = 0x10019398; +t3 = 0xfffffffc; +MEM_U8(at + 0) = (uint8_t)t4; +at = 0x100193a0; +MEM_U32(at + 0) = t3; +goto L40f4e4; +MEM_U32(at + 0) = t3; +L40f984: +at = 0x5; +if (v1 != at) {t5 = 0x1; +goto L40f99c;} +t5 = 0x1; +at = 0x1001939c; +MEM_U8(at + 0) = (uint8_t)t5; +goto L40f4e4; +MEM_U8(at + 0) = (uint8_t)t5; +L40f99c: +if (v1 != 0) {at = 0x7; +goto L40f9ec;} +at = 0x7; +t6 = MEM_U32(sp + 464); +at = 0x10018e98; +//nop; +MEM_U32(at + 0) = t6; +at = 0x4; +if (t6 != at) {//nop; +goto L40f4e4;} +//nop; +v0 = 0x10019364; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +if (v0 == 0) {at = v0 < 0x3; +goto L40f4e4;} +at = v0 < 0x3; +if (at == 0) {//nop; +goto L40f4e4;} +//nop; +at = 0x10019358; +MEM_U8(at + 0) = (uint8_t)zero; +goto L40f4e4; +MEM_U8(at + 0) = (uint8_t)zero; +L40f9ec: +if (v1 != at) {t7 = 0x1; +goto L40fa00;} +t7 = 0x1; +at = 0x10019374; +MEM_U8(at + 0) = (uint8_t)t7; +goto L40f4e4; +MEM_U8(at + 0) = (uint8_t)t7; +L40fa00: +at = 0x2; +if (v1 != at) {//nop; +goto L40f4e4;} +//nop; +t9 = MEM_U32(v0 + 40); +at = 0x10018ec8; +MEM_U32(at + 0) = t9; +goto L40f4e4; +MEM_U32(at + 0) = t9; +L40fa1c: +t2 = MEM_U16(sp + 5704); +a0 = sp + 0x1c8; +if (t2 == 0) {//nop; +goto L40fa30;} +//nop; +abort(); +L40fa30: +//nop; +t8 = 0xffffffff; +MEM_U32(sp + 380) = t8; +MEM_U32(sp + 496) = zero; +MEM_U32(sp + 492) = zero; +MEM_U32(sp + 392) = zero; +MEM_U32(sp + 388) = zero; +MEM_U8(sp + 295) = (uint8_t)zero; +MEM_U32(sp + 444) = zero; +MEM_U32(sp + 432) = zero; +MEM_U32(sp + 440) = zero; +MEM_U32(sp + 428) = zero; +MEM_U32(sp + 424) = zero; +MEM_U8(sp + 386) = (uint8_t)zero; +MEM_U8(sp + 379) = (uint8_t)zero; +MEM_U8(sp + 358) = (uint8_t)zero; +MEM_U8(sp + 357) = (uint8_t)zero; +MEM_U8(sp + 387) = (uint8_t)zero; +MEM_U8(sp + 351) = (uint8_t)zero; +v0 = f_build_u(mem, sp, a0); +goto L40fa80; +MEM_U8(sp + 351) = (uint8_t)zero; +L40fa80: +t1 = MEM_U32(sp + 500); +gp = MEM_U32(sp + 204); +if (t1 != 0) {MEM_U32(sp + 448) = v0; +goto L40fab0;} +MEM_U32(sp + 448) = v0; +MEM_U32(sp + 5708) = v0; +MEM_U32(sp + 500) = v0; +MEM_U32(sp + 344) = zero; +MEM_U8(sp + 296) = (uint8_t)zero; +MEM_U8(sp + 308) = (uint8_t)zero; +MEM_U8(sp + 320) = (uint8_t)zero; +MEM_U8(sp + 332) = (uint8_t)zero; +goto L40fadc; +MEM_U8(sp + 332) = (uint8_t)zero; +L40fab0: +//nop; +a0 = MEM_U32(sp + 448); +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L40fac4; +v0 = sp + 0x1650; +L40fac4: +gp = MEM_U32(sp + 204); +MEM_U32(sp + 344) = zero; +MEM_U8(sp + 296) = (uint8_t)zero; +MEM_U8(sp + 308) = (uint8_t)zero; +MEM_U8(sp + 320) = (uint8_t)zero; +MEM_U8(sp + 332) = (uint8_t)zero; +L40fadc: +//nop; +a0 = 0x42; +//nop; +v0 = f_build_op(mem, sp, a0); +goto L40faec; +//nop; +L40faec: +gp = MEM_U32(sp + 204); +MEM_U32(sp + 420) = v0; +at = 0x10018ea8; +MEM_U16(v0 + 34) = (uint16_t)zero; +MEM_U32(v0 + 40) = zero; +t4 = 0x1; +MEM_U8(at + 0) = (uint8_t)t4; +at = 0x10018ee8; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10018e9c; +a0 = sp + 0x1c8; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10018ea0; +MEM_U8(at + 0) = (uint8_t)zero; +f_gen_sym(mem, sp, a0); +goto L40fb2c; +MEM_U8(at + 0) = (uint8_t)zero; +L40fb2c: +t0 = MEM_U32(sp + 468); +gp = MEM_U32(sp + 204); +t3 = t0 & 0x4; +t5 = zero < t3; +MEM_U8(sp + 359) = (uint8_t)t5; +goto L40f4e4; +MEM_U8(sp + 359) = (uint8_t)t5; +L40fb44: +//nop; +t6 = 0x1; +MEM_U8(sp + 386) = (uint8_t)t6; +a0 = sp + 0x1c8; +v0 = f_build_u(mem, sp, a0); +goto L40fb58; +a0 = sp + 0x1c8; +L40fb58: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L40fb74; +//nop; +L40fb74: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L40fb80: +//nop; +a0 = MEM_U32(sp + 420); +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L40fb94; +v0 = sp + 0x1650; +L40fb94: +gp = MEM_U32(sp + 204); +a0 = sp + 0x1c8; +//nop; +//nop; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L40fbac; +//nop; +L40fbac: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L40fbc8; +//nop; +L40fbc8: +t7 = MEM_U32(sp + 496); +gp = MEM_U32(sp + 204); +if (t7 == 0) {t1 = MEM_U8(sp + 295); +goto L40fc68;} +t1 = MEM_U8(sp + 295); +//nop; +a0 = 0x1b; +//nop; +v0 = f_build_op(mem, sp, a0); +goto L40fbe8; +//nop; +L40fbe8: +t9 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 204); +t2 = t9 & 0xff1f; +t8 = t2 | 0xc0; +t1 = 0x10019314; +t5 = 0x10019310; +MEM_U8(v0 + 33) = (uint8_t)t8; +t4 = MEM_U32(t1 + 0); +t5 = MEM_U32(t5 + 0); +t3 = t4 << 3; +t6 = t5 << 2; +at = (int)t6 < (int)t3; +t7 = MEM_U32(sp + 492); +if (at == 0) {t2 = 0x1; +goto L40fc28;} +t2 = 0x1; +t6 = t3; +L40fc28: +at = (int)t7 < (int)t6; +if (at == 0) {//nop; +goto L40fc38;} +//nop; +t7 = t6; +L40fc38: +MEM_U32(v0 + 40) = t7; +MEM_U32(v0 + 36) = zero; +t9 = MEM_U8(sp + 386); +//nop; +if (t9 == 0) {t8 = MEM_U32(sp + 432); +goto L40fc58;} +t8 = MEM_U32(sp + 432); +MEM_U32(v0 + 36) = t2; +t8 = MEM_U32(sp + 432); +L40fc58: +//nop; +MEM_U32(v0 + 8) = t8; +MEM_U32(sp + 432) = v0; +t1 = MEM_U8(sp + 295); +L40fc68: +//nop; +if (t1 != 0) {t5 = MEM_U32(sp + 440); +goto L40fc90;} +t5 = MEM_U32(sp + 440); +at = 0x10019358; +t4 = 0x1; +MEM_U8(at + 0) = (uint8_t)t4; +at = 0x1001935c; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +t5 = MEM_U32(sp + 440); +L40fc90: +//nop; +if (t5 == 0) {t3 = MEM_U32(sp + 444); +goto L40fd80;} +t3 = MEM_U32(sp + 444); +//nop; +a1 = MEM_U32(sp + 380); +a0 = t5; +f_map_pdefs_to_regs(mem, sp, a0, a1); +goto L40fcac; +a0 = t5; +L40fcac: +gp = MEM_U32(sp + 204); +t6 = MEM_U8(sp + 386); +t3 = 0x10019358; +//nop; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 == 0) {t5 = MEM_U8(sp + 379); +goto L40fd54;} +t5 = MEM_U8(sp + 379); +if (t6 != 0) {//nop; +goto L40fd04;} +//nop; +t7 = MEM_U32(sp + 496); +t9 = MEM_U32(sp + 380); +if (t7 != 0) {at = 0xffffffff; +goto L40fcec;} +at = 0xffffffff; +if (t9 != at) {//nop; +goto L40fd04;} +//nop; +L40fcec: +t2 = 0x10018ea8; +//nop; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == 0) {t5 = MEM_U8(sp + 379); +goto L40fd54;} +t5 = MEM_U8(sp + 379); +L40fd04: +t8 = 0x10018e98; +at = 0x4; +t8 = MEM_U32(t8 + 0); +t1 = MEM_U8(sp + 359); +if (t8 != at) {t4 = MEM_U8(sp + 357); +goto L40fd28;} +t4 = MEM_U8(sp + 357); +if (t1 != 0) {t5 = MEM_U8(sp + 379); +goto L40fd54;} +t5 = MEM_U8(sp + 379); +t4 = MEM_U8(sp + 357); +L40fd28: +//nop; +if (t4 != 0) {t5 = MEM_U8(sp + 379); +goto L40fd54;} +t5 = MEM_U8(sp + 379); +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40eda4(mem, sp, v0); +goto L40fd48; +//nop; +L40fd48: +gp = MEM_U32(sp + 204); +//nop; +t5 = MEM_U8(sp + 379); +L40fd54: +//nop; +if (t5 == 0) {t3 = MEM_U32(sp + 444); +goto L40fd80;} +t3 = MEM_U32(sp + 444); +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40f23c(mem, sp, v0); +goto L40fd74; +//nop; +L40fd74: +gp = MEM_U32(sp + 204); +//nop; +t3 = MEM_U32(sp + 444); +L40fd80: +//nop; +if (t3 == 0) {//nop; +goto L40fde0;} +//nop; +t6 = 0x100197a8; +//nop; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L40fdc0;} +//nop; +//nop; +a0 = t3; +t9 = t9; +v0 = sp + 0x1650; +func_40ee60(mem, sp, v0, a0); +goto L40fdb8; +v0 = sp + 0x1650; +L40fdb8: +gp = MEM_U32(sp + 204); +//nop; +L40fdc0: +//nop; +a0 = MEM_U32(sp + 448); +a1 = MEM_U32(sp + 444); +t9 = t9; +v0 = sp + 0x1650; +func_40e048(mem, sp, a0, a1); +goto L40fdd8; +v0 = sp + 0x1650; +L40fdd8: +gp = MEM_U32(sp + 204); +//nop; +L40fde0: +a0 = 0x100016d8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +if (a0 == 0) {t7 = MEM_U32(sp + 432); +goto L40fe44;} +t7 = MEM_U32(sp + 432); +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40ee98(mem, sp, v0, a0); +goto L40fe0c; +//nop; +L40fe0c: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(sp + 448); +a1 = 0x100016d8; +//nop; +a1 = MEM_U32(a1 + 0); +t9 = t9; +v0 = sp + 0x1650; +func_40e048(mem, sp, a0, a1); +goto L40fe2c; +v0 = sp + 0x1650; +L40fe2c: +gp = MEM_U32(sp + 204); +//nop; +at = 0x100016d8; +//nop; +MEM_U32(at + 0) = zero; +t7 = MEM_U32(sp + 432); +L40fe44: +a0 = MEM_U32(sp + 448); +if (t7 == 0) {t9 = MEM_U32(sp + 428); +goto L40fe70;} +t9 = MEM_U32(sp + 428); +//nop; +a1 = t7; +t9 = t9; +v0 = sp + 0x1650; +func_40e048(mem, sp, a0, a1); +goto L40fe64; +v0 = sp + 0x1650; +L40fe64: +gp = MEM_U32(sp + 204); +//nop; +t9 = MEM_U32(sp + 428); +L40fe70: +//nop; +if (t9 == 0) {a1 = t9; +goto L40fe98;} +a1 = t9; +//nop; +a0 = MEM_U32(sp + 448); +t9 = t9; +v0 = sp + 0x1650; +func_40e048(mem, sp, a0, a1); +goto L40fe90; +v0 = sp + 0x1650; +L40fe90: +gp = MEM_U32(sp + 204); +//nop; +L40fe98: +t2 = MEM_U32(sp + 424); +s2 = MEM_U32(sp + 448); +if (t2 == 0) {v0 = MEM_U32(sp + 5708); +goto L40fee4;} +v0 = MEM_U32(sp + 5708); +t1 = MEM_U32(sp + 420); +v0 = 0x31; +if (s2 == t1) {//nop; +goto L40fee0;} +//nop; +L40feb8: +t4 = MEM_U8(s2 + 32); +t5 = MEM_U32(sp + 424); +if (v0 != t4) {//nop; +goto L40fecc;} +//nop; +MEM_U32(s2 + 4) = t5; +L40fecc: +s2 = MEM_U32(s2 + 8); +t6 = MEM_U32(sp + 420); +//nop; +if (s2 != t6) {//nop; +goto L40feb8;} +//nop; +L40fee0: +v0 = MEM_U32(sp + 5708); +L40fee4: +ra = MEM_U32(sp + 212); +goto L4142dc; +ra = MEM_U32(sp + 212); +L40feec: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L40fefc; +//nop; +L40fefc: +gp = MEM_U32(sp + 204); +s3 = v0; +//nop; +a0 = v0; +t9 = t9; +v0 = sp + 0x1650; +func_40ef9c(mem, sp, v0, a0); +goto L40ff18; +v0 = sp + 0x1650; +L40ff18: +t3 = MEM_U16(s3 + 34); +gp = MEM_U32(sp + 204); +at = 0x1; +if (t3 == at) {t7 = 0x1; +goto L40f4e4;} +t7 = 0x1; +MEM_U8(sp + 379) = (uint8_t)t7; +goto L40f4e4; +MEM_U8(sp + 379) = (uint8_t)t7; +L40ff34: +t9 = 0x10019398; +v1 = MEM_U8(sp + 457); +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L40ff94;} +//nop; +v1 = MEM_U8(sp + 457); +//nop; +t2 = v1 << 24; +t8 = t2 >> 29; +t1 = t8 ^ 0x1; +t1 = zero < t1; +if (t1 != 0) {v1 = t1; +goto L40ff80;} +v1 = t1; +t4 = MEM_U32(sp + 464); +t5 = MEM_U32(sp + 388); +//nop; +v1 = (int)t4 < (int)t5; +v1 = v1 ^ 0x1; +L40ff80: +if (v1 != 0) {//nop; +goto L40ff8c;} +//nop; +abort(); +L40ff8c: +//nop; +goto L40ffcc; +//nop; +L40ff94: +t6 = v1 << 24; +t3 = t6 >> 29; +t7 = t3 ^ 0x1; +t7 = zero < t7; +if (t7 != 0) {v1 = t7; +goto L40ffc0;} +v1 = t7; +t2 = MEM_U32(sp + 392); +t9 = MEM_U32(sp + 464); +t8 = -t2; +v1 = (int)t9 < (int)t8; +v1 = v1 ^ 0x1; +L40ffc0: +if (v1 != 0) {//nop; +goto L40ffcc;} +//nop; +abort(); +L40ffcc: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L40ffdc; +//nop; +L40ffdc: +t1 = MEM_U8(sp + 457); +gp = MEM_U32(sp + 204); +t4 = t1 << 24; +t5 = t4 >> 29; +at = 0x2; +if (t5 != at) {t3 = MEM_U32(sp + 432); +goto L410008;} +t3 = MEM_U32(sp + 432); +t6 = MEM_U32(sp + 440); +//nop; +MEM_U32(v0 + 0) = t6; +t3 = MEM_U32(sp + 432); +L410008: +//nop; +MEM_U32(v0 + 8) = t3; +MEM_U32(sp + 432) = v0; +goto L40f4e4; +MEM_U32(sp + 432) = v0; +L410018: +//nop; +t7 = 0xffffffff; +MEM_U32(sp + 472) = t7; +a0 = sp + 0x1c8; +v0 = f_build_u(mem, sp, a0); +goto L41002c; +a0 = sp + 0x1c8; +L41002c: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40eac0(mem, sp, v0, a0); +goto L410048; +//nop; +L410048: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L410054: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L410064; +//nop; +L410064: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L410080; +//nop; +L410080: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L41008c: +t2 = MEM_U16(sp + 5704); +//nop; +if (t2 == 0) {//nop; +goto L4100a0;} +//nop; +abort(); +L4100a0: +//nop; +a0 = 0x88; +//nop; +v0 = f_build_op(mem, sp, a0); +goto L4100b0; +//nop; +L4100b0: +gp = MEM_U32(sp + 204); +t9 = MEM_U32(sp + 420); +a0 = v0; +MEM_U32(v0 + 4) = t9; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L4100d4; +//nop; +L4100d4: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L4100e0: +t8 = MEM_U16(sp + 5704); +//nop; +if (t8 == 0) {//nop; +goto L4100f4;} +//nop; +abort(); +L4100f4: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L410104; +//nop; +L410104: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(sp + 460); +//nop; +s3 = v0; +//nop; +v0 = f_find_label(mem, sp, a0); +goto L41011c; +//nop; +L41011c: +gp = MEM_U32(sp + 204); +MEM_U32(s3 + 4) = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +a0 = s3; +func_40dff0(mem, sp, v0, a0); +goto L410138; +a0 = s3; +L410138: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L410144: +a0 = MEM_U16(sp + 5704); +//nop; +t5 = sp + 0x1004; +t4 = a0 << 2; +a3 = a0 + 0xffffffff; +t9 = t9; +MEM_U32(sp + 244) = a3; +s7 = t4 + t5; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L41016c; +v0 = sp + 0x1650; +L41016c: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s7 + 0); +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u1(mem, sp, a0, a1); +goto L410184; +//nop; +L410184: +a3 = MEM_U32(sp + 244); +gp = MEM_U32(sp + 204); +v1 = a3 & 0xffff; +a3 = a3 + 0xffffffff; +if (v1 == 0) {//nop; +goto L4101a0;} +//nop; +abort(); +L4101a0: +//nop; +a0 = v0; +t9 = t9; +v0 = sp + 0x1650; +MEM_U16(sp + 5704) = (uint16_t)v1; +func_40dff0(mem, sp, v0, a0); +goto L4101b8; +MEM_U16(sp + 5704) = (uint16_t)v1; +L4101b8: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L4101c4: +a0 = MEM_U16(sp + 5704); +//nop; +t7 = sp + 0x1004; +t3 = a0 << 2; +a3 = a0 + 0xffffffff; +t9 = t9; +MEM_U32(sp + 244) = a3; +s7 = t3 + t7; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L4101ec; +v0 = sp + 0x1650; +L4101ec: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(sp + 460); +//nop; +//nop; +//nop; +v0 = f_find_label(mem, sp, a0); +goto L410204; +//nop; +L410204: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s7 + 0); +//nop; +a0 = sp + 0x1c8; +a2 = v0; +v0 = f_build_u2(mem, sp, a0, a1, a2); +goto L41021c; +a2 = v0; +L41021c: +a3 = MEM_U32(sp + 244); +gp = MEM_U32(sp + 204); +v1 = a3 & 0xffff; +s3 = v0; +a3 = a3 + 0xffffffff; +if (v1 == 0) {//nop; +goto L41023c;} +//nop; +abort(); +L41023c: +//nop; +a0 = MEM_U32(v0 + 0); +MEM_U16(sp + 5704) = (uint16_t)v1; +v0 = f_is_constant(mem, sp, a0); +goto L41024c; +MEM_U16(sp + 5704) = (uint16_t)v1; +L41024c: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L4102ac;} +//nop; +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_is_zero(mem, sp, a0); +goto L410268; +//nop; +L410268: +t2 = MEM_U8(sp + 456); +gp = MEM_U32(sp + 204); +t9 = t2 ^ 0x7f; +t9 = t9 < 0x1; +t8 = v0 < 0x1; +if (t9 == t8) {t4 = 0x88; +goto L4102a0;} +t4 = 0x88; +//nop; +a0 = s3; +//nop; +f_free_tree(mem, sp, a0); +goto L410294; +//nop; +L410294: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L4102a0: +MEM_U8(s3 + 32) = (uint8_t)t4; +MEM_U32(s3 + 0) = zero; +goto L41033c; +MEM_U32(s3 + 0) = zero; +L4102ac: +v0 = MEM_U32(s3 + 0); +at = 0x50; +t5 = MEM_U8(v0 + 32); +//nop; +if (t5 != at) {//nop; +goto L41033c;} +//nop; +//nop; +a0 = MEM_U32(v0 + 0); +s0 = v0; +v0 = f_dup_tree(mem, sp, a0); +goto L4102d4; +s0 = v0; +L4102d4: +t1 = MEM_U8(s3 + 32); +gp = MEM_U32(sp + 204); +at = 0x7f; +if (t1 != at) {MEM_U32(s3 + 0) = v0; +goto L4102f4;} +MEM_U32(s3 + 0) = v0; +t3 = 0x26; +MEM_U8(s3 + 32) = (uint8_t)t3; +goto L4102fc; +MEM_U8(s3 + 32) = (uint8_t)t3; +L4102f4: +t7 = 0x7f; +MEM_U8(s3 + 32) = (uint8_t)t7; +L4102fc: +v0 = MEM_U16(s3 + 34); +at = 0x1; +if (v0 == 0) {//nop; +goto L410324;} +//nop; +if (v0 != at) {t2 = 0x1; +goto L410320;} +t2 = 0x1; +t6 = 0x2; +MEM_U16(s3 + 34) = (uint16_t)t6; +goto L410324; +MEM_U16(s3 + 34) = (uint16_t)t6; +L410320: +MEM_U16(s3 + 34) = (uint16_t)t2; +L410324: +//nop; +a0 = s0; +//nop; +f_free_tree(mem, sp, a0); +goto L410334; +//nop; +L410334: +gp = MEM_U32(sp + 204); +//nop; +L41033c: +//nop; +a0 = s3; +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L410350; +v0 = sp + 0x1650; +L410350: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L41035c: +t9 = MEM_U16(sp + 5704); +//nop; +if (t9 == 0) {//nop; +goto L410370;} +//nop; +abort(); +L410370: +//nop; +a0 = MEM_U32(sp + 460); +//nop; +v0 = f_find_label(mem, sp, a0); +goto L410380; +//nop; +L410380: +t8 = sp + 0x1c8; +at = MEM_U32(t8 + 0); +gp = MEM_U32(sp + 204); +MEM_U32(v0 + 32) = at; +t5 = MEM_U32(t8 + 4); +//nop; +MEM_U32(v0 + 36) = t5; +at = MEM_U32(t8 + 8); +s3 = v0; +MEM_U32(v0 + 40) = at; +t5 = MEM_U32(t8 + 12); +a0 = v0; +MEM_U32(v0 + 44) = t5; +at = MEM_U32(t8 + 16); +t9 = t9; +MEM_U32(v0 + 48) = at; +t5 = MEM_U32(t8 + 20); +//nop; +MEM_U32(v0 + 52) = t5; +at = MEM_U32(t8 + 24); +//nop; +MEM_U32(v0 + 56) = at; +t5 = MEM_U32(t8 + 28); +MEM_U32(v0 + 48) = zero; +MEM_U32(v0 + 60) = t5; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L4103ec; +v0 = sp + 0x1650; +L4103ec: +t1 = MEM_U16(sp + 458); +gp = MEM_U32(sp + 204); +t3 = t1 & 0x8; +if (t3 == 0) {t7 = MEM_U16(sp + 458); +goto L410420;} +t7 = MEM_U16(sp + 458); +//nop; +a0 = s3; +t9 = t9; +v0 = sp + 0x1650; +func_40f0bc(mem, sp, v0, a0); +goto L410414; +v0 = sp + 0x1650; +L410414: +gp = MEM_U32(sp + 204); +//nop; +t7 = MEM_U16(sp + 458); +L410420: +t2 = 0x1; +t6 = t7 & 0x2; +if (t6 == 0) {//nop; +goto L40f4e4;} +//nop; +MEM_U8(sp + 358) = (uint8_t)t2; +goto L40f4e4; +MEM_U8(sp + 358) = (uint8_t)t2; +L410438: +t9 = MEM_U16(sp + 5704); +//nop; +if (t9 == 0) {//nop; +goto L41044c;} +//nop; +abort(); +L41044c: +//nop; +a0 = MEM_U32(sp + 460); +//nop; +v0 = f_search_label(mem, sp, a0); +goto L41045c; +//nop; +L41045c: +gp = MEM_U32(sp + 204); +if (v0 != 0) {a0 = 0x4; +goto L410574;} +a0 = 0x4; +t4 = 0x10007c78; +a1 = 0x581; +t4 = t4; +t5 = t4 + 0x48; +t1 = sp; +L41047c: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t1 = t1 + 0xc; +MEM_U8(t1 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t1) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t1 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 4 + 3) = (uint8_t)(at >> 0); +if (t4 != t5) {//swr $at, 7($t1) +goto L41047c;} +//swr $at, 7($t1) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t3 = 0x10007c28; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +t5 = t4 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t4) +t3 = t3; +MEM_U8(t1 + 12 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t1 + 12 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t1 + 12 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t1 + 12 + 3) = (uint8_t)(t5 >> 0); +t6 = t3 + 0x48; +t2 = sp; +//swr $t5, 0xf($t1) +L4104ec: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t2 = t2 + 0xc; +MEM_U8(t2 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t2) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t2 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 84 + 3) = (uint8_t)(at >> 0); +if (t3 != t6) {//swr $at, 0x57($t2) +goto L4104ec;} +//swr $at, 0x57($t2) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +//nop; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +t6 = t3 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t3) +//nop; +MEM_U8(t2 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t2 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t2 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t2 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t2) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L410568; +//nop; +L410568: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L410574: +t9 = MEM_U16(sp + 458); +//nop; +MEM_U16(v0 + 34) = (uint16_t)t9; +t8 = MEM_U32(sp + 464); +MEM_U32(v0 + 40) = t8; +goto L40f4e4; +MEM_U32(v0 + 40) = t8; +L41058c: +t5 = MEM_U16(sp + 5704); +a0 = MEM_U32(sp + 460); +if (t5 == 0) {//nop; +goto L4105a0;} +//nop; +abort(); +L4105a0: +//nop; +s5 = 0xffffffff; +s4 = 0xffffffff; +v0 = f_find_label(mem, sp, a0); +goto L4105b0; +s4 = 0xffffffff; +L4105b0: +t4 = sp + 0x1c8; +at = MEM_U32(t4 + 0); +gp = MEM_U32(sp + 204); +MEM_U32(v0 + 32) = at; +t7 = MEM_U32(t4 + 4); +//nop; +MEM_U32(v0 + 36) = t7; +at = MEM_U32(t4 + 8); +t6 = 0x1; +MEM_U32(v0 + 40) = at; +t7 = MEM_U32(t4 + 12); +s3 = v0; +MEM_U32(v0 + 44) = t7; +at = MEM_U32(t4 + 16); +a0 = v0; +MEM_U32(v0 + 48) = at; +t7 = MEM_U32(t4 + 20); +t9 = t9; +MEM_U32(v0 + 52) = t7; +at = MEM_U32(t4 + 24); +//nop; +MEM_U32(v0 + 56) = at; +t7 = MEM_U32(t4 + 28); +MEM_U32(v0 + 44) = zero; +MEM_U32(v0 + 48) = t6; +MEM_U32(v0 + 60) = t7; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L410620; +v0 = sp + 0x1650; +L410620: +t3 = MEM_U32(sp + 500); +gp = MEM_U32(sp + 204); +if (t3 == 0) {s2 = t3; +goto L410688;} +s2 = t3; +t2 = MEM_U8(t3 + 32); +at = 0x8c; +if (t2 != at) {//nop; +goto L410654;} +//nop; +t9 = MEM_U32(s3 + 36); +t8 = MEM_U32(t3 + 36); +//nop; +if (t9 == t8) {//nop; +goto L410688;} +//nop; +L410654: +s2 = MEM_U32(s2 + 12); +//nop; +if (s2 == 0) {//nop; +goto L410688;} +//nop; +t5 = MEM_U8(s2 + 32); +at = 0x8c; +if (t5 != at) {//nop; +goto L410654;} +//nop; +t1 = MEM_U32(s3 + 36); +t4 = MEM_U32(s2 + 36); +//nop; +if (t1 != t4) {//nop; +goto L410654;} +//nop; +L410688: +if (s2 == 0) {s3 = MEM_U32(sp + 464); +goto L410954;} +s3 = MEM_U32(sp + 464); +v0 = MEM_U32(s2 + 0); +at = 0x4; +t7 = MEM_U8(v0 + 32); +//nop; +if (t7 != at) {//nop; +goto L410770;} +//nop; +v1 = MEM_U32(v0 + 4); +at = 0x49; +t6 = MEM_U8(v1 + 32); +//nop; +if (t6 != at) {//nop; +goto L41070c;} +//nop; +t2 = MEM_U8(v1 + 33); +at = 0x5010000; +t3 = t2 & 0x1f; +t9 = t3 < 0x20; +t8 = -t9; +t5 = t8 & at; +t1 = t5 << (t3 & 0x1f); +if ((int)t1 >= 0) {//nop; +goto L4106f4;} +//nop; +s5 = MEM_U32(v1 + 48); +s4 = MEM_U32(v1 + 52); +s3 = MEM_U32(sp + 464); +goto L410954; +s3 = MEM_U32(sp + 464); +L4106f4: +s4 = MEM_U32(v1 + 48); +//nop; +if ((int)s4 < 0) {s3 = MEM_U32(sp + 464); +goto L410954;} +s3 = MEM_U32(sp + 464); +s5 = zero; +goto L410950; +s5 = zero; +L41070c: +v1 = MEM_U32(v0 + 0); +at = 0x49; +t4 = MEM_U8(v1 + 32); +//nop; +if (t4 != at) {s3 = MEM_U32(sp + 464); +goto L410954;} +s3 = MEM_U32(sp + 464); +t7 = MEM_U8(v1 + 33); +at = 0x5010000; +t6 = t7 & 0x1f; +t2 = t6 < 0x20; +t9 = -t2; +t8 = t9 & at; +t5 = t8 << (t6 & 0x1f); +if ((int)t5 >= 0) {//nop; +goto L410758;} +//nop; +s5 = MEM_U32(v1 + 48); +s4 = MEM_U32(v1 + 52); +s3 = MEM_U32(sp + 464); +goto L410954; +s3 = MEM_U32(sp + 464); +L410758: +s4 = MEM_U32(v1 + 48); +//nop; +if ((int)s4 < 0) {s3 = MEM_U32(sp + 464); +goto L410954;} +s3 = MEM_U32(sp + 464); +s5 = zero; +goto L410950; +s5 = zero; +L410770: +v0 = MEM_U32(s2 + 12); +at = 0x26; +t3 = MEM_U8(v0 + 32); +//nop; +if (t3 != at) {s3 = MEM_U32(sp + 464); +goto L410954;} +s3 = MEM_U32(sp + 464); +a0 = MEM_U32(v0 + 12); +at = 0x7b; +t1 = MEM_U8(a0 + 32); +//nop; +if (t1 != at) {s3 = MEM_U32(sp + 464); +goto L410954;} +s3 = MEM_U32(sp + 464); +t4 = MEM_U32(a0 + 0); +at = 0x4; +t7 = MEM_U8(t4 + 32); +//nop; +if (t7 != at) {s3 = MEM_U32(sp + 464); +goto L410954;} +s3 = MEM_U32(sp + 464); +t2 = MEM_U32(v0 + 0); +at = 0x52; +v1 = MEM_U32(t2 + 0); +//nop; +t9 = MEM_U8(v1 + 32); +//nop; +if (t9 != at) {//nop; +goto L4107e0;} +//nop; +s3 = v1; +goto L4107e8; +s3 = v1; +L4107e0: +s3 = MEM_U32(v1 + 0); +//nop; +L4107e8: +t8 = MEM_U8(a0 + 33); +t3 = MEM_U8(s3 + 33); +t6 = t8 << 24; +t1 = t3 << 24; +t4 = t1 >> 29; +t5 = t6 >> 29; +if (t5 != t4) {s0 = a0; +goto L410950;} +s0 = a0; +t7 = MEM_U32(a0 + 36); +t2 = MEM_U32(s3 + 36); +//nop; +if (t7 != t2) {//nop; +goto L410950;} +//nop; +v0 = 0x10018e80; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +if (v0 == 0) {//nop; +goto L410848;} +//nop; +t9 = MEM_U32(a0 + 44); +t8 = MEM_U32(s3 + 44); +//nop; +if (t9 == t8) {//nop; +goto L410870;} +//nop; +L410848: +if (v0 != 0) {//nop; +goto L410950;} +//nop; +t6 = MEM_U32(s0 + 44); +t3 = MEM_U32(s0 + 40); +t5 = MEM_U32(s3 + 44); +t4 = MEM_U32(s3 + 40); +t1 = t6 + t3; +t7 = t5 + t4; +if (t1 != t7) {//nop; +goto L410950;} +//nop; +L410870: +t2 = MEM_U32(s3 + 40); +t9 = MEM_U32(s0 + 40); +//nop; +if (t2 != t9) {s3 = MEM_U32(sp + 464); +goto L410954;} +s3 = MEM_U32(sp + 464); +v1 = MEM_U32(s0 + 0); +at = 0x49; +v0 = MEM_U32(v1 + 0); +//nop; +t8 = MEM_U8(v0 + 32); +//nop; +if (t8 != at) {//nop; +goto L4108f0;} +//nop; +t6 = MEM_U8(v0 + 33); +at = 0x5010000; +t3 = t6 & 0x1f; +t5 = t3 < 0x20; +t4 = -t5; +t1 = t4 & at; +t7 = t1 << (t3 & 0x1f); +if ((int)t7 >= 0) {//nop; +goto L4108d8;} +//nop; +s5 = MEM_U32(v0 + 48); +s4 = MEM_U32(v0 + 52); +s3 = MEM_U32(sp + 464); +goto L410954; +s3 = MEM_U32(sp + 464); +L4108d8: +s4 = MEM_U32(v0 + 48); +//nop; +if ((int)s4 < 0) {s3 = MEM_U32(sp + 464); +goto L410954;} +s3 = MEM_U32(sp + 464); +s5 = zero; +goto L410950; +s5 = zero; +L4108f0: +v0 = MEM_U32(v1 + 4); +at = 0x49; +t2 = MEM_U8(v0 + 32); +//nop; +if (t2 != at) {s3 = MEM_U32(sp + 464); +goto L410954;} +s3 = MEM_U32(sp + 464); +t9 = MEM_U8(v0 + 33); +at = 0x5010000; +t8 = t9 & 0x1f; +t6 = t8 < 0x20; +t5 = -t6; +t4 = t5 & at; +t1 = t4 << (t8 & 0x1f); +if ((int)t1 >= 0) {//nop; +goto L41093c;} +//nop; +s5 = MEM_U32(v0 + 48); +s4 = MEM_U32(v0 + 52); +s3 = MEM_U32(sp + 464); +goto L410954; +s3 = MEM_U32(sp + 464); +L41093c: +s4 = MEM_U32(v0 + 48); +//nop; +if ((int)s4 < 0) {s3 = MEM_U32(sp + 464); +goto L410954;} +s3 = MEM_U32(sp + 464); +s5 = zero; +L410950: +s3 = MEM_U32(sp + 464); +L410954: +//nop; +if (s3 == 0) {//nop; +goto L410b40;} +//nop; +s1 = 0x1; +s3 = s3 + 0x1; +L410968: +//nop; +//nop; +//nop; +v0 = f_new_tree(mem, sp); +goto L410978; +//nop; +L410978: +gp = MEM_U32(sp + 204); +s0 = v0; +//nop; +a0 = v0 + 0x20; +a1 = zero; +f_readuinstr(mem, sp, a0, a1, a2, a3); +goto L410990; +a1 = zero; +L410990: +t3 = MEM_U8(s0 + 32); +gp = MEM_U32(sp + 204); +at = 0x88; +if (t3 == at) {a0 = 0x4; +goto L410aac;} +a0 = 0x4; +t7 = 0x10007bd8; +a1 = 0x60f; +t7 = t7; +t9 = t7 + 0x48; +t6 = sp; +L4109b8: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t6 = t6 + 0xc; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t6 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t9) {//swr $at, 7($t6) +goto L4109b8;} +//swr $at, 7($t6) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t5 = 0x10007b88; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +t9 = t7 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t7) +t5 = t5; +MEM_U8(t6 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t6 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t6 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t6 + 12 + 3) = (uint8_t)(t9 >> 0); +t8 = t5 + 0x48; +t1 = sp; +//swr $t9, 0xf($t6) +L410a28: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t1 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t1) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t1 = t1 + 0xc; +MEM_U8(t1 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t1) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t1 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 84 + 3) = (uint8_t)(at >> 0); +if (t5 != t8) {//swr $at, 0x57($t1) +goto L410a28;} +//swr $at, 0x57($t1) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +//nop; +MEM_U8(t1 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t1) +t8 = t5 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t5) +//nop; +MEM_U8(t1 + 92 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t1 + 92 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t1 + 92 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t1 + 92 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x5f($t1) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L410aa4; +//nop; +L410aa4: +gp = MEM_U32(sp + 204); +//nop; +L410aac: +if (s2 == 0) {//nop; +goto L410b04;} +//nop; +v0 = MEM_U32(s2 + 52); +a1 = zero; +v1 = v0 + s1; +v1 = v1 + 0xffffffff; +at = (int)v1 < (int)v0; +if (at == 0) {t3 = v1 & s4; +goto L410ad8;} +t3 = v1 & s4; +a1 = 0x1; +goto L410ad8; +a1 = 0x1; +L410ad8: +if (v1 != t3) {//nop; +goto L410af8;} +//nop; +t2 = MEM_U32(s2 + 48); +//nop; +v0 = t2 + a1; +t9 = v0 & s5; +if (v0 == t9) {//nop; +goto L410b04;} +//nop; +L410af8: +t7 = MEM_U32(s2 + 40); +//nop; +MEM_U32(s0 + 36) = t7; +L410b04: +//nop; +a0 = MEM_U32(s0 + 36); +//nop; +v0 = f_find_label(mem, sp, a0); +goto L410b14; +//nop; +L410b14: +gp = MEM_U32(sp + 204); +MEM_U32(s0 + 4) = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +a0 = s0; +func_40dff0(mem, sp, v0, a0); +goto L410b30; +a0 = s0; +L410b30: +gp = MEM_U32(sp + 204); +s1 = s1 + 0x1; +if (s1 != s3) {//nop; +goto L410968;} +//nop; +L410b40: +//nop; +a0 = 0x11; +//nop; +v0 = f_build_op(mem, sp, a0); +goto L410b50; +//nop; +L410b50: +gp = MEM_U32(sp + 204); +MEM_U32(v0 + 40) = zero; +t6 = MEM_U32(sp + 460); +//nop; +a0 = v0; +MEM_U32(v0 + 36) = t6; +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L410b74; +v0 = sp + 0x1650; +L410b74: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L410b80: +t4 = MEM_U16(sp + 5704); +t8 = sp + 0x1004; +s2 = t4 << 2; +s7 = s2 + t8; +t1 = MEM_U32(s7 + 0); +t5 = sp + 0x9c4; +s4 = s2 + t5; +if (t1 != 0) {a3 = t4 + 0xffffffff; +goto L410de0;} +a3 = t4 + 0xffffffff; +//nop; +a0 = MEM_U32(sp + 460); +MEM_U32(sp + 244) = a3; +v0 = f_search_label(mem, sp, a0); +goto L410bb4; +MEM_U32(sp + 244) = a3; +L410bb4: +gp = MEM_U32(sp + 204); +a3 = MEM_U32(sp + 244); +if (v0 == 0) {//nop; +goto L410de0;} +//nop; +//nop; +MEM_U32(sp + 244) = a3; +//nop; +v0 = f_new_tree(mem, sp); +goto L410bd4; +//nop; +L410bd4: +gp = MEM_U32(sp + 204); +a3 = MEM_U32(sp + 244); +t3 = 0x88; +MEM_U8(v0 + 32) = (uint8_t)t3; +t9 = MEM_U32(sp + 476); +t2 = MEM_U32(s4 + 0); +t6 = MEM_U32(sp + 480); +t5 = t2 - t9; +t2 = 0x0; +t7 = MEM_U32(sp + 484); +at = (int)t2 < (int)t6; +s3 = v0; +if (at != 0) {a1 = t5; +goto L410c40;} +a1 = t5; +at = (int)t6 < (int)t2; +if (at != 0) {at = t5 < t7; +goto L410c20;} +at = t5 < t7; +if (at != 0) {//nop; +goto L410c40;} +//nop; +L410c20: +//nop; +a0 = MEM_U32(sp + 464); +MEM_U32(sp + 244) = a3; +v0 = f_find_label(mem, sp, a0); +goto L410c30; +MEM_U32(sp + 244) = a3; +L410c30: +gp = MEM_U32(sp + 204); +a3 = MEM_U32(sp + 244); +MEM_U32(s3 + 4) = v0; +goto L410db8; +MEM_U32(s3 + 4) = v0; +L410c40: +//nop; +a0 = MEM_U32(sp + 460); +MEM_U32(sp + 372) = a1; +MEM_U32(sp + 244) = a3; +v0 = f_find_label(mem, sp, a0); +goto L410c54; +MEM_U32(sp + 244) = a3; +L410c54: +t1 = MEM_U8(v0 + 32); +t8 = 0x11; +gp = MEM_U32(sp + 204); +a1 = MEM_U32(sp + 372); +a3 = MEM_U32(sp + 244); +s0 = v0; +if (t1 == t8) {//nop; +goto L410c78;} +//nop; +abort(); +L410c78: +a1 = a1 + 0x1; +v0 = a1 & 0x3; +v0 = -v0; +if (v0 == 0) {a0 = v0; +goto L410cd4;} +a0 = v0; +a0 = v0 + a1; +L410c90: +s0 = MEM_U32(s0 + 8); +a1 = a1 + 0xffffffff; +v0 = zero < s0; +if (v0 == 0) {v1 = v0; +goto L410cb8;} +v1 = v0; +v1 = MEM_U8(s0 + 32); +//nop; +t9 = v1 ^ 0x88; +t9 = t9 < 0x1; +v1 = t9; +L410cb8: +if (v1 != 0) {//nop; +goto L410cc4;} +//nop; +abort(); +L410cc4: +if (a0 != a1) {//nop; +goto L410c90;} +//nop; +if (a1 == 0) {//nop; +goto L410dac;} +//nop; +L410cd4: +s0 = MEM_U32(s0 + 8); +a1 = a1 + 0xfffffffc; +v0 = zero < s0; +if (v0 == 0) {v1 = v0; +goto L410cfc;} +v1 = v0; +v1 = MEM_U8(s0 + 32); +//nop; +t4 = v1 ^ 0x88; +t4 = t4 < 0x1; +v1 = t4; +L410cfc: +if (v1 != 0) {//nop; +goto L410d08;} +//nop; +abort(); +L410d08: +s0 = MEM_U32(s0 + 8); +//nop; +v0 = zero < s0; +if (v0 == 0) {v1 = v0; +goto L410d30;} +v1 = v0; +v1 = MEM_U8(s0 + 32); +//nop; +t5 = v1 ^ 0x88; +t5 = t5 < 0x1; +v1 = t5; +L410d30: +if (v1 != 0) {//nop; +goto L410d3c;} +//nop; +abort(); +L410d3c: +s0 = MEM_U32(s0 + 8); +//nop; +v0 = zero < s0; +if (v0 == 0) {v1 = v0; +goto L410d64;} +v1 = v0; +v1 = MEM_U8(s0 + 32); +//nop; +t2 = v1 ^ 0x88; +t2 = t2 < 0x1; +v1 = t2; +L410d64: +if (v1 != 0) {//nop; +goto L410d70;} +//nop; +abort(); +L410d70: +s0 = MEM_U32(s0 + 8); +//nop; +v0 = zero < s0; +if (v0 == 0) {v1 = v0; +goto L410d98;} +v1 = v0; +v1 = MEM_U8(s0 + 32); +//nop; +t3 = v1 ^ 0x88; +t3 = t3 < 0x1; +v1 = t3; +L410d98: +if (v1 != 0) {//nop; +goto L410da4;} +//nop; +abort(); +L410da4: +if (a1 != 0) {//nop; +goto L410cd4;} +//nop; +L410dac: +t6 = MEM_U32(s0 + 4); +//nop; +MEM_U32(s3 + 4) = t6; +L410db8: +//nop; +a0 = s3; +t9 = t9; +v0 = sp + 0x1650; +MEM_U32(sp + 244) = a3; +func_40dff0(mem, sp, v0, a0); +goto L410dd0; +MEM_U32(sp + 244) = a3; +L410dd0: +gp = MEM_U32(sp + 204); +a3 = MEM_U32(sp + 244); +v0 = a3 & 0xffff; +goto L411340; +v0 = a3 & 0xffff; +L410de0: +t7 = MEM_U32(s4 + 0); +t5 = MEM_U32(sp + 476); +t6 = sp + 0x384; +t3 = t7 - t5; +//nop; +MEM_U32(s4 + 0) = t3; +t7 = s2 + t6; +MEM_U32(t7 + 0) = zero; +a0 = MEM_U16(sp + 5704); +t9 = t9; +MEM_U32(sp + 244) = a3; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L410e14; +v0 = sp + 0x1650; +L410e14: +t8 = MEM_U8(sp + 457); +at = 0x5010000; +t9 = t8 & 0x1f; +t4 = t9 < 0x20; +t5 = -t4; +t2 = t5 & at; +gp = MEM_U32(sp + 204); +a3 = MEM_U32(sp + 244); +s2 = MEM_U32(s7 + 0); +t3 = t2 << (t9 & 0x1f); +if ((int)t3 >= 0) {at = 0x4; +goto L410e4c;} +at = 0x4; +s1 = 0x7; +goto L410e50; +s1 = 0x7; +L410e4c: +s1 = 0x8; +L410e50: +v0 = MEM_U8(s2 + 33); +a1 = MEM_U8(s2 + 32); +t1 = v0 << 27; +t6 = t1 >> 27; +t7 = s1 ^ t6; +t8 = t7 & 0x1f; +t4 = t8 ^ v0; +if (a1 != at) {MEM_U8(s2 + 33) = (uint8_t)t4; +goto L410fa4;} +MEM_U8(s2 + 33) = (uint8_t)t4; +v0 = MEM_U32(s2 + 4); +at = 0x49; +t5 = MEM_U8(v0 + 32); +t2 = MEM_U32(sp + 480); +if (t5 != at) {//nop; +goto L410ed8;} +//nop; +t3 = MEM_U32(sp + 484); +t6 = MEM_U32(sp + 472); +t7 = MEM_U32(sp + 476); +v1 = MEM_U32(v0 + 48); +t8 = t2 - t6; +at = t3 < t7; +t8 = t8 - at; +t4 = (int)v1 >> 31; +at = (int)t8 < (int)t4; +t9 = t3 - t7; +if (at != 0) {t5 = v1; +goto L410ed8;} +t5 = v1; +at = (int)t4 < (int)t8; +if (at != 0) {at = t9 < t5; +goto L410ed0;} +at = t9 < t5; +if (at != 0) {//nop; +goto L410ed8;} +//nop; +L410ed0: +if ((int)v1 > 0) {//nop; +goto L410f3c;} +//nop; +L410ed8: +v0 = MEM_U32(s2 + 0); +at = 0x49; +t1 = MEM_U8(v0 + 32); +t2 = MEM_U32(sp + 480); +if (t1 != at) {t1 = MEM_U32(sp + 500); +goto L410fa8;} +t1 = MEM_U32(sp + 500); +t3 = MEM_U32(sp + 484); +t6 = MEM_U32(sp + 472); +t7 = MEM_U32(sp + 476); +v1 = MEM_U32(v0 + 48); +t8 = t2 - t6; +at = t3 < t7; +t8 = t8 - at; +t4 = (int)v1 >> 31; +at = (int)t8 < (int)t4; +t9 = t3 - t7; +if (at != 0) {t5 = v1; +goto L410fa4;} +t5 = v1; +at = (int)t4 < (int)t8; +if (at != 0) {at = t9 < t5; +goto L410f34;} +at = t9 < t5; +if (at != 0) {t1 = MEM_U32(sp + 500); +goto L410fa8;} +t1 = MEM_U32(sp + 500); +L410f34: +if ((int)v1 <= 0) {t1 = MEM_U32(sp + 500); +goto L410fa8;} +t1 = MEM_U32(sp + 500); +L410f3c: +//nop; +a0 = MEM_U32(sp + 460); +MEM_U32(sp + 244) = a3; +v0 = f_find_label(mem, sp, a0); +goto L410f4c; +MEM_U32(sp + 244) = a3; +L410f4c: +gp = MEM_U32(sp + 204); +a0 = sp + 0x1c8; +//nop; +a1 = s2; +a2 = v0; +v0 = f_build_u2(mem, sp, a0, a1, a2); +goto L410f64; +a2 = v0; +L410f64: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L410f80; +//nop; +L410f80: +a3 = MEM_U32(sp + 244); +gp = MEM_U32(sp + 204); +v0 = a3 & 0xffff; +a3 = a3 + 0xffffffff; +if (v0 == 0) {//nop; +goto L410f9c;} +//nop; +abort(); +L410f9c: +MEM_U16(sp + 5704) = (uint16_t)v0; +goto L40f4e4; +MEM_U16(sp + 5704) = (uint16_t)v0; +L410fa4: +t1 = MEM_U32(sp + 500); +L410fa8: +at = 0x7b; +t2 = MEM_U8(t1 + 32); +//nop; +if (t2 != at) {//nop; +goto L411248;} +//nop; +a0 = MEM_U32(t1 + 0); +at = 0x4; +t3 = MEM_U8(a0 + 32); +//nop; +if (t3 != at) {//nop; +goto L411248;} +//nop; +v0 = MEM_U32(a0 + 0); +at = 0x49; +t6 = MEM_U8(v0 + 32); +t8 = MEM_U32(sp + 480); +if (t6 != at) {//nop; +goto L411038;} +//nop; +t9 = MEM_U32(sp + 484); +t4 = MEM_U32(sp + 472); +t5 = MEM_U32(sp + 476); +v1 = MEM_U32(v0 + 48); +t2 = t8 - t4; +at = t9 < t5; +t2 = t2 - at; +t6 = (int)v1 >> 31; +at = (int)t2 < (int)t6; +t3 = t9 - t5; +if (at != 0) {t7 = v1; +goto L411038;} +t7 = v1; +at = (int)t6 < (int)t2; +if (at != 0) {at = t3 < t7; +goto L411030;} +at = t3 < t7; +if (at != 0) {//nop; +goto L411038;} +//nop; +L411030: +if ((int)v1 > 0) {at = 0x52; +goto L41109c;} +at = 0x52; +L411038: +v0 = MEM_U32(a0 + 4); +at = 0x49; +t1 = MEM_U8(v0 + 32); +t8 = MEM_U32(sp + 480); +if (t1 != at) {//nop; +goto L411248;} +//nop; +t9 = MEM_U32(sp + 484); +t4 = MEM_U32(sp + 472); +t5 = MEM_U32(sp + 476); +v1 = MEM_U32(v0 + 48); +t2 = t8 - t4; +at = t9 < t5; +t2 = t2 - at; +t6 = (int)v1 >> 31; +at = (int)t2 < (int)t6; +t3 = t9 - t5; +if (at != 0) {t7 = v1; +goto L411248;} +t7 = v1; +at = (int)t6 < (int)t2; +if (at != 0) {at = t3 < t7; +goto L411094;} +at = t3 < t7; +if (at != 0) {//nop; +goto L411248;} +//nop; +L411094: +if ((int)v1 <= 0) {at = 0x52; +goto L411248;} +at = 0x52; +L41109c: +if (a1 != at) {//nop; +goto L4110ac;} +//nop; +s3 = s2; +goto L4110b4; +s3 = s2; +L4110ac: +s3 = MEM_U32(s2 + 0); +//nop; +L4110b4: +t1 = MEM_U32(sp + 500); +t5 = MEM_U8(s3 + 33); +t8 = MEM_U8(t1 + 33); +t2 = t5 << 24; +t9 = t8 << 24; +t4 = t9 >> 29; +t3 = t2 >> 29; +if (t4 != t3) {at = 0x1; +goto L411248;} +at = 0x1; +if (a1 != at) {t1 = MEM_U32(sp + 500); +goto L411114;} +t1 = MEM_U32(sp + 500); +v0 = MEM_U32(s2 + 4); +//nop; +if (v0 == 0) {t1 = MEM_U32(sp + 500); +goto L411114;} +t1 = MEM_U32(sp + 500); +t6 = MEM_U8(v0 + 32); +at = 0x49; +if (t6 != at) {t1 = MEM_U32(sp + 500); +goto L411114;} +t1 = MEM_U32(sp + 500); +t7 = MEM_U32(v0 + 48); +//nop; +if ((int)t7 < 0) {//nop; +goto L411248;} +//nop; +t1 = MEM_U32(sp + 500); +L411114: +t9 = MEM_U32(s3 + 36); +t8 = MEM_U32(t1 + 36); +//nop; +if (t8 != t9) {//nop; +goto L411248;} +//nop; +v0 = 0x10018e80; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +if (v0 == 0) {//nop; +goto L411160;} +//nop; +t2 = MEM_U32(t1 + 48); +t4 = MEM_U32(s3 + 48); +t3 = MEM_U32(t1 + 52); +t5 = MEM_U32(s3 + 52); +if (t2 != t4) {//nop; +goto L411160;} +//nop; +if (t3 == t5) {t1 = MEM_U32(sp + 500); +goto L4111c0;} +t1 = MEM_U32(sp + 500); +L411160: +if (v0 != 0) {//nop; +goto L411248;} +//nop; +t6 = MEM_U32(sp + 500); +t7 = MEM_U32(s3 + 52); +t9 = MEM_U32(t6 + 52); +t3 = MEM_U32(t6 + 60); +t8 = MEM_U32(t6 + 48); +t5 = t9 + t3; +at = t5 < t3; +t9 = MEM_U32(s3 + 60); +t2 = MEM_U32(t6 + 56); +t4 = at + t8; +t6 = MEM_U32(s3 + 48); +t3 = t7 + t9; +t8 = MEM_U32(s3 + 56); +at = t3 < t9; +t4 = t4 + t2; +t2 = at + t6; +t2 = t2 + t8; +if (t4 != t2) {//nop; +goto L411248;} +//nop; +if (t5 != t3) {//nop; +goto L411248;} +//nop; +t1 = MEM_U32(sp + 500); +L4111c0: +t6 = MEM_U32(s3 + 56); +t8 = MEM_U32(t1 + 56); +t7 = MEM_U32(s3 + 60); +t9 = MEM_U32(t1 + 60); +if (t6 != t8) {//nop; +goto L411248;} +//nop; +if (t7 != t9) {//nop; +goto L411248;} +//nop; +//nop; +a0 = MEM_U32(sp + 460); +MEM_U32(sp + 244) = a3; +v0 = f_find_label(mem, sp, a0); +goto L4111f0; +MEM_U32(sp + 244) = a3; +L4111f0: +gp = MEM_U32(sp + 204); +a0 = sp + 0x1c8; +//nop; +a1 = s2; +a2 = v0; +v0 = f_build_u2(mem, sp, a0, a1, a2); +goto L411208; +a2 = v0; +L411208: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L411224; +//nop; +L411224: +a3 = MEM_U32(sp + 244); +gp = MEM_U32(sp + 204); +v0 = a3 & 0xffff; +a3 = a3 + 0xffffffff; +if (v0 == 0) {//nop; +goto L411240;} +//nop; +abort(); +L411240: +MEM_U16(sp + 5704) = (uint16_t)v0; +goto L40f4e4; +MEM_U16(sp + 5704) = (uint16_t)v0; +L411248: +//nop; +a0 = s2; +MEM_U32(sp + 244) = a3; +v0 = f_dup_tree(mem, sp, a0); +goto L411258; +MEM_U32(sp + 244) = a3; +L411258: +gp = MEM_U32(sp + 204); +t5 = MEM_U32(sp + 484); +t3 = MEM_U32(sp + 476); +//nop; +t7 = t5 - t3; +a2 = t7 + 0x1; +s0 = v0; +a0 = s1; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L411280; +a1 = zero; +L411280: +gp = MEM_U32(sp + 204); +a0 = 0x4e; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L411298; +a2 = v0; +L411298: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(sp + 464); +//nop; +s0 = v0; +//nop; +v0 = f_find_label(mem, sp, a0); +goto L4112b0; +//nop; +L4112b0: +gp = MEM_U32(sp + 204); +a0 = 0x26; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L4112c8; +a2 = v0; +L4112c8: +gp = MEM_U32(sp + 204); +MEM_U16(v0 + 34) = (uint16_t)zero; +//nop; +a0 = v0; +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L4112e4; +v0 = sp + 0x1650; +L4112e4: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(sp + 460); +//nop; +//nop; +//nop; +v0 = f_find_label(mem, sp, a0); +goto L4112fc; +//nop; +L4112fc: +gp = MEM_U32(sp + 204); +a0 = sp + 0x1c8; +//nop; +a1 = s2; +a2 = v0; +v0 = f_build_u2(mem, sp, a0, a1, a2); +goto L411314; +a2 = v0; +L411314: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L411330; +//nop; +L411330: +gp = MEM_U32(sp + 204); +a3 = MEM_U32(sp + 244); +//nop; +v0 = a3 & 0xffff; +L411340: +a3 = a3 + 0xffffffff; +if (v0 == 0) {//nop; +goto L411350;} +//nop; +abort(); +L411350: +MEM_U16(sp + 5704) = (uint16_t)v0; +goto L40f4e4; +MEM_U16(sp + 5704) = (uint16_t)v0; +L411358: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L411368; +//nop; +L411368: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L411384; +//nop; +L411384: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L411390: +t1 = 0x100193a0; +t0 = MEM_U32(sp + 468); +t1 = MEM_U32(t1 + 0); +t2 = MEM_U32(sp + 464); +t4 = t0 - t1; +if ((int)t4 >= 0) {t5 = t4; +goto L4113b0;} +t5 = t4; +t5 = -t4; +L4113b0: +t6 = MEM_U32(sp + 492); +t3 = t5 + t2; +at = (int)t6 < (int)t3; +if (at == 0) {t7 = 0x1; +goto L4113c8;} +t7 = 0x1; +t6 = t3; +L4113c8: +t8 = MEM_U16(sp + 5704); +MEM_U32(sp + 492) = t6; +if (t8 != 0) {MEM_U8(sp + 351) = (uint8_t)t7; +goto L41153c;} +MEM_U8(sp + 351) = (uint8_t)t7; +t9 = 0x10018e98; +at = 0x3; +t9 = MEM_U32(t9 + 0); +t1 = 0x2; +if (t9 != at) {a2 = 0x6e; +goto L41153c;} +a2 = 0x6e; +a0 = 0x10006560; +a1 = 0x10007b1a; +//nop; +a0 = MEM_U32(a0 + 0); +MEM_U16(sp + 5704) = (uint16_t)t1; +a3 = 0x6e; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L411410; +a1 = a1; +L411410: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10006560; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L41142c; +//nop; +L41142c: +gp = MEM_U32(sp + 204); +a0 = 0x4; +t4 = 0x10007aca; +a1 = 0x6ac; +t4 = t4; +t2 = t4 + 0x48; +t3 = sp; +L411448: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t3 = t3 + 0xc; +MEM_U8(t3 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t3) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t3 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 4 + 3) = (uint8_t)(at >> 0); +if (t4 != t2) {//swr $at, 7($t3) +goto L411448;} +//swr $at, 7($t3) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t6 = 0x10007a7a; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +t2 = t4 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t4) +t6 = t6; +MEM_U8(t3 + 12 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 12 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 12 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 12 + 3) = (uint8_t)(t2 >> 0); +t8 = t6 + 0x48; +t9 = sp; +//swr $t2, 0xf($t3) +L4114b8: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 84 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 0x57($t9) +goto L4114b8;} +//swr $at, 0x57($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +//nop; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +//nop; +MEM_U8(t9 + 92 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 92 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 92 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 92 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x5f($t9) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L411534; +//nop; +L411534: +gp = MEM_U32(sp + 204); +//nop; +L41153c: +a0 = MEM_U16(sp + 5704); +//nop; +t2 = sp + 0x1004; +t5 = a0 << 2; +a3 = a0 + 0xffffffff; +t9 = t9; +MEM_U32(sp + 244) = a3; +s7 = t5 + t2; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L411564; +v0 = sp + 0x1650; +L411564: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s7 + 0); +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u1(mem, sp, a0, a1); +goto L41157c; +//nop; +L41157c: +a3 = MEM_U32(sp + 244); +gp = MEM_U32(sp + 204); +v1 = a3 & 0xffff; +a3 = a3 + 0xffffffff; +if (v1 == 0) {//nop; +goto L411598;} +//nop; +abort(); +L411598: +//nop; +a0 = v0; +t9 = t9; +v0 = sp + 0x1650; +MEM_U16(sp + 5704) = (uint16_t)v1; +func_40e008(mem, sp, v0, a0); +goto L4115b0; +MEM_U16(sp + 5704) = (uint16_t)v1; +L4115b0: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L4115bc: +t4 = 0x100193a0; +t0 = MEM_U32(sp + 468); +t4 = MEM_U32(t4 + 0); +t8 = MEM_U32(sp + 464); +t3 = t0 - t4; +if ((int)t3 >= 0) {t7 = t3; +goto L4115dc;} +t7 = t3; +t7 = -t3; +L4115dc: +t9 = MEM_U32(sp + 492); +t6 = t7 + t8; +at = (int)t9 < (int)t6; +if (at == 0) {a0 = sp + 0x1c8; +goto L4115f4;} +a0 = sp + 0x1c8; +t9 = t6; +L4115f4: +t5 = MEM_U16(sp + 5704); +MEM_U32(sp + 492) = t9; +if (t5 == 0) {//nop; +goto L411608;} +//nop; +abort(); +L411608: +t2 = MEM_U16(sp + 458); +//nop; +t1 = t2 << 2; +MEM_U32(sp + 472) = t1; +v0 = f_build_u(mem, sp, a0); +goto L41161c; +MEM_U32(sp + 472) = t1; +L41161c: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L411638; +//nop; +L411638: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L411644: +t4 = MEM_U16(sp + 5704); +//nop; +if (t4 == 0) {//nop; +goto L411658;} +//nop; +abort(); +L411658: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L411668; +//nop; +L411668: +t0 = MEM_U32(sp + 468); +t3 = MEM_U32(sp + 496); +gp = MEM_U32(sp + 204); +t8 = t0 & 0x2; +t7 = t3 + 0x1; +s3 = v0; +if (t8 != 0) {MEM_U32(sp + 496) = t7; +goto L411694;} +MEM_U32(sp + 496) = t7; +at = 0x10018ea8; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +L411694: +//nop; +a0 = s3; +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L4116a8; +v0 = sp + 0x1650; +L4116a8: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L4116b4: +a0 = MEM_U16(sp + 5704); +t5 = sp + 0x1004; +t9 = a0 << 2; +s7 = t9 + t5; +//nop; +a3 = a0 + 0xffffffff; +t9 = t9; +MEM_U32(sp + 244) = a3; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L4116dc; +v0 = sp + 0x1650; +L4116dc: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s7 + 0); +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u1(mem, sp, a0, a1); +goto L4116f4; +//nop; +L4116f4: +a3 = MEM_U32(sp + 244); +gp = MEM_U32(sp + 204); +v1 = a3 & 0xffff; +t0 = MEM_U32(sp + 468); +s3 = v0; +a3 = a3 + 0xffffffff; +if (v1 == 0) {//nop; +goto L411718;} +//nop; +abort(); +L411718: +t2 = t0 & 0x80; +if (t2 != 0) {MEM_U16(sp + 5704) = (uint16_t)v1; +goto L411738;} +MEM_U16(sp + 5704) = (uint16_t)v1; +t1 = MEM_U32(sp + 496); +at = 0x10018ea8; +t4 = t1 + 0x1; +MEM_U32(sp + 496) = t4; +MEM_U8(at + 0) = (uint8_t)zero; +L411738: +//nop; +a0 = s3; +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L41174c; +v0 = sp + 0x1650; +L41174c: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L411758: +a0 = MEM_U16(sp + 5704); +t8 = sp + 0x1004; +t7 = a0 << 2; +t9 = t7 + t8; +s7 = t9; +s6 = t9 + 0xfffffffc; +//nop; +a3 = a0 + 0xffffffff; +t9 = t9; +MEM_U32(sp + 244) = a3; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L411788; +v0 = sp + 0x1650; +L411788: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(sp + 244); +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40e07c(mem, sp, v0, a0); +goto L4117a4; +//nop; +L4117a4: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s6 + 0); +//nop; +a2 = MEM_U32(s7 + 0); +a0 = sp + 0x1c8; +v0 = f_build_u2(mem, sp, a0, a1, a2); +goto L4117bc; +a0 = sp + 0x1c8; +L4117bc: +t5 = MEM_U16(sp + 5704); +gp = MEM_U32(sp + 204); +t6 = t5 + 0xfffffffe; +t2 = t6 & 0xffff; +MEM_U16(sp + 5704) = (uint16_t)t6; +if (t2 == 0) {//nop; +goto L4117dc;} +//nop; +abort(); +L4117dc: +//nop; +a0 = v0; +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L4117f0; +v0 = sp + 0x1650; +L4117f0: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L4117fc: +t1 = MEM_U16(sp + 5704); +t8 = MEM_U8(sp + 456); +t7 = sp + 0x1004; +at = 0x7b; +t4 = t1 << 2; +s7 = t4 + t7; +if (t8 != at) {a3 = t1 + 0xffffffff; +goto L411820;} +a3 = t1 + 0xffffffff; +MEM_U32(sp + 472) = zero; +L411820: +t3 = MEM_U8(sp + 456); +at = 0x7b; +if (t3 != at) {v0 = sp + 0x1650; +goto L411858;} +v0 = sp + 0x1650; +t9 = MEM_U8(sp + 457); +at = 0x3; +t5 = t9 << 24; +t6 = t5 >> 29; +if (t6 != at) {t4 = MEM_U8(sp + 456); +goto L41185c;} +t4 = MEM_U8(sp + 456); +t0 = MEM_U32(sp + 468); +//nop; +t2 = t0 << 2; +MEM_U32(sp + 468) = t2; +L411858: +t4 = MEM_U8(sp + 456); +L41185c: +t0 = MEM_U32(sp + 468); +at = 0x7b; +if (t4 != at) {t1 = MEM_U8(sp + 456); +goto L4118d4;} +t1 = MEM_U8(sp + 456); +t7 = MEM_U8(sp + 457); +at = 0x2; +t1 = t7 << 24; +t8 = t1 >> 29; +if (t8 != at) {MEM_U32(sp + 468) = t0; +goto L4118d0;} +MEM_U32(sp + 468) = t0; +t3 = MEM_U32(sp + 460); +t2 = MEM_U32(sp + 464); +if (t3 != 0) {MEM_U32(sp + 468) = t0; +goto L4118d0;} +MEM_U32(sp + 468) = t0; +t9 = 0x100193a0; +t7 = MEM_U32(sp + 492); +t9 = MEM_U32(t9 + 0); +//nop; +t5 = t0 - t9; +if ((int)t5 >= 0) {t6 = t5; +goto L4118b4;} +t6 = t5; +t6 = -t5; +L4118b4: +t4 = t6 + t2; +at = (int)t7 < (int)t4; +if (at == 0) {//nop; +goto L4118c8;} +//nop; +t7 = t4; +L4118c8: +MEM_U32(sp + 492) = t7; +MEM_U32(sp + 468) = t0; +L4118d0: +t1 = MEM_U8(sp + 456); +L4118d4: +at = 0x5; +if (t1 == at) {at = 0x7c; +goto L4118e8;} +at = 0x7c; +if (t1 != at) {//nop; +goto L4118f4;} +//nop; +L4118e8: +at = 0x10018e9c; +t8 = 0x1; +MEM_U8(at + 0) = (uint8_t)t8; +L4118f4: +//nop; +a0 = MEM_U16(sp + 5704); +t9 = t9; +MEM_U32(sp + 244) = a3; +func_40e07c(mem, sp, v0, a0); +goto L411908; +MEM_U32(sp + 244) = a3; +L411908: +gp = MEM_U32(sp + 204); +s0 = MEM_U32(s7 + 0); +//nop; +a0 = sp + 0x1c8; +a1 = s0; +v0 = f_build_u1(mem, sp, a0, a1); +goto L411920; +a1 = s0; +L411920: +t3 = MEM_U8(sp + 456); +gp = MEM_U32(sp + 204); +a3 = MEM_U32(sp + 244); +at = 0x7b; +if (t3 != at) {s3 = v0; +goto L4119e0;} +s3 = v0; +t9 = MEM_U8(s0 + 32); +at = 0x52; +if (t9 != at) {t8 = MEM_U8(sp + 456); +goto L4119e4;} +t8 = MEM_U8(sp + 456); +t0 = MEM_U32(sp + 468); +t5 = MEM_U32(s0 + 44); +//nop; +if (t0 != t5) {t8 = MEM_U8(sp + 456); +goto L4119e4;} +t8 = MEM_U8(sp + 456); +v0 = MEM_U8(s0 + 33); +t2 = MEM_U8(sp + 457); +t6 = v0 & 0x1f; +t4 = t2 & 0x1f; +if (t6 != t4) {t8 = t2 << 24; +goto L4119e0;} +t8 = t2 << 24; +t7 = v0 << 24; +t1 = t7 >> 29; +t3 = t8 >> 29; +if (t1 != t3) {//nop; +goto L4119e0;} +//nop; +t9 = MEM_U32(sp + 460); +t5 = MEM_U32(s0 + 36); +//nop; +if (t9 != t5) {//nop; +goto L4119e0;} +//nop; +t6 = MEM_U32(sp + 464); +t4 = MEM_U32(s0 + 40); +//nop; +if (t6 != t4) {//nop; +goto L4119e0;} +//nop; +t7 = MEM_U16(sp + 458); +//nop; +t2 = t7 & 0x1; +if (t2 != 0) {//nop; +goto L4119e0;} +//nop; +v0 = a3 & 0xffff; +a3 = a3 + 0xffffffff; +if (v0 == 0) {//nop; +goto L4119d8;} +//nop; +abort(); +L4119d8: +MEM_U16(sp + 5704) = (uint16_t)v0; +goto L40f4e4; +MEM_U16(sp + 5704) = (uint16_t)v0; +L4119e0: +t8 = MEM_U8(sp + 456); +L4119e4: +MEM_U16(sp + 5704) = (uint16_t)a3; +at = 0x5; +if (t8 != at) {a3 = a3 + 0xffffffff; +goto L411b70;} +a3 = a3 + 0xffffffff; +t1 = MEM_U16(sp + 5704); +//nop; +if (t1 == 0) {t1 = MEM_U16(sp + 5704); +goto L411b74;} +t1 = MEM_U16(sp + 5704); +a0 = 0x10006560; +a1 = 0x100079f4; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = 0x86; +a3 = 0x86; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L411a24; +a1 = a1; +L411a24: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10006560; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L411a40; +//nop; +L411a40: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10006560; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_fflush(mem, a0); +goto L411a5c; +//nop; +L411a5c: +gp = MEM_U32(sp + 204); +a0 = 0x4; +t3 = 0x100079a4; +a1 = 0x70f; +t3 = t3; +t5 = t3 + 0x48; +t6 = sp; +L411a78: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t6 = t6 + 0xc; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t6 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 4 + 3) = (uint8_t)(at >> 0); +if (t3 != t5) {//swr $at, 7($t6) +goto L411a78;} +//swr $at, 7($t6) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t4 = 0x10007954; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +t4 = t4; +MEM_U8(t6 + 12 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t6 + 12 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t6 + 12 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t6 + 12 + 3) = (uint8_t)(t5 >> 0); +t2 = t4 + 0x48; +t8 = sp; +//swr $t5, 0xf($t6) +L411ae8: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t8 = t8 + 0xc; +MEM_U8(t8 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t8) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t8 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t2) {//swr $at, 0x57($t8) +goto L411ae8;} +//swr $at, 0x57($t8) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +t2 = t4 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t4) +//nop; +MEM_U8(t8 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t8 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t8 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t8 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t8) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L411b64; +//nop; +L411b64: +gp = MEM_U32(sp + 204); +//nop; +goto L411b84; +//nop; +L411b70: +t1 = MEM_U16(sp + 5704); +L411b74: +//nop; +if (t1 == 0) {//nop; +goto L411b84;} +//nop; +abort(); +L411b84: +//nop; +a0 = s3; +t9 = t9; +v0 = sp + 0x1650; +func_40e008(mem, sp, v0, a0); +goto L411b98; +v0 = sp + 0x1650; +L411b98: +v0 = MEM_U8(s3 + 32); +gp = MEM_U32(sp + 204); +at = 0x7b; +if (v0 != at) {at = 0x5; +goto L411be8;} +at = 0x5; +t9 = MEM_U8(s3 + 33); +at = 0x2; +t5 = t9 << 24; +t3 = t5 >> 29; +if (t3 != at) {at = 0x5; +goto L411be8;} +at = 0x5; +//nop; +a0 = s3; +t9 = t9; +v0 = sp + 0x1650; +func_40e238(mem, sp, v0, a0); +goto L411bd8; +v0 = sp + 0x1650; +L411bd8: +gp = MEM_U32(sp + 204); +v0 = MEM_U8(s3 + 32); +//nop; +at = 0x5; +L411be8: +if (v0 == at) {at = 0x7c; +goto L411bf8;} +at = 0x7c; +if (v0 != at) {//nop; +goto L40f4e4;} +//nop; +L411bf8: +v0 = MEM_U8(s3 + 33); +t6 = 0x10019348; +t7 = v0 << 27; +t6 = MEM_U8(t6 + 0); +t2 = t7 >> 27; +t4 = t6 ^ t2; +t8 = t4 & 0x1f; +t1 = t8 ^ v0; +MEM_U8(s3 + 33) = (uint8_t)t1; +goto L40f4e4; +MEM_U8(s3 + 33) = (uint8_t)t1; +L411c20: +t9 = MEM_U16(sp + 5704); +t4 = 0x10019370; +t5 = t9 << 2; +t4 = MEM_U8(t4 + 0); +t3 = sp + 0x1004; +s7 = t5 + t3; +t6 = t5 + 0xfffffffc; +t2 = sp + 0x9c4; +MEM_U32(sp + 472) = zero; +s1 = t6 + t2; +if (t4 == 0) {s6 = s7 + 0xfffffffc; +goto L411c70;} +s6 = s7 + 0xfffffffc; +a0 = t9 + 0xffffffff; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40e07c(mem, sp, v0, a0); +goto L411c68; +//nop; +L411c68: +gp = MEM_U32(sp + 204); +//nop; +L411c70: +t8 = MEM_U32(s6 + 0); +t0 = MEM_U32(sp + 468); +if (t8 != 0) {at = 0xffff8000; +goto L411cf0;} +at = 0xffff8000; +t0 = MEM_U32(sp + 468); +t1 = MEM_U32(s1 + 0); +t7 = 0x10018ed0; +fp = t1 + t0; +t0 = fp & 0xffff; +t3 = t0 ^ 0x8000; +t7 = MEM_U8(t7 + 0); +t0 = t3 + at; +at = 0x1; +if (t7 != at) {a0 = zero; +goto L411cd0;} +a0 = zero; +//nop; +a3 = fp - t0; +a2 = (int)a3 >> 31; +a0 = 0xf; +MEM_U32(sp + 468) = t0; +v0 = f_dwvalue(mem, sp, a0, a1, a2, a3); +goto L411cc4; +MEM_U32(sp + 468) = t0; +L411cc4: +gp = MEM_U32(sp + 204); +MEM_U32(s6 + 0) = v0; +goto L411d00; +MEM_U32(s6 + 0) = v0; +L411cd0: +//nop; +a1 = zero; +a2 = fp - t0; +MEM_U32(sp + 468) = t0; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L411ce4; +MEM_U32(sp + 468) = t0; +L411ce4: +gp = MEM_U32(sp + 204); +MEM_U32(s6 + 0) = v0; +goto L411d00; +MEM_U32(s6 + 0) = v0; +L411cf0: +t6 = MEM_U32(s1 + 0); +//nop; +t0 = t0 + t6; +MEM_U32(sp + 468) = t0; +L411d00: +//nop; +MEM_U32(s1 + 0) = zero; +a0 = MEM_U16(sp + 5704); +t9 = t9; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L411d18; +v0 = sp + 0x1650; +L411d18: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s6 + 0); +//nop; +a2 = MEM_U32(s7 + 0); +a0 = sp + 0x1c8; +v0 = f_build_u2(mem, sp, a0, a1, a2); +goto L411d30; +a0 = sp + 0x1c8; +L411d30: +t2 = MEM_U16(sp + 5704); +gp = MEM_U32(sp + 204); +t4 = t2 + 0xfffffffe; +t9 = t4 & 0xffff; +MEM_U16(sp + 5704) = (uint16_t)t4; +if (t9 == 0) {//nop; +goto L411d50;} +//nop; +abort(); +L411d50: +//nop; +a0 = v0; +t9 = t9; +v0 = sp + 0x1650; +func_40e008(mem, sp, v0, a0); +goto L411d64; +v0 = sp + 0x1650; +L411d64: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L411d70: +t8 = 0x10019370; +t0 = MEM_U32(sp + 468); +t8 = MEM_U8(t8 + 0); +a0 = MEM_U16(sp + 5704); +if (t8 == 0) {MEM_U32(sp + 472) = t0; +goto L411da4;} +MEM_U32(sp + 472) = t0; +//nop; +a0 = a0 + 0xffffffff; +t9 = t9; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L411d9c; +v0 = sp + 0x1650; +L411d9c: +gp = MEM_U32(sp + 204); +//nop; +L411da4: +t1 = MEM_U16(sp + 5704); +t3 = 0x2; +at = t1 < 0x2; +if (at == 0) {t2 = sp + 0x1004; +goto L411dbc;} +t2 = sp + 0x1004; +MEM_U16(sp + 5704) = (uint16_t)t3; +L411dbc: +t7 = MEM_U16(sp + 5704); +t9 = sp + 0x9c4; +t5 = t7 << 2; +t6 = t5 + 0xfffffffc; +s6 = t6 + t2; +t8 = MEM_U32(s6 + 0); +t4 = t5 + 0xfffffffc; +s1 = t4 + t9; +if (t8 != 0) {s7 = t5 + t2; +goto L411e58;} +s7 = t5 + t2; +t1 = MEM_U32(s1 + 0); +t3 = MEM_U32(sp + 460); +t6 = 0x10018ed0; +fp = t1 + t3; +t0 = fp & 0xffff; +t7 = t0 ^ 0x8000; +at = 0xffff8000; +t6 = MEM_U8(t6 + 0); +t0 = t7 + at; +at = 0x1; +if (t6 != at) {a0 = zero; +goto L411e38;} +a0 = zero; +//nop; +a3 = fp - t0; +a2 = (int)a3 >> 31; +a0 = 0xf; +MEM_U32(sp + 468) = t0; +v0 = f_dwvalue(mem, sp, a0, a1, a2, a3); +goto L411e2c; +MEM_U32(sp + 468) = t0; +L411e2c: +gp = MEM_U32(sp + 204); +MEM_U32(s6 + 0) = v0; +goto L411e6c; +MEM_U32(s6 + 0) = v0; +L411e38: +//nop; +a1 = zero; +a2 = fp - t0; +MEM_U32(sp + 468) = t0; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L411e4c; +MEM_U32(sp + 468) = t0; +L411e4c: +gp = MEM_U32(sp + 204); +MEM_U32(s6 + 0) = v0; +goto L411e6c; +MEM_U32(s6 + 0) = v0; +L411e58: +t5 = MEM_U32(sp + 460); +t4 = MEM_U32(s1 + 0); +//nop; +t0 = t5 + t4; +MEM_U32(sp + 468) = t0; +L411e6c: +//nop; +MEM_U32(s1 + 0) = zero; +a0 = MEM_U16(sp + 5704); +t9 = t9; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L411e84; +v0 = sp + 0x1650; +L411e84: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s6 + 0); +//nop; +a2 = MEM_U32(s7 + 0); +a0 = sp + 0x1c8; +v0 = f_build_u2(mem, sp, a0, a1, a2); +goto L411e9c; +a0 = sp + 0x1c8; +L411e9c: +t9 = MEM_U16(sp + 5704); +gp = MEM_U32(sp + 204); +t8 = t9 + 0xfffffffe; +t1 = t8 & 0xffff; +MEM_U16(sp + 5704) = (uint16_t)t8; +if (t1 == 0) {//nop; +goto L411ebc;} +//nop; +abort(); +L411ebc: +//nop; +a0 = v0; +t9 = t9; +v0 = sp + 0x1650; +func_40e008(mem, sp, v0, a0); +goto L411ed0; +v0 = sp + 0x1650; +L411ed0: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L411edc: +//nop; +a0 = MEM_U16(sp + 5704); +t9 = t9; +v0 = sp + 0x1650; +a0 = a0 + 0xffffffff; +func_40e07c(mem, sp, v0, a0); +goto L411ef4; +a0 = a0 + 0xffffffff; +L411ef4: +t3 = MEM_U16(sp + 5704); +gp = MEM_U32(sp + 204); +at = t3 < 0x2; +if (at == 0) {t2 = sp + 0x9c4; +goto L411f10;} +t2 = sp + 0x9c4; +t7 = 0x2; +MEM_U16(sp + 5704) = (uint16_t)t7; +L411f10: +a0 = MEM_U16(sp + 5704); +t9 = sp + 0x1004; +t8 = a0 << 2; +t1 = t8 + 0xfffffffc; +t4 = a0 << 2; +s7 = t4 + t9; +s6 = t1 + t9; +//nop; +t6 = a0 << 2; +t5 = t6 + t2; +t9 = t9; +MEM_U32(t5 + -4) = zero; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L411f48; +v0 = sp + 0x1650; +L411f48: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s6 + 0); +//nop; +a2 = MEM_U32(s7 + 0); +a0 = sp + 0x1c8; +v0 = f_build_u2(mem, sp, a0, a1, a2); +goto L411f60; +a0 = sp + 0x1c8; +L411f60: +v1 = MEM_U16(sp + 5704); +gp = MEM_U32(sp + 204); +v1 = v1 + 0xfffffffe; +t3 = v1 & 0xffff; +v1 = t3; +if (v1 == 0) {//nop; +goto L411f80;} +//nop; +abort(); +L411f80: +//nop; +a0 = v0; +t9 = t9; +v0 = sp + 0x1650; +MEM_U16(sp + 5704) = (uint16_t)v1; +func_40e008(mem, sp, v0, a0); +goto L411f98; +MEM_U16(sp + 5704) = (uint16_t)v1; +L411f98: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L411fa4: +//nop; +a0 = 0x52; +//nop; +v0 = f_build_op(mem, sp, a0); +goto L411fb4; +//nop; +L411fb4: +t7 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 204); +t6 = t7 & 0xff1f; +v1 = t6 | 0x60; +MEM_U8(v0 + 33) = (uint8_t)v1; +t5 = MEM_U16(sp + 458); +t3 = v1 << 27; +t4 = t5 << 2; +MEM_U32(v0 + 44) = t4; +t8 = MEM_U32(sp + 464); +t7 = t3 >> 27; +MEM_U32(v0 + 40) = t8; +t9 = MEM_U8(sp + 457); +a0 = sp + 0x1c8; +t6 = t9 ^ t7; +t2 = t6 & 0x1f; +t5 = t2 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t5; +t4 = MEM_U32(sp + 460); +MEM_U16(v0 + 34) = (uint16_t)zero; +MEM_U32(v0 + 36) = t4; +//nop; +a1 = v0; +//nop; +v0 = f_build_u1(mem, sp, a0, a1); +goto L412018; +//nop; +L412018: +gp = MEM_U32(sp + 204); +t8 = 0x7b; +//nop; +MEM_U8(v0 + 32) = (uint8_t)t8; +MEM_U32(v0 + 48) = zero; +MEM_U16(v0 + 34) = (uint16_t)zero; +a0 = v0; +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L412040; +v0 = sp + 0x1650; +L412040: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L41204c: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L41205c; +//nop; +L41205c: +gp = MEM_U32(sp + 204); +t1 = 0x52; +MEM_U8(v0 + 32) = (uint8_t)t1; +MEM_U32(v0 + 48) = zero; +MEM_U16(v0 + 34) = (uint16_t)zero; +//nop; +s0 = v0; +a0 = 0x7b; +v0 = f_build_op(mem, sp, a0); +goto L412080; +a0 = 0x7b; +L412080: +t3 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 204); +t9 = t3 & 0xff1f; +v1 = t9 | 0x60; +MEM_U8(v0 + 33) = (uint8_t)v1; +t6 = MEM_U16(sp + 458); +MEM_U32(v0 + 48) = zero; +t2 = t6 << 2; +MEM_U32(v0 + 44) = t2; +t5 = MEM_U32(sp + 464); +t1 = v1 << 27; +MEM_U32(v0 + 40) = t5; +t8 = MEM_U8(sp + 457); +t3 = t1 >> 27; +t9 = t8 ^ t3; +t7 = t9 & 0x1f; +t6 = t7 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t6; +t2 = MEM_U32(sp + 460); +//nop; +MEM_U16(v0 + 34) = (uint16_t)zero; +MEM_U32(v0 + 0) = s0; +a0 = v0; +MEM_U32(v0 + 36) = t2; +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L4120ec; +v0 = sp + 0x1650; +L4120ec: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L4120f8: +t5 = MEM_U8(sp + 457); +at = 0x4e0000; +t4 = t5 & 0x1f; +t1 = t4 < 0x20; +t8 = -t1; +at = at | 0x8000; +t3 = t8 & at; +t9 = t3 << (t4 & 0x1f); +if ((int)t9 >= 0) {a0 = 0x400; +goto L41213c;} +a0 = 0x400; +t7 = MEM_U32(sp + 452); +//nop; +a1 = zero; +MEM_U32(sp + 476) = t7; +v0 = f_new(mem, sp, a0, a1); +goto L412134; +MEM_U32(sp + 476) = t7; +L412134: +gp = MEM_U32(sp + 204); +MEM_U32(sp + 452) = v0; +L41213c: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L41214c; +//nop; +L41214c: +gp = MEM_U32(sp + 204); +t6 = 0x49; +MEM_U8(v0 + 32) = (uint8_t)t6; +t2 = MEM_U8(sp + 457); +at = 0x2; +t5 = t2 & 0x1f; +if (t5 == at) {s0 = v0; +goto L412174;} +s0 = v0; +at = 0xa; +if (t5 != at) {t1 = 0x47; +goto L4121cc;} +L412174: +t1 = 0x47; +MEM_U8(v0 + 32) = (uint8_t)t1; +t8 = MEM_U32(sp + 472); +v1 = MEM_U8(v0 + 33); +t3 = 0x10019348; +MEM_U32(v0 + 36) = t8; +t3 = MEM_U8(t3 + 0); +t4 = v1 << 27; +t9 = t4 >> 27; +t7 = t3 ^ t9; +t6 = t7 & 0x1f; +t5 = t6 ^ v1; +t1 = t5 & 0xff1f; +t4 = 0x1001934c; +MEM_U8(v0 + 33) = (uint8_t)t5; +t8 = t1 | 0x80; +MEM_U8(v0 + 33) = (uint8_t)t8; +MEM_U32(v0 + 44) = zero; +MEM_U32(v0 + 48) = zero; +t4 = MEM_U32(t4 + 0); +MEM_U32(v0 + 40) = t4; +goto L412220; +MEM_U32(v0 + 40) = t4; +L4121cc: +t3 = MEM_U8(sp + 457); +at = 0x3; +t9 = t3 & 0x1f; +if (t9 != at) {//nop; +goto L412220;} +//nop; +//nop; +a0 = MEM_U32(sp + 472); +//nop; +v0 = f_find_label(mem, sp, a0); +goto L4121f0; +//nop; +L4121f0: +gp = MEM_U32(sp + 204); +a0 = 0xb; +//nop; +a1 = v0; +//nop; +v0 = f_build_1op(mem, sp, a0, a1); +goto L412208; +//nop; +L412208: +t7 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 204); +t6 = t7 & 0xffe0; +t2 = t6 | 0x3; +s0 = v0; +MEM_U8(v0 + 33) = (uint8_t)t2; +L412220: +//nop; +a0 = 0x7b; +//nop; +v0 = f_build_op(mem, sp, a0); +goto L412230; +//nop; +L412230: +v1 = MEM_U8(v0 + 33); +t1 = MEM_U8(sp + 457); +t8 = v1 << 27; +t4 = t8 >> 27; +t3 = t1 ^ t4; +t9 = t3 & 0x1f; +t6 = t9 ^ v1; +gp = MEM_U32(sp + 204); +t2 = t6 & 0xff1f; +MEM_U8(v0 + 33) = (uint8_t)t6; +t5 = t2 | 0x60; +MEM_U8(v0 + 33) = (uint8_t)t5; +t8 = MEM_U32(sp + 460); +MEM_U32(v0 + 48) = zero; +t1 = t8 << 2; +MEM_U32(v0 + 44) = t1; +t4 = MEM_U32(sp + 464); +//nop; +MEM_U32(v0 + 0) = s0; +a0 = v0; +MEM_U32(v0 + 40) = t4; +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L412290; +v0 = sp + 0x1650; +L412290: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L41229c: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L4122ac; +//nop; +L4122ac: +gp = MEM_U32(sp + 204); +v1 = MEM_U8(v0 + 33); +t9 = 0x10019348; +t3 = 0x47; +MEM_U8(v0 + 32) = (uint8_t)t3; +t9 = MEM_U8(t9 + 0); +t7 = v1 << 27; +t6 = t7 >> 27; +t2 = t9 ^ t6; +t5 = t2 & 0x1f; +t8 = t5 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t8; +t1 = MEM_U8(sp + 457); +at = 0x2; +t4 = t1 << 24; +t3 = t4 >> 29; +if (t3 != at) {s0 = v0; +goto L412310;} +s0 = v0; +//nop; +a0 = v0; +t9 = t9; +v0 = sp + 0x1650; +func_40e238(mem, sp, v0, a0); +goto L412308; +v0 = sp + 0x1650; +L412308: +gp = MEM_U32(sp + 204); +//nop; +L412310: +//nop; +a0 = 0x7b; +//nop; +v0 = f_build_op(mem, sp, a0); +goto L412320; +//nop; +L412320: +gp = MEM_U32(sp + 204); +v1 = MEM_U8(v0 + 33); +t7 = 0x10019348; +t9 = v1 << 27; +t7 = MEM_U8(t7 + 0); +t6 = t9 >> 27; +t2 = t7 ^ t6; +t5 = t2 & 0x1f; +t1 = t5 ^ v1; +t4 = t1 & 0xff1f; +MEM_U8(v0 + 33) = (uint8_t)t1; +t3 = t4 | 0x60; +a1 = 0x1001934c; +MEM_U8(v0 + 33) = (uint8_t)t3; +t9 = MEM_U32(sp + 464); +a1 = MEM_U32(a1 + 0); +MEM_U32(v0 + 48) = zero; +lo = t9 * a1; +hi = (uint32_t)((uint64_t)t9 * (uint64_t)a1 >> 32); +//nop; +MEM_U32(v0 + 0) = s0; +a0 = v0; +MEM_U32(v0 + 40) = a1; +t9 = t9; +t7 = lo; +MEM_U32(v0 + 44) = t7; +v0 = sp + 0x1650; +MEM_U32(s0 + 40) = a1; +func_40dff0(mem, sp, v0, a0); +goto L412390; +MEM_U32(s0 + 40) = a1; +L412390: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L41239c: +s2 = MEM_U16(sp + 5704); +t6 = MEM_U32(sp + 452); +t2 = s2 << 2; +//nop; +t5 = sp + 0x1004; +t8 = sp + 0x9c4; +t1 = sp + 0x384; +s5 = t2 + t1; +s4 = t2 + t8; +s7 = t2 + t5; +s2 = t2; +a0 = 0x400; +a1 = zero; +MEM_U32(sp + 476) = t6; +v0 = f_new(mem, sp, a0, a1); +goto L4123d8; +MEM_U32(sp + 476) = t6; +L4123d8: +gp = MEM_U32(sp + 204); +MEM_U32(sp + 452) = v0; +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L4123f0; +//nop; +L4123f0: +t4 = MEM_U16(sp + 5704); +gp = MEM_U32(sp + 204); +t3 = t4 + 0x1; +MEM_U16(sp + 5704) = (uint16_t)t3; +s7 = s7 + 0x4; +s4 = s4 + 0x4; +s5 = s5 + 0x4; +MEM_U32(s7 + 0) = v0; +MEM_U32(s4 + 0) = zero; +MEM_U32(s5 + 0) = zero; +goto L40f4e4; +MEM_U32(s5 + 0) = zero; +L41241c: +t9 = 0x10019348; +t7 = MEM_U8(sp + 457); +t9 = MEM_U8(t9 + 0); +t6 = t7 << 27; +s2 = MEM_U16(sp + 5704); +t2 = t6 >> 27; +t5 = t9 ^ t2; +t9 = sp + 0x384; +t4 = s2 << 2; +s5 = t4 + t9; +//nop; +t8 = t5 & 0x1f; +t6 = sp + 0x9c4; +t3 = sp + 0x1004; +t1 = t8 ^ t7; +MEM_U8(sp + 457) = (uint8_t)t1; +s7 = t4 + t3; +s4 = t4 + t6; +s2 = t4; +a0 = sp + 0x1c8; +v0 = f_build_u(mem, sp, a0); +goto L412470; +a0 = sp + 0x1c8; +L412470: +t2 = MEM_U8(sp + 457); +gp = MEM_U32(sp + 204); +t5 = t2 << 24; +t8 = t5 >> 29; +at = 0x1; +if (t8 != at) {s3 = v0; +goto L4124e0;} +s3 = v0; +t7 = 0x10019398; +t3 = MEM_U32(sp + 472); +t7 = MEM_U8(t7 + 0); +t6 = MEM_U32(sp + 392); +if (t7 == 0) {at = (int)t3 < (int)t6; +goto L4124cc;} +at = (int)t3 < (int)t6; +t1 = MEM_U32(sp + 472); +t4 = MEM_U32(sp + 388); +//nop; +at = (int)t4 < (int)t1; +if (at == 0) {//nop; +goto L4124c0;} +//nop; +t4 = t1; +L4124c0: +MEM_U32(sp + 388) = t4; +goto L412514; +MEM_U32(sp + 388) = t4; +at = (int)t3 < (int)t6; +L4124cc: +if (at == 0) {//nop; +goto L4124d8;} +//nop; +t6 = t3; +L4124d8: +MEM_U32(sp + 392) = t6; +goto L412514; +MEM_U32(sp + 392) = t6; +L4124e0: +t9 = MEM_U8(sp + 457); +at = 0x2; +t2 = t9 << 24; +t5 = t2 >> 29; +if (t5 != at) {t8 = MEM_U16(sp + 5704); +goto L412518;} +t8 = MEM_U16(sp + 5704); +//nop; +a0 = s3; +t9 = t9; +v0 = sp + 0x1650; +func_40e238(mem, sp, v0, a0); +goto L41250c; +v0 = sp + 0x1650; +L41250c: +gp = MEM_U32(sp + 204); +//nop; +L412514: +t8 = MEM_U16(sp + 5704); +L412518: +s7 = s7 + 0x4; +t7 = t8 + 0x1; +MEM_U16(sp + 5704) = (uint16_t)t7; +s4 = s4 + 0x4; +s5 = s5 + 0x4; +MEM_U32(s7 + 0) = s3; +MEM_U32(s4 + 0) = zero; +MEM_U32(s5 + 0) = zero; +goto L40f4e4; +MEM_U32(s5 + 0) = zero; +L41253c: +t1 = MEM_U16(sp + 5704); +t6 = sp + 0x9c4; +t4 = t1 + 0x1; +s2 = t4 & 0xffff; +t3 = s2 << 2; +MEM_U16(sp + 5704) = (uint16_t)t4; +s4 = t3 + t6; +t9 = sp + 0x384; +MEM_U32(s4 + 0) = zero; +t2 = t3 + t9; +MEM_U32(t2 + 0) = zero; +t5 = MEM_U16(sp + 5704); +t8 = sp + 0x1f7; +t7 = 0x11; +v0 = t5 + t8; +MEM_U8(v0 + 0) = (uint8_t)t7; +t4 = MEM_U8(sp + 457); +t1 = sp + 0x1004; +s2 = t3; +s7 = t3 + t1; +t3 = t4 & 0x1f; +t6 = t3 < 0x20; +t9 = -t6; +at = 0x4e0000; +t2 = t9 & at; +t5 = t2 << (t3 & 0x1f); +if ((int)t5 >= 0) {a0 = 0x400; +goto L4125e4;} +a0 = 0x400; +t8 = MEM_U32(sp + 452); +//nop; +a1 = zero; +MEM_U32(sp + 476) = t8; +v0 = f_new(mem, sp, a0, a1); +goto L4125c0; +MEM_U32(sp + 476) = t8; +L4125c0: +gp = MEM_U32(sp + 204); +MEM_U32(sp + 452) = v0; +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L4125d8; +//nop; +L4125d8: +gp = MEM_U32(sp + 204); +MEM_U32(s7 + 0) = v0; +goto L40f4e4; +MEM_U32(s7 + 0) = v0; +L4125e4: +t7 = MEM_U8(sp + 457); +at = 0x2; +t1 = t7 & 0x1f; +if (t1 == at) {at = 0xa; +goto L412600;} +at = 0xa; +if (t1 != at) {t6 = MEM_U8(sp + 457); +goto L41265c;} +t6 = MEM_U8(sp + 457); +L412600: +//nop; +a0 = 0x47; +//nop; +v0 = f_build_op(mem, sp, a0); +goto L412610; +//nop; +L412610: +t6 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 204); +t4 = MEM_U32(sp + 472); +t9 = t6 & 0xff1f; +t3 = 0x10019348; +v1 = t9 | 0x80; +MEM_U8(v0 + 33) = (uint8_t)v1; +MEM_U32(v0 + 36) = t4; +t3 = MEM_U8(t3 + 0); +t5 = v1 << 27; +t8 = t5 >> 27; +t7 = t3 ^ t8; +t1 = t7 & 0x1f; +t4 = t1 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t4; +MEM_U32(v0 + 44) = zero; +MEM_U32(s7 + 0) = v0; +goto L40f4e4; +MEM_U32(s7 + 0) = v0; +t6 = MEM_U8(sp + 457); +L41265c: +at = 0x3; +t9 = t6 & 0x1f; +if (t9 != at) {t8 = MEM_U8(sp + 457); +goto L4126b4;} +t8 = MEM_U8(sp + 457); +//nop; +a0 = MEM_U32(sp + 472); +//nop; +v0 = f_find_label(mem, sp, a0); +goto L41267c; +//nop; +L41267c: +gp = MEM_U32(sp + 204); +a0 = 0xb; +//nop; +a1 = v0; +//nop; +v0 = f_build_1op(mem, sp, a0, a1); +goto L412694; +//nop; +L412694: +t2 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 204); +t5 = t2 & 0xffe0; +t3 = t5 | 0x3; +MEM_U8(v0 + 33) = (uint8_t)t3; +MEM_U32(s7 + 0) = v0; +goto L40f4e4; +MEM_U32(s7 + 0) = v0; +t8 = MEM_U8(sp + 457); +L4126b4: +at = 0x5000000; +t7 = t8 & 0x1f; +t1 = t7 < 0x20; +t4 = -t1; +t6 = t4 & at; +t9 = t6 << (t7 & 0x1f); +if ((int)t9 >= 0) {//nop; +goto L4126f0;} +//nop; +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L4126e4; +//nop; +L4126e4: +gp = MEM_U32(sp + 204); +MEM_U32(s7 + 0) = v0; +goto L40f4e4; +MEM_U32(s7 + 0) = v0; +L4126f0: +MEM_U32(s7 + 0) = zero; +t2 = MEM_U32(sp + 472); +//nop; +MEM_U32(s4 + 0) = t2; +t5 = MEM_U8(sp + 457); +//nop; +t3 = t5 & 0x1f; +MEM_U8(v0 + 0) = (uint8_t)t3; +goto L40f4e4; +MEM_U8(v0 + 0) = (uint8_t)t3; +L412714: +v0 = MEM_U16(sp + 5704); +t1 = sp + 0x9c4; +v0 = v0 + 0x1; +t8 = v0 & 0xffff; +s2 = t8 << 2; +t4 = s2 + t1; +t6 = sp + 0x384; +MEM_U32(t4 + 0) = zero; +t7 = s2 + t6; +t2 = sp + 0x1f7; +MEM_U32(t7 + 0) = zero; +t5 = t8 + t2; +t9 = 0x11; +MEM_U8(t5 + 0) = (uint8_t)t9; +//nop; +t3 = sp + 0x1004; +s7 = s2 + t3; +MEM_U16(sp + 5704) = (uint16_t)t8; +a0 = sp + 0x1c8; +v0 = f_build_u(mem, sp, a0); +goto L412764; +a0 = sp + 0x1c8; +L412764: +gp = MEM_U32(sp + 204); +MEM_U32(s7 + 0) = v0; +goto L40f4e4; +MEM_U32(s7 + 0) = v0; +L412770: +s2 = MEM_U16(sp + 5704); +t7 = MEM_U8(sp + 456); +t8 = s2 << 2; +t1 = sp + 0x1004; +t4 = sp + 0x9c4; +t6 = sp + 0x384; +at = 0x52; +s5 = t8 + t6; +s4 = t8 + t4; +s7 = t8 + t1; +if (t7 != at) {s2 = t8; +goto L4127c8;} +s2 = t8; +t2 = MEM_U8(sp + 457); +at = 0x3; +t9 = t2 << 24; +t5 = t9 >> 29; +if (t5 != at) {//nop; +goto L4127c8;} +//nop; +t0 = MEM_U32(sp + 468); +//nop; +t3 = t0 << 2; +MEM_U32(sp + 468) = t3; +L4127c8: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L4127d8; +//nop; +L4127d8: +gp = MEM_U32(sp + 204); +MEM_U32(v0 + 48) = zero; +t8 = MEM_U16(sp + 5704); +at = 0x52; +t1 = t8 + 0x1; +MEM_U16(sp + 5704) = (uint16_t)t1; +MEM_U32(s7 + 4) = v0; +MEM_U32(s4 + 4) = zero; +MEM_U32(s5 + 4) = zero; +t4 = MEM_U8(v0 + 32); +s3 = v0; +s7 = s7 + 0x4; +s4 = s4 + 0x4; +if (t4 != at) {s5 = s5 + 0x4; +goto L412848;} +s5 = s5 + 0x4; +t6 = MEM_U8(v0 + 33); +at = 0x2; +t7 = t6 << 24; +t2 = t7 >> 29; +if (t2 != at) {//nop; +goto L412848;} +//nop; +//nop; +a0 = v0; +t9 = t9; +v0 = sp + 0x1650; +func_40e238(mem, sp, v0, a0); +goto L412840; +v0 = sp + 0x1650; +L412840: +gp = MEM_U32(sp + 204); +//nop; +L412848: +v0 = MEM_U8(s3 + 32); +at = 0x4b; +if (v0 == at) {at = 0x48; +goto L412860;} +at = 0x48; +if (v0 != at) {//nop; +goto L40f4e4;} +//nop; +L412860: +v0 = MEM_U8(s3 + 33); +t9 = 0x10019348; +t5 = v0 << 27; +t9 = MEM_U8(t9 + 0); +t3 = t5 >> 27; +t8 = t9 ^ t3; +t1 = t8 & 0x1f; +t4 = t1 ^ v0; +MEM_U8(s3 + 33) = (uint8_t)t4; +goto L40f4e4; +MEM_U8(s3 + 33) = (uint8_t)t4; +L412888: +a0 = MEM_U16(sp + 5704); +//nop; +t2 = sp + 0x1004; +t7 = a0 << 2; +a3 = a0 + 0xffffffff; +t9 = t9; +MEM_U32(sp + 244) = a3; +s7 = t7 + t2; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L4128b0; +v0 = sp + 0x1650; +L4128b0: +gp = MEM_U32(sp + 204); +t5 = 0xa; +//nop; +MEM_U32(sp + 460) = t5; +a1 = MEM_U32(s7 + 0); +a0 = sp + 0x1c8; +v0 = f_build_u1(mem, sp, a0, a1); +goto L4128cc; +a0 = sp + 0x1c8; +L4128cc: +gp = MEM_U32(sp + 204); +a3 = MEM_U32(sp + 244); +//nop; +a0 = v0; +t9 = t9; +v0 = sp + 0x1650; +MEM_U16(sp + 5704) = (uint16_t)a3; +func_40dff0(mem, sp, v0, a0); +goto L4128ec; +MEM_U16(sp + 5704) = (uint16_t)a3; +L4128ec: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L4128f8: +t9 = MEM_U16(sp + 5704); +t8 = sp + 0x1004; +a0 = t9 + 0xffffffff; +t3 = t9 << 2; +//nop; +s7 = t3 + t8; +t9 = t9; +s6 = s7 + 0xfffffffc; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L412920; +v0 = sp + 0x1650; +L412920: +gp = MEM_U32(sp + 204); +a0 = MEM_U16(sp + 5704); +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40e07c(mem, sp, v0, a0); +goto L41293c; +//nop; +L41293c: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s6 + 0); +//nop; +a2 = MEM_U32(s7 + 0); +a0 = sp + 0x1c8; +v0 = f_build_u2(mem, sp, a0, a1, a2); +goto L412954; +a0 = sp + 0x1c8; +L412954: +t4 = MEM_U16(sp + 5704); +at = 0xc0000; +t7 = t4 + 0xfffffffe; +MEM_U16(sp + 5704) = (uint16_t)t7; +t2 = MEM_U8(v0 + 33); +at = at | 0x8000; +t6 = t2 & 0x1f; +t5 = t6 < 0x20; +t9 = -t5; +t3 = t9 & at; +gp = MEM_U32(sp + 204); +t8 = t3 << (t6 & 0x1f); +if ((int)t8 >= 0) {s3 = v0; +goto L4129ac;} +s3 = v0; +//nop; +a0 = v0; +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L4129a0; +v0 = sp + 0x1650; +L4129a0: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L4129ac: +t4 = 0x100016d0; +t1 = MEM_U8(sp + 456); +t4 = t4 + 0xffffff80; +t7 = t1 + t4; +t2 = MEM_U8(t7 + 0); +//nop; +a0 = 0xf; +a1 = s3; +MEM_U8(s3 + 32) = (uint8_t)t2; +v0 = f_build_1op(mem, sp, a0, a1); +goto L4129d4; +MEM_U8(s3 + 32) = (uint8_t)t2; +L4129d4: +gp = MEM_U32(sp + 204); +t5 = MEM_U32(sp + 460); +//nop; +a0 = v0; +MEM_U32(v0 + 36) = t5; +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L4129f4; +v0 = sp + 0x1650; +L4129f4: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L412a00: +t9 = MEM_U8(sp + 464); +t6 = 0x10001640; +t4 = MEM_U8(sp + 457); +t3 = t9 << 2; +t8 = t3 + t6; +t7 = t4 & 0x1f; +t1 = MEM_U32(t8 + 0); +t2 = t7 < 0x20; +t5 = -t2; +t3 = t1 & t5; +t6 = t3 << (t7 & 0x1f); +if ((int)t6 >= 0) {v0 = sp + 0x1650; +goto L412ab0;} +v0 = sp + 0x1650; +t8 = MEM_U16(sp + 458); +t2 = t9 < 0x20; +t4 = t8 & 0x2; +if (t4 == 0) {t1 = -t2; +goto L412a6c;} +t1 = -t2; +at = 0x6000000; +t3 = t1 & at; +t4 = t5 & at; +t2 = t4 << (t7 & 0x1f); +t6 = t3 << (t9 & 0x1f); +t8 = (int)t6 < (int)0x0; +t1 = (int)t2 < (int)0x0; +if (t8 != t1) {a0 = MEM_U16(sp + 5704); +goto L412ab4;} +a0 = MEM_U16(sp + 5704); +L412a6c: +t3 = 0x10018ecc; +t9 = MEM_U8(sp + 464); +t3 = MEM_U8(t3 + 0); +at = 0x1; +if (t3 != at) {t6 = t9 << 2; +goto L40f4e4;} +t6 = t9 << 2; +t5 = 0x10001688; +t2 = MEM_U8(sp + 457); +t4 = t6 + t5; +t8 = t2 & 0x1f; +t7 = MEM_U32(t4 + 0); +t1 = t8 < 0x20; +t3 = -t1; +t9 = t7 & t3; +t6 = t9 << (t8 & 0x1f); +if ((int)t6 < 0) {//nop; +goto L40f4e4;} +//nop; +L412ab0: +a0 = MEM_U16(sp + 5704); +L412ab4: +//nop; +t2 = sp + 0x1004; +t4 = a0 << 2; +t9 = t9; +s7 = t4 + t2; +func_40e07c(mem, sp, v0, a0); +goto L412acc; +s7 = t4 + t2; +L412acc: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s7 + 0); +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u1(mem, sp, a0, a1); +goto L412ae4; +//nop; +L412ae4: +gp = MEM_U32(sp + 204); +MEM_U32(s7 + 0) = v0; +goto L40f4e4; +MEM_U32(s7 + 0) = v0; +L412af0: +a0 = MEM_U16(sp + 5704); +//nop; +t3 = sp + 0x1004; +t7 = a0 << 2; +t9 = t9; +s7 = t7 + t3; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L412b10; +v0 = sp + 0x1650; +L412b10: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s7 + 0); +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u1(mem, sp, a0, a1); +goto L412b28; +//nop; +L412b28: +gp = MEM_U32(sp + 204); +MEM_U32(s7 + 0) = v0; +goto L40f4e4; +MEM_U32(s7 + 0) = v0; +L412b34: +t9 = MEM_U16(sp + 5704); +t5 = MEM_U16(sp + 458); +t8 = sp + 0x1004; +t6 = sp + 0x9c4; +s2 = t9 << 2; +t4 = t5 & 0x2; +s7 = s2 + t8; +if (t4 == 0) {s4 = s2 + t6; +goto L412b84;} +s4 = s2 + t6; +t2 = MEM_U32(s4 + 0); +at = 0x80000000; +if (t2 != at) {a0 = t9; +goto L412b84;} +a0 = t9; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40e07c(mem, sp, v0, a0); +goto L412b7c; +//nop; +L412b7c: +gp = MEM_U32(sp + 204); +//nop; +L412b84: +t1 = MEM_U32(s4 + 0); +s0 = MEM_U32(s7 + 0); +t7 = -t1; +if (s0 == 0) {MEM_U32(s4 + 0) = t7; +goto L40f4e4;} +MEM_U32(s4 + 0) = t7; +//nop; +a0 = sp + 0x1c8; +a1 = s0; +v0 = f_build_u1(mem, sp, a0, a1); +goto L412ba8; +a1 = s0; +L412ba8: +gp = MEM_U32(sp + 204); +MEM_U32(s7 + 0) = v0; +goto L40f4e4; +MEM_U32(s7 + 0) = v0; +L412bb4: +s2 = MEM_U16(sp + 5704); +t8 = sp + 0x9c4; +t3 = s2 << 2; +t4 = MEM_U16(sp + 458); +s4 = t3 + t8; +a1 = MEM_U32(s4 + 0); +t6 = MEM_U32(sp + 460); +t5 = sp + 0x384; +t2 = t4 & 0x2; +s2 = t3; +s5 = t3 + t5; +if (t2 == 0) {fp = a1 + t6; +goto L412c34;} +fp = a1 + t6; +a0 = MEM_U8(sp + 457); +a2 = t6; +t9 = a0 & 0x1f; +a0 = t9; +//nop; +//nop; +//nop; +v0 = f_add_overflow(mem, sp, a0, a1, a2); +goto L412c08; +//nop; +L412c08: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L412c34;} +//nop; +//nop; +a0 = MEM_U16(sp + 5704); +t9 = t9; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L412c28; +v0 = sp + 0x1650; +L412c28: +gp = MEM_U32(sp + 204); +fp = MEM_U32(sp + 460); +//nop; +L412c34: +MEM_U32(s4 + 0) = fp; +t7 = MEM_U16(sp + 458); +t1 = MEM_U32(s5 + 0); +//nop; +t3 = t1 | t7; +MEM_U32(s5 + 0) = t3; +goto L40f4e4; +MEM_U32(s5 + 0) = t3; +L412c50: +s2 = MEM_U16(sp + 5704); +t5 = sp + 0x9c4; +t8 = s2 << 2; +t9 = MEM_U16(sp + 458); +s4 = t8 + t5; +a1 = MEM_U32(s4 + 0); +t4 = MEM_U32(sp + 460); +t2 = sp + 0x384; +t6 = t9 & 0x2; +s2 = t8; +s5 = t8 + t2; +if (t6 == 0) {fp = a1 - t4; +goto L412cc8;} +fp = a1 - t4; +a0 = MEM_U8(sp + 457); +//nop; +t1 = a0 & 0x1f; +a0 = t1; +a2 = t4; +v0 = f_sub_overflow(mem, sp, a0, a1, a2); +goto L412c9c; +a2 = t4; +L412c9c: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L412cc8;} +//nop; +//nop; +a0 = MEM_U16(sp + 5704); +t9 = t9; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L412cbc; +v0 = sp + 0x1650; +L412cbc: +fp = MEM_U32(sp + 460); +gp = MEM_U32(sp + 204); +fp = -fp; +L412cc8: +MEM_U32(s4 + 0) = fp; +t3 = MEM_U16(sp + 458); +t7 = MEM_U32(s5 + 0); +//nop; +t8 = t7 | t3; +MEM_U32(s5 + 0) = t8; +goto L40f4e4; +MEM_U32(s5 + 0) = t8; +L412ce4: +t5 = MEM_U16(sp + 5704); +t1 = 0x10019370; +s2 = t5 << 2; +t1 = MEM_U8(t1 + 0); +t2 = sp + 0x1004; +t9 = sp + 0x9c4; +t6 = sp + 0x384; +MEM_U32(sp + 472) = zero; +s5 = s2 + t6; +s4 = s2 + t9; +if (t1 == 0) {s7 = s2 + t2; +goto L412d30;} +s7 = s2 + t2; +//nop; +a0 = t5; +t9 = t9; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L412d28; +v0 = sp + 0x1650; +L412d28: +gp = MEM_U32(sp + 204); +//nop; +L412d30: +s0 = MEM_U32(s7 + 0); +MEM_U32(s5 + 0) = zero; +v0 = s0 < 0x1; +if (v0 == 0) {at = 0xffff8000; +goto L412dc0;} +at = 0xffff8000; +t0 = MEM_U32(sp + 468); +t4 = MEM_U32(s4 + 0); +v0 = 0x10018ed0; +fp = t4 + t0; +v0 = MEM_U8(v0 + 0); +t0 = fp & 0xffff; +t7 = t0 ^ 0x8000; +t3 = v0 ^ 0x1; +t0 = t7 + at; +if (t3 != 0) {MEM_U32(s4 + 0) = zero; +goto L412d94;} +MEM_U32(s4 + 0) = zero; +//nop; +a3 = fp - t0; +a2 = (int)a3 >> 31; +a0 = 0xf; +MEM_U32(sp + 468) = t0; +v0 = f_dwvalue(mem, sp, a0, a1, a2, a3); +goto L412d88; +MEM_U32(sp + 468) = t0; +L412d88: +gp = MEM_U32(sp + 204); +MEM_U32(s7 + 0) = v0; +goto L412db4; +MEM_U32(s7 + 0) = v0; +L412d94: +//nop; +a0 = zero; +a1 = zero; +a2 = fp - t0; +MEM_U32(sp + 468) = t0; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L412dac; +MEM_U32(sp + 468) = t0; +L412dac: +gp = MEM_U32(sp + 204); +MEM_U32(s7 + 0) = v0; +L412db4: +s0 = MEM_U32(s7 + 0); +//nop; +goto L412dd4; +//nop; +L412dc0: +t0 = MEM_U32(sp + 468); +t2 = MEM_U32(s4 + 0); +MEM_U32(s4 + 0) = zero; +t0 = t0 + t2; +MEM_U32(sp + 468) = t0; +L412dd4: +//nop; +a0 = sp + 0x1c8; +a1 = s0; +v0 = f_build_u1(mem, sp, a0, a1); +goto L412de4; +a1 = s0; +L412de4: +gp = MEM_U32(sp + 204); +MEM_U32(s7 + 0) = v0; +goto L40f4e4; +MEM_U32(s7 + 0) = v0; +L412df0: +t9 = MEM_U16(sp + 5704); +t4 = 0x10019370; +t0 = MEM_U32(sp + 468); +t4 = MEM_U8(t4 + 0); +s2 = t9 << 2; +t6 = sp + 0x1004; +t1 = sp + 0x9c4; +t5 = sp + 0x384; +s5 = s2 + t5; +s4 = s2 + t1; +s7 = s2 + t6; +if (t4 == 0) {MEM_U32(sp + 472) = t0; +goto L412e44;} +MEM_U32(sp + 472) = t0; +a0 = t9; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40e07c(mem, sp, v0, a0); +goto L412e3c; +//nop; +L412e3c: +gp = MEM_U32(sp + 204); +//nop; +L412e44: +s0 = MEM_U32(s7 + 0); +MEM_U32(s5 + 0) = zero; +v0 = s0 < 0x1; +if (v0 == 0) {at = 0xffff8000; +goto L412ed4;} +at = 0xffff8000; +t7 = MEM_U32(s4 + 0); +t3 = MEM_U32(sp + 460); +v0 = 0x10018ed0; +fp = t7 + t3; +v0 = MEM_U8(v0 + 0); +t0 = fp & 0xffff; +t8 = t0 ^ 0x8000; +t2 = v0 ^ 0x1; +t0 = t8 + at; +if (t2 != 0) {MEM_U32(s4 + 0) = zero; +goto L412ea8;} +MEM_U32(s4 + 0) = zero; +//nop; +a3 = fp - t0; +a2 = (int)a3 >> 31; +a0 = 0xf; +MEM_U32(sp + 468) = t0; +v0 = f_dwvalue(mem, sp, a0, a1, a2, a3); +goto L412e9c; +MEM_U32(sp + 468) = t0; +L412e9c: +gp = MEM_U32(sp + 204); +MEM_U32(s7 + 0) = v0; +goto L412ec8; +MEM_U32(s7 + 0) = v0; +L412ea8: +//nop; +a0 = zero; +a1 = zero; +a2 = fp - t0; +MEM_U32(sp + 468) = t0; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L412ec0; +MEM_U32(sp + 468) = t0; +L412ec0: +gp = MEM_U32(sp + 204); +MEM_U32(s7 + 0) = v0; +L412ec8: +s0 = MEM_U32(s7 + 0); +//nop; +goto L412ee8; +//nop; +L412ed4: +t1 = MEM_U32(sp + 460); +t5 = MEM_U32(s4 + 0); +MEM_U32(s4 + 0) = zero; +t0 = t1 + t5; +MEM_U32(sp + 468) = t0; +L412ee8: +//nop; +a0 = sp + 0x1c8; +a1 = s0; +v0 = f_build_u1(mem, sp, a0, a1); +goto L412ef8; +a1 = s0; +L412ef8: +gp = MEM_U32(sp + 204); +MEM_U32(s7 + 0) = v0; +goto L40f4e4; +MEM_U32(s7 + 0) = v0; +L412f04: +a0 = MEM_U16(sp + 5704); +t9 = sp + 0x9c4; +s2 = a0 << 2; +s4 = s2 + t9; +//nop; +t4 = sp + 0x1004; +t7 = sp + 0x384; +t9 = t9; +s5 = s2 + t7; +s7 = s2 + t4; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L412f34; +v0 = sp + 0x1650; +L412f34: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s7 + 0); +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u1(mem, sp, a0, a1); +goto L412f4c; +//nop; +L412f4c: +gp = MEM_U32(sp + 204); +MEM_U32(s7 + 0) = v0; +MEM_U32(s4 + 0) = zero; +MEM_U32(s5 + 0) = zero; +goto L40f4e4; +MEM_U32(s5 + 0) = zero; +L412f60: +t3 = MEM_U16(sp + 5704); +t5 = sp + 0x1004; +t8 = t3 + 0x1; +t2 = t8 & 0xffff; +t6 = t2 << 2; +t1 = t6 + 0xfffffffc; +s2 = t8 & 0xffff; +MEM_U16(sp + 5704) = (uint16_t)t8; +t4 = s2 << 2; +s6 = t1 + t5; +t3 = MEM_U32(s6 + 0); +t9 = sp + 0x9c4; +t7 = sp + 0x384; +s5 = t4 + t7; +s4 = t4 + t9; +s2 = t4; +if (t3 != 0) {s7 = t4 + t5; +goto L412fc8;} +s7 = t4 + t5; +MEM_U32(s7 + 0) = zero; +t2 = MEM_U16(sp + 5704); +t1 = sp + 0x9c4; +t6 = t2 << 2; +t8 = t6 + t1; +t4 = MEM_U32(t8 + -4); +MEM_U32(s4 + 0) = t4; +goto L413004; +MEM_U32(s4 + 0) = t4; +L412fc8: +//nop; +a0 = MEM_U16(sp + 5704); +t9 = t9; +v0 = sp + 0x1650; +a0 = a0 + 0xffffffff; +func_40e07c(mem, sp, v0, a0); +goto L412fe0; +a0 = a0 + 0xffffffff; +L412fe0: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L412ff8; +//nop; +L412ff8: +gp = MEM_U32(sp + 204); +MEM_U32(s7 + 0) = v0; +MEM_U32(s4 + 0) = zero; +L413004: +MEM_U32(s5 + 0) = zero; +goto L40f4e4; +MEM_U32(s5 + 0) = zero; +L41300c: +t5 = MEM_U16(sp + 5704); +t3 = MEM_U16(sp + 458); +t9 = sp + 0x1004; +t7 = sp + 0x9c4; +s2 = t5 << 2; +t2 = t3 & 0x2; +fp = zero; +MEM_U32(sp + 396) = zero; +s7 = s2 + t9; +s4 = s2 + t7; +if (t2 == 0) {a3 = t5 + 0xffffffff; +goto L4130fc;} +a3 = t5 + 0xffffffff; +t6 = t5 << 2; +t1 = t6 + t9; +v0 = MEM_U32(t1 + -4); +t7 = MEM_U8(sp + 457); +if (v0 == 0) {//nop; +goto L413068;} +//nop; +t8 = MEM_U8(v0 + 33); +t3 = t7 & 0x1f; +t4 = t8 & 0x1f; +if (t4 != t3) {//nop; +goto L4130bc;} +//nop; +L413068: +s0 = MEM_U32(s7 + 0); +t6 = MEM_U8(sp + 457); +if (s0 == 0) {t7 = sp + 0x384; +goto L41308c;} +t7 = sp + 0x384; +t2 = MEM_U8(s0 + 33); +t9 = t6 & 0x1f; +t5 = t2 & 0x1f; +if (t5 != t9) {//nop; +goto L4130bc;} +//nop; +L41308c: +t1 = MEM_U16(sp + 5704); +t2 = MEM_U16(sp + 458); +t8 = t1 << 2; +t4 = t8 + t7; +t3 = MEM_U32(t4 + -4); +t6 = s2 + t7; +if (t3 != t2) {//nop; +goto L4130bc;} +//nop; +t5 = MEM_U32(t6 + 0); +//nop; +if (t5 == t2) {v0 = MEM_U8(sp + 456); +goto L413100;} +v0 = MEM_U8(sp + 456); +L4130bc: +//nop; +a0 = a3; +t9 = t9; +v0 = sp + 0x1650; +MEM_U32(sp + 244) = a3; +func_40e07c(mem, sp, v0, a0); +goto L4130d4; +MEM_U32(sp + 244) = a3; +L4130d4: +gp = MEM_U32(sp + 204); +a0 = MEM_U16(sp + 5704); +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40e07c(mem, sp, v0, a0); +goto L4130f0; +//nop; +L4130f0: +gp = MEM_U32(sp + 204); +a3 = MEM_U32(sp + 244); +//nop; +L4130fc: +v0 = MEM_U8(sp + 456); +L413100: +at = v0 < 0x42; +goto L4138cc; +at = v0 < 0x42; +L413108: +t8 = MEM_U16(sp + 458); +s3 = a3 << 2; +t1 = sp + 0x384; +t4 = t8 & 0x2; +v1 = s3 + t1; +if (t4 == 0) {s1 = s3 + t9; +goto L4131b0;} +s1 = s3 + t9; +t7 = MEM_U16(sp + 5704); +a0 = MEM_U8(sp + 457); +t6 = t7 << 2; +t5 = t6 + t9; +//nop; +a1 = MEM_U32(t5 + -4); +a2 = MEM_U32(s4 + 0); +t3 = a0 & 0x1f; +a0 = t3; +MEM_U32(sp + 244) = a3; +MEM_U32(sp + 220) = v1; +v0 = f_add_overflow(mem, sp, a0, a1, a2); +goto L413154; +MEM_U32(sp + 220) = v1; +L413154: +gp = MEM_U32(sp + 204); +v1 = MEM_U32(sp + 220); +a3 = MEM_U32(sp + 244); +if (v0 == 0) {//nop; +goto L4131b0;} +//nop; +t2 = MEM_U32(v1 + 0); +fp = MEM_U32(s1 + 0); +MEM_U32(sp + 396) = t2; +//nop; +MEM_U32(s1 + 0) = zero; +MEM_U32(v1 + 0) = zero; +a0 = MEM_U16(sp + 5704); +t9 = t9; +MEM_U32(sp + 244) = a3; +MEM_U32(sp + 220) = v1; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L413198; +v0 = sp + 0x1650; +L413198: +gp = MEM_U32(sp + 204); +v1 = MEM_U32(sp + 220); +a3 = MEM_U32(sp + 244); +s0 = MEM_U32(s7 + 0); +//nop; +goto L4131e8; +//nop; +L4131b0: +t1 = MEM_U32(s1 + 0); +t8 = MEM_U32(s4 + 0); +MEM_U32(s1 + 0) = zero; +t3 = sp + 0x384; +MEM_U32(s4 + 0) = zero; +t7 = s2 + t3; +t6 = MEM_U32(t7 + 0); +t4 = MEM_U32(v1 + 0); +t5 = MEM_U16(sp + 458); +t9 = t4 | t6; +t2 = t9 | t5; +MEM_U32(sp + 396) = t2; +s0 = MEM_U32(s7 + 0); +fp = t1 + t8; +L4131e8: +if (s0 != 0) {t7 = MEM_U16(sp + 5704); +goto L413214;} +t7 = MEM_U16(sp + 5704); +MEM_U32(s1 + 0) = fp; +t8 = MEM_U16(sp + 458); +t1 = MEM_U32(v1 + 0); +s1 = s1 + 0xfffffffc; +t3 = t1 | t8; +MEM_U32(v1 + 0) = t3; +MEM_U16(sp + 5704) = (uint16_t)a3; +goto L40f4e4; +MEM_U16(sp + 5704) = (uint16_t)a3; +t7 = MEM_U16(sp + 5704); +L413214: +t9 = sp + 0x1004; +t4 = t7 << 2; +t6 = t4 + 0xfffffffc; +s6 = t6 + t9; +t2 = MEM_U32(s6 + 0); +t5 = sp + 0x384; +if (t2 != 0) {s5 = s2 + t5; +goto L4139b8;} +s5 = s2 + t5; +t1 = s3 + t9; +MEM_U32(t1 + 0) = s0; +MEM_U32(s1 + 0) = fp; +t3 = MEM_U16(sp + 458); +t8 = MEM_U32(s5 + 0); +s3 = s3 + 0xfffffffc; +t7 = t8 | t3; +MEM_U32(v1 + 0) = t7; +MEM_U16(sp + 5704) = (uint16_t)a3; +s5 = s5 + 0xfffffffc; +s1 = s1 + 0xfffffffc; +goto L40f4e4; +s1 = s1 + 0xfffffffc; +t5 = MEM_U8(sp + 456); +L413268: +s3 = a3 << 2; +t4 = sp + 0x9c4; +t6 = sp + 0x384; +at = 0x9; +v1 = s3 + t6; +if (t5 != at) {s1 = s3 + t4; +goto L41328c;} +s1 = s3 + t4; +t2 = 0x7d; +MEM_U8(sp + 456) = (uint8_t)t2; +L41328c: +t9 = MEM_U16(sp + 458); +//nop; +t1 = t9 & 0x2; +if (t1 == 0) {//nop; +goto L41332c;} +//nop; +t3 = MEM_U16(sp + 5704); +t4 = sp + 0x9c4; +t7 = t3 << 2; +a0 = MEM_U8(sp + 457); +t6 = t7 + t4; +//nop; +a1 = MEM_U32(t6 + -4); +a2 = MEM_U32(s4 + 0); +t8 = a0 & 0x1f; +a0 = t8; +MEM_U32(sp + 244) = a3; +MEM_U32(sp + 220) = v1; +v0 = f_sub_overflow(mem, sp, a0, a1, a2); +goto L4132d4; +MEM_U32(sp + 220) = v1; +L4132d4: +gp = MEM_U32(sp + 204); +v1 = MEM_U32(sp + 220); +a3 = MEM_U32(sp + 244); +if (v0 == 0) {//nop; +goto L41332c;} +//nop; +t5 = MEM_U32(v1 + 0); +fp = MEM_U32(s1 + 0); +//nop; +MEM_U32(sp + 396) = t5; +MEM_U32(s1 + 0) = zero; +a0 = MEM_U16(sp + 5704); +t9 = t9; +MEM_U32(sp + 244) = a3; +MEM_U32(sp + 220) = v1; +v0 = sp + 0x1650; +func_40e07c(mem, sp, v0, a0); +goto L413314; +v0 = sp + 0x1650; +L413314: +gp = MEM_U32(sp + 204); +v1 = MEM_U32(sp + 220); +a3 = MEM_U32(sp + 244); +s0 = MEM_U32(s7 + 0); +//nop; +goto L413364; +//nop; +L41332c: +t2 = MEM_U32(s1 + 0); +t9 = MEM_U32(s4 + 0); +MEM_U32(s1 + 0) = zero; +t8 = sp + 0x384; +MEM_U32(s4 + 0) = zero; +t3 = s2 + t8; +t7 = MEM_U32(t3 + 0); +t1 = MEM_U32(v1 + 0); +t6 = MEM_U16(sp + 458); +t4 = t1 | t7; +t5 = t4 | t6; +MEM_U32(sp + 396) = t5; +s0 = MEM_U32(s7 + 0); +fp = t2 - t9; +L413364: +if (s0 != 0) {t3 = MEM_U16(sp + 5704); +goto L413390;} +t3 = MEM_U16(sp + 5704); +MEM_U32(s1 + 0) = fp; +t9 = MEM_U16(sp + 458); +t2 = MEM_U32(v1 + 0); +s1 = s1 + 0xfffffffc; +t8 = t2 | t9; +MEM_U32(v1 + 0) = t8; +MEM_U16(sp + 5704) = (uint16_t)a3; +goto L40f4e4; +MEM_U16(sp + 5704) = (uint16_t)a3; +t3 = MEM_U16(sp + 5704); +L413390: +t4 = sp + 0x1004; +t1 = t3 << 2; +t7 = t1 + 0xfffffffc; +s6 = t7 + t4; +t6 = MEM_U32(s6 + 0); +a0 = 0x5e; +if (t6 != 0) {a1 = s0; +goto L4133f8;} +a1 = s0; +MEM_U32(s1 + 0) = fp; +t5 = MEM_U32(sp + 396); +//nop; +t2 = sp + 0x1004; +MEM_U32(v1 + 0) = t5; +MEM_U32(sp + 244) = a3; +s2 = s3 + t2; +v0 = f_build_1op(mem, sp, a0, a1); +goto L4133d0; +s2 = s3 + t2; +L4133d0: +a3 = MEM_U32(sp + 244); +gp = MEM_U32(sp + 204); +MEM_U32(s2 + 0) = v0; +t9 = MEM_U32(s7 + 0); +s7 = s7 + 0xfffffffc; +t8 = MEM_U16(t9 + 34); +s2 = s2 + 0xfffffffc; +MEM_U16(v0 + 34) = (uint16_t)t8; +MEM_U16(sp + 5704) = (uint16_t)a3; +goto L40f4e4; +MEM_U16(sp + 5704) = (uint16_t)a3; +L4133f8: +t3 = sp + 0x384; +s5 = s2 + t3; +goto L4139b8; +s5 = s2 + t3; +L413404: +t1 = MEM_U16(sp + 458); +t6 = MEM_U16(sp + 5704); +t7 = t1 & 0x2; +if (t7 == 0) {t4 = sp + 0x384; +goto L413430;} +t4 = sp + 0x384; +t5 = t6 << 2; +t2 = t5 + 0xfffffffc; +t9 = sp + 0x1004; +s6 = t2 + t9; +s5 = s2 + t4; +goto L4139b8; +s5 = s2 + t4; +L413430: +t8 = MEM_U32(s7 + 0); +t7 = MEM_U16(sp + 5704); +if (t8 != 0) {t4 = t7 << 2; +goto L4134a4;} +t4 = t7 << 2; +s3 = a3 << 2; +t3 = sp + 0x9c4; +s1 = s3 + t3; +t1 = MEM_U32(s1 + 0); +t7 = MEM_U32(s4 + 0); +MEM_U32(s1 + 0) = zero; +lo = t1 * t7; +hi = (uint32_t)((uint64_t)t1 * (uint64_t)t7 >> 32); +t4 = sp + 0x1004; +t9 = MEM_U16(sp + 5704); +t6 = s3 + t4; +t5 = MEM_U32(t6 + 0); +t8 = t9 << 2; +t3 = t8 + 0xfffffffc; +t1 = sp + 0x1004; +t2 = sp + 0x384; +fp = lo; +if (t5 != 0) {//nop; +goto L413498;} +//nop; +MEM_U16(sp + 5704) = (uint16_t)a3; +s4 = s4 + 0xfffffffc; +MEM_U32(s4 + 0) = fp; +goto L40f4e4; +MEM_U32(s4 + 0) = fp; +L413498: +s5 = s2 + t2; +s6 = t3 + t1; +goto L4139b8; +s6 = t3 + t1; +L4134a4: +t6 = t4 + 0xfffffffc; +t5 = sp + 0x1004; +s6 = t6 + t5; +t9 = MEM_U32(s6 + 0); +t2 = sp + 0x384; +if (t9 != 0) {s5 = s2 + t2; +goto L4139b8;} +s5 = s2 + t2; +t3 = sp + 0x9c4; +t1 = t4 + t3; +t7 = MEM_U32(t1 + -4); +t8 = MEM_U32(s4 + 0); +MEM_U32(s4 + 0) = zero; +lo = t8 * t7; +hi = (uint32_t)((uint64_t)t8 * (uint64_t)t7 >> 32); +fp = lo; +//nop; +goto L4139b8; +//nop; +L4134e4: +t4 = MEM_U32(s4 + 0); +t3 = MEM_U32(sp + 460); +t6 = MEM_U16(sp + 5704); +lo = t4 * t3; +hi = (uint32_t)((uint64_t)t4 * (uint64_t)t3 >> 32); +t5 = t6 << 2; +t2 = t5 + 0xfffffffc; +t9 = sp + 0x9c4; +s1 = t2 + t9; +t8 = MEM_U32(s1 + 0); +s0 = MEM_U32(s7 + 0); +MEM_U32(s1 + 0) = zero; +MEM_U32(s4 + 0) = zero; +t1 = lo; +fp = t8 + t1; +if (s0 != 0) {t6 = MEM_U16(sp + 5704); +goto L413538;} +t6 = MEM_U16(sp + 5704); +MEM_U16(sp + 5704) = (uint16_t)a3; +s4 = s4 + 0xfffffffc; +MEM_U32(s4 + 0) = fp; +goto L40f4e4; +MEM_U32(s4 + 0) = fp; +t6 = MEM_U16(sp + 5704); +L413538: +t4 = MEM_U32(sp + 460); +t5 = t6 << 2; +t2 = t5 + 0xfffffffc; +t7 = sp + 0x384; +t9 = sp + 0x1004; +at = 0x1; +s6 = t2 + t9; +if (t4 == at) {s5 = s2 + t7; +goto L4135a4;} +s5 = s2 + t7; +//nop; +a0 = 0x8; +a1 = zero; +a2 = t4; +MEM_U32(sp + 244) = a3; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L413574; +MEM_U32(sp + 244) = a3; +L413574: +gp = MEM_U32(sp + 204); +a0 = 0x5b; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L41358c; +a2 = v0; +L41358c: +gp = MEM_U32(sp + 204); +a3 = MEM_U32(sp + 244); +MEM_U32(s7 + 0) = v0; +t3 = MEM_U16(sp + 458); +//nop; +MEM_U16(v0 + 34) = (uint16_t)t3; +L4135a4: +t8 = 0x1; +MEM_U8(sp + 456) = (uint8_t)t8; +goto L4139b8; +MEM_U8(sp + 456) = (uint8_t)t8; +L4135b0: +v0 = MEM_U16(sp + 5704); +t3 = MEM_U32(s7 + 0); +t7 = v0 << 2; +t2 = v0 << 2; +t9 = t2 + 0xfffffffc; +t6 = t7 + 0xfffffffc; +t1 = sp + 0x384; +t5 = sp + 0x1004; +t4 = sp + 0x9c4; +s1 = t9 + t4; +s6 = t6 + t5; +if (t3 != 0) {s5 = s2 + t1; +goto L4135f0;} +s5 = s2 + t1; +v0 = MEM_U32(s1 + 0); +fp = v0; +goto L41362c; +fp = v0; +L4135f0: +t8 = MEM_U32(s6 + 0); +//nop; +if (t8 != 0) {//nop; +goto L413610;} +//nop; +fp = MEM_U32(s4 + 0); +v0 = MEM_U32(s1 + 0); +t7 = v0 - fp; +goto L413630; +t7 = v0 - fp; +L413610: +v0 = MEM_U32(s1 + 0); +t1 = MEM_U32(s4 + 0); +fp = v0; +at = (int)t1 < (int)v0; +if (at == 0) {t7 = v0 - fp; +goto L413630;} +t7 = v0 - fp; +fp = t1; +L41362c: +t7 = v0 - fp; +L413630: +MEM_U32(s1 + 0) = t7; +t6 = MEM_U32(s4 + 0); +//nop; +t5 = t6 - fp; +MEM_U32(s4 + 0) = t5; +fp = zero; +goto L4139b8; +fp = zero; +v0 = MEM_U16(sp + 5704); +L413650: +t4 = sp + 0x9c4; +t2 = v0 << 2; +t9 = t2 + 0xfffffffc; +s1 = t9 + t4; +t6 = MEM_U32(s1 + 0); +t8 = v0 << 2; +t1 = t8 + 0xfffffffc; +t3 = sp + 0x384; +t7 = sp + 0x1004; +s6 = t1 + t7; +if (t6 == 0) {s5 = s2 + t3; +goto L4136d8;} +s5 = s2 + t3; +t5 = MEM_U32(s4 + 0); +a0 = s6; +if (t5 != 0) {t8 = MEM_U8(sp + 457); +goto L4136dc;} +t8 = MEM_U8(sp + 457); +//nop; +a1 = s7; +MEM_U32(sp + 244) = a3; +f_swap_tree(mem, sp, a0, a1); +goto L4136a0; +MEM_U32(sp + 244) = a3; +L4136a0: +gp = MEM_U32(sp + 204); +a0 = s1; +//nop; +a1 = s4; +//nop; +f_swap_int(mem, sp, a0, a1); +goto L4136b8; +//nop; +L4136b8: +gp = MEM_U32(sp + 204); +t2 = MEM_U8(sp + 456); +t9 = 0x10005a1c; +a3 = MEM_U32(sp + 244); +t4 = t2 + t9; +t3 = MEM_U8(t4 + 0); +//nop; +MEM_U8(sp + 456) = (uint8_t)t3; +L4136d8: +t8 = MEM_U8(sp + 457); +L4136dc: +at = 0x6; +t1 = t8 & 0x1f; +if (t1 != at) {//nop; +goto L4139b8;} +//nop; +s0 = MEM_U32(s7 + 0); +//nop; +if (s0 == 0) {//nop; +goto L413710;} +//nop; +t7 = MEM_U8(s0 + 33); +at = 0x6; +t6 = t7 & 0x1f; +if (t6 != at) {//nop; +goto L4139b8;} +//nop; +L413710: +a1 = MEM_U32(s4 + 0); +at = 0x1; +if (a1 != at) {at = 0x1; +goto L413740;} +at = 0x1; +t5 = MEM_U8(sp + 456); +at = 0x4e; +if (t5 != at) {t2 = 0x4d; +goto L41373c;} +t2 = 0x4d; +MEM_U8(sp + 456) = (uint8_t)t2; +MEM_U32(s4 + 0) = zero; +goto L4139b8; +MEM_U32(s4 + 0) = zero; +L41373c: +at = 0x1; +L413740: +if (a1 != at) {at = 0xffffffff; +goto L413768;} +at = 0xffffffff; +t9 = MEM_U8(sp + 456); +at = 0x28; +if (t9 != at) {t4 = 0x29; +goto L413764;} +t4 = 0x29; +MEM_U8(sp + 456) = (uint8_t)t4; +MEM_U32(s4 + 0) = zero; +goto L4139b8; +MEM_U32(s4 + 0) = zero; +L413764: +at = 0xffffffff; +L413768: +if (a1 != at) {at = 0xffffffff; +goto L413790;} +at = 0xffffffff; +t3 = MEM_U8(sp + 456); +at = 0x4d; +if (t3 != at) {t8 = 0x4e; +goto L41378c;} +t8 = 0x4e; +MEM_U8(sp + 456) = (uint8_t)t8; +MEM_U32(s4 + 0) = zero; +goto L4139b8; +MEM_U32(s4 + 0) = zero; +L41378c: +at = 0xffffffff; +L413790: +if (a1 != at) {//nop; +goto L4139b8;} +//nop; +t1 = MEM_U8(sp + 456); +at = 0x29; +if (t1 != at) {t7 = 0x28; +goto L4139b8;} +t7 = 0x28; +MEM_U8(sp + 456) = (uint8_t)t7; +MEM_U32(s4 + 0) = zero; +goto L4139b8; +MEM_U32(s4 + 0) = zero; +L4137b4: +t5 = MEM_U16(sp + 5704); +t6 = sp + 0x384; +t2 = t5 << 2; +t9 = t2 + 0xfffffffc; +t4 = sp + 0x1004; +s6 = t9 + t4; +s5 = s2 + t6; +goto L4139b8; +s5 = s2 + t6; +L4137d4: +t3 = MEM_U32(s4 + 0); +t2 = sp + 0x1004; +t8 = t3 & 0x1f; +MEM_U32(s4 + 0) = t8; +t7 = MEM_U16(sp + 5704); +s5 = s2 + t1; +t6 = t7 << 2; +t5 = t6 + 0xfffffffc; +s6 = t5 + t2; +goto L4139b8; +s6 = t5 + t2; +L4137fc: +t4 = MEM_U16(sp + 5704); +t7 = MEM_U32(s7 + 0); +t3 = t4 << 2; +t8 = t3 + 0xfffffffc; +t9 = sp + 0x384; +t1 = sp + 0x1004; +s6 = t8 + t1; +if (t7 != 0) {s5 = s2 + t9; +goto L4139b8;} +s5 = s2 + t9; +a1 = MEM_U32(s4 + 0); +//nop; +if (a1 == 0) {//nop; +goto L4139b8;} +//nop; +v0 = MEM_U32(s6 + 0); +//nop; +if (v0 == 0) {//nop; +goto L4139b8;} +//nop; +t6 = MEM_U8(v0 + 33); +at = 0x8; +t5 = t6 & 0x1f; +if (t5 == at) {t2 = t3 + 0xfffffffc; +goto L4139b8;} +t2 = t3 + 0xfffffffc; +t9 = sp + 0x9c4; +s1 = t2 + t9; +t4 = MEM_U32(s1 + 0); +//nop; +lo = (int)t4 / (int)a1; hi = (int)t4 % (int)a1; +if (a1 != 0) {//nop; +goto L413874;} +//nop; +abort(); +L413874: +at = 0xffffffff; +if (a1 != at) {at = 0x80000000; +goto L41388c;} +at = 0x80000000; +if (t4 != at) {//nop; +goto L41388c;} +//nop; +abort(); +L41388c: +t8 = hi; +t1 = t8 ^ a1; +if ((int)t1 >= 0) {//nop; +goto L4138a0;} +//nop; +t8 = t8 + a1; +L4138a0: +MEM_U32(s1 + 0) = t8; +goto L4139b8; +MEM_U32(s1 + 0) = t8; +L4138a8: +t6 = MEM_U16(sp + 5704); +L4138ac: +t7 = sp + 0x384; +t5 = t6 << 2; +t3 = t5 + 0xfffffffc; +t2 = sp + 0x1004; +s6 = t3 + t2; +s5 = s2 + t7; +goto L4139b8; +s5 = s2 + t7; +at = v0 < 0x42; +L4138cc: +if (at != 0) {at = v0 < 0x60; +goto L413914;} +at = v0 < 0x60; +if (at != 0) {at = v0 < 0x75; +goto L4138f4;} +at = v0 < 0x75; +if (at != 0) {at = 0x7d; +goto L4139a4;} +at = 0x7d; +if (v0 == at) {t5 = MEM_U8(sp + 456); +goto L413268;} +t5 = MEM_U8(sp + 456); +t6 = MEM_U16(sp + 5704); +goto L4138ac; +t6 = MEM_U16(sp + 5704); +L4138f4: +at = v0 < 0x4f; +if (at == 0) {t9 = v0 + 0xffffffab; +goto L413978;} +t9 = v0 + 0xffffffab; +at = v0 < 0x4d; +if (at == 0) {v0 = MEM_U16(sp + 5704); +goto L413650;} +v0 = MEM_U16(sp + 5704); +t6 = MEM_U16(sp + 5704); +goto L4138ac; +t6 = MEM_U16(sp + 5704); +L413914: +at = v0 < 0xa; +if (at != 0) {at = 0x23; +goto L413944;} +at = 0x23; +if (v0 == at) {//nop; +goto L4135b0;} +//nop; +at = v0 < 0x2a; +if (at == 0) {at = v0 < 0x28; +goto L413964;} +at = v0 < 0x28; +if (at == 0) {v0 = MEM_U16(sp + 5704); +goto L413650;} +v0 = MEM_U16(sp + 5704); +t6 = MEM_U16(sp + 5704); +goto L4138ac; +t6 = MEM_U16(sp + 5704); +L413944: +at = 0x1; +if (v0 == at) {t9 = sp + 0x9c4; +goto L413108;} +t9 = sp + 0x9c4; +at = 0x9; +if (v0 == at) {t5 = MEM_U8(sp + 456); +goto L413268;} +t5 = MEM_U8(sp + 456); +t6 = MEM_U16(sp + 5704); +goto L4138ac; +t6 = MEM_U16(sp + 5704); +L413964: +at = 0x41; +if (v0 == at) {//nop; +goto L4134e4;} +//nop; +t6 = MEM_U16(sp + 5704); +goto L4138ac; +t6 = MEM_U16(sp + 5704); +L413978: +at = t9 < 0xb; +if (at == 0) {//nop; +goto L4138a8;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10007cc8[] = { +&&L4137b4, +&&L4137b4, +&&L4137fc, +&&L4138a8, +&&L4138a8, +&&L4138a8, +&&L413404, +&&L4138a8, +&&L4138a8, +&&L4138a8, +&&L4135b0, +}; +dest = Lswitch10007cc8[t9]; +//nop; +goto *dest; +//nop; +L4139a4: +at = v0 < 0x73; +if (at == 0) {t1 = sp + 0x384; +goto L4137d4;} +t1 = sp + 0x384; +t6 = MEM_U16(sp + 5704); +goto L4138ac; +t6 = MEM_U16(sp + 5704); +L4139b8: +//nop; +a0 = MEM_U16(sp + 5704); +t9 = t9; +v0 = sp + 0x1650; +MEM_U32(sp + 244) = a3; +func_40e07c(mem, sp, v0, a0); +goto L4139d0; +MEM_U32(sp + 244) = a3; +L4139d0: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(sp + 244); +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40e07c(mem, sp, v0, a0); +goto L4139ec; +//nop; +L4139ec: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s6 + 0); +//nop; +a2 = MEM_U32(s7 + 0); +a0 = sp + 0x1c8; +v0 = f_build_u2(mem, sp, a0, a1, a2); +goto L413a04; +a0 = sp + 0x1c8; +L413a04: +a3 = MEM_U32(sp + 244); +gp = MEM_U32(sp + 204); +MEM_U16(sp + 5704) = (uint16_t)a3; +MEM_U32(s7 + -4) = v0; +MEM_U32(s4 + -4) = fp; +t4 = MEM_U32(sp + 396); +s7 = s7 + 0xfffffffc; +s4 = s4 + 0xfffffffc; +s5 = s5 + 0xfffffffc; +MEM_U32(s5 + 0) = t4; +goto L40f4e4; +MEM_U32(s5 + 0) = t4; +L413a30: +t1 = MEM_U16(sp + 5704); +t3 = MEM_U16(sp + 458); +t8 = t1 << 2; +t7 = sp + 0x1004; +v0 = t8 + t7; +t6 = sp + 0x9c4; +t5 = sp + 0x384; +t2 = t3 & 0x2; +s5 = t8 + t5; +s4 = t8 + t6; +s6 = v0 + 0xfffffffc; +s3 = v0 + 0xfffffff8; +if (t2 == 0) {s7 = t8 + t7; +goto L413b78;} +s7 = t8 + t7; +v0 = MEM_U32(s6 + 0); +t1 = MEM_U8(sp + 457); +if (v0 == 0) {//nop; +goto L413a8c;} +//nop; +t9 = MEM_U8(v0 + 33); +t6 = t1 & 0x1f; +t4 = t9 & 0x1f; +if (t4 != t6) {t9 = MEM_U16(sp + 5704); +goto L413b18;} +t9 = MEM_U16(sp + 5704); +L413a8c: +s0 = MEM_U32(s7 + 0); +t7 = MEM_U8(sp + 457); +if (s0 == 0) {//nop; +goto L413ab0;} +//nop; +t5 = MEM_U8(s0 + 33); +t3 = t7 & 0x1f; +t8 = t5 & 0x1f; +if (t8 != t3) {t9 = MEM_U16(sp + 5704); +goto L413b18;} +t9 = MEM_U16(sp + 5704); +L413ab0: +a2 = MEM_U32(s3 + 0); +t1 = MEM_U8(sp + 457); +if (a2 == 0) {t7 = sp + 0x384; +goto L413ad4;} +t7 = sp + 0x384; +t2 = MEM_U8(a2 + 33); +t4 = t1 & 0x1f; +t9 = t2 & 0x1f; +if (t9 != t4) {t9 = MEM_U16(sp + 5704); +goto L413b18;} +t9 = MEM_U16(sp + 5704); +L413ad4: +t6 = MEM_U16(sp + 5704); +t3 = MEM_U16(sp + 458); +t5 = t6 << 2; +v0 = t5 + t7; +t8 = MEM_U32(v0 + -8); +//nop; +if (t8 != t3) {t9 = MEM_U16(sp + 5704); +goto L413b18;} +t9 = MEM_U16(sp + 5704); +t2 = MEM_U32(v0 + -4); +//nop; +if (t2 != t3) {t9 = MEM_U16(sp + 5704); +goto L413b18;} +t9 = MEM_U16(sp + 5704); +t1 = MEM_U32(s5 + 0); +//nop; +if (t1 == t3) {//nop; +goto L413b78;} +//nop; +t9 = MEM_U16(sp + 5704); +L413b18: +v0 = sp + 0x1650; +a0 = t9; +a3 = t9 + 0xffffffff; +//nop; +MEM_U32(sp + 244) = a3; +t9 = t9; +//nop; +func_40e07c(mem, sp, v0, a0); +goto L413b38; +//nop; +L413b38: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(sp + 244); +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40e07c(mem, sp, v0, a0); +goto L413b54; +//nop; +L413b54: +gp = MEM_U32(sp + 204); +a0 = MEM_U16(sp + 5704); +//nop; +v0 = sp + 0x1650; +t9 = t9; +a0 = a0 + 0xfffffffe; +func_40e07c(mem, sp, v0, a0); +goto L413b70; +a0 = a0 + 0xfffffffe; +L413b70: +gp = MEM_U32(sp + 204); +//nop; +L413b78: +a2 = MEM_U32(s3 + 0); +t4 = MEM_U16(sp + 5704); +if (a2 != 0) {s2 = t4 + 0xfffffffe; +goto L413bf0;} +s2 = t4 + 0xfffffffe; +t6 = MEM_U32(s6 + 0); +t5 = t4 << 2; +if (t6 != 0) {t7 = t5 + 0xfffffffc; +goto L413bf0;} +t7 = t5 + 0xfffffffc; +t8 = sp + 0x9c4; +t2 = t5 + 0xfffffff8; +v0 = t2 + t8; +s1 = t7 + t8; +t1 = MEM_U32(s1 + 0); +t3 = MEM_U32(v0 + 0); +t6 = MEM_U32(s4 + 0); +lo = t1 * t3; +hi = (uint32_t)((uint64_t)t1 * (uint64_t)t3 >> 32); +MEM_U32(v0 + 0) = zero; +MEM_U32(s1 + 0) = zero; +s3 = MEM_U32(s7 + 0); +MEM_U32(s4 + 0) = zero; +MEM_U16(sp + 5704) = (uint16_t)s2; +s7 = s7 + 0xfffffff8; +s4 = s4 + 0xfffffff8; +s5 = s5 + 0xfffffff8; +MEM_U32(s5 + 0) = zero; +MEM_U32(s7 + 0) = s3; +t9 = lo; +fp = t6 + t9; +MEM_U32(s4 + 0) = fp; +goto L40f4e4; +MEM_U32(s4 + 0) = fp; +L413bf0: +t4 = MEM_U16(sp + 5704); +if (a2 != 0) {a3 = t4 + 0xffffffff; +goto L413c38;} +a3 = t4 + 0xffffffff; +t7 = t4 << 2; +t2 = sp + 0x9c4; +t5 = t7 + 0xfffffffc; +s1 = t5 + t2; +t1 = t7 + t2; +t3 = MEM_U32(t1 + -8); +t8 = MEM_U32(s1 + 0); +t9 = MEM_U32(s4 + 0); +lo = t8 * t3; +hi = (uint32_t)((uint64_t)t8 * (uint64_t)t3 >> 32); +MEM_U32(s1 + 0) = zero; +MEM_U32(s4 + 0) = zero; +t6 = lo; +fp = t9 + t6; +//nop; +goto L413c90; +//nop; +L413c38: +t4 = MEM_U32(s6 + 0); +//nop; +if (t4 != 0) {//nop; +goto L413c88;} +//nop; +t5 = MEM_U16(sp + 5704); +t1 = sp + 0x9c4; +t7 = t5 << 2; +t2 = t7 + 0xfffffff8; +v0 = t2 + t1; +t8 = t7 + t1; +t3 = MEM_U32(t8 + -4); +t9 = MEM_U32(v0 + 0); +t4 = MEM_U32(s4 + 0); +lo = t3 * t9; +hi = (uint32_t)((uint64_t)t3 * (uint64_t)t9 >> 32); +MEM_U32(v0 + 0) = zero; +MEM_U32(s4 + 0) = zero; +t6 = lo; +fp = t4 + t6; +//nop; +goto L413c90; +//nop; +L413c88: +fp = MEM_U32(s4 + 0); +MEM_U32(s4 + 0) = zero; +L413c90: +//nop; +a0 = s2; +t9 = t9; +v0 = sp + 0x1650; +MEM_U32(sp + 244) = a3; +func_40e07c(mem, sp, v0, a0); +goto L413ca8; +MEM_U32(sp + 244) = a3; +L413ca8: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(sp + 244); +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40e07c(mem, sp, v0, a0); +goto L413cc4; +//nop; +L413cc4: +a2 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 204); +if (a2 != 0) {//nop; +goto L413cf4;} +//nop; +t5 = MEM_U16(sp + 5704); +t7 = sp + 0x9c4; +t2 = t5 << 2; +t1 = t2 + t7; +t8 = MEM_U32(t1 + -8); +at = 0x1; +if (t8 == at) {//nop; +goto L413d18;} +//nop; +L413cf4: +//nop; +a1 = MEM_U32(s6 + 0); +a0 = 0x5b; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L413d04; +a0 = 0x5b; +L413d04: +gp = MEM_U32(sp + 204); +MEM_U32(s6 + 0) = v0; +t3 = MEM_U16(sp + 458); +//nop; +MEM_U16(v0 + 34) = (uint16_t)t3; +L413d18: +s0 = MEM_U32(s7 + 0); +//nop; +if (s0 == 0) {//nop; +goto L413d48;} +//nop; +//nop; +a2 = MEM_U32(s6 + 0); +a0 = 0x1; +a1 = s0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L413d3c; +a1 = s0; +L413d3c: +gp = MEM_U32(sp + 204); +s3 = v0; +goto L413d50; +s3 = v0; +L413d48: +s3 = MEM_U32(s6 + 0); +//nop; +L413d50: +MEM_U16(sp + 5704) = (uint16_t)s2; +s7 = s7 + 0xfffffff8; +s4 = s4 + 0xfffffff8; +s5 = s5 + 0xfffffff8; +MEM_U32(s7 + 0) = s3; +MEM_U32(s4 + 0) = fp; +MEM_U32(s5 + 0) = zero; +goto L40f4e4; +MEM_U32(s5 + 0) = zero; +L413d70: +t9 = MEM_U16(sp + 5704); +t5 = sp + 0x1004; +s2 = t9 << 2; +//nop; +t6 = s2 + 0xfffffffc; +t1 = s2 + 0xfffffffc; +t8 = s2 + 0xfffffffc; +t2 = sp + 0x9c4; +t7 = sp + 0x384; +s5 = s2 + t7; +s0 = t8 + t7; +s4 = s2 + t2; +s1 = t1 + t2; +a0 = t6 + t5; +a1 = s2 + t5; +f_swap_tree(mem, sp, a0, a1); +goto L413db0; +a1 = s2 + t5; +L413db0: +gp = MEM_U32(sp + 204); +a0 = s1; +//nop; +a1 = s4; +//nop; +f_swap_int(mem, sp, a0, a1); +goto L413dc8; +//nop; +L413dc8: +gp = MEM_U32(sp + 204); +a0 = s0; +//nop; +a1 = s5; +//nop; +f_swap_int(mem, sp, a0, a1); +goto L413de0; +//nop; +L413de0: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L413dec: +t3 = MEM_U16(sp + 5704); +t6 = sp + 0x1004; +t9 = t3 << 2; +s7 = t9 + t6; +//nop; +a0 = MEM_U32(s7 + 0); +a3 = t3 + 0xffffffff; +t9 = t9; +MEM_U32(sp + 244) = a3; +v0 = sp + 0x1650; +v0 = func_40f138(mem, sp, a0); +goto L413e18; +v0 = sp + 0x1650; +L413e18: +gp = MEM_U32(sp + 204); +a3 = MEM_U32(sp + 244); +if (v0 != 0) {//nop; +goto L413e30;} +//nop; +MEM_U16(sp + 5704) = (uint16_t)a3; +goto L40f4e4; +MEM_U16(sp + 5704) = (uint16_t)a3; +L413e30: +//nop; +a0 = MEM_U16(sp + 5704); +t9 = t9; +v0 = sp + 0x1650; +MEM_U32(sp + 244) = a3; +func_40e07c(mem, sp, v0, a0); +goto L413e48; +MEM_U32(sp + 244) = a3; +L413e48: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s7 + 0); +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u1(mem, sp, a0, a1); +goto L413e60; +//nop; +L413e60: +a3 = MEM_U32(sp + 244); +gp = MEM_U32(sp + 204); +MEM_U16(sp + 5704) = (uint16_t)a3; +t1 = MEM_U8(v0 + 33); +a1 = MEM_U32(v0 + 0); +t2 = t1 & 0xff1f; +t5 = 0x7b; +v1 = t2 | 0x60; +MEM_U8(v0 + 32) = (uint8_t)t5; +MEM_U8(v0 + 33) = (uint8_t)v1; +MEM_U32(v0 + 44) = zero; +MEM_U32(v0 + 48) = zero; +t8 = MEM_U32(a1 + 40); +t6 = v1 << 27; +MEM_U32(v0 + 40) = t8; +t9 = MEM_U8(a1 + 33); +t3 = t6 >> 27; +t5 = t9 ^ t3; +t1 = t5 & 0x1f; +t2 = t1 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t2; +//nop; +t4 = MEM_U32(a1 + 36); +a0 = v0; +t9 = t9; +MEM_U32(v0 + 36) = t4; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L413ed0; +v0 = sp + 0x1650; +L413ed0: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L413edc: +a3 = MEM_U16(sp + 5704); +//nop; +a3 = a3 + 0xffffffff; +MEM_U16(sp + 5704) = (uint16_t)a3; +goto L40f4e4; +MEM_U16(sp + 5704) = (uint16_t)a3; +L413ef0: +t8 = MEM_U16(sp + 5704); +t7 = MEM_U32(sp + 452); +if (t8 == 0) {//nop; +goto L413f04;} +//nop; +abort(); +L413f04: +t9 = 0x1; +MEM_U8(sp + 387) = (uint8_t)t9; +t6 = MEM_U32(sp + 464); +//nop; +MEM_U32(sp + 476) = t7; +a0 = 0x400; +a1 = zero; +MEM_U32(sp + 472) = t6; +v0 = f_new(mem, sp, a0, a1); +goto L413f28; +MEM_U32(sp + 472) = t6; +L413f28: +gp = MEM_U32(sp + 204); +MEM_U32(sp + 452) = v0; +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L413f40; +//nop; +L413f40: +t3 = MEM_U16(v0 + 34); +gp = MEM_U32(sp + 204); +if (t3 != 0) {s3 = v0; +goto L413f60;} +s3 = v0; +t5 = MEM_U8(sp + 351); +//nop; +if (t5 == 0) {//nop; +goto L413f74;} +//nop; +L413f60: +t1 = MEM_U32(sp + 496); +at = 0x10018ea8; +t2 = t1 + 0x1; +MEM_U32(sp + 496) = t2; +MEM_U8(at + 0) = (uint8_t)zero; +L413f74: +//nop; +a0 = s3; +t9 = t9; +v0 = sp + 0x1650; +func_40dff0(mem, sp, v0, a0); +goto L413f88; +v0 = sp + 0x1650; +L413f88: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L413f94: +t4 = MEM_U32(sp + 460); +MEM_U32(sp + 352) = t4; +goto L40f4e4; +MEM_U32(sp + 352) = t4; +L413fa0: +t8 = MEM_U32(sp + 352); +//nop; +a0 = sp + 0x1c8; +MEM_U32(sp + 460) = t8; +v0 = f_build_u(mem, sp, a0); +goto L413fb4; +MEM_U32(sp + 460) = t8; +L413fb4: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L413fd0; +//nop; +L413fd0: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L413fdc: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L413fec; +//nop; +L413fec: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L414008; +//nop; +L414008: +t7 = MEM_U32(sp + 460); +t6 = MEM_U16(sp + 458); +gp = MEM_U32(sp + 204); +at = 0x3; +if (t6 != at) {MEM_U32(sp + 344) = t7; +goto L40f4e4;} +MEM_U32(sp + 344) = t7; +t9 = MEM_U32(sp + 460); +at = 0x10018e64; +MEM_U32(at + 0) = t9; +goto L40f4e4; +MEM_U32(at + 0) = t9; +L414030: +//nop; +a0 = sp + 0x1c8; +//nop; +v0 = f_build_u(mem, sp, a0); +goto L414040; +//nop; +L414040: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +v0 = sp + 0x1650; +t9 = t9; +//nop; +func_40dff0(mem, sp, v0, a0); +goto L41405c; +//nop; +L41405c: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L414068: +t3 = 0x10007904; +a0 = 0x4; +t3 = t3; +t1 = t3 + 0x48; +a1 = 0xa42; +t2 = sp; +L414080: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t2 = t2 + 0xc; +MEM_U8(t2 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t2) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t2 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 4 + 3) = (uint8_t)(at >> 0); +if (t3 != t1) {//swr $at, 7($t2) +goto L414080;} +//swr $at, 7($t2) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t4 = 0x100078b4; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +t1 = t3 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t3) +t4 = t4; +MEM_U8(t2 + 12 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t2 + 12 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t2 + 12 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t2 + 12 + 3) = (uint8_t)(t1 >> 0); +t7 = t4 + 0x48; +t6 = sp; +//swr $t1, 0xf($t2) +L4140f0: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t6 = t6 + 0xc; +MEM_U8(t6 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t6) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t6 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t7) {//swr $at, 0x57($t6) +goto L4140f0;} +//swr $at, 0x57($t6) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +t7 = t4 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t4) +//nop; +MEM_U8(t6 + 92 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t6 + 92 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t6 + 92 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t6 + 92 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x5f($t6) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L41416c; +//nop; +L41416c: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L414178: +t9 = 0x10007864; +a0 = 0x4; +t9 = t9; +t1 = t9 + 0x48; +a1 = 0xa4a; +t3 = sp; +L414190: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t3 = t3 + 0xc; +MEM_U8(t3 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t3) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t3 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 4 + 3) = (uint8_t)(at >> 0); +if (t9 != t1) {//swr $at, 7($t3) +goto L414190;} +//swr $at, 7($t3) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t2 = 0x10007814; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +t1 = t9 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t9) +t2 = t2; +MEM_U8(t3 + 12 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t3 + 12 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t3 + 12 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t3 + 12 + 3) = (uint8_t)(t1 >> 0); +t7 = t2 + 0x48; +t4 = sp; +//swr $t1, 0xf($t3) +L414200: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t4 = t4 + 0xc; +MEM_U8(t4 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t4) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t4 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 84 + 3) = (uint8_t)(at >> 0); +if (t2 != t7) {//swr $at, 0x57($t4) +goto L414200;} +//swr $at, 0x57($t4) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +//nop; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +t7 = t2 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t2) +//nop; +MEM_U8(t4 + 92 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t4 + 92 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t4 + 92 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t4 + 92 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x5f($t4) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L41427c; +//nop; +L41427c: +gp = MEM_U32(sp + 204); +a1 = sp + 0x1c8; +//nop; +a0 = 0x10006560; +//nop; +f_print_ucode(mem, sp, a0, a1); +goto L414294; +//nop; +L414294: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10006560; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L4142b0; +//nop; +L4142b0: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10006560; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_fflush(mem, a0); +goto L4142cc; +//nop; +L4142cc: +gp = MEM_U32(sp + 204); +//nop; +goto L40f4e4; +//nop; +L4142d8: +ra = MEM_U32(sp + 212); +L4142dc: +s0 = MEM_U32(sp + 172); +s1 = MEM_U32(sp + 176); +s2 = MEM_U32(sp + 180); +s3 = MEM_U32(sp + 184); +s4 = MEM_U32(sp + 188); +s5 = MEM_U32(sp + 192); +s6 = MEM_U32(sp + 196); +s7 = MEM_U32(sp + 200); +fp = MEM_U32(sp + 208); +sp = sp + 0x1650; +return v0; +sp = sp + 0x1650; +//nop; +//nop; +} + +static void f_save_i_ptrs(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L414310: +//save_i_ptrs: +//nop; +//nop; +//nop; +t6 = 0x10018e70; +at = 0x10018e74; +t6 = MEM_U32(t6 + 0); +t7 = 0x10018e78; +MEM_U32(at + 0) = t6; +at = 0x10018e7c; +t7 = MEM_U32(t7 + 0); +MEM_U32(at + 0) = t7; +return; +MEM_U32(at + 0) = t7; +} + +static void f_restore_i_ptrs(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L414340: +//restore_i_ptrs: +//nop; +//nop; +//nop; +v0 = 0x10018e74; +t9 = 0x10018e70; +sp = sp + 0xffffffe0; +t6 = 0x10018e6c; +v0 = MEM_U32(v0 + 0); +t9 = MEM_U32(t9 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t7 = MEM_U32(t6 + 0); +a2 = t9 - v0; +//nop; +t8 = v0 << 4; +t0 = a2 << 4; +a0 = t7 + t8; +a0 = a0 + 0xfffffff0; +a2 = t0; +a1 = zero; +v0 = wrapper_memset(mem, a0, a1, a2); +goto L414394; +a1 = zero; +L414394: +gp = MEM_U32(sp + 24); +a1 = zero; +v0 = 0x10018e78; +t4 = 0x10018e7c; +t1 = 0x10018e6c; +v0 = MEM_U32(v0 + 0); +t4 = MEM_U32(t4 + 0); +t2 = MEM_U32(t1 + 0); +//nop; +t3 = v0 << 4; +a2 = t4 - v0; +t5 = a2 << 4; +a0 = t2 + t3; +a0 = a0 + 0xfffffff0; +a2 = t5 + 0x10; +v0 = wrapper_memset(mem, a0, a1, a2); +goto L4143d4; +a2 = t5 + 0x10; +L4143d4: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +t6 = 0x10018e74; +at = 0x10018e70; +t6 = MEM_U32(t6 + 0); +t7 = 0x10018e7c; +MEM_U32(at + 0) = t6; +at = 0x10018e78; +t7 = MEM_U32(t7 + 0); +sp = sp + 0x20; +MEM_U32(at + 0) = t7; +return; +MEM_U32(at + 0) = t7; +} + +static void f_init_ibuffer(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L414404: +//init_ibuffer: +//nop; +//nop; +//nop; +v0 = 0x10018e68; +t6 = 0xfde8; +MEM_U32(v0 + 0) = t6; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 180) = ra; +a0 = t6 << 4; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 188) = a0; +v0 = wrapper_malloc(mem, a0); +goto L414438; +MEM_U32(sp + 188) = a0; +L414438: +gp = MEM_U32(sp + 176); +a2 = MEM_U32(sp + 188); +v1 = 0x10018e6c; +a1 = zero; +MEM_U32(v1 + 0) = v0; +//nop; +a0 = MEM_U32(v1 + 0); +//nop; +v0 = wrapper_memset(mem, a0, a1, a2); +goto L41445c; +//nop; +L41445c: +gp = MEM_U32(sp + 176); +a0 = 0x4; +t8 = 0x10018e6c; +a1 = 0x60; +t9 = MEM_U32(t8 + 0); +t7 = sp; +if (t9 != 0) {//nop; +goto L41457c;} +//nop; +t0 = 0x10007fb0; +t3 = sp; +t0 = t0; +t2 = t0 + 0x48; +L41448c: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 4 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 7($t3) +goto L41448c;} +//swr $at, 7($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t4 = 0x10007f60; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +t4 = t4; +MEM_U8(t3 + 12 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 12 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 12 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 12 + 3) = (uint8_t)(t2 >> 0); +t6 = t4 + 0x48; +//swr $t2, 0xf($t3) +L4144f8: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 0x57($t7) +goto L4144f8;} +//swr $at, 0x57($t7) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L414574; +//nop; +L414574: +gp = MEM_U32(sp + 176); +//nop; +L41457c: +at = 0x10018e70; +t9 = 0x10018e68; +t8 = 0x1; +MEM_U32(at + 0) = t8; +at = 0x10018e78; +ra = MEM_U32(sp + 180); +t9 = MEM_U32(t9 + 0); +sp = sp + 0xc0; +MEM_U32(at + 0) = t9; +return; +MEM_U32(at + 0) = t9; +} + +static void f_grow_ibuffer(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4145a4: +//grow_ibuffer: +//nop; +//nop; +//nop; +v0 = 0x10018e68; +sp = sp + 0xffffff20; +v0 = MEM_U32(v0 + 0); +//nop; +t6 = v0 << 1; +MEM_U32(sp + 180) = ra; +a2 = t6 << 4; +MEM_U32(sp + 176) = gp; +a0 = a2; +MEM_U32(sp + 188) = a2; +MEM_U32(sp + 208) = t6; +v0 = wrapper_malloc(mem, a0); +goto L4145e0; +MEM_U32(sp + 208) = t6; +L4145e0: +gp = MEM_U32(sp + 176); +a2 = MEM_U32(sp + 188); +//nop; +a0 = v0; +a1 = zero; +MEM_U32(sp + 212) = v0; +v0 = wrapper_memset(mem, a0, a1, a2); +goto L4145fc; +MEM_U32(sp + 212) = v0; +L4145fc: +t3 = MEM_U32(sp + 212); +gp = MEM_U32(sp + 176); +if (t3 != 0) {a0 = 0x4; +goto L414718;} +a0 = 0x4; +t7 = 0x10008050; +a1 = 0x70; +t7 = t7; +t9 = t7 + 0x48; +t5 = sp; +L414620: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t5 = t5 + 0xc; +MEM_U8(t5 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t5) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t5 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t9) {//swr $at, 7($t5) +goto L414620;} +//swr $at, 7($t5) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t6 = 0x10008000; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +t9 = t7 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t7) +t6 = t6; +MEM_U8(t5 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t5 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t5 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t5 + 12 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0xf($t5) +t9 = t6 + 0x48; +t7 = sp; +L414690: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t6 != t9) {//swr $at, 0x57($t7) +goto L414690;} +//swr $at, 0x57($t7) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t9 = t6 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t6) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +MEM_U32(sp + 212) = t3; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L41470c; +MEM_U32(sp + 212) = t3; +L41470c: +gp = MEM_U32(sp + 176); +t3 = MEM_U32(sp + 212); +//nop; +L414718: +t1 = 0x10018e70; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {t1 = t1 + 0x1; +goto L41487c;} +t1 = t1 + 0x1; +a2 = t1 + 0xffffffff; +t5 = a2 & 0x3; +if (t5 == 0) {a0 = 0x1; +goto L414794;} +a0 = 0x1; +v1 = a0 << 4; +v0 = t3 + v1; +a2 = 0x10018e6c; +v0 = v0 + 0xfffffff0; +a1 = t5 + 0x1; +L414754: +t8 = MEM_U32(a2 + 0); +a0 = a0 + 0x1; +t9 = t8 + v1; +at = MEM_U32(t9 + -16); +v1 = v1 + 0x10; +MEM_U32(v0 + 0) = at; +t7 = MEM_U32(t9 + -12); +v0 = v0 + 0x10; +MEM_U32(v0 + -12) = t7; +at = MEM_U32(t9 + -8); +//nop; +MEM_U32(v0 + -8) = at; +t7 = MEM_U32(t9 + -4); +if (a1 != a0) {MEM_U32(v0 + -4) = t7; +goto L414754;} +MEM_U32(v0 + -4) = t7; +if (a0 == t1) {v1 = a0 << 4; +goto L41487c;} +L414794: +v1 = a0 << 4; +a1 = t3 + v1; +a2 = 0x10018e6c; +v0 = a1 + 0xfffffff0; +a3 = a1 + 0x10; +t0 = a1 + 0x20; +t2 = t1 << 4; +L4147b0: +t5 = MEM_U32(a2 + 0); +t7 = MEM_U32(a2 + 0); +t8 = t5 + v1; +at = MEM_U32(t8 + -16); +t5 = t7 + v1; +MEM_U32(v0 + 0) = at; +t9 = MEM_U32(t8 + -12); +a1 = a1 + 0x40; +MEM_U32(v0 + 4) = t9; +at = MEM_U32(t8 + -8); +v0 = v0 + 0x40; +MEM_U32(v0 + -56) = at; +t9 = MEM_U32(t8 + -4); +a3 = a3 + 0x40; +MEM_U32(v0 + -52) = t9; +at = MEM_U32(t5 + 0); +t9 = MEM_U32(a2 + 0); +MEM_U32(a1 + -64) = at; +t8 = MEM_U32(t5 + 4); +t7 = t9 + v1; +MEM_U32(a1 + -60) = t8; +at = MEM_U32(t5 + 8); +t0 = t0 + 0x40; +MEM_U32(a1 + -56) = at; +t8 = MEM_U32(t5 + 12); +//nop; +MEM_U32(a1 + -52) = t8; +at = MEM_U32(t7 + 16); +t8 = MEM_U32(a2 + 0); +MEM_U32(a3 + -64) = at; +t5 = MEM_U32(t7 + 20); +t9 = t8 + v1; +MEM_U32(a3 + -60) = t5; +at = MEM_U32(t7 + 24); +v1 = v1 + 0x40; +MEM_U32(a3 + -56) = at; +t5 = MEM_U32(t7 + 28); +//nop; +MEM_U32(a3 + -52) = t5; +at = MEM_U32(t9 + 32); +//nop; +MEM_U32(t0 + -64) = at; +t7 = MEM_U32(t9 + 36); +//nop; +MEM_U32(t0 + -60) = t7; +at = MEM_U32(t9 + 40); +//nop; +MEM_U32(t0 + -56) = at; +t7 = MEM_U32(t9 + 44); +if (v1 != t2) {MEM_U32(t0 + -52) = t7; +goto L4147b0;} +MEM_U32(t0 + -52) = t7; +L41487c: +t4 = 0x10018e78; +t1 = 0x10018e68; +t0 = MEM_U32(t4 + 0); +t1 = MEM_U32(t1 + 0); +a2 = 0x10018e6c; +a1 = MEM_U32(sp + 208); +at = t1 < t0; +if (at != 0) {t0 = t0 + 0xffffffff; +goto L4149e8;} +t0 = t0 + 0xffffffff; +t2 = t1 - t0; +t5 = t2 & 0x3; +t2 = -t5; +if (t2 == 0) {a0 = t1; +goto L414908;} +a0 = t1; +t8 = a1 << 4; +v0 = t3 + t8; +v0 = v0 + 0xfffffff0; +a3 = t2 + t1; +v1 = t1 << 4; +L4148c8: +t6 = MEM_U32(a2 + 0); +a0 = a0 + 0xffffffff; +t9 = t6 + v1; +at = MEM_U32(t9 + -16); +v1 = v1 + 0xfffffff0; +MEM_U32(v0 + 0) = at; +t5 = MEM_U32(t9 + -12); +a1 = a1 + 0xffffffff; +MEM_U32(v0 + 4) = t5; +at = MEM_U32(t9 + -8); +v0 = v0 + 0xfffffff0; +MEM_U32(v0 + 24) = at; +t5 = MEM_U32(t9 + -4); +if (a3 != a0) {MEM_U32(v0 + 28) = t5; +goto L4148c8;} +MEM_U32(v0 + 28) = t5; +if (a0 == t0) {t8 = a1 << 4; +goto L4149e8;} +L414908: +t8 = a1 << 4; +v0 = t3 + t8; +v0 = v0 + 0xfffffff0; +v1 = a0 << 4; +a3 = t0 << 4; +L41491c: +t6 = MEM_U32(a2 + 0); +t8 = MEM_U32(a2 + 0); +t7 = t6 + v1; +at = MEM_U32(t7 + -16); +t6 = t8 + v1; +MEM_U32(v0 + 0) = at; +t5 = MEM_U32(t7 + -12); +a1 = a1 + 0xfffffffc; +MEM_U32(v0 + 4) = t5; +at = MEM_U32(t7 + -8); +v0 = v0 + 0xffffffc0; +MEM_U32(v0 + 72) = at; +t5 = MEM_U32(t7 + -4); +//nop; +MEM_U32(v0 + 76) = t5; +at = MEM_U32(t6 + -32); +t5 = MEM_U32(a2 + 0); +MEM_U32(v0 + 48) = at; +t7 = MEM_U32(t6 + -28); +t8 = t5 + v1; +MEM_U32(v0 + 52) = t7; +at = MEM_U32(t6 + -24); +//nop; +MEM_U32(v0 + 56) = at; +t7 = MEM_U32(t6 + -20); +//nop; +MEM_U32(v0 + 60) = t7; +at = MEM_U32(t8 + -48); +t7 = MEM_U32(a2 + 0); +MEM_U32(v0 + 32) = at; +t6 = MEM_U32(t8 + -44); +t5 = t7 + v1; +MEM_U32(v0 + 36) = t6; +at = MEM_U32(t8 + -40); +v1 = v1 + 0xffffffc0; +MEM_U32(v0 + 40) = at; +t6 = MEM_U32(t8 + -36); +//nop; +MEM_U32(v0 + 44) = t6; +at = MEM_U32(t5 + -64); +//nop; +MEM_U32(v0 + 16) = at; +t8 = MEM_U32(t5 + -60); +//nop; +MEM_U32(v0 + 20) = t8; +at = MEM_U32(t5 + -56); +//nop; +MEM_U32(v0 + 24) = at; +t8 = MEM_U32(t5 + -52); +if (v1 != a3) {MEM_U32(v0 + 28) = t8; +goto L41491c;} +MEM_U32(v0 + 28) = t8; +L4149e8: +//nop; +a1 = a1 + 0x1; +a0 = MEM_U32(a2 + 0); +MEM_U32(sp + 216) = a1; +MEM_U32(sp + 212) = t3; +wrapper_free(mem, a0); +goto L414a00; +MEM_U32(sp + 212) = t3; +L414a00: +gp = MEM_U32(sp + 176); +t3 = MEM_U32(sp + 212); +a2 = 0x10018e6c; +t6 = MEM_U32(sp + 208); +at = 0x10018e68; +v0 = 0x10018e7c; +MEM_U32(a2 + 0) = t3; +t4 = 0x10018e78; +MEM_U32(at + 0) = t6; +a1 = MEM_U32(sp + 216); +t7 = MEM_U32(v0 + 0); +t5 = MEM_U32(t4 + 0); +ra = MEM_U32(sp + 180); +t9 = t7 + a1; +t8 = t9 - t5; +sp = sp + 0xe0; +MEM_U32(v0 + 0) = t8; +MEM_U32(t4 + 0) = a1; +return; +MEM_U32(t4 + 0) = a1; +} + +static uint32_t f_create_local_label(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L414a4c: +//create_local_label: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 180) = ra; +if (a0 == 0) {MEM_U32(sp + 176) = gp; +goto L414a7c;} +MEM_U32(sp + 176) = gp; +at = 0x7fff0000; +at = at | 0xffff; +at = (int)a0 < (int)at; +if (at != 0) {//nop; +goto L414b90;} +//nop; +L414a7c: +t6 = 0x100080f0; +a0 = 0x4; +t6 = t6; +t8 = t6 + 0x48; +a1 = 0x86; +t9 = sp; +L414a94: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 7($t9) +goto L414a94;} +//swr $at, 7($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t0 = 0x100080a0; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +t0 = t0; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t0 + 0x48; +t3 = sp; +//swr $t8, 0xf($t9) +L414b04: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 0x57($t3) +goto L414b04;} +//swr $at, 0x57($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L414b80; +//nop; +L414b80: +gp = MEM_U32(sp + 176); +v0 = MEM_U32(sp + 188); +//nop; +goto L414b98; +//nop; +L414b90: +v0 = -a0; +goto L414b98; +v0 = -a0; +L414b98: +ra = MEM_U32(sp + 180); +sp = sp + 0xc0; +//nop; +return v0; +//nop; +} + +static void f_emit_vers(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L414ba8: +//emit_vers: +//nop; +//nop; +//nop; +a0 = 0x10018e78; +v1 = 0x10018e6c; +t7 = MEM_U32(a0 + 0); +t6 = MEM_U32(v1 + 0); +t8 = t7 << 4; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +t2 = 0x3; +t0 = t9 & 0xffc0; +t1 = t0 | 0x2a; +MEM_U8(v0 + -11) = (uint8_t)t1; +t4 = MEM_U32(a0 + 0); +t3 = MEM_U32(v1 + 0); +t5 = t4 << 4; +t7 = t3 + t5; +MEM_U32(t7 + -8) = t2; +t9 = MEM_U32(a0 + 0); +t8 = MEM_U32(v1 + 0); +t0 = t9 << 4; +t6 = 0x13; +t1 = t8 + t0; +MEM_U32(t1 + -4) = t6; +t4 = MEM_U32(a0 + 0); +v0 = v0 + 0xfffffff0; +t3 = t4 + 0xffffffff; +MEM_U32(a0 + 0) = t3; +return; +MEM_U32(a0 + 0) = t3; +} + +static void f_emit_rob(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L414c20: +//emit_rob: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t0 = 0x10018e70; +t1 = 0x10018e6c; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(t1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t3 = t9 & 0xffc0; +t4 = t3 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t4; +t7 = MEM_U32(t0 + 0); +t5 = MEM_U32(t1 + 0); +t6 = t7 << 4; +v0 = t5 + t6; +t2 = MEM_U16(v0 + -10); +t8 = MEM_U16(sp + 42); +t9 = t2 << 22; +t3 = t9 >> 23; +t4 = t8 ^ t3; +t7 = t4 << 23; +t5 = t7 >> 22; +t6 = t5 ^ t2; +MEM_U16(v0 + -10) = (uint16_t)t6; +t8 = MEM_U32(t0 + 0); +t9 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t8 << 4; +v0 = t9 + t3; +t4 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t7 = t4 & at; +MEM_U32(v0 + -8) = t7; +t6 = MEM_U32(t0 + 0); +t5 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t8 = t6 << 4; +v0 = t5 + t8; +v1 = MEM_U32(v0 + -8); +t9 = MEM_U8(sp + 47); +t3 = v1 >> 25; +t4 = t9 ^ t3; +t7 = t4 << 25; +t6 = t7 ^ v1; +MEM_U32(v0 + -8) = t6; +t8 = MEM_U32(t0 + 0); +t5 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t9 = t8 << 4; +v0 = t5 + t9; +v1 = MEM_U32(v0 + -8); +t3 = MEM_U8(sp + 55); +t4 = v1 << 7; +t7 = t4 >> 25; +t6 = t3 ^ t7; +t8 = t6 << 25; +t5 = t8 >> 7; +t9 = t5 ^ v1; +MEM_U32(v0 + -8) = t9; +t3 = MEM_U32(t0 + 0); +t4 = MEM_U32(t1 + 0); +t7 = t3 << 4; +t6 = t4 + t7; +MEM_U32(t6 + -16) = zero; +t5 = MEM_U32(t0 + 0); +t8 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t9 = t5 << 4; +v0 = t8 + t9; +v1 = MEM_U32(v0 + -8); +t3 = MEM_U32(sp + 56); +t4 = v1 << 18; +t7 = t4 >> 18; +t6 = t3 ^ t7; +t5 = t6 & 0x3fff; +t8 = t5 ^ v1; +MEM_U32(v0 + -8) = t8; +t3 = MEM_U32(t0 + 0); +t4 = MEM_U32(t1 + 0); +t9 = MEM_U32(sp + 48); +t7 = t3 << 4; +t6 = t4 + t7; +MEM_U32(t6 + -4) = t9; +t8 = MEM_U32(t0 + 0); +t5 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t8 << 4; +v0 = t5 + t3; +t4 = MEM_U32(v0 + -12); +at = 0xfe3f0000; +at = at | 0xffff; +t7 = t4 & at; +t9 = 0x10018e78; +MEM_U32(v0 + -12) = t7; +v1 = MEM_U32(t0 + 0); +t9 = MEM_U32(t9 + 0); +v0 = v0 + 0xfffffff0; +if (t9 != v1) {//nop; +goto L414e04;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L414dec; +//nop; +L414dec: +gp = MEM_U32(sp + 32); +//nop; +t0 = 0x10018e70; +//nop; +v1 = MEM_U32(t0 + 0); +//nop; +L414e04: +t8 = 0x10018ed4; +t6 = v1 + 0x1; +MEM_U32(t0 + 0) = t6; +t8 = MEM_U8(t8 + 0); +a2 = 0xa; +if (t8 == 0) {a3 = 0xa; +goto L414f44;} +a3 = 0xa; +a0 = 0x10006570; +a1 = 0x10008140; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L414e38; +a1 = a1; +L414e38: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 42); +s0 = 0x10006570; +a2 = 0x100016f0; +//nop; +s0 = MEM_U32(s0 + 0); +t5 = 0xa; +MEM_U32(sp + 16) = t5; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L414e68; +a0 = s0; +L414e68: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L414e84; +a3 = 0xa; +L414e84: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t3 = 0xa; +MEM_U32(sp + 16) = t3; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L414eac; +a2 = a2; +L414eac: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +//nop; +a0 = s0; +a2 = 0xc; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L414ec8; +a3 = 0xa; +L414ec8: +gp = MEM_U32(sp + 32); +a1 = 0x20; +s0 = 0x10006570; +//nop; +s0 = MEM_U32(s0 + 0); +a2 = 0x1; +a3 = 0xa; +a0 = s0; +f_write_char(mem, sp, a0, a1, a2); +goto L414eec; +a0 = s0; +L414eec: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 55); +a2 = 0x1000258c; +//nop; +t4 = 0xa; +MEM_U32(sp + 16) = t4; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L414f14; +a2 = a2; +L414f14: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L414f2c; +//nop; +L414f2c: +t7 = MEM_U16(sp + 42); +t9 = 0x1ad; +gp = MEM_U32(sp + 32); +if (t7 != t9) {//nop; +goto L414f44;} +//nop; +abort(); +L414f44: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_rab(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L414f54: +//emit_rab: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t0 = 0x10018e70; +t1 = 0x10018e6c; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(t1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t3 = t9 & 0xffc0; +t4 = t3 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t4; +t7 = MEM_U32(t0 + 0); +t5 = MEM_U32(t1 + 0); +t6 = t7 << 4; +v0 = t5 + t6; +t2 = MEM_U16(v0 + -10); +t8 = MEM_U16(sp + 42); +t9 = t2 << 22; +t3 = t9 >> 23; +t4 = t8 ^ t3; +t7 = t4 << 23; +t5 = t7 >> 22; +t6 = t5 ^ t2; +MEM_U16(v0 + -10) = (uint16_t)t6; +t8 = MEM_U32(t0 + 0); +t9 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t8 << 4; +v0 = t9 + t3; +t4 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t7 = t4 & at; +MEM_U32(v0 + -8) = t7; +t6 = MEM_U32(t0 + 0); +t5 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t8 = t6 << 4; +v0 = t5 + t8; +v1 = MEM_U32(v0 + -8); +t9 = MEM_U8(sp + 47); +t3 = v1 >> 25; +t4 = t9 ^ t3; +t7 = t4 << 25; +t6 = t7 ^ v1; +MEM_U32(v0 + -8) = t6; +t8 = MEM_U32(t0 + 0); +t5 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t9 = t8 << 4; +v0 = t5 + t9; +v1 = MEM_U32(v0 + -8); +t3 = MEM_U8(sp + 59); +t4 = v1 << 7; +t7 = t4 >> 25; +t6 = t3 ^ t7; +t8 = t6 << 25; +t5 = t8 >> 7; +t9 = t5 ^ v1; +MEM_U32(v0 + -8) = t9; +t3 = MEM_U32(t0 + 0); +t4 = MEM_U32(t1 + 0); +t7 = t3 << 4; +t6 = t4 + t7; +MEM_U32(t6 + -16) = a3; +t5 = MEM_U32(t0 + 0); +t8 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t9 = t5 << 4; +v0 = t8 + t9; +v1 = MEM_U32(v0 + -8); +t3 = MEM_U32(sp + 60); +t4 = v1 << 18; +t7 = t4 >> 18; +t6 = t3 ^ t7; +t5 = t6 & 0x3fff; +t8 = t5 ^ v1; +MEM_U32(v0 + -8) = t8; +t3 = MEM_U32(t0 + 0); +t4 = MEM_U32(t1 + 0); +t9 = MEM_U32(sp + 48); +t7 = t3 << 4; +t6 = t4 + t7; +MEM_U32(t6 + -4) = t9; +t8 = MEM_U32(t0 + 0); +t5 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t8 << 4; +v0 = t5 + t3; +t4 = MEM_U32(v0 + -12); +at = 0xfe3f0000; +at = at | 0xffff; +t7 = t4 & at; +t9 = 0x10018e78; +MEM_U32(v0 + -12) = t7; +v1 = MEM_U32(t0 + 0); +t9 = MEM_U32(t9 + 0); +v0 = v0 + 0xfffffff0; +if (t9 != v1) {//nop; +goto L415134;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41511c; +//nop; +L41511c: +gp = MEM_U32(sp + 32); +//nop; +t0 = 0x10018e70; +//nop; +v1 = MEM_U32(t0 + 0); +//nop; +L415134: +t8 = 0x10018ed4; +t6 = v1 + 0x1; +MEM_U32(t0 + 0) = t6; +t8 = MEM_U8(t8 + 0); +a2 = 0xa; +if (t8 == 0) {a3 = 0xa; +goto L415274;} +a3 = 0xa; +a0 = 0x10006570; +a1 = 0x1000814a; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L415168; +a1 = a1; +L415168: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 42); +s0 = 0x10006570; +a2 = 0x100016f0; +//nop; +s0 = MEM_U32(s0 + 0); +t5 = 0xa; +MEM_U32(sp + 16) = t5; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L415198; +a0 = s0; +L415198: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L4151b4; +a3 = 0xa; +L4151b4: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t3 = 0xa; +MEM_U32(sp + 16) = t3; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L4151dc; +a2 = a2; +L4151dc: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +//nop; +a0 = s0; +a2 = 0xc; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L4151f8; +a3 = 0xa; +L4151f8: +gp = MEM_U32(sp + 32); +a1 = 0x20; +s0 = 0x10006570; +//nop; +s0 = MEM_U32(s0 + 0); +a2 = 0x1; +a3 = 0xa; +a0 = s0; +f_write_char(mem, sp, a0, a1, a2); +goto L41521c; +a0 = s0; +L41521c: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 59); +a2 = 0x1000258c; +//nop; +t4 = 0xa; +MEM_U32(sp + 16) = t4; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L415244; +a2 = a2; +L415244: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L41525c; +//nop; +L41525c: +t7 = MEM_U16(sp + 42); +t9 = 0x1ad; +gp = MEM_U32(sp + 32); +if (t7 != t9) {//nop; +goto L415274;} +//nop; +abort(); +L415274: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_rrab(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L415284: +//emit_rrab: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t0 = 0x10018e70; +t1 = 0x10018e6c; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(t1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t3 = t9 & 0xffc0; +t4 = t3 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t4; +t7 = MEM_U32(t0 + 0); +t5 = MEM_U32(t1 + 0); +t6 = t7 << 4; +v0 = t5 + t6; +t2 = MEM_U16(v0 + -10); +t8 = MEM_U16(sp + 42); +t9 = t2 << 22; +t3 = t9 >> 23; +t4 = t8 ^ t3; +t7 = t4 << 23; +t5 = t7 >> 22; +t6 = t5 ^ t2; +MEM_U16(v0 + -10) = (uint16_t)t6; +t8 = MEM_U32(t0 + 0); +t9 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t8 << 4; +v0 = t9 + t3; +t4 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t7 = t4 & at; +t5 = t7 | 0x4000; +MEM_U32(v0 + -8) = t5; +t8 = MEM_U32(t0 + 0); +t6 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t9 = t8 << 4; +v0 = t6 + t9; +v1 = MEM_U32(v0 + -8); +t3 = MEM_U8(sp + 47); +t4 = v1 >> 25; +t7 = t3 ^ t4; +t5 = t7 << 25; +t8 = t5 ^ v1; +MEM_U32(v0 + -8) = t8; +t9 = MEM_U32(t0 + 0); +t6 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t9 << 4; +v0 = t6 + t3; +v1 = MEM_U32(v0 + -8); +t4 = MEM_U8(sp + 59); +t7 = v1 << 7; +t5 = t7 >> 25; +t8 = t4 ^ t5; +t9 = t8 << 25; +t6 = t9 >> 7; +t3 = t6 ^ v1; +MEM_U32(v0 + -8) = t3; +t4 = MEM_U32(t0 + 0); +t7 = MEM_U32(t1 + 0); +t5 = t4 << 4; +t8 = t7 + t5; +MEM_U32(t8 + -16) = a3; +t6 = MEM_U32(t0 + 0); +t9 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t6 << 4; +v0 = t9 + t3; +t4 = MEM_U32(v0 + -8); +at = 0xffffc000; +t7 = t4 & at; +MEM_U32(v0 + -8) = t7; +t6 = MEM_U32(t0 + 0); +t8 = MEM_U32(t1 + 0); +t5 = MEM_U32(sp + 48); +t9 = t6 << 4; +t3 = t8 + t9; +MEM_U32(t3 + -4) = t5; +t7 = MEM_U32(t0 + 0); +t4 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t6 = t7 << 4; +v0 = t4 + t6; +t8 = MEM_U32(v0 + -12); +at = 0xfe3f0000; +at = at | 0xffff; +t9 = t8 & at; +at = 0x1800000; +t5 = t9 | at; +t3 = 0x10018e78; +MEM_U32(v0 + -12) = t5; +v1 = MEM_U32(t0 + 0); +t3 = MEM_U32(t3 + 0); +v0 = v0 + 0xfffffff0; +if (t3 != v1) {//nop; +goto L415460;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L415448; +//nop; +L415448: +gp = MEM_U32(sp + 32); +//nop; +t0 = 0x10018e70; +//nop; +v1 = MEM_U32(t0 + 0); +//nop; +L415460: +t4 = 0x10018ed4; +t7 = v1 + 0x1; +MEM_U32(t0 + 0) = t7; +t4 = MEM_U8(t4 + 0); +a2 = 0xa; +if (t4 == 0) {a3 = 0xa; +goto L415590;} +a3 = 0xa; +a0 = 0x10006570; +a1 = 0x10008154; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L415494; +a1 = a1; +L415494: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 42); +s0 = 0x10006570; +a2 = 0x100016f0; +//nop; +s0 = MEM_U32(s0 + 0); +t6 = 0xa; +MEM_U32(sp + 16) = t6; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L4154c4; +a0 = s0; +L4154c4: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L4154e0; +a3 = 0xa; +L4154e0: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t8 = 0xa; +MEM_U32(sp + 16) = t8; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L415508; +a2 = a2; +L415508: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +//nop; +a0 = s0; +a2 = 0xc; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L415524; +a3 = 0xa; +L415524: +gp = MEM_U32(sp + 32); +a1 = 0x20; +s0 = 0x10006570; +//nop; +s0 = MEM_U32(s0 + 0); +a2 = 0x1; +a3 = 0xa; +a0 = s0; +f_write_char(mem, sp, a0, a1, a2); +goto L415548; +a0 = s0; +L415548: +gp = MEM_U32(sp + 32); +t9 = 0xa; +MEM_U32(sp + 16) = t9; +//nop; +a2 = 0x1000258c; +a1 = MEM_U8(sp + 59); +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L415570; +a2 = a2; +L415570: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L415588; +//nop; +L415588: +gp = MEM_U32(sp + 32); +//nop; +L415590: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_rllb(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4155a0: +//emit_rllb: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t0 = 0x10018e70; +t1 = 0x10018e6c; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(t1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v1 = t6 + t8; +t9 = MEM_U8(v1 + -11); +v1 = v1 + 0xfffffff0; +t3 = t9 & 0xffc0; +t4 = t3 | 0x17; +MEM_U8(v1 + 5) = (uint8_t)t4; +t7 = MEM_U32(t0 + 0); +t5 = MEM_U32(t1 + 0); +t6 = t7 << 4; +v1 = t5 + t6; +t2 = MEM_U16(v1 + -10); +t8 = MEM_U16(sp + 42); +t9 = t2 << 22; +t3 = t9 >> 23; +t4 = t8 ^ t3; +t7 = t4 << 23; +t5 = t7 >> 22; +t6 = t5 ^ t2; +MEM_U16(v1 + -10) = (uint16_t)t6; +t8 = MEM_U32(t0 + 0); +t9 = MEM_U32(t1 + 0); +v1 = v1 + 0xfffffff0; +t3 = t8 << 4; +v1 = t9 + t3; +t4 = MEM_U32(v1 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t7 = t4 & at; +MEM_U32(v1 + -8) = t7; +t6 = MEM_U32(t0 + 0); +t5 = MEM_U32(t1 + 0); +v1 = v1 + 0xfffffff0; +t8 = t6 << 4; +v1 = t5 + t8; +v0 = MEM_U32(v1 + -8); +t9 = MEM_U8(sp + 47); +t3 = v0 >> 25; +t4 = t9 ^ t3; +t7 = t4 << 25; +t6 = t7 ^ v0; +MEM_U32(v1 + -8) = t6; +t8 = MEM_U32(t0 + 0); +t5 = MEM_U32(t1 + 0); +v1 = v1 + 0xfffffff0; +t9 = t8 << 4; +v1 = t5 + t9; +v0 = MEM_U32(v1 + -8); +t3 = MEM_U8(sp + 59); +t4 = v0 << 7; +t7 = t4 >> 25; +t6 = t3 ^ t7; +t8 = t6 << 25; +t5 = t8 >> 7; +t9 = t5 ^ v0; +MEM_U32(v1 + -8) = t9; +//nop; +a0 = MEM_U32(sp + 52); +v1 = v1 + 0xfffffff0; +v0 = f_create_local_label(mem, sp, a0); +goto L4156cc; +v1 = v1 + 0xfffffff0; +L4156cc: +gp = MEM_U32(sp + 32); +at = 0xffffc000; +t0 = 0x10018e70; +t1 = 0x10018e6c; +t3 = MEM_U32(t0 + 0); +t4 = MEM_U32(t1 + 0); +t7 = t3 << 4; +t6 = t4 + t7; +MEM_U32(t6 + -16) = v0; +t5 = MEM_U32(t0 + 0); +t8 = MEM_U32(t1 + 0); +t9 = t5 << 4; +v1 = t8 + t9; +t3 = MEM_U32(v1 + -8); +v1 = v1 + 0xfffffff0; +t4 = t3 & at; +MEM_U32(v1 + 8) = t4; +t5 = MEM_U32(t0 + 0); +t6 = MEM_U32(t1 + 0); +t7 = MEM_U32(sp + 48); +t8 = t5 << 4; +t9 = t6 + t8; +MEM_U32(t9 + -4) = t7; +t4 = MEM_U32(t0 + 0); +t3 = MEM_U32(t1 + 0); +t5 = t4 << 4; +v1 = t3 + t5; +t6 = MEM_U32(v1 + -12); +at = 0xfe3f0000; +at = at | 0xffff; +t8 = t6 & at; +t7 = 0x10018e78; +MEM_U32(v1 + -12) = t8; +a0 = MEM_U32(t0 + 0); +t7 = MEM_U32(t7 + 0); +v1 = v1 + 0xfffffff0; +if (t7 != a0) {//nop; +goto L41578c;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L415774; +//nop; +L415774: +gp = MEM_U32(sp + 32); +//nop; +t0 = 0x10018e70; +//nop; +a0 = MEM_U32(t0 + 0); +//nop; +L41578c: +t4 = 0x10018ed4; +t9 = a0 + 0x1; +MEM_U32(t0 + 0) = t9; +t4 = MEM_U8(t4 + 0); +a2 = 0xb; +if (t4 == 0) {a3 = 0xb; +goto L4158dc;} +a3 = 0xb; +a0 = 0x10006570; +a1 = 0x1000815e; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L4157c0; +a1 = a1; +L4157c0: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 42); +s0 = 0x10006570; +a2 = 0x100016f0; +//nop; +s0 = MEM_U32(s0 + 0); +t3 = 0xa; +MEM_U32(sp + 16) = t3; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L4157f0; +a0 = s0; +L4157f0: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L41580c; +a3 = 0xa; +L41580c: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t5 = 0xa; +MEM_U32(sp + 16) = t5; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L415834; +a2 = a2; +L415834: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +//nop; +a0 = s0; +a2 = 0xc; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L415850; +a3 = 0xa; +L415850: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 52); +a0 = 0x10006570; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = 0xc; +a3 = 0xa; +f_write_cardinal(mem, sp, a0, a1, a2, a3); +goto L415870; +a3 = 0xa; +L415870: +gp = MEM_U32(sp + 32); +a1 = 0x20; +s0 = 0x10006570; +//nop; +s0 = MEM_U32(s0 + 0); +a2 = 0x1; +a3 = 0xa; +a0 = s0; +f_write_char(mem, sp, a0, a1, a2); +goto L415894; +a0 = s0; +L415894: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 59); +a2 = 0x1000258c; +//nop; +t6 = 0xa; +MEM_U32(sp + 16) = t6; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L4158bc; +a2 = a2; +L4158bc: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L4158d4; +//nop; +L4158d4: +gp = MEM_U32(sp + 32); +//nop; +L4158dc: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_ra(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4158ec: +//emit_ra: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t0 = 0x10018e70; +t1 = 0x10018e6c; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(t1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 52) = a3; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t3 = t9 & 0xffc0; +t4 = t3 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t4; +t7 = MEM_U32(t0 + 0); +t5 = MEM_U32(t1 + 0); +t6 = t7 << 4; +v0 = t5 + t6; +t2 = MEM_U16(v0 + -10); +t8 = MEM_U16(sp + 42); +t9 = t2 << 22; +t3 = t9 >> 23; +t4 = t8 ^ t3; +t7 = t4 << 23; +t5 = t7 >> 22; +t6 = t5 ^ t2; +MEM_U16(v0 + -10) = (uint16_t)t6; +t8 = MEM_U32(t0 + 0); +t9 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t8 << 4; +v0 = t9 + t3; +t4 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t7 = t4 & at; +t5 = t7 | 0x4000; +MEM_U32(v0 + -8) = t5; +t8 = MEM_U32(t0 + 0); +t6 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t9 = t8 << 4; +v0 = t6 + t9; +v1 = MEM_U32(v0 + -8); +t3 = MEM_U8(sp + 47); +t4 = v1 >> 25; +t7 = t3 ^ t4; +t5 = t7 << 25; +t8 = t5 ^ v1; +MEM_U32(v0 + -8) = t8; +t9 = MEM_U32(t0 + 0); +t6 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t9 << 4; +v0 = t6 + t3; +t4 = MEM_U32(v0 + -8); +at = 0xfe030000; +at = at | 0xffff; +t7 = t4 & at; +at = 0x1200000; +t5 = t7 | at; +MEM_U32(v0 + -8) = t5; +t9 = MEM_U32(t0 + 0); +t8 = MEM_U32(t1 + 0); +t6 = t9 << 4; +t3 = t8 + t6; +MEM_U32(t3 + -16) = a2; +t7 = MEM_U32(t0 + 0); +t4 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t5 = t7 << 4; +v0 = t4 + t5; +v1 = MEM_U32(v0 + -8); +t9 = MEM_U32(sp + 56); +t8 = v1 << 18; +t6 = t8 >> 18; +t3 = t9 ^ t6; +t7 = t3 & 0x3fff; +t4 = t7 ^ v1; +MEM_U32(v0 + -8) = t4; +t9 = MEM_U32(t0 + 0); +t8 = MEM_U32(t1 + 0); +t5 = MEM_U32(sp + 52); +t6 = t9 << 4; +t3 = t8 + t6; +MEM_U32(t3 + -4) = t5; +t4 = MEM_U32(t0 + 0); +t7 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t9 = t4 << 4; +v0 = t7 + t9; +t8 = MEM_U32(v0 + -12); +at = 0xfe3f0000; +at = at | 0xffff; +t6 = t8 & at; +t5 = 0x10018e78; +MEM_U32(v0 + -12) = t6; +v1 = MEM_U32(t0 + 0); +t5 = MEM_U32(t5 + 0); +v0 = v0 + 0xfffffff0; +if (t5 != v1) {//nop; +goto L415ac8;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L415ab0; +//nop; +L415ab0: +gp = MEM_U32(sp + 32); +//nop; +t0 = 0x10018e70; +//nop; +v1 = MEM_U32(t0 + 0); +//nop; +L415ac8: +t7 = 0x10018ed4; +t3 = v1 + 0x1; +MEM_U32(t0 + 0) = t3; +at = 0x100197c4; +t7 = MEM_U8(t7 + 0); +t4 = 0x1; +if (t7 == 0) {MEM_U8(at + 0) = (uint8_t)t4; +goto L415bbc;} +MEM_U8(at + 0) = (uint8_t)t4; +a0 = 0x10006570; +a1 = 0x10008169; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = 0x9; +a3 = 0x9; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L415b08; +a1 = a1; +L415b08: +gp = MEM_U32(sp + 32); +t9 = 0xa; +s0 = 0x10006570; +MEM_U32(sp + 16) = t9; +//nop; +a2 = 0x100016f0; +s0 = MEM_U32(s0 + 0); +a1 = MEM_U16(sp + 42); +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L415b38; +a0 = s0; +L415b38: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L415b54; +a3 = 0xa; +L415b54: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t8 = 0xa; +MEM_U32(sp + 16) = t8; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L415b7c; +a2 = a2; +L415b7c: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 52); +//nop; +a0 = s0; +a2 = 0xc; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L415b98; +a3 = 0xa; +L415b98: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0x10006570; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L415bb4; +//nop; +L415bb4: +gp = MEM_U32(sp + 32); +//nop; +L415bbc: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_ri_(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L415bcc: +//emit_ri_: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t0 = 0x10018e70; +v1 = 0x10018e6c; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(v1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t5 = t9 & 0xffc0; +t7 = t5 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t7; +t8 = MEM_U32(t0 + 0); +t6 = MEM_U32(v1 + 0); +t9 = t8 << 4; +v0 = t6 + t9; +t1 = MEM_U16(v0 + -10); +t5 = MEM_U16(sp + 42); +t7 = t1 << 22; +t8 = t7 >> 23; +t6 = t5 ^ t8; +t9 = t6 << 23; +t7 = t9 >> 22; +t5 = t7 ^ t1; +MEM_U16(v0 + -10) = (uint16_t)t5; +t6 = MEM_U32(t0 + 0); +t8 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t9 = t6 << 4; +v0 = t8 + t9; +t7 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t5 = t7 & at; +t6 = t5 | 0x8000; +MEM_U32(v0 + -8) = t6; +t9 = MEM_U32(t0 + 0); +t8 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t7 = t9 << 4; +v0 = t8 + t7; +t2 = MEM_U32(v0 + -8); +t5 = MEM_U8(sp + 47); +t6 = t2 >> 25; +t9 = t5 ^ t6; +t8 = t9 << 25; +t7 = t8 ^ t2; +MEM_U32(v0 + -8) = t7; +t6 = MEM_U32(t0 + 0); +t5 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t9 = t6 << 4; +v0 = t5 + t9; +t8 = MEM_U32(v0 + -8); +at = 0xfe030000; +at = at | 0xffff; +t7 = t8 & at; +at = 0x1200000; +t6 = t7 | at; +MEM_U32(v0 + -8) = t6; +t9 = MEM_U32(t0 + 0); +t5 = MEM_U32(v1 + 0); +t8 = t9 << 4; +t7 = t5 + t8; +MEM_U32(t7 + -16) = zero; +t5 = MEM_U32(t0 + 0); +t9 = MEM_U32(v1 + 0); +t6 = MEM_U32(sp + 48); +t8 = t5 << 4; +t7 = t9 + t8; +MEM_U32(t7 + -4) = t6; +t9 = MEM_U32(t0 + 0); +t5 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t8 = t9 << 4; +v0 = t5 + t8; +t3 = MEM_U32(v0 + -12); +v0 = v0 + 0xfffffff0; +t6 = t3 << 7; +t7 = t6 >> 29; +t9 = a3 ^ t7; +t5 = t9 << 29; +t8 = t5 >> 7; +t6 = t8 ^ t3; +t7 = 0x10018e78; +MEM_U32(v0 + 4) = t6; +t4 = MEM_U32(t0 + 0); +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != t4) {//nop; +goto L415d88;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L415d70; +//nop; +L415d70: +gp = MEM_U32(sp + 32); +//nop; +t0 = 0x10018e70; +//nop; +t4 = MEM_U32(t0 + 0); +//nop; +L415d88: +t5 = 0x10018ed4; +t9 = t4 + 0x1; +MEM_U32(t0 + 0) = t9; +t5 = MEM_U8(t5 + 0); +a2 = 0x9; +if (t5 == 0) {a3 = 0x9; +goto L415e70;} +a3 = 0x9; +a0 = 0x10006570; +a1 = 0x10008172; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L415dbc; +a1 = a1; +L415dbc: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 42); +s0 = 0x10006570; +a2 = 0x100016f0; +//nop; +s0 = MEM_U32(s0 + 0); +t8 = 0xa; +MEM_U32(sp + 16) = t8; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L415dec; +a0 = s0; +L415dec: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L415e08; +a3 = 0xa; +L415e08: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t6 = 0xa; +MEM_U32(sp + 16) = t6; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L415e30; +a2 = a2; +L415e30: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +//nop; +a0 = s0; +a2 = 0xc; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L415e4c; +a3 = 0xa; +L415e4c: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0x10006570; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L415e68; +//nop; +L415e68: +gp = MEM_U32(sp + 32); +//nop; +L415e70: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_rii(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L415e80: +//emit_rii: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 44) = a3; +a1 = MEM_U8(sp + 39); +a0 = MEM_U16(sp + 34); +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a2; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L415ebc; +a3 = zero; +L415ebc: +gp = MEM_U32(sp + 24); +a0 = MEM_U16(sp + 34); +//nop; +a1 = MEM_U8(sp + 39); +a2 = MEM_U32(sp + 44); +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L415ed8; +a3 = zero; +L415ed8: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +at = 0x100197c4; +t6 = 0x1; +sp = sp + 0x20; +MEM_U8(at + 0) = (uint8_t)t6; +return; +MEM_U8(at + 0) = (uint8_t)t6; +} + +static void f_emit_rfi(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L415ef4: +//emit_rfi: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb8; +MEM_U32(sp + 36) = s2; +s2 = 0x10018e70; +MEM_U32(sp + 28) = s0; +s0 = 0x10018e6c; +t7 = MEM_U32(s2 + 0); +t6 = MEM_U32(s0 + 0); +t8 = t7 << 4; +MEM_U32(sp + 60) = ra; +MEM_U32(sp + 56) = gp; +MEM_U32(sp + 52) = s6; +MEM_U32(sp + 48) = s5; +MEM_U32(sp + 44) = s4; +MEM_U32(sp + 40) = s3; +MEM_U32(sp + 32) = s1; +MEM_U32(sp + 72) = a0; +MEM_U32(sp + 76) = a1; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t1 = t9 & 0xffc0; +t2 = t1 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t2; +t4 = MEM_U32(s2 + 0); +t3 = MEM_U32(s0 + 0); +t5 = t4 << 4; +v0 = t3 + t5; +a3 = MEM_U16(v0 + -10); +t7 = MEM_U16(sp + 74); +t6 = a3 << 22; +t8 = t6 >> 23; +t9 = t7 ^ t8; +t1 = t9 << 23; +t2 = t1 >> 22; +t4 = t2 ^ a3; +MEM_U16(v0 + -10) = (uint16_t)t4; +t5 = MEM_U32(s2 + 0); +t3 = MEM_U32(s0 + 0); +v0 = v0 + 0xfffffff0; +t6 = t5 << 4; +v0 = t3 + t6; +t7 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t8 = t7 & at; +t9 = t8 | 0x8000; +MEM_U32(v0 + -8) = t9; +t2 = MEM_U32(s2 + 0); +t1 = MEM_U32(s0 + 0); +v0 = v0 + 0xfffffff0; +t4 = t2 << 4; +v0 = t1 + t4; +t0 = MEM_U32(v0 + -8); +t5 = MEM_U8(sp + 79); +t3 = t0 >> 25; +t6 = t5 ^ t3; +t7 = t6 << 25; +t8 = t7 ^ t0; +MEM_U32(v0 + -8) = t8; +t2 = MEM_U32(s2 + 0); +t9 = MEM_U32(s0 + 0); +v0 = v0 + 0xfffffff0; +t1 = t2 << 4; +v0 = t9 + t1; +t4 = MEM_U32(v0 + -8); +at = 0xfe030000; +at = at | 0xffff; +t5 = t4 & at; +at = 0x1200000; +t3 = t5 | at; +MEM_U32(v0 + -8) = t3; +t7 = MEM_U32(s2 + 0); +t6 = MEM_U32(s0 + 0); +t8 = t7 << 4; +t2 = t6 + t8; +MEM_U32(t2 + -16) = zero; +t4 = MEM_U32(s2 + 0); +t1 = MEM_U32(s0 + 0); +s1 = a2; +t9 = MEM_U32(s1 + 0); +t5 = t4 << 4; +t3 = t1 + t5; +MEM_U32(t3 + -4) = t9; +t6 = MEM_U32(s2 + 0); +t7 = MEM_U32(s0 + 0); +v0 = v0 + 0xfffffff0; +t8 = t6 << 4; +v0 = t7 + t8; +t2 = MEM_U32(v0 + -12); +at = 0xfe3f0000; +at = at | 0xffff; +t4 = t2 & at; +s6 = 0x10018e78; +MEM_U32(v0 + -12) = t4; +v1 = MEM_U32(s2 + 0); +t1 = MEM_U32(s6 + 0); +v0 = v0 + 0xfffffff0; +if (t1 != v1) {t5 = v1 + 0x1; +goto L4160ac;} +t5 = v1 + 0x1; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41609c; +//nop; +L41609c: +gp = MEM_U32(sp + 56); +v1 = MEM_U32(s2 + 0); +//nop; +t5 = v1 + 0x1; +L4160ac: +MEM_U32(s2 + 0) = t5; +v0 = MEM_U32(s1 + 0); +s3 = 0x1; +if ((int)v0 >= 0) {t9 = (int)v0 >> 4; +goto L4160c8;} +t9 = (int)v0 >> 4; +at = v0 + 0xf; +t9 = (int)at >> 4; +L4160c8: +t3 = v0 & 0xf; +MEM_U32(sp + 68) = t9; +if (t9 == 0) {MEM_U32(sp + 64) = t3; +goto L4161d4;} +MEM_U32(sp + 64) = t3; +s5 = t9 + 0x1; +s4 = 0x11; +L4160e0: +v1 = s3 << 4; +v1 = v1 + 0xfffffff0; +v0 = 0x1; +L4160ec: +t7 = MEM_U32(s1 + 4); +t5 = MEM_U32(s2 + 0); +t1 = MEM_U32(s0 + 0); +t8 = t7 + v1; +t2 = t8 + v0; +t9 = t5 << 4; +t4 = MEM_U8(t2 + -1); +t3 = t1 + t9; +t6 = t3 + v0; +MEM_U8(t6 + -17) = (uint8_t)t4; +t7 = MEM_U32(s1 + 4); +t9 = MEM_U32(s2 + 0); +t1 = MEM_U32(s0 + 0); +t8 = t7 + v1; +t2 = t8 + v0; +t3 = t9 << 4; +t5 = MEM_U8(t2 + 0); +t4 = t1 + t3; +t6 = t4 + v0; +MEM_U8(t6 + -16) = (uint8_t)t5; +t7 = MEM_U32(s1 + 4); +t3 = MEM_U32(s2 + 0); +t1 = MEM_U32(s0 + 0); +t8 = t7 + v1; +t2 = t8 + v0; +t4 = t3 << 4; +t9 = MEM_U8(t2 + 1); +t5 = t1 + t4; +t6 = t5 + v0; +MEM_U8(t6 + -15) = (uint8_t)t9; +t4 = MEM_U32(s2 + 0); +t7 = MEM_U32(s1 + 4); +t1 = MEM_U32(s0 + 0); +t5 = t4 << 4; +t8 = t7 + v1; +t2 = t8 + v0; +t9 = t1 + t5; +t3 = MEM_U8(t2 + 2); +t6 = t9 + v0; +v0 = v0 + 0x4; +if (v0 != s4) {MEM_U8(t6 + -14) = (uint8_t)t3; +goto L4160ec;} +MEM_U8(t6 + -14) = (uint8_t)t3; +v1 = MEM_U32(s2 + 0); +t7 = MEM_U32(s6 + 0); +//nop; +if (t7 != v1) {t8 = v1 + 0x1; +goto L4161c8;} +t8 = v1 + 0x1; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L4161b8; +//nop; +L4161b8: +gp = MEM_U32(sp + 56); +v1 = MEM_U32(s2 + 0); +//nop; +t8 = v1 + 0x1; +L4161c8: +s3 = s3 + 0x1; +if (s3 != s5) {MEM_U32(s2 + 0) = t8; +goto L4160e0;} +MEM_U32(s2 + 0) = t8; +L4161d4: +t4 = 0x10018ed4; +at = 0x100197c4; +t4 = MEM_U8(t4 + 0); +t2 = 0x1; +if (t4 == 0) {MEM_U8(at + 0) = (uint8_t)t2; +goto L41629c;} +MEM_U8(at + 0) = (uint8_t)t2; +s4 = 0x10006570; +a1 = 0x1000818b; +//nop; +a0 = MEM_U32(s4 + 0); +a2 = 0xa; +a3 = 0xa; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L41620c; +a1 = a1; +L41620c: +gp = MEM_U32(sp + 56); +s3 = MEM_U32(s4 + 0); +a2 = 0x100016f0; +//nop; +a1 = MEM_U16(sp + 74); +t1 = 0xa; +MEM_U32(sp + 16) = t1; +a3 = zero; +a0 = s3; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L416238; +a2 = a2; +L416238: +gp = MEM_U32(sp + 56); +a0 = s3; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L416254; +a3 = 0xa; +L416254: +gp = MEM_U32(sp + 56); +a1 = MEM_U8(sp + 79); +a2 = 0x1000258c; +//nop; +t5 = 0xa; +MEM_U32(sp + 16) = t5; +a0 = s3; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L41627c; +a2 = a2; +L41627c: +gp = MEM_U32(sp + 56); +a0 = s3; +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L416294; +//nop; +L416294: +gp = MEM_U32(sp + 56); +//nop; +L41629c: +t9 = MEM_U32(sp + 64); +//nop; +if (t9 == 0) {ra = MEM_U32(sp + 60); +goto L41646c;} +ra = MEM_U32(sp + 60); +t2 = 0x1000817b; +t6 = MEM_U32(s2 + 0); +t2 = t2; +t3 = MEM_U32(s0 + 0); +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t7 = t6 << 4; +t8 = t3 + t7; +MEM_U8(t8 + -16 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + -16 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + -16 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + -16 + 3) = (uint8_t)(at >> 0); +//swr $at, -0xd($t8) +t1 = t2 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t2) +//nop; +MEM_U8(t8 + -12 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t8 + -12 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t8 + -12 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t8 + -12 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, -9($t8) +at = t2 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t2) +//nop; +MEM_U8(t8 + -8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + -8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + -8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + -8 + 3) = (uint8_t)(at >> 0); +//swr $at, -5($t8) +t1 = t2 + 12; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 0xf($t2) +//nop; +MEM_U8(t8 + -4 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t8 + -4 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t8 + -4 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t8 + -4 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, -1($t8) +t5 = MEM_U32(sp + 64); +//nop; +if (t5 == 0) {s5 = t5 + 0x1; +goto L416430;} +s5 = t5 + 0x1; +a0 = s5 + 0xffffffff; +t9 = a0 & 0x3; +if (t9 == 0) {s3 = 0x1; +goto L416378;} +s3 = 0x1; +v0 = MEM_U32(sp + 68); +v1 = t9 + 0x1; +t6 = v0 << 4; +v0 = t6; +L416340: +t3 = MEM_U32(s1 + 4); +t1 = MEM_U32(s2 + 0); +t2 = MEM_U32(s0 + 0); +t7 = t3 + v0; +t5 = t1 << 4; +t4 = t7 + s3; +t9 = t2 + t5; +t8 = MEM_U8(t4 + -1); +t6 = t9 + s3; +s3 = s3 + 0x1; +if (v1 != s3) {MEM_U8(t6 + -17) = (uint8_t)t8; +goto L416340;} +MEM_U8(t6 + -17) = (uint8_t)t8; +if (s3 == s5) {//nop; +goto L416430;} +//nop; +L416378: +v0 = MEM_U32(sp + 68); +//nop; +t3 = v0 << 4; +v0 = t3; +L416388: +t7 = MEM_U32(s1 + 4); +t9 = MEM_U32(s2 + 0); +t5 = MEM_U32(s0 + 0); +t4 = t7 + v0; +t1 = t4 + s3; +t8 = t9 << 4; +t2 = MEM_U8(t1 + -1); +t6 = t5 + t8; +t3 = t6 + s3; +MEM_U8(t3 + -17) = (uint8_t)t2; +t7 = MEM_U32(s1 + 4); +t8 = MEM_U32(s2 + 0); +t5 = MEM_U32(s0 + 0); +t4 = t7 + v0; +t1 = t4 + s3; +t6 = t8 << 4; +t9 = MEM_U8(t1 + 0); +t2 = t5 + t6; +t3 = t2 + s3; +MEM_U8(t3 + -16) = (uint8_t)t9; +t7 = MEM_U32(s1 + 4); +t6 = MEM_U32(s2 + 0); +t5 = MEM_U32(s0 + 0); +t4 = t7 + v0; +t1 = t4 + s3; +t2 = t6 << 4; +t8 = MEM_U8(t1 + 1); +t9 = t5 + t2; +t3 = t9 + s3; +MEM_U8(t3 + -15) = (uint8_t)t8; +t2 = MEM_U32(s2 + 0); +t7 = MEM_U32(s1 + 4); +t5 = MEM_U32(s0 + 0); +t9 = t2 << 4; +t4 = t7 + v0; +t1 = t4 + s3; +t8 = t5 + t9; +t6 = MEM_U8(t1 + 2); +t3 = t8 + s3; +s3 = s3 + 0x4; +if (s3 != s5) {MEM_U8(t3 + -14) = (uint8_t)t6; +goto L416388;} +MEM_U8(t3 + -14) = (uint8_t)t6; +L416430: +v1 = MEM_U32(s2 + 0); +t7 = MEM_U32(s6 + 0); +//nop; +if (t7 != v1) {t4 = v1 + 0x1; +goto L416464;} +t4 = v1 + 0x1; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L416454; +//nop; +L416454: +gp = MEM_U32(sp + 56); +v1 = MEM_U32(s2 + 0); +//nop; +t4 = v1 + 0x1; +L416464: +MEM_U32(s2 + 0) = t4; +ra = MEM_U32(sp + 60); +L41646c: +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +s3 = MEM_U32(sp + 40); +s4 = MEM_U32(sp + 44); +s5 = MEM_U32(sp + 48); +s6 = MEM_U32(sp + 52); +sp = sp + 0x48; +return; +sp = sp + 0x48; +} + +static void f_emit_rrfi(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L416490: +//emit_rrfi: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +a3 = 0x10018e70; +v1 = 0x10018e6c; +t7 = MEM_U32(a3 + 0); +t6 = MEM_U32(v1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t3 = t9 & 0xffc0; +t4 = t3 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t4; +t7 = MEM_U32(a3 + 0); +t5 = MEM_U32(v1 + 0); +t6 = t7 << 4; +v0 = t5 + t6; +t0 = MEM_U16(v0 + -10); +t8 = MEM_U16(sp + 42); +t9 = t0 << 22; +t3 = t9 >> 23; +t4 = t8 ^ t3; +t7 = t4 << 23; +t5 = t7 >> 22; +t6 = t5 ^ t0; +MEM_U16(v0 + -10) = (uint16_t)t6; +t8 = MEM_U32(a3 + 0); +t9 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t8 << 4; +v0 = t9 + t3; +t4 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t7 = t4 & at; +t5 = t7 | 0x8000; +MEM_U32(v0 + -8) = t5; +t8 = MEM_U32(a3 + 0); +t6 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t9 = t8 << 4; +v0 = t6 + t9; +t1 = MEM_U32(v0 + -8); +t3 = MEM_U8(sp + 47); +t4 = t1 >> 25; +t7 = t3 ^ t4; +t5 = t7 << 25; +t8 = t5 ^ t1; +MEM_U32(v0 + -8) = t8; +t9 = MEM_U32(a3 + 0); +t6 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t9 << 4; +v0 = t6 + t3; +t4 = MEM_U32(v0 + -8); +at = 0xfe030000; +at = at | 0xffff; +t7 = t4 & at; +at = 0x1200000; +t5 = t7 | at; +MEM_U32(v0 + -8) = t5; +t6 = MEM_U32(a3 + 0); +t9 = MEM_U32(v1 + 0); +t8 = MEM_U32(sp + 48); +t3 = t6 << 4; +t4 = t9 + t3; +MEM_U32(t4 + -16) = t8; +t5 = MEM_U32(a3 + 0); +t7 = MEM_U32(v1 + 0); +t6 = t5 << 4; +t9 = t7 + t6; +MEM_U32(t9 + -4) = zero; +t8 = MEM_U32(a3 + 0); +t3 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t4 = t8 << 4; +v0 = t3 + t4; +t5 = MEM_U32(v0 + -12); +at = 0xfe3f0000; +at = at | 0xffff; +t7 = t5 & at; +at = 0x1800000; +t6 = t7 | at; +t9 = 0x10018e78; +MEM_U32(v0 + -12) = t6; +t2 = MEM_U32(a3 + 0); +t9 = MEM_U32(t9 + 0); +v0 = v0 + 0xfffffff0; +if (t9 != t2) {//nop; +goto L416640;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L416628; +//nop; +L416628: +gp = MEM_U32(sp + 32); +//nop; +a3 = 0x10018e70; +//nop; +t2 = MEM_U32(a3 + 0); +//nop; +L416640: +t3 = 0x10018ed4; +t8 = t2 + 0x1; +MEM_U32(a3 + 0) = t8; +t3 = MEM_U8(t3 + 0); +a3 = 0x9; +if (t3 == 0) {a2 = 0x9; +goto L416728;} +a2 = 0x9; +a0 = 0x10006570; +a1 = 0x10008195; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L416674; +a1 = a1; +L416674: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 42); +s0 = 0x10006570; +a2 = 0x100016f0; +//nop; +s0 = MEM_U32(s0 + 0); +t4 = 0xa; +MEM_U32(sp + 16) = t4; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L4166a4; +a0 = s0; +L4166a4: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L4166c0; +a3 = 0xa; +L4166c0: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t5 = 0xa; +MEM_U32(sp + 16) = t5; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L4166e8; +a2 = a2; +L4166e8: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +//nop; +a0 = s0; +a2 = 0xc; +a3 = 0xa; +f_write_cardinal(mem, sp, a0, a1, a2, a3); +goto L416704; +a3 = 0xa; +L416704: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0x10006570; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L416720; +//nop; +L416720: +gp = MEM_U32(sp + 32); +//nop; +L416728: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_rrr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L416738: +//emit_rrr: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t1 = 0x10018e70; +t0 = 0x10018e6c; +t7 = MEM_U32(t1 + 0); +t6 = MEM_U32(t0 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t3 = t9 & 0xffc0; +t4 = t3 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t4; +t7 = MEM_U32(t1 + 0); +t5 = MEM_U32(t0 + 0); +t6 = t7 << 4; +v0 = t5 + t6; +t2 = MEM_U16(v0 + -10); +t8 = MEM_U16(sp + 42); +t9 = t2 << 22; +t3 = t9 >> 23; +t4 = t8 ^ t3; +t7 = t4 << 23; +t5 = t7 >> 22; +t6 = t5 ^ t2; +MEM_U16(v0 + -10) = (uint16_t)t6; +t8 = MEM_U32(t1 + 0); +t9 = MEM_U32(t0 + 0); +v0 = v0 + 0xfffffff0; +t3 = t8 << 4; +v0 = t9 + t3; +t4 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t7 = t4 & at; +t5 = t7 | 0xc000; +MEM_U32(v0 + -8) = t5; +t8 = MEM_U32(t1 + 0); +t6 = MEM_U32(t0 + 0); +t9 = t8 << 4; +t3 = t6 + t9; +MEM_U32(t3 + -16) = zero; +t7 = MEM_U32(t1 + 0); +t4 = MEM_U32(t0 + 0); +v0 = v0 + 0xfffffff0; +t5 = t7 << 4; +v0 = t4 + t5; +v1 = MEM_U32(v0 + -8); +t8 = MEM_U8(sp + 47); +t6 = v1 >> 25; +t9 = t8 ^ t6; +t3 = t9 << 25; +t7 = t3 ^ v1; +MEM_U32(v0 + -8) = t7; +t5 = MEM_U32(t1 + 0); +t4 = MEM_U32(t0 + 0); +v0 = v0 + 0xfffffff0; +t8 = t5 << 4; +v0 = t4 + t8; +v1 = MEM_U32(v0 + -8); +t6 = MEM_U8(sp + 51); +t9 = v1 << 7; +t3 = t9 >> 25; +t7 = t6 ^ t3; +t5 = t7 << 25; +t4 = t5 >> 7; +t8 = t4 ^ v1; +MEM_U32(v0 + -8) = t8; +t6 = MEM_U32(t1 + 0); +t9 = MEM_U32(t0 + 0); +v0 = v0 + 0xfffffff0; +t3 = t6 << 4; +v0 = t9 + t3; +v1 = MEM_U32(v0 + -8); +t7 = MEM_U8(sp + 55); +t5 = v1 << 18; +t4 = t5 >> 25; +t8 = t7 ^ t4; +t6 = t8 << 25; +t9 = t6 >> 18; +t3 = t9 ^ v1; +t5 = 0x10018e78; +MEM_U32(v0 + -8) = t3; +v0 = v0 + 0xfffffff0; +v0 = MEM_U32(t1 + 0); +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != v0) {//nop; +goto L4168e8;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L4168d0; +//nop; +L4168d0: +gp = MEM_U32(sp + 32); +//nop; +t1 = 0x10018e70; +//nop; +v0 = MEM_U32(t1 + 0); +//nop; +L4168e8: +t4 = 0x10018ed4; +t7 = v0 + 0x1; +MEM_U32(t1 + 0) = t7; +t4 = MEM_U8(t4 + 0); +a2 = 0xa; +if (t4 == 0) {a3 = 0xa; +goto L416a38;} +a3 = 0xa; +a0 = 0x10006570; +a1 = 0x1000819e; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L41691c; +a1 = a1; +L41691c: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 42); +s0 = 0x10006570; +a2 = 0x100016f0; +//nop; +s0 = MEM_U32(s0 + 0); +t8 = 0xa; +MEM_U32(sp + 16) = t8; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L41694c; +a0 = s0; +L41694c: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L416968; +a3 = 0xa; +L416968: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t6 = 0xa; +MEM_U32(sp + 16) = t6; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L416990; +a2 = a2; +L416990: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L4169ac; +a3 = 0xa; +L4169ac: +gp = MEM_U32(sp + 32); +t9 = 0xa; +MEM_U32(sp + 16) = t9; +//nop; +a2 = 0x1000258c; +a1 = MEM_U8(sp + 51); +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L4169d4; +a2 = a2; +L4169d4: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L4169f0; +a3 = 0xa; +L4169f0: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 55); +a2 = 0x1000258c; +//nop; +t3 = 0xa; +MEM_U32(sp + 16) = t3; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L416a18; +a2 = a2; +L416a18: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L416a30; +//nop; +L416a30: +gp = MEM_U32(sp + 32); +//nop; +L416a38: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_rri_(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L416a48: +//emit_rri_: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t1 = 0x10018e70; +v1 = 0x10018e6c; +t7 = MEM_U32(t1 + 0); +t6 = MEM_U32(v1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t4 = t9 & 0xffc0; +t5 = t4 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t5; +t6 = MEM_U32(t1 + 0); +t7 = MEM_U32(v1 + 0); +t8 = t6 << 4; +v0 = t7 + t8; +t2 = MEM_U16(v0 + -10); +t9 = MEM_U16(sp + 42); +t4 = t2 << 22; +t5 = t4 >> 23; +t6 = t9 ^ t5; +t7 = t6 << 23; +t8 = t7 >> 22; +t4 = t8 ^ t2; +MEM_U16(v0 + -10) = (uint16_t)t4; +t5 = MEM_U32(t1 + 0); +t9 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t6 = t5 << 4; +v0 = t9 + t6; +t7 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t8 = t7 & at; +at = 0x10000; +t4 = t8 | at; +MEM_U32(v0 + -8) = t4; +t9 = MEM_U32(t1 + 0); +t5 = MEM_U32(v1 + 0); +t6 = t9 << 4; +t7 = t5 + t6; +MEM_U32(t7 + -16) = zero; +t4 = MEM_U32(t1 + 0); +t8 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t9 = t4 << 4; +v0 = t8 + t9; +t0 = MEM_U32(v0 + -8); +t5 = MEM_U8(sp + 47); +t6 = t0 >> 25; +t7 = t5 ^ t6; +t4 = t7 << 25; +t8 = t4 ^ t0; +MEM_U32(v0 + -8) = t8; +t5 = MEM_U32(t1 + 0); +t9 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t6 = t5 << 4; +v0 = t9 + t6; +t0 = MEM_U32(v0 + -8); +t7 = MEM_U8(sp + 51); +t4 = t0 << 7; +t8 = t4 >> 25; +t5 = t7 ^ t8; +t9 = t5 << 25; +t6 = t9 >> 7; +t4 = t6 ^ t0; +MEM_U32(v0 + -8) = t4; +t5 = MEM_U32(t1 + 0); +t8 = MEM_U32(v1 + 0); +t7 = MEM_U32(sp + 52); +t9 = t5 << 4; +t6 = t8 + t9; +MEM_U32(t6 + -4) = t7; +t5 = MEM_U32(t1 + 0); +t4 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t8 = t5 << 4; +v0 = t4 + t8; +t3 = MEM_U32(v0 + -12); +t9 = MEM_U8(sp + 59); +t7 = t3 << 7; +t6 = t7 >> 29; +t5 = t9 ^ t6; +t4 = t5 << 29; +t8 = t4 >> 7; +t7 = t8 ^ t3; +t9 = 0x10018e78; +MEM_U32(v0 + -12) = t7; +v0 = v0 + 0xfffffff0; +v0 = MEM_U32(t1 + 0); +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != v0) {//nop; +goto L416c14;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L416bfc; +//nop; +L416bfc: +gp = MEM_U32(sp + 32); +//nop; +t1 = 0x10018e70; +//nop; +v0 = MEM_U32(t1 + 0); +//nop; +L416c14: +t5 = 0x10018ed4; +t6 = v0 + 0x1; +MEM_U32(t1 + 0) = t6; +t5 = MEM_U8(t5 + 0); +a2 = 0xa; +if (t5 == 0) {a3 = 0xa; +goto L416d40;} +a3 = 0xa; +a0 = 0x10006570; +a1 = 0x100081a8; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L416c48; +a1 = a1; +L416c48: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 42); +s0 = 0x10006570; +a2 = 0x100016f0; +//nop; +s0 = MEM_U32(s0 + 0); +t4 = 0xa; +MEM_U32(sp + 16) = t4; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L416c78; +a0 = s0; +L416c78: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L416c94; +a3 = 0xa; +L416c94: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t8 = 0xa; +MEM_U32(sp + 16) = t8; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L416cbc; +a2 = a2; +L416cbc: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L416cd8; +a3 = 0xa; +L416cd8: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +a2 = 0x1000258c; +//nop; +t7 = 0xa; +MEM_U32(sp + 16) = t7; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L416d00; +a2 = a2; +L416d00: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 52); +//nop; +a0 = s0; +a2 = 0xc; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L416d1c; +a3 = 0xa; +L416d1c: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0x10006570; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L416d38; +//nop; +L416d38: +gp = MEM_U32(sp + 32); +//nop; +L416d40: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_rrri(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L416d50: +//emit_rrri: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t1 = 0x10018e70; +v1 = 0x10018e6c; +t7 = MEM_U32(t1 + 0); +t6 = MEM_U32(v1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t4 = t9 & 0xffc0; +t5 = t4 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t5; +t6 = MEM_U32(t1 + 0); +t7 = MEM_U32(v1 + 0); +t8 = t6 << 4; +v0 = t7 + t8; +t2 = MEM_U16(v0 + -10); +t9 = MEM_U16(sp + 42); +t4 = t2 << 22; +t5 = t4 >> 23; +t6 = t9 ^ t5; +t7 = t6 << 23; +t8 = t7 >> 22; +t4 = t8 ^ t2; +MEM_U16(v0 + -10) = (uint16_t)t4; +t5 = MEM_U32(t1 + 0); +t9 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t6 = t5 << 4; +v0 = t9 + t6; +t7 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t8 = t7 & at; +at = 0x10000; +t4 = t8 | at; +MEM_U32(v0 + -8) = t4; +t6 = MEM_U32(t1 + 0); +t9 = MEM_U32(v1 + 0); +t5 = MEM_U32(sp + 52); +t7 = t6 << 4; +t8 = t9 + t7; +MEM_U32(t8 + -16) = t5; +t6 = MEM_U32(t1 + 0); +t4 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t9 = t6 << 4; +v0 = t4 + t9; +t0 = MEM_U32(v0 + -8); +t7 = MEM_U8(sp + 47); +t5 = t0 >> 25; +t8 = t7 ^ t5; +t6 = t8 << 25; +t4 = t6 ^ t0; +MEM_U32(v0 + -8) = t4; +t7 = MEM_U32(t1 + 0); +t9 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t5 = t7 << 4; +v0 = t9 + t5; +t0 = MEM_U32(v0 + -8); +t8 = MEM_U8(sp + 51); +t6 = t0 << 7; +t4 = t6 >> 25; +t7 = t8 ^ t4; +t9 = t7 << 25; +t5 = t9 >> 7; +t6 = t5 ^ t0; +MEM_U32(v0 + -8) = t6; +t4 = MEM_U32(t1 + 0); +t8 = MEM_U32(v1 + 0); +t7 = t4 << 4; +t9 = t8 + t7; +MEM_U32(t9 + -4) = zero; +t6 = MEM_U32(t1 + 0); +t5 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t4 = t6 << 4; +v0 = t5 + t4; +t8 = MEM_U32(v0 + -12); +at = 0xfe3f0000; +at = at | 0xffff; +t7 = t8 & at; +at = 0x1800000; +t9 = t7 | at; +t6 = 0x10018e78; +MEM_U32(v0 + -12) = t9; +t3 = MEM_U32(t1 + 0); +t6 = MEM_U32(t6 + 0); +v0 = v0 + 0xfffffff0; +if (t6 != t3) {//nop; +goto L416f10;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L416ef8; +//nop; +L416ef8: +gp = MEM_U32(sp + 32); +//nop; +t1 = 0x10018e70; +//nop; +t3 = MEM_U32(t1 + 0); +//nop; +L416f10: +t4 = 0x10018ed4; +t5 = t3 + 0x1; +MEM_U32(t1 + 0) = t5; +t4 = MEM_U8(t4 + 0); +a2 = 0xb; +if (t4 == 0) {a3 = 0xb; +goto L41703c;} +a3 = 0xb; +a0 = 0x10006570; +a1 = 0x100081b2; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L416f44; +a1 = a1; +L416f44: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 42); +s0 = 0x10006570; +a2 = 0x100016f0; +//nop; +s0 = MEM_U32(s0 + 0); +t8 = 0xa; +MEM_U32(sp + 16) = t8; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L416f74; +a0 = s0; +L416f74: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L416f90; +a3 = 0xa; +L416f90: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t7 = 0xa; +MEM_U32(sp + 16) = t7; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L416fb8; +a2 = a2; +L416fb8: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L416fd4; +a3 = 0xa; +L416fd4: +gp = MEM_U32(sp + 32); +t9 = 0xa; +MEM_U32(sp + 16) = t9; +//nop; +a2 = 0x1000258c; +a1 = MEM_U8(sp + 51); +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L416ffc; +a2 = a2; +L416ffc: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 52); +//nop; +a0 = s0; +a2 = 0xc; +a3 = 0xa; +f_write_cardinal(mem, sp, a0, a1, a2, a3); +goto L417018; +a3 = 0xa; +L417018: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0x10006570; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L417034; +//nop; +L417034: +gp = MEM_U32(sp + 32); +//nop; +L41703c: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_rr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41704c: +//emit_rr: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t0 = 0x10018e70; +a3 = 0x10018e6c; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(a3 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t3 = t9 & 0xffc0; +t4 = t3 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t4; +t7 = MEM_U32(t0 + 0); +t5 = MEM_U32(a3 + 0); +t6 = t7 << 4; +v0 = t5 + t6; +t1 = MEM_U16(v0 + -10); +t8 = MEM_U16(sp + 42); +t9 = t1 << 22; +t3 = t9 >> 23; +t4 = t8 ^ t3; +t7 = t4 << 23; +t5 = t7 >> 22; +t6 = t5 ^ t1; +MEM_U16(v0 + -10) = (uint16_t)t6; +t8 = MEM_U32(t0 + 0); +t9 = MEM_U32(a3 + 0); +v0 = v0 + 0xfffffff0; +t3 = t8 << 4; +v0 = t9 + t3; +t4 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t7 = t4 & at; +at = 0x10000; +at = at | 0x4000; +t5 = t7 | at; +MEM_U32(v0 + -8) = t5; +t8 = MEM_U32(t0 + 0); +t6 = MEM_U32(a3 + 0); +t9 = t8 << 4; +t3 = t6 + t9; +MEM_U32(t3 + -16) = zero; +t7 = MEM_U32(t0 + 0); +t4 = MEM_U32(a3 + 0); +v0 = v0 + 0xfffffff0; +t5 = t7 << 4; +v0 = t4 + t5; +v1 = MEM_U32(v0 + -8); +t8 = MEM_U8(sp + 47); +t6 = v1 >> 25; +t9 = t8 ^ t6; +t3 = t9 << 25; +t7 = t3 ^ v1; +MEM_U32(v0 + -8) = t7; +t5 = MEM_U32(t0 + 0); +t4 = MEM_U32(a3 + 0); +v0 = v0 + 0xfffffff0; +t8 = t5 << 4; +v0 = t4 + t8; +v1 = MEM_U32(v0 + -8); +t6 = MEM_U8(sp + 51); +t9 = v1 << 7; +t3 = t9 >> 25; +t7 = t6 ^ t3; +t5 = t7 << 25; +t4 = t5 >> 7; +t8 = t4 ^ v1; +t9 = 0x10018e78; +MEM_U32(v0 + -8) = t8; +t2 = MEM_U32(t0 + 0); +t9 = MEM_U32(t9 + 0); +v0 = v0 + 0xfffffff0; +if (t9 != t2) {//nop; +goto L4171c4;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L4171ac; +//nop; +L4171ac: +gp = MEM_U32(sp + 32); +//nop; +t0 = 0x10018e70; +//nop; +t2 = MEM_U32(t0 + 0); +//nop; +L4171c4: +t3 = 0x10018ed4; +t6 = t2 + 0x1; +MEM_U32(t0 + 0) = t6; +t3 = MEM_U8(t3 + 0); +a2 = 0x9; +if (t3 == 0) {a3 = 0x9; +goto L4172d0;} +a3 = 0x9; +a0 = 0x10006570; +a1 = 0x100081bd; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L4171f8; +a1 = a1; +L4171f8: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 42); +s0 = 0x10006570; +a2 = 0x100016f0; +//nop; +s0 = MEM_U32(s0 + 0); +t7 = 0xa; +MEM_U32(sp + 16) = t7; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L417228; +a0 = s0; +L417228: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L417244; +a3 = 0xa; +L417244: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t5 = 0xa; +MEM_U32(sp + 16) = t5; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L41726c; +a2 = a2; +L41726c: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L417288; +a3 = 0xa; +L417288: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +a2 = 0x1000258c; +//nop; +t4 = 0xa; +MEM_U32(sp + 16) = t4; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L4172b0; +a2 = a2; +L4172b0: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L4172c8; +//nop; +L4172c8: +gp = MEM_U32(sp + 32); +//nop; +L4172d0: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_a(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4172e0: +//emit_a: +//nop; +//nop; +//nop; +t0 = 0x10018e70; +sp = sp + 0xffffffd0; +v1 = 0x10018e6c; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(v1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 56) = a2; +MEM_U32(sp + 60) = a3; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t4 = t9 & 0xffc0; +t5 = t4 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t5; +t6 = MEM_U32(t0 + 0); +t7 = MEM_U32(v1 + 0); +t8 = t6 << 4; +v0 = t7 + t8; +t1 = MEM_U16(v0 + -10); +t9 = MEM_U16(sp + 50); +t4 = t1 << 22; +t5 = t4 >> 23; +t6 = t9 ^ t5; +t7 = t6 << 23; +t8 = t7 >> 22; +t4 = t8 ^ t1; +MEM_U16(v0 + -10) = (uint16_t)t4; +t5 = MEM_U32(t0 + 0); +t9 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t6 = t5 << 4; +v0 = t9 + t6; +t7 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t8 = t7 & at; +at = 0x10000; +at = at | 0x8000; +t4 = t8 | at; +MEM_U32(v0 + -8) = t4; +t9 = MEM_U32(t0 + 0); +t5 = MEM_U32(v1 + 0); +t6 = t9 << 4; +t7 = t5 + t6; +MEM_U32(t7 + -16) = a1; +t9 = MEM_U32(t0 + 0); +t4 = MEM_U32(v1 + 0); +t8 = MEM_U32(sp + 56); +t5 = t9 << 4; +t6 = t4 + t5; +MEM_U32(t6 + -4) = t8; +t9 = MEM_U32(t0 + 0); +t7 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t4 = t9 << 4; +v0 = t7 + t4; +t5 = MEM_U32(v0 + -8); +at = 0x1ff0000; +at = at | 0xffff; +t8 = t5 & at; +at = 0x90000000; +t6 = t8 | at; +MEM_U32(v0 + -8) = t6; +t7 = MEM_U32(t0 + 0); +t9 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t4 = t7 << 4; +v0 = t9 + t4; +t5 = MEM_U32(v0 + -8); +at = 0xfe030000; +at = at | 0xffff; +t8 = t5 & at; +at = 0x1200000; +t6 = t8 | at; +MEM_U32(v0 + -8) = t6; +t9 = MEM_U32(t0 + 0); +t7 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t4 = t9 << 4; +v0 = t7 + t4; +t2 = MEM_U32(v0 + -12); +v0 = v0 + 0xfffffff0; +t5 = t2 << 7; +t8 = t5 >> 29; +t6 = a3 ^ t8; +t9 = t6 << 29; +t7 = t9 >> 7; +t4 = t7 ^ t2; +t5 = 0x10018e78; +MEM_U32(v0 + 4) = t4; +t3 = MEM_U32(t0 + 0); +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != t3) {//nop; +goto L41749c;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L417484; +//nop; +L417484: +gp = MEM_U32(sp + 32); +//nop; +t0 = 0x10018e70; +//nop; +t3 = MEM_U32(t0 + 0); +//nop; +L41749c: +t9 = 0x10018ed4; +t8 = t3 + 0x1; +MEM_U32(t0 + 0) = t8; +at = 0x100197c8; +t9 = MEM_U8(t9 + 0); +t6 = 0x1; +if (t9 == 0) {MEM_U8(at + 0) = (uint8_t)t6; +goto L41754c;} +MEM_U8(at + 0) = (uint8_t)t6; +a0 = 0x10006570; +a1 = 0x100081c6; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = 0x8; +a3 = 0x8; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L4174dc; +a1 = a1; +L4174dc: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 50); +a0 = 0x10006570; +a2 = 0x100016f0; +//nop; +a0 = MEM_U32(a0 + 0); +t7 = 0xa; +MEM_U32(sp + 16) = t7; +a3 = zero; +a2 = a2; +MEM_U32(sp + 40) = a0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L41750c; +MEM_U32(sp + 40) = a0; +L41750c: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 40); +//nop; +a1 = MEM_U32(sp + 56); +a2 = 0xc; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L417528; +a3 = 0xa; +L417528: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0x10006570; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L417544; +//nop; +L417544: +gp = MEM_U32(sp + 32); +//nop; +L41754c: +ra = MEM_U32(sp + 36); +sp = sp + 0x30; +//nop; +return; +//nop; +} + +static void f_emit_r(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41755c: +//emit_r: +//nop; +//nop; +//nop; +a2 = 0x10018e70; +sp = sp + 0xffffffd8; +v1 = 0x10018e6c; +t7 = MEM_U32(a2 + 0); +t6 = MEM_U32(v1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t2 = t9 & 0xffc0; +t3 = t2 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t3; +t5 = MEM_U32(a2 + 0); +t4 = MEM_U32(v1 + 0); +t7 = t5 << 4; +v0 = t4 + t7; +a3 = MEM_U16(v0 + -10); +t6 = MEM_U16(sp + 42); +t8 = a3 << 22; +t9 = t8 >> 23; +t2 = t6 ^ t9; +t3 = t2 << 23; +t5 = t3 >> 22; +t4 = t5 ^ a3; +MEM_U16(v0 + -10) = (uint16_t)t4; +t8 = MEM_U32(a2 + 0); +t7 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t6 = t8 << 4; +v0 = t7 + t6; +t9 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t2 = t9 & at; +at = 0x10000; +at = at | 0xc000; +t3 = t2 | at; +MEM_U32(v0 + -8) = t3; +t4 = MEM_U32(a2 + 0); +t5 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t8 = t4 << 4; +v0 = t5 + t8; +t0 = MEM_U32(v0 + -8); +t7 = MEM_U8(sp + 47); +t6 = t0 >> 25; +t9 = t7 ^ t6; +t2 = t9 << 25; +t3 = t2 ^ t0; +MEM_U32(v0 + -8) = t3; +t5 = MEM_U32(a2 + 0); +t4 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t8 = t5 << 4; +v0 = t4 + t8; +t7 = MEM_U32(v0 + -8); +at = 0xfe030000; +at = at | 0xffff; +t6 = t7 & at; +at = 0x1200000; +t9 = t6 | at; +MEM_U32(v0 + -8) = t9; +t3 = MEM_U32(a2 + 0); +t2 = MEM_U32(v1 + 0); +t5 = t3 << 4; +t4 = t2 + t5; +t8 = 0x10018e78; +MEM_U32(t4 + -16) = zero; +t1 = MEM_U32(a2 + 0); +t8 = MEM_U32(t8 + 0); +v0 = v0 + 0xfffffff0; +if (t8 != t1) {t6 = MEM_U16(sp + 42); +goto L4176cc;} +t6 = MEM_U16(sp + 42); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L4176b0; +//nop; +L4176b0: +gp = MEM_U32(sp + 32); +//nop; +a2 = 0x10018e70; +//nop; +t1 = MEM_U32(a2 + 0); +//nop; +t6 = MEM_U16(sp + 42); +L4176cc: +t7 = t1 + 0x1; +at = 0x23; +if (t6 != at) {MEM_U32(a2 + 0) = t7; +goto L4176e8;} +MEM_U32(a2 + 0) = t7; +at = 0x100197c8; +t9 = 0x1; +MEM_U8(at + 0) = (uint8_t)t9; +L4176e8: +t3 = 0x10018ed4; +a2 = 0x8; +t3 = MEM_U8(t3 + 0); +a3 = 0x8; +if (t3 == 0) {ra = MEM_U32(sp + 36); +goto L4177b0;} +ra = MEM_U32(sp + 36); +a0 = 0x10006570; +a1 = 0x100081ce; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L417718; +a1 = a1; +L417718: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 42); +s0 = 0x10006570; +a2 = 0x100016f0; +//nop; +s0 = MEM_U32(s0 + 0); +t2 = 0xa; +MEM_U32(sp + 16) = t2; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L417748; +a0 = s0; +L417748: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L417764; +a3 = 0xa; +L417764: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t5 = 0xa; +MEM_U32(sp + 16) = t5; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L41778c; +a2 = a2; +L41778c: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L4177a4; +//nop; +L4177a4: +gp = MEM_U32(sp + 32); +//nop; +ra = MEM_U32(sp + 36); +L4177b0: +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_i(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4177bc: +//emit_i: +//nop; +//nop; +//nop; +a2 = 0x10018e70; +v1 = 0x10018e6c; +sp = sp + 0xffffffd0; +t7 = MEM_U32(a2 + 0); +t6 = MEM_U32(v1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 52) = a1; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t1 = t9 & 0xffc0; +t2 = t1 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t2; +t4 = MEM_U32(a2 + 0); +t3 = MEM_U32(v1 + 0); +t5 = t4 << 4; +v0 = t3 + t5; +a3 = MEM_U16(v0 + -10); +t7 = MEM_U16(sp + 50); +t6 = a3 << 22; +t8 = t6 >> 23; +t9 = t7 ^ t8; +t1 = t9 << 23; +t2 = t1 >> 22; +t4 = t2 ^ a3; +MEM_U16(v0 + -10) = (uint16_t)t4; +t5 = MEM_U32(a2 + 0); +t3 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t6 = t5 << 4; +v0 = t3 + t6; +t7 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t8 = t7 & at; +at = 0x30000; +at = at | 0x4000; +t9 = t8 | at; +MEM_U32(v0 + -8) = t9; +t4 = MEM_U32(a2 + 0); +t2 = MEM_U32(v1 + 0); +t1 = MEM_U32(sp + 52); +t5 = t4 << 4; +t3 = t2 + t5; +MEM_U32(t3 + -4) = t1; +t7 = MEM_U32(a2 + 0); +t6 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t8 = t7 << 4; +v0 = t6 + t8; +t9 = MEM_U32(v0 + -8); +at = 0x1ff0000; +at = at | 0xffff; +t4 = t9 & at; +at = 0x90000000; +t2 = t4 | at; +MEM_U32(v0 + -8) = t2; +t1 = MEM_U32(a2 + 0); +t5 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t1 << 4; +v0 = t5 + t3; +t7 = MEM_U32(v0 + -8); +at = 0xfe030000; +at = at | 0xffff; +t6 = t7 & at; +at = 0x1200000; +t8 = t6 | at; +MEM_U32(v0 + -8) = t8; +t4 = MEM_U32(a2 + 0); +t9 = MEM_U32(v1 + 0); +t2 = t4 << 4; +t1 = t9 + t2; +t5 = 0x10018e78; +MEM_U32(t1 + -16) = zero; +t0 = MEM_U32(a2 + 0); +t5 = MEM_U32(t5 + 0); +v0 = v0 + 0xfffffff0; +if (t5 != t0) {//nop; +goto L41793c;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L417924; +//nop; +L417924: +gp = MEM_U32(sp + 32); +//nop; +a2 = 0x10018e70; +//nop; +t0 = MEM_U32(a2 + 0); +//nop; +L41793c: +t7 = 0x10018ed4; +t3 = t0 + 0x1; +MEM_U32(a2 + 0) = t3; +t7 = MEM_U8(t7 + 0); +a2 = 0x8; +if (t7 == 0) {a3 = 0x8; +goto L4179e0;} +a3 = 0x8; +a0 = 0x10006570; +a1 = 0x100081d6; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L417970; +a1 = a1; +L417970: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 50); +a0 = 0x10006570; +a2 = 0x100016f0; +//nop; +a0 = MEM_U32(a0 + 0); +t6 = 0xa; +MEM_U32(sp + 16) = t6; +a3 = zero; +a2 = a2; +MEM_U32(sp + 40) = a0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L4179a0; +MEM_U32(sp + 40) = a0; +L4179a0: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 40); +//nop; +a1 = MEM_U32(sp + 52); +a2 = 0xc; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L4179bc; +a3 = 0xa; +L4179bc: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0x10006570; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L4179d8; +//nop; +L4179d8: +gp = MEM_U32(sp + 32); +//nop; +L4179e0: +ra = MEM_U32(sp + 36); +sp = sp + 0x30; +//nop; +return; +//nop; +} + +static void f_emit_rrll(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L417ca8: +//emit_rrll: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t0 = 0x10018e70; +t2 = 0x10018e6c; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(t2 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t3 = t9 & 0xffc0; +t4 = t3 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t4; +t7 = MEM_U32(t0 + 0); +t5 = MEM_U32(t2 + 0); +t6 = t7 << 4; +v0 = t5 + t6; +t1 = MEM_U16(v0 + -10); +t8 = MEM_U16(sp + 42); +t9 = t1 << 22; +t3 = t9 >> 23; +t4 = t8 ^ t3; +t7 = t4 << 23; +t5 = t7 >> 22; +t6 = t5 ^ t1; +MEM_U16(v0 + -10) = (uint16_t)t6; +t8 = MEM_U32(t0 + 0); +t9 = MEM_U32(t2 + 0); +v0 = v0 + 0xfffffff0; +t3 = t8 << 4; +v0 = t9 + t3; +t4 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t7 = t4 & at; +at = 0x20000; +t5 = t7 | at; +MEM_U32(v0 + -8) = t5; +t8 = MEM_U32(t0 + 0); +t6 = MEM_U32(t2 + 0); +v0 = v0 + 0xfffffff0; +t9 = t8 << 4; +v0 = t6 + t9; +v1 = MEM_U32(v0 + -8); +t3 = MEM_U8(sp + 47); +t4 = v1 >> 25; +t7 = t3 ^ t4; +t5 = t7 << 25; +t8 = t5 ^ v1; +MEM_U32(v0 + -8) = t8; +t9 = MEM_U32(t0 + 0); +t6 = MEM_U32(t2 + 0); +v0 = v0 + 0xfffffff0; +t3 = t9 << 4; +v0 = t6 + t3; +v1 = MEM_U32(v0 + -8); +t4 = MEM_U8(sp + 51); +t7 = v1 << 7; +t5 = t7 >> 25; +t8 = t4 ^ t5; +t9 = t8 << 25; +t6 = t9 >> 7; +t3 = t6 ^ v1; +MEM_U32(v0 + -8) = t3; +//nop; +a0 = MEM_U32(sp + 52); +v0 = v0 + 0xfffffff0; +v0 = f_create_local_label(mem, sp, a0); +goto L417ddc; +v0 = v0 + 0xfffffff0; +L417ddc: +gp = MEM_U32(sp + 32); +//nop; +t0 = 0x10018e70; +t2 = 0x10018e6c; +t4 = MEM_U32(t0 + 0); +t7 = MEM_U32(t2 + 0); +t5 = t4 << 4; +t8 = t7 + t5; +t9 = 0x10018e78; +MEM_U32(t8 + -16) = v0; +v1 = MEM_U32(t0 + 0); +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != v1) {//nop; +goto L417e40;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L417e28; +//nop; +L417e28: +gp = MEM_U32(sp + 32); +//nop; +t0 = 0x10018e70; +//nop; +v1 = MEM_U32(t0 + 0); +//nop; +L417e40: +t3 = 0x10018ed4; +t6 = v1 + 0x1; +MEM_U32(t0 + 0) = t6; +t3 = MEM_U8(t3 + 0); +a2 = 0xb; +if (t3 == 0) {a3 = 0xb; +goto L417f6c;} +a3 = 0xb; +a0 = 0x10006570; +a1 = 0x100081e8; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L417e74; +a1 = a1; +L417e74: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 42); +s0 = 0x10006570; +a2 = 0x100016f0; +//nop; +s0 = MEM_U32(s0 + 0); +t4 = 0xa; +MEM_U32(sp + 16) = t4; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L417ea4; +a0 = s0; +L417ea4: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L417ec0; +a3 = 0xa; +L417ec0: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t7 = 0xa; +MEM_U32(sp + 16) = t7; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L417ee8; +a2 = a2; +L417ee8: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L417f04; +a3 = 0xa; +L417f04: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +a2 = 0x1000258c; +//nop; +t5 = 0xa; +MEM_U32(sp + 16) = t5; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L417f2c; +a2 = a2; +L417f2c: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 52); +//nop; +a0 = s0; +a2 = 0xc; +a3 = 0xa; +f_write_cardinal(mem, sp, a0, a1, a2, a3); +goto L417f48; +a3 = 0xa; +L417f48: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0x10006570; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L417f64; +//nop; +L417f64: +gp = MEM_U32(sp + 32); +//nop; +L417f6c: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_rll(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L4181fc: +//emit_rll: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +v1 = 0x10018e70; +t1 = 0x10018e6c; +t7 = MEM_U32(v1 + 0); +t6 = MEM_U32(t1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t2 = t9 & 0xffc0; +t3 = t2 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t3; +t5 = MEM_U32(v1 + 0); +t4 = MEM_U32(t1 + 0); +t7 = t5 << 4; +v0 = t4 + t7; +a3 = MEM_U16(v0 + -10); +t6 = MEM_U16(sp + 42); +t8 = a3 << 22; +t9 = t8 >> 23; +t2 = t6 ^ t9; +t3 = t2 << 23; +t5 = t3 >> 22; +t4 = t5 ^ a3; +MEM_U16(v0 + -10) = (uint16_t)t4; +t8 = MEM_U32(v1 + 0); +t7 = MEM_U32(t1 + 0); +t6 = t8 << 4; +t9 = t7 + t6; +MEM_U32(t9 + -4) = zero; +t3 = MEM_U32(v1 + 0); +t2 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t5 = t3 << 4; +v0 = t2 + t5; +t4 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t8 = t4 & at; +at = 0x20000; +at = at | 0x4000; +t7 = t8 | at; +MEM_U32(v0 + -8) = t7; +t9 = MEM_U32(v1 + 0); +t6 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t9 << 4; +v0 = t6 + t3; +t0 = MEM_U32(v0 + -8); +t2 = MEM_U8(sp + 47); +t5 = t0 >> 25; +t4 = t2 ^ t5; +t8 = t4 << 25; +t7 = t8 ^ t0; +MEM_U32(v0 + -8) = t7; +t6 = MEM_U32(v1 + 0); +t9 = MEM_U32(t1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t6 << 4; +v0 = t9 + t3; +t2 = MEM_U32(v0 + -8); +at = 0xfe030000; +at = at | 0xffff; +t5 = t2 & at; +at = 0x1200000; +t4 = t5 | at; +MEM_U32(v0 + -8) = t4; +//nop; +a0 = MEM_U32(sp + 48); +v0 = v0 + 0xfffffff0; +v0 = f_create_local_label(mem, sp, a0); +goto L41833c; +v0 = v0 + 0xfffffff0; +L41833c: +gp = MEM_U32(sp + 32); +//nop; +v1 = 0x10018e70; +t1 = 0x10018e6c; +t7 = MEM_U32(v1 + 0); +t8 = MEM_U32(t1 + 0); +t6 = t7 << 4; +t9 = t8 + t6; +t3 = 0x10018e78; +MEM_U32(t9 + -16) = v0; +a0 = MEM_U32(v1 + 0); +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != a0) {//nop; +goto L4183a0;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L418388; +//nop; +L418388: +gp = MEM_U32(sp + 32); +//nop; +v1 = 0x10018e70; +//nop; +a0 = MEM_U32(v1 + 0); +//nop; +L4183a0: +t5 = 0x10018ed4; +t2 = a0 + 0x1; +MEM_U32(v1 + 0) = t2; +t5 = MEM_U8(t5 + 0); +a2 = 0xa; +if (t5 == 0) {a3 = 0xa; +goto L418488;} +a3 = 0xa; +a0 = 0x10006570; +a1 = 0x100081fc; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L4183d4; +a1 = a1; +L4183d4: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 42); +s0 = 0x10006570; +a2 = 0x100016f0; +//nop; +s0 = MEM_U32(s0 + 0); +t4 = 0xa; +MEM_U32(sp + 16) = t4; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L418404; +a0 = s0; +L418404: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L418420; +a3 = 0xa; +L418420: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t7 = 0xa; +MEM_U32(sp + 16) = t7; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L418448; +a2 = a2; +L418448: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +//nop; +a0 = s0; +a2 = 0xc; +a3 = 0xa; +f_write_cardinal(mem, sp, a0, a1, a2, a3); +goto L418464; +a3 = 0xa; +L418464: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0x10006570; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L418480; +//nop; +L418480: +gp = MEM_U32(sp + 32); +//nop; +L418488: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_ll(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4186b8: +//emit_ll: +//nop; +//nop; +//nop; +a2 = 0x10018e70; +a3 = 0x10018e6c; +sp = sp + 0xffffffc8; +t7 = MEM_U32(a2 + 0); +t6 = MEM_U32(a3 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +v1 = t6 + t8; +t9 = MEM_U8(v1 + -11); +v1 = v1 + 0xfffffff0; +t0 = t9 & 0xffc0; +t1 = t0 | 0x17; +MEM_U8(v1 + 5) = (uint8_t)t1; +t3 = MEM_U32(a2 + 0); +t2 = MEM_U32(a3 + 0); +t4 = t3 << 4; +v1 = t2 + t4; +v0 = MEM_U16(v1 + -10); +t5 = MEM_U16(sp + 58); +t7 = v0 << 22; +t6 = t7 >> 23; +t8 = t5 ^ t6; +t9 = t8 << 23; +t0 = t9 >> 22; +t1 = t0 ^ v0; +MEM_U16(v1 + -10) = (uint16_t)t1; +t2 = MEM_U32(a2 + 0); +t3 = MEM_U32(a3 + 0); +v1 = v1 + 0xfffffff0; +t4 = t2 << 4; +v1 = t3 + t4; +t7 = MEM_U32(v1 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t5 = t7 & at; +at = 0x20000; +at = at | 0x8000; +t6 = t5 | at; +MEM_U32(v1 + -8) = t6; +//nop; +a0 = MEM_U32(sp + 60); +v1 = v1 + 0xfffffff0; +v0 = f_create_local_label(mem, sp, a0); +goto L41877c; +v1 = v1 + 0xfffffff0; +L41877c: +gp = MEM_U32(sp + 32); +at = 0x1ff0000; +a2 = 0x10018e70; +a3 = 0x10018e6c; +t9 = MEM_U32(a2 + 0); +t8 = MEM_U32(a3 + 0); +t0 = t9 << 4; +t1 = t8 + t0; +MEM_U32(t1 + -16) = v0; +t3 = MEM_U32(a2 + 0); +t2 = MEM_U32(a3 + 0); +t4 = t3 << 4; +v1 = t2 + t4; +t7 = MEM_U32(v1 + -8); +at = at | 0xffff; +t5 = t7 & at; +at = 0x90000000; +t6 = t5 | at; +MEM_U32(v1 + -8) = t6; +t8 = MEM_U32(a2 + 0); +t9 = MEM_U32(a3 + 0); +v1 = v1 + 0xfffffff0; +t0 = t8 << 4; +v1 = t9 + t0; +t1 = MEM_U32(v1 + -8); +at = 0xfe030000; +at = at | 0xffff; +t3 = t1 & at; +at = 0x1200000; +t2 = t3 | at; +t4 = 0x10018e78; +MEM_U32(v1 + -8) = t2; +a0 = MEM_U32(a2 + 0); +t4 = MEM_U32(t4 + 0); +v1 = v1 + 0xfffffff0; +if (t4 != a0) {//nop; +goto L418838;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L418820; +//nop; +L418820: +gp = MEM_U32(sp + 32); +//nop; +a2 = 0x10018e70; +//nop; +a0 = MEM_U32(a2 + 0); +//nop; +L418838: +t5 = 0x10018ed4; +t7 = a0 + 0x1; +MEM_U32(a2 + 0) = t7; +t5 = MEM_U8(t5 + 0); +a2 = 0x9; +if (t5 == 0) {a3 = 0x9; +goto L4188dc;} +a3 = 0x9; +a0 = 0x10006570; +a1 = 0x1000820e; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L41886c; +a1 = a1; +L41886c: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 58); +a0 = 0x10006570; +a2 = 0x100016f0; +//nop; +a0 = MEM_U32(a0 + 0); +t6 = 0xa; +MEM_U32(sp + 16) = t6; +a3 = zero; +a2 = a2; +MEM_U32(sp + 44) = a0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L41889c; +MEM_U32(sp + 44) = a0; +L41889c: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 44); +//nop; +a1 = MEM_U32(sp + 60); +a2 = 0xc; +a3 = 0xa; +f_write_cardinal(mem, sp, a0, a1, a2, a3); +goto L4188b8; +a3 = 0xa; +L4188b8: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0x10006570; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L4188d4; +//nop; +L4188d4: +gp = MEM_U32(sp + 32); +//nop; +L4188dc: +ra = MEM_U32(sp + 36); +sp = sp + 0x38; +//nop; +return; +//nop; +} + +static void f_emit_rill(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L418b90: +//emit_rill: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +v1 = 0x10018e70; +t2 = 0x10018e6c; +t7 = MEM_U32(v1 + 0); +t6 = MEM_U32(t2 + 0); +t8 = t7 << 4; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t3 = t9 & 0xffc0; +t4 = t3 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t4; +t7 = MEM_U32(v1 + 0); +t5 = MEM_U32(t2 + 0); +t6 = t7 << 4; +v0 = t5 + t6; +t0 = MEM_U16(v0 + -10); +t8 = MEM_U16(sp + 42); +t9 = t0 << 22; +t3 = t9 >> 23; +t4 = t8 ^ t3; +t7 = t4 << 23; +t5 = t7 >> 22; +t6 = t5 ^ t0; +MEM_U16(v0 + -10) = (uint16_t)t6; +t8 = MEM_U32(v1 + 0); +t9 = MEM_U32(t2 + 0); +v0 = v0 + 0xfffffff0; +t3 = t8 << 4; +v0 = t9 + t3; +t1 = MEM_U32(v0 + -8); +t4 = MEM_U8(sp + 47); +t7 = t1 >> 25; +t5 = t4 ^ t7; +t6 = t5 << 25; +t8 = t6 ^ t1; +MEM_U32(v0 + -8) = t8; +t3 = MEM_U32(v1 + 0); +t9 = MEM_U32(t2 + 0); +v0 = v0 + 0xfffffff0; +t4 = t3 << 4; +v0 = t9 + t4; +t7 = MEM_U32(v0 + -8); +at = 0xfe030000; +at = at | 0xffff; +t5 = t7 & at; +at = 0x1200000; +t6 = t5 | at; +MEM_U32(v0 + -8) = t6; +t9 = MEM_U32(v1 + 0); +t3 = MEM_U32(t2 + 0); +t8 = MEM_U32(sp + 48); +t4 = t9 << 4; +t7 = t3 + t4; +MEM_U32(t7 + -4) = t8; +t6 = MEM_U32(v1 + 0); +t5 = MEM_U32(t2 + 0); +v0 = v0 + 0xfffffff0; +t9 = t6 << 4; +v0 = t5 + t9; +t3 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t4 = t3 & at; +at = 0x30000; +t8 = t4 | at; +MEM_U32(v0 + -8) = t8; +//nop; +a0 = MEM_U32(sp + 52); +v0 = v0 + 0xfffffff0; +v0 = f_create_local_label(mem, sp, a0); +goto L418cd4; +v0 = v0 + 0xfffffff0; +L418cd4: +gp = MEM_U32(sp + 32); +//nop; +v1 = 0x10018e70; +t2 = 0x10018e6c; +t6 = MEM_U32(v1 + 0); +t7 = MEM_U32(t2 + 0); +t5 = t6 << 4; +t9 = t7 + t5; +t3 = 0x10018e78; +MEM_U32(t9 + -16) = v0; +a0 = MEM_U32(v1 + 0); +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != a0) {//nop; +goto L418d38;} +//nop; +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L418d20; +//nop; +L418d20: +gp = MEM_U32(sp + 32); +//nop; +v1 = 0x10018e70; +//nop; +a0 = MEM_U32(v1 + 0); +//nop; +L418d38: +t8 = 0x10018ed4; +t4 = a0 + 0x1; +MEM_U32(v1 + 0) = t4; +t8 = MEM_U8(t8 + 0); +a2 = 0xb; +if (t8 == 0) {a3 = 0xb; +goto L418e40;} +a3 = 0xb; +a0 = 0x10006570; +a1 = 0x10008221; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L418d6c; +a1 = a1; +L418d6c: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(sp + 42); +s0 = 0x10006570; +a2 = 0x100016f0; +//nop; +s0 = MEM_U32(s0 + 0); +t6 = 0xa; +MEM_U32(sp + 16) = t6; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L418d9c; +a0 = s0; +L418d9c: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L418db8; +a3 = 0xa; +L418db8: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = 0x1000258c; +//nop; +t7 = 0xa; +MEM_U32(sp + 16) = t7; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L418de0; +a2 = a2; +L418de0: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +//nop; +a0 = s0; +a2 = 0xc; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L418dfc; +a3 = 0xa; +L418dfc: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 52); +a0 = 0x10006570; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = 0xc; +a3 = 0xa; +f_write_cardinal(mem, sp, a0, a1, a2, a3); +goto L418e1c; +a3 = 0xa; +L418e1c: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0x10006570; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L418e38; +//nop; +L418e38: +gp = MEM_U32(sp + 32); +//nop; +L418e40: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_define_label(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L418e50: +//define_label: +//nop; +//nop; +//nop; +t8 = 0x10018e70; +sp = sp + 0xffffffe0; +t6 = 0x10018e6c; +t8 = MEM_U32(t8 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t7 = MEM_U32(t6 + 0); +t9 = t8 << 4; +v0 = t7 + t9; +t0 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t1 = t0 & 0xffc0; +MEM_U8(v0 + 5) = (uint8_t)t1; +//nop; +//nop; +//nop; +v0 = f_create_local_label(mem, sp, a0); +goto L418ea0; +//nop; +L418ea0: +gp = MEM_U32(sp + 24); +//nop; +a0 = 0x10018e70; +t2 = 0x10018e6c; +t4 = MEM_U32(a0 + 0); +t3 = MEM_U32(t2 + 0); +t5 = t4 << 4; +t6 = t3 + t5; +t8 = 0x10018e78; +MEM_U32(t6 + -16) = v0; +v1 = MEM_U32(a0 + 0); +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != v1) {ra = MEM_U32(sp + 28); +goto L418f08;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L418eec; +//nop; +L418eec: +gp = MEM_U32(sp + 24); +//nop; +a0 = 0x10018e70; +//nop; +v1 = MEM_U32(a0 + 0); +//nop; +ra = MEM_U32(sp + 28); +L418f08: +t7 = v1 + 0x1; +MEM_U32(a0 + 0) = t7; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_emit_itext(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L418f18: +//emit_itext: +//nop; +//nop; +//nop; +a1 = 0x10018e70; +v1 = 0x10018e6c; +t7 = MEM_U32(a1 + 0); +t6 = MEM_U32(v1 + 0); +sp = sp + 0xffffffe0; +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t1 = t9 & 0xffc0; +t2 = t1 | 0x15; +MEM_U8(v0 + 5) = (uint8_t)t2; +t4 = MEM_U32(a1 + 0); +t3 = MEM_U32(v1 + 0); +t5 = t4 << 4; +t7 = t3 + t5; +MEM_U32(t7 + -16) = zero; +t9 = MEM_U32(a1 + 0); +t8 = MEM_U32(v1 + 0); +t6 = MEM_U32(a0 + 0); +t1 = t9 << 4; +t2 = t8 + t1; +t4 = 0x10018e78; +MEM_U32(t2 + -8) = t6; +a2 = MEM_U32(a1 + 0); +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != a2) {//nop; +goto L418fc8;} +//nop; +//nop; +MEM_U32(sp + 32) = a0; +//nop; +f_grow_ibuffer(mem, sp); +goto L418fb0; +//nop; +L418fb0: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +a1 = 0x10018e70; +v1 = 0x10018e6c; +a2 = MEM_U32(a1 + 0); +//nop; +L418fc8: +t1 = 0x1000822c; +t3 = a2 + 0x1; +MEM_U32(a1 + 0) = t3; +t7 = MEM_U32(a1 + 0); +t1 = t1; +t5 = MEM_U32(v1 + 0); +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t7 << 4; +t8 = t5 + t9; +MEM_U8(t8 + -16 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + -16 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + -16 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + -16 + 3) = (uint8_t)(at >> 0); +//swr $at, -0xd($t8) +t2 = t1 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t1) +//nop; +MEM_U8(t8 + -12 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t8 + -12 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t8 + -12 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t8 + -12 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, -9($t8) +at = t1 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t1) +//nop; +MEM_U8(t8 + -8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + -8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + -8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + -8 + 3) = (uint8_t)(at >> 0); +//swr $at, -5($t8) +t2 = t1 + 12; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 0xf($t1) +//nop; +MEM_U8(t8 + -4 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t8 + -4 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t8 + -4 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t8 + -4 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, -1($t8) +a3 = MEM_U32(a0 + 0); +//nop; +if (a3 == 0) {a3 = a3 + 0x1; +goto L419124;} +a3 = a3 + 0x1; +t0 = a3 + 0xffffffff; +t4 = t0 & 0x3; +if (t4 == 0) {v0 = 0x1; +goto L41908c;} +v0 = 0x1; +a2 = t4 + 0x1; +L419058: +t6 = MEM_U32(a1 + 0); +t3 = MEM_U32(a0 + 4); +t9 = MEM_U32(v1 + 0); +t8 = t6 << 4; +t7 = t3 + v0; +t1 = t9 + t8; +t5 = MEM_U8(t7 + -1); +t2 = t1 + v0; +v0 = v0 + 0x1; +if (a2 != v0) {MEM_U8(t2 + -17) = (uint8_t)t5; +goto L419058;} +MEM_U8(t2 + -17) = (uint8_t)t5; +if (v0 == a3) {//nop; +goto L419124;} +//nop; +L41908c: +t4 = MEM_U32(a0 + 4); +t9 = MEM_U32(a1 + 0); +t6 = MEM_U32(v1 + 0); +t3 = t4 + v0; +t8 = t9 << 4; +t7 = MEM_U8(t3 + -1); +t1 = t6 + t8; +t5 = t1 + v0; +MEM_U8(t5 + -17) = (uint8_t)t7; +t6 = MEM_U32(a1 + 0); +t2 = MEM_U32(a0 + 4); +t9 = MEM_U32(v1 + 0); +t8 = t6 << 4; +t4 = t2 + v0; +t3 = MEM_U8(t4 + 0); +t1 = t9 + t8; +t7 = t1 + v0; +MEM_U8(t7 + -16) = (uint8_t)t3; +t9 = MEM_U32(a1 + 0); +t5 = MEM_U32(a0 + 4); +t6 = MEM_U32(v1 + 0); +t8 = t9 << 4; +t2 = t5 + v0; +t4 = MEM_U8(t2 + 1); +t1 = t6 + t8; +t3 = t1 + v0; +MEM_U8(t3 + -15) = (uint8_t)t4; +t6 = MEM_U32(a1 + 0); +t9 = MEM_U32(v1 + 0); +t7 = MEM_U32(a0 + 4); +t8 = t6 << 4; +t1 = t9 + t8; +t5 = t7 + v0; +t2 = MEM_U8(t5 + 2); +t4 = t1 + v0; +v0 = v0 + 0x4; +if (v0 != a3) {MEM_U8(t4 + -14) = (uint8_t)t2; +goto L41908c;} +MEM_U8(t4 + -14) = (uint8_t)t2; +L419124: +t3 = 0x10018e78; +a2 = MEM_U32(a1 + 0); +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != a2) {ra = MEM_U32(sp + 28); +goto L419168;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41914c; +//nop; +L41914c: +gp = MEM_U32(sp + 24); +//nop; +a1 = 0x10018e70; +//nop; +a2 = MEM_U32(a1 + 0); +//nop; +ra = MEM_U32(sp + 28); +L419168: +t7 = a2 + 0x1; +MEM_U32(a1 + 0) = t7; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_itext(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L419178: +//demit_itext: +//nop; +//nop; +//nop; +a1 = 0x10018e78; +v1 = 0x10018e6c; +t7 = MEM_U32(a1 + 0); +t6 = MEM_U32(v1 + 0); +sp = sp + 0xffffffe0; +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t1 = t9 & 0xffc0; +t2 = t1 | 0x15; +MEM_U8(v0 + 5) = (uint8_t)t2; +t4 = MEM_U32(a1 + 0); +t3 = MEM_U32(v1 + 0); +t5 = t4 << 4; +t7 = t3 + t5; +MEM_U32(t7 + -16) = zero; +t9 = MEM_U32(a1 + 0); +t8 = MEM_U32(v1 + 0); +t6 = MEM_U32(a0 + 0); +t1 = t9 << 4; +t2 = t8 + t1; +t4 = 0x10018e70; +MEM_U32(t2 + -8) = t6; +a2 = MEM_U32(a1 + 0); +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != a2) {//nop; +goto L419228;} +//nop; +//nop; +MEM_U32(sp + 32) = a0; +//nop; +f_grow_ibuffer(mem, sp); +goto L419210; +//nop; +L419210: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +a1 = 0x10018e78; +v1 = 0x10018e6c; +a2 = MEM_U32(a1 + 0); +//nop; +L419228: +t1 = 0x1000823c; +t3 = a2 + 0xffffffff; +MEM_U32(a1 + 0) = t3; +t7 = MEM_U32(a1 + 0); +t1 = t1; +t5 = MEM_U32(v1 + 0); +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t7 << 4; +t8 = t5 + t9; +MEM_U8(t8 + -16 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + -16 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + -16 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + -16 + 3) = (uint8_t)(at >> 0); +//swr $at, -0xd($t8) +t2 = t1 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t1) +//nop; +MEM_U8(t8 + -12 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t8 + -12 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t8 + -12 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t8 + -12 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, -9($t8) +at = t1 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t1) +//nop; +MEM_U8(t8 + -8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + -8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + -8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + -8 + 3) = (uint8_t)(at >> 0); +//swr $at, -5($t8) +t2 = t1 + 12; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 0xf($t1) +//nop; +MEM_U8(t8 + -4 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t8 + -4 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t8 + -4 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t8 + -4 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, -1($t8) +a3 = MEM_U32(a0 + 0); +//nop; +if (a3 == 0) {a3 = a3 + 0x1; +goto L419384;} +a3 = a3 + 0x1; +t0 = a3 + 0xffffffff; +t4 = t0 & 0x3; +if (t4 == 0) {v0 = 0x1; +goto L4192ec;} +v0 = 0x1; +a2 = t4 + 0x1; +L4192b8: +t6 = MEM_U32(a1 + 0); +t3 = MEM_U32(a0 + 4); +t9 = MEM_U32(v1 + 0); +t8 = t6 << 4; +t7 = t3 + v0; +t1 = t9 + t8; +t5 = MEM_U8(t7 + -1); +t2 = t1 + v0; +v0 = v0 + 0x1; +if (a2 != v0) {MEM_U8(t2 + -17) = (uint8_t)t5; +goto L4192b8;} +MEM_U8(t2 + -17) = (uint8_t)t5; +if (v0 == a3) {//nop; +goto L419384;} +//nop; +L4192ec: +t4 = MEM_U32(a0 + 4); +t9 = MEM_U32(a1 + 0); +t6 = MEM_U32(v1 + 0); +t3 = t4 + v0; +t8 = t9 << 4; +t7 = MEM_U8(t3 + -1); +t1 = t6 + t8; +t5 = t1 + v0; +MEM_U8(t5 + -17) = (uint8_t)t7; +t6 = MEM_U32(a1 + 0); +t2 = MEM_U32(a0 + 4); +t9 = MEM_U32(v1 + 0); +t8 = t6 << 4; +t4 = t2 + v0; +t3 = MEM_U8(t4 + 0); +t1 = t9 + t8; +t7 = t1 + v0; +MEM_U8(t7 + -16) = (uint8_t)t3; +t9 = MEM_U32(a1 + 0); +t5 = MEM_U32(a0 + 4); +t6 = MEM_U32(v1 + 0); +t8 = t9 << 4; +t2 = t5 + v0; +t4 = MEM_U8(t2 + 1); +t1 = t6 + t8; +t3 = t1 + v0; +MEM_U8(t3 + -15) = (uint8_t)t4; +t6 = MEM_U32(a1 + 0); +t9 = MEM_U32(v1 + 0); +t7 = MEM_U32(a0 + 4); +t8 = t6 << 4; +t1 = t9 + t8; +t5 = t7 + v0; +t2 = MEM_U8(t5 + 2); +t4 = t1 + v0; +v0 = v0 + 0x4; +if (v0 != a3) {MEM_U8(t4 + -14) = (uint8_t)t2; +goto L4192ec;} +MEM_U8(t4 + -14) = (uint8_t)t2; +L419384: +t3 = 0x10018e70; +a2 = MEM_U32(a1 + 0); +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != a2) {ra = MEM_U32(sp + 28); +goto L4193c8;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L4193ac; +//nop; +L4193ac: +gp = MEM_U32(sp + 24); +//nop; +a1 = 0x10018e78; +//nop; +a2 = MEM_U32(a1 + 0); +//nop; +ra = MEM_U32(sp + 28); +L4193c8: +t7 = a2 + 0xffffffff; +MEM_U32(a1 + 0) = t7; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_emit_dir0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4193d8: +//emit_dir0: +//nop; +//nop; +//nop; +a3 = 0x10018e70; +a2 = 0x10018e6c; +t7 = MEM_U32(a3 + 0); +sp = sp + 0xffffffe0; +t6 = MEM_U32(a2 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +v0 = t6 + t8; +v1 = MEM_U8(v0 + -11); +t4 = a0 < 0x40; +t9 = v1 << 26; +t0 = t9 >> 26; +t1 = a0 ^ t0; +t2 = t1 & 0x3f; +t3 = t2 ^ v1; +MEM_U8(v0 + -11) = (uint8_t)t3; +if (t4 == 0) {v0 = v0 + 0xfffffff0; +goto L419458;} +v0 = v0 + 0xfffffff0; +t6 = 0x100027ac; +t5 = (int)a0 >> 5; +t7 = t5 << 2; +t6 = t6; +t8 = t6 + t7; +t9 = MEM_U32(t8 + 0); +//nop; +t0 = t9 << (a0 & 0x1f); +t4 = (int)t0 < (int)0x0; +L419458: +if (t4 == 0) {//nop; +goto L41948c;} +//nop; +t3 = MEM_U32(a3 + 0); +t2 = MEM_U32(a2 + 0); +t5 = t3 << 4; +t6 = t2 + t5; +MEM_U32(t6 + -16) = zero; +t8 = MEM_U32(a3 + 0); +t7 = MEM_U32(a2 + 0); +t9 = t8 << 4; +t0 = t7 + t9; +MEM_U32(t0 + -8) = a1; +goto L4194c8; +MEM_U32(t0 + -8) = a1; +L41948c: +t4 = MEM_U32(a3 + 0); +t1 = MEM_U32(a2 + 0); +t3 = t4 << 4; +t2 = t1 + t3; +MEM_U32(t2 + -16) = a1; +t6 = MEM_U32(a3 + 0); +t5 = MEM_U32(a2 + 0); +t8 = t6 << 4; +t7 = t5 + t8; +MEM_U32(t7 + -8) = zero; +t0 = MEM_U32(a3 + 0); +t9 = MEM_U32(a2 + 0); +t4 = t0 << 4; +t1 = t9 + t4; +MEM_U32(t1 + -8) = zero; +L4194c8: +t2 = MEM_U32(a3 + 0); +t3 = MEM_U32(a2 + 0); +t6 = t2 << 4; +t5 = t3 + t6; +t8 = 0x10018e78; +MEM_U32(t5 + -4) = zero; +v0 = MEM_U32(a3 + 0); +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != v0) {ra = MEM_U32(sp + 28); +goto L419520;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L419504; +//nop; +L419504: +gp = MEM_U32(sp + 24); +//nop; +a3 = 0x10018e70; +//nop; +v0 = MEM_U32(a3 + 0); +//nop; +ra = MEM_U32(sp + 28); +L419520: +t7 = v0 + 0x1; +MEM_U32(a3 + 0) = t7; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_emit_dir1(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L419530: +//emit_dir1: +//nop; +//nop; +//nop; +t1 = 0x10018e70; +t0 = 0x10018e6c; +t7 = MEM_U32(t1 + 0); +sp = sp + 0xffffffe0; +t6 = MEM_U32(t0 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +v0 = t6 + t8; +v1 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t9 = v1 << 26; +t2 = t9 >> 26; +t3 = a0 ^ t2; +t4 = t3 & 0x3f; +t5 = t4 ^ v1; +MEM_U8(v0 + 5) = (uint8_t)t5; +t6 = MEM_U32(t1 + 0); +t7 = MEM_U32(t0 + 0); +t8 = t6 << 4; +t9 = t7 + t8; +MEM_U32(t9 + -8) = a2; +t3 = MEM_U32(t1 + 0); +t2 = MEM_U32(t0 + 0); +t4 = t3 << 4; +t5 = t2 + t4; +t6 = 0x10018e78; +MEM_U32(t5 + -16) = a1; +a3 = MEM_U32(t1 + 0); +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != a3) {ra = MEM_U32(sp + 28); +goto L4195f0;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L4195d4; +//nop; +L4195d4: +gp = MEM_U32(sp + 24); +//nop; +t1 = 0x10018e70; +//nop; +a3 = MEM_U32(t1 + 0); +//nop; +ra = MEM_U32(sp + 28); +L4195f0: +t7 = a3 + 0x1; +MEM_U32(t1 + 0) = t7; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_emit_dir2(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L419600: +//emit_dir2: +//nop; +//nop; +//nop; +t1 = 0x10018e70; +t0 = 0x10018e6c; +t7 = MEM_U32(t1 + 0); +sp = sp + 0xffffffe0; +t6 = MEM_U32(t0 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +v0 = t6 + t8; +v1 = MEM_U8(v0 + -11); +at = 0x1c; +t9 = v1 << 26; +t2 = t9 >> 26; +t3 = a0 ^ t2; +t4 = t3 & 0x3f; +t5 = t4 ^ v1; +MEM_U8(v0 + -11) = (uint8_t)t5; +t6 = MEM_U32(t1 + 0); +t7 = MEM_U32(t0 + 0); +t8 = t6 << 4; +t9 = t7 + t8; +v0 = v0 + 0xfffffff0; +if (a0 == at) {MEM_U32(t9 + -16) = a1; +goto L4196a0;} +MEM_U32(t9 + -16) = a1; +t2 = a0 + 0xffffffce; +at = t2 < 0x2; +if (at == 0) {//nop; +goto L419724;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000824c[] = { +&&L4196cc, +&&L4196f8, +}; +dest = Lswitch1000824c[t2]; +//nop; +goto *dest; +//nop; +L4196a0: +t4 = MEM_U32(t1 + 0); +t3 = MEM_U32(t0 + 0); +t5 = t4 << 4; +t6 = t3 + t5; +MEM_U32(t6 + -8) = a2; +t8 = MEM_U32(t1 + 0); +t7 = MEM_U32(t0 + 0); +t9 = t8 << 4; +t2 = t7 + t9; +MEM_U32(t2 + -4) = a3; +goto L41974c; +MEM_U32(t2 + -4) = a3; +L4196cc: +t3 = MEM_U32(t1 + 0); +t4 = MEM_U32(t0 + 0); +t5 = t3 << 4; +t6 = t4 + t5; +MEM_U32(t6 + -8) = a2; +t7 = MEM_U32(t1 + 0); +t8 = MEM_U32(t0 + 0); +t9 = t7 << 4; +t2 = t8 + t9; +MEM_U32(t2 + -4) = a3; +goto L41974c; +MEM_U32(t2 + -4) = a3; +L4196f8: +t4 = MEM_U32(t1 + 0); +t3 = MEM_U32(t0 + 0); +t5 = t4 << 4; +t6 = t3 + t5; +MEM_U32(t6 + -8) = a2; +t8 = MEM_U32(t1 + 0); +t7 = MEM_U32(t0 + 0); +t9 = t8 << 4; +t2 = t7 + t9; +MEM_U32(t2 + -4) = a3; +goto L41974c; +MEM_U32(t2 + -4) = a3; +L419724: +t3 = MEM_U32(t1 + 0); +t4 = MEM_U32(t0 + 0); +t5 = t3 << 4; +t6 = t4 + t5; +MEM_U32(t6 + -8) = a2; +t7 = MEM_U32(t1 + 0); +t8 = MEM_U32(t0 + 0); +t9 = t7 << 4; +t2 = t8 + t9; +MEM_U32(t2 + -4) = a3; +L41974c: +t3 = 0x10018e78; +v0 = MEM_U32(t1 + 0); +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != v0) {ra = MEM_U32(sp + 28); +goto L419790;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L419774; +//nop; +L419774: +gp = MEM_U32(sp + 24); +//nop; +t1 = 0x10018e70; +//nop; +v0 = MEM_U32(t1 + 0); +//nop; +ra = MEM_U32(sp + 28); +L419790: +t4 = v0 + 0x1; +MEM_U32(t1 + 0) = t4; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_emit_alias(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L4197a0: +//emit_alias: +//nop; +//nop; +//nop; +t1 = 0x10018e70; +sp = sp + 0xffffffe0; +t0 = 0x10018e6c; +t7 = MEM_U32(t1 + 0); +t6 = MEM_U32(t0 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +v0 = t6 + t8; +a3 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t9 = a3 << 26; +t3 = t9 >> 26; +t4 = a0 ^ t3; +t5 = t4 & 0x3f; +t7 = t5 ^ a3; +MEM_U8(v0 + 5) = (uint8_t)t7; +t8 = MEM_U32(t1 + 0); +t6 = MEM_U32(t0 + 0); +t9 = t8 << 4; +t3 = t6 + t9; +MEM_U32(t3 + -16) = zero; +t5 = MEM_U32(t1 + 0); +t4 = MEM_U32(t0 + 0); +t7 = t5 << 4; +v0 = t4 + t7; +v1 = MEM_U32(v0 + -12); +v0 = v0 + 0xfffffff0; +t8 = v1 << 16; +t6 = t8 >> 25; +t9 = a1 ^ t6; +t3 = t9 << 25; +t5 = t3 >> 16; +t4 = t5 ^ v1; +MEM_U32(v0 + 4) = t4; +t8 = MEM_U32(t1 + 0); +t7 = MEM_U32(t0 + 0); +t6 = t8 << 4; +v0 = t7 + t6; +v1 = MEM_U32(v0 + -12); +t6 = 0x10018e78; +t9 = v1 << 23; +t3 = t9 >> 25; +t5 = a2 ^ t3; +t4 = t5 << 25; +t8 = t4 >> 23; +t7 = t8 ^ v1; +MEM_U32(v0 + -12) = t7; +t2 = MEM_U32(t1 + 0); +t6 = MEM_U32(t6 + 0); +v0 = v0 + 0xfffffff0; +if (t6 != t2) {ra = MEM_U32(sp + 28); +goto L4198b8;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41989c; +//nop; +L41989c: +gp = MEM_U32(sp + 24); +//nop; +t1 = 0x10018e70; +//nop; +t2 = MEM_U32(t1 + 0); +//nop; +ra = MEM_U32(sp + 28); +L4198b8: +t9 = t2 + 0x1; +MEM_U32(t1 + 0) = t9; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_emit_regmask(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L4198c8: +//emit_regmask: +//nop; +//nop; +//nop; +t0 = 0x10018e70; +a3 = 0x10018e6c; +t7 = MEM_U32(t0 + 0); +sp = sp + 0xffffffe0; +t6 = MEM_U32(a3 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +v0 = t6 + t8; +v1 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t9 = v1 << 26; +t2 = t9 >> 26; +t3 = a0 ^ t2; +t4 = t3 & 0x3f; +t5 = t4 ^ v1; +MEM_U8(v0 + 5) = (uint8_t)t5; +t6 = MEM_U32(t0 + 0); +t7 = MEM_U32(a3 + 0); +t8 = t6 << 4; +t9 = t7 + t8; +MEM_U32(t9 + -16) = zero; +t3 = MEM_U32(t0 + 0); +t2 = MEM_U32(a3 + 0); +t4 = t3 << 4; +t5 = t2 + t4; +MEM_U32(t5 + -8) = a1; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(a3 + 0); +t8 = t7 << 4; +t9 = t6 + t8; +t3 = 0x10018e78; +MEM_U32(t9 + -4) = a2; +t1 = MEM_U32(t0 + 0); +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != t1) {ra = MEM_U32(sp + 28); +goto L41999c;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L419980; +//nop; +L419980: +gp = MEM_U32(sp + 24); +//nop; +t0 = 0x10018e70; +//nop; +t1 = MEM_U32(t0 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41999c: +t2 = t1 + 0x1; +MEM_U32(t0 + 0) = t2; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_emit_loopno(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4199ac: +//emit_loopno: +//nop; +//nop; +//nop; +a2 = 0x10018e70; +v1 = 0x10018e6c; +t7 = MEM_U32(a2 + 0); +t6 = MEM_U32(v1 + 0); +sp = sp + 0xffffffe0; +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t0 = t9 & 0xffc0; +t1 = t0 | 0x13; +MEM_U8(v0 + 5) = (uint8_t)t1; +t3 = MEM_U32(a2 + 0); +t2 = MEM_U32(v1 + 0); +t4 = t3 << 4; +t5 = t2 + t4; +MEM_U32(t5 + -8) = a0; +t6 = MEM_U32(a2 + 0); +t7 = MEM_U32(v1 + 0); +t8 = t6 << 4; +t9 = t7 + t8; +MEM_U32(t9 + -4) = a1; +t1 = MEM_U32(a2 + 0); +t0 = MEM_U32(v1 + 0); +t3 = t1 << 4; +t2 = t0 + t3; +t4 = 0x10018e78; +MEM_U32(t2 + -16) = zero; +a3 = MEM_U32(a2 + 0); +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != a3) {ra = MEM_U32(sp + 28); +goto L419a70;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L419a54; +//nop; +L419a54: +gp = MEM_U32(sp + 24); +//nop; +a2 = 0x10018e70; +//nop; +a3 = MEM_U32(a2 + 0); +//nop; +ra = MEM_U32(sp + 28); +L419a70: +t5 = a3 + 0x1; +MEM_U32(a2 + 0) = t5; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_emit_dir_ll(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L419a80: +//emit_dir_ll: +//nop; +//nop; +//nop; +t6 = 0x10018ed8; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +at = 0x2; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if (t6 != at) {a3 = a1; +goto L419adc;} +a3 = a1; +a1 = 0x10018e70; +a2 = 0x10018e6c; +t8 = MEM_U32(a1 + 0); +t7 = MEM_U32(a2 + 0); +t9 = t8 << 4; +v0 = t7 + t9; +t0 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t1 = t0 & 0xffc0; +t2 = t1 | 0x10; +MEM_U8(v0 + 5) = (uint8_t)t2; +goto L419b08; +MEM_U8(v0 + 5) = (uint8_t)t2; +L419adc: +a1 = 0x10018e70; +a2 = 0x10018e6c; +t4 = MEM_U32(a1 + 0); +t3 = MEM_U32(a2 + 0); +t5 = t4 << 4; +v0 = t3 + t5; +t6 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t8 = t6 & 0xffc0; +t7 = t8 | 0x16; +MEM_U8(v0 + 5) = (uint8_t)t7; +L419b08: +t0 = MEM_U32(a1 + 0); +t9 = MEM_U32(a2 + 0); +t1 = t0 << 4; +t2 = t9 + t1; +MEM_U32(t2 + -8) = a3; +//nop; +//nop; +//nop; +v0 = f_create_local_label(mem, sp, a0); +goto L419b2c; +//nop; +L419b2c: +gp = MEM_U32(sp + 24); +t8 = 0x1; +a1 = 0x10018e70; +a2 = 0x10018e6c; +t3 = MEM_U32(a1 + 0); +t4 = MEM_U32(a2 + 0); +t5 = t3 << 4; +t6 = t4 + t5; +MEM_U32(t6 + -16) = v0; +t0 = MEM_U32(a1 + 0); +t7 = MEM_U32(a2 + 0); +t9 = t0 << 4; +t1 = t7 + t9; +t2 = 0x10018e78; +MEM_U32(t1 + -4) = t8; +v1 = MEM_U32(a1 + 0); +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != v1) {ra = MEM_U32(sp + 28); +goto L419ba8;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L419b8c; +//nop; +L419b8c: +gp = MEM_U32(sp + 24); +//nop; +a1 = 0x10018e70; +//nop; +v1 = MEM_U32(a1 + 0); +//nop; +ra = MEM_U32(sp + 28); +L419ba8: +t3 = v1 + 0x1; +MEM_U32(a1 + 0) = t3; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_rob_(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L419bb8: +//demit_rob_: +//nop; +//nop; +//nop; +t1 = 0x10018e78; +sp = sp + 0xffffffe0; +v1 = 0x10018e6c; +t7 = MEM_U32(t1 + 0); +t6 = MEM_U32(v1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 44) = a3; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t4 = t9 & 0xffc0; +t5 = t4 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t5; +t6 = MEM_U32(t1 + 0); +t7 = MEM_U32(v1 + 0); +t8 = t6 << 4; +v0 = t7 + t8; +t2 = MEM_U16(v0 + -10); +v0 = v0 + 0xfffffff0; +t9 = t2 << 22; +t4 = t9 >> 23; +t5 = a0 ^ t4; +t6 = t5 << 23; +t7 = t6 >> 22; +t8 = t7 ^ t2; +MEM_U16(v0 + 6) = (uint16_t)t8; +t4 = MEM_U32(t1 + 0); +t9 = MEM_U32(v1 + 0); +t5 = t4 << 4; +v0 = t9 + t5; +t6 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t7 = t6 & at; +MEM_U32(v0 + -8) = t7; +t4 = MEM_U32(t1 + 0); +t8 = MEM_U32(v1 + 0); +t9 = t4 << 4; +t5 = t8 + t9; +MEM_U32(t5 + -16) = zero; +t7 = MEM_U32(t1 + 0); +t6 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t4 = t7 << 4; +v0 = t6 + t4; +t0 = MEM_U32(v0 + -8); +v0 = v0 + 0xfffffff0; +t8 = t0 >> 25; +t9 = a1 ^ t8; +t5 = t9 << 25; +t7 = t5 ^ t0; +MEM_U32(v0 + 8) = t7; +t4 = MEM_U32(t1 + 0); +t6 = MEM_U32(v1 + 0); +t8 = t4 << 4; +v0 = t6 + t8; +t0 = MEM_U32(v0 + -8); +v0 = v0 + 0xfffffff0; +t9 = t0 << 7; +t5 = t9 >> 25; +t7 = a3 ^ t5; +t4 = t7 << 25; +t6 = t4 >> 7; +t8 = t6 ^ t0; +MEM_U32(v0 + 8) = t8; +t5 = MEM_U32(t1 + 0); +t9 = MEM_U32(v1 + 0); +t7 = t5 << 4; +v0 = t9 + t7; +t4 = MEM_U32(v0 + -8); +at = 0xffffc000; +t6 = t4 & at; +MEM_U32(v0 + -8) = t6; +t5 = MEM_U32(t1 + 0); +t8 = MEM_U32(v1 + 0); +t9 = t5 << 4; +t7 = t8 + t9; +MEM_U32(t7 + -4) = a2; +t6 = MEM_U32(t1 + 0); +t4 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t5 = t6 << 4; +v0 = t4 + t5; +t3 = MEM_U32(v0 + -12); +t8 = MEM_U8(sp + 51); +t9 = t3 << 7; +t7 = t9 >> 29; +t6 = t8 ^ t7; +t4 = t6 << 29; +t5 = t4 >> 7; +t9 = t5 ^ t3; +t8 = 0x10018e70; +MEM_U32(v0 + -12) = t9; +v0 = v0 + 0xfffffff0; +v0 = MEM_U32(t1 + 0); +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != v0) {ra = MEM_U32(sp + 28); +goto L419d8c;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L419d70; +//nop; +L419d70: +gp = MEM_U32(sp + 24); +//nop; +t1 = 0x10018e78; +//nop; +v0 = MEM_U32(t1 + 0); +//nop; +ra = MEM_U32(sp + 28); +L419d8c: +t7 = v0 + 0xffffffff; +MEM_U32(t1 + 0) = t7; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_ri(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L419d9c: +//demit_ri: +//nop; +//nop; +//nop; +t0 = 0x10018e78; +sp = sp + 0xffffffe0; +v1 = 0x10018e6c; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(v1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 44) = a3; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t5 = t9 & 0xffc0; +t7 = t5 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t7; +t8 = MEM_U32(t0 + 0); +t6 = MEM_U32(v1 + 0); +t9 = t8 << 4; +v0 = t6 + t9; +t1 = MEM_U16(v0 + -10); +v0 = v0 + 0xfffffff0; +t5 = t1 << 22; +t7 = t5 >> 23; +t8 = a0 ^ t7; +t6 = t8 << 23; +t9 = t6 >> 22; +t5 = t9 ^ t1; +MEM_U16(v0 + 6) = (uint16_t)t5; +t8 = MEM_U32(t0 + 0); +t7 = MEM_U32(v1 + 0); +t6 = t8 << 4; +v0 = t7 + t6; +t9 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t5 = t9 & at; +t8 = t5 | 0x8000; +MEM_U32(v0 + -8) = t8; +t6 = MEM_U32(t0 + 0); +t7 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t9 = t6 << 4; +v0 = t7 + t9; +t2 = MEM_U32(v0 + -8); +v0 = v0 + 0xfffffff0; +t5 = t2 >> 25; +t8 = a1 ^ t5; +t6 = t8 << 25; +t7 = t6 ^ t2; +MEM_U32(v0 + 8) = t7; +t5 = MEM_U32(t0 + 0); +t9 = MEM_U32(v1 + 0); +t8 = t5 << 4; +v0 = t9 + t8; +t6 = MEM_U32(v0 + -8); +at = 0xfe030000; +at = at | 0xffff; +t7 = t6 & at; +at = 0x1200000; +t5 = t7 | at; +MEM_U32(v0 + -8) = t5; +t8 = MEM_U32(t0 + 0); +t9 = MEM_U32(v1 + 0); +t6 = t8 << 4; +t7 = t9 + t6; +MEM_U32(t7 + -16) = zero; +t8 = MEM_U32(t0 + 0); +t5 = MEM_U32(v1 + 0); +t9 = t8 << 4; +t6 = t5 + t9; +MEM_U32(t6 + -4) = a2; +t8 = MEM_U32(t0 + 0); +t7 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t5 = t8 << 4; +v0 = t7 + t5; +t3 = MEM_U32(v0 + -12); +v0 = v0 + 0xfffffff0; +t9 = t3 << 7; +t6 = t9 >> 29; +t8 = a3 ^ t6; +t7 = t8 << 29; +t5 = t7 >> 7; +t9 = t5 ^ t3; +t6 = 0x10018e70; +MEM_U32(v0 + 4) = t9; +t4 = MEM_U32(t0 + 0); +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != t4) {ra = MEM_U32(sp + 28); +goto L419f48;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L419f2c; +//nop; +L419f2c: +gp = MEM_U32(sp + 24); +//nop; +t0 = 0x10018e78; +//nop; +t4 = MEM_U32(t0 + 0); +//nop; +ra = MEM_U32(sp + 28); +L419f48: +t8 = t4 + 0xffffffff; +MEM_U32(t0 + 0) = t8; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_rr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L419f58: +//demit_rr: +//nop; +//nop; +//nop; +t0 = 0x10018e78; +sp = sp + 0xffffffe0; +a3 = 0x10018e6c; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(a3 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t3 = t9 & 0xffc0; +t4 = t3 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t4; +t7 = MEM_U32(t0 + 0); +t5 = MEM_U32(a3 + 0); +t6 = t7 << 4; +v0 = t5 + t6; +t1 = MEM_U16(v0 + -10); +v0 = v0 + 0xfffffff0; +t8 = t1 << 22; +t9 = t8 >> 23; +t3 = a0 ^ t9; +t4 = t3 << 23; +t7 = t4 >> 22; +t5 = t7 ^ t1; +MEM_U16(v0 + 6) = (uint16_t)t5; +t8 = MEM_U32(t0 + 0); +t6 = MEM_U32(a3 + 0); +t9 = t8 << 4; +v0 = t6 + t9; +t3 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t4 = t3 & at; +at = 0x10000; +at = at | 0x4000; +t7 = t4 | at; +MEM_U32(v0 + -8) = t7; +t8 = MEM_U32(t0 + 0); +t5 = MEM_U32(a3 + 0); +v0 = v0 + 0xfffffff0; +t6 = t8 << 4; +v0 = t5 + t6; +v1 = MEM_U32(v0 + -8); +v0 = v0 + 0xfffffff0; +t9 = v1 >> 25; +t3 = a1 ^ t9; +t4 = t3 << 25; +t7 = t4 ^ v1; +MEM_U32(v0 + 8) = t7; +t5 = MEM_U32(t0 + 0); +t8 = MEM_U32(a3 + 0); +t6 = t5 << 4; +v0 = t8 + t6; +v1 = MEM_U32(v0 + -8); +v0 = v0 + 0xfffffff0; +t9 = v1 << 7; +t3 = t9 >> 25; +t4 = a2 ^ t3; +t7 = t4 << 25; +t5 = t7 >> 7; +t8 = t5 ^ v1; +MEM_U32(v0 + 8) = t8; +t9 = MEM_U32(t0 + 0); +t6 = MEM_U32(a3 + 0); +t3 = t9 << 4; +t4 = t6 + t3; +t7 = 0x10018e70; +MEM_U32(t4 + -16) = zero; +t2 = MEM_U32(t0 + 0); +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != t2) {ra = MEM_U32(sp + 28); +goto L41a0c8;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41a0ac; +//nop; +L41a0ac: +gp = MEM_U32(sp + 24); +//nop; +t0 = 0x10018e78; +//nop; +t2 = MEM_U32(t0 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41a0c8: +t5 = t2 + 0xffffffff; +MEM_U32(t0 + 0) = t5; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_a(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41a0d8: +//demit_a: +//nop; +//nop; +//nop; +a3 = 0x10018e78; +v1 = 0x10018e6c; +t7 = MEM_U32(a3 + 0); +sp = sp + 0xffffffe0; +t6 = MEM_U32(v1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t2 = t9 & 0xffc0; +t3 = t2 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t3; +t5 = MEM_U32(a3 + 0); +t4 = MEM_U32(v1 + 0); +t7 = t5 << 4; +v0 = t4 + t7; +t0 = MEM_U16(v0 + -10); +v0 = v0 + 0xfffffff0; +t6 = t0 << 22; +t8 = t6 >> 23; +t9 = a0 ^ t8; +t2 = t9 << 23; +t3 = t2 >> 22; +t5 = t3 ^ t0; +MEM_U16(v0 + 6) = (uint16_t)t5; +t7 = MEM_U32(a3 + 0); +t4 = MEM_U32(v1 + 0); +t6 = t7 << 4; +v0 = t4 + t6; +t8 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t9 = t8 & at; +at = 0x10000; +at = at | 0x8000; +t2 = t9 | at; +MEM_U32(v0 + -8) = t2; +t5 = MEM_U32(a3 + 0); +t3 = MEM_U32(v1 + 0); +t7 = t5 << 4; +t4 = t3 + t7; +MEM_U32(t4 + -16) = a1; +t8 = MEM_U32(a3 + 0); +t6 = MEM_U32(v1 + 0); +t9 = t8 << 4; +t2 = t6 + t9; +MEM_U32(t2 + -4) = a2; +t3 = MEM_U32(a3 + 0); +t5 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t7 = t3 << 4; +v0 = t5 + t7; +t4 = MEM_U32(v0 + -8); +at = 0x1ff0000; +at = at | 0xffff; +t8 = t4 & at; +at = 0x90000000; +t6 = t8 | at; +MEM_U32(v0 + -8) = t6; +t2 = MEM_U32(a3 + 0); +t9 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t2 << 4; +v0 = t9 + t3; +t5 = MEM_U32(v0 + -8); +at = 0xfe030000; +at = at | 0xffff; +t7 = t5 & at; +at = 0x1200000; +t4 = t7 | at; +MEM_U32(v0 + -8) = t4; +t6 = MEM_U32(a3 + 0); +t8 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t2 = t6 << 4; +v0 = t8 + t2; +t9 = MEM_U32(v0 + -12); +at = 0xfe3f0000; +at = at | 0xffff; +t3 = t9 & at; +t5 = 0x10018e70; +MEM_U32(v0 + -12) = t3; +t1 = MEM_U32(a3 + 0); +t5 = MEM_U32(t5 + 0); +v0 = v0 + 0xfffffff0; +if (t5 != t1) {ra = MEM_U32(sp + 28); +goto L41a278;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41a25c; +//nop; +L41a25c: +gp = MEM_U32(sp + 24); +//nop; +a3 = 0x10018e78; +//nop; +t1 = MEM_U32(a3 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41a278: +t7 = t1 + 0xffffffff; +MEM_U32(a3 + 0) = t7; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_regmask(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41a288: +//demit_regmask: +//nop; +//nop; +//nop; +t0 = 0x10018e78; +a3 = 0x10018e6c; +t7 = MEM_U32(t0 + 0); +sp = sp + 0xffffffe0; +t6 = MEM_U32(a3 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +v0 = t6 + t8; +v1 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t9 = v1 << 26; +t2 = t9 >> 26; +t3 = a0 ^ t2; +t4 = t3 & 0x3f; +t5 = t4 ^ v1; +MEM_U8(v0 + 5) = (uint8_t)t5; +t6 = MEM_U32(t0 + 0); +t7 = MEM_U32(a3 + 0); +t8 = t6 << 4; +t9 = t7 + t8; +MEM_U32(t9 + -16) = zero; +t3 = MEM_U32(t0 + 0); +t2 = MEM_U32(a3 + 0); +t4 = t3 << 4; +t5 = t2 + t4; +MEM_U32(t5 + -8) = a1; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(a3 + 0); +t8 = t7 << 4; +t9 = t6 + t8; +t3 = 0x10018e70; +MEM_U32(t9 + -4) = a2; +t1 = MEM_U32(t0 + 0); +t3 = MEM_U32(t3 + 0); +//nop; +if (t1 != t3) {ra = MEM_U32(sp + 28); +goto L41a35c;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41a340; +//nop; +L41a340: +gp = MEM_U32(sp + 24); +//nop; +t0 = 0x10018e78; +//nop; +t1 = MEM_U32(t0 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41a35c: +t2 = t1 + 0xffffffff; +MEM_U32(t0 + 0) = t2; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_rrr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41a36c: +//demit_rrr: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +t1 = 0x10018e78; +t0 = 0x10018e6c; +t7 = MEM_U32(t1 + 0); +t6 = MEM_U32(t0 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +MEM_U32(sp + 44) = a3; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t3 = t9 & 0xffc0; +t4 = t3 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t4; +t7 = MEM_U32(t1 + 0); +t5 = MEM_U32(t0 + 0); +t6 = t7 << 4; +v0 = t5 + t6; +t2 = MEM_U16(v0 + -10); +v0 = v0 + 0xfffffff0; +t8 = t2 << 22; +t9 = t8 >> 23; +t3 = a0 ^ t9; +t4 = t3 << 23; +t7 = t4 >> 22; +t5 = t7 ^ t2; +MEM_U16(v0 + 6) = (uint16_t)t5; +t8 = MEM_U32(t1 + 0); +t6 = MEM_U32(t0 + 0); +t9 = t8 << 4; +v0 = t6 + t9; +t3 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t4 = t3 & at; +t7 = t4 | 0xc000; +MEM_U32(v0 + -8) = t7; +t8 = MEM_U32(t1 + 0); +t5 = MEM_U32(t0 + 0); +t6 = t8 << 4; +t9 = t5 + t6; +MEM_U32(t9 + -16) = zero; +t4 = MEM_U32(t1 + 0); +t3 = MEM_U32(t0 + 0); +v0 = v0 + 0xfffffff0; +t7 = t4 << 4; +v0 = t3 + t7; +v1 = MEM_U32(v0 + -8); +v0 = v0 + 0xfffffff0; +t8 = v1 >> 25; +t5 = a1 ^ t8; +t6 = t5 << 25; +t9 = t6 ^ v1; +MEM_U32(v0 + 8) = t9; +t3 = MEM_U32(t1 + 0); +t4 = MEM_U32(t0 + 0); +t7 = t3 << 4; +v0 = t4 + t7; +v1 = MEM_U32(v0 + -8); +v0 = v0 + 0xfffffff0; +t8 = v1 << 7; +t5 = t8 >> 25; +t6 = a2 ^ t5; +t9 = t6 << 25; +t3 = t9 >> 7; +t4 = t3 ^ v1; +MEM_U32(v0 + 8) = t4; +t8 = MEM_U32(t1 + 0); +t7 = MEM_U32(t0 + 0); +t5 = t8 << 4; +v0 = t7 + t5; +v1 = MEM_U32(v0 + -8); +t5 = 0x10018e70; +t6 = v1 << 18; +t9 = t6 >> 25; +t3 = a3 ^ t9; +t4 = t3 << 25; +t8 = t4 >> 18; +t7 = t8 ^ v1; +MEM_U32(v0 + -8) = t7; +v0 = v0 + 0xfffffff0; +v0 = MEM_U32(t1 + 0); +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != v0) {ra = MEM_U32(sp + 28); +goto L41a50c;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41a4f0; +//nop; +L41a4f0: +gp = MEM_U32(sp + 24); +//nop; +t1 = 0x10018e78; +//nop; +v0 = MEM_U32(t1 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41a50c: +t6 = v0 + 0xffffffff; +MEM_U32(t1 + 0) = t6; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_rri(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41a51c: +//demit_rri: +//nop; +//nop; +//nop; +t1 = 0x10018e78; +sp = sp + 0xffffffe0; +t0 = 0x10018e6c; +t7 = MEM_U32(t1 + 0); +t6 = MEM_U32(t0 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t4 = t9 & 0xffc0; +t5 = t4 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t5; +t6 = MEM_U32(t1 + 0); +t7 = MEM_U32(t0 + 0); +t8 = t6 << 4; +v0 = t7 + t8; +t2 = MEM_U16(v0 + -10); +v0 = v0 + 0xfffffff0; +t9 = t2 << 22; +t4 = t9 >> 23; +t5 = a0 ^ t4; +t6 = t5 << 23; +t7 = t6 >> 22; +t8 = t7 ^ t2; +MEM_U16(v0 + 6) = (uint16_t)t8; +t4 = MEM_U32(t1 + 0); +t9 = MEM_U32(t0 + 0); +t5 = t4 << 4; +v0 = t9 + t5; +t6 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t7 = t6 & at; +at = 0x10000; +t8 = t7 | at; +MEM_U32(v0 + -8) = t8; +t9 = MEM_U32(t1 + 0); +t4 = MEM_U32(t0 + 0); +v0 = v0 + 0xfffffff0; +t5 = t9 << 4; +v0 = t4 + t5; +v1 = MEM_U32(v0 + -8); +v0 = v0 + 0xfffffff0; +t6 = v1 >> 25; +t7 = a1 ^ t6; +t8 = t7 << 25; +t9 = t8 ^ v1; +MEM_U32(v0 + 8) = t9; +t5 = MEM_U32(t1 + 0); +t4 = MEM_U32(t0 + 0); +t6 = t5 << 4; +v0 = t4 + t6; +v1 = MEM_U32(v0 + -8); +v0 = v0 + 0xfffffff0; +t7 = v1 << 7; +t8 = t7 >> 25; +t9 = a2 ^ t8; +t5 = t9 << 25; +t4 = t5 >> 7; +t6 = t4 ^ v1; +MEM_U32(v0 + 8) = t6; +t8 = MEM_U32(t1 + 0); +t7 = MEM_U32(t0 + 0); +t9 = t8 << 4; +t5 = t7 + t9; +MEM_U32(t5 + -16) = zero; +t6 = MEM_U32(t1 + 0); +t4 = MEM_U32(t0 + 0); +t8 = t6 << 4; +t7 = t4 + t8; +t9 = 0x10018e70; +MEM_U32(t7 + -4) = a3; +t3 = MEM_U32(t1 + 0); +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 != t3) {ra = MEM_U32(sp + 28); +goto L41a69c;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41a680; +//nop; +L41a680: +gp = MEM_U32(sp + 24); +//nop; +t1 = 0x10018e78; +//nop; +t3 = MEM_U32(t1 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41a69c: +t5 = t3 + 0xffffffff; +MEM_U32(t1 + 0) = t5; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_rrll(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41a6ac: +//demit_rrll: +//nop; +//nop; +//nop; +t0 = 0x10018e78; +sp = sp + 0xffffffe0; +t2 = 0x10018e6c; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(t2 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t3 = t9 & 0xffc0; +t4 = t3 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t4; +t7 = MEM_U32(t0 + 0); +t5 = MEM_U32(t2 + 0); +t6 = t7 << 4; +v0 = t5 + t6; +t1 = MEM_U16(v0 + -10); +t8 = MEM_U16(sp + 34); +t9 = t1 << 22; +t3 = t9 >> 23; +t4 = t8 ^ t3; +t7 = t4 << 23; +t5 = t7 >> 22; +t6 = t5 ^ t1; +MEM_U16(v0 + -10) = (uint16_t)t6; +t8 = MEM_U32(t0 + 0); +t9 = MEM_U32(t2 + 0); +v0 = v0 + 0xfffffff0; +t3 = t8 << 4; +v0 = t9 + t3; +t4 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t7 = t4 & at; +at = 0x20000; +t5 = t7 | at; +MEM_U32(v0 + -8) = t5; +t8 = MEM_U32(t0 + 0); +t6 = MEM_U32(t2 + 0); +v0 = v0 + 0xfffffff0; +t9 = t8 << 4; +v0 = t6 + t9; +v1 = MEM_U32(v0 + -8); +v0 = v0 + 0xfffffff0; +t3 = v1 >> 25; +t4 = a1 ^ t3; +t7 = t4 << 25; +t5 = t7 ^ v1; +MEM_U32(v0 + 8) = t5; +t6 = MEM_U32(t0 + 0); +t8 = MEM_U32(t2 + 0); +t9 = t6 << 4; +v0 = t8 + t9; +v1 = MEM_U32(v0 + -8); +v0 = v0 + 0xfffffff0; +t3 = v1 << 7; +t4 = t3 >> 25; +t7 = a2 ^ t4; +t5 = t7 << 25; +t6 = t5 >> 7; +t8 = t6 ^ v1; +MEM_U32(v0 + 8) = t8; +//nop; +a0 = a3; +//nop; +v0 = f_create_local_label(mem, sp, a0); +goto L41a7d4; +//nop; +L41a7d4: +gp = MEM_U32(sp + 24); +//nop; +t0 = 0x10018e78; +t2 = 0x10018e6c; +t3 = MEM_U32(t0 + 0); +t9 = MEM_U32(t2 + 0); +t4 = t3 << 4; +t7 = t9 + t4; +t5 = 0x10018e70; +MEM_U32(t7 + -16) = v0; +v1 = MEM_U32(t0 + 0); +t5 = MEM_U32(t5 + 0); +//nop; +if (v1 != t5) {ra = MEM_U32(sp + 28); +goto L41a83c;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41a820; +//nop; +L41a820: +gp = MEM_U32(sp + 24); +//nop; +t0 = 0x10018e78; +//nop; +v1 = MEM_U32(t0 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41a83c: +t6 = v1 + 0xffffffff; +MEM_U32(t0 + 0) = t6; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_i(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41a84c: +//demit_i: +//nop; +//nop; +//nop; +a2 = 0x10018e78; +v1 = 0x10018e6c; +t7 = MEM_U32(a2 + 0); +sp = sp + 0xffffffe0; +t6 = MEM_U32(v1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t1 = t9 & 0xffc0; +t2 = t1 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t2; +t4 = MEM_U32(a2 + 0); +t3 = MEM_U32(v1 + 0); +t5 = t4 << 4; +v0 = t3 + t5; +a3 = MEM_U16(v0 + -10); +v0 = v0 + 0xfffffff0; +t7 = a3 << 22; +t6 = t7 >> 23; +t8 = a0 ^ t6; +t9 = t8 << 23; +t1 = t9 >> 22; +t2 = t1 ^ a3; +MEM_U16(v0 + 6) = (uint16_t)t2; +t3 = MEM_U32(a2 + 0); +t4 = MEM_U32(v1 + 0); +t5 = t3 << 4; +v0 = t4 + t5; +t7 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t6 = t7 & at; +at = 0x30000; +at = at | 0x4000; +t8 = t6 | at; +MEM_U32(v0 + -8) = t8; +t1 = MEM_U32(a2 + 0); +t9 = MEM_U32(v1 + 0); +t2 = t1 << 4; +t3 = t9 + t2; +MEM_U32(t3 + -4) = a1; +t5 = MEM_U32(a2 + 0); +t4 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t7 = t5 << 4; +v0 = t4 + t7; +t6 = MEM_U32(v0 + -8); +at = 0x1ff0000; +at = at | 0xffff; +t8 = t6 & at; +at = 0x90000000; +t1 = t8 | at; +MEM_U32(v0 + -8) = t1; +t2 = MEM_U32(a2 + 0); +t9 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t3 = t2 << 4; +v0 = t9 + t3; +t5 = MEM_U32(v0 + -8); +at = 0xfe030000; +at = at | 0xffff; +t4 = t5 & at; +at = 0x1200000; +t7 = t4 | at; +MEM_U32(v0 + -8) = t7; +t8 = MEM_U32(a2 + 0); +t6 = MEM_U32(v1 + 0); +t1 = t8 << 4; +t2 = t6 + t1; +t9 = 0x10018e70; +MEM_U32(t2 + -16) = zero; +t0 = MEM_U32(a2 + 0); +t9 = MEM_U32(t9 + 0); +v0 = v0 + 0xfffffff0; +if (t0 != t9) {ra = MEM_U32(sp + 28); +goto L41a9c4;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41a9a8; +//nop; +L41a9a8: +gp = MEM_U32(sp + 24); +//nop; +a2 = 0x10018e78; +//nop; +t0 = MEM_U32(a2 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41a9c4: +t3 = t0 + 0xffffffff; +MEM_U32(a2 + 0) = t3; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_ra(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41a9d4: +//demit_ra: +//nop; +//nop; +//nop; +t0 = 0x10018e78; +v1 = 0x10018e6c; +sp = sp + 0xffffffe0; +t7 = MEM_U32(t0 + 0); +t6 = MEM_U32(v1 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t4 = t9 & 0xffc0; +t5 = t4 | 0x17; +MEM_U8(v0 + 5) = (uint8_t)t5; +t6 = MEM_U32(t0 + 0); +t7 = MEM_U32(v1 + 0); +t8 = t6 << 4; +v0 = t7 + t8; +t1 = MEM_U16(v0 + -10); +v0 = v0 + 0xfffffff0; +t9 = t1 << 22; +t4 = t9 >> 23; +t5 = a0 ^ t4; +t6 = t5 << 23; +t7 = t6 >> 22; +t8 = t7 ^ t1; +MEM_U16(v0 + 6) = (uint16_t)t8; +t4 = MEM_U32(t0 + 0); +t9 = MEM_U32(v1 + 0); +t5 = t4 << 4; +v0 = t9 + t5; +t6 = MEM_U32(v0 + -8); +at = 0xfffc0000; +at = at | 0x3fff; +t7 = t6 & at; +t8 = t7 | 0x4000; +MEM_U32(v0 + -8) = t8; +t9 = MEM_U32(t0 + 0); +t4 = MEM_U32(v1 + 0); +v0 = v0 + 0xfffffff0; +t5 = t9 << 4; +v0 = t4 + t5; +t2 = MEM_U32(v0 + -8); +v0 = v0 + 0xfffffff0; +t6 = t2 >> 25; +t7 = a1 ^ t6; +t8 = t7 << 25; +t9 = t8 ^ t2; +MEM_U32(v0 + 8) = t9; +t5 = MEM_U32(t0 + 0); +t4 = MEM_U32(v1 + 0); +t6 = t5 << 4; +v0 = t4 + t6; +t7 = MEM_U32(v0 + -8); +at = 0xfe030000; +at = at | 0xffff; +t8 = t7 & at; +at = 0x1200000; +t9 = t8 | at; +MEM_U32(v0 + -8) = t9; +t4 = MEM_U32(t0 + 0); +t5 = MEM_U32(v1 + 0); +t6 = t4 << 4; +t7 = t5 + t6; +MEM_U32(t7 + -16) = a2; +t9 = MEM_U32(t0 + 0); +t8 = MEM_U32(v1 + 0); +t4 = t9 << 4; +t5 = t8 + t4; +t6 = 0x10018e70; +MEM_U32(t5 + -4) = a3; +t3 = MEM_U32(t0 + 0); +t6 = MEM_U32(t6 + 0); +v0 = v0 + 0xfffffff0; +if (t3 != t6) {ra = MEM_U32(sp + 28); +goto L41ab44;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41ab28; +//nop; +L41ab28: +gp = MEM_U32(sp + 24); +//nop; +t0 = 0x10018e78; +//nop; +t3 = MEM_U32(t0 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41ab44: +t7 = t3 + 0xffffffff; +MEM_U32(t0 + 0) = t7; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_dir0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41ab54: +//demit_dir0: +//nop; +//nop; +//nop; +a3 = 0x10018e78; +a2 = 0x10018e6c; +t7 = MEM_U32(a3 + 0); +sp = sp + 0xffffffe0; +t6 = MEM_U32(a2 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +v0 = t6 + t8; +v1 = MEM_U8(v0 + -11); +t4 = a0 < 0x40; +t9 = v1 << 26; +t0 = t9 >> 26; +t1 = a0 ^ t0; +t2 = t1 & 0x3f; +t3 = t2 ^ v1; +MEM_U8(v0 + -11) = (uint8_t)t3; +if (t4 == 0) {v0 = v0 + 0xfffffff0; +goto L41abd4;} +v0 = v0 + 0xfffffff0; +t6 = 0x100027b4; +t5 = (int)a0 >> 5; +t7 = t5 << 2; +t6 = t6; +t8 = t6 + t7; +t9 = MEM_U32(t8 + 0); +//nop; +t0 = t9 << (a0 & 0x1f); +t4 = (int)t0 < (int)0x0; +L41abd4: +if (t4 == 0) {//nop; +goto L41ac08;} +//nop; +t3 = MEM_U32(a3 + 0); +t2 = MEM_U32(a2 + 0); +t5 = t3 << 4; +t6 = t2 + t5; +MEM_U32(t6 + -16) = zero; +t8 = MEM_U32(a3 + 0); +t7 = MEM_U32(a2 + 0); +t9 = t8 << 4; +t0 = t7 + t9; +MEM_U32(t0 + -8) = a1; +goto L41ac30; +MEM_U32(t0 + -8) = a1; +L41ac08: +t4 = MEM_U32(a3 + 0); +t1 = MEM_U32(a2 + 0); +t3 = t4 << 4; +t2 = t1 + t3; +MEM_U32(t2 + -16) = a1; +t6 = MEM_U32(a3 + 0); +t5 = MEM_U32(a2 + 0); +t8 = t6 << 4; +t7 = t5 + t8; +MEM_U32(t7 + -8) = zero; +L41ac30: +t0 = MEM_U32(a3 + 0); +t9 = MEM_U32(a2 + 0); +t4 = t0 << 4; +t1 = t9 + t4; +t3 = 0x10018e70; +MEM_U32(t1 + -4) = zero; +v0 = MEM_U32(a3 + 0); +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != v0) {ra = MEM_U32(sp + 28); +goto L41ac88;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41ac6c; +//nop; +L41ac6c: +gp = MEM_U32(sp + 24); +//nop; +a3 = 0x10018e78; +//nop; +v0 = MEM_U32(a3 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41ac88: +t2 = v0 + 0xffffffff; +MEM_U32(a3 + 0) = t2; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_dir1(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41ac98: +//demit_dir1: +//nop; +//nop; +//nop; +a3 = 0x10018e78; +t0 = 0x10018e6c; +t7 = MEM_U32(a3 + 0); +sp = sp + 0xffffffe0; +t6 = MEM_U32(t0 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +v0 = t6 + t8; +v1 = MEM_U8(v0 + -11); +at = 0x1b; +t9 = v1 << 26; +t1 = t9 >> 26; +t2 = a0 ^ t1; +t3 = t2 & 0x3f; +t4 = t3 ^ v1; +MEM_U8(v0 + -11) = (uint8_t)t4; +t7 = MEM_U32(a3 + 0); +t5 = MEM_U32(t0 + 0); +t6 = t7 << 4; +t8 = t5 + t6; +v0 = v0 + 0xfffffff0; +if (a0 != at) {MEM_U32(t8 + -16) = a1; +goto L41ad2c;} +MEM_U32(t8 + -16) = a1; +L41ad08: +t1 = MEM_U32(a3 + 0); +t9 = MEM_U32(t0 + 0); +t2 = t1 << 4; +t3 = t9 + t2; +MEM_U32(t3 + -8) = a2; +goto L41ad4c; +MEM_U32(t3 + -8) = a2; +at = 0x1b; +if (a0 == at) {//nop; +goto L41ad08;} +//nop; +L41ad2c: +at = 0x3c; +if (a0 == at) {//nop; +goto L41ad08;} +//nop; +t7 = MEM_U32(a3 + 0); +t4 = MEM_U32(t0 + 0); +t5 = t7 << 4; +t6 = t4 + t5; +MEM_U32(t6 + -8) = a2; +L41ad4c: +t8 = 0x10018e70; +v0 = MEM_U32(a3 + 0); +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != v0) {ra = MEM_U32(sp + 28); +goto L41ad90;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41ad74; +//nop; +L41ad74: +gp = MEM_U32(sp + 24); +//nop; +a3 = 0x10018e78; +//nop; +v0 = MEM_U32(a3 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41ad90: +t1 = v0 + 0xffffffff; +MEM_U32(a3 + 0) = t1; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_dir2(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41ada0: +//demit_dir2: +//nop; +//nop; +//nop; +t1 = 0x10018e78; +t0 = 0x10018e6c; +t7 = MEM_U32(t1 + 0); +sp = sp + 0xffffffe0; +t6 = MEM_U32(t0 + 0); +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +v0 = t6 + t8; +v1 = MEM_U8(v0 + -11); +at = a0 < 0x1d; +t9 = v1 << 26; +t2 = t9 >> 26; +t3 = a0 ^ t2; +t4 = t3 & 0x3f; +t5 = t4 ^ v1; +MEM_U8(v0 + -11) = (uint8_t)t5; +t6 = MEM_U32(t1 + 0); +t7 = MEM_U32(t0 + 0); +t8 = t6 << 4; +t9 = t7 + t8; +v0 = v0 + 0xfffffff0; +if (at != 0) {MEM_U32(t9 + -16) = a1; +goto L41aef0;} +MEM_U32(t9 + -16) = a1; +t2 = a0 + 0xffffffd6; +at = t2 < 0x4; +if (at == 0) {//nop; +goto L41aec4;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10008254[] = { +&&L41ae40, +&&L41aec4, +&&L41aec4, +&&L41ae98, +}; +dest = Lswitch10008254[t2]; +//nop; +goto *dest; +//nop; +L41ae40: +t4 = MEM_U32(t1 + 0); +t3 = MEM_U32(t0 + 0); +t5 = t4 << 4; +t6 = t3 + t5; +MEM_U32(t6 + -8) = a2; +t8 = MEM_U32(t1 + 0); +t7 = MEM_U32(t0 + 0); +t9 = t8 << 4; +t2 = t7 + t9; +MEM_U32(t2 + -4) = a3; +goto L41af20; +MEM_U32(t2 + -4) = a3; +L41ae6c: +t3 = MEM_U32(t1 + 0); +t4 = MEM_U32(t0 + 0); +t5 = t3 << 4; +t6 = t4 + t5; +MEM_U32(t6 + -8) = a2; +t7 = MEM_U32(t1 + 0); +t8 = MEM_U32(t0 + 0); +t9 = t7 << 4; +t2 = t8 + t9; +MEM_U32(t2 + -4) = a3; +goto L41af20; +MEM_U32(t2 + -4) = a3; +L41ae98: +t4 = MEM_U32(t1 + 0); +t3 = MEM_U32(t0 + 0); +t5 = t4 << 4; +t6 = t3 + t5; +MEM_U32(t6 + -8) = a2; +t8 = MEM_U32(t1 + 0); +t7 = MEM_U32(t0 + 0); +t9 = t8 << 4; +t2 = t7 + t9; +MEM_U32(t2 + -4) = a3; +goto L41af20; +MEM_U32(t2 + -4) = a3; +L41aec4: +t3 = MEM_U32(t1 + 0); +L41aec8: +t4 = MEM_U32(t0 + 0); +t5 = t3 << 4; +t6 = t4 + t5; +MEM_U32(t6 + -8) = a2; +t7 = MEM_U32(t1 + 0); +t8 = MEM_U32(t0 + 0); +t9 = t7 << 4; +t2 = t8 + t9; +MEM_U32(t2 + -4) = a3; +goto L41af20; +MEM_U32(t2 + -4) = a3; +L41aef0: +at = a0 < 0xa; +if (at == 0) {at = a0 < 0x8; +goto L41af0c;} +at = a0 < 0x8; +if (at == 0) {//nop; +goto L41ae98;} +//nop; +t3 = MEM_U32(t1 + 0); +goto L41aec8; +t3 = MEM_U32(t1 + 0); +L41af0c: +at = 0x1c; +if (a0 == at) {//nop; +goto L41ae6c;} +//nop; +t3 = MEM_U32(t1 + 0); +goto L41aec8; +t3 = MEM_U32(t1 + 0); +L41af20: +t3 = 0x10018e70; +v0 = MEM_U32(t1 + 0); +t3 = MEM_U32(t3 + 0); +//nop; +if (t3 != v0) {ra = MEM_U32(sp + 28); +goto L41af64;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41af48; +//nop; +L41af48: +gp = MEM_U32(sp + 24); +//nop; +t1 = 0x10018e78; +//nop; +v0 = MEM_U32(t1 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41af64: +t4 = v0 + 0xffffffff; +MEM_U32(t1 + 0) = t4; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_edata(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41af74: +//demit_edata: +//nop; +//nop; +//nop; +a3 = 0x10018e78; +v1 = 0x10018e6c; +t7 = MEM_U32(a3 + 0); +t6 = MEM_U32(v1 + 0); +sp = sp + 0xffffffe0; +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t1 = t9 & 0xffc0; +t2 = t1 | 0x3d; +MEM_U8(v0 + 5) = (uint8_t)t2; +t4 = MEM_U32(a3 + 0); +t3 = MEM_U32(v1 + 0); +t5 = t4 << 4; +t7 = t3 + t5; +MEM_U32(t7 + -16) = a0; +t8 = MEM_U32(a3 + 0); +t6 = MEM_U32(v1 + 0); +t9 = t8 << 4; +t1 = t6 + t9; +MEM_U32(t1 + -8) = a1; +t4 = MEM_U32(a3 + 0); +t2 = MEM_U32(v1 + 0); +t3 = t4 << 4; +t5 = t2 + t3; +t7 = 0x10018e70; +MEM_U32(t5 + -4) = a2; +t0 = MEM_U32(a3 + 0); +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != t0) {ra = MEM_U32(sp + 28); +goto L41b038;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41b01c; +//nop; +L41b01c: +gp = MEM_U32(sp + 24); +//nop; +a3 = 0x10018e78; +//nop; +t0 = MEM_U32(a3 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41b038: +t8 = t0 + 0xffffffff; +MEM_U32(a3 + 0) = t8; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_demit_weakext(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41b048: +//demit_weakext: +//nop; +//nop; +//nop; +a3 = 0x10018e78; +a2 = 0x10018e6c; +t7 = MEM_U32(a3 + 0); +t6 = MEM_U32(a2 + 0); +sp = sp + 0xffffffe0; +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t0 = t9 & 0xffc0; +t1 = t0 | 0x12; +MEM_U8(v0 + 5) = (uint8_t)t1; +t3 = MEM_U32(a3 + 0); +t2 = MEM_U32(a2 + 0); +t4 = t3 << 4; +t5 = t2 + t4; +MEM_U32(t5 + -16) = a0; +t6 = MEM_U32(a3 + 0); +t7 = MEM_U32(a2 + 0); +t8 = t6 << 4; +t9 = t7 + t8; +t0 = 0x10018e70; +MEM_U32(t9 + -8) = a1; +v1 = MEM_U32(a3 + 0); +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != v1) {ra = MEM_U32(sp + 28); +goto L41b0f8;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41b0dc; +//nop; +L41b0dc: +gp = MEM_U32(sp + 24); +//nop; +a3 = 0x10018e78; +//nop; +v1 = MEM_U32(a3 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41b0f8: +t1 = v1 + 0xffffffff; +MEM_U32(a3 + 0) = t1; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_emit_cpload(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41b108: +//emit_cpload: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 36) = zero; +t6 = MEM_U8(sp + 37); +t9 = a0 << 25; +t7 = t6 & 0xffc0; +t8 = t7 | 0x3; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 60) = a3; +MEM_U8(sp + 37) = (uint8_t)t8; +MEM_U32(sp + 40) = t9; +MEM_U32(sp + 44) = a1; +if (a3 == 0) {MEM_U32(sp + 32) = a2; +goto L41b19c;} +MEM_U32(sp + 32) = a2; +//nop; +a0 = 0x20; +a1 = 0x2; +f_emit_dir0(mem, sp, a0, a1); +goto L41b160; +a1 = 0x2; +L41b160: +gp = MEM_U32(sp + 24); +a0 = sp + 0x20; +//nop; +//nop; +//nop; +f_append_i(mem, sp, a0); +goto L41b178; +//nop; +L41b178: +gp = MEM_U32(sp + 24); +a0 = 0x20; +//nop; +a1 = 0x1; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L41b190; +//nop; +L41b190: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L41b1e8; +ra = MEM_U32(sp + 28); +L41b19c: +//nop; +a0 = 0x20; +a1 = 0x2; +f_demit_dir0(mem, sp, a0, a1); +goto L41b1ac; +a1 = 0x2; +L41b1ac: +gp = MEM_U32(sp + 24); +a0 = sp + 0x20; +//nop; +//nop; +//nop; +f_append_d(mem, sp, a0); +goto L41b1c4; +//nop; +L41b1c4: +gp = MEM_U32(sp + 24); +a0 = 0x20; +//nop; +a1 = 0x1; +//nop; +f_demit_dir0(mem, sp, a0, a1); +goto L41b1dc; +//nop; +L41b1dc: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L41b1e8: +sp = sp + 0x30; +//nop; +return; +//nop; +} + +static void f_ddefine_label(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41b1f4: +//ddefine_label: +//nop; +//nop; +//nop; +t8 = 0x10018e78; +sp = sp + 0xffffffe0; +t6 = 0x10018e6c; +t8 = MEM_U32(t8 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t7 = MEM_U32(t6 + 0); +t9 = t8 << 4; +v0 = t7 + t9; +t0 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t1 = t0 & 0xffc0; +MEM_U8(v0 + 5) = (uint8_t)t1; +//nop; +//nop; +//nop; +v0 = f_create_local_label(mem, sp, a0); +goto L41b244; +//nop; +L41b244: +gp = MEM_U32(sp + 24); +//nop; +a0 = 0x10018e78; +t2 = 0x10018e6c; +t4 = MEM_U32(a0 + 0); +t3 = MEM_U32(t2 + 0); +t5 = t4 << 4; +t6 = t3 + t5; +t8 = 0x10018e70; +MEM_U32(t6 + -16) = v0; +v1 = MEM_U32(a0 + 0); +t8 = MEM_U32(t8 + 0); +//nop; +if (v1 != t8) {ra = MEM_U32(sp + 28); +goto L41b2ac;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41b290; +//nop; +L41b290: +gp = MEM_U32(sp + 24); +//nop; +a0 = 0x10018e78; +//nop; +v1 = MEM_U32(a0 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41b2ac: +t7 = v1 + 0xffffffff; +MEM_U32(a0 + 0) = t7; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_define_exception_label(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41b2bc: +//define_exception_label: +//nop; +//nop; +//nop; +a1 = 0x10018e70; +a2 = 0x10018e6c; +t7 = MEM_U32(a1 + 0); +t6 = MEM_U32(a2 + 0); +sp = sp + 0xffffffe0; +t8 = t7 << 4; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +t5 = 0x10018e78; +t0 = t9 & 0xffc0; +MEM_U8(v0 + -11) = (uint8_t)t0; +t2 = MEM_U32(a1 + 0); +t1 = MEM_U32(a2 + 0); +t3 = t2 << 4; +t4 = t1 + t3; +MEM_U32(t4 + -16) = a0; +v1 = MEM_U32(a1 + 0); +t5 = MEM_U32(t5 + 0); +v0 = v0 + 0xfffffff0; +if (t5 != v1) {ra = MEM_U32(sp + 28); +goto L41b350;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41b334; +//nop; +L41b334: +gp = MEM_U32(sp + 24); +//nop; +a1 = 0x10018e70; +//nop; +v1 = MEM_U32(a1 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41b350: +t7 = v1 + 0x1; +MEM_U32(a1 + 0) = t7; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_append_i(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41b360: +//append_i: +//nop; +//nop; +//nop; +v1 = 0x10018e70; +sp = sp + 0xffffffe0; +t6 = 0x10018e6c; +t8 = MEM_U32(v1 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t7 = MEM_U32(t6 + 0); +at = MEM_U32(a0 + 0); +t9 = t8 << 4; +t0 = t7 + t9; +MEM_U32(t0 + -16) = at; +t3 = MEM_U32(a0 + 4); +t4 = 0x10018e78; +MEM_U32(t0 + -12) = t3; +at = MEM_U32(a0 + 8); +//nop; +MEM_U32(t0 + -8) = at; +t3 = MEM_U32(a0 + 12); +//nop; +MEM_U32(t0 + -4) = t3; +v0 = MEM_U32(v1 + 0); +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != v0) {ra = MEM_U32(sp + 28); +goto L41b3fc;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41b3e0; +//nop; +L41b3e0: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x10018e70; +//nop; +v0 = MEM_U32(v1 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41b3fc: +t5 = v0 + 0x1; +MEM_U32(v1 + 0) = t5; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_append_d(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41b40c: +//append_d: +//nop; +//nop; +//nop; +v1 = 0x10018e78; +sp = sp + 0xffffffe0; +t6 = 0x10018e6c; +t8 = MEM_U32(v1 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t7 = MEM_U32(t6 + 0); +at = MEM_U32(a0 + 0); +t9 = t8 << 4; +t0 = t7 + t9; +MEM_U32(t0 + -16) = at; +t3 = MEM_U32(a0 + 4); +t4 = 0x10018e70; +MEM_U32(t0 + -12) = t3; +at = MEM_U32(a0 + 8); +//nop; +MEM_U32(t0 + -8) = at; +t3 = MEM_U32(a0 + 12); +//nop; +MEM_U32(t0 + -4) = t3; +v0 = MEM_U32(v1 + 0); +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 != v0) {ra = MEM_U32(sp + 28); +goto L41b4a8;} +ra = MEM_U32(sp + 28); +//nop; +//nop; +//nop; +f_grow_ibuffer(mem, sp); +goto L41b48c; +//nop; +L41b48c: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x10018e78; +//nop; +v0 = MEM_U32(v1 + 0); +//nop; +ra = MEM_U32(sp + 28); +L41b4a8: +t5 = v0 + 0xffffffff; +MEM_U32(v1 + 0) = t5; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_clear_ibuffer(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41b4b8: +//clear_ibuffer: +//nop; +//nop; +//nop; +a2 = 0x10018e70; +sp = sp + 0xffffffe0; +t6 = 0x10018e6c; +a2 = MEM_U32(a2 + 0); +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +a0 = MEM_U32(t6 + 0); +t7 = a2 << 4; +a2 = t7; +a1 = zero; +v0 = wrapper_memset(mem, a0, a1, a2); +goto L41b4f4; +a1 = zero; +L41b4f4: +gp = MEM_U32(sp + 24); +a1 = zero; +v0 = 0x10018e78; +t8 = 0x10018e6c; +t1 = 0x10018e68; +v0 = MEM_U32(v0 + 0); +t9 = MEM_U32(t8 + 0); +t1 = MEM_U32(t1 + 0); +t0 = v0 << 4; +a0 = t9 + t0; +//nop; +a2 = t1 - v0; +t2 = a2 << 4; +a2 = t2 + 0x10; +a0 = a0 + 0xfffffff0; +v0 = wrapper_memset(mem, a0, a1, a2); +goto L41b534; +a0 = a0 + 0xfffffff0; +L41b534: +gp = MEM_U32(sp + 24); +t3 = 0x1; +at = 0x10018e70; +t4 = 0x10018e68; +MEM_U32(at + 0) = t3; +ra = MEM_U32(sp + 28); +at = 0x10018e78; +t4 = MEM_U32(t4 + 0); +sp = sp + 0x20; +MEM_U32(at + 0) = t4; +return; +MEM_U32(at + 0) = t4; +} + +static void f_emit_vreg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41b560: +//emit_vreg: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 36) = zero; +a3 = a0; +t6 = MEM_U8(sp + 37); +t9 = a3 << 25; +MEM_U32(sp + 40) = t9; +//nop; +t7 = t6 & 0xffc0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 48) = a0; +t8 = t7 | 0x25; +MEM_U32(sp + 24) = gp; +MEM_U8(sp + 37) = (uint8_t)t8; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 32) = a2; +a0 = sp + 0x20; +f_append_i(mem, sp, a0); +goto L41b5b0; +a0 = sp + 0x20; +L41b5b0: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void f_emit_pic(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41b5c0: +//emit_pic: +//nop; +//nop; +//nop; +a1 = 0x10018e78; +v1 = 0x10018e6c; +t7 = MEM_U32(a1 + 0); +t6 = MEM_U32(v1 + 0); +t8 = t7 << 4; +v0 = t6 + t8; +t9 = MEM_U8(v0 + -11); +v0 = v0 + 0xfffffff0; +t0 = t9 & 0xffc0; +t1 = t0 | 0x2f; +MEM_U8(v0 + 5) = (uint8_t)t1; +t3 = MEM_U32(a1 + 0); +t2 = MEM_U32(v1 + 0); +t4 = t3 << 4; +v0 = t2 + t4; +t5 = MEM_U8(v0 + -10); +v0 = v0 + 0xfffffff0; +t7 = t5 & 0xff3f; +t6 = t7 | 0x80; +MEM_U8(v0 + 6) = (uint8_t)t6; +t9 = MEM_U32(a1 + 0); +t8 = MEM_U32(v1 + 0); +t0 = t9 << 4; +t1 = t8 + t0; +MEM_U32(t1 + -4) = a0; +t3 = MEM_U32(a1 + 0); +//nop; +t2 = t3 + 0xffffffff; +MEM_U32(a1 + 0) = t2; +return; +MEM_U32(a1 + 0) = t2; +} + +static void f_demit_cpalias(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41b644: +//demit_cpalias: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 36) = zero; +a1 = a0; +t6 = MEM_U8(sp + 37); +t9 = a1 << 25; +MEM_U32(sp + 40) = t9; +//nop; +t7 = t6 & 0xffc0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 48) = a0; +t8 = t7 | 0x21; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 44) = zero; +MEM_U8(sp + 37) = (uint8_t)t8; +MEM_U32(sp + 32) = zero; +a0 = sp + 0x20; +f_append_d(mem, sp, a0); +goto L41b694; +a0 = sp + 0x20; +L41b694: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void f_emit_cpalias(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41b6a4: +//emit_cpalias: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 36) = zero; +a1 = a0; +t6 = MEM_U8(sp + 37); +t9 = a1 << 25; +MEM_U32(sp + 40) = t9; +//nop; +t7 = t6 & 0xffc0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 48) = a0; +t8 = t7 | 0x21; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 44) = zero; +MEM_U8(sp + 37) = (uint8_t)t8; +MEM_U32(sp + 32) = zero; +a0 = sp + 0x20; +f_append_i(mem, sp, a0); +goto L41b6f4; +a0 = sp + 0x20; +L41b6f4: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void f_emit_cpadd(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L41b704: +//emit_cpadd: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 36) = zero; +a1 = a0; +t6 = MEM_U8(sp + 37); +t9 = a1 << 25; +MEM_U32(sp + 40) = t9; +at = 0x100197c4; +//nop; +t7 = t6 & 0xffc0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 48) = a0; +t8 = t7 | 0x11; +t0 = 0x1; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 44) = zero; +MEM_U8(sp + 37) = (uint8_t)t8; +MEM_U32(sp + 32) = zero; +a0 = sp + 0x20; +MEM_U8(at + 0) = (uint8_t)t0; +f_append_i(mem, sp, a0); +goto L41b760; +MEM_U8(at + 0) = (uint8_t)t0; +L41b760: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x30; +return; +sp = sp + 0x30; +//nop; +} + +static void func_41b774(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41b774: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +//nop; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 28) = ra; +a1 = MEM_U8(sp + 35); +a3 = MEM_U32(sp + 40); +a2 = MEM_U8(sp + 39); +MEM_U32(sp + 24) = gp; +a0 = 0x1a; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41b7b0; +a0 = 0x1a; +L41b7b0: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 35); +a2 = MEM_U8(sp + 39); +//nop; +a3 = MEM_U32(sp + 40); +a0 = 0x1a; +a1 = a1 + 0x1; +a2 = a2 + 0x1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41b7d4; +a2 = a2 + 0x1; +L41b7d4: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void func_41b7e4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41b7e4: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41b810; +MEM_U32(sp + 48) = a2; +L41b810: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U8(sp + 47); +MEM_U32(sp + 32) = v0; +a0 = 0x1a; +a3 = v0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41b830; +a3 = v0; +L41b830: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +a2 = MEM_U8(sp + 47); +//nop; +a3 = MEM_U32(sp + 48); +a0 = 0xd; +a1 = a1 + 0x1; +a2 = a2 + 0x1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41b854; +a2 = a2 + 0x1; +L41b854: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41b86c; +//nop; +L41b86c: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41b87c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41b87c: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a0 & 0xff; +s1 = a1 & 0xff; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +MEM_U32(sp + 64) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41b8b8; +MEM_U32(sp + 64) = a2; +L41b8b8: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 48) = v0; +t6 = 0x10018e80; +a2 = s1 + 0x1; +t6 = MEM_U8(t6 + 0); +a0 = 0x11; +if (t6 == 0) {a1 = s0; +goto L41b938;} +a1 = s0; +//nop; +a1 = s0 + 0x1; +a3 = MEM_U32(sp + 64); +MEM_U32(sp + 44) = a1; +a0 = 0x11; +MEM_U32(sp + 40) = a2; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41b8f4; +MEM_U32(sp + 40) = a2; +L41b8f4: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 44); +//nop; +a2 = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 48); +a0 = 0x17; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41b910; +a0 = 0x17; +L41b910: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0x12; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41b92c; +a2 = s1; +L41b92c: +gp = MEM_U32(sp + 32); +//nop; +goto L41b988; +//nop; +L41b938: +//nop; +a3 = MEM_U32(sp + 64); +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41b948; +a2 = s1; +L41b948: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 48); +//nop; +a0 = 0x17; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41b964; +a2 = s1; +L41b964: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0x12; +a1 = s0 + 0x1; +a2 = s1 + 0x1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41b980; +a2 = s1 + 0x1; +L41b980: +gp = MEM_U32(sp + 32); +//nop; +L41b988: +//nop; +a0 = MEM_U32(sp + 48); +//nop; +f_define_label(mem, sp, a0); +goto L41b998; +//nop; +L41b998: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void func_41b9b0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41b9b0: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a0 & 0xff; +s1 = a1 & 0xff; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +MEM_U32(sp + 64) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41b9ec; +MEM_U32(sp + 64) = a2; +L41b9ec: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 48) = v0; +t6 = 0x10018e80; +a2 = s1 + 0x1; +t6 = MEM_U8(t6 + 0); +a0 = 0x12; +if (t6 == 0) {a1 = s0; +goto L41ba6c;} +a1 = s0; +//nop; +a1 = s0 + 0x1; +a3 = MEM_U32(sp + 64); +MEM_U32(sp + 44) = a1; +a0 = 0x12; +MEM_U32(sp + 40) = a2; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41ba28; +MEM_U32(sp + 40) = a2; +L41ba28: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 44); +//nop; +a2 = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 48); +a0 = 0x18; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41ba44; +a0 = 0x18; +L41ba44: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0x12; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41ba60; +a2 = s1; +L41ba60: +gp = MEM_U32(sp + 32); +//nop; +goto L41babc; +//nop; +L41ba6c: +//nop; +a3 = MEM_U32(sp + 64); +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41ba7c; +a2 = s1; +L41ba7c: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 48); +//nop; +a0 = 0x18; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41ba98; +a2 = s1; +L41ba98: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0x12; +a1 = s0 + 0x1; +a2 = s1 + 0x1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bab4; +a2 = s1 + 0x1; +L41bab4: +gp = MEM_U32(sp + 32); +//nop; +L41babc: +//nop; +a0 = MEM_U32(sp + 48); +//nop; +f_define_label(mem, sp, a0); +goto L41bacc; +//nop; +L41bacc: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void func_41bae4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41bae4: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a0 & 0xff; +s1 = a1 & 0xff; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +MEM_U32(sp + 64) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41bb20; +MEM_U32(sp + 64) = a2; +L41bb20: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 48) = v0; +t6 = 0x10018e80; +a2 = s1 + 0x1; +t6 = MEM_U8(t6 + 0); +a0 = 0x17; +if (t6 == 0) {a1 = s0; +goto L41bba0;} +a1 = s0; +//nop; +a1 = s0 + 0x1; +a3 = MEM_U32(sp + 64); +MEM_U32(sp + 44) = a1; +a0 = 0x17; +MEM_U32(sp + 40) = a2; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bb5c; +MEM_U32(sp + 40) = a2; +L41bb5c: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 44); +//nop; +a2 = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 48); +a0 = 0x11; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bb78; +a0 = 0x11; +L41bb78: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0x18; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bb94; +a2 = s1; +L41bb94: +gp = MEM_U32(sp + 32); +//nop; +goto L41bbf0; +//nop; +L41bba0: +//nop; +a3 = MEM_U32(sp + 64); +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bbb0; +a2 = s1; +L41bbb0: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 48); +//nop; +a0 = 0x11; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bbcc; +a2 = s1; +L41bbcc: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0x18; +a1 = s0 + 0x1; +a2 = s1 + 0x1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bbe8; +a2 = s1 + 0x1; +L41bbe8: +gp = MEM_U32(sp + 32); +//nop; +L41bbf0: +//nop; +a0 = MEM_U32(sp + 48); +//nop; +f_define_label(mem, sp, a0); +goto L41bc00; +//nop; +L41bc00: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void func_41bc18(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41bc18: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a0 & 0xff; +s1 = a1 & 0xff; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +MEM_U32(sp + 64) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41bc54; +MEM_U32(sp + 64) = a2; +L41bc54: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 48) = v0; +t6 = 0x10018e80; +a2 = s1 + 0x1; +t6 = MEM_U8(t6 + 0); +a0 = 0x18; +if (t6 == 0) {a1 = s0; +goto L41bcd4;} +a1 = s0; +//nop; +a1 = s0 + 0x1; +a3 = MEM_U32(sp + 64); +MEM_U32(sp + 44) = a1; +a0 = 0x18; +MEM_U32(sp + 40) = a2; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bc90; +MEM_U32(sp + 40) = a2; +L41bc90: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 44); +//nop; +a2 = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 48); +a0 = 0x12; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bcac; +a0 = 0x12; +L41bcac: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0x18; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bcc8; +a2 = s1; +L41bcc8: +gp = MEM_U32(sp + 32); +//nop; +goto L41bd24; +//nop; +L41bcd4: +//nop; +a3 = MEM_U32(sp + 64); +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bce4; +a2 = s1; +L41bce4: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 48); +//nop; +a0 = 0x12; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bd00; +a2 = s1; +L41bd00: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0x18; +a1 = s0 + 0x1; +a2 = s1 + 0x1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bd1c; +a2 = s1 + 0x1; +L41bd1c: +gp = MEM_U32(sp + 32); +//nop; +L41bd24: +//nop; +a0 = MEM_U32(sp + 48); +//nop; +f_define_label(mem, sp, a0); +goto L41bd34; +//nop; +L41bd34: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void func_41bd4c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41bd4c: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a0 & 0xff; +s1 = a1 & 0xff; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +MEM_U32(sp + 64) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41bd88; +MEM_U32(sp + 64) = a2; +L41bd88: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 48) = v0; +t6 = 0x10018e80; +a2 = s1 + 0x1; +t6 = MEM_U8(t6 + 0); +a0 = 0x17; +if (t6 == 0) {a1 = s0; +goto L41be08;} +a1 = s0; +//nop; +a1 = s0 + 0x1; +a3 = MEM_U32(sp + 64); +MEM_U32(sp + 44) = a1; +a0 = 0x17; +MEM_U32(sp + 40) = a2; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bdc4; +MEM_U32(sp + 40) = a2; +L41bdc4: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 44); +//nop; +a2 = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 48); +a0 = 0x11; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bde0; +a0 = 0x11; +L41bde0: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0x15; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bdfc; +a2 = s1; +L41bdfc: +gp = MEM_U32(sp + 32); +//nop; +goto L41be58; +//nop; +L41be08: +//nop; +a3 = MEM_U32(sp + 64); +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41be18; +a2 = s1; +L41be18: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 48); +//nop; +a0 = 0x11; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41be34; +a2 = s1; +L41be34: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0x15; +a1 = s0 + 0x1; +a2 = s1 + 0x1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41be50; +a2 = s1 + 0x1; +L41be50: +gp = MEM_U32(sp + 32); +//nop; +L41be58: +//nop; +a0 = MEM_U32(sp + 48); +//nop; +f_define_label(mem, sp, a0); +goto L41be68; +//nop; +L41be68: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void func_41be80(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41be80: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a0 & 0xff; +s1 = a1 & 0xff; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +MEM_U32(sp + 64) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41bebc; +MEM_U32(sp + 64) = a2; +L41bebc: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 48) = v0; +t6 = 0x10018e80; +a2 = s1 + 0x1; +t6 = MEM_U8(t6 + 0); +a0 = 0x18; +if (t6 == 0) {a1 = s0; +goto L41bf3c;} +a1 = s0; +//nop; +a1 = s0 + 0x1; +a3 = MEM_U32(sp + 64); +MEM_U32(sp + 44) = a1; +a0 = 0x18; +MEM_U32(sp + 40) = a2; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bef8; +MEM_U32(sp + 40) = a2; +L41bef8: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 44); +//nop; +a2 = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 48); +a0 = 0x12; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bf14; +a0 = 0x12; +L41bf14: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0x15; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bf30; +a2 = s1; +L41bf30: +gp = MEM_U32(sp + 32); +//nop; +goto L41bf8c; +//nop; +L41bf3c: +//nop; +a3 = MEM_U32(sp + 64); +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bf4c; +a2 = s1; +L41bf4c: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 48); +//nop; +a0 = 0x12; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bf68; +a2 = s1; +L41bf68: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0x15; +a1 = s0 + 0x1; +a2 = s1 + 0x1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41bf84; +a2 = s1 + 0x1; +L41bf84: +gp = MEM_U32(sp + 32); +//nop; +L41bf8c: +//nop; +a0 = MEM_U32(sp + 48); +//nop; +f_define_label(mem, sp, a0); +goto L41bf9c; +//nop; +L41bf9c: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void func_41bfb4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41bfb4: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a0 & 0xff; +s1 = a1 & 0xff; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +MEM_U32(sp + 64) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41bff0; +MEM_U32(sp + 64) = a2; +L41bff0: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 48) = v0; +t6 = 0x10018e80; +a2 = s1 + 0x1; +t6 = MEM_U8(t6 + 0); +a0 = 0x11; +if (t6 == 0) {a1 = s0; +goto L41c070;} +a1 = s0; +//nop; +a1 = s0 + 0x1; +a3 = MEM_U32(sp + 64); +MEM_U32(sp + 44) = a1; +a0 = 0x11; +MEM_U32(sp + 40) = a2; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41c02c; +MEM_U32(sp + 40) = a2; +L41c02c: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 44); +//nop; +a2 = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 48); +a0 = 0x17; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41c048; +a0 = 0x17; +L41c048: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0xf; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41c064; +a2 = s1; +L41c064: +gp = MEM_U32(sp + 32); +//nop; +goto L41c0c0; +//nop; +L41c070: +//nop; +a3 = MEM_U32(sp + 64); +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41c080; +a2 = s1; +L41c080: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 48); +//nop; +a0 = 0x17; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41c09c; +a2 = s1; +L41c09c: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0xf; +a1 = s0 + 0x1; +a2 = s1 + 0x1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41c0b8; +a2 = s1 + 0x1; +L41c0b8: +gp = MEM_U32(sp + 32); +//nop; +L41c0c0: +//nop; +a0 = MEM_U32(sp + 48); +//nop; +f_define_label(mem, sp, a0); +goto L41c0d0; +//nop; +L41c0d0: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void func_41c0e8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41c0e8: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a0 & 0xff; +s1 = a1 & 0xff; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +MEM_U32(sp + 64) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41c124; +MEM_U32(sp + 64) = a2; +L41c124: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 48) = v0; +t6 = 0x10018e80; +a2 = s1 + 0x1; +t6 = MEM_U8(t6 + 0); +a0 = 0x12; +if (t6 == 0) {a1 = s0; +goto L41c1a4;} +a1 = s0; +//nop; +a1 = s0 + 0x1; +a3 = MEM_U32(sp + 64); +MEM_U32(sp + 44) = a1; +a0 = 0x12; +MEM_U32(sp + 40) = a2; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41c160; +MEM_U32(sp + 40) = a2; +L41c160: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 44); +//nop; +a2 = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 48); +a0 = 0x18; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41c17c; +a0 = 0x18; +L41c17c: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0xf; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41c198; +a2 = s1; +L41c198: +gp = MEM_U32(sp + 32); +//nop; +goto L41c1f4; +//nop; +L41c1a4: +//nop; +a3 = MEM_U32(sp + 64); +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41c1b4; +a2 = s1; +L41c1b4: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 48); +//nop; +a0 = 0x18; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41c1d0; +a2 = s1; +L41c1d0: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0xf; +a1 = s0 + 0x1; +a2 = s1 + 0x1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41c1ec; +a2 = s1 + 0x1; +L41c1ec: +gp = MEM_U32(sp + 32); +//nop; +L41c1f4: +//nop; +a0 = MEM_U32(sp + 48); +//nop; +f_define_label(mem, sp, a0); +goto L41c204; +//nop; +L41c204: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void f_emit_branch_rrll(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41c21c: +//emit_branch_rrll: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +t6 = 0x10018ecc; +MEM_U32(sp + 28) = s1; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 24) = s0; +s0 = a1 & 0xff; +s1 = a2 & 0xff; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 52) = a1; +if (t6 != 0) {MEM_U32(sp + 56) = a2; +goto L41c460;} +MEM_U32(sp + 56) = a2; +t7 = MEM_U32(sp + 64); +at = 0x5010000; +t8 = MEM_U8(t7 + 33); +v0 = a0 & 0xffff; +t9 = t8 & 0x1f; +t0 = t9 < 0x20; +t1 = -t0; +t2 = t1 & at; +t3 = t2 << (t9 & 0x1f); +if ((int)t3 >= 0) {t4 = v0 + 0xfffffff3; +goto L41c460;} +t4 = v0 + 0xfffffff3; +at = t4 < 0xe; +if (at == 0) {//nop; +goto L41c444;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10008270[] = { +&&L41c2dc, +&&L41c3f4, +&&L41c41c, +&&L41c444, +&&L41c304, +&&L41c32c, +&&L41c444, +&&L41c3a4, +&&L41c3cc, +&&L41c444, +&&L41c354, +&&L41c37c, +&&L41c444, +&&L41c2b4, +}; +dest = Lswitch10008270[t4]; +//nop; +goto *dest; +//nop; +L41c2b4: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x30; +func_41b774(mem, sp, a0, a1, a2); +goto L41c2d0; +v0 = sp + 0x30; +L41c2d0: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41c47c; +ra = MEM_U32(sp + 36); +L41c2dc: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x30; +func_41b7e4(mem, sp, a0, a1, a2); +goto L41c2f8; +v0 = sp + 0x30; +L41c2f8: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41c47c; +ra = MEM_U32(sp + 36); +L41c304: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x30; +func_41b87c(mem, sp, a0, a1, a2); +goto L41c320; +v0 = sp + 0x30; +L41c320: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41c47c; +ra = MEM_U32(sp + 36); +L41c32c: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x30; +func_41b9b0(mem, sp, a0, a1, a2); +goto L41c348; +v0 = sp + 0x30; +L41c348: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41c47c; +ra = MEM_U32(sp + 36); +L41c354: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x30; +func_41bae4(mem, sp, a0, a1, a2); +goto L41c370; +v0 = sp + 0x30; +L41c370: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41c47c; +ra = MEM_U32(sp + 36); +L41c37c: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x30; +func_41bc18(mem, sp, a0, a1, a2); +goto L41c398; +v0 = sp + 0x30; +L41c398: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41c47c; +ra = MEM_U32(sp + 36); +L41c3a4: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x30; +func_41bd4c(mem, sp, a0, a1, a2); +goto L41c3c0; +v0 = sp + 0x30; +L41c3c0: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41c47c; +ra = MEM_U32(sp + 36); +L41c3cc: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x30; +func_41be80(mem, sp, a0, a1, a2); +goto L41c3e8; +v0 = sp + 0x30; +L41c3e8: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41c47c; +ra = MEM_U32(sp + 36); +L41c3f4: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x30; +func_41bfb4(mem, sp, a0, a1, a2); +goto L41c410; +v0 = sp + 0x30; +L41c410: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41c47c; +ra = MEM_U32(sp + 36); +L41c41c: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x30; +func_41c0e8(mem, sp, a0, a1, a2); +goto L41c438; +v0 = sp + 0x30; +L41c438: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41c47c; +ra = MEM_U32(sp + 36); +L41c444: +//nop; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41c454; +a2 = s1; +L41c454: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41c47c; +ra = MEM_U32(sp + 36); +L41c460: +//nop; +a1 = s0; +a2 = s1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41c470; +a2 = s1; +L41c470: +gp = MEM_U32(sp + 32); +//nop; +ra = MEM_U32(sp + 36); +L41c47c: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_41c48c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41c48c: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 40) = a2; +//nop; +a2 = a1; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 28) = ra; +a1 = MEM_U8(sp + 35); +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 44) = a3; +a0 = 0x1a; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c4c8; +a0 = 0x1a; +L41c4c8: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 35); +//nop; +a2 = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 44); +a0 = 0x1a; +a1 = a1 + 0x1; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c4e8; +a1 = a1 + 0x1; +L41c4e8: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void func_41c4f8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41c4f8: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41c528; +MEM_U32(sp + 52) = a3; +L41c528: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +MEM_U32(sp + 32) = v0; +a0 = 0x1a; +a3 = v0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c548; +a3 = v0; +L41c548: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 48); +a3 = MEM_U32(sp + 52); +a0 = 0xd; +a1 = a1 + 0x1; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c568; +a1 = a1 + 0x1; +L41c568: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41c580; +//nop; +L41c580: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41c590(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41c590: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41c5c0; +MEM_U32(sp + 52) = a3; +L41c5c0: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 52); +MEM_U32(sp + 32) = v0; +a0 = 0x11; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c5e0; +a0 = 0x11; +L41c5e0: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 32); +a0 = 0x17; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c5fc; +a0 = 0x17; +L41c5fc: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 48); +a3 = MEM_U32(sp + 52); +a0 = 0x12; +a1 = a1 + 0x1; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c61c; +a1 = a1 + 0x1; +L41c61c: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41c634; +//nop; +L41c634: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41c644(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41c644: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41c674; +MEM_U32(sp + 52) = a3; +L41c674: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 52); +MEM_U32(sp + 32) = v0; +a0 = 0x12; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c694; +a0 = 0x12; +L41c694: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 32); +a0 = 0x18; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c6b0; +a0 = 0x18; +L41c6b0: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 48); +a3 = MEM_U32(sp + 52); +a0 = 0x12; +a1 = a1 + 0x1; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c6d0; +a1 = a1 + 0x1; +L41c6d0: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41c6e8; +//nop; +L41c6e8: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41c6f8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41c6f8: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41c728; +MEM_U32(sp + 52) = a3; +L41c728: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 52); +MEM_U32(sp + 32) = v0; +a0 = 0x11; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c748; +a0 = 0x11; +L41c748: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 32); +a0 = 0x17; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c764; +a0 = 0x17; +L41c764: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 48); +a3 = MEM_U32(sp + 52); +a0 = 0xf; +a1 = a1 + 0x1; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c784; +a1 = a1 + 0x1; +L41c784: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41c79c; +//nop; +L41c79c: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41c7ac(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41c7ac: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41c7dc; +MEM_U32(sp + 52) = a3; +L41c7dc: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 52); +MEM_U32(sp + 32) = v0; +a0 = 0x12; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c7fc; +a0 = 0x12; +L41c7fc: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 32); +a0 = 0x18; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c818; +a0 = 0x18; +L41c818: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 48); +a3 = MEM_U32(sp + 52); +a0 = 0xf; +a1 = a1 + 0x1; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c838; +a1 = a1 + 0x1; +L41c838: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41c850; +//nop; +L41c850: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41c860(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41c860: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41c890; +MEM_U32(sp + 52) = a3; +L41c890: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 52); +MEM_U32(sp + 32) = v0; +a0 = 0x17; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c8b0; +a0 = 0x17; +L41c8b0: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 32); +a0 = 0x11; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c8cc; +a0 = 0x11; +L41c8cc: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 48); +a3 = MEM_U32(sp + 52); +a0 = 0x18; +a1 = a1 + 0x1; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c8ec; +a1 = a1 + 0x1; +L41c8ec: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41c904; +//nop; +L41c904: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41c914(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41c914: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41c944; +MEM_U32(sp + 52) = a3; +L41c944: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 52); +MEM_U32(sp + 32) = v0; +a0 = 0x18; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c964; +a0 = 0x18; +L41c964: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 32); +a0 = 0x12; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c980; +a0 = 0x12; +L41c980: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 48); +a3 = MEM_U32(sp + 52); +a0 = 0x18; +a1 = a1 + 0x1; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41c9a0; +a1 = a1 + 0x1; +L41c9a0: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41c9b8; +//nop; +L41c9b8: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41c9c8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41c9c8: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41c9f8; +MEM_U32(sp + 52) = a3; +L41c9f8: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 52); +MEM_U32(sp + 32) = v0; +a0 = 0x17; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41ca18; +a0 = 0x17; +L41ca18: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 32); +a0 = 0x11; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41ca34; +a0 = 0x11; +L41ca34: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 48); +a3 = MEM_U32(sp + 52); +a0 = 0x15; +a1 = a1 + 0x1; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41ca54; +a1 = a1 + 0x1; +L41ca54: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41ca6c; +//nop; +L41ca6c: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41ca7c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41ca7c: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41caac; +MEM_U32(sp + 52) = a3; +L41caac: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 52); +MEM_U32(sp + 32) = v0; +a0 = 0x18; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41cacc; +a0 = 0x18; +L41cacc: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 32); +a0 = 0x12; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41cae8; +a0 = 0x12; +L41cae8: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 48); +a3 = MEM_U32(sp + 52); +a0 = 0x15; +a1 = a1 + 0x1; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41cb08; +a1 = a1 + 0x1; +L41cb08: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41cb20; +//nop; +L41cb20: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_branch_rill(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41cb30: +//emit_branch_rill: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +v0 = 0x10018ecc; +MEM_U32(sp + 28) = s2; +v0 = MEM_U8(v0 + 0); +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +s0 = a2; +s1 = a1 & 0xff; +s2 = a3; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a0; +if (v0 != 0) {MEM_U32(sp + 60) = a1; +goto L41cdb4;} +MEM_U32(sp + 60) = a1; +t6 = MEM_U32(sp + 76); +at = 0x5010000; +t7 = MEM_U8(t6 + 33); +//nop; +t8 = t7 & 0x1f; +t9 = t8 < 0x20; +t0 = -t9; +t1 = t0 & at; +t2 = t1 << (t8 & 0x1f); +if ((int)t2 >= 0) {at = 0x1; +goto L41cdb8;} +at = 0x1; +v0 = MEM_U16(sp + 58); +//nop; +t3 = v0 + 0xfffffff3; +at = t3 < 0xe; +if (at == 0) {//nop; +goto L41cd90;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100082a8[] = { +&&L41cc04, +&&L41cd38, +&&L41cd64, +&&L41cd90, +&&L41cc30, +&&L41cc5c, +&&L41cd90, +&&L41cce0, +&&L41cd0c, +&&L41cd90, +&&L41cc88, +&&L41ccb4, +&&L41cd90, +&&L41cbd8, +}; +dest = Lswitch100082a8[t3]; +//nop; +goto *dest; +//nop; +L41cbd8: +//nop; +a3 = MEM_U32(sp + 72); +t9 = t9; +a0 = s1; +a1 = s0; +a2 = s2; +v0 = sp + 0x38; +func_41c48c(mem, sp, a0, a1, a2, a3); +goto L41cbf8; +v0 = sp + 0x38; +L41cbf8: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41ce64; +ra = MEM_U32(sp + 36); +L41cc04: +//nop; +a3 = MEM_U32(sp + 72); +t9 = t9; +a0 = s1; +a1 = s0; +a2 = s2; +v0 = sp + 0x38; +func_41c4f8(mem, sp, a0, a1, a2, a3); +goto L41cc24; +v0 = sp + 0x38; +L41cc24: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41ce64; +ra = MEM_U32(sp + 36); +L41cc30: +//nop; +a3 = MEM_U32(sp + 72); +t9 = t9; +a0 = s1; +a1 = s0; +a2 = s2; +v0 = sp + 0x38; +func_41c590(mem, sp, a0, a1, a2, a3); +goto L41cc50; +v0 = sp + 0x38; +L41cc50: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41ce64; +ra = MEM_U32(sp + 36); +L41cc5c: +//nop; +a3 = MEM_U32(sp + 72); +t9 = t9; +a0 = s1; +a1 = s0; +a2 = s2; +v0 = sp + 0x38; +func_41c644(mem, sp, a0, a1, a2, a3); +goto L41cc7c; +v0 = sp + 0x38; +L41cc7c: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41ce64; +ra = MEM_U32(sp + 36); +L41cc88: +//nop; +a3 = MEM_U32(sp + 72); +t9 = t9; +a0 = s1; +a1 = s0; +a2 = s2; +v0 = sp + 0x38; +func_41c860(mem, sp, a0, a1, a2, a3); +goto L41cca8; +v0 = sp + 0x38; +L41cca8: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41ce64; +ra = MEM_U32(sp + 36); +L41ccb4: +//nop; +a3 = MEM_U32(sp + 72); +t9 = t9; +a0 = s1; +a1 = s0; +a2 = s2; +v0 = sp + 0x38; +func_41c914(mem, sp, a0, a1, a2, a3); +goto L41ccd4; +v0 = sp + 0x38; +L41ccd4: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41ce64; +ra = MEM_U32(sp + 36); +L41cce0: +//nop; +a3 = MEM_U32(sp + 72); +t9 = t9; +a0 = s1; +a1 = s0; +a2 = s2; +v0 = sp + 0x38; +func_41c9c8(mem, sp, a0, a1, a2, a3); +goto L41cd00; +v0 = sp + 0x38; +L41cd00: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41ce64; +ra = MEM_U32(sp + 36); +L41cd0c: +//nop; +a3 = MEM_U32(sp + 72); +t9 = t9; +a0 = s1; +a1 = s0; +a2 = s2; +v0 = sp + 0x38; +func_41ca7c(mem, sp, a0, a1, a2, a3); +goto L41cd2c; +v0 = sp + 0x38; +L41cd2c: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41ce64; +ra = MEM_U32(sp + 36); +L41cd38: +//nop; +a3 = MEM_U32(sp + 72); +t9 = t9; +a0 = s1; +a1 = s0; +a2 = s2; +v0 = sp + 0x38; +func_41c6f8(mem, sp, a0, a1, a2, a3); +goto L41cd58; +v0 = sp + 0x38; +L41cd58: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41ce64; +ra = MEM_U32(sp + 36); +L41cd64: +//nop; +a3 = MEM_U32(sp + 72); +t9 = t9; +a0 = s1; +a1 = s0; +a2 = s2; +v0 = sp + 0x38; +func_41c7ac(mem, sp, a0, a1, a2, a3); +goto L41cd84; +v0 = sp + 0x38; +L41cd84: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41ce64; +ra = MEM_U32(sp + 36); +L41cd90: +//nop; +a0 = MEM_U16(sp + 58); +a3 = MEM_U32(sp + 72); +a1 = s1; +a2 = s2; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41cda8; +a2 = s2; +L41cda8: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41ce64; +ra = MEM_U32(sp + 36); +L41cdb4: +at = 0x1; +L41cdb8: +if (v0 != at) {a1 = s1; +goto L41ce44;} +a1 = s1; +if (s0 == 0) {a0 = zero; +goto L41ce44;} +a0 = zero; +//nop; +MEM_U32(sp + 48) = s0; +MEM_U32(sp + 52) = s2; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L41cddc; +a1 = 0x1; +L41cddc: +gp = MEM_U32(sp + 32); +s0 = v0 & 0xff; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L41cdf4; +//nop; +L41cdf4: +t4 = sp + 0x30; +a2 = MEM_U32(t4 + 0); +gp = MEM_U32(sp + 32); +MEM_U32(sp + 8) = a2; +a3 = MEM_U32(t4 + 4); +//nop; +a0 = 0x14c; +a1 = s0; +MEM_U32(sp + 12) = a3; +f_emit_rii(mem, sp, a0, a1, a2, a3); +goto L41ce1c; +MEM_U32(sp + 12) = a3; +L41ce1c: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 58); +//nop; +a3 = MEM_U32(sp + 72); +a1 = s1; +a2 = s0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41ce38; +a2 = s0; +L41ce38: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41ce64; +ra = MEM_U32(sp + 36); +L41ce44: +//nop; +a0 = MEM_U16(sp + 58); +a3 = MEM_U32(sp + 72); +a2 = s2; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41ce58; +a2 = s2; +L41ce58: +gp = MEM_U32(sp + 32); +//nop; +ra = MEM_U32(sp + 36); +L41ce64: +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void func_41ce78(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41ce78: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +//nop; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 36) = ra; +a1 = MEM_U8(sp + 43); +a3 = MEM_U32(sp + 48); +a2 = MEM_U8(sp + 47); +MEM_U32(sp + 32) = gp; +a0 = 0x104; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41ceb8; +MEM_U32(sp + 16) = zero; +L41ceb8: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 43); +a2 = MEM_U8(sp + 47); +//nop; +a3 = MEM_U32(sp + 48); +a0 = 0x104; +MEM_U32(sp + 16) = zero; +a1 = a1 + 0x1; +a2 = a2 + 0x1; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41cee0; +a2 = a2 + 0x1; +L41cee0: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41cef0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41cef0: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 52) = a1; +MEM_U32(sp + 56) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41cf1c; +MEM_U32(sp + 56) = a2; +L41cf1c: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +//nop; +a2 = MEM_U8(sp + 55); +MEM_U32(sp + 40) = v0; +a0 = 0x1a; +a3 = v0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41cf3c; +a3 = v0; +L41cf3c: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +a2 = MEM_U8(sp + 55); +//nop; +a3 = MEM_U32(sp + 56); +a0 = 0x103; +MEM_U32(sp + 16) = zero; +a1 = a1 + 0x1; +a2 = a2 + 0x1; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41cf64; +a2 = a2 + 0x1; +L41cf64: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 40); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41cf7c; +//nop; +L41cf7c: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_41cf8c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41cf8c: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 52) = a1; +MEM_U32(sp + 56) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41cfb8; +MEM_U32(sp + 56) = a2; +L41cfb8: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +//nop; +a2 = MEM_U8(sp + 55); +a3 = MEM_U32(sp + 56); +MEM_U32(sp + 40) = v0; +a0 = 0xff; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41cfdc; +MEM_U32(sp + 16) = zero; +L41cfdc: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +//nop; +a2 = MEM_U8(sp + 55); +a3 = MEM_U32(sp + 40); +a0 = 0x11; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41cff8; +a0 = 0x11; +L41cff8: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +a2 = MEM_U8(sp + 55); +//nop; +a3 = MEM_U32(sp + 56); +a0 = 0x100; +MEM_U32(sp + 16) = zero; +a1 = a1 + 0x1; +a2 = a2 + 0x1; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41d020; +a2 = a2 + 0x1; +L41d020: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 40); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41d038; +//nop; +L41d038: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_41d048(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41d048: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 52) = a1; +MEM_U32(sp + 56) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41d074; +MEM_U32(sp + 56) = a2; +L41d074: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +//nop; +a2 = MEM_U8(sp + 55); +a3 = MEM_U32(sp + 56); +MEM_U32(sp + 40) = v0; +a0 = 0x100; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41d098; +MEM_U32(sp + 16) = zero; +L41d098: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +//nop; +a2 = MEM_U8(sp + 55); +a3 = MEM_U32(sp + 40); +a0 = 0x12; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41d0b4; +a0 = 0x12; +L41d0b4: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +a2 = MEM_U8(sp + 55); +//nop; +a3 = MEM_U32(sp + 56); +a0 = 0x18; +MEM_U32(sp + 16) = zero; +a1 = a1 + 0x1; +a2 = a2 + 0x1; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41d0dc; +a2 = a2 + 0x1; +L41d0dc: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 40); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41d0f4; +//nop; +L41d0f4: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_41d104(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41d104: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 52) = a1; +MEM_U32(sp + 56) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41d130; +MEM_U32(sp + 56) = a2; +L41d130: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 55); +//nop; +a2 = MEM_U8(sp + 51); +a3 = MEM_U32(sp + 56); +MEM_U32(sp + 40) = v0; +a0 = 0xff; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41d154; +MEM_U32(sp + 16) = zero; +L41d154: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +//nop; +a2 = MEM_U8(sp + 55); +a3 = MEM_U32(sp + 40); +a0 = 0x17; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41d170; +a0 = 0x17; +L41d170: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +a2 = MEM_U8(sp + 55); +//nop; +a3 = MEM_U32(sp + 56); +a0 = 0x102; +MEM_U32(sp + 16) = zero; +a1 = a1 + 0x1; +a2 = a2 + 0x1; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41d198; +a2 = a2 + 0x1; +L41d198: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 40); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41d1b0; +//nop; +L41d1b0: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_41d1c0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41d1c0: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 52) = a1; +MEM_U32(sp + 56) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41d1ec; +MEM_U32(sp + 56) = a2; +L41d1ec: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 55); +//nop; +a2 = MEM_U8(sp + 51); +a3 = MEM_U32(sp + 56); +MEM_U32(sp + 40) = v0; +a0 = 0x100; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41d210; +MEM_U32(sp + 16) = zero; +L41d210: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +//nop; +a2 = MEM_U8(sp + 55); +a3 = MEM_U32(sp + 40); +a0 = 0x18; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41d22c; +a0 = 0x18; +L41d22c: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 51); +a2 = MEM_U8(sp + 55); +//nop; +a3 = MEM_U32(sp + 56); +a0 = 0x102; +MEM_U32(sp + 16) = zero; +a1 = a1 + 0x1; +a2 = a2 + 0x1; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41d254; +a2 = a2 + 0x1; +L41d254: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 40); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41d26c; +//nop; +L41d26c: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void f_emit_trap_rri(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41d27c: +//emit_trap_rri: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +t6 = 0x10018ecc; +MEM_U32(sp + 36) = s1; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 32) = s0; +s0 = a1 & 0xff; +s1 = a2 & 0xff; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +if (t6 != 0) {MEM_U32(sp + 64) = a2; +goto L41d420;} +MEM_U32(sp + 64) = a2; +t7 = MEM_U32(sp + 72); +at = 0x5010000; +t8 = MEM_U8(t7 + 33); +v0 = a0 & 0xffff; +t9 = t8 & 0x1f; +t0 = t9 < 0x20; +t1 = -t0; +t2 = t1 & at; +t3 = t2 << (t9 & 0x1f); +if ((int)t3 >= 0) {t4 = v0 + 0xffffff01; +goto L41d420;} +t4 = v0 + 0xffffff01; +at = t4 < 0x6; +if (at == 0) {a1 = s0; +goto L41d404;} +a1 = s0; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100082e0[] = { +&&L41d3b4, +&&L41d3dc, +&&L41d364, +&&L41d38c, +&&L41d33c, +&&L41d314, +}; +dest = Lswitch100082e0[t4]; +//nop; +goto *dest; +//nop; +L41d314: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x38; +func_41ce78(mem, sp, a0, a1, a2); +goto L41d330; +v0 = sp + 0x38; +L41d330: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L41d440; +ra = MEM_U32(sp + 44); +L41d33c: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x38; +func_41cef0(mem, sp, a0, a1, a2); +goto L41d358; +v0 = sp + 0x38; +L41d358: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L41d440; +ra = MEM_U32(sp + 44); +L41d364: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x38; +func_41d104(mem, sp, a0, a1, a2); +goto L41d380; +v0 = sp + 0x38; +L41d380: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L41d440; +ra = MEM_U32(sp + 44); +L41d38c: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x38; +func_41d1c0(mem, sp, a0, a1, a2); +goto L41d3a8; +v0 = sp + 0x38; +L41d3a8: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L41d440; +ra = MEM_U32(sp + 44); +L41d3b4: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x38; +func_41cf8c(mem, sp, a0, a1, a2); +goto L41d3d0; +v0 = sp + 0x38; +L41d3d0: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L41d440; +ra = MEM_U32(sp + 44); +L41d3dc: +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = a3; +v0 = sp + 0x38; +func_41d048(mem, sp, a0, a1, a2); +goto L41d3f8; +v0 = sp + 0x38; +L41d3f8: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L41d440; +ra = MEM_U32(sp + 44); +L41d404: +//nop; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41d414; +MEM_U32(sp + 16) = zero; +L41d414: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L41d440; +ra = MEM_U32(sp + 44); +L41d420: +//nop; +a1 = s0; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41d434; +MEM_U32(sp + 16) = zero; +L41d434: +gp = MEM_U32(sp + 40); +//nop; +ra = MEM_U32(sp + 44); +L41d440: +s0 = MEM_U32(sp + 32); +s1 = MEM_U32(sp + 36); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void func_41d450(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41d450: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 40) = a2; +//nop; +a2 = a1; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 28) = ra; +a1 = MEM_U8(sp + 35); +MEM_U32(sp + 24) = gp; +a0 = 0x104; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41d48c; +a3 = zero; +L41d48c: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 35); +//nop; +a2 = MEM_U32(sp + 40); +a0 = 0x104; +a3 = zero; +a1 = a1 + 0x1; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41d4ac; +a1 = a1 + 0x1; +L41d4ac: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void func_41d4bc(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41d4bc: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41d4e8; +MEM_U32(sp + 48) = a2; +L41d4e8: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +MEM_U32(sp + 32) = v0; +a0 = 0x1a; +a3 = v0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41d508; +a3 = v0; +L41d508: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 48); +a0 = 0x103; +a3 = zero; +a1 = a1 + 0x1; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41d528; +a1 = a1 + 0x1; +L41d528: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41d540; +//nop; +L41d540: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41d550(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41d550: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41d57c; +MEM_U32(sp + 48) = a2; +L41d57c: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +MEM_U32(sp + 32) = v0; +a0 = 0xff; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41d59c; +a3 = zero; +L41d59c: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 32); +a0 = 0x11; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41d5b8; +a0 = 0x11; +L41d5b8: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 48); +a0 = 0x100; +a3 = zero; +a1 = a1 + 0x1; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41d5d8; +a1 = a1 + 0x1; +L41d5d8: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41d5f0; +//nop; +L41d5f0: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41d600(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41d600: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41d62c; +MEM_U32(sp + 48) = a2; +L41d62c: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +MEM_U32(sp + 32) = v0; +a0 = 0x100; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41d64c; +a3 = zero; +L41d64c: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 32); +a0 = 0x12; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41d668; +a0 = 0x12; +L41d668: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 48); +a0 = 0x18; +a3 = zero; +a1 = a1 + 0x1; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41d688; +a1 = a1 + 0x1; +L41d688: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41d6a0; +//nop; +L41d6a0: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41d6b0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41d6b0: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41d6dc; +MEM_U32(sp + 48) = a2; +L41d6dc: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +MEM_U32(sp + 32) = v0; +a0 = 0x17; +a3 = v0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41d6fc; +a3 = v0; +L41d6fc: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a0 = 0x104; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41d718; +a3 = zero; +L41d718: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 48); +a0 = 0x102; +a3 = zero; +a1 = a1 + 0x1; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41d738; +a1 = a1 + 0x1; +L41d738: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41d750; +//nop; +L41d750: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41d760(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L41d760: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +v0 = f_gen_label_id(mem, sp); +goto L41d78c; +MEM_U32(sp + 48) = a2; +L41d78c: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +MEM_U32(sp + 32) = v0; +a0 = 0x18; +a3 = v0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41d7ac; +a3 = v0; +L41d7ac: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 44); +a0 = 0x104; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41d7c8; +a3 = zero; +L41d7c8: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 43); +//nop; +a2 = MEM_U32(sp + 48); +a0 = 0x102; +a3 = zero; +a1 = a1 + 0x1; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41d7e8; +a1 = a1 + 0x1; +L41d7e8: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41d800; +//nop; +L41d800: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_emit_trap_ri(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41d810: +//emit_trap_ri: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +t6 = 0x10018ecc; +MEM_U32(sp + 28) = s1; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 24) = s0; +s0 = a1 & 0xff; +s1 = a3; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 52) = a1; +if (t6 != 0) {MEM_U32(sp + 56) = a2; +goto L41d9b4;} +MEM_U32(sp + 56) = a2; +t7 = MEM_U32(sp + 64); +at = 0x5010000; +t8 = MEM_U8(t7 + 33); +v0 = a0 & 0xffff; +t9 = t8 & 0x1f; +t0 = t9 < 0x20; +t1 = -t0; +t2 = t1 & at; +t3 = t2 << (t9 & 0x1f); +if ((int)t3 >= 0) {t4 = v0 + 0xffffff01; +goto L41d9b4;} +t4 = v0 + 0xffffff01; +at = t4 < 0x6; +if (at == 0) {a1 = s0; +goto L41d998;} +a1 = s0; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100082f8[] = { +&&L41d948, +&&L41d970, +&&L41d8f8, +&&L41d920, +&&L41d8d0, +&&L41d8a8, +}; +dest = Lswitch100082f8[t4]; +//nop; +goto *dest; +//nop; +L41d8a8: +//nop; +a1 = MEM_U32(sp + 56); +t9 = t9; +a0 = s0; +a2 = s1; +v0 = sp + 0x30; +func_41d450(mem, sp, a0, a1, a2); +goto L41d8c4; +v0 = sp + 0x30; +L41d8c4: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41d9d4; +ra = MEM_U32(sp + 36); +L41d8d0: +//nop; +a1 = MEM_U32(sp + 56); +t9 = t9; +a0 = s0; +a2 = s1; +v0 = sp + 0x30; +func_41d4bc(mem, sp, a0, a1, a2); +goto L41d8ec; +v0 = sp + 0x30; +L41d8ec: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41d9d4; +ra = MEM_U32(sp + 36); +L41d8f8: +//nop; +a1 = MEM_U32(sp + 56); +t9 = t9; +a0 = s0; +a2 = s1; +v0 = sp + 0x30; +func_41d6b0(mem, sp, a0, a1, a2); +goto L41d914; +v0 = sp + 0x30; +L41d914: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41d9d4; +ra = MEM_U32(sp + 36); +L41d920: +//nop; +a1 = MEM_U32(sp + 56); +t9 = t9; +a0 = s0; +a2 = s1; +v0 = sp + 0x30; +func_41d760(mem, sp, a0, a1, a2); +goto L41d93c; +v0 = sp + 0x30; +L41d93c: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41d9d4; +ra = MEM_U32(sp + 36); +L41d948: +//nop; +a1 = MEM_U32(sp + 56); +t9 = t9; +a0 = s0; +a2 = s1; +v0 = sp + 0x30; +func_41d550(mem, sp, a0, a1, a2); +goto L41d964; +v0 = sp + 0x30; +L41d964: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41d9d4; +ra = MEM_U32(sp + 36); +L41d970: +//nop; +a1 = MEM_U32(sp + 56); +t9 = t9; +a0 = s0; +a2 = s1; +v0 = sp + 0x30; +func_41d600(mem, sp, a0, a1, a2); +goto L41d98c; +v0 = sp + 0x30; +L41d98c: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41d9d4; +ra = MEM_U32(sp + 36); +L41d998: +//nop; +a2 = s1; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41d9a8; +a3 = zero; +L41d9a8: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41d9d4; +ra = MEM_U32(sp + 36); +L41d9b4: +//nop; +a1 = s0; +a2 = s1; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41d9c8; +a3 = zero; +L41d9c8: +gp = MEM_U32(sp + 32); +//nop; +ra = MEM_U32(sp + 36); +L41d9d4: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_41d9e4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41d9e4: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 28) = s1; +s1 = a1 & 0xff; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +if (s1 != a3) {MEM_U32(sp + 76) = a3; +goto L41da30;} +MEM_U32(sp + 76) = a3; +s3 = a3 & 0xff; +s2 = a2 & 0xff; +goto L41da38; +s2 = a2 & 0xff; +L41da30: +s3 = a2 & 0xff; +s2 = a3 & 0xff; +L41da38: +//nop; +a0 = 0x20; +a1 = 0x6; +f_emit_dir0(mem, sp, a0, a1); +goto L41da48; +a1 = 0x6; +L41da48: +gp = MEM_U32(sp + 40); +s0 = s1 + 0x1; +t6 = 0x10018e80; +a1 = s0; +t6 = MEM_U8(t6 + 0); +a0 = 0x2; +if (t6 == 0) {a2 = s3 + 0x1; +goto L41dae4;} +a2 = s3 + 0x1; +//nop; +a0 = 0x2; +a1 = s1; +a2 = s3; +a3 = s2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41da80; +a3 = s2; +L41da80: +gp = MEM_U32(sp + 40); +a0 = 0x51; +//nop; +a1 = 0x1; +a2 = s1; +a3 = s2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41da9c; +a3 = s2; +L41da9c: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +s0 = s1 + 0x1; +a1 = s0; +a2 = 0x1; +a3 = s3 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41dabc; +a3 = s3 + 0x1; +L41dabc: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a1 = s0; +a2 = s0; +a3 = s2 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41dad8; +a3 = s2 + 0x1; +L41dad8: +gp = MEM_U32(sp + 40); +//nop; +goto L41db50; +//nop; +L41dae4: +//nop; +a3 = s2 + 0x1; +MEM_U32(sp + 48) = a3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41daf4; +MEM_U32(sp + 48) = a3; +L41daf4: +gp = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 48); +//nop; +a0 = 0x51; +a1 = 0x1; +a2 = s0; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41db10; +a2 = s0; +L41db10: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a1 = s1; +a2 = 0x1; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41db2c; +a3 = s3; +L41db2c: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a1 = s1; +a2 = s1; +a3 = s2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41db48; +a3 = s2; +L41db48: +gp = MEM_U32(sp + 40); +//nop; +L41db50: +//nop; +a0 = 0x20; +a1 = 0x5; +f_emit_dir0(mem, sp, a0, a1); +goto L41db60; +a1 = 0x5; +L41db60: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_41db80(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41db80: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +//nop; +MEM_U32(sp + 20) = s0; +s0 = a1 & 0xff; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +s1 = a2 & 0xff; +s2 = a3 & 0xff; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 64) = a2; +MEM_U32(sp + 68) = a3; +a1 = 0x6; +a0 = 0x20; +f_emit_dir0(mem, sp, a0, a1); +goto L41dbd0; +a0 = 0x20; +L41dbd0: +gp = MEM_U32(sp + 32); +a0 = 0x51; +t6 = 0x10018e80; +a1 = 0x1; +t6 = MEM_U8(t6 + 0); +a2 = s1 + 0x1; +if (t6 == 0) {a3 = s2 + 0x1; +goto L41dc6c;} +a3 = s2 + 0x1; +//nop; +a0 = 0x51; +a1 = 0x1; +a2 = s1; +a3 = s2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41dc08; +a3 = s2; +L41dc08: +gp = MEM_U32(sp + 32); +a0 = 0x56; +//nop; +a1 = s0; +a2 = s1; +a3 = s2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41dc24; +a3 = s2; +L41dc24: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 58); +//nop; +a1 = s0 + 0x1; +MEM_U32(sp + 48) = a1; +a2 = s1 + 0x1; +a3 = s2 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41dc44; +a3 = s2 + 0x1; +L41dc44: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +//nop; +a0 = MEM_U16(sp + 58); +a3 = 0x1; +a2 = a1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41dc60; +a2 = a1; +L41dc60: +gp = MEM_U32(sp + 32); +//nop; +goto L41dcd8; +//nop; +L41dc6c: +//nop; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 44) = a3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41dc7c; +MEM_U32(sp + 44) = a3; +L41dc7c: +gp = MEM_U32(sp + 32); +a2 = MEM_U32(sp + 48); +//nop; +a3 = MEM_U32(sp + 44); +a0 = 0x56; +a1 = s0 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41dc98; +a1 = s0 + 0x1; +L41dc98: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 58); +//nop; +a1 = s0; +a2 = s1; +a3 = s2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41dcb4; +a3 = s2; +L41dcb4: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 58); +//nop; +a1 = s0; +a2 = s0; +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41dcd0; +a3 = 0x1; +L41dcd0: +gp = MEM_U32(sp + 32); +//nop; +L41dcd8: +//nop; +a0 = 0x20; +a1 = 0x5; +f_emit_dir0(mem, sp, a0, a1); +goto L41dce8; +a1 = 0x5; +L41dce8: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void func_41dd04(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +L41dd04: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb8; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 72) = a0; +MEM_U32(sp + 76) = a1; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 80) = a2; +MEM_U32(sp + 84) = a3; +MEM_U32(sp + 68) = v0; +a1 = 0x1; +a0 = zero; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L41dd40; +a0 = zero; +L41dd40: +gp = MEM_U32(sp + 32); +MEM_U8(sp + 67) = (uint8_t)v0; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L41dd58; +//nop; +L41dd58: +gp = MEM_U32(sp + 32); +a0 = zero; +//nop; +a1 = 0x1; +//nop; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L41dd70; +//nop; +L41dd70: +gp = MEM_U32(sp + 32); +MEM_U8(sp + 66) = (uint8_t)v0; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L41dd88; +//nop; +L41dd88: +gp = MEM_U32(sp + 32); +a0 = zero; +//nop; +a1 = 0x1; +//nop; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L41dda0; +//nop; +L41dda0: +gp = MEM_U32(sp + 32); +MEM_U8(sp + 65) = (uint8_t)v0; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L41ddb8; +//nop; +L41ddb8: +gp = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L41ddd0; +//nop; +L41ddd0: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 60) = v0; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L41dde8; +//nop; +L41dde8: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 56) = v0; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L41de00; +//nop; +L41de00: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 87); +//nop; +a1 = MEM_U8(sp + 67); +MEM_U32(sp + 52) = v0; +a0 = 0x4f; +a3 = 0x1a; +MEM_U32(sp + 16) = zero; +MEM_U8(sp + 51) = (uint8_t)a2; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41de28; +MEM_U8(sp + 51) = (uint8_t)a2; +L41de28: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 67); +//nop; +a2 = MEM_U32(sp + 60); +a0 = 0x10; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41de40; +a0 = 0x10; +L41de40: +gp = MEM_U32(sp + 32); +t8 = MEM_U32(sp + 68); +t6 = 0x10018e80; +a0 = 0x4f; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41df94;} +//nop; +a1 = MEM_U8(sp + 79); +//nop; +a2 = MEM_U8(sp + 83); +a3 = MEM_U8(sp + 87); +a1 = a1 + 0x1; +MEM_U32(sp + 44) = a1; +a0 = 0x4f; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41de80; +a0 = 0x4f; +L41de80: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 79); +//nop; +a0 = 0x29; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41de9c; +a3 = zero; +L41de9c: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 52); +//nop; +a0 = 0x4; +//nop; +f_emit_ll(mem, sp, a0, a1); +goto L41deb4; +//nop; +L41deb4: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 60); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41decc; +//nop; +L41decc: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 83); +//nop; +a1 = MEM_U32(sp + 44); +a3 = MEM_U8(sp + 87); +a0 = 0x4f; +a2 = a2 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41deec; +a2 = a2 + 0x1; +L41deec: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 67); +//nop; +a2 = MEM_U32(sp + 56); +a0 = 0xdc; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41df04; +a0 = 0xdc; +L41df04: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 66); +//nop; +a2 = MEM_U8(sp + 87); +a0 = 0xdb; +f_emit_rr(mem, sp, a0, a1, a2); +goto L41df1c; +a0 = 0xdb; +L41df1c: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 65); +//nop; +a2 = MEM_U8(sp + 83); +a3 = MEM_U8(sp + 66); +a0 = 0x54; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41df38; +a0 = 0x54; +L41df38: +gp = MEM_U32(sp + 32); +a2 = MEM_U32(sp + 44); +//nop; +a3 = MEM_U8(sp + 65); +a0 = 0x40; +a1 = a2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41df54; +a1 = a2; +L41df54: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 56); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41df6c; +//nop; +L41df6c: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 79); +//nop; +a2 = MEM_U8(sp + 83); +a3 = MEM_U8(sp + 87); +a0 = 0x4f; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41df88; +a0 = 0x4f; +L41df88: +gp = MEM_U32(sp + 32); +//nop; +goto L41e108; +//nop; +L41df94: +t9 = MEM_U32(t8 + 16); +at = 0x5010000; +t0 = MEM_U32(t9 + 4); +//nop; +t1 = MEM_U8(t0 + 33); +//nop; +t2 = t1 & 0x1f; +t3 = t2 < 0x20; +t4 = -t3; +t5 = t4 & at; +t6 = t5 << (t2 & 0x1f); +if ((int)t6 >= 0) {a2 = MEM_U8(sp + 83); +goto L41dfdc;} +a2 = MEM_U8(sp + 83); +t7 = MEM_U8(sp + 87); +//nop; +t8 = t7 + 0x1; +MEM_U8(sp + 51) = (uint8_t)t8; +a2 = MEM_U8(sp + 83); +L41dfdc: +//nop; +a1 = MEM_U8(sp + 79); +a3 = MEM_U8(sp + 51); +a2 = a2 + 0x1; +MEM_U32(sp + 40) = a2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41dff4; +MEM_U32(sp + 40) = a2; +L41dff4: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 79); +//nop; +a1 = a1 + 0x1; +MEM_U32(sp + 44) = a1; +a0 = 0x29; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41e018; +a3 = zero; +L41e018: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 52); +//nop; +a0 = 0x4; +//nop; +f_emit_ll(mem, sp, a0, a1); +goto L41e030; +//nop; +L41e030: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 60); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41e048; +//nop; +L41e048: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 79); +//nop; +a2 = MEM_U8(sp + 83); +a3 = MEM_U8(sp + 51); +a0 = 0x4f; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e064; +a0 = 0x4f; +L41e064: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 67); +//nop; +a2 = MEM_U32(sp + 56); +a0 = 0xdc; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41e07c; +a0 = 0xdc; +L41e07c: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 66); +//nop; +a2 = MEM_U8(sp + 51); +a0 = 0xdb; +f_emit_rr(mem, sp, a0, a1, a2); +goto L41e094; +a0 = 0xdb; +L41e094: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 65); +//nop; +a2 = MEM_U32(sp + 40); +a3 = MEM_U8(sp + 66); +a0 = 0x54; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e0b0; +a0 = 0x54; +L41e0b0: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 79); +//nop; +a3 = MEM_U8(sp + 65); +a0 = 0x40; +a1 = a2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e0cc; +a1 = a2; +L41e0cc: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 56); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41e0e4; +//nop; +L41e0e4: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 44); +//nop; +a2 = MEM_U32(sp + 40); +a3 = MEM_U8(sp + 51); +a0 = 0x4f; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e100; +a0 = 0x4f; +L41e100: +gp = MEM_U32(sp + 32); +//nop; +L41e108: +//nop; +a0 = MEM_U32(sp + 52); +//nop; +f_define_label(mem, sp, a0); +goto L41e118; +//nop; +L41e118: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x48; +return; +sp = sp + 0x48; +} + +static void func_41e128(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +L41e128: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb8; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 72) = a0; +MEM_U32(sp + 76) = a1; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 80) = a2; +MEM_U32(sp + 84) = a3; +MEM_U32(sp + 68) = v0; +a1 = 0x1; +a0 = zero; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L41e164; +a0 = zero; +L41e164: +gp = MEM_U32(sp + 32); +MEM_U8(sp + 67) = (uint8_t)v0; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L41e17c; +//nop; +L41e17c: +gp = MEM_U32(sp + 32); +a0 = zero; +//nop; +a1 = 0x1; +//nop; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L41e194; +//nop; +L41e194: +gp = MEM_U32(sp + 32); +MEM_U8(sp + 66) = (uint8_t)v0; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L41e1ac; +//nop; +L41e1ac: +gp = MEM_U32(sp + 32); +a0 = zero; +//nop; +a1 = 0x1; +//nop; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L41e1c4; +//nop; +L41e1c4: +gp = MEM_U32(sp + 32); +MEM_U8(sp + 65) = (uint8_t)v0; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L41e1dc; +//nop; +L41e1dc: +gp = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L41e1f4; +//nop; +L41e1f4: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 60) = v0; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L41e20c; +//nop; +L41e20c: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 56) = v0; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L41e224; +//nop; +L41e224: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 87); +//nop; +a1 = MEM_U8(sp + 67); +MEM_U32(sp + 52) = v0; +a0 = 0x4f; +a3 = 0x1a; +MEM_U32(sp + 16) = zero; +MEM_U8(sp + 51) = (uint8_t)a2; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41e24c; +MEM_U8(sp + 51) = (uint8_t)a2; +L41e24c: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 67); +//nop; +a2 = MEM_U32(sp + 60); +a0 = 0x10; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41e264; +a0 = 0x10; +L41e264: +gp = MEM_U32(sp + 32); +t8 = MEM_U32(sp + 68); +t6 = 0x10018e80; +//nop; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L41e3fc;} +//nop; +a2 = MEM_U8(sp + 83); +//nop; +a0 = MEM_U16(sp + 74); +a1 = MEM_U8(sp + 79); +a3 = MEM_U8(sp + 87); +a2 = a2 + 0x1; +MEM_U32(sp + 44) = a2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e2a4; +MEM_U32(sp + 44) = a2; +L41e2a4: +t7 = MEM_U16(sp + 74); +gp = MEM_U32(sp + 32); +at = 0x53; +if (t7 != at) {a0 = 0x29; +goto L41e2e8;} +a0 = 0x29; +a1 = MEM_U8(sp + 79); +//nop; +a2 = MEM_U32(sp + 44); +a1 = a1 + 0x1; +MEM_U32(sp + 40) = a1; +a0 = 0x53; +a3 = 0x1f; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41e2dc; +MEM_U32(sp + 16) = zero; +L41e2dc: +gp = MEM_U32(sp + 32); +//nop; +goto L41e30c; +//nop; +L41e2e8: +a1 = MEM_U8(sp + 79); +//nop; +a1 = a1 + 0x1; +MEM_U32(sp + 40) = a1; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41e304; +a3 = zero; +L41e304: +gp = MEM_U32(sp + 32); +//nop; +L41e30c: +//nop; +a1 = MEM_U32(sp + 52); +a0 = 0x4; +f_emit_ll(mem, sp, a0, a1); +goto L41e31c; +a0 = 0x4; +L41e31c: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 60); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41e334; +//nop; +L41e334: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 79); +//nop; +a2 = MEM_U8(sp + 83); +a3 = MEM_U8(sp + 87); +a0 = 0x54; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e350; +a0 = 0x54; +L41e350: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 67); +//nop; +a2 = MEM_U32(sp + 56); +a0 = 0xdc; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41e368; +a0 = 0xdc; +L41e368: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 66); +//nop; +a2 = MEM_U8(sp + 87); +a0 = 0xdb; +f_emit_rr(mem, sp, a0, a1, a2); +goto L41e380; +a0 = 0xdb; +L41e380: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 65); +//nop; +a2 = MEM_U32(sp + 44); +a3 = MEM_U8(sp + 66); +a0 = 0x4f; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e39c; +a0 = 0x4f; +L41e39c: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 79); +//nop; +a3 = MEM_U8(sp + 65); +a0 = 0x40; +a2 = a1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e3b8; +a2 = a1; +L41e3b8: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 56); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41e3d0; +//nop; +L41e3d0: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 74); +//nop; +a1 = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 44); +a3 = MEM_U8(sp + 87); +//nop; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e3f0; +//nop; +L41e3f0: +gp = MEM_U32(sp + 32); +//nop; +goto L41e5a8; +//nop; +L41e3fc: +t9 = MEM_U32(t8 + 16); +at = 0x5010000; +t0 = MEM_U32(t9 + 4); +//nop; +t1 = MEM_U8(t0 + 33); +//nop; +t2 = t1 & 0x1f; +t3 = t2 < 0x20; +t4 = -t3; +t5 = t4 & at; +t6 = t5 << (t2 & 0x1f); +if ((int)t6 >= 0) {a1 = MEM_U8(sp + 79); +goto L41e444;} +a1 = MEM_U8(sp + 79); +t7 = MEM_U8(sp + 87); +//nop; +t8 = t7 + 0x1; +MEM_U8(sp + 51) = (uint8_t)t8; +a1 = MEM_U8(sp + 79); +L41e444: +//nop; +a0 = MEM_U16(sp + 74); +a2 = MEM_U8(sp + 83); +a3 = MEM_U8(sp + 51); +a1 = a1 + 0x1; +MEM_U32(sp + 40) = a1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e460; +MEM_U32(sp + 40) = a1; +L41e460: +t9 = MEM_U16(sp + 74); +gp = MEM_U32(sp + 32); +at = 0x53; +if (t9 != at) {a0 = 0x29; +goto L41e49c;} +a0 = 0x29; +//nop; +a1 = MEM_U8(sp + 79); +a2 = MEM_U8(sp + 83); +a0 = 0x53; +a3 = 0x1f; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41e490; +MEM_U32(sp + 16) = zero; +L41e490: +gp = MEM_U32(sp + 32); +//nop; +goto L41e4b8; +//nop; +L41e49c: +//nop; +a1 = MEM_U8(sp + 79); +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41e4b0; +a3 = zero; +L41e4b0: +gp = MEM_U32(sp + 32); +//nop; +L41e4b8: +//nop; +a1 = MEM_U32(sp + 52); +a0 = 0x4; +f_emit_ll(mem, sp, a0, a1); +goto L41e4c8; +a0 = 0x4; +L41e4c8: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 60); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41e4e0; +//nop; +L41e4e0: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 83); +//nop; +a1 = MEM_U32(sp + 40); +a3 = MEM_U8(sp + 51); +a0 = 0x54; +a2 = a2 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e500; +a2 = a2 + 0x1; +L41e500: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 67); +//nop; +a2 = MEM_U32(sp + 56); +a0 = 0xdc; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41e518; +a0 = 0xdc; +L41e518: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 66); +//nop; +a2 = MEM_U8(sp + 51); +a0 = 0xdb; +f_emit_rr(mem, sp, a0, a1, a2); +goto L41e530; +a0 = 0xdb; +L41e530: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 65); +//nop; +a2 = MEM_U8(sp + 83); +a3 = MEM_U8(sp + 66); +a0 = 0x4f; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e54c; +a0 = 0x4f; +L41e54c: +gp = MEM_U32(sp + 32); +a2 = MEM_U32(sp + 40); +//nop; +a3 = MEM_U8(sp + 65); +a0 = 0x40; +a1 = a2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e568; +a1 = a2; +L41e568: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 56); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41e580; +//nop; +L41e580: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 74); +//nop; +a1 = MEM_U8(sp + 79); +a2 = MEM_U8(sp + 83); +a3 = MEM_U8(sp + 51); +//nop; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e5a0; +//nop; +L41e5a0: +gp = MEM_U32(sp + 32); +//nop; +L41e5a8: +//nop; +a0 = MEM_U32(sp + 52); +//nop; +f_define_label(mem, sp, a0); +goto L41e5b8; +//nop; +L41e5b8: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x48; +return; +sp = sp + 0x48; +} + +static void func_41e5c8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41e5c8: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = s0; +s0 = a1 & 0xff; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +a1 = 0x6; +a0 = 0x20; +f_emit_dir0(mem, sp, a0, a1); +goto L41e608; +a0 = 0x20; +L41e608: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 51); +//nop; +a3 = MEM_U8(sp + 55); +a0 = 0x59; +a1 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e624; +a1 = 0x1; +L41e624: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 51); +a3 = MEM_U8(sp + 55); +//nop; +a0 = 0x59; +a1 = s0; +a2 = a2 + 0x1; +a3 = a3 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e648; +a3 = a3 + 0x1; +L41e648: +t6 = MEM_U16(sp + 42); +gp = MEM_U32(sp + 32); +at = 0x47; +if (t6 != at) {a0 = 0x40; +goto L41e6a0;} +a0 = 0x40; +//nop; +a0 = 0x40; +a1 = s0; +a2 = s0; +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e674; +a3 = 0x1; +L41e674: +gp = MEM_U32(sp + 32); +a0 = 0xd6; +//nop; +a1 = s0; +a2 = s0; +a3 = 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41e694; +MEM_U32(sp + 16) = zero; +L41e694: +gp = MEM_U32(sp + 32); +//nop; +goto L41e6d8; +//nop; +L41e6a0: +//nop; +a1 = s0; +a2 = s0; +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e6b4; +a3 = 0x1; +L41e6b4: +gp = MEM_U32(sp + 32); +a0 = 0x51; +//nop; +a1 = s0; +a2 = zero; +a3 = s0; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e6d0; +a3 = s0; +L41e6d0: +gp = MEM_U32(sp + 32); +//nop; +L41e6d8: +//nop; +a0 = 0x20; +a1 = 0x5; +f_emit_dir0(mem, sp, a0, a1); +goto L41e6e8; +a1 = 0x5; +L41e6e8: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41e6fc(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41e6fc: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +s1 = a1 & 0xff; +s2 = a2 & 0xff; +s3 = a3 & 0xff; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +MEM_U32(sp + 76) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41e748; +MEM_U32(sp + 76) = a3; +L41e748: +gp = MEM_U32(sp + 40); +s0 = v0; +t6 = 0x10018e80; +a2 = s2 + 0x1; +t6 = MEM_U8(t6 + 0); +a0 = 0x4b; +if (t6 == 0) {a1 = s1; +goto L41e7e0;} +a1 = s1; +//nop; +a3 = s3 + 0x1; +MEM_U32(sp + 48) = a3; +a0 = 0x4b; +a1 = s1; +MEM_U32(sp + 52) = a2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e784; +MEM_U32(sp + 52) = a2; +L41e784: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41e79c; +a2 = s0; +L41e79c: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 52); +//nop; +a2 = MEM_U32(sp + 48); +a0 = 0x18; +a3 = s0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41e7b8; +a3 = s0; +L41e7b8: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a1 = s1; +a2 = s2; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e7d4; +a3 = s3; +L41e7d4: +gp = MEM_U32(sp + 40); +//nop; +goto L41e848; +//nop; +L41e7e0: +//nop; +a2 = s2; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e7f0; +a3 = s3; +L41e7f0: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41e808; +a2 = s0; +L41e808: +gp = MEM_U32(sp + 40); +a0 = 0x18; +//nop; +a1 = s2; +a2 = s3; +a3 = s0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41e824; +a3 = s0; +L41e824: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a1 = s1; +a2 = s2 + 0x1; +a3 = s3 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e840; +a3 = s3 + 0x1; +L41e840: +gp = MEM_U32(sp + 40); +//nop; +L41e848: +//nop; +a0 = s0; +//nop; +f_define_label(mem, sp, a0); +goto L41e858; +//nop; +L41e858: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_41e878(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41e878: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +s1 = a1 & 0xff; +s2 = a2 & 0xff; +s3 = a3 & 0xff; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +MEM_U32(sp + 76) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41e8c4; +MEM_U32(sp + 76) = a3; +L41e8c4: +gp = MEM_U32(sp + 40); +s0 = v0; +t6 = 0x10018e80; +a2 = s2 + 0x1; +t6 = MEM_U8(t6 + 0); +a0 = 0x4a; +if (t6 == 0) {a1 = s1; +goto L41e95c;} +a1 = s1; +//nop; +a3 = s3 + 0x1; +MEM_U32(sp + 48) = a3; +a0 = 0x4a; +a1 = s1; +MEM_U32(sp + 52) = a2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e900; +MEM_U32(sp + 52) = a2; +L41e900: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41e918; +a2 = s0; +L41e918: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 52); +//nop; +a2 = MEM_U32(sp + 48); +a0 = 0x17; +a3 = s0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41e934; +a3 = s0; +L41e934: +gp = MEM_U32(sp + 40); +a0 = 0x49; +//nop; +a1 = s1; +a2 = s2; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e950; +a3 = s3; +L41e950: +gp = MEM_U32(sp + 40); +//nop; +goto L41e9c4; +//nop; +L41e95c: +//nop; +a2 = s2; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e96c; +a3 = s3; +L41e96c: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41e984; +a2 = s0; +L41e984: +gp = MEM_U32(sp + 40); +a0 = 0x17; +//nop; +a1 = s2; +a2 = s3; +a3 = s0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41e9a0; +a3 = s0; +L41e9a0: +gp = MEM_U32(sp + 40); +a0 = 0x49; +//nop; +a1 = s1; +a2 = s2 + 0x1; +a3 = s3 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41e9bc; +a3 = s3 + 0x1; +L41e9bc: +gp = MEM_U32(sp + 40); +//nop; +L41e9c4: +//nop; +a0 = s0; +//nop; +f_define_label(mem, sp, a0); +goto L41e9d4; +//nop; +L41e9d4: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_41e9f4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41e9f4: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +s1 = a1 & 0xff; +s2 = a2 & 0xff; +s3 = a3 & 0xff; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +MEM_U32(sp + 76) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41ea40; +MEM_U32(sp + 76) = a3; +L41ea40: +gp = MEM_U32(sp + 40); +s0 = v0; +t6 = 0x10018e80; +a2 = s2 + 0x1; +t6 = MEM_U8(t6 + 0); +a0 = 0x4a; +if (t6 == 0) {a1 = s1; +goto L41ead8;} +a1 = s1; +//nop; +a3 = s3 + 0x1; +MEM_U32(sp + 48) = a3; +a0 = 0x4a; +a1 = s1; +MEM_U32(sp + 52) = a2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41ea7c; +MEM_U32(sp + 52) = a2; +L41ea7c: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41ea94; +a2 = s0; +L41ea94: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 52); +//nop; +a2 = MEM_U32(sp + 48); +a0 = 0x17; +a3 = s0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41eab0; +a3 = s0; +L41eab0: +gp = MEM_U32(sp + 40); +a0 = 0x4b; +//nop; +a1 = s1; +a2 = s2; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41eacc; +a3 = s3; +L41eacc: +gp = MEM_U32(sp + 40); +//nop; +goto L41eb40; +//nop; +L41ead8: +//nop; +a2 = s2; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41eae8; +a3 = s3; +L41eae8: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41eb00; +a2 = s0; +L41eb00: +gp = MEM_U32(sp + 40); +a0 = 0x17; +//nop; +a1 = s2; +a2 = s3; +a3 = s0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41eb1c; +a3 = s0; +L41eb1c: +gp = MEM_U32(sp + 40); +a0 = 0x4b; +//nop; +a1 = s1; +a2 = s2 + 0x1; +a3 = s3 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41eb38; +a3 = s3 + 0x1; +L41eb38: +gp = MEM_U32(sp + 40); +//nop; +L41eb40: +//nop; +a0 = s0; +//nop; +f_define_label(mem, sp, a0); +goto L41eb50; +//nop; +L41eb50: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_41eb70(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41eb70: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +s1 = a1 & 0xff; +s2 = a2 & 0xff; +s3 = a3 & 0xff; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +MEM_U32(sp + 76) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41ebbc; +MEM_U32(sp + 76) = a3; +L41ebbc: +gp = MEM_U32(sp + 40); +s0 = v0; +t6 = 0x10018e80; +a2 = s2 + 0x1; +t6 = MEM_U8(t6 + 0); +a0 = 0x51; +if (t6 == 0) {a1 = s1; +goto L41ec54;} +a1 = s1; +//nop; +a3 = s3 + 0x1; +MEM_U32(sp + 48) = a3; +a0 = 0x51; +a1 = s1; +MEM_U32(sp + 52) = a2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41ebf8; +MEM_U32(sp + 52) = a2; +L41ebf8: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41ec10; +a2 = s0; +L41ec10: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 52); +//nop; +a2 = MEM_U32(sp + 48); +a0 = 0x12; +a3 = s0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41ec2c; +a3 = s0; +L41ec2c: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a1 = s1; +a2 = s2; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41ec48; +a3 = s3; +L41ec48: +gp = MEM_U32(sp + 40); +//nop; +goto L41ecbc; +//nop; +L41ec54: +//nop; +a2 = s2; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41ec64; +a3 = s3; +L41ec64: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41ec7c; +a2 = s0; +L41ec7c: +gp = MEM_U32(sp + 40); +a0 = 0x12; +//nop; +a1 = s2; +a2 = s3; +a3 = s0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41ec98; +a3 = s0; +L41ec98: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a1 = s1; +a2 = s2 + 0x1; +a3 = s3 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41ecb4; +a3 = s3 + 0x1; +L41ecb4: +gp = MEM_U32(sp + 40); +//nop; +L41ecbc: +//nop; +a0 = s0; +//nop; +f_define_label(mem, sp, a0); +goto L41eccc; +//nop; +L41eccc: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_41ecec(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41ecec: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +s1 = a1 & 0xff; +s2 = a2 & 0xff; +s3 = a3 & 0xff; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +MEM_U32(sp + 76) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41ed38; +MEM_U32(sp + 76) = a3; +L41ed38: +gp = MEM_U32(sp + 40); +s0 = v0; +t6 = 0x10018e80; +a2 = s2 + 0x1; +t6 = MEM_U8(t6 + 0); +a0 = 0x50; +if (t6 == 0) {a1 = s1; +goto L41edd0;} +a1 = s1; +//nop; +a3 = s3 + 0x1; +MEM_U32(sp + 48) = a3; +a0 = 0x50; +a1 = s1; +MEM_U32(sp + 52) = a2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41ed74; +MEM_U32(sp + 52) = a2; +L41ed74: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41ed8c; +a2 = s0; +L41ed8c: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 52); +//nop; +a2 = MEM_U32(sp + 48); +a0 = 0x11; +a3 = s0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41eda8; +a3 = s0; +L41eda8: +gp = MEM_U32(sp + 40); +a0 = 0x51; +//nop; +a1 = s1; +a2 = s2; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41edc4; +a3 = s3; +L41edc4: +gp = MEM_U32(sp + 40); +//nop; +goto L41ee38; +//nop; +L41edd0: +//nop; +a2 = s2; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41ede0; +a3 = s3; +L41ede0: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41edf8; +a2 = s0; +L41edf8: +gp = MEM_U32(sp + 40); +a0 = 0x11; +//nop; +a1 = s2; +a2 = s3; +a3 = s0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41ee14; +a3 = s0; +L41ee14: +gp = MEM_U32(sp + 40); +a0 = 0x51; +//nop; +a1 = s1; +a2 = s2 + 0x1; +a3 = s3 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41ee30; +a3 = s3 + 0x1; +L41ee30: +gp = MEM_U32(sp + 40); +//nop; +L41ee38: +//nop; +a0 = s0; +//nop; +f_define_label(mem, sp, a0); +goto L41ee48; +//nop; +L41ee48: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_41ee68(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41ee68: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +s1 = a1 & 0xff; +s2 = a2 & 0xff; +s3 = a3 & 0xff; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +MEM_U32(sp + 76) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41eeb4; +MEM_U32(sp + 76) = a3; +L41eeb4: +gp = MEM_U32(sp + 40); +s0 = v0; +t6 = 0x10018e80; +a2 = s2 + 0x1; +t6 = MEM_U8(t6 + 0); +a0 = 0x50; +if (t6 == 0) {a1 = s1; +goto L41ef4c;} +a1 = s1; +//nop; +a3 = s3 + 0x1; +MEM_U32(sp + 48) = a3; +a0 = 0x50; +a1 = s1; +MEM_U32(sp + 52) = a2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41eef0; +MEM_U32(sp + 52) = a2; +L41eef0: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41ef08; +a2 = s0; +L41ef08: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 52); +//nop; +a2 = MEM_U32(sp + 48); +a0 = 0x11; +a3 = s0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41ef24; +a3 = s0; +L41ef24: +gp = MEM_U32(sp + 40); +a0 = 0x4e; +//nop; +a1 = s1; +a2 = s2; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41ef40; +a3 = s3; +L41ef40: +gp = MEM_U32(sp + 40); +//nop; +goto L41efb4; +//nop; +L41ef4c: +//nop; +a2 = s2; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41ef5c; +a3 = s3; +L41ef5c: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41ef74; +a2 = s0; +L41ef74: +gp = MEM_U32(sp + 40); +a0 = 0x11; +//nop; +a1 = s2; +a2 = s3; +a3 = s0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L41ef90; +a3 = s0; +L41ef90: +gp = MEM_U32(sp + 40); +a0 = 0x4e; +//nop; +a1 = s1; +a2 = s2 + 0x1; +a3 = s3 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41efac; +a3 = s3 + 0x1; +L41efac: +gp = MEM_U32(sp + 40); +//nop; +L41efb4: +//nop; +a0 = s0; +//nop; +f_define_label(mem, sp, a0); +goto L41efc4; +//nop; +L41efc4: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void f_dw_emit_rrr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41efe4: +//dw_emit_rrr: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +t6 = 0x10018ecc; +MEM_U32(sp + 28) = s2; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +s0 = a1 & 0xff; +s1 = a2 & 0xff; +s2 = a3 & 0xff; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 52) = a1; +MEM_U32(sp + 56) = a2; +if (t6 != 0) {MEM_U32(sp + 60) = a3; +goto L41f32c;} +MEM_U32(sp + 60) = a3; +t7 = MEM_U32(sp + 64); +at = 0x5010000; +t8 = MEM_U8(t7 + 33); +//nop; +t9 = t8 & 0x1f; +t0 = t9 < 0x20; +t1 = -t0; +t2 = t1 & at; +t3 = t2 << (t9 & 0x1f); +if ((int)t3 >= 0) {at = a0 < 0x41; +goto L41f32c;} +at = a0 < 0x41; +if (at != 0) {at = a0 < 0x5a; +goto L41f2b4;} +at = a0 < 0x5a; +if (at != 0) {t6 = a0 + 0xffffffb9; +goto L41f300;} +t6 = a0 + 0xffffffb9; +t4 = a0 + 0xffffff12; +at = t4 < 0x2; +if (at == 0) {//nop; +goto L41f294;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10008368[] = { +&&L41f0dc, +&&L41f104, +}; +dest = Lswitch10008368[t4]; +//nop; +goto *dest; +//nop; +L41f09c: +//nop; +a1 = s0; +a2 = s1; +a3 = s2; +MEM_U16(sp + 50) = (uint16_t)a0; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41f0b4; +MEM_U16(sp + 50) = (uint16_t)a0; +L41f0b4: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 50); +//nop; +a1 = s0 + 0x1; +a2 = s1 + 0x1; +a3 = s2 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41f0d0; +a3 = s2 + 0x1; +L41f0d0: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f34c; +ra = MEM_U32(sp + 36); +L41f0dc: +//nop; +a1 = s0; +t9 = t9; +a2 = s1; +a3 = s2; +v0 = sp + 0x30; +func_41d9e4(mem, sp, a0, a1, a2, a3); +goto L41f0f8; +v0 = sp + 0x30; +L41f0f8: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f34c; +ra = MEM_U32(sp + 36); +L41f104: +//nop; +a1 = s0; +t9 = t9; +a2 = s1; +a3 = s2; +v0 = sp + 0x30; +func_41db80(mem, sp, a0, a1, a2, a3); +goto L41f120; +v0 = sp + 0x30; +L41f120: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f34c; +ra = MEM_U32(sp + 36); +L41f12c: +//nop; +a1 = s0; +t9 = t9; +a2 = s1; +a3 = s2; +v0 = sp + 0x30; +func_41dd04(mem, sp, v0, a0, a1, a2, a3); +goto L41f148; +v0 = sp + 0x30; +L41f148: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f34c; +ra = MEM_U32(sp + 36); +L41f154: +//nop; +a1 = s0; +t9 = t9; +a2 = s1; +a3 = s2; +v0 = sp + 0x30; +func_41e128(mem, sp, v0, a0, a1, a2, a3); +goto L41f170; +v0 = sp + 0x30; +L41f170: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f34c; +ra = MEM_U32(sp + 36); +L41f17c: +//nop; +a1 = s0; +t9 = t9; +a2 = s1; +a3 = s2; +v0 = sp + 0x30; +func_41e5c8(mem, sp, a0, a1, a2, a3); +goto L41f198; +v0 = sp + 0x30; +L41f198: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f34c; +ra = MEM_U32(sp + 36); +L41f1a4: +//nop; +a1 = s0; +t9 = t9; +a2 = s1; +a3 = s2; +v0 = sp + 0x30; +func_41e6fc(mem, sp, a0, a1, a2, a3); +goto L41f1c0; +v0 = sp + 0x30; +L41f1c0: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f34c; +ra = MEM_U32(sp + 36); +L41f1cc: +//nop; +a1 = s0; +t9 = t9; +a2 = s1; +a3 = s2; +v0 = sp + 0x30; +func_41e878(mem, sp, a0, a1, a2, a3); +goto L41f1e8; +v0 = sp + 0x30; +L41f1e8: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f34c; +ra = MEM_U32(sp + 36); +L41f1f4: +//nop; +a1 = s0; +t9 = t9; +a2 = s1; +a3 = s2; +v0 = sp + 0x30; +func_41e9f4(mem, sp, a0, a1, a2, a3); +goto L41f210; +v0 = sp + 0x30; +L41f210: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f34c; +ra = MEM_U32(sp + 36); +L41f21c: +//nop; +a1 = s0; +t9 = t9; +a2 = s1; +a3 = s2; +v0 = sp + 0x30; +func_41eb70(mem, sp, a0, a1, a2, a3); +goto L41f238; +v0 = sp + 0x30; +L41f238: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f34c; +ra = MEM_U32(sp + 36); +L41f244: +//nop; +a1 = s0; +t9 = t9; +a2 = s1; +a3 = s2; +v0 = sp + 0x30; +func_41ee68(mem, sp, a0, a1, a2, a3); +goto L41f260; +v0 = sp + 0x30; +L41f260: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f34c; +ra = MEM_U32(sp + 36); +L41f26c: +//nop; +a1 = s0; +t9 = t9; +a2 = s1; +a3 = s2; +v0 = sp + 0x30; +func_41ecec(mem, sp, a0, a1, a2, a3); +goto L41f288; +v0 = sp + 0x30; +L41f288: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f34c; +ra = MEM_U32(sp + 36); +L41f294: +//nop; +a1 = s0; +a2 = s1; +a3 = s2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41f2a8; +a3 = s2; +L41f2a8: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f34c; +ra = MEM_U32(sp + 36); +L41f2b4: +at = a0 < 0x4; +if (at == 0) {t5 = a0 + 0xffffffff; +goto L41f2ec;} +t5 = a0 + 0xffffffff; +at = t5 < 0x3; +if (at == 0) {//nop; +goto L41f294;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10008310[] = { +&&L41f0dc, +&&L41f0dc, +&&L41f09c, +}; +dest = Lswitch10008310[t5]; +//nop; +goto *dest; +//nop; +L41f2ec: +at = a0 < 0x3f; +if (at == 0) {//nop; +goto L41f09c;} +//nop; +//nop; +goto L41f294; +//nop; +L41f300: +at = t6 < 0x13; +if (at == 0) {//nop; +goto L41f294;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000831c[] = { +&&L41f17c, +&&L41f1cc, +&&L41f1a4, +&&L41f1f4, +&&L41f1a4, +&&L41f294, +&&L41f244, +&&L41f21c, +&&L41f12c, +&&L41f26c, +&&L41f21c, +&&L41f17c, +&&L41f154, +&&L41f154, +&&L41f104, +&&L41f104, +&&L41f294, +&&L41f294, +&&L41f09c, +}; +dest = Lswitch1000831c[t6]; +//nop; +goto *dest; +//nop; +L41f32c: +//nop; +a1 = s0; +a2 = s1; +a3 = s2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41f340; +a3 = s2; +L41f340: +gp = MEM_U32(sp + 32); +//nop; +ra = MEM_U32(sp + 36); +L41f34c: +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_41f360(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41f360: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +t6 = 0x10018e80; +MEM_U32(sp + 36) = ra; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 52) = a1; +MEM_U32(sp + 56) = a2; +if (t6 == 0) {MEM_U32(sp + 60) = a3; +goto L41f3b4;} +MEM_U32(sp + 60) = a3; +t7 = a1 + 0x1; +t8 = a2 + 0x1; +MEM_U8(sp + 43) = (uint8_t)t7; +s0 = a1 & 0xff; +MEM_U8(sp + 41) = (uint8_t)t8; +MEM_U8(sp + 40) = (uint8_t)a2; +goto L41f3d0; +MEM_U8(sp + 40) = (uint8_t)a2; +L41f3b4: +s0 = a1 + 0x1; +t9 = s0 & 0xff; +t0 = a2 + 0x1; +MEM_U8(sp + 43) = (uint8_t)a1; +s0 = t9; +MEM_U8(sp + 41) = (uint8_t)a2; +MEM_U8(sp + 40) = (uint8_t)t0; +L41f3d0: +t1 = MEM_U32(sp + 60); +a3 = MEM_U32(sp + 64); +if (t1 != 0) {at = 0x8000; +goto L41f480;} +at = 0x8000; +at = (int)a3 < (int)at; +if (at == 0) {at = (int)a3 < (int)0xffff8000; +goto L41f480;} +at = (int)a3 < (int)0xffff8000; +if (at != 0) {a0 = 0x2; +goto L41f480;} +a0 = 0x2; +//nop; +a2 = MEM_U8(sp + 40); +a1 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41f408; +MEM_U32(sp + 16) = zero; +L41f408: +gp = MEM_U32(sp + 32); +a0 = 0x20; +//nop; +a1 = 0x6; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L41f420; +//nop; +L41f420: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0x51; +a1 = 0x1; +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41f440; +MEM_U32(sp + 16) = zero; +L41f440: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 50); +//nop; +a1 = MEM_U8(sp + 43); +a2 = MEM_U8(sp + 41); +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41f45c; +a3 = 0x1; +L41f45c: +gp = MEM_U32(sp + 32); +a0 = 0x20; +//nop; +a1 = 0x5; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L41f474; +//nop; +L41f474: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f540; +ra = MEM_U32(sp + 36); +L41f480: +//nop; +a0 = 0x20; +a1 = 0x6; +f_emit_dir0(mem, sp, a0, a1); +goto L41f490; +a1 = 0x6; +L41f490: +gp = MEM_U32(sp + 32); +a2 = MEM_U32(sp + 64); +//nop; +a0 = 0x29; +a1 = 0x1; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41f4ac; +a3 = zero; +L41f4ac: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 40); +//nop; +a0 = 0x2; +a1 = s0; +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41f4c8; +a3 = 0x1; +L41f4c8: +gp = MEM_U32(sp + 32); +a0 = 0x51; +//nop; +a1 = 0x1; +a2 = s0; +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41f4e4; +a3 = 0x1; +L41f4e4: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 50); +//nop; +a1 = MEM_U8(sp + 43); +a2 = MEM_U8(sp + 41); +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41f500; +a3 = 0x1; +L41f500: +gp = MEM_U32(sp + 32); +a0 = 0x20; +//nop; +a1 = 0x5; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L41f518; +//nop; +L41f518: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 50); +//nop; +a1 = MEM_U8(sp + 43); +a2 = MEM_U32(sp + 60); +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41f534; +a3 = zero; +L41f534: +gp = MEM_U32(sp + 32); +//nop; +ra = MEM_U32(sp + 36); +L41f540: +s0 = MEM_U32(sp + 28); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_41f54c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41f54c: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +t6 = 0x10018e80; +MEM_U32(sp + 36) = ra; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 52) = a1; +MEM_U32(sp + 56) = a2; +if (t6 == 0) {MEM_U32(sp + 60) = a3; +goto L41f5a0;} +MEM_U32(sp + 60) = a3; +t7 = a1 + 0x1; +t8 = a2 + 0x1; +MEM_U8(sp + 43) = (uint8_t)t7; +MEM_U8(sp + 42) = (uint8_t)a1; +MEM_U8(sp + 41) = (uint8_t)t8; +s0 = a2 & 0xff; +goto L41f5bc; +s0 = a2 & 0xff; +L41f5a0: +s0 = a2 + 0x1; +t9 = a1 + 0x1; +t0 = s0 & 0xff; +MEM_U8(sp + 43) = (uint8_t)a1; +MEM_U8(sp + 42) = (uint8_t)t9; +MEM_U8(sp + 41) = (uint8_t)a2; +s0 = t0; +L41f5bc: +t1 = MEM_U32(sp + 60); +t2 = MEM_U32(sp + 64); +if (t1 != 0) {at = 0x8000; +goto L41f670;} +at = 0x8000; +at = (int)t2 < (int)at; +if (at == 0) {at = (int)t2 < (int)0xffff8000; +goto L41f670;} +at = (int)t2 < (int)0xffff8000; +if (at != 0) {//nop; +goto L41f670;} +//nop; +//nop; +a0 = 0x20; +a1 = 0x6; +f_emit_dir0(mem, sp, a0, a1); +goto L41f5f0; +a1 = 0x6; +L41f5f0: +gp = MEM_U32(sp + 32); +a3 = MEM_U32(sp + 64); +//nop; +a0 = 0x51; +a1 = 0x1; +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41f610; +MEM_U32(sp + 16) = zero; +L41f610: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 42); +//nop; +a3 = MEM_U32(sp + 64); +a0 = 0x56; +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41f630; +MEM_U32(sp + 16) = zero; +L41f630: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 50); +//nop; +a1 = MEM_U8(sp + 43); +a2 = MEM_U8(sp + 41); +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41f64c; +a3 = 0x1; +L41f64c: +gp = MEM_U32(sp + 32); +a0 = 0x20; +//nop; +a1 = 0x5; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L41f664; +//nop; +L41f664: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L41f734; +ra = MEM_U32(sp + 36); +L41f670: +//nop; +a0 = 0x20; +a1 = 0x6; +f_emit_dir0(mem, sp, a0, a1); +goto L41f680; +a1 = 0x6; +L41f680: +gp = MEM_U32(sp + 32); +a2 = MEM_U32(sp + 64); +//nop; +a0 = 0x29; +a1 = 0x1; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41f69c; +a3 = zero; +L41f69c: +gp = MEM_U32(sp + 32); +a0 = 0x51; +//nop; +a1 = 0x1; +a2 = s0; +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41f6b8; +a3 = 0x1; +L41f6b8: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 50); +//nop; +a1 = MEM_U8(sp + 43); +a2 = MEM_U8(sp + 41); +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41f6d4; +a3 = 0x1; +L41f6d4: +gp = MEM_U32(sp + 32); +a0 = 0x20; +//nop; +a1 = 0x5; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L41f6ec; +//nop; +L41f6ec: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 42); +//nop; +a3 = MEM_U32(sp + 64); +a0 = 0x56; +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41f70c; +MEM_U32(sp + 16) = zero; +L41f70c: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 50); +//nop; +a1 = MEM_U8(sp + 43); +a2 = MEM_U32(sp + 60); +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41f728; +a3 = zero; +L41f728: +gp = MEM_U32(sp + 32); +//nop; +ra = MEM_U32(sp + 36); +L41f734: +s0 = MEM_U32(sp + 28); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_41f740(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41f740: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb8; +MEM_U32(sp + 36) = s2; +MEM_U32(sp + 44) = s4; +MEM_U32(sp + 40) = s3; +MEM_U32(sp + 28) = s0; +s2 = a3 & 0x3f; +at = 0x40; +s0 = a1 & 0xff; +s3 = a0 & 0xffff; +s4 = a2 & 0xff; +MEM_U32(sp + 52) = ra; +MEM_U32(sp + 48) = gp; +MEM_U32(sp + 32) = s1; +MEM_U32(sp + 72) = a0; +MEM_U32(sp + 76) = a1; +if (s2 != at) {MEM_U32(sp + 80) = a2; +goto L41f7d0;} +MEM_U32(sp + 80) = a2; +//nop; +a0 = 0x29; +a1 = s0; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41f7a8; +a3 = zero; +L41f7a8: +gp = MEM_U32(sp + 48); +a0 = 0x29; +//nop; +a1 = s0 + 0x1; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41f7c4; +a3 = zero; +L41f7c4: +gp = MEM_U32(sp + 48); +ra = MEM_U32(sp + 52); +goto L41f998; +ra = MEM_U32(sp + 52); +L41f7d0: +at = (int)s2 < (int)0x20; +if (at != 0) {//nop; +goto L41f870;} +//nop; +t7 = 0x10018e80; +a2 = zero; +t7 = MEM_U8(t7 + 0); +a0 = 0x29; +if (t7 == 0) {a1 = s0 + 0x1; +goto L41f834;} +a1 = s0 + 0x1; +//nop; +a0 = 0x29; +a1 = s0; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41f808; +a3 = zero; +L41f808: +gp = MEM_U32(sp + 48); +a0 = s3; +//nop; +a1 = s0 + 0x1; +a2 = s4; +a3 = s2 + 0xffffffe0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41f828; +MEM_U32(sp + 16) = zero; +L41f828: +gp = MEM_U32(sp + 48); +ra = MEM_U32(sp + 52); +goto L41f998; +ra = MEM_U32(sp + 52); +L41f834: +//nop; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41f844; +a3 = zero; +L41f844: +gp = MEM_U32(sp + 48); +a0 = s3; +//nop; +a1 = s0; +a2 = s4 + 0x1; +a3 = s2 + 0xffffffe0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41f864; +MEM_U32(sp + 16) = zero; +L41f864: +gp = MEM_U32(sp + 48); +ra = MEM_U32(sp + 52); +goto L41f998; +ra = MEM_U32(sp + 52); +L41f870: +t8 = 0x10018e80; +a0 = s3; +t8 = MEM_U8(t8 + 0); +a1 = s0; +if (t8 == 0) {a2 = s4; +goto L41f914;} +a2 = s4; +//nop; +s1 = s0 + 0x1; +a1 = s1; +a0 = s3; +a2 = s4 + 0x1; +a3 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41f8a8; +MEM_U32(sp + 16) = zero; +L41f8a8: +gp = MEM_U32(sp + 48); +t9 = 0x20; +a3 = t9 - s2; +//nop; +a0 = s3; +a1 = s0; +a2 = s4; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41f8cc; +MEM_U32(sp + 16) = zero; +L41f8cc: +gp = MEM_U32(sp + 48); +a0 = 0x40; +//nop; +a1 = s1; +a2 = s1; +a3 = s0; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41f8e8; +a3 = s0; +L41f8e8: +gp = MEM_U32(sp + 48); +a0 = s3; +//nop; +a1 = s0; +a2 = s4; +a3 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41f908; +MEM_U32(sp + 16) = zero; +L41f908: +gp = MEM_U32(sp + 48); +ra = MEM_U32(sp + 52); +goto L41f998; +ra = MEM_U32(sp + 52); +L41f914: +//nop; +a3 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41f924; +MEM_U32(sp + 16) = zero; +L41f924: +gp = MEM_U32(sp + 48); +s1 = s0 + 0x1; +//nop; +a2 = s4 + 0x1; +t0 = 0x20; +a3 = t0 - s2; +MEM_U32(sp + 60) = a2; +a1 = s1; +a0 = s3; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41f950; +MEM_U32(sp + 16) = zero; +L41f950: +gp = MEM_U32(sp + 48); +a0 = 0x40; +//nop; +a1 = s0; +a2 = s0; +a3 = s1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41f96c; +a3 = s1; +L41f96c: +gp = MEM_U32(sp + 48); +a2 = MEM_U32(sp + 60); +//nop; +a0 = s3; +a1 = s1; +a3 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41f98c; +MEM_U32(sp + 16) = zero; +L41f98c: +gp = MEM_U32(sp + 48); +//nop; +ra = MEM_U32(sp + 52); +L41f998: +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +s3 = MEM_U32(sp + 40); +s4 = MEM_U32(sp + 44); +sp = sp + 0x48; +return; +sp = sp + 0x48; +} + +static void func_41f9b4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41f9b4: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 36) = s2; +MEM_U32(sp + 32) = s1; +s2 = a3 & 0x3f; +at = 0x40; +s1 = a1 & 0xff; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +if (s2 != at) {MEM_U32(sp + 72) = a2; +goto L41fa34;} +MEM_U32(sp + 72) = a2; +//nop; +a0 = 0x29; +a1 = s1; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41fa0c; +a3 = zero; +L41fa0c: +gp = MEM_U32(sp + 40); +a0 = 0x29; +//nop; +a1 = s1 + 0x1; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41fa28; +a3 = zero; +L41fa28: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L41fcc0; +ra = MEM_U32(sp + 44); +L41fa34: +at = (int)s2 < (int)0x20; +if (at != 0) {//nop; +goto L41fb90;} +//nop; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L41fa50; +//nop; +L41fa50: +gp = MEM_U32(sp + 40); +MEM_U32(sp + 56) = v0; +t7 = 0x10018e80; +s0 = s1 + 0x1; +t7 = MEM_U8(t7 + 0); +a0 = 0x29; +if (t7 == 0) {a1 = s1; +goto L41fb08;} +a1 = s1; +//nop; +a0 = 0x29; +a1 = s0; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41fa88; +a3 = zero; +L41fa88: +gp = MEM_U32(sp + 40); +a1 = MEM_U8(sp + 75); +//nop; +a2 = MEM_U32(sp + 56); +a1 = a1 + 0x1; +MEM_U32(sp + 48) = a1; +a0 = 0x10; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41faa8; +a0 = 0x10; +L41faa8: +gp = MEM_U32(sp + 40); +a0 = 0x29; +//nop; +a1 = s0; +a2 = 0xffffffff; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41fac4; +a3 = zero; +L41fac4: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(sp + 56); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41fadc; +//nop; +L41fadc: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a2 = MEM_U32(sp + 48); +a1 = s1; +a3 = s2 + 0xffffffe0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41fafc; +MEM_U32(sp + 16) = zero; +L41fafc: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L41fcc0; +ra = MEM_U32(sp + 44); +L41fb08: +//nop; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41fb18; +a3 = zero; +L41fb18: +gp = MEM_U32(sp + 40); +a1 = MEM_U8(sp + 75); +//nop; +a2 = MEM_U32(sp + 56); +a0 = 0x10; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41fb30; +a0 = 0x10; +L41fb30: +gp = MEM_U32(sp + 40); +a0 = 0x29; +//nop; +a1 = s1; +a2 = 0xffffffff; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41fb4c; +a3 = zero; +L41fb4c: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(sp + 56); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L41fb64; +//nop; +L41fb64: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a2 = MEM_U8(sp + 75); +a1 = s1 + 0x1; +a3 = s2 + 0xffffffe0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41fb84; +MEM_U32(sp + 16) = zero; +L41fb84: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L41fcc0; +ra = MEM_U32(sp + 44); +L41fb90: +t8 = 0x10018e80; +s0 = s1 + 0x1; +t8 = MEM_U8(t8 + 0); +a1 = s0; +if (t8 == 0) {a0 = 0x54; +goto L41fc3c;} +a0 = 0x54; +//nop; +a2 = MEM_U8(sp + 75); +a0 = 0x54; +a1 = s1; +a3 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41fbc4; +MEM_U32(sp + 16) = zero; +L41fbc4: +gp = MEM_U32(sp + 40); +t9 = 0x20; +a2 = MEM_U8(sp + 75); +a3 = t9 - s2; +//nop; +s0 = s1 + 0x1; +a2 = a2 + 0x1; +MEM_U32(sp + 48) = a2; +a1 = s0; +a0 = 0x4f; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41fbf4; +MEM_U32(sp + 16) = zero; +L41fbf4: +gp = MEM_U32(sp + 40); +a0 = 0x40; +//nop; +a1 = s1; +a2 = s1; +a3 = s0; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41fc10; +a3 = s0; +L41fc10: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a2 = MEM_U32(sp + 48); +a1 = s0; +a3 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41fc30; +MEM_U32(sp + 16) = zero; +L41fc30: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L41fcc0; +ra = MEM_U32(sp + 44); +L41fc3c: +a2 = MEM_U8(sp + 75); +//nop; +a3 = s2; +MEM_U32(sp + 16) = zero; +a2 = a2 + 0x1; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41fc54; +a2 = a2 + 0x1; +L41fc54: +gp = MEM_U32(sp + 40); +a2 = MEM_U8(sp + 75); +//nop; +t0 = 0x20; +a3 = t0 - s2; +a0 = 0x4f; +a1 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41fc78; +MEM_U32(sp + 16) = zero; +L41fc78: +gp = MEM_U32(sp + 40); +a0 = 0x40; +//nop; +a1 = s0; +a2 = s0; +a3 = s1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41fc94; +a3 = s1; +L41fc94: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a2 = MEM_U8(sp + 75); +a1 = s1; +a3 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41fcb4; +MEM_U32(sp + 16) = zero; +L41fcb4: +gp = MEM_U32(sp + 40); +//nop; +ra = MEM_U32(sp + 44); +L41fcc0: +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_41fcd4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41fcd4: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 48) = a2; +s0 = a1 & 0xff; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 52) = a3; +a2 = MEM_U32(sp + 56); +MEM_U32(sp + 32) = gp; +a3 = zero; +a1 = s0; +a0 = 0x29; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41fd1c; +a0 = 0x29; +L41fd1c: +gp = MEM_U32(sp + 32); +a3 = MEM_U8(sp + 51); +t6 = 0x10018e80; +a2 = s0; +t6 = MEM_U8(t6 + 0); +a0 = 0x59; +if (t6 == 0) {a1 = s0; +goto L41fd5c;} +a1 = s0; +//nop; +a3 = MEM_U8(sp + 51); +a0 = 0x59; +a1 = s0; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41fd50; +a1 = s0; +L41fd50: +gp = MEM_U32(sp + 32); +//nop; +goto L41fd74; +//nop; +L41fd5c: +//nop; +a2 = s0; +a3 = a3 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41fd6c; +a3 = a3 + 0x1; +L41fd6c: +gp = MEM_U32(sp + 32); +//nop; +L41fd74: +//nop; +a0 = 0x20; +a1 = 0x6; +f_emit_dir0(mem, sp, a0, a1); +goto L41fd84; +a1 = 0x6; +L41fd84: +gp = MEM_U32(sp + 32); +a2 = MEM_U32(sp + 52); +//nop; +a0 = 0x29; +a1 = 0x1; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L41fda0; +a3 = zero; +L41fda0: +gp = MEM_U32(sp + 32); +a3 = MEM_U8(sp + 51); +t7 = 0x10018e80; +a2 = 0x1; +t7 = MEM_U8(t7 + 0); +a0 = 0x59; +if (t7 == 0) {a1 = 0x1; +goto L41fde0;} +a1 = 0x1; +//nop; +a0 = 0x59; +a1 = 0x1; +a3 = a3 + 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41fdd4; +a3 = a3 + 0x1; +L41fdd4: +gp = MEM_U32(sp + 32); +t8 = MEM_U16(sp + 42); +goto L41fdfc; +t8 = MEM_U16(sp + 42); +L41fde0: +//nop; +a3 = MEM_U8(sp + 51); +a2 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41fdf0; +a2 = 0x1; +L41fdf0: +gp = MEM_U32(sp + 32); +//nop; +t8 = MEM_U16(sp + 42); +L41fdfc: +at = 0x47; +if (t8 != at) {a0 = 0x40; +goto L41fe4c;} +a0 = 0x40; +//nop; +a0 = 0x40; +a1 = s0; +a2 = s0; +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41fe20; +a3 = 0x1; +L41fe20: +gp = MEM_U32(sp + 32); +a0 = 0xd6; +//nop; +a1 = s0; +a2 = s0; +a3 = 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41fe40; +MEM_U32(sp + 16) = zero; +L41fe40: +gp = MEM_U32(sp + 32); +//nop; +goto L41fe84; +//nop; +L41fe4c: +//nop; +a1 = s0; +a2 = s0; +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41fe60; +a3 = 0x1; +L41fe60: +gp = MEM_U32(sp + 32); +a0 = 0x51; +//nop; +a1 = s0; +a2 = zero; +a3 = s0; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L41fe7c; +a3 = s0; +L41fe7c: +gp = MEM_U32(sp + 32); +//nop; +L41fe84: +//nop; +a0 = 0x20; +a1 = 0x5; +f_emit_dir0(mem, sp, a0, a1); +goto L41fe94; +a1 = 0x5; +L41fe94: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_41fea8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L41fea8: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 36) = s2; +MEM_U32(sp + 32) = s1; +s1 = a1 & 0xff; +s2 = a2 & 0xff; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +MEM_U32(sp + 76) = a3; +v0 = f_gen_label_id(mem, sp); +goto L41feec; +MEM_U32(sp + 76) = a3; +L41feec: +gp = MEM_U32(sp + 40); +s0 = v0; +t6 = 0x10018e80; +a0 = 0x4b; +t6 = MEM_U8(t6 + 0); +a1 = s1; +if (t6 == 0) {a2 = s2; +goto L41ff8c;} +a2 = s2; +//nop; +a2 = s2 + 0x1; +a3 = MEM_U32(sp + 76); +MEM_U32(sp + 52) = a2; +a0 = 0x4b; +a1 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41ff2c; +MEM_U32(sp + 16) = zero; +L41ff2c: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41ff44; +a2 = s0; +L41ff44: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 52); +//nop; +a2 = MEM_U32(sp + 76); +a0 = 0x18; +a3 = s0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41ff60; +a3 = s0; +L41ff60: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a3 = MEM_U32(sp + 80); +a1 = s1; +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41ff80; +MEM_U32(sp + 16) = zero; +L41ff80: +gp = MEM_U32(sp + 40); +//nop; +goto L41fff8; +//nop; +L41ff8c: +//nop; +a3 = MEM_U32(sp + 76); +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41ff9c; +MEM_U32(sp + 16) = zero; +L41ff9c: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L41ffb4; +a2 = s0; +L41ffb4: +gp = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 76); +//nop; +a0 = 0x18; +a1 = s2; +a3 = s0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L41ffd0; +a3 = s0; +L41ffd0: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a3 = MEM_U32(sp + 80); +a1 = s1; +a2 = s2 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L41fff0; +MEM_U32(sp + 16) = zero; +L41fff0: +gp = MEM_U32(sp + 40); +//nop; +L41fff8: +//nop; +a0 = s0; +//nop; +f_define_label(mem, sp, a0); +goto L420008; +//nop; +L420008: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_420024(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L420024: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 36) = s2; +MEM_U32(sp + 32) = s1; +s1 = a1 & 0xff; +s2 = a2 & 0xff; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +MEM_U32(sp + 76) = a3; +v0 = f_gen_label_id(mem, sp); +goto L420068; +MEM_U32(sp + 76) = a3; +L420068: +gp = MEM_U32(sp + 40); +s0 = v0; +t6 = 0x10018e80; +a0 = 0x4a; +t6 = MEM_U8(t6 + 0); +a1 = s1; +if (t6 == 0) {a2 = s2; +goto L420108;} +a2 = s2; +//nop; +a2 = s2 + 0x1; +a3 = MEM_U32(sp + 76); +MEM_U32(sp + 52) = a2; +a0 = 0x4a; +a1 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4200a8; +MEM_U32(sp + 16) = zero; +L4200a8: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L4200c0; +a2 = s0; +L4200c0: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 52); +//nop; +a2 = MEM_U32(sp + 76); +a0 = 0x17; +a3 = s0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L4200dc; +a3 = s0; +L4200dc: +gp = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 80); +//nop; +a0 = 0x49; +a1 = s1; +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4200fc; +MEM_U32(sp + 16) = zero; +L4200fc: +gp = MEM_U32(sp + 40); +//nop; +goto L420174; +//nop; +L420108: +//nop; +a3 = MEM_U32(sp + 76); +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420118; +MEM_U32(sp + 16) = zero; +L420118: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L420130; +a2 = s0; +L420130: +gp = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 76); +//nop; +a0 = 0x17; +a1 = s2; +a3 = s0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L42014c; +a3 = s0; +L42014c: +gp = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 80); +//nop; +a0 = 0x49; +a1 = s1; +a2 = s2 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42016c; +MEM_U32(sp + 16) = zero; +L42016c: +gp = MEM_U32(sp + 40); +//nop; +L420174: +//nop; +a0 = s0; +//nop; +f_define_label(mem, sp, a0); +goto L420184; +//nop; +L420184: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_4201a0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4201a0: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 36) = s2; +MEM_U32(sp + 32) = s1; +s1 = a1 & 0xff; +s2 = a2 & 0xff; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +MEM_U32(sp + 76) = a3; +v0 = f_gen_label_id(mem, sp); +goto L4201e4; +MEM_U32(sp + 76) = a3; +L4201e4: +gp = MEM_U32(sp + 40); +s0 = v0; +t6 = 0x10018e80; +a0 = 0x4a; +t6 = MEM_U8(t6 + 0); +a1 = s1; +if (t6 == 0) {a2 = s2; +goto L420284;} +a2 = s2; +//nop; +a2 = s2 + 0x1; +a3 = MEM_U32(sp + 76); +MEM_U32(sp + 52) = a2; +a0 = 0x4a; +a1 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420224; +MEM_U32(sp + 16) = zero; +L420224: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L42023c; +a2 = s0; +L42023c: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 52); +//nop; +a2 = MEM_U32(sp + 76); +a0 = 0x17; +a3 = s0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L420258; +a3 = s0; +L420258: +gp = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 80); +//nop; +a0 = 0x4b; +a1 = s1; +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420278; +MEM_U32(sp + 16) = zero; +L420278: +gp = MEM_U32(sp + 40); +//nop; +goto L4202f0; +//nop; +L420284: +//nop; +a3 = MEM_U32(sp + 76); +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420294; +MEM_U32(sp + 16) = zero; +L420294: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L4202ac; +a2 = s0; +L4202ac: +gp = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 76); +//nop; +a0 = 0x17; +a1 = s2; +a3 = s0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L4202c8; +a3 = s0; +L4202c8: +gp = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 80); +//nop; +a0 = 0x4b; +a1 = s1; +a2 = s2 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4202e8; +MEM_U32(sp + 16) = zero; +L4202e8: +gp = MEM_U32(sp + 40); +//nop; +L4202f0: +//nop; +a0 = s0; +//nop; +f_define_label(mem, sp, a0); +goto L420300; +//nop; +L420300: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_42031c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L42031c: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 36) = s2; +MEM_U32(sp + 32) = s1; +s1 = a1 & 0xff; +s2 = a2 & 0xff; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +MEM_U32(sp + 76) = a3; +v0 = f_gen_label_id(mem, sp); +goto L420360; +MEM_U32(sp + 76) = a3; +L420360: +gp = MEM_U32(sp + 40); +s0 = v0; +t6 = 0x10018e80; +a0 = 0x50; +t6 = MEM_U8(t6 + 0); +a1 = s1; +if (t6 == 0) {a2 = s2; +goto L420400;} +a2 = s2; +//nop; +a2 = s2 + 0x1; +a3 = MEM_U32(sp + 76); +MEM_U32(sp + 52) = a2; +a0 = 0x50; +a1 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4203a0; +MEM_U32(sp + 16) = zero; +L4203a0: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L4203b8; +a2 = s0; +L4203b8: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 52); +//nop; +a2 = MEM_U32(sp + 76); +a0 = 0x11; +a3 = s0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L4203d4; +a3 = s0; +L4203d4: +gp = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 80); +//nop; +a0 = 0x4e; +a1 = s1; +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4203f4; +MEM_U32(sp + 16) = zero; +L4203f4: +gp = MEM_U32(sp + 40); +//nop; +goto L42046c; +//nop; +L420400: +//nop; +a3 = MEM_U32(sp + 76); +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420410; +MEM_U32(sp + 16) = zero; +L420410: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L420428; +a2 = s0; +L420428: +gp = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 76); +//nop; +a0 = 0x11; +a1 = s2; +a3 = s0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L420444; +a3 = s0; +L420444: +gp = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 80); +//nop; +a0 = 0x4e; +a1 = s1; +a2 = s2 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420464; +MEM_U32(sp + 16) = zero; +L420464: +gp = MEM_U32(sp + 40); +//nop; +L42046c: +//nop; +a0 = s0; +//nop; +f_define_label(mem, sp, a0); +goto L42047c; +//nop; +L42047c: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_420498(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L420498: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 36) = s2; +MEM_U32(sp + 32) = s1; +s1 = a1 & 0xff; +s2 = a2 & 0xff; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +MEM_U32(sp + 76) = a3; +v0 = f_gen_label_id(mem, sp); +goto L4204dc; +MEM_U32(sp + 76) = a3; +L4204dc: +gp = MEM_U32(sp + 40); +s0 = v0; +t6 = 0x10018e80; +a0 = 0x50; +t6 = MEM_U8(t6 + 0); +a1 = s1; +if (t6 == 0) {a2 = s2; +goto L42057c;} +a2 = s2; +//nop; +a2 = s2 + 0x1; +a3 = MEM_U32(sp + 76); +MEM_U32(sp + 52) = a2; +a0 = 0x50; +a1 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42051c; +MEM_U32(sp + 16) = zero; +L42051c: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L420534; +a2 = s0; +L420534: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 52); +//nop; +a2 = MEM_U32(sp + 76); +a0 = 0x11; +a3 = s0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L420550; +a3 = s0; +L420550: +gp = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 80); +//nop; +a0 = 0x51; +a1 = s1; +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420570; +MEM_U32(sp + 16) = zero; +L420570: +gp = MEM_U32(sp + 40); +//nop; +goto L4205e8; +//nop; +L42057c: +//nop; +a3 = MEM_U32(sp + 76); +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42058c; +MEM_U32(sp + 16) = zero; +L42058c: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L4205a4; +a2 = s0; +L4205a4: +gp = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 76); +//nop; +a0 = 0x11; +a1 = s2; +a3 = s0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L4205c0; +a3 = s0; +L4205c0: +gp = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 80); +//nop; +a0 = 0x51; +a1 = s1; +a2 = s2 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4205e0; +MEM_U32(sp + 16) = zero; +L4205e0: +gp = MEM_U32(sp + 40); +//nop; +L4205e8: +//nop; +a0 = s0; +//nop; +f_define_label(mem, sp, a0); +goto L4205f8; +//nop; +L4205f8: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_420614(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L420614: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 36) = s2; +MEM_U32(sp + 32) = s1; +s1 = a1 & 0xff; +s2 = a2 & 0xff; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +MEM_U32(sp + 76) = a3; +v0 = f_gen_label_id(mem, sp); +goto L420658; +MEM_U32(sp + 76) = a3; +L420658: +gp = MEM_U32(sp + 40); +s0 = v0; +t6 = 0x10018e80; +a0 = 0x51; +t6 = MEM_U8(t6 + 0); +a1 = s1; +if (t6 == 0) {a2 = s2; +goto L4206f8;} +a2 = s2; +//nop; +a2 = s2 + 0x1; +a3 = MEM_U32(sp + 76); +MEM_U32(sp + 52) = a2; +a0 = 0x51; +a1 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420698; +MEM_U32(sp + 16) = zero; +L420698: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L4206b0; +a2 = s0; +L4206b0: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 52); +//nop; +a2 = MEM_U32(sp + 76); +a0 = 0x12; +a3 = s0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L4206cc; +a3 = s0; +L4206cc: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a3 = MEM_U32(sp + 80); +a1 = s1; +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4206ec; +MEM_U32(sp + 16) = zero; +L4206ec: +gp = MEM_U32(sp + 40); +//nop; +goto L420764; +//nop; +L4206f8: +//nop; +a3 = MEM_U32(sp + 76); +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420708; +MEM_U32(sp + 16) = zero; +L420708: +gp = MEM_U32(sp + 40); +a0 = 0x13; +//nop; +a1 = s1; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L420720; +a2 = s0; +L420720: +gp = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 76); +//nop; +a0 = 0x12; +a1 = s2; +a3 = s0; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L42073c; +a3 = s0; +L42073c: +gp = MEM_U32(sp + 40); +a0 = MEM_U16(sp + 66); +//nop; +a3 = MEM_U32(sp + 80); +a1 = s1; +a2 = s2 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42075c; +MEM_U32(sp + 16) = zero; +L42075c: +gp = MEM_U32(sp + 40); +//nop; +L420764: +//nop; +a0 = s0; +//nop; +f_define_label(mem, sp, a0); +goto L420774; +//nop; +L420774: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void f_dw_emit_rri(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L420790: +//dw_emit_rri: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +v0 = 0x10018ecc; +MEM_U32(sp + 36) = s2; +v0 = MEM_U8(v0 + 0); +MEM_U32(sp + 32) = s1; +MEM_U32(sp + 28) = s0; +s0 = a0 & 0xffff; +s1 = a1 & 0xff; +s2 = a2 & 0xff; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 68) = a1; +MEM_U32(sp + 72) = a2; +if (v0 != 0) {MEM_U32(sp + 76) = a3; +goto L420df4;} +MEM_U32(sp + 76) = a3; +t6 = MEM_U32(sp + 84); +at = 0x5010000; +t7 = MEM_U8(t6 + 33); +//nop; +t8 = t7 & 0x1f; +t9 = t8 < 0x20; +t0 = -t9; +t1 = t0 & at; +t2 = t1 << (t8 & 0x1f); +if ((int)t2 >= 0) {at = s0 < 0x41; +goto L420df4;} +at = s0 < 0x41; +if (at != 0) {at = s0 < 0x5a; +goto L420d60;} +at = s0 < 0x5a; +if (at != 0) {t8 = s0 + 0xffffffb9; +goto L420dc8;} +t8 = s0 + 0xffffffb9; +t3 = s0 + 0xffffff12; +at = t3 < 0x2; +if (at == 0) {//nop; +goto L420d38;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100083d0[] = { +&&L420b0c, +&&L420b40, +}; +dest = Lswitch100083d0[t3]; +//nop; +goto *dest; +//nop; +L420848: +t4 = 0x10018e80; +t5 = MEM_U32(sp + 76); +t4 = MEM_U8(t4 + 0); +a0 = s0; +if (t4 == 0) {a1 = s1; +goto L4208c4;} +a1 = s1; +//nop; +a3 = MEM_U32(sp + 80); +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420874; +MEM_U32(sp + 16) = zero; +L420874: +a3 = MEM_U32(sp + 76); +gp = MEM_U32(sp + 40); +if (a3 != 0) {a0 = s0; +goto L4208a4;} +a0 = s0; +//nop; +a0 = 0x31; +a1 = s1 + 0x1; +a2 = zero; +f_emit_rr(mem, sp, a0, a1, a2); +goto L420898; +a2 = zero; +L420898: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L4208a4: +//nop; +a1 = s1 + 0x1; +a2 = s2 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4208b8; +MEM_U32(sp + 16) = zero; +L4208b8: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L4208c4: +if (t5 != 0) {a0 = s0; +goto L4208ec;} +a0 = s0; +//nop; +a0 = 0x31; +a1 = s1; +a2 = zero; +f_emit_rr(mem, sp, a0, a1, a2); +goto L4208e0; +a2 = zero; +L4208e0: +gp = MEM_U32(sp + 40); +//nop; +goto L42090c; +//nop; +L4208ec: +//nop; +a3 = MEM_U32(sp + 76); +a1 = s1; +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420904; +MEM_U32(sp + 16) = zero; +L420904: +gp = MEM_U32(sp + 40); +//nop; +L42090c: +//nop; +a3 = MEM_U32(sp + 80); +a0 = s0; +a1 = s1 + 0x1; +a2 = s2 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420928; +MEM_U32(sp + 16) = zero; +L420928: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420934: +t6 = 0x10018e80; +t7 = MEM_U32(sp + 76); +t6 = MEM_U8(t6 + 0); +a0 = s0; +if (t6 == 0) {a1 = s1; +goto L4209b0;} +a1 = s1; +//nop; +a3 = MEM_U32(sp + 80); +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420960; +MEM_U32(sp + 16) = zero; +L420960: +a3 = MEM_U32(sp + 76); +gp = MEM_U32(sp + 40); +if (a3 != 0) {a0 = s0; +goto L420990;} +a0 = s0; +//nop; +a0 = 0x31; +a1 = s1 + 0x1; +a2 = s2 + 0x1; +f_emit_rr(mem, sp, a0, a1, a2); +goto L420984; +a2 = s2 + 0x1; +L420984: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420990: +//nop; +a1 = s1 + 0x1; +a2 = s2 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4209a4; +MEM_U32(sp + 16) = zero; +L4209a4: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L4209b0: +if (t7 != 0) {a0 = s0; +goto L4209d8;} +a0 = s0; +//nop; +a0 = 0x31; +a1 = s1; +a2 = s2; +f_emit_rr(mem, sp, a0, a1, a2); +goto L4209cc; +a2 = s2; +L4209cc: +gp = MEM_U32(sp + 40); +//nop; +goto L4209f8; +//nop; +L4209d8: +//nop; +a3 = MEM_U32(sp + 76); +a1 = s1; +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4209f0; +MEM_U32(sp + 16) = zero; +L4209f0: +gp = MEM_U32(sp + 40); +//nop; +L4209f8: +//nop; +a3 = MEM_U32(sp + 80); +a0 = s0; +a1 = s1 + 0x1; +a2 = s2 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420a14; +MEM_U32(sp + 16) = zero; +L420a14: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420a20: +t9 = 0x10018e80; +t0 = MEM_U32(sp + 76); +t9 = MEM_U8(t9 + 0); +a0 = s0; +if (t9 == 0) {a1 = s1; +goto L420a9c;} +a1 = s1; +//nop; +a3 = MEM_U32(sp + 80); +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420a4c; +MEM_U32(sp + 16) = zero; +L420a4c: +a3 = MEM_U32(sp + 76); +gp = MEM_U32(sp + 40); +if (a3 != 0) {a0 = s0; +goto L420a7c;} +a0 = s0; +//nop; +a0 = 0x5a; +a1 = s1 + 0x1; +a2 = s2 + 0x1; +f_emit_rr(mem, sp, a0, a1, a2); +goto L420a70; +a2 = s2 + 0x1; +L420a70: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420a7c: +//nop; +a1 = s1 + 0x1; +a2 = s2 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420a90; +MEM_U32(sp + 16) = zero; +L420a90: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420a9c: +if (t0 != 0) {a0 = s0; +goto L420ac4;} +a0 = s0; +//nop; +a0 = 0x5a; +a1 = s1; +a2 = s2; +f_emit_rr(mem, sp, a0, a1, a2); +goto L420ab8; +a2 = s2; +L420ab8: +gp = MEM_U32(sp + 40); +//nop; +goto L420ae4; +//nop; +L420ac4: +//nop; +a3 = MEM_U32(sp + 76); +a1 = s1; +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420adc; +MEM_U32(sp + 16) = zero; +L420adc: +gp = MEM_U32(sp + 40); +//nop; +L420ae4: +//nop; +a3 = MEM_U32(sp + 80); +a0 = s0; +a1 = s1 + 0x1; +a2 = s2 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420b00; +MEM_U32(sp + 16) = zero; +L420b00: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420b0c: +//nop; +t1 = MEM_U32(sp + 80); +a3 = MEM_U32(sp + 76); +t9 = t9; +a0 = s0; +a1 = s1; +a2 = s2; +v0 = sp + 0x40; +MEM_U32(sp + 16) = t1; +func_41f360(mem, sp, a0, a1, a2, a3); +goto L420b34; +MEM_U32(sp + 16) = t1; +L420b34: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420b40: +//nop; +t8 = MEM_U32(sp + 80); +a3 = MEM_U32(sp + 76); +t9 = t9; +a0 = s0; +a1 = s1; +a2 = s2; +v0 = sp + 0x40; +MEM_U32(sp + 16) = t8; +func_41f54c(mem, sp, a0, a1, a2, a3); +goto L420b68; +MEM_U32(sp + 16) = t8; +L420b68: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420b74: +//nop; +a3 = MEM_U32(sp + 80); +t9 = t9; +a0 = s0; +a1 = s1; +a2 = s2; +v0 = sp + 0x40; +func_41f740(mem, sp, a0, a1, a2, a3); +goto L420b94; +v0 = sp + 0x40; +L420b94: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420ba0: +//nop; +a3 = MEM_U32(sp + 80); +t9 = t9; +a0 = s0; +a1 = s1; +a2 = s2; +v0 = sp + 0x40; +func_41f9b4(mem, sp, a0, a1, a2, a3); +goto L420bc0; +v0 = sp + 0x40; +L420bc0: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420bcc: +//nop; +t2 = MEM_U32(sp + 80); +a3 = MEM_U32(sp + 76); +t9 = t9; +a0 = s0; +a1 = s1; +a2 = s2; +v0 = sp + 0x40; +MEM_U32(sp + 16) = t2; +func_41fcd4(mem, sp, a0, a1, a2, a3); +goto L420bf4; +MEM_U32(sp + 16) = t2; +L420bf4: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420c00: +//nop; +t3 = MEM_U32(sp + 80); +a3 = MEM_U32(sp + 76); +t9 = t9; +a0 = s0; +a1 = s1; +a2 = s2; +v0 = sp + 0x40; +MEM_U32(sp + 16) = t3; +func_41fea8(mem, sp, a0, a1, a2, a3); +goto L420c28; +MEM_U32(sp + 16) = t3; +L420c28: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420c34: +//nop; +t4 = MEM_U32(sp + 80); +a3 = MEM_U32(sp + 76); +t9 = t9; +a0 = s0; +a1 = s1; +a2 = s2; +v0 = sp + 0x40; +MEM_U32(sp + 16) = t4; +func_420024(mem, sp, a0, a1, a2, a3); +goto L420c5c; +MEM_U32(sp + 16) = t4; +L420c5c: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420c68: +//nop; +t5 = MEM_U32(sp + 80); +a3 = MEM_U32(sp + 76); +t9 = t9; +a0 = s0; +a1 = s1; +a2 = s2; +v0 = sp + 0x40; +MEM_U32(sp + 16) = t5; +func_4201a0(mem, sp, a0, a1, a2, a3); +goto L420c90; +MEM_U32(sp + 16) = t5; +L420c90: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420c9c: +//nop; +t6 = MEM_U32(sp + 80); +a3 = MEM_U32(sp + 76); +t9 = t9; +a0 = s0; +a1 = s1; +a2 = s2; +v0 = sp + 0x40; +MEM_U32(sp + 16) = t6; +func_420614(mem, sp, a0, a1, a2, a3); +goto L420cc4; +MEM_U32(sp + 16) = t6; +L420cc4: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420cd0: +//nop; +t7 = MEM_U32(sp + 80); +a3 = MEM_U32(sp + 76); +t9 = t9; +a0 = s0; +a1 = s1; +a2 = s2; +v0 = sp + 0x40; +MEM_U32(sp + 16) = t7; +func_42031c(mem, sp, a0, a1, a2, a3); +goto L420cf8; +MEM_U32(sp + 16) = t7; +L420cf8: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420d04: +t9 = MEM_U32(sp + 80); +a3 = MEM_U32(sp + 76); +MEM_U32(sp + 16) = t9; +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +a2 = s2; +v0 = sp + 0x40; +func_420498(mem, sp, a0, a1, a2, a3); +goto L420d2c; +v0 = sp + 0x40; +L420d2c: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420d38: +//nop; +a3 = MEM_U32(sp + 80); +a0 = s0; +a1 = s1; +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420d54; +MEM_U32(sp + 16) = zero; +L420d54: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420d60: +at = s0 < 0x4; +if (at == 0) {t1 = s0 + 0xffffffc1; +goto L420d9c;} +t1 = s0 + 0xffffffc1; +t0 = s0 + 0xffffffff; +at = t0 < 0x3; +if (at == 0) {//nop; +goto L420d38;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10008370[] = { +&&L420b0c, +&&L420b0c, +&&L420848, +}; +dest = Lswitch10008370[t0]; +//nop; +goto *dest; +//nop; +L420d9c: +at = t1 < 0x2; +if (at == 0) {//nop; +goto L420d38;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000837c[] = { +&&L420a20, +&&L420934, +}; +dest = Lswitch1000837c[t1]; +//nop; +goto *dest; +//nop; +L420dc8: +at = t8 < 0x13; +if (at == 0) {//nop; +goto L420d38;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10008384[] = { +&&L420bcc, +&&L420c34, +&&L420c00, +&&L420c68, +&&L420c00, +&&L420d38, +&&L420cd0, +&&L420c9c, +&&L420b74, +&&L420d04, +&&L420c9c, +&&L420bcc, +&&L420ba0, +&&L420ba0, +&&L420b40, +&&L420b40, +&&L420d38, +&&L420d38, +&&L420934, +}; +dest = Lswitch10008384[t8]; +//nop; +goto *dest; +//nop; +L420df4: +at = 0x1; +if (v0 != at) {a0 = s0; +goto L420e90;} +a0 = s0; +t2 = MEM_U32(sp + 76); +a1 = 0x1; +if (t2 == 0) {//nop; +goto L420e90;} +//nop; +t3 = MEM_U32(sp + 80); +//nop; +MEM_U32(sp + 56) = t2; +a0 = zero; +MEM_U32(sp + 60) = t3; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L420e28; +MEM_U32(sp + 60) = t3; +L420e28: +gp = MEM_U32(sp + 40); +MEM_U8(sp + 55) = (uint8_t)v0; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L420e40; +//nop; +L420e40: +t4 = sp + 0x38; +a2 = MEM_U32(t4 + 0); +gp = MEM_U32(sp + 40); +MEM_U32(sp + 8) = a2; +a3 = MEM_U32(t4 + 4); +//nop; +a1 = MEM_U8(sp + 55); +a0 = 0x14c; +MEM_U32(sp + 12) = a3; +f_emit_rii(mem, sp, a0, a1, a2, a3); +goto L420e68; +MEM_U32(sp + 12) = a3; +L420e68: +gp = MEM_U32(sp + 40); +a3 = MEM_U8(sp + 55); +//nop; +a0 = s0; +a1 = s1; +a2 = s2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L420e84; +a2 = s2; +L420e84: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L420eb4; +ra = MEM_U32(sp + 44); +L420e90: +//nop; +a3 = MEM_U32(sp + 80); +a1 = s1; +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420ea8; +MEM_U32(sp + 16) = zero; +L420ea8: +gp = MEM_U32(sp + 40); +//nop; +ra = MEM_U32(sp + 44); +L420eb4: +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_420ec8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L420ec8: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 28) = s0; +s0 = a1 & 0xff; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 52) = a1; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a2; +a1 = 0x6; +a0 = 0x20; +f_emit_dir0(mem, sp, a0, a1); +goto L420f04; +a0 = 0x20; +L420f04: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 59); +t6 = 0x10018e80; +a0 = 0x47; +t6 = MEM_U8(t6 + 0); +a1 = 0x1; +if (t6 == 0) {a2 = a2 + 0x1; +goto L420fcc;} +a2 = a2 + 0x1; +//nop; +a2 = MEM_U8(sp + 59); +a0 = 0x47; +a1 = 0x1; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420f40; +MEM_U32(sp + 16) = zero; +L420f40: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 59); +//nop; +a0 = 0xdb; +a1 = s0; +f_emit_rr(mem, sp, a0, a1, a2); +goto L420f58; +a1 = s0; +L420f58: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 59); +//nop; +a1 = s0 + 0x1; +MEM_U32(sp + 40) = a1; +a0 = 0x5a; +a2 = a2 + 0x1; +f_emit_rr(mem, sp, a0, a1, a2); +goto L420f78; +a2 = a2 + 0x1; +L420f78: +t7 = MEM_U16(sp + 50); +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 40); +at = 0x3d; +if (t7 != at) {a0 = 0x2; +goto L420fb0;} +a0 = 0x2; +//nop; +a0 = 0x1; +a2 = a1; +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L420fa4; +a3 = 0x1; +L420fa4: +gp = MEM_U32(sp + 32); +//nop; +goto L421064; +//nop; +L420fb0: +//nop; +a2 = a1; +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L420fc0; +a3 = 0x1; +L420fc0: +gp = MEM_U32(sp + 32); +//nop; +goto L421064; +//nop; +L420fcc: +//nop; +a3 = zero; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 40) = a2; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L420fe0; +MEM_U32(sp + 40) = a2; +L420fe0: +gp = MEM_U32(sp + 32); +a2 = MEM_U32(sp + 40); +//nop; +a0 = 0xdb; +a1 = s0 + 0x1; +f_emit_rr(mem, sp, a0, a1, a2); +goto L420ff8; +a1 = s0 + 0x1; +L420ff8: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 59); +//nop; +a0 = 0x5a; +a1 = s0; +f_emit_rr(mem, sp, a0, a1, a2); +goto L421010; +a1 = s0; +L421010: +t8 = MEM_U16(sp + 50); +gp = MEM_U32(sp + 32); +at = 0x3d; +if (t8 != at) {a0 = 0x2; +goto L421048;} +a0 = 0x2; +//nop; +a0 = 0x1; +a1 = s0; +a2 = s0; +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L42103c; +a3 = 0x1; +L42103c: +gp = MEM_U32(sp + 32); +//nop; +goto L421064; +//nop; +L421048: +//nop; +a1 = s0; +a2 = s0; +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L42105c; +a3 = 0x1; +L42105c: +gp = MEM_U32(sp + 32); +//nop; +L421064: +//nop; +a0 = 0x20; +a1 = 0x5; +f_emit_dir0(mem, sp, a0, a1); +goto L421074; +a1 = 0x5; +L421074: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 28); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_421088(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L421088: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +MEM_U32(sp + 28) = ra; +a2 = MEM_U8(sp + 43); +a1 = MEM_U8(sp + 39); +a0 = MEM_U16(sp + 34); +MEM_U32(sp + 24) = gp; +f_emit_rr(mem, sp, a0, a1, a2); +goto L4210c0; +MEM_U32(sp + 24) = gp; +L4210c0: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 39); +a2 = MEM_U8(sp + 43); +//nop; +a0 = MEM_U16(sp + 34); +a1 = a1 + 0x1; +a2 = a2 + 0x1; +f_emit_rr(mem, sp, a0, a1, a2); +goto L4210e0; +a2 = a2 + 0x1; +L4210e0: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void func_4210f0(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a3 = 0; +L4210f0: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +MEM_U32(sp + 64) = a2; +a3 = MEM_U32(v0 + 12); +//nop; +a2 = MEM_U8(sp + 67); +a1 = MEM_U8(sp + 63); +a0 = 0x31; +MEM_U32(sp + 44) = a3; +f_dw_emit_rr(mem, sp, a0, a1, a2, a3); +goto L421130; +MEM_U32(sp + 44) = a3; +L421130: +gp = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L421148; +//nop; +L421148: +gp = MEM_U32(sp + 32); +t6 = MEM_U32(sp + 44); +//nop; +a1 = MEM_U8(sp + 67); +MEM_U32(sp + 48) = v0; +a0 = 0xe; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = v0; +MEM_U32(sp + 20) = t6; +f_emit_branch_rill(mem, sp, a0, a1, a2, a3); +goto L421174; +MEM_U32(sp + 20) = t6; +L421174: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 63); +//nop; +a2 = MEM_U8(sp + 67); +a3 = MEM_U32(sp + 44); +a0 = 0xdb; +f_dw_emit_rr(mem, sp, a0, a1, a2, a3); +goto L421190; +a0 = 0xdb; +L421190: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 48); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L4211a8; +//nop; +L4211a8: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void func_4211b8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L4211b8: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +MEM_U32(sp + 28) = ra; +a2 = MEM_U8(sp + 43); +a1 = MEM_U8(sp + 39); +a0 = MEM_U16(sp + 34); +MEM_U32(sp + 24) = gp; +f_emit_rr(mem, sp, a0, a1, a2); +goto L4211f0; +MEM_U32(sp + 24) = gp; +L4211f0: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 39); +a2 = MEM_U8(sp + 43); +//nop; +a0 = MEM_U16(sp + 34); +a1 = a1 + 0x1; +a2 = a2 + 0x1; +f_emit_rr(mem, sp, a0, a1, a2); +goto L421210; +a2 = a2 + 0x1; +L421210: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_dw_emit_rr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L421220: +//dw_emit_rr: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t6 = 0x10018ecc; +MEM_U32(sp + 28) = ra; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +if (t6 != 0) {MEM_U32(sp + 52) = a3; +goto L421364;} +MEM_U32(sp + 52) = a3; +t8 = MEM_U8(a3 + 33); +at = 0x5010000; +t9 = t8 & 0x1f; +t0 = t9 < 0x20; +t1 = -t0; +t2 = t1 & at; +t3 = t2 << (t9 & 0x1f); +if ((int)t3 >= 0) {at = a0 < 0x3e; +goto L421364;} +at = a0 < 0x3e; +//nop; +goto L42131c; +//nop; +L421280: +//nop; +v0 = sp + 0x28; +t9 = t9; +//nop; +func_420ec8(mem, sp, a0, a1, a2); +goto L421294; +//nop; +L421294: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L421380; +ra = MEM_U32(sp + 28); +L4212a0: +//nop; +v0 = sp + 0x28; +t9 = t9; +//nop; +func_421088(mem, sp, a0, a1, a2); +goto L4212b4; +//nop; +L4212b4: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L421380; +ra = MEM_U32(sp + 28); +L4212c0: +//nop; +v0 = sp + 0x28; +t9 = t9; +//nop; +func_4210f0(mem, sp, v0, a0, a1, a2); +goto L4212d4; +//nop; +L4212d4: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L421380; +ra = MEM_U32(sp + 28); +L4212e0: +//nop; +v0 = sp + 0x28; +t9 = t9; +//nop; +func_4211b8(mem, sp, a0, a1, a2); +goto L4212f4; +//nop; +L4212f4: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L421380; +ra = MEM_U32(sp + 28); +L421300: +//nop; +//nop; +//nop; +f_emit_rr(mem, sp, a0, a1, a2); +goto L421310; +//nop; +L421310: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L421380; +ra = MEM_U32(sp + 28); +L42131c: +if (at != 0) {at = 0x5a; +goto L421340;} +at = 0x5a; +if (a0 == at) {//nop; +goto L4212a0;} +//nop; +at = 0xdb; +if (a0 == at) {//nop; +goto L421280;} +//nop; +//nop; +goto L421300; +//nop; +L421340: +if (a0 == 0) {at = 0x31; +goto L4212c0;} +at = 0x31; +if (a0 == at) {//nop; +goto L4212e0;} +//nop; +at = 0x3d; +if (a0 == at) {//nop; +goto L421280;} +//nop; +//nop; +goto L421300; +//nop; +L421364: +//nop; +//nop; +//nop; +f_emit_rr(mem, sp, a0, a1, a2); +goto L421374; +//nop; +L421374: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L421380: +sp = sp + 0x28; +//nop; +return; +//nop; +//nop; +//nop; +} + +static void f_gen_entry_exit(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L421394: +//gen_entry_exit: +//nop; +//nop; +//nop; +sp = sp + 0xffffff38; +t6 = MEM_U32(sp + 264); +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 200) = a0; +MEM_U32(sp + 204) = a1; +MEM_U32(sp + 208) = a2; +if (t6 == 0) {MEM_U32(sp + 212) = a3; +goto L4213e0;} +MEM_U32(sp + 212) = a3; +//nop; +a0 = sp + 0x108; +//nop; +f_demit_itext(mem, sp, a0); +goto L4213d4; +//nop; +L4213d4: +gp = MEM_U32(sp + 176); +//nop; +goto L4213f8; +//nop; +L4213e0: +//nop; +a0 = 0x15; +a1 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L4213f0; +a1 = zero; +L4213f0: +gp = MEM_U32(sp + 176); +//nop; +L4213f8: +//nop; +a0 = 0x4; +a1 = zero; +a2 = 0x2; +f_demit_dir1(mem, sp, a0, a1, a2); +goto L42140c; +a2 = 0x2; +L42140c: +gp = MEM_U32(sp + 176); +//nop; +t7 = 0x10018e88; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 == 0) {t8 = MEM_U8(sp + 207); +goto L421448;} +t8 = MEM_U8(sp + 207); +//nop; +a0 = MEM_U32(sp + 224); +a1 = 0x1; +f_emit_file(mem, sp, a0, a1, a2, a3); +goto L42143c; +a1 = 0x1; +L42143c: +gp = MEM_U32(sp + 176); +//nop; +t8 = MEM_U8(sp + 207); +L421448: +//nop; +if (t8 == 0) {//nop; +goto L42146c;} +//nop; +//nop; +a1 = MEM_U32(sp + 200); +a0 = 0x2; +f_demit_dir0(mem, sp, a0, a1); +goto L421464; +a0 = 0x2; +L421464: +gp = MEM_U32(sp + 176); +//nop; +L42146c: +//nop; +a2 = MEM_U32(sp + 224); +a3 = MEM_U32(sp + 228); +a0 = 0x1c; +a1 = zero; +f_demit_dir2(mem, sp, a0, a1, a2, a3); +goto L421484; +a1 = zero; +L421484: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(sp + 200); +//nop; +a2 = MEM_U32(sp + 208); +a0 = 0x1b; +f_demit_dir1(mem, sp, a0, a1, a2); +goto L42149c; +a0 = 0x1b; +L42149c: +gp = MEM_U32(sp + 176); +a0 = MEM_U32(sp + 200); +//nop; +//nop; +//nop; +f_output_entry_point(mem, sp, a0); +goto L4214b4; +//nop; +L4214b4: +gp = MEM_U32(sp + 176); +//nop; +a0 = 0x10019368; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +f_emit_optimize_level(mem, sp, a0); +goto L4214d0; +//nop; +L4214d0: +gp = MEM_U32(sp + 176); +at = 0x1; +v0 = 0x10018ed8; +//nop; +v0 = MEM_U32(v0 + 0); +//nop; +if (v0 == at) {at = 0x2; +goto L421558;} +at = 0x2; +if (v0 != at) {t3 = MEM_U32(sp + 212); +goto L42157c;} +t3 = MEM_U32(sp + 212); +t9 = MEM_U8(sp + 223); +//nop; +if (t9 == 0) {//nop; +goto L421558;} +//nop; +t0 = 0x10019368; +//nop; +t0 = MEM_U8(t0 + 0); +//nop; +at = t0 < 0x2; +if (at != 0) {//nop; +goto L421558;} +//nop; +t1 = 0x100197c4; +//nop; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L421558;} +//nop; +t2 = 0x10018e70; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +at = t2 < 0x3e8; +if (at != 0) {t3 = MEM_U32(sp + 212); +goto L42157c;} +t3 = MEM_U32(sp + 212); +L421558: +//nop; +a2 = MEM_U32(sp + 200); +a0 = 0x19; +a1 = zero; +a3 = zero; +f_emit_cpload(mem, sp, a0, a1, a2, a3); +goto L421570; +a3 = zero; +L421570: +gp = MEM_U32(sp + 176); +//nop; +t3 = MEM_U32(sp + 212); +L42157c: +//nop; +if (t3 != 0) {//nop; +goto L42158c;} +//nop; +MEM_U32(sp + 256) = zero; +L42158c: +t4 = 0x100197bc; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == 0) {t6 = MEM_U32(sp + 212); +goto L421624;} +t6 = MEM_U32(sp + 212); +t5 = MEM_U32(sp + 212); +//nop; +if (t5 == 0) {t6 = MEM_U32(sp + 212); +goto L421624;} +t6 = MEM_U32(sp + 212); +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L4215c4; +a1 = 0x1; +L4215c4: +gp = MEM_U32(sp + 176); +MEM_U8(sp + 194) = (uint8_t)v0; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L4215dc; +a1 = 0x1; +L4215dc: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(sp + 194); +//nop; +a2 = 0xfffa0000; +MEM_U8(sp + 193) = (uint8_t)v0; +a2 = a2 | 0x5a5a; +a0 = 0x29; +a3 = zero; +f_demit_ri(mem, sp, a0, a1, a2, a3); +goto L421600; +a3 = zero; +L421600: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(sp + 193); +//nop; +a0 = 0x31; +a2 = 0x1d; +f_demit_rr(mem, sp, a0, a1, a2); +goto L421618; +a2 = 0x1d; +L421618: +gp = MEM_U32(sp + 176); +//nop; +t6 = MEM_U32(sp + 212); +L421624: +//nop; +if (t6 == 0) {t0 = MEM_U8(sp + 243); +goto L4217b8;} +t0 = MEM_U8(sp + 243); +v0 = 0x100197c0; +at = 0xffffffff; +v0 = MEM_U32(v0 + 0); +t7 = MEM_U32(sp + 212); +if (v0 == at) {at = (int)t7 < (int)v0; +goto L421764;} +at = (int)t7 < (int)v0; +if (at != 0) {a0 = 0x56; +goto L421724;} +a0 = 0x56; +//nop; +a0 = 0x18; +a1 = zero; +a2 = 0x1; +f_get_reg(mem, sp, a0, a1, a2); +goto L421664; +a2 = 0x1; +L421664: +gp = MEM_U32(sp + 176); +a0 = 0x31; +//nop; +a1 = 0x19; +a2 = 0x1f; +f_demit_rr(mem, sp, a0, a1, a2); +goto L42167c; +a2 = 0x1f; +L42167c: +gp = MEM_U32(sp + 176); +a2 = MEM_U32(sp + 212); +//nop; +a0 = 0x29; +a1 = 0x18; +a3 = zero; +f_demit_ri(mem, sp, a0, a1, a2, a3); +goto L421698; +a3 = zero; +L421698: +gp = MEM_U32(sp + 176); +a0 = 0x35; +//nop; +a1 = 0xc0; +a2 = zero; +f_demit_regmask(mem, sp, a0, a1, a2); +goto L4216b0; +a2 = zero; +L4216b0: +gp = MEM_U32(sp + 176); +a0 = 0x23; +a1 = 0x10018ec8; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +f_demit_a(mem, sp, a0, a1, a2); +goto L4216cc; +a2 = zero; +L4216cc: +gp = MEM_U32(sp + 176); +a0 = 0x56; +//nop; +a1 = 0x1d; +a2 = 0x1d; +a3 = 0x18; +f_demit_rrr(mem, sp, a0, a1, a2, a3); +goto L4216e8; +a3 = 0x18; +L4216e8: +gp = MEM_U32(sp + 176); +a0 = 0x18; +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L421700; +//nop; +L421700: +gp = MEM_U32(sp + 176); +a0 = 0x31; +//nop; +a1 = 0x1f; +a2 = 0x19; +f_demit_rr(mem, sp, a0, a1, a2); +goto L421718; +a2 = 0x19; +L421718: +gp = MEM_U32(sp + 176); +t0 = MEM_U8(sp + 243); +goto L4217b8; +t0 = MEM_U8(sp + 243); +L421724: +//nop; +a2 = MEM_U32(sp + 212); +a1 = 0x1d; +a3 = zero; +f_demit_ri(mem, sp, a0, a1, a2, a3); +goto L421738; +a3 = zero; +L421738: +gp = MEM_U32(sp + 176); +a0 = 0x57; +//nop; +a1 = zero; +a2 = zero; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L421758; +MEM_U32(sp + 16) = zero; +L421758: +gp = MEM_U32(sp + 176); +t0 = MEM_U8(sp + 243); +goto L4217b8; +t0 = MEM_U8(sp + 243); +L421764: +t8 = 0x10019398; +a2 = MEM_U32(sp + 212); +t8 = MEM_U8(t8 + 0); +a0 = 0x56; +if (t8 == 0) {a1 = 0x1d; +goto L42179c;} +a1 = 0x1d; +//nop; +a0 = 0x2; +a1 = 0x1d; +a3 = zero; +f_demit_ri(mem, sp, a0, a1, a2, a3); +goto L421790; +a3 = zero; +L421790: +gp = MEM_U32(sp + 176); +t0 = MEM_U8(sp + 243); +goto L4217b8; +t0 = MEM_U8(sp + 243); +L42179c: +//nop; +a2 = MEM_U32(sp + 212); +a3 = zero; +f_demit_ri(mem, sp, a0, a1, a2, a3); +goto L4217ac; +a3 = zero; +L4217ac: +gp = MEM_U32(sp + 176); +//nop; +t0 = MEM_U8(sp + 243); +L4217b8: +t9 = 0x17; +if (t0 == 0) {MEM_U8(sp + 187) = (uint8_t)t9; +goto L421904;} +MEM_U8(sp + 187) = (uint8_t)t9; +a2 = 0x10018ec8; +a1 = 0xc1; +a2 = MEM_U32(a2 + 0); +t9 = 0x8; +if (a2 != 0) {a0 = 0x2a; +goto L4218e8;} +a0 = 0x2a; +t1 = 0x10008430; +a0 = 0x4; +t1 = t1; +t3 = t1 + 0x48; +t4 = sp; +L4217f0: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t4 = t4 + 0xc; +MEM_U8(t4 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t4) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t4 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 4 + 3) = (uint8_t)(at >> 0); +if (t1 != t3) {//swr $at, 7($t4) +goto L4217f0;} +//swr $at, 7($t4) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t5 = 0x100083e0; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +t5 = t5; +MEM_U8(t4 + 12 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 12 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 12 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 12 + 3) = (uint8_t)(t3 >> 0); +t7 = t5 + 0x48; +t8 = sp; +//swr $t3, 0xf($t4) +L421860: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t8 = t8 + 0xc; +MEM_U8(t8 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t8) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t8 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 84 + 3) = (uint8_t)(at >> 0); +if (t5 != t7) {//swr $at, 0x57($t8) +goto L421860;} +//swr $at, 0x57($t8) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +//nop; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +t7 = t5 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t5) +//nop; +MEM_U8(t8 + 92 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t8 + 92 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t8 + 92 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t8 + 92 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x5f($t8) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4218dc; +//nop; +L4218dc: +gp = MEM_U32(sp + 176); +t0 = MEM_U32(sp + 212); +goto L421908; +t0 = MEM_U32(sp + 212); +L4218e8: +MEM_U8(sp + 187) = (uint8_t)t9; +//nop; +a1 = 0x8; +a3 = zero; +f_demit_ra(mem, sp, a0, a1, a2, a3); +goto L4218fc; +a3 = zero; +L4218fc: +gp = MEM_U32(sp + 176); +//nop; +L421904: +t0 = MEM_U32(sp + 212); +L421908: +t2 = MEM_U8(sp + 239); +if (t0 == 0) {//nop; +goto L421a20;} +//nop; +if (t2 == 0) {//nop; +goto L421a20;} +//nop; +t3 = 0x10018eac; +at = 0x1; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L421988;} +//nop; +t1 = 0x10019398; +a2 = 0x1d; +t1 = MEM_U8(t1 + 0); +a0 = 0x100; +if (t1 == 0) {a1 = 0x1d; +goto L42196c;} +a1 = 0x1d; +//nop; +a1 = MEM_U8(sp + 187); +a0 = 0x100; +a3 = 0x9; +f_demit_rri(mem, sp, a0, a1, a2, a3); +goto L421960; +a3 = 0x9; +L421960: +gp = MEM_U32(sp + 176); +//nop; +goto L421a20; +//nop; +L42196c: +//nop; +a2 = MEM_U8(sp + 187); +a3 = 0x9; +f_demit_rri(mem, sp, a0, a1, a2, a3); +goto L42197c; +a3 = 0x9; +L42197c: +gp = MEM_U32(sp + 176); +//nop; +goto L421a20; +//nop; +L421988: +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L421998; +//nop; +L421998: +gp = MEM_U32(sp + 176); +a2 = MEM_U8(sp + 187); +t4 = 0x10019398; +a3 = v0; +t4 = MEM_U8(t4 + 0); +a0 = 0xf; +if (t4 == 0) {a1 = 0x1d; +goto L4219d8;} +a1 = 0x1d; +//nop; +a0 = 0x15; +a1 = 0x1d; +MEM_U32(sp + 188) = v0; +f_demit_rrll(mem, sp, a0, a1, a2, a3); +goto L4219cc; +MEM_U32(sp + 188) = v0; +L4219cc: +gp = MEM_U32(sp + 176); +//nop; +goto L4219f0; +//nop; +L4219d8: +//nop; +a2 = MEM_U8(sp + 187); +MEM_U32(sp + 188) = a3; +f_demit_rrll(mem, sp, a0, a1, a2, a3); +goto L4219e8; +MEM_U32(sp + 188) = a3; +L4219e8: +gp = MEM_U32(sp + 176); +//nop; +L4219f0: +//nop; +a0 = 0x1b; +a1 = 0x9; +f_demit_i(mem, sp, a0, a1); +goto L421a00; +a1 = 0x9; +L421a00: +gp = MEM_U32(sp + 176); +a0 = MEM_U32(sp + 188); +//nop; +//nop; +//nop; +f_ddefine_label(mem, sp, a0); +goto L421a18; +//nop; +L421a18: +gp = MEM_U32(sp + 176); +//nop; +L421a20: +t6 = 0x100197bc; +t7 = MEM_U32(sp + 212); +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == 0) {t9 = MEM_U32(sp + 276); +goto L421b90;} +t9 = MEM_U32(sp + 276); +if (t7 == 0) {t9 = MEM_U32(sp + 276); +goto L421b90;} +t9 = MEM_U32(sp + 276); +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L421a50; +//nop; +L421a50: +gp = MEM_U32(sp + 176); +MEM_U32(sp + 188) = v0; +//nop; +a0 = v0; +//nop; +f_ddefine_label(mem, sp, a0); +goto L421a68; +//nop; +L421a68: +gp = MEM_U32(sp + 176); +a3 = MEM_U8(sp + 193); +t5 = 0x10019398; +a1 = MEM_U8(sp + 193); +t5 = MEM_U8(t5 + 0); +a2 = zero; +if (t5 == 0) {a0 = 0x56; +goto L421ae4;} +a0 = 0x56; +//nop; +a1 = MEM_U8(sp + 194); +a0 = 0x57; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L421a9c; +MEM_U32(sp + 16) = zero; +L421a9c: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(sp + 194); +//nop; +a3 = MEM_U8(sp + 193); +a0 = 0x57; +a2 = 0x4; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L421abc; +MEM_U32(sp + 16) = zero; +L421abc: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(sp + 193); +//nop; +a0 = 0x2; +a2 = 0x8; +a3 = zero; +f_demit_ri(mem, sp, a0, a1, a2, a3); +goto L421ad8; +a3 = zero; +L421ad8: +gp = MEM_U32(sp + 176); +//nop; +goto L421b3c; +//nop; +L421ae4: +//nop; +a2 = 0x8; +a3 = zero; +f_demit_ri(mem, sp, a0, a1, a2, a3); +goto L421af4; +a3 = zero; +L421af4: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(sp + 194); +//nop; +a3 = MEM_U8(sp + 193); +a0 = 0x57; +a2 = zero; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L421b14; +MEM_U32(sp + 16) = zero; +L421b14: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(sp + 194); +//nop; +a3 = MEM_U8(sp + 193); +a0 = 0x57; +a2 = 0x4; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L421b34; +MEM_U32(sp + 16) = zero; +L421b34: +gp = MEM_U32(sp + 176); +//nop; +L421b3c: +//nop; +a1 = MEM_U8(sp + 193); +a3 = MEM_U32(sp + 188); +a0 = 0x1a; +a2 = 0x1d; +f_demit_rrll(mem, sp, a0, a1, a2, a3); +goto L421b54; +a2 = 0x1d; +L421b54: +gp = MEM_U32(sp + 176); +a0 = MEM_U8(sp + 194); +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L421b6c; +//nop; +L421b6c: +gp = MEM_U32(sp + 176); +a0 = MEM_U8(sp + 193); +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L421b84; +//nop; +L421b84: +gp = MEM_U32(sp + 176); +//nop; +t9 = MEM_U32(sp + 276); +L421b90: +t8 = MEM_U8(sp + 235); +MEM_U32(sp + 20) = t9; +//nop; +t0 = MEM_U32(sp + 280); +a0 = MEM_U32(sp + 212); +a1 = MEM_U32(sp + 216); +a2 = MEM_U32(sp + 248); +a3 = MEM_U32(sp + 256); +MEM_U32(sp + 16) = t8; +MEM_U32(sp + 24) = t0; +f_gen_reg_save_restore(mem, sp, a0, a1, a2, a3); +goto L421bbc; +MEM_U32(sp + 24) = t0; +L421bbc: +t2 = MEM_U8(sp + 243); +gp = MEM_U32(sp + 176); +if (t2 == 0) {a0 = 0x31; +goto L421be4;} +a0 = 0x31; +//nop; +a2 = MEM_U8(sp + 187); +a1 = 0x17; +f_demit_rr(mem, sp, a0, a1, a2); +goto L421bdc; +a1 = 0x17; +L421bdc: +gp = MEM_U32(sp + 176); +//nop; +L421be4: +t3 = MEM_U32(sp + 212); +t1 = MEM_U8(sp + 235); +if (t3 == 0) {t7 = MEM_U32(sp + 272); +goto L421c98;} +t7 = MEM_U32(sp + 272); +if (t1 != 0) {t7 = MEM_U32(sp + 272); +goto L421c98;} +t7 = MEM_U32(sp + 272); +t4 = 0x10018e60; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L421c44;} +//nop; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L421c24; +//nop; +L421c24: +gp = MEM_U32(sp + 176); +a0 = v0; +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L421c3c; +//nop; +L421c3c: +gp = MEM_U32(sp + 176); +//nop; +L421c44: +t6 = 0x10019398; +a2 = MEM_U32(sp + 212); +t6 = MEM_U8(t6 + 0); +a0 = 0x2; +if (t6 == 0) {a1 = 0x1d; +goto L421c7c;} +a1 = 0x1d; +//nop; +a0 = 0x56; +a1 = 0x1d; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L421c70; +a3 = zero; +L421c70: +gp = MEM_U32(sp + 176); +t7 = MEM_U32(sp + 272); +goto L421c98; +t7 = MEM_U32(sp + 272); +L421c7c: +//nop; +a2 = MEM_U32(sp + 212); +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L421c8c; +a3 = zero; +L421c8c: +gp = MEM_U32(sp + 176); +//nop; +t7 = MEM_U32(sp + 272); +L421c98: +at = 0xffffffff; +if (t7 != at) {//nop; +goto L421cbc;} +//nop; +//nop; +a0 = 0x22; +a1 = 0x1f; +f_emit_r(mem, sp, a0, a1); +goto L421cb4; +a1 = 0x1f; +L421cb4: +gp = MEM_U32(sp + 176); +//nop; +L421cbc: +a1 = 0x10019380; +//nop; +a0 = MEM_U32(sp + 212); +a1 = MEM_U8(a1 + 0); +a2 = 0x1f; +f_demit_frame(mem, sp, a0, a1, a2); +goto L421cd4; +a2 = 0x1f; +L421cd4: +gp = MEM_U32(sp + 176); +//nop; +t5 = 0x10018ee8; +//nop; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L421d44;} +//nop; +t8 = 0x10019398; +a2 = MEM_U32(sp + 244); +t8 = MEM_U8(t8 + 0); +a0 = 0x56; +if (t8 == 0) {a1 = 0x1d; +goto L421d2c;} +a1 = 0x1d; +//nop; +a0 = 0x2; +a1 = 0x1d; +a3 = 0x6; +f_demit_ri(mem, sp, a0, a1, a2, a3); +goto L421d20; +a3 = 0x6; +L421d20: +gp = MEM_U32(sp + 176); +//nop; +goto L421d44; +//nop; +L421d2c: +//nop; +a2 = MEM_U32(sp + 244); +a3 = 0x6; +f_demit_ri(mem, sp, a0, a1, a2, a3); +goto L421d3c; +a3 = 0x6; +L421d3c: +gp = MEM_U32(sp + 176); +//nop; +L421d44: +t9 = 0x10018e60; +t0 = MEM_U8(sp + 255); +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == 0) {ra = MEM_U32(sp + 180); +goto L421da0;} +ra = MEM_U32(sp + 180); +if (t0 == 0) {a0 = 0x3c; +goto L421d84;} +a0 = 0x3c; +//nop; +a0 = 0x3c; +a1 = zero; +a2 = 0x1; +f_demit_dir1(mem, sp, a0, a1, a2); +goto L421d78; +a2 = 0x1; +L421d78: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L421da0; +ra = MEM_U32(sp + 180); +L421d84: +//nop; +a1 = zero; +a2 = zero; +f_demit_dir1(mem, sp, a0, a1, a2); +goto L421d94; +a2 = zero; +L421d94: +gp = MEM_U32(sp + 176); +//nop; +ra = MEM_U32(sp + 180); +L421da0: +sp = sp + 0xc8; +//nop; +return; +//nop; +} + +static void f_gen_entry(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L421dac: +//gen_entry: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 52) = a1; +MEM_U32(sp + 36) = ra; +a1 = MEM_U32(sp + 48); +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a2; +MEM_U32(sp + 60) = a3; +a0 = 0x2; +f_emit_dir0(mem, sp, a0, a1); +goto L421de4; +a0 = 0x2; +L421de4: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +//nop; +a2 = MEM_U32(sp + 52); +a0 = 0x2e; +f_emit_dir1(mem, sp, a0, a1, a2); +goto L421dfc; +a0 = 0x2e; +L421dfc: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 48); +//nop; +a0 = zero; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L421e14; +//nop; +L421e14: +gp = MEM_U32(sp + 32); +a0 = 0x19; +t6 = 0x10018ed8; +a1 = zero; +t6 = MEM_U32(t6 + 0); +//nop; +if ((int)t6 <= 0) {t7 = MEM_U32(sp + 56); +goto L421e50;} +t7 = MEM_U32(sp + 56); +//nop; +a2 = MEM_U32(sp + 48); +a3 = 0x1; +f_emit_cpload(mem, sp, a0, a1, a2, a3); +goto L421e44; +a3 = 0x1; +L421e44: +gp = MEM_U32(sp + 32); +//nop; +t7 = MEM_U32(sp + 56); +L421e50: +//nop; +if (t7 != 0) {//nop; +goto L421e60;} +//nop; +MEM_U32(sp + 68) = zero; +L421e60: +t8 = 0x100197bc; +t9 = MEM_U32(sp + 56); +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == 0) {t0 = MEM_U32(sp + 56); +goto L421ef0;} +t0 = MEM_U32(sp + 56); +if (t9 == 0) {t0 = MEM_U32(sp + 56); +goto L421ef0;} +t0 = MEM_U32(sp + 56); +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L421e90; +a1 = 0x1; +L421e90: +gp = MEM_U32(sp + 32); +MEM_U8(sp + 43) = (uint8_t)v0; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L421ea8; +a1 = 0x1; +L421ea8: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 43); +//nop; +a2 = 0xfffa0000; +MEM_U8(sp + 42) = (uint8_t)v0; +a2 = a2 | 0x5a5a; +a0 = 0x29; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L421ecc; +a3 = zero; +L421ecc: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 42); +//nop; +a0 = 0x31; +a2 = 0x1d; +f_emit_rr(mem, sp, a0, a1, a2); +goto L421ee4; +a2 = 0x1d; +L421ee4: +gp = MEM_U32(sp + 32); +//nop; +t0 = MEM_U32(sp + 56); +L421ef0: +//nop; +if (t0 == 0) {//nop; +goto L421f80;} +//nop; +t1 = 0x10019398; +a0 = 0x56; +t1 = MEM_U8(t1 + 0); +a1 = 0x1d; +if (t1 == 0) {//nop; +goto L421f68;} +//nop; +a1 = 0x10019380; +at = 0x1d; +a1 = MEM_U8(a1 + 0); +//nop; +if (a1 == at) {//nop; +goto L421f44;} +//nop; +//nop; +a0 = 0x31; +a2 = 0x1d; +f_demit_rr(mem, sp, a0, a1, a2); +goto L421f3c; +a2 = 0x1d; +L421f3c: +gp = MEM_U32(sp + 32); +//nop; +L421f44: +//nop; +a2 = MEM_U32(sp + 56); +a0 = 0x2; +a1 = 0x1d; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L421f5c; +a3 = zero; +L421f5c: +gp = MEM_U32(sp + 32); +//nop; +goto L421f80; +//nop; +L421f68: +//nop; +a2 = MEM_U32(sp + 56); +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L421f78; +a3 = zero; +L421f78: +gp = MEM_U32(sp + 32); +//nop; +L421f80: +t2 = 0x100197bc; +t3 = MEM_U32(sp + 56); +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L4220ec;} +//nop; +if (t3 == 0) {//nop; +goto L4220ec;} +//nop; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L421fb0; +//nop; +L421fb0: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 44) = v0; +//nop; +a0 = v0; +//nop; +f_define_label(mem, sp, a0); +goto L421fc8; +//nop; +L421fc8: +gp = MEM_U32(sp + 32); +a3 = MEM_U8(sp + 42); +t4 = 0x10019398; +a1 = MEM_U8(sp + 42); +t4 = MEM_U8(t4 + 0); +a2 = zero; +if (t4 == 0) {a0 = 0x56; +goto L422044;} +a0 = 0x56; +//nop; +a1 = MEM_U8(sp + 43); +a0 = 0x57; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L421ffc; +MEM_U32(sp + 16) = zero; +L421ffc: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 43); +//nop; +a3 = MEM_U8(sp + 42); +a0 = 0x57; +a2 = 0x4; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42201c; +MEM_U32(sp + 16) = zero; +L42201c: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 42); +//nop; +a0 = 0x2; +a2 = 0x8; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L422038; +a3 = zero; +L422038: +gp = MEM_U32(sp + 32); +//nop; +goto L42209c; +//nop; +L422044: +//nop; +a2 = 0x8; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L422054; +a3 = zero; +L422054: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 43); +//nop; +a3 = MEM_U8(sp + 42); +a0 = 0x57; +a2 = zero; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L422074; +MEM_U32(sp + 16) = zero; +L422074: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 43); +//nop; +a3 = MEM_U8(sp + 42); +a0 = 0x57; +a2 = 0x4; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L422094; +MEM_U32(sp + 16) = zero; +L422094: +gp = MEM_U32(sp + 32); +//nop; +L42209c: +//nop; +a1 = MEM_U8(sp + 42); +a3 = MEM_U32(sp + 44); +a0 = 0x1a; +a2 = 0x1d; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L4220b4; +a2 = 0x1d; +L4220b4: +gp = MEM_U32(sp + 32); +a0 = MEM_U8(sp + 43); +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L4220cc; +//nop; +L4220cc: +gp = MEM_U32(sp + 32); +a0 = MEM_U8(sp + 42); +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L4220e4; +//nop; +L4220e4: +gp = MEM_U32(sp + 32); +//nop; +L4220ec: +//nop; +a0 = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 60); +a2 = MEM_U32(sp + 68); +a3 = MEM_U32(sp + 64); +//nop; +f_gen_reg_save(mem, sp, a0, a1, a2, a3); +goto L422108; +//nop; +L422108: +gp = MEM_U32(sp + 32); +a2 = MEM_U32(sp + 56); +t5 = 0x10019394; +a0 = 0x6d; +t5 = MEM_U8(t5 + 0); +a1 = 0x4; +if (t5 == 0) {ra = MEM_U32(sp + 36); +goto L422168;} +ra = MEM_U32(sp + 36); +//nop; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L422138; +MEM_U32(sp + 16) = zero; +L422138: +gp = MEM_U32(sp + 32); +a2 = MEM_U32(sp + 56); +//nop; +a0 = 0x6d; +a1 = 0x6; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +a2 = a2 + 0x8; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42215c; +a2 = a2 + 0x8; +L42215c: +gp = MEM_U32(sp + 32); +//nop; +ra = MEM_U32(sp + 36); +L422168: +sp = sp + 0x30; +//nop; +return; +//nop; +} + +static void f_clear_saved_regs(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L422174: +//clear_saved_regs: +//nop; +//nop; +//nop; +at = 0x100197b0; +//nop; +MEM_U32(at + 0) = zero; +at = 0x100197b0; +//nop; +MEM_U32(at + 4) = zero; +at = 0x100197b0; +MEM_U32(at + 8) = zero; +return; +MEM_U32(at + 8) = zero; +} + +static uint32_t f_is_empty_saved_regs(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4221a4: +//is_empty_saved_regs: +//nop; +//nop; +//nop; +t6 = 0x100197b0; +t7 = 0x100197b0; +t9 = 0x100197b0; +t6 = MEM_U32(t6 + 8); +t7 = MEM_U32(t7 + 4); +t9 = MEM_U32(t9 + 0); +t8 = t6 | t7; +v0 = t8 | t9; +t0 = v0 < 0x1; +v0 = t0; +return v0; +v0 = t0; +} + +static void f_home_parameters(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4221dc: +//home_parameters: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb8; +v0 = 0x10019310; +MEM_U32(sp + 52) = s6; +v0 = MEM_U32(v0 + 0); +MEM_U32(sp + 44) = s4; +MEM_U32(sp + 36) = s2; +s6 = a0; +MEM_U32(sp + 68) = ra; +MEM_U32(sp + 64) = fp; +MEM_U32(sp + 60) = gp; +MEM_U32(sp + 56) = s7; +MEM_U32(sp + 48) = s5; +MEM_U32(sp + 40) = s3; +MEM_U32(sp + 32) = s1; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 76) = a1; +s2 = 0x4; +if (v0 == 0) {s4 = zero; +goto L4223ec;} +s4 = zero; +fp = 0x10019398; +s5 = 0x100197b0; +s3 = 0x10018ed0; +s1 = 0x10019394; +//nop; +L422248: +t6 = MEM_U8(s3 + 0); +t7 = s2 < 0x60; +if (t6 != 0) {//nop; +goto L422314;} +//nop; +if (t7 == 0) {t8 = (int)s2 >> 5; +goto L422278;} +t8 = (int)s2 >> 5; +t9 = t8 << 2; +t0 = s5 + t9; +t1 = MEM_U32(t0 + 0); +//nop; +t2 = t1 << (s2 & 0x1f); +t7 = (int)t2 < (int)0x0; +L422278: +if (t7 != 0) {//nop; +goto L422290;} +//nop; +t4 = MEM_U8(s1 + 0); +//nop; +if (t4 == 0) {//nop; +goto L4223d4;} +//nop; +L422290: +t6 = MEM_U8(fp + 0); +t5 = s4 << 2; +if (t6 == 0) {s0 = s6 + t5; +goto L4222dc;} +s0 = s6 + t5; +//nop; +t8 = 0xfffffffc; +a2 = t8 - s0; +a0 = 0x57; +a1 = s2; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L4222c0; +MEM_U32(sp + 16) = zero; +L4222c0: +gp = MEM_U32(sp + 60); +//nop; +v0 = 0x10019310; +//nop; +v0 = MEM_U32(v0 + 0); +s2 = s2 + 0x1; +goto L4223d8; +s2 = s2 + 0x1; +L4222dc: +//nop; +a0 = 0x57; +a1 = s2; +a2 = s0; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L4222f8; +MEM_U32(sp + 16) = zero; +L4222f8: +gp = MEM_U32(sp + 60); +//nop; +v0 = 0x10019310; +//nop; +v0 = MEM_U32(v0 + 0); +s2 = s2 + 0x1; +goto L4223d8; +s2 = s2 + 0x1; +L422314: +t9 = s2 < 0x60; +if (t9 == 0) {t0 = (int)s2 >> 5; +goto L422338;} +t0 = (int)s2 >> 5; +t1 = t0 << 2; +t2 = s5 + t1; +t3 = MEM_U32(t2 + 0); +//nop; +t7 = t3 << (s2 & 0x1f); +t9 = (int)t7 < (int)0x0; +L422338: +if (t9 != 0) {//nop; +goto L422350;} +//nop; +t5 = MEM_U8(s1 + 0); +//nop; +if (t5 == 0) {//nop; +goto L4223d4;} +//nop; +L422350: +t6 = MEM_U8(fp + 0); +a0 = 0x6d; +if (t6 == 0) {a1 = s2; +goto L4223a4;} +a1 = s2; +//nop; +t8 = s4 << 3; +t0 = s6 + t8; +t1 = 0xfffffff8; +a2 = t1 - t0; +a0 = 0x6d; +a1 = s2; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422388; +MEM_U32(sp + 16) = zero; +L422388: +gp = MEM_U32(sp + 60); +//nop; +v0 = 0x10019310; +//nop; +v0 = MEM_U32(v0 + 0); +s2 = s2 + 0x1; +goto L4223d8; +s2 = s2 + 0x1; +L4223a4: +//nop; +t2 = s4 << 2; +a2 = s6 + t2; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L4223bc; +MEM_U32(sp + 16) = zero; +L4223bc: +gp = MEM_U32(sp + 60); +//nop; +v0 = 0x10019310; +//nop; +v0 = MEM_U32(v0 + 0); +//nop; +L4223d4: +s2 = s2 + 0x1; +L4223d8: +s4 = s4 + 0x1; +t3 = s2 & 0xff; +if (s4 != v0) {s2 = t3; +goto L422248;} +s2 = t3; +s4 = zero; +L4223ec: +v0 = 0x10019314; +s5 = 0x100197b0; +v0 = MEM_U32(v0 + 0); +fp = 0x10019398; +s2 = 0x2c; +s0 = zero; +if (v0 == 0) {v1 = 0x3e; +goto L422584;} +v1 = 0x3e; +s7 = 0x7a; +L422410: +t7 = s2 < 0x60; +if (t7 == 0) {s3 = 0x79; +goto L422438;} +s3 = 0x79; +t4 = (int)s2 >> 5; +t9 = t4 << 2; +t5 = s5 + t9; +t6 = MEM_U32(t5 + 0); +//nop; +t8 = t6 << (s2 & 0x1f); +t7 = (int)t8 < (int)0x0; +L422438: +if (t7 == 0) {//nop; +goto L42255c;} +//nop; +t0 = MEM_U8(fp + 0); +t1 = s2 + 0x1; +if (t0 == 0) {t7 = t1 < 0x60; +goto L4224d8;} +t7 = t1 < 0x60; +//nop; +s1 = s6 + s0; +s1 = -s1; +a2 = s1 + 0xfffffffc; +a0 = 0x79; +a1 = s2; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422474; +MEM_U32(sp + 16) = zero; +L422474: +a1 = s2 + 0x1; +gp = MEM_U32(sp + 60); +t2 = a1 < 0x60; +if (t2 == 0) {t3 = (int)a1 >> 5; +goto L4224a0;} +t3 = (int)a1 >> 5; +t4 = t3 << 2; +t9 = s5 + t4; +t5 = MEM_U32(t9 + 0); +//nop; +t6 = t5 << (a1 & 0x1f); +t2 = (int)t6 < (int)0x0; +L4224a0: +if (t2 == 0) {a0 = 0x79; +goto L4224c4;} +a0 = 0x79; +//nop; +a2 = s1 + 0xfffffff8; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L4224bc; +MEM_U32(sp + 16) = zero; +L4224bc: +gp = MEM_U32(sp + 60); +s0 = s0 + 0x4; +L4224c4: +v0 = 0x10019314; +//nop; +v0 = MEM_U32(v0 + 0); +s2 = s2 + 0x2; +goto L422560; +s2 = s2 + 0x2; +L4224d8: +if (t7 == 0) {a1 = s2; +goto L4224fc;} +a1 = s2; +t0 = (int)t1 >> 5; +t3 = t0 << 2; +t4 = s5 + t3; +t9 = MEM_U32(t4 + 0); +//nop; +t5 = t9 << (t1 & 0x1f); +t7 = (int)t5 < (int)0x0; +L4224fc: +if (t7 == 0) {a3 = 0x1d; +goto L422508;} +a3 = 0x1d; +s3 = s7 & 0xffff; +L422508: +if (s3 != s7) {a0 = s3; +goto L422534;} +a0 = s3; +at = 0x79; +if (v1 != at) {//nop; +goto L422534;} +//nop; +s0 = s0 + 0x7; +if ((int)s0 >= 0) {t8 = (int)s0 >> 3; +goto L422530;} +t8 = (int)s0 >> 3; +at = s0 + 0x7; +t8 = (int)at >> 3; +L422530: +s0 = t8 << 3; +L422534: +//nop; +a2 = s6 + s0; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422544; +MEM_U32(sp + 16) = zero; +L422544: +gp = MEM_U32(sp + 60); +//nop; +v0 = 0x10019314; +//nop; +v0 = MEM_U32(v0 + 0); +//nop; +L42255c: +s2 = s2 + 0x2; +L422560: +t0 = s2 & 0xff; +s4 = s4 + 0x1; +if (s3 != s7) {s2 = t0; +goto L422578;} +s2 = t0; +s0 = s0 + 0x8; +goto L42257c; +s0 = s0 + 0x8; +L422578: +s0 = s0 + 0x4; +L42257c: +if (s4 != v0) {v1 = s3 & 0xffff; +goto L422410;} +v1 = s3 & 0xffff; +L422584: +t3 = MEM_U32(sp + 76); +at = 0xffffffff; +if (t3 == at) {at = 0xffff0000; +goto L4226ac;} +at = 0xffff0000; +s0 = t3 & at; +t4 = s0 >> 16; +if (t4 == 0) {s0 = t4; +goto L4226ac;} +s0 = t4; +t9 = t3 & 0xffff; +if (t9 != 0) {//nop; +goto L42262c;} +//nop; +t1 = MEM_U8(fp + 0); +a0 = 0x7a; +if (t1 == 0) {a1 = 0x2c; +goto L422610;} +a1 = 0x2c; +//nop; +s1 = s6 - t4; +s1 = -s1; +a2 = s1 + 0xfffffffc; +a0 = 0x79; +a1 = 0x2c; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L4225e4; +MEM_U32(sp + 16) = zero; +L4225e4: +gp = MEM_U32(sp + 60); +a0 = 0x79; +//nop; +a1 = 0x2d; +a2 = s1 + 0xfffffff8; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422604; +MEM_U32(sp + 16) = zero; +L422604: +gp = MEM_U32(sp + 60); +t5 = MEM_U8(fp + 0); +goto L422630; +t5 = MEM_U8(fp + 0); +L422610: +//nop; +a2 = s6 - s0; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422624; +MEM_U32(sp + 16) = zero; +L422624: +gp = MEM_U32(sp + 60); +//nop; +L42262c: +t5 = MEM_U8(fp + 0); +L422630: +v0 = s0 + 0x8; +if (t5 == 0) {a0 = 0x7a; +goto L42268c;} +a0 = 0x7a; +//nop; +s0 = s6 - v0; +s0 = -s0; +a2 = s0 + 0xfffffffc; +a0 = 0x79; +a1 = 0x2e; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422660; +MEM_U32(sp + 16) = zero; +L422660: +gp = MEM_U32(sp + 60); +a0 = 0x79; +//nop; +a1 = 0x2f; +a2 = s0 + 0xfffffff8; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422680; +MEM_U32(sp + 16) = zero; +L422680: +gp = MEM_U32(sp + 60); +ra = MEM_U32(sp + 68); +goto L4226b0; +ra = MEM_U32(sp + 68); +L42268c: +//nop; +a1 = 0x2e; +a2 = s6 - v0; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L4226a4; +MEM_U32(sp + 16) = zero; +L4226a4: +gp = MEM_U32(sp + 60); +//nop; +L4226ac: +ra = MEM_U32(sp + 68); +L4226b0: +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +s3 = MEM_U32(sp + 40); +s4 = MEM_U32(sp + 44); +s5 = MEM_U32(sp + 48); +s6 = MEM_U32(sp + 52); +s7 = MEM_U32(sp + 56); +fp = MEM_U32(sp + 64); +sp = sp + 0x48; +return; +sp = sp + 0x48; +} + +static void f_gen_reg_save_restore(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4226dc: +//gen_reg_save_restore: +//nop; +//nop; +//nop; +sp = sp + 0xffffffa8; +MEM_U32(sp + 44) = s4; +s4 = 0x10019398; +MEM_U32(sp + 52) = ra; +v1 = MEM_U8(s4 + 0); +MEM_U32(sp + 48) = gp; +MEM_U32(sp + 40) = s3; +MEM_U32(sp + 36) = s2; +MEM_U32(sp + 32) = s1; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 88) = a0; +if (v1 == 0) {MEM_U32(sp + 72) = zero; +goto L422734;} +MEM_U32(sp + 72) = zero; +t6 = a1 + a2; +v0 = t6 + a3; +t8 = v0 + 0xfffffffc; +s1 = a0 - v0; +MEM_U32(sp + 64) = t8; +goto L42274c; +MEM_U32(sp + 64) = t8; +L422734: +t9 = MEM_U32(sp + 88); +v0 = a1 + a2; +t0 = 0xfffffffc; +t1 = t0 - v0; +MEM_U32(sp + 64) = t1; +s1 = t9 - v0; +L42274c: +t2 = MEM_U32(sp + 112); +at = 0xffffffff; +if (t2 == at) {MEM_U32(sp + 68) = zero; +goto L4227d8;} +MEM_U32(sp + 68) = zero; +t4 = 0x10018ed0; +t3 = 0x80000000; +t4 = MEM_U8(t4 + 0); +MEM_U32(sp + 72) = t3; +if (t4 != 0) {MEM_U32(sp + 64) = t2; +goto L4227a0;} +MEM_U32(sp + 64) = t2; +t5 = MEM_U32(sp + 88); +//nop; +a0 = 0x57; +a1 = 0x1f; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +a2 = t5 + t2; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422794; +a2 = t5 + t2; +L422794: +gp = MEM_U32(sp + 48); +//nop; +goto L4227cc; +//nop; +L4227a0: +t6 = MEM_U32(sp + 88); +t7 = MEM_U32(sp + 112); +//nop; +a0 = 0x6d; +a1 = 0x1f; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +a2 = t6 + t7; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L4227c4; +a2 = t6 + t7; +L4227c4: +gp = MEM_U32(sp + 48); +//nop; +L4227cc: +s3 = 0x100197b0; +t4 = MEM_U32(s3 + 0); +goto L4228c4; +t4 = MEM_U32(s3 + 0); +L4227d8: +s3 = 0x100197b0; +t0 = 0x80000000; +t8 = MEM_U32(s3 + 0); +//nop; +t9 = t8 << 31; +if ((int)t9 >= 0) {//nop; +goto L4228c0;} +//nop; +if (v1 == 0) {MEM_U32(sp + 72) = t0; +goto L422860;} +MEM_U32(sp + 72) = t0; +t1 = 0x10018ed0; +a0 = 0x6d; +t1 = MEM_U8(t1 + 0); +a1 = 0x1f; +if (t1 != 0) {a3 = 0x1d; +goto L422840;} +a3 = 0x1d; +//nop; +s1 = s1 + 0x4; +a2 = -s1; +a0 = 0x57; +a1 = 0x1f; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422834; +MEM_U32(sp + 16) = zero; +L422834: +gp = MEM_U32(sp + 48); +t4 = MEM_U32(s3 + 0); +goto L4228c4; +t4 = MEM_U32(s3 + 0); +L422840: +//nop; +s1 = s1 + 0x8; +a2 = -s1; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422854; +MEM_U32(sp + 16) = zero; +L422854: +gp = MEM_U32(sp + 48); +t4 = MEM_U32(s3 + 0); +goto L4228c4; +t4 = MEM_U32(s3 + 0); +L422860: +t3 = 0x10018ed0; +a0 = 0x6d; +t3 = MEM_U8(t3 + 0); +a1 = 0x1f; +if (t3 != 0) {a3 = 0x1d; +goto L4228a4;} +a3 = 0x1d; +//nop; +s1 = s1 + 0xfffffffc; +a2 = s1; +a0 = 0x57; +a1 = 0x1f; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422898; +MEM_U32(sp + 16) = zero; +L422898: +gp = MEM_U32(sp + 48); +t4 = MEM_U32(s3 + 0); +goto L4228c4; +t4 = MEM_U32(s3 + 0); +L4228a4: +//nop; +s1 = s1 + 0xfffffff8; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L4228b8; +MEM_U32(sp + 16) = zero; +L4228b8: +gp = MEM_U32(sp + 48); +//nop; +L4228c0: +t4 = MEM_U32(s3 + 0); +L4228c4: +//nop; +t5 = t4 << 30; +if ((int)t5 >= 0) {//nop; +goto L4229b8;} +//nop; +t2 = MEM_U8(s4 + 0); +//nop; +if (t2 == 0) {//nop; +goto L422948;} +//nop; +t6 = 0x10018ed0; +a0 = 0x6d; +t6 = MEM_U8(t6 + 0); +a1 = 0x1e; +if (t6 != 0) {a3 = 0x1d; +goto L422928;} +a3 = 0x1d; +//nop; +s1 = s1 + 0x4; +a2 = -s1; +a0 = 0x57; +a1 = 0x1e; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L42291c; +MEM_U32(sp + 16) = zero; +L42291c: +gp = MEM_U32(sp + 48); +t8 = MEM_U32(sp + 72); +goto L4229ac; +t8 = MEM_U32(sp + 72); +L422928: +//nop; +s1 = s1 + 0x8; +a2 = -s1; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L42293c; +MEM_U32(sp + 16) = zero; +L42293c: +gp = MEM_U32(sp + 48); +t8 = MEM_U32(sp + 72); +goto L4229ac; +t8 = MEM_U32(sp + 72); +L422948: +t7 = 0x10018ed0; +a0 = 0x6d; +t7 = MEM_U8(t7 + 0); +a1 = 0x1e; +if (t7 != 0) {a3 = 0x1d; +goto L42298c;} +a3 = 0x1d; +//nop; +s1 = s1 + 0xfffffffc; +a2 = s1; +a0 = 0x57; +a1 = 0x1e; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422980; +MEM_U32(sp + 16) = zero; +L422980: +gp = MEM_U32(sp + 48); +t8 = MEM_U32(sp + 72); +goto L4229ac; +t8 = MEM_U32(sp + 72); +L42298c: +//nop; +s1 = s1 + 0xfffffff8; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L4229a0; +MEM_U32(sp + 16) = zero; +L4229a0: +gp = MEM_U32(sp + 48); +//nop; +t8 = MEM_U32(sp + 72); +L4229ac: +at = 0x40000000; +t9 = t8 | at; +MEM_U32(sp + 72) = t9; +L4229b8: +t0 = 0x10018ed8; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if ((int)t0 <= 0) {//nop; +goto L422b18;} +//nop; +t1 = MEM_U32(s3 + 0); +//nop; +t3 = t1 << 28; +if ((int)t3 >= 0) {//nop; +goto L422ae8;} +//nop; +t4 = MEM_U8(s4 + 0); +a0 = 0xf; +if (t4 == 0) {//nop; +goto L422a6c;} +//nop; +//nop; +s1 = s1 + 0x4; +s0 = -s1; +a1 = s0; +a0 = 0xf; +f_demit_dir0(mem, sp, a0, a1); +goto L422a0c; +a0 = 0xf; +L422a0c: +gp = MEM_U32(sp + 48); +//nop; +v1 = 0x10019820; +//nop; +v0 = MEM_U32(v1 + 0); +//nop; +if (v0 == 0) {t6 = MEM_U32(sp + 72); +goto L422ad8;} +t6 = MEM_U32(sp + 72); +a0 = 0x10018e6c; +a1 = 0x100197d0; +a0 = MEM_U32(a0 + 0); +a1 = a1 + 0xfffffffc; +L422a3c: +t5 = v0 << 2; +t2 = a1 + t5; +t6 = MEM_U32(t2 + 0); +t9 = v0 + 0xffffffff; +t7 = t6 << 4; +t8 = a0 + t7; +MEM_U32(t8 + -4) = s0; +MEM_U32(v1 + 0) = t9; +if (t9 != 0) {v0 = t9; +goto L422a3c;} +v0 = t9; +t6 = MEM_U32(sp + 72); +goto L422ad8; +t6 = MEM_U32(sp + 72); +L422a6c: +//nop; +s1 = s1 + 0xfffffffc; +a1 = s1; +f_demit_dir0(mem, sp, a0, a1); +goto L422a7c; +a1 = s1; +L422a7c: +gp = MEM_U32(sp + 48); +//nop; +v1 = 0x10019820; +//nop; +v0 = MEM_U32(v1 + 0); +//nop; +if (v0 == 0) {t6 = MEM_U32(sp + 72); +goto L422ad8;} +t6 = MEM_U32(sp + 72); +a0 = 0x10018e6c; +a1 = 0x100197d0; +a0 = MEM_U32(a0 + 0); +a1 = a1 + 0xfffffffc; +L422aac: +t0 = v0 << 2; +t1 = a1 + t0; +t3 = MEM_U32(t1 + 0); +t2 = v0 + 0xffffffff; +t4 = t3 << 4; +t5 = a0 + t4; +MEM_U32(t5 + -4) = s1; +MEM_U32(v1 + 0) = t2; +if (t2 != 0) {v0 = t2; +goto L422aac;} +v0 = t2; +t6 = MEM_U32(sp + 72); +L422ad8: +at = 0x10000000; +t7 = t6 | at; +MEM_U32(sp + 72) = t7; +goto L422b18; +MEM_U32(sp + 72) = t7; +L422ae8: +t8 = 0x10018ee4; +//nop; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L422b18;} +//nop; +//nop; +a0 = 0x1e; +//nop; +f_demit_cpalias(mem, sp, a0); +goto L422b10; +//nop; +L422b10: +gp = MEM_U32(sp + 48); +//nop; +L422b18: +//nop; +a0 = MEM_U32(sp + 88); +a1 = MEM_U32(sp + 108); +//nop; +f_home_parameters(mem, sp, a0, a1); +goto L422b2c; +//nop; +L422b2c: +gp = MEM_U32(sp + 48); +s2 = zero; +v0 = 0x10019318; +//nop; +v0 = MEM_U32(v0 + 0); +//nop; +s0 = v0 + 0xf; +t9 = s0 & 0xff; +if (v0 == 0) {s0 = t9; +goto L422ca4;} +s0 = t9; +L422b54: +t0 = s0 < 0x60; +if (t0 == 0) {t1 = (int)s0 >> 5; +goto L422b78;} +t1 = (int)s0 >> 5; +t3 = t1 << 2; +t4 = s3 + t3; +t5 = MEM_U32(t4 + 0); +//nop; +t2 = t5 << (s0 & 0x1f); +t0 = (int)t2 < (int)0x0; +L422b78: +if (t0 == 0) {t8 = 0x1; +goto L422c8c;} +t8 = 0x1; +t7 = MEM_U32(sp + 72); +t3 = MEM_U8(s4 + 0); +t9 = t8 << (s0 & 0x1f); +t1 = t7 | t9; +if (t3 == 0) {MEM_U32(sp + 72) = t1; +goto L422c0c;} +MEM_U32(sp + 72) = t1; +t4 = 0x10018ed0; +a0 = 0x6d; +t4 = MEM_U8(t4 + 0); +a1 = s0; +if (t4 != 0) {a3 = 0x1d; +goto L422bdc;} +a3 = 0x1d; +//nop; +s1 = s1 + 0x4; +a2 = -s1; +a0 = 0x57; +a1 = s0; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422bd0; +MEM_U32(sp + 16) = zero; +L422bd0: +gp = MEM_U32(sp + 48); +//nop; +goto L422bf8; +//nop; +L422bdc: +//nop; +s1 = s1 + 0x8; +a2 = -s1; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422bf0; +MEM_U32(sp + 16) = zero; +L422bf0: +gp = MEM_U32(sp + 48); +//nop; +L422bf8: +v0 = 0x10019318; +//nop; +v0 = MEM_U32(v0 + 0); +s0 = s0 + 0xffffffff; +goto L422c90; +s0 = s0 + 0xffffffff; +L422c0c: +t5 = 0x10018ed0; +a0 = 0x6d; +t5 = MEM_U8(t5 + 0); +a1 = s0; +if (t5 != 0) {a3 = 0x1d; +goto L422c60;} +a3 = 0x1d; +//nop; +s1 = s1 + 0xfffffffc; +a2 = s1; +a0 = 0x57; +a1 = s0; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422c44; +MEM_U32(sp + 16) = zero; +L422c44: +gp = MEM_U32(sp + 48); +//nop; +v0 = 0x10019318; +//nop; +v0 = MEM_U32(v0 + 0); +s0 = s0 + 0xffffffff; +goto L422c90; +s0 = s0 + 0xffffffff; +L422c60: +//nop; +s1 = s1 + 0xfffffff8; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422c74; +MEM_U32(sp + 16) = zero; +L422c74: +gp = MEM_U32(sp + 48); +//nop; +v0 = 0x10019318; +//nop; +v0 = MEM_U32(v0 + 0); +//nop; +L422c8c: +s0 = s0 + 0xffffffff; +L422c90: +s2 = s2 + 0x1; +t2 = s0 & 0xff; +if (s2 != v0) {s0 = t2; +goto L422b54;} +s0 = t2; +s2 = zero; +L422ca4: +v0 = 0x1001931c; +v1 = 0x1; +v0 = MEM_U32(v0 + 0); +MEM_U8(sp + 58) = (uint8_t)zero; +s0 = v0 << 1; +s0 = s0 + 0x32; +t6 = s0 & 0xff; +s0 = t6; +if ((int)s1 >= 0) {t0 = (int)s1 >> 2; +goto L422cd4;} +t0 = (int)s1 >> 2; +at = s1 + 0x3; +t0 = (int)at >> 2; +L422cd4: +t8 = t0 & 0x1; +if (t8 == 0) {t7 = 0x1; +goto L422ce8;} +t7 = 0x1; +s1 = s1 + 0xfffffffc; +MEM_U8(sp + 58) = (uint8_t)t7; +L422ce8: +if (v0 == 0) {t9 = s0 < 0x60; +goto L422ddc;} +L422cec: +t9 = s0 < 0x60; +if (t9 == 0) {t1 = (int)s0 >> 5; +goto L422d10;} +t1 = (int)s0 >> 5; +t3 = t1 << 2; +t4 = s3 + t3; +t5 = MEM_U32(t4 + 0); +//nop; +t2 = t5 << (s0 & 0x1f); +t9 = (int)t2 < (int)0x0; +L422d10: +if (t9 == 0) {t8 = 0x3; +goto L422dbc;} +t8 = 0x3; +t0 = MEM_U32(sp + 68); +t3 = MEM_U8(s4 + 0); +t7 = t8 << (s0 & 0x1f); +t1 = t0 | t7; +if (t3 == 0) {MEM_U32(sp + 68) = t1; +goto L422d78;} +MEM_U32(sp + 68) = t1; +//nop; +s1 = s1 + 0x8; +a2 = -s1; +a0 = 0x7a; +a1 = s0; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +MEM_U8(sp + 59) = (uint8_t)v1; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422d54; +MEM_U8(sp + 59) = (uint8_t)v1; +L422d54: +v1 = MEM_U8(sp + 59); +gp = MEM_U32(sp + 48); +if (v1 == 0) {//nop; +goto L422dbc;} +//nop; +t4 = MEM_U32(sp + 88); +v1 = zero; +t5 = t4 - s1; +MEM_U32(sp + 60) = t5; +goto L422dbc; +MEM_U32(sp + 60) = t5; +L422d78: +//nop; +s1 = s1 + 0xfffffff8; +a2 = s1; +a0 = 0x7a; +a1 = s0; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +MEM_U8(sp + 59) = (uint8_t)v1; +f_demit_rob_(mem, sp, a0, a1, a2, a3); +goto L422d9c; +MEM_U8(sp + 59) = (uint8_t)v1; +L422d9c: +v1 = MEM_U8(sp + 59); +gp = MEM_U32(sp + 48); +if (v1 == 0) {//nop; +goto L422dbc;} +//nop; +t2 = MEM_U32(sp + 88); +v1 = zero; +t6 = s1 - t2; +MEM_U32(sp + 60) = t6; +L422dbc: +t8 = 0x1001931c; +s0 = s0 + 0xfffffffe; +t8 = MEM_U32(t8 + 0); +s2 = s2 + 0x1; +t9 = s0 & 0xff; +if (s2 != t8) {s0 = t9; +goto L422cec;} +s0 = t9; +s2 = zero; +L422ddc: +a3 = 0x10019380; +at = 0x1d; +a3 = MEM_U8(a3 + 0); +//nop; +if (a3 == at) {//nop; +goto L422e48;} +//nop; +t0 = MEM_U8(s4 + 0); +a0 = 0x31; +if (t0 != 0) {t7 = MEM_U8(sp + 107); +goto L422e20;} +t7 = MEM_U8(sp + 107); +//nop; +a1 = a3; +a2 = 0x1d; +f_demit_rr(mem, sp, a0, a1, a2); +goto L422e14; +a2 = 0x1d; +L422e14: +gp = MEM_U32(sp + 48); +//nop; +t7 = MEM_U8(sp + 107); +L422e20: +a0 = 0x31; +if (t7 != 0) {//nop; +goto L422e48;} +//nop; +a2 = 0x10019380; +//nop; +a2 = MEM_U8(a2 + 0); +a1 = 0x1d; +f_emit_rr(mem, sp, a0, a1, a2); +goto L422e40; +a1 = 0x1d; +L422e40: +gp = MEM_U32(sp + 48); +//nop; +L422e48: +v0 = 0x1001931c; +s0 = 0x34; +v0 = MEM_U32(v0 + 0); +//nop; +if (v0 == 0) {t1 = s0 < 0x60; +goto L422f14;} +L422e5c: +t1 = s0 < 0x60; +if (t1 == 0) {t3 = (int)s0 >> 5; +goto L422e80;} +t3 = (int)s0 >> 5; +t4 = t3 << 2; +t5 = s3 + t4; +t2 = MEM_U32(t5 + 0); +//nop; +t6 = t2 << (s0 & 0x1f); +t1 = (int)t6 < (int)0x0; +L422e80: +if (t1 == 0) {//nop; +goto L422efc;} +//nop; +a3 = 0x10019380; +t8 = MEM_U8(s4 + 0); +a3 = MEM_U8(a3 + 0); +if (t8 == 0) {a0 = 0x77; +goto L422ed0;} +a0 = 0x77; +//nop; +a0 = 0x77; +a1 = s0; +a2 = -s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L422eb4; +MEM_U32(sp + 16) = zero; +L422eb4: +gp = MEM_U32(sp + 48); +s1 = s1 + 0xfffffff8; +v0 = 0x1001931c; +//nop; +v0 = MEM_U32(v0 + 0); +s0 = s0 + 0x2; +goto L422f00; +s0 = s0 + 0x2; +L422ed0: +//nop; +a1 = s0; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L422ee4; +MEM_U32(sp + 16) = zero; +L422ee4: +gp = MEM_U32(sp + 48); +s1 = s1 + 0x8; +v0 = 0x1001931c; +//nop; +v0 = MEM_U32(v0 + 0); +//nop; +L422efc: +s0 = s0 + 0x2; +L422f00: +s2 = s2 + 0x1; +t0 = s0 & 0xff; +if (s2 != v0) {s0 = t0; +goto L422e5c;} +s0 = t0; +s2 = zero; +L422f14: +v0 = 0x10019318; +t7 = MEM_U8(sp + 58); +v0 = MEM_U32(v0 + 0); +if (t7 == 0) {//nop; +goto L422f2c;} +//nop; +s1 = s1 + 0x4; +L422f2c: +if (v0 == 0) {s0 = 0x10; +goto L42309c;} +s0 = 0x10; +L422f34: +t3 = 0x10018ed0; +t4 = s0 < 0x60; +t3 = MEM_U8(t3 + 0); +t7 = s0 < 0x60; +if (t3 != 0) {//nop; +goto L422fec;} +//nop; +if (t4 == 0) {t5 = (int)s0 >> 5; +goto L422f6c;} +t5 = (int)s0 >> 5; +t2 = t5 << 2; +t6 = s3 + t2; +t9 = MEM_U32(t6 + 0); +//nop; +t1 = t9 << (s0 & 0x1f); +t4 = (int)t1 < (int)0x0; +L422f6c: +if (t4 == 0) {//nop; +goto L423088;} +//nop; +a3 = 0x10019380; +t0 = MEM_U8(s4 + 0); +a3 = MEM_U8(a3 + 0); +if (t0 == 0) {a0 = 0x2a; +goto L422fbc;} +a0 = 0x2a; +//nop; +a0 = 0x2a; +a1 = s0; +a2 = -s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L422fa0; +MEM_U32(sp + 16) = zero; +L422fa0: +gp = MEM_U32(sp + 48); +s1 = s1 + 0xfffffffc; +v0 = 0x10019318; +//nop; +v0 = MEM_U32(v0 + 0); +s0 = s0 + 0x1; +goto L42308c; +s0 = s0 + 0x1; +L422fbc: +//nop; +a1 = s0; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L422fd0; +MEM_U32(sp + 16) = zero; +L422fd0: +gp = MEM_U32(sp + 48); +s1 = s1 + 0x4; +v0 = 0x10019318; +//nop; +v0 = MEM_U32(v0 + 0); +s0 = s0 + 0x1; +goto L42308c; +s0 = s0 + 0x1; +L422fec: +if (t7 == 0) {t3 = (int)s0 >> 5; +goto L42300c;} +t3 = (int)s0 >> 5; +t5 = t3 << 2; +t2 = s3 + t5; +t6 = MEM_U32(t2 + 0); +//nop; +t9 = t6 << (s0 & 0x1f); +t7 = (int)t9 < (int)0x0; +L42300c: +if (t7 == 0) {//nop; +goto L423088;} +//nop; +a3 = 0x10019380; +t8 = MEM_U8(s4 + 0); +a3 = MEM_U8(a3 + 0); +if (t8 == 0) {a0 = 0x6c; +goto L42305c;} +a0 = 0x6c; +//nop; +a0 = 0x6c; +a1 = s0; +a2 = -s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423040; +MEM_U32(sp + 16) = zero; +L423040: +gp = MEM_U32(sp + 48); +s1 = s1 + 0xfffffff8; +v0 = 0x10019318; +//nop; +v0 = MEM_U32(v0 + 0); +s0 = s0 + 0x1; +goto L42308c; +s0 = s0 + 0x1; +L42305c: +//nop; +a1 = s0; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423070; +MEM_U32(sp + 16) = zero; +L423070: +gp = MEM_U32(sp + 48); +s1 = s1 + 0x8; +v0 = 0x10019318; +//nop; +v0 = MEM_U32(v0 + 0); +//nop; +L423088: +s0 = s0 + 0x1; +L42308c: +s2 = s2 + 0x1; +t4 = s0 & 0xff; +if (s2 != v0) {s0 = t4; +goto L422f34;} +s0 = t4; +L42309c: +t0 = 0x10018ed8; +t6 = MEM_U32(sp + 112); +t0 = MEM_U32(t0 + 0); +t9 = MEM_U32(sp + 72); +if ((int)t0 <= 0) {at = 0xffffffff; +goto L4230e4;} +at = 0xffffffff; +t3 = MEM_U32(s3 + 0); +//nop; +t5 = t3 << 28; +if ((int)t5 >= 0) {//nop; +goto L4230e4;} +//nop; +t2 = MEM_U8(s4 + 0); +//nop; +if (t2 == 0) {//nop; +goto L4230e0;} +//nop; +s1 = s1 + 0xfffffffc; +goto L4230e4; +s1 = s1 + 0xfffffffc; +L4230e0: +s1 = s1 + 0x4; +L4230e4: +if (t6 == at) {//nop; +goto L423240;} +//nop; +t8 = 0x10018ed0; +t7 = MEM_U32(sp + 88); +t8 = MEM_U8(t8 + 0); +at = 0x80000000; +t1 = t9 | at; +MEM_U32(sp + 72) = t1; +if (t8 != 0) {a2 = t7 + t6; +goto L423130;} +a2 = t7 + t6; +//nop; +a0 = 0x2a; +a1 = 0x1f; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423124; +MEM_U32(sp + 16) = zero; +L423124: +gp = MEM_U32(sp + 48); +t4 = MEM_U32(s3 + 0); +goto L423154; +t4 = MEM_U32(s3 + 0); +L423130: +//nop; +a0 = 0x6c; +a1 = 0x1f; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423148; +MEM_U32(sp + 16) = zero; +L423148: +gp = MEM_U32(sp + 48); +//nop; +t4 = MEM_U32(s3 + 0); +L423154: +//nop; +t0 = t4 << 30; +if ((int)t0 >= 0) {//nop; +goto L423550;} +//nop; +t3 = MEM_U8(s4 + 0); +//nop; +if (t3 == 0) {//nop; +goto L4231dc;} +//nop; +t5 = 0x10018ed0; +s0 = -s1; +t5 = MEM_U8(t5 + 0); +a0 = 0x6c; +if (t5 != 0) {a1 = 0x1e; +goto L4231b8;} +a1 = 0x1e; +a3 = 0x10019380; +//nop; +a3 = MEM_U8(a3 + 0); +a0 = 0x2a; +a1 = 0x1e; +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L4231ac; +MEM_U32(sp + 16) = zero; +L4231ac: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L4231b8: +a3 = 0x10019380; +//nop; +a3 = MEM_U8(a3 + 0); +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L4231d0; +MEM_U32(sp + 16) = zero; +L4231d0: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L4231dc: +t2 = 0x10018ed0; +a0 = 0x6c; +t2 = MEM_U8(t2 + 0); +a1 = 0x1e; +if (t2 != 0) {a2 = s1; +goto L423220;} +a2 = s1; +a3 = 0x10019380; +//nop; +a3 = MEM_U8(a3 + 0); +a0 = 0x2a; +a1 = 0x1e; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423214; +MEM_U32(sp + 16) = zero; +L423214: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L423220: +a3 = 0x10019380; +//nop; +a3 = MEM_U8(a3 + 0); +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423234; +MEM_U32(sp + 16) = zero; +L423234: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L423240: +t9 = MEM_U8(s4 + 0); +//nop; +if (t9 == 0) {//nop; +goto L4233d8;} +//nop; +t1 = MEM_U32(s3 + 0); +//nop; +t7 = t1 << 31; +if ((int)t7 >= 0) {//nop; +goto L423364;} +//nop; +v0 = 0x10018ed0; +a3 = 0x10019380; +t6 = MEM_U32(s3 + 0); +v0 = MEM_U8(v0 + 0); +a3 = MEM_U8(a3 + 0); +t8 = t6 << 30; +if ((int)t8 >= 0) {s0 = -s1; +goto L423318;} +s0 = -s1; +if (v0 != 0) {a0 = 0x6c; +goto L4232d4;} +a0 = 0x6c; +//nop; +a0 = 0x2a; +a1 = 0x1f; +a2 = s0 + 0x4; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L4232a4; +MEM_U32(sp + 16) = zero; +L4232a4: +gp = MEM_U32(sp + 48); +a0 = 0x2a; +a3 = 0x10019380; +//nop; +a3 = MEM_U8(a3 + 0); +a1 = 0x1e; +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L4232c8; +MEM_U32(sp + 16) = zero; +L4232c8: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L4232d4: +//nop; +a1 = 0x1f; +a2 = s0 + 0x8; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L4232e8; +MEM_U32(sp + 16) = zero; +L4232e8: +gp = MEM_U32(sp + 48); +a0 = 0x6c; +a3 = 0x10019380; +//nop; +a3 = MEM_U8(a3 + 0); +a1 = 0x1e; +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42330c; +MEM_U32(sp + 16) = zero; +L42330c: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L423318: +if (v0 != 0) {a0 = 0x6c; +goto L423344;} +a0 = 0x6c; +//nop; +a0 = 0x2a; +a1 = 0x1f; +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423338; +MEM_U32(sp + 16) = zero; +L423338: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L423344: +//nop; +a1 = 0x1f; +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423358; +MEM_U32(sp + 16) = zero; +L423358: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L423364: +t4 = MEM_U32(s3 + 0); +//nop; +t0 = t4 << 30; +if ((int)t0 >= 0) {//nop; +goto L423550;} +//nop; +t3 = 0x10018ed0; +a3 = 0x10019380; +t3 = MEM_U8(t3 + 0); +a3 = MEM_U8(a3 + 0); +if (t3 != 0) {s0 = -s1; +goto L4233b4;} +s0 = -s1; +//nop; +a0 = 0x2a; +a1 = 0x1e; +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L4233a8; +MEM_U32(sp + 16) = zero; +L4233a8: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L4233b4: +//nop; +a0 = 0x6c; +a1 = 0x1e; +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L4233cc; +MEM_U32(sp + 16) = zero; +L4233cc: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L4233d8: +t5 = MEM_U32(s3 + 0); +//nop; +t2 = t5 << 31; +if ((int)t2 >= 0) {t1 = t5 << 30; +goto L4234e4;} +t1 = t5 << 30; +v0 = 0x10018ed0; +a3 = 0x10019380; +v0 = MEM_U8(v0 + 0); +a3 = MEM_U8(a3 + 0); +if ((int)t1 >= 0) {//nop; +goto L423498;} +//nop; +if (v0 != 0) {a0 = 0x6c; +goto L423454;} +a0 = 0x6c; +//nop; +a0 = 0x2a; +a1 = 0x1f; +a2 = s1 + 0x4; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423424; +MEM_U32(sp + 16) = zero; +L423424: +gp = MEM_U32(sp + 48); +a0 = 0x2a; +a3 = 0x10019380; +//nop; +a3 = MEM_U8(a3 + 0); +a1 = 0x1e; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423448; +MEM_U32(sp + 16) = zero; +L423448: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L423454: +//nop; +a1 = 0x1f; +a2 = s1 + 0x8; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423468; +MEM_U32(sp + 16) = zero; +L423468: +gp = MEM_U32(sp + 48); +a0 = 0x6c; +a3 = 0x10019380; +//nop; +a3 = MEM_U8(a3 + 0); +a1 = 0x1e; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42348c; +MEM_U32(sp + 16) = zero; +L42348c: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L423498: +if (v0 != 0) {a0 = 0x6c; +goto L4234c4;} +a0 = 0x6c; +//nop; +a0 = 0x2a; +a1 = 0x1f; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L4234b8; +MEM_U32(sp + 16) = zero; +L4234b8: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L4234c4: +//nop; +a1 = 0x1f; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L4234d8; +MEM_U32(sp + 16) = zero; +L4234d8: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L4234e4: +t7 = MEM_U32(s3 + 0); +//nop; +t6 = t7 << 30; +if ((int)t6 >= 0) {//nop; +goto L423550;} +//nop; +t8 = 0x10018ed0; +a3 = 0x10019380; +t8 = MEM_U8(t8 + 0); +a3 = MEM_U8(a3 + 0); +if (t8 != 0) {a0 = 0x6c; +goto L423534;} +a0 = 0x6c; +//nop; +a0 = 0x2a; +a1 = 0x1e; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423528; +MEM_U32(sp + 16) = zero; +L423528: +gp = MEM_U32(sp + 48); +//nop; +goto L423550; +//nop; +L423534: +//nop; +a1 = 0x1e; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423548; +MEM_U32(sp + 16) = zero; +L423548: +gp = MEM_U32(sp + 48); +//nop; +L423550: +//nop; +a1 = MEM_U32(sp + 72); +a2 = MEM_U32(sp + 64); +a0 = 0x26; +f_demit_mask(mem, sp, a0, a1, a2); +goto L423564; +a0 = 0x26; +L423564: +gp = MEM_U32(sp + 48); +a1 = MEM_U32(sp + 68); +//nop; +a2 = MEM_U32(sp + 60); +a0 = 0x27; +f_demit_mask(mem, sp, a0, a1, a2); +goto L42357c; +a0 = 0x27; +L42357c: +ra = MEM_U32(sp + 52); +gp = MEM_U32(sp + 48); +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +s3 = MEM_U32(sp + 40); +s4 = MEM_U32(sp + 44); +sp = sp + 0x58; +return; +sp = sp + 0x58; +} + +static void f_gen_reg_save(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4235a0: +//gen_reg_save: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 52) = s5; +s5 = 0x10019398; +MEM_U32(sp + 60) = ra; +v0 = MEM_U8(s5 + 0); +MEM_U32(sp + 56) = gp; +MEM_U32(sp + 48) = s4; +MEM_U32(sp + 44) = s3; +MEM_U32(sp + 40) = s2; +MEM_U32(sp + 36) = s1; +if (v0 == 0) {MEM_U32(sp + 32) = s0; +goto L4235ec;} +MEM_U32(sp + 32) = s0; +t6 = a0 - a1; +t7 = t6 - a3; +s1 = t7 - a2; +goto L4235f4; +s1 = t7 - a2; +L4235ec: +t8 = a0 - a1; +s1 = t8 - a3; +L4235f4: +s4 = 0x100197b0; +//nop; +t9 = MEM_U32(s4 + 0); +//nop; +t0 = t9 << 31; +if ((int)t0 >= 0) {//nop; +goto L4236dc;} +//nop; +if (v0 == 0) {//nop; +goto L42367c;} +//nop; +s3 = 0x10018ed0; +a0 = 0x6d; +t1 = MEM_U8(s3 + 0); +a1 = 0x1f; +if (t1 != 0) {a3 = 0x1d; +goto L42365c;} +a3 = 0x1d; +//nop; +s1 = s1 + 0x4; +a2 = -s1; +a0 = 0x57; +a1 = 0x1f; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423650; +MEM_U32(sp + 16) = zero; +L423650: +gp = MEM_U32(sp + 56); +t3 = MEM_U32(s4 + 0); +goto L4236e0; +t3 = MEM_U32(s4 + 0); +L42365c: +//nop; +s1 = s1 + 0x8; +a2 = -s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423670; +MEM_U32(sp + 16) = zero; +L423670: +gp = MEM_U32(sp + 56); +t3 = MEM_U32(s4 + 0); +goto L4236e0; +t3 = MEM_U32(s4 + 0); +L42367c: +s3 = 0x10018ed0; +a0 = 0x6d; +t2 = MEM_U8(s3 + 0); +a1 = 0x1f; +if (t2 != 0) {a3 = 0x1d; +goto L4236c0;} +a3 = 0x1d; +//nop; +s1 = s1 + 0xfffffffc; +a2 = s1; +a0 = 0x57; +a1 = 0x1f; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L4236b4; +MEM_U32(sp + 16) = zero; +L4236b4: +gp = MEM_U32(sp + 56); +t3 = MEM_U32(s4 + 0); +goto L4236e0; +t3 = MEM_U32(s4 + 0); +L4236c0: +//nop; +s1 = s1 + 0xfffffff8; +a2 = s1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L4236d4; +MEM_U32(sp + 16) = zero; +L4236d4: +gp = MEM_U32(sp + 56); +//nop; +L4236dc: +t3 = MEM_U32(s4 + 0); +L4236e0: +s3 = 0x10018ed0; +t4 = t3 << 30; +if ((int)t4 >= 0) {//nop; +goto L4237bc;} +//nop; +t5 = MEM_U8(s5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L423760;} +//nop; +t6 = MEM_U8(s3 + 0); +a0 = 0x6d; +if (t6 != 0) {a1 = 0x1e; +goto L42373c;} +a1 = 0x1e; +//nop; +s1 = s1 + 0x4; +a2 = -s1; +a0 = 0x57; +a1 = 0x1e; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423730; +MEM_U32(sp + 16) = zero; +L423730: +gp = MEM_U32(sp + 56); +//nop; +goto L4237bc; +//nop; +L42373c: +//nop; +s1 = s1 + 0x8; +a2 = -s1; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423754; +MEM_U32(sp + 16) = zero; +L423754: +gp = MEM_U32(sp + 56); +//nop; +goto L4237bc; +//nop; +L423760: +t7 = MEM_U8(s3 + 0); +a0 = 0x6d; +if (t7 != 0) {a1 = 0x1e; +goto L42379c;} +a1 = 0x1e; +//nop; +s1 = s1 + 0xfffffffc; +a2 = s1; +a0 = 0x57; +a1 = 0x1e; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423790; +MEM_U32(sp + 16) = zero; +L423790: +gp = MEM_U32(sp + 56); +//nop; +goto L4237bc; +//nop; +L42379c: +//nop; +s1 = s1 + 0xfffffff8; +a2 = s1; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L4237b4; +MEM_U32(sp + 16) = zero; +L4237b4: +gp = MEM_U32(sp + 56); +//nop; +L4237bc: +t8 = 0x10018ed8; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if ((int)t8 <= 0) {//nop; +goto L4238e0;} +//nop; +t9 = MEM_U32(s4 + 0); +//nop; +t0 = t9 << 28; +if ((int)t0 >= 0) {//nop; +goto L4238e0;} +//nop; +t1 = MEM_U8(s5 + 0); +a0 = 0xf; +if (t1 == 0) {//nop; +goto L423870;} +//nop; +//nop; +s1 = s1 + 0x4; +s0 = -s1; +a1 = s0; +a0 = 0xf; +f_emit_dir0(mem, sp, a0, a1); +goto L423810; +a0 = 0xf; +L423810: +gp = MEM_U32(sp + 56); +//nop; +v1 = 0x10019820; +//nop; +v0 = MEM_U32(v1 + 0); +//nop; +if (v0 == 0) {//nop; +goto L423910;} +//nop; +a0 = 0x10018e6c; +a1 = 0x100197d0; +a0 = MEM_U32(a0 + 0); +a1 = a1 + 0xfffffffc; +L423840: +t2 = v0 << 2; +t3 = a1 + t2; +t4 = MEM_U32(t3 + 0); +t7 = v0 + 0xffffffff; +t5 = t4 << 4; +t6 = a0 + t5; +MEM_U32(t6 + -4) = s0; +MEM_U32(v1 + 0) = t7; +if (t7 != 0) {v0 = t7; +goto L423840;} +v0 = t7; +//nop; +goto L423910; +//nop; +L423870: +//nop; +s1 = s1 + 0xfffffffc; +a1 = s1; +f_emit_dir0(mem, sp, a0, a1); +goto L423880; +a1 = s1; +L423880: +gp = MEM_U32(sp + 56); +//nop; +v1 = 0x10019820; +//nop; +v0 = MEM_U32(v1 + 0); +//nop; +if (v0 == 0) {//nop; +goto L423910;} +//nop; +a0 = 0x10018e6c; +a1 = 0x100197d0; +a0 = MEM_U32(a0 + 0); +a1 = a1 + 0xfffffffc; +L4238b0: +t8 = v0 << 2; +t9 = a1 + t8; +t0 = MEM_U32(t9 + 0); +t3 = v0 + 0xffffffff; +t1 = t0 << 4; +t2 = a0 + t1; +MEM_U32(t2 + -4) = s1; +MEM_U32(v1 + 0) = t3; +if (t3 != 0) {v0 = t3; +goto L4238b0;} +v0 = t3; +//nop; +goto L423910; +//nop; +L4238e0: +t4 = 0x10018ee4; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L423910;} +//nop; +//nop; +a0 = 0x1e; +//nop; +f_emit_cpalias(mem, sp, a0); +goto L423908; +//nop; +L423908: +gp = MEM_U32(sp + 56); +//nop; +L423910: +v0 = 0x10019318; +s2 = zero; +v0 = MEM_U32(v0 + 0); +//nop; +s0 = v0 + 0xf; +t5 = s0 & 0xff; +if (v0 == 0) {s0 = t5; +goto L423a70;} +s0 = t5; +L423930: +t6 = s0 < 0x60; +if (t6 == 0) {t7 = (int)s0 >> 5; +goto L423954;} +t7 = (int)s0 >> 5; +t8 = t7 << 2; +t9 = s4 + t8; +t0 = MEM_U32(t9 + 0); +//nop; +t1 = t0 << (s0 & 0x1f); +t6 = (int)t1 < (int)0x0; +L423954: +if (t6 == 0) {//nop; +goto L423a58;} +//nop; +t3 = MEM_U8(s5 + 0); +//nop; +if (t3 == 0) {//nop; +goto L4239dc;} +//nop; +t4 = MEM_U8(s3 + 0); +a0 = 0x6d; +if (t4 != 0) {a1 = s0; +goto L4239a8;} +a1 = s0; +//nop; +s1 = s1 + 0x4; +a2 = -s1; +a0 = 0x57; +a1 = s0; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42399c; +MEM_U32(sp + 16) = zero; +L42399c: +gp = MEM_U32(sp + 56); +//nop; +goto L4239c8; +//nop; +L4239a8: +//nop; +s1 = s1 + 0x8; +a2 = -s1; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L4239c0; +MEM_U32(sp + 16) = zero; +L4239c0: +gp = MEM_U32(sp + 56); +//nop; +L4239c8: +v0 = 0x10019318; +//nop; +v0 = MEM_U32(v0 + 0); +s0 = s0 + 0xffffffff; +goto L423a5c; +s0 = s0 + 0xffffffff; +L4239dc: +t5 = MEM_U8(s3 + 0); +a0 = 0x6d; +if (t5 != 0) {a1 = s0; +goto L423a28;} +a1 = s0; +//nop; +s1 = s1 + 0xfffffffc; +a2 = s1; +a0 = 0x57; +a1 = s0; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423a0c; +MEM_U32(sp + 16) = zero; +L423a0c: +gp = MEM_U32(sp + 56); +//nop; +v0 = 0x10019318; +//nop; +v0 = MEM_U32(v0 + 0); +s0 = s0 + 0xffffffff; +goto L423a5c; +s0 = s0 + 0xffffffff; +L423a28: +//nop; +s1 = s1 + 0xfffffff8; +a2 = s1; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423a40; +MEM_U32(sp + 16) = zero; +L423a40: +gp = MEM_U32(sp + 56); +//nop; +v0 = 0x10019318; +//nop; +v0 = MEM_U32(v0 + 0); +//nop; +L423a58: +s0 = s0 + 0xffffffff; +L423a5c: +s2 = s2 + 0x1; +t7 = s0 & 0xff; +if (s2 != v0) {s0 = t7; +goto L423930;} +s0 = t7; +s2 = zero; +L423a70: +v0 = 0x1001931c; +//nop; +v0 = MEM_U32(v0 + 0); +//nop; +s0 = v0 << 1; +s0 = s0 + 0x32; +t8 = s0 & 0xff; +s0 = t8; +if ((int)s1 >= 0) {t9 = (int)s1 >> 2; +goto L423aa0;} +t9 = (int)s1 >> 2; +at = s1 + 0x3; +t9 = (int)at >> 2; +L423aa0: +t0 = t9 & 0x1; +if (t0 == 0) {//nop; +goto L423ab0;} +//nop; +s1 = s1 + 0xfffffffc; +L423ab0: +if (v0 == 0) {t1 = s0 < 0x60; +goto L423b70;} +L423ab4: +t1 = s0 < 0x60; +if (t1 == 0) {t2 = (int)s0 >> 5; +goto L423ad8;} +t2 = (int)s0 >> 5; +t6 = t2 << 2; +t3 = s4 + t6; +t4 = MEM_U32(t3 + 0); +//nop; +t5 = t4 << (s0 & 0x1f); +t1 = (int)t5 < (int)0x0; +L423ad8: +if (t1 == 0) {//nop; +goto L423b5c;} +//nop; +t8 = MEM_U8(s5 + 0); +a0 = 0x7a; +if (t8 == 0) {a1 = s0; +goto L423b2c;} +a1 = s0; +//nop; +s1 = s1 + 0x8; +a2 = -s1; +a0 = 0x7a; +a1 = s0; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423b10; +MEM_U32(sp + 16) = zero; +L423b10: +gp = MEM_U32(sp + 56); +//nop; +v0 = 0x1001931c; +//nop; +v0 = MEM_U32(v0 + 0); +s0 = s0 + 0xfffffffe; +goto L423b60; +s0 = s0 + 0xfffffffe; +L423b2c: +//nop; +s1 = s1 + 0xfffffff8; +a2 = s1; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L423b44; +MEM_U32(sp + 16) = zero; +L423b44: +gp = MEM_U32(sp + 56); +//nop; +v0 = 0x1001931c; +//nop; +v0 = MEM_U32(v0 + 0); +//nop; +L423b5c: +s0 = s0 + 0xfffffffe; +L423b60: +s2 = s2 + 0x1; +t9 = s0 & 0xff; +if (s2 != v0) {s0 = t9; +goto L423ab4;} +s0 = t9; +L423b70: +a1 = 0x10019380; +at = 0x1d; +a1 = MEM_U8(a1 + 0); +//nop; +if (a1 == at) {ra = MEM_U32(sp + 60); +goto L423ba4;} +ra = MEM_U32(sp + 60); +//nop; +a0 = 0x31; +a2 = 0x1d; +f_emit_rr(mem, sp, a0, a1, a2); +goto L423b98; +a2 = 0x1d; +L423b98: +gp = MEM_U32(sp + 56); +//nop; +ra = MEM_U32(sp + 60); +L423ba4: +s0 = MEM_U32(sp + 32); +s1 = MEM_U32(sp + 36); +s2 = MEM_U32(sp + 40); +s3 = MEM_U32(sp + 44); +s4 = MEM_U32(sp + 48); +s5 = MEM_U32(sp + 52); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void f_demit_mask(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L423bc4: +//demit_mask: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 36) = zero; +if (a1 == 0) {a3 = a0 & 0xff; +goto L423c28;} +a3 = a0 & 0xff; +t6 = MEM_U8(sp + 37); +MEM_U32(sp + 32) = zero; +t7 = t6 << 26; +t8 = t7 >> 26; +t9 = a3 ^ t8; +t0 = t9 & 0x3f; +//nop; +t1 = t0 ^ t6; +MEM_U8(sp + 37) = (uint8_t)t1; +MEM_U32(sp + 40) = a1; +MEM_U32(sp + 44) = a2; +a0 = sp + 0x20; +f_append_d(mem, sp, a0); +goto L423c20; +a0 = sp + 0x20; +L423c20: +gp = MEM_U32(sp + 24); +//nop; +L423c28: +ra = MEM_U32(sp + 28); +sp = sp + 0x30; +//nop; +return; +//nop; +} + +static void f_demit_frame(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L423c38: +//demit_frame: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +v0 = a1 << 25; +t9 = v0 << 7; +MEM_U32(sp + 36) = zero; +t0 = t9 >> 25; +t6 = MEM_U8(sp + 37); +t1 = a2 ^ t0; +t2 = t1 << 25; +//nop; +t3 = t2 >> 7; +t7 = t6 & 0xffc0; +MEM_U32(sp + 28) = ra; +t8 = t7 | 0x2b; +MEM_U32(sp + 40) = a0; +v0 = t3 ^ v0; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 52) = a1; +MEM_U32(sp + 56) = a2; +MEM_U8(sp + 37) = (uint8_t)t8; +MEM_U32(sp + 32) = zero; +MEM_U32(sp + 44) = v0; +a0 = sp + 0x20; +f_append_d(mem, sp, a0); +goto L423ca0; +a0 = sp + 0x20; +L423ca0: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void f_emit_file(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L423cb0: +//emit_file: +//nop; +//nop; +//nop; +sp = sp + 0xfffffaf8; +MEM_U32(sp + 196) = s6; +s6 = a1 & 0xff; +MEM_U32(sp + 204) = ra; +MEM_U32(sp + 200) = gp; +MEM_U32(sp + 192) = s5; +MEM_U32(sp + 188) = s4; +MEM_U32(sp + 184) = s3; +MEM_U32(sp + 180) = s2; +MEM_U32(sp + 176) = s1; +MEM_U32(sp + 172) = s0; +MEM_U32(sp + 1292) = a1; +MEM_U32(sp + 232) = zero; +if (a0 != 0) {MEM_U32(sp + 240) = zero; +goto L423e14;} +MEM_U32(sp + 240) = zero; +t6 = 0x10018ec4; +a0 = 0x2; +t6 = MEM_U8(t6 + 0); +a1 = 0x41f; +if (t6 != 0) {t4 = sp; +goto L423fd4;} +t4 = sp; +t7 = 0x100084e0; +t0 = sp; +t7 = t7; +t9 = t7 + 0x48; +L423d20: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t0 = t0 + 0xc; +MEM_U8(t0 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t0) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t0 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t9) {//swr $at, 7($t0) +goto L423d20;} +//swr $at, 7($t0) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t1 = 0x10008490; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +t9 = t7 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t7) +t1 = t1; +MEM_U8(t0 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t0 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t0 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t0 + 12 + 3) = (uint8_t)(t9 >> 0); +t3 = t1 + 0x48; +//swr $t9, 0xf($t0) +L423d8c: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t4 = t4 + 0xc; +MEM_U8(t4 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t4) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t4 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 84 + 3) = (uint8_t)(at >> 0); +if (t1 != t3) {//swr $at, 0x57($t4) +goto L423d8c;} +//swr $at, 0x57($t4) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +//nop; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +//nop; +MEM_U8(t4 + 92 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 92 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 92 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 92 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x5f($t4) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L423e08; +//nop; +L423e08: +gp = MEM_U32(sp + 200); +ra = MEM_U32(sp + 204); +goto L423fd8; +ra = MEM_U32(sp + 204); +L423e14: +t5 = MEM_U8(sp + 233); +MEM_U32(sp + 228) = a0; +t6 = t5 & 0xffc0; +t8 = t6 | 0xc; +if (a0 != 0) {MEM_U8(sp + 233) = (uint8_t)t8; +goto L423e30;} +MEM_U8(sp + 233) = (uint8_t)t8; +a0 = 0x2; +L423e30: +//nop; +//nop; +//nop; +v0 = f_st_str_idn(mem, sp, a0, a1, a2, a3); +goto L423e40; +//nop; +L423e40: +gp = MEM_U32(sp + 200); +v1 = sp + 0x108; +a1 = sp + 0x508; +a0 = 0x20; +L423e50: +v1 = v1 + 0x1; +if (v1 != a1) {MEM_U8(v1 + -1) = (uint8_t)a0; +goto L423e50;} +MEM_U8(v1 + -1) = (uint8_t)a0; +t9 = MEM_U8(v0 + 0); +a2 = 0x1; +if (t9 == 0) {a0 = v0 + 0x1; +goto L423e8c;} +a0 = v0 + 0x1; +a1 = MEM_U8(a0 + -1); +v1 = sp + 0x108; +L423e74: +MEM_U8(v1 + 0) = (uint8_t)a1; +a1 = MEM_U8(a0 + 0); +a2 = a2 + 0x1; +v1 = v1 + 0x1; +if (a1 != 0) {a0 = a0 + 0x1; +goto L423e74;} +a0 = a0 + 0x1; +L423e8c: +t7 = a2 + 0xffffffff; +if (s6 == 0) {MEM_U32(sp + 236) = t7; +goto L423eb4;} +MEM_U32(sp + 236) = t7; +//nop; +s4 = sp + 0xe4; +a0 = s4; +f_append_d(mem, sp, a0); +goto L423ea8; +a0 = s4; +L423ea8: +gp = MEM_U32(sp + 200); +t0 = MEM_U32(sp + 236); +goto L423ed0; +t0 = MEM_U32(sp + 236); +L423eb4: +//nop; +s4 = sp + 0xe4; +a0 = s4; +f_append_i(mem, sp, a0); +goto L423ec4; +a0 = s4; +L423ec4: +gp = MEM_U32(sp + 200); +//nop; +t0 = MEM_U32(sp + 236); +L423ed0: +//nop; +if (t0 == 0) {v0 = t0 + 0xffffffff; +goto L423fd4;} +v0 = t0 + 0xffffffff; +if ((int)v0 >= 0) {t2 = (int)v0 >> 4; +goto L423eec;} +t2 = (int)v0 >> 4; +at = v0 + 0xf; +t2 = (int)at >> 4; +L423eec: +v0 = t2 + 0x1; +if (v0 == 0) {s3 = 0x1; +goto L423fd4;} +s3 = 0x1; +s5 = v0 + 0x1; +s2 = 0x11; +s1 = sp + 0x107; +s0 = sp + 0xe3; +L423f08: +t3 = 0x10008480; +a0 = s3 << 4; +t3 = t3; +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +a0 = a0 + 0xfffffff0; +MEM_U8(s4 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(s4 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(s4 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(s4 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($s4) +t4 = t3 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t3) +v0 = 0x1; +MEM_U8(s4 + 4 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(s4 + 4 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(s4 + 4 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(s4 + 4 + 3) = (uint8_t)(t4 >> 0); +//swr $t4, 7($s4) +at = t3 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t3) +//nop; +MEM_U8(s4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(s4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(s4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(s4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($s4) +t4 = t3 + 12; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 0xf($t3) +//nop; +MEM_U8(s4 + 12 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(s4 + 12 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(s4 + 12 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(s4 + 12 + 3) = (uint8_t)(t4 >> 0); +//swr $t4, 0xf($s4) +L423f64: +t5 = MEM_U32(sp + 236); +v1 = a0 + v0; +at = (int)t5 < (int)v1; +if (at != 0) {t6 = s1 + v1; +goto L423f8c;} +t6 = s1 + v1; +t8 = MEM_U8(t6 + 0); +t9 = s0 + v0; +v0 = v0 + 0x1; +if (v0 != s2) {MEM_U8(t9 + 0) = (uint8_t)t8; +goto L423f64;} +MEM_U8(t9 + 0) = (uint8_t)t8; +L423f8c: +if (s6 == 0) {//nop; +goto L423fb0;} +//nop; +//nop; +a0 = s4; +//nop; +f_append_d(mem, sp, a0); +goto L423fa4; +//nop; +L423fa4: +gp = MEM_U32(sp + 200); +s3 = s3 + 0x1; +goto L423fcc; +s3 = s3 + 0x1; +L423fb0: +//nop; +a0 = s4; +//nop; +f_append_i(mem, sp, a0); +goto L423fc0; +//nop; +L423fc0: +gp = MEM_U32(sp + 200); +//nop; +s3 = s3 + 0x1; +L423fcc: +if (s3 != s5) {//nop; +goto L423f08;} +//nop; +L423fd4: +ra = MEM_U32(sp + 204); +L423fd8: +s0 = MEM_U32(sp + 172); +s1 = MEM_U32(sp + 176); +s2 = MEM_U32(sp + 180); +s3 = MEM_U32(sp + 184); +s4 = MEM_U32(sp + 188); +s5 = MEM_U32(sp + 192); +s6 = MEM_U32(sp + 196); +sp = sp + 0x508; +return; +sp = sp + 0x508; +} + +static void f_emit_optimize_level(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L423ffc: +//emit_optimize_level: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 36) = zero; +t9 = MEM_U8(sp + 38); +t6 = MEM_U8(sp + 37); +t0 = t9 & 0xff3f; +//nop; +t7 = t6 & 0xffc0; +MEM_U32(sp + 28) = ra; +t8 = t7 | 0x2f; +t1 = t0 | 0x40; +MEM_U32(sp + 44) = a0; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = zero; +MEM_U32(sp + 32) = zero; +MEM_U8(sp + 37) = (uint8_t)t8; +MEM_U8(sp + 38) = (uint8_t)t1; +a0 = sp + 0x20; +f_append_d(mem, sp, a0); +goto L424050; +a0 = sp + 0x20; +L424050: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x30; +return; +sp = sp + 0x30; +//nop; +//nop; +} + +static uint32_t f_is_end_return(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L424068: +//is_end_return: +t6 = MEM_U8(a0 + 32); +at = 0x88; +if (t6 != at) {v0 = a0; +goto L42408c;} +v0 = a0; +t7 = MEM_U32(a0 + 4); +//nop; +v0 = MEM_U32(t7 + 8); +v1 = MEM_U8(v0 + 32); +goto L424090; +v1 = MEM_U8(v0 + 32); +L42408c: +v1 = MEM_U8(v0 + 32); +L424090: +//nop; +t8 = v1 < 0x80; +if (t8 == 0) {//nop; +goto L4240c4;} +//nop; +t1 = 0x10005278; +t9 = (int)v1 >> 5; +t0 = t9 << 2; +t1 = t1; +t2 = t1 + t0; +t3 = MEM_U32(t2 + 0); +//nop; +t4 = t3 << (v1 & 0x1f); +t8 = (int)t4 < (int)0x0; +L4240c4: +if (t8 == 0) {//nop; +goto L424110;} +//nop; +L4240cc: +v0 = MEM_U32(v0 + 8); +//nop; +v1 = MEM_U8(v0 + 32); +//nop; +t6 = v1 < 0x80; +if (t6 == 0) {t7 = (int)v1 >> 5; +goto L424108;} +t7 = (int)v1 >> 5; +t1 = 0x10005278; +t9 = t7 << 2; +t1 = t1; +t0 = t1 + t9; +t2 = MEM_U32(t0 + 0); +//nop; +t3 = t2 << (v1 & 0x1f); +t6 = (int)t3 < (int)0x0; +L424108: +if (t6 != 0) {//nop; +goto L4240cc;} +//nop; +L424110: +v0 = v1 ^ 0x1f; +v0 = v0 < 0x1; +return v0; +v0 = v0 < 0x1; +} + +static void f_move_dreg_to_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42411c: +//move_dreg_to_regs: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 36) = s2; +s2 = a1 & 0xff; +MEM_U32(sp + 32) = s1; +s1 = a0 & 0xff; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 48) = a0; +if (s2 != 0) {MEM_U32(sp + 52) = a1; +goto L424198;} +MEM_U32(sp + 52) = a1; +//nop; +a0 = 0x29; +a1 = s1; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L42416c; +a3 = zero; +L42416c: +gp = MEM_U32(sp + 40); +s0 = s1 + 0x1; +//nop; +a1 = s0; +a0 = 0x29; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L42418c; +a3 = zero; +L42418c: +gp = MEM_U32(sp + 40); +//nop; +goto L424364; +//nop; +L424198: +t6 = 0x10018e80; +//nop; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L42428c;} +//nop; +if (s1 != s2) {a0 = 0x13a; +goto L424224;} +a0 = 0x13a; +//nop; +s0 = s1 + 0x1; +a1 = s0; +a0 = 0x13c; +a2 = s2; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4241d8; +MEM_U32(sp + 16) = zero; +L4241d8: +gp = MEM_U32(sp + 40); +a0 = 0x13a; +//nop; +a1 = s1; +a2 = s2; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4241f8; +MEM_U32(sp + 16) = zero; +L4241f8: +gp = MEM_U32(sp + 40); +a0 = 0x13c; +//nop; +a1 = s1; +a2 = s1; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L424218; +MEM_U32(sp + 16) = zero; +L424218: +gp = MEM_U32(sp + 40); +//nop; +goto L424364; +//nop; +L424224: +//nop; +a1 = s1; +a2 = s2; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42423c; +MEM_U32(sp + 16) = zero; +L42423c: +gp = MEM_U32(sp + 40); +a0 = 0x13c; +//nop; +a1 = s1; +a2 = s1; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42425c; +MEM_U32(sp + 16) = zero; +L42425c: +gp = MEM_U32(sp + 40); +s0 = s1 + 0x1; +//nop; +a1 = s0; +a0 = 0x13c; +a2 = s2; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L424280; +MEM_U32(sp + 16) = zero; +L424280: +gp = MEM_U32(sp + 40); +//nop; +goto L424364; +//nop; +L42428c: +if (s1 != s2) {a0 = 0x13c; +goto L424300;} +a0 = 0x13c; +//nop; +s0 = s1 + 0x1; +a1 = s0; +a0 = 0x13a; +a2 = s2; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4242b4; +MEM_U32(sp + 16) = zero; +L4242b4: +gp = MEM_U32(sp + 40); +a0 = 0x13c; +//nop; +a1 = s0; +a2 = s0; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4242d4; +MEM_U32(sp + 16) = zero; +L4242d4: +gp = MEM_U32(sp + 40); +a0 = 0x13c; +//nop; +a1 = s1; +a2 = s2; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4242f4; +MEM_U32(sp + 16) = zero; +L4242f4: +gp = MEM_U32(sp + 40); +//nop; +goto L424364; +//nop; +L424300: +//nop; +a1 = s1; +a2 = s2; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L424318; +MEM_U32(sp + 16) = zero; +L424318: +gp = MEM_U32(sp + 40); +s0 = s1 + 0x1; +//nop; +a1 = s0; +a0 = 0x13a; +a2 = s2; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42433c; +MEM_U32(sp + 16) = zero; +L42433c: +gp = MEM_U32(sp + 40); +a0 = 0x13c; +//nop; +a1 = s0; +a2 = s0; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42435c; +MEM_U32(sp + 16) = zero; +L42435c: +gp = MEM_U32(sp + 40); +//nop; +L424364: +t7 = 0x10018ecc; +at = 0x1; +t7 = MEM_U8(t7 + 0); +t8 = s1 < 0x20; +if (t7 != at) {ra = MEM_U32(sp + 44); +goto L4243ac;} +ra = MEM_U32(sp + 44); +t9 = -t8; +at = 0xa000000; +t0 = t9 & at; +t1 = t0 << (s1 & 0x1f); +if ((int)t1 >= 0) {t2 = s1 << 2; +goto L4243a8;} +t2 = s1 << 2; +t3 = 0x10019830; +t2 = t2 - s1; +t2 = t2 << 2; +t4 = t2 + t3; +MEM_U8(t4 + 9) = (uint8_t)s0; +L4243a8: +ra = MEM_U32(sp + 44); +L4243ac: +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void f_move_two_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4243c0: +//move_two_regs: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +a3 = a0 & 0xff; +a2 = a1 & 0xff; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +if (a3 == a2) {MEM_U32(sp + 44) = a1; +goto L424460;} +MEM_U32(sp + 44) = a1; +t6 = a2 + 0xffffffe0; +t7 = t6 < 0x20; +t8 = -t7; +t9 = t8 << (t6 & 0x1f); +if ((int)t9 >= 0) {a1 = a3; +goto L424420;} +a1 = a3; +t0 = a3 < 0x20; +t1 = -t0; +t2 = t1 << (a3 & 0x1f); +if ((int)t2 >= 0) {a0 = 0x31; +goto L424424;} +a0 = 0x31; +a0 = 0x61; +goto L424424; +a0 = 0x61; +L424420: +a0 = 0x31; +L424424: +//nop; +MEM_U16(sp + 38) = (uint16_t)a0; +MEM_U8(sp + 47) = (uint8_t)a2; +MEM_U8(sp + 43) = (uint8_t)a3; +f_emit_rr(mem, sp, a0, a1, a2); +goto L424438; +MEM_U8(sp + 43) = (uint8_t)a3; +L424438: +gp = MEM_U32(sp + 24); +a3 = MEM_U8(sp + 43); +a2 = MEM_U8(sp + 47); +//nop; +a0 = MEM_U16(sp + 38); +a1 = a3 + 0x1; +a2 = a2 + 0x1; +f_emit_rr(mem, sp, a0, a1, a2); +goto L424458; +a2 = a2 + 0x1; +L424458: +gp = MEM_U32(sp + 24); +//nop; +L424460: +ra = MEM_U32(sp + 28); +sp = sp + 0x28; +//nop; +return; +//nop; +} + +static uint32_t f_fasm(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L424470: +//fasm: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +v0 = a1 & 0xff; +t6 = v0 + 0xfffffff4; +at = t6 < 0x5; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 192) = a0; +if (at == 0) {MEM_U32(sp + 196) = a1; +goto L4245e0;} +MEM_U32(sp + 196) = a1; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10008670[] = { +&&L4244c8, +&&L4244c0, +&&L4245e0, +&&L4245e0, +&&L4244d0, +}; +dest = Lswitch10008670[t6]; +//nop; +goto *dest; +//nop; +L4244c0: +v0 = a0; +goto L4246f4; +v0 = a0; +L4244c8: +v0 = a0 + 0x1; +goto L4246f4; +v0 = a0 + 0x1; +L4244d0: +t7 = 0x10008620; +a0 = 0x4; +t7 = t7; +t9 = t7 + 0x48; +a1 = 0x346; +t0 = sp; +L4244e8: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t0 = t0 + 0xc; +MEM_U8(t0 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t0) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t0 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t9) {//swr $at, 7($t0) +goto L4244e8;} +//swr $at, 7($t0) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t1 = 0x100085d0; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +t9 = t7 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t7) +t1 = t1; +MEM_U8(t0 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t0 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t0 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t0 + 12 + 3) = (uint8_t)(t9 >> 0); +t3 = t1 + 0x48; +t4 = sp; +//swr $t9, 0xf($t0) +L424558: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t4 = t4 + 0xc; +MEM_U8(t4 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t4) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t4 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 84 + 3) = (uint8_t)(at >> 0); +if (t1 != t3) {//swr $at, 0x57($t4) +goto L424558;} +//swr $at, 0x57($t4) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +//nop; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +//nop; +MEM_U8(t4 + 92 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 92 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 92 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 92 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x5f($t4) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4245d4; +//nop; +L4245d4: +gp = MEM_U32(sp + 176); +v0 = MEM_U16(sp + 190); +goto L4246f0; +v0 = MEM_U16(sp + 190); +L4245e0: +t5 = 0x10008580; +a0 = 0x4; +t5 = t5; +t8 = t5 + 0x48; +a1 = 0x34c; +t9 = sp; +L4245f8: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t5 != t8) {//swr $at, 7($t9) +goto L4245f8;} +//swr $at, 7($t9) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t7 = 0x10008530; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t8 = t5 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t5) +t7 = t7; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t7 + 0x48; +t3 = sp; +//swr $t8, 0xf($t9) +L424668: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t7 != t2) {//swr $at, 0x57($t3) +goto L424668;} +//swr $at, 0x57($t3) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t2 = t7 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t7) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4246e4; +//nop; +L4246e4: +gp = MEM_U32(sp + 176); +//nop; +v0 = MEM_U16(sp + 190); +L4246f0: +//nop; +L4246f4: +ra = MEM_U32(sp + 180); +sp = sp + 0xc0; +//nop; +return v0; +//nop; +} + +static uint32_t f_fop(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L424704: +//fop: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +v0 = a1 & 0xff; +t6 = v0 + 0xfffffff4; +at = t6 < 0x5; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 192) = a0; +if (at == 0) {MEM_U32(sp + 196) = a1; +goto L424894;} +MEM_U32(sp + 196) = a1; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100087c4[] = { +&&L42476c, +&&L424754, +&&L424894, +&&L424894, +&&L424784, +}; +dest = Lswitch100087c4[t6]; +//nop; +goto *dest; +//nop; +L424754: +t8 = 0x100027d0; +t7 = a0 << 1; +t9 = t7 + t8; +v0 = MEM_U16(t9 + 0); +ra = MEM_U32(sp + 180); +goto L4249ac; +ra = MEM_U32(sp + 180); +L42476c: +t1 = 0x10002908; +t0 = a0 << 1; +t2 = t0 + t1; +v0 = MEM_U16(t2 + 0); +ra = MEM_U32(sp + 180); +goto L4249ac; +ra = MEM_U32(sp + 180); +L424784: +t3 = 0x10008774; +a0 = 0x4; +t3 = t3; +t5 = t3 + 0x48; +a1 = 0x358; +t6 = sp; +L42479c: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t6 = t6 + 0xc; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t6 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 4 + 3) = (uint8_t)(at >> 0); +if (t3 != t5) {//swr $at, 7($t6) +goto L42479c;} +//swr $at, 7($t6) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t7 = 0x10008724; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +t7 = t7; +MEM_U8(t6 + 12 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t6 + 12 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t6 + 12 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t6 + 12 + 3) = (uint8_t)(t5 >> 0); +t9 = t7 + 0x48; +t0 = sp; +//swr $t5, 0xf($t6) +L42480c: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t0 = t0 + 0xc; +MEM_U8(t0 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t0) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t0 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 84 + 3) = (uint8_t)(at >> 0); +if (t7 != t9) {//swr $at, 0x57($t0) +goto L42480c;} +//swr $at, 0x57($t0) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +//nop; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +t9 = t7 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t7) +//nop; +MEM_U8(t0 + 92 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t0 + 92 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t0 + 92 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t0 + 92 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x5f($t0) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L424888; +//nop; +L424888: +gp = MEM_U32(sp + 176); +v0 = MEM_U16(sp + 190); +goto L4249a4; +v0 = MEM_U16(sp + 190); +L424894: +t1 = 0x100086d4; +a0 = 0x4; +t1 = t1; +t4 = t1 + 0x48; +a1 = 0x35e; +t5 = sp; +L4248ac: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t5 = t5 + 0xc; +MEM_U8(t5 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t5) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t5 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 4 + 3) = (uint8_t)(at >> 0); +if (t1 != t4) {//swr $at, 7($t5) +goto L4248ac;} +//swr $at, 7($t5) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t3 = 0x10008684; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +t4 = t1 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t1) +t3 = t3; +MEM_U8(t5 + 12 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t5 + 12 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t5 + 12 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t5 + 12 + 3) = (uint8_t)(t4 >> 0); +t8 = t3 + 0x48; +t9 = sp; +//swr $t4, 0xf($t5) +L42491c: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t9 = t9 + 0xc; +MEM_U8(t9 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t9) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t9 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 84 + 3) = (uint8_t)(at >> 0); +if (t3 != t8) {//swr $at, 0x57($t9) +goto L42491c;} +//swr $at, 0x57($t9) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +//nop; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +t8 = t3 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t3) +//nop; +MEM_U8(t9 + 92 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 92 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 92 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 92 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x5f($t9) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L424998; +//nop; +L424998: +gp = MEM_U32(sp + 176); +//nop; +v0 = MEM_U16(sp + 190); +L4249a4: +//nop; +ra = MEM_U32(sp + 180); +L4249ac: +sp = sp + 0xc0; +//nop; +return v0; +//nop; +} + +static uint32_t f_uop_to_asm(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4249b8: +//uop_to_asm: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +a1 = MEM_U8(a0 + 33); +at = 0xc0000; +t6 = a1 & 0x1f; +t7 = t6 < 0x20; +t8 = -t7; +at = at | 0x8000; +t9 = t8 & at; +t0 = t9 << (t6 & 0x1f); +a2 = a0; +if ((int)t0 >= 0) {a1 = t6; +goto L424a18;} +a1 = t6; +//nop; +a0 = MEM_U8(a0 + 32); +//nop; +v0 = f_fop(mem, sp, a0, a1); +goto L424a0c; +//nop; +L424a0c: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L424c88; +ra = MEM_U32(sp + 28); +L424a18: +t1 = MEM_U16(a2 + 34); +v0 = a1 & 0xff; +t2 = t1 & 0x2; +if (t2 == 0) {t2 = v0 + 0xfffffffb; +goto L424b60;} +t2 = v0 + 0xfffffffb; +v0 = a1 & 0xff; +t3 = v0 + 0xfffffffb; +at = t3 < 0x3; +if (at == 0) {//nop; +goto L424b1c;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100087d8[] = { +&&L424a60, +&&L424b00, +&&L424ab0, +}; +dest = Lswitch100087d8[t3]; +//nop; +goto *dest; +//nop; +L424a60: +t4 = 0x10018ecc; +at = 0x1; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L424a94;} +//nop; +t5 = MEM_U8(a2 + 32); +t7 = 0x100048f8; +t6 = t5 << 1; +t8 = t6 + t7; +v0 = MEM_U16(t8 + 0); +ra = MEM_U32(sp + 28); +goto L424c88; +ra = MEM_U32(sp + 28); +L424a94: +t9 = MEM_U8(a2 + 32); +t1 = 0x10004418; +t0 = t9 << 1; +t2 = t0 + t1; +v0 = MEM_U16(t2 + 0); +ra = MEM_U32(sp + 28); +goto L424c88; +ra = MEM_U32(sp + 28); +L424ab0: +t3 = 0x10018ecc; +at = 0x1; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L424ae4;} +//nop; +t4 = MEM_U8(a2 + 32); +t6 = 0x10004a30; +t5 = t4 << 1; +t7 = t5 + t6; +v0 = MEM_U16(t7 + 0); +ra = MEM_U32(sp + 28); +goto L424c88; +ra = MEM_U32(sp + 28); +L424ae4: +t8 = MEM_U8(a2 + 32); +t0 = 0x10004550; +t9 = t8 << 1; +t1 = t9 + t0; +v0 = MEM_U16(t1 + 0); +ra = MEM_U32(sp + 28); +goto L424c88; +ra = MEM_U32(sp + 28); +L424b00: +t2 = MEM_U8(a2 + 32); +t4 = 0x10004418; +t3 = t2 << 1; +t5 = t3 + t4; +v0 = MEM_U16(t5 + 0); +ra = MEM_U32(sp + 28); +goto L424c88; +ra = MEM_U32(sp + 28); +L424b1c: +v1 = MEM_U8(a2 + 32); +at = 0x50; +if (v1 != at) {//nop; +goto L424b44;} +//nop; +t7 = 0x10004418; +t6 = v1 << 1; +t8 = t6 + t7; +v0 = MEM_U16(t8 + 0); +ra = MEM_U32(sp + 28); +goto L424c88; +ra = MEM_U32(sp + 28); +L424b44: +t0 = 0x10004550; +t9 = v1 << 1; +t1 = t9 + t0; +v0 = MEM_U16(t1 + 0); +ra = MEM_U32(sp + 28); +goto L424c88; +ra = MEM_U32(sp + 28); +t2 = v0 + 0xfffffffb; +L424b60: +at = t2 < 0x3; +if (at == 0) {//nop; +goto L424c48;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100087e4[] = { +&&L424b8c, +&&L424c2c, +&&L424bdc, +}; +dest = Lswitch100087e4[t2]; +//nop; +goto *dest; +//nop; +L424b8c: +t3 = 0x10018ecc; +at = 0x1; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L424bc0;} +//nop; +t4 = MEM_U8(a2 + 32); +t6 = 0x10004688; +t5 = t4 << 1; +t7 = t5 + t6; +v0 = MEM_U16(t7 + 0); +ra = MEM_U32(sp + 28); +goto L424c88; +ra = MEM_U32(sp + 28); +L424bc0: +t8 = MEM_U8(a2 + 32); +t0 = 0x100041a8; +t9 = t8 << 1; +t1 = t9 + t0; +v0 = MEM_U16(t1 + 0); +ra = MEM_U32(sp + 28); +goto L424c88; +ra = MEM_U32(sp + 28); +L424bdc: +t2 = 0x10018ecc; +at = 0x1; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L424c10;} +//nop; +t3 = MEM_U8(a2 + 32); +t5 = 0x100047c0; +t4 = t3 << 1; +t6 = t4 + t5; +v0 = MEM_U16(t6 + 0); +ra = MEM_U32(sp + 28); +goto L424c88; +ra = MEM_U32(sp + 28); +L424c10: +t7 = MEM_U8(a2 + 32); +t9 = 0x100042e0; +t8 = t7 << 1; +t0 = t8 + t9; +v0 = MEM_U16(t0 + 0); +ra = MEM_U32(sp + 28); +goto L424c88; +ra = MEM_U32(sp + 28); +L424c2c: +t1 = MEM_U8(a2 + 32); +t3 = 0x100041a8; +t2 = t1 << 1; +t4 = t2 + t3; +v0 = MEM_U16(t4 + 0); +ra = MEM_U32(sp + 28); +goto L424c88; +ra = MEM_U32(sp + 28); +L424c48: +v1 = MEM_U8(a2 + 32); +at = 0x50; +if (v1 != at) {//nop; +goto L424c70;} +//nop; +t6 = 0x100041a8; +t5 = v1 << 1; +t7 = t5 + t6; +v0 = MEM_U16(t7 + 0); +ra = MEM_U32(sp + 28); +goto L424c88; +ra = MEM_U32(sp + 28); +L424c70: +t9 = 0x100042e0; +t8 = v1 << 1; +t0 = t8 + t9; +v0 = MEM_U16(t0 + 0); +//nop; +ra = MEM_U32(sp + 28); +L424c88: +sp = sp + 0x20; +//nop; +return v0; +//nop; +} + +static void f_jump(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L424c94: +//jump: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 40) = s2; +MEM_U32(sp + 36) = s1; +MEM_U32(sp + 32) = s0; +s0 = a0; +s1 = a1 & 0xff; +s2 = a2; +MEM_U32(sp + 52) = ra; +MEM_U32(sp + 48) = gp; +MEM_U32(sp + 44) = s3; +MEM_U32(sp + 68) = a1; +L424ccc: +t6 = MEM_U16(s0 + 20); +at = 0x1; +if (t6 == at) {//nop; +goto L424cf4;} +//nop; +//nop; +a0 = s0; +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L424cec; +a1 = 0x48; +L424cec: +gp = MEM_U32(sp + 48); +//nop; +L424cf4: +t7 = MEM_U8(s0 + 25); +at = 0x48; +t8 = t7 << 24; +t9 = t8 >> 25; +if (t9 == at) {//nop; +goto L424dc0;} +//nop; +if (s1 == 0) {s3 = 0x1a; +goto L424d18;} +s3 = 0x1a; +s3 = 0xd; +L424d18: +//nop; +a0 = s0; +//nop; +v0 = f_result_type(mem, sp, a0); +goto L424d28; +//nop; +L424d28: +t0 = v0 < 0x20; +t1 = -t0; +at = 0x5010000; +t2 = t1 & at; +t3 = t2 << (v0 & 0x1f); +gp = MEM_U32(sp + 48); +if ((int)t3 >= 0) {//nop; +goto L424d88;} +//nop; +//nop; +a0 = s0; +//nop; +v0 = f_reg(mem, sp, a0); +goto L424d58; +//nop; +L424d58: +gp = MEM_U32(sp + 48); +a0 = s3; +//nop; +a1 = v0; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = s2; +MEM_U32(sp + 20) = s0; +f_emit_branch_rill(mem, sp, a0, a1, a2, a3); +goto L424d7c; +MEM_U32(sp + 20) = s0; +L424d7c: +gp = MEM_U32(sp + 48); +ra = MEM_U32(sp + 52); +goto L4251c4; +ra = MEM_U32(sp + 52); +L424d88: +//nop; +a0 = s0; +//nop; +v0 = f_reg(mem, sp, a0); +goto L424d98; +//nop; +L424d98: +gp = MEM_U32(sp + 48); +a0 = s3; +//nop; +a1 = v0; +a2 = zero; +a3 = s2; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L424db4; +a3 = s2; +L424db4: +gp = MEM_U32(sp + 48); +ra = MEM_U32(sp + 52); +goto L4251c4; +ra = MEM_U32(sp + 52); +L424dc0: +a0 = MEM_U8(s0 + 32); +v0 = a0; +goto L42513c; +v0 = a0; +L424dcc: +s1 = s1 < 0x1; +t4 = s1 & 0xff; +s0 = MEM_U32(s0 + 0); +s1 = t4; +goto L424ccc; +s1 = t4; +L424de0: +a1 = MEM_U8(s0 + 33); +at = 0xc0000; +t5 = a1 & 0x1f; +t6 = t5 < 0x20; +t7 = -t6; +at = at | 0x8000; +t8 = t7 & at; +t9 = t8 << (t5 & 0x1f); +if ((int)t9 >= 0) {a1 = t5; +goto L424f30;} +a1 = t5; +//nop; +//nop; +//nop; +v0 = f_fop(mem, sp, a0, a1); +goto L424e18; +//nop; +L424e18: +t0 = MEM_U8(s0 + 32); +gp = MEM_U32(sp + 48); +at = 0x5f; +if (t0 != at) {s3 = v0 & 0xffff; +goto L424e38;} +s3 = v0 & 0xffff; +s1 = s1 < 0x1; +t1 = s1 & 0xff; +s1 = t1; +L424e38: +//nop; +a0 = MEM_U32(s0 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L424e48; +a1 = 0x48; +L424e48: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(s0 + 4); +//nop; +a1 = 0x48; +//nop; +f_eval(mem, sp, a0, a1); +goto L424e60; +//nop; +L424e60: +t2 = MEM_U8(s0 + 32); +at = 0xc00000; +t3 = t2 + 0xffffffe0; +t4 = t3 < 0x20; +t5 = -t4; +t6 = t5 & at; +gp = MEM_U32(sp + 48); +t7 = t6 << (t3 & 0x1f); +if ((int)t7 >= 0) {//nop; +goto L424ec0;} +//nop; +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L424e98; +//nop; +L424e98: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(s0 + 4); +//nop; +MEM_U8(sp + 60) = (uint8_t)v0; +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L424eb0; +//nop; +L424eb0: +gp = MEM_U32(sp + 48); +a2 = MEM_U8(sp + 60); +a1 = v0 & 0xff; +goto L424ef4; +a1 = v0 & 0xff; +L424ec0: +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L424ed0; +//nop; +L424ed0: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(s0 + 4); +//nop; +MEM_U8(sp + 61) = (uint8_t)v0; +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L424ee8; +//nop; +L424ee8: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 61); +a2 = v0 & 0xff; +L424ef4: +//nop; +a0 = s3; +//nop; +f_emit_rr(mem, sp, a0, a1, a2); +goto L424f04; +//nop; +L424f04: +gp = MEM_U32(sp + 48); +if (s1 == 0) {s3 = 0x8; +goto L424f14;} +s3 = 0x8; +s3 = 0x7; +L424f14: +//nop; +a0 = s3; +a1 = s2; +f_emit_ll(mem, sp, a0, a1); +goto L424f24; +a1 = s2; +L424f24: +gp = MEM_U32(sp + 48); +ra = MEM_U32(sp + 52); +goto L4251c4; +ra = MEM_U32(sp + 52); +L424f30: +t8 = 0x10002a40; +v0 = a0 << 1; +t9 = v0 + t8; +s3 = MEM_U16(t9 + 0); +at = 0x6; +if (a1 == at) {at = 0x5; +goto L424f68;} +at = 0x5; +if (a1 == at) {//nop; +goto L424f68;} +//nop; +t0 = 0x10002b78; +//nop; +t1 = v0 + t0; +s3 = MEM_U16(t1 + 0); +//nop; +L424f68: +if (s1 == 0) {//nop; +goto L424f84;} +//nop; +t4 = 0x10002cb0; +t2 = s3 << 1; +t5 = t2 + t4; +s3 = MEM_U16(t5 + 0); +//nop; +L424f84: +t6 = MEM_U32(s0 + 4); +at = 0x49; +t3 = MEM_U8(t6 + 32); +//nop; +if (t3 != at) {//nop; +goto L425058;} +//nop; +//nop; +a0 = MEM_U32(s0 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L424fac; +a1 = 0x48; +L424fac: +t7 = MEM_U32(s0 + 4); +at = 0x5010000; +t8 = MEM_U8(t7 + 33); +gp = MEM_U32(sp + 48); +t9 = t8 & 0x1f; +t0 = t9 < 0x20; +t1 = -t0; +t2 = t1 & at; +t4 = t2 << (t9 & 0x1f); +if ((int)t4 >= 0) {//nop; +goto L42501c;} +//nop; +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +v0 = f_reg(mem, sp, a0); +goto L424fe8; +//nop; +L424fe8: +gp = MEM_U32(sp + 48); +v1 = MEM_U32(s0 + 4); +//nop; +a2 = MEM_U32(v1 + 48); +a3 = MEM_U32(v1 + 52); +a0 = s3; +a1 = v0; +MEM_U32(sp + 16) = s2; +MEM_U32(sp + 20) = s0; +f_emit_branch_rill(mem, sp, a0, a1, a2, a3); +goto L425010; +MEM_U32(sp + 20) = s0; +L425010: +gp = MEM_U32(sp + 48); +ra = MEM_U32(sp + 52); +goto L4251c4; +ra = MEM_U32(sp + 52); +L42501c: +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +v0 = f_reg(mem, sp, a0); +goto L42502c; +//nop; +L42502c: +gp = MEM_U32(sp + 48); +t5 = MEM_U32(s0 + 4); +//nop; +a2 = MEM_U32(t5 + 48); +a0 = s3; +a1 = v0; +a3 = s2; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L42504c; +a3 = s2; +L42504c: +gp = MEM_U32(sp + 48); +ra = MEM_U32(sp + 52); +goto L4251c4; +ra = MEM_U32(sp + 52); +L425058: +//nop; +a0 = MEM_U32(s0 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L425068; +a1 = 0x48; +L425068: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(s0 + 4); +//nop; +a1 = 0x48; +//nop; +f_eval(mem, sp, a0, a1); +goto L425080; +//nop; +L425080: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(s0 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L425098; +//nop; +L425098: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(s0 + 4); +//nop; +MEM_U8(sp + 61) = (uint8_t)v0; +//nop; +v0 = f_reg(mem, sp, a0); +goto L4250b0; +//nop; +L4250b0: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 61); +//nop; +a0 = s3; +a2 = v0 & 0xff; +a3 = s2; +MEM_U32(sp + 16) = s0; +f_emit_branch_rrll(mem, sp, a0, a1, a2, a3); +goto L4250d0; +MEM_U32(sp + 16) = s0; +L4250d0: +gp = MEM_U32(sp + 48); +ra = MEM_U32(sp + 52); +goto L4251c4; +ra = MEM_U32(sp + 52); +L4250dc: +//nop; +a0 = s0; +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L4250ec; +a1 = 0x48; +L4250ec: +gp = MEM_U32(sp + 48); +if (s1 == 0) {s3 = 0x1a; +goto L4250fc;} +s3 = 0x1a; +s3 = 0xd; +L4250fc: +//nop; +a0 = s0; +//nop; +v0 = f_reg(mem, sp, a0); +goto L42510c; +//nop; +L42510c: +gp = MEM_U32(sp + 48); +a0 = s3; +//nop; +a1 = v0; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = s2; +MEM_U32(sp + 20) = s0; +f_emit_branch_rill(mem, sp, a0, a1, a2, a3); +goto L425130; +MEM_U32(sp + 20) = s0; +L425130: +gp = MEM_U32(sp + 48); +ra = MEM_U32(sp + 52); +goto L4251c4; +ra = MEM_U32(sp + 52); +L42513c: +at = v0 < 0x51; +if (at != 0) {t3 = v0 + 0xffffffb3; +goto L42515c;} +t3 = v0 + 0xffffffb3; +at = 0x5f; +if (v0 == at) {//nop; +goto L424de0;} +//nop; +//nop; +goto L4250dc; +//nop; +L42515c: +at = v0 < 0x2a; +if (at == 0) {t6 = v0 + 0xffffffdd; +goto L425194;} +t6 = v0 + 0xffffffdd; +at = t6 < 0x7; +if (at == 0) {//nop; +goto L4250dc;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100087f0[] = { +&&L424de0, +&&L4250dc, +&&L4250dc, +&&L4250dc, +&&L4250dc, +&&L424de0, +&&L424de0, +}; +dest = Lswitch100087f0[t6]; +//nop; +goto *dest; +//nop; +L425194: +at = t3 < 0x4; +if (at == 0) {//nop; +goto L4250dc;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000880c[] = { +&&L424de0, +&&L424de0, +&&L4250dc, +&&L424dcc, +}; +dest = Lswitch1000880c[t3]; +//nop; +goto *dest; +//nop; +ra = MEM_U32(sp + 52); +L4251c4: +s0 = MEM_U32(sp + 32); +s1 = MEM_U32(sp + 36); +s2 = MEM_U32(sp + 40); +s3 = MEM_U32(sp + 44); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void f_trap(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L4251dc: +//trap: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 28) = s0; +s0 = a1; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 72) = a2; +L425204: +t6 = MEM_U16(s0 + 20); +at = 0x1; +if (t6 == at) {//nop; +goto L42522c;} +//nop; +//nop; +a0 = s0; +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L425224; +a1 = 0x48; +L425224: +gp = MEM_U32(sp + 32); +//nop; +L42522c: +t7 = MEM_U8(s0 + 25); +at = 0x48; +t8 = t7 << 24; +t9 = t8 >> 25; +if (t9 == at) {//nop; +goto L425294;} +//nop; +t1 = MEM_U8(sp + 75); +v0 = 0x104; +if (t1 == 0) {//nop; +goto L425258;} +//nop; +v0 = 0x103; +L425258: +//nop; +a0 = s0; +MEM_U16(sp + 60) = (uint16_t)v0; +v0 = f_reg(mem, sp, a0); +goto L425268; +MEM_U16(sp + 60) = (uint16_t)v0; +L425268: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 60); +//nop; +a3 = MEM_U32(sp + 64); +a1 = v0; +a2 = zero; +MEM_U32(sp + 16) = s0; +f_emit_trap_rri(mem, sp, a0, a1, a2, a3); +goto L425288; +MEM_U32(sp + 16) = s0; +L425288: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4257fc; +ra = MEM_U32(sp + 36); +L425294: +a3 = MEM_U8(s0 + 32); +at = a3 < 0x51; +goto L425778; +at = a3 < 0x51; +L4252a0: +t2 = MEM_U8(sp + 75); +s0 = MEM_U32(s0 + 0); +t3 = t2 < 0x1; +MEM_U8(sp + 75) = (uint8_t)t3; +goto L425204; +MEM_U8(sp + 75) = (uint8_t)t3; +L4252b4: +a1 = MEM_U8(s0 + 33); +at = 0xc0000; +t4 = a1 & 0x1f; +t5 = t4 < 0x20; +t6 = -t5; +at = at | 0x8000; +t7 = t6 & at; +t8 = t7 << (t4 & 0x1f); +if ((int)t8 >= 0) {a1 = t4; +goto L425454;} +a1 = t4; +//nop; +a0 = a3; +//nop; +v0 = f_fop(mem, sp, a0, a1); +goto L4252ec; +//nop; +L4252ec: +t9 = MEM_U8(s0 + 32); +gp = MEM_U32(sp + 32); +at = 0x5f; +if (t9 != at) {MEM_U16(sp + 60) = (uint16_t)v0; +goto L425310;} +MEM_U16(sp + 60) = (uint16_t)v0; +t1 = MEM_U8(sp + 75); +//nop; +t2 = t1 < 0x1; +MEM_U8(sp + 75) = (uint8_t)t2; +L425310: +//nop; +a0 = MEM_U32(s0 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L425320; +a1 = 0x48; +L425320: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s0 + 4); +//nop; +a1 = 0x48; +//nop; +f_eval(mem, sp, a0, a1); +goto L425338; +//nop; +L425338: +t3 = MEM_U8(s0 + 32); +at = 0xc00000; +t4 = t3 + 0xffffffe0; +t5 = t4 < 0x20; +t6 = -t5; +t7 = t6 & at; +gp = MEM_U32(sp + 32); +t8 = t7 << (t4 & 0x1f); +if ((int)t8 >= 0) {//nop; +goto L425398;} +//nop; +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L425370; +//nop; +L425370: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s0 + 4); +//nop; +MEM_U8(sp + 58) = (uint8_t)v0; +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L425388; +//nop; +L425388: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 58); +a1 = v0 & 0xff; +goto L4253cc; +a1 = v0 & 0xff; +L425398: +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L4253a8; +//nop; +L4253a8: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s0 + 4); +//nop; +MEM_U8(sp + 59) = (uint8_t)v0; +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L4253c0; +//nop; +L4253c0: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 59); +a2 = v0 & 0xff; +L4253cc: +//nop; +a0 = MEM_U16(sp + 60); +//nop; +f_emit_rr(mem, sp, a0, a1, a2); +goto L4253dc; +//nop; +L4253dc: +t9 = MEM_U8(sp + 75); +gp = MEM_U32(sp + 32); +if (t9 == 0) {v0 = 0x7; +goto L4253f0;} +v0 = 0x7; +v0 = 0x8; +L4253f0: +//nop; +MEM_U16(sp + 60) = (uint16_t)v0; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L425400; +//nop; +L425400: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 60); +//nop; +s0 = v0; +a1 = v0; +f_emit_ll(mem, sp, a0, a1); +goto L425418; +a1 = v0; +L425418: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 64); +//nop; +a0 = 0x1b; +//nop; +f_emit_i(mem, sp, a0, a1); +goto L425430; +//nop; +L425430: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L425448; +//nop; +L425448: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4257fc; +ra = MEM_U32(sp + 36); +L425454: +v0 = MEM_U32(s0 + 0); +v1 = MEM_U32(s0 + 4); +MEM_U32(sp + 48) = v0; +t0 = v1; +goto L425530; +t0 = v1; +L425468: +t1 = MEM_U8(t0 + 32); +at = 0x49; +if (t1 != at) {a3 = 0x28; +goto L4254c0;} +a3 = 0x28; +a0 = MEM_U8(t0 + 33); +a2 = MEM_U32(t0 + 48); +//nop; +a3 = 0x4e; +t2 = a0 & 0x1f; +a0 = t2; +MEM_U8(sp + 63) = (uint8_t)a3; +a1 = zero; +a2 = a2 + 0x1; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L4254a0; +a2 = a2 + 0x1; +L4254a0: +a1 = MEM_U8(s0 + 33); +gp = MEM_U32(sp + 32); +a3 = MEM_U8(sp + 63); +t3 = a1 & 0x1f; +a1 = t3; +MEM_U32(sp + 44) = v0; +t0 = v0; +goto L425548; +t0 = v0; +L4254c0: +MEM_U32(sp + 48) = v1; +t0 = v0; +goto L425548; +t0 = v0; +L4254cc: +t5 = MEM_U8(t0 + 32); +at = 0x49; +if (t5 != at) {a3 = 0x4e; +goto L425524;} +a3 = 0x4e; +a0 = MEM_U8(t0 + 33); +a2 = MEM_U32(t0 + 48); +//nop; +a3 = 0x28; +t6 = a0 & 0x1f; +a0 = t6; +MEM_U8(sp + 63) = (uint8_t)a3; +a1 = zero; +a2 = a2 + 0x1; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L425504; +a2 = a2 + 0x1; +L425504: +a1 = MEM_U8(s0 + 33); +gp = MEM_U32(sp + 32); +a3 = MEM_U8(sp + 63); +t7 = a1 & 0x1f; +a1 = t7; +MEM_U32(sp + 44) = v0; +t0 = v0; +goto L425548; +t0 = v0; +L425524: +MEM_U32(sp + 48) = v1; +t0 = v0; +goto L425548; +t0 = v0; +L425530: +at = 0x29; +if (a3 == at) {//nop; +goto L4254cc;} +//nop; +at = 0x4d; +if (a3 == at) {//nop; +goto L425468;} +//nop; +L425548: +t4 = 0x1000300c; +v0 = a3 << 1; +t8 = v0 + t4; +v1 = MEM_U16(t8 + 0); +at = 0x6; +t2 = MEM_U8(sp + 75); +if (a1 == at) {//nop; +goto L42557c;} +//nop; +t9 = 0x10003144; +//nop; +t1 = v0 + t9; +v1 = MEM_U16(t1 + 0); +//nop; +L42557c: +if (t2 == 0) {a1 = 0x48; +goto L425598;} +a1 = 0x48; +t5 = 0x10002cb0; +t3 = v1 << 1; +t6 = t3 + t5; +v1 = MEM_U16(t6 + 0); +//nop; +L425598: +t7 = MEM_U8(t0 + 32); +at = 0x49; +if (t7 != at) {//nop; +goto L425690;} +//nop; +t4 = MEM_U32(sp + 64); +at = 0x8; +if (t4 != at) {//nop; +goto L425690;} +//nop; +//nop; +a0 = MEM_U32(sp + 48); +a1 = 0x48; +MEM_U16(sp + 60) = (uint16_t)v1; +MEM_U32(sp + 44) = t0; +f_eval(mem, sp, a0, a1); +goto L4255d0; +MEM_U32(sp + 44) = t0; +L4255d0: +gp = MEM_U32(sp + 32); +t9 = MEM_U32(sp + 44); +t8 = 0x10018ecc; +//nop; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L425654;} +//nop; +t1 = MEM_U8(t9 + 33); +at = 0x5010000; +t2 = t1 & 0x1f; +t3 = t2 < 0x20; +t5 = -t3; +t6 = t5 & at; +t7 = t6 << (t2 & 0x1f); +if ((int)t7 >= 0) {//nop; +goto L425654;} +//nop; +//nop; +a0 = MEM_U32(sp + 48); +//nop; +v0 = f_reg(mem, sp, a0); +goto L425624; +//nop; +L425624: +gp = MEM_U32(sp + 32); +v1 = MEM_U32(sp + 44); +//nop; +a0 = MEM_U16(sp + 60); +a2 = MEM_U32(v1 + 48); +a3 = MEM_U32(v1 + 52); +a1 = v0; +MEM_U32(sp + 16) = s0; +f_emit_trap_ri(mem, sp, a0, a1, a2, a3); +goto L425648; +MEM_U32(sp + 16) = s0; +L425648: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4257fc; +ra = MEM_U32(sp + 36); +L425654: +//nop; +a0 = MEM_U32(sp + 48); +//nop; +v0 = f_reg(mem, sp, a0); +goto L425664; +//nop; +L425664: +gp = MEM_U32(sp + 32); +t4 = MEM_U32(sp + 44); +//nop; +a0 = MEM_U16(sp + 60); +a2 = MEM_U32(t4 + 48); +a1 = v0; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L425684; +a3 = zero; +L425684: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4257fc; +ra = MEM_U32(sp + 36); +L425690: +//nop; +a0 = MEM_U32(sp + 48); +MEM_U16(sp + 60) = (uint16_t)v1; +MEM_U32(sp + 44) = t0; +f_eval(mem, sp, a0, a1); +goto L4256a4; +MEM_U32(sp + 44) = t0; +L4256a4: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 44); +//nop; +a1 = 0x48; +//nop; +f_eval(mem, sp, a0, a1); +goto L4256bc; +//nop; +L4256bc: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 48); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L4256d4; +//nop; +L4256d4: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 44); +//nop; +MEM_U8(sp + 59) = (uint8_t)v0; +//nop; +v0 = f_reg(mem, sp, a0); +goto L4256ec; +//nop; +L4256ec: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 59); +//nop; +a0 = MEM_U16(sp + 60); +a3 = MEM_U32(sp + 64); +a2 = v0 & 0xff; +MEM_U32(sp + 16) = s0; +f_emit_trap_rri(mem, sp, a0, a1, a2, a3); +goto L42570c; +MEM_U32(sp + 16) = s0; +L42570c: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4257fc; +ra = MEM_U32(sp + 36); +L425718: +//nop; +a0 = s0; +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L425728; +a1 = 0x48; +L425728: +t8 = MEM_U8(sp + 75); +gp = MEM_U32(sp + 32); +if (t8 == 0) {v0 = 0x104; +goto L42573c;} +v0 = 0x104; +v0 = 0x103; +L42573c: +//nop; +a0 = s0; +MEM_U16(sp + 60) = (uint16_t)v0; +v0 = f_reg(mem, sp, a0); +goto L42574c; +MEM_U16(sp + 60) = (uint16_t)v0; +L42574c: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 60); +//nop; +a3 = MEM_U32(sp + 64); +a1 = v0; +a2 = zero; +MEM_U32(sp + 16) = s0; +f_emit_trap_rri(mem, sp, a0, a1, a2, a3); +goto L42576c; +MEM_U32(sp + 16) = s0; +L42576c: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4257fc; +ra = MEM_U32(sp + 36); +L425778: +if (at != 0) {t1 = a3 + 0xffffffb3; +goto L425794;} +t1 = a3 + 0xffffffb3; +at = 0x5f; +if (a3 == at) {//nop; +goto L4252b4;} +//nop; +//nop; +goto L425718; +//nop; +L425794: +at = a3 < 0x2a; +if (at == 0) {t9 = a3 + 0xffffffdd; +goto L4257cc;} +t9 = a3 + 0xffffffdd; +at = t9 < 0x7; +if (at == 0) {//nop; +goto L425718;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000881c[] = { +&&L4252b4, +&&L425718, +&&L425718, +&&L425718, +&&L425718, +&&L4252b4, +&&L4252b4, +}; +dest = Lswitch1000881c[t9]; +//nop; +goto *dest; +//nop; +L4257cc: +at = t1 < 0x4; +if (at == 0) {//nop; +goto L425718;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10008838[] = { +&&L4252b4, +&&L4252b4, +&&L425718, +&&L4252a0, +}; +dest = Lswitch10008838[t1]; +//nop; +goto *dest; +//nop; +ra = MEM_U32(sp + 36); +L4257fc: +s0 = MEM_U32(sp + 28); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static uint32_t f_is_saved_reg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L425808: +//is_saved_reg: +//nop; +//nop; +//nop; +v0 = a0 < 0x10; +v1 = v0 ^ 0x1; +if (v1 == 0) {MEM_U32(sp + 0) = a0; +goto L425840;} +MEM_U32(sp + 0) = a0; +t6 = 0x10019318; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +t7 = t6 + 0xf; +v1 = t7 < a0; +v1 = v1 ^ 0x1; +L425840: +if (v1 != 0) {t8 = a0 < 0x20; +goto L42588c;} +t8 = a0 < 0x20; +t9 = -t8; +t0 = t9 & 0x3; +v0 = t0 << (a0 & 0x1f); +v1 = (int)v0 < (int)0x0; +if (v1 != 0) {v0 = a0 < 0x34; +goto L42588c;} +v0 = a0 < 0x34; +v1 = v0 ^ 0x1; +if (v1 == 0) {//nop; +goto L42588c;} +//nop; +t2 = 0x1001931c; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +t3 = t2 << 1; +t4 = t3 + 0x32; +v1 = t4 < a0; +v1 = v1 ^ 0x1; +L42588c: +v0 = v1; +return v0; +v0 = v1; +} + +static uint32_t f_is_parm_reg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L425894: +//is_parm_reg: +//nop; +//nop; +//nop; +v0 = a0 < 0x4; +v1 = v0 ^ 0x1; +if (v1 == 0) {MEM_U32(sp + 0) = a0; +goto L4258cc;} +MEM_U32(sp + 0) = a0; +t6 = 0x10019310; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +t7 = t6 + 0x3; +v1 = t7 < a0; +v1 = v1 ^ 0x1; +L4258cc: +if (v1 != 0) {v0 = a0 < 0x2c; +goto L425900;} +v0 = a0 < 0x2c; +v1 = v0 ^ 0x1; +if (v1 == 0) {//nop; +goto L425900;} +//nop; +t8 = 0x10019314; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +t9 = t8 << 1; +t0 = t9 + 0x2a; +v1 = t0 < a0; +v1 = v1 ^ 0x1; +L425900: +v0 = v1; +return v0; +v0 = v1; +} + +static uint32_t f_is_fp_reg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L425908: +//is_fp_reg: +v0 = a0 < 0x20; +v1 = v0 ^ 0x1; +if (v1 == 0) {MEM_U32(sp + 0) = a0; +goto L42591c;} +MEM_U32(sp + 0) = a0; +v1 = a0 < 0x40; +L42591c: +v0 = v1; +return v0; +v0 = v1; +} + +static void f_restore_from_temp(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L425924: +//restore_from_temp: +//nop; +//nop; +//nop; +sp = sp + 0xffffff38; +//nop; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 172) = s0; +s0 = a0; +MEM_U32(sp + 176) = gp; +v0 = f_result_type(mem, sp, a0); +goto L42594c; +MEM_U32(sp + 176) = gp; +L42594c: +gp = MEM_U32(sp + 176); +MEM_U8(sp + 199) = (uint8_t)v0; +t6 = 0x10018eac; +t9 = 0x8; +t6 = MEM_U8(t6 + 0); +v1 = v0 & 0xff; +at = t6 < 0x2; +if (at == 0) {//nop; +goto L425990;} +//nop; +t7 = 0x10018ecc; +t8 = 0x4; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L425990;} +//nop; +MEM_U32(sp + 192) = t8; +goto L425994; +MEM_U32(sp + 192) = t8; +L425990: +MEM_U32(sp + 192) = t9; +L425994: +at = v1 < 0x11; +if (at == 0) {//nop; +goto L425be4;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10008988[] = { +&&L425b40, +&&L425be4, +&&L425b40, +&&L425b40, +&&L425b40, +&&L425b90, +&&L425b40, +&&L425b90, +&&L425b40, +&&L425be4, +&&L425b40, +&&L425be4, +&&L4259c0, +&&L4259c0, +&&L425b40, +&&L425b90, +&&L425a30, +}; +dest = Lswitch10008988[v1]; +//nop; +goto *dest; +//nop; +L4259c0: +//nop; +a0 = MEM_U8(s0 + 24); +//nop; +v0 = f_temp_usage_count(mem, sp, a0); +goto L4259d0; +//nop; +L4259d0: +gp = MEM_U32(sp + 176); +t1 = MEM_U8(sp + 199); +t2 = 0x1000327c; +//nop; +t3 = t1 + t2; +a1 = MEM_U8(t3 + 0); +a0 = s0; +a2 = v0; +v0 = f_get_free_fp_reg(mem, sp, a0, a1, a2); +goto L4259f4; +a2 = v0; +L4259f4: +v1 = MEM_U8(s0 + 25); +t0 = MEM_U8(sp + 199); +t4 = v1 << 24; +t5 = t4 >> 25; +t6 = v0 ^ t5; +t7 = t6 << 25; +t8 = t7 >> 24; +gp = MEM_U32(sp + 176); +at = 0xc; +t9 = t8 ^ v1; +if (t0 != at) {MEM_U8(s0 + 25) = (uint8_t)t9; +goto L425cf0;} +MEM_U8(s0 + 25) = (uint8_t)t9; +t1 = 0x8; +MEM_U32(sp + 192) = t1; +goto L425cf0; +MEM_U32(sp + 192) = t1; +L425a30: +t2 = 0x10008938; +a0 = 0x4; +t2 = t2; +t4 = t2 + 0x48; +a1 = 0x52b; +t5 = sp; +L425a48: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t5 = t5 + 0xc; +MEM_U8(t5 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t5) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t5 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 4 + 3) = (uint8_t)(at >> 0); +if (t2 != t4) {//swr $at, 7($t5) +goto L425a48;} +//swr $at, 7($t5) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t6 = 0x100088e8; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +t4 = t2 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t2) +t6 = t6; +MEM_U8(t5 + 12 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t5 + 12 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t5 + 12 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t5 + 12 + 3) = (uint8_t)(t4 >> 0); +t8 = t6 + 0x48; +t9 = sp; +//swr $t4, 0xf($t5) +L425ab8: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 84 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 0x57($t9) +goto L425ab8;} +//swr $at, 0x57($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +//nop; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +//nop; +MEM_U8(t9 + 92 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 92 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 92 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 92 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x5f($t9) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L425b34; +//nop; +L425b34: +gp = MEM_U32(sp + 176); +t1 = MEM_U8(sp + 199); +goto L425cf4; +t1 = MEM_U8(sp + 199); +L425b40: +//nop; +a0 = MEM_U8(s0 + 24); +//nop; +v0 = f_temp_usage_count(mem, sp, a0); +goto L425b50; +//nop; +L425b50: +gp = MEM_U32(sp + 176); +a0 = s0; +//nop; +a1 = v0; +//nop; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L425b68; +//nop; +L425b68: +v1 = MEM_U8(s0 + 25); +gp = MEM_U32(sp + 176); +t0 = v1 << 24; +t1 = t0 >> 25; +t3 = v0 ^ t1; +t4 = t3 << 25; +t2 = t4 >> 24; +t5 = t2 ^ v1; +MEM_U8(s0 + 25) = (uint8_t)t5; +goto L425cf0; +MEM_U8(s0 + 25) = (uint8_t)t5; +L425b90: +//nop; +a0 = MEM_U8(s0 + 24); +t7 = 0x8; +MEM_U32(sp + 192) = t7; +v0 = f_temp_usage_count(mem, sp, a0); +goto L425ba4; +MEM_U32(sp + 192) = t7; +L425ba4: +gp = MEM_U32(sp + 176); +a0 = s0; +//nop; +a1 = v0; +//nop; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L425bbc; +//nop; +L425bbc: +v1 = MEM_U8(s0 + 25); +gp = MEM_U32(sp + 176); +t8 = v1 << 24; +t6 = t8 >> 25; +t9 = v0 ^ t6; +t0 = t9 << 25; +t1 = t0 >> 24; +t3 = t1 ^ v1; +MEM_U8(s0 + 25) = (uint8_t)t3; +goto L425cf0; +MEM_U8(s0 + 25) = (uint8_t)t3; +L425be4: +t4 = 0x10008898; +a0 = 0x4; +t4 = t4; +t5 = t4 + 0x48; +a1 = 0x541; +t7 = sp; +L425bfc: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t7 = t7 + 0xc; +MEM_U8(t7 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t7) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t7 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 4 + 3) = (uint8_t)(at >> 0); +if (t4 != t5) {//swr $at, 7($t7) +goto L425bfc;} +//swr $at, 7($t7) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t8 = 0x10008848; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +t5 = t4 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t4) +t8 = t8; +MEM_U8(t7 + 12 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t7 + 12 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t7 + 12 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t7 + 12 + 3) = (uint8_t)(t5 >> 0); +t9 = t8 + 0x48; +t0 = sp; +//swr $t5, 0xf($t7) +L425c6c: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t0 = t0 + 0xc; +MEM_U8(t0 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t0) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t0 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 84 + 3) = (uint8_t)(at >> 0); +if (t8 != t9) {//swr $at, 0x57($t0) +goto L425c6c;} +//swr $at, 0x57($t0) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +//nop; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +t9 = t8 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t8) +//nop; +MEM_U8(t0 + 92 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t0 + 92 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t0 + 92 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t0 + 92 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x5f($t0) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L425ce8; +//nop; +L425ce8: +gp = MEM_U32(sp + 176); +//nop; +L425cf0: +t1 = MEM_U8(sp + 199); +L425cf4: +t2 = 0x10003290; +t4 = 0x10019398; +t3 = t1 << 1; +t4 = MEM_U8(t4 + 0); +t5 = t3 + t2; +v0 = MEM_U16(t5 + 0); +if (t4 == 0) {at = 0x6c; +goto L425e58;} +at = 0x6c; +at = 0x6c; +if (v0 != at) {//nop; +goto L425df8;} +//nop; +t7 = 0x10018ecc; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L425df8;} +//nop; +//nop; +a0 = MEM_U8(s0 + 24); +//nop; +v0 = f_temp_offset(mem, sp, a0); +goto L425d48; +//nop; +L425d48: +gp = MEM_U32(sp + 176); +t6 = MEM_U32(sp + 192); +//nop; +a0 = v0 + t6; +//nop; +v0 = f_frame_offset1(mem, sp, a0); +goto L425d60; +//nop; +L425d60: +a1 = MEM_U8(s0 + 25); +gp = MEM_U32(sp + 176); +t9 = a1 << 24; +a3 = 0x10019380; +a1 = t9 >> 25; +//nop; +a3 = MEM_U8(a3 + 0); +a0 = 0x2a; +a2 = v0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L425d8c; +MEM_U32(sp + 16) = zero; +L425d8c: +gp = MEM_U32(sp + 176); +a0 = MEM_U8(s0 + 24); +//nop; +//nop; +//nop; +v0 = f_temp_offset(mem, sp, a0); +goto L425da4; +//nop; +L425da4: +gp = MEM_U32(sp + 176); +t0 = MEM_U32(sp + 192); +//nop; +a0 = v0 + t0; +//nop; +v0 = f_frame_offset1(mem, sp, a0); +goto L425dbc; +//nop; +L425dbc: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(s0 + 25); +a3 = 0x10019380; +//nop; +t1 = a1 << 24; +t3 = t1 >> 25; +a3 = MEM_U8(a3 + 0); +a1 = t3 + 0x1; +a0 = 0x2a; +a2 = v0 + 0x4; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L425dec; +MEM_U32(sp + 16) = zero; +L425dec: +gp = MEM_U32(sp + 176); +//nop; +goto L425f94; +//nop; +L425df8: +//nop; +a0 = MEM_U8(s0 + 24); +MEM_U16(sp + 190) = (uint16_t)v0; +v0 = f_temp_offset(mem, sp, a0); +goto L425e08; +MEM_U16(sp + 190) = (uint16_t)v0; +L425e08: +gp = MEM_U32(sp + 176); +t2 = MEM_U32(sp + 192); +//nop; +a0 = v0 + t2; +//nop; +v0 = f_frame_offset1(mem, sp, a0); +goto L425e20; +//nop; +L425e20: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(s0 + 25); +a3 = 0x10019380; +//nop; +a0 = MEM_U16(sp + 190); +t5 = a1 << 24; +a3 = MEM_U8(a3 + 0); +a1 = t5 >> 25; +a2 = v0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L425e4c; +MEM_U32(sp + 16) = zero; +L425e4c: +gp = MEM_U32(sp + 176); +//nop; +goto L425f94; +//nop; +L425e58: +if (v0 != at) {//nop; +goto L425f38;} +//nop; +t7 = 0x10018ecc; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L425f38;} +//nop; +//nop; +a0 = MEM_U8(s0 + 24); +//nop; +v0 = f_temp_offset(mem, sp, a0); +goto L425e88; +//nop; +L425e88: +gp = MEM_U32(sp + 176); +a0 = v0; +//nop; +//nop; +//nop; +v0 = f_frame_offset1(mem, sp, a0); +goto L425ea0; +//nop; +L425ea0: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(s0 + 25); +a3 = 0x10019380; +//nop; +t6 = a1 << 24; +a3 = MEM_U8(a3 + 0); +a1 = t6 >> 25; +a0 = 0x2a; +a2 = v0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L425ecc; +MEM_U32(sp + 16) = zero; +L425ecc: +gp = MEM_U32(sp + 176); +a0 = MEM_U8(s0 + 24); +//nop; +//nop; +//nop; +v0 = f_temp_offset(mem, sp, a0); +goto L425ee4; +//nop; +L425ee4: +gp = MEM_U32(sp + 176); +a0 = v0; +//nop; +//nop; +//nop; +v0 = f_frame_offset1(mem, sp, a0); +goto L425efc; +//nop; +L425efc: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(s0 + 25); +a3 = 0x10019380; +//nop; +t8 = a1 << 24; +t0 = t8 >> 25; +a3 = MEM_U8(a3 + 0); +a1 = t0 + 0x1; +a0 = 0x2a; +a2 = v0 + 0x4; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L425f2c; +MEM_U32(sp + 16) = zero; +L425f2c: +gp = MEM_U32(sp + 176); +//nop; +goto L425f94; +//nop; +L425f38: +//nop; +a0 = MEM_U8(s0 + 24); +MEM_U16(sp + 190) = (uint16_t)v0; +v0 = f_temp_offset(mem, sp, a0); +goto L425f48; +MEM_U16(sp + 190) = (uint16_t)v0; +L425f48: +gp = MEM_U32(sp + 176); +a0 = v0; +//nop; +//nop; +//nop; +v0 = f_frame_offset1(mem, sp, a0); +goto L425f60; +//nop; +L425f60: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(s0 + 25); +a3 = 0x10019380; +//nop; +a0 = MEM_U16(sp + 190); +t1 = a1 << 24; +a3 = MEM_U8(a3 + 0); +a1 = t1 >> 25; +a2 = v0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L425f8c; +MEM_U32(sp + 16) = zero; +L425f8c: +gp = MEM_U32(sp + 176); +//nop; +L425f94: +//nop; +a0 = MEM_U8(s0 + 24); +//nop; +f_free_temp(mem, sp, a0); +goto L425fa4; +//nop; +L425fa4: +ra = MEM_U32(sp + 180); +MEM_U8(s0 + 24) = (uint8_t)zero; +gp = MEM_U32(sp + 176); +s0 = MEM_U32(sp + 172); +sp = sp + 0xc8; +return; +sp = sp + 0xc8; +} + +static uint32_t f_reg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L425fbc: +//reg: +//nop; +//nop; +//nop; +sp = sp + 0xffffff48; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 172) = s0; +a2 = MEM_U8(a0 + 25); +at = 0x48; +t6 = a2 << 24; +a2 = t6 >> 25; +if (a2 != at) {s0 = a0; +goto L426100;} +s0 = a0; +t8 = 0x10008a1c; +a0 = 0x4; +t8 = t8; +t0 = t8 + 0x48; +a1 = 0x568; +t1 = sp; +L426008: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t1 = t1 + 0xc; +MEM_U8(t1 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t1) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t1 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 4 + 3) = (uint8_t)(at >> 0); +if (t8 != t0) {//swr $at, 7($t1) +goto L426008;} +//swr $at, 7($t1) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t2 = 0x100089cc; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +t0 = t8 + 4; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 7($t8) +t2 = t2; +MEM_U8(t1 + 12 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(t1 + 12 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(t1 + 12 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(t1 + 12 + 3) = (uint8_t)(t0 >> 0); +t4 = t2 + 0x48; +t5 = sp; +//swr $t0, 0xf($t1) +L426078: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t5 = t5 + 0xc; +MEM_U8(t5 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t5) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t5 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 84 + 3) = (uint8_t)(at >> 0); +if (t2 != t4) {//swr $at, 0x57($t5) +goto L426078;} +//swr $at, 0x57($t5) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +//nop; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +t4 = t2 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t2) +//nop; +MEM_U8(t5 + 92 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t5 + 92 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t5 + 92 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t5 + 92 + 3) = (uint8_t)(t4 >> 0); +//swr $t4, 0x5f($t5) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4260f4; +//nop; +L4260f4: +gp = MEM_U32(sp + 176); +v0 = 0x48; +goto L4261a0; +v0 = 0x48; +L426100: +t6 = MEM_U8(s0 + 24); +//nop; +if (t6 == 0) {t0 = a2 + 0xffffffe0; +goto L426134;} +t0 = a2 + 0xffffffe0; +//nop; +a0 = s0; +//nop; +f_restore_from_temp(mem, sp, a0); +goto L426120; +//nop; +L426120: +a2 = MEM_U8(s0 + 25); +gp = MEM_U32(sp + 176); +t7 = a2 << 24; +a2 = t7 >> 25; +t0 = a2 + 0xffffffe0; +L426134: +t8 = t0 < 0x20; +t1 = -t8; +t3 = t1 << (t0 & 0x1f); +if ((int)t3 >= 0) {//nop; +goto L426174;} +//nop; +t4 = MEM_U8(s0 + 33); +t5 = 0x1000327c; +t2 = t4 & 0x1f; +//nop; +t6 = t2 + t5; +a1 = MEM_U8(t6 + 0); +a0 = a2; +f_free_fp_reg(mem, sp, a0, a1); +goto L426168; +a0 = a2; +L426168: +gp = MEM_U32(sp + 176); +v0 = MEM_U8(s0 + 25); +goto L426190; +v0 = MEM_U8(s0 + 25); +L426174: +//nop; +a0 = a2; +//nop; +f_free_reg(mem, sp, a0); +goto L426184; +//nop; +L426184: +gp = MEM_U32(sp + 176); +//nop; +v0 = MEM_U8(s0 + 25); +L426190: +//nop; +t7 = v0 << 24; +t9 = t7 >> 25; +v0 = t9; +L4261a0: +ra = MEM_U32(sp + 180); +s0 = MEM_U32(sp + 172); +sp = sp + 0xb8; +return v0; +sp = sp + 0xb8; +} + +static void f_binary_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4261b0: +//binary_regs: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 188) = ra; +MEM_U32(sp + 184) = gp; +MEM_U32(sp + 180) = s1; +MEM_U32(sp + 176) = s0; +MEM_U32(sp + 200) = a2; +MEM_U32(sp + 204) = a3; +t6 = MEM_U8(a0 + 25); +at = 0x48; +t7 = t6 << 24; +t8 = t7 >> 25; +s0 = a0; +if (t8 != at) {s1 = a1; +goto L426300;} +s1 = a1; +t9 = 0x10008b5c; +a0 = 0x4; +t9 = t9; +t1 = t9 + 0x48; +a1 = 0x580; +t2 = sp; +L42620c: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t2 = t2 + 0xc; +MEM_U8(t2 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t2) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t2 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 4 + 3) = (uint8_t)(at >> 0); +if (t9 != t1) {//swr $at, 7($t2) +goto L42620c;} +//swr $at, 7($t2) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t3 = 0x10008b0c; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +t1 = t9 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t9) +t3 = t3; +MEM_U8(t2 + 12 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t2 + 12 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t2 + 12 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t2 + 12 + 3) = (uint8_t)(t1 >> 0); +t5 = t3 + 0x48; +t6 = sp; +//swr $t1, 0xf($t2) +L42627c: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t6 = t6 + 0xc; +MEM_U8(t6 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t6) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t6 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 84 + 3) = (uint8_t)(at >> 0); +if (t3 != t5) {//swr $at, 0x57($t6) +goto L42627c;} +//swr $at, 0x57($t6) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +//nop; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +//nop; +MEM_U8(t6 + 92 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t6 + 92 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t6 + 92 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t6 + 92 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x5f($t6) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4262f8; +//nop; +L4262f8: +gp = MEM_U32(sp + 184); +//nop; +L426300: +t7 = MEM_U8(s0 + 24); +//nop; +if (t7 == 0) {//nop; +goto L426328;} +//nop; +//nop; +a0 = s0; +//nop; +f_restore_from_temp(mem, sp, a0); +goto L426320; +//nop; +L426320: +gp = MEM_U32(sp + 184); +//nop; +L426328: +t8 = MEM_U8(s1 + 25); +at = 0x48; +t0 = t8 << 24; +t1 = t0 >> 25; +if (t1 != at) {a0 = 0x4; +goto L426448;} +a0 = 0x4; +t9 = 0x10008abc; +a1 = 0x588; +t9 = t9; +t4 = t9 + 0x48; +t5 = sp; +L426354: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t5 = t5 + 0xc; +MEM_U8(t5 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t5) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t5 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 4 + 3) = (uint8_t)(at >> 0); +if (t9 != t4) {//swr $at, 7($t5) +goto L426354;} +//swr $at, 7($t5) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t3 = 0x10008a6c; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +t4 = t9 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t9) +t3 = t3; +MEM_U8(t5 + 12 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t5 + 12 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t5 + 12 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t5 + 12 + 3) = (uint8_t)(t4 >> 0); +t7 = t3 + 0x48; +t8 = sp; +//swr $t4, 0xf($t5) +L4263c4: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t8 = t8 + 0xc; +MEM_U8(t8 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t8) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t8 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 84 + 3) = (uint8_t)(at >> 0); +if (t3 != t7) {//swr $at, 0x57($t8) +goto L4263c4;} +//swr $at, 0x57($t8) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +//nop; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +t7 = t3 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t3) +//nop; +MEM_U8(t8 + 92 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t8 + 92 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t8 + 92 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t8 + 92 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x5f($t8) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L426440; +//nop; +L426440: +gp = MEM_U32(sp + 184); +//nop; +L426448: +t0 = MEM_U8(s1 + 24); +//nop; +if (t0 == 0) {//nop; +goto L426470;} +//nop; +//nop; +a0 = s1; +//nop; +f_restore_from_temp(mem, sp, a0); +goto L426468; +//nop; +L426468: +gp = MEM_U32(sp + 184); +//nop; +L426470: +a0 = MEM_U8(s0 + 25); +//nop; +t1 = a0 << 24; +a0 = t1 >> 25; +t4 = a0 + 0xffffffe0; +t9 = t4 < 0x20; +t5 = -t9; +t6 = t5 << (t4 & 0x1f); +if ((int)t6 >= 0) {//nop; +goto L4264c4;} +//nop; +t7 = MEM_U8(s0 + 33); +t8 = 0x1000327c; +t3 = t7 & 0x1f; +//nop; +t0 = t3 + t8; +a1 = MEM_U8(t0 + 0); +//nop; +f_free_fp_reg(mem, sp, a0, a1); +goto L4264b8; +//nop; +L4264b8: +gp = MEM_U32(sp + 184); +a0 = MEM_U8(s1 + 25); +goto L4264e0; +a0 = MEM_U8(s1 + 25); +L4264c4: +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L4264d4; +//nop; +L4264d4: +gp = MEM_U32(sp + 184); +//nop; +a0 = MEM_U8(s1 + 25); +L4264e0: +//nop; +t1 = a0 << 24; +a0 = t1 >> 25; +t9 = a0 + 0xffffffe0; +t5 = t9 < 0x20; +t4 = -t5; +t6 = t4 << (t9 & 0x1f); +if ((int)t6 >= 0) {//nop; +goto L426530;} +//nop; +t7 = MEM_U8(s1 + 33); +t8 = 0x1000327c; +t3 = t7 & 0x1f; +//nop; +t0 = t3 + t8; +a1 = MEM_U8(t0 + 0); +//nop; +f_free_fp_reg(mem, sp, a0, a1); +goto L426524; +//nop; +L426524: +gp = MEM_U32(sp + 184); +t1 = MEM_U8(s0 + 25); +goto L42654c; +t1 = MEM_U8(s0 + 25); +L426530: +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L426540; +//nop; +L426540: +gp = MEM_U32(sp + 184); +//nop; +t1 = MEM_U8(s0 + 25); +L42654c: +t4 = MEM_U32(sp + 200); +t2 = t1 << 24; +t5 = t2 >> 25; +MEM_U8(t4 + 0) = (uint8_t)t5; +t9 = MEM_U8(s1 + 25); +t3 = MEM_U32(sp + 204); +t6 = t9 << 24; +t7 = t6 >> 25; +MEM_U8(t3 + 0) = (uint8_t)t7; +ra = MEM_U32(sp + 188); +s1 = MEM_U32(sp + 180); +s0 = MEM_U32(sp + 176); +sp = sp + 0xc0; +return; +sp = sp + 0xc0; +} + +static uint32_t f_flt_reg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L426584: +//flt_reg: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 32) = s3; +s3 = a0; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s4; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +v0 = f_reg(mem, sp, a0); +goto L4265bc; +MEM_U32(sp + 20) = s0; +L4265bc: +v1 = v0 & 0xff; +gp = MEM_U32(sp + 40); +at = v1 < 0x20; +if (at != 0) {s4 = v0 & 0xff; +goto L4265dc;} +s4 = v0 & 0xff; +at = v1 < 0x3f; +if (at != 0) {//nop; +goto L426714;} +//nop; +L4265dc: +//nop; +a0 = s3; +//nop; +v0 = f_result_type(mem, sp, a0); +goto L4265ec; +//nop; +L4265ec: +t6 = v0 & 0xff; +t7 = t6 < 0x20; +at = 0xc0000; +at = at | 0x8000; +t8 = -t7; +t9 = t8 & at; +gp = MEM_U32(sp + 40); +t0 = t9 << (t6 & 0x1f); +if ((int)t0 >= 0) {s2 = v0 & 0xff; +goto L4266b8;} +s2 = v0 & 0xff; +//nop; +a0 = s4; +//nop; +v0 = f_usage_count(mem, sp, a0); +goto L426624; +//nop; +L426624: +gp = MEM_U32(sp + 40); +a0 = s3; +t1 = 0x1000327c; +//nop; +s0 = s2 + t1; +a1 = MEM_U8(s0 + 0); +a2 = v0 + 0x1; +v0 = f_get_free_fp_reg(mem, sp, a0, a1, a2); +goto L426644; +a2 = v0 + 0x1; +L426644: +gp = MEM_U32(sp + 40); +s1 = v0 & 0xff; +//nop; +a0 = v0 & 0xff; +a1 = s4; +a2 = s2; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L426660; +a2 = s2; +L426660: +gp = MEM_U32(sp + 40); +a0 = s4; +//nop; +//nop; +//nop; +f_force_free_reg(mem, sp, a0); +goto L426678; +//nop; +L426678: +gp = MEM_U32(sp + 40); +a1 = MEM_U8(s0 + 0); +//nop; +a0 = s1; +//nop; +f_free_fp_reg(mem, sp, a0, a1); +goto L426690; +//nop; +L426690: +v0 = MEM_U8(s3 + 25); +gp = MEM_U32(sp + 40); +t2 = v0 << 24; +t3 = t2 >> 25; +t4 = s1 ^ t3; +t5 = t4 << 25; +t7 = t5 >> 24; +t8 = t7 ^ v0; +MEM_U8(s3 + 25) = (uint8_t)t8; +goto L426714; +MEM_U8(s3 + 25) = (uint8_t)t8; +L4266b8: +t9 = 0x1000327c; +a0 = s3; +s0 = s2 + t9; +//nop; +a1 = MEM_U8(s0 + 0); +a2 = 0x1; +v0 = f_get_free_fp_reg(mem, sp, a0, a1, a2); +goto L4266d4; +a2 = 0x1; +L4266d4: +gp = MEM_U32(sp + 40); +s1 = v0 & 0xff; +//nop; +a0 = v0 & 0xff; +a1 = s4; +a2 = s2; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L4266f0; +a2 = s2; +L4266f0: +gp = MEM_U32(sp + 40); +a1 = MEM_U8(s0 + 0); +//nop; +a0 = s1; +//nop; +f_free_fp_reg(mem, sp, a0, a1); +goto L426708; +//nop; +L426708: +gp = MEM_U32(sp + 40); +v0 = s1; +goto L426724; +v0 = s1; +L426714: +v0 = MEM_U8(s3 + 25); +//nop; +t6 = v0 << 24; +v0 = t6 >> 25; +L426724: +ra = MEM_U32(sp + 44); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +s3 = MEM_U32(sp + 32); +s4 = MEM_U32(sp + 36); +sp = sp + 0x30; +return v0; +sp = sp + 0x30; +} + +static uint32_t func_426744(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L426744: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 32) = s3; +s3 = a1 & 0xff; +MEM_U32(sp + 36) = s4; +at = s3 < 0x20; +s4 = a0; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +if (at != 0) {MEM_U32(sp + 52) = a1; +goto L426790;} +MEM_U32(sp + 52) = a1; +at = s3 < 0x3f; +if (at != 0) {//nop; +goto L4268c8;} +//nop; +L426790: +//nop; +a0 = s4; +//nop; +v0 = f_result_type(mem, sp, a0); +goto L4267a0; +//nop; +L4267a0: +t6 = v0 & 0xff; +t7 = t6 < 0x20; +at = 0xc0000; +at = at | 0x8000; +t8 = -t7; +t9 = t8 & at; +gp = MEM_U32(sp + 40); +t0 = t9 << (t6 & 0x1f); +if ((int)t0 >= 0) {s2 = v0 & 0xff; +goto L42686c;} +s2 = v0 & 0xff; +//nop; +a0 = s3; +//nop; +v0 = f_usage_count(mem, sp, a0); +goto L4267d8; +//nop; +L4267d8: +gp = MEM_U32(sp + 40); +a0 = s4; +t1 = 0x1000327c; +//nop; +s0 = s2 + t1; +a1 = MEM_U8(s0 + 0); +a2 = v0 + 0x1; +v0 = f_get_free_fp_reg(mem, sp, a0, a1, a2); +goto L4267f8; +a2 = v0 + 0x1; +L4267f8: +gp = MEM_U32(sp + 40); +s1 = v0 & 0xff; +//nop; +a0 = v0 & 0xff; +a1 = s3; +a2 = s2; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L426814; +a2 = s2; +L426814: +gp = MEM_U32(sp + 40); +a0 = s3; +//nop; +//nop; +//nop; +f_force_free_reg(mem, sp, a0); +goto L42682c; +//nop; +L42682c: +gp = MEM_U32(sp + 40); +a1 = MEM_U8(s0 + 0); +//nop; +a0 = s1; +//nop; +f_free_fp_reg(mem, sp, a0, a1); +goto L426844; +//nop; +L426844: +v0 = MEM_U8(s4 + 25); +gp = MEM_U32(sp + 40); +t2 = v0 << 24; +t3 = t2 >> 25; +t4 = s1 ^ t3; +t5 = t4 << 25; +t7 = t5 >> 24; +t8 = t7 ^ v0; +MEM_U8(s4 + 25) = (uint8_t)t8; +goto L4268c8; +MEM_U8(s4 + 25) = (uint8_t)t8; +L42686c: +t9 = 0x1000327c; +a0 = s4; +s0 = s2 + t9; +//nop; +a1 = MEM_U8(s0 + 0); +a2 = 0x1; +v0 = f_get_free_fp_reg(mem, sp, a0, a1, a2); +goto L426888; +a2 = 0x1; +L426888: +gp = MEM_U32(sp + 40); +s1 = v0 & 0xff; +//nop; +a0 = v0 & 0xff; +a1 = s3; +a2 = s2; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L4268a4; +a2 = s2; +L4268a4: +gp = MEM_U32(sp + 40); +a1 = MEM_U8(s0 + 0); +//nop; +a0 = s1; +//nop; +f_free_fp_reg(mem, sp, a0, a1); +goto L4268bc; +//nop; +L4268bc: +gp = MEM_U32(sp + 40); +v0 = s1; +goto L4268d8; +v0 = s1; +L4268c8: +v0 = MEM_U8(s4 + 25); +//nop; +t6 = v0 << 24; +v0 = t6 >> 25; +L4268d8: +ra = MEM_U32(sp + 44); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +s3 = MEM_U32(sp + 32); +s4 = MEM_U32(sp + 36); +sp = sp + 0x30; +return v0; +sp = sp + 0x30; +} + +static void f_binary_flt_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4268f8: +//binary_flt_regs: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +a3 = sp + 0x26; +a2 = sp + 0x27; +f_binary_regs(mem, sp, a0, a1, a2, a3); +goto L426930; +a2 = sp + 0x27; +L426930: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 40); +//nop; +a1 = MEM_U8(sp + 39); +t9 = t9; +v0 = sp + 0x28; +v0 = func_426744(mem, sp, a0, a1); +goto L42694c; +v0 = sp + 0x28; +L42694c: +gp = MEM_U32(sp + 24); +t6 = MEM_U32(sp + 48); +//nop; +MEM_U8(t6 + 0) = (uint8_t)v0; +a1 = MEM_U8(sp + 38); +a0 = MEM_U32(sp + 44); +t9 = t9; +v0 = sp + 0x28; +v0 = func_426744(mem, sp, a0, a1); +goto L426970; +v0 = sp + 0x28; +L426970: +t7 = MEM_U32(sp + 52); +gp = MEM_U32(sp + 24); +MEM_U8(t7 + 0) = (uint8_t)v0; +ra = MEM_U32(sp + 28); +sp = sp + 0x28; +//nop; +return; +//nop; +} + +static uint32_t f_get_dest(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42698c: +//get_dest: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a0; +s1 = a1 & 0xff; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 52) = a1; +v0 = f_result_type(mem, sp, a0); +goto L4269c0; +MEM_U32(sp + 52) = a1; +L4269c0: +gp = MEM_U32(sp + 32); +at = 0x48; +if (s1 != at) {t0 = v0 & 0xff; +goto L426a38;} +t0 = v0 & 0xff; +t6 = v0 & 0xff; +t7 = t6 < 0x20; +at = 0xc0000; +at = at | 0x8000; +t8 = -t7; +t9 = t8 & at; +t1 = t9 << (t6 & 0x1f); +if ((int)t1 < 0) {//nop; +goto L426a10;} +//nop; +//nop; +a1 = MEM_U16(s0 + 20); +a0 = s0; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L426a04; +a0 = s0; +L426a04: +gp = MEM_U32(sp + 32); +s1 = v0 & 0xff; +goto L426b28; +s1 = v0 & 0xff; +L426a10: +t2 = 0x1000327c; +//nop; +t3 = t0 + t2; +a1 = MEM_U8(t3 + 0); +a2 = MEM_U16(s0 + 20); +a0 = s0; +v0 = f_get_free_fp_reg(mem, sp, a0, a1, a2); +goto L426a2c; +a0 = s0; +L426a2c: +gp = MEM_U32(sp + 32); +s1 = v0 & 0xff; +goto L426b28; +s1 = v0 & 0xff; +L426a38: +t4 = s1 + 0xffffffe0; +t5 = t4 < 0x20; +t7 = -t5; +t8 = t7 << (t4 & 0x1f); +if ((int)t8 >= 0) {a0 = s1; +goto L426a78;} +a0 = s1; +t9 = 0x1000327c; +a1 = s0; +t6 = t0 + t9; +//nop; +a2 = MEM_U8(t6 + 0); +a3 = 0x1; +f_get_fp_reg(mem, sp, a0, a1, a2, a3); +goto L426a6c; +a3 = 0x1; +L426a6c: +gp = MEM_U32(sp + 32); +v1 = MEM_U8(s0 + 25); +goto L426b2c; +v1 = MEM_U8(s0 + 25); +L426a78: +t1 = 0x10018ecc; +a0 = s1; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L426b10;} +//nop; +v1 = MEM_U8(s0 + 33); +at = 0x5010000; +a3 = v1 & 0x1f; +t2 = a3 < 0x20; +t3 = -t2; +t5 = t3 & at; +t7 = t5 << (a3 & 0x1f); +if ((int)t7 >= 0) {t4 = v0 & 0xff; +goto L426b10;} +t4 = v0 & 0xff; +if (t4 == a3) {t8 = v1 << 27; +goto L426b10;} +t8 = v1 << 27; +t9 = t8 >> 27; +t6 = t0 ^ t9; +//nop; +t1 = t6 & 0x1f; +t2 = t1 ^ v1; +MEM_U8(sp + 45) = (uint8_t)a3; +MEM_U8(s0 + 33) = (uint8_t)t2; +a0 = s1; +a1 = s0; +a2 = 0x1; +f_get_reg(mem, sp, a0, a1, a2); +goto L426ae8; +a2 = 0x1; +L426ae8: +v1 = MEM_U8(s0 + 33); +t3 = MEM_U8(sp + 45); +t5 = v1 << 27; +t7 = t5 >> 27; +t4 = t3 ^ t7; +t8 = t4 & 0x1f; +gp = MEM_U32(sp + 32); +t9 = t8 ^ v1; +MEM_U8(s0 + 33) = (uint8_t)t9; +goto L426b28; +MEM_U8(s0 + 33) = (uint8_t)t9; +L426b10: +//nop; +a1 = s0; +a2 = 0x1; +f_get_reg(mem, sp, a0, a1, a2); +goto L426b20; +a2 = 0x1; +L426b20: +gp = MEM_U32(sp + 32); +//nop; +L426b28: +v1 = MEM_U8(s0 + 25); +L426b2c: +ra = MEM_U32(sp + 36); +t6 = v1 << 24; +t1 = t6 >> 25; +t2 = s1 ^ t1; +t5 = t2 << 25; +t3 = t5 >> 24; +t7 = t3 ^ v1; +MEM_U8(s0 + 25) = (uint8_t)t7; +v0 = s1; +s1 = MEM_U32(sp + 28); +s0 = MEM_U32(sp + 24); +sp = sp + 0x30; +return v0; +sp = sp + 0x30; +} + +static void f_move_to_dest(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L426b60: +//move_to_dest: +//nop; +//nop; +//nop; +sp = sp + 0xffffff48; +MEM_U32(sp + 188) = a1; +t6 = MEM_U8(sp + 191); +a3 = a0 & 0xff; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 184) = a0; +if (a3 == t6) {MEM_U32(sp + 192) = a2; +goto L426e3c;} +MEM_U32(sp + 192) = a2; +t7 = MEM_U8(sp + 191); +t1 = a3 + 0xffffffe0; +t8 = t7 < 0x20; +t9 = -t8; +t0 = t9 << (t7 & 0x1f); +if ((int)t0 >= 0) {t2 = t1 < 0x20; +goto L426c14;} +t2 = t1 < 0x20; +t3 = -t2; +t4 = t3 << (t1 & 0x1f); +if ((int)t4 >= 0) {at = 0xc; +goto L426c14;} +at = 0xc; +if (a2 != at) {a0 = 0x65; +goto L426bc8;} +a0 = 0x65; +a0 = 0xe6; +L426bc8: +t5 = 0x10018ecc; +at = 0x1; +t5 = MEM_U8(t5 + 0); +t6 = a2 < 0x20; +if (t5 != at) {t8 = -t6; +goto L426bf8;} +t8 = -t6; +at = 0x5010000; +t9 = t8 & at; +t7 = t9 << (a2 & 0x1f); +if ((int)t7 >= 0) {//nop; +goto L426bf8;} +//nop; +a0 = 0x146; +L426bf8: +//nop; +a1 = MEM_U8(sp + 191); +a2 = a3; +f_emit_rr(mem, sp, a0, a1, a2); +goto L426c08; +a2 = a3; +L426c08: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L426e40; +ra = MEM_U32(sp + 180); +L426c14: +v0 = MEM_U8(sp + 191); +t1 = a3 < 0x20; +v0 = v0 + 0xffffffe0; +t0 = v0 < 0x20; +t2 = -t0; +t3 = t2 << (v0 & 0x1f); +if ((int)t3 >= 0) {t4 = -t1; +goto L426c98;} +t4 = -t1; +t5 = t4 << (a3 & 0x1f); +if ((int)t5 >= 0) {at = 0xc; +goto L426c98;} +at = 0xc; +if (a2 != at) {a0 = 0x61; +goto L426c4c;} +a0 = 0x61; +a0 = 0xe7; +L426c4c: +t6 = 0x10018ecc; +at = 0x1; +t6 = MEM_U8(t6 + 0); +t8 = a2 < 0x20; +if (t6 != at) {t9 = -t8; +goto L426c7c;} +t9 = -t8; +at = 0x5010000; +t7 = t9 & at; +t0 = t7 << (a2 & 0x1f); +if ((int)t0 >= 0) {//nop; +goto L426c7c;} +//nop; +a0 = 0x147; +L426c7c: +//nop; +a2 = MEM_U8(sp + 191); +a1 = a3; +f_emit_rr(mem, sp, a0, a1, a2); +goto L426c8c; +a1 = a3; +L426c8c: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L426e40; +ra = MEM_U32(sp + 180); +L426c98: +t2 = v0 < 0x20; +t3 = -t2; +t1 = t3 << (v0 & 0x1f); +if ((int)t1 >= 0) {t4 = a3 + 0xffffffe0; +goto L426cec;} +t4 = a3 + 0xffffffe0; +t5 = t4 < 0x20; +t6 = -t5; +t8 = t6 << (t4 & 0x1f); +if ((int)t8 >= 0) {at = 0xd; +goto L426cec;} +at = 0xd; +if (a2 != at) {a0 = 0x8c; +goto L426cd0;} +a0 = 0x8c; +a0 = 0x8b; +goto L426cd0; +a0 = 0x8b; +L426cd0: +//nop; +a2 = MEM_U8(sp + 191); +a1 = a3; +f_emit_rr(mem, sp, a0, a1, a2); +goto L426ce0; +a1 = a3; +L426ce0: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L426e40; +ra = MEM_U32(sp + 180); +L426cec: +t9 = MEM_U8(sp + 191); +t3 = a3 < 0x20; +t7 = t9 < 0x20; +t0 = -t7; +t2 = t0 << (t9 & 0x1f); +if ((int)t2 >= 0) {t1 = -t3; +goto L426d30;} +t1 = -t3; +t5 = t1 << (a3 & 0x1f); +if ((int)t5 >= 0) {a2 = t9; +goto L426d30;} +a2 = t9; +//nop; +a0 = 0x31; +a1 = a3; +f_emit_rr(mem, sp, a0, a1, a2); +goto L426d24; +a1 = a3; +L426d24: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L426e40; +ra = MEM_U32(sp + 180); +L426d30: +t6 = 0x10008bfc; +a0 = 0x4; +t6 = t6; +t8 = t6 + 0x48; +a1 = 0x63a; +t7 = sp; +L426d48: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t7 = t7 + 0xc; +MEM_U8(t7 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t7) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t7 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 7($t7) +goto L426d48;} +//swr $at, 7($t7) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t0 = 0x10008bac; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +t0 = t0; +MEM_U8(t7 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t7 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t7 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t7 + 12 + 3) = (uint8_t)(t8 >> 0); +t3 = t0 + 0x48; +t1 = sp; +//swr $t8, 0xf($t7) +L426db8: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t1 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t1) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t1 = t1 + 0xc; +MEM_U8(t1 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t1) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t1 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 84 + 3) = (uint8_t)(at >> 0); +if (t0 != t3) {//swr $at, 0x57($t1) +goto L426db8;} +//swr $at, 0x57($t1) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +//nop; +MEM_U8(t1 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t1) +t3 = t0 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t0) +//nop; +MEM_U8(t1 + 92 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t1 + 92 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t1 + 92 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t1 + 92 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x5f($t1) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L426e34; +//nop; +L426e34: +gp = MEM_U32(sp + 176); +//nop; +L426e3c: +ra = MEM_U32(sp + 180); +L426e40: +sp = sp + 0xb8; +//nop; +return; +//nop; +} + +static uint32_t f_lsopc(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L426e4c: +//lsopc: +//nop; +//nop; +//nop; +t6 = a2 + 0xffffffe0; +sp = sp + 0xffffff40; +t7 = t6 < 0x20; +t8 = -t7; +MEM_U32(sp + 172) = s0; +t9 = t8 << (t6 & 0x1f); +s0 = a0; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +if ((int)t9 >= 0) {MEM_U32(sp + 200) = a2; +goto L427000;} +MEM_U32(sp + 200) = a2; +v0 = MEM_U32(a1 + 40); +//nop; +at = (int)v0 < (int)0x5; +if (at == 0) {//nop; +goto L426ebc;} +//nop; +t0 = MEM_U8(a1 + 33); +t2 = 0xd; +t1 = t0 & 0x1f; +if (t1 == t2) {//nop; +goto L426eb0;} +//nop; +abort(); +L426eb0: +v1 = MEM_U16(s0 + 14); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L426ebc: +at = (int)v0 < (int)0x9; +if (at == 0) {//nop; +goto L426eec;} +//nop; +t3 = MEM_U8(a1 + 33); +t5 = 0xc; +t4 = t3 & 0x1f; +if (t4 == t5) {//nop; +goto L426ee0;} +//nop; +abort(); +L426ee0: +v1 = MEM_U16(s0 + 16); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L426eec: +t7 = 0x1000905c; +a0 = 0x4; +t7 = t7; +t6 = t7 + 0x48; +a1 = 0x64e; +t9 = sp; +L426f04: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t6) {//swr $at, 7($t9) +goto L426f04;} +//swr $at, 7($t9) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t0 = 0x1000900c; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t6 = t7 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t7) +t0 = t0; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t6 >> 0); +t2 = t0 + 0x48; +t3 = sp; +//swr $t6, 0xf($t9) +L426f74: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 0x57($t3) +goto L426f74;} +//swr $at, 0x57($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L426ff0; +//nop; +L426ff0: +gp = MEM_U32(sp + 176); +v1 = MEM_U16(sp + 190); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L427000: +t4 = MEM_U8(a1 + 33); +//nop; +t5 = t4 & 0x1f; +at = t5 < 0x10; +if (at == 0) {//nop; +goto L4277d8;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100090ac[] = { +&&L427628, +&&L4277d8, +&&L427628, +&&L427628, +&&L427628, +&&L427318, +&&L427038, +&&L42748c, +&&L427194, +&&L427628, +&&L427628, +&&L4277d8, +&&L4277cc, +&&L4277c0, +&&L427628, +&&L427628, +}; +dest = Lswitch100090ac[t5]; +//nop; +goto *dest; +//nop; +L427038: +v0 = MEM_U32(a1 + 40); +at = 0x4; +if (v0 != at) {at = 0x1; +goto L427058;} +at = 0x1; +v1 = MEM_U16(s0 + 8); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +at = 0x1; +L427058: +if (v0 != at) {at = 0x2; +goto L427070;} +at = 0x2; +v1 = MEM_U16(s0 + 0); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +at = 0x2; +L427070: +if (v0 != at) {a0 = 0x4; +goto L427084;} +a0 = 0x4; +v1 = MEM_U16(s0 + 4); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L427084: +t6 = 0x10008fbc; +a1 = 0x65e; +t6 = t6; +t9 = t6 + 0x48; +t1 = sp; +L427098: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t1 = t1 + 0xc; +MEM_U8(t1 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t1) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t1 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t9) {//swr $at, 7($t1) +goto L427098;} +//swr $at, 7($t1) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t2 = 0x10008f6c; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +t9 = t6 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t6) +t2 = t2; +MEM_U8(t1 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t1 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t1 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t1 + 12 + 3) = (uint8_t)(t9 >> 0); +t3 = t2 + 0x48; +t4 = sp; +//swr $t9, 0xf($t1) +L427108: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t4 = t4 + 0xc; +MEM_U8(t4 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t4) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t4 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 84 + 3) = (uint8_t)(at >> 0); +if (t2 != t3) {//swr $at, 0x57($t4) +goto L427108;} +//swr $at, 0x57($t4) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +//nop; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +t3 = t2 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t2) +//nop; +MEM_U8(t4 + 92 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 92 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 92 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 92 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x5f($t4) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L427184; +//nop; +L427184: +gp = MEM_U32(sp + 176); +v1 = MEM_U16(sp + 190); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L427194: +v0 = MEM_U32(a1 + 40); +at = 0x4; +if (v0 != at) {at = 0x1; +goto L4271dc;} +at = 0x1; +t5 = 0x10018eac; +//nop; +t5 = MEM_U8(t5 + 0); +//nop; +at = t5 < 0x2; +if (at != 0) {//nop; +goto L4271cc;} +//nop; +v1 = MEM_U16(s0 + 10); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L4271cc: +v1 = MEM_U16(s0 + 8); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +at = 0x1; +L4271dc: +if (v0 != at) {at = 0x2; +goto L4271f4;} +at = 0x2; +v1 = MEM_U16(s0 + 2); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +at = 0x2; +L4271f4: +if (v0 != at) {a0 = 0x4; +goto L427208;} +a0 = 0x4; +v1 = MEM_U16(s0 + 6); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L427208: +t8 = 0x10008f1c; +a1 = 0x66f; +t8 = t8; +t9 = t8 + 0x48; +t6 = sp; +L42721c: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t6 = t6 + 0xc; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t6 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 4 + 3) = (uint8_t)(at >> 0); +if (t8 != t9) {//swr $at, 7($t6) +goto L42721c;} +//swr $at, 7($t6) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t1 = 0x10008ecc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +t9 = t8 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t8) +t1 = t1; +MEM_U8(t6 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t6 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t6 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t6 + 12 + 3) = (uint8_t)(t9 >> 0); +t3 = t1 + 0x48; +t2 = sp; +//swr $t9, 0xf($t6) +L42728c: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t2 = t2 + 0xc; +MEM_U8(t2 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t2) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t2 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 84 + 3) = (uint8_t)(at >> 0); +if (t1 != t3) {//swr $at, 0x57($t2) +goto L42728c;} +//swr $at, 0x57($t2) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +//nop; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +//nop; +MEM_U8(t2 + 92 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t2 + 92 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t2 + 92 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t2 + 92 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x5f($t2) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L427308; +//nop; +L427308: +gp = MEM_U32(sp + 176); +v1 = MEM_U16(sp + 190); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L427318: +v0 = MEM_U32(a1 + 40); +at = 0x4; +if (v0 != at) {at = 0x1; +goto L427338;} +at = 0x1; +v1 = MEM_U16(s0 + 8); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +at = 0x1; +L427338: +if (v0 != at) {at = 0x2; +goto L427350;} +at = 0x2; +v1 = MEM_U16(s0 + 0); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +at = 0x2; +L427350: +if (v0 != at) {at = 0x8; +goto L427368;} +at = 0x8; +v1 = MEM_U16(s0 + 4); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +at = 0x8; +L427368: +if (v0 != at) {a0 = 0x4; +goto L42737c;} +a0 = 0x4; +v1 = MEM_U16(s0 + 12); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L42737c: +t4 = 0x10008e7c; +a1 = 0x67b; +t4 = t4; +t7 = t4 + 0x48; +t9 = sp; +L427390: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t4 != t7) {//swr $at, 7($t9) +goto L427390;} +//swr $at, 7($t9) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t8 = 0x10008e2c; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t7 = t4 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t4) +t8 = t8; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t7 >> 0); +t0 = t8 + 0x48; +t3 = sp; +//swr $t7, 0xf($t9) +L427400: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t8 != t0) {//swr $at, 0x57($t3) +goto L427400;} +//swr $at, 0x57($t3) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t0 = t8 + 4; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 7($t8) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L42747c; +//nop; +L42747c: +gp = MEM_U32(sp + 176); +v1 = MEM_U16(sp + 190); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L42748c: +v0 = MEM_U32(a1 + 40); +at = 0x4; +if (v0 != at) {at = 0x1; +goto L4274d4;} +at = 0x1; +t1 = 0x10018eac; +//nop; +t1 = MEM_U8(t1 + 0); +//nop; +at = t1 < 0x2; +if (at != 0) {//nop; +goto L4274c4;} +//nop; +v1 = MEM_U16(s0 + 10); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L4274c4: +v1 = MEM_U16(s0 + 8); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +at = 0x1; +L4274d4: +if (v0 != at) {at = 0x2; +goto L4274ec;} +at = 0x2; +v1 = MEM_U16(s0 + 2); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +at = 0x2; +L4274ec: +if (v0 != at) {at = 0x8; +goto L427504;} +at = 0x8; +v1 = MEM_U16(s0 + 6); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +at = 0x8; +L427504: +if (v0 != at) {a0 = 0x4; +goto L427518;} +a0 = 0x4; +v1 = MEM_U16(s0 + 12); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L427518: +t2 = 0x10008ddc; +a1 = 0x691; +t2 = t2; +t7 = t2 + 0x48; +t4 = sp; +L42752c: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t4 = t4 + 0xc; +MEM_U8(t4 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t4) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t4 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 4 + 3) = (uint8_t)(at >> 0); +if (t2 != t7) {//swr $at, 7($t4) +goto L42752c;} +//swr $at, 7($t4) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = 0x10008d8c; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +t7 = t2 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t2) +t9 = t9; +MEM_U8(t4 + 12 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t4 + 12 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t4 + 12 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t4 + 12 + 3) = (uint8_t)(t7 >> 0); +t0 = t9 + 0x48; +t8 = sp; +//swr $t7, 0xf($t4) +L42759c: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t8 = t8 + 0xc; +MEM_U8(t8 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t8) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t8 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 84 + 3) = (uint8_t)(at >> 0); +if (t9 != t0) {//swr $at, 0x57($t8) +goto L42759c;} +//swr $at, 0x57($t8) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +t0 = t9 + 4; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 7($t9) +//nop; +MEM_U8(t8 + 92 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(t8 + 92 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(t8 + 92 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(t8 + 92 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0x5f($t8) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L427618; +//nop; +L427618: +gp = MEM_U32(sp + 176); +v1 = MEM_U16(sp + 190); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L427628: +v0 = MEM_U32(a1 + 40); +at = 0x4; +if (v0 != at) {at = 0x1; +goto L42766c;} +at = 0x1; +t3 = 0x10018ed0; +at = 0x1; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L42765c;} +//nop; +v1 = MEM_U16(s0 + 10); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L42765c: +v1 = MEM_U16(s0 + 8); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +at = 0x1; +L42766c: +if (v0 != at) {at = 0x2; +goto L427684;} +at = 0x2; +v1 = MEM_U16(s0 + 2); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +at = 0x2; +L427684: +if (v0 != at) {at = 0x8; +goto L42769c;} +at = 0x8; +v1 = MEM_U16(s0 + 6); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +at = 0x8; +L42769c: +if (v0 != at) {a0 = 0x4; +goto L4276b0;} +a0 = 0x4; +v1 = MEM_U16(s0 + 12); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L4276b0: +t1 = 0x10008d3c; +a1 = 0x6a1; +t1 = t1; +t7 = t1 + 0x48; +t2 = sp; +L4276c4: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t2 = t2 + 0xc; +MEM_U8(t2 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t2) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t2 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 4 + 3) = (uint8_t)(at >> 0); +if (t1 != t7) {//swr $at, 7($t2) +goto L4276c4;} +//swr $at, 7($t2) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t4 = 0x10008cec; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +t7 = t1 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t1) +t4 = t4; +MEM_U8(t2 + 12 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t2 + 12 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t2 + 12 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t2 + 12 + 3) = (uint8_t)(t7 >> 0); +t0 = t4 + 0x48; +t9 = sp; +//swr $t7, 0xf($t2) +L427734: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t9 = t9 + 0xc; +MEM_U8(t9 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t9) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t9 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t0) {//swr $at, 0x57($t9) +goto L427734;} +//swr $at, 0x57($t9) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +t0 = t4 + 4; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 7($t4) +//nop; +MEM_U8(t9 + 92 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(t9 + 92 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(t9 + 92 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(t9 + 92 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0x5f($t9) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4277b0; +//nop; +L4277b0: +gp = MEM_U32(sp + 176); +v1 = MEM_U16(sp + 190); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L4277c0: +v1 = MEM_U16(s0 + 8); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L4277cc: +v1 = MEM_U16(s0 + 12); +ra = MEM_U32(sp + 180); +goto L4278ec; +ra = MEM_U32(sp + 180); +L4277d8: +t8 = 0x10008c9c; +a0 = 0x4; +t8 = t8; +t5 = t8 + 0x48; +a1 = 0x6b0; +t7 = sp; +L4277f0: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t7 = t7 + 0xc; +MEM_U8(t7 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t7) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t7 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 4 + 3) = (uint8_t)(at >> 0); +if (t8 != t5) {//swr $at, 7($t7) +goto L4277f0;} +//swr $at, 7($t7) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t1 = 0x10008c4c; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +t5 = t8 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t8) +t1 = t1; +MEM_U8(t7 + 12 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t7 + 12 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t7 + 12 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t7 + 12 + 3) = (uint8_t)(t5 >> 0); +t6 = t1 + 0x48; +t0 = sp; +//swr $t5, 0xf($t7) +L427860: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t0 = t0 + 0xc; +MEM_U8(t0 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t0) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t0 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 84 + 3) = (uint8_t)(at >> 0); +if (t1 != t6) {//swr $at, 0x57($t0) +goto L427860;} +//swr $at, 0x57($t0) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +//nop; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +t6 = t1 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t1) +//nop; +MEM_U8(t0 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t0 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t0 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t0 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t0) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4278dc; +//nop; +L4278dc: +gp = MEM_U32(sp + 176); +v1 = MEM_U16(s0 + 8); +//nop; +ra = MEM_U32(sp + 180); +L4278ec: +s0 = MEM_U32(sp + 172); +sp = sp + 0xc0; +v0 = v1; +return v0; +v0 = v1; +} + +static void f_loadstore(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4278fc: +//loadstore: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 172) = s0; +MEM_U32(sp + 192) = a0; +MEM_U32(sp + 200) = a2; +MEM_U32(sp + 204) = a3; +v0 = MEM_U8(a1 + 33); +s0 = a1; +t6 = v0 << 24; +t7 = t6 >> 29; +t8 = t7 & 0xff; +t9 = t8 + 0xffffffff; +at = t9 < 0x5; +if (at == 0) {//nop; +goto L427c48;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000918c[] = { +&&L427968, +&&L427968, +&&L427c48, +&&L427ae8, +&&L427c14, +}; +dest = Lswitch1000918c[t9]; +//nop; +goto *dest; +//nop; +L427968: +//nop; +a0 = MEM_U32(s0 + 36); +//nop; +v0 = f_get_sym_kind(mem, sp, a0); +goto L427978; +//nop; +L427978: +gp = MEM_U32(sp + 176); +at = 0x5; +if (v0 != at) {//nop; +goto L427aa0;} +//nop; +t0 = MEM_U16(sp + 194); +at = 0x24; +if (t0 == at) {a0 = 0x24; +goto L427a50;} +a0 = 0x24; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L4279a8; +a1 = 0x1; +L4279a8: +gp = MEM_U32(sp + 176); +at = 0x1; +t1 = 0x10018ed0; +a1 = v0 & 0xff; +t1 = MEM_U8(t1 + 0); +a0 = 0x56; +if (t1 != at) {//nop; +goto L4279f0;} +//nop; +a2 = 0x10019380; +//nop; +a3 = MEM_U32(s0 + 36); +a2 = MEM_U8(a2 + 0); +a0 = 0x139; +MEM_U8(sp + 191) = (uint8_t)a1; +f_emit_rrri(mem, sp, a0, a1, a2, a3); +goto L4279e4; +MEM_U8(sp + 191) = (uint8_t)a1; +L4279e4: +gp = MEM_U32(sp + 176); +//nop; +goto L427a10; +//nop; +L4279f0: +a2 = 0x10019380; +//nop; +a3 = MEM_U32(s0 + 36); +a2 = MEM_U8(a2 + 0); +MEM_U8(sp + 191) = (uint8_t)a1; +f_emit_rrri(mem, sp, a0, a1, a2, a3); +goto L427a08; +MEM_U8(sp + 191) = (uint8_t)a1; +L427a08: +gp = MEM_U32(sp + 176); +//nop; +L427a10: +//nop; +a0 = MEM_U16(sp + 194); +a1 = MEM_U8(sp + 203); +a2 = MEM_U32(s0 + 44); +a3 = MEM_U8(sp + 191); +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L427a2c; +MEM_U32(sp + 16) = zero; +L427a2c: +gp = MEM_U32(sp + 176); +a0 = MEM_U8(sp + 191); +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L427a44; +//nop; +L427a44: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L427d58; +ra = MEM_U32(sp + 180); +L427a50: +t2 = 0x10019380; +//nop; +t2 = MEM_U8(t2 + 0); +a1 = MEM_U8(sp + 203); +a2 = MEM_U32(sp + 204); +a3 = MEM_U32(s0 + 36); +MEM_U32(sp + 16) = t2; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L427a70; +MEM_U32(sp + 16) = t2; +L427a70: +a3 = MEM_U32(s0 + 44); +gp = MEM_U32(sp + 176); +if (a3 == 0) {a0 = 0x2; +goto L427d54;} +a0 = 0x2; +a2 = MEM_U8(sp + 203); +//nop; +MEM_U32(sp + 16) = zero; +a1 = a2; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L427a94; +a1 = a2; +L427a94: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L427d58; +ra = MEM_U32(sp + 180); +L427aa0: +//nop; +a0 = s0; +//nop; +v0 = f_frame_offset(mem, sp, a0); +goto L427ab0; +//nop; +L427ab0: +gp = MEM_U32(sp + 176); +t4 = MEM_U32(sp + 204); +a3 = 0x10019380; +t5 = MEM_U32(s0 + 48); +//nop; +a0 = MEM_U16(sp + 194); +a1 = MEM_U8(sp + 203); +a3 = MEM_U8(a3 + 0); +a2 = v0 + t4; +MEM_U32(sp + 16) = t5; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L427adc; +MEM_U32(sp + 16) = t5; +L427adc: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L427d58; +ra = MEM_U32(sp + 180); +L427ae8: +t6 = 0x10018ed8; +a0 = MEM_U16(sp + 194); +t6 = MEM_U32(t6 + 0); +a1 = MEM_U8(sp + 203); +if ((int)t6 <= 0) {//nop; +goto L427be8;} +//nop; +v0 = MEM_U32(s0 + 36); +t8 = MEM_U32(sp + 204); +if (v0 == 0) {a2 = v0; +goto L427bb8;} +a2 = v0; +t7 = MEM_U32(s0 + 44); +at = 0x8000; +v1 = t7 + t8; +at = (int)v1 < (int)at; +if (at == 0) {at = (int)v1 < (int)0xffff8000; +goto L427b30;} +at = (int)v1 < (int)0xffff8000; +if (at == 0) {//nop; +goto L427bb8;} +//nop; +L427b30: +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L427b40; +a1 = 0x1; +L427b40: +t9 = MEM_U32(s0 + 44); +t0 = MEM_U32(sp + 204); +gp = MEM_U32(sp + 176); +a3 = t9 + t0; +t1 = MEM_U32(s0 + 48); +//nop; +a2 = MEM_U32(s0 + 36); +MEM_U8(sp + 191) = (uint8_t)v0; +a0 = 0x24; +a1 = v0 & 0xff; +MEM_U32(sp + 16) = t1; +f_emit_ra(mem, sp, a0, a1, a2, a3); +goto L427b70; +MEM_U32(sp + 16) = t1; +L427b70: +gp = MEM_U32(sp + 176); +t2 = MEM_U32(s0 + 48); +//nop; +a0 = MEM_U16(sp + 194); +a1 = MEM_U8(sp + 203); +a3 = MEM_U8(sp + 191); +a2 = zero; +MEM_U32(sp + 16) = t2; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L427b94; +MEM_U32(sp + 16) = t2; +L427b94: +gp = MEM_U32(sp + 176); +a0 = MEM_U8(sp + 191); +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L427bac; +//nop; +L427bac: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L427d58; +ra = MEM_U32(sp + 180); +L427bb8: +t3 = MEM_U32(s0 + 44); +t4 = MEM_U32(sp + 204); +t5 = MEM_U32(s0 + 48); +//nop; +a0 = MEM_U16(sp + 194); +a1 = MEM_U8(sp + 203); +a3 = t3 + t4; +MEM_U32(sp + 16) = t5; +f_emit_ra(mem, sp, a0, a1, a2, a3); +goto L427bdc; +MEM_U32(sp + 16) = t5; +L427bdc: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L427d58; +ra = MEM_U32(sp + 180); +L427be8: +t6 = MEM_U32(s0 + 44); +t7 = MEM_U32(sp + 204); +t8 = MEM_U32(s0 + 48); +//nop; +a2 = MEM_U32(s0 + 36); +a3 = t6 + t7; +MEM_U32(sp + 16) = t8; +f_emit_ra(mem, sp, a0, a1, a2, a3); +goto L427c08; +MEM_U32(sp + 16) = t8; +L427c08: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L427d58; +ra = MEM_U32(sp + 180); +L427c14: +t9 = MEM_U32(s0 + 44); +t0 = MEM_U32(sp + 204); +t1 = MEM_U32(s0 + 48); +a2 = t9 + t0; +//nop; +a0 = MEM_U16(sp + 194); +a1 = MEM_U8(sp + 203); +a3 = 0x1d; +MEM_U32(sp + 16) = t1; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L427c3c; +MEM_U32(sp + 16) = t1; +L427c3c: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L427d58; +ra = MEM_U32(sp + 180); +L427c48: +t2 = 0x1000913c; +a0 = 0x4; +t2 = t2; +t4 = t2 + 0x48; +a1 = 0x6ed; +t5 = sp; +L427c60: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t5 = t5 + 0xc; +MEM_U8(t5 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t5) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t5 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 4 + 3) = (uint8_t)(at >> 0); +if (t2 != t4) {//swr $at, 7($t5) +goto L427c60;} +//swr $at, 7($t5) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t6 = 0x100090ec; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +t4 = t2 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t2) +t6 = t6; +MEM_U8(t5 + 12 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t5 + 12 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t5 + 12 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t5 + 12 + 3) = (uint8_t)(t4 >> 0); +t8 = t6 + 0x48; +t9 = sp; +//swr $t4, 0xf($t5) +L427cd0: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 84 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 0x57($t9) +goto L427cd0;} +//swr $at, 0x57($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +//nop; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +//nop; +MEM_U8(t9 + 92 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 92 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 92 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 92 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x5f($t9) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L427d4c; +//nop; +L427d4c: +gp = MEM_U32(sp + 176); +//nop; +L427d54: +ra = MEM_U32(sp + 180); +L427d58: +s0 = MEM_U32(sp + 172); +sp = sp + 0xc0; +return; +sp = sp + 0xc0; +} + +static void func_427d64(uint8_t *mem, uint32_t sp, uint32_t v0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L427d64: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 32) = s0; +s0 = v0; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s1; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L427d98; +a1 = 0x1; +L427d98: +v1 = MEM_U16(s0 + 6); +gp = MEM_U32(sp + 40); +at = 0x79; +if (v1 == at) {s1 = v0 & 0xff; +goto L427db8;} +s1 = v0 & 0xff; +at = 0x33; +if (v1 != at) {//nop; +goto L427e04;} +//nop; +L427db8: +//nop; +a1 = MEM_U8(s0 + 11); +a0 = s1; +a2 = 0xd; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L427dcc; +a2 = 0xd; +L427dcc: +t6 = MEM_U8(s0 + 23); +gp = MEM_U32(sp + 40); +a2 = MEM_U32(s0 + 12); +a3 = MEM_U32(s0 + 16); +MEM_U32(sp + 16) = t6; +t7 = MEM_U32(s0 + -8); +//nop; +a0 = 0xd1; +a1 = s1; +MEM_U32(sp + 20) = t7; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L427df8; +MEM_U32(sp + 20) = t7; +L427df8: +gp = MEM_U32(sp + 40); +//nop; +goto L427e50; +//nop; +L427e04: +t8 = MEM_U8(s0 + 23); +a2 = MEM_U32(s0 + 12); +a3 = MEM_U32(s0 + 16); +MEM_U32(sp + 16) = t8; +t9 = MEM_U32(s0 + -8); +a0 = 0xce; +MEM_U32(sp + 20) = t9; +//nop; +a1 = s1; +//nop; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L427e30; +//nop; +L427e30: +gp = MEM_U32(sp + 40); +a0 = MEM_U8(s0 + 11); +//nop; +a1 = s1; +a2 = 0xd; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L427e48; +a2 = 0xd; +L427e48: +gp = MEM_U32(sp + 40); +//nop; +L427e50: +//nop; +a0 = s1; +//nop; +f_free_reg(mem, sp, a0); +goto L427e60; +//nop; +L427e60: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 32); +s1 = MEM_U32(sp + 36); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_427e78(uint8_t *mem, uint32_t sp, uint32_t v0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L427e78: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb8; +t6 = 0x10018e80; +MEM_U32(sp + 52) = ra; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 48) = gp; +MEM_U32(sp + 44) = s4; +MEM_U32(sp + 40) = s3; +MEM_U32(sp + 36) = s2; +MEM_U32(sp + 32) = s1; +MEM_U32(sp + 28) = s0; +if (t6 != 0) {v1 = v0; +goto L427ed8;} +v1 = v0; +s4 = MEM_U8(v0 + 11); +//nop; +MEM_U32(sp + 68) = v0; +a0 = s4; +v0 = f_is_fp_reg(mem, sp, a0); +goto L427ec8; +a0 = s4; +L427ec8: +gp = MEM_U32(sp + 48); +v1 = MEM_U32(sp + 68); +if (v0 != 0) {//nop; +goto L427ef8;} +//nop; +L427ed8: +v0 = MEM_U32(v1 + 12); +//nop; +t7 = v0 + 0x4; +MEM_U32(sp + 60) = t7; +MEM_U32(sp + 64) = v0; +s4 = MEM_U8(v1 + 11); +//nop; +goto L427f0c; +//nop; +L427ef8: +v0 = MEM_U32(v1 + 12); +//nop; +t8 = v0 + 0x4; +MEM_U32(sp + 64) = t8; +MEM_U32(sp + 60) = v0; +L427f0c: +//nop; +a0 = s4; +MEM_U32(sp + 68) = v1; +v0 = f_is_fp_reg(mem, sp, a0); +goto L427f1c; +MEM_U32(sp + 68) = v1; +L427f1c: +gp = MEM_U32(sp + 48); +v1 = MEM_U32(sp + 68); +if (v0 == 0) {a0 = zero; +goto L427fa8;} +a0 = zero; +t9 = MEM_U32(v1 + -4); +at = 0x4; +if (t9 != at) {a1 = s4; +goto L427fa8;} +a1 = s4; +t0 = MEM_U16(v1 + 6); +t2 = 0x10003300; +t1 = t0 << 1; +s1 = MEM_U8(v1 + 23); +t3 = t1 + t2; +s3 = MEM_U16(t3 + 0); +s0 = MEM_U32(v1 + 16); +MEM_U32(sp + 16) = s1; +s2 = MEM_U32(v1 + -8); +//nop; +a2 = MEM_U32(sp + 64); +a0 = s3; +a3 = s0; +MEM_U32(sp + 20) = s2; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L427f78; +MEM_U32(sp + 20) = s2; +L427f78: +gp = MEM_U32(sp + 48); +a2 = MEM_U32(sp + 60); +//nop; +a0 = s3; +a1 = s4 + 0x1; +a3 = s0; +MEM_U32(sp + 16) = s1; +MEM_U32(sp + 20) = s2; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L427f9c; +MEM_U32(sp + 20) = s2; +L427f9c: +gp = MEM_U32(sp + 48); +ra = MEM_U32(sp + 52); +goto L428108; +ra = MEM_U32(sp + 52); +L427fa8: +//nop; +a1 = 0x1; +MEM_U32(sp + 68) = v1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L427fb8; +MEM_U32(sp + 68) = v1; +L427fb8: +v1 = MEM_U32(sp + 68); +gp = MEM_U32(sp + 48); +t4 = MEM_U16(v1 + 6); +at = 0x7a; +if (t4 != at) {s3 = v0 & 0xff; +goto L428064;} +s3 = v0 & 0xff; +//nop; +a0 = s3; +a1 = s4; +a2 = 0xd; +MEM_U32(sp + 68) = v1; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L427fe8; +MEM_U32(sp + 68) = v1; +L427fe8: +v1 = MEM_U32(sp + 68); +gp = MEM_U32(sp + 48); +s1 = MEM_U8(v1 + 23); +s0 = MEM_U32(v1 + 16); +MEM_U32(sp + 16) = s1; +s2 = MEM_U32(v1 + -8); +//nop; +a2 = MEM_U32(sp + 64); +a0 = 0xd1; +a1 = s3; +a3 = s0; +MEM_U32(sp + 20) = s2; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L42801c; +MEM_U32(sp + 20) = s2; +L42801c: +gp = MEM_U32(sp + 48); +a0 = s3; +//nop; +a1 = s4 + 0x1; +a2 = 0xd; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L428034; +a2 = 0xd; +L428034: +gp = MEM_U32(sp + 48); +a2 = MEM_U32(sp + 60); +//nop; +a0 = 0xd1; +a1 = s3; +a3 = s0; +MEM_U32(sp + 16) = s1; +MEM_U32(sp + 20) = s2; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L428058; +MEM_U32(sp + 20) = s2; +L428058: +gp = MEM_U32(sp + 48); +//nop; +goto L4280ec; +//nop; +L428064: +s1 = MEM_U8(v1 + 23); +s0 = MEM_U32(v1 + 16); +MEM_U32(sp + 16) = s1; +s2 = MEM_U32(v1 + -8); +//nop; +a2 = MEM_U32(sp + 64); +a0 = 0xce; +a1 = s3; +a3 = s0; +MEM_U32(sp + 20) = s2; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L428090; +MEM_U32(sp + 20) = s2; +L428090: +gp = MEM_U32(sp + 48); +a0 = s4; +//nop; +a1 = s3; +a2 = 0xd; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L4280a8; +a2 = 0xd; +L4280a8: +gp = MEM_U32(sp + 48); +a2 = MEM_U32(sp + 60); +//nop; +a0 = 0xce; +a1 = s3; +a3 = s0; +MEM_U32(sp + 16) = s1; +MEM_U32(sp + 20) = s2; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L4280cc; +MEM_U32(sp + 20) = s2; +L4280cc: +gp = MEM_U32(sp + 48); +a0 = s4 + 0x1; +//nop; +a1 = s3; +a2 = 0xd; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L4280e4; +a2 = 0xd; +L4280e4: +gp = MEM_U32(sp + 48); +//nop; +L4280ec: +//nop; +a0 = s3; +//nop; +f_free_reg(mem, sp, a0); +goto L4280fc; +//nop; +L4280fc: +gp = MEM_U32(sp + 48); +//nop; +ra = MEM_U32(sp + 52); +L428108: +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +s3 = MEM_U32(sp + 40); +s4 = MEM_U32(sp + 44); +sp = sp + 0x48; +return; +sp = sp + 0x48; +} + +static void f_iloadistore(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L428124: +//iloadistore: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 60) = a1; +MEM_U32(sp + 64) = a2; +MEM_U32(sp + 68) = a3; +v1 = MEM_U16(a0 + 34); +t6 = a0; +t8 = MEM_U32(t6 + 48); +if ((int)v1 >= 0) {t7 = (int)v1 >> 3; +goto L428168;} +t7 = (int)v1 >> 3; +at = v1 + 0x7; +t7 = (int)at >> 3; +L428168: +v1 = t7; +if (t7 != 0) {MEM_U32(sp + 48) = t8; +goto L42817c;} +MEM_U32(sp + 48) = t8; +v1 = MEM_U32(t6 + 40); +//nop; +L42817c: +t0 = 0x10018eb4; +t9 = MEM_U32(sp + 56); +t0 = MEM_U8(t0 + 0); +a0 = MEM_U32(t9 + 40); +if (t0 == 0) {//nop; +goto L42819c;} +//nop; +v1 = 0x1; +goto L4281f8; +v1 = 0x1; +L42819c: +t1 = 0x10018eb8; +//nop; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L4281bc;} +//nop; +v1 = 0x2; +goto L4281f8; +v1 = 0x2; +L4281bc: +t2 = 0x10018ebc; +//nop; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L4281dc;} +//nop; +v1 = 0x4; +goto L4281f8; +v1 = 0x4; +L4281dc: +t3 = 0x10018ec0; +//nop; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 == 0) {at = (int)a0 < (int)0x5; +goto L4281fc;} +at = (int)a0 < (int)0x5; +v1 = 0x8; +L4281f8: +at = (int)a0 < (int)0x5; +L4281fc: +if (at != 0) {at = (int)v1 < (int)a0; +goto L42841c;} +at = (int)v1 < (int)a0; +if (at == 0) {at = 0x4; +goto L428420;} +at = 0x4; +//nop; +a0 = MEM_U8(sp + 67); +MEM_U32(sp + 52) = v1; +v0 = f_is_fp_reg(mem, sp, a0); +goto L42821c; +MEM_U32(sp + 52) = v1; +L42821c: +gp = MEM_U32(sp + 32); +v1 = MEM_U32(sp + 52); +if (v0 != 0) {//nop; +goto L42825c;} +//nop; +t4 = MEM_U32(sp + 56); +at = 0xc0000; +t5 = MEM_U8(t4 + 33); +at = at | 0x8000; +t7 = t5 & 0x1f; +t8 = t7 < 0x20; +t6 = -t8; +t9 = t6 & at; +t0 = t9 << (t7 & 0x1f); +if ((int)t0 >= 0) {at = (int)v1 < (int)0x4; +goto L42827c;} +at = (int)v1 < (int)0x4; +MEM_U32(sp + 52) = v1; +L42825c: +//nop; +v0 = sp + 0x38; +t9 = t9; +//nop; +func_427e78(mem, sp, v0); +goto L428270; +//nop; +L428270: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4287d8; +ra = MEM_U32(sp + 36); +L42827c: +if (at == 0) {t6 = MEM_U16(sp + 62); +goto L4283a4;} +t6 = MEM_U16(sp + 62); +v1 = MEM_U16(sp + 62); +t2 = 0x10003300; +t4 = 0x10018e80; +t1 = v1 << 1; +t4 = MEM_U8(t4 + 0); +t3 = t1 + t2; +v1 = MEM_U16(t3 + 0); +if (t4 == 0) {//nop; +goto L428324;} +//nop; +t9 = MEM_U32(sp + 48); +t8 = 0x10003d14; +t5 = v1 << 1; +MEM_U32(sp + 20) = t9; +//nop; +a2 = MEM_U32(sp + 68); +t6 = MEM_U8(sp + 79); +v0 = t5 + t8; +a0 = MEM_U16(v0 + 0); +a1 = MEM_U8(sp + 67); +a3 = MEM_U32(sp + 72); +MEM_U32(sp + 44) = v0; +a2 = a2 + 0x4; +MEM_U32(sp + 16) = t6; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L4282e4; +MEM_U32(sp + 16) = t6; +L4282e4: +gp = MEM_U32(sp + 32); +v0 = MEM_U32(sp + 44); +a1 = MEM_U8(sp + 67); +t7 = MEM_U8(sp + 79); +t0 = MEM_U32(sp + 48); +//nop; +a2 = MEM_U32(sp + 68); +a3 = MEM_U32(sp + 72); +a0 = MEM_U16(v0 + 0); +a1 = a1 + 0x1; +MEM_U32(sp + 16) = t7; +MEM_U32(sp + 20) = t0; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L428318; +MEM_U32(sp + 20) = t0; +L428318: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4287d8; +ra = MEM_U32(sp + 36); +L428324: +t2 = 0x10003d14; +t1 = v1 << 1; +t3 = MEM_U8(sp + 79); +t4 = MEM_U32(sp + 48); +//nop; +v0 = t1 + t2; +a0 = MEM_U16(v0 + 0); +a1 = MEM_U8(sp + 67); +a2 = MEM_U32(sp + 68); +a3 = MEM_U32(sp + 72); +MEM_U32(sp + 44) = v0; +MEM_U32(sp + 16) = t3; +MEM_U32(sp + 20) = t4; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L42835c; +MEM_U32(sp + 20) = t4; +L42835c: +gp = MEM_U32(sp + 32); +v0 = MEM_U32(sp + 44); +a1 = MEM_U8(sp + 67); +a2 = MEM_U32(sp + 68); +t5 = MEM_U8(sp + 79); +t8 = MEM_U32(sp + 48); +//nop; +a3 = MEM_U32(sp + 72); +a0 = MEM_U16(v0 + 0); +a1 = a1 + 0x1; +a2 = a2 + 0x4; +MEM_U32(sp + 16) = t5; +MEM_U32(sp + 20) = t8; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L428394; +MEM_U32(sp + 20) = t8; +L428394: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4287d8; +ra = MEM_U32(sp + 36); +t6 = MEM_U16(sp + 62); +L4283a4: +t7 = 0x10003300; +t9 = t6 << 1; +t0 = t9 + t7; +a0 = MEM_U16(t0 + 0); +//nop; +t2 = MEM_U8(sp + 79); +t3 = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 67); +a2 = MEM_U32(sp + 68); +a3 = MEM_U32(sp + 72); +MEM_U16(sp + 62) = (uint16_t)a0; +MEM_U32(sp + 16) = t2; +MEM_U32(sp + 20) = t3; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L4283dc; +MEM_U32(sp + 20) = t3; +L4283dc: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 67); +a2 = MEM_U32(sp + 68); +t4 = MEM_U8(sp + 79); +t5 = MEM_U32(sp + 48); +//nop; +a0 = MEM_U16(sp + 62); +a3 = MEM_U32(sp + 72); +a1 = a1 + 0x1; +a2 = a2 + 0x4; +MEM_U32(sp + 16) = t4; +MEM_U32(sp + 20) = t5; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L428410; +MEM_U32(sp + 20) = t5; +L428410: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4287d8; +ra = MEM_U32(sp + 36); +L42841c: +at = 0x4; +L428420: +if (a0 != at) {at = (int)v1 < (int)a0; +goto L428508;} +at = (int)v1 < (int)a0; +if (at != 0) {//nop; +goto L42846c;} +//nop; +t8 = MEM_U32(sp + 68); +//nop; +lo = (int)t8 / (int)v1; hi = (int)t8 % (int)v1; +if (v1 != 0) {//nop; +goto L428448;} +//nop; +abort(); +L428448: +at = 0xffffffff; +if (v1 != at) {at = 0x80000000; +goto L428460;} +at = 0x80000000; +if (t8 != at) {//nop; +goto L428460;} +//nop; +abort(); +L428460: +t6 = hi; +if (t6 == 0) {t6 = MEM_U32(sp + 56); +goto L42850c;} +t6 = MEM_U32(sp + 56); +L42846c: +t9 = MEM_U32(sp + 56); +at = 0xd; +t7 = MEM_U8(t9 + 33); +//nop; +t0 = t7 & 0x1f; +if (t0 == at) {//nop; +goto L4284a4;} +//nop; +//nop; +a0 = MEM_U8(sp + 67); +//nop; +v0 = f_is_fp_reg(mem, sp, a0); +goto L428498; +//nop; +L428498: +gp = MEM_U32(sp + 32); +if (v0 == 0) {t1 = MEM_U16(sp + 62); +goto L4284c8;} +t1 = MEM_U16(sp + 62); +L4284a4: +//nop; +v0 = sp + 0x38; +t9 = t9; +//nop; +func_427d64(mem, sp, v0); +goto L4284b8; +//nop; +L4284b8: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4287d8; +ra = MEM_U32(sp + 36); +t1 = MEM_U16(sp + 62); +L4284c8: +t3 = 0x10003d14; +t2 = t1 << 1; +t4 = t2 + t3; +t5 = MEM_U8(sp + 79); +t8 = MEM_U32(sp + 48); +//nop; +a0 = MEM_U16(t4 + 0); +a1 = MEM_U8(sp + 67); +a2 = MEM_U32(sp + 68); +a3 = MEM_U32(sp + 72); +MEM_U32(sp + 16) = t5; +MEM_U32(sp + 20) = t8; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L4284fc; +MEM_U32(sp + 20) = t8; +L4284fc: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4287d8; +ra = MEM_U32(sp + 36); +L428508: +t6 = MEM_U32(sp + 56); +L42850c: +at = 0xc0000; +v0 = MEM_U8(t6 + 33); +at = at | 0x8000; +t9 = v0 & 0x1f; +t7 = t9 < 0x20; +t0 = -t7; +t1 = t0 & at; +t2 = t1 << (t9 & 0x1f); +if ((int)t2 >= 0) {v0 = t9; +goto L428568;} +v0 = t9; +t3 = MEM_U8(sp + 79); +t4 = MEM_U32(sp + 48); +//nop; +a0 = MEM_U16(sp + 62); +a1 = MEM_U8(sp + 67); +a2 = MEM_U32(sp + 68); +a3 = MEM_U32(sp + 72); +MEM_U32(sp + 16) = t3; +MEM_U32(sp + 20) = t4; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L42855c; +MEM_U32(sp + 20) = t4; +L42855c: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4287d8; +ra = MEM_U32(sp + 36); +L428568: +t5 = v0 < 0x20; +t8 = -t5; +at = 0x5010000; +t6 = t8 & at; +t9 = t6 << (v0 & 0x1f); +if ((int)t9 >= 0) {t9 = MEM_U32(sp + 68); +goto L4286a8;} +t9 = MEM_U32(sp + 68); +t7 = 0x10018ecc; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != 0) {t9 = MEM_U32(sp + 68); +goto L4286a8;} +t9 = MEM_U32(sp + 68); +t0 = MEM_U16(sp + 62); +at = 0xc0000; +t1 = t0 + 0xffffffa0; +t2 = t1 < 0x20; +t3 = -t2; +t4 = t3 & at; +t5 = t4 << (t1 & 0x1f); +if ((int)t5 >= 0) {t9 = MEM_U32(sp + 68); +goto L4286a8;} +t9 = MEM_U32(sp + 68); +t6 = 0x10003300; +t8 = t0 << 1; +t9 = t8 + t6; +t7 = MEM_U16(t9 + 0); +t2 = MEM_U8(sp + 79); +t3 = MEM_U8(sp + 67); +MEM_U16(sp + 62) = (uint16_t)t7; +if (t2 != t3) {t1 = MEM_U8(sp + 79); +goto L42861c;} +t1 = MEM_U8(sp + 79); +//nop; +a0 = 0x20; +a1 = 0x6; +f_emit_dir0(mem, sp, a0, a1); +goto L4285f4; +a1 = 0x6; +L4285f4: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 79); +//nop; +a0 = 0x31; +a1 = 0x1; +f_emit_rr(mem, sp, a0, a1, a2); +goto L42860c; +a1 = 0x1; +L42860c: +t4 = 0x1; +gp = MEM_U32(sp + 32); +MEM_U8(sp + 79) = (uint8_t)t4; +t1 = MEM_U8(sp + 79); +L42861c: +t5 = MEM_U32(sp + 48); +//nop; +a0 = MEM_U16(sp + 62); +a1 = MEM_U8(sp + 67); +a2 = MEM_U32(sp + 68); +a3 = MEM_U32(sp + 72); +MEM_U32(sp + 16) = t1; +MEM_U32(sp + 20) = t5; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L428640; +MEM_U32(sp + 20) = t5; +L428640: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 67); +a2 = MEM_U32(sp + 68); +t0 = MEM_U8(sp + 79); +t8 = MEM_U32(sp + 48); +//nop; +a0 = MEM_U16(sp + 62); +a3 = MEM_U32(sp + 72); +a1 = a1 + 0x1; +a2 = a2 + 0x4; +MEM_U32(sp + 16) = t0; +MEM_U32(sp + 20) = t8; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L428674; +MEM_U32(sp + 20) = t8; +L428674: +t6 = MEM_U8(sp + 79); +gp = MEM_U32(sp + 32); +at = 0x1; +if (t6 != at) {ra = MEM_U32(sp + 36); +goto L4287d8;} +ra = MEM_U32(sp + 36); +//nop; +a0 = 0x20; +a1 = 0x5; +f_emit_dir0(mem, sp, a0, a1); +goto L428698; +a1 = 0x5; +L428698: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4287d8; +ra = MEM_U32(sp + 36); +t9 = MEM_U32(sp + 68); +L4286a8: +t2 = MEM_U16(sp + 62); +lo = (int)t9 / (int)a0; hi = (int)t9 % (int)a0; +a1 = MEM_U8(sp + 67); +if (a0 != 0) {//nop; +goto L4286c0;} +//nop; +abort(); +L4286c0: +at = 0xffffffff; +if (a0 != at) {at = 0x80000000; +goto L4286d8;} +at = 0x80000000; +if (t9 != at) {//nop; +goto L4286d8;} +//nop; +abort(); +L4286d8: +a3 = MEM_U32(sp + 72); +t5 = MEM_U8(sp + 79); +at = 0x1; +a2 = t9; +t3 = t2 << 1; +t7 = hi; +if (t7 == 0) {//nop; +goto L428724;} +//nop; +t4 = 0x10003d14; +t0 = MEM_U32(sp + 48); +t1 = t3 + t4; +//nop; +a0 = MEM_U16(t1 + 0); +MEM_U32(sp + 16) = t5; +MEM_U32(sp + 20) = t0; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L428718; +MEM_U32(sp + 20) = t0; +L428718: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4287d8; +ra = MEM_U32(sp + 36); +L428724: +if (v1 != at) {t6 = MEM_U8(sp + 79); +goto L4287a8;} +t6 = MEM_U8(sp + 79); +t8 = MEM_U16(sp + 62); +a1 = MEM_U8(sp + 67); +t6 = t8 + 0xffffffe0; +t7 = t6 < 0x40; +if (t7 == 0) {t2 = (int)t6 >> 5; +goto L428764;} +t2 = (int)t6 >> 5; +t4 = 0x10005288; +t3 = t2 << 2; +t4 = t4; +t1 = t4 + t3; +t9 = MEM_U32(t1 + 0); +//nop; +t5 = t9 << (t6 & 0x1f); +t7 = (int)t5 < (int)0x0; +L428764: +if (t7 == 0) {t2 = t8 << 1; +goto L4287a4;} +t2 = t8 << 1; +t4 = 0x10003d14; +t9 = MEM_U32(sp + 48); +t3 = t2 + t4; +a0 = MEM_U16(t3 + 0); +MEM_U32(sp + 20) = t9; +//nop; +t1 = MEM_U8(sp + 79); +a2 = MEM_U32(sp + 68); +a3 = MEM_U32(sp + 72); +MEM_U32(sp + 16) = t1; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L428798; +MEM_U32(sp + 16) = t1; +L428798: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4287d8; +ra = MEM_U32(sp + 36); +L4287a4: +t6 = MEM_U8(sp + 79); +L4287a8: +t5 = MEM_U32(sp + 48); +//nop; +a0 = MEM_U16(sp + 62); +a1 = MEM_U8(sp + 67); +a2 = MEM_U32(sp + 68); +a3 = MEM_U32(sp + 72); +MEM_U32(sp + 16) = t6; +MEM_U32(sp + 20) = t5; +f_emit_rab(mem, sp, a0, a1, a2, a3); +goto L4287cc; +MEM_U32(sp + 20) = t5; +L4287cc: +gp = MEM_U32(sp + 32); +//nop; +ra = MEM_U32(sp + 36); +L4287d8: +sp = sp + 0x38; +//nop; +return; +//nop; +} + +static void func_4287e4(uint8_t *mem, uint32_t sp, uint32_t v0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4287e4: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s0; +s0 = v0; +MEM_U32(sp + 32) = gp; +a0 = 0x20; +a1 = 0x6; +f_emit_dir0(mem, sp, a0, a1); +goto L428814; +a1 = 0x6; +L428814: +t6 = MEM_U16(s0 + 6); +gp = MEM_U32(sp + 32); +at = 0x79; +if (t6 != at) {a0 = 0xce; +goto L42886c;} +a0 = 0xce; +//nop; +a1 = MEM_U8(s0 + 11); +a0 = 0x1; +a2 = 0xd; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L42883c; +a2 = 0xd; +L42883c: +gp = MEM_U32(sp + 32); +t7 = MEM_U8(s0 + 19); +//nop; +a3 = MEM_U32(s0 + 12); +a0 = 0xd1; +a1 = 0x1; +a2 = zero; +MEM_U32(sp + 16) = t7; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428860; +MEM_U32(sp + 16) = t7; +L428860: +gp = MEM_U32(sp + 32); +//nop; +goto L4288a8; +//nop; +L42886c: +t8 = MEM_U8(s0 + 19); +//nop; +a3 = MEM_U32(s0 + 12); +a1 = 0x1; +a2 = zero; +MEM_U32(sp + 16) = t8; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428888; +MEM_U32(sp + 16) = t8; +L428888: +gp = MEM_U32(sp + 32); +a0 = MEM_U8(s0 + 11); +//nop; +a1 = 0x1; +a2 = 0xd; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L4288a0; +a2 = 0xd; +L4288a0: +gp = MEM_U32(sp + 32); +//nop; +L4288a8: +//nop; +a0 = 0x20; +a1 = 0x5; +f_emit_dir0(mem, sp, a0, a1); +goto L4288b8; +a1 = 0x5; +L4288b8: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_rloadrstore(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4288cc: +//rloadrstore: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +v1 = MEM_U16(a0 + 34); +MEM_U32(sp + 36) = s1; +MEM_U32(sp + 32) = s0; +s0 = a1 & 0xffff; +s1 = a2 & 0xff; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 60) = a1; +MEM_U32(sp + 64) = a2; +MEM_U32(sp + 68) = a3; +if ((int)v1 >= 0) {t6 = (int)v1 >> 3; +goto L428914;} +t6 = (int)v1 >> 3; +at = v1 + 0x7; +t6 = (int)at >> 3; +L428914: +if (t6 != 0) {v1 = t6; +goto L428924;} +v1 = t6; +v1 = MEM_U32(a0 + 40); +//nop; +L428924: +v0 = MEM_U32(a0 + 40); +//nop; +at = (int)v0 < (int)0x5; +if (at != 0) {at = 0x4; +goto L428b98;} +at = 0x4; +t7 = 0x10018ebc; +at = (int)v1 < (int)v0; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L428958;} +//nop; +if (at == 0) {at = 0x4; +goto L428b98;} +at = 0x4; +L428958: +//nop; +a0 = s1; +MEM_U32(sp + 52) = v1; +v0 = f_is_fp_reg(mem, sp, a0); +goto L428968; +MEM_U32(sp + 52) = v1; +L428968: +v1 = MEM_U32(sp + 52); +gp = MEM_U32(sp + 40); +if (v0 == 0) {at = (int)v1 < (int)0x4; +goto L428a4c;} +at = (int)v1 < (int)0x4; +t8 = 0x10018e80; +t3 = s0 << 1; +t8 = MEM_U8(t8 + 0); +a1 = s1; +if (t8 == 0) {a2 = 0x4; +goto L4289f4;} +a2 = 0x4; +t0 = 0x10003300; +t9 = s0 << 1; +v0 = t9 + t0; +//nop; +t1 = MEM_U8(sp + 75); +a0 = MEM_U16(v0 + 0); +a3 = MEM_U32(sp + 68); +MEM_U32(sp + 48) = v0; +a1 = s1; +a2 = zero; +MEM_U32(sp + 16) = t1; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L4289c0; +MEM_U32(sp + 16) = t1; +L4289c0: +gp = MEM_U32(sp + 40); +v0 = MEM_U32(sp + 48); +t2 = MEM_U8(sp + 75); +//nop; +a3 = MEM_U32(sp + 68); +a0 = MEM_U16(v0 + 0); +a1 = s1 + 0x1; +a2 = 0x4; +MEM_U32(sp + 16) = t2; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L4289e8; +MEM_U32(sp + 16) = t2; +L4289e8: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L428e10; +ra = MEM_U32(sp + 44); +L4289f4: +t4 = 0x10003300; +t5 = MEM_U8(sp + 75); +//nop; +v0 = t3 + t4; +a0 = MEM_U16(v0 + 0); +a3 = MEM_U32(sp + 68); +MEM_U32(sp + 48) = v0; +MEM_U32(sp + 16) = t5; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428a18; +MEM_U32(sp + 16) = t5; +L428a18: +gp = MEM_U32(sp + 40); +v0 = MEM_U32(sp + 48); +t6 = MEM_U8(sp + 75); +//nop; +a3 = MEM_U32(sp + 68); +a0 = MEM_U16(v0 + 0); +a1 = s1 + 0x1; +a2 = zero; +MEM_U32(sp + 16) = t6; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428a40; +MEM_U32(sp + 16) = t6; +L428a40: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L428e10; +ra = MEM_U32(sp + 44); +L428a4c: +if (at == 0) {t9 = s0 << 1; +goto L428b38;} +t9 = s0 << 1; +t8 = 0x10003300; +t0 = 0x10018e80; +t7 = s0 << 1; +t0 = MEM_U8(t0 + 0); +t9 = t7 + t8; +s0 = MEM_U16(t9 + 0); +if (t0 == 0) {a1 = s1; +goto L428ad8;} +a1 = s1; +t2 = 0x10003d14; +t1 = s0 << 1; +t3 = MEM_U8(sp + 75); +//nop; +v0 = t1 + t2; +a0 = MEM_U16(v0 + 0); +a3 = MEM_U32(sp + 68); +MEM_U32(sp + 48) = v0; +a1 = s1; +a2 = 0x4; +MEM_U32(sp + 16) = t3; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428aa4; +MEM_U32(sp + 16) = t3; +L428aa4: +gp = MEM_U32(sp + 40); +v0 = MEM_U32(sp + 48); +t4 = MEM_U8(sp + 75); +//nop; +a3 = MEM_U32(sp + 68); +a0 = MEM_U16(v0 + 0); +a1 = s1 + 0x1; +a2 = zero; +MEM_U32(sp + 16) = t4; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428acc; +MEM_U32(sp + 16) = t4; +L428acc: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L428e10; +ra = MEM_U32(sp + 44); +L428ad8: +t6 = 0x10003d14; +t5 = s0 << 1; +t7 = MEM_U8(sp + 75); +//nop; +v0 = t5 + t6; +a0 = MEM_U16(v0 + 0); +a3 = MEM_U32(sp + 68); +MEM_U32(sp + 48) = v0; +a2 = zero; +MEM_U32(sp + 16) = t7; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428b04; +MEM_U32(sp + 16) = t7; +L428b04: +gp = MEM_U32(sp + 40); +v0 = MEM_U32(sp + 48); +t8 = MEM_U8(sp + 75); +//nop; +a3 = MEM_U32(sp + 68); +a0 = MEM_U16(v0 + 0); +a1 = s1 + 0x1; +a2 = 0x4; +MEM_U32(sp + 16) = t8; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428b2c; +MEM_U32(sp + 16) = t8; +L428b2c: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L428e10; +ra = MEM_U32(sp + 44); +L428b38: +t0 = 0x10003300; +t2 = MEM_U8(sp + 75); +t1 = t9 + t0; +s0 = MEM_U16(t1 + 0); +//nop; +a3 = MEM_U32(sp + 68); +a1 = s1; +a2 = zero; +MEM_U32(sp + 16) = t2; +a0 = s0; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428b64; +a0 = s0; +L428b64: +gp = MEM_U32(sp + 40); +t3 = MEM_U8(sp + 75); +//nop; +a3 = MEM_U32(sp + 68); +a0 = s0; +a1 = s1 + 0x1; +a2 = 0x4; +MEM_U32(sp + 16) = t3; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428b88; +MEM_U32(sp + 16) = t3; +L428b88: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L428e10; +ra = MEM_U32(sp + 44); +at = 0x4; +L428b98: +if (v0 != at) {at = (int)v1 < (int)v0; +goto L428c14;} +at = (int)v1 < (int)v0; +if (at == 0) {//nop; +goto L428c14;} +//nop; +t4 = MEM_U8(a0 + 33); +at = 0xd; +t5 = t4 & 0x1f; +if (t5 != at) {t6 = s0 << 1; +goto L428be0;} +t6 = s0 << 1; +//nop; +MEM_U8(sp + 67) = (uint8_t)s1; +t9 = t9; +MEM_U16(sp + 62) = (uint16_t)s0; +v0 = sp + 0x38; +func_4287e4(mem, sp, v0); +goto L428bd4; +v0 = sp + 0x38; +L428bd4: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L428e10; +ra = MEM_U32(sp + 44); +L428be0: +t7 = 0x10003d14; +t9 = MEM_U8(sp + 75); +t8 = t6 + t7; +a0 = MEM_U16(t8 + 0); +MEM_U32(sp + 16) = t9; +//nop; +a3 = MEM_U32(sp + 68); +a1 = s1; +a2 = zero; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428c08; +a2 = zero; +L428c08: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L428e10; +ra = MEM_U32(sp + 44); +L428c14: +v0 = MEM_U8(a0 + 33); +at = 0xc0000; +t0 = v0 & 0x1f; +t1 = t0 < 0x20; +t2 = -t1; +at = at | 0x8000; +t3 = t2 & at; +t4 = t3 << (t0 & 0x1f); +if ((int)t4 >= 0) {v0 = t0; +goto L428c68;} +v0 = t0; +t5 = MEM_U8(sp + 75); +//nop; +a3 = MEM_U32(sp + 68); +a0 = s0; +a1 = s1; +a2 = zero; +MEM_U32(sp + 16) = t5; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428c5c; +MEM_U32(sp + 16) = t5; +L428c5c: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L428e10; +ra = MEM_U32(sp + 44); +L428c68: +t6 = v0 < 0x20; +t7 = -t6; +at = 0x5010000; +t8 = t7 & at; +t9 = t8 << (v0 & 0x1f); +if ((int)t9 >= 0) {at = 0x1; +goto L428d74;} +at = 0x1; +t0 = 0x10018ecc; +t1 = s0 + 0xffffffa0; +t0 = MEM_U8(t0 + 0); +t2 = t1 < 0x20; +if (t0 != 0) {t3 = -t2; +goto L428d70;} +t3 = -t2; +at = 0xc0000; +t4 = t3 & at; +t5 = t4 << (t1 & 0x1f); +if ((int)t5 >= 0) {t6 = s0 << 1; +goto L428d70;} +t6 = s0 << 1; +t7 = 0x10003300; +t9 = MEM_U8(sp + 75); +t8 = t6 + t7; +s0 = MEM_U16(t8 + 0); +if (t9 != s1) {t2 = MEM_U8(sp + 75); +goto L428d00;} +t2 = MEM_U8(sp + 75); +//nop; +a0 = 0x20; +a1 = 0x6; +f_emit_dir0(mem, sp, a0, a1); +goto L428cd8; +a1 = 0x6; +L428cd8: +gp = MEM_U32(sp + 40); +a2 = MEM_U8(sp + 75); +//nop; +a0 = 0x31; +a1 = 0x1; +f_emit_rr(mem, sp, a0, a1, a2); +goto L428cf0; +a1 = 0x1; +L428cf0: +t0 = 0x1; +gp = MEM_U32(sp + 40); +MEM_U8(sp + 75) = (uint8_t)t0; +t2 = MEM_U8(sp + 75); +L428d00: +//nop; +a3 = MEM_U32(sp + 68); +a0 = s0; +a1 = s1; +a2 = zero; +MEM_U32(sp + 16) = t2; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428d1c; +MEM_U32(sp + 16) = t2; +L428d1c: +gp = MEM_U32(sp + 40); +t3 = MEM_U8(sp + 75); +//nop; +a3 = MEM_U32(sp + 68); +a0 = s0; +a1 = s1 + 0x1; +a2 = 0x4; +MEM_U32(sp + 16) = t3; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428d40; +MEM_U32(sp + 16) = t3; +L428d40: +t4 = MEM_U8(sp + 75); +gp = MEM_U32(sp + 40); +at = 0x1; +if (t4 != at) {ra = MEM_U32(sp + 44); +goto L428e10;} +ra = MEM_U32(sp + 44); +//nop; +a0 = 0x20; +a1 = 0x5; +f_emit_dir0(mem, sp, a0, a1); +goto L428d64; +a1 = 0x5; +L428d64: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L428e10; +ra = MEM_U32(sp + 44); +L428d70: +at = 0x1; +L428d74: +if (v1 != at) {t1 = s0 + 0xffffffe0; +goto L428de4;} +t1 = s0 + 0xffffffe0; +t5 = t1 < 0x40; +if (t5 == 0) {t6 = (int)t1 >> 5; +goto L428da8;} +t6 = (int)t1 >> 5; +t8 = 0x10005290; +t7 = t6 << 2; +t8 = t8; +t9 = t8 + t7; +t0 = MEM_U32(t9 + 0); +//nop; +t2 = t0 << (t1 & 0x1f); +t5 = (int)t2 < (int)0x0; +L428da8: +if (t5 == 0) {t4 = s0 << 1; +goto L428de4;} +t4 = s0 << 1; +t6 = 0x10003d14; +t7 = MEM_U8(sp + 75); +//nop; +t8 = t4 + t6; +a0 = MEM_U16(t8 + 0); +a3 = MEM_U32(sp + 68); +a1 = s1; +a2 = zero; +MEM_U32(sp + 16) = t7; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428dd8; +MEM_U32(sp + 16) = t7; +L428dd8: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L428e10; +ra = MEM_U32(sp + 44); +L428de4: +t9 = MEM_U8(sp + 75); +a3 = MEM_U32(sp + 68); +MEM_U32(sp + 16) = t9; +//nop; +a0 = s0; +a1 = s1; +a2 = zero; +f_emit_rrab(mem, sp, a0, a1, a2, a3); +goto L428e04; +a2 = zero; +L428e04: +gp = MEM_U32(sp + 40); +//nop; +ra = MEM_U32(sp + 44); +L428e10: +s0 = MEM_U32(sp + 32); +s1 = MEM_U32(sp + 36); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void f_loadstore_for_two_words(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L428e20: +//loadstore_for_two_words: +//nop; +//nop; +//nop; +t6 = 0x10018e80; +sp = sp + 0xffffffe0; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +if (t6 == 0) {MEM_U32(sp + 40) = a2; +goto L428e90;} +MEM_U32(sp + 40) = a2; +//nop; +a0 = MEM_U16(sp + 34); +a2 = MEM_U8(sp + 43); +a3 = 0x4; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L428e64; +a3 = 0x4; +L428e64: +gp = MEM_U32(sp + 24); +a2 = MEM_U8(sp + 43); +//nop; +a0 = MEM_U16(sp + 34); +a1 = MEM_U32(sp + 36); +a3 = zero; +a2 = a2 + 0x1; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L428e84; +a2 = a2 + 0x1; +L428e84: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L428ed4; +ra = MEM_U32(sp + 28); +L428e90: +//nop; +a0 = MEM_U16(sp + 34); +a1 = MEM_U32(sp + 36); +a2 = MEM_U8(sp + 43); +a3 = zero; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L428ea8; +a3 = zero; +L428ea8: +gp = MEM_U32(sp + 24); +a2 = MEM_U8(sp + 43); +//nop; +a0 = MEM_U16(sp + 34); +a1 = MEM_U32(sp + 36); +a3 = 0x4; +a2 = a2 + 0x1; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L428ec8; +a2 = a2 + 0x1; +L428ec8: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L428ed4: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void f_unaligned_loadstore_for_fp_word(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L428ee0: +//unaligned_loadstore_for_fp_word: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 20) = s0; +MEM_U32(sp + 40) = a2; +MEM_U32(sp + 44) = a3; +a1 = 0x1; +a0 = zero; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L428f1c; +a0 = zero; +L428f1c: +t6 = MEM_U16(sp + 34); +gp = MEM_U32(sp + 24); +at = 0x79; +if (t6 != at) {s0 = v0 & 0xff; +goto L428f6c;} +s0 = v0 & 0xff; +//nop; +a1 = MEM_U8(sp + 43); +a0 = s0; +a2 = 0xd; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L428f44; +a2 = 0xd; +L428f44: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 36); +//nop; +a0 = 0xd1; +a2 = s0; +a3 = zero; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L428f60; +a3 = zero; +L428f60: +gp = MEM_U32(sp + 24); +//nop; +goto L428fa4; +//nop; +L428f6c: +//nop; +a1 = MEM_U32(sp + 36); +a0 = 0xce; +a2 = s0; +a3 = zero; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L428f84; +a3 = zero; +L428f84: +gp = MEM_U32(sp + 24); +a0 = MEM_U8(sp + 43); +//nop; +a1 = s0; +a2 = 0xd; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L428f9c; +a2 = 0xd; +L428f9c: +gp = MEM_U32(sp + 24); +//nop; +L428fa4: +//nop; +a0 = s0; +//nop; +f_free_reg(mem, sp, a0); +goto L428fb4; +//nop; +L428fb4: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +s0 = MEM_U32(sp + 20); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_unaligned_loadstore_for_two_fp_w(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L428fc8: +//unaligned_loadstore_for_two_fp_w: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t6 = 0x10018e80; +MEM_U32(sp + 28) = ra; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 20) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +if (t6 != 0) {MEM_U32(sp + 48) = a2; +goto L429018;} +MEM_U32(sp + 48) = a2; +//nop; +a0 = MEM_U8(sp + 51); +//nop; +v0 = f_is_fp_reg(mem, sp, a0); +goto L42900c; +//nop; +L42900c: +gp = MEM_U32(sp + 24); +if (v0 != 0) {a3 = 0x4; +goto L429028;} +a3 = 0x4; +L429018: +t7 = 0x4; +a3 = zero; +MEM_U32(sp + 32) = t7; +goto L42902c; +MEM_U32(sp + 32) = t7; +L429028: +MEM_U32(sp + 32) = zero; +L42902c: +//nop; +a0 = zero; +a1 = 0x1; +MEM_U32(sp + 36) = a3; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L429040; +MEM_U32(sp + 36) = a3; +L429040: +t8 = MEM_U16(sp + 42); +gp = MEM_U32(sp + 24); +a3 = MEM_U32(sp + 36); +at = 0x79; +if (t8 != at) {s0 = v0 & 0xff; +goto L4290d0;} +s0 = v0 & 0xff; +//nop; +a1 = MEM_U8(sp + 51); +a0 = s0; +a2 = 0xd; +MEM_U32(sp + 36) = a3; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L429070; +MEM_U32(sp + 36) = a3; +L429070: +gp = MEM_U32(sp + 24); +a3 = MEM_U32(sp + 36); +//nop; +a1 = MEM_U32(sp + 44); +a0 = 0xd1; +a2 = s0; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L42908c; +a2 = s0; +L42908c: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 51); +//nop; +a0 = s0; +a2 = 0xd; +a1 = a1 + 0x1; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L4290a8; +a1 = a1 + 0x1; +L4290a8: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 44); +//nop; +a3 = MEM_U32(sp + 32); +a0 = 0xd1; +a2 = s0; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L4290c4; +a2 = s0; +L4290c4: +gp = MEM_U32(sp + 24); +//nop; +goto L42913c; +//nop; +L4290d0: +//nop; +a1 = MEM_U32(sp + 44); +a0 = 0xce; +a2 = s0; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L4290e4; +a2 = s0; +L4290e4: +gp = MEM_U32(sp + 24); +a0 = MEM_U8(sp + 51); +//nop; +a1 = s0; +a2 = 0xd; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L4290fc; +a2 = 0xd; +L4290fc: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 44); +//nop; +a3 = MEM_U32(sp + 32); +a0 = 0xce; +a2 = s0; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L429118; +a2 = s0; +L429118: +gp = MEM_U32(sp + 24); +a0 = MEM_U8(sp + 51); +//nop; +a1 = s0; +a2 = 0xd; +a0 = a0 + 0x1; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L429134; +a0 = a0 + 0x1; +L429134: +gp = MEM_U32(sp + 24); +//nop; +L42913c: +//nop; +a0 = s0; +//nop; +f_free_reg(mem, sp, a0); +goto L42914c; +//nop; +L42914c: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +s0 = MEM_U32(sp + 20); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_loadstore_for_two_fp_words(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L429160: +//loadstore_for_two_fp_words: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t6 = 0x10018e80; +MEM_U32(sp + 28) = s2; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +s0 = a2 & 0xff; +s1 = a0 & 0xffff; +s2 = a1; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 40) = a0; +if (t6 == 0) {MEM_U32(sp + 48) = a2; +goto L4291e0;} +MEM_U32(sp + 48) = a2; +//nop; +a0 = s1; +a2 = s0; +a3 = zero; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L4291b8; +a3 = zero; +L4291b8: +gp = MEM_U32(sp + 32); +a0 = s1; +//nop; +a1 = s2; +a2 = s0 + 0x1; +a3 = 0x4; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L4291d4; +a3 = 0x4; +L4291d4: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L429278; +ra = MEM_U32(sp + 36); +L4291e0: +//nop; +a0 = s0; +//nop; +v0 = f_is_fp_reg(mem, sp, a0); +goto L4291f0; +//nop; +L4291f0: +gp = MEM_U32(sp + 32); +if (v0 == 0) {a0 = s1; +goto L42923c;} +a0 = s1; +//nop; +a0 = s1; +a1 = s2; +a2 = s0; +a3 = 0x4; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L429214; +a3 = 0x4; +L429214: +gp = MEM_U32(sp + 32); +a0 = s1; +//nop; +a1 = s2; +a2 = s0 + 0x1; +a3 = zero; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L429230; +a3 = zero; +L429230: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L429278; +ra = MEM_U32(sp + 36); +L42923c: +//nop; +a1 = s2; +a2 = s0; +a3 = zero; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L429250; +a3 = zero; +L429250: +gp = MEM_U32(sp + 32); +a0 = s1; +//nop; +a1 = s2; +a2 = s0 + 0x1; +a3 = 0x4; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L42926c; +a3 = 0x4; +L42926c: +gp = MEM_U32(sp + 32); +//nop; +ra = MEM_U32(sp + 36); +L429278: +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_42928c(uint8_t *mem, uint32_t sp, uint32_t v0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42928c: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 20) = s0; +v1 = MEM_U32(v0 + -4); +t8 = 0x10003300; +t6 = MEM_U16(v1 + 2); +t1 = 0x10018e80; +t7 = t6 << 1; +t9 = t7 + t8; +t0 = MEM_U16(t9 + 0); +a3 = zero; +MEM_U16(v1 + 2) = (uint16_t)t0; +t1 = MEM_U8(t1 + 0); +t2 = t0 << 1; +if (t1 == 0) {//nop; +goto L429334;} +//nop; +t3 = 0x10003d14; +s0 = MEM_U8(v1 + 11); +a1 = MEM_U32(v1 + 4); +//nop; +v0 = t2 + t3; +a0 = MEM_U16(v0 + 0); +MEM_U32(sp + 36) = v0; +a3 = 0x4; +a2 = s0; +MEM_U32(sp + 32) = a1; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L429308; +MEM_U32(sp + 32) = a1; +L429308: +gp = MEM_U32(sp + 24); +v0 = MEM_U32(sp + 36); +//nop; +a1 = MEM_U32(sp + 32); +a0 = MEM_U16(v0 + 0); +a2 = s0 + 0x1; +a3 = zero; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L429328; +a3 = zero; +L429328: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L429390; +ra = MEM_U32(sp + 28); +L429334: +t4 = MEM_U16(v1 + 2); +t6 = 0x10003d14; +s0 = MEM_U8(v1 + 11); +t5 = t4 << 1; +a1 = MEM_U32(v1 + 4); +//nop; +v0 = t5 + t6; +a0 = MEM_U16(v0 + 0); +MEM_U32(sp + 36) = v0; +a2 = s0; +MEM_U32(sp + 32) = a1; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L429364; +MEM_U32(sp + 32) = a1; +L429364: +gp = MEM_U32(sp + 24); +v0 = MEM_U32(sp + 36); +//nop; +a1 = MEM_U32(sp + 32); +a0 = MEM_U16(v0 + 0); +a2 = s0 + 0x1; +a3 = 0x4; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L429384; +a3 = 0x4; +L429384: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L429390: +s0 = MEM_U32(sp + 20); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_42939c(uint8_t *mem, uint32_t sp, uint32_t v0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42939c: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +v1 = MEM_U32(v0 + -4); +t8 = 0x10003300; +t6 = MEM_U16(v1 + 2); +a2 = MEM_U8(v1 + 11); +t7 = t6 << 1; +t9 = t7 + t8; +t0 = MEM_U16(t9 + 0); +a0 = a2; +MEM_U16(v1 + 2) = (uint16_t)t0; +//nop; +MEM_U32(sp + 40) = v1; +MEM_U32(sp + 36) = a2; +v0 = f_is_fp_reg(mem, sp, a0); +goto L4293e8; +MEM_U32(sp + 36) = a2; +L4293e8: +gp = MEM_U32(sp + 24); +v1 = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 36); +if (v0 != 0) {//nop; +goto L429428;} +//nop; +a1 = MEM_U32(v1 + 4); +at = 0xc0000; +t1 = MEM_U8(a1 + 33); +at = at | 0x8000; +t2 = t1 & 0x1f; +t3 = t2 < 0x20; +t4 = -t3; +t5 = t4 & at; +t6 = t5 << (t2 & 0x1f); +if ((int)t6 >= 0) {//nop; +goto L429448;} +//nop; +L429428: +//nop; +a0 = MEM_U16(v1 + 2); +a1 = MEM_U32(v1 + 4); +//nop; +f_unaligned_loadstore_for_two_fp_w(mem, sp, a0, a1, a2); +goto L42943c; +//nop; +L42943c: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L429464; +ra = MEM_U32(sp + 28); +L429448: +//nop; +a0 = MEM_U16(v1 + 2); +//nop; +f_loadstore_for_two_words(mem, sp, a0, a1, a2); +goto L429458; +//nop; +L429458: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L429464: +sp = sp + 0x30; +//nop; +return; +//nop; +} + +static void func_429470(uint8_t *mem, uint32_t sp, uint32_t v0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L429470: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +a1 = MEM_U32(v0 + 4); +v1 = v0; +t6 = MEM_U32(a1 + 44); +//nop; +t7 = t6 & 0x3; +if (t7 == 0) {//nop; +goto L4294ec;} +//nop; +//nop; +a0 = MEM_U8(v0 + 11); +MEM_U32(sp + 40) = a1; +MEM_U32(sp + 44) = v0; +v0 = f_is_fp_reg(mem, sp, a0); +goto L4294b8; +MEM_U32(sp + 44) = v0; +L4294b8: +gp = MEM_U32(sp + 24); +v1 = MEM_U32(sp + 44); +a1 = MEM_U32(sp + 40); +if (v0 != 0) {//nop; +goto L4294ec;} +//nop; +//nop; +v0 = sp + 0x30; +t9 = t9; +//nop; +func_42928c(mem, sp, v0); +goto L4294e0; +//nop; +L4294e0: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L429674; +ra = MEM_U32(sp + 28); +L4294ec: +MEM_U32(sp + 44) = v1; +t8 = MEM_U32(a1 + 44); +//nop; +t9 = t8 & 0x7; +if (t9 != 0) {//nop; +goto L42951c;} +//nop; +t0 = MEM_U32(v1 + -4); +at = 0x5090000; +t1 = t0 & 0x7; +if (t1 == 0) {//nop; +goto L42953c;} +//nop; +MEM_U32(sp + 44) = v1; +L42951c: +//nop; +v0 = sp + 0x30; +t9 = t9; +//nop; +func_42939c(mem, sp, v0); +goto L429530; +//nop; +L429530: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L429674; +ra = MEM_U32(sp + 28); +L42953c: +t2 = MEM_U8(a1 + 33); +a2 = MEM_U8(v1 + 11); +t3 = t2 & 0x1f; +t4 = t3 < 0x20; +t5 = -t4; +t6 = t5 & at; +t7 = t6 << (t3 & 0x1f); +if ((int)t7 >= 0) {//nop; +goto L429658;} +//nop; +v0 = MEM_U16(v1 + 2); +at = 0xc0000; +t8 = v0 + 0xffffffa0; +t9 = t8 < 0x20; +t0 = -t9; +t1 = t0 & at; +t2 = t1 << (t8 & 0x1f); +if ((int)t2 >= 0) {//nop; +goto L429658;} +//nop; +t4 = 0x10018ecc; +t6 = a2 << 2; +t4 = MEM_U8(t4 + 0); +t6 = t6 - a2; +if (t4 == 0) {//nop; +goto L4295b8;} +//nop; +t3 = 0x10019830; +t6 = t6 << 2; +t7 = t6 + t3; +t9 = MEM_U8(t7 + 9); +t5 = a2 + 0x1; +if (t5 != t9) {//nop; +goto L429658;} +//nop; +L4295b8: +t1 = 0x10003300; +t0 = v0 << 1; +t8 = t0 + t1; +t2 = MEM_U16(t8 + 0); +a0 = a2; +MEM_U16(v1 + 2) = (uint16_t)t2; +//nop; +MEM_U32(sp + 36) = a2; +MEM_U32(sp + 40) = a1; +MEM_U32(sp + 44) = v1; +v0 = f_is_fp_reg(mem, sp, a0); +goto L4295e4; +MEM_U32(sp + 44) = v1; +L4295e4: +gp = MEM_U32(sp + 24); +v1 = MEM_U32(sp + 44); +a1 = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 36); +if (v0 != 0) {at = 0xc0000; +goto L429620;} +at = 0xc0000; +t4 = MEM_U8(a1 + 33); +at = at | 0x8000; +t6 = t4 & 0x1f; +t3 = t6 < 0x20; +t7 = -t3; +t5 = t7 & at; +t9 = t5 << (t6 & 0x1f); +if ((int)t9 >= 0) {//nop; +goto L42963c;} +//nop; +L429620: +//nop; +a0 = MEM_U16(v1 + 2); +//nop; +f_loadstore_for_two_fp_words(mem, sp, a0, a1, a2); +goto L429630; +//nop; +L429630: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L429674; +ra = MEM_U32(sp + 28); +L42963c: +//nop; +a0 = MEM_U16(v1 + 2); +//nop; +f_loadstore_for_two_words(mem, sp, a0, a1, a2); +goto L42964c; +//nop; +L42964c: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L429674; +ra = MEM_U32(sp + 28); +L429658: +//nop; +a0 = MEM_U16(v1 + 2); +a3 = zero; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L429668; +a3 = zero; +L429668: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L429674: +sp = sp + 0x30; +//nop; +return; +//nop; +} + +static void f_unaligned_loadstore(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L429680: +//unaligned_loadstore: +//nop; +//nop; +//nop; +t6 = 0x10018eb4; +sp = sp + 0xffffffd8; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +if (t6 == 0) {MEM_U32(sp + 48) = a2; +goto L4296b8;} +MEM_U32(sp + 48) = a2; +t7 = 0x1; +MEM_U32(sp + 36) = t7; +goto L429704; +MEM_U32(sp + 36) = t7; +L4296b8: +t8 = 0x10018eb8; +t9 = 0x2; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L4296d8;} +//nop; +MEM_U32(sp + 36) = t9; +goto L429704; +MEM_U32(sp + 36) = t9; +L4296d8: +t0 = 0x10018ebc; +//nop; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L4296fc;} +//nop; +t1 = 0x4; +MEM_U32(sp + 36) = t1; +goto L429704; +MEM_U32(sp + 36) = t1; +L4296fc: +t2 = 0x8; +MEM_U32(sp + 36) = t2; +L429704: +v0 = MEM_U32(a1 + 40); +//nop; +at = (int)v0 < (int)0x5; +if (at != 0) {at = 0x4; +goto L429740;} +at = 0x4; +//nop; +MEM_U8(sp + 51) = (uint8_t)a2; +t9 = t9; +MEM_U32(sp + 44) = a1; +v0 = sp + 0x28; +func_429470(mem, sp, v0); +goto L429730; +v0 = sp + 0x28; +L429730: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L42984c; +ra = MEM_U32(sp + 28); +at = 0x4; +L429740: +if (v0 != at) {//nop; +goto L4297cc;} +//nop; +t3 = MEM_U32(a1 + 44); +//nop; +t4 = t3 & 0x3; +if (t4 == 0) {//nop; +goto L4297cc;} +//nop; +//nop; +a0 = a2; +MEM_U32(sp + 44) = a1; +MEM_U8(sp + 51) = (uint8_t)a2; +v0 = f_is_fp_reg(mem, sp, a0); +goto L429770; +MEM_U8(sp + 51) = (uint8_t)a2; +L429770: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 44); +a2 = MEM_U8(sp + 51); +if (v0 == 0) {t5 = MEM_U16(sp + 42); +goto L4297a4;} +t5 = MEM_U16(sp + 42); +//nop; +a0 = MEM_U16(sp + 42); +a3 = zero; +f_unaligned_loadstore_for_fp_word(mem, sp, a0, a1, a2, a3); +goto L429794; +a3 = zero; +L429794: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L42984c; +ra = MEM_U32(sp + 28); +t5 = MEM_U16(sp + 42); +L4297a4: +t7 = 0x10003d14; +t6 = t5 << 1; +//nop; +t8 = t6 + t7; +a0 = MEM_U16(t8 + 0); +a3 = zero; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L4297c0; +a3 = zero; +L4297c0: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L42984c; +ra = MEM_U32(sp + 28); +L4297cc: +t9 = MEM_U32(a1 + 44); +t1 = MEM_U16(sp + 42); +lo = (int)t9 / (int)v0; hi = (int)t9 % (int)v0; +t2 = t1 << 1; +if (v0 != 0) {//nop; +goto L4297e8;} +//nop; +abort(); +L4297e8: +at = 0xffffffff; +if (v0 != at) {at = 0x80000000; +goto L429800;} +at = 0x80000000; +if (t9 != at) {//nop; +goto L429800;} +//nop; +abort(); +L429800: +t0 = hi; +if (t0 == 0) {//nop; +goto L429830;} +//nop; +t3 = 0x10003d14; +//nop; +t4 = t2 + t3; +a0 = MEM_U16(t4 + 0); +a3 = zero; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L429824; +a3 = zero; +L429824: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L42984c; +ra = MEM_U32(sp + 28); +L429830: +//nop; +a0 = MEM_U16(sp + 42); +a3 = zero; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L429840; +a3 = zero; +L429840: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L42984c: +sp = sp + 0x28; +//nop; +return; +//nop; +} + +static void f_eval_2ops(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L429858: +//eval_2ops: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t6 = MEM_U32(a0 + 4); +a3 = MEM_U32(a0 + 0); +MEM_U32(sp + 32) = t6; +t9 = MEM_U8(t6 + 22); +t7 = MEM_U8(a3 + 22); +a2 = a0; +at = t7 < t9; +if (at != 0) {a1 = 0x48; +goto L4298cc;} +a1 = 0x48; +//nop; +a0 = a3; +a1 = 0x48; +MEM_U32(sp + 40) = a2; +f_eval(mem, sp, a0, a1); +goto L4298a8; +MEM_U32(sp + 40) = a2; +L4298a8: +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 40); +//nop; +a0 = MEM_U32(a2 + 4); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L4298c0; +a1 = 0x48; +L4298c0: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L429900; +ra = MEM_U32(sp + 28); +L4298cc: +//nop; +a0 = MEM_U32(sp + 32); +MEM_U32(sp + 40) = a2; +f_eval(mem, sp, a0, a1); +goto L4298dc; +MEM_U32(sp + 40) = a2; +L4298dc: +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 40); +//nop; +a0 = MEM_U32(a2 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L4298f4; +a1 = 0x48; +L4298f4: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L429900: +sp = sp + 0x28; +//nop; +return; +//nop; +} + +static void f_eval_fp_cond(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42990c: +//eval_fp_cond: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 24) = s0; +s0 = a0; +MEM_U32(sp + 52) = a1; +a1 = MEM_U8(s0 + 33); +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s1; +a0 = MEM_U8(a0 + 32); +t6 = a1 & 0x1f; +a1 = t6; +v0 = f_fop(mem, sp, a0, a1); +goto L42994c; +a1 = t6; +L42994c: +gp = MEM_U32(sp + 32); +s1 = v0 & 0xffff; +//nop; +a0 = s0; +//nop; +f_eval_2ops(mem, sp, a0); +goto L429964; +//nop; +L429964: +t7 = MEM_U8(s0 + 32); +at = 0xc00000; +t8 = t7 + 0xffffffe0; +t9 = t8 < 0x20; +t0 = -t9; +t1 = t0 & at; +gp = MEM_U32(sp + 32); +t2 = t1 << (t8 & 0x1f); +if ((int)t2 >= 0) {//nop; +goto L4299c4;} +//nop; +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L42999c; +//nop; +L42999c: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s0 + 4); +//nop; +MEM_U8(sp + 46) = (uint8_t)v0; +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L4299b4; +//nop; +L4299b4: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 46); +a1 = v0 & 0xff; +goto L4299f8; +a1 = v0 & 0xff; +L4299c4: +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L4299d4; +//nop; +L4299d4: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s0 + 4); +//nop; +MEM_U8(sp + 47) = (uint8_t)v0; +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L4299ec; +//nop; +L4299ec: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +a2 = v0 & 0xff; +L4299f8: +//nop; +a0 = s1; +//nop; +f_emit_rr(mem, sp, a0, a1, a2); +goto L429a08; +//nop; +L429a08: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 55); +//nop; +a0 = s0; +//nop; +v0 = f_get_dest(mem, sp, a0, a1); +goto L429a20; +//nop; +L429a20: +gp = MEM_U32(sp + 32); +MEM_U8(sp + 55) = (uint8_t)v0; +//nop; +a0 = 0x31; +a1 = v0 & 0xff; +a2 = zero; +f_emit_rr(mem, sp, a0, a1, a2); +goto L429a3c; +a2 = zero; +L429a3c: +gp = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L429a54; +//nop; +L429a54: +t3 = MEM_U8(s0 + 32); +gp = MEM_U32(sp + 32); +at = 0x5f; +a1 = v0; +if (t3 != at) {s1 = 0x7; +goto L429a70;} +s1 = 0x7; +s1 = 0x8; +L429a70: +//nop; +a0 = s1; +MEM_U32(sp + 40) = a1; +f_emit_ll(mem, sp, a0, a1); +goto L429a80; +MEM_U32(sp + 40) = a1; +L429a80: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 55); +//nop; +a0 = 0x29; +a2 = 0x1; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L429a9c; +a3 = zero; +L429a9c: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 40); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L429ab4; +//nop; +L429ab4: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void f_eval_fp_min_max(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L429acc: +//eval_fp_min_max: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 20) = s0; +s0 = a0; +s2 = a1 & 0xff; +MEM_U32(sp + 60) = a1; +a1 = MEM_U8(s0 + 33); +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 24) = s1; +a0 = MEM_U8(a0 + 32); +t6 = a1 & 0x1f; +a1 = t6; +v0 = f_fop(mem, sp, a0, a1); +goto L429b14; +a1 = t6; +L429b14: +t7 = MEM_U8(s0 + 32); +gp = MEM_U32(sp + 32); +at = 0x55; +MEM_U16(sp + 54) = (uint16_t)v0; +if (t7 != at) {v1 = 0x8; +goto L429b30;} +v1 = 0x8; +v1 = 0x7; +L429b30: +//nop; +a0 = MEM_U32(s0 + 0); +a1 = 0x48; +MEM_U16(sp + 52) = (uint16_t)v1; +f_eval(mem, sp, a0, a1); +goto L429b44; +MEM_U16(sp + 52) = (uint16_t)v1; +L429b44: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s0 + 4); +//nop; +a1 = 0x48; +//nop; +f_eval(mem, sp, a0, a1); +goto L429b5c; +//nop; +L429b5c: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s0 + 0); +//nop; +//nop; +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L429b74; +//nop; +L429b74: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s0 + 4); +//nop; +s1 = v0 & 0xff; +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L429b8c; +//nop; +L429b8c: +gp = MEM_U32(sp + 32); +at = 0x48; +if (s2 == at) {MEM_U8(sp + 46) = (uint8_t)v0; +goto L429bb4;} +MEM_U8(sp + 46) = (uint8_t)v0; +t8 = s2 + 0xffffffe0; +t9 = t8 < 0x20; +t0 = -t9; +t1 = t0 << (t8 & 0x1f); +if ((int)t1 < 0) {a0 = s2; +goto L429cc8;} +a0 = s2; +L429bb4: +//nop; +a0 = s1; +//nop; +v0 = f_usage_count(mem, sp, a0); +goto L429bc4; +//nop; +L429bc4: +gp = MEM_U32(sp + 32); +if (v0 != 0) {//nop; +goto L429c20;} +//nop; +//nop; +a0 = s1; +//nop; +v0 = f_is_available(mem, sp, a0); +goto L429be0; +//nop; +L429be0: +gp = MEM_U32(sp + 32); +if (v0 == 0) {s2 = s1 & 0xff; +goto L429c20;} +s2 = s1 & 0xff; +t2 = MEM_U8(s0 + 33); +t4 = 0x1000327c; +t3 = t2 & 0x1f; +//nop; +t5 = t3 + t4; +a2 = MEM_U8(t5 + 0); +a3 = MEM_U16(s0 + 20); +a0 = s1; +a1 = s0; +f_get_fp_reg(mem, sp, a0, a1, a2, a3); +goto L429c14; +a1 = s0; +L429c14: +gp = MEM_U32(sp + 32); +v0 = MEM_U8(s0 + 25); +goto L429cf8; +v0 = MEM_U8(s0 + 25); +L429c20: +//nop; +a0 = MEM_U8(sp + 46); +//nop; +v0 = f_usage_count(mem, sp, a0); +goto L429c30; +//nop; +L429c30: +gp = MEM_U32(sp + 32); +if (v0 != 0) {//nop; +goto L429c98;} +//nop; +//nop; +a0 = MEM_U8(sp + 46); +//nop; +v0 = f_is_available(mem, sp, a0); +goto L429c4c; +//nop; +L429c4c: +gp = MEM_U32(sp + 32); +if (v0 == 0) {a1 = s0; +goto L429c98;} +a1 = s0; +t6 = MEM_U8(s0 + 33); +t9 = 0x1000327c; +v0 = s1; +s1 = MEM_U8(sp + 46); +t7 = t6 & 0x1f; +t0 = t7 + t9; +//nop; +MEM_U8(sp + 46) = (uint8_t)v0; +a2 = MEM_U8(t0 + 0); +a3 = MEM_U16(s0 + 20); +s2 = s1; +a0 = s1; +f_get_fp_reg(mem, sp, a0, a1, a2, a3); +goto L429c8c; +a0 = s1; +L429c8c: +gp = MEM_U32(sp + 32); +v0 = MEM_U8(s0 + 25); +goto L429cf8; +v0 = MEM_U8(s0 + 25); +L429c98: +t8 = MEM_U8(s0 + 33); +t2 = 0x1000327c; +t1 = t8 & 0x1f; +//nop; +t3 = t1 + t2; +a1 = MEM_U8(t3 + 0); +a2 = MEM_U16(s0 + 20); +a0 = s0; +v0 = f_get_free_fp_reg(mem, sp, a0, a1, a2); +goto L429cbc; +a0 = s0; +L429cbc: +gp = MEM_U32(sp + 32); +s2 = v0 & 0xff; +goto L429cf4; +s2 = v0 & 0xff; +L429cc8: +t4 = MEM_U8(s0 + 33); +t6 = 0x1000327c; +t5 = t4 & 0x1f; +//nop; +t7 = t5 + t6; +a2 = MEM_U8(t7 + 0); +a3 = MEM_U16(s0 + 20); +a1 = s0; +f_get_fp_reg(mem, sp, a0, a1, a2, a3); +goto L429cec; +a1 = s0; +L429cec: +gp = MEM_U32(sp + 32); +//nop; +L429cf4: +v0 = MEM_U8(s0 + 25); +L429cf8: +t4 = MEM_U8(sp + 46); +t9 = v0 << 24; +t0 = t9 >> 25; +t8 = s2 ^ t0; +t1 = t8 << 25; +t2 = t1 >> 24; +t3 = t2 ^ v0; +if (s2 != t4) {MEM_U8(s0 + 25) = (uint8_t)t3; +goto L429d24;} +MEM_U8(s0 + 25) = (uint8_t)t3; +MEM_U8(sp + 46) = (uint8_t)s1; +goto L429d4c; +MEM_U8(sp + 46) = (uint8_t)s1; +L429d24: +if (s2 == s1) {a0 = s2; +goto L429d4c;} +a0 = s2; +a2 = MEM_U8(s0 + 33); +//nop; +t5 = a2 & 0x1f; +a2 = t5; +a1 = s1; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L429d44; +a1 = s1; +L429d44: +gp = MEM_U32(sp + 32); +//nop; +L429d4c: +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L429d5c; +//nop; +L429d5c: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 54); +//nop; +a2 = MEM_U8(sp + 46); +s1 = v0; +a1 = s2; +f_emit_rr(mem, sp, a0, a1, a2); +goto L429d78; +a1 = s2; +L429d78: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 52); +//nop; +a1 = s1; +//nop; +f_emit_ll(mem, sp, a0, a1); +goto L429d90; +//nop; +L429d90: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(s0 + 33); +//nop; +a1 = MEM_U8(sp + 46); +t6 = a2 & 0x1f; +a2 = t6; +a0 = s2; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L429db0; +a0 = s2; +L429db0: +gp = MEM_U32(sp + 32); +a0 = s1; +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L429dc8; +//nop; +L429dc8: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void f_eval2(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L429de4: +//eval2: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 48) = a0; +s0 = a1; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 56) = a2; +a0 = a1; +f_eval_2ops(mem, sp, a0); +goto L429e18; +a0 = a1; +L429e18: +v0 = MEM_U8(s0 + 33); +at = 0xc0000; +t6 = v0 & 0x1f; +t7 = t6 < 0x20; +t8 = -t7; +at = at | 0x8000; +t9 = t8 & at; +gp = MEM_U32(sp + 32); +t0 = t9 << (t6 & 0x1f); +if ((int)t0 >= 0) {v0 = t6; +goto L429e68;} +v0 = t6; +//nop; +a0 = MEM_U32(s0 + 0); +a1 = MEM_U32(s0 + 4); +a2 = sp + 0x2f; +a3 = sp + 0x2e; +f_binary_flt_regs(mem, sp, a0, a1, a2, a3); +goto L429e5c; +a3 = sp + 0x2e; +L429e5c: +gp = MEM_U32(sp + 32); +t5 = MEM_U8(s0 + 33); +goto L429ec8; +t5 = MEM_U8(s0 + 33); +L429e68: +t1 = v0 < 0x20; +t2 = -t1; +at = 0x5010000; +t3 = t2 & at; +t4 = t3 << (v0 & 0x1f); +if ((int)t4 >= 0) {a2 = sp + 0x2f; +goto L429ea8;} +a2 = sp + 0x2f; +//nop; +a0 = MEM_U32(s0 + 0); +a1 = MEM_U32(s0 + 4); +a2 = sp + 0x2f; +a3 = sp + 0x2e; +f_binary_regs(mem, sp, a0, a1, a2, a3); +goto L429e9c; +a3 = sp + 0x2e; +L429e9c: +gp = MEM_U32(sp + 32); +t5 = MEM_U8(s0 + 33); +goto L429ec8; +t5 = MEM_U8(s0 + 33); +L429ea8: +//nop; +a0 = MEM_U32(s0 + 0); +a1 = MEM_U32(s0 + 4); +a3 = sp + 0x2e; +f_binary_regs(mem, sp, a0, a1, a2, a3); +goto L429ebc; +a3 = sp + 0x2e; +L429ebc: +gp = MEM_U32(sp + 32); +//nop; +t5 = MEM_U8(s0 + 33); +L429ec8: +at = 0xc0000; +t6 = t5 & 0x1f; +t7 = t6 < 0x20; +t8 = -t7; +at = at | 0x8000; +t9 = t8 & at; +t0 = t9 << (t6 & 0x1f); +if ((int)t0 >= 0) {//nop; +goto L429f10;} +//nop; +t1 = MEM_U8(sp + 59); +t7 = 0x48; +t2 = t1 + 0xffffffe0; +t3 = t2 < 0x20; +t4 = -t3; +t5 = t4 << (t2 & 0x1f); +if ((int)t5 < 0) {//nop; +goto L429f10;} +//nop; +MEM_U8(sp + 59) = (uint8_t)t7; +L429f10: +//nop; +a1 = MEM_U8(sp + 59); +a0 = s0; +v0 = f_get_dest(mem, sp, a0, a1); +goto L429f20; +a0 = s0; +L429f20: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 50); +//nop; +a2 = MEM_U8(sp + 47); +a3 = MEM_U8(sp + 46); +a1 = v0 & 0xff; +MEM_U32(sp + 16) = s0; +f_dw_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L429f40; +MEM_U32(sp + 16) = s0; +L429f40: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 28); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static uint32_t f_ureg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L429f54: +//ureg: +t6 = MEM_U8(a0 + 1); +at = 0x3; +t7 = t6 << 24; +t8 = t7 >> 29; +if (t8 != at) {v0 = 0x48; +goto L429f8c;} +v0 = 0x48; +v0 = MEM_U32(a0 + 12); +//nop; +if ((int)v0 >= 0) {t9 = (int)v0 >> 2; +goto L429f84;} +t9 = (int)v0 >> 2; +at = v0 + 0x3; +t9 = (int)at >> 2; +L429f84: +v0 = t9; +return v0; +v0 = t9; +L429f8c: +//nop; +return v0; +//nop; +} + +static uint32_t f_copy(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L429f94: +//copy: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 20) = s0; +s0 = a0 & 0xff; +t6 = s0 < 0x20; +t7 = -t6; +t8 = t7 << (s0 & 0x1f); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +if ((int)t8 < 0) {//nop; +goto L429fd0;} +//nop; +abort(); +L429fd0: +//nop; +a0 = s0; +//nop; +v0 = f_usage_count(mem, sp, a0); +goto L429fe0; +//nop; +L429fe0: +gp = MEM_U32(sp + 24); +if (v0 != 0) {//nop; +goto L42a024;} +//nop; +//nop; +a0 = s0; +//nop; +v0 = f_is_available(mem, sp, a0); +goto L429ffc; +//nop; +L429ffc: +gp = MEM_U32(sp + 24); +if (v0 == 0) {a0 = s0; +goto L42a024;} +a0 = s0; +//nop; +a1 = zero; +a2 = 0x1; +f_get_reg(mem, sp, a0, a1, a2); +goto L42a018; +a2 = 0x1; +L42a018: +gp = MEM_U32(sp + 24); +v0 = s0; +goto L42a068; +v0 = s0; +L42a024: +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L42a034; +a1 = 0x1; +L42a034: +gp = MEM_U32(sp + 24); +t9 = v0 & 0xff; +if (s0 == t9) {a1 = v0 & 0xff; +goto L42a064;} +a1 = v0 & 0xff; +//nop; +a0 = 0x31; +a2 = s0; +MEM_U8(sp + 38) = (uint8_t)a1; +f_emit_rr(mem, sp, a0, a1, a2); +goto L42a058; +MEM_U8(sp + 38) = (uint8_t)a1; +L42a058: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 38); +//nop; +L42a064: +v0 = a1; +L42a068: +ra = MEM_U32(sp + 28); +s0 = MEM_U32(sp + 20); +sp = sp + 0x28; +return v0; +sp = sp + 0x28; +} + +static void f_eval_mov(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42a078: +//eval_mov: +//nop; +//nop; +//nop; +sp = sp + 0xfffffee0; +MEM_U32(sp + 196) = ra; +MEM_U32(sp + 192) = gp; +MEM_U32(sp + 188) = s3; +MEM_U32(sp + 184) = s2; +MEM_U32(sp + 180) = s1; +MEM_U32(sp + 176) = s0; +t6 = MEM_U8(a0 + 32); +s1 = MEM_U32(a0 + 40); +at = 0x58; +if (t6 != at) {s0 = a0; +goto L42a0f0;} +s0 = a0; +t7 = MEM_U32(a0 + 36); +//nop; +MEM_U32(sp + 280) = t7; +v0 = MEM_U16(a0 + 34); +t8 = MEM_U32(sp + 280); +if (v0 == 0) {//nop; +goto L42a0d8;} +//nop; +MEM_U32(sp + 276) = v0; +goto L42a0dc; +MEM_U32(sp + 276) = v0; +L42a0d8: +MEM_U32(sp + 276) = t8; +L42a0dc: +t9 = MEM_U32(s0 + 0); +t0 = MEM_U32(s0 + 4); +MEM_U32(sp + 272) = t9; +MEM_U32(sp + 268) = t0; +goto L42a108; +MEM_U32(sp + 268) = t0; +L42a0f0: +t1 = MEM_U16(s0 + 34); +t3 = MEM_U32(s0 + 0); +MEM_U32(sp + 272) = zero; +MEM_U32(sp + 280) = t1; +MEM_U32(sp + 276) = t1; +MEM_U32(sp + 268) = t3; +L42a108: +t4 = MEM_U32(sp + 280); +t6 = MEM_U32(sp + 276); +if ((int)t4 >= 0) {t5 = (int)t4 >> 3; +goto L42a120;} +t5 = (int)t4 >> 3; +at = t4 + 0x7; +t5 = (int)at >> 3; +L42a120: +t8 = MEM_U32(sp + 272); +MEM_U32(sp + 280) = t5; +if ((int)t6 >= 0) {t7 = (int)t6 >> 3; +goto L42a138;} +t7 = (int)t6 >> 3; +at = t6 + 0x7; +t7 = (int)at >> 3; +L42a138: +MEM_U32(sp + 276) = t7; +if (t8 == 0) {s3 = zero; +goto L42a1bc;} +s3 = zero; +t9 = MEM_U16(t8 + 20); +v0 = 0x1; +if (v0 != t9) {t4 = MEM_U32(sp + 268); +goto L42a1c0;} +t4 = MEM_U32(sp + 268); +t0 = MEM_U8(t8 + 32); +//nop; +if (v0 != t0) {t4 = MEM_U32(sp + 268); +goto L42a1c0;} +t4 = MEM_U32(sp + 268); +//nop; +a0 = MEM_U32(t8 + 4); +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L42a174; +//nop; +L42a174: +gp = MEM_U32(sp + 192); +if (v0 == 0) {t4 = MEM_U32(sp + 268); +goto L42a1c0;} +t4 = MEM_U32(sp + 268); +t1 = MEM_U32(sp + 272); +//nop; +t2 = MEM_U32(t1 + 4); +//nop; +v0 = MEM_U32(t2 + 48); +//nop; +at = (int)v0 < (int)0xffff8000; +if (at != 0) {at = 0x8000; +goto L42a1bc;} +at = 0x8000; +at = (int)v0 < (int)at; +if (at == 0) {t4 = MEM_U32(sp + 268); +goto L42a1c0;} +t4 = MEM_U32(sp + 268); +t3 = MEM_U32(t1 + 0); +s3 = v0; +MEM_U32(sp + 272) = t3; +L42a1bc: +t4 = MEM_U32(sp + 268); +L42a1c0: +v0 = 0x1; +t5 = MEM_U16(t4 + 20); +s2 = zero; +if (v0 != t5) {t8 = s1 < 0x20; +goto L42a240;} +t8 = s1 < 0x20; +t6 = MEM_U8(t4 + 32); +//nop; +if (v0 != t6) {t8 = s1 < 0x20; +goto L42a240;} +t8 = s1 < 0x20; +//nop; +a0 = MEM_U32(t4 + 4); +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L42a1f4; +//nop; +L42a1f4: +gp = MEM_U32(sp + 192); +if (v0 == 0) {t8 = s1 < 0x20; +goto L42a240;} +t8 = s1 < 0x20; +t7 = MEM_U32(sp + 268); +//nop; +t9 = MEM_U32(t7 + 4); +//nop; +v0 = MEM_U32(t9 + 48); +//nop; +at = (int)v0 < (int)0xffff8000; +if (at != 0) {at = 0x8000; +goto L42a23c;} +at = 0x8000; +at = (int)v0 < (int)at; +if (at == 0) {t8 = s1 < 0x20; +goto L42a240;} +t8 = s1 < 0x20; +t0 = MEM_U32(t7 + 0); +s2 = v0; +MEM_U32(sp + 268) = t0; +L42a23c: +t8 = s1 < 0x20; +L42a240: +t2 = -t8; +at = 0x68000000; +t1 = t2 & at; +t3 = t1 << (s1 & 0x1f); +if ((int)t3 >= 0) {v0 = 0x1; +goto L42a8dc;} +v0 = 0x1; +t5 = MEM_U32(sp + 280); +t6 = MEM_U32(sp + 276); +at = t5 < 0x2; +if (at != 0) {at = t6 < 0x2; +goto L42a270;} +at = t6 < 0x2; +if (at == 0) {at = 0x2; +goto L42a27c;} +L42a270: +at = 0x2; +if (s1 == at) {t4 = MEM_U32(sp + 272); +goto L42a8e0;} +t4 = MEM_U32(sp + 272); +L42a27c: +t4 = MEM_U32(sp + 272); +t0 = MEM_U32(sp + 268); +if (t4 == 0) {//nop; +goto L42a2ac;} +//nop; +t9 = MEM_U16(t4 + 20); +//nop; +if (v0 != t9) {//nop; +goto L42a8dc;} +//nop; +t7 = MEM_U8(t4 + 32); +at = 0x47; +if (t7 != at) {t4 = MEM_U32(sp + 272); +goto L42a8e0;} +t4 = MEM_U32(sp + 272); +L42a2ac: +t8 = MEM_U16(t0 + 20); +//nop; +if (v0 != t8) {t4 = MEM_U32(sp + 272); +goto L42a8e0;} +t4 = MEM_U32(sp + 272); +t2 = MEM_U8(t0 + 32); +at = 0x47; +if (t2 != at) {t4 = MEM_U32(sp + 272); +goto L42a8e0;} +t4 = MEM_U32(sp + 272); +//nop; +a0 = zero; +a1 = v0; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L42a2dc; +a1 = v0; +L42a2dc: +gp = MEM_U32(sp + 192); +MEM_U8(sp + 255) = (uint8_t)v0; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L42a2f4; +//nop; +L42a2f4: +t1 = s1 + 0xffffffff; +gp = MEM_U32(sp + 192); +at = t1 < 0x4; +if (at == 0) {//nop; +goto L42a394;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100092ec[] = { +&&L42a328, +&&L42a33c, +&&L42a394, +&&L42a350, +}; +dest = Lswitch100092ec[t1]; +//nop; +goto *dest; +//nop; +L42a328: +t3 = 0x26; +t5 = 0x46; +MEM_U16(sp + 258) = (uint16_t)t3; +MEM_U16(sp + 256) = (uint16_t)t5; +goto L42a3b8; +MEM_U16(sp + 256) = (uint16_t)t5; +L42a33c: +t6 = 0x28; +t9 = 0x4c; +MEM_U16(sp + 258) = (uint16_t)t6; +MEM_U16(sp + 256) = (uint16_t)t9; +goto L42a3b8; +MEM_U16(sp + 256) = (uint16_t)t9; +L42a350: +t4 = MEM_U32(sp + 280); +t7 = 0xce; +at = (int)t4 < (int)0x4; +if (at == 0) {t8 = 0x2a; +goto L42a36c;} +t8 = 0x2a; +MEM_U16(sp + 258) = (uint16_t)t7; +goto L42a370; +MEM_U16(sp + 258) = (uint16_t)t7; +L42a36c: +MEM_U16(sp + 258) = (uint16_t)t8; +L42a370: +t0 = MEM_U32(sp + 276); +t2 = 0xd1; +at = (int)t0 < (int)0x4; +if (at == 0) {t1 = 0x57; +goto L42a38c;} +t1 = 0x57; +MEM_U16(sp + 256) = (uint16_t)t2; +goto L42a3b8; +MEM_U16(sp + 256) = (uint16_t)t2; +L42a38c: +MEM_U16(sp + 256) = (uint16_t)t1; +goto L42a3b8; +MEM_U16(sp + 256) = (uint16_t)t1; +L42a394: +a2 = 0x100092e6; +//nop; +a0 = 0x1; +a1 = 0x9c8; +a3 = 0x6; +a2 = a2; +f_caseerror(mem, sp, a0, a1, a2, a3); +goto L42a3b0; +a2 = a2; +L42a3b0: +gp = MEM_U32(sp + 192); +//nop; +L42a3b8: +v1 = MEM_U32(sp + 268); +//nop; +v0 = MEM_U8(v1 + 33); +//nop; +t3 = v0 << 24; +t5 = t3 >> 29; +t6 = t5 & 0xff; +t9 = t6 + 0xffffffff; +at = t9 < 0x4; +if (at == 0) {//nop; +goto L42a530;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100092fc[] = { +&&L42a404, +&&L42a404, +&&L42a530, +&&L42a4f8, +}; +dest = Lswitch100092fc[t9]; +//nop; +goto *dest; +//nop; +L42a404: +//nop; +a0 = MEM_U32(v1 + 36); +//nop; +v0 = f_get_sym_kind(mem, sp, a0); +goto L42a414; +//nop; +L42a414: +gp = MEM_U32(sp + 192); +at = 0x5; +if (v0 != at) {//nop; +goto L42a4b4;} +//nop; +t4 = 0x10018ed0; +at = 0x1; +t4 = MEM_U8(t4 + 0); +a1 = MEM_U8(sp + 255); +if (t4 != at) {//nop; +goto L42a468;} +//nop; +s1 = 0x10019380; +t7 = MEM_U32(sp + 268); +//nop; +a1 = MEM_U8(sp + 255); +a2 = MEM_U8(s1 + 0); +a3 = MEM_U32(t7 + 36); +a0 = 0x139; +f_emit_rrri(mem, sp, a0, a1, a2, a3); +goto L42a45c; +a0 = 0x139; +L42a45c: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 255); +goto L42a490; +a1 = MEM_U8(sp + 255); +L42a468: +s1 = 0x10019380; +t8 = MEM_U32(sp + 268); +//nop; +a2 = MEM_U8(s1 + 0); +a3 = MEM_U32(t8 + 36); +a0 = 0x56; +f_emit_rrri(mem, sp, a0, a1, a2, a3); +goto L42a484; +a0 = 0x56; +L42a484: +gp = MEM_U32(sp + 192); +//nop; +a1 = MEM_U8(sp + 255); +L42a490: +//nop; +a0 = MEM_U16(sp + 258); +a2 = zero; +MEM_U32(sp + 16) = zero; +a3 = a1; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42a4a8; +a3 = a1; +L42a4a8: +gp = MEM_U32(sp + 192); +v1 = MEM_U32(sp + 272); +goto L42a648; +v1 = MEM_U32(sp + 272); +L42a4b4: +//nop; +a0 = MEM_U32(sp + 268); +//nop; +v0 = f_frame_offset(mem, sp, a0); +goto L42a4c4; +//nop; +L42a4c4: +gp = MEM_U32(sp + 192); +s2 = s2 + v0; +s1 = 0x10019380; +//nop; +a0 = MEM_U16(sp + 258); +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(s1 + 0); +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42a4ec; +MEM_U32(sp + 16) = zero; +L42a4ec: +gp = MEM_U32(sp + 192); +v1 = MEM_U32(sp + 272); +goto L42a648; +v1 = MEM_U32(sp + 272); +L42a4f8: +t0 = MEM_U32(v1 + 44); +//nop; +a0 = MEM_U16(sp + 258); +a1 = MEM_U8(sp + 255); +a2 = MEM_U32(v1 + 36); +s2 = s2 + t0; +a3 = s2; +MEM_U32(sp + 16) = zero; +f_emit_ra(mem, sp, a0, a1, a2, a3); +goto L42a51c; +MEM_U32(sp + 16) = zero; +L42a51c: +gp = MEM_U32(sp + 192); +//nop; +s1 = 0x10019380; +v1 = MEM_U32(sp + 272); +goto L42a648; +v1 = MEM_U32(sp + 272); +L42a530: +t2 = 0x10009296; +a0 = 0x4; +t2 = t2; +t3 = t2 + 0x48; +a1 = 0x9f8; +t5 = sp; +L42a548: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t5 = t5 + 0xc; +MEM_U8(t5 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t5) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t5 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 4 + 3) = (uint8_t)(at >> 0); +if (t2 != t3) {//swr $at, 7($t5) +goto L42a548;} +//swr $at, 7($t5) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t6 = 0x10009246; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +t3 = t2 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t2) +t6 = t6; +MEM_U8(t5 + 12 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t5 + 12 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t5 + 12 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t5 + 12 + 3) = (uint8_t)(t3 >> 0); +t4 = t6 + 0x48; +t7 = sp; +//swr $t3, 0xf($t5) +L42a5b8: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t6 != t4) {//swr $at, 0x57($t7) +goto L42a5b8;} +//swr $at, 0x57($t7) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t4 = t6 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t6) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t4 >> 0); +//swr $t4, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L42a634; +//nop; +L42a634: +gp = MEM_U32(sp + 192); +//nop; +s1 = 0x10019380; +//nop; +v1 = MEM_U32(sp + 272); +L42a648: +a0 = MEM_U16(sp + 256); +if (v1 != 0) {a3 = 0x1d; +goto L42a678;} +a3 = 0x1d; +t8 = MEM_U32(s0 + 44); +//nop; +a1 = MEM_U8(sp + 255); +MEM_U32(sp + 16) = zero; +a2 = s3 + t8; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42a66c; +a2 = s3 + t8; +L42a66c: +gp = MEM_U32(sp + 192); +ra = MEM_U32(sp + 196); +goto L42b40c; +ra = MEM_U32(sp + 196); +L42a678: +v0 = MEM_U8(v1 + 33); +//nop; +t0 = v0 << 24; +t1 = t0 >> 29; +t3 = t1 & 0xff; +t2 = t3 + 0xffffffff; +at = t2 < 0x4; +if (at == 0) {//nop; +goto L42a7cc;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000930c[] = { +&&L42a6bc, +&&L42a6bc, +&&L42a7cc, +&&L42a7a0, +}; +dest = Lswitch1000930c[t2]; +//nop; +goto *dest; +//nop; +L42a6bc: +//nop; +a0 = MEM_U32(v1 + 36); +//nop; +v0 = f_get_sym_kind(mem, sp, a0); +goto L42a6cc; +//nop; +L42a6cc: +gp = MEM_U32(sp + 192); +at = 0x5; +if (v0 != at) {//nop; +goto L42a764;} +//nop; +t5 = 0x10018ed0; +at = 0x1; +t5 = MEM_U8(t5 + 0); +a1 = MEM_U8(sp + 255); +if (t5 != at) {t4 = MEM_U32(sp + 272); +goto L42a720;} +t4 = MEM_U32(sp + 272); +t9 = MEM_U32(sp + 272); +a1 = MEM_U8(sp + 255); +a3 = MEM_U32(t9 + 36); +//nop; +a2 = MEM_U8(s1 + 0); +a0 = 0x139; +f_emit_rrri(mem, sp, a0, a1, a2, a3); +goto L42a710; +a0 = 0x139; +L42a710: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 255); +goto L42a740; +a1 = MEM_U8(sp + 255); +t4 = MEM_U32(sp + 272); +L42a720: +//nop; +a2 = MEM_U8(s1 + 0); +a3 = MEM_U32(t4 + 36); +a0 = 0x56; +f_emit_rrri(mem, sp, a0, a1, a2, a3); +goto L42a734; +a0 = 0x56; +L42a734: +gp = MEM_U32(sp + 192); +//nop; +a1 = MEM_U8(sp + 255); +L42a740: +//nop; +a0 = MEM_U16(sp + 256); +a2 = zero; +MEM_U32(sp + 16) = zero; +a3 = a1; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42a758; +a3 = a1; +L42a758: +gp = MEM_U32(sp + 192); +ra = MEM_U32(sp + 196); +goto L42b40c; +ra = MEM_U32(sp + 196); +L42a764: +//nop; +a0 = MEM_U32(sp + 272); +//nop; +v0 = f_frame_offset(mem, sp, a0); +goto L42a774; +//nop; +L42a774: +gp = MEM_U32(sp + 192); +a0 = MEM_U16(sp + 256); +//nop; +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(s1 + 0); +a2 = s3 + v0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42a794; +MEM_U32(sp + 16) = zero; +L42a794: +gp = MEM_U32(sp + 192); +ra = MEM_U32(sp + 196); +goto L42b40c; +ra = MEM_U32(sp + 196); +L42a7a0: +t6 = MEM_U32(v1 + 44); +//nop; +a0 = MEM_U16(sp + 256); +a1 = MEM_U8(sp + 255); +a2 = MEM_U32(v1 + 36); +MEM_U32(sp + 16) = zero; +a3 = s3 + t6; +f_emit_ra(mem, sp, a0, a1, a2, a3); +goto L42a7c0; +a3 = s3 + t6; +L42a7c0: +gp = MEM_U32(sp + 192); +ra = MEM_U32(sp + 196); +goto L42b40c; +ra = MEM_U32(sp + 196); +L42a7cc: +t7 = 0x100091f6; +a0 = 0x4; +t7 = t7; +t0 = t7 + 0x48; +a1 = 0xa17; +t1 = sp; +L42a7e4: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t1 = t1 + 0xc; +MEM_U8(t1 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t1) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t1 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t0) {//swr $at, 7($t1) +goto L42a7e4;} +//swr $at, 7($t1) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t3 = 0x100091a6; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +t0 = t7 + 4; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 7($t7) +t3 = t3; +MEM_U8(t1 + 12 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(t1 + 12 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(t1 + 12 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(t1 + 12 + 3) = (uint8_t)(t0 >> 0); +t5 = t3 + 0x48; +t9 = sp; +//swr $t0, 0xf($t1) +L42a854: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t9 = t9 + 0xc; +MEM_U8(t9 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t9) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t9 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 84 + 3) = (uint8_t)(at >> 0); +if (t3 != t5) {//swr $at, 0x57($t9) +goto L42a854;} +//swr $at, 0x57($t9) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +//nop; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +//nop; +MEM_U8(t9 + 92 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t9 + 92 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t9 + 92 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t9 + 92 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x5f($t9) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L42a8d0; +//nop; +L42a8d0: +gp = MEM_U32(sp + 192); +ra = MEM_U32(sp + 196); +goto L42b40c; +ra = MEM_U32(sp + 196); +L42a8dc: +t4 = MEM_U32(sp + 272); +L42a8e0: +//nop; +if (t4 == 0) {//nop; +goto L42a904;} +//nop; +//nop; +a0 = t4; +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L42a8fc; +a1 = 0x48; +L42a8fc: +gp = MEM_U32(sp + 192); +//nop; +L42a904: +//nop; +a0 = MEM_U32(sp + 268); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L42a914; +a1 = 0x48; +L42a914: +t6 = MEM_U32(sp + 272); +gp = MEM_U32(sp + 192); +if (t6 != 0) {t0 = s1 & 0x3; +goto L42a934;} +t0 = s1 & 0x3; +t8 = MEM_U32(s0 + 44); +//nop; +v1 = s3 + t8; +MEM_U32(sp + 232) = v1; +L42a934: +v1 = MEM_U32(sp + 232); +if (t0 != 0) {at = (int)v1 < (int)0x7ff8; +goto L42a9c4;} +at = (int)v1 < (int)0x7ff8; +if (at == 0) {at = (int)s2 < (int)0x7ff8; +goto L42a9c4;} +at = (int)s2 < (int)0x7ff8; +if (at == 0) {t2 = v1 + s1; +goto L42a9c8;} +t2 = v1 + s1; +t7 = MEM_U32(sp + 280); +v0 = 0x4; +if (t7 != v0) {t2 = v1 + s1; +goto L42a9c8;} +t2 = v1 + s1; +t1 = MEM_U32(sp + 276); +at = (int)s1 < (int)0x21; +if (t1 != v0) {t2 = v1 + s1; +goto L42a9c8;} +t2 = v1 + s1; +if (at != 0) {t2 = v1 + s1; +goto L42a9c8;} +t2 = v1 + s1; +//nop; +a0 = 0x20; +a1 = 0x6; +f_emit_dir0(mem, sp, a0, a1); +goto L42a988; +a1 = 0x6; +L42a988: +gp = MEM_U32(sp + 192); +a0 = zero; +//nop; +a1 = 0x1; +//nop; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L42a9a0; +//nop; +L42a9a0: +gp = MEM_U32(sp + 192); +a0 = v0 & 0xff; +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L42a9b8; +//nop; +L42a9b8: +gp = MEM_U32(sp + 192); +t3 = MEM_U32(sp + 272); +goto L42aa90; +t3 = MEM_U32(sp + 272); +L42a9c4: +t2 = v1 + s1; +L42a9c8: +at = (int)t2 < (int)0x7ff9; +if (at == 0) {t5 = s2 + s1; +goto L42a9e0;} +t5 = s2 + s1; +at = (int)t5 < (int)0x7ff9; +if (at != 0) {//nop; +goto L42aa44;} +//nop; +L42a9e0: +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L42a9f0; +a1 = 0x1; +L42a9f0: +gp = MEM_U32(sp + 192); +MEM_U8(sp + 255) = (uint8_t)v0; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L42aa08; +a1 = 0x1; +L42aa08: +gp = MEM_U32(sp + 192); +a0 = v0 & 0xff; +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L42aa20; +//nop; +L42aa20: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(sp + 255); +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L42aa38; +//nop; +L42aa38: +gp = MEM_U32(sp + 192); +t3 = MEM_U32(sp + 272); +goto L42aa90; +t3 = MEM_U32(sp + 272); +L42aa44: +//nop; +a0 = 0x20; +a1 = 0x6; +f_emit_dir0(mem, sp, a0, a1); +goto L42aa54; +a1 = 0x6; +L42aa54: +gp = MEM_U32(sp + 192); +a0 = zero; +//nop; +a1 = 0x1; +//nop; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L42aa6c; +//nop; +L42aa6c: +gp = MEM_U32(sp + 192); +a0 = v0 & 0xff; +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L42aa84; +//nop; +L42aa84: +gp = MEM_U32(sp + 192); +//nop; +t3 = MEM_U32(sp + 272); +L42aa90: +t9 = 0x1d; +if (t3 != 0) {//nop; +goto L42aaac;} +//nop; +t4 = MEM_U32(s0 + 44); +MEM_U8(sp + 252) = (uint8_t)t9; +s3 = s3 + t4; +goto L42aac4; +s3 = s3 + t4; +L42aaac: +//nop; +a0 = MEM_U32(sp + 272); +//nop; +v0 = f_reg(mem, sp, a0); +goto L42aabc; +//nop; +L42aabc: +gp = MEM_U32(sp + 192); +MEM_U8(sp + 252) = (uint8_t)v0; +L42aac4: +//nop; +a0 = MEM_U32(sp + 268); +//nop; +v0 = f_reg(mem, sp, a0); +goto L42aad4; +//nop; +L42aad4: +gp = MEM_U32(sp + 192); +at = (int)s3 < (int)0x7ff4; +if (at == 0) {MEM_U8(sp + 253) = (uint8_t)v0; +goto L42ab18;} +MEM_U8(sp + 253) = (uint8_t)v0; +at = (int)s2 < (int)0x7ff4; +if (at == 0) {t6 = s3 + s1; +goto L42ab18;} +t6 = s3 + s1; +at = 0x8000; +at = (int)t6 < (int)at; +if (at == 0) {t8 = s2 + s1; +goto L42ab0c;} +t8 = s2 + s1; +at = 0x8000; +at = (int)t8 < (int)at; +if (at != 0) {at = (int)s1 < (int)0x21; +goto L42ab84;} +L42ab0c: +at = (int)s1 < (int)0x21; +if (at == 0) {//nop; +goto L42ab84;} +//nop; +L42ab18: +//nop; +t0 = 0x1; +MEM_U8(sp + 243) = (uint8_t)t0; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L42ab30; +a1 = 0x1; +L42ab30: +gp = MEM_U32(sp + 192); +MEM_U8(sp + 255) = (uint8_t)v0; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L42ab48; +a1 = 0x1; +L42ab48: +gp = MEM_U32(sp + 192); +MEM_U8(sp + 254) = (uint8_t)v0; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L42ab60; +//nop; +L42ab60: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(sp + 255); +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L42ab78; +//nop; +L42ab78: +gp = MEM_U32(sp + 192); +t1 = MEM_U32(sp + 280); +goto L42abd8; +t1 = MEM_U32(sp + 280); +L42ab84: +//nop; +MEM_U8(sp + 243) = (uint8_t)zero; +a0 = 0x20; +a1 = 0x6; +f_emit_dir0(mem, sp, a0, a1); +goto L42ab98; +a1 = 0x6; +L42ab98: +gp = MEM_U32(sp + 192); +t7 = 0x1; +//nop; +MEM_U8(sp + 255) = (uint8_t)t7; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L42abb4; +a1 = 0x1; +L42abb4: +gp = MEM_U32(sp + 192); +MEM_U8(sp + 254) = (uint8_t)v0; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L42abcc; +//nop; +L42abcc: +gp = MEM_U32(sp + 192); +//nop; +t1 = MEM_U32(sp + 280); +L42abd8: +t2 = 0xce; +at = (int)t1 < (int)0x4; +if (at == 0) {t5 = 0x2a; +goto L42abf0;} +t5 = 0x2a; +MEM_U16(sp + 258) = (uint16_t)t2; +goto L42abf4; +MEM_U16(sp + 258) = (uint16_t)t2; +L42abf0: +MEM_U16(sp + 258) = (uint16_t)t5; +L42abf4: +t3 = MEM_U32(sp + 276); +t9 = 0xd1; +at = (int)t3 < (int)0x4; +if (at == 0) {t4 = 0x57; +goto L42ac10;} +t4 = 0x57; +MEM_U16(sp + 256) = (uint16_t)t9; +goto L42ac14; +MEM_U16(sp + 256) = (uint16_t)t9; +L42ac10: +MEM_U16(sp + 256) = (uint16_t)t4; +L42ac14: +t6 = 0x10018ecc; +at = 0x1; +t6 = MEM_U8(t6 + 0); +t8 = MEM_U32(sp + 280); +if (t6 != at) {s0 = 0x4; +goto L42ac60;} +s0 = 0x4; +v0 = 0x8; +if (t8 != v0) {//nop; +goto L42ac60;} +//nop; +t0 = MEM_U32(sp + 276); +t7 = 0x1; +if (t0 != v0) {t1 = 0x6c; +goto L42ac60;} +t1 = 0x6c; +t2 = 0x6d; +MEM_U8(sp + 241) = (uint8_t)t7; +s0 = 0x8; +MEM_U16(sp + 258) = (uint16_t)t1; +MEM_U16(sp + 256) = (uint16_t)t2; +goto L42ac64; +MEM_U16(sp + 256) = (uint16_t)t2; +L42ac60: +MEM_U8(sp + 241) = (uint8_t)zero; +L42ac64: +t5 = s0 << 3; +at = t5 < s1; +if (at == 0) {t6 = MEM_U32(sp + 272); +goto L42aea0;} +t6 = MEM_U32(sp + 272); +//nop; +a0 = MEM_U8(sp + 253); +//nop; +v0 = f_copy(mem, sp, a0); +goto L42ac84; +//nop; +L42ac84: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(sp + 252); +//nop; +MEM_U8(sp + 253) = (uint8_t)v0; +//nop; +v0 = f_copy(mem, sp, a0); +goto L42ac9c; +//nop; +L42ac9c: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(sp + 253); +//nop; +MEM_U8(sp + 252) = (uint8_t)v0; +//nop; +f_free_reg(mem, sp, a0); +goto L42acb4; +//nop; +L42acb4: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(sp + 252); +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L42accc; +//nop; +L42accc: +v1 = s0 << 2; +v1 = v1 - s0; +lo = s1 / v1; hi = s1 % v1; +gp = MEM_U32(sp + 192); +if (v1 != 0) {//nop; +goto L42ace8;} +//nop; +abort(); +L42ace8: +//nop; +a1 = MEM_U8(sp + 254); +a2 = MEM_U8(sp + 253); +MEM_U32(sp + 212) = v1; +a0 = 0x2; +MEM_U32(sp + 16) = zero; +t3 = lo; +//nop; +//nop; +lo = t3 * v1; +hi = (uint32_t)((uint64_t)t3 * (uint64_t)v1 >> 32); +v0 = lo; +a3 = v0; +s1 = s1 - v0; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42ad20; +s1 = s1 - v0; +L42ad20: +gp = MEM_U32(sp + 192); +//nop; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L42ad38; +//nop; +L42ad38: +gp = MEM_U32(sp + 192); +MEM_U32(sp + 244) = v0; +//nop; +a0 = v0; +//nop; +f_define_label(mem, sp, a0); +goto L42ad50; +//nop; +L42ad50: +gp = MEM_U32(sp + 192); +a0 = MEM_U16(sp + 258); +//nop; +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(sp + 253); +v0 = zero; +a2 = s2; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 208) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42ad78; +MEM_U32(sp + 208) = zero; +L42ad78: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 253); +a3 = MEM_U32(sp + 212); +//nop; +a0 = 0x2; +MEM_U32(sp + 16) = zero; +a2 = a1; +MEM_U32(sp + 204) = a3; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42ad9c; +MEM_U32(sp + 204) = a3; +L42ad9c: +t9 = MEM_U32(sp + 208); +gp = MEM_U32(sp + 192); +a2 = s3 + t9; +//nop; +a0 = MEM_U16(sp + 256); +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(sp + 252); +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42adc0; +MEM_U32(sp + 16) = zero; +L42adc0: +gp = MEM_U32(sp + 192); +a0 = MEM_U16(sp + 258); +//nop; +a1 = MEM_U8(sp + 255); +v0 = s0 << 1; +a3 = MEM_U8(sp + 253); +a2 = s2 - v0; +MEM_U32(sp + 212) = v0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42ade8; +MEM_U32(sp + 16) = zero; +L42ade8: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 252); +//nop; +a3 = MEM_U32(sp + 204); +a0 = 0x2; +MEM_U32(sp + 16) = zero; +a2 = a1; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42ae08; +a2 = a1; +L42ae08: +gp = MEM_U32(sp + 192); +t4 = MEM_U32(sp + 212); +//nop; +a0 = MEM_U16(sp + 256); +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(sp + 252); +MEM_U32(sp + 16) = zero; +a2 = s3 - t4; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42ae2c; +a2 = s3 - t4; +L42ae2c: +gp = MEM_U32(sp + 192); +a0 = MEM_U16(sp + 258); +//nop; +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(sp + 253); +v0 = s0; +a2 = s2 - s0; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 212) = s0; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42ae54; +MEM_U32(sp + 212) = s0; +L42ae54: +gp = MEM_U32(sp + 192); +v0 = MEM_U32(sp + 212); +//nop; +a0 = MEM_U16(sp + 256); +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(sp + 252); +MEM_U32(sp + 16) = zero; +a2 = s3 - v0; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42ae78; +a2 = s3 - v0; +L42ae78: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 253); +//nop; +a2 = MEM_U8(sp + 254); +a3 = MEM_U32(sp + 244); +a0 = 0x1a; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L42ae94; +a0 = 0x1a; +L42ae94: +gp = MEM_U32(sp + 192); +//nop; +t6 = MEM_U32(sp + 272); +L42aea0: +MEM_U8(sp + 242) = (uint8_t)zero; +if (t6 == 0) {at = s1 < s0; +goto L42af08;} +at = s1 < s0; +t8 = MEM_U8(t6 + 32); +at = 0x47; +if (t8 != at) {at = s1 < s0; +goto L42af08;} +at = s1 < s0; +t0 = MEM_U32(sp + 268); +at = 0x47; +t7 = MEM_U8(t0 + 32); +//nop; +if (t7 != at) {at = s1 < s0; +goto L42af08;} +at = s1 < s0; +t1 = MEM_U32(t0 + 36); +t2 = MEM_U32(t6 + 36); +t5 = 0x1; +if (t1 == t2) {a0 = 0x30; +goto L42af04;} +a0 = 0x30; +//nop; +a1 = MEM_U8(sp + 253); +a2 = MEM_U8(sp + 252); +MEM_U8(sp + 242) = (uint8_t)t5; +f_emit_alias(mem, sp, a0, a1, a2); +goto L42aefc; +MEM_U8(sp + 242) = (uint8_t)t5; +L42aefc: +gp = MEM_U32(sp + 192); +//nop; +L42af04: +at = s1 < s0; +L42af08: +if (at != 0) {at = s1 < 0x4; +goto L42afc0;} +at = s1 < 0x4; +L42af10: +//nop; +a0 = MEM_U16(sp + 258); +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(sp + 253); +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42af2c; +MEM_U32(sp + 16) = zero; +L42af2c: +gp = MEM_U32(sp + 192); +a0 = MEM_U16(sp + 256); +//nop; +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(sp + 252); +a2 = s3; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42af4c; +MEM_U32(sp + 16) = zero; +L42af4c: +s1 = s1 - s0; +gp = MEM_U32(sp + 192); +at = s1 < s0; +s2 = s2 + s0; +if (at != 0) {s3 = s3 + s0; +goto L42afb0;} +s3 = s3 + s0; +//nop; +a0 = MEM_U16(sp + 258); +a1 = MEM_U8(sp + 254); +a3 = MEM_U8(sp + 253); +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42af80; +MEM_U32(sp + 16) = zero; +L42af80: +gp = MEM_U32(sp + 192); +a0 = MEM_U16(sp + 256); +//nop; +a1 = MEM_U8(sp + 254); +a3 = MEM_U8(sp + 252); +a2 = s3; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42afa0; +MEM_U32(sp + 16) = zero; +L42afa0: +gp = MEM_U32(sp + 192); +s2 = s2 + s0; +s3 = s3 + s0; +s1 = s1 - s0; +L42afb0: +at = s1 < s0; +if (at == 0) {//nop; +goto L42af10;} +//nop; +at = s1 < 0x4; +L42afc0: +if (at != 0) {at = s1 < 0x4; +goto L42b020;} +at = s1 < 0x4; +t3 = MEM_U8(sp + 241); +a1 = MEM_U8(sp + 254); +if (t3 == 0) {a0 = 0x2a; +goto L42b01c;} +a0 = 0x2a; +//nop; +a3 = MEM_U8(sp + 253); +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42afec; +MEM_U32(sp + 16) = zero; +L42afec: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 254); +//nop; +a3 = MEM_U8(sp + 252); +a0 = 0x57; +a2 = s3; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b00c; +MEM_U32(sp + 16) = zero; +L42b00c: +gp = MEM_U32(sp + 192); +s2 = s2 + 0x4; +s3 = s3 + 0x4; +s1 = s1 + 0xfffffffc; +L42b01c: +at = s1 < 0x4; +L42b020: +if (at == 0) {a0 = 0x1; +goto L42b398;} +a0 = 0x1; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000931c[] = { +&&L42b3b8, +&&L42b048, +&&L42b090, +&&L42b178, +}; +dest = Lswitch1000931c[s1]; +//nop; +goto *dest; +//nop; +L42b048: +//nop; +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(sp + 253); +a0 = 0x26; +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b064; +MEM_U32(sp + 16) = zero; +L42b064: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 255); +//nop; +a3 = MEM_U8(sp + 252); +a0 = 0x46; +a2 = s3; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b084; +MEM_U32(sp + 16) = zero; +L42b084: +gp = MEM_U32(sp + 192); +t5 = MEM_U8(sp + 242); +goto L42b3bc; +t5 = MEM_U8(sp + 242); +L42b090: +t4 = MEM_U32(sp + 280); +t8 = MEM_U32(sp + 276); +at = t4 < 0x2; +if (at != 0) {a0 = 0x26; +goto L42b0b0;} +a0 = 0x26; +at = t8 < 0x2; +if (at == 0) {a2 = s2; +goto L42b134;} +a2 = s2; +L42b0b0: +//nop; +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(sp + 253); +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b0c8; +MEM_U32(sp + 16) = zero; +L42b0c8: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 255); +//nop; +a3 = MEM_U8(sp + 252); +a0 = 0x46; +a2 = s3; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b0e8; +MEM_U32(sp + 16) = zero; +L42b0e8: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 254); +//nop; +a3 = MEM_U8(sp + 253); +a0 = 0x26; +a2 = s2 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b108; +MEM_U32(sp + 16) = zero; +L42b108: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 254); +//nop; +a3 = MEM_U8(sp + 252); +a0 = 0x46; +a2 = s3 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b128; +MEM_U32(sp + 16) = zero; +L42b128: +gp = MEM_U32(sp + 192); +t5 = MEM_U8(sp + 242); +goto L42b3bc; +t5 = MEM_U8(sp + 242); +L42b134: +//nop; +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(sp + 253); +a0 = 0x28; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b14c; +MEM_U32(sp + 16) = zero; +L42b14c: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 255); +//nop; +a3 = MEM_U8(sp + 252); +a0 = 0x4c; +a2 = s3; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b16c; +MEM_U32(sp + 16) = zero; +L42b16c: +gp = MEM_U32(sp + 192); +t5 = MEM_U8(sp + 242); +goto L42b3bc; +t5 = MEM_U8(sp + 242); +L42b178: +t7 = MEM_U32(sp + 280); +t0 = MEM_U32(sp + 276); +at = (int)t7 < (int)0x4; +if (at != 0) {at = (int)t0 < (int)0x4; +goto L42b230;} +at = (int)t0 < (int)0x4; +if (at != 0) {t1 = MEM_U32(sp + 280); +goto L42b234;} +t1 = MEM_U32(sp + 280); +t6 = 0x10018e80; +a1 = MEM_U8(sp + 255); +t6 = MEM_U8(t6 + 0); +a0 = 0x5c; +if (t6 == 0) {a2 = s2 + 0x2; +goto L42b1f4;} +a2 = s2 + 0x2; +//nop; +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(sp + 253); +a0 = 0x5b; +a2 = s2 + 0x2; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b1c8; +MEM_U32(sp + 16) = zero; +L42b1c8: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 255); +//nop; +a3 = MEM_U8(sp + 252); +a0 = 0x5d; +a2 = s3 + 0x2; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b1e8; +MEM_U32(sp + 16) = zero; +L42b1e8: +gp = MEM_U32(sp + 192); +t5 = MEM_U8(sp + 242); +goto L42b3bc; +t5 = MEM_U8(sp + 242); +L42b1f4: +//nop; +a3 = MEM_U8(sp + 253); +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b204; +MEM_U32(sp + 16) = zero; +L42b204: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 255); +//nop; +a3 = MEM_U8(sp + 252); +a0 = 0x5e; +a2 = s3 + 0x2; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b224; +MEM_U32(sp + 16) = zero; +L42b224: +gp = MEM_U32(sp + 192); +t5 = MEM_U8(sp + 242); +goto L42b3bc; +t5 = MEM_U8(sp + 242); +L42b230: +t1 = MEM_U32(sp + 280); +L42b234: +t2 = MEM_U32(sp + 276); +at = t1 < 0x2; +if (at != 0) {a0 = 0x26; +goto L42b2d4;} +a0 = 0x26; +at = t2 < 0x2; +if (at != 0) {a2 = s2; +goto L42b2d4;} +a2 = s2; +//nop; +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(sp + 253); +a0 = 0x28; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b268; +MEM_U32(sp + 16) = zero; +L42b268: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 255); +//nop; +a3 = MEM_U8(sp + 252); +a0 = 0x4c; +a2 = s3; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b288; +MEM_U32(sp + 16) = zero; +L42b288: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 254); +//nop; +a3 = MEM_U8(sp + 253); +a0 = 0x26; +a2 = s2 + 0x2; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b2a8; +MEM_U32(sp + 16) = zero; +L42b2a8: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 254); +//nop; +a3 = MEM_U8(sp + 252); +a0 = 0x46; +a2 = s3 + 0x2; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b2c8; +MEM_U32(sp + 16) = zero; +L42b2c8: +gp = MEM_U32(sp + 192); +t5 = MEM_U8(sp + 242); +goto L42b3bc; +t5 = MEM_U8(sp + 242); +L42b2d4: +//nop; +a1 = MEM_U8(sp + 255); +a3 = MEM_U8(sp + 253); +a2 = s2; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b2ec; +MEM_U32(sp + 16) = zero; +L42b2ec: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 255); +//nop; +a3 = MEM_U8(sp + 252); +a0 = 0x46; +a2 = s3; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b30c; +MEM_U32(sp + 16) = zero; +L42b30c: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 254); +//nop; +a3 = MEM_U8(sp + 253); +a0 = 0x26; +a2 = s2 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b32c; +MEM_U32(sp + 16) = zero; +L42b32c: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 254); +//nop; +a3 = MEM_U8(sp + 252); +a0 = 0x46; +a2 = s3 + 0x1; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b34c; +MEM_U32(sp + 16) = zero; +L42b34c: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 255); +//nop; +a3 = MEM_U8(sp + 253); +a0 = 0x26; +a2 = s2 + 0x2; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b36c; +MEM_U32(sp + 16) = zero; +L42b36c: +gp = MEM_U32(sp + 192); +a1 = MEM_U8(sp + 255); +//nop; +a3 = MEM_U8(sp + 252); +a0 = 0x46; +a2 = s3 + 0x2; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b38c; +MEM_U32(sp + 16) = zero; +L42b38c: +gp = MEM_U32(sp + 192); +t5 = MEM_U8(sp + 242); +goto L42b3bc; +t5 = MEM_U8(sp + 242); +L42b398: +a2 = 0x100091a0; +//nop; +a1 = 0xab2; +a3 = 0x6; +a2 = a2; +f_caseerror(mem, sp, a0, a1, a2, a3); +goto L42b3b0; +a2 = a2; +L42b3b0: +gp = MEM_U32(sp + 192); +//nop; +L42b3b8: +t5 = MEM_U8(sp + 242); +L42b3bc: +a1 = MEM_U8(sp + 253); +if (t5 == 0) {t3 = MEM_U8(sp + 243); +goto L42b3e4;} +t3 = MEM_U8(sp + 243); +//nop; +a2 = MEM_U8(sp + 252); +a0 = 0x31; +f_emit_alias(mem, sp, a0, a1, a2); +goto L42b3d8; +a0 = 0x31; +L42b3d8: +gp = MEM_U32(sp + 192); +//nop; +t3 = MEM_U8(sp + 243); +L42b3e4: +//nop; +if (t3 != 0) {ra = MEM_U32(sp + 196); +goto L42b40c;} +ra = MEM_U32(sp + 196); +//nop; +a0 = 0x20; +a1 = 0x5; +f_emit_dir0(mem, sp, a0, a1); +goto L42b400; +a1 = 0x5; +L42b400: +gp = MEM_U32(sp + 192); +//nop; +ra = MEM_U32(sp + 196); +L42b40c: +s0 = MEM_U32(sp + 176); +s1 = MEM_U32(sp + 180); +s2 = MEM_U32(sp + 184); +s3 = MEM_U32(sp + 188); +sp = sp + 0x120; +return; +sp = sp + 0x120; +} + +static void f_get_ops(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L42b424: +//get_ops: +//nop; +//nop; +//nop; +v1 = MEM_U8(a0 + 32); +sp = sp + 0xffffff48; +t6 = v1 + 0xffffffe0; +t7 = t6 < 0x60; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +if (t7 == 0) {t2 = 0x66; +goto L42b478;} +t2 = 0x66; +t3 = 0x10005298; +t8 = (int)t6 >> 5; +t9 = t8 << 2; +t3 = t3; +t4 = t3 + t9; +t5 = MEM_U32(t4 + 0); +//nop; +t8 = t5 << (t6 & 0x1f); +t3 = (int)t8 < (int)0x0; +t7 = t3; +L42b478: +if (t7 != 0) {//nop; +goto L42b484;} +//nop; +abort(); +L42b484: +t1 = MEM_U32(a0 + 40); +t0 = MEM_U32(a0 + 36); +if (t2 == v1) {at = 0x5a; +goto L42b49c;} +at = 0x5a; +if (v1 != at) {//nop; +goto L42b4a4;} +//nop; +L42b49c: +t0 = MEM_U16(a0 + 34); +//nop; +L42b4a4: +v0 = v1 & 0xff; +goto L42b68c; +v0 = v1 & 0xff; +L42b4ac: +at = 0x20; +L42b4b0: +if (t0 != at) {at = 0x40; +goto L42b4c4;} +at = 0x40; +t9 = t1 & 0x3; +if (t9 == 0) {at = 0x40; +goto L42b4d0;} +at = 0x40; +L42b4c4: +if (t0 != at) {t4 = t1 & 0x7; +goto L42b4ec;} +t4 = t1 & 0x7; +if (t4 != 0) {t5 = 0x2a; +goto L42b4ec;} +L42b4d0: +t5 = 0x2a; +MEM_U16(a1 + 0) = (uint16_t)t5; +t6 = 0x57; +MEM_U16(a2 + 0) = (uint16_t)t6; +t8 = 0x4; +MEM_U32(a3 + 0) = t8; +goto L42b530; +MEM_U32(a3 + 0) = t8; +L42b4ec: +at = 0x10; +if (t0 != at) {t3 = t1 & 0x1; +goto L42b518;} +t3 = t1 & 0x1; +if (t3 != 0) {t7 = 0x28; +goto L42b518;} +t7 = 0x28; +MEM_U16(a1 + 0) = (uint16_t)t7; +t9 = 0x4c; +MEM_U16(a2 + 0) = (uint16_t)t9; +t4 = 0x2; +MEM_U32(a3 + 0) = t4; +goto L42b530; +MEM_U32(a3 + 0) = t4; +L42b518: +t5 = 0x26; +MEM_U16(a1 + 0) = (uint16_t)t5; +t6 = 0x46; +MEM_U16(a2 + 0) = (uint16_t)t6; +t8 = 0x1; +MEM_U32(a3 + 0) = t8; +L42b530: +at = 0x58; +if (v1 == at) {ra = MEM_U32(sp + 180); +goto L42b714;} +ra = MEM_U32(sp + 180); +if (t2 == v1) {at = 0x5a; +goto L42b710;} +at = 0x5a; +if (v1 == at) {t3 = 0x3e; +goto L42b710;} +t3 = 0x3e; +MEM_U16(a2 + 0) = (uint16_t)t3; +goto L42b710; +MEM_U16(a2 + 0) = (uint16_t)t3; +L42b554: +t4 = 0x10004070; +t7 = 0x26; +t9 = v1 << 1; +MEM_U16(a1 + 0) = (uint16_t)t7; +t5 = t9 + t4; +t6 = MEM_U16(t5 + 0); +t8 = 0x1; +MEM_U16(a2 + 0) = (uint16_t)t6; +MEM_U32(a3 + 0) = t8; +goto L42b710; +MEM_U32(a3 + 0) = t8; +L42b57c: +t3 = 0x1000937c; +a0 = 0x4; +t3 = t3; +t9 = t3 + 0x48; +a1 = 0xb2d; +t4 = sp; +L42b594: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t4 = t4 + 0xc; +MEM_U8(t4 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t4) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t4 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 4 + 3) = (uint8_t)(at >> 0); +if (t3 != t9) {//swr $at, 7($t4) +goto L42b594;} +//swr $at, 7($t4) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t5 = 0x1000932c; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +t9 = t3 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t3) +t5 = t5; +MEM_U8(t4 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t4 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t4 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t4 + 12 + 3) = (uint8_t)(t9 >> 0); +t8 = t5 + 0x48; +t7 = sp; +//swr $t9, 0xf($t4) +L42b604: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t5 != t8) {//swr $at, 0x57($t7) +goto L42b604;} +//swr $at, 0x57($t7) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t8 = t5 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t5) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L42b680; +//nop; +L42b680: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L42b714; +ra = MEM_U32(sp + 180); +L42b68c: +at = v0 < 0x5b; +if (at != 0) {at = v0 < 0x39; +goto L42b6ac;} +at = v0 < 0x39; +if (v0 == t2) {at = 0x20; +goto L42b4b0;} +at = 0x20; +//nop; +goto L42b57c; +//nop; +at = v0 < 0x39; +L42b6ac: +if (at == 0) {t3 = v0 + 0xffffffa8; +goto L42b6e4;} +t3 = v0 + 0xffffffa8; +t9 = v0 + 0xffffffd2; +at = t9 < 0xb; +if (at == 0) {//nop; +goto L42b57c;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100093cc[] = { +&&L42b4ac, +&&L42b554, +&&L42b554, +&&L42b57c, +&&L42b57c, +&&L42b57c, +&&L42b554, +&&L42b554, +&&L42b57c, +&&L42b57c, +&&L42b4ac, +}; +dest = Lswitch100093cc[t9]; +//nop; +goto *dest; +//nop; +L42b6e4: +at = t3 < 0x3; +if (at == 0) {//nop; +goto L42b57c;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100093f8[] = { +&&L42b4ac, +&&L42b57c, +&&L42b4ac, +}; +dest = Lswitch100093f8[t3]; +//nop; +goto *dest; +//nop; +L42b710: +ra = MEM_U32(sp + 180); +L42b714: +sp = sp + 0xb8; +//nop; +return; +//nop; +} + +static void f_eval_irel(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42b720: +//eval_irel: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb0; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 80) = a0; +a0 = MEM_U32(a0 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L42b74c; +a1 = 0x48; +L42b74c: +gp = MEM_U32(sp + 32); +t7 = MEM_U32(sp + 80); +//nop; +a0 = MEM_U32(t7 + 4); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L42b764; +a1 = 0x48; +L42b764: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 80); +//nop; +a1 = sp + 0x3a; +a2 = sp + 0x38; +a3 = sp + 0x34; +f_get_ops(mem, sp, a0, a1, a2, a3); +goto L42b780; +a3 = sp + 0x34; +L42b780: +gp = MEM_U32(sp + 32); +t8 = MEM_U32(sp + 80); +//nop; +a0 = MEM_U32(t8 + 0); +//nop; +v0 = f_reg(mem, sp, a0); +goto L42b798; +//nop; +L42b798: +gp = MEM_U32(sp + 32); +a0 = v0; +//nop; +//nop; +//nop; +v0 = f_copy(mem, sp, a0); +goto L42b7b0; +//nop; +L42b7b0: +t9 = MEM_U32(sp + 80); +gp = MEM_U32(sp + 32); +MEM_U8(sp + 77) = (uint8_t)v0; +a0 = MEM_U32(t9 + 4); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L42b7d0; +//nop; +L42b7d0: +gp = MEM_U32(sp + 32); +a0 = v0; +//nop; +//nop; +//nop; +v0 = f_copy(mem, sp, a0); +goto L42b7e8; +//nop; +L42b7e8: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 80); +//nop; +a1 = MEM_U16(a0 + 20); +MEM_U8(sp + 76) = (uint8_t)v0; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L42b800; +MEM_U8(sp + 76) = (uint8_t)v0; +L42b800: +gp = MEM_U32(sp + 32); +MEM_U8(sp + 75) = (uint8_t)v0; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L42b818; +a1 = 0x1; +L42b818: +gp = MEM_U32(sp + 32); +MEM_U8(sp + 78) = (uint8_t)v0; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L42b830; +//nop; +L42b830: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 68) = v0; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L42b848; +//nop; +L42b848: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 64) = v0; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L42b860; +//nop; +L42b860: +gp = MEM_U32(sp + 32); +t0 = MEM_U32(sp + 80); +//nop; +MEM_U32(sp + 60) = v0; +a1 = MEM_U8(sp + 75); +a2 = MEM_U8(sp + 77); +a3 = MEM_U32(t0 + 40); +MEM_U32(sp + 16) = zero; +a0 = 0x1; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42b888; +a0 = 0x1; +L42b888: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 68); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L42b8a0; +//nop; +L42b8a0: +gp = MEM_U32(sp + 32); +a0 = 0x20; +//nop; +a1 = 0x6; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L42b8b8; +//nop; +L42b8b8: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 58); +//nop; +a3 = MEM_U8(sp + 77); +a1 = 0x1; +a2 = zero; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b8d8; +MEM_U32(sp + 16) = zero; +L42b8d8: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 77); +//nop; +a3 = MEM_U32(sp + 52); +a0 = 0x1; +MEM_U32(sp + 16) = zero; +a2 = a1; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42b8f8; +a2 = a1; +L42b8f8: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 58); +//nop; +a1 = MEM_U8(sp + 78); +a3 = MEM_U8(sp + 76); +a2 = zero; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42b918; +MEM_U32(sp + 16) = zero; +L42b918: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 76); +//nop; +a3 = MEM_U32(sp + 52); +a0 = 0x1; +MEM_U32(sp + 16) = zero; +a2 = a1; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42b938; +a2 = a1; +L42b938: +gp = MEM_U32(sp + 32); +a2 = MEM_U8(sp + 78); +//nop; +a3 = MEM_U32(sp + 64); +a0 = 0x1a; +a1 = 0x1; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L42b954; +a1 = 0x1; +L42b954: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 77); +//nop; +a2 = MEM_U8(sp + 75); +a3 = MEM_U32(sp + 68); +a0 = 0x1a; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L42b970; +a0 = 0x1a; +L42b970: +gp = MEM_U32(sp + 32); +a0 = 0x20; +//nop; +a1 = 0x5; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L42b988; +//nop; +L42b988: +t1 = MEM_U32(sp + 80); +gp = MEM_U32(sp + 32); +v0 = MEM_U8(t1 + 32); +//nop; +t2 = v0 + 0xffffffd2; +at = t2 < 0xb; +if (at == 0) {//nop; +goto L42bb48;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000940c[] = { +&&L42b9c8, +&&L42bb10, +&&L42bb10, +&&L42bb48, +&&L42bb48, +&&L42bb48, +&&L42bad8, +&&L42bad8, +&&L42bb48, +&&L42bb48, +&&L42ba50, +}; +dest = Lswitch1000940c[t2]; +//nop; +goto *dest; +//nop; +L42b9c8: +//nop; +a1 = MEM_U8(sp + 75); +a0 = 0x29; +a2 = 0x1; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L42b9e0; +a3 = zero; +L42b9e0: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 60); +//nop; +a0 = 0x4; +//nop; +f_emit_ll(mem, sp, a0, a1); +goto L42b9f8; +//nop; +L42b9f8: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 64); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L42ba10; +//nop; +L42ba10: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 75); +//nop; +a0 = 0x29; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L42ba2c; +a3 = zero; +L42ba2c: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 60); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L42ba44; +//nop; +L42ba44: +gp = MEM_U32(sp + 32); +t3 = MEM_U32(sp + 80); +goto L42bb70; +t3 = MEM_U32(sp + 80); +L42ba50: +//nop; +a1 = MEM_U8(sp + 75); +a0 = 0x29; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L42ba68; +a3 = zero; +L42ba68: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 60); +//nop; +a0 = 0x4; +//nop; +f_emit_ll(mem, sp, a0, a1); +goto L42ba80; +//nop; +L42ba80: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 64); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L42ba98; +//nop; +L42ba98: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 75); +//nop; +a0 = 0x29; +a2 = 0x1; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L42bab4; +a3 = zero; +L42bab4: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 60); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L42bacc; +//nop; +L42bacc: +gp = MEM_U32(sp + 32); +t3 = MEM_U32(sp + 80); +goto L42bb70; +t3 = MEM_U32(sp + 80); +L42bad8: +//nop; +a0 = MEM_U32(sp + 64); +//nop; +f_define_label(mem, sp, a0); +goto L42bae8; +//nop; +L42bae8: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 56); +//nop; +a1 = MEM_U8(sp + 75); +a3 = MEM_U8(sp + 78); +a2 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L42bb04; +a2 = 0x1; +L42bb04: +gp = MEM_U32(sp + 32); +t3 = MEM_U32(sp + 80); +goto L42bb70; +t3 = MEM_U32(sp + 80); +L42bb10: +//nop; +a0 = MEM_U32(sp + 64); +//nop; +f_define_label(mem, sp, a0); +goto L42bb20; +//nop; +L42bb20: +gp = MEM_U32(sp + 32); +a0 = MEM_U16(sp + 56); +//nop; +a1 = MEM_U8(sp + 75); +a2 = MEM_U8(sp + 78); +a3 = 0x1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L42bb3c; +a3 = 0x1; +L42bb3c: +gp = MEM_U32(sp + 32); +t3 = MEM_U32(sp + 80); +goto L42bb70; +t3 = MEM_U32(sp + 80); +L42bb48: +a2 = 0x10009404; +//nop; +a0 = 0x1; +a1 = 0xb5b; +a3 = 0x6; +a2 = a2; +f_caseerror(mem, sp, a0, a1, a2, a3); +goto L42bb64; +a2 = a2; +L42bb64: +gp = MEM_U32(sp + 32); +//nop; +t3 = MEM_U32(sp + 80); +L42bb70: +t4 = MEM_U8(sp + 75); +v0 = MEM_U8(t3 + 25); +//nop; +t5 = v0 << 24; +t6 = t5 >> 25; +t7 = t4 ^ t6; +t8 = t7 << 25; +t9 = t8 >> 24; +t0 = t9 ^ v0; +MEM_U8(t3 + 25) = (uint8_t)t0; +//nop; +a0 = MEM_U8(sp + 77); +//nop; +f_free_reg(mem, sp, a0); +goto L42bba8; +//nop; +L42bba8: +gp = MEM_U32(sp + 32); +a0 = MEM_U8(sp + 76); +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L42bbc0; +//nop; +L42bbc0: +gp = MEM_U32(sp + 32); +a0 = MEM_U8(sp + 78); +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L42bbd8; +//nop; +L42bbd8: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x50; +return; +sp = sp + 0x50; +} + +static void f_save_vreg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42bbe8: +//save_vreg: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +a2 = MEM_U32(a0 + 48); +//nop; +a1 = a0; +if ((int)a2 >= 0) {t6 = (int)a2 >> 2; +goto L42bc1c;} +t6 = (int)a2 >> 2; +at = a2 + 0x3; +t6 = (int)at >> 2; +L42bc1c: +a0 = t6 & 0xff; +MEM_U8(sp + 39) = (uint8_t)a0; +MEM_U32(sp + 40) = a1; +v0 = f_is_saved_reg(mem, sp, a0); +goto L42bc2c; +MEM_U32(sp + 40) = a1; +L42bc2c: +a2 = MEM_U8(sp + 39); +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 40); +if (v0 == 0) {t2 = a2 < 0x20; +goto L42bd1c;} +t2 = a2 < 0x20; +v0 = 0x100197b0; +t8 = a2 < 0x20; +t1 = MEM_U32(v0 + 0); +t9 = ~a2; +t0 = t8 << (t9 & 0x1f); +t3 = a2 + 0xffffffe0; +t2 = t1 | t0; +t4 = t3 < 0x20; +t5 = ~a2; +t6 = t4 << (t5 & 0x1f); +t9 = a2 + 0xffffffc0; +t5 = MEM_U32(a1 + 40); +t3 = MEM_U32(v0 + 8); +t7 = MEM_U32(v0 + 4); +t1 = t9 < 0x20; +t0 = ~a2; +MEM_U32(v0 + 0) = t2; +t2 = t1 << (t0 & 0x1f); +at = (int)t5 < (int)0x5; +t4 = t3 | t2; +t8 = t7 | t6; +MEM_U32(v0 + 4) = t8; +if (at == 0) {MEM_U32(v0 + 8) = t4; +goto L42bcc4;} +MEM_U32(v0 + 8) = t4; +t7 = MEM_U8(a1 + 33); +at = 0xc0000; +t6 = t7 & 0x1f; +t8 = t6 < 0x20; +t9 = -t8; +at = at | 0x8000; +t1 = t9 & at; +t0 = t1 << (t6 & 0x1f); +if ((int)t0 >= 0) {t3 = a2 + 0x1; +goto L42beb0;} +L42bcc4: +t3 = a2 + 0x1; +t7 = MEM_U32(v0 + 0); +t2 = t3 < 0x20; +t4 = ~t3; +t5 = t2 << (t4 & 0x1f); +t8 = t7 | t5; +t9 = t3 + 0xffffffe0; +t1 = t9 < 0x20; +t6 = ~t3; +t0 = t1 << (t6 & 0x1f); +MEM_U32(v0 + 0) = t8; +t7 = t3 + 0xffffffc0; +t1 = MEM_U32(v0 + 8); +t2 = MEM_U32(v0 + 4); +t5 = t7 < 0x20; +t8 = ~t3; +t9 = t5 << (t8 & 0x1f); +t6 = t1 | t9; +t4 = t2 | t0; +MEM_U32(v0 + 4) = t4; +MEM_U32(v0 + 8) = t6; +goto L42beb0; +MEM_U32(v0 + 8) = t6; +L42bd1c: +v0 = 0x100197b0; +t0 = ~a2; +t3 = MEM_U32(v0 + 0); +t4 = t2 << (t0 & 0x1f); +t8 = a2 + 0xffffffe0; +t1 = t8 < 0x20; +t7 = ~t4; +t9 = ~a2; +t0 = MEM_U32(v0 + 4); +t6 = t1 << (t9 & 0x1f); +t5 = t3 & t7; +t2 = ~t6; +t4 = t0 & t2; +t3 = a2 + 0xffffffc0; +MEM_U32(v0 + 0) = t5; +t5 = ~a2; +t7 = t3 < 0x20; +t0 = a2 + 0xffffffe0; +t9 = MEM_U32(v0 + 8); +t8 = t7 << (t5 & 0x1f); +t2 = t0 < 0x20; +MEM_U32(v0 + 4) = t4; +t1 = ~t8; +t4 = -t2; +t3 = t4 << (t0 & 0x1f); +t6 = t9 & t1; +if ((int)t3 >= 0) {MEM_U32(v0 + 8) = t6; +goto L42be08;} +MEM_U32(v0 + 8) = t6; +t7 = a2 + 0x1; +t5 = t7 < 0x20; +t8 = ~t7; +t6 = MEM_U32(v0 + 0); +t9 = t5 << (t8 & 0x1f); +t1 = ~t9; +t4 = t7 + 0xffffffe0; +t0 = t4 < 0x20; +t3 = ~t7; +t2 = t6 & t1; +t5 = t0 << (t3 & 0x1f); +MEM_U32(v0 + 0) = t2; +t1 = t7 + 0xffffffc0; +t9 = MEM_U32(v0 + 4); +t2 = t1 < 0x20; +t8 = ~t5; +t4 = ~t7; +t5 = MEM_U32(v0 + 8); +t0 = t2 << (t4 & 0x1f); +t3 = ~t0; +t6 = t9 & t8; +t9 = t5 & t3; +MEM_U32(v0 + 8) = t9; +MEM_U32(v0 + 4) = t6; +//nop; +a0 = a2; +a1 = 0x3; +f_remove_from_fp_free_list(mem, sp, a0, a1); +goto L42bdfc; +a1 = 0x3; +L42bdfc: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L42beb4; +ra = MEM_U32(sp + 28); +L42be08: +//nop; +a0 = a2; +MEM_U32(sp + 40) = a1; +MEM_U8(sp + 39) = (uint8_t)a2; +f_remove_from_free_list(mem, sp, a0); +goto L42be1c; +MEM_U8(sp + 39) = (uint8_t)a2; +L42be1c: +a1 = MEM_U32(sp + 40); +gp = MEM_U32(sp + 24); +t8 = MEM_U32(a1 + 40); +a2 = MEM_U8(sp + 39); +v0 = 0x100197b0; +at = (int)t8 < (int)0x5; +if (at != 0) {a0 = a2 + 0x1; +goto L42beb0;} +a0 = a2 + 0x1; +t6 = a0 < 0x20; +t1 = ~a0; +t4 = MEM_U32(v0 + 0); +t7 = t6 << (t1 & 0x1f); +t2 = ~t7; +t0 = t4 & t2; +t5 = a0 + 0xffffffe0; +t3 = t5 < 0x20; +t9 = ~a0; +t8 = t3 << (t9 & 0x1f); +MEM_U32(v0 + 0) = t0; +t4 = a0 + 0xffffffc0; +t2 = t4 < 0x20; +t0 = ~a0; +t9 = MEM_U32(v0 + 8); +t1 = MEM_U32(v0 + 4); +t5 = t2 << (t0 & 0x1f); +t6 = ~t8; +t3 = ~t5; +t8 = t9 & t3; +t7 = t1 & t6; +MEM_U32(v0 + 4) = t7; +MEM_U32(v0 + 8) = t8; +//nop; +//nop; +//nop; +f_remove_from_free_list(mem, sp, a0); +goto L42bea8; +//nop; +L42bea8: +gp = MEM_U32(sp + 24); +//nop; +L42beb0: +ra = MEM_U32(sp + 28); +L42beb4: +sp = sp + 0x28; +//nop; +return; +//nop; +} + +static uint32_t f_pass_in_register(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42bec0: +//pass_in_register: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 24) = s0; +s0 = 0x10019d70; +MEM_U32(sp + 28) = s1; +s0 = MEM_U32(s0 + 0); +s1 = a0; +MEM_U32(sp + 36) = ra; +if (s0 == 0) {MEM_U32(sp + 32) = gp; +goto L42bf38;} +MEM_U32(sp + 32) = gp; +L42bef0: +//nop; +a0 = s1; +a1 = s0; +v0 = f_overlap(mem, sp, a0, a1); +goto L42bf00; +a1 = s0; +L42bf00: +gp = MEM_U32(sp + 32); +if (v0 == 0) {//nop; +goto L42bf28;} +//nop; +//nop; +a0 = s0; +//nop; +v0 = f_parm_reg(mem, sp, a0); +goto L42bf1c; +//nop; +L42bf1c: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L42bf40; +ra = MEM_U32(sp + 36); +L42bf28: +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 != 0) {//nop; +goto L42bef0;} +//nop; +L42bf38: +v0 = 0x48; +ra = MEM_U32(sp + 36); +L42bf40: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x28; +return v0; +sp = sp + 0x28; +} + +static void f_load_parm_vreg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42bf50: +//load_parm_vreg: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s1; +MEM_U32(sp + 32) = s0; +s0 = MEM_U32(a0 + 48); +//nop; +s1 = a0; +if ((int)s0 >= 0) {t6 = (int)s0 >> 2; +goto L42bf8c;} +t6 = (int)s0 >> 2; +at = s0 + 0x3; +t6 = (int)at >> 2; +L42bf8c: +s0 = t6 & 0xff; +a0 = s1; +v0 = f_pass_in_register(mem, sp, a0); +goto L42bf98; +a0 = s1; +L42bf98: +gp = MEM_U32(sp + 40); +t8 = v0 & 0xff; +at = 0x48; +if (t8 == at) {a1 = v0 & 0xff; +goto L42c0a0;} +a1 = v0 & 0xff; +a2 = MEM_U8(s1 + 33); +a0 = s0; +t9 = a2 & 0x1f; +a2 = t9; +//nop; +//nop; +//nop; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L42bfcc; +//nop; +L42bfcc: +gp = MEM_U32(sp + 40); +at = 0x3; +t0 = 0x10018e98; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 != at) {ra = MEM_U32(sp + 44); +goto L42c0dc;} +ra = MEM_U32(sp + 44); +v0 = MEM_U32(s1 + 40); +//nop; +at = (int)v0 < (int)0x4; +if (at == 0) {ra = MEM_U32(sp + 44); +goto L42c0dc;} +ra = MEM_U32(sp + 44); +t1 = MEM_U8(s1 + 33); +at = 0x6; +t2 = t1 & 0x1f; +if (t2 != at) {a0 = 0x3; +goto L42c070;} +a0 = 0x3; +//nop; +t3 = v0 << 3; +t4 = 0x20; +a3 = t4 - t3; +a0 = 0x4f; +a1 = s0; +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42c038; +MEM_U32(sp + 16) = zero; +L42c038: +gp = MEM_U32(sp + 40); +t5 = MEM_U32(s1 + 40); +//nop; +t7 = 0x20; +t6 = t5 << 3; +a3 = t7 - t6; +a0 = 0x53; +a1 = s0; +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42c064; +MEM_U32(sp + 16) = zero; +L42c064: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L42c0dc; +ra = MEM_U32(sp + 44); +L42c070: +t8 = v0 << 3; +t9 = 0x1; +a3 = t9 << (t8 & 0x1f); +//nop; +a3 = a3 + 0xffffffff; +a1 = s0; +a2 = s0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42c094; +MEM_U32(sp + 16) = zero; +L42c094: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L42c0dc; +ra = MEM_U32(sp + 44); +L42c0a0: +//nop; +a0 = 0x100032d8; +a1 = s1; +a2 = s0; +v0 = f_lsopc(mem, sp, a0, a1, a2); +goto L42c0b4; +a2 = s0; +L42c0b4: +gp = MEM_U32(sp + 40); +a0 = v0; +//nop; +a1 = s1; +a2 = s0; +a3 = zero; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L42c0d0; +a3 = zero; +L42c0d0: +gp = MEM_U32(sp + 40); +//nop; +ra = MEM_U32(sp + 44); +L42c0dc: +s0 = MEM_U32(sp + 32); +s1 = MEM_U32(sp + 36); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static uint32_t f_in_parm_regs(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42c0ec: +//in_parm_regs: +//nop; +//nop; +//nop; +v0 = a0 < 0x4; +v1 = v0 ^ 0x1; +if (v1 == 0) {MEM_U32(sp + 0) = a0; +goto L42c124;} +MEM_U32(sp + 0) = a0; +t6 = 0x10019310; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +t7 = t6 + 0x3; +v1 = t7 < a0; +v1 = v1 ^ 0x1; +L42c124: +if (v1 != 0) {v0 = a0 < 0x2c; +goto L42c158;} +v0 = a0 < 0x2c; +v1 = v0 ^ 0x1; +if (v1 == 0) {//nop; +goto L42c158;} +//nop; +t8 = 0x10019314; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +t9 = t8 << 1; +t0 = t9 + 0x2a; +v1 = t0 < a0; +v1 = v1 ^ 0x1; +L42c158: +v0 = v1; +return v0; +v0 = v1; +} + +static void f_gen_regs(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42c160: +//gen_regs: +//nop; +//nop; +//nop; +v0 = MEM_U8(a0 + 47); +t6 = MEM_U32(a0 + 40); +sp = sp + 0xffffffd0; +a1 = MEM_U32(a0 + 36); +v1 = v0 + t6; +v1 = v1 + 0xffffffff; +t8 = a1 + 0xffffffff; +t7 = v1 & 0xff; +at = t8 < 0x4; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +v1 = t7; +if (at == 0) {a2 = v0; +goto L42c4c4;} +a2 = v0; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10009438[] = { +&&L42c2f0, +&&L42c1d4, +&&L42c3a8, +&&L42c1d4, +}; +dest = Lswitch10009438[t8]; +//nop; +goto *dest; +//nop; +L42c1d4: +at = v1 < v0; +if (at != 0) {ra = MEM_U32(sp + 44); +goto L42c4c8;} +ra = MEM_U32(sp + 44); +s2 = 0x10019338; +s1 = 0x100197b0; +s0 = v0; +s3 = v1 + 0x1; +L42c1f0: +t2 = MEM_U32(s1 + 0); +t9 = s0 < 0x20; +t0 = ~s0; +t1 = t9 << (t0 & 0x1f); +t4 = s0 + 0xffffffe0; +t3 = t2 | t1; +t5 = t4 < 0x20; +t6 = ~s0; +t7 = t5 << (t6 & 0x1f); +t0 = s0 + 0xffffffc0; +t4 = MEM_U32(s1 + 8); +t8 = MEM_U32(s1 + 4); +t2 = t0 < 0x20; +MEM_U32(s1 + 0) = t3; +t1 = ~s0; +t3 = t2 << (t1 & 0x1f); +t6 = s0 < 0x60; +t5 = t4 | t3; +t9 = t8 | t7; +MEM_U32(s1 + 4) = t9; +if (t6 == 0) {MEM_U32(s1 + 8) = t5; +goto L42c264;} +MEM_U32(s1 + 8) = t5; +t8 = (int)s0 >> 5; +t7 = t8 << 2; +t9 = s2 + t7; +t0 = MEM_U32(t9 + 0); +//nop; +t2 = t0 << (s0 & 0x1f); +t6 = (int)t2 < (int)0x0; +L42c264: +if (t6 == 0) {t4 = s0 < 0x20; +goto L42c2dc;} +t4 = s0 < 0x20; +t3 = ~s0; +t7 = MEM_U32(s2 + 0); +t5 = t4 << (t3 & 0x1f); +t8 = ~t5; +t9 = t7 & t8; +t0 = s0 + 0xffffffe0; +t2 = t0 < 0x20; +t1 = ~s0; +t6 = t2 << (t1 & 0x1f); +MEM_U32(s2 + 0) = t9; +t7 = s0 + 0xffffffc0; +t8 = t7 < 0x20; +t9 = ~s0; +t1 = MEM_U32(s2 + 8); +t3 = MEM_U32(s2 + 4); +t0 = t8 << (t9 & 0x1f); +t4 = ~t6; +t2 = ~t0; +t6 = t1 & t2; +t5 = t3 & t4; +MEM_U32(s2 + 4) = t5; +MEM_U32(s2 + 8) = t6; +//nop; +a0 = s0; +a1 = zero; +f_remove_from_fp_free_list(mem, sp, a0, a1); +goto L42c2d4; +a1 = zero; +L42c2d4: +gp = MEM_U32(sp + 40); +//nop; +L42c2dc: +s0 = s0 + 0x1; +if (s0 != s3) {//nop; +goto L42c1f0;} +//nop; +ra = MEM_U32(sp + 44); +goto L42c4c8; +ra = MEM_U32(sp + 44); +L42c2f0: +at = v1 < v0; +if (at != 0) {s0 = v0; +goto L42c4c4;} +s0 = v0; +s1 = 0x100197b0; +s3 = v1 + 0x1; +t3 = s0 < 0x20; +L42c308: +t4 = ~s0; +t8 = MEM_U32(s1 + 0); +t5 = t3 << (t4 & 0x1f); +t7 = ~t5; +t9 = t8 & t7; +t0 = s0 + 0xffffffe0; +t1 = t0 < 0x20; +t2 = ~s0; +t6 = t1 << (t2 & 0x1f); +MEM_U32(s1 + 0) = t9; +t8 = s0 + 0xffffffc0; +t7 = t8 < 0x20; +t9 = ~s0; +t2 = MEM_U32(s1 + 8); +t4 = MEM_U32(s1 + 4); +t0 = t7 << (t9 & 0x1f); +t3 = ~t6; +t1 = ~t0; +t6 = t2 & t1; +t5 = t4 & t3; +MEM_U32(s1 + 4) = t5; +MEM_U32(s1 + 8) = t6; +//nop; +a0 = s0; +//nop; +v0 = f_in_parm_regs(mem, sp, a0); +goto L42c370; +//nop; +L42c370: +gp = MEM_U32(sp + 40); +if (v0 != 0) {//nop; +goto L42c394;} +//nop; +//nop; +a0 = s0; +//nop; +f_remove_from_free_list(mem, sp, a0); +goto L42c38c; +//nop; +L42c38c: +gp = MEM_U32(sp + 40); +//nop; +L42c394: +s0 = s0 + 0x1; +if (s0 != s3) {t3 = s0 < 0x20; +goto L42c308;} +t3 = s0 < 0x20; +ra = MEM_U32(sp + 44); +goto L42c4c8; +ra = MEM_U32(sp + 44); +L42c3a8: +at = (int)v1 < (int)a2; +s0 = v0 & 0xff; +if (at != 0) {s2 = v1; +goto L42c4c4;} +s2 = v1; +s1 = 0x100197b0; +//nop; +L42c3c0: +t4 = s0 < 0x20; +t3 = ~s0; +t7 = MEM_U32(s1 + 0); +t5 = t4 << (t3 & 0x1f); +t8 = ~t5; +t0 = s0 + 0xffffffe0; +t9 = t7 & t8; +t2 = t0 < 0x20; +t1 = ~s0; +t3 = MEM_U32(s1 + 4); +t6 = t2 << (t1 & 0x1f); +t4 = ~t6; +MEM_U32(s1 + 0) = t9; +t7 = s0 + 0xffffffc0; +t8 = t7 < 0x20; +t9 = ~s0; +t5 = t3 & t4; +t1 = MEM_U32(s1 + 8); +t0 = t8 << (t9 & 0x1f); +t2 = ~t0; +t3 = s0 + 0x1; +MEM_U32(s1 + 4) = t5; +t6 = t1 & t2; +t5 = ~t3; +t4 = t3 < 0x20; +t9 = MEM_U32(s1 + 0); +t7 = t4 << (t5 & 0x1f); +MEM_U32(s1 + 8) = t6; +t8 = ~t7; +t1 = t3 + 0xffffffe0; +t2 = t1 < 0x20; +t6 = ~t3; +t0 = t9 & t8; +t4 = t2 << (t6 & 0x1f); +MEM_U32(s1 + 0) = t0; +t8 = t3 + 0xffffffc0; +t7 = MEM_U32(s1 + 4); +t0 = t8 < 0x20; +t5 = ~t4; +t1 = ~t3; +t4 = MEM_U32(s1 + 8); +t2 = t0 << (t1 & 0x1f); +t6 = ~t2; +t9 = t7 & t5; +t7 = t4 & t6; +MEM_U32(s1 + 8) = t7; +MEM_U32(s1 + 4) = t9; +//nop; +a0 = s0; +//nop; +v0 = f_in_parm_regs(mem, sp, a0); +goto L42c48c; +//nop; +L42c48c: +gp = MEM_U32(sp + 40); +if (v0 != 0) {//nop; +goto L42c4b0;} +//nop; +//nop; +a0 = s0; +a1 = 0x3; +f_remove_from_fp_free_list(mem, sp, a0, a1); +goto L42c4a8; +a1 = 0x3; +L42c4a8: +gp = MEM_U32(sp + 40); +//nop; +L42c4b0: +s0 = s0 + 0x2; +t5 = s0 & 0xff; +at = (int)s2 < (int)t5; +if (at == 0) {s0 = t5; +goto L42c3c0;} +s0 = t5; +L42c4c4: +ra = MEM_U32(sp + 44); +L42c4c8: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static uint32_t f_get_saved_regs_size(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42c4e0: +//get_saved_regs_size: +//nop; +//nop; +//nop; +t6 = 0x10018ed0; +sp = sp + 0xffffffc8; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if (t6 != 0) {a1 = a0; +goto L42c510;} +a1 = a0; +a2 = 0x4; +goto L42c514; +a2 = 0x4; +L42c510: +a2 = 0x8; +L42c514: +a1 = MEM_U32(a1 + 8); +v1 = zero; +a3 = 0x6; +if (a1 == 0) {t0 = zero; +goto L42c80c;} +t0 = zero; +t1 = 0x10018ed8; +//nop; +L42c530: +v0 = MEM_U8(a1 + 32); +at = v0 < 0x53; +goto L42c798; +at = v0 < 0x53; +L42c53c: +v0 = MEM_U32(a1 + 48); +at = 0xffffffff; +if (v0 == at) {//nop; +goto L42c7fc;} +//nop; +t7 = 0x1001935c; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L42c7fc;} +//nop; +//nop; +if ((int)v0 >= 0) {a0 = (int)v0 >> 2; +goto L42c578;} +a0 = (int)v0 >> 2; +at = v0 + 0x3; +a0 = (int)at >> 2; +L42c578: +t8 = a0 & 0xff; +a0 = t8; +MEM_U32(sp + 48) = v1; +MEM_U32(sp + 56) = a1; +MEM_U32(sp + 36) = a2; +MEM_U32(sp + 40) = a3; +MEM_U8(sp + 35) = (uint8_t)t0; +v0 = f_is_saved_reg(mem, sp, a0); +goto L42c598; +MEM_U8(sp + 35) = (uint8_t)t0; +L42c598: +gp = MEM_U32(sp + 24); +v1 = MEM_U32(sp + 48); +a1 = MEM_U32(sp + 56); +a2 = MEM_U32(sp + 36); +a3 = MEM_U32(sp + 40); +t0 = MEM_U8(sp + 35); +t1 = 0x10018ed8; +if (v0 == 0) {at = 0xc0000; +goto L42c7fc;} +at = 0xc0000; +t9 = MEM_U8(a1 + 33); +at = at | 0x8000; +t2 = t9 & 0x1f; +t3 = t2 < 0x20; +t4 = -t3; +t5 = t4 & at; +t6 = t5 << (t2 & 0x1f); +if ((int)t6 >= 0) {//nop; +goto L42c5e8;} +//nop; +v1 = v1 + 0x8; +goto L42c7fc; +v1 = v1 + 0x8; +L42c5e8: +t7 = MEM_U32(a1 + 40); +//nop; +t8 = t7 + 0x3; +if ((int)t8 >= 0) {t9 = (int)t8 >> 2; +goto L42c604;} +t9 = (int)t8 >> 2; +at = t8 + 0x3; +t9 = (int)at >> 2; +L42c604: +t3 = t9 << 2; +v1 = v1 + t3; +goto L42c7fc; +v1 = v1 + t3; +L42c610: +t4 = MEM_U8(a1 + 33); +a0 = 0x10019390; +t5 = t4 << 24; +t2 = t5 >> 29; +at = 0x6; +a0 = MEM_U8(a0 + 0); +if (t2 != at) {//nop; +goto L42c65c;} +//nop; +v0 = 0x10018ea8; +t6 = MEM_U32(t1 + 0); +v0 = MEM_U8(v0 + 0); +if ((int)t6 <= 0) {t7 = a2 << 1; +goto L42c64c;} +t7 = a2 << 1; +v1 = v1 + t7; +goto L42c650; +v1 = v1 + t7; +L42c64c: +v1 = v1 + a2; +L42c650: +if (v0 == 0) {//nop; +goto L42c65c;} +//nop; +v1 = v1 - a2; +L42c65c: +if (a0 == 0) {//nop; +goto L42c7fc;} +//nop; +v1 = v1 + a2; +goto L42c7fc; +v1 = v1 + a2; +L42c66c: +v0 = MEM_U32(a1 + 44); +//nop; +at = (int)v0 < (int)0x1f; +if (at == 0) {//nop; +goto L42c69c;} +//nop; +t8 = MEM_U32(a1 + 40); +//nop; +t9 = v0 + t8; +at = (int)t9 < (int)0x1f; +if (at != 0) {//nop; +goto L42c69c;} +//nop; +t0 = 0x1; +L42c69c: +v0 = MEM_U32(a1 + 36); +at = 0x2; +if (v0 != at) {at = 0x4; +goto L42c6c4;} +at = 0x4; +t3 = MEM_U32(a1 + 40); +//nop; +t4 = t3 << 2; +v1 = v1 + t4; +goto L42c7fc; +v1 = v1 + t4; +at = 0x4; +L42c6c4: +if (v0 != at) {//nop; +goto L42c7fc;} +//nop; +v0 = MEM_U32(a1 + 40); +//nop; +t5 = v0 << 2; +v1 = v1 + t5; +a3 = a3 - v0; +goto L42c7fc; +a3 = a3 - v0; +L42c6e4: +t2 = 0x10019330; +t7 = a3 << 3; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L42c714;} +//nop; +t6 = 0x10019334; +//nop; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L42c718;} +//nop; +L42c714: +v1 = v1 + t7; +L42c718: +t8 = 0x10018edc; +//nop; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L42c770;} +//nop; +v0 = MEM_U32(t1 + 0); +//nop; +t9 = (int)zero < (int)v0; +if (t9 == 0) {v0 = t9; +goto L42c764;} +v0 = t9; +v0 = 0x10018ea8; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +v0 = v0 < 0x1; +if (v0 == 0) {//nop; +goto L42c764;} +//nop; +v0 = t0 < 0x1; +L42c764: +at = 0x10018ee4; +//nop; +MEM_U8(at + 0) = (uint8_t)v0; +L42c770: +if (v1 != 0) {v0 = v1 + 0x8; +goto L42c780;} +v0 = v1 + 0x8; +v0 = v1; +goto L42c814; +v0 = v1; +L42c780: +if ((int)v0 >= 0) {t3 = (int)v0 >> 3; +goto L42c790;} +t3 = (int)v0 >> 3; +at = v0 + 0x7; +t3 = (int)at >> 3; +L42c790: +v0 = t3 << 3; +goto L42c814; +v0 = t3 << 3; +L42c798: +if (at != 0) {at = v0 < 0x7c; +goto L42c7d8;} +at = v0 < 0x7c; +if (at != 0) {at = 0x8b; +goto L42c7b8;} +at = 0x8b; +if (v0 == at) {//nop; +goto L42c53c;} +//nop; +a1 = MEM_U32(a1 + 8); +goto L42c800; +a1 = MEM_U32(a1 + 8); +L42c7b8: +at = 0x68; +if (v0 == at) {//nop; +goto L42c66c;} +//nop; +at = v0 < 0x7a; +if (at == 0) {//nop; +goto L42c6e4;} +//nop; +a1 = MEM_U32(a1 + 8); +goto L42c800; +a1 = MEM_U32(a1 + 8); +L42c7d8: +at = 0x1b; +if (v0 == at) {//nop; +goto L42c610;} +//nop; +at = 0x1f; +if (v0 == at) {//nop; +goto L42c6e4;} +//nop; +at = 0x52; +if (v0 == at) {//nop; +goto L42c6e4;} +//nop; +L42c7fc: +a1 = MEM_U32(a1 + 8); +L42c800: +//nop; +if (a1 != 0) {//nop; +goto L42c530;} +//nop; +L42c80c: +v0 = MEM_U32(sp + 52); +//nop; +L42c814: +ra = MEM_U32(sp + 28); +sp = sp + 0x38; +//nop; +return v0; +//nop; +} + +static void f_unhome_parms(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42c824: +//unhome_parms: +//nop; +//nop; +//nop; +v0 = 0x10019310; +//nop; +v0 = MEM_U32(v0 + 0); +//nop; +v0 = v0 + 0x3; +at = v0 < 0x4; +if (at != 0) {v0 = v0 + 0x1; +goto L42ca60;} +v0 = v0 + 0x1; +a1 = v0 + 0xfffffffc; +t6 = a1 & 0x3; +if (t6 == 0) {v1 = 0x4; +goto L42c8d4;} +v1 = 0x4; +a1 = 0x100197b0; +a0 = t6 + 0x4; +L42c868: +t7 = v1 < 0x20; +t8 = ~v1; +t1 = MEM_U32(a1 + 0); +t9 = t7 << (t8 & 0x1f); +t0 = ~t9; +t2 = t1 & t0; +t3 = v1 + 0xffffffe0; +t4 = t3 < 0x20; +t5 = ~v1; +t6 = t4 << (t5 & 0x1f); +MEM_U32(a1 + 0) = t2; +t1 = v1 + 0xffffffc0; +t0 = t1 < 0x20; +t2 = ~v1; +t5 = MEM_U32(a1 + 8); +t8 = MEM_U32(a1 + 4); +t3 = t0 << (t2 & 0x1f); +t7 = ~t6; +t4 = ~t3; +v1 = v1 + 0x1; +t6 = t5 & t4; +t9 = t8 & t7; +MEM_U32(a1 + 4) = t9; +if (a0 != v1) {MEM_U32(a1 + 8) = t6; +goto L42c868;} +MEM_U32(a1 + 8) = t6; +if (v1 == v0) {//nop; +goto L42ca60;} +//nop; +L42c8d4: +a1 = 0x100197b0; +//nop; +L42c8dc: +t8 = v1 < 0x20; +t7 = ~v1; +t0 = MEM_U32(a1 + 0); +t9 = t8 << (t7 & 0x1f); +t1 = ~t9; +t3 = v1 + 0xffffffe0; +t2 = t0 & t1; +t5 = t3 < 0x20; +t4 = ~v1; +t7 = MEM_U32(a1 + 4); +t6 = t5 << (t4 & 0x1f); +t8 = ~t6; +MEM_U32(a1 + 0) = t2; +t0 = v1 + 0xffffffc0; +t1 = t0 < 0x20; +t2 = ~v1; +t9 = t7 & t8; +t4 = MEM_U32(a1 + 8); +t3 = t1 << (t2 & 0x1f); +t5 = ~t3; +t7 = v1 + 0x1; +MEM_U32(a1 + 4) = t9; +t6 = t4 & t5; +t9 = ~t7; +t8 = t7 < 0x20; +t2 = MEM_U32(a1 + 0); +t0 = t8 << (t9 & 0x1f); +t1 = ~t0; +MEM_U32(a1 + 8) = t6; +t4 = t7 + 0xffffffe0; +t5 = t4 < 0x20; +t6 = ~t7; +t3 = t2 & t1; +t0 = MEM_U32(a1 + 4); +t8 = t5 << (t6 & 0x1f); +t9 = ~t8; +MEM_U32(a1 + 0) = t3; +t1 = t7 + 0xffffffc0; +t2 = t0 & t9; +t3 = t1 < 0x20; +t4 = ~t7; +t8 = MEM_U32(a1 + 8); +t5 = t3 << (t4 & 0x1f); +t9 = v1 + 0x2; +t6 = ~t5; +MEM_U32(a1 + 4) = t2; +t2 = t9 < 0x20; +t1 = ~t9; +t0 = t8 & t6; +t4 = MEM_U32(a1 + 0); +t7 = t2 << (t1 & 0x1f); +t3 = ~t7; +MEM_U32(a1 + 8) = t0; +t8 = t9 + 0xffffffe0; +t5 = t4 & t3; +t6 = t8 < 0x20; +t0 = ~t9; +t7 = MEM_U32(a1 + 4); +t2 = t6 << (t0 & 0x1f); +t1 = ~t2; +MEM_U32(a1 + 0) = t5; +t3 = t9 + 0xffffffc0; +t5 = t3 < 0x20; +t8 = ~t9; +t4 = t7 & t1; +t2 = MEM_U32(a1 + 8); +t6 = t5 << (t8 & 0x1f); +t0 = ~t6; +t1 = v1 + 0x3; +MEM_U32(a1 + 4) = t4; +t7 = t2 & t0; +t4 = t1 < 0x20; +t3 = ~t1; +t8 = MEM_U32(a1 + 0); +t9 = t4 << (t3 & 0x1f); +t5 = ~t9; +MEM_U32(a1 + 8) = t7; +t2 = t1 + 0xffffffe0; +t0 = t2 < 0x20; +t7 = ~t1; +t6 = t8 & t5; +t4 = t0 << (t7 & 0x1f); +MEM_U32(a1 + 0) = t6; +t5 = t1 + 0xffffffc0; +t9 = MEM_U32(a1 + 4); +t6 = t5 < 0x20; +t3 = ~t4; +t2 = ~t1; +t4 = MEM_U32(a1 + 8); +t0 = t6 << (t2 & 0x1f); +t7 = ~t0; +t8 = t9 & t3; +v1 = v1 + 0x4; +t9 = t4 & t7; +MEM_U32(a1 + 8) = t9; +if (v1 != v0) {MEM_U32(a1 + 4) = t8; +goto L42c8dc;} +MEM_U32(a1 + 4) = t8; +L42ca60: +//nop; +return; +//nop; +} + +static void f_home_parms(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42ca68: +//home_parms: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 36) = s3; +s3 = 0x10019d70; +MEM_U32(sp + 52) = ra; +s3 = MEM_U32(s3 + 0); +MEM_U32(sp + 48) = gp; +MEM_U32(sp + 44) = s5; +MEM_U32(sp + 40) = s4; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +if (s3 == 0) {MEM_U32(sp + 56) = a0; +goto L42ccc4;} +MEM_U32(sp + 56) = a0; +s2 = 0x100197b0; +s5 = 0xc; +s4 = 0x2; +L42cab4: +t6 = MEM_U16(s3 + 34); +//nop; +if (s4 == t6) {//nop; +goto L42ccb4;} +//nop; +//nop; +a0 = s3; +//nop; +v0 = f_pass_in_reg(mem, sp, a0); +goto L42cad4; +//nop; +L42cad4: +gp = MEM_U32(sp + 48); +if (v0 == 0) {t4 = MEM_U32(sp + 56); +goto L42ccc8;} +t4 = MEM_U32(sp + 56); +//nop; +a0 = s3; +//nop; +v0 = f_parm_reg(mem, sp, a0); +goto L42caf0; +//nop; +L42caf0: +v1 = v0 & 0xff; +t7 = v1 + 0xffffffe0; +t8 = t7 < 0x20; +t9 = -t8; +gp = MEM_U32(sp + 48); +t0 = t9 << (t7 & 0x1f); +if ((int)t0 >= 0) {s1 = v0 & 0xff; +goto L42cc14;} +s1 = v0 & 0xff; +t4 = MEM_U32(s2 + 0); +t1 = v1 < 0x20; +t2 = ~v1; +at = 0x100197b0; +t3 = t1 << (t2 & 0x1f); +t5 = t4 | t3; +t6 = v1 + 0xffffffe0; +MEM_U32(at + 0) = t5; +t0 = MEM_U32(s2 + 4); +t8 = t6 < 0x20; +t9 = ~v1; +at = 0x100197b0; +t7 = t8 << (t9 & 0x1f); +t1 = t0 | t7; +t2 = v1 + 0xffffffc0; +MEM_U32(at + 4) = t1; +t6 = MEM_U32(s2 + 8); +t4 = t2 < 0x20; +t3 = ~v1; +at = 0x100197b0; +t5 = t4 << (t3 & 0x1f); +t8 = t6 | t5; +MEM_U32(at + 8) = t8; +t9 = MEM_U32(s3 + 40); +t3 = v1 + 0x1; +at = (int)t9 < (int)0x5; +if (at != 0) {t6 = t3 < 0x20; +goto L42ccb4;} +t6 = t3 < 0x20; +a0 = MEM_U8(s3 + 33); +at = 0x5010000; +t0 = a0 & 0x1f; +t7 = t0 < 0x20; +t1 = -t7; +t2 = t1 & at; +v0 = t2 << (t0 & 0x1f); +t4 = (int)v0 < (int)0x0; +v0 = t4; +if (t4 != 0) {a0 = t0; +goto L42cbb4;} +a0 = t0; +v0 = s5 ^ a0; +v0 = v0 < 0x1; +L42cbb4: +if (v0 != 0) {//nop; +goto L42cbc0;} +//nop; +abort(); +L42cbc0: +t9 = MEM_U32(s2 + 0); +t5 = ~t3; +at = 0x100197b0; +t8 = t6 << (t5 & 0x1f); +t0 = t9 | t8; +t7 = t3 + 0xffffffe0; +MEM_U32(at + 0) = t0; +t4 = MEM_U32(s2 + 4); +t1 = t7 < 0x20; +at = 0x100197b0; +t2 = t1 << (t5 & 0x1f); +t6 = t4 | t2; +t9 = t3 + 0xffffffc0; +MEM_U32(at + 4) = t6; +t7 = MEM_U32(s2 + 8); +t8 = t9 < 0x20; +at = 0x100197b0; +t0 = t8 << (t5 & 0x1f); +t1 = t7 | t0; +MEM_U32(at + 8) = t1; +goto L42ccb4; +MEM_U32(at + 8) = t1; +L42cc14: +s0 = MEM_U32(s3 + 40); +//nop; +s0 = s0 + 0x3; +if ((int)s0 >= 0) {t4 = (int)s0 >> 2; +goto L42cc30;} +t4 = (int)s0 >> 2; +at = s0 + 0x3; +t4 = (int)at >> 2; +L42cc30: +if (t4 == 0) {s0 = t4; +goto L42ccb4;} +s0 = t4; +L42cc38: +t9 = MEM_U32(s2 + 0); +t2 = s1 < 0x20; +t6 = ~s1; +t3 = t2 << (t6 & 0x1f); +t5 = s1 + 0xffffffe0; +t8 = t9 | t3; +t7 = t5 < 0x20; +t6 = s1 + 0xffffffc0; +t0 = ~s1; +t5 = MEM_U32(s2 + 8); +t4 = MEM_U32(s2 + 4); +t1 = t7 << (t0 & 0x1f); +t9 = t6 < 0x20; +MEM_U32(s2 + 0) = t8; +t3 = ~s1; +t8 = t9 << (t3 & 0x1f); +t7 = t5 | t8; +t2 = t4 | t1; +MEM_U32(s2 + 4) = t2; +MEM_U32(s2 + 8) = t7; +//nop; +a0 = s1; +//nop; +v0 = f_is_parm_reg(mem, sp, a0); +goto L42cc98; +//nop; +L42cc98: +gp = MEM_U32(sp + 48); +if (v0 == 0) {s1 = s1 + 0x1; +goto L42ccc4;} +s1 = s1 + 0x1; +t0 = s1 & 0xff; +s0 = s0 + 0xffffffff; +if (s0 != 0) {s1 = t0; +goto L42cc38;} +s1 = t0; +L42ccb4: +s3 = MEM_U32(s3 + 8); +//nop; +if (s3 != 0) {//nop; +goto L42cab4;} +//nop; +L42ccc4: +t4 = MEM_U32(sp + 56); +L42ccc8: +s2 = 0x100197b0; +at = 0xffffffff; +if (t4 == at) {t1 = t4 & 0xffff; +goto L42ced0;} +t1 = t4 & 0xffff; +a0 = 0x10019310; +if ((int)t1 >= 0) {t2 = (int)t1 >> 2; +goto L42ccec;} +t2 = (int)t1 >> 2; +at = t1 + 0x3; +t2 = (int)at >> 2; +L42ccec: +a0 = MEM_U32(a0 + 0); +a1 = t2 + 0x4; +a0 = a0 + 0x3; +at = a0 < a1; +if (at != 0) {MEM_U32(sp + 56) = t2; +goto L42ced0;} +MEM_U32(sp + 56) = t2; +a0 = a0 + 0x1; +a2 = a0 - a1; +t6 = a2 & 0x3; +if (t6 == 0) {v0 = a1; +goto L42cd7c;} +v0 = a1; +v1 = t6 + a1; +L42cd1c: +t8 = MEM_U32(s2 + 0); +t9 = v0 < 0x20; +t3 = ~v0; +t5 = t9 << (t3 & 0x1f); +t0 = v0 + 0xffffffe0; +t7 = t8 | t5; +t4 = t0 < 0x20; +t3 = v0 + 0xffffffc0; +t1 = ~v0; +t0 = MEM_U32(s2 + 8); +t6 = MEM_U32(s2 + 4); +t2 = t4 << (t1 & 0x1f); +t8 = t3 < 0x20; +MEM_U32(s2 + 0) = t7; +t5 = ~v0; +t7 = t8 << (t5 & 0x1f); +v0 = v0 + 0x1; +t4 = t0 | t7; +t9 = t6 | t2; +MEM_U32(s2 + 4) = t9; +if (v1 != v0) {MEM_U32(s2 + 8) = t4; +goto L42cd1c;} +MEM_U32(s2 + 8) = t4; +if (v0 == a0) {ra = MEM_U32(sp + 52); +goto L42ced4;} +ra = MEM_U32(sp + 52); +L42cd7c: +t9 = MEM_U32(s2 + 0); +t1 = v0 < 0x20; +t6 = ~v0; +t2 = t1 << (t6 & 0x1f); +t8 = v0 + 0xffffffe0; +t4 = MEM_U32(s2 + 4); +t5 = t8 < 0x20; +t0 = ~v0; +t3 = t9 | t2; +t7 = t5 << (t0 & 0x1f); +t6 = v0 + 0xffffffc0; +t1 = t4 | t7; +t8 = MEM_U32(s2 + 8); +t9 = t6 < 0x20; +t0 = v0 + 0x1; +MEM_U32(s2 + 0) = t3; +t2 = ~v0; +t3 = t9 << (t2 & 0x1f); +t6 = MEM_U32(s2 + 0); +t4 = t0 < 0x20; +t7 = ~t0; +MEM_U32(s2 + 4) = t1; +t5 = t8 | t3; +t1 = t4 << (t7 & 0x1f); +t2 = t0 + 0xffffffe0; +t9 = t6 | t1; +t4 = MEM_U32(s2 + 4); +t8 = t2 < 0x20; +MEM_U32(s2 + 8) = t5; +t3 = ~t0; +t5 = t8 << (t3 & 0x1f); +MEM_U32(s2 + 0) = t9; +t6 = t0 + 0xffffffc0; +t7 = t4 | t5; +t8 = MEM_U32(s2 + 8); +t1 = t6 < 0x20; +t9 = ~t0; +t2 = t1 << (t9 & 0x1f); +t4 = v0 + 0x2; +MEM_U32(s2 + 4) = t7; +t3 = t8 | t2; +t7 = ~t4; +t5 = t4 < 0x20; +t0 = MEM_U32(s2 + 0); +t6 = t5 << (t7 & 0x1f); +t9 = t4 + 0xffffffe0; +t5 = MEM_U32(s2 + 4); +t8 = t9 < 0x20; +MEM_U32(s2 + 8) = t3; +t2 = ~t4; +t3 = t8 << (t2 & 0x1f); +t1 = t0 | t6; +t7 = t5 | t3; +MEM_U32(s2 + 0) = t1; +t1 = ~t4; +t5 = v0 + 0x3; +t0 = t4 + 0xffffffc0; +t8 = MEM_U32(s2 + 8); +t6 = t0 < 0x20; +MEM_U32(s2 + 4) = t7; +t4 = MEM_U32(s2 + 0); +t7 = ~t5; +t9 = t6 << (t1 & 0x1f); +t3 = t5 < 0x20; +t0 = t3 << (t7 & 0x1f); +t2 = t8 | t9; +t6 = t4 | t0; +t1 = t5 + 0xffffffe0; +t8 = t1 < 0x20; +MEM_U32(s2 + 8) = t2; +t9 = ~t5; +t2 = t8 << (t9 & 0x1f); +MEM_U32(s2 + 0) = t6; +t4 = t5 + 0xffffffc0; +t8 = MEM_U32(s2 + 8); +t3 = MEM_U32(s2 + 4); +t0 = t4 < 0x20; +t6 = ~t5; +t1 = t0 << (t6 & 0x1f); +v0 = v0 + 0x4; +t9 = t8 | t1; +t7 = t3 | t2; +MEM_U32(s2 + 4) = t7; +if (v0 != a0) {MEM_U32(s2 + 8) = t9; +goto L42cd7c;} +MEM_U32(s2 + 8) = t9; +L42ced0: +ra = MEM_U32(sp + 52); +L42ced4: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +s4 = MEM_U32(sp + 40); +s5 = MEM_U32(sp + 44); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void f_clean_tree(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42cef4: +//clean_tree: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a0; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +s1 = 0xffffff01; +L42cf1c: +t6 = MEM_U8(s0 + 25); +a0 = MEM_U32(s0 + 0); +t7 = t6 & s1; +t8 = t7 | 0x90; +MEM_U8(s0 + 25) = (uint8_t)t8; +if (a0 == 0) {MEM_U8(s0 + 24) = (uint8_t)zero; +goto L42cf8c;} +MEM_U8(s0 + 24) = (uint8_t)zero; +t9 = MEM_U8(s0 + 32); +//nop; +t0 = t9 < 0x60; +if (t0 == 0) {t1 = (int)t9 >> 5; +goto L42cf6c;} +t1 = (int)t9 >> 5; +t3 = 0x100052b8; +t2 = t1 << 2; +t3 = t3; +t4 = t3 + t2; +t5 = MEM_U32(t4 + 0); +//nop; +t6 = t5 << (t9 & 0x1f); +t0 = (int)t6 < (int)0x0; +L42cf6c: +if (t0 != 0) {//nop; +goto L42cf8c;} +//nop; +//nop; +//nop; +//nop; +f_clean_tree(mem, sp, a0); +goto L42cf84; +//nop; +L42cf84: +gp = MEM_U32(sp + 32); +//nop; +L42cf8c: +a0 = MEM_U32(s0 + 4); +//nop; +if (a0 == 0) {//nop; +goto L42cff0;} +//nop; +t8 = MEM_U8(s0 + 32); +//nop; +t1 = t8 < 0xa0; +if (t1 == 0) {t3 = (int)t8 >> 5; +goto L42cfd0;} +t3 = (int)t8 >> 5; +t4 = 0x100052a4; +t2 = t3 << 2; +t4 = t4; +t5 = t4 + t2; +t9 = MEM_U32(t5 + 0); +//nop; +t6 = t9 << (t8 & 0x1f); +t1 = (int)t6 < (int)0x0; +L42cfd0: +if (t1 != 0) {//nop; +goto L42cff0;} +//nop; +//nop; +//nop; +//nop; +f_clean_tree(mem, sp, a0); +goto L42cfe8; +//nop; +L42cfe8: +gp = MEM_U32(sp + 32); +//nop; +L42cff0: +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 != 0) {//nop; +goto L42cf1c;} +//nop; +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_clear_pmov_regs(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42d014: +//clear_pmov_regs: +//nop; +//nop; +//nop; +at = 0x10019d30; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10019d30; +//nop; +MEM_U32(at + 4) = zero; +at = 0x10019d30; +MEM_U32(at + 8) = zero; +return; +MEM_U32(at + 8) = zero; +} + +static void f_save_pmov_reg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42d044: +//save_pmov_reg: +//nop; +//nop; +//nop; +v0 = 0x10019d30; +t6 = a0 < 0x20; +t9 = MEM_U32(v0 + 0); +t7 = ~a0; +t8 = t6 << (t7 & 0x1f); +t1 = a0 + 0xffffffe0; +t0 = t9 | t8; +t2 = t1 < 0x20; +t7 = a0 + 0xffffffc0; +t3 = ~a0; +t1 = MEM_U32(v0 + 8); +t5 = MEM_U32(v0 + 4); +t4 = t2 << (t3 & 0x1f); +t9 = t7 < 0x20; +t8 = ~a0; +MEM_U32(v0 + 0) = t0; +t0 = t9 << (t8 & 0x1f); +t2 = t1 | t0; +t6 = t5 | t4; +MEM_U32(sp + 0) = a0; +MEM_U32(v0 + 4) = t6; +MEM_U32(v0 + 8) = t2; +return; +MEM_U32(v0 + 8) = t2; +} + +static void f_load_pmov_regs(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42d0ac: +//load_pmov_regs: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 36) = s2; +s2 = 0x10019d30; +MEM_U32(sp + 44) = ra; +t6 = MEM_U32(s2 + 8); +t7 = MEM_U32(s2 + 4); +t9 = MEM_U32(s2 + 0); +t8 = t6 | t7; +t0 = t8 | t9; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 32) = s1; +if (t0 == 0) {MEM_U32(sp + 28) = s0; +goto L42d168;} +MEM_U32(sp + 28) = s0; +s1 = 0x10019310; +s0 = 0x4; +s1 = MEM_U32(s1 + 0); +//nop; +s1 = s1 + 0x3; +at = s1 < 0x4; +if (at != 0) {s1 = s1 + 0x1; +goto L42d168;} +s1 = s1 + 0x1; +t1 = s0 < 0x60; +L42d110: +if (t1 == 0) {t2 = (int)s0 >> 5; +goto L42d130;} +t2 = (int)s0 >> 5; +t3 = t2 << 2; +t4 = s2 + t3; +t5 = MEM_U32(t4 + 0); +//nop; +t6 = t5 << (s0 & 0x1f); +t1 = (int)t6 < (int)0x0; +L42d130: +if (t1 == 0) {a0 = 0x2a; +goto L42d15c;} +a0 = 0x2a; +//nop; +a2 = s0 << 2; +a2 = a2 + 0xfffffff0; +a1 = s0; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42d154; +MEM_U32(sp + 16) = zero; +L42d154: +gp = MEM_U32(sp + 40); +//nop; +L42d15c: +s0 = s0 + 0x1; +if (s0 != s1) {t1 = s0 < 0x60; +goto L42d110;} +t1 = s0 < 0x60; +L42d168: +ra = MEM_U32(sp + 44); +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static uint32_t f_cvt_tab(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42d180: +//cvt_tab: +//nop; +//nop; +//nop; +v0 = a0 & 0xff; +at = v0 < 0x10; +MEM_U32(sp + 0) = a0; +if (at == 0) {MEM_U32(sp + 4) = a1; +goto L42d318;} +MEM_U32(sp + 4) = a1; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100094d8[] = { +&&L42d1c0, +&&L42d318, +&&L42d318, +&&L42d318, +&&L42d1c0, +&&L42d20c, +&&L42d1c0, +&&L42d20c, +&&L42d1c0, +&&L42d318, +&&L42d318, +&&L42d318, +&&L42d2b8, +&&L42d258, +&&L42d318, +&&L42d20c, +}; +dest = Lswitch100094d8[v0]; +//nop; +goto *dest; +//nop; +L42d1c0: +v0 = a1 & 0xff; +t7 = v0 + 0xfffffff4; +at = t7 < 0x2; +if (at == 0) {//nop; +goto L42d204;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10009448[] = { +&&L42d1fc, +&&L42d1f4, +}; +dest = Lswitch10009448[t7]; +//nop; +goto *dest; +//nop; +L42d1f4: +v0 = 0x93; +return v0; +v0 = 0x93; +L42d1fc: +v0 = 0x96; +return v0; +v0 = 0x96; +L42d204: +v0 = 0x3e; +return v0; +v0 = 0x3e; +L42d20c: +v0 = a1 & 0xff; +t8 = v0 + 0xfffffff4; +at = t8 < 0x2; +if (at == 0) {//nop; +goto L42d250;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10009450[] = { +&&L42d248, +&&L42d240, +}; +dest = Lswitch10009450[t8]; +//nop; +goto *dest; +//nop; +L42d240: +v0 = 0x15f; +return v0; +v0 = 0x15f; +L42d248: +v0 = 0x160; +return v0; +v0 = 0x160; +L42d250: +v0 = 0x3e; +return v0; +v0 = 0x3e; +L42d258: +v0 = a1 & 0xff; +at = v0 < 0x10; +if (at == 0) {//nop; +goto L42d2b0;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10009458[] = { +&&L42d2a0, +&&L42d2b0, +&&L42d2b0, +&&L42d2b0, +&&L42d2a0, +&&L42d288, +&&L42d290, +&&L42d298, +&&L42d2a0, +&&L42d2b0, +&&L42d2b0, +&&L42d2b0, +&&L42d2a8, +&&L42d2b0, +&&L42d2b0, +&&L42d298, +}; +dest = Lswitch10009458[v0]; +//nop; +goto *dest; +//nop; +L42d288: +v0 = 0x14f; +return v0; +v0 = 0x14f; +L42d290: +v0 = 0xe8; +return v0; +v0 = 0xe8; +L42d298: +v0 = 0x14f; +return v0; +v0 = 0x14f; +L42d2a0: +v0 = 0xe8; +return v0; +v0 = 0xe8; +L42d2a8: +v0 = 0x94; +return v0; +v0 = 0x94; +L42d2b0: +v0 = 0x3e; +return v0; +v0 = 0x3e; +L42d2b8: +v0 = a1 & 0xff; +at = v0 < 0x10; +if (at == 0) {//nop; +goto L42d310;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10009498[] = { +&&L42d300, +&&L42d310, +&&L42d310, +&&L42d310, +&&L42d300, +&&L42d2e8, +&&L42d2f0, +&&L42d2f8, +&&L42d300, +&&L42d310, +&&L42d310, +&&L42d310, +&&L42d310, +&&L42d308, +&&L42d310, +&&L42d2f8, +}; +dest = Lswitch10009498[v0]; +//nop; +goto *dest; +//nop; +L42d2e8: +v0 = 0x153; +return v0; +v0 = 0x153; +L42d2f0: +v0 = 0xe9; +return v0; +v0 = 0xe9; +L42d2f8: +v0 = 0x153; +return v0; +v0 = 0x153; +L42d300: +v0 = 0xe9; +return v0; +v0 = 0xe9; +L42d308: +v0 = 0x91; +return v0; +v0 = 0x91; +L42d310: +v0 = 0x3e; +return v0; +v0 = 0x3e; +L42d318: +v0 = 0x3e; +return v0; +v0 = 0x3e; +//nop; +return v0; +//nop; +} + +static uint32_t f_rnd_tab(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42d328: +//rnd_tab: +//nop; +//nop; +//nop; +at = 0xd; +MEM_U32(sp + 0) = a0; +if (a0 != at) {MEM_U32(sp + 4) = a1; +goto L42d3b8;} +MEM_U32(sp + 4) = a1; +at = a1 < 0x9; +goto L42d374; +at = a1 < 0x9; +L42d34c: +v0 = 0xf3; +return v0; +v0 = 0xf3; +L42d354: +v0 = 0xeb; +return v0; +v0 = 0xeb; +L42d35c: +v0 = 0x150; +return v0; +v0 = 0x150; +L42d364: +v0 = 0x150; +return v0; +v0 = 0x150; +L42d36c: +v0 = 0x3e; +return v0; +v0 = 0x3e; +L42d374: +if (at != 0) {at = 0xf; +goto L42d38c;} +at = 0xf; +if (a1 == at) {//nop; +goto L42d364;} +//nop; +v0 = 0x3e; +return v0; +v0 = 0x3e; +L42d38c: +at = a1 < 0x9; +if (at == 0) {//nop; +goto L42d36c;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10009518[] = { +&&L42d34c, +&&L42d36c, +&&L42d36c, +&&L42d36c, +&&L42d34c, +&&L42d35c, +&&L42d354, +&&L42d364, +&&L42d34c, +}; +dest = Lswitch10009518[a1]; +//nop; +goto *dest; +//nop; +L42d3b8: +at = 0xc; +if (a0 != at) {v0 = 0x3e; +goto L42d438;} +v0 = 0x3e; +at = a1 < 0x9; +goto L42d3f4; +at = a1 < 0x9; +L42d3cc: +v0 = 0xf4; +return v0; +v0 = 0xf4; +L42d3d4: +v0 = 0xec; +return v0; +v0 = 0xec; +L42d3dc: +v0 = 0x154; +return v0; +v0 = 0x154; +L42d3e4: +v0 = 0x154; +return v0; +v0 = 0x154; +L42d3ec: +v0 = 0x3e; +return v0; +v0 = 0x3e; +L42d3f4: +if (at != 0) {at = 0xf; +goto L42d40c;} +at = 0xf; +if (a1 == at) {//nop; +goto L42d3e4;} +//nop; +v0 = 0x3e; +return v0; +v0 = 0x3e; +L42d40c: +at = a1 < 0x9; +if (at == 0) {//nop; +goto L42d3ec;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000953c[] = { +&&L42d3cc, +&&L42d3ec, +&&L42d3ec, +&&L42d3ec, +&&L42d3cc, +&&L42d3dc, +&&L42d3d4, +&&L42d3e4, +&&L42d3cc, +}; +dest = Lswitch1000953c[a1]; +//nop; +goto *dest; +//nop; +L42d438: +//nop; +return v0; +//nop; +} + +static void f_eval(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L42d47c: +//eval: +//nop; +//nop; +//nop; +sp = sp + 0xfffffec0; +MEM_U32(sp + 212) = ra; +MEM_U32(sp + 208) = fp; +MEM_U32(sp + 204) = gp; +MEM_U32(sp + 200) = s7; +MEM_U32(sp + 196) = s6; +MEM_U32(sp + 192) = s5; +MEM_U32(sp + 188) = s4; +MEM_U32(sp + 184) = s3; +MEM_U32(sp + 180) = s2; +MEM_U32(sp + 176) = s1; +MEM_U32(sp + 172) = s0; +MEM_U32(sp + 324) = a1; +s0 = MEM_U8(a0 + 25); +at = 0x48; +t6 = s0 << 24; +t7 = t6 >> 25; +s6 = a0; +fp = a1 & 0xff; +if (t7 == at) {s0 = t7; +goto L42d55c;} +s0 = t7; +t8 = MEM_U8(a0 + 24); +//nop; +if (t8 == 0) {t1 = s0 + 0xffffffe0; +goto L42d510;} +t1 = s0 + 0xffffffe0; +//nop; +//nop; +//nop; +f_restore_from_temp(mem, sp, a0); +goto L42d4fc; +//nop; +L42d4fc: +s0 = MEM_U8(s6 + 25); +gp = MEM_U32(sp + 204); +t9 = s0 << 24; +s0 = t9 >> 25; +t1 = s0 + 0xffffffe0; +L42d510: +t2 = t1 < 0x20; +t3 = -t2; +t4 = t3 << (t1 & 0x1f); +if ((int)t4 >= 0) {//nop; +goto L42d540;} +//nop; +//nop; +a0 = s0; +//nop; +f_move_to_end_fp_list(mem, sp, a0); +goto L42d534; +//nop; +L42d534: +gp = MEM_U32(sp + 204); +ra = MEM_U32(sp + 212); +goto L434eec; +ra = MEM_U32(sp + 212); +L42d540: +//nop; +a0 = s0; +//nop; +f_move_to_end_gp_list(mem, sp, a0); +goto L42d550; +//nop; +L42d550: +gp = MEM_U32(sp + 204); +ra = MEM_U32(sp + 212); +goto L434eec; +ra = MEM_U32(sp + 212); +L42d55c: +t5 = MEM_U16(s6 + 20); +//nop; +at = t5 < 0x2; +if (at != 0) {//nop; +goto L42d574;} +//nop; +fp = 0x48; +L42d574: +if (s6 == 0) {//nop; +goto L434ee8;} +//nop; +L42d57c: +a0 = MEM_U8(s6 + 32); +//nop; +v0 = a0; +at = v0 < 0x98; +if (at == 0) {//nop; +goto L434c2c;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10009924[] = { +&&L43270c, +&&L432890, +&&L434c2c, +&&L42debc, +&&L432890, +&&L433e40, +&&L434c2c, +&&L42d7a0, +&&L433af8, +&&L434c2c, +&&L433b7c, +&&L430624, +&&L43371c, +&&L43371c, +&&L433680, +&&L433650, +&&L43452c, +&&L4339e4, +&&L434c2c, +&&L433ae4, +&&L434c2c, +&&L434c2c, +&&L434c2c, +&&L42f96c, +&&L43317c, +&&L432fbc, +&&L434c2c, +&&L42e498, +&&L434c2c, +&&L432890, +&&L434c2c, +&&L42df64, +&&L433b24, +&&L42d7f0, +&&L434c2c, +&&L432890, +&&L434c2c, +&&L434c2c, +&&L430314, +&&L434c2c, +&&L432890, +&&L432890, +&&L434c2c, +&&L434c2c, +&&L42fc4c, +&&L434c2c, +&&L433820, +&&L433820, +&&L433820, +&&L4305c8, +&&L434c2c, +&&L434c2c, +&&L433820, +&&L433820, +&&L430cf8, +&&L434c2c, +&&L433820, +&&L434c2c, +&&L434c2c, +&&L434c2c, +&&L432890, +&&L430cf8, +&&L4314e4, +&&L4314e4, +&&L434c2c, +&&L434c2c, +&&L42e9e4, +&&L434c2c, +&&L43459c, +&&L434c2c, +&&L43248c, +&&L43208c, +&&L434c2c, +&&L430670, +&&L434c2c, +&&L434260, +&&L434c2c, +&&L432890, +&&L432890, +&&L434c2c, +&&L432504, +&&L42d5b4, +&&L430a04, +&&L434c2c, +&&L434c2c, +&&L42fe30, +&&L42fe30, +&&L432d58, +&&L43384c, +&&L434c2c, +&&L42f310, +&&L432890, +&&L42f158, +&&L434c2c, +&&L43270c, +&&L432890, +&&L433ad0, +&&L43259c, +&&L434c2c, +&&L42d678, +&&L42f490, +&&L434c2c, +&&L42f310, +&&L434c2c, +&&L42e8a4, +&&L432890, +&&L434c2c, +&&L434c2c, +&&L434c2c, +&&L434c2c, +&&L433b50, +&&L42f890, +&&L434c2c, +&&L434c2c, +&&L434c2c, +&&L432890, +&&L432890, +&&L4346e0, +&&L434c2c, +&&L4345cc, +&&L42e444, +&&L434c2c, +&&L434ee8, +&&L42eb3c, +&&L4342ec, +&&L432890, +&&L434c2c, +&&L4302e0, +&&L434390, +&&L434390, +&&L434390, +&&L434390, +&&L434390, +&&L434390, +&&L4333b0, +&&L434c2c, +&&L430348, +&&L42d6b8, +&&L434c2c, +&&L42e8d0, +&&L433878, +&&L432890, +&&L434c2c, +&&L434678, +&&L4346ac, +&&L434c2c, +&&L434c2c, +&&L431284, +&&L431d08, +&&L43091c, +&&L42e46c, +&&L42f96c, +}; +dest = Lswitch10009924[v0]; +//nop; +goto *dest; +//nop; +L42d5b4: +t7 = 0x10019d40; +a3 = MEM_U32(s6 + 36); +at = 0x10018e00; +t7 = MEM_U8(t7 + 0); +v0 = a3; +if (t7 == 0) {MEM_U32(at + 0) = a3; +goto L42d5fc;} +MEM_U32(at + 0) = a3; +v1 = 0x10019d44; +t9 = MEM_U16(s6 + 34); +at = 0x10019d48; +MEM_U32(v1 + 0) = t9; +a0 = 0x10018ed4; +MEM_U32(at + 0) = v0; +at = 0x10019d40; +a0 = MEM_U8(a0 + 0); +MEM_U32(sp + 264) = t9; +MEM_U8(at + 0) = (uint8_t)zero; +goto L434d7c; +MEM_U8(at + 0) = (uint8_t)zero; +L42d5fc: +s0 = MEM_U16(s6 + 34); +t0 = MEM_U32(sp + 264); +//nop; +if (t0 == s0) {//nop; +goto L42d648;} +//nop; +t2 = 0x10018e88; +a0 = s0; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42d648;} +//nop; +//nop; +MEM_U32(sp + 264) = s0; +a1 = zero; +f_emit_file(mem, sp, a0, a1, a2, a3); +goto L42d638; +a1 = zero; +L42d638: +gp = MEM_U32(sp + 204); +a3 = MEM_U32(s6 + 36); +s0 = MEM_U16(s6 + 34); +//nop; +L42d648: +//nop; +a0 = 0x1c; +a1 = zero; +a2 = s0; +f_emit_dir2(mem, sp, a0, a1, a2, a3); +goto L42d65c; +a2 = s0; +L42d65c: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42d678: +a0 = 0x10018ed4; +a3 = MEM_U32(s6 + 36); +at = 0x1; +a0 = MEM_U8(a0 + 0); +if (a3 != at) {at = 0x2; +goto L42d6a0;} +at = 0x2; +t3 = MEM_U32(s6 + 40); +MEM_U32(sp + 268) = t3; +goto L434d7c; +MEM_U32(sp + 268) = t3; +at = 0x2; +L42d6a0: +if (a3 != at) {//nop; +goto L434d7c;} +//nop; +t1 = MEM_U32(s6 + 40); +at = 0x10018ec8; +MEM_U32(at + 0) = t1; +goto L434d7c; +MEM_U32(at + 0) = t1; +L42d6b8: +t5 = MEM_U8(s6 + 33); +t4 = MEM_U32(s6 + 36); +s3 = MEM_U8(s6 + 35); +t6 = t5 & 0x1f; +if (t6 != 0) {MEM_U8(sp + 318) = (uint8_t)t4; +goto L42d728;} +MEM_U8(sp + 318) = (uint8_t)t4; +t8 = 0x10019bb0; +t7 = s3 << 2; +v0 = t7 + t8; +a1 = MEM_U32(v0 + 0); +t9 = t4 & 0xff; +t0 = 0x1; +a2 = t0 << (t9 & 0x1f); +t2 = a1 & a2; +if (t2 == 0) {a0 = 0x31; +goto L42d774;} +a0 = 0x31; +t5 = 0x10019bb0; +t1 = t4 & 0xff; +t3 = a1 - a2; +t4 = t1 << 2; +MEM_U32(v0 + 0) = t3; +v1 = t4 + t5; +t6 = MEM_U32(v1 + 0); +t7 = 0x1; +t8 = t7 << (s3 & 0x1f); +t0 = t6 - t8; +MEM_U32(v1 + 0) = t0; +goto L42d774; +MEM_U32(v1 + 0) = t0; +L42d728: +t2 = 0x10019bb0; +t9 = s3 << 2; +t1 = MEM_U8(sp + 318); +v0 = t9 + t2; +t3 = MEM_U32(v0 + 0); +t6 = MEM_U8(sp + 318); +t4 = 0x1; +t0 = 0x10019bb0; +t5 = t4 << (t1 & 0x1f); +t7 = t3 | t5; +t8 = t6 << 2; +MEM_U32(v0 + 0) = t7; +v1 = t8 + t0; +t9 = MEM_U32(v1 + 0); +t2 = 0x1; +t4 = t2 << (s3 & 0x1f); +t1 = t9 | t4; +a0 = 0x30; +MEM_U32(v1 + 0) = t1; +L42d774: +//nop; +a2 = MEM_U8(sp + 318); +a1 = s3; +f_emit_alias(mem, sp, a0, a1, a2); +goto L42d784; +a1 = s3; +L42d784: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42d7a0: +//nop; +a2 = MEM_U32(s6 + 40); +a3 = MEM_U32(s6 + 44); +a0 = 0x2a; +a1 = zero; +f_demit_dir2(mem, sp, a0, a1, a2, a3); +goto L42d7b8; +a1 = zero; +L42d7b8: +gp = MEM_U32(sp + 204); +a0 = 0x2f; +a2 = 0x10018ed8; +//nop; +a2 = MEM_U32(a2 + 0); +a1 = zero; +f_demit_dir1(mem, sp, a0, a1, a2); +goto L42d7d4; +a1 = zero; +L42d7d4: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42d7f0: +//nop; +t3 = 0xffffffff; +t5 = 0xffffffff; +MEM_U32(sp + 232) = t5; +MEM_U32(sp + 268) = t3; +f_clear_saved_regs(mem, sp); +goto L42d808; +MEM_U32(sp + 268) = t3; +L42d808: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +f_init_regs(mem, sp); +goto L42d820; +//nop; +L42d820: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +f_init_temps(mem, sp); +goto L42d838; +//nop; +L42d838: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +f_reset_pool(mem, sp); +goto L42d850; +//nop; +L42d850: +gp = MEM_U32(sp + 204); +s0 = zero; +s1 = 0x10019ce0; +s2 = 0x10019bb0; +v0 = s1 + 0x20; +L42d864: +s1 = s1 + 0x1; +MEM_U32(s2 + 0) = zero; +MEM_U8(s1 + -1) = (uint8_t)zero; +if (s1 != v0) {s2 = s2 + 0x4; +goto L42d864;} +s2 = s2 + 0x4; +v0 = 0x1001938c; +at = 0x10019d70; +v0 = MEM_U8(v0 + 0); +MEM_U32(at + 0) = zero; +if (v0 != 0) {//nop; +goto L42d8d0;} +//nop; +v0 = 0x10018e9c; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +if (v0 != 0) {//nop; +goto L42d8d0;} +//nop; +v0 = 0x10018ee8; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +if (v0 != 0) {//nop; +goto L42d8d0;} +//nop; +v0 = MEM_U32(s6 + 44); +//nop; +t7 = v0 & 0x2; +v0 = zero < t7; +L42d8d0: +at = 0x10019390; +//nop; +MEM_U8(at + 0) = (uint8_t)v0; +a3 = MEM_U32(s6 + 44); +//nop; +t8 = a3 & 0x80; +if (t8 == 0) {t9 = a3 & 0x200; +goto L42d914;} +t9 = a3 & 0x200; +t0 = 0x10018e98; +at = 0x2; +t0 = MEM_U32(t0 + 0); +t2 = 0x1; +if (t0 != at) {//nop; +goto L42d914;} +//nop; +at = 0x10019394; +MEM_U8(at + 0) = (uint8_t)t2; +goto L42d920; +MEM_U8(at + 0) = (uint8_t)t2; +L42d914: +at = 0x10019394; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +L42d920: +if (t9 == 0) {t6 = 0xffffffff; +goto L42d968;} +t6 = 0xffffffff; +t4 = 0x10019398; +t1 = 0xffffffff; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42d948;} +//nop; +MEM_U32(sp + 224) = zero; +goto L42d94c; +MEM_U32(sp + 224) = zero; +L42d948: +MEM_U32(sp + 224) = t1; +L42d94c: +t3 = MEM_U8(s6 + 40); +t5 = MEM_U8(s6 + 41); +MEM_U8(sp + 226) = (uint8_t)t3; +MEM_U8(sp + 227) = (uint8_t)t5; +t7 = MEM_U32(sp + 224); +MEM_U32(sp + 228) = t7; +goto L42d96c; +MEM_U32(sp + 228) = t7; +L42d968: +MEM_U32(sp + 228) = t6; +L42d96c: +t8 = 0x10019390; +t0 = 0xd; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L42d9a4;} +//nop; +at = 0x10019380; +//nop; +a0 = 0xd; +MEM_U8(at + 0) = (uint8_t)t0; +f_remove_from_free_list(mem, sp, a0); +goto L42d998; +MEM_U8(at + 0) = (uint8_t)t0; +L42d998: +gp = MEM_U32(sp + 204); +//nop; +goto L42d9b0; +//nop; +L42d9a4: +at = 0x10019380; +t2 = 0x1d; +MEM_U8(at + 0) = (uint8_t)t2; +L42d9b0: +t9 = 0x10019330; +//nop; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L42d9e0;} +//nop; +t4 = 0x10019334; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L42dbe0;} +//nop; +L42d9e0: +v1 = 0x1001931c; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +t1 = v1 << 1; +v1 = t1 + 0x32; +at = v1 < 0x34; +if (at != 0) {v1 = v1 + 0x1; +goto L42dc04;} +v1 = v1 + 0x1; +a0 = v1 + 0xffffffcc; +t3 = a0 & 0x3; +if (t3 == 0) {s0 = 0x34; +goto L42da7c;} +s0 = 0x34; +a0 = 0x10019338; +v0 = t3 + 0x34; +L42da1c: +t8 = MEM_U32(a0 + 0); +t5 = s0 < 0x20; +t7 = ~s0; +t6 = t5 << (t7 & 0x1f); +t2 = s0 + 0xffffffe0; +t0 = t8 | t6; +t9 = t2 < 0x20; +t7 = s0 + 0xffffffc0; +t4 = ~s0; +t2 = MEM_U32(a0 + 8); +t3 = MEM_U32(a0 + 4); +t1 = t9 << (t4 & 0x1f); +t8 = t7 < 0x20; +MEM_U32(a0 + 0) = t0; +t6 = ~s0; +t0 = t8 << (t6 & 0x1f); +s0 = s0 + 0x1; +t9 = t2 | t0; +t5 = t3 | t1; +MEM_U32(a0 + 4) = t5; +if (v0 != s0) {MEM_U32(a0 + 8) = t9; +goto L42da1c;} +MEM_U32(a0 + 8) = t9; +if (s0 == v1) {//nop; +goto L42dc04;} +//nop; +L42da7c: +v0 = 0x10019338; +//nop; +L42da84: +t5 = MEM_U32(v0 + 0); +t4 = s0 < 0x20; +t3 = ~s0; +t1 = t4 << (t3 & 0x1f); +t8 = s0 + 0xffffffe0; +t9 = MEM_U32(v0 + 4); +t6 = t8 < 0x20; +t2 = ~s0; +t7 = t5 | t1; +t0 = t6 << (t2 & 0x1f); +t3 = s0 + 0xffffffc0; +t4 = t9 | t0; +t8 = MEM_U32(v0 + 8); +t5 = t3 < 0x20; +t2 = s0 + 0x1; +MEM_U32(v0 + 0) = t7; +t1 = ~s0; +t7 = t5 << (t1 & 0x1f); +t3 = MEM_U32(v0 + 0); +t9 = t2 < 0x20; +t0 = ~t2; +MEM_U32(v0 + 4) = t4; +t6 = t8 | t7; +t4 = t9 << (t0 & 0x1f); +t1 = t2 + 0xffffffe0; +t5 = t3 | t4; +t9 = MEM_U32(v0 + 4); +t8 = t1 < 0x20; +MEM_U32(v0 + 8) = t6; +t7 = ~t2; +t6 = t8 << (t7 & 0x1f); +MEM_U32(v0 + 0) = t5; +t3 = t2 + 0xffffffc0; +t0 = t9 | t6; +t8 = MEM_U32(v0 + 8); +t4 = t3 < 0x20; +t5 = ~t2; +t1 = t4 << (t5 & 0x1f); +t9 = s0 + 0x2; +MEM_U32(v0 + 4) = t0; +t7 = t8 | t1; +t0 = ~t9; +t6 = t9 < 0x20; +t2 = MEM_U32(v0 + 0); +t3 = t6 << (t0 & 0x1f); +t5 = t9 + 0xffffffe0; +t6 = MEM_U32(v0 + 4); +t8 = t5 < 0x20; +MEM_U32(v0 + 8) = t7; +t1 = ~t9; +t7 = t8 << (t1 & 0x1f); +t4 = t2 | t3; +t0 = t6 | t7; +MEM_U32(v0 + 0) = t4; +t4 = ~t9; +t6 = s0 + 0x3; +t2 = t9 + 0xffffffc0; +t8 = MEM_U32(v0 + 8); +t3 = t2 < 0x20; +MEM_U32(v0 + 4) = t0; +t9 = MEM_U32(v0 + 0); +t0 = ~t6; +t5 = t3 << (t4 & 0x1f); +t7 = t6 < 0x20; +t2 = t7 << (t0 & 0x1f); +t1 = t8 | t5; +t3 = t9 | t2; +t4 = t6 + 0xffffffe0; +t8 = t4 < 0x20; +MEM_U32(v0 + 8) = t1; +t5 = ~t6; +t1 = t8 << (t5 & 0x1f); +MEM_U32(v0 + 0) = t3; +t9 = t6 + 0xffffffc0; +t8 = MEM_U32(v0 + 8); +t7 = MEM_U32(v0 + 4); +t2 = t9 < 0x20; +t3 = ~t6; +t4 = t2 << (t3 & 0x1f); +s0 = s0 + 0x4; +t5 = t8 | t4; +t0 = t7 | t1; +MEM_U32(v0 + 4) = t0; +if (s0 != v1) {MEM_U32(v0 + 8) = t5; +goto L42da84;} +MEM_U32(v0 + 8) = t5; +//nop; +goto L42dc04; +//nop; +L42dbe0: +at = 0x10019338; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10019338; +//nop; +MEM_U32(at + 4) = zero; +at = 0x10019338; +//nop; +MEM_U32(at + 8) = zero; +L42dc04: +t7 = 0x10019d3c; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L42dc58;} +//nop; +//nop; +a0 = s6; +//nop; +v0 = f_get_saved_regs_size(mem, sp, a0); +goto L42dc2c; +//nop; +L42dc2c: +gp = MEM_U32(sp + 204); +//nop; +v1 = 0x10019d54; +at = 0x10019388; +MEM_U32(v1 + 0) = v0; +//nop; +MEM_U32(at + 0) = v0; +//nop; +f_save_i_ptrs(mem, sp); +goto L42dc50; +//nop; +L42dc50: +gp = MEM_U32(sp + 204); +//nop; +L42dc58: +at = 0x10019ba0; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10019d4c; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10019d50; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10019ba4; +//nop; +MEM_U32(at + 0) = zero; +at = 0x100197c8; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x100197c4; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10019820; +//nop; +MEM_U32(at + 0) = zero; +t0 = MEM_U16(s6 + 34); +at = 0x10019d64; +//nop; +MEM_U32(at + 0) = t0; +t9 = MEM_U32(s6 + 36); +at = 0x10019d60; +//nop; +MEM_U32(at + 0) = t9; +a3 = MEM_U32(s6 + 44); +at = 0x10019d5c; +t6 = a3 & 0x1; +t3 = a3 & 0x20; +t4 = a3 & 0x4; +t7 = a3 & 0x8; +t2 = zero < t6; +t8 = zero < t3; +t5 = zero < t4; +t1 = zero < t7; +t0 = a3 & 0x10; +MEM_U8(sp + 255) = (uint8_t)t2; +MEM_U8(sp + 254) = (uint8_t)t8; +MEM_U8(sp + 253) = (uint8_t)t5; +MEM_U8(sp + 252) = (uint8_t)t1; +if (t0 == 0) {MEM_U8(at + 0) = (uint8_t)zero; +goto L42dd70;} +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10019d5c; +t6 = 0x10019d3c; +t9 = 0x1; +MEM_U8(at + 0) = (uint8_t)t9; +at = 0x10018ec8; +t6 = MEM_U8(t6 + 0); +MEM_U32(at + 0) = zero; +if (t6 != 0) {//nop; +goto L42dd4c;} +//nop; +v0 = 0x10019388; +//nop; +t2 = MEM_U32(v0 + 0); +//nop; +t3 = t2 + 0x4; +MEM_U32(v0 + 0) = t3; +L42dd4c: +v0 = 0x100197b0; +//nop; +t8 = MEM_U32(v0 + 0); +t5 = MEM_U32(v0 + 4); +t7 = MEM_U32(v0 + 8); +t4 = t8 | 0x100; +MEM_U32(v0 + 0) = t4; +MEM_U32(v0 + 4) = t5; +MEM_U32(v0 + 8) = t7; +L42dd70: +v1 = 0x10019388; +v0 = MEM_U32(s6 + 8); +t1 = MEM_U32(v1 + 0); +t2 = MEM_U8(v0 + 32); +t0 = t1 + 0x7; +if ((int)t0 >= 0) {t9 = (int)t0 >> 3; +goto L42dd94;} +t9 = (int)t0 >> 3; +at = t0 + 0x7; +t9 = (int)at >> 3; +L42dd94: +t6 = t9 << 3; +t3 = t2 < 0xa0; +if (t3 == 0) {MEM_U32(v1 + 0) = t6; +goto L42ddcc;} +MEM_U32(v1 + 0) = t6; +t5 = 0x100052dc; +t8 = (int)t2 >> 5; +t4 = t8 << 2; +t5 = t5; +t7 = t5 + t4; +t1 = MEM_U32(t7 + 0); +//nop; +t0 = t1 << (t2 & 0x1f); +t9 = (int)t0 < (int)0x0; +t3 = t9; +L42ddcc: +if (t3 == 0) {//nop; +goto L42de1c;} +//nop; +L42ddd4: +v0 = MEM_U32(v0 + 8); +//nop; +t6 = MEM_U8(v0 + 32); +//nop; +t8 = t6 < 0xa0; +if (t8 == 0) {t5 = (int)t6 >> 5; +goto L42de14;} +t5 = (int)t6 >> 5; +t7 = 0x100052dc; +t4 = t5 << 2; +t7 = t7; +t1 = t7 + t4; +t2 = MEM_U32(t1 + 0); +//nop; +t0 = t2 << (t6 & 0x1f); +t9 = (int)t0 < (int)0x0; +t8 = t9; +L42de14: +if (t8 != 0) {//nop; +goto L42ddd4;} +//nop; +L42de1c: +at = 0x10019d58; +t3 = MEM_U8(s6 + 33); +t7 = 0x10019b9c; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10019d68; +t7 = MEM_U8(t7 + 0); +t5 = t3 & 0x1f; +MEM_U32(sp + 276) = v0; +MEM_U8(sp + 223) = (uint8_t)t5; +if (t7 == 0) {MEM_U32(at + 0) = zero; +goto L42de7c;} +MEM_U32(at + 0) = zero; +t4 = 0x1001939c; +at = 0x10019b9c; +t4 = MEM_U8(t4 + 0); +MEM_U8(at + 0) = (uint8_t)zero; +if (t4 == 0) {t1 = a3 & 0x100; +goto L42de80;} +t1 = a3 & 0x100; +//nop; +a0 = 0x3a; +a1 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L42de70; +a1 = zero; +L42de70: +gp = MEM_U32(sp + 204); +a3 = MEM_U32(s6 + 44); +//nop; +L42de7c: +t1 = a3 & 0x100; +L42de80: +if (t1 == 0) {//nop; +goto L42dea8;} +//nop; +at = 0x10019388; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10019d54; +MEM_U32(at + 0) = zero; +f_clear_saved_regs(mem, sp); +goto L42dea0; +MEM_U32(at + 0) = zero; +L42dea0: +gp = MEM_U32(sp + 204); +//nop; +L42dea8: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42debc: +t2 = MEM_U32(s6 + 44); +t0 = 0x1; +t6 = t2 & 0x80; +if (t6 == 0) {//nop; +goto L42dee4;} +//nop; +a3 = 0x10019ba0; +at = 0x10019394; +a3 = MEM_U32(a3 + 0); +MEM_U8(at + 0) = (uint8_t)t0; +goto L42df0c; +MEM_U8(at + 0) = (uint8_t)t0; +L42dee4: +//nop; +//nop; +//nop; +f_unhome_parms(mem, sp); +goto L42def4; +//nop; +L42def4: +gp = MEM_U32(sp + 204); +//nop; +a3 = 0x10019ba0; +//nop; +a3 = MEM_U32(a3 + 0); +//nop; +L42df0c: +at = 0x10019d58; +t9 = 0x1; +t8 = 0x10019ba4; +t3 = 0x10019d54; +MEM_U8(at + 0) = (uint8_t)t9; +a2 = 0x10019388; +//nop; +t8 = MEM_U32(t8 + 0); +t3 = MEM_U32(t3 + 0); +a1 = MEM_U16(s6 + 34); +a0 = MEM_U32(s6 + 36); +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 16) = t8; +MEM_U32(sp + 20) = t3; +f_gen_entry(mem, sp, a0, a1, a2, a3); +goto L42df48; +MEM_U32(sp + 20) = t3; +L42df48: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42df64: +//nop; +//nop; +//nop; +f_check_no_used(mem, sp); +goto L42df74; +//nop; +L42df74: +gp = MEM_U32(sp + 204); +//nop; +t5 = 0x10019d3c; +//nop; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 != 0) {ra = MEM_U32(sp + 212); +goto L434eec;} +ra = MEM_U32(sp + 212); +//nop; +//nop; +//nop; +v0 = f_get_temp_area_size(mem, sp); +goto L42dfa4; +//nop; +L42dfa4: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L42e0d8;} +//nop; +at = 0x10019d3c; +//nop; +t7 = 0x1; +MEM_U8(at + 0) = (uint8_t)t7; +f_restore_i_ptrs(mem, sp); +goto L42dfc4; +MEM_U8(at + 0) = (uint8_t)t7; +L42dfc4: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +v0 = f_get_temp_area_size(mem, sp); +goto L42dfdc; +//nop; +L42dfdc: +gp = MEM_U32(sp + 204); +t4 = v0 + 0x7; +v1 = 0x10019388; +a1 = 0x10019ba4; +t6 = MEM_U32(v1 + 0); +if ((int)t4 >= 0) {t1 = (int)t4 >> 3; +goto L42e000;} +t1 = (int)t4 >> 3; +at = t4 + 0x7; +t1 = (int)at >> 3; +L42e000: +t2 = t1 << 3; +t3 = 0x10019d4c; +t9 = t6 + t2; +MEM_U32(v1 + 0) = t9; +MEM_U32(a1 + 0) = t2; +t7 = 0x10019d54; +t3 = MEM_U32(t3 + 0); +t7 = MEM_U32(t7 + 0); +t5 = t9 - t3; +//nop; +a0 = t5 - t7; +a0 = -a0; +f_set_temps_offset(mem, sp, a0); +goto L42e034; +a0 = -a0; +L42e034: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(sp + 276); +//nop; +//nop; +//nop; +f_clean_tree(mem, sp, a0); +goto L42e04c; +//nop; +L42e04c: +gp = MEM_U32(sp + 204); +t4 = 0x1; +t1 = 0x10018ed4; +at = 0x10019d40; +t1 = MEM_U8(t1 + 0); +a2 = 0xe; +if (t1 == 0) {MEM_U8(at + 0) = (uint8_t)t4; +goto L42e0a8;} +MEM_U8(at + 0) = (uint8_t)t4; +s0 = 0x10006570; +a1 = 0x100098ca; +//nop; +a0 = MEM_U32(s0 + 0); +a3 = 0xe; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L42e088; +a1 = a1; +L42e088: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s0 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L42e0a0; +//nop; +L42e0a0: +gp = MEM_U32(sp + 204); +//nop; +L42e0a8: +//nop; +//nop; +//nop; +f_init_temps(mem, sp); +goto L42e0b8; +//nop; +L42e0b8: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(sp + 276); +//nop; +a1 = 0x48; +//nop; +f_eval(mem, sp, a0, a1); +goto L42e0d0; +//nop; +L42e0d0: +gp = MEM_U32(sp + 204); +//nop; +L42e0d8: +t6 = 0x10018e70; +t2 = 0x10018e6c; +t6 = MEM_U32(t6 + 0); +at = 0x10019d3c; +t2 = MEM_U32(t2 + 0); +t0 = t6 << 4; +MEM_U8(at + 0) = (uint8_t)zero; +v0 = t2 + t0; +t9 = MEM_U8(v0 + -27); +at = 0x17; +t8 = t9 & 0x3f; +if (t8 != at) {v0 = v0 + 0xfffffff0; +goto L42e13c;} +v0 = v0 + 0xfffffff0; +t3 = MEM_U16(v0 + -10); +at = 0x4; +t5 = t3 << 22; +t7 = t5 >> 23; +if (t7 != at) {a0 = 0x4; +goto L42e13c;} +a0 = 0x4; +//nop; +a1 = zero; +a2 = 0x5; +f_emit_dir1(mem, sp, a0, a1, a2); +goto L42e134; +a2 = 0x5; +L42e134: +gp = MEM_U32(sp + 204); +//nop; +L42e13c: +//nop; +//nop; +//nop; +f_output_pool(mem, sp); +goto L42e14c; +//nop; +L42e14c: +t4 = MEM_U32(sp + 232); +gp = MEM_U32(sp + 204); +at = 0xffffffff; +if (t4 != at) {//nop; +goto L42e32c;} +//nop; +t1 = 0x10019d58; +t2 = MEM_U8(sp + 223); +t1 = MEM_U8(t1 + 0); +MEM_U32(sp + 244) = zero; +if (t1 == 0) {a2 = zero; +goto L42e188;} +a2 = zero; +t6 = 0x20000000; +MEM_U32(sp + 244) = t6; +a2 = 0xf0000000; +goto L42e200; +a2 = 0xf0000000; +L42e188: +at = 0xb; +if (t2 == at) {t0 = t2 + 0xfffffffb; +goto L42e200;} +t0 = t2 + 0xfffffffb; +at = t0 < 0x9; +if (at == 0) {a0 = t2; +goto L42e1f8;} +a0 = t2; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100098d8[] = { +&&L42e1d0, +&&L42e1f8, +&&L42e1d0, +&&L42e1f8, +&&L42e1f8, +&&L42e1f8, +&&L42e1f8, +&&L42e1c8, +&&L42e1c0, +}; +dest = Lswitch100098d8[t0]; +//nop; +goto *dest; +//nop; +L42e1c0: +a2 = 0xa0000000; +goto L42e200; +a2 = 0xa0000000; +L42e1c8: +a2 = 0xf0000000; +goto L42e200; +a2 = 0xf0000000; +L42e1d0: +t9 = 0x10018ed0; +t8 = 0x30000000; +t9 = MEM_U8(t9 + 0); +t3 = 0x20000000; +if (t9 != 0) {//nop; +goto L42e1f0;} +//nop; +MEM_U32(sp + 244) = t8; +goto L42e200; +MEM_U32(sp + 244) = t8; +L42e1f0: +MEM_U32(sp + 244) = t3; +goto L42e200; +MEM_U32(sp + 244) = t3; +L42e1f8: +t5 = 0x20000000; +MEM_U32(sp + 244) = t5; +L42e200: +s0 = 0x10019d70; +//nop; +s0 = MEM_U32(s0 + 0); +//nop; +if (s0 == 0) {t5 = MEM_U32(sp + 244); +goto L42e308;} +t5 = MEM_U32(sp + 244); +t7 = MEM_U32(s0 + 48); +at = 0xffffffff; +if (t7 == at) {t5 = MEM_U32(sp + 244); +goto L42e308;} +t5 = MEM_U32(sp + 244); +L42e228: +t4 = MEM_U16(s0 + 34); +at = 0x1; +if (t4 == at) {MEM_U32(sp + 240) = a2; +goto L42e2e4;} +MEM_U32(sp + 240) = a2; +//nop; +a0 = s0; +MEM_U32(sp + 240) = a2; +v0 = f_parm_reg(mem, sp, a0); +goto L42e248; +MEM_U32(sp + 240) = a2; +L42e248: +t1 = MEM_U8(s0 + 33); +at = 0xc0000; +t6 = t1 & 0x1f; +t2 = t6 < 0x20; +t0 = -t2; +at = at | 0x8000; +t9 = t0 & at; +gp = MEM_U32(sp + 204); +t8 = t9 << (t6 & 0x1f); +if ((int)t8 >= 0) {v1 = v0 & 0xff; +goto L42e2b0;} +v1 = v0 & 0xff; +t3 = MEM_U32(sp + 240); +v1 = v0 & 0xff; +t5 = 0x80000000; +t1 = MEM_U32(s0 + 40); +t7 = t5 >> (v1 & 0x1f); +at = 0x8; +t4 = t3 | t7; +if (t1 != at) {MEM_U32(sp + 240) = t4; +goto L42e2e4;} +MEM_U32(sp + 240) = t4; +t0 = v1 + 0x1; +t9 = 0x80000000; +t6 = t9 >> (t0 & 0x1f); +t8 = t4 | t6; +MEM_U32(sp + 240) = t8; +goto L42e2e4; +MEM_U32(sp + 240) = t8; +L42e2b0: +t5 = MEM_U32(sp + 244); +t3 = 0x80000000; +t1 = MEM_U32(s0 + 40); +t7 = t3 >> (v1 & 0x1f); +at = 0x8; +t4 = t5 | t7; +if (t1 != at) {MEM_U32(sp + 244) = t4; +goto L42e2e4;} +MEM_U32(sp + 244) = t4; +t0 = v1 + 0x1; +t2 = 0x80000000; +t6 = t2 >> (t0 & 0x1f); +t8 = t4 | t6; +MEM_U32(sp + 244) = t8; +L42e2e4: +s0 = MEM_U32(s0 + 8); +a2 = MEM_U32(sp + 240); +if (s0 == 0) {t5 = MEM_U32(sp + 244); +goto L42e308;} +t5 = MEM_U32(sp + 244); +t3 = MEM_U32(s0 + 48); +at = 0xffffffff; +if (t3 != at) {//nop; +goto L42e228;} +//nop; +t5 = MEM_U32(sp + 244); +L42e308: +//nop; +t4 = a2 | 0xfff; +a1 = t5 | 0xff0e; +MEM_U32(sp + 244) = a1; +a2 = t4; +a0 = 0x35; +f_emit_regmask(mem, sp, a0, a1, a2); +goto L42e324; +a0 = 0x35; +L42e324: +gp = MEM_U32(sp + 204); +//nop; +L42e32c: +t2 = 0x100197c8; +t1 = 0x10019ba0; +t2 = MEM_U8(t2 + 0); +t1 = MEM_U32(t1 + 0); +t0 = t2 < 0x1; +t2 = 0x10019d54; +t9 = 0x10019d44; +t6 = 0x10019d48; +t5 = 0x10019d5c; +t4 = 0x10019d50; +t7 = 0x10019ba4; +MEM_U32(sp + 16) = t1; +t1 = MEM_U8(sp + 254); +t8 = MEM_U8(sp + 253); +t3 = MEM_U8(sp + 252); +t2 = MEM_U32(t2 + 0); +t9 = MEM_U32(t9 + 0); +t6 = MEM_U32(t6 + 0); +t5 = MEM_U8(t5 + 0); +t4 = MEM_U32(t4 + 0); +t7 = MEM_U32(t7 + 0); +MEM_U32(sp + 20) = t0; +t0 = 0x10019d68; +MEM_U32(sp + 52) = t1; +MEM_U32(sp + 32) = t8; +MEM_U32(sp + 36) = t3; +MEM_U32(sp + 56) = t2; +MEM_U32(sp + 24) = t9; +MEM_U32(sp + 28) = t6; +MEM_U32(sp + 40) = t5; +MEM_U32(sp + 44) = t4; +MEM_U32(sp + 48) = t7; +at = MEM_U32(t0 + 0); +a0 = 0x10019d60; +MEM_U32(sp + 64) = at; +t6 = MEM_U32(t0 + 4); +a2 = 0x10019d64; +a3 = 0x10019388; +t5 = MEM_U32(sp + 228); +//nop; +t3 = MEM_U32(sp + 268); +t8 = MEM_U32(sp + 232); +a1 = MEM_U8(sp + 255); +a0 = MEM_U32(a0 + 0); +a2 = MEM_U32(a2 + 0); +a3 = MEM_U32(a3 + 0); +MEM_U32(sp + 68) = t6; +MEM_U32(sp + 80) = t5; +MEM_U32(sp + 76) = t3; +MEM_U32(sp + 72) = t8; +f_gen_entry_exit(mem, sp, a0, a1, a2, a3); +goto L42e3f8; +MEM_U32(sp + 72) = t8; +L42e3f8: +t4 = MEM_U32(sp + 232); +gp = MEM_U32(sp + 204); +at = 0xffffffff; +if (t4 == at) {a0 = 0x22; +goto L42e428;} +a0 = 0x22; +//nop; +a1 = t4; +a2 = zero; +a3 = zero; +f_emit_a(mem, sp, a0, a1, a2, a3); +goto L42e420; +a3 = zero; +L42e420: +gp = MEM_U32(sp + 204); +//nop; +L42e428: +//nop; +a1 = MEM_U32(s6 + 36); +a0 = 0x18; +f_emit_dir0(mem, sp, a0, a1); +goto L42e438; +a0 = 0x18; +L42e438: +gp = MEM_U32(sp + 204); +ra = MEM_U32(sp + 212); +goto L434eec; +ra = MEM_U32(sp + 212); +L42e444: +t7 = 0x10019d68; +at = MEM_U32(s6 + 48); +a0 = 0x10018ed4; +MEM_U32(t7 + 0) = at; +t2 = MEM_U32(s6 + 52); +//nop; +MEM_U32(t7 + 4) = t2; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42e46c: +//nop; +a1 = MEM_U32(s6 + 36); +a0 = 0x3e; +f_emit_dir0(mem, sp, a0, a1); +goto L42e47c; +a0 = 0x3e; +L42e47c: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42e498: +a0 = MEM_U8(s6 + 33); +//nop; +t9 = a0 << 24; +t0 = t9 >> 29; +t6 = t0 & 0xff; +t8 = t6 + 0xffffffff; +at = t8 < 0x6; +if (at == 0) {a0 = t6; +goto L42e784;} +a0 = t6; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch100098fc[] = { +&&L42e730, +&&L42e4dc, +&&L42e784, +&&L42e784, +&&L42e784, +&&L42e510, +}; +dest = Lswitch100098fc[t8]; +//nop; +goto *dest; +//nop; +L42e4dc: +t3 = MEM_U32(s6 + 0); +at = 0x10019d70; +//nop; +a0 = MEM_U32(sp + 268); +MEM_U32(at + 0) = t3; +f_home_parms(mem, sp, a0); +goto L42e4f4; +MEM_U32(at + 0) = t3; +L42e4f4: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42e510: +t5 = 0x10019390; +//nop; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L42e5c0;} +//nop; +a0 = 0x10019380; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +f_add_to_free_list(mem, sp, a0); +goto L42e53c; +//nop; +L42e53c: +gp = MEM_U32(sp + 204); +t4 = 0x1e; +at = 0x10019380; +v0 = 0x100197b0; +MEM_U8(at + 0) = (uint8_t)t4; +t1 = MEM_U32(v0 + 0); +t2 = 0x10019380; +t7 = t1 | 0x2; +MEM_U32(v0 + 0) = t7; +t2 = MEM_U8(t2 + 0); +t3 = MEM_U32(v0 + 4); +t9 = t2 + 0xffffffe0; +t0 = t9 < 0x20; +t6 = ~t2; +t8 = t0 << (t6 & 0x1f); +v1 = 0x10019388; +t5 = t3 | t8; +t4 = t2 + 0xffffffc0; +t0 = MEM_U32(v0 + 8); +t3 = MEM_U32(v1 + 0); +t1 = t4 < 0x20; +t7 = ~t2; +t9 = t1 << (t7 & 0x1f); +MEM_U32(v0 + 4) = t5; +t5 = 0x10019d54; +t6 = t0 | t9; +t8 = t3 + 0x8; +MEM_U32(v0 + 8) = t6; +MEM_U32(v1 + 0) = t8; +t5 = MEM_U32(t5 + 0); +at = 0x10019d54; +t4 = t5 + 0x8; +MEM_U32(at + 0) = t4; +L42e5c0: +t2 = 0x10018ed8; +a0 = 0x10018ed4; +v1 = 0x10018ea8; +t2 = MEM_U32(t2 + 0); +a0 = MEM_U8(a0 + 0); +v1 = MEM_U8(v1 + 0); +if ((int)t2 <= 0) {//nop; +goto L42e678;} +//nop; +v0 = 0x10018ee4; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +if (v0 == 0) {//nop; +goto L42e610;} +//nop; +v0 = 0x10019380; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +t1 = v0 ^ 0x1e; +v0 = zero < t1; +L42e610: +at = 0x10018ee4; +t7 = 0x10018ee4; +MEM_U8(at + 0) = (uint8_t)v0; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L42e654;} +//nop; +v0 = 0x100197b0; +//nop; +t0 = MEM_U32(v0 + 0); +t6 = MEM_U32(v0 + 4); +t3 = MEM_U32(v0 + 8); +t9 = t0 | 0x2; +MEM_U32(v0 + 0) = t9; +MEM_U32(v0 + 4) = t6; +MEM_U32(v0 + 8) = t3; +goto L42e678; +MEM_U32(v0 + 8) = t3; +L42e654: +v0 = 0x100197b0; +//nop; +t8 = MEM_U32(v0 + 0); +t4 = MEM_U32(v0 + 4); +t2 = MEM_U32(v0 + 8); +t5 = t8 | 0x8; +MEM_U32(v0 + 0) = t5; +MEM_U32(v0 + 4) = t4; +MEM_U32(v0 + 8) = t2; +L42e678: +t1 = MEM_U32(s6 + 40); +//nop; +t7 = t1 + 0x7; +if ((int)t7 >= 0) {t0 = (int)t7 >> 3; +goto L42e694;} +t0 = (int)t7 >> 3; +at = t7 + 0x7; +t0 = (int)at >> 3; +L42e694: +at = 0x10019d4c; +t9 = t0 << 3; +if (v1 != 0) {MEM_U32(at + 0) = t9; +goto L434d7c;} +MEM_U32(at + 0) = t9; +v0 = 0x100197b0; +t4 = 0x10019d3c; +t6 = MEM_U32(v0 + 0); +t8 = MEM_U32(v0 + 4); +t5 = MEM_U32(v0 + 8); +t3 = t6 | 0x1; +MEM_U32(v0 + 0) = t3; +MEM_U32(v0 + 4) = t8; +MEM_U32(v0 + 8) = t5; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L434d7c;} +//nop; +t2 = 0x10018ee8; +//nop; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42e710;} +//nop; +t1 = 0x10019d4c; +at = 0x10019d50; +t1 = MEM_U32(t1 + 0); +//nop; +MEM_U32(at + 0) = t1; +at = 0x10019d4c; +MEM_U32(at + 0) = zero; +goto L434d7c; +MEM_U32(at + 0) = zero; +L42e710: +t7 = 0x10019388; +t0 = 0x10019d4c; +t7 = MEM_U32(t7 + 0); +t0 = MEM_U32(t0 + 0); +at = 0x10019388; +t9 = t7 + t0; +MEM_U32(at + 0) = t9; +goto L434d7c; +MEM_U32(at + 0) = t9; +L42e730: +t6 = MEM_U32(s6 + 40); +t4 = 0x10019d3c; +t3 = t6 + 0x7; +if ((int)t3 >= 0) {t8 = (int)t3 >> 3; +goto L42e74c;} +t8 = (int)t3 >> 3; +at = t3 + 0x7; +t8 = (int)at >> 3; +L42e74c: +a0 = 0x10018ed4; +at = 0x10019ba0; +t4 = MEM_U8(t4 + 0); +t5 = t8 << 3; +a0 = MEM_U8(a0 + 0); +if (t4 != 0) {MEM_U32(at + 0) = t5; +goto L434d7c;} +MEM_U32(at + 0) = t5; +t2 = 0x10019388; +at = 0x10019388; +t2 = MEM_U32(t2 + 0); +//nop; +t1 = t2 + t5; +MEM_U32(at + 0) = t1; +goto L434d7c; +MEM_U32(at + 0) = t1; +L42e784: +t7 = 0x1000987a; +a0 = 0x4; +t7 = t7; +t9 = t7 + 0x48; +a1 = 0xf79; +t6 = sp; +L42e79c: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t6 = t6 + 0xc; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t6 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t9) {//swr $at, 7($t6) +goto L42e79c;} +//swr $at, 7($t6) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t3 = 0x1000982a; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +t9 = t7 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t7) +t3 = t3; +MEM_U8(t6 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t6 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t6 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t6 + 12 + 3) = (uint8_t)(t9 >> 0); +t4 = t3 + 0x48; +t2 = sp; +//swr $t9, 0xf($t6) +L42e80c: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t2 = t2 + 0xc; +MEM_U8(t2 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t2) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t2 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 84 + 3) = (uint8_t)(at >> 0); +if (t3 != t4) {//swr $at, 0x57($t2) +goto L42e80c;} +//swr $at, 0x57($t2) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +//nop; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +t4 = t3 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t3) +//nop; +MEM_U8(t2 + 92 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t2 + 92 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t2 + 92 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t2 + 92 + 3) = (uint8_t)(t4 >> 0); +//swr $t4, 0x5f($t2) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L42e888; +//nop; +L42e888: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42e8a4: +//nop; +a0 = s6; +//nop; +f_gen_regs(mem, sp, a0); +goto L42e8b4; +//nop; +L42e8b4: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42e8d0: +//nop; +//nop; +//nop; +v0 = f_get_domtag(mem, sp); +goto L42e8e0; +//nop; +L42e8e0: +gp = MEM_U32(sp + 204); +if (v0 == 0) {a0 = 0x32; +goto L42e908;} +a0 = 0x32; +//nop; +a2 = MEM_U32(s6 + 52); +a1 = zero; +a3 = 0x9; +f_emit_dir2(mem, sp, a0, a1, a2, a3); +goto L42e900; +a3 = 0x9; +L42e900: +gp = MEM_U32(sp + 204); +//nop; +L42e908: +t5 = MEM_U32(s6 + 48); +at = 0xffffffff; +if (t5 == at) {//nop; +goto L42e9d0;} +//nop; +t1 = MEM_U8(s6 + 26); +//nop; +if (t1 == 0) {//nop; +goto L42e9d0;} +//nop; +//nop; +a0 = s6; +//nop; +f_save_vreg(mem, sp, a0); +goto L42e938; +//nop; +L42e938: +t0 = MEM_U8(s6 + 33); +gp = MEM_U32(sp + 204); +t9 = t0 << 24; +t7 = t9 >> 29; +at = 0x2; +if (t7 != at) {//nop; +goto L42e96c;} +//nop; +//nop; +a0 = s6; +//nop; +f_load_parm_vreg(mem, sp, a0); +goto L42e964; +//nop; +L42e964: +gp = MEM_U32(sp + 204); +//nop; +L42e96c: +v0 = 0x10019364; +at = 0x3; +v0 = MEM_U8(v0 + 0); +//nop; +if (v0 == 0) {//nop; +goto L42e9d0;} +//nop; +if (v0 == at) {//nop; +goto L42e9d0;} +//nop; +t6 = MEM_U16(s6 + 34); +//nop; +if (t6 != 0) {//nop; +goto L42e9d0;} +//nop; +s3 = MEM_U32(s6 + 48); +//nop; +if ((int)s3 >= 0) {t8 = (int)s3 >> 2; +goto L42e9b4;} +t8 = (int)s3 >> 2; +at = s3 + 0x3; +t8 = (int)at >> 2; +L42e9b4: +a0 = t8 & 0xff; +a1 = MEM_U32(s6 + 44); +a2 = MEM_U32(s6 + 36); +s3 = a0; +f_emit_vreg(mem, sp, a0, a1, a2); +goto L42e9c8; +s3 = a0; +L42e9c8: +gp = MEM_U32(sp + 204); +//nop; +L42e9d0: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42e9e4: +//nop; +//nop; +//nop; +f_check_no_used(mem, sp); +goto L42e9f4; +//nop; +L42e9f4: +t3 = MEM_U16(s6 + 34); +gp = MEM_U32(sp + 204); +at = 0x1; +if (t3 == at) {//nop; +goto L42ea20;} +//nop; +//nop; +a0 = MEM_U32(s6 + 36); +//nop; +f_define_label(mem, sp, a0); +goto L42ea18; +//nop; +L42ea18: +gp = MEM_U32(sp + 204); +//nop; +L42ea20: +s1 = MEM_U32(s6 + 40); +//nop; +if (s1 == 0) {//nop; +goto L42ea90;} +//nop; +t2 = 0x10019374; +//nop; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L42ea78;} +//nop; +t5 = MEM_U16(s6 + 34); +//nop; +t1 = t5 & 0x2; +if (t1 == 0) {//nop; +goto L42ea78;} +//nop; +//nop; +a0 = s1; +//nop; +f_define_exception_label(mem, sp, a0); +goto L42ea6c; +//nop; +L42ea6c: +gp = MEM_U32(sp + 204); +s1 = MEM_U32(s6 + 40); +//nop; +L42ea78: +//nop; +a0 = 0x24; +a1 = s1; +f_emit_dir0(mem, sp, a0, a1); +goto L42ea88; +a1 = s1; +L42ea88: +gp = MEM_U32(sp + 204); +//nop; +L42ea90: +t0 = MEM_U16(s6 + 34); +//nop; +t9 = t0 & 0x1; +if (t9 == 0) {//nop; +goto L42eb28;} +//nop; +t7 = 0x10018ed8; +t6 = 0x1; +t7 = MEM_U32(t7 + 0); +a0 = 0x2a; +if ((int)t7 <= 0) {//nop; +goto L42eb28;} +//nop; +at = 0x100197c4; +v1 = 0x10019820; +MEM_U8(at + 0) = (uint8_t)t6; +t8 = MEM_U32(v1 + 0); +t3 = 0x15; +t4 = t8 + 0x1; +v0 = t4; +MEM_U32(v1 + 0) = t4; +at = v0 < t3; +if (at != 0) {//nop; +goto L42eaec;} +//nop; +abort(); +L42eaec: +t2 = 0x10018e70; +t1 = 0x100197d0; +t2 = MEM_U32(t2 + 0); +t5 = v0 << 2; +t1 = t1 + 0xfffffffc; +t0 = t5 + t1; +MEM_U32(t0 + 0) = t2; +//nop; +MEM_U32(sp + 16) = zero; +a1 = 0x1c; +a2 = zero; +a3 = 0x1d; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42eb20; +a3 = 0x1d; +L42eb20: +gp = MEM_U32(sp + 204); +//nop; +L42eb28: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42eb3c: +//nop; +a0 = s6 + 0x20; +//nop; +v0 = f_ureg(mem, sp, a0); +goto L42eb4c; +//nop; +L42eb4c: +gp = MEM_U32(sp + 204); +t9 = v0 & 0xff; +at = 0x48; +if (t9 == at) {fp = v0 & 0xff; +goto L42edd0;} +fp = v0 & 0xff; +//nop; +a0 = MEM_U32(s6 + 8); +//nop; +v0 = f_is_end_return(mem, sp, a0); +goto L42eb70; +//nop; +L42eb70: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L42eba8;} +//nop; +t7 = MEM_U8(sp + 223); +at = 0x5010000; +t6 = t7 < 0x20; +t8 = -t6; +t4 = t8 & at; +t3 = t4 << (t7 & 0x1f); +if ((int)t3 >= 0) {//nop; +goto L42eba8;} +//nop; +at = 0x100027cc; +t5 = 0x1; +MEM_U8(at + 0) = (uint8_t)t5; +L42eba8: +t1 = 0x10018ecc; +at = 0x1; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L42ec60;} +//nop; +t2 = 0x10018ed0; +//nop; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L42ec60;} +//nop; +t0 = 0x100027cc; +at = 0x2; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 == 0) {//nop; +goto L42ec60;} +//nop; +if (fp != at) {//nop; +goto L42ec60;} +//nop; +t9 = MEM_U32(s6 + 0); +at = 0x49; +a0 = MEM_U8(t9 + 32); +//nop; +if (a0 != at) {t8 = fp << 2; +goto L42ec54;} +t8 = fp << 2; +L42ec10: +t4 = 0x10019830; +t8 = t8 - fp; +t8 = t8 << 2; +t6 = fp + 0x1; +t7 = t8 + t4; +MEM_U8(t7 + 9) = (uint8_t)t6; +goto L42ec60; +MEM_U8(t7 + 9) = (uint8_t)t6; +L42ec2c: +t5 = fp << 2; +t1 = 0x10019830; +t5 = t5 - fp; +t5 = t5 << 2; +t2 = t5 + t1; +MEM_U8(t2 + 9) = (uint8_t)t3; +goto L42ec60; +MEM_U8(t2 + 9) = (uint8_t)t3; +at = 0x49; +if (a0 == at) {t8 = fp << 2; +goto L42ec10;} +t8 = fp << 2; +L42ec54: +at = 0x52; +if (a0 == at) {t3 = fp + 0x1; +goto L42ec2c;} +t3 = fp + 0x1; +L42ec60: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = fp; +f_eval(mem, sp, a0, a1); +goto L42ec70; +a1 = fp; +L42ec70: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L42ec88; +//nop; +L42ec88: +a3 = MEM_U8(s6 + 33); +at = 0x5010000; +t0 = a3 & 0x1f; +t9 = t0 < 0x20; +t8 = -t9; +t4 = t8 & at; +gp = MEM_U32(sp + 204); +t6 = t4 << (t0 & 0x1f); +s2 = v0 & 0xff; +if ((int)t6 >= 0) {a3 = t0; +goto L42eda0;} +a3 = t0; +t7 = 0x10018ed0; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L42eda0;} +//nop; +t5 = 0x100027c4; +t1 = fp < 0x20; +t5 = MEM_U8(t5 + 0); +at = 0xa000000; +if (t5 == 0) {//nop; +goto L42ecf8;} +//nop; +t3 = -t1; +t2 = t3 & at; +t0 = t2 << (fp & 0x1f); +if ((int)t0 < 0) {//nop; +goto L42ed18;} +//nop; +L42ecf8: +t9 = 0x100027cc; +at = 0x2; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L42eda0;} +//nop; +if (fp != at) {//nop; +goto L42eda0;} +//nop; +L42ed18: +t8 = 0x10018ecc; +v1 = v0 & 0xff; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L42ed4c;} +//nop; +//nop; +a0 = fp; +a1 = s2; +f_move_two_regs(mem, sp, a0, a1); +goto L42ed40; +a1 = s2; +L42ed40: +gp = MEM_U32(sp + 204); +//nop; +goto L42ed8c; +//nop; +L42ed4c: +if (v1 != fp) {t6 = v1 << 2; +goto L42ed74;} +t6 = v1 << 2; +t7 = 0x10019830; +t6 = t6 - v1; +t6 = t6 << 2; +t5 = t6 + t7; +t1 = MEM_U8(t5 + 9); +t4 = v1 + 0x1; +if (t4 == t1) {//nop; +goto L42ed8c;} +//nop; +L42ed74: +//nop; +a0 = fp; +a1 = s2; +f_move_dreg_to_regs(mem, sp, a0, a1); +goto L42ed84; +a1 = s2; +L42ed84: +gp = MEM_U32(sp + 204); +//nop; +L42ed8c: +v0 = 0x100027cc; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +goto L42f114; +//nop; +L42eda0: +//nop; +a0 = fp; +a1 = s2; +a2 = a3; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L42edb4; +a2 = a3; +L42edb4: +gp = MEM_U32(sp + 204); +//nop; +v0 = 0x100027cc; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +goto L42f114; +//nop; +L42edd0: +a2 = MEM_U32(s6 + 0); +at = 0x18; +t3 = MEM_U8(a2 + 32); +//nop; +if (t3 != at) {//nop; +goto L42ee5c;} +//nop; +v0 = MEM_U8(a2 + 33); +at = 0x6; +t2 = v0 & 0x1f; +if (t2 == at) {at = 0x5; +goto L42ee1c;} +at = 0x5; +if (t2 != at) {//nop; +goto L42ee5c;} +//nop; +t0 = 0x10018ecc; +at = 0x1; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L42ee5c;} +//nop; +L42ee1c: +t9 = MEM_U8(a2 + 40); +at = 0xc; +if (t9 != at) {//nop; +goto L42ee5c;} +//nop; +t8 = MEM_U16(a2 + 20); +at = 0x1; +if (t8 != at) {//nop; +goto L42ee5c;} +//nop; +t6 = MEM_U32(s6 + 40); +at = 0x4; +if (t6 != at) {//nop; +goto L42ee5c;} +//nop; +t7 = MEM_U32(a2 + 16); +at = 0x10004b70; +t5 = t7 >> 8; +MEM_U32(at + 0) = t5; +L42ee5c: +//nop; +a0 = a2; +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L42ee6c; +a1 = 0x48; +L42ee6c: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L42ee84; +//nop; +L42ee84: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +t4 = 0x10018e80; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L42ef2c;} +//nop; +t1 = MEM_U8(s6 + 33); +at = 0xe; +t3 = t1 & 0x1f; +if (t3 != at) {//nop; +goto L42ef2c;} +//nop; +t2 = MEM_U32(s6 + 40); +//nop; +at = (int)t2 < (int)0x4; +if (at == 0) {//nop; +goto L42ef2c;} +//nop; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L42eedc; +a1 = 0x1; +L42eedc: +t0 = MEM_U32(s6 + 40); +gp = MEM_U32(sp + 204); +t8 = 0x20; +t9 = t0 << 3; +a3 = t8 - t9; +//nop; +MEM_U8(sp + 318) = (uint8_t)v0; +a0 = 0x54; +a1 = v0 & 0xff; +a2 = s3; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L42ef0c; +MEM_U32(sp + 16) = zero; +L42ef0c: +gp = MEM_U32(sp + 204); +a0 = MEM_U8(sp + 318); +//nop; +s3 = a0; +//nop; +f_free_reg(mem, sp, a0); +goto L42ef24; +//nop; +L42ef24: +gp = MEM_U32(sp + 204); +//nop; +L42ef2c: +s7 = MEM_U16(s6 + 34); +//nop; +t7 = s7 & 0x1; +t5 = zero < t7; +s7 = t5 & 0xff; +if (s7 == 0) {//nop; +goto L42ef60;} +//nop; +//nop; +a0 = 0x20; +a1 = 0xb; +f_emit_dir0(mem, sp, a0, a1); +goto L42ef58; +a1 = 0xb; +L42ef58: +gp = MEM_U32(sp + 204); +//nop; +L42ef60: +s0 = MEM_U8(s6 + 33); +at = 0x2; +t1 = s0 << 24; +t3 = t1 >> 29; +if (t3 != at) {//nop; +goto L42f054;} +//nop; +t2 = MEM_U32(s6 + 36); +t0 = s0 & 0x1f; +if (t2 != 0) {t8 = t0 << 1; +goto L42f054;} +t8 = t0 << 1; +a2 = MEM_U32(s6 + 0); +t9 = 0x100032b4; +t4 = 0x10004b70; +t7 = MEM_U32(a2 + 16); +t4 = MEM_U32(t4 + 0); +t6 = t8 + t9; +s5 = MEM_U16(t6 + 0); +t5 = t7 >> 8; +if (t5 != t4) {a1 = s3; +goto L42efcc;} +a1 = s3; +t1 = MEM_U8(a2 + 33); +at = 0x6; +t3 = t1 & 0x1f; +if (t3 != at) {s5 = 0x73; +goto L42efcc;} +s5 = 0x73; +s5 = 0x33; +goto L42efcc; +s5 = 0x33; +L42efcc: +t2 = 0x10018ecc; +at = 0x6d; +t2 = MEM_U8(t2 + 0); +a0 = s5; +if (t2 != 0) {a3 = 0x1d; +goto L42f038;} +a3 = 0x1d; +if (s5 != at) {//nop; +goto L42f038;} +//nop; +//nop; +a2 = MEM_U32(s6 + 44); +a0 = 0x57; +a1 = s3; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42f008; +MEM_U32(sp + 16) = zero; +L42f008: +gp = MEM_U32(sp + 204); +a2 = MEM_U32(s6 + 44); +//nop; +a0 = 0x57; +a1 = s3 + 0x1; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +a2 = a2 + 0x4; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42f02c; +a2 = a2 + 0x4; +L42f02c: +gp = MEM_U32(sp + 204); +//nop; +goto L42f0e0; +//nop; +L42f038: +//nop; +a2 = MEM_U32(s6 + 44); +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42f048; +MEM_U32(sp + 16) = zero; +L42f048: +gp = MEM_U32(sp + 204); +//nop; +goto L42f0e0; +//nop; +L42f054: +a2 = MEM_U32(s6 + 0); +t9 = 0x10004b70; +t0 = MEM_U32(a2 + 16); +t9 = MEM_U32(t9 + 0); +t8 = t0 >> 8; +if (t8 != t9) {a1 = s6; +goto L42f0b0;} +a1 = s6; +t6 = MEM_U8(a2 + 33); +at = 0x6; +t7 = t6 & 0x1f; +if (t7 != at) {a1 = s6; +goto L42f08c;} +a1 = s6; +s5 = 0x33; +goto L42f090; +s5 = 0x33; +L42f08c: +s5 = 0x73; +L42f090: +//nop; +a0 = s5; +a2 = s3; +a3 = zero; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L42f0a4; +a3 = zero; +L42f0a4: +gp = MEM_U32(sp + 204); +//nop; +goto L42f0e0; +//nop; +L42f0b0: +//nop; +a0 = 0x100032ec; +a2 = s3; +v0 = f_lsopc(mem, sp, a0, a1, a2); +goto L42f0c0; +a2 = s3; +L42f0c0: +gp = MEM_U32(sp + 204); +a0 = v0 & 0xffff; +//nop; +a1 = s6; +a2 = s3; +f_unaligned_loadstore(mem, sp, a0, a1, a2); +goto L42f0d8; +a2 = s3; +L42f0d8: +gp = MEM_U32(sp + 204); +//nop; +L42f0e0: +if (s7 == 0) {//nop; +goto L42f100;} +//nop; +//nop; +a0 = 0x20; +a1 = 0xc; +f_emit_dir0(mem, sp, a0, a1); +goto L42f0f8; +a1 = 0xc; +L42f0f8: +gp = MEM_U32(sp + 204); +//nop; +L42f100: +v0 = 0x100027cc; +at = 0x10004b70; +t5 = 0xffffffff; +v0 = MEM_U8(v0 + 0); +MEM_U32(at + 0) = t5; +L42f114: +if (v0 == 0) {//nop; +goto L42f144;} +//nop; +at = 0x100027cc; +t4 = 0x10018ecc; +MEM_U8(at + 0) = (uint8_t)zero; +t4 = MEM_U8(t4 + 0); +at = 0x1; +if (t4 != at) {//nop; +goto L42f144;} +//nop; +at = 0x10019830; +t1 = 0x48; +MEM_U8(at + 33) = (uint8_t)t1; +L42f144: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42f158: +at = 0x100027c4; +//nop; +t3 = 0x1; +MEM_U32(sp + 244) = zero; +MEM_U32(sp + 240) = zero; +MEM_U8(at + 0) = (uint8_t)t3; +f_clear_pmov_regs(mem, sp); +goto L42f174; +MEM_U8(at + 0) = (uint8_t)t3; +L42f174: +t2 = MEM_U32(s6 + 36); +gp = MEM_U32(sp + 204); +if (t2 == 0) {a0 = 0x56; +goto L42f1a4;} +a0 = 0x56; +a2 = 0x10019d4c; +//nop; +a2 = MEM_U32(a2 + 0); +a1 = 0x1d; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L42f19c; +a3 = zero; +L42f19c: +gp = MEM_U32(sp + 204); +//nop; +L42f1a4: +s2 = MEM_U32(s6 + 8); +at = 0x17; +v0 = MEM_U8(s2 + 32); +//nop; +if (v0 == at) {at = 0x97; +goto L42f2fc;} +at = 0x97; +if (v0 == at) {at = 0x2c; +goto L42f2fc;} +at = 0x2c; +if (v0 == at) {at = 0x10; +goto L42f2fc;} +at = 0x10; +if (v0 == at) {at = 0x7b; +goto L42f2fc;} +at = 0x7b; +L42f1d4: +if (v0 != at) {at = 0x6f; +goto L42f1f4;} +at = 0x6f; +t0 = MEM_U8(s2 + 33); +at = 0x3; +t8 = t0 << 24; +t9 = t8 >> 29; +if (t9 == at) {at = 0x6f; +goto L42f1f8;} +at = 0x6f; +L42f1f4: +if (v0 != at) {at = 0x7b; +goto L42f2cc;} +L42f1f8: +at = 0x7b; +if (v0 != at) {t8 = 0x80000000; +goto L42f224;} +t8 = 0x80000000; +s3 = MEM_U32(s2 + 44); +//nop; +if ((int)s3 >= 0) {t6 = (int)s3 >> 2; +goto L42f21c;} +t6 = (int)s3 >> 2; +at = s3 + 0x3; +t6 = (int)at >> 2; +L42f21c: +s3 = t6 & 0xff; +goto L42f244; +s3 = t6 & 0xff; +L42f224: +s3 = MEM_U32(s2 + 48); +//nop; +if ((int)s3 >= 0) {t5 = (int)s3 >> 2; +goto L42f23c;} +t5 = (int)s3 >> 2; +at = s3 + 0x3; +t5 = (int)at >> 2; +L42f23c: +t4 = t5 & 0xff; +s3 = t4; +L42f244: +t1 = s3 + 0xffffffe0; +t3 = t1 < 0x20; +t2 = -t3; +t0 = t2 << (t1 & 0x1f); +if ((int)t0 >= 0) {t6 = t8 >> (s3 & 0x1f); +goto L42f29c;} +t6 = t8 >> (s3 & 0x1f); +t8 = MEM_U32(sp + 240); +t9 = 0x80000000; +t5 = MEM_U32(s2 + 40); +t6 = t9 >> (s3 & 0x1f); +at = 0x8; +t7 = t8 | t6; +MEM_U32(sp + 240) = t7; +if (t5 != at) {v0 = s3; +goto L42f2cc;} +v0 = s3; +t3 = v0 + 0x1; +t2 = 0x80000000; +t1 = t2 >> (t3 & 0x1f); +t0 = t7 | t1; +MEM_U32(sp + 240) = t0; +t4 = t7; +goto L42f2cc; +t4 = t7; +L42f29c: +t9 = MEM_U32(sp + 244); +t5 = MEM_U32(s2 + 40); +at = 0x8; +t7 = t9 | t6; +if (t5 != at) {MEM_U32(sp + 244) = t7; +goto L42f2cc;} +MEM_U32(sp + 244) = t7; +t3 = s3 + 0x1; +t4 = 0x80000000; +t1 = t4 >> (t3 & 0x1f); +t0 = t7 | t1; +MEM_U32(sp + 244) = t0; +t2 = t7; +L42f2cc: +s2 = MEM_U32(s2 + 8); +at = 0x17; +v0 = MEM_U8(s2 + 32); +//nop; +if (v0 == at) {at = 0x97; +goto L42f2fc;} +at = 0x97; +if (v0 == at) {at = 0x2c; +goto L42f2fc;} +at = 0x2c; +if (v0 == at) {at = 0x10; +goto L42f2fc;} +at = 0x10; +if (v0 != at) {at = 0x7b; +goto L42f1d4;} +at = 0x7b; +L42f2fc: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42f310: +//nop; +a0 = s6; +//nop; +f_eval_mov(mem, sp, a0); +goto L42f320; +//nop; +L42f320: +t8 = MEM_U8(s6 + 32); +gp = MEM_U32(sp + 204); +at = 0x66; +if (t8 != at) {//nop; +goto L42f47c;} +//nop; +t6 = 0x100193a0; +t9 = MEM_U32(s6 + 44); +t6 = MEM_U32(t6 + 0); +//nop; +v0 = t9 - t6; +if ((int)v0 >= 0) {//nop; +goto L42f354;} +//nop; +v0 = -v0; +L42f354: +t7 = MEM_U32(s6 + 40); +s2 = v0; +t5 = v0 + t7; +at = (int)v0 < (int)t5; +if (at == 0) {//nop; +goto L42f47c;} +//nop; +L42f36c: +if ((int)s2 >= 0) {v0 = (int)s2 >> 2; +goto L42f37c;} +v0 = (int)s2 >> 2; +at = s2 + 0x3; +v0 = (int)at >> 2; +L42f37c: +v0 = v0 + 0x4; +at = (int)v0 < (int)0x40; +if (at != 0) {//nop; +goto L42f3a0;} +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42f3a0: +//nop; +s0 = v0 & 0xff; +a0 = s0; +v0 = f_is_parm_reg(mem, sp, a0); +goto L42f3b0; +a0 = s0; +L42f3b0: +gp = MEM_U32(sp + 204); +if (v0 != 0) {//nop; +goto L42f3d0;} +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42f3d0: +//nop; +a0 = s0; +//nop; +f_save_pmov_reg(mem, sp, a0); +goto L42f3e0; +//nop; +L42f3e0: +t4 = s0 + 0xffffffe0; +t3 = t4 < 0x20; +t2 = -t3; +gp = MEM_U32(sp + 204); +t1 = t2 << (t4 & 0x1f); +if ((int)t1 >= 0) {t8 = 0x80000000; +goto L42f438;} +t8 = 0x80000000; +t0 = MEM_U32(sp + 240); +t8 = 0x80000000; +s1 = MEM_U32(s6 + 40); +t9 = t8 >> (s0 & 0x1f); +at = 0x8; +t6 = t0 | t9; +MEM_U32(sp + 240) = t6; +if (s1 != at) {v0 = s0; +goto L42f44c;} +v0 = s0; +t5 = v0 + 0x1; +t3 = 0x80000000; +t2 = t3 >> (t5 & 0x1f); +t4 = t6 | t2; +MEM_U32(sp + 240) = t4; +goto L42f44c; +MEM_U32(sp + 240) = t4; +L42f438: +t1 = MEM_U32(sp + 244); +t0 = t8 >> (s0 & 0x1f); +t9 = t1 | t0; +s1 = MEM_U32(s6 + 40); +MEM_U32(sp + 244) = t9; +L42f44c: +t3 = 0x100193a0; +t6 = MEM_U32(s6 + 44); +t3 = MEM_U32(t3 + 0); +s2 = s2 + 0x4; +t5 = t6 - t3; +if ((int)t5 >= 0) {t7 = t5; +goto L42f46c;} +t7 = t5; +t7 = -t5; +L42f46c: +t2 = t7 + s1; +at = (int)s2 < (int)t2; +if (at != 0) {//nop; +goto L42f36c;} +//nop; +L42f47c: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42f490: +//nop; +a0 = s6; +//nop; +v0 = f_parm_reg(mem, sp, a0); +goto L42f4a0; +//nop; +L42f4a0: +gp = MEM_U32(sp + 204); +v1 = v0 & 0xff; +at = 0x48; +if (v1 == at) {fp = v0 & 0xff; +goto L42f6f4;} +fp = v0 & 0xff; +t4 = 0x10018ecc; +at = 0x1; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 != at) {//nop; +goto L42f54c;} +//nop; +t8 = 0x10018ed0; +//nop; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L42f54c;} +//nop; +t1 = MEM_U32(s6 + 0); +at = 0x49; +a0 = MEM_U8(t1 + 32); +//nop; +if (a0 != at) {t9 = v1 << 2; +goto L42f540;} +t9 = v1 << 2; +L42f4fc: +t6 = 0x10019830; +t9 = t9 - v1; +t9 = t9 << 2; +t0 = v1 + 0x1; +t3 = t9 + t6; +MEM_U8(t3 + 9) = (uint8_t)t0; +goto L42f54c; +MEM_U8(t3 + 9) = (uint8_t)t0; +L42f518: +t7 = v1 << 2; +t2 = 0x10019830; +t7 = t7 - v1; +t7 = t7 << 2; +t4 = t7 + t2; +MEM_U8(t4 + 9) = (uint8_t)t5; +goto L42f54c; +MEM_U8(t4 + 9) = (uint8_t)t5; +at = 0x49; +if (a0 == at) {t9 = v1 << 2; +goto L42f4fc;} +t9 = v1 << 2; +L42f540: +at = 0x52; +if (a0 == at) {t5 = v1 + 0x1; +goto L42f518;} +t5 = v1 + 0x1; +L42f54c: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = fp; +f_eval(mem, sp, a0, a1); +goto L42f55c; +a1 = fp; +L42f55c: +t8 = MEM_U8(s6 + 33); +at = 0x5010000; +t1 = t8 & 0x1f; +t9 = t1 < 0x20; +t6 = -t9; +t0 = t6 & at; +gp = MEM_U32(sp + 204); +t3 = t0 << (t1 & 0x1f); +if ((int)t3 >= 0) {//nop; +goto L42f62c;} +//nop; +t7 = 0x10018ed0; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L42f62c;} +//nop; +//nop; +a0 = MEM_U32(s6 + 0); +//nop; +v0 = f_reg(mem, sp, a0); +goto L42f5ac; +//nop; +L42f5ac: +gp = MEM_U32(sp + 204); +s2 = v0 & 0xff; +t2 = 0x10018ecc; +v1 = v0 & 0xff; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L42f5e8;} +//nop; +//nop; +a0 = fp; +a1 = s2; +f_move_two_regs(mem, sp, a0, a1); +goto L42f5dc; +a1 = s2; +L42f5dc: +gp = MEM_U32(sp + 204); +t1 = fp + 0xffffffe0; +goto L42f668; +t1 = fp + 0xffffffe0; +L42f5e8: +if (v1 != fp) {t4 = v1 << 2; +goto L42f610;} +t4 = v1 << 2; +t8 = 0x10019830; +t4 = t4 - v1; +t4 = t4 << 2; +t9 = t4 + t8; +t6 = MEM_U8(t9 + 9); +t5 = v1 + 0x1; +if (t5 == t6) {t1 = fp + 0xffffffe0; +goto L42f668;} +t1 = fp + 0xffffffe0; +L42f610: +//nop; +a0 = fp; +a1 = s2; +f_move_dreg_to_regs(mem, sp, a0, a1); +goto L42f620; +a1 = s2; +L42f620: +gp = MEM_U32(sp + 204); +t1 = fp + 0xffffffe0; +goto L42f668; +t1 = fp + 0xffffffe0; +L42f62c: +//nop; +a0 = MEM_U32(s6 + 0); +//nop; +v0 = f_reg(mem, sp, a0); +goto L42f63c; +//nop; +L42f63c: +gp = MEM_U32(sp + 204); +a2 = MEM_U8(s6 + 33); +//nop; +t0 = a2 & 0x1f; +a2 = t0; +a0 = fp; +a1 = v0; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L42f65c; +a1 = v0; +L42f65c: +gp = MEM_U32(sp + 204); +//nop; +t1 = fp + 0xffffffe0; +L42f668: +t3 = t1 < 0x20; +t7 = -t3; +t2 = t7 << (t1 & 0x1f); +if ((int)t2 >= 0) {t4 = 0x80000000; +goto L42f6bc;} +t4 = 0x80000000; +t4 = MEM_U32(sp + 240); +t8 = 0x80000000; +t6 = MEM_U32(s6 + 40); +t9 = t8 >> (fp & 0x1f); +at = 0x8; +t5 = t4 | t9; +MEM_U32(sp + 240) = t5; +if (t6 != at) {v0 = fp; +goto L42f87c;} +v0 = fp; +t3 = v0 + 0x1; +t7 = 0x80000000; +t1 = t7 >> (t3 & 0x1f); +t2 = t5 | t1; +MEM_U32(sp + 240) = t2; +t0 = t5; +goto L42f87c; +t0 = t5; +L42f6bc: +t8 = MEM_U32(sp + 244); +t6 = MEM_U32(s6 + 40); +t9 = t4 >> (fp & 0x1f); +at = 0x8; +t5 = t8 | t9; +if (t6 != at) {MEM_U32(sp + 244) = t5; +goto L42f87c;} +MEM_U32(sp + 244) = t5; +t3 = fp + 0x1; +t0 = 0x80000000; +t1 = t0 >> (t3 & 0x1f); +t2 = t5 | t1; +MEM_U32(sp + 244) = t2; +t7 = t5; +goto L42f87c; +t7 = t5; +L42f6f4: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L42f704; +a1 = 0x48; +L42f704: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L42f71c; +//nop; +L42f71c: +t4 = v0 & 0xff; +t8 = t4 + 0xffffffe0; +t9 = t8 < 0x20; +t5 = -t9; +gp = MEM_U32(sp + 204); +t6 = t5 << (t8 & 0x1f); +if ((int)t6 >= 0) {s3 = v0 & 0xff; +goto L42f780;} +s3 = v0 & 0xff; +s5 = 0x100032ec; +t0 = MEM_U32(s6 + 40); +s5 = MEM_U16(s5 + 14); +at = (int)t0 < (int)0x5; +if (at != 0) {//nop; +goto L42f7e8;} +//nop; +t3 = MEM_U8(s6 + 33); +t1 = 0xc; +t7 = t3 & 0x1f; +if (t7 == t1) {//nop; +goto L42f76c;} +//nop; +abort(); +L42f76c: +s5 = 0x100032ec; +//nop; +s5 = MEM_U16(s5 + 16); +//nop; +goto L42f7e8; +//nop; +L42f780: +s5 = 0x100032ec; +t2 = MEM_U32(s6 + 40); +s5 = MEM_U16(s5 + 8); +at = (int)t2 < (int)0x5; +if (at != 0) {//nop; +goto L42f7e8;} +//nop; +a3 = MEM_U8(s6 + 33); +at = 0x5010000; +t4 = a3 & 0x1f; +t9 = t4 < 0x20; +t5 = -t9; +t8 = t5 & at; +v0 = t8 << (t4 & 0x1f); +t6 = (int)v0 < (int)0x0; +v0 = t6; +if (t6 != 0) {a3 = t4; +goto L42f7cc;} +a3 = t4; +v0 = a3 ^ 0xc; +v0 = v0 < 0x1; +L42f7cc: +if (v0 != 0) {//nop; +goto L42f7d8;} +//nop; +abort(); +L42f7d8: +s5 = 0x100032ec; +//nop; +s5 = MEM_U16(s5 + 12); +//nop; +L42f7e8: +t0 = 0x10018ecc; +at = 0x6d; +t0 = MEM_U8(t0 + 0); +a0 = s5; +if (t0 != 0) {a1 = s3; +goto L42f860;} +a1 = s3; +if (s5 != at) {t3 = s5 << 1; +goto L42f860;} +t3 = s5 << 1; +t7 = 0x10003300; +//nop; +t1 = t3 + t7; +s5 = MEM_U16(t1 + 0); +a2 = MEM_U32(s6 + 44); +MEM_U32(sp + 16) = zero; +a1 = s3; +a3 = 0x1d; +a0 = s5; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42f830; +a0 = s5; +L42f830: +gp = MEM_U32(sp + 204); +a2 = MEM_U32(s6 + 44); +//nop; +a0 = s5; +a1 = s3 + 0x1; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +a2 = a2 + 0x4; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42f854; +a2 = a2 + 0x4; +L42f854: +gp = MEM_U32(sp + 204); +//nop; +goto L42f87c; +//nop; +L42f860: +//nop; +a2 = MEM_U32(s6 + 44); +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L42f874; +MEM_U32(sp + 16) = zero; +L42f874: +gp = MEM_U32(sp + 204); +//nop; +L42f87c: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42f890: +t2 = 0x10019368; +//nop; +t2 = MEM_U8(t2 + 0); +//nop; +at = t2 < 0x2; +if (at != 0) {//nop; +goto L42f958;} +//nop; +t4 = MEM_U8(s6 + 33); +at = 0x5010000; +t9 = t4 & 0x1f; +t5 = t9 < 0x20; +t8 = -t5; +t6 = t8 & at; +t0 = t6 << (t9 & 0x1f); +if ((int)t0 >= 0) {//nop; +goto L42f958;} +//nop; +t3 = 0x10018ed0; +//nop; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L42f958;} +//nop; +t7 = 0x10018ecc; +at = 0x1; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L42f958;} +//nop; +//nop; +a0 = s6; +//nop; +v0 = f_parm_reg(mem, sp, a0); +goto L42f910; +//nop; +L42f910: +gp = MEM_U32(sp + 204); +v1 = v0 & 0xff; +at = 0x48; +if (v1 == at) {fp = v0 & 0xff; +goto L42f958;} +fp = v0 & 0xff; +t1 = v1 < 0x20; +t2 = -t1; +at = 0xa000000; +t4 = t2 & at; +t5 = t4 << (v1 & 0x1f); +if ((int)t5 >= 0) {//nop; +goto L42f958;} +//nop; +//nop; +a0 = fp; +a1 = fp; +f_move_dreg_to_regs(mem, sp, a0, a1); +goto L42f950; +a1 = fp; +L42f950: +gp = MEM_U32(sp + 204); +//nop; +L42f958: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42f96c: +//nop; +//nop; +//nop; +f_check_no_used(mem, sp); +goto L42f97c; +//nop; +L42f97c: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +f_load_pmov_regs(mem, sp); +goto L42f994; +//nop; +L42f994: +t8 = MEM_U32(sp + 244); +t0 = MEM_U32(s6 + 44); +t9 = MEM_U32(sp + 240); +gp = MEM_U32(sp + 204); +t6 = t8 | 0xe; +t3 = t0 & 0x100; +MEM_U32(sp + 244) = t6; +if (t3 == 0) {MEM_U32(sp + 240) = t9; +goto L42f9d0;} +MEM_U32(sp + 240) = t9; +at = 0x5fff0000; +t1 = t6 | at; +at = 0xfffff000; +t2 = t9 | at; +MEM_U32(sp + 244) = t1; +MEM_U32(sp + 240) = t2; +L42f9d0: +//nop; +a1 = MEM_U32(sp + 244); +a2 = MEM_U32(sp + 240); +a0 = 0x35; +f_emit_regmask(mem, sp, a0, a1, a2); +goto L42f9e4; +a0 = 0x35; +L42f9e4: +s0 = MEM_U8(s6 + 33); +gp = MEM_U32(sp + 204); +v0 = s0 << 24; +t4 = v0 >> 29; +at = 0x5; +if (t4 != at) {v0 = t4; +goto L42fa0c;} +v0 = t4; +t5 = MEM_U32(s6 + 36); +MEM_U32(sp + 232) = t5; +goto L42fbe4; +MEM_U32(sp + 232) = t5; +L42fa0c: +t8 = MEM_U8(s6 + 32); +at = 0x97; +if (t8 != at) {//nop; +goto L42fa78;} +//nop; +t6 = MEM_U32(s6 + 44); +a0 = 0x23; +t0 = t6 & 0x80; +if (t0 == 0) {a2 = zero; +goto L42fa54;} +a2 = zero; +//nop; +a1 = MEM_U32(s6 + 36); +a0 = 0x22; +a2 = zero; +a3 = zero; +f_emit_a(mem, sp, a0, a1, a2, a3); +goto L42fa48; +a3 = zero; +L42fa48: +gp = MEM_U32(sp + 204); +s0 = MEM_U8(s6 + 33); +goto L42fa70; +s0 = MEM_U8(s6 + 33); +L42fa54: +//nop; +a1 = MEM_U32(s6 + 36); +a3 = 0x6; +f_emit_a(mem, sp, a0, a1, a2, a3); +goto L42fa64; +a3 = 0x6; +L42fa64: +gp = MEM_U32(sp + 204); +//nop; +s0 = MEM_U8(s6 + 33); +L42fa70: +//nop; +goto L42fbe4; +//nop; +L42fa78: +t3 = 0x10018ea4; +t1 = s0 & 0xff1f; +t3 = MEM_U8(t3 + 0); +t2 = t1 | 0x80; +if (t3 == 0) {t4 = t2 & 0xffe0; +goto L42fb8c;} +t4 = t2 & 0xffe0; +//nop; +s1 = s0; +t7 = s1 & 0x1f; +MEM_U8(s6 + 33) = (uint8_t)t2; +t5 = t4 | 0x6; +s3 = MEM_U32(s6 + 44); +s4 = MEM_U32(s6 + 48); +s1 = t7; +s2 = v0 & 0xff; +MEM_U8(s6 + 33) = (uint8_t)t5; +MEM_U32(s6 + 44) = zero; +MEM_U32(s6 + 48) = zero; +a0 = 0x24; +a1 = s6; +a2 = 0x8; +a3 = zero; +f_loadstore(mem, sp, a0, a1, a2, a3); +goto L42fad4; +a3 = zero; +L42fad4: +s0 = MEM_U8(s6 + 33); +gp = MEM_U32(sp + 204); +t8 = s0 << 27; +t6 = t8 >> 27; +t0 = s1 ^ t6; +t3 = t0 & 0x1f; +t7 = t3 ^ s0; +t1 = t7 << 24; +t9 = t1 >> 29; +t2 = s2 ^ t9; +t4 = t2 << 29; +//nop; +t5 = t4 >> 24; +MEM_U8(s6 + 33) = (uint8_t)t7; +t8 = t5 ^ t7; +MEM_U32(s6 + 44) = s3; +MEM_U32(s6 + 48) = s4; +MEM_U8(s6 + 33) = (uint8_t)t8; +f_check_no_used(mem, sp); +goto L42fb20; +MEM_U8(s6 + 33) = (uint8_t)t8; +L42fb20: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +f_load_pmov_regs(mem, sp); +goto L42fb38; +//nop; +L42fb38: +t6 = MEM_U32(s6 + 44); +gp = MEM_U32(sp + 204); +t0 = t6 & 0x80; +if (t0 == 0) {//nop; +goto L42fb68;} +//nop; +//nop; +a0 = 0x22; +a1 = 0x8; +f_emit_r(mem, sp, a0, a1); +goto L42fb5c; +a1 = 0x8; +L42fb5c: +gp = MEM_U32(sp + 204); +s0 = MEM_U8(s6 + 33); +goto L42fb84; +s0 = MEM_U8(s6 + 33); +L42fb68: +//nop; +a0 = 0x23; +a1 = 0x8; +f_emit_r(mem, sp, a0, a1); +goto L42fb78; +a1 = 0x8; +L42fb78: +gp = MEM_U32(sp + 204); +//nop; +s0 = MEM_U8(s6 + 33); +L42fb84: +//nop; +goto L42fbe4; +//nop; +L42fb8c: +t3 = MEM_U32(s6 + 44); +a0 = 0x23; +t7 = t3 & 0x80; +if (t7 == 0) {a2 = zero; +goto L42fbc8;} +a2 = zero; +//nop; +a1 = MEM_U32(s6 + 36); +a0 = 0x22; +a2 = zero; +a3 = zero; +f_emit_a(mem, sp, a0, a1, a2, a3); +goto L42fbb8; +a3 = zero; +L42fbb8: +gp = MEM_U32(sp + 204); +s0 = MEM_U8(s6 + 33); +//nop; +goto L42fbe4; +//nop; +L42fbc8: +//nop; +a1 = MEM_U32(s6 + 36); +a3 = zero; +f_emit_a(mem, sp, a0, a1, a2, a3); +goto L42fbd8; +a3 = zero; +L42fbd8: +gp = MEM_U32(sp + 204); +s0 = MEM_U8(s6 + 33); +//nop; +L42fbe4: +t1 = 0x10018ecc; +at = 0x1; +t1 = MEM_U8(t1 + 0); +t9 = s0 & 0x1f; +if (t1 != at) {t2 = t9 < 0x20; +goto L42fc0c;} +t2 = t9 < 0x20; +v0 = 0x10019830; +v1 = 0x48; +MEM_U8(v0 + 57) = (uint8_t)v1; +MEM_U8(v0 + 81) = (uint8_t)v1; +L42fc0c: +at = 0x100027c4; +t4 = -t2; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x5010000; +t5 = t4 & at; +t8 = t5 << (t9 & 0x1f); +if ((int)t8 >= 0) {//nop; +goto L42fc38;} +//nop; +at = 0x100027c8; +t6 = 0x1; +MEM_U8(at + 0) = (uint8_t)t6; +L42fc38: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42fc4c: +t1 = 0x10018ed8; +t0 = MEM_U32(sp + 244); +t7 = MEM_U32(sp + 240); +t1 = MEM_U32(t1 + 0); +t3 = t0 | 0xe; +MEM_U32(sp + 244) = t3; +if ((int)t1 <= 0) {MEM_U32(sp + 240) = t7; +goto L42fc74;} +MEM_U32(sp + 240) = t7; +t2 = t3 | 0x40; +MEM_U32(sp + 244) = t2; +L42fc74: +//nop; +a1 = MEM_U32(sp + 244); +a2 = MEM_U32(sp + 240); +a0 = 0x35; +f_emit_regmask(mem, sp, a0, a1, a2); +goto L42fc88; +a0 = 0x35; +L42fc88: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +a1 = 0x19; +//nop; +f_eval(mem, sp, a0, a1); +goto L42fca0; +//nop; +L42fca0: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L42fcb8; +//nop; +L42fcb8: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +t4 = 0x10018ed8; +t5 = v0 & 0xff; +t4 = MEM_U32(t4 + 0); +at = 0x19; +if ((int)t4 <= 0) {//nop; +goto L42fcf8;} +//nop; +if (t5 == at) {a0 = 0x31; +goto L42fcf8;} +a0 = 0x31; +//nop; +a1 = 0x19; +a2 = s3; +f_emit_rr(mem, sp, a0, a1, a2); +goto L42fcf0; +a2 = s3; +L42fcf0: +gp = MEM_U32(sp + 204); +//nop; +L42fcf8: +//nop; +//nop; +//nop; +f_check_no_used(mem, sp); +goto L42fd08; +//nop; +L42fd08: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +f_load_pmov_regs(mem, sp); +goto L42fd20; +//nop; +L42fd20: +t9 = MEM_U32(s6 + 44); +gp = MEM_U32(sp + 204); +t8 = t9 & 0x80; +if (t8 == 0) {//nop; +goto L42fd50;} +//nop; +//nop; +a0 = 0x22; +a1 = s3; +f_emit_r(mem, sp, a0, a1); +goto L42fd44; +a1 = s3; +L42fd44: +gp = MEM_U32(sp + 204); +//nop; +goto L42fd68; +//nop; +L42fd50: +//nop; +a0 = 0x23; +a1 = s3; +f_emit_r(mem, sp, a0, a1); +goto L42fd60; +a1 = s3; +L42fd60: +gp = MEM_U32(sp + 204); +//nop; +L42fd68: +t6 = 0x10018ecc; +at = 0x1; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 != at) {//nop; +goto L42fde0;} +//nop; +t0 = 0x10018ed0; +//nop; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L42fde0;} +//nop; +t7 = 0x10019830; +at = 0x5; +t7 = MEM_U8(t7 + 57); +//nop; +if (t7 != at) {//nop; +goto L42fdbc;} +//nop; +at = 0x10019830; +t1 = 0x48; +MEM_U8(at + 57) = (uint8_t)t1; +L42fdbc: +t3 = 0x10019830; +at = 0x7; +t3 = MEM_U8(t3 + 81); +//nop; +if (t3 != at) {//nop; +goto L42fde0;} +//nop; +at = 0x10019830; +t2 = 0x48; +MEM_U8(at + 81) = (uint8_t)t2; +L42fde0: +at = 0x100027c4; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +t4 = MEM_U8(s6 + 33); +at = 0x5010000; +t5 = t4 & 0x1f; +t9 = t5 < 0x20; +t8 = -t9; +t6 = t8 & at; +t0 = t6 << (t5 & 0x1f); +if ((int)t0 >= 0) {//nop; +goto L42fe1c;} +//nop; +at = 0x100027c8; +t7 = 0x1; +MEM_U8(at + 0) = (uint8_t)t7; +L42fe1c: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L42fe30: +t1 = MEM_U8(s6 + 33); +at = 0xc0000; +t3 = t1 & 0x1f; +t2 = t3 < 0x20; +t4 = -t2; +at = at | 0x8000; +t9 = t4 & at; +t8 = t9 << (t3 & 0x1f); +if ((int)t8 >= 0) {//nop; +goto L42fe74;} +//nop; +//nop; +a0 = s6; +a1 = fp; +f_eval_fp_min_max(mem, sp, a0, a1); +goto L42fe68; +a1 = fp; +L42fe68: +gp = MEM_U32(sp + 204); +ra = MEM_U32(sp + 212); +goto L434eec; +ra = MEM_U32(sp + 212); +L42fe74: +s0 = MEM_U32(s6 + 4); +at = 0x49; +t6 = MEM_U8(s0 + 32); +//nop; +if (t6 == at) {//nop; +goto L42fea4;} +//nop; +//nop; +a0 = s0; +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L42fe9c; +a1 = 0x48; +L42fe9c: +gp = MEM_U32(sp + 204); +//nop; +L42fea4: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L42feb4; +a1 = 0x48; +L42feb4: +s0 = MEM_U32(s6 + 4); +gp = MEM_U32(sp + 204); +t5 = MEM_U8(s0 + 32); +at = 0x49; +if (t5 == at) {//nop; +goto L42fee4;} +//nop; +//nop; +a0 = s0; +//nop; +v0 = f_reg(mem, sp, a0); +goto L42fedc; +//nop; +L42fedc: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)v0; +L42fee4: +//nop; +a0 = MEM_U32(s6 + 0); +//nop; +v0 = f_reg(mem, sp, a0); +goto L42fef4; +//nop; +L42fef4: +gp = MEM_U32(sp + 204); +at = 0x48; +if (fp != at) {s3 = v0 & 0xff; +goto L42fff4;} +s3 = v0 & 0xff; +//nop; +a0 = s3; +//nop; +v0 = f_usage_count(mem, sp, a0); +goto L42ff14; +//nop; +L42ff14: +gp = MEM_U32(sp + 204); +if (v0 != 0) {//nop; +goto L42ff5c;} +//nop; +//nop; +a0 = s3; +//nop; +v0 = f_is_available(mem, sp, a0); +goto L42ff30; +//nop; +L42ff30: +gp = MEM_U32(sp + 204); +if (v0 == 0) {a0 = s3; +goto L42ff5c;} +a0 = s3; +//nop; +a2 = MEM_U16(s6 + 20); +fp = s3 & 0xff; +a1 = s6; +f_get_reg(mem, sp, a0, a1, a2); +goto L42ff50; +a1 = s6; +L42ff50: +gp = MEM_U32(sp + 204); +v1 = MEM_U8(s6 + 25); +goto L430014; +v1 = MEM_U8(s6 + 25); +L42ff5c: +t0 = MEM_U32(s6 + 4); +at = 0x49; +t7 = MEM_U8(t0 + 32); +//nop; +if (t7 == at) {//nop; +goto L42ffd8;} +//nop; +//nop; +a0 = MEM_U8(sp + 318); +//nop; +v0 = f_usage_count(mem, sp, a0); +goto L42ff84; +//nop; +L42ff84: +gp = MEM_U32(sp + 204); +if (v0 != 0) {//nop; +goto L42ffd8;} +//nop; +//nop; +a0 = MEM_U8(sp + 318); +//nop; +v0 = f_is_available(mem, sp, a0); +goto L42ffa0; +//nop; +L42ffa0: +gp = MEM_U32(sp + 204); +if (v0 == 0) {a1 = s6; +goto L42ffd8;} +a1 = s6; +s4 = s3 & 0xff; +s3 = MEM_U8(sp + 318); +//nop; +a2 = MEM_U16(s6 + 20); +MEM_U8(sp + 318) = (uint8_t)s4; +fp = s3; +a0 = s3; +f_get_reg(mem, sp, a0, a1, a2); +goto L42ffcc; +a0 = s3; +L42ffcc: +gp = MEM_U32(sp + 204); +v1 = MEM_U8(s6 + 25); +goto L430014; +v1 = MEM_U8(s6 + 25); +L42ffd8: +//nop; +a1 = MEM_U16(s6 + 20); +a0 = s6; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L42ffe8; +a0 = s6; +L42ffe8: +gp = MEM_U32(sp + 204); +fp = v0 & 0xff; +goto L430010; +fp = v0 & 0xff; +L42fff4: +//nop; +a2 = MEM_U16(s6 + 20); +a0 = fp; +a1 = s6; +f_get_reg(mem, sp, a0, a1, a2); +goto L430008; +a1 = s6; +L430008: +gp = MEM_U32(sp + 204); +//nop; +L430010: +v1 = MEM_U8(s6 + 25); +L430014: +t6 = MEM_U8(sp + 318); +t1 = v1 << 24; +t2 = t1 >> 25; +t4 = fp ^ t2; +t9 = t4 << 25; +t3 = t9 >> 24; +t8 = t3 ^ v1; +if (fp != t6) {MEM_U8(s6 + 25) = (uint8_t)t8; +goto L430058;} +MEM_U8(s6 + 25) = (uint8_t)t8; +t5 = MEM_U32(s6 + 4); +at = 0x49; +t0 = MEM_U8(t5 + 32); +//nop; +if (t0 == at) {//nop; +goto L430058;} +//nop; +MEM_U8(sp + 318) = (uint8_t)s3; +goto L4300cc; +MEM_U8(sp + 318) = (uint8_t)s3; +L430058: +if (fp == s3) {a0 = 0x31; +goto L4300cc;} +a0 = 0x31; +//nop; +a1 = fp; +a2 = s3; +f_emit_rr(mem, sp, a0, a1, a2); +goto L430070; +a2 = s3; +L430070: +gp = MEM_U32(sp + 204); +//nop; +t7 = 0x10018ecc; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L4300cc;} +//nop; +t1 = MEM_U8(s6 + 33); +at = 0x5010000; +t2 = t1 & 0x1f; +t4 = t2 < 0x20; +t9 = -t4; +t3 = t9 & at; +t8 = t3 << (t2 & 0x1f); +if ((int)t8 >= 0) {a0 = 0x31; +goto L4300cc;} +a0 = 0x31; +//nop; +a1 = fp + 0x1; +a2 = s3 + 0x1; +f_emit_rr(mem, sp, a0, a1, a2); +goto L4300c4; +a2 = s3 + 0x1; +L4300c4: +gp = MEM_U32(sp + 204); +//nop; +L4300cc: +//nop; +a0 = s6; +//nop; +v0 = f_uop_to_asm(mem, sp, a0); +goto L4300dc; +//nop; +L4300dc: +gp = MEM_U32(sp + 204); +s5 = v0 & 0xffff; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L4300f4; +//nop; +L4300f4: +s0 = MEM_U32(s6 + 4); +gp = MEM_U32(sp + 204); +t6 = MEM_U8(s0 + 32); +at = 0x49; +if (t6 != at) {s7 = v0; +goto L430220;} +s7 = v0; +t5 = MEM_U8(s6 + 33); +at = 0x5010000; +t0 = t5 & 0x1f; +t7 = t0 < 0x20; +t1 = -t7; +t4 = t1 & at; +t9 = t4 << (t0 & 0x1f); +if ((int)t9 >= 0) {a0 = s5; +goto L4301e0;} +a0 = s5; +//nop; +a2 = MEM_U32(s0 + 48); +a3 = MEM_U32(s0 + 52); +a0 = s5; +a1 = fp; +MEM_U32(sp + 16) = v0; +MEM_U32(sp + 20) = s6; +f_emit_branch_rill(mem, sp, a0, a1, a2, a3); +goto L430150; +MEM_U32(sp + 20) = s6; +L430150: +gp = MEM_U32(sp + 204); +a1 = fp; +t3 = 0x10018ecc; +a3 = zero; +t3 = MEM_U8(t3 + 0); +a0 = 0x14c; +if (t3 != 0) {//nop; +goto L4301b4;} +//nop; +t2 = MEM_U32(s6 + 4); +//nop; +a2 = MEM_U32(t2 + 48); +a0 = 0x29; +s0 = fp + 0x1; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L430188; +s0 = fp + 0x1; +L430188: +gp = MEM_U32(sp + 204); +t8 = MEM_U32(s6 + 4); +//nop; +a2 = MEM_U32(t8 + 52); +a0 = 0x29; +a1 = s0; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L4301a8; +a3 = zero; +L4301a8: +gp = MEM_U32(sp + 204); +//nop; +goto L4302b4; +//nop; +L4301b4: +t6 = MEM_U32(s6 + 4); +//nop; +a2 = MEM_U32(t6 + 48); +a1 = fp; +MEM_U32(sp + 8) = a2; +a3 = MEM_U32(t6 + 52); +MEM_U32(sp + 12) = a3; +f_emit_rii(mem, sp, a0, a1, a2, a3); +goto L4301d4; +MEM_U32(sp + 12) = a3; +L4301d4: +gp = MEM_U32(sp + 204); +//nop; +goto L4302b4; +//nop; +L4301e0: +//nop; +a2 = MEM_U32(s0 + 48); +a1 = fp; +a3 = s7; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L4301f4; +a3 = s7; +L4301f4: +gp = MEM_U32(sp + 204); +t1 = MEM_U32(s6 + 4); +//nop; +a2 = MEM_U32(t1 + 48); +a0 = 0x29; +a1 = fp; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L430214; +a3 = zero; +L430214: +gp = MEM_U32(sp + 204); +//nop; +goto L4302b4; +//nop; +L430220: +//nop; +a2 = MEM_U8(sp + 318); +a0 = s5; +a1 = fp; +a3 = s7; +MEM_U32(sp + 16) = s6; +f_emit_branch_rrll(mem, sp, a0, a1, a2, a3); +goto L43023c; +MEM_U32(sp + 16) = s6; +L43023c: +gp = MEM_U32(sp + 204); +a2 = MEM_U8(sp + 318); +//nop; +a0 = 0x31; +a1 = fp; +f_emit_rr(mem, sp, a0, a1, a2); +goto L430254; +a1 = fp; +L430254: +gp = MEM_U32(sp + 204); +//nop; +t4 = 0x10018ecc; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L4302b4;} +//nop; +t0 = MEM_U8(s6 + 33); +at = 0x5010000; +t9 = t0 & 0x1f; +t3 = t9 < 0x20; +t2 = -t3; +t8 = t2 & at; +t5 = t8 << (t9 & 0x1f); +if ((int)t5 >= 0) {a0 = 0x31; +goto L4302b4;} +a0 = 0x31; +a2 = MEM_U8(sp + 318); +//nop; +a1 = fp + 0x1; +a2 = a2 + 0x1; +f_emit_rr(mem, sp, a0, a1, a2); +goto L4302ac; +a2 = a2 + 0x1; +L4302ac: +gp = MEM_U32(sp + 204); +//nop; +L4302b4: +//nop; +a0 = s7; +//nop; +f_define_label(mem, sp, a0); +goto L4302c4; +//nop; +L4302c4: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L4302e0: +t6 = MEM_U32(s6 + 4); +//nop; +a0 = MEM_U32(s6 + 0); +a2 = MEM_U32(t6 + 36); +a1 = zero; +f_jump(mem, sp, a0, a1, a2); +goto L4302f8; +a1 = zero; +L4302f8: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L430314: +t7 = MEM_U32(s6 + 4); +//nop; +a0 = MEM_U32(s6 + 0); +a2 = MEM_U32(t7 + 36); +a1 = 0x1; +f_jump(mem, sp, a0, a1, a2); +goto L43032c; +a1 = 0x1; +L43032c: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L430348: +//nop; +a0 = s6; +//nop; +v0 = f_is_end_return(mem, sp, a0); +goto L430358; +//nop; +L430358: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L430598;} +//nop; +t1 = 0x10019388; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L430598;} +//nop; +t4 = 0x10019d5c; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L430598;} +//nop; +//nop; +//nop; +//nop; +v0 = f_is_empty_saved_regs(mem, sp); +goto L4303a4; +//nop; +L4303a4: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L430598;} +//nop; +t0 = 0x10019380; +at = 0x1d; +t0 = MEM_U8(t0 + 0); +t3 = MEM_U8(sp + 223); +if (t0 != at) {at = 0xb; +goto L430598;} +at = 0xb; +if (t3 == at) {t2 = t3 < 0x20; +goto L43043c;} +t2 = t3 < 0x20; +at = 0xc0000; +at = at | 0x8000; +t8 = -t2; +t9 = t8 & at; +t5 = t9 << (t3 & 0x1f); +if ((int)t5 >= 0) {t6 = 0xc0000000; +goto L4303f8;} +t6 = 0xc0000000; +MEM_U32(sp + 244) = zero; +MEM_U32(sp + 240) = t6; +goto L430444; +MEM_U32(sp + 240) = t6; +L4303f8: +t7 = 0x10018ed0; +t1 = MEM_U8(sp + 223); +t7 = MEM_U8(t7 + 0); +MEM_U32(sp + 240) = zero; +if (t7 != 0) {t4 = t1 < 0x20; +goto L430430;} +t4 = t1 < 0x20; +t0 = -t4; +at = 0x5010000; +t2 = t0 & at; +t8 = t2 << (t1 & 0x1f); +if ((int)t8 >= 0) {t9 = 0x30000000; +goto L430430;} +t9 = 0x30000000; +MEM_U32(sp + 244) = t9; +goto L430444; +MEM_U32(sp + 244) = t9; +L430430: +t3 = 0x20000000; +MEM_U32(sp + 244) = t3; +goto L430444; +MEM_U32(sp + 244) = t3; +L43043c: +MEM_U32(sp + 244) = zero; +MEM_U32(sp + 240) = zero; +L430444: +s0 = 0x10019d70; +//nop; +s0 = MEM_U32(s0 + 0); +//nop; +if (s0 == 0) {a1 = MEM_U32(sp + 244); +goto L43054c;} +a1 = MEM_U32(sp + 244); +t5 = MEM_U32(s0 + 48); +at = 0xffffffff; +if (t5 == at) {a1 = MEM_U32(sp + 244); +goto L43054c;} +a1 = MEM_U32(sp + 244); +L43046c: +t6 = MEM_U16(s0 + 34); +at = 0x1; +if (t6 == at) {//nop; +goto L430528;} +//nop; +//nop; +a0 = s0; +//nop; +v0 = f_parm_reg(mem, sp, a0); +goto L43048c; +//nop; +L43048c: +t7 = MEM_U8(s0 + 33); +at = 0xc0000; +t4 = t7 & 0x1f; +t0 = t4 < 0x20; +t2 = -t0; +at = at | 0x8000; +t1 = t2 & at; +gp = MEM_U32(sp + 204); +t8 = t1 << (t4 & 0x1f); +if ((int)t8 >= 0) {v1 = v0 & 0xff; +goto L4304f4;} +v1 = v0 & 0xff; +t9 = MEM_U32(sp + 240); +v1 = v0 & 0xff; +t3 = 0x80000000; +t7 = MEM_U32(s0 + 40); +t5 = t3 >> (v1 & 0x1f); +at = 0x8; +t6 = t9 | t5; +if (t7 != at) {MEM_U32(sp + 240) = t6; +goto L430528;} +MEM_U32(sp + 240) = t6; +t2 = v1 + 0x1; +t1 = 0x80000000; +t4 = t1 >> (t2 & 0x1f); +t8 = t6 | t4; +MEM_U32(sp + 240) = t8; +goto L430528; +MEM_U32(sp + 240) = t8; +L4304f4: +t3 = MEM_U32(sp + 244); +t9 = 0x80000000; +t7 = MEM_U32(s0 + 40); +t5 = t9 >> (v1 & 0x1f); +at = 0x8; +t6 = t3 | t5; +if (t7 != at) {MEM_U32(sp + 244) = t6; +goto L430528;} +MEM_U32(sp + 244) = t6; +t2 = v1 + 0x1; +t0 = 0x80000000; +t4 = t0 >> (t2 & 0x1f); +t8 = t6 | t4; +MEM_U32(sp + 244) = t8; +L430528: +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 == 0) {a1 = MEM_U32(sp + 244); +goto L43054c;} +a1 = MEM_U32(sp + 244); +t9 = MEM_U32(s0 + 48); +at = 0xffffffff; +if (t9 != at) {//nop; +goto L43046c;} +//nop; +a1 = MEM_U32(sp + 244); +L43054c: +a2 = MEM_U32(sp + 240); +//nop; +t3 = a1 | 0xff0e; +t5 = a2 | 0xfff; +a1 = t3; +a2 = t5; +MEM_U32(sp + 240) = t5; +MEM_U32(sp + 244) = t3; +a0 = 0x35; +f_emit_regmask(mem, sp, a0, a1, a2); +goto L430574; +a0 = 0x35; +L430574: +gp = MEM_U32(sp + 204); +a0 = 0x22; +//nop; +a1 = 0x1f; +//nop; +f_emit_r(mem, sp, a0, a1); +goto L43058c; +//nop; +L43058c: +gp = MEM_U32(sp + 204); +//nop; +goto L4305b4; +//nop; +L430598: +t6 = MEM_U32(s6 + 4); +//nop; +a1 = MEM_U32(t6 + 36); +a0 = 0x4; +f_emit_ll(mem, sp, a0, a1); +goto L4305ac; +a0 = 0x4; +L4305ac: +gp = MEM_U32(sp + 204); +//nop; +L4305b4: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L4305c8: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L4305d8; +a1 = 0x48; +L4305d8: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L4305f0; +//nop; +L4305f0: +gp = MEM_U32(sp + 204); +a0 = 0x22; +//nop; +a1 = v0; +//nop; +f_emit_r(mem, sp, a0, a1); +goto L430608; +//nop; +L430608: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L430624: +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L430634; +a1 = fp; +L430634: +gp = MEM_U32(sp + 204); +t7 = MEM_U32(s6 + 0); +//nop; +a2 = MEM_U32(t7 + 36); +fp = v0 & 0xff; +a0 = 0x24; +a1 = v0 & 0xff; +f_emit_rll(mem, sp, a0, a1, a2); +goto L430654; +a1 = v0 & 0xff; +L430654: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L430670: +a3 = MEM_U8(s6 + 33); +at = 0xc0000; +t0 = a3 & 0x1f; +t2 = t0 < 0x20; +t1 = -t2; +at = at | 0x8000; +t4 = t1 & at; +t8 = t4 << (t0 & 0x1f); +if ((int)t8 >= 0) {a3 = t0; +goto L4306b4;} +a3 = t0; +//nop; +a0 = s6; +a1 = fp; +f_load_fp_literal(mem, sp, a0, a1); +goto L4306a8; +a1 = fp; +L4306a8: +gp = MEM_U32(sp + 204); +//nop; +goto L430908; +//nop; +L4306b4: +at = 0xe; +if (a3 != at) {//nop; +goto L43073c;} +//nop; +t9 = MEM_U32(s6 + 40); +//nop; +at = (int)t9 < (int)0x5; +if (at != 0) {//nop; +goto L43073c;} +//nop; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L4306e4; +//nop; +L4306e4: +gp = MEM_U32(sp + 204); +a0 = s6 + 0x20; +//nop; +a1 = v0; +//nop; +v0 = f_add_to_pool(mem, sp, a0, a1); +goto L4306fc; +//nop; +L4306fc: +gp = MEM_U32(sp + 204); +s0 = v0; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L430714; +a1 = fp; +L430714: +gp = MEM_U32(sp + 204); +fp = v0 & 0xff; +//nop; +a0 = 0x24; +a1 = v0 & 0xff; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L430730; +a2 = s0; +L430730: +gp = MEM_U32(sp + 204); +//nop; +goto L430908; +//nop; +L43073c: +//nop; +a0 = s6; +//nop; +v0 = f_is_zero(mem, sp, a0); +goto L43074c; +//nop; +L43074c: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L430814;} +//nop; +t3 = 0x10018ecc; +a0 = zero; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L4307ec;} +//nop; +t5 = MEM_U8(s6 + 33); +at = 0x5010000; +t6 = t5 & 0x1f; +t7 = t6 < 0x20; +t0 = -t7; +t2 = t0 & at; +t1 = t2 << (t6 & 0x1f); +if ((int)t1 >= 0) {//nop; +goto L4307ec;} +//nop; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L4307a4; +a1 = fp; +L4307a4: +gp = MEM_U32(sp + 204); +fp = v0 & 0xff; +//nop; +a0 = 0x29; +a1 = v0 & 0xff; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L4307c4; +a3 = zero; +L4307c4: +gp = MEM_U32(sp + 204); +a0 = 0x29; +//nop; +a1 = fp + 0x1; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L4307e0; +a3 = zero; +L4307e0: +gp = MEM_U32(sp + 204); +//nop; +goto L430908; +//nop; +L4307ec: +t4 = MEM_U8(s6 + 25); +//nop; +a1 = MEM_U16(s6 + 20); +t8 = t4 & 0xff01; +fp = zero; +MEM_U8(s6 + 25) = (uint8_t)t8; +f_inc_usage(mem, sp, a0, a1); +goto L430808; +MEM_U8(s6 + 25) = (uint8_t)t8; +L430808: +gp = MEM_U32(sp + 204); +//nop; +goto L430908; +//nop; +L430814: +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L430824; +a1 = fp; +L430824: +t9 = MEM_U8(s6 + 33); +at = 0x5010000; +t3 = t9 & 0x1f; +t5 = t3 < 0x20; +t7 = -t5; +t0 = t7 & at; +gp = MEM_U32(sp + 204); +t2 = t0 << (t3 & 0x1f); +if ((int)t2 >= 0) {fp = v0 & 0xff; +goto L4308e8;} +fp = v0 & 0xff; +t6 = 0x10018ecc; +v1 = v0 & 0xff; +t6 = MEM_U8(t6 + 0); +t4 = v1 << 2; +if (t6 == 0) {t4 = t4 - v1; +goto L430880;} +t4 = t4 - v1; +t8 = 0x10019830; +t4 = t4 << 2; +t9 = t4 + t8; +t5 = MEM_U8(t9 + 9); +t1 = v1 + 0x1; +if (t1 != t5) {a0 = 0x14c; +goto L4308c0;} +a0 = 0x14c; +L430880: +//nop; +a2 = MEM_U32(s6 + 48); +a0 = 0x29; +a1 = fp; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L430898; +a3 = zero; +L430898: +gp = MEM_U32(sp + 204); +a2 = MEM_U32(s6 + 52); +//nop; +a0 = 0x29; +a1 = fp + 0x1; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L4308b4; +a3 = zero; +L4308b4: +gp = MEM_U32(sp + 204); +//nop; +goto L430908; +//nop; +L4308c0: +a2 = MEM_U32(s6 + 48); +a3 = MEM_U32(s6 + 52); +//nop; +a1 = fp; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +f_emit_rii(mem, sp, a0, a1, a2, a3); +goto L4308dc; +MEM_U32(sp + 12) = a3; +L4308dc: +gp = MEM_U32(sp + 204); +//nop; +goto L430908; +//nop; +L4308e8: +//nop; +a2 = MEM_U32(s6 + 48); +a0 = 0x29; +a1 = fp; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L430900; +a3 = zero; +L430900: +gp = MEM_U32(sp + 204); +//nop; +L430908: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L43091c: +a3 = MEM_U8(s6 + 33); +at = 0x5010000; +t3 = a3 & 0x1f; +t2 = t3 < 0x20; +t6 = -t2; +t4 = t6 & at; +t8 = t4 << (t3 & 0x1f); +a3 = t3; +if ((int)t8 >= 0) {//nop; +goto L430948;} +//nop; +abort(); +L430948: +t9 = a3 < 0x20; +at = 0xc0000; +at = at | 0x8000; +t1 = -t9; +t5 = t1 & at; +t7 = t5 << (a3 & 0x1f); +if ((int)t7 >= 0) {//nop; +goto L4309bc;} +//nop; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L430978; +a1 = fp; +L430978: +gp = MEM_U32(sp + 204); +a1 = MEM_U8(s6 + 33); +//nop; +t0 = a1 & 0x1f; +fp = v0 & 0xff; +a1 = t0; +a0 = 0xfc; +v0 = f_fasm(mem, sp, a0, a1); +goto L430998; +a0 = 0xfc; +L430998: +gp = MEM_U32(sp + 204); +a2 = MEM_U32(s6 + 36); +//nop; +a0 = v0; +a1 = fp; +f_emit_rrfi(mem, sp, a0, a1, a2); +goto L4309b0; +a1 = fp; +L4309b0: +gp = MEM_U32(sp + 204); +//nop; +goto L4309f0; +//nop; +L4309bc: +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L4309cc; +a1 = fp; +L4309cc: +gp = MEM_U32(sp + 204); +a2 = MEM_U32(s6 + 36); +//nop; +fp = v0 & 0xff; +a0 = 0x29; +a1 = v0 & 0xff; +f_emit_rrfi(mem, sp, a0, a1, a2); +goto L4309e8; +a1 = v0 & 0xff; +L4309e8: +gp = MEM_U32(sp + 204); +//nop; +L4309f0: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L430a04: +//nop; +a0 = s6 + 0x20; +//nop; +v0 = f_ureg(mem, sp, a0); +goto L430a14; +//nop; +L430a14: +gp = MEM_U32(sp + 204); +v1 = v0 & 0xff; +at = 0x48; +if (v1 == at) {s3 = v0 & 0xff; +goto L430bec;} +s3 = v0 & 0xff; +t3 = v1 + 0xffffffe0; +t2 = t3 < 0x20; +t6 = -t2; +t4 = t6 << (t3 & 0x1f); +if ((int)t4 >= 0) {a0 = s3; +goto L430a74;} +a0 = s3; +t8 = MEM_U8(s6 + 33); +t1 = 0x1000327c; +t9 = t8 & 0x1f; +t5 = t9 + t1; +//nop; +a2 = MEM_U8(t5 + 0); +a3 = MEM_U16(s6 + 20); +a0 = s3; +a1 = s6; +f_get_fp_reg1(mem, sp, a0, a1, a2, a3); +goto L430a68; +a1 = s6; +L430a68: +gp = MEM_U32(sp + 204); +v1 = MEM_U8(s6 + 25); +goto L430bc8; +v1 = MEM_U8(s6 + 25); +L430a74: +//nop; +a2 = MEM_U16(s6 + 20); +a1 = s6; +f_get_reg1(mem, sp, a0, a1, a2); +goto L430a84; +a1 = s6; +L430a84: +gp = MEM_U32(sp + 204); +at = 0x2; +t7 = 0x100027c8; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L430bc4;} +//nop; +if (s3 != at) {//nop; +goto L430bc4;} +//nop; +at = 0x100027c8; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +t0 = MEM_U8(s6 + 33); +at = 0x5010000; +t2 = t0 & 0x1f; +t6 = t2 < 0x20; +t3 = -t6; +t4 = t3 & at; +t8 = t4 << (t2 & 0x1f); +if ((int)t8 >= 0) {//nop; +goto L430bc4;} +//nop; +t9 = 0x10018ecc; +at = 0x1; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L430bc4;} +//nop; +t1 = 0x10018ed0; +a0 = 0x13a; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L430bc4;} +//nop; +//nop; +a1 = s3; +a2 = s3; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L430b24; +MEM_U32(sp + 16) = zero; +L430b24: +gp = MEM_U32(sp + 204); +s0 = s3 + 0x1; +//nop; +a1 = s0; +a2 = s0; +a0 = 0x13a; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L430b48; +MEM_U32(sp + 16) = zero; +L430b48: +gp = MEM_U32(sp + 204); +a3 = 0x20; +t5 = 0x10018e80; +a0 = 0x13b; +t5 = MEM_U8(t5 + 0); +a1 = s0; +if (t5 == 0) {a2 = s0; +goto L430b8c;} +a2 = s0; +//nop; +a0 = 0x13b; +a1 = s3; +a2 = s3; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L430b80; +MEM_U32(sp + 16) = zero; +L430b80: +gp = MEM_U32(sp + 204); +//nop; +goto L430ba4; +//nop; +L430b8c: +//nop; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L430b9c; +MEM_U32(sp + 16) = zero; +L430b9c: +gp = MEM_U32(sp + 204); +//nop; +L430ba4: +//nop; +a0 = 0x40; +a1 = s3; +a2 = s3; +a3 = s0; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L430bbc; +a3 = s0; +L430bbc: +gp = MEM_U32(sp + 204); +//nop; +L430bc4: +v1 = MEM_U8(s6 + 25); +L430bc8: +//nop; +t7 = v1 << 24; +t0 = t7 >> 25; +t6 = s3 ^ t0; +t3 = t6 << 25; +t4 = t3 >> 24; +t2 = t4 ^ v1; +MEM_U8(s6 + 25) = (uint8_t)t2; +goto L430ce4; +MEM_U8(s6 + 25) = (uint8_t)t2; +L430bec: +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L430bfc; +a1 = fp; +L430bfc: +s7 = MEM_U16(s6 + 34); +gp = MEM_U32(sp + 204); +t8 = s7 & 0x1; +t9 = zero < t8; +s7 = t9 & 0xff; +if (s7 == 0) {fp = v0 & 0xff; +goto L430c30;} +fp = v0 & 0xff; +//nop; +a0 = 0x20; +a1 = 0xb; +f_emit_dir0(mem, sp, a0, a1); +goto L430c28; +a1 = 0xb; +L430c28: +gp = MEM_U32(sp + 204); +//nop; +L430c30: +//nop; +a0 = 0x100032d8; +a1 = s6; +a2 = fp; +v0 = f_lsopc(mem, sp, a0, a1, a2); +goto L430c44; +a2 = fp; +L430c44: +gp = MEM_U32(sp + 204); +a0 = v0 & 0xffff; +//nop; +a1 = s6; +a2 = fp; +f_unaligned_loadstore(mem, sp, a0, a1, a2); +goto L430c5c; +a2 = fp; +L430c5c: +gp = MEM_U32(sp + 204); +//nop; +t5 = 0x10018e80; +//nop; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L430cc4;} +//nop; +t7 = MEM_U8(s6 + 33); +at = 0xe; +t0 = t7 & 0x1f; +if (t0 != at) {//nop; +goto L430cc4;} +//nop; +s1 = MEM_U32(s6 + 40); +a0 = 0x4f; +at = (int)s1 < (int)0x4; +if (at == 0) {t6 = s1 << 3; +goto L430cc4;} +t6 = s1 << 3; +//nop; +t3 = 0x20; +a2 = t3 - t6; +a1 = fp; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L430cbc; +a3 = zero; +L430cbc: +gp = MEM_U32(sp + 204); +//nop; +L430cc4: +if (s7 == 0) {//nop; +goto L430ce4;} +//nop; +//nop; +a0 = 0x20; +a1 = 0xc; +f_emit_dir0(mem, sp, a0, a1); +goto L430cdc; +a1 = 0xc; +L430cdc: +gp = MEM_U32(sp + 204); +//nop; +L430ce4: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L430cf8: +s2 = MEM_U32(s6 + 0); +s7 = MEM_U16(s6 + 34); +t9 = MEM_U16(s2 + 20); +t4 = s7 & 0x1; +t2 = zero < t4; +at = 0x1; +if (t9 != at) {s7 = t2 & 0xff; +goto L431024;} +s7 = t2 & 0xff; +t1 = 0x10018ed8; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L431024;} +//nop; +t5 = MEM_U8(s2 + 32); +at = 0x1; +if (t5 != at) {//nop; +goto L431024;} +//nop; +v1 = MEM_U32(s2 + 4); +at = 0x1; +t7 = MEM_U16(v1 + 20); +//nop; +if (t7 != at) {//nop; +goto L431024;} +//nop; +t0 = MEM_U8(v1 + 32); +at = 0x47; +if (t0 != at) {//nop; +goto L431024;} +//nop; +t3 = MEM_U8(v1 + 33); +at = 0x68000000; +t6 = t3 << 24; +t4 = t6 >> 29; +t2 = t4 < 0x20; +t8 = -t2; +t9 = t8 & at; +t1 = t9 << (t4 & 0x1f); +if ((int)t1 >= 0) {//nop; +goto L431024;} +//nop; +//nop; +a0 = MEM_U32(v1 + 36); +//nop; +v0 = f_get_sym_kind(mem, sp, a0); +goto L430da0; +//nop; +L430da0: +gp = MEM_U32(sp + 204); +at = 0x5; +if (v0 == at) {//nop; +goto L431024;} +//nop; +t5 = MEM_U32(s2 + 4); +at = 0x4; +t7 = MEM_U8(t5 + 33); +//nop; +t0 = t7 << 24; +t3 = t0 >> 29; +if (t3 != at) {//nop; +goto L430ea4;} +//nop; +//nop; +a0 = MEM_U32(s2 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L430de0; +a1 = 0x48; +L430de0: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s2 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L430df8; +//nop; +L430df8: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L430e10; +a1 = fp; +L430e10: +gp = MEM_U32(sp + 204); +if (s7 == 0) {fp = v0 & 0xff; +goto L430e34;} +fp = v0 & 0xff; +//nop; +a0 = 0x20; +a1 = 0xb; +f_emit_dir0(mem, sp, a0, a1); +goto L430e2c; +a1 = 0xb; +L430e2c: +gp = MEM_U32(sp + 204); +//nop; +L430e34: +//nop; +a0 = 0x100032d8; +a1 = s6; +a2 = fp; +v0 = f_lsopc(mem, sp, a0, a1, a2); +goto L430e48; +a2 = fp; +L430e48: +v1 = MEM_U32(s2 + 4); +gp = MEM_U32(sp + 204); +t6 = MEM_U32(s6 + 44); +t2 = MEM_U32(v1 + 44); +t8 = MEM_U32(v1 + 36); +//nop; +a0 = s6; +a1 = v0 & 0xffff; +a2 = fp; +MEM_U32(sp + 20) = s3; +a3 = t6 + t2; +MEM_U32(sp + 16) = t8; +f_iloadistore(mem, sp, a0, a1, a2, a3); +goto L430e7c; +MEM_U32(sp + 16) = t8; +L430e7c: +gp = MEM_U32(sp + 204); +if (s7 == 0) {//nop; +goto L43120c;} +//nop; +//nop; +a0 = 0x20; +a1 = 0xc; +f_emit_dir0(mem, sp, a0, a1); +goto L430e98; +a1 = 0xc; +L430e98: +gp = MEM_U32(sp + 204); +//nop; +goto L43120c; +//nop; +L430ea4: +//nop; +a0 = MEM_U32(s2 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L430eb4; +a1 = 0x48; +L430eb4: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s2 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L430ecc; +//nop; +L430ecc: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L430ee4; +a1 = fp; +L430ee4: +a3 = MEM_U8(s6 + 33); +at = 0xc0000; +t9 = a3 & 0x1f; +t4 = t9 < 0x20; +t1 = -t4; +at = at | 0x8000; +t5 = t1 & at; +gp = MEM_U32(sp + 204); +t7 = t5 << (t9 & 0x1f); +if ((int)t7 < 0) {fp = v0 & 0xff; +goto L430f2c;} +fp = v0 & 0xff; +t0 = t9 < 0x20; +t3 = -t0; +at = 0x5010000; +t6 = t3 & at; +t2 = t6 << (t9 & 0x1f); +if ((int)t2 >= 0) {//nop; +goto L430f60;} +//nop; +L430f2c: +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L430f3c; +a1 = 0x1; +L430f3c: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)v0; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L430f54; +//nop; +L430f54: +gp = MEM_U32(sp + 204); +//nop; +goto L430f64; +//nop; +L430f60: +MEM_U8(sp + 318) = (uint8_t)v0; +L430f64: +if (s7 == 0) {//nop; +goto L430f84;} +//nop; +//nop; +a0 = 0x20; +a1 = 0xb; +f_emit_dir0(mem, sp, a0, a1); +goto L430f7c; +a1 = 0xb; +L430f7c: +gp = MEM_U32(sp + 204); +//nop; +L430f84: +a2 = 0x10019380; +//nop; +a1 = MEM_U8(sp + 318); +a2 = MEM_U8(a2 + 0); +a0 = 0x2; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L430fa0; +a3 = s3; +L430fa0: +gp = MEM_U32(sp + 204); +a1 = s6; +//nop; +a0 = 0x100032d8; +a2 = fp; +v0 = f_lsopc(mem, sp, a0, a1, a2); +goto L430fb8; +a2 = fp; +L430fb8: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s2 + 4); +//nop; +s5 = v0 & 0xffff; +//nop; +v0 = f_frame_offset(mem, sp, a0); +goto L430fd0; +//nop; +L430fd0: +t9 = MEM_U8(sp + 318); +gp = MEM_U32(sp + 204); +MEM_U32(sp + 20) = t9; +t8 = MEM_U32(s6 + 44); +//nop; +a0 = s6; +a1 = s5; +a2 = fp; +MEM_U32(sp + 16) = zero; +a3 = t8 + v0; +f_iloadistore(mem, sp, a0, a1, a2, a3); +goto L430ffc; +a3 = t8 + v0; +L430ffc: +gp = MEM_U32(sp + 204); +if (s7 == 0) {//nop; +goto L43120c;} +//nop; +//nop; +a0 = 0x20; +a1 = 0xc; +f_emit_dir0(mem, sp, a0, a1); +goto L431018; +a1 = 0xc; +L431018: +gp = MEM_U32(sp + 204); +//nop; +goto L43120c; +//nop; +L431024: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L431034; +a1 = 0x48; +L431034: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L43104c; +//nop; +L43104c: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L431064; +a1 = fp; +L431064: +gp = MEM_U32(sp + 204); +if (s7 == 0) {fp = v0 & 0xff; +goto L431088;} +fp = v0 & 0xff; +//nop; +a0 = 0x20; +a1 = 0xb; +f_emit_dir0(mem, sp, a0, a1); +goto L431080; +a1 = 0xb; +L431080: +gp = MEM_U32(sp + 204); +//nop; +L431088: +t4 = MEM_U8(s6 + 32); +at = 0x36; +if (t4 != at) {//nop; +goto L431164;} +//nop; +t1 = MEM_U8(s2 + 32); +at = 0x1; +if (t1 != at) {//nop; +goto L431164;} +//nop; +s1 = MEM_U32(s2 + 0); +at = 0x5b; +v0 = MEM_U8(s1 + 32); +//nop; +if (v0 != at) {at = 0x52; +goto L4310d4;} +at = 0x52; +s1 = MEM_U32(s1 + 0); +//nop; +v0 = MEM_U8(s1 + 32); +//nop; +at = 0x52; +L4310d4: +if (v0 != at) {//nop; +goto L431164;} +//nop; +s2 = 0x10019bb0; +s0 = 0x1; +s2 = s2 + 0x4; +L4310e8: +t5 = MEM_U8(s1 + 25); +v0 = MEM_U32(s2 + 0); +t7 = t5 << 24; +t0 = t7 >> 25; +t3 = 0x1; +t6 = t3 << (t0 & 0x1f); +t2 = v0 & t6; +if (t2 == 0) {//nop; +goto L431154;} +//nop; +t9 = 0x10019bb0; +t8 = s3 << 2; +t4 = t8 + t9; +t1 = MEM_U32(t4 + 0); +t7 = 0x1; +t5 = t1 & v0; +if (t5 != 0) {//nop; +goto L431154;} +//nop; +t3 = 0x10019ce0; +a0 = 0x30; +t0 = s0 + t3; +MEM_U8(t0 + 0) = (uint8_t)t7; +//nop; +a1 = s3; +a2 = s0; +f_emit_alias(mem, sp, a0, a1, a2); +goto L43114c; +a2 = s0; +L43114c: +gp = MEM_U32(sp + 204); +//nop; +L431154: +s0 = s0 + 0x1; +at = 0x20; +if (s0 != at) {s2 = s2 + 0x4; +goto L4310e8;} +s2 = s2 + 0x4; +L431164: +//nop; +a0 = 0x100032d8; +a1 = s6; +a2 = fp; +v0 = f_lsopc(mem, sp, a0, a1, a2); +goto L431178; +a2 = fp; +L431178: +gp = MEM_U32(sp + 204); +a3 = MEM_U32(s6 + 44); +//nop; +a0 = s6; +a1 = v0 & 0xffff; +a2 = fp; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 20) = s3; +f_iloadistore(mem, sp, a0, a1, a2, a3); +goto L43119c; +MEM_U32(sp + 20) = s3; +L43119c: +gp = MEM_U32(sp + 204); +s0 = 0x1; +s1 = 0x10019ce0; +//nop; +s1 = s1 + 0x1; +L4311b0: +t6 = MEM_U8(s1 + 0); +a0 = 0x31; +if (t6 == 0) {//nop; +goto L4311dc;} +//nop; +MEM_U8(s1 + 0) = (uint8_t)zero; +//nop; +a1 = s3; +a2 = s0; +f_emit_alias(mem, sp, a0, a1, a2); +goto L4311d4; +a2 = s0; +L4311d4: +gp = MEM_U32(sp + 204); +//nop; +L4311dc: +s0 = s0 + 0x1; +at = 0x20; +if (s0 != at) {s1 = s1 + 0x1; +goto L4311b0;} +s1 = s1 + 0x1; +if (s7 == 0) {//nop; +goto L43120c;} +//nop; +//nop; +a0 = 0x20; +a1 = 0xc; +f_emit_dir0(mem, sp, a0, a1); +goto L431204; +a1 = 0xc; +L431204: +gp = MEM_U32(sp + 204); +//nop; +L43120c: +t2 = 0x10018e80; +//nop; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L431270;} +//nop; +t8 = MEM_U8(s6 + 33); +at = 0xe; +t9 = t8 & 0x1f; +if (t9 != at) {//nop; +goto L431270;} +//nop; +s1 = MEM_U32(s6 + 40); +a0 = 0x4f; +at = (int)s1 < (int)0x4; +if (at == 0) {//nop; +goto L431270;} +//nop; +//nop; +t4 = s1 << 3; +t1 = 0x20; +a2 = t1 - t4; +a1 = fp; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L431268; +a3 = zero; +L431268: +gp = MEM_U32(sp + 204); +//nop; +L431270: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L431284: +s7 = MEM_U16(s6 + 34); +a0 = MEM_U32(s6 + 0); +//nop; +t5 = s7 & 0x1; +t3 = zero < t5; +s7 = t3 & 0xff; +a1 = 0x48; +s2 = a0; +f_eval(mem, sp, a0, a1); +goto L4312a8; +s2 = a0; +L4312a8: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L4312c0; +//nop; +L4312c0: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L4312d8; +a1 = fp; +L4312d8: +gp = MEM_U32(sp + 204); +if (s7 == 0) {fp = v0 & 0xff; +goto L4312fc;} +fp = v0 & 0xff; +//nop; +a0 = 0x20; +a1 = 0xb; +f_emit_dir0(mem, sp, a0, a1); +goto L4312f4; +a1 = 0xb; +L4312f4: +gp = MEM_U32(sp + 204); +//nop; +L4312fc: +t0 = MEM_U8(s2 + 32); +at = 0x1; +if (t0 != at) {//nop; +goto L4313c8;} +//nop; +s1 = MEM_U32(s2 + 0); +at = 0x5b; +v0 = MEM_U8(s1 + 32); +//nop; +if (v0 != at) {at = 0x52; +goto L431338;} +at = 0x52; +s1 = MEM_U32(s1 + 0); +//nop; +v0 = MEM_U8(s1 + 32); +//nop; +at = 0x52; +L431338: +if (v0 != at) {//nop; +goto L4313c8;} +//nop; +s2 = 0x10019bb0; +s0 = 0x1; +s2 = s2 + 0x4; +L43134c: +t6 = MEM_U8(s1 + 25); +v0 = MEM_U32(s2 + 0); +t2 = t6 << 24; +t8 = t2 >> 25; +t9 = 0x1; +t1 = t9 << (t8 & 0x1f); +t4 = v0 & t1; +if (t4 == 0) {//nop; +goto L4313b8;} +//nop; +t3 = 0x10019bb0; +t5 = s3 << 2; +t7 = t5 + t3; +t0 = MEM_U32(t7 + 0); +t2 = 0x1; +t6 = t0 & v0; +if (t6 != 0) {//nop; +goto L4313b8;} +//nop; +t9 = 0x10019ce0; +a0 = 0x30; +t8 = s0 + t9; +MEM_U8(t8 + 0) = (uint8_t)t2; +//nop; +a1 = s3; +a2 = s0; +f_emit_alias(mem, sp, a0, a1, a2); +goto L4313b0; +a2 = s0; +L4313b0: +gp = MEM_U32(sp + 204); +//nop; +L4313b8: +s0 = s0 + 0x1; +at = 0x20; +if (s0 != at) {s2 = s2 + 0x4; +goto L43134c;} +s2 = s2 + 0x4; +L4313c8: +//nop; +a0 = 0x100032d8; +a1 = s6; +a2 = fp; +v0 = f_lsopc(mem, sp, a0, a1, a2); +goto L4313dc; +a2 = fp; +L4313dc: +gp = MEM_U32(sp + 204); +a3 = MEM_U32(s6 + 36); +//nop; +a0 = s6; +a1 = v0 & 0xffff; +a2 = fp; +MEM_U32(sp + 16) = s3; +f_rloadrstore(mem, sp, a0, a1, a2, a3); +goto L4313fc; +MEM_U32(sp + 16) = s3; +L4313fc: +gp = MEM_U32(sp + 204); +s0 = 0x1; +s1 = 0x10019ce0; +//nop; +s1 = s1 + 0x1; +L431410: +t1 = MEM_U8(s1 + 0); +a0 = 0x31; +if (t1 == 0) {//nop; +goto L43143c;} +//nop; +MEM_U8(s1 + 0) = (uint8_t)zero; +//nop; +a1 = s3; +a2 = s0; +f_emit_alias(mem, sp, a0, a1, a2); +goto L431434; +a2 = s0; +L431434: +gp = MEM_U32(sp + 204); +//nop; +L43143c: +s0 = s0 + 0x1; +at = 0x20; +if (s0 != at) {s1 = s1 + 0x1; +goto L431410;} +s1 = s1 + 0x1; +if (s7 == 0) {//nop; +goto L43146c;} +//nop; +//nop; +a0 = 0x20; +a1 = 0xc; +f_emit_dir0(mem, sp, a0, a1); +goto L431464; +a1 = 0xc; +L431464: +gp = MEM_U32(sp + 204); +//nop; +L43146c: +t4 = 0x10018e80; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L4314d0;} +//nop; +t5 = MEM_U8(s6 + 33); +at = 0xe; +t3 = t5 & 0x1f; +if (t3 != at) {//nop; +goto L4314d0;} +//nop; +s1 = MEM_U32(s6 + 40); +a0 = 0x4f; +at = (int)s1 < (int)0x4; +if (at == 0) {//nop; +goto L4314d0;} +//nop; +//nop; +t7 = s1 << 3; +t0 = 0x20; +a2 = t0 - t7; +a1 = fp; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L4314c8; +a3 = zero; +L4314c8: +gp = MEM_U32(sp + 204); +//nop; +L4314d0: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L4314e4: +s0 = MEM_U32(s6 + 4); +at = 0x18; +t6 = MEM_U8(s0 + 32); +//nop; +if (t6 != at) {//nop; +goto L431570;} +//nop; +v0 = MEM_U8(s0 + 33); +at = 0x6; +t9 = v0 & 0x1f; +if (t9 == at) {at = 0x5; +goto L431530;} +at = 0x5; +if (t9 != at) {//nop; +goto L431570;} +//nop; +t2 = 0x10018ecc; +at = 0x1; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 != at) {//nop; +goto L431570;} +//nop; +L431530: +t8 = MEM_U8(s0 + 40); +at = 0xc; +if (t8 != at) {//nop; +goto L431570;} +//nop; +t1 = MEM_U16(s0 + 20); +at = 0x1; +if (t1 != at) {//nop; +goto L431570;} +//nop; +t4 = MEM_U32(s6 + 40); +at = 0x4; +if (t4 != at) {//nop; +goto L431570;} +//nop; +t5 = MEM_U32(s0 + 16); +at = 0x10004b70; +t3 = t5 >> 8; +MEM_U32(at + 0) = t3; +L431570: +//nop; +a0 = s0; +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L431580; +a1 = 0x48; +L431580: +s7 = MEM_U16(s6 + 34); +s2 = MEM_U32(s6 + 0); +t0 = s7 & 0x1; +t9 = MEM_U16(s2 + 20); +gp = MEM_U32(sp + 204); +t7 = zero < t0; +at = 0x1; +if (t9 != at) {s7 = t7 & 0xff; +goto L431a24;} +s7 = t7 & 0xff; +t2 = 0x10018ed8; +//nop; +t2 = MEM_U32(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L431a24;} +//nop; +t8 = MEM_U8(s2 + 32); +at = 0x1; +if (t8 != at) {//nop; +goto L431a24;} +//nop; +v1 = MEM_U32(s2 + 4); +at = 0x1; +t1 = MEM_U16(v1 + 20); +//nop; +if (t1 != at) {//nop; +goto L431a24;} +//nop; +t4 = MEM_U8(v1 + 32); +at = 0x47; +if (t4 != at) {//nop; +goto L431a24;} +//nop; +t5 = MEM_U8(v1 + 33); +at = 0x68000000; +t3 = t5 << 24; +t0 = t3 >> 29; +t7 = t0 < 0x20; +t6 = -t7; +t9 = t6 & at; +t2 = t9 << (t0 & 0x1f); +if ((int)t2 >= 0) {//nop; +goto L431a24;} +//nop; +//nop; +a0 = MEM_U32(v1 + 36); +//nop; +v0 = f_get_sym_kind(mem, sp, a0); +goto L43162c; +//nop; +L43162c: +gp = MEM_U32(sp + 204); +at = 0x5; +if (v0 == at) {//nop; +goto L431a24;} +//nop; +t8 = MEM_U32(s2 + 4); +at = 0x4; +t1 = MEM_U8(t8 + 33); +//nop; +t4 = t1 << 24; +t5 = t4 >> 29; +if (t5 != at) {//nop; +goto L431814;} +//nop; +//nop; +a0 = MEM_U32(s2 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L43166c; +a1 = 0x48; +L43166c: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 4); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L431684; +//nop; +L431684: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)v0; +t3 = 0x10018e80; +//nop; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 != 0) {//nop; +goto L43172c;} +//nop; +t7 = MEM_U8(s6 + 33); +at = 0xe; +t6 = t7 & 0x1f; +if (t6 != at) {//nop; +goto L43172c;} +//nop; +t9 = MEM_U32(s6 + 40); +//nop; +at = (int)t9 < (int)0x4; +if (at == 0) {//nop; +goto L43172c;} +//nop; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L4316dc; +a1 = 0x1; +L4316dc: +gp = MEM_U32(sp + 204); +t0 = MEM_U32(s6 + 40); +//nop; +a2 = MEM_U8(sp + 318); +t8 = 0x20; +t2 = t0 << 3; +s4 = v0 & 0xff; +a3 = t8 - t2; +a0 = 0x54; +a1 = v0 & 0xff; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L43170c; +MEM_U32(sp + 16) = zero; +L43170c: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)s4; +//nop; +a0 = s4; +//nop; +f_free_reg(mem, sp, a0); +goto L431724; +//nop; +L431724: +gp = MEM_U32(sp + 204); +//nop; +L43172c: +//nop; +a0 = MEM_U32(s2 + 0); +//nop; +v0 = f_reg(mem, sp, a0); +goto L43173c; +//nop; +L43173c: +gp = MEM_U32(sp + 204); +if (s7 == 0) {s3 = v0 & 0xff; +goto L431760;} +s3 = v0 & 0xff; +//nop; +a0 = 0x20; +a1 = 0xb; +f_emit_dir0(mem, sp, a0, a1); +goto L431758; +a1 = 0xb; +L431758: +gp = MEM_U32(sp + 204); +//nop; +L431760: +s0 = MEM_U32(s6 + 4); +t5 = 0x10004b70; +t1 = MEM_U32(s0 + 16); +t5 = MEM_U32(t5 + 0); +t4 = t1 >> 8; +if (t4 != t5) {//nop; +goto L4317a0;} +//nop; +t3 = MEM_U8(s0 + 33); +at = 0x6; +t7 = t3 & 0x1f; +if (t7 != at) {//nop; +goto L431798;} +//nop; +s5 = 0x33; +goto L4317bc; +s5 = 0x33; +L431798: +s5 = 0x73; +goto L4317bc; +s5 = 0x73; +L4317a0: +//nop; +a0 = 0x100032ec; +a2 = MEM_U8(sp + 318); +a1 = s6; +v0 = f_lsopc(mem, sp, a0, a1, a2); +goto L4317b4; +a1 = s6; +L4317b4: +gp = MEM_U32(sp + 204); +s5 = v0 & 0xffff; +L4317bc: +v1 = MEM_U32(s2 + 4); +t6 = MEM_U32(s6 + 44); +t9 = MEM_U32(v1 + 44); +t0 = MEM_U32(v1 + 36); +a3 = t6 + t9; +//nop; +a2 = MEM_U8(sp + 318); +a0 = s6; +a1 = s5; +MEM_U32(sp + 20) = s3; +MEM_U32(sp + 16) = t0; +f_iloadistore(mem, sp, a0, a1, a2, a3); +goto L4317ec; +MEM_U32(sp + 16) = t0; +L4317ec: +gp = MEM_U32(sp + 204); +if (s7 == 0) {//nop; +goto L431cf0;} +//nop; +//nop; +a0 = 0x20; +a1 = 0xc; +f_emit_dir0(mem, sp, a0, a1); +goto L431808; +a1 = 0xc; +L431808: +gp = MEM_U32(sp + 204); +//nop; +goto L431cf0; +//nop; +L431814: +//nop; +a0 = MEM_U32(s2 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L431824; +a1 = 0x48; +L431824: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 4); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L43183c; +//nop; +L43183c: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)v0; +t8 = 0x10018e80; +//nop; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L4318e4;} +//nop; +t2 = MEM_U8(s6 + 33); +at = 0xe; +t1 = t2 & 0x1f; +if (t1 != at) {//nop; +goto L4318e4;} +//nop; +t4 = MEM_U32(s6 + 40); +//nop; +at = (int)t4 < (int)0x4; +if (at == 0) {//nop; +goto L4318e4;} +//nop; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L431894; +a1 = 0x1; +L431894: +gp = MEM_U32(sp + 204); +t5 = MEM_U32(s6 + 40); +//nop; +a2 = MEM_U8(sp + 318); +t7 = 0x20; +t3 = t5 << 3; +s4 = v0 & 0xff; +a3 = t7 - t3; +a0 = 0x54; +a1 = v0 & 0xff; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4318c4; +MEM_U32(sp + 16) = zero; +L4318c4: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)s4; +//nop; +a0 = s4; +//nop; +f_free_reg(mem, sp, a0); +goto L4318dc; +//nop; +L4318dc: +gp = MEM_U32(sp + 204); +//nop; +L4318e4: +//nop; +a0 = MEM_U32(s2 + 0); +//nop; +v0 = f_reg(mem, sp, a0); +goto L4318f4; +//nop; +L4318f4: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L43190c; +a1 = 0x1; +L43190c: +gp = MEM_U32(sp + 204); +s4 = v0 & 0xff; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L431924; +//nop; +L431924: +gp = MEM_U32(sp + 204); +if (s7 == 0) {//nop; +goto L431948;} +//nop; +//nop; +a0 = 0x20; +a1 = 0xb; +f_emit_dir0(mem, sp, a0, a1); +goto L431940; +a1 = 0xb; +L431940: +gp = MEM_U32(sp + 204); +//nop; +L431948: +a2 = 0x10019380; +//nop; +a2 = MEM_U8(a2 + 0); +a0 = 0x2; +a1 = s4; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L431964; +a3 = s3; +L431964: +gp = MEM_U32(sp + 204); +s0 = MEM_U32(s6 + 4); +t0 = 0x10004b70; +t6 = MEM_U32(s0 + 16); +t0 = MEM_U32(t0 + 0); +t9 = t6 >> 8; +if (t9 != t0) {//nop; +goto L4319a8;} +//nop; +t8 = MEM_U8(s0 + 33); +at = 0x6; +t2 = t8 & 0x1f; +if (t2 != at) {//nop; +goto L4319a0;} +//nop; +s5 = 0x33; +goto L4319c4; +s5 = 0x33; +L4319a0: +s5 = 0x73; +goto L4319c4; +s5 = 0x73; +L4319a8: +//nop; +a0 = 0x100032ec; +a2 = MEM_U8(sp + 318); +a1 = s6; +v0 = f_lsopc(mem, sp, a0, a1, a2); +goto L4319bc; +a1 = s6; +L4319bc: +gp = MEM_U32(sp + 204); +s5 = v0 & 0xffff; +L4319c4: +//nop; +a0 = MEM_U32(s2 + 4); +//nop; +v0 = f_frame_offset(mem, sp, a0); +goto L4319d4; +//nop; +L4319d4: +gp = MEM_U32(sp + 204); +t1 = MEM_U32(s6 + 44); +//nop; +a2 = MEM_U8(sp + 318); +a0 = s6; +a1 = s5; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 20) = s4; +a3 = t1 + v0; +f_iloadistore(mem, sp, a0, a1, a2, a3); +goto L4319fc; +a3 = t1 + v0; +L4319fc: +gp = MEM_U32(sp + 204); +if (s7 == 0) {//nop; +goto L431cf0;} +//nop; +//nop; +a0 = 0x20; +a1 = 0xc; +f_emit_dir0(mem, sp, a0, a1); +goto L431a18; +a1 = 0xc; +L431a18: +gp = MEM_U32(sp + 204); +//nop; +goto L431cf0; +//nop; +L431a24: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L431a34; +a1 = 0x48; +L431a34: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 4); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L431a4c; +//nop; +L431a4c: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)v0; +t4 = 0x10018e80; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L431af4;} +//nop; +t5 = MEM_U8(s6 + 33); +at = 0xe; +t7 = t5 & 0x1f; +if (t7 != at) {//nop; +goto L431af4;} +//nop; +t3 = MEM_U32(s6 + 40); +//nop; +at = (int)t3 < (int)0x4; +if (at == 0) {//nop; +goto L431af4;} +//nop; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L431aa4; +a1 = 0x1; +L431aa4: +t6 = MEM_U32(s6 + 40); +gp = MEM_U32(sp + 204); +t0 = 0x20; +t9 = t6 << 3; +a3 = t0 - t9; +//nop; +a2 = MEM_U8(sp + 318); +s4 = v0 & 0xff; +a0 = 0x54; +a1 = v0 & 0xff; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L431ad4; +MEM_U32(sp + 16) = zero; +L431ad4: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)s4; +//nop; +a0 = s4; +//nop; +f_free_reg(mem, sp, a0); +goto L431aec; +//nop; +L431aec: +gp = MEM_U32(sp + 204); +//nop; +L431af4: +//nop; +a0 = MEM_U32(s6 + 0); +//nop; +v0 = f_reg(mem, sp, a0); +goto L431b04; +//nop; +L431b04: +gp = MEM_U32(sp + 204); +if (s7 == 0) {s3 = v0 & 0xff; +goto L431b28;} +s3 = v0 & 0xff; +//nop; +a0 = 0x20; +a1 = 0xb; +f_emit_dir0(mem, sp, a0, a1); +goto L431b20; +a1 = 0xb; +L431b20: +gp = MEM_U32(sp + 204); +//nop; +L431b28: +t8 = MEM_U8(s6 + 32); +at = 0x3f; +if (t8 != at) {//nop; +goto L431c04;} +//nop; +t2 = MEM_U8(s2 + 32); +at = 0x1; +if (t2 != at) {//nop; +goto L431c04;} +//nop; +s1 = MEM_U32(s2 + 0); +at = 0x5b; +v0 = MEM_U8(s1 + 32); +//nop; +if (v0 != at) {at = 0x52; +goto L431b74;} +at = 0x52; +s1 = MEM_U32(s1 + 0); +//nop; +v0 = MEM_U8(s1 + 32); +//nop; +at = 0x52; +L431b74: +if (v0 != at) {//nop; +goto L431c04;} +//nop; +s2 = 0x10019bb0; +s0 = 0x1; +s2 = s2 + 0x4; +L431b88: +t1 = MEM_U8(s1 + 25); +v0 = MEM_U32(s2 + 0); +t4 = t1 << 24; +t5 = t4 >> 25; +t7 = 0x1; +t3 = t7 << (t5 & 0x1f); +t6 = v0 & t3; +if (t6 == 0) {//nop; +goto L431bf4;} +//nop; +t9 = 0x10019bb0; +t0 = s3 << 2; +t8 = t0 + t9; +t2 = MEM_U32(t8 + 0); +t4 = 0x1; +t1 = t2 & v0; +if (t1 != 0) {//nop; +goto L431bf4;} +//nop; +t7 = 0x10019ce0; +a0 = 0x30; +t5 = s0 + t7; +MEM_U8(t5 + 0) = (uint8_t)t4; +//nop; +a1 = s3; +a2 = s0; +f_emit_alias(mem, sp, a0, a1, a2); +goto L431bec; +a2 = s0; +L431bec: +gp = MEM_U32(sp + 204); +//nop; +L431bf4: +s0 = s0 + 0x1; +at = 0x20; +if (s0 != at) {s2 = s2 + 0x4; +goto L431b88;} +s2 = s2 + 0x4; +L431c04: +s0 = MEM_U32(s6 + 4); +t0 = 0x10004b70; +t3 = MEM_U32(s0 + 16); +t0 = MEM_U32(t0 + 0); +t6 = t3 >> 8; +if (t6 != t0) {//nop; +goto L431c44;} +//nop; +t9 = MEM_U8(s0 + 33); +at = 0x6; +t8 = t9 & 0x1f; +if (t8 != at) {//nop; +goto L431c3c;} +//nop; +s5 = 0x33; +goto L431c60; +s5 = 0x33; +L431c3c: +s5 = 0x73; +goto L431c60; +s5 = 0x73; +L431c44: +//nop; +a0 = 0x100032ec; +a2 = MEM_U8(sp + 318); +a1 = s6; +v0 = f_lsopc(mem, sp, a0, a1, a2); +goto L431c58; +a1 = s6; +L431c58: +gp = MEM_U32(sp + 204); +s5 = v0 & 0xffff; +L431c60: +//nop; +a2 = MEM_U8(sp + 318); +a3 = MEM_U32(s6 + 44); +a0 = s6; +a1 = s5; +MEM_U32(sp + 16) = zero; +MEM_U32(sp + 20) = s3; +f_iloadistore(mem, sp, a0, a1, a2, a3); +goto L431c80; +MEM_U32(sp + 20) = s3; +L431c80: +gp = MEM_U32(sp + 204); +s0 = 0x1; +s1 = 0x10019ce0; +//nop; +s1 = s1 + 0x1; +L431c94: +t2 = MEM_U8(s1 + 0); +a0 = 0x31; +if (t2 == 0) {//nop; +goto L431cc0;} +//nop; +MEM_U8(s1 + 0) = (uint8_t)zero; +//nop; +a1 = s3; +a2 = s0; +f_emit_alias(mem, sp, a0, a1, a2); +goto L431cb8; +a2 = s0; +L431cb8: +gp = MEM_U32(sp + 204); +//nop; +L431cc0: +s0 = s0 + 0x1; +at = 0x20; +if (s0 != at) {s1 = s1 + 0x1; +goto L431c94;} +s1 = s1 + 0x1; +if (s7 == 0) {//nop; +goto L431cf0;} +//nop; +//nop; +a0 = 0x20; +a1 = 0xc; +f_emit_dir0(mem, sp, a0, a1); +goto L431ce8; +a1 = 0xc; +L431ce8: +gp = MEM_U32(sp + 204); +//nop; +L431cf0: +a0 = 0x10018ed4; +at = 0x10004b70; +t1 = 0xffffffff; +a0 = MEM_U8(a0 + 0); +MEM_U32(at + 0) = t1; +goto L434d7c; +MEM_U32(at + 0) = t1; +L431d08: +s0 = MEM_U32(s6 + 4); +at = 0x18; +t7 = MEM_U8(s0 + 32); +//nop; +if (t7 != at) {//nop; +goto L431d94;} +//nop; +v0 = MEM_U8(s0 + 33); +at = 0x6; +t4 = v0 & 0x1f; +if (t4 == at) {at = 0x5; +goto L431d54;} +at = 0x5; +if (t4 != at) {//nop; +goto L431d94;} +//nop; +t5 = 0x10018ecc; +at = 0x1; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L431d94;} +//nop; +L431d54: +t3 = MEM_U8(s0 + 40); +at = 0xc; +if (t3 != at) {//nop; +goto L431d94;} +//nop; +t6 = MEM_U16(s0 + 20); +at = 0x1; +if (t6 != at) {//nop; +goto L431d94;} +//nop; +t0 = MEM_U32(s6 + 40); +at = 0x4; +if (t0 != at) {//nop; +goto L431d94;} +//nop; +t9 = MEM_U32(s0 + 16); +at = 0x10004b70; +t8 = t9 >> 8; +MEM_U32(at + 0) = t8; +L431d94: +//nop; +a0 = s0; +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L431da4; +a1 = 0x48; +L431da4: +gp = MEM_U32(sp + 204); +s7 = MEM_U16(s6 + 34); +a0 = MEM_U32(s6 + 0); +//nop; +t2 = s7 & 0x1; +t1 = zero < t2; +s7 = t1 & 0xff; +a1 = 0x48; +s2 = a0; +f_eval(mem, sp, a0, a1); +goto L431dcc; +s2 = a0; +L431dcc: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 4); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L431de4; +//nop; +L431de4: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)v0; +t4 = 0x10018e80; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L431e8c;} +//nop; +t5 = MEM_U8(s6 + 33); +at = 0xe; +t3 = t5 & 0x1f; +if (t3 != at) {//nop; +goto L431e8c;} +//nop; +t6 = MEM_U32(s6 + 40); +//nop; +at = (int)t6 < (int)0x4; +if (at == 0) {//nop; +goto L431e8c;} +//nop; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L431e3c; +a1 = 0x1; +L431e3c: +t0 = MEM_U32(s6 + 40); +gp = MEM_U32(sp + 204); +t8 = 0x20; +t9 = t0 << 3; +a3 = t8 - t9; +//nop; +a2 = MEM_U8(sp + 318); +s4 = v0 & 0xff; +a0 = 0x54; +a1 = v0 & 0xff; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L431e6c; +MEM_U32(sp + 16) = zero; +L431e6c: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)s4; +//nop; +a0 = s4; +//nop; +f_free_reg(mem, sp, a0); +goto L431e84; +//nop; +L431e84: +gp = MEM_U32(sp + 204); +//nop; +L431e8c: +//nop; +a0 = MEM_U32(s6 + 0); +//nop; +v0 = f_reg(mem, sp, a0); +goto L431e9c; +//nop; +L431e9c: +gp = MEM_U32(sp + 204); +if (s7 == 0) {s3 = v0 & 0xff; +goto L431ec0;} +s3 = v0 & 0xff; +//nop; +a0 = 0x20; +a1 = 0xb; +f_emit_dir0(mem, sp, a0, a1); +goto L431eb8; +a1 = 0xb; +L431eb8: +gp = MEM_U32(sp + 204); +//nop; +L431ec0: +t2 = MEM_U8(s2 + 32); +at = 0x1; +if (t2 != at) {//nop; +goto L431f8c;} +//nop; +s1 = MEM_U32(s2 + 0); +at = 0x5b; +v0 = MEM_U8(s1 + 32); +//nop; +if (v0 != at) {at = 0x52; +goto L431efc;} +at = 0x52; +s1 = MEM_U32(s1 + 0); +//nop; +v0 = MEM_U8(s1 + 32); +//nop; +at = 0x52; +L431efc: +if (v0 != at) {//nop; +goto L431f8c;} +//nop; +s2 = 0x10019bb0; +s0 = 0x1; +s2 = s2 + 0x4; +L431f10: +t1 = MEM_U8(s1 + 25); +v0 = MEM_U32(s2 + 0); +t7 = t1 << 24; +t4 = t7 >> 25; +t5 = 0x1; +t3 = t5 << (t4 & 0x1f); +t6 = v0 & t3; +if (t6 == 0) {//nop; +goto L431f7c;} +//nop; +t8 = 0x10019bb0; +t0 = s3 << 2; +t9 = t0 + t8; +t2 = MEM_U32(t9 + 0); +t7 = 0x1; +t1 = t2 & v0; +if (t1 != 0) {//nop; +goto L431f7c;} +//nop; +t5 = 0x10019ce0; +a0 = 0x30; +t4 = s0 + t5; +MEM_U8(t4 + 0) = (uint8_t)t7; +//nop; +a1 = s3; +a2 = s0; +f_emit_alias(mem, sp, a0, a1, a2); +goto L431f74; +a2 = s0; +L431f74: +gp = MEM_U32(sp + 204); +//nop; +L431f7c: +s0 = s0 + 0x1; +at = 0x20; +if (s0 != at) {s2 = s2 + 0x4; +goto L431f10;} +s2 = s2 + 0x4; +L431f8c: +s0 = MEM_U32(s6 + 4); +t0 = 0x10004b70; +t3 = MEM_U32(s0 + 16); +t0 = MEM_U32(t0 + 0); +t6 = t3 >> 8; +if (t6 != t0) {//nop; +goto L431fcc;} +//nop; +t8 = MEM_U8(s0 + 33); +at = 0x6; +t9 = t8 & 0x1f; +if (t9 != at) {//nop; +goto L431fc4;} +//nop; +s5 = 0x33; +goto L431fe8; +s5 = 0x33; +L431fc4: +s5 = 0x73; +goto L431fe8; +s5 = 0x73; +L431fcc: +//nop; +a0 = 0x100032ec; +a2 = MEM_U8(sp + 318); +a1 = s6; +v0 = f_lsopc(mem, sp, a0, a1, a2); +goto L431fe0; +a1 = s6; +L431fe0: +gp = MEM_U32(sp + 204); +s5 = v0 & 0xffff; +L431fe8: +//nop; +a2 = MEM_U8(sp + 318); +a3 = MEM_U32(s6 + 36); +a0 = s6; +a1 = s5; +MEM_U32(sp + 16) = s3; +f_rloadrstore(mem, sp, a0, a1, a2, a3); +goto L432004; +MEM_U32(sp + 16) = s3; +L432004: +gp = MEM_U32(sp + 204); +s0 = 0x1; +s1 = 0x10019ce0; +//nop; +s1 = s1 + 0x1; +L432018: +t2 = MEM_U8(s1 + 0); +a0 = 0x31; +if (t2 == 0) {//nop; +goto L432044;} +//nop; +MEM_U8(s1 + 0) = (uint8_t)zero; +//nop; +a1 = s3; +a2 = s0; +f_emit_alias(mem, sp, a0, a1, a2); +goto L43203c; +a2 = s0; +L43203c: +gp = MEM_U32(sp + 204); +//nop; +L432044: +s0 = s0 + 0x1; +at = 0x20; +if (s0 != at) {s1 = s1 + 0x1; +goto L432018;} +s1 = s1 + 0x1; +if (s7 == 0) {//nop; +goto L432074;} +//nop; +//nop; +a0 = 0x20; +a1 = 0xc; +f_emit_dir0(mem, sp, a0, a1); +goto L43206c; +a1 = 0xc; +L43206c: +gp = MEM_U32(sp + 204); +//nop; +L432074: +a0 = 0x10018ed4; +at = 0x10004b70; +t1 = 0xffffffff; +a0 = MEM_U8(a0 + 0); +MEM_U32(at + 0) = t1; +goto L434d7c; +MEM_U32(at + 0) = t1; +L43208c: +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L43209c; +a1 = fp; +L43209c: +a0 = MEM_U8(s6 + 33); +gp = MEM_U32(sp + 204); +t5 = a0 << 24; +t7 = t5 >> 29; +t4 = t7 & 0xff; +t3 = t4 + 0xffffffff; +at = t3 < 0x4; +fp = v0 & 0xff; +if (at == 0) {a0 = t4; +goto L43236c;} +a0 = t4; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10009914[] = { +&&L4320e4, +&&L4320e4, +&&L43236c, +&&L43230c, +}; +dest = Lswitch10009914[t3]; +//nop; +goto *dest; +//nop; +L4320e4: +//nop; +a0 = MEM_U32(s6 + 36); +//nop; +v0 = f_get_sym_kind(mem, sp, a0); +goto L4320f4; +//nop; +L4320f4: +gp = MEM_U32(sp + 204); +at = 0x5; +if (v0 != at) {//nop; +goto L4321ac;} +//nop; +t6 = 0x10018ed0; +at = 0x1; +t6 = MEM_U8(t6 + 0); +a1 = fp; +if (t6 != at) {a0 = 0x56; +goto L432164;} +a0 = 0x56; +a2 = 0x10019380; +//nop; +a3 = MEM_U32(s6 + 36); +a2 = MEM_U8(a2 + 0); +a0 = 0x139; +f_emit_rrri(mem, sp, a0, a1, a2, a3); +goto L432134; +a0 = 0x139; +L432134: +a3 = MEM_U32(s6 + 44); +gp = MEM_U32(sp + 204); +if (a3 == 0) {a0 = 0x137; +goto L432478;} +a0 = 0x137; +//nop; +a1 = fp; +a2 = fp; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L432158; +MEM_U32(sp + 16) = zero; +L432158: +gp = MEM_U32(sp + 204); +//nop; +goto L432478; +//nop; +L432164: +a2 = 0x10019380; +//nop; +a3 = MEM_U32(s6 + 36); +a2 = MEM_U8(a2 + 0); +a1 = fp; +f_emit_rrri(mem, sp, a0, a1, a2, a3); +goto L43217c; +a1 = fp; +L43217c: +a3 = MEM_U32(s6 + 44); +gp = MEM_U32(sp + 204); +if (a3 == 0) {a0 = 0x2; +goto L432478;} +a0 = 0x2; +//nop; +a1 = fp; +a2 = fp; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4321a0; +MEM_U32(sp + 16) = zero; +L4321a0: +gp = MEM_U32(sp + 204); +//nop; +goto L432478; +//nop; +L4321ac: +t0 = MEM_U8(s6 + 33); +at = 0x2; +t8 = t0 << 24; +t9 = t8 >> 29; +if (t9 != at) {//nop; +goto L432274;} +//nop; +t2 = 0x10018ee8; +//nop; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L432274;} +//nop; +t1 = 0x10018ed0; +at = 0x1; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 != at) {//nop; +goto L432234;} +//nop; +//nop; +a0 = s6; +//nop; +v0 = f_frame_offset(mem, sp, a0); +goto L432204; +//nop; +L432204: +gp = MEM_U32(sp + 204); +a0 = 0x137; +a2 = 0x10019380; +//nop; +a2 = MEM_U8(a2 + 0); +a1 = fp; +a3 = v0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L432228; +MEM_U32(sp + 16) = zero; +L432228: +gp = MEM_U32(sp + 204); +//nop; +goto L432478; +//nop; +L432234: +//nop; +a0 = s6; +//nop; +v0 = f_frame_offset(mem, sp, a0); +goto L432244; +//nop; +L432244: +gp = MEM_U32(sp + 204); +a0 = 0x2; +a2 = 0x10019380; +//nop; +a2 = MEM_U8(a2 + 0); +a1 = fp; +a3 = v0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L432268; +MEM_U32(sp + 16) = zero; +L432268: +gp = MEM_U32(sp + 204); +//nop; +goto L432478; +//nop; +L432274: +t5 = 0x10018ed0; +at = 0x1; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L4322cc;} +//nop; +//nop; +a0 = s6; +//nop; +v0 = f_frame_offset(mem, sp, a0); +goto L43229c; +//nop; +L43229c: +gp = MEM_U32(sp + 204); +a0 = 0x137; +a2 = 0x10019380; +//nop; +a2 = MEM_U8(a2 + 0); +a1 = fp; +a3 = v0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4322c0; +MEM_U32(sp + 16) = zero; +L4322c0: +gp = MEM_U32(sp + 204); +//nop; +goto L432478; +//nop; +L4322cc: +//nop; +a0 = s6; +//nop; +v0 = f_frame_offset(mem, sp, a0); +goto L4322dc; +//nop; +L4322dc: +gp = MEM_U32(sp + 204); +a0 = 0x2; +a2 = 0x10019380; +//nop; +a2 = MEM_U8(a2 + 0); +a1 = fp; +a3 = v0; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L432300; +MEM_U32(sp + 16) = zero; +L432300: +gp = MEM_U32(sp + 204); +//nop; +goto L432478; +//nop; +L43230c: +t7 = 0x10018ed0; +at = 0x1; +t7 = MEM_U8(t7 + 0); +a0 = 0x24; +if (t7 != at) {a1 = fp; +goto L43234c;} +a1 = fp; +//nop; +a2 = MEM_U32(s6 + 36); +a3 = MEM_U32(s6 + 44); +a0 = 0x14d; +a1 = fp; +MEM_U32(sp + 16) = zero; +f_emit_ra(mem, sp, a0, a1, a2, a3); +goto L432340; +MEM_U32(sp + 16) = zero; +L432340: +gp = MEM_U32(sp + 204); +//nop; +goto L432478; +//nop; +L43234c: +//nop; +a2 = MEM_U32(s6 + 36); +a3 = MEM_U32(s6 + 44); +MEM_U32(sp + 16) = zero; +f_emit_ra(mem, sp, a0, a1, a2, a3); +goto L432360; +MEM_U32(sp + 16) = zero; +L432360: +gp = MEM_U32(sp + 204); +//nop; +goto L432478; +//nop; +L43236c: +t4 = 0x100097da; +a0 = 0x4; +t4 = t4; +t6 = t4 + 0x48; +a1 = 0x146e; +t0 = sp; +L432384: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t0 = t0 + 0xc; +MEM_U8(t0 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t0) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t0 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 4 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 7($t0) +goto L432384;} +//swr $at, 7($t0) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t8 = 0x1000978a; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +t8 = t8; +MEM_U8(t0 + 12 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t0 + 12 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t0 + 12 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t0 + 12 + 3) = (uint8_t)(t6 >> 0); +t2 = t8 + 0x48; +t1 = sp; +//swr $t6, 0xf($t0) +L4323f4: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t1 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t1) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t1 = t1 + 0xc; +MEM_U8(t1 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t1) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t1 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 84 + 3) = (uint8_t)(at >> 0); +if (t8 != t2) {//swr $at, 0x57($t1) +goto L4323f4;} +//swr $at, 0x57($t1) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +//nop; +MEM_U8(t1 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t1) +t2 = t8 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t8) +//nop; +MEM_U8(t1 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t1 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t1 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t1 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t1) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L432470; +//nop; +L432470: +gp = MEM_U32(sp + 204); +//nop; +L432478: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L43248c: +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L43249c; +//nop; +L43249c: +gp = MEM_U32(sp + 204); +a0 = s6 + 0x20; +//nop; +a1 = v0; +//nop; +v0 = f_add_to_pool(mem, sp, a0, a1); +goto L4324b4; +//nop; +L4324b4: +gp = MEM_U32(sp + 204); +s0 = v0; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L4324cc; +a1 = fp; +L4324cc: +gp = MEM_U32(sp + 204); +fp = v0 & 0xff; +//nop; +a0 = 0x24; +a1 = v0 & 0xff; +a2 = s0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L4324e8; +a2 = s0; +L4324e8: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L432504: +//nop; +a0 = s6; +//nop; +v0 = f_uop_to_asm(mem, sp, a0); +goto L432514; +//nop; +L432514: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +s5 = v0 & 0xffff; +a1 = fp; +f_eval(mem, sp, a0, a1); +goto L43252c; +a1 = fp; +L43252c: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L432544; +//nop; +L432544: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L43255c; +a1 = fp; +L43255c: +gp = MEM_U32(sp + 204); +fp = v0 & 0xff; +//nop; +a0 = s5; +a1 = v0 & 0xff; +a2 = s3; +a3 = zero; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L432580; +MEM_U32(sp + 16) = zero; +L432580: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L43259c: +//nop; +a0 = s6; +//nop; +v0 = f_uop_to_asm(mem, sp, a0); +goto L4325ac; +//nop; +L4325ac: +a2 = MEM_U32(s6 + 0); +gp = MEM_U32(sp + 204); +t5 = MEM_U8(a2 + 32); +at = 0x3c; +if (t5 != at) {s5 = v0 & 0xffff; +goto L432690;} +s5 = v0 & 0xffff; +t7 = 0x10019350; +at = 0x2; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != at) {//nop; +goto L432690;} +//nop; +t3 = MEM_U16(a2 + 20); +at = 0x1; +if (t3 != at) {//nop; +goto L432690;} +//nop; +at = 0x10004b6c; +t6 = 0x1; +MEM_U8(at + 0) = (uint8_t)t6; +t4 = MEM_U16(s6 + 20); +//nop; +MEM_U16(a2 + 20) = (uint16_t)t4; +a0 = MEM_U32(s6 + 0); +a1 = fp; +f_eval(mem, sp, a0, a1); +goto L432610; +a1 = fp; +L432610: +t0 = MEM_U32(s6 + 0); +v1 = MEM_U8(s6 + 25); +t9 = MEM_U8(t0 + 25); +t1 = v1 << 24; +t2 = t9 << 24; +t8 = t2 >> 25; +t5 = t1 >> 25; +t7 = t8 ^ t5; +t3 = t7 << 25; +t6 = t3 >> 24; +s0 = t6 ^ v1; +t0 = s0 << 24; +t9 = t0 >> 25; +gp = MEM_U32(sp + 204); +t2 = t9 << 2; +t1 = 0x10019830; +MEM_U8(s6 + 25) = (uint8_t)s0; +t2 = t2 - t9; +t2 = t2 << 2; +s0 = t9; +a0 = t9; +//nop; +t8 = t2 + t1; +a3 = MEM_U8(t8 + 8); +a2 = MEM_U16(s6 + 20); +a1 = s6; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43267c; +a1 = s6; +L43267c: +t7 = MEM_U32(s6 + 0); +gp = MEM_U32(sp + 204); +t5 = 0x1; +MEM_U16(t7 + 20) = (uint16_t)t5; +goto L4326f8; +MEM_U16(t7 + 20) = (uint16_t)t5; +L432690: +//nop; +a0 = a2; +a1 = fp; +f_eval(mem, sp, a0, a1); +goto L4326a0; +a1 = fp; +L4326a0: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L4326b8; +//nop; +L4326b8: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L4326d0; +a1 = fp; +L4326d0: +gp = MEM_U32(sp + 204); +fp = v0 & 0xff; +//nop; +a0 = s5; +a1 = v0 & 0xff; +a2 = s3; +a3 = s6; +f_dw_emit_rr(mem, sp, a0, a1, a2, a3); +goto L4326f0; +a3 = s6; +L4326f0: +gp = MEM_U32(sp + 204); +//nop; +L4326f8: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L43270c: +t3 = MEM_U8(s6 + 33); +//nop; +a0 = s6; +s0 = t3 & 0x1f; +v0 = f_uop_to_asm(mem, sp, a0); +goto L432720; +s0 = t3 & 0x1f; +L432720: +t4 = s0 < 0x20; +at = 0xc0000; +at = at | 0x8000; +t0 = -t4; +t9 = t0 & at; +gp = MEM_U32(sp + 204); +t2 = t9 << (s0 & 0x1f); +if ((int)t2 >= 0) {s5 = v0 & 0xffff; +goto L432760;} +s5 = v0 & 0xffff; +t1 = fp + 0xffffffe0; +t8 = t1 < 0x20; +t5 = -t8; +t7 = t5 << (t1 & 0x1f); +if ((int)t7 < 0) {//nop; +goto L432760;} +//nop; +fp = 0x48; +L432760: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = fp; +f_eval(mem, sp, a0, a1); +goto L432770; +a1 = fp; +L432770: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L432788; +//nop; +L432788: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L4327a0; +a1 = fp; +L4327a0: +a3 = MEM_U8(s6 + 33); +gp = MEM_U32(sp + 204); +at = 0x6; +t3 = a3 & 0x1f; +fp = v0 & 0xff; +if (t3 == at) {a3 = t3; +goto L4327c8;} +a3 = t3; +at = 0x8; +if (t3 != at) {//nop; +goto L43285c;} +//nop; +L4327c8: +t6 = MEM_U8(s6 + 32); +a0 = fp; +if (t6 != 0) {//nop; +goto L43285c;} +//nop; +//nop; +a1 = s3; +a2 = a3; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L4327e8; +a2 = a3; +L4327e8: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L432800; +//nop; +L432800: +gp = MEM_U32(sp + 204); +s7 = v0; +//nop; +a0 = 0x10; +a1 = s3; +a2 = v0; +f_emit_rll(mem, sp, a0, a1, a2); +goto L43281c; +a2 = v0; +L43281c: +gp = MEM_U32(sp + 204); +a0 = 0x56; +//nop; +a1 = fp; +a2 = zero; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L432838; +a3 = s3; +L432838: +gp = MEM_U32(sp + 204); +a0 = s7; +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L432850; +//nop; +L432850: +gp = MEM_U32(sp + 204); +//nop; +goto L43287c; +//nop; +L43285c: +//nop; +a0 = s5; +a1 = fp; +a2 = s3; +a3 = s6; +f_dw_emit_rr(mem, sp, a0, a1, a2, a3); +goto L432874; +a3 = s6; +L432874: +gp = MEM_U32(sp + 204); +//nop; +L43287c: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L432890: +t4 = MEM_U8(s6 + 33); +at = 0xc0000; +s0 = t4 & 0x1f; +t9 = s0 < 0x20; +t2 = -t9; +at = at | 0x8000; +t8 = t2 & at; +t5 = t8 << (s0 & 0x1f); +if ((int)t5 >= 0) {t1 = a0 + 0xffffffe0; +goto L43293c;} +t1 = a0 + 0xffffffe0; +t7 = t1 < 0x40; +if (t7 == 0) {t3 = (int)t1 >> 5; +goto L4328e4;} +t3 = (int)t1 >> 5; +t4 = 0x100052d4; +t6 = t3 << 2; +t4 = t4; +t0 = t4 + t6; +t9 = MEM_U32(t0 + 0); +//nop; +t2 = t9 << (t1 & 0x1f); +t7 = (int)t2 < (int)0x0; +L4328e4: +if (t7 == 0) {//nop; +goto L432908;} +//nop; +//nop; +a0 = s6; +a1 = fp; +f_eval_fp_cond(mem, sp, a0, a1); +goto L4328fc; +a1 = fp; +L4328fc: +gp = MEM_U32(sp + 204); +//nop; +goto L432d44; +//nop; +L432908: +//nop; +a1 = s0; +//nop; +v0 = f_fop(mem, sp, a0, a1); +goto L432918; +//nop; +L432918: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +a1 = s6; +a2 = fp; +f_eval2(mem, sp, a0, a1, a2); +goto L432930; +a2 = fp; +L432930: +gp = MEM_U32(sp + 204); +//nop; +goto L432d44; +//nop; +L43293c: +//nop; +a0 = s6; +//nop; +v0 = f_uop_to_asm(mem, sp, a0); +goto L43294c; +//nop; +L43294c: +t5 = MEM_U8(s6 + 32); +gp = MEM_U32(sp + 204); +at = 0x3c; +if (t5 != at) {s5 = v0 & 0xffff; +goto L432988;} +s5 = v0 & 0xffff; +t3 = 0x10004b6c; +//nop; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L432988;} +//nop; +s5 = 0x10004b68; +at = 0x10004b6c; +s5 = MEM_U16(s5 + 0); +MEM_U8(at + 0) = (uint8_t)zero; +L432988: +//nop; +a0 = MEM_U32(s6 + 4); +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L432998; +//nop; +L432998: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L432c68;} +//nop; +t4 = 0x10018ecc; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L432a18;} +//nop; +t6 = MEM_U8(s6 + 33); +at = 0x5010000; +t0 = t6 & 0x1f; +t9 = t0 < 0x20; +t1 = -t9; +t2 = t1 & at; +t8 = t2 << (t0 & 0x1f); +if ((int)t8 >= 0) {//nop; +goto L432a18;} +//nop; +//nop; +a0 = s6; +//nop; +v0 = f_result_type(mem, sp, a0); +goto L4329f0; +//nop; +L4329f0: +gp = MEM_U32(sp + 204); +if (s0 == v0) {//nop; +goto L432a18;} +//nop; +//nop; +a0 = MEM_U32(s6 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L432a0c; +a1 = 0x48; +L432a0c: +gp = MEM_U32(sp + 204); +//nop; +goto L432a30; +//nop; +L432a18: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = fp; +f_eval(mem, sp, a0, a1); +goto L432a28; +a1 = fp; +L432a28: +gp = MEM_U32(sp + 204); +//nop; +L432a30: +//nop; +a0 = MEM_U32(s6 + 0); +//nop; +v0 = f_reg(mem, sp, a0); +goto L432a40; +//nop; +L432a40: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L432a58; +a1 = fp; +L432a58: +gp = MEM_U32(sp + 204); +v1 = v0 & 0xff; +if (s3 != v1) {fp = v0 & 0xff; +goto L432ac4;} +fp = v0 & 0xff; +t7 = MEM_U8(s6 + 32); +//nop; +t5 = t7 < 0x80; +if (t5 == 0) {t3 = (int)t7 >> 5; +goto L432a9c;} +t3 = (int)t7 >> 5; +t6 = 0x100052c4; +t4 = t3 << 2; +t6 = t6; +t9 = t6 + t4; +t1 = MEM_U32(t9 + 0); +//nop; +t2 = t1 << (t7 & 0x1f); +t5 = (int)t2 < (int)0x0; +L432a9c: +if (t5 != 0) {//nop; +goto L432ac4;} +//nop; +//nop; +a0 = s6; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L432ab4; +a1 = 0x1; +L432ab4: +gp = MEM_U32(sp + 204); +a0 = MEM_U8(s6 + 32); +s2 = v0 & 0xff; +goto L432acc; +s2 = v0 & 0xff; +L432ac4: +a0 = MEM_U8(s6 + 32); +s2 = v1 & 0xff; +L432acc: +s0 = MEM_U32(s6 + 4); +at = 0x5010000; +v0 = MEM_U8(s0 + 33); +a1 = s2; +t8 = v0 & 0x1f; +t3 = t8 < 0x20; +t6 = -t3; +t4 = t6 & at; +t9 = t4 << (t8 & 0x1f); +if ((int)t9 >= 0) {v0 = t8; +goto L432b1c;} +v0 = t8; +s1 = MEM_U32(s0 + 52); +at = 0x73; +if (a0 == at) {t1 = s1 & 0x3f; +goto L432b14;} +t1 = s1 & 0x3f; +at = 0x74; +if (a0 != at) {t2 = v0 < 0x20; +goto L432b40;} +t2 = v0 < 0x20; +L432b14: +s1 = t1; +goto L432b3c; +s1 = t1; +L432b1c: +s1 = MEM_U32(s0 + 48); +at = 0x73; +if (a0 == at) {t7 = s1 & 0x1f; +goto L432b38;} +t7 = s1 & 0x1f; +at = 0x74; +if (a0 != at) {t2 = v0 < 0x20; +goto L432b40;} +t2 = v0 < 0x20; +L432b38: +s1 = t7; +L432b3c: +t2 = v0 < 0x20; +L432b40: +t0 = -t2; +at = 0x5010000; +t5 = t0 & at; +t8 = t5 << (v0 & 0x1f); +if ((int)t8 >= 0) {a0 = s5; +goto L432b7c;} +a0 = s5; +//nop; +a3 = MEM_U32(s0 + 48); +a2 = s3; +MEM_U32(sp + 16) = s1; +MEM_U32(sp + 20) = s6; +f_dw_emit_rri(mem, sp, a0, a1, a2, a3); +goto L432b70; +MEM_U32(sp + 20) = s6; +L432b70: +gp = MEM_U32(sp + 204); +//nop; +goto L432bd4; +//nop; +L432b7c: +if ((int)s1 >= 0) {a0 = s5; +goto L432bb0;} +a0 = s5; +//nop; +a0 = s5; +a1 = s2; +a2 = s3; +a3 = 0xffffffff; +MEM_U32(sp + 16) = s1; +MEM_U32(sp + 20) = s6; +f_dw_emit_rri(mem, sp, a0, a1, a2, a3); +goto L432ba4; +MEM_U32(sp + 20) = s6; +L432ba4: +gp = MEM_U32(sp + 204); +//nop; +goto L432bd4; +//nop; +L432bb0: +//nop; +a1 = s2; +a2 = s3; +a3 = zero; +MEM_U32(sp + 16) = s1; +MEM_U32(sp + 20) = s6; +f_dw_emit_rri(mem, sp, a0, a1, a2, a3); +goto L432bcc; +MEM_U32(sp + 20) = s6; +L432bcc: +gp = MEM_U32(sp + 204); +//nop; +L432bd4: +if (s2 == fp) {//nop; +goto L432d44;} +//nop; +t3 = MEM_U8(s6 + 33); +at = 0x5010000; +t6 = t3 & 0x1f; +t4 = t6 < 0x20; +t9 = -t4; +t1 = t9 & at; +t7 = t1 << (t6 & 0x1f); +if ((int)t7 >= 0) {a0 = 0x31; +goto L432c34;} +a0 = 0x31; +t2 = 0x10018ecc; +//nop; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 != 0) {//nop; +goto L432c34;} +//nop; +//nop; +a0 = fp; +a1 = s2; +f_move_two_regs(mem, sp, a0, a1); +goto L432c28; +a1 = s2; +L432c28: +gp = MEM_U32(sp + 204); +//nop; +goto L432c4c; +//nop; +L432c34: +//nop; +a1 = fp; +a2 = s2; +f_emit_rr(mem, sp, a0, a1, a2); +goto L432c44; +a2 = s2; +L432c44: +gp = MEM_U32(sp + 204); +//nop; +L432c4c: +//nop; +a0 = s2; +//nop; +f_free_reg(mem, sp, a0); +goto L432c5c; +//nop; +L432c5c: +gp = MEM_U32(sp + 204); +//nop; +goto L432d44; +//nop; +L432c68: +t0 = MEM_U32(s6 + 4); +at = 0x95; +t5 = MEM_U8(t0 + 32); +a0 = s5; +if (t5 != at) {//nop; +goto L432d2c;} +//nop; +//nop; +a0 = MEM_U32(s6 + 0); +a1 = fp; +f_eval(mem, sp, a0, a1); +goto L432c90; +a1 = fp; +L432c90: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L432ca8; +//nop; +L432ca8: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L432cc0; +a1 = fp; +L432cc0: +t8 = MEM_U32(s6 + 4); +t3 = MEM_U8(s6 + 32); +gp = MEM_U32(sp + 204); +at = 0x4; +s1 = MEM_U32(t8 + 36); +if (t3 != at) {fp = v0 & 0xff; +goto L432d08;} +fp = v0 & 0xff; +a2 = MEM_U32(s6 + 0); +at = 0x36; +t4 = MEM_U8(a2 + 32); +//nop; +if (t4 != at) {//nop; +goto L432d08;} +//nop; +t9 = MEM_U32(a2 + 40); +at = 0x1; +if (t9 != at) {//nop; +goto L432d08;} +//nop; +s5 = 0xd7; +L432d08: +//nop; +a0 = s5; +a1 = fp; +a2 = s3; +a3 = s1; +f_emit_rrri(mem, sp, a0, a1, a2, a3); +goto L432d20; +a3 = s1; +L432d20: +gp = MEM_U32(sp + 204); +//nop; +goto L432d44; +//nop; +L432d2c: +//nop; +a1 = s6; +a2 = fp; +f_eval2(mem, sp, a0, a1, a2); +goto L432d3c; +a2 = fp; +L432d3c: +gp = MEM_U32(sp + 204); +//nop; +L432d44: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L432d58: +//nop; +a0 = s6; +//nop; +v0 = f_uop_to_asm(mem, sp, a0); +goto L432d68; +//nop; +L432d68: +gp = MEM_U32(sp + 204); +s5 = v0 & 0xffff; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L432d80; +//nop; +L432d80: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +s7 = v0; +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L432d98; +a1 = 0x48; +L432d98: +s0 = MEM_U32(s6 + 4); +gp = MEM_U32(sp + 204); +t1 = MEM_U8(s0 + 32); +at = 0x49; +if (t1 != at) {//nop; +goto L432e80;} +//nop; +//nop; +a0 = MEM_U32(s6 + 0); +//nop; +v0 = f_reg(mem, sp, a0); +goto L432dc0; +//nop; +L432dc0: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L432dd8; +a1 = fp; +L432dd8: +gp = MEM_U32(sp + 204); +t6 = MEM_U32(s6 + 4); +//nop; +a3 = MEM_U32(t6 + 48); +fp = v0 & 0xff; +MEM_U32(sp + 16) = zero; +a0 = s5; +a1 = v0 & 0xff; +a2 = s3; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L432e00; +a2 = s3; +L432e00: +t7 = MEM_U32(s6 + 4); +gp = MEM_U32(sp + 204); +t2 = MEM_U32(t7 + 48); +a0 = 0x14; +if ((int)t2 < 0) {a1 = fp; +goto L432e3c;} +a1 = fp; +//nop; +a0 = 0xe; +a1 = fp; +a2 = zero; +a3 = s7; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L432e30; +a3 = s7; +L432e30: +gp = MEM_U32(sp + 204); +t0 = MEM_U32(s6 + 4); +goto L432e58; +t0 = MEM_U32(s6 + 4); +L432e3c: +//nop; +a2 = zero; +a3 = s7; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L432e4c; +a3 = s7; +L432e4c: +gp = MEM_U32(sp + 204); +//nop; +t0 = MEM_U32(s6 + 4); +L432e58: +//nop; +a3 = MEM_U32(t0 + 48); +MEM_U32(sp + 16) = zero; +a0 = 0x1; +a1 = fp; +a2 = fp; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L432e74; +a2 = fp; +L432e74: +gp = MEM_U32(sp + 204); +//nop; +goto L432f90; +//nop; +L432e80: +//nop; +a0 = s0; +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L432e90; +a1 = 0x48; +L432e90: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L432ea8; +//nop; +L432ea8: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L432ec0; +a1 = fp; +L432ec0: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 4); +//nop; +fp = v0 & 0xff; +//nop; +v0 = f_reg(mem, sp, a0); +goto L432ed8; +//nop; +L432ed8: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)v0; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L432ef0; +a1 = 0x1; +L432ef0: +gp = MEM_U32(sp + 204); +s4 = v0 & 0xff; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L432f08; +//nop; +L432f08: +t5 = MEM_U8(sp + 318); +gp = MEM_U32(sp + 204); +if (t5 != fp) {//nop; +goto L432f1c;} +//nop; +abort(); +L432f1c: +//nop; +a0 = s5; +a1 = fp; +a2 = s3; +a3 = t5; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L432f34; +a3 = t5; +L432f34: +gp = MEM_U32(sp + 204); +a3 = MEM_U8(sp + 318); +//nop; +a0 = 0x59; +a1 = s4; +a2 = fp; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L432f50; +a2 = fp; +L432f50: +gp = MEM_U32(sp + 204); +a0 = 0xe; +//nop; +a1 = s4; +a2 = zero; +a3 = s7; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L432f6c; +a3 = s7; +L432f6c: +gp = MEM_U32(sp + 204); +a3 = MEM_U8(sp + 318); +//nop; +a0 = 0x2; +a1 = fp; +a2 = fp; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L432f88; +a2 = fp; +L432f88: +gp = MEM_U32(sp + 204); +//nop; +L432f90: +//nop; +a0 = s7; +//nop; +f_define_label(mem, sp, a0); +goto L432fa0; +//nop; +L432fa0: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L432fbc: +t8 = MEM_U16(s6 + 34); +//nop; +t3 = t8 & 0x2; +if (t3 != 0) {//nop; +goto L432fd4;} +//nop; +abort(); +L432fd4: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L432fe4; +a1 = 0x48; +L432fe4: +t4 = MEM_U32(s6 + 0); +gp = MEM_U32(sp + 204); +t9 = MEM_U8(t4 + 25); +//nop; +t1 = t9 << 24; +t6 = t1 >> 25; +if (fp != t6) {//nop; +goto L433008;} +//nop; +fp = 0x48; +L433008: +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L433018; +a1 = fp; +L433018: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +fp = v0 & 0xff; +//nop; +v0 = f_reg(mem, sp, a0); +goto L433030; +//nop; +L433030: +t7 = MEM_U8(s6 + 33); +at = 0x5010000; +t2 = t7 & 0x1f; +t0 = t2 < 0x20; +t5 = -t0; +t8 = t5 & at; +gp = MEM_U32(sp + 204); +t3 = t8 << (t2 & 0x1f); +if ((int)t3 >= 0) {s3 = v0 & 0xff; +goto L4330d8;} +s3 = v0 & 0xff; +t4 = 0x10018ecc; +at = 0x1; +t4 = MEM_U8(t4 + 0); +a0 = 0x13a; +if (t4 != at) {a1 = fp; +goto L433144;} +a1 = fp; +t9 = MEM_U32(s6 + 36); +t1 = 0x40; +a3 = t1 - t9; +//nop; +a2 = s3; +MEM_U32(sp + 16) = zero; +s5 = 0x13b; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L433090; +s5 = 0x13b; +L433090: +t6 = MEM_U8(s6 + 33); +gp = MEM_U32(sp + 204); +at = 0x5; +t7 = t6 & 0x1f; +if (t7 != at) {a1 = fp; +goto L4330ac;} +a1 = fp; +s5 = 0x13c; +L4330ac: +t0 = MEM_U32(s6 + 36); +//nop; +t5 = 0x40; +a0 = s5; +a2 = fp; +MEM_U32(sp + 16) = zero; +a3 = t5 - t0; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4330cc; +a3 = t5 - t0; +L4330cc: +gp = MEM_U32(sp + 204); +//nop; +goto L433144; +//nop; +L4330d8: +t8 = MEM_U32(s6 + 36); +//nop; +t2 = 0x20; +a0 = 0x4f; +a1 = fp; +a2 = s3; +MEM_U32(sp + 16) = zero; +s5 = 0x54; +a3 = t2 - t8; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L433100; +a3 = t2 - t8; +L433100: +t3 = MEM_U8(s6 + 33); +gp = MEM_U32(sp + 204); +at = 0x6; +t4 = t3 & 0x1f; +if (t4 != at) {a1 = fp; +goto L43311c;} +a1 = fp; +s5 = 0x53; +L43311c: +t1 = MEM_U32(s6 + 36); +t9 = 0x20; +a3 = t9 - t1; +//nop; +a0 = s5; +a2 = fp; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L43313c; +MEM_U32(sp + 16) = zero; +L43313c: +gp = MEM_U32(sp + 204); +//nop; +L433144: +//nop; +a0 = 0x104; +a1 = fp; +a2 = s3; +a3 = 0x6; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L433160; +MEM_U32(sp + 16) = zero; +L433160: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L43317c: +a3 = MEM_U8(s6 + 33); +at = 0x8f8d0000; +t6 = a3 & 0x1f; +t7 = t6 < 0x20; +t5 = -t7; +at = at | 0x8000; +t0 = t5 & at; +t2 = t0 << (t6 & 0x1f); +if ((int)t2 >= 0) {a3 = t6; +goto L4331c8;} +a3 = t6; +v0 = MEM_U8(s6 + 40); +at = 0x8f8d0000; +t8 = v0 < 0x20; +t3 = -t8; +at = at | 0x8000; +t4 = t3 & at; +t9 = t4 << (v0 & 0x1f); +if ((int)t9 < 0) {t4 = v0 < 0x20; +goto L4332d8;} +t4 = v0 < 0x20; +L4331c8: +t1 = 0x1000973a; +a0 = 0x4; +t1 = t1; +t7 = t1 + 0x48; +a1 = 0x15ae; +t5 = sp; +L4331e0: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t5 = t5 + 0xc; +MEM_U8(t5 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t5) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t5 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 4 + 3) = (uint8_t)(at >> 0); +if (t1 != t7) {//swr $at, 7($t5) +goto L4331e0;} +//swr $at, 7($t5) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t0 = 0x100096ea; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +t7 = t1 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t1) +t0 = t0; +MEM_U8(t5 + 12 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t5 + 12 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t5 + 12 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t5 + 12 + 3) = (uint8_t)(t7 >> 0); +t8 = t0 + 0x48; +t3 = sp; +//swr $t7, 0xf($t5) +L433250: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t0 != t8) {//swr $at, 0x57($t3) +goto L433250;} +//swr $at, 0x57($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t8 = t0 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t0) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4332cc; +//nop; +L4332cc: +gp = MEM_U32(sp + 204); +ra = MEM_U32(sp + 212); +goto L434eec; +ra = MEM_U32(sp + 212); +L4332d8: +at = 0xc0000; +at = at | 0x8000; +t9 = -t4; +t6 = t9 & at; +t7 = t6 << (v0 & 0x1f); +if ((int)t7 >= 0) {t0 = a3 < 0x20; +goto L43334c;} +t0 = a3 < 0x20; +t1 = a3 < 0x20; +at = 0xc0000; +at = at | 0x8000; +t5 = -t1; +t2 = t5 & at; +t8 = t2 << (a3 & 0x1f); +if ((int)t8 >= 0) {//nop; +goto L433330;} +//nop; +//nop; +a0 = s6; +a1 = fp; +f_eval_flt_flt_cvt(mem, sp, a0, a1); +goto L433324; +a1 = fp; +L433324: +gp = MEM_U32(sp + 204); +//nop; +goto L43339c; +//nop; +L433330: +//nop; +a0 = s6; +a1 = fp; +f_eval_flt_int_cvt(mem, sp, a0, a1); +goto L433340; +a1 = fp; +L433340: +gp = MEM_U32(sp + 204); +//nop; +goto L43339c; +//nop; +L43334c: +at = 0xc0000; +at = at | 0x8000; +t3 = -t0; +t4 = t3 & at; +t9 = t4 << (a3 & 0x1f); +if ((int)t9 >= 0) {//nop; +goto L433384;} +//nop; +//nop; +a0 = s6; +a1 = fp; +f_eval_int_flt_cvt(mem, sp, a0, a1); +goto L433378; +a1 = fp; +L433378: +gp = MEM_U32(sp + 204); +//nop; +goto L43339c; +//nop; +L433384: +//nop; +a0 = s6; +a1 = fp; +f_eval_int_int_cvt(mem, sp, a0, a1); +goto L433394; +a1 = fp; +L433394: +gp = MEM_U32(sp + 204); +//nop; +L43339c: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L4333b0: +a3 = MEM_U8(s6 + 33); +at = 0xbfa10000; +t6 = a3 & 0x1f; +t7 = t6 < 0x20; +t1 = -t7; +t5 = t1 & at; +t2 = t5 << (t6 & 0x1f); +if ((int)t2 < 0) {at = 0xd; +goto L4333dc;} +at = 0xd; +if (t6 != at) {//nop; +goto L433404;} +//nop; +L4333dc: +v0 = MEM_U8(s6 + 40); +at = 0xbfa10000; +t8 = v0 < 0x20; +t0 = -t8; +t3 = t0 & at; +t4 = t3 << (v0 & 0x1f); +if ((int)t4 < 0) {at = 0xd; +goto L433514;} +at = 0xd; +if (v0 == at) {//nop; +goto L433514;} +//nop; +L433404: +t9 = 0x1000969a; +a0 = 0x4; +t9 = t9; +t7 = t9 + 0x48; +a1 = 0x15c9; +t1 = sp; +L43341c: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t1 = t1 + 0xc; +MEM_U8(t1 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t1) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t1 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 4 + 3) = (uint8_t)(at >> 0); +if (t9 != t7) {//swr $at, 7($t1) +goto L43341c;} +//swr $at, 7($t1) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t5 = 0x1000964a; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +t7 = t9 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t9) +t5 = t5; +MEM_U8(t1 + 12 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t1 + 12 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t1 + 12 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t1 + 12 + 3) = (uint8_t)(t7 >> 0); +t8 = t5 + 0x48; +t0 = sp; +//swr $t7, 0xf($t1) +L43348c: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t0 = t0 + 0xc; +MEM_U8(t0 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t0) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t0 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 84 + 3) = (uint8_t)(at >> 0); +if (t5 != t8) {//swr $at, 0x57($t0) +goto L43348c;} +//swr $at, 0x57($t0) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +//nop; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +t8 = t5 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t5) +//nop; +MEM_U8(t0 + 92 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t0 + 92 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t0 + 92 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t0 + 92 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x5f($t0) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L433508; +//nop; +L433508: +gp = MEM_U32(sp + 204); +ra = MEM_U32(sp + 212); +goto L434eec; +ra = MEM_U32(sp + 212); +L433514: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L433524; +a1 = 0x48; +L433524: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L43353c; +//nop; +L43353c: +t3 = MEM_U8(s6 + 40); +at = 0xbfa10000; +t4 = t3 < 0x20; +t6 = -t4; +t7 = t6 & at; +gp = MEM_U32(sp + 204); +t9 = t7 << (t3 & 0x1f); +if ((int)t9 >= 0) {s3 = v0 & 0xff; +goto L4335c8;} +s3 = v0 & 0xff; +t1 = MEM_U8(s6 + 33); +at = 0xd; +t2 = t1 & 0x1f; +if (t2 != at) {//nop; +goto L4335ac;} +//nop; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L433584; +a1 = fp; +L433584: +gp = MEM_U32(sp + 204); +fp = v0 & 0xff; +//nop; +a0 = 0x65; +a1 = s3; +a2 = v0 & 0xff; +f_emit_rr(mem, sp, a0, a1, a2); +goto L4335a0; +a2 = v0 & 0xff; +L4335a0: +gp = MEM_U32(sp + 204); +//nop; +goto L43363c; +//nop; +L4335ac: +//nop; +a0 = s6; +a1 = s3; +v0 = f_get_dest(mem, sp, a0, a1); +goto L4335bc; +a1 = s3; +L4335bc: +gp = MEM_U32(sp + 204); +fp = v0 & 0xff; +goto L43363c; +fp = v0 & 0xff; +L4335c8: +t8 = MEM_U8(s6 + 33); +at = 0xbfa10000; +t5 = t8 & 0x1f; +t0 = t5 < 0x20; +t4 = -t0; +t6 = t4 & at; +t7 = t6 << (t5 & 0x1f); +if ((int)t7 >= 0) {//nop; +goto L433624;} +//nop; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L4335fc; +a1 = fp; +L4335fc: +gp = MEM_U32(sp + 204); +fp = v0 & 0xff; +//nop; +a0 = 0x61; +a1 = v0 & 0xff; +a2 = s3; +f_emit_rr(mem, sp, a0, a1, a2); +goto L433618; +a2 = s3; +L433618: +gp = MEM_U32(sp + 204); +//nop; +goto L43363c; +//nop; +L433624: +//nop; +a0 = s6; +a1 = s3; +v0 = f_get_dest(mem, sp, a0, a1); +goto L433634; +a1 = s3; +L433634: +gp = MEM_U32(sp + 204); +fp = v0 & 0xff; +L43363c: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L433650: +//nop; +a0 = MEM_U32(s6 + 36); +a1 = MEM_U32(s6 + 0); +a2 = 0x1; +f_trap(mem, sp, a0, a1, a2); +goto L433664; +a2 = 0x1; +L433664: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L433680: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = fp; +f_eval(mem, sp, a0, a1); +goto L433690; +a1 = fp; +L433690: +t3 = MEM_U32(s6 + 0); +v1 = MEM_U8(s6 + 25); +s3 = MEM_U8(t3 + 25); +t8 = v1 << 24; +t9 = s3 << 24; +t1 = t9 >> 25; +s3 = t1 & 0xff; +t0 = t8 >> 25; +t4 = s3 ^ t0; +t6 = t4 << 25; +gp = MEM_U32(sp + 204); +t5 = t6 >> 24; +a0 = t5 ^ v1; +a1 = MEM_U16(s6 + 20); +//nop; +MEM_U8(s6 + 25) = (uint8_t)a0; +t3 = a0 << 24; +a0 = t3 >> 25; +a1 = a1 + 0xffffffff; +f_inc_usage(mem, sp, a0, a1); +goto L4336e0; +a1 = a1 + 0xffffffff; +L4336e0: +gp = MEM_U32(sp + 204); +a0 = 0x103; +//nop; +a1 = s3; +a2 = zero; +a3 = 0x8; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L433700; +MEM_U32(sp + 16) = zero; +L433700: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L43371c: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = fp; +f_eval(mem, sp, a0, a1); +goto L43372c; +a1 = fp; +L43372c: +t1 = MEM_U32(s6 + 0); +v1 = MEM_U8(s6 + 25); +s3 = MEM_U8(t1 + 25); +t4 = v1 << 24; +t2 = s3 << 24; +t8 = t2 >> 25; +t0 = t8 & 0xff; +t6 = t4 >> 25; +t5 = t0 ^ t6; +t7 = t5 << 25; +gp = MEM_U32(sp + 204); +t3 = t7 >> 24; +a0 = t3 ^ v1; +a1 = MEM_U16(s6 + 20); +//nop; +MEM_U8(s6 + 25) = (uint8_t)a0; +t1 = a0 << 24; +s3 = t0; +a0 = t1 >> 25; +a1 = a1 + 0xffffffff; +f_inc_usage(mem, sp, a0, a1); +goto L433780; +a1 = a1 + 0xffffffff; +L433780: +t8 = MEM_U8(s6 + 32); +gp = MEM_U32(sp + 204); +at = 0xc; +if (t8 != at) {//nop; +goto L4337c4;} +//nop; +t0 = MEM_U8(s6 + 33); +a2 = MEM_U32(s6 + 36); +at = 0x6; +t4 = t0 & 0x1f; +if (t4 != at) {a2 = a2 + 0x1; +goto L4337b8;} +a2 = a2 + 0x1; +s5 = 0x101; +s0 = 0x80000000; +goto L4337ec; +s0 = 0x80000000; +L4337b8: +s5 = 0x102; +s0 = zero; +goto L4337ec; +s0 = zero; +L4337c4: +t6 = MEM_U8(s6 + 33); +a2 = MEM_U32(s6 + 36); +at = 0x6; +t5 = t6 & 0x1f; +if (t5 != at) {s5 = 0x100; +goto L4337e8;} +s5 = 0x100; +s5 = 0xff; +s0 = 0x80000000; +goto L4337ec; +s0 = 0x80000000; +L4337e8: +s0 = zero; +L4337ec: +if (a2 == s0) {a0 = s5; +goto L43380c;} +a0 = s5; +//nop; +a1 = s3; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L433804; +a3 = zero; +L433804: +gp = MEM_U32(sp + 204); +//nop; +L43380c: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L433820: +//nop; +a0 = s6; +//nop; +f_eval_irel(mem, sp, a0); +goto L433830; +//nop; +L433830: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L43384c: +//nop; +a0 = s6; +//nop; +f_eval_mov(mem, sp, a0); +goto L43385c; +//nop; +L43385c: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L433878: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L433888; +a1 = 0x48; +L433888: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L4338a0; +//nop; +L4338a0: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +t7 = 0x10018ecc; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L4338f4;} +//nop; +t3 = MEM_U8(s6 + 33); +at = 0x5010000; +t9 = t3 & 0x1f; +t1 = t9 < 0x20; +t2 = -t1; +t8 = t2 & at; +t0 = t8 << (t9 & 0x1f); +if ((int)t0 >= 0) {//nop; +goto L4338f4;} +//nop; +s3 = v0; +s3 = s3 + 0x1; +t4 = s3 & 0xff; +s3 = t4; +L4338f4: +//nop; +MEM_U8(sp + 318) = (uint8_t)s3; +a0 = s3; +v0 = f_is_available(mem, sp, a0); +goto L433904; +a0 = s3; +L433904: +gp = MEM_U32(sp + 204); +if (v0 != 0) {//nop; +goto L433940;} +//nop; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L433920; +a1 = 0x1; +L433920: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)v0; +//nop; +a0 = v0 & 0xff; +//nop; +f_free_reg(mem, sp, a0); +goto L433938; +//nop; +L433938: +gp = MEM_U32(sp + 204); +//nop; +L433940: +//nop; +a1 = MEM_U8(sp + 318); +a0 = 0x4f; +a2 = s3; +a3 = 0x2; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L43395c; +MEM_U32(sp + 16) = zero; +L43395c: +gp = MEM_U32(sp + 204); +t6 = MEM_U32(s6 + 4); +a1 = MEM_U8(sp + 318); +//nop; +a3 = MEM_U32(t6 + 36); +a0 = 0x2a; +a2 = zero; +MEM_U32(sp + 16) = a1; +f_emit_rllb(mem, sp, a0, a1, a2, a3); +goto L433980; +MEM_U32(sp + 16) = a1; +L433980: +gp = MEM_U32(sp + 204); +at = 0x2; +t5 = 0x10018ed8; +//nop; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L4339b8;} +//nop; +//nop; +a0 = MEM_U8(sp + 318); +//nop; +f_emit_cpadd(mem, sp, a0); +goto L4339b0; +//nop; +L4339b0: +gp = MEM_U32(sp + 204); +//nop; +L4339b8: +//nop; +a1 = MEM_U8(sp + 318); +a0 = 0x22; +f_emit_r(mem, sp, a0, a1); +goto L4339c8; +a0 = 0x22; +L4339c8: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L4339e4: +t7 = MEM_U32(s6 + 40); +//nop; +if (t7 != 0) {//nop; +goto L433a08;} +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L433a08: +//nop; +a0 = 0x1a; +a1 = zero; +f_emit_dir0(mem, sp, a0, a1); +goto L433a18; +a1 = zero; +L433a18: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 36); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L433a30; +//nop; +L433a30: +v0 = MEM_U32(s6 + 40); +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L433a70;} +//nop; +s0 = v0; +L433a44: +s6 = MEM_U32(s6 + 8); +//nop; +t3 = MEM_U32(s6 + 4); +a1 = zero; +a0 = MEM_U32(t3 + 36); +//nop; +f_emit_dir_ll(mem, sp, a0, a1); +goto L433a60; +//nop; +L433a60: +gp = MEM_U32(sp + 204); +s0 = s0 + 0xffffffff; +if (s0 != 0) {//nop; +goto L433a44;} +//nop; +L433a70: +t1 = 0x10019d68; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L433aa4;} +//nop; +//nop; +a0 = 0x10019d68; +//nop; +f_emit_itext(mem, sp, a0); +goto L433a98; +//nop; +L433a98: +gp = MEM_U32(sp + 204); +//nop; +goto L433abc; +//nop; +L433aa4: +//nop; +a0 = 0x15; +a1 = zero; +f_emit_dir0(mem, sp, a0, a1); +goto L433ab4; +a1 = zero; +L433ab4: +gp = MEM_U32(sp + 204); +//nop; +L433abc: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L433ad0: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L433ae4: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L433af8: +//nop; +a1 = MEM_U32(s6 + 36); +a0 = 0x1d; +f_emit_dir0(mem, sp, a0, a1); +goto L433b08; +a0 = 0x1d; +L433b08: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L433b24: +//nop; +a1 = MEM_U32(s6 + 36); +a0 = 0x1e; +f_emit_dir0(mem, sp, a0, a1); +goto L433b34; +a0 = 0x1e; +L433b34: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L433b50: +//nop; +a0 = s6; +a1 = fp; +f_eval_flt_int_cvt(mem, sp, a0, a1); +goto L433b60; +a1 = fp; +L433b60: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L433b7c: +a2 = MEM_U32(s6 + 0); +at = 0x49; +t2 = MEM_U8(a2 + 32); +//nop; +if (t2 != at) {//nop; +goto L433c34;} +//nop; +t8 = MEM_U32(a2 + 48); +a0 = zero; +if (t8 != 0) {//nop; +goto L433bcc;} +//nop; +t9 = MEM_U8(s6 + 25); +a1 = MEM_U16(s6 + 20); +t0 = t9 & 0xff01; +//nop; +fp = zero; +MEM_U8(s6 + 25) = (uint8_t)t0; +f_inc_usage(mem, sp, a0, a1); +goto L433bc0; +MEM_U8(s6 + 25) = (uint8_t)t0; +L433bc0: +gp = MEM_U32(sp + 204); +//nop; +goto L433e2c; +//nop; +L433bcc: +//nop; +a0 = MEM_U32(s6 + 4); +a1 = fp; +f_eval(mem, sp, a0, a1); +goto L433bdc; +a1 = fp; +L433bdc: +t4 = MEM_U32(s6 + 4); +v1 = MEM_U8(s6 + 25); +t6 = MEM_U8(t4 + 25); +t3 = v1 << 24; +t5 = t6 << 24; +t7 = t5 >> 25; +t1 = t3 >> 25; +t2 = t7 ^ t1; +t8 = t2 << 25; +t9 = t8 >> 24; +gp = MEM_U32(sp + 204); +a0 = t9 ^ v1; +a1 = MEM_U16(s6 + 20); +//nop; +MEM_U8(s6 + 25) = (uint8_t)a0; +t4 = a0 << 24; +a0 = t4 >> 25; +a1 = a1 + 0xffffffff; +f_inc_usage(mem, sp, a0, a1); +goto L433c28; +a1 = a1 + 0xffffffff; +L433c28: +gp = MEM_U32(sp + 204); +//nop; +goto L433e2c; +//nop; +L433c34: +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L433c44; +//nop; +L433c44: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +s7 = v0; +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L433c5c; +a1 = 0x48; +L433c5c: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L433c74; +//nop; +L433c74: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +//nop; +a0 = v0 & 0xff; +//nop; +v0 = f_usage_count(mem, sp, a0); +goto L433c8c; +//nop; +L433c8c: +gp = MEM_U32(sp + 204); +if (v0 != 0) {//nop; +goto L433cd4;} +//nop; +//nop; +a0 = s3; +//nop; +v0 = f_is_available(mem, sp, a0); +goto L433ca8; +//nop; +L433ca8: +gp = MEM_U32(sp + 204); +if (v0 == 0) {a0 = s3; +goto L433cd4;} +a0 = s3; +//nop; +a2 = MEM_U16(s6 + 20); +fp = s3 & 0xff; +a1 = s6; +f_get_reg(mem, sp, a0, a1, a2); +goto L433cc8; +a1 = s6; +L433cc8: +gp = MEM_U32(sp + 204); +v1 = MEM_U8(s6 + 25); +goto L433d14; +v1 = MEM_U8(s6 + 25); +L433cd4: +//nop; +a1 = MEM_U16(s6 + 20); +a0 = s6; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L433ce4; +a0 = s6; +L433ce4: +gp = MEM_U32(sp + 204); +a2 = MEM_U8(s6 + 33); +//nop; +t5 = a2 & 0x1f; +fp = v0 & 0xff; +a2 = t5; +a0 = v0 & 0xff; +a1 = s3; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L433d08; +a1 = s3; +L433d08: +gp = MEM_U32(sp + 204); +//nop; +v1 = MEM_U8(s6 + 25); +L433d14: +a0 = 0xd; +t3 = v1 << 24; +t7 = t3 >> 25; +t1 = fp ^ t7; +t2 = t1 << 25; +t8 = t2 >> 24; +t9 = t8 ^ v1; +MEM_U8(s6 + 25) = (uint8_t)t9; +//nop; +a1 = s3; +a2 = zero; +a3 = s7; +f_emit_rill(mem, sp, a0, a1, a2, a3); +goto L433d48; +a3 = s7; +L433d48: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 4); +//nop; +a1 = 0x48; +//nop; +f_eval(mem, sp, a0, a1); +goto L433d60; +//nop; +L433d60: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 4); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L433d78; +//nop; +L433d78: +gp = MEM_U32(sp + 204); +t0 = v0 & 0xff; +if (fp == t0) {s3 = v0 & 0xff; +goto L433e14;} +s3 = v0 & 0xff; +a2 = MEM_U8(s6 + 33); +//nop; +t4 = a2 & 0x1f; +a2 = t4; +a0 = fp; +a1 = s3; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L433da4; +a1 = s3; +L433da4: +a0 = MEM_U8(s6 + 24); +gp = MEM_U32(sp + 204); +if (a0 == 0) {//nop; +goto L433e14;} +//nop; +//nop; +//nop; +//nop; +v0 = f_temp_usage_count(mem, sp, a0); +goto L433dc4; +//nop; +L433dc4: +gp = MEM_U32(sp + 204); +a0 = s6; +//nop; +a1 = v0; +//nop; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L433ddc; +//nop; +L433ddc: +v1 = MEM_U8(s6 + 25); +gp = MEM_U32(sp + 204); +t6 = v1 << 24; +t5 = t6 >> 25; +t3 = v0 ^ t5; +t7 = t3 << 25; +//nop; +t1 = t7 >> 24; +a0 = MEM_U8(s6 + 24); +t2 = t1 ^ v1; +MEM_U8(s6 + 25) = (uint8_t)t2; +f_free_temp(mem, sp, a0); +goto L433e0c; +MEM_U8(s6 + 25) = (uint8_t)t2; +L433e0c: +gp = MEM_U32(sp + 204); +MEM_U8(s6 + 24) = (uint8_t)zero; +L433e14: +//nop; +a0 = s7; +//nop; +f_define_label(mem, sp, a0); +goto L433e24; +//nop; +L433e24: +gp = MEM_U32(sp + 204); +//nop; +L433e2c: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L433e40: +//nop; +a0 = MEM_U32(s6 + 0); +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L433e50; +//nop; +L433e50: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L434020;} +//nop; +v0 = 0x100197c0; +at = 0xffffffff; +v0 = MEM_U32(v0 + 0); +//nop; +if (v0 == at) {//nop; +goto L433f70;} +//nop; +t8 = MEM_U32(s6 + 0); +t0 = v0 + 0xfffffff8; +t9 = MEM_U32(t8 + 48); +a0 = 0x18; +at = (int)t9 < (int)t0; +if (at != 0) {//nop; +goto L433f70;} +//nop; +t4 = 0x100197b0; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +t6 = t4 << 31; +if ((int)t6 < 0) {t5 = t4 | 0x1; +goto L433ee8;} +t5 = t4 | 0x1; +at = 0x100197b0; +t3 = 0x100197b0; +MEM_U32(at + 0) = t5; +at = 0x100197b0; +t3 = MEM_U32(t3 + 4); +t7 = 0x100197b0; +MEM_U32(at + 4) = t3; +at = 0x100197b0; +t1 = 0x10019388; +t7 = MEM_U32(t7 + 8); +t1 = MEM_U32(t1 + 0); +MEM_U32(at + 8) = t7; +at = 0x10019388; +t2 = t1 + 0x8; +MEM_U32(at + 0) = t2; +L433ee8: +//nop; +a1 = zero; +a2 = 0x1; +f_get_reg(mem, sp, a0, a1, a2); +goto L433ef8; +a2 = 0x1; +L433ef8: +gp = MEM_U32(sp + 204); +t8 = MEM_U32(s6 + 0); +//nop; +a2 = MEM_U32(t8 + 48); +a0 = 0x29; +a1 = 0x18; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L433f18; +a3 = zero; +L433f18: +gp = MEM_U32(sp + 204); +a0 = 0x18; +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L433f30; +//nop; +L433f30: +gp = MEM_U32(sp + 204); +a0 = 0x35; +//nop; +a1 = 0xc0; +a2 = zero; +f_emit_regmask(mem, sp, a0, a1, a2); +goto L433f48; +a2 = zero; +L433f48: +gp = MEM_U32(sp + 204); +a0 = 0x23; +a1 = 0x10018ec8; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a3 = zero; +f_emit_a(mem, sp, a0, a1, a2, a3); +goto L433f68; +a3 = zero; +L433f68: +gp = MEM_U32(sp + 204); +//nop; +L433f70: +t0 = 0x10019398; +t9 = MEM_U32(s6 + 0); +t0 = MEM_U8(t0 + 0); +a3 = MEM_U32(t9 + 48); +if (t0 == 0) {a0 = 0x56; +goto L433fac;} +a0 = 0x56; +//nop; +a0 = 0x2; +a1 = 0x1d; +a2 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L433fa0; +MEM_U32(sp + 16) = zero; +L433fa0: +gp = MEM_U32(sp + 204); +//nop; +goto L433fc8; +//nop; +L433fac: +//nop; +a1 = 0x1d; +a2 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L433fc0; +MEM_U32(sp + 16) = zero; +L433fc0: +gp = MEM_U32(sp + 204); +//nop; +L433fc8: +v0 = 0x100197c0; +at = 0xffffffff; +v0 = MEM_U32(v0 + 0); +//nop; +if (v0 == at) {t3 = MEM_U8(sp + 252); +goto L4341a0;} +t3 = MEM_U8(sp + 252); +t6 = MEM_U32(s6 + 0); +t5 = v0 + 0xfffffff8; +t4 = MEM_U32(t6 + 48); +a0 = 0x57; +at = (int)t4 < (int)t5; +if (at == 0) {t3 = MEM_U8(sp + 252); +goto L4341a0;} +t3 = MEM_U8(sp + 252); +//nop; +a1 = zero; +a2 = zero; +a3 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L434014; +MEM_U32(sp + 16) = zero; +L434014: +gp = MEM_U32(sp + 204); +t3 = MEM_U8(sp + 252); +goto L4341a0; +t3 = MEM_U8(sp + 252); +L434020: +t3 = 0x100197c0; +at = 0xffffffff; +t3 = MEM_U32(t3 + 0); +a1 = 0x18; +if (t3 == at) {//nop; +goto L43411c;} +//nop; +//nop; +a0 = MEM_U32(s6 + 0); +s3 = 0x18; +f_eval(mem, sp, a0, a1); +goto L434048; +s3 = 0x18; +L434048: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L434060; +//nop; +L434060: +gp = MEM_U32(sp + 204); +a2 = MEM_U8(s6 + 33); +//nop; +t7 = a2 & 0x1f; +a2 = t7; +a0 = 0x18; +a1 = v0; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L434080; +a1 = v0; +L434080: +gp = MEM_U32(sp + 204); +a0 = 0x35; +t1 = 0x100197b0; +//nop; +t1 = MEM_U32(t1 + 0); +//nop; +t2 = t1 << 31; +if ((int)t2 < 0) {t8 = t1 | 0x1; +goto L4340e0;} +t8 = t1 | 0x1; +at = 0x100197b0; +t9 = 0x100197b0; +MEM_U32(at + 0) = t8; +at = 0x100197b0; +t9 = MEM_U32(t9 + 4); +t0 = 0x100197b0; +MEM_U32(at + 4) = t9; +at = 0x100197b0; +t6 = 0x10019388; +t0 = MEM_U32(t0 + 8); +t6 = MEM_U32(t6 + 0); +MEM_U32(at + 8) = t0; +at = 0x10019388; +t4 = t6 + 0x8; +MEM_U32(at + 0) = t4; +L4340e0: +//nop; +a1 = 0xc0; +a2 = zero; +f_emit_regmask(mem, sp, a0, a1, a2); +goto L4340f0; +a2 = zero; +L4340f0: +gp = MEM_U32(sp + 204); +a0 = 0x23; +a1 = 0x10018ec8; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a3 = zero; +f_emit_a(mem, sp, a0, a1, a2, a3); +goto L434110; +a3 = zero; +L434110: +gp = MEM_U32(sp + 204); +//nop; +goto L43414c; +//nop; +L43411c: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L43412c; +a1 = 0x48; +L43412c: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L434144; +//nop; +L434144: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +L43414c: +t5 = 0x10019398; +a2 = 0x1d; +t5 = MEM_U8(t5 + 0); +a0 = 0x56; +if (t5 == 0) {a1 = 0x1d; +goto L434184;} +a1 = 0x1d; +//nop; +a0 = 0x2; +a1 = 0x1d; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L434178; +a3 = s3; +L434178: +gp = MEM_U32(sp + 204); +t3 = MEM_U8(sp + 252); +goto L4341a0; +t3 = MEM_U8(sp + 252); +L434184: +//nop; +a2 = 0x1d; +a3 = s3; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L434194; +a3 = s3; +L434194: +gp = MEM_U32(sp + 204); +//nop; +t3 = MEM_U8(sp + 252); +L4341a0: +//nop; +if (t3 == 0) {//nop; +goto L43424c;} +//nop; +t7 = 0x10018eac; +at = 0x1; +t7 = MEM_U8(t7 + 0); +a0 = 0x100; +if (t7 != at) {a1 = 0x1d; +goto L4341e4;} +a1 = 0x1d; +//nop; +a2 = 0x17; +a3 = 0x9; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4341d8; +MEM_U32(sp + 16) = zero; +L4341d8: +gp = MEM_U32(sp + 204); +//nop; +goto L43424c; +//nop; +L4341e4: +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L4341f4; +//nop; +L4341f4: +gp = MEM_U32(sp + 204); +s7 = v0; +//nop; +a0 = 0xf; +a1 = 0x1d; +a2 = 0x17; +a3 = v0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L434214; +a3 = v0; +L434214: +gp = MEM_U32(sp + 204); +a0 = 0x1b; +//nop; +a1 = 0x9; +//nop; +f_emit_i(mem, sp, a0, a1); +goto L43422c; +//nop; +L43422c: +gp = MEM_U32(sp + 204); +a0 = s7; +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L434244; +//nop; +L434244: +gp = MEM_U32(sp + 204); +//nop; +L43424c: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L434260: +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L434270; +a1 = fp; +L434270: +gp = MEM_U32(sp + 204); +fp = v0 & 0xff; +t2 = 0x10018ee8; +a1 = fp; +t2 = MEM_U8(t2 + 0); +a0 = 0x2; +if (t2 == 0) {a2 = 0x1d; +goto L4342bc;} +a2 = 0x1d; +a3 = 0x10019d50; +//nop; +a3 = MEM_U32(a3 + 0); +a0 = 0x2; +a1 = fp; +a2 = 0x1d; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4342b0; +MEM_U32(sp + 16) = zero; +L4342b0: +gp = MEM_U32(sp + 204); +//nop; +goto L4342d8; +//nop; +L4342bc: +a3 = 0x10019d4c; +//nop; +a3 = MEM_U32(a3 + 0); +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4342d0; +MEM_U32(sp + 16) = zero; +L4342d0: +gp = MEM_U32(sp + 204); +//nop; +L4342d8: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L4342ec: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L4342fc; +a1 = 0x48; +L4342fc: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L434314; +//nop; +L434314: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +t1 = 0x10018ee8; +a2 = s3; +t1 = MEM_U8(t1 + 0); +a0 = 0x56; +if (t1 == 0) {a1 = 0x1d; +goto L434360;} +a1 = 0x1d; +a3 = 0x10019d50; +//nop; +a3 = MEM_U32(a3 + 0); +a0 = 0x56; +a1 = 0x1d; +a2 = s3; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L434354; +MEM_U32(sp + 16) = zero; +L434354: +gp = MEM_U32(sp + 204); +//nop; +goto L43437c; +//nop; +L434360: +a3 = 0x10019d4c; +//nop; +a3 = MEM_U32(a3 + 0); +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L434374; +MEM_U32(sp + 16) = zero; +L434374: +gp = MEM_U32(sp + 204); +//nop; +L43437c: +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L434390: +a3 = MEM_U8(s6 + 33); +at = 0xc0000; +t8 = a3 & 0x1f; +t9 = t8 < 0x20; +t0 = -t9; +at = at | 0x8000; +t6 = t0 & at; +t4 = t6 << (t8 & 0x1f); +a3 = t8; +if ((int)t4 < 0) {//nop; +goto L4343c0;} +//nop; +abort(); +L4343c0: +//nop; +a1 = a3; +//nop; +v0 = f_fop(mem, sp, a0, a1); +goto L4343d0; +//nop; +L4343d0: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +s5 = v0 & 0xffff; +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L4343e8; +a1 = 0x48; +L4343e8: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 4); +//nop; +a1 = 0x48; +//nop; +f_eval(mem, sp, a0, a1); +goto L434400; +//nop; +L434400: +t5 = MEM_U8(s6 + 32); +at = 0x60000000; +t3 = t5 + 0xffffff80; +t7 = t3 < 0x20; +t2 = -t7; +t1 = t2 & at; +gp = MEM_U32(sp + 204); +t8 = t1 << (t3 & 0x1f); +if ((int)t8 >= 0) {//nop; +goto L43445c;} +//nop; +//nop; +a0 = MEM_U32(s6 + 0); +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L434438; +//nop; +L434438: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 4); +//nop; +MEM_U8(sp + 318) = (uint8_t)v0; +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L434450; +//nop; +L434450: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +goto L43448c; +s3 = v0 & 0xff; +L43445c: +//nop; +a0 = MEM_U32(s6 + 0); +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L43446c; +//nop; +L43446c: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 4); +//nop; +s3 = v0 & 0xff; +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L434484; +//nop; +L434484: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)v0; +L43448c: +//nop; +a2 = MEM_U8(sp + 318); +a0 = s5; +a1 = s3; +f_emit_rr(mem, sp, a0, a1, a2); +goto L4344a0; +a1 = s3; +L4344a0: +t9 = MEM_U8(s6 + 32); +gp = MEM_U32(sp + 204); +at = 0x85; +if (t9 != at) {s5 = 0x7; +goto L4344b8;} +s5 = 0x7; +s5 = 0x8; +L4344b8: +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L4344c8; +//nop; +L4344c8: +gp = MEM_U32(sp + 204); +s7 = v0; +//nop; +a0 = s5; +a1 = v0; +f_emit_ll(mem, sp, a0, a1); +goto L4344e0; +a1 = v0; +L4344e0: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s6 + 36); +//nop; +a0 = 0x1b; +//nop; +f_emit_i(mem, sp, a0, a1); +goto L4344f8; +//nop; +L4344f8: +gp = MEM_U32(sp + 204); +a0 = s7; +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L434510; +//nop; +L434510: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L43452c: +//nop; +//nop; +//nop; +f_check_no_used(mem, sp); +goto L43453c; +//nop; +L43453c: +t0 = MEM_U16(s6 + 34); +gp = MEM_U32(sp + 204); +if (t0 == 0) {a0 = 0x164; +goto L434570;} +a0 = 0x164; +v0 = 0x100197b0; +//nop; +t6 = MEM_U32(v0 + 0); +t5 = MEM_U32(v0 + 4); +t7 = MEM_U32(v0 + 8); +t4 = t6 | 0x1; +MEM_U32(v0 + 0) = t4; +MEM_U32(v0 + 4) = t5; +MEM_U32(v0 + 8) = t7; +L434570: +//nop; +a1 = 0x48; +a2 = s6 + 0x30; +f_emit_rfi(mem, sp, a0, a1, a2); +goto L434580; +a2 = s6 + 0x30; +L434580: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L43459c: +//nop; +a0 = MEM_U32(s6 + 36); +a1 = MEM_U16(s6 + 34); +//nop; +f_emit_loopno(mem, sp, a0, a1); +goto L4345b0; +//nop; +L4345b0: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L4345cc: +a1 = MEM_U8(s6 + 33); +//nop; +t2 = a1 & 0x1f; +a1 = t2; +s0 = fp + 0xffffffe0; +v0 = f_fop(mem, sp, a0, a1); +goto L4345e4; +s0 = fp + 0xffffffe0; +L4345e4: +t1 = s0 < 0x20; +t3 = -t1; +gp = MEM_U32(sp + 204); +t8 = t3 << (s0 & 0x1f); +if ((int)t8 < 0) {s5 = v0 & 0xffff; +goto L434600;} +s5 = v0 & 0xffff; +fp = 0x48; +L434600: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = fp; +f_eval(mem, sp, a0, a1); +goto L434610; +a1 = fp; +L434610: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L434628; +//nop; +L434628: +gp = MEM_U32(sp + 204); +s3 = v0 & 0xff; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L434640; +a1 = fp; +L434640: +gp = MEM_U32(sp + 204); +fp = v0 & 0xff; +//nop; +a0 = s5; +a1 = v0 & 0xff; +a2 = s3; +f_emit_rr(mem, sp, a0, a1, a2); +goto L43465c; +a2 = s3; +L43465c: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L434678: +//nop; +a2 = MEM_U32(s6 + 36); +a3 = MEM_U16(s6 + 34); +a0 = 0x32; +a1 = zero; +f_emit_dir2(mem, sp, a0, a1, a2, a3); +goto L434690; +a1 = zero; +L434690: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L4346ac: +//nop; +a2 = MEM_U32(s6 + 36); +a3 = MEM_U16(s6 + 34); +a0 = 0x33; +a1 = zero; +f_emit_dir2(mem, sp, a0, a1, a2, a3); +goto L4346c4; +a1 = zero; +L4346c4: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L4346e0: +//nop; +a0 = s6; +//nop; +f_eval_2ops(mem, sp, a0); +goto L4346f0; +//nop; +L4346f0: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L434708; +//nop; +L434708: +a3 = MEM_U8(s6 + 33); +at = 0xc0000; +t9 = a3 & 0x1f; +t0 = t9 < 0x20; +t6 = -t0; +at = at | 0x8000; +t4 = t6 & at; +gp = MEM_U32(sp + 204); +t5 = t4 << (t9 & 0x1f); +if ((int)t5 >= 0) {s7 = v0; +goto L434a2c;} +s7 = v0; +t7 = 0x1000327c; +a0 = zero; +t2 = t9 + t7; +//nop; +a1 = MEM_U8(t2 + 0); +a2 = 0x1; +v0 = f_get_free_fp_reg(mem, sp, a0, a1, a2); +goto L434750; +a2 = 0x1; +L434750: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +s4 = v0 & 0xff; +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L434768; +//nop; +L434768: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 4); +//nop; +s3 = v0 & 0xff; +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L434780; +//nop; +L434780: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)v0; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L434798; +a1 = fp; +L434798: +t1 = MEM_U8(sp + 318); +gp = MEM_U32(sp + 204); +t3 = v0 & 0xff; +if (t1 != t3) {fp = v0 & 0xff; +goto L434818;} +fp = v0 & 0xff; +t8 = MEM_U32(s6 + 4); +t6 = 0x1000327c; +t9 = MEM_U8(t8 + 33); +a0 = zero; +t0 = t9 & 0x1f; +//nop; +t4 = t0 + t6; +a1 = MEM_U8(t4 + 0); +a2 = 0x1; +v0 = f_get_free_fp_reg(mem, sp, a0, a1, a2); +goto L4347d4; +a2 = 0x1; +L4347d4: +gp = MEM_U32(sp + 204); +a1 = MEM_U8(s6 + 33); +//nop; +t5 = a1 & 0x1f; +s2 = v0 & 0xff; +a1 = t5; +a0 = 0x8b; +v0 = f_fasm(mem, sp, a0, a1); +goto L4347f4; +a0 = 0x8b; +L4347f4: +gp = MEM_U32(sp + 204); +a2 = MEM_U8(sp + 318); +//nop; +a0 = v0; +a1 = s2; +f_emit_rr(mem, sp, a0, a1, a2); +goto L43480c; +a1 = s2; +L43480c: +gp = MEM_U32(sp + 204); +a1 = MEM_U8(s6 + 33); +goto L434824; +a1 = MEM_U8(s6 + 33); +L434818: +s2 = MEM_U8(sp + 318); +//nop; +a1 = MEM_U8(s6 + 33); +L434824: +//nop; +t7 = a1 & 0x1f; +a1 = t7; +a0 = zero; +v0 = f_fop(mem, sp, a0, a1); +goto L434838; +a0 = zero; +L434838: +gp = MEM_U32(sp + 204); +a0 = v0 & 0xffff; +//nop; +a1 = fp; +a2 = s3; +f_emit_rr(mem, sp, a0, a1, a2); +goto L434850; +a2 = s3; +L434850: +gp = MEM_U32(sp + 204); +a0 = MEM_U8(s6 + 33); +t1 = 0x1000962a; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t2 = a0 & 0x1f; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t8 = t1 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t1) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0xb($sp) +at = t1 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t1) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t8 = t1 + 12; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 0xf($t1) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x13($sp) +at = t1 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t1) +a0 = t2; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t8 = t1 + 20; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 0x17($t1) +//nop; +MEM_U8(sp + 24 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x1b($sp) +at = t1 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t1) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t8 = t1 + 28; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 0x1f($t1) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x23($sp) +v0 = f_rvalue(mem, sp, a0, a1, a2, a3); +goto L434908; +//swr $t8, 0x23($sp) +L434908: +a1 = MEM_U8(s6 + 33); +gp = MEM_U32(sp + 204); +t9 = a1 & 0x1f; +a1 = t9; +//nop; +s1 = v0; +a0 = 0xfc; +v0 = f_fasm(mem, sp, a0, a1); +goto L434928; +a0 = 0xfc; +L434928: +gp = MEM_U32(sp + 204); +a0 = v0; +//nop; +a1 = s4; +a2 = s1 + 0x30; +f_emit_rfi(mem, sp, a0, a1, a2); +goto L434940; +a2 = s1 + 0x30; +L434940: +gp = MEM_U32(sp + 204); +a0 = s1; +//nop; +//nop; +//nop; +f_free_tree(mem, sp, a0); +goto L434958; +//nop; +L434958: +gp = MEM_U32(sp + 204); +a1 = MEM_U8(s6 + 33); +//nop; +t0 = a1 & 0x1f; +a1 = t0; +a0 = 0x4e; +v0 = f_fop(mem, sp, a0, a1); +goto L434974; +a0 = 0x4e; +L434974: +gp = MEM_U32(sp + 204); +a0 = v0 & 0xffff; +//nop; +a1 = s2; +a2 = s4; +f_emit_rr(mem, sp, a0, a1, a2); +goto L43498c; +a2 = s4; +L43498c: +gp = MEM_U32(sp + 204); +a0 = 0x7; +//nop; +a1 = s7; +//nop; +f_emit_ll(mem, sp, a0, a1); +goto L4349a4; +//nop; +L4349a4: +gp = MEM_U32(sp + 204); +a1 = MEM_U8(s6 + 33); +//nop; +t6 = a1 & 0x1f; +a1 = t6; +a0 = 0x5e; +v0 = f_fop(mem, sp, a0, a1); +goto L4349c0; +a0 = 0x5e; +L4349c0: +gp = MEM_U32(sp + 204); +t4 = MEM_U8(s6 + 33); +t7 = 0x1000327c; +t5 = t4 & 0x1f; +//nop; +t2 = t5 + t7; +a1 = MEM_U8(t2 + 0); +s5 = v0 & 0xffff; +a0 = s4; +f_free_fp_reg(mem, sp, a0, a1); +goto L4349e8; +a0 = s4; +L4349e8: +t3 = MEM_U8(sp + 318); +gp = MEM_U32(sp + 204); +if (s2 == t3) {//nop; +goto L434b6c;} +//nop; +t1 = MEM_U32(s6 + 4); +t0 = 0x1000327c; +t8 = MEM_U8(t1 + 33); +a0 = s2; +t9 = t8 & 0x1f; +t6 = t9 + t0; +//nop; +a1 = MEM_U8(t6 + 0); +//nop; +f_free_fp_reg(mem, sp, a0, a1); +goto L434a20; +//nop; +L434a20: +gp = MEM_U32(sp + 204); +//nop; +goto L434b6c; +//nop; +L434a2c: +//nop; +a0 = MEM_U32(s6 + 0); +s5 = 0xdb; +v0 = f_reg(mem, sp, a0); +goto L434a3c; +s5 = 0xdb; +L434a3c: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 4); +//nop; +s3 = v0 & 0xff; +//nop; +v0 = f_reg(mem, sp, a0); +goto L434a54; +//nop; +L434a54: +gp = MEM_U32(sp + 204); +MEM_U8(sp + 318) = (uint8_t)v0; +//nop; +a0 = s6; +a1 = fp; +v0 = f_get_dest(mem, sp, a0, a1); +goto L434a6c; +a1 = fp; +L434a6c: +t4 = MEM_U8(sp + 318); +gp = MEM_U32(sp + 204); +t5 = v0 & 0xff; +if (t4 != t5) {fp = v0 & 0xff; +goto L434abc;} +fp = v0 & 0xff; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L434a90; +a1 = 0x1; +L434a90: +gp = MEM_U32(sp + 204); +a2 = MEM_U8(sp + 318); +//nop; +s2 = v0 & 0xff; +a0 = 0x31; +a1 = v0 & 0xff; +a3 = s6; +f_dw_emit_rr(mem, sp, a0, a1, a2, a3); +goto L434ab0; +a3 = s6; +L434ab0: +gp = MEM_U32(sp + 204); +//nop; +goto L434ac4; +//nop; +L434abc: +s2 = MEM_U8(sp + 318); +//nop; +L434ac4: +t7 = 0x10018ecc; +a1 = fp; +t7 = MEM_U8(t7 + 0); +a2 = s3; +if (t7 != 0) {a0 = 0x167; +goto L434af8;} +a0 = 0x167; +//nop; +a0 = zero; +a3 = s6; +f_dw_emit_rr(mem, sp, a0, a1, a2, a3); +goto L434aec; +a3 = s6; +L434aec: +gp = MEM_U32(sp + 204); +//nop; +goto L434b10; +//nop; +L434af8: +//nop; +a1 = fp; +a2 = s3; +f_emit_rr(mem, sp, a0, a1, a2); +goto L434b08; +a2 = s3; +L434b08: +gp = MEM_U32(sp + 204); +//nop; +L434b10: +//nop; +a0 = 0xe; +a1 = s2; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = s7; +MEM_U32(sp + 20) = s6; +f_emit_branch_rill(mem, sp, a0, a1, a2, a3); +goto L434b30; +MEM_U32(sp + 20) = s6; +L434b30: +t2 = MEM_U16(s6 + 34); +gp = MEM_U32(sp + 204); +t1 = MEM_U8(sp + 318); +t3 = t2 & 0x2; +if (t3 == 0) {//nop; +goto L434b4c;} +//nop; +s5 = 0x3d; +L434b4c: +if (s2 == t1) {//nop; +goto L434b6c;} +//nop; +//nop; +a0 = s2; +//nop; +f_free_reg(mem, sp, a0); +goto L434b64; +//nop; +L434b64: +gp = MEM_U32(sp + 204); +//nop; +L434b6c: +t8 = 0x10018ecc; +a0 = s5; +t8 = MEM_U8(t8 + 0); +a1 = fp; +if (t8 != 0) {//nop; +goto L434ba0;} +//nop; +//nop; +a2 = fp; +a3 = s6; +f_dw_emit_rr(mem, sp, a0, a1, a2, a3); +goto L434b94; +a3 = s6; +L434b94: +gp = MEM_U32(sp + 204); +//nop; +goto L434be8; +//nop; +L434ba0: +t9 = MEM_U16(s6 + 34); +a1 = fp; +t0 = t9 & 0x2; +if (t0 == 0) {a0 = 0x169; +goto L434bd0;} +a0 = 0x169; +//nop; +a0 = 0x168; +a2 = fp; +f_emit_rr(mem, sp, a0, a1, a2); +goto L434bc4; +a2 = fp; +L434bc4: +gp = MEM_U32(sp + 204); +//nop; +goto L434be8; +//nop; +L434bd0: +//nop; +a1 = fp; +a2 = fp; +f_emit_rr(mem, sp, a0, a1, a2); +goto L434be0; +a2 = fp; +L434be0: +gp = MEM_U32(sp + 204); +//nop; +L434be8: +//nop; +a0 = s7; +//nop; +f_define_label(mem, sp, a0); +goto L434bf8; +//nop; +L434bf8: +v1 = MEM_U8(s6 + 25); +gp = MEM_U32(sp + 204); +t6 = v1 << 24; +t4 = t6 >> 25; +t5 = fp ^ t4; +t7 = t5 << 25; +t2 = t7 >> 24; +a0 = 0x10018ed4; +t3 = t2 ^ v1; +MEM_U8(s6 + 25) = (uint8_t)t3; +a0 = MEM_U8(a0 + 0); +//nop; +goto L434d7c; +//nop; +L434c2c: +t1 = 0x100095da; +a0 = 0x4; +t1 = t1; +t9 = t1 + 0x48; +a1 = 0x178c; +t0 = sp; +L434c44: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t0 = t0 + 0xc; +MEM_U8(t0 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t0) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t0 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 4 + 3) = (uint8_t)(at >> 0); +if (t1 != t9) {//swr $at, 7($t0) +goto L434c44;} +//swr $at, 7($t0) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t6 = 0x1000958a; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +t9 = t1 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t1) +t6 = t6; +MEM_U8(t0 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t0 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t0 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t0 + 12 + 3) = (uint8_t)(t9 >> 0); +t5 = t6 + 0x48; +t7 = sp; +//swr $t9, 0xf($t0) +L434cb4: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t6 != t5) {//swr $at, 0x57($t7) +goto L434cb4;} +//swr $at, 0x57($t7) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t5 = t6 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t6) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L434d30; +//nop; +L434d30: +gp = MEM_U32(sp + 204); +a1 = s6; +//nop; +a0 = 0x10006560; +//nop; +f_print_node(mem, sp, a0, a1); +goto L434d48; +//nop; +L434d48: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10006560; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_fflush(mem, a0); +goto L434d64; +//nop; +L434d64: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed4; +//nop; +a0 = MEM_U8(a0 + 0); +//nop; +L434d7c: +if (a0 == 0) {//nop; +goto L434ed8;} +//nop; +a0 = 0x10006560; +a1 = 0x1000957b; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = 0xf; +a3 = 0xf; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L434da4; +a1 = a1; +L434da4: +gp = MEM_U32(sp + 204); +a2 = 0xc; +a0 = 0x10006560; +a1 = 0x10018e00; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 0); +a3 = 0xa; +f_write_cardinal(mem, sp, a0, a1, a2, a3); +goto L434dc8; +a3 = 0xa; +L434dc8: +gp = MEM_U32(sp + 204); +a2 = 0x7; +a0 = 0x10006560; +a1 = 0x10009574; +//nop; +a0 = MEM_U32(a0 + 0); +a3 = 0x7; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L434dec; +a1 = a1; +L434dec: +gp = MEM_U32(sp + 204); +a1 = MEM_U8(s6 + 32); +s0 = 0x10006560; +a2 = 0x10004b78; +//nop; +s0 = MEM_U32(s0 + 0); +t2 = 0xa; +MEM_U32(sp + 16) = t2; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L434e1c; +a0 = s0; +L434e1c: +gp = MEM_U32(sp + 204); +a0 = s0; +a1 = 0x1000956d; +//nop; +a2 = 0x7; +a3 = 0x7; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L434e3c; +a1 = a1; +L434e3c: +gp = MEM_U32(sp + 204); +t9 = 0xa; +s0 = 0x10006560; +a1 = MEM_U8(s6 + 25); +MEM_U32(sp + 16) = t9; +//nop; +a2 = 0x10005058; +s0 = MEM_U32(s0 + 0); +t3 = a1 << 24; +a1 = t3 >> 25; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L434e74; +a0 = s0; +L434e74: +gp = MEM_U32(sp + 204); +a0 = s0; +a1 = 0x10009560; +//nop; +a2 = 0xd; +a3 = 0xd; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L434e94; +a1 = a1; +L434e94: +gp = MEM_U32(sp + 204); +a1 = MEM_U16(s6 + 20); +a0 = 0x10006560; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = 0xc; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L434eb4; +a3 = 0xa; +L434eb4: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10006560; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L434ed0; +//nop; +L434ed0: +gp = MEM_U32(sp + 204); +//nop; +L434ed8: +s6 = MEM_U32(s6 + 8); +//nop; +if (s6 != 0) {//nop; +goto L42d57c;} +//nop; +L434ee8: +ra = MEM_U32(sp + 212); +L434eec: +s0 = MEM_U32(sp + 172); +s1 = MEM_U32(sp + 176); +s2 = MEM_U32(sp + 180); +s3 = MEM_U32(sp + 184); +s4 = MEM_U32(sp + 188); +s5 = MEM_U32(sp + 192); +s6 = MEM_U32(sp + 196); +s7 = MEM_U32(sp + 200); +fp = MEM_U32(sp + 208); +sp = sp + 0x140; +return; +sp = sp + 0x140; +} + +static void f_init_eval(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L434f18: +//init_eval: +//nop; +//nop; +//nop; +at = 0x10019d40; +t6 = 0x1; +MEM_U8(at + 0) = (uint8_t)t6; +at = 0x10019d44; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10019d48; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10019d3c; +MEM_U8(at + 0) = (uint8_t)zero; +return; +MEM_U8(at + 0) = (uint8_t)zero; +} + +static void f_load_fp_literal(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L434f54: +//load_fp_literal: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +v0 = f_get_dest(mem, sp, a0, a1); +goto L434f7c; +MEM_U32(sp + 36) = a1; +L434f7c: +t6 = MEM_U32(sp + 32); +gp = MEM_U32(sp + 24); +MEM_U8(sp + 39) = (uint8_t)v0; +a1 = MEM_U8(t6 + 33); +//nop; +t7 = a1 & 0x1f; +a1 = t7; +a0 = 0xfc; +v0 = f_fasm(mem, sp, a0, a1); +goto L434fa0; +a0 = 0xfc; +L434fa0: +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 32); +//nop; +a1 = MEM_U8(sp + 39); +a0 = v0; +a2 = a2 + 0x30; +f_emit_rfi(mem, sp, a0, a1, a2); +goto L434fbc; +a2 = a2 + 0x30; +L434fbc: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_eval_int_flt_cvt(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L434fcc: +//eval_int_flt_cvt: +//nop; +//nop; +//nop; +sp = sp + 0xffffff98; +MEM_U32(sp + 44) = s0; +//nop; +s0 = a0; +MEM_U32(sp + 52) = ra; +MEM_U32(sp + 48) = gp; +MEM_U32(sp + 108) = a1; +a0 = MEM_U32(a0 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L435000; +a1 = 0x48; +L435000: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(s0 + 33); +//nop; +a0 = MEM_U8(s0 + 40); +t6 = a1 & 0x1f; +a1 = t6; +v0 = f_cvt_tab(mem, sp, a0, a1); +goto L43501c; +a1 = t6; +L43501c: +a0 = MEM_U32(s0 + 0); +gp = MEM_U32(sp + 48); +v1 = MEM_U8(a0 + 25); +MEM_U16(sp + 102) = (uint16_t)v0; +t7 = v1 << 24; +t8 = t7 >> 25; +t9 = t8 & 0xff; +t0 = t9 < 0x20; +t1 = -t0; +t2 = t1 << (t9 & 0x1f); +v1 = t9; +if ((int)t2 < 0) {//nop; +goto L435054;} +//nop; +abort(); +L435054: +//nop; +MEM_U8(sp + 101) = (uint8_t)v1; +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L435064; +//nop; +L435064: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 111); +//nop; +a0 = s0; +MEM_U8(sp + 100) = (uint8_t)v0; +v0 = f_get_dest(mem, sp, a0, a1); +goto L43507c; +MEM_U8(sp + 100) = (uint8_t)v0; +L43507c: +v1 = v0 & 0xff; +t3 = v1 + 0xffffffe0; +t4 = t3 < 0x20; +t5 = -t4; +gp = MEM_U32(sp + 48); +a2 = MEM_U8(sp + 100); +t6 = t5 << (t3 & 0x1f); +if ((int)t6 >= 0) {MEM_U8(sp + 111) = (uint8_t)v0; +goto L4350a8;} +MEM_U8(sp + 111) = (uint8_t)v0; +MEM_U8(sp + 98) = (uint8_t)v1; +goto L4350ac; +MEM_U8(sp + 98) = (uint8_t)v1; +L4350a8: +MEM_U8(sp + 98) = (uint8_t)a2; +L4350ac: +//nop; +a0 = MEM_U16(sp + 102); +a1 = MEM_U8(sp + 98); +//nop; +f_emit_rr(mem, sp, a0, a1, a2); +goto L4350c0; +//nop; +L4350c0: +v1 = MEM_U8(s0 + 40); +at = 0x6000000; +t7 = v1 < 0x20; +t8 = -t7; +t9 = t8 & at; +gp = MEM_U32(sp + 48); +t0 = t9 << (v1 & 0x1f); +if ((int)t0 >= 0) {a1 = 0x1; +goto L4350ec;} +a1 = 0x1; +a1 = zero; +goto L4350ec; +a1 = zero; +L4350ec: +a0 = MEM_U32(s0 + 0); +at = 0x49; +t1 = MEM_U8(a0 + 32); +a2 = 0x1; +if (t1 != at) {at = 0x8; +goto L435188;} +at = 0x8; +if (v1 != at) {at = 0x7; +goto L435130;} +at = 0x7; +v0 = MEM_U32(a0 + 48); +at = 0x7fff0000; +if ((int)v0 <= 0) {at = at | 0xffff; +goto L43512c;} +at = at | 0xffff; +at = (int)v0 < (int)at; +if (at == 0) {at = 0x7; +goto L435130;} +at = 0x7; +a1 = zero; +L43512c: +at = 0x7; +L435130: +if (v1 != at) {//nop; +goto L435188;} +//nop; +t2 = MEM_U32(a0 + 48); +t3 = MEM_U32(a0 + 52); +MEM_U32(sp + 56) = t2; +t4 = t2; +MEM_U32(sp + 60) = t3; +if ((int)t2 < 0) {t5 = t3; +goto L435188;} +t5 = t3; +if ((int)t2 > 0) {//nop; +goto L435164;} +//nop; +if (t3 == 0) {//nop; +goto L435188;} +//nop; +L435164: +if ((int)t4 > 0) {//nop; +goto L435188;} +//nop; +if ((int)t4 < 0) {at = 0x7fff0000; +goto L435184;} +at = 0x7fff0000; +at = at | 0xffff; +at = t5 < at; +if (at == 0) {//nop; +goto L435188;} +//nop; +L435184: +a1 = zero; +L435188: +if (a1 == 0) {//nop; +goto L435360;} +//nop; +t6 = MEM_U8(sp + 86); +t7 = 0x1000327c; +//nop; +t8 = t6 + t7; +a1 = MEM_U8(t8 + 0); +a0 = zero; +v0 = f_get_free_fp_reg(mem, sp, a0, a1, a2); +goto L4351ac; +a0 = zero; +L4351ac: +gp = MEM_U32(sp + 48); +MEM_U8(sp + 99) = (uint8_t)v0; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L4351c4; +//nop; +L4351c4: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 101); +//nop; +MEM_U32(sp + 88) = v0; +a0 = 0xe; +a2 = zero; +a3 = v0; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L4351e4; +a3 = v0; +L4351e4: +gp = MEM_U32(sp + 48); +t9 = MEM_U8(s0 + 33); +t1 = 0x10009b84; +a0 = t9 & 0x1f; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0xb($sp) +at = t1 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t1) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t3 = t1 + 12; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0xf($t1) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x13($sp) +at = t1 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t1) +//nop; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t3 = t1 + 20; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0x17($t1) +//nop; +MEM_U8(sp + 24 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x1b($sp) +at = t1 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t1) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t3 = t1 + 28; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0x1f($t1) +MEM_U8(sp + 86) = (uint8_t)a0; +MEM_U8(sp + 32 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x23($sp) +v0 = f_rvalue(mem, sp, a0, a1, a2, a3); +goto L43529c; +//swr $t3, 0x23($sp) +L43529c: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 86); +//nop; +MEM_U32(sp + 92) = v0; +a0 = 0xfc; +v0 = f_fasm(mem, sp, a0, a1); +goto L4352b4; +a0 = 0xfc; +L4352b4: +gp = MEM_U32(sp + 48); +a2 = MEM_U32(sp + 92); +//nop; +a1 = MEM_U8(sp + 99); +a0 = v0; +a2 = a2 + 0x30; +f_emit_rfi(mem, sp, a0, a1, a2); +goto L4352d0; +a2 = a2 + 0x30; +L4352d0: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 92); +//nop; +//nop; +//nop; +f_free_tree(mem, sp, a0); +goto L4352e8; +//nop; +L4352e8: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 86); +//nop; +a0 = 0x7c; +//nop; +v0 = f_fasm(mem, sp, a0, a1); +goto L435300; +//nop; +L435300: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 98); +//nop; +a3 = MEM_U8(sp + 99); +a0 = v0; +a2 = a1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L43531c; +a2 = a1; +L43531c: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 88); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L435334; +//nop; +L435334: +gp = MEM_U32(sp + 48); +t4 = MEM_U8(sp + 86); +t5 = 0x1000327c; +//nop; +t6 = t4 + t5; +a1 = MEM_U8(t6 + 0); +a0 = MEM_U8(sp + 99); +//nop; +f_free_fp_reg(mem, sp, a0, a1); +goto L435358; +//nop; +L435358: +gp = MEM_U32(sp + 48); +//nop; +L435360: +a2 = MEM_U8(s0 + 33); +//nop; +a0 = MEM_U8(sp + 111); +a1 = MEM_U8(sp + 98); +t7 = a2 & 0x1f; +a2 = t7; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L43537c; +a2 = t7; +L43537c: +ra = MEM_U32(sp + 52); +gp = MEM_U32(sp + 48); +s0 = MEM_U32(sp + 44); +sp = sp + 0x68; +return; +sp = sp + 0x68; +} + +static void f_eval_flt_int_cvt(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L435390: +//eval_flt_int_cvt: +//nop; +//nop; +//nop; +sp = sp + 0xffffffa0; +//nop; +MEM_U32(sp + 52) = ra; +MEM_U32(sp + 48) = gp; +MEM_U32(sp + 96) = a0; +MEM_U32(sp + 100) = a1; +a0 = MEM_U32(a0 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L4353c0; +a1 = 0x48; +L4353c0: +v0 = MEM_U32(sp + 96); +gp = MEM_U32(sp + 48); +a1 = MEM_U8(v0 + 33); +//nop; +a0 = MEM_U8(v0 + 40); +t7 = a1 & 0x1f; +a1 = t7; +v0 = f_cvt_tab(mem, sp, a0, a1); +goto L4353e0; +a1 = t7; +L4353e0: +v1 = MEM_U32(sp + 96); +gp = MEM_U32(sp + 48); +t8 = MEM_U8(v1 + 32); +at = 0x6e; +if (t8 != at) {MEM_U16(sp + 94) = (uint16_t)v0; +goto L435424;} +MEM_U16(sp + 94) = (uint16_t)v0; +a1 = MEM_U8(v1 + 33); +a0 = MEM_U8(v1 + 40); +t9 = a1 & 0x1f; +a1 = t9; +//nop; +//nop; +//nop; +v0 = f_rnd_tab(mem, sp, a0, a1); +goto L435418; +//nop; +L435418: +gp = MEM_U32(sp + 48); +v1 = MEM_U32(sp + 96); +MEM_U16(sp + 94) = (uint16_t)v0; +L435424: +//nop; +a0 = MEM_U32(v1 + 0); +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L435434; +//nop; +L435434: +v1 = MEM_U32(sp + 96); +gp = MEM_U32(sp + 48); +t0 = MEM_U8(v1 + 32); +at = 0x18; +if (t0 != at) {MEM_U8(sp + 90) = (uint8_t)v0; +goto L435ed0;} +MEM_U8(sp + 90) = (uint8_t)v0; +t1 = MEM_U8(v1 + 33); +at = 0x6000000; +t2 = t1 & 0x1f; +t3 = t2 < 0x20; +t4 = -t3; +t5 = t4 & at; +t6 = t5 << (t2 & 0x1f); +if ((int)t6 < 0) {t7 = 0xffffffff; +goto L435ed0;} +t7 = 0xffffffff; +at = 0x10004b70; +t8 = 0x1000327c; +MEM_U32(at + 0) = t7; +v0 = MEM_U8(v1 + 40); +//nop; +a3 = v0 + t8; +a1 = MEM_U8(a3 + 0); +MEM_U32(sp + 56) = a3; +a0 = zero; +a2 = 0x1; +MEM_U8(sp + 71) = (uint8_t)v0; +v0 = f_get_free_fp_reg(mem, sp, a0, a1, a2); +goto L4354a0; +MEM_U8(sp + 71) = (uint8_t)v0; +L4354a0: +gp = MEM_U32(sp + 48); +MEM_U8(sp + 91) = (uint8_t)v0; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L4354b8; +a1 = 0x1; +L4354b8: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 96); +//nop; +a1 = MEM_U8(sp + 103); +MEM_U8(sp + 93) = (uint8_t)v0; +v0 = f_get_dest(mem, sp, a0, a1); +goto L4354d0; +MEM_U8(sp + 93) = (uint8_t)v0; +L4354d0: +gp = MEM_U32(sp + 48); +MEM_U8(sp + 103) = (uint8_t)v0; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L4354e8; +//nop; +L4354e8: +gp = MEM_U32(sp + 48); +at = 0x1; +t9 = 0x10018ecc; +t0 = MEM_U32(sp + 96); +t9 = MEM_U8(t9 + 0); +MEM_U32(sp + 76) = v0; +if (t9 != at) {//nop; +goto L4355d4;} +//nop; +t1 = MEM_U8(t0 + 33); +at = 0x8; +t3 = t1 & 0x1f; +if (t3 != at) {//nop; +goto L4355d4;} +//nop; +//nop; +a1 = MEM_U8(sp + 91); +a2 = MEM_U8(sp + 90); +a0 = 0x14f; +f_emit_rr(mem, sp, a0, a1, a2); +goto L435530; +a0 = 0x14f; +L435530: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 103); +//nop; +a2 = MEM_U8(sp + 91); +a0 = 0x147; +f_emit_rr(mem, sp, a0, a1, a2); +goto L435548; +a0 = 0x147; +L435548: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 93); +//nop; +a2 = MEM_U8(sp + 103); +a0 = 0x13b; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L435568; +MEM_U32(sp + 16) = zero; +L435568: +gp = MEM_U32(sp + 48); +t4 = MEM_U32(sp + 76); +t5 = MEM_U32(sp + 96); +//nop; +a1 = MEM_U8(sp + 93); +a0 = 0xd; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = t4; +MEM_U32(sp + 20) = t5; +f_emit_branch_rill(mem, sp, a0, a1, a2, a3); +goto L435594; +MEM_U32(sp + 20) = t5; +L435594: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 103); +//nop; +a0 = 0x29; +a2 = 0xffffffff; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L4355b0; +a3 = zero; +L4355b0: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 76); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L4355c8; +//nop; +L4355c8: +gp = MEM_U32(sp + 48); +t6 = MEM_U32(sp + 56); +goto L435e98; +t6 = MEM_U32(sp + 56); +L4355d4: +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L4355e4; +//nop; +L4355e4: +gp = MEM_U32(sp + 48); +MEM_U32(sp + 84) = v0; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L4355fc; +//nop; +L4355fc: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 93); +//nop; +MEM_U32(sp + 80) = v0; +a0 = 0xe1; +a2 = 0x1f; +f_emit_rr(mem, sp, a0, a1, a2); +goto L435618; +a2 = 0x1f; +L435618: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 103); +//nop; +a0 = 0x29; +a2 = 0x1; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L435634; +a3 = zero; +L435634: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 103); +//nop; +a0 = 0xe2; +a2 = 0x1f; +f_emit_rr(mem, sp, a0, a1, a2); +goto L43564c; +a2 = 0x1f; +L43564c: +t2 = MEM_U32(sp + 96); +at = 0x5010000; +t6 = MEM_U8(t2 + 33); +gp = MEM_U32(sp + 48); +t7 = t6 & 0x1f; +t8 = t7 < 0x20; +t9 = -t8; +t0 = t9 & at; +t1 = t0 << (t7 & 0x1f); +if ((int)t1 >= 0) {//nop; +goto L4356c4;} +//nop; +t3 = 0x10018ecc; +at = 0x1; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L4356c4;} +//nop; +//nop; +a1 = MEM_U8(sp + 71); +a0 = 0x15b; +v0 = f_fasm(mem, sp, a0, a1); +goto L4356a0; +a0 = 0x15b; +L4356a0: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 91); +//nop; +a2 = MEM_U8(sp + 90); +a0 = v0; +f_emit_rr(mem, sp, a0, a1, a2); +goto L4356b8; +a0 = v0; +L4356b8: +gp = MEM_U32(sp + 48); +//nop; +goto L4356f4; +//nop; +L4356c4: +//nop; +a1 = MEM_U8(sp + 71); +a0 = 0x9a; +v0 = f_fasm(mem, sp, a0, a1); +goto L4356d4; +a0 = 0x9a; +L4356d4: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 91); +//nop; +a2 = MEM_U8(sp + 90); +a0 = v0; +f_emit_rr(mem, sp, a0, a1, a2); +goto L4356ec; +a0 = v0; +L4356ec: +gp = MEM_U32(sp + 48); +//nop; +L4356f4: +//nop; +a1 = MEM_U8(sp + 103); +a0 = 0xe1; +a2 = 0x1f; +f_emit_rr(mem, sp, a0, a1, a2); +goto L435708; +a2 = 0x1f; +L435708: +gp = MEM_U32(sp + 48); +a0 = 0x20; +//nop; +a1 = 0x6; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L435720; +//nop; +L435720: +gp = MEM_U32(sp + 48); +a2 = MEM_U8(sp + 103); +//nop; +a0 = 0x3; +a1 = 0x1; +a3 = 0x4; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L435740; +MEM_U32(sp + 16) = zero; +L435740: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 103); +//nop; +a0 = 0x3; +a3 = 0x78; +MEM_U32(sp + 16) = zero; +a2 = a1; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L435760; +a2 = a1; +L435760: +gp = MEM_U32(sp + 48); +a0 = 0x20; +//nop; +a1 = 0x5; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L435778; +//nop; +L435778: +gp = MEM_U32(sp + 48); +t4 = MEM_U32(sp + 84); +t5 = MEM_U32(sp + 96); +//nop; +a1 = MEM_U8(sp + 103); +a0 = 0xd; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = t4; +MEM_U32(sp + 20) = t5; +f_emit_branch_rill(mem, sp, a0, a1, a2, a3); +goto L4357a4; +MEM_U32(sp + 20) = t5; +L4357a4: +t2 = MEM_U32(sp + 96); +at = 0x5010000; +t6 = MEM_U8(t2 + 33); +gp = MEM_U32(sp + 48); +t8 = t6 & 0x1f; +t9 = t8 < 0x20; +t0 = -t9; +t7 = t0 & at; +t1 = t7 << (t8 & 0x1f); +if ((int)t1 >= 0) {//nop; +goto L4358a4;} +//nop; +t3 = 0x10018ecc; +at = 0x1; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 != at) {//nop; +goto L4358a4;} +//nop; +t4 = 0x10009bc4; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +a0 = MEM_U8(sp + 71); +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t2 = t4 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t4) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0xb($sp) +at = t4 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t4) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t2 = t4 + 12; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 0xf($t4) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x13($sp) +at = t4 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t4) +//nop; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t2 = t4 + 20; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 0x17($t4) +//nop; +MEM_U8(sp + 24 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x1b($sp) +at = t4 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t4) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t2 = t4 + 28; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 0x1f($t4) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x23($sp) +v0 = f_rvalue(mem, sp, a0, a1, a2, a3); +goto L435898; +//swr $t2, 0x23($sp) +L435898: +gp = MEM_U32(sp + 48); +MEM_U32(sp + 72) = v0; +goto L43595c; +MEM_U32(sp + 72) = v0; +L4358a4: +t6 = 0x10009ba4; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +a0 = MEM_U8(sp + 71); +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t0 = t6 + 4; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 7($t6) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0xb($sp) +at = t6 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t6) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t0 = t6 + 12; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 0xf($t6) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0x13($sp) +at = t6 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t6) +//nop; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t0 = t6 + 20; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 0x17($t6) +//nop; +MEM_U8(sp + 24 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0x1b($sp) +at = t6 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t6) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t0 = t6 + 28; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 0x1f($t6) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0x23($sp) +v0 = f_rvalue(mem, sp, a0, a1, a2, a3); +goto L435954; +//swr $t0, 0x23($sp) +L435954: +gp = MEM_U32(sp + 48); +MEM_U32(sp + 72) = v0; +L43595c: +//nop; +a1 = MEM_U8(sp + 71); +a0 = 0xfc; +v0 = f_fasm(mem, sp, a0, a1); +goto L43596c; +a0 = 0xfc; +L43596c: +gp = MEM_U32(sp + 48); +a2 = MEM_U32(sp + 72); +//nop; +a1 = MEM_U8(sp + 91); +a0 = v0; +a2 = a2 + 0x30; +f_emit_rfi(mem, sp, a0, a1, a2); +goto L435988; +a2 = a2 + 0x30; +L435988: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 72); +//nop; +//nop; +//nop; +f_free_tree(mem, sp, a0); +goto L4359a0; +//nop; +L4359a0: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 71); +//nop; +a0 = 0x7f; +//nop; +v0 = f_fasm(mem, sp, a0, a1); +goto L4359b8; +//nop; +L4359b8: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 91); +//nop; +a2 = MEM_U8(sp + 90); +a0 = v0; +a3 = a1; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L4359d4; +a3 = a1; +L4359d4: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 103); +//nop; +a0 = 0x29; +a2 = 0x1; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L4359f0; +a3 = zero; +L4359f0: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 103); +//nop; +a0 = 0xe2; +a2 = 0x1f; +f_emit_rr(mem, sp, a0, a1, a2); +goto L435a08; +a2 = 0x1f; +L435a08: +t7 = MEM_U32(sp + 96); +at = 0x5010000; +t8 = MEM_U8(t7 + 33); +gp = MEM_U32(sp + 48); +t1 = t8 & 0x1f; +t3 = t1 < 0x20; +t5 = -t3; +t4 = t5 & at; +t2 = t4 << (t1 & 0x1f); +if ((int)t2 >= 0) {//nop; +goto L435a80;} +//nop; +t9 = 0x10018ecc; +at = 0x1; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 != at) {//nop; +goto L435a80;} +//nop; +//nop; +a1 = MEM_U8(sp + 71); +a0 = 0x15b; +v0 = f_fasm(mem, sp, a0, a1); +goto L435a5c; +a0 = 0x15b; +L435a5c: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 91); +//nop; +a0 = v0; +a2 = a1; +f_emit_rr(mem, sp, a0, a1, a2); +goto L435a74; +a2 = a1; +L435a74: +gp = MEM_U32(sp + 48); +//nop; +goto L435ab0; +//nop; +L435a80: +//nop; +a1 = MEM_U8(sp + 71); +a0 = 0x9a; +v0 = f_fasm(mem, sp, a0, a1); +goto L435a90; +a0 = 0x9a; +L435a90: +gp = MEM_U32(sp + 48); +a2 = MEM_U8(sp + 91); +//nop; +a0 = v0; +a1 = a2; +f_emit_rr(mem, sp, a0, a1, a2); +goto L435aa8; +a1 = a2; +L435aa8: +gp = MEM_U32(sp + 48); +//nop; +L435ab0: +//nop; +a1 = MEM_U8(sp + 103); +a0 = 0xe1; +a2 = 0x1f; +f_emit_rr(mem, sp, a0, a1, a2); +goto L435ac4; +a2 = 0x1f; +L435ac4: +gp = MEM_U32(sp + 48); +a0 = 0x20; +//nop; +a1 = 0x6; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L435adc; +//nop; +L435adc: +gp = MEM_U32(sp + 48); +a2 = MEM_U8(sp + 103); +//nop; +a0 = 0x3; +a1 = 0x1; +a3 = 0x4; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L435afc; +MEM_U32(sp + 16) = zero; +L435afc: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 103); +//nop; +a0 = 0x3; +a3 = 0x78; +MEM_U32(sp + 16) = zero; +a2 = a1; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L435b1c; +a2 = a1; +L435b1c: +gp = MEM_U32(sp + 48); +a0 = 0x20; +//nop; +a1 = 0x5; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L435b34; +//nop; +L435b34: +gp = MEM_U32(sp + 48); +t0 = MEM_U32(sp + 80); +t7 = MEM_U32(sp + 96); +//nop; +a1 = MEM_U8(sp + 103); +a0 = 0x1a; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = t0; +MEM_U32(sp + 20) = t7; +f_emit_branch_rill(mem, sp, a0, a1, a2, a3); +goto L435b60; +MEM_U32(sp + 20) = t7; +L435b60: +gp = MEM_U32(sp + 48); +a0 = 0x20; +//nop; +a1 = 0x6; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L435b78; +//nop; +L435b78: +gp = MEM_U32(sp + 48); +at = 0x1; +t8 = 0x10018ecc; +a1 = MEM_U8(sp + 103); +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 != at) {//nop; +goto L435c88;} +//nop; +//nop; +a0 = 0x20; +a1 = 0x5; +f_emit_dir0(mem, sp, a0, a1); +goto L435ba8; +a1 = 0x5; +L435ba8: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 103); +//nop; +a2 = MEM_U8(sp + 91); +a0 = 0x147; +f_emit_rr(mem, sp, a0, a1, a2); +goto L435bc0; +a0 = 0x147; +L435bc0: +t3 = MEM_U32(sp + 96); +gp = MEM_U32(sp + 48); +a0 = MEM_U8(t3 + 33); +//nop; +t5 = a0 & 0x1f; +a0 = t5; +a2 = 0x0; +a3 = 0x0; +v0 = f_dwvalue(mem, sp, a0, a1, a2, a3); +goto L435be4; +a3 = 0x0; +L435be4: +gp = MEM_U32(sp + 48); +MEM_U32(sp + 72) = v0; +t4 = 0x80000000; +MEM_U32(v0 + 48) = t4; +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L435c04; +a1 = 0x1; +L435c04: +t1 = MEM_U32(sp + 72); +MEM_U8(sp + 92) = (uint8_t)v0; +a2 = MEM_U32(t1 + 48); +gp = MEM_U32(sp + 48); +MEM_U32(sp + 8) = a2; +a3 = MEM_U32(t1 + 52); +//nop; +a0 = 0x14c; +a1 = v0 & 0xff; +MEM_U32(sp + 12) = a3; +f_emit_rii(mem, sp, a0, a1, a2, a3); +goto L435c30; +MEM_U32(sp + 12) = a3; +L435c30: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 72); +//nop; +//nop; +//nop; +f_free_tree(mem, sp, a0); +goto L435c48; +//nop; +L435c48: +gp = MEM_U32(sp + 48); +a2 = MEM_U8(sp + 103); +//nop; +a3 = MEM_U8(sp + 92); +a0 = 0x40; +a1 = a2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L435c64; +a1 = a2; +L435c64: +gp = MEM_U32(sp + 48); +a0 = MEM_U8(sp + 92); +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L435c7c; +//nop; +L435c7c: +gp = MEM_U32(sp + 48); +//nop; +goto L435cf0; +//nop; +L435c88: +//nop; +a2 = MEM_U8(sp + 91); +a0 = 0x61; +f_emit_rr(mem, sp, a0, a1, a2); +goto L435c98; +a0 = 0x61; +L435c98: +gp = MEM_U32(sp + 48); +a0 = 0x29; +//nop; +a1 = 0x1; +a2 = 0x80000000; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L435cb4; +a3 = zero; +L435cb4: +gp = MEM_U32(sp + 48); +a2 = MEM_U8(sp + 103); +//nop; +a0 = 0x40; +a3 = 0x1; +a1 = a2; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L435cd0; +a1 = a2; +L435cd0: +gp = MEM_U32(sp + 48); +a0 = 0x20; +//nop; +a1 = 0x5; +//nop; +f_emit_dir0(mem, sp, a0, a1); +goto L435ce8; +//nop; +L435ce8: +gp = MEM_U32(sp + 48); +//nop; +L435cf0: +//nop; +a1 = MEM_U32(sp + 76); +a0 = 0x4; +f_emit_ll(mem, sp, a0, a1); +goto L435d00; +a0 = 0x4; +L435d00: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 80); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L435d18; +//nop; +L435d18: +gp = MEM_U32(sp + 48); +at = 0x1; +t7 = 0x10018ecc; +t8 = MEM_U32(sp + 96); +t7 = MEM_U8(t7 + 0); +a1 = MEM_U8(sp + 103); +if (t7 != at) {a0 = 0x29; +goto L435da0;} +a0 = 0x29; +a0 = MEM_U8(t8 + 33); +//nop; +t3 = a0 & 0x1f; +a0 = t3; +a2 = 0xffffffff; +a3 = 0xffffffff; +v0 = f_dwvalue(mem, sp, a0, a1, a2, a3); +goto L435d54; +a3 = 0xffffffff; +L435d54: +MEM_U32(sp + 72) = v0; +a2 = MEM_U32(v0 + 48); +gp = MEM_U32(sp + 48); +MEM_U32(sp + 8) = a2; +a3 = MEM_U32(v0 + 52); +//nop; +a1 = MEM_U8(sp + 103); +a0 = 0x14c; +MEM_U32(sp + 12) = a3; +f_emit_rii(mem, sp, a0, a1, a2, a3); +goto L435d7c; +MEM_U32(sp + 12) = a3; +L435d7c: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 72); +//nop; +//nop; +//nop; +f_free_tree(mem, sp, a0); +goto L435d94; +//nop; +L435d94: +gp = MEM_U32(sp + 48); +//nop; +goto L435db8; +//nop; +L435da0: +//nop; +a2 = 0xffffffff; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L435db0; +a3 = zero; +L435db0: +gp = MEM_U32(sp + 48); +//nop; +L435db8: +//nop; +a1 = MEM_U32(sp + 76); +a0 = 0x4; +f_emit_ll(mem, sp, a0, a1); +goto L435dc8; +a0 = 0x4; +L435dc8: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 84); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L435de0; +//nop; +L435de0: +gp = MEM_U32(sp + 48); +at = 0x1; +t2 = 0x10018ecc; +a2 = MEM_U8(sp + 91); +t2 = MEM_U8(t2 + 0); +a1 = MEM_U8(sp + 103); +if (t2 != at) {//nop; +goto L435e1c;} +//nop; +//nop; +a1 = MEM_U8(sp + 103); +a0 = 0x147; +f_emit_rr(mem, sp, a0, a1, a2); +goto L435e10; +a0 = 0x147; +L435e10: +gp = MEM_U32(sp + 48); +t9 = MEM_U32(sp + 96); +goto L435e38; +t9 = MEM_U32(sp + 96); +L435e1c: +//nop; +a2 = MEM_U8(sp + 91); +a0 = 0x61; +f_emit_rr(mem, sp, a0, a1, a2); +goto L435e2c; +a0 = 0x61; +L435e2c: +gp = MEM_U32(sp + 48); +//nop; +t9 = MEM_U32(sp + 96); +L435e38: +t1 = MEM_U32(sp + 80); +MEM_U32(sp + 20) = t9; +//nop; +a1 = MEM_U8(sp + 103); +a0 = 0x17; +a2 = zero; +a3 = zero; +MEM_U32(sp + 16) = t1; +f_emit_branch_rill(mem, sp, a0, a1, a2, a3); +goto L435e5c; +MEM_U32(sp + 16) = t1; +L435e5c: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 76); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L435e74; +//nop; +L435e74: +gp = MEM_U32(sp + 48); +a1 = MEM_U8(sp + 93); +//nop; +a0 = 0xe2; +a2 = 0x1f; +f_emit_rr(mem, sp, a0, a1, a2); +goto L435e8c; +a2 = 0x1f; +L435e8c: +gp = MEM_U32(sp + 48); +//nop; +t6 = MEM_U32(sp + 56); +L435e98: +//nop; +a0 = MEM_U8(sp + 91); +a1 = MEM_U8(t6 + 0); +//nop; +f_free_fp_reg(mem, sp, a0, a1); +goto L435eac; +//nop; +L435eac: +gp = MEM_U32(sp + 48); +a0 = MEM_U8(sp + 93); +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L435ec4; +//nop; +L435ec4: +gp = MEM_U32(sp + 48); +ra = MEM_U32(sp + 52); +goto L435ffc; +ra = MEM_U32(sp + 52); +L435ed0: +//nop; +a0 = zero; +a1 = 0x1; +v0 = f_get_free_reg(mem, sp, a0, a1); +goto L435ee0; +a1 = 0x1; +L435ee0: +gp = MEM_U32(sp + 48); +t0 = MEM_U32(sp + 96); +MEM_U8(sp + 93) = (uint8_t)v0; +t8 = 0x1000327c; +t7 = MEM_U8(t0 + 40); +//nop; +t3 = t7 + t8; +a1 = MEM_U8(t3 + 0); +a0 = zero; +a2 = 0x1; +v0 = f_get_free_fp_reg(mem, sp, a0, a1, a2); +goto L435f0c; +a2 = 0x1; +L435f0c: +gp = MEM_U32(sp + 48); +a0 = MEM_U16(sp + 94); +//nop; +a2 = MEM_U8(sp + 90); +a3 = MEM_U8(sp + 93); +MEM_U8(sp + 91) = (uint8_t)v0; +a1 = v0 & 0xff; +f_emit_rrr(mem, sp, a0, a1, a2, a3); +goto L435f2c; +a1 = v0 & 0xff; +L435f2c: +gp = MEM_U32(sp + 48); +a0 = MEM_U8(sp + 93); +//nop; +//nop; +//nop; +f_free_reg(mem, sp, a0); +goto L435f44; +//nop; +L435f44: +gp = MEM_U32(sp + 48); +t5 = MEM_U32(sp + 96); +t1 = 0x10004b70; +t4 = MEM_U32(t5 + 16); +t1 = MEM_U32(t1 + 0); +t2 = t4 >> 8; +if (t2 == t1) {t3 = MEM_U32(sp + 96); +goto L435fd0;} +t3 = MEM_U32(sp + 96); +t9 = MEM_U8(t5 + 40); +t6 = 0x1000327c; +a0 = MEM_U8(sp + 91); +t0 = t9 + t6; +//nop; +a1 = MEM_U8(t0 + 0); +//nop; +f_free_fp_reg(mem, sp, a0, a1); +goto L435f84; +//nop; +L435f84: +gp = MEM_U32(sp + 48); +a0 = MEM_U32(sp + 96); +//nop; +a1 = MEM_U8(sp + 103); +//nop; +v0 = f_get_dest(mem, sp, a0, a1); +goto L435f9c; +//nop; +L435f9c: +t7 = MEM_U32(sp + 96); +gp = MEM_U32(sp + 48); +a2 = MEM_U8(t7 + 33); +//nop; +a1 = MEM_U8(sp + 91); +t8 = a2 & 0x1f; +a2 = t8; +a0 = v0 & 0xff; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L435fc0; +a0 = v0 & 0xff; +L435fc0: +gp = MEM_U32(sp + 48); +ra = MEM_U32(sp + 52); +goto L435ffc; +ra = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 96); +L435fd0: +t4 = MEM_U8(sp + 91); +v0 = MEM_U8(t3 + 25); +//nop; +t2 = v0 << 24; +t1 = t2 >> 25; +t5 = t4 ^ t1; +t9 = t5 << 25; +t6 = t9 >> 24; +t0 = t6 ^ v0; +MEM_U8(t3 + 25) = (uint8_t)t0; +ra = MEM_U32(sp + 52); +L435ffc: +sp = sp + 0x60; +//nop; +return; +//nop; +} + +static void func_436008(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L436008: +//nop; +//nop; +//nop; +t6 = 0x10018ecc; +sp = sp + 0xffffffc0; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 32) = s0; +at = 0x1; +s0 = a0; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s1; +if (t6 != at) {MEM_U32(sp + 68) = a1; +goto L4361cc;} +MEM_U32(sp + 68) = a1; +v0 = MEM_U32(s0 + 0); +at = 0x52; +t7 = MEM_U8(v0 + 32); +//nop; +if (t7 != at) {//nop; +goto L4360a0;} +//nop; +//nop; +a0 = v0 + 0x20; +//nop; +v0 = f_ureg(mem, sp, a0); +goto L436068; +//nop; +L436068: +gp = MEM_U32(sp + 40); +at = 0x48; +if (v0 != at) {//nop; +goto L4360a0;} +//nop; +v0 = MEM_U32(s0 + 0); +t9 = MEM_U8(s0 + 33); +v1 = MEM_U8(v0 + 33); +//nop; +t0 = v1 << 27; +t1 = t0 >> 27; +t2 = t9 ^ t1; +t3 = t2 & 0x1f; +t4 = t3 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t4; +L4360a0: +//nop; +a0 = MEM_U32(s0 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L4360b0; +a1 = 0x48; +L4360b0: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s0 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L4360c8; +//nop; +L4360c8: +t5 = v0 & 0xff; +t6 = t5 < 0x20; +t7 = -t6; +t8 = t7 << (t5 & 0x1f); +gp = MEM_U32(sp + 40); +s1 = v0 & 0xff; +if ((int)t8 < 0) {//nop; +goto L4360ec;} +//nop; +abort(); +L4360ec: +t0 = MEM_U32(s0 + 0); +t2 = MEM_U8(s0 + 33); +t9 = MEM_U8(t0 + 33); +t3 = t2 & 0x1f; +t1 = t9 & 0x1f; +if (t1 == t3) {a0 = 0x13a; +goto L436190;} +a0 = 0x13a; +//nop; +a1 = s1; +a2 = s1; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L436120; +MEM_U32(sp + 16) = zero; +L436120: +t4 = MEM_U8(s0 + 33); +at = 0x86010000; +t6 = t4 & 0x1f; +t7 = t6 < 0x20; +t5 = -t7; +t8 = t5 & at; +gp = MEM_U32(sp + 40); +t0 = t8 << (t6 & 0x1f); +if ((int)t0 >= 0) {a0 = 0x13b; +goto L436170;} +a0 = 0x13b; +//nop; +a0 = 0x13c; +a1 = s1; +a2 = s1; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L436164; +MEM_U32(sp + 16) = zero; +L436164: +gp = MEM_U32(sp + 40); +//nop; +goto L436190; +//nop; +L436170: +//nop; +a1 = s1; +a2 = s1; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L436188; +MEM_U32(sp + 16) = zero; +L436188: +gp = MEM_U32(sp + 40); +//nop; +L436190: +//nop; +a1 = MEM_U8(sp + 71); +a0 = s0; +v0 = f_get_dest(mem, sp, a0, a1); +goto L4361a0; +a0 = s0; +L4361a0: +a2 = MEM_U8(s0 + 33); +gp = MEM_U32(sp + 40); +t9 = a2 & 0x1f; +a2 = t9; +//nop; +a0 = v0 & 0xff; +a1 = s1; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L4361c0; +a1 = s1; +L4361c0: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L4362d0; +ra = MEM_U32(sp + 44); +L4361cc: +t2 = MEM_U16(s0 + 34); +//nop; +t1 = t2 & 0x2; +if (t1 != 0) {//nop; +goto L4361e4;} +//nop; +abort(); +L4361e4: +//nop; +a0 = MEM_U32(s0 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L4361f4; +a1 = 0x48; +L4361f4: +gp = MEM_U32(sp + 40); +//nop; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L43620c; +//nop; +L43620c: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s0 + 0); +//nop; +MEM_U32(sp + 52) = v0; +//nop; +v0 = f_reg(mem, sp, a0); +goto L436224; +//nop; +L436224: +a1 = v0 & 0xff; +t3 = a1 < 0x20; +t4 = -t3; +t7 = t4 << (a1 & 0x1f); +gp = MEM_U32(sp + 40); +s1 = v0 & 0xff; +if ((int)t7 < 0) {//nop; +goto L436248;} +//nop; +abort(); +L436248: +//nop; +a3 = MEM_U32(sp + 52); +a0 = 0xf; +a2 = zero; +f_emit_rrll(mem, sp, a0, a1, a2, a3); +goto L43625c; +a2 = zero; +L43625c: +gp = MEM_U32(sp + 40); +a0 = 0x1b; +//nop; +a1 = 0x6; +//nop; +f_emit_i(mem, sp, a0, a1); +goto L436274; +//nop; +L436274: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(sp + 52); +//nop; +//nop; +//nop; +f_define_label(mem, sp, a0); +goto L43628c; +//nop; +L43628c: +gp = MEM_U32(sp + 40); +a1 = MEM_U8(sp + 71); +//nop; +a0 = s0; +//nop; +v0 = f_get_dest(mem, sp, a0, a1); +goto L4362a4; +//nop; +L4362a4: +gp = MEM_U32(sp + 40); +a2 = MEM_U8(s0 + 33); +//nop; +t5 = a2 & 0x1f; +a2 = t5; +a0 = v0 & 0xff; +a1 = s1; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L4362c4; +a1 = s1; +L4362c4: +gp = MEM_U32(sp + 40); +//nop; +ra = MEM_U32(sp + 44); +L4362d0: +s0 = MEM_U32(sp + 32); +s1 = MEM_U32(sp + 36); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_4362e0(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4362e0: +//nop; +//nop; +//nop; +t6 = 0x10018e80; +sp = sp + 0xffffffe0; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 36) = a1; +if (t6 == 0) {a3 = a0; +goto L436354;} +a3 = a0; +a2 = MEM_U8(a3 + 33); +//nop; +a0 = MEM_U8(sp + 39); +a1 = MEM_U8(v0 + -5); +t7 = a2 & 0x1f; +a2 = t7; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L436328; +a2 = t7; +L436328: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 39); +//nop; +a0 = 0x29; +a2 = zero; +a3 = zero; +a1 = a1 + 0x1; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L436348; +a1 = a1 + 0x1; +L436348: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L43639c; +ra = MEM_U32(sp + 28); +L436354: +a2 = MEM_U8(a3 + 33); +a0 = MEM_U8(sp + 39); +//nop; +a1 = MEM_U8(v0 + -5); +t8 = a2 & 0x1f; +a2 = t8; +a0 = a0 + 0x1; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L436374; +a0 = a0 + 0x1; +L436374: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 39); +//nop; +a0 = 0x29; +a2 = zero; +a3 = zero; +f_emit_ri_(mem, sp, a0, a1, a2, a3); +goto L436390; +a3 = zero; +L436390: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L43639c: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void func_4363a8(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4363a8: +//nop; +//nop; +//nop; +t6 = 0x10018e80; +sp = sp + 0xffffffd8; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 44) = a1; +if (t6 == 0) {a3 = a0; +goto L436428;} +a3 = a0; +a2 = MEM_U8(a3 + 33); +s0 = MEM_U8(v0 + -5); +//nop; +a0 = MEM_U8(sp + 47); +t7 = a2 & 0x1f; +a2 = t7; +a1 = s0; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L4363f8; +a1 = s0; +L4363f8: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +//nop; +a0 = 0x53; +a2 = s0; +a3 = 0x1f; +MEM_U32(sp + 16) = zero; +a1 = a1 + 0x1; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L43641c; +a1 = a1 + 0x1; +L43641c: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L436478; +ra = MEM_U32(sp + 36); +L436428: +a2 = MEM_U8(a3 + 33); +a0 = MEM_U8(sp + 47); +s0 = MEM_U8(v0 + -5); +//nop; +t8 = a2 & 0x1f; +a2 = t8; +a0 = a0 + 0x1; +a1 = s0; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L43644c; +a1 = s0; +L43644c: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(sp + 47); +//nop; +a0 = 0x53; +a2 = s0; +a3 = 0x1f; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L43646c; +MEM_U32(sp + 16) = zero; +L43646c: +gp = MEM_U32(sp + 32); +//nop; +ra = MEM_U32(sp + 36); +L436478: +s0 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_436484(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L436484: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +//nop; +s0 = a0; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 52) = a1; +s1 = a1 & 0xff; +a0 = MEM_U32(a0 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L4364c0; +a1 = 0x48; +L4364c0: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s0 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L4364d8; +//nop; +L4364d8: +t6 = v0 & 0xff; +t7 = t6 < 0x20; +t8 = -t7; +t9 = t8 << (t6 & 0x1f); +gp = MEM_U32(sp + 32); +MEM_U8(sp + 43) = (uint8_t)v0; +if ((int)t9 < 0) {//nop; +goto L4364fc;} +//nop; +abort(); +L4364fc: +//nop; +a0 = s0; +a1 = s1; +v0 = f_get_dest(mem, sp, a0, a1); +goto L43650c; +a1 = s1; +L43650c: +gp = MEM_U32(sp + 32); +s1 = v0 & 0xff; +t0 = 0x10018ecc; +a1 = MEM_U8(sp + 43); +t0 = MEM_U8(t0 + 0); +a0 = s1; +if (t0 != 0) {//nop; +goto L436580;} +//nop; +t1 = MEM_U8(s0 + 40); +at = 0x8; +if (t1 != at) {a0 = s0; +goto L436560;} +a0 = s0; +//nop; +a0 = s0; +t9 = t9; +a1 = s1; +v0 = sp + 0x30; +func_4362e0(mem, sp, v0, a0, a1); +goto L436554; +v0 = sp + 0x30; +L436554: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4365a0; +ra = MEM_U32(sp + 36); +L436560: +//nop; +a1 = s1; +t9 = t9; +v0 = sp + 0x30; +func_4363a8(mem, sp, v0, a0, a1); +goto L436574; +v0 = sp + 0x30; +L436574: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L4365a0; +ra = MEM_U32(sp + 36); +L436580: +a2 = MEM_U8(s0 + 33); +//nop; +t2 = a2 & 0x1f; +a2 = t2; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L436594; +a2 = t2; +L436594: +gp = MEM_U32(sp + 32); +//nop; +ra = MEM_U32(sp + 36); +L4365a0: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_4365b0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4365b0: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 36) = s1; +MEM_U32(sp + 32) = s0; +//nop; +s1 = a0; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 60) = a1; +s0 = a1 & 0xff; +a0 = MEM_U32(a0 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L4365ec; +a1 = 0x48; +L4365ec: +gp = MEM_U32(sp + 40); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +v0 = f_reg(mem, sp, a0); +goto L436604; +//nop; +L436604: +t6 = v0 & 0xff; +t7 = t6 < 0x20; +t8 = -t7; +t9 = t8 << (t6 & 0x1f); +gp = MEM_U32(sp + 40); +a3 = v0 & 0xff; +if ((int)t9 < 0) {//nop; +goto L436628;} +//nop; +abort(); +L436628: +//nop; +a0 = s1; +a1 = s0; +MEM_U8(sp + 51) = (uint8_t)a3; +v0 = f_get_dest(mem, sp, a0, a1); +goto L43663c; +MEM_U8(sp + 51) = (uint8_t)a3; +L43663c: +gp = MEM_U32(sp + 40); +a3 = MEM_U8(sp + 51); +t0 = 0x10018ecc; +s0 = v0 & 0xff; +t0 = MEM_U8(t0 + 0); +at = 0x1; +if (t0 != at) {a0 = s0; +goto L436708;} +a0 = s0; +a2 = MEM_U8(s1 + 33); +//nop; +t1 = a2 & 0x1f; +a2 = t1; +a1 = a3; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L436674; +a1 = a3; +L436674: +gp = MEM_U32(sp + 40); +a0 = 0x13a; +//nop; +a1 = s0; +a2 = s0; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L436694; +MEM_U32(sp + 16) = zero; +L436694: +t2 = MEM_U8(s1 + 33); +at = 0x6000000; +t3 = t2 & 0x1f; +t4 = t3 < 0x20; +t5 = -t4; +t7 = t5 & at; +gp = MEM_U32(sp + 40); +t8 = t7 << (t3 & 0x1f); +if ((int)t8 >= 0) {a0 = 0x13b; +goto L4366e4;} +a0 = 0x13b; +//nop; +a0 = 0x13c; +a1 = s0; +a2 = s0; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4366d8; +MEM_U32(sp + 16) = zero; +L4366d8: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L43676c; +ra = MEM_U32(sp + 44); +L4366e4: +//nop; +a1 = s0; +a2 = s0; +a3 = 0x20; +MEM_U32(sp + 16) = zero; +f_emit_rri_(mem, sp, a0, a1, a2, a3); +goto L4366fc; +MEM_U32(sp + 16) = zero; +L4366fc: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L43676c; +ra = MEM_U32(sp + 44); +L436708: +t6 = 0x10018e80; +a0 = s0; +t6 = MEM_U8(t6 + 0); +a1 = a3 + 0x1; +if (t6 == 0) {//nop; +goto L43674c;} +//nop; +a2 = MEM_U8(s1 + 33); +a0 = s0; +t9 = a2 & 0x1f; +a2 = t9; +//nop; +a1 = a3; +//nop; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L436740; +//nop; +L436740: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L43676c; +ra = MEM_U32(sp + 44); +L43674c: +a2 = MEM_U8(s1 + 33); +//nop; +t0 = a2 & 0x1f; +a2 = t0; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L436760; +a2 = t0; +L436760: +gp = MEM_U32(sp + 40); +//nop; +ra = MEM_U32(sp + 44); +L43676c: +s0 = MEM_U32(sp + 32); +s1 = MEM_U32(sp + 36); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void f_eval_int_int_cvt(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43677c: +//eval_int_int_cvt: +//nop; +//nop; +//nop; +t6 = MEM_U8(a0 + 33); +at = 0x5010000; +t7 = t6 & 0x1f; +t8 = t7 < 0x20; +t9 = -t8; +sp = sp + 0xffffffe0; +t0 = t9 & at; +t1 = t0 << (t7 & 0x1f); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if ((int)t1 >= 0) {MEM_U32(sp + 36) = a1; +goto L4367d8;} +MEM_U32(sp + 36) = a1; +//nop; +v0 = sp + 0x20; +t9 = t9; +//nop; +func_436484(mem, sp, a0, a1); +goto L4367cc; +//nop; +L4367cc: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L436838; +ra = MEM_U32(sp + 28); +L4367d8: +t2 = MEM_U8(a0 + 40); +at = 0x5010000; +t3 = t2 < 0x20; +t4 = -t3; +t5 = t4 & at; +t6 = t5 << (t2 & 0x1f); +if ((int)t6 >= 0) {//nop; +goto L436818;} +//nop; +//nop; +v0 = sp + 0x20; +t9 = t9; +//nop; +func_4365b0(mem, sp, a0, a1); +goto L43680c; +//nop; +L43680c: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L436838; +ra = MEM_U32(sp + 28); +L436818: +//nop; +v0 = sp + 0x20; +t9 = t9; +//nop; +func_436008(mem, sp, a0, a1); +goto L43682c; +//nop; +L43682c: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L436838: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void f_eval_flt_flt_cvt(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L436844: +//eval_flt_flt_cvt: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 20) = s0; +//nop; +s0 = a0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 44) = a1; +a0 = MEM_U32(a0 + 0); +a1 = 0x48; +f_eval(mem, sp, a0, a1); +goto L436878; +a1 = 0x48; +L436878: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(s0 + 33); +//nop; +a0 = MEM_U8(s0 + 40); +t6 = a1 & 0x1f; +a1 = t6; +v0 = f_cvt_tab(mem, sp, a0, a1); +goto L436894; +a1 = t6; +L436894: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +//nop; +MEM_U16(sp + 38) = (uint16_t)v0; +//nop; +v0 = f_flt_reg(mem, sp, a0); +goto L4368ac; +//nop; +L4368ac: +gp = MEM_U32(sp + 24); +a1 = MEM_U8(sp + 47); +//nop; +MEM_U8(sp + 36) = (uint8_t)v0; +a0 = s0; +v0 = f_get_dest(mem, sp, a0, a1); +goto L4368c4; +a0 = s0; +L4368c4: +t7 = v0 & 0xff; +t8 = t7 + 0xffffffe0; +t9 = t8 < 0x20; +t0 = -t9; +gp = MEM_U32(sp + 24); +t1 = t0 << (t8 & 0x1f); +MEM_U8(sp + 47) = (uint8_t)v0; +if ((int)t1 < 0) {a3 = v0 & 0xff; +goto L436914;} +a3 = v0 & 0xff; +t2 = MEM_U8(s0 + 33); +t4 = 0x1000327c; +t3 = t2 & 0x1f; +//nop; +t5 = t3 + t4; +a1 = MEM_U8(t5 + 0); +a0 = zero; +a2 = 0x1; +v0 = f_get_free_fp_reg(mem, sp, a0, a1, a2); +goto L43690c; +a2 = 0x1; +L43690c: +gp = MEM_U32(sp + 24); +a3 = v0 & 0xff; +L436914: +//nop; +a0 = MEM_U16(sp + 38); +a2 = MEM_U8(sp + 36); +a1 = a3; +MEM_U8(sp + 37) = (uint8_t)a3; +f_emit_rr(mem, sp, a0, a1, a2); +goto L43692c; +MEM_U8(sp + 37) = (uint8_t)a3; +L43692c: +a3 = MEM_U8(sp + 37); +t6 = MEM_U8(sp + 47); +gp = MEM_U32(sp + 24); +if (a3 == t6) {a0 = a3; +goto L43696c;} +a0 = a3; +t7 = MEM_U8(s0 + 33); +t0 = 0x1000327c; +t9 = t7 & 0x1f; +t8 = t9 + t0; +//nop; +a1 = MEM_U8(t8 + 0); +MEM_U8(sp + 37) = (uint8_t)a3; +f_free_fp_reg(mem, sp, a0, a1); +goto L436960; +MEM_U8(sp + 37) = (uint8_t)a3; +L436960: +gp = MEM_U32(sp + 24); +a3 = MEM_U8(sp + 37); +//nop; +L43696c: +a2 = MEM_U8(s0 + 33); +//nop; +a0 = MEM_U8(sp + 47); +t1 = a2 & 0x1f; +a2 = t1; +a1 = a3; +f_move_to_dest(mem, sp, a0, a1, a2); +goto L436988; +a1 = a3; +L436988: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +s0 = MEM_U32(sp + 20); +sp = sp + 0x28; +return; +sp = sp + 0x28; +//nop; +//nop; +//nop; +} + +static uint32_t f_add_overflow(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L4369a8: +//add_overflow: +at = 0x6; +if (a0 != at) {MEM_U32(sp + 0) = a0; +goto L4369e0;} +MEM_U32(sp + 0) = a0; +v1 = a1 ^ a2; +t6 = (int)v1 < (int)0x0; +v0 = t6 ^ 0x1; +if (v0 == 0) {t7 = a1 + a2; +goto L4369d4;} +t7 = a1 + a2; +v0 = a1 ^ t7; +t8 = (int)v0 < (int)0x0; +v0 = t8; +L4369d4: +v1 = v0 & 0xff; +v0 = v1; +return v0; +v0 = v1; +L4369e0: +t9 = ~a1; +v1 = t9 < a2; +t0 = v1 & 0xff; +v1 = t0; +v0 = v1; +return v0; +v0 = v1; +} + +static uint32_t f_sub_overflow(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L4369f8: +//sub_overflow: +at = 0x6; +if (a0 != at) {MEM_U32(sp + 0) = a0; +goto L436a2c;} +MEM_U32(sp + 0) = a0; +v1 = a1 ^ a2; +v0 = (int)v1 < (int)0x0; +if (v0 == 0) {t7 = a1 - a2; +goto L436a20;} +t7 = a1 - a2; +v0 = a1 ^ t7; +t8 = (int)v0 < (int)0x0; +v0 = t8; +L436a20: +v1 = v0 & 0xff; +v0 = v1; +return v0; +v0 = v1; +L436a2c: +v1 = a1 < a2; +t9 = v1 & 0xff; +v1 = t9; +v0 = v1; +return v0; +v0 = v1; +} + +static uint32_t f_is_constant(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L436a40: +//is_constant: +v1 = MEM_U8(a0 + 32); +//nop; +t6 = v1 ^ 0x49; +v1 = t6 < 0x1; +if (v1 == 0) {//nop; +goto L436a7c;} +//nop; +t7 = MEM_U8(a0 + 33); +at = 0x8f810000; +t8 = t7 & 0x1f; +t9 = t8 < 0x20; +t0 = -t9; +t1 = t0 & at; +v1 = t1 << (t8 & 0x1f); +t2 = (int)v1 < (int)0x0; +v1 = t2; +L436a7c: +v0 = v1; +return v0; +v0 = v1; +} + +static uint64_t f_llconst(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L436a84: +//llconst: +t6 = a1 < 0x20; +t7 = -t6; +at = 0x5010000; +t8 = t7 & at; +sp = sp + 0xfffffff8; +t9 = t8 << (a1 & 0x1f); +if ((int)t9 >= 0) {MEM_U32(sp + 12) = a1; +goto L436ab8;} +MEM_U32(sp + 12) = a1; +t0 = MEM_U32(a0 + 48); +t1 = MEM_U32(a0 + 52); +MEM_U32(sp + 0) = t0; +MEM_U32(sp + 4) = t1; +goto L436af8; +MEM_U32(sp + 4) = t1; +L436ab8: +t2 = a1 < 0x20; +t3 = -t2; +at = 0x6000000; +t4 = t3 & at; +t5 = t4 << (a1 & 0x1f); +if ((int)t5 >= 0) {t0 = 0x0; +goto L436aec;} +t0 = 0x0; +t9 = MEM_U32(a0 + 48); +//nop; +t8 = (int)t9 >> 31; +MEM_U32(sp + 0) = t8; +MEM_U32(sp + 4) = t9; +goto L436af8; +MEM_U32(sp + 4) = t9; +L436aec: +t7 = MEM_U32(a0 + 48); +MEM_U32(sp + 0) = t0; +MEM_U32(sp + 4) = t7; +L436af8: +v0 = MEM_U32(sp + 0); +v1 = MEM_U32(sp + 4); +sp = sp + 0x8; +return ((uint64_t)v0 << 32) | v1; +sp = sp + 0x8; +} + +static uint32_t f_fold(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L436b08: +//fold: +//nop; +//nop; +//nop; +sp = sp + 0xffffff80; +MEM_U32(sp + 52) = ra; +MEM_U32(sp + 48) = gp; +MEM_U32(sp + 44) = s0; +t6 = MEM_U8(a0 + 32); +at = 0x18; +if (t6 != at) {s0 = a0; +goto L436c6c;} +s0 = a0; +t7 = MEM_U16(a0 + 34); +at = 0xc0000; +t8 = t7 & 0x2; +if (t8 == 0) {//nop; +goto L436b50;} +//nop; +v0 = a0; +goto L436e40; +v0 = a0; +L436b50: +a1 = MEM_U8(s0 + 33); +at = at | 0x8000; +t9 = a1 & 0x1f; +t0 = t9 < 0x20; +t1 = -t0; +t2 = t1 & at; +t3 = t2 << (t9 & 0x1f); +if ((int)t3 >= 0) {a1 = t9; +goto L436b7c;} +a1 = t9; +v0 = s0; +goto L436e40; +v0 = s0; +L436b7c: +t4 = a1 < 0x20; +t5 = -t4; +at = 0x5010000; +t6 = t5 & at; +v0 = t6 << (a1 & 0x1f); +t7 = (int)v0 < (int)0x0; +if (t7 == 0) {v0 = t7; +goto L436bfc;} +v0 = t7; +a2 = MEM_U32(s0 + 0); +at = 0x5010000; +a3 = MEM_U8(a2 + 33); +//nop; +t8 = a3 & 0x1f; +t9 = t8 < 0x20; +t0 = -t9; +t1 = t0 & at; +t2 = t1 << (t8 & 0x1f); +if ((int)t2 < 0) {//nop; +goto L436bfc;} +//nop; +//nop; +a0 = a2; +a1 = t8; +temp64 = f_llconst(mem, sp, a0, a1); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L436bd8; +a1 = t8; +L436bd8: +t3 = MEM_U32(s0 + 0); +gp = MEM_U32(sp + 48); +MEM_U32(t3 + 52) = v1; +MEM_U32(t3 + 48) = v0; +a1 = MEM_U8(s0 + 33); +a2 = MEM_U32(s0 + 0); +t4 = a1 & 0x1f; +a1 = t4; +goto L436c48; +a1 = t4; +L436bfc: +a2 = MEM_U32(s0 + 0); +if (v0 != 0) {//nop; +goto L436c48;} +//nop; +t5 = MEM_U8(a2 + 33); +at = 0x5010000; +t6 = t5 & 0x1f; +t7 = t6 < 0x20; +t8 = -t7; +t9 = t8 & at; +t0 = t9 << (t6 & 0x1f); +if ((int)t0 >= 0) {//nop; +goto L436c48;} +//nop; +t3 = MEM_U32(a2 + 52); +//nop; +MEM_U32(a2 + 48) = t3; +a1 = MEM_U8(s0 + 33); +a2 = MEM_U32(s0 + 0); +t4 = a1 & 0x1f; +a1 = t4; +L436c48: +a3 = MEM_U8(a2 + 33); +v0 = a2; +t5 = a3 << 27; +t7 = t5 >> 27; +t8 = a1 ^ t7; +t9 = t8 & 0x1f; +t6 = t9 ^ a3; +MEM_U8(a2 + 33) = (uint8_t)t6; +goto L436e40; +MEM_U8(a2 + 33) = (uint8_t)t6; +L436c6c: +a1 = MEM_U8(s0 + 33); +//nop; +a0 = MEM_U32(s0 + 0); +t0 = a1 & 0x1f; +a1 = t0; +temp64 = f_llconst(mem, sp, a0, a1); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L436c84; +a1 = t0; +L436c84: +a2 = MEM_U32(s0 + 4); +gp = MEM_U32(sp + 48); +MEM_U32(sp + 104) = v0; +if (a2 == 0) {MEM_U32(sp + 108) = v1; +goto L436cc4;} +MEM_U32(sp + 108) = v1; +a1 = MEM_U8(s0 + 33); +//nop; +t2 = a1 & 0x1f; +a1 = t2; +a0 = a2; +temp64 = f_llconst(mem, sp, a0, a1); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L436cb0; +a0 = a2; +L436cb0: +gp = MEM_U32(sp + 48); +a0 = MEM_U8(s0 + 32); +MEM_U32(sp + 96) = v0; +MEM_U32(sp + 100) = v1; +goto L436ce8; +MEM_U32(sp + 100) = v1; +L436cc4: +a0 = MEM_U8(s0 + 32); +at = 0x19; +if (a0 != at) {//nop; +goto L436ce8;} +//nop; +t3 = MEM_U32(s0 + 36); +//nop; +t4 = (int)t3 >> 31; +MEM_U32(sp + 96) = t4; +MEM_U32(sp + 100) = t3; +L436ce8: +a1 = MEM_U8(s0 + 33); +t8 = MEM_U32(sp + 96); +t1 = a1 & 0x1f; +t7 = t1 < 0x20; +t6 = -t7; +at = 0x6000000; +t9 = MEM_U32(sp + 100); +t0 = t6 & at; +t4 = t1 < 0x20; +t5 = -t4; +at = 0x5010000; +MEM_U32(sp + 16) = t8; +t8 = t5 & at; +t2 = t0 << (t1 & 0x1f); +MEM_U32(sp + 20) = t9; +t6 = MEM_U16(s0 + 34); +t9 = t8 << (t1 & 0x1f); +t3 = (int)t2 < (int)0x0; +a1 = t1; +t1 = (int)t9 < (int)0x0; +//nop; +MEM_U32(sp + 24) = t3; +t0 = t6 & 0x2; +t2 = zero < t0; +t3 = sp + 0x70; +t7 = t1 < 0x1; +a2 = MEM_U32(sp + 104); +a3 = MEM_U32(sp + 108); +MEM_U32(sp + 28) = t7; +MEM_U32(sp + 36) = t3; +MEM_U32(sp + 32) = t2; +v0 = f_fold_constant(mem, sp, a0, a1, a2, a3); +goto L436d68; +MEM_U32(sp + 32) = t2; +L436d68: +gp = MEM_U32(sp + 48); +if (v0 == 0) {//nop; +goto L436e34;} +//nop; +a0 = MEM_U32(s0 + 0); +t4 = MEM_U8(s0 + 25); +t8 = MEM_U8(a0 + 25); +a2 = MEM_U32(s0 + 4); +t5 = t4 & 0xfffe; +t9 = t8 & 0xfffe; +v0 = 0xfffffffe; +MEM_U8(s0 + 25) = (uint8_t)t5; +if (a2 == 0) {MEM_U8(a0 + 25) = (uint8_t)t9; +goto L436dac;} +MEM_U8(a0 + 25) = (uint8_t)t9; +t1 = MEM_U8(a2 + 25); +//nop; +t7 = t1 & v0; +MEM_U8(a2 + 25) = (uint8_t)t7; +L436dac: +//nop; +a0 = s0; +//nop; +f_free_tree(mem, sp, a0); +goto L436dbc; +//nop; +L436dbc: +gp = MEM_U32(sp + 48); +a0 = s0; +//nop; +//nop; +//nop; +v0 = f_result_type(mem, sp, a0); +goto L436dd4; +//nop; +L436dd4: +t6 = v0 & 0xff; +t0 = t6 < 0x20; +t2 = -t0; +at = 0x5010000; +t3 = t2 & at; +gp = MEM_U32(sp + 48); +t4 = t3 << (t6 & 0x1f); +if ((int)t4 >= 0) {a0 = v0 & 0xff; +goto L436e18;} +a0 = v0 & 0xff; +//nop; +a2 = MEM_U32(sp + 112); +a3 = MEM_U32(sp + 116); +//nop; +v0 = f_dwvalue(mem, sp, a0, a1, a2, a3); +goto L436e0c; +//nop; +L436e0c: +gp = MEM_U32(sp + 48); +a0 = v0; +goto L436e3c; +a0 = v0; +L436e18: +//nop; +a2 = MEM_U32(sp + 116); +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L436e28; +a1 = zero; +L436e28: +gp = MEM_U32(sp + 48); +a0 = v0; +goto L436e3c; +a0 = v0; +L436e34: +v0 = s0; +goto L436e40; +v0 = s0; +L436e3c: +v0 = a0; +L436e40: +ra = MEM_U32(sp + 52); +s0 = MEM_U32(sp + 44); +sp = sp + 0x80; +return v0; +sp = sp + 0x80; +} + +static uint32_t f_fold1(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L436e50: +//fold1: +//nop; +//nop; +//nop; +sp = sp + 0xffffffa0; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s1; +MEM_U32(sp + 32) = s0; +v0 = MEM_U32(a0 + 0); +at = 0x5010000; +t6 = MEM_U8(v0 + 33); +s1 = a0; +t7 = t6 & 0x1f; +t8 = t7 < 0x20; +t9 = -t8; +t0 = t9 & at; +t1 = t0 << (t7 & 0x1f); +if ((int)t1 >= 0) {//nop; +goto L436f00;} +//nop; +//nop; +a0 = MEM_U32(v0 + 0); +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L436eac; +//nop; +L436eac: +gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L436edc;} +//nop; +v0 = MEM_U32(s1 + 0); +//nop; +t2 = MEM_U32(v0 + 0); +a0 = MEM_U32(v0 + 4); +t4 = MEM_U32(t2 + 48); +t5 = MEM_U32(t2 + 52); +MEM_U32(sp + 80) = t4; +MEM_U32(sp + 84) = t5; +goto L436f68; +MEM_U32(sp + 84) = t5; +L436edc: +t3 = MEM_U32(s1 + 0); +//nop; +a0 = MEM_U32(t3 + 4); +//nop; +t6 = MEM_U32(a0 + 48); +t7 = MEM_U32(a0 + 52); +MEM_U32(sp + 80) = t6; +MEM_U32(sp + 84) = t7; +goto L436f68; +MEM_U32(sp + 84) = t7; +L436f00: +//nop; +a0 = MEM_U32(v0 + 0); +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L436f10; +//nop; +L436f10: +gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L436f44;} +//nop; +v0 = MEM_U32(s1 + 0); +//nop; +t8 = MEM_U32(v0 + 0); +a0 = MEM_U32(v0 + 4); +t9 = MEM_U32(t8 + 48); +//nop; +t0 = (int)t9 >> 31; +MEM_U32(sp + 80) = t0; +MEM_U32(sp + 84) = t9; +goto L436f68; +MEM_U32(sp + 84) = t9; +L436f44: +t2 = MEM_U32(s1 + 0); +//nop; +a0 = MEM_U32(t2 + 4); +//nop; +t4 = MEM_U32(a0 + 48); +//nop; +t6 = (int)t4 >> 31; +MEM_U32(sp + 80) = t6; +MEM_U32(sp + 84) = t4; +L436f68: +//nop; +//nop; +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L436f78; +//nop; +L436f78: +gp = MEM_U32(sp + 40); +t5 = MEM_U32(s1 + 0); +//nop; +a2 = MEM_U32(sp + 80); +a3 = MEM_U32(sp + 84); +a0 = MEM_U8(t5 + 32); +MEM_U32(sp + 16) = v0; +v0 = f_fold_identities(mem, sp, a0, a1, a2, a3); +goto L436f98; +MEM_U32(sp + 16) = v0; +L436f98: +gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L43701c;} +//nop; +s0 = MEM_U32(s1 + 0); +//nop; +t3 = MEM_U8(s0 + 25); +a0 = MEM_U32(s0 + 0); +t8 = t3 & 0xfffe; +MEM_U8(s0 + 25) = (uint8_t)t8; +v0 = f_is_constant(mem, sp, a0); +goto L436fc0; +MEM_U8(s0 + 25) = (uint8_t)t8; +L436fc0: +gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L436fe8;} +//nop; +//nop; +a0 = MEM_U32(s0 + 4); +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L436fdc; +//nop; +L436fdc: +gp = MEM_U32(sp + 40); +MEM_U32(s1 + 0) = v0; +goto L437000; +MEM_U32(s1 + 0) = v0; +L436fe8: +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L436ff8; +//nop; +L436ff8: +gp = MEM_U32(sp + 40); +MEM_U32(s1 + 0) = v0; +L437000: +//nop; +a0 = s0; +//nop; +f_free_tree(mem, sp, a0); +goto L437010; +//nop; +L437010: +gp = MEM_U32(sp + 40); +v0 = 0x1; +goto L43710c; +v0 = 0x1; +L43701c: +t9 = MEM_U32(s1 + 0); +//nop; +a0 = MEM_U32(t9 + 4); +//nop; +//nop; +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L437038; +//nop; +L437038: +gp = MEM_U32(sp + 40); +t0 = MEM_U32(s1 + 0); +//nop; +a0 = MEM_U8(t0 + 32); +a2 = MEM_U32(sp + 80); +a3 = MEM_U32(sp + 84); +t1 = sp + 0x48; +MEM_U32(sp + 20) = t1; +MEM_U32(sp + 16) = v0; +v0 = f_fold_idempotents(mem, sp, a0, a1, a2, a3); +goto L437060; +MEM_U32(sp + 16) = v0; +L437060: +gp = MEM_U32(sp + 40); +if (v0 == 0) {v0 = zero; +goto L43710c;} +v0 = zero; +v0 = MEM_U32(s1 + 0); +at = 0x5010000; +t2 = MEM_U8(v0 + 33); +a2 = MEM_U32(sp + 72); +t4 = t2 & 0x1f; +t6 = t4 < 0x20; +t7 = -t6; +t5 = t7 & at; +t3 = t5 << (t4 & 0x1f); +if ((int)t3 >= 0) {s0 = v0; +goto L4370bc;} +s0 = v0; +a0 = MEM_U8(v0 + 33); +//nop; +a3 = MEM_U32(sp + 76); +t8 = a0 & 0x1f; +a0 = t8; +v0 = f_dwvalue(mem, sp, a0, a1, a2, a3); +goto L4370b0; +a0 = t8; +L4370b0: +gp = MEM_U32(sp + 40); +MEM_U32(s1 + 0) = v0; +goto L4370e4; +MEM_U32(s1 + 0) = v0; +L4370bc: +a0 = MEM_U8(s0 + 33); +a2 = MEM_U32(sp + 76); +t9 = a0 & 0x1f; +a0 = t9; +//nop; +a1 = zero; +//nop; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L4370dc; +//nop; +L4370dc: +gp = MEM_U32(sp + 40); +MEM_U32(s1 + 0) = v0; +L4370e4: +t2 = MEM_U8(s0 + 25); +//nop; +t6 = t2 & 0xfffe; +MEM_U8(s0 + 25) = (uint8_t)t6; +a0 = s0; +f_free_tree_and_cse(mem, sp, a0); +goto L4370fc; +a0 = s0; +L4370fc: +gp = MEM_U32(sp + 40); +v0 = 0x1; +goto L43710c; +v0 = 0x1; +v0 = zero; +L43710c: +ra = MEM_U32(sp + 44); +s0 = MEM_U32(sp + 32); +s1 = MEM_U32(sp + 36); +sp = sp + 0x60; +return v0; +sp = sp + 0x60; +//nop; +//nop; +} + +static uint32_t f_frame_offset(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L437128: +//frame_offset: +//nop; +//nop; +//nop; +v1 = 0x10019388; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +if (v1 != 0) {//nop; +goto L437158;} +//nop; +v0 = MEM_U32(a0 + 44); +//nop; +return v0; +//nop; +L437158: +t6 = 0x10019398; +//nop; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L437184;} +//nop; +t7 = MEM_U32(a0 + 44); +//nop; +v0 = v1 - t7; +v0 = -v0; +return v0; +v0 = -v0; +L437184: +t8 = MEM_U32(a0 + 44); +//nop; +v0 = t8 + v1; +//nop; +return v0; +//nop; +} + +static uint32_t f_frame_offset1(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L437198: +//frame_offset1: +//nop; +//nop; +//nop; +v1 = 0x10019388; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +if (v1 != 0) {//nop; +goto L4371c4;} +//nop; +v0 = a0; +return v0; +v0 = a0; +L4371c4: +t6 = 0x10019398; +v0 = a0 + v1; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L4371e8;} +//nop; +v0 = v1 - a0; +v0 = -v0; +return v0; +v0 = -v0; +L4371e8: +//nop; +return v0; +//nop; +//nop; +//nop; +} + +static void f_st_feinit(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4371f8: +//st_feinit: +//nop; +return; +//nop; +//nop; +//nop; +} + +static void f_swap_tree(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L437208: +//swap_tree: +v0 = MEM_U32(a0 + 0); +t6 = MEM_U32(a1 + 0); +//nop; +MEM_U32(a0 + 0) = t6; +MEM_U32(a1 + 0) = v0; +return; +MEM_U32(a1 + 0) = v0; +} + +static void f_swap_int(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L437220: +//swap_int: +v0 = MEM_U32(a0 + 0); +t6 = MEM_U32(a1 + 0); +//nop; +MEM_U32(a0 + 0) = t6; +MEM_U32(a1 + 0) = v0; +return; +MEM_U32(a1 + 0) = v0; +} + +static void func_437238(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L437238: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 20) = s0; +s0 = MEM_U32(a0 + 8); +MEM_U32(sp + 28) = ra; +v0 = MEM_U8(s0 + 32); +MEM_U32(sp + 24) = gp; +t6 = v0 < 0x80; +if (t6 == 0) {t7 = (int)v0 >> 5; +goto L437288;} +t7 = (int)v0 >> 5; +t9 = 0x10005304; +t8 = t7 << 2; +t9 = t9; +t0 = t9 + t8; +t1 = MEM_U32(t0 + 0); +//nop; +t2 = t1 << (v0 & 0x1f); +t6 = (int)t2 < (int)0x0; +L437288: +if (t6 != 0) {t4 = v0 < 0xa0; +goto L43731c;} +t4 = v0 < 0xa0; +L437290: +if (t4 == 0) {t5 = (int)v0 >> 5; +goto L4372b8;} +t5 = (int)v0 >> 5; +t9 = 0x100052f0; +t7 = t5 << 2; +t9 = t9; +t8 = t9 + t7; +t0 = MEM_U32(t8 + 0); +//nop; +t1 = t0 << (v0 & 0x1f); +t4 = (int)t1 < (int)0x0; +L4372b8: +if (t4 != 0) {//nop; +goto L4372d8;} +//nop; +//nop; +a0 = s0; +//nop; +f_delete_statement(mem, sp, a0); +goto L4372d0; +//nop; +L4372d0: +gp = MEM_U32(sp + 24); +//nop; +L4372d8: +s0 = MEM_U32(s0 + 8); +//nop; +v0 = MEM_U8(s0 + 32); +//nop; +t3 = v0 < 0x80; +if (t3 == 0) {t6 = (int)v0 >> 5; +goto L437314;} +t6 = (int)v0 >> 5; +t9 = 0x10005304; +t5 = t6 << 2; +t9 = t9; +t7 = t9 + t5; +t8 = MEM_U32(t7 + 0); +//nop; +t0 = t8 << (v0 & 0x1f); +t3 = (int)t0 < (int)0x0; +L437314: +if (t3 == 0) {t4 = v0 < 0xa0; +goto L437290;} +t4 = v0 < 0xa0; +L43731c: +ra = MEM_U32(sp + 28); +s0 = MEM_U32(sp + 20); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void func_43732c(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43732c: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 48) = s7; +MEM_U32(sp + 28) = s2; +s7 = v0; +MEM_U32(sp + 60) = ra; +MEM_U32(sp + 56) = fp; +MEM_U32(sp + 52) = gp; +MEM_U32(sp + 44) = s6; +MEM_U32(sp + 40) = s5; +MEM_U32(sp + 36) = s4; +MEM_U32(sp + 32) = s3; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +if (a0 == 0) {s2 = a0; +goto L437894;} +s2 = a0; +fp = 0x26; +s6 = 0x1; +s5 = 0x7f; +s4 = 0x88; +s3 = 0x42; +L437388: +s0 = MEM_U8(s2 + 32); +at = 0x11; +if (s0 == at) {//nop; +goto L4373b0;} +//nop; +if (s0 == s3) {at = 0x21; +goto L4373b0;} +at = 0x21; +if (s0 == at) {at = 0x3; +goto L4373b0;} +at = 0x3; +if (s0 != at) {//nop; +goto L4373bc;} +//nop; +L4373b0: +MEM_U32(s2 + 0) = zero; +MEM_U32(s2 + 4) = zero; +goto L4373f0; +MEM_U32(s2 + 4) = zero; +L4373bc: +if (s0 == s4) {at = 0x8c; +goto L4373d4;} +at = 0x8c; +if (s0 == at) {at = 0x6a; +goto L4373d4;} +at = 0x6a; +if (s0 != at) {//nop; +goto L4373f0;} +//nop; +L4373d4: +//nop; +a0 = s2; +t9 = t9; +v0 = s7; +func_437238(mem, sp, a0); +goto L4373e8; +v0 = s7; +L4373e8: +gp = MEM_U32(sp + 52); +//nop; +L4373f0: +if (s0 == s5) {//nop; +goto L437408;} +//nop; +if (s0 == fp) {//nop; +goto L437408;} +//nop; +if (s0 != s4) {//nop; +goto L437740;} +//nop; +L437408: +if (s0 == s4) {//nop; +goto L437478;} +//nop; +v1 = MEM_U32(s2 + 0); +//nop; +v0 = MEM_U8(v1 + 32); +at = v0 < 0x3e; +goto L437448; +at = v0 < 0x3e; +L437424: +t6 = MEM_U16(v1 + 34); +//nop; +t7 = t6 & 0x1; +if (t7 == 0) {//nop; +goto L437478;} +//nop; +t8 = MEM_U32(s7 + -4); +t9 = MEM_U32(s2 + 4); +MEM_U8(t9 + 23) = (uint8_t)t8; +goto L437884; +MEM_U8(t9 + 23) = (uint8_t)t8; +L437448: +if (at != 0) {at = 0x52; +goto L437460;} +at = 0x52; +if (v0 == at) {//nop; +goto L437424;} +//nop; +t0 = MEM_U32(s2 + 4); +goto L43747c; +t0 = MEM_U32(s2 + 4); +L437460: +at = 0x36; +if (v0 == at) {//nop; +goto L437424;} +//nop; +at = 0x3d; +if (v0 == at) {//nop; +goto L437424;} +//nop; +L437478: +t0 = MEM_U32(s2 + 4); +L43747c: +a1 = zero; +s0 = MEM_U32(t0 + 8); +//nop; +v0 = MEM_U8(s0 + 32); +//nop; +t1 = v0 < 0xa0; +if (t1 == 0) {t2 = (int)v0 >> 5; +goto L4374bc;} +t2 = (int)v0 >> 5; +t4 = 0x10005314; +t3 = t2 << 2; +t4 = t4; +t5 = t4 + t3; +t6 = MEM_U32(t5 + 0); +//nop; +t7 = t6 << (v0 & 0x1f); +t1 = (int)t7 < (int)0x0; +L4374bc: +if (t1 == 0) {//nop; +goto L437524;} +//nop; +L4374c4: +if (s3 != v0) {//nop; +goto L4374e0;} +//nop; +t9 = MEM_U16(s0 + 34); +//nop; +if (t9 != 0) {//nop; +goto L437524;} +//nop; +MEM_U32(s2 + 4) = s0; +L4374e0: +s0 = MEM_U32(s0 + 8); +//nop; +v0 = MEM_U8(s0 + 32); +//nop; +t0 = v0 < 0xa0; +if (t0 == 0) {t2 = (int)v0 >> 5; +goto L43751c;} +t2 = (int)v0 >> 5; +t3 = 0x10005314; +t4 = t2 << 2; +t3 = t3; +t5 = t3 + t4; +t6 = MEM_U32(t5 + 0); +//nop; +t7 = t6 << (v0 & 0x1f); +t0 = (int)t7 < (int)0x0; +L43751c: +if (t0 != 0) {//nop; +goto L4374c4;} +//nop; +L437524: +if (s4 != v0) {//nop; +goto L437538;} +//nop; +t1 = MEM_U32(s0 + 4); +//nop; +MEM_U32(s2 + 4) = t1; +L437538: +s1 = MEM_U32(s2 + 8); +s0 = MEM_U32(s2 + 4); +a0 = MEM_U8(s1 + 32); +//nop; +t9 = a0 < 0xa0; +if (t9 == 0) {t2 = (int)a0 >> 5; +goto L437574;} +t2 = (int)a0 >> 5; +t4 = 0x10005314; +t3 = t2 << 2; +t4 = t4; +t5 = t4 + t3; +t6 = MEM_U32(t5 + 0); +//nop; +t7 = t6 << (a0 & 0x1f); +t9 = (int)t7 < (int)0x0; +L437574: +if (t9 == 0) {v0 = s3 ^ a0; +goto L43760c;} +v0 = s3 ^ a0; +L43757c: +v0 = v0 < 0x1; +if (v0 == 0) {//nop; +goto L437598;} +//nop; +t0 = MEM_U16(s1 + 34); +//nop; +if (t0 != 0) {//nop; +goto L43760c;} +//nop; +L437598: +if (s0 != s1) {//nop; +goto L4375bc;} +//nop; +//nop; +a0 = s2; +//nop; +f_delete_statement(mem, sp, a0); +goto L4375b0; +//nop; +L4375b0: +gp = MEM_U32(sp + 52); +s2 = MEM_U32(s2 + 8); +goto L437888; +s2 = MEM_U32(s2 + 8); +L4375bc: +if (a1 != 0) {v1 = a1; +goto L4375c8;} +v1 = a1; +v1 = v0; +L4375c8: +s1 = MEM_U32(s1 + 8); +a1 = v1 & 0xff; +a0 = MEM_U8(s1 + 32); +//nop; +t1 = a0 < 0xa0; +if (t1 == 0) {t2 = (int)a0 >> 5; +goto L437604;} +t2 = (int)a0 >> 5; +t3 = 0x10005314; +t4 = t2 << 2; +t3 = t3; +t5 = t3 + t4; +t6 = MEM_U32(t5 + 0); +//nop; +t7 = t6 << (a0 & 0x1f); +t1 = (int)t7 < (int)0x0; +L437604: +if (t1 != 0) {v0 = s3 ^ a0; +goto L43757c;} +v0 = s3 ^ a0; +L43760c: +if (a1 != 0) {//nop; +goto L437730;} +//nop; +t9 = MEM_U8(s2 + 32); +//nop; +if (s4 == t9) {//nop; +goto L437730;} +//nop; +if (s4 != a0) {//nop; +goto L437730;} +//nop; +//nop; +a0 = s1; +t9 = t9; +v0 = s7; +func_437238(mem, sp, a0); +goto L437640; +v0 = s7; +L437640: +v0 = MEM_U32(s1 + 8); +gp = MEM_U32(sp + 52); +t0 = MEM_U8(v0 + 32); +//nop; +t2 = t0 < 0xa0; +if (t2 == 0) {t3 = (int)t0 >> 5; +goto L43767c;} +t3 = (int)t0 >> 5; +t5 = 0x10005314; +t4 = t3 << 2; +t5 = t5; +t6 = t5 + t4; +t7 = MEM_U32(t6 + 0); +//nop; +t8 = t7 << (t0 & 0x1f); +t2 = (int)t8 < (int)0x0; +L43767c: +if (t2 == 0) {//nop; +goto L437730;} +//nop; +L437684: +if (s0 != v0) {//nop; +goto L4376ec;} +//nop; +t9 = MEM_U8(s2 + 32); +//nop; +if (s5 != t9) {//nop; +goto L4376a4;} +//nop; +MEM_U8(s2 + 32) = (uint8_t)fp; +goto L4376a8; +MEM_U8(s2 + 32) = (uint8_t)fp; +L4376a4: +MEM_U8(s2 + 32) = (uint8_t)s5; +L4376a8: +t3 = MEM_U32(s1 + 4); +v0 = MEM_U16(s2 + 34); +MEM_U32(s2 + 4) = t3; +if (v0 == 0) {//nop; +goto L4376d0;} +//nop; +if (s6 != v0) {t5 = 0x2; +goto L4376cc;} +t5 = 0x2; +MEM_U16(s2 + 34) = (uint16_t)t5; +goto L4376d0; +MEM_U16(s2 + 34) = (uint16_t)t5; +L4376cc: +MEM_U16(s2 + 34) = (uint16_t)s6; +L4376d0: +//nop; +a0 = s1; +//nop; +f_delete_statement(mem, sp, a0); +goto L4376e0; +//nop; +L4376e0: +gp = MEM_U32(sp + 52); +t0 = MEM_U32(s2 + 4); +goto L43747c; +t0 = MEM_U32(s2 + 4); +L4376ec: +v0 = MEM_U32(v0 + 8); +//nop; +t4 = MEM_U8(v0 + 32); +//nop; +t6 = t4 < 0xa0; +if (t6 == 0) {t7 = (int)t4 >> 5; +goto L437728;} +t7 = (int)t4 >> 5; +t8 = 0x10005314; +t0 = t7 << 2; +t8 = t8; +t1 = t8 + t0; +t2 = MEM_U32(t1 + 0); +//nop; +t9 = t2 << (t4 & 0x1f); +t6 = (int)t9 < (int)0x0; +L437728: +if (t6 != 0) {//nop; +goto L437684;} +//nop; +L437730: +t5 = MEM_U32(s7 + -4); +t7 = MEM_U32(s2 + 4); +MEM_U8(t7 + 23) = (uint8_t)t5; +goto L437884; +MEM_U8(t7 + 23) = (uint8_t)t5; +L437740: +v0 = MEM_U8(s2 + 32); +at = 0x11; +if (v0 != at) {at = 0x31; +goto L437848;} +at = 0x31; +v0 = MEM_U32(s2 + 40); +//nop; +if (v0 == 0) {//nop; +goto L437884;} +//nop; +a0 = MEM_U32(s7 + -4); +v1 = v0; +L437768: +s2 = MEM_U32(s2 + 8); +v1 = v1 + 0xffffffff; +t8 = MEM_U32(s2 + 4); +//nop; +s0 = MEM_U32(t8 + 8); +//nop; +v0 = MEM_U8(s0 + 32); +//nop; +t0 = v0 < 0xa0; +if (t0 == 0) {t1 = (int)v0 >> 5; +goto L4377b4;} +t1 = (int)v0 >> 5; +t4 = 0x10005314; +t2 = t1 << 2; +t4 = t4; +t9 = t4 + t2; +t3 = MEM_U32(t9 + 0); +//nop; +t6 = t3 << (v0 & 0x1f); +t0 = (int)t6 < (int)0x0; +L4377b4: +if (t0 == 0) {//nop; +goto L43781c;} +//nop; +L4377bc: +if (s3 != v0) {//nop; +goto L4377d8;} +//nop; +t7 = MEM_U16(s0 + 34); +//nop; +if (t7 == 0) {//nop; +goto L4377d8;} +//nop; +MEM_U32(s2 + 4) = s0; +L4377d8: +s0 = MEM_U32(s0 + 8); +//nop; +v0 = MEM_U8(s0 + 32); +//nop; +t8 = v0 < 0xa0; +if (t8 == 0) {t1 = (int)v0 >> 5; +goto L437814;} +t1 = (int)v0 >> 5; +t2 = 0x10005314; +t4 = t1 << 2; +t2 = t2; +t9 = t2 + t4; +t3 = MEM_U32(t9 + 0); +//nop; +t6 = t3 << (v0 & 0x1f); +t8 = (int)t6 < (int)0x0; +L437814: +if (t8 != 0) {//nop; +goto L4377bc;} +//nop; +L43781c: +if (s4 != v0) {//nop; +goto L437830;} +//nop; +t0 = MEM_U32(s0 + 4); +//nop; +MEM_U32(s2 + 4) = t0; +L437830: +t7 = MEM_U32(s2 + 4); +if (v1 != 0) {MEM_U8(t7 + 23) = (uint8_t)a0; +goto L437768;} +MEM_U8(t7 + 23) = (uint8_t)a0; +s2 = MEM_U32(s2 + 8); +goto L437888; +s2 = MEM_U32(s2 + 8); +at = 0x31; +L437848: +if (v0 != at) {//nop; +goto L437884;} +//nop; +s0 = MEM_U32(s2 + 4); +//nop; +if (s0 == 0) {//nop; +goto L437884;} +//nop; +a0 = MEM_U32(s7 + -4); +//nop; +L437868: +t1 = MEM_U32(s0 + 0); +//nop; +MEM_U8(t1 + 23) = (uint8_t)a0; +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 != 0) {//nop; +goto L437868;} +//nop; +L437884: +s2 = MEM_U32(s2 + 8); +L437888: +//nop; +if (s2 != 0) {//nop; +goto L437388;} +//nop; +L437894: +ra = MEM_U32(sp + 60); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +s3 = MEM_U32(sp + 32); +s4 = MEM_U32(sp + 36); +s5 = MEM_U32(sp + 40); +s6 = MEM_U32(sp + 44); +s7 = MEM_U32(sp + 48); +fp = MEM_U32(sp + 56); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void func_4378c4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4378c4: +//nop; +//nop; +//nop; +sp = sp + 0xffffff48; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +v0 = MEM_U32(a0 + 0); +a3 = a0; +if (v0 == 0) {a2 = a1; +goto L43790c;} +a2 = a1; +L4378ec: +t6 = MEM_U32(v0 + 4); +//nop; +if (a2 == t6) {ra = MEM_U32(sp + 180); +goto L437a74;} +ra = MEM_U32(sp + 180); +v0 = MEM_U32(v0 + 12); +//nop; +if (v0 != 0) {//nop; +goto L4378ec;} +//nop; +L43790c: +//nop; +a0 = 0x10; +a1 = zero; +MEM_U32(sp + 188) = a2; +MEM_U32(sp + 184) = a3; +v0 = f_new(mem, sp, a0, a1); +goto L437924; +MEM_U32(sp + 184) = a3; +L437924: +gp = MEM_U32(sp + 176); +a2 = MEM_U32(sp + 188); +a3 = MEM_U32(sp + 184); +if (v0 != 0) {//nop; +goto L437a48;} +//nop; +t7 = 0x10009c40; +a0 = 0x4; +t7 = t7; +t9 = t7 + 0x48; +a1 = 0xe5; +t0 = sp; +L437950: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t0 = t0 + 0xc; +MEM_U8(t0 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t0) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t0 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t9) {//swr $at, 7($t0) +goto L437950;} +//swr $at, 7($t0) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t1 = 0x10009bf0; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +t9 = t7 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t7) +t1 = t1; +MEM_U8(t0 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t0 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t0 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t0 + 12 + 3) = (uint8_t)(t9 >> 0); +t3 = t1 + 0x48; +t4 = sp; +//swr $t9, 0xf($t0) +L4379c0: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t4 = t4 + 0xc; +MEM_U8(t4 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t4) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t4 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 84 + 3) = (uint8_t)(at >> 0); +if (t1 != t3) {//swr $at, 0x57($t4) +goto L4379c0;} +//swr $at, 0x57($t4) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +//nop; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +//nop; +MEM_U8(t4 + 92 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 92 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 92 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 92 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x5f($t4) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L437a3c; +//nop; +L437a3c: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L437a74; +ra = MEM_U32(sp + 180); +L437a48: +MEM_U32(v0 + 0) = a3; +MEM_U32(v0 + 4) = a2; +t5 = MEM_U32(a3 + 0); +//nop; +MEM_U32(v0 + 12) = t5; +t6 = MEM_U32(a2 + 4); +//nop; +MEM_U32(v0 + 8) = t6; +MEM_U32(a3 + 0) = v0; +MEM_U32(a2 + 4) = v0; +ra = MEM_U32(sp + 180); +L437a74: +sp = sp + 0xb8; +//nop; +return; +//nop; +} + +static void func_437a80(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L437a80: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb8; +MEM_U32(sp + 40) = s5; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +s2 = v0; +MEM_U32(sp + 52) = ra; +MEM_U32(sp + 48) = gp; +MEM_U32(sp + 44) = s6; +MEM_U32(sp + 36) = s4; +MEM_U32(sp + 32) = s3; +MEM_U32(sp + 20) = s0; +s5 = zero; +if (a0 == 0) {s1 = a0; +goto L437d6c;} +s1 = a0; +s4 = MEM_U8(sp + 67); +s3 = MEM_U32(sp + 56); +s6 = 0x21; +L437ad0: +v1 = MEM_U8(s1 + 32); +v0 = v1; +goto L437cb0; +v0 = v1; +L437adc: +t6 = MEM_U32(s2 + -8); +s4 = 0x1; +s3 = s1; +if (s6 != v1) {MEM_U8(s1 + 23) = (uint8_t)t6; +goto L437af8;} +MEM_U8(s1 + 23) = (uint8_t)t6; +s5 = s1; +goto L437d54; +s5 = s1; +L437af8: +//nop; +a0 = s5; +t9 = t9; +a1 = s1; +v0 = s2; +func_4378c4(mem, sp, a0, a1); +goto L437b10; +v0 = s2; +L437b10: +gp = MEM_U32(sp + 48); +s1 = MEM_U32(s1 + 8); +goto L437d58; +s1 = MEM_U32(s1 + 8); +L437b1c: +s4 = zero; +goto L437d54; +s4 = zero; +L437b24: +t7 = MEM_U32(s2 + -4); +t8 = MEM_U8(s1 + 23); +//nop; +if (t7 == t8) {//nop; +goto L437b94;} +//nop; +t9 = MEM_U16(s1 + 34); +//nop; +if (t9 != 0) {//nop; +goto L437b94;} +//nop; +t0 = MEM_U32(s1 + 40); +//nop; +if (t0 != 0) {//nop; +goto L437b94;} +//nop; +//nop; +a0 = s1; +//nop; +f_delete_statement(mem, sp, a0); +goto L437b68; +//nop; +L437b68: +gp = MEM_U32(sp + 48); +if (s4 != 0) {//nop; +goto L437d54;} +//nop; +//nop; +a0 = s1; +t9 = t9; +v0 = s2; +func_437238(mem, sp, a0); +goto L437b88; +v0 = s2; +L437b88: +gp = MEM_U32(sp + 48); +s1 = MEM_U32(s1 + 8); +goto L437d58; +s1 = MEM_U32(s1 + 8); +L437b94: +t1 = MEM_U16(s1 + 34); +s0 = MEM_U32(s2 + -8); +if (t1 != 0) {a0 = s5; +goto L437bb4;} +a0 = s5; +t2 = MEM_U32(s1 + 40); +//nop; +if (t2 == 0) {v0 = zero < s4; +goto L437bd4;} +v0 = zero < s4; +L437bb4: +//nop; +a1 = s1; +t9 = t9; +v0 = s2; +func_4378c4(mem, sp, a0, a1); +goto L437bc8; +v0 = s2; +L437bc8: +gp = MEM_U32(sp + 48); +//nop; +v0 = zero < s4; +L437bd4: +if (v0 == 0) {s4 = 0x1; +goto L437bfc;} +s4 = 0x1; +//nop; +a0 = s3; +t9 = t9; +a1 = s1; +v0 = s2; +func_4378c4(mem, sp, a0, a1); +goto L437bf4; +v0 = s2; +L437bf4: +gp = MEM_U32(sp + 48); +//nop; +L437bfc: +s3 = s1; +MEM_U8(s1 + 23) = (uint8_t)s0; +goto L437d54; +MEM_U8(s1 + 23) = (uint8_t)s0; +L437c08: +t3 = MEM_U32(s1 + 40); +//nop; +if (t3 == 0) {//nop; +goto L437d54;} +//nop; +t4 = MEM_U32(s2 + -8); +s3 = s1; +MEM_U8(s1 + 23) = (uint8_t)t4; +goto L437d54; +MEM_U8(s1 + 23) = (uint8_t)t4; +L437c28: +//nop; +a1 = MEM_U32(s1 + 4); +t9 = t9; +v0 = s2; +s4 = zero; +func_4378c4(mem, sp, a0, a1); +goto L437c40; +s4 = zero; +L437c40: +gp = MEM_U32(sp + 48); +s1 = MEM_U32(s1 + 8); +goto L437d58; +s1 = MEM_U32(s1 + 8); +L437c4c: +//nop; +a1 = MEM_U32(s1 + 4); +t9 = t9; +a0 = s3; +v0 = s2; +func_4378c4(mem, sp, a0, a1); +goto L437c64; +v0 = s2; +L437c64: +gp = MEM_U32(sp + 48); +s1 = MEM_U32(s1 + 8); +goto L437d58; +s1 = MEM_U32(s1 + 8); +L437c70: +s0 = MEM_U32(s1 + 4); +s4 = zero; +if (s0 == 0) {//nop; +goto L437d54;} +//nop; +L437c80: +//nop; +a1 = MEM_U32(s0 + 0); +t9 = t9; +a0 = s3; +v0 = s2; +func_4378c4(mem, sp, a0, a1); +goto L437c98; +v0 = s2; +L437c98: +s0 = MEM_U32(s0 + 8); +gp = MEM_U32(sp + 48); +if (s0 != 0) {//nop; +goto L437c80;} +//nop; +s1 = MEM_U32(s1 + 8); +goto L437d58; +s1 = MEM_U32(s1 + 8); +L437cb0: +at = v0 < 0x32; +if (at != 0) {at = v0 < 0x80; +goto L437d0c;} +at = v0 < 0x80; +if (at != 0) {at = 0x88; +goto L437ce0;} +at = 0x88; +if (v0 == at) {a0 = s3; +goto L437c28;} +a0 = s3; +at = 0x8c; +if (v0 == at) {//nop; +goto L437c28;} +//nop; +s1 = MEM_U32(s1 + 8); +goto L437d58; +s1 = MEM_U32(s1 + 8); +L437ce0: +at = 0x42; +if (v0 == at) {//nop; +goto L437b24;} +//nop; +at = 0x6a; +if (v0 == at) {//nop; +goto L437b1c;} +//nop; +at = 0x7f; +if (v0 == at) {//nop; +goto L437c4c;} +//nop; +s1 = MEM_U32(s1 + 8); +goto L437d58; +s1 = MEM_U32(s1 + 8); +L437d0c: +at = v0 < 0x12; +if (at != 0) {at = 0x3; +goto L437d40;} +at = 0x3; +if (v0 == s6) {at = 0x26; +goto L437adc;} +at = 0x26; +if (v0 == at) {//nop; +goto L437c4c;} +//nop; +at = 0x31; +if (v0 == at) {//nop; +goto L437c70;} +//nop; +s1 = MEM_U32(s1 + 8); +goto L437d58; +s1 = MEM_U32(s1 + 8); +at = 0x3; +L437d40: +if (v0 == at) {//nop; +goto L437adc;} +//nop; +at = 0x11; +if (v0 == at) {//nop; +goto L437c08;} +//nop; +L437d54: +s1 = MEM_U32(s1 + 8); +L437d58: +//nop; +if (s1 != 0) {//nop; +goto L437ad0;} +//nop; +MEM_U8(sp + 67) = (uint8_t)s4; +MEM_U32(sp + 56) = s3; +L437d6c: +ra = MEM_U32(sp + 52); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +s3 = MEM_U32(sp + 32); +s4 = MEM_U32(sp + 36); +s5 = MEM_U32(sp + 40); +s6 = MEM_U32(sp + 44); +sp = sp + 0x48; +return; +sp = sp + 0x48; +} + +static void func_437d94(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L437d94: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +MEM_U32(sp + 40) = a0; +s2 = MEM_U32(v0 + 4); +//nop; +s0 = MEM_U32(s2 + 0); +a1 = 0x4c; +a2 = 0x1; +a3 = 0xa; +a0 = s0; +f_write_char(mem, sp, a0, a1, a2); +goto L437ddc; +a0 = s0; +L437ddc: +t6 = MEM_U32(sp + 40); +gp = MEM_U32(sp + 32); +a1 = MEM_U32(t6 + 16); +//nop; +t7 = a1 >> 8; +a1 = t7; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L437e04; +a3 = 0xa; +L437e04: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s2 + 0); +a1 = 0x10009c99; +//nop; +a2 = 0x4; +a3 = 0x4; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L437e24; +a1 = a1; +L437e24: +t8 = MEM_U32(sp + 40); +gp = MEM_U32(sp + 32); +s1 = MEM_U32(t8 + 4); +//nop; +if (s1 == 0) {//nop; +goto L437e94;} +//nop; +L437e3c: +s0 = MEM_U32(s2 + 0); +a1 = 0x10009c97; +//nop; +a2 = 0x2; +a3 = 0x2; +a0 = s0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L437e5c; +a1 = a1; +L437e5c: +t9 = MEM_U32(s1 + 0); +gp = MEM_U32(sp + 32); +a1 = MEM_U32(t9 + 16); +//nop; +t0 = a1 >> 8; +a1 = t0; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L437e84; +a3 = 0xa; +L437e84: +s1 = MEM_U32(s1 + 8); +gp = MEM_U32(sp + 32); +if (s1 != 0) {//nop; +goto L437e3c;} +//nop; +L437e94: +a1 = 0x10009c92; +//nop; +a0 = MEM_U32(s2 + 0); +a2 = 0x5; +a3 = 0x5; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L437eb0; +a1 = a1; +L437eb0: +t1 = MEM_U32(sp + 40); +gp = MEM_U32(sp + 32); +s1 = MEM_U32(t1 + 0); +//nop; +if (s1 == 0) {//nop; +goto L437f20;} +//nop; +L437ec8: +s0 = MEM_U32(s2 + 0); +a1 = 0x10009c90; +//nop; +a2 = 0x2; +a3 = 0x2; +a0 = s0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L437ee8; +a1 = a1; +L437ee8: +t2 = MEM_U32(s1 + 4); +gp = MEM_U32(sp + 32); +a1 = MEM_U32(t2 + 16); +//nop; +t3 = a1 >> 8; +a1 = t3; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L437f10; +a3 = 0xa; +L437f10: +s1 = MEM_U32(s1 + 12); +gp = MEM_U32(sp + 32); +if (s1 != 0) {//nop; +goto L437ec8;} +//nop; +L437f20: +//nop; +a0 = MEM_U32(s2 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L437f30; +//nop; +L437f30: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void func_437f4c(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L437f4c: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +v1 = MEM_U32(v0 + -4); +t6 = MEM_U8(a0 + 23); +s1 = v0; +if (v1 == t6) {ra = MEM_U32(sp + 36); +goto L437fb8;} +ra = MEM_U32(sp + 36); +s0 = MEM_U32(a0 + 0); +MEM_U8(a0 + 23) = (uint8_t)v1; +if (s0 == 0) {ra = MEM_U32(sp + 36); +goto L437fb8;} +ra = MEM_U32(sp + 36); +L437f90: +//nop; +a0 = MEM_U32(s0 + 4); +t9 = t9; +v0 = s1; +func_437f4c(mem, sp, v0, a0); +goto L437fa4; +v0 = s1; +L437fa4: +s0 = MEM_U32(s0 + 12); +gp = MEM_U32(sp + 32); +if (s0 != 0) {//nop; +goto L437f90;} +//nop; +ra = MEM_U32(sp + 36); +L437fb8: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static uint32_t func_437fc8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L437fc8: +v0 = MEM_U32(a0 + 0); +//nop; +if (v0 == 0) {//nop; +goto L438000;} +//nop; +L437fd8: +t6 = MEM_U32(v0 + 4); +//nop; +if (a1 != t6) {//nop; +goto L437ff0;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L437ff0: +v0 = MEM_U32(v0 + 12); +//nop; +if (v0 != 0) {//nop; +goto L437fd8;} +//nop; +L438000: +v0 = 0x1; +//nop; +return v0; +//nop; +} + +static uint32_t func_43800c(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43800c: +v1 = a0; +L438010: +v1 = MEM_U32(v1 + 8); +//nop; +if (v1 == 0) {//nop; +goto L43805c;} +//nop; +t6 = MEM_U8(v1 + 32); +//nop; +t7 = t6 < 0x60; +if (t7 == 0) {t8 = (int)t6 >> 5; +goto L438054;} +t8 = (int)t6 >> 5; +t0 = 0x10005328; +t9 = t8 << 2; +t0 = t0; +t1 = t0 + t9; +t2 = MEM_U32(t1 + 0); +//nop; +t3 = t2 << (t6 & 0x1f); +t7 = (int)t3 < (int)0x0; +L438054: +if (t7 == 0) {//nop; +goto L438010;} +//nop; +L43805c: +v0 = v1; +return v0; +v0 = v1; +} + +static uint32_t func_438064(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L438064: +v1 = a0; +L438068: +v1 = MEM_U32(v1 + 12); +//nop; +if (v1 == 0) {//nop; +goto L4380b4;} +//nop; +t6 = MEM_U8(v1 + 32); +//nop; +t7 = t6 < 0x60; +if (t7 == 0) {t8 = (int)t6 >> 5; +goto L4380ac;} +t8 = (int)t6 >> 5; +t0 = 0x10005334; +t9 = t8 << 2; +t0 = t0; +t1 = t0 + t9; +t2 = MEM_U32(t1 + 0); +//nop; +t3 = t2 << (t6 & 0x1f); +t7 = (int)t3 < (int)0x0; +L4380ac: +if (t7 == 0) {//nop; +goto L438068;} +//nop; +L4380b4: +v0 = v1; +return v0; +v0 = v1; +} + +static uint32_t func_4380bc(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4380bc: +v0 = a0; +L4380c0: +v0 = MEM_U32(v0 + 8); +//nop; +if (v0 != 0) {//nop; +goto L4380d8;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L4380d8: +a0 = MEM_U8(v0 + 32); +//nop; +t6 = a0 < 0xa0; +if (t6 == 0) {t7 = (int)a0 >> 5; +goto L43810c;} +t7 = (int)a0 >> 5; +t9 = 0x10005340; +t8 = t7 << 2; +t9 = t9; +t0 = t9 + t8; +t1 = MEM_U32(t0 + 0); +//nop; +t2 = t1 << (a0 & 0x1f); +t6 = (int)t2 < (int)0x0; +L43810c: +if (t6 == 0) {//nop; +goto L4380c0;} +//nop; +v1 = a0 ^ 0x8c; +v1 = v1 < 0x1; +v0 = v1 & 0xff; +//nop; +return v0; +//nop; +} + +static void func_438128(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L438128: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +t6 = MEM_U8(a0 + 32); +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +v1 = 0x21; +s1 = v0; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s4; +MEM_U32(sp + 32) = s3; +MEM_U32(sp + 28) = s2; +if (v1 == t6) {s0 = a0; +goto L438180;} +s0 = a0; +L438168: +s0 = MEM_U32(s0 + 8); +//nop; +t7 = MEM_U8(s0 + 32); +//nop; +if (v1 != t7) {//nop; +goto L438168;} +//nop; +L438180: +s4 = 0x88; +L438184: +//nop; +a0 = s0; +t9 = t9; +v0 = s1; +v0 = func_43800c(mem, sp, a0); +goto L438198; +v0 = s1; +L438198: +gp = MEM_U32(sp + 40); +s2 = v0; +//nop; +a1 = v0; +t9 = t9; +v0 = s1; +a0 = s0; +v0 = func_437fc8(mem, sp, a0, a1); +goto L4381b8; +a0 = s0; +L4381b8: +gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L4382ac;} +//nop; +if (s2 == 0) {//nop; +goto L4382ac;} +//nop; +v1 = MEM_U32(s2 + 12); +v0 = s1; +t8 = MEM_U8(v1 + 32); +//nop; +if (s4 != t8) {//nop; +goto L4382ac;} +//nop; +//nop; +s0 = MEM_U32(v1 + 4); +t9 = t9; +a0 = s0; +v0 = func_43800c(mem, sp, a0); +goto L4381f8; +a0 = s0; +L4381f8: +gp = MEM_U32(sp + 40); +if (v0 == 0) {s3 = v0; +goto L4382ac;} +s3 = v0; +//nop; +a0 = s0; +t9 = t9; +v0 = s1; +v0 = func_4380bc(mem, sp, a0); +goto L438218; +v0 = s1; +L438218: +gp = MEM_U32(sp + 40); +if (v0 != 0) {a0 = s0; +goto L438244;} +a0 = s0; +//nop; +a1 = s3; +t9 = t9; +v0 = s1; +v0 = func_437fc8(mem, sp, a0, a1); +goto L438238; +v0 = s1; +L438238: +gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L4382ac;} +//nop; +L438244: +//nop; +a0 = s0; +t9 = t9; +v0 = s1; +v0 = func_438064(mem, sp, a0); +goto L438258; +v0 = s1; +L438258: +gp = MEM_U32(sp + 40); +a0 = v0; +//nop; +v0 = s1; +t9 = t9; +a1 = s0; +v0 = func_437fc8(mem, sp, a0, a1); +goto L438274; +a1 = s0; +L438274: +gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L4382ac;} +//nop; +v1 = MEM_U32(s0 + 12); +a0 = MEM_U32(s3 + 12); +MEM_U32(v1 + 8) = s3; +MEM_U32(s3 + 12) = v1; +v0 = MEM_U32(s2 + 12); +//nop; +MEM_U32(s0 + 12) = v0; +MEM_U32(a0 + 8) = s2; +MEM_U32(v0 + 8) = s0; +MEM_U32(s2 + 12) = v0; +goto L4382b4; +MEM_U32(s2 + 12) = v0; +L4382ac: +if (s2 != 0) {s0 = s2; +goto L438184;} +s0 = s2; +L4382b4: +ra = MEM_U32(sp + 44); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +s3 = MEM_U32(sp + 32); +s4 = MEM_U32(sp + 36); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_4382d4(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4382d4: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 24) = s0; +s3 = v0; +MEM_U32(sp + 60) = ra; +MEM_U32(sp + 56) = gp; +MEM_U32(sp + 52) = s7; +MEM_U32(sp + 48) = s6; +MEM_U32(sp + 44) = s5; +MEM_U32(sp + 40) = s4; +MEM_U32(sp + 28) = s1; +s2 = zero; +if (a0 == 0) {s0 = a0; +goto L438490;} +s0 = a0; +s7 = 0x42; +s6 = 0x11; +s5 = 0x3; +s4 = 0x21; +L43832c: +v1 = MEM_U8(s0 + 32); +//nop; +v0 = v1; +if (v0 == s4) {//nop; +goto L438368;} +//nop; +if (v0 == s5) {//nop; +goto L438368;} +//nop; +if (v0 == s7) {//nop; +goto L438368;} +//nop; +if (v0 != s6) {//nop; +goto L43842c;} +//nop; +t6 = MEM_U32(s0 + 40); +//nop; +if (t6 == 0) {//nop; +goto L43842c;} +//nop; +L438368: +s2 = MEM_U8(s3 + 11); +if (v0 == s4) {//nop; +goto L43837c;} +//nop; +if (v0 != s5) {//nop; +goto L438398;} +//nop; +L43837c: +//nop; +a0 = s0; +t9 = t9; +v0 = s3; +func_437f4c(mem, sp, v0, a0); +goto L438390; +v0 = s3; +L438390: +gp = MEM_U32(sp + 56); +//nop; +L438398: +s1 = MEM_U32(s3 + -4); +if (s2 == 0) {//nop; +goto L4383c0;} +//nop; +//nop; +a0 = s0; +t9 = t9; +v0 = s3; +func_437d94(mem, sp, v0, a0); +goto L4383b8; +v0 = s3; +L4383b8: +gp = MEM_U32(sp + 56); +//nop; +L4383c0: +v1 = MEM_U8(s0 + 32); +//nop; +if (s6 != v1) {//nop; +goto L4383ec;} +//nop; +t7 = MEM_U8(s0 + 23); +//nop; +s2 = s1 ^ t7; +s2 = zero < s2; +t8 = s2 & 0xff; +s2 = t8; +goto L43842c; +s2 = t8; +L4383ec: +t9 = MEM_U8(s0 + 23); +//nop; +v0 = s1 ^ t9; +v0 = zero < v0; +if (v0 == 0) {s2 = v0 & 0xff; +goto L43842c;} +s2 = v0 & 0xff; +v0 = MEM_U16(s0 + 34); +//nop; +t0 = v0 < 0x1; +if (t0 == 0) {v0 = t0; +goto L438428;} +v0 = t0; +v0 = MEM_U32(s0 + 40); +//nop; +t1 = v0 < 0x1; +v0 = t1; +L438428: +s2 = v0 & 0xff; +L43842c: +if (s2 == 0) {t2 = v1 < 0x80; +goto L438480;} +t2 = v1 < 0x80; +if (t2 == 0) {t3 = (int)v1 >> 5; +goto L438460;} +t3 = (int)v1 >> 5; +t5 = 0x10005354; +t4 = t3 << 2; +t5 = t5; +t6 = t5 + t4; +t7 = MEM_U32(t6 + 0); +//nop; +t8 = t7 << (v1 & 0x1f); +t9 = (int)t8 < (int)0x0; +t2 = t9; +L438460: +if (t2 != 0) {//nop; +goto L438480;} +//nop; +//nop; +a0 = s0; +//nop; +f_delete_statement(mem, sp, a0); +goto L438478; +//nop; +L438478: +gp = MEM_U32(sp + 56); +//nop; +L438480: +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 != 0) {//nop; +goto L43832c;} +//nop; +L438490: +ra = MEM_U32(sp + 60); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +s4 = MEM_U32(sp + 40); +s5 = MEM_U32(sp + 44); +s6 = MEM_U32(sp + 48); +s7 = MEM_U32(sp + 52); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void f_labelopt(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4384bc: +//labelopt: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 24) = s0; +s0 = a0; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 60) = a1; +MEM_U32(sp + 64) = a2; +MEM_U32(sp + 68) = a3; +v0 = f_next_mark(mem, sp); +goto L4384f4; +MEM_U32(sp + 68) = a3; +L4384f4: +gp = MEM_U32(sp + 32); +s1 = MEM_U32(sp + 60); +//nop; +MEM_U32(sp + 52) = v0; +//nop; +v0 = f_next_mark(mem, sp); +goto L43850c; +//nop; +L43850c: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 48) = v0; +//nop; +v0 = sp + 0x38; +t9 = t9; +a0 = s0; +func_43732c(mem, sp, v0, a0); +goto L438528; +a0 = s0; +L438528: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +v0 = sp + 0x38; +t9 = t9; +//nop; +func_437a80(mem, sp, v0, a0); +goto L438544; +//nop; +L438544: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +v0 = sp + 0x38; +t9 = t9; +//nop; +func_438128(mem, sp, a0); +goto L438560; +//nop; +L438560: +t6 = MEM_U8(sp + 67); +gp = MEM_U32(sp + 32); +if (t6 == 0) {a2 = 0x1d; +goto L4385fc;} +a2 = 0x1d; +a0 = MEM_U32(s1 + 0); +a1 = 0x10009cfa; +//nop; +a3 = 0x1d; +MEM_U32(sp + 44) = a0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L43858c; +a1 = a1; +L43858c: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 44); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L4385a4; +//nop; +L4385a4: +gp = MEM_U32(sp + 32); +a2 = 0x7fff0000; +//nop; +a2 = a2 | 0xffff; +a3 = a2; +a0 = s1; +a1 = s0; +f_print_tree(mem, sp, a0, a1, a2, a3); +goto L4385c4; +a1 = s0; +L4385c4: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L4385dc; +//nop; +L4385dc: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L4385f4; +//nop; +L4385f4: +gp = MEM_U32(sp + 32); +//nop; +L4385fc: +//nop; +a0 = s0; +t9 = t9; +v0 = sp + 0x38; +func_4382d4(mem, sp, v0, a0); +goto L438610; +v0 = sp + 0x38; +L438610: +t7 = MEM_U8(sp + 67); +gp = MEM_U32(sp + 32); +if (t7 == 0) {a2 = 0x20; +goto L4386b0;} +a2 = 0x20; +s1 = MEM_U32(sp + 60); +a1 = 0x10009cda; +//nop; +a0 = MEM_U32(s1 + 0); +a3 = 0x20; +a1 = a1; +MEM_U32(sp + 44) = a0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L438640; +MEM_U32(sp + 44) = a0; +L438640: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 44); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L438658; +//nop; +L438658: +gp = MEM_U32(sp + 32); +a2 = 0x7fff0000; +//nop; +a2 = a2 | 0xffff; +a3 = a2; +a0 = s1; +a1 = s0; +f_print_tree(mem, sp, a0, a1, a2, a3); +goto L438678; +a1 = s0; +L438678: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L438690; +//nop; +L438690: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L4386a8; +//nop; +L4386a8: +gp = MEM_U32(sp + 32); +//nop; +L4386b0: +t8 = MEM_U8(sp + 71); +s1 = MEM_U32(sp + 60); +if (t8 == 0) {//nop; +goto L43876c;} +//nop; +//nop; +a0 = s0; +//nop; +f_cross_jump(mem, sp, a0); +goto L4386d0; +//nop; +L4386d0: +t9 = MEM_U8(sp + 67); +gp = MEM_U32(sp + 32); +if (t9 == 0) {a2 = 0x1d; +goto L43876c;} +a2 = 0x1d; +a0 = MEM_U32(s1 + 0); +a1 = 0x10009cbd; +//nop; +a3 = 0x1d; +MEM_U32(sp + 44) = a0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L4386fc; +a1 = a1; +L4386fc: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 44); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L438714; +//nop; +L438714: +gp = MEM_U32(sp + 32); +a2 = 0x7fff0000; +//nop; +a2 = a2 | 0xffff; +a3 = a2; +a0 = s1; +a1 = s0; +f_print_tree(mem, sp, a0, a1, a2, a3); +goto L438734; +a1 = s0; +L438734: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L43874c; +//nop; +L43874c: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L438764; +//nop; +L438764: +gp = MEM_U32(sp + 32); +//nop; +L43876c: +//nop; +//nop; +//nop; +v0 = f_next_mark(mem, sp); +goto L43877c; +//nop; +L43877c: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 52) = v0; +//nop; +//nop; +//nop; +v0 = f_next_mark(mem, sp); +goto L438794; +//nop; +L438794: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 48) = v0; +//nop; +v0 = sp + 0x38; +t9 = t9; +a0 = s0; +func_43732c(mem, sp, v0, a0); +goto L4387b0; +a0 = s0; +L4387b0: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +v0 = sp + 0x38; +t9 = t9; +//nop; +func_437a80(mem, sp, v0, a0); +goto L4387cc; +//nop; +L4387cc: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +v0 = sp + 0x38; +t9 = t9; +//nop; +func_4382d4(mem, sp, v0, a0); +goto L4387e8; +//nop; +L4387e8: +t0 = MEM_U8(sp + 67); +gp = MEM_U32(sp + 32); +if (t0 == 0) {a2 = 0x20; +goto L438888;} +a2 = 0x20; +s1 = MEM_U32(sp + 60); +a1 = 0x10009c9d; +//nop; +a0 = MEM_U32(s1 + 0); +a3 = 0x20; +a1 = a1; +MEM_U32(sp + 44) = a0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L438818; +MEM_U32(sp + 44) = a0; +L438818: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 44); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L438830; +//nop; +L438830: +gp = MEM_U32(sp + 32); +a2 = 0x7fff0000; +//nop; +a2 = a2 | 0xffff; +a3 = a2; +a0 = s1; +a1 = s0; +f_print_tree(mem, sp, a0, a1, a2, a3); +goto L438850; +a1 = s0; +L438850: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L438868; +//nop; +L438868: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s1 + 0); +//nop; +//nop; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L438880; +//nop; +L438880: +gp = MEM_U32(sp + 32); +//nop; +L438888: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x38; +return; +sp = sp + 0x38; +//nop; +//nop; +//nop; +} + +static void f_reset_pool(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4388a8: +//reset_pool: +//nop; +//nop; +//nop; +at = 0x10019d74; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10019d78; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10019d7c; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10019d80; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10019d84; +MEM_U32(at + 0) = zero; +return; +MEM_U32(at + 0) = zero; +} + +static void f_select_data_section(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4388f0: +//select_data_section: +//nop; +//nop; +//nop; +t6 = 0x10018e84; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +at = (int)t6 < (int)a0; +if (at != 0) {MEM_U32(sp + 24) = gp; +goto L438934;} +MEM_U32(sp + 24) = gp; +//nop; +a0 = 0x19; +a1 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L438928; +a1 = zero; +L438928: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L438950; +ra = MEM_U32(sp + 28); +L438934: +//nop; +a0 = 0xa; +a1 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L438944; +a1 = zero; +L438944: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L438950: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void f_emit_list(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43895c: +//emit_list: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a0; +s1 = a1 & 0xff; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +if (a0 == 0) {MEM_U32(sp + 44) = a1; +goto L4389c8;} +MEM_U32(sp + 44) = a1; +L43898c: +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +v0 = f_create_local_label(mem, sp, a0); +goto L43899c; +//nop; +L43899c: +gp = MEM_U32(sp + 32); +a0 = v0; +//nop; +a1 = s1; +a2 = s0 + 0x8; +a3 = 0x1; +f_emit_val(mem, sp, a0, a1, a2, a3); +goto L4389b8; +a3 = 0x1; +L4389b8: +s0 = MEM_U32(s0 + 16); +gp = MEM_U32(sp + 32); +if (s0 != 0) {//nop; +goto L43898c;} +//nop; +L4389c8: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_output_pool(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4389dc: +//output_pool: +//nop; +//nop; +//nop; +t6 = 0x10019d7c; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +if (t6 == 0) {MEM_U32(sp + 24) = gp; +goto L438a4c;} +MEM_U32(sp + 24) = gp; +//nop; +a0 = 0x4; +//nop; +f_select_data_section(mem, sp, a0); +goto L438a10; +//nop; +L438a10: +gp = MEM_U32(sp + 24); +a0 = 0x4; +//nop; +a1 = zero; +a2 = 0x2; +f_demit_dir1(mem, sp, a0, a1, a2); +goto L438a28; +a2 = 0x2; +L438a28: +gp = MEM_U32(sp + 24); +a1 = 0x5; +a0 = 0x10019d7c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_emit_list(mem, sp, a0, a1); +goto L438a44; +//nop; +L438a44: +gp = MEM_U32(sp + 24); +//nop; +L438a4c: +t7 = 0x10019d80; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L438ab0;} +//nop; +//nop; +a0 = 0x8; +//nop; +f_select_data_section(mem, sp, a0); +goto L438a74; +//nop; +L438a74: +gp = MEM_U32(sp + 24); +a0 = 0x4; +//nop; +a1 = zero; +a2 = 0x3; +f_demit_dir1(mem, sp, a0, a1, a2); +goto L438a8c; +a2 = 0x3; +L438a8c: +gp = MEM_U32(sp + 24); +a1 = 0x6; +a0 = 0x10019d80; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_emit_list(mem, sp, a0, a1); +goto L438aa8; +//nop; +L438aa8: +gp = MEM_U32(sp + 24); +//nop; +L438ab0: +t8 = 0x10019d84; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L438b14;} +//nop; +//nop; +a0 = 0x8; +//nop; +f_select_data_section(mem, sp, a0); +goto L438ad8; +//nop; +L438ad8: +gp = MEM_U32(sp + 24); +a0 = 0x4; +//nop; +a1 = zero; +a2 = 0x2; +f_demit_dir1(mem, sp, a0, a1, a2); +goto L438af0; +a2 = 0x2; +L438af0: +gp = MEM_U32(sp + 24); +a1 = 0x9; +a0 = 0x10019d84; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_emit_list(mem, sp, a0, a1); +goto L438b0c; +//nop; +L438b0c: +gp = MEM_U32(sp + 24); +//nop; +L438b14: +t9 = 0x10019d74; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L438b60;} +//nop; +//nop; +a0 = 0x19; +a1 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L438b3c; +a1 = zero; +L438b3c: +gp = MEM_U32(sp + 24); +a1 = 0x7; +a0 = 0x10019d74; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_emit_list(mem, sp, a0, a1); +goto L438b58; +//nop; +L438b58: +gp = MEM_U32(sp + 24); +//nop; +L438b60: +t0 = 0x10019d78; +//nop; +t0 = MEM_U32(t0 + 0); +//nop; +if (t0 == 0) {ra = MEM_U32(sp + 28); +goto L438bb0;} +ra = MEM_U32(sp + 28); +//nop; +a0 = 0x1a; +a1 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L438b88; +a1 = zero; +L438b88: +gp = MEM_U32(sp + 24); +a1 = 0x7; +a0 = 0x10019d78; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_emit_list(mem, sp, a0, a1); +goto L438ba4; +//nop; +L438ba4: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L438bb0: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t f_new_lit(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L438bbc: +//new_lit: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +//nop; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 192) = a0; +MEM_U32(sp + 196) = a1; +MEM_U32(sp + 176) = gp; +a1 = 0x1; +a0 = 0x18; +v0 = f_new(mem, sp, a0, a1); +goto L438bec; +a0 = 0x18; +L438bec: +gp = MEM_U32(sp + 176); +if (v0 != 0) {v1 = v0; +goto L438d0c;} +v1 = v0; +t6 = 0x10009d70; +a0 = 0x4; +t6 = t6; +t8 = t6 + 0x48; +a1 = 0x6a; +t9 = sp; +L438c10: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 7($t9) +goto L438c10;} +//swr $at, 7($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t0 = 0x10009d20; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +t0 = t0; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t0 + 0x48; +t3 = sp; +//swr $t8, 0xf($t9) +L438c80: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 0x57($t3) +goto L438c80;} +//swr $at, 0x57($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +MEM_U32(sp + 184) = v1; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L438cfc; +MEM_U32(sp + 184) = v1; +L438cfc: +gp = MEM_U32(sp + 176); +v0 = MEM_U32(sp + 184); +ra = MEM_U32(sp + 180); +goto L438d34; +ra = MEM_U32(sp + 180); +L438d0c: +t4 = MEM_U32(sp + 196); +t5 = MEM_U32(sp + 192); +MEM_U32(v1 + 0) = t4; +at = MEM_U32(t5 + 0); +v0 = v1; +MEM_U32(v1 + 8) = at; +t8 = MEM_U32(t5 + 4); +//nop; +MEM_U32(v1 + 12) = t8; +ra = MEM_U32(sp + 180); +L438d34: +sp = sp + 0xc0; +//nop; +return v0; +//nop; +} + +static void f_add_to_list_no_check(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L438d40: +//add_to_list_no_check: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 28) = ra; +a0 = a1; +MEM_U32(sp + 24) = gp; +a1 = a2; +v0 = f_new_lit(mem, sp, a0, a1); +goto L438d6c; +a1 = a2; +L438d6c: +v1 = MEM_U32(sp + 32); +gp = MEM_U32(sp + 24); +t6 = MEM_U32(v1 + 0); +//nop; +MEM_U32(v0 + 16) = t6; +MEM_U32(v1 + 0) = v0; +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t f_valu_equ(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L438d94: +//valu_equ: +v0 = MEM_U32(a0 + 0); +t6 = MEM_U32(a1 + 0); +//nop; +if (t6 == v0) {//nop; +goto L438db0;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L438db0: +if (v0 == 0) {v1 = v0; +goto L438e94;} +v1 = v0; +v1 = v1 + 0x1; +t1 = v1 + 0xffffffff; +t7 = t1 & 0x3; +if (t7 == 0) {v0 = 0x1; +goto L438e0c;} +v0 = 0x1; +t8 = MEM_U32(a1 + 4); +t9 = MEM_U32(a0 + 4); +t0 = t7 + 0x1; +a2 = t8 + v0; +a3 = t9 + v0; +L438de0: +t2 = MEM_U8(a2 + -1); +t3 = MEM_U8(a3 + -1); +v0 = v0 + 0x1; +if (t2 == t3) {a2 = a2 + 0x1; +goto L438dfc;} +a2 = a2 + 0x1; +v0 = zero; +return v0; +v0 = zero; +L438dfc: +if (t0 != v0) {a3 = a3 + 0x1; +goto L438de0;} +a3 = a3 + 0x1; +if (v0 == v1) {//nop; +goto L438e94;} +//nop; +L438e0c: +t4 = MEM_U32(a1 + 4); +t5 = MEM_U32(a0 + 4); +a2 = t4 + v0; +a3 = t5 + v0; +L438e1c: +t6 = MEM_U8(a2 + -1); +t7 = MEM_U8(a3 + -1); +v0 = v0 + 0x4; +if (t6 == t7) {//nop; +goto L438e38;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L438e38: +t8 = MEM_U8(a2 + 0); +t9 = MEM_U8(a3 + 0); +//nop; +if (t8 == t9) {//nop; +goto L438e54;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L438e54: +t2 = MEM_U8(a2 + 1); +t3 = MEM_U8(a3 + 1); +//nop; +if (t2 == t3) {//nop; +goto L438e70;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L438e70: +t4 = MEM_U8(a2 + 2); +t5 = MEM_U8(a3 + 2); +a2 = a2 + 0x4; +if (t4 == t5) {//nop; +goto L438e8c;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L438e8c: +if (v0 != v1) {a3 = a3 + 0x4; +goto L438e1c;} +a3 = a3 + 0x4; +L438e94: +v0 = 0x1; +//nop; +return v0; +//nop; +} + +static uint32_t f_add_to_list(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L438ea0: +//add_to_list: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 48) = a2; +v0 = MEM_U32(a0 + 0); +s1 = a1; +if (v0 == 0) {//nop; +goto L438f18;} +//nop; +if (v0 == 0) {s0 = v0; +goto L438f18;} +s0 = v0; +L438ee0: +//nop; +a0 = s1; +a1 = s0 + 0x8; +v0 = f_valu_equ(mem, sp, a0, a1); +goto L438ef0; +a1 = s0 + 0x8; +L438ef0: +gp = MEM_U32(sp + 32); +if (v0 == 0) {//nop; +goto L438f08;} +//nop; +v0 = MEM_U32(s0 + 0); +ra = MEM_U32(sp + 36); +goto L438f54; +ra = MEM_U32(sp + 36); +L438f08: +s0 = MEM_U32(s0 + 16); +//nop; +if (s0 != 0) {//nop; +goto L438ee0;} +//nop; +L438f18: +//nop; +a1 = MEM_U32(sp + 48); +a0 = s1; +v0 = f_new_lit(mem, sp, a0, a1); +goto L438f28; +a0 = s1; +L438f28: +t7 = MEM_U32(sp + 40); +gp = MEM_U32(sp + 32); +t8 = MEM_U32(t7 + 0); +//nop; +MEM_U32(v0 + 16) = t8; +t9 = MEM_U32(sp + 40); +//nop; +MEM_U32(t9 + 0) = v0; +v0 = MEM_U32(sp + 48); +//nop; +ra = MEM_U32(sp + 36); +L438f54: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x28; +return v0; +sp = sp + 0x28; +} + +static uint32_t f_add_to_pool(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L438f64: +//add_to_pool: +//nop; +//nop; +//nop; +sp = sp + 0xffffff48; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +v1 = MEM_U8(a0 + 0); +a3 = a0; +v0 = v1 ^ 0x49; +v0 = v0 < 0x1; +if (v0 != 0) {a2 = a1; +goto L438f9c;} +a2 = a1; +v0 = v1 ^ 0x46; +v0 = v0 < 0x1; +L438f9c: +if (v0 != 0) {//nop; +goto L438fa8;} +//nop; +abort(); +L438fa8: +t6 = MEM_U8(a3 + 1); +//nop; +t7 = t6 & 0x1f; +t8 = t7 + 0xfffffff7; +at = t8 < 0x6; +if (at == 0) {//nop; +goto L43909c;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10009e60[] = { +&&L438fe4, +&&L43909c, +&&L43909c, +&&L439048, +&&L439064, +&&L439080, +}; +dest = Lswitch10009e60[t8]; +//nop; +goto *dest; +//nop; +L438fe4: +t9 = 0x10018e84; +t0 = MEM_U32(a3 + 16); +t9 = MEM_U32(t9 + 0); +a1 = a3 + 0x10; +at = (int)t9 < (int)t0; +if (at == 0) {//nop; +goto L439024;} +//nop; +//nop; +a0 = 0x10019d78; +a1 = a3 + 0x10; +MEM_U32(sp + 188) = a2; +f_add_to_list_no_check(mem, sp, a0, a1, a2); +goto L439014; +MEM_U32(sp + 188) = a2; +L439014: +gp = MEM_U32(sp + 176); +v0 = MEM_U32(sp + 188); +ra = MEM_U32(sp + 180); +goto L4391ac; +ra = MEM_U32(sp + 180); +L439024: +//nop; +a0 = 0x10019d74; +MEM_U32(sp + 188) = a2; +f_add_to_list_no_check(mem, sp, a0, a1, a2); +goto L439034; +MEM_U32(sp + 188) = a2; +L439034: +gp = MEM_U32(sp + 176); +a2 = MEM_U32(sp + 188); +//nop; +v0 = a2; +goto L4391a8; +v0 = a2; +L439048: +//nop; +a0 = 0x10019d80; +a1 = a3 + 0x10; +v0 = f_add_to_list(mem, sp, a0, a1, a2); +goto L439058; +a1 = a3 + 0x10; +L439058: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L4391ac; +ra = MEM_U32(sp + 180); +L439064: +//nop; +a0 = 0x10019d7c; +a1 = a3 + 0x10; +v0 = f_add_to_list(mem, sp, a0, a1, a2); +goto L439074; +a1 = a3 + 0x10; +L439074: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L4391ac; +ra = MEM_U32(sp + 180); +L439080: +//nop; +a0 = 0x10019d84; +a1 = a3 + 0x10; +v0 = f_add_to_list(mem, sp, a0, a1, a2); +goto L439090; +a1 = a3 + 0x10; +L439090: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L4391ac; +ra = MEM_U32(sp + 180); +L43909c: +t1 = 0x10009e10; +a0 = 0x4; +t1 = t1; +t3 = t1 + 0x48; +a1 = 0xba; +t4 = sp; +L4390b4: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t4 = t4 + 0xc; +MEM_U8(t4 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t4) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t4 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 4 + 3) = (uint8_t)(at >> 0); +if (t1 != t3) {//swr $at, 7($t4) +goto L4390b4;} +//swr $at, 7($t4) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t5 = 0x10009dc0; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +t5 = t5; +MEM_U8(t4 + 12 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 12 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 12 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 12 + 3) = (uint8_t)(t3 >> 0); +t7 = t5 + 0x48; +t8 = sp; +//swr $t3, 0xf($t4) +L439124: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t8 = t8 + 0xc; +MEM_U8(t8 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t8) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t8 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 84 + 3) = (uint8_t)(at >> 0); +if (t5 != t7) {//swr $at, 0x57($t8) +goto L439124;} +//swr $at, 0x57($t8) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +//nop; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +t7 = t5 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t5) +//nop; +MEM_U8(t8 + 92 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t8 + 92 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t8 + 92 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t8 + 92 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x5f($t8) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4391a0; +//nop; +L4391a0: +gp = MEM_U32(sp + 176); +v0 = zero; +L4391a8: +ra = MEM_U32(sp + 180); +L4391ac: +sp = sp + 0xb8; +//nop; +return v0; +//nop; +} + +static void f_insert(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4391b8: +//insert: +MEM_U32(a0 + 8) = a1; +t6 = MEM_U32(a1 + 12); +//nop; +MEM_U32(a0 + 12) = t6; +MEM_U32(t6 + 8) = a0; +MEM_U32(a1 + 12) = a0; +return; +MEM_U32(a1 + 12) = a0; +} + +static void f_append(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4391d4: +//append: +MEM_U32(a0 + 12) = a1; +t6 = MEM_U32(a1 + 8); +//nop; +MEM_U32(a0 + 8) = t6; +MEM_U32(a1 + 8) = a0; +t7 = MEM_U32(a0 + 8); +MEM_U32(t7 + 12) = a0; +return; +MEM_U32(t7 + 12) = a0; +} + +static uint32_t f_make_new_label(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4391f4: +//make_new_label: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +a0 = 0x42; +v0 = f_build_op(mem, sp, a0); +goto L439218; +a0 = 0x42; +L439218: +gp = MEM_U32(sp + 24); +MEM_U32(sp + 32) = v0; +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L439230; +//nop; +L439230: +v1 = MEM_U32(sp + 32); +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +MEM_U32(v1 + 36) = v0; +sp = sp + 0x28; +MEM_U16(v1 + 34) = (uint16_t)zero; +MEM_U32(v1 + 40) = zero; +v0 = v1; +return v0; +v0 = v1; +} + +static uint32_t f_make_new_jump(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L439254: +//make_new_jump: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +a2 = a0; +MEM_U32(sp + 24) = gp; +a0 = 0x88; +a1 = zero; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L439280; +a1 = zero; +L439280: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return v0; +sp = sp + 0x20; +} + +static uint32_t f_cmp_tree(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L439290: +//cmp_tree: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +t6 = 0x1; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 184) = t6; +t7 = MEM_U8(a0 + 26); +a2 = a0; +t8 = t7 + 0x1; +MEM_U8(a0 + 26) = (uint8_t)t8; +t9 = MEM_U8(a1 + 26); +a3 = a1; +t0 = t9 + 0x1; +if (a0 != a1) {MEM_U8(a1 + 26) = (uint8_t)t0; +goto L4392dc;} +MEM_U8(a1 + 26) = (uint8_t)t0; +v0 = 0x1; +goto L43a098; +v0 = 0x1; +L4392dc: +v1 = MEM_U8(a2 + 32); +t1 = MEM_U8(a3 + 32); +//nop; +if (t1 == v1) {//nop; +goto L4392f8;} +//nop; +v0 = zero; +goto L43a098; +v0 = zero; +L4392f8: +v0 = v1 & 0xff; +goto L439dfc; +v0 = v1 & 0xff; +L439300: +v0 = MEM_U8(a3 + 33); +a0 = MEM_U8(a2 + 33); +t2 = v0 & 0x1f; +t3 = a0 & 0x1f; +v1 = t2 ^ t3; +v1 = v1 < 0x1; +if (v1 == 0) {at = 0x3; +goto L4393a8;} +at = 0x3; +t4 = v0 << 24; +t6 = a0 << 24; +t7 = t6 >> 29; +t5 = t4 >> 29; +v1 = t5 ^ t7; +v1 = v1 < 0x1; +if (v1 == 0) {t5 = a0 << 24; +goto L4393ac;} +t5 = a0 << 24; +t8 = MEM_U32(a3 + 36); +t9 = MEM_U32(a2 + 36); +//nop; +v1 = t8 ^ t9; +v1 = v1 < 0x1; +if (v1 == 0) {t5 = a0 << 24; +goto L4393ac;} +t5 = a0 << 24; +t0 = MEM_U32(a3 + 44); +t1 = MEM_U32(a2 + 44); +//nop; +v1 = t0 ^ t1; +v1 = v1 < 0x1; +if (v1 == 0) {t5 = a0 << 24; +goto L4393ac;} +t5 = a0 << 24; +t2 = MEM_U32(a3 + 40); +t3 = MEM_U32(a2 + 40); +//nop; +v1 = t2 ^ t3; +v1 = v1 < 0x1; +if (v1 == 0) {t5 = a0 << 24; +goto L4393ac;} +t5 = a0 << 24; +t4 = MEM_U16(a3 + 34); +t6 = MEM_U16(a2 + 34); +//nop; +v1 = t4 ^ t6; +v1 = v1 < 0x1; +L4393a8: +t5 = a0 << 24; +L4393ac: +t7 = t5 >> 29; +if (t7 != at) {MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080;} +MEM_U8(sp + 191) = (uint8_t)v1; +MEM_U32(sp + 184) = zero; +goto L43a080; +MEM_U32(sp + 184) = zero; +L4393c0: +v0 = MEM_U8(a3 + 33); +a0 = MEM_U8(a2 + 33); +t8 = v0 & 0x1f; +t9 = a0 & 0x1f; +v1 = t8 ^ t9; +v1 = v1 < 0x1; +if (v1 == 0) {t0 = v0 << 24; +goto L439490;} +t0 = v0 << 24; +t2 = a0 << 24; +t3 = t2 >> 29; +t1 = t0 >> 29; +v1 = t1 ^ t3; +v1 = v1 < 0x1; +if (v1 == 0) {t1 = a0 << 24; +goto L439494;} +t1 = a0 << 24; +t4 = MEM_U32(a3 + 36); +t6 = MEM_U32(a2 + 36); +//nop; +v1 = t4 ^ t6; +v1 = v1 < 0x1; +if (v1 == 0) {t1 = a0 << 24; +goto L439494;} +t1 = a0 << 24; +t5 = MEM_U32(a3 + 44); +t7 = MEM_U32(a2 + 44); +//nop; +v1 = t5 ^ t7; +v1 = v1 < 0x1; +if (v1 == 0) {t1 = a0 << 24; +goto L439494;} +t1 = a0 << 24; +t8 = MEM_U32(a3 + 40); +t9 = MEM_U32(a2 + 40); +//nop; +v1 = t8 ^ t9; +v1 = v1 < 0x1; +if (v1 == 0) {t1 = a0 << 24; +goto L439494;} +t1 = a0 << 24; +t0 = MEM_U16(a3 + 34); +t2 = MEM_U16(a2 + 34); +//nop; +v1 = t0 ^ t2; +v1 = v1 < 0x1; +if (v1 == 0) {t1 = a0 << 24; +goto L439494;} +t1 = a0 << 24; +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +MEM_U32(sp + 192) = a2; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439480; +MEM_U32(sp + 192) = a2; +L439480: +a2 = MEM_U32(sp + 192); +gp = MEM_U32(sp + 176); +a0 = MEM_U8(a2 + 33); +v1 = v0; +L439490: +t1 = a0 << 24; +L439494: +t3 = t1 >> 29; +at = 0x3; +if (t3 != at) {MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080;} +MEM_U8(sp + 191) = (uint8_t)v1; +MEM_U32(sp + 184) = zero; +goto L43a080; +MEM_U32(sp + 184) = zero; +L4394ac: +v0 = MEM_U8(a3 + 33); +a0 = MEM_U8(a2 + 33); +t4 = v0 & 0x1f; +t6 = a0 & 0x1f; +v1 = t4 ^ t6; +v1 = v1 < 0x1; +if (v1 == 0) {t5 = v0 << 24; +goto L439558;} +t5 = v0 << 24; +t8 = a0 << 24; +t9 = t8 >> 29; +t7 = t5 >> 29; +v1 = t7 ^ t9; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439558;} +//nop; +t0 = MEM_U32(a3 + 36); +t2 = MEM_U32(a2 + 36); +//nop; +v1 = t0 ^ t2; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439558;} +//nop; +t1 = MEM_U32(a3 + 44); +t3 = MEM_U32(a2 + 44); +//nop; +v1 = t1 ^ t3; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439558;} +//nop; +t4 = MEM_U32(a3 + 40); +t6 = MEM_U32(a2 + 40); +//nop; +v1 = t4 ^ t6; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439558;} +//nop; +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439550; +//nop; +L439550: +gp = MEM_U32(sp + 176); +v1 = v0; +L439558: +MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v1; +L439560: +t5 = MEM_U16(a3 + 34); +t8 = MEM_U16(a2 + 34); +//nop; +t7 = t5 ^ t8; +t7 = t7 < 0x1; +MEM_U8(sp + 191) = (uint8_t)t7; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)t7; +L43957c: +t9 = MEM_U8(a3 + 33); +t2 = MEM_U8(a2 + 33); +t0 = t9 & 0x1f; +t1 = t2 & 0x1f; +v1 = t0 ^ t1; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439620;} +//nop; +t3 = MEM_U16(a3 + 34); +t4 = MEM_U16(a2 + 34); +//nop; +v1 = t3 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439620;} +//nop; +t6 = MEM_U32(a3 + 36); +t5 = MEM_U32(a2 + 36); +//nop; +v1 = t6 ^ t5; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439620;} +//nop; +t8 = MEM_U8(a3 + 40); +t7 = MEM_U8(a2 + 40); +//nop; +v1 = t8 ^ t7; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439620;} +//nop; +t9 = MEM_U8(a3 + 41); +t2 = MEM_U8(a2 + 41); +//nop; +v1 = t9 ^ t2; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439620;} +//nop; +t0 = MEM_U32(a3 + 44); +t1 = MEM_U32(a2 + 44); +//nop; +v1 = t0 ^ t1; +v1 = v1 < 0x1; +L439620: +MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v1; +L439628: +t3 = MEM_U8(a3 + 33); +t6 = MEM_U8(a2 + 33); +t4 = t3 & 0x1f; +t5 = t6 & 0x1f; +v1 = t4 ^ t5; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4396b0;} +//nop; +t8 = MEM_U32(a3 + 36); +t7 = MEM_U32(a2 + 36); +//nop; +v1 = t8 ^ t7; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4396b0;} +//nop; +t9 = MEM_U8(a3 + 40); +t2 = MEM_U8(a2 + 40); +//nop; +v1 = t9 ^ t2; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4396b0;} +//nop; +t0 = MEM_U8(a3 + 41); +t1 = MEM_U8(a2 + 41); +//nop; +v1 = t0 ^ t1; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4396b0;} +//nop; +t3 = MEM_U32(a3 + 44); +t6 = MEM_U32(a2 + 44); +//nop; +v1 = t3 ^ t6; +v1 = v1 < 0x1; +L4396b0: +MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v1; +L4396b8: +t4 = MEM_U8(a3 + 33); +t8 = MEM_U8(a2 + 33); +t5 = t4 & 0x1f; +t7 = t8 & 0x1f; +v1 = t5 ^ t7; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439748;} +//nop; +t9 = MEM_U8(a3 + 40); +t2 = MEM_U8(a2 + 40); +//nop; +v1 = t9 ^ t2; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439748;} +//nop; +t0 = MEM_U8(a3 + 41); +t1 = MEM_U8(a2 + 41); +//nop; +v1 = t0 ^ t1; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439748;} +//nop; +t3 = MEM_U32(a3 + 44); +t6 = MEM_U32(a2 + 44); +//nop; +v1 = t3 ^ t6; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439748;} +//nop; +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439740; +//nop; +L439740: +gp = MEM_U32(sp + 176); +v1 = v0; +L439748: +MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v1; +L439750: +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439764; +//nop; +L439764: +gp = MEM_U32(sp + 176); +MEM_U8(sp + 191) = (uint8_t)v0; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v0; +L439770: +//nop; +a0 = MEM_U32(a2 + 4); +a1 = MEM_U32(a3 + 4); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439784; +//nop; +L439784: +gp = MEM_U32(sp + 176); +MEM_U8(sp + 191) = (uint8_t)v0; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v0; +L439790: +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L4397a4; +//nop; +L4397a4: +gp = MEM_U32(sp + 176); +MEM_U8(sp + 191) = (uint8_t)v0; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v0; +L4397b0: +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L4397c4; +//nop; +L4397c4: +gp = MEM_U32(sp + 176); +MEM_U8(sp + 191) = (uint8_t)v0; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v0; +L4397d0: +//nop; +a0 = a2; +a1 = a3; +MEM_U32(sp + 192) = a2; +v0 = f_const_equal(mem, sp, a0, a1); +goto L4397e4; +MEM_U32(sp + 192) = a2; +L4397e4: +a2 = MEM_U32(sp + 192); +gp = MEM_U32(sp + 176); +t4 = MEM_U32(a2 + 48); +MEM_U8(sp + 191) = (uint8_t)v0; +if (t4 != 0) {//nop; +goto L43a080;} +//nop; +MEM_U32(sp + 184) = zero; +goto L43a080; +MEM_U32(sp + 184) = zero; +L439804: +t8 = MEM_U8(a3 + 33); +t7 = MEM_U8(a2 + 33); +t5 = t8 & 0x1f; +t9 = t7 & 0x1f; +v1 = t5 ^ t9; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439894;} +//nop; +t2 = MEM_U32(a3 + 44); +t0 = MEM_U32(a2 + 44); +//nop; +v1 = t2 ^ t0; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439894;} +//nop; +t1 = MEM_U32(a3 + 40); +t3 = MEM_U32(a2 + 40); +//nop; +v1 = t1 ^ t3; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439894;} +//nop; +t6 = MEM_U16(a3 + 34); +t4 = MEM_U16(a2 + 34); +//nop; +v1 = t6 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439894;} +//nop; +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L43988c; +//nop; +L43988c: +gp = MEM_U32(sp + 176); +v1 = v0; +L439894: +MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v1; +L43989c: +t8 = MEM_U8(a3 + 33); +t5 = MEM_U8(a2 + 33); +t7 = t8 & 0x1f; +t9 = t5 & 0x1f; +v1 = t7 ^ t9; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439958;} +//nop; +t2 = MEM_U32(a3 + 44); +t0 = MEM_U32(a2 + 44); +//nop; +v1 = t2 ^ t0; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439958;} +//nop; +t1 = MEM_U32(a3 + 40); +t3 = MEM_U32(a2 + 40); +//nop; +v1 = t1 ^ t3; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439958;} +//nop; +t6 = MEM_U16(a3 + 34); +t4 = MEM_U16(a2 + 34); +//nop; +v1 = t6 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439958;} +//nop; +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +MEM_U32(sp + 192) = a2; +MEM_U32(sp + 196) = a3; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439928; +MEM_U32(sp + 196) = a3; +L439928: +gp = MEM_U32(sp + 176); +a2 = MEM_U32(sp + 192); +a3 = MEM_U32(sp + 196); +if (v0 == 0) {v1 = v0; +goto L439958;} +v1 = v0; +//nop; +a0 = MEM_U32(a2 + 4); +a1 = MEM_U32(a3 + 4); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439950; +//nop; +L439950: +gp = MEM_U32(sp + 176); +v1 = v0; +L439958: +MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v1; +L439960: +v0 = MEM_U8(a3 + 33); +a0 = MEM_U8(a2 + 33); +t8 = v0 & 0x1f; +t5 = a0 & 0x1f; +v1 = t8 ^ t5; +v1 = v1 < 0x1; +if (v1 == 0) {t7 = v0 << 24; +goto L439a28;} +t7 = v0 << 24; +t2 = a0 << 24; +t0 = t2 >> 29; +t9 = t7 >> 29; +v1 = t9 ^ t0; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439a28;} +//nop; +t1 = MEM_U32(a3 + 36); +t3 = MEM_U32(a2 + 36); +//nop; +v1 = t1 ^ t3; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439a28;} +//nop; +t6 = MEM_U32(a3 + 44); +t4 = MEM_U32(a2 + 44); +//nop; +v1 = t6 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439a28;} +//nop; +t8 = MEM_U32(a3 + 40); +t5 = MEM_U32(a2 + 40); +//nop; +v1 = t8 ^ t5; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439a28;} +//nop; +t7 = MEM_U16(a3 + 34); +t2 = MEM_U16(a2 + 34); +//nop; +v1 = t7 ^ t2; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439a28;} +//nop; +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439a20; +//nop; +L439a20: +gp = MEM_U32(sp + 176); +v1 = v0; +L439a28: +MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v1; +L439a30: +v0 = MEM_U8(a3 + 33); +a0 = MEM_U8(a2 + 33); +t9 = v0 & 0x1f; +t0 = a0 & 0x1f; +v1 = t9 ^ t0; +v1 = v1 < 0x1; +if (v1 == 0) {t1 = v0 << 24; +goto L439b24;} +t1 = v0 << 24; +t6 = a0 << 24; +t4 = t6 >> 29; +t3 = t1 >> 29; +v1 = t3 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439b24;} +//nop; +t8 = MEM_U32(a3 + 36); +t5 = MEM_U32(a2 + 36); +//nop; +v1 = t8 ^ t5; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439b24;} +//nop; +t7 = MEM_U32(a3 + 44); +t2 = MEM_U32(a2 + 44); +//nop; +v1 = t7 ^ t2; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439b24;} +//nop; +t9 = MEM_U32(a3 + 40); +t0 = MEM_U32(a2 + 40); +//nop; +v1 = t9 ^ t0; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439b24;} +//nop; +t1 = MEM_U16(a3 + 34); +t6 = MEM_U16(a2 + 34); +//nop; +v1 = t1 ^ t6; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439b24;} +//nop; +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +MEM_U32(sp + 192) = a2; +MEM_U32(sp + 196) = a3; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439af4; +MEM_U32(sp + 196) = a3; +L439af4: +gp = MEM_U32(sp + 176); +a2 = MEM_U32(sp + 192); +a3 = MEM_U32(sp + 196); +if (v0 == 0) {v1 = v0; +goto L439b24;} +v1 = v0; +//nop; +a0 = MEM_U32(a2 + 4); +a1 = MEM_U32(a3 + 4); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439b1c; +//nop; +L439b1c: +gp = MEM_U32(sp + 176); +v1 = v0; +L439b24: +MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v1; +L439b2c: +t3 = MEM_U8(a3 + 33); +t5 = MEM_U8(a2 + 33); +t4 = t3 << 24; +t7 = t5 << 24; +t2 = t7 >> 29; +t8 = t4 >> 29; +v1 = t8 ^ t2; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439bbc;} +//nop; +t9 = MEM_U32(a3 + 36); +t0 = MEM_U32(a2 + 36); +//nop; +v1 = t9 ^ t0; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439bbc;} +//nop; +t1 = MEM_U32(a3 + 44); +t6 = MEM_U32(a2 + 44); +//nop; +v1 = t1 ^ t6; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439bbc;} +//nop; +t3 = MEM_U32(a3 + 40); +t4 = MEM_U32(a2 + 40); +//nop; +v1 = t3 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439bbc;} +//nop; +t5 = MEM_U32(a3 + 48); +t7 = MEM_U32(a2 + 48); +//nop; +v1 = t5 ^ t7; +v1 = v1 < 0x1; +L439bbc: +MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v1; +L439bc4: +MEM_U8(sp + 191) = (uint8_t)zero; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)zero; +L439bcc: +t8 = MEM_U8(a3 + 33); +t9 = MEM_U8(a2 + 33); +t2 = t8 & 0x1f; +t0 = t9 & 0x1f; +v1 = t2 ^ t0; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439c08;} +//nop; +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439c00; +//nop; +L439c00: +gp = MEM_U32(sp + 176); +v1 = v0; +L439c08: +MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v1; +L439c10: +t1 = MEM_U8(a3 + 33); +t3 = MEM_U8(a2 + 33); +t6 = t1 & 0x1f; +t4 = t3 & 0x1f; +v1 = t6 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439c78;} +//nop; +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +MEM_U32(sp + 192) = a2; +MEM_U32(sp + 196) = a3; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439c48; +MEM_U32(sp + 196) = a3; +L439c48: +gp = MEM_U32(sp + 176); +a2 = MEM_U32(sp + 192); +a3 = MEM_U32(sp + 196); +if (v0 == 0) {v1 = v0; +goto L439c78;} +v1 = v0; +//nop; +a0 = MEM_U32(a2 + 4); +a1 = MEM_U32(a3 + 4); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439c70; +//nop; +L439c70: +gp = MEM_U32(sp + 176); +v1 = v0; +L439c78: +MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v1; +L439c80: +t5 = MEM_U8(a3 + 33); +t8 = MEM_U8(a2 + 33); +t7 = t5 & 0x1f; +t9 = t8 & 0x1f; +v1 = t7 ^ t9; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439cd8;} +//nop; +t2 = MEM_U8(a3 + 40); +t0 = MEM_U8(a2 + 40); +//nop; +v1 = t2 ^ t0; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439cd8;} +//nop; +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 4); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439cd0; +//nop; +L439cd0: +gp = MEM_U32(sp + 176); +v1 = v0; +L439cd8: +MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v1; +L439ce0: +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439cf4; +//nop; +L439cf4: +gp = MEM_U32(sp + 176); +MEM_U8(sp + 191) = (uint8_t)v0; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v0; +L439d00: +t1 = MEM_U8(a3 + 33); +t6 = MEM_U8(a2 + 33); +t3 = t1 & 0x1f; +t4 = t6 & 0x1f; +v1 = t3 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439d58;} +//nop; +t5 = MEM_U32(a3 + 40); +t8 = MEM_U32(a2 + 40); +//nop; +v1 = t5 ^ t8; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439d58;} +//nop; +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439d50; +//nop; +L439d50: +gp = MEM_U32(sp + 176); +v1 = v0; +L439d58: +MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v1; +L439d60: +t7 = MEM_U32(a3 + 36); +t9 = MEM_U32(a2 + 36); +//nop; +v1 = t7 ^ t9; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439de0;} +//nop; +t2 = MEM_U32(a3 + 40); +t0 = MEM_U32(a2 + 40); +//nop; +v1 = t2 ^ t0; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L439de0;} +//nop; +//nop; +a0 = MEM_U32(a2 + 0); +a1 = MEM_U32(a3 + 0); +MEM_U32(sp + 192) = a2; +MEM_U32(sp + 196) = a3; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439db0; +MEM_U32(sp + 196) = a3; +L439db0: +gp = MEM_U32(sp + 176); +a2 = MEM_U32(sp + 192); +a3 = MEM_U32(sp + 196); +if (v0 == 0) {v1 = v0; +goto L439de0;} +v1 = v0; +//nop; +a0 = MEM_U32(a2 + 4); +a1 = MEM_U32(a3 + 4); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L439dd8; +//nop; +L439dd8: +gp = MEM_U32(sp + 176); +v1 = v0; +L439de0: +MEM_U8(sp + 191) = (uint8_t)v1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)v1; +L439de8: +MEM_U8(sp + 191) = (uint8_t)zero; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)zero; +L439df0: +t1 = 0x1; +MEM_U8(sp + 191) = (uint8_t)t1; +goto L43a080; +MEM_U8(sp + 191) = (uint8_t)t1; +L439dfc: +at = v0 < 0x1e; +if (at != 0) {at = v0 < 0x80; +goto L439e68;} +at = v0 < 0x80; +if (at != 0) {at = v0 < 0x8e; +goto L439e2c;} +at = v0 < 0x8e; +if (at != 0) {t5 = v0 + 0xffffff7a; +goto L43a054;} +t5 = v0 + 0xffffff7a; +at = 0x97; +if (v0 == at) {//nop; +goto L439628;} +//nop; +//nop; +goto L439f18; +//nop; +L439e2c: +at = v0 < 0x75; +if (at == 0) {t4 = v0 + 0xffffff85; +goto L43a028;} +t4 = v0 + 0xffffff85; +t6 = v0 + 0xffffffdd; +at = t6 < 0x52; +if (at == 0) {//nop; +goto L439f18;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10009f5c[] = { +&&L439c10, +&&L439f18, +&&L439f18, +&&L439750, +&&L439f18, +&&L439c10, +&&L439c10, +&&L439f18, +&&L439f18, +&&L4396b8, +&&L439f18, +&&L439d60, +&&L439d60, +&&L439d60, +&&L439790, +&&L439f18, +&&L439f18, +&&L439d60, +&&L439d60, +&&L439804, +&&L439f18, +&&L439d60, +&&L439f18, +&&L439f18, +&&L439f18, +&&L439c10, +&&L439960, +&&L439a30, +&&L43989c, +&&L439f18, +&&L439f18, +&&L439df0, +&&L439f18, +&&L43a080, +&&L439f18, +&&L439bc4, +&&L439b2c, +&&L439f18, +&&L4397d0, +&&L439f18, +&&L439f18, +&&L439f18, +&&L439c10, +&&L439c10, +&&L439f18, +&&L439bcc, +&&L439f18, +&&L439300, +&&L439f18, +&&L439f18, +&&L439c10, +&&L439c10, +&&L439c10, +&&L439d60, +&&L439f18, +&&L439f18, +&&L439c10, +&&L439560, +&&L439f18, +&&L439bcc, +&&L439c10, +&&L439de8, +&&L439bcc, +&&L439f18, +&&L439f18, +&&L4394ac, +&&L439f18, +&&L439f18, +&&L439f18, +&&L439f18, +&&L439c10, +&&L439f18, +&&L439f18, +&&L439f18, +&&L439f18, +&&L439c80, +&&L439f18, +&&L439f18, +&&L439f18, +&&L439f18, +&&L439c10, +&&L439c10, +}; +dest = Lswitch10009f5c[t6]; +//nop; +goto *dest; +//nop; +L439e68: +at = v0 < 0x12; +if (at != 0) {at = v0 < 0x19; +goto L439ea8;} +at = v0 < 0x19; +if (at == 0) {t3 = v0 + 0xffffffe9; +goto L439f0c;} +t3 = v0 + 0xffffffe9; +at = t3 < 0x2; +if (at == 0) {//nop; +goto L439f18;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10009f54[] = { +&&L43957c, +&&L439c80, +}; +dest = Lswitch10009f54[t3]; +//nop; +goto *dest; +//nop; +L439ea8: +at = v0 < 0x5; +if (at == 0) {t5 = v0 + 0xfffffff6; +goto L439ee0;} +t5 = v0 + 0xfffffff6; +at = v0 < 0x5; +if (at == 0) {//nop; +goto L439f18;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10009f20[] = { +&&L439bcc, +&&L439c10, +&&L439f18, +&&L439f18, +&&L439c10, +}; +dest = Lswitch10009f20[v0]; +//nop; +goto *dest; +//nop; +L439ee0: +at = t5 < 0x8; +if (at == 0) {//nop; +goto L439f18;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch10009f34[] = { +&&L439c10, +&&L4397b0, +&&L439d00, +&&L439d00, +&&L439ce0, +&&L439ce0, +&&L439de8, +&&L439de8, +}; +dest = Lswitch10009f34[t5]; +//nop; +goto *dest; +//nop; +L439f0c: +at = 0x1d; +if (v0 == at) {//nop; +goto L439c10;} +//nop; +L439f18: +t8 = 0x10009ed0; +a0 = 0x4; +t8 = t8; +t9 = t8 + 0x48; +a1 = 0xf7; +t2 = sp; +L439f30: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t2 = t2 + 0xc; +MEM_U8(t2 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t2) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t2 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 4 + 3) = (uint8_t)(at >> 0); +if (t8 != t9) {//swr $at, 7($t2) +goto L439f30;} +//swr $at, 7($t2) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t0 = 0x10009e80; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +t9 = t8 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t8) +t0 = t0; +MEM_U8(t2 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t2 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t2 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t2 + 12 + 3) = (uint8_t)(t9 >> 0); +t6 = t0 + 0x48; +t3 = sp; +//swr $t9, 0xf($t2) +L439fa0: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t0 != t6) {//swr $at, 0x57($t3) +goto L439fa0;} +//swr $at, 0x57($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t6 = t0 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t0) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43a01c; +//nop; +L43a01c: +gp = MEM_U32(sp + 176); +//nop; +goto L43a080; +//nop; +L43a028: +at = t4 < 0x5; +if (at == 0) {//nop; +goto L439f18;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000a0a4[] = { +&&L4393c0, +&&L439f18, +&&L439c10, +&&L439f18, +&&L439750, +}; +dest = Lswitch1000a0a4[t4]; +//nop; +goto *dest; +//nop; +L43a054: +at = t5 < 0x8; +if (at == 0) {//nop; +goto L439f18;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000a0b8[] = { +&&L439c80, +&&L439f18, +&&L439770, +&&L439f18, +&&L439f18, +&&L439f18, +&&L439de8, +&&L439c10, +}; +dest = Lswitch1000a0b8[t5]; +//nop; +goto *dest; +//nop; +L43a080: +v1 = 0x10019d88; +t9 = MEM_U32(sp + 184); +t7 = MEM_U32(v1 + 0); +v0 = MEM_U8(sp + 191); +t8 = t7 + t9; +MEM_U32(v1 + 0) = t8; +L43a098: +ra = MEM_U32(sp + 180); +sp = sp + 0xc0; +//nop; +return v0; +//nop; +} + +static uint32_t f_cmp_tree_again(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43a0a8: +//cmp_tree_again: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 180) = s1; +MEM_U32(sp + 176) = s0; +s0 = a1; +s1 = a0; +MEM_U32(sp + 188) = ra; +MEM_U32(sp + 184) = gp; +a2 = 0x42; +v1 = MEM_U8(s1 + 32); +L43a0d8: +//nop; +if (a2 != v1) {//nop; +goto L43a124;} +//nop; +t6 = MEM_U8(s0 + 32); +v0 = s0; +if (a2 != t6) {//nop; +goto L43a11c;} +//nop; +L43a0f4: +if (v0 != s1) {//nop; +goto L43a104;} +//nop; +v0 = 0x1; +goto L43a488; +v0 = 0x1; +L43a104: +v0 = MEM_U32(v0 + 12); +//nop; +t7 = MEM_U8(v0 + 32); +//nop; +if (a2 == t7) {//nop; +goto L43a0f4;} +//nop; +L43a11c: +v0 = zero; +goto L43a488; +v0 = zero; +L43a124: +t8 = MEM_U16(s0 + 20); +t9 = MEM_U8(s0 + 26); +//nop; +if (t8 == t9) {//nop; +goto L43a140;} +//nop; +v0 = zero; +goto L43a488; +v0 = zero; +L43a140: +v0 = v1 & 0xff; +goto L43a2dc; +v0 = v1 & 0xff; +L43a148: +v0 = 0x1; +goto L43a488; +v0 = 0x1; +L43a150: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = MEM_U32(s0 + 0); +//nop; +v0 = f_cmp_tree_again(mem, sp, a0, a1); +goto L43a164; +//nop; +L43a164: +gp = MEM_U32(sp + 184); +ra = MEM_U32(sp + 188); +goto L43a48c; +ra = MEM_U32(sp + 188); +L43a170: +//nop; +a0 = MEM_U32(s1 + 4); +a1 = MEM_U32(s0 + 4); +//nop; +v0 = f_cmp_tree_again(mem, sp, a0, a1); +goto L43a184; +//nop; +L43a184: +gp = MEM_U32(sp + 184); +ra = MEM_U32(sp + 188); +goto L43a48c; +ra = MEM_U32(sp + 188); +L43a190: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = MEM_U32(s0 + 0); +//nop; +v0 = f_cmp_tree_again(mem, sp, a0, a1); +goto L43a1a4; +//nop; +L43a1a4: +gp = MEM_U32(sp + 184); +a2 = 0x42; +if (v0 == 0) {v1 = v0; +goto L43a1c4;} +v1 = v0; +s1 = MEM_U32(s1 + 4); +s0 = MEM_U32(s0 + 4); +v1 = MEM_U8(s1 + 32); +goto L43a0d8; +v1 = MEM_U8(s1 + 32); +L43a1c4: +v0 = v1; +goto L43a488; +v0 = v1; +L43a1cc: +t0 = 0x1000a128; +a0 = 0x4; +t0 = t0; +t2 = t0 + 0x48; +a1 = 0x12b; +t3 = sp; +L43a1e4: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 4 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 7($t3) +goto L43a1e4;} +//swr $at, 7($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t4 = 0x1000a0d8; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +t4 = t4; +MEM_U8(t3 + 12 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 12 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 12 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 12 + 3) = (uint8_t)(t2 >> 0); +t6 = t4 + 0x48; +t7 = sp; +//swr $t2, 0xf($t3) +L43a254: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 0x57($t7) +goto L43a254;} +//swr $at, 0x57($t7) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43a2d0; +//nop; +L43a2d0: +gp = MEM_U32(sp + 184); +v0 = zero; +goto L43a488; +v0 = zero; +L43a2dc: +at = v0 < 0x40; +if (at != 0) {at = v0 < 0x89; +goto L43a354;} +at = v0 < 0x89; +if (at != 0) {at = 0x8d; +goto L43a30c;} +at = 0x8d; +if (v0 == at) {//nop; +goto L43a190;} +//nop; +at = 0x97; +if (v0 == at) {//nop; +goto L43a148;} +//nop; +//nop; +goto L43a1cc; +//nop; +L43a30c: +at = v0 < 0x75; +if (at != 0) {t3 = v0 + 0xffffffba; +goto L43a430;} +t3 = v0 + 0xffffffba; +at = v0 < 0x80; +if (at == 0) {t5 = v0 + 0xffffff7a; +goto L43a45c;} +t5 = v0 + 0xffffff7a; +t8 = v0 + 0xffffff85; +at = t8 < 0x5; +if (at == 0) {//nop; +goto L43a1cc;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000a2dc[] = { +&&L43a150, +&&L43a1cc, +&&L43a190, +&&L43a1cc, +&&L43a190, +}; +dest = Lswitch1000a2dc[t8]; +//nop; +goto *dest; +//nop; +L43a354: +at = v0 < 0x10; +if (at != 0) {at = v0 < 0x19; +goto L43a3a0;} +at = v0 < 0x19; +if (at != 0) {t0 = v0 + 0xffffffe9; +goto L43a404;} +t0 = v0 + 0xffffffe9; +at = 0x1d; +if (v0 == at) {t9 = v0 + 0xffffffdd; +goto L43a190;} +t9 = v0 + 0xffffffdd; +at = t9 < 0x1d; +if (at == 0) {//nop; +goto L43a1cc;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000a1ac[] = { +&&L43a190, +&&L43a1cc, +&&L43a1cc, +&&L43a190, +&&L43a1cc, +&&L43a190, +&&L43a190, +&&L43a1cc, +&&L43a1cc, +&&L43a150, +&&L43a1cc, +&&L43a190, +&&L43a190, +&&L43a190, +&&L43a150, +&&L43a1cc, +&&L43a1cc, +&&L43a190, +&&L43a190, +&&L43a150, +&&L43a1cc, +&&L43a190, +&&L43a1cc, +&&L43a1cc, +&&L43a1cc, +&&L43a190, +&&L43a150, +&&L43a190, +&&L43a190, +}; +dest = Lswitch1000a1ac[t9]; +//nop; +goto *dest; +//nop; +L43a3a0: +at = v0 < 0x5; +if (at == 0) {t2 = v0 + 0xfffffff6; +goto L43a3d8;} +t2 = v0 + 0xfffffff6; +at = v0 < 0x5; +if (at == 0) {//nop; +goto L43a1cc;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000a178[] = { +&&L43a150, +&&L43a190, +&&L43a1cc, +&&L43a1cc, +&&L43a190, +}; +dest = Lswitch1000a178[v0]; +//nop; +goto *dest; +//nop; +L43a3d8: +at = t2 < 0x6; +if (at == 0) {//nop; +goto L43a1cc;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000a18c[] = { +&&L43a190, +&&L43a150, +&&L43a150, +&&L43a150, +&&L43a150, +&&L43a150, +}; +dest = Lswitch1000a18c[t2]; +//nop; +goto *dest; +//nop; +L43a404: +at = t0 < 0x2; +if (at == 0) {//nop; +goto L43a1cc;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000a1a4[] = { +&&L43a148, +&&L43a150, +}; +dest = Lswitch1000a1a4[t0]; +//nop; +goto *dest; +//nop; +L43a430: +at = t3 < 0x2f; +if (at == 0) {//nop; +goto L43a1cc;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000a220[] = { +&&L43a148, +&&L43a148, +&&L43a1cc, +&&L43a148, +&&L43a1cc, +&&L43a1cc, +&&L43a1cc, +&&L43a190, +&&L43a190, +&&L43a1cc, +&&L43a150, +&&L43a1cc, +&&L43a148, +&&L43a1cc, +&&L43a1cc, +&&L43a190, +&&L43a190, +&&L43a190, +&&L43a190, +&&L43a1cc, +&&L43a1cc, +&&L43a190, +&&L43a148, +&&L43a1cc, +&&L43a150, +&&L43a190, +&&L43a1cc, +&&L43a150, +&&L43a1cc, +&&L43a1cc, +&&L43a150, +&&L43a1cc, +&&L43a1cc, +&&L43a1cc, +&&L43a1cc, +&&L43a190, +&&L43a1cc, +&&L43a1cc, +&&L43a1cc, +&&L43a1cc, +&&L43a150, +&&L43a1cc, +&&L43a1cc, +&&L43a1cc, +&&L43a1cc, +&&L43a190, +&&L43a190, +}; +dest = Lswitch1000a220[t3]; +//nop; +goto *dest; +//nop; +L43a45c: +at = t5 < 0x3; +if (at == 0) {//nop; +goto L43a1cc;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000a2f0[] = { +&&L43a150, +&&L43a1cc, +&&L43a170, +}; +dest = Lswitch1000a2f0[t5]; +//nop; +goto *dest; +//nop; +L43a488: +ra = MEM_U32(sp + 188); +L43a48c: +s0 = MEM_U32(sp + 176); +s1 = MEM_U32(sp + 180); +sp = sp + 0xc0; +return v0; +sp = sp + 0xc0; +} + +static void f_move_label(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43a49c: +//move_label: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +t6 = MEM_U32(a0 + 8); +t7 = MEM_U32(a0 + 12); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(t7 + 8) = t6; +t9 = MEM_U32(a0 + 8); +t8 = MEM_U32(a0 + 12); +//nop; +MEM_U32(t9 + 12) = t8; +//nop; +//nop; +//nop; +f_insert(mem, sp, a0, a1); +goto L43a4e0; +//nop; +L43a4e0: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static uint32_t f_get_prior_stm(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43a4f0: +//get_prior_stm: +//nop; +//nop; +//nop; +a0 = MEM_U32(a0 + 12); +v0 = 0x10005384; +t6 = MEM_U8(a0 + 32); +//nop; +t7 = t6 < 0xa0; +if (t7 == 0) {t8 = (int)t6 >> 5; +goto L43a530;} +t8 = (int)t6 >> 5; +t9 = t8 << 2; +t0 = v0 + t9; +t1 = MEM_U32(t0 + 0); +//nop; +t2 = t1 << (t6 & 0x1f); +t7 = (int)t2 < (int)0x0; +L43a530: +if (t7 == 0) {//nop; +goto L43a574;} +//nop; +L43a538: +a0 = MEM_U32(a0 + 12); +//nop; +t4 = MEM_U8(a0 + 32); +//nop; +t5 = t4 < 0xa0; +if (t5 == 0) {t8 = (int)t4 >> 5; +goto L43a56c;} +t8 = (int)t4 >> 5; +t9 = t8 << 2; +t0 = v0 + t9; +t1 = MEM_U32(t0 + 0); +//nop; +t6 = t1 << (t4 & 0x1f); +t5 = (int)t6 < (int)0x0; +L43a56c: +if (t5 != 0) {//nop; +goto L43a538;} +//nop; +L43a574: +v0 = a0; +return v0; +v0 = a0; +} + +static uint32_t f_get_prior_stm1(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43a57c: +//get_prior_stm1: +//nop; +//nop; +//nop; +a0 = MEM_U32(a0 + 12); +v1 = 0x10005384; +v0 = MEM_U8(a0 + 32); +a1 = 0x42; +t6 = v0 < 0xa0; +if (t6 == 0) {t7 = (int)v0 >> 5; +goto L43a5bc;} +t7 = (int)v0 >> 5; +t8 = t7 << 2; +t9 = v1 + t8; +t0 = MEM_U32(t9 + 0); +//nop; +t1 = t0 << (v0 & 0x1f); +t6 = (int)t1 < (int)0x0; +L43a5bc: +if (t6 != 0) {//nop; +goto L43a5cc;} +//nop; +if (a1 != v0) {//nop; +goto L43a610;} +//nop; +L43a5cc: +a0 = MEM_U32(a0 + 12); +a1 = 0x42; +v0 = MEM_U8(a0 + 32); +//nop; +t3 = v0 < 0xa0; +if (t3 == 0) {t4 = (int)v0 >> 5; +goto L43a600;} +t4 = (int)v0 >> 5; +t5 = t4 << 2; +t7 = v1 + t5; +t8 = MEM_U32(t7 + 0); +//nop; +t9 = t8 << (v0 & 0x1f); +t3 = (int)t9 < (int)0x0; +L43a600: +if (t3 != 0) {//nop; +goto L43a5cc;} +//nop; +if (a1 == v0) {//nop; +goto L43a5cc;} +//nop; +L43a610: +v0 = a0; +return v0; +v0 = a0; +} + +static uint32_t f_find_br(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43a618: +//find_br: +//nop; +//nop; +//nop; +v1 = MEM_U32(a0 + 4); +//nop; +v0 = MEM_U8(v1 + 32); +//nop; +t6 = v0 + 0xffffffe0; +t7 = t6 < 0x60; +if (t7 == 0) {t8 = (int)t6 >> 5; +goto L43a664;} +t8 = (int)t6 >> 5; +t0 = 0x10005434; +t9 = t8 << 2; +t0 = t0; +t1 = t0 + t9; +t2 = MEM_U32(t1 + 0); +//nop; +t3 = t2 << (t6 & 0x1f); +t7 = (int)t3 < (int)0x0; +L43a664: +if (t7 != 0) {//nop; +goto L43a6fc;} +//nop; +a1 = 0x10005384; +a2 = 0x42; +L43a674: +if (v1 == a0) {t5 = v0 < 0xa0; +goto L43a6ac;} +t5 = v0 < 0xa0; +if (t5 == 0) {t8 = (int)v0 >> 5; +goto L43a69c;} +t8 = (int)v0 >> 5; +t0 = t8 << 2; +t9 = a1 + t0; +t1 = MEM_U32(t9 + 0); +//nop; +t2 = t1 << (v0 & 0x1f); +t5 = (int)t2 < (int)0x0; +L43a69c: +if (t5 != 0) {//nop; +goto L43a6b4;} +//nop; +if (a2 == v0) {//nop; +goto L43a6b4;} +//nop; +L43a6ac: +v0 = zero; +return v0; +v0 = zero; +L43a6b4: +v1 = MEM_U32(v1 + 12); +//nop; +v0 = MEM_U8(v1 + 32); +//nop; +t3 = v0 + 0xffffffe0; +t4 = t3 < 0x60; +if (t4 == 0) {t7 = (int)t3 >> 5; +goto L43a6f4;} +t7 = (int)t3 >> 5; +t0 = 0x10005434; +t8 = t7 << 2; +t0 = t0; +t9 = t0 + t8; +t1 = MEM_U32(t9 + 0); +//nop; +t2 = t1 << (t3 & 0x1f); +t4 = (int)t2 < (int)0x0; +L43a6f4: +if (t4 == 0) {//nop; +goto L43a674;} +//nop; +L43a6fc: +v0 = v1; +//nop; +return v0; +//nop; +} + +static void f_match_uconds(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43a708: +//match_uconds: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 60) = ra; +MEM_U32(sp + 56) = gp; +MEM_U32(sp + 52) = s7; +MEM_U32(sp + 48) = s6; +MEM_U32(sp + 44) = s5; +MEM_U32(sp + 40) = s4; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 24) = s0; +s6 = MEM_U32(a0 + 4); +s1 = 0x10005370; +s5 = a0; +s0 = a0; +s7 = zero; +s4 = 0x42; +L43a758: +//nop; +a0 = s6; +//nop; +v0 = f_get_prior_stm1(mem, sp, a0); +goto L43a768; +//nop; +L43a768: +gp = MEM_U32(sp + 56); +s6 = v0; +//nop; +a0 = s0; +//nop; +v0 = f_get_prior_stm(mem, sp, a0); +goto L43a780; +//nop; +L43a780: +v1 = MEM_U8(v0 + 32); +gp = MEM_U32(sp + 56); +if (s4 != v1) {s0 = v0; +goto L43a7c0;} +s0 = v0; +L43a790: +t6 = MEM_U32(s5 + 4); +//nop; +if (v0 == t6) {//nop; +goto L43a84c;} +//nop; +//nop; +a0 = s0; +//nop; +v0 = f_get_prior_stm(mem, sp, a0); +goto L43a7b0; +//nop; +L43a7b0: +v1 = MEM_U8(v0 + 32); +gp = MEM_U32(sp + 56); +if (s4 == v1) {s0 = v0; +goto L43a790;} +s0 = v0; +L43a7c0: +if (s6 == s5) {t5 = v1 < 0xa0; +goto L43a84c;} +t5 = v1 < 0xa0; +t7 = MEM_U8(s6 + 32); +t6 = (int)v1 >> 5; +t8 = t7 < 0xa0; +if (t8 == 0) {//nop; +goto L43a7f8;} +//nop; +t9 = (int)t7 >> 5; +t0 = t9 << 2; +t1 = s1 + t0; +t2 = MEM_U32(t1 + 0); +//nop; +t3 = t2 << (t7 & 0x1f); +t8 = (int)t3 < (int)0x0; +L43a7f8: +if (t8 != 0) {//nop; +goto L43a84c;} +//nop; +if (t5 == 0) {//nop; +goto L43a820;} +//nop; +t9 = t6 << 2; +t0 = s1 + t9; +t1 = MEM_U32(t0 + 0); +//nop; +t2 = t1 << (v1 & 0x1f); +t5 = (int)t2 < (int)0x0; +L43a820: +if (t5 != 0) {//nop; +goto L43a84c;} +//nop; +//nop; +a0 = s0; +a1 = s6; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L43a838; +a1 = s6; +L43a838: +gp = MEM_U32(sp + 56); +if (v0 == 0) {//nop; +goto L43a84c;} +//nop; +s7 = 0x1; +goto L43a758; +s7 = 0x1; +L43a84c: +if (s7 == 0) {ra = MEM_U32(sp + 60); +goto L43a9d0;} +ra = MEM_U32(sp + 60); +s3 = MEM_U32(s5 + 4); +s2 = s5; +if (s3 == s6) {s7 = zero; +goto L43a928;} +s7 = zero; +L43a864: +//nop; +s1 = s3; +a0 = s3; +v0 = f_get_prior_stm(mem, sp, a0); +goto L43a874; +a0 = s3; +L43a874: +t3 = MEM_U8(v0 + 32); +gp = MEM_U32(sp + 56); +if (s4 != t3) {s3 = v0; +goto L43a8a4;} +s3 = v0; +L43a884: +//nop; +s1 = s3; +a0 = s3; +v0 = f_get_prior_stm(mem, sp, a0); +goto L43a894; +a0 = s3; +L43a894: +t4 = MEM_U8(v0 + 32); +gp = MEM_U32(sp + 56); +if (s4 == t4) {s3 = v0; +goto L43a884;} +s3 = v0; +L43a8a4: +//nop; +a0 = s2; +//nop; +v0 = f_get_prior_stm(mem, sp, a0); +goto L43a8b4; +//nop; +L43a8b4: +t8 = MEM_U8(v0 + 32); +gp = MEM_U32(sp + 56); +if (s4 != t8) {s2 = v0; +goto L43a8fc;} +s2 = v0; +L43a8c4: +//nop; +s0 = s2; +a0 = s2; +v0 = f_get_prior_stm(mem, sp, a0); +goto L43a8d4; +a0 = s2; +L43a8d4: +gp = MEM_U32(sp + 56); +s2 = v0; +//nop; +a0 = s0; +a1 = s1; +f_move_label(mem, sp, a0, a1); +goto L43a8ec; +a1 = s1; +L43a8ec: +t6 = MEM_U8(s2 + 32); +gp = MEM_U32(sp + 56); +if (s4 == t6) {//nop; +goto L43a8c4;} +//nop; +L43a8fc: +if (s3 == s6) {//nop; +goto L43a928;} +//nop; +//nop; +a0 = s2; +a1 = s3; +v0 = f_cmp_tree_again(mem, sp, a0, a1); +goto L43a914; +a1 = s3; +L43a914: +gp = MEM_U32(sp + 56); +if (v0 == 0) {//nop; +goto L43a928;} +//nop; +if (s3 != s6) {s7 = 0x1; +goto L43a864;} +s7 = 0x1; +L43a928: +if (s7 == 0) {ra = MEM_U32(sp + 60); +goto L43a9d0;} +ra = MEM_U32(sp + 60); +if (s5 == s2) {s0 = s5; +goto L43a96c;} +s0 = s5; +L43a938: +//nop; +a0 = s0; +//nop; +f_delete_statement(mem, sp, a0); +goto L43a948; +//nop; +L43a948: +gp = MEM_U32(sp + 56); +a0 = s0; +//nop; +//nop; +//nop; +v0 = f_get_prior_stm(mem, sp, a0); +goto L43a960; +//nop; +L43a960: +gp = MEM_U32(sp + 56); +if (v0 != s2) {s0 = v0; +goto L43a938;} +s0 = v0; +L43a96c: +//nop; +//nop; +//nop; +v0 = f_make_new_label(mem, sp); +goto L43a97c; +//nop; +L43a97c: +gp = MEM_U32(sp + 56); +s6 = v0; +//nop; +a0 = v0; +//nop; +v0 = f_make_new_jump(mem, sp, a0); +goto L43a994; +//nop; +L43a994: +gp = MEM_U32(sp + 56); +a0 = v0; +//nop; +a1 = s2; +//nop; +f_append(mem, sp, a0, a1); +goto L43a9ac; +//nop; +L43a9ac: +gp = MEM_U32(sp + 56); +a0 = s6; +//nop; +a1 = s3; +//nop; +f_append(mem, sp, a0, a1); +goto L43a9c4; +//nop; +L43a9c4: +gp = MEM_U32(sp + 56); +//nop; +ra = MEM_U32(sp + 60); +L43a9d0: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +s4 = MEM_U32(sp + 40); +s5 = MEM_U32(sp + 44); +s6 = MEM_U32(sp + 48); +s7 = MEM_U32(sp + 52); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static uint32_t f_cmp_br(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43a9f8: +//cmp_br: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 20) = s0; +t6 = MEM_U8(a0 + 26); +a3 = a0; +t7 = t6 + 0x1; +MEM_U8(a0 + 26) = (uint8_t)t7; +t8 = MEM_U8(a1 + 26); +a2 = a1; +t9 = t8 + 0x1; +MEM_U8(a1 + 26) = (uint8_t)t9; +s0 = MEM_U32(a0 + 0); +//nop; +t1 = MEM_U8(s0 + 26); +//nop; +t2 = t1 + 0x1; +MEM_U8(s0 + 26) = (uint8_t)t2; +v0 = MEM_U32(a1 + 0); +//nop; +t3 = MEM_U8(v0 + 26); +//nop; +t4 = t3 + 0x1; +MEM_U8(v0 + 26) = (uint8_t)t4; +s0 = MEM_U32(a0 + 0); +//nop; +t0 = MEM_U8(s0 + 32); +//nop; +t5 = t0 + 0xffffffe0; +t6 = t5 < 0x40; +if (t6 == 0) {t7 = (int)t5 >> 5; +goto L43aaa4;} +t7 = (int)t5 >> 5; +t9 = 0x10005440; +t8 = t7 << 2; +t9 = t9; +t1 = t9 + t8; +t2 = MEM_U32(t1 + 0); +//nop; +t3 = t2 << (t5 & 0x1f); +t6 = (int)t3 < (int)0x0; +L43aaa4: +if (t6 == 0) {//nop; +goto L43ab8c;} +//nop; +v0 = MEM_U32(a2 + 0); +//nop; +a1 = MEM_U8(v0 + 32); +//nop; +t7 = a1 + 0xffffffe0; +t9 = t7 < 0x40; +if (t9 == 0) {t8 = (int)t7 >> 5; +goto L43aaec;} +t8 = (int)t7 >> 5; +t2 = 0x10005440; +t1 = t8 << 2; +t2 = t2; +t5 = t2 + t1; +t3 = MEM_U32(t5 + 0); +//nop; +t4 = t3 << (t7 & 0x1f); +t9 = (int)t4 < (int)0x0; +L43aaec: +if (t9 == 0) {//nop; +goto L43ab8c;} +//nop; +v1 = MEM_U8(a2 + 32); +a0 = MEM_U8(a3 + 32); +//nop; +if (v1 != a0) {//nop; +goto L43ab24;} +//nop; +t8 = 0x10005398; +//nop; +t2 = a1 + t8; +t1 = MEM_U8(t2 + 0); +//nop; +if (t1 == t0) {//nop; +goto L43ab34;} +//nop; +L43ab24: +if (v1 == a0) {//nop; +goto L43abc8;} +//nop; +if (a1 != t0) {//nop; +goto L43abc8;} +//nop; +L43ab34: +//nop; +a0 = MEM_U32(s0 + 0); +a1 = MEM_U32(v0 + 0); +MEM_U32(sp + 36) = a2; +MEM_U32(sp + 32) = a3; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L43ab4c; +MEM_U32(sp + 32) = a3; +L43ab4c: +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 36); +a3 = MEM_U32(sp + 32); +if (v0 == 0) {v1 = v0; +goto L43ab84;} +v1 = v0; +t5 = MEM_U32(a3 + 0); +t3 = MEM_U32(a2 + 0); +//nop; +a0 = MEM_U32(t5 + 4); +a1 = MEM_U32(t3 + 4); +//nop; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L43ab7c; +//nop; +L43ab7c: +gp = MEM_U32(sp + 24); +v1 = v0; +L43ab84: +v0 = v1; +goto L43abcc; +v0 = v1; +L43ab8c: +t7 = MEM_U8(a2 + 32); +t4 = MEM_U8(a3 + 32); +//nop; +v1 = t7 ^ t4; +v1 = zero < v1; +if (v1 == 0) {//nop; +goto L43abc0;} +//nop; +//nop; +a1 = MEM_U32(a2 + 0); +a0 = s0; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L43abb8; +a0 = s0; +L43abb8: +gp = MEM_U32(sp + 24); +v1 = v0; +L43abc0: +v0 = v1; +goto L43abcc; +v0 = v1; +L43abc8: +v0 = zero; +L43abcc: +ra = MEM_U32(sp + 28); +s0 = MEM_U32(sp + 20); +sp = sp + 0x20; +return v0; +sp = sp + 0x20; +} + +static void f_match_conds(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43abdc: +//match_conds: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +//nop; +MEM_U32(sp + 52) = ra; +MEM_U32(sp + 48) = gp; +MEM_U32(sp + 44) = s5; +MEM_U32(sp + 40) = s4; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 56) = a0; +v0 = f_find_br(mem, sp, a0); +goto L43ac18; +MEM_U32(sp + 56) = a0; +L43ac18: +gp = MEM_U32(sp + 48); +s3 = v0; +s2 = 0x10019d88; +if (v0 == 0) {MEM_U32(s2 + 0) = zero; +goto L43aec8;} +MEM_U32(s2 + 0) = zero; +//nop; +a0 = v0; +//nop; +v0 = f_find_br(mem, sp, a0); +goto L43ac3c; +//nop; +L43ac3c: +a0 = MEM_U32(sp + 56); +gp = MEM_U32(sp + 48); +if (v0 != a0) {ra = MEM_U32(sp + 52); +goto L43aecc;} +ra = MEM_U32(sp + 52); +//nop; +a1 = s3; +//nop; +v0 = f_cmp_br(mem, sp, a0, a1); +goto L43ac5c; +//nop; +L43ac5c: +gp = MEM_U32(sp + 48); +if (v0 == 0) {ra = MEM_U32(sp + 52); +goto L43aecc;} +ra = MEM_U32(sp + 52); +s0 = MEM_U32(sp + 56); +s1 = 0x10005370; +s5 = s3; +L43ac74: +//nop; +a0 = s5; +//nop; +v0 = f_get_prior_stm1(mem, sp, a0); +goto L43ac84; +//nop; +L43ac84: +gp = MEM_U32(sp + 48); +s5 = v0; +//nop; +a0 = s0; +//nop; +v0 = f_get_prior_stm1(mem, sp, a0); +goto L43ac9c; +//nop; +L43ac9c: +t6 = MEM_U8(s5 + 32); +gp = MEM_U32(sp + 48); +t7 = t6 < 0xa0; +if (t7 == 0) {s0 = v0; +goto L43accc;} +s0 = v0; +t8 = (int)t6 >> 5; +t9 = t8 << 2; +t0 = s1 + t9; +t1 = MEM_U32(t0 + 0); +//nop; +t2 = t1 << (t6 & 0x1f); +t7 = (int)t2 < (int)0x0; +L43accc: +if (t7 != 0) {//nop; +goto L43ad24;} +//nop; +t4 = MEM_U8(v0 + 32); +//nop; +t5 = t4 < 0xa0; +if (t5 == 0) {t8 = (int)t4 >> 5; +goto L43ad00;} +t8 = (int)t4 >> 5; +t9 = t8 << 2; +t0 = s1 + t9; +t1 = MEM_U32(t0 + 0); +//nop; +t6 = t1 << (t4 & 0x1f); +t5 = (int)t6 < (int)0x0; +L43ad00: +if (t5 != 0) {//nop; +goto L43ad24;} +//nop; +//nop; +a0 = s0; +a1 = s5; +v0 = f_cmp_tree(mem, sp, a0, a1); +goto L43ad18; +a1 = s5; +L43ad18: +gp = MEM_U32(sp + 48); +if (v0 != 0) {//nop; +goto L43ac74;} +//nop; +L43ad24: +t3 = MEM_U32(s2 + 0); +s2 = MEM_U32(sp + 56); +at = t3 < 0x3; +if (at != 0) {ra = MEM_U32(sp + 52); +goto L43aecc;} +ra = MEM_U32(sp + 52); +//nop; +a0 = MEM_U32(s2 + 0); +a1 = MEM_U32(s3 + 0); +s4 = s3; +v0 = f_cmp_tree_again(mem, sp, a0, a1); +goto L43ad4c; +s4 = s3; +L43ad4c: +gp = MEM_U32(sp + 48); +if (v0 == 0) {ra = MEM_U32(sp + 52); +goto L43aecc;} +ra = MEM_U32(sp + 52); +if (s3 == s5) {s3 = 0x42; +goto L43ae24;} +s3 = 0x42; +L43ad60: +//nop; +s1 = s4; +a0 = s4; +v0 = f_get_prior_stm(mem, sp, a0); +goto L43ad70; +a0 = s4; +L43ad70: +t8 = MEM_U8(v0 + 32); +gp = MEM_U32(sp + 48); +if (s3 != t8) {s4 = v0; +goto L43ada0;} +s4 = v0; +L43ad80: +//nop; +s1 = s4; +a0 = s4; +v0 = f_get_prior_stm(mem, sp, a0); +goto L43ad90; +a0 = s4; +L43ad90: +t9 = MEM_U8(v0 + 32); +gp = MEM_U32(sp + 48); +if (s3 == t9) {s4 = v0; +goto L43ad80;} +s4 = v0; +L43ada0: +//nop; +a0 = s2; +//nop; +v0 = f_get_prior_stm(mem, sp, a0); +goto L43adb0; +//nop; +L43adb0: +t0 = MEM_U8(v0 + 32); +gp = MEM_U32(sp + 48); +if (s3 != t0) {s2 = v0; +goto L43adf8;} +s2 = v0; +L43adc0: +//nop; +s0 = s2; +a0 = s2; +v0 = f_get_prior_stm(mem, sp, a0); +goto L43add0; +a0 = s2; +L43add0: +gp = MEM_U32(sp + 48); +s2 = v0; +//nop; +a0 = s0; +a1 = s1; +f_move_label(mem, sp, a0, a1); +goto L43ade8; +a1 = s1; +L43ade8: +t1 = MEM_U8(s2 + 32); +gp = MEM_U32(sp + 48); +if (s3 == t1) {//nop; +goto L43adc0;} +//nop; +L43adf8: +if (s4 == s5) {s0 = MEM_U32(sp + 56); +goto L43ae28;} +s0 = MEM_U32(sp + 56); +//nop; +a0 = s2; +a1 = s4; +v0 = f_cmp_tree_again(mem, sp, a0, a1); +goto L43ae10; +a1 = s4; +L43ae10: +gp = MEM_U32(sp + 48); +if (v0 == 0) {s0 = MEM_U32(sp + 56); +goto L43ae28;} +s0 = MEM_U32(sp + 56); +if (s4 != s5) {//nop; +goto L43ad60;} +//nop; +L43ae24: +s0 = MEM_U32(sp + 56); +L43ae28: +//nop; +if (s0 == s2) {//nop; +goto L43ae68;} +//nop; +L43ae34: +//nop; +a0 = s0; +//nop; +f_delete_statement(mem, sp, a0); +goto L43ae44; +//nop; +L43ae44: +gp = MEM_U32(sp + 48); +a0 = s0; +//nop; +//nop; +//nop; +v0 = f_get_prior_stm(mem, sp, a0); +goto L43ae5c; +//nop; +L43ae5c: +gp = MEM_U32(sp + 48); +if (v0 != s2) {s0 = v0; +goto L43ae34;} +s0 = v0; +L43ae68: +//nop; +//nop; +//nop; +v0 = f_make_new_label(mem, sp); +goto L43ae78; +//nop; +L43ae78: +gp = MEM_U32(sp + 48); +s5 = v0; +//nop; +a0 = v0; +//nop; +v0 = f_make_new_jump(mem, sp, a0); +goto L43ae90; +//nop; +L43ae90: +gp = MEM_U32(sp + 48); +a0 = v0; +//nop; +a1 = s2; +//nop; +f_append(mem, sp, a0, a1); +goto L43aea8; +//nop; +L43aea8: +gp = MEM_U32(sp + 48); +a0 = s5; +//nop; +a1 = s4; +//nop; +f_append(mem, sp, a0, a1); +goto L43aec0; +//nop; +L43aec0: +gp = MEM_U32(sp + 48); +//nop; +L43aec8: +ra = MEM_U32(sp + 52); +L43aecc: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +s4 = MEM_U32(sp + 40); +s5 = MEM_U32(sp + 44); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void f_cross_jump(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43aeec: +//cross_jump: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 20) = s0; +s0 = a0; +MEM_U32(sp + 52) = ra; +MEM_U32(sp + 48) = gp; +MEM_U32(sp + 44) = s6; +MEM_U32(sp + 40) = s5; +MEM_U32(sp + 36) = s4; +MEM_U32(sp + 32) = s3; +MEM_U32(sp + 28) = s2; +if (a0 == 0) {MEM_U32(sp + 24) = s1; +goto L43b040;} +MEM_U32(sp + 24) = s1; +s6 = 0x10018e00; +s5 = 0x51; +s4 = 0x26; +s3 = 0x11; +s2 = 0x88; +s1 = 0x7f; +L43af40: +v0 = MEM_U8(s0 + 32); +at = v0 < 0x52; +goto L43aff8; +at = v0 < 0x52; +L43af4c: +t6 = MEM_U32(s0 + 40); +MEM_U32(s6 + 0) = t6; +goto L43b030; +MEM_U32(s6 + 0) = t6; +L43af58: +a0 = MEM_U32(s0 + 40); +//nop; +if (a0 == 0) {a0 = a0 + 0x1; +goto L43b030;} +a0 = a0 + 0x1; +a1 = a0 + 0xffffffff; +t7 = a1 & 0x3; +if (t7 == 0) {v0 = 0x1; +goto L43af94;} +v0 = 0x1; +v1 = t7 + 0x1; +L43af7c: +s0 = MEM_U32(s0 + 8); +v0 = v0 + 0x1; +if (v1 != v0) {//nop; +goto L43af7c;} +//nop; +if (v0 == a0) {//nop; +goto L43b030;} +//nop; +L43af94: +s0 = MEM_U32(s0 + 8); +v0 = v0 + 0x4; +s0 = MEM_U32(s0 + 8); +//nop; +s0 = MEM_U32(s0 + 8); +//nop; +s0 = MEM_U32(s0 + 8); +if (v0 != a0) {//nop; +goto L43af94;} +//nop; +s0 = MEM_U32(s0 + 8); +goto L43b034; +s0 = MEM_U32(s0 + 8); +L43afc0: +//nop; +a0 = s0; +//nop; +f_match_uconds(mem, sp, a0); +goto L43afd0; +//nop; +L43afd0: +gp = MEM_U32(sp + 48); +s0 = MEM_U32(s0 + 8); +goto L43b034; +s0 = MEM_U32(s0 + 8); +L43afdc: +//nop; +a0 = s0; +//nop; +f_match_conds(mem, sp, a0); +goto L43afec; +//nop; +L43afec: +gp = MEM_U32(sp + 48); +s0 = MEM_U32(s0 + 8); +goto L43b034; +s0 = MEM_U32(s0 + 8); +L43aff8: +if (at != 0) {//nop; +goto L43b018;} +//nop; +if (v0 == s1) {//nop; +goto L43afdc;} +//nop; +if (v0 == s2) {//nop; +goto L43afc0;} +//nop; +s0 = MEM_U32(s0 + 8); +goto L43b034; +s0 = MEM_U32(s0 + 8); +L43b018: +if (v0 == s3) {//nop; +goto L43af58;} +//nop; +if (v0 == s4) {//nop; +goto L43afdc;} +//nop; +if (v0 == s5) {//nop; +goto L43af4c;} +//nop; +L43b030: +s0 = MEM_U32(s0 + 8); +L43b034: +//nop; +if (s0 != 0) {//nop; +goto L43af40;} +//nop; +L43b040: +ra = MEM_U32(sp + 52); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +s3 = MEM_U32(sp + 32); +s4 = MEM_U32(sp + 36); +s5 = MEM_U32(sp + 40); +s6 = MEM_U32(sp + 44); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void f_set_opts(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43b068: +//set_opts: +//nop; +//nop; +//nop; +at = 0x10019364; +sp = sp + 0xffffffe0; +MEM_U8(at + 0) = (uint8_t)a1; +at = 0x10019368; +v1 = 0x2; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +if (a1 != v1) {MEM_U8(at + 0) = (uint8_t)a0; +goto L43b0b0;} +MEM_U8(at + 0) = (uint8_t)a0; +at = a0 < 0x2; +if (at != 0) {at = a0 < 0x5; +goto L43b0b4;} +at = a0 < 0x5; +a0 = 0x1; +L43b0b0: +at = a0 < 0x5; +L43b0b4: +if (at == 0) {a3 = 0x5; +goto L43b21c;} +a3 = 0x5; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000a308[] = { +&&L43b0dc, +&&L43b114, +&&L43b180, +&&L43b180, +&&L43b180, +}; +dest = Lswitch1000a308[a0]; +//nop; +goto *dest; +//nop; +L43b0dc: +at = 0x10019350; +a2 = 0x1; +MEM_U8(at + 0) = (uint8_t)a2; +at = 0x10019354; +v0 = 0x10019360; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10019358; +//nop; +MEM_U8(at + 0) = (uint8_t)a2; +at = 0x1001935c; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +MEM_U8(v0 + 0) = (uint8_t)zero; +goto L43b23c; +MEM_U8(v0 + 0) = (uint8_t)zero; +L43b114: +v0 = a1 < 0x1; +if (v0 != 0) {at = 0x3; +goto L43b128;} +at = 0x3; +if (a1 != at) {//nop; +goto L43b138;} +//nop; +L43b128: +at = 0x10019350; +a2 = 0x1; +MEM_U8(at + 0) = (uint8_t)v1; +goto L43b144; +MEM_U8(at + 0) = (uint8_t)v1; +L43b138: +at = 0x10019350; +a2 = 0x1; +MEM_U8(at + 0) = (uint8_t)a2; +L43b144: +if (v0 != 0) {v1 = v0; +goto L43b154;} +v1 = v0; +v1 = a1 ^ 0x3; +v1 = v1 < 0x1; +L43b154: +at = 0x10019354; +v0 = 0x10019360; +MEM_U8(at + 0) = (uint8_t)v1; +at = 0x10019358; +//nop; +MEM_U8(at + 0) = (uint8_t)a2; +at = 0x1001935c; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +MEM_U8(v0 + 0) = (uint8_t)zero; +goto L43b23c; +MEM_U8(v0 + 0) = (uint8_t)zero; +L43b180: +v0 = a1 < 0x1; +if (v0 != 0) {at = 0x3; +goto L43b194;} +at = 0x3; +if (a1 != at) {//nop; +goto L43b1a4;} +//nop; +L43b194: +at = 0x10019350; +a2 = 0x1; +MEM_U8(at + 0) = (uint8_t)v1; +goto L43b1b0; +MEM_U8(at + 0) = (uint8_t)v1; +L43b1a4: +at = 0x10019350; +a2 = 0x1; +MEM_U8(at + 0) = (uint8_t)a2; +L43b1b0: +if (v0 != 0) {v1 = v0; +goto L43b1c0;} +v1 = v0; +v1 = a1 ^ 0x3; +v1 = v1 < 0x1; +L43b1c0: +at = 0x10019354; +//nop; +MEM_U8(at + 0) = (uint8_t)v1; +at = 0x10019358; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001935c; +//nop; +MEM_U8(at + 0) = (uint8_t)a2; +at = a0 < 0x3; +if (at != 0) {//nop; +goto L43b210;} +//nop; +v0 = 0x10019360; +//nop; +t7 = MEM_U8(v0 + 0); +//nop; +if (t7 == 0) {//nop; +goto L43b210;} +//nop; +MEM_U8(v0 + 0) = (uint8_t)a2; +goto L43b23c; +MEM_U8(v0 + 0) = (uint8_t)a2; +L43b210: +v0 = 0x10019360; +MEM_U8(v0 + 0) = (uint8_t)zero; +goto L43b23c; +MEM_U8(v0 + 0) = (uint8_t)zero; +L43b21c: +a2 = 0x1000a300; +//nop; +a0 = 0x1; +a1 = 0x1d; +a2 = a2; +f_caseerror(mem, sp, a0, a1, a2, a3); +goto L43b234; +a2 = a2; +L43b234: +gp = MEM_U32(sp + 24); +//nop; +L43b23c: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return; +//nop; +//nop; +//nop; +//nop; +} + +static uint32_t f_pass_in_reg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43b258: +//pass_in_reg: +t6 = MEM_U8(a0 + 32); +at = 0xc000000; +t7 = t6 + 0xffffffa0; +t8 = t7 < 0x20; +t9 = -t8; +t0 = t9 & at; +t1 = t0 << (t7 & 0x1f); +if ((int)t1 < 0) {//nop; +goto L43b280;} +//nop; +abort(); +L43b280: +v0 = MEM_U32(a0 + 48); +//nop; +t2 = v0 + 0x1; +v0 = zero < t2; +return v0; +v0 = zero < t2; +} + +static uint32_t f_parm_reg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43b294: +//parm_reg: +//nop; +//nop; +//nop; +t6 = MEM_U8(a0 + 32); +//nop; +t7 = t6 + 0xffffffa0; +t8 = t7 < 0x40; +if (t8 == 0) {//nop; +goto L43b2e0;} +//nop; +t1 = 0x10005450; +t9 = (int)t7 >> 5; +t0 = t9 << 2; +t1 = t1; +t2 = t1 + t0; +t3 = MEM_U32(t2 + 0); +//nop; +t4 = t3 << (t7 & 0x1f); +t5 = (int)t4 < (int)0x0; +t8 = t5; +L43b2e0: +if (t8 != 0) {//nop; +goto L43b2ec;} +//nop; +abort(); +L43b2ec: +v1 = MEM_U32(a0 + 48); +at = 0xffffffff; +if (v1 != at) {//nop; +goto L43b304;} +//nop; +v0 = 0x48; +return v0; +v0 = 0x48; +L43b304: +t6 = 0x10018ed0; +//nop; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L43b334;} +//nop; +if ((int)v1 >= 0) {v0 = (int)v1 >> 2; +goto L43b32c;} +v0 = (int)v1 >> 2; +at = v1 + 0x3; +v0 = (int)at >> 2; +L43b32c: +//nop; +return v0; +//nop; +L43b334: +if ((int)v1 >= 0) {v0 = (int)v1 >> 3; +goto L43b344;} +v0 = (int)v1 >> 3; +at = v1 + 0x7; +v0 = (int)at >> 3; +L43b344: +//nop; +return v0; +//nop; +} + +static void f_map_pdefs_to_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43b34c: +//map_pdefs_to_regs: +//nop; +//nop; +//nop; +v0 = 0x10019314; +v1 = 0x1; +v0 = MEM_U32(v0 + 0); +t0 = 0xffffffff; +if (v0 == 0) {a3 = 0x65; +goto L43b3e4;} +a3 = 0x65; +v0 = v0 + 0x1; +L43b374: +if (a0 == 0) {at = 0xc0000; +goto L43b494;} +at = 0xc0000; +t6 = MEM_U8(a0 + 32); +a2 = v1 << 1; +if (a3 == t6) {//nop; +goto L43b390;} +//nop; +abort(); +L43b390: +t7 = MEM_U8(a0 + 33); +at = at | 0x8000; +t8 = t7 & 0x1f; +t9 = t8 < 0x20; +t1 = -t9; +t2 = t1 & at; +t3 = t2 << (t8 & 0x1f); +if ((int)t3 >= 0) {v1 = v1 + 0x1; +goto L43b3e4;} +v1 = v1 + 0x1; +if (a1 == t0) {a2 = a2 + 0xfffffffe; +goto L43b3cc;} +a2 = a2 + 0xfffffffe; +t4 = a2 << 2; +at = (int)a1 < (int)t4; +if (at != 0) {//nop; +goto L43b3e4;} +//nop; +L43b3cc: +t5 = a2 << 2; +t6 = t5 + 0xb0; +MEM_U32(a0 + 48) = t6; +a0 = MEM_U32(a0 + 8); +if (v1 != v0) {a2 = a2 + 0x2; +goto L43b374;} +a2 = a2 + 0x2; +L43b3e4: +a3 = 0x65; +if (a0 == 0) {t0 = 0xffffffff; +goto L43b494;} +t0 = 0xffffffff; +v1 = 0x100193a0; +a1 = 0x10018ed0; +a2 = 0x10019310; +v1 = MEM_U32(v1 + 0); +a1 = MEM_U8(a1 + 0); +a2 = MEM_U32(a2 + 0); +//nop; +L43b40c: +t7 = MEM_U8(a0 + 32); +//nop; +if (a3 == t7) {//nop; +goto L43b420;} +//nop; +abort(); +L43b420: +t9 = MEM_U32(a0 + 44); +//nop; +v0 = t9 - v1; +if ((int)v0 >= 0) {//nop; +goto L43b438;} +//nop; +v0 = -v0; +L43b438: +if (a1 != 0) {//nop; +goto L43b464;} +//nop; +t1 = a2 << 2; +at = (int)v0 < (int)t1; +if (at == 0) {//nop; +goto L43b45c;} +//nop; +t2 = v0 + 0x10; +MEM_U32(a0 + 48) = t2; +goto L43b484; +MEM_U32(a0 + 48) = t2; +L43b45c: +MEM_U32(a0 + 48) = t0; +goto L43b484; +MEM_U32(a0 + 48) = t0; +L43b464: +t8 = a2 << 3; +at = (int)v0 < (int)t8; +if (at == 0) {//nop; +goto L43b480;} +//nop; +t3 = v0 + 0x20; +MEM_U32(a0 + 48) = t3; +goto L43b484; +MEM_U32(a0 + 48) = t3; +L43b480: +MEM_U32(a0 + 48) = t0; +L43b484: +a0 = MEM_U32(a0 + 8); +//nop; +if (a0 != 0) {//nop; +goto L43b40c;} +//nop; +L43b494: +//nop; +return; +//nop; +} + +static void f_map_pars_to_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43b49c: +//map_pars_to_regs: +//nop; +//nop; +//nop; +t6 = MEM_U8(a0 + 32); +t7 = 0x5c; +sp = sp + 0xfffffff8; +MEM_U32(sp + 4) = s0; +s0 = a1; +if (t6 == t7) {//nop; +goto L43b4c8;} +//nop; +abort(); +L43b4c8: +v1 = 0x10019d90; +MEM_U32(a0 + 36) = zero; +v0 = a0; +t0 = 0xffffffff; +a3 = v1 + 0x10; +L43b4dc: +v1 = v1 + 0x4; +if (v1 != a3) {MEM_U32(v1 + -4) = t0; +goto L43b4dc;} +MEM_U32(v1 + -4) = t0; +a1 = 0x10019314; +a0 = MEM_U32(a0 + 8); +a1 = MEM_U32(a1 + 0); +a2 = 0x1; +if (a1 == 0) {t2 = 0x66; +goto L43b628;} +t2 = 0x66; +t4 = 0x10019d90; +t3 = 0x100193a0; +a1 = a1 + 0x1; +t1 = 0x64; +L43b510: +v1 = MEM_U8(a0 + 32); +//nop; +t9 = v1 < 0xa0; +if (t9 == 0) {t5 = (int)v1 >> 5; +goto L43b544;} +t5 = (int)v1 >> 5; +t7 = 0x10005458; +t6 = t5 << 2; +t7 = t7; +t8 = t7 + t6; +t5 = MEM_U32(t8 + 0); +//nop; +t7 = t5 << (v1 & 0x1f); +t9 = (int)t7 < (int)0x0; +L43b544: +if (t9 != 0) {at = 0x17; +goto L43b7e8;} +at = 0x17; +if (t1 == v1) {at = 0xc0000; +goto L43b5ac;} +at = 0xc0000; +if (t2 == v1) {t8 = v1 < 0xa0; +goto L43b5ac;} +t8 = v1 < 0xa0; +L43b55c: +if (t8 == 0) {t5 = (int)v1 >> 5; +goto L43b584;} +t5 = (int)v1 >> 5; +t6 = 0x10005458; +t7 = t5 << 2; +t6 = t6; +t9 = t6 + t7; +t5 = MEM_U32(t9 + 0); +//nop; +t6 = t5 << (v1 & 0x1f); +t8 = (int)t6 < (int)0x0; +L43b584: +if (t8 != 0) {//nop; +goto L43b7e4;} +//nop; +a0 = MEM_U32(a0 + 8); +//nop; +v1 = MEM_U8(a0 + 32); +//nop; +if (t1 == v1) {//nop; +goto L43b5ac;} +//nop; +if (t2 != v1) {t8 = v1 < 0xa0; +goto L43b55c;} +t8 = v1 < 0xa0; +L43b5ac: +t9 = MEM_U8(a0 + 33); +at = at | 0x8000; +t5 = t9 & 0x1f; +t6 = t5 < 0x20; +t7 = -t6; +t8 = t7 & at; +t9 = t8 << (t5 & 0x1f); +if ((int)t9 >= 0) {at = (int)a2 < (int)s0; +goto L43b628;} +at = (int)a2 < (int)s0; +if (s0 == t0) {t8 = a2 << 3; +goto L43b5e0;} +t8 = a2 << 3; +if (at == 0) {//nop; +goto L43b628;} +//nop; +L43b5e0: +t6 = MEM_U32(a0 + 44); +t7 = MEM_U32(t3 + 0); +v1 = t8 + 0xa8; +a3 = t6 - t7; +if ((int)a3 >= 0) {a2 = a2 + 0x1; +goto L43b5fc;} +a2 = a2 + 0x1; +a3 = -a3; +L43b5fc: +MEM_U32(a0 + 48) = v1; +if ((int)a3 >= 0) {t5 = (int)a3 >> 2; +goto L43b610;} +t5 = (int)a3 >> 2; +at = a3 + 0x3; +t5 = (int)at >> 2; +L43b610: +t9 = t5 << 2; +t6 = t4 + t9; +MEM_U32(t6 + 0) = v1; +a0 = MEM_U32(a0 + 8); +if (a2 != a1) {//nop; +goto L43b510;} +//nop; +L43b628: +v1 = MEM_U8(a0 + 32); +t3 = 0x100193a0; +t4 = 0x10019d90; +t7 = v1 < 0xa0; +t1 = 0x64; +if (t7 == 0) {t2 = 0x66; +goto L43b668;} +t2 = 0x66; +t9 = 0x10005458; +t8 = (int)v1 >> 5; +t5 = t8 << 2; +t9 = t9; +t6 = t9 + t5; +t8 = MEM_U32(t6 + 0); +//nop; +t9 = t8 << (v1 & 0x1f); +t7 = (int)t9 < (int)0x0; +L43b668: +if (t7 != 0) {at = 0x17; +goto L43b7e8;} +at = 0x17; +a2 = 0x10019310; +a1 = 0x10018ed0; +//nop; +L43b67c: +if (t1 == v1) {//nop; +goto L43b6e0;} +//nop; +if (t2 == v1) {t6 = v1 < 0xa0; +goto L43b6e0;} +t6 = v1 < 0xa0; +L43b68c: +if (t6 == 0) {t8 = (int)v1 >> 5; +goto L43b6b8;} +t8 = (int)v1 >> 5; +t5 = 0x10005458; +t9 = t8 << 2; +t5 = t5; +t7 = t5 + t9; +t8 = MEM_U32(t7 + 0); +//nop; +t5 = t8 << (v1 & 0x1f); +t9 = (int)t5 < (int)0x0; +t6 = t9; +L43b6b8: +if (t6 != 0) {at = 0x17; +goto L43b7e8;} +at = 0x17; +a0 = MEM_U32(a0 + 8); +//nop; +v1 = MEM_U8(a0 + 32); +//nop; +if (t1 == v1) {//nop; +goto L43b6e0;} +//nop; +if (t2 != v1) {t6 = v1 < 0xa0; +goto L43b68c;} +t6 = v1 < 0xa0; +L43b6e0: +t7 = MEM_U32(a0 + 44); +t8 = MEM_U32(t3 + 0); +//nop; +a3 = t7 - t8; +if ((int)a3 >= 0) {//nop; +goto L43b6fc;} +//nop; +a3 = -a3; +L43b6fc: +t5 = MEM_U8(a1 + 0); +//nop; +if (t5 != 0) {//nop; +goto L43b758;} +//nop; +if (t2 == v1) {//nop; +goto L43b7a0;} +//nop; +t9 = MEM_U32(a2 + 0); +v1 = a3 + 0x10; +t6 = t9 << 2; +at = (int)a3 < (int)t6; +if (at == 0) {//nop; +goto L43b750;} +//nop; +MEM_U32(a0 + 48) = v1; +if ((int)a3 >= 0) {t7 = (int)a3 >> 2; +goto L43b740;} +t7 = (int)a3 >> 2; +at = a3 + 0x3; +t7 = (int)at >> 2; +L43b740: +t8 = t7 << 2; +t5 = t4 + t8; +MEM_U32(t5 + 0) = v1; +goto L43b7a0; +MEM_U32(t5 + 0) = v1; +L43b750: +MEM_U32(a0 + 48) = t0; +goto L43b7a0; +MEM_U32(a0 + 48) = t0; +L43b758: +if (t2 == v1) {//nop; +goto L43b7a0;} +//nop; +t9 = MEM_U32(a2 + 0); +v1 = a3 + 0x20; +t6 = t9 << 3; +at = (int)a3 < (int)t6; +if (at == 0) {//nop; +goto L43b79c;} +//nop; +MEM_U32(a0 + 48) = v1; +if ((int)a3 >= 0) {t7 = (int)a3 >> 3; +goto L43b78c;} +t7 = (int)a3 >> 3; +at = a3 + 0x7; +t7 = (int)at >> 3; +L43b78c: +t8 = t7 << 2; +t5 = t4 + t8; +MEM_U32(t5 + 0) = v1; +goto L43b7a0; +MEM_U32(t5 + 0) = v1; +L43b79c: +MEM_U32(a0 + 48) = t0; +L43b7a0: +a0 = MEM_U32(a0 + 8); +//nop; +v1 = MEM_U8(a0 + 32); +//nop; +t9 = v1 < 0xa0; +if (t9 == 0) {t6 = (int)v1 >> 5; +goto L43b7dc;} +t6 = (int)v1 >> 5; +t8 = 0x10005458; +t7 = t6 << 2; +t8 = t8; +t5 = t8 + t7; +t6 = MEM_U32(t5 + 0); +//nop; +t8 = t6 << (v1 & 0x1f); +t9 = (int)t8 < (int)0x0; +L43b7dc: +if (t9 == 0) {//nop; +goto L43b67c;} +//nop; +L43b7e4: +at = 0x17; +L43b7e8: +if (v1 != at) {s0 = MEM_U32(sp + 4); +goto L43b80c;} +s0 = MEM_U32(sp + 4); +t5 = MEM_U32(a0 + 44); +t8 = 0x1; +t6 = t5 & 0x8; +if (t6 == 0) {s0 = MEM_U32(sp + 4); +goto L43b80c;} +s0 = MEM_U32(sp + 4); +MEM_U32(v0 + 36) = t8; +s0 = MEM_U32(sp + 4); +L43b80c: +sp = sp + 0x8; +return; +sp = sp + 0x8; +} + +static uint32_t f_check_amt(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43b814: +//check_amt: +//nop; +//nop; +//nop; +v1 = MEM_U32(a0 + 44); +//nop; +if ((int)v1 >= 0) {//nop; +goto L43b834;} +//nop; +abort(); +L43b834: +t6 = 0x10018ed0; +//nop; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L43b8bc;} +//nop; +t7 = 0x10019310; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +t8 = t7 << 2; +at = (int)v1 < (int)t8; +if (at == 0) {//nop; +goto L43b88c;} +//nop; +t9 = 0x10019314; +//nop; +t9 = MEM_U32(t9 + 0); +//nop; +t1 = t9 << 3; +at = (int)v1 < (int)t1; +if (at != 0) {//nop; +goto L43b894;} +//nop; +L43b88c: +v0 = 0xffffffff; +return v0; +v0 = 0xffffffff; +L43b894: +t4 = 0x10019d90; +if ((int)v1 >= 0) {t2 = (int)v1 >> 2; +goto L43b8a8;} +t2 = (int)v1 >> 2; +at = v1 + 0x3; +t2 = (int)at >> 2; +L43b8a8: +t3 = t2 << 2; +t5 = t3 + t4; +v0 = MEM_U32(t5 + 0); +//nop; +return v0; +//nop; +L43b8bc: +t6 = 0x10019310; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +t7 = t6 << 3; +at = (int)v1 < (int)t7; +if (at == 0) {//nop; +goto L43b900;} +//nop; +t8 = 0x10019314; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +t9 = t8 << 1; +t0 = t9 << 2; +at = (int)v1 < (int)t0; +if (at != 0) {//nop; +goto L43b908;} +//nop; +L43b900: +v0 = 0xffffffff; +return v0; +v0 = 0xffffffff; +L43b908: +t3 = 0x10019d90; +if ((int)v1 >= 0) {t1 = (int)v1 >> 3; +goto L43b91c;} +t1 = (int)v1 >> 3; +at = v1 + 0x7; +t1 = (int)at >> 3; +L43b91c: +t2 = t1 << 2; +t4 = t2 + t3; +v0 = MEM_U32(t4 + 0); +//nop; +//nop; +return v0; +//nop; +} + +static void f_check_amt_ref(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43b934: +//check_amt_ref: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +v1 = 0x10018ed0; +MEM_U32(sp + 40) = s4; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 44) = s5; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s3 = 0x10019310; +s4 = 0x10019314; +v1 = MEM_U8(v1 + 0); +s0 = a0; +s1 = 0x52; +s2 = 0x5; +s5 = 0xb; +MEM_U32(sp + 52) = ra; +MEM_U32(sp + 48) = gp; +L43b984: +if (v1 != 0) {//nop; +goto L43ba1c;} +//nop; +v1 = MEM_U8(s0 + 32); +//nop; +if (s1 != v1) {//nop; +goto L43baac;} +//nop; +t6 = MEM_U8(s0 + 33); +//nop; +t7 = t6 << 24; +t8 = t7 >> 29; +if (s2 != t8) {//nop; +goto L43baac;} +//nop; +t9 = MEM_U32(s3 + 0); +v0 = MEM_U32(s0 + 44); +t0 = t9 << 2; +at = (int)v0 < (int)t0; +if (at != 0) {//nop; +goto L43b9e4;} +//nop; +t2 = MEM_U32(s4 + 0); +//nop; +t3 = t2 << 3; +at = (int)v0 < (int)t3; +if (at == 0) {//nop; +goto L43baac;} +//nop; +L43b9e4: +t6 = 0x10019d90; +if ((int)v0 >= 0) {v1 = (int)v0 >> 2; +goto L43b9f8;} +v1 = (int)v0 >> 2; +at = v0 + 0x3; +v1 = (int)at >> 2; +L43b9f8: +t9 = 0x10019da0; +t5 = v1 << 2; +t4 = 0xffffffff; +t7 = t5 + t6; +MEM_U32(t7 + 0) = t4; +t8 = 0x1; +t0 = v1 + t9; +MEM_U8(t0 + 0) = (uint8_t)t8; +goto L43bb00; +MEM_U8(t0 + 0) = (uint8_t)t8; +L43ba1c: +v1 = MEM_U8(s0 + 32); +//nop; +if (s1 != v1) {//nop; +goto L43baac;} +//nop; +t1 = MEM_U8(s0 + 33); +//nop; +t2 = t1 << 24; +t3 = t2 >> 29; +if (s2 != t3) {//nop; +goto L43baac;} +//nop; +t5 = MEM_U32(s3 + 0); +v0 = MEM_U32(s0 + 44); +t6 = t5 << 3; +at = (int)v0 < (int)t6; +if (at != 0) {//nop; +goto L43ba74;} +//nop; +t7 = MEM_U32(s4 + 0); +//nop; +t9 = t7 << 4; +at = (int)v0 < (int)t9; +if (at == 0) {//nop; +goto L43baac;} +//nop; +L43ba74: +t1 = 0x10019d90; +if ((int)v0 >= 0) {v1 = (int)v0 >> 3; +goto L43ba88;} +v1 = (int)v0 >> 3; +at = v0 + 0x7; +v1 = (int)at >> 3; +L43ba88: +t5 = 0x10019da0; +t0 = v1 << 2; +t8 = 0xffffffff; +t2 = t0 + t1; +MEM_U32(t2 + 0) = t8; +t3 = 0x1; +t6 = v1 + t5; +MEM_U8(t6 + 0) = (uint8_t)t3; +goto L43bb00; +MEM_U8(t6 + 0) = (uint8_t)t3; +L43baac: +a0 = MEM_U32(s0 + 0); +//nop; +if (a0 == 0) {//nop; +goto L43badc;} +//nop; +if (s5 == v1) {//nop; +goto L43badc;} +//nop; +//nop; +//nop; +//nop; +f_check_amt_ref(mem, sp, a0); +goto L43bad4; +//nop; +L43bad4: +gp = MEM_U32(sp + 48); +//nop; +L43badc: +v0 = MEM_U32(s0 + 4); +//nop; +if (v0 == 0) {ra = MEM_U32(sp + 52); +goto L43bb04;} +ra = MEM_U32(sp + 52); +v1 = 0x10018ed0; +s0 = v0; +v1 = MEM_U8(v1 + 0); +//nop; +goto L43b984; +//nop; +L43bb00: +ra = MEM_U32(sp + 52); +L43bb04: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +s4 = MEM_U32(sp + 40); +s5 = MEM_U32(sp + 44); +sp = sp + 0x38; +return; +sp = sp + 0x38; +} + +static void f_fix_amt_ref(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43bb24: +//fix_amt_ref: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 48) = s6; +s6 = 0x4; +MEM_U32(sp + 52) = s7; +MEM_U32(sp + 32) = s2; +v1 = s6 & 0x3; +s7 = a0; +MEM_U32(sp + 60) = ra; +MEM_U32(sp + 56) = gp; +MEM_U32(sp + 44) = s5; +MEM_U32(sp + 40) = s4; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +if (v1 == 0) {s2 = zero; +goto L43bb94;} +s2 = zero; +t6 = 0x10019da0; +v0 = v1; +s0 = zero + t6; +L43bb7c: +s2 = s2 + 0x1; +MEM_U8(s0 + 0) = (uint8_t)zero; +if (v0 != s2) {s0 = s0 + 0x1; +goto L43bb7c;} +s0 = s0 + 0x1; +if (s2 == s6) {//nop; +goto L43bbbc;} +//nop; +L43bb94: +t7 = 0x10019da0; +//nop; +s0 = s2 + t7; +v0 = s6 + t7; +L43bba4: +s0 = s0 + 0x4; +MEM_U8(s0 + -4) = (uint8_t)zero; +MEM_U8(s0 + -3) = (uint8_t)zero; +MEM_U8(s0 + -2) = (uint8_t)zero; +if (s0 != v0) {MEM_U8(s0 + -1) = (uint8_t)zero; +goto L43bba4;} +MEM_U8(s0 + -1) = (uint8_t)zero; +L43bbbc: +s0 = MEM_U32(s7 + 8); +s1 = 0x64; +v0 = MEM_U8(s0 + 32); +//nop; +t8 = v0 < 0xa0; +if (t8 == 0) {//nop; +goto L43bbfc;} +//nop; +t1 = 0x1000546c; +t9 = (int)v0 >> 5; +t0 = t9 << 2; +t1 = t1; +t2 = t1 + t0; +t3 = MEM_U32(t2 + 0); +//nop; +t4 = t3 << (v0 & 0x1f); +t8 = (int)t4 < (int)0x0; +L43bbfc: +if (t8 != 0) {//nop; +goto L43bc68;} +//nop; +L43bc04: +if (s1 != v0) {//nop; +goto L43bc24;} +//nop; +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +f_check_amt_ref(mem, sp, a0); +goto L43bc1c; +//nop; +L43bc1c: +gp = MEM_U32(sp + 56); +//nop; +L43bc24: +s0 = MEM_U32(s0 + 8); +//nop; +v0 = MEM_U8(s0 + 32); +//nop; +t6 = v0 < 0xa0; +if (t6 == 0) {t7 = (int)v0 >> 5; +goto L43bc60;} +t7 = (int)v0 >> 5; +t1 = 0x1000546c; +t9 = t7 << 2; +t1 = t1; +t0 = t1 + t9; +t2 = MEM_U32(t0 + 0); +//nop; +t3 = t2 << (v0 & 0x1f); +t6 = (int)t3 < (int)0x0; +L43bc60: +if (t6 == 0) {//nop; +goto L43bc04;} +//nop; +L43bc68: +s0 = 0x10019da0; +s5 = 0x1001934c; +s3 = 0x10019348; +s2 = zero; +s6 = 0x4; +s4 = 0xffffff1f; +L43bc80: +t5 = MEM_U8(s0 + 0); +//nop; +if (t5 == 0) {//nop; +goto L43bd5c;} +//nop; +//nop; +a0 = 0x52; +//nop; +v0 = f_build_op(mem, sp, a0); +goto L43bca0; +//nop; +L43bca0: +s1 = MEM_U8(v0 + 33); +t8 = MEM_U8(s3 + 0); +t7 = s1 << 27; +t1 = t7 >> 27; +t9 = t8 ^ t1; +t0 = t9 & 0x1f; +t3 = t0 ^ s1; +gp = MEM_U32(sp + 56); +t4 = t3 & s4; +MEM_U8(v0 + 33) = (uint8_t)t3; +t6 = t4 | 0x60; +MEM_U8(v0 + 33) = (uint8_t)t6; +v1 = MEM_U32(s5 + 0); +t5 = s2 + 0x4; +lo = t5 * v1; +hi = (uint32_t)((uint64_t)t5 * (uint64_t)v1 >> 32); +MEM_U16(v0 + 34) = (uint16_t)zero; +MEM_U32(v0 + 40) = v1; +a0 = 0x7b; +a1 = v0; +t7 = lo; +MEM_U32(v0 + 44) = t7; +//nop; +//nop; +//nop; +v0 = f_build_1op(mem, sp, a0, a1); +goto L43bd04; +//nop; +L43bd04: +s1 = MEM_U8(v0 + 33); +t8 = MEM_U8(s3 + 0); +t1 = s1 << 27; +t9 = t1 >> 27; +t0 = t8 ^ t9; +t2 = t0 & 0x1f; +t4 = t2 ^ s1; +gp = MEM_U32(sp + 56); +t6 = t4 & s4; +MEM_U8(v0 + 33) = (uint8_t)t4; +t5 = t6 | 0xa0; +MEM_U8(v0 + 33) = (uint8_t)t5; +v1 = MEM_U32(s5 + 0); +MEM_U16(v0 + 34) = (uint16_t)zero; +lo = s2 * v1; +hi = (uint32_t)((uint64_t)s2 * (uint64_t)v1 >> 32); +MEM_U32(v0 + 40) = v1; +t7 = lo; +MEM_U32(v0 + 44) = t7; +t1 = MEM_U32(s7 + 8); +//nop; +MEM_U32(v0 + 8) = t1; +MEM_U32(s7 + 8) = v0; +L43bd5c: +s2 = s2 + 0x1; +if (s2 != s6) {s0 = s0 + 0x1; +goto L43bc80;} +s0 = s0 + 0x1; +ra = MEM_U32(sp + 60); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +s4 = MEM_U32(sp + 40); +s5 = MEM_U32(sp + 44); +s6 = MEM_U32(sp + 48); +s7 = MEM_U32(sp + 52); +sp = sp + 0x40; +return; +sp = sp + 0x40; +//nop; +} + +static uint32_t f_find_non_special_reg(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43be58: +//find_non_special_reg: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 192) = a0; +a0 = MEM_U32(sp + 484); +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 196) = a1; +MEM_U32(sp + 200) = a2; +MEM_U32(sp + 204) = a3; +v1 = MEM_U8(a0 + 0); +v0 = MEM_U8(a0 + 1); +a2 = 0xc; +if (v1 == v0) {t4 = sp; +goto L43bedc;} +t4 = sp; +a1 = 0x10019830; +a0 = sp + 0xc0; +t6 = v1 << 2; +L43bea4: +t7 = a0 + t6; +t8 = MEM_U32(t7 + 0); +//nop; +if (t8 != 0) {//nop; +goto L43bec0;} +//nop; +v0 = v1; +goto L43bfe8; +v0 = v1; +L43bec0: +lo = v1 * a2; +hi = (uint32_t)((uint64_t)v1 * (uint64_t)a2 >> 32); +t9 = lo; +t0 = a1 + t9; +v1 = MEM_U8(t0 + 6); +//nop; +if (v1 != v0) {t6 = v1 << 2; +goto L43bea4;} +t6 = v1 << 2; +L43bedc: +t1 = 0x1000a370; +a0 = 0x4; +t1 = t1; +t3 = t1 + 0x48; +a1 = 0x118; +L43bef0: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t4 = t4 + 0xc; +MEM_U8(t4 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t4) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t4 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 4 + 3) = (uint8_t)(at >> 0); +if (t1 != t3) {//swr $at, 7($t4) +goto L43bef0;} +//swr $at, 7($t4) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t5 = 0x1000a320; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +t5 = t5; +MEM_U8(t4 + 12 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 12 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 12 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 12 + 3) = (uint8_t)(t3 >> 0); +t7 = t5 + 0x48; +t8 = sp; +//swr $t3, 0xf($t4) +L43bf60: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t8 = t8 + 0xc; +MEM_U8(t8 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t8) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t8 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 84 + 3) = (uint8_t)(at >> 0); +if (t5 != t7) {//swr $at, 0x57($t8) +goto L43bf60;} +//swr $at, 0x57($t8) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +//nop; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +t7 = t5 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t5) +//nop; +MEM_U8(t8 + 92 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t8 + 92 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t8 + 92 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t8 + 92 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x5f($t8) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43bfdc; +//nop; +L43bfdc: +gp = MEM_U32(sp + 176); +v0 = MEM_U8(sp + 191); +//nop; +L43bfe8: +ra = MEM_U32(sp + 180); +sp = sp + 0xc0; +//nop; +return v0; +//nop; +} + +static uint32_t f_kind_of_register(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43c01c: +//kind_of_register: +//nop; +//nop; +//nop; +t6 = a0 << 2; +t7 = 0x10019830; +t6 = t6 - a0; +t6 = t6 << 2; +MEM_U32(sp + 0) = a0; +t8 = t6 + t7; +v0 = MEM_U8(t8 + 8); +//nop; +return v0; +//nop; +} + +static void f_init_regs(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43c04c: +//init_regs: +//nop; +//nop; +//nop; +at = 0x10019830; +t6 = 0x48; +MEM_U32(at + 0) = zero; +at = 0x10019830; +sp = sp + 0xffffffa8; +MEM_U16(at + 4) = (uint16_t)zero; +at = 0x10019830; +v0 = 0x10019830; +MEM_U8(at + 6) = (uint8_t)t6; +at = 0x10019830; +v1 = 0x10019830; +MEM_U8(at + 7) = (uint8_t)zero; +at = 0x10019830; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s3 = 0x48; +v0 = v0 + 0xc; +v1 = v1 + 0x36c; +MEM_U8(at + 8) = (uint8_t)zero; +L43c0b4: +v0 = v0 + 0x30; +MEM_U32(v0 + -48) = zero; +MEM_U16(v0 + -44) = (uint16_t)zero; +MEM_U8(v0 + -42) = (uint8_t)s3; +MEM_U8(v0 + -41) = (uint8_t)zero; +MEM_U8(v0 + -40) = (uint8_t)zero; +MEM_U32(v0 + -36) = zero; +MEM_U16(v0 + -32) = (uint16_t)zero; +MEM_U8(v0 + -30) = (uint8_t)s3; +MEM_U8(v0 + -29) = (uint8_t)zero; +MEM_U8(v0 + -28) = (uint8_t)zero; +MEM_U32(v0 + -24) = zero; +MEM_U16(v0 + -20) = (uint16_t)zero; +MEM_U8(v0 + -18) = (uint8_t)s3; +MEM_U8(v0 + -17) = (uint8_t)zero; +MEM_U8(v0 + -16) = (uint8_t)zero; +MEM_U32(v0 + -12) = zero; +MEM_U16(v0 + -8) = (uint16_t)zero; +MEM_U8(v0 + -6) = (uint8_t)s3; +MEM_U8(v0 + -5) = (uint8_t)zero; +if (v0 != v1) {MEM_U8(v0 + -4) = (uint8_t)zero; +goto L43c0b4;} +MEM_U8(v0 + -4) = (uint8_t)zero; +v0 = 0x10019da4; +s2 = 0x10019328; +MEM_U8(v0 + 0) = (uint8_t)s3; +MEM_U8(v0 + 1) = (uint8_t)s3; +s2 = MEM_U32(s2 + 0); +//nop; +if (s2 == 0) {//nop; +goto L43c160;} +//nop; +s0 = 0x100054d4; +s2 = s2 + 0x1; +t7 = s0 + 0xffffffff; +v0 = s2 + t7; +L43c13c: +//nop; +a0 = MEM_U8(s0 + 0); +MEM_U32(sp + 52) = v0; +f_add_to_free_list(mem, sp, a0); +goto L43c14c; +MEM_U32(sp + 52) = v0; +L43c14c: +v0 = MEM_U32(sp + 52); +gp = MEM_U32(sp + 40); +s0 = s0 + 0x1; +if (s0 != v0) {//nop; +goto L43c13c;} +//nop; +L43c160: +s1 = 0x10019320; +s0 = 0x8; +s1 = MEM_U32(s1 + 0); +//nop; +s1 = s1 + 0x7; +at = s1 < 0x8; +if (at != 0) {s1 = s1 + 0x1; +goto L43c1a0;} +s1 = s1 + 0x1; +L43c180: +//nop; +a0 = s0; +//nop; +f_add_to_free_list(mem, sp, a0); +goto L43c190; +//nop; +L43c190: +gp = MEM_U32(sp + 40); +s0 = s0 + 0x1; +if (s0 != s1) {//nop; +goto L43c180;} +//nop; +L43c1a0: +v0 = 0x10019dac; +s2 = 0x1001932c; +MEM_U8(v0 + 0) = (uint8_t)s3; +MEM_U8(v0 + 1) = (uint8_t)s3; +s2 = MEM_U32(s2 + 0); +s0 = 0x24; +if (s2 == 0) {s1 = 0x1; +goto L43c1ec;} +s1 = 0x1; +s2 = s2 + 0x1; +L43c1c4: +//nop; +a0 = s0; +a1 = zero; +f_add_to_fp_free_list(mem, sp, a0, a1); +goto L43c1d4; +a1 = zero; +L43c1d4: +s0 = s0 + 0x2; +gp = MEM_U32(sp + 40); +t8 = s0 & 0xff; +s1 = s1 + 0x1; +if (s1 != s2) {s0 = t8; +goto L43c1c4;} +s0 = t8; +L43c1ec: +s2 = 0x10019324; +s0 = 0x30; +s2 = MEM_U32(s2 + 0); +s1 = 0x1; +if (s2 == 0) {s2 = s2 + 0x1; +goto L43c22c;} +s2 = s2 + 0x1; +L43c204: +//nop; +a0 = s0; +a1 = zero; +f_add_to_fp_free_list(mem, sp, a0, a1); +goto L43c214; +a1 = zero; +L43c214: +s0 = s0 + 0x2; +gp = MEM_U32(sp + 40); +t9 = s0 & 0xff; +s1 = s1 + 0x1; +if (s1 != s2) {s0 = t9; +goto L43c204;} +s0 = t9; +L43c22c: +t0 = 0x10019344; +s0 = 0x21; +t0 = MEM_U8(t0 + 0); +s1 = 0x1; +if (t0 == 0) {s2 = 0x11; +goto L43c26c;} +s2 = 0x11; +L43c244: +//nop; +a0 = s0; +a1 = zero; +f_add_to_fp_free_list(mem, sp, a0, a1); +goto L43c254; +a1 = zero; +L43c254: +s0 = s0 + 0x2; +gp = MEM_U32(sp + 40); +t1 = s0 & 0xff; +s1 = s1 + 0x1; +if (s1 != s2) {s0 = t1; +goto L43c244;} +s0 = t1; +L43c26c: +s1 = 0x10019310; +//nop; +s1 = MEM_U32(s1 + 0); +//nop; +s1 = s1 + 0x3; +at = s1 < 0x4; +if (at != 0) {s1 = s1 + 0x1; +goto L43c31c;} +s1 = s1 + 0x1; +a0 = s1 + 0xfffffffc; +t2 = a0 & 0x3; +if (t2 == 0) {s0 = 0x4; +goto L43c2d0;} +s0 = 0x4; +t3 = s0 << 2; +t4 = 0x10019830; +t3 = t3 - s0; +t3 = t3 << 2; +v1 = t2 + 0x4; +v0 = t3 + t4; +L43c2b4: +s0 = s0 + 0x1; +MEM_U8(v0 + 7) = (uint8_t)zero; +MEM_U16(v0 + 4) = (uint16_t)zero; +if (v1 != s0) {v0 = v0 + 0xc; +goto L43c2b4;} +v0 = v0 + 0xc; +if (s0 == s1) {//nop; +goto L43c31c;} +//nop; +L43c2d0: +t6 = 0x10019830; +t5 = s0 << 2; +t7 = s1 << 2; +t7 = t7 - s1; +t5 = t5 - s0; +t5 = t5 << 2; +t7 = t7 << 2; +v1 = t7 + t6; +v0 = t5 + t6; +L43c2f4: +v0 = v0 + 0x30; +MEM_U8(v0 + -41) = (uint8_t)zero; +MEM_U16(v0 + -44) = (uint16_t)zero; +MEM_U8(v0 + -29) = (uint8_t)zero; +MEM_U16(v0 + -32) = (uint16_t)zero; +MEM_U8(v0 + -17) = (uint8_t)zero; +MEM_U16(v0 + -20) = (uint16_t)zero; +MEM_U8(v0 + -5) = (uint8_t)zero; +if (v0 != v1) {MEM_U16(v0 + -8) = (uint16_t)zero; +goto L43c2f4;} +MEM_U16(v0 + -8) = (uint16_t)zero; +L43c31c: +v1 = 0x10019314; +s0 = 0x2c; +v1 = MEM_U32(v1 + 0); +//nop; +t8 = v1 << 1; +v1 = t8 + 0x2a; +at = v1 < 0x2c; +if (at != 0) {//nop; +goto L43c36c;} +//nop; +v0 = 0x10019830; +//nop; +v0 = v0 + 0x210; +L43c34c: +s0 = s0 + 0x2; +t9 = s0 & 0xff; +at = v1 < t9; +MEM_U8(v0 + 7) = (uint8_t)zero; +MEM_U16(v0 + 4) = (uint16_t)zero; +s0 = t9; +if (at == 0) {v0 = v0 + 0x18; +goto L43c34c;} +v0 = v0 + 0x18; +L43c36c: +s1 = 0x10019318; +//nop; +s1 = MEM_U32(s1 + 0); +//nop; +s1 = s1 + 0xf; +at = s1 < 0x10; +if (at != 0) {s1 = s1 + 0x1; +goto L43c41c;} +s1 = s1 + 0x1; +a0 = s1 + 0xfffffff0; +t0 = a0 & 0x3; +if (t0 == 0) {s0 = 0x10; +goto L43c3d0;} +s0 = 0x10; +t1 = s0 << 2; +t2 = 0x10019830; +t1 = t1 - s0; +t1 = t1 << 2; +v1 = t0 + 0x10; +v0 = t1 + t2; +L43c3b4: +s0 = s0 + 0x1; +MEM_U8(v0 + 7) = (uint8_t)zero; +MEM_U16(v0 + 4) = (uint16_t)zero; +if (v1 != s0) {v0 = v0 + 0xc; +goto L43c3b4;} +v0 = v0 + 0xc; +if (s0 == s1) {//nop; +goto L43c41c;} +//nop; +L43c3d0: +t4 = 0x10019830; +t3 = s0 << 2; +t5 = s1 << 2; +t5 = t5 - s1; +t3 = t3 - s0; +t3 = t3 << 2; +t5 = t5 << 2; +v1 = t5 + t4; +v0 = t3 + t4; +L43c3f4: +v0 = v0 + 0x30; +MEM_U8(v0 + -41) = (uint8_t)zero; +MEM_U16(v0 + -44) = (uint16_t)zero; +MEM_U8(v0 + -29) = (uint8_t)zero; +MEM_U16(v0 + -32) = (uint16_t)zero; +MEM_U8(v0 + -17) = (uint8_t)zero; +MEM_U16(v0 + -20) = (uint16_t)zero; +MEM_U8(v0 + -5) = (uint8_t)zero; +if (v0 != v1) {MEM_U16(v0 + -8) = (uint16_t)zero; +goto L43c3f4;} +MEM_U16(v0 + -8) = (uint16_t)zero; +L43c41c: +v1 = 0x1001931c; +s0 = 0x34; +v1 = MEM_U32(v1 + 0); +//nop; +t7 = v1 << 1; +v1 = t7 + 0x32; +at = v1 < 0x34; +if (at != 0) {//nop; +goto L43c4b4;} +//nop; +s2 = 0x10019830; +s1 = 0x10019334; +//nop; +L43c44c: +t6 = MEM_U8(s1 + 0); +t9 = s0 << 2; +if (t6 == 0) {t9 = t9 - s0; +goto L43c490;} +t9 = t9 - s0; +//nop; +a0 = s0; +a1 = zero; +f_add_to_fp_free_list(mem, sp, a0, a1); +goto L43c46c; +a1 = zero; +L43c46c: +gp = MEM_U32(sp + 40); +//nop; +v1 = 0x1001931c; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +t8 = v1 << 1; +v1 = t8 + 0x32; +goto L43c4a0; +v1 = t8 + 0x32; +L43c490: +t9 = t9 << 2; +v0 = s2 + t9; +MEM_U8(v0 + 7) = (uint8_t)zero; +MEM_U16(v0 + 4) = (uint16_t)zero; +L43c4a0: +s0 = s0 + 0x2; +t0 = s0 & 0xff; +at = v1 < t0; +if (at == 0) {s0 = t0; +goto L43c44c;} +s0 = t0; +L43c4b4: +v0 = 0x10019da8; +v1 = 0x10019db0; +ra = MEM_U32(sp + 44); +MEM_U8(v0 + 0) = (uint8_t)s3; +MEM_U8(v0 + 1) = (uint8_t)s3; +MEM_U8(v1 + 0) = (uint8_t)s3; +MEM_U8(v1 + 1) = (uint8_t)s3; +s3 = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +sp = sp + 0x58; +return; +sp = sp + 0x58; +} + +static void f_fill_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L43c4e8: +//fill_reg: +//nop; +//nop; +//nop; +t6 = a0 << 2; +t7 = 0x10019830; +t6 = t6 - a0; +t6 = t6 << 2; +v0 = t6 + t7; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +MEM_U32(v0 + 0) = a1; +MEM_U16(v0 + 4) = (uint16_t)a2; +MEM_U8(v0 + 8) = (uint8_t)a3; +return; +MEM_U8(v0 + 8) = (uint8_t)a3; +} + +static void f_copy_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L43c524: +//copy_reg: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +//nop; +MEM_U32(sp + 28) = ra; +a1 = MEM_U8(sp + 43); +a2 = MEM_U8(sp + 39); +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +f_emit_rr(mem, sp, a0, a1, a2); +goto L43c558; +MEM_U32(sp + 32) = a0; +L43c558: +t6 = MEM_U8(sp + 43); +a1 = 0xc; +lo = t6 * a1; +hi = (uint32_t)((uint64_t)t6 * (uint64_t)a1 >> 32); +t8 = MEM_U8(sp + 39); +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +a0 = 0x10019830; +t7 = lo; +v0 = a0 + t7; +//nop; +lo = t8 * a1; +hi = (uint32_t)((uint64_t)t8 * (uint64_t)a1 >> 32); +t9 = lo; +v1 = a0 + t9; +t0 = MEM_U32(v1 + 0); +//nop; +MEM_U32(v0 + 0) = t0; +t1 = MEM_U16(v1 + 4); +//nop; +MEM_U16(v0 + 4) = (uint16_t)t1; +t2 = MEM_U8(v1 + 8); +sp = sp + 0x20; +MEM_U8(v0 + 8) = (uint8_t)t2; +return; +MEM_U8(v0 + 8) = (uint8_t)t2; +} + +static uint32_t f_list_is_empty(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43c5b4: +//list_is_empty: +v0 = MEM_U8(a0 + 0); +//nop; +t6 = v0 ^ 0x48; +v0 = t6 < 0x1; +return v0; +v0 = t6 < 0x1; +} + +static void f_print_regs(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43c768: +//print_regs: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb8; +MEM_U32(sp + 60) = s7; +MEM_U32(sp + 56) = s6; +s7 = 0x10006560; +MEM_U32(sp + 68) = ra; +MEM_U32(sp + 64) = gp; +MEM_U32(sp + 52) = s5; +MEM_U32(sp + 48) = s4; +MEM_U32(sp + 44) = s3; +MEM_U32(sp + 40) = s2; +MEM_U32(sp + 36) = s1; +MEM_U32(sp + 32) = s0; +a1 = 0x1000a3d9; +//nop; +s6 = a0; +s1 = MEM_U8(a0 + 0); +a0 = MEM_U32(s7 + 0); +a2 = 0xa; +a3 = 0xa; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L43c7c8; +a1 = a1; +L43c7c8: +gp = MEM_U32(sp + 64); +a0 = MEM_U32(s7 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L43c7e0; +//nop; +L43c7e0: +t6 = MEM_U8(s6 + 1); +gp = MEM_U32(sp + 64); +if (s1 == t6) {//nop; +goto L43c874;} +//nop; +s4 = 0x48; +if (s1 == s4) {//nop; +goto L43c874;} +//nop; +s5 = 0x10005648; +s2 = 0x10019830; +s3 = 0xc; +s5 = s5; +L43c80c: +s0 = MEM_U32(s7 + 0); +//nop; +t7 = 0xa; +MEM_U32(sp + 16) = t7; +a1 = s1; +a2 = s5; +a3 = zero; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L43c830; +a0 = s0; +L43c830: +gp = MEM_U32(sp + 64); +a0 = s0; +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L43c848; +//nop; +L43c848: +lo = s1 * s3; +hi = (uint32_t)((uint64_t)s1 * (uint64_t)s3 >> 32); +t0 = MEM_U8(s6 + 1); +gp = MEM_U32(sp + 64); +t8 = lo; +t9 = s2 + t8; +s1 = MEM_U8(t9 + 6); +//nop; +if (s1 == t0) {//nop; +goto L43c874;} +//nop; +if (s1 != s4) {//nop; +goto L43c80c;} +//nop; +L43c874: +s5 = 0x10005648; +s0 = MEM_U32(s7 + 0); +//nop; +t1 = 0xa; +s5 = s5; +a2 = s5; +MEM_U32(sp + 16) = t1; +a1 = s1; +a3 = zero; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L43c8a0; +a0 = s0; +L43c8a0: +gp = MEM_U32(sp + 64); +a0 = s0; +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L43c8b8; +//nop; +L43c8b8: +t2 = MEM_U8(s6 + 1); +gp = MEM_U32(sp + 64); +if (s1 == t2) {//nop; +goto L43c8cc;} +//nop; +abort(); +L43c8cc: +ra = MEM_U32(sp + 68); +s0 = MEM_U32(sp + 32); +s1 = MEM_U32(sp + 36); +s2 = MEM_U32(sp + 40); +s3 = MEM_U32(sp + 44); +s4 = MEM_U32(sp + 48); +s5 = MEM_U32(sp + 52); +s6 = MEM_U32(sp + 56); +s7 = MEM_U32(sp + 60); +sp = sp + 0x48; +return; +sp = sp + 0x48; +} + +static uint32_t f_remove_direg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43c8f8: +//remove_direg: +//nop; +//nop; +//nop; +v0 = MEM_U8(a0 + 0); +a2 = 0x48; +if (a2 != v0) {//nop; +goto L43c918;} +//nop; +abort(); +L43c918: +t6 = v0 & 0x1; +v1 = v0 & 0xff; +if (t6 == 0) {a1 = v0 & 0xff; +goto L43c954;} +a1 = v0 & 0xff; +a3 = 0x10019830; +t0 = 0xc; +L43c930: +lo = v1 * t0; +hi = (uint32_t)((uint64_t)v1 * (uint64_t)t0 >> 32); +a1 = v1 & 0xff; +t7 = lo; +t8 = a3 + t7; +v1 = MEM_U8(t8 + 6); +//nop; +t9 = v1 & 0x1; +if (t9 != 0) {//nop; +goto L43c930;} +//nop; +L43c954: +a3 = 0x10019830; +if (v1 != v0) {t0 = 0xc; +goto L43c978;} +t0 = 0xc; +lo = v1 * t0; +hi = (uint32_t)((uint64_t)v1 * (uint64_t)t0 >> 32); +t1 = lo; +t2 = a3 + t1; +t3 = MEM_U8(t2 + 6); +MEM_U8(a0 + 0) = (uint8_t)t3; +goto L43c998; +MEM_U8(a0 + 0) = (uint8_t)t3; +L43c978: +lo = v1 * t0; +hi = (uint32_t)((uint64_t)v1 * (uint64_t)t0 >> 32); +t4 = lo; +t5 = a3 + t4; +t6 = MEM_U8(t5 + 6); +lo = a1 * t0; +hi = (uint32_t)((uint64_t)a1 * (uint64_t)t0 >> 32); +t7 = lo; +t8 = a3 + t7; +MEM_U8(t8 + 6) = (uint8_t)t6; +L43c998: +t9 = MEM_U8(a0 + 1); +//nop; +if (v1 != t9) {//nop; +goto L43c9c4;} +//nop; +t1 = MEM_U8(a0 + 0); +v0 = v1; +if (a2 != t1) {//nop; +goto L43c9c0;} +//nop; +MEM_U8(a0 + 1) = (uint8_t)a2; +return v0; +MEM_U8(a0 + 1) = (uint8_t)a2; +L43c9c0: +MEM_U8(a0 + 1) = (uint8_t)a1; +L43c9c4: +v0 = v1; +return v0; +v0 = v1; +} + +static uint32_t f_get_head(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43c9cc: +//get_head: +MEM_U32(sp + 0) = a0; +a0 = MEM_U8(sp + 0); +t6 = 0x48; +if (a0 != t6) {//nop; +goto L43c9e4;} +//nop; +abort(); +L43c9e4: +v0 = a0; +return v0; +v0 = a0; +} + +static uint32_t f_remove_head(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43c9ec: +//remove_head: +//nop; +//nop; +//nop; +v0 = MEM_U8(a0 + 0); +a1 = 0x48; +if (a1 != v0) {//nop; +goto L43ca0c;} +//nop; +abort(); +L43ca0c: +t6 = v0 << 2; +t7 = 0x10019830; +t6 = t6 - v0; +t6 = t6 << 2; +t8 = t6 + t7; +t9 = MEM_U8(t8 + 6); +t0 = MEM_U8(a0 + 1); +v1 = v0 & 0xff; +if (v1 != t0) {MEM_U8(a0 + 0) = (uint8_t)t9; +goto L43ca48;} +MEM_U8(a0 + 0) = (uint8_t)t9; +t1 = t9 & 0xff; +if (a1 == t1) {//nop; +goto L43ca44;} +//nop; +abort(); +L43ca44: +MEM_U8(a0 + 1) = (uint8_t)a1; +L43ca48: +v0 = v1; +return v0; +v0 = v1; +} + +static void f_append_to_list(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43ca50: +//append_to_list: +//nop; +//nop; +//nop; +a2 = a0 & 0xff; +t6 = a2 << 2; +t7 = 0x10019830; +t6 = t6 - a2; +t6 = t6 << 2; +v0 = t6 + t7; +t8 = MEM_U8(v0 + 7); +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +if (t8 != 0) {//nop; +goto L43ca94;} +//nop; +abort(); +L43ca94: +t9 = 0x48; +MEM_U8(v0 + 6) = (uint8_t)t9; +//nop; +a0 = a1; +MEM_U32(sp + 36) = a1; +MEM_U8(sp + 35) = (uint8_t)a2; +v0 = f_list_is_empty(mem, sp, a0); +goto L43cab0; +MEM_U8(sp + 35) = (uint8_t)a2; +L43cab0: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 36); +a2 = MEM_U8(sp + 35); +if (v0 == 0) {//nop; +goto L43cad0;} +//nop; +MEM_U8(a1 + 0) = (uint8_t)a2; +MEM_U8(a1 + 1) = (uint8_t)a2; +goto L43caf0; +MEM_U8(a1 + 1) = (uint8_t)a2; +L43cad0: +t0 = MEM_U8(a1 + 1); +t2 = 0x10019830; +t1 = t0 << 2; +t1 = t1 - t0; +t1 = t1 << 2; +t3 = t1 + t2; +MEM_U8(t3 + 6) = (uint8_t)a2; +MEM_U8(a1 + 1) = (uint8_t)a2; +L43caf0: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t f_remove_from_list(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43cb00: +//remove_from_list: +//nop; +//nop; +//nop; +MEM_U32(sp + 0) = a0; +v0 = MEM_U8(a1 + 0); +//nop; +if (a0 != v0) {//nop; +goto L43cb64;} +//nop; +t6 = MEM_U8(a1 + 1); +t0 = 0x48; +if (a0 != t6) {t2 = 0xc; +goto L43cb40;} +t2 = 0xc; +MEM_U8(a1 + 0) = (uint8_t)t0; +MEM_U8(a1 + 1) = (uint8_t)t0; +v0 = 0x1; +return v0; +v0 = 0x1; +L43cb40: +lo = a0 * t2; +hi = (uint32_t)((uint64_t)a0 * (uint64_t)t2 >> 32); +t1 = 0x10019830; +t7 = lo; +t8 = t1 + t7; +t9 = MEM_U8(t8 + 6); +//nop; +MEM_U8(a1 + 0) = (uint8_t)t9; +v0 = 0x1; +return v0; +v0 = 0x1; +L43cb64: +v1 = MEM_U8(a1 + 1); +a2 = v0 & 0xff; +if (a2 == v1) {t0 = 0x48; +goto L43cbec;} +t0 = 0x48; +if (a2 == t0) {v0 = zero; +goto L43cbf0;} +v0 = zero; +t1 = 0x10019830; +t2 = 0xc; +L43cb84: +lo = a2 * t2; +hi = (uint32_t)((uint64_t)a2 * (uint64_t)t2 >> 32); +t3 = lo; +v0 = t1 + t3; +a3 = MEM_U8(v0 + 6); +//nop; +if (a0 != a3) {//nop; +goto L43cbd8;} +//nop; +if (v1 != a3) {//nop; +goto L43cbb8;} +//nop; +MEM_U8(a1 + 1) = (uint8_t)a2; +MEM_U8(v0 + 6) = (uint8_t)t0; +v0 = 0x1; +return v0; +v0 = 0x1; +L43cbb8: +lo = a0 * t2; +hi = (uint32_t)((uint64_t)a0 * (uint64_t)t2 >> 32); +t4 = lo; +t5 = t1 + t4; +t6 = MEM_U8(t5 + 6); +//nop; +MEM_U8(v0 + 6) = (uint8_t)t6; +v0 = 0x1; +return v0; +v0 = 0x1; +L43cbd8: +a2 = a3 & 0xff; +if (a2 == v1) {v0 = zero; +goto L43cbf0;} +v0 = zero; +if (a2 != t0) {//nop; +goto L43cb84;} +//nop; +L43cbec: +v0 = zero; +L43cbf0: +//nop; +return v0; +//nop; +} + +static void f_spill(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L43cbf8: +//spill: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +t6 = 0x10018ecc; +MEM_U32(sp + 180) = ra; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 172) = s0; +MEM_U32(sp + 192) = a0; +MEM_U32(sp + 200) = a2; +if (t6 != 0) {MEM_U32(sp + 204) = a3; +goto L43ccc4;} +MEM_U32(sp + 204) = a3; +t7 = MEM_U8(sp + 195); +t9 = 0x10019830; +t8 = t7 << 2; +t8 = t8 - t7; +t8 = t8 << 2; +s0 = t8 + t9; +t0 = MEM_U8(s0 + 8); +at = 0x6; +if (t0 != at) {//nop; +goto L43ccc4;} +//nop; +//nop; +a0 = t7; +//nop; +f_spill_to_temp(mem, sp, a0, a1); +goto L43cc64; +//nop; +L43cc64: +gp = MEM_U32(sp + 176); +a0 = MEM_U8(s0 + 9); +//nop; +a1 = 0x10019da8; +//nop; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43cc7c; +//nop; +L43cc7c: +gp = MEM_U32(sp + 176); +if (v0 == 0) {ra = MEM_U32(sp + 180); +goto L43cea0;} +ra = MEM_U32(sp + 180); +//nop; +a0 = MEM_U8(s0 + 9); +a1 = 0x10019da4; +//nop; +f_append_to_list(mem, sp, a0, a1); +goto L43cc9c; +//nop; +L43cc9c: +gp = MEM_U32(sp + 176); +a0 = MEM_U8(s0 + 9); +//nop; +a1 = zero; +a2 = zero; +a3 = 0x1; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43ccb8; +a3 = 0x1; +L43ccb8: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43cea0; +ra = MEM_U32(sp + 180); +L43ccc4: +//nop; +a0 = MEM_U32(sp + 200); +MEM_U32(sp + 196) = a1; +v0 = f_list_is_empty(mem, sp, a0); +goto L43ccd4; +MEM_U32(sp + 196) = a1; +L43ccd4: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(sp + 196); +if (v0 == 0) {t1 = MEM_U8(sp + 195); +goto L43cd04;} +t1 = MEM_U8(sp + 195); +//nop; +a0 = MEM_U8(sp + 195); +//nop; +f_spill_to_temp(mem, sp, a0, a1); +goto L43ccf4; +//nop; +L43ccf4: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43cea0; +ra = MEM_U32(sp + 180); +t1 = MEM_U8(sp + 195); +L43cd04: +t3 = 0x10019830; +t2 = t1 << 2; +//nop; +t2 = t2 - t1; +t2 = t2 << 2; +a0 = MEM_U32(sp + 200); +s0 = t2 + t3; +v0 = f_remove_head(mem, sp, a0); +goto L43cd24; +s0 = t2 + t3; +L43cd24: +gp = MEM_U32(sp + 176); +a0 = MEM_U16(sp + 210); +//nop; +a1 = MEM_U8(sp + 195); +MEM_U8(sp + 191) = (uint8_t)v0; +a2 = v0 & 0xff; +f_copy_reg(mem, sp, a0, a1, a2); +goto L43cd40; +a2 = v0 & 0xff; +L43cd40: +a0 = MEM_U32(s0 + 0); +gp = MEM_U32(sp + 176); +if (a0 != 0) {a1 = 0x221; +goto L43ce5c;} +a1 = 0x221; +t4 = 0x1000a433; +a0 = 0x4; +t4 = t4; +t6 = t4 + 0x48; +t8 = sp; +L43cd64: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t8 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t8) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t8 = t8 + 0xc; +MEM_U8(t8 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t8) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t8 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 4 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 7($t8) +goto L43cd64;} +//swr $at, 7($t8) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = 0x1000a3e3; +MEM_U8(t8 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t8) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +t9 = t9; +MEM_U8(t8 + 12 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t8 + 12 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t8 + 12 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t8 + 12 + 3) = (uint8_t)(t6 >> 0); +t7 = t9 + 0x48; +t1 = sp; +//swr $t6, 0xf($t8) +L43cdd4: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t1 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t1) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t1 = t1 + 0xc; +MEM_U8(t1 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t1) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t1 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 84 + 3) = (uint8_t)(at >> 0); +if (t9 != t7) {//swr $at, 0x57($t1) +goto L43cdd4;} +//swr $at, 0x57($t1) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(t1 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t1) +t7 = t9 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t9) +//nop; +MEM_U8(t1 + 92 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t1 + 92 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t1 + 92 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t1 + 92 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x5f($t1) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43ce50; +//nop; +L43ce50: +gp = MEM_U32(sp + 176); +//nop; +goto L43ce80; +//nop; +L43ce5c: +v1 = MEM_U8(a0 + 25); +t2 = MEM_U8(sp + 191); +t3 = v1 << 24; +t5 = t3 >> 25; +t6 = t2 ^ t5; +t4 = t6 << 25; +t8 = t4 >> 24; +t0 = t8 ^ v1; +MEM_U8(a0 + 25) = (uint8_t)t0; +L43ce80: +//nop; +a0 = MEM_U8(sp + 191); +a1 = MEM_U32(sp + 204); +//nop; +f_append_to_list(mem, sp, a0, a1); +goto L43ce94; +//nop; +L43ce94: +gp = MEM_U32(sp + 176); +//nop; +ra = MEM_U32(sp + 180); +L43cea0: +s0 = MEM_U32(sp + 172); +sp = sp + 0xc0; +return; +sp = sp + 0xc0; +} + +static void f_spill_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43ceac: +//spill_reg: +//nop; +//nop; +//nop; +t6 = 0x10018eac; +sp = sp + 0xffffff48; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 172) = s0; +at = t6 < 0x2; +s0 = a1 & 0xff; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 184) = a0; +if (at != 0) {MEM_U32(sp + 188) = a1; +goto L43cefc;} +MEM_U32(sp + 188) = a1; +t8 = 0x100054b4; +t7 = s0 << 2; +t9 = t7 + t8; +a1 = MEM_U32(t9 + 0); +v0 = s0 & 0xff; +goto L43cf14; +v0 = s0 & 0xff; +L43cefc: +t1 = 0x10005494; +t0 = s0 << 2; +t2 = t0 + t1; +a1 = MEM_U32(t2 + 0); +//nop; +v0 = s0 & 0xff; +L43cf14: +t3 = v0 + 0xffffffff; +at = t3 < 0x7; +if (at == 0) {//nop; +goto L43cfbc;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000a53c[] = { +&&L43cf44, +&&L43cf6c, +&&L43cf94, +&&L43cfbc, +&&L43cfbc, +&&L43cf44, +&&L43cf44, +}; +dest = Lswitch1000a53c[t3]; +//nop; +goto *dest; +//nop; +L43cf44: +//nop; +a0 = MEM_U8(sp + 187); +a2 = 0x10019da4; +a3 = 0x10019da8; +t4 = 0x31; +MEM_U32(sp + 16) = t4; +f_spill(mem, sp, a0, a1, a2, a3); +goto L43cf60; +MEM_U32(sp + 16) = t4; +L43cf60: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43d18c; +ra = MEM_U32(sp + 180); +L43cf6c: +//nop; +a0 = MEM_U8(sp + 187); +a2 = 0x10019dac; +a3 = 0x10019db0; +t5 = 0x8b; +MEM_U32(sp + 16) = t5; +f_spill(mem, sp, a0, a1, a2, a3); +goto L43cf88; +MEM_U32(sp + 16) = t5; +L43cf88: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43d18c; +ra = MEM_U32(sp + 180); +L43cf94: +//nop; +a0 = MEM_U8(sp + 187); +a2 = 0x10019dac; +a3 = 0x10019db0; +t6 = 0x8c; +MEM_U32(sp + 16) = t6; +f_spill(mem, sp, a0, a1, a2, a3); +goto L43cfb0; +MEM_U32(sp + 16) = t6; +L43cfb0: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43d18c; +ra = MEM_U32(sp + 180); +L43cfbc: +a0 = 0x10006560; +a1 = 0x1000a535; +//nop; +a0 = MEM_U32(a0 + 0); +a2 = 0x6; +a3 = 0x6; +MEM_U8(sp + 191) = (uint8_t)s0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L43cfe0; +a1 = a1; +L43cfe0: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(sp + 187); +s0 = 0x10006560; +a2 = 0x10005648; +//nop; +s0 = MEM_U32(s0 + 0); +t7 = 0xa; +MEM_U32(sp + 16) = t7; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L43d010; +a0 = s0; +L43d010: +gp = MEM_U32(sp + 176); +a0 = s0; +a1 = 0x1000a523; +//nop; +a2 = 0x12; +a3 = 0x12; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L43d030; +a1 = a1; +L43d030: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(sp + 191); +s0 = 0x10006560; +a2 = 0x10005868; +//nop; +s0 = MEM_U32(s0 + 0); +t8 = 0xa; +MEM_U32(sp + 16) = t8; +a3 = zero; +a2 = a2; +a0 = s0; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L43d060; +a0 = s0; +L43d060: +gp = MEM_U32(sp + 176); +a0 = s0; +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L43d078; +//nop; +L43d078: +gp = MEM_U32(sp + 176); +a0 = 0x4; +t9 = 0x1000a4d3; +a1 = 0x240; +t9 = t9; +t1 = t9 + 0x48; +t2 = sp; +L43d094: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t2 = t2 + 0xc; +MEM_U8(t2 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t2) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t2 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 4 + 3) = (uint8_t)(at >> 0); +if (t9 != t1) {//swr $at, 7($t2) +goto L43d094;} +//swr $at, 7($t2) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t3 = 0x1000a483; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +t1 = t9 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t9) +t3 = t3; +MEM_U8(t2 + 12 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t2 + 12 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t2 + 12 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t2 + 12 + 3) = (uint8_t)(t1 >> 0); +t5 = t3 + 0x48; +t6 = sp; +//swr $t1, 0xf($t2) +L43d104: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t6 = t6 + 0xc; +MEM_U8(t6 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t6) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t6 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 84 + 3) = (uint8_t)(at >> 0); +if (t3 != t5) {//swr $at, 0x57($t6) +goto L43d104;} +//swr $at, 0x57($t6) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +//nop; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +//nop; +MEM_U8(t6 + 92 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t6 + 92 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t6 + 92 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t6 + 92 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x5f($t6) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43d180; +//nop; +L43d180: +gp = MEM_U32(sp + 176); +//nop; +ra = MEM_U32(sp + 180); +L43d18c: +s0 = MEM_U32(sp + 172); +sp = sp + 0xb8; +return; +sp = sp + 0xb8; +} + +static void f_get_one_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L43d198: +//get_one_reg: +//nop; +//nop; +//nop; +sp = sp + 0xffffff48; +MEM_U32(sp + 172) = s0; +s0 = a0 & 0xff; +t6 = s0 << 2; +t7 = 0x10019830; +t6 = t6 - s0; +t6 = t6 << 2; +v0 = t6 + t7; +t8 = MEM_U8(v0 + 7); +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 184) = a0; +MEM_U32(sp + 188) = a1; +MEM_U32(sp + 192) = a2; +if (t8 != 0) {MEM_U32(sp + 196) = a3; +goto L43d210;} +MEM_U32(sp + 196) = a3; +t9 = MEM_U16(v0 + 4); +//nop; +if (t9 == 0) {//nop; +goto L43d388;} +//nop; +//nop; +a1 = MEM_U8(sp + 199); +a0 = s0; +f_spill_reg(mem, sp, a0, a1); +goto L43d204; +a0 = s0; +L43d204: +gp = MEM_U32(sp + 176); +//nop; +goto L43d388; +//nop; +L43d210: +//nop; +a1 = 0x10019da4; +a0 = s0; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43d220; +a0 = s0; +L43d220: +gp = MEM_U32(sp + 176); +if (v0 != 0) {//nop; +goto L43d370;} +//nop; +//nop; +a1 = 0x10019da8; +a0 = s0; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43d23c; +a0 = s0; +L43d23c: +gp = MEM_U32(sp + 176); +if (v0 == 0) {a0 = 0x4; +goto L43d264;} +a0 = 0x4; +//nop; +a1 = MEM_U8(sp + 199); +a0 = s0; +f_spill_reg(mem, sp, a0, a1); +goto L43d258; +a0 = s0; +L43d258: +gp = MEM_U32(sp + 176); +//nop; +goto L43d370; +//nop; +L43d264: +t0 = 0x1000a5a8; +a1 = 0x252; +t0 = t0; +t2 = t0 + 0x48; +t3 = sp; +L43d278: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 4 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 7($t3) +goto L43d278;} +//swr $at, 7($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t4 = 0x1000a558; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +t4 = t4; +MEM_U8(t3 + 12 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 12 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 12 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 12 + 3) = (uint8_t)(t2 >> 0); +t6 = t4 + 0x48; +t7 = sp; +//swr $t2, 0xf($t3) +L43d2e8: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 0x57($t7) +goto L43d2e8;} +//swr $at, 0x57($t7) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43d364; +//nop; +L43d364: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43d3ac; +ra = MEM_U32(sp + 180); +L43d370: +//nop; +a1 = 0x10019da8; +a0 = s0; +f_append_to_list(mem, sp, a0, a1); +goto L43d380; +a0 = s0; +L43d380: +gp = MEM_U32(sp + 176); +//nop; +L43d388: +//nop; +a1 = MEM_U32(sp + 188); +a2 = MEM_U16(sp + 194); +a3 = MEM_U8(sp + 199); +a0 = s0; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43d3a0; +a0 = s0; +L43d3a0: +gp = MEM_U32(sp + 176); +//nop; +ra = MEM_U32(sp + 180); +L43d3ac: +s0 = MEM_U32(sp + 172); +sp = sp + 0xb8; +return; +sp = sp + 0xb8; +} + +static void f_get_two_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L43d3b8: +//get_two_regs: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +t6 = a0 & 0x1; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +if (t6 == 0) {//nop; +goto L43d3ec;} +//nop; +abort(); +L43d3ec: +//nop; +a1 = MEM_U32(sp + 36); +a2 = MEM_U16(sp + 42); +a3 = 0x6; +MEM_U8(sp + 35) = (uint8_t)a0; +f_get_one_reg(mem, sp, a0, a1, a2, a3); +goto L43d404; +MEM_U8(sp + 35) = (uint8_t)a0; +L43d404: +v0 = MEM_U8(sp + 35); +gp = MEM_U32(sp + 24); +t7 = v0 << 2; +t8 = 0x10019830; +t7 = t7 - v0; +t7 = t7 << 2; +a0 = v0 + 0x1; +t9 = t7 + t8; +MEM_U8(t9 + 9) = (uint8_t)a0; +//nop; +a2 = MEM_U16(sp + 42); +a1 = MEM_U32(sp + 36); +a3 = 0x7; +f_get_one_reg(mem, sp, a0, a1, a2, a3); +goto L43d43c; +a3 = 0x7; +L43d43c: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_get_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L43d44c: +//get_reg: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +if (a1 == 0) {MEM_U32(sp + 40) = a2; +goto L43d4c8;} +MEM_U32(sp + 40) = a2; +t6 = 0x10018ecc; +//nop; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L43d4c8;} +//nop; +t7 = MEM_U8(a1 + 33); +at = 0x5010000; +t8 = t7 & 0x1f; +t9 = t8 < 0x20; +t0 = -t9; +t1 = t0 & at; +t2 = t1 << (t8 & 0x1f); +if ((int)t2 >= 0) {//nop; +goto L43d4c8;} +//nop; +//nop; +//nop; +//nop; +f_get_two_regs(mem, sp, a0, a1, a2); +goto L43d4bc; +//nop; +L43d4bc: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L43d4e4; +ra = MEM_U32(sp + 28); +L43d4c8: +//nop; +a3 = 0x1; +//nop; +f_get_one_reg(mem, sp, a0, a1, a2, a3); +goto L43d4d8; +//nop; +L43d4d8: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L43d4e4: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void f_get_reg1(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L43d4f0: +//get_reg1: +//nop; +//nop; +//nop; +t6 = a0 << 2; +t7 = 0x10019830; +t6 = t6 - a0; +sp = sp + 0xffffffd8; +t6 = t6 << 2; +v1 = t6 + t7; +t8 = MEM_U8(v1 + 7); +MEM_U32(sp + 20) = s0; +s0 = a1; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +if (t8 == 0) {MEM_U32(sp + 48) = a2; +goto L43d5e8;} +MEM_U32(sp + 48) = a2; +//nop; +a1 = 0x10019da4; +MEM_U32(sp + 32) = v1; +MEM_U8(sp + 43) = (uint8_t)a0; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43d548; +MEM_U8(sp + 43) = (uint8_t)a0; +L43d548: +gp = MEM_U32(sp + 24); +v1 = MEM_U32(sp + 32); +a0 = MEM_U8(sp + 43); +if (v0 == 0) {//nop; +goto L43d5e8;} +//nop; +//nop; +a1 = 0x10019da8; +MEM_U8(sp + 43) = (uint8_t)a0; +f_append_to_list(mem, sp, a0, a1); +goto L43d56c; +MEM_U8(sp + 43) = (uint8_t)a0; +L43d56c: +gp = MEM_U32(sp + 24); +a0 = MEM_U8(sp + 43); +t9 = 0x10018ecc; +a1 = s0; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 != 0) {//nop; +goto L43d5cc;} +//nop; +t0 = MEM_U8(s0 + 33); +at = 0x5010000; +t1 = t0 & 0x1f; +t2 = t1 < 0x20; +t3 = -t2; +t4 = t3 & at; +t5 = t4 << (t1 & 0x1f); +if ((int)t5 >= 0) {a3 = 0x6; +goto L43d5cc;} +a3 = 0x6; +//nop; +a2 = MEM_U16(sp + 50); +a1 = s0; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43d5c0; +a1 = s0; +L43d5c0: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L43d778; +ra = MEM_U32(sp + 28); +L43d5cc: +//nop; +a2 = MEM_U16(sp + 50); +a3 = 0x1; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43d5dc; +a3 = 0x1; +L43d5dc: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L43d778; +ra = MEM_U32(sp + 28); +L43d5e8: +//nop; +a1 = MEM_U16(sp + 50); +MEM_U32(sp + 32) = v1; +MEM_U8(sp + 43) = (uint8_t)a0; +f_inc_usage(mem, sp, a0, a1); +goto L43d5fc; +MEM_U8(sp + 43) = (uint8_t)a0; +L43d5fc: +gp = MEM_U32(sp + 24); +v1 = MEM_U32(sp + 32); +v0 = 0x10018ecc; +a0 = MEM_U8(sp + 43); +v0 = MEM_U8(v0 + 0); +//nop; +if (v0 != 0) {//nop; +goto L43d644;} +//nop; +t6 = MEM_U8(s0 + 33); +at = 0x5010000; +t7 = t6 & 0x1f; +t8 = t7 < 0x20; +t9 = -t8; +t0 = t9 & at; +t2 = t0 << (t7 & 0x1f); +if ((int)t2 >= 0) {t3 = 0x6; +goto L43d644;} +t3 = 0x6; +MEM_U8(v1 + 8) = (uint8_t)t3; +L43d644: +if (s0 == 0) {ra = MEM_U32(sp + 28); +goto L43d778;} +ra = MEM_U32(sp + 28); +if (v0 != 0) {ra = MEM_U32(sp + 28); +goto L43d778;} +ra = MEM_U32(sp + 28); +t4 = MEM_U8(s0 + 33); +at = 0x5010000; +t1 = t4 & 0x1f; +t5 = t1 < 0x20; +t6 = -t5; +t8 = t6 & at; +t9 = t8 << (t1 & 0x1f); +if ((int)t9 >= 0) {v0 = a0 + 0x1; +goto L43d774;} +v0 = a0 + 0x1; +t0 = v0 & 0xff; +t7 = t0 << 2; +t2 = 0x10019830; +t7 = t7 - t0; +t7 = t7 << 2; +MEM_U8(sp + 39) = (uint8_t)v0; +MEM_U8(v1 + 9) = (uint8_t)v0; +t3 = t7 + t2; +t4 = MEM_U8(t3 + 7); +//nop; +if (t4 == 0) {//nop; +goto L43d700;} +//nop; +//nop; +a1 = 0x10019da4; +a0 = v0 & 0xff; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43d6b8; +a0 = v0 & 0xff; +L43d6b8: +gp = MEM_U32(sp + 24); +if (v0 == 0) {//nop; +goto L43d700;} +//nop; +//nop; +a0 = MEM_U8(sp + 39); +a1 = 0x10019da8; +//nop; +f_append_to_list(mem, sp, a0, a1); +goto L43d6d8; +//nop; +L43d6d8: +gp = MEM_U32(sp + 24); +a0 = MEM_U8(sp + 39); +//nop; +a2 = MEM_U16(sp + 50); +a1 = s0; +a3 = 0x7; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43d6f4; +a3 = 0x7; +L43d6f4: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L43d778; +ra = MEM_U32(sp + 28); +L43d700: +//nop; +a0 = MEM_U8(sp + 39); +a1 = MEM_U16(sp + 50); +//nop; +f_inc_usage(mem, sp, a0, a1); +goto L43d714; +//nop; +L43d714: +gp = MEM_U32(sp + 24); +//nop; +t5 = 0x10018ecc; +//nop; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 != 0) {ra = MEM_U32(sp + 28); +goto L43d778;} +ra = MEM_U32(sp + 28); +t6 = MEM_U8(s0 + 33); +at = 0x5010000; +t8 = t6 & 0x1f; +t1 = t8 < 0x20; +t9 = -t1; +t0 = t9 & at; +t7 = t0 << (t8 & 0x1f); +if ((int)t7 >= 0) {t2 = 0x7; +goto L43d774;} +t2 = 0x7; +t3 = MEM_U8(sp + 39); +t5 = 0x10019830; +t4 = t3 << 2; +t4 = t4 - t3; +t4 = t4 << 2; +t6 = t4 + t5; +MEM_U8(t6 + 8) = (uint8_t)t2; +L43d774: +ra = MEM_U32(sp + 28); +L43d778: +s0 = MEM_U32(sp + 20); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_get_fp_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L43d784: +//get_fp_reg: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 172) = s0; +s0 = a0 & 0xff; +t6 = s0 << 2; +t7 = 0x10019830; +t6 = t6 - s0; +t6 = t6 << 2; +v1 = t6 + t7; +t8 = MEM_U8(v1 + 7); +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 192) = a0; +MEM_U32(sp + 196) = a1; +MEM_U32(sp + 200) = a2; +if (t8 != 0) {MEM_U32(sp + 204) = a3; +goto L43d7fc;} +MEM_U32(sp + 204) = a3; +t9 = MEM_U16(v1 + 4); +//nop; +if (t9 == 0) {//nop; +goto L43d980;} +//nop; +//nop; +a1 = MEM_U8(v1 + 8); +a0 = s0; +f_spill_reg(mem, sp, a0, a1); +goto L43d7f0; +a0 = s0; +L43d7f0: +gp = MEM_U32(sp + 176); +//nop; +goto L43d980; +//nop; +L43d7fc: +//nop; +a1 = 0x10019dac; +a0 = s0; +MEM_U32(sp + 188) = v1; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43d810; +MEM_U32(sp + 188) = v1; +L43d810: +gp = MEM_U32(sp + 176); +v1 = MEM_U32(sp + 188); +if (v0 != 0) {a0 = s0; +goto L43d968;} +a0 = s0; +//nop; +a1 = 0x10019db0; +MEM_U32(sp + 188) = v1; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43d830; +MEM_U32(sp + 188) = v1; +L43d830: +gp = MEM_U32(sp + 176); +v1 = MEM_U32(sp + 188); +if (v0 == 0) {a0 = 0x4; +goto L43d85c;} +a0 = 0x4; +//nop; +a1 = MEM_U8(v1 + 8); +a0 = s0; +f_spill_reg(mem, sp, a0, a1); +goto L43d850; +a0 = s0; +L43d850: +gp = MEM_U32(sp + 176); +//nop; +goto L43d968; +//nop; +L43d85c: +t0 = 0x1000a648; +a1 = 0x2a6; +t0 = t0; +t2 = t0 + 0x48; +t3 = sp; +L43d870: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 4 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 7($t3) +goto L43d870;} +//swr $at, 7($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t4 = 0x1000a5f8; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +t4 = t4; +MEM_U8(t3 + 12 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 12 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 12 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 12 + 3) = (uint8_t)(t2 >> 0); +t6 = t4 + 0x48; +t7 = sp; +//swr $t2, 0xf($t3) +L43d8e0: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 0x57($t7) +goto L43d8e0;} +//swr $at, 0x57($t7) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43d95c; +//nop; +L43d95c: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43d9a4; +ra = MEM_U32(sp + 180); +L43d968: +//nop; +a1 = 0x10019db0; +a0 = s0; +f_append_to_list(mem, sp, a0, a1); +goto L43d978; +a0 = s0; +L43d978: +gp = MEM_U32(sp + 176); +//nop; +L43d980: +//nop; +a1 = MEM_U32(sp + 196); +a2 = MEM_U16(sp + 206); +a3 = MEM_U8(sp + 203); +a0 = s0; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43d998; +a0 = s0; +L43d998: +gp = MEM_U32(sp + 176); +//nop; +ra = MEM_U32(sp + 180); +L43d9a4: +s0 = MEM_U32(sp + 172); +sp = sp + 0xc0; +return; +sp = sp + 0xc0; +} + +static void f_get_fp_reg1(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L43d9b0: +//get_fp_reg1: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +t6 = a0 << 2; +t7 = 0x10019830; +t6 = t6 - a0; +t6 = t6 << 2; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +MEM_U32(sp + 44) = a3; +t8 = t6 + t7; +t9 = MEM_U8(t8 + 7); +//nop; +if (t9 == 0) {//nop; +goto L43da58;} +//nop; +//nop; +a1 = 0x10019dac; +MEM_U8(sp + 35) = (uint8_t)a0; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43da0c; +MEM_U8(sp + 35) = (uint8_t)a0; +L43da0c: +gp = MEM_U32(sp + 24); +a0 = MEM_U8(sp + 35); +if (v0 == 0) {//nop; +goto L43da58;} +//nop; +//nop; +a1 = 0x10019db0; +MEM_U8(sp + 35) = (uint8_t)a0; +f_append_to_list(mem, sp, a0, a1); +goto L43da2c; +MEM_U8(sp + 35) = (uint8_t)a0; +L43da2c: +gp = MEM_U32(sp + 24); +a0 = MEM_U8(sp + 35); +//nop; +a1 = MEM_U32(sp + 36); +a2 = MEM_U16(sp + 46); +a3 = MEM_U8(sp + 43); +//nop; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43da4c; +//nop; +L43da4c: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L43da74; +ra = MEM_U32(sp + 28); +L43da58: +//nop; +a1 = MEM_U16(sp + 46); +//nop; +f_inc_usage(mem, sp, a0, a1); +goto L43da68; +//nop; +L43da68: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L43da74: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t f_can_get_two_regs(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43dab4: +//can_get_two_regs: +//nop; +//nop; +//nop; +MEM_U32(sp + 0) = a0; +a0 = MEM_U8(sp + 0); +v1 = 0x48; +if (a0 != v1) {t6 = a0 & 0x1; +goto L43dadc;} +t6 = a0 & 0x1; +v0 = zero; +return v0; +v0 = zero; +L43dadc: +if (t6 == 0) {v0 = a0 & 0xff; +goto L43db0c;} +v0 = a0 & 0xff; +a0 = 0x10019830; +a1 = 0xc; +L43daec: +lo = v0 * a1; +hi = (uint32_t)((uint64_t)v0 * (uint64_t)a1 >> 32); +t7 = lo; +t8 = a0 + t7; +v0 = MEM_U8(t8 + 6); +//nop; +t9 = v0 & 0x1; +if (t9 != 0) {//nop; +goto L43daec;} +//nop; +L43db0c: +if (v0 != v1) {v0 = 0x1; +goto L43db20;} +v0 = 0x1; +v0 = zero; +return v0; +v0 = zero; +v0 = 0x1; +L43db20: +//nop; +return v0; +//nop; +} + +static uint32_t f_spill_two_regs(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43db28: +//spill_two_regs: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +//nop; +MEM_U32(sp + 188) = ra; +a0 = 0x10019da8; +MEM_U32(sp + 184) = gp; +MEM_U32(sp + 180) = s1; +MEM_U32(sp + 176) = s0; +v0 = f_remove_direg(mem, sp, a0); +goto L43db54; +MEM_U32(sp + 176) = s0; +L43db54: +gp = MEM_U32(sp + 184); +t6 = v0 & 0xff; +t7 = t6 << 2; +t8 = 0x10019830; +t7 = t7 - t6; +t7 = t7 << 2; +t9 = t7 + t8; +t0 = MEM_U8(t9 + 8); +at = 0x6; +if (t0 != at) {s1 = v0 & 0xff; +goto L43dbc4;} +s1 = v0 & 0xff; +a1 = 0x10005494; +//nop; +a1 = MEM_U32(a1 + 24); +a0 = s1; +f_spill_to_temp(mem, sp, a0, a1); +goto L43db94; +a0 = s1; +L43db94: +gp = MEM_U32(sp + 184); +s0 = s1 + 0x1; +//nop; +a1 = 0x10019da8; +a0 = s0; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43dbac; +a0 = s0; +L43dbac: +gp = MEM_U32(sp + 184); +if (v0 != 0) {//nop; +goto L43dbbc;} +//nop; +abort(); +L43dbbc: +t9 = s1 << 2; +goto L43dd44; +t9 = s1 << 2; +L43dbc4: +a1 = 0x10005494; +//nop; +a1 = MEM_U32(a1 + 4); +a0 = s1; +f_spill_to_temp(mem, sp, a0, a1); +goto L43dbd8; +a0 = s1; +L43dbd8: +gp = MEM_U32(sp + 184); +s0 = s1 + 0x1; +//nop; +a1 = 0x10019da8; +a0 = s0; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43dbf0; +a0 = s0; +L43dbf0: +gp = MEM_U32(sp + 184); +if (v0 == 0) {//nop; +goto L43dc1c;} +//nop; +a1 = 0x10005494; +//nop; +a1 = MEM_U32(a1 + 4); +a0 = s0; +f_spill_to_temp(mem, sp, a0, a1); +goto L43dc10; +a0 = s0; +L43dc10: +gp = MEM_U32(sp + 184); +t9 = s1 << 2; +goto L43dd44; +t9 = s1 << 2; +L43dc1c: +//nop; +a1 = 0x10019da4; +a0 = s0; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43dc2c; +a0 = s0; +L43dc2c: +gp = MEM_U32(sp + 184); +if (v0 != 0) {a0 = 0x4; +goto L43dd40;} +a0 = 0x4; +t1 = 0x1000a6e8; +a1 = 0x305; +t1 = t1; +t3 = t1 + 0x48; +t4 = sp; +L43dc4c: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t4 = t4 + 0xc; +MEM_U8(t4 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t4) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t4 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 4 + 3) = (uint8_t)(at >> 0); +if (t1 != t3) {//swr $at, 7($t4) +goto L43dc4c;} +//swr $at, 7($t4) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t5 = 0x1000a698; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +t5 = t5; +MEM_U8(t4 + 12 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 12 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 12 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 12 + 3) = (uint8_t)(t3 >> 0); +t7 = t5 + 0x48; +t8 = sp; +//swr $t3, 0xf($t4) +L43dcbc: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t8 = t8 + 0xc; +MEM_U8(t8 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t8) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t8 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 84 + 3) = (uint8_t)(at >> 0); +if (t5 != t7) {//swr $at, 0x57($t8) +goto L43dcbc;} +//swr $at, 0x57($t8) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +//nop; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +t7 = t5 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t5) +//nop; +MEM_U8(t8 + 92 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t8 + 92 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t8 + 92 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t8 + 92 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x5f($t8) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43dd38; +//nop; +L43dd38: +gp = MEM_U32(sp + 184); +//nop; +L43dd40: +t9 = s1 << 2; +L43dd44: +t0 = 0x10019830; +t9 = t9 - s1; +t9 = t9 << 2; +t2 = t9 + t0; +MEM_U8(t2 + 9) = (uint8_t)s0; +ra = MEM_U32(sp + 188); +v0 = s1; +s1 = MEM_U32(sp + 180); +s0 = MEM_U32(sp + 176); +sp = sp + 0xc0; +return v0; +sp = sp + 0xc0; +} + +static uint32_t f_get_two_free_regs(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43dd70: +//get_two_free_regs: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 28) = s1; +v0 = zero < a0; +s1 = a0; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 44) = a1; +if (v0 == 0) {v1 = v0; +goto L43dde4;} +v1 = v0; +v1 = 0x10018ecc; +//nop; +v1 = MEM_U8(v1 + 0); +//nop; +t6 = v1 < 0x1; +if (t6 == 0) {v1 = t6; +goto L43dde4;} +v1 = t6; +t7 = MEM_U8(s1 + 33); +at = 0x5010000; +t8 = t7 & 0x1f; +t9 = t8 < 0x20; +t1 = -t9; +t2 = t1 & at; +v1 = t2 << (t8 & 0x1f); +t3 = (int)v1 < (int)0x0; +v1 = t3; +L43dde4: +s0 = 0x10019da4; +if (v1 != 0) {//nop; +goto L43ddf4;} +//nop; +abort(); +L43ddf4: +at = MEM_U8(s0 + 0); +//nop; +MEM_U8(sp + 0) = (uint8_t)at; +t5 = MEM_U8(s0 + 1); +//nop; +MEM_U8(sp + 1) = (uint8_t)t5; +a0 = MEM_U32(sp + 0); +//nop; +v0 = f_can_get_two_regs(mem, sp, a0); +goto L43de18; +//nop; +L43de18: +gp = MEM_U32(sp + 32); +if (v0 == 0) {//nop; +goto L43de80;} +//nop; +//nop; +a0 = s0; +//nop; +v0 = f_remove_direg(mem, sp, a0); +goto L43de34; +//nop; +L43de34: +gp = MEM_U32(sp + 32); +v1 = v0 & 0xff; +t6 = v1 << 2; +t7 = 0x10019830; +t6 = t6 - v1; +t6 = t6 << 2; +t9 = v1 + 0x1; +t0 = t6 + t7; +MEM_U8(t0 + 9) = (uint8_t)t9; +a0 = t9 & 0xff; +//nop; +a2 = MEM_U16(sp + 46); +s0 = v0 & 0xff; +a1 = s1; +a3 = 0x7; +f_get_one_reg(mem, sp, a0, a1, a2, a3); +goto L43de74; +a3 = 0x7; +L43de74: +gp = MEM_U32(sp + 32); +//nop; +goto L43def8; +//nop; +L43de80: +//nop; +//nop; +//nop; +v0 = f_spill_two_regs(mem, sp); +goto L43de90; +//nop; +L43de90: +gp = MEM_U32(sp + 32); +t1 = v0 & 0xff; +t2 = t1 << 2; +t8 = 0x10019830; +t2 = t2 - t1; +t2 = t2 << 2; +//nop; +t3 = t2 + t8; +a0 = MEM_U8(t3 + 9); +a1 = 0x10019da8; +s0 = v0 & 0xff; +f_append_to_list(mem, sp, a0, a1); +goto L43dec0; +s0 = v0 & 0xff; +L43dec0: +gp = MEM_U32(sp + 32); +t4 = s0 << 2; +t5 = 0x10019830; +t4 = t4 - s0; +t4 = t4 << 2; +//nop; +t6 = t4 + t5; +a0 = MEM_U8(t6 + 9); +a2 = MEM_U16(sp + 46); +a1 = s1; +a3 = 0x7; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43def0; +a3 = 0x7; +L43def0: +gp = MEM_U32(sp + 32); +//nop; +L43def8: +//nop; +a1 = 0x10019da8; +a0 = s0; +f_append_to_list(mem, sp, a0, a1); +goto L43df08; +a0 = s0; +L43df08: +gp = MEM_U32(sp + 32); +a2 = MEM_U16(sp + 46); +//nop; +a0 = s0; +a1 = s1; +a3 = 0x6; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43df24; +a3 = 0x6; +L43df24: +ra = MEM_U32(sp + 36); +v0 = s0; +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x28; +return v0; +sp = sp + 0x28; +} + +static uint32_t f_get_one_free_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43df40: +//get_one_free_reg: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 28) = ra; +a0 = 0x10019da4; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 20) = s0; +MEM_U32(sp + 36) = a1; +v0 = f_list_is_empty(mem, sp, a0); +goto L43df70; +MEM_U32(sp + 36) = a1; +L43df70: +gp = MEM_U32(sp + 24); +if (v0 == 0) {//nop; +goto L43e0c8;} +//nop; +t6 = 0x10019da8; +//nop; +at = MEM_U8(t6 + 0); +//nop; +MEM_U8(sp + 0) = (uint8_t)at; +t8 = MEM_U8(t6 + 1); +//nop; +MEM_U8(sp + 1) = (uint8_t)t8; +a0 = MEM_U32(sp + 0); +//nop; +v0 = f_get_head(mem, sp, a0); +goto L43dfa8; +//nop; +L43dfa8: +gp = MEM_U32(sp + 24); +t9 = v0 & 0xff; +t0 = t9 << 2; +t1 = 0x10019830; +t0 = t0 - t9; +t0 = t0 << 2; +t2 = t0 + t1; +v1 = MEM_U8(t2 + 8); +at = 0x6; +if (v1 == at) {at = 0x7; +goto L43dfdc;} +at = 0x7; +if (v1 != at) {//nop; +goto L43e058;} +//nop; +L43dfdc: +//nop; +//nop; +//nop; +v0 = f_spill_two_regs(mem, sp); +goto L43dfec; +//nop; +L43dfec: +gp = MEM_U32(sp + 24); +t3 = v0 & 0xff; +t4 = t3 << 2; +t5 = 0x10019830; +t4 = t4 - t3; +t4 = t4 << 2; +//nop; +t7 = t4 + t5; +a0 = MEM_U8(t7 + 9); +a1 = 0x10019da4; +s0 = v0 & 0xff; +f_append_to_list(mem, sp, a0, a1); +goto L43e01c; +s0 = v0 & 0xff; +L43e01c: +gp = MEM_U32(sp + 24); +t6 = s0 << 2; +t8 = 0x10019830; +t6 = t6 - s0; +t6 = t6 << 2; +t9 = t6 + t8; +a0 = MEM_U8(t9 + 9); +//nop; +a1 = zero; +a2 = zero; +a3 = 0x1; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43e04c; +a3 = 0x1; +L43e04c: +gp = MEM_U32(sp + 24); +//nop; +goto L43e0e0; +//nop; +L43e058: +//nop; +a0 = 0x10019da8; +//nop; +v0 = f_remove_head(mem, sp, a0); +goto L43e068; +//nop; +L43e068: +gp = MEM_U32(sp + 24); +at = 0x1; +t0 = 0x10018ecc; +s0 = v0 & 0xff; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 != at) {//nop; +goto L43e0a8;} +//nop; +a1 = 0x100054b4; +//nop; +a1 = MEM_U32(a1 + 4); +a0 = s0; +f_spill_to_temp(mem, sp, a0, a1); +goto L43e09c; +a0 = s0; +L43e09c: +gp = MEM_U32(sp + 24); +//nop; +goto L43e0e0; +//nop; +L43e0a8: +a1 = 0x10005494; +//nop; +a1 = MEM_U32(a1 + 4); +a0 = s0; +f_spill_to_temp(mem, sp, a0, a1); +goto L43e0bc; +a0 = s0; +L43e0bc: +gp = MEM_U32(sp + 24); +//nop; +goto L43e0e0; +//nop; +L43e0c8: +//nop; +a0 = 0x10019da4; +//nop; +v0 = f_remove_head(mem, sp, a0); +goto L43e0d8; +//nop; +L43e0d8: +gp = MEM_U32(sp + 24); +s0 = v0 & 0xff; +L43e0e0: +//nop; +a1 = 0x10019da8; +a0 = s0; +f_append_to_list(mem, sp, a0, a1); +goto L43e0f0; +a0 = s0; +L43e0f0: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +a2 = MEM_U16(sp + 38); +a0 = s0; +a3 = 0x1; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43e10c; +a3 = 0x1; +L43e10c: +ra = MEM_U32(sp + 28); +v0 = s0; +gp = MEM_U32(sp + 24); +s0 = MEM_U32(sp + 20); +sp = sp + 0x20; +return v0; +sp = sp + 0x20; +} + +static uint32_t f_get_free_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43e124: +//get_free_reg: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if (a0 == 0) {MEM_U32(sp + 36) = a1; +goto L43e19c;} +MEM_U32(sp + 36) = a1; +t6 = 0x10018ecc; +//nop; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L43e19c;} +//nop; +t7 = MEM_U8(a0 + 33); +at = 0x5010000; +t8 = t7 & 0x1f; +t9 = t8 < 0x20; +t0 = -t9; +t1 = t0 & at; +t2 = t1 << (t8 & 0x1f); +if ((int)t2 >= 0) {//nop; +goto L43e19c;} +//nop; +//nop; +//nop; +//nop; +v0 = f_get_two_free_regs(mem, sp, a0, a1); +goto L43e190; +//nop; +L43e190: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L43e1b8; +ra = MEM_U32(sp + 28); +L43e19c: +//nop; +//nop; +//nop; +v0 = f_get_one_free_reg(mem, sp, a0, a1); +goto L43e1ac; +//nop; +L43e1ac: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L43e1b8: +sp = sp + 0x20; +//nop; +return v0; +//nop; +} + +static uint32_t f_get_free_fp_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L43e1c4: +//get_free_fp_reg: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 20) = s0; +s0 = 0x10019dac; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +a0 = s0; +v0 = f_list_is_empty(mem, sp, a0); +goto L43e1fc; +a0 = s0; +L43e1fc: +gp = MEM_U32(sp + 24); +if (v0 == 0) {//nop; +goto L43e2b0;} +//nop; +//nop; +a0 = 0x10019db0; +//nop; +v0 = f_remove_head(mem, sp, a0); +goto L43e218; +//nop; +L43e218: +gp = MEM_U32(sp + 24); +s0 = v0 & 0xff; +t6 = 0x10018eac; +t4 = s0 << 2; +t6 = MEM_U8(t6 + 0); +t7 = s0 << 2; +at = t6 < 0x2; +if (at != 0) {t4 = t4 - s0; +goto L43e278;} +t4 = t4 - s0; +t8 = 0x10019830; +t7 = t7 - s0; +t7 = t7 << 2; +t9 = t7 + t8; +t0 = MEM_U8(t9 + 8); +t2 = 0x100054b4; +t1 = t0 << 2; +//nop; +t3 = t1 + t2; +a1 = MEM_U32(t3 + 0); +a0 = s0; +f_spill_to_temp(mem, sp, a0, a1); +goto L43e26c; +a0 = s0; +L43e26c: +gp = MEM_U32(sp + 24); +//nop; +goto L43e358; +//nop; +L43e278: +t5 = 0x10019830; +t4 = t4 << 2; +t6 = t4 + t5; +t7 = MEM_U8(t6 + 8); +t9 = 0x10005494; +t8 = t7 << 2; +t0 = t8 + t9; +//nop; +a1 = MEM_U32(t0 + 0); +a0 = s0; +f_spill_to_temp(mem, sp, a0, a1); +goto L43e2a4; +a0 = s0; +L43e2a4: +gp = MEM_U32(sp + 24); +//nop; +goto L43e358; +//nop; +L43e2b0: +//nop; +a0 = s0; +//nop; +v0 = f_remove_head(mem, sp, a0); +goto L43e2c0; +//nop; +L43e2c0: +v1 = v0 & 0xff; +gp = MEM_U32(sp + 24); +t1 = v1 < 0x60; +if (t1 == 0) {s0 = v0 & 0xff; +goto L43e2f4;} +s0 = v0 & 0xff; +t4 = 0x10019338; +t2 = (int)v1 >> 5; +t3 = t2 << 2; +t5 = t3 + t4; +t6 = MEM_U32(t5 + 0); +//nop; +t7 = t6 << (v1 & 0x1f); +t1 = (int)t7 < (int)0x0; +L43e2f4: +if (t1 == 0) {t9 = v1 < 0x20; +goto L43e358;} +t9 = v1 < 0x20; +t3 = 0x100197b0; +t0 = ~v1; +t3 = MEM_U32(t3 + 0); +at = 0x100197b0; +t2 = t9 << (t0 & 0x1f); +t8 = 0x100197b0; +t4 = t3 | t2; +t5 = v1 + 0xffffffe0; +MEM_U32(at + 0) = t4; +t8 = MEM_U32(t8 + 4); +t6 = t5 < 0x20; +at = 0x100197b0; +t7 = t6 << (t0 & 0x1f); +t4 = 0x100197b0; +t1 = t8 | t7; +t9 = v1 + 0xffffffc0; +MEM_U32(at + 4) = t1; +t4 = MEM_U32(t4 + 8); +t3 = t9 < 0x20; +at = 0x100197b0; +t2 = t3 << (t0 & 0x1f); +t5 = t4 | t2; +MEM_U32(at + 8) = t5; +L43e358: +//nop; +a1 = 0x10019db0; +a0 = s0; +f_append_to_list(mem, sp, a0, a1); +goto L43e368; +a0 = s0; +L43e368: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +a2 = MEM_U16(sp + 42); +a3 = MEM_U8(sp + 39); +a0 = s0; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43e384; +a0 = s0; +L43e384: +ra = MEM_U32(sp + 28); +v0 = s0; +gp = MEM_U32(sp + 24); +s0 = MEM_U32(sp + 20); +sp = sp + 0x20; +return v0; +sp = sp + 0x20; +} + +static uint32_t f_content_of(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43e39c: +//content_of: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +t6 = a0 << 2; +t7 = 0x10019830; +t6 = t6 - a0; +t6 = t6 << 2; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 192) = a0; +t8 = t6 + t7; +v1 = MEM_U32(t8 + 0); +a0 = 0x4; +if (v1 != 0) {v0 = v1; +goto L43e4ec;} +v0 = v1; +t9 = 0x1000a788; +a1 = 0x363; +t9 = t9; +t1 = t9 + 0x48; +t2 = sp; +L43e3f0: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t2 = t2 + 0xc; +MEM_U8(t2 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t2) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t2 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 4 + 3) = (uint8_t)(at >> 0); +if (t9 != t1) {//swr $at, 7($t2) +goto L43e3f0;} +//swr $at, 7($t2) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t3 = 0x1000a738; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +t1 = t9 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t9) +t3 = t3; +MEM_U8(t2 + 12 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t2 + 12 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t2 + 12 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t2 + 12 + 3) = (uint8_t)(t1 >> 0); +t5 = t3 + 0x48; +t6 = sp; +//swr $t1, 0xf($t2) +L43e460: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t6 = t6 + 0xc; +MEM_U8(t6 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t6) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t6 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 84 + 3) = (uint8_t)(at >> 0); +if (t3 != t5) {//swr $at, 0x57($t6) +goto L43e460;} +//swr $at, 0x57($t6) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +//nop; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +//nop; +MEM_U8(t6 + 92 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t6 + 92 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t6 + 92 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t6 + 92 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x5f($t6) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43e4dc; +//nop; +L43e4dc: +gp = MEM_U32(sp + 176); +v0 = MEM_U32(sp + 188); +ra = MEM_U32(sp + 180); +goto L43e4f0; +ra = MEM_U32(sp + 180); +L43e4ec: +ra = MEM_U32(sp + 180); +L43e4f0: +sp = sp + 0xc0; +//nop; +return v0; +//nop; +} + +static void f_inc_usage(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43e4fc: +//inc_usage: +//nop; +//nop; +//nop; +t6 = a0 << 2; +t7 = 0x10019830; +t6 = t6 - a0; +t6 = t6 << 2; +v0 = t6 + t7; +t8 = MEM_U16(v0 + 4); +MEM_U32(sp + 0) = a0; +t9 = t8 + a1; +MEM_U32(sp + 4) = a1; +MEM_U16(v0 + 4) = (uint16_t)t9; +return; +MEM_U16(v0 + 4) = (uint16_t)t9; +} + +static void f_dec_usage(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43e534: +//dec_usage: +//nop; +//nop; +//nop; +t6 = a0 << 2; +t7 = 0x10019830; +t6 = t6 - a0; +t6 = t6 << 2; +v1 = t6 + t7; +v0 = MEM_U16(v1 + 4); +sp = sp + 0xffffff40; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +if (v0 != 0) {MEM_U32(sp + 192) = a0; +goto L43e680;} +MEM_U32(sp + 192) = a0; +t8 = 0x1000a8c8; +a0 = 0x4; +t8 = t8; +t0 = t8 + 0x48; +a1 = 0x374; +t1 = sp; +L43e584: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t1 = t1 + 0xc; +MEM_U8(t1 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t1) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t1 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 4 + 3) = (uint8_t)(at >> 0); +if (t8 != t0) {//swr $at, 7($t1) +goto L43e584;} +//swr $at, 7($t1) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t2 = 0x1000a878; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +t0 = t8 + 4; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 7($t8) +t2 = t2; +MEM_U8(t1 + 12 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(t1 + 12 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(t1 + 12 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(t1 + 12 + 3) = (uint8_t)(t0 >> 0); +t4 = t2 + 0x48; +t5 = sp; +//swr $t0, 0xf($t1) +L43e5f4: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t5 = t5 + 0xc; +MEM_U8(t5 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t5) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t5 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 84 + 3) = (uint8_t)(at >> 0); +if (t2 != t4) {//swr $at, 0x57($t5) +goto L43e5f4;} +//swr $at, 0x57($t5) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +//nop; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +t4 = t2 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t2) +//nop; +MEM_U8(t5 + 92 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t5 + 92 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t5 + 92 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t5 + 92 + 3) = (uint8_t)(t4 >> 0); +//swr $t4, 0x5f($t5) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +MEM_U32(sp + 184) = v1; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43e670; +MEM_U32(sp + 184) = v1; +L43e670: +gp = MEM_U32(sp + 176); +v1 = MEM_U32(sp + 184); +//nop; +goto L43e688; +//nop; +L43e680: +t6 = v0 + 0xffffffff; +MEM_U16(v1 + 4) = (uint16_t)t6; +L43e688: +t7 = 0x10018ecc; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != 0) {ra = MEM_U32(sp + 180); +goto L43e7ec;} +ra = MEM_U32(sp + 180); +t9 = MEM_U8(v1 + 8); +at = 0x6; +if (t9 != at) {ra = MEM_U32(sp + 180); +goto L43e7ec;} +ra = MEM_U32(sp + 180); +v0 = MEM_U8(v1 + 9); +t8 = 0x10019830; +t0 = v0 << 2; +t0 = t0 - v0; +t0 = t0 << 2; +a0 = t0 + t8; +a1 = MEM_U16(a0 + 4); +t2 = sp; +if (a1 != 0) {t0 = a1 + 0xffffffff; +goto L43e7e4;} +t0 = a1 + 0xffffffff; +t1 = 0x1000a828; +a0 = 0x4; +t1 = t1; +t4 = t1 + 0x48; +a1 = 0x37b; +L43e6ec: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t2 = t2 + 0xc; +MEM_U8(t2 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t2) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t2 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 4 + 3) = (uint8_t)(at >> 0); +if (t1 != t4) {//swr $at, 7($t2) +goto L43e6ec;} +//swr $at, 7($t2) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t5 = 0x1000a7d8; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +t4 = t1 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t1) +t5 = t5; +MEM_U8(t2 + 12 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t2 + 12 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t2 + 12 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t2 + 12 + 3) = (uint8_t)(t4 >> 0); +t7 = t5 + 0x48; +t9 = sp; +//swr $t4, 0xf($t2) +L43e75c: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t9 = t9 + 0xc; +MEM_U8(t9 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t9) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t9 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 84 + 3) = (uint8_t)(at >> 0); +if (t5 != t7) {//swr $at, 0x57($t9) +goto L43e75c;} +//swr $at, 0x57($t9) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +//nop; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +t7 = t5 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t5) +//nop; +MEM_U8(t9 + 92 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t9 + 92 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t9 + 92 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t9 + 92 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x5f($t9) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43e7d8; +//nop; +L43e7d8: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43e7ec; +ra = MEM_U32(sp + 180); +L43e7e4: +MEM_U16(a0 + 4) = (uint16_t)t0; +ra = MEM_U32(sp + 180); +L43e7ec: +sp = sp + 0xc0; +//nop; +return; +//nop; +} + +static void f_free_reg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43e7f8: +//free_reg: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +//nop; +MEM_U32(sp + 192) = a0; +MEM_U32(sp + 180) = ra; +a0 = MEM_U8(sp + 195); +MEM_U32(sp + 176) = gp; +f_dec_usage(mem, sp, a0); +goto L43e820; +MEM_U32(sp + 176) = gp; +L43e820: +a0 = MEM_U8(sp + 195); +gp = MEM_U32(sp + 176); +t6 = a0 << 2; +t7 = 0x10019830; +t6 = t6 - a0; +t6 = t6 << 2; +v1 = t6 + t7; +t8 = MEM_U16(v1 + 4); +//nop; +if (t8 != 0) {ra = MEM_U32(sp + 180); +goto L43eb9c;} +ra = MEM_U32(sp + 180); +t9 = MEM_U8(v1 + 7); +//nop; +if (t9 == 0) {//nop; +goto L43e9ac;} +//nop; +//nop; +a1 = 0x10019da8; +MEM_U32(sp + 184) = v1; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43e86c; +MEM_U32(sp + 184) = v1; +L43e86c: +gp = MEM_U32(sp + 176); +v1 = MEM_U32(sp + 184); +if (v0 != 0) {a0 = 0x4; +goto L43e988;} +a0 = 0x4; +t0 = 0x1000aa08; +a1 = 0x38b; +t0 = t0; +t2 = t0 + 0x48; +t3 = sp; +L43e890: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 4 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 7($t3) +goto L43e890;} +//swr $at, 7($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t4 = 0x1000a9b8; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +t4 = t4; +MEM_U8(t3 + 12 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 12 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 12 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 12 + 3) = (uint8_t)(t2 >> 0); +t6 = t4 + 0x48; +t7 = sp; +//swr $t2, 0xf($t3) +L43e900: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 0x57($t7) +goto L43e900;} +//swr $at, 0x57($t7) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43e97c; +//nop; +L43e97c: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43eb9c; +ra = MEM_U32(sp + 180); +L43e988: +//nop; +a0 = MEM_U8(sp + 195); +a1 = 0x10019da4; +MEM_U32(sp + 184) = v1; +f_append_to_list(mem, sp, a0, a1); +goto L43e99c; +MEM_U32(sp + 184) = v1; +L43e99c: +gp = MEM_U32(sp + 176); +v1 = MEM_U32(sp + 184); +a0 = MEM_U8(sp + 195); +//nop; +L43e9ac: +t8 = 0x10018ecc; +a1 = zero; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L43eb80;} +//nop; +t9 = MEM_U8(v1 + 8); +at = 0x6; +if (t9 != at) {a2 = zero; +goto L43eb80;} +a2 = zero; +//nop; +a1 = zero; +a3 = 0x1; +MEM_U32(sp + 184) = v1; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43e9e8; +MEM_U32(sp + 184) = v1; +L43e9e8: +v1 = MEM_U32(sp + 184); +gp = MEM_U32(sp + 176); +a0 = MEM_U8(v1 + 9); +t2 = 0x10019830; +t1 = a0 << 2; +t1 = t1 - a0; +t1 = t1 << 2; +t0 = t1 + t2; +t3 = MEM_U8(t0 + 7); +//nop; +if (t3 == 0) {//nop; +goto L43eb60;} +//nop; +//nop; +a1 = 0x10019da8; +MEM_U8(sp + 191) = (uint8_t)a0; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43ea28; +MEM_U8(sp + 191) = (uint8_t)a0; +L43ea28: +gp = MEM_U32(sp + 176); +a0 = MEM_U8(sp + 191); +if (v0 != 0) {a1 = 0x395; +goto L43eb44;} +a1 = 0x395; +t5 = 0x1000a968; +a0 = 0x4; +t5 = t5; +t4 = t5 + 0x48; +t7 = sp; +L43ea4c: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t7 = t7 + 0xc; +MEM_U8(t7 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t7) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t7 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 4 + 3) = (uint8_t)(at >> 0); +if (t5 != t4) {//swr $at, 7($t7) +goto L43ea4c;} +//swr $at, 7($t7) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t8 = 0x1000a918; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +t4 = t5 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t5) +t8 = t8; +MEM_U8(t7 + 12 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t7 + 12 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t7 + 12 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t7 + 12 + 3) = (uint8_t)(t4 >> 0); +t1 = t8 + 0x48; +t2 = sp; +//swr $t4, 0xf($t7) +L43eabc: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t2 = t2 + 0xc; +MEM_U8(t2 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t2) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t2 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 84 + 3) = (uint8_t)(at >> 0); +if (t8 != t1) {//swr $at, 0x57($t2) +goto L43eabc;} +//swr $at, 0x57($t2) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +//nop; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +t1 = t8 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t8) +//nop; +MEM_U8(t2 + 92 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t2 + 92 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t2 + 92 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t2 + 92 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0x5f($t2) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43eb38; +//nop; +L43eb38: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43eb9c; +ra = MEM_U32(sp + 180); +L43eb44: +//nop; +a1 = 0x10019da4; +MEM_U8(sp + 191) = (uint8_t)a0; +f_append_to_list(mem, sp, a0, a1); +goto L43eb54; +MEM_U8(sp + 191) = (uint8_t)a0; +L43eb54: +gp = MEM_U32(sp + 176); +a0 = MEM_U8(sp + 191); +//nop; +L43eb60: +//nop; +a1 = zero; +a2 = zero; +a3 = 0x1; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43eb74; +a3 = 0x1; +L43eb74: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43eb9c; +ra = MEM_U32(sp + 180); +L43eb80: +//nop; +a2 = zero; +a3 = 0x1; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43eb90; +a3 = 0x1; +L43eb90: +gp = MEM_U32(sp + 176); +//nop; +ra = MEM_U32(sp + 180); +L43eb9c: +sp = sp + 0xc0; +//nop; +return; +//nop; +} + +static void f_free_fp_reg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43eba8: +//free_fp_reg: +//nop; +//nop; +//nop; +sp = sp + 0xffffff48; +//nop; +MEM_U32(sp + 172) = s0; +s0 = a0 & 0xff; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 184) = a0; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 188) = a1; +a0 = s0; +f_dec_usage(mem, sp, a0); +goto L43ebdc; +a0 = s0; +L43ebdc: +gp = MEM_U32(sp + 176); +t6 = s0 << 2; +t7 = 0x10019830; +t6 = t6 - s0; +t6 = t6 << 2; +v0 = t6 + t7; +t8 = MEM_U16(v0 + 4); +//nop; +if (t8 != 0) {ra = MEM_U32(sp + 180); +goto L43ed78;} +ra = MEM_U32(sp + 180); +t9 = MEM_U8(v0 + 7); +//nop; +if (t9 == 0) {//nop; +goto L43ed54;} +//nop; +//nop; +a1 = 0x10019db0; +a0 = s0; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43ec24; +a0 = s0; +L43ec24: +gp = MEM_U32(sp + 176); +if (v0 != 0) {a0 = 0x4; +goto L43ed3c;} +a0 = 0x4; +t0 = 0x1000aaa8; +a1 = 0x3a9; +t0 = t0; +t2 = t0 + 0x48; +t3 = sp; +L43ec44: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 4 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 7($t3) +goto L43ec44;} +//swr $at, 7($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t4 = 0x1000aa58; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +t4 = t4; +MEM_U8(t3 + 12 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 12 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 12 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 12 + 3) = (uint8_t)(t2 >> 0); +t6 = t4 + 0x48; +t7 = sp; +//swr $t2, 0xf($t3) +L43ecb4: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 0x57($t7) +goto L43ecb4;} +//swr $at, 0x57($t7) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43ed30; +//nop; +L43ed30: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43ed78; +ra = MEM_U32(sp + 180); +L43ed3c: +//nop; +a1 = 0x10019dac; +a0 = s0; +f_append_to_list(mem, sp, a0, a1); +goto L43ed4c; +a0 = s0; +L43ed4c: +gp = MEM_U32(sp + 176); +//nop; +L43ed54: +//nop; +a3 = MEM_U8(sp + 191); +a0 = s0; +a1 = zero; +a2 = zero; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43ed6c; +a2 = zero; +L43ed6c: +gp = MEM_U32(sp + 176); +//nop; +ra = MEM_U32(sp + 180); +L43ed78: +s0 = MEM_U32(sp + 172); +sp = sp + 0xb8; +return; +sp = sp + 0xb8; +} + +static void f_force_free_reg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43ed84: +//force_free_reg: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 32) = a0; +t6 = MEM_U8(sp + 35); +t8 = 0x10019830; +t7 = t6 << 2; +t7 = t7 - t6; +t7 = t7 << 2; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t9 = t7 + t8; +t0 = MEM_U8(t9 + 7); +//nop; +if (t0 == 0) {//nop; +goto L43ee00;} +//nop; +//nop; +a1 = 0x10019da8; +a0 = t6; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43edd8; +a0 = t6; +L43edd8: +gp = MEM_U32(sp + 24); +if (v0 == 0) {ra = MEM_U32(sp + 28); +goto L43ee24;} +ra = MEM_U32(sp + 28); +//nop; +a0 = MEM_U8(sp + 35); +a1 = 0x10019da4; +//nop; +f_append_to_list(mem, sp, a0, a1); +goto L43edf8; +//nop; +L43edf8: +gp = MEM_U32(sp + 24); +//nop; +L43ee00: +//nop; +a0 = MEM_U8(sp + 35); +a1 = zero; +a2 = zero; +a3 = 0x1; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43ee18; +a3 = 0x1; +L43ee18: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L43ee24: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void f_add_to_free_list(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43ee30: +//add_to_free_list: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 192) = a0; +t6 = MEM_U8(sp + 195); +t8 = 0x10019830; +t7 = t6 << 2; +t7 = t7 - t6; +t7 = t7 << 2; +v0 = t7 + t8; +t9 = MEM_U16(v0 + 4); +MEM_U32(sp + 180) = ra; +if (t9 == 0) {MEM_U32(sp + 176) = gp; +goto L43ef7c;} +MEM_U32(sp + 176) = gp; +t0 = 0x1000ab48; +a0 = 0x4; +t0 = t0; +t2 = t0 + 0x48; +a1 = 0x3c7; +t3 = sp; +L43ee84: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 4 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 7($t3) +goto L43ee84;} +//swr $at, 7($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t4 = 0x1000aaf8; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +t4 = t4; +MEM_U8(t3 + 12 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 12 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 12 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 12 + 3) = (uint8_t)(t2 >> 0); +t6 = t4 + 0x48; +t7 = sp; +//swr $t2, 0xf($t3) +L43eef4: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 0x57($t7) +goto L43eef4;} +//swr $at, 0x57($t7) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +MEM_U32(sp + 188) = v0; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43ef70; +MEM_U32(sp + 188) = v0; +L43ef70: +gp = MEM_U32(sp + 176); +v0 = MEM_U32(sp + 188); +//nop; +L43ef7c: +//nop; +a0 = MEM_U8(sp + 195); +a1 = zero; +a2 = zero; +a3 = 0x1; +MEM_U32(sp + 188) = v0; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43ef98; +MEM_U32(sp + 188) = v0; +L43ef98: +v0 = MEM_U32(sp + 188); +gp = MEM_U32(sp + 176); +t8 = 0x1; +MEM_U8(v0 + 7) = (uint8_t)t8; +//nop; +a0 = MEM_U8(sp + 195); +a1 = 0x10019da4; +//nop; +f_append_to_list(mem, sp, a0, a1); +goto L43efbc; +//nop; +L43efbc: +ra = MEM_U32(sp + 180); +gp = MEM_U32(sp + 176); +sp = sp + 0xc0; +return; +sp = sp + 0xc0; +} + +static void f_add_to_fp_free_list(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43efcc: +//add_to_fp_free_list: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 192) = a0; +t6 = MEM_U8(sp + 195); +t8 = 0x10019830; +t7 = t6 << 2; +t7 = t7 - t6; +t7 = t7 << 2; +v0 = t7 + t8; +t9 = MEM_U16(v0 + 4); +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +if (t9 == 0) {MEM_U32(sp + 196) = a1; +goto L43f11c;} +MEM_U32(sp + 196) = a1; +t0 = 0x1000abe8; +a0 = 0x4; +t0 = t0; +t2 = t0 + 0x48; +a1 = 0x3d1; +t3 = sp; +L43f024: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 4 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 7($t3) +goto L43f024;} +//swr $at, 7($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t4 = 0x1000ab98; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +t4 = t4; +MEM_U8(t3 + 12 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 12 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 12 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 12 + 3) = (uint8_t)(t2 >> 0); +t6 = t4 + 0x48; +t7 = sp; +//swr $t2, 0xf($t3) +L43f094: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 0x57($t7) +goto L43f094;} +//swr $at, 0x57($t7) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +MEM_U32(sp + 188) = v0; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43f110; +MEM_U32(sp + 188) = v0; +L43f110: +gp = MEM_U32(sp + 176); +v0 = MEM_U32(sp + 188); +//nop; +L43f11c: +//nop; +a0 = MEM_U8(sp + 195); +a3 = MEM_U8(sp + 199); +a1 = zero; +a2 = zero; +MEM_U32(sp + 188) = v0; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43f138; +MEM_U32(sp + 188) = v0; +L43f138: +v0 = MEM_U32(sp + 188); +gp = MEM_U32(sp + 176); +t8 = 0x1; +MEM_U8(v0 + 7) = (uint8_t)t8; +//nop; +a0 = MEM_U8(sp + 195); +a1 = 0x10019dac; +//nop; +f_append_to_list(mem, sp, a0, a1); +goto L43f15c; +//nop; +L43f15c: +ra = MEM_U32(sp + 180); +gp = MEM_U32(sp + 176); +sp = sp + 0xc0; +return; +sp = sp + 0xc0; +} + +static void f_remove_from_free_list(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43f16c: +//remove_from_free_list: +//nop; +//nop; +//nop; +t6 = a0 << 2; +t7 = 0x10019830; +t6 = t6 - a0; +t6 = t6 << 2; +v1 = t6 + t7; +t8 = MEM_U8(v1 + 7); +sp = sp + 0xffffff38; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +if (t8 == 0) {MEM_U32(sp + 200) = a0; +goto L43f2dc;} +MEM_U32(sp + 200) = a0; +//nop; +a1 = 0x10019da4; +MEM_U32(sp + 192) = v1; +MEM_U8(sp + 203) = (uint8_t)a0; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43f1b8; +MEM_U8(sp + 203) = (uint8_t)a0; +L43f1b8: +gp = MEM_U32(sp + 176); +v1 = MEM_U32(sp + 192); +a0 = MEM_U8(sp + 203); +if (v0 != 0) {a1 = 0x3de; +goto L43f2d8;} +a1 = 0x3de; +t9 = 0x1000ad28; +a0 = 0x4; +t9 = t9; +t1 = t9 + 0x48; +t2 = sp; +L43f1e0: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t2 = t2 + 0xc; +MEM_U8(t2 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t2) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t2 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 4 + 3) = (uint8_t)(at >> 0); +if (t9 != t1) {//swr $at, 7($t2) +goto L43f1e0;} +//swr $at, 7($t2) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t3 = 0x1000acd8; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +t1 = t9 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t9) +t3 = t3; +MEM_U8(t2 + 12 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t2 + 12 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t2 + 12 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t2 + 12 + 3) = (uint8_t)(t1 >> 0); +t5 = t3 + 0x48; +t6 = sp; +//swr $t1, 0xf($t2) +L43f250: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t6 = t6 + 0xc; +MEM_U8(t6 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t6) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t6 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 84 + 3) = (uint8_t)(at >> 0); +if (t3 != t5) {//swr $at, 0x57($t6) +goto L43f250;} +//swr $at, 0x57($t6) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +//nop; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +//nop; +MEM_U8(t6 + 92 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t6 + 92 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t6 + 92 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t6 + 92 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x5f($t6) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43f2cc; +//nop; +L43f2cc: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43f4a4; +ra = MEM_U32(sp + 180); +L43f2d8: +MEM_U8(v1 + 7) = (uint8_t)zero; +L43f2dc: +//nop; +a1 = zero; +a2 = zero; +a3 = 0x1; +MEM_U32(sp + 192) = v1; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43f2f4; +MEM_U32(sp + 192) = v1; +L43f2f4: +gp = MEM_U32(sp + 176); +v1 = MEM_U32(sp + 192); +t7 = 0x10018ecc; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != 0) {ra = MEM_U32(sp + 180); +goto L43f4a4;} +ra = MEM_U32(sp + 180); +t8 = MEM_U8(v1 + 8); +at = 0x6; +if (t8 != at) {ra = MEM_U32(sp + 180); +goto L43f4a4;} +ra = MEM_U32(sp + 180); +a0 = MEM_U8(v1 + 9); +t1 = 0x10019830; +t0 = a0 << 2; +t0 = t0 - a0; +t0 = t0 << 2; +a2 = t0 + t1; +t9 = MEM_U8(a2 + 7); +//nop; +if (t9 == 0) {//nop; +goto L43f484;} +//nop; +//nop; +a1 = 0x10019da4; +MEM_U8(sp + 199) = (uint8_t)a0; +MEM_U32(sp + 188) = a2; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43f360; +MEM_U32(sp + 188) = a2; +L43f360: +gp = MEM_U32(sp + 176); +a0 = MEM_U8(sp + 199); +a2 = MEM_U32(sp + 188); +if (v0 != 0) {a1 = 0x3e8; +goto L43f480;} +a1 = 0x3e8; +t2 = 0x1000ac88; +a0 = 0x4; +t2 = t2; +t5 = t2 + 0x48; +t3 = sp; +L43f388: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t3 = t3 + 0xc; +MEM_U8(t3 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t3) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t3 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 4 + 3) = (uint8_t)(at >> 0); +if (t2 != t5) {//swr $at, 7($t3) +goto L43f388;} +//swr $at, 7($t3) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t6 = 0x1000ac38; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +t5 = t2 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t2) +t6 = t6; +MEM_U8(t3 + 12 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t3 + 12 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t3 + 12 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t3 + 12 + 3) = (uint8_t)(t5 >> 0); +t8 = t6 + 0x48; +t0 = sp; +//swr $t5, 0xf($t3) +L43f3f8: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t0 = t0 + 0xc; +MEM_U8(t0 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t0) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t0 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 84 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 0x57($t0) +goto L43f3f8;} +//swr $at, 0x57($t0) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +//nop; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +//nop; +MEM_U8(t0 + 92 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t0 + 92 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t0 + 92 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t0 + 92 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x5f($t0) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43f474; +//nop; +L43f474: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43f4a4; +ra = MEM_U32(sp + 180); +L43f480: +MEM_U8(a2 + 7) = (uint8_t)zero; +L43f484: +//nop; +a1 = zero; +a2 = zero; +a3 = 0x1; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43f498; +a3 = 0x1; +L43f498: +gp = MEM_U32(sp + 176); +//nop; +ra = MEM_U32(sp + 180); +L43f4a4: +sp = sp + 0xc8; +//nop; +return; +//nop; +} + +static void f_remove_from_fp_free_list(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43f4b0: +//remove_from_fp_free_list: +//nop; +//nop; +//nop; +t6 = a0 << 2; +t7 = 0x10019830; +t6 = t6 - a0; +t6 = t6 << 2; +sp = sp + 0xffffff40; +v1 = t6 + t7; +t8 = MEM_U8(v1 + 7); +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 192) = a0; +if (t8 == 0) {MEM_U32(sp + 196) = a1; +goto L43f624;} +MEM_U32(sp + 196) = a1; +//nop; +a1 = 0x10019dac; +MEM_U32(sp + 188) = v1; +MEM_U8(sp + 195) = (uint8_t)a0; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43f500; +MEM_U8(sp + 195) = (uint8_t)a0; +L43f500: +gp = MEM_U32(sp + 176); +v1 = MEM_U32(sp + 188); +a0 = MEM_U8(sp + 195); +if (v0 != 0) {a1 = 0x3f5; +goto L43f620;} +a1 = 0x3f5; +t9 = 0x1000adc8; +a0 = 0x4; +t9 = t9; +t1 = t9 + 0x48; +t2 = sp; +L43f528: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t2 = t2 + 0xc; +MEM_U8(t2 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t2) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t2 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 4 + 3) = (uint8_t)(at >> 0); +if (t9 != t1) {//swr $at, 7($t2) +goto L43f528;} +//swr $at, 7($t2) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t3 = 0x1000ad78; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +t1 = t9 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t9) +t3 = t3; +MEM_U8(t2 + 12 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t2 + 12 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t2 + 12 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t2 + 12 + 3) = (uint8_t)(t1 >> 0); +t5 = t3 + 0x48; +t6 = sp; +//swr $t1, 0xf($t2) +L43f598: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t6 = t6 + 0xc; +MEM_U8(t6 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t6) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t6 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 84 + 3) = (uint8_t)(at >> 0); +if (t3 != t5) {//swr $at, 0x57($t6) +goto L43f598;} +//swr $at, 0x57($t6) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +//nop; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +//nop; +MEM_U8(t6 + 92 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t6 + 92 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t6 + 92 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t6 + 92 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x5f($t6) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43f614; +//nop; +L43f614: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L43f644; +ra = MEM_U32(sp + 180); +L43f620: +MEM_U8(v1 + 7) = (uint8_t)zero; +L43f624: +//nop; +a3 = MEM_U8(sp + 199); +a1 = zero; +a2 = zero; +f_fill_reg(mem, sp, a0, a1, a2, a3); +goto L43f638; +a2 = zero; +L43f638: +gp = MEM_U32(sp + 176); +//nop; +ra = MEM_U32(sp + 180); +L43f644: +sp = sp + 0xc0; +//nop; +return; +//nop; +} + +static uint32_t f_is_available(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43f650: +//is_available: +//nop; +//nop; +//nop; +t6 = a0 << 2; +t7 = 0x10019830; +t6 = t6 - a0; +t6 = t6 << 2; +MEM_U32(sp + 0) = a0; +t8 = t6 + t7; +v0 = MEM_U8(t8 + 7); +//nop; +return v0; +//nop; +} + +static void f_check_no_used(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43f680: +//check_no_used: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffff48; +MEM_U32(sp + 180) = ra; +a0 = 0x10019da8; +MEM_U32(sp + 176) = gp; +v0 = f_list_is_empty(mem, sp, a0); +goto L43f6a4; +MEM_U32(sp + 176) = gp; +L43f6a4: +gp = MEM_U32(sp + 176); +if (v0 != 0) {//nop; +goto L43f7d0;} +//nop; +//nop; +a0 = 0x10019da8; +//nop; +f_print_regs(mem, sp, a0); +goto L43f6c0; +//nop; +L43f6c0: +gp = MEM_U32(sp + 176); +a0 = 0x4; +t6 = 0x1000af08; +a1 = 0x407; +t6 = t6; +t8 = t6 + 0x48; +t9 = sp; +L43f6dc: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 7($t9) +goto L43f6dc;} +//swr $at, 7($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t0 = 0x1000aeb8; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +t0 = t0; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t0 + 0x48; +t3 = sp; +//swr $t8, 0xf($t9) +L43f74c: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 0x57($t3) +goto L43f74c;} +//swr $at, 0x57($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43f7c8; +//nop; +L43f7c8: +gp = MEM_U32(sp + 176); +//nop; +L43f7d0: +//nop; +a0 = 0x10019db0; +//nop; +v0 = f_list_is_empty(mem, sp, a0); +goto L43f7e0; +//nop; +L43f7e0: +gp = MEM_U32(sp + 176); +if (v0 != 0) {a0 = 0x4; +goto L43f90c;} +a0 = 0x4; +t4 = 0x1000ae68; +a1 = 0x40a; +t4 = t4; +t7 = t4 + 0x48; +t8 = sp; +L43f800: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t8 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t8) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t8 = t8 + 0xc; +MEM_U8(t8 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t8) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t8 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 4 + 3) = (uint8_t)(at >> 0); +if (t4 != t7) {//swr $at, 7($t8) +goto L43f800;} +//swr $at, 7($t8) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t6 = 0x1000ae18; +MEM_U8(t8 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t8) +t7 = t4 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t4) +t6 = t6; +MEM_U8(t8 + 12 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t8 + 12 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t8 + 12 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t8 + 12 + 3) = (uint8_t)(t7 >> 0); +t1 = t6 + 0x48; +t2 = sp; +//swr $t7, 0xf($t8) +L43f870: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t2 = t2 + 0xc; +MEM_U8(t2 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t2) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t2 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 84 + 3) = (uint8_t)(at >> 0); +if (t6 != t1) {//swr $at, 0x57($t2) +goto L43f870;} +//swr $at, 0x57($t2) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +//nop; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +t1 = t6 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t6) +//nop; +MEM_U8(t2 + 92 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t2 + 92 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t2 + 92 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t2 + 92 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0x5f($t2) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L43f8ec; +//nop; +L43f8ec: +gp = MEM_U32(sp + 176); +//nop; +//nop; +a0 = 0x10019db0; +//nop; +f_print_regs(mem, sp, a0); +goto L43f904; +//nop; +L43f904: +gp = MEM_U32(sp + 176); +//nop; +L43f90c: +ra = MEM_U32(sp + 180); +sp = sp + 0xb8; +//nop; +return; +//nop; +} + +static uint32_t f_usage_count(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43f91c: +//usage_count: +//nop; +//nop; +//nop; +t6 = a0 << 2; +t7 = 0x10019830; +t6 = t6 - a0; +t6 = t6 << 2; +MEM_U32(sp + 0) = a0; +t8 = t6 + t7; +v0 = MEM_U16(t8 + 4); +//nop; +return v0; +//nop; +} + +static void f_move_to_end_fp_list(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43f94c: +//move_to_end_fp_list: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 28) = ra; +a0 = MEM_U8(sp + 35); +a1 = 0x10019db0; +MEM_U32(sp + 24) = gp; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43f978; +MEM_U32(sp + 24) = gp; +L43f978: +gp = MEM_U32(sp + 24); +if (v0 == 0) {ra = MEM_U32(sp + 28); +goto L43f9a4;} +ra = MEM_U32(sp + 28); +//nop; +a0 = MEM_U8(sp + 35); +a1 = 0x10019db0; +//nop; +f_append_to_list(mem, sp, a0, a1); +goto L43f998; +//nop; +L43f998: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L43f9a4: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void f_move_to_end_gp_list(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L43f9b0: +//move_to_end_gp_list: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 28) = ra; +a0 = MEM_U8(sp + 35); +a1 = 0x10019da8; +MEM_U32(sp + 24) = gp; +v0 = f_remove_from_list(mem, sp, a0, a1); +goto L43f9dc; +MEM_U32(sp + 24) = gp; +L43f9dc: +gp = MEM_U32(sp + 24); +if (v0 == 0) {ra = MEM_U32(sp + 28); +goto L43fa08;} +ra = MEM_U32(sp + 28); +//nop; +a0 = MEM_U8(sp + 35); +a1 = 0x10019da8; +//nop; +f_append_to_list(mem, sp, a0, a1); +goto L43f9fc; +//nop; +L43f9fc: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L43fa08: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void f_report_error(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L43ff28: +//report_error: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 40) = a0; +t6 = MEM_U8(sp + 43); +t8 = 0x1001a020; +t7 = t6 << 2; +v0 = t7 + t8; +t9 = MEM_U32(v0 + 0); +t1 = MEM_U8(sp + 43); +at = 0x2; +t0 = t9 + 0x1; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 20) = s0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +if (t1 != at) {MEM_U32(v0 + 0) = t0; +goto L43ff94;} +MEM_U32(v0 + 0) = t0; +t2 = 0x10018dfc; +//nop; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L440150;} +//nop; +L43ff94: +s0 = 0x10006560; +a1 = 0x1000b0e5; +//nop; +a0 = MEM_U32(s0 + 0); +a2 = 0x6; +a3 = 0x6; +MEM_U32(sp + 36) = v0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L43ffb8; +a1 = a1; +L43ffb8: +gp = MEM_U32(sp + 24); +t3 = MEM_U8(sp + 43); +t5 = 0x100058b0; +t4 = t3 << 2; +//nop; +t4 = t4 + t3; +t4 = t4 << 1; +a0 = MEM_U32(s0 + 0); +a2 = 0xa; +a3 = 0xa; +a1 = t4 + t5; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L43ffe8; +a1 = t4 + t5; +L43ffe8: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +a1 = 0x1000b0cf; +//nop; +a2 = 0x16; +a3 = 0x16; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L440008; +a1 = a1; +L440008: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +a1 = 0x10018e00; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = zero; +a3 = 0xa; +f_write_cardinal(mem, sp, a0, a1, a2, a3); +goto L440028; +a3 = 0xa; +L440028: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +a1 = 0x1000b0b7; +//nop; +a2 = 0x18; +a3 = 0x18; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L440048; +a1 = a1; +L440048: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +//nop; +a1 = sp + 0x30; +a2 = 0x50; +a3 = zero; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L440064; +a3 = zero; +L440064: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +a1 = 0x1000b0b0; +//nop; +a2 = 0x7; +a3 = 0x7; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L440084; +a1 = a1; +L440084: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +//nop; +a1 = MEM_U32(sp + 44); +a2 = zero; +a3 = 0xa; +f_write_cardinal(mem, sp, a0, a1, a2, a3); +goto L4400a0; +a3 = 0xa; +L4400a0: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +//nop; +a1 = 0x29; +a2 = 0x1; +a3 = 0xa; +MEM_U32(sp + 32) = a0; +f_write_char(mem, sp, a0, a1, a2); +goto L4400c0; +MEM_U32(sp + 32) = a0; +L4400c0: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 32); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L4400d8; +//nop; +L4400d8: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +a1 = 0x1000b0a0; +//nop; +a2 = 0x10; +a3 = 0x10; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L4400f8; +a1 = a1; +L4400f8: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +//nop; +a1 = sp + 0x80; +a2 = 0x50; +a3 = zero; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L440114; +a3 = zero; +L440114: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44012c; +//nop; +L44012c: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +//nop; +//nop; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L440144; +//nop; +L440144: +gp = MEM_U32(sp + 24); +v0 = MEM_U32(sp + 36); +//nop; +L440150: +t6 = 0x1001a020; +//nop; +t6 = t6 + 0x10; +if (v0 != t6) {ra = MEM_U32(sp + 28); +goto L440198;} +ra = MEM_U32(sp + 28); +t7 = 0x10018ed4; +//nop; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 != 0) {ra = MEM_U32(sp + 28); +goto L440198;} +ra = MEM_U32(sp + 28); +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L44018c; +//nop; +L44018c: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L440198: +s0 = MEM_U32(sp + 20); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static uint32_t f_has_errors(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4401a4: +//has_errors: +//nop; +//nop; +//nop; +at = a0 < 0x2; +if (at != 0) {//nop; +goto L440204;} +//nop; +v0 = 0x1001a020; +//nop; +v1 = MEM_U32(v0 + 16); +//nop; +t6 = zero < v1; +if (t6 == 0) {v1 = t6; +goto L4401fc;} +v1 = t6; +v1 = MEM_U32(v0 + 8); +//nop; +t7 = zero < v1; +if (t7 == 0) {v1 = t7; +goto L4401fc;} +v1 = t7; +v1 = MEM_U32(v0 + 12); +//nop; +t8 = zero < v1; +v1 = t8; +L4401fc: +v0 = v1; +return v0; +v0 = v1; +L440204: +v0 = 0x1001a020; +//nop; +v1 = MEM_U32(v0 + 16); +//nop; +t9 = zero < v1; +if (t9 == 0) {v1 = t9; +goto L440230;} +v1 = t9; +v1 = MEM_U32(v0 + 12); +//nop; +t0 = zero < v1; +v1 = t0; +L440230: +v0 = v1; +//nop; +return v0; +//nop; +} + +static uint32_t f_sym_hash(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L440368: +//sym_hash: +v0 = a0 & 0xff; +return v0; +v0 = a0 & 0xff; +} + +static uint32_t f_get_data_area(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L440370: +//get_data_area: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +v0 = MEM_U16(a0 + 2); +at = 0x1; +t6 = v0 & 0xf0; +v0 = t6 >> 4; +if (v0 != 0) {//nop; +goto L4403a8;} +//nop; +v0 = zero; +goto L440514; +v0 = zero; +L4403a8: +if (v0 != at) {at = 0x2; +goto L4403bc;} +at = 0x2; +v0 = 0x1; +goto L440514; +v0 = 0x1; +at = 0x2; +L4403bc: +if (v0 != at) {at = 0x3; +goto L4403d0;} +at = 0x3; +v0 = 0x2; +goto L440514; +v0 = 0x2; +at = 0x3; +L4403d0: +if (v0 != at) {at = 0x4; +goto L4403e4;} +at = 0x4; +v0 = 0x3; +goto L440514; +v0 = 0x3; +at = 0x4; +L4403e4: +if (v0 != at) {at = 0x5; +goto L4403f8;} +at = 0x5; +v0 = 0x4; +goto L440514; +v0 = 0x4; +at = 0x5; +L4403f8: +if (v0 != at) {a0 = 0x4; +goto L440408;} +a0 = 0x4; +v0 = 0x5; +goto L440514; +v0 = 0x5; +L440408: +t8 = 0x1000b1e0; +a1 = 0x87; +t8 = t8; +t0 = t8 + 0x48; +t1 = sp; +L44041c: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t1 = t1 + 0xc; +MEM_U8(t1 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t1) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t1 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 4 + 3) = (uint8_t)(at >> 0); +if (t8 != t0) {//swr $at, 7($t1) +goto L44041c;} +//swr $at, 7($t1) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t2 = 0x1000b190; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +t0 = t8 + 4; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 7($t8) +t2 = t2; +MEM_U8(t1 + 12 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(t1 + 12 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(t1 + 12 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(t1 + 12 + 3) = (uint8_t)(t0 >> 0); +t4 = t2 + 0x48; +t5 = sp; +//swr $t0, 0xf($t1) +L44048c: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t5 = t5 + 0xc; +MEM_U8(t5 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t5) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t5 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 84 + 3) = (uint8_t)(at >> 0); +if (t2 != t4) {//swr $at, 0x57($t5) +goto L44048c;} +//swr $at, 0x57($t5) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +//nop; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +t4 = t2 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t2) +//nop; +MEM_U8(t5 + 92 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t5 + 92 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t5 + 92 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t5 + 92 + 3) = (uint8_t)(t4 >> 0); +//swr $t4, 0x5f($t5) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L440508; +//nop; +L440508: +gp = MEM_U32(sp + 176); +v0 = MEM_U8(sp + 191); +//nop; +L440514: +ra = MEM_U32(sp + 180); +sp = sp + 0xc0; +//nop; +return v0; +//nop; +} + +static uint32_t f_get_sym_type(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L440524: +//get_sym_type: +v0 = MEM_U8(a0 + 0); +at = 0x53; +if (v0 == at) {at = 0x27; +goto L44053c;} +at = 0x27; +if (v0 != at) {at = 0x2a; +goto L440548;} +at = 0x2a; +L44053c: +v0 = 0x4; +return v0; +v0 = 0x4; +at = 0x2a; +L440548: +if (v0 != at) {at = 0x98; +goto L44055c;} +at = 0x98; +v0 = 0x2; +return v0; +v0 = 0x2; +at = 0x98; +L44055c: +if (v0 != at) {at = 0x99; +goto L440570;} +at = 0x99; +v0 = 0x3; +return v0; +v0 = 0x3; +at = 0x99; +L440570: +if (v0 != at) {at = 0x96; +goto L440584;} +at = 0x96; +v0 = 0x6; +return v0; +v0 = 0x6; +at = 0x96; +L440584: +if (v0 != at) {at = 0x24; +goto L440598;} +at = 0x24; +v0 = 0x5; +return v0; +v0 = 0x5; +at = 0x24; +L440598: +if (v0 != at) {at = 0x6; +goto L4405ac;} +at = 0x6; +v0 = 0x1; +return v0; +v0 = 0x1; +at = 0x6; +L4405ac: +if (v0 != at) {at = 0x14; +goto L4405c0;} +at = 0x14; +v0 = 0x8; +return v0; +v0 = 0x8; +at = 0x14; +L4405c0: +if (v0 != at) {at = 0x21; +goto L4405d4;} +at = 0x21; +v0 = 0x7; +return v0; +v0 = 0x7; +at = 0x21; +L4405d4: +if (v0 != at) {v0 = zero; +goto L4405e8;} +v0 = zero; +v0 = 0x9; +return v0; +v0 = 0x9; +v0 = zero; +L4405e8: +//nop; +return v0; +//nop; +} + +static uint32_t f_make_new_sym(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L4405f0: +//make_new_sym: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +//nop; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 192) = a0; +MEM_U32(sp + 196) = a1; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 200) = a2; +a1 = 0x1; +a0 = 0x2c; +v0 = f_new(mem, sp, a0, a1); +goto L440624; +a0 = 0x2c; +L440624: +gp = MEM_U32(sp + 176); +if (v0 != 0) {v1 = v0; +goto L440744;} +v1 = v0; +t6 = 0x1000b280; +a0 = 0x4; +t6 = t6; +t8 = t6 + 0x48; +a1 = 0xad; +t9 = sp; +L440648: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 7($t9) +goto L440648;} +//swr $at, 7($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t0 = 0x1000b230; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +t0 = t0; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t0 + 0x48; +t3 = sp; +//swr $t8, 0xf($t9) +L4406b8: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 0x57($t3) +goto L4406b8;} +//swr $at, 0x57($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +MEM_U32(sp + 184) = v1; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L440734; +MEM_U32(sp + 184) = v1; +L440734: +gp = MEM_U32(sp + 176); +v0 = MEM_U32(sp + 184); +ra = MEM_U32(sp + 180); +goto L4407bc; +ra = MEM_U32(sp + 180); +L440744: +//nop; +a0 = MEM_U32(sp + 192); +MEM_U32(sp + 184) = v1; +v0 = f_sym_hash(mem, sp, a0); +goto L440754; +MEM_U32(sp + 184) = v1; +L440754: +v1 = MEM_U32(sp + 184); +gp = MEM_U32(sp + 176); +t4 = v0 & 0xff; +t7 = 0x1001a040; +t5 = t4 << 2; +a0 = t5 + t7; +t8 = MEM_U32(a0 + 0); +t6 = MEM_U8(sp + 199); +t9 = MEM_U32(sp + 192); +t1 = MEM_U8(sp + 203); +MEM_U8(v1 + 13) = (uint8_t)zero; +MEM_U8(v1 + 14) = (uint8_t)zero; +MEM_U32(v1 + 16) = zero; +MEM_U32(v1 + 20) = zero; +MEM_U32(v1 + 28) = zero; +MEM_U32(v1 + 32) = zero; +MEM_U32(v1 + 36) = zero; +MEM_U32(v1 + 40) = zero; +MEM_U32(v1 + 4) = zero; +MEM_U32(a0 + 0) = v1; +v0 = v1; +MEM_U32(v1 + 8) = t8; +MEM_U8(v1 + 12) = (uint8_t)t6; +MEM_U32(v1 + 0) = t9; +MEM_U8(v1 + 24) = (uint8_t)t1; +ra = MEM_U32(sp + 180); +L4407bc: +sp = sp + 0xc0; +//nop; +return v0; +//nop; +} + +static uint32_t f_change_sym_type(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4407c8: +//change_sym_type: +at = 0x1; +MEM_U32(sp + 0) = a0; +if (a0 == at) {MEM_U32(sp + 4) = a1; +goto L4407f0;} +MEM_U32(sp + 4) = a1; +at = 0x4; +if (a0 != at) {v0 = a0; +goto L4407f8;} +v0 = a0; +at = 0x7; +if (a1 != at) {//nop; +goto L4407f8;} +//nop; +L4407f0: +v0 = a1; +return v0; +v0 = a1; +L4407f8: +//nop; +return v0; +//nop; +} + +static uint32_t f_lookup_sym(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L440800: +//lookup_sym: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +v0 = f_sym_hash(mem, sp, a0); +goto L440824; +MEM_U32(sp + 32) = a0; +L440824: +gp = MEM_U32(sp + 24); +t6 = v0 & 0xff; +t8 = 0x1001a040; +t7 = t6 << 2; +t9 = t7 + t8; +v1 = MEM_U32(t9 + 0); +a0 = MEM_U32(sp + 32); +ra = MEM_U32(sp + 28); +if (v1 == 0) {v0 = v1; +goto L440878;} +v0 = v1; +L44084c: +t0 = MEM_U32(v1 + 0); +//nop; +if (a0 != t0) {//nop; +goto L440864;} +//nop; +v0 = v1; +goto L440878; +v0 = v1; +L440864: +v1 = MEM_U32(v1 + 8); +//nop; +if (v1 != 0) {//nop; +goto L44084c;} +//nop; +v0 = v1; +L440878: +sp = sp + 0x20; +return v0; +sp = sp + 0x20; +} + +static void f_clear_sym_tab(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L440880: +//clear_sym_tab: +//nop; +//nop; +//nop; +v1 = 0x1001a040; +//nop; +v0 = v1 + 0x400; +L440898: +v1 = v1 + 0x10; +MEM_U32(v1 + -16) = zero; +MEM_U32(v1 + -12) = zero; +MEM_U32(v1 + -8) = zero; +if (v1 != v0) {MEM_U32(v1 + -4) = zero; +goto L440898;} +MEM_U32(v1 + -4) = zero; +//nop; +return; +//nop; +} + +static void f_gen_sym(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4408b8: +//gen_sym: +//nop; +//nop; +//nop; +sp = sp + 0xffffff38; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 172) = s0; +v0 = MEM_U8(a0 + 0); +s0 = a0; +at = v0 < 0x2c; +if (at != 0) {at = 0x53; +goto L441060;} +at = 0x53; +if (v0 == at) {//nop; +goto L440c24;} +//nop; +t6 = v0 + 0xffffff6a; +at = t6 < 0x4; +if (at == 0) {//nop; +goto L440f50;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000b57c[] = { +&&L440d74, +&&L440f50, +&&L440c24, +&&L4410a8, +}; +dest = Lswitch1000b57c[t6]; +//nop; +goto *dest; +//nop; +L440920: +t7 = MEM_U32(s0 + 12); +a3 = 0x9; +t8 = t7 & 0x1; +if (t8 == 0) {a2 = zero; +goto L44093c;} +a2 = zero; +a3 = 0xa; +goto L44093c; +a3 = 0xa; +L44093c: +//nop; +a0 = MEM_U32(s0 + 4); +a1 = a3; +v0 = f_make_new_sym(mem, sp, a0, a1, a2); +goto L44094c; +a1 = a3; +L44094c: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L4410ac; +ra = MEM_U32(sp + 180); +L440958: +t9 = MEM_U16(s0 + 2); +v1 = 0x1; +t0 = t9 & 0x1; +if (v1 != t0) {//nop; +goto L440998;} +//nop; +t1 = MEM_U32(s0 + 8); +//nop; +if (t1 != 0) {//nop; +goto L440998;} +//nop; +//nop; +a1 = MEM_U32(s0 + 4); +a0 = 0x12; +f_emit_dir0(mem, sp, a0, a1); +goto L44098c; +a0 = 0x12; +L44098c: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L4410ac; +ra = MEM_U32(sp + 180); +L440998: +//nop; +a0 = MEM_U32(s0 + 8); +//nop; +v0 = f_lookup_sym(mem, sp, a0); +goto L4409a8; +//nop; +L4409a8: +gp = MEM_U32(sp + 176); +if (v0 != 0) {v1 = v0; +goto L440ac4;} +v1 = v0; +t2 = 0x1000b500; +a0 = 0x4; +t2 = t2; +t4 = t2 + 0x48; +a1 = 0x100; +t5 = sp; +L4409cc: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t5 = t5 + 0xc; +MEM_U8(t5 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t5) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t5 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 4 + 3) = (uint8_t)(at >> 0); +if (t2 != t4) {//swr $at, 7($t5) +goto L4409cc;} +//swr $at, 7($t5) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t6 = 0x1000b4b0; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +t4 = t2 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t2) +t6 = t6; +MEM_U8(t5 + 12 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t5 + 12 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t5 + 12 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t5 + 12 + 3) = (uint8_t)(t4 >> 0); +t8 = t6 + 0x48; +t9 = sp; +//swr $t4, 0xf($t5) +L440a3c: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 84 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 0x57($t9) +goto L440a3c;} +//swr $at, 0x57($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +//nop; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +//nop; +MEM_U8(t9 + 92 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 92 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 92 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 92 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x5f($t9) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L440ab8; +//nop; +L440ab8: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L4410ac; +ra = MEM_U32(sp + 180); +L440ac4: +//nop; +a0 = 0xc; +a1 = zero; +MEM_U32(sp + 196) = v1; +v0 = f_new(mem, sp, a0, a1); +goto L440ad8; +MEM_U32(sp + 196) = v1; +L440ad8: +gp = MEM_U32(sp + 176); +v1 = MEM_U32(sp + 196); +if (v0 != 0) {a0 = 0x4; +goto L440bf4;} +a0 = 0x4; +t0 = 0x1000b460; +a1 = 0x105; +t0 = t0; +t3 = t0 + 0x48; +t4 = sp; +L440afc: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t4 = t4 + 0xc; +MEM_U8(t4 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t4) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t4 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 4 + 3) = (uint8_t)(at >> 0); +if (t0 != t3) {//swr $at, 7($t4) +goto L440afc;} +//swr $at, 7($t4) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t2 = 0x1000b410; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +t3 = t0 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t0) +t2 = t2; +MEM_U8(t4 + 12 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 12 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 12 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 12 + 3) = (uint8_t)(t3 >> 0); +t7 = t2 + 0x48; +t8 = sp; +//swr $t3, 0xf($t4) +L440b6c: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t8 = t8 + 0xc; +MEM_U8(t8 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t8) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t8 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 84 + 3) = (uint8_t)(at >> 0); +if (t2 != t7) {//swr $at, 0x57($t8) +goto L440b6c;} +//swr $at, 0x57($t8) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +//nop; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +t7 = t2 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t2) +//nop; +MEM_U8(t8 + 92 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t8 + 92 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t8 + 92 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t8 + 92 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x5f($t8) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L440be8; +//nop; +L440be8: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L4410ac; +ra = MEM_U32(sp + 180); +L440bf4: +t6 = MEM_U32(s0 + 4); +//nop; +MEM_U32(v0 + 0) = t6; +t9 = MEM_U16(s0 + 2); +//nop; +t1 = t9 & 0x1; +MEM_U32(v0 + 4) = t1; +t3 = MEM_U32(v1 + 40); +//nop; +MEM_U32(v0 + 8) = t3; +MEM_U32(v1 + 40) = v0; +goto L4410a8; +MEM_U32(v1 + 40) = v0; +L440c24: +t0 = MEM_U16(s0 + 2); +t4 = 0xf4; +at = (int)t0 < (int)t4; +if (at != 0) {//nop; +goto L440c3c;} +//nop; +abort(); +L440c3c: +//nop; +a0 = MEM_U32(s0 + 4); +//nop; +v0 = f_lookup_sym(mem, sp, a0); +goto L440c4c; +//nop; +L440c4c: +gp = MEM_U32(sp + 176); +a0 = s0; +//nop; +MEM_U32(sp + 196) = v0; +//nop; +v0 = f_get_sym_type(mem, sp, a0); +goto L440c64; +//nop; +L440c64: +v1 = MEM_U32(sp + 196); +gp = MEM_U32(sp + 176); +if (v1 != 0) {a3 = v0 & 0xff; +goto L440d00;} +a3 = v0 & 0xff; +//nop; +a0 = s0; +MEM_U8(sp + 191) = (uint8_t)a3; +v0 = f_get_data_area(mem, sp, a0); +goto L440c84; +MEM_U8(sp + 191) = (uint8_t)a3; +L440c84: +a3 = MEM_U8(sp + 191); +gp = MEM_U32(sp + 176); +v1 = 0x1; +if (a3 != v1) {a2 = v0 & 0xff; +goto L440ca4;} +a2 = v0 & 0xff; +t5 = v0 & 0xff; +if (t5 == v1) {ra = MEM_U32(sp + 180); +goto L4410ac;} +ra = MEM_U32(sp + 180); +L440ca4: +//nop; +a0 = MEM_U32(s0 + 4); +a1 = a3; +v0 = f_make_new_sym(mem, sp, a0, a1, a2); +goto L440cb4; +a1 = a3; +L440cb4: +a0 = MEM_U8(s0 + 0); +gp = MEM_U32(sp + 176); +at = 0x53; +if (a0 == at) {v1 = v0; +goto L440cdc;} +v1 = v0; +at = 0x27; +if (a0 == at) {at = 0x2a; +goto L440cdc;} +at = 0x2a; +if (a0 != at) {//nop; +goto L440d44;} +//nop; +L440cdc: +t7 = MEM_U16(s0 + 2); +at = 0xffffff0f; +t2 = t7 & at; +at = t2 < 0x2; +if (at == 0) {//nop; +goto L440cf8;} +//nop; +t2 = 0x2; +L440cf8: +MEM_U8(v0 + 14) = (uint8_t)t2; +goto L440d44; +MEM_U8(v0 + 14) = (uint8_t)t2; +L440d00: +//nop; +a1 = MEM_U8(v1 + 12); +a0 = a3; +MEM_U32(sp + 196) = v1; +v0 = f_change_sym_type(mem, sp, a0, a1); +goto L440d14; +MEM_U32(sp + 196) = v1; +L440d14: +v1 = MEM_U32(sp + 196); +at = 0xffffff0f; +MEM_U8(v1 + 12) = (uint8_t)v0; +t8 = MEM_U16(s0 + 2); +t9 = MEM_U8(v1 + 14); +t6 = t8 & at; +gp = MEM_U32(sp + 176); +at = t9 < t6; +if (at == 0) {//nop; +goto L440d40;} +//nop; +t9 = t6; +L440d40: +MEM_U8(v1 + 14) = (uint8_t)t9; +L440d44: +v0 = MEM_U32(s0 + 8); +//nop; +if (v0 == 0) {ra = MEM_U32(sp + 180); +goto L4410ac;} +ra = MEM_U32(sp + 180); +t1 = MEM_U32(v1 + 16); +//nop; +at = (int)t1 < (int)v0; +if (at == 0) {//nop; +goto L440d6c;} +//nop; +t1 = v0; +L440d6c: +MEM_U32(v1 + 16) = t1; +goto L4410a8; +MEM_U32(v1 + 16) = t1; +L440d74: +//nop; +a0 = MEM_U32(s0 + 4); +//nop; +v0 = f_lookup_sym(mem, sp, a0); +goto L440d84; +//nop; +L440d84: +gp = MEM_U32(sp + 176); +a0 = s0; +//nop; +MEM_U32(sp + 196) = v0; +//nop; +v0 = f_get_sym_type(mem, sp, a0); +goto L440d9c; +//nop; +L440d9c: +v1 = MEM_U32(sp + 196); +gp = MEM_U32(sp + 176); +if (v1 != 0) {a3 = v0 & 0xff; +goto L440dcc;} +a3 = v0 & 0xff; +//nop; +a0 = MEM_U32(s0 + 4); +a1 = a3; +a2 = zero; +v0 = f_make_new_sym(mem, sp, a0, a1, a2); +goto L440dc0; +a2 = zero; +L440dc0: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L4410ac; +ra = MEM_U32(sp + 180); +L440dcc: +//nop; +a1 = MEM_U8(v1 + 12); +a0 = a3; +MEM_U32(sp + 196) = v1; +v0 = f_change_sym_type(mem, sp, a0, a1); +goto L440de0; +MEM_U32(sp + 196) = v1; +L440de0: +v1 = MEM_U32(sp + 196); +gp = MEM_U32(sp + 176); +MEM_U8(v1 + 12) = (uint8_t)v0; +goto L4410a8; +MEM_U8(v1 + 12) = (uint8_t)v0; +L440df0: +//nop; +a0 = MEM_U32(s0 + 4); +//nop; +v0 = f_lookup_sym(mem, sp, a0); +goto L440e00; +//nop; +L440e00: +gp = MEM_U32(sp + 176); +if (v0 != 0) {a0 = 0x4; +goto L440f18;} +a0 = 0x4; +t3 = 0x1000b3c0; +a1 = 0x135; +t3 = t3; +t4 = t3 + 0x48; +t5 = sp; +L440e20: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t5 = t5 + 0xc; +MEM_U8(t5 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t5) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t5 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 4 + 3) = (uint8_t)(at >> 0); +if (t3 != t4) {//swr $at, 7($t5) +goto L440e20;} +//swr $at, 7($t5) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t7 = 0x1000b370; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +t4 = t3 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t3) +t7 = t7; +MEM_U8(t5 + 12 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t5 + 12 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t5 + 12 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t5 + 12 + 3) = (uint8_t)(t4 >> 0); +t8 = t7 + 0x48; +t6 = sp; +//swr $t4, 0xf($t5) +L440e90: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t6 = t6 + 0xc; +MEM_U8(t6 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t6) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t6 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 84 + 3) = (uint8_t)(at >> 0); +if (t7 != t8) {//swr $at, 0x57($t6) +goto L440e90;} +//swr $at, 0x57($t6) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +//nop; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +t8 = t7 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t7) +//nop; +MEM_U8(t6 + 92 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t6 + 92 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t6 + 92 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t6 + 92 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x5f($t6) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L440f0c; +//nop; +L440f0c: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L4410ac; +ra = MEM_U32(sp + 180); +L440f18: +t9 = 0x10018e60; +//nop; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == 0) {ra = MEM_U32(sp + 180); +goto L4410ac;} +ra = MEM_U32(sp + 180); +//nop; +a0 = MEM_U32(s0 + 8); +a2 = MEM_U32(s0 + 4); +a1 = 0x1; +f_demit_edata(mem, sp, a0, a1, a2); +goto L440f44; +a1 = 0x1; +L440f44: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L4410ac; +ra = MEM_U32(sp + 180); +L440f50: +t1 = 0x1000b320; +a0 = 0x4; +t1 = t1; +t4 = t1 + 0x48; +a1 = 0x146; +t3 = sp; +L440f68: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t3 = t3 + 0xc; +MEM_U8(t3 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t3) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t3 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 4 + 3) = (uint8_t)(at >> 0); +if (t1 != t4) {//swr $at, 7($t3) +goto L440f68;} +//swr $at, 7($t3) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t5 = 0x1000b2d0; +MEM_U8(t3 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t3) +t4 = t1 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t1) +t5 = t5; +MEM_U8(t3 + 12 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t3 + 12 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t3 + 12 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t3 + 12 + 3) = (uint8_t)(t4 >> 0); +t8 = t5 + 0x48; +t7 = sp; +//swr $t4, 0xf($t3) +L440fd8: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t5 != t8) {//swr $at, 0x57($t7) +goto L440fd8;} +//swr $at, 0x57($t7) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t8 = t5 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t5) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L441054; +//nop; +L441054: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L4410ac; +ra = MEM_U32(sp + 180); +L441060: +at = 0x6; +if (v0 == at) {//nop; +goto L440958;} +//nop; +at = 0x14; +if (v0 == at) {//nop; +goto L440c24;} +//nop; +t6 = v0 + 0xffffffdf; +at = t6 < 0xb; +if (at == 0) {//nop; +goto L440f50;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000b550[] = { +&&L440920, +&&L440f50, +&&L440f50, +&&L440c24, +&&L440f50, +&&L440f50, +&&L440c24, +&&L440f50, +&&L440f50, +&&L440c24, +&&L440df0, +}; +dest = Lswitch1000b550[t6]; +//nop; +goto *dest; +//nop; +L4410a8: +ra = MEM_U32(sp + 180); +L4410ac: +s0 = MEM_U32(sp + 172); +sp = sp + 0xc8; +return; +sp = sp + 0xc8; +} + +static void f_set_size(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44110c: +//set_size: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 36) = a1; +v0 = f_lookup_sym(mem, sp, a0); +goto L441130; +MEM_U32(sp + 36) = a1; +L441130: +t6 = MEM_U32(v0 + 16); +t7 = MEM_U32(sp + 36); +gp = MEM_U32(sp + 24); +at = t7 < t6; +if (at == 0) {//nop; +goto L44114c;} +//nop; +t7 = t6; +L44114c: +MEM_U32(v0 + 16) = t7; +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t f_some_init_overlap(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L441160: +//some_init_overlap: +v1 = MEM_U32(a0 + 28); +MEM_U32(sp + 8) = a2; +if (v1 != 0) {MEM_U32(sp + 12) = a3; +goto L441178;} +MEM_U32(sp + 12) = a3; +v0 = zero; +return v0; +v0 = zero; +L441178: +a1 = MEM_U32(a0 + 32); +a2 = MEM_U32(sp + 20); +t6 = MEM_U32(a1 + 16); +t7 = MEM_U32(a1 + 8); +a3 = MEM_U32(sp + 16); +t8 = t6 + t7; +at = (int)a2 < (int)t8; +if (at != 0) {v0 = a1; +goto L4411a0;} +v0 = a1; +v1 = v0; +L4411a0: +a0 = MEM_U32(sp + 24); +v0 = zero; +L4411a8: +t9 = MEM_U32(v1 + 16); +t0 = MEM_U32(v1 + 8); +//nop; +t1 = t9 + t0; +at = (int)a2 < (int)t1; +if (at == 0) {//nop; +goto L4411e0;} +//nop; +t2 = MEM_U32(v1 + 12); +t3 = a0 + a3; +at = (int)t2 < (int)t3; +if (at == 0) {//nop; +goto L4411e0;} +//nop; +v0 = v1; +return v0; +v0 = v1; +L4411e0: +if (v1 != a1) {//nop; +goto L4411f0;} +//nop; +v0 = 0x1; +goto L4411f8; +v0 = 0x1; +L4411f0: +v1 = MEM_U32(v1 + 32); +//nop; +L4411f8: +if (v0 == 0) {//nop; +goto L4411a8;} +//nop; +v0 = zero; +//nop; +return v0; +//nop; +} + +static void f_complex_init_duplicate_p(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44120c: +//complex_init_duplicate_p: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 36) = a1; +a2 = a0; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a2; +a0 = 0x28; +a1 = 0x1; +v0 = f_new(mem, sp, a0, a1); +goto L441240; +a1 = 0x1; +L441240: +a2 = MEM_U32(sp + 32); +v1 = MEM_U32(sp + 36); +t6 = MEM_U32(a2 + 32); +gp = MEM_U32(sp + 24); +MEM_U32(v0 + 32) = t6; +at = MEM_U32(a2 + 0); +//nop; +MEM_U32(v0 + 0) = at; +t8 = MEM_U32(a2 + 4); +//nop; +MEM_U32(v0 + 4) = t8; +at = MEM_U32(a2 + 8); +//nop; +MEM_U32(v0 + 8) = at; +t8 = MEM_U32(a2 + 12); +//nop; +MEM_U32(v0 + 12) = t8; +at = MEM_U32(a2 + 16); +//nop; +MEM_U32(v0 + 16) = at; +t8 = MEM_U32(a2 + 20); +//nop; +MEM_U32(v0 + 20) = t8; +at = MEM_U32(a2 + 24); +//nop; +MEM_U32(v0 + 24) = at; +t8 = MEM_U32(a2 + 28); +//nop; +MEM_U32(v0 + 28) = t8; +MEM_U32(a2 + 32) = v0; +t9 = MEM_U32(v1 + 32); +//nop; +if (a2 != t9) {ra = MEM_U32(sp + 28); +goto L4412d0;} +ra = MEM_U32(sp + 28); +MEM_U32(v1 + 32) = v0; +ra = MEM_U32(sp + 28); +L4412d0: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void f_complex_insert_init(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L44133c: +//complex_insert_init: +//nop; +//nop; +//nop; +sp = sp + 0xfffffeb0; +MEM_U32(sp + 212) = ra; +MEM_U32(sp + 208) = fp; +MEM_U32(sp + 204) = gp; +MEM_U32(sp + 200) = s7; +MEM_U32(sp + 196) = s6; +MEM_U32(sp + 192) = s5; +MEM_U32(sp + 188) = s4; +MEM_U32(sp + 184) = s3; +MEM_U32(sp + 180) = s2; +MEM_U32(sp + 176) = s1; +MEM_U32(sp + 172) = s0; +MEM_U32(sp + 344) = a2; +MEM_U32(sp + 348) = a3; +MEM_U32(sp + 304) = zero; +MEM_U32(sp + 308) = zero; +MEM_U32(sp + 312) = zero; +MEM_U32(sp + 316) = zero; +MEM_U32(sp + 320) = zero; +MEM_U32(sp + 324) = zero; +MEM_U32(sp + 328) = zero; +MEM_U32(sp + 332) = zero; +MEM_U32(sp + 272) = zero; +MEM_U32(sp + 280) = zero; +MEM_U32(sp + 284) = zero; +MEM_U32(sp + 288) = zero; +t7 = sp + 0x158; +at = MEM_U32(t7 + 0); +t6 = sp + 0x130; +MEM_U32(t6 + 0) = at; +t2 = MEM_U32(t7 + 4); +t3 = sp + 0x110; +MEM_U32(t6 + 4) = t2; +at = MEM_U32(t7 + 8); +s2 = a0; +MEM_U32(t6 + 8) = at; +t2 = MEM_U32(t7 + 12); +s6 = a1; +MEM_U32(t6 + 12) = t2; +at = MEM_U32(t7 + 16); +//nop; +MEM_U32(t6 + 16) = at; +t2 = MEM_U32(t7 + 20); +//nop; +MEM_U32(t6 + 20) = t2; +at = MEM_U32(t7 + 24); +//nop; +MEM_U32(t6 + 24) = at; +t2 = MEM_U32(t7 + 28); +//nop; +MEM_U32(t6 + 28) = t2; +at = MEM_U32(a0 + 0); +//nop; +MEM_U32(t3 + 0) = at; +t9 = MEM_U32(a0 + 4); +//nop; +MEM_U32(t3 + 4) = t9; +at = MEM_U32(a0 + 8); +//nop; +MEM_U32(t3 + 8) = at; +t9 = MEM_U32(a0 + 12); +//nop; +MEM_U32(t3 + 12) = t9; +at = MEM_U32(a0 + 16); +//nop; +MEM_U32(t3 + 16) = at; +t9 = MEM_U32(a0 + 20); +//nop; +MEM_U32(t3 + 20) = t9; +at = MEM_U32(a0 + 24); +//nop; +MEM_U32(t3 + 24) = at; +t9 = MEM_U32(a0 + 28); +//nop; +MEM_U32(t3 + 28) = t9; +t6 = MEM_U32(sp + 280); +t8 = MEM_U32(sp + 312); +t7 = MEM_U8(sp + 305); +if (t8 == t6) {v1 = MEM_U32(sp + 320); +goto L4415a8;} +v1 = MEM_U32(sp + 320); +t5 = MEM_U8(sp + 273); +t2 = t7 & 0x1f; +t4 = t5 & 0x1f; +if (t2 == t4) {a0 = 0x4; +goto L4415a4;} +a0 = 0x4; +t3 = 0x1000b71c; +a1 = 0x1bb; +t3 = t3; +t8 = t3 + 0x48; +t6 = sp; +L4414b0: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t6 = t6 + 0xc; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t6 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 4 + 3) = (uint8_t)(at >> 0); +if (t3 != t8) {//swr $at, 7($t6) +goto L4414b0;} +//swr $at, 7($t6) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t7 = 0x1000b6cc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +t8 = t3 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t3) +t7 = t7; +MEM_U8(t6 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t6 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t6 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t6 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t7 + 0x48; +t4 = sp; +//swr $t8, 0xf($t6) +L441520: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t4 = t4 + 0xc; +MEM_U8(t4 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t4) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t4 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 84 + 3) = (uint8_t)(at >> 0); +if (t7 != t2) {//swr $at, 0x57($t4) +goto L441520;} +//swr $at, 0x57($t4) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +//nop; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +t2 = t7 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t7) +//nop; +MEM_U8(t4 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t4 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t4 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t4 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t4) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44159c; +//nop; +L44159c: +gp = MEM_U32(sp + 204); +//nop; +L4415a4: +v1 = MEM_U32(sp + 320); +L4415a8: +fp = MEM_U32(sp + 312); +s3 = MEM_U32(sp + 316); +s0 = v1 + fp; +at = (int)s3 < (int)s0; +if (at == 0) {s5 = 0x9; +goto L441e04;} +s5 = 0x9; +L4415c0: +at = MEM_U32(s2 + 0); +t9 = sp + 0x110; +MEM_U32(t9 + 0) = at; +t3 = MEM_U32(s2 + 4); +a0 = s2; +MEM_U32(t9 + 4) = t3; +at = MEM_U32(s2 + 8); +a1 = s6; +MEM_U32(t9 + 8) = at; +t3 = MEM_U32(s2 + 12); +//nop; +MEM_U32(t9 + 12) = t3; +at = MEM_U32(s2 + 16); +//nop; +MEM_U32(t9 + 16) = at; +t3 = MEM_U32(s2 + 20); +//nop; +MEM_U32(t9 + 20) = t3; +at = MEM_U32(s2 + 24); +//nop; +MEM_U32(t9 + 24) = at; +t3 = MEM_U32(s2 + 28); +//nop; +MEM_U32(t9 + 28) = t3; +t6 = MEM_U32(sp + 284); +s4 = MEM_U32(sp + 284); +at = (int)t6 < (int)s3; +if (at == 0) {s7 = MEM_U32(sp + 280); +goto L44182c;} +s7 = MEM_U32(sp + 280); +//nop; +s7 = MEM_U32(sp + 280); +s4 = t6; +f_complex_init_duplicate_p(mem, sp, a0, a1); +goto L441644; +s4 = t6; +L441644: +t5 = MEM_U8(sp + 305); +gp = MEM_U32(sp + 204); +t2 = t5 & 0x1f; +if (s5 != t2) {t5 = s3 - s4; +goto L4416ac;} +t5 = s3 - s4; +t7 = MEM_U8(sp + 273); +//nop; +t4 = t7 & 0x1f; +if (s5 != t4) {t5 = s3 - s4; +goto L4416ac;} +t5 = s3 - s4; +s1 = MEM_U32(s2 + 32); +v0 = s3 - s4; +MEM_U32(s1 + 12) = s3; +MEM_U32(s1 + 16) = s3; +t8 = MEM_U32(s2 + 8); +//nop; +t9 = t8 - v0; +MEM_U32(s1 + 8) = t9; +t3 = MEM_U32(s2 + 8); +//nop; +t6 = t3 - v0; +MEM_U32(s1 + 24) = t6; +MEM_U32(s2 + 8) = v0; +MEM_U32(s2 + 24) = v0; +goto L441818; +MEM_U32(s2 + 24) = v0; +t5 = s3 - s4; +L4416ac: +lo = (int)t5 / (int)s7; hi = (int)t5 % (int)s7; +t8 = MEM_U32(s2 + 32); +if (s7 != 0) {//nop; +goto L4416c0;} +//nop; +abort(); +L4416c0: +at = 0xffffffff; +if (s7 != at) {at = 0x80000000; +goto L4416d8;} +at = 0x80000000; +if (t5 != at) {//nop; +goto L4416d8;} +//nop; +abort(); +L4416d8: +v0 = lo; +t2 = v0 + 0xffffffff; +//nop; +lo = t2 * s7; +hi = (uint32_t)((uint64_t)t2 * (uint64_t)s7 >> 32); +t7 = lo; +t4 = s4 + t7; +MEM_U32(s2 + 16) = t4; +lo = v0 * s7; +hi = (uint32_t)((uint64_t)v0 * (uint64_t)s7 >> 32); +MEM_U32(t8 + 12) = s3; +t9 = lo; +t3 = t9 + s4; +if (s3 == t3) {//nop; +goto L441818;} +//nop; +t6 = 0x1000b67c; +a0 = 0x2; +t6 = t6; +t2 = t6 + 0x48; +a1 = 0x1d7; +t7 = sp; +L441724: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t7 = t7 + 0xc; +MEM_U8(t7 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t7) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t7 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t2) {//swr $at, 7($t7) +goto L441724;} +//swr $at, 7($t7) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t4 = 0x1000b62c; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +t2 = t6 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t6) +t4 = t4; +MEM_U8(t7 + 12 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t7 + 12 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t7 + 12 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t7 + 12 + 3) = (uint8_t)(t2 >> 0); +t9 = t4 + 0x48; +t3 = sp; +//swr $t2, 0xf($t7) +L441794: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t9) {//swr $at, 0x57($t3) +goto L441794;} +//swr $at, 0x57($t3) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t9 = t4 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t4) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L441810; +//nop; +L441810: +gp = MEM_U32(sp + 204); +//nop; +L441818: +s2 = MEM_U32(s2 + 32); +v1 = MEM_U32(sp + 320); +at = (int)s3 < (int)s0; +goto L441dfc; +at = (int)s3 < (int)s0; +s7 = MEM_U32(sp + 280); +L44182c: +if (s4 != s3) {a0 = s2; +goto L441b0c;} +a0 = s2; +v0 = MEM_U32(sp + 288); +MEM_U32(sp + 316) = s3; +at = (int)v0 < (int)v1; +if (at == 0) {t5 = sp + 0x148; +goto L441884;} +t5 = sp + 0x148; +at = MEM_U32(t5 + 0); +s3 = v0 + s7; +MEM_U32(s2 + 24) = at; +t6 = MEM_U32(t5 + 4); +//nop; +MEM_U32(s2 + 28) = t6; +t7 = MEM_U32(s6 + 32); +//nop; +if (s2 != t7) {//nop; +goto L441878;} +//nop; +MEM_U32(s2 + 16) = v1; +goto L441e04; +MEM_U32(s2 + 16) = v1; +L441878: +s2 = MEM_U32(s2 + 32); +at = (int)s3 < (int)s0; +goto L441dfc; +at = (int)s3 < (int)s0; +L441884: +if (v0 != v1) {a0 = s2; +goto L441a90;} +a0 = s2; +t8 = MEM_U8(sp + 305); +MEM_U32(sp + 312) = fp; +t9 = t8 & 0x1f; +if (s5 != t9) {t3 = sp + 0x130; +goto L441a30;} +t3 = sp + 0x130; +t4 = MEM_U8(sp + 273); +MEM_U32(sp + 312) = fp; +t3 = t4 & 0x1f; +if (s5 != t3) {at = (int)fp < (int)s7; +goto L441a2c;} +at = (int)fp < (int)s7; +if (at == 0) {MEM_U32(sp + 312) = fp; +goto L441a2c;} +MEM_U32(sp + 312) = fp; +//nop; +a0 = s2; +a1 = s6; +s0 = 0x1; +f_complex_init_duplicate_p(mem, sp, a0, a1); +goto L4418d0; +s0 = 0x1; +L4418d0: +gp = MEM_U32(sp + 204); +s1 = MEM_U32(s2 + 32); +t2 = MEM_U32(s2 + 12); +//nop; +t5 = t2 + fp; +a0 = 0x400; +a1 = zero; +MEM_U32(s1 + 12) = t5; +MEM_U32(s1 + 16) = t5; +v0 = f_new(mem, sp, a0, a1); +goto L4418f8; +MEM_U32(s1 + 16) = t5; +L4418f8: +a3 = MEM_U32(s1 + 24); +a0 = fp + 0x1; +gp = MEM_U32(sp + 204); +at = a3 < a0; +if (at != 0) {MEM_U32(sp + 312) = fp; +goto L4419b8;} +MEM_U32(sp + 312) = fp; +a3 = a3 + 0x1; +t0 = a3 - a0; +t7 = t0 & 0x3; +if (t7 == 0) {a1 = a0; +goto L441950;} +a1 = a0; +a2 = t7 + a0; +v1 = v0 + s0; +L44192c: +t8 = MEM_U32(s1 + 28); +s0 = s0 + 0x1; +t9 = t8 + a1; +t4 = MEM_U8(t9 + -1); +a1 = a1 + 0x1; +v1 = v1 + 0x1; +if (a2 != a1) {MEM_U8(v1 + -2) = (uint8_t)t4; +goto L44192c;} +MEM_U8(v1 + -2) = (uint8_t)t4; +if (a1 == a3) {v1 = v0 + s0; +goto L4419b8;} +L441950: +v1 = v0 + s0; +L441954: +t3 = MEM_U32(s1 + 28); +v1 = v1 + 0x4; +t2 = t3 + a1; +t5 = MEM_U8(t2 + -1); +//nop; +MEM_U8(v1 + -5) = (uint8_t)t5; +t6 = MEM_U32(s1 + 28); +//nop; +t7 = t6 + a1; +t8 = MEM_U8(t7 + 0); +//nop; +MEM_U8(v1 + -4) = (uint8_t)t8; +t9 = MEM_U32(s1 + 28); +//nop; +t4 = t9 + a1; +t3 = MEM_U8(t4 + 1); +//nop; +MEM_U8(v1 + -3) = (uint8_t)t3; +t2 = MEM_U32(s1 + 28); +//nop; +t5 = t2 + a1; +t6 = MEM_U8(t5 + 2); +a1 = a1 + 0x4; +if (a1 != a3) {MEM_U8(v1 + -2) = (uint8_t)t6; +goto L441954;} +MEM_U8(v1 + -2) = (uint8_t)t6; +L4419b8: +MEM_U32(s1 + 28) = v0; +t7 = sp + 0x130; +at = MEM_U32(t7 + 0); +t4 = MEM_U32(sp + 312); +MEM_U32(s2 + 0) = at; +t9 = MEM_U32(t7 + 4); +v1 = s7 - t4; +MEM_U32(s2 + 4) = t9; +at = MEM_U32(t7 + 8); +//nop; +MEM_U32(s2 + 8) = at; +t9 = MEM_U32(t7 + 12); +//nop; +MEM_U32(s2 + 12) = t9; +at = MEM_U32(t7 + 16); +//nop; +MEM_U32(s2 + 16) = at; +t9 = MEM_U32(t7 + 20); +//nop; +MEM_U32(s2 + 20) = t9; +at = MEM_U32(t7 + 24); +//nop; +MEM_U32(s2 + 24) = at; +t9 = MEM_U32(t7 + 28); +//nop; +MEM_U32(s2 + 28) = t9; +MEM_U32(s1 + 8) = v1; +MEM_U32(s1 + 24) = v1; +goto L441e04; +MEM_U32(s1 + 24) = v1; +L441a2c: +t3 = sp + 0x130; +L441a30: +at = MEM_U32(t3 + 0); +//nop; +MEM_U32(s2 + 0) = at; +t5 = MEM_U32(t3 + 4); +//nop; +MEM_U32(s2 + 4) = t5; +at = MEM_U32(t3 + 8); +//nop; +MEM_U32(s2 + 8) = at; +t5 = MEM_U32(t3 + 12); +//nop; +MEM_U32(s2 + 12) = t5; +at = MEM_U32(t3 + 16); +//nop; +MEM_U32(s2 + 16) = at; +t5 = MEM_U32(t3 + 20); +//nop; +MEM_U32(s2 + 20) = t5; +at = MEM_U32(t3 + 24); +//nop; +MEM_U32(s2 + 24) = at; +t5 = MEM_U32(t3 + 28); +MEM_U32(s2 + 28) = t5; +goto L441e04; +MEM_U32(s2 + 28) = t5; +L441a90: +//nop; +MEM_U32(sp + 312) = fp; +a1 = s6; +f_complex_init_duplicate_p(mem, sp, a0, a1); +goto L441aa0; +a1 = s6; +L441aa0: +t6 = sp + 0x130; +at = MEM_U32(t6 + 0); +t4 = MEM_U32(s2 + 32); +MEM_U32(s2 + 0) = at; +t9 = MEM_U32(t6 + 4); +gp = MEM_U32(sp + 204); +MEM_U32(s2 + 4) = t9; +at = MEM_U32(t6 + 8); +//nop; +MEM_U32(s2 + 8) = at; +t9 = MEM_U32(t6 + 12); +//nop; +MEM_U32(s2 + 12) = t9; +at = MEM_U32(t6 + 16); +//nop; +MEM_U32(s2 + 16) = at; +t9 = MEM_U32(t6 + 20); +//nop; +MEM_U32(s2 + 20) = t9; +at = MEM_U32(t6 + 24); +//nop; +MEM_U32(s2 + 24) = at; +t9 = MEM_U32(t6 + 28); +//nop; +MEM_U32(s2 + 28) = t9; +MEM_U32(t4 + 12) = s0; +goto L441e04; +MEM_U32(t4 + 12) = s0; +L441b0c: +//nop; +a1 = s6; +MEM_U32(sp + 316) = s3; +MEM_U32(sp + 312) = fp; +f_complex_init_duplicate_p(mem, sp, a0, a1); +goto L441b20; +MEM_U32(sp + 312) = fp; +L441b20: +t2 = sp + 0x130; +at = MEM_U32(t2 + 0); +t8 = MEM_U8(sp + 305); +MEM_U32(s2 + 0) = at; +t7 = MEM_U32(t2 + 4); +gp = MEM_U32(sp + 204); +MEM_U32(s2 + 4) = t7; +at = MEM_U32(t2 + 8); +t6 = t8 & 0x1f; +MEM_U32(s2 + 8) = at; +t7 = MEM_U32(t2 + 12); +//nop; +MEM_U32(s2 + 12) = t7; +at = MEM_U32(t2 + 16); +//nop; +MEM_U32(s2 + 16) = at; +t7 = MEM_U32(t2 + 20); +//nop; +MEM_U32(s2 + 20) = t7; +at = MEM_U32(t2 + 24); +//nop; +MEM_U32(s2 + 24) = at; +t7 = MEM_U32(t2 + 28); +if (s5 != t6) {MEM_U32(s2 + 28) = t7; +goto L441c78;} +MEM_U32(s2 + 28) = t7; +t9 = MEM_U8(sp + 273); +s3 = MEM_U32(sp + 316); +fp = MEM_U32(sp + 312); +t4 = t9 & 0x1f; +if (s5 != t4) {//nop; +goto L441c78;} +//nop; +v0 = s4 - s3; +//nop; +s3 = s3 + v0; +s1 = v0; +MEM_U32(s2 + 8) = v0; +MEM_U32(s2 + 24) = v0; +fp = fp - v0; +MEM_U32(sp + 320) = s3; +a0 = 0x400; +a1 = zero; +s0 = 0x1; +v0 = f_new(mem, sp, a0, a1); +goto L441bcc; +s0 = 0x1; +L441bcc: +t5 = MEM_U32(sp + 328); +t0 = s1 + 0x1; +gp = MEM_U32(sp + 204); +at = t5 < t0; +if (at != 0) {a3 = t5 + 0x1; +goto L441c64;} +a3 = t5 + 0x1; +t1 = a3 - t0; +t3 = t1 & 0x3; +if (t3 == 0) {a1 = t0; +goto L441c28;} +a1 = t0; +t2 = MEM_U32(sp + 332); +a2 = t3 + t0; +v1 = v0 + s0; +a0 = t2 + t0; +L441c04: +t7 = MEM_U8(a0 + -1); +a1 = a1 + 0x1; +s0 = s0 + 0x1; +v1 = v1 + 0x1; +a0 = a0 + 0x1; +if (a2 != a1) {MEM_U8(v1 + -2) = (uint8_t)t7; +goto L441c04;} +MEM_U8(v1 + -2) = (uint8_t)t7; +if (a1 == a3) {t3 = MEM_U32(sp + 320); +goto L441c68;} +t3 = MEM_U32(sp + 320); +L441c28: +t8 = MEM_U32(sp + 332); +v1 = v0 + s0; +a0 = t8 + a1; +L441c34: +t6 = MEM_U8(a0 + -1); +a1 = a1 + 0x4; +MEM_U8(v1 + -1) = (uint8_t)t6; +t9 = MEM_U8(a0 + 0); +v1 = v1 + 0x4; +MEM_U8(v1 + -4) = (uint8_t)t9; +t4 = MEM_U8(a0 + 1); +a0 = a0 + 0x4; +MEM_U8(v1 + -3) = (uint8_t)t4; +t5 = MEM_U8(a0 + -2); +if (a1 != a3) {MEM_U8(v1 + -2) = (uint8_t)t5; +goto L441c34;} +MEM_U8(v1 + -2) = (uint8_t)t5; +L441c64: +t3 = MEM_U32(sp + 320); +L441c68: +MEM_U32(sp + 332) = v0; +MEM_U32(sp + 328) = fp; +s0 = t3 + fp; +goto L441dec; +s0 = t3 + fp; +L441c78: +s3 = MEM_U32(sp + 316); +fp = MEM_U32(sp + 312); +t2 = s4 - s3; +lo = (int)t2 / (int)fp; hi = (int)t2 % (int)fp; +t4 = MEM_U32(s2 + 32); +if (fp != 0) {//nop; +goto L441c98;} +//nop; +abort(); +L441c98: +at = 0xffffffff; +if (fp != at) {at = 0x80000000; +goto L441cb0;} +at = 0x80000000; +if (t2 != at) {//nop; +goto L441cb0;} +//nop; +abort(); +L441cb0: +a0 = 0x2; +a1 = 0x23b; +t7 = lo; +t8 = t7 + 0xffffffff; +//nop; +lo = t8 * fp; +hi = (uint32_t)((uint64_t)t8 * (uint64_t)fp >> 32); +t6 = lo; +t9 = s3 + t6; +MEM_U32(s2 + 16) = t9; +MEM_U32(t4 + 12) = s4; +t5 = MEM_U32(s2 + 16); +//nop; +s3 = t5 + fp; +if (s3 == s4) {t5 = sp; +goto L441dec;} +t5 = sp; +t3 = 0x1000b5dc; +t8 = sp; +t3 = t3; +t7 = t3 + 0x48; +L441cfc: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t8 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t8) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t8 = t8 + 0xc; +MEM_U8(t8 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t8) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t8 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 4 + 3) = (uint8_t)(at >> 0); +if (t3 != t7) {//swr $at, 7($t8) +goto L441cfc;} +//swr $at, 7($t8) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t6 = 0x1000b58c; +MEM_U8(t8 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t8) +t7 = t3 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t3) +t6 = t6; +MEM_U8(t8 + 12 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t8 + 12 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t8 + 12 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t8 + 12 + 3) = (uint8_t)(t7 >> 0); +t4 = t6 + 0x48; +//swr $t7, 0xf($t8) +L441d68: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t5 = t5 + 0xc; +MEM_U8(t5 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t5) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t5 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 84 + 3) = (uint8_t)(at >> 0); +if (t6 != t4) {//swr $at, 0x57($t5) +goto L441d68;} +//swr $at, 0x57($t5) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +//nop; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +t4 = t6 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t6) +//nop; +MEM_U8(t5 + 92 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t5 + 92 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t5 + 92 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t5 + 92 + 3) = (uint8_t)(t4 >> 0); +//swr $t4, 0x5f($t5) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L441de4; +//nop; +L441de4: +gp = MEM_U32(sp + 204); +//nop; +L441dec: +s2 = MEM_U32(s2 + 32); +v1 = MEM_U32(sp + 320); +//nop; +at = (int)s3 < (int)s0; +L441dfc: +if (at != 0) {//nop; +goto L4415c0;} +//nop; +L441e04: +ra = MEM_U32(sp + 212); +s0 = MEM_U32(sp + 172); +s1 = MEM_U32(sp + 176); +s2 = MEM_U32(sp + 180); +s3 = MEM_U32(sp + 184); +s4 = MEM_U32(sp + 188); +s5 = MEM_U32(sp + 192); +s6 = MEM_U32(sp + 196); +s7 = MEM_U32(sp + 200); +fp = MEM_U32(sp + 208); +sp = sp + 0x150; +return; +sp = sp + 0x150; +} + +static void f_append_init(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L441e34: +//append_init: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 188) = ra; +MEM_U32(sp + 184) = gp; +MEM_U32(sp + 180) = s1; +MEM_U32(sp + 176) = s0; +MEM_U32(sp + 196) = a1; +t7 = MEM_U8(a1 + 1); +s1 = a0; +t8 = t7 & 0x1f; +t9 = t8 + 0xfffffffa; +at = t9 < 0xb; +if (at == 0) {s0 = zero; +goto L441f0c;} +s0 = zero; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000b8ac[] = { +&&L441e94, +&&L441f08, +&&L441e94, +&&L441e94, +&&L441f08, +&&L441f08, +&&L441e94, +&&L441e94, +&&L441f08, +&&L441f08, +&&L441e94, +}; +dest = Lswitch1000b8ac[t9]; +//nop; +goto *dest; +//nop; +L441e94: +t5 = MEM_U32(sp + 196); +//nop; +at = MEM_U32(t5 + 0); +a0 = s1; +MEM_U32(sp + 8) = at; +t7 = MEM_U32(t5 + 4); +a2 = MEM_U32(sp + 8); +MEM_U32(sp + 12) = t7; +at = MEM_U32(t5 + 8); +a3 = MEM_U32(sp + 12); +MEM_U32(sp + 16) = at; +t7 = MEM_U32(t5 + 12); +//nop; +MEM_U32(sp + 20) = t7; +at = MEM_U32(t5 + 16); +//nop; +MEM_U32(sp + 24) = at; +t7 = MEM_U32(t5 + 20); +//nop; +MEM_U32(sp + 28) = t7; +at = MEM_U32(t5 + 24); +//nop; +MEM_U32(sp + 32) = at; +t7 = MEM_U32(t5 + 28); +MEM_U32(sp + 36) = t7; +v0 = f_some_init_overlap(mem, sp, a0, a1, a2, a3); +goto L441efc; +MEM_U32(sp + 36) = t7; +L441efc: +gp = MEM_U32(sp + 184); +s0 = v0; +goto L441f0c; +s0 = v0; +L441f08: +s0 = zero; +L441f0c: +if (s0 == 0) {//nop; +goto L441f88;} +//nop; +t8 = MEM_U32(sp + 196); +//nop; +at = MEM_U32(t8 + 0); +a0 = s0; +MEM_U32(sp + 8) = at; +t6 = MEM_U32(t8 + 4); +a2 = MEM_U32(sp + 8); +MEM_U32(sp + 12) = t6; +at = MEM_U32(t8 + 8); +a3 = MEM_U32(sp + 12); +MEM_U32(sp + 16) = at; +t6 = MEM_U32(t8 + 12); +a1 = s1; +MEM_U32(sp + 20) = t6; +at = MEM_U32(t8 + 16); +//nop; +MEM_U32(sp + 24) = at; +t6 = MEM_U32(t8 + 20); +//nop; +MEM_U32(sp + 28) = t6; +at = MEM_U32(t8 + 24); +//nop; +MEM_U32(sp + 32) = at; +t6 = MEM_U32(t8 + 28); +MEM_U32(sp + 36) = t6; +f_complex_insert_init(mem, sp, a0, a1, a2, a3); +goto L441f7c; +MEM_U32(sp + 36) = t6; +L441f7c: +gp = MEM_U32(sp + 184); +ra = MEM_U32(sp + 188); +goto L4423d0; +ra = MEM_U32(sp + 188); +L441f88: +//nop; +a0 = 0x28; +a1 = 0x1; +v0 = f_new(mem, sp, a0, a1); +goto L441f98; +a1 = 0x1; +L441f98: +gp = MEM_U32(sp + 184); +if (v0 != 0) {a0 = 0x4; +goto L4420b0;} +a0 = 0x4; +t5 = 0x1000b85c; +a1 = 0x25c; +t5 = t5; +t9 = t5 + 0x48; +t8 = sp; +L441fb8: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t8 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t8) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t8 = t8 + 0xc; +MEM_U8(t8 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t8) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t8 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 4 + 3) = (uint8_t)(at >> 0); +if (t5 != t9) {//swr $at, 7($t8) +goto L441fb8;} +//swr $at, 7($t8) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t6 = 0x1000b80c; +MEM_U8(t8 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t8) +t9 = t5 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t5) +t6 = t6; +MEM_U8(t8 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t8 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t8 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t8 + 12 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0xf($t8) +t9 = t6 + 0x48; +t5 = sp; +L442028: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t5 = t5 + 0xc; +MEM_U8(t5 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t5) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t5 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 84 + 3) = (uint8_t)(at >> 0); +if (t6 != t9) {//swr $at, 0x57($t5) +goto L442028;} +//swr $at, 0x57($t5) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +//nop; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +t9 = t6 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t6) +//nop; +MEM_U8(t5 + 92 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t5 + 92 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t5 + 92 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t5 + 92 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x5f($t5) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4420a4; +//nop; +L4420a4: +gp = MEM_U32(sp + 184); +ra = MEM_U32(sp + 188); +goto L4423d0; +ra = MEM_U32(sp + 188); +L4420b0: +v1 = 0x100058f0; +//nop; +t8 = MEM_U32(v1 + 0); +//nop; +if (t8 != 0) {//nop; +goto L4420d8;} +//nop; +a0 = 0x100058f4; +MEM_U32(v1 + 0) = s1; +MEM_U32(a0 + 0) = s1; +goto L442108; +MEM_U32(a0 + 0) = s1; +L4420d8: +t7 = MEM_U32(s1 + 36); +//nop; +if (t7 != 0) {t9 = MEM_U32(sp + 196); +goto L44210c;} +t9 = MEM_U32(sp + 196); +a0 = 0x100058f4; +//nop; +v1 = MEM_U32(a0 + 0); +//nop; +if (s1 == v1) {t9 = MEM_U32(sp + 196); +goto L44210c;} +t9 = MEM_U32(sp + 196); +MEM_U32(v1 + 36) = s1; +MEM_U32(a0 + 0) = s1; +L442108: +t9 = MEM_U32(sp + 196); +L44210c: +//nop; +at = MEM_U32(t9 + 0); +//nop; +MEM_U32(v0 + 0) = at; +t5 = MEM_U32(t9 + 4); +//nop; +MEM_U32(v0 + 4) = t5; +at = MEM_U32(t9 + 8); +//nop; +MEM_U32(v0 + 8) = at; +t5 = MEM_U32(t9 + 12); +//nop; +MEM_U32(v0 + 12) = t5; +at = MEM_U32(t9 + 16); +//nop; +MEM_U32(v0 + 16) = at; +t5 = MEM_U32(t9 + 20); +//nop; +MEM_U32(v0 + 20) = t5; +at = MEM_U32(t9 + 24); +//nop; +MEM_U32(v0 + 24) = at; +t5 = MEM_U32(t9 + 28); +MEM_U32(v0 + 32) = zero; +MEM_U32(v0 + 28) = t5; +t3 = MEM_U32(s1 + 28); +//nop; +if (t3 != 0) {//nop; +goto L44218c;} +//nop; +MEM_U32(s1 + 28) = v0; +MEM_U32(s1 + 32) = v0; +goto L4423cc; +MEM_U32(s1 + 32) = v0; +L44218c: +t1 = MEM_U32(s1 + 32); +t8 = MEM_U32(sp + 196); +t7 = MEM_U32(t1 + 12); +a1 = MEM_U32(t8 + 12); +//nop; +at = (int)t7 < (int)a1; +if (at == 0) {//nop; +goto L4421b8;} +//nop; +MEM_U32(t1 + 32) = v0; +MEM_U32(s1 + 32) = v0; +goto L4423cc; +MEM_U32(s1 + 32) = v0; +L4421b8: +t4 = MEM_U32(t3 + 12); +//nop; +at = (int)a1 < (int)t4; +if (at == 0) {//nop; +goto L4421d8;} +//nop; +MEM_U32(v0 + 32) = t3; +MEM_U32(s1 + 28) = v0; +goto L4423cc; +MEM_U32(s1 + 28) = v0; +L4421d8: +t6 = MEM_U32(t3 + 12); +s0 = t3; +if (a1 == t6) {//nop; +goto L442284;} +//nop; +if (s0 == t1) {t2 = 0x2; +goto L442284;} +t2 = 0x2; +t0 = 0x10018eb0; +a3 = 0x10018e98; +a2 = 0x1; +L4421fc: +a0 = MEM_U32(s0 + 32); +//nop; +v1 = MEM_U32(a0 + 12); +//nop; +at = (int)a1 < (int)v1; +if (at == 0) {//nop; +goto L442224;} +//nop; +MEM_U32(v0 + 32) = a0; +MEM_U32(s0 + 32) = v0; +goto L4423cc; +MEM_U32(s0 + 32) = v0; +L442224: +if (a1 != v1) {//nop; +goto L44227c;} +//nop; +v1 = MEM_U32(a3 + 0); +//nop; +if (a2 != v1) {//nop; +goto L44224c;} +//nop; +t9 = MEM_U8(t0 + 0); +//nop; +if (t9 != 0) {//nop; +goto L442254;} +//nop; +L44224c: +if (t2 != v1) {//nop; +goto L44227c;} +//nop; +L442254: +if (t1 != a0) {//nop; +goto L442268;} +//nop; +MEM_U32(s0 + 32) = v0; +MEM_U32(s1 + 32) = v0; +goto L4423cc; +MEM_U32(s1 + 32) = v0; +L442268: +t5 = MEM_U32(a0 + 32); +//nop; +MEM_U32(v0 + 32) = t5; +MEM_U32(s0 + 32) = v0; +goto L4423cc; +MEM_U32(s0 + 32) = v0; +L44227c: +if (a0 != t1) {s0 = a0; +goto L4421fc;} +s0 = a0; +L442284: +a3 = 0x10018e98; +a2 = 0x1; +v1 = MEM_U32(a3 + 0); +t2 = 0x2; +if (a2 == v1) {//nop; +goto L4422a4;} +//nop; +if (t2 != v1) {//nop; +goto L4422c0;} +//nop; +L4422a4: +if (t4 != a1) {//nop; +goto L4422c0;} +//nop; +t8 = MEM_U32(t3 + 32); +//nop; +MEM_U32(v0 + 32) = t8; +MEM_U32(s1 + 28) = v0; +goto L4423cc; +MEM_U32(s1 + 28) = v0; +L4422c0: +t7 = 0x1000b7bc; +a0 = 0x4; +t7 = t7; +t9 = t7 + 0x48; +a1 = 0x2a5; +t5 = sp; +L4422d8: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t5 = t5 + 0xc; +MEM_U8(t5 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t5) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t5 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t9) {//swr $at, 7($t5) +goto L4422d8;} +//swr $at, 7($t5) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t8 = 0x1000b76c; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +t9 = t7 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t7) +t8 = t8; +MEM_U8(t5 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t5 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t5 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t5 + 12 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0xf($t5) +t9 = t8 + 0x48; +t7 = sp; +L442348: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t8 != t9) {//swr $at, 0x57($t7) +goto L442348;} +//swr $at, 0x57($t7) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t9 = t8 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t8) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4423c4; +//nop; +L4423c4: +gp = MEM_U32(sp + 184); +//nop; +L4423cc: +ra = MEM_U32(sp + 188); +L4423d0: +s0 = MEM_U32(sp + 176); +s1 = MEM_U32(sp + 180); +sp = sp + 0xc0; +return; +sp = sp + 0xc0; +} + +static void f_add_init(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4423e0: +//add_init: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +a0 = MEM_U32(a0 + 4); +//nop; +v0 = f_lookup_sym(mem, sp, a0); +goto L44240c; +//nop; +L44240c: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +a0 = v0; +//nop; +f_append_init(mem, sp, a0, a1); +goto L442424; +//nop; +L442424: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_choose_area(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L442434: +//choose_area: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +v0 = a0 & 0xff; +at = v0 < 0x6; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if (at == 0) {MEM_U32(sp + 32) = a0; +goto L442574;} +MEM_U32(sp + 32) = a0; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000b8e0[] = { +&&L44247c, +&&L4424d0, +&&L4424ec, +&&L442508, +&&L442524, +&&L442540, +}; +dest = Lswitch1000b8e0[v0]; +//nop; +goto *dest; +//nop; +L44247c: +t7 = 0x10018e84; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +at = (int)t7 < (int)a1; +if (at == 0) {//nop; +goto L4424b4;} +//nop; +//nop; +a0 = 0xa; +a1 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L4424a8; +a1 = zero; +L4424a8: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L44259c; +ra = MEM_U32(sp + 28); +L4424b4: +//nop; +a0 = 0x19; +a1 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L4424c4; +a1 = zero; +L4424c4: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L44259c; +ra = MEM_U32(sp + 28); +L4424d0: +//nop; +a0 = 0x1a; +a1 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L4424e0; +a1 = zero; +L4424e0: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L44259c; +ra = MEM_U32(sp + 28); +L4424ec: +//nop; +a0 = 0x19; +a1 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L4424fc; +a1 = zero; +L4424fc: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L44259c; +ra = MEM_U32(sp + 28); +L442508: +//nop; +a0 = 0xa; +a1 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L442518; +a1 = zero; +L442518: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L44259c; +ra = MEM_U32(sp + 28); +L442524: +//nop; +a0 = 0x15; +a1 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L442534; +a1 = zero; +L442534: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L44259c; +ra = MEM_U32(sp + 28); +L442540: +t8 = 0x10018e60; +a0 = zero; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == 0) {ra = MEM_U32(sp + 28); +goto L44259c;} +ra = MEM_U32(sp + 28); +//nop; +a1 = zero; +a2 = zero; +f_demit_edata(mem, sp, a0, a1, a2); +goto L442568; +a2 = zero; +L442568: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L44259c; +ra = MEM_U32(sp + 28); +L442574: +a2 = 0x1000b8d8; +//nop; +a0 = 0x1; +a1 = 0x2b4; +a3 = 0x8; +a2 = a2; +f_caseerror(mem, sp, a0, a1, a2, a3); +goto L442590; +a2 = a2; +L442590: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L44259c: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void f_force_alignment(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4425a8: +//force_alignment: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +a3 = a0 & 0xff; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if (a3 == 0) {MEM_U32(sp + 32) = a0; +goto L4425e8;} +MEM_U32(sp + 32) = a0; +//nop; +a0 = 0x4; +a1 = zero; +a2 = a3; +f_demit_dir1(mem, sp, a0, a1, a2); +goto L4425e0; +a2 = a3; +L4425e0: +gp = MEM_U32(sp + 24); +//nop; +L4425e8: +//nop; +a0 = 0x4; +a1 = zero; +a2 = zero; +f_demit_dir1(mem, sp, a0, a1, a2); +goto L4425fc; +a2 = zero; +L4425fc: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_emit_init(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44260c: +//emit_init: +//nop; +//nop; +//nop; +sp = sp + 0xffffff28; +MEM_U32(sp + 216) = a0; +t6 = MEM_U32(sp + 216); +//nop; +MEM_U32(sp + 212) = ra; +MEM_U32(sp + 208) = gp; +MEM_U32(sp + 204) = s7; +MEM_U32(sp + 200) = s6; +MEM_U32(sp + 196) = s5; +MEM_U32(sp + 192) = s4; +MEM_U32(sp + 188) = s3; +MEM_U32(sp + 184) = s2; +MEM_U32(sp + 180) = s1; +MEM_U32(sp + 176) = s0; +a1 = MEM_U32(t6 + 0); +a0 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L44265c; +a0 = zero; +L44265c: +t7 = MEM_U32(sp + 216); +gp = MEM_U32(sp + 208); +s0 = MEM_U32(t7 + 40); +//nop; +if (s0 == 0) {t9 = MEM_U32(sp + 216); +goto L4426c4;} +t9 = MEM_U32(sp + 216); +s1 = 0x1; +L442678: +t8 = MEM_U32(s0 + 4); +//nop; +if (s1 != t8) {//nop; +goto L4426a0;} +//nop; +//nop; +a0 = MEM_U32(s0 + 0); +a1 = zero; +f_demit_weakext(mem, sp, a0, a1); +goto L442698; +a1 = zero; +L442698: +gp = MEM_U32(sp + 208); +//nop; +L4426a0: +//nop; +a1 = MEM_U32(s0 + 0); +a0 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L4426b0; +a0 = zero; +L4426b0: +s0 = MEM_U32(s0 + 8); +gp = MEM_U32(sp + 208); +if (s0 != 0) {//nop; +goto L442678;} +//nop; +t9 = MEM_U32(sp + 216); +L4426c4: +s0 = zero; +s3 = MEM_U32(t9 + 28); +s7 = 0x2; +if (s3 == 0) {s5 = 0xffff0000; +goto L442b94;} +s5 = 0xffff0000; +s5 = s5 | 0x1; +s4 = 0x10000; +L4426e0: +a0 = MEM_U8(s3 + 1); +s6 = MEM_U32(s3 + 8); +//nop; +t0 = a0 & 0x1f; +a0 = t0; +a1 = s6; +v0 = f_find_val_type(mem, sp, a0, a1); +goto L4426fc; +a1 = s6; +L4426fc: +t1 = MEM_U32(s3 + 12); +gp = MEM_U32(sp + 208); +a2 = t1 - s0; +if (a2 == 0) {s2 = v0 & 0xff; +goto L44295c;} +s2 = v0 & 0xff; +if ((int)a2 >= 0) {//nop; +goto L442944;} +//nop; +t2 = 0x10018e98; +a0 = 0x4; +t2 = MEM_U32(t2 + 0); +a1 = 0x304; +if (s7 != t2) {t9 = sp; +goto L442840;} +t9 = sp; +t3 = 0x1000bbc8; +a0 = 0x2; +t3 = t3; +t5 = t3 + 0x48; +a1 = 0x2ff; +t6 = sp; +L442748: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t6 = t6 + 0xc; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t6 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 4 + 3) = (uint8_t)(at >> 0); +if (t3 != t5) {//swr $at, 7($t6) +goto L442748;} +//swr $at, 7($t6) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t7 = 0x1000bb78; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +t7 = t7; +MEM_U8(t6 + 12 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t6 + 12 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t6 + 12 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t6 + 12 + 3) = (uint8_t)(t5 >> 0); +t9 = t7 + 0x48; +t0 = sp; +//swr $t5, 0xf($t6) +L4427b8: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t0 = t0 + 0xc; +MEM_U8(t0 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t0) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t0 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 84 + 3) = (uint8_t)(at >> 0); +if (t7 != t9) {//swr $at, 0x57($t0) +goto L4427b8;} +//swr $at, 0x57($t0) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +//nop; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +t9 = t7 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t7) +//nop; +MEM_U8(t0 + 92 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t0 + 92 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t0 + 92 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t0 + 92 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x5f($t0) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L442834; +//nop; +L442834: +gp = MEM_U32(sp + 208); +a2 = zero; +goto L442944; +a2 = zero; +L442840: +t1 = 0x1000bb28; +t5 = sp; +t1 = t1; +t4 = t1 + 0x48; +L442850: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t5 = t5 + 0xc; +MEM_U8(t5 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t5) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t5 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 4 + 3) = (uint8_t)(at >> 0); +if (t1 != t4) {//swr $at, 7($t5) +goto L442850;} +//swr $at, 7($t5) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t3 = 0x1000bad8; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +t4 = t1 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t1) +t3 = t3; +MEM_U8(t5 + 12 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t5 + 12 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t5 + 12 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t5 + 12 + 3) = (uint8_t)(t4 >> 0); +t8 = t3 + 0x48; +//swr $t4, 0xf($t5) +L4428bc: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t9 = t9 + 0xc; +MEM_U8(t9 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t9) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t9 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 84 + 3) = (uint8_t)(at >> 0); +if (t3 != t8) {//swr $at, 0x57($t9) +goto L4428bc;} +//swr $at, 0x57($t9) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +//nop; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +t8 = t3 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t3) +//nop; +MEM_U8(t9 + 92 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 92 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 92 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 92 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x5f($t9) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L442938; +//nop; +L442938: +gp = MEM_U32(sp + 208); +//nop; +a2 = zero; +L442944: +//nop; +a0 = 0x14; +a1 = zero; +f_demit_dir1(mem, sp, a0, a1, a2); +goto L442954; +a1 = zero; +L442954: +gp = MEM_U32(sp + 208); +//nop; +L44295c: +at = 0x8; +if (s2 != at) {//nop; +goto L442acc;} +//nop; +v0 = MEM_U16(s3 + 2); +//nop; +if (v0 == 0) {//nop; +goto L442aa8;} +//nop; +if (s6 != s7) {a0 = 0x2; +goto L4429a0;} +a0 = 0x2; +//nop; +a0 = 0x39; +a1 = zero; +a2 = v0; +f_demit_dir1(mem, sp, a0, a1, a2); +goto L442994; +a2 = v0; +L442994: +gp = MEM_U32(sp + 208); +//nop; +goto L442aa8; +//nop; +L4429a0: +t7 = 0x1000ba88; +a1 = 0x313; +t7 = t7; +t2 = t7 + 0x48; +t4 = sp; +L4429b4: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t4 = t4 + 0xc; +MEM_U8(t4 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t4) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t4 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t2) {//swr $at, 7($t4) +goto L4429b4;} +//swr $at, 7($t4) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t1 = 0x1000ba38; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +t2 = t7 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t7) +t1 = t1; +MEM_U8(t4 + 12 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t4 + 12 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t4 + 12 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t4 + 12 + 3) = (uint8_t)(t2 >> 0); +t6 = t1 + 0x48; +t8 = sp; +//swr $t2, 0xf($t4) +L442a24: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t8 = t8 + 0xc; +MEM_U8(t8 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t8) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t8 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 84 + 3) = (uint8_t)(at >> 0); +if (t1 != t6) {//swr $at, 0x57($t8) +goto L442a24;} +//swr $at, 0x57($t8) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +//nop; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +t6 = t1 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t1) +//nop; +MEM_U8(t8 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t8 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t8 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t8 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t8) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L442aa0; +//nop; +L442aa0: +gp = MEM_U32(sp + 208); +//nop; +L442aa8: +//nop; +a1 = MEM_U32(s3 + 24); +a2 = MEM_U32(s3 + 20); +a0 = zero; +a3 = s6; +f_emit_label_val(mem, sp, a0, a1, a2, a3); +goto L442ac0; +a3 = s6; +L442ac0: +gp = MEM_U32(sp + 208); +t9 = MEM_U32(s3 + 16); +goto L442b84; +t9 = MEM_U32(s3 + 16); +L442acc: +v1 = MEM_U32(s3 + 16); +v0 = MEM_U32(s3 + 12); +//nop; +if (v1 == v0) {t3 = v1 - v0; +goto L442b5c;} +t3 = v1 - v0; +lo = (int)t3 / (int)s6; hi = (int)t3 % (int)s6; +if (s6 != 0) {//nop; +goto L442af0;} +//nop; +abort(); +L442af0: +at = 0xffffffff; +if (s6 != at) {at = 0x80000000; +goto L442b08;} +at = 0x80000000; +if (t3 != at) {//nop; +goto L442b08;} +//nop; +abort(); +L442b08: +s0 = lo; +s0 = s0 + 0x1; +at = (int)s0 < (int)s4; +if (at != 0) {at = (int)s0 < (int)s4; +goto L442b50;} +at = (int)s0 < (int)s4; +if (at != 0) {s1 = s3 + 0x18; +goto L442b50;} +s1 = s3 + 0x18; +L442b24: +//nop; +a0 = zero; +a1 = s2; +a2 = s1; +a3 = 0xffff; +f_emit_val(mem, sp, a0, a1, a2, a3); +goto L442b3c; +a3 = 0xffff; +L442b3c: +s0 = s0 + s5; +gp = MEM_U32(sp + 208); +at = (int)s0 < (int)s4; +if (at == 0) {//nop; +goto L442b24;} +//nop; +L442b50: +a3 = s0; +s1 = s3 + 0x18; +goto L442b64; +s1 = s3 + 0x18; +L442b5c: +a3 = 0x1; +s1 = s3 + 0x18; +L442b64: +//nop; +a0 = zero; +a1 = s2; +a2 = s1; +f_emit_val(mem, sp, a0, a1, a2, a3); +goto L442b78; +a2 = s1; +L442b78: +gp = MEM_U32(sp + 208); +//nop; +t9 = MEM_U32(s3 + 16); +L442b84: +s3 = MEM_U32(s3 + 32); +s0 = t9 + s6; +if (s3 != 0) {//nop; +goto L4426e0;} +//nop; +L442b94: +t0 = MEM_U32(sp + 216); +s7 = 0x2; +t2 = MEM_U32(t0 + 16); +//nop; +a2 = t2 - s0; +if (a2 == 0) {ra = MEM_U32(sp + 212); +goto L442e00;} +ra = MEM_U32(sp + 212); +if ((int)a2 >= 0) {//nop; +goto L442de4;} +//nop; +t7 = 0x10018e98; +a0 = 0x2; +t7 = MEM_U32(t7 + 0); +a1 = 0x343; +if (s7 != t7) {t9 = sp; +goto L442ce0;} +t9 = sp; +t4 = 0x1000b9e8; +a0 = 0x2; +t4 = t4; +t6 = t4 + 0x48; +a1 = 0x33e; +t1 = sp; +L442be8: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t1 = t1 + 0xc; +MEM_U8(t1 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t1) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t1 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 4 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 7($t1) +goto L442be8;} +//swr $at, 7($t1) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t8 = 0x1000b998; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +t8 = t8; +MEM_U8(t1 + 12 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t1 + 12 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t1 + 12 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t1 + 12 + 3) = (uint8_t)(t6 >> 0); +t9 = t8 + 0x48; +t0 = sp; +//swr $t6, 0xf($t1) +L442c58: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t0 = t0 + 0xc; +MEM_U8(t0 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t0) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t0 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 84 + 3) = (uint8_t)(at >> 0); +if (t8 != t9) {//swr $at, 0x57($t0) +goto L442c58;} +//swr $at, 0x57($t0) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +//nop; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +t9 = t8 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t8) +//nop; +MEM_U8(t0 + 92 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t0 + 92 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t0 + 92 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t0 + 92 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x5f($t0) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L442cd4; +//nop; +L442cd4: +gp = MEM_U32(sp + 208); +a2 = zero; +goto L442de4; +a2 = zero; +L442ce0: +t2 = 0x1000b948; +t6 = sp; +t2 = t2; +t5 = t2 + 0x48; +L442cf0: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t6 = t6 + 0xc; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t6 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 4 + 3) = (uint8_t)(at >> 0); +if (t2 != t5) {//swr $at, 7($t6) +goto L442cf0;} +//swr $at, 7($t6) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t4 = 0x1000b8f8; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +t5 = t2 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t2) +t4 = t4; +MEM_U8(t6 + 12 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t6 + 12 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t6 + 12 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t6 + 12 + 3) = (uint8_t)(t5 >> 0); +t3 = t4 + 0x48; +//swr $t5, 0xf($t6) +L442d5c: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t9 = t9 + 0xc; +MEM_U8(t9 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t9) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t9 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t3) {//swr $at, 0x57($t9) +goto L442d5c;} +//swr $at, 0x57($t9) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +t3 = t4 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t4) +//nop; +MEM_U8(t9 + 92 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t9 + 92 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t9 + 92 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t9 + 92 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x5f($t9) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L442dd8; +//nop; +L442dd8: +gp = MEM_U32(sp + 208); +//nop; +a2 = zero; +L442de4: +//nop; +a0 = 0x14; +a1 = zero; +f_demit_dir1(mem, sp, a0, a1, a2); +goto L442df4; +a1 = zero; +L442df4: +gp = MEM_U32(sp + 208); +//nop; +ra = MEM_U32(sp + 212); +L442e00: +s0 = MEM_U32(sp + 176); +s1 = MEM_U32(sp + 180); +s2 = MEM_U32(sp + 184); +s3 = MEM_U32(sp + 188); +s4 = MEM_U32(sp + 192); +s5 = MEM_U32(sp + 196); +s6 = MEM_U32(sp + 200); +s7 = MEM_U32(sp + 204); +sp = sp + 0xd8; +return; +sp = sp + 0xd8; +} + +static void f_emit_symbol(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L442e28: +//emit_symbol: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 188) = ra; +MEM_U32(sp + 184) = gp; +MEM_U32(sp + 180) = s1; +MEM_U32(sp + 176) = s0; +v1 = MEM_U8(a0 + 12); +s1 = a0; +t6 = v1 + 0xffffffff; +at = t6 < 0xa; +if (at == 0) {//nop; +goto L4430f4;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000bcb8[] = { +&&L442e80, +&&L442ee4, +&&L443200, +&&L442ee4, +&&L443200, +&&L443200, +&&L442fc8, +&&L4430f4, +&&L443200, +&&L4430a0, +}; +dest = Lswitch1000bcb8[t6]; +//nop; +goto *dest; +//nop; +L442e80: +s0 = MEM_U32(s1 + 16); +//nop; +if (s0 == 0) {ra = MEM_U32(sp + 188); +goto L443204;} +ra = MEM_U32(sp + 188); +t7 = MEM_U8(s1 + 24); +at = 0x2; +if (t7 != at) {a0 = 0x2d; +goto L442ec4;} +a0 = 0x2d; +//nop; +a1 = MEM_U32(s1 + 0); +a0 = 0x2d; +a2 = s0; +a3 = 0x1; +f_demit_dir2(mem, sp, a0, a1, a2, a3); +goto L442eb8; +a3 = 0x1; +L442eb8: +gp = MEM_U32(sp + 184); +ra = MEM_U32(sp + 188); +goto L443204; +ra = MEM_U32(sp + 188); +L442ec4: +//nop; +a1 = MEM_U32(s1 + 0); +a2 = s0; +a3 = zero; +f_demit_dir2(mem, sp, a0, a1, a2, a3); +goto L442ed8; +a3 = zero; +L442ed8: +gp = MEM_U32(sp + 184); +ra = MEM_U32(sp + 188); +goto L443204; +ra = MEM_U32(sp + 188); +L442ee4: +at = 0x2; +if (v1 != at) {//nop; +goto L442f08;} +//nop; +//nop; +a1 = MEM_U32(s1 + 0); +a0 = 0x2; +f_demit_dir0(mem, sp, a0, a1); +goto L442f00; +a0 = 0x2; +L442f00: +gp = MEM_U32(sp + 184); +//nop; +L442f08: +s0 = MEM_U32(s1 + 16); +//nop; +if (s0 == 0) {ra = MEM_U32(sp + 188); +goto L443204;} +ra = MEM_U32(sp + 188); +t8 = MEM_U32(s1 + 28); +//nop; +if (t8 != 0) {//nop; +goto L442f7c;} +//nop; +t9 = MEM_U8(s1 + 24); +at = 0x2; +if (t9 != at) {a0 = 0x9; +goto L442f5c;} +a0 = 0x9; +//nop; +a1 = MEM_U32(s1 + 0); +a0 = 0x9; +a2 = s0; +a3 = 0x1; +f_demit_dir2(mem, sp, a0, a1, a2, a3); +goto L442f50; +a3 = 0x1; +L442f50: +gp = MEM_U32(sp + 184); +ra = MEM_U32(sp + 188); +goto L443204; +ra = MEM_U32(sp + 188); +L442f5c: +//nop; +a1 = MEM_U32(s1 + 0); +a2 = s0; +a3 = zero; +f_demit_dir2(mem, sp, a0, a1, a2, a3); +goto L442f70; +a3 = zero; +L442f70: +gp = MEM_U32(sp + 184); +ra = MEM_U32(sp + 188); +goto L443204; +ra = MEM_U32(sp + 188); +L442f7c: +//nop; +a0 = MEM_U8(s1 + 24); +a1 = s0; +f_choose_area(mem, sp, a0, a1); +goto L442f8c; +a1 = s0; +L442f8c: +gp = MEM_U32(sp + 184); +a0 = MEM_U8(s1 + 14); +//nop; +//nop; +//nop; +f_force_alignment(mem, sp, a0); +goto L442fa4; +//nop; +L442fa4: +gp = MEM_U32(sp + 184); +a0 = s1; +//nop; +//nop; +//nop; +f_emit_init(mem, sp, a0); +goto L442fbc; +//nop; +L442fbc: +gp = MEM_U32(sp + 184); +ra = MEM_U32(sp + 188); +goto L443204; +ra = MEM_U32(sp + 188); +L442fc8: +t0 = MEM_U32(s1 + 28); +//nop; +if (t0 != 0) {//nop; +goto L44303c;} +//nop; +s0 = MEM_U32(s1 + 16); +//nop; +if (s0 == 0) {ra = MEM_U32(sp + 188); +goto L443204;} +ra = MEM_U32(sp + 188); +t1 = MEM_U8(s1 + 24); +at = 0x2; +if (t1 != at) {a0 = 0x8; +goto L44301c;} +a0 = 0x8; +//nop; +a1 = MEM_U32(s1 + 0); +a0 = 0x8; +a2 = s0; +a3 = 0x1; +f_demit_dir2(mem, sp, a0, a1, a2, a3); +goto L443010; +a3 = 0x1; +L443010: +gp = MEM_U32(sp + 184); +ra = MEM_U32(sp + 188); +goto L443204; +ra = MEM_U32(sp + 188); +L44301c: +//nop; +a1 = MEM_U32(s1 + 0); +a2 = s0; +a3 = zero; +f_demit_dir2(mem, sp, a0, a1, a2, a3); +goto L443030; +a3 = zero; +L443030: +gp = MEM_U32(sp + 184); +ra = MEM_U32(sp + 188); +goto L443204; +ra = MEM_U32(sp + 188); +L44303c: +//nop; +a1 = MEM_U32(s1 + 0); +a0 = 0x2; +f_demit_dir0(mem, sp, a0, a1); +goto L44304c; +a0 = 0x2; +L44304c: +gp = MEM_U32(sp + 184); +a0 = MEM_U8(s1 + 24); +//nop; +a1 = MEM_U32(s1 + 16); +//nop; +f_choose_area(mem, sp, a0, a1); +goto L443064; +//nop; +L443064: +gp = MEM_U32(sp + 184); +a0 = 0x3; +//nop; +//nop; +//nop; +f_force_alignment(mem, sp, a0); +goto L44307c; +//nop; +L44307c: +gp = MEM_U32(sp + 184); +a0 = s1; +//nop; +//nop; +//nop; +f_emit_init(mem, sp, a0); +goto L443094; +//nop; +L443094: +gp = MEM_U32(sp + 184); +ra = MEM_U32(sp + 188); +goto L443204; +ra = MEM_U32(sp + 188); +L4430a0: +s0 = MEM_U32(s1 + 40); +//nop; +if (s0 == 0) {ra = MEM_U32(sp + 188); +goto L443204;} +ra = MEM_U32(sp + 188); +L4430b0: +t2 = MEM_U32(s0 + 4); +at = 0x1; +if (t2 != at) {//nop; +goto L4430dc;} +//nop; +//nop; +a0 = MEM_U32(s0 + 0); +a1 = MEM_U32(s1 + 0); +//nop; +f_demit_weakext(mem, sp, a0, a1); +goto L4430d4; +//nop; +L4430d4: +gp = MEM_U32(sp + 184); +//nop; +L4430dc: +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 != 0) {//nop; +goto L4430b0;} +//nop; +ra = MEM_U32(sp + 188); +goto L443204; +ra = MEM_U32(sp + 188); +L4430f4: +t3 = 0x1000bc68; +a0 = 0x4; +t3 = t3; +t5 = t3 + 0x48; +a1 = 0x396; +t6 = sp; +L44310c: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t6 = t6 + 0xc; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t6 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 4 + 3) = (uint8_t)(at >> 0); +if (t3 != t5) {//swr $at, 7($t6) +goto L44310c;} +//swr $at, 7($t6) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t7 = 0x1000bc18; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +t7 = t7; +MEM_U8(t6 + 12 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t6 + 12 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t6 + 12 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t6 + 12 + 3) = (uint8_t)(t5 >> 0); +t9 = t7 + 0x48; +t0 = sp; +//swr $t5, 0xf($t6) +L44317c: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t0 = t0 + 0xc; +MEM_U8(t0 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t0) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t0 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 84 + 3) = (uint8_t)(at >> 0); +if (t7 != t9) {//swr $at, 0x57($t0) +goto L44317c;} +//swr $at, 0x57($t0) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +//nop; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +t9 = t7 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t7) +//nop; +MEM_U8(t0 + 92 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t0 + 92 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t0 + 92 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t0 + 92 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x5f($t0) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4431f8; +//nop; +L4431f8: +gp = MEM_U32(sp + 184); +//nop; +L443200: +ra = MEM_U32(sp + 188); +L443204: +s0 = MEM_U32(sp + 176); +s1 = MEM_U32(sp + 180); +sp = sp + 0xc0; +return; +sp = sp + 0xc0; +} + +static void f_output_decls(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L443214: +//output_decls: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 36) = s3; +s3 = 0x100058f0; +MEM_U32(sp + 24) = s0; +s0 = MEM_U32(s3 + 0); +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 32) = s2; +if (s0 == 0) {MEM_U32(sp + 28) = s1; +goto L443270;} +MEM_U32(sp + 28) = s1; +s1 = 0xffffffff; +L44324c: +//nop; +a0 = s0; +//nop; +f_emit_symbol(mem, sp, a0); +goto L44325c; +//nop; +L44325c: +MEM_U32(s0 + 0) = s1; +s0 = MEM_U32(s0 + 36); +gp = MEM_U32(sp + 40); +if (s0 != 0) {//nop; +goto L44324c;} +//nop; +L443270: +at = 0x100058f4; +s2 = 0x1001a040; +MEM_U32(s3 + 0) = zero; +s1 = 0xffffffff; +MEM_U32(at + 0) = zero; +s3 = s2 + 0x400; +L443288: +v0 = MEM_U32(s2 + 0); +//nop; +if (v0 == 0) {//nop; +goto L4432d8;} +//nop; +if (v0 == 0) {s0 = v0; +goto L4432d8;} +s0 = v0; +L4432a0: +t6 = MEM_U32(s0 + 0); +//nop; +if (s1 == t6) {//nop; +goto L4432c8;} +//nop; +//nop; +a0 = s0; +//nop; +f_emit_symbol(mem, sp, a0); +goto L4432c0; +//nop; +L4432c0: +gp = MEM_U32(sp + 40); +//nop; +L4432c8: +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 != 0) {//nop; +goto L4432a0;} +//nop; +L4432d8: +s2 = s2 + 0x4; +if (s2 != s3) {//nop; +goto L443288;} +//nop; +ra = MEM_U32(sp + 44); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void f_output_entry_point(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L443300: +//output_entry_point: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +//nop; +MEM_U32(sp + 188) = ra; +MEM_U32(sp + 172) = s0; +s0 = a0; +MEM_U32(sp + 184) = gp; +MEM_U32(sp + 180) = s2; +MEM_U32(sp + 176) = s1; +v0 = f_lookup_sym(mem, sp, a0); +goto L443330; +MEM_U32(sp + 176) = s1; +L443330: +gp = MEM_U32(sp + 184); +if (v0 != 0) {s2 = v0; +goto L44344c;} +s2 = v0; +t6 = 0x1000bd30; +a0 = 0x4; +t6 = t6; +t8 = t6 + 0x48; +a1 = 0x3c1; +t9 = sp; +L443354: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 7($t9) +goto L443354;} +//swr $at, 7($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t0 = 0x1000bce0; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +t0 = t0; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t0 + 0x48; +t3 = sp; +//swr $t8, 0xf($t9) +L4433c4: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 0x57($t3) +goto L4433c4;} +//swr $at, 0x57($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L443440; +//nop; +L443440: +gp = MEM_U32(sp + 184); +ra = MEM_U32(sp + 188); +goto L4434b8; +ra = MEM_U32(sp + 188); +L44344c: +//nop; +a0 = zero; +a1 = s0; +f_demit_dir0(mem, sp, a0, a1); +goto L44345c; +a1 = s0; +L44345c: +s0 = MEM_U32(s2 + 40); +gp = MEM_U32(sp + 184); +if (s0 == 0) {s1 = 0xa; +goto L4434b4;} +s1 = 0xa; +L44346c: +t4 = MEM_U8(s2 + 12); +//nop; +if (s1 != t4) {//nop; +goto L443494;} +//nop; +//nop; +a1 = MEM_U32(s0 + 0); +a0 = 0x2; +f_demit_dir0(mem, sp, a0, a1); +goto L44348c; +a0 = 0x2; +L44348c: +gp = MEM_U32(sp + 184); +//nop; +L443494: +//nop; +a1 = MEM_U32(s0 + 0); +a0 = zero; +f_demit_dir0(mem, sp, a0, a1); +goto L4434a4; +a0 = zero; +L4434a4: +s0 = MEM_U32(s0 + 8); +gp = MEM_U32(sp + 184); +if (s0 != 0) {//nop; +goto L44346c;} +//nop; +L4434b4: +ra = MEM_U32(sp + 188); +L4434b8: +s0 = MEM_U32(sp + 172); +s1 = MEM_U32(sp + 176); +s2 = MEM_U32(sp + 180); +sp = sp + 0xc0; +return; +sp = sp + 0xc0; +} + +static void f_set_mtag(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L443628: +//set_mtag: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 36) = a1; +v0 = f_lookup_sym(mem, sp, a0); +goto L44364c; +MEM_U32(sp + 36) = a1; +L44364c: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 36); +if (v0 == 0) {ra = MEM_U32(sp + 28); +goto L443684;} +ra = MEM_U32(sp + 28); +t6 = MEM_U32(v0 + 20); +//nop; +if (t6 != 0) {ra = MEM_U32(sp + 28); +goto L443684;} +ra = MEM_U32(sp + 28); +t7 = MEM_U32(a1 + 0); +//nop; +t9 = t7 + 0x1; +MEM_U32(a1 + 0) = t9; +MEM_U32(v0 + 20) = t9; +ra = MEM_U32(sp + 28); +L443684: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t f_get_mtag(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L443690: +//get_mtag: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +v0 = f_lookup_sym(mem, sp, a0); +goto L4436b0; +MEM_U32(sp + 24) = gp; +L4436b0: +gp = MEM_U32(sp + 24); +if (v0 == 0) {//nop; +goto L4436c8;} +//nop; +v1 = MEM_U32(v0 + 20); +ra = MEM_U32(sp + 28); +goto L4436dc; +ra = MEM_U32(sp + 28); +L4436c8: +v1 = 0x10018e64; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +ra = MEM_U32(sp + 28); +L4436dc: +sp = sp + 0x20; +v0 = v1; +return v0; +v0 = v1; +} + +static uint32_t f_get_sym_kind(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4436e8: +//get_sym_kind: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +v0 = f_lookup_sym(mem, sp, a0); +goto L443708; +MEM_U32(sp + 24) = gp; +L443708: +gp = MEM_U32(sp + 24); +if (v0 == 0) {v1 = zero; +goto L443720;} +v1 = zero; +v1 = MEM_U8(v0 + 12); +ra = MEM_U32(sp + 28); +goto L443724; +ra = MEM_U32(sp + 28); +L443720: +ra = MEM_U32(sp + 28); +L443724: +sp = sp + 0x20; +v0 = v1; +return v0; +v0 = v1; +//nop; +//nop; +} + +static void f_init_temps(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L443738: +//init_temps: +//nop; +//nop; +//nop; +at = 0x1001a440; +t6 = 0x1; +MEM_U32(at + 0) = zero; +at = 0x1001a448; +MEM_U8(at + 0) = (uint8_t)t6; +return; +MEM_U8(at + 0) = (uint8_t)t6; +} + +static uint32_t f_lookup_temp(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44375c: +//lookup_temp: +//nop; +//nop; +//nop; +v1 = 0x1001a440; +MEM_U32(sp + 0) = a0; +v1 = MEM_U32(v1 + 0); +v0 = zero; +if (v1 == 0) {//nop; +goto L4437b8;} +//nop; +L443780: +t6 = MEM_U8(v1 + 0); +//nop; +if (a0 != t6) {//nop; +goto L4437a8;} +//nop; +t7 = MEM_U8(v1 + 4); +//nop; +if (t7 != 0) {//nop; +goto L4437a8;} +//nop; +v0 = v1; +return v0; +v0 = v1; +L4437a8: +v1 = MEM_U32(v1 + 16); +//nop; +if (v1 != 0) {//nop; +goto L443780;} +//nop; +L4437b8: +//nop; +return v0; +//nop; +} + +static uint32_t f_make_new_temp(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4437c0: +//make_new_temp: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 180) = ra; +a2 = a0; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 192) = a2; +a0 = 0x14; +a1 = 0x1; +v0 = f_new(mem, sp, a0, a1); +goto L4437f0; +a1 = 0x1; +L4437f0: +gp = MEM_U32(sp + 176); +a2 = MEM_U32(sp + 192); +if (v0 != 0) {v1 = v0; +goto L443914;} +v1 = v0; +t6 = 0x1000be70; +a0 = 0x4; +t6 = t6; +t8 = t6 + 0x48; +a1 = 0x4c; +t9 = sp; +L443818: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 7($t9) +goto L443818;} +//swr $at, 7($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t2 = 0x1000be20; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +t2 = t2; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t8 >> 0); +t4 = t2 + 0x48; +t5 = sp; +//swr $t8, 0xf($t9) +L443888: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t5 = t5 + 0xc; +MEM_U8(t5 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t5) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t5 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 84 + 3) = (uint8_t)(at >> 0); +if (t2 != t4) {//swr $at, 0x57($t5) +goto L443888;} +//swr $at, 0x57($t5) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +//nop; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +t4 = t2 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t2) +//nop; +MEM_U8(t5 + 92 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t5 + 92 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t5 + 92 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t5 + 92 + 3) = (uint8_t)(t4 >> 0); +//swr $t4, 0x5f($t5) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +MEM_U32(sp + 184) = v1; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L443904; +MEM_U32(sp + 184) = v1; +L443904: +gp = MEM_U32(sp + 176); +v0 = MEM_U32(sp + 184); +ra = MEM_U32(sp + 180); +goto L443988; +ra = MEM_U32(sp + 180); +L443914: +at = (int)a2 < (int)0x5; +if (at != 0) {//nop; +goto L443940;} +//nop; +a3 = 0x1001a444; +//nop; +a0 = MEM_U32(a3 + 0); +//nop; +v0 = a0 & 0x7; +if (v0 == 0) {t7 = a0 + v0; +goto L443940;} +t7 = a0 + v0; +MEM_U32(a3 + 0) = t7; +L443940: +a3 = 0x1001a444; +t0 = 0x1001a448; +t1 = 0x1001a440; +a0 = MEM_U32(a3 + 0); +a1 = MEM_U8(t0 + 0); +t9 = MEM_U32(t1 + 0); +t6 = a0 + a2; +t8 = a1 + 0x1; +MEM_U8(v1 + 4) = (uint8_t)zero; +MEM_U32(v1 + 8) = a2; +v0 = v1; +MEM_U32(a3 + 0) = t6; +MEM_U8(t0 + 0) = (uint8_t)t8; +MEM_U32(t1 + 0) = v1; +MEM_U32(v1 + 12) = a0; +MEM_U8(v1 + 0) = (uint8_t)a1; +MEM_U32(v1 + 16) = t9; +ra = MEM_U32(sp + 180); +L443988: +sp = sp + 0xc0; +//nop; +return v0; +//nop; +} + +static uint32_t f_find_free_temp(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L443994: +//find_free_temp: +//nop; +//nop; +//nop; +v1 = 0x1001a440; +v0 = zero; +v1 = MEM_U32(v1 + 0); +//nop; +if (v1 == 0) {//nop; +goto L4439f4;} +//nop; +L4439b8: +t6 = MEM_U8(v1 + 4); +//nop; +if (t6 == 0) {//nop; +goto L4439e4;} +//nop; +t7 = MEM_U32(v1 + 8); +//nop; +if (a0 != t7) {//nop; +goto L4439e4;} +//nop; +MEM_U8(v1 + 4) = (uint8_t)zero; +v0 = v1; +return v0; +v0 = v1; +L4439e4: +v1 = MEM_U32(v1 + 16); +//nop; +if (v1 != 0) {//nop; +goto L4439b8;} +//nop; +L4439f4: +//nop; +return v0; +//nop; +} + +static void f_gen_store(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L4439fc: +//gen_store: +//nop; +//nop; +//nop; +sp = sp + 0xffffff38; +MEM_U32(sp + 200) = a0; +t6 = MEM_U8(sp + 203); +MEM_U32(sp + 180) = ra; +t7 = t6 < 0x20; +t8 = -t7; +t9 = t8 << (t6 & 0x1f); +if ((int)t9 >= 0) {MEM_U32(sp + 176) = gp; +goto L443b64;} +MEM_U32(sp + 176) = gp; +at = (int)a2 < (int)0x5; +if (at == 0) {t0 = 0x57; +goto L443a40;} +t0 = 0x57; +MEM_U16(sp + 198) = (uint16_t)t0; +goto L443c9c; +MEM_U16(sp + 198) = (uint16_t)t0; +L443a40: +at = (int)a2 < (int)0x9; +if (at == 0) {a0 = 0x4; +goto L443a58;} +a0 = 0x4; +t1 = 0x6d; +MEM_U16(sp + 198) = (uint16_t)t1; +goto L443c9c; +MEM_U16(sp + 198) = (uint16_t)t1; +L443a58: +t2 = 0x1000bfb0; +a1 = 0x7c; +t2 = t2; +t4 = t2 + 0x48; +t5 = sp; +L443a6c: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t5 = t5 + 0xc; +MEM_U8(t5 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t5) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t5 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 4 + 3) = (uint8_t)(at >> 0); +if (t2 != t4) {//swr $at, 7($t5) +goto L443a6c;} +//swr $at, 7($t5) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t7 = 0x1000bf60; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +t4 = t2 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t2) +t7 = t7; +MEM_U8(t5 + 12 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t5 + 12 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t5 + 12 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t5 + 12 + 3) = (uint8_t)(t4 >> 0); +t6 = t7 + 0x48; +t9 = sp; +//swr $t4, 0xf($t5) +L443adc: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t9 = t9 + 0xc; +MEM_U8(t9 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t9) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t9 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 84 + 3) = (uint8_t)(at >> 0); +if (t7 != t6) {//swr $at, 0x57($t9) +goto L443adc;} +//swr $at, 0x57($t9) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +//nop; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +t6 = t7 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t7) +//nop; +MEM_U8(t9 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t9 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t9 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t9 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t9) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L443b58; +//nop; +L443b58: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L443e9c; +ra = MEM_U32(sp + 180); +L443b64: +at = (int)a2 < (int)0x5; +if (at == 0) {t0 = 0x79; +goto L443b78;} +t0 = 0x79; +MEM_U16(sp + 198) = (uint16_t)t0; +goto L443c9c; +MEM_U16(sp + 198) = (uint16_t)t0; +L443b78: +at = (int)a2 < (int)0x9; +if (at == 0) {a0 = 0x4; +goto L443b90;} +a0 = 0x4; +t1 = 0x7a; +MEM_U16(sp + 198) = (uint16_t)t1; +goto L443c9c; +MEM_U16(sp + 198) = (uint16_t)t1; +L443b90: +t3 = 0x1000bf10; +a1 = 0x85; +t3 = t3; +t2 = t3 + 0x48; +t5 = sp; +L443ba4: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t5 = t5 + 0xc; +MEM_U8(t5 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t5) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t5 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 4 + 3) = (uint8_t)(at >> 0); +if (t3 != t2) {//swr $at, 7($t5) +goto L443ba4;} +//swr $at, 7($t5) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t8 = 0x1000bec0; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +t2 = t3 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t3) +t8 = t8; +MEM_U8(t5 + 12 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t5 + 12 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t5 + 12 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t5 + 12 + 3) = (uint8_t)(t2 >> 0); +t7 = t8 + 0x48; +t9 = sp; +//swr $t2, 0xf($t5) +L443c14: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t9 = t9 + 0xc; +MEM_U8(t9 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t9) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t9 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 84 + 3) = (uint8_t)(at >> 0); +if (t8 != t7) {//swr $at, 0x57($t9) +goto L443c14;} +//swr $at, 0x57($t9) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +//nop; +MEM_U8(t9 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t9) +t7 = t8 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t8) +//nop; +MEM_U8(t9 + 92 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t9 + 92 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t9 + 92 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t9 + 92 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x5f($t9) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L443c90; +//nop; +L443c90: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L443e9c; +ra = MEM_U32(sp + 180); +L443c9c: +t0 = 0x10019398; +t1 = MEM_U16(sp + 198); +t0 = MEM_U8(t0 + 0); +t9 = MEM_U16(sp + 198); +if (t0 == 0) {at = 0x6d; +goto L443dbc;} +at = 0x6d; +at = 0x6d; +if (t1 != at) {t6 = a2 + 0x3; +goto L443d6c;} +t6 = a2 + 0x3; +t4 = 0x10018ecc; +t2 = a2 + 0x3; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 != 0) {//nop; +goto L443d6c;} +//nop; +if ((int)t2 >= 0) {t3 = (int)t2 >> 2; +goto L443ce8;} +t3 = (int)t2 >> 2; +at = t2 + 0x3; +t3 = (int)at >> 2; +L443ce8: +//nop; +t5 = t3 << 2; +a0 = a1 + t5; +MEM_U32(sp + 188) = a0; +v0 = f_frame_offset1(mem, sp, a0); +goto L443cfc; +MEM_U32(sp + 188) = a0; +L443cfc: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(sp + 203); +a3 = 0x10019380; +//nop; +a3 = MEM_U8(a3 + 0); +a0 = 0x57; +a2 = v0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L443d20; +MEM_U32(sp + 16) = zero; +L443d20: +gp = MEM_U32(sp + 176); +a0 = MEM_U32(sp + 188); +//nop; +//nop; +//nop; +v0 = f_frame_offset1(mem, sp, a0); +goto L443d38; +//nop; +L443d38: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(sp + 203); +a3 = 0x10019380; +//nop; +a3 = MEM_U8(a3 + 0); +a0 = 0x57; +a2 = v0 + 0x4; +MEM_U32(sp + 16) = zero; +a1 = a1 + 0x1; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L443d60; +a1 = a1 + 0x1; +L443d60: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L443e9c; +ra = MEM_U32(sp + 180); +L443d6c: +//nop; +if ((int)t6 >= 0) {t7 = (int)t6 >> 2; +goto L443d80;} +t7 = (int)t6 >> 2; +at = t6 + 0x3; +t7 = (int)at >> 2; +L443d80: +t8 = t7 << 2; +a0 = a1 + t8; +v0 = f_frame_offset1(mem, sp, a0); +goto L443d8c; +a0 = a1 + t8; +L443d8c: +gp = MEM_U32(sp + 176); +a0 = MEM_U16(sp + 198); +a3 = 0x10019380; +//nop; +a1 = MEM_U8(sp + 203); +a3 = MEM_U8(a3 + 0); +a2 = v0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L443db0; +MEM_U32(sp + 16) = zero; +L443db0: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L443e9c; +ra = MEM_U32(sp + 180); +L443dbc: +if (t9 != at) {//nop; +goto L443e5c;} +//nop; +t0 = 0x10018ecc; +//nop; +t0 = MEM_U8(t0 + 0); +//nop; +if (t0 != 0) {//nop; +goto L443e5c;} +//nop; +//nop; +a0 = a1; +MEM_U32(sp + 204) = a1; +v0 = f_frame_offset1(mem, sp, a0); +goto L443dec; +MEM_U32(sp + 204) = a1; +L443dec: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(sp + 203); +a3 = 0x10019380; +//nop; +a3 = MEM_U8(a3 + 0); +a0 = 0x57; +a2 = v0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L443e10; +MEM_U32(sp + 16) = zero; +L443e10: +gp = MEM_U32(sp + 176); +a0 = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +v0 = f_frame_offset1(mem, sp, a0); +goto L443e28; +//nop; +L443e28: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(sp + 203); +a3 = 0x10019380; +//nop; +a3 = MEM_U8(a3 + 0); +a0 = 0x57; +a2 = v0 + 0x4; +MEM_U32(sp + 16) = zero; +a1 = a1 + 0x1; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L443e50; +a1 = a1 + 0x1; +L443e50: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L443e9c; +ra = MEM_U32(sp + 180); +L443e5c: +//nop; +a0 = a1; +//nop; +v0 = f_frame_offset1(mem, sp, a0); +goto L443e6c; +//nop; +L443e6c: +gp = MEM_U32(sp + 176); +a0 = MEM_U16(sp + 198); +a3 = 0x10019380; +//nop; +a1 = MEM_U8(sp + 203); +a3 = MEM_U8(a3 + 0); +a2 = v0; +MEM_U32(sp + 16) = zero; +f_emit_rob(mem, sp, a0, a1, a2, a3); +goto L443e90; +MEM_U32(sp + 16) = zero; +L443e90: +gp = MEM_U32(sp + 176); +//nop; +ra = MEM_U32(sp + 180); +L443e9c: +sp = sp + 0xc8; +//nop; +return; +//nop; +} + +static void f_spill_to_temp(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L443ea8: +//spill_to_temp: +//nop; +//nop; +//nop; +t6 = 0x10018ecc; +sp = sp + 0xffffffd8; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 20) = s0; +s0 = a1; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if (t6 != 0) {MEM_U32(sp + 40) = a0; +goto L443efc;} +MEM_U32(sp + 40) = a0; +//nop; +a0 = MEM_U8(sp + 43); +//nop; +v0 = f_kind_of_register(mem, sp, a0); +goto L443ee8; +//nop; +L443ee8: +gp = MEM_U32(sp + 24); +at = 0x6; +if (v0 != at) {//nop; +goto L443efc;} +//nop; +s0 = 0x8; +L443efc: +//nop; +a0 = s0; +//nop; +v0 = f_find_free_temp(mem, sp, a0); +goto L443f0c; +//nop; +L443f0c: +gp = MEM_U32(sp + 24); +if (v0 != 0) {v1 = v0; +goto L443f30;} +v1 = v0; +//nop; +a0 = s0; +//nop; +v0 = f_make_new_temp(mem, sp, a0); +goto L443f28; +//nop; +L443f28: +gp = MEM_U32(sp + 24); +v1 = v0; +L443f30: +//nop; +a0 = MEM_U8(sp + 43); +MEM_U32(sp + 36) = v1; +v0 = f_content_of(mem, sp, a0); +goto L443f40; +MEM_U32(sp + 36) = v1; +L443f40: +v1 = MEM_U32(sp + 36); +gp = MEM_U32(sp + 24); +t7 = MEM_U8(v1 + 0); +//nop; +MEM_U8(v0 + 24) = (uint8_t)t7; +//nop; +a0 = MEM_U8(sp + 43); +//nop; +v0 = f_usage_count(mem, sp, a0); +goto L443f64; +//nop; +L443f64: +gp = MEM_U32(sp + 24); +v1 = MEM_U32(sp + 36); +//nop; +a0 = MEM_U8(sp + 43); +a1 = MEM_U32(v1 + 12); +a2 = s0; +MEM_U16(v1 + 2) = (uint16_t)v0; +MEM_U32(v1 + 8) = s0; +f_gen_store(mem, sp, a0, a1, a2); +goto L443f88; +MEM_U32(v1 + 8) = s0; +L443f88: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +s0 = MEM_U32(sp + 20); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_free_temp(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L443f9c: +//free_temp: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffff48; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 184) = a0; +v0 = f_lookup_temp(mem, sp, a0); +goto L443fc0; +MEM_U32(sp + 184) = a0; +L443fc0: +gp = MEM_U32(sp + 176); +if (v0 != 0) {t4 = 0x1; +goto L4440dc;} +t4 = 0x1; +t6 = 0x1000c050; +a0 = 0x4; +t6 = t6; +t8 = t6 + 0x48; +a1 = 0xc0; +t9 = sp; +L443fe4: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 7($t9) +goto L443fe4;} +//swr $at, 7($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t0 = 0x1000c000; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +t0 = t0; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t0 + 0x48; +t3 = sp; +//swr $t8, 0xf($t9) +L444054: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 0x57($t3) +goto L444054;} +//swr $at, 0x57($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4440d0; +//nop; +L4440d0: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L4440e4; +ra = MEM_U32(sp + 180); +L4440dc: +MEM_U8(v0 + 4) = (uint8_t)t4; +ra = MEM_U32(sp + 180); +L4440e4: +sp = sp + 0xb8; +//nop; +return; +//nop; +} + +static uint32_t f_temp_offset(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4440f0: +//temp_offset: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 192) = a0; +v0 = f_lookup_temp(mem, sp, a0); +goto L444114; +MEM_U32(sp + 192) = a0; +L444114: +gp = MEM_U32(sp + 176); +if (v0 != 0) {v1 = v0; +goto L444230;} +v1 = v0; +t6 = 0x1000c0f0; +a0 = 0x4; +t6 = t6; +t8 = t6 + 0x48; +a1 = 0xcc; +t9 = sp; +L444138: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 7($t9) +goto L444138;} +//swr $at, 7($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t0 = 0x1000c0a0; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +t0 = t0; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t0 + 0x48; +t3 = sp; +//swr $t8, 0xf($t9) +L4441a8: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 0x57($t3) +goto L4441a8;} +//swr $at, 0x57($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L444224; +//nop; +L444224: +gp = MEM_U32(sp + 176); +v0 = MEM_U32(sp + 188); +goto L444240; +v0 = MEM_U32(sp + 188); +L444230: +v0 = MEM_U32(v1 + 12); +ra = MEM_U32(sp + 180); +goto L444248; +ra = MEM_U32(sp + 180); +v0 = MEM_U32(sp + 188); +L444240: +//nop; +ra = MEM_U32(sp + 180); +L444248: +sp = sp + 0xc0; +//nop; +return v0; +//nop; +} + +static uint32_t f_temp_usage_count(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L444254: +//temp_usage_count: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 192) = a0; +v0 = f_lookup_temp(mem, sp, a0); +goto L444278; +MEM_U32(sp + 192) = a0; +L444278: +gp = MEM_U32(sp + 176); +if (v0 != 0) {v1 = v0; +goto L444394;} +v1 = v0; +t6 = 0x1000c190; +a0 = 0x4; +t6 = t6; +t8 = t6 + 0x48; +a1 = 0xd8; +t9 = sp; +L44429c: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 7($t9) +goto L44429c;} +//swr $at, 7($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t0 = 0x1000c140; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +t0 = t0; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t0 + 0x48; +t3 = sp; +//swr $t8, 0xf($t9) +L44430c: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 0x57($t3) +goto L44430c;} +//swr $at, 0x57($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L444388; +//nop; +L444388: +gp = MEM_U32(sp + 176); +v0 = MEM_U16(sp + 188); +goto L4443a4; +v0 = MEM_U16(sp + 188); +L444394: +v0 = MEM_U16(v1 + 2); +ra = MEM_U32(sp + 180); +goto L4443ac; +ra = MEM_U32(sp + 180); +v0 = MEM_U16(sp + 188); +L4443a4: +//nop; +ra = MEM_U32(sp + 180); +L4443ac: +sp = sp + 0xc0; +//nop; +return v0; +//nop; +} + +static uint32_t f_get_temp_area_size(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4443b8: +//get_temp_area_size: +//nop; +//nop; +//nop; +v0 = 0x1001a440; +v1 = zero; +v0 = MEM_U32(v0 + 0); +//nop; +if (v0 == 0) {//nop; +goto L4443f0;} +//nop; +L4443dc: +t6 = MEM_U32(v0 + 8); +v0 = MEM_U32(v0 + 16); +v1 = v1 + t6; +if (v0 != 0) {//nop; +goto L4443dc;} +//nop; +L4443f0: +v0 = v1; +return v0; +v0 = v1; +} + +static void f_set_temps_offset(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4443f8: +//set_temps_offset: +//nop; +//nop; +//nop; +at = 0x1001a444; +MEM_U32(at + 0) = a0; +return; +MEM_U32(at + 0) = a0; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +} + +static void f_force_casting(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L444430: +//force_casting: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +at = (int)a1 < (int)0x5; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if (at == 0) {MEM_U32(sp + 40) = a0; +goto L4444e4;} +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 32) = zero; +t7 = MEM_U32(a0 + 48); +t8 = a1 + 0xffffffff; +at = t8 < 0x4; +if (at == 0) {MEM_U32(sp + 36) = t7; +goto L4444b0;} +MEM_U32(sp + 36) = t7; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c1ec[] = { +&&L4444a4, +&&L444498, +&&L4444b0, +&&L44448c, +}; +dest = Lswitch1000c1ec[t8]; +//nop; +goto *dest; +//nop; +L44448c: +t9 = MEM_U32(sp + 36); +MEM_U32(sp + 32) = t9; +goto L4444d4; +MEM_U32(sp + 32) = t9; +L444498: +t0 = MEM_U16(sp + 38); +MEM_U16(sp + 34) = (uint16_t)t0; +goto L4444d4; +MEM_U16(sp + 34) = (uint16_t)t0; +L4444a4: +t1 = MEM_U8(sp + 39); +MEM_U8(sp + 35) = (uint8_t)t1; +goto L4444d4; +MEM_U8(sp + 35) = (uint8_t)t1; +L4444b0: +a2 = 0x1000c1e0; +//nop; +a0 = 0x1; +a1 = 0x113; +a3 = 0xb; +a2 = a2; +f_caseerror(mem, sp, a0, a1, a2, a3); +goto L4444cc; +a2 = a2; +L4444cc: +gp = MEM_U32(sp + 24); +//nop; +L4444d4: +t2 = MEM_U32(sp + 32); +t3 = MEM_U32(sp + 40); +//nop; +MEM_U32(t3 + 48) = t2; +L4444e4: +ra = MEM_U32(sp + 28); +sp = sp + 0x28; +//nop; +return; +//nop; +} + +static uint32_t f_is_power_of_two(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4444f4: +//is_power_of_two: +if ((int)a0 >= 0) {v0 = zero; +goto L444504;} +v0 = zero; +v0 = zero; +return v0; +v0 = zero; +L444504: +a1 = 0x20; +v1 = 0x1; +L44450c: +t6 = a0 & 0x1; +if (v1 != t6) {t8 = (int)a0 >> 1; +goto L444534;} +t8 = (int)a0 >> 1; +t7 = a0 >> 1; +if (t7 != 0) {//nop; +goto L44452c;} +//nop; +v0 = 0x1; +return v0; +v0 = 0x1; +L44452c: +v0 = zero; +return v0; +v0 = zero; +L444534: +v0 = v0 + 0x1; +if (v0 != a1) {a0 = t8; +goto L44450c;} +a0 = t8; +v0 = 0x1; +//nop; +return v0; +//nop; +} + +static uint32_t f_get_set_const(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L44454c: +//get_set_const: +//nop; +//nop; +//nop; +MEM_U32(sp + 8) = a2; +v0 = MEM_U32(a0 + 0); +v1 = a1 + a2; +if ((int)v1 >= 0) {a3 = (int)v1 >> 2; +goto L444574;} +a3 = (int)v1 >> 2; +at = v1 + 0x3; +a3 = (int)at >> 2; +L444574: +at = (int)v0 < (int)a3; +if (at == 0) {//nop; +goto L444584;} +//nop; +abort(); +L444584: +t6 = 0x10018e80; +t0 = zero; +t6 = MEM_U8(t6 + 0); +t1 = a3; +if (t6 != 0) {//nop; +goto L4445b4;} +//nop; +if ((int)a1 >= 0) {a2 = (int)a1 >> 2; +goto L4445ac;} +a2 = (int)a1 >> 2; +at = a1 + 0x3; +a2 = (int)at >> 2; +L4445ac: +a2 = a2 + 0x1; +goto L4445e8; +a2 = a2 + 0x1; +L4445b4: +a3 = v0 << 2; +t1 = a3 - a1; +if ((int)t1 >= 0) {t7 = (int)t1 >> 2; +goto L4445cc;} +t7 = (int)t1 >> 2; +at = t1 + 0x3; +t7 = (int)at >> 2; +L4445cc: +a2 = a3 - v1; +t1 = t7; +if ((int)a2 >= 0) {t8 = (int)a2 >> 2; +goto L4445e4;} +t8 = (int)a2 >> 2; +at = a2 + 0x3; +t8 = (int)at >> 2; +L4445e4: +a2 = t8 + 0x1; +L4445e8: +at = t1 < a2; +if (at != 0) {v0 = t1 + 0x1; +goto L4446a8;} +v0 = t1 + 0x1; +t1 = v0 - a2; +t9 = t1 & 0x3; +if (t9 == 0) {v1 = a2; +goto L444640;} +v1 = a2; +t2 = MEM_U32(a0 + 4); +a3 = t9 + a2; +a1 = t2 + a2; +a2 = 0x1000599c; +//nop; +L444618: +t4 = MEM_U8(a1 + -1); +t3 = t0 << 4; +t5 = a2 + t4; +t6 = MEM_U8(t5 + 0); +v1 = v1 + 0x1; +a1 = a1 + 0x1; +if (a3 != v1) {t0 = t3 + t6; +goto L444618;} +t0 = t3 + t6; +if (v1 == v0) {//nop; +goto L4446a8;} +//nop; +L444640: +t7 = MEM_U32(a0 + 4); +a2 = 0x1000599c; +a1 = t7 + v1; +L44464c: +t9 = MEM_U8(a1 + -1); +t3 = MEM_U8(a1 + 0); +t2 = a2 + t9; +t4 = MEM_U8(t2 + 0); +t8 = t0 << 4; +t6 = a2 + t3; +t7 = MEM_U8(t6 + 0); +t0 = t8 + t4; +t2 = MEM_U8(a1 + 1); +t5 = t0 << 4; +t0 = t5 + t7; +t6 = MEM_U8(a1 + 2); +t8 = a2 + t2; +t4 = MEM_U8(t8 + 0); +t9 = t0 << 4; +t5 = a2 + t6; +t7 = MEM_U8(t5 + 0); +t0 = t9 + t4; +t3 = t0 << 4; +v1 = v1 + 0x4; +a1 = a1 + 0x4; +if (v1 != v0) {t0 = t3 + t7; +goto L44464c;} +t0 = t3 + t7; +L4446a8: +v0 = t0; +return v0; +v0 = t0; +} + +static void f_gen_set_str(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4446b0: +//gen_set_str: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb0; +MEM_U32(sp + 60) = ra; +MEM_U32(sp + 56) = fp; +MEM_U32(sp + 52) = gp; +MEM_U32(sp + 48) = s7; +MEM_U32(sp + 44) = s6; +MEM_U32(sp + 40) = s5; +MEM_U32(sp + 36) = s4; +MEM_U32(sp + 32) = s3; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +t6 = MEM_U8(a0 + 32); +at = 0x8000000; +t7 = t6 + 0xffffffa0; +t8 = t7 < 0x20; +t9 = -t8; +at = at | 0x10; +t0 = t9 & at; +t1 = t0 << (t7 & 0x1f); +s1 = a0; +if ((int)t1 < 0) {//nop; +goto L44471c;} +//nop; +abort(); +L44471c: +t2 = MEM_U32(s1 + 8); +fp = MEM_U32(s1 + 0); +//nop; +s4 = s1; +a1 = zero; +a2 = 0x20; +MEM_U32(sp + 72) = t2; +a0 = fp; +v0 = f_set_rewrite(mem, sp, a0, a1, a2); +goto L444740; +a0 = fp; +L444740: +s3 = MEM_U32(s1 + 40); +gp = MEM_U32(sp + 52); +s3 = s3 + 0x3; +MEM_U32(s1 + 0) = v0; +if ((int)s3 >= 0) {t3 = (int)s3 >> 2; +goto L444760;} +t3 = (int)s3 >> 2; +at = s3 + 0x3; +t3 = (int)at >> 2; +L444760: +s3 = t3 + 0xffffffff; +if (s3 == 0) {s2 = 0x20; +goto L44481c;} +s2 = 0x20; +s3 = s3 + 0x1; +s5 = s3 << 2; +s0 = 0x4; +s7 = 0x4; +s6 = 0xffffffe0; +L444780: +//nop; +a0 = fp; +a1 = s2; +a2 = 0x20; +v0 = f_set_rewrite(mem, sp, a0, a1, a2); +goto L444794; +a2 = 0x20; +L444794: +gp = MEM_U32(sp + 52); +a0 = MEM_U8(s1 + 32); +//nop; +a1 = v0; +//nop; +v0 = f_build_1op(mem, sp, a0, a1); +goto L4447ac; +//nop; +L4447ac: +t4 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 52); +t5 = t4 & s6; +v1 = t5 | 0xe; +MEM_U8(v0 + 33) = (uint8_t)v1; +t8 = MEM_U8(s1 + 33); +t7 = v1 << 24; +t9 = t8 << 24; +t0 = t9 >> 29; +t1 = t7 >> 29; +t2 = t0 ^ t1; +t3 = t2 << 29; +t4 = t3 >> 24; +t5 = t4 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t5; +t6 = MEM_U32(s1 + 36); +s2 = s2 + 0x20; +MEM_U32(v0 + 36) = t6; +t8 = MEM_U32(s1 + 44); +MEM_U32(v0 + 40) = s7; +t9 = t8 + s0; +MEM_U32(v0 + 44) = t9; +MEM_U16(v0 + 34) = (uint16_t)zero; +MEM_U32(s4 + 8) = v0; +s0 = s0 + 0x4; +if (s0 != s5) {s4 = v0; +goto L444780;} +s4 = v0; +MEM_U32(sp + 68) = v0; +L44481c: +a1 = MEM_U32(sp + 68); +t7 = MEM_U32(sp + 72); +//nop; +s7 = 0x4; +MEM_U32(a1 + 8) = t7; +MEM_U32(s1 + 40) = s7; +MEM_U16(s1 + 34) = (uint16_t)zero; +a0 = fp; +f_free_tree(mem, sp, a0); +goto L444840; +a0 = fp; +L444840: +ra = MEM_U32(sp + 60); +gp = MEM_U32(sp + 52); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +s3 = MEM_U32(sp + 32); +s4 = MEM_U32(sp + 36); +s5 = MEM_U32(sp + 40); +s6 = MEM_U32(sp + 44); +s7 = MEM_U32(sp + 48); +fp = MEM_U32(sp + 56); +sp = sp + 0x50; +return; +sp = sp + 0x50; +} + +static void f_gen_set_istr(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L444874: +//gen_set_istr: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb0; +MEM_U32(sp + 60) = ra; +MEM_U32(sp + 56) = fp; +MEM_U32(sp + 52) = gp; +MEM_U32(sp + 48) = s7; +MEM_U32(sp + 44) = s6; +MEM_U32(sp + 40) = s5; +MEM_U32(sp + 36) = s4; +MEM_U32(sp + 32) = s3; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +t6 = MEM_U8(a0 + 32); +s1 = a0; +t7 = t6 + 0xffffffe0; +t8 = t7 < 0x20; +t9 = -t8; +t0 = t9 & 0x3; +t1 = t0 << (t7 & 0x1f); +if ((int)t1 < 0) {//nop; +goto L4448d8;} +//nop; +abort(); +L4448d8: +t2 = MEM_U32(s1 + 8); +fp = MEM_U32(s1 + 4); +//nop; +s4 = s1; +a1 = zero; +a2 = 0x20; +MEM_U32(sp + 72) = t2; +a0 = fp; +v0 = f_set_rewrite(mem, sp, a0, a1, a2); +goto L4448fc; +a0 = fp; +L4448fc: +s6 = MEM_U32(s1 + 40); +gp = MEM_U32(sp + 52); +s6 = s6 + 0x3; +MEM_U32(s1 + 4) = v0; +if ((int)s6 >= 0) {t3 = (int)s6 >> 2; +goto L44491c;} +t3 = (int)s6 >> 2; +at = s6 + 0x3; +t3 = (int)at >> 2; +L44491c: +s6 = t3 + 0xffffffff; +if (s6 == 0) {s2 = 0x20; +goto L4449f0;} +s2 = 0x20; +s6 = s6 + 0x1; +s5 = s6 << 2; +s0 = 0x4; +s7 = 0xffffffe0; +L444938: +//nop; +a0 = fp; +a1 = s2; +a2 = 0x20; +v0 = f_set_rewrite(mem, sp, a0, a1, a2); +goto L44494c; +a2 = 0x20; +L44494c: +gp = MEM_U32(sp + 52); +a0 = MEM_U32(s1 + 0); +//nop; +s3 = v0; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L444964; +//nop; +L444964: +gp = MEM_U32(sp + 52); +a0 = MEM_U8(s1 + 32); +//nop; +a1 = v0; +a2 = s3; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44497c; +a2 = s3; +L44497c: +t4 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 52); +t5 = t4 & s7; +v1 = t5 | 0xe; +MEM_U8(v0 + 33) = (uint8_t)v1; +t8 = MEM_U8(s1 + 33); +t7 = v1 << 24; +t9 = t8 << 24; +t0 = t9 >> 29; +t1 = t7 >> 29; +t2 = t0 ^ t1; +t3 = t2 << 29; +t4 = t3 >> 24; +t5 = t4 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t5; +t6 = MEM_U32(s1 + 36); +t7 = 0x4; +MEM_U32(v0 + 36) = t6; +t8 = MEM_U32(s1 + 44); +MEM_U32(v0 + 40) = t7; +t9 = t8 + s0; +MEM_U32(v0 + 44) = t9; +MEM_U16(v0 + 34) = (uint16_t)zero; +MEM_U32(s4 + 8) = v0; +s0 = s0 + 0x4; +s4 = v0; +if (s0 != s5) {s2 = s2 + 0x20; +goto L444938;} +s2 = s2 + 0x20; +MEM_U32(sp + 68) = v0; +L4449f0: +s3 = MEM_U32(sp + 68); +t0 = MEM_U32(sp + 72); +//nop; +t1 = 0x4; +MEM_U32(s3 + 8) = t0; +MEM_U32(s1 + 40) = t1; +MEM_U16(s1 + 34) = (uint16_t)zero; +a0 = fp; +f_free_tree(mem, sp, a0); +goto L444a14; +a0 = fp; +L444a14: +ra = MEM_U32(sp + 60); +gp = MEM_U32(sp + 52); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +s3 = MEM_U32(sp + 32); +s4 = MEM_U32(sp + 36); +s5 = MEM_U32(sp + 40); +s6 = MEM_U32(sp + 44); +s7 = MEM_U32(sp + 48); +fp = MEM_U32(sp + 56); +sp = sp + 0x50; +return; +sp = sp + 0x50; +} + +static uint32_t f_gen_set_equ(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L444a48: +//gen_set_equ: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +MEM_U32(sp + 60) = ra; +MEM_U32(sp + 56) = gp; +MEM_U32(sp + 52) = s7; +MEM_U32(sp + 48) = s6; +MEM_U32(sp + 44) = s5; +MEM_U32(sp + 40) = s4; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +t6 = MEM_U8(a0 + 32); +s5 = a0; +t7 = t6 + 0xffffffe0; +t8 = t7 < 0x40; +if (t8 == 0) {s4 = zero; +goto L444ac0;} +s4 = zero; +t1 = 0x10005abc; +t9 = (int)t7 >> 5; +t0 = t9 << 2; +t1 = t1; +t2 = t1 + t0; +t3 = MEM_U32(t2 + 0); +//nop; +t4 = t3 << (t7 & 0x1f); +t5 = (int)t4 < (int)0x0; +t8 = t5; +L444ac0: +if (t8 != 0) {//nop; +goto L444acc;} +//nop; +abort(); +L444acc: +a1 = MEM_U32(s5 + 0); +s7 = 0xffffffff; +v0 = MEM_U32(a1 + 40); +s6 = 0xffffffe0; +v0 = v0 + 0x3; +if ((int)v0 >= 0) {t6 = (int)v0 >> 2; +goto L444af0;} +t6 = (int)v0 >> 2; +at = v0 + 0x3; +t6 = (int)at >> 2; +L444af0: +s1 = t6 + 0xffffffff; +s2 = s1 << 5; +L444af8: +//nop; +a0 = MEM_U32(s5 + 0); +s0 = s2; +a1 = s2; +a2 = 0x20; +v0 = f_set_rewrite(mem, sp, a0, a1, a2); +goto L444b10; +a2 = 0x20; +L444b10: +gp = MEM_U32(sp + 56); +a0 = MEM_U32(s5 + 4); +//nop; +s3 = v0; +a1 = s0; +a2 = 0x20; +v0 = f_set_rewrite(mem, sp, a0, a1, a2); +goto L444b2c; +a2 = 0x20; +L444b2c: +gp = MEM_U32(sp + 56); +a0 = 0x8d; +//nop; +a1 = s3; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L444b44; +a2 = v0; +L444b44: +t9 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 56); +t1 = t9 & s6; +t0 = t1 | 0x8; +a2 = v0; +if (s4 != 0) {MEM_U8(v0 + 33) = (uint8_t)t0; +goto L444b68;} +MEM_U8(v0 + 33) = (uint8_t)t0; +s4 = v0; +goto L444b90; +s4 = v0; +L444b68: +//nop; +a0 = 0x3c; +a1 = s4; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L444b78; +a1 = s4; +L444b78: +t2 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 56); +t3 = t2 & s6; +t7 = t3 | 0x8; +s4 = v0; +MEM_U8(v0 + 33) = (uint8_t)t7; +L444b90: +s1 = s1 + 0xffffffff; +if (s1 != s7) {s2 = s2 + 0xffffffe0; +goto L444af8;} +s2 = s2 + 0xffffffe0; +//nop; +a0 = MEM_U32(s5 + 0); +s6 = 0xffffffe0; +f_free_tree(mem, sp, a0); +goto L444bac; +s6 = 0xffffffe0; +L444bac: +gp = MEM_U32(sp + 56); +a0 = MEM_U32(s5 + 4); +//nop; +//nop; +//nop; +f_free_tree(mem, sp, a0); +goto L444bc4; +//nop; +L444bc4: +gp = MEM_U32(sp + 56); +t4 = MEM_U8(s5 + 33); +//nop; +t5 = t4 & s6; +t8 = t5 | 0x8; +MEM_U8(s5 + 33) = (uint8_t)t8; +MEM_U32(s5 + 0) = s4; +a0 = 0x8; +a1 = zero; +a2 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L444bf0; +a2 = zero; +L444bf0: +MEM_U32(s5 + 4) = v0; +ra = MEM_U32(sp + 60); +v0 = s5; +gp = MEM_U32(sp + 56); +s5 = MEM_U32(sp + 44); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +s4 = MEM_U32(sp + 40); +s6 = MEM_U32(sp + 48); +s7 = MEM_U32(sp + 52); +sp = sp + 0x40; +return v0; +sp = sp + 0x40; +} + +static uint32_t f_set_rewrite(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L444c28: +//set_rewrite: +//nop; +//nop; +//nop; +sp = sp + 0xffffff20; +MEM_U32(sp + 180) = s1; +MEM_U32(sp + 176) = s0; +a3 = a1; +a1 = 0x2; +s0 = a0; +s1 = a2 & 0xff; +MEM_U32(sp + 188) = ra; +MEM_U32(sp + 184) = gp; +MEM_U32(sp + 232) = a2; +t0 = 0xe; +L444c60: +v0 = MEM_U8(s0 + 32); +at = v0 < 0x3e; +goto L445370; +at = v0 < 0x3e; +L444c6c: +t6 = MEM_U8(s0 + 33); +a0 = s0 + 0x30; +t7 = t6 & 0x1f; +if (t0 == t7) {//nop; +goto L444c84;} +//nop; +abort(); +L444c84: +//nop; +a1 = a3; +a2 = s1; +v0 = f_get_set_const(mem, sp, a0, a1, a2); +goto L444c94; +a2 = s1; +L444c94: +gp = MEM_U32(sp + 184); +a0 = 0x8; +//nop; +a1 = zero; +a2 = v0; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L444cac; +a2 = v0; +L444cac: +t8 = s1 + 0x7; +gp = MEM_U32(sp + 184); +MEM_U32(sp + 216) = v0; +if ((int)t8 >= 0) {t9 = (int)t8 >> 3; +goto L444cc8;} +t9 = (int)t8 >> 3; +at = t8 + 0x7; +t9 = (int)at >> 3; +L444cc8: +MEM_U32(v0 + 40) = t9; +goto L44556c; +MEM_U32(v0 + 40) = t9; +L444cd0: +t1 = MEM_U8(s0 + 33); +//nop; +t2 = t1 & 0x1f; +if (t0 == t2) {//nop; +goto L444ce8;} +//nop; +abort(); +L444ce8: +//nop; +a0 = s0 + 0x20; +MEM_U32(sp + 228) = a3; +v0 = f_build_u(mem, sp, a0); +goto L444cf8; +MEM_U32(sp + 228) = a3; +L444cf8: +a3 = MEM_U32(sp + 228); +MEM_U32(sp + 216) = v0; +t3 = MEM_U32(v0 + 44); +gp = MEM_U32(sp + 184); +if ((int)a3 >= 0) {t4 = (int)a3 >> 3; +goto L444d18;} +t4 = (int)a3 >> 3; +at = a3 + 0x7; +t4 = (int)at >> 3; +L444d18: +t6 = s1 + 0x7; +t5 = t3 + t4; +MEM_U32(v0 + 44) = t5; +if ((int)t6 >= 0) {t7 = (int)t6 >> 3; +goto L444d34;} +t7 = (int)t6 >> 3; +at = t6 + 0x7; +t7 = (int)at >> 3; +L444d34: +MEM_U32(v0 + 40) = t7; +MEM_U16(v0 + 34) = (uint16_t)zero; +goto L44556c; +MEM_U16(v0 + 34) = (uint16_t)zero; +L444d40: +t8 = MEM_U8(s0 + 33); +//nop; +t9 = t8 & 0x1f; +if (t0 == t9) {//nop; +goto L444d58;} +//nop; +abort(); +L444d58: +//nop; +a0 = s0 + 0x20; +MEM_U32(sp + 228) = a3; +v0 = f_build_u(mem, sp, a0); +goto L444d68; +MEM_U32(sp + 228) = a3; +L444d68: +gp = MEM_U32(sp + 184); +a0 = MEM_U32(s0 + 0); +//nop; +MEM_U32(sp + 216) = v0; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L444d80; +//nop; +L444d80: +a3 = MEM_U32(sp + 228); +v1 = MEM_U32(sp + 216); +t4 = s1 + 0x7; +t1 = MEM_U32(v1 + 44); +gp = MEM_U32(sp + 184); +MEM_U32(v1 + 0) = v0; +if ((int)a3 >= 0) {t2 = (int)a3 >> 3; +goto L444da8;} +t2 = (int)a3 >> 3; +at = a3 + 0x7; +t2 = (int)at >> 3; +L444da8: +t3 = t1 + t2; +MEM_U32(v1 + 44) = t3; +if ((int)t4 >= 0) {t5 = (int)t4 >> 3; +goto L444dc0;} +t5 = (int)t4 >> 3; +at = t4 + 0x7; +t5 = (int)at >> 3; +L444dc0: +MEM_U32(v1 + 40) = t5; +MEM_U16(v1 + 34) = (uint16_t)zero; +goto L44556c; +MEM_U16(v1 + 34) = (uint16_t)zero; +L444dcc: +t6 = MEM_U8(s0 + 33); +a1 = a3; +t7 = t6 & 0x1f; +if (t0 == t7) {//nop; +goto L444de4;} +//nop; +abort(); +L444de4: +//nop; +a0 = MEM_U32(s0 + 0); +a2 = s1; +MEM_U32(sp + 228) = a3; +v0 = f_set_rewrite(mem, sp, a0, a1, a2); +goto L444df8; +MEM_U32(sp + 228) = a3; +L444df8: +gp = MEM_U32(sp + 184); +a1 = MEM_U32(sp + 228); +//nop; +a0 = MEM_U32(s0 + 4); +MEM_U32(sp + 192) = v0; +a2 = s1; +v0 = f_set_rewrite(mem, sp, a0, a1, a2); +goto L444e14; +a2 = s1; +L444e14: +gp = MEM_U32(sp + 184); +a0 = MEM_U8(s0 + 32); +//nop; +a1 = MEM_U32(sp + 192); +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L444e2c; +a2 = v0; +L444e2c: +t8 = s1 + 0x7; +gp = MEM_U32(sp + 184); +MEM_U32(sp + 216) = v0; +if ((int)t8 >= 0) {t9 = (int)t8 >> 3; +goto L444e48;} +t9 = (int)t8 >> 3; +at = t8 + 0x7; +t9 = (int)at >> 3; +L444e48: +MEM_U32(v0 + 40) = t9; +goto L44556c; +MEM_U32(v0 + 40) = t9; +L444e50: +v0 = MEM_U32(s0 + 44); +t4 = s1 & 0xff; +v1 = v0 << 3; +at = (int)a3 < (int)v1; +if (at != 0) {s1 = t4; +goto L444e8c;} +s1 = t4; +a0 = MEM_U32(s0 + 0); +//nop; +t1 = MEM_U32(a0 + 40); +//nop; +t2 = v0 + t1; +t3 = t2 << 3; +at = (int)a3 < (int)t3; +if (at != 0) {a3 = a3 - v1; +goto L444eac;} +a3 = a3 - v1; +L444e8c: +//nop; +a0 = 0x8; +a1 = zero; +a2 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L444ea0; +a2 = zero; +L444ea0: +gp = MEM_U32(sp + 184); +MEM_U32(sp + 216) = v0; +goto L44556c; +MEM_U32(sp + 216) = v0; +L444eac: +s0 = a0; +goto L444c60; +s0 = a0; +L444eb4: +a0 = MEM_U32(s0 + 0); +at = 0x49; +t5 = MEM_U8(a0 + 32); +//nop; +if (t5 != at) {//nop; +goto L444f64;} +//nop; +v0 = MEM_U32(a0 + 48); +t6 = a3 + s1; +at = (int)v0 < (int)a3; +if (at != 0) {a0 = 0x8; +goto L444eec;} +a0 = 0x8; +at = (int)v0 < (int)t6; +if (at != 0) {//nop; +goto L444f08;} +//nop; +L444eec: +//nop; +a1 = zero; +a2 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L444efc; +a2 = zero; +L444efc: +gp = MEM_U32(sp + 184); +MEM_U32(sp + 216) = v0; +goto L44556c; +MEM_U32(sp + 216) = v0; +L444f08: +t7 = 0x10018e80; +a0 = 0x8; +t7 = MEM_U8(t7 + 0); +a1 = zero; +if (t7 == 0) {t1 = v0 - a3; +goto L444f48;} +t1 = v0 - a3; +t8 = v0 - a3; +t9 = 0x1; +a2 = t9 << (t8 & 0x1f); +//nop; +a0 = 0x8; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L444f3c; +a1 = zero; +L444f3c: +gp = MEM_U32(sp + 184); +MEM_U32(sp + 216) = v0; +goto L44556c; +MEM_U32(sp + 216) = v0; +L444f48: +//nop; +t2 = 0x80000000; +a2 = t2 >> (t1 & 0x1f); +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L444f58; +a2 = t2 >> (t1 & 0x1f); +L444f58: +gp = MEM_U32(sp + 184); +MEM_U32(sp + 216) = v0; +goto L44556c; +MEM_U32(sp + 216) = v0; +L444f64: +if (a3 == 0) {//nop; +goto L444fc4;} +//nop; +//nop; +MEM_U32(sp + 228) = a3; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L444f7c; +//nop; +L444f7c: +gp = MEM_U32(sp + 184); +a3 = MEM_U32(sp + 228); +//nop; +MEM_U32(sp + 192) = v0; +a0 = 0x6; +a1 = zero; +a2 = -a3; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L444f9c; +a2 = -a3; +L444f9c: +gp = MEM_U32(sp + 184); +a1 = MEM_U32(sp + 192); +//nop; +a0 = 0x1; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L444fb4; +a2 = v0; +L444fb4: +gp = MEM_U32(sp + 184); +MEM_U32(sp + 216) = v0; +MEM_U16(v0 + 34) = (uint16_t)zero; +goto L444fdc; +MEM_U16(v0 + 34) = (uint16_t)zero; +L444fc4: +//nop; +//nop; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L444fd4; +//nop; +L444fd4: +gp = MEM_U32(sp + 184); +MEM_U32(sp + 216) = v0; +L444fdc: +//nop; +a0 = 0x8; +a1 = zero; +a2 = s1; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L444ff0; +a2 = s1; +L444ff0: +gp = MEM_U32(sp + 184); +a1 = MEM_U32(sp + 216); +//nop; +a0 = 0x4e; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445008; +a2 = v0; +L445008: +MEM_U32(sp + 216) = v0; +t3 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 184); +t4 = t3 & 0xffe0; +t5 = t4 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t5; +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L445030; +//nop; +L445030: +gp = MEM_U32(sp + 184); +s0 = v0; +t6 = 0x10018e80; +//nop; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L445068;} +//nop; +//nop; +a0 = 0x61; +a1 = v0; +v0 = f_build_1op(mem, sp, a0, a1); +goto L445060; +a1 = v0; +L445060: +gp = MEM_U32(sp + 184); +s0 = v0; +L445068: +//nop; +a1 = MEM_U32(sp + 216); +a0 = 0x73; +a2 = s0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44507c; +a2 = s0; +L44507c: +gp = MEM_U32(sp + 184); +MEM_U32(sp + 216) = v0; +goto L44556c; +MEM_U32(sp + 216) = v0; +L445088: +//nop; +a0 = MEM_U32(s0 + 0); +MEM_U32(sp + 228) = a3; +v0 = f_dup_tree(mem, sp, a0); +goto L445098; +MEM_U32(sp + 228) = a3; +L445098: +gp = MEM_U32(sp + 184); +a0 = MEM_U32(s0 + 4); +//nop; +MEM_U32(sp + 212) = v0; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L4450b0; +//nop; +L4450b0: +a3 = MEM_U32(sp + 228); +gp = MEM_U32(sp + 184); +if (a3 == 0) {s0 = v0; +goto L445100;} +s0 = v0; +//nop; +a0 = 0x6; +a1 = zero; +a2 = -a3; +MEM_U32(sp + 228) = a3; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L4450d8; +MEM_U32(sp + 228) = a3; +L4450d8: +gp = MEM_U32(sp + 184); +a1 = MEM_U32(sp + 212); +//nop; +a0 = 0x1; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L4450f0; +a2 = v0; +L4450f0: +gp = MEM_U32(sp + 184); +a3 = MEM_U32(sp + 228); +MEM_U32(sp + 212) = v0; +MEM_U16(v0 + 34) = (uint16_t)zero; +L445100: +at = 0xffffffff; +if (a3 == at) {a0 = 0x6; +goto L445144;} +a0 = 0x6; +//nop; +t7 = 0x1; +a2 = t7 - a3; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L445120; +a1 = zero; +L445120: +gp = MEM_U32(sp + 184); +a0 = 0x1; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445138; +a2 = v0; +L445138: +gp = MEM_U32(sp + 184); +s0 = v0; +MEM_U16(v0 + 34) = (uint16_t)zero; +L445144: +//nop; +a0 = 0x6; +a1 = zero; +a2 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L445158; +a2 = zero; +L445158: +gp = MEM_U32(sp + 184); +a1 = MEM_U32(sp + 212); +//nop; +a0 = 0x55; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445170; +a2 = v0; +L445170: +gp = MEM_U32(sp + 184); +MEM_U32(sp + 212) = v0; +//nop; +a0 = 0x6; +a1 = zero; +a2 = s1; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L44518c; +a2 = s1; +L44518c: +gp = MEM_U32(sp + 184); +a0 = 0x56; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L4451a4; +a2 = v0; +L4451a4: +gp = MEM_U32(sp + 184); +a1 = MEM_U32(sp + 212); +//nop; +a0 = 0x7d; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L4451bc; +a2 = v0; +L4451bc: +gp = MEM_U32(sp + 184); +MEM_U16(v0 + 34) = (uint16_t)zero; +//nop; +s0 = v0; +a0 = 0x8; +a1 = zero; +a2 = 0x1f; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L4451dc; +a2 = 0x1f; +L4451dc: +gp = MEM_U32(sp + 184); +a0 = 0x74; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L4451f4; +a2 = v0; +L4451f4: +MEM_U32(sp + 216) = v0; +t9 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 184); +t8 = t9 & 0xffe0; +t1 = 0x10018e80; +t2 = t8 | 0x6; +MEM_U8(v0 + 33) = (uint8_t)t2; +t1 = MEM_U8(t1 + 0); +s1 = 0xffffffe0; +if (t1 == 0) {//nop; +goto L4452a4;} +//nop; +//nop; +a0 = s0; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L445230; +//nop; +L445230: +gp = MEM_U32(sp + 184); +a1 = MEM_U32(sp + 216); +//nop; +a0 = 0x74; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445248; +a2 = v0; +L445248: +MEM_U32(sp + 216) = v0; +t3 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 184); +t4 = t3 & s1; +t5 = t4 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t5; +//nop; +a0 = MEM_U32(sp + 212); +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L445270; +//nop; +L445270: +gp = MEM_U32(sp + 184); +a1 = MEM_U32(sp + 216); +//nop; +a0 = 0x73; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445288; +a2 = v0; +L445288: +MEM_U32(sp + 216) = v0; +t6 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 184); +t7 = t6 & s1; +t9 = t7 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t9; +goto L44556c; +MEM_U8(v0 + 33) = (uint8_t)t9; +L4452a4: +//nop; +a0 = s0; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L4452b4; +//nop; +L4452b4: +gp = MEM_U32(sp + 184); +a1 = MEM_U32(sp + 216); +//nop; +a0 = 0x73; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L4452cc; +a2 = v0; +L4452cc: +MEM_U32(sp + 216) = v0; +t8 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 184); +t2 = t8 & s1; +t1 = t2 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t1; +//nop; +a0 = MEM_U32(sp + 212); +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L4452f4; +//nop; +L4452f4: +gp = MEM_U32(sp + 184); +a1 = MEM_U32(sp + 216); +//nop; +a0 = 0x74; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44530c; +a2 = v0; +L44530c: +MEM_U32(sp + 216) = v0; +t3 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 184); +t4 = t3 & s1; +t5 = t4 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t5; +goto L44556c; +MEM_U8(v0 + 33) = (uint8_t)t5; +L445328: +t6 = MEM_U8(s0 + 33); +t9 = s1 & 0xff; +t7 = t6 & 0x1f; +if (t0 == t7) {//nop; +goto L445340;} +//nop; +abort(); +L445340: +s0 = MEM_U32(s0 + 0); +s1 = t9; +goto L444c60; +s1 = t9; +L44534c: +t8 = MEM_U8(s0 + 33); +t1 = s1 & 0xff; +t2 = t8 & 0x1f; +if (t0 == t2) {//nop; +goto L445364;} +//nop; +abort(); +L445364: +s0 = MEM_U32(s0 + 0); +s1 = t1; +goto L444c60; +s1 = t1; +L445370: +if (at != 0) {at = v0 < 0x5e; +goto L4454e8;} +at = v0 < 0x5e; +if (at != 0) {at = 0x72; +goto L44539c;} +at = 0x72; +if (v0 == at) {//nop; +goto L444eb4;} +//nop; +at = 0x8a; +if (v0 == at) {//nop; +goto L444dcc;} +//nop; +//nop; +goto L4453c0; +//nop; +L44539c: +at = 0x49; +if (v0 == at) {//nop; +goto L444c6c;} +//nop; +at = 0x52; +if (v0 == at) {//nop; +goto L444cd0;} +//nop; +at = 0x5d; +if (v0 == at) {//nop; +goto L445088;} +//nop; +L4453c0: +t3 = 0x1000c24c; +a0 = 0x4; +t3 = t3; +t5 = t3 + 0x48; +a1 = 0x230; +t6 = sp; +L4453d8: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t6 = t6 + 0xc; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t6 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 4 + 3) = (uint8_t)(at >> 0); +if (t3 != t5) {//swr $at, 7($t6) +goto L4453d8;} +//swr $at, 7($t6) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t7 = 0x1000c1fc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +t7 = t7; +MEM_U8(t6 + 12 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t6 + 12 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t6 + 12 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t6 + 12 + 3) = (uint8_t)(t5 >> 0); +t8 = t7 + 0x48; +t2 = sp; +//swr $t5, 0xf($t6) +L445448: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t2 = t2 + 0xc; +MEM_U8(t2 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t2) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t2 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 84 + 3) = (uint8_t)(at >> 0); +if (t7 != t8) {//swr $at, 0x57($t2) +goto L445448;} +//swr $at, 0x57($t2) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +//nop; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +t8 = t7 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t7) +//nop; +MEM_U8(t2 + 92 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t2 + 92 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t2 + 92 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t2 + 92 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x5f($t2) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4454c4; +//nop; +L4454c4: +gp = MEM_U32(sp + 184); +a1 = s0; +//nop; +a0 = 0x10006560; +//nop; +f_print_node(mem, sp, a0, a1); +goto L4454dc; +//nop; +L4454dc: +gp = MEM_U32(sp + 184); +ra = MEM_U32(sp + 188); +goto L445570; +ra = MEM_U32(sp + 188); +L4454e8: +at = v0 < 0xe; +if (at != 0) {at = 0x1c; +goto L445538;} +at = 0x1c; +if (v0 == at) {//nop; +goto L444dcc;} +//nop; +at = 0x36; +if (v0 == at) {//nop; +goto L444d40;} +//nop; +t1 = v0 + 0xffffffc5; +at = t1 < 0x3; +if (at == 0) {//nop; +goto L4453c0;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c2a4[] = { +&&L444dcc, +&&L4453c0, +&&L444d40, +}; +dest = Lswitch1000c2a4[t1]; +//nop; +goto *dest; +//nop; +L445538: +if (v0 == a1) {t4 = v0 + 0xfffffff4; +goto L444e50;} +t4 = v0 + 0xfffffff4; +at = t4 < 0x2; +if (at == 0) {//nop; +goto L4453c0;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c29c[] = { +&&L445328, +&&L44534c, +}; +dest = Lswitch1000c29c[t4]; +//nop; +goto *dest; +//nop; +L44556c: +ra = MEM_U32(sp + 188); +L445570: +v0 = MEM_U32(sp + 216); +s0 = MEM_U32(sp + 176); +s1 = MEM_U32(sp + 180); +sp = sp + 0xe0; +return v0; +sp = sp + 0xe0; +} + +static uint32_t f_set_rewrite_indexed(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L445584: +//set_rewrite_indexed: +//nop; +//nop; +//nop; +sp = sp + 0xffffff28; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 172) = s0; +MEM_U32(sp + 224) = a2; +v1 = MEM_U8(a0 + 32); +s0 = a0; +a3 = a1; +v0 = v1; +goto L445c78; +v0 = v1; +L4455b8: +v0 = MEM_U8(s0 + 33); +t7 = 0xe; +t6 = v0 & 0x1f; +if (t6 == t7) {//nop; +goto L4455d0;} +//nop; +abort(); +L4455d0: +at = 0x52; +if (v1 != at) {t8 = 0x47; +goto L445600;} +t8 = 0x47; +t9 = 0x10019348; +MEM_U8(s0 + 32) = (uint8_t)t8; +t9 = MEM_U8(t9 + 0); +t0 = v0 << 27; +t1 = t0 >> 27; +t2 = t9 ^ t1; +t3 = t2 & 0x1f; +t4 = t3 ^ v0; +MEM_U8(s0 + 33) = (uint8_t)t4; +L445600: +//nop; +a0 = a3; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L445610; +//nop; +L445610: +gp = MEM_U32(sp + 176); +a0 = 0x1; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445628; +a2 = v0; +L445628: +gp = MEM_U32(sp + 176); +v1 = MEM_U8(v0 + 33); +t5 = 0x10019348; +MEM_U16(v0 + 34) = (uint16_t)zero; +t5 = MEM_U8(t5 + 0); +t6 = v1 << 27; +t7 = t6 >> 27; +t8 = t5 ^ t7; +t0 = t8 & 0x1f; +t9 = t0 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t9; +//nop; +a0 = 0x36; +a1 = v0; +v0 = f_build_1op(mem, sp, a0, a1); +goto L445664; +a1 = v0; +L445664: +MEM_U32(sp + 208) = v0; +t1 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 176); +t2 = t1 & 0xffe0; +t3 = t2 | 0xe; +MEM_U8(v0 + 33) = (uint8_t)t3; +t4 = MEM_U8(sp + 227); +s0 = 0xffffffe0; +t6 = t4 + 0x7; +if ((int)t6 >= 0) {t5 = (int)t6 >> 3; +goto L445698;} +t5 = (int)t6 >> 3; +at = t6 + 0x7; +t5 = (int)at >> 3; +L445698: +MEM_U32(v0 + 40) = t5; +MEM_U32(v0 + 44) = zero; +MEM_U32(v0 + 48) = zero; +MEM_U16(v0 + 34) = (uint16_t)zero; +goto L445e7c; +MEM_U16(v0 + 34) = (uint16_t)zero; +L4456ac: +t7 = MEM_U8(s0 + 33); +t0 = 0xe; +t8 = t7 & 0x1f; +if (t8 == t0) {//nop; +goto L4456c4;} +//nop; +abort(); +L4456c4: +//nop; +a0 = a3; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L4456d4; +//nop; +L4456d4: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(s0 + 0); +//nop; +a0 = 0x1; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L4456ec; +a2 = v0; +L4456ec: +gp = MEM_U32(sp + 176); +MEM_U32(s0 + 0) = v0; +MEM_U16(v0 + 34) = (uint16_t)zero; +t9 = MEM_U8(sp + 227); +MEM_U16(s0 + 34) = (uint16_t)zero; +t1 = t9 + 0x7; +if ((int)t1 >= 0) {t2 = (int)t1 >> 3; +goto L445714;} +t2 = (int)t1 >> 3; +at = t1 + 0x7; +t2 = (int)at >> 3; +L445714: +MEM_U32(s0 + 40) = t2; +MEM_U32(sp + 208) = s0; +goto L445e7c; +MEM_U32(sp + 208) = s0; +L445720: +t3 = MEM_U8(s0 + 33); +t6 = 0xe; +t4 = t3 & 0x1f; +if (t4 == t6) {//nop; +goto L445738;} +//nop; +abort(); +L445738: +//nop; +a0 = MEM_U32(s0 + 0); +a2 = MEM_U8(sp + 227); +a1 = a3; +MEM_U32(sp + 220) = a3; +v0 = f_set_rewrite_indexed(mem, sp, a0, a1, a2); +goto L445750; +MEM_U32(sp + 220) = a3; +L445750: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(sp + 220); +//nop; +a0 = MEM_U32(s0 + 4); +a2 = MEM_U8(sp + 227); +MEM_U32(sp + 184) = v0; +v0 = f_set_rewrite_indexed(mem, sp, a0, a1, a2); +goto L44576c; +MEM_U32(sp + 184) = v0; +L44576c: +gp = MEM_U32(sp + 176); +a0 = MEM_U8(s0 + 32); +//nop; +a1 = MEM_U32(sp + 184); +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445784; +a2 = v0; +L445784: +t5 = MEM_U8(sp + 227); +gp = MEM_U32(sp + 176); +t7 = t5 + 0x7; +MEM_U32(sp + 208) = v0; +if ((int)t7 >= 0) {t8 = (int)t7 >> 3; +goto L4457a4;} +t8 = (int)t7 >> 3; +at = t7 + 0x7; +t8 = (int)at >> 3; +L4457a4: +MEM_U32(v0 + 40) = t8; +goto L445e7c; +MEM_U32(v0 + 40) = t8; +L4457ac: +a0 = MEM_U32(s0 + 0); +at = 0x49; +t0 = MEM_U8(a0 + 32); +//nop; +if (t0 != at) {//nop; +goto L4457f8;} +//nop; +//nop; +//nop; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L4457d4; +//nop; +L4457d4: +gp = MEM_U32(sp + 176); +MEM_U32(sp + 208) = v0; +//nop; +a0 = s0; +//nop; +f_free_tree(mem, sp, a0); +goto L4457ec; +//nop; +L4457ec: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L445e80; +ra = MEM_U32(sp + 180); +L4457f8: +//nop; +a1 = MEM_U32(s0 + 40); +a0 = a3; +MEM_U32(sp + 220) = a3; +v0 = f_build_ucond0(mem, sp, a0, a1); +goto L44580c; +MEM_U32(sp + 220) = a3; +L44580c: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(sp + 220); +//nop; +a0 = MEM_U32(s0 + 0); +a2 = MEM_U8(sp + 227); +MEM_U32(sp + 208) = v0; +v0 = f_set_rewrite_indexed(mem, sp, a0, a1, a2); +goto L445828; +MEM_U32(sp + 208) = v0; +L445828: +t9 = MEM_U32(sp + 208); +gp = MEM_U32(sp + 176); +MEM_U32(t9 + 4) = v0; +goto L445e7c; +MEM_U32(t9 + 4) = v0; +L445838: +//nop; +a0 = a3; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L445848; +//nop; +L445848: +gp = MEM_U32(sp + 176); +MEM_U32(sp + 184) = v0; +//nop; +a0 = 0x8; +a1 = zero; +a2 = 0x8; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L445864; +a2 = 0x8; +L445864: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(sp + 184); +//nop; +a0 = 0x5b; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44587c; +a2 = v0; +L44587c: +gp = MEM_U32(sp + 176); +MEM_U16(v0 + 34) = (uint16_t)zero; +//nop; +a1 = MEM_U32(s0 + 0); +a0 = 0x7d; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445898; +a2 = v0; +L445898: +gp = MEM_U32(sp + 176); +MEM_U32(sp + 204) = v0; +MEM_U16(v0 + 34) = (uint16_t)zero; +//nop; +a0 = v0; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L4458b4; +//nop; +L4458b4: +gp = MEM_U32(sp + 176); +s0 = v0; +t1 = 0x10018e80; +//nop; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L4458ec;} +//nop; +//nop; +a0 = 0x61; +a1 = v0; +v0 = f_build_1op(mem, sp, a0, a1); +goto L4458e4; +a1 = v0; +L4458e4: +gp = MEM_U32(sp + 176); +s0 = v0; +L4458ec: +//nop; +a2 = MEM_U8(sp + 227); +a0 = 0x8; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L445900; +a1 = zero; +L445900: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(sp + 204); +//nop; +a0 = 0x4e; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445918; +a2 = v0; +L445918: +t2 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 176); +t3 = t2 & 0xffe0; +t4 = t3 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t4; +//nop; +a0 = 0x73; +a1 = v0; +a2 = s0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445940; +a2 = s0; +L445940: +gp = MEM_U32(sp + 176); +MEM_U32(sp + 208) = v0; +goto L445e7c; +MEM_U32(sp + 208) = v0; +L44594c: +//nop; +a0 = a3; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L44595c; +//nop; +L44595c: +gp = MEM_U32(sp + 176); +MEM_U32(sp + 184) = v0; +//nop; +a0 = 0x8; +a1 = zero; +a2 = 0x8; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L445978; +a2 = 0x8; +L445978: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(sp + 184); +//nop; +a0 = 0x5b; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445990; +a2 = v0; +L445990: +gp = MEM_U32(sp + 176); +MEM_U32(sp + 196) = v0; +MEM_U16(v0 + 34) = (uint16_t)zero; +//nop; +a0 = v0; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L4459ac; +//nop; +L4459ac: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(s0 + 0); +//nop; +a0 = 0x7d; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L4459c4; +a2 = v0; +L4459c4: +gp = MEM_U32(sp + 176); +MEM_U32(sp + 204) = v0; +MEM_U16(v0 + 34) = (uint16_t)zero; +//nop; +a0 = 0x8; +a1 = zero; +a2 = 0x1; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L4459e4; +a2 = 0x1; +L4459e4: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(s0 + 4); +//nop; +a0 = 0x1; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L4459fc; +a2 = v0; +L4459fc: +gp = MEM_U32(sp + 176); +MEM_U16(v0 + 34) = (uint16_t)zero; +//nop; +a2 = MEM_U32(sp + 196); +a0 = 0x7d; +a1 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445a18; +a1 = v0; +L445a18: +gp = MEM_U32(sp + 176); +MEM_U16(v0 + 34) = (uint16_t)zero; +//nop; +s0 = v0; +a0 = 0x6; +a1 = zero; +a2 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L445a38; +a2 = zero; +L445a38: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(sp + 204); +//nop; +a0 = 0x55; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445a50; +a2 = v0; +L445a50: +gp = MEM_U32(sp + 176); +a2 = MEM_U8(sp + 227); +//nop; +MEM_U32(sp + 204) = v0; +a0 = 0x6; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L445a6c; +a1 = zero; +L445a6c: +gp = MEM_U32(sp + 176); +a0 = 0x56; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445a84; +a2 = v0; +L445a84: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(sp + 204); +//nop; +a0 = 0x7d; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445a9c; +a2 = v0; +L445a9c: +gp = MEM_U32(sp + 176); +MEM_U32(sp + 196) = v0; +MEM_U16(v0 + 34) = (uint16_t)zero; +//nop; +a0 = 0x8; +a1 = zero; +a2 = 0x1f; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L445abc; +a2 = 0x1f; +L445abc: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(sp + 196); +//nop; +a0 = 0x74; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445ad4; +a2 = v0; +L445ad4: +MEM_U32(sp + 208) = v0; +t6 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 176); +t5 = t6 & 0xffe0; +t8 = 0x10018e80; +t7 = t5 | 0x6; +MEM_U8(v0 + 33) = (uint8_t)t7; +t8 = MEM_U8(t8 + 0); +s0 = 0xffffffe0; +if (t8 == 0) {//nop; +goto L445b84;} +//nop; +//nop; +a0 = MEM_U32(sp + 196); +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L445b10; +//nop; +L445b10: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(sp + 208); +//nop; +a0 = 0x74; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445b28; +a2 = v0; +L445b28: +MEM_U32(sp + 208) = v0; +t0 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 176); +t9 = t0 & s0; +t1 = t9 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t1; +//nop; +a0 = MEM_U32(sp + 204); +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L445b50; +//nop; +L445b50: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(sp + 208); +//nop; +a0 = 0x73; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445b68; +a2 = v0; +L445b68: +MEM_U32(sp + 208) = v0; +t2 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 176); +t3 = t2 & s0; +t4 = t3 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t4; +goto L445e7c; +MEM_U8(v0 + 33) = (uint8_t)t4; +L445b84: +//nop; +a0 = MEM_U32(sp + 196); +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L445b94; +//nop; +L445b94: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(sp + 208); +//nop; +a0 = 0x73; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445bac; +a2 = v0; +L445bac: +MEM_U32(sp + 208) = v0; +t6 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 176); +t5 = t6 & s0; +t7 = t5 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t7; +//nop; +a0 = MEM_U32(sp + 204); +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L445bd4; +//nop; +L445bd4: +gp = MEM_U32(sp + 176); +a1 = MEM_U32(sp + 208); +//nop; +a0 = 0x74; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L445bec; +a2 = v0; +L445bec: +MEM_U32(sp + 208) = v0; +t8 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 176); +t0 = t8 & s0; +t9 = t0 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t9; +goto L445e7c; +MEM_U8(v0 + 33) = (uint8_t)t9; +L445c08: +t1 = MEM_U8(s0 + 33); +t3 = 0xe; +t2 = t1 & 0x1f; +if (t2 == t3) {//nop; +goto L445c20;} +//nop; +abort(); +L445c20: +//nop; +a0 = MEM_U32(s0 + 0); +a2 = MEM_U8(sp + 227); +a1 = a3; +v0 = f_set_rewrite_indexed(mem, sp, a0, a1, a2); +goto L445c34; +a1 = a3; +L445c34: +gp = MEM_U32(sp + 176); +MEM_U32(sp + 208) = v0; +goto L445e7c; +MEM_U32(sp + 208) = v0; +L445c40: +t4 = MEM_U8(s0 + 33); +t5 = 0xe; +t6 = t4 & 0x1f; +if (t6 == t5) {//nop; +goto L445c58;} +//nop; +abort(); +L445c58: +//nop; +a0 = MEM_U32(s0 + 0); +a2 = MEM_U8(sp + 227); +a1 = a3; +v0 = f_set_rewrite_indexed(mem, sp, a0, a1, a2); +goto L445c6c; +a1 = a3; +L445c6c: +gp = MEM_U32(sp + 176); +MEM_U32(sp + 208) = v0; +goto L445e7c; +MEM_U32(sp + 208) = v0; +L445c78: +at = v0 < 0x3e; +if (at != 0) {at = v0 < 0x5e; +goto L445df4;} +at = v0 < 0x5e; +if (at != 0) {at = 0x72; +goto L445ca8;} +at = 0x72; +if (v0 == at) {//nop; +goto L445838;} +//nop; +at = 0x8a; +if (v0 == at) {//nop; +goto L445720;} +//nop; +//nop; +goto L445ccc; +//nop; +L445ca8: +at = 0x49; +if (v0 == at) {//nop; +goto L4455b8;} +//nop; +at = 0x52; +if (v0 == at) {//nop; +goto L4455b8;} +//nop; +at = 0x5d; +if (v0 == at) {//nop; +goto L44594c;} +//nop; +L445ccc: +t7 = 0x1000c300; +a0 = 0x4; +t7 = t7; +t0 = t7 + 0x48; +a1 = 0x2b1; +t9 = sp; +L445ce4: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t0) {//swr $at, 7($t9) +goto L445ce4;} +//swr $at, 7($t9) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t1 = 0x1000c2b0; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t0 = t7 + 4; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 7($t7) +t1 = t1; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t0 >> 0); +t3 = t1 + 0x48; +t4 = sp; +//swr $t0, 0xf($t9) +L445d54: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t4 = t4 + 0xc; +MEM_U8(t4 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t4) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t4 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 84 + 3) = (uint8_t)(at >> 0); +if (t1 != t3) {//swr $at, 0x57($t4) +goto L445d54;} +//swr $at, 0x57($t4) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +//nop; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +//nop; +MEM_U8(t4 + 92 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 92 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 92 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 92 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x5f($t4) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L445dd0; +//nop; +L445dd0: +gp = MEM_U32(sp + 176); +a1 = s0; +//nop; +a0 = 0x10006560; +//nop; +f_print_node(mem, sp, a0, a1); +goto L445de8; +//nop; +L445de8: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L445e80; +ra = MEM_U32(sp + 180); +L445df4: +at = v0 < 0xe; +if (at != 0) {at = 0x1c; +goto L445e44;} +at = 0x1c; +if (v0 == at) {//nop; +goto L445720;} +//nop; +at = 0x36; +if (v0 == at) {//nop; +goto L4456ac;} +//nop; +t6 = v0 + 0xffffffc5; +at = t6 < 0x3; +if (at == 0) {//nop; +goto L445ccc;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c358[] = { +&&L445720, +&&L445ccc, +&&L4456ac, +}; +dest = Lswitch1000c358[t6]; +//nop; +goto *dest; +//nop; +L445e44: +at = 0x2; +if (v0 == at) {t5 = v0 + 0xfffffff4; +goto L4457ac;} +t5 = v0 + 0xfffffff4; +at = t5 < 0x2; +if (at == 0) {//nop; +goto L445ccc;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c350[] = { +&&L445c08, +&&L445c40, +}; +dest = Lswitch1000c350[t5]; +//nop; +goto *dest; +//nop; +L445e7c: +ra = MEM_U32(sp + 180); +L445e80: +v0 = MEM_U32(sp + 208); +s0 = MEM_U32(sp + 172); +sp = sp + 0xd8; +return v0; +sp = sp + 0xd8; +} + +static uint32_t f_translate_tree(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L445e90: +//translate_tree: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 20) = s0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +if (a0 == 0) {s0 = a0; +goto L445ed8;} +s0 = a0; +L445eb8: +//nop; +a0 = s0; +//nop; +v0 = f_translate(mem, sp, a0); +goto L445ec8; +//nop; +L445ec8: +s0 = MEM_U32(v0 + 8); +gp = MEM_U32(sp + 24); +if (s0 != 0) {//nop; +goto L445eb8;} +//nop; +L445ed8: +t7 = 0x1001a548; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {ra = MEM_U32(sp + 28); +goto L445f00;} +ra = MEM_U32(sp + 28); +at = 0x10018ea8; +t8 = 0x1; +MEM_U8(at + 0) = (uint8_t)t8; +ra = MEM_U32(sp + 28); +L445f00: +v0 = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 20); +sp = sp + 0x20; +return v0; +sp = sp + 0x20; +} + +static uint32_t f_translate(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L445f10: +//translate: +//nop; +//nop; +//nop; +sp = sp + 0xfffffef8; +MEM_U32(sp + 196) = ra; +MEM_U32(sp + 192) = gp; +MEM_U32(sp + 188) = s4; +MEM_U32(sp + 184) = s3; +MEM_U32(sp + 180) = s2; +MEM_U32(sp + 176) = s1; +MEM_U32(sp + 172) = s0; +MEM_U32(sp + 264) = a0; +v1 = MEM_U8(a0 + 25); +s3 = a0; +t6 = v1 & 0x1; +if (t6 == 0) {//nop; +goto L445fe4;} +//nop; +a0 = MEM_U8(a0 + 32); +t7 = 0x10005900; +t5 = a0 + 0xffffffe0; +t8 = a0 + t7; +t9 = MEM_U8(t8 + 0); +t6 = t5 < 0x40; +if (t9 == 0) {//nop; +goto L445f90;} +//nop; +//nop; +a0 = s3; +//nop; +v0 = f_cse(mem, sp, a0); +goto L445f84; +//nop; +L445f84: +gp = MEM_U32(sp + 192); +ra = MEM_U32(sp + 196); +goto L4494ac; +ra = MEM_U32(sp + 196); +L445f90: +if (t6 == 0) {t7 = (int)t5 >> 5; +goto L445fb8;} +t7 = (int)t5 >> 5; +t9 = 0x10005ae8; +t8 = t7 << 2; +t9 = t9; +t7 = t9 + t8; +t9 = MEM_U32(t7 + 0); +//nop; +t8 = t9 << (t5 & 0x1f); +t6 = (int)t8 < (int)0x0; +L445fb8: +if (t6 == 0) {//nop; +goto L445fdc;} +//nop; +//nop; +a0 = s3; +//nop; +v0 = f_load_cse(mem, sp, a0); +goto L445fd0; +//nop; +L445fd0: +gp = MEM_U32(sp + 192); +ra = MEM_U32(sp + 196); +goto L4494ac; +ra = MEM_U32(sp + 196); +L445fdc: +v0 = s3; +goto L4494a8; +v0 = s3; +L445fe4: +a0 = MEM_U8(s3 + 32); +L445fe8: +t9 = v1 | 0x1; +v0 = a0; +at = v0 < 0x80; +a3 = 0x4; +t0 = 0x3c; +s4 = 0xffffffe0; +if (at != 0) {MEM_U8(s3 + 25) = (uint8_t)t9; +goto L4492a4;} +MEM_U8(s3 + 25) = (uint8_t)t9; +at = v0 < 0x8e; +if (at != 0) {//nop; +goto L449308;} +//nop; +t5 = v0 + 0xffffff6d; +at = t5 < 0x5; +if (at == 0) {//nop; +goto L449338;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c61c[] = { +&&L448c30, +&&L448f2c, +&&L447cdc, +&&L449338, +&&L446fe4, +}; +dest = Lswitch1000c61c[t5]; +//nop; +goto *dest; +//nop; +L446044: +t8 = MEM_U32(s3 + 36); +at = 0x10018e00; +t7 = 0x10019350; +MEM_U32(at + 0) = t8; +t7 = MEM_U8(t7 + 0); +at = 0x1; +if (t7 != at) {//nop; +goto L446088;} +//nop; +at = 0x1001a4d4; +v0 = zero; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a508; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a538; +MEM_U32(at + 0) = zero; +goto L4460c0; +MEM_U32(at + 0) = zero; +L446088: +v1 = 0x1001a538; +//nop; +v0 = MEM_U32(v1 + 0); +//nop; +at = (int)v0 < (int)0x4c; +if (at != 0) {//nop; +goto L4460c0;} +//nop; +at = 0x1001a4d4; +v0 = zero; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a508; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +MEM_U32(v1 + 0) = zero; +L4460c0: +at = 0x1001a538; +t6 = v0 + 0x1; +MEM_U32(at + 0) = t6; +goto L449338; +MEM_U32(at + 0) = t6; +L4460d0: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L4460e0; +//nop; +L4460e0: +MEM_U32(s3 + 0) = v0; +t9 = MEM_U8(v0 + 32); +gp = MEM_U32(sp + 192); +at = 0xb; +if (t9 != at) {t5 = 0x88; +goto L446118;} +t5 = 0x88; +MEM_U8(s3 + 32) = (uint8_t)t5; +t8 = MEM_U32(v0 + 0); +//nop; +a0 = v0; +MEM_U32(s3 + 4) = t8; +f_free_tree_and_cse(mem, sp, a0); +goto L446110; +MEM_U32(s3 + 4) = t8; +L446110: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = zero; +L446118: +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L446124: +s0 = MEM_U32(s3 + 0); +//nop; +t7 = MEM_U16(s0 + 34); +//nop; +t6 = t7 | 0x4; +MEM_U16(s0 + 34) = (uint16_t)t6; +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L446148: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L446158; +//nop; +L446158: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = v0; +//nop; +a0 = v0; +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L446170; +//nop; +L446170: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L4461f8;} +//nop; +s0 = MEM_U32(s3 + 0); +at = 0x5010000; +t9 = MEM_U8(s0 + 33); +//nop; +t5 = t9 & 0x1f; +t8 = t5 < 0x20; +t7 = -t8; +t6 = t7 & at; +t9 = t6 << (t5 & 0x1f); +if ((int)t9 >= 0) {t8 = 0x88; +goto L4461b4;} +t8 = 0x88; +a3 = MEM_U32(s0 + 52); +t7 = MEM_U8(s3 + 32); +goto L4461c0; +t7 = MEM_U8(s3 + 32); +L4461b4: +a3 = MEM_U32(s0 + 48); +//nop; +t7 = MEM_U8(s3 + 32); +L4461c0: +t5 = zero < a3; +t6 = t7 ^ 0x7f; +t6 = t6 < 0x1; +if (t6 == t5) {//nop; +goto L4461f0;} +//nop; +//nop; +a0 = s3; +//nop; +f_delete_statement(mem, sp, a0); +goto L4461e4; +//nop; +L4461e4: +gp = MEM_U32(sp + 192); +v0 = s3; +goto L4494a8; +v0 = s3; +L4461f0: +MEM_U8(s3 + 32) = (uint8_t)t8; +MEM_U32(s3 + 0) = zero; +L4461f8: +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L446204: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L446214; +//nop; +L446214: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = v0; +//nop; +a0 = v0; +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L44622c; +//nop; +L44622c: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L446298;} +//nop; +s0 = MEM_U32(s3 + 0); +at = 0x5010000; +t9 = MEM_U8(s0 + 33); +//nop; +t7 = t9 & 0x1f; +t6 = t7 < 0x20; +t5 = -t6; +t8 = t5 & at; +t9 = t8 << (t7 & 0x1f); +if ((int)t9 >= 0) {//nop; +goto L446270;} +//nop; +a3 = MEM_U32(s0 + 52); +//nop; +goto L446278; +//nop; +L446270: +a3 = MEM_U32(s0 + 48); +//nop; +L446278: +if (a3 == 0) {//nop; +goto L446298;} +//nop; +//nop; +a0 = s3; +//nop; +f_delete_statement(mem, sp, a0); +goto L446290; +//nop; +L446290: +gp = MEM_U32(sp + 192); +//nop; +L446298: +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L4462a4: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L4462b4; +//nop; +L4462b4: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = v0; +//nop; +a0 = v0; +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L4462cc; +//nop; +L4462cc: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L446370;} +//nop; +s0 = MEM_U32(s3 + 0); +at = 0x5010000; +t5 = MEM_U8(s0 + 33); +//nop; +t8 = t5 & 0x1f; +t9 = t8 < 0x20; +t6 = -t9; +t7 = t6 & at; +t5 = t7 << (t8 & 0x1f); +if ((int)t5 >= 0) {//nop; +goto L446310;} +//nop; +a3 = MEM_U32(s0 + 52); +//nop; +goto L446318; +//nop; +L446310: +a3 = MEM_U32(s0 + 48); +//nop; +L446318: +if (a3 == 0) {//nop; +goto L446354;} +//nop; +//nop; +s1 = s3; +a0 = s0; +v0 = f_dup_tree(mem, sp, a0); +goto L446330; +a0 = s0; +L446330: +gp = MEM_U32(sp + 192); +s3 = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L446348; +//nop; +L446348: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +goto L446394; +a0 = MEM_U8(s3 + 32); +L446354: +t9 = MEM_U8(s0 + 22); +//nop; +if (t9 != 0) {//nop; +goto L446368;} +//nop; +t9 = 0x1; +L446368: +MEM_U8(s3 + 22) = (uint8_t)t9; +goto L446390; +MEM_U8(s3 + 22) = (uint8_t)t9; +L446370: +t8 = MEM_U32(s3 + 0); +//nop; +t5 = MEM_U8(t8 + 22); +//nop; +if (t5 != 0) {//nop; +goto L44638c;} +//nop; +t5 = 0x1; +L44638c: +MEM_U8(s3 + 22) = (uint8_t)t5; +L446390: +a0 = MEM_U8(s3 + 32); +L446394: +//nop; +goto L449338; +//nop; +L44639c: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L4463ac; +//nop; +L4463ac: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = v0; +//nop; +a0 = s3; +//nop; +v0 = f_need_check_hl(mem, sp, a0); +goto L4463c4; +//nop; +L4463c4: +gp = MEM_U32(sp + 192); +if (v0 != 0) {//nop; +goto L446404;} +//nop; +//nop; +a0 = MEM_U32(s3 + 0); +s1 = s3; +v0 = f_dup_tree(mem, sp, a0); +goto L4463e0; +s1 = s3; +L4463e0: +gp = MEM_U32(sp + 192); +s3 = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L4463f8; +//nop; +L4463f8: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +goto L446428; +a0 = MEM_U8(s3 + 32); +L446404: +t6 = MEM_U32(s3 + 0); +//nop; +t7 = MEM_U8(t6 + 22); +//nop; +if (t7 != 0) {//nop; +goto L446420;} +//nop; +t7 = 0x1; +L446420: +MEM_U8(s3 + 22) = (uint8_t)t7; +a0 = MEM_U8(s3 + 32); +L446428: +//nop; +goto L449338; +//nop; +L446430: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L446440; +//nop; +L446440: +a0 = MEM_U8(s3 + 32); +gp = MEM_U32(sp + 192); +at = 0x76; +if (a0 != at) {MEM_U32(s3 + 0) = v0; +goto L446478;} +MEM_U32(s3 + 0) = v0; +t9 = 0x5b; +MEM_U8(s3 + 32) = (uint8_t)t9; +//nop; +a0 = v0; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L44646c; +//nop; +L44646c: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +MEM_U32(s3 + 4) = v0; +L446478: +at = 0x77; +if (a0 != at) {//nop; +goto L4465b0;} +//nop; +t8 = MEM_U8(s3 + 33); +at = 0xc0000; +t5 = t8 & 0x1f; +t6 = t5 < 0x20; +t7 = -t6; +t9 = t7 & at; +t8 = t9 << (t5 & 0x1f); +if ((int)t8 < 0) {a0 = 0x4; +goto L4465b0;} +a0 = 0x4; +t6 = 0x1000c3b4; +a1 = 0x358; +t6 = t6; +t9 = t6 + 0x48; +t5 = sp; +L4464bc: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t5 = t5 + 0xc; +MEM_U8(t5 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t5) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t5 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t9) {//swr $at, 7($t5) +goto L4464bc;} +//swr $at, 7($t5) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t8 = 0x1000c364; +MEM_U8(t5 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t5) +t9 = t6 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t6) +t8 = t8; +MEM_U8(t5 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t5 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t5 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t5 + 12 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0xf($t5) +t9 = t8 + 0x48; +t6 = sp; +L44652c: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t6 = t6 + 0xc; +MEM_U8(t6 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t6) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t6 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 84 + 3) = (uint8_t)(at >> 0); +if (t8 != t9) {//swr $at, 0x57($t6) +goto L44652c;} +//swr $at, 0x57($t6) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +//nop; +MEM_U8(t6 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t6) +t9 = t8 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t8) +//nop; +MEM_U8(t6 + 92 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t6 + 92 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t6 + 92 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t6 + 92 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x5f($t6) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4465a8; +//nop; +L4465a8: +gp = MEM_U32(sp + 192); +//nop; +L4465b0: +t5 = MEM_U32(s3 + 0); +//nop; +t7 = MEM_U8(t5 + 22); +//nop; +if (t7 != 0) {//nop; +goto L4465cc;} +//nop; +t7 = 0x1; +L4465cc: +a0 = MEM_U8(s3 + 32); +MEM_U8(s3 + 22) = (uint8_t)t7; +goto L449338; +MEM_U8(s3 + 22) = (uint8_t)t7; +L4465d8: +t9 = a0 + 0xffffffe0; +t8 = t9 < 0x40; +if (t8 == 0) {//nop; +goto L446610;} +//nop; +t7 = 0x10005ae0; +t6 = (int)t9 >> 5; +t5 = t6 << 2; +t7 = t7; +t6 = t7 + t5; +t7 = MEM_U32(t6 + 0); +//nop; +t5 = t7 << (t9 & 0x1f); +t6 = (int)t5 < (int)0x0; +t8 = t6; +L446610: +if (t8 == 0) {//nop; +goto L446694;} +//nop; +v1 = MEM_U8(s3 + 33); +at = 0xe; +t7 = v1 & 0x1f; +if (t7 != at) {//nop; +goto L446694;} +//nop; +t9 = MEM_U32(s3 + 0); +//nop; +v0 = MEM_U32(t9 + 40); +//nop; +at = (int)v0 < (int)0x5; +if (at == 0) {//nop; +goto L446658;} +//nop; +t5 = v1 & s4; +t6 = t5 | 0x8; +MEM_U8(s3 + 33) = (uint8_t)t6; +goto L446694; +MEM_U8(s3 + 33) = (uint8_t)t6; +L446658: +t8 = MEM_U32(s3 + 4); +//nop; +t7 = MEM_U32(t8 + 40); +//nop; +if (t7 == v0) {//nop; +goto L446674;} +//nop; +abort(); +L446674: +//nop; +a0 = s3; +//nop; +v0 = f_gen_set_equ(mem, sp, a0); +goto L446684; +//nop; +L446684: +gp = MEM_U32(sp + 192); +v1 = MEM_U8(v0 + 25); +s3 = v0; +goto L445fe4; +s3 = v0; +L446694: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L4466a4; +//nop; +L4466a4: +t9 = MEM_U8(s3 + 32); +gp = MEM_U32(sp + 192); +s1 = 0xa; +if (s1 != t9) {MEM_U32(s3 + 0) = v0; +goto L4466d0;} +MEM_U32(s3 + 0) = v0; +s0 = 0x10005ab8; +//nop; +t5 = MEM_U32(s0 + 0); +//nop; +t6 = t5 + 0x1; +MEM_U32(s0 + 0) = t6; +L4466d0: +//nop; +s0 = 0x10005ab8; +a0 = MEM_U32(s3 + 4); +//nop; +v0 = f_translate(mem, sp, a0); +goto L4466e4; +//nop; +L4466e4: +a0 = MEM_U8(s3 + 32); +gp = MEM_U32(sp + 192); +if (s1 != a0) {MEM_U32(s3 + 4) = v0; +goto L446704;} +MEM_U32(s3 + 4) = v0; +t8 = MEM_U32(s0 + 0); +//nop; +t7 = t8 + 0xffffffff; +MEM_U32(s0 + 0) = t7; +L446704: +at = 0x73; +if (a0 == at) {at = 0x74; +goto L446718;} +at = 0x74; +if (a0 != at) {//nop; +goto L44674c;} +//nop; +L446718: +a2 = MEM_U32(s3 + 4); +a1 = 0x49; +t9 = MEM_U8(a2 + 32); +//nop; +if (a1 != t9) {//nop; +goto L44674c;} +//nop; +v1 = MEM_U32(a2 + 48); +//nop; +at = (int)v1 < (int)0x20; +if (at != 0) {//nop; +goto L44674c;} +//nop; +t5 = v1 & 0x1f; +MEM_U32(a2 + 48) = t5; +L44674c: +t6 = MEM_U32(s3 + 4); +t8 = MEM_U32(s3 + 0); +v0 = MEM_U8(t6 + 22); +v1 = MEM_U8(t8 + 22); +a1 = 0x49; +if (v0 != v1) {at = v1 < v0; +goto L446774;} +at = v1 < v0; +t7 = v1 + 0x1; +MEM_U8(s3 + 22) = (uint8_t)t7; +goto L446784; +MEM_U8(s3 + 22) = (uint8_t)t7; +L446774: +if (at == 0) {t9 = v1; +goto L446780;} +t9 = v1; +t9 = v0; +L446780: +MEM_U8(s3 + 22) = (uint8_t)t9; +L446784: +a0 = MEM_U8(s3 + 32); +v0 = a0; +goto L446d7c; +v0 = a0; +L446790: +a2 = MEM_U32(s3 + 4); +//nop; +t5 = MEM_U8(a2 + 32); +//nop; +if (a1 != t5) {//nop; +goto L449338;} +//nop; +v1 = MEM_U8(s3 + 33); +at = 0x2000000; +t6 = v1 & 0x1f; +t8 = t6 < 0x20; +t7 = -t8; +t9 = t7 & at; +t5 = t9 << (t6 & 0x1f); +if ((int)t5 >= 0) {v1 = t6; +goto L44681c;} +v1 = t6; +t6 = MEM_U32(a2 + 48); +at = 0x7fff0000; +at = at | 0xffff; +if (t6 != at) {s1 = s3; +goto L449338;} +s1 = s3; +//nop; +a0 = 0x8; +a1 = zero; +a2 = 0x1; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L4467f4; +a2 = 0x1; +L4467f4: +gp = MEM_U32(sp + 192); +s3 = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L44680c; +//nop; +L44680c: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L44681c: +at = 0x8; +if (v1 != at) {//nop; +goto L449338;} +//nop; +t8 = MEM_U32(a2 + 48); +s4 = 0xffffffff; +if (s4 != t8) {s1 = s3; +goto L449338;} +s1 = s3; +//nop; +a0 = 0x8; +a1 = zero; +a2 = 0x1; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L44684c; +a2 = 0x1; +L44684c: +gp = MEM_U32(sp + 192); +s3 = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L446864; +//nop; +L446864: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L446874: +a2 = MEM_U32(s3 + 4); +//nop; +t7 = MEM_U8(a2 + 32); +//nop; +if (a1 != t7) {//nop; +goto L449338;} +//nop; +v1 = MEM_U8(s3 + 33); +at = 0x2000000; +t9 = v1 & 0x1f; +t5 = t9 < 0x20; +t6 = -t5; +t8 = t6 & at; +t7 = t8 << (t9 & 0x1f); +if ((int)t7 >= 0) {v1 = t9; +goto L446900;} +v1 = t9; +t9 = MEM_U32(a2 + 48); +at = 0x7fff0000; +at = at | 0xffff; +if (t9 != at) {s1 = s3; +goto L449338;} +s1 = s3; +//nop; +a0 = 0x8; +a1 = zero; +a2 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L4468d8; +a2 = zero; +L4468d8: +gp = MEM_U32(sp + 192); +s3 = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L4468f0; +//nop; +L4468f0: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L446900: +at = 0x8; +if (v1 != at) {//nop; +goto L449338;} +//nop; +t5 = MEM_U32(a2 + 48); +s4 = 0xffffffff; +if (s4 != t5) {s1 = s3; +goto L449338;} +s1 = s3; +//nop; +a0 = 0x8; +a1 = zero; +a2 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L446930; +a2 = zero; +L446930: +gp = MEM_U32(sp + 192); +s3 = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L446948; +//nop; +L446948: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L446958: +a2 = MEM_U32(s3 + 4); +//nop; +t6 = MEM_U8(a2 + 32); +//nop; +if (a1 != t6) {//nop; +goto L449338;} +//nop; +v1 = MEM_U8(s3 + 33); +at = 0x2000000; +t8 = v1 & 0x1f; +t7 = t8 < 0x20; +t9 = -t7; +t5 = t9 & at; +t6 = t5 << (t8 & 0x1f); +if ((int)t6 >= 0) {v1 = t8; +goto L4469e0;} +v1 = t8; +t8 = MEM_U32(a2 + 48); +at = 0x80000000; +if (t8 != at) {s1 = s3; +goto L449338;} +s1 = s3; +//nop; +a0 = 0x8; +a1 = zero; +a2 = 0x1; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L4469b8; +a2 = 0x1; +L4469b8: +gp = MEM_U32(sp + 192); +s3 = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L4469d0; +//nop; +L4469d0: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L4469e0: +at = 0x8; +if (v1 != at) {//nop; +goto L449338;} +//nop; +t7 = MEM_U32(a2 + 48); +s1 = s3; +if (t7 != 0) {a1 = zero; +goto L449338;} +a1 = zero; +//nop; +a0 = 0x8; +a2 = 0x1; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L446a0c; +a2 = 0x1; +L446a0c: +gp = MEM_U32(sp + 192); +s3 = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L446a24; +//nop; +L446a24: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L446a34: +a2 = MEM_U32(s3 + 4); +//nop; +t9 = MEM_U8(a2 + 32); +//nop; +if (a1 != t9) {//nop; +goto L449338;} +//nop; +v1 = MEM_U8(s3 + 33); +at = 0x2000000; +t5 = v1 & 0x1f; +t6 = t5 < 0x20; +t8 = -t6; +t7 = t8 & at; +t9 = t7 << (t5 & 0x1f); +if ((int)t9 >= 0) {v1 = t5; +goto L446abc;} +v1 = t5; +t5 = MEM_U32(a2 + 48); +at = 0x80000000; +if (t5 != at) {s1 = s3; +goto L449338;} +s1 = s3; +//nop; +a0 = 0x8; +a1 = zero; +a2 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L446a94; +a2 = zero; +L446a94: +gp = MEM_U32(sp + 192); +s3 = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L446aac; +//nop; +L446aac: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L446abc: +at = 0x8; +if (v1 != at) {//nop; +goto L449338;} +//nop; +t6 = MEM_U32(a2 + 48); +s1 = s3; +if (t6 != 0) {a1 = zero; +goto L449338;} +a1 = zero; +//nop; +a0 = 0x8; +a2 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L446ae8; +a2 = zero; +L446ae8: +gp = MEM_U32(sp + 192); +s3 = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L446b00; +//nop; +L446b00: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L446b10: +a2 = MEM_U32(s3 + 4); +//nop; +t8 = MEM_U8(a2 + 32); +//nop; +if (a1 != t8) {//nop; +goto L449338;} +//nop; +t7 = MEM_U16(s3 + 20); +at = 0x1; +if (t7 != at) {//nop; +goto L449338;} +//nop; +t9 = 0x10019368; +v0 = 0x1; +t9 = MEM_U8(t9 + 0); +a3 = zero; +if (t9 == 0) {t6 = 0x4; +goto L449338;} +t6 = 0x4; +v1 = MEM_U32(a2 + 48); +s1 = 0x20; +L446b58: +if (v0 != v1) {t8 = v0 << 1; +goto L446b74;} +t8 = v0 << 1; +t5 = v1 + 0xffffffff; +MEM_U32(a2 + 48) = t5; +MEM_U8(s3 + 32) = (uint8_t)t6; +a0 = t6 & 0xff; +goto L449338; +a0 = t6 & 0xff; +L446b74: +a3 = a3 + 0x1; +if (a3 != s1) {v0 = t8; +goto L446b58;} +v0 = t8; +//nop; +goto L449338; +//nop; +L446b88: +t7 = 0x10019368; +s1 = 0x57; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L446d70;} +//nop; +//nop; +a0 = MEM_U32(s3 + 4); +//nop; +v0 = f_is_zero(mem, sp, a0); +goto L446bb0; +//nop; +L446bb0: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L446c88;} +//nop; +s0 = MEM_U32(s3 + 0); +at = 0x1; +t9 = MEM_U16(s0 + 20); +//nop; +if (t9 != at) {//nop; +goto L446c88;} +//nop; +v1 = MEM_U8(s0 + 32); +t5 = 0x69; +if (s1 != v1) {at = 0x69; +goto L446bf8;} +at = 0x69; +MEM_U8(s0 + 32) = (uint8_t)t5; +s0 = MEM_U32(s3 + 0); +//nop; +v1 = MEM_U8(s0 + 32); +//nop; +L446bf8: +if (v1 != at) {MEM_U32(sp + 264) = s3; +goto L446c7c;} +MEM_U32(sp + 264) = s3; +t6 = MEM_U8(s0 + 33); +at = 0x6; +t8 = t6 & 0x1f; +if (t8 != at) {MEM_U32(sp + 264) = s3; +goto L446c7c;} +MEM_U32(sp + 264) = s3; +//nop; +a0 = MEM_U32(s0 + 4); +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L446c24; +//nop; +L446c24: +gp = MEM_U32(sp + 192); +if (v0 == 0) {MEM_U32(sp + 264) = s3; +goto L446c7c;} +MEM_U32(sp + 264) = s3; +t7 = MEM_U32(s3 + 0); +//nop; +t9 = MEM_U32(t7 + 4); +//nop; +a0 = MEM_U32(t9 + 48); +//nop; +//nop; +//nop; +v0 = f_is_power_of_two(mem, sp, a0); +goto L446c54; +//nop; +L446c54: +gp = MEM_U32(sp + 192); +if (v0 == 0) {MEM_U32(sp + 264) = s3; +goto L446c7c;} +MEM_U32(sp + 264) = s3; +v0 = MEM_U32(s3 + 0); +//nop; +t6 = MEM_U8(v0 + 33); +//nop; +t8 = t6 & s4; +t7 = t8 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t7; +L446c7c: +s3 = MEM_U32(sp + 264); +a0 = MEM_U8(s3 + 32); +goto L446d74; +a0 = MEM_U8(s3 + 32); +L446c88: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_is_zero(mem, sp, a0); +goto L446c98; +//nop; +L446c98: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L446d70;} +//nop; +a2 = MEM_U32(s3 + 4); +at = 0x1; +t9 = MEM_U16(a2 + 20); +//nop; +if (t9 != at) {//nop; +goto L446d70;} +//nop; +v0 = MEM_U8(a2 + 32); +t5 = 0x69; +if (s1 != v0) {at = 0x69; +goto L446ce0;} +at = 0x69; +MEM_U8(a2 + 32) = (uint8_t)t5; +a2 = MEM_U32(s3 + 4); +//nop; +v0 = MEM_U8(a2 + 32); +//nop; +L446ce0: +if (v0 != at) {//nop; +goto L446d70;} +//nop; +t6 = MEM_U8(a2 + 33); +at = 0x6; +t8 = t6 & 0x1f; +if (t8 != at) {//nop; +goto L446d70;} +//nop; +//nop; +a0 = MEM_U32(a2 + 4); +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L446d0c; +//nop; +L446d0c: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L446d70;} +//nop; +t7 = MEM_U32(s3 + 4); +//nop; +t9 = MEM_U32(t7 + 4); +//nop; +a0 = MEM_U32(t9 + 48); +//nop; +//nop; +//nop; +v0 = f_is_power_of_two(mem, sp, a0); +goto L446d3c; +//nop; +L446d3c: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L446d70;} +//nop; +MEM_U32(sp + 264) = s3; +v0 = MEM_U32(s3 + 4); +//nop; +t6 = MEM_U8(v0 + 33); +//nop; +t8 = t6 & s4; +t7 = t8 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t7; +s3 = MEM_U32(sp + 264); +//nop; +L446d70: +a0 = MEM_U8(s3 + 32); +L446d74: +//nop; +goto L449338; +//nop; +L446d7c: +at = v0 < 0x4f; +if (at != 0) {at = 0x23; +goto L446da8;} +at = 0x23; +s1 = 0x57; +if (v0 == s1) {at = 0x5f; +goto L446b10;} +at = 0x5f; +if (v0 == at) {//nop; +goto L446b88;} +//nop; +//nop; +goto L449338; +//nop; +at = 0x23; +L446da8: +if (v0 == at) {//nop; +goto L446b88;} +//nop; +at = v0 < 0x2a; +if (at == 0) {//nop; +goto L446dec;} +//nop; +t9 = v0 + 0xffffffd8; +at = t9 < 0x2; +if (at == 0) {//nop; +goto L449338;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c404[] = { +&&L446958, +&&L446874, +}; +dest = Lswitch1000c404[t9]; +//nop; +goto *dest; +//nop; +L446dec: +t5 = v0 + 0xffffffb3; +at = t5 < 0x2; +if (at == 0) {//nop; +goto L449338;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c40c[] = { +&&L446790, +&&L446a34, +}; +dest = Lswitch1000c40c[t5]; +//nop; +goto *dest; +//nop; +L446e1c: +at = 0x1001a53c; +t6 = 0x1; +MEM_U8(at + 0) = (uint8_t)t6; +at = 0x1001a540; +s1 = 0x10019310; +MEM_U8(at + 0) = (uint8_t)zero; +v0 = MEM_U32(s1 + 0); +at = 0x4; +if (v0 != at) {s1 = 0x20; +goto L446e70;} +s1 = 0x20; +s0 = 0x1001a454; +t9 = 0x10019320; +t8 = 0x10; +MEM_U32(s0 + 0) = t8; +t9 = MEM_U32(t9 + 0); +at = 0x1001a44c; +t5 = v0 + t9; +t6 = t5 << 2; +t8 = t8 + t6; +MEM_U32(at + 0) = t8; +goto L446e90; +MEM_U32(at + 0) = t8; +L446e70: +s0 = 0x1001a454; +t5 = 0x10019320; +MEM_U32(s0 + 0) = s1; +t5 = MEM_U32(t5 + 0); +at = 0x1001a44c; +t7 = t5 << 2; +t6 = s1 + t7; +MEM_U32(at + 0) = t6; +L446e90: +v0 = 0x10019314; +at = 0x1001a45c; +v0 = MEM_U32(v0 + 0); +MEM_U32(at + 0) = zero; +at = 0x4; +t8 = v0 << 1; +if (t8 != at) {t6 = 0xc0; +goto L446edc;} +t6 = 0xc0; +s2 = 0x1001a458; +t7 = 0x10019324; +t9 = 0xb0; +MEM_U32(s2 + 0) = t9; +t7 = MEM_U32(t7 + 0); +at = 0x1001a450; +t8 = t7 + v0; +t5 = t8 << 3; +t7 = t9 + t5; +MEM_U32(at + 0) = t7; +goto L446efc; +MEM_U32(at + 0) = t7; +L446edc: +s2 = 0x1001a458; +t9 = 0x10019324; +MEM_U32(s2 + 0) = t6; +t5 = MEM_U32(t9 + 0); +at = 0x1001a450; +t7 = t5 << 3; +t6 = t6 + t7; +MEM_U32(at + 0) = t6; +L446efc: +at = 0x1001a4d4; +v1 = 0x1001a548; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a508; +v0 = 0x1001938c; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a538; +//nop; +MEM_U32(at + 0) = zero; +at = 0x10019d70; +//nop; +MEM_U32(at + 0) = zero; +at = 0x1001a544; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +MEM_U32(v1 + 0) = zero; +v0 = MEM_U8(v0 + 0); +//nop; +if (v0 != 0) {//nop; +goto L446f74;} +//nop; +v0 = 0x10018e9c; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +if (v0 != 0) {//nop; +goto L446f74;} +//nop; +v0 = MEM_U32(s3 + 44); +//nop; +t9 = v0 & 0x2; +v0 = zero < t9; +L446f74: +at = 0x10019390; +MEM_U8(at + 0) = (uint8_t)v0; +goto L449338; +MEM_U8(at + 0) = (uint8_t)v0; +L446f80: +t8 = MEM_U32(s3 + 36); +at = 0x1; +if (t8 != at) {s1 = 0x20; +goto L449338;} +s1 = 0x20; +at = 0x1001a544; +s0 = 0x1001a454; +t7 = 0x1; +t9 = 0x10019320; +MEM_U8(at + 0) = (uint8_t)t7; +MEM_U32(s0 + 0) = s1; +t9 = MEM_U32(t9 + 0); +at = 0x1001a44c; +t5 = t9 << 2; +s2 = 0x1001a458; +t8 = s1 + t5; +t6 = 0x10019324; +t7 = 0xc0; +MEM_U32(at + 0) = t8; +MEM_U32(s2 + 0) = t7; +t5 = MEM_U32(t6 + 0); +at = 0x1001a450; +t8 = t5 << 3; +t7 = t7 + t8; +MEM_U32(at + 0) = t7; +goto L449338; +MEM_U32(at + 0) = t7; +L446fe4: +a3 = MEM_U8(s3 + 41); +//nop; +t6 = a3 & 0xe0; +t5 = t6 >> 5; +if ((int)t5 <= 0) {//nop; +goto L44701c;} +//nop; +s0 = 0x1001a4d0; +//nop; +a0 = MEM_U32(s0 + 0); +a1 = t5; +f_map_pars_to_regs(mem, sp, a0, a1); +goto L447010; +a1 = t5; +L447010: +gp = MEM_U32(sp + 192); +//nop; +goto L447038; +//nop; +L44701c: +s0 = 0x1001a4d0; +//nop; +a0 = MEM_U32(s0 + 0); +a1 = 0xffffffff; +f_map_pars_to_regs(mem, sp, a0, a1); +goto L447030; +a1 = 0xffffffff; +L447030: +gp = MEM_U32(sp + 192); +//nop; +L447038: +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +f_fix_amt_ref(mem, sp, a0); +goto L447048; +//nop; +L447048: +gp = MEM_U32(sp + 192); +t9 = MEM_U8(s3 + 33); +t7 = 0x10019360; +t8 = t9 & 0xff1f; +MEM_U8(s3 + 33) = (uint8_t)t8; +t7 = MEM_U8(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L447570;} +//nop; +v0 = MEM_U32(s3 + 44); +//nop; +t6 = v0 & 0x2; +if (t6 != 0) {t5 = v0 & 0x8; +goto L447570;} +t5 = v0 & 0x8; +if (t5 != 0) {t9 = v0 & 0x10; +goto L447570;} +t9 = v0 & 0x10; +if (t9 != 0) {t8 = v0 & 0x20; +goto L447570;} +t8 = v0 & 0x20; +if (t8 != 0) {//nop; +goto L447570;} +//nop; +t6 = MEM_U8(s3 + 33); +t7 = MEM_U8(sp + 207); +t5 = t6 & 0x1f; +if (t7 != t5) {//nop; +goto L447570;} +//nop; +t9 = MEM_U32(sp + 208); +t8 = MEM_U16(s3 + 34); +//nop; +if (t9 != t8) {//nop; +goto L447570;} +//nop; +a1 = MEM_U32(s3 + 8); +at = 0x88; +v0 = MEM_U8(a1 + 32); +s4 = 0x52; +if (v0 == at) {s2 = 0x2; +goto L4471a0;} +s2 = 0x2; +s1 = 0x20; +t2 = 0x7b; +t6 = v0 < 0x80; +L4470e4: +if (t6 == 0) {t7 = (int)v0 >> 5; +goto L44710c;} +t7 = (int)v0 >> 5; +t9 = 0x10005ad0; +t5 = t7 << 2; +t9 = t9; +t8 = t9 + t5; +t7 = MEM_U32(t8 + 0); +//nop; +t9 = t7 << (v0 & 0x1f); +t6 = (int)t9 < (int)0x0; +L44710c: +if (t6 != 0) {s0 = a1 + 0x20; +goto L447188;} +s0 = a1 + 0x20; +if (t2 != v0) {//nop; +goto L447570;} +//nop; +//nop; +a0 = s0; +MEM_U32(sp + 228) = a1; +v0 = f_ureg(mem, sp, a0); +goto L44712c; +MEM_U32(sp + 228) = a1; +L44712c: +gp = MEM_U32(sp + 192); +a1 = MEM_U32(sp + 228); +if (v0 == s2) {t2 = 0x7b; +goto L44715c;} +t2 = 0x7b; +//nop; +a0 = s0; +MEM_U32(sp + 228) = a1; +v0 = f_ureg(mem, sp, a0); +goto L44714c; +MEM_U32(sp + 228) = a1; +L44714c: +gp = MEM_U32(sp + 192); +a1 = MEM_U32(sp + 228); +if (v0 != s1) {t2 = 0x7b; +goto L447570;} +t2 = 0x7b; +L44715c: +v1 = MEM_U32(a1 + 0); +//nop; +t8 = MEM_U8(v1 + 32); +//nop; +if (s4 != t8) {//nop; +goto L447570;} +//nop; +t7 = MEM_U32(a1 + 44); +t9 = MEM_U32(v1 + 44); +//nop; +if (t7 != t9) {//nop; +goto L447570;} +//nop; +L447188: +a1 = MEM_U32(a1 + 8); +at = 0x88; +v0 = MEM_U8(a1 + 32); +//nop; +if (v0 != at) {t6 = v0 < 0x80; +goto L4470e4;} +t6 = v0 < 0x80; +L4471a0: +t5 = MEM_U32(a1 + 4); +t2 = 0x7b; +s0 = MEM_U32(t5 + 8); +s2 = 0x2; +v0 = MEM_U8(s0 + 32); +s4 = 0x52; +t6 = v0 < 0x80; +if (t6 == 0) {v1 = 0x1f; +goto L4471e8;} +v1 = 0x1f; +t9 = 0x10005ad0; +t8 = (int)v0 >> 5; +t7 = t8 << 2; +t9 = t9; +t5 = t9 + t7; +t8 = MEM_U32(t5 + 0); +//nop; +t9 = t8 << (v0 & 0x1f); +t6 = (int)t9 < (int)0x0; +L4471e8: +if (t6 == 0) {//nop; +goto L447234;} +//nop; +L4471f0: +s0 = MEM_U32(s0 + 8); +//nop; +v0 = MEM_U8(s0 + 32); +//nop; +t5 = v0 < 0x80; +if (t5 == 0) {t8 = (int)v0 >> 5; +goto L44722c;} +t8 = (int)v0 >> 5; +t7 = 0x10005ad0; +t9 = t8 << 2; +t7 = t7; +t6 = t7 + t9; +t8 = MEM_U32(t6 + 0); +//nop; +t7 = t8 << (v0 & 0x1f); +t5 = (int)t7 < (int)0x0; +L44722c: +if (t5 != 0) {//nop; +goto L4471f0;} +//nop; +L447234: +if (v1 != v0) {//nop; +goto L447570;} +//nop; +s0 = MEM_U32(a1 + 8); +//nop; +v0 = MEM_U8(s0 + 32); +//nop; +t6 = v0 < 0x80; +if (t6 == 0) {t8 = (int)v0 >> 5; +goto L447278;} +t8 = (int)v0 >> 5; +t9 = 0x10005ad0; +t7 = t8 << 2; +t9 = t9; +t5 = t9 + t7; +t8 = MEM_U32(t5 + 0); +//nop; +t9 = t8 << (v0 & 0x1f); +t6 = (int)t9 < (int)0x0; +L447278: +if (t6 == 0) {//nop; +goto L4472c4;} +//nop; +L447280: +s0 = MEM_U32(s0 + 8); +//nop; +v0 = MEM_U8(s0 + 32); +//nop; +t5 = v0 < 0x80; +if (t5 == 0) {t8 = (int)v0 >> 5; +goto L4472bc;} +t8 = (int)v0 >> 5; +t7 = 0x10005ad0; +t9 = t8 << 2; +t7 = t7; +t6 = t7 + t9; +t8 = MEM_U32(t6 + 0); +//nop; +t7 = t8 << (v0 & 0x1f); +t5 = (int)t7 < (int)0x0; +L4472bc: +if (t5 != 0) {//nop; +goto L447280;} +//nop; +L4472c4: +if (v1 != v0) {//nop; +goto L447570;} +//nop; +t4 = MEM_U32(s3 + 12); +t0 = 0x5c; +v0 = MEM_U8(t4 + 32); +t1 = 0x6f; +if (t0 == v0) {a1 = t4; +goto L44731c;} +a1 = t4; +if (t1 == v0) {//nop; +goto L44731c;} +//nop; +if (t2 == v0) {//nop; +goto L44731c;} +//nop; +L4472f4: +a1 = MEM_U32(a1 + 12); +//nop; +v0 = MEM_U8(a1 + 32); +//nop; +if (t0 == v0) {//nop; +goto L44731c;} +//nop; +if (t1 == v0) {//nop; +goto L44731c;} +//nop; +if (t2 != v0) {//nop; +goto L4472f4;} +//nop; +L44731c: +t1 = 0x6f; +if (t1 == v0) {//nop; +goto L447330;} +//nop; +if (t2 != v0) {//nop; +goto L447380;} +//nop; +L447330: +t6 = MEM_U32(a1 + 44); +t8 = MEM_U32(a1 + 40); +t9 = MEM_U32(sp + 200); +a3 = t6 + t8; +a3 = a3 + 0x3; +if ((int)a3 >= 0) {t7 = (int)a3 >> 2; +goto L447354;} +t7 = (int)a3 >> 2; +at = a3 + 0x3; +t7 = (int)at >> 2; +L447354: +at = (int)t9 < (int)0x4; +if (at == 0) {a3 = t7; +goto L447364;} +a3 = t7; +t9 = 0x4; +L447364: +at = (int)a3 < (int)0x4; +if (at == 0) {t5 = a3; +goto L447374;} +t5 = a3; +t5 = 0x4; +L447374: +at = (int)t9 < (int)t5; +if (at != 0) {//nop; +goto L447570;} +//nop; +L447380: +if (t0 == v0) {t3 = 0x1; +goto L44741c;} +t3 = 0x1; +a2 = 0x10019348; +a3 = 0x47; +L447390: +if (t1 != v0) {//nop; +goto L447404;} +//nop; +t8 = MEM_U8(a1 + 33); +t6 = MEM_U8(a2 + 0); +t7 = t8 & 0x1f; +if (t6 != t7) {//nop; +goto L447404;} +//nop; +v0 = MEM_U32(a1 + 12); +//nop; +t9 = MEM_U8(v0 + 32); +//nop; +if (t2 != t9) {//nop; +goto L447404;} +//nop; +v1 = MEM_U32(v0 + 0); +//nop; +a0 = MEM_U8(v1 + 32); +//nop; +if (s4 == a0) {//nop; +goto L4473e4;} +//nop; +if (a3 != a0) {//nop; +goto L447404;} +//nop; +L4473e4: +v0 = MEM_U8(v1 + 33); +//nop; +t5 = v0 << 24; +t8 = t5 >> 29; +if (t3 == t8) {//nop; +goto L447570;} +//nop; +if (s2 == t8) {//nop; +goto L447570;} +//nop; +L447404: +a1 = MEM_U32(a1 + 12); +//nop; +v0 = MEM_U8(a1 + 32); +//nop; +if (t0 != v0) {//nop; +goto L447390;} +//nop; +L44741c: +v0 = MEM_U8(t4 + 32); +a1 = t4; +if (t0 == v0) {//nop; +goto L44755c;} +//nop; +if (t1 == v0) {//nop; +goto L44755c;} +//nop; +L447434: +if (t2 != v0) {//nop; +goto L44753c;} +//nop; +t6 = MEM_U8(a1 + 33); +//nop; +t7 = t6 << 24; +t9 = t7 >> 29; +if (s2 != t9) {//nop; +goto L44753c;} +//nop; +v1 = MEM_U32(a1 + 0); +//nop; +t5 = MEM_U8(v1 + 32); +//nop; +if (s4 != t5) {//nop; +goto L44749c;} +//nop; +t8 = MEM_U8(v1 + 33); +//nop; +t6 = t8 << 24; +t7 = t6 >> 29; +if (s2 != t7) {//nop; +goto L44749c;} +//nop; +t9 = MEM_U32(v1 + 44); +t5 = MEM_U32(a1 + 44); +//nop; +at = (int)t9 < (int)t5; +if (at != 0) {//nop; +goto L447570;} +//nop; +L44749c: +v0 = MEM_U32(v1 + 0); +//nop; +if (v0 == 0) {//nop; +goto L4474ec;} +//nop; +t8 = MEM_U8(v0 + 32); +//nop; +if (s4 != t8) {//nop; +goto L4474ec;} +//nop; +t6 = MEM_U8(v0 + 33); +//nop; +t7 = t6 << 24; +t9 = t7 >> 29; +if (s2 != t9) {//nop; +goto L4474ec;} +//nop; +t5 = MEM_U32(v0 + 44); +t8 = MEM_U32(a1 + 44); +//nop; +at = (int)t5 < (int)t8; +if (at != 0) {//nop; +goto L447570;} +//nop; +L4474ec: +v0 = MEM_U32(v1 + 4); +//nop; +if (v0 == 0) {//nop; +goto L44753c;} +//nop; +t6 = MEM_U8(v0 + 32); +//nop; +if (s4 != t6) {//nop; +goto L44753c;} +//nop; +t7 = MEM_U8(v0 + 33); +//nop; +t9 = t7 << 24; +t5 = t9 >> 29; +if (s2 != t5) {//nop; +goto L44753c;} +//nop; +t8 = MEM_U32(v0 + 44); +t6 = MEM_U32(a1 + 44); +//nop; +at = (int)t8 < (int)t6; +if (at != 0) {//nop; +goto L447570;} +//nop; +L44753c: +a1 = MEM_U32(a1 + 12); +//nop; +v0 = MEM_U8(a1 + 32); +//nop; +if (t0 == v0) {//nop; +goto L44755c;} +//nop; +if (t1 != v0) {//nop; +goto L447434;} +//nop; +L44755c: +t7 = MEM_U8(s3 + 33); +//nop; +t9 = t7 & 0xff1f; +t5 = t9 | 0xa0; +MEM_U8(s3 + 33) = (uint8_t)t5; +L447570: +t8 = MEM_U8(s3 + 33); +at = 0x5; +t6 = t8 << 24; +t7 = t6 >> 29; +if (t7 == at) {//nop; +goto L4475dc;} +//nop; +v0 = MEM_U32(s3 + 44); +//nop; +t9 = v0 & 0x2; +if (t9 == 0) {t5 = v0 & 0x10; +goto L4475c4;} +t5 = v0 & 0x10; +if (t5 == 0) {//nop; +goto L4475dc;} +//nop; +v1 = 0x1001a548; +at = 0x10018ea8; +t8 = MEM_U32(v1 + 0); +//nop; +t6 = t8 + 0x1; +MEM_U32(v1 + 0) = t6; +MEM_U8(at + 0) = (uint8_t)zero; +goto L4475dc; +MEM_U8(at + 0) = (uint8_t)zero; +L4475c4: +v1 = 0x1001a548; +//nop; +t7 = MEM_U32(v1 + 0); +//nop; +t9 = t7 + 0x1; +MEM_U32(v1 + 0) = t9; +L4475dc: +at = 0x1001a4d4; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a508; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a538; +//nop; +MEM_U32(at + 0) = zero; +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L44760c: +at = 0x1001a4d4; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a508; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a538; +MEM_U32(at + 0) = zero; +goto L449338; +MEM_U32(at + 0) = zero; +L447630: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L447640; +//nop; +L447640: +a3 = MEM_U8(s3 + 41); +gp = MEM_U32(sp + 192); +t5 = a3 & 0xe0; +t8 = t5 >> 5; +if ((int)t8 <= 0) {MEM_U32(s3 + 0) = v0; +goto L447678;} +MEM_U32(s3 + 0) = v0; +s0 = 0x1001a4d0; +//nop; +a0 = MEM_U32(s0 + 0); +a1 = t8; +f_map_pars_to_regs(mem, sp, a0, a1); +goto L44766c; +a1 = t8; +L44766c: +gp = MEM_U32(sp + 192); +//nop; +goto L447694; +//nop; +L447678: +s0 = 0x1001a4d0; +//nop; +a0 = MEM_U32(s0 + 0); +a1 = 0xffffffff; +f_map_pars_to_regs(mem, sp, a0, a1); +goto L44768c; +a1 = 0xffffffff; +L44768c: +gp = MEM_U32(sp + 192); +//nop; +L447694: +v1 = 0x1001a548; +at = 0x1001a4d4; +t6 = MEM_U32(v1 + 0); +//nop; +t7 = t6 + 0x1; +MEM_U32(v1 + 0) = t7; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a508; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a538; +//nop; +MEM_U32(at + 0) = zero; +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L4476d4: +//nop; +a0 = s3; +//nop; +f_check_reg(mem, sp, a0); +goto L4476e4; +//nop; +L4476e4: +t9 = MEM_U8(s3 + 33); +gp = MEM_U32(sp + 192); +t5 = t9 << 24; +t8 = t5 >> 29; +at = 0x3; +if (t8 == at) {t6 = 0x1; +goto L447708;} +t6 = 0x1; +MEM_U8(s3 + 22) = (uint8_t)t6; +goto L44770c; +MEM_U8(s3 + 22) = (uint8_t)t6; +L447708: +MEM_U8(s3 + 22) = (uint8_t)zero; +L44770c: +//nop; +a0 = s3; +//nop; +v0 = f_load_cse(mem, sp, a0); +goto L44771c; +//nop; +L44771c: +gp = MEM_U32(sp + 192); +ra = MEM_U32(sp + 196); +goto L4494ac; +ra = MEM_U32(sp + 196); +L447728: +a1 = 0x1001a53c; +//nop; +a1 = MEM_U8(a1 + 0); +a0 = s3; +f_assign_vreg(mem, sp, a0, a1); +goto L44773c; +a0 = s3; +L44773c: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L44774c: +v0 = MEM_U8(s3 + 33); +at = 0x6; +t7 = v0 << 24; +t9 = t7 >> 29; +if (t9 != at) {v0 = t9; +goto L447808;} +v0 = t9; +t5 = 0x10018ea8; +t9 = 0x40; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L447808;} +//nop; +t8 = 0x1001a45c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L447798;} +//nop; +abort(); +L447798: +at = 0x1001a53c; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +t6 = MEM_U32(s3 + 36); +at = 0x1; +if (t6 != at) {//nop; +goto L4477c0;} +//nop; +at = 0x1001a540; +t7 = 0x1; +MEM_U8(at + 0) = (uint8_t)t7; +L4477c0: +s0 = 0x1001a454; +t8 = 0x10019318; +MEM_U32(s0 + 0) = t9; +t8 = MEM_U32(t8 + 0); +at = 0x1001a44c; +t6 = t8 << 2; +t7 = t9 + t6; +s2 = 0x1001a458; +t5 = 0x1001931c; +t9 = 0xd0; +MEM_U32(at + 0) = t7; +MEM_U32(s2 + 0) = t9; +t6 = MEM_U32(t5 + 0); +at = 0x1001a450; +t7 = t6 << 3; +t9 = t9 + t7; +MEM_U32(at + 0) = t9; +goto L449338; +MEM_U32(at + 0) = t9; +L447808: +s2 = 0x2; +if (s2 != v0) {//nop; +goto L449338;} +//nop; +v0 = 0x10019d70; +t5 = MEM_U32(s3 + 0); +t6 = 0x1001a53c; +MEM_U32(v0 + 0) = t5; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L447954;} +//nop; +t8 = 0x1001a544; +//nop; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L447954;} +//nop; +if (t5 == 0) {a1 = t5; +goto L447954;} +a1 = t5; +t7 = MEM_U32(t5 + 48); +s4 = 0xffffffff; +if (s4 == t7) {//nop; +goto L447954;} +//nop; +s2 = 0x1001a458; +s1 = 0x10019310; +s0 = 0x1001a454; +//nop; +L447874: +//nop; +a0 = a1; +MEM_U32(sp + 228) = a1; +v0 = f_parm_reg(mem, sp, a0); +goto L447884; +MEM_U32(sp + 228) = a1; +L447884: +v1 = v0 & 0xff; +gp = MEM_U32(sp + 192); +a1 = MEM_U32(sp + 228); +at = v1 < 0x4; +if (at != 0) {//nop; +goto L4478f4;} +//nop; +t9 = MEM_U32(s1 + 0); +//nop; +t5 = t9 + 0x3; +at = t5 < v1; +if (at != 0) {//nop; +goto L4478f4;} +//nop; +t6 = MEM_U32(a1 + 48); +t8 = MEM_U32(a1 + 40); +//nop; +t7 = t6 + t8; +t9 = t7 + 0x3; +if ((int)t9 >= 0) {t5 = (int)t9 >> 2; +goto L4478d8;} +t5 = (int)t9 >> 2; +at = t9 + 0x3; +t5 = (int)at >> 2; +L4478d8: +at = (int)t5 < (int)0x9; +if (at != 0) {t6 = t5 << 2; +goto L4478ec;} +t6 = t5 << 2; +t5 = 0x8; +t6 = t5 << 2; +L4478ec: +MEM_U32(s0 + 0) = t6; +goto L447934; +MEM_U32(s0 + 0) = t6; +L4478f4: +t8 = MEM_U32(a1 + 48); +t7 = MEM_U32(a1 + 40); +//nop; +t9 = t8 + t7; +t5 = t9 + 0x7; +if ((int)t5 >= 0) {t6 = (int)t5 >> 3; +goto L447918;} +t6 = (int)t5 >> 3; +at = t5 + 0x7; +t6 = (int)at >> 3; +L447918: +t8 = t6 << 1; +at = (int)t8 < (int)0x31; +if (at != 0) {t7 = t8 << 2; +goto L447930;} +t7 = t8 << 2; +t8 = 0x30; +t7 = t8 << 2; +L447930: +MEM_U32(s2 + 0) = t7; +L447934: +a1 = MEM_U32(a1 + 8); +//nop; +if (a1 == 0) {//nop; +goto L447954;} +//nop; +t9 = MEM_U32(a1 + 48); +//nop; +if (s4 != t9) {//nop; +goto L447874;} +//nop; +L447954: +v0 = 0x10019d70; +a0 = MEM_U8(s3 + 32); +s0 = MEM_U32(v0 + 0); +//nop; +if (s0 == 0) {//nop; +goto L44797c;} +//nop; +L44796c: +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 != 0) {//nop; +goto L44796c;} +//nop; +L44797c: +if (s0 == 0) {//nop; +goto L449338;} +//nop; +//nop; +goto L449338; +//nop; +L44798c: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L44799c; +//nop; +L44799c: +gp = MEM_U32(sp + 192); +a0 = MEM_U32(s3 + 4); +//nop; +MEM_U32(s3 + 0) = v0; +//nop; +v0 = f_translate(mem, sp, a0); +goto L4479b4; +//nop; +L4479b4: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 4) = v0; +at = 0x1001a508; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a4d4; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a538; +//nop; +MEM_U32(at + 0) = zero; +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L4479ec: +v0 = MEM_U32(s3 + 40); +t5 = 0x21; +at = (int)v0 < (int)t5; +if (at != 0) {//nop; +goto L447a04;} +//nop; +abort(); +L447a04: +a1 = MEM_U32(s3 + 44); +//nop; +a0 = MEM_U32(s3 + 0); +s1 = s3; +a2 = v0 << 3; +a1 = -a1; +v0 = f_set_rewrite(mem, sp, a0, a1, a2); +goto L447a20; +a1 = -a1; +L447a20: +gp = MEM_U32(sp + 192); +s3 = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L447a38; +//nop; +L447a38: +gp = MEM_U32(sp + 192); +v1 = MEM_U8(s3 + 25); +a0 = MEM_U8(s3 + 32); +goto L445fe8; +a0 = MEM_U8(s3 + 32); +L447a48: +t6 = MEM_U16(s3 + 34); +//nop; +t8 = t6 & 0x2; +if (t8 == 0) {//nop; +goto L447a78;} +//nop; +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L447a6c; +//nop; +L447a6c: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = v0; +goto L447c24; +MEM_U32(s3 + 0) = v0; +L447a78: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L447a88; +//nop; +L447a88: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L447ab0;} +//nop; +//nop; +a0 = s3; +//nop; +v0 = f_fold(mem, sp, a0); +goto L447aa4; +//nop; +L447aa4: +gp = MEM_U32(sp + 192); +s3 = v0; +goto L447c24; +s3 = v0; +L447ab0: +s0 = MEM_U32(s3 + 0); +at = 0x19; +v1 = MEM_U8(s0 + 32); +//nop; +if (v1 != at) {at = 0x19; +goto L447b78;} +at = 0x19; +t7 = MEM_U32(s0 + 36); +t9 = MEM_U32(s3 + 36); +//nop; +at = (int)t7 < (int)t9; +if (at != 0) {at = 0x19; +goto L447b78;} +at = 0x19; +t5 = MEM_U16(s0 + 34); +//nop; +t6 = t5 & 0x2; +if (t6 == 0) {//nop; +goto L447b40;} +//nop; +//nop; +s1 = s3; +a0 = s0; +v0 = f_dup_tree(mem, sp, a0); +goto L447b04; +a0 = s0; +L447b04: +gp = MEM_U32(sp + 192); +a0 = v0; +//nop; +//nop; +//nop; +v0 = f_translate(mem, sp, a0); +goto L447b1c; +//nop; +L447b1c: +gp = MEM_U32(sp + 192); +s3 = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L447b34; +//nop; +L447b34: +gp = MEM_U32(sp + 192); +v0 = s3; +goto L4494a8; +v0 = s3; +L447b40: +//nop; +a0 = MEM_U32(s0 + 0); +s1 = s0; +v0 = f_dup_tree(mem, sp, a0); +goto L447b50; +s1 = s0; +L447b50: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L447b68; +//nop; +L447b68: +gp = MEM_U32(sp + 192); +//nop; +goto L447c04; +//nop; +at = 0x19; +L447b78: +if (v1 != at) {//nop; +goto L447c04;} +//nop; +v0 = MEM_U8(s0 + 33); +t7 = MEM_U8(s3 + 33); +t8 = v0 & 0x1f; +t9 = t7 & 0x1f; +if (t8 == t9) {at = 0x6; +goto L447ba0;} +at = 0x6; +if (t8 == at) {//nop; +goto L447c04;} +//nop; +L447ba0: +//nop; +s1 = s3; +a0 = s0; +v0 = f_dup_tree(mem, sp, a0); +goto L447bb0; +a0 = s0; +L447bb0: +gp = MEM_U32(sp + 192); +a0 = v0; +//nop; +//nop; +//nop; +v0 = f_translate(mem, sp, a0); +goto L447bc8; +//nop; +L447bc8: +gp = MEM_U32(sp + 192); +s3 = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L447be0; +//nop; +L447be0: +t5 = MEM_U32(s1 + 0); +gp = MEM_U32(sp + 192); +t6 = MEM_U8(t5 + 22); +v0 = s3; +if (t6 != 0) {//nop; +goto L447bfc;} +//nop; +t6 = 0x1; +L447bfc: +MEM_U8(s3 + 22) = (uint8_t)t6; +goto L4494a8; +MEM_U8(s3 + 22) = (uint8_t)t6; +L447c04: +//nop; +a0 = s3; +//nop; +v0 = f_translate_cvtl(mem, sp, a0); +goto L447c14; +//nop; +L447c14: +gp = MEM_U32(sp + 192); +v1 = MEM_U8(v0 + 25); +s3 = v0; +goto L445fe4; +s3 = v0; +L447c24: +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L447c30: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L447c40; +//nop; +L447c40: +gp = MEM_U32(sp + 192); +a2 = MEM_U32(s3 + 44); +//nop; +MEM_U32(s3 + 0) = v0; +a0 = 0x6; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L447c5c; +a1 = zero; +L447c5c: +t8 = 0x1; +t7 = MEM_U32(s3 + 0); +MEM_U32(s3 + 4) = v0; +MEM_U8(s3 + 32) = (uint8_t)t8; +MEM_U16(s3 + 34) = (uint16_t)zero; +t9 = MEM_U8(v0 + 22); +v1 = MEM_U8(t7 + 22); +gp = MEM_U32(sp + 192); +if (t9 != v1) {t5 = v1 + 0x1; +goto L447c8c;} +t5 = v1 + 0x1; +MEM_U8(s3 + 22) = (uint8_t)t5; +goto L447cb0; +MEM_U8(s3 + 22) = (uint8_t)t5; +L447c8c: +t6 = MEM_U32(s3 + 4); +//nop; +t8 = MEM_U8(t6 + 22); +//nop; +at = t8 < v1; +if (at == 0) {//nop; +goto L447cac;} +//nop; +t8 = v1; +L447cac: +MEM_U8(s3 + 22) = (uint8_t)t8; +L447cb0: +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L447cbc: +//nop; +a0 = s3; +//nop; +v0 = f_cse(mem, sp, a0); +goto L447ccc; +//nop; +L447ccc: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(v0 + 32); +s3 = v0; +goto L449338; +s3 = v0; +L447cdc: +v1 = MEM_U8(s3 + 33); +at = 0xe; +t7 = v1 & 0x1f; +if (t7 != at) {v1 = t7; +goto L447d34;} +v1 = t7; +v0 = MEM_U32(s3 + 40); +a0 = s3 + 0x30; +at = (int)v0 < (int)0x5; +if (at == 0) {t7 = v1 < 0x20; +goto L447d38;} +t7 = v1 < 0x20; +//nop; +a1 = zero; +a2 = v0 << 3; +v0 = f_get_set_const(mem, sp, a0, a1, a2); +goto L447d14; +a2 = v0 << 3; +L447d14: +t9 = MEM_U8(s3 + 33); +gp = MEM_U32(sp + 192); +t5 = t9 & s4; +v1 = t5 | 0x8; +MEM_U8(s3 + 33) = (uint8_t)v1; +t8 = v1 & 0x1f; +MEM_U32(s3 + 48) = v0; +v1 = t8; +L447d34: +t7 = v1 < 0x20; +L447d38: +at = 0xc0000; +at = at | 0x8000; +t9 = -t7; +t5 = t9 & at; +t6 = t5 << (v1 & 0x1f); +if ((int)t6 >= 0) {t8 = 0x1; +goto L447d5c;} +t8 = 0x1; +MEM_U8(s3 + 22) = (uint8_t)t8; +goto L447d60; +MEM_U8(s3 + 22) = (uint8_t)t8; +L447d5c: +MEM_U8(s3 + 22) = (uint8_t)zero; +L447d60: +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L447d6c: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L447d7c; +//nop; +L447d7c: +gp = MEM_U32(sp + 192); +a0 = MEM_U32(s3 + 4); +//nop; +MEM_U32(s3 + 0) = v0; +//nop; +v0 = f_translate(mem, sp, a0); +goto L447d94; +//nop; +L447d94: +s0 = MEM_U32(s3 + 0); +MEM_U32(s3 + 4) = v0; +v1 = MEM_U8(s0 + 32); +gp = MEM_U32(sp + 192); +a3 = 0x47; +if (a3 != v1) {a0 = 0x5e; +goto L447dd4;} +a0 = 0x5e; +//nop; +a0 = s3; +a1 = s3 + 0x4; +f_swap_tree(mem, sp, a0, a1); +goto L447dc0; +a1 = s3 + 0x4; +L447dc0: +gp = MEM_U32(sp + 192); +s0 = MEM_U32(s3 + 0); +a2 = MEM_U32(s3 + 4); +v1 = MEM_U8(s0 + 22); +goto L447f4c; +v1 = MEM_U8(s0 + 22); +L447dd4: +if (a0 != v1) {//nop; +goto L447e34;} +//nop; +//nop; +a0 = MEM_U32(s0 + 0); +s1 = s0; +v0 = f_dup_tree(mem, sp, a0); +goto L447dec; +s1 = s0; +L447dec: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L447e04; +//nop; +L447e04: +gp = MEM_U32(sp + 192); +a0 = s3; +//nop; +a1 = s3 + 0x4; +//nop; +f_swap_tree(mem, sp, a0, a1); +goto L447e1c; +//nop; +L447e1c: +gp = MEM_U32(sp + 192); +t7 = 0x7d; +s0 = MEM_U32(s3 + 0); +a2 = MEM_U32(s3 + 4); +MEM_U8(s3 + 32) = (uint8_t)t7; +goto L447f48; +MEM_U8(s3 + 32) = (uint8_t)t7; +L447e34: +a2 = MEM_U32(s3 + 4); +//nop; +v0 = MEM_U8(a2 + 32); +//nop; +if (a0 != v0) {//nop; +goto L447e8c;} +//nop; +//nop; +a0 = MEM_U32(a2 + 0); +s1 = a2; +v0 = f_dup_tree(mem, sp, a0); +goto L447e5c; +s1 = a2; +L447e5c: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 4) = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L447e74; +//nop; +L447e74: +gp = MEM_U32(sp + 192); +t9 = 0x7d; +s0 = MEM_U32(s3 + 0); +a2 = MEM_U32(s3 + 4); +MEM_U8(s3 + 32) = (uint8_t)t9; +goto L447f48; +MEM_U8(s3 + 32) = (uint8_t)t9; +L447e8c: +t5 = MEM_U16(s0 + 20); +a0 = 0x1; +if (a0 != t5) {//nop; +goto L447ee0;} +//nop; +if (a0 != v1) {//nop; +goto L447ee0;} +//nop; +t6 = MEM_U32(s0 + 4); +//nop; +t8 = MEM_U8(t6 + 32); +//nop; +if (a3 != t8) {//nop; +goto L447ee0;} +//nop; +//nop; +a0 = s3 + 0x4; +a1 = s0 + 0x4; +f_swap_tree(mem, sp, a0, a1); +goto L447ecc; +a1 = s0 + 0x4; +L447ecc: +gp = MEM_U32(sp + 192); +s0 = MEM_U32(s3 + 0); +a2 = MEM_U32(s3 + 4); +v1 = MEM_U8(s0 + 22); +goto L447f4c; +v1 = MEM_U8(s0 + 22); +L447ee0: +t7 = MEM_U16(a2 + 20); +//nop; +if (a0 != t7) {//nop; +goto L447f48;} +//nop; +if (a0 != v0) {//nop; +goto L447f48;} +//nop; +t9 = MEM_U32(a2 + 4); +//nop; +t5 = MEM_U8(t9 + 32); +//nop; +if (a3 != t5) {//nop; +goto L447f48;} +//nop; +//nop; +a0 = s3; +a1 = a2 + 0x4; +f_swap_tree(mem, sp, a0, a1); +goto L447f20; +a1 = a2 + 0x4; +L447f20: +gp = MEM_U32(sp + 192); +a0 = s3; +//nop; +a1 = s3 + 0x4; +//nop; +f_swap_tree(mem, sp, a0, a1); +goto L447f38; +//nop; +L447f38: +gp = MEM_U32(sp + 192); +s0 = MEM_U32(s3 + 0); +a2 = MEM_U32(s3 + 4); +//nop; +L447f48: +v1 = MEM_U8(s0 + 22); +L447f4c: +v0 = MEM_U8(a2 + 22); +t6 = v1 + 0x1; +if (v0 != v1) {at = v1 < v0; +goto L447f64;} +at = v1 < v0; +MEM_U8(s3 + 22) = (uint8_t)t6; +goto L447f74; +MEM_U8(s3 + 22) = (uint8_t)t6; +L447f64: +if (at == 0) {t8 = v1; +goto L447f70;} +t8 = v1; +t8 = v0; +L447f70: +MEM_U8(s3 + 22) = (uint8_t)t8; +L447f74: +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L447f80: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L447f90; +//nop; +L447f90: +gp = MEM_U32(sp + 192); +t7 = 0x4; +//nop; +MEM_U32(s3 + 0) = v0; +MEM_U8(s3 + 32) = (uint8_t)t7; +a0 = 0x8; +a1 = zero; +a2 = 0x1; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L447fb4; +a2 = 0x1; +L447fb4: +t9 = MEM_U32(s3 + 0); +MEM_U32(s3 + 4) = v0; +t5 = MEM_U8(v0 + 22); +v1 = MEM_U8(t9 + 22); +gp = MEM_U32(sp + 192); +if (t5 != v1) {t6 = v1 + 0x1; +goto L447fd8;} +t6 = v1 + 0x1; +MEM_U8(s3 + 22) = (uint8_t)t6; +goto L447ffc; +MEM_U8(s3 + 22) = (uint8_t)t6; +L447fd8: +t8 = MEM_U32(s3 + 4); +//nop; +t7 = MEM_U8(t8 + 22); +//nop; +at = t7 < v1; +if (at == 0) {//nop; +goto L447ff8;} +//nop; +t7 = v1; +L447ff8: +MEM_U8(s3 + 22) = (uint8_t)t7; +L447ffc: +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L448008: +t9 = MEM_U32(s3 + 40); +t5 = 0x5; +at = (int)t9 < (int)t5; +if (at != 0) {//nop; +goto L448020;} +//nop; +abort(); +L448020: +t6 = MEM_U8(s3 + 33); +v1 = MEM_U8(s3 + 25); +t8 = t6 & s4; +t7 = t8 | 0x8; +MEM_U8(s3 + 32) = (uint8_t)t0; +MEM_U8(s3 + 33) = (uint8_t)t7; +goto L445fe4; +MEM_U8(s3 + 33) = (uint8_t)t7; +L44803c: +t9 = MEM_U32(s3 + 40); +t5 = 0x5; +at = (int)t9 < (int)t5; +if (at != 0) {//nop; +goto L448054;} +//nop; +abort(); +L448054: +t6 = MEM_U8(s3 + 33); +v1 = MEM_U8(s3 + 25); +t8 = t6 & s4; +t7 = t8 | 0x8; +MEM_U8(s3 + 32) = (uint8_t)a3; +MEM_U8(s3 + 33) = (uint8_t)t7; +goto L445fe4; +MEM_U8(s3 + 33) = (uint8_t)t7; +L448070: +t9 = MEM_U32(s3 + 40); +t5 = 0x5; +at = (int)t9 < (int)t5; +if (at != 0) {//nop; +goto L448088;} +//nop; +abort(); +L448088: +t6 = MEM_U8(s3 + 33); +//nop; +t8 = t6 & s4; +t7 = t8 | 0x8; +a1 = MEM_U32(s3 + 4); +MEM_U8(s3 + 32) = (uint8_t)a3; +MEM_U8(s3 + 33) = (uint8_t)t7; +a0 = 0x61; +v0 = f_build_1op(mem, sp, a0, a1); +goto L4480ac; +a0 = 0x61; +L4480ac: +MEM_U32(s3 + 4) = v0; +t9 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 192); +t5 = t9 & s4; +t6 = t5 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t6; +v1 = MEM_U8(s3 + 25); +a0 = MEM_U8(s3 + 32); +goto L445fe8; +a0 = MEM_U8(s3 + 32); +L4480d0: +t8 = MEM_U32(s3 + 40); +t7 = 0x5; +at = (int)t8 < (int)t7; +if (at != 0) {//nop; +goto L4480e8;} +//nop; +abort(); +L4480e8: +t9 = 0x10018e80; +t5 = 0x74; +t9 = MEM_U8(t9 + 0); +a0 = 0x8; +if (t9 == 0) {a1 = zero; +goto L448170;} +a1 = zero; +a0 = MEM_U32(s3 + 0); +//nop; +t5 = 0x73; +MEM_U8(s3 + 32) = (uint8_t)t5; +MEM_U32(s3 + 4) = a0; +v0 = f_dup_tree(mem, sp, a0); +goto L448118; +MEM_U32(s3 + 4) = a0; +L448118: +gp = MEM_U32(sp + 192); +a2 = MEM_U32(s3 + 40); +//nop; +t6 = a2 << 5; +a2 = t6; +s0 = v0; +a0 = 0x8; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L44813c; +a1 = zero; +L44813c: +gp = MEM_U32(sp + 192); +a0 = 0x4e; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L448154; +a2 = v0; +L448154: +MEM_U32(s3 + 0) = v0; +t8 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 192); +t7 = t8 & s4; +t9 = t7 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t9; +goto L448190; +MEM_U8(v0 + 33) = (uint8_t)t9; +L448170: +t6 = MEM_U32(s3 + 0); +//nop; +MEM_U8(s3 + 32) = (uint8_t)t5; +a2 = 0x80000000; +MEM_U32(s3 + 4) = t6; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L448188; +MEM_U32(s3 + 4) = t6; +L448188: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = v0; +L448190: +t8 = MEM_U8(s3 + 33); +v1 = MEM_U8(s3 + 25); +t7 = t8 & s4; +t9 = t7 | 0x8; +MEM_U8(s3 + 33) = (uint8_t)t9; +goto L445fe4; +MEM_U8(s3 + 33) = (uint8_t)t9; +L4481a8: +t5 = MEM_U32(s3 + 40); +t6 = 0x5; +at = (int)t5 < (int)t6; +if (at != 0) {//nop; +goto L4481c0;} +//nop; +abort(); +L4481c0: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L4481d0; +//nop; +L4481d0: +gp = MEM_U32(sp + 192); +a0 = MEM_U32(s3 + 4); +//nop; +s1 = v0; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L4481e8; +//nop; +L4481e8: +gp = MEM_U32(sp + 192); +s0 = v0; +//nop; +a0 = s3; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L448200; +//nop; +L448200: +gp = MEM_U32(sp + 192); +a0 = 0x6; +//nop; +a1 = zero; +a2 = 0x1; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L448218; +a2 = 0x1; +L448218: +gp = MEM_U32(sp + 192); +a0 = 0x1; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L448230; +a2 = v0; +L448230: +gp = MEM_U32(sp + 192); +MEM_U16(v0 + 34) = (uint16_t)zero; +//nop; +a0 = 0x7d; +a1 = s1; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44824c; +a2 = v0; +L44824c: +gp = MEM_U32(sp + 192); +MEM_U16(v0 + 34) = (uint16_t)zero; +//nop; +s0 = v0; +a0 = 0x8; +a1 = zero; +a2 = 0x1f; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L44826c; +a2 = 0x1f; +L44826c: +gp = MEM_U32(sp + 192); +a0 = 0x74; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L448284; +a2 = v0; +L448284: +t8 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 192); +t7 = t8 & s4; +t5 = 0x10018e80; +t9 = t7 | 0x6; +MEM_U8(v0 + 33) = (uint8_t)t9; +t5 = MEM_U8(t5 + 0); +s3 = v0; +if (t5 == 0) {//nop; +goto L44832c;} +//nop; +//nop; +a0 = s0; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L4482bc; +//nop; +L4482bc: +gp = MEM_U32(sp + 192); +a0 = 0x74; +//nop; +a1 = s3; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L4482d4; +a2 = v0; +L4482d4: +t6 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 192); +t8 = t6 & s4; +t7 = t8 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t7; +//nop; +s3 = v0; +a0 = s1; +v0 = f_dup_tree(mem, sp, a0); +goto L4482f8; +a0 = s1; +L4482f8: +gp = MEM_U32(sp + 192); +a0 = 0x73; +//nop; +a1 = s3; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L448310; +a2 = v0; +L448310: +t9 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 192); +t5 = t9 & s4; +t6 = t5 | 0x8; +s3 = v0; +MEM_U8(v0 + 33) = (uint8_t)t6; +goto L4483a8; +MEM_U8(v0 + 33) = (uint8_t)t6; +L44832c: +//nop; +a0 = s0; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L44833c; +//nop; +L44833c: +gp = MEM_U32(sp + 192); +a0 = 0x73; +//nop; +a1 = s3; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L448354; +a2 = v0; +L448354: +t8 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 192); +t7 = t8 & s4; +t9 = t7 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t9; +//nop; +s3 = v0; +a0 = s1; +v0 = f_dup_tree(mem, sp, a0); +goto L448378; +a0 = s1; +L448378: +gp = MEM_U32(sp + 192); +a0 = 0x74; +//nop; +a1 = s3; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L448390; +a2 = v0; +L448390: +t5 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 192); +t6 = t5 & s4; +t8 = t6 | 0x8; +s3 = v0; +MEM_U8(v0 + 33) = (uint8_t)t8; +L4483a8: +v1 = MEM_U8(s3 + 25); +a0 = MEM_U8(s3 + 32); +goto L445fe8; +a0 = MEM_U8(s3 + 32); +L4483b4: +s1 = MEM_U32(s3 + 4); +MEM_U32(sp + 244) = zero; +t7 = MEM_U32(s1 + 40); +a0 = 0x8; +at = (int)t7 < (int)0x5; +if (at == 0) {//nop; +goto L448438;} +//nop; +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L4483e0; +//nop; +L4483e0: +a2 = MEM_U32(s3 + 40); +gp = MEM_U32(sp + 192); +t9 = a2 << 3; +a2 = t9; +//nop; +s0 = v0; +a0 = 0x8; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L448404; +a1 = zero; +L448404: +gp = MEM_U32(sp + 192); +a0 = 0x4e; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44841c; +a2 = v0; +L44841c: +t5 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 192); +t6 = t5 & s4; +t8 = t6 | 0x8; +s2 = v0; +MEM_U8(v0 + 33) = (uint8_t)t8; +goto L4485c0; +MEM_U8(v0 + 33) = (uint8_t)t8; +L448438: +//nop; +a1 = zero; +a2 = 0x1; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L448448; +a2 = 0x1; +L448448: +s0 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 192); +t7 = MEM_U8(s0 + 32); +at = 0x49; +if (t7 != at) {s2 = v0; +goto L4484b4;} +s2 = v0; +a3 = MEM_U32(s0 + 48); +a0 = s1; +if ((int)a3 >= 0) {a1 = (int)a3 >> 5; +goto L448478;} +a1 = (int)a3 >> 5; +at = a3 + 0x1f; +a1 = (int)at >> 5; +L448478: +t9 = a1 << 5; +a1 = t9; +//nop; +a2 = 0x20; +//nop; +v0 = f_set_rewrite(mem, sp, a0, a1, a2); +goto L448490; +//nop; +L448490: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 4) = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L4484a8; +//nop; +L4484a8: +gp = MEM_U32(sp + 192); +//nop; +goto L4485c0; +//nop; +L4484b4: +a1 = MEM_U32(s1 + 40); +//nop; +t5 = a1 << 3; +a1 = t5; +a0 = s0; +v0 = f_build_ucond0(mem, sp, a0, a1); +goto L4484cc; +a0 = s0; +L4484cc: +gp = MEM_U32(sp + 192); +MEM_U32(sp + 244) = v0; +//nop; +a0 = s0; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L4484e4; +//nop; +L4484e4: +gp = MEM_U32(sp + 192); +s0 = v0; +//nop; +a0 = 0x8; +a1 = zero; +a2 = 0x5; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L448500; +a2 = 0x5; +L448500: +gp = MEM_U32(sp + 192); +a0 = 0x74; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L448518; +a2 = v0; +L448518: +t6 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 192); +t8 = t6 & s4; +t7 = t8 | 0x6; +MEM_U8(v0 + 33) = (uint8_t)t7; +//nop; +s0 = v0; +a0 = 0x8; +a1 = zero; +a2 = 0x4; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L448544; +a2 = 0x4; +L448544: +gp = MEM_U32(sp + 192); +a0 = 0x5b; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44855c; +a2 = v0; +L44855c: +gp = MEM_U32(sp + 192); +MEM_U16(v0 + 34) = (uint16_t)zero; +//nop; +s0 = v0; +a0 = s1; +a1 = v0; +a2 = 0x20; +v0 = f_set_rewrite_indexed(mem, sp, a0, a1, a2); +goto L44857c; +a2 = 0x20; +L44857c: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 4) = v0; +//nop; +a0 = s0; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L448594; +//nop; +L448594: +gp = MEM_U32(sp + 192); +//nop; +at = 0x1001a4d4; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a508; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a538; +//nop; +MEM_U32(at + 0) = zero; +L4485c0: +//nop; +a0 = s3; +a1 = s3 + 0x4; +f_swap_tree(mem, sp, a0, a1); +goto L4485d0; +a1 = s3 + 0x4; +L4485d0: +gp = MEM_U32(sp + 192); +//nop; +t9 = 0x10018e80; +//nop; +t9 = MEM_U8(t9 + 0); +//nop; +if (t9 == 0) {//nop; +goto L448670;} +//nop; +t5 = MEM_U32(s3 + 0); +a0 = 0x8; +v0 = MEM_U32(t5 + 40); +a1 = zero; +at = (int)v0 < (int)0x4; +if (at == 0) {//nop; +goto L44863c;} +//nop; +//nop; +a2 = v0 << 3; +a2 = a2 + 0xffffffff; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L44861c; +a2 = a2 + 0xffffffff; +L44861c: +gp = MEM_U32(sp + 192); +a1 = MEM_U32(s3 + 4); +//nop; +a0 = 0x4; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L448634; +a2 = v0; +L448634: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 4) = v0; +L44863c: +t8 = MEM_U8(s3 + 25); +//nop; +t6 = 0x74; +t7 = t8 & 0xfffe; +MEM_U8(s3 + 32) = (uint8_t)t6; +MEM_U8(s3 + 25) = (uint8_t)t7; +a0 = 0x4; +a1 = s3; +a2 = s2; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L448664; +a2 = s2; +L448664: +gp = MEM_U32(sp + 192); +s3 = v0; +goto L448740; +s3 = v0; +L448670: +t5 = MEM_U8(s3 + 25); +t9 = 0x73; +t6 = t5 & 0xfffe; +MEM_U8(s3 + 32) = (uint8_t)t9; +MEM_U8(s3 + 25) = (uint8_t)t6; +t8 = MEM_U8(s2 + 32); +at = 0x49; +if (t8 != at) {//nop; +goto L4486a4;} +//nop; +t7 = MEM_U32(s2 + 48); +at = 0x1; +if (t7 == at) {//nop; +goto L4486e4;} +//nop; +L4486a4: +//nop; +a0 = 0x5e; +a1 = s2; +v0 = f_build_1op(mem, sp, a0, a1); +goto L4486b4; +a1 = s2; +L4486b4: +gp = MEM_U32(sp + 192); +a1 = MEM_U32(s3 + 0); +//nop; +a0 = 0x4; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L4486cc; +a2 = v0; +L4486cc: +MEM_U32(s3 + 0) = v0; +t9 = MEM_U32(v0 + 4); +gp = MEM_U32(sp + 192); +t5 = MEM_U32(t9 + 0); +MEM_U16(t5 + 34) = (uint16_t)zero; +goto L4486fc; +MEM_U16(t5 + 34) = (uint16_t)zero; +L4486e4: +//nop; +a0 = s2; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L4486f4; +//nop; +L4486f4: +gp = MEM_U32(sp + 192); +//nop; +L4486fc: +//nop; +a0 = 0x6; +a1 = zero; +a2 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L448710; +a2 = zero; +L448710: +gp = MEM_U32(sp + 192); +a0 = 0x4e; +//nop; +a1 = s3; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L448728; +a2 = v0; +L448728: +t6 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 192); +t8 = t6 & s4; +t7 = t8 | 0x6; +s3 = v0; +MEM_U8(v0 + 33) = (uint8_t)t7; +L448740: +t9 = MEM_U32(sp + 244); +//nop; +if (t9 == 0) {//nop; +goto L448758;} +//nop; +MEM_U32(t9 + 4) = v0; +s3 = t9; +L448758: +v1 = MEM_U8(s3 + 25); +a0 = MEM_U8(s3 + 32); +goto L445fe8; +a0 = MEM_U8(s3 + 32); +L448764: +s0 = 0x1001a4d0; +MEM_U32(s0 + 0) = s3; +goto L449338; +MEM_U32(s0 + 0) = s3; +L448770: +t5 = MEM_U16(s3 + 20); +t6 = 0x1; +if (t5 == t6) {//nop; +goto L448784;} +//nop; +abort(); +L448784: +t8 = MEM_U8(s3 + 33); +at = 0xe; +t7 = t8 & 0x1f; +if (t7 != at) {t2 = 0x7b; +goto L4487cc;} +t2 = 0x7b; +t9 = MEM_U32(s3 + 40); +//nop; +at = (int)t9 < (int)0x5; +if (at != 0) {t2 = 0x7b; +goto L4487cc;} +t2 = 0x7b; +//nop; +a0 = s3; +//nop; +f_gen_set_str(mem, sp, a0); +goto L4487bc; +//nop; +L4487bc: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +//nop; +t2 = 0x7b; +L4487cc: +if (t2 != a0) {//nop; +goto L448814;} +//nop; +t5 = MEM_U8(s3 + 33); +s2 = 0x2; +t6 = t5 << 24; +t8 = t6 >> 29; +if (s2 != t8) {//nop; +goto L4487fc;} +//nop; +t7 = MEM_U32(s3 + 36); +//nop; +if (t7 == 0) {//nop; +goto L448814;} +//nop; +L4487fc: +//nop; +a0 = s3; +//nop; +f_check_reg(mem, sp, a0); +goto L44880c; +//nop; +L44880c: +gp = MEM_U32(sp + 192); +//nop; +L448814: +v0 = MEM_U32(s3 + 40); +//nop; +at = (int)v0 < (int)0x5; +if (at == 0) {//nop; +goto L4488ac;} +//nop; +s0 = MEM_U32(s3 + 0); +at = 0x19; +t9 = MEM_U8(s0 + 32); +//nop; +if (t9 != at) {//nop; +goto L4488ac;} +//nop; +t5 = MEM_U32(s0 + 36); +t6 = v0 << 3; +if (t5 != t6) {//nop; +goto L4488ac;} +//nop; +t8 = MEM_U16(s0 + 34); +//nop; +t7 = t8 & 0x2; +if (t7 != 0) {//nop; +goto L4488ac;} +//nop; +t9 = MEM_U8(s3 + 33); +at = 0x3; +t5 = t9 << 24; +t6 = t5 >> 29; +if (t6 == at) {//nop; +goto L4488ac;} +//nop; +//nop; +a0 = MEM_U32(s0 + 0); +s1 = s0; +v0 = f_dup_tree(mem, sp, a0); +goto L44888c; +s1 = s0; +L44888c: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L4488a4; +//nop; +L4488a4: +gp = MEM_U32(sp + 192); +//nop; +L4488ac: +a0 = MEM_U32(s3 + 0); +//nop; +s1 = MEM_U8(a0 + 32); +//nop; +v0 = f_translate(mem, sp, a0); +goto L4488c0; +//nop; +L4488c0: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = v0; +t8 = 0x10018e98; +at = 0x3; +t8 = MEM_U32(t8 + 0); +t2 = 0x7b; +if (t8 != at) {//nop; +goto L448970;} +//nop; +t7 = MEM_U32(s3 + 40); +//nop; +at = (int)t7 < (int)0x4; +if (at == 0) {at = 0x19; +goto L448970;} +at = 0x19; +if (s1 == at) {//nop; +goto L448970;} +//nop; +t9 = MEM_U8(s3 + 33); +at = 0x3; +t5 = t9 << 24; +t6 = t5 >> 29; +if (t6 != at) {//nop; +goto L448970;} +//nop; +//nop; +a0 = 0x19; +a1 = v0; +v0 = f_build_1op(mem, sp, a0, a1); +goto L448924; +a1 = v0; +L448924: +t8 = MEM_U32(s3 + 40); +gp = MEM_U32(sp + 192); +v1 = MEM_U8(v0 + 33); +t7 = t8 << 3; +MEM_U32(v0 + 36) = t7; +t5 = MEM_U8(s3 + 33); +t6 = v1 << 27; +t8 = t6 >> 27; +t7 = t5 ^ t8; +t9 = t7 & 0x1f; +t6 = t9 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t6; +//nop; +a0 = v0; +//nop; +v0 = f_translate_cvtl(mem, sp, a0); +goto L448964; +//nop; +L448964: +gp = MEM_U32(sp + 192); +t2 = 0x7b; +MEM_U32(s3 + 0) = v0; +L448970: +a0 = MEM_U8(s3 + 32); +//nop; +if (t2 != a0) {//nop; +goto L449338;} +//nop; +//nop; +a0 = s3; +//nop; +f_add_store(mem, sp, a0); +goto L448990; +//nop; +L448990: +gp = MEM_U32(sp + 192); +//nop; +t1 = 0x1001a4d4; +//nop; +t1 = MEM_U8(t1 + 0); +//nop; +if ((int)t1 <= 0) {t1 = t1 + 0x1; +goto L448af4;} +t1 = t1 + 0x1; +v0 = t1 + 0xffffffff; +t5 = v0 & 0x3; +if (t5 == 0) {a3 = 0x1; +goto L448a18;} +a3 = 0x1; +t7 = 0x1001a4e0; +t8 = a3 << 2; +t7 = t7 + 0xfffffffc; +a0 = t8 + t7; +t0 = t5 + 0x1; +a2 = 0x36; +a1 = 0x3f; +L4489dc: +v0 = MEM_U32(a0 + 0); +a3 = a3 + 0x1; +if (v0 == 0) {//nop; +goto L448a08;} +//nop; +v1 = MEM_U8(v0 + 32); +//nop; +if (a2 == v1) {//nop; +goto L448a04;} +//nop; +if (a1 != v1) {//nop; +goto L448a08;} +//nop; +L448a04: +MEM_U32(a0 + 0) = zero; +L448a08: +if (t0 != a3) {a0 = a0 + 0x4; +goto L4489dc;} +a0 = a0 + 0x4; +if (a3 == t1) {//nop; +goto L448af4;} +//nop; +L448a18: +t6 = 0x1001a4e0; +t9 = a3 << 2; +t6 = t6 + 0xfffffffc; +t5 = t1 << 2; +t0 = t5 + t6; +a0 = t9 + t6; +a1 = 0x3f; +a2 = 0x36; +L448a38: +v0 = MEM_U32(a0 + 0); +//nop; +if (v0 == 0) {//nop; +goto L448a64;} +//nop; +v1 = MEM_U8(v0 + 32); +//nop; +if (a2 == v1) {//nop; +goto L448a60;} +//nop; +if (a1 != v1) {//nop; +goto L448a64;} +//nop; +L448a60: +MEM_U32(a0 + 0) = zero; +L448a64: +v0 = MEM_U32(a0 + 4); +//nop; +if (v0 == 0) {//nop; +goto L448a90;} +//nop; +v1 = MEM_U8(v0 + 32); +//nop; +if (a2 == v1) {//nop; +goto L448a8c;} +//nop; +if (a1 != v1) {//nop; +goto L448a90;} +//nop; +L448a8c: +MEM_U32(a0 + 4) = zero; +L448a90: +v0 = MEM_U32(a0 + 8); +//nop; +if (v0 == 0) {//nop; +goto L448abc;} +//nop; +v1 = MEM_U8(v0 + 32); +//nop; +if (a2 == v1) {//nop; +goto L448ab8;} +//nop; +if (a1 != v1) {//nop; +goto L448abc;} +//nop; +L448ab8: +MEM_U32(a0 + 8) = zero; +L448abc: +v0 = MEM_U32(a0 + 12); +//nop; +if (v0 == 0) {//nop; +goto L448ae8;} +//nop; +v1 = MEM_U8(v0 + 32); +//nop; +if (a2 == v1) {//nop; +goto L448ae4;} +//nop; +if (a1 != v1) {//nop; +goto L448ae8;} +//nop; +L448ae4: +MEM_U32(a0 + 12) = zero; +L448ae8: +a0 = a0 + 0x10; +if (a0 != t0) {//nop; +goto L448a38;} +//nop; +L448af4: +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L448b00: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L448b10; +//nop; +L448b10: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = v0; +t8 = 0x10019370; +s1 = v0; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L448bc0;} +//nop; +t7 = MEM_U8(v0 + 32); +at = 0x1; +if (t7 != at) {//nop; +goto L448bc0;} +//nop; +//nop; +a0 = MEM_U32(v0 + 4); +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L448b50; +//nop; +L448b50: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L448bc0;} +//nop; +//nop; +a0 = MEM_U32(s1 + 0); +//nop; +v0 = f_check_loads_exprs(mem, sp, a0); +goto L448b6c; +//nop; +L448b6c: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L448bc0;} +//nop; +t5 = MEM_U32(s1 + 4); +t9 = MEM_U32(s3 + 44); +t6 = MEM_U32(t5 + 48); +//nop; +t8 = t9 + t6; +//nop; +MEM_U32(s3 + 44) = t8; +a0 = MEM_U32(s1 + 0); +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L448ba0; +//nop; +L448ba0: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L448bb8; +//nop; +L448bb8: +gp = MEM_U32(sp + 192); +//nop; +L448bc0: +t7 = MEM_U32(s3 + 0); +a2 = 0x36; +t5 = MEM_U8(t7 + 22); +//nop; +if (t5 != 0) {//nop; +goto L448bdc;} +//nop; +t5 = 0x1; +L448bdc: +a0 = MEM_U8(s3 + 32); +at = 0x3d; +if (a0 != at) {MEM_U8(s3 + 22) = (uint8_t)t5; +goto L448c08;} +MEM_U8(s3 + 22) = (uint8_t)t5; +//nop; +a0 = s3; +//nop; +v0 = f_load_cse(mem, sp, a0); +goto L448bfc; +//nop; +L448bfc: +gp = MEM_U32(sp + 192); +ra = MEM_U32(sp + 196); +goto L4494ac; +ra = MEM_U32(sp + 196); +L448c08: +if (a2 != a0) {//nop; +goto L449338;} +//nop; +//nop; +a0 = s3; +//nop; +v0 = f_cse(mem, sp, a0); +goto L448c20; +//nop; +L448c20: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(v0 + 32); +s3 = v0; +goto L449338; +s3 = v0; +L448c30: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L448c40; +//nop; +L448c40: +MEM_U32(s3 + 0) = v0; +t9 = MEM_U8(v0 + 22); +gp = MEM_U32(sp + 192); +if (t9 != 0) {//nop; +goto L448c58;} +//nop; +t9 = 0x1; +L448c58: +MEM_U8(s3 + 22) = (uint8_t)t9; +//nop; +a0 = s3; +//nop; +v0 = f_cse(mem, sp, a0); +goto L448c6c; +//nop; +L448c6c: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(v0 + 32); +s3 = v0; +goto L449338; +s3 = v0; +L448c7c: +t6 = MEM_U16(s3 + 20); +t8 = 0x1; +if (t6 == t8) {//nop; +goto L448c90;} +//nop; +abort(); +L448c90: +t7 = MEM_U8(s3 + 33); +at = 0xe; +t5 = t7 & 0x1f; +if (t5 != at) {//nop; +goto L448cd0;} +//nop; +t9 = MEM_U32(s3 + 40); +//nop; +at = (int)t9 < (int)0x5; +if (at != 0) {//nop; +goto L448cd0;} +//nop; +//nop; +a0 = s3; +//nop; +f_gen_set_istr(mem, sp, a0); +goto L448cc8; +//nop; +L448cc8: +gp = MEM_U32(sp + 192); +//nop; +L448cd0: +v0 = MEM_U32(s3 + 40); +//nop; +at = (int)v0 < (int)0x5; +if (at == 0) {//nop; +goto L448d3c;} +//nop; +a2 = MEM_U32(s3 + 4); +at = 0x19; +t6 = MEM_U8(a2 + 32); +//nop; +if (t6 != at) {//nop; +goto L448d3c;} +//nop; +t8 = MEM_U32(a2 + 36); +t7 = v0 << 3; +if (t8 != t7) {//nop; +goto L448d3c;} +//nop; +//nop; +a0 = MEM_U32(a2 + 0); +s1 = a2; +v0 = f_dup_tree(mem, sp, a0); +goto L448d1c; +s1 = a2; +L448d1c: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 4) = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L448d34; +//nop; +L448d34: +gp = MEM_U32(sp + 192); +//nop; +L448d3c: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L448d4c; +//nop; +L448d4c: +gp = MEM_U32(sp + 192); +a0 = MEM_U32(s3 + 4); +//nop; +MEM_U32(s3 + 0) = v0; +//nop; +v0 = f_translate(mem, sp, a0); +goto L448d64; +//nop; +L448d64: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 4) = v0; +t5 = 0x10019370; +s1 = MEM_U32(s3 + 0); +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 != 0) {//nop; +goto L448e10;} +//nop; +t9 = MEM_U8(s1 + 32); +at = 0x1; +if (t9 != at) {//nop; +goto L448e10;} +//nop; +t6 = MEM_U32(s1 + 4); +at = 0x49; +t8 = MEM_U8(t6 + 32); +//nop; +if (t8 != at) {//nop; +goto L448e10;} +//nop; +//nop; +a0 = MEM_U32(s1 + 0); +//nop; +v0 = f_check_loads_exprs(mem, sp, a0); +goto L448dbc; +//nop; +L448dbc: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L448e10;} +//nop; +t5 = MEM_U32(s1 + 4); +t7 = MEM_U32(s3 + 44); +t9 = MEM_U32(t5 + 48); +//nop; +t6 = t7 + t9; +//nop; +MEM_U32(s3 + 44) = t6; +a0 = MEM_U32(s1 + 0); +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L448df0; +//nop; +L448df0: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L448e08; +//nop; +L448e08: +gp = MEM_U32(sp + 192); +//nop; +L448e10: +a0 = MEM_U8(s3 + 32); +at = 0x3e; +if (a0 != at) {//nop; +goto L448e40;} +//nop; +//nop; +a0 = s3; +//nop; +f_add_store(mem, sp, a0); +goto L448e30; +//nop; +L448e30: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L448e40: +t8 = 0x1001935c; +//nop; +t8 = MEM_U8(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L448efc;} +//nop; +s0 = MEM_U32(s3 + 0); +at = 0x60000000; +t5 = MEM_U8(s0 + 33); +//nop; +t7 = t5 << 24; +t9 = t7 >> 29; +t6 = t9 < 0x20; +t8 = -t6; +t5 = t8 & at; +t7 = t5 << (t9 & 0x1f); +if ((int)t7 >= 0) {//nop; +goto L448efc;} +//nop; +t6 = MEM_U8(s0 + 32); +//nop; +t8 = t6 + 0xffffffe0; +t5 = t8 < 0x60; +if (t5 == 0) {t9 = (int)t8 >> 5; +goto L448ec0;} +t9 = (int)t8 >> 5; +t6 = 0x10005ac4; +t7 = t9 << 2; +t6 = t6; +t9 = t6 + t7; +t6 = MEM_U32(t9 + 0); +//nop; +t7 = t6 << (t8 & 0x1f); +t5 = (int)t7 < (int)0x0; +L448ec0: +if (t5 == 0) {//nop; +goto L448ef0;} +//nop; +//nop; +a0 = s0; +a1 = 0x1; +v0 = f_check_vreg(mem, sp, a0, a1); +goto L448ed8; +a1 = 0x1; +L448ed8: +gp = MEM_U32(sp + 192); +if (v0 != 0) {//nop; +goto L448ef0;} +//nop; +at = 0x1001a508; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +L448ef0: +a0 = MEM_U8(s3 + 32); +//nop; +goto L448f08; +//nop; +L448efc: +at = 0x1001a508; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +L448f08: +at = 0x1001a4d4; +t6 = 0x1; +MEM_U8(at + 0) = (uint8_t)t6; +at = 0x1001a4e0; +//nop; +MEM_U32(at + 0) = s3; +at = 0x1001a538; +MEM_U32(at + 0) = zero; +goto L449338; +MEM_U32(at + 0) = zero; +L448f2c: +t8 = MEM_U16(s3 + 20); +t7 = 0x1; +if (t8 == t7) {//nop; +goto L448f40;} +//nop; +abort(); +L448f40: +t9 = MEM_U8(s3 + 33); +t6 = 0xe; +t5 = t9 & 0x1f; +if (t5 != t6) {//nop; +goto L448f58;} +//nop; +abort(); +L448f58: +v0 = MEM_U32(s3 + 40); +//nop; +at = (int)v0 < (int)0x5; +if (at == 0) {//nop; +goto L448fc4;} +//nop; +a2 = MEM_U32(s3 + 4); +at = 0x19; +t8 = MEM_U8(a2 + 32); +//nop; +if (t8 != at) {//nop; +goto L448fc4;} +//nop; +t7 = MEM_U32(a2 + 36); +t9 = v0 << 3; +if (t7 != t9) {//nop; +goto L448fc4;} +//nop; +//nop; +a0 = MEM_U32(a2 + 0); +s1 = a2; +v0 = f_dup_tree(mem, sp, a0); +goto L448fa4; +s1 = a2; +L448fa4: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 4) = v0; +//nop; +a0 = s1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L448fbc; +//nop; +L448fbc: +gp = MEM_U32(sp + 192); +//nop; +L448fc4: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L448fd4; +//nop; +L448fd4: +gp = MEM_U32(sp + 192); +a0 = MEM_U32(s3 + 4); +//nop; +MEM_U32(s3 + 0) = v0; +//nop; +v0 = f_translate(mem, sp, a0); +goto L448fec; +//nop; +L448fec: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 4) = v0; +t5 = 0x1001935c; +//nop; +t5 = MEM_U8(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L4490a4;} +//nop; +s0 = MEM_U32(s3 + 0); +at = 0x60000000; +t6 = MEM_U8(s0 + 33); +//nop; +t8 = t6 << 24; +t7 = t8 >> 29; +t9 = t7 < 0x20; +t5 = -t9; +t6 = t5 & at; +t8 = t6 << (t7 & 0x1f); +if ((int)t8 >= 0) {//nop; +goto L4490a4;} +//nop; +t9 = MEM_U8(s0 + 32); +//nop; +t5 = t9 + 0xffffffe0; +t6 = t5 < 0x60; +if (t6 == 0) {t7 = (int)t5 >> 5; +goto L449074;} +t7 = (int)t5 >> 5; +t9 = 0x10005ac4; +t8 = t7 << 2; +t9 = t9; +t7 = t9 + t8; +t9 = MEM_U32(t7 + 0); +//nop; +t8 = t9 << (t5 & 0x1f); +t6 = (int)t8 < (int)0x0; +L449074: +if (t6 == 0) {//nop; +goto L4490b0;} +//nop; +//nop; +a0 = s0; +a1 = 0x1; +v0 = f_check_vreg(mem, sp, a0, a1); +goto L44908c; +a1 = 0x1; +L44908c: +gp = MEM_U32(sp + 192); +if (v0 != 0) {//nop; +goto L4490b0;} +//nop; +at = 0x1001a508; +MEM_U8(at + 0) = (uint8_t)zero; +goto L4490b0; +MEM_U8(at + 0) = (uint8_t)zero; +L4490a4: +at = 0x1001a508; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +L4490b0: +at = 0x1001a4d4; +t9 = 0x1; +MEM_U8(at + 0) = (uint8_t)t9; +at = 0x1001a4e0; +//nop; +MEM_U32(at + 0) = s3; +at = 0x1001a538; +//nop; +MEM_U32(at + 0) = zero; +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L4490e0: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L4490f0; +//nop; +L4490f0: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +MEM_U32(s3 + 0) = v0; +goto L449338; +MEM_U32(s3 + 0) = v0; +L449100: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L449110; +//nop; +L449110: +gp = MEM_U32(sp + 192); +a0 = MEM_U8(s3 + 32); +MEM_U32(s3 + 0) = v0; +goto L449338; +MEM_U32(s3 + 0) = v0; +L449120: +t5 = 0x1001a53c; +s4 = 0x52; +t5 = MEM_U8(t5 + 0); +t9 = 0x74; +if (t5 == 0) {//nop; +goto L449338;} +//nop; +t8 = MEM_U8(s3 + 33); +MEM_U8(s3 + 32) = (uint8_t)s4; +t7 = t8 & 0xff1f; +t6 = t7 | 0x60; +MEM_U8(s3 + 33) = (uint8_t)t6; +MEM_U32(s3 + 44) = t9; +MEM_U8(s3 + 22) = (uint8_t)zero; +a0 = s4 & 0xff; +goto L449338; +a0 = s4 & 0xff; +L44915c: +t5 = MEM_U8(s3 + 33); +s4 = 0x52; +t8 = t5 & 0xff1f; +t7 = t8 | 0x60; +t6 = 0x74; +MEM_U8(s3 + 32) = (uint8_t)s4; +MEM_U8(s3 + 33) = (uint8_t)t7; +MEM_U32(s3 + 44) = t6; +a0 = s4 & 0xff; +MEM_U8(s3 + 22) = (uint8_t)zero; +goto L449338; +MEM_U8(s3 + 22) = (uint8_t)zero; +L449188: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L449198; +//nop; +L449198: +gp = MEM_U32(sp + 192); +MEM_U32(s3 + 0) = v0; +t9 = 0x1001a53c; +t2 = 0x7b; +t9 = MEM_U8(t9 + 0); +t6 = 0x74; +if (t9 == 0) {//nop; +goto L4491d0;} +//nop; +t5 = MEM_U8(s3 + 33); +MEM_U8(s3 + 32) = (uint8_t)t2; +t8 = t5 & 0xff1f; +t7 = t8 | 0x60; +MEM_U8(s3 + 33) = (uint8_t)t7; +MEM_U32(s3 + 44) = t6; +L4491d0: +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L4491dc: +s0 = 0x1001a4d0; +//nop; +a0 = MEM_U32(s0 + 0); +a1 = 0xffffffff; +f_map_pars_to_regs(mem, sp, a0, a1); +goto L4491f0; +a1 = 0xffffffff; +L4491f0: +gp = MEM_U32(sp + 192); +//nop; +at = 0x1001a4d4; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a508; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001a538; +//nop; +MEM_U32(at + 0) = zero; +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L449228: +//nop; +a0 = MEM_U32(s3 + 0); +//nop; +v0 = f_translate(mem, sp, a0); +goto L449238; +//nop; +L449238: +gp = MEM_U32(sp + 192); +a0 = MEM_U32(s3 + 4); +//nop; +MEM_U32(s3 + 0) = v0; +//nop; +v0 = f_translate(mem, sp, a0); +goto L449250; +//nop; +L449250: +t9 = MEM_U32(s3 + 0); +MEM_U32(s3 + 4) = v0; +t5 = MEM_U8(v0 + 22); +v1 = MEM_U8(t9 + 22); +gp = MEM_U32(sp + 192); +if (t5 != v1) {t8 = v1 + 0x1; +goto L449274;} +t8 = v1 + 0x1; +MEM_U8(s3 + 22) = (uint8_t)t8; +goto L449298; +MEM_U8(s3 + 22) = (uint8_t)t8; +L449274: +t7 = MEM_U32(s3 + 4); +//nop; +t6 = MEM_U8(t7 + 22); +//nop; +at = t6 < v1; +if (at == 0) {//nop; +goto L449294;} +//nop; +t6 = v1; +L449294: +MEM_U8(s3 + 22) = (uint8_t)t6; +L449298: +a0 = MEM_U8(s3 + 32); +//nop; +goto L449338; +//nop; +L4492a4: +at = v0 < 0x11; +if (at == 0) {at = v0 < 0x11; +goto L4492d8;} +at = v0 < 0x11; +if (at == 0) {//nop; +goto L449338;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c414[] = { +&&L446430, +&&L447d6c, +&&L4479ec, +&&L44760c, +&&L4465d8, +&&L449100, +&&L449338, +&&L449338, +&&L449338, +&&L449338, +&&L4465d8, +&&L446124, +&&L44639c, +&&L44639c, +&&L4462a4, +&&L446204, +&&L4491dc, +}; +dest = Lswitch1000c414[v0]; +//nop; +goto *dest; +//nop; +L4492d8: +t5 = v0 + 0xffffffe9; +at = t5 < 0x69; +if (at == 0) {//nop; +goto L449338;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c458[] = { +&&L446fe4, +&&L446430, +&&L447a48, +&&L449338, +&&L44774c, +&&L448070, +&&L4465d8, +&&L449338, +&&L449338, +&&L449338, +&&L446e1c, +&&L449338, +&&L4465d8, +&&L449338, +&&L449338, +&&L446148, +&&L449338, +&&L4465d8, +&&L4465d8, +&&L449338, +&&L449338, +&&L447630, +&&L449338, +&&L44798c, +&&L44798c, +&&L44798c, +&&L4460d0, +&&L447c30, +&&L449338, +&&L44798c, +&&L44798c, +&&L448b00, +&&L449338, +&&L44798c, +&&L449338, +&&L4483b4, +&&L44803c, +&&L4465d8, +&&L448b00, +&&L448c7c, +&&L448c7c, +&&L449338, +&&L449338, +&&L44760c, +&&L449338, +&&L449338, +&&L449338, +&&L449338, +&&L447cbc, +&&L44915c, +&&L447cdc, +&&L449338, +&&L449120, +&&L449338, +&&L4465d8, +&&L4465d8, +&&L449338, +&&L446430, +&&L446044, +&&L4476d4, +&&L449338, +&&L449338, +&&L4465d8, +&&L4465d8, +&&L4465d8, +&&L44798c, +&&L449338, +&&L446430, +&&L4465d8, +&&L448764, +&&L4481a8, +&&L446430, +&&L4465d8, +&&L449338, +&&L446430, +&&L447f80, +&&L446f80, +&&L448770, +&&L449338, +&&L446430, +&&L449338, +&&L449338, +&&L4465d8, +&&L449338, +&&L449338, +&&L449338, +&&L449338, +&&L446430, +&&L449338, +&&L449338, +&&L449338, +&&L4480d0, +&&L4465d8, +&&L4465d8, +&&L449228, +&&L446430, +&&L446430, +&&L449338, +&&L449338, +&&L449338, +&&L448770, +&&L449188, +&&L4465d8, +&&L449338, +&&L446148, +}; +dest = Lswitch1000c458[t5]; +//nop; +goto *dest; +//nop; +L449308: +t8 = v0 + 0xffffff7a; +at = t8 < 0x8; +if (at == 0) {//nop; +goto L449338;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c5fc[] = { +&&L446430, +&&L449338, +&&L449338, +&&L449338, +&&L448008, +&&L447728, +&&L4490e0, +&&L4465d8, +}; +dest = Lswitch1000c5fc[t8]; +//nop; +goto *dest; +//nop; +L449338: +t7 = 0x10005900; +//nop; +t6 = a0 + t7; +t9 = MEM_U8(t6 + 0); +//nop; +if (t9 == 0) {v0 = s3; +goto L4494a8;} +v0 = s3; +s0 = MEM_U32(s3 + 0); +//nop; +if (s0 == 0) {//nop; +goto L449438;} +//nop; +//nop; +a0 = s0; +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L449374; +//nop; +L449374: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L449438;} +//nop; +a2 = MEM_U32(s3 + 4); +//nop; +if (a2 == 0) {//nop; +goto L4493ac;} +//nop; +//nop; +a0 = a2; +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L4493a0; +//nop; +L4493a0: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L4493c8;} +//nop; +L4493ac: +//nop; +a0 = s3; +//nop; +v0 = f_fold(mem, sp, a0); +goto L4493bc; +//nop; +L4493bc: +gp = MEM_U32(sp + 192); +ra = MEM_U32(sp + 196); +goto L4494ac; +ra = MEM_U32(sp + 196); +L4493c8: +s0 = 0x10005a1c; +t5 = MEM_U8(s3 + 32); +at = 0x60; +t8 = s0 + t5; +t7 = MEM_U8(t8 + 0); +MEM_U32(sp + 264) = s3; +if (t7 == at) {//nop; +goto L449410;} +//nop; +//nop; +a0 = s3; +a1 = s3 + 0x4; +f_swap_tree(mem, sp, a0, a1); +goto L4493f8; +a1 = s3 + 0x4; +L4493f8: +t6 = MEM_U8(s3 + 32); +gp = MEM_U32(sp + 192); +t9 = s0 + t6; +t5 = MEM_U8(t9 + 0); +MEM_U32(sp + 264) = s3; +MEM_U8(s3 + 32) = (uint8_t)t5; +L449410: +//nop; +a0 = sp + 0x108; +//nop; +v0 = f_fold1(mem, sp, a0); +goto L449420; +//nop; +L449420: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L44948c;} +//nop; +v0 = MEM_U32(sp + 264); +ra = MEM_U32(sp + 196); +goto L4494ac; +ra = MEM_U32(sp + 196); +L449438: +a2 = MEM_U32(s3 + 4); +MEM_U32(sp + 264) = s3; +if (a2 == 0) {//nop; +goto L44948c;} +//nop; +//nop; +a0 = a2; +//nop; +v0 = f_is_constant(mem, sp, a0); +goto L449458; +//nop; +L449458: +gp = MEM_U32(sp + 192); +if (v0 == 0) {MEM_U32(sp + 264) = s3; +goto L44948c;} +MEM_U32(sp + 264) = s3; +//nop; +a0 = sp + 0x108; +//nop; +v0 = f_fold1(mem, sp, a0); +goto L449474; +//nop; +L449474: +gp = MEM_U32(sp + 192); +if (v0 == 0) {//nop; +goto L44948c;} +//nop; +v0 = MEM_U32(sp + 264); +ra = MEM_U32(sp + 196); +goto L4494ac; +ra = MEM_U32(sp + 196); +L44948c: +//nop; +a0 = MEM_U32(sp + 264); +//nop; +v0 = f_cse(mem, sp, a0); +goto L44949c; +//nop; +L44949c: +gp = MEM_U32(sp + 192); +s3 = v0; +v0 = s3; +L4494a8: +ra = MEM_U32(sp + 196); +L4494ac: +s0 = MEM_U32(sp + 172); +s1 = MEM_U32(sp + 176); +s2 = MEM_U32(sp + 180); +s3 = MEM_U32(sp + 184); +s4 = MEM_U32(sp + 188); +sp = sp + 0x108; +return v0; +sp = sp + 0x108; +} + +static uint32_t f_cse_equ(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4494c8: +//cse_equ: +//nop; +//nop; +//nop; +sp = sp + 0xffffff48; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +a2 = a0; +if (a0 != a1) {a3 = a1; +goto L4494f4;} +a3 = a1; +v0 = 0x1; +goto L449e20; +v0 = 0x1; +L4494f4: +v0 = MEM_U8(a3 + 32); +v1 = MEM_U8(a2 + 32); +at = 0x36; +if (v0 == v1) {//nop; +goto L449520;} +//nop; +if (v1 != at) {at = 0x3f; +goto L449518;} +at = 0x3f; +if (v0 == at) {//nop; +goto L449520;} +//nop; +L449518: +v0 = zero; +goto L449e20; +v0 = zero; +L449520: +v0 = v1 & 0xff; +goto L449af4; +v0 = v1 & 0xff; +L449528: +t6 = MEM_U8(a3 + 33); +t9 = MEM_U8(a2 + 33); +t7 = t6 << 24; +t0 = t9 << 24; +t1 = t0 >> 29; +t8 = t7 >> 29; +v1 = t8 ^ t1; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L44959c;} +//nop; +t2 = MEM_U32(a3 + 36); +t3 = MEM_U32(a2 + 36); +//nop; +v1 = t2 ^ t3; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L44959c;} +//nop; +t4 = MEM_U32(a3 + 44); +t5 = MEM_U32(a2 + 44); +//nop; +v1 = t4 ^ t5; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L44959c;} +//nop; +t6 = MEM_U32(a3 + 40); +t7 = MEM_U32(a2 + 40); +//nop; +v1 = t6 ^ t7; +v1 = v1 < 0x1; +L44959c: +v0 = v1; +goto L449e20; +v0 = v1; +L4495a4: +t9 = MEM_U8(a3 + 33); +t8 = MEM_U8(a2 + 33); +t0 = t9 & 0x1f; +t1 = t8 & 0x1f; +v1 = t0 ^ t1; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4495d8;} +//nop; +t2 = MEM_U32(a3 + 0); +t3 = MEM_U32(a2 + 0); +//nop; +v1 = t2 ^ t3; +v1 = v1 < 0x1; +L4495d8: +v0 = v1; +goto L449e20; +v0 = v1; +L4495e0: +t4 = MEM_U8(a3 + 33); +t6 = MEM_U8(a2 + 33); +t5 = t4 & 0x1f; +t7 = t6 & 0x1f; +v1 = t5 ^ t7; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449630;} +//nop; +t9 = MEM_U16(a3 + 34); +t8 = MEM_U16(a2 + 34); +//nop; +v1 = t9 ^ t8; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449630;} +//nop; +t0 = MEM_U32(a3 + 0); +t1 = MEM_U32(a2 + 0); +//nop; +v1 = t0 ^ t1; +v1 = v1 < 0x1; +L449630: +v0 = v1; +goto L449e20; +v0 = v1; +L449638: +t2 = MEM_U8(a3 + 33); +t4 = MEM_U8(a2 + 33); +t3 = t2 & 0x1f; +t6 = t4 & 0x1f; +v1 = t3 ^ t6; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449688;} +//nop; +t5 = MEM_U32(a3 + 36); +t7 = MEM_U32(a2 + 36); +//nop; +v1 = t5 ^ t7; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449688;} +//nop; +t9 = MEM_U32(a3 + 0); +t8 = MEM_U32(a2 + 0); +//nop; +v1 = t9 ^ t8; +v1 = v1 < 0x1; +L449688: +v0 = v1; +goto L449e20; +v0 = v1; +L449690: +t0 = MEM_U8(a3 + 33); +t2 = MEM_U8(a2 + 33); +t1 = t0 & 0x1f; +t4 = t2 & 0x1f; +v1 = t1 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4496fc;} +//nop; +t3 = MEM_U32(a3 + 36); +t6 = MEM_U32(a2 + 36); +//nop; +v1 = t3 ^ t6; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4496fc;} +//nop; +t5 = MEM_U16(a3 + 34); +t7 = MEM_U16(a2 + 34); +//nop; +v1 = t5 ^ t7; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4496fc;} +//nop; +t9 = MEM_U32(a3 + 0); +t8 = MEM_U32(a2 + 0); +//nop; +v1 = t9 ^ t8; +v1 = v1 < 0x1; +L4496fc: +v0 = v1; +goto L449e20; +v0 = v1; +L449704: +t0 = MEM_U8(a3 + 33); +t1 = MEM_U8(a2 + 33); +t2 = t0 & 0x1f; +t4 = t1 & 0x1f; +v1 = t2 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449770;} +//nop; +t3 = MEM_U8(a3 + 40); +t6 = MEM_U8(a2 + 40); +//nop; +v1 = t3 ^ t6; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449770;} +//nop; +t5 = MEM_U16(a3 + 34); +t7 = MEM_U16(a2 + 34); +//nop; +v1 = t5 ^ t7; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449770;} +//nop; +t9 = MEM_U32(a3 + 0); +t8 = MEM_U32(a2 + 0); +//nop; +v1 = t9 ^ t8; +v1 = v1 < 0x1; +L449770: +v0 = v1; +goto L449e20; +v0 = v1; +L449778: +t0 = MEM_U32(a3 + 44); +t1 = MEM_U32(a2 + 44); +//nop; +v1 = t0 ^ t1; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4497c4;} +//nop; +t2 = MEM_U32(a3 + 40); +t4 = MEM_U32(a2 + 40); +//nop; +v1 = t2 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4497c4;} +//nop; +t3 = MEM_U32(a3 + 0); +t6 = MEM_U32(a2 + 0); +//nop; +v1 = t3 ^ t6; +v1 = v1 < 0x1; +L4497c4: +v0 = v1; +goto L449e20; +v0 = v1; +L4497cc: +t5 = MEM_U8(a3 + 33); +t8 = MEM_U8(a2 + 33); +t7 = t5 << 24; +t0 = t8 << 24; +t1 = t0 >> 29; +t9 = t7 >> 29; +v1 = t9 ^ t1; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L44985c;} +//nop; +t2 = MEM_U32(a3 + 36); +t4 = MEM_U32(a2 + 36); +//nop; +v1 = t2 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L44985c;} +//nop; +t3 = MEM_U32(a3 + 44); +t6 = MEM_U32(a2 + 44); +//nop; +v1 = t3 ^ t6; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L44985c;} +//nop; +t5 = MEM_U32(a3 + 40); +t7 = MEM_U32(a2 + 40); +//nop; +v1 = t5 ^ t7; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L44985c;} +//nop; +t8 = MEM_U32(a3 + 0); +t0 = MEM_U32(a2 + 0); +//nop; +v1 = t8 ^ t0; +v1 = v1 < 0x1; +L44985c: +v0 = v1; +goto L449e20; +v0 = v1; +L449864: +t9 = MEM_U8(a3 + 33); +t2 = MEM_U8(a2 + 33); +t1 = t9 & 0x1f; +t4 = t2 & 0x1f; +v1 = t1 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4498d4;} +//nop; +t3 = MEM_U32(a3 + 0); +t6 = MEM_U32(a2 + 0); +//nop; +v1 = t3 ^ t6; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4498d4;} +//nop; +a1 = MEM_U32(a3 + 4); +a0 = MEM_U32(a2 + 4); +//nop; +v1 = a1 ^ a0; +v1 = v1 < 0x1; +if (v1 != 0) {//nop; +goto L4498d4;} +//nop; +//nop; +//nop; +//nop; +v0 = f_const_equal(mem, sp, a0, a1); +goto L4498cc; +//nop; +L4498cc: +gp = MEM_U32(sp + 176); +v1 = v0; +L4498d4: +v0 = v1; +goto L449e20; +v0 = v1; +L4498dc: +t5 = MEM_U8(a3 + 33); +t8 = MEM_U8(a2 + 33); +t7 = t5 & 0x1f; +t0 = t8 & 0x1f; +v1 = t7 ^ t0; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449968;} +//nop; +t9 = MEM_U32(a3 + 0); +t2 = MEM_U32(a2 + 0); +//nop; +v1 = t9 ^ t2; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449968;} +//nop; +t1 = MEM_U16(a3 + 34); +t4 = MEM_U16(a2 + 34); +//nop; +v1 = t1 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449968;} +//nop; +a1 = MEM_U32(a3 + 4); +a0 = MEM_U32(a2 + 4); +//nop; +v1 = a1 ^ a0; +v1 = v1 < 0x1; +if (v1 != 0) {//nop; +goto L449968;} +//nop; +//nop; +//nop; +//nop; +v0 = f_const_equal(mem, sp, a0, a1); +goto L449960; +//nop; +L449960: +gp = MEM_U32(sp + 176); +v1 = v0; +L449968: +v0 = v1; +goto L449e20; +v0 = v1; +L449970: +t3 = MEM_U8(a3 + 33); +t5 = MEM_U8(a2 + 33); +t6 = t3 & 0x1f; +t8 = t5 & 0x1f; +v1 = t6 ^ t8; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4499fc;} +//nop; +t7 = MEM_U32(a3 + 40); +t0 = MEM_U32(a2 + 40); +//nop; +v1 = t7 ^ t0; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4499fc;} +//nop; +t9 = MEM_U32(a3 + 0); +t2 = MEM_U32(a2 + 0); +//nop; +v1 = t9 ^ t2; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L4499fc;} +//nop; +a1 = MEM_U32(a3 + 4); +a0 = MEM_U32(a2 + 4); +//nop; +v1 = a1 ^ a0; +v1 = v1 < 0x1; +if (v1 != 0) {//nop; +goto L4499fc;} +//nop; +//nop; +//nop; +//nop; +v0 = f_const_equal(mem, sp, a0, a1); +goto L4499f4; +//nop; +L4499f4: +gp = MEM_U32(sp + 176); +v1 = v0; +L4499fc: +v0 = v1; +goto L449e20; +v0 = v1; +L449a04: +t1 = MEM_U8(a3 + 33); +t3 = MEM_U8(a2 + 33); +t4 = t1 & 0x1f; +t5 = t3 & 0x1f; +v1 = t4 ^ t5; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449a70;} +//nop; +t6 = MEM_U32(a3 + 44); +t8 = MEM_U32(a2 + 44); +//nop; +v1 = t6 ^ t8; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449a70;} +//nop; +t7 = MEM_U32(a3 + 40); +t0 = MEM_U32(a2 + 40); +//nop; +v1 = t7 ^ t0; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449a70;} +//nop; +t9 = MEM_U32(a3 + 0); +t2 = MEM_U32(a2 + 0); +//nop; +v1 = t9 ^ t2; +v1 = v1 < 0x1; +L449a70: +v0 = v1; +goto L449e20; +v0 = v1; +L449a78: +t1 = MEM_U8(a3 + 33); +t4 = MEM_U8(a2 + 33); +t3 = t1 & 0x1f; +t5 = t4 & 0x1f; +v1 = t3 ^ t5; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449ae4;} +//nop; +t6 = MEM_U32(a3 + 36); +t8 = MEM_U32(a2 + 36); +//nop; +v1 = t6 ^ t8; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449ae4;} +//nop; +t7 = MEM_U32(a3 + 40); +t0 = MEM_U32(a2 + 40); +//nop; +v1 = t7 ^ t0; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L449ae4;} +//nop; +t9 = MEM_U32(a3 + 0); +t2 = MEM_U32(a2 + 0); +//nop; +v1 = t9 ^ t2; +v1 = v1 < 0x1; +L449ae4: +v0 = v1; +goto L449e20; +v0 = v1; +L449aec: +v0 = zero; +goto L449e20; +v0 = zero; +L449af4: +at = v0 < 0x48; +if (at != 0) {at = v0 < 0x78; +goto L449bd0;} +at = v0 < 0x78; +if (at != 0) {at = v0 < 0x8e; +goto L449b58;} +at = v0 < 0x8e; +if (at != 0) {at = 0x93; +goto L449b20;} +at = 0x93; +if (v0 == at) {//nop; +goto L449a78;} +//nop; +//nop; +goto L449c34; +//nop; +L449b20: +at = 0x7d; +if (v0 == at) {t1 = v0 + 0xffffff7a; +goto L4498dc;} +t1 = v0 + 0xffffff7a; +at = t1 < 0x8; +if (at == 0) {//nop; +goto L449c34;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c7a8[] = { +&&L449704, +&&L449c34, +&&L449c34, +&&L449c34, +&&L449970, +&&L449c34, +&&L449c34, +&&L449864, +}; +dest = Lswitch1000c7a8[t1]; +//nop; +goto *dest; +//nop; +L449b58: +at = v0 < 0x6a; +if (at != 0) {at = 0x6e; +goto L449b98;} +at = 0x6e; +if (v0 == at) {t4 = v0 + 0xffffff8d; +goto L449704;} +t4 = v0 + 0xffffff8d; +at = t4 < 0x5; +if (at == 0) {//nop; +goto L449c34;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c794[] = { +&&L449864, +&&L449864, +&&L449c34, +&&L4495a4, +&&L4495a4, +}; +dest = Lswitch1000c794[t4]; +//nop; +goto *dest; +//nop; +L449b98: +at = v0 < 0x62; +if (at == 0) {t3 = v0 + 0xffffffb3; +goto L449e0c;} +t3 = v0 + 0xffffffb3; +at = t3 < 0x15; +if (at == 0) {//nop; +goto L449c34;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c740[] = { +&&L449864, +&&L449864, +&&L449c34, +&&L4495a4, +&&L449c34, +&&L449c34, +&&L449c34, +&&L449c34, +&&L449864, +&&L449864, +&&L4498dc, +&&L449c34, +&&L449c34, +&&L449c34, +&&L4498dc, +&&L449c34, +&&L449864, +&&L4495e0, +&&L449864, +&&L449c34, +&&L4495a4, +}; +dest = Lswitch1000c740[t3]; +//nop; +goto *dest; +//nop; +L449bd0: +at = v0 < 0x1e; +if (at != 0) {at = v0 < 0x2a; +goto L449d44;} +at = v0 < 0x2a; +if (at != 0) {at = v0 < 0x3e; +goto L449c1c;} +at = v0 < 0x3e; +if (at == 0) {t7 = v0 + 0xffffffba; +goto L449de0;} +t7 = v0 + 0xffffffba; +t5 = v0 + 0xffffffce; +at = t5 < 0xc; +if (at == 0) {//nop; +goto L449c34;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c708[] = { +&&L4497cc, +&&L449c34, +&&L449c34, +&&L449c34, +&&L449a04, +&&L449c34, +&&L449c34, +&&L449c34, +&&L449864, +&&L449970, +&&L449864, +&&L449a04, +}; +dest = Lswitch1000c708[t5]; +//nop; +goto *dest; +//nop; +L449c1c: +at = 0x23; +if (v0 == at) {//nop; +goto L449864;} +//nop; +at = v0 < 0x28; +if (at == 0) {//nop; +goto L449864;} +//nop; +L449c34: +t6 = 0x1000c680; +a0 = 0x4; +t6 = t6; +t7 = t6 + 0x48; +a1 = 0x83c; +t0 = sp; +L449c4c: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t0 = t0 + 0xc; +MEM_U8(t0 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t0) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t0 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t7) {//swr $at, 7($t0) +goto L449c4c;} +//swr $at, 7($t0) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = 0x1000c630; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +t7 = t6 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t6) +t9 = t9; +MEM_U8(t0 + 12 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t0 + 12 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t0 + 12 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t0 + 12 + 3) = (uint8_t)(t7 >> 0); +t1 = t9 + 0x48; +t4 = sp; +//swr $t7, 0xf($t0) +L449cbc: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t4 = t4 + 0xc; +MEM_U8(t4 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t4) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t4 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 84 + 3) = (uint8_t)(at >> 0); +if (t9 != t1) {//swr $at, 0x57($t4) +goto L449cbc;} +//swr $at, 0x57($t4) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +t1 = t9 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t9) +//nop; +MEM_U8(t4 + 92 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t4 + 92 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t4 + 92 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t4 + 92 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0x5f($t4) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L449d38; +//nop; +L449d38: +gp = MEM_U32(sp + 176); +v0 = zero; +goto L449e20; +v0 = zero; +L449d44: +at = v0 < 0x5; +if (at != 0) {at = v0 < 0xf; +goto L449d88;} +at = v0 < 0xf; +if (at == 0) {t8 = v0 + 0xffffffe8; +goto L449db4;} +t8 = v0 + 0xffffffe8; +t3 = v0 + 0xfffffff4; +at = t3 < 0x3; +if (at == 0) {//nop; +goto L449c34;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c6e4[] = { +&&L449638, +&&L449638, +&&L4495a4, +}; +dest = Lswitch1000c6e4[t3]; +//nop; +goto *dest; +//nop; +L449d88: +at = v0 < 0x5; +if (at == 0) {//nop; +goto L449c34;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c6d0[] = { +&&L4495e0, +&&L4498dc, +&&L449778, +&&L449c34, +&&L449864, +}; +dest = Lswitch1000c6d0[v0]; +//nop; +goto *dest; +//nop; +L449db4: +at = t8 < 0x6; +if (at == 0) {//nop; +goto L449c34;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c6f0[] = { +&&L449704, +&&L449690, +&&L449c34, +&&L449c34, +&&L449864, +&&L4498dc, +}; +dest = Lswitch1000c6f0[t8]; +//nop; +goto *dest; +//nop; +L449de0: +at = t7 < 0x2; +if (at == 0) {//nop; +goto L449c34;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000c738[] = { +&&L449aec, +&&L449528, +}; +dest = Lswitch1000c738[t7]; +//nop; +goto *dest; +//nop; +L449e0c: +at = 0x69; +if (v0 == at) {//nop; +goto L4498dc;} +//nop; +//nop; +goto L449c34; +//nop; +L449e20: +ra = MEM_U32(sp + 180); +sp = sp + 0xb8; +//nop; +return v0; +//nop; +} + +static uint32_t f_cse(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L449e30: +//cse: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +t6 = 0x10005ab8; +MEM_U32(sp + 36) = s3; +t6 = MEM_U32(t6 + 0); +s3 = a0; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +if ((int)t6 <= 0) {MEM_U32(sp + 24) = s0; +goto L449e70;} +MEM_U32(sp + 24) = s0; +v0 = a0; +goto L44a068; +v0 = a0; +L449e70: +v0 = MEM_U8(s3 + 32); +at = 0x36; +if (v0 == at) {at = 0x93; +goto L449e88;} +at = 0x93; +if (v0 != at) {//nop; +goto L449ea4;} +//nop; +L449e88: +t7 = MEM_U16(s3 + 34); +//nop; +t8 = t7 & 0x1; +if (t8 == 0) {//nop; +goto L449ea4;} +//nop; +v0 = s3; +goto L44a068; +v0 = s3; +L449ea4: +v0 = MEM_U32(s3 + 0); +//nop; +if (v0 == 0) {//nop; +goto L449ed8;} +//nop; +t9 = MEM_U16(v0 + 20); +//nop; +at = t9 < 0x2; +if (at == 0) {//nop; +goto L449ed8;} +//nop; +t0 = MEM_U8(v0 + 32); +at = 0x49; +if (t0 != at) {//nop; +goto L44a024;} +//nop; +L449ed8: +v0 = MEM_U32(s3 + 4); +//nop; +if (v0 == 0) {//nop; +goto L449f0c;} +//nop; +t1 = MEM_U16(v0 + 20); +//nop; +at = t1 < 0x2; +if (at == 0) {//nop; +goto L449f0c;} +//nop; +t2 = MEM_U8(v0 + 32); +at = 0x49; +if (t2 != at) {//nop; +goto L44a024;} +//nop; +L449f0c: +v1 = 0x1001a4d4; +//nop; +v1 = MEM_U8(v1 + 0); +//nop; +if (v1 == 0) {v0 = v1 & 0xff; +goto L44a024;} +v0 = v1 & 0xff; +t4 = 0x1001a4e0; +s2 = 0x1001a4e0; +t3 = v0 << 2; +t4 = t4 + 0xfffffffc; +s0 = t3 + t4; +s2 = s2 + 0xfffffffc; +L449f3c: +s1 = MEM_U32(s0 + 0); +//nop; +if (s1 == 0) {//nop; +goto L44a018;} +//nop; +//nop; +a0 = s3; +a1 = s1; +v0 = f_cse_equ(mem, sp, a0, a1); +goto L449f5c; +a1 = s1; +L449f5c: +gp = MEM_U32(sp + 40); +if (v0 == 0) {s0 = s0 + 0xfffffffc; +goto L44a01c;} +s0 = s0 + 0xfffffffc; +if (s3 != s1) {//nop; +goto L449f78;} +//nop; +v0 = s3; +goto L44a068; +v0 = s3; +L449f78: +//nop; +a0 = s3; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L449f88; +//nop; +L449f88: +v0 = MEM_U8(s1 + 32); +gp = MEM_U32(sp + 40); +at = 0x3f; +if (v0 == at) {at = 0x94; +goto L449fa4;} +at = 0x94; +if (v0 != at) {//nop; +goto L449ffc;} +//nop; +L449fa4: +//nop; +a0 = MEM_U32(s1 + 4); +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L449fb4; +//nop; +L449fb4: +t5 = MEM_U8(v0 + 32); +gp = MEM_U32(sp + 40); +at = 0x49; +if (t5 != at) {s1 = v0; +goto L449ff4;} +s1 = v0; +a1 = MEM_U32(s3 + 40); +t6 = MEM_U32(v0 + 40); +//nop; +if (a1 == t6) {//nop; +goto L449ff4;} +//nop; +//nop; +a0 = v0; +//nop; +f_force_casting(mem, sp, a0, a1); +goto L449fec; +//nop; +L449fec: +gp = MEM_U32(sp + 40); +//nop; +L449ff4: +v0 = s1; +goto L44a068; +v0 = s1; +L449ffc: +//nop; +a0 = s1; +//nop; +v0 = f_dup_tree(mem, sp, a0); +goto L44a00c; +//nop; +L44a00c: +gp = MEM_U32(sp + 40); +ra = MEM_U32(sp + 44); +goto L44a06c; +ra = MEM_U32(sp + 44); +L44a018: +s0 = s0 + 0xfffffffc; +L44a01c: +if (s0 != s2) {//nop; +goto L449f3c;} +//nop; +L44a024: +v0 = 0x1001a4d4; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +at = (int)v0 < (int)0xa; +if (at == 0) {t7 = v0 + 0x1; +goto L44a064;} +t7 = v0 + 0x1; +at = 0x1001a4d4; +t8 = 0x1001a4d4; +MEM_U8(at + 0) = (uint8_t)t7; +t0 = 0x1001a4e0; +t8 = MEM_U8(t8 + 0); +t0 = t0 + 0xfffffffc; +t9 = t8 << 2; +t1 = t9 + t0; +MEM_U32(t1 + 0) = s3; +L44a064: +v0 = s3; +L44a068: +ra = MEM_U32(sp + 44); +L44a06c: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x30; +return v0; +sp = sp + 0x30; +} + +static uint32_t f_overlap(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44a084: +//overlap: +t6 = MEM_U8(a0 + 32); +v1 = 0x47; +if (v1 != t6) {//nop; +goto L44a0a0;} +//nop; +v0 = MEM_U32(a0 + 48); +t7 = MEM_U8(a1 + 32); +goto L44a0ac; +t7 = MEM_U8(a1 + 32); +L44a0a0: +v0 = MEM_U32(a0 + 44); +//nop; +t7 = MEM_U8(a1 + 32); +L44a0ac: +//nop; +if (v1 != t7) {//nop; +goto L44a0c4;} +//nop; +v1 = MEM_U32(a1 + 48); +t8 = MEM_U32(a1 + 40); +goto L44a0d0; +t8 = MEM_U32(a1 + 40); +L44a0c4: +v1 = MEM_U32(a1 + 44); +//nop; +t8 = MEM_U32(a1 + 40); +L44a0d0: +//nop; +t9 = v1 + t8; +a2 = (int)v0 < (int)t9; +a2 = a2 ^ 0x1; +a2 = a2 < 0x1; +if (a2 == 0) {//nop; +goto L44a104;} +//nop; +t0 = MEM_U32(a0 + 40); +//nop; +t1 = v0 + t0; +a2 = (int)v1 < (int)t1; +a2 = a2 ^ 0x1; +a2 = a2 < 0x1; +L44a104: +v0 = a2; +return v0; +v0 = a2; +} + +static void f_free_tree_and_cse(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44a10c: +//free_tree_and_cse: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t6 = MEM_U16(a0 + 20); +a1 = a0; +t7 = t6 + 0xffffffff; +t8 = t7 & 0xffff; +if (t8 != 0) {MEM_U16(a0 + 20) = (uint16_t)t7; +goto L44a400;} +MEM_U16(a0 + 20) = (uint16_t)t7; +t0 = MEM_U8(a0 + 32); +//nop; +t9 = t0 + 0xffffffe0; +t1 = t9 < 0x40; +if (t1 == 0) {t2 = (int)t9 >> 5; +goto L44a174;} +t2 = (int)t9 >> 5; +t4 = 0x10005b14; +t3 = t2 << 2; +t4 = t4; +t5 = t4 + t3; +t6 = MEM_U32(t5 + 0); +//nop; +t7 = t6 << (t9 & 0x1f); +t1 = (int)t7 < (int)0x0; +L44a174: +if (t1 == 0) {//nop; +goto L44a254;} +//nop; +a2 = 0x1001a508; +//nop; +a2 = MEM_U8(a2 + 0); +//nop; +if (a2 == 0) {a3 = a2 & 0x3; +goto L44a324;} +a3 = a2 & 0x3; +a3 = -a3; +if (a3 == 0) {v1 = a2; +goto L44a1d8;} +v1 = a2; +t4 = 0x1001a510; +t2 = a2 << 2; +t4 = t4 + 0xfffffffc; +v0 = t2 + t4; +a0 = a3 + a2; +L44a1b4: +t3 = MEM_U32(v0 + 0); +v1 = v1 + 0xffffffff; +if (a1 != t3) {//nop; +goto L44a1c8;} +//nop; +MEM_U32(v0 + 0) = zero; +L44a1c8: +if (a0 != v1) {v0 = v0 + 0xfffffffc; +goto L44a1b4;} +v0 = v0 + 0xfffffffc; +if (v1 == 0) {//nop; +goto L44a324;} +//nop; +L44a1d8: +t6 = 0x1001a510; +t5 = v1 << 2; +v1 = 0x1001a510; +t6 = t6 + 0xfffffffc; +v0 = t5 + t6; +v1 = v1 + 0xfffffffc; +L44a1f0: +t9 = MEM_U32(v0 + 0); +//nop; +if (a1 != t9) {//nop; +goto L44a204;} +//nop; +MEM_U32(v0 + 0) = zero; +L44a204: +t7 = MEM_U32(v0 + -4); +//nop; +if (a1 != t7) {//nop; +goto L44a218;} +//nop; +MEM_U32(v0 + -4) = zero; +L44a218: +t8 = MEM_U32(v0 + -8); +//nop; +if (a1 != t8) {//nop; +goto L44a22c;} +//nop; +MEM_U32(v0 + -8) = zero; +L44a22c: +t1 = MEM_U32(v0 + -12); +//nop; +if (a1 != t1) {//nop; +goto L44a240;} +//nop; +MEM_U32(v0 + -12) = zero; +L44a240: +v0 = v0 + 0xfffffff0; +if (v0 != v1) {//nop; +goto L44a1f0;} +//nop; +a0 = MEM_U32(a1 + 0); +goto L44a328; +a0 = MEM_U32(a1 + 0); +L44a254: +a2 = 0x1001a4d4; +//nop; +a2 = MEM_U8(a2 + 0); +//nop; +if (a2 == 0) {a3 = a2 & 0x3; +goto L44a324;} +a3 = a2 & 0x3; +a3 = -a3; +if (a3 == 0) {v1 = a2; +goto L44a2b0;} +v1 = a2; +t4 = 0x1001a4e0; +t2 = a2 << 2; +t4 = t4 + 0xfffffffc; +v0 = t2 + t4; +a0 = a3 + a2; +L44a28c: +t3 = MEM_U32(v0 + 0); +v1 = v1 + 0xffffffff; +if (a1 != t3) {//nop; +goto L44a2a0;} +//nop; +MEM_U32(v0 + 0) = zero; +L44a2a0: +if (a0 != v1) {v0 = v0 + 0xfffffffc; +goto L44a28c;} +v0 = v0 + 0xfffffffc; +if (v1 == 0) {//nop; +goto L44a324;} +//nop; +L44a2b0: +t6 = 0x1001a4e0; +t5 = v1 << 2; +v1 = 0x1001a4e0; +t6 = t6 + 0xfffffffc; +v0 = t5 + t6; +v1 = v1 + 0xfffffffc; +L44a2c8: +t9 = MEM_U32(v0 + 0); +//nop; +if (a1 != t9) {//nop; +goto L44a2dc;} +//nop; +MEM_U32(v0 + 0) = zero; +L44a2dc: +t7 = MEM_U32(v0 + -4); +//nop; +if (a1 != t7) {//nop; +goto L44a2f0;} +//nop; +MEM_U32(v0 + -4) = zero; +L44a2f0: +t8 = MEM_U32(v0 + -8); +//nop; +if (a1 != t8) {//nop; +goto L44a304;} +//nop; +MEM_U32(v0 + -8) = zero; +L44a304: +t1 = MEM_U32(v0 + -12); +//nop; +if (a1 != t1) {//nop; +goto L44a318;} +//nop; +MEM_U32(v0 + -12) = zero; +L44a318: +v0 = v0 + 0xfffffff0; +if (v0 != v1) {//nop; +goto L44a2c8;} +//nop; +L44a324: +a0 = MEM_U32(a1 + 0); +L44a328: +t2 = t0 < 0x80; +if (a0 == 0) {//nop; +goto L44a380;} +//nop; +if (t2 == 0) {t4 = (int)t0 >> 5; +goto L44a35c;} +t4 = (int)t0 >> 5; +t5 = 0x10005b04; +t3 = t4 << 2; +t5 = t5; +t6 = t5 + t3; +t9 = MEM_U32(t6 + 0); +//nop; +t7 = t9 << (t0 & 0x1f); +t2 = (int)t7 < (int)0x0; +L44a35c: +if (t2 != 0) {//nop; +goto L44a380;} +//nop; +//nop; +MEM_U32(sp + 32) = a1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L44a374; +//nop; +L44a374: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +L44a380: +a0 = MEM_U32(a1 + 4); +//nop; +if (a0 == 0) {//nop; +goto L44a3e8;} +//nop; +t1 = MEM_U8(a1 + 32); +//nop; +t4 = t1 < 0xa0; +if (t4 == 0) {t5 = (int)t1 >> 5; +goto L44a3c4;} +t5 = (int)t1 >> 5; +t6 = 0x10005af0; +t3 = t5 << 2; +t6 = t6; +t9 = t6 + t3; +t7 = MEM_U32(t9 + 0); +//nop; +t8 = t7 << (t1 & 0x1f); +t4 = (int)t8 < (int)0x0; +L44a3c4: +if (t4 != 0) {//nop; +goto L44a3e8;} +//nop; +//nop; +MEM_U32(sp + 32) = a1; +//nop; +f_free_tree_and_cse(mem, sp, a0); +goto L44a3dc; +//nop; +L44a3dc: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +L44a3e8: +//nop; +a0 = a1; +//nop; +f_free_node(mem, sp, a0); +goto L44a3f8; +//nop; +L44a3f8: +gp = MEM_U32(sp + 24); +//nop; +L44a400: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t f_check_vreg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44a410: +//check_vreg: +//nop; +//nop; +//nop; +sp = sp + 0xffffff38; +MEM_U32(sp + 188) = s4; +s4 = 0x1001a45c; +MEM_U32(sp + 184) = s3; +s4 = MEM_U32(s4 + 0); +s3 = a0; +s4 = s4 + 0xffffffff; +MEM_U32(sp + 196) = ra; +MEM_U32(sp + 192) = gp; +MEM_U32(sp + 180) = s2; +MEM_U32(sp + 176) = s1; +MEM_U32(sp + 172) = s0; +if ((int)s4 < 0) {MEM_U32(sp + 204) = a1; +goto L44a74c;} +MEM_U32(sp + 204) = a1; +s2 = 0x1001a460; +s0 = zero; +s4 = s4 + 0x1; +L44a460: +s1 = MEM_U32(s2 + 0); +//nop; +if (s1 == 0) {//nop; +goto L44a740;} +//nop; +t6 = MEM_U32(s1 + 36); +t7 = MEM_U32(s3 + 36); +//nop; +if (t6 != t7) {//nop; +goto L44a740;} +//nop; +//nop; +a0 = s3; +a1 = s1; +v0 = f_overlap(mem, sp, a0, a1); +goto L44a494; +a1 = s1; +L44a494: +gp = MEM_U32(sp + 192); +if (v0 == 0) {s0 = s0 + 0x1; +goto L44a744;} +s0 = s0 + 0x1; +t8 = MEM_U8(s1 + 33); +t1 = MEM_U8(s3 + 33); +t9 = t8 << 24; +t2 = t1 << 24; +t3 = t2 >> 29; +t0 = t9 >> 29; +if (t0 == t3) {a0 = 0x4; +goto L44a5c8;} +a0 = 0x4; +t4 = 0x1000c8b8; +a1 = 0x8ca; +t4 = t4; +t6 = t4 + 0x48; +t7 = sp; +L44a4d4: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t7 = t7 + 0xc; +MEM_U8(t7 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t7) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t7 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 4 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 7($t7) +goto L44a4d4;} +//swr $at, 7($t7) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t8 = 0x1000c868; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +t8 = t8; +MEM_U8(t7 + 12 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t7 + 12 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t7 + 12 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t7 + 12 + 3) = (uint8_t)(t6 >> 0); +t1 = t8 + 0x48; +t2 = sp; +//swr $t6, 0xf($t7) +L44a544: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t2 = t2 + 0xc; +MEM_U8(t2 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t2) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t2 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 84 + 3) = (uint8_t)(at >> 0); +if (t8 != t1) {//swr $at, 0x57($t2) +goto L44a544;} +//swr $at, 0x57($t2) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +//nop; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +t1 = t8 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t8) +//nop; +MEM_U8(t2 + 92 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t2 + 92 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t2 + 92 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t2 + 92 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0x5f($t2) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44a5c0; +//nop; +L44a5c0: +gp = MEM_U32(sp + 192); +//nop; +L44a5c8: +t0 = MEM_U32(s1 + 44); +t3 = MEM_U32(s3 + 44); +a0 = 0x4; +if (t0 != t3) {a1 = 0x8cf; +goto L44a5f0;} +a1 = 0x8cf; +t5 = MEM_U32(s1 + 40); +t6 = MEM_U32(s3 + 40); +//nop; +if (t5 == t6) {t5 = MEM_U8(sp + 207); +goto L44a6f8;} +t5 = MEM_U8(sp + 207); +L44a5f0: +t4 = 0x1000c818; +t1 = sp; +t4 = t4; +t9 = t4 + 0x48; +L44a600: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t1 = t1 + 0xc; +MEM_U8(t1 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t1) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t1 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 4 + 3) = (uint8_t)(at >> 0); +if (t4 != t9) {//swr $at, 7($t1) +goto L44a600;} +//swr $at, 7($t1) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t8 = 0x1000c7c8; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +t9 = t4 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t4) +t8 = t8; +MEM_U8(t1 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t1 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t1 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t1 + 12 + 3) = (uint8_t)(t9 >> 0); +t0 = t8 + 0x48; +t3 = sp; +//swr $t9, 0xf($t1) +L44a670: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t8 != t0) {//swr $at, 0x57($t3) +goto L44a670;} +//swr $at, 0x57($t3) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t0 = t8 + 4; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 7($t8) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44a6ec; +//nop; +L44a6ec: +gp = MEM_U32(sp + 192); +//nop; +t5 = MEM_U8(sp + 207); +L44a6f8: +//nop; +if (t5 != 0) {//nop; +goto L44a738;} +//nop; +t6 = MEM_U8(s3 + 33); +at = 0xffffff1f; +t7 = t6 & at; +t9 = t7 | 0x60; +MEM_U8(s3 + 33) = (uint8_t)t9; +t4 = MEM_U32(s1 + 48); +v0 = MEM_U32(s2 + 0); +MEM_U32(s3 + 44) = t4; +t1 = MEM_U8(v0 + 26); +t2 = 0x1; +if (t1 != 0) {//nop; +goto L44a738;} +//nop; +MEM_U8(v0 + 26) = (uint8_t)t2; +L44a738: +v0 = 0x1; +goto L44a750; +v0 = 0x1; +L44a740: +s0 = s0 + 0x1; +L44a744: +if (s0 != s4) {s2 = s2 + 0x4; +goto L44a460;} +s2 = s2 + 0x4; +L44a74c: +v0 = zero; +L44a750: +ra = MEM_U32(sp + 196); +s0 = MEM_U32(sp + 172); +s1 = MEM_U32(sp + 176); +s2 = MEM_U32(sp + 180); +s3 = MEM_U32(sp + 184); +s4 = MEM_U32(sp + 188); +sp = sp + 0xc8; +return v0; +sp = sp + 0xc8; +} + +static void f_find_vreg_mtag(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44a770: +//find_vreg_mtag: +//nop; +//nop; +//nop; +sp = sp + 0xffffff38; +MEM_U32(sp + 188) = s4; +s4 = 0x1001a45c; +MEM_U32(sp + 184) = s3; +s4 = MEM_U32(s4 + 0); +s3 = a0; +s4 = s4 + 0xffffffff; +MEM_U32(sp + 196) = ra; +MEM_U32(sp + 192) = gp; +MEM_U32(sp + 180) = s2; +MEM_U32(sp + 176) = s1; +if ((int)s4 < 0) {MEM_U32(sp + 172) = s0; +goto L44aa68;} +MEM_U32(sp + 172) = s0; +s2 = 0x1001a460; +s1 = zero; +s4 = s4 + 0x1; +L44a7bc: +s0 = MEM_U32(s2 + 0); +//nop; +if (s0 == 0) {//nop; +goto L44aa5c;} +//nop; +t6 = MEM_U32(s0 + 36); +t7 = MEM_U32(s3 + 36); +//nop; +if (t6 != t7) {//nop; +goto L44aa5c;} +//nop; +//nop; +a0 = s3; +a1 = s0; +v0 = f_overlap(mem, sp, a0, a1); +goto L44a7f0; +a1 = s0; +L44a7f0: +gp = MEM_U32(sp + 192); +if (v0 == 0) {s1 = s1 + 0x1; +goto L44aa60;} +s1 = s1 + 0x1; +t8 = MEM_U8(s0 + 33); +t1 = MEM_U8(s3 + 33); +t9 = t8 << 24; +t2 = t1 << 24; +t3 = t2 >> 29; +t0 = t9 >> 29; +if (t0 == t3) {a0 = 0x4; +goto L44a924;} +a0 = 0x4; +t4 = 0x1000c9f8; +a1 = 0x8ee; +t4 = t4; +t6 = t4 + 0x48; +t7 = sp; +L44a830: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t7 = t7 + 0xc; +MEM_U8(t7 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t7) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t7 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 4 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 7($t7) +goto L44a830;} +//swr $at, 7($t7) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t8 = 0x1000c9a8; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +t8 = t8; +MEM_U8(t7 + 12 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t7 + 12 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t7 + 12 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t7 + 12 + 3) = (uint8_t)(t6 >> 0); +t1 = t8 + 0x48; +t2 = sp; +//swr $t6, 0xf($t7) +L44a8a0: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t2 = t2 + 0xc; +MEM_U8(t2 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t2) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t2 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 84 + 3) = (uint8_t)(at >> 0); +if (t8 != t1) {//swr $at, 0x57($t2) +goto L44a8a0;} +//swr $at, 0x57($t2) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +//nop; +MEM_U8(t2 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t2) +t1 = t8 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t8) +//nop; +MEM_U8(t2 + 92 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t2 + 92 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t2 + 92 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t2 + 92 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0x5f($t2) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44a91c; +//nop; +L44a91c: +gp = MEM_U32(sp + 192); +//nop; +L44a924: +t0 = MEM_U32(s0 + 44); +t3 = MEM_U32(s3 + 44); +a0 = 0x4; +if (t0 != t3) {a1 = 0x8f3; +goto L44a94c;} +a1 = 0x8f3; +t5 = MEM_U32(s0 + 40); +t6 = MEM_U32(s3 + 40); +//nop; +if (t5 == t6) {//nop; +goto L44aa50;} +//nop; +L44a94c: +t4 = 0x1000c958; +t1 = sp; +t4 = t4; +t9 = t4 + 0x48; +L44a95c: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t1 = t1 + 0xc; +MEM_U8(t1 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t1) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t1 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 4 + 3) = (uint8_t)(at >> 0); +if (t4 != t9) {//swr $at, 7($t1) +goto L44a95c;} +//swr $at, 7($t1) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t8 = 0x1000c908; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +t9 = t4 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t4) +t8 = t8; +MEM_U8(t1 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t1 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t1 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t1 + 12 + 3) = (uint8_t)(t9 >> 0); +t0 = t8 + 0x48; +t3 = sp; +//swr $t9, 0xf($t1) +L44a9cc: +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t8 = t8 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t8 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t8) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t8 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t8) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t8 != t0) {//swr $at, 0x57($t3) +goto L44a9cc;} +//swr $at, 0x57($t3) +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t0 = t8 + 4; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 7($t8) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44aa48; +//nop; +L44aa48: +gp = MEM_U32(sp + 192); +//nop; +L44aa50: +t5 = MEM_U32(s0 + 52); +MEM_U32(s3 + 48) = t5; +goto L44aa68; +MEM_U32(s3 + 48) = t5; +L44aa5c: +s1 = s1 + 0x1; +L44aa60: +if (s1 != s4) {s2 = s2 + 0x4; +goto L44a7bc;} +s2 = s2 + 0x4; +L44aa68: +ra = MEM_U32(sp + 196); +s0 = MEM_U32(sp + 172); +s1 = MEM_U32(sp + 176); +s2 = MEM_U32(sp + 180); +s3 = MEM_U32(sp + 184); +s4 = MEM_U32(sp + 188); +sp = sp + 0xc8; +return; +sp = sp + 0xc8; +} + +static void f_check_reg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44aa88: +//check_reg: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 20) = s0; +v0 = MEM_U8(a0 + 33); +t8 = 0x6; +t6 = v0 << 24; +t7 = t6 >> 29; +v0 = t7; +s0 = a0; +if (v0 != t8) {//nop; +goto L44aac8;} +//nop; +abort(); +L44aac8: +at = 0x5; +if (v0 != at) {t2 = v0 < 0x20; +goto L44ab0c;} +t2 = v0 < 0x20; +//nop; +a0 = s0; +//nop; +v0 = f_check_amt(mem, sp, a0); +goto L44aae4; +//nop; +L44aae4: +gp = MEM_U32(sp + 24); +at = 0xffffffff; +if (v0 == at) {ra = MEM_U32(sp + 28); +goto L44abb4;} +ra = MEM_U32(sp + 28); +t9 = MEM_U8(s0 + 33); +MEM_U32(s0 + 44) = v0; +t0 = t9 & 0xff1f; +t1 = t0 | 0x60; +MEM_U8(s0 + 33) = (uint8_t)t1; +goto L44abb0; +MEM_U8(s0 + 33) = (uint8_t)t1; +L44ab0c: +t3 = -t2; +at = 0x60000000; +t4 = t3 & at; +t5 = t4 << (v0 & 0x1f); +if ((int)t5 >= 0) {at = 0x4; +goto L44ab90;} +at = 0x4; +t6 = 0x1001935c; +//nop; +t6 = MEM_U8(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L44ab58;} +//nop; +//nop; +a0 = s0; +a1 = zero; +v0 = f_check_vreg(mem, sp, a0, a1); +goto L44ab4c; +a1 = zero; +L44ab4c: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L44abb4; +ra = MEM_U32(sp + 28); +L44ab58: +//nop; +//nop; +//nop; +v0 = f_get_domtag(mem, sp); +goto L44ab68; +//nop; +L44ab68: +gp = MEM_U32(sp + 24); +if (v0 == 0) {ra = MEM_U32(sp + 28); +goto L44abb4;} +ra = MEM_U32(sp + 28); +//nop; +a0 = s0; +//nop; +f_find_vreg_mtag(mem, sp, a0); +goto L44ab84; +//nop; +L44ab84: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L44abb4; +ra = MEM_U32(sp + 28); +L44ab90: +if (v0 != at) {ra = MEM_U32(sp + 28); +goto L44abb4;} +ra = MEM_U32(sp + 28); +//nop; +a0 = MEM_U32(s0 + 36); +//nop; +v0 = f_get_mtag(mem, sp, a0); +goto L44aba8; +//nop; +L44aba8: +gp = MEM_U32(sp + 24); +MEM_U32(s0 + 48) = v0; +L44abb0: +ra = MEM_U32(sp + 28); +L44abb4: +s0 = MEM_U32(sp + 20); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_assign_vreg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44abc0: +//assign_vreg: +//nop; +//nop; +//nop; +sp = sp + 0xffffff48; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 188) = a1; +a3 = MEM_U8(a0 + 33); +a2 = a0; +v0 = a3; +t6 = v0 & 0x1f; +at = t6 < 0x11; +if (at == 0) {v0 = t6; +goto L44b0f0;} +v0 = t6; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000cb88[] = { +&&L44ad0c, +&&L44b0f0, +&&L44ad0c, +&&L44ad0c, +&&L44ad0c, +&&L44afa4, +&&L44ad0c, +&&L44afa4, +&&L44ad0c, +&&L44ad0c, +&&L44ad0c, +&&L44b0f0, +&&L44ac18, +&&L44ac18, +&&L44ad0c, +&&L44afa4, +&&L44ae94, +}; +dest = Lswitch1000cb88[t6]; +//nop; +goto *dest; +//nop; +L44ac18: +t0 = 0x1001a458; +t8 = 0x1001a450; +v1 = MEM_U32(t0 + 0); +t8 = MEM_U32(t8 + 0); +//nop; +at = v1 < t8; +if (at == 0) {//nop; +goto L44b1fc;} +//nop; +a0 = 0x1001a45c; +t1 = 0x1001a460; +v0 = MEM_U32(a0 + 0); +//nop; +t9 = v0 << 2; +t2 = t9 + t1; +MEM_U32(t2 + 0) = a2; +t3 = v0 + 0x1; +if (a1 == 0) {MEM_U32(a0 + 0) = t3; +goto L44ace4;} +MEM_U32(a0 + 0) = t3; +t4 = a3 << 24; +t5 = t4 >> 29; +at = 0x2; +if (t5 != at) {//nop; +goto L44ace4;} +//nop; +//nop; +a0 = a2; +MEM_U32(sp + 184) = a2; +v0 = f_parm_reg(mem, sp, a0); +goto L44ac84; +MEM_U32(sp + 184) = a2; +L44ac84: +gp = MEM_U32(sp + 176); +a2 = MEM_U32(sp + 184); +v1 = v0 & 0xff; +at = 0x48; +t0 = 0x1001a458; +if (v1 == at) {at = v1 < 0x2c; +goto L44acd8;} +at = v1 < 0x2c; +if (at != 0) {//nop; +goto L44acd8;} +//nop; +t6 = 0x10019314; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +t7 = t6 << 1; +t8 = t7 + 0x2a; +at = t8 < v1; +if (at != 0) {//nop; +goto L44acd8;} +//nop; +t9 = v1 << 2; +MEM_U32(a2 + 48) = t9; +goto L44b1fc; +MEM_U32(a2 + 48) = t9; +L44acd8: +v0 = MEM_U32(t0 + 0); +MEM_U32(a2 + 48) = v0; +goto L44ad00; +MEM_U32(a2 + 48) = v0; +L44ace4: +t1 = MEM_U32(a2 + 48); +t2 = 0xffffffff; +if (t1 == t2) {//nop; +goto L44acf8;} +//nop; +abort(); +L44acf8: +v0 = v1; +MEM_U32(a2 + 48) = v1; +L44ad00: +t3 = v0 + 0x8; +MEM_U32(t0 + 0) = t3; +goto L44b1fc; +MEM_U32(t0 + 0) = t3; +L44ad0c: +t4 = MEM_U32(a2 + 40); +t5 = 0x5; +t0 = 0x1001a454; +at = (int)t4 < (int)t5; +if (at != 0) {//nop; +goto L44ad28;} +//nop; +abort(); +L44ad28: +t6 = 0x1001a44c; +v1 = MEM_U32(t0 + 0); +t6 = MEM_U32(t6 + 0); +//nop; +at = v1 < t6; +if (at == 0) {//nop; +goto L44b1fc;} +//nop; +a0 = 0x1001a45c; +t8 = 0x1001a460; +v0 = MEM_U32(a0 + 0); +//nop; +t7 = v0 << 2; +t9 = t7 + t8; +MEM_U32(t9 + 0) = a2; +t1 = v0 + 0x1; +if (a1 != 0) {MEM_U32(a0 + 0) = t1; +goto L44ad84;} +MEM_U32(a0 + 0) = t1; +t2 = 0x1001a540; +//nop; +t2 = MEM_U8(t2 + 0); +//nop; +if (t2 == 0) {//nop; +goto L44ae24;} +//nop; +L44ad84: +t3 = a3 << 24; +t4 = t3 >> 29; +at = 0x2; +if (t4 != at) {//nop; +goto L44ae24;} +//nop; +//nop; +a0 = a2; +MEM_U8(sp + 191) = (uint8_t)a1; +MEM_U32(sp + 184) = a2; +v0 = f_parm_reg(mem, sp, a0); +goto L44adac; +MEM_U32(sp + 184) = a2; +L44adac: +gp = MEM_U32(sp + 176); +a1 = MEM_U8(sp + 191); +a2 = MEM_U32(sp + 184); +v1 = v0 & 0xff; +at = 0x48; +t0 = 0x1001a454; +if (v1 != at) {//nop; +goto L44adec;} +//nop; +t5 = MEM_U32(a2 + 48); +t6 = 0xffffffff; +if (t5 == t6) {//nop; +goto L44ade0;} +//nop; +abort(); +L44ade0: +v0 = MEM_U32(t0 + 0); +MEM_U32(a2 + 48) = v0; +goto L44ae40; +MEM_U32(a2 + 48) = v0; +L44adec: +v0 = MEM_U32(a2 + 48); +t8 = v1 << 2; +a0 = v0 + 0x1; +a0 = a0 < 0x1; +if (a0 != 0) {//nop; +goto L44ae10;} +//nop; +t7 = v1 << 2; +a0 = t7 ^ v0; +a0 = a0 < 0x1; +L44ae10: +if (a0 != 0) {//nop; +goto L44ae1c;} +//nop; +abort(); +L44ae1c: +MEM_U32(a2 + 48) = t8; +goto L44b1fc; +MEM_U32(a2 + 48) = t8; +L44ae24: +t9 = MEM_U32(a2 + 48); +t1 = 0xffffffff; +if (t9 == t1) {//nop; +goto L44ae38;} +//nop; +abort(); +L44ae38: +v0 = v1; +MEM_U32(a2 + 48) = v1; +L44ae40: +t3 = 0x10019390; +t2 = v0 + 0x4; +MEM_U32(t0 + 0) = t2; +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 == 0) {//nop; +goto L44ae64;} +//nop; +if (a1 != 0) {//nop; +goto L44ae7c;} +//nop; +L44ae64: +t4 = 0x1001a540; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == 0) {ra = MEM_U32(sp + 180); +goto L44b200;} +ra = MEM_U32(sp + 180); +L44ae7c: +v0 = MEM_U32(t0 + 0); +at = 0x34; +if (v0 != at) {t5 = v0 + 0x4; +goto L44b1fc;} +t5 = v0 + 0x4; +MEM_U32(t0 + 0) = t5; +goto L44b1fc; +MEM_U32(t0 + 0) = t5; +L44ae94: +t6 = 0x1000cb38; +a0 = 0x4; +t6 = t6; +t8 = t6 + 0x48; +a1 = 0x94d; +t9 = sp; +L44aeac: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 7($t9) +goto L44aeac;} +//swr $at, 7($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t1 = 0x1000cae8; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +t1 = t1; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t8 >> 0); +t3 = t1 + 0x48; +t4 = sp; +//swr $t8, 0xf($t9) +L44af1c: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t4 = t4 + 0xc; +MEM_U8(t4 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t4) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t4 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 84 + 3) = (uint8_t)(at >> 0); +if (t1 != t3) {//swr $at, 0x57($t4) +goto L44af1c;} +//swr $at, 0x57($t4) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +//nop; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +//nop; +MEM_U8(t4 + 92 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 92 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 92 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 92 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x5f($t4) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44af98; +//nop; +L44af98: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L44b200; +ra = MEM_U32(sp + 180); +L44afa4: +t5 = 0x10018ecc; +at = 0x1; +t5 = MEM_U8(t5 + 0); +t8 = 0x9; +if (t5 != at) {//nop; +goto L44b1fc;} +//nop; +t7 = MEM_U32(a2 + 40); +t0 = 0x1001a454; +at = (int)t7 < (int)t8; +if (at != 0) {//nop; +goto L44afd4;} +//nop; +abort(); +L44afd4: +t6 = 0x1001a44c; +v1 = MEM_U32(t0 + 0); +t6 = MEM_U32(t6 + 0); +//nop; +at = v1 < t6; +if (at == 0) {//nop; +goto L44b1fc;} +//nop; +a0 = 0x1001a45c; +t2 = 0x1001a460; +v0 = MEM_U32(a0 + 0); +//nop; +t9 = v0 << 2; +t3 = t9 + t2; +MEM_U32(t3 + 0) = a2; +t1 = v0 + 0x1; +if (a1 != 0) {MEM_U32(a0 + 0) = t1; +goto L44b030;} +MEM_U32(a0 + 0) = t1; +t4 = 0x1001a540; +//nop; +t4 = MEM_U8(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L44b0c8;} +//nop; +L44b030: +t5 = a3 << 24; +t7 = t5 >> 29; +at = 0x2; +if (t7 != at) {//nop; +goto L44b0c8;} +//nop; +//nop; +a0 = a2; +MEM_U32(sp + 184) = a2; +v0 = f_parm_reg(mem, sp, a0); +goto L44b054; +MEM_U32(sp + 184) = a2; +L44b054: +gp = MEM_U32(sp + 176); +a2 = MEM_U32(sp + 184); +v1 = v0 & 0xff; +at = 0x48; +t0 = 0x1001a454; +if (v1 != at) {//nop; +goto L44b090;} +//nop; +t8 = MEM_U32(a2 + 48); +t6 = 0xffffffff; +if (t8 == t6) {//nop; +goto L44b084;} +//nop; +abort(); +L44b084: +v0 = MEM_U32(t0 + 0); +MEM_U32(a2 + 48) = v0; +goto L44b0e4; +MEM_U32(a2 + 48) = v0; +L44b090: +v0 = MEM_U32(a2 + 48); +t2 = v1 << 2; +a0 = v0 + 0x1; +a0 = a0 < 0x1; +if (a0 != 0) {//nop; +goto L44b0b4;} +//nop; +t9 = v1 << 2; +a0 = t9 ^ v0; +a0 = a0 < 0x1; +L44b0b4: +if (a0 != 0) {//nop; +goto L44b0c0;} +//nop; +abort(); +L44b0c0: +MEM_U32(a2 + 48) = t2; +goto L44b1fc; +MEM_U32(a2 + 48) = t2; +L44b0c8: +t3 = MEM_U32(a2 + 48); +t1 = 0xffffffff; +if (t3 == t1) {//nop; +goto L44b0dc;} +//nop; +abort(); +L44b0dc: +v0 = v1; +MEM_U32(a2 + 48) = v1; +L44b0e4: +t4 = v0 + 0x8; +MEM_U32(t0 + 0) = t4; +goto L44b1fc; +MEM_U32(t0 + 0) = t4; +L44b0f0: +t5 = 0x1000ca98; +a0 = 0x4; +t5 = t5; +t8 = t5 + 0x48; +a1 = 0x96b; +t6 = sp; +L44b108: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t6 = t6 + 0xc; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t6 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 4 + 3) = (uint8_t)(at >> 0); +if (t5 != t8) {//swr $at, 7($t6) +goto L44b108;} +//swr $at, 7($t6) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = 0x1000ca48; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +t8 = t5 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t5) +t9 = t9; +MEM_U8(t6 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t6 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t6 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t6 + 12 + 3) = (uint8_t)(t8 >> 0); +t3 = t9 + 0x48; +t1 = sp; +//swr $t8, 0xf($t6) +L44b178: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t1 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t1) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t1 = t1 + 0xc; +MEM_U8(t1 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t1) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t1 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 84 + 3) = (uint8_t)(at >> 0); +if (t9 != t3) {//swr $at, 0x57($t1) +goto L44b178;} +//swr $at, 0x57($t1) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(t1 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t1) +t3 = t9 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t9) +//nop; +MEM_U8(t1 + 92 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t1 + 92 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t1 + 92 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t1 + 92 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x5f($t1) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44b1f4; +//nop; +L44b1f4: +gp = MEM_U32(sp + 176); +//nop; +L44b1fc: +ra = MEM_U32(sp + 180); +L44b200: +sp = sp + 0xb8; +//nop; +return; +//nop; +} + +static uint32_t f_load_cse(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44b20c: +//load_cse: +//nop; +//nop; +//nop; +t6 = 0x10005ab8; +sp = sp + 0xffffffd0; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if ((int)t6 <= 0) {a2 = a0; +goto L44b23c;} +a2 = a0; +v0 = a0; +goto L44b5e4; +v0 = a0; +L44b23c: +t7 = MEM_U8(a2 + 32); +//nop; +t8 = t7 + 0xffffffe0; +t9 = t8 < 0x40; +if (t9 == 0) {t5 = (int)t8 >> 5; +goto L44b274;} +t5 = (int)t8 >> 5; +t7 = 0x10005b28; +t6 = t5 << 2; +t7 = t7; +t5 = t7 + t6; +t7 = MEM_U32(t5 + 0); +//nop; +t6 = t7 << (t8 & 0x1f); +t9 = (int)t6 < (int)0x0; +L44b274: +if (t9 == 0) {//nop; +goto L44b2f0;} +//nop; +v0 = MEM_U8(a2 + 33); +at = 0x6c000000; +t2 = v0 << 24; +t7 = t2 >> 29; +t8 = t7 < 0x20; +t6 = -t8; +t5 = t6 & at; +t9 = t5 << (t7 & 0x1f); +if ((int)t9 >= 0) {t2 = t7; +goto L44b2f0;} +t2 = t7; +t7 = MEM_U16(a2 + 34); +v1 = 0xe; +t8 = t7 & 0x1; +if (t8 != 0) {a3 = v0 & 0x1f; +goto L44b2f0;} +a3 = v0 & 0x1f; +if (v1 != a3) {//nop; +goto L44b2d4;} +//nop; +a0 = MEM_U32(a2 + 40); +//nop; +at = (int)a0 < (int)0x5; +if (at != 0) {//nop; +goto L44b2f8;} +//nop; +L44b2d4: +if (v1 == a3) {//nop; +goto L44b2f0;} +//nop; +a0 = MEM_U32(a2 + 40); +//nop; +at = (int)a0 < (int)0x9; +if (at != 0) {//nop; +goto L44b2f8;} +//nop; +L44b2f0: +v0 = a2; +goto L44b5e4; +v0 = a2; +L44b2f8: +t4 = 0x1001a508; +//nop; +t3 = MEM_U8(t4 + 0); +//nop; +a1 = t3; +if (a1 == 0) {v0 = a1 & 0xff; +goto L44b5b8;} +v0 = a1 & 0xff; +t5 = 0x1001a510; +t1 = 0x1001a510; +t6 = v0 << 2; +t5 = t5 + 0xfffffffc; +t0 = 0x10018e80; +v1 = t6 + t5; +t1 = t1 + 0xfffffffc; +L44b330: +a1 = MEM_U32(v1 + 0); +v1 = v1 + 0xfffffffc; +if (a1 == 0) {//nop; +goto L44b5b0;} +//nop; +v0 = MEM_U8(a1 + 33); +//nop; +t9 = v0 & 0x1f; +if (a3 != t9) {t7 = v0 << 24; +goto L44b5b0;} +t7 = v0 << 24; +t8 = t7 >> 29; +if (t2 != t8) {//nop; +goto L44b5b0;} +//nop; +t6 = MEM_U32(a2 + 36); +t5 = MEM_U32(a1 + 36); +//nop; +if (t6 != t5) {//nop; +goto L44b5b0;} +//nop; +v0 = MEM_U8(t0 + 0); +//nop; +if (v0 == 0) {//nop; +goto L44b398;} +//nop; +t9 = MEM_U32(a2 + 44); +t7 = MEM_U32(a1 + 44); +//nop; +if (t9 == t7) {//nop; +goto L44b3bc;} +//nop; +L44b398: +if (v0 != 0) {//nop; +goto L44b5b0;} +//nop; +t8 = MEM_U32(a2 + 44); +t5 = MEM_U32(a1 + 44); +t9 = MEM_U32(a1 + 40); +t6 = t8 + a0; +t7 = t5 + t9; +if (t6 != t7) {//nop; +goto L44b5b0;} +//nop; +L44b3bc: +t8 = MEM_U32(a1 + 40); +//nop; +if (a0 != t8) {//nop; +goto L44b5b0;} +//nop; +v0 = MEM_U8(a1 + 32); +at = 0x7b; +if (v0 != at) {at = 0x3e; +goto L44b408;} +at = 0x3e; +//nop; +a0 = MEM_U32(a1 + 0); +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 48) = a2; +v0 = f_dup_tree(mem, sp, a0); +goto L44b3f0; +MEM_U32(sp + 48) = a2; +L44b3f0: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 36); +a2 = MEM_U32(sp + 48); +MEM_U32(sp + 32) = v0; +goto L44b468; +MEM_U32(sp + 32) = v0; +at = 0x3e; +L44b408: +if (v0 != at) {//nop; +goto L44b438;} +//nop; +//nop; +a0 = MEM_U32(a1 + 4); +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 48) = a2; +v0 = f_dup_tree(mem, sp, a0); +goto L44b424; +MEM_U32(sp + 48) = a2; +L44b424: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 36); +a2 = MEM_U32(sp + 48); +MEM_U32(sp + 32) = v0; +goto L44b468; +MEM_U32(sp + 32) = v0; +L44b438: +if (a2 != a1) {a0 = a1; +goto L44b448;} +a0 = a1; +v0 = a2; +goto L44b5e4; +v0 = a2; +L44b448: +//nop; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 48) = a2; +v0 = f_dup_tree(mem, sp, a0); +goto L44b458; +MEM_U32(sp + 48) = a2; +L44b458: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 36); +a2 = MEM_U32(sp + 48); +MEM_U32(sp + 32) = v0; +L44b468: +t5 = 0x10018e98; +at = 0x3; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 != at) {//nop; +goto L44b498;} +//nop; +t9 = MEM_U32(a2 + 40); +t6 = MEM_U32(a1 + 40); +//nop; +at = (int)t9 < (int)t6; +if (at != 0) {//nop; +goto L44b4ec;} +//nop; +L44b498: +t7 = MEM_U32(a2 + 40); +//nop; +at = (int)t7 < (int)0x4; +if (at == 0) {//nop; +goto L44b554;} +//nop; +t8 = MEM_U8(a1 + 32); +//nop; +t5 = t8 + 0xffffffe0; +t9 = t5 < 0x60; +if (t9 == 0) {t6 = (int)t5 >> 5; +goto L44b4e4;} +t6 = (int)t5 >> 5; +t8 = 0x10005b1c; +t7 = t6 << 2; +t8 = t8; +t6 = t8 + t7; +t8 = MEM_U32(t6 + 0); +//nop; +t7 = t8 << (t5 & 0x1f); +t9 = (int)t7 < (int)0x0; +L44b4e4: +if (t9 == 0) {//nop; +goto L44b554;} +//nop; +L44b4ec: +//nop; +a1 = MEM_U32(sp + 32); +a0 = 0x19; +MEM_U32(sp + 48) = a2; +v0 = f_build_1op(mem, sp, a0, a1); +goto L44b500; +MEM_U32(sp + 48) = a2; +L44b500: +a2 = MEM_U32(sp + 48); +v1 = MEM_U8(v0 + 33); +t5 = MEM_U8(a2 + 33); +t7 = v1 << 27; +t6 = t7 >> 27; +t9 = t5 ^ t6; +t8 = t9 & 0x1f; +gp = MEM_U32(sp + 24); +t7 = t8 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t7; +t5 = MEM_U32(a2 + 40); +a0 = v0; +t6 = t5 << 3; +MEM_U32(v0 + 36) = t6; +//nop; +//nop; +//nop; +v0 = f_translate_cvtl(mem, sp, a0); +goto L44b548; +//nop; +L44b548: +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 48); +MEM_U32(sp + 32) = v0; +L44b554: +t9 = MEM_U8(v0 + 32); +at = 0x49; +if (t9 != at) {//nop; +goto L44b590;} +//nop; +a3 = MEM_U8(a2 + 33); +v1 = MEM_U8(v0 + 33); +t8 = a3 & 0x1f; +t7 = v1 & 0x1f; +if (t8 == t7) {t5 = v1 << 27; +goto L44b590;} +t5 = v1 << 27; +t6 = t5 >> 27; +t9 = t8 ^ t6; +t8 = t9 & 0x1f; +t7 = t8 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t7; +L44b590: +//nop; +a0 = a2; +//nop; +f_free_tree(mem, sp, a0); +goto L44b5a0; +//nop; +L44b5a0: +gp = MEM_U32(sp + 24); +v0 = MEM_U32(sp + 32); +ra = MEM_U32(sp + 28); +goto L44b5e8; +ra = MEM_U32(sp + 28); +L44b5b0: +if (v1 != t1) {//nop; +goto L44b330;} +//nop; +L44b5b8: +at = (int)t3 < (int)0xa; +if (at == 0) {v0 = a2; +goto L44b5e4;} +v0 = a2; +t8 = 0x1001a510; +t5 = t3 + 0x1; +t6 = t5 & 0xff; +t9 = t6 << 2; +t8 = t8 + 0xfffffffc; +MEM_U8(t4 + 0) = (uint8_t)t5; +t7 = t9 + t8; +MEM_U32(t7 + 0) = a2; +L44b5e4: +ra = MEM_U32(sp + 28); +L44b5e8: +sp = sp + 0x30; +//nop; +return v0; +//nop; +} + +static uint32_t f_uses(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L44b5f4: +//uses: +//nop; +//nop; +//nop; +sp = sp + 0xffffff28; +MEM_U32(sp + 184) = s2; +MEM_U32(sp + 180) = s1; +MEM_U32(sp + 176) = s0; +at = a2 < 0x10; +s0 = a0; +s1 = a1; +s2 = a2; +MEM_U32(sp + 204) = ra; +MEM_U32(sp + 200) = gp; +MEM_U32(sp + 196) = s5; +MEM_U32(sp + 192) = s4; +if (at != 0) {MEM_U32(sp + 188) = s3; +goto L44b640;} +MEM_U32(sp + 188) = s3; +v0 = 0x1; +goto L44b9c4; +v0 = 0x1; +L44b640: +v0 = MEM_U8(s0 + 32); +L44b644: +s3 = 0x69; +at = v0 < 0x63; +s4 = 0x7d; +if (at != 0) {s5 = 0x23; +goto L44b8b0;} +s5 = 0x23; +at = v0 < 0x7e; +if (at != 0) {at = v0 < 0x8e; +goto L44b874;} +at = v0 < 0x8e; +if (at != 0) {t0 = v0 + 0xffffff7a; +goto L44b998;} +t0 = v0 + 0xffffff7a; +t6 = v0 + 0xffffff6d; +at = t6 < 0x3; +if (at == 0) {//nop; +goto L44b760;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000cde4[] = { +&&L44b708, +&&L44b760, +&&L44b700, +}; +dest = Lswitch1000cde4[t6]; +//nop; +goto *dest; +//nop; +L44b69c: +t7 = MEM_U8(s1 + 33); +t0 = MEM_U8(s0 + 33); +t8 = t7 << 24; +t1 = t0 << 24; +t2 = t1 >> 29; +t9 = t8 >> 29; +v1 = t9 ^ t2; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L44b6f8;} +//nop; +t3 = MEM_U32(s1 + 36); +t4 = MEM_U32(s0 + 36); +//nop; +v1 = t3 ^ t4; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L44b6f8;} +//nop; +//nop; +a0 = s0; +a1 = s1; +v0 = f_overlap(mem, sp, a0, a1); +goto L44b6f0; +a1 = s1; +L44b6f0: +gp = MEM_U32(sp + 200); +v1 = v0; +L44b6f8: +v0 = v1; +goto L44b9c4; +v0 = v1; +L44b700: +v0 = zero; +goto L44b9c4; +v0 = zero; +L44b708: +s0 = MEM_U32(s0 + 0); +v0 = MEM_U8(s0 + 32); +goto L44b644; +v0 = MEM_U8(s0 + 32); +L44b714: +//nop; +a0 = MEM_U32(s0 + 0); +a1 = s1; +a2 = s2 + 0x1; +v0 = f_uses(mem, sp, a0, a1, a2); +goto L44b728; +a2 = s2 + 0x1; +L44b728: +gp = MEM_U32(sp + 200); +if (v0 == 0) {//nop; +goto L44b73c;} +//nop; +v0 = 0x1; +goto L44b9c4; +v0 = 0x1; +L44b73c: +v0 = MEM_U32(s0 + 4); +t5 = MEM_U32(s0 + 0); +//nop; +if (v0 != t5) {//nop; +goto L44b758;} +//nop; +v0 = zero; +goto L44b9c4; +v0 = zero; +L44b758: +s0 = v0; +goto L44b640; +s0 = v0; +L44b760: +t6 = 0x1000cc1c; +a0 = 0x4; +t6 = t6; +t8 = t6 + 0x48; +a1 = 0x9f0; +t0 = sp; +L44b778: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t0 = t0 + 0xc; +MEM_U8(t0 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t0) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t0 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 7($t0) +goto L44b778;} +//swr $at, 7($t0) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t1 = 0x1000cbcc; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +t1 = t1; +MEM_U8(t0 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t0 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t0 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t0 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t1 + 0x48; +t3 = sp; +//swr $t8, 0xf($t0) +L44b7e8: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t1 != t2) {//swr $at, 0x57($t3) +goto L44b7e8;} +//swr $at, 0x57($t3) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t2 = t1 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t1) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44b864; +//nop; +L44b864: +gp = MEM_U32(sp + 200); +v0 = MEM_U8(sp + 215); +//nop; +goto L44b9c4; +//nop; +L44b874: +if (v0 == s3) {at = v0 < 0x78; +goto L44b714;} +at = v0 < 0x78; +if (at == 0) {t4 = v0 + 0xffffff92; +goto L44b988;} +t4 = v0 + 0xffffff92; +at = t4 < 0xa; +if (at == 0) {//nop; +goto L44b760;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000cd9c[] = { +&&L44b708, +&&L44b760, +&&L44b760, +&&L44b760, +&&L44b708, +&&L44b714, +&&L44b714, +&&L44b714, +&&L44b708, +&&L44b708, +}; +dest = Lswitch1000cd9c[t4]; +//nop; +goto *dest; +//nop; +L44b8b0: +at = v0 < 0x10; +if (at != 0) {at = v0 < 0x1e; +goto L44b8f8;} +at = v0 < 0x1e; +if (at != 0) {t6 = v0 + 0xffffffe8; +goto L44b95c;} +t6 = v0 + 0xffffffe8; +if (v0 == s5) {t5 = v0 + 0xffffffd8; +goto L44b714;} +t5 = v0 + 0xffffffd8; +at = t5 < 0x3b; +if (at == 0) {//nop; +goto L44b760;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000ccb0[] = { +&&L44b714, +&&L44b714, +&&L44b760, +&&L44b760, +&&L44b760, +&&L44b760, +&&L44b714, +&&L44b714, +&&L44b714, +&&L44b760, +&&L44b708, +&&L44b760, +&&L44b714, +&&L44b714, +&&L44b708, +&&L44b708, +&&L44b714, +&&L44b760, +&&L44b714, +&&L44b714, +&&L44b714, +&&L44b708, +&&L44b760, +&&L44b760, +&&L44b760, +&&L44b714, +&&L44b700, +&&L44b760, +&&L44b760, +&&L44b760, +&&L44b700, +&&L44b700, +&&L44b760, +&&L44b700, +&&L44b760, +&&L44b700, +&&L44b760, +&&L44b714, +&&L44b714, +&&L44b760, +&&L44b708, +&&L44b760, +&&L44b69c, +&&L44b760, +&&L44b760, +&&L44b714, +&&L44b714, +&&L44b714, +&&L44b760, +&&L44b760, +&&L44b760, +&&L44b714, +&&L44b760, +&&L44b714, +&&L44b708, +&&L44b714, +&&L44b760, +&&L44b708, +&&L44b708, +}; +dest = Lswitch1000ccb0[t5]; +//nop; +goto *dest; +//nop; +L44b8f8: +at = v0 < 0x5; +if (at == 0) {t8 = v0 + 0xfffffff6; +goto L44b930;} +t8 = v0 + 0xfffffff6; +at = v0 < 0x5; +if (at == 0) {//nop; +goto L44b760;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000cc6c[] = { +&&L44b708, +&&L44b714, +&&L44b708, +&&L44b760, +&&L44b714, +}; +dest = Lswitch1000cc6c[v0]; +//nop; +goto *dest; +//nop; +L44b930: +at = t8 < 0x6; +if (at == 0) {//nop; +goto L44b760;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000cc80[] = { +&&L44b714, +&&L44b700, +&&L44b708, +&&L44b708, +&&L44b708, +&&L44b708, +}; +dest = Lswitch1000cc80[t8]; +//nop; +goto *dest; +//nop; +L44b95c: +at = t6 < 0x6; +if (at == 0) {//nop; +goto L44b760;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000cc98[] = { +&&L44b708, +&&L44b708, +&&L44b708, +&&L44b760, +&&L44b714, +&&L44b714, +}; +dest = Lswitch1000cc98[t6]; +//nop; +goto *dest; +//nop; +L44b988: +if (v0 == s4) {//nop; +goto L44b714;} +//nop; +//nop; +goto L44b760; +//nop; +L44b998: +at = t0 < 0x8; +if (at == 0) {//nop; +goto L44b760;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000cdc4[] = { +&&L44b708, +&&L44b760, +&&L44b760, +&&L44b760, +&&L44b714, +&&L44b760, +&&L44b760, +&&L44b714, +}; +dest = Lswitch1000cdc4[t0]; +//nop; +goto *dest; +//nop; +L44b9c4: +ra = MEM_U32(sp + 204); +s0 = MEM_U32(sp + 176); +s1 = MEM_U32(sp + 180); +s2 = MEM_U32(sp + 184); +s3 = MEM_U32(sp + 188); +s4 = MEM_U32(sp + 192); +s5 = MEM_U32(sp + 196); +sp = sp + 0xd8; +return v0; +sp = sp + 0xd8; +} + +static void f_add_store(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44b9e8: +//add_store: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +v0 = MEM_U8(a0 + 33); +at = 0x6c000000; +t6 = v0 << 24; +t7 = t6 >> 29; +t8 = t7 < 0x20; +t9 = -t8; +t0 = t9 & at; +t1 = t0 << (t7 & 0x1f); +if ((int)t1 >= 0) {s2 = a0; +goto L44bcf8;} +s2 = a0; +a0 = 0xe; +v1 = v0 & 0x1f; +if (a0 != v1) {//nop; +goto L44ba5c;} +//nop; +t2 = MEM_U32(s2 + 40); +//nop; +at = (int)t2 < (int)0x5; +if (at != 0) {//nop; +goto L44ba78;} +//nop; +L44ba5c: +if (a0 == v1) {ra = MEM_U32(sp + 44); +goto L44bcfc;} +ra = MEM_U32(sp + 44); +t3 = MEM_U32(s2 + 40); +//nop; +at = (int)t3 < (int)0x9; +if (at == 0) {ra = MEM_U32(sp + 44); +goto L44bcfc;} +ra = MEM_U32(sp + 44); +L44ba78: +a0 = MEM_U8(s2 + 32); +at = 0x7b; +if (a0 != at) {s3 = s2; +goto L44bb58;} +s3 = s2; +v0 = MEM_U32(s2 + 0); +//nop; +t4 = MEM_U8(v0 + 32); +//nop; +t5 = t4 + 0xffffffe0; +t6 = t5 < 0x40; +if (t6 == 0) {t8 = (int)t5 >> 5; +goto L44bac8;} +t8 = (int)t5 >> 5; +t0 = 0x10005b30; +t9 = t8 << 2; +t0 = t0; +t7 = t0 + t9; +t1 = MEM_U32(t7 + 0); +//nop; +t2 = t1 << (t5 & 0x1f); +t6 = (int)t2 < (int)0x0; +L44bac8: +if (t6 == 0) {//nop; +goto L44bae8;} +//nop; +t4 = MEM_U8(v0 + 33); +at = 0x3; +t8 = t4 << 24; +t0 = t8 >> 29; +if (t0 == at) {//nop; +goto L44bb50;} +//nop; +L44bae8: +v1 = MEM_U32(v0 + 0); +//nop; +if (v1 == 0) {at = 0x3e; +goto L44bb5c;} +at = 0x3e; +t9 = MEM_U8(v1 + 32); +//nop; +t7 = t9 + 0xffffffe0; +t1 = t7 < 0x40; +if (t1 == 0) {t5 = (int)t7 >> 5; +goto L44bb30;} +t5 = (int)t7 >> 5; +t3 = 0x10005b30; +t2 = t5 << 2; +t3 = t3; +t6 = t3 + t2; +t4 = MEM_U32(t6 + 0); +//nop; +t8 = t4 << (t7 & 0x1f); +t1 = (int)t8 < (int)0x0; +L44bb30: +if (t1 == 0) {at = 0x3e; +goto L44bb5c;} +at = 0x3e; +t9 = MEM_U8(v1 + 33); +at = 0x3; +t5 = t9 << 24; +t3 = t5 >> 29; +if (t3 != at) {at = 0x3e; +goto L44bb5c;} +at = 0x3e; +L44bb50: +s3 = zero; +goto L44bbc8; +s3 = zero; +L44bb58: +at = 0x3e; +L44bb5c: +if (a0 != at) {//nop; +goto L44bbc8;} +//nop; +v0 = MEM_U32(s2 + 4); +//nop; +t2 = MEM_U8(v0 + 32); +//nop; +t6 = t2 + 0xffffffe0; +t4 = t6 < 0x40; +if (t4 == 0) {t7 = (int)t6 >> 5; +goto L44bba4;} +t7 = (int)t6 >> 5; +t0 = 0x10005b30; +t8 = t7 << 2; +t0 = t0; +t1 = t0 + t8; +t9 = MEM_U32(t1 + 0); +//nop; +t5 = t9 << (t6 & 0x1f); +t4 = (int)t5 < (int)0x0; +L44bba4: +if (t4 == 0) {//nop; +goto L44bbc8;} +//nop; +t2 = MEM_U8(v0 + 33); +at = 0x3; +t7 = t2 << 24; +t0 = t7 >> 29; +if (t0 != at) {//nop; +goto L44bbc8;} +//nop; +s3 = zero; +L44bbc8: +v1 = 0x1001a508; +//nop; +v1 = MEM_U8(v1 + 0); +//nop; +if (v1 == 0) {v0 = v1 & 0xff; +goto L44bcac;} +v0 = v1 & 0xff; +t1 = 0x1001a510; +t8 = v0 << 2; +t1 = t1 + 0xfffffffc; +s1 = t8 + t1; +L44bbf0: +s0 = MEM_U32(s1 + 0); +//nop; +if (s0 != 0) {//nop; +goto L44bc0c;} +//nop; +MEM_U32(s1 + 0) = s3; +s3 = zero; +goto L44bc98; +s3 = zero; +L44bc0c: +t9 = MEM_U8(s2 + 33); +t3 = MEM_U8(s0 + 33); +t6 = t9 << 24; +t4 = t3 << 24; +t2 = t4 >> 29; +t5 = t6 >> 29; +if (t5 != t2) {//nop; +goto L44bc68;} +//nop; +t7 = MEM_U32(s2 + 36); +t0 = MEM_U32(s0 + 36); +//nop; +if (t7 != t0) {//nop; +goto L44bc68;} +//nop; +//nop; +a0 = s0; +a1 = s2; +v0 = f_overlap(mem, sp, a0, a1); +goto L44bc50; +a1 = s2; +L44bc50: +gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L44bc68;} +//nop; +MEM_U32(s1 + 0) = s3; +s3 = zero; +goto L44bc98; +s3 = zero; +L44bc68: +t8 = MEM_U8(s0 + 32); +at = 0x7b; +if (t8 != at) {a1 = s2; +goto L44bc98;} +a1 = s2; +//nop; +a0 = MEM_U32(s0 + 0); +a2 = zero; +v0 = f_uses(mem, sp, a0, a1, a2); +goto L44bc88; +a2 = zero; +L44bc88: +gp = MEM_U32(sp + 40); +if (v0 == 0) {//nop; +goto L44bc98;} +//nop; +MEM_U32(s1 + 0) = zero; +L44bc98: +t1 = 0x1001a510; +s1 = s1 + 0xfffffffc; +t1 = t1 + 0xfffffffc; +if (s1 != t1) {//nop; +goto L44bbf0;} +//nop; +L44bcac: +if (s3 == 0) {ra = MEM_U32(sp + 44); +goto L44bcfc;} +ra = MEM_U32(sp + 44); +v0 = 0x1001a508; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +at = (int)v0 < (int)0xa; +if (at == 0) {ra = MEM_U32(sp + 44); +goto L44bcfc;} +ra = MEM_U32(sp + 44); +at = 0x1001a508; +t6 = 0x1001a508; +t9 = v0 + 0x1; +MEM_U8(at + 0) = (uint8_t)t9; +t4 = 0x1001a510; +t6 = MEM_U8(t6 + 0); +t4 = t4 + 0xfffffffc; +t3 = t6 << 2; +t5 = t3 + t4; +MEM_U32(t5 + 0) = s3; +L44bcf8: +ra = MEM_U32(sp + 44); +L44bcfc: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static uint32_t f_is_reg(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44bd14: +//is_reg: +//nop; +//nop; +//nop; +v1 = MEM_U8(a0 + 33); +at = 0x66000000; +t6 = v1 << 24; +v1 = t6 >> 29; +t8 = v1 < 0x20; +t9 = -t8; +t0 = t9 & at; +sp = sp + 0xffffffe0; +t1 = t0 << (v1 & 0x1f); +MEM_U32(sp + 28) = ra; +if ((int)t1 >= 0) {MEM_U32(sp + 24) = gp; +goto L44bd78;} +MEM_U32(sp + 24) = gp; +//nop; +MEM_U32(sp + 32) = a0; +//nop; +f_check_reg(mem, sp, a0); +goto L44bd60; +//nop; +L44bd60: +a0 = MEM_U32(sp + 32); +gp = MEM_U32(sp + 24); +v1 = MEM_U8(a0 + 33); +//nop; +t2 = v1 << 24; +v1 = t2 >> 29; +L44bd78: +ra = MEM_U32(sp + 28); +v0 = v1 ^ 0x3; +v0 = v0 < 0x1; +sp = sp + 0x20; +return v0; +sp = sp + 0x20; +} + +static uint32_t f_translate_cvtl(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44bd8c: +//translate_cvtl: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 20) = s0; +a1 = a0; +a0 = MEM_U32(a0 + 0); +MEM_U32(sp + 64) = a1; +v0 = f_is_constant(mem, sp, a0); +goto L44bdbc; +MEM_U32(sp + 64) = a1; +L44bdbc: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 64); +if (v0 == 0) {//nop; +goto L44bde8;} +//nop; +//nop; +a0 = a1; +//nop; +v0 = f_fold(mem, sp, a0); +goto L44bddc; +//nop; +L44bddc: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L44c2a0; +ra = MEM_U32(sp + 28); +L44bde8: +t6 = MEM_U8(a1 + 33); +v1 = MEM_U32(a1 + 36); +//nop; +a0 = MEM_U32(a1 + 0); +t7 = t6 & 0x1f; +MEM_U8(sp + 55) = (uint8_t)t7; +MEM_U32(sp + 64) = a1; +MEM_U32(sp + 56) = v1; +v0 = f_dup_tree(mem, sp, a0); +goto L44be0c; +MEM_U32(sp + 56) = v1; +L44be0c: +a0 = MEM_U32(sp + 64); +gp = MEM_U32(sp + 24); +t8 = MEM_U8(a0 + 25); +s0 = v0; +t9 = t8 & 0xfffe; +MEM_U8(a0 + 25) = (uint8_t)t9; +//nop; +//nop; +//nop; +f_free_tree(mem, sp, a0); +goto L44be34; +//nop; +L44be34: +v1 = MEM_U32(sp + 56); +gp = MEM_U32(sp + 24); +at = (int)v1 < (int)0x40; +if (at != 0) {//nop; +goto L44be50;} +//nop; +v0 = s0; +goto L44c29c; +v0 = s0; +L44be50: +v0 = MEM_U8(s0 + 32); +at = 0x52; +if (v0 != at) {at = 0x36; +goto L44be8c;} +at = 0x36; +//nop; +a0 = s0; +MEM_U32(sp + 56) = v1; +v0 = f_is_reg(mem, sp, a0); +goto L44be70; +MEM_U32(sp + 56) = v1; +L44be70: +gp = MEM_U32(sp + 24); +v1 = MEM_U32(sp + 56); +if (v0 == 0) {//nop; +goto L44be9c;} +//nop; +v0 = MEM_U8(s0 + 32); +//nop; +at = 0x36; +L44be8c: +if (v0 == at) {at = 0x3d; +goto L44be9c;} +at = 0x3d; +if (v0 != at) {v0 = MEM_U8(sp + 55); +goto L44c0b8;} +v0 = MEM_U8(sp + 55); +L44be9c: +v0 = MEM_U32(s0 + 40); +//nop; +t0 = v0 << 3; +at = (int)t0 < (int)v1; +if (at == 0) {v0 = t0; +goto L44bf04;} +v0 = t0; +t1 = MEM_U8(s0 + 33); +a0 = 0x6; +t2 = t1 & 0x1f; +if (a0 != t2) {//nop; +goto L44befc;} +//nop; +v0 = MEM_U8(sp + 55); +at = 0x5; +if (v0 == a0) {//nop; +goto L44befc;} +//nop; +if (v0 != at) {v0 = MEM_U8(sp + 55); +goto L44c0b8;} +v0 = MEM_U8(sp + 55); +t3 = 0x10018eac; +//nop; +t3 = MEM_U8(t3 + 0); +//nop; +at = t3 < 0x2; +if (at != 0) {v0 = MEM_U8(sp + 55); +goto L44c0b8;} +v0 = MEM_U8(sp + 55); +L44befc: +v0 = s0; +goto L44c29c; +v0 = s0; +L44bf04: +if (v1 != v0) {//nop; +goto L44bf28;} +//nop; +t5 = MEM_U8(s0 + 33); +t4 = MEM_U8(sp + 55); +t6 = t5 & 0x1f; +if (t4 != t6) {//nop; +goto L44bf28;} +//nop; +v0 = s0; +goto L44c29c; +v0 = s0; +L44bf28: +t7 = MEM_U16(s0 + 34); +//nop; +t8 = t7 & 0x1; +if (t8 != 0) {v0 = MEM_U8(sp + 55); +goto L44c0b8;} +v0 = MEM_U8(sp + 55); +t9 = MEM_U16(s0 + 20); +t0 = v1 & 0x7; +at = t9 < 0x2; +if (at == 0) {v0 = MEM_U8(sp + 55); +goto L44c0b8;} +v0 = MEM_U8(sp + 55); +if (t0 != 0) {v0 = MEM_U8(sp + 55); +goto L44c0b8;} +v0 = MEM_U8(sp + 55); +if ((int)v1 >= 0) {a2 = (int)v1 >> 3; +goto L44bf68;} +a2 = (int)v1 >> 3; +at = v1 + 0x7; +a2 = (int)at >> 3; +L44bf68: +at = 0x1; +if (a2 == at) {at = 0x2; +goto L44bf8c;} +at = 0x2; +if (a2 == at) {at = 0x4; +goto L44bf8c;} +at = 0x4; +if (a2 == at) {at = 0x8; +goto L44bf8c;} +at = 0x8; +if (a2 != at) {v0 = MEM_U8(sp + 55); +goto L44c0b8;} +v0 = MEM_U8(sp + 55); +L44bf8c: +//nop; +a0 = s0 + 0x20; +MEM_U32(sp + 32) = a2; +v0 = f_build_u(mem, sp, a0); +goto L44bf9c; +MEM_U32(sp + 32) = a2; +L44bf9c: +t1 = MEM_U8(s0 + 32); +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 32); +at = 0x52; +if (t1 == at) {a1 = v0; +goto L44c040;} +a1 = v0; +a0 = MEM_U32(s0 + 0); +at = 0x52; +t2 = MEM_U8(a0 + 32); +//nop; +if (t2 != at) {//nop; +goto L44c01c;} +//nop; +//nop; +MEM_U32(sp + 44) = v0; +MEM_U32(sp + 32) = a2; +v0 = f_is_reg(mem, sp, a0); +goto L44bfdc; +MEM_U32(sp + 32) = a2; +L44bfdc: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 44); +a2 = MEM_U32(sp + 32); +if (v0 == 0) {//nop; +goto L44c01c;} +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 32) = a2; +a0 = a0 + 0x20; +v0 = f_build_u(mem, sp, a0); +goto L44c008; +a0 = a0 + 0x20; +L44c008: +a1 = MEM_U32(sp + 44); +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 32); +MEM_U32(a1 + 0) = v0; +goto L44c040; +MEM_U32(a1 + 0) = v0; +L44c01c: +//nop; +a0 = MEM_U32(s0 + 0); +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 32) = a2; +v0 = f_dup_tree(mem, sp, a0); +goto L44c030; +MEM_U32(sp + 32) = a2; +L44c030: +a1 = MEM_U32(sp + 44); +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 32); +MEM_U32(a1 + 0) = v0; +L44c040: +//nop; +a0 = s0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 32) = a2; +f_free_tree(mem, sp, a0); +goto L44c054; +MEM_U32(sp + 32) = a2; +L44c054: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 44); +t3 = 0x10018e80; +a2 = MEM_U32(sp + 32); +t3 = MEM_U8(t3 + 0); +v0 = a1; +if (t3 != 0) {//nop; +goto L44c08c;} +//nop; +t5 = MEM_U32(a1 + 44); +t4 = MEM_U32(a1 + 40); +//nop; +t6 = t5 + t4; +t7 = t6 - a2; +MEM_U32(a1 + 44) = t7; +L44c08c: +v1 = MEM_U8(a1 + 33); +t8 = MEM_U8(sp + 55); +t9 = v1 << 27; +t0 = t9 >> 27; +t1 = t8 ^ t0; +t2 = t1 & 0x1f; +t3 = t2 ^ v1; +MEM_U32(a1 + 40) = a2; +MEM_U8(a1 + 33) = (uint8_t)t3; +goto L44c29c; +MEM_U8(a1 + 33) = (uint8_t)t3; +v0 = MEM_U8(sp + 55); +L44c0b8: +a0 = 0x6; +if (v0 != a0) {at = 0x5; +goto L44c15c;} +at = 0x5; +//nop; +t5 = 0x20; +a2 = t5 - v1; +MEM_U32(sp + 32) = a2; +a0 = 0x8; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L44c0e0; +a1 = zero; +L44c0e0: +gp = MEM_U32(sp + 24); +a0 = 0x73; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44c0f8; +a2 = v0; +L44c0f8: +v1 = MEM_U8(v0 + 33); +t4 = MEM_U8(sp + 55); +t6 = v1 << 27; +t7 = t6 >> 27; +t9 = t4 ^ t7; +gp = MEM_U32(sp + 24); +t8 = t9 & 0x1f; +t0 = t8 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t0; +//nop; +a2 = MEM_U32(sp + 32); +s0 = v0; +a0 = 0x8; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L44c134; +a1 = zero; +L44c134: +gp = MEM_U32(sp + 24); +a0 = 0x74; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44c14c; +a2 = v0; +L44c14c: +gp = MEM_U32(sp + 24); +s0 = v0; +goto L44c298; +s0 = v0; +at = 0x5; +L44c15c: +if (v0 != at) {a0 = 0x7; +goto L44c1f4;} +a0 = 0x7; +//nop; +t1 = 0x40; +a2 = t1 - v1; +MEM_U32(sp + 32) = a2; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L44c17c; +a1 = zero; +L44c17c: +gp = MEM_U32(sp + 24); +a0 = 0x73; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44c194; +a2 = v0; +L44c194: +v1 = MEM_U8(v0 + 33); +t2 = MEM_U8(sp + 55); +t3 = v1 << 27; +t5 = t3 >> 27; +t6 = t2 ^ t5; +gp = MEM_U32(sp + 24); +t4 = t6 & 0x1f; +t7 = t4 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t7; +//nop; +a2 = MEM_U32(sp + 32); +s0 = v0; +a0 = 0x7; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L44c1d0; +a1 = zero; +L44c1d0: +gp = MEM_U32(sp + 24); +a0 = 0x74; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44c1e8; +a2 = v0; +L44c1e8: +gp = MEM_U32(sp + 24); +s0 = v0; +goto L44c298; +s0 = v0; +L44c1f4: +at = (int)v1 < (int)0x20; +if (at != 0) {a0 = 0x8; +goto L44c240;} +a0 = 0x8; +t9 = 0x1; +a1 = t9 << (v1 & 0x1f); +//nop; +a1 = a1 + 0xffffffff; +a0 = 0x7; +a2 = 0xffffffff; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L44c21c; +a2 = 0xffffffff; +L44c21c: +gp = MEM_U32(sp + 24); +a0 = 0x4; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44c234; +a2 = v0; +L44c234: +gp = MEM_U32(sp + 24); +s0 = v0; +goto L44c278; +s0 = v0; +L44c240: +//nop; +t8 = 0x1; +a2 = t8 << (v1 & 0x1f); +a2 = a2 + 0xffffffff; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L44c258; +a1 = zero; +L44c258: +gp = MEM_U32(sp + 24); +a0 = 0x4; +//nop; +a1 = s0; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44c270; +a2 = v0; +L44c270: +gp = MEM_U32(sp + 24); +s0 = v0; +L44c278: +v1 = MEM_U8(v0 + 33); +t0 = MEM_U8(sp + 55); +t1 = v1 << 27; +t3 = t1 >> 27; +t2 = t0 ^ t3; +t5 = t2 & 0x1f; +t6 = t5 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t6; +L44c298: +v0 = s0; +L44c29c: +ra = MEM_U32(sp + 28); +L44c2a0: +s0 = MEM_U32(sp + 20); +sp = sp + 0x40; +return v0; +sp = sp + 0x40; +} + +static uint32_t f_need_check_hl(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44c2ac: +//need_check_hl: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t6 = MEM_U8(a0 + 33); +at = 0xe; +t7 = t6 & 0x1f; +if (t7 != at) {a1 = a0; +goto L44c2e0;} +a1 = a0; +v0 = zero; +goto L44c364; +v0 = zero; +L44c2e0: +//nop; +a0 = MEM_U32(a1 + 0); +MEM_U32(sp + 32) = a1; +v0 = f_is_constant(mem, sp, a0); +goto L44c2f0; +MEM_U32(sp + 32) = a1; +L44c2f0: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +if (v0 == 0) {v0 = 0x1; +goto L44c364;} +v0 = 0x1; +v0 = MEM_U8(a1 + 32); +//nop; +v1 = v0 ^ 0xc; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L44c32c;} +//nop; +t9 = MEM_U32(a1 + 0); +t8 = MEM_U32(a1 + 36); +t0 = MEM_U32(t9 + 48); +//nop; +v1 = (int)t8 < (int)t0; +L44c32c: +if (v1 != 0) {//nop; +goto L44c358;} +//nop; +v1 = v0 ^ 0xd; +v1 = v1 < 0x1; +if (v1 == 0) {//nop; +goto L44c358;} +//nop; +t1 = MEM_U32(a1 + 0); +t3 = MEM_U32(a1 + 36); +t2 = MEM_U32(t1 + 48); +//nop; +v1 = (int)t2 < (int)t3; +L44c358: +v0 = v1; +goto L44c364; +v0 = v1; +v0 = 0x1; +L44c364: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return v0; +//nop; +} + +static uint32_t f_build_ucond0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44c374: +//build_ucond0: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 52) = a1; +v0 = f_dup_tree(mem, sp, a0); +goto L44c398; +MEM_U32(sp + 52) = a1; +L44c398: +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 52); +//nop; +MEM_U32(sp + 32) = v0; +a0 = 0x8; +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L44c3b4; +a1 = zero; +L44c3b4: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +a0 = 0x4e; +a2 = v0; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44c3cc; +a2 = v0; +L44c3cc: +t6 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 24); +t7 = t6 & 0xffe0; +t8 = t7 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t8; +//nop; +a0 = 0xa; +a1 = v0; +a2 = zero; +v0 = f_build_2op(mem, sp, a0, a1, a2); +goto L44c3f4; +a2 = zero; +L44c3f4: +t9 = MEM_U8(v0 + 33); +gp = MEM_U32(sp + 24); +t0 = t9 & 0xffe0; +t1 = t0 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t1; +ra = MEM_U32(sp + 28); +sp = sp + 0x30; +//nop; +return v0; +//nop; +} + +static uint32_t f_check_loads_exprs(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44c418: +//check_loads_exprs: +//nop; +//nop; +//nop; +v0 = 0x1001a508; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +if ((int)v0 <= 0) {a3 = v0 & 0x3; +goto L44c504;} +a3 = v0 & 0x3; +a3 = -a3; +if (a3 == 0) {v1 = v0; +goto L44c484;} +v1 = v0; +t7 = 0x1001a510; +t6 = v0 << 2; +t7 = t7 + 0xfffffffc; +a1 = t6 + t7; +a2 = a3 + v0; +L44c45c: +t8 = MEM_U32(a1 + 0); +v1 = v1 + 0xffffffff; +if (a0 != t8) {//nop; +goto L44c474;} +//nop; +v0 = 0x1; +return v0; +v0 = 0x1; +L44c474: +if (a2 != v1) {a1 = a1 + 0xfffffffc; +goto L44c45c;} +a1 = a1 + 0xfffffffc; +if (v1 == 0) {//nop; +goto L44c504;} +//nop; +L44c484: +t0 = 0x1001a510; +v0 = 0x1001a510; +t9 = v1 << 2; +t0 = t0 + 0xfffffffc; +a1 = t9 + t0; +v0 = v0 + 0xfffffffc; +L44c49c: +t1 = MEM_U32(a1 + 0); +//nop; +if (a0 != t1) {//nop; +goto L44c4b4;} +//nop; +v0 = 0x1; +return v0; +v0 = 0x1; +L44c4b4: +t2 = MEM_U32(a1 + -4); +//nop; +if (a0 != t2) {//nop; +goto L44c4cc;} +//nop; +v0 = 0x1; +return v0; +v0 = 0x1; +L44c4cc: +t3 = MEM_U32(a1 + -8); +//nop; +if (a0 != t3) {//nop; +goto L44c4e4;} +//nop; +v0 = 0x1; +return v0; +v0 = 0x1; +L44c4e4: +t4 = MEM_U32(a1 + -12); +a1 = a1 + 0xfffffff0; +if (a0 != t4) {//nop; +goto L44c4fc;} +//nop; +v0 = 0x1; +return v0; +v0 = 0x1; +L44c4fc: +if (a1 != v0) {//nop; +goto L44c49c;} +//nop; +L44c504: +v0 = 0x1001a4d4; +//nop; +v0 = MEM_U8(v0 + 0); +//nop; +if ((int)v0 <= 0) {a3 = v0 & 0x3; +goto L44c5e4;} +a3 = v0 & 0x3; +a3 = -a3; +if (a3 == 0) {v1 = v0; +goto L44c564;} +v1 = v0; +t6 = 0x1001a4e0; +t5 = v0 << 2; +t6 = t6 + 0xfffffffc; +a1 = t5 + t6; +a2 = a3 + v0; +L44c53c: +t7 = MEM_U32(a1 + 0); +v1 = v1 + 0xffffffff; +if (a0 != t7) {//nop; +goto L44c554;} +//nop; +v0 = 0x1; +return v0; +v0 = 0x1; +L44c554: +if (a2 != v1) {a1 = a1 + 0xfffffffc; +goto L44c53c;} +a1 = a1 + 0xfffffffc; +if (v1 == 0) {v0 = zero; +goto L44c5e8;} +v0 = zero; +L44c564: +t9 = 0x1001a4e0; +v0 = 0x1001a4e0; +t8 = v1 << 2; +t9 = t9 + 0xfffffffc; +a1 = t8 + t9; +v0 = v0 + 0xfffffffc; +L44c57c: +t0 = MEM_U32(a1 + 0); +//nop; +if (a0 != t0) {//nop; +goto L44c594;} +//nop; +v0 = 0x1; +return v0; +v0 = 0x1; +L44c594: +t1 = MEM_U32(a1 + -4); +//nop; +if (a0 != t1) {//nop; +goto L44c5ac;} +//nop; +v0 = 0x1; +return v0; +v0 = 0x1; +L44c5ac: +t2 = MEM_U32(a1 + -8); +//nop; +if (a0 != t2) {//nop; +goto L44c5c4;} +//nop; +v0 = 0x1; +return v0; +v0 = 0x1; +L44c5c4: +t3 = MEM_U32(a1 + -12); +a1 = a1 + 0xfffffff0; +if (a0 != t3) {//nop; +goto L44c5dc;} +//nop; +v0 = 0x1; +return v0; +v0 = 0x1; +L44c5dc: +if (a1 != v0) {//nop; +goto L44c57c;} +//nop; +L44c5e4: +v0 = zero; +L44c5e8: +//nop; +return v0; +//nop; +} + +static void f_indent_tree(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44c5f0: +//indent_tree: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 28) = s1; +t6 = a1 >> 3; +s1 = a0; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 24) = s0; +if (t6 == 0) {MEM_U32(sp + 44) = a1; +goto L44c64c;} +MEM_U32(sp + 44) = a1; +s0 = t6; +L44c624: +//nop; +a0 = MEM_U32(s1 + 0); +a1 = 0x9; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L44c63c; +a3 = 0xa; +L44c63c: +gp = MEM_U32(sp + 32); +s0 = s0 + 0xffffffff; +if (s0 != 0) {//nop; +goto L44c624;} +//nop; +L44c64c: +a2 = MEM_U32(sp + 44); +//nop; +a0 = MEM_U32(s1 + 0); +t7 = a2 & 0x7; +a2 = t7; +a1 = 0x20; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L44c66c; +a3 = 0xa; +L44c66c: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_print_ucode(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44c684: +//print_ucode: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 40) = a0; +s0 = MEM_U32(a0 + 0); +//nop; +s1 = a1; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +a0 = s0; +f_write_char(mem, sp, a0, a1, a2); +goto L44c6c8; +a0 = s0; +L44c6c8: +gp = MEM_U32(sp + 32); +t7 = MEM_U8(s1 + 0); +t9 = 0x10005b40; +t8 = t7 << 2; +a1 = t8 + t9; +//nop; +a0 = s0; +a2 = 0x4; +a3 = zero; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44c6f0; +a3 = zero; +L44c6f0: +v0 = MEM_U8(s1 + 0); +gp = MEM_U32(sp + 32); +t0 = v0 < 0xa0; +if (t0 == 0) {//nop; +goto L44c728;} +//nop; +t3 = 0x1000609c; +t1 = (int)v0 >> 5; +t2 = t1 << 2; +t3 = t3; +t4 = t3 + t2; +t5 = MEM_U32(t4 + 0); +//nop; +t6 = t5 << (v0 & 0x1f); +t0 = (int)t6 < (int)0x0; +L44c728: +if (t0 == 0) {t4 = v0 < 0xa0; +goto L44c790;} +t4 = v0 < 0xa0; +t8 = MEM_U32(sp + 40); +a1 = 0x1000ce5c; +//nop; +s0 = MEM_U32(t8 + 0); +a2 = 0x7; +a3 = 0x7; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44c754; +a0 = s0; +L44c754: +gp = MEM_U32(sp + 32); +t9 = MEM_U8(s1 + 1); +t3 = 0x10005db0; +t1 = t9 & 0x1f; +//nop; +t2 = t1 + t3; +a1 = MEM_U8(t2 + 0); +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L44c780; +a3 = 0xa; +L44c780: +gp = MEM_U32(sp + 32); +v0 = MEM_U8(s1 + 0); +//nop; +t4 = v0 < 0xa0; +L44c790: +if (t4 == 0) {//nop; +goto L44c7bc;} +//nop; +t7 = 0x10006088; +t5 = (int)v0 >> 5; +t6 = t5 << 2; +t7 = t7; +t0 = t7 + t6; +t8 = MEM_U32(t0 + 0); +//nop; +t9 = t8 << (v0 & 0x1f); +t4 = (int)t9 < (int)0x0; +L44c7bc: +if (t4 == 0) {t6 = v0 < 0xa0; +goto L44c820;} +t6 = v0 < 0xa0; +t3 = MEM_U32(sp + 40); +a1 = 0x1000ce54; +//nop; +s0 = MEM_U32(t3 + 0); +a2 = 0x8; +a3 = 0x8; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44c7e8; +a0 = s0; +L44c7e8: +gp = MEM_U32(sp + 32); +t2 = MEM_U8(s1 + 8); +t5 = 0x10005db0; +//nop; +t7 = t2 + t5; +a1 = MEM_U8(t7 + 0); +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L44c810; +a3 = 0xa; +L44c810: +gp = MEM_U32(sp + 32); +v0 = MEM_U8(s1 + 0); +//nop; +t6 = v0 < 0xa0; +L44c820: +if (t6 == 0) {//nop; +goto L44c84c;} +//nop; +t9 = 0x10006074; +t0 = (int)v0 >> 5; +t8 = t0 << 2; +t9 = t9; +t1 = t9 + t8; +t4 = MEM_U32(t1 + 0); +//nop; +t3 = t4 << (v0 & 0x1f); +t6 = (int)t3 < (int)0x0; +L44c84c: +if (t6 == 0) {t4 = v0 < 0xa0; +goto L44c8b8;} +t4 = v0 < 0xa0; +t5 = MEM_U32(sp + 40); +a1 = 0x1000ce4d; +//nop; +s0 = MEM_U32(t5 + 0); +a2 = 0x7; +a3 = 0x7; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44c878; +a0 = s0; +L44c878: +gp = MEM_U32(sp + 32); +t7 = MEM_U8(s1 + 1); +t8 = 0x10005dc4; +t0 = t7 << 24; +t9 = t0 >> 29; +t1 = t9 + t8; +//nop; +a1 = MEM_U8(t1 + 0); +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L44c8a8; +a3 = 0xa; +L44c8a8: +gp = MEM_U32(sp + 32); +v0 = MEM_U8(s1 + 0); +//nop; +t4 = v0 < 0xa0; +L44c8b8: +if (t4 == 0) {//nop; +goto L44c8e8;} +//nop; +t6 = 0x10006060; +t3 = (int)v0 >> 5; +t2 = t3 << 2; +t6 = t6; +t5 = t6 + t2; +t7 = MEM_U32(t5 + 0); +//nop; +t0 = t7 << (v0 & 0x1f); +t9 = (int)t0 < (int)0x0; +t4 = t9; +L44c8e8: +if (t4 == 0) {t1 = v0 < 0xa0; +goto L44c940;} +t1 = v0 < 0xa0; +t8 = MEM_U32(sp + 40); +a1 = 0x1000ce45; +//nop; +s0 = MEM_U32(t8 + 0); +a2 = 0x8; +a3 = 0x8; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44c914; +a0 = s0; +L44c914: +gp = MEM_U32(sp + 32); +a1 = MEM_U16(s1 + 2); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44c930; +a3 = 0xa; +L44c930: +gp = MEM_U32(sp + 32); +v0 = MEM_U8(s1 + 0); +//nop; +t1 = v0 < 0xa0; +L44c940: +if (t1 == 0) {//nop; +goto L44c970;} +//nop; +t2 = 0x1000604c; +t3 = (int)v0 >> 5; +t6 = t3 << 2; +t2 = t2; +t5 = t2 + t6; +t7 = MEM_U32(t5 + 0); +//nop; +t0 = t7 << (v0 & 0x1f); +t9 = (int)t0 < (int)0x0; +t1 = t9; +L44c970: +if (t1 == 0) {t8 = v0 < 0xa0; +goto L44c9c8;} +t8 = v0 < 0xa0; +t4 = MEM_U32(sp + 40); +a1 = 0x1000ce41; +//nop; +s0 = MEM_U32(t4 + 0); +a2 = 0x4; +a3 = 0x4; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44c99c; +a0 = s0; +L44c99c: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(s1 + 4); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44c9b8; +a3 = 0xa; +L44c9b8: +gp = MEM_U32(sp + 32); +v0 = MEM_U8(s1 + 0); +//nop; +t8 = v0 < 0xa0; +L44c9c8: +if (t8 == 0) {t3 = (int)v0 >> 5; +goto L44c9f4;} +t3 = (int)v0 >> 5; +t6 = 0x10006038; +t2 = t3 << 2; +t6 = t6; +t5 = t6 + t2; +t7 = MEM_U32(t5 + 0); +//nop; +t0 = t7 << (v0 & 0x1f); +t9 = (int)t0 < (int)0x0; +t8 = t9; +L44c9f4: +if (t8 == 0) {a2 = 0x9; +goto L44ca44;} +a2 = 0x9; +t1 = MEM_U32(sp + 40); +a1 = 0x1000ce38; +//nop; +s0 = MEM_U32(t1 + 0); +a3 = 0x9; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44ca1c; +a0 = s0; +L44ca1c: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(s1 + 4); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44ca38; +a3 = 0xa; +L44ca38: +gp = MEM_U32(sp + 32); +v0 = MEM_U8(s1 + 0); +//nop; +L44ca44: +t4 = v0 < 0xa0; +if (t4 == 0) {t3 = (int)v0 >> 5; +goto L44ca74;} +t3 = (int)v0 >> 5; +t2 = 0x10006024; +t6 = t3 << 2; +t2 = t2; +t5 = t2 + t6; +t7 = MEM_U32(t5 + 0); +//nop; +t0 = t7 << (v0 & 0x1f); +t9 = (int)t0 < (int)0x0; +t4 = t9; +L44ca74: +if (t4 == 0) {a2 = 0x8; +goto L44cac4;} +a2 = 0x8; +t8 = MEM_U32(sp + 40); +a1 = 0x1000ce30; +//nop; +s0 = MEM_U32(t8 + 0); +a3 = 0x8; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44ca9c; +a0 = s0; +L44ca9c: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(s1 + 8); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44cab8; +a3 = 0xa; +L44cab8: +gp = MEM_U32(sp + 32); +v0 = MEM_U8(s1 + 0); +//nop; +L44cac4: +t1 = v0 < 0xa0; +if (t1 == 0) {t3 = (int)v0 >> 5; +goto L44caf4;} +t3 = (int)v0 >> 5; +t6 = 0x10006010; +t2 = t3 << 2; +t6 = t6; +t5 = t6 + t2; +t7 = MEM_U32(t5 + 0); +//nop; +t0 = t7 << (v0 & 0x1f); +t9 = (int)t0 < (int)0x0; +t1 = t9; +L44caf4: +if (t1 == 0) {a2 = 0x8; +goto L44cb44;} +a2 = 0x8; +t4 = MEM_U32(sp + 40); +a1 = 0x1000ce28; +//nop; +s0 = MEM_U32(t4 + 0); +a3 = 0x8; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44cb1c; +a0 = s0; +L44cb1c: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(s1 + 12); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44cb38; +a3 = 0xa; +L44cb38: +gp = MEM_U32(sp + 32); +v0 = MEM_U8(s1 + 0); +//nop; +L44cb44: +t8 = v0 + 0xffffffe0; +t3 = t8 < 0x80; +if (t3 == 0) {t6 = (int)t8 >> 5; +goto L44cb74;} +t6 = (int)t8 >> 5; +t5 = 0x10006000; +t2 = t6 << 2; +t5 = t5; +t7 = t5 + t2; +t0 = MEM_U32(t7 + 0); +//nop; +t9 = t0 << (t8 & 0x1f); +t3 = (int)t9 < (int)0x0; +L44cb74: +if (t3 == 0) {a2 = 0x9; +goto L44cbc4;} +a2 = 0x9; +t4 = MEM_U32(sp + 40); +a1 = 0x1000ce1f; +//nop; +s0 = MEM_U32(t4 + 0); +a3 = 0x9; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44cb9c; +a0 = s0; +L44cb9c: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(s1 + 16); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44cbb8; +a3 = 0xa; +L44cbb8: +gp = MEM_U32(sp + 32); +v0 = MEM_U8(s1 + 0); +//nop; +L44cbc4: +t6 = v0 < 0x40; +if (t6 == 0) {t5 = (int)v0 >> 5; +goto L44cbf0;} +t5 = (int)v0 >> 5; +t7 = 0x10005ff8; +t2 = t5 << 2; +t7 = t7; +t0 = t7 + t2; +t8 = MEM_U32(t0 + 0); +//nop; +t9 = t8 << (v0 & 0x1f); +t6 = (int)t9 < (int)0x0; +L44cbf0: +if (t6 == 0) {a2 = 0x6; +goto L44ccfc;} +a2 = 0x6; +t3 = MEM_U32(sp + 40); +a1 = 0x1000ce19; +//nop; +s0 = MEM_U32(t3 + 0); +a3 = 0x6; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44cc18; +a0 = s0; +L44cc18: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(s1 + 9); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44cc34; +a3 = 0xa; +L44cc34: +gp = MEM_U32(sp + 32); +t4 = MEM_U32(sp + 40); +a1 = 0x1000ce14; +//nop; +s0 = MEM_U32(t4 + 0); +a2 = 0x5; +a3 = 0x5; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44cc5c; +a0 = s0; +L44cc5c: +gp = MEM_U32(sp + 32); +a1 = MEM_U8(s1 + 8); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44cc78; +a3 = 0xa; +L44cc78: +v0 = MEM_U8(s1 + 0); +gp = MEM_U32(sp + 32); +t5 = v0 < 0x40; +if (t5 == 0) {t7 = (int)v0 >> 5; +goto L44ccac;} +t7 = (int)v0 >> 5; +t0 = 0x10005ff0; +t2 = t7 << 2; +t0 = t0; +t8 = t0 + t2; +t9 = MEM_U32(t8 + 0); +//nop; +t1 = t9 << (v0 & 0x1f); +t5 = (int)t1 < (int)0x0; +L44ccac: +if (t5 == 0) {a2 = 0xa; +goto L44ccfc;} +a2 = 0xa; +t3 = MEM_U32(sp + 40); +a1 = 0x1000ce0a; +//nop; +s0 = MEM_U32(t3 + 0); +a3 = 0xa; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44ccd4; +a0 = s0; +L44ccd4: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(s1 + 12); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44ccf0; +a3 = 0xa; +L44ccf0: +gp = MEM_U32(sp + 32); +v0 = MEM_U8(s1 + 0); +//nop; +L44ccfc: +v1 = v0 & 0xff; +at = 0x10; +if (v1 != at) {at = 0x49; +goto L44ce58;} +at = 0x49; +t4 = MEM_U32(sp + 40); +L44cd10: +a1 = 0x1000ce04; +//nop; +s0 = MEM_U32(t4 + 0); +a2 = 0x6; +a3 = 0x6; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44cd30; +a0 = s0; +L44cd30: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(s1 + 16); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44cd4c; +a3 = 0xa; +L44cd4c: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L44ce64; +ra = MEM_U32(sp + 36); +L44cd58: +t7 = MEM_U8(s1 + 1); +at = 0x5000000; +t0 = t7 & 0x1f; +t2 = t0 < 0x20; +t8 = -t2; +t9 = t8 & at; +t1 = t9 << (t0 & 0x1f); +if ((int)t1 >= 0) {a2 = 0x6; +goto L44ce00;} +a2 = 0x6; +t6 = MEM_U32(sp + 40); +a1 = 0x1000cdf6; +//nop; +s0 = MEM_U32(t6 + 0); +a2 = 0xe; +a3 = 0xe; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44cda0; +a0 = s0; +L44cda0: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(s1 + 16); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44cdbc; +a3 = 0xa; +L44cdbc: +gp = MEM_U32(sp + 32); +a0 = s0; +//nop; +a1 = 0x20; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L44cdd8; +a3 = 0xa; +L44cdd8: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(s1 + 20); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44cdf4; +a3 = 0xa; +L44cdf4: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L44ce64; +ra = MEM_U32(sp + 36); +L44ce00: +t5 = MEM_U32(sp + 40); +a1 = 0x1000cdf0; +//nop; +s0 = MEM_U32(t5 + 0); +a3 = 0x6; +a1 = a1; +a0 = s0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44ce20; +a0 = s0; +L44ce20: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(s1 + 16); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44ce3c; +a3 = 0xa; +L44ce3c: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L44ce64; +ra = MEM_U32(sp + 36); +at = 0x10; +if (v1 == at) {t4 = MEM_U32(sp + 40); +goto L44cd10;} +t4 = MEM_U32(sp + 40); +at = 0x49; +L44ce58: +if (v1 == at) {//nop; +goto L44cd58;} +//nop; +ra = MEM_U32(sp + 36); +L44ce64: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_print_node_1(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L44ce74: +//print_node_1: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 32) = s1; +s1 = a1; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s2; +MEM_U32(sp + 28) = s0; +MEM_U32(sp + 56) = a2; +a1 = MEM_U32(a1 + 16); +s0 = MEM_U32(a0 + 0); +//nop; +s2 = a0; +t6 = a1 >> 8; +a1 = t6; +a2 = 0x6; +a3 = 0xa; +a0 = s0; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44cec8; +a0 = s0; +L44cec8: +gp = MEM_U32(sp + 40); +a0 = s0; +//nop; +a1 = 0x9; +a2 = 0x1; +a3 = 0xa; +f_write_char(mem, sp, a0, a1, a2); +goto L44cee4; +a3 = 0xa; +L44cee4: +gp = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 56); +//nop; +t7 = a1 << 1; +a1 = t7; +a0 = s2; +f_indent_tree(mem, sp, a0, a1); +goto L44cf00; +a0 = s2; +L44cf00: +gp = MEM_U32(sp + 40); +a0 = s2; +//nop; +a1 = s1 + 0x20; +//nop; +f_print_ucode(mem, sp, a0, a1); +goto L44cf18; +//nop; +L44cf18: +t8 = MEM_U16(s1 + 20); +gp = MEM_U32(sp + 40); +at = 0x1; +if (t8 == at) {a2 = 0xb; +goto L44cf6c;} +a2 = 0xb; +s0 = MEM_U32(s2 + 0); +a1 = 0x1000ce97; +//nop; +a3 = 0xb; +a0 = s0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44cf48; +a1 = a1; +L44cf48: +gp = MEM_U32(sp + 40); +a1 = MEM_U16(s1 + 20); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44cf64; +a3 = 0xa; +L44cf64: +gp = MEM_U32(sp + 40); +//nop; +L44cf6c: +t9 = MEM_U8(s1 + 26); +a2 = 0xc; +if (t9 == 0) {a3 = 0xc; +goto L44cfb8;} +a3 = 0xc; +s0 = MEM_U32(s2 + 0); +a1 = 0x1000ce8b; +//nop; +a0 = s0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44cf94; +a1 = a1; +L44cf94: +gp = MEM_U32(sp + 40); +a1 = MEM_U8(s1 + 26); +//nop; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44cfb0; +a3 = 0xa; +L44cfb0: +gp = MEM_U32(sp + 40); +//nop; +L44cfb8: +v0 = MEM_U8(s1 + 25); +a2 = 0xc; +t0 = v0 & 0x1; +if (t0 != 0) {a3 = 0xc; +goto L44cfec;} +a3 = 0xc; +a1 = 0x1000ce7f; +//nop; +a0 = MEM_U32(s2 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44cfe0; +a1 = a1; +L44cfe0: +gp = MEM_U32(sp + 40); +v0 = MEM_U8(s1 + 25); +//nop; +L44cfec: +t1 = v0 << 24; +t2 = t1 >> 25; +at = 0x48; +if (t2 == at) {a2 = 0x5; +goto L44d054;} +a2 = 0x5; +s0 = MEM_U32(s2 + 0); +a1 = 0x1000ce7a; +//nop; +a3 = 0x5; +a0 = s0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44d01c; +a1 = a1; +L44d01c: +gp = MEM_U32(sp + 40); +a1 = MEM_U8(s1 + 25); +a2 = 0x10005dd0; +//nop; +t5 = 0xa; +t3 = a1 << 24; +a1 = t3 >> 25; +MEM_U32(sp + 16) = t5; +a0 = s0; +a3 = zero; +a2 = a2; +f_write_enum(mem, sp, a0, a1, a2, a3); +goto L44d04c; +a2 = a2; +L44d04c: +gp = MEM_U32(sp + 40); +//nop; +L44d054: +t6 = MEM_U32(s1 + 0); +a2 = 0x5; +if (t6 == 0) {a3 = 0x5; +goto L44d0ac;} +a3 = 0x5; +s0 = MEM_U32(s2 + 0); +a1 = 0x1000ce75; +//nop; +a0 = s0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44d07c; +a1 = a1; +L44d07c: +t7 = MEM_U32(s1 + 0); +gp = MEM_U32(sp + 40); +a1 = MEM_U32(t7 + 16); +//nop; +t8 = a1 >> 8; +a1 = t8; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44d0a4; +a3 = 0xa; +L44d0a4: +gp = MEM_U32(sp + 40); +//nop; +L44d0ac: +t9 = MEM_U32(s1 + 4); +a2 = 0x5; +if (t9 == 0) {a3 = 0x5; +goto L44d104;} +a3 = 0x5; +s0 = MEM_U32(s2 + 0); +a1 = 0x1000ce70; +//nop; +a0 = s0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44d0d4; +a1 = a1; +L44d0d4: +t0 = MEM_U32(s1 + 4); +gp = MEM_U32(sp + 40); +a1 = MEM_U32(t0 + 16); +//nop; +t1 = a1 >> 8; +a1 = t1; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44d0fc; +a3 = 0xa; +L44d0fc: +gp = MEM_U32(sp + 40); +//nop; +L44d104: +t2 = MEM_U32(s1 + 8); +a2 = 0x6; +if (t2 == 0) {a3 = 0x6; +goto L44d15c;} +a3 = 0x6; +s0 = MEM_U32(s2 + 0); +a1 = 0x1000ce6a; +//nop; +a0 = s0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44d12c; +a1 = a1; +L44d12c: +t3 = MEM_U32(s1 + 8); +gp = MEM_U32(sp + 40); +a1 = MEM_U32(t3 + 16); +//nop; +t4 = a1 >> 8; +a1 = t4; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44d154; +a3 = 0xa; +L44d154: +gp = MEM_U32(sp + 40); +//nop; +L44d15c: +t5 = MEM_U32(s1 + 12); +a2 = 0x7; +if (t5 == 0) {a3 = 0x7; +goto L44d1b4;} +a3 = 0x7; +s0 = MEM_U32(s2 + 0); +a1 = 0x1000ce63; +//nop; +a0 = s0; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44d184; +a1 = a1; +L44d184: +t6 = MEM_U32(s1 + 12); +gp = MEM_U32(sp + 40); +a1 = MEM_U32(t6 + 16); +//nop; +t7 = a1 >> 8; +a1 = t7; +a0 = s0; +a2 = 0x1; +a3 = 0xa; +f_write_integer(mem, sp, a0, a1, a2, a3); +goto L44d1ac; +a3 = 0xa; +L44d1ac: +gp = MEM_U32(sp + 40); +//nop; +L44d1b4: +//nop; +a0 = MEM_U32(s2 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44d1c4; +//nop; +L44d1c4: +ra = MEM_U32(sp + 44); +gp = MEM_U32(sp + 40); +s0 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 32); +s2 = MEM_U32(sp + 36); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void f_print_node(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44d1e0: +//print_node: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +a2 = zero; +f_print_node_1(mem, sp, a0, a1, a2); +goto L44d204; +a2 = zero; +L44d204: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void func_44d214(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44d214: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a0; +s1 = v0; +s3 = a1; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +if (a0 == 0) {MEM_U32(sp + 32) = s2; +goto L44d388;} +MEM_U32(sp + 32) = s2; +L44d24c: +v0 = MEM_U32(s1 + -4); +t6 = MEM_U8(s0 + 23); +a1 = s0; +if (v0 == t6) {ra = MEM_U32(sp + 44); +goto L44d38c;} +ra = MEM_U32(sp + 44); +MEM_U8(s0 + 23) = (uint8_t)v0; +//nop; +s2 = MEM_U32(s1 + 8); +a0 = MEM_U32(s1 + 0); +a2 = s3; +f_print_node_1(mem, sp, a0, a1, a2); +goto L44d278; +a2 = s3; +L44d278: +gp = MEM_U32(sp + 40); +at = s3 < s2; +if (at == 0) {//nop; +goto L44d35c;} +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +if (a0 == 0) {//nop; +goto L44d2f4;} +//nop; +t7 = MEM_U8(s0 + 32); +//nop; +t8 = t7 < 0x80; +if (t8 == 0) {//nop; +goto L44d2d0;} +//nop; +t1 = 0x100060c4; +t9 = (int)t7 >> 5; +t0 = t9 << 2; +t1 = t1; +t2 = t1 + t0; +t3 = MEM_U32(t2 + 0); +//nop; +t4 = t3 << (t7 & 0x1f); +t8 = (int)t4 < (int)0x0; +L44d2d0: +if (t8 != 0) {//nop; +goto L44d2f4;} +//nop; +//nop; +a1 = s3 + 0x1; +t9 = t9; +v0 = s1; +func_44d214(mem, sp, v0, a0, a1); +goto L44d2ec; +v0 = s1; +L44d2ec: +gp = MEM_U32(sp + 40); +//nop; +L44d2f4: +a0 = MEM_U32(s0 + 4); +//nop; +if (a0 == 0) {//nop; +goto L44d35c;} +//nop; +t6 = MEM_U8(s0 + 32); +//nop; +t9 = t6 < 0xa0; +if (t9 == 0) {t1 = (int)t6 >> 5; +goto L44d338;} +t1 = (int)t6 >> 5; +t2 = 0x100060b0; +t0 = t1 << 2; +t2 = t2; +t3 = t2 + t0; +t7 = MEM_U32(t3 + 0); +//nop; +t4 = t7 << (t6 & 0x1f); +t9 = (int)t4 < (int)0x0; +L44d338: +if (t9 != 0) {//nop; +goto L44d35c;} +//nop; +//nop; +a1 = s3 + 0x1; +t9 = t9; +v0 = s1; +func_44d214(mem, sp, v0, a0, a1); +goto L44d354; +v0 = s1; +L44d354: +gp = MEM_U32(sp + 40); +//nop; +L44d35c: +v0 = MEM_U32(s1 + -8); +t8 = MEM_U32(s1 + 12); +t1 = v0 + 0x1; +at = v0 < t8; +if (at == 0) {ra = MEM_U32(sp + 44); +goto L44d38c;} +ra = MEM_U32(sp + 44); +MEM_U32(s1 + -8) = t1; +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 != 0) {//nop; +goto L44d24c;} +//nop; +L44d388: +ra = MEM_U32(sp + 44); +L44d38c: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void f_print_tree(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L44d3a4: +//print_tree: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +v0 = f_next_mark(mem, sp); +goto L44d3d4; +MEM_U32(sp + 52) = a3; +L44d3d4: +gp = MEM_U32(sp + 24); +MEM_U32(sp + 36) = v0; +//nop; +a0 = MEM_U32(sp + 44); +t9 = t9; +MEM_U32(sp + 32) = zero; +v0 = sp + 0x28; +a1 = zero; +func_44d214(mem, sp, v0, a0, a1); +goto L44d3f8; +a1 = zero; +L44d3f8: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_initialize_tree(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44d450: +//initialize_tree: +//nop; +//nop; +//nop; +at = 0x1001a54c; +t6 = 0x1f; +MEM_U32(at + 0) = zero; +at = 0x1001a550; +//nop; +MEM_U32(at + 0) = zero; +at = 0x1001a554; +MEM_U32(at + 0) = t6; +return; +MEM_U32(at + 0) = t6; +} + +static uint32_t f_gen_label_id(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44d480: +//gen_label_id: +//nop; +//nop; +//nop; +a0 = 0x1001a554; +//nop; +t6 = MEM_U32(a0 + 0); +//nop; +v0 = t6 + 0x1; +MEM_U32(a0 + 0) = v0; +return v0; +MEM_U32(a0 + 0) = v0; +} + +static uint32_t f_new_tree(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44d4a8: +//new_tree: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 28) = ra; +a1 = 0x10019378; +MEM_U32(sp + 24) = gp; +a0 = 0x40; +v0 = f_alloc_new(mem, sp, a0, a1); +goto L44d4d0; +a0 = 0x40; +L44d4d0: +gp = MEM_U32(sp + 24); +MEM_U32(sp + 32) = v0; +a0 = 0x1001a550; +t3 = 0x1; +t6 = MEM_U32(a0 + 0); +at = 0xfffffffe; +t7 = t6 + 0x1; +MEM_U32(a0 + 0) = t7; +v1 = MEM_U32(v0 + 16); +t4 = MEM_U8(v0 + 25); +t9 = v1 >> 8; +t0 = t7 ^ t9; +t1 = t0 << 8; +t5 = t4 & 0xff01; +t7 = 0x1001a54c; +t6 = t5 | 0x90; +t2 = t1 ^ v1; +MEM_U32(v0 + 16) = t2; +MEM_U32(v0 + 8) = zero; +MEM_U32(v0 + 12) = zero; +MEM_U32(v0 + 0) = zero; +MEM_U32(v0 + 4) = zero; +MEM_U16(v0 + 20) = (uint16_t)t3; +MEM_U8(v0 + 26) = (uint8_t)zero; +MEM_U8(v0 + 25) = (uint8_t)t6; +MEM_U8(v0 + 24) = (uint8_t)zero; +MEM_U8(v0 + 22) = (uint8_t)zero; +t7 = MEM_U32(t7 + 0); +t8 = t6 & 0xff; +t1 = 0x100060e0; +t9 = t8 & at; +t0 = 0x60; +MEM_U8(v0 + 25) = (uint8_t)t9; +MEM_U8(v0 + 32) = (uint8_t)t0; +MEM_U16(v0 + 34) = (uint16_t)zero; +MEM_U32(v0 + 48) = zero; +MEM_U8(v0 + 23) = (uint8_t)t7; +t1 = MEM_U32(t1 + 0); +t3 = t2 >> 8; +if (t1 != t3) {a2 = 0x8; +goto L44d5b4;} +a2 = 0x8; +a0 = 0x10006560; +a1 = 0x1000ceb0; +//nop; +a0 = MEM_U32(a0 + 0); +a3 = 0x8; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44d590; +a1 = a1; +L44d590: +gp = MEM_U32(sp + 24); +//nop; +a0 = 0x10006560; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44d5ac; +//nop; +L44d5ac: +gp = MEM_U32(sp + 24); +//nop; +L44d5b4: +ra = MEM_U32(sp + 28); +v0 = MEM_U32(sp + 32); +sp = sp + 0x28; +return v0; +sp = sp + 0x28; +} + +static uint32_t f_build_u(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44d5c4: +//build_u: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +v0 = f_new_tree(mem, sp); +goto L44d5e8; +MEM_U32(sp + 32) = a0; +L44d5e8: +t6 = MEM_U32(sp + 32); +gp = MEM_U32(sp + 24); +at = MEM_U32(t6 + 0); +//nop; +MEM_U32(v0 + 32) = at; +t9 = MEM_U32(t6 + 4); +//nop; +MEM_U32(v0 + 36) = t9; +at = MEM_U32(t6 + 8); +//nop; +MEM_U32(v0 + 40) = at; +t9 = MEM_U32(t6 + 12); +//nop; +MEM_U32(v0 + 44) = t9; +at = MEM_U32(t6 + 16); +//nop; +MEM_U32(v0 + 48) = at; +t9 = MEM_U32(t6 + 20); +//nop; +MEM_U32(v0 + 52) = t9; +at = MEM_U32(t6 + 24); +//nop; +MEM_U32(v0 + 56) = at; +t9 = MEM_U32(t6 + 28); +//nop; +MEM_U32(v0 + 60) = t9; +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return v0; +//nop; +} + +static uint32_t f_build_u1(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44d660: +//build_u1: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +v0 = f_new_tree(mem, sp); +goto L44d688; +MEM_U32(sp + 36) = a1; +L44d688: +t6 = MEM_U32(sp + 32); +gp = MEM_U32(sp + 24); +at = MEM_U32(t6 + 0); +//nop; +MEM_U32(v0 + 32) = at; +t9 = MEM_U32(t6 + 4); +//nop; +MEM_U32(v0 + 36) = t9; +at = MEM_U32(t6 + 8); +//nop; +MEM_U32(v0 + 40) = at; +t9 = MEM_U32(t6 + 12); +//nop; +MEM_U32(v0 + 44) = t9; +at = MEM_U32(t6 + 16); +//nop; +MEM_U32(v0 + 48) = at; +t9 = MEM_U32(t6 + 20); +//nop; +MEM_U32(v0 + 52) = t9; +at = MEM_U32(t6 + 24); +//nop; +MEM_U32(v0 + 56) = at; +t9 = MEM_U32(t6 + 28); +//nop; +MEM_U32(v0 + 60) = t9; +t0 = MEM_U32(sp + 36); +//nop; +MEM_U32(v0 + 0) = t0; +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return v0; +//nop; +} + +static uint32_t f_build_u2(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L44d70c: +//build_u2: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +v0 = f_new_tree(mem, sp); +goto L44d738; +MEM_U32(sp + 40) = a2; +L44d738: +t6 = MEM_U32(sp + 32); +gp = MEM_U32(sp + 24); +at = MEM_U32(t6 + 0); +//nop; +MEM_U32(v0 + 32) = at; +t9 = MEM_U32(t6 + 4); +//nop; +MEM_U32(v0 + 36) = t9; +at = MEM_U32(t6 + 8); +//nop; +MEM_U32(v0 + 40) = at; +t9 = MEM_U32(t6 + 12); +//nop; +MEM_U32(v0 + 44) = t9; +at = MEM_U32(t6 + 16); +//nop; +MEM_U32(v0 + 48) = at; +t9 = MEM_U32(t6 + 20); +//nop; +MEM_U32(v0 + 52) = t9; +at = MEM_U32(t6 + 24); +//nop; +MEM_U32(v0 + 56) = at; +t9 = MEM_U32(t6 + 28); +//nop; +MEM_U32(v0 + 60) = t9; +t0 = MEM_U32(sp + 36); +//nop; +MEM_U32(v0 + 0) = t0; +t1 = MEM_U32(sp + 40); +//nop; +MEM_U32(v0 + 4) = t1; +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return v0; +//nop; +} + +static uint32_t f_build_op(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44d7c8: +//build_op: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +v0 = f_new_tree(mem, sp); +goto L44d7ec; +MEM_U32(sp + 32) = a0; +L44d7ec: +t6 = MEM_U8(sp + 35); +gp = MEM_U32(sp + 24); +MEM_U8(v0 + 32) = (uint8_t)t6; +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return v0; +//nop; +} + +static uint32_t f_build_1op(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44d808: +//build_1op: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +v0 = f_new_tree(mem, sp); +goto L44d830; +MEM_U32(sp + 36) = a1; +L44d830: +a1 = MEM_U32(sp + 36); +t6 = MEM_U8(sp + 35); +gp = MEM_U32(sp + 24); +MEM_U8(v0 + 32) = (uint8_t)t6; +v1 = MEM_U8(a1 + 32); +a0 = v0; +goto L44d88c; +a0 = v0; +L44d84c: +t7 = MEM_U8(v0 + 33); +at = 0xffffffe0; +t8 = t7 & at; +t9 = t8 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t9; +goto L44d938; +MEM_U8(v0 + 33) = (uint8_t)t9; +L44d864: +v1 = MEM_U8(v0 + 33); +t0 = 0x10019348; +t1 = v1 << 27; +t0 = MEM_U8(t0 + 0); +t2 = t1 >> 27; +t3 = t0 ^ t2; +t4 = t3 & 0x1f; +t5 = t4 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t5; +goto L44d938; +MEM_U8(v0 + 33) = (uint8_t)t5; +L44d88c: +at = v1 < 0x48; +if (at != 0) {at = v1 < 0x4f; +goto L44d8b0;} +at = v1 < 0x4f; +if (at != 0) {at = 0x5f; +goto L44d924;} +at = 0x5f; +if (v1 == at) {//nop; +goto L44d84c;} +//nop; +v1 = MEM_U8(v0 + 33); +goto L44d904; +v1 = MEM_U8(v0 + 33); +L44d8b0: +at = 0x23; +if (v1 == at) {//nop; +goto L44d84c;} +//nop; +at = v1 < 0x3b; +if (at == 0) {t6 = v1 + 0xffffffd8; +goto L44d8f4;} +t6 = v1 + 0xffffffd8; +at = t6 < 0x13; +if (at == 0) {//nop; +goto L44d900;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000ceb8[] = { +&&L44d84c, +&&L44d84c, +&&L44d900, +&&L44d900, +&&L44d900, +&&L44d900, +&&L44d84c, +&&L44d84c, +&&L44d84c, +&&L44d900, +&&L44d900, +&&L44d900, +&&L44d84c, +&&L44d84c, +&&L44d900, +&&L44d900, +&&L44d84c, +&&L44d900, +&&L44d84c, +}; +dest = Lswitch1000ceb8[t6]; +//nop; +goto *dest; +//nop; +L44d8f4: +at = 0x47; +if (v1 == at) {//nop; +goto L44d864;} +//nop; +L44d900: +v1 = MEM_U8(v0 + 33); +L44d904: +t8 = MEM_U8(a1 + 33); +t9 = v1 << 27; +t1 = t9 >> 27; +t0 = t8 ^ t1; +t2 = t0 & 0x1f; +t3 = t2 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t3; +goto L44d938; +MEM_U8(v0 + 33) = (uint8_t)t3; +L44d924: +at = v1 < 0x4d; +if (at == 0) {//nop; +goto L44d84c;} +//nop; +v1 = MEM_U8(v0 + 33); +goto L44d904; +v1 = MEM_U8(v0 + 33); +L44d938: +MEM_U32(a0 + 0) = a1; +t4 = MEM_U32(a1 + 40); +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +v0 = a0; +MEM_U32(a0 + 40) = t4; +return v0; +MEM_U32(a0 + 40) = t4; +} + +static uint32_t f_build_2op(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L44d954: +//build_2op: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 40) = a2; +MEM_U32(sp + 36) = a1; +v0 = f_new_tree(mem, sp); +goto L44d980; +MEM_U32(sp + 36) = a1; +L44d980: +v1 = MEM_U8(sp + 35); +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 36); +at = 0x88; +a0 = v0; +if (v1 == at) {MEM_U8(v0 + 32) = (uint8_t)v1; +goto L44daa0;} +MEM_U8(v0 + 32) = (uint8_t)v1; +v1 = MEM_U8(a1 + 32); +at = v1 < 0x48; +goto L44d9e8; +at = v1 < 0x48; +L44d9a8: +t6 = MEM_U8(v0 + 33); +//nop; +t7 = t6 & 0xffe0; +t8 = t7 | 0x8; +MEM_U8(v0 + 33) = (uint8_t)t8; +goto L44da94; +MEM_U8(v0 + 33) = (uint8_t)t8; +L44d9c0: +v1 = MEM_U8(v0 + 33); +t9 = 0x10019348; +t0 = v1 << 27; +t9 = MEM_U8(t9 + 0); +t1 = t0 >> 27; +t2 = t9 ^ t1; +t3 = t2 & 0x1f; +t4 = t3 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t4; +goto L44da94; +MEM_U8(v0 + 33) = (uint8_t)t4; +L44d9e8: +if (at != 0) {at = v1 < 0x4f; +goto L44da08;} +at = v1 < 0x4f; +if (at != 0) {at = 0x5f; +goto L44da80;} +at = 0x5f; +if (v1 == at) {//nop; +goto L44d9a8;} +//nop; +v1 = MEM_U8(v0 + 33); +goto L44da5c; +v1 = MEM_U8(v0 + 33); +L44da08: +at = 0x23; +if (v1 == at) {//nop; +goto L44d9a8;} +//nop; +at = v1 < 0x3b; +if (at == 0) {t5 = v1 + 0xffffffd8; +goto L44da4c;} +t5 = v1 + 0xffffffd8; +at = t5 < 0x13; +if (at == 0) {//nop; +goto L44da58;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000cf04[] = { +&&L44d9a8, +&&L44d9a8, +&&L44da58, +&&L44da58, +&&L44da58, +&&L44da58, +&&L44d9a8, +&&L44d9a8, +&&L44d9a8, +&&L44da58, +&&L44da58, +&&L44da58, +&&L44d9a8, +&&L44d9a8, +&&L44da58, +&&L44da58, +&&L44d9a8, +&&L44da58, +&&L44d9a8, +}; +dest = Lswitch1000cf04[t5]; +//nop; +goto *dest; +//nop; +L44da4c: +at = 0x47; +if (v1 == at) {//nop; +goto L44d9c0;} +//nop; +L44da58: +v1 = MEM_U8(v0 + 33); +L44da5c: +t6 = MEM_U8(a1 + 33); +t8 = v1 << 27; +t0 = t8 >> 27; +t7 = t6 & 0x1f; +t9 = t7 ^ t0; +t1 = t9 & 0x1f; +t2 = t1 ^ v1; +MEM_U8(v0 + 33) = (uint8_t)t2; +goto L44da94; +MEM_U8(v0 + 33) = (uint8_t)t2; +L44da80: +at = v1 < 0x4d; +if (at == 0) {//nop; +goto L44d9a8;} +//nop; +v1 = MEM_U8(v0 + 33); +goto L44da5c; +v1 = MEM_U8(v0 + 33); +L44da94: +t3 = MEM_U32(a1 + 40); +//nop; +MEM_U32(v0 + 40) = t3; +L44daa0: +t4 = MEM_U32(sp + 40); +ra = MEM_U32(sp + 28); +MEM_U32(a0 + 0) = a1; +sp = sp + 0x20; +v0 = a0; +MEM_U32(a0 + 4) = t4; +return v0; +MEM_U32(a0 + 4) = t4; +} + +static void f_free_node(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44dabc: +//free_node: +MEM_U32(sp + 0) = a0; +return; +MEM_U32(sp + 0) = a0; +} + +static void f_free_tree(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44dac4: +//free_tree: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 24) = s0; +s0 = a0; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s1; +L44dae8: +t6 = MEM_U16(s0 + 20); +//nop; +t7 = t6 + 0xffffffff; +t8 = t7 & 0xffff; +if (t8 != 0) {MEM_U16(s0 + 20) = (uint16_t)t7; +goto L44dbe4;} +MEM_U16(s0 + 20) = (uint16_t)t7; +a0 = MEM_U32(s0 + 0); +//nop; +if (a0 == 0) {//nop; +goto L44db64;} +//nop; +t9 = MEM_U8(s0 + 32); +//nop; +t0 = t9 < 0x80; +if (t0 == 0) {t1 = (int)t9 >> 5; +goto L44db44;} +t1 = (int)t9 >> 5; +t3 = 0x100060f8; +t2 = t1 << 2; +t3 = t3; +t4 = t3 + t2; +t5 = MEM_U32(t4 + 0); +//nop; +t6 = t5 << (t9 & 0x1f); +t0 = (int)t6 < (int)0x0; +L44db44: +if (t0 != 0) {//nop; +goto L44db64;} +//nop; +//nop; +//nop; +//nop; +f_free_tree(mem, sp, a0); +goto L44db5c; +//nop; +L44db5c: +gp = MEM_U32(sp + 32); +//nop; +L44db64: +a0 = MEM_U32(s0 + 4); +//nop; +if (a0 == 0) {//nop; +goto L44dbc8;} +//nop; +t8 = MEM_U8(s0 + 32); +//nop; +t1 = t8 < 0xa0; +if (t1 == 0) {t3 = (int)t8 >> 5; +goto L44dba8;} +t3 = (int)t8 >> 5; +t4 = 0x100060e4; +t2 = t3 << 2; +t4 = t4; +t5 = t4 + t2; +t9 = MEM_U32(t5 + 0); +//nop; +t6 = t9 << (t8 & 0x1f); +t1 = (int)t6 < (int)0x0; +L44dba8: +if (t1 != 0) {//nop; +goto L44dbc8;} +//nop; +//nop; +//nop; +//nop; +f_free_tree(mem, sp, a0); +goto L44dbc0; +//nop; +L44dbc0: +gp = MEM_U32(sp + 32); +//nop; +L44dbc8: +//nop; +s1 = MEM_U32(s0 + 8); +a0 = s0; +f_free_node(mem, sp, a0); +goto L44dbd8; +a0 = s0; +L44dbd8: +gp = MEM_U32(sp + 32); +if (s1 != 0) {s0 = s1; +goto L44dae8;} +s0 = s1; +L44dbe4: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_delete_statement(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44dbf8: +//delete_statement: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +a2 = MEM_U32(a0 + 0); +a1 = a0; +if (a2 == 0) {//nop; +goto L44dc78;} +//nop; +t6 = MEM_U8(a0 + 32); +//nop; +t7 = t6 < 0x80; +if (t7 == 0) {t8 = (int)t6 >> 5; +goto L44dc54;} +t8 = (int)t6 >> 5; +t0 = 0x1000611c; +t9 = t8 << 2; +t0 = t0; +t1 = t0 + t9; +t2 = MEM_U32(t1 + 0); +//nop; +t3 = t2 << (t6 & 0x1f); +t7 = (int)t3 < (int)0x0; +L44dc54: +if (t7 != 0) {//nop; +goto L44dc78;} +//nop; +//nop; +a0 = a2; +MEM_U32(sp + 32) = a1; +f_free_tree(mem, sp, a0); +goto L44dc6c; +MEM_U32(sp + 32) = a1; +L44dc6c: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +L44dc78: +a0 = MEM_U32(a1 + 4); +//nop; +if (a0 == 0) {ra = MEM_U32(sp + 28); +goto L44dce4;} +ra = MEM_U32(sp + 28); +t5 = MEM_U8(a1 + 32); +//nop; +t8 = t5 < 0xa0; +if (t8 == 0) {t0 = (int)t5 >> 5; +goto L44dcbc;} +t0 = (int)t5 >> 5; +t1 = 0x10006108; +t9 = t0 << 2; +t1 = t1; +t2 = t1 + t9; +t6 = MEM_U32(t2 + 0); +//nop; +t3 = t6 << (t5 & 0x1f); +t8 = (int)t3 < (int)0x0; +L44dcbc: +if (t8 != 0) {ra = MEM_U32(sp + 28); +goto L44dce4;} +ra = MEM_U32(sp + 28); +//nop; +MEM_U32(sp + 32) = a1; +//nop; +f_free_tree(mem, sp, a0); +goto L44dcd4; +//nop; +L44dcd4: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +ra = MEM_U32(sp + 28); +L44dce4: +t7 = 0x60; +MEM_U32(a1 + 0) = zero; +MEM_U32(a1 + 4) = zero; +MEM_U8(a1 + 32) = (uint8_t)t7; +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static uint32_t f_dup_tree(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44dcfc: +//dup_tree: +//nop; +//nop; +//nop; +sp = sp + 0xffffff48; +//nop; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 172) = s0; +s0 = a0; +MEM_U32(sp + 176) = gp; +v0 = f_is_constant(mem, sp, a0); +goto L44dd24; +MEM_U32(sp + 176) = gp; +L44dd24: +gp = MEM_U32(sp + 176); +if (v0 == 0) {//nop; +goto L44dd90;} +//nop; +a0 = MEM_U8(s0 + 33); +at = 0x5010000; +t6 = a0 & 0x1f; +t7 = t6 < 0x20; +t8 = -t7; +t9 = t8 & at; +t0 = t9 << (t6 & 0x1f); +if ((int)t0 >= 0) {a0 = t6; +goto L44dd74;} +a0 = t6; +//nop; +a1 = MEM_U32(s0 + 48); +a2 = MEM_U32(s0 + 52); +//nop; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L44dd68; +//nop; +L44dd68: +gp = MEM_U32(sp + 176); +v1 = v0; +goto L44deb8; +v1 = v0; +L44dd74: +//nop; +a2 = MEM_U32(s0 + 48); +a1 = zero; +v0 = f_ivalue(mem, sp, a0, a1, a2); +goto L44dd84; +a1 = zero; +L44dd84: +gp = MEM_U32(sp + 176); +v1 = v0; +goto L44deb8; +v1 = v0; +L44dd90: +v0 = MEM_U16(s0 + 20); +at = 0xffff; +if (v0 != at) {t9 = v0 + 0x1; +goto L44deb0;} +t9 = v0 + 0x1; +t1 = 0x1000cfa0; +a0 = 0x4; +t1 = t1; +t3 = t1 + 0x48; +a1 = 0x12c; +t4 = sp; +L44ddb8: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t4 = t4 + 0xc; +MEM_U8(t4 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t4) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t4 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 4 + 3) = (uint8_t)(at >> 0); +if (t1 != t3) {//swr $at, 7($t4) +goto L44ddb8;} +//swr $at, 7($t4) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t5 = 0x1000cf50; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +t5 = t5; +MEM_U8(t4 + 12 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 12 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 12 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 12 + 3) = (uint8_t)(t3 >> 0); +t7 = t5 + 0x48; +t8 = sp; +//swr $t3, 0xf($t4) +L44de28: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t8 = t8 + 0xc; +MEM_U8(t8 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t8) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t8 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 84 + 3) = (uint8_t)(at >> 0); +if (t5 != t7) {//swr $at, 0x57($t8) +goto L44de28;} +//swr $at, 0x57($t8) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +//nop; +MEM_U8(t8 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t8 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t8 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t8 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t8) +t7 = t5 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t5) +//nop; +MEM_U8(t8 + 92 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(t8 + 92 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(t8 + 92 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(t8 + 92 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x5f($t8) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44dea4; +//nop; +L44dea4: +gp = MEM_U32(sp + 176); +v1 = s0; +goto L44deb8; +v1 = s0; +L44deb0: +MEM_U16(s0 + 20) = (uint16_t)t9; +v1 = s0; +L44deb8: +ra = MEM_U32(sp + 180); +s0 = MEM_U32(sp + 172); +sp = sp + 0xb8; +v0 = v1; +return v0; +v0 = v1; +} + +static uint32_t f_next_mark(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44decc: +//next_mark: +//nop; +//nop; +//nop; +a0 = 0x1001a54c; +//nop; +t6 = MEM_U32(a0 + 0); +//nop; +t7 = t6 + 0x1; +v0 = t7 & 0xff; +MEM_U32(a0 + 0) = v0; +return v0; +MEM_U32(a0 + 0) = v0; +} + +static uint32_t f_ivalue(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L44def8: +//ivalue: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +v0 = f_new_tree(mem, sp); +goto L44df24; +MEM_U32(sp + 40) = a2; +L44df24: +v1 = MEM_U8(v0 + 33); +a1 = MEM_U8(sp + 35); +t7 = v1 << 27; +t8 = t7 >> 27; +t2 = a1 < 0x20; +t3 = -t2; +at = 0x5010000; +t9 = a1 ^ t8; +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 40); +t0 = t9 & 0x1f; +t4 = t3 & at; +t6 = 0x49; +t1 = t0 ^ v1; +t5 = t4 << (a1 & 0x1f); +a0 = v0; +MEM_U8(v0 + 32) = (uint8_t)t6; +if ((int)t5 >= 0) {MEM_U8(v0 + 33) = (uint8_t)t1; +goto L44df88;} +MEM_U8(v0 + 33) = (uint8_t)t1; +MEM_U32(v0 + 52) = a2; +t6 = MEM_U32(sp + 36); +t7 = 0x8; +MEM_U32(v0 + 40) = t7; +MEM_U32(v0 + 48) = t6; +goto L44df94; +MEM_U32(v0 + 48) = t6; +L44df88: +t8 = 0x4; +MEM_U32(v0 + 48) = a2; +MEM_U32(v0 + 40) = t8; +L44df94: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +v0 = a0; +return v0; +v0 = a0; +} + +static uint32_t f_dwvalue(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L44dfa4: +//dwvalue: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 40) = a2; +MEM_U32(sp + 44) = a3; +v0 = f_new_tree(mem, sp); +goto L44dfd0; +MEM_U32(sp + 44) = a3; +L44dfd0: +v1 = MEM_U8(v0 + 33); +a1 = MEM_U8(sp + 35); +t7 = v1 << 27; +t8 = t7 >> 27; +t2 = a1 < 0x20; +t3 = -t2; +at = 0x5010000; +t9 = a1 ^ t8; +gp = MEM_U32(sp + 24); +t0 = t9 & 0x1f; +t4 = t3 & at; +t6 = 0x49; +t1 = t0 ^ v1; +t5 = t4 << (a1 & 0x1f); +a0 = v0; +MEM_U8(v0 + 32) = (uint8_t)t6; +if ((int)t5 >= 0) {MEM_U8(v0 + 33) = (uint8_t)t1; +goto L44e034;} +MEM_U8(v0 + 33) = (uint8_t)t1; +t6 = MEM_U32(sp + 40); +t7 = MEM_U32(sp + 44); +t8 = 0x8; +MEM_U32(v0 + 40) = t8; +MEM_U32(v0 + 48) = t6; +MEM_U32(v0 + 52) = t7; +goto L44e044; +MEM_U32(v0 + 52) = t7; +L44e034: +t9 = MEM_U32(sp + 44); +t2 = 0x4; +MEM_U32(v0 + 40) = t2; +MEM_U32(v0 + 48) = t9; +L44e044: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +v0 = a0; +return v0; +v0 = a0; +} + +static uint32_t f_rvalue(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L44e054: +//rvalue: +//nop; +//nop; +//nop; +sp = sp + 0xffffff28; +//nop; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 216) = a0; +MEM_U32(sp + 220) = a1; +MEM_U32(sp + 224) = a2; +MEM_U32(sp + 228) = a3; +v0 = f_new_tree(mem, sp); +goto L44e084; +MEM_U32(sp + 228) = a3; +L44e084: +v1 = MEM_U8(v0 + 33); +a0 = MEM_U8(sp + 219); +t7 = v1 << 27; +t8 = t7 >> 27; +gp = MEM_U32(sp + 176); +t9 = a0 ^ t8; +t1 = t9 & 0x1f; +t6 = 0x49; +t3 = 0x4; +at = 0xc; +t2 = t1 ^ v1; +t0 = v0; +MEM_U8(v0 + 32) = (uint8_t)t6; +MEM_U8(v0 + 33) = (uint8_t)t2; +if (a0 != at) {MEM_U32(v0 + 40) = t3; +goto L44e0cc;} +MEM_U32(v0 + 40) = t3; +t4 = 0x8; +MEM_U32(v0 + 40) = t4; +L44e0cc: +t5 = MEM_U8(sp + 220); +a0 = 0x20; +if (a0 == t5) {v1 = 0x1; +goto L44e0f0;} +v1 = 0x1; +v0 = sp + 0xdc; +L44e0e0: +t6 = MEM_U8(v0 + 1); +v1 = v1 + 0x1; +if (a0 != t6) {v0 = v0 + 0x1; +goto L44e0e0;} +v0 = v0 + 0x1; +L44e0f0: +//nop; +a2 = v1 + 0xffffffff; +MEM_U32(t0 + 48) = a2; +MEM_U32(sp + 184) = a2; +a0 = 0x400; +a1 = zero; +MEM_U32(sp + 208) = t0; +v0 = f_new(mem, sp, a0, a1); +goto L44e110; +MEM_U32(sp + 208) = t0; +L44e110: +t0 = MEM_U32(sp + 208); +gp = MEM_U32(sp + 176); +a2 = MEM_U32(sp + 184); +if (v0 != 0) {MEM_U32(t0 + 52) = v0; +goto L44e238;} +MEM_U32(t0 + 52) = v0; +t7 = 0x1000d040; +a0 = 0x4; +t7 = t7; +t9 = t7 + 0x48; +a1 = 0x179; +t1 = sp; +L44e13c: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t1 = t1 + 0xc; +MEM_U8(t1 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t1) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t1 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t9) {//swr $at, 7($t1) +goto L44e13c;} +//swr $at, 7($t1) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t2 = 0x1000cff0; +MEM_U8(t1 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t1 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t1 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t1 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t1) +t9 = t7 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t7) +t2 = t2; +MEM_U8(t1 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t1 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t1 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t1 + 12 + 3) = (uint8_t)(t9 >> 0); +t4 = t2 + 0x48; +t5 = sp; +//swr $t9, 0xf($t1) +L44e1ac: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t5 = t5 + 0xc; +MEM_U8(t5 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t5) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t5 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 84 + 3) = (uint8_t)(at >> 0); +if (t2 != t4) {//swr $at, 0x57($t5) +goto L44e1ac;} +//swr $at, 0x57($t5) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +//nop; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +t4 = t2 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t2) +//nop; +MEM_U8(t5 + 92 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t5 + 92 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t5 + 92 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t5 + 92 + 3) = (uint8_t)(t4 >> 0); +//swr $t4, 0x5f($t5) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +MEM_U32(sp + 208) = t0; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44e228; +MEM_U32(sp + 208) = t0; +L44e228: +gp = MEM_U32(sp + 176); +t0 = MEM_U32(sp + 208); +ra = MEM_U32(sp + 180); +goto L44e2d4; +ra = MEM_U32(sp + 180); +L44e238: +if (a2 == 0) {a1 = a2 + 0x1; +goto L44e2d0;} +a1 = a2 + 0x1; +a2 = a1 + 0xffffffff; +t6 = a2 & 0x3; +if (t6 == 0) {v1 = 0x1; +goto L44e27c;} +v1 = 0x1; +t8 = sp + 0xdb; +v0 = v1 + t8; +a0 = t6 + 0x1; +L44e25c: +t7 = MEM_U32(t0 + 52); +t9 = MEM_U8(v0 + 0); +t1 = t7 + v1; +v1 = v1 + 0x1; +v0 = v0 + 0x1; +if (a0 != v1) {MEM_U8(t1 + -1) = (uint8_t)t9; +goto L44e25c;} +MEM_U8(t1 + -1) = (uint8_t)t9; +if (v1 == a1) {t3 = sp + 0xdb; +goto L44e2d0;} +L44e27c: +t3 = sp + 0xdb; +v0 = v1 + t3; +L44e284: +t2 = MEM_U32(t0 + 52); +t4 = MEM_U8(v0 + 0); +t5 = t2 + v1; +MEM_U8(t5 + -1) = (uint8_t)t4; +t8 = MEM_U32(t0 + 52); +t6 = MEM_U8(v0 + 1); +t7 = t8 + v1; +MEM_U8(t7 + 0) = (uint8_t)t6; +t1 = MEM_U32(t0 + 52); +t9 = MEM_U8(v0 + 2); +t3 = t1 + v1; +MEM_U8(t3 + 1) = (uint8_t)t9; +t4 = MEM_U32(t0 + 52); +t2 = MEM_U8(v0 + 3); +t5 = t4 + v1; +v1 = v1 + 0x4; +v0 = v0 + 0x4; +if (v1 != a1) {MEM_U8(t5 + 2) = (uint8_t)t2; +goto L44e284;} +MEM_U8(t5 + 2) = (uint8_t)t2; +L44e2d0: +ra = MEM_U32(sp + 180); +L44e2d4: +sp = sp + 0xd8; +v0 = t0; +return v0; +v0 = t0; +} + +static uint32_t f_is_zero(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44e2e0: +//is_zero: +t6 = MEM_U8(a0 + 33); +at = 0x5010000; +t7 = t6 & 0x1f; +t8 = t7 < 0x20; +t9 = -t8; +t0 = t9 & at; +t1 = t0 << (t7 & 0x1f); +if ((int)t1 >= 0) {//nop; +goto L44e344;} +//nop; +v1 = MEM_U8(a0 + 32); +//nop; +t2 = v1 ^ 0x49; +v1 = t2 < 0x1; +if (v1 == 0) {//nop; +goto L44e36c;} +//nop; +v1 = MEM_U32(a0 + 48); +//nop; +t3 = v1 < 0x1; +if (t3 == 0) {v1 = t3; +goto L44e36c;} +v1 = t3; +v1 = MEM_U32(a0 + 52); +//nop; +t4 = v1 < 0x1; +v0 = t4 & 0xff; +return v0; +v0 = t4 & 0xff; +L44e344: +v1 = MEM_U8(a0 + 32); +//nop; +t5 = v1 ^ 0x49; +v1 = t5 < 0x1; +if (v1 == 0) {//nop; +goto L44e36c;} +//nop; +v1 = MEM_U32(a0 + 48); +//nop; +t6 = v1 < 0x1; +v1 = t6; +L44e36c: +v0 = v1 & 0xff; +return v0; +v0 = v1 & 0xff; +} + +static uint32_t f_result_type(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44e3e4: +//result_type: +//nop; +//nop; +//nop; +v0 = MEM_U8(a0 + 32); +at = v0 < 0x3b; +goto L44e424; +at = v0 < 0x3b; +L44e3fc: +v1 = 0x10019348; +//nop; +v0 = MEM_U8(v1 + 0); +//nop; +return v0; +//nop; +L44e410: +v0 = 0x8; +return v0; +v0 = 0x8; +L44e418: +t6 = MEM_U8(a0 + 33); +v0 = t6 & 0x1f; +return v0; +v0 = t6 & 0x1f; +L44e424: +if (at != 0) {at = v0 < 0x51; +goto L44e464;} +at = v0 < 0x51; +if (at != 0) {t0 = v0 + 0xffffffba; +goto L44e4a0;} +t0 = v0 + 0xffffffba; +t8 = v0 + 0xffffffa1; +at = t8 < 0x4; +if (at == 0) {//nop; +goto L44e418;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000d108[] = { +&&L44e410, +&&L44e418, +&&L44e418, +&&L44e410, +}; +dest = Lswitch1000d108[t8]; +//nop; +goto *dest; +//nop; +L44e464: +at = 0x23; +if (v0 == at) {//nop; +goto L44e410;} +//nop; +t9 = v0 + 0xffffffd8; +at = t9 < 0x13; +if (at == 0) {//nop; +goto L44e418;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000d090[] = { +&&L44e410, +&&L44e410, +&&L44e418, +&&L44e418, +&&L44e418, +&&L44e418, +&&L44e410, +&&L44e410, +&&L44e410, +&&L44e418, +&&L44e418, +&&L44e418, +&&L44e410, +&&L44e410, +&&L44e418, +&&L44e418, +&&L44e410, +&&L44e418, +&&L44e410, +}; +dest = Lswitch1000d090[t9]; +//nop; +goto *dest; +//nop; +L44e4a0: +at = t0 < 0xb; +if (at == 0) {//nop; +goto L44e418;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000d0dc[] = { +&&L44e3fc, +&&L44e3fc, +&&L44e418, +&&L44e418, +&&L44e418, +&&L44e3fc, +&&L44e418, +&&L44e410, +&&L44e410, +&&L44e418, +&&L44e410, +}; +dest = Lswitch1000d0dc[t0]; +//nop; +goto *dest; +//nop; +v0 = v1; +return v0; +v0 = v1; +} + +static uint32_t func_44e4d4(uint8_t *mem, uint32_t sp, uint32_t v0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44e4d4: +a0 = MEM_U32(v0 + 0); +//nop; +v1 = MEM_U32(a0 + 48); +//nop; +if (v1 == 0) {v1 = v1 + 0x1; +goto L44e5cc;} +v1 = v1 + 0x1; +t1 = v1 + 0xffffffff; +t6 = t1 & 0x3; +if (t6 == 0) {a1 = 0x1; +goto L44e540;} +a1 = 0x1; +t7 = MEM_U32(v0 + 4); +t9 = MEM_U32(a0 + 52); +t8 = MEM_U32(t7 + 52); +t0 = t6 + 0x1; +a3 = t9 + a1; +a2 = t8 + a1; +L44e514: +t2 = MEM_U8(a2 + -1); +t3 = MEM_U8(a3 + -1); +a1 = a1 + 0x1; +if (t2 == t3) {a2 = a2 + 0x1; +goto L44e530;} +a2 = a2 + 0x1; +v0 = zero; +return v0; +v0 = zero; +L44e530: +if (t0 != a1) {a3 = a3 + 0x1; +goto L44e514;} +a3 = a3 + 0x1; +if (a1 == v1) {//nop; +goto L44e5cc;} +//nop; +L44e540: +t4 = MEM_U32(v0 + 4); +t6 = MEM_U32(a0 + 52); +t5 = MEM_U32(t4 + 52); +a3 = t6 + a1; +a2 = t5 + a1; +L44e554: +t7 = MEM_U8(a2 + -1); +t8 = MEM_U8(a3 + -1); +a1 = a1 + 0x4; +if (t7 == t8) {//nop; +goto L44e570;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L44e570: +t9 = MEM_U8(a2 + 0); +t2 = MEM_U8(a3 + 0); +//nop; +if (t9 == t2) {//nop; +goto L44e58c;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L44e58c: +t3 = MEM_U8(a2 + 1); +t4 = MEM_U8(a3 + 1); +//nop; +if (t3 == t4) {//nop; +goto L44e5a8;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L44e5a8: +t5 = MEM_U8(a2 + 2); +t6 = MEM_U8(a3 + 2); +a2 = a2 + 0x4; +if (t5 == t6) {//nop; +goto L44e5c4;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L44e5c4: +if (a1 != v1) {a3 = a3 + 0x4; +goto L44e554;} +a3 = a3 + 0x4; +L44e5cc: +v0 = 0x1; +//nop; +return v0; +//nop; +} + +static uint32_t f_const_equal(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44e5d8: +//const_equal: +//nop; +//nop; +//nop; +t6 = MEM_U8(a0 + 32); +sp = sp + 0xffffffd8; +v0 = 0x49; +MEM_U32(sp + 28) = ra; +if (v0 != t6) {MEM_U32(sp + 24) = gp; +goto L44e60c;} +MEM_U32(sp + 24) = gp; +t7 = MEM_U8(a1 + 32); +//nop; +if (v0 == t7) {//nop; +goto L44e614;} +//nop; +L44e60c: +v0 = zero; +goto L44e730; +v0 = zero; +L44e614: +v0 = MEM_U8(a0 + 33); +at = 0x5010000; +t8 = v0 & 0x1f; +t9 = t8 < 0x20; +t0 = -t9; +t1 = t0 & at; +t2 = t1 << (t8 & 0x1f); +if ((int)t2 >= 0) {v0 = t8; +goto L44e674;} +v0 = t8; +t3 = MEM_U8(a1 + 33); +//nop; +t4 = t3 & 0x1f; +if (t8 != t4) {t5 = v0 < 0x20; +goto L44e678;} +t5 = v0 < 0x20; +t6 = MEM_U32(a1 + 48); +t8 = MEM_U32(a0 + 48); +t7 = MEM_U32(a1 + 52); +t9 = MEM_U32(a0 + 52); +if (t6 != t8) {t5 = v0 < 0x20; +goto L44e678;} +t5 = v0 < 0x20; +if (t7 != t9) {t5 = v0 < 0x20; +goto L44e678;} +t5 = v0 < 0x20; +v0 = 0x1; +goto L44e730; +v0 = 0x1; +L44e674: +t5 = v0 < 0x20; +L44e678: +t0 = -t5; +at = 0x8a800000; +t1 = t0 & at; +t2 = t1 << (v0 & 0x1f); +if ((int)t2 >= 0) {t8 = v0 < 0x20; +goto L44e6c0;} +t8 = v0 < 0x20; +t3 = MEM_U8(a1 + 33); +//nop; +t4 = t3 & 0x1f; +if (v0 != t4) {at = 0xc0000; +goto L44e6c4;} +at = 0xc0000; +t6 = MEM_U32(a1 + 48); +t7 = MEM_U32(a0 + 48); +//nop; +if (t6 != t7) {at = 0xc0000; +goto L44e6c4;} +at = 0xc0000; +v0 = 0x1; +goto L44e730; +v0 = 0x1; +L44e6c0: +at = 0xc0000; +L44e6c4: +at = at | 0x8000; +t9 = -t8; +t5 = t9 & at; +t0 = t5 << (v0 & 0x1f); +if ((int)t0 >= 0) {//nop; +goto L44e72c;} +//nop; +t1 = MEM_U8(a1 + 33); +//nop; +t2 = t1 & 0x1f; +if (v0 != t2) {v0 = zero; +goto L44e730;} +v0 = zero; +t3 = MEM_U32(a1 + 48); +t4 = MEM_U32(a0 + 48); +MEM_U32(sp + 40) = a0; +if (t3 != t4) {MEM_U32(sp + 44) = a1; +goto L44e72c;} +MEM_U32(sp + 44) = a1; +//nop; +v0 = sp + 0x28; +t9 = t9; +//nop; +v0 = func_44e4d4(mem, sp, v0); +goto L44e718; +//nop; +L44e718: +gp = MEM_U32(sp + 24); +if (v0 == 0) {v0 = zero; +goto L44e730;} +v0 = zero; +v0 = 0x1; +goto L44e730; +v0 = 0x1; +L44e72c: +v0 = zero; +L44e730: +ra = MEM_U32(sp + 28); +sp = sp + 0x28; +//nop; +return v0; +//nop; +} + +static void f_u_tree(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44e740: +//u_tree: +//nop; +//nop; +//nop; +sp = sp + 0xffffffa8; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a0; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 56) = zero; +MEM_U32(sp + 60) = zero; +MEM_U32(sp + 64) = zero; +MEM_U32(sp + 68) = zero; +MEM_U32(sp + 72) = zero; +MEM_U32(sp + 76) = zero; +MEM_U32(sp + 80) = zero; +MEM_U32(sp + 84) = zero; +s1 = 0x60; +s2 = 0x1f; +s3 = sp + 0x38; +L44e798: +v0 = MEM_U8(s0 + 32); +//nop; +if (s1 == v0) {//nop; +goto L44e89c;} +//nop; +a0 = MEM_U32(s0 + 0); +t6 = v0 < 0x60; +if (a0 == 0) {//nop; +goto L44e800;} +//nop; +if (t6 == 0) {t7 = (int)v0 >> 5; +goto L44e7e0;} +t7 = (int)v0 >> 5; +t9 = 0x10006144; +t8 = t7 << 2; +t9 = t9; +t0 = t9 + t8; +t1 = MEM_U32(t0 + 0); +//nop; +t2 = t1 << (v0 & 0x1f); +t6 = (int)t2 < (int)0x0; +L44e7e0: +if (t6 != 0) {//nop; +goto L44e800;} +//nop; +//nop; +//nop; +//nop; +f_u_tree(mem, sp, a0); +goto L44e7f8; +//nop; +L44e7f8: +gp = MEM_U32(sp + 40); +//nop; +L44e800: +a0 = MEM_U32(s0 + 4); +//nop; +if (a0 == 0) {//nop; +goto L44e864;} +//nop; +t4 = MEM_U8(s0 + 32); +//nop; +t5 = t4 < 0xa0; +if (t5 == 0) {t7 = (int)t4 >> 5; +goto L44e844;} +t7 = (int)t4 >> 5; +t8 = 0x10006130; +t9 = t7 << 2; +t8 = t8; +t0 = t8 + t9; +t1 = MEM_U32(t0 + 0); +//nop; +t2 = t1 << (t4 & 0x1f); +t5 = (int)t2 < (int)0x0; +L44e844: +if (t5 != 0) {//nop; +goto L44e864;} +//nop; +//nop; +//nop; +//nop; +f_u_tree(mem, sp, a0); +goto L44e85c; +//nop; +L44e85c: +gp = MEM_U32(sp + 40); +//nop; +L44e864: +//nop; +a0 = s0 + 0x20; +//nop; +f_uwrite(mem, sp, a0, a1, a2, a3); +goto L44e874; +//nop; +L44e874: +t6 = MEM_U8(s0 + 32); +gp = MEM_U32(sp + 40); +if (s2 != t6) {t7 = 0x6a; +goto L44e89c;} +t7 = 0x6a; +//nop; +MEM_U8(sp + 56) = (uint8_t)t7; +a0 = s3; +f_uwrite(mem, sp, a0, a1, a2, a3); +goto L44e894; +a0 = s3; +L44e894: +gp = MEM_U32(sp + 40); +//nop; +L44e89c: +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 != 0) {//nop; +goto L44e798;} +//nop; +ra = MEM_U32(sp + 44); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x58; +return; +sp = sp + 0x58; +//nop; +//nop; +} + +static uint32_t func_44e8d0(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44e8d0: +t6 = MEM_U8(a0 + 0); +a2 = 0x20; +if (a2 == t6) {v1 = zero; +goto L44e92c;} +v1 = zero; +v0 = a0 + 0x1; +a1 = MEM_U8(v0 + -1); +a0 = 0xa; +t7 = a1 + 0xffffffe0; +L44e8f0: +t8 = t7 < 0x20; +t9 = -t8; +t0 = t9 & 0xffc0; +t1 = t0 << (t7 & 0x1f); +if ((int)t1 < 0) {//nop; +goto L44e90c;} +//nop; +abort(); +L44e90c: +lo = v1 * a0; +hi = (uint32_t)((uint64_t)v1 * (uint64_t)a0 >> 32); +v0 = v0 + 0x1; +t2 = lo; +v1 = t2 + a1; +a1 = MEM_U8(v0 + -1); +v1 = v1 + 0xffffffd0; +if (a2 != a1) {t7 = a1 + 0xffffffe0; +goto L44e8f0;} +t7 = a1 + 0xffffffe0; +L44e92c: +v0 = v1; +return v0; +v0 = v1; +} + +static void func_44e934(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44e934: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +if (a0 == 0) {s0 = a0; +goto L44e9c0;} +s0 = a0; +s3 = 0x11; +s2 = 0x1; +s1 = 0x42; +L44e970: +v0 = MEM_U8(s0 + 32); +//nop; +if (s1 != v0) {//nop; +goto L44e990;} +//nop; +t6 = MEM_U16(s0 + 34); +//nop; +if (s2 != t6) {//nop; +goto L44e998;} +//nop; +L44e990: +if (s3 != v0) {//nop; +goto L44e9b0;} +//nop; +L44e998: +//nop; +//nop; +//nop; +v0 = f_gen_label_id(mem, sp); +goto L44e9a8; +//nop; +L44e9a8: +gp = MEM_U32(sp + 40); +MEM_U32(s0 + 36) = v0; +L44e9b0: +s0 = MEM_U32(s0 + 8); +//nop; +if (s0 != 0) {//nop; +goto L44e970;} +//nop; +L44e9c0: +ra = MEM_U32(sp + 44); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_44e9dc(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44e9dc: +//nop; +//nop; +//nop; +sp = sp + 0xffffff48; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 184) = a0; +goto L44ec5c; +MEM_U32(sp + 184) = a0; +L44e9fc: +at = 0x10019310; +MEM_U32(at + 0) = a1; +goto L44ecb0; +MEM_U32(at + 0) = a1; +L44ea08: +at = (int)a1 < (int)0x4; +if (at == 0) {a0 = 0x4; +goto L44eb28;} +a0 = 0x4; +t6 = 0x1000d210; +a1 = 0x88; +t6 = t6; +t8 = t6 + 0x48; +t9 = sp; +L44ea28: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 7($t9) +goto L44ea28;} +//swr $at, 7($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t0 = 0x1000d1c0; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +t0 = t0; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t0 + 0x48; +t3 = sp; +//swr $t8, 0xf($t9) +L44ea98: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 0x57($t3) +goto L44ea98;} +//swr $at, 0x57($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44eb14; +//nop; +L44eb14: +gp = MEM_U32(sp + 176); +t4 = 0x4; +at = 0x10019328; +MEM_U32(at + 0) = t4; +goto L44ecb0; +MEM_U32(at + 0) = t4; +L44eb28: +at = 0x10019328; +MEM_U32(at + 0) = a1; +goto L44ecb0; +MEM_U32(at + 0) = a1; +L44eb34: +at = 0x10019320; +MEM_U32(at + 0) = a1; +goto L44ecb0; +MEM_U32(at + 0) = a1; +L44eb40: +at = 0x10019318; +MEM_U32(at + 0) = a1; +goto L44ecb0; +MEM_U32(at + 0) = a1; +L44eb4c: +t5 = 0x1000d170; +a0 = 0x4; +t5 = t5; +t8 = t5 + 0x48; +a1 = 0x98; +t6 = sp; +L44eb64: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t6 = t6 + 0xc; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t6 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 4 + 3) = (uint8_t)(at >> 0); +if (t5 != t8) {//swr $at, 7($t6) +goto L44eb64;} +//swr $at, 7($t6) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = 0x1000d120; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +t8 = t5 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t5) +t9 = t9; +MEM_U8(t6 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t6 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t6 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t6 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t9 + 0x48; +t0 = sp; +//swr $t8, 0xf($t6) +L44ebd4: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t0 = t0 + 0xc; +MEM_U8(t0 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t0) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t0 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 84 + 3) = (uint8_t)(at >> 0); +if (t9 != t2) {//swr $at, 0x57($t0) +goto L44ebd4;} +//swr $at, 0x57($t0) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +t2 = t9 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t9) +//nop; +MEM_U8(t0 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t0 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t0 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t0 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t0) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44ec50; +//nop; +L44ec50: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L44ecb4; +ra = MEM_U32(sp + 180); +L44ec5c: +at = a0 < 0x68; +if (at != 0) {at = 0x72; +goto L44ec78;} +at = 0x72; +if (a0 == at) {//nop; +goto L44eb34;} +//nop; +//nop; +goto L44eb4c; +//nop; +L44ec78: +at = 0x20; +if (a0 == at) {t3 = a0 + 0xffffff9f; +goto L44ecb0;} +t3 = a0 + 0xffffff9f; +at = t3 < 0x7; +if (at == 0) {//nop; +goto L44eb4c;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000d260[] = { +&&L44e9fc, +&&L44eb4c, +&&L44eb4c, +&&L44eb4c, +&&L44eb40, +&&L44eb4c, +&&L44ea08, +}; +dest = Lswitch1000d260[t3]; +//nop; +goto *dest; +//nop; +L44ecb0: +ra = MEM_U32(sp + 180); +L44ecb4: +sp = sp + 0xb8; +//nop; +return; +//nop; +} + +static void func_44ecc0(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44ecc0: +//nop; +//nop; +//nop; +sp = sp + 0xffffff48; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +MEM_U32(sp + 184) = a0; +goto L44f088; +MEM_U32(sp + 184) = a0; +L44ece0: +at = 0x10019314; +MEM_U32(at + 0) = a1; +goto L44f0dc; +MEM_U32(at + 0) = a1; +L44ecec: +at = (int)a1 < (int)0x2; +if (at == 0) {a0 = 0x4; +goto L44ee0c;} +a0 = 0x4; +t6 = 0x1000d40c; +a1 = 0xa4; +t6 = t6; +t8 = t6 + 0x48; +t9 = sp; +L44ed0c: +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t6 = t6 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t6 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t6) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t6 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t6) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t6 != t8) {//swr $at, 7($t9) +goto L44ed0c;} +//swr $at, 7($t9) +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t0 = 0x1000d3bc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +t0 = t0; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t0 + 0x48; +t3 = sp; +//swr $t8, 0xf($t9) +L44ed7c: +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t0 = t0 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t0 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t0) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t0 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t0) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t0 != t2) {//swr $at, 0x57($t3) +goto L44ed7c;} +//swr $at, 0x57($t3) +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44edf8; +//nop; +L44edf8: +gp = MEM_U32(sp + 176); +t4 = 0x2; +at = 0x1001932c; +MEM_U32(at + 0) = t4; +goto L44f0dc; +MEM_U32(at + 0) = t4; +L44ee0c: +at = 0x1001932c; +MEM_U32(at + 0) = a1; +goto L44f0dc; +MEM_U32(at + 0) = a1; +L44ee18: +at = 0x10019324; +MEM_U32(at + 0) = a1; +goto L44f0dc; +MEM_U32(at + 0) = a1; +L44ee24: +at = 0x1001931c; +MEM_U32(at + 0) = a1; +goto L44f0dc; +MEM_U32(at + 0) = a1; +L44ee30: +at = 0x10019314; +a0 = 0x4; +MEM_U32(at + 0) = zero; +at = 0x10019324; +t6 = sp; +MEM_U32(at + 0) = zero; +at = 0x1001931c; +t0 = sp; +MEM_U32(at + 0) = zero; +at = (int)a1 < (int)0x2; +if (at == 0) {t4 = a1 + 0xffffffff; +goto L44ef6c;} +t4 = a1 + 0xffffffff; +t5 = 0x1000d36c; +a1 = 0xb4; +t5 = t5; +t8 = t5 + 0x48; +L44ee70: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t6 = t6 + 0xc; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t6 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 4 + 3) = (uint8_t)(at >> 0); +if (t5 != t8) {//swr $at, 7($t6) +goto L44ee70;} +//swr $at, 7($t6) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = 0x1000d31c; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +t8 = t5 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t5) +t9 = t9; +MEM_U8(t6 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t6 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t6 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t6 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t9 + 0x48; +//swr $t8, 0xf($t6) +L44eedc: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t0 = t0 + 0xc; +MEM_U8(t0 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t0) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t0 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 84 + 3) = (uint8_t)(at >> 0); +if (t9 != t2) {//swr $at, 0x57($t0) +goto L44eedc;} +//swr $at, 0x57($t0) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +t2 = t9 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t9) +//nop; +MEM_U8(t0 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t0 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t0 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t0 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t0) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44ef58; +//nop; +L44ef58: +gp = MEM_U32(sp + 176); +t3 = 0x2; +at = 0x1001932c; +MEM_U32(at + 0) = t3; +goto L44f0dc; +MEM_U32(at + 0) = t3; +L44ef6c: +at = 0x1001932c; +MEM_U32(at + 0) = t4; +goto L44f0dc; +MEM_U32(at + 0) = t4; +L44ef78: +t7 = 0x1000d2cc; +a0 = 0x4; +t7 = t7; +t5 = t7 + 0x48; +a1 = 0xbf; +t6 = sp; +L44ef90: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t6 = t6 + 0xc; +MEM_U8(t6 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t6) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t6 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t5) {//swr $at, 7($t6) +goto L44ef90;} +//swr $at, 7($t6) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t1 = 0x1000d27c; +MEM_U8(t6 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t6 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t6 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t6 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t6) +t5 = t7 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t7) +t1 = t1; +MEM_U8(t6 + 12 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t6 + 12 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t6 + 12 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t6 + 12 + 3) = (uint8_t)(t5 >> 0); +t9 = t1 + 0x48; +t0 = sp; +//swr $t5, 0xf($t6) +L44f000: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t0 = t0 + 0xc; +MEM_U8(t0 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t0) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t0 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 84 + 3) = (uint8_t)(at >> 0); +if (t1 != t9) {//swr $at, 0x57($t0) +goto L44f000;} +//swr $at, 0x57($t0) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +//nop; +MEM_U8(t0 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t0) +t9 = t1 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t1) +//nop; +MEM_U8(t0 + 92 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t0 + 92 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t0 + 92 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t0 + 92 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x5f($t0) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44f07c; +//nop; +L44f07c: +gp = MEM_U32(sp + 176); +ra = MEM_U32(sp + 180); +goto L44f0e0; +ra = MEM_U32(sp + 180); +L44f088: +at = a0 < 0x68; +if (at != 0) {at = 0x72; +goto L44f0a4;} +at = 0x72; +if (a0 == at) {//nop; +goto L44ee18;} +//nop; +//nop; +goto L44ef78; +//nop; +L44f0a4: +at = 0x20; +if (a0 == at) {t3 = a0 + 0xffffff9f; +goto L44ee30;} +t3 = a0 + 0xffffff9f; +at = t3 < 0x7; +if (at == 0) {//nop; +goto L44ef78;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000d45c[] = { +&&L44ece0, +&&L44ef78, +&&L44ef78, +&&L44ef78, +&&L44ee24, +&&L44ef78, +&&L44ecec, +}; +dest = Lswitch1000d45c[t3]; +//nop; +goto *dest; +//nop; +L44f0dc: +ra = MEM_U32(sp + 180); +L44f0e0: +sp = sp + 0xb8; +//nop; +return; +//nop; +} + +static void func_44f0ec(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +L44f0ec: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 20) = s0; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +MEM_U32(sp + 44) = a3; +t6 = MEM_U8(v0 + -1024); +s0 = v0; +if (t6 == 0) {a2 = 0x10; +goto L44f1ec;} +a2 = 0x10; +a1 = 0x1000d488; +//nop; +a0 = MEM_U32(v0 + -1032); +a2 = 0x10; +a3 = 0x10; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44f144; +a1 = a1; +L44f144: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + -1032); +//nop; +a1 = sp + 0x24; +a2 = 0xc; +a3 = zero; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44f160; +a3 = zero; +L44f160: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + -1032); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44f178; +//nop; +L44f178: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + -1032); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44f190; +//nop; +L44f190: +gp = MEM_U32(sp + 24); +a2 = 0x7fff0000; +//nop; +a2 = a2 | 0xffff; +a1 = MEM_U32(sp + 32); +a3 = a2; +a0 = s0 + 0xfffffbf8; +f_print_tree(mem, sp, a0, a1, a2, a3); +goto L44f1b0; +a0 = s0 + 0xfffffbf8; +L44f1b0: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + -1032); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44f1c8; +//nop; +L44f1c8: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + -1032); +//nop; +//nop; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L44f1e0; +//nop; +L44f1e0: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L44f298; +ra = MEM_U32(sp + 28); +L44f1ec: +s0 = 0x10006560; +a1 = 0x1000d478; +//nop; +a0 = MEM_U32(s0 + 0); +a3 = 0x10; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44f208; +a1 = a1; +L44f208: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +//nop; +a1 = sp + 0x24; +a2 = 0xc; +a3 = zero; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44f224; +a3 = zero; +L44f224: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44f23c; +//nop; +L44f23c: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44f254; +//nop; +L44f254: +gp = MEM_U32(sp + 24); +a2 = 0x7fff0000; +//nop; +a2 = a2 | 0xffff; +a1 = MEM_U32(sp + 32); +a3 = a2; +a0 = s0; +f_print_tree(mem, sp, a0, a1, a2, a3); +goto L44f274; +a0 = s0; +L44f274: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(s0 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44f28c; +//nop; +L44f28c: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L44f298: +s0 = MEM_U32(sp + 20); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void func_44f2a4(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L44f2a4: +MEM_U32(sp + 4) = a1; +t6 = MEM_U8(sp + 4); +t0 = 0x20; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +if (t0 == t6) {v0 = 0x1; +goto L44f2e4;} +v0 = 0x1; +a1 = sp + 0x4; +a2 = MEM_U8(a1 + 0); +v1 = a0 + 0x1; +L44f2cc: +MEM_U8(v1 + -1) = (uint8_t)a2; +a2 = MEM_U8(a1 + 1); +v0 = v0 + 0x1; +v1 = v1 + 0x1; +if (t0 != a2) {a1 = a1 + 0x1; +goto L44f2cc;} +a1 = a1 + 0x1; +L44f2e4: +at = (int)v0 < (int)0x401; +if (at == 0) {a1 = v0; +goto L44f33c;} +a1 = v0; +t1 = 0x401; +a3 = t1 - a1; +t8 = a3 & 0x3; +if (t8 == 0) {a2 = t8 + a1; +goto L44f31c;} +a2 = t8 + a1; +v1 = a0 + v0; +L44f308: +v0 = v0 + 0x1; +MEM_U8(v1 + -1) = (uint8_t)t0; +if (a2 != v0) {v1 = v1 + 0x1; +goto L44f308;} +v1 = v1 + 0x1; +if (v0 == t1) {v1 = a0 + v0; +goto L44f33c;} +L44f31c: +v1 = a0 + v0; +L44f320: +v0 = v0 + 0x4; +MEM_U8(v1 + -1) = (uint8_t)t0; +MEM_U8(v1 + 0) = (uint8_t)t0; +MEM_U8(v1 + 1) = (uint8_t)t0; +MEM_U8(v1 + 2) = (uint8_t)t0; +if (v0 != t1) {v1 = v1 + 0x4; +goto L44f320;} +v1 = v1 + 0x4; +L44f33c: +//nop; +return; +//nop; +} + +static void func_44f344(uint8_t *mem, uint32_t sp, uint32_t v0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44f344: +//nop; +//nop; +//nop; +t6 = 0x1000d538; +sp = sp + 0xffffff38; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0xb($sp) +at = t6 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t6) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t8 = t6 + 12; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 0xf($t6) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x13($sp) +at = t6 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t6) +a0 = v0 + 0xfffff7f8; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t8 = t6 + 20; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 0x17($t6) +t9 = t9; +MEM_U8(sp + 24 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0x1b($sp) +at = t6 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t6) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t8 = t6 + 28; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 0x1f($t6) +MEM_U32(sp + 188) = a0; +MEM_U8(sp + 32 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t8 >> 0); +MEM_U32(sp + 196) = v0; +//swr $t8, 0x23($sp) +func_44f2a4(mem, sp, a0, a1, a2, a3); +goto L44f40c; +//swr $t8, 0x23($sp) +L44f40c: +gp = MEM_U32(sp + 176); +v1 = MEM_U32(sp + 196); +a0 = MEM_U32(sp + 188); +MEM_U8(v1 + -2038) = (uint8_t)zero; +//nop; +//nop; +//nop; +v0 = wrapper_mktemp(mem, a0); +goto L44f42c; +//nop; +L44f42c: +v1 = MEM_U32(sp + 196); +gp = MEM_U32(sp + 176); +if (v0 != 0) {MEM_U32(v1 + -2060) = v0; +goto L44f548;} +MEM_U32(v1 + -2060) = v0; +t9 = 0x1000d4e8; +a0 = 0x4; +t9 = t9; +t1 = t9 + 0x48; +a1 = 0xfc; +t2 = sp; +L44f454: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t2 = t2 + 0xc; +MEM_U8(t2 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t2) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t2 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 4 + 3) = (uint8_t)(at >> 0); +if (t9 != t1) {//swr $at, 7($t2) +goto L44f454;} +//swr $at, 7($t2) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t3 = 0x1000d498; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +t1 = t9 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t9) +t3 = t3; +MEM_U8(t2 + 12 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t2 + 12 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t2 + 12 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t2 + 12 + 3) = (uint8_t)(t1 >> 0); +t5 = t3 + 0x48; +t7 = sp; +//swr $t1, 0xf($t2) +L44f4c4: +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t3 = t3 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t3 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t3) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t3 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t3) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t3 != t5) {//swr $at, 0x57($t7) +goto L44f4c4;} +//swr $at, 0x57($t7) +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L44f540; +//nop; +L44f540: +gp = MEM_U32(sp + 176); +//nop; +L44f548: +ra = MEM_U32(sp + 180); +sp = sp + 0xc8; +//nop; +return; +//nop; +} + +static void func_44f558(uint8_t *mem, uint32_t sp, uint32_t v0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44f558: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +a0 = v0 + 0xfffff7f8; +v0 = wrapper_unlink(mem, a0); +goto L44f57c; +a0 = v0 + 0xfffff7f8; +L44f57c: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static uint32_t func_44f58c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L44f58c: +MEM_U32(sp + 4) = a1; +t6 = MEM_U8(sp + 4); +MEM_U32(sp + 12) = a3; +a3 = 0x20; +a1 = a0; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 8) = a2; +if (a3 == t6) {v1 = 0x1; +goto L44f5e4;} +v1 = 0x1; +v0 = sp + 0x4; +a0 = MEM_U8(v0 + 0); +a2 = a1 + 0x1; +L44f5bc: +t8 = MEM_U8(a2 + -1); +v1 = v1 + 0x1; +if (a0 == t8) {//nop; +goto L44f5d4;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L44f5d4: +a0 = MEM_U8(v0 + 1); +v0 = v0 + 0x1; +if (a3 != a0) {a2 = a2 + 0x1; +goto L44f5bc;} +a2 = a2 + 0x1; +L44f5e4: +t9 = a1 + v1; +t0 = MEM_U8(t9 + -1); +//nop; +v0 = a3 ^ t0; +v0 = v0 < 0x1; +//nop; +return v0; +//nop; +} + +static uint32_t f_main(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L44f600: +//main: +//nop; +//nop; +//nop; +sp = sp + 0xffffe248; +t6 = 0x10018df0; +MEM_U32(sp + 212) = ra; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 208) = fp; +at = (int)t6 < (int)0x2; +MEM_U32(sp + 204) = gp; +MEM_U32(sp + 200) = s7; +MEM_U32(sp + 196) = s6; +MEM_U32(sp + 192) = s5; +MEM_U32(sp + 188) = s4; +MEM_U32(sp + 184) = s3; +MEM_U32(sp + 180) = s2; +MEM_U32(sp + 176) = s1; +MEM_U32(sp + 172) = s0; +MEM_U32(sp + 284) = zero; +MEM_U32(sp + 288) = zero; +MEM_U32(sp + 6576) = zero; +if (at == 0) {MEM_U32(sp + 6580) = zero; +goto L44f6a0;} +MEM_U32(sp + 6580) = zero; +s6 = 0x10006560; +a1 = 0x1000dba7; +//nop; +a0 = MEM_U32(s6 + 0); +a2 = 0x75; +a3 = 0x75; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44f67c; +a1 = a1; +L44f67c: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44f694; +//nop; +L44f694: +gp = MEM_U32(sp + 204); +v0 = zero; +goto L4522c4; +v0 = zero; +L44f6a0: +at = 0x10018e84; +t7 = 0x8; +MEM_U32(at + 0) = t7; +at = 0x10018e80; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10018e94; +MEM_U8(sp + 4520) = (uint8_t)zero; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10018e88; +MEM_U8(sp + 3496) = (uint8_t)zero; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10018ee0; +MEM_U8(sp + 2472) = (uint8_t)zero; +MEM_U8(sp + 1448) = (uint8_t)zero; +MEM_U8(sp + 1320) = (uint8_t)zero; +MEM_U8(sp + 5552) = (uint8_t)zero; +MEM_U8(sp + 6584) = (uint8_t)zero; +MEM_U8(sp + 253) = (uint8_t)zero; +MEM_U8(sp + 1319) = (uint8_t)zero; +a0 = zero; +MEM_U8(at + 0) = (uint8_t)zero; +f_set_domtag(mem, sp, a0); +goto L44f6fc; +MEM_U8(at + 0) = (uint8_t)zero; +L44f6fc: +gp = MEM_U32(sp + 204); +v0 = 0x4; +at = 0x10018e60; +a0 = 0x2; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10018e64; +t8 = 0x8; +MEM_U32(at + 0) = zero; +at = 0x100197bc; +v1 = 0x6; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001938c; +s4 = 0x1; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10018ed4; +t9 = 0xffffffff; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10018ed8; +s0 = 0x10018df0; +MEM_U32(at + 0) = zero; +at = 0x10018edc; +s0 = MEM_U32(s0 + 0); +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10019310; +s2 = MEM_U32(sp + 280); +MEM_U32(at + 0) = v0; +at = 0x10019314; +MEM_U8(sp + 1318) = (uint8_t)zero; +MEM_U32(at + 0) = a0; +at = 0x10019328; +MEM_U8(sp + 254) = (uint8_t)zero; +MEM_U32(at + 0) = v0; +at = 0x1001932c; +MEM_U8(sp + 260) = (uint8_t)zero; +MEM_U32(at + 0) = v0; +at = 0x10019318; +MEM_U8(sp + 256) = (uint8_t)s4; +MEM_U32(at + 0) = t8; +at = 0x1001931c; +MEM_U32(sp + 248) = zero; +MEM_U32(at + 0) = v1; +at = 0x10019320; +s1 = s4; +MEM_U32(at + 0) = v1; +at = 0x10019324; +s7 = 0x20; +MEM_U32(at + 0) = a0; +at = 0x10018eb0; +s5 = sp + 0x1db8; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10018eb4; +s3 = sp + 0x126; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10018eb8; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10018ebc; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10018ec0; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10019330; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10019334; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10019360; +//nop; +MEM_U8(at + 0) = (uint8_t)s4; +at = 0x1001936c; +//nop; +MEM_U8(at + 0) = (uint8_t)s4; +at = 0x10018ea4; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10019b9c; +//nop; +MEM_U8(at + 0) = (uint8_t)s4; +at = 0x10018dfc; +//nop; +MEM_U8(at + 0) = (uint8_t)s4; +at = 0x100197c0; +//nop; +MEM_U32(at + 0) = t9; +at = 0x10018ecc; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10018ed0; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x10019348; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = 0x1001934c; +//nop; +MEM_U32(at + 0) = v0; +at = 0x10019344; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +at = (int)s0 < (int)0x2; +if (at != 0) {t4 = MEM_U8(sp + 4520); +goto L451664;} +t4 = MEM_U8(sp + 4520); +s6 = 0x10006560; +fp = sp + 0x11a7; +L44f8a4: +//nop; +a0 = s1; +a1 = s3; +a2 = 0x400; +f_get_arg(mem, sp, a0, a1, a2); +goto L44f8b8; +a2 = 0x400; +L44f8b8: +t0 = MEM_U8(sp + 294); +gp = MEM_U32(sp + 204); +at = 0x2d; +if (t0 != at) {a0 = s1; +goto L45160c;} +a0 = s1; +v0 = MEM_U8(sp + 295); +//nop; +at = v0 < 0x50; +if (at != 0) {t1 = v0 + 0xffffff9f; +goto L4515d4;} +t1 = v0 + 0xffffff9f; +at = t1 < 0x17; +if (at == 0) {//nop; +goto L451568;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000dc54[] = { +&&L450e94, +&&L451568, +&&L451278, +&&L44fe18, +&&L44fd20, +&&L4502c0, +&&L450018, +&&L451568, +&&L451568, +&&L44f90c, +&&L451568, +&&L44facc, +&&L4507b8, +&&L450474, +&&L44f948, +&&L450afc, +&&L451568, +&&L450234, +&&L451568, +&&L44fb74, +&&L44f9e4, +&&L45045c, +&&L451204, +}; +dest = Lswitch1000dc54[t1]; +//nop; +goto *dest; +//nop; +L44f90c: +v1 = MEM_U8(sp + 296); +at = 0x61; +if (v1 != at) {//nop; +goto L451568;} +//nop; +t2 = MEM_U8(sp + 297); +at = 0x6c; +if (t2 != at) {//nop; +goto L451568;} +//nop; +v0 = MEM_U8(sp + 298); +at = 0x72; +if (v0 != at) {//nop; +goto L451568;} +//nop; +at = 0x10018ea4; +MEM_U8(at + 0) = (uint8_t)s4; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)s4; +L44f948: +v1 = MEM_U8(sp + 296); +t3 = s1 + 0x1; +if (v1 != s7) {//nop; +goto L451568;} +//nop; +if (t3 != s0) {a2 = 0x1a; +goto L44f9c0;} +a2 = 0x1a; +a1 = 0x1000db8d; +//nop; +a0 = MEM_U32(s6 + 0); +a3 = 0x1a; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44f978; +a1 = a1; +L44f978: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44f990; +//nop; +L44f990: +gp = MEM_U32(sp + 204); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L44f9a8; +//nop; +L44f9a8: +gp = MEM_U32(sp + 204); +//nop; +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +//nop; +L44f9c0: +//nop; +s1 = s1 + 0x1; +a0 = s1; +a1 = sp + 0xda8; +a2 = 0x400; +f_get_arg(mem, sp, a0, a1, a2); +goto L44f9d8; +a2 = 0x400; +L44f9d8: +gp = MEM_U32(sp + 204); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L44f9e4: +v1 = MEM_U8(sp + 296); +at = 0x66; +if (v1 != at) {//nop; +goto L44fa38;} +//nop; +t4 = MEM_U8(sp + 297); +at = 0x73; +if (t4 != at) {//nop; +goto L44fa38;} +//nop; +v0 = MEM_U8(sp + 298); +at = 0x61; +if (v0 != at) {at = 0x6d; +goto L44fa24;} +at = 0x6d; +at = 0x10019330; +MEM_U8(at + 0) = (uint8_t)s4; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)s4; +at = 0x6d; +L44fa24: +if (v0 != at) {//nop; +goto L451568;} +//nop; +at = 0x10019334; +MEM_U8(at + 0) = (uint8_t)s4; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)s4; +L44fa38: +if (v1 != s7) {t5 = s1 + 0x1; +goto L451568;} +t5 = s1 + 0x1; +if (t5 != s0) {a2 = 0x1a; +goto L44faa8;} +a2 = 0x1a; +a1 = 0x1000db73; +//nop; +a0 = MEM_U32(s6 + 0); +a3 = 0x1a; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44fa60; +a1 = a1; +L44fa60: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44fa78; +//nop; +L44fa78: +gp = MEM_U32(sp + 204); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L44fa90; +//nop; +L44fa90: +gp = MEM_U32(sp + 204); +//nop; +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +//nop; +L44faa8: +//nop; +s1 = s1 + 0x1; +a0 = s1; +a1 = sp + 0x5a8; +a2 = 0x400; +f_get_arg(mem, sp, a0, a1, a2); +goto L44fac0; +a2 = 0x400; +L44fac0: +gp = MEM_U32(sp + 204); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L44facc: +v1 = MEM_U8(sp + 296); +t6 = s1 + 0x1; +if (v1 != s7) {//nop; +goto L451568;} +//nop; +if (t6 != s0) {a2 = 0x1a; +goto L44fb44;} +a2 = 0x1a; +a1 = 0x1000db59; +//nop; +a0 = MEM_U32(s6 + 0); +a3 = 0x1a; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44fafc; +a1 = a1; +L44fafc: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44fb14; +//nop; +L44fb14: +gp = MEM_U32(sp + 204); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L44fb2c; +//nop; +L44fb2c: +gp = MEM_U32(sp + 204); +//nop; +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +//nop; +L44fb44: +at = 0x10018e88; +//nop; +s1 = s1 + 0x1; +t7 = 0x1; +a0 = s1; +a1 = sp + 0x9a8; +a2 = 0x400; +MEM_U8(at + 0) = (uint8_t)t7; +f_get_arg(mem, sp, a0, a1, a2); +goto L44fb68; +MEM_U8(at + 0) = (uint8_t)t7; +L44fb68: +gp = MEM_U32(sp + 204); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L44fb74: +v1 = MEM_U8(sp + 296); +at = 0x65; +if (v1 != at) {v0 = MEM_U8(sp + 298); +goto L44fc3c;} +v0 = MEM_U8(sp + 298); +t8 = MEM_U8(sp + 297); +at = 0x6d; +if (t8 != at) {v0 = MEM_U8(sp + 298); +goto L44fc3c;} +v0 = MEM_U8(sp + 298); +v0 = MEM_U8(sp + 298); +at = 0x70; +if (v0 != at) {t9 = 0x1; +goto L44fc38;} +t9 = 0x1; +t0 = s1 + 0x1; +if (t0 != s0) {MEM_U8(sp + 253) = (uint8_t)t9; +goto L44fc14;} +MEM_U8(sp + 253) = (uint8_t)t9; +a1 = 0x1000db3c; +//nop; +a0 = MEM_U32(s6 + 0); +a2 = 0x1d; +a3 = 0x1d; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44fbcc; +a1 = a1; +L44fbcc: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44fbe4; +//nop; +L44fbe4: +gp = MEM_U32(sp + 204); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L44fbfc; +//nop; +L44fbfc: +gp = MEM_U32(sp + 204); +//nop; +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +//nop; +L44fc14: +//nop; +s1 = s1 + 0x1; +a0 = s1; +a1 = sp + 0x15b0; +a2 = 0x400; +f_get_arg(mem, sp, a0, a1, a2); +goto L44fc2c; +a2 = 0x400; +L44fc2c: +gp = MEM_U32(sp + 204); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L44fc38: +v0 = MEM_U8(sp + 298); +L44fc3c: +at = 0x72; +if (v1 != at) {//nop; +goto L44fc8c;} +//nop; +t1 = MEM_U8(sp + 297); +at = 0x61; +if (t1 != at) {at = 0x70; +goto L44fc8c;} +at = 0x70; +if (v0 != at) {//nop; +goto L44fc8c;} +//nop; +t2 = MEM_U8(sp + 299); +at = 0x75; +if (t2 != at) {//nop; +goto L44fc8c;} +//nop; +t3 = MEM_U8(sp + 300); +at = 0x76; +if (t3 != at) {//nop; +goto L44fc8c;} +//nop; +at = 0x100197bc; +MEM_U8(at + 0) = (uint8_t)s4; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)s4; +L44fc8c: +if (v1 != s7) {t4 = s1 + 0x1; +goto L451568;} +t4 = s1 + 0x1; +if (t4 != s0) {a2 = 0x1a; +goto L44fcfc;} +a2 = 0x1a; +a1 = 0x1000db22; +//nop; +a0 = MEM_U32(s6 + 0); +a3 = 0x1a; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44fcb4; +a1 = a1; +L44fcb4: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44fccc; +//nop; +L44fccc: +gp = MEM_U32(sp + 204); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L44fce4; +//nop; +L44fce4: +gp = MEM_U32(sp + 204); +//nop; +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +//nop; +L44fcfc: +//nop; +s1 = s1 + 0x1; +a0 = s1; +a1 = sp + 0x528; +a2 = 0x80; +f_get_arg(mem, sp, a0, a1, a2); +goto L44fd14; +a2 = 0x80; +L44fd14: +gp = MEM_U32(sp + 204); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L44fd20: +v1 = MEM_U8(sp + 296); +t5 = 0x1; +if (v1 != s7) {at = 0x78; +goto L44fdc4;} +at = 0x78; +t6 = s1 + 0x1; +if (t6 != s0) {MEM_U8(sp + 1319) = (uint8_t)t5; +goto L44fda0;} +MEM_U8(sp + 1319) = (uint8_t)t5; +a1 = 0x1000db08; +//nop; +a0 = MEM_U32(s6 + 0); +a2 = 0x1a; +a3 = 0x1a; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L44fd58; +a1 = a1; +L44fd58: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L44fd70; +//nop; +L44fd70: +gp = MEM_U32(sp + 204); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L44fd88; +//nop; +L44fd88: +gp = MEM_U32(sp + 204); +//nop; +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +//nop; +L44fda0: +//nop; +s1 = s1 + 0x1; +a0 = s1; +a1 = sp + 0x19b8; +a2 = 0x400; +f_get_arg(mem, sp, a0, a1, a2); +goto L44fdb8; +a2 = 0x400; +L44fdb8: +gp = MEM_U32(sp + 204); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L44fdc4: +if (v1 != at) {//nop; +goto L451568;} +//nop; +t7 = MEM_U8(sp + 297); +at = 0x63; +if (t7 != at) {//nop; +goto L451568;} +//nop; +v0 = MEM_U8(sp + 298); +at = 0x70; +if (v0 != at) {//nop; +goto L451568;} +//nop; +t8 = MEM_U8(sp + 299); +at = 0x74; +if (t8 != at) {//nop; +goto L451568;} +//nop; +t9 = MEM_U8(sp + 300); +//nop; +if (t9 != s7) {//nop; +goto L451568;} +//nop; +at = 0x10018e60; +MEM_U8(at + 0) = (uint8_t)s4; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)s4; +L44fe18: +t0 = 0x1000dae8; +//nop; +t0 = t0; +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t2 = t0 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t0) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0xb($sp) +at = t0 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t0) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t2 = t0 + 12; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 0xf($t0) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x13($sp) +at = t0 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t0) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t2 = t0 + 20; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 0x17($t0) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x1b($sp) +at = t0 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t0) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t2 = t0 + 28; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 0x1f($t0) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L44fec8; +//swr $t2, 0x23($sp) +L44fec8: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L44feec;} +//nop; +at = 0x10018eac; +t3 = 0x2; +MEM_U8(at + 0) = (uint8_t)t3; +at = 0x10018ecc; +MEM_U8(at + 0) = (uint8_t)s4; +goto L44ffd0; +MEM_U8(at + 0) = (uint8_t)s4; +L44feec: +t4 = 0x1000dac8; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0xb($sp) +at = t4 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t4) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t6 = t4 + 12; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0xf($t4) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x13($sp) +at = t4 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t4) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t6 = t4 + 20; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0x17($t4) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x1b($sp) +at = t4 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t4) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t6 = t4 + 28; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0x1f($t4) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L44ff9c; +//swr $t6, 0x23($sp) +L44ff9c: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L44ffc4;} +//nop; +//nop; +a0 = s4; +//nop; +f_set_domtag(mem, sp, a0); +goto L44ffb8; +//nop; +L44ffb8: +gp = MEM_U32(sp + 204); +//nop; +goto L44ffd0; +//nop; +L44ffc4: +at = 0x10018ed4; +MEM_U8(sp + 1319) = (uint8_t)s4; +MEM_U8(at + 0) = (uint8_t)s4; +L44ffd0: +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L44ffe4: +v1 = MEM_U8(sp + 296); +at = 0x4c; +if (v1 != at) {at = 0x42; +goto L450004;} +at = 0x42; +at = 0x10018e80; +MEM_U8(at + 0) = (uint8_t)s4; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)s4; +at = 0x42; +L450004: +if (v1 != at) {//nop; +goto L451568;} +//nop; +at = 0x10018e80; +MEM_U8(at + 0) = (uint8_t)zero; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)zero; +L450018: +v1 = MEM_U8(sp + 296); +a2 = s7; +if (v1 != s7) {at = v1 < 0x30; +goto L450074;} +at = v1 < 0x30; +a1 = 0x1000daa8; +//nop; +a0 = MEM_U32(s6 + 0); +a3 = s7; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L450040; +a1 = a1; +L450040: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L450058; +//nop; +L450058: +gp = MEM_U32(sp + 204); +//nop; +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L450074: +if (at != 0) {at = v1 < 0x35; +goto L451568;} +at = v1 < 0x35; +if (at == 0) {t7 = v1 + 0xffffffd0; +goto L451568;} +t7 = v1 + 0xffffffd0; +MEM_U8(sp + 260) = (uint8_t)t7; +goto L45164c; +MEM_U8(sp + 260) = (uint8_t)t7; +L45008c: +v1 = MEM_U8(sp + 296); +a2 = s7; +if (v1 != s7) {at = v1 < 0x30; +goto L4500e8;} +at = v1 < 0x30; +a1 = 0x1000da88; +//nop; +a0 = MEM_U32(s6 + 0); +a3 = s7; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L4500b4; +a1 = a1; +L4500b4: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L4500cc; +//nop; +L4500cc: +gp = MEM_U32(sp + 204); +//nop; +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L4500e8: +if (at != 0) {at = v1 < 0x35; +goto L451568;} +at = v1 < 0x35; +if (at == 0) {t8 = v1 + 0xffffffd0; +goto L451568;} +t8 = v1 + 0xffffffd0; +MEM_U8(sp + 256) = (uint8_t)t8; +goto L45164c; +MEM_U8(sp + 256) = (uint8_t)t8; +L450100: +v1 = MEM_U8(sp + 296); +t9 = s1 + 0x1; +if (v1 != s7) {//nop; +goto L451568;} +//nop; +if (t9 != s0) {a2 = s7; +goto L450168;} +a2 = s7; +a1 = 0x1000da68; +//nop; +a0 = MEM_U32(s6 + 0); +a3 = s7; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L450130; +a1 = a1; +L450130: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L450148; +//nop; +L450148: +gp = MEM_U32(sp + 204); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L450160; +//nop; +L450160: +gp = MEM_U32(sp + 204); +//nop; +L450168: +//nop; +s1 = s1 + 0x1; +a0 = s1; +a1 = s3; +a2 = 0x400; +f_get_arg(mem, sp, a0, a1, a2); +goto L450180; +a2 = 0x400; +L450180: +gp = MEM_U32(sp + 204); +a0 = s3; +//nop; +v0 = s5; +t9 = t9; +//nop; +v0 = func_44e8d0(mem, sp, a0); +goto L45019c; +//nop; +L45019c: +gp = MEM_U32(sp + 204); +//nop; +t1 = 0x10018ed8; +at = 0x10018e84; +t1 = MEM_U32(t1 + 0); +MEM_U32(at + 0) = v0; +at = (int)t1 < (int)0x2; +if (at != 0) {//nop; +goto L450220;} +//nop; +t0 = 0x10018e84; +a2 = 0x25; +t0 = MEM_U32(t0 + 0); +a3 = 0x25; +if (t0 == 0) {//nop; +goto L450220;} +//nop; +at = 0x10018ee0; +a1 = 0x1000da43; +//nop; +MEM_U8(at + 0) = (uint8_t)s4; +a0 = MEM_U32(s6 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L4501f4; +a1 = a1; +L4501f4: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L45020c; +//nop; +L45020c: +gp = MEM_U32(sp + 204); +//nop; +at = 0x10018e84; +//nop; +MEM_U32(at + 0) = zero; +L450220: +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L450234: +v1 = MEM_U8(sp + 296); +at = 0x65; +if (v1 != at) {//nop; +goto L451568;} +//nop; +t2 = MEM_U8(sp + 297); +at = 0x67; +if (t2 != at) {a1 = s3; +goto L451568;} +a1 = s3; +//nop; +s0 = MEM_U8(sp + 298); +s1 = s1 + 0x1; +a0 = s1; +a2 = 0x400; +f_get_arg(mem, sp, a0, a1, a2); +goto L45026c; +a2 = 0x400; +L45026c: +gp = MEM_U32(sp + 204); +a0 = s3; +//nop; +v0 = s5; +t9 = t9; +//nop; +v0 = func_44e8d0(mem, sp, a0); +goto L450288; +//nop; +L450288: +gp = MEM_U32(sp + 204); +a1 = v0; +//nop; +v0 = s5; +t9 = t9; +a0 = s0; +func_44e9dc(mem, sp, a0, a1); +goto L4502a4; +a0 = s0; +L4502a4: +gp = MEM_U32(sp + 204); +//nop; +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L4502c0: +v1 = MEM_U8(sp + 296); +at = 0x72; +if (v1 != at) {//nop; +goto L45034c;} +//nop; +t3 = MEM_U8(sp + 297); +at = 0x65; +if (t3 != at) {//nop; +goto L45034c;} +//nop; +v0 = MEM_U8(sp + 298); +at = 0x67; +if (v0 != at) {a1 = s3; +goto L45034c;} +a1 = s3; +//nop; +s0 = MEM_U8(sp + 299); +s1 = s1 + 0x1; +a0 = s1; +a2 = 0x400; +f_get_arg(mem, sp, a0, a1, a2); +goto L450308; +a2 = 0x400; +L450308: +gp = MEM_U32(sp + 204); +a0 = s3; +//nop; +v0 = s5; +t9 = t9; +//nop; +v0 = func_44e8d0(mem, sp, a0); +goto L450324; +//nop; +L450324: +gp = MEM_U32(sp + 204); +a1 = v0; +//nop; +v0 = s5; +t9 = t9; +a0 = s0; +func_44ecc0(mem, sp, a0, a1); +goto L450340; +a0 = s0; +L450340: +gp = MEM_U32(sp + 204); +//nop; +goto L450414; +//nop; +L45034c: +t5 = 0x1000da23; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t6 = t5 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t5) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0xb($sp) +at = t5 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t5) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t6 = t5 + 12; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0xf($t5) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x13($sp) +at = t5 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t5) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t6 = t5 + 20; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0x17($t5) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x1b($sp) +at = t5 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t5) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t6 = t5 + 28; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0x1f($t5) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L4503fc; +//swr $t6, 0x23($sp) +L4503fc: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L451568;} +//nop; +at = 0x10019344; +//nop; +MEM_U8(at + 0) = (uint8_t)s4; +L450414: +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L450428: +v1 = MEM_U8(sp + 296); +//nop; +if (v1 != s7) {//nop; +goto L451568;} +//nop; +MEM_U8(sp + 254) = (uint8_t)s4; +goto L45164c; +MEM_U8(sp + 254) = (uint8_t)s4; +L450440: +v1 = MEM_U8(sp + 296); +at = 0x50; +if (v1 != at) {//nop; +goto L451568;} +//nop; +at = 0x1001938c; +MEM_U8(at + 0) = (uint8_t)s4; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)s4; +L45045c: +v1 = MEM_U8(sp + 296); +//nop; +if (v1 != s7) {//nop; +goto L451568;} +//nop; +MEM_U8(sp + 1318) = (uint8_t)s4; +goto L45164c; +MEM_U8(sp + 1318) = (uint8_t)s4; +L450474: +t7 = 0x1000da03; +a0 = s3; +t7 = t7; +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +v0 = s5; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t9 = t7 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t7) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0xb($sp) +at = t7 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t7) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t9 = t7 + 12; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 0xf($t7) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x13($sp) +at = t7 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t7) +//nop; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t9 = t7 + 20; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 0x17($t7) +//nop; +MEM_U8(sp + 24 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x1b($sp) +at = t7 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t7) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t9 = t7 + 28; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 0x1f($t7) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x23($sp) +//nop; +//nop; +t9 = t9; +//nop; +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L450534; +//nop; +L450534: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L45054c;} +//nop; +at = 0x10019370; +MEM_U8(at + 0) = (uint8_t)s4; +goto L4507a4; +MEM_U8(at + 0) = (uint8_t)s4; +L45054c: +t1 = 0x1000d9e3; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t2 = t1 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t1) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0xb($sp) +at = t1 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t1) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t2 = t1 + 12; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 0xf($t1) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x13($sp) +at = t1 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t1) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t2 = t1 + 20; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 0x17($t1) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x1b($sp) +at = t1 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t1) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t2 = t1 + 28; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 0x1f($t1) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L4505fc; +//swr $t2, 0x23($sp) +L4505fc: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L450614;} +//nop; +at = 0x10018edc; +MEM_U8(at + 0) = (uint8_t)zero; +goto L4507a4; +MEM_U8(at + 0) = (uint8_t)zero; +L450614: +t3 = 0x1000d9c3; +//nop; +t3 = t3; +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0xb($sp) +at = t3 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t3) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t5 = t3 + 12; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 0xf($t3) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x13($sp) +at = t3 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t3) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t5 = t3 + 20; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 0x17($t3) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x1b($sp) +at = t3 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t3) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t5 = t3 + 28; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 0x1f($t3) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L4506c4; +//swr $t5, 0x23($sp) +L4506c4: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L4506dc;} +//nop; +at = 0x10019360; +MEM_U8(at + 0) = (uint8_t)zero; +goto L4507a4; +MEM_U8(at + 0) = (uint8_t)zero; +L4506dc: +t6 = 0x1000d9a3; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t7 = t6 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t6) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0xb($sp) +at = t6 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t6) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t7 = t6 + 12; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 0xf($t6) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x13($sp) +at = t6 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t6) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t7 = t6 + 20; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 0x17($t6) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x1b($sp) +at = t6 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t6) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t7 = t6 + 28; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 0x1f($t6) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L45078c; +//swr $t7, 0x23($sp) +L45078c: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L451568;} +//nop; +at = 0x1001936c; +//nop; +MEM_U8(at + 0) = (uint8_t)zero; +L4507a4: +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L4507b8: +t9 = 0x1000d983; +a0 = s3; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +v0 = s5; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t1 = t9 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t9) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0xb($sp) +at = t9 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t9) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t1 = t9 + 12; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 0xf($t9) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0x13($sp) +at = t9 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t9) +//nop; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t1 = t9 + 20; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 0x17($t9) +//nop; +MEM_U8(sp + 24 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0x1b($sp) +at = t9 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t9) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t1 = t9 + 28; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 0x1f($t9) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t1 >> 0); +t9 = t9; +//swr $t1, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L45086c; +//swr $t1, 0x23($sp) +L45086c: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L450884;} +//nop; +at = 0x10018eac; +MEM_U8(at + 0) = (uint8_t)zero; +goto L450ae8; +MEM_U8(at + 0) = (uint8_t)zero; +L450884: +t2 = 0x1000d963; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t3 = t2 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t2) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0xb($sp) +at = t2 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t2) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t3 = t2 + 12; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0xf($t2) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x13($sp) +at = t2 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t2) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t3 = t2 + 20; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0x17($t2) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x1b($sp) +at = t2 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t2) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t3 = t2 + 28; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0x1f($t2) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L450934; +//swr $t3, 0x23($sp) +L450934: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L45094c;} +//nop; +at = 0x10018eac; +MEM_U8(at + 0) = (uint8_t)s4; +goto L450ae8; +MEM_U8(at + 0) = (uint8_t)s4; +L45094c: +t5 = 0x1000d943; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t6 = t5 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t5) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0xb($sp) +at = t5 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t5) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t6 = t5 + 12; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0xf($t5) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x13($sp) +at = t5 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t5) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t6 = t5 + 20; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0x17($t5) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x1b($sp) +at = t5 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t5) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t6 = t5 + 28; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0x1f($t5) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L4509fc; +//swr $t6, 0x23($sp) +L4509fc: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L450a20;} +//nop; +at = 0x10018eac; +t7 = 0x2; +MEM_U8(at + 0) = (uint8_t)t7; +at = 0x10018ecc; +MEM_U8(at + 0) = (uint8_t)s4; +goto L450ae8; +MEM_U8(at + 0) = (uint8_t)s4; +L450a20: +t0 = 0x1000d923; +//nop; +t0 = t0; +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t0) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t1 = t0 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t0) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0xb($sp) +at = t0 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t0) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t1 = t0 + 12; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 0xf($t0) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0x13($sp) +at = t0 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t0) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t1 = t0 + 20; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 0x17($t0) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0x1b($sp) +at = t0 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t0) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t1 = t0 + 28; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 0x1f($t0) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L450ad0; +//swr $t1, 0x23($sp) +L450ad0: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L451568;} +//nop; +at = 0x10018ec4; +//nop; +MEM_U8(at + 0) = (uint8_t)s4; +L450ae8: +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L450afc: +t4 = 0x1000d903; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t3 = t4 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t4) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0xb($sp) +at = t4 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t4) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t3 = t4 + 12; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0xf($t4) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x13($sp) +at = t4 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t4) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t3 = t4 + 20; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0x17($t4) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x1b($sp) +at = t4 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t4) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t3 = t4 + 28; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0x1f($t4) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L450bac; +//swr $t3, 0x23($sp) +L450bac: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L450bc4;} +//nop; +at = 0x10018ed8; +MEM_U32(at + 0) = zero; +goto L450e14; +MEM_U32(at + 0) = zero; +L450bc4: +t8 = 0x1000d8e3; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t6 = t8 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t8) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0xb($sp) +at = t8 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t8) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t6 = t8 + 12; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0xf($t8) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x13($sp) +at = t8 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t8) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t6 = t8 + 20; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0x17($t8) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x1b($sp) +at = t8 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t8) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t6 = t8 + 28; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0x1f($t8) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L450c74; +//swr $t6, 0x23($sp) +L450c74: +gp = MEM_U32(sp + 204); +if (v0 != 0) {//nop; +goto L450d3c;} +//nop; +t7 = 0x1000d8c3; +//nop; +t7 = t7; +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t0 = t7 + 4; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 7($t7) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0xb($sp) +at = t7 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t7) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t0 = t7 + 12; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 0xf($t7) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0x13($sp) +at = t7 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t7) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t0 = t7 + 20; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 0x17($t7) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0x1b($sp) +at = t7 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t7) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t0 = t7 + 28; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 0x1f($t7) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L450d30; +//swr $t0, 0x23($sp) +L450d30: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L450d4c;} +//nop; +L450d3c: +at = 0x10018ed8; +t1 = 0x1; +MEM_U32(at + 0) = t1; +goto L450e14; +MEM_U32(at + 0) = t1; +L450d4c: +t2 = 0x1000d8a3; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t3 = t2 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t2) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0xb($sp) +at = t2 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t2) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t3 = t2 + 12; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0xf($t2) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x13($sp) +at = t2 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t2) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t3 = t2 + 20; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0x17($t2) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x1b($sp) +at = t2 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t2) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t3 = t2 + 28; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0x1f($t2) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L450dfc; +//swr $t3, 0x23($sp) +L450dfc: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L451568;} +//nop; +at = 0x10018ed8; +t5 = 0x2; +MEM_U32(at + 0) = t5; +L450e14: +t8 = 0x10018ed8; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +at = (int)t8 < (int)0x2; +if (at != 0) {//nop; +goto L450e80;} +//nop; +t6 = 0x10018ee0; +at = 0x10018e84; +t6 = MEM_U8(t6 + 0); +a2 = 0x25; +if (t6 == 0) {MEM_U32(at + 0) = zero; +goto L450e80;} +MEM_U32(at + 0) = zero; +a1 = 0x1000d87e; +//nop; +a0 = MEM_U32(s6 + 0); +a3 = 0x25; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L450e60; +a1 = a1; +L450e60: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L450e78; +//nop; +L450e78: +gp = MEM_U32(sp + 204); +//nop; +L450e80: +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L450e94: +v1 = MEM_U8(sp + 296); +at = 0x70; +if (v1 != at) {//nop; +goto L450ec0;} +//nop; +t9 = MEM_U8(sp + 297); +at = 0x63; +if (t9 != at) {//nop; +goto L450ec0;} +//nop; +at = 0x10018eb0; +MEM_U8(at + 0) = (uint8_t)s4; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)s4; +L450ec0: +t7 = 0x1000d85e; +//nop; +t7 = t7; +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t1 = t7 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t7) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0xb($sp) +at = t7 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t7) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t1 = t7 + 12; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 0xf($t7) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0x13($sp) +at = t7 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t7) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t1 = t7 + 20; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 0x17($t7) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0x1b($sp) +at = t7 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t7) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t1 = t7 + 28; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 0x1f($t7) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t1 >> 0); +//swr $t1, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L450f70; +//swr $t1, 0x23($sp) +L450f70: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L450f90;} +//nop; +s0 = 0x10018df0; +at = 0x10018eb4; +s0 = MEM_U32(s0 + 0); +MEM_U8(at + 0) = (uint8_t)s4; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)s4; +L450f90: +t4 = 0x1000d83e; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t3 = t4 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t4) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0xb($sp) +at = t4 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t4) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t3 = t4 + 12; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0xf($t4) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x13($sp) +at = t4 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t4) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t3 = t4 + 20; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0x17($t4) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x1b($sp) +at = t4 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t4) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t3 = t4 + 28; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0x1f($t4) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L451040; +//swr $t3, 0x23($sp) +L451040: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L451060;} +//nop; +s0 = 0x10018df0; +at = 0x10018eb8; +s0 = MEM_U32(s0 + 0); +MEM_U8(at + 0) = (uint8_t)s4; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)s4; +L451060: +t5 = 0x1000d81e; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t6 = t5 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t5) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0xb($sp) +at = t5 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t5) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t6 = t5 + 12; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0xf($t5) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x13($sp) +at = t5 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t5) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t6 = t5 + 20; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0x17($t5) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x1b($sp) +at = t5 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t5) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t6 = t5 + 28; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 0x1f($t5) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L451110; +//swr $t6, 0x23($sp) +L451110: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L451130;} +//nop; +s0 = 0x10018df0; +at = 0x10018ebc; +s0 = MEM_U32(s0 + 0); +MEM_U8(at + 0) = (uint8_t)s4; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)s4; +L451130: +t9 = 0x1000d7fe; +a0 = s3; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +v0 = s5; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t7 = t9 + 4; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 7($t9) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0xb($sp) +at = t9 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t9) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t7 = t9 + 12; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 0xf($t9) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x13($sp) +at = t9 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t9) +//nop; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t7 = t9 + 20; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 0x17($t9) +//nop; +MEM_U8(sp + 24 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t7 >> 0); +//swr $t7, 0x1b($sp) +at = t9 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t9) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t7 = t9 + 28; t7 = (MEM_U8(t7) << 24) | (MEM_U8(t7 + 1) << 16) | (MEM_U8(t7 + 2) << 8) | MEM_U8(t7 + 3); +//lwr $t7, 0x1f($t9) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t7 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t7 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t7 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t7 >> 0); +t9 = t9; +//swr $t7, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L4511e4; +//swr $t7, 0x23($sp) +L4511e4: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L451568;} +//nop; +s0 = 0x10018df0; +at = 0x10018ec0; +s0 = MEM_U32(s0 + 0); +MEM_U8(at + 0) = (uint8_t)s4; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)s4; +L451204: +v0 = MEM_U8(sp + 296); +//nop; +t1 = v0 + 0xffffffcf; +at = t1 < 0x3; +if (at == 0) {//nop; +goto L45126c;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000dc1c[] = { +&&L45123c, +&&L45124c, +&&L451258, +}; +dest = Lswitch1000dc1c[t1]; +//nop; +goto *dest; +//nop; +L45123c: +at = 0x10018dfc; +MEM_U32(sp + 248) = s4; +MEM_U8(at + 0) = (uint8_t)zero; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)zero; +L45124c: +t2 = 0x2; +MEM_U32(sp + 248) = t2; +goto L45164c; +MEM_U32(sp + 248) = t2; +L451258: +at = 0x10018dfc; +t4 = 0x3; +MEM_U32(sp + 248) = t4; +MEM_U8(at + 0) = (uint8_t)zero; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)zero; +L45126c: +at = 0x10018dfc; +MEM_U8(at + 0) = (uint8_t)zero; +goto L45164c; +MEM_U8(at + 0) = (uint8_t)zero; +L451278: +t3 = 0x1000d7de; +//nop; +t3 = t3; +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t5 = t3 + 4; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 7($t3) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0xb($sp) +at = t3 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t3) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t5 = t3 + 12; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 0xf($t3) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x13($sp) +at = t3 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t3) +a0 = s3; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t5 = t3 + 20; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 0x17($t3) +v0 = s5; +MEM_U8(sp + 24 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x1b($sp) +at = t3 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t3) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t5 = t3 + 28; t5 = (MEM_U8(t5) << 24) | (MEM_U8(t5 + 1) << 16) | (MEM_U8(t5 + 2) << 8) | MEM_U8(t5 + 3); +//lwr $t5, 0x1f($t3) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t5 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t5 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t5 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t5 >> 0); +//swr $t5, 0x23($sp) +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L451328; +//swr $t5, 0x23($sp) +L451328: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L451340;} +//nop; +at = 0x10018edc; +MEM_U8(at + 0) = (uint8_t)s4; +goto L4514b8; +MEM_U8(at + 0) = (uint8_t)s4; +L451340: +t6 = 0x1000d7be; +a0 = s3; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +v0 = s5; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t9 = t6 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t6) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0xb($sp) +at = t6 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t6) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +t9 = t6 + 12; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 0xf($t6) +a3 = MEM_U32(sp + 12); +MEM_U8(sp + 16 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(sp + 16 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(sp + 16 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(sp + 16 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x13($sp) +at = t6 + 16; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x13($t6) +//nop; +MEM_U8(sp + 20 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 20 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 20 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 20 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x17($sp) +t9 = t6 + 20; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 0x17($t6) +//nop; +MEM_U8(sp + 24 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(sp + 24 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(sp + 24 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(sp + 24 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x1b($sp) +at = t6 + 24; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0x1b($t6) +//nop; +MEM_U8(sp + 28 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 28 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 28 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 28 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x1f($sp) +t9 = t6 + 28; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 0x1f($t6) +//nop; +MEM_U8(sp + 32 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(sp + 32 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(sp + 32 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(sp + 32 + 3) = (uint8_t)(t9 >> 0); +//swr $t9, 0x23($sp) +//nop; +//nop; +t9 = t9; +//nop; +v0 = func_44f58c(mem, sp, a0, a1, a2, a3); +goto L451400; +//nop; +L451400: +gp = MEM_U32(sp + 204); +if (v0 == 0) {//nop; +goto L451568;} +//nop; +t1 = 0x10018df0; +t7 = s1 + 0x1; +t1 = MEM_U32(t1 + 0); +a2 = 0x29; +if (t7 != t1) {a3 = 0x29; +goto L451470;} +a3 = 0x29; +a1 = 0x1000d795; +//nop; +a0 = MEM_U32(s6 + 0); +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L451438; +a1 = a1; +L451438: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L451450; +//nop; +L451450: +gp = MEM_U32(sp + 204); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L451468; +//nop; +L451468: +gp = MEM_U32(sp + 204); +//nop; +L451470: +//nop; +s1 = s1 + 0x1; +a0 = s1; +a1 = s3; +a2 = 0x400; +f_get_arg(mem, sp, a0, a1, a2); +goto L451488; +a2 = 0x400; +L451488: +gp = MEM_U32(sp + 204); +a0 = s3; +//nop; +v0 = s5; +t9 = t9; +//nop; +v0 = func_44e8d0(mem, sp, a0); +goto L4514a4; +//nop; +L4514a4: +gp = MEM_U32(sp + 204); +//nop; +at = 0x100197c0; +//nop; +MEM_U32(at + 0) = v0; +L4514b8: +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L4514cc: +v1 = MEM_U8(sp + 296); +at = 0x34; +if (v1 != at) {//nop; +goto L451568;} +//nop; +t2 = MEM_U8(sp + 297); +at = 0x64; +if (t2 != at) {//nop; +goto L451568;} +//nop; +v0 = MEM_U8(sp + 298); +at = 0x61; +if (v0 != at) {//nop; +goto L451568;} +//nop; +t4 = MEM_U8(sp + 299); +at = 0x74; +if (t4 != at) {//nop; +goto L451568;} +//nop; +t8 = MEM_U8(sp + 300); +at = 0x61; +if (t8 != at) {//nop; +goto L451568;} +//nop; +t3 = MEM_U8(sp + 301); +//nop; +if (t3 != s7) {//nop; +goto L451568;} +//nop; +at = 0x10018eac; +t5 = 0x2; +MEM_U8(at + 0) = (uint8_t)t5; +at = 0x10018ecc; +t0 = 0xf; +MEM_U8(at + 0) = (uint8_t)s4; +at = 0x10018ed0; +t6 = 0x8; +MEM_U8(at + 0) = (uint8_t)s4; +at = 0x10019348; +//nop; +MEM_U8(at + 0) = (uint8_t)t0; +at = 0x1001934c; +MEM_U32(at + 0) = t6; +goto L45164c; +MEM_U32(at + 0) = t6; +L451568: +//nop; +a0 = MEM_U32(s6 + 0); +a1 = s3; +a2 = 0x400; +a3 = zero; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L451580; +a3 = zero; +L451580: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +a1 = 0x1000d786; +//nop; +a2 = 0xf; +a3 = 0xf; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L4515a0; +a1 = a1; +L4515a0: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L4515b8; +//nop; +L4515b8: +gp = MEM_U32(sp + 204); +//nop; +s0 = 0x10018df0; +//nop; +s0 = MEM_U32(s0 + 0); +s1 = s1 + 0x1; +goto L451650; +s1 = s1 + 0x1; +L4515d4: +at = 0x36; +if (v0 == at) {t9 = v0 + 0xffffffbb; +goto L4514cc;} +t9 = v0 + 0xffffffbb; +at = t9 < 0xb; +if (at == 0) {//nop; +goto L451568;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000dc28[] = { +&&L44ffe4, +&&L450440, +&&L450100, +&&L451568, +&&L451568, +&&L451568, +&&L451568, +&&L450428, +&&L451568, +&&L451568, +&&L45008c, +}; +dest = Lswitch1000dc28[t9]; +//nop; +goto *dest; +//nop; +L45160c: +//nop; +a1 = sp + 0x11a8; +a2 = 0x400; +s2 = 0x400; +f_get_arg(mem, sp, a0, a1, a2); +goto L451620; +s2 = 0x400; +L451620: +t7 = MEM_U8(sp + 5543); +gp = MEM_U32(sp + 204); +if (s7 != t7) {//nop; +goto L45164c;} +//nop; +L451630: +s2 = s2 + 0xffffffff; +if (s2 == 0) {t1 = fp + s2; +goto L45164c;} +t1 = fp + s2; +t2 = MEM_U8(t1 + 0); +//nop; +if (s7 == t2) {//nop; +goto L451630;} +//nop; +L45164c: +s1 = s1 + 0x1; +L451650: +at = (int)s1 < (int)s0; +if (at != 0) {//nop; +goto L44f8a4;} +//nop; +MEM_U32(sp + 280) = s2; +t4 = MEM_U8(sp + 4520); +L451664: +s2 = MEM_U32(sp + 280); +s6 = 0x10006560; +s5 = sp + 0x1db8; +if (t4 != 0) {s7 = 0x20; +goto L4516cc;} +s7 = 0x20; +a1 = 0x1000d772; +//nop; +a0 = MEM_U32(s6 + 0); +a2 = 0x14; +a3 = 0x14; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L451694; +a1 = a1; +L451694: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L4516ac; +//nop; +L4516ac: +gp = MEM_U32(sp + 204); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4516c4; +//nop; +L4516c4: +gp = MEM_U32(sp + 204); +//nop; +L4516cc: +t8 = 0x10019310; +t3 = 0x10019318; +t0 = 0x10019320; +t8 = MEM_U32(t8 + 0); +t3 = MEM_U32(t3 + 0); +t0 = MEM_U32(t0 + 0); +t5 = t8 + t3; +t6 = t5 + t0; +at = (int)t6 < (int)0x13; +if (at != 0) {a0 = 0x4; +goto L451818;} +a0 = 0x4; +t9 = 0x1000d722; +a1 = 0x2f2; +t9 = t9; +t1 = t9 + 0x48; +t2 = sp; +L45170c: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t2 = t2 + 0xc; +MEM_U8(t2 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t2) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t2 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 4 + 3) = (uint8_t)(at >> 0); +if (t9 != t1) {//swr $at, 7($t2) +goto L45170c;} +//swr $at, 7($t2) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t4 = 0x1000d6d2; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +t1 = t9 + 4; t1 = (MEM_U8(t1) << 24) | (MEM_U8(t1 + 1) << 16) | (MEM_U8(t1 + 2) << 8) | MEM_U8(t1 + 3); +//lwr $t1, 7($t9) +t4 = t4; +MEM_U8(t2 + 12 + 0) = (uint8_t)(t1 >> 24); +MEM_U8(t2 + 12 + 1) = (uint8_t)(t1 >> 16); +MEM_U8(t2 + 12 + 2) = (uint8_t)(t1 >> 8); +MEM_U8(t2 + 12 + 3) = (uint8_t)(t1 >> 0); +t3 = t4 + 0x48; +t5 = sp; +//swr $t1, 0xf($t2) +L45177c: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t5 = t5 + 0xc; +MEM_U8(t5 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t5) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t5 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t3) {//swr $at, 0x57($t5) +goto L45177c;} +//swr $at, 0x57($t5) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +t3 = t4 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t4) +//nop; +MEM_U8(t5 + 92 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t5 + 92 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t5 + 92 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t5 + 92 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x5f($t5) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L4517f8; +//nop; +L4517f8: +gp = MEM_U32(sp + 204); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L451810; +//nop; +L451810: +gp = MEM_U32(sp + 204); +//nop; +L451818: +t0 = 0x10019314; +t6 = 0x1001931c; +t1 = 0x10019324; +t0 = MEM_U32(t0 + 0); +t6 = MEM_U32(t6 + 0); +t1 = MEM_U32(t1 + 0); +t7 = t0 + t6; +t9 = t7 + t1; +at = (int)t9 < (int)0xb; +if (at != 0) {a0 = 0x4; +goto L451964;} +a0 = 0x4; +t2 = 0x1000d682; +a1 = 0x2f7; +t2 = t2; +t3 = t2 + 0x48; +t4 = sp; +L451858: +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t2 = t2 + 0xc; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +at = t2 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t2) +t4 = t4 + 0xc; +MEM_U8(t4 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t4) +at = t2 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t2) +//nop; +MEM_U8(t4 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 4 + 3) = (uint8_t)(at >> 0); +if (t2 != t3) {//swr $at, 7($t4) +goto L451858;} +//swr $at, 7($t4) +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t5 = 0x1000d632; +MEM_U8(t4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t4) +t3 = t2 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t2) +t5 = t5; +MEM_U8(t4 + 12 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 12 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 12 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 12 + 3) = (uint8_t)(t3 >> 0); +t6 = t5 + 0x48; +t7 = sp; +//swr $t3, 0xf($t4) +L4518c8: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t7 = t7 + 0xc; +MEM_U8(t7 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t7) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t7 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 84 + 3) = (uint8_t)(at >> 0); +if (t5 != t6) {//swr $at, 0x57($t7) +goto L4518c8;} +//swr $at, 0x57($t7) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +//nop; +MEM_U8(t7 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t7) +t6 = t5 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t5) +//nop; +MEM_U8(t7 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t7 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t7 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t7 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t7) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L451944; +//nop; +L451944: +gp = MEM_U32(sp + 204); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L45195c; +//nop; +L45195c: +gp = MEM_U32(sp + 204); +//nop; +L451964: +t1 = 0x10019344; +//nop; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 == 0) {//nop; +goto L451ab4;} +//nop; +v0 = 0x10018eac; +a0 = 0x4; +v0 = MEM_U8(v0 + 0); +a1 = 0x2fc; +if (v0 == 0) {t5 = sp; +goto L45199c;} +t5 = sp; +if (s4 != v0) {//nop; +goto L451ab4;} +//nop; +L45199c: +t9 = 0x1000d5e2; +t2 = sp; +t9 = t9; +t3 = t9 + 0x48; +L4519ac: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t2 = t2 + 0xc; +MEM_U8(t2 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t2) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t2 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 4 + 3) = (uint8_t)(at >> 0); +if (t9 != t3) {//swr $at, 7($t2) +goto L4519ac;} +//swr $at, 7($t2) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t4 = 0x1000d592; +MEM_U8(t2 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t2 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t2 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t2 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t2) +t3 = t9 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t9) +t4 = t4; +MEM_U8(t2 + 12 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t2 + 12 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t2 + 12 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t2 + 12 + 3) = (uint8_t)(t3 >> 0); +t6 = t4 + 0x48; +//swr $t3, 0xf($t2) +L451a18: +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t4 = t4 + 0xc; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +at = t4 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t4) +t5 = t5 + 0xc; +MEM_U8(t5 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t5) +at = t4 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t4) +//nop; +MEM_U8(t5 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 84 + 3) = (uint8_t)(at >> 0); +if (t4 != t6) {//swr $at, 0x57($t5) +goto L451a18;} +//swr $at, 0x57($t5) +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +//nop; +MEM_U8(t5 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t5 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t5 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t5 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t5) +t6 = t4 + 4; t6 = (MEM_U8(t6) << 24) | (MEM_U8(t6 + 1) << 16) | (MEM_U8(t6 + 2) << 8) | MEM_U8(t6 + 3); +//lwr $t6, 7($t4) +//nop; +MEM_U8(t5 + 92 + 0) = (uint8_t)(t6 >> 24); +MEM_U8(t5 + 92 + 1) = (uint8_t)(t6 >> 16); +MEM_U8(t5 + 92 + 2) = (uint8_t)(t6 >> 8); +MEM_U8(t5 + 92 + 3) = (uint8_t)(t6 >> 0); +//swr $t6, 0x5f($t5) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L451a94; +//nop; +L451a94: +gp = MEM_U32(sp + 204); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L451aac; +//nop; +L451aac: +gp = MEM_U32(sp + 204); +//nop; +L451ab4: +t7 = 0x10018e88; +t1 = MEM_U8(sp + 3495); +t7 = MEM_U8(t7 + 0); +a0 = sp + 0x11c; +if (t7 == 0) {a1 = sp + 0x9a8; +goto L451c64;} +a1 = sp + 0x9a8; +if (s7 != t1) {v0 = 0x400; +goto L451af4;} +v0 = 0x400; +v1 = sp + 0x9a7; +L451ad8: +v0 = v0 + 0xffffffff; +if (v0 == 0) {t8 = v1 + v0; +goto L451af4;} +t8 = v1 + v0; +t3 = MEM_U8(t8 + 0); +//nop; +if (s7 == t3) {//nop; +goto L451ad8;} +//nop; +L451af4: +v1 = sp + 0x9a7; +t9 = v1 + v0; +MEM_U8(t9 + 1) = (uint8_t)zero; +//nop; +a2 = 0x400; +a3 = zero; +f_rewrite(mem, sp, a0, a1, a2, a3); +goto L451b10; +a3 = zero; +L451b10: +t2 = MEM_U8(sp + 1320); +gp = MEM_U32(sp + 204); +if (t2 != 0) {v0 = s2 + 0xffffffff; +goto L451bc0;} +v0 = s2 + 0xffffffff; +if (v0 == 0) {a1 = v0 + 0x1; +goto L451ba8;} +a1 = v0 + 0x1; +a2 = a1 + 0xffffffff; +t0 = a2 & 0x3; +if (t0 == 0) {s1 = 0x1; +goto L451b68;} +s1 = 0x1; +t6 = sp + 0x527; +t4 = sp + 0x11a7; +v0 = s1 + t4; +v1 = s1 + t6; +a0 = t0 + 0x1; +L451b4c: +t5 = MEM_U8(v0 + 0); +s1 = s1 + 0x1; +v1 = v1 + 0x1; +v0 = v0 + 0x1; +if (a0 != s1) {MEM_U8(v1 + -1) = (uint8_t)t5; +goto L451b4c;} +MEM_U8(v1 + -1) = (uint8_t)t5; +if (s1 == a1) {t1 = sp + 0x11a7; +goto L451ba8;} +L451b68: +t1 = sp + 0x11a7; +t7 = sp + 0x527; +v1 = s1 + t7; +v0 = s1 + t1; +a0 = a1 + t1; +L451b7c: +t8 = MEM_U8(v0 + 0); +t3 = MEM_U8(v0 + 1); +t9 = MEM_U8(v0 + 2); +t2 = MEM_U8(v0 + 3); +v0 = v0 + 0x4; +v1 = v1 + 0x4; +MEM_U8(v1 + -4) = (uint8_t)t8; +MEM_U8(v1 + -3) = (uint8_t)t3; +MEM_U8(v1 + -2) = (uint8_t)t9; +if (v0 != a0) {MEM_U8(v1 + -1) = (uint8_t)t2; +goto L451b7c;} +MEM_U8(v1 + -1) = (uint8_t)t2; +L451ba8: +v1 = sp + 0x527; +t6 = v1 + s2; +t0 = 0x54; +v0 = s2; +MEM_U8(t6 + 0) = (uint8_t)t0; +goto L451bec; +MEM_U8(t6 + 0) = (uint8_t)t0; +L451bc0: +t4 = MEM_U8(sp + 1446); +v0 = 0x7f; +if (s7 != t4) {v1 = sp + 0x527; +goto L451bec;} +v1 = sp + 0x527; +L451bd0: +v0 = v0 + 0xffffffff; +if (v0 == 0) {t5 = v1 + v0; +goto L451bec;} +t5 = v1 + v0; +t7 = MEM_U8(t5 + 0); +//nop; +if (s7 == t7) {//nop; +goto L451bd0;} +//nop; +L451bec: +v1 = sp + 0x527; +t1 = v1 + v0; +MEM_U8(t1 + 1) = (uint8_t)zero; +//nop; +a0 = sp + 0x528; +a1 = 0x72; +v0 = f_st_readbinary(mem, sp, a0, a1); +goto L451c08; +a1 = 0x72; +L451c08: +gp = MEM_U32(sp + 204); +if ((int)v0 >= 0) {a2 = 0x1d; +goto L451c64;} +a2 = 0x1d; +a1 = 0x1000d575; +//nop; +a0 = MEM_U32(s6 + 0); +a3 = 0x1d; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L451c2c; +a1 = a1; +L451c2c: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s6 + 0); +//nop; +//nop; +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L451c44; +//nop; +L451c44: +gp = MEM_U32(sp + 204); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L451c5c; +//nop; +L451c5c: +gp = MEM_U32(sp + 204); +//nop; +L451c64: +//nop; +//nop; +//nop; +f_initialize_tree(mem, sp); +goto L451c74; +//nop; +L451c74: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +f_init_ibuffer(mem, sp); +goto L451c8c; +//nop; +L451c8c: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +f_uini(mem, sp); +goto L451ca4; +//nop; +L451ca4: +gp = MEM_U32(sp + 204); +a0 = sp + 0x11a8; +//nop; +//nop; +//nop; +f_initur(mem, sp, a0); +goto L451cbc; +//nop; +L451cbc: +t8 = MEM_U8(sp + 3496); +gp = MEM_U32(sp + 204); +if (t8 != 0) {t9 = sp + 0x11a8; +goto L451d3c;} +t9 = sp + 0x11a8; +v1 = sp + 0xda7; +t0 = t9 + 0x3fc; +t3 = sp + 0xda8; +L451cd8: +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t9 = t9 + 0xc; +MEM_U8(t3 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t3) +at = t9 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t9) +t3 = t3 + 0xc; +MEM_U8(t3 + -8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + -8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + -8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + -8 + 3) = (uint8_t)(at >> 0); +//swr $at, -5($t3) +at = t9 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t9) +//nop; +MEM_U8(t3 + -4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + -4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + -4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + -4 + 3) = (uint8_t)(at >> 0); +if (t9 != t0) {//swr $at, -1($t3) +goto L451cd8;} +//swr $at, -1($t3) +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +t6 = 0x47; +MEM_U8(t3 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 0 + 3) = (uint8_t)(at >> 0); +t4 = v1 + s2; +//swr $at, 3($t3) +MEM_U8(t4 + 0) = (uint8_t)t6; +v0 = s2; +goto L451d68; +v0 = s2; +L451d3c: +t5 = MEM_U8(sp + 4519); +v0 = 0x400; +if (s7 != t5) {v1 = sp + 0xda7; +goto L451d68;} +v1 = sp + 0xda7; +L451d4c: +v0 = v0 + 0xffffffff; +if (v0 == 0) {t7 = v1 + v0; +goto L451d68;} +t7 = v1 + v0; +t1 = MEM_U8(t7 + 0); +//nop; +if (s7 == t1) {//nop; +goto L451d4c;} +//nop; +L451d68: +v1 = sp + 0xda7; +t8 = v1 + v0; +MEM_U32(sp + 224) = t8; +MEM_U8(t8 + 1) = (uint8_t)zero; +t0 = MEM_U8(sp + 5552); +t9 = MEM_U8(sp + 6575); +if (t0 != 0) {//nop; +goto L451da8;} +//nop; +//nop; +v0 = s5; +t9 = t9; +//nop; +func_44f344(mem, sp, v0); +goto L451d9c; +//nop; +L451d9c: +gp = MEM_U32(sp + 204); +t5 = MEM_U8(sp + 6584); +goto L451de0; +t5 = MEM_U8(sp + 6584); +L451da8: +if (s7 != t9) {v0 = 0x400; +goto L451dd0;} +v0 = 0x400; +v1 = sp + 0x15af; +L451db4: +v0 = v0 + 0xffffffff; +if (v0 == 0) {t3 = v1 + v0; +goto L451dd0;} +t3 = v1 + v0; +t6 = MEM_U8(t3 + 0); +//nop; +if (s7 == t6) {//nop; +goto L451db4;} +//nop; +L451dd0: +v1 = sp + 0x15af; +t4 = v1 + v0; +MEM_U8(t4 + 1) = (uint8_t)zero; +t5 = MEM_U8(sp + 6584); +L451de0: +a0 = sp + 0x19b0; +if (t5 == 0) {a1 = sp + 0x19b8; +goto L451e04;} +a1 = sp + 0x19b8; +//nop; +a2 = 0x400; +a3 = zero; +f_rewrite(mem, sp, a0, a1, a2, a3); +goto L451dfc; +a3 = zero; +L451dfc: +gp = MEM_U32(sp + 204); +//nop; +L451e04: +//nop; +a0 = MEM_U8(sp + 256); +a1 = MEM_U8(sp + 260); +//nop; +f_set_opts(mem, sp, a0, a1); +goto L451e18; +//nop; +L451e18: +t7 = MEM_U8(sp + 1318); +gp = MEM_U32(sp + 204); +if (t7 == 0) {a2 = 0x5; +goto L451e48;} +a2 = 0x5; +a1 = 0x1000d570; +//nop; +a0 = MEM_U32(s6 + 0); +a3 = 0x5; +a1 = a1; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L451e40; +a1 = a1; +L451e40: +gp = MEM_U32(sp + 204); +//nop; +L451e48: +//nop; +//nop; +//nop; +f_clear_sym_tab(mem, sp); +goto L451e58; +//nop; +L451e58: +gp = MEM_U32(sp + 204); +a0 = sp + 0x15b0; +//nop; +//nop; +//nop; +f_open_bin_file(mem, sp, a0); +goto L451e70; +//nop; +L451e70: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +f_init_build(mem, sp); +goto L451e88; +//nop; +L451e88: +gp = MEM_U32(sp + 204); +//nop; +fp = 0x10018e70; +s4 = 0x10018e6c; +s3 = 0x10019354; +s2 = 0x1001937c; +s1 = 0x10019378; +//nop; +L451ea8: +//nop; +//nop; +//nop; +f_clear_ibuffer(mem, sp); +goto L451eb8; +//nop; +L451eb8: +gp = MEM_U32(sp + 204); +a0 = s1; +//nop; +//nop; +//nop; +v0 = f_alloc_mark(mem, sp, a0); +goto L451ed0; +//nop; +L451ed0: +gp = MEM_U32(sp + 204); +MEM_U32(s2 + 0) = v0; +//nop; +a0 = MEM_U8(sp + 1318); +//nop; +v0 = f_build_tree(mem, sp, a0); +goto L451ee8; +//nop; +L451ee8: +gp = MEM_U32(sp + 204); +if (v0 == 0) {s0 = v0; +goto L452110;} +s0 = v0; +t1 = MEM_U8(sp + 1319); +a0 = v0; +if (t1 == 0) {//nop; +goto L451f60;} +//nop; +t8 = 0x1000d564; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t0 = t8 + 4; t0 = (MEM_U8(t0) << 24) | (MEM_U8(t0 + 1) << 16) | (MEM_U8(t0 + 2) << 8) | MEM_U8(t0 + 3); +//lwr $t0, 7($t8) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t0 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t0 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t0 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t0 >> 0); +//swr $t0, 0xb($sp) +at = t8 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t8) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +a3 = MEM_U32(sp + 12); +v0 = s5; +func_44f0ec(mem, sp, v0, a0, a1, a2, a3); +goto L451f58; +v0 = s5; +L451f58: +gp = MEM_U32(sp + 204); +//nop; +L451f60: +//nop; +a0 = s0; +//nop; +v0 = f_translate_tree(mem, sp, a0); +goto L451f70; +//nop; +L451f70: +t9 = MEM_U8(sp + 1319); +gp = MEM_U32(sp + 204); +if (t9 == 0) {s0 = v0; +goto L451fe0;} +s0 = v0; +t3 = 0x1000d558; +//nop; +t3 = t3; +at = t3 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t3) +a0 = v0; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +t4 = t3 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t3) +a1 = MEM_U32(sp + 4); +MEM_U8(sp + 8 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(sp + 8 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(sp + 8 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(sp + 8 + 3) = (uint8_t)(t4 >> 0); +//swr $t4, 0xb($sp) +at = t3 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t3) +a2 = MEM_U32(sp + 8); +MEM_U8(sp + 12 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 12 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 12 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 12 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xf($sp) +a3 = MEM_U32(sp + 12); +t9 = t9; +v0 = s5; +func_44f0ec(mem, sp, v0, a0, a1, a2, a3); +goto L451fd8; +v0 = s5; +L451fd8: +gp = MEM_U32(sp + 204); +//nop; +L451fe0: +t5 = MEM_U8(s3 + 0); +t7 = MEM_U8(sp + 6584); +if (t5 == 0) {//nop; +goto L452038;} +//nop; +if (t7 == 0) {a0 = s0; +goto L45201c;} +a0 = s0; +//nop; +a2 = MEM_U8(sp + 1319); +a3 = MEM_U8(sp + 254); +a0 = s0; +a1 = sp + 0x19b0; +f_labelopt(mem, sp, a0, a1, a2, a3); +goto L452010; +a1 = sp + 0x19b0; +L452010: +gp = MEM_U32(sp + 204); +//nop; +goto L452038; +//nop; +L45201c: +//nop; +a2 = MEM_U8(sp + 1319); +a3 = MEM_U8(sp + 254); +a1 = s6; +f_labelopt(mem, sp, a0, a1, a2, a3); +goto L452030; +a1 = s6; +L452030: +gp = MEM_U32(sp + 204); +//nop; +L452038: +//nop; +a0 = s0; +t9 = t9; +v0 = s5; +func_44e934(mem, sp, a0); +goto L45204c; +v0 = s5; +L45204c: +t1 = MEM_U8(sp + 1448); +gp = MEM_U32(sp + 204); +if (t1 == 0) {//nop; +goto L45208c;} +//nop; +//nop; +a0 = sp + 0x5a8; +//nop; +f_inituwrite(mem, sp, a0); +goto L45206c; +//nop; +L45206c: +gp = MEM_U32(sp + 204); +a0 = s0; +//nop; +//nop; +//nop; +f_u_tree(mem, sp, a0); +goto L452084; +//nop; +L452084: +gp = MEM_U32(sp + 204); +//nop; +L45208c: +//nop; +//nop; +//nop; +f_init_eval(mem, sp); +goto L45209c; +//nop; +L45209c: +gp = MEM_U32(sp + 204); +a0 = s0; +//nop; +a1 = 0x48; +//nop; +f_eval(mem, sp, a0, a1); +goto L4520b4; +//nop; +L4520b4: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s4 + 0); +v0 = 0x10018e68; +t8 = 0x10018e78; +v0 = MEM_U32(v0 + 0); +a1 = MEM_U32(fp + 0); +//nop; +t8 = MEM_U32(t8 + 0); +t2 = v0 << 4; +a2 = a0 + t2; +a2 = a2 + 0xfffffff0; +a1 = a1 + 0xffffffff; +a3 = v0 - t8; +f_output_inst_bin(mem, sp, a0, a1, a2, a3); +goto L4520ec; +a3 = v0 - t8; +L4520ec: +gp = MEM_U32(sp + 204); +a1 = MEM_U32(s2 + 0); +//nop; +a0 = s1; +//nop; +f_alloc_release(mem, sp, a0, a1); +goto L452104; +//nop; +L452104: +gp = MEM_U32(sp + 204); +//nop; +goto L451ea8; +//nop; +L452110: +//nop; +//nop; +//nop; +f_close_bin_file(mem, sp); +goto L452120; +//nop; +L452120: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +f_clear_ibuffer(mem, sp); +goto L452138; +//nop; +L452138: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +f_emit_vers(mem, sp); +goto L452150; +//nop; +L452150: +gp = MEM_U32(sp + 204); +//nop; +a0 = 0x10018ed8; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +f_emit_pic(mem, sp, a0); +goto L45216c; +//nop; +L45216c: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +f_output_decls(mem, sp); +goto L452184; +//nop; +L452184: +gp = MEM_U32(sp + 204); +a0 = sp + 0xda8; +//nop; +//nop; +//nop; +f_open_bin_file(mem, sp, a0); +goto L45219c; +//nop; +L45219c: +gp = MEM_U32(sp + 204); +a0 = MEM_U32(s4 + 0); +v0 = 0x10018e68; +t9 = 0x10018e78; +v0 = MEM_U32(v0 + 0); +t9 = MEM_U32(t9 + 0); +a1 = MEM_U32(fp + 0); +a3 = v0 - t9; +//nop; +t0 = v0 << 4; +a2 = a0 + t0; +a2 = a2 + 0xfffffff0; +a1 = a1 + 0xffffffff; +f_output_inst_bin(mem, sp, a0, a1, a2, a3); +goto L4521d4; +a1 = a1 + 0xffffffff; +L4521d4: +gp = MEM_U32(sp + 204); +//nop; +//nop; +//nop; +//nop; +f_close_bin_file(mem, sp); +goto L4521ec; +//nop; +L4521ec: +gp = MEM_U32(sp + 204); +a0 = sp + 0xda8; +//nop; +a1 = sp + 0x15b0; +//nop; +f_cat_files(mem, sp, a0, a1); +goto L452204; +//nop; +L452204: +t6 = MEM_U8(sp + 253); +gp = MEM_U32(sp + 204); +if (t6 != 0) {//nop; +goto L452230;} +//nop; +//nop; +v0 = s5; +t9 = t9; +//nop; +func_44f558(mem, sp, v0); +goto L452228; +//nop; +L452228: +gp = MEM_U32(sp + 204); +//nop; +L452230: +t3 = 0x10018e88; +t4 = MEM_U32(sp + 224); +t3 = MEM_U8(t3 + 0); +//nop; +if (t3 == 0) {t5 = MEM_U8(sp + 1318); +goto L452268;} +t5 = MEM_U8(sp + 1318); +MEM_U8(t4 + 1) = (uint8_t)s7; +//nop; +a0 = sp + 0xda8; +a1 = sp + 0x11c; +f_output_inst_ascii(mem, sp, a0, a1); +goto L45225c; +a1 = sp + 0x11c; +L45225c: +gp = MEM_U32(sp + 204); +//nop; +t5 = MEM_U8(sp + 1318); +L452268: +//nop; +if (t5 == 0) {//nop; +goto L45228c;} +//nop; +//nop; +a0 = MEM_U32(s6 + 0); +//nop; +f_writeln(mem, sp, a0, a1, a2, a3); +goto L452284; +//nop; +L452284: +gp = MEM_U32(sp + 204); +//nop; +L45228c: +//nop; +a0 = MEM_U32(sp + 248); +//nop; +v0 = f_has_errors(mem, sp, a0); +goto L45229c; +//nop; +L45229c: +gp = MEM_U32(sp + 204); +if (v0 == 0) {v0 = zero; +goto L4522c4;} +v0 = zero; +//nop; +a0 = 0x1; +//nop; +wrapper_exit(mem, a0); +goto L4522b8; +//nop; +L4522b8: +gp = MEM_U32(sp + 204); +//nop; +v0 = zero; +L4522c4: +ra = MEM_U32(sp + 212); +s0 = MEM_U32(sp + 172); +s1 = MEM_U32(sp + 176); +s2 = MEM_U32(sp + 180); +s3 = MEM_U32(sp + 184); +s4 = MEM_U32(sp + 188); +s5 = MEM_U32(sp + 192); +s6 = MEM_U32(sp + 196); +s7 = MEM_U32(sp + 200); +fp = MEM_U32(sp + 208); +sp = sp + 0x1db8; +return v0; +sp = sp + 0x1db8; +//nop; +//nop; +//nop; +} + +static void f_emit_composite_val(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L452300: +//emit_composite_val: +//nop; +//nop; +//nop; +sp = sp + 0xffffff98; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s4; +MEM_U32(sp + 32) = s3; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +MEM_U32(sp + 72) = zero; +MEM_U32(sp + 76) = zero; +MEM_U32(sp + 80) = zero; +MEM_U32(sp + 84) = zero; +v0 = MEM_U32(a0 + 0); +s0 = a0; +if ((int)v0 >= 0) {t6 = (int)v0 >> 4; +goto L452354;} +t6 = (int)v0 >> 4; +at = v0 + 0xf; +t6 = (int)at >> 4; +L452354: +t7 = v0 & 0xf; +MEM_U32(sp + 100) = t6; +if (t6 == 0) {MEM_U32(sp + 96) = t7; +goto L452418;} +MEM_U32(sp + 96) = t7; +s2 = 0x1; +s3 = t6 + 0x1; +s4 = sp + 0x48; +s1 = 0x11; +a0 = s2 << 4; +L452378: +a0 = a0 + 0xfffffff0; +v0 = 0x1; +v1 = sp + 0x48; +L452384: +t9 = MEM_U32(s0 + 4); +v1 = v1 + 0x4; +t0 = t9 + a0; +t1 = t0 + v0; +t2 = MEM_U8(t1 + -1); +//nop; +MEM_U8(v1 + -4) = (uint8_t)t2; +t3 = MEM_U32(s0 + 4); +//nop; +t4 = t3 + a0; +t5 = t4 + v0; +t6 = MEM_U8(t5 + 0); +//nop; +MEM_U8(v1 + -3) = (uint8_t)t6; +t7 = MEM_U32(s0 + 4); +//nop; +t8 = t7 + a0; +t9 = t8 + v0; +t0 = MEM_U8(t9 + 1); +//nop; +MEM_U8(v1 + -2) = (uint8_t)t0; +t1 = MEM_U32(s0 + 4); +//nop; +t2 = t1 + a0; +t3 = t2 + v0; +t4 = MEM_U8(t3 + 2); +v0 = v0 + 0x4; +if (v0 != s1) {MEM_U8(v1 + -1) = (uint8_t)t4; +goto L452384;} +MEM_U8(v1 + -1) = (uint8_t)t4; +//nop; +a0 = s4; +//nop; +f_append_d(mem, sp, a0); +goto L452408; +//nop; +L452408: +gp = MEM_U32(sp + 40); +s2 = s2 + 0x1; +if (s2 != s3) {a0 = s2 << 4; +goto L452378;} +a0 = s2 << 4; +L452418: +t5 = MEM_U32(sp + 96); +s4 = sp + 0x48; +if (t5 == 0) {ra = MEM_U32(sp + 44); +goto L452588;} +ra = MEM_U32(sp + 44); +t6 = 0x1000dcb0; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +//nop; +MEM_U8(s4 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(s4 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(s4 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(s4 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($s4) +t8 = t6 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t6) +//nop; +MEM_U8(s4 + 4 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(s4 + 4 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(s4 + 4 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(s4 + 4 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 7($s4) +at = t6 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t6) +//nop; +MEM_U8(s4 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(s4 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(s4 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(s4 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($s4) +t8 = t6 + 12; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 0xf($t6) +//nop; +MEM_U8(s4 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(s4 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(s4 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(s4 + 12 + 3) = (uint8_t)(t8 >> 0); +//swr $t8, 0xf($s4) +t9 = MEM_U32(sp + 96); +//nop; +if (t9 == 0) {s3 = t9 + 0x1; +goto L45256c;} +s3 = t9 + 0x1; +a1 = s3 + 0xffffffff; +t0 = a1 & 0x3; +if (t0 == 0) {s2 = 0x1; +goto L4524e4;} +s2 = 0x1; +v1 = MEM_U32(sp + 100); +t1 = sp + 0x47; +t2 = v1 << 4; +v1 = t2; +v0 = s2 + t1; +a0 = t0 + 0x1; +L4524bc: +t3 = MEM_U32(s0 + 4); +v0 = v0 + 0x1; +t4 = t3 + v1; +t5 = t4 + s2; +t7 = MEM_U8(t5 + -1); +s2 = s2 + 0x1; +if (a0 != s2) {MEM_U8(v0 + -1) = (uint8_t)t7; +goto L4524bc;} +MEM_U8(v0 + -1) = (uint8_t)t7; +if (s2 == s3) {//nop; +goto L45256c;} +//nop; +L4524e4: +v1 = MEM_U32(sp + 100); +t6 = sp + 0x47; +t8 = v1 << 4; +v1 = t8; +v0 = s2 + t6; +L4524f8: +t9 = MEM_U32(s0 + 4); +v0 = v0 + 0x4; +t0 = t9 + v1; +t1 = t0 + s2; +t2 = MEM_U8(t1 + -1); +//nop; +MEM_U8(v0 + -4) = (uint8_t)t2; +t3 = MEM_U32(s0 + 4); +//nop; +t4 = t3 + v1; +t5 = t4 + s2; +t7 = MEM_U8(t5 + 0); +//nop; +MEM_U8(v0 + -3) = (uint8_t)t7; +t6 = MEM_U32(s0 + 4); +//nop; +t8 = t6 + v1; +t9 = t8 + s2; +t0 = MEM_U8(t9 + 1); +//nop; +MEM_U8(v0 + -2) = (uint8_t)t0; +t1 = MEM_U32(s0 + 4); +//nop; +t2 = t1 + v1; +t3 = t2 + s2; +t4 = MEM_U8(t3 + 2); +s2 = s2 + 0x4; +if (s2 != s3) {MEM_U8(v0 + -1) = (uint8_t)t4; +goto L4524f8;} +MEM_U8(v0 + -1) = (uint8_t)t4; +L45256c: +//nop; +a0 = s4; +//nop; +f_append_d(mem, sp, a0); +goto L45257c; +//nop; +L45257c: +gp = MEM_U32(sp + 40); +//nop; +ra = MEM_U32(sp + 44); +L452588: +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +s3 = MEM_U32(sp + 32); +s4 = MEM_U32(sp + 36); +sp = sp + 0x68; +return; +sp = sp + 0x68; +} + +static void f_emit_val(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4525a4: +//emit_val: +//nop; +//nop; +//nop; +sp = sp + 0xffffff00; +MEM_U32(sp + 196) = s6; +MEM_U32(sp + 180) = s2; +MEM_U32(sp + 176) = s1; +MEM_U32(sp + 172) = s0; +s0 = a3; +s1 = a1 & 0xff; +s2 = a0; +s6 = a2; +MEM_U32(sp + 204) = ra; +MEM_U32(sp + 200) = gp; +MEM_U32(sp + 192) = s5; +MEM_U32(sp + 188) = s4; +MEM_U32(sp + 184) = s3; +MEM_U32(sp + 260) = a1; +MEM_U32(sp + 240) = zero; +MEM_U32(sp + 244) = zero; +MEM_U32(sp + 248) = zero; +if (a0 == 0) {MEM_U32(sp + 252) = zero; +goto L452618;} +MEM_U32(sp + 252) = zero; +//nop; +a0 = zero; +a1 = s2; +f_demit_dir0(mem, sp, a0, a1); +goto L452610; +a1 = s2; +L452610: +gp = MEM_U32(sp + 200); +//nop; +L452618: +v0 = s1 & 0xff; +at = v0 < 0xa; +if (at == 0) {//nop; +goto L452a3c;} +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000dd6c[] = { +&&L452648, +&&L452758, +&&L452758, +&&L452758, +&&L4527ac, +&&L452844, +&&L452844, +&&L452844, +&&L452a60, +&&L4528b0, +}; +dest = Lswitch1000dd6c[v0]; +//nop; +goto *dest; +//nop; +L452648: +t7 = 0x1000dd1a; +a0 = 0x4; +t7 = t7; +t9 = t7 + 0x48; +a1 = 0x87; +t0 = sp; +L452660: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t0 = t0 + 0xc; +MEM_U8(t0 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t0) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t0 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t9) {//swr $at, 7($t0) +goto L452660;} +//swr $at, 7($t0) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t1 = 0x1000dcca; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +t9 = t7 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t7) +t1 = t1; +MEM_U8(t0 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t0 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t0 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t0 + 12 + 3) = (uint8_t)(t9 >> 0); +t3 = t1 + 0x48; +t4 = sp; +//swr $t9, 0xf($t0) +L4526d0: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t4 = t4 + 0xc; +MEM_U8(t4 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t4) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t4 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 84 + 3) = (uint8_t)(at >> 0); +if (t1 != t3) {//swr $at, 0x57($t4) +goto L4526d0;} +//swr $at, 0x57($t4) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +//nop; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +//nop; +MEM_U8(t4 + 92 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 92 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 92 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 92 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x5f($t4) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L45274c; +//nop; +L45274c: +gp = MEM_U32(sp + 200); +ra = MEM_U32(sp + 204); +goto L452a64; +ra = MEM_U32(sp + 204); +L452758: +t5 = 0x10006150; +t9 = MEM_U8(sp + 245); +t5 = t5 + 0xffffffff; +t6 = s1 + t5; +t8 = MEM_U8(t6 + 0); +t7 = t9 << 26; +t0 = t7 >> 26; +t2 = t8 ^ t0; +t3 = t2 & 0x3f; +t1 = t3 ^ t9; +MEM_U8(sp + 245) = (uint8_t)t1; +t4 = MEM_U32(s6 + 0); +//nop; +a0 = sp + 0xf0; +MEM_U32(sp + 252) = s0; +MEM_U32(sp + 240) = zero; +MEM_U32(sp + 248) = t4; +f_append_d(mem, sp, a0); +goto L4527a0; +MEM_U32(sp + 248) = t4; +L4527a0: +gp = MEM_U32(sp + 200); +ra = MEM_U32(sp + 204); +goto L452a64; +ra = MEM_U32(sp + 204); +L4527ac: +t5 = 0x10006150; +t7 = MEM_U8(sp + 245); +t5 = t5 + 0xffffffff; +s2 = s1 + t5; +t6 = MEM_U8(s2 + 0); +t8 = t7 << 26; +t0 = t8 >> 26; +t2 = t6 ^ t0; +t3 = t2 & 0x3f; +t9 = t3 ^ t7; +MEM_U8(sp + 245) = (uint8_t)t9; +t1 = MEM_U32(s6 + 0); +//nop; +s3 = sp + 0xf0; +MEM_U32(sp + 252) = s0; +MEM_U32(sp + 240) = zero; +a0 = s3; +MEM_U32(sp + 248) = t1; +f_append_d(mem, sp, a0); +goto L4527f8; +MEM_U32(sp + 248) = t1; +L4527f8: +t5 = MEM_U8(sp + 245); +t4 = MEM_U8(s2 + 0); +t8 = t5 << 26; +t6 = t8 >> 26; +t0 = t4 ^ t6; +t2 = t0 & 0x3f; +t3 = t2 ^ t5; +gp = MEM_U32(sp + 200); +MEM_U8(sp + 245) = (uint8_t)t3; +t7 = MEM_U32(s6 + 4); +//nop; +MEM_U32(sp + 252) = s0; +MEM_U32(sp + 240) = zero; +a0 = s3; +MEM_U32(sp + 248) = t7; +f_append_d(mem, sp, a0); +goto L452838; +MEM_U32(sp + 248) = t7; +L452838: +gp = MEM_U32(sp + 200); +ra = MEM_U32(sp + 204); +goto L452a64; +ra = MEM_U32(sp + 204); +L452844: +t9 = 0x10006150; +t4 = MEM_U8(sp + 245); +t9 = t9 + 0xffffffff; +t1 = s1 + t9; +t8 = MEM_U8(t1 + 0); +t6 = t4 << 26; +t0 = t6 >> 26; +t2 = t8 ^ t0; +t5 = t2 & 0x3f; +t3 = t5 ^ t4; +MEM_U8(sp + 245) = (uint8_t)t3; +t7 = MEM_U32(s6 + 0); +//nop; +a0 = sp + 0xf0; +MEM_U32(sp + 240) = zero; +MEM_U32(sp + 252) = s0; +MEM_U32(sp + 248) = t7; +f_append_d(mem, sp, a0); +goto L45288c; +MEM_U32(sp + 248) = t7; +L45288c: +gp = MEM_U32(sp + 200); +a0 = s6; +//nop; +//nop; +//nop; +f_emit_composite_val(mem, sp, a0); +goto L4528a4; +//nop; +L4528a4: +gp = MEM_U32(sp + 200); +ra = MEM_U32(sp + 204); +goto L452a64; +ra = MEM_U32(sp + 204); +L4528b0: +v0 = MEM_U32(s6 + 0); +//nop; +t9 = v0 & 0x1; +if (t9 == 0) {//nop; +goto L4528c8;} +//nop; +abort(); +L4528c8: +t1 = 0x10018e80; +//nop; +t1 = MEM_U8(t1 + 0); +//nop; +if (t1 != 0) {//nop; +goto L452990;} +//nop; +if ((int)v0 >= 0) {s4 = (int)v0 >> 1; +goto L4528f0;} +s4 = (int)v0 >> 1; +at = v0 + 0x1; +s4 = (int)at >> 1; +L4528f0: +if ((int)s4 <= 0) {s0 = 0x2; +goto L452a60;} +s0 = 0x2; +t6 = 0x10006150; +s4 = s4 + 0x1; +t6 = t6 + 0xffffffff; +s2 = s1 + t6; +s1 = 0x1000615c; +s5 = s4 << 1; +s3 = sp + 0xf0; +t0 = MEM_U8(sp + 245); +L452918: +t8 = MEM_U8(s2 + 0); +t2 = t0 << 26; +t5 = t2 >> 26; +t4 = t8 ^ t5; +t3 = t4 & 0x3f; +t7 = t3 ^ t0; +MEM_U8(sp + 245) = (uint8_t)t7; +t9 = MEM_U32(s6 + 4); +t7 = 0x1; +v0 = t9 + s0; +t1 = MEM_U8(v0 + -2); +t5 = MEM_U8(v0 + -1); +t6 = s1 + t1; +t4 = s1 + t5; +t3 = MEM_U8(t4 + 0); +t2 = MEM_U8(t6 + 0); +//nop; +t8 = t2 << 4; +t0 = t8 + t3; +MEM_U32(sp + 248) = t0; +MEM_U32(sp + 252) = t7; +MEM_U32(sp + 240) = zero; +a0 = s3; +f_append_d(mem, sp, a0); +goto L452978; +a0 = s3; +L452978: +gp = MEM_U32(sp + 200); +s0 = s0 + 0x2; +if (s0 != s5) {t0 = MEM_U8(sp + 245); +goto L452918;} +t0 = MEM_U8(sp + 245); +ra = MEM_U32(sp + 204); +goto L452a64; +ra = MEM_U32(sp + 204); +L452990: +if ((int)v0 >= 0) {s4 = (int)v0 >> 1; +goto L4529a0;} +s4 = (int)v0 >> 1; +at = v0 + 0x1; +s4 = (int)at >> 1; +L4529a0: +if ((int)s4 <= 0) {ra = MEM_U32(sp + 204); +goto L452a64;} +ra = MEM_U32(sp + 204); +t9 = 0x10006150; +s0 = s4 << 1; +t9 = t9 + 0xffffffff; +s2 = s1 + t9; +s1 = 0x1000615c; +s3 = sp + 0xf0; +t6 = MEM_U8(sp + 245); +L4529c4: +t1 = MEM_U8(s2 + 0); +t2 = t6 << 26; +t5 = t2 >> 26; +t4 = t1 ^ t5; +t8 = t4 & 0x3f; +t3 = t8 ^ t6; +MEM_U8(sp + 245) = (uint8_t)t3; +t0 = MEM_U32(s6 + 4); +t3 = 0x1; +v0 = t0 + s0; +t7 = MEM_U8(v0 + -2); +t5 = MEM_U8(v0 + -1); +t9 = s1 + t7; +t2 = MEM_U8(t9 + 0); +t4 = s1 + t5; +t8 = MEM_U8(t4 + 0); +//nop; +t1 = t2 << 4; +t6 = t1 + t8; +MEM_U32(sp + 248) = t6; +MEM_U32(sp + 252) = t3; +MEM_U32(sp + 240) = zero; +a0 = s3; +f_append_d(mem, sp, a0); +goto L452a24; +a0 = s3; +L452a24: +gp = MEM_U32(sp + 200); +s0 = s0 + 0xfffffffe; +if (s0 != 0) {t6 = MEM_U8(sp + 245); +goto L4529c4;} +t6 = MEM_U8(sp + 245); +ra = MEM_U32(sp + 204); +goto L452a64; +ra = MEM_U32(sp + 204); +L452a3c: +a2 = 0x1000dcc0; +//nop; +a0 = 0x1; +a1 = 0x85; +a3 = 0xa; +a2 = a2; +f_caseerror(mem, sp, a0, a1, a2, a3); +goto L452a58; +a2 = a2; +L452a58: +gp = MEM_U32(sp + 200); +//nop; +L452a60: +ra = MEM_U32(sp + 204); +L452a64: +s0 = MEM_U32(sp + 172); +s1 = MEM_U32(sp + 176); +s2 = MEM_U32(sp + 180); +s3 = MEM_U32(sp + 184); +s4 = MEM_U32(sp + 188); +s5 = MEM_U32(sp + 192); +s6 = MEM_U32(sp + 196); +sp = sp + 0x100; +return; +sp = sp + 0x100; +} + +static void f_emit_label_val(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L452a88: +//emit_label_val: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +at = 0x2; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 48) = a0; +if (a3 != at) {MEM_U32(sp + 36) = zero; +goto L452ad8;} +MEM_U32(sp + 36) = zero; +t6 = 0x10006150; +t7 = MEM_U8(sp + 37); +t6 = MEM_U8(t6 + 1); +t8 = t7 << 26; +t9 = t8 >> 26; +t0 = t6 ^ t9; +t1 = t0 & 0x3f; +t2 = t1 ^ t7; +MEM_U8(sp + 37) = (uint8_t)t2; +goto L452afc; +MEM_U8(sp + 37) = (uint8_t)t2; +L452ad8: +t3 = 0x10006150; +t4 = MEM_U8(sp + 37); +t3 = MEM_U8(t3 + 7); +t5 = t4 << 26; +t8 = t5 >> 26; +t6 = t3 ^ t8; +t9 = t6 & 0x3f; +t0 = t9 ^ t4; +MEM_U8(sp + 37) = (uint8_t)t0; +L452afc: +//nop; +t1 = 0x1; +MEM_U32(sp + 40) = a2; +MEM_U32(sp + 44) = t1; +MEM_U32(sp + 32) = a1; +a0 = sp + 0x20; +f_append_d(mem, sp, a0); +goto L452b18; +a0 = sp + 0x20; +L452b18: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static uint32_t f_find_val_type(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L452b28: +//find_val_type: +//nop; +//nop; +//nop; +sp = sp + 0xffffff40; +v0 = a0 & 0xff; +at = v0 < 0x11; +MEM_U32(sp + 180) = ra; +MEM_U32(sp + 176) = gp; +if (at == 0) {MEM_U32(sp + 192) = a0; +goto L452cfc;} +MEM_U32(sp + 192) = a0; +//nop; +//nop; +//nop; +//nop; +//nop; +//nop; +;static void *const Lswitch1000ded4[] = { +&&L452bb4, +&&L452cfc, +&&L452bdc, +&&L452cfc, +&&L452bb4, +&&L452b70, +&&L452b70, +&&L452b70, +&&L452b70, +&&L452bd4, +&&L452bdc, +&&L452cfc, +&&L452bcc, +&&L452bc4, +&&L452be4, +&&L452bbc, +&&L452bec, +}; +dest = Lswitch1000ded4[v0]; +//nop; +goto *dest; +//nop; +L452b70: +at = 0x1; +if (a1 != at) {at = (int)a1 < (int)0x3; +goto L452b88;} +at = (int)a1 < (int)0x3; +v0 = 0x1; +goto L452e10; +v0 = 0x1; +at = (int)a1 < (int)0x3; +L452b88: +if (at == 0) {at = (int)a1 < (int)0x5; +goto L452b9c;} +at = (int)a1 < (int)0x5; +v0 = 0x2; +goto L452e10; +v0 = 0x2; +at = (int)a1 < (int)0x5; +L452b9c: +if (at == 0) {//nop; +goto L452bac;} +//nop; +v0 = 0x3; +goto L452e10; +v0 = 0x3; +L452bac: +v0 = 0x4; +goto L452e10; +v0 = 0x4; +L452bb4: +v0 = 0x3; +goto L452e10; +v0 = 0x3; +L452bbc: +v0 = 0x4; +goto L452e10; +v0 = 0x4; +L452bc4: +v0 = 0x5; +goto L452e10; +v0 = 0x5; +L452bcc: +v0 = 0x6; +goto L452e10; +v0 = 0x6; +L452bd4: +v0 = 0x7; +goto L452e10; +v0 = 0x7; +L452bdc: +v0 = 0x8; +goto L452e10; +v0 = 0x8; +L452be4: +v0 = 0x9; +goto L452e10; +v0 = 0x9; +L452bec: +t7 = 0x1000de84; +a0 = 0x4; +t7 = t7; +t9 = t7 + 0x48; +a1 = 0xf2; +t0 = sp; +L452c04: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t0 = t0 + 0xc; +MEM_U8(t0 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t0) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t0 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 4 + 3) = (uint8_t)(at >> 0); +if (t7 != t9) {//swr $at, 7($t0) +goto L452c04;} +//swr $at, 7($t0) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t1 = 0x1000de34; +MEM_U8(t0 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t0 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t0 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t0 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t0) +t9 = t7 + 4; t9 = (MEM_U8(t9) << 24) | (MEM_U8(t9 + 1) << 16) | (MEM_U8(t9 + 2) << 8) | MEM_U8(t9 + 3); +//lwr $t9, 7($t7) +t1 = t1; +MEM_U8(t0 + 12 + 0) = (uint8_t)(t9 >> 24); +MEM_U8(t0 + 12 + 1) = (uint8_t)(t9 >> 16); +MEM_U8(t0 + 12 + 2) = (uint8_t)(t9 >> 8); +MEM_U8(t0 + 12 + 3) = (uint8_t)(t9 >> 0); +t3 = t1 + 0x48; +t4 = sp; +//swr $t9, 0xf($t0) +L452c74: +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t1 = t1 + 0xc; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +at = t1 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t1) +t4 = t4 + 0xc; +MEM_U8(t4 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t4) +at = t1 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t1) +//nop; +MEM_U8(t4 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 84 + 3) = (uint8_t)(at >> 0); +if (t1 != t3) {//swr $at, 0x57($t4) +goto L452c74;} +//swr $at, 0x57($t4) +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +//nop; +MEM_U8(t4 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t4 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t4 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t4 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t4) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +//nop; +MEM_U8(t4 + 92 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t4 + 92 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t4 + 92 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t4 + 92 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0x5f($t4) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L452cf0; +//nop; +L452cf0: +gp = MEM_U32(sp + 176); +v0 = MEM_U8(sp + 191); +goto L452e0c; +v0 = MEM_U8(sp + 191); +L452cfc: +t5 = 0x1000dde4; +a0 = 0x4; +t5 = t5; +t8 = t5 + 0x48; +a1 = 0xf8; +t9 = sp; +L452d14: +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t5 = t5 + 0xc; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +at = t5 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t5) +t9 = t9 + 0xc; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +at = t5 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t5) +//nop; +MEM_U8(t9 + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 4 + 3) = (uint8_t)(at >> 0); +if (t5 != t8) {//swr $at, 7($t9) +goto L452d14;} +//swr $at, 7($t9) +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t7 = 0x1000dd94; +MEM_U8(t9 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t9) +t8 = t5 + 4; t8 = (MEM_U8(t8) << 24) | (MEM_U8(t8 + 1) << 16) | (MEM_U8(t8 + 2) << 8) | MEM_U8(t8 + 3); +//lwr $t8, 7($t5) +t7 = t7; +MEM_U8(t9 + 12 + 0) = (uint8_t)(t8 >> 24); +MEM_U8(t9 + 12 + 1) = (uint8_t)(t8 >> 16); +MEM_U8(t9 + 12 + 2) = (uint8_t)(t8 >> 8); +MEM_U8(t9 + 12 + 3) = (uint8_t)(t8 >> 0); +t2 = t7 + 0x48; +t3 = sp; +//swr $t8, 0xf($t9) +L452d84: +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +t7 = t7 + 0xc; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +at = t7 + -8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -5($t7) +t3 = t3 + 0xc; +MEM_U8(t3 + 80 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 80 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 80 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 80 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x53($t3) +at = t7 + -4; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, -1($t7) +//nop; +MEM_U8(t3 + 84 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 84 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 84 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 84 + 3) = (uint8_t)(at >> 0); +if (t7 != t2) {//swr $at, 0x57($t3) +goto L452d84;} +//swr $at, 0x57($t3) +at = t7 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t7) +//nop; +MEM_U8(t3 + 88 + 0) = (uint8_t)(at >> 24); +MEM_U8(t3 + 88 + 1) = (uint8_t)(at >> 16); +MEM_U8(t3 + 88 + 2) = (uint8_t)(at >> 8); +MEM_U8(t3 + 88 + 3) = (uint8_t)(at >> 0); +//swr $at, 0x5b($t3) +t2 = t7 + 4; t2 = (MEM_U8(t2) << 24) | (MEM_U8(t2 + 1) << 16) | (MEM_U8(t2 + 2) << 8) | MEM_U8(t2 + 3); +//lwr $t2, 7($t7) +//nop; +MEM_U8(t3 + 92 + 0) = (uint8_t)(t2 >> 24); +MEM_U8(t3 + 92 + 1) = (uint8_t)(t2 >> 16); +MEM_U8(t3 + 92 + 2) = (uint8_t)(t2 >> 8); +MEM_U8(t3 + 92 + 3) = (uint8_t)(t2 >> 0); +//swr $t2, 0x5f($t3) +//nop; +a3 = MEM_U32(sp + 12); +a2 = MEM_U32(sp + 8); +//nop; +f_report_error(mem, sp, a0, a1, a2, a3); +goto L452e00; +//nop; +L452e00: +gp = MEM_U32(sp + 176); +//nop; +v0 = MEM_U8(sp + 191); +L452e0c: +//nop; +L452e10: +ra = MEM_U32(sp + 180); +sp = sp + 0xc0; +//nop; +return v0; +//nop; +} + +static void func_452e50(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L452e50: +v0 = MEM_U32(a1 + 0); +v1 = 0x8; +if (v1 != v0) {at = 0x3; +goto L452ee0;} +at = 0x3; +t6 = MEM_U8(a0 + 0); +at = 0x49; +if (t6 != at) {at = 0x3; +goto L452ee0;} +at = 0x3; +t7 = MEM_U8(a0 + 1); +a2 = 0x6e; +if (a2 != t7) {at = 0x3; +goto L452ee0;} +at = 0x3; +t8 = MEM_U8(a0 + 2); +a3 = 0x66; +if (a3 != t8) {at = 0x3; +goto L452ee0;} +at = 0x3; +t9 = MEM_U8(a0 + 3); +t0 = 0x69; +if (t0 != t9) {at = 0x3; +goto L452ee0;} +at = 0x3; +t1 = MEM_U8(a0 + 4); +//nop; +if (a2 != t1) {at = 0x3; +goto L452ee0;} +at = 0x3; +t2 = MEM_U8(a0 + 5); +//nop; +if (t0 != t2) {at = 0x3; +goto L452ee0;} +at = 0x3; +t3 = MEM_U8(a0 + 6); +at = 0x74; +if (t3 != at) {at = 0x3; +goto L452ee0;} +at = 0x3; +t4 = MEM_U8(a0 + 7); +at = 0x79; +if (t4 == at) {at = 0x3; +goto L452f20;} +at = 0x3; +L452ee0: +a2 = 0x6e; +a3 = 0x66; +if (v0 != at) {t0 = 0x69; +goto L452f54;} +t0 = 0x69; +t5 = MEM_U8(a0 + 0); +//nop; +if (t0 != t5) {//nop; +goto L452f54;} +//nop; +t6 = MEM_U8(a0 + 1); +//nop; +if (a2 != t6) {//nop; +goto L452f54;} +//nop; +t7 = MEM_U8(a0 + 2); +//nop; +if (a3 != t7) {//nop; +goto L452f54;} +//nop; +L452f20: +v0 = 0x39; +t8 = 0x2e; +t9 = 0x65; +MEM_U8(a0 + 0) = (uint8_t)v0; +MEM_U8(a0 + 1) = (uint8_t)v0; +MEM_U8(a0 + 2) = (uint8_t)t8; +MEM_U8(a0 + 3) = (uint8_t)v0; +MEM_U8(a0 + 4) = (uint8_t)t9; +MEM_U8(a0 + 5) = (uint8_t)v0; +MEM_U8(a0 + 6) = (uint8_t)v0; +MEM_U8(a0 + 7) = (uint8_t)v0; +MEM_U32(a1 + 0) = v1; +return; +MEM_U32(a1 + 0) = v1; +L452f54: +v1 = 0x9; +if (v1 != v0) {at = 0x4; +goto L452ff0;} +at = 0x4; +t1 = MEM_U8(a0 + 0); +at = 0x2d; +if (t1 != at) {at = 0x4; +goto L452ff0;} +at = 0x4; +t2 = MEM_U8(a0 + 1); +at = 0x49; +if (t2 != at) {at = 0x4; +goto L452ff0;} +at = 0x4; +t3 = MEM_U8(a0 + 2); +//nop; +if (a2 != t3) {at = 0x4; +goto L452ff0;} +at = 0x4; +t4 = MEM_U8(a0 + 3); +//nop; +if (a3 != t4) {at = 0x4; +goto L452ff0;} +at = 0x4; +t5 = MEM_U8(a0 + 4); +//nop; +if (t0 != t5) {at = 0x4; +goto L452ff0;} +at = 0x4; +t6 = MEM_U8(a0 + 5); +//nop; +if (a2 != t6) {at = 0x4; +goto L452ff0;} +at = 0x4; +t7 = MEM_U8(a0 + 6); +//nop; +if (t0 != t7) {at = 0x4; +goto L452ff0;} +at = 0x4; +t8 = MEM_U8(a0 + 7); +at = 0x74; +if (t8 != at) {at = 0x4; +goto L452ff0;} +at = 0x4; +t9 = MEM_U8(a0 + 8); +at = 0x79; +if (t9 == at) {at = 0x4; +goto L453034;} +at = 0x4; +L452ff0: +if (v0 != at) {//nop; +goto L453064;} +//nop; +t1 = MEM_U8(a0 + 0); +at = 0x2d; +if (t1 != at) {//nop; +goto L453064;} +//nop; +t2 = MEM_U8(a0 + 1); +//nop; +if (t0 != t2) {//nop; +goto L453064;} +//nop; +t3 = MEM_U8(a0 + 2); +//nop; +if (a2 != t3) {//nop; +goto L453064;} +//nop; +t4 = MEM_U8(a0 + 3); +//nop; +if (a3 != t4) {v0 = 0x39; +goto L453064;} +L453034: +v0 = 0x39; +t5 = 0x2e; +t6 = 0x65; +MEM_U8(a0 + 1) = (uint8_t)v0; +MEM_U8(a0 + 2) = (uint8_t)v0; +MEM_U8(a0 + 3) = (uint8_t)t5; +MEM_U8(a0 + 4) = (uint8_t)v0; +MEM_U8(a0 + 5) = (uint8_t)t6; +MEM_U8(a0 + 6) = (uint8_t)v0; +MEM_U8(a0 + 7) = (uint8_t)v0; +MEM_U8(a0 + 8) = (uint8_t)v0; +MEM_U32(a1 + 0) = v1; +L453064: +//nop; +return; +//nop; +} + +static void f_readuinstr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L45306c: +//readuinstr: +//nop; +//nop; +//nop; +sp = sp + 0xffffffa0; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s2; +s2 = a0; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +MEM_U32(sp + 100) = a1; +v0 = f_ugeteof(mem, sp, a0, a1, a2, a3); +goto L4530a0; +MEM_U32(sp + 100) = a1; +L4530a0: +gp = MEM_U32(sp + 32); +at = 0x1; +if (v0 != at) {t6 = 0x22; +goto L4530b8;} +t6 = 0x22; +MEM_U8(s2 + 0) = (uint8_t)t6; +goto L453378; +MEM_U8(s2 + 0) = (uint8_t)t6; +L4530b8: +//nop; +//nop; +//nop; +v0 = f_ugetint(mem, sp, a0, a1, a2, a3); +goto L4530c8; +//nop; +L4530c8: +gp = MEM_U32(sp + 32); +MEM_U32(s2 + 0) = v0; +//nop; +//nop; +//nop; +v0 = f_ugetint(mem, sp, a0, a1, a2, a3); +goto L4530e0; +//nop; +L4530e0: +t8 = MEM_U8(s2 + 0); +gp = MEM_U32(sp + 32); +t9 = t8 << 2; +t9 = t9 + t8; +t0 = 0x1001a6c0; +t9 = t9 << 2; +t9 = t9 - t8; +MEM_U32(s2 + 4) = v0; +t1 = t9 + t0; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t7 = sp + 0x41; +MEM_U8(t7 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t7) +t3 = t1 + 4; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 7($t1) +s0 = s2 + 0xc; +MEM_U8(t7 + 4 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t7 + 4 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t7 + 4 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t7 + 4 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 7($t7) +at = t1 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t1) +//nop; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +t3 = t1 + 12; t3 = (MEM_U8(t3) << 24) | (MEM_U8(t3 + 1) << 16) | (MEM_U8(t3 + 2) << 8) | MEM_U8(t3 + 3); +//lwr $t3, 0xf($t1) +//nop; +MEM_U8(t7 + 12 + 0) = (uint8_t)(t3 >> 24); +MEM_U8(t7 + 12 + 1) = (uint8_t)(t3 >> 16); +MEM_U8(t7 + 12 + 2) = (uint8_t)(t3 >> 8); +MEM_U8(t7 + 12 + 3) = (uint8_t)(t3 >> 0); +//swr $t3, 0xf($t7) +at = MEM_U8(t1 + 16); +//nop; +MEM_U8(t7 + 16) = (uint8_t)at; +t3 = MEM_U8(t1 + 17); +//nop; +MEM_U8(t7 + 17) = (uint8_t)t3; +at = MEM_U8(t1 + 18); +//nop; +MEM_U8(t7 + 18) = (uint8_t)at; +v1 = MEM_U8(sp + 81); +at = 0x2; +if (v1 == at) {MEM_U32(sp + 88) = v1; +goto L4531cc;} +MEM_U32(sp + 88) = v1; +v0 = v1 + 0x1; +t4 = v0 << 2; +s1 = t4 + s2; +L453194: +//nop; +//nop; +//nop; +v0 = f_ugetint(mem, sp, a0, a1, a2, a3); +goto L4531a4; +//nop; +L4531a4: +gp = MEM_U32(sp + 32); +MEM_U32(s0 + -4) = v0; +//nop; +//nop; +//nop; +v0 = f_ugetint(mem, sp, a0, a1, a2, a3); +goto L4531bc; +//nop; +L4531bc: +gp = MEM_U32(sp + 32); +s0 = s0 + 0x8; +if (s0 != s1) {MEM_U32(s0 + -8) = v0; +goto L453194;} +MEM_U32(s0 + -8) = v0; +L4531cc: +t5 = MEM_U8(sp + 80); +//nop; +if (t5 == 0) {ra = MEM_U32(sp + 36); +goto L45337c;} +ra = MEM_U32(sp + 36); +//nop; +//nop; +//nop; +v0 = f_ugetint(mem, sp, a0, a1, a2, a3); +goto L4531ec; +//nop; +L4531ec: +t6 = MEM_U32(sp + 88); +gp = MEM_U32(sp + 32); +t8 = t6 << 2; +s0 = s2 + t8; +MEM_U32(s0 + 0) = v0; +//nop; +//nop; +//nop; +v0 = f_ugetint(mem, sp, a0, a1, a2, a3); +goto L453210; +//nop; +L453210: +gp = MEM_U32(sp + 32); +MEM_U32(s0 + 4) = v0; +a0 = MEM_U8(s2 + 1); +at = 0x4e0000; +t9 = a0 & 0x1f; +t0 = t9 < 0x20; +t2 = -t0; +at = at | 0x8000; +t7 = t2 & at; +t1 = t7 << (t9 & 0x1f); +if ((int)t1 < 0) {a0 = t9; +goto L453250;} +a0 = t9; +t3 = MEM_U8(s2 + 0); +at = 0x13; +if (t3 != at) {ra = MEM_U32(sp + 36); +goto L45337c;} +ra = MEM_U32(sp + 36); +L453250: +v0 = MEM_U32(s0 + 0); +//nop; +v0 = v0 + 0x3; +if ((int)v0 >= 0) {t4 = (int)v0 >> 2; +goto L45326c;} +t4 = (int)v0 >> 2; +at = v0 + 0x3; +t4 = (int)at >> 2; +L45326c: +t5 = t4 & 0x1; +if (t5 == 0) {v0 = t4; +goto L45327c;} +v0 = t4; +v0 = t4 + 0x1; +L45327c: +v1 = v0 + 0x1; +at = 0x1; +if (v1 == at) {t9 = a0 < 0x20; +goto L4532e8;} +t9 = a0 < 0x20; +v0 = MEM_U32(sp + 100); +t6 = v1 << 2; +s1 = t6 + v0; +s0 = v0 + 0x4; +L45329c: +//nop; +//nop; +//nop; +v0 = f_ugetint(mem, sp, a0, a1, a2, a3); +goto L4532ac; +//nop; +L4532ac: +gp = MEM_U32(sp + 32); +MEM_U32(s0 + -4) = v0; +//nop; +//nop; +//nop; +v0 = f_ugetint(mem, sp, a0, a1, a2, a3); +goto L4532c4; +//nop; +L4532c4: +gp = MEM_U32(sp + 32); +s0 = s0 + 0x8; +if (s0 != s1) {MEM_U32(s0 + -8) = v0; +goto L45329c;} +MEM_U32(s0 + -8) = v0; +a0 = MEM_U8(s2 + 1); +//nop; +t8 = a0 & 0x1f; +a0 = t8; +t9 = a0 < 0x20; +L4532e8: +t0 = -t9; +at = 0xc0000; +t2 = t0 & at; +t7 = t2 << (a0 & 0x1f); +v0 = MEM_U8(s2 + 0); +if ((int)t7 >= 0) {at = 0x39; +goto L453354;} +at = 0x39; +if (v0 == at) {a1 = s2 + 0x18; +goto L453334;} +a1 = s2 + 0x18; +//nop; +a0 = MEM_U32(sp + 100); +t9 = t9; +a1 = s2 + 0x10; +v0 = sp + 0x60; +func_452e50(mem, sp, a0, a1); +goto L453324; +v0 = sp + 0x60; +L453324: +gp = MEM_U32(sp + 32); +v0 = MEM_U8(s2 + 0); +at = 0x39; +goto L453358; +at = 0x39; +L453334: +//nop; +a0 = MEM_U32(sp + 100); +t9 = t9; +v0 = sp + 0x60; +func_452e50(mem, sp, a0, a1); +goto L453348; +v0 = sp + 0x60; +L453348: +gp = MEM_U32(sp + 32); +v0 = MEM_U8(s2 + 0); +//nop; +L453354: +at = 0x39; +L453358: +if (v0 == at) {t3 = MEM_U32(sp + 100); +goto L453370;} +t3 = MEM_U32(sp + 100); +t1 = MEM_U32(sp + 100); +MEM_U32(s2 + 20) = t1; +goto L453378; +MEM_U32(s2 + 20) = t1; +t3 = MEM_U32(sp + 100); +L453370: +//nop; +MEM_U32(s2 + 28) = t3; +L453378: +ra = MEM_U32(sp + 36); +L45337c: +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +sp = sp + 0x60; +return; +sp = sp + 0x60; +} + +static void f_initur(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L453390: +//initur: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +f_ugetinit(mem, sp, a0); +goto L4533b0; +MEM_U32(sp + 24) = gp; +L4533b0: +gp = MEM_U32(sp + 24); +t6 = 0x53fe0000; +at = 0x1001a6ac; +t6 = t6 | 0xf1a0; +MEM_U32(at + 0) = t6; +at = 0x1001a6a8; +t7 = 0x40040000; +t7 = t7 | 0xb020; +MEM_U32(at + 0) = t7; +at = 0x1001a6b0; +t8 = 0xffc0; +MEM_U32(at + 0) = t8; +at = 0x1001a6b0; +t9 = 0x7e000000; +MEM_U32(at + 4) = t9; +v0 = 0x1001a560; +v1 = 0x1001a580; +t1 = 0x6; +t2 = 0x7; +ra = MEM_U32(sp + 28); +MEM_U8(v0 + 9) = (uint8_t)t1; +MEM_U8(v0 + 10) = (uint8_t)t2; +a0 = 0x1; +a1 = 0x2; +a2 = 0x3; +a3 = 0x4; +t0 = 0x5; +t3 = 0x8; +t4 = 0x9; +t5 = 0xa; +t6 = 0xb; +t7 = 0xc; +t8 = 0xd; +t9 = 0xe; +t1 = 0xf; +t2 = 0x10; +sp = sp + 0x20; +MEM_U8(v0 + 0) = (uint8_t)zero; +MEM_U8(v0 + 2) = (uint8_t)a0; +MEM_U8(v0 + 5) = (uint8_t)a1; +MEM_U8(v0 + 6) = (uint8_t)a2; +MEM_U8(v0 + 7) = (uint8_t)a3; +MEM_U8(v0 + 8) = (uint8_t)t0; +MEM_U8(v0 + 11) = (uint8_t)t3; +MEM_U8(v0 + 12) = (uint8_t)t4; +MEM_U8(v0 + 13) = (uint8_t)t5; +MEM_U8(v0 + 15) = (uint8_t)t6; +MEM_U8(v0 + 16) = (uint8_t)t7; +MEM_U8(v0 + 17) = (uint8_t)t8; +MEM_U8(v0 + 18) = (uint8_t)t9; +MEM_U8(v0 + 22) = (uint8_t)t1; +MEM_U8(v0 + 23) = (uint8_t)t2; +MEM_U8(v1 + 25) = (uint8_t)zero; +MEM_U8(v1 + 12) = (uint8_t)a0; +MEM_U8(v1 + 15) = (uint8_t)a1; +MEM_U8(v1 + 17) = (uint8_t)a2; +MEM_U8(v1 + 18) = (uint8_t)a3; +MEM_U8(v1 + 0) = (uint8_t)t0; +return; +MEM_U8(v1 + 0) = (uint8_t)t0; +} + +static void f_inituwrite(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L453680: +//inituwrite: +//nop; +//nop; +//nop; +at = 0x1001b280; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +t6 = 0x1; +MEM_U32(sp + 24) = gp; +MEM_U8(at + 0) = (uint8_t)t6; +f_uputinit(mem, sp, a0); +goto L4536ac; +MEM_U8(at + 0) = (uint8_t)t6; +L4536ac: +gp = MEM_U32(sp + 24); +t7 = 0x43; +v0 = 0x1001b260; +v1 = 0x1001b278; +t8 = 0x46; +t9 = 0x47; +t2 = 0x48; +a0 = 0x5a; +a1 = 0x41; +a2 = 0x4d; +a3 = 0x50; +t0 = 0x52; +t1 = 0x53; +MEM_U8(v0 + 1) = (uint8_t)t7; +MEM_U8(v0 + 2) = (uint8_t)t8; +MEM_U8(v0 + 3) = (uint8_t)t9; +MEM_U8(v0 + 4) = (uint8_t)t2; +ra = MEM_U32(sp + 28); +at = 0x1001b284; +t3 = 0x4a; +t4 = 0x4c; +t5 = 0x4e; +t6 = 0x51; +t7 = 0x58; +t8 = 0x49; +t9 = 0x4b; +t2 = 0x57; +MEM_U8(v0 + 17) = (uint8_t)a0; +MEM_U8(v0 + 0) = (uint8_t)a1; +MEM_U8(v0 + 6) = (uint8_t)t3; +MEM_U8(v0 + 8) = (uint8_t)t4; +MEM_U8(v0 + 9) = (uint8_t)a2; +MEM_U8(v0 + 10) = (uint8_t)t5; +MEM_U8(v0 + 11) = (uint8_t)a3; +MEM_U8(v0 + 12) = (uint8_t)t6; +MEM_U8(v0 + 13) = (uint8_t)t0; +MEM_U8(v0 + 14) = (uint8_t)t1; +MEM_U8(v0 + 16) = (uint8_t)t7; +MEM_U8(v0 + 5) = (uint8_t)t8; +MEM_U8(v0 + 7) = (uint8_t)t9; +MEM_U8(v0 + 15) = (uint8_t)t2; +MEM_U8(v1 + 0) = (uint8_t)a0; +MEM_U8(v1 + 1) = (uint8_t)a2; +MEM_U8(v1 + 3) = (uint8_t)t0; +MEM_U8(v1 + 4) = (uint8_t)t1; +MEM_U8(v1 + 2) = (uint8_t)a3; +MEM_U8(v1 + 5) = (uint8_t)a1; +sp = sp + 0x20; +MEM_U32(at + 0) = zero; +return; +MEM_U32(at + 0) = zero; +} + +static uint32_t f_fnamelen(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4537f8: +//fnamelen: +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v1 = zero; +a1 = 0x400; +a0 = 0x20; +v0 = sp + 0xffffffff; +L453818: +t6 = MEM_U8(v0 + 1); +//nop; +if (a0 != t6) {//nop; +goto L453830;} +//nop; +v0 = v1; +return v0; +v0 = v1; +L453830: +t7 = MEM_U8(v0 + 2); +//nop; +if (a0 != t7) {//nop; +goto L453848;} +//nop; +v0 = v1 + 0x1; +return v0; +v0 = v1 + 0x1; +L453848: +t8 = MEM_U8(v0 + 3); +//nop; +if (a0 != t8) {//nop; +goto L453860;} +//nop; +v0 = v1 + 0x2; +return v0; +v0 = v1 + 0x2; +L453860: +t9 = MEM_U8(v0 + 4); +//nop; +if (a0 != t9) {//nop; +goto L453878;} +//nop; +v0 = v1 + 0x3; +return v0; +v0 = v1 + 0x3; +L453878: +v1 = v1 + 0x4; +if (v1 != a1) {v0 = v0 + 0x4; +goto L453818;} +v0 = v0 + 0x4; +v0 = 0x400; +//nop; +return v0; +//nop; +} + +static void f_uwrite(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L453890: +//uwrite: +//nop; +//nop; +//nop; +t6 = 0x1001b280; +sp = sp + 0xffffffa0; +t6 = MEM_U8(t6 + 0); +MEM_U32(sp + 28) = s2; +s2 = a0; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 24) = s1; +if (t6 == 0) {MEM_U32(sp + 20) = s0; +goto L453ae8;} +MEM_U32(sp + 20) = s0; +t8 = MEM_U8(a0 + 0); +t0 = 0x1001a6c0; +t9 = t8 << 2; +t9 = t9 + t8; +t9 = t9 << 2; +t9 = t9 - t8; +t1 = t9 + t0; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t7 = sp + 0x45; +MEM_U8(t7 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t7) +t4 = t1 + 4; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 7($t1) +s0 = s2 + 0x4; +MEM_U8(t7 + 4 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t7 + 4 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t7 + 4 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t7 + 4 + 3) = (uint8_t)(t4 >> 0); +//swr $t4, 7($t7) +at = t1 + 8; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 0xb($t1) +//nop; +MEM_U8(t7 + 8 + 0) = (uint8_t)(at >> 24); +MEM_U8(t7 + 8 + 1) = (uint8_t)(at >> 16); +MEM_U8(t7 + 8 + 2) = (uint8_t)(at >> 8); +MEM_U8(t7 + 8 + 3) = (uint8_t)(at >> 0); +//swr $at, 0xb($t7) +t4 = t1 + 12; t4 = (MEM_U8(t4) << 24) | (MEM_U8(t4 + 1) << 16) | (MEM_U8(t4 + 2) << 8) | MEM_U8(t4 + 3); +//lwr $t4, 0xf($t1) +//nop; +MEM_U8(t7 + 12 + 0) = (uint8_t)(t4 >> 24); +MEM_U8(t7 + 12 + 1) = (uint8_t)(t4 >> 16); +MEM_U8(t7 + 12 + 2) = (uint8_t)(t4 >> 8); +MEM_U8(t7 + 12 + 3) = (uint8_t)(t4 >> 0); +//swr $t4, 0xf($t7) +at = MEM_U8(t1 + 16); +//nop; +MEM_U8(t7 + 16) = (uint8_t)at; +t4 = MEM_U8(t1 + 17); +//nop; +MEM_U8(t7 + 17) = (uint8_t)t4; +at = MEM_U8(t1 + 18); +//nop; +MEM_U8(t7 + 18) = (uint8_t)at; +v0 = MEM_U8(sp + 85); +at = 0x1; +v0 = v0 + 0x1; +if (v0 == at) {t5 = v0 << 2; +goto L4539a4;} +t5 = v0 << 2; +s1 = t5 + s2; +L45396c: +//nop; +a0 = MEM_U32(s0 + -4); +//nop; +f_uputint(mem, sp, a0, a1, a2, a3); +goto L45397c; +//nop; +L45397c: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s0 + 0); +//nop; +//nop; +//nop; +f_uputint(mem, sp, a0, a1, a2, a3); +goto L453994; +//nop; +L453994: +gp = MEM_U32(sp + 32); +s0 = s0 + 0x8; +if (s0 != s1) {//nop; +goto L45396c;} +//nop; +L4539a4: +t6 = MEM_U8(sp + 84); +t8 = MEM_U8(sp + 85); +if (t6 == 0) {ra = MEM_U32(sp + 36); +goto L453aec;} +ra = MEM_U32(sp + 36); +t9 = t8 << 2; +s0 = s2 + t9; +//nop; +a0 = MEM_U32(s0 + 0); +//nop; +f_uputint(mem, sp, a0, a1, a2, a3); +goto L4539cc; +//nop; +L4539cc: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s0 + 4); +//nop; +//nop; +//nop; +f_uputint(mem, sp, a0, a1, a2, a3); +goto L4539e4; +//nop; +L4539e4: +t0 = MEM_U8(s2 + 1); +at = 0x4e0000; +t3 = t0 & 0x1f; +t2 = t3 < 0x20; +t7 = -t2; +at = at | 0x8000; +t1 = t7 & at; +gp = MEM_U32(sp + 32); +t4 = t1 << (t3 & 0x1f); +if ((int)t4 < 0) {//nop; +goto L453a20;} +//nop; +t5 = MEM_U8(s2 + 0); +at = 0x13; +if (t5 != at) {ra = MEM_U32(sp + 36); +goto L453aec;} +ra = MEM_U32(sp + 36); +L453a20: +v1 = MEM_U8(s2 + 0); +a1 = 0x39; +if (a1 != v1) {s1 = 0x4; +goto L453a54;} +s1 = 0x4; +v0 = MEM_U32(s2 + 24); +//nop; +v0 = v0 + 0x3; +if ((int)v0 >= 0) {t6 = (int)v0 >> 2; +goto L453a4c;} +t6 = (int)v0 >> 2; +at = v0 + 0x3; +t6 = (int)at >> 2; +L453a4c: +v0 = t6; +goto L453a74; +v0 = t6; +L453a54: +v0 = MEM_U32(s2 + 16); +//nop; +v0 = v0 + 0x3; +if ((int)v0 >= 0) {t8 = (int)v0 >> 2; +goto L453a70;} +t8 = (int)v0 >> 2; +at = v0 + 0x3; +t8 = (int)at >> 2; +L453a70: +v0 = t8; +L453a74: +t9 = v0 & 0x1; +if (t9 == 0) {at = 0x1; +goto L453a84;} +at = 0x1; +v0 = v0 + 0x1; +L453a84: +if (a1 != v1) {//nop; +goto L453a98;} +//nop; +a0 = MEM_U32(s2 + 28); +v1 = v0 + 0x1; +goto L453aa4; +v1 = v0 + 0x1; +L453a98: +a0 = MEM_U32(s2 + 20); +//nop; +v1 = v0 + 0x1; +L453aa4: +if (v1 == at) {s0 = a0 + 0x4; +goto L453ae8;} +s0 = a0 + 0x4; +s2 = v1 << 2; +L453ab0: +//nop; +a0 = MEM_U32(s0 + -4); +//nop; +f_uputint(mem, sp, a0, a1, a2, a3); +goto L453ac0; +//nop; +L453ac0: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(s0 + 0); +//nop; +//nop; +//nop; +f_uputint(mem, sp, a0, a1, a2, a3); +goto L453ad8; +//nop; +L453ad8: +gp = MEM_U32(sp + 32); +s1 = s1 + 0x8; +if (s1 != s2) {s0 = s0 + 0x8; +goto L453ab0;} +s0 = s0 + 0x8; +L453ae8: +ra = MEM_U32(sp + 36); +L453aec: +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +sp = sp + 0x60; +return; +sp = sp + 0x60; +} + +static void func_454190(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a2 = 0; +uint32_t a3 = 0; +L454190: +//nop; +//nop; +//nop; +t6 = a0 << 2; +t6 = t6 + a0; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +t6 = t6 << 2; +t0 = sp + 0x4; +t8 = 0x1001a6c0; +at = t0 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +t6 = t6 - a0; +//lwr $at, 3($t0) +t7 = t6 + 0xa; +t9 = t7 + t8; +MEM_U8(t9 + 0 + 0) = (uint8_t)(at >> 24); +MEM_U8(t9 + 0 + 1) = (uint8_t)(at >> 16); +MEM_U8(t9 + 0 + 2) = (uint8_t)(at >> 8); +MEM_U8(t9 + 0 + 3) = (uint8_t)(at >> 0); +//swr $at, 3($t9) +MEM_U32(v0 + -4) = zero; +MEM_U8(v0 + -5) = (uint8_t)a0; +return; +MEM_U8(v0 + -5) = (uint8_t)a0; +} + +static void func_4541e0(uint8_t *mem, uint32_t sp, uint32_t v0, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4541e0: +//nop; +//nop; +//nop; +MEM_U32(sp + 0) = a0; +t8 = MEM_U8(v0 + -5); +t6 = MEM_U32(v0 + -4); +t9 = t8 << 2; +t9 = t9 + t8; +t9 = t9 << 2; +t1 = 0x1001a6c0; +t9 = t9 - t8; +t7 = t6 + 0x1; +t0 = t9 + t7; +MEM_U32(v0 + -4) = t7; +t2 = t0 + t1; +MEM_U8(t2 + -1) = (uint8_t)a0; +return; +MEM_U8(t2 + -1) = (uint8_t)a0; +} + +static void f_uini(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L454224: +//uini: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +t6 = 0x1000e174; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 20) = s0; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +s0 = sp + 0x30; +a1 = MEM_U32(sp + 4); +t9 = t9; +v0 = s0; +a0 = zero; +func_454190(mem, sp, v0, a0, a1); +goto L454274; +a0 = zero; +L454274: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454290; +//nop; +L454290: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4542ac; +//nop; +L4542ac: +gp = MEM_U32(sp + 24); +a0 = 0x1; +t9 = 0x1000e170; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L4542e4; +//nop; +L4542e4: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454300; +//nop; +L454300: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45431c; +//nop; +L45431c: +gp = MEM_U32(sp + 24); +a0 = 0x2; +t2 = 0x1000e16c; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454350; +v0 = s0; +L454350: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45436c; +//nop; +L45436c: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454388; +//nop; +L454388: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4543a4; +//nop; +L4543a4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4543c0; +//nop; +L4543c0: +gp = MEM_U32(sp + 24); +a0 = 0x90; +t5 = 0x1000e168; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4543f4; +v0 = s0; +L4543f4: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454410; +//nop; +L454410: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45442c; +//nop; +L45442c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454448; +//nop; +L454448: +gp = MEM_U32(sp + 24); +a0 = 0x4; +t8 = 0x1000e164; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L45447c; +v0 = s0; +L45447c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454498; +//nop; +L454498: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4544b4; +//nop; +L4544b4: +gp = MEM_U32(sp + 24); +a0 = 0x5; +t1 = 0x1000e160; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4544e8; +v0 = s0; +L4544e8: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454504; +//nop; +L454504: +gp = MEM_U32(sp + 24); +a0 = 0x7; +t4 = 0x1000e15c; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454538; +v0 = s0; +L454538: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454554; +//nop; +L454554: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454570; +//nop; +L454570: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45458c; +//nop; +L45458c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4545a8; +//nop; +L4545a8: +gp = MEM_U32(sp + 24); +a0 = 0x8; +t6 = 0x1000e158; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4545dc; +v0 = s0; +L4545dc: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4545f8; +//nop; +L4545f8: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454614; +//nop; +L454614: +gp = MEM_U32(sp + 24); +a0 = 0x9; +t9 = 0x1000e154; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L45464c; +//nop; +L45464c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454668; +//nop; +L454668: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454684; +//nop; +L454684: +gp = MEM_U32(sp + 24); +a0 = 0xf; +t2 = 0x1000e150; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4546b8; +v0 = s0; +L4546b8: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4546d4; +//nop; +L4546d4: +gp = MEM_U32(sp + 24); +a0 = 0xc; +t5 = 0x1000e14c; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454708; +v0 = s0; +L454708: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454724; +//nop; +L454724: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454740; +//nop; +L454740: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45475c; +//nop; +L45475c: +gp = MEM_U32(sp + 24); +a0 = 0xd; +t8 = 0x1000e148; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454790; +v0 = s0; +L454790: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4547ac; +//nop; +L4547ac: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4547c8; +//nop; +L4547c8: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4547e4; +//nop; +L4547e4: +gp = MEM_U32(sp + 24); +a0 = 0xe; +t1 = 0x1000e144; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454818; +v0 = s0; +L454818: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454834; +//nop; +L454834: +gp = MEM_U32(sp + 24); +a0 = 0x10; +t4 = 0x1000e140; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454868; +v0 = s0; +L454868: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454884; +//nop; +L454884: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4548a0; +//nop; +L4548a0: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4548bc; +//nop; +L4548bc: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4548d8; +//nop; +L4548d8: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4548f4; +//nop; +L4548f4: +gp = MEM_U32(sp + 24); +a0 = 0xb; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454910; +//nop; +L454910: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45492c; +//nop; +L45492c: +gp = MEM_U32(sp + 24); +a0 = 0x11; +t6 = 0x1000e13c; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454960; +v0 = s0; +L454960: +gp = MEM_U32(sp + 24); +a0 = 0x3; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45497c; +//nop; +L45497c: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454998; +//nop; +L454998: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4549b4; +//nop; +L4549b4: +gp = MEM_U32(sp + 24); +a0 = 0x12; +t9 = 0x1000e138; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L4549ec; +//nop; +L4549ec: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454a08; +//nop; +L454a08: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454a24; +//nop; +L454a24: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454a40; +//nop; +L454a40: +gp = MEM_U32(sp + 24); +a0 = 0x16; +t2 = 0x1000e134; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454a74; +v0 = s0; +L454a74: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454a90; +//nop; +L454a90: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454aac; +//nop; +L454aac: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454ac8; +//nop; +L454ac8: +gp = MEM_U32(sp + 24); +a0 = 0x15; +t5 = 0x1000e130; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454afc; +v0 = s0; +L454afc: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454b18; +//nop; +L454b18: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454b34; +//nop; +L454b34: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454b50; +//nop; +L454b50: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454b6c; +//nop; +L454b6c: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454b88; +//nop; +L454b88: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454ba4; +//nop; +L454ba4: +gp = MEM_U32(sp + 24); +a0 = 0x13; +t8 = 0x1000e12c; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454bd8; +v0 = s0; +L454bd8: +gp = MEM_U32(sp + 24); +a0 = 0xc; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454bf4; +//nop; +L454bf4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454c10; +//nop; +L454c10: +gp = MEM_U32(sp + 24); +a0 = 0x17; +t1 = 0x1000e128; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454c44; +v0 = s0; +L454c44: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454c60; +//nop; +L454c60: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454c7c; +//nop; +L454c7c: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454c98; +//nop; +L454c98: +gp = MEM_U32(sp + 24); +a0 = 0x7; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454cb4; +//nop; +L454cb4: +gp = MEM_U32(sp + 24); +a0 = 0x8; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454cd0; +//nop; +L454cd0: +gp = MEM_U32(sp + 24); +a0 = 0x9; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454cec; +//nop; +L454cec: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454d08; +//nop; +L454d08: +gp = MEM_U32(sp + 24); +a0 = 0x18; +t4 = 0x1000e124; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454d3c; +v0 = s0; +L454d3c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454d58; +//nop; +L454d58: +gp = MEM_U32(sp + 24); +a0 = 0x6; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454d74; +//nop; +L454d74: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454d90; +//nop; +L454d90: +gp = MEM_U32(sp + 24); +a0 = 0x19; +t6 = 0x1000e120; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454dc4; +v0 = s0; +L454dc4: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454de0; +//nop; +L454de0: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454dfc; +//nop; +L454dfc: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454e18; +//nop; +L454e18: +gp = MEM_U32(sp + 24); +a0 = 0x1a; +t9 = 0x1000e11c; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L454e50; +//nop; +L454e50: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454e6c; +//nop; +L454e6c: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454e88; +//nop; +L454e88: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454ea4; +//nop; +L454ea4: +gp = MEM_U32(sp + 24); +a0 = 0x1b; +t2 = 0x1000e118; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454ed8; +v0 = s0; +L454ed8: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454ef4; +//nop; +L454ef4: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454f10; +//nop; +L454f10: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454f2c; +//nop; +L454f2c: +gp = MEM_U32(sp + 24); +a0 = 0x1c; +t5 = 0x1000e114; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454f60; +v0 = s0; +L454f60: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454f7c; +//nop; +L454f7c: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454f98; +//nop; +L454f98: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L454fb4; +//nop; +L454fb4: +gp = MEM_U32(sp + 24); +a0 = 0x1d; +t8 = 0x1000e110; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L454fe8; +v0 = s0; +L454fe8: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455004; +//nop; +L455004: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455020; +//nop; +L455020: +gp = MEM_U32(sp + 24); +a0 = 0x1e; +t1 = 0x1000e10c; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L455054; +v0 = s0; +L455054: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455070; +//nop; +L455070: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45508c; +//nop; +L45508c: +gp = MEM_U32(sp + 24); +a0 = 0x1f; +t4 = 0x1000e108; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4550c0; +v0 = s0; +L4550c0: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4550dc; +//nop; +L4550dc: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4550f8; +//nop; +L4550f8: +gp = MEM_U32(sp + 24); +a0 = 0x20; +t6 = 0x1000e104; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L45512c; +v0 = s0; +L45512c: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455148; +//nop; +L455148: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455164; +//nop; +L455164: +gp = MEM_U32(sp + 24); +a0 = 0x21; +t9 = 0x1000e100; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L45519c; +//nop; +L45519c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4551b8; +//nop; +L4551b8: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4551d4; +//nop; +L4551d4: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4551f0; +//nop; +L4551f0: +gp = MEM_U32(sp + 24); +a0 = 0x7; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45520c; +//nop; +L45520c: +gp = MEM_U32(sp + 24); +a0 = 0x8; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455228; +//nop; +L455228: +gp = MEM_U32(sp + 24); +a0 = 0x9; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455244; +//nop; +L455244: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455260; +//nop; +L455260: +gp = MEM_U32(sp + 24); +a0 = 0x3; +t2 = 0x1000e0fc; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L455294; +v0 = s0; +L455294: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4552b0; +//nop; +L4552b0: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4552cc; +//nop; +L4552cc: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4552e8; +//nop; +L4552e8: +gp = MEM_U32(sp + 24); +a0 = 0x7; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455304; +//nop; +L455304: +gp = MEM_U32(sp + 24); +a0 = 0x8; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455320; +//nop; +L455320: +gp = MEM_U32(sp + 24); +a0 = 0x9; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45533c; +//nop; +L45533c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455358; +//nop; +L455358: +gp = MEM_U32(sp + 24); +a0 = 0x23; +t5 = 0x1000e0f8; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L45538c; +v0 = s0; +L45538c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4553a8; +//nop; +L4553a8: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4553c4; +//nop; +L4553c4: +gp = MEM_U32(sp + 24); +a0 = 0x26; +t8 = 0x1000e0f4; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4553f8; +v0 = s0; +L4553f8: +gp = MEM_U32(sp + 24); +a0 = 0x4; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455414; +//nop; +L455414: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455430; +//nop; +L455430: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45544c; +//nop; +L45544c: +gp = MEM_U32(sp + 24); +a0 = 0x28; +t1 = 0x1000e0f0; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L455480; +v0 = s0; +L455480: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45549c; +//nop; +L45549c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4554b8; +//nop; +L4554b8: +gp = MEM_U32(sp + 24); +a0 = 0x29; +t4 = 0x1000e0ec; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4554ec; +v0 = s0; +L4554ec: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455508; +//nop; +L455508: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455524; +//nop; +L455524: +gp = MEM_U32(sp + 24); +a0 = 0x25; +t6 = 0x1000e0e8; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L455558; +v0 = s0; +L455558: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455574; +//nop; +L455574: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455590; +//nop; +L455590: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4555ac; +//nop; +L4555ac: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4555c8; +//nop; +L4555c8: +gp = MEM_U32(sp + 24); +a0 = 0x2d; +t9 = 0x1000e0e4; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L455600; +//nop; +L455600: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45561c; +//nop; +L45561c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455638; +//nop; +L455638: +gp = MEM_U32(sp + 24); +a0 = 0x2e; +t2 = 0x1000e0e0; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L45566c; +v0 = s0; +L45566c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455688; +//nop; +L455688: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4556a4; +//nop; +L4556a4: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4556c0; +//nop; +L4556c0: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4556dc; +//nop; +L4556dc: +gp = MEM_U32(sp + 24); +a0 = 0x2f; +t5 = 0x1000e0dc; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L455710; +v0 = s0; +L455710: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45572c; +//nop; +L45572c: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455748; +//nop; +L455748: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455764; +//nop; +L455764: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455780; +//nop; +L455780: +gp = MEM_U32(sp + 24); +a0 = 0x30; +t8 = 0x1000e0d8; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4557b4; +v0 = s0; +L4557b4: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4557d0; +//nop; +L4557d0: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4557ec; +//nop; +L4557ec: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455808; +//nop; +L455808: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455824; +//nop; +L455824: +gp = MEM_U32(sp + 24); +a0 = 0x34; +t1 = 0x1000e0d4; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L455858; +v0 = s0; +L455858: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455874; +//nop; +L455874: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455890; +//nop; +L455890: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4558ac; +//nop; +L4558ac: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4558c8; +//nop; +L4558c8: +gp = MEM_U32(sp + 24); +a0 = 0x35; +t4 = 0x1000e0d0; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4558fc; +v0 = s0; +L4558fc: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455918; +//nop; +L455918: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455934; +//nop; +L455934: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455950; +//nop; +L455950: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45596c; +//nop; +L45596c: +gp = MEM_U32(sp + 24); +a0 = 0x36; +t6 = 0x1000e0cc; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4559a0; +v0 = s0; +L4559a0: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4559bc; +//nop; +L4559bc: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4559d8; +//nop; +L4559d8: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4559f4; +//nop; +L4559f4: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455a10; +//nop; +L455a10: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455a2c; +//nop; +L455a2c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455a48; +//nop; +L455a48: +gp = MEM_U32(sp + 24); +a0 = 0x38; +t9 = 0x1000e0c8; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L455a80; +//nop; +L455a80: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455a9c; +//nop; +L455a9c: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455ab8; +//nop; +L455ab8: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455ad4; +//nop; +L455ad4: +gp = MEM_U32(sp + 24); +a0 = 0x37; +t2 = 0x1000e0c4; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L455b08; +v0 = s0; +L455b08: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455b24; +//nop; +L455b24: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455b40; +//nop; +L455b40: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455b5c; +//nop; +L455b5c: +gp = MEM_U32(sp + 24); +a0 = 0x39; +t5 = 0x1000e0c0; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L455b90; +v0 = s0; +L455b90: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455bac; +//nop; +L455bac: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455bc8; +//nop; +L455bc8: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455be4; +//nop; +L455be4: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455c00; +//nop; +L455c00: +gp = MEM_U32(sp + 24); +a0 = 0xf; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455c1c; +//nop; +L455c1c: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455c38; +//nop; +L455c38: +gp = MEM_U32(sp + 24); +a0 = 0x12; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455c54; +//nop; +L455c54: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455c70; +//nop; +L455c70: +gp = MEM_U32(sp + 24); +a0 = 0x10; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455c8c; +//nop; +L455c8c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455ca8; +//nop; +L455ca8: +gp = MEM_U32(sp + 24); +a0 = 0x3a; +t8 = 0x1000e0bc; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L455cdc; +v0 = s0; +L455cdc: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455cf8; +//nop; +L455cf8: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455d14; +//nop; +L455d14: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455d30; +//nop; +L455d30: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455d4c; +//nop; +L455d4c: +gp = MEM_U32(sp + 24); +a0 = 0x3b; +t1 = 0x1000e0b8; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L455d80; +v0 = s0; +L455d80: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455d9c; +//nop; +L455d9c: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455db8; +//nop; +L455db8: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455dd4; +//nop; +L455dd4: +gp = MEM_U32(sp + 24); +a0 = 0x3c; +t4 = 0x1000e0b4; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L455e08; +v0 = s0; +L455e08: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455e24; +//nop; +L455e24: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455e40; +//nop; +L455e40: +gp = MEM_U32(sp + 24); +a0 = 0x3f; +t6 = 0x1000e0b0; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L455e74; +v0 = s0; +L455e74: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455e90; +//nop; +L455e90: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455eac; +//nop; +L455eac: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455ec8; +//nop; +L455ec8: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455ee4; +//nop; +L455ee4: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455f00; +//nop; +L455f00: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455f1c; +//nop; +L455f1c: +gp = MEM_U32(sp + 24); +a0 = 0x41; +t9 = 0x1000e0ac; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L455f54; +//nop; +L455f54: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455f70; +//nop; +L455f70: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455f8c; +//nop; +L455f8c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455fa8; +//nop; +L455fa8: +gp = MEM_U32(sp + 24); +a0 = 0x42; +t2 = 0x1000e0a8; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L455fdc; +v0 = s0; +L455fdc: +gp = MEM_U32(sp + 24); +a0 = 0x3; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L455ff8; +//nop; +L455ff8: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456014; +//nop; +L456014: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456030; +//nop; +L456030: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45604c; +//nop; +L45604c: +gp = MEM_U32(sp + 24); +a0 = 0x4a; +t5 = 0x1000e0a4; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456080; +v0 = s0; +L456080: +gp = MEM_U32(sp + 24); +a0 = 0x3; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45609c; +//nop; +L45609c: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4560b8; +//nop; +L4560b8: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4560d4; +//nop; +L4560d4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4560f0; +//nop; +L4560f0: +gp = MEM_U32(sp + 24); +a0 = 0x43; +t8 = 0x1000e0a0; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456124; +v0 = s0; +L456124: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456140; +//nop; +L456140: +gp = MEM_U32(sp + 24); +a0 = 0x46; +t1 = 0x1000e09c; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456174; +v0 = s0; +L456174: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456190; +//nop; +L456190: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4561ac; +//nop; +L4561ac: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4561c8; +//nop; +L4561c8: +gp = MEM_U32(sp + 24); +a0 = 0xb; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4561e4; +//nop; +L4561e4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456200; +//nop; +L456200: +gp = MEM_U32(sp + 24); +a0 = 0x32; +t4 = 0x1000e098; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456234; +v0 = s0; +L456234: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456250; +//nop; +L456250: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45626c; +//nop; +L45626c: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456288; +//nop; +L456288: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4562a4; +//nop; +L4562a4: +gp = MEM_U32(sp + 24); +a0 = 0xf; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4562c0; +//nop; +L4562c0: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4562dc; +//nop; +L4562dc: +gp = MEM_U32(sp + 24); +a0 = 0x47; +t6 = 0x1000e094; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456310; +v0 = s0; +L456310: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45632c; +//nop; +L45632c: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456348; +//nop; +L456348: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456364; +//nop; +L456364: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456380; +//nop; +L456380: +gp = MEM_U32(sp + 24); +a0 = 0xf; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45639c; +//nop; +L45639c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4563b8; +//nop; +L4563b8: +gp = MEM_U32(sp + 24); +a0 = 0x49; +t9 = 0x1000e090; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L4563f0; +//nop; +L4563f0: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45640c; +//nop; +L45640c: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456428; +//nop; +L456428: +gp = MEM_U32(sp + 24); +a0 = 0xb; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456444; +//nop; +L456444: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456460; +//nop; +L456460: +gp = MEM_U32(sp + 24); +a0 = 0x4b; +t2 = 0x1000e08c; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456494; +v0 = s0; +L456494: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4564b0; +//nop; +L4564b0: +gp = MEM_U32(sp + 24); +a0 = 0x48; +t5 = 0x1000e088; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4564e4; +v0 = s0; +L4564e4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456500; +//nop; +L456500: +gp = MEM_U32(sp + 24); +a0 = 0x4d; +t8 = 0x1000e084; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456534; +v0 = s0; +L456534: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456550; +//nop; +L456550: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45656c; +//nop; +L45656c: +gp = MEM_U32(sp + 24); +a0 = 0x4e; +t1 = 0x1000e080; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4565a0; +v0 = s0; +L4565a0: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4565bc; +//nop; +L4565bc: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4565d8; +//nop; +L4565d8: +gp = MEM_U32(sp + 24); +a0 = 0x4f; +t4 = 0x1000e07c; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L45660c; +v0 = s0; +L45660c: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456628; +//nop; +L456628: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456644; +//nop; +L456644: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456660; +//nop; +L456660: +gp = MEM_U32(sp + 24); +a0 = 0x51; +t6 = 0x1000e078; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456694; +v0 = s0; +L456694: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4566b0; +//nop; +L4566b0: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4566cc; +//nop; +L4566cc: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4566e8; +//nop; +L4566e8: +gp = MEM_U32(sp + 24); +a0 = 0x52; +t9 = 0x1000e074; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L456720; +//nop; +L456720: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45673c; +//nop; +L45673c: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456758; +//nop; +L456758: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456774; +//nop; +L456774: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456790; +//nop; +L456790: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4567ac; +//nop; +L4567ac: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4567c8; +//nop; +L4567c8: +gp = MEM_U32(sp + 24); +a0 = 0x56; +t2 = 0x1000e070; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4567fc; +v0 = s0; +L4567fc: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456818; +//nop; +L456818: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456834; +//nop; +L456834: +gp = MEM_U32(sp + 24); +a0 = 0x55; +t5 = 0x1000e06c; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456868; +v0 = s0; +L456868: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456884; +//nop; +L456884: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4568a0; +//nop; +L4568a0: +gp = MEM_U32(sp + 24); +a0 = 0x57; +t8 = 0x1000e068; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4568d4; +v0 = s0; +L4568d4: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4568f0; +//nop; +L4568f0: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45690c; +//nop; +L45690c: +gp = MEM_U32(sp + 24); +a0 = 0x69; +t1 = 0x1000e064; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456940; +v0 = s0; +L456940: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45695c; +//nop; +L45695c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456978; +//nop; +L456978: +gp = MEM_U32(sp + 24); +a0 = 0x58; +t4 = 0x1000e060; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4569ac; +v0 = s0; +L4569ac: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4569c8; +//nop; +L4569c8: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4569e4; +//nop; +L4569e4: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456a00; +//nop; +L456a00: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456a1c; +//nop; +L456a1c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456a38; +//nop; +L456a38: +gp = MEM_U32(sp + 24); +a0 = 0x5b; +t6 = 0x1000e05c; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456a6c; +v0 = s0; +L456a6c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456a88; +//nop; +L456a88: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456aa4; +//nop; +L456aa4: +gp = MEM_U32(sp + 24); +a0 = 0x5c; +t9 = 0x1000e058; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L456adc; +//nop; +L456adc: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456af8; +//nop; +L456af8: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456b14; +//nop; +L456b14: +gp = MEM_U32(sp + 24); +a0 = 0x8f; +t2 = 0x1000e054; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456b48; +v0 = s0; +L456b48: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456b64; +//nop; +L456b64: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456b80; +//nop; +L456b80: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456b9c; +//nop; +L456b9c: +gp = MEM_U32(sp + 24); +a0 = 0x5d; +t5 = 0x1000e050; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456bd0; +v0 = s0; +L456bd0: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456bec; +//nop; +L456bec: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456c08; +//nop; +L456c08: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456c24; +//nop; +L456c24: +gp = MEM_U32(sp + 24); +a0 = 0x5e; +t8 = 0x1000e04c; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456c58; +v0 = s0; +L456c58: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456c74; +//nop; +L456c74: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456c90; +//nop; +L456c90: +gp = MEM_U32(sp + 24); +a0 = 0x5f; +t1 = 0x1000e048; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456cc4; +v0 = s0; +L456cc4: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456ce0; +//nop; +L456ce0: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456cfc; +//nop; +L456cfc: +gp = MEM_U32(sp + 24); +a0 = 0x60; +t4 = 0x1000e044; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456d30; +v0 = s0; +L456d30: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456d4c; +//nop; +L456d4c: +gp = MEM_U32(sp + 24); +a0 = 0x61; +t6 = 0x1000e040; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456d80; +v0 = s0; +L456d80: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456d9c; +//nop; +L456d9c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456db8; +//nop; +L456db8: +gp = MEM_U32(sp + 24); +a0 = 0x62; +t9 = 0x1000e03c; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L456df0; +//nop; +L456df0: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456e0c; +//nop; +L456e0c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456e28; +//nop; +L456e28: +gp = MEM_U32(sp + 24); +a0 = 0x8e; +t2 = 0x1000e038; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456e5c; +v0 = s0; +L456e5c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456e78; +//nop; +L456e78: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456e94; +//nop; +L456e94: +gp = MEM_U32(sp + 24); +a0 = 0x63; +t5 = 0x1000e034; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456ec8; +v0 = s0; +L456ec8: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456ee4; +//nop; +L456ee4: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456f00; +//nop; +L456f00: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456f1c; +//nop; +L456f1c: +gp = MEM_U32(sp + 24); +a0 = 0x64; +t8 = 0x1000e030; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L456f50; +v0 = s0; +L456f50: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456f6c; +//nop; +L456f6c: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456f88; +//nop; +L456f88: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456fa4; +//nop; +L456fa4: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456fc0; +//nop; +L456fc0: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456fdc; +//nop; +L456fdc: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L456ff8; +//nop; +L456ff8: +gp = MEM_U32(sp + 24); +a0 = 0x65; +t1 = 0x1000e02c; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L45702c; +v0 = s0; +L45702c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457048; +//nop; +L457048: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457064; +//nop; +L457064: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457080; +//nop; +L457080: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45709c; +//nop; +L45709c: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4570b8; +//nop; +L4570b8: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4570d4; +//nop; +L4570d4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4570f0; +//nop; +L4570f0: +gp = MEM_U32(sp + 24); +a0 = 0x67; +t4 = 0x1000e028; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457124; +v0 = s0; +L457124: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457140; +//nop; +L457140: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45715c; +//nop; +L45715c: +gp = MEM_U32(sp + 24); +a0 = 0x68; +t6 = 0x1000e024; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457190; +v0 = s0; +L457190: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4571ac; +//nop; +L4571ac: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4571c8; +//nop; +L4571c8: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4571e4; +//nop; +L4571e4: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457200; +//nop; +L457200: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45721c; +//nop; +L45721c: +gp = MEM_U32(sp + 24); +a0 = 0x6a; +t9 = 0x1000e020; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L457254; +//nop; +L457254: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457270; +//nop; +L457270: +gp = MEM_U32(sp + 24); +a0 = 0x6b; +t2 = 0x1000e01c; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4572a4; +v0 = s0; +L4572a4: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4572c0; +//nop; +L4572c0: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4572dc; +//nop; +L4572dc: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4572f8; +//nop; +L4572f8: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457314; +//nop; +L457314: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457330; +//nop; +L457330: +gp = MEM_U32(sp + 24); +a0 = 0x6c; +t5 = 0x1000e018; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457364; +v0 = s0; +L457364: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457380; +//nop; +L457380: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45739c; +//nop; +L45739c: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4573b8; +//nop; +L4573b8: +gp = MEM_U32(sp + 24); +a0 = 0xb; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4573d4; +//nop; +L4573d4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4573f0; +//nop; +L4573f0: +gp = MEM_U32(sp + 24); +a0 = 0x6d; +t8 = 0x1000e014; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457424; +v0 = s0; +L457424: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457440; +//nop; +L457440: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45745c; +//nop; +L45745c: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457478; +//nop; +L457478: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457494; +//nop; +L457494: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4574b0; +//nop; +L4574b0: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4574cc; +//nop; +L4574cc: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4574e8; +//nop; +L4574e8: +gp = MEM_U32(sp + 24); +a0 = 0x6e; +t1 = 0x1000e010; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L45751c; +v0 = s0; +L45751c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457538; +//nop; +L457538: +gp = MEM_U32(sp + 24); +a0 = 0x6; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457554; +//nop; +L457554: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457570; +//nop; +L457570: +gp = MEM_U32(sp + 24); +a0 = 0x6f; +t4 = 0x1000e00c; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4575a4; +v0 = s0; +L4575a4: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4575c0; +//nop; +L4575c0: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4575dc; +//nop; +L4575dc: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4575f8; +//nop; +L4575f8: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457614; +//nop; +L457614: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457630; +//nop; +L457630: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45764c; +//nop; +L45764c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457668; +//nop; +L457668: +gp = MEM_U32(sp + 24); +a0 = 0x70; +t6 = 0x1000e008; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L45769c; +v0 = s0; +L45769c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4576b8; +//nop; +L4576b8: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4576d4; +//nop; +L4576d4: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4576f0; +//nop; +L4576f0: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45770c; +//nop; +L45770c: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457728; +//nop; +L457728: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457744; +//nop; +L457744: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457760; +//nop; +L457760: +gp = MEM_U32(sp + 24); +a0 = 0x71; +t9 = 0x1000e004; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L457798; +//nop; +L457798: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4577b4; +//nop; +L4577b4: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4577d0; +//nop; +L4577d0: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4577ec; +//nop; +L4577ec: +gp = MEM_U32(sp + 24); +a0 = 0x6; +t2 = 0x1000e000; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457820; +v0 = s0; +L457820: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45783c; +//nop; +L45783c: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457858; +//nop; +L457858: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457874; +//nop; +L457874: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457890; +//nop; +L457890: +gp = MEM_U32(sp + 24); +a0 = 0x2b; +t5 = 0x1000dffc; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4578c4; +v0 = s0; +L4578c4: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4578e0; +//nop; +L4578e0: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4578fc; +//nop; +L4578fc: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457918; +//nop; +L457918: +gp = MEM_U32(sp + 24); +a0 = 0x72; +t8 = 0x1000dff8; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L45794c; +v0 = s0; +L45794c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457968; +//nop; +L457968: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457984; +//nop; +L457984: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4579a0; +//nop; +L4579a0: +gp = MEM_U32(sp + 24); +a0 = 0x76; +t1 = 0x1000dff4; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4579d4; +v0 = s0; +L4579d4: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4579f0; +//nop; +L4579f0: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457a0c; +//nop; +L457a0c: +gp = MEM_U32(sp + 24); +a0 = 0x77; +t4 = 0x1000dff0; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457a40; +v0 = s0; +L457a40: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457a5c; +//nop; +L457a5c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457a78; +//nop; +L457a78: +gp = MEM_U32(sp + 24); +a0 = 0x79; +t6 = 0x1000dfec; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457aac; +v0 = s0; +L457aac: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457ac8; +//nop; +L457ac8: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457ae4; +//nop; +L457ae4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457b00; +//nop; +L457b00: +gp = MEM_U32(sp + 24); +a0 = 0x7a; +t9 = 0x1000dfe8; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L457b38; +//nop; +L457b38: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457b54; +//nop; +L457b54: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457b70; +//nop; +L457b70: +gp = MEM_U32(sp + 24); +a0 = 0x7b; +t2 = 0x1000dfe4; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457ba4; +v0 = s0; +L457ba4: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457bc0; +//nop; +L457bc0: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457bdc; +//nop; +L457bdc: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457bf8; +//nop; +L457bf8: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457c14; +//nop; +L457c14: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457c30; +//nop; +L457c30: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457c4c; +//nop; +L457c4c: +gp = MEM_U32(sp + 24); +a0 = 0x7c; +t5 = 0x1000dfe0; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457c80; +v0 = s0; +L457c80: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457c9c; +//nop; +L457c9c: +gp = MEM_U32(sp + 24); +a0 = 0x7d; +t8 = 0x1000dfdc; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457cd0; +v0 = s0; +L457cd0: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457cec; +//nop; +L457cec: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457d08; +//nop; +L457d08: +gp = MEM_U32(sp + 24); +a0 = 0x7e; +t1 = 0x1000dfd8; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457d3c; +v0 = s0; +L457d3c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457d58; +//nop; +L457d58: +gp = MEM_U32(sp + 24); +a0 = 0x6; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457d74; +//nop; +L457d74: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457d90; +//nop; +L457d90: +gp = MEM_U32(sp + 24); +a0 = 0x7f; +t4 = 0x1000dfd4; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457dc4; +v0 = s0; +L457dc4: +gp = MEM_U32(sp + 24); +a0 = 0x4; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457de0; +//nop; +L457de0: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457dfc; +//nop; +L457dfc: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457e18; +//nop; +L457e18: +gp = MEM_U32(sp + 24); +a0 = 0x86; +t6 = 0x1000dfd0; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457e4c; +v0 = s0; +L457e4c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457e68; +//nop; +L457e68: +gp = MEM_U32(sp + 24); +a0 = 0x6; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457e84; +//nop; +L457e84: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457ea0; +//nop; +L457ea0: +gp = MEM_U32(sp + 24); +a0 = 0x88; +t9 = 0x1000dfcc; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L457ed8; +//nop; +L457ed8: +gp = MEM_U32(sp + 24); +a0 = 0x4; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457ef4; +//nop; +L457ef4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457f10; +//nop; +L457f10: +gp = MEM_U32(sp + 24); +a0 = 0x8a; +t2 = 0x1000dfc8; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457f44; +v0 = s0; +L457f44: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457f60; +//nop; +L457f60: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457f7c; +//nop; +L457f7c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457f98; +//nop; +L457f98: +gp = MEM_U32(sp + 24); +a0 = 0x8c; +t5 = 0x1000dfc4; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L457fcc; +v0 = s0; +L457fcc: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L457fe8; +//nop; +L457fe8: +gp = MEM_U32(sp + 24); +a0 = 0x4; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458004; +//nop; +L458004: +gp = MEM_U32(sp + 24); +a0 = 0x11; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458020; +//nop; +L458020: +gp = MEM_U32(sp + 24); +a0 = 0x14; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45803c; +//nop; +L45803c: +gp = MEM_U32(sp + 24); +a0 = 0x15; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458058; +//nop; +L458058: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458074; +//nop; +L458074: +gp = MEM_U32(sp + 24); +a0 = 0x8d; +t8 = 0x1000dfc0; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4580a8; +v0 = s0; +L4580a8: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4580c4; +//nop; +L4580c4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4580e0; +//nop; +L4580e0: +gp = MEM_U32(sp + 24); +a0 = 0x14; +t1 = 0x1000dfbc; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458114; +v0 = s0; +L458114: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458130; +//nop; +L458130: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45814c; +//nop; +L45814c: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458168; +//nop; +L458168: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458184; +//nop; +L458184: +gp = MEM_U32(sp + 24); +a0 = 0x24; +t4 = 0x1000dfb8; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4581b8; +v0 = s0; +L4581b8: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4581d4; +//nop; +L4581d4: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4581f0; +//nop; +L4581f0: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45820c; +//nop; +L45820c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458228; +//nop; +L458228: +gp = MEM_U32(sp + 24); +a0 = 0x27; +t6 = 0x1000dfb4; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L45825c; +v0 = s0; +L45825c: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458278; +//nop; +L458278: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458294; +//nop; +L458294: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4582b0; +//nop; +L4582b0: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4582cc; +//nop; +L4582cc: +gp = MEM_U32(sp + 24); +a0 = 0x2a; +t9 = 0x1000dfb0; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L458304; +//nop; +L458304: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458320; +//nop; +L458320: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45833c; +//nop; +L45833c: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458358; +//nop; +L458358: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458374; +//nop; +L458374: +gp = MEM_U32(sp + 24); +a0 = 0x53; +t2 = 0x1000dfac; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4583a8; +v0 = s0; +L4583a8: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4583c4; +//nop; +L4583c4: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4583e0; +//nop; +L4583e0: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4583fc; +//nop; +L4583fc: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458418; +//nop; +L458418: +gp = MEM_U32(sp + 24); +a0 = 0x73; +t5 = 0x1000dfa8; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L45844c; +v0 = s0; +L45844c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458468; +//nop; +L458468: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458484; +//nop; +L458484: +gp = MEM_U32(sp + 24); +a0 = 0x74; +t8 = 0x1000dfa4; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4584b8; +v0 = s0; +L4584b8: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4584d4; +//nop; +L4584d4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4584f0; +//nop; +L4584f0: +gp = MEM_U32(sp + 24); +a0 = 0x50; +t1 = 0x1000dfa0; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458524; +v0 = s0; +L458524: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458540; +//nop; +L458540: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45855c; +//nop; +L45855c: +gp = MEM_U32(sp + 24); +a0 = 0x2c; +t4 = 0x1000df9c; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458590; +v0 = s0; +L458590: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4585ac; +//nop; +L4585ac: +gp = MEM_U32(sp + 24); +a0 = 0x7; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4585c8; +//nop; +L4585c8: +gp = MEM_U32(sp + 24); +a0 = 0x8; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4585e4; +//nop; +L4585e4: +gp = MEM_U32(sp + 24); +a0 = 0x9; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458600; +//nop; +L458600: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45861c; +//nop; +L45861c: +gp = MEM_U32(sp + 24); +a0 = 0x3d; +t6 = 0x1000df98; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458650; +v0 = s0; +L458650: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45866c; +//nop; +L45866c: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458688; +//nop; +L458688: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4586a4; +//nop; +L4586a4: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4586c0; +//nop; +L4586c0: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4586dc; +//nop; +L4586dc: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4586f8; +//nop; +L4586f8: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458714; +//nop; +L458714: +gp = MEM_U32(sp + 24); +a0 = 0x3e; +t9 = 0x1000df94; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L45874c; +//nop; +L45874c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458768; +//nop; +L458768: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458784; +//nop; +L458784: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4587a0; +//nop; +L4587a0: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4587bc; +//nop; +L4587bc: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4587d8; +//nop; +L4587d8: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4587f4; +//nop; +L4587f4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458810; +//nop; +L458810: +gp = MEM_U32(sp + 24); +a0 = 0x66; +t2 = 0x1000df90; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458844; +v0 = s0; +L458844: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458860; +//nop; +L458860: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45887c; +//nop; +L45887c: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458898; +//nop; +L458898: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4588b4; +//nop; +L4588b4: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4588d0; +//nop; +L4588d0: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4588ec; +//nop; +L4588ec: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458908; +//nop; +L458908: +gp = MEM_U32(sp + 24); +a0 = 0x5a; +t5 = 0x1000df8c; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L45893c; +v0 = s0; +L45893c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458958; +//nop; +L458958: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458974; +//nop; +L458974: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458990; +//nop; +L458990: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4589ac; +//nop; +L4589ac: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4589c8; +//nop; +L4589c8: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4589e4; +//nop; +L4589e4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458a00; +//nop; +L458a00: +gp = MEM_U32(sp + 24); +a0 = 0x89; +t8 = 0x1000df88; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458a34; +v0 = s0; +L458a34: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458a50; +//nop; +L458a50: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458a6c; +//nop; +L458a6c: +gp = MEM_U32(sp + 24); +a0 = 0x13; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458a88; +//nop; +L458a88: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458aa4; +//nop; +L458aa4: +gp = MEM_U32(sp + 24); +a0 = 0x8b; +t1 = 0x1000df84; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458ad8; +v0 = s0; +L458ad8: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458af4; +//nop; +L458af4: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458b10; +//nop; +L458b10: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458b2c; +//nop; +L458b2c: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458b48; +//nop; +L458b48: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458b64; +//nop; +L458b64: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458b80; +//nop; +L458b80: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458b9c; +//nop; +L458b9c: +gp = MEM_U32(sp + 24); +a0 = 0x31; +t4 = 0x1000df80; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458bd0; +v0 = s0; +L458bd0: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458bec; +//nop; +L458bec: +gp = MEM_U32(sp + 24); +a0 = 0xa; +t6 = 0x1000df7c; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458c20; +v0 = s0; +L458c20: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458c3c; +//nop; +L458c3c: +gp = MEM_U32(sp + 24); +a0 = 0xb; +t9 = 0x1000df78; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L458c74; +//nop; +L458c74: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458c90; +//nop; +L458c90: +gp = MEM_U32(sp + 24); +a0 = 0x80; +t2 = 0x1000df74; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458cc4; +v0 = s0; +L458cc4: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458ce0; +//nop; +L458ce0: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458cfc; +//nop; +L458cfc: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458d18; +//nop; +L458d18: +gp = MEM_U32(sp + 24); +a0 = 0x85; +t5 = 0x1000df70; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458d4c; +v0 = s0; +L458d4c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458d68; +//nop; +L458d68: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458d84; +//nop; +L458d84: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458da0; +//nop; +L458da0: +gp = MEM_U32(sp + 24); +a0 = 0x84; +t8 = 0x1000df6c; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458dd4; +v0 = s0; +L458dd4: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458df0; +//nop; +L458df0: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458e0c; +//nop; +L458e0c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458e28; +//nop; +L458e28: +gp = MEM_U32(sp + 24); +a0 = 0x82; +t1 = 0x1000df68; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458e5c; +v0 = s0; +L458e5c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458e78; +//nop; +L458e78: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458e94; +//nop; +L458e94: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458eb0; +//nop; +L458eb0: +gp = MEM_U32(sp + 24); +a0 = 0x81; +t4 = 0x1000df64; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458ee4; +v0 = s0; +L458ee4: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458f00; +//nop; +L458f00: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458f1c; +//nop; +L458f1c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458f38; +//nop; +L458f38: +gp = MEM_U32(sp + 24); +a0 = 0x83; +t6 = 0x1000df60; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L458f6c; +v0 = s0; +L458f6c: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458f88; +//nop; +L458f88: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458fa4; +//nop; +L458fa4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L458fc0; +//nop; +L458fc0: +gp = MEM_U32(sp + 24); +a0 = 0x87; +t9 = 0x1000df5c; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L458ff8; +//nop; +L458ff8: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459014; +//nop; +L459014: +gp = MEM_U32(sp + 24); +a0 = 0x45; +t2 = 0x1000df58; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L459048; +v0 = s0; +L459048: +gp = MEM_U32(sp + 24); +a0 = 0xe; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459064; +//nop; +L459064: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459080; +//nop; +L459080: +gp = MEM_U32(sp + 24); +a0 = 0x44; +t5 = 0x1000df54; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4590b4; +v0 = s0; +L4590b4: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4590d0; +//nop; +L4590d0: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4590ec; +//nop; +L4590ec: +gp = MEM_U32(sp + 24); +a0 = 0x54; +t8 = 0x1000df50; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L459120; +v0 = s0; +L459120: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45913c; +//nop; +L45913c: +gp = MEM_U32(sp + 24); +a0 = 0x4c; +t1 = 0x1000df4c; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L459170; +v0 = s0; +L459170: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45918c; +//nop; +L45918c: +gp = MEM_U32(sp + 24); +a0 = 0x78; +t4 = 0x1000df48; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4591c0; +v0 = s0; +L4591c0: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4591dc; +//nop; +L4591dc: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4591f8; +//nop; +L4591f8: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459214; +//nop; +L459214: +gp = MEM_U32(sp + 24); +a0 = 0xb; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459230; +//nop; +L459230: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45924c; +//nop; +L45924c: +gp = MEM_U32(sp + 24); +a0 = 0x75; +t6 = 0x1000df44; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L459280; +v0 = s0; +L459280: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45929c; +//nop; +L45929c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4592b8; +//nop; +L4592b8: +gp = MEM_U32(sp + 24); +a0 = 0x91; +t9 = 0x1000df40; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L4592f0; +//nop; +L4592f0: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45930c; +//nop; +L45930c: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459328; +//nop; +L459328: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459344; +//nop; +L459344: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459360; +//nop; +L459360: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45937c; +//nop; +L45937c: +gp = MEM_U32(sp + 24); +a0 = 0x92; +t2 = 0x1000df3c; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4593b0; +v0 = s0; +L4593b0: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4593cc; +//nop; +L4593cc: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4593e8; +//nop; +L4593e8: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459404; +//nop; +L459404: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459420; +//nop; +L459420: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45943c; +//nop; +L45943c: +gp = MEM_U32(sp + 24); +a0 = 0x93; +t5 = 0x1000df38; +//nop; +t5 = t5; +at = t5 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t5) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L459470; +v0 = s0; +L459470: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45948c; +//nop; +L45948c: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4594a8; +//nop; +L4594a8: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4594c4; +//nop; +L4594c4: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4594e0; +//nop; +L4594e0: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4594fc; +//nop; +L4594fc: +gp = MEM_U32(sp + 24); +a0 = 0x94; +t8 = 0x1000df34; +//nop; +t8 = t8; +at = t8 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t8) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L459530; +v0 = s0; +L459530: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45954c; +//nop; +L45954c: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459568; +//nop; +L459568: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459584; +//nop; +L459584: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4595a0; +//nop; +L4595a0: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4595bc; +//nop; +L4595bc: +gp = MEM_U32(sp + 24); +a0 = 0x95; +t1 = 0x1000df30; +//nop; +t1 = t1; +at = t1 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t1) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4595f0; +v0 = s0; +L4595f0: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45960c; +//nop; +L45960c: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459628; +//nop; +L459628: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459644; +//nop; +L459644: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459660; +//nop; +L459660: +gp = MEM_U32(sp + 24); +a0 = 0x97; +t4 = 0x1000df2c; +//nop; +t4 = t4; +at = t4 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t4) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L459694; +v0 = s0; +L459694: +gp = MEM_U32(sp + 24); +a0 = zero; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4596b0; +//nop; +L4596b0: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4596cc; +//nop; +L4596cc: +gp = MEM_U32(sp + 24); +a0 = 0x7; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4596e8; +//nop; +L4596e8: +gp = MEM_U32(sp + 24); +a0 = 0x8; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459704; +//nop; +L459704: +gp = MEM_U32(sp + 24); +a0 = 0x9; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459720; +//nop; +L459720: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45973c; +//nop; +L45973c: +gp = MEM_U32(sp + 24); +a0 = 0x96; +t6 = 0x1000df28; +//nop; +t6 = t6; +at = t6 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t6) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L459770; +v0 = s0; +L459770: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45978c; +//nop; +L45978c: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4597a8; +//nop; +L4597a8: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4597c4; +//nop; +L4597c4: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4597e0; +//nop; +L4597e0: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4597fc; +//nop; +L4597fc: +gp = MEM_U32(sp + 24); +a0 = 0x98; +t9 = 0x1000df24; +v0 = s0; +t9 = t9; +at = t9 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t9) +//nop; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +t9 = t9; +//nop; +func_454190(mem, sp, v0, a0, a1); +goto L459834; +//nop; +L459834: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459850; +//nop; +L459850: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45986c; +//nop; +L45986c: +gp = MEM_U32(sp + 24); +a0 = 0x2; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459888; +//nop; +L459888: +gp = MEM_U32(sp + 24); +a0 = 0xa; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4598a4; +//nop; +L4598a4: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L4598c0; +//nop; +L4598c0: +gp = MEM_U32(sp + 24); +a0 = 0x99; +t2 = 0x1000df20; +//nop; +t2 = t2; +at = t2 + 0; at = (MEM_U8(at) << 24) | (MEM_U8(at + 1) << 16) | (MEM_U8(at + 2) << 8) | MEM_U8(at + 3); +//lwr $at, 3($t2) +t9 = t9; +MEM_U8(sp + 4 + 0) = (uint8_t)(at >> 24); +MEM_U8(sp + 4 + 1) = (uint8_t)(at >> 16); +MEM_U8(sp + 4 + 2) = (uint8_t)(at >> 8); +MEM_U8(sp + 4 + 3) = (uint8_t)(at >> 0); +//swr $at, 7($sp) +a1 = MEM_U32(sp + 4); +v0 = s0; +func_454190(mem, sp, v0, a0, a1); +goto L4598f4; +v0 = s0; +L4598f4: +gp = MEM_U32(sp + 24); +a0 = 0x5; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459910; +//nop; +L459910: +gp = MEM_U32(sp + 24); +a0 = 0xd; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L45992c; +//nop; +L45992c: +gp = MEM_U32(sp + 24); +a0 = 0x16; +//nop; +v0 = s0; +t9 = t9; +//nop; +func_4541e0(mem, sp, v0, a0); +goto L459948; +//nop; +L459948: +gp = MEM_U32(sp + 24); +a1 = 0x2; +v0 = 0x1001a6c0; +//nop; +v1 = v0 + 0xb94; +L45995c: +v0 = v0 + 0x4c; +MEM_U8(v0 + -62) = (uint8_t)zero; +MEM_U8(v0 + -61) = (uint8_t)zero; +MEM_U8(v0 + -60) = (uint8_t)a1; +MEM_U8(v0 + -59) = (uint8_t)zero; +MEM_U8(v0 + -58) = (uint8_t)zero; +MEM_U8(v0 + -43) = (uint8_t)zero; +MEM_U8(v0 + -42) = (uint8_t)zero; +MEM_U8(v0 + -41) = (uint8_t)a1; +MEM_U8(v0 + -40) = (uint8_t)zero; +MEM_U8(v0 + -39) = (uint8_t)zero; +MEM_U8(v0 + -24) = (uint8_t)zero; +MEM_U8(v0 + -23) = (uint8_t)zero; +MEM_U8(v0 + -22) = (uint8_t)a1; +MEM_U8(v0 + -21) = (uint8_t)zero; +MEM_U8(v0 + -20) = (uint8_t)zero; +MEM_U8(v0 + -5) = (uint8_t)zero; +MEM_U8(v0 + -4) = (uint8_t)zero; +MEM_U8(v0 + -3) = (uint8_t)a1; +MEM_U8(v0 + -2) = (uint8_t)zero; +if (v0 != v1) {MEM_U8(v0 + -1) = (uint8_t)zero; +goto L45995c;} +MEM_U8(v0 + -1) = (uint8_t)zero; +v0 = 0x1001a6c0; +v1 = 0x1; +a0 = 0x4; +a2 = 0x6; +a3 = 0x3; +t5 = 0x8; +MEM_U8(v0 + 1572) = (uint8_t)v1; +MEM_U8(v0 + 2351) = (uint8_t)v1; +MEM_U8(v0 + 1040) = (uint8_t)v1; +MEM_U8(v0 + 1211) = (uint8_t)v1; +MEM_U8(v0 + 2769) = (uint8_t)v1; +MEM_U8(v0 + 2788) = (uint8_t)v1; +MEM_U8(v0 + 2807) = (uint8_t)v1; +MEM_U8(v0 + 2826) = (uint8_t)v1; +MEM_U8(v0 + 1686) = (uint8_t)v1; +MEM_U8(v0 + 14) = (uint8_t)v1; +MEM_U8(v0 + 1800) = (uint8_t)v1; +MEM_U8(v0 + 2256) = (uint8_t)v1; +MEM_U8(v0 + 280) = (uint8_t)v1; +MEM_U8(v0 + 299) = (uint8_t)v1; +MEM_U8(v0 + 1534) = (uint8_t)v1; +MEM_U8(v0 + 1857) = (uint8_t)v1; +MEM_U8(v0 + 1876) = (uint8_t)v1; +MEM_U8(v0 + 2275) = (uint8_t)v1; +MEM_U8(v0 + 489) = (uint8_t)v1; +MEM_U8(v0 + 508) = (uint8_t)v1; +MEM_U8(v0 + 1059) = (uint8_t)v1; +MEM_U8(v0 + 242) = (uint8_t)v1; +MEM_U8(v0 + 261) = (uint8_t)v1; +MEM_U8(v0 + 2180) = (uint8_t)v1; +MEM_U8(v0 + 470) = (uint8_t)v1; +MEM_U8(v0 + 2104) = (uint8_t)v1; +MEM_U8(v0 + 52) = (uint8_t)v1; +MEM_U8(v0 + 33) = (uint8_t)v1; +MEM_U8(v0 + 565) = (uint8_t)v1; +MEM_U8(v0 + 1667) = (uint8_t)v1; +MEM_U8(v0 + 1743) = (uint8_t)v1; +MEM_U8(v0 + 2389) = (uint8_t)v1; +MEM_U8(v0 + 2009) = (uint8_t)v1; +MEM_U8(v0 + 90) = (uint8_t)v1; +MEM_U8(v0 + 679) = (uint8_t)v1; +MEM_U8(v0 + 774) = (uint8_t)v1; +MEM_U8(v0 + 793) = (uint8_t)v1; +MEM_U8(v0 + 1154) = (uint8_t)v1; +MEM_U8(v0 + 1477) = (uint8_t)v1; +MEM_U8(v0 + 1496) = (uint8_t)v1; +MEM_U8(v0 + 1629) = (uint8_t)v1; +MEM_U8(v0 + 1648) = (uint8_t)v1; +MEM_U8(v0 + 1819) = (uint8_t)v1; +MEM_U8(v0 + 2199) = (uint8_t)v1; +MEM_U8(v0 + 2218) = (uint8_t)v1; +MEM_U8(v0 + 2693) = (uint8_t)v1; +MEM_U8(v0 + 1249) = (uint8_t)v1; +MEM_U8(v0 + 1135) = (uint8_t)v1; +MEM_U8(v0 + 546) = (uint8_t)v1; +MEM_U8(v0 + 1781) = (uint8_t)v1; +MEM_U8(v0 + 2636) = (uint8_t)v1; +MEM_U8(v0 + 1116) = (uint8_t)v1; +MEM_U8(v0 + 888) = (uint8_t)v1; +MEM_U8(v0 + 926) = (uint8_t)v1; +MEM_U8(v0 + 907) = (uint8_t)v1; +MEM_U8(v0 + 1002) = (uint8_t)v1; +MEM_U8(v0 + 1021) = (uint8_t)v1; +MEM_U8(v0 + 1078) = (uint8_t)v1; +MEM_U8(v0 + 2237) = (uint8_t)v1; +MEM_U8(v0 + 1173) = (uint8_t)v1; +MEM_U8(v0 + 1192) = (uint8_t)v1; +MEM_U8(v0 + 319) = (uint8_t)v1; +MEM_U8(v0 + 376) = (uint8_t)v1; +MEM_U8(v0 + 1098) = (uint8_t)v1; +MEM_U8(v0 + 1345) = (uint8_t)v1; +MEM_U8(v0 + 1402) = (uint8_t)v1; +MEM_U8(v0 + 2067) = (uint8_t)v1; +MEM_U8(v0 + 2295) = (uint8_t)v1; +MEM_U8(v0 + 54) = (uint8_t)a0; +MEM_U8(v0 + 149) = (uint8_t)a0; +MEM_U8(v0 + 168) = (uint8_t)a1; +MEM_U8(v0 + 244) = (uint8_t)a1; +MEM_U8(v0 + 263) = (uint8_t)a1; +MEM_U8(v0 + 320) = (uint8_t)a0; +MEM_U8(v0 + 339) = (uint8_t)a0; +MEM_U8(v0 + 358) = (uint8_t)a1; +MEM_U8(v0 + 434) = (uint8_t)a1; +MEM_U8(v0 + 415) = (uint8_t)a0; +MEM_U8(v0 + 377) = (uint8_t)a0; +MEM_U8(v0 + 453) = (uint8_t)a0; +MEM_U8(v0 + 472) = (uint8_t)a0; +MEM_U8(v0 + 491) = (uint8_t)a1; +MEM_U8(v0 + 510) = (uint8_t)a1; +MEM_U8(v0 + 1061) = (uint8_t)a1; +MEM_U8(v0 + 529) = (uint8_t)a0; +MEM_U8(v0 + 548) = (uint8_t)a0; +MEM_U8(v0 + 1137) = (uint8_t)a0; +MEM_U8(v0 + 2638) = (uint8_t)a0; +MEM_U8(v0 + 605) = (uint8_t)a1; +MEM_U8(v0 + 624) = (uint8_t)a1; +MEM_U8(v0 + 643) = (uint8_t)a0; +MEM_U8(v0 + 73) = (uint8_t)a0; +MEM_U8(v0 + 890) = (uint8_t)a0; +MEM_U8(v0 + 909) = (uint8_t)a0; +MEM_U8(v0 + 928) = (uint8_t)a0; +MEM_U8(v0 + 1004) = (uint8_t)a0; +MEM_U8(v0 + 1023) = (uint8_t)a0; +MEM_U8(v0 + 1080) = (uint8_t)a0; +MEM_U8(v0 + 738) = (uint8_t)a1; +MEM_U8(v0 + 2429) = (uint8_t)a1; +MEM_U8(v0 + 2600) = (uint8_t)a1; +MEM_U8(v0 + 719) = (uint8_t)a0; +MEM_U8(v0 + 985) = (uint8_t)a0; +MEM_U8(v0 + 1042) = (uint8_t)a0; +MEM_U8(v0 + 1099) = (uint8_t)a2; +MEM_U8(v0 + 1118) = (uint8_t)a0; +MEM_U8(v0 + 1232) = (uint8_t)a0; +MEM_U8(v0 + 1213) = (uint8_t)a0; +MEM_U8(v0 + 1251) = (uint8_t)a1; +MEM_U8(v0 + 1270) = (uint8_t)a0; +MEM_U8(v0 + 1422) = (uint8_t)a0; +MEM_U8(v0 + 1346) = (uint8_t)a0; +MEM_U8(v0 + 966) = (uint8_t)a2; +MEM_U8(v0 + 1327) = (uint8_t)a1; +MEM_U8(v0 + 1365) = (uint8_t)a2; +MEM_U8(v0 + 1403) = (uint8_t)a0; +MEM_U8(v0 + 1517) = (uint8_t)a1; +MEM_U8(v0 + 1555) = (uint8_t)a1; +MEM_U8(v0 + 1574) = (uint8_t)a0; +MEM_U8(v0 + 1688) = (uint8_t)a0; +MEM_U8(v0 + 1783) = (uint8_t)a0; +MEM_U8(v0 + 1897) = (uint8_t)a0; +MEM_U8(v0 + 1916) = (uint8_t)a0; +MEM_U8(v0 + 1935) = (uint8_t)a0; +MEM_U8(v0 + 1992) = (uint8_t)a0; +MEM_U8(v0 + 2049) = (uint8_t)a0; +MEM_U8(v0 + 2068) = (uint8_t)a0; +MEM_U8(v0 + 2087) = (uint8_t)a0; +MEM_U8(v0 + 2106) = (uint8_t)a0; +MEM_U8(v0 + 2125) = (uint8_t)a0; +MEM_U8(v0 + 2144) = (uint8_t)a0; +MEM_U8(v0 + 2163) = (uint8_t)a0; +MEM_U8(v0 + 130) = (uint8_t)a0; +MEM_U8(v0 + 833) = (uint8_t)a0; +MEM_U8(v0 + 2182) = (uint8_t)a0; +MEM_U8(v0 + 2315) = (uint8_t)a1; +MEM_U8(v0 + 2334) = (uint8_t)a1; +MEM_U8(v0 + 2353) = (uint8_t)a0; +MEM_U8(v0 + 2410) = (uint8_t)a0; +MEM_U8(v0 + 2676) = (uint8_t)t5; +MEM_U8(v0 + 396) = (uint8_t)a0; +MEM_U8(v0 + 700) = (uint8_t)a0; +MEM_U8(v0 + 757) = (uint8_t)a0; +MEM_U8(v0 + 814) = (uint8_t)a0; +MEM_U8(v0 + 1593) = (uint8_t)a0; +MEM_U8(v0 + 852) = (uint8_t)a0; +MEM_U8(v0 + 1175) = (uint8_t)a0; +MEM_U8(v0 + 1194) = (uint8_t)a0; +MEM_U8(v0 + 1954) = (uint8_t)a0; +MEM_U8(v0 + 1726) = (uint8_t)a0; +MEM_U8(v0 + 2619) = (uint8_t)a1; +MEM_U8(v0 + 2657) = (uint8_t)a0; +MEM_U8(v0 + 2448) = (uint8_t)a1; +MEM_U8(v0 + 2543) = (uint8_t)a1; +MEM_U8(v0 + 2524) = (uint8_t)a1; +MEM_U8(v0 + 2486) = (uint8_t)a1; +MEM_U8(v0 + 2467) = (uint8_t)a1; +MEM_U8(v0 + 2505) = (uint8_t)a1; +MEM_U8(v0 + 2562) = (uint8_t)a0; +MEM_U8(v0 + 2296) = (uint8_t)a0; +MEM_U8(v0 + 2885) = (uint8_t)a0; +MEM_U8(v0 + 2847) = (uint8_t)a0; +MEM_U8(v0 + 2866) = (uint8_t)a0; +MEM_U8(v0 + 2904) = (uint8_t)a0; +MEM_U8(v0 + 2923) = (uint8_t)a0; +MEM_U8(v0 + 2771) = (uint8_t)a0; +MEM_U8(v0 + 2790) = (uint8_t)a0; +MEM_U8(v0 + 2809) = (uint8_t)a0; +MEM_U8(v0 + 2828) = (uint8_t)a0; +MEM_U8(v0 + 2354) = (uint8_t)v1; +MEM_U8(v0 + 283) = (uint8_t)v1; +MEM_U8(v0 + 302) = (uint8_t)v1; +MEM_U8(v0 + 17) = (uint8_t)v1; +MEM_U8(v0 + 188) = (uint8_t)a1; +MEM_U8(v0 + 1803) = (uint8_t)v1; +MEM_U8(v0 + 2259) = (uint8_t)v1; +MEM_U8(v0 + 1537) = (uint8_t)v1; +MEM_U8(v0 + 1860) = (uint8_t)v1; +MEM_U8(v0 + 1879) = (uint8_t)v1; +MEM_U8(v0 + 2278) = (uint8_t)v1; +MEM_U8(v0 + 492) = (uint8_t)v1; +MEM_U8(v0 + 511) = (uint8_t)v1; +MEM_U8(v0 + 1062) = (uint8_t)v1; +MEM_U8(v0 + 245) = (uint8_t)v1; +MEM_U8(v0 + 264) = (uint8_t)v1; +MEM_U8(v0 + 2183) = (uint8_t)v1; +MEM_U8(v0 + 473) = (uint8_t)v1; +MEM_U8(v0 + 2563) = (uint8_t)v1; +MEM_U8(v0 + 2107) = (uint8_t)v1; +MEM_U8(v0 + 55) = (uint8_t)v1; +MEM_U8(v0 + 967) = (uint8_t)v1; +MEM_U8(v0 + 1290) = (uint8_t)v1; +MEM_U8(v0 + 2582) = (uint8_t)v1; +MEM_U8(v0 + 36) = (uint8_t)a1; +MEM_U8(v0 + 568) = (uint8_t)a1; +MEM_U8(v0 + 1670) = (uint8_t)a1; +MEM_U8(v0 + 1746) = (uint8_t)a1; +MEM_U8(v0 + 2392) = (uint8_t)a1; +MEM_U8(v0 + 2012) = (uint8_t)a1; +MEM_U8(v0 + 93) = (uint8_t)a1; +MEM_U8(v0 + 682) = (uint8_t)a1; +MEM_U8(v0 + 777) = (uint8_t)a1; +MEM_U8(v0 + 796) = (uint8_t)a1; +MEM_U8(v0 + 1157) = (uint8_t)a1; +MEM_U8(v0 + 1480) = (uint8_t)a1; +MEM_U8(v0 + 1499) = (uint8_t)a1; +MEM_U8(v0 + 1632) = (uint8_t)a1; +MEM_U8(v0 + 1651) = (uint8_t)a1; +MEM_U8(v0 + 1822) = (uint8_t)a1; +MEM_U8(v0 + 2202) = (uint8_t)a1; +MEM_U8(v0 + 2221) = (uint8_t)a1; +MEM_U8(v0 + 2696) = (uint8_t)a1; +MEM_U8(v0 + 1252) = (uint8_t)a1; +MEM_U8(v0 + 872) = (uint8_t)a3; +MEM_U8(v0 + 1138) = (uint8_t)a1; +MEM_U8(v0 + 549) = (uint8_t)a1; +MEM_U8(v0 + 1784) = (uint8_t)a1; +MEM_U8(v0 + 2639) = (uint8_t)a1; +MEM_U8(v0 + 1119) = (uint8_t)a1; +MEM_U8(v0 + 1043) = (uint8_t)v1; +MEM_U8(v0 + 1214) = (uint8_t)a1; +MEM_U8(v0 + 2772) = (uint8_t)a1; +MEM_U8(v0 + 2791) = (uint8_t)a3; +MEM_U8(v0 + 2810) = (uint8_t)v1; +MEM_U8(v0 + 2829) = (uint8_t)a1; +MEM_U8(v0 + 1176) = (uint8_t)v1; +MEM_U8(v0 + 1195) = (uint8_t)a1; +MEM_U8(v0 + 1689) = (uint8_t)a1; +MEM_U8(v0 + 720) = (uint8_t)a1; +MEM_U8(v0 + 891) = (uint8_t)a1; +MEM_U8(v0 + 910) = (uint8_t)a1; +MEM_U8(v0 + 929) = (uint8_t)a1; +MEM_U8(v0 + 1005) = (uint8_t)a1; +MEM_U8(v0 + 1024) = (uint8_t)a1; +MEM_U8(v0 + 1081) = (uint8_t)a1; +MEM_U8(v0 + 739) = (uint8_t)v1; +MEM_U8(v0 + 2430) = (uint8_t)v1; +MEM_U8(v0 + 948) = (uint8_t)v1; +MEM_U8(v0 + 2677) = (uint8_t)v1; +MEM_U8(v0 + 853) = (uint8_t)v1; +MEM_U8(v0 + 1917) = (uint8_t)v1; +MEM_U8(v0 + 2715) = (uint8_t)v1; +MEM_U8(v0 + 1955) = (uint8_t)v1; +MEM_U8(v0 + 1727) = (uint8_t)v1; +MEM_U8(v0 + 2449) = (uint8_t)a1; +MEM_U8(v0 + 2468) = (uint8_t)a1; +MEM_U8(v0 + 2487) = (uint8_t)a1; +MEM_U8(v0 + 2506) = (uint8_t)a1; +MEM_U8(v0 + 2525) = (uint8_t)a1; +MEM_U8(v0 + 2544) = (uint8_t)a1; +MEM_U8(v0 + 1974) = (uint8_t)v1; +MEM_U8(v0 + 2411) = (uint8_t)v1; +MEM_U8(v0 + 112) = (uint8_t)v1; +MEM_U8(v0 + 2373) = (uint8_t)v1; +MEM_U8(v0 + 2240) = (uint8_t)a1; +MEM_U8(v0 + 1576) = (uint8_t)v1; +MEM_U8(v0 + 1405) = (uint8_t)v1; +MEM_U8(v0 + 2849) = (uint8_t)v1; +MEM_U8(v0 + 1348) = (uint8_t)v1; +MEM_U8(v0 + 1367) = (uint8_t)v1; +MEM_U8(v0 + 284) = (uint8_t)v1; +MEM_U8(v0 + 18) = (uint8_t)v1; +MEM_U8(v0 + 189) = (uint8_t)v1; +MEM_U8(v0 + 1804) = (uint8_t)v1; +MEM_U8(v0 + 2260) = (uint8_t)v1; +MEM_U8(v0 + 1538) = (uint8_t)v1; +MEM_U8(v0 + 1861) = (uint8_t)v1; +MEM_U8(v0 + 1880) = (uint8_t)v1; +MEM_U8(v0 + 2279) = (uint8_t)v1; +MEM_U8(v0 + 493) = (uint8_t)v1; +MEM_U8(v0 + 512) = (uint8_t)v1; +MEM_U8(v0 + 1063) = (uint8_t)v1; +MEM_U8(v0 + 246) = (uint8_t)v1; +MEM_U8(v0 + 265) = (uint8_t)v1; +MEM_U8(v0 + 2184) = (uint8_t)v1; +ra = MEM_U32(sp + 28); +s0 = MEM_U32(sp + 20); +MEM_U8(v0 + 474) = (uint8_t)v1; +MEM_U8(v0 + 2564) = (uint8_t)v1; +MEM_U8(v0 + 2108) = (uint8_t)v1; +MEM_U8(v0 + 56) = (uint8_t)v1; +MEM_U8(v0 + 968) = (uint8_t)v1; +MEM_U8(v0 + 1291) = (uint8_t)v1; +MEM_U8(v0 + 2583) = (uint8_t)v1; +MEM_U8(v0 + 37) = (uint8_t)v1; +MEM_U8(v0 + 569) = (uint8_t)v1; +MEM_U8(v0 + 1671) = (uint8_t)v1; +MEM_U8(v0 + 1747) = (uint8_t)v1; +MEM_U8(v0 + 2393) = (uint8_t)v1; +MEM_U8(v0 + 2013) = (uint8_t)v1; +MEM_U8(v0 + 94) = (uint8_t)v1; +MEM_U8(v0 + 683) = (uint8_t)v1; +MEM_U8(v0 + 778) = (uint8_t)v1; +MEM_U8(v0 + 797) = (uint8_t)v1; +MEM_U8(v0 + 1158) = (uint8_t)v1; +MEM_U8(v0 + 1481) = (uint8_t)v1; +MEM_U8(v0 + 1500) = (uint8_t)v1; +MEM_U8(v0 + 1633) = (uint8_t)v1; +MEM_U8(v0 + 1652) = (uint8_t)v1; +MEM_U8(v0 + 1823) = (uint8_t)v1; +MEM_U8(v0 + 2203) = (uint8_t)v1; +MEM_U8(v0 + 2222) = (uint8_t)v1; +MEM_U8(v0 + 2697) = (uint8_t)v1; +MEM_U8(v0 + 1253) = (uint8_t)v1; +MEM_U8(v0 + 873) = (uint8_t)v1; +MEM_U8(v0 + 1139) = (uint8_t)v1; +MEM_U8(v0 + 550) = (uint8_t)v1; +MEM_U8(v0 + 1785) = (uint8_t)v1; +MEM_U8(v0 + 2640) = (uint8_t)v1; +MEM_U8(v0 + 1120) = (uint8_t)v1; +MEM_U8(v0 + 1044) = (uint8_t)v1; +MEM_U8(v0 + 2773) = (uint8_t)v1; +MEM_U8(v0 + 2811) = (uint8_t)v1; +MEM_U8(v0 + 1177) = (uint8_t)v1; +MEM_U8(v0 + 892) = (uint8_t)v1; +MEM_U8(v0 + 911) = (uint8_t)v1; +MEM_U8(v0 + 930) = (uint8_t)v1; +MEM_U8(v0 + 1006) = (uint8_t)v1; +MEM_U8(v0 + 1025) = (uint8_t)v1; +MEM_U8(v0 + 1082) = (uint8_t)v1; +MEM_U8(v0 + 588) = (uint8_t)v1; +MEM_U8(v0 + 2412) = (uint8_t)v1; +MEM_U8(v0 + 1443) = (uint8_t)v1; +MEM_U8(v0 + 1386) = (uint8_t)v1; +MEM_U8(v0 + 2241) = (uint8_t)v1; +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void f_uputinit(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L459f90: +//uputinit: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +a3 = 0x10018858; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +v0 = MEM_U8(a0 + 0); +a3 = a3; +if (v0 == 0) {v1 = a3; +goto L45a000;} +v1 = a3; +a1 = 0x20; +if (a1 == v0) {//nop; +goto L45a000;} +//nop; +a2 = 0x10018c58; +//nop; +a2 = a2; +L459fd4: +v1 = v1 + 0x1; +at = v1 < a2; +a0 = a0 + 0x1; +if (at == 0) {MEM_U8(v1 + -1) = (uint8_t)v0; +goto L45a000;} +MEM_U8(v1 + -1) = (uint8_t)v0; +v0 = MEM_U8(a0 + 0); +//nop; +if (v0 == 0) {//nop; +goto L45a000;} +//nop; +if (a1 != v0) {//nop; +goto L459fd4;} +//nop; +L45a000: +MEM_U8(v1 + 0) = (uint8_t)zero; +t6 = MEM_U8(a3 + 0); +a0 = a3; +if (t6 == 0) {ra = MEM_U32(sp + 28); +goto L45a078;} +ra = MEM_U32(sp + 28); +//nop; +a1 = 0x301; +a2 = 0x1b6; +v0 = wrapper_open(mem, a0, a1, a2); +goto L45a024; +a2 = 0x1b6; +L45a024: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x1000627c; +a3 = 0x10018858; +v1 = v1; +MEM_U32(v1 + 0) = v0; +if ((int)v0 >= 0) {a3 = a3; +goto L45a074;} +a3 = a3; +//nop; +a0 = a3; +//nop; +wrapper_perror(mem, a0); +goto L45a054; +//nop; +L45a054: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L45a06c; +//nop; +L45a06c: +gp = MEM_U32(sp + 24); +//nop; +L45a074: +ra = MEM_U32(sp + 28); +L45a078: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void f_uputint(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L45a09c: +//uputint: +//nop; +//nop; +//nop; +t6 = 0x1000627c; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if ((int)t6 >= 0) {MEM_U32(sp + 32) = a0; +goto L45a118;} +MEM_U32(sp + 32) = a0; +a0 = 0xfb528e4; +a1 = 0x1000e180; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L45a0dc; +a1 = a1; +L45a0dc: +gp = MEM_U32(sp + 24); +//nop; +a0 = 0xfb528e4; +//nop; +a0 = a0 + 0x20; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L45a0f8; +//nop; +L45a0f8: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L45a110; +//nop; +L45a110: +gp = MEM_U32(sp + 24); +//nop; +L45a118: +v0 = 0x10018448; +a2 = 0x4000; +v0 = MEM_U32(v0 + 0); +//nop; +at = (int)v0 < (int)0x1000; +if (at != 0) {//nop; +goto L45a19c;} +//nop; +a0 = 0x1000627c; +a1 = 0x10014448; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_write(mem, a0, a1, a2); +goto L45a14c; +a1 = a1; +L45a14c: +gp = MEM_U32(sp + 24); +at = 0x4000; +if (v0 == at) {//nop; +goto L45a190;} +//nop; +a0 = 0x1000e1a4; +//nop; +a0 = a0; +//nop; +wrapper_perror(mem, a0); +goto L45a170; +//nop; +L45a170: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L45a188; +//nop; +L45a188: +gp = MEM_U32(sp + 24); +//nop; +L45a190: +at = 0x10018448; +v0 = zero; +MEM_U32(at + 0) = zero; +L45a19c: +t9 = 0x10014448; +t7 = MEM_U32(sp + 32); +t8 = v0 << 2; +t9 = t9; +t0 = t8 + t9; +MEM_U32(t0 + 0) = t7; +at = 0x10018448; +ra = MEM_U32(sp + 28); +t1 = v0 + 0x1; +sp = sp + 0x20; +MEM_U32(at + 0) = t1; +return; +MEM_U32(at + 0) = t1; +} + +static void f_ugetinit(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L45a430: +//ugetinit: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +a3 = 0x10018450; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +v0 = MEM_U8(a0 + 0); +a3 = a3; +if (v0 == 0) {v1 = a3; +goto L45a4a0;} +v1 = a3; +a1 = 0x20; +if (a1 == v0) {//nop; +goto L45a4a0;} +//nop; +a2 = 0x10018850; +//nop; +a2 = a2; +L45a474: +v1 = v1 + 0x1; +at = v1 < a2; +a0 = a0 + 0x1; +if (at == 0) {MEM_U8(v1 + -1) = (uint8_t)v0; +goto L45a4a0;} +MEM_U8(v1 + -1) = (uint8_t)v0; +v0 = MEM_U8(a0 + 0); +//nop; +if (v0 == 0) {//nop; +goto L45a4a0;} +//nop; +if (a1 != v0) {//nop; +goto L45a474;} +//nop; +L45a4a0: +MEM_U8(v1 + 0) = (uint8_t)zero; +t6 = MEM_U8(a3 + 0); +a0 = a3; +if (t6 == 0) {ra = MEM_U32(sp + 28); +goto L45a518;} +ra = MEM_U32(sp + 28); +//nop; +a1 = zero; +a2 = zero; +v0 = wrapper_open(mem, a0, a1, a2); +goto L45a4c4; +a2 = zero; +L45a4c4: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x10006278; +a3 = 0x10018450; +v1 = v1; +MEM_U32(v1 + 0) = v0; +if ((int)v0 >= 0) {a3 = a3; +goto L45a514;} +a3 = a3; +//nop; +a0 = a3; +//nop; +wrapper_perror(mem, a0); +goto L45a4f4; +//nop; +L45a4f4: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L45a50c; +//nop; +L45a50c: +gp = MEM_U32(sp + 24); +//nop; +L45a514: +ra = MEM_U32(sp + 28); +L45a518: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t f_ugetint(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L45a588: +//ugetint: +//nop; +//nop; +//nop; +t6 = 0x10006278; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +if ((int)t6 >= 0) {MEM_U32(sp + 24) = gp; +goto L45a600;} +MEM_U32(sp + 24) = gp; +a0 = 0xfb528e4; +a1 = 0x1000e248; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L45a5c4; +a1 = a1; +L45a5c4: +gp = MEM_U32(sp + 24); +//nop; +a0 = 0xfb528e4; +//nop; +a0 = a0 + 0x20; +//nop; +v0 = wrapper_fflush(mem, a0); +goto L45a5e0; +//nop; +L45a5e0: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L45a5f8; +//nop; +L45a5f8: +gp = MEM_U32(sp + 24); +//nop; +L45a600: +a0 = 0x10014440; +v1 = 0x10006274; +a0 = MEM_U32(a0 + 0); +v1 = MEM_U32(v1 + 0); +//nop; +at = (int)a0 < (int)v1; +if (at != 0) {//nop; +goto L45a790;} +//nop; +a0 = 0x10006278; +at = 0xffff; +a0 = MEM_U32(a0 + 0); +//nop; +if (a0 != at) {//nop; +goto L45a698;} +//nop; +if ((int)v1 <= 0) {//nop; +goto L45a64c;} +//nop; +at = 0x10006274; +MEM_U32(at + 0) = zero; +goto L45a684; +MEM_U32(at + 0) = zero; +L45a64c: +a0 = 0xfb528e4; +a1 = 0x1000e26c; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L45a664; +a1 = a1; +L45a664: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L45a67c; +//nop; +L45a67c: +gp = MEM_U32(sp + 24); +//nop; +L45a684: +v1 = 0x10006274; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +goto L45a768; +//nop; +L45a698: +a1 = 0x10006270; +//nop; +a1 = MEM_U32(a1 + 0); +a2 = 0x4000; +v0 = wrapper_read(mem, a0, a1, a2); +goto L45a6ac; +a2 = 0x4000; +L45a6ac: +gp = MEM_U32(sp + 24); +//nop; +at = 0x10006274; +v1 = 0x10006274; +MEM_U32(at + 0) = v0; +v1 = MEM_U32(v1 + 0); +//nop; +if ((int)v1 >= 0) {t7 = v1 & 0x3; +goto L45a718;} +t7 = v1 & 0x3; +a0 = 0x1000e28c; +//nop; +a0 = a0; +//nop; +wrapper_perror(mem, a0); +goto L45a6e4; +//nop; +L45a6e4: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L45a6fc; +//nop; +L45a6fc: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x10006274; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +t7 = v1 & 0x3; +L45a718: +if (t7 == 0) {//nop; +goto L45a768;} +//nop; +a0 = 0xfb528e4; +a1 = 0x1000e29c; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L45a738; +a1 = a1; +L45a738: +gp = MEM_U32(sp + 24); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L45a750; +//nop; +L45a750: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x10006274; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +L45a768: +if ((int)v1 >= 0) {t8 = (int)v1 >> 2; +goto L45a778;} +t8 = (int)v1 >> 2; +at = v1 + 0x3; +t8 = (int)at >> 2; +L45a778: +at = 0x10006274; +a0 = zero; +MEM_U32(at + 0) = t8; +at = 0x10014440; +//nop; +MEM_U32(at + 0) = zero; +L45a790: +t9 = 0x10006270; +t0 = a0 << 2; +t9 = MEM_U32(t9 + 0); +at = 0x10014440; +t1 = t9 + t0; +ra = MEM_U32(sp + 28); +v0 = MEM_U32(t1 + 0); +t2 = a0 + 0x1; +sp = sp + 0x20; +MEM_U32(at + 0) = t2; +return v0; +MEM_U32(at + 0) = t2; +} + +static uint32_t f_ugeteof(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L45a7bc: +//ugeteof: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +v0 = f_ugetint(mem, sp, a0, a1, a2, a3); +goto L45a7dc; +MEM_U32(sp + 24) = gp; +L45a7dc: +gp = MEM_U32(sp + 24); +//nop; +t6 = 0x10006274; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 != 0) {//nop; +goto L45a804;} +//nop; +v0 = 0x1; +goto L45a820; +v0 = 0x1; +L45a804: +v1 = 0x10014440; +v0 = zero; +v1 = v1; +t7 = MEM_U32(v1 + 0); +//nop; +t8 = t7 + 0xffffffff; +MEM_U32(v1 + 0) = t8; +L45a820: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return v0; +//nop; +} + +static uint32_t f_st_str_idn(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L45baf0: +//st_str_idn: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +v0 = f_st_pdn_idn(mem, sp, a0, a1, a2, a3); +goto L45bb10; +MEM_U32(sp + 24) = gp; +L45bb10: +at = MEM_U32(v0 + 0); +gp = MEM_U32(sp + 24); +t6 = sp + 0x28; +MEM_U32(t6 + 0) = at; +t9 = MEM_U32(v0 + 4); +at = 0xf0000; +MEM_U32(t6 + 4) = t9; +t0 = MEM_U32(sp + 44); +at = at | 0xffff; +if (t0 != at) {//nop; +goto L45bb44;} +//nop; +v0 = 0xffffffff; +goto L45bb78; +v0 = 0xffffffff; +L45bb44: +//nop; +a0 = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 44); +//nop; +v0 = f_st_psym_ifd_isym(mem, sp, a0, a1); +goto L45bb58; +//nop; +L45bb58: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 40); +//nop; +a1 = MEM_U32(v0 + 0); +//nop; +v0 = f_st_str_ifd_iss(mem, sp, a0, a1); +goto L45bb70; +//nop; +L45bb70: +gp = MEM_U32(sp + 24); +//nop; +L45bb78: +ra = MEM_U32(sp + 28); +sp = sp + 0x30; +//nop; +return v0; +//nop; +} + +static uint32_t f_st_fglobal_idn(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L45bb88: +//st_fglobal_idn: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +v0 = f_st_pdn_idn(mem, sp, a0, a1, a2, a3); +goto L45bba8; +MEM_U32(sp + 24) = gp; +L45bba8: +at = MEM_U32(v0 + 0); +gp = MEM_U32(sp + 24); +t6 = sp + 0x28; +MEM_U32(t6 + 0) = at; +t9 = MEM_U32(v0 + 4); +at = 0xf0000; +MEM_U32(t6 + 4) = t9; +t0 = MEM_U32(sp + 44); +at = at | 0xffff; +if (t0 != at) {//nop; +goto L45bbdc;} +//nop; +v0 = zero; +goto L45bc24; +v0 = zero; +L45bbdc: +//nop; +a0 = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 44); +//nop; +v0 = f_st_psym_ifd_isym(mem, sp, a0, a1); +goto L45bbf0; +//nop; +L45bbf0: +v1 = v0; +v0 = MEM_U32(v0 + 8); +gp = MEM_U32(sp + 24); +t1 = v0 >> 26; +t2 = t1 ^ 0x2; +v0 = zero < t2; +if (v0 == 0) {ra = MEM_U32(sp + 28); +goto L45bc28;} +ra = MEM_U32(sp + 28); +v0 = MEM_U32(v1 + 8); +//nop; +t3 = v0 >> 26; +t4 = t3 ^ 0xe; +v0 = zero < t4; +L45bc24: +ra = MEM_U32(sp + 28); +L45bc28: +sp = sp + 0x30; +//nop; +return v0; +//nop; +} + +static uint32_t f_st_readbinary(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L45c2d0: +//st_readbinary: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 52) = a1; +MEM_U32(sp + 32) = gp; +a1 = zero; +a2 = zero; +v0 = wrapper_open(mem, a0, a1, a2); +goto L45c2fc; +a2 = zero; +L45c2fc: +gp = MEM_U32(sp + 32); +if ((int)v0 >= 0) {a0 = v0; +goto L45c310;} +a0 = v0; +v0 = 0xfffffffe; +goto L45c354; +v0 = 0xfffffffe; +L45c310: +//nop; +a1 = MEM_S8(sp + 55); +t6 = 0xffffffff; +MEM_U32(sp + 16) = t6; +a2 = zero; +a3 = zero; +MEM_U32(sp + 44) = a0; +v0 = f_st_readst(mem, sp, a0, a1, a2, a3); +goto L45c330; +MEM_U32(sp + 44) = a0; +L45c330: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 44); +//nop; +MEM_U32(sp + 40) = v0; +//nop; +v0 = wrapper_close(mem, a0); +goto L45c348; +//nop; +L45c348: +gp = MEM_U32(sp + 32); +v0 = MEM_U32(sp + 40); +//nop; +L45c354: +ra = MEM_U32(sp + 36); +sp = sp + 0x30; +//nop; +return v0; +//nop; +} + +static uint32_t f_st_readst(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L45c364: +//st_readst: +//nop; +//nop; +//nop; +sp = sp + 0xfffffee0; +t6 = a1 << 24; +t7 = (int)t6 >> 24; +MEM_U32(sp + 32) = s0; +at = 0x72; +s0 = a3; +MEM_U32(sp + 52) = ra; +MEM_U32(sp + 48) = gp; +MEM_U32(sp + 44) = s3; +MEM_U32(sp + 40) = s2; +MEM_U32(sp + 36) = s1; +MEM_U32(sp + 288) = a0; +MEM_U32(sp + 292) = a1; +MEM_U32(sp + 296) = a2; +if (t7 != at) {MEM_U32(sp + 156) = zero; +goto L45c3b8;} +MEM_U32(sp + 156) = zero; +v0 = zero; +goto L45c3bc; +v0 = zero; +L45c3b8: +v0 = 0x1; +L45c3bc: +if (v0 == 0) {t8 = 0xffffffff; +goto L45c3c8;} +t8 = 0xffffffff; +MEM_U32(sp + 304) = t8; +L45c3c8: +if (s0 != 0) {//nop; +goto L45c3f4;} +//nop; +//nop; +a0 = 0xbc; +a1 = 0x1; +v0 = wrapper_calloc(mem, a0, a1); +goto L45c3e0; +a1 = 0x1; +L45c3e0: +gp = MEM_U32(sp + 48); +//nop; +s3 = 0x1001b288; +MEM_U32(s3 + 0) = v0; +goto L45c400; +MEM_U32(s3 + 0) = v0; +L45c3f4: +s3 = 0x1001b288; +//nop; +MEM_U32(s3 + 0) = s0; +L45c400: +v0 = MEM_U32(s3 + 0); +t7 = MEM_U32(sp + 304); +t9 = MEM_U32(v0 + 84); +a0 = MEM_U32(sp + 288); +t6 = ~t9; +t8 = t6 & t7; +if (s0 == 0) {MEM_U32(sp + 304) = t8; +goto L45c42c;} +MEM_U32(sp + 304) = t8; +t9 = t8 & 0x8; +if (t9 == 0) {t6 = sp + 0xc0; +goto L45c5a0;} +t6 = sp + 0xc0; +L45c42c: +//nop; +a1 = zero; +a2 = 0x1; +v0 = wrapper_lseek(mem, a0, a1, a2); +goto L45c43c; +a2 = 0x1; +L45c43c: +gp = MEM_U32(sp + 48); +t7 = MEM_U32(sp + 304); +t6 = MEM_U32(sp + 296); +//nop; +s0 = sp + 0xc0; +a0 = MEM_U32(sp + 288); +t8 = t7 | 0x208; +MEM_U32(sp + 304) = t8; +a1 = s0; +a2 = 0x60; +s1 = v0 - t6; +v0 = wrapper_read(mem, a0, a1, a2); +goto L45c46c; +s1 = v0 - t6; +L45c46c: +gp = MEM_U32(sp + 48); +at = 0x60; +if (v0 == at) {a2 = MEM_S16(sp + 192); +goto L45c488;} +a2 = MEM_S16(sp + 192); +v0 = 0xfffffffd; +goto L45d460; +v0 = 0xfffffffd; +a2 = MEM_S16(sp + 192); +L45c488: +at = 0x7009; +if (a2 == at) {at = 0x7109; +goto L45c504;} +at = 0x7109; +if (a2 == at) {at = 0x970; +goto L45c504;} +at = 0x970; +if (a2 == at) {at = 0x971; +goto L45c4ac;} +at = 0x971; +if (a2 != at) {//nop; +goto L45c4e8;} +//nop; +L45c4ac: +//nop; +//nop; +//nop; +v0 = f_gethostsex(mem, sp); +goto L45c4bc; +//nop; +L45c4bc: +gp = MEM_U32(sp + 48); +a0 = s0; +//nop; +a1 = v0; +//nop; +f_swap_hdr(mem, sp, a0, a1); +goto L45c4d4; +//nop; +L45c4d4: +t6 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 48); +t9 = 0x1; +MEM_U32(t6 + 88) = t9; +goto L45c504; +MEM_U32(t6 + 88) = t9; +L45c4e8: +a0 = 0x1000e380; +//nop; +a1 = 0x7009; +a0 = a0; +f_st_error(mem, sp, a0, a1, a2); +goto L45c4fc; +a0 = a0; +L45c4fc: +gp = MEM_U32(sp + 48); +//nop; +L45c504: +t7 = MEM_S16(sp + 194); +t8 = MEM_U32(sp + 208); +at = (int)t7 < (int)0x11e; +if (at == 0) {t9 = MEM_U32(sp + 304); +goto L45c540;} +t9 = MEM_U32(sp + 304); +if (t8 == 0) {t9 = MEM_U32(sp + 304); +goto L45c540;} +t9 = MEM_U32(sp + 304); +a0 = 0x1000e3ac; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45c534; +//nop; +L45c534: +gp = MEM_U32(sp + 48); +//nop; +t9 = MEM_U32(sp + 304); +L45c540: +t5 = 0xffffffff; +if (t9 != t5) {s2 = zero; +goto L45c568;} +s2 = zero; +//nop; +a0 = s0; +a1 = s1; +v0 = f_ldfsymorder(mem, sp, a0, a1); +goto L45c55c; +a1 = s1; +L45c55c: +gp = MEM_U32(sp + 48); +s2 = v0; +goto L45c568; +s2 = v0; +L45c568: +t6 = MEM_U32(s3 + 0); +t9 = s0; +t8 = s0 + 0x60; +L45c574: +at = MEM_U32(t9 + 0); +t9 = t9 + 0xc; +MEM_U32(t6 + 92) = at; +at = MEM_U32(t9 + -8); +t6 = t6 + 0xc; +MEM_U32(t6 + 84) = at; +at = MEM_U32(t9 + -4); +if (t9 != t8) {MEM_U32(t6 + 88) = at; +goto L45c574;} +MEM_U32(t6 + 88) = at; +t7 = MEM_U32(sp + 304); +goto L45c5d4; +t7 = MEM_U32(sp + 304); +L45c5a0: +s2 = zero; +t9 = v0; +t8 = v0 + 0x60; +L45c5ac: +at = MEM_U32(t9 + 92); +t9 = t9 + 0xc; +MEM_U32(t6 + 0) = at; +at = MEM_U32(t9 + 84); +t6 = t6 + 0xc; +MEM_U32(t6 + -8) = at; +at = MEM_U32(t9 + 88); +if (t9 != t8) {MEM_U32(t6 + -4) = at; +goto L45c5ac;} +MEM_U32(t6 + -4) = at; +t7 = MEM_U32(sp + 304); +L45c5d4: +//nop; +t8 = t7 & 0x2; +if (t8 == 0) {MEM_U32(sp + 104) = t8; +goto L45c618;} +MEM_U32(sp + 104) = t8; +t9 = MEM_U32(s3 + 0); +a1 = sp + 0xa0; +a0 = MEM_U32(t9 + 20); +//nop; +if (a0 != 0) {t7 = MEM_U32(sp + 304); +goto L45c61c;} +t7 = MEM_U32(sp + 304); +//nop; +a3 = MEM_U32(sp + 224); +a2 = 0xc; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45c60c; +a2 = 0xc; +L45c60c: +t6 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 48); +MEM_U32(t6 + 20) = v0; +L45c618: +t7 = MEM_U32(sp + 304); +L45c61c: +s1 = sp + 0xa0; +t8 = t7 & 0x400; +if (t8 == 0) {MEM_U32(sp + 100) = t8; +goto L45c660;} +MEM_U32(sp + 100) = t8; +t9 = MEM_U32(s3 + 0); +a1 = s1; +a0 = MEM_U32(t9 + 48); +//nop; +if (a0 != 0) {t7 = MEM_U32(sp + 304); +goto L45c664;} +t7 = MEM_U32(sp + 304); +//nop; +a3 = MEM_U32(sp + 240); +a2 = 0x4; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45c654; +a2 = 0x4; +L45c654: +t6 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 48); +MEM_U32(t6 + 48) = v0; +L45c660: +t7 = MEM_U32(sp + 304); +L45c664: +//nop; +t8 = t7 & 0x80; +if (t8 == 0) {MEM_U32(sp + 96) = t8; +goto L45c6a8;} +MEM_U32(sp + 96) = t8; +t9 = MEM_U32(s3 + 0); +a1 = s1; +a0 = MEM_U32(t9 + 52); +//nop; +if (a0 != 0) {t7 = MEM_U32(sp + 304); +goto L45c6ac;} +t7 = MEM_U32(sp + 304); +//nop; +a3 = MEM_U32(sp + 248); +a2 = 0x1; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45c69c; +a2 = 0x1; +L45c69c: +t6 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 48); +MEM_U32(t6 + 52) = v0; +L45c6a8: +t7 = MEM_U32(sp + 304); +L45c6ac: +//nop; +t8 = t7 & 0x4; +if (t8 == 0) {MEM_U32(sp + 92) = t8; +goto L45c6dc;} +MEM_U32(sp + 92) = t8; +//nop; +a3 = MEM_U32(sp + 200); +a0 = zero; +a1 = s1; +a2 = 0x1; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45c6d4; +a2 = 0x1; +L45c6d4: +gp = MEM_U32(sp + 48); +MEM_U32(sp + 156) = v0; +L45c6dc: +t9 = MEM_U32(sp + 92); +//nop; +if (t9 == 0) {t8 = MEM_U32(sp + 304); +goto L45c724;} +t8 = MEM_U32(sp + 304); +t6 = MEM_U32(s3 + 0); +a1 = s1; +a0 = MEM_U32(t6 + 72); +//nop; +if (a0 != 0) {t8 = MEM_U32(sp + 304); +goto L45c724;} +t8 = MEM_U32(sp + 304); +//nop; +a3 = MEM_U32(sp + 196); +a2 = 0x4; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45c714; +a2 = 0x4; +L45c714: +t7 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 48); +MEM_U32(t7 + 72) = v0; +t8 = MEM_U32(sp + 304); +L45c724: +//nop; +t9 = t8 & 0x20; +if (t9 == 0) {MEM_U32(sp + 88) = t9; +goto L45c768;} +MEM_U32(sp + 88) = t9; +t6 = MEM_U32(s3 + 0); +a1 = s1; +a0 = MEM_U32(t6 + 68); +//nop; +if (a0 != 0) {t8 = MEM_U32(sp + 304); +goto L45c76c;} +t8 = MEM_U32(sp + 304); +//nop; +a3 = MEM_U32(sp + 232); +a2 = 0xc; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45c75c; +a2 = 0xc; +L45c75c: +t7 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 48); +MEM_U32(t7 + 68) = v0; +L45c768: +t8 = MEM_U32(sp + 304); +L45c76c: +//nop; +t9 = t8 & 0x40; +if (t9 == 0) {MEM_U32(sp + 84) = t9; +goto L45c7b0;} +MEM_U32(sp + 84) = t9; +t6 = MEM_U32(s3 + 0); +a1 = s1; +a0 = MEM_U32(t6 + 76); +//nop; +if (a0 != 0) {t8 = MEM_U32(sp + 304); +goto L45c7b4;} +t8 = MEM_U32(sp + 304); +//nop; +a3 = MEM_U32(sp + 272); +a2 = 0x4; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45c7a4; +a2 = 0x4; +L45c7a4: +t7 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 48); +MEM_U32(t7 + 76) = v0; +L45c7b0: +t8 = MEM_U32(sp + 304); +L45c7b4: +//nop; +t9 = t8 & 0x100; +if (t9 == 0) {MEM_U32(sp + 80) = t9; +goto L45c7f8;} +MEM_U32(sp + 80) = t9; +t6 = MEM_U32(s3 + 0); +a1 = s1; +a0 = MEM_U32(t6 + 80); +//nop; +if (a0 != 0) {t8 = MEM_U32(sp + 304); +goto L45c7fc;} +t8 = MEM_U32(sp + 304); +//nop; +a3 = MEM_U32(sp + 216); +a2 = 0x34; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45c7ec; +a2 = 0x34; +L45c7ec: +t7 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 48); +MEM_U32(t7 + 80) = v0; +L45c7f8: +t8 = MEM_U32(sp + 304); +L45c7fc: +//nop; +t9 = t8 & 0x1; +if (t9 == 0) {MEM_U32(sp + 76) = t9; +goto L45c840;} +MEM_U32(sp + 76) = t9; +t6 = MEM_U32(s3 + 0); +a3 = MEM_U32(sp + 280); +a0 = MEM_U32(t6 + 24); +a1 = s1; +if (a0 != 0) {t8 = MEM_U32(sp + 304); +goto L45c844;} +t8 = MEM_U32(sp + 304); +//nop; +a2 = 0x10; +a3 = a3 + 0x1; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45c834; +a3 = a3 + 0x1; +L45c834: +t7 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 48); +MEM_U32(t7 + 24) = v0; +L45c840: +t8 = MEM_U32(sp + 304); +L45c844: +//nop; +t9 = t8 & 0x800; +if (t9 == 0) {MEM_U32(sp + 72) = t9; +goto L45c888;} +MEM_U32(sp + 72) = t9; +t6 = MEM_U32(s3 + 0); +a3 = MEM_U32(sp + 256); +a0 = MEM_U32(t6 + 36); +a1 = s1; +if (a0 != 0) {t8 = MEM_U32(sp + 304); +goto L45c88c;} +t8 = MEM_U32(sp + 304); +//nop; +a2 = 0x1; +a3 = a3 + 0x8; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45c87c; +a3 = a3 + 0x8; +L45c87c: +t7 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 48); +MEM_U32(t7 + 36) = v0; +L45c888: +t8 = MEM_U32(sp + 304); +L45c88c: +//nop; +t9 = t8 & 0x10; +if (t9 == 0) {MEM_U32(sp + 68) = t9; +goto L45c8d0;} +MEM_U32(sp + 68) = t9; +t6 = MEM_U32(s3 + 0); +a1 = s1; +a0 = MEM_U32(t6 + 56); +//nop; +if (a0 != 0) {t8 = MEM_U32(sp + 304); +goto L45c8d4;} +t8 = MEM_U32(sp + 304); +//nop; +a3 = MEM_U32(sp + 208); +a2 = 0x8; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45c8c4; +a2 = 0x8; +L45c8c4: +t7 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 48); +MEM_U32(t7 + 56) = v0; +L45c8d0: +t8 = MEM_U32(sp + 304); +L45c8d4: +//nop; +t9 = t8 & 0x200; +if (t9 == 0) {MEM_U32(sp + 64) = t9; +goto L45c918;} +MEM_U32(sp + 64) = t9; +t6 = MEM_U32(s3 + 0); +a1 = s1; +a0 = MEM_U32(t6 + 8); +//nop; +if (a0 != 0) {t8 = MEM_U32(sp + 64); +goto L45c91c;} +t8 = MEM_U32(sp + 64); +//nop; +a3 = MEM_U32(sp + 264); +a2 = 0x48; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45c90c; +a2 = 0x48; +L45c90c: +t7 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 48); +MEM_U32(t7 + 8) = v0; +L45c918: +t8 = MEM_U32(sp + 64); +L45c91c: +//nop; +t9 = zero < t8; +if (t9 == 0) {//nop; +goto L45c9a4;} +//nop; +t6 = MEM_U32(s3 + 0); +//nop; +s0 = MEM_U32(t6 + 4); +//nop; +if (s0 != 0) {//nop; +goto L45c9a4;} +//nop; +if (t9 == 0) {a1 = MEM_U32(sp + 264); +goto L45c988;} +a1 = MEM_U32(sp + 264); +if (s0 != 0) {a0 = s0; +goto L45c984;} +a0 = s0; +//nop; +a3 = MEM_U32(sp + 264); +a1 = s1; +a2 = 0x40; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45c968; +a2 = 0x40; +L45c968: +t7 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 48); +MEM_U32(t7 + 4) = v0; +t8 = MEM_U32(s3 + 0); +//nop; +s0 = MEM_U32(t8 + 4); +//nop; +L45c984: +a1 = MEM_U32(sp + 264); +L45c988: +//nop; +t6 = a1 << 6; +a1 = t6; +a0 = s0; +wrapper_bzero(mem, a0, a1); +goto L45c99c; +a0 = s0; +L45c99c: +gp = MEM_U32(sp + 48); +//nop; +L45c9a4: +t9 = MEM_U32(sp + 76); +t7 = MEM_U32(sp + 280); +if (t9 == 0) {a1 = s2; +goto L45c9d4;} +a1 = s2; +t8 = MEM_U32(s3 + 0); +//nop; +MEM_U32(t8 + 32) = t7; +v0 = MEM_U32(s3 + 0); +//nop; +t6 = MEM_U32(v0 + 32); +//nop; +MEM_U32(v0 + 28) = t6; +L45c9d4: +t9 = MEM_U32(sp + 72); +t7 = MEM_U32(sp + 256); +if (t9 == 0) {t9 = MEM_U32(sp + 68); +goto L45ca08;} +t9 = MEM_U32(sp + 68); +t8 = MEM_U32(s3 + 0); +//nop; +MEM_U32(t8 + 44) = t7; +v0 = MEM_U32(s3 + 0); +//nop; +t6 = MEM_U32(v0 + 44); +//nop; +MEM_U32(v0 + 40) = t6; +t9 = MEM_U32(sp + 68); +L45ca08: +t7 = MEM_U32(sp + 208); +if (t9 == 0) {t9 = MEM_U32(sp + 64); +goto L45ca38;} +t9 = MEM_U32(sp + 64); +t8 = MEM_U32(s3 + 0); +//nop; +MEM_U32(t8 + 64) = t7; +v0 = MEM_U32(s3 + 0); +//nop; +t6 = MEM_U32(v0 + 64); +//nop; +MEM_U32(v0 + 60) = t6; +t9 = MEM_U32(sp + 64); +L45ca38: +t7 = MEM_U32(sp + 264); +if (t9 == 0) {t9 = MEM_U32(sp + 92); +goto L45ca68;} +t9 = MEM_U32(sp + 92); +t8 = MEM_U32(s3 + 0); +//nop; +MEM_U32(t8 + 16) = t7; +v0 = MEM_U32(s3 + 0); +//nop; +t6 = MEM_U32(v0 + 16); +//nop; +MEM_U32(v0 + 12) = t6; +t9 = MEM_U32(sp + 92); +L45ca68: +a0 = MEM_U32(sp + 288); +if (t9 == 0) {t9 = MEM_U32(sp + 80); +goto L45cab0;} +t9 = MEM_U32(sp + 80); +//nop; +t7 = MEM_U32(sp + 204); +t8 = MEM_U32(sp + 296); +t6 = MEM_U32(sp + 200); +a3 = MEM_U32(sp + 156); +t9 = t9; +a2 = t7 + t8; +MEM_U32(sp + 16) = t6; +v0 = func_45d47c(mem, sp, a0, a1, a2, a3); +goto L45ca98; +MEM_U32(sp + 16) = t6; +L45ca98: +gp = MEM_U32(sp + 48); +if (v0 == 0) {//nop; +goto L45caac;} +//nop; +ra = MEM_U32(sp + 52); +goto L45d464; +ra = MEM_U32(sp + 52); +L45caac: +t9 = MEM_U32(sp + 80); +L45cab0: +a0 = MEM_U32(sp + 288); +if (t9 == 0) {a1 = s2; +goto L45cb0c;} +a1 = s2; +t7 = MEM_U32(sp + 220); +t8 = MEM_U32(sp + 296); +t9 = MEM_U32(sp + 216); +a2 = t7 + t8; +t7 = t9 << 2; +t7 = t7 - t9; +t7 = t7 << 2; +t7 = t7 + t9; +//nop; +t6 = MEM_U32(s3 + 0); +t7 = t7 << 2; +t9 = t9; +a3 = MEM_U32(t6 + 80); +MEM_U32(sp + 16) = t7; +v0 = func_45d47c(mem, sp, a0, a1, a2, a3); +goto L45caf8; +MEM_U32(sp + 16) = t7; +L45caf8: +gp = MEM_U32(sp + 48); +if (v0 == 0) {t8 = MEM_U32(sp + 104); +goto L45cb10;} +t8 = MEM_U32(sp + 104); +ra = MEM_U32(sp + 52); +goto L45d464; +ra = MEM_U32(sp + 52); +L45cb0c: +t8 = MEM_U32(sp + 104); +L45cb10: +a0 = MEM_U32(sp + 288); +if (t8 == 0) {a1 = s2; +goto L45cb64;} +a1 = s2; +t6 = MEM_U32(sp + 228); +t9 = MEM_U32(sp + 296); +t8 = MEM_U32(sp + 224); +a2 = t6 + t9; +//nop; +t7 = MEM_U32(s3 + 0); +t6 = t8 << 2; +t6 = t6 - t8; +t6 = t6 << 2; +t9 = t9; +a3 = MEM_U32(t7 + 20); +MEM_U32(sp + 16) = t6; +v0 = func_45d47c(mem, sp, a0, a1, a2, a3); +goto L45cb50; +MEM_U32(sp + 16) = t6; +L45cb50: +gp = MEM_U32(sp + 48); +if (v0 == 0) {//nop; +goto L45cb64;} +//nop; +ra = MEM_U32(sp + 52); +goto L45d464; +ra = MEM_U32(sp + 52); +L45cb64: +t9 = MEM_U32(sp + 88); +a0 = MEM_U32(sp + 288); +if (t9 == 0) {a1 = s2; +goto L45cbbc;} +a1 = s2; +t7 = MEM_U32(sp + 236); +t8 = MEM_U32(sp + 296); +t9 = MEM_U32(sp + 232); +a2 = t7 + t8; +t7 = t9 << 2; +t7 = t7 - t9; +//nop; +t6 = MEM_U32(s3 + 0); +t7 = t7 << 2; +t9 = t9; +a3 = MEM_U32(t6 + 68); +MEM_U32(sp + 16) = t7; +v0 = func_45d47c(mem, sp, a0, a1, a2, a3); +goto L45cba8; +MEM_U32(sp + 16) = t7; +L45cba8: +gp = MEM_U32(sp + 48); +if (v0 == 0) {t8 = MEM_U32(sp + 100); +goto L45cbc0;} +t8 = MEM_U32(sp + 100); +ra = MEM_U32(sp + 52); +goto L45d464; +ra = MEM_U32(sp + 52); +L45cbbc: +t8 = MEM_U32(sp + 100); +L45cbc0: +a0 = MEM_U32(sp + 288); +if (t8 == 0) {a1 = s2; +goto L45cc0c;} +a1 = s2; +t6 = MEM_U32(sp + 244); +t9 = MEM_U32(sp + 296); +t7 = MEM_U32(s3 + 0); +a2 = t6 + t9; +//nop; +t8 = MEM_U32(sp + 240); +a3 = MEM_U32(t7 + 48); +t9 = t9; +t6 = t8 << 2; +MEM_U32(sp + 16) = t6; +v0 = func_45d47c(mem, sp, a0, a1, a2, a3); +goto L45cbf8; +MEM_U32(sp + 16) = t6; +L45cbf8: +gp = MEM_U32(sp + 48); +if (v0 == 0) {//nop; +goto L45cc0c;} +//nop; +ra = MEM_U32(sp + 52); +goto L45d464; +ra = MEM_U32(sp + 52); +L45cc0c: +t9 = MEM_U32(sp + 96); +a0 = MEM_U32(sp + 288); +if (t9 == 0) {a1 = s2; +goto L45cc58;} +a1 = s2; +t6 = MEM_U32(s3 + 0); +t9 = MEM_U32(sp + 248); +a3 = MEM_U32(t6 + 52); +MEM_U32(sp + 16) = t9; +//nop; +t7 = MEM_U32(sp + 252); +t8 = MEM_U32(sp + 296); +t9 = t9; +a2 = t7 + t8; +v0 = func_45d47c(mem, sp, a0, a1, a2, a3); +goto L45cc44; +a2 = t7 + t8; +L45cc44: +gp = MEM_U32(sp + 48); +if (v0 == 0) {t7 = MEM_U32(sp + 72); +goto L45cc5c;} +t7 = MEM_U32(sp + 72); +ra = MEM_U32(sp + 52); +goto L45d464; +ra = MEM_U32(sp + 52); +L45cc58: +t7 = MEM_U32(sp + 72); +L45cc5c: +a0 = MEM_U32(sp + 288); +if (t7 == 0) {a1 = s2; +goto L45cca4;} +a1 = s2; +t9 = MEM_U32(s3 + 0); +t8 = MEM_U32(sp + 260); +a3 = MEM_U32(t9 + 36); +//nop; +t6 = MEM_U32(sp + 296); +t7 = MEM_U32(sp + 256); +t9 = t9; +a2 = t8 + t6; +MEM_U32(sp + 16) = t7; +v0 = func_45d47c(mem, sp, a0, a1, a2, a3); +goto L45cc90; +MEM_U32(sp + 16) = t7; +L45cc90: +gp = MEM_U32(sp + 48); +if (v0 == 0) {t8 = MEM_U32(sp + 64); +goto L45cca8;} +t8 = MEM_U32(sp + 64); +ra = MEM_U32(sp + 52); +goto L45d464; +ra = MEM_U32(sp + 52); +L45cca4: +t8 = MEM_U32(sp + 64); +L45cca8: +a0 = MEM_U32(sp + 288); +if (t8 == 0) {a1 = s2; +goto L45ccfc;} +a1 = s2; +t6 = MEM_U32(sp + 268); +t9 = MEM_U32(sp + 296); +t8 = MEM_U32(sp + 264); +a2 = t6 + t9; +//nop; +t7 = MEM_U32(s3 + 0); +t6 = t8 << 3; +t6 = t6 + t8; +t6 = t6 << 3; +t9 = t9; +a3 = MEM_U32(t7 + 8); +MEM_U32(sp + 16) = t6; +v0 = func_45d47c(mem, sp, a0, a1, a2, a3); +goto L45cce8; +MEM_U32(sp + 16) = t6; +L45cce8: +gp = MEM_U32(sp + 48); +if (v0 == 0) {//nop; +goto L45ccfc;} +//nop; +ra = MEM_U32(sp + 52); +goto L45d464; +ra = MEM_U32(sp + 52); +L45ccfc: +t9 = MEM_U32(sp + 84); +a0 = MEM_U32(sp + 288); +if (t9 == 0) {a1 = s2; +goto L45cd4c;} +a1 = s2; +t7 = MEM_U32(sp + 276); +t8 = MEM_U32(sp + 296); +t9 = MEM_U32(sp + 272); +a2 = t7 + t8; +t7 = t9 << 2; +//nop; +t6 = MEM_U32(s3 + 0); +t9 = t9; +a3 = MEM_U32(t6 + 76); +MEM_U32(sp + 16) = t7; +v0 = func_45d47c(mem, sp, a0, a1, a2, a3); +goto L45cd38; +MEM_U32(sp + 16) = t7; +L45cd38: +gp = MEM_U32(sp + 48); +if (v0 == 0) {t8 = MEM_U32(sp + 76); +goto L45cd50;} +t8 = MEM_U32(sp + 76); +ra = MEM_U32(sp + 52); +goto L45d464; +ra = MEM_U32(sp + 52); +L45cd4c: +t8 = MEM_U32(sp + 76); +L45cd50: +a0 = MEM_U32(sp + 288); +if (t8 == 0) {a1 = s2; +goto L45cd9c;} +a1 = s2; +t6 = MEM_U32(sp + 284); +t9 = MEM_U32(sp + 296); +t7 = MEM_U32(s3 + 0); +a2 = t6 + t9; +//nop; +t8 = MEM_U32(sp + 280); +a3 = MEM_U32(t7 + 24); +t9 = t9; +t6 = t8 << 4; +MEM_U32(sp + 16) = t6; +v0 = func_45d47c(mem, sp, a0, a1, a2, a3); +goto L45cd88; +MEM_U32(sp + 16) = t6; +L45cd88: +gp = MEM_U32(sp + 48); +if (v0 == 0) {//nop; +goto L45cd9c;} +//nop; +ra = MEM_U32(sp + 52); +goto L45d464; +ra = MEM_U32(sp + 52); +L45cd9c: +t9 = MEM_U32(sp + 68); +a0 = MEM_U32(sp + 288); +if (t9 == 0) {a1 = s2; +goto L45cdec;} +a1 = s2; +t7 = MEM_U32(sp + 212); +t8 = MEM_U32(sp + 296); +t9 = MEM_U32(sp + 208); +a2 = t7 + t8; +t7 = t9 << 3; +//nop; +t6 = MEM_U32(s3 + 0); +t9 = t9; +a3 = MEM_U32(t6 + 56); +MEM_U32(sp + 16) = t7; +v0 = func_45d47c(mem, sp, a0, a1, a2, a3); +goto L45cdd8; +MEM_U32(sp + 16) = t7; +L45cdd8: +gp = MEM_U32(sp + 48); +if (v0 == 0) {//nop; +goto L45cdec;} +//nop; +ra = MEM_U32(sp + 52); +goto L45d464; +ra = MEM_U32(sp + 52); +L45cdec: +t8 = MEM_U32(s3 + 0); +t9 = MEM_U32(sp + 80); +t6 = MEM_U32(t8 + 88); +//nop; +if (t6 == 0) {v1 = MEM_U32(sp + 264); +goto L45cfdc;} +v1 = MEM_U32(sp + 264); +if (t9 == 0) {t8 = MEM_U32(sp + 104); +goto L45ce44;} +t8 = MEM_U32(sp + 104); +//nop; +//nop; +//nop; +v0 = f_gethostsex(mem, sp); +goto L45ce1c; +//nop; +L45ce1c: +gp = MEM_U32(sp + 48); +t7 = MEM_U32(s3 + 0); +//nop; +a1 = MEM_U32(sp + 216); +a0 = MEM_U32(t7 + 80); +a2 = v0; +f_swap_pd(mem, sp, a0, a1, a2); +goto L45ce38; +a2 = v0; +L45ce38: +gp = MEM_U32(sp + 48); +//nop; +t8 = MEM_U32(sp + 104); +L45ce44: +//nop; +if (t8 == 0) {t9 = MEM_U32(sp + 88); +goto L45ce88;} +t9 = MEM_U32(sp + 88); +//nop; +//nop; +//nop; +v0 = f_gethostsex(mem, sp); +goto L45ce60; +//nop; +L45ce60: +gp = MEM_U32(sp + 48); +t6 = MEM_U32(s3 + 0); +//nop; +a1 = MEM_U32(sp + 224); +a0 = MEM_U32(t6 + 20); +a2 = v0; +f_swap_sym(mem, sp, a0, a1, a2); +goto L45ce7c; +a2 = v0; +L45ce7c: +gp = MEM_U32(sp + 48); +//nop; +t9 = MEM_U32(sp + 88); +L45ce88: +//nop; +if (t9 == 0) {t8 = MEM_U32(sp + 64); +goto L45cecc;} +t8 = MEM_U32(sp + 64); +//nop; +//nop; +//nop; +v0 = f_gethostsex(mem, sp); +goto L45cea4; +//nop; +L45cea4: +gp = MEM_U32(sp + 48); +t7 = MEM_U32(s3 + 0); +//nop; +a1 = MEM_U32(sp + 232); +a0 = MEM_U32(t7 + 68); +a2 = v0; +f_swap_opt(mem, sp, a0, a1, a2); +goto L45cec0; +a2 = v0; +L45cec0: +gp = MEM_U32(sp + 48); +//nop; +t8 = MEM_U32(sp + 64); +L45cecc: +//nop; +if (t8 == 0) {t9 = MEM_U32(sp + 84); +goto L45cf10;} +t9 = MEM_U32(sp + 84); +//nop; +//nop; +//nop; +v0 = f_gethostsex(mem, sp); +goto L45cee8; +//nop; +L45cee8: +gp = MEM_U32(sp + 48); +t6 = MEM_U32(s3 + 0); +//nop; +a1 = MEM_U32(sp + 264); +a0 = MEM_U32(t6 + 8); +a2 = v0; +f_swap_fd(mem, sp, a0, a1, a2); +goto L45cf04; +a2 = v0; +L45cf04: +gp = MEM_U32(sp + 48); +//nop; +t9 = MEM_U32(sp + 84); +L45cf10: +//nop; +if (t9 == 0) {t8 = MEM_U32(sp + 76); +goto L45cf54;} +t8 = MEM_U32(sp + 76); +//nop; +//nop; +//nop; +v0 = f_gethostsex(mem, sp); +goto L45cf2c; +//nop; +L45cf2c: +gp = MEM_U32(sp + 48); +t7 = MEM_U32(s3 + 0); +//nop; +a1 = MEM_U32(sp + 272); +a0 = MEM_U32(t7 + 76); +a2 = v0; +f_swap_fi(mem, sp, a0, a1, a2); +goto L45cf48; +a2 = v0; +L45cf48: +gp = MEM_U32(sp + 48); +//nop; +t8 = MEM_U32(sp + 76); +L45cf54: +//nop; +if (t8 == 0) {t9 = MEM_U32(sp + 68); +goto L45cf98;} +t9 = MEM_U32(sp + 68); +//nop; +//nop; +//nop; +v0 = f_gethostsex(mem, sp); +goto L45cf70; +//nop; +L45cf70: +gp = MEM_U32(sp + 48); +t6 = MEM_U32(s3 + 0); +//nop; +a1 = MEM_U32(sp + 280); +a0 = MEM_U32(t6 + 24); +a2 = v0; +f_swap_ext(mem, sp, a0, a1, a2); +goto L45cf8c; +a2 = v0; +L45cf8c: +gp = MEM_U32(sp + 48); +//nop; +t9 = MEM_U32(sp + 68); +L45cf98: +//nop; +if (t9 == 0) {v1 = MEM_U32(sp + 264); +goto L45cfdc;} +v1 = MEM_U32(sp + 264); +//nop; +//nop; +//nop; +v0 = f_gethostsex(mem, sp); +goto L45cfb4; +//nop; +L45cfb4: +gp = MEM_U32(sp + 48); +t7 = MEM_U32(s3 + 0); +//nop; +a1 = MEM_U32(sp + 208); +a0 = MEM_U32(t7 + 56); +a2 = v0; +f_swap_dn(mem, sp, a0, a1, a2); +goto L45cfd0; +a2 = v0; +L45cfd0: +gp = MEM_U32(sp + 48); +//nop; +v1 = MEM_U32(sp + 264); +L45cfdc: +s0 = zero; +if ((int)v1 <= 0) {s2 = zero; +goto L45d248;} +s2 = zero; +s1 = zero; +L45cfec: +//nop; +a0 = s2; +//nop; +v0 = f_st_pcfd_ifd(mem, sp, a0, a1, a2, a3); +goto L45cffc; +//nop; +L45cffc: +t8 = MEM_U32(s3 + 0); +gp = MEM_U32(sp + 48); +t6 = MEM_U32(t8 + 8); +//nop; +t9 = t6 + s1; +MEM_U32(v0 + 0) = t9; +t7 = MEM_U32(sp + 104); +//nop; +if (t7 == 0) {t8 = MEM_U32(sp + 100); +goto L45d064;} +t8 = MEM_U32(sp + 100); +t8 = MEM_U32(t9 + 20); +v1 = t9; +if ((int)t8 <= 0) {t8 = MEM_U32(sp + 100); +goto L45d064;} +t8 = MEM_U32(sp + 100); +t7 = MEM_U32(v1 + 16); +t6 = MEM_U32(s3 + 0); +t8 = t7 << 2; +t8 = t8 - t7; +t9 = MEM_U32(t6 + 20); +t7 = MEM_U32(v0 + 60); +t8 = t8 << 2; +t6 = t9 + t8; +t9 = t7 | 0x2; +MEM_U32(v0 + 4) = t6; +MEM_U32(v0 + 60) = t9; +t8 = MEM_U32(sp + 100); +L45d064: +//nop; +if (t8 == 0) {t6 = MEM_U32(sp + 88); +goto L45d0b0;} +t6 = MEM_U32(sp + 88); +v1 = MEM_U32(v0 + 0); +//nop; +t6 = MEM_U32(v1 + 48); +//nop; +if ((int)t6 <= 0) {t6 = MEM_U32(sp + 88); +goto L45d0b0;} +t6 = MEM_U32(sp + 88); +t7 = MEM_U32(s3 + 0); +t8 = MEM_U32(v1 + 44); +t9 = MEM_U32(t7 + 48); +t6 = t8 << 2; +t8 = MEM_U32(v0 + 60); +t7 = t9 + t6; +t9 = t8 | 0x400; +MEM_U32(v0 + 12) = t7; +MEM_U32(v0 + 60) = t9; +t6 = MEM_U32(sp + 88); +L45d0b0: +//nop; +if (t6 == 0) {t7 = MEM_U32(sp + 84); +goto L45d104;} +t7 = MEM_U32(sp + 84); +v1 = MEM_U32(v0 + 0); +//nop; +t7 = MEM_U32(v1 + 36); +//nop; +if ((int)t7 <= 0) {t7 = MEM_U32(sp + 84); +goto L45d104;} +t7 = MEM_U32(sp + 84); +t6 = MEM_U32(v1 + 32); +t8 = MEM_U32(s3 + 0); +t7 = t6 << 2; +t7 = t7 - t6; +t9 = MEM_U32(t8 + 68); +t6 = MEM_U32(v0 + 60); +t7 = t7 << 2; +t8 = t9 + t7; +t9 = t6 | 0x20; +MEM_U32(v0 + 28) = t8; +MEM_U32(v0 + 60) = t9; +t7 = MEM_U32(sp + 84); +L45d104: +//nop; +if (t7 == 0) {t8 = MEM_U32(sp + 96); +goto L45d150;} +t8 = MEM_U32(sp + 96); +v1 = MEM_U32(v0 + 0); +//nop; +t8 = MEM_U32(v1 + 56); +//nop; +if ((int)t8 <= 0) {t8 = MEM_U32(sp + 96); +goto L45d150;} +t8 = MEM_U32(sp + 96); +t6 = MEM_U32(s3 + 0); +t7 = MEM_U32(v1 + 52); +t9 = MEM_U32(t6 + 76); +t8 = t7 << 2; +t7 = MEM_U32(v0 + 60); +t6 = t9 + t8; +t9 = t7 | 0x40; +MEM_U32(v0 + 44) = t6; +MEM_U32(v0 + 60) = t9; +t8 = MEM_U32(sp + 96); +L45d150: +//nop; +if (t8 == 0) {t8 = MEM_U32(sp + 80); +goto L45d198;} +t8 = MEM_U32(sp + 80); +v1 = MEM_U32(v0 + 0); +//nop; +t6 = MEM_U32(v1 + 12); +//nop; +if ((int)t6 <= 0) {t8 = MEM_U32(sp + 80); +goto L45d198;} +t8 = MEM_U32(sp + 80); +t7 = MEM_U32(s3 + 0); +t8 = MEM_U32(v1 + 8); +t9 = MEM_U32(t7 + 52); +t7 = MEM_U32(v0 + 60); +t6 = t9 + t8; +t9 = t7 | 0x80; +MEM_U32(v0 + 20) = t6; +MEM_U32(v0 + 60) = t9; +t8 = MEM_U32(sp + 80); +L45d198: +//nop; +if (t8 == 0) {t6 = MEM_U32(sp + 92); +goto L45d1ec;} +t6 = MEM_U32(sp + 92); +v1 = MEM_U32(v0 + 0); +t8 = s0 << 2; +t6 = MEM_U16(v1 + 42); +t8 = t8 - s0; +if (t6 == 0) {t8 = t8 << 2; +goto L45d1e8;} +t8 = t8 << 2; +t7 = MEM_U32(s3 + 0); +t8 = t8 + s0; +t9 = MEM_U32(t7 + 80); +t8 = t8 << 2; +t6 = t9 + t8; +t9 = MEM_U32(v0 + 60); +MEM_U32(v0 + 52) = t6; +t7 = MEM_U16(v1 + 42); +t8 = t9 | 0x100; +MEM_U32(v0 + 60) = t8; +s0 = s0 + t7; +L45d1e8: +t6 = MEM_U32(sp + 92); +L45d1ec: +//nop; +if (t6 == 0) {v1 = MEM_U32(sp + 264); +goto L45d238;} +v1 = MEM_U32(sp + 264); +v1 = MEM_U32(v0 + 0); +//nop; +t7 = MEM_U32(v1 + 28); +//nop; +if ((int)t7 <= 0) {//nop; +goto L45d234;} +//nop; +t9 = MEM_U32(s3 + 0); +t6 = MEM_U32(v1 + 24); +t8 = MEM_U32(t9 + 72); +t7 = t6 << 2; +t6 = MEM_U32(v0 + 60); +t9 = t8 + t7; +t8 = t6 | 0x4; +MEM_U32(v0 + 36) = t9; +MEM_U32(v0 + 60) = t8; +L45d234: +v1 = MEM_U32(sp + 264); +L45d238: +s2 = s2 + 0x1; +at = (int)s2 < (int)v1; +if (at != 0) {s1 = s1 + 0x48; +goto L45cfec;} +s1 = s1 + 0x48; +L45d248: +t7 = MEM_U32(sp + 92); +s2 = v1 + 0xffffffff; +if (t7 == 0) {//nop; +goto L45d41c;} +//nop; +if ((int)s2 < 0) {//nop; +goto L45d41c;} +//nop; +L45d260: +//nop; +a0 = s2; +//nop; +v0 = f_st_pcfd_ifd(mem, sp, a0, a1, a2, a3); +goto L45d270; +//nop; +L45d270: +v1 = MEM_U32(v0 + 0); +gp = MEM_U32(sp + 48); +t9 = MEM_U32(v1 + 28); +t3 = 0xfffffff8; +t5 = 0xffffffff; +if (t9 == 0) {s1 = v0; +goto L45d410;} +s1 = v0; +t6 = MEM_U32(v1 + 64); +t8 = MEM_U32(sp + 156); +t7 = MEM_U16(v1 + 42); +ra = zero; +if (t7 == 0) {t0 = t6 + t8; +goto L45d410;} +t0 = t6 + t8; +s0 = zero; +L45d2a8: +t2 = MEM_U32(v0 + 52); +ra = ra + 0x1; +v1 = t2 + s0; +a3 = MEM_U32(v1 + 8); +//nop; +if (t5 == a3) {//nop; +goto L45d2e4;} +//nop; +t4 = MEM_U32(v1 + 40); +//nop; +if (t5 == t4) {//nop; +goto L45d2e4;} +//nop; +t9 = MEM_U32(v1 + 44); +//nop; +if (t5 != t9) {//nop; +goto L45d2f8;} +//nop; +L45d2e4: +t6 = MEM_U32(s1 + 0); +//nop; +a2 = MEM_U16(t6 + 42); +at = ra < a2; +goto L45d408; +at = ra < a2; +L45d2f8: +v1 = MEM_U32(v0 + 0); +a1 = zero; +t8 = MEM_U16(v1 + 42); +t1 = MEM_U32(v1 + 28); +if (t8 == 0) {at = (int)a3 < (int)t1; +goto L45d370;} +at = (int)a3 < (int)t1; +t7 = MEM_U32(s1 + 0); +a0 = t2; +a2 = MEM_U16(t7 + 42); +//nop; +L45d320: +v1 = MEM_U32(a0 + 8); +a1 = a1 + 0x1; +at = (int)a3 < (int)v1; +if (at == 0) {at = a1 < a2; +goto L45d364;} +at = a1 < a2; +t9 = MEM_U32(a0 + 40); +//nop; +if (t5 == t9) {at = a1 < a2; +goto L45d364;} +at = a1 < a2; +t6 = MEM_U32(a0 + 44); +at = (int)v1 < (int)t1; +if (t5 == t6) {//nop; +goto L45d360;} +//nop; +if (at == 0) {at = a1 < a2; +goto L45d364;} +at = a1 < a2; +t1 = v1; +L45d360: +at = a1 < a2; +L45d364: +if (at != 0) {a0 = a0 + 0x34; +goto L45d320;} +a0 = a0 + 0x34; +at = (int)a3 < (int)t1; +L45d370: +a2 = t4; +if (at == 0) {a1 = a3; +goto L45d3f4;} +a1 = a3; +L45d37c: +v1 = MEM_S8(t0 + 0); +t0 = t0 + 0x1; +a3 = (int)v1 >> 4; +t8 = a3 << 24; +a3 = (int)t8 >> 24; +if (a3 != t3) {a0 = v1 & 0xf; +goto L45d3c0;} +a0 = v1 & 0xf; +t9 = MEM_S8(t0 + 1); +t8 = MEM_S8(t0 + 0); +t6 = t9 & 0xff; +t7 = t8 << 8; +v1 = t6 | t7; +t9 = v1 << 16; +t8 = (int)t9 >> 16; +t0 = t0 + 0x2; +a2 = a2 + t8; +goto L45d3c4; +a2 = a2 + t8; +L45d3c0: +a2 = a2 + a3; +L45d3c4: +if ((int)a0 < 0) {v1 = a1 << 2; +goto L45d3e8;} +v1 = a1 << 2; +L45d3cc: +t6 = MEM_U32(v0 + 36); +a0 = a0 + 0xffffffff; +t7 = t6 + v1; +MEM_U32(t7 + 0) = a2; +v1 = v1 + 0x4; +if ((int)a0 >= 0) {a1 = a1 + 0x1; +goto L45d3cc;} +a1 = a1 + 0x1; +L45d3e8: +at = (int)a1 < (int)t1; +if (at != 0) {//nop; +goto L45d37c;} +//nop; +L45d3f4: +t9 = MEM_U32(s1 + 0); +//nop; +a2 = MEM_U16(t9 + 42); +//nop; +at = ra < a2; +L45d408: +if (at != 0) {s0 = s0 + 0x34; +goto L45d2a8;} +s0 = s0 + 0x34; +L45d410: +s2 = s2 + 0xffffffff; +if ((int)s2 >= 0) {//nop; +goto L45d260;} +//nop; +L45d41c: +v0 = MEM_U32(s3 + 0); +t6 = MEM_U32(sp + 304); +t8 = MEM_U32(v0 + 84); +//nop; +t7 = t8 | t6; +MEM_U32(v0 + 84) = t7; +t9 = MEM_U32(sp + 156); +//nop; +if (t9 == 0) {a0 = t9; +goto L45d45c;} +a0 = t9; +//nop; +//nop; +//nop; +wrapper_free(mem, a0); +goto L45d454; +//nop; +L45d454: +gp = MEM_U32(sp + 48); +//nop; +L45d45c: +v0 = zero; +L45d460: +ra = MEM_U32(sp + 52); +L45d464: +s0 = MEM_U32(sp + 32); +s1 = MEM_U32(sp + 36); +s2 = MEM_U32(sp + 40); +s3 = MEM_U32(sp + 44); +sp = sp + 0x120; +return v0; +sp = sp + 0x120; +} + +static uint32_t func_45d47c(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L45d47c: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +t6 = MEM_U32(sp + 48); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 40) = a2; +if (t6 != 0) {MEM_U32(sp + 44) = a3; +goto L45d4b0;} +MEM_U32(sp + 44) = a3; +v0 = zero; +goto L45d548; +v0 = zero; +L45d4b0: +if (a1 != 0) {//nop; +goto L45d4fc;} +//nop; +//nop; +a0 = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 40); +a2 = zero; +v0 = wrapper_lseek(mem, a0, a1, a2); +goto L45d4cc; +a2 = zero; +L45d4cc: +t7 = MEM_U32(sp + 40); +gp = MEM_U32(sp + 24); +if (v0 == t7) {//nop; +goto L45d4fc;} +//nop; +a0 = 0x1000e42c; +//nop; +a0 = a0; +//nop; +f_st_warning(mem, sp, a0); +goto L45d4f0; +//nop; +L45d4f0: +gp = MEM_U32(sp + 24); +v0 = 0xfffffffb; +goto L45d548; +v0 = 0xfffffffb; +L45d4fc: +//nop; +a0 = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 44); +a2 = MEM_U32(sp + 48); +//nop; +v0 = wrapper_read(mem, a0, a1, a2); +goto L45d514; +//nop; +L45d514: +t8 = MEM_U32(sp + 48); +gp = MEM_U32(sp + 24); +if (v0 == t8) {v0 = zero; +goto L45d548;} +v0 = zero; +a0 = 0x1000e444; +//nop; +a0 = a0; +//nop; +f_st_warning(mem, sp, a0); +goto L45d538; +//nop; +L45d538: +gp = MEM_U32(sp + 24); +v0 = 0xfffffffa; +goto L45d548; +v0 = 0xfffffffa; +v0 = zero; +L45d548: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return v0; +//nop; +} + +static void f_st_writest(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L45d5ec: +//st_writest: +//nop; +//nop; +//nop; +sp = sp + 0xfffffe28; +//nop; +MEM_U32(sp + 20) = s0; +s0 = a0; +MEM_U32(sp + 60) = ra; +MEM_U32(sp + 476) = a1; +MEM_U32(sp + 56) = fp; +MEM_U32(sp + 52) = gp; +MEM_U32(sp + 48) = s7; +MEM_U32(sp + 44) = s6; +MEM_U32(sp + 40) = s5; +MEM_U32(sp + 36) = s4; +MEM_U32(sp + 32) = s3; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +a1 = 0x48; +a0 = sp + 0x18c; +MEM_U32(sp + 288) = zero; +wrapper_bzero(mem, a0, a1); +goto L45d644; +MEM_U32(sp + 288) = zero; +L45d644: +gp = MEM_U32(sp + 52); +a0 = sp + 0x128; +//nop; +a1 = 0x60; +//nop; +wrapper_bzero(mem, a0, a1); +goto L45d65c; +//nop; +L45d65c: +gp = MEM_U32(sp + 52); +//nop; +//nop; +//nop; +//nop; +v0 = f_st_ifdmax(mem, sp); +goto L45d674; +//nop; +L45d674: +gp = MEM_U32(sp + 52); +MEM_U32(sp + 276) = v0; +//nop; +a0 = s0; +a1 = zero; +a2 = 0x1; +v0 = wrapper_lseek(mem, a0, a1, a2); +goto L45d690; +a2 = 0x1; +L45d690: +gp = MEM_U32(sp + 52); +MEM_U32(sp + 272) = v0; +//nop; +a0 = s0; +a1 = 0x60; +a2 = 0x1; +v0 = wrapper_lseek(mem, a0, a1, a2); +goto L45d6ac; +a2 = 0x1; +L45d6ac: +gp = MEM_U32(sp + 52); +t6 = MEM_U32(sp + 276); +t7 = 0x1001b288; +MEM_U32(sp + 284) = v0; +t7 = MEM_U32(t7 + 0); +a0 = s0; +MEM_U32(t7 + 12) = t6; +//nop; +//nop; +//nop; +v0 = wrapper_dup(mem, a0); +goto L45d6d8; +//nop; +L45d6d8: +gp = MEM_U32(sp + 52); +a0 = v0; +a1 = 0x1000e480; +//nop; +a1 = a1; +//nop; +v0 = wrapper_fdopen(mem, a0, a1); +goto L45d6f4; +//nop; +L45d6f4: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +if (v0 != 0) {MEM_U32(sp + 268) = v0; +goto L45d728;} +MEM_U32(sp + 268) = v0; +a0 = 0x1000e484; +//nop; +a1 = s0; +MEM_U32(sp + 288) = t3; +a0 = a0; +f_st_error(mem, sp, a0, a1, a2); +goto L45d71c; +a0 = a0; +L45d71c: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +//nop; +L45d728: +t8 = MEM_U32(sp + 476); +//nop; +t9 = t8 & 0x4; +if (t9 == 0) {t8 = MEM_U32(sp + 476); +goto L45dacc;} +t8 = MEM_U32(sp + 476); +t4 = MEM_U32(sp + 276); +s6 = 0xffffffff; +if ((int)t4 <= 0) {t9 = MEM_U32(sp + 300); +goto L45da48;} +t9 = MEM_U32(sp + 300); +MEM_U32(sp + 280) = zero; +fp = sp + 0x68; +L45d754: +//nop; +a0 = MEM_U32(sp + 280); +MEM_U32(sp + 292) = zero; +MEM_U32(sp + 288) = t3; +v0 = f_st_pcfd_ifd(mem, sp, a0, a1, a2, a3); +goto L45d768; +MEM_U32(sp + 288) = t3; +L45d768: +t5 = MEM_U32(v0 + 0); +gp = MEM_U32(sp + 52); +MEM_U32(sp + 392) = t5; +v1 = MEM_U32(t5 + 28); +t2 = MEM_U32(sp + 292); +t3 = MEM_U32(sp + 288); +if (v1 == 0) {t1 = v0; +goto L45da30;} +t1 = v0; +t7 = MEM_U32(v0 + 36); +t8 = MEM_U32(sp + 300); +if (t7 == 0) {t4 = t8 + v1; +goto L45da30;} +t4 = t8 + v1; +MEM_U32(t5 + 24) = t8; +MEM_U32(sp + 300) = t4; +MEM_U32(t5 + 64) = t3; +MEM_U32(sp + 264) = zero; +s1 = MEM_U16(t5 + 42); +//nop; +if (s1 == 0) {t8 = MEM_U32(sp + 392); +goto L45da28;} +t8 = MEM_U32(sp + 392); +MEM_U32(sp + 88) = zero; +L45d7bc: +t5 = MEM_U32(t1 + 52); +t6 = MEM_U32(sp + 88); +//nop; +t0 = t5 + t6; +t7 = MEM_U32(t0 + 8); +//nop; +if (s6 == t7) {t4 = MEM_U32(sp + 264); +goto L45da08;} +t4 = MEM_U32(sp + 264); +t8 = MEM_U32(t0 + 40); +//nop; +if (s6 == t8) {t4 = MEM_U32(sp + 264); +goto L45da08;} +t4 = MEM_U32(sp + 264); +t4 = MEM_U32(t0 + 44); +t9 = MEM_U32(sp + 392); +if (s6 == t4) {t4 = MEM_U32(sp + 264); +goto L45da08;} +t4 = MEM_U32(sp + 264); +t5 = MEM_U32(t9 + 64); +a0 = zero; +t6 = t3 - t5; +MEM_U32(t0 + 48) = t6; +t7 = MEM_U32(sp + 392); +//nop; +s1 = MEM_U16(t7 + 42); +a1 = MEM_U32(t7 + 28); +if (s1 == 0) {//nop; +goto L45d87c;} +//nop; +a2 = MEM_U32(t0 + 8); +v1 = MEM_U32(t1 + 52); +//nop; +L45d830: +v0 = MEM_U32(v1 + 8); +a0 = a0 + 0x1; +at = (int)a2 < (int)v0; +if (at == 0) {at = a0 < s1; +goto L45d874;} +at = a0 < s1; +t8 = MEM_U32(v1 + 40); +//nop; +if (s6 == t8) {at = a0 < s1; +goto L45d874;} +at = a0 < s1; +t4 = MEM_U32(v1 + 44); +at = (int)v0 < (int)a1; +if (s6 == t4) {//nop; +goto L45d870;} +//nop; +if (at == 0) {at = a0 < s1; +goto L45d874;} +at = a0 < s1; +a1 = v0; +L45d870: +at = a0 < s1; +L45d874: +if (at != 0) {v1 = v1 + 0x34; +goto L45d830;} +v1 = v1 + 0x34; +L45d87c: +if ((int)a1 <= 0) {t4 = MEM_U32(sp + 264); +goto L45da08;} +t4 = MEM_U32(sp + 264); +a2 = MEM_U32(t0 + 8); +s2 = s6; +if ((int)a2 < 0) {t9 = a2 << 2; +goto L45da04;} +t9 = a2 << 2; +v0 = MEM_U32(t1 + 36); +s7 = a1 << 2; +s3 = v0 + t9; +v1 = v0 + s7; +s5 = MEM_U32(t0 + 40); +at = v1 < s3; +s4 = zero; +if (at != 0) {s0 = fp; +goto L45da04;} +s0 = fp; +L45d8b8: +if (s3 != v1) {at = 0x8; +goto L45d8c8;} +at = 0x8; +v1 = 0x1; +goto L45d8f0; +v1 = 0x1; +L45d8c8: +v0 = MEM_U32(s3 + 0); +//nop; +if (v0 != 0) {a0 = v0; +goto L45d8e4;} +a0 = v0; +a0 = MEM_U32(t0 + 40); +v1 = a0 - s5; +goto L45d8e8; +v1 = a0 - s5; +L45d8e4: +v1 = a0 - s5; +L45d8e8: +t5 = v1 << 16; +v1 = (int)t5 >> 16; +L45d8f0: +if (v1 != 0) {a0 = fp; +goto L45d900;} +a0 = fp; +if (s2 != at) {v0 = s0 + 0x3; +goto L45d968;} +v0 = s0 + 0x3; +L45d900: +if (s2 == s6) {s5 = s5 + v1; +goto L45d92c;} +s5 = s5 + v1; +at = (int)s4 < (int)0xfffffff9; +if (at != 0) {at = (int)s4 < (int)0x8; +goto L45d92c;} +at = (int)s4 < (int)0x8; +if (at == 0) {t4 = s4 << 4; +goto L45d92c;} +t4 = s4 << 4; +t9 = t4 | s2; +MEM_U8(s0 + 0) = (uint8_t)t9; +s0 = s0 + 0x1; +goto L45d950; +s0 = s0 + 0x1; +L45d92c: +if (s2 == s6) {t7 = (int)s4 >> 8; +goto L45d950;} +t7 = (int)s4 >> 8; +MEM_U8(s0 + 0) = (uint8_t)s2; +t5 = MEM_S8(s0 + 0); +MEM_U8(s0 + 1) = (uint8_t)t7; +t6 = t5 | 0x80; +MEM_U8(s0 + 0) = (uint8_t)t6; +MEM_U8(s0 + 2) = (uint8_t)s4; +s0 = s0 + 0x3; +L45d950: +s4 = v1 << 16; +t4 = (int)s4 >> 16; +s2 = zero; +s4 = t4; +v0 = s0 + 0x3; +goto L45d96c; +v0 = s0 + 0x3; +L45d968: +s2 = s2 + 0x1; +L45d96c: +t9 = sp + 0xe8; +at = v0 < t9; +if (at == 0) {s1 = s0 - fp; +goto L45d998;} +s1 = s0 - fp; +t5 = MEM_U32(t1 + 36); +t6 = s0 - fp; +v1 = t5 + s7; +if (s3 != v1) {//nop; +goto L45d9e4;} +//nop; +if ((int)t6 <= 0) {//nop; +goto L45d9e4;} +//nop; +L45d998: +//nop; +a3 = MEM_U32(sp + 268); +a1 = s1; +a2 = 0x1; +MEM_U32(sp + 252) = t0; +MEM_U32(sp + 468) = t1; +MEM_U32(sp + 292) = t2; +MEM_U32(sp + 288) = t3; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45d9bc; +MEM_U32(sp + 288) = t3; +L45d9bc: +t1 = MEM_U32(sp + 468); +t2 = MEM_U32(sp + 292); +t3 = MEM_U32(sp + 288); +t7 = MEM_U32(t1 + 36); +gp = MEM_U32(sp + 52); +t0 = MEM_U32(sp + 252); +s0 = fp; +t2 = t2 + s1; +t3 = t3 + s1; +v1 = t7 + s7; +L45d9e4: +s3 = s3 + 0x4; +at = v1 < s3; +if (at == 0) {//nop; +goto L45d8b8;} +//nop; +t8 = MEM_U32(sp + 392); +//nop; +s1 = MEM_U16(t8 + 42); +//nop; +L45da04: +t4 = MEM_U32(sp + 264); +L45da08: +t5 = MEM_U32(sp + 88); +t9 = t4 + 0x1; +at = t9 < s1; +t6 = t5 + 0x34; +MEM_U32(sp + 88) = t6; +if (at != 0) {MEM_U32(sp + 264) = t9; +goto L45d7bc;} +MEM_U32(sp + 264) = t9; +t8 = MEM_U32(sp + 392); +L45da28: +//nop; +MEM_U32(t8 + 68) = t2; +L45da30: +v0 = MEM_U32(sp + 280); +t4 = MEM_U32(sp + 276); +v0 = v0 + 0x1; +if (v0 != t4) {MEM_U32(sp + 280) = v0; +goto L45d754;} +MEM_U32(sp + 280) = v0; +t9 = MEM_U32(sp + 300); +L45da48: +s0 = -t3; +if (t9 == 0) {t5 = s0 & 0x3; +goto L45dac8;} +t5 = s0 & 0x3; +if (t5 == 0) {s0 = t5; +goto L45dabc;} +s0 = t5; +a0 = 0x10018c80; +//nop; +a3 = MEM_U32(sp + 268); +a1 = 0x1; +a2 = t5; +MEM_U32(sp + 288) = t3; +a0 = a0; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45da7c; +a0 = a0; +L45da7c: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +if (v0 == s0) {//nop; +goto L45daac;} +//nop; +a0 = 0x1000e4b0; +//nop; +MEM_U32(sp + 288) = t3; +a0 = a0; +f_st_error(mem, sp, a0, a1, a2); +goto L45daa0; +a0 = a0; +L45daa0: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +//nop; +L45daac: +t3 = t3 + 0x3; +at = 0xfffffffc; +t6 = t3 & at; +t3 = t6; +L45dabc: +t7 = MEM_U32(sp + 284); +MEM_U32(sp + 304) = t3; +MEM_U32(sp + 308) = t7; +L45dac8: +t8 = MEM_U32(sp + 476); +L45dacc: +//nop; +t4 = t8 & 0x100; +if (t4 == 0) {t5 = MEM_U32(sp + 476); +goto L45dbec;} +t5 = MEM_U32(sp + 476); +t9 = MEM_U32(sp + 284); +t6 = MEM_U32(sp + 276); +t5 = t9 + t3; +MEM_U32(sp + 284) = t5; +if ((int)t6 <= 0) {t3 = zero; +goto L45dbd4;} +t3 = zero; +s2 = 0x10006294; +MEM_U32(sp + 280) = zero; +s0 = 0x34; +L45db00: +//nop; +a0 = MEM_U32(sp + 280); +MEM_U32(sp + 288) = t3; +v0 = f_st_pcfd_ifd(mem, sp, a0, a1, a2, a3); +goto L45db10; +MEM_U32(sp + 288) = t3; +L45db10: +t7 = MEM_U32(v0 + 0); +t8 = MEM_U16(sp + 436); +MEM_U32(sp + 392) = t7; +s1 = MEM_U16(t7 + 42); +t4 = MEM_U16(sp + 438); +lo = s1 * s0; +hi = (uint32_t)((uint64_t)s1 * (uint64_t)s0 >> 32); +t3 = MEM_U32(sp + 288); +gp = MEM_U32(sp + 52); +t9 = t8 + t4; +MEM_U16(t7 + 40) = (uint16_t)t9; +a3 = MEM_U32(sp + 268); +a1 = s0; +a2 = s1; +a0 = lo; +t3 = t3 + a0; +if (s1 == 0) {t8 = MEM_U16(sp + 436); +goto L45db9c;} +t8 = MEM_U16(sp + 436); +//nop; +a0 = MEM_U32(v0 + 52); +MEM_U32(sp + 288) = t3; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45db64; +MEM_U32(sp + 288) = t3; +L45db64: +t6 = MEM_U32(sp + 392); +gp = MEM_U32(sp + 52); +t7 = MEM_U16(t6 + 42); +t3 = MEM_U32(sp + 288); +if (v0 == t7) {t8 = MEM_U16(sp + 436); +goto L45db9c;} +t8 = MEM_U16(sp + 436); +//nop; +a0 = s2; +MEM_U32(sp + 288) = t3; +f_st_error(mem, sp, a0, a1, a2); +goto L45db8c; +MEM_U32(sp + 288) = t3; +L45db8c: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +//nop; +t8 = MEM_U16(sp + 436); +L45db9c: +t4 = MEM_U16(sp + 438); +t5 = MEM_U32(sp + 392); +t9 = t8 + t4; +MEM_U16(sp + 436) = (uint16_t)t9; +v0 = MEM_U16(t5 + 42); +v1 = MEM_U32(sp + 280); +t6 = MEM_U32(sp + 320); +t8 = MEM_U32(sp + 276); +v1 = v1 + 0x1; +t7 = t6 + v0; +MEM_U32(sp + 320) = t7; +MEM_U32(sp + 280) = v1; +if (v1 != t8) {MEM_U16(sp + 438) = (uint16_t)v0; +goto L45db00;} +MEM_U16(sp + 438) = (uint16_t)v0; +L45dbd4: +t4 = MEM_U32(sp + 320); +t9 = MEM_U32(sp + 284); +if (t4 == 0) {t5 = MEM_U32(sp + 476); +goto L45dbec;} +t5 = MEM_U32(sp + 476); +MEM_U32(sp + 324) = t9; +t5 = MEM_U32(sp + 476); +L45dbec: +s2 = 0x10006294; +t6 = t5 & 0x2; +if (t6 == 0) {t9 = MEM_U32(sp + 476); +goto L45dd04;} +t9 = MEM_U32(sp + 476); +t7 = MEM_U32(sp + 284); +t4 = MEM_U32(sp + 276); +t8 = t7 + t3; +MEM_U32(sp + 284) = t8; +if ((int)t4 <= 0) {t3 = zero; +goto L45dcec;} +t3 = zero; +MEM_U32(sp + 280) = zero; +s0 = 0xc; +L45dc1c: +//nop; +a0 = MEM_U32(sp + 280); +MEM_U32(sp + 288) = t3; +v0 = f_st_pcfd_ifd(mem, sp, a0, a1, a2, a3); +goto L45dc2c; +MEM_U32(sp + 288) = t3; +L45dc2c: +t9 = MEM_U32(v0 + 0); +t5 = MEM_U32(sp + 412); +MEM_U32(sp + 392) = t9; +a2 = MEM_U32(t9 + 20); +t6 = MEM_U32(sp + 416); +lo = a2 * s0; +hi = (uint32_t)((uint64_t)a2 * (uint64_t)s0 >> 32); +t3 = MEM_U32(sp + 288); +gp = MEM_U32(sp + 52); +t7 = t5 + t6; +MEM_U32(t9 + 16) = t7; +a3 = MEM_U32(sp + 268); +a1 = s0; +a0 = lo; +t3 = t3 + a0; +if (a2 == 0) {t5 = MEM_U32(sp + 412); +goto L45dcb4;} +t5 = MEM_U32(sp + 412); +//nop; +a0 = MEM_U32(v0 + 4); +MEM_U32(sp + 288) = t3; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45dc7c; +MEM_U32(sp + 288) = t3; +L45dc7c: +t4 = MEM_U32(sp + 392); +gp = MEM_U32(sp + 52); +t9 = MEM_U32(t4 + 20); +t3 = MEM_U32(sp + 288); +if (v0 == t9) {t5 = MEM_U32(sp + 412); +goto L45dcb4;} +t5 = MEM_U32(sp + 412); +//nop; +a0 = s2; +MEM_U32(sp + 288) = t3; +f_st_error(mem, sp, a0, a1, a2); +goto L45dca4; +MEM_U32(sp + 288) = t3; +L45dca4: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +//nop; +t5 = MEM_U32(sp + 412); +L45dcb4: +t6 = MEM_U32(sp + 416); +t8 = MEM_U32(sp + 392); +t7 = t5 + t6; +MEM_U32(sp + 412) = t7; +a0 = MEM_U32(t8 + 20); +t5 = MEM_U32(sp + 280); +t4 = MEM_U32(sp + 328); +t7 = MEM_U32(sp + 276); +t6 = t5 + 0x1; +t9 = t4 + a0; +MEM_U32(sp + 328) = t9; +MEM_U32(sp + 280) = t6; +if (t6 != t7) {MEM_U32(sp + 416) = a0; +goto L45dc1c;} +MEM_U32(sp + 416) = a0; +L45dcec: +t8 = MEM_U32(sp + 328); +t4 = MEM_U32(sp + 284); +if (t8 == 0) {t9 = MEM_U32(sp + 476); +goto L45dd04;} +t9 = MEM_U32(sp + 476); +MEM_U32(sp + 332) = t4; +t9 = MEM_U32(sp + 476); +L45dd04: +s0 = 0xc; +t5 = t9 & 0x20; +if (t5 == 0) {t4 = MEM_U32(sp + 476); +goto L45de18;} +t4 = MEM_U32(sp + 476); +t6 = MEM_U32(sp + 284); +t8 = MEM_U32(sp + 276); +t7 = t6 + t3; +MEM_U32(sp + 284) = t7; +if ((int)t8 <= 0) {t3 = zero; +goto L45de00;} +t3 = zero; +MEM_U32(sp + 280) = zero; +L45dd30: +//nop; +a0 = MEM_U32(sp + 280); +MEM_U32(sp + 288) = t3; +v0 = f_st_pcfd_ifd(mem, sp, a0, a1, a2, a3); +goto L45dd40; +MEM_U32(sp + 288) = t3; +L45dd40: +t4 = MEM_U32(v0 + 0); +t9 = MEM_U32(sp + 428); +MEM_U32(sp + 392) = t4; +a2 = MEM_U32(t4 + 36); +t5 = MEM_U32(sp + 432); +lo = a2 * s0; +hi = (uint32_t)((uint64_t)a2 * (uint64_t)s0 >> 32); +t3 = MEM_U32(sp + 288); +gp = MEM_U32(sp + 52); +t6 = t9 + t5; +MEM_U32(t4 + 32) = t6; +a3 = MEM_U32(sp + 268); +a1 = s0; +a0 = lo; +t3 = t3 + a0; +if (a2 == 0) {t9 = MEM_U32(sp + 428); +goto L45ddc8;} +t9 = MEM_U32(sp + 428); +//nop; +a0 = MEM_U32(v0 + 28); +MEM_U32(sp + 288) = t3; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45dd90; +MEM_U32(sp + 288) = t3; +L45dd90: +t8 = MEM_U32(sp + 392); +gp = MEM_U32(sp + 52); +t4 = MEM_U32(t8 + 36); +t3 = MEM_U32(sp + 288); +if (v0 == t4) {t9 = MEM_U32(sp + 428); +goto L45ddc8;} +t9 = MEM_U32(sp + 428); +//nop; +a0 = s2; +MEM_U32(sp + 288) = t3; +f_st_error(mem, sp, a0, a1, a2); +goto L45ddb8; +MEM_U32(sp + 288) = t3; +L45ddb8: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +//nop; +t9 = MEM_U32(sp + 428); +L45ddc8: +t5 = MEM_U32(sp + 432); +t7 = MEM_U32(sp + 392); +t6 = t9 + t5; +MEM_U32(sp + 428) = t6; +a0 = MEM_U32(t7 + 36); +t9 = MEM_U32(sp + 280); +t8 = MEM_U32(sp + 336); +t6 = MEM_U32(sp + 276); +t5 = t9 + 0x1; +t4 = t8 + a0; +MEM_U32(sp + 336) = t4; +MEM_U32(sp + 280) = t5; +if (t5 != t6) {MEM_U32(sp + 432) = a0; +goto L45dd30;} +MEM_U32(sp + 432) = a0; +L45de00: +t7 = MEM_U32(sp + 336); +t8 = MEM_U32(sp + 284); +if (t7 == 0) {t4 = MEM_U32(sp + 476); +goto L45de18;} +t4 = MEM_U32(sp + 476); +MEM_U32(sp + 340) = t8; +t4 = MEM_U32(sp + 476); +L45de18: +//nop; +t9 = t4 & 0x400; +if (t9 == 0) {t8 = MEM_U32(sp + 476); +goto L45df24;} +t8 = MEM_U32(sp + 476); +t5 = MEM_U32(sp + 284); +t7 = MEM_U32(sp + 276); +t6 = t5 + t3; +MEM_U32(sp + 284) = t6; +if ((int)t7 <= 0) {t3 = zero; +goto L45df0c;} +t3 = zero; +MEM_U32(sp + 280) = zero; +L45de44: +//nop; +a0 = MEM_U32(sp + 280); +MEM_U32(sp + 288) = t3; +v0 = f_st_pcfd_ifd(mem, sp, a0, a1, a2, a3); +goto L45de54; +MEM_U32(sp + 288) = t3; +L45de54: +t8 = MEM_U32(v0 + 0); +t4 = MEM_U32(sp + 440); +MEM_U32(sp + 392) = t8; +t9 = MEM_U32(sp + 444); +a2 = MEM_U32(t8 + 48); +t3 = MEM_U32(sp + 288); +gp = MEM_U32(sp + 52); +t5 = t4 + t9; +a0 = a2 << 2; +MEM_U32(t8 + 44) = t5; +if (a2 == 0) {t3 = t3 + a0; +goto L45ded0;} +t3 = t3 + a0; +//nop; +a0 = MEM_U32(v0 + 12); +a3 = MEM_U32(sp + 268); +MEM_U32(sp + 288) = t3; +a1 = 0x4; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45de9c; +a1 = 0x4; +L45de9c: +t7 = MEM_U32(sp + 392); +gp = MEM_U32(sp + 52); +t8 = MEM_U32(t7 + 48); +t3 = MEM_U32(sp + 288); +if (v0 == t8) {t4 = MEM_U32(sp + 440); +goto L45ded4;} +t4 = MEM_U32(sp + 440); +//nop; +a0 = s2; +MEM_U32(sp + 288) = t3; +f_st_error(mem, sp, a0, a1, a2); +goto L45dec4; +MEM_U32(sp + 288) = t3; +L45dec4: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +//nop; +L45ded0: +t4 = MEM_U32(sp + 440); +L45ded4: +t9 = MEM_U32(sp + 444); +t6 = MEM_U32(sp + 392); +t5 = t4 + t9; +MEM_U32(sp + 440) = t5; +a0 = MEM_U32(t6 + 48); +t4 = MEM_U32(sp + 280); +t7 = MEM_U32(sp + 344); +t5 = MEM_U32(sp + 276); +t9 = t4 + 0x1; +t8 = t7 + a0; +MEM_U32(sp + 344) = t8; +MEM_U32(sp + 280) = t9; +if (t9 != t5) {MEM_U32(sp + 444) = a0; +goto L45de44;} +MEM_U32(sp + 444) = a0; +L45df0c: +t6 = MEM_U32(sp + 344); +t7 = MEM_U32(sp + 284); +if (t6 == 0) {t8 = MEM_U32(sp + 476); +goto L45df24;} +t8 = MEM_U32(sp + 476); +MEM_U32(sp + 348) = t7; +t8 = MEM_U32(sp + 476); +L45df24: +//nop; +t4 = t8 & 0x80; +if (t4 == 0) {t8 = MEM_U32(sp + 476); +goto L45e09c;} +t8 = MEM_U32(sp + 476); +t9 = MEM_U32(sp + 284); +t6 = MEM_U32(sp + 276); +t5 = t9 + t3; +MEM_U32(sp + 284) = t5; +if ((int)t6 <= 0) {t3 = zero; +goto L45e014;} +t3 = zero; +MEM_U32(sp + 280) = zero; +L45df50: +//nop; +a0 = MEM_U32(sp + 280); +MEM_U32(sp + 288) = t3; +v0 = f_st_pcfd_ifd(mem, sp, a0, a1, a2, a3); +goto L45df60; +MEM_U32(sp + 288) = t3; +L45df60: +t7 = MEM_U32(v0 + 0); +t8 = MEM_U32(sp + 404); +t4 = MEM_U32(sp + 408); +MEM_U32(sp + 392) = t7; +t3 = MEM_U32(sp + 288); +a2 = MEM_U32(t7 + 12); +gp = MEM_U32(sp + 52); +t9 = t8 + t4; +MEM_U32(t7 + 8) = t9; +if (a2 == 0) {t3 = t3 + a2; +goto L45dfd8;} +t3 = t3 + a2; +//nop; +a0 = MEM_U32(v0 + 20); +a3 = MEM_U32(sp + 268); +MEM_U32(sp + 288) = t3; +a1 = 0x1; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45dfa4; +a1 = 0x1; +L45dfa4: +t6 = MEM_U32(sp + 392); +gp = MEM_U32(sp + 52); +t7 = MEM_U32(t6 + 12); +t3 = MEM_U32(sp + 288); +if (v0 == t7) {t8 = MEM_U32(sp + 404); +goto L45dfdc;} +t8 = MEM_U32(sp + 404); +//nop; +a0 = s2; +MEM_U32(sp + 288) = t3; +f_st_error(mem, sp, a0, a1, a2); +goto L45dfcc; +MEM_U32(sp + 288) = t3; +L45dfcc: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +//nop; +L45dfd8: +t8 = MEM_U32(sp + 404); +L45dfdc: +t4 = MEM_U32(sp + 408); +t5 = MEM_U32(sp + 392); +t9 = t8 + t4; +MEM_U32(sp + 404) = t9; +a0 = MEM_U32(t5 + 12); +t8 = MEM_U32(sp + 280); +t6 = MEM_U32(sp + 352); +t9 = MEM_U32(sp + 276); +t4 = t8 + 0x1; +t7 = t6 + a0; +MEM_U32(sp + 352) = t7; +MEM_U32(sp + 280) = t4; +if (t4 != t9) {MEM_U32(sp + 408) = a0; +goto L45df50;} +MEM_U32(sp + 408) = a0; +L45e014: +s0 = -t3; +t5 = s0 & 0x3; +if (t5 == 0) {s0 = t5; +goto L45e084;} +s0 = t5; +a0 = 0x10018c80; +//nop; +a3 = MEM_U32(sp + 268); +a1 = 0x1; +a2 = t5; +MEM_U32(sp + 288) = t3; +a0 = a0; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45e044; +a0 = a0; +L45e044: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +if (v0 == s0) {//nop; +goto L45e074;} +//nop; +a0 = 0x1000e4d4; +//nop; +MEM_U32(sp + 288) = t3; +a0 = a0; +f_st_error(mem, sp, a0, a1, a2); +goto L45e068; +a0 = a0; +L45e068: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +//nop; +L45e074: +t3 = t3 + 0x3; +at = 0xfffffffc; +t6 = t3 & at; +t3 = t6; +L45e084: +if (t3 == 0) {MEM_U32(sp + 352) = t3; +goto L45e098;} +MEM_U32(sp + 352) = t3; +t7 = MEM_U32(sp + 284); +//nop; +MEM_U32(sp + 356) = t7; +L45e098: +t8 = MEM_U32(sp + 476); +L45e09c: +//nop; +t4 = t8 & 0x800; +if (t4 == 0) {t7 = MEM_U32(sp + 476); +goto L45e1b8;} +t7 = MEM_U32(sp + 476); +t0 = 0x1001b288; +t5 = MEM_U32(sp + 284); +v0 = MEM_U32(t0 + 0); +t6 = t5 + t3; +t9 = MEM_U32(v0 + 40); +MEM_U32(sp + 284) = t6; +t3 = zero; +if (t9 == 0) {MEM_U32(sp + 360) = t9; +goto L45e140;} +MEM_U32(sp + 360) = t9; +t3 = MEM_U32(v0 + 40); +MEM_U32(sp + 364) = t6; +v1 = MEM_U32(v0 + 40); +a1 = 0x1; +if (v1 == 0) {a2 = v1; +goto L45e140;} +a2 = v1; +//nop; +a0 = MEM_U32(v0 + 36); +a3 = MEM_U32(sp + 268); +MEM_U32(sp + 288) = t3; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45e0fc; +MEM_U32(sp + 288) = t3; +L45e0fc: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +t8 = 0x1001b288; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +t4 = MEM_U32(t8 + 40); +//nop; +if (v0 == t4) {s0 = -t3; +goto L45e144;} +s0 = -t3; +//nop; +a0 = 0x100062a8; +MEM_U32(sp + 288) = t3; +f_st_error(mem, sp, a0, a1, a2); +goto L45e134; +MEM_U32(sp + 288) = t3; +L45e134: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +//nop; +L45e140: +s0 = -t3; +L45e144: +t9 = s0 & 0x3; +if (t9 == 0) {s0 = t9; +goto L45e1b0;} +s0 = t9; +a2 = t9; +//nop; +a0 = 0x10018c80; +a3 = MEM_U32(sp + 268); +a1 = 0x1; +MEM_U32(sp + 288) = t3; +a0 = a0; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45e170; +a0 = a0; +L45e170: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +if (v0 == s0) {//nop; +goto L45e1a0;} +//nop; +a0 = 0x1000e4fc; +//nop; +MEM_U32(sp + 288) = t3; +a0 = a0; +f_st_error(mem, sp, a0, a1, a2); +goto L45e194; +a0 = a0; +L45e194: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +//nop; +L45e1a0: +t3 = t3 + 0x3; +at = 0xfffffffc; +t5 = t3 & at; +t3 = t5; +L45e1b0: +MEM_U32(sp + 360) = t3; +t7 = MEM_U32(sp + 476); +L45e1b8: +t0 = 0x1001b288; +s1 = 0x100062a8; +t6 = t7 & 0x200; +if (t6 == 0) {t4 = MEM_U32(sp + 476); +goto L45e278;} +t4 = MEM_U32(sp + 476); +v0 = MEM_U32(t0 + 0); +t4 = MEM_U32(sp + 284); +t8 = MEM_U32(v0 + 12); +t9 = t4 + t3; +MEM_U32(sp + 284) = t9; +t3 = zero; +if (t8 == 0) {MEM_U32(sp + 368) = t8; +goto L45e26c;} +MEM_U32(sp + 368) = t8; +t3 = MEM_U32(v0 + 12); +MEM_U32(sp + 372) = t9; +t7 = t3 << 3; +v1 = MEM_U32(v0 + 12); +t7 = t7 + t3; +t7 = t7 << 3; +if (v1 == 0) {t3 = t7; +goto L45e26c;} +t3 = t7; +//nop; +a0 = MEM_U32(v0 + 8); +a3 = MEM_U32(sp + 268); +MEM_U32(sp + 288) = t7; +a1 = 0x48; +a2 = v1; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45e228; +a2 = v1; +L45e228: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +t6 = 0x1001b288; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +t8 = MEM_U32(t6 + 12); +//nop; +if (v0 == t8) {//nop; +goto L45e26c;} +//nop; +//nop; +a0 = s1; +MEM_U32(sp + 288) = t3; +f_st_error(mem, sp, a0, a1, a2); +goto L45e260; +MEM_U32(sp + 288) = t3; +L45e260: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +//nop; +L45e26c: +t0 = 0x1001b288; +//nop; +t4 = MEM_U32(sp + 476); +L45e278: +t7 = MEM_U32(sp + 284); +t5 = t4 & 0x40; +if (t5 == 0) {t9 = t7 + t3; +goto L45e380;} +t9 = t7 + t3; +t6 = MEM_U32(sp + 276); +MEM_U32(sp + 284) = t9; +if ((int)t6 <= 0) {t3 = zero; +goto L45e36c;} +t3 = zero; +MEM_U32(sp + 280) = zero; +L45e29c: +//nop; +a0 = MEM_U32(sp + 280); +MEM_U32(sp + 288) = t3; +v0 = f_st_pcfd_ifd(mem, sp, a0, a1, a2, a3); +goto L45e2ac; +MEM_U32(sp + 288) = t3; +L45e2ac: +t8 = MEM_U32(v0 + 0); +t4 = MEM_U32(sp + 448); +MEM_U32(sp + 392) = t8; +t5 = MEM_U32(sp + 452); +a2 = MEM_U32(t8 + 56); +t3 = MEM_U32(sp + 288); +gp = MEM_U32(sp + 52); +t7 = t4 + t5; +a0 = a2 << 2; +MEM_U32(t8 + 52) = t7; +if (a2 == 0) {t3 = t3 + a0; +goto L45e328;} +t3 = t3 + a0; +//nop; +a0 = MEM_U32(v0 + 44); +a3 = MEM_U32(sp + 268); +MEM_U32(sp + 288) = t3; +a1 = 0x4; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45e2f4; +a1 = 0x4; +L45e2f4: +t6 = MEM_U32(sp + 392); +gp = MEM_U32(sp + 52); +t8 = MEM_U32(t6 + 56); +t3 = MEM_U32(sp + 288); +if (v0 == t8) {t4 = MEM_U32(sp + 448); +goto L45e32c;} +t4 = MEM_U32(sp + 448); +//nop; +a0 = s2; +MEM_U32(sp + 288) = t3; +f_st_error(mem, sp, a0, a1, a2); +goto L45e31c; +MEM_U32(sp + 288) = t3; +L45e31c: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +//nop; +L45e328: +t4 = MEM_U32(sp + 448); +L45e32c: +t5 = MEM_U32(sp + 452); +t9 = MEM_U32(sp + 392); +t7 = t4 + t5; +MEM_U32(sp + 448) = t7; +a0 = MEM_U32(t9 + 56); +t4 = MEM_U32(sp + 280); +t6 = MEM_U32(sp + 376); +t7 = MEM_U32(sp + 276); +t5 = t4 + 0x1; +t8 = t6 + a0; +MEM_U32(sp + 376) = t8; +MEM_U32(sp + 280) = t5; +if (t5 != t7) {MEM_U32(sp + 452) = a0; +goto L45e29c;} +MEM_U32(sp + 452) = a0; +t0 = 0x1001b288; +//nop; +L45e36c: +t9 = MEM_U32(sp + 376); +t6 = MEM_U32(sp + 284); +if (t9 == 0) {t8 = MEM_U32(sp + 476); +goto L45e384;} +t8 = MEM_U32(sp + 476); +MEM_U32(sp + 380) = t6; +L45e380: +t8 = MEM_U32(sp + 476); +L45e384: +//nop; +t4 = t8 & 0x1; +if (t4 == 0) {t7 = MEM_U32(sp + 476); +goto L45e438;} +t7 = MEM_U32(sp + 476); +v0 = MEM_U32(t0 + 0); +t7 = MEM_U32(sp + 284); +t5 = MEM_U32(v0 + 28); +t9 = t7 + t3; +MEM_U32(sp + 284) = t9; +t3 = zero; +if (t5 == 0) {MEM_U32(sp + 384) = t5; +goto L45e42c;} +MEM_U32(sp + 384) = t5; +t3 = MEM_U32(v0 + 28); +MEM_U32(sp + 388) = t9; +v1 = MEM_U32(v0 + 28); +t8 = t3 << 4; +if (v1 == 0) {t3 = t8; +goto L45e42c;} +t3 = t8; +//nop; +a0 = MEM_U32(v0 + 24); +a3 = MEM_U32(sp + 268); +MEM_U32(sp + 288) = t8; +a1 = 0x10; +a2 = v1; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45e3e8; +a2 = v1; +L45e3e8: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +t4 = 0x1001b288; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +t5 = MEM_U32(t4 + 28); +//nop; +if (v0 == t5) {//nop; +goto L45e42c;} +//nop; +//nop; +a0 = s1; +MEM_U32(sp + 288) = t3; +f_st_error(mem, sp, a0, a1, a2); +goto L45e420; +MEM_U32(sp + 288) = t3; +L45e420: +gp = MEM_U32(sp + 52); +t3 = MEM_U32(sp + 288); +//nop; +L45e42c: +t0 = 0x1001b288; +//nop; +t7 = MEM_U32(sp + 476); +L45e438: +//nop; +t6 = t7 & 0x10; +if (t6 == 0) {//nop; +goto L45e528;} +//nop; +v0 = MEM_U32(t0 + 0); +//nop; +t8 = MEM_U32(v0 + 60); +//nop; +if (t8 == 0) {//nop; +goto L45e528;} +//nop; +t9 = MEM_U32(v0 + 56); +//nop; +MEM_U32(t9 + 0) = zero; +t4 = MEM_U32(t0 + 0); +//nop; +t5 = MEM_U32(t4 + 56); +//nop; +MEM_U32(t5 + 4) = zero; +t7 = MEM_U32(t0 + 0); +//nop; +t6 = MEM_U32(t7 + 56); +//nop; +MEM_U32(t6 + 8) = zero; +t8 = MEM_U32(t0 + 0); +//nop; +t9 = MEM_U32(t8 + 56); +//nop; +MEM_U32(t9 + 12) = zero; +v0 = MEM_U32(t0 + 0); +t5 = MEM_U32(sp + 284); +t4 = MEM_U32(v0 + 60); +t7 = t5 + t3; +MEM_U32(sp + 284) = t7; +if (t4 == 0) {MEM_U32(sp + 312) = t4; +goto L45e528;} +MEM_U32(sp + 312) = t4; +MEM_U32(sp + 316) = t7; +v1 = MEM_U32(v0 + 60); +a3 = MEM_U32(sp + 268); +if (v1 == 0) {a1 = 0x8; +goto L45e528;} +a1 = 0x8; +//nop; +a0 = MEM_U32(v0 + 56); +a2 = v1; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45e4e8; +a2 = v1; +L45e4e8: +gp = MEM_U32(sp + 52); +//nop; +t8 = 0x1001b288; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +t9 = MEM_U32(t8 + 60); +//nop; +if (v0 == t9) {//nop; +goto L45e528;} +//nop; +//nop; +a0 = s1; +//nop; +f_st_error(mem, sp, a0, a1, a2); +goto L45e520; +//nop; +L45e520: +gp = MEM_U32(sp + 52); +//nop; +L45e528: +//nop; +a0 = MEM_U32(sp + 268); +//nop; +v0 = wrapper_fflush(mem, a0); +goto L45e538; +//nop; +L45e538: +gp = MEM_U32(sp + 52); +a0 = MEM_U32(sp + 268); +//nop; +a1 = MEM_U32(sp + 272); +a2 = zero; +v0 = wrapper_fseek(mem, a0, a1, a2); +goto L45e550; +a2 = zero; +L45e550: +gp = MEM_U32(sp + 52); +t4 = 0x313; +t5 = 0x10006290; +//nop; +t5 = MEM_S16(t5 + 0); +a3 = MEM_U32(sp + 268); +MEM_U16(sp + 298) = (uint16_t)t4; +a0 = sp + 0x128; +a1 = 0x1; +a2 = 0x60; +MEM_U16(sp + 296) = (uint16_t)t5; +v0 = wrapper_fwrite(mem, a0, a1, a2, a3); +goto L45e580; +MEM_U16(sp + 296) = (uint16_t)t5; +L45e580: +gp = MEM_U32(sp + 52); +at = 0x60; +if (v0 == at) {//nop; +goto L45e5ac;} +//nop; +a0 = 0x1000e524; +//nop; +a0 = a0; +//nop; +f_st_error(mem, sp, a0, a1, a2); +goto L45e5a4; +//nop; +L45e5a4: +gp = MEM_U32(sp + 52); +//nop; +L45e5ac: +//nop; +a0 = MEM_U32(sp + 268); +//nop; +v0 = wrapper_fclose(mem, a0); +goto L45e5bc; +//nop; +L45e5bc: +ra = MEM_U32(sp + 60); +gp = MEM_U32(sp + 52); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +s3 = MEM_U32(sp + 32); +s4 = MEM_U32(sp + 36); +s5 = MEM_U32(sp + 40); +s6 = MEM_U32(sp + 44); +s7 = MEM_U32(sp + 48); +fp = MEM_U32(sp + 56); +sp = sp + 0x1d8; +return; +sp = sp + 0x1d8; +} + +static uint32_t f_st_currentifd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L45e610: +//st_currentifd: +//nop; +//nop; +//nop; +a0 = 0x1001b28c; +sp = sp + 0xffffffe0; +a0 = MEM_U32(a0 + 0); +MEM_U32(sp + 28) = ra; +if (a0 != 0) {MEM_U32(sp + 24) = gp; +goto L45e63c;} +MEM_U32(sp + 24) = gp; +v0 = 0xffffffff; +goto L45e654; +v0 = 0xffffffff; +L45e63c: +//nop; +//nop; +//nop; +v0 = f_st_ifd_pcfd(mem, sp, a0, a1, a2); +goto L45e64c; +//nop; +L45e64c: +gp = MEM_U32(sp + 24); +//nop; +L45e654: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return v0; +//nop; +} + +static uint32_t f_st_ifdmax(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L45e664: +//st_ifdmax: +//nop; +//nop; +//nop; +t6 = 0x1001b288; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +v0 = MEM_U32(t6 + 12); +//nop; +return v0; +//nop; +} + +static void f_st_setfd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L45e68c: +//st_setfd: +//nop; +//nop; +//nop; +t6 = 0x1001b288; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +v0 = MEM_U32(t6 + 4); +//nop; +if (v0 != 0) {t8 = MEM_U32(sp + 32); +goto L45e6f8;} +t8 = MEM_U32(sp + 32); +a0 = 0x100062c0; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45e6d4; +//nop; +L45e6d4: +gp = MEM_U32(sp + 24); +//nop; +t7 = 0x1001b288; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +v0 = MEM_U32(t7 + 4); +//nop; +t8 = MEM_U32(sp + 32); +L45e6f8: +at = 0x1001b28c; +ra = MEM_U32(sp + 28); +t9 = t8 << 6; +t0 = v0 + t9; +sp = sp + 0x20; +MEM_U32(at + 0) = t0; +return; +MEM_U32(at + 0) = t0; +} + +static void f_st_fdadd(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L45e714: +//st_fdadd: +//nop; +//nop; +//nop; +sp = sp + 0xffffff10; +t2 = 0x1001b288; +MEM_U32(sp + 28) = ra; +t0 = MEM_U32(t2 + 0); +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 240) = a0; +MEM_U32(sp + 244) = a1; +MEM_U32(sp + 248) = a2; +MEM_U32(sp + 252) = a3; +t6 = MEM_U32(t0 + 12); +at = 0x7fff0000; +at = at | 0xffff; +at = (int)t6 < (int)at; +if (at != 0) {MEM_U32(sp + 40) = t6; +goto L45e79c;} +MEM_U32(sp + 40) = t6; +a0 = 0x1000e540; +//nop; +a2 = 0x7fff0000; +a2 = a2 | 0xffff; +a1 = t6; +a0 = a0; +f_st_error(mem, sp, a0, a1, a2); +goto L45e778; +a0 = a0; +L45e778: +gp = MEM_U32(sp + 24); +//nop; +t2 = 0x1001b288; +//nop; +t0 = MEM_U32(t2 + 0); +//nop; +t8 = MEM_U32(t0 + 12); +//nop; +MEM_U32(sp + 40) = t8; +L45e79c: +v0 = MEM_U32(t0 + 16); +t9 = MEM_U32(sp + 40); +a1 = t0 + 0x10; +at = (int)t9 < (int)v0; +if (at != 0) {a2 = 0x40; +goto L45e89c;} +a2 = 0x40; +//nop; +MEM_U32(sp + 236) = v0; +a0 = MEM_U32(t0 + 4); +MEM_U32(sp + 232) = v0; +a3 = 0x19; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45e7cc; +a3 = 0x19; +L45e7cc: +gp = MEM_U32(sp + 24); +a1 = sp + 0xec; +t2 = 0x1001b288; +a2 = 0x48; +t3 = MEM_U32(t2 + 0); +a3 = 0x19; +MEM_U32(t3 + 4) = v0; +t4 = MEM_U32(t2 + 0); +//nop; +a0 = MEM_U32(t4 + 8); +//nop; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45e7fc; +//nop; +L45e7fc: +gp = MEM_U32(sp + 24); +t1 = MEM_U32(sp + 232); +t2 = 0x1001b288; +//nop; +t5 = MEM_U32(t2 + 0); +//nop; +MEM_U32(t5 + 8) = v0; +t6 = MEM_U32(t2 + 0); +t7 = MEM_U32(sp + 236); +a2 = MEM_U32(t6 + 16); +a3 = MEM_U32(sp + 240); +if (t7 == a2) {a1 = t7; +goto L45e854;} +a1 = t7; +a0 = 0x1000e574; +//nop; +MEM_U32(sp + 232) = t1; +a0 = a0; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45e844; +a0 = a0; +L45e844: +gp = MEM_U32(sp + 24); +t1 = MEM_U32(sp + 232); +t2 = 0x1001b288; +//nop; +L45e854: +a0 = t1; +if (t1 == 0) {t1 = t1 + 0xffffffff; +goto L45e89c;} +t1 = t1 + 0xffffffff; +v1 = t1 << 3; +v1 = v1 + t1; +v1 = v1 << 3; +v0 = t1 << 6; +L45e870: +t0 = MEM_U32(t2 + 0); +a0 = t1; +t8 = MEM_U32(t0 + 8); +t3 = MEM_U32(t0 + 4); +t9 = t8 + v1; +t4 = t3 + v0; +MEM_U32(t4 + 0) = t9; +v0 = v0 + 0xffffffc0; +v1 = v1 + 0xffffffb8; +if (t1 != 0) {t1 = t1 + 0xffffffff; +goto L45e870;} +t1 = t1 + 0xffffffff; +L45e89c: +t0 = MEM_U32(t2 + 0); +t9 = 0x10018cd8; +t6 = MEM_U32(t0 + 12); +t5 = MEM_U32(t0 + 4); +a1 = 0x1001b28c; +t7 = t6 << 6; +t9 = t9; +t3 = t5 + t7; +t6 = t9 + 0x3c; +MEM_U32(a1 + 0) = t3; +L45e8c4: +at = MEM_U32(t9 + 0); +t9 = t9 + 0xc; +MEM_U32(t3 + 0) = at; +at = MEM_U32(t9 + -8); +t3 = t3 + 0xc; +MEM_U32(t3 + -8) = at; +at = MEM_U32(t9 + -4); +if (t9 != t6) {MEM_U32(t3 + -4) = at; +goto L45e8c4;} +MEM_U32(t3 + -4) = at; +at = MEM_U32(t9 + 0); +//nop; +MEM_U32(t3 + 0) = at; +t0 = MEM_U32(t2 + 0); +t6 = MEM_U32(a1 + 0); +t5 = MEM_U32(t0 + 12); +t8 = MEM_U32(t0 + 8); +t7 = t5 << 3; +t7 = t7 + t5; +t7 = t7 << 3; +t4 = t7 + t8; +MEM_U32(t6 + 0) = t4; +t0 = MEM_U32(t2 + 0); +t8 = 0x10018c90; +t9 = MEM_U32(t0 + 12); +t8 = t8; +t3 = t9 + 0x1; +MEM_U32(t0 + 12) = t3; +t5 = MEM_U32(a1 + 0); +t6 = t8 + 0x48; +t7 = MEM_U32(t5 + 0); +//nop; +L45e940: +at = MEM_U32(t8 + 0); +t8 = t8 + 0xc; +MEM_U32(t7 + 0) = at; +at = MEM_U32(t8 + -8); +t7 = t7 + 0xc; +MEM_U32(t7 + -8) = at; +at = MEM_U32(t8 + -4); +if (t8 != t6) {MEM_U32(t7 + -4) = at; +goto L45e940;} +MEM_U32(t7 + -4) = at; +t9 = MEM_U32(a1 + 0); +t5 = MEM_U32(sp + 244); +v1 = MEM_U32(t9 + 0); +t6 = t5 << 3; +t8 = MEM_U8(v1 + 60); +//nop; +t7 = t8 & 0xff07; +t9 = t6 | t7; +MEM_U8(v1 + 60) = (uint8_t)t9; +t3 = MEM_U32(a1 + 0); +t4 = MEM_U32(sp + 248); +v1 = MEM_U32(t3 + 0); +t8 = t4 << 2; +t7 = MEM_U8(v1 + 60); +t6 = t8 & 0x4; +t9 = t7 & 0xfffb; +t3 = t6 | t9; +MEM_U8(v1 + 60) = (uint8_t)t3; +t5 = MEM_U32(a1 + 0); +t8 = MEM_U32(sp + 252); +v1 = MEM_U32(t5 + 0); +t6 = t8 << 6; +t9 = MEM_U8(v1 + 61); +//nop; +t3 = t9 & 0xff3f; +t5 = t6 | t3; +MEM_U8(v1 + 61) = (uint8_t)t5; +//nop; +//nop; +//nop; +v0 = f_gethostsex(mem, sp); +goto L45e9e0; +//nop; +L45e9e0: +gp = MEM_U32(sp + 24); +t7 = v0 < 0x1; +a1 = 0x1001b28c; +t9 = t7 & 0x1; +t4 = MEM_U32(a1 + 0); +a0 = 0x1000e5ac; +v1 = MEM_U32(t4 + 0); +a0 = a0; +t6 = MEM_U8(v1 + 60); +//nop; +t3 = t6 & 0xfffe; +t5 = t9 | t3; +MEM_U8(v1 + 60) = (uint8_t)t5; +//nop; +//nop; +//nop; +v0 = f_st_stradd(mem, sp, a0, a1); +goto L45ea24; +//nop; +L45ea24: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 240); +//nop; +//nop; +//nop; +v0 = f_st_stradd(mem, sp, a0, a1); +goto L45ea3c; +//nop; +L45ea3c: +gp = MEM_U32(sp + 24); +//nop; +a1 = 0x1001b28c; +t7 = 0x10006280; +t4 = MEM_U32(a1 + 0); +//nop; +t8 = MEM_U32(t4 + 0); +//nop; +MEM_U32(t8 + 4) = v0; +t7 = MEM_U32(t7 + 0); +t6 = MEM_U32(sp + 252); +if (t7 != 0) {ra = MEM_U32(sp + 28); +goto L45ee14;} +ra = MEM_U32(sp + 28); +if (t6 == 0) {at = (int)t6 < (int)0x3; +goto L45ea80;} +at = (int)t6 < (int)0x3; +if (at != 0) {ra = MEM_U32(sp + 28); +goto L45ee14;} +ra = MEM_U32(sp + 28); +L45ea80: +a0 = 0x1000e5b0; +//nop; +a0 = a0; +//nop; +v0 = f_st_stradd(mem, sp, a0, a1); +goto L45ea94; +//nop; +L45ea94: +gp = MEM_U32(sp + 24); +t3 = 0x1; +t9 = 0x1000636c; +a1 = 0x40; +t9 = MEM_S8(t9 + 0); +//nop; +if (t9 != 0) {t4 = MEM_U32(sp + 240); +goto L45ec34;} +t4 = MEM_U32(sp + 240); +at = 0x1000636c; +a0 = 0x10018d18; +//nop; +MEM_U8(at + 0) = (uint8_t)t3; +a0 = a0; +v0 = wrapper_gethostname(mem, a0, a1); +goto L45eacc; +a0 = a0; +L45eacc: +gp = MEM_U32(sp + 24); +if ((int)v0 >= 0) {//nop; +goto L45eafc;} +//nop; +a0 = 0x10018d18; +a1 = 0x1000e5bc; +//nop; +a0 = a0; +a1 = a1; +v0 = wrapper_strcpy(mem, a0, a1); +goto L45eaf0; +a1 = a1; +L45eaf0: +gp = MEM_U32(sp + 24); +//nop; +goto L45eb1c; +//nop; +L45eafc: +a0 = 0x10018d18; +a1 = 0x1000e5c0; +//nop; +a0 = a0; +a1 = a1; +v0 = wrapper_strcat(mem, a0, a1); +goto L45eb14; +a1 = a1; +L45eb14: +gp = MEM_U32(sp + 24); +//nop; +L45eb1c: +//nop; +a0 = MEM_U32(sp + 240); +a1 = 0x5; +v0 = wrapper_pathconf(mem, a0, a1); +goto L45eb2c; +a1 = 0x5; +L45eb2c: +gp = MEM_U32(sp + 24); +at = (int)v0 < (int)0x5; +if (at == 0) {v1 = v0; +goto L45eb40;} +v1 = v0; +v1 = 0x5; +L45eb40: +t5 = v1 << 2; +v0 = t5 << 2; +//nop; +v0 = v0 - t5; +v0 = v0 + 0xa; +a0 = v0; +MEM_U32(sp + 44) = v0; +MEM_U32(sp + 228) = t5; +v0 = wrapper_malloc(mem, a0); +goto L45eb64; +MEM_U32(sp + 228) = t5; +L45eb64: +gp = MEM_U32(sp + 24); +v1 = MEM_U32(sp + 228); +at = 0x10018d60; +if (v0 != 0) {MEM_U32(at + 0) = v0; +goto L45eb9c;} +MEM_U32(at + 0) = v0; +a0 = 0x1000e5c4; +//nop; +a1 = MEM_U32(sp + 44); +MEM_U32(sp + 228) = v1; +a0 = a0; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45eb90; +a0 = a0; +L45eb90: +gp = MEM_U32(sp + 24); +v1 = MEM_U32(sp + 228); +//nop; +L45eb9c: +//nop; +a1 = MEM_U32(sp + 44); +a0 = zero; +MEM_U32(sp + 228) = v1; +v0 = wrapper_getcwd(mem, a0, a1); +goto L45ebb0; +MEM_U32(sp + 228) = v1; +L45ebb0: +gp = MEM_U32(sp + 24); +v1 = MEM_U32(sp + 228); +at = 0x10018d64; +if (v0 != 0) {MEM_U32(at + 0) = v0; +goto L45ebe8;} +MEM_U32(at + 0) = v0; +a0 = 0x1000e5f0; +//nop; +a1 = MEM_U32(sp + 44); +MEM_U32(sp + 228) = v1; +a0 = a0; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45ebdc; +a0 = a0; +L45ebdc: +gp = MEM_U32(sp + 24); +v1 = MEM_U32(sp + 228); +//nop; +L45ebe8: +//nop; +a1 = v1 << 2; +a1 = a1 + 0xa; +a0 = a1; +MEM_U32(sp + 44) = a1; +v0 = wrapper_malloc(mem, a0); +goto L45ec00; +MEM_U32(sp + 44) = a1; +L45ec00: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 44); +at = 0x10018d5c; +if (v0 != 0) {MEM_U32(at + 0) = v0; +goto L45ec30;} +MEM_U32(at + 0) = v0; +a0 = 0x1000e61c; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45ec28; +//nop; +L45ec28: +gp = MEM_U32(sp + 24); +//nop; +L45ec30: +t4 = MEM_U32(sp + 240); +L45ec34: +at = 0x2f; +t8 = MEM_S8(t4 + 0); +a1 = MEM_U32(sp + 240); +if (t8 == at) {//nop; +goto L45ecac;} +//nop; +a0 = 0x10018d60; +a1 = 0x10018d64; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 0); +//nop; +v0 = wrapper_strcpy(mem, a0, a1); +goto L45ec64; +//nop; +L45ec64: +gp = MEM_U32(sp + 24); +//nop; +a0 = 0x10018d60; +a1 = 0x1000e658; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcat(mem, a0, a1); +goto L45ec84; +a1 = a1; +L45ec84: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 240); +a0 = 0x10018d60; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_strcat(mem, a0, a1); +goto L45eca0; +//nop; +L45eca0: +gp = MEM_U32(sp + 24); +//nop; +goto L45ecc8; +//nop; +L45ecac: +a0 = 0x10018d60; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = wrapper_strcpy(mem, a0, a1); +goto L45ecc0; +//nop; +L45ecc0: +gp = MEM_U32(sp + 24); +//nop; +L45ecc8: +a0 = 0x10018d5c; +a1 = 0x10018d18; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = a1; +v0 = wrapper_strcpy(mem, a0, a1); +goto L45ece0; +a1 = a1; +L45ece0: +gp = MEM_U32(sp + 24); +//nop; +a0 = 0x10018d5c; +a1 = 0x10018d60; +//nop; +a0 = MEM_U32(a0 + 0); +a1 = MEM_U32(a1 + 0); +//nop; +v0 = wrapper_strcat(mem, a0, a1); +goto L45ed04; +//nop; +L45ed04: +gp = MEM_U32(sp + 24); +//nop; +a0 = 0x10018d5c; +//nop; +a0 = MEM_U32(a0 + 0); +//nop; +v0 = f_st_stradd(mem, sp, a0, a1); +goto L45ed20; +//nop; +L45ed20: +gp = MEM_U32(sp + 24); +t6 = 0x1; +t7 = 0x10006370; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 != 0) {//nop; +goto L45ed84;} +//nop; +at = 0x10006370; +//nop; +a0 = zero; +MEM_U32(at + 0) = t6; +v0 = wrapper_time(mem, a0); +goto L45ed54; +MEM_U32(at + 0) = t6; +L45ed54: +gp = MEM_U32(sp + 24); +a2 = v0; +at = 0x10018d88; +a0 = 0x10018d68; +a1 = 0x1000e65c; +//nop; +MEM_U32(at + 0) = v0; +a0 = a0; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_sprintf(mem, a0, a1, sp); +goto L45ed7c; +a1 = a1; +L45ed7c: +gp = MEM_U32(sp + 24); +//nop; +L45ed84: +a0 = 0x10018d68; +//nop; +a0 = a0; +//nop; +v0 = f_st_stradd(mem, sp, a0, a1); +goto L45ed98; +//nop; +L45ed98: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 240); +//nop; +a1 = sp + 0x38; +//nop; +v0 = wrapper_stat(mem, a0, a1); +goto L45edb0; +//nop; +L45edb0: +gp = MEM_U32(sp + 24); +if ((int)v0 >= 0) {a0 = sp + 0xc0; +goto L45eddc;} +a0 = sp + 0xc0; +a0 = 0x1000e660; +//nop; +a0 = a0; +//nop; +v0 = f_st_stradd(mem, sp, a0, a1); +goto L45edd0; +//nop; +L45edd0: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L45ee14; +ra = MEM_U32(sp + 28); +L45eddc: +a1 = 0x1000e664; +//nop; +a2 = MEM_U32(sp + 104); +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_sprintf(mem, a0, a1, sp); +goto L45edf0; +a1 = a1; +L45edf0: +gp = MEM_U32(sp + 24); +a0 = sp + 0xc0; +//nop; +//nop; +//nop; +v0 = f_st_stradd(mem, sp, a0, a1); +goto L45ee08; +//nop; +L45ee08: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L45ee14: +sp = sp + 0xf0; +//nop; +return; +//nop; +} + +static uint32_t f_st_auxadd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L45ee20: +//st_auxadd: +//nop; +//nop; +//nop; +t6 = 0x1001b288; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +t7 = MEM_U32(t6 + 4); +//nop; +if (t7 != 0) {//nop; +goto L45ee70;} +//nop; +a0 = 0x100062c0; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45ee68; +//nop; +L45ee68: +gp = MEM_U32(sp + 24); +//nop; +L45ee70: +v1 = 0x1001b28c; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +if (v1 != 0) {//nop; +goto L45eeb4;} +//nop; +a0 = 0x100062fc; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45ee9c; +//nop; +L45ee9c: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x1001b28c; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +L45eeb4: +t8 = MEM_U32(v1 + 60); +//nop; +t9 = t8 & 0x400; +if (t9 == 0) {//nop; +goto L45eef4;} +//nop; +a0 = 0x10006330; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45eedc; +//nop; +L45eedc: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x1001b28c; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +L45eef4: +t0 = MEM_U32(v1 + 0); +t1 = MEM_U32(v1 + 16); +a0 = MEM_U32(t0 + 48); +a1 = v1 + 0x10; +at = (int)a0 < (int)t1; +if (at != 0) {a2 = 0x4; +goto L45ef54;} +a2 = 0x4; +//nop; +a0 = MEM_U32(v1 + 12); +a3 = 0x40; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45ef20; +a3 = 0x40; +L45ef20: +gp = MEM_U32(sp + 24); +//nop; +t2 = 0x1001b28c; +v1 = 0x1001b28c; +t2 = MEM_U32(t2 + 0); +//nop; +MEM_U32(t2 + 12) = v0; +v1 = MEM_U32(v1 + 0); +//nop; +t3 = MEM_U32(v1 + 0); +//nop; +a0 = MEM_U32(t3 + 48); +//nop; +L45ef54: +t4 = MEM_U32(v1 + 12); +t7 = sp + 0x20; +at = MEM_U32(t7 + 0); +t5 = a0 << 2; +t0 = 0x1001b28c; +t6 = t4 + t5; +MEM_U32(t6 + 0) = at; +t0 = MEM_U32(t0 + 0); +//nop; +a1 = MEM_U32(t0 + 0); +//nop; +v0 = MEM_U32(a1 + 48); +//nop; +t1 = v0 + 0x1; +MEM_U32(a1 + 48) = t1; +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return v0; +//nop; +} + +static void f_st_pdadd(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L45efa0: +//st_pdadd: +//nop; +//nop; +//nop; +t6 = 0x1001b288; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +t7 = MEM_U32(t6 + 4); +//nop; +if (t7 != 0) {//nop; +goto L45eff0;} +//nop; +a0 = 0x100062c0; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45efe8; +//nop; +L45efe8: +gp = MEM_U32(sp + 24); +//nop; +L45eff0: +v1 = 0x1001b28c; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +if (v1 != 0) {//nop; +goto L45f034;} +//nop; +a0 = 0x100062fc; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45f01c; +//nop; +L45f01c: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x1001b28c; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +L45f034: +t8 = MEM_U32(v1 + 60); +//nop; +t9 = t8 & 0x100; +if (t9 == 0) {//nop; +goto L45f074;} +//nop; +a0 = 0x10006330; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45f05c; +//nop; +L45f05c: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x1001b28c; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +L45f074: +t0 = MEM_U32(v1 + 0); +t1 = MEM_U32(v1 + 56); +a0 = MEM_U16(t0 + 42); +a1 = v1 + 0x38; +at = a0 < t1; +if (at != 0) {a2 = 0x34; +goto L45f0d4;} +a2 = 0x34; +//nop; +a0 = MEM_U32(v1 + 52); +a3 = 0x20; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45f0a0; +a3 = 0x20; +L45f0a0: +gp = MEM_U32(sp + 24); +//nop; +t2 = 0x1001b28c; +v1 = 0x1001b28c; +t2 = MEM_U32(t2 + 0); +//nop; +MEM_U32(t2 + 52) = v0; +v1 = MEM_U32(v1 + 0); +//nop; +t3 = MEM_U32(v1 + 0); +//nop; +a0 = MEM_U16(t3 + 42); +//nop; +L45f0d4: +a3 = 0x34; +lo = a0 * a3; +hi = (uint32_t)((uint64_t)a0 * (uint64_t)a3 >> 32); +t7 = 0x10018d90; +t4 = MEM_U32(v1 + 52); +t7 = t7; +t9 = t7 + 0x30; +t5 = lo; +t6 = t4 + t5; +//nop; +L45f0f8: +at = MEM_U32(t7 + 0); +t7 = t7 + 0xc; +MEM_U32(t6 + 0) = at; +at = MEM_U32(t7 + -8); +t6 = t6 + 0xc; +MEM_U32(t6 + -8) = at; +at = MEM_U32(t7 + -4); +if (t7 != t9) {MEM_U32(t6 + -4) = at; +goto L45f0f8;} +MEM_U32(t6 + -4) = at; +at = MEM_U32(t7 + 0); +v1 = 0x1001b28c; +MEM_U32(t6 + 0) = at; +v1 = MEM_U32(v1 + 0); +t0 = MEM_U32(sp + 32); +t2 = MEM_U32(v1 + 0); +t1 = MEM_U32(v1 + 52); +t3 = MEM_U16(t2 + 42); +t8 = 0x1001b28c; +lo = t3 * a3; +hi = (uint32_t)((uint64_t)t3 * (uint64_t)a3 >> 32); +t4 = lo; +t5 = t1 + t4; +MEM_U32(t5 + 4) = t0; +t8 = MEM_U32(t8 + 0); +//nop; +a1 = MEM_U32(t8 + 0); +//nop; +v0 = MEM_U16(a1 + 42); +//nop; +t9 = v0 + 0x1; +MEM_U16(a1 + 42) = (uint16_t)t9; +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t f_st_stradd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L45f2fc: +//st_stradd: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +if (a0 != 0) {MEM_U32(sp + 40) = a0; +goto L45f344;} +MEM_U32(sp + 40) = a0; +a0 = 0x1000e668; +//nop; +a0 = a0; +//nop; +f_st_error(mem, sp, a0, a1, a2); +goto L45f33c; +//nop; +L45f33c: +gp = MEM_U32(sp + 32); +//nop; +L45f344: +//nop; +a0 = MEM_U32(sp + 40); +//nop; +v0 = wrapper_strlen(mem, a0); +goto L45f354; +//nop; +L45f354: +gp = MEM_U32(sp + 32); +s2 = v0 + 0x1; +t7 = 0x1001b288; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +t8 = MEM_U32(t7 + 4); +//nop; +if (t8 != 0) {//nop; +goto L45f398;} +//nop; +a0 = 0x100062c0; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45f390; +//nop; +L45f390: +gp = MEM_U32(sp + 32); +//nop; +L45f398: +s1 = 0x1001b28c; +//nop; +s0 = MEM_U32(s1 + 0); +//nop; +if (s0 != 0) {//nop; +goto L45f3d0;} +//nop; +a0 = 0x100062fc; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45f3c4; +//nop; +L45f3c4: +gp = MEM_U32(sp + 32); +s0 = MEM_U32(s1 + 0); +//nop; +L45f3d0: +t9 = MEM_U32(s0 + 60); +//nop; +t0 = t9 & 0x80; +if (t0 == 0) {//nop; +goto L45f404;} +//nop; +a0 = 0x10006330; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45f3f8; +//nop; +L45f3f8: +gp = MEM_U32(sp + 32); +s0 = MEM_U32(s1 + 0); +//nop; +L45f404: +t1 = MEM_U32(s0 + 0); +t2 = MEM_U32(s0 + 24); +v1 = MEM_U32(t1 + 12); +//nop; +t3 = v1 + s2; +at = (int)t2 < (int)t3; +if (at == 0) {//nop; +goto L45f470;} +//nop; +L45f424: +//nop; +a0 = MEM_U32(s0 + 20); +a1 = s0 + 0x18; +a2 = 0x1; +a3 = 0x200; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45f43c; +a3 = 0x200; +L45f43c: +t4 = MEM_U32(s1 + 0); +gp = MEM_U32(sp + 32); +MEM_U32(t4 + 20) = v0; +s0 = MEM_U32(s1 + 0); +//nop; +t5 = MEM_U32(s0 + 0); +t6 = MEM_U32(s0 + 24); +v1 = MEM_U32(t5 + 12); +//nop; +t7 = v1 + s2; +at = (int)t6 < (int)t7; +if (at != 0) {//nop; +goto L45f424;} +//nop; +L45f470: +t8 = MEM_U32(s0 + 20); +//nop; +a1 = MEM_U32(sp + 40); +a0 = t8 + v1; +v0 = wrapper_strcpy(mem, a0, a1); +goto L45f484; +a0 = t8 + v1; +L45f484: +t9 = MEM_U32(s1 + 0); +gp = MEM_U32(sp + 32); +a0 = MEM_U32(t9 + 0); +//nop; +v0 = MEM_U32(a0 + 12); +//nop; +t0 = v0 + s2; +MEM_U32(a0 + 12) = t0; +ra = MEM_U32(sp + 36); +s2 = MEM_U32(sp + 28); +s1 = MEM_U32(sp + 24); +s0 = MEM_U32(sp + 20); +sp = sp + 0x28; +return v0; +sp = sp + 0x28; +} + +static uint32_t f_st_paux_ifd_iaux(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L45f4fc: +//st_paux_ifd_iaux: +//nop; +//nop; +//nop; +t6 = 0x1001b288; +sp = sp + 0xffffffd8; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t7 = MEM_U32(t6 + 4); +a3 = a0; +if (t7 != 0) {a2 = a1; +goto L45f554;} +a2 = a1; +a0 = 0x100062c0; +//nop; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 40) = a3; +a0 = a0; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45f544; +a0 = a0; +L45f544: +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 40); +//nop; +L45f554: +if ((int)a3 < 0) {a1 = a3; +goto L45f5b0;} +a1 = a3; +if ((int)a2 < 0) {//nop; +goto L45f5b0;} +//nop; +v0 = 0x1001b288; +//nop; +v0 = MEM_U32(v0 + 0); +//nop; +t8 = MEM_U32(v0 + 12); +//nop; +at = (int)a3 < (int)t8; +if (at == 0) {//nop; +goto L45f5b0;} +//nop; +t9 = MEM_U32(v0 + 4); +t0 = a3 << 6; +v1 = t9 + t0; +t1 = MEM_U32(v1 + 0); +//nop; +t2 = MEM_U32(t1 + 48); +//nop; +at = (int)a2 < (int)t2; +if (at != 0) {//nop; +goto L45f5f0;} +//nop; +L45f5b0: +a0 = 0x1000e684; +//nop; +t3 = a3 << 6; +MEM_U32(sp + 36) = t3; +MEM_U32(sp + 44) = a2; +a0 = a0; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45f5cc; +a0 = a0; +L45f5cc: +gp = MEM_U32(sp + 24); +t6 = MEM_U32(sp + 36); +t4 = 0x1001b288; +a2 = MEM_U32(sp + 44); +t4 = MEM_U32(t4 + 0); +//nop; +t5 = MEM_U32(t4 + 4); +//nop; +v1 = t5 + t6; +L45f5f0: +t7 = MEM_U32(v1 + 12); +ra = MEM_U32(sp + 28); +t8 = a2 << 2; +sp = sp + 0x28; +v0 = t7 + t8; +return v0; +v0 = t7 + t8; +} + +static uint32_t f_st_str_iss(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L45f714: +//st_str_iss: +//nop; +//nop; +//nop; +t6 = 0x1001b288; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +t7 = MEM_U32(t6 + 4); +//nop; +if (t7 != 0) {//nop; +goto L45f764;} +//nop; +a0 = 0x100062c0; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45f75c; +//nop; +L45f75c: +gp = MEM_U32(sp + 24); +//nop; +L45f764: +v1 = 0x1001b28c; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +if (v1 != 0) {//nop; +goto L45f7a8;} +//nop; +a0 = 0x100062fc; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L45f790; +//nop; +L45f790: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x1001b28c; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +L45f7a8: +t8 = MEM_U32(v1 + 0); +ra = MEM_U32(sp + 28); +v0 = MEM_U32(t8 + 12); +//nop; +if (v0 == 0) {//nop; +goto L45f7e0;} +//nop; +t9 = MEM_U32(sp + 32); +t1 = MEM_U32(sp + 32); +at = (int)t9 < (int)v0; +if (at == 0) {v0 = zero; +goto L45f7e4;} +v0 = zero; +t0 = MEM_U32(v1 + 20); +v0 = t0 + t1; +goto L45f7e4; +v0 = t0 + t1; +L45f7e0: +v0 = zero; +L45f7e4: +sp = sp + 0x20; +return v0; +sp = sp + 0x20; +} + +static uint32_t f_st_malloc(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L45f7ec: +//st_malloc: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 48) = a2; +v0 = MEM_U32(a1 + 0); +s0 = a1; +if (v0 == 0) {s1 = a0; +goto L45f830;} +s1 = a0; +if (a0 == 0) {at = 0xffffffff; +goto L45f830;} +at = 0xffffffff; +if (a0 != at) {t0 = v0 << 1; +goto L45f8dc;} +t0 = v0 << 1; +L45f830: +if (a3 != 0) {MEM_U32(s0 + 0) = a3; +goto L45f878;} +MEM_U32(s0 + 0) = a3; +//nop; +a0 = 0x1; +//nop; +v0 = wrapper_malloc(mem, a0); +goto L45f848; +//nop; +L45f848: +gp = MEM_U32(sp + 32); +if (v0 != 0) {s1 = v0; +goto L45f870;} +s1 = v0; +a0 = 0x1000e6f4; +//nop; +a0 = a0; +//nop; +f_st_error(mem, sp, a0, a1, a2); +goto L45f868; +//nop; +L45f868: +gp = MEM_U32(sp + 32); +//nop; +L45f870: +v0 = s1; +goto L45f938; +v0 = s1; +L45f878: +t6 = MEM_U32(s0 + 0); +t7 = MEM_U32(sp + 48); +//nop; +lo = t6 * t7; +hi = (uint32_t)((uint64_t)t6 * (uint64_t)t7 >> 32); +a0 = lo; +//nop; +v0 = wrapper_malloc(mem, a0); +goto L45f894; +//nop; +L45f894: +gp = MEM_U32(sp + 32); +if (v0 != 0) {s1 = v0; +goto L45f934;} +s1 = v0; +t8 = MEM_U32(s0 + 0); +t9 = MEM_U32(sp + 48); +//nop; +lo = t8 * t9; +hi = (uint32_t)((uint64_t)t8 * (uint64_t)t9 >> 32); +a1 = lo; +if (a1 == 0) {v0 = s1; +goto L45f938;} +v0 = s1; +a0 = 0x1000e730; +//nop; +a0 = a0; +//nop; +f_st_error(mem, sp, a0, a1, a2); +goto L45f8d0; +//nop; +L45f8d0: +gp = MEM_U32(sp + 32); +v0 = s1; +goto L45f938; +v0 = s1; +L45f8dc: +MEM_U32(s0 + 0) = t0; +t2 = MEM_U32(sp + 48); +//nop; +lo = t0 * t2; +hi = (uint32_t)((uint64_t)t0 * (uint64_t)t2 >> 32); +a0 = s1; +a1 = lo; +//nop; +v0 = wrapper_realloc(mem, a0, a1); +goto L45f8fc; +//nop; +L45f8fc: +gp = MEM_U32(sp + 32); +if (v0 != 0) {s1 = v0; +goto L45f934;} +s1 = v0; +t3 = MEM_U32(s0 + 0); +t4 = MEM_U32(sp + 48); +a0 = 0x1000e770; +lo = t3 * t4; +hi = (uint32_t)((uint64_t)t3 * (uint64_t)t4 >> 32); +//nop; +a0 = a0; +a1 = lo; +//nop; +f_st_error(mem, sp, a0, a1, a2); +goto L45f92c; +//nop; +L45f92c: +gp = MEM_U32(sp + 32); +//nop; +L45f934: +v0 = s1; +L45f938: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x28; +return v0; +sp = sp + 0x28; +//nop; +} + +static uint32_t f_st_symadd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L45f950: +//st_symadd: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +t6 = 0x1001b288; +MEM_U32(sp + 28) = ra; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +t7 = MEM_U32(t6 + 4); +//nop; +if (t7 != 0) {//nop; +goto L45f9ac;} +//nop; +a0 = 0x10006380; +//nop; +a0 = a0; +//nop; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L45f9a4; +//nop; +L45f9a4: +gp = MEM_U32(sp + 24); +//nop; +L45f9ac: +t0 = 0x1001b28c; +//nop; +v1 = MEM_U32(t0 + 0); +//nop; +if (v1 != 0) {//nop; +goto L45f9f0;} +//nop; +a0 = 0x100063bc; +//nop; +a0 = a0; +//nop; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L45f9d8; +//nop; +L45f9d8: +gp = MEM_U32(sp + 24); +//nop; +t0 = 0x1001b28c; +//nop; +v1 = MEM_U32(t0 + 0); +//nop; +L45f9f0: +t8 = MEM_U32(v1 + 60); +//nop; +t9 = t8 & 0x2; +if (t9 == 0) {//nop; +goto L45fa30;} +//nop; +a0 = 0x100063f0; +//nop; +a0 = a0; +//nop; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L45fa18; +//nop; +L45fa18: +gp = MEM_U32(sp + 24); +//nop; +t0 = 0x1001b28c; +//nop; +v1 = MEM_U32(t0 + 0); +//nop; +L45fa30: +t1 = MEM_U32(v1 + 0); +t2 = MEM_U32(v1 + 8); +a1 = MEM_U32(t1 + 20); +a2 = 0xc; +at = (int)a1 < (int)t2; +if (at != 0) {a3 = 0x40; +goto L45fa90;} +a3 = 0x40; +//nop; +a0 = MEM_U32(v1 + 4); +a1 = v1 + 0x8; +v0 = f__md_st_malloc(mem, sp, a0, a1, a2, a3); +goto L45fa5c; +a1 = v1 + 0x8; +L45fa5c: +gp = MEM_U32(sp + 24); +//nop; +t0 = 0x1001b28c; +//nop; +t3 = MEM_U32(t0 + 0); +//nop; +MEM_U32(t3 + 4) = v0; +v1 = MEM_U32(t0 + 0); +//nop; +t4 = MEM_U32(v1 + 0); +//nop; +a1 = MEM_U32(t4 + 20); +//nop; +L45fa90: +t6 = a1 << 2; +t5 = MEM_U32(v1 + 4); +t6 = t6 - a1; +t7 = MEM_U32(sp + 40); +t6 = t6 << 2; +v0 = t5 + t6; +MEM_U32(v0 + 0) = t7; +t8 = MEM_U32(sp + 44); +t4 = MEM_U8(v0 + 8); +MEM_U32(v0 + 4) = t8; +t1 = MEM_U32(sp + 48); +t5 = t4 & 0xff03; +t3 = t1 << 2; +t6 = t3 | t5; +MEM_U8(v0 + 8) = (uint8_t)t6; +t8 = MEM_U32(sp + 52); +t2 = MEM_U16(v0 + 8); +t9 = t8 << 5; +t1 = t9 & 0x3e0; +t4 = t2 & 0xfc1f; +t3 = t1 | t4; +MEM_U16(v0 + 8) = (uint16_t)t3; +t5 = MEM_U8(v0 + 9); +at = 0xf0000; +t6 = t5 & 0xffef; +MEM_U8(v0 + 9) = (uint8_t)t6; +t7 = MEM_U32(sp + 56); +a2 = MEM_U32(v0 + 8); +at = at | 0xffff; +t8 = t7 & at; +t9 = t8 ^ a2; +t2 = t9 << 12; +t1 = t2 >> 12; +t4 = t1 ^ a2; +MEM_U32(v0 + 8) = t4; +//nop; +a0 = MEM_U32(sp + 40); +//nop; +v0 = f_st_str_iss(mem, sp, a0, a1, a2, a3); +goto L45fb2c; +//nop; +L45fb2c: +gp = MEM_U32(sp + 24); +MEM_U32(sp + 32) = v0; +//nop; +a0 = v0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L45fb44; +//nop; +L45fb44: +gp = MEM_U32(sp + 24); +t5 = MEM_U32(sp + 48); +t0 = 0x1001b28c; +t6 = MEM_U32(sp + 52); +t3 = MEM_U32(t0 + 0); +t7 = t5 + t6; +v1 = MEM_U32(t3 + 0); +a2 = v0; +t9 = MEM_U32(v1 + 60); +t4 = MEM_U16(v1 + 62); +t2 = t9 + t7; +t1 = t2 & 0x1fff; +t3 = t4 & 0xe000; +t5 = t1 | t3; +a0 = zero; +if ((int)v0 <= 0) {MEM_U16(v1 + 62) = (uint16_t)t5; +goto L45fbd0;} +MEM_U16(v1 + 62) = (uint16_t)t5; +a1 = MEM_U32(sp + 32); +//nop; +L45fb90: +t6 = MEM_U32(t0 + 0); +t9 = MEM_S8(a1 + 0); +v1 = MEM_U32(t6 + 0); +a0 = a0 + 0x1; +t8 = MEM_U32(v1 + 60); +t5 = MEM_U16(v1 + 62); +t7 = t8 << 5; +t2 = t9 + t7; +t1 = t2 + t8; +t3 = t1 & 0x1fff; +t6 = t5 & 0xe000; +at = (int)a0 < (int)a2; +t8 = t3 | t6; +a1 = a1 + 0x1; +if (at != 0) {MEM_U16(v1 + 62) = (uint16_t)t8; +goto L45fb90;} +MEM_U16(v1 + 62) = (uint16_t)t8; +L45fbd0: +t9 = MEM_U32(sp + 48); +at = 0xe; +if (t9 == at) {at = 0x2; +goto L45fbf8;} +at = 0x2; +if (t9 == at) {at = 0x5; +goto L45fbf8;} +at = 0x5; +if (t9 == at) {at = 0x6; +goto L45fbf8;} +at = 0x6; +if (t9 != at) {//nop; +goto L45fc18;} +//nop; +L45fbf8: +t7 = MEM_U32(t0 + 0); +//nop; +v1 = MEM_U32(t7 + 0); +//nop; +t2 = MEM_U8(v1 + 60); +//nop; +t4 = t2 & 0xfffb; +MEM_U8(v1 + 60) = (uint8_t)t4; +L45fc18: +t1 = MEM_U32(t0 + 0); +//nop; +v1 = MEM_U32(t1 + 0); +//nop; +v0 = MEM_U32(v1 + 20); +//nop; +t5 = v0 + 0x1; +MEM_U32(v1 + 20) = t5; +ra = MEM_U32(sp + 28); +sp = sp + 0x28; +//nop; +return v0; +//nop; +} + +static uint32_t f_st_ifd_pcfd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L45fc48: +//st_ifd_pcfd: +//nop; +//nop; +//nop; +t6 = 0x1001b288; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +t7 = MEM_U32(t6 + 4); +//nop; +if (t7 != 0) {//nop; +goto L45fc98;} +//nop; +a0 = 0x10006380; +//nop; +a0 = a0; +//nop; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L45fc90; +//nop; +L45fc90: +gp = MEM_U32(sp + 24); +//nop; +L45fc98: +t8 = 0x1001b28c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {//nop; +goto L45fccc;} +//nop; +a0 = 0x100063bc; +//nop; +a0 = a0; +//nop; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L45fcc4; +//nop; +L45fcc4: +gp = MEM_U32(sp + 24); +//nop; +L45fccc: +t0 = 0x1001b288; +t9 = MEM_U32(sp + 32); +t0 = MEM_U32(t0 + 0); +ra = MEM_U32(sp + 28); +t1 = MEM_U32(t0 + 4); +sp = sp + 0x20; +v0 = t9 - t1; +t2 = (int)v0 >> 6; +v0 = t2; +return v0; +v0 = t2; +} + +static uint32_t f_st_pcfd_ifd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L45fcf4: +//st_pcfd_ifd: +//nop; +//nop; +//nop; +t6 = 0x1001b288; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t7 = MEM_U32(t6 + 4); +a1 = a0; +if (t7 != 0) {//nop; +goto L45fd44;} +//nop; +a0 = 0x10006380; +//nop; +MEM_U32(sp + 32) = a1; +a0 = a0; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L45fd38; +a0 = a0; +L45fd38: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +//nop; +L45fd44: +if ((int)a1 < 0) {//nop; +goto L45fd70;} +//nop; +v1 = 0x1001b288; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +t8 = MEM_U32(v1 + 12); +//nop; +at = (int)a1 < (int)t8; +if (at != 0) {//nop; +goto L45fd9c;} +//nop; +L45fd70: +a0 = 0x1000e7b0; +//nop; +MEM_U32(sp + 32) = a1; +a0 = a0; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L45fd84; +a0 = a0; +L45fd84: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +v1 = 0x1001b288; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +L45fd9c: +t9 = MEM_U32(v1 + 4); +ra = MEM_U32(sp + 28); +t0 = a1 << 6; +sp = sp + 0x20; +v0 = t9 + t0; +return v0; +v0 = t9 + t0; +} + +static uint32_t f_st_psym_ifd_isym(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L45fdb4: +//st_psym_ifd_isym: +//nop; +//nop; +//nop; +t6 = 0x1001b288; +sp = sp + 0xffffffd8; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t7 = MEM_U32(t6 + 4); +a3 = a0; +if (t7 != 0) {a2 = a1; +goto L45fe0c;} +a2 = a1; +a0 = 0x10006380; +//nop; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 40) = a3; +a0 = a0; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L45fdfc; +a0 = a0; +L45fdfc: +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 40); +//nop; +L45fe0c: +at = 0x7fff0000; +at = at | 0xffff; +if (a3 != at) {//nop; +goto L45fe38;} +//nop; +//nop; +a0 = a2; +//nop; +v0 = f_st_pext_iext(mem, sp, a0, a1, a2, a3); +goto L45fe2c; +//nop; +L45fe2c: +gp = MEM_U32(sp + 24); +v0 = v0 + 0x4; +goto L45fee8; +v0 = v0 + 0x4; +L45fe38: +if ((int)a3 < 0) {a1 = a3; +goto L45fe94;} +a1 = a3; +if ((int)a2 < 0) {//nop; +goto L45fe94;} +//nop; +v0 = 0x1001b288; +//nop; +v0 = MEM_U32(v0 + 0); +//nop; +t8 = MEM_U32(v0 + 12); +//nop; +at = (int)a3 < (int)t8; +if (at == 0) {//nop; +goto L45fe94;} +//nop; +t9 = MEM_U32(v0 + 4); +t0 = a3 << 6; +v1 = t9 + t0; +t1 = MEM_U32(v1 + 0); +//nop; +t2 = MEM_U32(t1 + 20); +//nop; +at = (int)a2 < (int)t2; +if (at != 0) {t8 = a2 << 2; +goto L45fed8;} +t8 = a2 << 2; +L45fe94: +a0 = 0x1000e7d4; +//nop; +t3 = a3 << 6; +MEM_U32(sp + 36) = t3; +MEM_U32(sp + 44) = a2; +a0 = a0; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L45feb0; +a0 = a0; +L45feb0: +gp = MEM_U32(sp + 24); +t6 = MEM_U32(sp + 36); +t4 = 0x1001b288; +a2 = MEM_U32(sp + 44); +t4 = MEM_U32(t4 + 0); +//nop; +t5 = MEM_U32(t4 + 4); +//nop; +v1 = t5 + t6; +t8 = a2 << 2; +L45fed8: +t7 = MEM_U32(v1 + 4); +t8 = t8 - a2; +t8 = t8 << 2; +v0 = t7 + t8; +L45fee8: +ra = MEM_U32(sp + 28); +sp = sp + 0x28; +//nop; +return v0; +//nop; +} + +static uint32_t f_st_paux_iaux(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L45fef8: +//st_paux_iaux: +//nop; +//nop; +//nop; +t6 = 0x1001b288; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +t7 = MEM_U32(t6 + 4); +//nop; +if (t7 != 0) {//nop; +goto L45ff48;} +//nop; +a0 = 0x10006380; +//nop; +a0 = a0; +//nop; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L45ff40; +//nop; +L45ff40: +gp = MEM_U32(sp + 24); +//nop; +L45ff48: +t8 = 0x1001b28c; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 != 0) {t9 = MEM_U32(sp + 32); +goto L45ff80;} +t9 = MEM_U32(sp + 32); +a0 = 0x100063bc; +//nop; +a0 = a0; +//nop; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L45ff74; +//nop; +L45ff74: +gp = MEM_U32(sp + 24); +//nop; +t9 = MEM_U32(sp + 32); +L45ff80: +//nop; +if ((int)t9 < 0) {//nop; +goto L45ffb8;} +//nop; +v1 = 0x1001b28c; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +t0 = MEM_U32(v1 + 0); +//nop; +t1 = MEM_U32(t0 + 48); +//nop; +at = (int)t9 < (int)t1; +if (at != 0) {t3 = MEM_U32(sp + 32); +goto L45ffe8;} +t3 = MEM_U32(sp + 32); +L45ffb8: +a0 = 0x1000e80c; +//nop; +a1 = MEM_U32(sp + 32); +a0 = a0; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L45ffcc; +a0 = a0; +L45ffcc: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x1001b28c; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +t3 = MEM_U32(sp + 32); +L45ffe8: +t2 = MEM_U32(v1 + 12); +ra = MEM_U32(sp + 28); +t4 = t3 << 2; +sp = sp + 0x20; +v0 = t2 + t4; +return v0; +v0 = t2 + t4; +} + +static uint32_t f_st_str_ifd_iss(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L460000: +//st_str_ifd_iss: +//nop; +//nop; +//nop; +t6 = 0x1001b288; +sp = sp + 0xffffffe0; +t6 = MEM_U32(t6 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t7 = MEM_U32(t6 + 4); +a2 = a0; +if (t7 != 0) {at = 0x7fff0000; +goto L46005c;} +at = 0x7fff0000; +a0 = 0x10006380; +//nop; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 32) = a2; +a0 = a0; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L460048; +a0 = a0; +L460048: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 36); +a2 = MEM_U32(sp + 32); +//nop; +at = 0x7fff0000; +L46005c: +at = at | 0xffff; +if (a2 != at) {//nop; +goto L460084;} +//nop; +//nop; +a0 = a1; +//nop; +v0 = f__md_st_str_extiss(mem, sp, a0); +goto L460078; +//nop; +L460078: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L4600c8; +ra = MEM_U32(sp + 28); +L460084: +//nop; +a0 = a2; +MEM_U32(sp + 36) = a1; +v0 = f_st_pcfd_ifd(mem, sp, a0, a1, a2, a3); +goto L460094; +MEM_U32(sp + 36) = a1; +L460094: +t8 = MEM_U32(v0 + 0); +a1 = MEM_U32(sp + 36); +v1 = MEM_U32(t8 + 12); +gp = MEM_U32(sp + 24); +if (v1 == 0) {at = (int)a1 < (int)v1; +goto L4600c0;} +at = (int)a1 < (int)v1; +if (at == 0) {//nop; +goto L4600c0;} +//nop; +t9 = MEM_U32(v0 + 20); +v0 = t9 + a1; +goto L4600c4; +v0 = t9 + a1; +L4600c0: +v0 = zero; +L4600c4: +ra = MEM_U32(sp + 28); +L4600c8: +sp = sp + 0x20; +//nop; +return v0; +//nop; +} + +static void f_st_internal(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4601b0: +//st_internal: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 48) = a2; +a2 = 0x10006430; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +a1 = 0x1000e840; +a0 = 0xfb528e4; +//nop; +MEM_U32(sp + 36) = ra; +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 52) = a3; +a1 = a1; +a0 = a0 + 0x20; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L4601f8; +a0 = a0 + 0x20; +L4601f8: +gp = MEM_U32(sp + 32); +t6 = MEM_U32(sp + 52); +t7 = MEM_U32(sp + 56); +a0 = 0xfb528e4; +//nop; +a1 = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 48); +MEM_U32(sp + 16) = t6; +MEM_U32(sp + 20) = t7; +a0 = a0 + 0x20; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L460228; +a0 = a0 + 0x20; +L460228: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0xfb528e4; +a1 = 0x1000e850; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L460248; +a1 = a1; +L460248: +gp = MEM_U32(sp + 32); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L460260; +//nop; +L460260: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static uint32_t f_st_pext_iext(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L460500: +//st_pext_iext: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if ((int)a0 < 0) {a1 = a0; +goto L460544;} +a1 = a0; +v1 = 0x1001b288; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +t6 = MEM_U32(v1 + 28); +//nop; +at = (int)t6 < (int)a0; +if (at == 0) {//nop; +goto L460570;} +//nop; +L460544: +a0 = 0x1000e8c4; +//nop; +MEM_U32(sp + 32) = a1; +a0 = a0; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L460558; +a0 = a0; +L460558: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +v1 = 0x1001b288; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +L460570: +t7 = MEM_U32(v1 + 24); +ra = MEM_U32(sp + 28); +t8 = a1 << 4; +sp = sp + 0x20; +v0 = t7 + t8; +return v0; +v0 = t7 + t8; +} + +static uint32_t f_st_idn_index_fext(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L460588: +//st_idn_index_fext: +//nop; +//nop; +//nop; +v1 = 0x1001b288; +sp = sp + 0xffffffc8; +v1 = MEM_U32(v1 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 56) = a0; +if (v1 != 0) {MEM_U32(sp + 60) = a1; +goto L4605e0;} +MEM_U32(sp + 60) = a1; +a0 = 0x1000e8ec; +//nop; +a0 = a0; +//nop; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L4605c8; +//nop; +L4605c8: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x1001b288; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +L4605e0: +v0 = MEM_U32(v1 + 64); +t6 = MEM_U32(v1 + 60); +a1 = v1 + 0x40; +at = (int)t6 < (int)v0; +if (at != 0) {t0 = v0; +goto L46062c;} +t0 = v0; +//nop; +a0 = MEM_U32(v1 + 56); +MEM_U32(sp + 44) = v0; +a2 = 0x8; +a3 = 0x80; +v0 = f__md_st_malloc(mem, sp, a0, a1, a2, a3); +goto L460610; +a3 = 0x80; +L460610: +gp = MEM_U32(sp + 24); +t0 = MEM_U32(sp + 44); +t7 = 0x1001b288; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +MEM_U32(t7 + 56) = v0; +L46062c: +if (t0 != 0) {t9 = MEM_U32(sp + 56); +goto L46065c;} +t9 = MEM_U32(sp + 56); +t8 = 0x1001b288; +//nop; +t8 = MEM_U32(t8 + 0); +a1 = 0x10; +a0 = MEM_U32(t8 + 56); +//nop; +wrapper_bzero(mem, a0, a1); +goto L460650; +//nop; +L460650: +gp = MEM_U32(sp + 24); +//nop; +t9 = MEM_U32(sp + 56); +L46065c: +t1 = MEM_U32(sp + 60); +t2 = 0x7fff0000; +if (t1 == 0) {MEM_U32(sp + 52) = t9; +goto L460680;} +MEM_U32(sp + 52) = t9; +v1 = 0x1001b288; +t2 = t2 | 0xffff; +v1 = MEM_U32(v1 + 0); +MEM_U32(sp + 48) = t2; +goto L4606a8; +MEM_U32(sp + 48) = t2; +L460680: +//nop; +//nop; +//nop; +v0 = f__md_st_currentifd(mem, sp, a0, a1, a2); +goto L460690; +//nop; +L460690: +gp = MEM_U32(sp + 24); +MEM_U32(sp + 48) = v0; +v1 = 0x1001b288; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +L4606a8: +t4 = MEM_U32(v1 + 60); +t3 = MEM_U32(v1 + 56); +t7 = sp + 0x30; +at = MEM_U32(t7 + 0); +t5 = t4 << 3; +t6 = t3 + t5; +MEM_U32(t6 + 0) = at; +t1 = MEM_U32(t7 + 4); +v1 = 0x1001b288; +MEM_U32(t6 + 4) = t1; +v1 = MEM_U32(v1 + 0); +//nop; +v0 = MEM_U32(v1 + 60); +//nop; +t2 = v0 + 0x1; +MEM_U32(v1 + 60) = t2; +ra = MEM_U32(sp + 28); +sp = sp + 0x38; +//nop; +return v0; +//nop; +} + +static uint32_t f_st_pdn_idn(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4606f8: +//st_pdn_idn: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if ((int)a0 < 0) {a1 = a0; +goto L46073c;} +a1 = a0; +v1 = 0x1001b288; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +t6 = MEM_U32(v1 + 60); +//nop; +at = (int)t6 < (int)a0; +if (at == 0) {//nop; +goto L460774;} +//nop; +L46073c: +t7 = 0x1001b288; +a0 = 0x1000e92c; +t7 = MEM_U32(t7 + 0); +//nop; +a2 = MEM_U32(t7 + 60); +MEM_U32(sp + 32) = a1; +a0 = a0; +f__md_st_internal(mem, sp, a0, a1, a2, a3); +goto L46075c; +a0 = a0; +L46075c: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +v1 = 0x1001b288; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +L460774: +t8 = MEM_U32(v1 + 56); +ra = MEM_U32(sp + 28); +t9 = a1 << 3; +sp = sp + 0x20; +v0 = t8 + t9; +return v0; +v0 = t8 + t9; +//nop; +} + +static uint32_t f_st_str_extiss(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L460ca8: +//st_str_extiss: +//nop; +//nop; +//nop; +if ((int)a0 < 0) {v0 = zero; +goto L460cec;} +v0 = zero; +v1 = 0x1001b288; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +t6 = MEM_U32(v1 + 40); +//nop; +at = (int)a0 < (int)t6; +if (at == 0) {//nop; +goto L460cec;} +//nop; +t7 = MEM_U32(v1 + 36); +v0 = t7 + a0; +return v0; +v0 = t7 + a0; +L460cec: +//nop; +return v0; +//nop; +} + +static void f_st_idn_dn(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L460cf4: +//st_idn_dn: +//nop; +//nop; +//nop; +v1 = 0x1001b288; +sp = sp + 0xffffffd8; +v1 = MEM_U32(v1 + 0); +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +if (v1 != 0) {MEM_U32(sp + 44) = a1; +goto L460d4c;} +MEM_U32(sp + 44) = a1; +a0 = 0x1000e9cc; +//nop; +a0 = a0; +//nop; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L460d34; +//nop; +L460d34: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x1001b288; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +L460d4c: +v0 = MEM_U32(v1 + 64); +t6 = MEM_U32(v1 + 60); +a1 = v1 + 0x40; +at = (int)t6 < (int)v0; +if (at != 0) {t0 = v0; +goto L460da0;} +t0 = v0; +//nop; +a0 = MEM_U32(v1 + 56); +MEM_U32(sp + 36) = v0; +a2 = 0x8; +a3 = 0x80; +v0 = f_st_malloc(mem, sp, a0, a1, a2, a3); +goto L460d7c; +a3 = 0x80; +L460d7c: +gp = MEM_U32(sp + 24); +t0 = MEM_U32(sp + 36); +t7 = 0x1001b288; +v1 = 0x1001b288; +t7 = MEM_U32(t7 + 0); +//nop; +MEM_U32(t7 + 56) = v0; +v1 = MEM_U32(v1 + 0); +//nop; +L460da0: +if (t0 != 0) {//nop; +goto L460dd0;} +//nop; +//nop; +a0 = MEM_U32(v1 + 56); +a1 = 0x10; +wrapper_bzero(mem, a0, a1); +goto L460db8; +a1 = 0x10; +L460db8: +gp = MEM_U32(sp + 24); +//nop; +v1 = 0x1001b288; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +L460dd0: +t1 = MEM_U32(v1 + 60); +t9 = MEM_U32(v1 + 56); +t8 = MEM_U32(sp + 40); +t2 = t1 << 3; +v1 = 0x1001b288; +t3 = t9 + t2; +MEM_U32(t3 + 0) = t8; +v1 = MEM_U32(v1 + 0); +t4 = MEM_U32(sp + 44); +t6 = MEM_U32(v1 + 60); +t5 = MEM_U32(v1 + 56); +t7 = t6 << 3; +v1 = 0x1001b288; +t1 = t5 + t7; +MEM_U32(t1 + 4) = t4; +v1 = MEM_U32(v1 + 0); +//nop; +v0 = MEM_U32(v1 + 60); +//nop; +t9 = v0 + 0x1; +MEM_U32(v1 + 60) = t9; +ra = MEM_U32(sp + 28); +sp = sp + 0x28; +//nop; +return; +//nop; +} + +static void f_st_setidn(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4610a8: +//st_setidn: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if ((int)a0 < 0) {a2 = a0; +goto L4610fc;} +a2 = a0; +if ((int)a1 < 0) {//nop; +goto L4610fc;} +//nop; +v1 = 0x1001b288; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +v0 = MEM_U32(v1 + 60); +//nop; +at = (int)a0 < (int)v0; +if (at == 0) {at = (int)a1 < (int)v0; +goto L4610fc;} +at = (int)a1 < (int)v0; +if (at != 0) {//nop; +goto L46112c;} +//nop; +L4610fc: +a0 = 0x1000eac0; +//nop; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 32) = a2; +a0 = a0; +f_st_internal(mem, sp, a0, a1, a2, a3); +goto L461114; +a0 = a0; +L461114: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 36); +v1 = 0x1001b288; +a2 = MEM_U32(sp + 32); +v1 = MEM_U32(v1 + 0); +//nop; +L46112c: +v0 = MEM_U32(v1 + 56); +t8 = a1 << 3; +t9 = v0 + t8; +at = MEM_U32(t9 + 0); +t6 = a2 << 3; +t7 = v0 + t6; +MEM_U32(t7 + 0) = at; +t2 = MEM_U32(t9 + 4); +//nop; +MEM_U32(t7 + 4) = t2; +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t f_st_iaux_copyty(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4614ec: +//st_iaux_copyty: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +MEM_U32(sp + 20) = s0; +MEM_U32(sp + 60) = a1; +a1 = MEM_U32(a1 + 8); +at = 0xf0000; +//nop; +at = at | 0xffff; +t7 = a1 & at; +s2 = a0; +s1 = zero; +a1 = t7; +v0 = f_st_paux_ifd_iaux(mem, sp, a0, a1); +goto L461538; +a1 = t7; +L461538: +a2 = MEM_U32(sp + 60); +gp = MEM_U32(sp + 32); +t8 = MEM_U32(a2 + 8); +at = 0x6; +t9 = t8 >> 26; +if (t9 != at) {t0 = s1 << 2; +goto L46155c;} +t0 = s1 << 2; +s1 = 0x1; +t0 = s1 << 2; +L46155c: +a1 = t0 + v0; +v1 = MEM_U8(a1 + 0); +at = 0x25; +t1 = v1 & 0x3f; +s1 = s1 + 0x1; +if (t1 != at) {v1 = t1; +goto L4615a0;} +v1 = t1; +t2 = s1 << 2; +t3 = v0 + t2; +t4 = MEM_U32(t3 + 0); +a3 = 0xfff; +t5 = t4 >> 20; +if (a3 != t5) {//nop; +goto L461598;} +//nop; +s1 = s1 + 0x1; +L461598: +s1 = s1 + 0x1; +goto L461624; +s1 = s1 + 0x1; +L4615a0: +at = 0x11; +if (v1 == at) {t6 = s1 << 2; +goto L4615d4;} +t6 = s1 << 2; +at = 0x14; +if (v1 == at) {at = 0xc; +goto L4615d4;} +at = 0xc; +if (v1 == at) {at = 0xd; +goto L4615d4;} +at = 0xd; +if (v1 == at) {at = 0xf; +goto L4615d4;} +at = 0xf; +if (v1 == at) {at = 0xe; +goto L4615d4;} +at = 0xe; +if (v1 != at) {t7 = v0 + t6; +goto L4615f8;} +L4615d4: +t7 = v0 + t6; +t8 = MEM_U32(t7 + 0); +a3 = 0xfff; +t9 = t8 >> 20; +if (a3 != t9) {//nop; +goto L4615f0;} +//nop; +s1 = s1 + 0x1; +L4615f0: +s1 = s1 + 0x1; +goto L461624; +s1 = s1 + 0x1; +L4615f8: +at = 0x10; +if (v1 != at) {t0 = s1 << 2; +goto L461624;} +t0 = s1 << 2; +t1 = v0 + t0; +t2 = MEM_U32(t1 + 0); +a3 = 0xfff; +t3 = t2 >> 20; +if (a3 != t3) {//nop; +goto L461620;} +//nop; +s1 = s1 + 0x1; +L461620: +s1 = s1 + 0x3; +L461624: +t4 = MEM_U16(a1 + 2); +v1 = 0x3; +t5 = t4 >> 12; +if (v1 != t5) {a3 = 0xfff; +goto L46165c;} +a3 = 0xfff; +t6 = s1 << 2; +t7 = v0 + t6; +t8 = MEM_U32(t7 + 0); +//nop; +t9 = t8 >> 20; +if (a3 != t9) {//nop; +goto L461658;} +//nop; +s1 = s1 + 0x1; +L461658: +s1 = s1 + 0x4; +L46165c: +t0 = MEM_U8(a1 + 2); +t2 = s1 << 2; +t1 = t0 & 0xf; +if (v1 != t1) {t3 = v0 + t2; +goto L46168c;} +t3 = v0 + t2; +t4 = MEM_U32(t3 + 0); +//nop; +t5 = t4 >> 20; +if (a3 != t5) {//nop; +goto L461688;} +//nop; +s1 = s1 + 0x1; +L461688: +s1 = s1 + 0x4; +L46168c: +t6 = MEM_U8(a1 + 3); +t8 = s1 << 2; +t7 = t6 >> 4; +if (v1 != t7) {t9 = v0 + t8; +goto L4616bc;} +t9 = v0 + t8; +t0 = MEM_U32(t9 + 0); +//nop; +t1 = t0 >> 20; +if (a3 != t1) {//nop; +goto L4616b8;} +//nop; +s1 = s1 + 0x1; +L4616b8: +s1 = s1 + 0x4; +L4616bc: +a0 = MEM_U32(a1 + 0); +t3 = s1 << 2; +t2 = a0 & 0xf; +if (v1 != t2) {t4 = v0 + t3; +goto L4616ec;} +t4 = v0 + t3; +t5 = MEM_U32(t4 + 0); +//nop; +t6 = t5 >> 20; +if (a3 != t6) {//nop; +goto L4616e8;} +//nop; +s1 = s1 + 0x1; +L4616e8: +s1 = s1 + 0x4; +L4616ec: +t7 = MEM_U8(a1 + 1); +t9 = s1 << 2; +t8 = t7 >> 4; +if (v1 != t8) {t0 = v0 + t9; +goto L46171c;} +t0 = v0 + t9; +t1 = MEM_U32(t0 + 0); +//nop; +t2 = t1 >> 20; +if (a3 != t2) {//nop; +goto L461718;} +//nop; +s1 = s1 + 0x1; +L461718: +s1 = s1 + 0x4; +L46171c: +t3 = MEM_U16(a1 + 0); +t5 = s1 << 2; +t4 = t3 & 0xf; +if (v1 != t4) {t9 = a0 >> 31; +goto L461750;} +t9 = a0 >> 31; +t6 = v0 + t5; +t7 = MEM_U32(t6 + 0); +//nop; +t8 = t7 >> 20; +if (a3 != t8) {//nop; +goto L46174c;} +//nop; +s1 = s1 + 0x1; +L46174c: +s1 = s1 + 0x4; +L461750: +if (t9 == 0) {//nop; +goto L46175c;} +//nop; +s1 = s1 + 0x1; +L46175c: +if ((int)s1 <= 0) {s0 = zero; +goto L4617f8;} +s0 = zero; +a2 = MEM_U32(sp + 60); +L461768: +a0 = s2; +v0 = MEM_U32(a2 + 8); +if (s0 != 0) {at = 0xf0000; +goto L4617b8;} +at = 0xf0000; +at = 0xf0000; +//nop; +at = at | 0xffff; +t0 = v0 & at; +a1 = t0 + s0; +a0 = s2; +v0 = f_st_paux_ifd_iaux(mem, sp, a0, a1); +goto L461794; +a0 = s2; +L461794: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(v0 + 0); +//nop; +MEM_U32(sp + 0) = a0; +//nop; +v0 = f_st_auxadd(mem, sp, a0, a1); +goto L4617ac; +//nop; +L4617ac: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 44) = v0; +goto L4617ec; +MEM_U32(sp + 44) = v0; +L4617b8: +//nop; +at = at | 0xffff; +t3 = v0 & at; +a1 = t3 + s0; +v0 = f_st_paux_ifd_iaux(mem, sp, a0, a1); +goto L4617cc; +a1 = t3 + s0; +L4617cc: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(v0 + 0); +//nop; +MEM_U32(sp + 0) = a0; +//nop; +v0 = f_st_auxadd(mem, sp, a0, a1); +goto L4617e4; +//nop; +L4617e4: +gp = MEM_U32(sp + 32); +//nop; +L4617ec: +s0 = s0 + 0x1; +if (s0 != s1) {a2 = MEM_U32(sp + 60); +goto L461768;} +a2 = MEM_U32(sp + 60); +L4617f8: +ra = MEM_U32(sp + 36); +v0 = MEM_U32(sp + 44); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +sp = sp + 0x38; +return v0; +sp = sp + 0x38; +} + +static void f_st_auxisymadd(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L461adc: +//st_auxisymadd: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 36) = a0; +MEM_U32(sp + 0) = a0; +v0 = f_st_auxadd(mem, sp, a0, a1); +goto L461b04; +MEM_U32(sp + 0) = a0; +L461b04: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_st_auxrndxadd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L461b14: +//st_auxrndxadd: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +t7 = MEM_U16(sp + 44); +at = 0xf0000; +t8 = t7 | 0xfff0; +MEM_U16(sp + 44) = (uint16_t)t8; +t0 = MEM_U32(sp + 44); +at = at | 0xffff; +t9 = a1 & at; +t1 = t9 ^ t0; +t2 = t1 << 12; +t3 = t2 >> 12; +t4 = t3 ^ t0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 44) = t4; +t5 = sp + 0x2c; +a0 = MEM_U32(t5 + 0); +//nop; +v0 = sp + 0x28; +MEM_U32(v0 + 0) = a0; +MEM_U32(sp + 0) = a0; +v0 = f_st_auxadd(mem, sp, a0, a1); +goto L461b7c; +MEM_U32(sp + 0) = a0; +L461b7c: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 48); +//nop; +MEM_U32(sp + 36) = v0; +//nop; +f_st_auxisymadd(mem, sp); +goto L461b94; +//nop; +L461b94: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +v0 = MEM_U32(sp + 36); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void f_swap_hdr(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4622c0: +//swap_hdr: +MEM_U32(sp + 4) = a1; +v1 = MEM_S16(a0 + 0); +a1 = MEM_S16(a0 + 2); +t8 = v1 & 0xffff; +t9 = t8 >> 8; +t7 = v1 << 8; +a2 = MEM_U32(a0 + 4); +t1 = t7 | t9; +t4 = a1 & 0xffff; +v0 = 0xff0000; +t5 = t4 >> 8; +t3 = a1 << 8; +t7 = a2 << 8; +MEM_U16(a0 + 0) = (uint16_t)t1; +t6 = t3 | t5; +t9 = t7 & v0; +t8 = a2 << 24; +a3 = MEM_U32(a0 + 8); +t1 = t8 | t9; +t2 = (int)a2 >> 8; +t4 = t2 & 0xff00; +MEM_U16(a0 + 2) = (uint16_t)t6; +t3 = t1 | t4; +t5 = a2 >> 24; +t8 = a3 << 8; +t6 = t3 | t5; +t9 = t8 & v0; +t7 = a3 << 24; +t0 = MEM_U32(a0 + 12); +t2 = t7 | t9; +t1 = (int)a3 >> 8; +t4 = t1 & 0xff00; +MEM_U32(a0 + 4) = t6; +t3 = t2 | t4; +t5 = a3 >> 24; +t7 = t0 << 8; +t6 = t3 | t5; +t9 = t7 & v0; +t8 = t0 << 24; +v1 = MEM_U32(a0 + 16); +t1 = t8 | t9; +t2 = (int)t0 >> 8; +t4 = t2 & 0xff00; +MEM_U32(a0 + 8) = t6; +t3 = t1 | t4; +t5 = t0 >> 24; +t8 = v1 << 8; +t6 = t3 | t5; +t9 = t8 & v0; +t7 = v1 << 24; +a1 = MEM_U32(a0 + 20); +t2 = t7 | t9; +t1 = (int)v1 >> 8; +t4 = t1 & 0xff00; +MEM_U32(a0 + 12) = t6; +t3 = t2 | t4; +t5 = v1 >> 24; +t7 = a1 << 8; +t6 = t3 | t5; +t9 = t7 & v0; +t8 = a1 << 24; +a2 = MEM_U32(a0 + 24); +t1 = t8 | t9; +t2 = (int)a1 >> 8; +t4 = t2 & 0xff00; +MEM_U32(a0 + 16) = t6; +t3 = t1 | t4; +t5 = a1 >> 24; +t8 = a2 << 8; +t6 = t3 | t5; +t9 = t8 & v0; +t7 = a2 << 24; +a3 = MEM_U32(a0 + 28); +t2 = t7 | t9; +t1 = (int)a2 >> 8; +t4 = t1 & 0xff00; +MEM_U32(a0 + 20) = t6; +t3 = t2 | t4; +t5 = a2 >> 24; +t7 = a3 << 8; +t6 = t3 | t5; +t9 = t7 & v0; +t8 = a3 << 24; +v1 = MEM_U32(a0 + 32); +t1 = t8 | t9; +t2 = (int)a3 >> 8; +t4 = t2 & 0xff00; +MEM_U32(a0 + 24) = t6; +t3 = t1 | t4; +t5 = a3 >> 24; +t8 = v1 << 8; +t6 = t3 | t5; +t9 = t8 & v0; +t7 = v1 << 24; +a1 = MEM_U32(a0 + 36); +t2 = t7 | t9; +t1 = (int)v1 >> 8; +t4 = t1 & 0xff00; +MEM_U32(a0 + 28) = t6; +t3 = t2 | t4; +t5 = v1 >> 24; +t7 = a1 << 8; +t6 = t3 | t5; +t9 = t7 & v0; +t8 = a1 << 24; +a2 = MEM_U32(a0 + 40); +t1 = t8 | t9; +t2 = (int)a1 >> 8; +t4 = t2 & 0xff00; +MEM_U32(a0 + 32) = t6; +t3 = t1 | t4; +t5 = a1 >> 24; +t8 = a2 << 8; +t6 = t3 | t5; +t9 = t8 & v0; +t7 = a2 << 24; +a3 = MEM_U32(a0 + 44); +t2 = t7 | t9; +t1 = (int)a2 >> 8; +t4 = t1 & 0xff00; +MEM_U32(a0 + 36) = t6; +t3 = t2 | t4; +t5 = a2 >> 24; +t7 = a3 << 8; +t6 = t3 | t5; +t9 = t7 & v0; +t8 = a3 << 24; +v1 = MEM_U32(a0 + 48); +t1 = t8 | t9; +t2 = (int)a3 >> 8; +t4 = t2 & 0xff00; +MEM_U32(a0 + 40) = t6; +t3 = t1 | t4; +t5 = a3 >> 24; +t8 = v1 << 8; +t6 = t3 | t5; +t9 = t8 & v0; +t7 = v1 << 24; +a1 = MEM_U32(a0 + 52); +t2 = t7 | t9; +t1 = (int)v1 >> 8; +t4 = t1 & 0xff00; +MEM_U32(a0 + 44) = t6; +t3 = t2 | t4; +t5 = v1 >> 24; +t7 = a1 << 8; +t6 = t3 | t5; +t9 = t7 & v0; +t8 = a1 << 24; +a2 = MEM_U32(a0 + 56); +t1 = t8 | t9; +t2 = (int)a1 >> 8; +t4 = t2 & 0xff00; +MEM_U32(a0 + 48) = t6; +t3 = t1 | t4; +t5 = a1 >> 24; +t8 = a2 << 8; +t6 = t3 | t5; +t9 = t8 & v0; +t7 = a2 << 24; +a3 = MEM_U32(a0 + 60); +t2 = t7 | t9; +t1 = (int)a2 >> 8; +t4 = t1 & 0xff00; +MEM_U32(a0 + 52) = t6; +t3 = t2 | t4; +t5 = a2 >> 24; +t7 = a3 << 8; +t6 = t3 | t5; +t9 = t7 & v0; +t8 = a3 << 24; +v1 = MEM_U32(a0 + 64); +t1 = t8 | t9; +t2 = (int)a3 >> 8; +t4 = t2 & 0xff00; +MEM_U32(a0 + 56) = t6; +t3 = t1 | t4; +t5 = a3 >> 24; +t8 = v1 << 8; +t6 = t3 | t5; +t9 = t8 & v0; +t7 = v1 << 24; +a1 = MEM_U32(a0 + 68); +t2 = t7 | t9; +t1 = (int)v1 >> 8; +t4 = t1 & 0xff00; +MEM_U32(a0 + 60) = t6; +t3 = t2 | t4; +t5 = v1 >> 24; +t7 = a1 << 8; +t6 = t3 | t5; +t9 = t7 & v0; +t8 = a1 << 24; +a2 = MEM_U32(a0 + 72); +t1 = t8 | t9; +t2 = (int)a1 >> 8; +t4 = t2 & 0xff00; +MEM_U32(a0 + 64) = t6; +t3 = t1 | t4; +t5 = a1 >> 24; +t8 = a2 << 8; +t6 = t3 | t5; +t9 = t8 & v0; +t7 = a2 << 24; +a3 = MEM_U32(a0 + 76); +t2 = t7 | t9; +t1 = (int)a2 >> 8; +t4 = t1 & 0xff00; +MEM_U32(a0 + 68) = t6; +t3 = t2 | t4; +t5 = a2 >> 24; +t7 = a3 << 8; +t6 = t3 | t5; +t9 = t7 & v0; +t8 = a3 << 24; +v1 = MEM_U32(a0 + 80); +t1 = t8 | t9; +t2 = (int)a3 >> 8; +t4 = t2 & 0xff00; +MEM_U32(a0 + 72) = t6; +t3 = t1 | t4; +t5 = a3 >> 24; +t8 = v1 << 8; +t6 = t3 | t5; +t9 = t8 & v0; +t7 = v1 << 24; +a1 = MEM_U32(a0 + 84); +t2 = t7 | t9; +t1 = (int)v1 >> 8; +t4 = t1 & 0xff00; +MEM_U32(a0 + 76) = t6; +t3 = t2 | t4; +t5 = v1 >> 24; +t7 = a1 << 8; +t6 = t3 | t5; +t9 = t7 & v0; +t8 = a1 << 24; +a2 = MEM_U32(a0 + 88); +t1 = t8 | t9; +t2 = (int)a1 >> 8; +t4 = t2 & 0xff00; +MEM_U32(a0 + 80) = t6; +t3 = t1 | t4; +t5 = a1 >> 24; +t8 = a2 << 8; +t6 = t3 | t5; +t9 = t8 & v0; +t7 = a2 << 24; +a3 = MEM_U32(a0 + 92); +t2 = t7 | t9; +t1 = (int)a2 >> 8; +t4 = t1 & 0xff00; +MEM_U32(a0 + 84) = t6; +t3 = t2 | t4; +t5 = a2 >> 24; +t6 = t3 | t5; +t7 = a3 << 8; +t9 = t7 & v0; +t2 = (int)a3 >> 8; +t8 = a3 << 24; +t1 = t8 | t9; +t4 = t2 & 0xff00; +MEM_U32(a0 + 88) = t6; +t3 = t1 | t4; +t5 = a3 >> 24; +t6 = t3 | t5; +MEM_U32(a0 + 92) = t6; +return; +MEM_U32(a0 + 92) = t6; +} + +static void f_swap_fd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L4626f0: +//swap_fd: +//nop; +//nop; +//nop; +sp = sp + 0xffffff70; +//nop; +MEM_U32(sp + 52) = ra; +MEM_U32(sp + 44) = s5; +MEM_U32(sp + 40) = s4; +MEM_U32(sp + 24) = s0; +s0 = a0; +s4 = a1; +s5 = a2; +MEM_U32(sp + 48) = gp; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +v0 = f_gethostsex(mem, sp); +goto L462734; +MEM_U32(sp + 28) = s1; +L462734: +gp = MEM_U32(sp + 48); +if ((int)s4 <= 0) {s3 = zero; +goto L462cc8;} +s3 = zero; +v1 = s0; +s2 = 0xff0000; +s1 = sp + 0x40; +a0 = 0xff0000; +L462750: +t8 = v1; +t9 = s1; +t7 = v1 + 0x48; +L46275c: +at = MEM_U32(t8 + 0); +t8 = t8 + 0xc; +MEM_U32(t9 + 0) = at; +at = MEM_U32(t8 + -8); +t9 = t9 + 0xc; +MEM_U32(t9 + -8) = at; +at = MEM_U32(t8 + -4); +if (t8 != t7) {MEM_U32(t9 + -4) = at; +goto L46275c;} +MEM_U32(t9 + -4) = at; +t6 = MEM_U32(sp + 64); +a1 = MEM_U32(sp + 84); +t8 = t6 << 8; +t9 = t8 & s2; +t7 = t6 << 24; +t8 = t7 | t9; +t7 = t6 >> 8; +t9 = t7 & 0xff00; +t7 = t8 | t9; +t8 = t6 >> 24; +t9 = t7 | t8; +t6 = MEM_U32(sp + 68); +MEM_U32(sp + 64) = t9; +t8 = t6 << 8; +t9 = t8 & a0; +t7 = t6 << 24; +t8 = t7 | t9; +t7 = (int)t6 >> 8; +t9 = t7 & 0xff00; +t7 = MEM_U32(sp + 68); +t6 = t8 | t9; +t8 = t7 >> 24; +t9 = t6 | t8; +t7 = MEM_U32(sp + 72); +MEM_U32(sp + 68) = t9; +t8 = t7 << 8; +t9 = t8 & a0; +t6 = t7 << 24; +t8 = t6 | t9; +t6 = (int)t7 >> 8; +t9 = t6 & 0xff00; +t6 = MEM_U32(sp + 72); +t7 = t8 | t9; +t8 = t6 >> 24; +t9 = t7 | t8; +t6 = MEM_U32(sp + 76); +MEM_U32(sp + 72) = t9; +t8 = t6 << 8; +t9 = t8 & a0; +t7 = t6 << 24; +t8 = t7 | t9; +t7 = (int)t6 >> 8; +t9 = t7 & 0xff00; +t7 = MEM_U32(sp + 76); +t6 = t8 | t9; +t8 = t7 >> 24; +t9 = t6 | t8; +t7 = MEM_U32(sp + 80); +MEM_U32(sp + 76) = t9; +t8 = t7 << 8; +t9 = t8 & a0; +t6 = t7 << 24; +t8 = t6 | t9; +t6 = (int)t7 >> 8; +t9 = t6 & 0xff00; +t6 = MEM_U32(sp + 80); +t7 = t8 | t9; +t8 = t6 >> 24; +t9 = t7 | t8; +t7 = a1 << 8; +t8 = t7 & a0; +MEM_U32(sp + 80) = t9; +t6 = a1 << 24; +t9 = t6 | t8; +t7 = (int)a1 >> 8; +t6 = t7 & 0xff00; +a2 = MEM_U32(sp + 88); +t8 = t9 | t6; +t7 = a1 >> 24; +a1 = t8 | t7; +t6 = a2 << 8; +t8 = t6 & a0; +t9 = a2 << 24; +t7 = t9 | t8; +t6 = (int)a2 >> 8; +t9 = t6 & 0xff00; +a3 = MEM_U32(sp + 92); +t8 = t7 | t9; +t6 = a2 >> 24; +a2 = t8 | t6; +t9 = a3 << 8; +t8 = t9 & a0; +t7 = a3 << 24; +t6 = t7 | t8; +t9 = (int)a3 >> 8; +t7 = t9 & 0xff00; +t0 = MEM_U32(sp + 96); +t8 = t6 | t7; +t9 = a3 >> 24; +a3 = t8 | t9; +t7 = t0 << 8; +t8 = t7 & a0; +t6 = t0 << 24; +t9 = t6 | t8; +t7 = (int)t0 >> 8; +t6 = t7 & 0xff00; +t1 = MEM_U32(sp + 100); +t8 = t9 | t6; +t7 = t0 >> 24; +t0 = t8 | t7; +t6 = t1 << 8; +t8 = t6 & a0; +t9 = t1 << 24; +t7 = t9 | t8; +t6 = (int)t1 >> 8; +t9 = t6 & 0xff00; +t8 = t7 | t9; +t6 = t1 >> 24; +t1 = t8 | t6; +t6 = MEM_U16(sp + 104); +t9 = MEM_S16(sp + 104); +t7 = t6 >> 8; +t8 = t9 << 8; +t9 = t8 | t7; +MEM_U16(sp + 104) = (uint16_t)t9; +t9 = MEM_U16(sp + 106); +t8 = MEM_S16(sp + 106); +t2 = MEM_U32(sp + 108); +t6 = t9 >> 8; +t7 = t8 << 8; +t8 = t7 | t6; +t7 = t2 << 8; +t6 = t7 & a0; +MEM_U16(sp + 106) = (uint16_t)t8; +t9 = t2 << 24; +t8 = t9 | t6; +t7 = (int)t2 >> 8; +t9 = t7 & 0xff00; +t3 = MEM_U32(sp + 112); +t6 = t8 | t9; +t7 = t2 >> 24; +t2 = t6 | t7; +t9 = t3 << 8; +t6 = t9 & a0; +t8 = t3 << 24; +t7 = t8 | t6; +t9 = (int)t3 >> 8; +t8 = t9 & 0xff00; +t4 = MEM_U32(sp + 116); +t6 = t7 | t8; +t9 = t3 >> 24; +t3 = t6 | t9; +t8 = t4 << 8; +t6 = t8 & a0; +t7 = t4 << 24; +t9 = t7 | t6; +t8 = (int)t4 >> 8; +t7 = t8 & 0xff00; +t5 = MEM_U32(sp + 120); +t6 = t9 | t7; +t8 = t4 >> 24; +t4 = t6 | t8; +t7 = t5 << 8; +t6 = t7 & a0; +t9 = t5 << 24; +t8 = t9 | t6; +t7 = (int)t5 >> 8; +t9 = t7 & 0xff00; +ra = MEM_U32(sp + 128); +t6 = t8 | t9; +t7 = t5 >> 24; +t5 = t6 | t7; +t9 = ra << 8; +t6 = t9 & a0; +t8 = ra << 24; +t7 = t8 | t6; +t9 = (int)ra >> 8; +t8 = t9 & 0xff00; +s0 = MEM_U32(sp + 132); +t6 = t7 | t8; +t9 = ra >> 24; +ra = t6 | t9; +t8 = s0 << 8; +t6 = t8 & a0; +t7 = s0 << 24; +t9 = t7 | t6; +t8 = (int)s0 >> 8; +t7 = t8 & 0xff00; +t6 = t9 | t7; +t8 = s0 >> 24; +s0 = t6 | t8; +MEM_U32(sp + 132) = s0; +MEM_U32(sp + 128) = ra; +MEM_U32(sp + 120) = t5; +MEM_U32(sp + 116) = t4; +MEM_U32(sp + 112) = t3; +MEM_U32(sp + 108) = t2; +MEM_U32(sp + 100) = t1; +MEM_U32(sp + 96) = t0; +MEM_U32(sp + 92) = a3; +MEM_U32(sp + 88) = a2; +if (s5 != v0) {MEM_U32(sp + 84) = a1; +goto L462ba0;} +MEM_U32(sp + 84) = a1; +t6 = s1; +t8 = v1; +t7 = s1 + 0x48; +L462a90: +at = MEM_U32(t6 + 0); +t6 = t6 + 0xc; +MEM_U32(t8 + 0) = at; +at = MEM_U32(t6 + -8); +t8 = t8 + 0xc; +MEM_U32(t8 + -8) = at; +at = MEM_U32(t6 + -4); +if (t6 != t7) {MEM_U32(t8 + -4) = at; +goto L462a90;} +MEM_U32(t8 + -4) = at; +t9 = MEM_U32(sp + 124); +//nop; +t6 = t9 << 8; +t8 = t6 & s2; +t7 = t9 << 24; +t6 = t7 | t8; +t7 = t9 >> 8; +t8 = t7 & 0xff00; +t7 = t6 | t8; +t6 = t9 >> 24; +t9 = t7 | t6; +MEM_U32(sp + 124) = t9; +t8 = MEM_U8(v1 + 60); +t6 = t9 << 3; +t9 = t8 & 0xff07; +t7 = t6 | t9; +MEM_U8(v1 + 60) = (uint8_t)t7; +t8 = MEM_U32(sp + 124); +//nop; +t6 = t8 << 26; +t9 = t6 >> 31; +t6 = MEM_U8(v1 + 60); +t7 = t9 << 2; +t8 = t7 & 0x4; +t9 = t6 & 0xfffb; +t7 = t8 | t9; +MEM_U8(v1 + 60) = (uint8_t)t7; +t6 = MEM_U32(sp + 124); +//nop; +t8 = t6 << 25; +t9 = t8 >> 31; +t8 = MEM_U8(v1 + 60); +t7 = t9 << 1; +t6 = t7 & 0x2; +t9 = t8 & 0xfffd; +t7 = t6 | t9; +MEM_U8(v1 + 60) = (uint8_t)t7; +t8 = MEM_U8(sp + 127); +//nop; +t6 = t8 >> 7; +t9 = t6 & 0x1; +t8 = t7 & 0xfe; +t6 = t9 | t8; +MEM_U8(v1 + 60) = (uint8_t)t6; +t9 = MEM_U8(sp + 126); +t7 = MEM_U8(v1 + 61); +t6 = t9 << 6; +t9 = t7 & 0xff3f; +t8 = t6 | t9; +MEM_U8(v1 + 61) = (uint8_t)t8; +t7 = MEM_U32(sp + 124); +//nop; +t9 = t7 >> 10; +t7 = MEM_U16(v1 + 62); +t8 = t9 & 0x1fff; +t6 = t7 & 0xe000; +t9 = t8 | t6; +MEM_U16(v1 + 62) = (uint16_t)t9; +goto L462cbc; +MEM_U16(v1 + 62) = (uint16_t)t9; +L462ba0: +t7 = MEM_U32(v1 + 60); +t9 = MEM_U8(sp + 127); +t8 = t7 >> 27; +t6 = t8 & 0x1f; +t7 = t9 & 0xffe0; +t8 = t6 | t7; +MEM_U8(sp + 127) = (uint8_t)t8; +t9 = MEM_U32(v1 + 60); +//nop; +t6 = t9 << 5; +t7 = t6 >> 31; +t9 = t7 << 5; +t6 = t9 & 0x20; +t7 = t8; +t9 = t7 & 0xdf; +t8 = t6 | t9; +MEM_U8(sp + 127) = (uint8_t)t8; +t7 = MEM_U32(v1 + 60); +//nop; +t6 = t7 << 6; +t9 = t6 >> 31; +t7 = t9 << 6; +t6 = t7 & 0x40; +t9 = t8; +t7 = t9 & 0xbf; +t8 = t6 | t7; +MEM_U8(sp + 127) = (uint8_t)t8; +t6 = MEM_U8(v1 + 60); +//nop; +t9 = t6 << 7; +t6 = t8; +t7 = t6 & 0x7f; +t8 = t9 | t7; +MEM_U8(sp + 127) = (uint8_t)t8; +t6 = MEM_U8(v1 + 61); +t8 = MEM_U8(sp + 126); +t9 = t6 >> 6; +t7 = t9 & 0x3; +t6 = t8 & 0xfffc; +t9 = t7 | t6; +MEM_U8(sp + 126) = (uint8_t)t9; +t6 = MEM_U32(sp + 124); +t8 = MEM_U32(v1 + 60); +t9 = t6 >> 10; +t7 = t8 & 0x1fff; +t8 = t7 ^ t9; +t7 = t8 << 10; +t9 = t7 ^ t6; +t7 = t9 << 8; +t6 = t7 & s2; +t8 = t9 << 24; +t7 = t8 | t6; +t8 = t9 >> 8; +t6 = t8 & 0xff00; +t8 = t7 | t6; +t7 = t9 >> 24; +t6 = t8 | t7; +MEM_U32(sp + 124) = t9; +MEM_U32(sp + 124) = t6; +t6 = s1; +t7 = s1 + 0x48; +t8 = v1; +L462c98: +at = MEM_U32(t6 + 0); +t6 = t6 + 0xc; +MEM_U32(t8 + 0) = at; +at = MEM_U32(t6 + -8); +t8 = t8 + 0xc; +MEM_U32(t8 + -8) = at; +at = MEM_U32(t6 + -4); +if (t6 != t7) {MEM_U32(t8 + -4) = at; +goto L462c98;} +MEM_U32(t8 + -4) = at; +L462cbc: +s3 = s3 + 0x1; +if (s3 != s4) {v1 = v1 + 0x48; +goto L462750;} +v1 = v1 + 0x48; +L462cc8: +ra = MEM_U32(sp + 52); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +s4 = MEM_U32(sp + 40); +s5 = MEM_U32(sp + 44); +sp = sp + 0x90; +return; +sp = sp + 0x90; +} + +static void f_swap_fi(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L462cec: +//swap_fi: +MEM_U32(sp + 8) = a2; +if ((int)a1 <= 0) {v0 = zero; +goto L462e18;} +v0 = zero; +a2 = a1 & 0x3; +if (a2 == 0) {a3 = a2; +goto L462d4c;} +a3 = a2; +t6 = zero << 2; +v1 = a0 + t6; +t1 = 0xff0000; +L462d10: +a2 = MEM_U32(v1 + 0); +v0 = v0 + 0x1; +t8 = a2 << 8; +t9 = t8 & t1; +t7 = a2 << 24; +t3 = (int)a2 >> 8; +t4 = t3 & 0xff00; +t2 = t7 | t9; +t5 = t2 | t4; +t6 = a2 >> 24; +t8 = t6 | t5; +MEM_U32(v1 + 0) = t8; +if (a3 != v0) {v1 = v1 + 0x4; +goto L462d10;} +v1 = v1 + 0x4; +if (v0 == a1) {t7 = v0 << 2; +goto L462e18;} +L462d4c: +t7 = v0 << 2; +t9 = a1 << 2; +t0 = t9 + a0; +v1 = a0 + t7; +t1 = 0xff0000; +L462d60: +a2 = MEM_U32(v1 + 0); +v0 = MEM_U32(v1 + 4); +t2 = a2 << 8; +t4 = t2 & t1; +t3 = a2 << 24; +t5 = (int)a2 >> 8; +t8 = t5 & 0xff00; +t6 = t3 | t4; +t7 = t6 | t8; +t9 = a2 >> 24; +t2 = t9 | t7; +t4 = v0 << 8; +t5 = t4 & t1; +t8 = (int)v0 >> 8; +t3 = v0 << 24; +a0 = MEM_U32(v1 + 8); +t6 = t3 | t5; +t9 = t8 & 0xff00; +MEM_U32(v1 + 0) = t2; +t7 = t6 | t9; +t2 = v0 >> 24; +t4 = t2 | t7; +t5 = a0 << 8; +t8 = t5 & t1; +t9 = (int)a0 >> 8; +t3 = a0 << 24; +a3 = MEM_U32(v1 + 12); +t6 = t3 | t8; +t2 = t9 & 0xff00; +MEM_U32(v1 + 4) = t4; +t7 = t6 | t2; +t4 = a0 >> 24; +t5 = t4 | t7; +t8 = a3 << 8; +t9 = t8 & t1; +t2 = (int)a3 >> 8; +t3 = a3 << 24; +t6 = t3 | t9; +t4 = t2 & 0xff00; +MEM_U32(v1 + 8) = t5; +t7 = t6 | t4; +t5 = a3 >> 24; +t8 = t5 | t7; +v1 = v1 + 0x10; +if (v1 != t0) {MEM_U32(v1 + -4) = t8; +goto L462d60;} +MEM_U32(v1 + -4) = t8; +L462e18: +//nop; +return; +//nop; +} + +static void f_swap_sym(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L462e20: +//swap_sym: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a1; +s1 = a2; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 64) = a0; +v0 = f_gethostsex(mem, sp); +goto L462e54; +MEM_U32(sp + 64) = a0; +L462e54: +gp = MEM_U32(sp + 32); +if ((int)s0 <= 0) {a2 = zero; +goto L4630a4;} +a2 = zero; +v1 = MEM_U32(sp + 64); +t0 = 0xff0000; +a3 = 0xff0000; +a1 = sp + 0x2c; +L462e70: +at = MEM_U32(v1 + 0); +a2 = a2 + 0x1; +MEM_U32(a1 + 0) = at; +t7 = MEM_U32(v1 + 4); +//nop; +MEM_U32(a1 + 4) = t7; +at = MEM_U32(v1 + 8); +//nop; +MEM_U32(a1 + 8) = at; +t8 = MEM_U32(sp + 44); +at = 0xf0000; +t1 = t8 << 8; +t2 = t1 & a3; +t9 = t8 << 24; +t3 = t9 | t2; +t4 = (int)t8 >> 8; +t2 = MEM_U32(sp + 48); +t5 = t4 & 0xff00; +t6 = t3 | t5; +t1 = t8 >> 24; +t4 = t2 << 8; +t9 = t6 | t1; +t3 = t4 & a3; +t8 = t2 << 24; +t7 = (int)t2 >> 8; +t6 = t7 & 0xff00; +t5 = t8 | t3; +t1 = t5 | t6; +t4 = t2 >> 24; +t8 = t1 | t4; +MEM_U32(sp + 44) = t9; +if (s1 != v0) {MEM_U32(sp + 48) = t8; +goto L462fc8;} +MEM_U32(sp + 48) = t8; +at = MEM_U32(a1 + 0); +//nop; +MEM_U32(v1 + 0) = at; +t2 = MEM_U32(a1 + 4); +//nop; +MEM_U32(v1 + 4) = t2; +at = MEM_U32(a1 + 8); +//nop; +MEM_U32(v1 + 8) = at; +t7 = MEM_U32(sp + 52); +//nop; +t6 = t7 << 8; +t9 = t6 & t0; +t5 = t7 << 24; +t4 = t7 >> 8; +t8 = t4 & 0xff00; +t1 = t5 | t9; +t3 = t1 | t8; +t2 = t7 >> 24; +t5 = t3 | t2; +MEM_U32(sp + 52) = t5; +t1 = MEM_U8(v1 + 8); +t4 = t5 << 2; +t8 = t1 & 0xff03; +t7 = t4 | t8; +MEM_U8(v1 + 8) = (uint8_t)t7; +t3 = MEM_U32(sp + 52); +t1 = MEM_U16(v1 + 8); +t2 = t3 << 21; +t6 = t2 >> 27; +t5 = t6 << 5; +t9 = t5 & 0x3e0; +t4 = t1 & 0xfc1f; +t8 = t9 | t4; +MEM_U16(v1 + 8) = (uint16_t)t8; +t7 = MEM_U32(sp + 52); +t1 = MEM_U8(v1 + 9); +t3 = t7 << 20; +t2 = t3 >> 31; +t6 = t2 << 4; +t5 = t6 & 0x10; +t9 = t1 & 0xffef; +t4 = t5 | t9; +MEM_U8(v1 + 9) = (uint8_t)t4; +t8 = MEM_U32(sp + 52); +a0 = MEM_U32(v1 + 8); +t7 = t8 >> 12; +t3 = t7 ^ a0; +t2 = t3 << 12; +t6 = t2 >> 12; +t1 = t6 ^ a0; +MEM_U32(v1 + 8) = t1; +goto L46309c; +MEM_U32(v1 + 8) = t1; +L462fc8: +t5 = MEM_U32(v1 + 8); +t8 = MEM_U8(sp + 55); +t9 = t5 >> 26; +t4 = t9 & 0x3f; +t7 = t8 & 0xffc0; +t3 = t4 | t7; +MEM_U8(sp + 55) = (uint8_t)t3; +t2 = MEM_U32(v1 + 8); +t8 = MEM_U16(sp + 54); +t6 = t2 << 6; +t1 = t6 >> 27; +t5 = t1 << 6; +t9 = t5 & 0x7c0; +t4 = t8 & 0xf83f; +t7 = t9 | t4; +MEM_U16(sp + 54) = (uint16_t)t7; +t3 = MEM_U32(v1 + 8); +t8 = MEM_U8(sp + 54); +t2 = t3 << 11; +t6 = t2 >> 31; +t1 = t6 << 3; +t5 = t1 & 0x8; +t9 = t8 & 0xfff7; +t4 = t5 | t9; +MEM_U8(sp + 54) = (uint8_t)t4; +t7 = MEM_U32(v1 + 8); +t2 = MEM_U32(sp + 52); +at = at | 0xffff; +t3 = t7 & at; +t6 = t2 >> 12; +t1 = t3 ^ t6; +t8 = t1 << 12; +t5 = t8 ^ t2; +t4 = t5 << 8; +t7 = t4 & t0; +t9 = t5 << 24; +t6 = t5 >> 8; +t1 = t6 & 0xff00; +t3 = t9 | t7; +t8 = t3 | t1; +t2 = t5 >> 24; +MEM_U32(sp + 52) = t5; +t4 = t8 | t2; +MEM_U32(sp + 52) = t4; +at = MEM_U32(a1 + 0); +//nop; +MEM_U32(v1 + 0) = at; +t6 = MEM_U32(a1 + 4); +//nop; +MEM_U32(v1 + 4) = t6; +at = MEM_U32(a1 + 8); +//nop; +MEM_U32(v1 + 8) = at; +L46309c: +if (a2 != s0) {v1 = v1 + 0xc; +goto L462e70;} +v1 = v1 + 0xc; +L4630a4: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static void f_swap_ext(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L4630b8: +//swap_ext: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb8; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a1; +s1 = a2; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 72) = a0; +v0 = f_gethostsex(mem, sp); +goto L4630ec; +MEM_U32(sp + 72) = a0; +L4630ec: +gp = MEM_U32(sp + 32); +if ((int)s0 <= 0) {a3 = zero; +goto L4634b8;} +a3 = zero; +v1 = MEM_U32(sp + 72); +t0 = 0xff0000; +a2 = sp + 0x30; +a1 = 0xff0000; +L463108: +at = MEM_U32(v1 + 0); +a3 = a3 + 0x1; +MEM_U32(a2 + 0) = at; +t7 = MEM_U32(v1 + 4); +//nop; +MEM_U32(a2 + 4) = t7; +at = MEM_U32(v1 + 8); +//nop; +MEM_U32(a2 + 8) = at; +t7 = MEM_U32(v1 + 12); +at = 0xf0000; +MEM_U32(a2 + 12) = t7; +t8 = MEM_U32(sp + 52); +at = at | 0xffff; +t1 = t8 << 8; +t2 = t1 & t0; +t9 = t8 << 24; +t3 = t9 | t2; +t4 = (int)t8 >> 8; +t2 = MEM_U32(sp + 56); +t5 = t4 & 0xff00; +t6 = t3 | t5; +t1 = t8 >> 24; +t4 = t2 << 8; +t9 = t6 | t1; +t3 = t4 & t0; +t8 = t2 << 24; +t7 = (int)t2 >> 8; +t6 = t7 & 0xff00; +t5 = t8 | t3; +t1 = t5 | t6; +t4 = t2 >> 24; +t8 = t1 | t4; +MEM_U32(sp + 52) = t9; +if (s1 != v0) {MEM_U32(sp + 56) = t8; +goto L463324;} +MEM_U32(sp + 56) = t8; +at = MEM_U32(a2 + 0); +//nop; +MEM_U32(v1 + 0) = at; +t2 = MEM_U32(a2 + 4); +//nop; +MEM_U32(v1 + 4) = t2; +at = MEM_U32(a2 + 8); +//nop; +MEM_U32(v1 + 8) = at; +t2 = MEM_U32(a2 + 12); +//nop; +MEM_U32(v1 + 12) = t2; +t7 = MEM_U32(sp + 60); +//nop; +t6 = t7 << 8; +t9 = t6 & a1; +t5 = t7 << 24; +t4 = t7 >> 8; +t8 = t4 & 0xff00; +t1 = t5 | t9; +t3 = t1 | t8; +t2 = t7 >> 24; +t5 = t3 | t2; +MEM_U32(sp + 60) = t5; +t1 = MEM_U8(v1 + 12); +t4 = t5 << 2; +t8 = t1 & 0xff03; +t7 = t4 | t8; +MEM_U8(v1 + 12) = (uint8_t)t7; +t3 = MEM_U32(sp + 60); +t1 = MEM_U16(v1 + 12); +t2 = t3 << 21; +t6 = t2 >> 27; +t5 = t6 << 5; +t9 = t5 & 0x3e0; +t4 = t1 & 0xfc1f; +t8 = t9 | t4; +MEM_U16(v1 + 12) = (uint16_t)t8; +t7 = MEM_U32(sp + 60); +t1 = MEM_U8(v1 + 13); +t3 = t7 << 20; +t2 = t3 >> 31; +t6 = t2 << 4; +t5 = t6 & 0x10; +t9 = t1 & 0xffef; +t4 = t5 | t9; +MEM_U8(v1 + 13) = (uint8_t)t4; +t8 = MEM_U32(sp + 60); +a0 = MEM_U32(v1 + 12); +t7 = t8 >> 12; +t3 = t7 ^ a0; +t2 = t3 << 12; +t6 = t2 >> 12; +t1 = t6 ^ a0; +MEM_U32(v1 + 12) = t1; +t5 = MEM_U32(sp + 48); +//nop; +t4 = t5 << 8; +t8 = t4 & a1; +t9 = t5 << 24; +t3 = t5 >> 8; +t2 = t3 & 0xff00; +t7 = t9 | t8; +t6 = t7 | t2; +t1 = t5 >> 24; +t4 = t6 | t1; +MEM_U32(sp + 48) = t4; +t9 = MEM_S16(sp + 48); +t5 = MEM_U16(v1 + 0); +MEM_U16(v1 + 2) = (uint16_t)t9; +t8 = MEM_U16(sp + 50); +t6 = t5 & 0xf800; +t7 = t8 >> 3; +t2 = t7 & 0x7ff; +t1 = t2 | t6; +MEM_U16(v1 + 0) = (uint16_t)t1; +t7 = MEM_U8(v1 + 0); +t9 = MEM_U32(sp + 48); +t5 = t7 & 0xff7f; +t3 = t9 << 7; +t7 = t3 | t5; +MEM_U8(v1 + 0) = (uint8_t)t7; +t6 = MEM_U32(sp + 48); +t3 = t7 & 0xbf; +t1 = t6 << 30; +t4 = t1 >> 31; +t9 = t4 << 6; +t8 = t9 & 0x40; +t7 = t8 | t3; +MEM_U8(v1 + 0) = (uint8_t)t7; +t2 = MEM_U32(sp + 48); +t8 = t7 & 0xdf; +t6 = t2 << 29; +t1 = t6 >> 31; +t4 = t1 << 5; +t9 = t4 & 0x20; +t3 = t9 | t8; +MEM_U8(v1 + 0) = (uint8_t)t3; +goto L4634b0; +MEM_U8(v1 + 0) = (uint8_t)t3; +L463324: +t5 = MEM_U32(v1 + 12); +t1 = MEM_U8(sp + 63); +t2 = t5 >> 26; +t6 = t2 & 0x3f; +t4 = t1 & 0xffc0; +t7 = t6 | t4; +MEM_U8(sp + 63) = (uint8_t)t7; +t9 = MEM_U32(v1 + 12); +t1 = MEM_U16(sp + 62); +t8 = t9 << 6; +t3 = t8 >> 27; +t5 = t3 << 6; +t2 = t5 & 0x7c0; +t6 = t1 & 0xf83f; +t4 = t2 | t6; +MEM_U16(sp + 62) = (uint16_t)t4; +t7 = MEM_U32(v1 + 12); +t1 = MEM_U8(sp + 62); +t9 = t7 << 11; +t8 = t9 >> 31; +t3 = t8 << 3; +t5 = t3 & 0x8; +t2 = t1 & 0xfff7; +t6 = t5 | t2; +MEM_U8(sp + 62) = (uint8_t)t6; +t4 = MEM_U32(v1 + 12); +t9 = MEM_U32(sp + 60); +t7 = t4 & at; +t8 = t9 >> 12; +t3 = t7 ^ t8; +t1 = t3 << 12; +t5 = t1 ^ t9; +t6 = t5 << 8; +t4 = t6 & a1; +t2 = t5 << 24; +t8 = t5 >> 8; +t3 = t8 & 0xff00; +t7 = t2 | t4; +t1 = t7 | t3; +t9 = t5 >> 24; +MEM_U32(sp + 60) = t5; +t6 = t1 | t9; +MEM_U32(sp + 60) = t6; +t2 = MEM_S16(v1 + 2); +t5 = MEM_U16(sp + 50); +MEM_U16(sp + 48) = (uint16_t)t2; +t4 = MEM_U16(v1 + 0); +t1 = t5 & 0x7; +t8 = t4 & 0x7ff; +t3 = t8 << 3; +t9 = t3 | t1; +MEM_U16(sp + 50) = (uint16_t)t9; +t6 = MEM_U32(v1 + 0); +t5 = MEM_U8(sp + 51); +t2 = t6 << 2; +t4 = t2 >> 31; +t8 = t4 << 2; +t7 = t8 & 0x4; +t3 = t5 & 0xfffb; +t5 = t7 | t3; +MEM_U8(sp + 51) = (uint8_t)t5; +t9 = MEM_U32(v1 + 0); +t7 = t5 & 0xfd; +t6 = t9 << 1; +t2 = t6 >> 31; +t4 = t2 << 1; +t8 = t4 & 0x2; +t4 = t8 | t7; +MEM_U8(sp + 51) = (uint8_t)t4; +t9 = MEM_U32(v1 + 0); +t1 = t4 & 0xfe; +t6 = t9 >> 31; +t2 = t6 & 0x1; +t5 = t2 | t1; +MEM_U8(sp + 51) = (uint8_t)t5; +t8 = MEM_U32(sp + 48); +//nop; +t9 = t8 << 8; +t6 = t9 & a1; +t7 = t8 << 24; +t4 = t8 >> 8; +t2 = t4 & 0xff00; +t3 = t7 | t6; +t1 = t3 | t2; +t5 = t8 >> 24; +t9 = t1 | t5; +MEM_U32(sp + 48) = t9; +at = MEM_U32(a2 + 0); +//nop; +MEM_U32(v1 + 0) = at; +t4 = MEM_U32(a2 + 4); +//nop; +MEM_U32(v1 + 4) = t4; +at = MEM_U32(a2 + 8); +//nop; +MEM_U32(v1 + 8) = at; +t4 = MEM_U32(a2 + 12); +//nop; +MEM_U32(v1 + 12) = t4; +L4634b0: +if (a3 != s0) {v1 = v1 + 0x10; +goto L463108;} +v1 = v1 + 0x10; +L4634b8: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x48; +return; +sp = sp + 0x48; +} + +static void f_swap_pd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L4634cc: +//swap_pd: +MEM_U32(sp + 8) = a2; +if ((int)a1 <= 0) {v0 = zero; +goto L463730;} +v0 = zero; +v1 = a0; +t1 = 0xff0000; +t0 = 0xff0000; +L4634e4: +a0 = MEM_U32(v1 + 0); +a2 = MEM_U32(v1 + 4); +t6 = a0 >> 24; +t7 = a0 << 24; +t9 = a0 << 8; +t2 = t9 & t0; +t8 = t6 | t7; +t4 = a0 >> 8; +t5 = t4 & 0xff00; +t3 = t8 | t2; +t6 = t3 | t5; +t9 = a2 << 8; +t8 = t9 & t1; +t4 = (int)a2 >> 8; +t7 = a2 << 24; +a0 = MEM_U32(v1 + 8); +MEM_U32(v1 + 0) = t6; +t2 = t7 | t8; +t3 = t4 & 0xff00; +t5 = t2 | t3; +t6 = a2 >> 24; +t9 = t6 | t5; +t8 = a0 << 8; +t4 = t8 & t1; +t3 = (int)a0 >> 8; +t7 = a0 << 24; +a2 = MEM_U32(v1 + 12); +MEM_U32(v1 + 4) = t9; +t2 = t7 | t4; +t6 = t3 & 0xff00; +t5 = t2 | t6; +t9 = a0 >> 24; +t8 = t9 | t5; +t4 = a2 << 8; +t3 = t4 & t1; +t6 = (int)a2 >> 8; +t7 = a2 << 24; +a0 = MEM_U32(v1 + 16); +MEM_U32(v1 + 8) = t8; +t2 = t7 | t3; +t9 = t6 & 0xff00; +t5 = t2 | t9; +t8 = a2 >> 24; +t4 = t8 | t5; +t3 = a0 << 8; +t6 = t3 & t1; +t9 = (int)a0 >> 8; +t7 = a0 << 24; +a2 = MEM_U32(v1 + 20); +MEM_U32(v1 + 12) = t4; +t2 = t7 | t6; +t8 = t9 & 0xff00; +t5 = t2 | t8; +t4 = a0 >> 24; +t3 = t4 | t5; +t6 = a2 << 8; +t9 = t6 & t1; +t8 = (int)a2 >> 8; +t7 = a2 << 24; +a0 = MEM_U32(v1 + 24); +MEM_U32(v1 + 16) = t3; +t2 = t7 | t9; +t4 = t8 & 0xff00; +t5 = t2 | t4; +t3 = a2 >> 24; +t6 = t3 | t5; +t9 = a0 << 8; +t8 = t9 & t1; +t4 = (int)a0 >> 8; +t7 = a0 << 24; +a2 = MEM_U32(v1 + 28); +MEM_U32(v1 + 20) = t6; +t2 = t7 | t8; +t3 = t4 & 0xff00; +t5 = t2 | t3; +t6 = a0 >> 24; +t9 = t6 | t5; +t8 = a2 << 8; +t4 = t8 & t1; +t3 = (int)a2 >> 8; +t7 = a2 << 24; +a0 = MEM_U32(v1 + 32); +MEM_U32(v1 + 24) = t9; +t2 = t7 | t4; +t6 = t3 & 0xff00; +t5 = t2 | t6; +t9 = a2 >> 24; +t8 = t9 | t5; +t4 = a0 << 8; +t3 = t4 & t1; +t6 = (int)a0 >> 8; +t7 = a0 << 24; +MEM_U32(v1 + 28) = t8; +t2 = t7 | t3; +t9 = t6 & 0xff00; +t5 = t2 | t9; +t8 = a0 >> 24; +t6 = MEM_S16(v1 + 36); +t4 = t8 | t5; +MEM_U32(v1 + 32) = t4; +t4 = MEM_S16(v1 + 38); +t7 = t6 & 0xffff; +t3 = t7 >> 8; +t2 = t6 << 8; +a0 = MEM_U32(v1 + 40); +t9 = t3 | t2; +t8 = t4 & 0xffff; +t5 = t8 >> 8; +t7 = t4 << 8; +t6 = t5 | t7; +MEM_U16(v1 + 36) = (uint16_t)t9; +t2 = a0 << 8; +t9 = t2 & t1; +t4 = (int)a0 >> 8; +t3 = a0 << 24; +a2 = MEM_U32(v1 + 44); +MEM_U16(v1 + 38) = (uint16_t)t6; +t8 = t3 | t9; +t5 = t4 & 0xff00; +t7 = t8 | t5; +t6 = a0 >> 24; +t2 = t6 | t7; +t9 = a2 << 8; +t4 = t9 & t1; +t5 = (int)a2 >> 8; +t3 = a2 << 24; +a0 = MEM_U32(v1 + 48); +MEM_U32(v1 + 40) = t2; +t8 = t3 | t4; +t6 = t5 & 0xff00; +t7 = t8 | t6; +t2 = a2 >> 24; +t9 = t2 | t7; +t4 = a0 << 8; +t5 = t4 & t1; +t6 = (int)a0 >> 8; +t3 = a0 << 24; +MEM_U32(v1 + 44) = t9; +t8 = t3 | t5; +t2 = t6 & 0xff00; +t7 = t8 | t2; +t9 = a0 >> 24; +v0 = v0 + 0x1; +t4 = t9 | t7; +v1 = v1 + 0x34; +if (v0 != a1) {MEM_U32(v1 + -4) = t4; +goto L4634e4;} +MEM_U32(v1 + -4) = t4; +L463730: +//nop; +return; +//nop; +} + +static void f_swap_dn(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L463738: +//swap_dn: +MEM_U32(sp + 8) = a2; +if ((int)a1 <= 0) {v0 = zero; +goto L46387c;} +v0 = zero; +v1 = a1 & 0x1; +if (v1 == 0) {t1 = 0xff0000; +goto L4637b0;} +t1 = 0xff0000; +a2 = MEM_U32(a0 + 0); +a3 = MEM_U32(a0 + 4); +t6 = a2 >> 24; +t7 = a2 << 24; +t9 = a2 << 8; +t2 = t9 & t1; +t8 = t6 | t7; +t4 = a2 >> 8; +t5 = t4 & 0xff00; +t3 = t8 | t2; +t6 = t3 | t5; +t2 = a3 << 8; +t7 = a3 >> 24; +t9 = a3 << 24; +t8 = t7 | t9; +t4 = t2 & t1; +MEM_U32(a0 + 0) = t6; +t5 = a3 >> 8; +t6 = t5 & 0xff00; +t3 = t8 | t4; +t7 = t3 | t6; +v0 = 0x1; +if (v0 == a1) {MEM_U32(a0 + 4) = t7; +goto L46387c;} +MEM_U32(a0 + 4) = t7; +L4637b0: +t9 = v0 << 3; +t2 = a1 << 3; +t0 = t2 + a0; +v1 = a0 + t9; +t1 = 0xff0000; +L4637c4: +v0 = MEM_U32(v1 + 0); +a0 = MEM_U32(v1 + 4); +t8 = v0 >> 24; +t4 = v0 << 24; +t3 = v0 << 8; +t6 = t3 & t1; +t5 = t8 | t4; +t9 = v0 >> 8; +t2 = t9 & 0xff00; +t7 = t5 | t6; +t8 = t7 | t2; +t6 = a0 << 8; +t4 = a0 >> 24; +t3 = a0 << 24; +a2 = MEM_U32(v1 + 8); +MEM_U32(v1 + 0) = t8; +t5 = t4 | t3; +t9 = t6 & t1; +t2 = a0 >> 8; +t8 = t2 & 0xff00; +t7 = t5 | t9; +t4 = t7 | t8; +t9 = a2 << 8; +t6 = a2 << 24; +t3 = a2 >> 24; +a3 = MEM_U32(v1 + 12); +t5 = t3 | t6; +t2 = t9 & t1; +MEM_U32(v1 + 4) = t4; +t8 = a2 >> 8; +t4 = t8 & 0xff00; +t7 = t5 | t2; +t3 = t7 | t4; +t2 = a3 << 8; +t9 = a3 << 24; +t6 = a3 >> 24; +t5 = t6 | t9; +t8 = t2 & t1; +MEM_U32(v1 + 8) = t3; +t4 = a3 >> 8; +t3 = t4 & 0xff00; +t7 = t5 | t8; +t6 = t7 | t3; +v1 = v1 + 0x10; +if (v1 != t0) {MEM_U32(v1 + -4) = t6; +goto L4637c4;} +MEM_U32(v1 + -4) = t6; +L46387c: +//nop; +return; +//nop; +} + +static void f_swap_opt(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L463a3c: +//swap_opt: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +s0 = a1; +s1 = a2; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 64) = a0; +v0 = f_gethostsex(mem, sp); +goto L463a70; +MEM_U32(sp + 64) = a0; +L463a70: +gp = MEM_U32(sp + 32); +if ((int)s0 <= 0) {t0 = zero; +goto L463cb8;} +t0 = zero; +v1 = MEM_U32(sp + 64); +a3 = sp + 0x2c; +a2 = 0xff0000; +L463a88: +at = MEM_U32(v1 + 0); +t0 = t0 + 0x1; +MEM_U32(a3 + 0) = at; +t7 = MEM_U32(v1 + 4); +//nop; +MEM_U32(a3 + 4) = t7; +at = MEM_U32(v1 + 8); +//nop; +MEM_U32(a3 + 8) = at; +t8 = MEM_U32(sp + 52); +at = 0xff0000; +t1 = t8 << 8; +t2 = t1 & a2; +t9 = t8 << 24; +t4 = t8 >> 8; +t5 = t4 & 0xff00; +t3 = t9 | t2; +t6 = t3 | t5; +t7 = t8 >> 24; +t1 = t6 | t7; +if (s1 != v0) {MEM_U32(sp + 52) = t1; +goto L463bc8;} +MEM_U32(sp + 52) = t1; +at = MEM_U32(a3 + 0); +//nop; +MEM_U32(v1 + 0) = at; +t2 = MEM_U32(a3 + 4); +//nop; +MEM_U32(v1 + 4) = t2; +at = MEM_U32(a3 + 8); +//nop; +MEM_U32(v1 + 8) = at; +t4 = MEM_U32(sp + 44); +at = 0xff0000; +t5 = t4 << 8; +t8 = t5 & a2; +t3 = t4 << 24; +t6 = t3 | t8; +t7 = t4 >> 8; +t3 = MEM_U32(sp + 48); +t1 = t7 & 0xff00; +t9 = t6 | t1; +t2 = t4 >> 24; +t5 = t9 | t2; +t7 = t3 << 8; +t6 = t7 & a2; +t4 = t3 >> 8; +t8 = t3 << 24; +MEM_U32(sp + 44) = t5; +t1 = t8 | t6; +t9 = t4 & 0xff00; +t2 = t1 | t9; +t5 = t3 >> 24; +t8 = MEM_U8(sp + 44); +t7 = t2 | t5; +MEM_U32(sp + 48) = t7; +MEM_U8(v1 + 0) = (uint8_t)t8; +t6 = MEM_U32(sp + 44); +a0 = MEM_U32(v1 + 0); +at = at | 0xffff; +t4 = t6 & at; +t1 = t4 ^ a0; +t9 = t1 << 8; +t3 = t9 >> 8; +t2 = t3 ^ a0; +MEM_U32(v1 + 0) = t2; +t5 = MEM_U32(sp + 48); +a1 = MEM_U32(v1 + 4); +t7 = t5 >> 12; +t8 = t7 ^ a1; +t6 = t8 << 12; +t4 = t6 >> 12; +t1 = t4 ^ a1; +MEM_U32(v1 + 4) = t1; +t7 = MEM_U16(v1 + 4); +t9 = MEM_U32(sp + 48); +t8 = t7 & 0xf; +t5 = t9 << 4; +t6 = t5 | t8; +MEM_U16(v1 + 4) = (uint16_t)t6; +goto L463cb0; +MEM_U16(v1 + 4) = (uint16_t)t6; +L463bc8: +t4 = MEM_U8(v1 + 0); +at = at | 0xffff; +MEM_U8(sp + 44) = (uint8_t)t4; +t1 = MEM_U32(v1 + 0); +t3 = MEM_U32(sp + 44); +t9 = t1 & at; +t2 = t9 ^ t3; +t7 = t2 << 8; +t5 = t7 >> 8; +t8 = t5 ^ t3; +MEM_U32(sp + 44) = t8; +t6 = MEM_U32(v1 + 4); +t1 = MEM_U32(sp + 48); +at = 0xf0000; +at = at | 0xffff; +t4 = t6 & at; +t9 = t1 >> 12; +t2 = t4 ^ t9; +t7 = t2 << 12; +t5 = t7 ^ t1; +MEM_U32(sp + 48) = t5; +t3 = MEM_U32(v1 + 4); +t9 = MEM_U16(sp + 50); +t6 = t3 >> 20; +t4 = t6 & 0xfff; +t2 = t9 & 0xf000; +t7 = t4 | t2; +t5 = t8 << 8; +t3 = t5 & a2; +t1 = t8 << 24; +MEM_U16(sp + 50) = (uint16_t)t7; +t6 = t1 | t3; +t9 = t8 >> 8; +t1 = MEM_U32(sp + 48); +t4 = t9 & 0xff00; +t2 = t6 | t4; +t7 = t8 >> 24; +t5 = t2 | t7; +t9 = t1 << 8; +t6 = t9 & a2; +t8 = t1 >> 8; +t3 = t1 << 24; +MEM_U32(sp + 44) = t5; +t4 = t3 | t6; +t2 = t8 & 0xff00; +t7 = t4 | t2; +t5 = t1 >> 24; +t9 = t7 | t5; +MEM_U32(sp + 48) = t9; +at = MEM_U32(a3 + 0); +//nop; +MEM_U32(v1 + 0) = at; +t8 = MEM_U32(a3 + 4); +//nop; +MEM_U32(v1 + 4) = t8; +at = MEM_U32(a3 + 8); +//nop; +MEM_U32(v1 + 8) = at; +L463cb0: +if (t0 != s0) {v1 = v1 + 0xc; +goto L463a88;} +v1 = v1 + 0xc; +L463cb8: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x40; +return; +sp = sp + 0x40; +} + +static uint32_t f_gethostsex(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L464b80: +//gethostsex: +sp = sp + 0xfffffff8; +t6 = 0x1; +MEM_U32(sp + 4) = t6; +t7 = MEM_S8(sp + 4); +at = 0x1; +if (t7 != at) {v0 = zero; +goto L464ba4;} +v0 = zero; +v0 = 0x1; +goto L464ba4; +v0 = 0x1; +L464ba4: +sp = sp + 0x8; +return v0; +sp = sp + 0x8; +//nop; +} + +static void f_st_error(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L464bb0: +//st_error: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 48) = a2; +a2 = 0x10006430; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +a1 = 0x1000ec70; +a0 = 0xfb528e4; +//nop; +MEM_U32(sp + 36) = ra; +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 52) = a3; +a1 = a1; +a0 = a0 + 0x20; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L464bf8; +a0 = a0 + 0x20; +L464bf8: +gp = MEM_U32(sp + 32); +t6 = MEM_U32(sp + 52); +t7 = MEM_U32(sp + 56); +a0 = 0xfb528e4; +//nop; +a1 = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 48); +MEM_U32(sp + 16) = t6; +MEM_U32(sp + 20) = t7; +a0 = a0 + 0x20; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L464c28; +a0 = a0 + 0x20; +L464c28: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0xfb528e4; +a1 = 0x1000ec7c; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L464c48; +a1 = a1; +L464c48: +gp = MEM_U32(sp + 32); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L464c60; +//nop; +L464c60: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static uint32_t f_ldfsymorder(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L464c70: +//ldfsymorder: +a2 = MEM_U32(a0 + 12); +v0 = a1 + 0x60; +if (a2 == 0) {//nop; +goto L464ca0;} +//nop; +t6 = MEM_U32(a0 + 8); +//nop; +if (t6 == 0) {//nop; +goto L464ca0;} +//nop; +if (v0 == a2) {//nop; +goto L464ca0;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464ca0: +v1 = MEM_U32(a0 + 8); +//nop; +t7 = v1 & 0x3; +if (t7 == 0) {//nop; +goto L464cbc;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464cbc: +a1 = MEM_U32(a0 + 28); +//nop; +if (a1 == 0) {//nop; +goto L464cf0;} +//nop; +t8 = MEM_U32(a0 + 24); +//nop; +if (t8 == 0) {//nop; +goto L464cf0;} +//nop; +t9 = v0 + v1; +if (t9 == a1) {//nop; +goto L464cf0;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464cf0: +t0 = MEM_U32(a0 + 24); +//nop; +t1 = t0 << 2; +t1 = t1 - t0; +t1 = t1 << 2; +t1 = t1 + t0; +t1 = t1 << 2; +v1 = v1 + t1; +t2 = v1 & 0x3; +if (t2 == 0) {//nop; +goto L464d24;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464d24: +a1 = MEM_U32(a0 + 36); +//nop; +if (a1 == 0) {//nop; +goto L464d54;} +//nop; +t3 = MEM_U32(a0 + 32); +t4 = v0 + v1; +if (t3 == 0) {//nop; +goto L464d54;} +//nop; +if (t4 == a1) {//nop; +goto L464d54;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464d54: +t5 = MEM_U32(a0 + 32); +a2 = 0xc; +lo = t5 * a2; +hi = (uint32_t)((uint64_t)t5 * (uint64_t)a2 >> 32); +t6 = lo; +v1 = v1 + t6; +t7 = v1 & 0x3; +if (t7 == 0) {//nop; +goto L464d7c;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464d7c: +a1 = MEM_U32(a0 + 44); +//nop; +if (a1 == 0) {//nop; +goto L464db0;} +//nop; +t8 = MEM_U32(a0 + 40); +//nop; +if (t8 == 0) {//nop; +goto L464db0;} +//nop; +t9 = v0 + v1; +if (t9 == a1) {//nop; +goto L464db0;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464db0: +t0 = MEM_U32(a0 + 40); +//nop; +lo = t0 * a2; +hi = (uint32_t)((uint64_t)t0 * (uint64_t)a2 >> 32); +t1 = lo; +v1 = v1 + t1; +t2 = v1 & 0x3; +if (t2 == 0) {//nop; +goto L464dd8;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464dd8: +a1 = MEM_U32(a0 + 52); +//nop; +if (a1 == 0) {//nop; +goto L464e08;} +//nop; +t3 = MEM_U32(a0 + 48); +t4 = v0 + v1; +if (t3 == 0) {//nop; +goto L464e08;} +//nop; +if (t4 == a1) {//nop; +goto L464e08;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464e08: +t5 = MEM_U32(a0 + 48); +//nop; +t6 = t5 << 2; +v1 = v1 + t6; +t7 = v1 & 0x3; +if (t7 == 0) {//nop; +goto L464e2c;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464e2c: +a1 = MEM_U32(a0 + 60); +//nop; +if (a1 == 0) {//nop; +goto L464e60;} +//nop; +t8 = MEM_U32(a0 + 56); +//nop; +if (t8 == 0) {//nop; +goto L464e60;} +//nop; +t9 = v0 + v1; +if (t9 == a1) {//nop; +goto L464e60;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464e60: +t0 = MEM_U32(a0 + 56); +//nop; +v1 = v1 + t0; +t1 = v1 & 0x3; +if (t1 == 0) {//nop; +goto L464e80;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464e80: +a1 = MEM_U32(a0 + 68); +//nop; +if (a1 == 0) {//nop; +goto L464eb0;} +//nop; +t2 = MEM_U32(a0 + 64); +t3 = v0 + v1; +if (t2 == 0) {//nop; +goto L464eb0;} +//nop; +if (t3 == a1) {//nop; +goto L464eb0;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464eb0: +t4 = MEM_U32(a0 + 64); +//nop; +v1 = v1 + t4; +t5 = v1 & 0x3; +if (t5 == 0) {//nop; +goto L464ed0;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464ed0: +a1 = MEM_U32(a0 + 76); +//nop; +if (a1 == 0) {//nop; +goto L464f00;} +//nop; +t6 = MEM_U32(a0 + 72); +t7 = v0 + v1; +if (t6 == 0) {//nop; +goto L464f00;} +//nop; +if (t7 == a1) {//nop; +goto L464f00;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464f00: +t8 = MEM_U32(a0 + 72); +//nop; +t9 = t8 << 3; +t9 = t9 + t8; +t9 = t9 << 3; +v1 = v1 + t9; +t0 = v1 & 0x3; +if (t0 == 0) {//nop; +goto L464f2c;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464f2c: +a1 = MEM_U32(a0 + 84); +//nop; +if (a1 == 0) {//nop; +goto L464f5c;} +//nop; +t1 = MEM_U32(a0 + 80); +t2 = v0 + v1; +if (t1 == 0) {//nop; +goto L464f5c;} +//nop; +if (t2 == a1) {//nop; +goto L464f5c;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464f5c: +t3 = MEM_U32(a0 + 80); +//nop; +t4 = t3 << 2; +v1 = v1 + t4; +t5 = v1 & 0x3; +if (t5 == 0) {//nop; +goto L464f80;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464f80: +a1 = MEM_U32(a0 + 92); +//nop; +if (a1 == 0) {//nop; +goto L464fb0;} +//nop; +t6 = MEM_U32(a0 + 88); +t7 = v0 + v1; +if (t6 == 0) {//nop; +goto L464fb0;} +//nop; +if (t7 == a1) {//nop; +goto L464fb0;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464fb0: +t8 = MEM_U32(a0 + 88); +//nop; +t9 = t8 << 4; +v1 = v1 + t9; +t0 = v1 & 0x3; +if (t0 == 0) {//nop; +goto L464fd4;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L464fd4: +a1 = MEM_U32(a0 + 20); +//nop; +if (a1 == 0) {//nop; +goto L465004;} +//nop; +t1 = MEM_U32(a0 + 16); +t2 = v0 + v1; +if (t1 == 0) {//nop; +goto L465004;} +//nop; +if (t2 == a1) {//nop; +goto L465004;} +//nop; +v0 = zero; +return v0; +v0 = zero; +L465004: +t3 = MEM_U32(a0 + 16); +//nop; +t4 = t3 << 3; +v1 = v1 + t4; +t5 = v1 & 0x3; +if (t5 == 0) {v0 = v1; +goto L465028;} +v0 = v1; +v0 = zero; +return v0; +v0 = zero; +L465028: +//nop; +return v0; +//nop; +} + +static void f_st_warning(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L465030: +//st_warning: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +a1 = 0x1000ec80; +a0 = 0xfb528e4; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 48) = a2; +MEM_U32(sp + 52) = a3; +a1 = a1; +a0 = a0 + 0x20; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L465070; +a0 = a0 + 0x20; +L465070: +gp = MEM_U32(sp + 32); +//nop; +a2 = 0x10006430; +a0 = 0xfb528e4; +a1 = 0x1000ec84; +//nop; +a2 = MEM_U32(a2 + 0); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L465098; +a1 = a1; +L465098: +gp = MEM_U32(sp + 32); +t6 = MEM_U32(sp + 52); +t7 = MEM_U32(sp + 56); +a0 = 0xfb528e4; +//nop; +a1 = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 48); +MEM_U32(sp + 16) = t6; +MEM_U32(sp + 20) = t7; +a0 = a0 + 0x20; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L4650c8; +a0 = a0 + 0x20; +L4650c8: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0xfb528e4; +a1 = 0x1000ec94; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L4650e8; +a1 = a1; +L4650e8: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x28; +return; +sp = sp + 0x28; +//nop; +//nop; +} + +static void f__md_st_internal(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L465100: +//_md_st_internal: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 48) = a2; +a2 = 0x10006430; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +a1 = 0x1000eca0; +a0 = 0xfb528e4; +//nop; +MEM_U32(sp + 36) = ra; +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 52) = a3; +a1 = a1; +a0 = a0 + 0x20; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L465148; +a0 = a0 + 0x20; +L465148: +gp = MEM_U32(sp + 32); +t6 = MEM_U32(sp + 52); +t7 = MEM_U32(sp + 56); +a0 = 0xfb528e4; +//nop; +a1 = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 48); +MEM_U32(sp + 16) = t6; +MEM_U32(sp + 20) = t7; +a0 = a0 + 0x20; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L465178; +a0 = a0 + 0x20; +L465178: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0xfb528e4; +a1 = 0x1000ecb0; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L465198; +a1 = a1; +L465198: +gp = MEM_U32(sp + 32); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L4651b0; +//nop; +L4651b0: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f__md_st_error(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4651c0: +//_md_st_error: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 48) = a2; +a2 = 0x10006430; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +a1 = 0x1000ecb4; +a0 = 0xfb528e4; +//nop; +MEM_U32(sp + 36) = ra; +a2 = MEM_U32(a2 + 0); +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 52) = a3; +a1 = a1; +a0 = a0 + 0x20; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L465208; +a0 = a0 + 0x20; +L465208: +gp = MEM_U32(sp + 32); +t6 = MEM_U32(sp + 52); +t7 = MEM_U32(sp + 56); +a0 = 0xfb528e4; +//nop; +a1 = MEM_U32(sp + 40); +a2 = MEM_U32(sp + 44); +a3 = MEM_U32(sp + 48); +MEM_U32(sp + 16) = t6; +MEM_U32(sp + 20) = t7; +a0 = a0 + 0x20; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L465238; +a0 = a0 + 0x20; +L465238: +gp = MEM_U32(sp + 32); +//nop; +a0 = 0xfb528e4; +a1 = 0x1000ecc0; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L465258; +a1 = a1; +L465258: +gp = MEM_U32(sp + 32); +a0 = 0x1; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L465270; +//nop; +L465270: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static uint32_t f__md_st_str_extiss(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L465280: +//_md_st_str_extiss: +//nop; +//nop; +//nop; +if ((int)a0 < 0) {v0 = zero; +goto L4652c4;} +v0 = zero; +v1 = 0x1001b288; +//nop; +v1 = MEM_U32(v1 + 0); +//nop; +t6 = MEM_U32(v1 + 40); +//nop; +at = (int)a0 < (int)t6; +if (at == 0) {//nop; +goto L4652c4;} +//nop; +t7 = MEM_U32(v1 + 36); +v0 = t7 + a0; +return v0; +v0 = t7 + a0; +L4652c4: +//nop; +return v0; +//nop; +} + +static uint32_t f__md_st_currentifd(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L4653cc: +//_md_st_currentifd: +//nop; +//nop; +//nop; +a0 = 0x1001b28c; +sp = sp + 0xffffffe0; +a0 = MEM_U32(a0 + 0); +MEM_U32(sp + 28) = ra; +if (a0 != 0) {MEM_U32(sp + 24) = gp; +goto L4653f8;} +MEM_U32(sp + 24) = gp; +v0 = 0xffffffff; +goto L465410; +v0 = 0xffffffff; +L4653f8: +//nop; +//nop; +//nop; +v0 = f_st_ifd_pcfd(mem, sp, a0, a1, a2); +goto L465408; +//nop; +L465408: +gp = MEM_U32(sp + 24); +//nop; +L465410: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return v0; +//nop; +} + +static uint32_t f__md_st_malloc(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L465420: +//_md_st_malloc: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 48) = a2; +v0 = MEM_U32(a1 + 0); +s0 = a1; +if (v0 == 0) {s1 = a0; +goto L465464;} +s1 = a0; +if (a0 == 0) {at = 0xffffffff; +goto L465464;} +at = 0xffffffff; +if (a0 != at) {t0 = v0 << 1; +goto L465510;} +t0 = v0 << 1; +L465464: +if (a3 != 0) {MEM_U32(s0 + 0) = a3; +goto L4654ac;} +MEM_U32(s0 + 0) = a3; +//nop; +a0 = 0x1; +//nop; +v0 = wrapper_malloc(mem, a0); +goto L46547c; +//nop; +L46547c: +gp = MEM_U32(sp + 32); +if (v0 != 0) {s1 = v0; +goto L4654a4;} +s1 = v0; +a0 = 0x1000ecc4; +//nop; +a0 = a0; +//nop; +f__md_st_error(mem, sp, a0); +goto L46549c; +//nop; +L46549c: +gp = MEM_U32(sp + 32); +//nop; +L4654a4: +v0 = s1; +goto L46556c; +v0 = s1; +L4654ac: +t6 = MEM_U32(s0 + 0); +t7 = MEM_U32(sp + 48); +//nop; +lo = t6 * t7; +hi = (uint32_t)((uint64_t)t6 * (uint64_t)t7 >> 32); +a0 = lo; +//nop; +v0 = wrapper_malloc(mem, a0); +goto L4654c8; +//nop; +L4654c8: +gp = MEM_U32(sp + 32); +if (v0 != 0) {s1 = v0; +goto L465568;} +s1 = v0; +t8 = MEM_U32(s0 + 0); +t9 = MEM_U32(sp + 48); +//nop; +lo = t8 * t9; +hi = (uint32_t)((uint64_t)t8 * (uint64_t)t9 >> 32); +a1 = lo; +if (a1 == 0) {v0 = s1; +goto L46556c;} +v0 = s1; +a0 = 0x1000ed04; +//nop; +a0 = a0; +//nop; +f__md_st_error(mem, sp, a0); +goto L465504; +//nop; +L465504: +gp = MEM_U32(sp + 32); +v0 = s1; +goto L46556c; +v0 = s1; +L465510: +MEM_U32(s0 + 0) = t0; +t2 = MEM_U32(sp + 48); +//nop; +lo = t0 * t2; +hi = (uint32_t)((uint64_t)t0 * (uint64_t)t2 >> 32); +a0 = s1; +a1 = lo; +//nop; +v0 = wrapper_realloc(mem, a0, a1); +goto L465530; +//nop; +L465530: +gp = MEM_U32(sp + 32); +if (v0 != 0) {s1 = v0; +goto L465568;} +s1 = v0; +t3 = MEM_U32(s0 + 0); +t4 = MEM_U32(sp + 48); +a0 = 0x1000ed48; +lo = t3 * t4; +hi = (uint32_t)((uint64_t)t3 * (uint64_t)t4 >> 32); +//nop; +a0 = a0; +a1 = lo; +//nop; +f__md_st_error(mem, sp, a0); +goto L465560; +//nop; +L465560: +gp = MEM_U32(sp + 32); +//nop; +L465568: +v0 = s1; +L46556c: +ra = MEM_U32(sp + 36); +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x28; +return v0; +sp = sp + 0x28; +} + +static void f_exit(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L465630: +//exit: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb0; +MEM_U32(sp + 20) = s0; +s0 = 0x1001b290; +MEM_U32(sp + 36) = ra; +s0 = MEM_U32(s0 + 0); +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s2; +MEM_U32(sp + 24) = s1; +if (s0 == 0) {MEM_U32(sp + 80) = a0; +goto L4656c4;} +MEM_U32(sp + 80) = a0; +s2 = 0x1000ed90; +s1 = sp + 0x34; +s2 = s2; +L465670: +//nop; +//nop; +//nop; +v0 = wrapper_getpid(); +goto L465680; +//nop; +L465680: +gp = MEM_U32(sp + 32); +a0 = s1; +//nop; +a1 = s2; +a2 = s0; +a3 = v0; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_sprintf(mem, a0, a1, sp); +goto L46569c; +a3 = v0; +L46569c: +gp = MEM_U32(sp + 32); +a0 = s1; +//nop; +//nop; +//nop; +v0 = wrapper_unlink(mem, a0); +goto L4656b4; +//nop; +L4656b4: +s0 = s0 + 0xffffffff; +gp = MEM_U32(sp + 32); +if (s0 != 0) {//nop; +goto L465670;} +//nop; +L4656c4: +//nop; +a0 = 0xe; +//nop; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper__prctl(mem, a0, sp); +goto L4656d4; +//nop; +L4656d4: +gp = MEM_U32(sp + 32); +at = (int)v0 < (int)0x2; +if (at == 0) {//nop; +goto L465724;} +//nop; +//nop; +//nop; +//nop; +wrapper__exithandle(mem); +goto L4656f4; +//nop; +L4656f4: +gp = MEM_U32(sp + 32); +//nop; +t6 = 0x1; +//nop; +if (t6 == 0) {//nop; +goto L465724;} +//nop; +//nop; +a0 = zero; +//nop; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper__rld_new_interface(mem, a0, sp); +goto L46571c; +//nop; +L46571c: +gp = MEM_U32(sp + 32); +//nop; +L465724: +//nop; +//nop; +//nop; +wrapper__cleanup(mem); +goto L465734; +//nop; +L465734: +gp = MEM_U32(sp + 32); +a0 = MEM_U32(sp + 80); +//nop; +//nop; +//nop; +wrapper__exit(mem, a0); +goto L46574c; +//nop; +L46574c: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +s0 = MEM_U32(sp + 20); +s1 = MEM_U32(sp + 24); +s2 = MEM_U32(sp + 28); +sp = sp + 0x50; +return; +sp = sp + 0x50; +//nop; +//nop; +} + +static void f_get(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L465770: +//get: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t6 = MEM_U8(a0 + 12); +a2 = a0; +t7 = t6 & 0x1; +if (t7 != 0) {//nop; +goto L4657c0;} +//nop; +a0 = 0xfb528e4; +a1 = 0x1000eda0; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L4657b4; +a1 = a1; +L4657b4: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L465850; +ra = MEM_U32(sp + 28); +L4657c0: +t0 = MEM_U32(a2 + 0); +t8 = MEM_U32(a2 + 4); +t1 = t0 - a1; +at = (int)t1 < (int)a1; +t9 = t8 + a1; +MEM_U32(a2 + 4) = t9; +if (at == 0) {MEM_U32(a2 + 0) = t1; +goto L46584c;} +MEM_U32(a2 + 0) = t1; +if ((int)t1 <= 0) {//nop; +goto L465810;} +//nop; +a0 = 0xfb528e4; +a1 = 0x1000edc8; +//nop; +MEM_U32(sp + 32) = a2; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L465804; +a1 = a1; +L465804: +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 32); +//nop; +L465810: +//nop; +a0 = a2; +MEM_U32(sp + 32) = a2; +v0 = wrapper___filbuf(mem, a0); +goto L465820; +MEM_U32(sp + 32) = a2; +L465820: +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 32); +at = 0xffffffff; +if (v0 == at) {a0 = v0; +goto L46584c;} +a0 = v0; +//nop; +a1 = a2; +//nop; +v0 = wrapper_ungetc(mem, a0, a1); +goto L465844; +//nop; +L465844: +gp = MEM_U32(sp + 24); +//nop; +L46584c: +ra = MEM_U32(sp + 28); +L465850: +sp = sp + 0x20; +//nop; +return; +//nop; +//nop; +} + +static uint32_t f_eof(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L465860: +//eof: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +v1 = a0 < 0x1; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if (v1 != 0) {a1 = a0; +goto L465904;} +a1 = a0; +v1 = MEM_U8(a0 + 12); +//nop; +t6 = v1 & 0x2; +v1 = zero < t6; +if (v1 != 0) {ra = MEM_U32(sp + 28); +goto L465908;} +ra = MEM_U32(sp + 28); +v1 = MEM_U32(a0 + 0); +//nop; +t8 = (int)v1 < (int)0x1; +if (t8 == 0) {v1 = t8; +goto L465904;} +v1 = t8; +//nop; +MEM_U32(sp + 32) = a1; +//nop; +v0 = wrapper___filbuf(mem, a0); +goto L4658c0; +//nop; +L4658c0: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +v1 = 0x10018dd0; +at = 0xffffffff; +v1 = v1; +MEM_U32(v1 + 0) = v0; +if (v0 != at) {a0 = v0; +goto L4658e8;} +a0 = v0; +a0 = 0x1; +goto L465900; +a0 = 0x1; +L4658e8: +//nop; +//nop; +//nop; +v0 = wrapper_ungetc(mem, a0, a1); +goto L4658f8; +//nop; +L4658f8: +gp = MEM_U32(sp + 24); +a0 = zero; +L465900: +v1 = zero < a0; +L465904: +ra = MEM_U32(sp + 28); +L465908: +sp = sp + 0x20; +v0 = v1; +return v0; +v0 = v1; +} + +static uint32_t f_eoln(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L465914: +//eoln: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +v1 = a0 < 0x1; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if (v1 != 0) {a1 = a0; +goto L4659d8;} +a1 = a0; +v1 = MEM_U8(a0 + 12); +//nop; +t6 = v1 & 0x2; +v1 = zero < t6; +if (v1 != 0) {ra = MEM_U32(sp + 28); +goto L4659dc;} +ra = MEM_U32(sp + 28); +v1 = MEM_U32(a0 + 0); +//nop; +if ((int)v1 > 0) {//nop; +goto L4659c0;} +//nop; +//nop; +MEM_U32(sp + 32) = a1; +//nop; +v0 = wrapper___filbuf(mem, a0); +goto L465970; +//nop; +L465970: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +v1 = 0x10018dd0; +at = 0xffffffff; +v1 = v1; +MEM_U32(v1 + 0) = v0; +if (v0 != at) {a0 = v0; +goto L465998;} +a0 = v0; +a0 = 0x1; +goto L4659b4; +a0 = 0x1; +L465998: +//nop; +MEM_U32(sp + 32) = a1; +//nop; +v0 = wrapper_ungetc(mem, a0, a1); +goto L4659a8; +//nop; +L4659a8: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +a0 = zero; +L4659b4: +v1 = zero < a0; +if (v1 != 0) {ra = MEM_U32(sp + 28); +goto L4659dc;} +ra = MEM_U32(sp + 28); +L4659c0: +t9 = MEM_U32(a1 + 4); +//nop; +v1 = MEM_U8(t9 + 0); +//nop; +t0 = v1 ^ 0xa; +v1 = t0 < 0x1; +L4659d8: +ra = MEM_U32(sp + 28); +L4659dc: +sp = sp + 0x20; +v0 = v1; +return v0; +v0 = v1; +} + +static uint32_t f_peek_char(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L4659e8: +//peek_char: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if (a0 == 0) {a1 = a0; +goto L465a74;} +a1 = a0; +t6 = MEM_U32(a0 + 0); +//nop; +if ((int)t6 > 0) {//nop; +goto L465a7c;} +//nop; +//nop; +MEM_U32(sp + 32) = a1; +//nop; +v0 = wrapper___filbuf(mem, a0); +goto L465a28; +//nop; +L465a28: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +v1 = 0x10018dd0; +at = 0xffffffff; +v1 = v1; +MEM_U32(v1 + 0) = v0; +if (v0 != at) {a0 = v0; +goto L465a50;} +a0 = v0; +v1 = 0x1; +goto L465a6c; +v1 = 0x1; +L465a50: +//nop; +MEM_U32(sp + 32) = a1; +//nop; +v0 = wrapper_ungetc(mem, a0, a1); +goto L465a60; +//nop; +L465a60: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 32); +v1 = zero; +L465a6c: +if (v1 == 0) {//nop; +goto L465a7c;} +//nop; +L465a74: +v0 = 0x20; +goto L465a9c; +v0 = 0x20; +L465a7c: +t7 = MEM_U32(a1 + 4); +at = 0xa; +v1 = MEM_U8(t7 + 0); +//nop; +if (v1 != at) {v0 = v1; +goto L465a9c;} +v0 = v1; +v1 = 0x20; +v0 = v1; +L465a9c: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return v0; +//nop; +} + +static void f_next_char(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L465aac: +//next_char: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +if (a0 == 0) {MEM_U32(sp + 24) = gp; +goto L465b3c;} +MEM_U32(sp + 24) = gp; +t6 = 0xfb51f00; +//nop; +t6 = MEM_U32(t6 + 0); +//nop; +if (t6 == 0) {//nop; +goto L465afc;} +//nop; +//nop; +//nop; +//nop; +v0 = wrapper___semgetc(mem, a0); +goto L465af0; +//nop; +L465af0: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L465b40; +ra = MEM_U32(sp + 28); +L465afc: +t7 = MEM_U32(a0 + 0); +//nop; +t9 = t7 + 0xffffffff; +if ((int)t9 >= 0) {MEM_U32(a0 + 0) = t9; +goto L465b2c;} +MEM_U32(a0 + 0) = t9; +//nop; +//nop; +//nop; +v0 = wrapper___filbuf(mem, a0); +goto L465b20; +//nop; +L465b20: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L465b40; +ra = MEM_U32(sp + 28); +L465b2c: +t0 = MEM_U32(a0 + 4); +//nop; +t1 = t0 + 0x1; +MEM_U32(a0 + 4) = t1; +L465b3c: +ra = MEM_U32(sp + 28); +L465b40: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t f_calc_size(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L468be0: +//calc_size: +t6 = 0x1000; +lo = t6 / a1; hi = t6 % a1; +MEM_U32(sp + 0) = a0; +if (a1 != 0) {//nop; +goto L468bf8;} +//nop; +abort(); +L468bf8: +v1 = a1; +t7 = lo; +//nop; +//nop; +lo = t7 * a1; +hi = (uint32_t)((uint64_t)t7 * (uint64_t)a1 >> 32); +v0 = lo; +at = a1 < v0; +if (at == 0) {//nop; +goto L468c24;} +//nop; +//nop; +return v0; +//nop; +L468c24: +v0 = v1; +return v0; +v0 = v1; +} + +static void f_reset(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L468c2c: +//reset: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 20) = s0; +MEM_U32(sp + 56) = a0; +MEM_U32(sp + 68) = a3; +MEM_U32(sp + 44) = zero; +s0 = MEM_U32(a0 + 0); +if (a2 == 0) {v0 = a2 + 0xffffffff; +goto L468c94;} +v0 = a2 + 0xffffffff; +t7 = v0 + a1; +t8 = MEM_U8(t7 + 0); +v1 = 0x20; +if (v1 != t8) {//nop; +goto L468c94;} +//nop; +L468c74: +if (v0 == 0) {a2 = v0; +goto L468c94;} +a2 = v0; +v0 = v0 + 0xffffffff; +t9 = v0 + a1; +t0 = MEM_U8(t9 + 0); +//nop; +if (v1 == t0) {//nop; +goto L468c74;} +//nop; +L468c94: +if (a2 == 0) {a0 = a2 + 0x1; +goto L468cf0;} +a0 = a2 + 0x1; +//nop; +MEM_U32(sp + 60) = a1; +MEM_U32(sp + 64) = a2; +v0 = wrapper_malloc(mem, a0); +goto L468cac; +MEM_U32(sp + 64) = a2; +L468cac: +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 60); +//nop; +a2 = MEM_U32(sp + 64); +MEM_U32(sp + 48) = v0; +a0 = v0; +v0 = wrapper_memcpy(mem, a0, a1, a2); +goto L468cc8; +a0 = v0; +L468cc8: +v1 = MEM_U32(sp + 48); +a2 = MEM_U32(sp + 64); +gp = MEM_U32(sp + 24); +t1 = v1 + a2; +MEM_U8(t1 + 0) = (uint8_t)zero; +t2 = MEM_U32(sp + 56); +t3 = 0x1; +MEM_U32(t2 + 4) = v1; +MEM_U32(sp + 44) = t3; +goto L468da0; +MEM_U32(sp + 44) = t3; +L468cf0: +t4 = MEM_U32(sp + 56); +//nop; +t5 = MEM_U32(t4 + 4); +//nop; +if (t5 != 0) {MEM_U32(sp + 48) = t5; +goto L468da0;} +MEM_U32(sp + 48) = t5; +if (s0 == 0) {a0 = s0; +goto L468d2c;} +a0 = s0; +//nop; +a1 = zero; +a2 = zero; +v0 = wrapper_fseek(mem, a0, a1, a2); +goto L468d20; +a2 = zero; +L468d20: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L468efc; +ra = MEM_U32(sp + 28); +L468d2c: +//nop; +a0 = 0x18; +//nop; +v0 = wrapper_malloc(mem, a0); +goto L468d3c; +//nop; +L468d3c: +gp = MEM_U32(sp + 24); +t6 = 0x1; +v1 = 0x1001b290; +MEM_U32(sp + 48) = v0; +t7 = MEM_U32(v1 + 0); +MEM_U32(sp + 44) = t6; +t8 = t7 + 0x1; +MEM_U32(v1 + 0) = t8; +//nop; +//nop; +//nop; +v0 = wrapper_getpid(); +goto L468d6c; +//nop; +L468d6c: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 48); +a2 = 0x1001b290; +a1 = 0x1000f390; +//nop; +a2 = MEM_U32(a2 + 0); +a3 = v0; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_sprintf(mem, a0, a1, sp); +goto L468d90; +a1 = a1; +L468d90: +t9 = MEM_U32(sp + 48); +t0 = MEM_U32(sp + 56); +gp = MEM_U32(sp + 24); +MEM_U32(t0 + 4) = t9; +L468da0: +if (s0 == 0) {a2 = s0; +goto L468dc8;} +a2 = s0; +a1 = 0x1000f3a0; +//nop; +a0 = MEM_U32(sp + 48); +a1 = a1; +v0 = wrapper_freopen(mem, a0, a1, a2); +goto L468dbc; +a1 = a1; +L468dbc: +gp = MEM_U32(sp + 24); +s0 = v0; +goto L468de4; +s0 = v0; +L468dc8: +a1 = 0x1000f3a4; +//nop; +a0 = MEM_U32(sp + 48); +a1 = a1; +v0 = wrapper_fopen(mem, a0, a1); +goto L468ddc; +a1 = a1; +L468ddc: +gp = MEM_U32(sp + 24); +s0 = v0; +L468de4: +if (v0 == 0) {t6 = MEM_U32(sp + 56); +goto L468ec8;} +t6 = MEM_U32(sp + 56); +t1 = MEM_U32(sp + 68); +//nop; +if (t1 == 0) {t6 = MEM_U32(sp + 56); +goto L468ec8;} +t6 = MEM_U32(sp + 56); +//nop; +a0 = s0; +a1 = t1; +v0 = f_calc_size(mem, sp, a0, a1); +goto L468e0c; +a1 = t1; +L468e0c: +gp = MEM_U32(sp + 24); +a3 = v0 + 0x8; +t2 = 0xfb528e4; +//nop; +if (s0 != t2) {//nop; +goto L468e30;} +//nop; +t3 = 0xfb546b0; +MEM_U32(s0 + 8) = t3; +goto L468e8c; +MEM_U32(s0 + 8) = t3; +L468e30: +//nop; +a0 = a3; +MEM_U32(sp + 40) = a3; +v0 = wrapper_malloc(mem, a0); +goto L468e40; +MEM_U32(sp + 40) = a3; +L468e40: +gp = MEM_U32(sp + 24); +a3 = MEM_U32(sp + 40); +if (v0 == 0) {a1 = v0; +goto L468e58;} +a1 = v0; +a2 = zero; +goto L468e5c; +a2 = zero; +L468e58: +a2 = 0x4; +L468e5c: +//nop; +a0 = s0; +MEM_U32(sp + 32) = a1; +v0 = wrapper_setvbuf(mem, a0, a1, a2, a3); +goto L468e6c; +MEM_U32(sp + 32) = a1; +L468e6c: +a1 = MEM_U32(sp + 32); +gp = MEM_U32(sp + 24); +if (a1 == 0) {//nop; +goto L468e8c;} +//nop; +t4 = MEM_U8(s0 + 12); +//nop; +t5 = t4 | 0x8; +MEM_U8(s0 + 12) = (uint8_t)t5; +L468e8c: +//nop; +a0 = s0; +//nop; +v0 = wrapper___filbuf(mem, a0); +goto L468e9c; +//nop; +L468e9c: +gp = MEM_U32(sp + 24); +at = 0xffffffff; +if (v0 == at) {a0 = v0; +goto L468ec4;} +a0 = v0; +//nop; +a1 = s0; +//nop; +v0 = wrapper_ungetc(mem, a0, a1); +goto L468ebc; +//nop; +L468ebc: +gp = MEM_U32(sp + 24); +//nop; +L468ec4: +t6 = MEM_U32(sp + 56); +L468ec8: +//nop; +MEM_U32(t6 + 0) = s0; +t7 = MEM_U32(sp + 44); +//nop; +if (t7 == 0) {ra = MEM_U32(sp + 28); +goto L468efc;} +ra = MEM_U32(sp + 28); +//nop; +a0 = MEM_U32(sp + 48); +//nop; +wrapper_free(mem, a0); +goto L468ef0; +//nop; +L468ef0: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L468efc: +s0 = MEM_U32(sp + 20); +sp = sp + 0x38; +return; +sp = sp + 0x38; +//nop; +//nop; +//nop; +//nop; +} + +static void func_468f18(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L468f18: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +t6 = MEM_U8(a0 + 12); +s0 = a1; +t7 = t6 & 0x2; +s1 = a0; +if (t7 == 0) {s2 = a2; +goto L46908c;} +s2 = a2; +t8 = MEM_U32(a0 + 0); +s3 = 0xffffffff; +v1 = t8 - a2; +if ((int)v1 >= 0) {MEM_U32(a0 + 0) = v1; +goto L469020;} +MEM_U32(a0 + 0) = v1; +L468f6c: +t0 = v1 + s2; +if ((int)t0 <= 0) {MEM_U32(s1 + 0) = t0; +goto L468fe4;} +MEM_U32(s1 + 0) = t0; +a0 = t0 + s0; +a1 = a0 - s0; +v0 = MEM_U32(s1 + 4); +t1 = a1 & 0x3; +if (t1 == 0) {s2 = s2 - t0; +goto L468fb0;} +s2 = s2 - t0; +v1 = t1 + s0; +L468f94: +t2 = MEM_U8(s0 + 0); +s0 = s0 + 0x1; +v0 = v0 + 0x1; +if (v1 != s0) {MEM_U8(v0 + -1) = (uint8_t)t2; +goto L468f94;} +MEM_U8(v0 + -1) = (uint8_t)t2; +if (s0 == a0) {//nop; +goto L468fe0;} +//nop; +L468fb0: +t3 = MEM_U8(s0 + 0); +s0 = s0 + 0x4; +MEM_U8(v0 + 0) = (uint8_t)t3; +t4 = MEM_U8(s0 + -3); +v0 = v0 + 0x4; +MEM_U8(v0 + -3) = (uint8_t)t4; +t5 = MEM_U8(s0 + -2); +//nop; +MEM_U8(v0 + -2) = (uint8_t)t5; +t6 = MEM_U8(s0 + -1); +if (s0 != a0) {MEM_U8(v0 + -1) = (uint8_t)t6; +goto L468fb0;} +MEM_U8(v0 + -1) = (uint8_t)t6; +L468fe0: +MEM_U32(s1 + 4) = v0; +L468fe4: +MEM_U32(s1 + 0) = s3; +//nop; +a0 = MEM_U8(s0 + 0); +a1 = s1; +s0 = s0 + 0x1; +v0 = wrapper___flsbuf(mem, a0, a1); +goto L468ffc; +s0 = s0 + 0x1; +L468ffc: +gp = MEM_U32(sp + 40); +s2 = s2 + 0xffffffff; +if (s2 == 0) {ra = MEM_U32(sp + 44); +goto L469090;} +ra = MEM_U32(sp + 44); +t7 = MEM_U32(s1 + 0); +//nop; +v1 = t7 - s2; +if ((int)v1 < 0) {MEM_U32(s1 + 0) = v1; +goto L468f6c;} +MEM_U32(s1 + 0) = v1; +L469020: +a0 = s0 + s2; +a2 = a0 - s0; +v0 = MEM_U32(s1 + 4); +t9 = a2 & 0x3; +if (t9 == 0) {a2 = t9; +goto L469058;} +a2 = t9; +v1 = a2 + s0; +L46903c: +t0 = MEM_U8(s0 + 0); +s0 = s0 + 0x1; +v0 = v0 + 0x1; +if (v1 != s0) {MEM_U8(v0 + -1) = (uint8_t)t0; +goto L46903c;} +MEM_U8(v0 + -1) = (uint8_t)t0; +if (s0 == a0) {//nop; +goto L469088;} +//nop; +L469058: +t1 = MEM_U8(s0 + 0); +s0 = s0 + 0x4; +MEM_U8(v0 + 0) = (uint8_t)t1; +t2 = MEM_U8(s0 + -3); +v0 = v0 + 0x4; +MEM_U8(v0 + -3) = (uint8_t)t2; +t3 = MEM_U8(s0 + -2); +//nop; +MEM_U8(v0 + -2) = (uint8_t)t3; +t4 = MEM_U8(s0 + -1); +if (s0 != a0) {MEM_U8(v0 + -1) = (uint8_t)t4; +goto L469058;} +MEM_U8(v0 + -1) = (uint8_t)t4; +L469088: +MEM_U32(s1 + 4) = v0; +L46908c: +ra = MEM_U32(sp + 44); +L469090: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void func_4690a8(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L4690a8: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +MEM_U32(sp + 44) = ra; +MEM_U32(sp + 40) = gp; +MEM_U32(sp + 36) = s3; +MEM_U32(sp + 32) = s2; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +t6 = MEM_U8(a0 + 12); +s0 = a1; +t7 = t6 & 0x2; +s1 = a2; +if (t7 == 0) {s2 = a0; +goto L4691e4;} +s2 = a0; +if ((int)a2 <= 0) {ra = MEM_U32(sp + 44); +goto L4691e8;} +ra = MEM_U32(sp + 44); +t8 = MEM_U32(a0 + 0); +s3 = 0xffffffff; +t9 = t8 - a2; +MEM_U32(a0 + 0) = t9; +if ((int)t9 >= 0) {v1 = t9; +goto L469198;} +v1 = t9; +L469108: +t0 = v1 + s1; +if ((int)t0 <= 0) {MEM_U32(s2 + 0) = t0; +goto L469160;} +MEM_U32(s2 + 0) = t0; +v0 = MEM_U32(s2 + 4); +s1 = s1 - t0; +a0 = t0 + v0; +a1 = a0 - v0; +t1 = a1 & 0x3; +if (t1 == 0) {v1 = t1 + v0; +goto L469144;} +v1 = t1 + v0; +L469130: +v0 = v0 + 0x1; +if (v1 != v0) {MEM_U8(v0 + -1) = (uint8_t)s0; +goto L469130;} +MEM_U8(v0 + -1) = (uint8_t)s0; +if (v0 == a0) {//nop; +goto L46915c;} +//nop; +L469144: +v0 = v0 + 0x4; +MEM_U8(v0 + -4) = (uint8_t)s0; +MEM_U8(v0 + -3) = (uint8_t)s0; +MEM_U8(v0 + -2) = (uint8_t)s0; +if (v0 != a0) {MEM_U8(v0 + -1) = (uint8_t)s0; +goto L469144;} +MEM_U8(v0 + -1) = (uint8_t)s0; +L46915c: +MEM_U32(s2 + 4) = v0; +L469160: +MEM_U32(s2 + 0) = s3; +//nop; +a0 = s0; +a1 = s2; +v0 = wrapper___flsbuf(mem, a0, a1); +goto L469174; +a1 = s2; +L469174: +gp = MEM_U32(sp + 40); +s1 = s1 + 0xffffffff; +if (s1 == 0) {ra = MEM_U32(sp + 44); +goto L4691e8;} +ra = MEM_U32(sp + 44); +t2 = MEM_U32(s2 + 0); +//nop; +v1 = t2 - s1; +if ((int)v1 < 0) {MEM_U32(s2 + 0) = v1; +goto L469108;} +MEM_U32(s2 + 0) = v1; +L469198: +v0 = MEM_U32(s2 + 4); +//nop; +a0 = v0 + s1; +a2 = a0 - v0; +t4 = a2 & 0x3; +if (t4 == 0) {v1 = t4 + v0; +goto L4691c8;} +v1 = t4 + v0; +L4691b4: +v0 = v0 + 0x1; +if (v1 != v0) {MEM_U8(v0 + -1) = (uint8_t)s0; +goto L4691b4;} +MEM_U8(v0 + -1) = (uint8_t)s0; +if (v0 == a0) {//nop; +goto L4691e0;} +//nop; +L4691c8: +v0 = v0 + 0x4; +MEM_U8(v0 + -4) = (uint8_t)s0; +MEM_U8(v0 + -3) = (uint8_t)s0; +MEM_U8(v0 + -2) = (uint8_t)s0; +if (v0 != a0) {MEM_U8(v0 + -1) = (uint8_t)s0; +goto L4691c8;} +MEM_U8(v0 + -1) = (uint8_t)s0; +L4691e0: +MEM_U32(s2 + 4) = v0; +L4691e4: +ra = MEM_U32(sp + 44); +L4691e8: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +s2 = MEM_U32(sp + 32); +s3 = MEM_U32(sp + 36); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static void f_writeln(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L469200: +//writeln: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +t6 = MEM_U8(a0 + 12); +a1 = a0; +t7 = t6 & 0x2; +if (t7 != 0) {//nop; +goto L469250;} +//nop; +a0 = 0xfb528e4; +a1 = 0x1000f3b0; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L469244; +a1 = a1; +L469244: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L4692d4; +ra = MEM_U32(sp + 28); +L469250: +t8 = 0xfb51f00; +//nop; +t8 = MEM_U32(t8 + 0); +//nop; +if (t8 == 0) {//nop; +goto L469284;} +//nop; +//nop; +a0 = 0xa; +//nop; +v0 = wrapper___semputc(mem, a0, a1); +goto L469278; +//nop; +L469278: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L4692d4; +ra = MEM_U32(sp + 28); +L469284: +t9 = MEM_U32(a1 + 0); +//nop; +t0 = t9 + 0xffffffff; +if ((int)t0 >= 0) {MEM_U32(a1 + 0) = t0; +goto L4692b4;} +MEM_U32(a1 + 0) = t0; +//nop; +a0 = 0xa; +//nop; +v0 = wrapper___flsbuf(mem, a0, a1); +goto L4692a8; +//nop; +L4692a8: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L4692d4; +ra = MEM_U32(sp + 28); +L4692b4: +t3 = MEM_U32(a1 + 4); +t2 = 0xa; +MEM_U8(t3 + 0) = (uint8_t)t2; +t4 = MEM_U32(a1 + 4); +//nop; +t5 = t4 + 0x1; +MEM_U32(a1 + 4) = t5; +ra = MEM_U32(sp + 28); +L4692d4: +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static void f_write_char(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L469380: +//write_char: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 20) = s0; +at = (int)a2 < (int)0x2; +s0 = a1 & 0xff; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 36) = a1; +MEM_U32(sp + 40) = a2; +if (at != 0) {a3 = a0; +goto L469458;} +a3 = a0; +//nop; +a1 = 0x20; +t9 = t9; +a2 = a2 + 0xffffffff; +MEM_U32(sp + 32) = a3; +func_4690a8(mem, sp, a0, a1, a2); +goto L4693cc; +MEM_U32(sp + 32) = a3; +L4693cc: +gp = MEM_U32(sp + 24); +a3 = MEM_U32(sp + 32); +t7 = 0xfb51f00; +//nop; +t7 = MEM_U32(t7 + 0); +//nop; +if (t7 == 0) {//nop; +goto L469408;} +//nop; +//nop; +a0 = s0; +a1 = a3; +v0 = wrapper___semputc(mem, a0, a1); +goto L4693fc; +a1 = a3; +L4693fc: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L4695a4; +ra = MEM_U32(sp + 28); +L469408: +t8 = MEM_U32(a3 + 0); +//nop; +t9 = t8 + 0xffffffff; +if ((int)t9 >= 0) {MEM_U32(a3 + 0) = t9; +goto L469438;} +MEM_U32(a3 + 0) = t9; +//nop; +a0 = s0; +a1 = a3; +v0 = wrapper___flsbuf(mem, a0, a1); +goto L46942c; +a1 = a3; +L46942c: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L4695a4; +ra = MEM_U32(sp + 28); +L469438: +t1 = MEM_U32(a3 + 4); +//nop; +MEM_U8(t1 + 0) = (uint8_t)s0; +t2 = MEM_U32(a3 + 4); +//nop; +t3 = t2 + 0x1; +MEM_U32(a3 + 4) = t3; +goto L4695a0; +MEM_U32(a3 + 4) = t3; +L469458: +t4 = MEM_U32(sp + 40); +//nop; +at = (int)t4 < (int)0xffffffff; +if (at == 0) {//nop; +goto L469520;} +//nop; +t5 = 0xfb51f00; +a0 = s0; +t5 = MEM_U32(t5 + 0); +//nop; +if (t5 == 0) {//nop; +goto L4694a4;} +//nop; +//nop; +a1 = a3; +MEM_U32(sp + 32) = a3; +v0 = wrapper___semputc(mem, a0, a1); +goto L469494; +MEM_U32(sp + 32) = a3; +L469494: +gp = MEM_U32(sp + 24); +a3 = MEM_U32(sp + 32); +//nop; +goto L4694f4; +//nop; +L4694a4: +t6 = MEM_U32(a3 + 0); +a0 = s0; +t7 = t6 + 0xffffffff; +if ((int)t7 >= 0) {MEM_U32(a3 + 0) = t7; +goto L4694d8;} +MEM_U32(a3 + 0) = t7; +//nop; +a1 = a3; +MEM_U32(sp + 32) = a3; +v0 = wrapper___flsbuf(mem, a0, a1); +goto L4694c8; +MEM_U32(sp + 32) = a3; +L4694c8: +gp = MEM_U32(sp + 24); +a3 = MEM_U32(sp + 32); +//nop; +goto L4694f4; +//nop; +L4694d8: +t9 = MEM_U32(a3 + 4); +//nop; +MEM_U8(t9 + 0) = (uint8_t)s0; +t0 = MEM_U32(a3 + 4); +//nop; +t1 = t0 + 0x1; +MEM_U32(a3 + 4) = t1; +L4694f4: +//nop; +t2 = MEM_U32(sp + 40); +t3 = 0xffffffff; +t9 = t9; +a0 = a3; +a1 = 0x20; +a2 = t3 - t2; +func_4690a8(mem, sp, a0, a1, a2); +goto L469514; +a2 = t3 - t2; +L469514: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L4695a4; +ra = MEM_U32(sp + 28); +L469520: +t4 = 0xfb51f00; +//nop; +t4 = MEM_U32(t4 + 0); +//nop; +if (t4 == 0) {//nop; +goto L469554;} +//nop; +//nop; +a0 = s0; +a1 = a3; +v0 = wrapper___semputc(mem, a0, a1); +goto L469548; +a1 = a3; +L469548: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L4695a4; +ra = MEM_U32(sp + 28); +L469554: +t5 = MEM_U32(a3 + 0); +//nop; +t6 = t5 + 0xffffffff; +if ((int)t6 >= 0) {MEM_U32(a3 + 0) = t6; +goto L469584;} +MEM_U32(a3 + 0) = t6; +//nop; +a0 = s0; +a1 = a3; +v0 = wrapper___flsbuf(mem, a0, a1); +goto L469578; +a1 = a3; +L469578: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L4695a4; +ra = MEM_U32(sp + 28); +L469584: +t8 = MEM_U32(a3 + 4); +//nop; +MEM_U8(t8 + 0) = (uint8_t)s0; +t9 = MEM_U32(a3 + 4); +//nop; +t0 = t9 + 0x1; +MEM_U32(a3 + 4) = t0; +L4695a0: +ra = MEM_U32(sp + 28); +L4695a4: +s0 = MEM_U32(sp + 20); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_write_string(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4695b0: +//write_string: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 20) = s0; +s0 = a1; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 32) = a0; +if (a3 != 0) {MEM_U32(sp + 40) = a2; +goto L46961c;} +MEM_U32(sp + 40) = a2; +a0 = a1 + a2; +if (a1 == a0) {v0 = a0; +goto L469614;} +v0 = a0; +t7 = MEM_U8(a0 + -1); +v1 = 0x20; +if (v1 != t7) {//nop; +goto L469614;} +//nop; +L4695f8: +v0 = v0 + 0xffffffff; +if (v0 == s0) {//nop; +goto L469614;} +//nop; +t8 = MEM_U8(v0 + -1); +//nop; +if (v1 == t8) {//nop; +goto L4695f8;} +//nop; +L469614: +a3 = v0 - s0; +goto L469650; +a3 = v0 - s0; +L46961c: +t9 = MEM_U32(sp + 40); +//nop; +at = t9 < a3; +if (at == 0) {a2 = a3 - t9; +goto L469650;} +a2 = a3 - t9; +//nop; +a0 = MEM_U32(sp + 32); +t9 = t9; +a1 = 0x20; +func_4690a8(mem, sp, a0, a1, a2); +goto L469644; +a1 = 0x20; +L469644: +gp = MEM_U32(sp + 24); +a3 = MEM_U32(sp + 40); +//nop; +L469650: +if ((int)a3 <= 0) {a1 = s0; +goto L469674;} +a1 = s0; +//nop; +a0 = MEM_U32(sp + 32); +t9 = t9; +a2 = a3; +func_468f18(mem, sp, a0, a1, a2); +goto L46966c; +a2 = a3; +L46966c: +gp = MEM_U32(sp + 24); +//nop; +L469674: +ra = MEM_U32(sp + 28); +s0 = MEM_U32(sp + 20); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_write_enum(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L469684: +//write_enum: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 20) = s0; +s0 = a2; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 52) = a3; +if (a1 == 0) {MEM_U32(sp + 36) = a1; +goto L46971c;} +MEM_U32(sp + 36) = a1; +v1 = MEM_U8(a2 + 0); +//nop; +v0 = zero < v1; +L4696c0: +if (v0 == 0) {s0 = s0 + 0x1; +goto L4696dc;} +s0 = s0 + 0x1; +L4696c8: +v0 = MEM_U8(s0 + 0); +s0 = s0 + 0x1; +t6 = zero < v0; +if (t6 != 0) {//nop; +goto L4696c8;} +//nop; +L4696dc: +v1 = MEM_U8(s0 + 0); +a1 = a1 + 0xffffffff; +if (v1 != 0) {//nop; +goto L469714;} +//nop; +a0 = 0xfb528e4; +a1 = 0x1000f3e0; +//nop; +a2 = MEM_U32(sp + 36); +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L469708; +a1 = a1; +L469708: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L469788; +ra = MEM_U32(sp + 28); +L469714: +if (a1 != 0) {v0 = zero < v1; +goto L4696c0;} +v0 = zero < v1; +L46971c: +t7 = MEM_U8(s0 + 0); +v1 = 0x20; +a0 = v1 ^ t7; +a0 = a0 < 0x1; +if (a0 == 0) {//nop; +goto L469750;} +//nop; +if (a0 == 0) {s0 = s0 + 0x1; +goto L46974c;} +s0 = s0 + 0x1; +L46973c: +t8 = MEM_U8(s0 + 0); +s0 = s0 + 0x1; +if (v1 == t8) {//nop; +goto L46973c;} +//nop; +L46974c: +s0 = s0 + 0xffffffff; +L469750: +//nop; +a0 = s0; +//nop; +v0 = wrapper_strlen(mem, a0); +goto L469760; +//nop; +L469760: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 40); +//nop; +a3 = MEM_U32(sp + 52); +a1 = s0; +a2 = v0; +f_write_string(mem, sp, a0, a1, a2, a3); +goto L46977c; +a2 = v0; +L46977c: +gp = MEM_U32(sp + 24); +//nop; +ra = MEM_U32(sp + 28); +L469788: +s0 = MEM_U32(sp + 20); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static void f_write_integer(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L469794: +//write_integer: +//nop; +//nop; +//nop; +sp = sp + 0xffffffa8; +MEM_U32(sp + 20) = s0; +at = a3 < 0x2; +s0 = a3; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 88) = a0; +if (at == 0) {MEM_U32(sp + 96) = a2; +goto L4697ec;} +MEM_U32(sp + 96) = a2; +a0 = 0xfb528e4; +a1 = 0x1000f408; +//nop; +a2 = a3; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L4697e0; +a1 = a1; +L4697e0: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L4698dc; +ra = MEM_U32(sp + 28); +L4697ec: +if ((int)a1 >= 0) {t0 = sp + 0x34; +goto L4697fc;} +t0 = sp + 0x34; +v0 = -a1; +goto L469800; +v0 = -a1; +L4697fc: +v0 = a1; +L469800: +v1 = 0x10006530; +a3 = sp + 0x55; +v1 = v1; +L46980c: +lo = v0 / s0; hi = v0 % s0; +a3 = a3 + 0xffffffff; +if (s0 != 0) {//nop; +goto L469820;} +//nop; +abort(); +L469820: +t6 = hi; +t7 = v1 + t6; +t8 = MEM_U8(t7 + 0); +v0 = lo; +MEM_U8(a3 + 0) = (uint8_t)t8; +if (v0 != 0) {//nop; +goto L46980c;} +//nop; +if ((int)a1 >= 0) {t9 = 0x2d; +goto L46984c;} +t9 = 0x2d; +a3 = a3 + 0xffffffff; +MEM_U8(a3 + 0) = (uint8_t)t9; +L46984c: +t1 = MEM_U32(sp + 96); +s0 = t0 - a3; +s0 = s0 + 0x21; +at = (int)s0 < (int)t1; +if (at == 0) {a1 = 0x20; +goto L46988c;} +a1 = 0x20; +//nop; +t2 = MEM_U32(sp + 96); +a0 = MEM_U32(sp + 88); +t9 = t9; +MEM_U32(sp + 48) = a3; +a2 = t2 - s0; +func_4690a8(mem, sp, a0, a1, a2); +goto L469880; +a2 = t2 - s0; +L469880: +gp = MEM_U32(sp + 24); +a3 = MEM_U32(sp + 48); +//nop; +L46988c: +//nop; +a0 = MEM_U32(sp + 88); +t9 = t9; +a1 = a3; +a2 = s0; +func_468f18(mem, sp, a0, a1, a2); +goto L4698a4; +a2 = s0; +L4698a4: +v0 = MEM_U32(sp + 96); +gp = MEM_U32(sp + 24); +v0 = -v0; +at = (int)s0 < (int)v0; +if (at == 0) {a1 = 0x20; +goto L4698d8;} +a1 = 0x20; +//nop; +a0 = MEM_U32(sp + 88); +t9 = t9; +a2 = v0 - s0; +func_4690a8(mem, sp, a0, a1, a2); +goto L4698d0; +a2 = v0 - s0; +L4698d0: +gp = MEM_U32(sp + 24); +//nop; +L4698d8: +ra = MEM_U32(sp + 28); +L4698dc: +s0 = MEM_U32(sp + 20); +sp = sp + 0x58; +return; +sp = sp + 0x58; +} + +static void f_write_cardinal(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L4698e8: +//write_cardinal: +//nop; +//nop; +//nop; +sp = sp + 0xffffffb0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 20) = s0; +MEM_U32(sp + 80) = a0; +if (a3 != 0) {MEM_U32(sp + 88) = a2; +goto L469938;} +MEM_U32(sp + 88) = a2; +a0 = 0xfb528e4; +a1 = 0x1000f438; +//nop; +a2 = a3; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L46992c; +a1 = a1; +L46992c: +gp = MEM_U32(sp + 24); +ra = MEM_U32(sp + 28); +goto L469a10; +ra = MEM_U32(sp + 28); +L469938: +v0 = 0x10006530; +s0 = sp + 0x50; +v0 = v0; +L469944: +lo = a1 / a3; hi = a1 % a3; +s0 = s0 + 0xffffffff; +if (a3 != 0) {//nop; +goto L469958;} +//nop; +abort(); +L469958: +t6 = hi; +t7 = v0 + t6; +t8 = MEM_U8(t7 + 0); +a1 = lo; +MEM_U8(s0 + 0) = (uint8_t)t8; +if (a1 != 0) {//nop; +goto L469944;} +//nop; +t9 = sp + 0x30; +t0 = MEM_U32(sp + 88); +a3 = t9 - s0; +a3 = a3 + 0x20; +at = (int)a3 < (int)t0; +if (at == 0) {a1 = 0x20; +goto L4699b8;} +a1 = 0x20; +//nop; +t1 = MEM_U32(sp + 88); +a0 = MEM_U32(sp + 80); +t9 = t9; +MEM_U32(sp + 40) = a3; +a2 = t1 - a3; +func_4690a8(mem, sp, a0, a1, a2); +goto L4699ac; +a2 = t1 - a3; +L4699ac: +gp = MEM_U32(sp + 24); +a3 = MEM_U32(sp + 40); +//nop; +L4699b8: +//nop; +a0 = MEM_U32(sp + 80); +t9 = t9; +a1 = s0; +a2 = a3; +MEM_U32(sp + 40) = a3; +func_468f18(mem, sp, a0, a1, a2); +goto L4699d4; +MEM_U32(sp + 40) = a3; +L4699d4: +v0 = MEM_U32(sp + 88); +a3 = MEM_U32(sp + 40); +v0 = -v0; +gp = MEM_U32(sp + 24); +at = (int)a3 < (int)v0; +if (at == 0) {a1 = 0x20; +goto L469a0c;} +a1 = 0x20; +//nop; +a0 = MEM_U32(sp + 80); +t9 = t9; +a2 = v0 - a3; +func_4690a8(mem, sp, a0, a1, a2); +goto L469a04; +a2 = v0 - a3; +L469a04: +gp = MEM_U32(sp + 24); +//nop; +L469a0c: +ra = MEM_U32(sp + 28); +L469a10: +s0 = MEM_U32(sp + 20); +sp = sp + 0x50; +return; +sp = sp + 0x50; +} + +static void f_write_int64(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L46b69c: +//write_int64: +//nop; +//nop; +//nop; +sp = sp + 0xffffff60; +MEM_U32(sp + 168) = a2; +a2 = MEM_U32(sp + 180); +MEM_U32(sp + 36) = ra; +at = a2 < 0x2; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 160) = a0; +if (at == 0) {MEM_U32(sp + 172) = a3; +goto L46b6f8;} +MEM_U32(sp + 172) = a3; +a0 = 0xfb528e4; +a1 = 0x1000f4c4; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L46b6ec; +a1 = a1; +L46b6ec: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L46b8a4; +ra = MEM_U32(sp + 36); +L46b6f8: +t6 = MEM_U32(sp + 168); +t7 = MEM_U32(sp + 172); +if ((int)t6 > 0) {s0 = sp + 0x9d; +goto L46b730;} +s0 = sp + 0x9d; +if ((int)t6 < 0) {at = t7 < 0x1; +goto L46b718;} +at = t7 < 0x1; +t0 = MEM_U32(sp + 168); +goto L46b734; +t0 = MEM_U32(sp + 168); +L46b718: +t8 = ~t6; +t8 = t8 + at; +t9 = -t7; +MEM_U32(sp + 84) = t9; +MEM_U32(sp + 80) = t8; +goto L46b740; +MEM_U32(sp + 80) = t8; +L46b730: +t0 = MEM_U32(sp + 168); +L46b734: +t1 = MEM_U32(sp + 172); +MEM_U32(sp + 80) = t0; +MEM_U32(sp + 84) = t1; +L46b740: +s1 = 0x10006530; +t2 = 0x0; +MEM_U32(sp + 56) = t2; +MEM_U32(sp + 60) = a2; +s1 = s1; +L46b754: +//nop; +a0 = MEM_U32(sp + 80); +a1 = MEM_U32(sp + 84); +a2 = MEM_U32(sp + 56); +a3 = MEM_U32(sp + 60); +s0 = s0 + 0xffffffff; +temp64 = wrapper___ull_rem((((uint64_t)a0 << 32) | (uint64_t)a1), (((uint64_t)a2 << 32) | (uint64_t)a3)); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L46b770; +s0 = s0 + 0xffffffff; +L46b770: +t5 = s1 + v1; +t6 = MEM_U8(t5 + 0); +gp = MEM_U32(sp + 32); +MEM_U8(s0 + 0) = (uint8_t)t6; +//nop; +a3 = MEM_U32(sp + 60); +a2 = MEM_U32(sp + 56); +a1 = MEM_U32(sp + 84); +a0 = MEM_U32(sp + 80); +//nop; +temp64 = wrapper___ull_div((((uint64_t)a0 << 32) | (uint64_t)a1), (((uint64_t)a2 << 32) | (uint64_t)a3)); +v0 = (uint32_t)(temp64 >> 32); +v1 = (uint32_t)temp64; +goto L46b79c; +//nop; +L46b79c: +gp = MEM_U32(sp + 32); +MEM_U32(sp + 80) = v0; +if (v0 != 0) {MEM_U32(sp + 84) = v1; +goto L46b754;} +MEM_U32(sp + 84) = v1; +if (v1 != 0) {//nop; +goto L46b754;} +//nop; +t8 = MEM_U32(sp + 168); +t0 = sp + 0x5c; +if ((int)t8 > 0) {t3 = MEM_U32(sp + 176); +goto L46b7e0;} +t3 = MEM_U32(sp + 176); +if ((int)t8 < 0) {t7 = 0x2d; +goto L46b7d4;} +t7 = 0x2d; +t3 = MEM_U32(sp + 176); +goto L46b7e0; +t3 = MEM_U32(sp + 176); +L46b7d4: +s0 = s0 + 0xffffffff; +MEM_U8(s0 + 0) = (uint8_t)t7; +t3 = MEM_U32(sp + 176); +L46b7e0: +t1 = t0 - s0; +t2 = t1 + 0x41; +t4 = (int)t2 >> 31; +t6 = (int)t3 >> 31; +at = t6 < t4; +MEM_U32(sp + 48) = t6; +MEM_U32(sp + 56) = t4; +t5 = t2; +MEM_U32(sp + 60) = t2; +t7 = t3; +if (at != 0) {MEM_U32(sp + 52) = t3; +goto L46b850;} +MEM_U32(sp + 52) = t3; +at = t4 < t6; +if (at != 0) {a1 = 0x20; +goto L46b828;} +a1 = 0x20; +at = t2 < t3; +if (at == 0) {//nop; +goto L46b850;} +//nop; +L46b828: +//nop; +a0 = MEM_U32(sp + 160); +at = t7 < t5; +a2 = t6 - t4; +t9 = t9; +a2 = a2 - at; +a3 = t7 - t5; +func_4690a8(mem, sp, a0, a1, a2); +goto L46b848; +a3 = t7 - t5; +L46b848: +gp = MEM_U32(sp + 32); +//nop; +L46b850: +//nop; +a2 = MEM_U32(sp + 60); +a0 = MEM_U32(sp + 160); +t9 = t9; +a1 = s0; +s1 = a2; +func_468f18(mem, sp, a0, a1, a2); +goto L46b86c; +s1 = a2; +L46b86c: +v0 = MEM_U32(sp + 176); +gp = MEM_U32(sp + 32); +v0 = -v0; +at = s1 < v0; +if (at == 0) {a1 = 0x20; +goto L46b8a0;} +a1 = 0x20; +//nop; +a0 = MEM_U32(sp + 160); +t9 = t9; +a2 = v0 - s1; +func_4690a8(mem, sp, a0, a1, a2); +goto L46b898; +a2 = v0 - s1; +L46b898: +gp = MEM_U32(sp + 32); +//nop; +L46b8a0: +ra = MEM_U32(sp + 36); +L46b8a4: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0xa0; +return; +sp = sp + 0xa0; +//nop; +} + +static void f_caseerror(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L46b8b8: +//caseerror: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd0; +//nop; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 48) = a0; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 52) = a1; +MEM_U32(sp + 56) = a2; +MEM_U32(sp + 60) = a3; +a0 = a3 + 0x1; +v0 = wrapper_malloc(mem, a0); +goto L46b8ec; +a0 = a3 + 0x1; +L46b8ec: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 56); +//nop; +a2 = MEM_U32(sp + 60); +a0 = v0; +MEM_U32(sp + 44) = v0; +v0 = wrapper_memcpy(mem, a0, a1, a2); +goto L46b908; +MEM_U32(sp + 44) = v0; +L46b908: +gp = MEM_U32(sp + 32); +v1 = MEM_U32(sp + 44); +t6 = MEM_U32(sp + 60); +a0 = 0xfb528e4; +t7 = v1 + t6; +MEM_U8(t7 + 0) = (uint8_t)zero; +//nop; +a1 = 0x1000f500; +a3 = MEM_U32(sp + 52); +a2 = MEM_U32(sp + 48); +MEM_U32(sp + 16) = v1; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L46b940; +a1 = a1; +L46b940: +ra = MEM_U32(sp + 36); +gp = MEM_U32(sp + 32); +sp = sp + 0x30; +return; +sp = sp + 0x30; +} + +static uint32_t f_new(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L46b9f8: +//new: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +v0 = f_xmalloc(mem, sp, a0); +goto L46ba20; +MEM_U32(sp + 44) = a1; +L46ba20: +t6 = MEM_U32(sp + 44); +gp = MEM_U32(sp + 24); +if (t6 == 0) {a0 = v0; +goto L46ba54;} +a0 = v0; +if (v0 == 0) {a1 = zero; +goto L46ba54;} +a1 = zero; +//nop; +a2 = MEM_U32(sp + 40); +MEM_U32(sp + 36) = v0; +v0 = wrapper_memset(mem, a0, a1, a2); +goto L46ba48; +MEM_U32(sp + 36) = v0; +L46ba48: +gp = MEM_U32(sp + 24); +a0 = MEM_U32(sp + 36); +//nop; +L46ba54: +ra = MEM_U32(sp + 28); +sp = sp + 0x28; +v0 = a0; +return v0; +v0 = a0; +} + +static void f_dispose(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L46ba64: +//dispose: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 36) = a1; +f_xfree(mem, sp); +goto L46ba88; +MEM_U32(sp + 36) = a1; +L46ba88: +ra = MEM_U32(sp + 28); +gp = MEM_U32(sp + 24); +sp = sp + 0x20; +return; +sp = sp + 0x20; +} + +static void f_rewrite(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2, uint32_t a3) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +L46ba98: +//rewrite: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 52) = a3; +s1 = MEM_U32(a0 + 0); +if (a2 == 0) {v0 = a2 + 0xffffffff; +goto L46bb00;} +v0 = a2 + 0xffffffff; +t7 = v0 + a1; +t8 = MEM_U8(t7 + 0); +v1 = 0x20; +if (v1 != t8) {//nop; +goto L46bb00;} +//nop; +L46bae0: +if (v0 == 0) {a2 = v0; +goto L46bb00;} +a2 = v0; +v0 = v0 + 0xffffffff; +t9 = v0 + a1; +t0 = MEM_U8(t9 + 0); +//nop; +if (v1 == t0) {//nop; +goto L46bae0;} +//nop; +L46bb00: +if (a2 == 0) {a0 = a2 + 0x1; +goto L46bb50;} +a0 = a2 + 0x1; +//nop; +MEM_U32(sp + 44) = a1; +MEM_U32(sp + 48) = a2; +v0 = wrapper_malloc(mem, a0); +goto L46bb18; +MEM_U32(sp + 48) = a2; +L46bb18: +gp = MEM_U32(sp + 32); +a1 = MEM_U32(sp + 44); +//nop; +a2 = MEM_U32(sp + 48); +s0 = v0; +a0 = v0; +v0 = wrapper_memcpy(mem, a0, a1, a2); +goto L46bb34; +a0 = v0; +L46bb34: +a2 = MEM_U32(sp + 48); +gp = MEM_U32(sp + 32); +t1 = s0 + a2; +MEM_U8(t1 + 0) = (uint8_t)zero; +t2 = MEM_U32(sp + 40); +MEM_U32(t2 + 4) = s0; +goto L46bbfc; +MEM_U32(t2 + 4) = s0; +L46bb50: +t3 = MEM_U32(sp + 40); +//nop; +s0 = MEM_U32(t3 + 4); +//nop; +if (s0 != 0) {//nop; +goto L46bbfc;} +//nop; +if (s1 == 0) {a0 = s1; +goto L46bb8c;} +a0 = s1; +//nop; +a1 = zero; +a2 = zero; +v0 = wrapper_fseek(mem, a0, a1, a2); +goto L46bb80; +a2 = zero; +L46bb80: +gp = MEM_U32(sp + 32); +ra = MEM_U32(sp + 36); +goto L46bccc; +ra = MEM_U32(sp + 36); +L46bb8c: +//nop; +a0 = 0x18; +//nop; +v0 = wrapper_malloc(mem, a0); +goto L46bb9c; +//nop; +L46bb9c: +gp = MEM_U32(sp + 32); +s0 = v0; +v1 = 0x1001b290; +//nop; +t4 = MEM_U32(v1 + 0); +//nop; +t5 = t4 + 0x1; +MEM_U32(v1 + 0) = t5; +//nop; +//nop; +//nop; +v0 = wrapper_getpid(); +goto L46bbcc; +//nop; +L46bbcc: +gp = MEM_U32(sp + 32); +a0 = s0; +a2 = 0x1001b290; +a1 = 0x1000f560; +//nop; +a2 = MEM_U32(a2 + 0); +a3 = v0; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_sprintf(mem, a0, a1, sp); +goto L46bbf0; +a1 = a1; +L46bbf0: +t6 = MEM_U32(sp + 40); +gp = MEM_U32(sp + 32); +MEM_U32(t6 + 4) = s0; +L46bbfc: +if (s1 == 0) {a0 = s0; +goto L46bc60;} +a0 = s0; +a1 = 0x1000f570; +//nop; +a2 = s1; +a1 = a1; +v0 = wrapper_freopen(mem, a0, a1, a2); +goto L46bc18; +a1 = a1; +L46bc18: +gp = MEM_U32(sp + 32); +if (v0 != 0) {s1 = v0; +goto L46bc7c;} +s1 = v0; +a0 = 0xfb528e4; +a1 = 0x1000f574; +//nop; +a0 = a0 + 0x20; +a1 = a1; +MEM_U32(sp + 0) = a0; +MEM_U32(sp + 4) = a1; +MEM_U32(sp + 8) = a2; +MEM_U32(sp + 12) = a3; +v0 = wrapper_fprintf(mem, a0, a1, sp); +goto L46bc3c; +a1 = a1; +L46bc3c: +gp = MEM_U32(sp + 32); +a0 = 0xd; +//nop; +//nop; +//nop; +wrapper_exit(mem, a0); +goto L46bc54; +//nop; +L46bc54: +gp = MEM_U32(sp + 32); +//nop; +goto L46bc7c; +//nop; +L46bc60: +a1 = 0x1000f5a4; +//nop; +a0 = s0; +a1 = a1; +v0 = wrapper_fopen(mem, a0, a1); +goto L46bc74; +a1 = a1; +L46bc74: +gp = MEM_U32(sp + 32); +s1 = v0; +L46bc7c: +if (s1 == 0) {t9 = MEM_U32(sp + 40); +goto L46bcc0;} +t9 = MEM_U32(sp + 40); +t7 = MEM_U32(s1 + 8); +t8 = MEM_U32(sp + 52); +if (t7 != 0) {t9 = MEM_U32(sp + 40); +goto L46bcc0;} +t9 = MEM_U32(sp + 40); +if (t8 == 0) {a1 = 0x1; +goto L46bca4;} +a1 = 0x1; +a1 = t8; +goto L46bca4; +a1 = t8; +L46bca4: +//nop; +a0 = s1; +//nop; +f__getbuf(mem, sp, a0, a1); +goto L46bcb4; +//nop; +L46bcb4: +gp = MEM_U32(sp + 32); +//nop; +t9 = MEM_U32(sp + 40); +L46bcc0: +//nop; +MEM_U32(t9 + 0) = s1; +ra = MEM_U32(sp + 36); +L46bccc: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +//nop; +//nop; +//nop; +} + +static void f_get_arg(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1, uint32_t a2) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a3 = 0; +L46bce8: +//get_arg: +//nop; +//nop; +//nop; +t6 = 0x10018df0; +v1 = a1 + a2; +t6 = MEM_U32(t6 + 0); +v0 = v1; +at = a0 < t6; +if (at == 0) {//nop; +goto L46bd5c;} +//nop; +t7 = 0x10018df4; +t8 = a0 << 2; +t7 = MEM_U32(t7 + 0); +//nop; +t9 = t7 + t8; +a2 = MEM_U32(t9 + 0); +if (a1 == v1) {//nop; +goto L46bd5c;} +//nop; +v1 = MEM_U8(a2 + 0); +a2 = a2 + 0x1; +if (v1 == 0) {//nop; +goto L46bd5c;} +//nop; +L46bd40: +a1 = a1 + 0x1; +if (a1 == v0) {MEM_U8(a1 + -1) = (uint8_t)v1; +goto L46bd5c;} +MEM_U8(a1 + -1) = (uint8_t)v1; +v1 = MEM_U8(a2 + 0); +a2 = a2 + 0x1; +if (v1 != 0) {//nop; +goto L46bd40;} +//nop; +L46bd5c: +if (a1 == v0) {a0 = v0 - a1; +goto L46bda0;} +a0 = v0 - a1; +t0 = a0 & 0x3; +if (t0 == 0) {v1 = t0 + a1; +goto L46bd84;} +v1 = t0 + a1; +a0 = 0x20; +L46bd74: +a1 = a1 + 0x1; +if (v1 != a1) {MEM_U8(a1 + -1) = (uint8_t)a0; +goto L46bd74;} +MEM_U8(a1 + -1) = (uint8_t)a0; +if (a1 == v0) {a0 = 0x20; +goto L46bda0;} +L46bd84: +a0 = 0x20; +L46bd88: +a1 = a1 + 0x4; +MEM_U8(a1 + -4) = (uint8_t)a0; +MEM_U8(a1 + -3) = (uint8_t)a0; +MEM_U8(a1 + -2) = (uint8_t)a0; +if (a1 != v0) {MEM_U8(a1 + -1) = (uint8_t)a0; +goto L46bd88;} +MEM_U8(a1 + -1) = (uint8_t)a0; +L46bda0: +//nop; +return; +//nop; +} + +static void f__getbuf(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L46bda8: +//_getbuf: +//nop; +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +MEM_U32(sp + 40) = a0; +v0 = f_calc_size(mem, sp, a0, a1); +goto L46bdcc; +MEM_U32(sp + 40) = a0; +L46bdcc: +gp = MEM_U32(sp + 24); +t6 = MEM_U32(sp + 40); +v1 = 0xfb528e4; +MEM_U32(sp + 36) = v0; +t7 = v1 + 0x10; +if (t6 != t7) {a2 = zero; +goto L46be10;} +a2 = zero; +//nop; +a0 = MEM_U8(v1 + 29); +//nop; +v0 = wrapper_isatty(mem, a0); +goto L46bdf8; +//nop; +L46bdf8: +gp = MEM_U32(sp + 24); +if (v0 == 0) {a2 = zero; +goto L46be10;} +a2 = zero; +a2 = 0x40; +goto L46be10; +a2 = 0x40; +a2 = zero; +L46be10: +//nop; +a0 = MEM_U32(sp + 40); +a3 = MEM_U32(sp + 36); +a1 = zero; +v0 = wrapper_setvbuf(mem, a0, a1, a2, a3); +goto L46be24; +a1 = zero; +L46be24: +t8 = MEM_U32(sp + 36); +t9 = MEM_U32(sp + 40); +gp = MEM_U32(sp + 24); +MEM_U32(t9 + 0) = t8; +ra = MEM_U32(sp + 28); +sp = sp + 0x28; +//nop; +return; +//nop; +//nop; +} + +static void f_xfree(uint8_t *mem, uint32_t sp) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L46be7c: +//xfree: +a1 = 0x1001b298; +f_alloc_dispose(mem, sp, a0, a1); +goto L46be84; +a1 = 0x1001b298; +L46be84: +//nop; +return; +//nop; +//nop; +} + +static void f_alloc_dispose(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L46be90: +//alloc_dispose: +t0 = MEM_U32(a1 + 0); +a2 = a0 + 0xfffffff8; +v0 = MEM_U32(t0 + 0); +a3 = t0; +if (v0 == 0) {//nop; +goto L46bfc4;} +//nop; +if (a3 == 0) {at = (int)a2 < (int)a3; +goto L46bf18;} +at = (int)a2 < (int)a3; +if (at != 0) {//nop; +goto L46bedc;} +//nop; +v1 = MEM_U32(a3 + 12); +//nop; +if ((int)v1 >= 0) {t8 = v1; +goto L46becc;} +t8 = v1; +t8 = -v1; +L46becc: +t9 = a3 + t8; +at = (int)t9 < (int)a2; +if (at == 0) {//nop; +goto L46bf18;} +//nop; +L46bedc: +a3 = MEM_U32(a3 + 4); +//nop; +if (a3 == 0) {at = (int)a2 < (int)a3; +goto L46bf18;} +at = (int)a2 < (int)a3; +if (at != 0) {//nop; +goto L46bedc;} +//nop; +t6 = MEM_U32(a3 + 12); +//nop; +if ((int)t6 >= 0) {t7 = t6; +goto L46bf08;} +t7 = t6; +t7 = -t6; +L46bf08: +v0 = a3 + t7; +at = (int)v0 < (int)a2; +if (at != 0) {//nop; +goto L46bedc;} +//nop; +L46bf18: +if (a3 != 0) {//nop; +goto L46bf9c;} +//nop; +a3 = t0; +if (a3 == 0) {at = (int)a2 < (int)a3; +goto L46bf94;} +at = (int)a2 < (int)a3; +if (at != 0) {//nop; +goto L46bf58;} +//nop; +v1 = MEM_U32(a3 + 12); +//nop; +if ((int)v1 >= 0) {t8 = v1; +goto L46bf48;} +t8 = v1; +t8 = -v1; +L46bf48: +t9 = a3 + t8; +at = (int)t9 < (int)a2; +if (at == 0) {//nop; +goto L46bf94;} +//nop; +L46bf58: +a3 = MEM_U32(a3 + 0); +//nop; +if (a3 == 0) {at = (int)a2 < (int)a3; +goto L46bf94;} +at = (int)a2 < (int)a3; +if (at != 0) {//nop; +goto L46bf58;} +//nop; +t6 = MEM_U32(a3 + 12); +//nop; +if ((int)t6 >= 0) {t7 = t6; +goto L46bf84;} +t7 = t6; +t7 = -t6; +L46bf84: +v0 = a3 + t7; +at = (int)v0 < (int)a2; +if (at != 0) {//nop; +goto L46bf58;} +//nop; +L46bf94: +if (a3 == 0) {//nop; +goto L46c168;} +//nop; +L46bf9c: +v1 = MEM_U32(a3 + 12); +//nop; +if ((int)v1 >= 0) {//nop; +goto L46bfc4;} +//nop; +L46bfac: +a3 = MEM_U32(a3 + 0); +//nop; +t8 = MEM_U32(a3 + 12); +//nop; +if ((int)t8 < 0) {//nop; +goto L46bfac;} +//nop; +L46bfc4: +a0 = MEM_U32(a2 + 4); +t4 = 0xfffffffc; +a1 = a0 & t4; +t1 = a2 + a1; +t0 = t1; +t2 = MEM_U32(t0 + 4); +t9 = a0 & 0x2; +if (t9 != 0) {t3 = t2 & t4; +goto L46c0b8;} +t3 = t2 & t4; +t1 = MEM_U32(a2 + 0); +t6 = t2 & 0x1; +a0 = t1; +if (t6 != 0) {t4 = a2 - a0; +goto L46c068;} +t4 = a2 - a0; +t7 = a0 + a1; +a0 = t7 + t3; +t2 = MEM_U32(a3 + 8); +at = (int)a0 < (int)0x100; +if (at != 0) {at = (int)t1 < (int)0x100; +goto L46c030;} +at = (int)t1 < (int)0x100; +if (at == 0) {v0 = a0 + 0x2; +goto L46c034;} +v0 = a0 + 0x2; +t5 = MEM_U32(t2 + 8); +MEM_U32(t4 + 12) = t2; +MEM_U32(t4 + 8) = t5; +MEM_U32(t5 + 12) = t4; +MEM_U32(t2 + 8) = t4; +L46c030: +v0 = a0 + 0x2; +L46c034: +MEM_U32(t4 + 4) = v0; +a1 = t4 + a0; +at = (int)t3 < (int)0x100; +if (at != 0) {MEM_U32(a1 + 0) = a0; +goto L46c168;} +MEM_U32(a1 + 0) = a0; +t5 = MEM_U32(t0 + 12); +a0 = MEM_U32(t0 + 8); +//nop; +MEM_U32(a0 + 12) = t5; +if (t2 != t0) {MEM_U32(t5 + 8) = a0; +goto L46c168;} +MEM_U32(t5 + 8) = a0; +MEM_U32(a3 + 8) = t5; +goto L46c168; +MEM_U32(a3 + 8) = t5; +L46c068: +a0 = a0 + a1; +at = (int)a0 < (int)0x100; +if (at != 0) {at = (int)t1 < (int)0x100; +goto L46c09c;} +at = (int)t1 < (int)0x100; +if (at == 0) {v1 = a0 + 0x2; +goto L46c0a0;} +v1 = a0 + 0x2; +t2 = MEM_U32(a3 + 8); +//nop; +t5 = MEM_U32(t2 + 8); +MEM_U32(t4 + 12) = t2; +MEM_U32(t4 + 8) = t5; +MEM_U32(t5 + 12) = t4; +MEM_U32(t2 + 8) = t4; +L46c09c: +v1 = a0 + 0x2; +L46c0a0: +MEM_U32(t4 + 4) = v1; +t8 = t3 + 0x1; +MEM_U32(t0 + 4) = t8; +t0 = t4 + a0; +MEM_U32(t0 + 0) = a0; +goto L46c168; +MEM_U32(t0 + 0) = a0; +L46c0b8: +t9 = t2 & 0x1; +if (t9 != 0) {at = (int)a1 < (int)0x100; +goto L46c128;} +at = (int)a1 < (int)0x100; +a1 = a1 + t3; +t2 = MEM_U32(a3 + 8); +at = (int)a1 < (int)0x100; +if (at != 0) {t4 = a2 + a1; +goto L46c0f0;} +t4 = a2 + a1; +t5 = MEM_U32(t2 + 8); +MEM_U32(a2 + 12) = t2; +MEM_U32(a2 + 8) = t5; +MEM_U32(t5 + 12) = a2; +MEM_U32(t2 + 8) = a2; +t4 = a2 + a1; +L46c0f0: +MEM_U32(t4 + 0) = a1; +t6 = a1 + 0x2; +at = (int)t3 < (int)0x100; +if (at != 0) {MEM_U32(a2 + 4) = t6; +goto L46c168;} +MEM_U32(a2 + 4) = t6; +t5 = MEM_U32(t0 + 12); +a0 = MEM_U32(t0 + 8); +//nop; +MEM_U32(a0 + 12) = t5; +if (t2 != t0) {MEM_U32(t5 + 8) = a0; +goto L46c168;} +MEM_U32(t5 + 8) = a0; +MEM_U32(a3 + 8) = t5; +goto L46c168; +MEM_U32(a3 + 8) = t5; +at = (int)a1 < (int)0x100; +L46c128: +if (at != 0) {t4 = t1; +goto L46c150;} +t4 = t1; +t2 = MEM_U32(a3 + 8); +//nop; +t5 = MEM_U32(t2 + 8); +MEM_U32(a2 + 12) = t2; +MEM_U32(a2 + 8) = t5; +MEM_U32(t5 + 12) = a2; +MEM_U32(t2 + 8) = a2; +t4 = t1; +L46c150: +MEM_U32(t4 + 0) = a1; +t7 = a1 + 0x2; +MEM_U32(a2 + 4) = t7; +v0 = t3 + 0x1; +MEM_U32(t0 + 4) = v0; +return; +MEM_U32(t0 + 4) = v0; +L46c168: +//nop; +return; +//nop; +} + +static uint32_t f_xmalloc(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L46c170: +//xmalloc: +a1 = 0x1001b298; +v0 = f_alloc_new(mem, sp, a0, a1); +goto L46c178; +a1 = 0x1001b298; +L46c178: +//nop; +return v0; +//nop; +//nop; +//nop; +//nop; +} + +static uint32_t f_alloc_new(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L46c18c: +//alloc_new: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 32) = ra; +L46c1a0: +MEM_U32(sp + 28) = gp; +t0 = MEM_U32(a1 + 0); +a0 = a0 + 0xf; +if (t0 == 0) {t5 = 0xfffffff8; +goto L46c2bc;} +t5 = 0xfffffff8; +L46c1b4: +t1 = MEM_U32(t0 + 8); +a0 = a0 & t5; +t2 = MEM_U32(t1 + 4); +at = (int)a0 < (int)0x10; +if (at == 0) {//nop; +goto L46c1d0;} +//nop; +a0 = 0x10; +L46c1d0: +at = (int)t2 < (int)a0; +if (at == 0) {t2 = t2 & t5; +goto L46c1fc;} +t2 = t2 & t5; +t3 = t1; +L46c1e0: +t1 = MEM_U32(t1 + 12); +//nop; +t2 = MEM_U32(t1 + 4); +if (t1 == t3) {t4 = (int)t2 < (int)a0; +goto L46c278;} +t4 = (int)t2 < (int)a0; +if (t4 != 0) {t2 = t2 & t5; +goto L46c1e0;} +t2 = t2 & t5; +L46c1fc: +t3 = t2 + 0xffffff00; +at = (int)a0 < (int)t3; +if (at == 0) {t3 = t1 + t2; +goto L46c240;} +t3 = t1 + t2; +t4 = MEM_U32(t3 + 4); +MEM_U32(t3 + 0) = a0; +t4 = t4 | 0x2; +MEM_U32(t3 + 4) = t4; +t3 = t3 - a0; +t4 = a0 | 0x1; +MEM_U32(t3 + 4) = t4; +t2 = t2 - a0; +MEM_U32(t3 + 0) = t2; +t2 = t2 | 0x2; +MEM_U32(t1 + 4) = t2; +v0 = t3 + 0x8; +goto L46c2f0; +v0 = t3 + 0x8; +L46c240: +t3 = MEM_U32(t1 + 8); +t4 = MEM_U32(t1 + 12); +t5 = MEM_U32(t1 + 4); +MEM_U32(t3 + 12) = t4; +MEM_U32(t4 + 8) = t3; +MEM_U32(t0 + 8) = t3; +t5 = t5 | 0x1; +t3 = t1 + t2; +t4 = MEM_U32(t3 + 4); +MEM_U32(t1 + 4) = t5; +t4 = t4 | 0x2; +MEM_U32(t3 + 4) = t4; +v0 = t1 + 0x8; +goto L46c2f0; +v0 = t1 + 0x8; +L46c278: +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 36) = t0; +//nop; +//nop; +a0 = a0 + 0xfffffffc; +v0 = f_alloc_next_scb(mem, sp, a0, a1); +goto L46c290; +a0 = a0 + 0xfffffffc; +L46c290: +gp = MEM_U32(sp + 28); +t0 = MEM_U32(sp + 36); +if (v0 == 0) {a0 = MEM_U32(sp + 40); +goto L46c2b4;} +a0 = MEM_U32(sp + 40); +t1 = MEM_U32(t0 + 8); +t5 = 0xfffffff8; +t2 = MEM_U32(t1 + 4); +t2 = t2 & t5; +goto L46c1fc; +t2 = t2 & t5; +L46c2b4: +//nop; +goto L46c2f0; +//nop; +L46c2bc: +MEM_U32(sp + 40) = a0; +MEM_U32(sp + 44) = a1; +//nop; +//nop; +a0 = a1; +v0 = f_alloc_mark(mem, sp, a0); +goto L46c2d4; +a0 = a1; +L46c2d4: +gp = MEM_U32(sp + 28); +a0 = MEM_U32(sp + 40); +a1 = MEM_U32(sp + 44); +if (v0 == 0) {t0 = MEM_U32(a1 + 0); +goto L46c2b4;} +t0 = MEM_U32(a1 + 0); +t5 = 0xfffffff8; +goto L46c1b4; +t5 = 0xfffffff8; +L46c2f0: +ra = MEM_U32(sp + 32); +sp = sp + 0x28; +//nop; +return v0; +//nop; +//nop; +//nop; +} + +static uint32_t f_alloc_page(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L46c308: +//alloc_page: +//nop; +//nop; +//nop; +a1 = 0x10006bd0; +sp = sp + 0xffffffd0; +v0 = MEM_U32(a1 + 0); +MEM_U32(sp + 28) = ra; +if (v0 == 0) {MEM_U32(sp + 24) = gp; +goto L46c340;} +MEM_U32(sp + 24) = gp; +t6 = MEM_U32(v0 + 12); +//nop; +at = (int)t6 < (int)a0; +if (at == 0) {//nop; +goto L46c3a4;} +//nop; +L46c340: +//nop; +//nop; +//nop; +v0 = wrapper_sbrk(mem, a0); +goto L46c350; +//nop; +L46c350: +gp = MEM_U32(sp + 24); +at = 0xffffffff; +if (v0 != at) {v1 = v0; +goto L46c368;} +v1 = v0; +v1 = zero; +goto L46c3b0; +v1 = zero; +L46c368: +a1 = 0xfffff000; +t7 = v0 & a1; +if (v0 == t7) {t8 = v1 + 0xfff; +goto L46c3b0;} +t8 = v1 + 0xfff; +t9 = t8 & a1; +a0 = t9 - v1; +//nop; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 40) = v1; +v0 = wrapper_sbrk(mem, a0); +goto L46c390; +MEM_U32(sp + 40) = v1; +L46c390: +v1 = MEM_U32(sp + 40); +t0 = MEM_U32(sp + 32); +gp = MEM_U32(sp + 24); +v1 = v1 + t0; +goto L46c3b0; +v1 = v1 + t0; +L46c3a4: +t1 = MEM_U32(v0 + 4); +v1 = v0; +MEM_U32(a1 + 0) = t1; +L46c3b0: +ra = MEM_U32(sp + 28); +sp = sp + 0x30; +v0 = v1; +return v0; +v0 = v1; +} + +static void f_alloc_free(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L46c3c0: +//alloc_free: +//nop; +//nop; +//nop; +v0 = 0x10006bd0; +t7 = MEM_U32(a0 + 12); +t6 = MEM_U32(v0 + 0); +MEM_U32(v0 + 0) = a0; +t8 = t7; +if ((int)t7 >= 0) {MEM_U32(a0 + 4) = t6; +goto L46c3ec;} +MEM_U32(a0 + 4) = t6; +t8 = -t7; +L46c3ec: +MEM_U32(a0 + 12) = t8; +return; +MEM_U32(a0 + 12) = t8; +} + +static void f_alloc_scb(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L46c3f4: +//alloc_scb: +//nop; +//nop; +//nop; +sp = sp + 0xffffffe0; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 32) = a0; +MEM_U32(sp + 24) = gp; +a0 = a1; +MEM_U32(sp + 36) = a1; +v0 = f_alloc_page(mem, sp, a0); +goto L46c420; +MEM_U32(sp + 36) = a1; +L46c420: +t6 = MEM_U32(sp + 32); +gp = MEM_U32(sp + 24); +a2 = MEM_U32(sp + 36); +if (v0 == 0) {MEM_U32(t6 + 0) = v0; +goto L46c47c;} +MEM_U32(t6 + 0) = v0; +a0 = v0 + a2; +a0 = a0 + 0xfffffff8; +a1 = a0 - v0; +t7 = -a2; +t8 = a1 + 0xfffffff2; +MEM_U32(v0 + 12) = t7; +MEM_U32(v0 + 0) = zero; +MEM_U32(v0 + 4) = zero; +MEM_U32(v0 + 16) = zero; +MEM_U32(v0 + 20) = t8; +t9 = a1 + 0xfffffff0; +t0 = 0x1; +MEM_U32(a0 + 0) = t9; +MEM_U32(a0 + 4) = t0; +v1 = v0 + 0x10; +MEM_U32(v0 + 24) = v1; +MEM_U32(v0 + 28) = v1; +MEM_U32(v0 + 8) = v1; +L46c47c: +ra = MEM_U32(sp + 28); +sp = sp + 0x20; +//nop; +return; +//nop; +} + +static uint32_t f_alloc_mark(uint8_t *mem, uint32_t sp, uint32_t a0) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a1 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L46c48c: +//alloc_mark: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc0; +//nop; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 64) = a0; +MEM_U32(sp + 24) = gp; +a0 = sp + 0x34; +a1 = 0x10000; +f_alloc_scb(mem, sp, a0, a1); +goto L46c4b8; +a1 = 0x10000; +L46c4b8: +a0 = MEM_U32(sp + 52); +gp = MEM_U32(sp + 24); +t1 = MEM_U32(sp + 64); +if (a0 != 0) {at = 0xfffffffc; +goto L46c4d4;} +at = 0xfffffffc; +v0 = zero; +goto L46c590; +v0 = zero; +L46c4d4: +t6 = MEM_U32(sp + 52); +v1 = MEM_U32(t1 + 0); +t0 = t6; +if (v1 == 0) {t7 = MEM_U32(sp + 52); +goto L46c518;} +t7 = MEM_U32(sp + 52); +v0 = MEM_U32(v1 + 4); +a0 = t6; +if (v0 == 0) {//nop; +goto L46c50c;} +//nop; +L46c4f8: +v1 = v0; +v0 = MEM_U32(v0 + 4); +//nop; +if (v0 != 0) {//nop; +goto L46c4f8;} +//nop; +L46c50c: +MEM_U32(v1 + 4) = a0; +MEM_U32(a0 + 0) = v1; +t7 = MEM_U32(sp + 52); +L46c518: +//nop; +MEM_U32(t1 + 0) = t7; +t8 = MEM_U32(sp + 52); +//nop; +t9 = MEM_U32(t8 + 12); +//nop; +if ((int)t9 >= 0) {t2 = t9; +goto L46c53c;} +t2 = t9; +t2 = -t9; +L46c53c: +MEM_U32(t8 + 12) = t2; +t3 = MEM_U32(sp + 52); +t7 = 0x2; +v1 = MEM_U32(t3 + 8); +v0 = t0; +a3 = MEM_U32(v1 + 4); +a0 = v1 + 0x10; +t4 = a3 & at; +a1 = v1 + t4; +a2 = a1 - v1; +t5 = a2 + 0xfffffff0; +MEM_U32(v1 + 12) = a0; +MEM_U32(v1 + 8) = a0; +MEM_U32(v1 + 28) = v1; +MEM_U32(v1 + 24) = v1; +MEM_U32(a1 + 0) = t5; +t9 = MEM_U32(sp + 52); +t6 = a2 + 0xfffffff2; +MEM_U32(v1 + 20) = t6; +MEM_U32(v1 + 4) = t7; +MEM_U32(t9 + 8) = a0; +L46c590: +ra = MEM_U32(sp + 28); +sp = sp + 0x40; +//nop; +return v0; +//nop; +} + +static void f_alloc_release(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L46c5a0: +//alloc_release: +//nop; +//nop; +//nop; +sp = sp + 0xffffffd8; +MEM_U32(sp + 36) = ra; +MEM_U32(sp + 32) = gp; +MEM_U32(sp + 28) = s1; +MEM_U32(sp + 24) = s0; +v0 = MEM_U32(a0 + 0); +s1 = a1; +if (v0 == a1) {//nop; +goto L46c5f0;} +//nop; +if (v0 == 0) {//nop; +goto L46c5f0;} +//nop; +L46c5d8: +v0 = MEM_U32(v0 + 0); +//nop; +if (v0 == a1) {//nop; +goto L46c5f0;} +//nop; +if (v0 != 0) {//nop; +goto L46c5d8;} +//nop; +L46c5f0: +if (v0 == 0) {ra = MEM_U32(sp + 36); +goto L46c668;} +ra = MEM_U32(sp + 36); +s0 = MEM_U32(a1 + 0); +//nop; +if (s0 == 0) {//nop; +goto L46c60c;} +//nop; +MEM_U32(s0 + 4) = zero; +L46c60c: +if (s0 == 0) {//nop; +goto L46c644;} +//nop; +t6 = MEM_U32(s0 + 12); +//nop; +if ((int)t6 >= 0) {//nop; +goto L46c644;} +//nop; +L46c624: +s0 = MEM_U32(s0 + 0); +//nop; +if (s0 == 0) {//nop; +goto L46c644;} +//nop; +t7 = MEM_U32(s0 + 12); +//nop; +if ((int)t7 < 0) {//nop; +goto L46c624;} +//nop; +L46c644: +MEM_U32(a0 + 0) = s0; +L46c648: +//nop; +s0 = MEM_U32(s1 + 4); +a0 = s1; +f_alloc_free(mem, sp, a0); +goto L46c658; +a0 = s1; +L46c658: +gp = MEM_U32(sp + 32); +if (s0 != 0) {s1 = s0; +goto L46c648;} +s1 = s0; +ra = MEM_U32(sp + 36); +L46c668: +s0 = MEM_U32(sp + 24); +s1 = MEM_U32(sp + 28); +sp = sp + 0x28; +return; +sp = sp + 0x28; +} + +static uint32_t f_alloc_next_scb(uint8_t *mem, uint32_t sp, uint32_t a0, uint32_t a1) { +const uint32_t zero = 0; +uint32_t at = 0, v1 = 0, t0 = 0, t1 = 0, t2 = 0, +t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, gp = 0x10000, ra = 0x10000; +uint32_t lo = 0, hi = 0; +int cf = 0; +uint64_t temp64; +uint32_t fp_dest; +void *dest; +uint32_t v0 = 0; +uint32_t a2 = 0; +uint32_t a3 = 0; +L46c678: +//alloc_next_scb: +//nop; +//nop; +//nop; +sp = sp + 0xffffffc8; +a2 = a0; +at = 0x7fff0000; +MEM_U32(sp + 60) = a1; +at = at | 0xf000; +t6 = a2 + 0x1017; +a1 = t6 & at; +at = 0x10000; +at = (int)a1 < (int)at; +MEM_U32(sp + 28) = ra; +MEM_U32(sp + 24) = gp; +if (at == 0) {a0 = sp + 0x2c; +goto L46c6bc;} +a0 = sp + 0x2c; +a1 = 0x10000; +L46c6bc: +//nop; +//nop; +//nop; +f_alloc_scb(mem, sp, a0, a1); +goto L46c6cc; +//nop; +L46c6cc: +t8 = MEM_U32(sp + 44); +gp = MEM_U32(sp + 24); +a1 = MEM_U32(sp + 60); +if (t8 != 0) {//nop; +goto L46c6e8;} +//nop; +v0 = zero; +goto L46c75c; +v0 = zero; +L46c6e8: +v1 = MEM_U32(a1 + 0); +t9 = MEM_U32(sp + 44); +v0 = MEM_U32(v1 + 4); +//nop; +if (v0 == 0) {t0 = MEM_U32(sp + 44); +goto L46c718;} +t0 = MEM_U32(sp + 44); +L46c700: +v1 = v0; +v0 = MEM_U32(v0 + 4); +//nop; +if (v0 != 0) {//nop; +goto L46c700;} +//nop; +t0 = MEM_U32(sp + 44); +L46c718: +MEM_U32(v1 + 4) = t9; +MEM_U32(t0 + 0) = v1; +v1 = MEM_U32(a1 + 0); +t1 = MEM_U32(sp + 44); +v0 = MEM_U32(v1 + 8); +a0 = MEM_U32(t1 + 8); +if (v0 == 0) {//nop; +goto L46c754;} +//nop; +t2 = MEM_U32(v0 + 8); +MEM_U32(a0 + 12) = v0; +MEM_U32(a0 + 8) = t2; +t3 = MEM_U32(v0 + 8); +//nop; +MEM_U32(t3 + 12) = a0; +MEM_U32(v0 + 8) = a0; +L46c754: +MEM_U32(v1 + 8) = a0; +v0 = 0x1; +L46c75c: +ra = MEM_U32(sp + 28); +sp = sp + 0x38; +//nop; +return v0; +//nop; +} diff --git a/ido/ido5.3_recomp/ujoin b/ido/ido5.3_recomp/ujoin new file mode 100755 index 00000000..98ba6065 Binary files /dev/null and b/ido/ido5.3_recomp/ujoin differ diff --git a/ido/ido5.3_recomp/uld b/ido/ido5.3_recomp/uld new file mode 100755 index 00000000..38833f5b Binary files /dev/null and b/ido/ido5.3_recomp/uld differ diff --git a/ido/ido5.3_recomp/umerge b/ido/ido5.3_recomp/umerge new file mode 100755 index 00000000..5b78e92e Binary files /dev/null and b/ido/ido5.3_recomp/umerge differ diff --git a/ido/ido5.3_recomp/uopt b/ido/ido5.3_recomp/uopt new file mode 100755 index 00000000..e2eff50d Binary files /dev/null and b/ido/ido5.3_recomp/uopt differ diff --git a/ido/ido5.3_recomp/usplit b/ido/ido5.3_recomp/usplit new file mode 100755 index 00000000..e6a69ef8 Binary files /dev/null and b/ido/ido5.3_recomp/usplit differ diff --git a/include/2.0L/PR/PRimage.h b/include/2.0L/PR/PRimage.h new file mode 100644 index 00000000..aacc6567 --- /dev/null +++ b/include/2.0L/PR/PRimage.h @@ -0,0 +1,126 @@ +/************************************************************************** + * + * $Revision: 1.4 $ + * $Date: 1997/11/26 00:30:50 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/PRimage.h,v $ + * + **************************************************************************/ + +#ifndef __GL_IMAGE_H__ +#define __GL_IMAGE_H__ +#ifdef __cplusplus +extern "C" { +#endif + + +/* + * Defines for image files . . . . + * + * Paul Haeberli - 1984 + * Look in /usr/people/4Dgifts/iristools/imgtools for example code! + * + */ + +#include + +#define IMAGIC 0732 + +/* colormap of images */ +#define CM_NORMAL 0 /* file contains rows of values which + * are either RGB values (zsize == 3) + * or greyramp values (zsize == 1) */ +#define CM_DITHERED 1 +#define CM_SCREEN 2 /* file contains data which is a screen + * image; getrow returns buffer which + * can be displayed directly with + * writepixels */ +#define CM_COLORMAP 3 /* a colormap file */ + +#define TYPEMASK 0xff00 +#define BPPMASK 0x00ff +#define ITYPE_VERBATIM 0x0000 +#define ITYPE_RLE 0x0100 +#define ISRLE(type) (((type) & 0xff00) == ITYPE_RLE) +#define ISVERBATIM(type) (((type) & 0xff00) == ITYPE_VERBATIM) +#define BPP(type) ((type) & BPPMASK) +#define RLE(bpp) (ITYPE_RLE | (bpp)) +#define VERBATIM(bpp) (ITYPE_VERBATIM | (bpp)) +#define IBUFSIZE(pixels) (((pixels)+((pixels)>>6))<<2) +#define RLE_NOP 0x00 + +#define ierror(p) (((p)->flags&_IOERR)!=0) +#define ifileno(p) ((p)->file) +#define getpix(p) (--(p)->cnt>=0 ? *(p)->ptr++ : ifilbuf(p)) +#define putpix(p,x) (--(p)->cnt>=0 \ + ? ((int)(*(p)->ptr++=(unsigned)(x))) \ + : iflsbuf(p,(unsigned)(x))) + +typedef struct { + unsigned short imagic; /* stuff saved on disk . . */ + unsigned short type; + unsigned short dim; + unsigned short xsize; + unsigned short ysize; + unsigned short zsize; + unsigned long min; + unsigned long max; + unsigned long wastebytes; + char name[80]; + unsigned long colormap; + + long file; /* stuff used in core only */ + unsigned short flags; + short dorev; + short x; + short y; + short z; + short cnt; + unsigned short *ptr; + unsigned short *base; + unsigned short *tmpbuf; + unsigned long offset; + unsigned long rleend; /* for rle images */ + unsigned long *rowstart; /* for rle images */ + long *rowsize; /* for rle images */ +} IMAGE; + +IMAGE *icreate(); +/* + * IMAGE *iopen(char *file, char *mode, unsigned int type, unsigned int dim, + * unsigned int xsize, unsigned int ysize, unsigned int zsize); + * IMAGE *fiopen(int f, char *mode, unsigned int type, unsigned int dim, + * unsigned int xsize, unsigned int ysize, unsigned int zsize); + * + * ...while iopen and fiopen can take an extended set of parameters, the + * last five are optional, so a more correct prototype would be: + * + */ +IMAGE *iopen(char *file, char *mode, ...); +IMAGE *fiopen(int f, char *mode, ...); + +/* + * + * unsigned short *ibufalloc(IMAGE *image); + * int ifilbuf(IMAGE *image); + * int iflush(IMAGE *image); + * unsigned int iflsbuf(IMAGE *image, unsigned int c); + * void isetname(IMAGE *image, char *name); + * void isetcolormap(IMAGE *image, int colormap); + */ + +int iclose(IMAGE *image); +int putrow(IMAGE *image, unsigned short *buffer, unsigned int y, unsigned int z); +int getrow(IMAGE *image, unsigned short *buffer, unsigned int y, unsigned int z); + +/* +IMAGE *iopen(); +IMAGE *icreate(); +*/ + +unsigned short *ibufalloc(); + +#define IMAGEDEF /* for backwards compatibility */ +#ifdef __cplusplus +} +#endif +#endif /* !__GL_IMAGE_H__ */ diff --git a/include/2.0L/PR/R4300.h b/include/2.0L/PR/R4300.h new file mode 100644 index 00000000..fd70d07f --- /dev/null +++ b/include/2.0L/PR/R4300.h @@ -0,0 +1,453 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * $Revision: 1.13 $ + * $Date: 1997/02/11 08:15:34 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/R4300.h,v $ + * + **************************************************************************/ + +#ifndef __R4300_H__ +#define __R4300_H__ + +#include + +/* + * Segment base addresses and sizes + */ +#define KUBASE 0 +#define KUSIZE 0x80000000 +#define K0BASE 0x80000000 +#define K0SIZE 0x20000000 +#define K1BASE 0xA0000000 +#define K1SIZE 0x20000000 +#define K2BASE 0xC0000000 +#define K2SIZE 0x20000000 + +/* + * Exception vectors + */ +#define SIZE_EXCVEC 0x80 /* Size of an exc. vec */ +#define UT_VEC K0BASE /* utlbmiss vector */ +#define R_VEC (K1BASE+0x1fc00000) /* reset vector */ +#define XUT_VEC (K0BASE+0x80) /* extended address tlbmiss */ +#define ECC_VEC (K0BASE+0x100) /* Ecc exception vector */ +#define E_VEC (K0BASE+0x180) /* Gen. exception vector */ + +/* + * Address conversion macros + */ +#ifdef _LANGUAGE_ASSEMBLY + +#define K0_TO_K1(x) ((x)|0xA0000000) /* kseg0 to kseg1 */ +#define K1_TO_K0(x) ((x)&0x9FFFFFFF) /* kseg1 to kseg0 */ +#define K0_TO_PHYS(x) ((x)&0x1FFFFFFF) /* kseg0 to physical */ +#define K1_TO_PHYS(x) ((x)&0x1FFFFFFF) /* kseg1 to physical */ +#define KDM_TO_PHYS(x) ((x)&0x1FFFFFFF) /* direct mapped to physical */ +#define PHYS_TO_K0(x) ((x)|0x80000000) /* physical to kseg0 */ +#define PHYS_TO_K1(x) ((x)|0xA0000000) /* physical to kseg1 */ + +#else /* _LANGUAGE_C */ + +#define K0_TO_K1(x) ((u32)(x)|0xA0000000) /* kseg0 to kseg1 */ +#define K1_TO_K0(x) ((u32)(x)&0x9FFFFFFF) /* kseg1 to kseg0 */ +#define K0_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* kseg0 to physical */ +#define K1_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* kseg1 to physical */ +#define KDM_TO_PHYS(x) ((u32)(x)&0x1FFFFFFF) /* direct mapped to physical */ +#define PHYS_TO_K0(x) ((u32)(x)|0x80000000) /* physical to kseg0 */ +#define PHYS_TO_K1(x) ((u32)(x)|0xA0000000) /* physical to kseg1 */ + +#endif /* _LANGUAGE_ASSEMBLY */ + +/* + * Address predicates + */ +#define IS_KSEG0(x) ((u32)(x) >= K0BASE && (u32)(x) < K1BASE) +#define IS_KSEG1(x) ((u32)(x) >= K1BASE && (u32)(x) < K2BASE) +#define IS_KSEGDM(x) ((u32)(x) >= K0BASE && (u32)(x) < K2BASE) +#define IS_KSEG2(x) ((u32)(x) >= K2BASE && (u32)(x) < KPTE_SHDUBASE) +#define IS_KPTESEG(x) ((u32)(x) >= KPTE_SHDUBASE) +#define IS_KUSEG(x) ((u32)(x) < K0BASE) + +/* + * TLB size constants + */ + +#define NTLBENTRIES 31 /* entry 31 is reserved by rdb */ + +#define TLBHI_VPN2MASK 0xffffe000 +#define TLBHI_VPN2SHIFT 13 +#define TLBHI_PIDMASK 0xff +#define TLBHI_PIDSHIFT 0 +#define TLBHI_NPID 255 /* 255 to fit in 8 bits */ + +#define TLBLO_PFNMASK 0x3fffffc0 +#define TLBLO_PFNSHIFT 6 +#define TLBLO_CACHMASK 0x38 /* cache coherency algorithm */ +#define TLBLO_CACHSHIFT 3 +#define TLBLO_UNCACHED 0x10 /* not cached */ +#define TLBLO_NONCOHRNT 0x18 /* Cacheable non-coherent */ +#define TLBLO_EXLWR 0x28 /* Exclusive write */ +#define TLBLO_D 0x4 /* writeable */ +#define TLBLO_V 0x2 /* valid bit */ +#define TLBLO_G 0x1 /* global access bit */ + +#define TLBINX_PROBE 0x80000000 +#define TLBINX_INXMASK 0x3f +#define TLBINX_INXSHIFT 0 + +#define TLBRAND_RANDMASK 0x3f +#define TLBRAND_RANDSHIFT 0 + +#define TLBWIRED_WIREDMASK 0x3f + +#define TLBCTXT_BASEMASK 0xff800000 +#define TLBCTXT_BASESHIFT 23 +#define TLBCTXT_BASEBITS 9 + +#define TLBCTXT_VPNMASK 0x7ffff0 +#define TLBCTXT_VPNSHIFT 4 + +#define TLBPGMASK_4K 0x0 +#define TLBPGMASK_16K 0x6000 +#define TLBPGMASK_64K 0x1e000 + +/* + * Status register + */ +#define SR_CUMASK 0xf0000000 /* coproc usable bits */ + +#define SR_CU3 0x80000000 /* Coprocessor 3 usable */ +#define SR_CU2 0x40000000 /* Coprocessor 2 usable */ +#define SR_CU1 0x20000000 /* Coprocessor 1 usable */ +#define SR_CU0 0x10000000 /* Coprocessor 0 usable */ +#define SR_RP 0x08000000 /* Reduced power (quarter speed) */ +#define SR_FR 0x04000000 /* MIPS III FP register mode */ +#define SR_RE 0x02000000 /* Reverse endian */ +#define SR_ITS 0x01000000 /* Instruction trace support */ +#define SR_BEV 0x00400000 /* Use boot exception vectors */ +#define SR_TS 0x00200000 /* TLB shutdown */ +#define SR_SR 0x00100000 /* Soft reset occured */ +#define SR_CH 0x00040000 /* Cache hit for last 'cache' op */ +#define SR_CE 0x00020000 /* Create ECC */ +#define SR_DE 0x00010000 /* ECC of parity does not cause error */ + +/* + * Interrupt enable bits + * (NOTE: bits set to 1 enable the corresponding level interrupt) + */ +#define SR_IMASK 0x0000ff00 /* Interrupt mask */ +#define SR_IMASK8 0x00000000 /* mask level 8 */ +#define SR_IMASK7 0x00008000 /* mask level 7 */ +#define SR_IMASK6 0x0000c000 /* mask level 6 */ +#define SR_IMASK5 0x0000e000 /* mask level 5 */ +#define SR_IMASK4 0x0000f000 /* mask level 4 */ +#define SR_IMASK3 0x0000f800 /* mask level 3 */ +#define SR_IMASK2 0x0000fc00 /* mask level 2 */ +#define SR_IMASK1 0x0000fe00 /* mask level 1 */ +#define SR_IMASK0 0x0000ff00 /* mask level 0 */ + +#define SR_IBIT8 0x00008000 /* bit level 8 */ +#define SR_IBIT7 0x00004000 /* bit level 7 */ +#define SR_IBIT6 0x00002000 /* bit level 6 */ +#define SR_IBIT5 0x00001000 /* bit level 5 */ +#define SR_IBIT4 0x00000800 /* bit level 4 */ +#define SR_IBIT3 0x00000400 /* bit level 3 */ +#define SR_IBIT2 0x00000200 /* bit level 2 */ +#define SR_IBIT1 0x00000100 /* bit level 1 */ + +#define SR_IMASKSHIFT 8 + +#define SR_KX 0x00000080 /* extended-addr TLB vec in kernel */ +#define SR_SX 0x00000040 /* xtended-addr TLB vec supervisor */ +#define SR_UX 0x00000020 /* xtended-addr TLB vec in user mode */ +#define SR_KSU_MASK 0x00000018 /* mode mask */ +#define SR_KSU_USR 0x00000010 /* user mode */ +#define SR_KSU_SUP 0x00000008 /* supervisor mode */ +#define SR_KSU_KER 0x00000000 /* kernel mode */ +#define SR_ERL 0x00000004 /* Error level, 1=>cache error */ +#define SR_EXL 0x00000002 /* Exception level, 1=>exception */ +#define SR_IE 0x00000001 /* interrupt enable, 1=>enable */ + +/* + * Cause Register + */ +#define CAUSE_BD 0x80000000 /* Branch delay slot */ +#define CAUSE_CEMASK 0x30000000 /* coprocessor error */ +#define CAUSE_CESHIFT 28 + +/* Interrupt pending bits */ +#define CAUSE_IP8 0x00008000 /* External level 8 pending - COMPARE */ +#define CAUSE_IP7 0x00004000 /* External level 7 pending - INT4 */ +#define CAUSE_IP6 0x00002000 /* External level 6 pending - INT3 */ +#define CAUSE_IP5 0x00001000 /* External level 5 pending - INT2 */ +#define CAUSE_IP4 0x00000800 /* External level 4 pending - INT1 */ +#define CAUSE_IP3 0x00000400 /* External level 3 pending - INT0 */ +#define CAUSE_SW2 0x00000200 /* Software level 2 pending */ +#define CAUSE_SW1 0x00000100 /* Software level 1 pending */ + +#define CAUSE_IPMASK 0x0000FF00 /* Pending interrupt mask */ +#define CAUSE_IPSHIFT 8 + +#define CAUSE_EXCMASK 0x0000007C /* Cause code bits */ + +#define CAUSE_EXCSHIFT 2 + +/* Cause register exception codes */ + +#define EXC_CODE(x) ((x)<<2) + +/* Hardware exception codes */ +#define EXC_INT EXC_CODE(0) /* interrupt */ +#define EXC_MOD EXC_CODE(1) /* TLB mod */ +#define EXC_RMISS EXC_CODE(2) /* Read TLB Miss */ +#define EXC_WMISS EXC_CODE(3) /* Write TLB Miss */ +#define EXC_RADE EXC_CODE(4) /* Read Address Error */ +#define EXC_WADE EXC_CODE(5) /* Write Address Error */ +#define EXC_IBE EXC_CODE(6) /* Instruction Bus Error */ +#define EXC_DBE EXC_CODE(7) /* Data Bus Error */ +#define EXC_SYSCALL EXC_CODE(8) /* SYSCALL */ +#define EXC_BREAK EXC_CODE(9) /* BREAKpoint */ +#define EXC_II EXC_CODE(10) /* Illegal Instruction */ +#define EXC_CPU EXC_CODE(11) /* CoProcessor Unusable */ +#define EXC_OV EXC_CODE(12) /* OVerflow */ +#define EXC_TRAP EXC_CODE(13) /* Trap exception */ +#define EXC_VCEI EXC_CODE(14) /* Virt. Coherency on Inst. fetch */ +#define EXC_FPE EXC_CODE(15) /* Floating Point Exception */ +#define EXC_WATCH EXC_CODE(23) /* Watchpoint reference */ +#define EXC_VCED EXC_CODE(31) /* Virt. Coherency on data read */ + +/* C0_PRID Defines */ +#define C0_IMPMASK 0xff00 +#define C0_IMPSHIFT 8 +#define C0_REVMASK 0xff +#define C0_MAJREVMASK 0xf0 +#define C0_MAJREVSHIFT 4 +#define C0_MINREVMASK 0xf + +/* + * Coprocessor 0 operations + */ +#define C0_READI 0x1 /* read ITLB entry addressed by C0_INDEX */ +#define C0_WRITEI 0x2 /* write ITLB entry addressed by C0_INDEX */ +#define C0_WRITER 0x6 /* write ITLB entry addressed by C0_RAND */ +#define C0_PROBE 0x8 /* probe for ITLB entry addressed by TLBHI */ +#define C0_RFE 0x10 /* restore for exception */ + +/* + * 'cache' instruction definitions + */ + +/* Target cache */ +#define CACH_PI 0x0 /* specifies primary inst. cache */ +#define CACH_PD 0x1 /* primary data cache */ +#define CACH_SI 0x2 /* secondary instruction cache */ +#define CACH_SD 0x3 /* secondary data cache */ + +/* Cache operations */ +#define C_IINV 0x0 /* index invalidate (inst, 2nd inst) */ +#define C_IWBINV 0x0 /* index writeback inval (d, sd) */ +#define C_ILT 0x4 /* index load tag (all) */ +#define C_IST 0x8 /* index store tag (all) */ +#define C_CDX 0xc /* create dirty exclusive (d, sd) */ +#define C_HINV 0x10 /* hit invalidate (all) */ +#define C_HWBINV 0x14 /* hit writeback inv. (d, sd) */ +#define C_FILL 0x14 /* fill (i) */ +#define C_HWB 0x18 /* hit writeback (i, d, sd) */ +#define C_HSV 0x1c /* hit set virt. (si, sd) */ + +/* + * Cache size definitions + */ +#define ICACHE_SIZE 0x4000 /* 16K */ +#define ICACHE_LINESIZE 32 /* 8 words */ +#define ICACHE_LINEMASK (ICACHE_LINESIZE-1) + +#define DCACHE_SIZE 0x2000 /* 8K */ +#define DCACHE_LINESIZE 16 /* 4 words */ +#define DCACHE_LINEMASK (DCACHE_LINESIZE-1) + +/* + * C0_CONFIG register definitions + */ +#define CONFIG_CM 0x80000000 /* 1 == Master-Checker enabled */ +#define CONFIG_EC 0x70000000 /* System Clock ratio */ +#define CONFIG_EC_1_1 0x6 /* System Clock ratio 1 :1 */ +#define CONFIG_EC_3_2 0x7 /* System Clock ratio 1.5 :1 */ +#define CONFIG_EC_2_1 0x0 /* System Clock ratio 2 :1 */ +#define CONFIG_EC_3_1 0x1 /* System Clock ratio 3 :1 */ +#define CONFIG_EP 0x0f000000 /* Transmit Data Pattern */ +#define CONFIG_SB 0x00c00000 /* Secondary cache block size */ + +#define CONFIG_SS 0x00200000 /* Split scache: 0 == I&D combined */ +#define CONFIG_SW 0x00100000 /* scache port: 0==128, 1==64 */ +#define CONFIG_EW 0x000c0000 /* System Port width: 0==64, 1==32 */ +#define CONFIG_SC 0x00020000 /* 0 -> 2nd cache present */ +#define CONFIG_SM 0x00010000 /* 0 -> Dirty Shared Coherency enabled*/ +#define CONFIG_BE 0x00008000 /* Endian-ness: 1 --> BE */ +#define CONFIG_EM 0x00004000 /* 1 -> ECC mode, 0 -> parity */ +#define CONFIG_EB 0x00002000 /* Block order:1->sequent,0->subblock */ + +#define CONFIG_IC 0x00000e00 /* Primary Icache size */ +#define CONFIG_DC 0x000001c0 /* Primary Dcache size */ +#define CONFIG_IB 0x00000020 /* Icache block size */ +#define CONFIG_DB 0x00000010 /* Dcache block size */ +#define CONFIG_CU 0x00000008 /* Update on Store-conditional */ +#define CONFIG_K0 0x00000007 /* K0SEG Coherency algorithm */ + +#define CONFIG_UNCACHED 0x00000002 /* K0 is uncached */ +#define CONFIG_NONCOHRNT 0x00000003 +#define CONFIG_COHRNT_EXLWR 0x00000005 +#define CONFIG_SB_SHFT 22 /* shift SB to bit position 0 */ +#define CONFIG_IC_SHFT 9 /* shift IC to bit position 0 */ +#define CONFIG_DC_SHFT 6 /* shift DC to bit position 0 */ +#define CONFIG_BE_SHFT 15 /* shift BE to bit position 0 */ + +/* + * C0_TAGLO definitions for setting/getting cache states and physaddr bits + */ +#define SADDRMASK 0xFFFFE000 /* 31..13 -> scache paddr bits 35..17 */ +#define SVINDEXMASK 0x00000380 /* 9..7: prim virt index bits 14..12 */ +#define SSTATEMASK 0x00001c00 /* bits 12..10 hold scache line state */ +#define SINVALID 0x00000000 /* invalid --> 000 == state 0 */ +#define SCLEANEXCL 0x00001000 /* clean exclusive --> 100 == state 4 */ +#define SDIRTYEXCL 0x00001400 /* dirty exclusive --> 101 == state 5 */ +#define SECC_MASK 0x0000007f /* low 7 bits are ecc for the tag */ +#define SADDR_SHIFT 4 /* shift STagLo (31..13) to 35..17 */ + +#define PADDRMASK 0xFFFFFF00 /* PTagLo31..8->prim paddr bits35..12 */ +#define PADDR_SHIFT 4 /* roll bits 35..12 down to 31..8 */ +#define PSTATEMASK 0x00C0 /* bits 7..6 hold primary line state */ +#define PINVALID 0x0000 /* invalid --> 000 == state 0 */ +#define PCLEANEXCL 0x0080 /* clean exclusive --> 10 == state 2 */ +#define PDIRTYEXCL 0x00C0 /* dirty exclusive --> 11 == state 3 */ +#define PPARITY_MASK 0x0001 /* low bit is parity bit (even). */ + +/* + * C0_CACHE_ERR definitions. + */ +#define CACHERR_ER 0x80000000 /* 0: inst ref, 1: data ref */ +#define CACHERR_EC 0x40000000 /* 0: primary, 1: secondary */ +#define CACHERR_ED 0x20000000 /* 1: data error */ +#define CACHERR_ET 0x10000000 /* 1: tag error */ +#define CACHERR_ES 0x08000000 /* 1: external ref, e.g. snoop*/ +#define CACHERR_EE 0x04000000 /* error on SysAD bus */ +#define CACHERR_EB 0x02000000 /* complicated, see spec. */ +#define CACHERR_EI 0x01000000 /* complicated, see spec. */ +#define CACHERR_SIDX_MASK 0x003ffff8 /* secondary cache index */ +#define CACHERR_PIDX_MASK 0x00000007 /* primary cache index */ +#define CACHERR_PIDX_SHIFT 12 /* bits 2..0 are paddr14..12 */ + +/* R4000 family supports hardware watchpoints: + * C0_WATCHLO: + * bits 31..3 are bits 31..3 of physaddr to watch + * bit 2: reserved; must be written as 0. + * bit 1: when set causes a watchpoint trap on load accesses to paddr. + * bit 0: when set traps on stores to paddr; + * C0_WATCHHI + * bits 31..4 are reserved and must be written as zeros. + * bits 3..0 are bits 35..32 of the physaddr to watch + */ +#define WATCHLO_WTRAP 0x00000001 +#define WATCHLO_RTRAP 0x00000002 +#define WATCHLO_ADDRMASK 0xfffffff8 +#define WATCHLO_VALIDMASK 0xfffffffb +#define WATCHHI_VALIDMASK 0x0000000f + +/* + * Coprocessor 0 registers + */ +#ifdef _LANGUAGE_ASSEMBLY +#define C0_INX $0 +#define C0_RAND $1 +#define C0_ENTRYLO0 $2 +#define C0_ENTRYLO1 $3 +#define C0_CONTEXT $4 +#define C0_PAGEMASK $5 /* page mask */ +#define C0_WIRED $6 /* # wired entries in tlb */ +#define C0_BADVADDR $8 +#define C0_COUNT $9 /* free-running counter */ +#define C0_ENTRYHI $10 +#define C0_SR $12 +#define C0_CAUSE $13 +#define C0_EPC $14 +#define C0_PRID $15 /* revision identifier */ +#define C0_COMPARE $11 /* counter comparison reg. */ +#define C0_CONFIG $16 /* hardware configuration */ +#define C0_LLADDR $17 /* load linked address */ +#define C0_WATCHLO $18 /* watchpoint */ +#define C0_WATCHHI $19 /* watchpoint */ +#define C0_ECC $26 /* S-cache ECC and primary parity */ +#define C0_CACHE_ERR $27 /* cache error status */ +#define C0_TAGLO $28 /* cache operations */ +#define C0_TAGHI $29 /* cache operations */ +#define C0_ERROR_EPC $30 /* ECC error prg. counter */ + +# else /* ! _LANGUAGE_ASSEMBLY */ + +#define C0_INX 0 +#define C0_RAND 1 +#define C0_ENTRYLO0 2 +#define C0_ENTRYLO1 3 +#define C0_CONTEXT 4 +#define C0_PAGEMASK 5 /* page mask */ +#define C0_WIRED 6 /* # wired entries in tlb */ +#define C0_BADVADDR 8 +#define C0_COUNT 9 /* free-running counter */ +#define C0_ENTRYHI 10 +#define C0_SR 12 +#define C0_CAUSE 13 +#define C0_EPC 14 +#define C0_PRID 15 /* revision identifier */ +#define C0_COMPARE 11 /* counter comparison reg. */ +#define C0_CONFIG 16 /* hardware configuration */ +#define C0_LLADDR 17 /* load linked address */ +#define C0_WATCHLO 18 /* watchpoint */ +#define C0_WATCHHI 19 /* watchpoint */ +#define C0_ECC 26 /* S-cache ECC and primary parity */ +#define C0_CACHE_ERR 27 /* cache error status */ +#define C0_TAGLO 28 /* cache operations */ +#define C0_TAGHI 29 /* cache operations */ +#define C0_ERROR_EPC 30 /* ECC error prg. counter */ + +#endif /* _LANGUAGE_ASSEMBLY */ + +/* + * floating-point status register + */ +#define FPCSR_FS 0x01000000 /* flush denorm to zero */ +#define FPCSR_C 0x00800000 /* condition bit */ +#define FPCSR_CE 0x00020000 /* cause: unimplemented operation */ +#define FPCSR_CV 0x00010000 /* cause: invalid operation */ +#define FPCSR_CZ 0x00008000 /* cause: division by zero */ +#define FPCSR_CO 0x00004000 /* cause: overflow */ +#define FPCSR_CU 0x00002000 /* cause: underflow */ +#define FPCSR_CI 0x00001000 /* cause: inexact operation */ +#define FPCSR_EV 0x00000800 /* enable: invalid operation */ +#define FPCSR_EZ 0x00000400 /* enable: division by zero */ +#define FPCSR_EO 0x00000200 /* enable: overflow */ +#define FPCSR_EU 0x00000100 /* enable: underflow */ +#define FPCSR_EI 0x00000080 /* enable: inexact operation */ +#define FPCSR_FV 0x00000040 /* flag: invalid operation */ +#define FPCSR_FZ 0x00000020 /* flag: division by zero */ +#define FPCSR_FO 0x00000010 /* flag: overflow */ +#define FPCSR_FU 0x00000008 /* flag: underflow */ +#define FPCSR_FI 0x00000004 /* flag: inexact operation */ +#define FPCSR_RM_MASK 0x00000003 /* rounding mode mask */ +#define FPCSR_RM_RN 0x00000000 /* round to nearest */ +#define FPCSR_RM_RZ 0x00000001 /* round to zero */ +#define FPCSR_RM_RP 0x00000002 /* round to positive infinity */ +#define FPCSR_RM_RM 0x00000003 /* round to negative infinity */ + +#endif /* __R4300_H */ diff --git a/include/2.0L/PR/abi.h b/include/2.0L/PR/abi.h new file mode 100644 index 00000000..e1215260 --- /dev/null +++ b/include/2.0L/PR/abi.h @@ -0,0 +1,410 @@ +#ifndef _ABI_H_ +#define _ABI_H_ + +/************************************************************************** + * * + * Copyright (C) 1994, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * $Revision: 1.32 $ + * $Date: 1997/02/11 08:16:37 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/abi.h,v $ + * + **************************************************************************/ + +/* + * Header file for the Audio Binary Interface. + * This is included in the Media Binary Interface file + * mbi.h. + * + * This file follows the framework used for graphics. + * + */ + +/* Audio commands: */ +#define A_SPNOOP 0 +#define A_ADPCM 1 +#define A_CLEARBUFF 2 +#define A_ENVMIXER 3 +#define A_LOADBUFF 4 +#define A_RESAMPLE 5 +#define A_SAVEBUFF 6 +#define A_SEGMENT 7 +#define A_SETBUFF 8 +#define A_SETVOL 9 +#define A_DMEMMOVE 10 +#define A_LOADADPCM 11 +#define A_MIXER 12 +#define A_INTERLEAVE 13 +#define A_POLEF 14 +#define A_SETLOOP 15 + +#define ACMD_SIZE 32 +/* + * Audio flags + */ + +#define A_INIT 0x01 +#define A_CONTINUE 0x00 +#define A_LOOP 0x02 +#define A_OUT 0x02 +#define A_LEFT 0x02 +#define A_RIGHT 0x00 +#define A_VOL 0x04 +#define A_RATE 0x00 +#define A_AUX 0x08 +#define A_NOAUX 0x00 +#define A_MAIN 0x00 +#define A_MIX 0x10 + +/* + * BEGIN C-specific section: (typedef's) + */ +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* + * Data Structures. + */ + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int gain:16; + unsigned int addr; +} Aadpcm; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int gain:16; + unsigned int addr; +} Apolef; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int pad1:16; + unsigned int addr; +} Aenvelope; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:8; + unsigned int dmem:16; + unsigned int pad2:16; + unsigned int count:16; +} Aclearbuff; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:8; + unsigned int pad2:16; + unsigned int inL:16; + unsigned int inR:16; +} Ainterleave; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:24; + unsigned int addr; +} Aloadbuff; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int pad1:16; + unsigned int addr; +} Aenvmixer; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int gain:16; + unsigned int dmemi:16; + unsigned int dmemo:16; +} Amixer; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int dmem2:16; + unsigned int addr; +} Apan; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int pitch:16; + unsigned int addr; +} Aresample; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int pad1:16; + unsigned int addr; +} Areverb; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:24; + unsigned int addr; +} Asavebuff; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:24; + unsigned int pad2:2; + unsigned int number:4; + unsigned int base:24; +} Asegment; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int dmemin:16; + unsigned int dmemout:16; + unsigned int count:16; +} Asetbuff; + +typedef struct { + unsigned int cmd:8; + unsigned int flags:8; + unsigned int vol:16; + unsigned int voltgt:16; + unsigned int volrate:16; +} Asetvol; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:8; + unsigned int dmemin:16; + unsigned int dmemout:16; + unsigned int count:16; +} Admemmove; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:8; + unsigned int count:16; + unsigned int addr; +} Aloadadpcm; + +typedef struct { + unsigned int cmd:8; + unsigned int pad1:8; + unsigned int pad2:16; + unsigned int addr; +} Asetloop; + +/* + * Generic Acmd Packet + */ + +typedef struct { + unsigned int w0; + unsigned int w1; +} Awords; + +typedef union { + Awords words; + Aadpcm adpcm; + Apolef polef; + Aclearbuff clearbuff; + Aenvelope envelope; + Ainterleave interleave; + Aloadbuff loadbuff; + Aenvmixer envmixer; + Aresample resample; + Areverb reverb; + Asavebuff savebuff; + Asegment segment; + Asetbuff setbuff; + Asetvol setvol; + Admemmove dmemmove; + Aloadadpcm loadadpcm; + Amixer mixer; + Asetloop setloop; + long long int force_union_align; /* dummy, force alignment */ +} Acmd; + +/* + * ADPCM State + */ +#define ADPCMVSIZE 8 +#define ADPCMFSIZE 16 +typedef short ADPCM_STATE[ADPCMFSIZE]; + +/* + * Pole filter state + */ +typedef short POLEF_STATE[4]; + +/* + * Resampler state + */ +typedef short RESAMPLE_STATE[16]; + +/* + * Resampler constants + */ +#define UNITY_PITCH 0x8000 +#define MAX_RATIO 1.99996 /* within .03 cents of +1 octave */ + +/* + * Enveloper/Mixer state + */ +typedef short ENVMIX_STATE[40]; + +/* + * Macros to assemble the audio command list + */ + +#define aADPCMdec(pkt, f, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_ADPCM, 24, 8) | _SHIFTL(f, 16, 8); \ + _a->words.w1 = (unsigned int)(s); \ +} + +#define aPoleFilter(pkt, f, g, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_POLEF, 24, 8) | _SHIFTL(f, 16, 8) | \ + _SHIFTL(g, 0, 16)); \ + _a->words.w1 = (unsigned int)(s); \ +} + +#define aClearBuffer(pkt, d, c) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_CLEARBUFF, 24, 8) | _SHIFTL(d, 0, 24); \ + _a->words.w1 = (unsigned int)(c); \ +} + +#define aEnvMixer(pkt, f, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_ENVMIXER, 24, 8) | _SHIFTL(f, 16, 8); \ + _a->words.w1 = (unsigned int)(s); \ +} + +#define aInterleave(pkt, l, r) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_INTERLEAVE, 24, 8); \ + _a->words.w1 = _SHIFTL(l, 16, 16) | _SHIFTL(r, 0, 16); \ +} + +#define aLoadBuffer(pkt, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_LOADBUFF, 24, 8); \ + _a->words.w1 = (unsigned int)(s); \ +} + +#define aMix(pkt, f, g, i, o) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_MIXER, 24, 8) | _SHIFTL(f, 16, 8) | \ + _SHIFTL(g, 0, 16)); \ + _a->words.w1 = _SHIFTL(i,16, 16) | _SHIFTL(o, 0, 16); \ +} + +#define aPan(pkt, f, d, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_PAN, 24, 8) | _SHIFTL(f, 16, 8) | \ + _SHIFTL(d, 0, 16)); \ + _a->words.w1 = (unsigned int)(s); \ +} + +#define aResample(pkt, f, p, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_RESAMPLE, 24, 8) | _SHIFTL(f, 16, 8) |\ + _SHIFTL(p, 0, 16)); \ + _a->words.w1 = (unsigned int)(s); \ +} + +#define aSaveBuffer(pkt, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_SAVEBUFF, 24, 8); \ + _a->words.w1 = (unsigned int)(s); \ +} + +#define aSegment(pkt, s, b) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_SEGMENT, 24, 8); \ + _a->words.w1 = _SHIFTL(s, 24, 8) | _SHIFTL(b, 0, 24); \ +} + +#define aSetBuffer(pkt, f, i, o, c) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_SETBUFF, 24, 8) | _SHIFTL(f, 16, 8) | \ + _SHIFTL(i, 0, 16)); \ + _a->words.w1 = _SHIFTL(o, 16, 16) | _SHIFTL(c, 0, 16); \ +} + +#define aSetVolume(pkt, f, v, t, r) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_SETVOL, 24, 8) | _SHIFTL(f, 16, 16) | \ + _SHIFTL(v, 0, 16)); \ + _a->words.w1 = _SHIFTL(t, 16, 16) | _SHIFTL(r, 0, 16); \ +} + +#define aSetLoop(pkt, a) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + _a->words.w0 = _SHIFTL(A_SETLOOP, 24, 8); \ + _a->words.w1 = (unsigned int)(a); \ +} + +#define aDMEMMove(pkt, i, o, c) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_DMEMMOVE, 24, 8) | _SHIFTL(i, 0, 24); \ + _a->words.w1 = _SHIFTL(o, 16, 16) | _SHIFTL(c, 0, 16); \ +} + +#define aLoadADPCM(pkt, c, d) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_LOADADPCM, 24, 8) | _SHIFTL(c, 0, 24); \ + _a->words.w1 = (unsigned int) d; \ +} + +#endif /* _LANGUAGE_C */ + +#endif /* !_ABI_H_ */ + + + diff --git a/include/2.0L/PR/gbi.h b/include/2.0L/PR/gbi.h new file mode 100644 index 00000000..80ba6023 --- /dev/null +++ b/include/2.0L/PR/gbi.h @@ -0,0 +1,4572 @@ +/************************************************************************** + * * + * Copyright (C) 1994, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ +/************************************************************************** + * + * $Revision: 1.141 $ + * $Date: 1999/09/03 03:43:08 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/gbi.h,v $ + * + **************************************************************************/ + +#ifndef _GBI_H_ +#define _GBI_H_ + +#include + +/* + * To use the F3DEX ucodes, define F3DEX_GBI before include this file. + * + * #define F3DEX_GBI + * #include + * + * or + * + * cc -c -DF3DEX_GBI -I.... foo.c + * + */ + +/************************************************************************** + * + * Graphics Binary Interface + * + **************************************************************************/ + +/* + * Graphics Commands, 'xxx' parts may be generated from ucode + * + * The command format is + * + * |00xxxxxx| = DMA 0,..,127 + * |10xxxxxx| = Immediate Mode -65,..,-128 + * |11xxxxxx| = RDP cmds -1,..,-64 + * + * Note: in order for the RSP microcode to process RDP commands opaquely, + * we need to further identify those RDP commands that need DRAM address + * "fixup". To do this, we have the dummy command G_RDP_ADDR_FIXUP, and + * all |RDP commands| less than this are commands with embedded DRAM + * addresses. Further, the format of these commands should be similar so + * only one fixup routine is needed. + * + * Further explanation: + * The names of the commands are somewhat misleading. Here is clarification: + * + * - a 'DMA' type command has a pointer to additional data and + * causes a DMA transfer to bring that into DMEM. + * + * - an 'Immediate' type command isn't really 'immediate', in the + * traditional sense. This just means that the entire command fits + * in the 64-bit word, and the ucode can execute it 'immediately' + * without additional memory transfers. + * + * - an 'RDP' command is identified as such because the RDP + * commands can be passed-thru the RSP and sent to the RDP + * directly. One further confusing thing, is that some 'DP' + * macros below actually generate immediate commands, not + * not direct DP commands. + * + * IMPLEMENTATION NOTE: + * There is another group of RDP commands that includes the triangle commands + * generated by the RSP code. These are the raw commands the rasterizer + * hardware chews on, with slope info, etc. They will follow the RDP + * ordering... + * + * IMPLEMENTATION NOTE: + * The RDP hardware has some of these bit patterns wired up. If the hardware + * changes, we must adjust this table, likewise we can't change/add things + * once the hardware is frozen. (actually, the RDP hardware only looks at + * the lower 6 bits of the command byte) + * + */ + +#ifdef F3DEX_GBI_2 +# ifndef F3DEX_GBI +# define F3DEX_GBI +# endif +#define G_NOOP 0x00 +#define G_RDPHALF_2 0xf1 +#define G_SETOTHERMODE_H 0xe3 +#define G_SETOTHERMODE_L 0xe2 +#define G_RDPHALF_1 0xe1 +#define G_SPNOOP 0xe0 +#define G_ENDDL 0xdf +#define G_DL 0xde +#define G_LOAD_UCODE 0xdd +#define G_MOVEMEM 0xdc +#define G_MOVEWORD 0xdb +#define G_MTX 0xda +#define G_GEOMETRYMODE 0xd9 +#define G_POPMTX 0xd8 +#define G_TEXTURE 0xd7 +#define G_DMA_IO 0xd6 +#define G_SPECIAL_1 0xd5 +#define G_SPECIAL_2 0xd4 +#define G_SPECIAL_3 0xd3 + +#define G_VTX 0x01 +#define G_MODIFYVTX 0x02 +#define G_CULLDL 0x03 +#define G_BRANCH_Z 0x04 +#define G_TRI1 0x05 +#define G_TRI2 0x06 +#define G_QUAD 0x07 +#define G_LINE3D 0x08 +#else /* F3DEX_GBI_2 */ + +/* DMA commands: */ +#define G_SPNOOP 0 /* handle 0 gracefully */ +#define G_MTX 1 +#define G_RESERVED0 2 /* not implemeted */ +#define G_MOVEMEM 3 /* move a block of memory (up to 4 words) to dmem */ +#define G_VTX 4 +#define G_RESERVED1 5 /* not implemeted */ +#define G_DL 6 +#define G_RESERVED2 7 /* not implemeted */ +#define G_RESERVED3 8 /* not implemeted */ +#define G_SPRITE2D_BASE 9 /* sprite command */ + +/* IMMEDIATE commands: */ +#define G_IMMFIRST -65 +#define G_TRI1 (G_IMMFIRST-0) +#define G_CULLDL (G_IMMFIRST-1) +#define G_POPMTX (G_IMMFIRST-2) +#define G_MOVEWORD (G_IMMFIRST-3) +#define G_TEXTURE (G_IMMFIRST-4) +#define G_SETOTHERMODE_H (G_IMMFIRST-5) +#define G_SETOTHERMODE_L (G_IMMFIRST-6) +#define G_ENDDL (G_IMMFIRST-7) +#define G_SETGEOMETRYMODE (G_IMMFIRST-8) +#define G_CLEARGEOMETRYMODE (G_IMMFIRST-9) +#define G_LINE3D (G_IMMFIRST-10) +#define G_RDPHALF_1 (G_IMMFIRST-11) +#define G_RDPHALF_2 (G_IMMFIRST-12) +#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)) +# define G_MODIFYVTX (G_IMMFIRST-13) +# define G_TRI2 (G_IMMFIRST-14) +# define G_BRANCH_Z (G_IMMFIRST-15) +# define G_LOAD_UCODE (G_IMMFIRST-16) +#else +# define G_RDPHALF_CONT (G_IMMFIRST-13) +#endif + +/* We are overloading 2 of the immediate commands + to keep the byte alignment of dmem the same */ + +#define G_SPRITE2D_SCALEFLIP (G_IMMFIRST-1) +#define G_SPRITE2D_DRAW (G_IMMFIRST-2) + +/* RDP commands: */ +#define G_NOOP 0xc0 /* 0 */ + +#endif /* F3DEX_GBI_2 */ + +/* RDP commands: */ +#define G_SETCIMG 0xff /* -1 */ +#define G_SETZIMG 0xfe /* -2 */ +#define G_SETTIMG 0xfd /* -3 */ +#define G_SETCOMBINE 0xfc /* -4 */ +#define G_SETENVCOLOR 0xfb /* -5 */ +#define G_SETPRIMCOLOR 0xfa /* -6 */ +#define G_SETBLENDCOLOR 0xf9 /* -7 */ +#define G_SETFOGCOLOR 0xf8 /* -8 */ +#define G_SETFILLCOLOR 0xf7 /* -9 */ +#define G_FILLRECT 0xf6 /* -10 */ +#define G_SETTILE 0xf5 /* -11 */ +#define G_LOADTILE 0xf4 /* -12 */ +#define G_LOADBLOCK 0xf3 /* -13 */ +#define G_SETTILESIZE 0xf2 /* -14 */ +#define G_LOADTLUT 0xf0 /* -16 */ +#define G_RDPSETOTHERMODE 0xef /* -17 */ +#define G_SETPRIMDEPTH 0xee /* -18 */ +#define G_SETSCISSOR 0xed /* -19 */ +#define G_SETCONVERT 0xec /* -20 */ +#define G_SETKEYR 0xeb /* -21 */ +#define G_SETKEYGB 0xea /* -22 */ +#define G_RDPFULLSYNC 0xe9 /* -23 */ +#define G_RDPTILESYNC 0xe8 /* -24 */ +#define G_RDPPIPESYNC 0xe7 /* -25 */ +#define G_RDPLOADSYNC 0xe6 /* -26 */ +#define G_TEXRECTFLIP 0xe5 /* -27 */ +#define G_TEXRECT 0xe4 /* -28 */ + + +/* + * The following commands are the "generated" RDP commands; the user + * never sees them, the RSP microcode generates them. + * + * The layout of the bits is magical, to save work in the ucode. + * These id's are -56, -52, -54, -50, -55, -51, -53, -49, ... + * edge, shade, texture, zbuff bits: estz + */ +#define G_TRI_FILL 0xc8 /* fill triangle: 11001000 */ +#define G_TRI_SHADE 0xcc /* shade triangle: 11001100 */ +#define G_TRI_TXTR 0xca /* texture triangle: 11001010 */ +#define G_TRI_SHADE_TXTR 0xce /* shade, texture triangle: 11001110 */ +#define G_TRI_FILL_ZBUFF 0xc9 /* fill, zbuff triangle: 11001001 */ +#define G_TRI_SHADE_ZBUFF 0xcd /* shade, zbuff triangle: 11001101 */ +#define G_TRI_TXTR_ZBUFF 0xcb /* texture, zbuff triangle: 11001011 */ +#define G_TRI_SHADE_TXTR_ZBUFF 0xcf /* shade, txtr, zbuff trngl: 11001111 */ + +/* + * A TRI_FILL triangle is just the edges. You need to set the DP + * to use primcolor, in order to see anything. (it is NOT a triangle + * that gets rendered in 'fill mode'. Triangles can't be rendered + * in 'fill mode') + * + * A TRI_SHADE is a gouraud triangle that has colors interpolated. + * Flat-shaded triangles (from the software) are still gouraud shaded, + * it's just the colors are all the same and the deltas are 0. + * + * Other triangle types, and combinations are more obvious. + */ + +/* masks to build RDP triangle commands: */ +#define G_RDP_TRI_FILL_MASK 0x08 +#define G_RDP_TRI_SHADE_MASK 0x04 +#define G_RDP_TRI_TXTR_MASK 0x02 +#define G_RDP_TRI_ZBUFF_MASK 0x01 + +/* + * HACK: + * This is a dreadful hack. For version 1.0 hardware, there are still + * some 'bowtie' hangs. This parameter can be increased to avoid + * the hangs. Every increase of 4 chops one scanline off of every + * triangle. Values of 4,8,12 should be sufficient to avoid any + * bowtie hang. + * + * Change this value, then recompile ALL of your program (including static + * display lists!) + * + * THIS WILL BE REMOVED FOR HARDWARE VERSION 2.0! + */ +#define BOWTIE_VAL 0 + + +/* gets added to RDP command, in order to test for addres fixup: */ +#define G_RDP_ADDR_FIXUP 3 /* |RDP cmds| <= this, do addr fixup */ +#ifdef _LANGUAGE_ASSEMBLY +#define G_RDP_TEXRECT_CHECK ((-1*G_TEXRECTFLIP)& 0xff) +#endif + +/* macros for command parsing: */ +#define GDMACMD(x) (x) +#define GIMMCMD(x) (G_IMMFIRST-(x)) +#define GRDPCMD(x) (0xff-(x)) + +#define G_DMACMDSIZ 128 +#define G_IMMCMDSIZ 64 +#define G_RDPCMDSIZ 64 + +/* + * Coordinate shift values, number of bits of fraction + */ +#define G_TEXTURE_IMAGE_FRAC 2 +#define G_TEXTURE_SCALE_FRAC 16 +#define G_SCALE_FRAC 8 +#define G_ROTATE_FRAC 16 + +/* + * Parameters to graphics commands + */ + +/* + * Data packing macros + */ + +/* + * Maximum z-buffer value, used to initialize the z-buffer. + * Note : this number is NOT the viewport z-scale constant. + * See the comment next to G_MAXZ for more info. + */ +#define G_MAXFBZ 0x3fff /* 3b exp, 11b mantissa */ + +#define GPACK_RGBA5551(r, g, b, a) ((((r)<<8) & 0xf800) | \ + (((g)<<3) & 0x7c0) | \ + (((b)>>2) & 0x3e) | ((a) & 0x1)) +#define GPACK_ZDZ(z, dz) ((z) << 2 | (dz)) + +/* + * G_MTX: parameter flags + */ +#ifdef F3DEX_GBI_2 +# define G_MTX_MODELVIEW 0x00 /* matrix types */ +# define G_MTX_PROJECTION 0x04 +# define G_MTX_MUL 0x00 /* concat or load */ +# define G_MTX_LOAD 0x02 +# define G_MTX_NOPUSH 0x00 /* push or not */ +# define G_MTX_PUSH 0x01 +#else /* F3DEX_GBI_2 */ +# define G_MTX_MODELVIEW 0x00 /* matrix types */ +# define G_MTX_PROJECTION 0x01 +# define G_MTX_MUL 0x00 /* concat or load */ +# define G_MTX_LOAD 0x02 +# define G_MTX_NOPUSH 0x00 /* push or not */ +# define G_MTX_PUSH 0x04 +#endif /* F3DEX_GBI_2 */ + +/* + * flags for G_SETGEOMETRYMODE + * (this rendering state is maintained in RSP) + * + * DO NOT USE THE LOW 8 BITS OF GEOMETRYMODE: + * The weird bit-ordering is for the micro-code: the lower byte + * can be OR'd in with G_TRI_SHADE (11001100) to construct + * the triangle command directly. Don't break it... + * + * DO NOT USE THE HIGH 8 BITS OF GEOMETRYMODE: + * The high byte is OR'd with 0x703 to form the clip code mask. + * If it is set to 0x04, this will cause near clipping to occur. + * If it is zero, near clipping will not occur. + * + * Further explanation: + * G_SHADE is necessary in order to see the color that you passed + * down with the vertex. If G_SHADE isn't set, you need to set the DP + * appropriately and use primcolor to see anything. + * + * G_SHADING_SMOOTH enabled means use all 3 colors of the triangle. + * If it is not set, then do 'flat shading', where only one vertex color + * is used (and all 3 vertices are set to that same color by the ucode) + * See the man page for gSP1Triangle(). + * + */ +#define G_ZBUFFER 0x00000001 +#define G_SHADE 0x00000004 /* enable Gouraud interp */ +/* rest of low byte reserved for setup ucode */ +#ifdef F3DEX_GBI_2 +# define G_TEXTURE_ENABLE 0x00000000 /* Ignored */ +# define G_SHADING_SMOOTH 0x00200000 /* flat or smooth shaded */ +# define G_CULL_FRONT 0x00000200 +# define G_CULL_BACK 0x00000400 +# define G_CULL_BOTH 0x00000600 /* To make code cleaner */ +#else +# define G_TEXTURE_ENABLE 0x00000002 /* Microcode use only */ +# define G_SHADING_SMOOTH 0x00000200 /* flat or smooth shaded */ +# define G_CULL_FRONT 0x00001000 +# define G_CULL_BACK 0x00002000 +# define G_CULL_BOTH 0x00003000 /* To make code cleaner */ +#endif +#define G_FOG 0x00010000 +#define G_LIGHTING 0x00020000 +#define G_TEXTURE_GEN 0x00040000 +#define G_TEXTURE_GEN_LINEAR 0x00080000 +#define G_LOD 0x00100000 /* NOT IMPLEMENTED */ +#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)) +# define G_CLIPPING 0x00800000 +#else +# define G_CLIPPING 0x00000000 +#endif + +#ifdef _LANGUAGE_ASSEMBLY +#define G_FOG_H (G_FOG/0x10000) +#define G_LIGHTING_H (G_LIGHTING/0x10000) +#define G_TEXTURE_GEN_H (G_TEXTURE_GEN/0x10000) +#define G_TEXTURE_GEN_LINEAR_H (G_TEXTURE_GEN_LINEAR/0x10000) +#define G_LOD_H (G_LOD/0x10000) /* NOT IMPLEMENTED */ +#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)) +# define G_CLIPPING_H (G_CLIPPING/0x10000) +#endif +#endif + +/* Need these defined for Sprite Microcode */ +#ifdef _LANGUAGE_ASSEMBLY +#define G_TX_LOADTILE 7 +#define G_TX_RENDERTILE 0 + +#define G_TX_NOMIRROR 0 +#define G_TX_WRAP 0 +#define G_TX_MIRROR 0x1 +#define G_TX_CLAMP 0x2 +#define G_TX_NOMASK 0 +#define G_TX_NOLOD 0 +#endif + +/* + * G_SETIMG fmt: set image formats + */ +#define G_IM_FMT_RGBA 0 +#define G_IM_FMT_YUV 1 +#define G_IM_FMT_CI 2 +#define G_IM_FMT_IA 3 +#define G_IM_FMT_I 4 + +/* + * G_SETIMG siz: set image pixel size + */ +#define G_IM_SIZ_4b 0 +#define G_IM_SIZ_8b 1 +#define G_IM_SIZ_16b 2 +#define G_IM_SIZ_32b 3 +#define G_IM_SIZ_DD 5 + +#define G_IM_SIZ_4b_BYTES 0 +#define G_IM_SIZ_4b_TILE_BYTES G_IM_SIZ_4b_BYTES +#define G_IM_SIZ_4b_LINE_BYTES G_IM_SIZ_4b_BYTES + +#define G_IM_SIZ_8b_BYTES 1 +#define G_IM_SIZ_8b_TILE_BYTES G_IM_SIZ_8b_BYTES +#define G_IM_SIZ_8b_LINE_BYTES G_IM_SIZ_8b_BYTES + +#define G_IM_SIZ_16b_BYTES 2 +#define G_IM_SIZ_16b_TILE_BYTES G_IM_SIZ_16b_BYTES +#define G_IM_SIZ_16b_LINE_BYTES G_IM_SIZ_16b_BYTES + +#define G_IM_SIZ_32b_BYTES 4 +#define G_IM_SIZ_32b_TILE_BYTES 2 +#define G_IM_SIZ_32b_LINE_BYTES 2 + +#define G_IM_SIZ_4b_LOAD_BLOCK G_IM_SIZ_16b +#define G_IM_SIZ_8b_LOAD_BLOCK G_IM_SIZ_16b +#define G_IM_SIZ_16b_LOAD_BLOCK G_IM_SIZ_16b +#define G_IM_SIZ_32b_LOAD_BLOCK G_IM_SIZ_32b + +#define G_IM_SIZ_4b_SHIFT 2 +#define G_IM_SIZ_8b_SHIFT 1 +#define G_IM_SIZ_16b_SHIFT 0 +#define G_IM_SIZ_32b_SHIFT 0 + +#define G_IM_SIZ_4b_INCR 3 +#define G_IM_SIZ_8b_INCR 1 +#define G_IM_SIZ_16b_INCR 0 +#define G_IM_SIZ_32b_INCR 0 + +/* + * G_SETCOMBINE: color combine modes + */ +/* Color combiner constants: */ +#define G_CCMUX_COMBINED 0 +#define G_CCMUX_TEXEL0 1 +#define G_CCMUX_TEXEL1 2 +#define G_CCMUX_PRIMITIVE 3 +#define G_CCMUX_SHADE 4 +#define G_CCMUX_ENVIRONMENT 5 +#define G_CCMUX_CENTER 6 +#define G_CCMUX_SCALE 6 +#define G_CCMUX_COMBINED_ALPHA 7 +#define G_CCMUX_TEXEL0_ALPHA 8 +#define G_CCMUX_TEXEL1_ALPHA 9 +#define G_CCMUX_PRIMITIVE_ALPHA 10 +#define G_CCMUX_SHADE_ALPHA 11 +#define G_CCMUX_ENV_ALPHA 12 +#define G_CCMUX_LOD_FRACTION 13 +#define G_CCMUX_PRIM_LOD_FRAC 14 +#define G_CCMUX_NOISE 7 +#define G_CCMUX_K4 7 +#define G_CCMUX_K5 15 +#define G_CCMUX_1 6 +#define G_CCMUX_0 31 + +/* Alpha combiner constants: */ +#define G_ACMUX_COMBINED 0 +#define G_ACMUX_TEXEL0 1 +#define G_ACMUX_TEXEL1 2 +#define G_ACMUX_PRIMITIVE 3 +#define G_ACMUX_SHADE 4 +#define G_ACMUX_ENVIRONMENT 5 +#define G_ACMUX_LOD_FRACTION 0 +#define G_ACMUX_PRIM_LOD_FRAC 6 +#define G_ACMUX_1 6 +#define G_ACMUX_0 7 + +/* typical CC cycle 1 modes */ +#define G_CC_PRIMITIVE 0, 0, 0, PRIMITIVE, 0, 0, 0, PRIMITIVE +#define G_CC_SHADE 0, 0, 0, SHADE, 0, 0, 0, SHADE +#define G_CC_MODULATEI TEXEL0, 0, SHADE, 0, 0, 0, 0, SHADE +#define G_CC_MODULATEIA TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0 +#define G_CC_MODULATEIDECALA TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0 +#define G_CC_MODULATERGB G_CC_MODULATEI +#define G_CC_MODULATERGBA G_CC_MODULATEIA +#define G_CC_MODULATERGBDECALA G_CC_MODULATEIDECALA +#define G_CC_MODULATEI_PRIM TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE +#define G_CC_MODULATEIA_PRIM TEXEL0, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0 +#define G_CC_MODULATEIDECALA_PRIM TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0 +#define G_CC_MODULATERGB_PRIM G_CC_MODULATEI_PRIM +#define G_CC_MODULATERGBA_PRIM G_CC_MODULATEIA_PRIM +#define G_CC_MODULATERGBDECALA_PRIM G_CC_MODULATEIDECALA_PRIM +#define G_CC_DECALRGB 0, 0, 0, TEXEL0, 0, 0, 0, SHADE +#define G_CC_DECALRGBA 0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0 +#define G_CC_BLENDI ENVIRONMENT, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE +#define G_CC_BLENDIA ENVIRONMENT, SHADE, TEXEL0, SHADE, TEXEL0, 0, SHADE, 0 +#define G_CC_BLENDIDECALA ENVIRONMENT, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0 +#define G_CC_BLENDRGBA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, SHADE +#define G_CC_BLENDRGBDECALA TEXEL0, SHADE, TEXEL0_ALPHA, SHADE, 0, 0, 0, TEXEL0 +#define G_CC_ADDRGB 1, 0, TEXEL0, SHADE, 0, 0, 0, SHADE +#define G_CC_ADDRGBDECALA 1, 0, TEXEL0, SHADE, 0, 0, 0, TEXEL0 +#define G_CC_REFLECTRGB ENVIRONMENT, 0, TEXEL0, SHADE, 0, 0, 0, SHADE +#define G_CC_REFLECTRGBDECALA ENVIRONMENT, 0, TEXEL0, SHADE, 0, 0, 0, TEXEL0 +#define G_CC_HILITERGB PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE +#define G_CC_HILITERGBA PRIMITIVE, SHADE, TEXEL0, SHADE, PRIMITIVE, SHADE, TEXEL0, SHADE +#define G_CC_HILITERGBDECALA PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, TEXEL0 +#define G_CC_SHADEDECALA 0, 0, 0, SHADE, 0, 0, 0, TEXEL0 +#define G_CC_BLENDPE PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, SHADE, 0 +#define G_CC_BLENDPEDECALA PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, TEXEL0 + +/* oddball modes */ +#define _G_CC_BLENDPE ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, TEXEL0, 0, SHADE, 0 +#define _G_CC_BLENDPEDECALA ENVIRONMENT, PRIMITIVE, TEXEL0, PRIMITIVE, 0, 0, 0, TEXEL0 +#define _G_CC_TWOCOLORTEX PRIMITIVE, SHADE, TEXEL0, SHADE, 0, 0, 0, SHADE +/* used for 1-cycle sparse mip-maps, primitive color has color of lowest LOD */ +#define _G_CC_SPARSEST PRIMITIVE, TEXEL0, LOD_FRACTION, TEXEL0, PRIMITIVE, TEXEL0, LOD_FRACTION, TEXEL0 +#define G_CC_TEMPLERP TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0, TEXEL1, TEXEL0, PRIM_LOD_FRAC, TEXEL0 + +/* typical CC cycle 1 modes, usually followed by other cycle 2 modes */ +#define G_CC_TRILERP TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0, TEXEL1, TEXEL0, LOD_FRACTION, TEXEL0 +#define G_CC_INTERFERENCE TEXEL0, 0, TEXEL1, 0, TEXEL0, 0, TEXEL1, 0 + +/* + * One-cycle color convert operation + */ +#define G_CC_1CYUV2RGB TEXEL0, K4, K5, TEXEL0, 0, 0, 0, SHADE + +/* + * NOTE: YUV2RGB expects TF step1 color conversion to occur in 2nd clock. + * Therefore, CC looks for step1 results in TEXEL1 + */ +#define G_CC_YUV2RGB TEXEL1, K4, K5, TEXEL1, 0, 0, 0, 0 + +/* typical CC cycle 2 modes */ +#define G_CC_PASS2 0, 0, 0, COMBINED, 0, 0, 0, COMBINED +#define G_CC_MODULATEI2 COMBINED, 0, SHADE, 0, 0, 0, 0, SHADE +#define G_CC_MODULATEIA2 COMBINED, 0, SHADE, 0, COMBINED, 0, SHADE, 0 +#define G_CC_MODULATERGB2 G_CC_MODULATEI2 +#define G_CC_MODULATERGBA2 G_CC_MODULATEIA2 +#define G_CC_MODULATEI_PRIM2 COMBINED, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE +#define G_CC_MODULATEIA_PRIM2 COMBINED, 0, PRIMITIVE, 0, COMBINED, 0, PRIMITIVE, 0 +#define G_CC_MODULATERGB_PRIM2 G_CC_MODULATEI_PRIM2 +#define G_CC_MODULATERGBA_PRIM2 G_CC_MODULATEIA_PRIM2 +#define G_CC_DECALRGB2 0, 0, 0, COMBINED, 0, 0, 0, SHADE +/* + * ? +#define G_CC_DECALRGBA2 COMBINED, SHADE, COMBINED_ALPHA, SHADE, 0, 0, 0, SHADE +*/ +#define G_CC_BLENDI2 ENVIRONMENT, SHADE, COMBINED, SHADE, 0, 0, 0, SHADE +#define G_CC_BLENDIA2 ENVIRONMENT, SHADE, COMBINED, SHADE, COMBINED, 0, SHADE, 0 +#define G_CC_CHROMA_KEY2 TEXEL0, CENTER, SCALE, 0, 0, 0, 0, 0 +#define G_CC_HILITERGB2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, SHADE +#define G_CC_HILITERGBA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, ENVIRONMENT, COMBINED, TEXEL0, COMBINED +#define G_CC_HILITERGBDECALA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, TEXEL0 +#define G_CC_HILITERGBPASSA2 ENVIRONMENT, COMBINED, TEXEL0, COMBINED, 0, 0, 0, COMBINED + +/* + * G_SETOTHERMODE_L sft: shift count + */ +#define G_MDSFT_ALPHACOMPARE 0 +#define G_MDSFT_ZSRCSEL 2 +#define G_MDSFT_RENDERMODE 3 +#define G_MDSFT_BLENDER 16 + +/* + * G_SETOTHERMODE_H sft: shift count + */ +#define G_MDSFT_BLENDMASK 0 /* unsupported */ +#define G_MDSFT_ALPHADITHER 4 +#define G_MDSFT_RGBDITHER 6 + +#define G_MDSFT_COMBKEY 8 +#define G_MDSFT_TEXTCONV 9 +#define G_MDSFT_TEXTFILT 12 +#define G_MDSFT_TEXTLUT 14 +#define G_MDSFT_TEXTLOD 16 +#define G_MDSFT_TEXTDETAIL 17 +#define G_MDSFT_TEXTPERSP 19 +#define G_MDSFT_CYCLETYPE 20 +#define G_MDSFT_COLORDITHER 22 /* unsupported in HW 2.0 */ +#define G_MDSFT_PIPELINE 23 + +/* G_SETOTHERMODE_H gPipelineMode */ +#define G_PM_1PRIMITIVE (1 << G_MDSFT_PIPELINE) +#define G_PM_NPRIMITIVE (0 << G_MDSFT_PIPELINE) + +/* G_SETOTHERMODE_H gSetCycleType */ +#define G_CYC_1CYCLE (0 << G_MDSFT_CYCLETYPE) +#define G_CYC_2CYCLE (1 << G_MDSFT_CYCLETYPE) +#define G_CYC_COPY (2 << G_MDSFT_CYCLETYPE) +#define G_CYC_FILL (3 << G_MDSFT_CYCLETYPE) + +/* G_SETOTHERMODE_H gSetTexturePersp */ +#define G_TP_NONE (0 << G_MDSFT_TEXTPERSP) +#define G_TP_PERSP (1 << G_MDSFT_TEXTPERSP) + +/* G_SETOTHERMODE_H gSetTextureDetail */ +#define G_TD_CLAMP (0 << G_MDSFT_TEXTDETAIL) +#define G_TD_SHARPEN (1 << G_MDSFT_TEXTDETAIL) +#define G_TD_DETAIL (2 << G_MDSFT_TEXTDETAIL) + +/* G_SETOTHERMODE_H gSetTextureLOD */ +#define G_TL_TILE (0 << G_MDSFT_TEXTLOD) +#define G_TL_LOD (1 << G_MDSFT_TEXTLOD) + +/* G_SETOTHERMODE_H gSetTextureLUT */ +#define G_TT_NONE (0 << G_MDSFT_TEXTLUT) +#define G_TT_RGBA16 (2 << G_MDSFT_TEXTLUT) +#define G_TT_IA16 (3 << G_MDSFT_TEXTLUT) + +/* G_SETOTHERMODE_H gSetTextureFilter */ +#define G_TF_POINT (0 << G_MDSFT_TEXTFILT) +#define G_TF_AVERAGE (3 << G_MDSFT_TEXTFILT) +#define G_TF_BILERP (2 << G_MDSFT_TEXTFILT) + +/* G_SETOTHERMODE_H gSetTextureConvert */ +#define G_TC_CONV (0 << G_MDSFT_TEXTCONV) +#define G_TC_FILTCONV (5 << G_MDSFT_TEXTCONV) +#define G_TC_FILT (6 << G_MDSFT_TEXTCONV) + +/* G_SETOTHERMODE_H gSetCombineKey */ +#define G_CK_NONE (0 << G_MDSFT_COMBKEY) +#define G_CK_KEY (1 << G_MDSFT_COMBKEY) + +/* G_SETOTHERMODE_H gSetColorDither */ +#define G_CD_MAGICSQ (0 << G_MDSFT_RGBDITHER) +#define G_CD_BAYER (1 << G_MDSFT_RGBDITHER) +#define G_CD_NOISE (2 << G_MDSFT_RGBDITHER) + +#ifndef _HW_VERSION_1 +#define G_CD_DISABLE (3 << G_MDSFT_RGBDITHER) +#define G_CD_ENABLE G_CD_NOISE /* HW 1.0 compatibility mode */ +#else +#define G_CD_ENABLE (1 << G_MDSFT_COLORDITHER) +#define G_CD_DISABLE (0 << G_MDSFT_COLORDITHER) +#endif + +/* G_SETOTHERMODE_H gSetAlphaDither */ +#define G_AD_PATTERN (0 << G_MDSFT_ALPHADITHER) +#define G_AD_NOTPATTERN (1 << G_MDSFT_ALPHADITHER) +#define G_AD_NOISE (2 << G_MDSFT_ALPHADITHER) +#define G_AD_DISABLE (3 << G_MDSFT_ALPHADITHER) + +/* G_SETOTHERMODE_L gSetAlphaCompare */ +#define G_AC_NONE (0 << G_MDSFT_ALPHACOMPARE) +#define G_AC_THRESHOLD (1 << G_MDSFT_ALPHACOMPARE) +#define G_AC_DITHER (3 << G_MDSFT_ALPHACOMPARE) + +/* G_SETOTHERMODE_L gSetDepthSource */ +#define G_ZS_PIXEL (0 << G_MDSFT_ZSRCSEL) +#define G_ZS_PRIM (1 << G_MDSFT_ZSRCSEL) + +/* G_SETOTHERMODE_L gSetRenderMode */ +#define AA_EN 0x8 +#define Z_CMP 0x10 +#define Z_UPD 0x20 +#define IM_RD 0x40 +#define CLR_ON_CVG 0x80 +#define CVG_DST_CLAMP 0 +#define CVG_DST_WRAP 0x100 +#define CVG_DST_FULL 0x200 +#define CVG_DST_SAVE 0x300 +#define ZMODE_OPA 0 +#define ZMODE_INTER 0x400 +#define ZMODE_XLU 0x800 +#define ZMODE_DEC 0xc00 +#define CVG_X_ALPHA 0x1000 +#define ALPHA_CVG_SEL 0x2000 +#define FORCE_BL 0x4000 +#define TEX_EDGE 0x0000 /* used to be 0x8000 */ + +#define G_BL_CLR_IN 0 +#define G_BL_CLR_MEM 1 +#define G_BL_CLR_BL 2 +#define G_BL_CLR_FOG 3 +#define G_BL_1MA 0 +#define G_BL_A_MEM 1 +#define G_BL_A_IN 0 +#define G_BL_A_FOG 1 +#define G_BL_A_SHADE 2 +#define G_BL_1 2 +#define G_BL_0 3 + +#define GBL_c1(m1a, m1b, m2a, m2b) \ + (m1a) << 30 | (m1b) << 26 | (m2a) << 22 | (m2b) << 18 +#define GBL_c2(m1a, m1b, m2a, m2b) \ + (m1a) << 28 | (m1b) << 24 | (m2a) << 20 | (m2b) << 16 + +#define RM_AA_ZB_OPA_SURF(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_RA_ZB_OPA_SURF(clk) \ + AA_EN | Z_CMP | Z_UPD | CVG_DST_CLAMP | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_ZB_XLU_SURF(clk) \ + AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | \ + FORCE_BL | ZMODE_XLU | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_OPA_DECAL(clk) \ + AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | ALPHA_CVG_SEL | \ + ZMODE_DEC | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_RA_ZB_OPA_DECAL(clk) \ + AA_EN | Z_CMP | CVG_DST_WRAP | ALPHA_CVG_SEL | \ + ZMODE_DEC | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_ZB_XLU_DECAL(clk) \ + AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | \ + FORCE_BL | ZMODE_DEC | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_OPA_INTER(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ + ALPHA_CVG_SEL | ZMODE_INTER | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_RA_ZB_OPA_INTER(clk) \ + AA_EN | Z_CMP | Z_UPD | CVG_DST_CLAMP | \ + ALPHA_CVG_SEL | ZMODE_INTER | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_ZB_XLU_INTER(clk) \ + AA_EN | Z_CMP | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | \ + FORCE_BL | ZMODE_INTER | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_XLU_LINE(clk) \ + AA_EN | Z_CMP | IM_RD | CVG_DST_CLAMP | CVG_X_ALPHA | \ + ALPHA_CVG_SEL | FORCE_BL | ZMODE_XLU | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_DEC_LINE(clk) \ + AA_EN | Z_CMP | IM_RD | CVG_DST_SAVE | CVG_X_ALPHA | \ + ALPHA_CVG_SEL | FORCE_BL | ZMODE_DEC | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_TEX_EDGE(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ + CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_ZB_TEX_INTER(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ + CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_INTER | TEX_EDGE | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_ZB_SUB_SURF(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_ZB_PCL_SURF(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ + ZMODE_OPA | G_AC_DITHER | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_OPA_TERR(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_TEX_TERR(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_CLAMP | \ + CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_ZB_SUB_TERR(clk) \ + AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + + +#define RM_AA_OPA_SURF(clk) \ + AA_EN | IM_RD | CVG_DST_CLAMP | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_RA_OPA_SURF(clk) \ + AA_EN | CVG_DST_CLAMP | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_XLU_SURF(clk) \ + AA_EN | IM_RD | CVG_DST_WRAP | CLR_ON_CVG | FORCE_BL | \ + ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_XLU_LINE(clk) \ + AA_EN | IM_RD | CVG_DST_CLAMP | CVG_X_ALPHA | \ + ALPHA_CVG_SEL | FORCE_BL | ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_DEC_LINE(clk) \ + AA_EN | IM_RD | CVG_DST_FULL | CVG_X_ALPHA | \ + ALPHA_CVG_SEL | FORCE_BL | ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_TEX_EDGE(clk) \ + AA_EN | IM_RD | CVG_DST_CLAMP | \ + CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_SUB_SURF(clk) \ + AA_EN | IM_RD | CVG_DST_FULL | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_AA_PCL_SURF(clk) \ + AA_EN | IM_RD | CVG_DST_CLAMP | \ + ZMODE_OPA | G_AC_DITHER | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_OPA_TERR(clk) \ + AA_EN | IM_RD | CVG_DST_CLAMP | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_TEX_TERR(clk) \ + AA_EN | IM_RD | CVG_DST_CLAMP | \ + CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_AA_SUB_TERR(clk) \ + AA_EN | IM_RD | CVG_DST_FULL | \ + ZMODE_OPA | ALPHA_CVG_SEL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + + +#define RM_ZB_OPA_SURF(clk) \ + Z_CMP | Z_UPD | CVG_DST_FULL | ALPHA_CVG_SEL | \ + ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_ZB_XLU_SURF(clk) \ + Z_CMP | IM_RD | CVG_DST_FULL | FORCE_BL | ZMODE_XLU | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_ZB_OPA_DECAL(clk) \ + Z_CMP | CVG_DST_FULL | ALPHA_CVG_SEL | ZMODE_DEC | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM) + +#define RM_ZB_XLU_DECAL(clk) \ + Z_CMP | IM_RD | CVG_DST_FULL | FORCE_BL | ZMODE_DEC | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_ZB_CLD_SURF(clk) \ + Z_CMP | IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_XLU | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_ZB_OVL_SURF(clk) \ + Z_CMP | IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_DEC | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_ZB_PCL_SURF(clk) \ + Z_CMP | Z_UPD | CVG_DST_FULL | ZMODE_OPA | \ + G_AC_DITHER | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) + + +#define RM_OPA_SURF(clk) \ + CVG_DST_CLAMP | FORCE_BL | ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) + +#define RM_XLU_SURF(clk) \ + IM_RD | CVG_DST_FULL | FORCE_BL | ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_TEX_EDGE(clk) \ + CVG_DST_CLAMP | CVG_X_ALPHA | ALPHA_CVG_SEL | FORCE_BL |\ + ZMODE_OPA | TEX_EDGE | AA_EN | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) + +#define RM_CLD_SURF(clk) \ + IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define RM_PCL_SURF(clk) \ + CVG_DST_FULL | FORCE_BL | ZMODE_OPA | \ + G_AC_DITHER | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) + +#define RM_ADD(clk) \ + IM_RD | CVG_DST_SAVE | FORCE_BL | ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_1) + +#define RM_NOOP(clk) \ + GBL_c##clk(0, 0, 0, 0) + +#define RM_VISCVG(clk) \ + IM_RD | FORCE_BL | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_BL, G_BL_A_MEM) + +/* for rendering to an 8-bit framebuffer */ +#define RM_OPA_CI(clk) \ + CVG_DST_CLAMP | ZMODE_OPA | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) + + + +#define G_RM_AA_ZB_OPA_SURF RM_AA_ZB_OPA_SURF(1) +#define G_RM_AA_ZB_OPA_SURF2 RM_AA_ZB_OPA_SURF(2) +#define G_RM_AA_ZB_XLU_SURF RM_AA_ZB_XLU_SURF(1) +#define G_RM_AA_ZB_XLU_SURF2 RM_AA_ZB_XLU_SURF(2) +#define G_RM_AA_ZB_OPA_DECAL RM_AA_ZB_OPA_DECAL(1) +#define G_RM_AA_ZB_OPA_DECAL2 RM_AA_ZB_OPA_DECAL(2) +#define G_RM_AA_ZB_XLU_DECAL RM_AA_ZB_XLU_DECAL(1) +#define G_RM_AA_ZB_XLU_DECAL2 RM_AA_ZB_XLU_DECAL(2) +#define G_RM_AA_ZB_OPA_INTER RM_AA_ZB_OPA_INTER(1) +#define G_RM_AA_ZB_OPA_INTER2 RM_AA_ZB_OPA_INTER(2) +#define G_RM_AA_ZB_XLU_INTER RM_AA_ZB_XLU_INTER(1) +#define G_RM_AA_ZB_XLU_INTER2 RM_AA_ZB_XLU_INTER(2) +#define G_RM_AA_ZB_XLU_LINE RM_AA_ZB_XLU_LINE(1) +#define G_RM_AA_ZB_XLU_LINE2 RM_AA_ZB_XLU_LINE(2) +#define G_RM_AA_ZB_DEC_LINE RM_AA_ZB_DEC_LINE(1) +#define G_RM_AA_ZB_DEC_LINE2 RM_AA_ZB_DEC_LINE(2) +#define G_RM_AA_ZB_TEX_EDGE RM_AA_ZB_TEX_EDGE(1) +#define G_RM_AA_ZB_TEX_EDGE2 RM_AA_ZB_TEX_EDGE(2) +#define G_RM_AA_ZB_TEX_INTER RM_AA_ZB_TEX_INTER(1) +#define G_RM_AA_ZB_TEX_INTER2 RM_AA_ZB_TEX_INTER(2) +#define G_RM_AA_ZB_SUB_SURF RM_AA_ZB_SUB_SURF(1) +#define G_RM_AA_ZB_SUB_SURF2 RM_AA_ZB_SUB_SURF(2) +#define G_RM_AA_ZB_PCL_SURF RM_AA_ZB_PCL_SURF(1) +#define G_RM_AA_ZB_PCL_SURF2 RM_AA_ZB_PCL_SURF(2) +#define G_RM_AA_ZB_OPA_TERR RM_AA_ZB_OPA_TERR(1) +#define G_RM_AA_ZB_OPA_TERR2 RM_AA_ZB_OPA_TERR(2) +#define G_RM_AA_ZB_TEX_TERR RM_AA_ZB_TEX_TERR(1) +#define G_RM_AA_ZB_TEX_TERR2 RM_AA_ZB_TEX_TERR(2) +#define G_RM_AA_ZB_SUB_TERR RM_AA_ZB_SUB_TERR(1) +#define G_RM_AA_ZB_SUB_TERR2 RM_AA_ZB_SUB_TERR(2) + +#define G_RM_RA_ZB_OPA_SURF RM_RA_ZB_OPA_SURF(1) +#define G_RM_RA_ZB_OPA_SURF2 RM_RA_ZB_OPA_SURF(2) +#define G_RM_RA_ZB_OPA_DECAL RM_RA_ZB_OPA_DECAL(1) +#define G_RM_RA_ZB_OPA_DECAL2 RM_RA_ZB_OPA_DECAL(2) +#define G_RM_RA_ZB_OPA_INTER RM_RA_ZB_OPA_INTER(1) +#define G_RM_RA_ZB_OPA_INTER2 RM_RA_ZB_OPA_INTER(2) + +#define G_RM_AA_OPA_SURF RM_AA_OPA_SURF(1) +#define G_RM_AA_OPA_SURF2 RM_AA_OPA_SURF(2) +#define G_RM_AA_XLU_SURF RM_AA_XLU_SURF(1) +#define G_RM_AA_XLU_SURF2 RM_AA_XLU_SURF(2) +#define G_RM_AA_XLU_LINE RM_AA_XLU_LINE(1) +#define G_RM_AA_XLU_LINE2 RM_AA_XLU_LINE(2) +#define G_RM_AA_DEC_LINE RM_AA_DEC_LINE(1) +#define G_RM_AA_DEC_LINE2 RM_AA_DEC_LINE(2) +#define G_RM_AA_TEX_EDGE RM_AA_TEX_EDGE(1) +#define G_RM_AA_TEX_EDGE2 RM_AA_TEX_EDGE(2) +#define G_RM_AA_SUB_SURF RM_AA_SUB_SURF(1) +#define G_RM_AA_SUB_SURF2 RM_AA_SUB_SURF(2) +#define G_RM_AA_PCL_SURF RM_AA_PCL_SURF(1) +#define G_RM_AA_PCL_SURF2 RM_AA_PCL_SURF(2) +#define G_RM_AA_OPA_TERR RM_AA_OPA_TERR(1) +#define G_RM_AA_OPA_TERR2 RM_AA_OPA_TERR(2) +#define G_RM_AA_TEX_TERR RM_AA_TEX_TERR(1) +#define G_RM_AA_TEX_TERR2 RM_AA_TEX_TERR(2) +#define G_RM_AA_SUB_TERR RM_AA_SUB_TERR(1) +#define G_RM_AA_SUB_TERR2 RM_AA_SUB_TERR(2) + +#define G_RM_RA_OPA_SURF RM_RA_OPA_SURF(1) +#define G_RM_RA_OPA_SURF2 RM_RA_OPA_SURF(2) + +#define G_RM_ZB_OPA_SURF RM_ZB_OPA_SURF(1) +#define G_RM_ZB_OPA_SURF2 RM_ZB_OPA_SURF(2) +#define G_RM_ZB_XLU_SURF RM_ZB_XLU_SURF(1) +#define G_RM_ZB_XLU_SURF2 RM_ZB_XLU_SURF(2) +#define G_RM_ZB_OPA_DECAL RM_ZB_OPA_DECAL(1) +#define G_RM_ZB_OPA_DECAL2 RM_ZB_OPA_DECAL(2) +#define G_RM_ZB_XLU_DECAL RM_ZB_XLU_DECAL(1) +#define G_RM_ZB_XLU_DECAL2 RM_ZB_XLU_DECAL(2) +#define G_RM_ZB_CLD_SURF RM_ZB_CLD_SURF(1) +#define G_RM_ZB_CLD_SURF2 RM_ZB_CLD_SURF(2) +#define G_RM_ZB_OVL_SURF RM_ZB_OVL_SURF(1) +#define G_RM_ZB_OVL_SURF2 RM_ZB_OVL_SURF(2) +#define G_RM_ZB_PCL_SURF RM_ZB_PCL_SURF(1) +#define G_RM_ZB_PCL_SURF2 RM_ZB_PCL_SURF(2) + +#define G_RM_OPA_SURF RM_OPA_SURF(1) +#define G_RM_OPA_SURF2 RM_OPA_SURF(2) +#define G_RM_XLU_SURF RM_XLU_SURF(1) +#define G_RM_XLU_SURF2 RM_XLU_SURF(2) +#define G_RM_CLD_SURF RM_CLD_SURF(1) +#define G_RM_CLD_SURF2 RM_CLD_SURF(2) +#define G_RM_TEX_EDGE RM_TEX_EDGE(1) +#define G_RM_TEX_EDGE2 RM_TEX_EDGE(2) +#define G_RM_PCL_SURF RM_PCL_SURF(1) +#define G_RM_PCL_SURF2 RM_PCL_SURF(2) +#define G_RM_ADD RM_ADD(1) +#define G_RM_ADD2 RM_ADD(2) +#define G_RM_NOOP RM_NOOP(1) +#define G_RM_NOOP2 RM_NOOP(2) +#define G_RM_VISCVG RM_VISCVG(1) +#define G_RM_VISCVG2 RM_VISCVG(2) +#define G_RM_OPA_CI RM_OPA_CI(1) +#define G_RM_OPA_CI2 RM_OPA_CI(2) + + +#define G_RM_FOG_SHADE_A GBL_c1(G_BL_CLR_FOG, G_BL_A_SHADE, G_BL_CLR_IN, G_BL_1MA) +#define G_RM_FOG_PRIM_A GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_IN, G_BL_1MA) +#define G_RM_PASS GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1) + +/* + * G_SETCONVERT: K0-5 + */ +#define G_CV_K0 175 +#define G_CV_K1 -43 +#define G_CV_K2 -89 +#define G_CV_K3 222 +#define G_CV_K4 114 +#define G_CV_K5 42 + +/* + * G_SETSCISSOR: interlace mode + */ +#define G_SC_NON_INTERLACE 0 +#define G_SC_ODD_INTERLACE 3 +#define G_SC_EVEN_INTERLACE 2 + +/* flags to inhibit pushing of the display list (on branch) */ +#define G_DL_PUSH 0x00 +#define G_DL_NOPUSH 0x01 + +/* + * BEGIN C-specific section: (typedef's) + */ +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* + * Data Structures + * + * NOTE: + * The DMA transfer hardware requires 64-bit aligned, 64-bit multiple- + * sized transfers. This important hardware optimization is unfortunately + * reflected in the programming interface, with some structures + * padded and alignment enforced. + * + * Since structures are aligned to the boundary of the "worst-case" + * element, we can't depend on the C compiler to align things + * properly. + * + * 64-bit structure alignment is enforced by wrapping structures with + * unions that contain a dummy "long long int". Why this works is + * explained in the ANSI C Spec, or on page 186 of the second edition + * of K&R, "The C Programming Language". + * + * The price we pay for this is a little awkwardness referencing the + * structures through the union. There is no memory penalty, since + * all the structures are at least 64-bits the dummy alignment field + * does not increase the size of the union. + * + * Static initialization of these union structures works because + * the ANSI C spec states that static initialization for unions + * works by using the first union element. We put the dummy alignment + * field last for this reason. + * + * (it's possible a newer 64-bit compiler from MIPS might make this + * easier with a flag, but we can't wait for it...) + * + */ + +/* + * Vertex (set up for use with colors) + */ +typedef struct { + short ob[3]; /* x, y, z */ + unsigned short flag; + short tc[2]; /* texture coord */ + unsigned char cn[4]; /* color & alpha */ +} Vtx_t; + +/* + * Vertex (set up for use with normals) + */ +typedef struct { + short ob[3]; /* x, y, z */ + unsigned short flag; + short tc[2]; /* texture coord */ + signed char n[3]; /* normal */ + unsigned char a; /* alpha */ +} Vtx_tn; + +typedef union { + Vtx_t v; /* Use this one for colors */ + Vtx_tn n; /* Use this one for normals */ + long long int force_structure_alignment; +} Vtx; + +/* + * Sprite structure + */ + +typedef struct { + void *SourceImagePointer; + void *TlutPointer; + short Stride; + short SubImageWidth; + short SubImageHeight; + char SourceImageType; + char SourceImageBitSize; + short SourceImageOffsetS; + short SourceImageOffsetT; + /* 20 bytes for above */ + + /* padding to bring structure size to 64 bit allignment */ + char dummy[4]; + +} uSprite_t; + +typedef union { + uSprite_t s; + + /* Need to make sure this is 64 bit aligned */ + long long int force_structure_allignment[3]; +} uSprite; + +/* + * Triangle face + */ +typedef struct { + unsigned char flag; + unsigned char v[3]; +} Tri; + +/* + * 4x4 matrix, fixed point s15.16 format. + * First 8 words are integer portion of the 4x4 matrix + * Last 8 words are the fraction portion of the 4x4 matrix + */ +typedef long Mtx_t[4][4]; + +typedef union { + Mtx_t m; + long long int force_structure_alignment; +} Mtx; + +/* + * Viewport + */ + +/* + * + * This magic value is the maximum INTEGER z-range of the hardware + * (there are also 16-bits of fraction, which are introduced during + * any transformations). This is not just a good idea, it's the law. + * Feeding the hardware eventual z-coordinates (after any transforms + * or scaling) bigger than this, will not work. + * + * This number is DIFFERENT than G_MAXFBZ, which is the maximum value + * you want to use to initialize the z-buffer. + * + * The reason these are different is mildly interesting, but too long + * to explain here. It is basically the result of optimizations in the + * hardware. A more generic API might hide this detail from the users, + * but we don't have the ucode to do that... + * + */ +#define G_MAXZ 0x03ff /* 10 bits of integer screen-Z precision */ + +/* + * The viewport structure elements have 2 bits of fraction, necessary + * to accomodate the sub-pixel positioning scaling for the hardware. + * This can also be exploited to handle odd-sized viewports. + * + * Accounting for these fractional bits, using the default projection + * and viewing matrices, the viewport structure is initialized thusly: + * + * (SCREEN_WD/2)*4, (SCREEN_HT/2)*4, G_MAXZ, 0, + * (SCREEN_WD/2)*4, (SCREEN_HT/2)*4, 0, 0, + */ +typedef struct { + short vscale[4]; /* scale, 2 bits fraction */ + short vtrans[4]; /* translate, 2 bits fraction */ + /* both the above arrays are padded to 64-bit boundary */ +} Vp_t; + +typedef union { + Vp_t vp; + long long int force_structure_alignment; +} Vp; + +/* + * MOVEMEM indices + * + * Each of these indexes an entry in a dmem table + * which points to a 1-4 word block of dmem in + * which to store a 1-4 word DMA. + * + */ +#ifdef F3DEX_GBI_2 +/* 0,4 are reserved by G_MTX */ +# define G_MV_MMTX 2 +# define G_MV_PMTX 6 +# define G_MV_VIEWPORT 8 +# define G_MV_LIGHT 10 +# define G_MV_POINT 12 +# define G_MV_MATRIX 14 /* NOTE: this is in moveword table */ +# define G_MVO_LOOKATX (0*24) +# define G_MVO_LOOKATY (1*24) +# define G_MVO_L0 (2*24) +# define G_MVO_L1 (3*24) +# define G_MVO_L2 (4*24) +# define G_MVO_L3 (5*24) +# define G_MVO_L4 (6*24) +# define G_MVO_L5 (7*24) +# define G_MVO_L6 (8*24) +# define G_MVO_L7 (9*24) +#else /* F3DEX_GBI_2 */ +# define G_MV_VIEWPORT 0x80 +# define G_MV_LOOKATY 0x82 +# define G_MV_LOOKATX 0x84 +# define G_MV_L0 0x86 +# define G_MV_L1 0x88 +# define G_MV_L2 0x8a +# define G_MV_L3 0x8c +# define G_MV_L4 0x8e +# define G_MV_L5 0x90 +# define G_MV_L6 0x92 +# define G_MV_L7 0x94 +# define G_MV_TXTATT 0x96 +# define G_MV_MATRIX_1 0x9e /* NOTE: this is in moveword table */ +# define G_MV_MATRIX_2 0x98 +# define G_MV_MATRIX_3 0x9a +# define G_MV_MATRIX_4 0x9c +#endif /* F3DEX_GBI_2 */ + +/* + * MOVEWORD indices + * + * Each of these indexes an entry in a dmem table + * which points to a word in dmem in dmem where + * an immediate word will be stored. + * + */ +#define G_MW_MATRIX 0x00 /* NOTE: also used by movemem */ +#define G_MW_NUMLIGHT 0x02 +#define G_MW_CLIP 0x04 +#define G_MW_SEGMENT 0x06 +#define G_MW_FOG 0x08 +#define G_MW_LIGHTCOL 0x0a +#ifdef F3DEX_GBI_2 +# define G_MW_FORCEMTX 0x0c +#else /* F3DEX_GBI_2 */ +# define G_MW_POINTS 0x0c +#endif /* F3DEX_GBI_2 */ +#define G_MW_PERSPNORM 0x0e + +/* + * These are offsets from the address in the dmem table + */ +#define G_MWO_NUMLIGHT 0x00 +#define G_MWO_CLIP_RNX 0x04 +#define G_MWO_CLIP_RNY 0x0c +#define G_MWO_CLIP_RPX 0x14 +#define G_MWO_CLIP_RPY 0x1c +#define G_MWO_SEGMENT_0 0x00 +#define G_MWO_SEGMENT_1 0x01 +#define G_MWO_SEGMENT_2 0x02 +#define G_MWO_SEGMENT_3 0x03 +#define G_MWO_SEGMENT_4 0x04 +#define G_MWO_SEGMENT_5 0x05 +#define G_MWO_SEGMENT_6 0x06 +#define G_MWO_SEGMENT_7 0x07 +#define G_MWO_SEGMENT_8 0x08 +#define G_MWO_SEGMENT_9 0x09 +#define G_MWO_SEGMENT_A 0x0a +#define G_MWO_SEGMENT_B 0x0b +#define G_MWO_SEGMENT_C 0x0c +#define G_MWO_SEGMENT_D 0x0d +#define G_MWO_SEGMENT_E 0x0e +#define G_MWO_SEGMENT_F 0x0f +#define G_MWO_FOG 0x00 +#define G_MWO_aLIGHT_1 0x00 +#define G_MWO_bLIGHT_1 0x04 +#ifdef F3DEX_GBI_2 +#define G_MWO_aLIGHT_2 0x18 +#define G_MWO_bLIGHT_2 0x1c +#define G_MWO_aLIGHT_3 0x30 +#define G_MWO_bLIGHT_3 0x34 +#define G_MWO_aLIGHT_4 0x48 +#define G_MWO_bLIGHT_4 0x4c +#define G_MWO_aLIGHT_5 0x60 +#define G_MWO_bLIGHT_5 0x64 +#define G_MWO_aLIGHT_6 0x78 +#define G_MWO_bLIGHT_6 0x7c +#define G_MWO_aLIGHT_7 0x90 +#define G_MWO_bLIGHT_7 0x94 +#define G_MWO_aLIGHT_8 0xa8 +#define G_MWO_bLIGHT_8 0xac +#else +#define G_MWO_aLIGHT_2 0x20 +#define G_MWO_bLIGHT_2 0x24 +#define G_MWO_aLIGHT_3 0x40 +#define G_MWO_bLIGHT_3 0x44 +#define G_MWO_aLIGHT_4 0x60 +#define G_MWO_bLIGHT_4 0x64 +#define G_MWO_aLIGHT_5 0x80 +#define G_MWO_bLIGHT_5 0x84 +#define G_MWO_aLIGHT_6 0xa0 +#define G_MWO_bLIGHT_6 0xa4 +#define G_MWO_aLIGHT_7 0xc0 +#define G_MWO_bLIGHT_7 0xc4 +#define G_MWO_aLIGHT_8 0xe0 +#define G_MWO_bLIGHT_8 0xe4 +#endif +#define G_MWO_MATRIX_XX_XY_I 0x00 +#define G_MWO_MATRIX_XZ_XW_I 0x04 +#define G_MWO_MATRIX_YX_YY_I 0x08 +#define G_MWO_MATRIX_YZ_YW_I 0x0c +#define G_MWO_MATRIX_ZX_ZY_I 0x10 +#define G_MWO_MATRIX_ZZ_ZW_I 0x14 +#define G_MWO_MATRIX_WX_WY_I 0x18 +#define G_MWO_MATRIX_WZ_WW_I 0x1c +#define G_MWO_MATRIX_XX_XY_F 0x20 +#define G_MWO_MATRIX_XZ_XW_F 0x24 +#define G_MWO_MATRIX_YX_YY_F 0x28 +#define G_MWO_MATRIX_YZ_YW_F 0x2c +#define G_MWO_MATRIX_ZX_ZY_F 0x30 +#define G_MWO_MATRIX_ZZ_ZW_F 0x34 +#define G_MWO_MATRIX_WX_WY_F 0x38 +#define G_MWO_MATRIX_WZ_WW_F 0x3c +#define G_MWO_POINT_RGBA 0x10 +#define G_MWO_POINT_ST 0x14 +#define G_MWO_POINT_XYSCREEN 0x18 +#define G_MWO_POINT_ZSCREEN 0x1c + +/* + * Light structure. + * + * Note: only directional (infinite) lights are currently supported. + * + * Note: the weird order is for the DMEM alignment benefit of + * the microcode. + * + */ + +typedef struct { + unsigned char col[3]; /* diffuse light value (rgba) */ + char pad1; + unsigned char colc[3]; /* copy of diffuse light value (rgba) */ + char pad2; + signed char dir[3]; /* direction of light (normalized) */ + char pad3; +} Light_t; + +typedef struct { + unsigned char col[3]; /* ambient light value (rgba) */ + char pad1; + unsigned char colc[3]; /* copy of ambient light value (rgba) */ + char pad2; +} Ambient_t; + +typedef struct { + int x1,y1,x2,y2; /* texture offsets for highlight 1/2 */ +} Hilite_t; + +typedef union { + Light_t l; + long long int force_structure_alignment[2]; +} Light; + +typedef union { + Ambient_t l; + long long int force_structure_alignment[1]; +} Ambient; + +typedef struct { + Ambient a; + Light l[7]; +} Lightsn; + +typedef struct { + Ambient a; + Light l[1]; +} Lights0; + +typedef struct { + Ambient a; + Light l[1]; +} Lights1; + +typedef struct { + Ambient a; + Light l[2]; +} Lights2; + +typedef struct { + Ambient a; + Light l[3]; +} Lights3; + +typedef struct { + Ambient a; + Light l[4]; +} Lights4; + +typedef struct { + Ambient a; + Light l[5]; +} Lights5; + +typedef struct { + Ambient a; + Light l[6]; +} Lights6; + +typedef struct { + Ambient a; + Light l[7]; +} Lights7; + +typedef struct { + Light l[2]; +} LookAt; + +typedef union { + Hilite_t h; + long int force_structure_alignment[4]; +} Hilite; + +#define gdSPDefLights0(ar,ag,ab) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ { 0, 0, 0},0,{ 0, 0, 0},0,{ 0, 0, 0},0}}} } +#define gdSPDefLights1(ar,ag,ab,r1,g1,b1,x1,y1,z1) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}} } +#define gdSPDefLights2(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \ + {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}} } +#define gdSPDefLights3(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \ + {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \ + {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}} } +#define gdSPDefLights4(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \ + {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \ + {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \ + {{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}} } +#define gdSPDefLights5(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4,r5,g5,b5,x5,y5,z5) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \ + {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \ + {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \ + {{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}, \ + {{ {r5,g5,b5},0,{r5,g5,b5},0,{x5,y5,z5},0}}} } + + +#define gdSPDefLights6(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4,r5,g5,b5,x5,y5,z5,r6,g6,b6,x6,y6,z6) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \ + {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \ + {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \ + {{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}, \ + {{ {r5,g5,b5},0,{r5,g5,b5},0,{x5,y5,z5},0}}, \ + {{ {r6,g6,b6},0,{r6,g6,b6},0,{x6,y6,z6},0}}} } + + +#define gdSPDefLights7(ar,ag,ab,r1,g1,b1,x1,y1,z1,r2,g2,b2,x2,y2,z2,r3,g3,b3,x3,y3,z3,r4,g4,b4,x4,y4,z4,r5,g5,b5,x5,y5,z5,r6,g6,b6,x6,y6,z6,r7,g7,b7,x7,y7,z7) \ + { {{ {ar,ag,ab},0,{ar,ag,ab},0}}, \ + {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}, \ + {{ {r2,g2,b2},0,{r2,g2,b2},0,{x2,y2,z2},0}}, \ + {{ {r3,g3,b3},0,{r3,g3,b3},0,{x3,y3,z3},0}}, \ + {{ {r4,g4,b4},0,{r4,g4,b4},0,{x4,y4,z4},0}}, \ + {{ {r5,g5,b5},0,{r5,g5,b5},0,{x5,y5,z5},0}}, \ + {{ {r6,g6,b6},0,{r6,g6,b6},0,{x6,y6,z6},0}}, \ + {{ {r7,g7,b7},0,{r7,g7,b7},0,{x7,y7,z7},0}}} } + + +#define gdSPDefLookAt(rightx,righty,rightz,upx,upy,upz) \ + { {{ {{0,0,0},0,{0,0,0},0,{rightx,righty,rightz},0}}, \ + { {{0,0x80,0},0,{0,0x80,0},0,{upx,upy,upz},0}}} } + +/* + * Graphics DMA Packet + */ +typedef struct { + int cmd:8; + unsigned int par:8; + unsigned int len:16; + unsigned int addr; +} Gdma; + +/* + * Graphics Immediate Mode Packet types + */ +typedef struct { + int cmd:8; + int pad:24; + Tri tri; +} Gtri; + +typedef struct { + int cmd:8; + int pad1:24; + int pad2:24; + unsigned char param:8; +} Gpopmtx; + +/* + * typedef struct { + * int cmd:8; + * int pad0:24; + * int pad1:4; + * int number:4; + * int base:24; + * } Gsegment; + */ +typedef struct { + int cmd:8; + int pad0:8; + int mw_index:8; + int number:8; + int pad1:8; + int base:24; +} Gsegment; + +typedef struct { + int cmd:8; + int pad0:8; + int sft:8; + int len:8; + unsigned int data:32; +} GsetothermodeL; + +typedef struct { + int cmd:8; + int pad0:8; + int sft:8; + int len:8; + unsigned int data:32; +} GsetothermodeH; + +typedef struct { + unsigned char cmd; + unsigned char lodscale; + unsigned char tile; + unsigned char on; + unsigned short s; + unsigned short t; +} Gtexture; + +typedef struct { + int cmd:8; + int pad:24; + Tri line; +} Gline3D; + +typedef struct { + int cmd:8; + int pad1:24; + short int pad2; + short int scale; +} Gperspnorm; + + +/* + * RDP Packet types + */ +typedef struct { + int cmd:8; + unsigned int fmt:3; + unsigned int siz:2; + unsigned int pad:7; + unsigned int wd:12; /* really only 10 bits, extra */ + unsigned int dram; /* to account for 1024 */ +} Gsetimg; + +typedef struct { + int cmd:8; + unsigned int muxs0:24; + unsigned int muxs1:32; +} Gsetcombine; + +typedef struct { + int cmd:8; + unsigned char pad; + unsigned char prim_min_level; + unsigned char prim_level; + unsigned long color; +} Gsetcolor; + +typedef struct { + int cmd:8; + int x0:10; + int x0frac:2; + int y0:10; + int y0frac:2; + unsigned int pad:8; + int x1:10; + int x1frac:2; + int y1:10; + int y1frac:2; +} Gfillrect; + +typedef struct { + int cmd:8; + unsigned int fmt:3; + unsigned int siz:2; + unsigned int pad0:1; + unsigned int line:9; + unsigned int tmem:9; + unsigned int pad1:5; + unsigned int tile:3; + unsigned int palette:4; + unsigned int ct:1; + unsigned int mt:1; + unsigned int maskt:4; + unsigned int shiftt:4; + unsigned int cs:1; + unsigned int ms:1; + unsigned int masks:4; + unsigned int shifts:4; +} Gsettile; + +typedef struct { + int cmd:8; + unsigned int sl:12; + unsigned int tl:12; + int pad:5; + unsigned int tile:3; + unsigned int sh:12; + unsigned int th:12; +} Gloadtile; + +typedef Gloadtile Gloadblock; + +typedef Gloadtile Gsettilesize; + +typedef Gloadtile Gloadtlut; + +typedef struct { + unsigned int cmd:8; /* command */ + unsigned int xl:12; /* X coordinate of upper left */ + unsigned int yl:12; /* Y coordinate of upper left */ + unsigned int pad1:5; /* Padding */ + unsigned int tile:3; /* Tile descriptor index */ + unsigned int xh:12; /* X coordinate of lower right */ + unsigned int yh:12; /* Y coordinate of lower right */ + unsigned int s:16; /* S texture coord at top left */ + unsigned int t:16; /* T texture coord at top left */ + unsigned int dsdx:16;/* Change in S per change in X */ + unsigned int dtdy:16;/* Change in T per change in Y */ +} Gtexrect; + +#define MakeTexRect(xh,yh,flip,tile,xl,yl,s,t,dsdx,dtdy) \ + G_TEXRECT, xh, yh, 0, flip, 0, tile, xl, yl, s, t, dsdx, dtdy + +/* + * Textured rectangles are 128 bits not 64 bits + */ +typedef struct { + unsigned long w0; + unsigned long w1; + unsigned long w2; + unsigned long w3; +} TexRect; + +/* + * Generic Gfx Packet + */ +typedef struct { + unsigned int w0; + unsigned int w1; +} Gwords; + +/* + * This union is the fundamental type of the display list. + * It is, by law, exactly 64 bits in size. + */ +typedef union { + Gwords words; + Gdma dma; + Gtri tri; + Gline3D line; + Gpopmtx popmtx; + Gsegment segment; + GsetothermodeH setothermodeH; + GsetothermodeL setothermodeL; + Gtexture texture; + Gperspnorm perspnorm; + Gsetimg setimg; + Gsetcombine setcombine; + Gsetcolor setcolor; + Gfillrect fillrect; /* use for setscissor also */ + Gsettile settile; + Gloadtile loadtile; /* use for loadblock also, th is dxt */ + Gsettilesize settilesize; + Gloadtlut loadtlut; + long long int force_structure_alignment; +} Gfx; + +/* + * Macros to assemble the graphics display list + */ + +/* + * DMA macros + */ +#define gDma0p(pkt, c, s, l) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL((c), 24, 8) | _SHIFTL((l), 0, 24); \ + _g->words.w1 = (unsigned int)(s); \ +} + +#define gsDma0p(c, s, l) \ +{{ \ + _SHIFTL((c), 24, 8) | _SHIFTL((l), 0, 24), (unsigned int)(s) \ +}} + +#define gDma1p(pkt, c, s, l, p) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \ + _SHIFTL((l), 0, 16)); \ + _g->words.w1 = (unsigned int)(s); \ +} + +#define gsDma1p(c, s, l, p) \ +{{ \ + (_SHIFTL((c), 24, 8) | _SHIFTL((p), 16, 8) | \ + _SHIFTL((l), 0, 16)), \ + (unsigned int)(s) \ +}} + +#define gDma2p(pkt, c, adrs, len, idx, ofs) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = (_SHIFTL((c),24,8)|_SHIFTL(((len)-1)/8,19,5)| \ + _SHIFTL((ofs)/8,8,8)|_SHIFTL((idx),0,8)); \ + _g->words.w1 = (unsigned int)(adrs); \ +} +#define gsDma2p(c, adrs, len, idx, ofs) \ +{{ \ + (_SHIFTL((c),24,8)|_SHIFTL(((len)-1)/8,19,5)| \ + _SHIFTL((ofs)/8,8,8)|_SHIFTL((idx),0,8)), \ + (unsigned int)(adrs) \ +}} + +#define gSPNoOp(pkt) gDma0p(pkt, G_SPNOOP, 0, 0) +#define gsSPNoOp() gsDma0p(G_SPNOOP, 0, 0) + +#ifdef F3DEX_GBI_2 +# define gSPMatrix(pkt, m, p) \ + gDma2p((pkt),G_MTX,(m),sizeof(Mtx),(p)^G_MTX_PUSH,0) +# define gsSPMatrix(m, p) \ + gsDma2p( G_MTX,(m),sizeof(Mtx),(p)^G_MTX_PUSH,0) +#else /* F3DEX_GBI_2 */ +# define gSPMatrix(pkt, m, p) gDma1p(pkt, G_MTX, m, sizeof(Mtx), p) +# define gsSPMatrix(m, p) gsDma1p(G_MTX, m, sizeof(Mtx), p) +#endif /* F3DEX_GBI_2 */ + +#if defined(F3DEX_GBI_2) +/* + * F3DEX_GBI_2: G_VTX GBI format was changed. + * + * +--------+----+---+---+----+------+-+ + * G_VTX | cmd:8 |0000| n:8 |0000|v0+n:7|0| + * +-+---+--+----+---+---+----+------+-+ + * | |seg| address | + * +-+---+-----------------------------+ + */ +# define gSPVertex(pkt, v, n, v0) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = \ + _SHIFTL(G_VTX,24,8)|_SHIFTL((n),12,8)|_SHIFTL((v0)+(n),1,7); \ + _g->words.w1 = (unsigned int)(v); \ +} +# define gsSPVertex(v, n, v0) \ +{{ \ + (_SHIFTL(G_VTX,24,8)|_SHIFTL((n),12,8)|_SHIFTL((v0)+(n),1,7)), \ + (unsigned int)(v) \ +}} +#elif (defined(F3DEX_GBI)||defined(F3DLP_GBI)) +/* + * F3DEX_GBI: G_VTX GBI format was changed to support 64 vertice. + * + * +--------+--------+------+----------+ + * G_VTX | cmd:8 | v0:8 | n:6 |length:10 | + * +-+---+--+--------+------+----------+ + * | |seg| address | + * +-+---+-----------------------------+ + */ +# define gSPVertex(pkt, v, n, v0) \ + gDma1p((pkt),G_VTX,(v),((n)<<10)|(sizeof(Vtx)*(n)-1),(v0)*2) +# define gsSPVertex(v, n, v0) \ + gsDma1p(G_VTX,(v),((n)<<10)|(sizeof(Vtx)*(n)-1),(v0)*2) +#else +# define gSPVertex(pkt, v, n, v0) \ + gDma1p(pkt, G_VTX, v, sizeof(Vtx)*(n),((n)-1)<<4|(v0)) +# define gsSPVertex(v, n, v0) \ + gsDma1p(G_VTX, v, sizeof(Vtx)*(n), ((n)-1)<<4|(v0)) +#endif + + +#ifdef F3DEX_GBI_2 +# define gSPViewport(pkt, v) \ + gDma2p((pkt), G_MOVEMEM, (v), sizeof(Vp), G_MV_VIEWPORT, 0) +# define gsSPViewport(v) \ + gsDma2p( G_MOVEMEM, (v), sizeof(Vp), G_MV_VIEWPORT, 0) +#else /* F3DEX_GBI_2 */ +# define gSPViewport(pkt,v) \ + gDma1p((pkt), G_MOVEMEM, (v), sizeof(Vp), G_MV_VIEWPORT) +# define gsSPViewport(v) \ + gsDma1p( G_MOVEMEM, (v), sizeof(Vp), G_MV_VIEWPORT) +#endif /* F3DEX_GBI_2 */ + +#define gSPDisplayList(pkt,dl) gDma1p(pkt,G_DL,dl,0,G_DL_PUSH) +#define gsSPDisplayList( dl) gsDma1p( G_DL,dl,0,G_DL_PUSH) + +#define gSPBranchList(pkt,dl) gDma1p(pkt,G_DL,dl,0,G_DL_NOPUSH) +#define gsSPBranchList( dl) gsDma1p( G_DL,dl,0,G_DL_NOPUSH) + +#define gSPSprite2DBase(pkt, s) gDma1p(pkt, G_SPRITE2D_BASE, s, sizeof(uSprite), 0) +#define gsSPSprite2DBase(s) gsDma1p(G_SPRITE2D_BASE, s, sizeof(uSprite), 0) + +/* + * RSP short command (no DMA required) macros + */ +#define gImmp0(pkt, c) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL((c), 24, 8); \ +} + +#define gsImmp0(c) \ +{{ \ + _SHIFTL((c), 24, 8) \ +}} + +#define gImmp1(pkt, c, p0) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL((c), 24, 8); \ + _g->words.w1 = (unsigned int)(p0); \ +} + +#define gsImmp1(c, p0) \ +{{ \ + _SHIFTL((c), 24, 8), (unsigned int)(p0) \ +}} + +#define gImmp2(pkt, c, p0, p1) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL((c), 24, 8); \ + _g->words.w1 = _SHIFTL((p0), 16, 16) | _SHIFTL((p1), 8, 8); \ +} + +#define gsImmp2(c, p0, p1) \ +{{ \ + _SHIFTL((c), 24, 8), _SHIFTL((p0), 16, 16) | _SHIFTL((p1), 8, 8)\ +}} + +#define gImmp3(pkt, c, p0, p1, p2) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL((c), 24, 8); \ + _g->words.w1 = (_SHIFTL((p0), 16, 16) | _SHIFTL((p1), 8, 8) | \ + _SHIFTL((p2), 0, 8)); \ +} + +#define gsImmp3(c, p0, p1, p2) \ +{{ \ + _SHIFTL((c), 24, 8), (_SHIFTL((p0), 16, 16) | \ + _SHIFTL((p1), 8, 8) | _SHIFTL((p2), 0, 8))\ +}} + +#define gImmp21(pkt, c, p0, p1, dat) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL((c), 24, 8) | _SHIFTL((p0), 8, 16) | \ + _SHIFTL((p1), 0, 8)); \ + _g->words.w1 = (unsigned int) (dat); \ +} + +#define gsImmp21(c, p0, p1, dat) \ +{{ \ + _SHIFTL((c), 24, 8) | _SHIFTL((p0), 8, 16) | _SHIFTL((p1), 0, 8),\ + (unsigned int) (dat) \ +}} + +#ifdef F3DEX_GBI_2 +#define gMoveWd(pkt, index, offset, data) \ + gDma1p((pkt), G_MOVEWORD, data, offset, index) +#define gsMoveWd( index, offset, data) \ + gsDma1p( G_MOVEWORD, data, offset, index) +#else /* F3DEX_GBI_2 */ +#define gMoveWd(pkt, index, offset, data) \ + gImmp21((pkt), G_MOVEWORD, offset, index, data) +#define gsMoveWd( index, offset, data) \ + gsImmp21( G_MOVEWORD, offset, index, data) +#endif /* F3DEX_GBI_2 */ + +/* Sprite immediate macros, there is also a sprite dma macro above */ + +#define gSPSprite2DScaleFlip(pkt, sx, sy, fx, fy) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_SPRITE2D_SCALEFLIP, 24, 8) | \ + _SHIFTL((fx), 8, 8) | \ + _SHIFTL((fy), 0, 8)); \ + _g->words.w1 = (_SHIFTL((sx), 16, 16) | \ + _SHIFTL((sy), 0, 16)); \ +} + +#define gsSPSprite2DScaleFlip(sx, sy, fx, fy) \ +{{ \ + (_SHIFTL(G_SPRITE2D_SCALEFLIP, 24, 8) | \ + _SHIFTL((fx), 8, 8) | \ + _SHIFTL((fy), 0, 8)), \ + (_SHIFTL((sx), 16, 16) | \ + _SHIFTL((sy), 0, 16)) \ +}} + +#define gSPSprite2DDraw(pkt, px, py) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_SPRITE2D_DRAW, 24, 8)); \ + _g->words.w1 = (_SHIFTL((px), 16, 16) | \ + _SHIFTL((py), 0, 16)); \ +} + +#define gsSPSprite2DDraw(px, py) \ +{{ \ + (_SHIFTL(G_SPRITE2D_DRAW, 24, 8)), \ + (_SHIFTL((px), 16, 16) | \ + _SHIFTL((py), 0, 16)) \ +}} + + +/* + * Note: the SP1Triangle() and line macros multiply the vertex indices + * by 10, this is an optimization for the microcode. + */ +#if (defined(F3DLP_GBI)||defined(F3DEX_GBI)) +# define __gsSP1Triangle_w1(v0, v1, v2) \ + (_SHIFTL((v0)*2,16,8)|_SHIFTL((v1)*2,8,8)|_SHIFTL((v2)*2,0,8)) +# define __gsSP1Triangle_w1f(v0, v1, v2, flag) \ + (((flag) == 0) ? __gsSP1Triangle_w1(v0, v1, v2): \ + ((flag) == 1) ? __gsSP1Triangle_w1(v1, v2, v0): \ + __gsSP1Triangle_w1(v2, v0, v1)) +# define __gsSPLine3D_w1(v0, v1, wd) \ + (_SHIFTL((v0)*2,16,8)|_SHIFT((v1)*2,8,8)|_SHIFT((wd),0,8)) +# define __gsSPLine3D_w1f(v0, v1, wd, flag) \ + (((flag) == 0) ? __gsSPLine3D_w1(v0, v1, wd): \ + __gsSPLine3D_w1(v1, v0, wd)) +# define __gsSP1Quadrangle_w1f(v0, v1, v2, v3, flag) \ + (((flag) == 0) ? __gsSP1Triangle_w1(v0, v1, v2): \ + ((flag) == 1) ? __gsSP1Triangle_w1(v1, v2, v3): \ + ((flag) == 2) ? __gsSP1Triangle_w1(v2, v3, v0): \ + __gsSP1Triangle_w1(v3, v0, v1)) +# define __gsSP1Quadrangle_w2f(v0, v1, v2, v3, flag) \ + (((flag) == 0) ? __gsSP1Triangle_w1(v0, v2, v3): \ + ((flag) == 1) ? __gsSP1Triangle_w1(v1, v3, v0): \ + ((flag) == 2) ? __gsSP1Triangle_w1(v2, v0, v1): \ + __gsSP1Triangle_w1(v3, v1, v2)) +#else +# define __gsSP1Triangle_w1f(v0, v1, v2, flag) \ + (_SHIFTL((flag), 24,8)|_SHIFTL((v0)*10,16,8)| \ + _SHIFTL((v1)*10, 8,8)|_SHIFTL((v2)*10, 0,8)) +# define __gsSPLine3D_w1f(v0, v1, wd, flag) \ + (_SHIFTL((flag), 24,8)|_SHIFTL((v0)*10,16,8)| \ + _SHIFTL((v1)*10, 8,8)|_SHIFTL((wd), 0,8)) +#endif + +#ifdef F3DEX_GBI_2 +/*** + *** 1 Triangle + ***/ +#define gSP1Triangle(pkt, v0, v1, v2, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_TRI1, 24, 8)| \ + __gsSP1Triangle_w1f(v0, v1, v2, flag); \ + _g->words.w1 = 0; \ +} +#define gsSP1Triangle(v0, v1, v2, flag) \ +{{ \ + _SHIFTL(G_TRI1, 24, 8)|__gsSP1Triangle_w1f(v0, v1, v2, flag), \ + 0 \ +}} + +/*** + *** Line + ***/ +#define gSPLine3D(pkt, v0, v1, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_LINE3D, 24, 8)| \ + __gsSPLine3D_w1f(v0, v1, 0, flag); \ + _g->words.w1 = 0; \ +} +#define gsSPLine3D(v0, v1, flag) \ +{{ \ + _SHIFTL(G_LINE3D, 24, 8)|__gsSPLine3D_w1f(v0, v1, 0, flag), \ + 0 \ +}} + +/*** + *** LineW + ***/ +/* these macros are the same as SPLine3D, except they have an + * additional parameter for width. The width is added to the "minimum" + * thickness, which is 1.5 pixels. The units for width are in + * half-pixel units, so a width of 1 translates to (.5 + 1.5) or + * a 2.0 pixels wide line. + */ +#define gSPLineW3D(pkt, v0, v1, wd, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_LINE3D, 24, 8)| \ + __gsSPLine3D_w1f(v0, v1, wd, flag); \ + _g->words.w1 = 0; \ +} +#define gsSPLineW3D(v0, v1, wd, flag) \ +{{ \ + _SHIFTL(G_LINE3D, 24, 8)|__gsSPLine3D_w1f(v0, v1, wd, flag), \ + 0 \ +}} + +/*** + *** 1 Quadrangle + ***/ +#define gSP1Quadrangle(pkt, v0, v1, v2, v3, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_QUAD, 24, 8)| \ + __gsSP1Quadrangle_w1f(v0, v1, v2, v3, flag)); \ + _g->words.w1 = __gsSP1Quadrangle_w2f(v0, v1, v2, v3, flag); \ +} + +#define gsSP1Quadrangle(v0, v1, v2, v3, flag) \ +{{ \ + (_SHIFTL(G_QUAD, 24, 8)| \ + __gsSP1Quadrangle_w1f(v0, v1, v2, v3, flag)), \ + __gsSP1Quadrangle_w2f(v0, v1, v2, v3, flag) \ +}} +#else /* F3DEX_GBI_2 */ + +/*** + *** 1 Triangle + ***/ +#define gSP1Triangle(pkt, v0, v1, v2, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_TRI1, 24, 8); \ + _g->words.w1 = __gsSP1Triangle_w1f(v0, v1, v2, flag); \ +} +#define gsSP1Triangle(v0, v1, v2, flag) \ +{{ \ + _SHIFTL(G_TRI1, 24, 8), \ + __gsSP1Triangle_w1f(v0, v1, v2, flag) \ +}} + +/*** + *** Line + ***/ +#define gSPLine3D(pkt, v0, v1, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_LINE3D, 24, 8); \ + _g->words.w1 = __gsSPLine3D_w1f(v0, v1, 0, flag); \ +} +#define gsSPLine3D(v0, v1, flag) \ +{{ \ + _SHIFTL(G_LINE3D, 24, 8), \ + __gsSPLine3D_w1f(v0, v1, 0, flag) \ +}} + +/*** + *** LineW + ***/ +/* these macros are the same as SPLine3D, except they have an + * additional parameter for width. The width is added to the "minimum" + * thickness, which is 1.5 pixels. The units for width are in + * half-pixel units, so a width of 1 translates to (.5 + 1.5) or + * a 2.0 pixels wide line. + */ +#define gSPLineW3D(pkt, v0, v1, wd, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_LINE3D, 24, 8); \ + _g->words.w1 = __gsSPLine3D_w1f(v0, v1, wd, flag); \ +} +#define gsSPLineW3D(v0, v1, wd, flag) \ +{{ \ + _SHIFTL(G_LINE3D, 24, 8), \ + __gsSPLine3D_w1f(v0, v1, wd, flag) \ +}} + +/*** + *** 1 Quadrangle + ***/ +#define gSP1Quadrangle(pkt, v0, v1, v2, v3, flag) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TRI2, 24, 8)| \ + __gsSP1Quadrangle_w1f(v0, v1, v2, v3, flag)); \ + _g->words.w1 = __gsSP1Quadrangle_w2f(v0, v1, v2, v3, flag); \ +} + +#define gsSP1Quadrangle(v0, v1, v2, v3, flag) \ +{{ \ + (_SHIFTL(G_TRI2, 24, 8)| \ + __gsSP1Quadrangle_w1f(v0, v1, v2, v3, flag)), \ + __gsSP1Quadrangle_w2f(v0, v1, v2, v3, flag) \ +}} +#endif /* F3DEX_GBI_2 */ + +#if (defined(F3DLP_GBI)||defined(F3DEX_GBI)) +/*** + *** 2 Triangles + ***/ +#define gSP2Triangles(pkt, v00, v01, v02, flag0, v10, v11, v12, flag1) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TRI2, 24, 8)| \ + __gsSP1Triangle_w1f(v00, v01, v02, flag0)); \ + _g->words.w1 = __gsSP1Triangle_w1f(v10, v11, v12, flag1); \ +} + +#define gsSP2Triangles(v00, v01, v02, flag0, v10, v11, v12, flag1) \ +{{ \ + (_SHIFTL(G_TRI2, 24, 8)| \ + __gsSP1Triangle_w1f(v00, v01, v02, flag0)), \ + __gsSP1Triangle_w1f(v10, v11, v12, flag1) \ +}} + +#endif /* F3DEX_GBI/F3DLP_GBI */ + +#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)) +#define gSPCullDisplayList(pkt,vstart,vend) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_CULLDL, 24, 8) | \ + _SHIFTL((vstart)*2, 0, 16); \ + _g->words.w1 = _SHIFTL((vend)*2, 0, 16); \ +} + +#define gsSPCullDisplayList(vstart,vend) \ +{{ \ + _SHIFTL(G_CULLDL, 24, 8) | _SHIFTL((vstart)*2, 0, 16), \ + _SHIFTL((vend)*2, 0, 16) \ +}} + +#else +#define gSPCullDisplayList(pkt,vstart,vend) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_CULLDL, 24, 8) | \ + ((0x0f & (vstart))*40); \ + _g->words.w1 = (unsigned int)((0x0f & ((vend)+1))*40); \ +} + +#define gsSPCullDisplayList(vstart,vend) \ +{{ \ + _SHIFTL(G_CULLDL, 24, 8) | ((0x0f & (vstart))*40), \ + ((0x0f & ((vend)+1))*40) \ +}} +#endif + +#define gSPSegment(pkt, segment, base) \ + gMoveWd(pkt, G_MW_SEGMENT, (segment)*4, base) +#define gsSPSegment(segment, base) \ + gsMoveWd( G_MW_SEGMENT, (segment)*4, base) + +/* + * Clipping Macros + */ +#define FR_NEG_FRUSTRATIO_1 0x00000001 +#define FR_POS_FRUSTRATIO_1 0x0000ffff +#define FR_NEG_FRUSTRATIO_2 0x00000002 +#define FR_POS_FRUSTRATIO_2 0x0000fffe +#define FR_NEG_FRUSTRATIO_3 0x00000003 +#define FR_POS_FRUSTRATIO_3 0x0000fffd +#define FR_NEG_FRUSTRATIO_4 0x00000004 +#define FR_POS_FRUSTRATIO_4 0x0000fffc +#define FR_NEG_FRUSTRATIO_5 0x00000005 +#define FR_POS_FRUSTRATIO_5 0x0000fffb +#define FR_NEG_FRUSTRATIO_6 0x00000006 +#define FR_POS_FRUSTRATIO_6 0x0000fffa +/* + * r should be one of: FRUSTRATIO_1, FRUSTRATIO_2, FRUSTRATIO_3, ... FRUSTRATIO_6 + */ +#define gSPClipRatio(pkt, r) \ +{ \ + gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RNX, FR_NEG_##r); \ + gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RNY, FR_NEG_##r); \ + gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RPX, FR_POS_##r); \ + gMoveWd(pkt, G_MW_CLIP, G_MWO_CLIP_RPY, FR_POS_##r); \ +} + +#define gsSPClipRatio(r) \ + gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RNX, FR_NEG_##r), \ + gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RNY, FR_NEG_##r), \ + gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RPX, FR_POS_##r), \ + gsMoveWd(G_MW_CLIP, G_MWO_CLIP_RPY, FR_POS_##r) + +/* + * Insert values into Matrix + * + * where = element of matrix (byte offset) + * num = new element (32 bit value replacing 2 int or 2 frac matrix + * componants + */ +#ifdef F3DEX_GBI_2 +#define gSPInsertMatrix(pkt, where, num) \ + ERROR!! gSPInsertMatrix is no longer supported. +#define gsSPInsertMatrix(where, num) \ + ERROR!! gsSPInsertMatrix is no longer supported. +#else +#define gSPInsertMatrix(pkt, where, num) \ + gMoveWd(pkt, G_MW_MATRIX, where, num) +#define gsSPInsertMatrix(where, num) \ + gsMoveWd(G_MW_MATRIX, where, num) +#endif + +/* + * Load new matrix directly + * + * mptr = pointer to matrix + */ +#ifdef F3DEX_GBI_2 +#define gSPForceMatrix(pkt, mptr) \ +{ gDma2p((pkt),G_MOVEMEM,(mptr),sizeof(Mtx),G_MV_MATRIX,0); \ + gMoveWd((pkt), G_MW_FORCEMTX,0,0x00010000); \ +} +#define gsSPForceMatrix(mptr) \ + gsDma2p(G_MOVEMEM,(mptr),sizeof(Mtx),G_MV_MATRIX,0), \ + gsMoveWd(G_MW_FORCEMTX,0,0x00010000) + +#else /* F3DEX_GBI_2 */ +#define gSPForceMatrix(pkt, mptr) \ +{ \ + gDma1p(pkt, G_MOVEMEM, mptr, 16, G_MV_MATRIX_1); \ + gDma1p(pkt, G_MOVEMEM, (char *)(mptr)+16, 16, G_MV_MATRIX_2); \ + gDma1p(pkt, G_MOVEMEM, (char *)(mptr)+32, 16, G_MV_MATRIX_3); \ + gDma1p(pkt, G_MOVEMEM, (char *)(mptr)+48, 16, G_MV_MATRIX_4); \ +} +#define gsSPForceMatrix(mptr) \ + gsDma1p( G_MOVEMEM, mptr, 16, G_MV_MATRIX_1), \ + gsDma1p( G_MOVEMEM, (char *)(mptr)+16, 16, G_MV_MATRIX_2), \ + gsDma1p( G_MOVEMEM, (char *)(mptr)+32, 16, G_MV_MATRIX_3), \ + gsDma1p( G_MOVEMEM, (char *)(mptr)+48, 16, G_MV_MATRIX_4) +#endif /* F3DEX_GBI_2 */ + +/* + * Insert values into Points + * + * point = point number 0-15 + * where = which element of point to modify (byte offset into point) + * num = new value (32 bit) + */ +#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)) +# define gSPModifyVertex(pkt, vtx, where, val) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = (_SHIFTL(G_MODIFYVTX,24,8)| \ + _SHIFTL((where),16,8)|_SHIFTL((vtx)*2,0,16)); \ + _g->words.w1 = (unsigned int)(val); \ +} +# define gsSPModifyVertex(vtx, where, val) \ +{{ \ + _SHIFTL(G_MODIFYVTX,24,8)| \ + _SHIFTL((where),16,8)|_SHIFTL((vtx)*2,0,16), \ + (unsigned int)(val) \ +}} +#else +# define gSPModifyVertex(pkt, vtx, where, val) \ + gMoveWd(pkt, G_MW_POINTS, (vtx)*40+(where), val) +# define gsSPModifyVertex(vtx, where, val) \ + gsMoveWd(G_MW_POINTS, (vtx)*40+(where), val) +#endif + +#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)) +/* + * gSPBranchLessZ Branch DL if (vtx.z) less than or equal (zval). + * + * dl = DL branch to + * vtx = Vertex + * zval = Screen depth + * near = Near plane + * far = Far plane + * flag = G_BZ_PERSP or G_BZ_ORTHO + */ + +#define G_BZ_PERSP 0 +#define G_BZ_ORTHO 1 + +#define G_DEPTOZSrg(zval, near, far, flag, zmin, zmax) \ +(((unsigned int)FTOFIX32(((flag) == G_BZ_PERSP ? \ + (1.0f-(float)(near)/(float)(zval)) / \ + (1.0f-(float)(near)/(float)(far )) : \ + ((float)(zval) - (float)(near)) / \ + ((float)(far ) - (float)(near))))) * \ + (((int)((zmax) - (zmin)))&~1) + (int)FTOFIX32(zmin)) + +#define G_DEPTOZS(zval, near, far, flag) \ + G_DEPTOZSrg(zval, near, far, flag, 0, G_MAXZ) + +#define gSPBranchLessZrg(pkt, dl, vtx, zval, near, far, flag, zmin, zmax) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \ + _g->words.w1 = (unsigned int)(dl); \ + _g = (Gfx *)(pkt); \ + _g->words.w0 = (_SHIFTL(G_BRANCH_Z,24,8)| \ + _SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12)); \ + _g->words.w1 = G_DEPTOZSrg(zval, near, far, flag, zmin, zmax); \ +} + +#define gsSPBranchLessZrg(dl, vtx, zval, near, far, flag, zmin, zmax) \ +{{ _SHIFTL(G_RDPHALF_1,24,8), \ + (unsigned int)(dl), }}, \ +{{ _SHIFTL(G_BRANCH_Z,24,8)|_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12),\ + G_DEPTOZSrg(zval, near, far, flag, zmin, zmax), }} + +#define gSPBranchLessZ(pkt, dl, vtx, zval, near, far, flag) \ + gSPBranchLessZrg(pkt, dl, vtx, zval, near, far, flag, 0, G_MAXZ) +#define gsSPBranchLessZ(dl, vtx, zval, near, far, flag) \ + gsSPBranchLessZrg(dl, vtx, zval, near, far, flag, 0, G_MAXZ) + +/* + * gSPBranchLessZraw Branch DL if (vtx.z) less than or equal (raw zval). + * + * dl = DL branch to + * vtx = Vertex + * zval = Raw value of screen depth + */ +#define gSPBranchLessZraw(pkt, dl, vtx, zval) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \ + _g->words.w1 = (unsigned int)(dl); \ + _g = (Gfx *)(pkt); \ + _g->words.w0 = (_SHIFTL(G_BRANCH_Z,24,8)| \ + _SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12)); \ + _g->words.w1 = (unsigned int)(zval); \ +} + +#define gsSPBranchLessZraw(dl, vtx, zval) \ +{{ _SHIFTL(G_RDPHALF_1,24,8), \ + (unsigned int)(dl), }}, \ +{{ _SHIFTL(G_BRANCH_Z,24,8)|_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12),\ + (unsigned int)(zval), }} + +/* + * gSPLoadUcode RSP loads specified ucode. + * + * uc_start = ucode text section start + * uc_dstart = ucode data section start + */ +#define gSPLoadUcodeEx(pkt, uc_start, uc_dstart, uc_dsize) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = _SHIFTL(G_RDPHALF_1,24,8); \ + _g->words.w1 = (unsigned int)(uc_dstart); \ + _g = (Gfx *)(pkt); \ + _g->words.w0 = (_SHIFTL(G_LOAD_UCODE,24,8)| \ + _SHIFTL((int)(uc_dsize)-1,0,16)); \ + _g->words.w1 = (unsigned int)(uc_start); \ +} + +#define gsSPLoadUcodeEx(uc_start, uc_dstart, uc_dsize) \ +{{ _SHIFTL(G_RDPHALF_1,24,8), \ + (unsigned int)(uc_dstart), }}, \ +{{ _SHIFTL(G_LOAD_UCODE,24,8)| \ + _SHIFTL((int)(uc_dsize)-1,0,16), \ + (unsigned int)(uc_start), }} + +#define gSPLoadUcode(pkt, uc_start, uc_dstart) \ + gSPLoadUcodeEx((pkt), (uc_start), (uc_dstart), SP_UCODE_DATA_SIZE) +#define gsSPLoadUcode(uc_start, uc_dstart) \ + gsSPLoadUcodeEx((uc_start), (uc_dstart), SP_UCODE_DATA_SIZE) + +#define gSPLoadUcodeL(pkt, ucode) \ + gSPLoadUcode((pkt), OS_K0_TO_PHYSICAL(&##ucode##TextStart), \ + OS_K0_TO_PHYSICAL(&##ucode##DataStart)) +#define gsSPLoadUcodeL(ucode) \ + gsSPLoadUcode(OS_K0_TO_PHYSICAL(&##ucode##TextStart), \ + OS_K0_TO_PHYSICAL(&##ucode##DataStart)) +#endif + +#ifdef F3DEX_GBI_2 +/* + * gSPDma_io DMA to/from DMEM/IMEM for DEBUG. + */ +#define gSPDma_io(pkt, flag, dmem, dram, size) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = _SHIFTL(G_DMA_IO,24,8)|_SHIFTL((flag),23,1)| \ + _SHIFTL((dmem)/8,13,10)|_SHIFTL((size)-1,0,12); \ + _g->words.w1 = (unsigned int)(dram); \ +} + +#define gsSPDma_io(flag, dmem, dram, size) \ +{{ \ + _SHIFTL(G_DMA_IO,24,8)|_SHIFTL((flag),23,1)| \ + _SHIFTL((dmem)/8,13,10)|_SHIFTL((size)-1,0,12), \ + (unsigned int)(dram) \ +}} + +#define gSPDmaRead(pkt,dmem,dram,size) gSPDma_io((pkt),0,(dmem),(dram),(size)) +#define gsSPDmaRead(dmem,dram,size) gsSPDma_io(0,(dmem),(dram),(size)) +#define gSPDmaWrite(pkt,dmem,dram,size) gSPDma_io((pkt),1,(dmem),(dram),(size)) +#define gsSPDmaWrite(dmem,dram,size) gsSPDma_io(1,(dmem),(dram),(size)) +#endif + +/* + * Lighting Macros + */ +#ifdef F3DEX_GBI_2 +# define NUML(n) ((n)*24) +#else +# define NUML(n) (((n)+1)*32 + 0x80000000) +#endif +#define NUMLIGHTS_0 1 +#define NUMLIGHTS_1 1 +#define NUMLIGHTS_2 2 +#define NUMLIGHTS_3 3 +#define NUMLIGHTS_4 4 +#define NUMLIGHTS_5 5 +#define NUMLIGHTS_6 6 +#define NUMLIGHTS_7 7 +/* + * n should be one of: NUMLIGHTS_0, NUMLIGHTS_1, ..., NUMLIGHTS_7 + * NOTE: in addition to the number of directional lights specified, + * there is always 1 ambient light + */ +#define gSPNumLights(pkt, n) \ + gMoveWd(pkt, G_MW_NUMLIGHT, G_MWO_NUMLIGHT, NUML(n)) +#define gsSPNumLights(n) \ + gsMoveWd( G_MW_NUMLIGHT, G_MWO_NUMLIGHT, NUML(n)) + +#define LIGHT_1 1 +#define LIGHT_2 2 +#define LIGHT_3 3 +#define LIGHT_4 4 +#define LIGHT_5 5 +#define LIGHT_6 6 +#define LIGHT_7 7 +#define LIGHT_8 8 +/* + * l should point to a Light struct + * n should be one of: LIGHT_1, LIGHT_2, ..., LIGHT_8 + * NOTE: the highest numbered light is always the ambient light (eg if there are + * 3 directional lights defined: gsSPNumLights(NUMLIGHTS_3), then lights + * LIGHT_1 through LIGHT_3 will be the directional lights and light + * LIGHT_4 will be the ambient light. + */ +#ifdef F3DEX_GBI_2 +# define gSPLight(pkt, l, n) \ + gDma2p((pkt),G_MOVEMEM,(l),sizeof(Light),G_MV_LIGHT,(n)*24+24) +# define gsSPLight(l, n) \ + gsDma2p( G_MOVEMEM,(l),sizeof(Light),G_MV_LIGHT,(n)*24+24) +#else /* F3DEX_GBI_2 */ +# define gSPLight(pkt, l, n) \ + gDma1p(pkt, G_MOVEMEM, l, sizeof(Light),((n)-1)*2+G_MV_L0) +# define gsSPLight(l, n) \ + gsDma1p( G_MOVEMEM, l, sizeof(Light),((n)-1)*2+G_MV_L0) +#endif /* F3DEX_GBI_2 */ + +/* + * gSPLightColor changes color of light without recalculating light direction + * col is a 32 bit word with r,g,b,a (alpha is ignored) + * n should be one of LIGHT_1, LIGHT_2, ..., LIGHT_8 + */ +#define gSPLightColor(pkt, n, col) \ +{ \ + gMoveWd(pkt, G_MW_LIGHTCOL, G_MWO_a##n, col); \ + gMoveWd(pkt, G_MW_LIGHTCOL, G_MWO_b##n, col); \ +} +#define gsSPLightColor(n, col) \ + gsMoveWd(G_MW_LIGHTCOL, G_MWO_a##n, col), \ + gsMoveWd(G_MW_LIGHTCOL, G_MWO_b##n, col) + +/* These macros use a structure "name" which is init'd with the gdSPDefLights macros*/ + +#define gSPSetLights0(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_0); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.a,2); \ +} +#define gsSPSetLights0(name) \ + gsSPNumLights(NUMLIGHTS_0), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.a,2) + +#define gSPSetLights1(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_1); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.a,2); \ +} +#define gsSPSetLights1(name) \ + gsSPNumLights(NUMLIGHTS_1), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.a,2) + +#define gSPSetLights2(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_2); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.l[1],2); \ + gSPLight(pkt,&name.a,3); \ +} +#define gsSPSetLights2(name) \ + gsSPNumLights(NUMLIGHTS_2), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.l[1],2), \ + gsSPLight(&name.a,3) + +#define gSPSetLights3(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_3); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.l[1],2); \ + gSPLight(pkt,&name.l[2],3); \ + gSPLight(pkt,&name.a,4); \ +} +#define gsSPSetLights3(name) \ + gsSPNumLights(NUMLIGHTS_3), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.l[1],2), \ + gsSPLight(&name.l[2],3), \ + gsSPLight(&name.a,4) + +#define gSPSetLights4(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_4); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.l[1],2); \ + gSPLight(pkt,&name.l[2],3); \ + gSPLight(pkt,&name.l[3],4); \ + gSPLight(pkt,&name.a,5); \ +} +#define gsSPSetLights4(name) \ + gsSPNumLights(NUMLIGHTS_4), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.l[1],2), \ + gsSPLight(&name.l[2],3), \ + gsSPLight(&name.l[3],4), \ + gsSPLight(&name.a,5) + +#define gSPSetLights5(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_5); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.l[1],2); \ + gSPLight(pkt,&name.l[2],3); \ + gSPLight(pkt,&name.l[3],4); \ + gSPLight(pkt,&name.l[4],5); \ + gSPLight(pkt,&name.a,6); \ +} + +#define gsSPSetLights5(name) \ + gsSPNumLights(NUMLIGHTS_5), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.l[1],2), \ + gsSPLight(&name.l[2],3), \ + gsSPLight(&name.l[3],4), \ + gsSPLight(&name.l[4],5), \ + gsSPLight(&name.a,6) + +#define gSPSetLights6(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_6); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.l[1],2); \ + gSPLight(pkt,&name.l[2],3); \ + gSPLight(pkt,&name.l[3],4); \ + gSPLight(pkt,&name.l[4],5); \ + gSPLight(pkt,&name.l[5],6); \ + gSPLight(pkt,&name.a,7); \ +} + +#define gsSPSetLights6(name) \ + gsSPNumLights(NUMLIGHTS_6), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.l[1],2), \ + gsSPLight(&name.l[2],3), \ + gsSPLight(&name.l[3],4), \ + gsSPLight(&name.l[4],5), \ + gsSPLight(&name.l[5],6), \ + gsSPLight(&name.a,7) + +#define gSPSetLights7(pkt,name) \ +{ \ + gSPNumLights(pkt,NUMLIGHTS_7); \ + gSPLight(pkt,&name.l[0],1); \ + gSPLight(pkt,&name.l[1],2); \ + gSPLight(pkt,&name.l[2],3); \ + gSPLight(pkt,&name.l[3],4); \ + gSPLight(pkt,&name.l[4],5); \ + gSPLight(pkt,&name.l[5],6); \ + gSPLight(pkt,&name.l[6],7); \ + gSPLight(pkt,&name.a,8); \ +} + +#define gsSPSetLights7(name) \ + gsSPNumLights(NUMLIGHTS_7), \ + gsSPLight(&name.l[0],1), \ + gsSPLight(&name.l[1],2), \ + gsSPLight(&name.l[2],3), \ + gsSPLight(&name.l[3],4), \ + gsSPLight(&name.l[4],5), \ + gsSPLight(&name.l[5],6), \ + gsSPLight(&name.l[6],7), \ + gsSPLight(&name.a,8) + +/* + * Reflection/Hiliting Macros + */ +#ifdef F3DEX_GBI_2 +# define gSPLookAtX(pkt, l) \ + gDma2p((pkt),G_MOVEMEM,(l),sizeof(Light),G_MV_LIGHT,G_MVO_LOOKATX) +# define gsSPLookAtX(l) \ + gsDma2p( G_MOVEMEM,(l),sizeof(Light),G_MV_LIGHT,G_MVO_LOOKATX) +# define gSPLookAtY(pkt, l) \ + gDma2p((pkt),G_MOVEMEM,(l),sizeof(Light),G_MV_LIGHT,G_MVO_LOOKATY) +# define gsSPLookAtY(l) \ + gsDma2p( G_MOVEMEM,(l),sizeof(Light),G_MV_LIGHT,G_MVO_LOOKATY) +#else /* F3DEX_GBI_2 */ +# define gSPLookAtX(pkt, l) \ + gDma1p(pkt, G_MOVEMEM, l, sizeof(Light),G_MV_LOOKATX) +# define gsSPLookAtX(l) \ + gsDma1p( G_MOVEMEM, l, sizeof(Light),G_MV_LOOKATX) +# define gSPLookAtY(pkt, l) \ + gDma1p(pkt, G_MOVEMEM, l, sizeof(Light),G_MV_LOOKATY) +# define gsSPLookAtY(l) \ + gsDma1p( G_MOVEMEM, l, sizeof(Light),G_MV_LOOKATY) +#endif /* F3DEX_GBI_2 */ + +#define gSPLookAt(pkt, la) \ +{ \ + gSPLookAtX(pkt,la) \ + gSPLookAtY(pkt,(char *)(la)+16) \ +} +#define gsSPLookAt(la) \ + gsSPLookAtX(la), \ + gsSPLookAtY((char *)(la)+16) + +#define gDPSetHilite1Tile(pkt, tile, hilite, width, height) \ + gDPSetTileSize(pkt, tile, (hilite)->h.x1 & 0xfff, (hilite)->h.y1 & 0xfff, \ + ((((width)-1)*4)+(hilite)->h.x1) & 0xfff, ((((height)-1)*4)+(hilite)->h.y1) & 0xfff) + +#define gDPSetHilite2Tile(pkt, tile, hilite, width, height) \ + gDPSetTileSize(pkt, tile, (hilite)->h.x2 & 0xfff, (hilite)->h.y2 & 0xfff, \ + ((((width)-1)*4)+(hilite)->h.x2) & 0xfff, ((((height)-1)*4)+(hilite)->h.y2) & 0xfff) + + +/* + * FOG macros + * fm = z multiplier + * fo = z offset + * FOG FORMULA: alpha(fog) = (eyespace z) * fm + fo CLAMPED 0 to 255 + * note: (eyespace z) ranges -1 to 1 + * + * Alternate method of setting fog: + * min, max: range 0 to 1000: 0=nearplane, 1000=farplane + * min is where fog begins (usually less than max and often 0) + * max is where fog is thickest (usually 1000) + * + */ +#define gSPFogFactor(pkt, fm, fo) \ + gMoveWd(pkt, G_MW_FOG, G_MWO_FOG, \ + (_SHIFTL(fm,16,16) | _SHIFTL(fo,0,16))) + +#define gsSPFogFactor(fm, fo) \ + gsMoveWd(G_MW_FOG, G_MWO_FOG, \ + (_SHIFTL(fm,16,16) | _SHIFTL(fo,0,16))) + +#define gSPFogPosition(pkt, min, max) \ + gMoveWd(pkt, G_MW_FOG, G_MWO_FOG, \ + (_SHIFTL((128000/((max)-(min))),16,16) | \ + _SHIFTL(((500-(min))*256/((max)-(min))),0,16))) + +#define gsSPFogPosition(min, max) \ + gsMoveWd(G_MW_FOG, G_MWO_FOG, \ + (_SHIFTL((128000/((max)-(min))),16,16) | \ + _SHIFTL(((500-(min))*256/((max)-(min))),0,16))) + +#ifdef F3DEX_GBI_2 +/* + * Macros to turn texture on/off + */ +# define gSPTexture(pkt, s, t, level, tile, on) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXTURE,24,8) | \ + _SHIFTL(BOWTIE_VAL,16,8) | \ + _SHIFTL((level),11,3) | _SHIFTL((tile),8,3) | \ + _SHIFTL((on),1,7)); \ + _g->words.w1 = (_SHIFTL((s),16,16) | _SHIFTL((t),0,16)); \ +} +# define gsSPTexture(s, t, level, tile, on) \ +{{ \ + (_SHIFTL(G_TEXTURE,24,8) | _SHIFTL(BOWTIE_VAL,16,8) | \ + _SHIFTL((level),11,3) | _SHIFTL((tile),8,3) | _SHIFTL((on),1,7)),\ + (_SHIFTL((s),16,16) | _SHIFTL((t),0,16)) \ +}} +/* + * Different version of SPTexture macro, has an additional parameter + * which is currently reserved in the microcode. + */ +# define gSPTextureL(pkt, s, t, level, xparam, tile, on) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXTURE,24,8) | \ + _SHIFTL((xparam),16,8) | \ + _SHIFTL((level),11,3) | _SHIFTL((tile),8,3) | \ + _SHIFTL((on),1,7)); \ + _g->words.w1 = (_SHIFTL((s),16,16) | _SHIFTL((t),0,16)); \ +} +# define gsSPTextureL(s, t, level, xparam, tile, on) \ +{{ \ + (_SHIFTL(G_TEXTURE,24,8) | _SHIFTL((xparam),16,8) | \ + _SHIFTL((level),11,3) | _SHIFTL((tile),8,3) | _SHIFTL((on),1,7)),\ + (_SHIFTL((s),16,16) | _SHIFTL((t),0,16)) \ +}} +#else +/* + * Macros to turn texture on/off + */ +# define gSPTexture(pkt, s, t, level, tile, on) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXTURE,24,8)|_SHIFTL(BOWTIE_VAL,16,8)|\ + _SHIFTL((level),11,3)|_SHIFTL((tile),8,3)| \ + _SHIFTL((on),0,8)); \ + _g->words.w1 = (_SHIFTL((s),16,16)|_SHIFTL((t),0,16)); \ +} +# define gsSPTexture(s, t, level, tile, on) \ +{{ \ + (_SHIFTL(G_TEXTURE,24,8)|_SHIFTL(BOWTIE_VAL,16,8)| \ + _SHIFTL((level),11,3)|_SHIFTL((tile),8,3)|_SHIFTL((on),0,8)), \ + (_SHIFTL((s),16,16)|_SHIFTL((t),0,16)) \ +}} +/* + * Different version of SPTexture macro, has an additional parameter + * which is currently reserved in the microcode. + */ +# define gSPTextureL(pkt, s, t, level, xparam, tile, on) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXTURE,24,8)|_SHIFTL((xparam),16,8)| \ + _SHIFTL((level),11,3)|_SHIFTL((tile),8,3)| \ + _SHIFTL((on),0,8)); \ + _g->words.w1 = (_SHIFTL((s),16,16)|_SHIFTL((t),0,16)); \ +} +# define gsSPTextureL(s, t, level, xparam, tile, on) \ +{{ \ + (_SHIFTL(G_TEXTURE,24,8)|_SHIFTL((xparam),16,8)| \ + _SHIFTL((level),11,3)|_SHIFTL((tile),8,3)|_SHIFTL((on),0,8)), \ + (_SHIFTL((s),16,16)|_SHIFTL((t),0,16)) \ +}} +#endif + +#define gSPPerspNormalize(pkt, s) gMoveWd(pkt, G_MW_PERSPNORM, 0, (s)) +#define gsSPPerspNormalize(s) gsMoveWd( G_MW_PERSPNORM, 0, (s)) + +#ifdef F3DEX_GBI_2 +# define gSPPopMatrixN(pkt, n, num) gDma2p((pkt),G_POPMTX,(num)*64,64,2,0) +# define gsSPPopMatrixN(n, num) gsDma2p( G_POPMTX,(num)*64,64,2,0) +# define gSPPopMatrix(pkt, n) gSPPopMatrixN((pkt), (n), 1) +# define gsSPPopMatrix(n) gsSPPopMatrixN( (n), 1) +#else /* F3DEX_GBI_2 */ +# define gSPPopMatrix(pkt, n) gImmp1(pkt, G_POPMTX, n) +# define gsSPPopMatrix(n) gsImmp1( G_POPMTX, n) +#endif /* F3DEX_GBI_2 */ + +#define gSPEndDisplayList(pkt) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_ENDDL, 24, 8); \ + _g->words.w1 = 0; \ +} + +#define gsSPEndDisplayList() \ +{{ \ + _SHIFTL(G_ENDDL, 24, 8), 0 \ +}} + +#ifdef F3DEX_GBI_2 +/* + * One gSPGeometryMode(pkt,c,s) GBI is equal to these two GBIs. + * + * gSPClearGeometryMode(pkt,c) + * gSPSetGeometryMode(pkt,s) + * + * gSPLoadGeometryMode(pkt, word) sets GeometryMode directly. + */ +#define gSPGeometryMode(pkt, c, s) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = _SHIFTL(G_GEOMETRYMODE,24,8)|_SHIFTL(~(u32)(c),0,24);\ + _g->words.w1 = (u32)(s); \ +} + +#define gsSPGeometryMode(c, s) \ +{{ \ + (_SHIFTL(G_GEOMETRYMODE,24,8)|_SHIFTL(~(u32)(c),0,24)),(u32)(s) \ +}} +#define gSPSetGeometryMode(pkt, word) gSPGeometryMode((pkt),0,(word)) +#define gsSPSetGeometryMode(word) gsSPGeometryMode(0,(word)) +#define gSPClearGeometryMode(pkt, word) gSPGeometryMode((pkt),(word),0) +#define gsSPClearGeometryMode(word) gsSPGeometryMode((word),0) +#define gSPLoadGeometryMode(pkt, word) gSPGeometryMode((pkt),-1,(word)) +#define gsSPLoadGeometryMode(word) gsSPGeometryMode(-1,(word)) + +#else /* F3DEX_GBI_2 */ +#define gSPSetGeometryMode(pkt, word) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_SETGEOMETRYMODE, 24, 8); \ + _g->words.w1 = (unsigned int)(word); \ +} + +#define gsSPSetGeometryMode(word) \ +{{ \ + _SHIFTL(G_SETGEOMETRYMODE, 24, 8), (unsigned int)(word) \ +}} + +#define gSPClearGeometryMode(pkt, word) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_CLEARGEOMETRYMODE, 24, 8); \ + _g->words.w1 = (unsigned int)(word); \ +} + +#define gsSPClearGeometryMode(word) \ +{{ \ + _SHIFTL(G_CLEARGEOMETRYMODE, 24, 8), (unsigned int)(word) \ +}} +#endif /* F3DEX_GBI_2 */ + +#ifdef F3DEX_GBI_2 +#define gSPSetOtherMode(pkt, cmd, sft, len, data) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + _g->words.w0 = (_SHIFTL(cmd,24,8)|_SHIFTL(32-(sft)-(len),8,8)| \ + _SHIFTL((len)-1,0,8)); \ + _g->words.w1 = (unsigned int)(data); \ +} + +#define gsSPSetOtherMode(cmd, sft, len, data) \ +{{ \ + _SHIFTL(cmd,24,8)|_SHIFTL(32-(sft)-(len),8,8)|_SHIFTL((len)-1,0,8), \ + (unsigned int)(data) \ +}} +#else +#define gSPSetOtherMode(pkt, cmd, sft, len, data) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(cmd, 24, 8) | _SHIFTL(sft, 8, 8) | \ + _SHIFTL(len, 0, 8)); \ + _g->words.w1 = (unsigned int)(data); \ +} + +#define gsSPSetOtherMode(cmd, sft, len, data) \ +{{ \ + _SHIFTL(cmd, 24, 8) | _SHIFTL(sft, 8, 8) | _SHIFTL(len, 0, 8), \ + (unsigned int)(data) \ +}} +#endif + +/* + * RDP setothermode register commands - register shadowed in RSP + */ +#define gDPPipelineMode(pkt, mode) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_PIPELINE, 1, mode) +#define gsDPPipelineMode(mode) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_PIPELINE, 1, mode) + +#define gDPSetCycleType(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_CYCLETYPE, 2, type) +#define gsDPSetCycleType(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_CYCLETYPE, 2, type) + +#define gDPSetTexturePersp(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTPERSP, 1, type) +#define gsDPSetTexturePersp(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTPERSP, 1, type) + +#define gDPSetTextureDetail(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTDETAIL, 2, type) +#define gsDPSetTextureDetail(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTDETAIL, 2, type) + +#define gDPSetTextureLOD(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTLOD, 1, type) +#define gsDPSetTextureLOD(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTLOD, 1, type) + +#define gDPSetTextureLUT(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTLUT, 2, type) +#define gsDPSetTextureLUT(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTLUT, 2, type) + +#define gDPSetTextureFilter(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTFILT, 2, type) +#define gsDPSetTextureFilter(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTFILT, 2, type) + +#define gDPSetTextureConvert(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_TEXTCONV, 3, type) +#define gsDPSetTextureConvert(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_TEXTCONV, 3, type) + +#define gDPSetCombineKey(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_COMBKEY, 1, type) +#define gsDPSetCombineKey(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_COMBKEY, 1, type) + +#ifndef _HW_VERSION_1 +#define gDPSetColorDither(pkt, mode) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_RGBDITHER, 2, mode) +#define gsDPSetColorDither(mode) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_RGBDITHER, 2, mode) +#else +#define gDPSetColorDither(pkt, mode) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_COLORDITHER, 1, mode) +#define gsDPSetColorDither(mode) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_COLORDITHER, 1, mode) +#endif + +#ifndef _HW_VERSION_1 +#define gDPSetAlphaDither(pkt, mode) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 2, mode) +#define gsDPSetAlphaDither(mode) \ + gsSPSetOtherMode(G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 2, mode) +#endif + +/* 'blendmask' is not supported anymore. + * The bits are reserved for future use. + * Fri May 26 13:45:55 PDT 1995 + */ +#define gDPSetBlendMask(pkt, mask) gDPNoOp(pkt) +#define gsDPSetBlendMask(mask) gsDPNoOp() + +#define gDPSetAlphaCompare(pkt, type) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_L, G_MDSFT_ALPHACOMPARE, 2, type) +#define gsDPSetAlphaCompare(type) \ + gsSPSetOtherMode(G_SETOTHERMODE_L, G_MDSFT_ALPHACOMPARE, 2, type) + +#define gDPSetDepthSource(pkt, src) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_L, G_MDSFT_ZSRCSEL, 1, src) +#define gsDPSetDepthSource(src) \ + gsSPSetOtherMode(G_SETOTHERMODE_L, G_MDSFT_ZSRCSEL, 1, src) + +#define gDPSetRenderMode(pkt, c0, c1) \ + gSPSetOtherMode(pkt, G_SETOTHERMODE_L, G_MDSFT_RENDERMODE, 29, \ + (c0) | (c1)) +#define gsDPSetRenderMode(c0, c1) \ + gsSPSetOtherMode(G_SETOTHERMODE_L, G_MDSFT_RENDERMODE, 29, \ + (c0) | (c1)) + +#define gSetImage(pkt, cmd, fmt, siz, width, i) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(cmd, 24, 8) | _SHIFTL(fmt, 21, 3) | \ + _SHIFTL(siz, 19, 2) | _SHIFTL((width)-1, 0, 12); \ + _g->words.w1 = (unsigned int)(i); \ +} + +#define gsSetImage(cmd, fmt, siz, width, i) \ +{{ \ + _SHIFTL(cmd, 24, 8) | _SHIFTL(fmt, 21, 3) | \ + _SHIFTL(siz, 19, 2) | _SHIFTL((width)-1, 0, 12), \ + (unsigned int)(i) \ +}} + +#define gDPSetColorImage(pkt, f, s, w, i) gSetImage(pkt, G_SETCIMG, f, s, w, i) +#define gsDPSetColorImage(f, s, w, i) gsSetImage(G_SETCIMG, f, s, w, i) + + +/* use these for new code */ +#define gDPSetDepthImage(pkt, i) gSetImage(pkt, G_SETZIMG, 0, 0, 1, i) +#define gsDPSetDepthImage(i) gsSetImage(G_SETZIMG, 0, 0, 1, i) +/* kept for compatibility */ +#define gDPSetMaskImage(pkt, i) gDPSetDepthImage(pkt, i) +#define gsDPSetMaskImage(i) gsDPSetDepthImage(i) + +#define gDPSetTextureImage(pkt, f, s, w, i) gSetImage(pkt, G_SETTIMG, f, s, w, i) +#define gsDPSetTextureImage(f, s, w, i) gsSetImage(G_SETTIMG, f, s, w, i) + +/* + * RDP macros + */ + +#define gDPSetCombine(pkt, muxs0, muxs1) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_SETCOMBINE, 24, 8) | _SHIFTL(muxs0, 0, 24);\ + _g->words.w1 = (unsigned int)(muxs1); \ +} + +#define gsDPSetCombine(muxs0, muxs1) \ +{{ \ + _SHIFTL(G_SETCOMBINE, 24, 8) | _SHIFTL(muxs0, 0, 24), \ + (unsigned int)(muxs1) \ +}} + +#define GCCc0w0(saRGB0, mRGB0, saA0, mA0) \ + (_SHIFTL((saRGB0), 20, 4) | _SHIFTL((mRGB0), 15, 5) | \ + _SHIFTL((saA0), 12, 3) | _SHIFTL((mA0), 9, 3)) + +#define GCCc1w0(saRGB1, mRGB1) \ + (_SHIFTL((saRGB1), 5, 4) | _SHIFTL((mRGB1), 0, 5)) + +#define GCCc0w1(sbRGB0, aRGB0, sbA0, aA0) \ + (_SHIFTL((sbRGB0), 28, 4) | _SHIFTL((aRGB0), 15, 3) | \ + _SHIFTL((sbA0), 12, 3) | _SHIFTL((aA0), 9, 3)) + +#define GCCc1w1(sbRGB1, saA1, mA1, aRGB1, sbA1, aA1) \ + (_SHIFTL((sbRGB1), 24, 4) | _SHIFTL((saA1), 21, 3) | \ + _SHIFTL((mA1), 18, 3) | _SHIFTL((aRGB1), 6, 3) | \ + _SHIFTL((sbA1), 3, 3) | _SHIFTL((aA1), 0, 3)) + +#define gDPSetCombineLERP(pkt, a0, b0, c0, d0, Aa0, Ab0, Ac0, Ad0, \ + a1, b1, c1, d1, Aa1, Ab1, Ac1, Ad1) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_SETCOMBINE, 24, 8) | \ + _SHIFTL(GCCc0w0(G_CCMUX_##a0, G_CCMUX_##c0, \ + G_ACMUX_##Aa0, G_ACMUX_##Ac0) | \ + GCCc1w0(G_CCMUX_##a1, G_CCMUX_##c1), \ + 0, 24); \ + _g->words.w1 = (unsigned int)(GCCc0w1(G_CCMUX_##b0, \ + G_CCMUX_##d0, \ + G_ACMUX_##Ab0, \ + G_ACMUX_##Ad0) | \ + GCCc1w1(G_CCMUX_##b1, \ + G_ACMUX_##Aa1, \ + G_ACMUX_##Ac1, \ + G_CCMUX_##d1, \ + G_ACMUX_##Ab1, \ + G_ACMUX_##Ad1)); \ +} + +#define gsDPSetCombineLERP(a0, b0, c0, d0, Aa0, Ab0, Ac0, Ad0, \ + a1, b1, c1, d1, Aa1, Ab1, Ac1, Ad1) \ +{{ \ + _SHIFTL(G_SETCOMBINE, 24, 8) | \ + _SHIFTL(GCCc0w0(G_CCMUX_##a0, G_CCMUX_##c0, \ + G_ACMUX_##Aa0, G_ACMUX_##Ac0) | \ + GCCc1w0(G_CCMUX_##a1, G_CCMUX_##c1), 0, 24), \ + (unsigned int)(GCCc0w1(G_CCMUX_##b0, G_CCMUX_##d0, \ + G_ACMUX_##Ab0, G_ACMUX_##Ad0) | \ + GCCc1w1(G_CCMUX_##b1, G_ACMUX_##Aa1, \ + G_ACMUX_##Ac1, G_CCMUX_##d1, \ + G_ACMUX_##Ab1, G_ACMUX_##Ad1)) \ +}} + +/* + * SetCombineMode macros are NOT redunant. It allow the C preprocessor + * to substitute single parameter which includes commas in the token and + * rescan for higher parameter count macro substitution. + * + * eg. gsDPSetCombineMode(G_CC_MODULATE, G_CC_MODULATE) turns into + * gsDPSetCombineLERP(TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0, + * TEXEL0, 0, SHADE, 0, TEXEL0, 0, SHADE, 0) + */ + +#define gDPSetCombineMode(pkt, a, b) gDPSetCombineLERP(pkt, a, b) +#define gsDPSetCombineMode(a, b) gsDPSetCombineLERP(a, b) + +#define gDPSetColor(pkt, c, d) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(c, 24, 8); \ + _g->words.w1 = (unsigned int)(d); \ +} + +#define gsDPSetColor(c, d) \ +{{ \ + _SHIFTL(c, 24, 8), (unsigned int)(d) \ +}} + +#define DPRGBColor(pkt, cmd, r, g, b, a) \ + gDPSetColor(pkt, cmd, \ + (_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | \ + _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8))) +#define sDPRGBColor(cmd, r, g, b, a) \ + gsDPSetColor(cmd, \ + (_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | \ + _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8))) + +#define gDPSetEnvColor(pkt, r, g, b, a) \ + DPRGBColor(pkt, G_SETENVCOLOR, r,g,b,a) +#define gsDPSetEnvColor(r, g, b, a) \ + sDPRGBColor(G_SETENVCOLOR, r,g,b,a) +#define gDPSetBlendColor(pkt, r, g, b, a) \ + DPRGBColor(pkt, G_SETBLENDCOLOR, r,g,b,a) +#define gsDPSetBlendColor(r, g, b, a) \ + sDPRGBColor(G_SETBLENDCOLOR, r,g,b,a) +#define gDPSetFogColor(pkt, r, g, b, a) \ + DPRGBColor(pkt, G_SETFOGCOLOR, r,g,b,a) +#define gsDPSetFogColor(r, g, b, a) \ + sDPRGBColor(G_SETFOGCOLOR, r,g,b,a) +#define gDPSetFillColor(pkt, d) \ + gDPSetColor(pkt, G_SETFILLCOLOR, (d)) +#define gsDPSetFillColor(d) \ + gsDPSetColor(G_SETFILLCOLOR, (d)) + +#define gDPSetPrimDepth(pkt, z, dz) \ + gDPSetColor(pkt, G_SETPRIMDEPTH, \ + _SHIFTL(z, 16, 16) | _SHIFTL(dz, 0, 16)) +#define gsDPSetPrimDepth(z, dz) \ + gsDPSetColor(G_SETPRIMDEPTH, _SHIFTL(z, 16, 16) | \ + _SHIFTL(dz, 0, 16)) + +#define gDPSetPrimColor(pkt, m, l, r, g, b, a) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | \ + _SHIFTL(m, 8, 8) | _SHIFTL(l, 0, 8)); \ + _g->words.w1 = (_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | \ + _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8)); \ +} + +#define gsDPSetPrimColor(m, l, r, g, b, a) \ +{{ \ + (_SHIFTL(G_SETPRIMCOLOR, 24, 8) | _SHIFTL(m, 8, 8) | \ + _SHIFTL(l, 0, 8)), \ + (_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | _SHIFTL(b, 8, 8) | \ + _SHIFTL(a, 0, 8)) \ +}} + +/* + * gDPSetOtherMode (This is for expert user.) + * + * This command makes all othermode parameters set. + * Do not use this command in the same DL with another g*SPSetOtherMode DLs. + * + * [Usage] + * gDPSetOtherMode(pkt, modeA, modeB) + * + * 'modeA' is described all parameters of GroupA GBI command. + * 'modeB' is also described all parameters of GroupB GBI command. + * + * GroupA: + * gDPPipelineMode, gDPSetCycleType, gSPSetTexturePersp, + * gDPSetTextureDetail, gDPSetTextureLOD, gDPSetTextureLUT, + * gDPSetTextureFilter, gDPSetTextureConvert, gDPSetCombineKey, + * gDPSetColorDither, gDPSetAlphaDither + * + * GroupB: + * gDPSetAlphaCompare, gDPSetDepthSource, gDPSetRenderMode + * + * Use 'OR' operation to get modeA and modeB. + * + * modeA = G_PM_* | G_CYC_* | G_TP_* | G_TD_* | G_TL_* | G_TT_* | G_TF_* + * G_TC_* | G_CK_* | G_CD_* | G_AD_*; + * + * modeB = G_AC_* | G_ZS_* | G_RM_* | G_RM_*2; + */ +#define gDPSetOtherMode(pkt, mode0, mode1) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_RDPSETOTHERMODE,24,8)|_SHIFTL(mode0,0,24);\ + _g->words.w1 = (unsigned int)(mode1); \ +} + +#define gsDPSetOtherMode(mode0, mode1) \ +{{ \ + _SHIFTL(G_RDPSETOTHERMODE,24,8)|_SHIFTL(mode0,0,24), \ + (unsigned int)(mode1) \ +}} + +/* + * Texturing macros + */ + +/* These are also defined defined above for Sprite Microcode */ + +#define G_TX_LOADTILE 7 +#define G_TX_RENDERTILE 0 + +#define G_TX_NOMIRROR 0 +#define G_TX_WRAP 0 +#define G_TX_MIRROR 0x1 +#define G_TX_CLAMP 0x2 +#define G_TX_NOMASK 0 +#define G_TX_NOLOD 0 + + +#ifndef MAX +#define MAX(a, b) ((a) > (b) ? (a) : (b)) +#endif + +#ifndef MIN +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif +/* + * Dxt is the inverse of the number of 64-bit words in a line of + * the texture being loaded using the load_block command. If + * there are any 1's to the right of the 11th fractional bit, + * dxt should be rounded up. The following macros accomplish + * this. The 4b macros are a special case since 4-bit textures + * are loaded as 8-bit textures. Dxt is fixed point 1.11. RJM + */ +#define G_TX_DXT_FRAC 11 + +/* + * For RCP 2.0, the maximum number of texels that can be loaded + * using a load_block command is 2048. In order to load the total + * 4kB of Tmem, change the texel size when loading to be G_IM_SIZ_16b, + * then change the tile to the proper texel size after the load. + * The g*DPLoadTextureBlock macros already do this, so this change + * will be transparent if you use these macros. If you use + * the g*DPLoadBlock macros directly, you will need to handle this + * tile manipulation yourself. RJM. + */ +#ifdef _HW_VERSION_1 +#define G_TX_LDBLK_MAX_TXL 4095 +#else +#define G_TX_LDBLK_MAX_TXL 2047 +#endif /* _HW_VERSION_1 */ + +#define TXL2WORDS(txls, b_txl) MAX(1, ((txls)*(b_txl)/8)) +#define CALC_DXT(width, b_txl) \ + (((1 << G_TX_DXT_FRAC) + TXL2WORDS(width, b_txl) - 1) / \ + TXL2WORDS(width, b_txl)) + +#define TXL2WORDS_4b(txls) MAX(1, ((txls)/16)) +#define CALC_DXT_4b(width) \ + (((1 << G_TX_DXT_FRAC) + TXL2WORDS_4b(width) - 1) / \ + TXL2WORDS_4b(width)) + +#define gDPLoadTileGeneric(pkt, c, tile, uls, ult, lrs, lrt) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(c, 24, 8) | _SHIFTL(uls, 12, 12) | \ + _SHIFTL(ult, 0, 12); \ + _g->words.w1 = _SHIFTL(tile, 24, 3) | _SHIFTL(lrs, 12, 12) | \ + _SHIFTL(lrt, 0, 12); \ +} + +#define gsDPLoadTileGeneric(c, tile, uls, ult, lrs, lrt) \ +{{ \ + _SHIFTL(c, 24, 8) | _SHIFTL(uls, 12, 12) | _SHIFTL(ult, 0, 12), \ + _SHIFTL(tile, 24, 3) | _SHIFTL(lrs, 12, 12) | _SHIFTL(lrt, 0, 12)\ +}} + +#define gDPSetTileSize(pkt, t, uls, ult, lrs, lrt) \ + gDPLoadTileGeneric(pkt, G_SETTILESIZE, t, uls, ult, lrs, lrt) +#define gsDPSetTileSize(t, uls, ult, lrs, lrt) \ + gsDPLoadTileGeneric(G_SETTILESIZE, t, uls, ult, lrs, lrt) +#define gDPLoadTile(pkt, t, uls, ult, lrs, lrt) \ + gDPLoadTileGeneric(pkt, G_LOADTILE, t, uls, ult, lrs, lrt) +#define gsDPLoadTile(t, uls, ult, lrs, lrt) \ + gsDPLoadTileGeneric(G_LOADTILE, t, uls, ult, lrs, lrt) + +#define gDPSetTile(pkt, fmt, siz, line, tmem, tile, palette, cmt, \ + maskt, shiftt, cms, masks, shifts) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_SETTILE, 24, 8) | _SHIFTL(fmt, 21, 3) |\ + _SHIFTL(siz, 19, 2) | _SHIFTL(line, 9, 9) | \ + _SHIFTL(tmem, 0, 9); \ + _g->words.w1 = _SHIFTL(tile, 24, 3) | _SHIFTL(palette, 20, 4) | \ + _SHIFTL(cmt, 18, 2) | _SHIFTL(maskt, 14, 4) | \ + _SHIFTL(shiftt, 10, 4) |_SHIFTL(cms, 8, 2) | \ + _SHIFTL(masks, 4, 4) | _SHIFTL(shifts, 0, 4); \ +} + +#define gsDPSetTile(fmt, siz, line, tmem, tile, palette, cmt, \ + maskt, shiftt, cms, masks, shifts) \ +{{ \ + (_SHIFTL(G_SETTILE, 24, 8) | _SHIFTL(fmt, 21, 3) | \ + _SHIFTL(siz, 19, 2) | _SHIFTL(line, 9, 9) | _SHIFTL(tmem, 0, 9)),\ + (_SHIFTL(tile, 24, 3) | _SHIFTL(palette, 20, 4) | \ + _SHIFTL(cmt, 18, 2) | _SHIFTL(maskt, 14, 4) | \ + _SHIFTL(shiftt, 10, 4) | _SHIFTL(cms, 8, 2) | \ + _SHIFTL(masks, 4, 4) | _SHIFTL(shifts, 0, 4)) \ +}} + +/* + * For RCP 2.0, the maximum number of texels that can be loaded + * using a load_block command is 2048. In order to load the total + * 4kB of Tmem, change the texel size when loading to be G_IM_SIZ_16b, + * then change the tile to the proper texel size after the load. + * The g*DPLoadTextureBlock macros already do this, so this change + * will be transparent if you use these macros. If you use + * the g*DPLoadBlock macros directly, you will need to handle this + * tile manipulation yourself. RJM. + */ +#define gDPLoadBlock(pkt, tile, uls, ult, lrs, dxt) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_LOADBLOCK, 24, 8) | \ + _SHIFTL(uls, 12, 12) | _SHIFTL(ult, 0, 12)); \ + _g->words.w1 = (_SHIFTL(tile, 24, 3) | \ + _SHIFTL((MIN(lrs,G_TX_LDBLK_MAX_TXL)), 12, 12) |\ + _SHIFTL(dxt, 0, 12)); \ +} + +#define gsDPLoadBlock(tile, uls, ult, lrs, dxt) \ +{{ \ + (_SHIFTL(G_LOADBLOCK, 24, 8) | _SHIFTL(uls, 12, 12) | \ + _SHIFTL(ult, 0, 12)), \ + (_SHIFTL(tile, 24, 3) | \ + _SHIFTL((MIN(lrs,G_TX_LDBLK_MAX_TXL)), 12, 12) | \ + _SHIFTL(dxt, 0, 12)) \ +}} + +#define gDPLoadTLUTCmd(pkt, tile, count) \ +{ \ + Gfx *_g = (Gfx *)pkt; \ + \ + _g->words.w0 = _SHIFTL(G_LOADTLUT, 24, 8); \ + _g->words.w1 = _SHIFTL((tile), 24, 3) | _SHIFTL((count), 14, 10);\ +} + +#define gsDPLoadTLUTCmd(tile, count) \ +{{ \ + _SHIFTL(G_LOADTLUT, 24, 8), \ + _SHIFTL((tile), 24, 3) | _SHIFTL((count), 14, 10) \ +}} + +#define gDPLoadTextureBlock(pkt, timg, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT) -1, \ + CALC_DXT(width, siz##_BYTES)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, \ + (((width) * siz##_LINE_BYTES)+7)>>3, 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +#define gDPLoadTextureBlockYuv(pkt, timg, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT) -1, \ + CALC_DXT(width, siz##_BYTES)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, \ + (((width) * 1)+7)>>3, 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* Load fix rww 27jun95 */ +/* The S at the end means odd lines are already word Swapped */ + +#define gDPLoadTextureBlockS(pkt, timg, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1,0); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, \ + (((width) * siz##_LINE_BYTES)+7)>>3, 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* + * Allow tmem address and render tile to be specified. + * The S at the end means odd lines are already word Swapped + */ +#define gDPLoadMultiBlockS(pkt, timg, tmem, rtile, fmt, siz, width, \ + height, pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1,0); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, \ + (((width) * siz##_LINE_BYTES)+7)>>3, tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + + +#define gDPLoadTextureBlockYuvS(pkt, timg, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1,0); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, \ + (((width) * 1)+7)>>3, 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* + * allows tmem address to be specified + */ +#define _gDPLoadTextureBlock(pkt, timg, tmem, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \ + 0, cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, (((width) * siz##_LINE_BYTES)+7)>>3, \ + tmem, G_TX_RENDERTILE, pal, cmt, \ + maskt, shiftt, cms, masks, shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* + * allows tmem address and render tile to be specified + */ +#define _gDPLoadTextureBlockTile(pkt, timg, tmem, rtile, fmt, siz, width, \ + height, pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, 0,\ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, (((width) * siz##_LINE_BYTES)+7)>>3, \ + tmem, rtile, pal, cmt, \ + maskt, shiftt, cms, masks, shifts); \ + gDPSetTileSize(pkt, rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* + * allows tmem address and render tile to be specified + */ +#define gDPLoadMultiBlock(pkt, timg, tmem, rtile, fmt, siz, width, \ + height, pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, 0,\ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, (((width) * siz##_LINE_BYTES)+7)>>3, \ + tmem, rtile, pal, cmt, \ + maskt, shiftt, cms, masks, shifts); \ + gDPSetTileSize(pkt, rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +#define gsDPLoadTextureBlock(timg, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \ + gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, 0, \ + G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, \ + masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, siz, ((((width) * siz##_LINE_BYTES)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + +/* Here is the static form of the pre-swapped texture block loading */ +/* See gDPLoadTextureBlockS() for reference. Basically, just don't + calculate DxT, use 0 */ + +#define gsDPLoadTextureBlockS(timg, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \ + gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, 0, G_TX_LOADTILE, 0 , \ + cmt, maskt,shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, 0 ),\ + gsDPPipeSync(), \ + gsDPSetTile(fmt, siz, ((((width) * siz##_LINE_BYTES)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + +/* + * Allow tmem address to be specified + */ +#define _gsDPLoadTextureBlock(timg, tmem, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \ + gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, siz, \ + ((((width) * siz##_LINE_BYTES)+7)>>3), tmem, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + + +/* + * Allow tmem address and render_tile to be specified + */ +#define _gsDPLoadTextureBlockTile(timg, tmem, rtile, fmt, siz, width, \ + height, pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \ + gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, siz, \ + ((((width) * siz##_LINE_BYTES)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + + +/* + * Allow tmem address and render_tile to be specified, useful when loading + * mutilple tiles at a time. + */ +#define gsDPLoadMultiBlock(timg, tmem, rtile, fmt, siz, width, \ + height, pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \ + gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, \ + 0 , cmt, maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, siz, \ + ((((width) * siz##_LINE_BYTES)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + +/* + * Allows tmem and render tile to be specified. Useful when loading + * several tiles at a time. + * + * Here is the static form of the pre-swapped texture block loading + * See gDPLoadTextureBlockS() for reference. Basically, just don't + * calculate DxT, use 0 + */ + +#define gsDPLoadMultiBlockS(timg, tmem, rtile, fmt, siz, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, siz##_LOAD_BLOCK, 1, timg), \ + gsDPSetTile(fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, 0 , \ + cmt, maskt,shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, 0 ),\ + gsDPPipeSync(), \ + gsDPSetTile(fmt, siz, ((((width) * siz##_LINE_BYTES)+7)>>3), tmem,\ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + + +#define gDPLoadTextureBlock_4b(pkt, timg, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, \ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height)+3)>>2)-1, \ + CALC_DXT_4b(width)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* Load fix rww 27jun95 */ +/* The S at the end means odd lines are already word Swapped */ + +#define gDPLoadTextureBlock_4bS(pkt, timg, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, \ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height)+3)>>2)-1, 0 ); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* + * 4-bit load block. Useful when loading multiple tiles + */ +#define gDPLoadMultiBlock_4b(pkt, timg, tmem, rtile, fmt, width, height,\ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0, \ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height)+3)>>2)-1, \ + CALC_DXT_4b(width)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +/* + * 4-bit load block. Allows tmem and render tile to be specified. Useful when + * loading multiple tiles. The S means odd lines are already word swapped. + */ +#define gDPLoadMultiBlock_4bS(pkt, timg, tmem, rtile, fmt, width, height,\ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0, \ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height)+3)>>2)-1, 0 ); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + + +#define _gDPLoadTextureBlock_4b(pkt, timg, tmem, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, G_IM_SIZ_16b, 1, timg); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0, \ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height)+3)>>2)-1, \ + CALC_DXT_4b(width)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) \ +} + +#define gsDPLoadTextureBlock_4b(timg, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \ + gsDPSetTile(fmt, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0 , cmt, \ + maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1, \ + CALC_DXT_4b(width)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + +#define gsDPLoadTextureBlock_4bS(timg, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \ + gsDPSetTile(fmt, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0 , cmt, \ + maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1,0),\ + gsDPPipeSync(), \ + gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + +/* + * 4-bit load block. Allows tmem address and render tile to be specified. + * Useful when loading multiple tiles. + */ +#define gsDPLoadMultiBlock_4b(timg, tmem, rtile, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \ + gsDPSetTile(fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0 , cmt, \ + maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1, \ + CALC_DXT_4b(width)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + + +/* + * 4-bit load block. Allows tmem address and render tile to be specified. + * Useful when loading multiple tiles. S means odd lines are already swapped. + */ +#define gsDPLoadMultiBlock_4bS(timg, tmem, rtile, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \ + gsDPSetTile(fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0 , cmt, \ + maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1,0),\ + gsDPPipeSync(), \ + gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(rtile, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + + +/* + * Allows tmem address to be specified + */ +#define _gsDPLoadTextureBlock_4b(timg, tmem, fmt, width, height, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ + \ + gsDPSetTextureImage(fmt, G_IM_SIZ_16b, 1, timg), \ + gsDPSetTile(fmt, G_IM_SIZ_16b, 0, tmem, G_TX_LOADTILE, 0 , cmt, \ + maskt, shiftt, cms, masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadBlock(G_TX_LOADTILE, 0, 0, (((width)*(height)+3)>>2)-1, \ + CALC_DXT_4b(width)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, 0, 0, \ + ((width)-1) << G_TEXTURE_IMAGE_FRAC, \ + ((height)-1) << G_TEXTURE_IMAGE_FRAC) + +#ifndef _HW_VERSION_1 + +#define gDPLoadTextureTile(pkt, timg, fmt, siz, width, height, \ + uls, ult, lrs, lrt, pal, \ + cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz, width, timg); \ + gDPSetTile(pkt, fmt, siz, \ + (((((lrs)-(uls)+1) * siz##_TILE_BYTES)+7)>>3), 0, \ + G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPLoadSync(pkt); \ + gDPLoadTile( pkt, G_TX_LOADTILE, \ + (uls)<>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, \ + (uls)<>3), tmem, \ + G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPLoadSync(pkt); \ + gDPLoadTile( pkt, G_TX_LOADTILE, \ + (uls)<>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, rtile, \ + (uls)<>3), 0, \ + G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPLoadSync(), \ + gsDPLoadTile( G_TX_LOADTILE, \ + (uls)<>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks,\ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, \ + (uls)<>3), \ + tmem, G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, \ + masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadTile( G_TX_LOADTILE, \ + (uls)<>3), \ + tmem, rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(rtile, \ + (uls)<>1), timg); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_8b, \ + (((((lrs)-(uls)+1)>>1)+7)>>3), 0, \ + G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPLoadSync(pkt); \ + gDPLoadTile( pkt, G_TX_LOADTILE, \ + (uls)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (ult)<<(G_TEXTURE_IMAGE_FRAC), \ + (lrs)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (lrt)<<(G_TEXTURE_IMAGE_FRAC)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, \ + (((((lrs)-(uls)+1)>>1)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, \ + masks, shifts); \ + gDPSetTileSize(pkt, G_TX_RENDERTILE, \ + (uls)<>1), timg); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_8b, \ + (((((lrs)-(uls)+1)>>1)+7)>>3), tmem, \ + G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPLoadSync(pkt); \ + gDPLoadTile( pkt, G_TX_LOADTILE, \ + (uls)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (ult)<<(G_TEXTURE_IMAGE_FRAC), \ + (lrs)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (lrt)<<(G_TEXTURE_IMAGE_FRAC)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, \ + (((((lrs)-(uls)+1)>>1)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, rtile, \ + (uls)<>1), timg), \ + gsDPSetTile(fmt, G_IM_SIZ_8b, (((((lrs)-(uls)+1)>>1)+7)>>3), 0, \ + G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPLoadSync(), \ + gsDPLoadTile( G_TX_LOADTILE, \ + (uls)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (ult)<<(G_TEXTURE_IMAGE_FRAC), \ + (lrs)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (lrt)<<(G_TEXTURE_IMAGE_FRAC)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, G_IM_SIZ_4b, (((((lrs)-(uls)+1)>>1)+7)>>3), 0, \ + G_TX_RENDERTILE, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(G_TX_RENDERTILE, \ + (uls)<>1), timg), \ + gsDPSetTile(fmt, G_IM_SIZ_8b, (((((lrs)-(uls)+1)>>1)+7)>>3), \ + tmem, G_TX_LOADTILE, 0 , cmt, maskt, shiftt, cms, \ + masks, shifts), \ + gsDPLoadSync(), \ + gsDPLoadTile( G_TX_LOADTILE, \ + (uls)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (ult)<<(G_TEXTURE_IMAGE_FRAC), \ + (lrs)<<(G_TEXTURE_IMAGE_FRAC-1), \ + (lrt)<<(G_TEXTURE_IMAGE_FRAC)), \ + gsDPPipeSync(), \ + gsDPSetTile(fmt, G_IM_SIZ_4b, (((((lrs)-(uls)+1)>>1)+7)>>3), \ + tmem, rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts), \ + gsDPSetTileSize(rtile, \ + (uls)<words.w0 = _SHIFTL(G_SETSCISSOR, 24, 8) | \ + _SHIFTL((int)((float)(ulx)*4.0F), 12, 12) | \ + _SHIFTL((int)((float)(uly)*4.0F), 0, 12); \ + _g->words.w1 = _SHIFTL(mode, 24, 2) | \ + _SHIFTL((int)((float)(lrx)*4.0F), 12, 12) | \ + _SHIFTL((int)((float)(lry)*4.0F), 0, 12); \ +} + + +#define gDPSetScissorFrac(pkt, mode, ulx, uly, lrx, lry) \ +{ \ + Gfx *_g = (Gfx *)pkt; \ + \ + _g->words.w0 = _SHIFTL(G_SETSCISSOR, 24, 8) | \ + _SHIFTL((int)((ulx)), 12, 12) | \ + _SHIFTL((int)((uly)), 0, 12); \ + _g->words.w1 = _SHIFTL(mode, 24, 2) | \ + _SHIFTL((int)((lrx)), 12, 12) | \ + _SHIFTL((int)((lry)), 0, 12); \ +} + +#define gsDPSetScissor(mode, ulx, uly, lrx, lry) \ +{{ \ + _SHIFTL(G_SETSCISSOR, 24, 8) | \ + _SHIFTL((int)((float)(ulx)*4.0F), 12, 12) | \ + _SHIFTL((int)((float)(uly)*4.0F), 0, 12), \ + _SHIFTL(mode, 24, 2) | \ + _SHIFTL((int)((float)(lrx)*4.0F), 12, 12) | \ + _SHIFTL((int)((float)(lry)*4.0F), 0, 12) \ +}} + +#define gsDPSetScissorFrac(mode, ulx, uly, lrx, lry) \ +{{ \ + _SHIFTL(G_SETSCISSOR, 24, 8) | \ + _SHIFTL((int)((ulx)), 12, 12) | \ + _SHIFTL((int)((uly)), 0, 12), \ + _SHIFTL(mode, 24, 2) | \ + _SHIFTL((int)(lrx), 12, 12) | \ + _SHIFTL((int)(lry), 0, 12) \ +}} + +/* Fraction never used in fill */ +#define gDPFillRectangle(pkt, ulx, uly, lrx, lry) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_FILLRECT, 24, 8) | \ + _SHIFTL((lrx), 14, 10) | _SHIFTL((lry), 2, 10));\ + _g->words.w1 = (_SHIFTL((ulx), 14, 10) | _SHIFTL((uly), 2, 10));\ +} + +#define gsDPFillRectangle(ulx, uly, lrx, lry) \ +{{ \ + (_SHIFTL(G_FILLRECT, 24, 8) | _SHIFTL((lrx), 14, 10) | \ + _SHIFTL((lry), 2, 10)), \ + (_SHIFTL((ulx), 14, 10) | _SHIFTL((uly), 2, 10)) \ +}} + +/* like gDPFillRectangle but accepts negative arguments */ +#define gDPScisFillRectangle(pkt, ulx, uly, lrx, lry) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_FILLRECT, 24, 8) | \ + _SHIFTL(MAX((lrx),0), 14, 10) | \ + _SHIFTL(MAX((lry),0), 2, 10)); \ + _g->words.w1 = (_SHIFTL(MAX((ulx),0), 14, 10) | \ + _SHIFTL(MAX((uly),0), 2, 10)); \ +} + +#define gDPSetConvert(pkt, k0, k1, k2, k3, k4, k5) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_SETCONVERT, 24, 8) | \ + _SHIFTL(k0, 13, 9) | _SHIFTL(k1, 4, 9) | \ + _SHIFTR(k2, 5, 4)); \ + _g->words.w1 = (_SHIFTL(k2, 27, 5) | _SHIFTL(k3, 18, 9) | \ + _SHIFTL(k4, 9, 9) | _SHIFTL(k5, 0, 9)); \ +} + +#define gsDPSetConvert(k0, k1, k2, k3, k4, k5) \ +{{ \ + (_SHIFTL(G_SETCONVERT, 24, 8) | \ + _SHIFTL(k0, 13, 9) | _SHIFTL(k1, 4, 9) | _SHIFTR(k2, 5, 4)), \ + (_SHIFTL(k2, 27, 5) | _SHIFTL(k3, 18, 9) | _SHIFTL(k4, 9, 9) | \ + _SHIFTL(k5, 0, 9)) \ +}} + +#define gDPSetKeyR(pkt, cR, sR, wR) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_SETKEYR, 24, 8); \ + _g->words.w1 = (_SHIFTL(wR, 16, 12) | _SHIFTL(cR, 8, 8) | \ + _SHIFTL(sR, 0, 8)); \ +} + +#define gsDPSetKeyR(cR, sR, wR) \ +{{ \ + _SHIFTL(G_SETKEYR, 24, 8), \ + _SHIFTL(wR, 16, 12) | _SHIFTL(cR, 8, 8) | _SHIFTL(sR, 0, 8) \ +}} + +#define gDPSetKeyGB(pkt, cG, sG, wG, cB, sB, wB) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_SETKEYGB, 24, 8) | \ + _SHIFTL(wG, 12, 12) | _SHIFTL(wB, 0, 12)); \ + _g->words.w1 = (_SHIFTL(cG, 24, 8) | _SHIFTL(sG, 16, 8) | \ + _SHIFTL(cB, 8, 8) | _SHIFTL(sB, 0, 8)); \ +} + +#define gsDPSetKeyGB(cG, sG, wG, cB, sB, wB) \ +{{ \ + (_SHIFTL(G_SETKEYGB, 24, 8) | _SHIFTL(wG, 12, 12) | \ + _SHIFTL(wB, 0, 12)), \ + (_SHIFTL(cG, 24, 8) | _SHIFTL(sG, 16, 8) | _SHIFTL(cB, 8, 8) | \ + _SHIFTL(sB, 0, 8)) \ +}} + +#define gDPNoParam(pkt, cmd) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(cmd, 24, 8); \ + _g->words.w1 = 0; \ +} + +#define gsDPNoParam(cmd) \ +{{ \ + _SHIFTL(cmd, 24, 8), 0 \ +}} + +#define gDPParam(pkt, cmd, param) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(cmd, 24, 8); \ + _g->words.w1 = (param); \ +} + +#define gsDPParam(cmd, param) \ +{{ \ + _SHIFTL(cmd, 24, 8), (param) \ +}} + +/* Notice that textured rectangles are 128-bit commands, therefore + * gsDPTextureRectangle() should not be used in display lists + * under normal circumstances (use gsSPTextureRectangle()). + * That is also why there is no gDPTextureRectangle() macros. + */ +#define gsDPTextureRectangle(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ +{{ \ + (_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | \ + _SHIFTL(yh, 0, 12)), \ + (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12)), \ +}}, \ +{{ \ + _SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16), \ + _SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16) \ +}} + +#define gDPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)\ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + if (pkt); \ + _g->words.w0 = (_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | \ + _SHIFTL(yh, 0, 12)); \ + _g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \ + _SHIFTL(yl, 0, 12)); \ + _g ++; \ + _g->words.w0 = (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16)); \ + _g->words.w1 = (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)); \ +} + +#define gsDPTextureRectangleFlip(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ +{{ \ + (_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) | \ + _SHIFTL(yh, 0, 12)), \ + (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12)), \ +}}, \ +{{ \ + _SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16), \ + _SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16) \ +}} + +#define gDPTextureRectangleFlip(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)\ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + if (pkt); \ + _g->words.w0 = (_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) | \ + _SHIFTL(yh, 0, 12)); \ + _g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \ + _SHIFTL(yl, 0, 12)); \ + _g ++; \ + _g->words.w0 = (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16)); \ + _g->words.w1 = (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)); \ +} + +#define gsSPTextureRectangle(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ + {{(_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | _SHIFTL(yh, 0, 12)),\ + (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12))}}, \ + gsImmp1(G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))), \ + gsImmp1(G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16))) + +#define gSPTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy)\ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXRECT, 24, 8) | _SHIFTL(xh, 12, 12) | \ + _SHIFTL(yh, 0, 12)); \ + _g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \ + _SHIFTL(yl, 0, 12)); \ + gImmp1(pkt, G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))); \ + gImmp1(pkt, G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)));\ +} + +/* like gSPTextureRectangle but accepts negative position arguments */ +#define gSPScisTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXRECT, 24, 8) | \ + _SHIFTL(MAX((s16)(xh),0), 12, 12) | \ + _SHIFTL(MAX((s16)(yh),0), 0, 12)); \ + _g->words.w1 = (_SHIFTL((tile), 24, 3) | \ + _SHIFTL(MAX((s16)(xl),0), 12, 12) | \ + _SHIFTL(MAX((s16)(yl),0), 0, 12)); \ + gImmp1(pkt, G_RDPHALF_1, \ + (_SHIFTL(((s) - \ + (((s16)(xl) < 0) ? \ + (((s16)(dsdx) < 0) ? \ + (MAX((((s16)(xl)*(s16)(dsdx))>>7),0)) : \ + (MIN((((s16)(xl)*(s16)(dsdx))>>7),0))) : 0)), \ + 16, 16) | \ + _SHIFTL(((t) - \ + (((yl) < 0) ? \ + (((s16)(dtdy) < 0) ? \ + (MAX((((s16)(yl)*(s16)(dtdy))>>7),0)) : \ + (MIN((((s16)(yl)*(s16)(dtdy))>>7),0))) : 0)), \ + 0, 16))); \ + gImmp1(pkt, G_RDPHALF_2, (_SHIFTL((dsdx), 16, 16) | \ + _SHIFTL((dtdy), 0, 16))); \ +} + +#define gsSPTextureRectangleFlip(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ + {{(_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) | \ + _SHIFTL(yh, 0, 12)), \ + (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | _SHIFTL(yl, 0, 12))}}, \ + gsImmp1(G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))), \ + gsImmp1(G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16))) + +#define gSPTextureRectangleFlip(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = (_SHIFTL(G_TEXRECTFLIP, 24, 8) | _SHIFTL(xh, 12, 12) |\ + _SHIFTL(yh, 0, 12)); \ + _g->words.w1 = (_SHIFTL(tile, 24, 3) | _SHIFTL(xl, 12, 12) | \ + _SHIFTL(yl, 0, 12)); \ + gImmp1(pkt, G_RDPHALF_1, (_SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16))); \ + gImmp1(pkt, G_RDPHALF_2, (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16))); \ +} + +#define gsDPWord(wordhi, wordlo) \ + gsImmp1(G_RDPHALF_1, (unsigned int)(wordhi)), \ + gsImmp1(G_RDPHALF_2, (unsigned int)(wordlo)) + +#define gDPWord(pkt, wordhi, wordlo) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + gImmp1(pkt, G_RDPHALF_1, (unsigned int)(wordhi)); \ + gImmp1(pkt, G_RDPHALF_2, (unsigned int)(wordlo)); \ +} + +#define gDPFullSync(pkt) gDPNoParam(pkt, G_RDPFULLSYNC) +#define gsDPFullSync() gsDPNoParam(G_RDPFULLSYNC) +#define gDPTileSync(pkt) gDPNoParam(pkt, G_RDPTILESYNC) +#define gsDPTileSync() gsDPNoParam(G_RDPTILESYNC) +#define gDPPipeSync(pkt) gDPNoParam(pkt, G_RDPPIPESYNC) +#define gsDPPipeSync() gsDPNoParam(G_RDPPIPESYNC) +#define gDPLoadSync(pkt) gDPNoParam(pkt, G_RDPLOADSYNC) +#define gsDPLoadSync() gsDPNoParam(G_RDPLOADSYNC) +#define gDPNoOp(pkt) gDPNoParam(pkt, G_NOOP) +#define gsDPNoOp() gsDPNoParam(G_NOOP) +#define gDPNoOpTag(pkt, tag) gDPParam(pkt, G_NOOP, tag) +#define gsDPNoOpTag(tag) gsDPParam(G_NOOP, tag) + +#endif /* _LANGUAGE_C */ + + +#endif /* _GBI_H_ */ diff --git a/include/2.0L/PR/gs2dex.h b/include/2.0L/PR/gs2dex.h new file mode 100644 index 00000000..ced46855 --- /dev/null +++ b/include/2.0L/PR/gs2dex.h @@ -0,0 +1,392 @@ +/*--------------------------------------------------------------------- + Copyright (C) 1997, Nintendo. + + File gs2dex.h + Coded by Yoshitaka Yasumoto. Jul 31, 1997. + Modified by + Comments Header file for S2DEX ucode. + + $Id: gs2dex.h,v 1.21 1998/05/28 00:14:49 has Exp $ + ---------------------------------------------------------------------*/ + +#ifndef _GS2DEX_H_ +#define _GS2DEX_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +/*===========================================================================* + * Macro + *===========================================================================*/ +#define GS_CALC_DXT(line) (((1<< G_TX_DXT_FRAC)-1)/(line)+1) +#define GS_PIX2TMEM(pix, siz) ((pix)>>(4-(siz))) +#define GS_PIX2DXT(pix, siz) GS_CALC_DXT(GS_PIX2TMEM((pix), (siz))) + +/*===========================================================================* + * Data structures for S2DEX microcode + *===========================================================================*/ + +/*---------------------------------------------------------------------------* + * Background + *---------------------------------------------------------------------------*/ +#define G_BGLT_LOADBLOCK 0x0033 +#define G_BGLT_LOADTILE 0xfff4 + +#define G_BG_FLAG_FLIPS 0x01 +#define G_BG_FLAG_FLIPT 0x10 + +/* Non scalable background plane */ +typedef struct { + u16 imageX; /* x-coordinate of upper-left position of texture (u10.5) */ + u16 imageW; /* width of the texture (u10.2) */ + s16 frameX; /* upper-left position of transferred frame (s10.2) */ + u16 frameW; /* width of transferred frame (u10.2) */ + + u16 imageY; /* y-coordinate of upper-left position of texture (u10.5) */ + u16 imageH; /* height of the texture (u10.2) */ + s16 frameY; /* upper-left position of transferred frame (s10.2) */ + u16 frameH; /* height of transferred frame (u10.2) */ + + u64 *imagePtr; /* texture source address on DRAM */ + u16 imageLoad; /* which to use, LoadBlock or LoadTile */ + u8 imageFmt; /* format of texel - G_IM_FMT_* */ + u8 imageSiz; /* size of texel - G_IM_SIZ_* */ + u16 imagePal; /* pallet number */ + u16 imageFlip; /* right & left image inversion (Inverted by G_BG_FLAG_FLIPS) */ + + /* The following is set in the initialization routine guS2DInitBg(). There is no need for the user to set it. */ + u16 tmemW; /* TMEM width and Word size of frame 1 line. + At LoadBlock, GS_PIX2TMEM(imageW/4,imageSiz) + At LoadTile GS_PIX2TMEM(frameW/4,imageSiz)+1 */ + u16 tmemH; /* height of TMEM loadable at a time (s13.2) 4 times value + When the normal texture, 512/tmemW*4 + When the CI texture, 256/tmemW*4 */ + u16 tmemLoadSH; /* SH value + At LoadBlock, tmemSize/2-1 + At LoadTile, tmemW*16-1 */ + u16 tmemLoadTH; /* TH value or Stride value + At LoadBlock, GS_CALC_DXT(tmemW) + At LoadTile, tmemH-1 */ + u16 tmemSizeW; /* skip value of imagePtr for image 1-line + At LoadBlock, tmemW*2 + At LoadTile, GS_PIX2TMEM(imageW/4,imageSiz)*2 */ + u16 tmemSize; /* skip value of imagePtr for 1-loading + = tmemSizeW*tmemH */ +} uObjBg_t; /* 40 bytes */ + +/* Scalable background plane */ +typedef struct { + u16 imageX; /* x-coordinate of upper-left position of texture (u10.5) */ + u16 imageW; /* width of texture (u10.2) */ + s16 frameX; /* upper-left position of transferred frame (s10.2) */ + u16 frameW; /* width of transferred frame (u10.2) */ + + u16 imageY; /* y-coordinate of upper-left position of texture (u10.5) */ + u16 imageH; /* height of texture (u10.2) */ + s16 frameY; /* upper-left position of transferred frame (s10.2) */ + u16 frameH; /* height of transferred frame (u10.2) */ + + u64 *imagePtr; /* texture source address on DRAM */ + u16 imageLoad; /* Which to use, LoadBlock or LoadTile? */ + u8 imageFmt; /* format of texel - G_IM_FMT_* */ + u8 imageSiz; /* size of texel - G_IM_SIZ_* */ + u16 imagePal; /* pallet number */ + u16 imageFlip; /* right & left image inversion (Inverted by G_BG_FLAG_FLIPS) */ + + u16 scaleW; /* scale value of X-direction (u5.10) */ + u16 scaleH; /* scale value of Y-direction (u5.10) */ + s32 imageYorig; /* start point of drawing on image (s20.5) */ + + u8 padding[4]; + +} uObjScaleBg_t; /* 40 bytes */ + +typedef union { + uObjBg_t b; + uObjScaleBg_t s; + long long int force_structure_alignment; +} uObjBg; + +/*---------------------------------------------------------------------------* + * 2D Objects + *---------------------------------------------------------------------------*/ +#define G_OBJ_FLAG_FLIPS 1<<0 /* inversion to S-direction */ +#define G_OBJ_FLAG_FLIPT 1<<4 /* nversion to T-direction */ + +typedef struct { + s16 objX; /* s10.2 OBJ x-coordinate of upper-left end */ + u16 scaleW; /* u5.10 Scaling of u5.10 width direction */ + u16 imageW; /* u10.5 width of u10.5 texture (length of S-direction) */ + u16 paddingX; /* Unused - Always 0 */ + s16 objY; /* s10.2 OBJ y-coordinate of s10.2 OBJ upper-left end */ + u16 scaleH; /* u5.10 Scaling of u5.10 height direction */ + u16 imageH; /* u10.5 height of u10.5 texture (length of T-direction) */ + u16 paddingY; /* Unused - Always 0 */ + u16 imageStride; /* folding width of texel (In units of 64bit word) */ + u16 imageAdrs; /* texture header position in TMEM (In units of 64bit word) */ + u8 imageFmt; /* format of texel - G_IM_FMT_* */ + u8 imageSiz; /* size of texel - G_IM_SIZ_* */ + u8 imagePal; /* pallet number (0-7) */ + u8 imageFlags; /* The display flag - G_OBJ_FLAG_FLIP* */ +} uObjSprite_t; /* 24 bytes */ + +typedef union { + uObjSprite_t s; + long long int force_structure_alignment; +} uObjSprite; + +/*---------------------------------------------------------------------------* + * 2D Matrix + *---------------------------------------------------------------------------*/ +typedef struct { + s32 A, B, C, D; /* s15.16 */ + s16 X, Y; /* s10.2 */ + u16 BaseScaleX; /* u5.10 */ + u16 BaseScaleY; /* u5.10 */ +} uObjMtx_t; /* 24 bytes */ + +typedef union { + uObjMtx_t m; + long long int force_structure_alignment; +} uObjMtx; + +typedef struct { + s16 X, Y; /* s10.2 */ + u16 BaseScaleX; /* u5.10 */ + u16 BaseScaleY; /* u5.10 */ +} uObjSubMtx_t; /* 8 bytes */ + +typedef union { + uObjSubMtx_t m; + long long int force_structure_alignment; +} uObjSubMtx; + +/*---------------------------------------------------------------------------* + * Loading into TMEM + *---------------------------------------------------------------------------*/ +#define G_OBJLT_TXTRBLOCK 0x00001033 +#define G_OBJLT_TXTRTILE 0x00fc1034 +#define G_OBJLT_TLUT 0x00000030 + +#define GS_TB_TSIZE(pix,siz) (GS_PIX2TMEM((pix),(siz))-1) +#define GS_TB_TLINE(pix,siz) (GS_CALC_DXT(GS_PIX2TMEM((pix),(siz)))) + +typedef struct { + u32 type; /* G_OBJLT_TXTRBLOCK divided into types */ + u64 *image; /* texture source address on DRAM */ + u16 tmem; /* loaded TMEM word address (8byteWORD) */ + u16 tsize; /* Texture size, Specified by macro GS_TB_TSIZE() */ + u16 tline; /* width of Texture 1-line, Specified by macro GS_TB_TLINE() */ + u16 sid; /* STATE ID Multipled by 4 (Either one of 0, 4, 8 and 12) */ + u32 flag; /* STATE flag */ + u32 mask; /* STATE mask */ +} uObjTxtrBlock_t; /* 24 bytes */ + +#define GS_TT_TWIDTH(pix,siz) ((GS_PIX2TMEM((pix), (siz))<<2)-1) +#define GS_TT_THEIGHT(pix,siz) (((pix)<<2)-1) + +typedef struct { + u32 type; /* G_OBJLT_TXTRTILE divided into types */ + u64 *image; /* texture source address on DRAM */ + u16 tmem; /* loaded TMEM word address (8byteWORD)*/ + u16 twidth; /* width of Texture (Specified by macro GS_TT_TWIDTH()) */ + u16 theight; /* height of Texture (Specified by macro GS_TT_THEIGHT()) */ + u16 sid; /* STATE ID Multipled by 4 (Either one of 0, 4, 8 and 12) */ + u32 flag; /* STATE flag */ + u32 mask; /* STATE mask */ +} uObjTxtrTile_t; /* 24 bytes */ + +#define GS_PAL_HEAD(head) ((head)+256) +#define GS_PAL_NUM(num) ((num)-1) + +typedef struct { + u32 type; /* G_OBJLT_TLUT divided into types */ + u64 *image; /* texture source address on DRAM */ + u16 phead; /* pallet number of load header (Between 256 and 511) */ + u16 pnum; /* loading pallet number -1 */ + u16 zero; /* Assign 0 all the time */ + u16 sid; /* STATE ID Multipled by 4 (Either one of 0, 4, 8 and 12)*/ + u32 flag; /* STATE flag */ + u32 mask; /* STATE mask */ +} uObjTxtrTLUT_t; /* 24 bytes */ + +typedef union { + uObjTxtrBlock_t block; + uObjTxtrTile_t tile; + uObjTxtrTLUT_t tlut; + long long int force_structure_alignment; +} uObjTxtr; + +/*---------------------------------------------------------------------------* + * Loading into TMEM & 2D Objects + *---------------------------------------------------------------------------*/ +typedef struct { + uObjTxtr txtr; + uObjSprite sprite; +} uObjTxSprite; /* 48 bytes */ + +/*===========================================================================* + * GBI Commands for S2DEX microcode + *===========================================================================*/ +/* GBI Header */ +#ifdef F3DEX_GBI_2 +#define G_OBJ_RECTANGLE_R 0xda +#define G_OBJ_MOVEMEM 0xdc +#define G_RDPHALF_0 0xe4 +#define G_OBJ_RECTANGLE 0x01 +#define G_OBJ_SPRITE 0x02 +#define G_SELECT_DL 0x04 +#define G_OBJ_LOADTXTR 0x05 +#define G_OBJ_LDTX_SPRITE 0x06 +#define G_OBJ_LDTX_RECT 0x07 +#define G_OBJ_LDTX_RECT_R 0x08 +#define G_BG_1CYC 0x09 +#define G_BG_COPY 0x0a +#define G_OBJ_RENDERMODE 0x0b +#else +#define G_BG_1CYC 0x01 +#define G_BG_COPY 0x02 +#define G_OBJ_RECTANGLE 0x03 +#define G_OBJ_SPRITE 0x04 +#define G_OBJ_MOVEMEM 0x05 +#define G_SELECT_DL 0xb0 +#define G_OBJ_RENDERMODE 0xb1 +#define G_OBJ_RECTANGLE_R 0xb2 +#define G_OBJ_LOADTXTR 0xc1 +#define G_OBJ_LDTX_SPRITE 0xc2 +#define G_OBJ_LDTX_RECT 0xc3 +#define G_OBJ_LDTX_RECT_R 0xc4 +#define G_RDPHALF_0 0xe4 +#endif + +/*---------------------------------------------------------------------------* + * Background wrapped screen + *---------------------------------------------------------------------------*/ +#define gSPBgRectangle(pkt, m, mptr) gDma0p((pkt),(m),(mptr),0) +#define gsSPBgRectangle(m, mptr) gsDma0p( (m),(mptr),0) +#define gSPBgRectCopy(pkt, mptr) gSPBgRectangle((pkt), G_BG_COPY, (mptr)) +#define gsSPBgRectCopy(mptr) gsSPBgRectangle( G_BG_COPY, (mptr)) +#define gSPBgRect1Cyc(pkt, mptr) gSPBgRectangle((pkt), G_BG_1CYC, (mptr)) +#define gsSPBgRect1Cyc(mptr) gsSPBgRectangle( G_BG_1CYC, (mptr)) + +/*---------------------------------------------------------------------------* + * 2D Objects + *---------------------------------------------------------------------------*/ +#define gSPObjSprite(pkt, mptr) gDma0p((pkt),G_OBJ_SPRITE, (mptr),0) +#define gsSPObjSprite(mptr) gsDma0p( G_OBJ_SPRITE, (mptr),0) +#define gSPObjRectangle(pkt, mptr) gDma0p((pkt),G_OBJ_RECTANGLE, (mptr),0) +#define gsSPObjRectangle(mptr) gsDma0p( G_OBJ_RECTANGLE, (mptr),0) +#define gSPObjRectangleR(pkt, mptr) gDma0p((pkt),G_OBJ_RECTANGLE_R,(mptr),0) +#define gsSPObjRectangleR(mptr) gsDma0p( G_OBJ_RECTANGLE_R,(mptr),0) + +/*---------------------------------------------------------------------------* + * 2D Matrix + *---------------------------------------------------------------------------*/ +#define gSPObjMatrix(pkt, mptr) gDma1p((pkt),G_OBJ_MOVEMEM,(mptr),0,23) +#define gsSPObjMatrix(mptr) gsDma1p( G_OBJ_MOVEMEM,(mptr),0,23) +#define gSPObjSubMatrix(pkt, mptr) gDma1p((pkt),G_OBJ_MOVEMEM,(mptr),2, 7) +#define gsSPObjSubMatrix(mptr) gsDma1p( G_OBJ_MOVEMEM,(mptr),2, 7) + +/*---------------------------------------------------------------------------* + * Loading into TMEM + *---------------------------------------------------------------------------*/ +#define gSPObjLoadTxtr(pkt, tptr) gDma0p((pkt),G_OBJ_LOADTXTR, (tptr),23) +#define gsSPObjLoadTxtr(tptr) gsDma0p( G_OBJ_LOADTXTR, (tptr),23) +#define gSPObjLoadTxSprite(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_SPRITE,(tptr),47) +#define gsSPObjLoadTxSprite(tptr) gsDma0p( G_OBJ_LDTX_SPRITE,(tptr),47) +#define gSPObjLoadTxRect(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_RECT, (tptr),47) +#define gsSPObjLoadTxRect(tptr) gsDma0p( G_OBJ_LDTX_RECT, (tptr),47) +#define gSPObjLoadTxRectR(pkt, tptr) gDma0p((pkt),G_OBJ_LDTX_RECT_R,(tptr),47) +#define gsSPObjLoadTxRectR(tptr) gsDma0p( G_OBJ_LDTX_RECT_R,(tptr),47) + +/*---------------------------------------------------------------------------* + * Select Display List + *---------------------------------------------------------------------------*/ +#define gSPSelectDL(pkt, mptr, sid, flag, mask) \ +{ gDma1p((pkt), G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \ + gDma1p((pkt), G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_PUSH); } +#define gsSPSelectDL(mptr, sid, flag, mask) \ +{ gsDma1p(G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \ + gsDma1p(G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_PUSH); } +#define gSPSelectBranchDL(pkt, mptr, sid, flag, mask) \ +{ gDma1p((pkt), G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \ + gDma1p((pkt), G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_NOPUSH); } +#define gsSPSelectBranchDL(mptr, sid, flag, mask) \ +{ gsDma1p(G_RDPHALF_0, (flag), (u32)(mptr) & 0xffff, (sid)); \ + gsDma1p(G_SELECT_DL, (mask), (u32)(mptr) >> 16, G_DL_NOPUSH); } + +/*---------------------------------------------------------------------------* + * Set general status + *---------------------------------------------------------------------------*/ +#define G_MW_GENSTAT 0x08 /* Note that it is the same value of G_MW_FOG */ + +#define gSPSetStatus(pkt, sid, val) \ + gMoveWd((pkt), G_MW_GENSTAT, (sid), (val)) +#define gsSPSetStatus(sid, val) \ + gsMoveWd( G_MW_GENSTAT, (sid), (val)) + +/*---------------------------------------------------------------------------* + * Set Object Render Mode + *---------------------------------------------------------------------------*/ +#define G_OBJRM_NOTXCLAMP 0x01 +#define G_OBJRM_XLU 0x02 /* Ignored */ +#define G_OBJRM_ANTIALIAS 0x04 /* Ignored */ +#define G_OBJRM_BILERP 0x08 +#define G_OBJRM_SHRINKSIZE_1 0x10 +#define G_OBJRM_SHRINKSIZE_2 0x20 +#define G_OBJRM_WIDEN 0x40 + +#define gSPObjRenderMode(pkt, mode) gImmp1((pkt),G_OBJ_RENDERMODE,(mode)) +#define gsSPObjRenderMode(mode) gsImmp1( G_OBJ_RENDERMODE,(mode)) + +/*===========================================================================* + * Render Mode Macro + *===========================================================================*/ +#define RM_RA_SPRITE(clk) \ + AA_EN | CVG_DST_CLAMP | \ + CVG_X_ALPHA | ALPHA_CVG_SEL | ZMODE_OPA | TEX_EDGE | \ + GBL_c##clk(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA) + +#define G_RM_SPRITE G_RM_OPA_SURF +#define G_RM_SPRITE2 G_RM_OPA_SURF2 +#define G_RM_RA_SPRITE RM_RA_SPRITE(1) +#define G_RM_RA_SPRITE2 RM_RA_SPRITE(2) +#define G_RM_AA_SPRITE G_RM_AA_TEX_TERR +#define G_RM_AA_SPRITE2 G_RM_AA_TEX_TERR2 +#define G_RM_XLU_SPRITE G_RM_XLU_SURF +#define G_RM_XLU_SPRITE2 G_RM_XLU_SURF2 +#define G_RM_AA_XLU_SPRITE G_RM_AA_XLU_SURF +#define G_RM_AA_XLU_SPRITE2 G_RM_AA_XLU_SURF2 + +/*===========================================================================* + * External functions + *===========================================================================*/ +extern u64 gspS2DEX_fifoTextStart[], gspS2DEX_fifoTextEnd[]; +extern u64 gspS2DEX_fifoDataStart[], gspS2DEX_fifoDataEnd[]; +extern u64 gspS2DEX_fifo_dTextStart[], gspS2DEX_fifo_dTextEnd[]; +extern u64 gspS2DEX_fifo_dDataStart[], gspS2DEX_fifo_dDataEnd[]; +extern u64 gspS2DEX2_fifoTextStart[], gspS2DEX2_fifoTextEnd[]; +extern u64 gspS2DEX2_fifoDataStart[], gspS2DEX2_fifoDataEnd[]; +extern u64 gspS2DEX2_xbusTextStart[], gspS2DEX2_xbusTextEnd[]; +extern u64 gspS2DEX2_xbusDataStart[], gspS2DEX2_xbusDataEnd[]; +extern void guS2DInitBg(uObjBg *); + +#ifdef F3DEX_GBI_2 +# define guS2DEmuBgRect1Cyc guS2D2EmuBgRect1Cyc /*Wrapper*/ +# define guS2DEmuSetScissor guS2D2EmuSetScissor /*Wrapper*/ + extern void guS2D2EmuSetScissor(u32, u32, u32, u32, u8); + extern void guS2D2EmuBgRect1Cyc(Gfx **, uObjBg *); +#else + extern void guS2DEmuSetScissor(u32, u32, u32, u32, u8); + extern void guS2DEmuBgRect1Cyc(Gfx **, uObjBg *); +#endif + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif +#endif /* _GS2DEX_H_ */ + +/*======== End of gs2dex.h ========*/ diff --git a/include/2.0L/PR/gt.h b/include/2.0L/PR/gt.h new file mode 100644 index 00000000..09b6ba2d --- /dev/null +++ b/include/2.0L/PR/gt.h @@ -0,0 +1,365 @@ + +/* + * Copyright 1995, Silicon Graphics, Inc. + * ALL RIGHTS RESERVED + * + * UNPUBLISHED -- Rights reserved under the copyright laws of the United + * States. Use of a copyright notice is precautionary only and does not + * imply publication or disclosure. + * + * U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to restrictions + * as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or + * in similar or successor clauses in the FAR, or the DOD or NASA FAR + * Supplement. Contractor/manufacturer is Silicon Graphics, Inc., + * 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311. + * + * THE CONTENT OF THIS WORK CONTAINS CONFIDENTIAL AND PROPRIETARY + * INFORMATION OF SILICON GRAPHICS, INC. ANY DUPLICATION, MODIFICATION, + * DISTRIBUTION, OR DISCLOSURE IN ANY FORM, IN WHOLE, OR IN PART, IS STRICTLY + * PROHIBITED WITHOUT THE PRIOR EXPRESS WRITTEN PERMISSION OF SILICON + * GRAPHICS, INC. + * + */ + +/* + * File: gt.h + * Creator: hsa@sgi.com + * Create Date: Thu Oct 12 15:48:14 PDT 1995 + * + * This file defines the GBI for the TURBO 3D graphics microcode. + * The turbo microcode is a special FEATURE-LIMITED microcode designed + * for specific applications. It is not for general use. + * + * (see XXX for more information) + * + */ + +/************************************************************************** + * + * $Revision: 1.16 $ + * $Date: 1998/05/28 00:14:50 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/gt.h,v $ + * + **************************************************************************/ + +#ifndef _GT_H_ +#define _GT_H_ + +/* this file should be #included AFTER gbi.h */ + +#include "sptask.h" + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif /* _LANGUAGE_C_PLUS_PLUS */ + +#include + +/* the following #defines seem out of order, but we need them + * for the microcode. + */ + +/* + * object state field: rendState + * + * This flag word is built up out of the bits from a + * subset of the G_SETGEOMETRYMODE flags from gbi.h. + * + * When each of these bits is '1', the comments below explain + * the effect on the triangles. + */ +#define GT_ZBUFFER G_ZBUFFER +#define GT_TEXTURE G_TEXTURE_ENABLE /* texture ON */ +#define GT_CULL_BACK G_CULL_BACK /* reject backfaces */ +#define GT_SHADING_SMOOTH G_SHADING_SMOOTH /* smooth shade ON */ + +/* + * object state field: textureState + * + * The lower 3 bits of this flag word contain the texture tile number + * to be used. All triangles of an object are rendered with the same + * texture tile. + */ + +/* + * object state field: flag + * + * This is a group of what would be pad bits. We use them for some + * flag bits. + */ +#define GT_FLAG_NOMTX 0x01 /* don't load the matrix */ +#define GT_FLAG_NO_XFM 0x02 /* load vtx, use verbatim */ +#define GT_FLAG_XFM_ONLY 0x04 /* xform vtx, write to *TriN */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* turbo 3D ucode: */ +extern long long int gspTurbo3DTextStart[], gspTurbo3DTextEnd[]; +extern long long int gspTurbo3DDataStart[], gspTurbo3DDataEnd[]; +extern long long int gspTurbo3D_dramTextStart[], gspTurbo3D_dramTextEnd[]; +extern long long int gspTurbo3D_dramDataStart[], gspTurbo3D_dramDataEnd[]; +extern long long int gspTurbo3D_fifoTextStart[], gspTurbo3D_fifoTextEnd[]; +extern long long int gspTurbo3D_fifoDataStart[], gspTurbo3D_fifoDataEnd[]; + +/* + * This is the global state structure. It's definition carefully + * matches the ucode, so if this structure changes, you must also change + * the ucode. + */ +typedef struct { + u16 perspNorm; /* persp normalization */ + u16 pad0; + u32 flag; + Gfx rdpOthermode; + u32 segBases[16]; /* table of segment base addrs (SEE NOTE!) */ + Vp viewport; /* the viewport to use */ + Gfx *rdpCmds; /* block of RDP data, process if !NULL + * block terminated by gDPEndDisplayList() + * (This is a segment address) + */ +} gtGlobState_t; + +/* NOTE: + * Although there are 16 segment table entries, the first one (segment 0) + * is reserved for physical memory mapping. You should not segment 0 + * to anything other than 0x0. + */ + +typedef union { + gtGlobState_t sp; + long long int force_structure_alignment; +} gtGlobState; + + +/* + * This is the 'state' structure associated with each object + * to be rendered. It's definition carefully matches the + * ucode, so if this structure changes, you must also change + * the gtoff.c tool and the ucode. + */ +typedef struct { + u32 renderState; /* render state */ + u32 textureState; /* texture state */ + u8 vtxCount; /* how many verts? */ + u8 vtxV0; /* where to load verts? */ + u8 triCount; /* how many tris? */ + u8 flag; + Gfx *rdpCmds; /* ptr (segment address) to RDP DL */ + Gfx rdpOthermode; + Mtx transform; /* the transform matrix to use */ +} gtState_t; + +typedef union { + gtState_t sp; + long long int force_structure_alignment; +} gtState; + +/* gtStateLite : same as gtState, but no matrix (see flags below) */ +/* this structure must be identical to gtState! (bad) */ +typedef struct { + u32 renderState; /* render state */ + u32 textureState; /* texture state */ + u8 vtxCount; /* how many verts? */ + u8 vtxV0; /* where to load verts? */ + u8 triCount; /* how many tris? */ + u8 flag; + Gfx *rdpCmds; /* ptr (segment address) to RDP DL */ + Gfx rdpOthermode; +} gtStateL_t; + +typedef union { + gtStateL_t sp; + long long int force_structure_alignment; +} gtStateL; + +/* + * The vertex list for the turbo display list uses the + * Vtx struct in gbi.h + * + */ + + +/* + * This structure represents a single triangle, part of the + * triangle list of the object to be rendered. + * + * NOTE: The triangle list MUST be aligned to an 8-byte boundary. + * Since this structure is only 4 bytes, we are REQUIRING that + * this structure only be used as an array of triangles, and we + * depend on the MIPS C compiler (which always aligns arrays to + * 8-byte boundaries). THIS IS DANGEROUS!!!! + * + */ +typedef struct { + u8 v0, v1, v2, flag; /* flag is which one for flat shade */ +} gtTriN; + + +/* + * This structure represents the transformed points. It is the format + * of the points written out when GT_FLAG_XFM_ONLY is set, as well as + * the format expected when GT_FLAG_NO_XFM is used. + * + * NOTE: The size and layout of these points is very similar to Vtx, + * except the screen coordinates overwrite the x,y,z,pad fields. + * (we could consider adding to the Vtx union, but we want to keep + * turbo stuff out of gbi.h) + * + * NOTE: The z is a special format. It can be used to compare vertices + * for sorting, but it should not be used for other purposes. If modified, + * the z-buffer hardware might not understand the data. + * + */ +typedef struct { + short int xscrn; /* x,y screen coordinates are SSSS10.2 */ + short int yscrn; + int zscrn; /* z screen is S15.16 */ + + short int s; /* transformed texture coord, S10.5 */ + short int t; + + u8 r; /* color (or normal) */ + u8 g; + u8 b; + u8 a; +} gtVtxOut_t; + +/* see "Data Structure" comment in gbi.h for information about why + * we use this union. + */ +typedef union { + gtVtxOut_t v; + long long int force_structure_alignment; +} gtVtxOut; + + + +/* + * state field: rdpOthermode + * + * This is one of the trickier state fields. The turbo interface + * requires the RDP othermode command to be cached by the host, + * therefore we provide a different interface in libultra to help cache + * this in the gt state (this word is just bits, you could pack them + * on your own). + * + * gtStateSetOthermode() accomplishs this, taking as arguments + * the state, one of the following mode enums, and a piece of data + * (othermode parameters from gbi.h). + * + * By definition, the othermode word from the gt state structure is sent + * to the RDP *before* any RDP commands from the rdpCmds[] field. The + * othermode is *always* sent. + * + * Stated another way, NONE of the gbi RDP othermode commands equivalent + * to those listed here are allowed in the rdpCmd[] field of the + * gt state structure. + * + * Notice also that many of these commands do not make sense for + * the turbo ucode (they control features not supported, like mip-mapping). + * They are only included here for completeness. + * + */ +typedef enum { + GT_CLEAR, /* special gt mode, clears othermode state */ + GT_ALPHACOMPARE, + GT_ZSRCSEL, + GT_RENDERMODE, + GT_ALPHADITHER, + GT_RGBDITHER, + GT_COMBKEY, + GT_TEXTCONV, + GT_TEXTFILT, + GT_TEXTLUT, + GT_TEXTLOD, + GT_TEXTDETAIL, + GT_TEXTPERSP, + GT_CYCLETYPE, + GT_PIPELINE +} gtStateOthermode_t; + +/* + * This call builds up an othermode command word. The 'mode' is one of + * the above modes, the 'data' field comes from gbi.h, it is the data + * field for the equivalent gbi setothermode macro. + */ +extern void gtStateSetOthermode(Gfx *om, gtStateOthermode_t mode, int data); + +/* + * This call dumps a turbo display list for use with gbi2mem and RSPSIM + */ +#define GT_DUMPTURBO_HANGAFTER 64 +#define GT_DUMPTURBO_NOTEXTURES 128 +extern void gtDumpTurbo(OSTask *tp,u8 flags); + +/* + * Special macros to init othermode words to all 0's, a good default + * value. + */ +#define gDPClearOtherMode(pkt) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_RDPSETOTHERMODE, 24, 8); \ + _g->words.w1 = 0x0; \ +} + +#define gsDPClearOtherMode() \ +{ \ + _SHIFTL(G_RDPSETOTHERMODE, 24, 8), 0x0 \ +} + +/* + * Special macros to end DP blocks (see above). These commands + * generate all 0's, which the turbo ucode looks for. They *aren't* + * real DP commands! + */ +#define gDPEndDisplayList(pkt) gSPNoOp(pkt) +#define gsDPEndDisplayList() gsSPNoOp() + +/* + * This structure is a turbo 'object', the turbo display list is + * simply a list of these. + * + * NOTE: All pointers are segment addresses + * + * NOTE: If (statep->flag & GT_FLAG_XFM_ONLY), the trip field is + * interpreted as a pointer to gtVtxOut[] that can be used to store + * the transformed points. (statep->triCount should be 0, else bad + * things could happen...) + * + * NOTE: If (statep->flag & GT_FLAG_NO_XFM), the vtxp field is + * interpreted as a pointer to gtVtxOut[] that can be used to load + * pre-transformed points. + * + */ +typedef struct { + gtGlobState *gstatep; /* global state, usually NULL */ + gtState *statep; /* if this is NULL, end object processing */ + Vtx *vtxp; /* if this is NULL, use points in buffer */ + gtTriN *trip; /* if this is NULL, use tris in buffer */ +} gtGfx_t; + +typedef union { + gtGfx_t obj; + long long int force_structure_alignment; +} gtGfx; + + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_ASSEMBLY +#include +#endif /* _LANGUAGE_ASSEMBLY */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif /* _LANGUAGE_C_PLUS_PLUS */ + +#ifdef _LANGUAGE_MAKEROM +#endif /* _LANGUAGE_MAKEROM */ + +#endif /* _GT_H_ */ diff --git a/include/2.0L/PR/gu.h b/include/2.0L/PR/gu.h new file mode 100644 index 00000000..aa83ba08 --- /dev/null +++ b/include/2.0L/PR/gu.h @@ -0,0 +1,269 @@ +#ifndef _GU_H_ +#define _GU_H_ + +/************************************************************************** + * * + * Copyright (C) 1994, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * $Revision: 1.48 $ + * $Date: 1999/07/13 08:00:20 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/gu.h,v $ + * + **************************************************************************/ + +#include +#include +#include + +#ifndef MAX +#define MAX(a,b) (((a)>(b))?(a):(b)) +#endif +#ifndef MIN +#define MIN(a,b) (((a)<(b))?(a):(b)) +#endif + +#define M_PI 3.14159265358979323846 +#define M_DTOR (3.14159265358979323846/180.0) + +#define FTOFIX32(x) (long)((x) * (float)0x00010000) +#define FIX32TOF(x) ((float)(x) * (1.0f / (float)0x00010000)) +#define FTOFRAC8(x) ((int) MIN(((x) * (128.0f)), 127.0f) & 0xff) + +#define FILTER_WRAP 0 +#define FILTER_CLAMP 1 + +#define RAND(x) (guRandom()%x) /* random number between 0 to x */ + +/* + * Data Structures + */ +typedef struct { + unsigned char *base; + int fmt, siz; + int xsize, ysize; + int lsize; + /* current tile info */ + int addr; + int w, h; + int s, t; +} Image; + +typedef struct { + float col[3]; + float pos[3]; + float a1, a2; /* actual color = col/(a1*dist + a2) */ +} PositionalLight; + + +/* + * Function Prototypes + */ + +extern int guLoadTextureBlockMipMap(Gfx **glist, unsigned char *tbuf, Image *im, + unsigned char startTile, unsigned char pal, unsigned char cms, + unsigned char cmt, unsigned char masks, unsigned char maskt, + unsigned char shifts, unsigned char shiftt, unsigned char cfs, + unsigned char cft); + +extern int guGetDPLoadTextureTileSz (int ult, int lrt); +extern void guDPLoadTextureTile (Gfx *glistp, void *timg, + int texl_fmt, int texl_size, + int img_width, int img_height, + int uls, int ult, int lrs, int lrt, + int palette, + int cms, int cmt, + int masks, int maskt, + int shifts, int shiftt); + + +/* + * matrix operations: + * + * The 'F' version is floating point, in case the application wants + * to do matrix manipulations and convert to fixed-point at the last + * minute. + */ +extern void guMtxIdent(Mtx *m); +extern void guMtxIdentF(float mf[4][4]); +extern void guOrtho(Mtx *m, float l, float r, float b, float t, + float n, float f, float scale); +extern void guOrthoF(float mf[4][4], float l, float r, float b, float t, + float n, float f, float scale); +extern void guFrustum(Mtx *m, float l, float r, float b, float t, + float n, float f, float scale); +extern void guFrustumF(float mf[4][4], float l, float r, float b, float t, + float n, float f, float scale); +extern void guPerspective(Mtx *m, u16 *perspNorm, float fovy, + float aspect, float near, float far, float scale); +extern void guPerspectiveF(float mf[4][4], u16 *perspNorm, float fovy, + float aspect, float near, float far, float scale); +extern void guLookAt(Mtx *m, + float xEye, float yEye, float zEye, + float xAt, float yAt, float zAt, + float xUp, float yUp, float zUp); +extern void guLookAtF(float mf[4][4], float xEye, float yEye, float zEye, + float xAt, float yAt, float zAt, + float xUp, float yUp, float zUp); +extern void guLookAtReflect(Mtx *m, LookAt *l, + float xEye, float yEye, float zEye, + float xAt, float yAt, float zAt, + float xUp, float yUp, float zUp); +extern void guLookAtReflectF(float mf[4][4], LookAt *l, + float xEye, float yEye, float zEye, + float xAt, float yAt, float zAt, + float xUp, float yUp, float zUp); +extern void guLookAtHilite(Mtx *m, LookAt *l, Hilite *h, + float xEye, float yEye, float zEye, + float xAt, float yAt, float zAt, + float xUp, float yUp, float zUp, + float xl1, float yl1, float zl1, + float xl2, float yl2, float zl2, + int twidth, int theight); +extern void guLookAtHiliteF(float mf[4][4], LookAt *l, Hilite *h, + float xEye, float yEye, float zEye, + float xAt, float yAt, float zAt, + float xUp, float yUp, float zUp, + float xl1, float yl1, float zl1, + float xl2, float yl2, float zl2, + int twidth, int theight); +extern void guLookAtStereo(Mtx *m, + float xEye, float yEye, float zEye, + float xAt, float yAt, float zAt, + float xUp, float yUp, float zUp, + float eyedist); +extern void guLookAtStereoF(float mf[4][4], + float xEye, float yEye, float zEye, + float xAt, float yAt, float zAt, + float xUp, float yUp, float zUp, + float eyedist); +extern void guRotate(Mtx *m, float a, float x, float y, float z); +extern void guRotateF(float mf[4][4], float a, float x, float y, float z); +extern void guRotateRPY(Mtx *m, float r, float p, float y); +extern void guRotateRPYF(float mf[4][4], float r, float p, float h); +extern void guAlign(Mtx *m, float a, float x, float y, float z); +extern void guAlignF(float mf[4][4], float a, float x, float y, float z); +extern void guScale(Mtx *m, float x, float y, float z); +extern void guScaleF(float mf[4][4], float x, float y, float z); +extern void guTranslate(Mtx *m, float x, float y, float z); +extern void guTranslateF(float mf[4][4], float x, float y, float z); +extern void guPosition(Mtx *m, float r, float p, float h, float s, + float x, float y, float z); +extern void guPositionF(float mf[4][4], float r, float p, float h, float s, + float x, float y, float z); +extern void guMtxF2L(float mf[4][4], Mtx *m); +extern void guMtxL2F(float mf[4][4], Mtx *m); +extern void guMtxCatF(float m[4][4], float n[4][4], float r[4][4]); +extern void guMtxCatL(Mtx *m, Mtx *n, Mtx *res); +extern void guMtxXFMF(float mf[4][4], float x, float y, float z, + float *ox, float *oy, float *oz); +extern void guMtxXFML(Mtx *m, float x, float y, float z, + float *ox, float *oy, float *oz); + +/* vector utility: */ +extern void guNormalize(float *x, float *y, float *z); + +/* light utilities: */ +void guPosLight(PositionalLight *pl, Light *l, + float xOb, float yOb, float zOb); +void guPosLightHilite(PositionalLight *pl1, PositionalLight *pl2, + Light *l1, Light *l2, + LookAt *l, Hilite *h, + float xEye, float yEye, float zEye, + float xOb, float yOb, float zOb, + float xUp, float yUp, float zUp, + int twidth, int theight); +extern int guRandom(void); + +/* + * Math functions + */ +extern float sinf(float angle); +extern float cosf(float angle); +extern signed short sins (unsigned short angle); +extern signed short coss (unsigned short angle); +extern float sqrtf(float value); +#ifdef __sgi +#pragma intrinsic(sqrtf); +#endif + +/* + * Dump routines for low-level display lists + */ +/* flag values for guParseRdpDL() */ +#define GU_PARSERDP_VERBOSE 1 +#define GU_PARSERDP_PRAREA 2 +#define GU_PARSERDP_PRHISTO 4 +#define GU_PARSERDP_DUMPONLY 32 /* doesn't need to be same as */ + /* GU_PARSEGBI_DUMPOLNY, but this */ + /* allows app to use interchangeably */ + +extern void guParseRdpDL(u64 *rdp_dl, u64 nbytes, u8 flags); +extern void guParseString(char *StringPointer, u64 nbytes); + +/* + * NO LONGER SUPPORTED, + * use guParseRdpDL with GU_PARSERDP_DUMPONLY flags + */ +/* extern void guDumpRawRdpDL(u64 *rdp_dl, u64 nbytes); */ + +/* flag values for guBlinkRdpDL() */ +#define GU_BLINKRDP_HILITE 1 +#define GU_BLINKRDP_EXTRACT 2 + +extern void +guBlinkRdpDL(u64 *rdp_dl_in, u64 nbytes_in, + u64 *rdp_dl_out, u64 *nbytes_out, + u32 x, u32 y, u32 radius, + u8 red, u8 green, u8 blue, + u8 flags); + +/* flag values for guParseGbiDL() */ +#define GU_PARSEGBI_ROWMAJOR 1 +#define GU_PARSEGBI_NONEST 2 +#define GU_PARSEGBI_FLTMTX 4 +#define GU_PARSEGBI_SHOWDMA 8 +#define GU_PARSEGBI_ALLMTX 16 +#define GU_PARSEGBI_DUMPONLY 32 +/* +#define GU_PARSEGBI_HANGAFTER 64 +#define GU_PARSEGBI_NOTEXTURES 128 +*/ +extern void guParseGbiDL(u64 *gbi_dl, u32 nbytes, u8 flags); +extern void guDumpGbiDL(OSTask *tp,u8 flags); + +#define GU_PARSE_GBI_TYPE 1 +#define GU_PARSE_RDP_TYPE 2 +#define GU_PARSE_READY 3 +#define GU_PARSE_MEM_BLOCK 4 +#define GU_PARSE_ABI_TYPE 5 +#define GU_PARSE_STRING_TYPE 6 + +typedef struct { + int dataSize; + int dlType; + int flags; + u32 paddr; +} guDLPrintCB; + +void guSprite2DInit(uSprite *SpritePointer, + void *SourceImagePointer, + void *TlutPointer, + int Stride, + int SubImageWidth, + int SubImageHeight, + int SourceImageType, + int SourceImageBitSize, + int SourceImageOffsetS, + int SourceImageOffsetT); + +#endif /* !_GU_H_ */ diff --git a/include/2.0L/PR/leo.h b/include/2.0L/PR/leo.h new file mode 100644 index 00000000..96f2edd1 --- /dev/null +++ b/include/2.0L/PR/leo.h @@ -0,0 +1,280 @@ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. + + $RCSfile: leo.h,v $ + $Revision: 1.29 $ + $Date: 1998/12/21 07:30:15 $ + *---------------------------------------------------------------------*/ + +#ifndef _LEO_H_ +#define _LEO_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ +typedef u32 LEOError; + +typedef u8 LEOSpdlMode; + +typedef u8 LEOStatus; + +typedef struct +{ + u8 drive; /* version of hw */ + u8 driver; /* version of sw */ + u8 deviceType; /* dev type, always 00 */ + u8 ndevices; /* # of devices, always 01 */ +} LEOVersion; + +typedef struct +{ + u32 startLBA; + u32 endLBA; + u32 nbytes; +} LEOCapacity; + +typedef struct +{ + u8 pad; + u8 yearhi; + u8 yearlo; + u8 month; + u8 day; + u8 hour; + u8 minute; + u8 second; +} LEODiskTime; + +typedef struct +{ + u64 lineNumber; + LEODiskTime time; +} LEOSerialNum; + +typedef struct +{ + u8 gameName[4]; + u8 gameVersion; + u8 diskNumber; + u8 ramUsage; + u8 diskUsage; + LEOSerialNum serialNumber; + u8 company[2]; + u8 freeArea[6]; +} LEODiskID; + +typedef struct +{ + LEOCmdHeader header; + union + { + struct + { + u32 lba; + u32 xfer_blks; + void *buff_ptr; + u32 rw_bytes; +#ifdef _LONGCMD + u32 size; +#endif + } readwrite; + struct + { + u32 lba; + } seek; + struct + { + void *buffer_pointer; + } readdiskid; + LEODiskTime time; + struct + { + u8 reserve1; + u8 reserve2; + u8 standby_time; + u8 sleep_time; + u32 reserve3; + } modeselect; + + } data; + +} LEOCmd; + + +#define _nbytes readwrite.rw_bytes +#define _result header.status + + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ +#define LEO_SW_VERSION 6 /* This will be returned by */ + /* LeoInquiry command */ + +#define OS_PRIORITY_LEOMGR OS_PRIORITY_PIMGR + +/* + * Drive Rom offset address + */ +#define DDROM_FONT_START 0x000a0000 +#define DDROM_WAVEDATA_START 0x00140000 + +/* + * Definition for osLeoSpdlMotor() + */ +#define ACTIVE 0 +#define STANDBY 1 +#define SLEEP 2 +#define BRAKE 4 + +#define LEO_MOTOR_ACTIVE 0 +#define LEO_MOTOR_STANDBY 1 +#define LEO_MOTOR_SLEEP 2 +#define LEO_MOTOR_BRAKE 4 + +#define NUM_LBAS 4292 /* total number of LBAs */ + +#define BLK_SIZE_ZONE0 19720 +#define BLK_SIZE_ZONE1 18360 +#define BLK_SIZE_ZONE2 17680 +#define BLK_SIZE_ZONE3 16320 +#define BLK_SIZE_ZONE4 14960 +#define BLK_SIZE_ZONE5 13600 +#define BLK_SIZE_ZONE6 12240 +#define BLK_SIZE_ZONE7 10880 +#define BLK_SIZE_ZONE8 9520 + +#define MAX_BLK_SIZE BLK_SIZE_ZONE0 +#define MIN_BLK_SIZE BLK_SIZE_ZONE8 + +/* + * Error codes + */ +#define LEO_ERROR_GOOD 0 +#define LEO_ERROR_DRIVE_NOT_READY 1 +#define LEO_ERROR_DIAGNOSTIC_FAILURE 2 +#define LEO_ERROR_COMMAND_PHASE_ERROR 3 +#define LEO_ERROR_DATA_PHASE_ERROR 4 +#define LEO_ERROR_REAL_TIME_CLOCK_FAILURE 5 +#define LEO_ERROR_BUSY 8 +#define LEO_ERROR_INCOMPATIBLE_MEDIUM_INSTALLED 11 +#define LEO_ERROR_UNKNOWN_FORMAT 11 +#define LEO_ERROR_NO_SEEK_COMPLETE 21 +#define LEO_ERROR_WRITE_FAULT 22 +#define LEO_ERROR_UNRECOVERED_READ_ERROR 23 +#define LEO_ERROR_NO_REFERENCE_POSITION_FOUND 24 +#define LEO_ERROR_TRACK_FOLLOWING_ERROR 25 +#define LEO_ERROR_TRACKING_OR_SPDL_SERVO_FAILURE 25 +#define LEO_ERROR_INVALID_COMMAND_OPERATION_CODE 31 +#define LEO_ERROR_LBA_OUT_OF_RANGE 32 +#define LEO_ERROR_WRITE_PROTECT_ERROR 33 +#define LEO_ERROR_COMMAND_CLEARED_BY_HOST 34 +#define LEO_ERROR_COMMAND_TERMINATED 34 +#define LEO_ERROR_QUEUE_FULL 35 +#define LEO_ERROR_ILLEGAL_TIMER_VALUE 36 +#define LEO_ERROR_WAITING_NMI 37 +#define LEO_ERROR_DEVICE_COMMUNICATION_FAILURE 41 +#define LEO_ERROR_MEDIUM_NOT_PRESENT 42 +#define LEO_ERROR_POWERONRESET_DEVICERESET_OCCURED 43 +#define LEO_ERROR_RAMPACK_NOT_CONNECTED 44 +#define LEO_ERROR_MEDIUM_MAY_HAVE_CHANGED 47 +#define LEO_ERROR_EJECTED_ILLEGALLY_RESUME 49 + +/* + * Reserved + */ +#define LEO_ERROR_NOT_BOOTED_DISK 45 +#define LEO_ERROR_DIDNOT_CHANGED_DISK_AS_EXPECTED 46 + +/* + * Error codes only used in IPL + */ +#define LEO_ERROR_RTC_NOT_SET_CORRECTLY 48 +#define LEO_ERROR_DIAGNOSTIC_FAILURE_RESET 50 +#define LEO_ERROR_EJECTED_ILLEGALLY_RESET 51 + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ +#define GET_ERROR(x) ((x).header.sense) + + +/************************************************************************** + * + * Extern variables + * + */ +extern LEODiskID leoBootID; +extern OSPiHandle *__osDiskHandle; /* For exceptasm to get disk info*/ + + +/************************************************************************** + * + * Function prototypes + * + */ +/* Initialize routine */ +extern s32 LeoCreateLeoManager(OSPri comPri, OSPri intPri, + OSMesg *cmdBuf, s32 cmdMsgCnt); +extern s32 LeoCJCreateLeoManager(OSPri comPri, OSPri intPri, + OSMesg *cmdBuf, s32 cmdMsgCnt); +extern s32 LeoCACreateLeoManager(OSPri comPri, OSPri intPri, + OSMesg *cmdBuf, s32 cmdMsgCnt); +extern u32 LeoDriveExist(void); + +/* Synchronous functions */ +extern s32 LeoClearQueue(void); +extern s32 LeoByteToLBA(s32 startLBA, u32 nbytes, s32 *lbas); +extern s32 LeoLBAToByte(s32 startLBA, u32 nLBAs, s32 *bytes); +extern s32 LeoReadCapacity(LEOCapacity *cap, s32 dir); +extern s32 LeoInquiry(LEOVersion *ver); +extern s32 LeoTestUnitReady(LEOStatus *status); + +/* Asynchronous functions */ +extern s32 LeoSpdlMotor(LEOCmd *cmdBlock, LEOSpdlMode mode, OSMesgQueue *mq); +extern s32 LeoSeek(LEOCmd *cmdBlock, u32 lba, OSMesgQueue *mq); +extern s32 LeoRezero(LEOCmd *cmdBlock, OSMesgQueue *mq); +extern s32 LeoReadWrite(LEOCmd *cmdBlock, s32 direction, + u32 LBA, void *vAddr, u32 nLBAs, OSMesgQueue *mq); +extern s32 LeoReadDiskID(LEOCmd *cmdBlock, LEODiskID *vaddr, OSMesgQueue *mq); +extern s32 LeoSetRTC(LEOCmd *cmdBlock, LEODiskTime *RTCdata, OSMesgQueue *mq); +extern s32 LeoReadRTC(LEOCmd *cmdBlock, OSMesgQueue *mq); +extern s32 LeoModeSelectAsync(LEOCmd *cmdBlock, u32 standby, + u32 sleep, OSMesgQueue *mq); + +/* Font routines */ +extern int LeoGetKAdr(int sjis); +extern int LeoGetAAdr(int code,int *dx,int *dy, int *cy); +extern int LeoGetAAdr2(u32 ccode,int *dx,int *dy, int *cy); + +/* Boot function */ +extern void LeoBootGame(void *entry); + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_LEO_H */ diff --git a/include/2.0L/PR/leoappli.h b/include/2.0L/PR/leoappli.h new file mode 100644 index 00000000..619fbc08 --- /dev/null +++ b/include/2.0L/PR/leoappli.h @@ -0,0 +1,274 @@ +/* + * F i l e N a m e : l e o a p p l i . h + * + **************************************************************************** + * (C) Copyright ALPS Electric Co., Ltd. 1995-1997 + **************************************************************************** + * Version + * + * ver Date + * ---- -------- + * 1.01 '97-11-18 Add MOTOR BRAKE definition for control bit. + **************************************************************************** +*/ +/*-----------------------------------*/ +/* DRIVE PARAMETER */ +/*-----------------------------------*/ +#define LEO_DISK_TYPE_MIN 0 +#define LEO_DISK_TYPE_MAX 6 + +#define LEO_LBA_MIN 0 +#define LEO_LBA_MAX 4291 + +#define LEO_LBA_ROM_TOP LEO_LBA_MIN +#define LEO_LBA_ROM_END0 1417 +#define LEO_LBA_ROM_END1 1965 +#define LEO_LBA_ROM_END2 2513 +#define LEO_LBA_ROM_END3 3061 +#define LEO_LBA_ROM_END4 3609 +#define LEO_LBA_ROM_END5 4087 +#define LEO_LBA_ROM_END6 LEO_LBA_MAX +#define LEO_LBA_RAM_TOP0 (LEO_LBA_ROM_END0+1) +#define LEO_LBA_RAM_TOP1 (LEO_LBA_ROM_END1+1) +#define LEO_LBA_RAM_TOP2 (LEO_LBA_ROM_END2+1) +#define LEO_LBA_RAM_TOP3 (LEO_LBA_ROM_END3+1) +#define LEO_LBA_RAM_TOP4 (LEO_LBA_ROM_END4+1) +#define LEO_LBA_RAM_TOP5 (LEO_LBA_ROM_END5+1) +#define LEO_LBA_RAM_TOP6 (LEO_LBA_ROM_END6+1) +#define LEO_LBA_RAM_END6 LEO_LBA_MAX + +/*-----------------------------------*/ +/* LEO FUNCTION DEFINITIONS */ +/*-----------------------------------*/ +extern void leoInitialize(OSPri PRI_WRK, OSPri PRI_INT, OSMesg *command_que_buf, u32 cmd_buff_size); +extern void leoCommand(void *CDB); +extern void LeoReset(void); +extern s32 LeoResetClear(void); + +/*-----------------------------------*/ +/* THREAD PRIORITY */ +/*-----------------------------------*/ +#define LEO_PRIORITY_WRK (OS_PRIORITY_PIMGR-1) +#define LEO_PRIORITY_INT OS_PRIORITY_PIMGR + +/*-----------------------------------*/ +/* COMMAND CODE */ +/*-----------------------------------*/ +#define LEO_COMMAND_CLEAR_QUE 0x01 +#define LEO_COMMAND_INQUIRY 0x02 +#define LEO_COMMAND_TEST_UNIT_READY 0x03 +#define LEO_COMMAND_REZERO 0x04 +#define LEO_COMMAND_READ 0x05 +#define LEO_COMMAND_WRITE 0x06 +#define LEO_COMMAND_SEEK 0x07 +#define LEO_COMMAND_START_STOP 0x08 +#define LEO_COMMAND_READ_CAPACITY 0x09 +#define LEO_COMMAND_TRANSLATE 0x0a +#define LEO_COMMAND_MODE_SELECT 0x0b +#define LEO_COMMAND_READ_DISK_ID 0x0c +#define LEO_COMMAND_READ_TIMER 0x0d +#define LEO_COMMAND_SET_TIMER 0x0e + +/*-----------------------------------*/ +/* CONTROL BIT */ +/*-----------------------------------*/ +#define LEO_CONTROL_POST 0x80 /* ENABLE POST QUEUE */ +#define LEO_CONTROL_START 0x01 /* START COMMAND */ +#define LEO_CONTROL_STBY 0x02 /* STAND-BY MODE(NOT SLEEP MODE) */ +#define LEO_CONTROL_WRT 0x01 /* READ RE-WRITE-ABLE CAPACITY */ +#define LEO_CONTROL_TBL 0x01 /* TRANSLATE BYTE TO LBA */ +#define LEO_CONTROL_BRAKE 0x04 /* SLEEP MODE(BRAKE ON) */ + +/*-----------------------------------*/ +/* BIT FIELD PARAMETER */ +/*-----------------------------------*/ +#define LEO_TEST_UNIT_MR 0x01 /* MEDIUM REMOVED */ +#define LEO_TEST_UNIT_RE 0x02 /* HEAD RETRACTED */ +#define LEO_TEST_UNIT_SS 0x04 /* SPINDLE STOPPED */ + +/*-----------------------------------*/ +/* STATUS */ +/*-----------------------------------*/ +#define LEO_STATUS_GOOD 0x00 +#define LEO_STATUS_CHECK_CONDITION 0x02 +#define LEO_STATUS_BUSY 0x08 + +/*-----------------------------------*/ +/* SENSE CODE */ +/*-----------------------------------*/ +#define LEO_SENSE_NO_ADDITIONAL_SENSE_INFOMATION 00 +#define LEO_SENSE_DRIVE_NOT_READY 01 +#define LEO_SENSE_DIAGNOSTIC_FAILURE 02 +#define LEO_SENSE_COMMAND_PHASE_ERROR 03 +#define LEO_SENSE_DATA_PHASE_ERROR 04 +#define LEO_SENSE_REAL_TIME_CLOCK_FAILURE 05 +#define LEO_SENSE_INCOMPATIBLE_MEDIUM_INSTALLED 11 +#define LEO_SENSE_UNKNOWN_FORMAT 11 +#define LEO_SENSE_NO_SEEK_COMPLETE 21 +#define LEO_SENSE_WRITE_FAULT 22 +#define LEO_SENSE_UNRECOVERED_READ_ERROR 23 +#define LEO_SENSE_NO_REFERENCE_POSITION_FOUND 24 +#define LEO_SENSE_TRACK_FOLLOWING_ERROR 25 +#define LEO_SENSE_TRACKING_OR_SPDL_SERVO_FAILURE 25 +#define LEO_SENSE_INVALID_COMMAND_OPERATION_CODE 31 +#define LEO_SENSE_LBA_OUT_OF_RANGE 32 +#define LEO_SENSE_WRITE_PROTECT_ERROR 33 +#define LEO_SENSE_COMMAND_TERMINATED 34 +#define LEO_SENSE_QUEUE_FULL 35 +#define LEO_SENSE_ILLEGAL_TIMER_VALUE 36 +#define LEO_SENSE_WAITING_NMI 37 +#define LEO_SENSE_DEVICE_COMMUNICATION_FAILURE 41 +#define LEO_SENSE_MEDIUM_NOT_PRESENT 42 +#define LEO_SENSE_POWERONRESET_DEVICERESET_OCCURED 43 +#define LEO_SENSE_MEDIUM_MAY_HAVE_CHANGED 47 +#define LEO_SENSE_EJECTED_ILLEGALLY_RESUME 49 + +/*-----------------------------------*/ +/* Command Block Header */ +/*-----------------------------------*/ +typedef struct{ + u8 command; + u8 reserve1; + u8 control; + u8 reserve3; + u8 status; + u8 sense; + u8 reserve6; + u8 reserve7; + OSMesgQueue *post; +} LEOCmdHeader; + +/*-----------------------------------*/ +/* CLEAR QUEUE(01H) command */ +/*-----------------------------------*/ +typedef struct { + LEOCmdHeader header; +} LEOCmdClearQue; + +/*-----------------------------------*/ +/* INQUIRY(02H) command */ +/*-----------------------------------*/ +typedef struct { + LEOCmdHeader header; + u8 dev_type; + u8 version; + u8 dev_num; + u8 leo_bios_ver; + u32 reserve5; +} LEOCmdInquiry; + +/*-----------------------------------*/ +/* TEST UNIT READY(03H) command */ +/*-----------------------------------*/ +typedef struct { + LEOCmdHeader header; + u8 test; + u8 reserve2; + u8 reserve3; + u8 reserve4; +} LEOCmdTestUnitReady; + +/*-----------------------------------*/ +/* REZERO(04H) command */ +/*-----------------------------------*/ +typedef struct { + LEOCmdHeader header; +} LEOCmdRezero; + +/*-----------------------------------*/ +/* READ(05H) command */ +/*-----------------------------------*/ +typedef struct { + LEOCmdHeader header; + u32 lba; + u32 xfer_blks; + void *buff_ptr; + u32 rw_bytes; +} LEOCmdRead; + +/*-----------------------------------*/ +/* WRITE(06H) command */ +/*-----------------------------------*/ +typedef LEOCmdRead LEOCmdWrite; + +/*-----------------------------------*/ +/* SEEK(07H) command */ +/*-----------------------------------*/ +typedef struct { + LEOCmdHeader header; + u32 lba; +} LEOCmdSeek; + +/*-----------------------------------*/ +/* START/STOP(08H) command */ +/*-----------------------------------*/ +typedef struct { + LEOCmdHeader header; +} LEOCmdStartStop; + +/*-----------------------------------*/ +/* READ CAPACITY(09H) command */ +/*-----------------------------------*/ +typedef struct { + LEOCmdHeader header; + u32 start_lba; + u32 end_lba; + u32 capa_bytes; +} LEOCmdReadCapacity; + +/*-----------------------------------*/ +/* TRANSLATE(0AH) command */ +/*-----------------------------------*/ +typedef struct { + LEOCmdHeader header; + u32 start_lba; + u32 in_param; + u32 out_param; +} LEOCmdTranslate; + +/*-----------------------------------*/ +/* MODE SELECT(0BH) command */ +/*-----------------------------------*/ +typedef struct { + LEOCmdHeader header; + u8 page_code; + u8 reserve1; + u8 standby_time; + u8 sleep_time; + u8 led_on_time; + u8 led_off_time; + u8 reserve18; + u8 reserve19; +} LEOCmdModeSelect; + +/*-----------------------------------*/ +/* READ DISK ID(0CH) command */ +/*-----------------------------------*/ +typedef struct { + LEOCmdHeader header; + void *buffer_pointer; +} LEOCmdReadDiskId; + +/*-----------------------------------*/ +/* READ TIMER(0DH) command */ +/*-----------------------------------*/ +typedef struct { + LEOCmdHeader header; + u8 reserve12; + u8 reserve13; + u8 year; + u8 month; + u8 day; + u8 hour; + u8 minute; + u8 second; +} LEOCmdReadTimer; + +/*-----------------------------------*/ +/* SET TIMER(0EH) command */ +/*-----------------------------------*/ +typedef LEOCmdReadTimer LEOCmdSetTimer; + +/*-------end of leoappli.h--------------------------*/ + + diff --git a/include/2.0L/PR/libaudio.h b/include/2.0L/PR/libaudio.h new file mode 100644 index 00000000..c7f272d5 --- /dev/null +++ b/include/2.0L/PR/libaudio.h @@ -0,0 +1,972 @@ +/*==================================================================== + * libaudio.h + * + * Copyright 1993, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/************************************************************************** + * + * $Revision: 1.173 $ + * $Date: 1997/12/01 12:42:21 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/libaudio.h,v $ + * + **************************************************************************/ + +#ifndef __LIB_AUDIO__ +#define __LIB_AUDIO__ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include + +/*********************************************************************** + * misc defines + ***********************************************************************/ +#ifndef _EMULATOR +# ifdef AUD_PROFILE + +#define PROFILE_AUD(num, cnt, max, min) \ +{ \ + u32 currCnt = osGetCount(); \ + currCnt -= lastCnt[cnt_index]; \ + cnt_index--; \ + cnt += currCnt; \ + num++; \ + \ + if ( currCnt > max ) max = currCnt; \ + if ( currCnt < min ) min = currCnt; \ +} + +# endif /* AUD_PROFILE */ +#endif /* EMULATOR */ + +#ifndef NULL +#define NULL 0 +#endif + +#define AL_FX_BUFFER_SIZE 8192 +#define AL_FRAME_INIT -1 +#define AL_USEC_PER_FRAME 16000 +#define AL_MAX_PRIORITY 127 +#define AL_GAIN_CHANGE_TIME 1000 + +typedef s32 ALMicroTime; +typedef u8 ALPan; + +#define AL_PAN_CENTER 64 +#define AL_PAN_LEFT 0 +#define AL_PAN_RIGHT 127 +#define AL_VOL_FULL 127 +#define AL_KEY_MIN 0 +#define AL_KEY_MAX 127 +#define AL_DEFAULT_FXMIX 0 +#define AL_SUSTAIN 63 + +/*********************************************************************** + * Error handling + ***********************************************************************/ + +#ifdef _DEBUG +#define ALFailIf(condition, error) \ + if (condition) { \ + __osError(error, 0); \ + return; } + +#else +#define ALFailIf(condition, error) \ + if (condition) { \ + return; } +#endif + +#ifdef _DEBUG +#define ALFlagFailIf(condition, flag, error) \ + if (condition) { \ + if(flag) __osError(error, 0); \ + return; } + +#else +#define ALFlagFailIf(condition, flag, error) \ + if (condition) { \ + return; } +#endif + +/*********************************************************************** + * Audio Library global routines + ***********************************************************************/ +typedef struct ALLink_s { + struct ALLink_s *next; + struct ALLink_s *prev; +} ALLink; + +void alUnlink(ALLink *element); +void alLink(ALLink *element, ALLink *after); + +typedef s32 (*ALDMAproc)(s32 addr, s32 len, void *state); +typedef ALDMAproc (*ALDMANew)(void *state); + +void alCopy(void *src, void *dest, s32 len); + +typedef struct { + u8 *base; + u8 *cur; + s32 len; + s32 count; +} ALHeap; + +#define AL_HEAP_DEBUG 1 +#define AL_HEAP_MAGIC 0x20736a73 +#define AL_HEAP_INIT 0 + +void alHeapInit(ALHeap *hp, u8 *base, s32 len); +void *alHeapDBAlloc(u8 *file, s32 line, ALHeap *hp, s32 num, s32 size); +s32 alHeapCheck(ALHeap *hp); + +#ifdef _DEBUG +#define alHeapAlloc(hp, elem ,size) alHeapDBAlloc((u8 *) __FILE__,__LINE__,(hp),(elem),(size)) +#else +#define alHeapAlloc(hp, elem ,size) alHeapDBAlloc(0, 0,(hp),(elem),(size)) +#endif + +/*********************************************************************** + * FX Stuff + ***********************************************************************/ +#define AL_FX_NONE 0 +#define AL_FX_SMALLROOM 1 +#define AL_FX_BIGROOM 2 +#define AL_FX_CHORUS 3 +#define AL_FX_FLANGE 4 +#define AL_FX_ECHO 5 +#define AL_FX_CUSTOM 6 + +typedef u8 ALFxId; +typedef void *ALFxRef; + +/*********************************************************************** + * data structures for sound banks + ***********************************************************************/ + +#define AL_BANK_VERSION 0x4231 /* 'B1' */ + +/* Possible wavetable types */ +enum {AL_ADPCM_WAVE = 0, + AL_RAW16_WAVE}; + +typedef struct { + s32 order; + s32 npredictors; + s16 book[1]; /* Actually variable size. Must be 8-byte aligned */ +} ALADPCMBook; + +typedef struct { + u32 start; + u32 end; + u32 count; + ADPCM_STATE state; +} ALADPCMloop; + +typedef struct { + u32 start; + u32 end; + u32 count; +} ALRawLoop; + +typedef struct { + ALMicroTime attackTime; + ALMicroTime decayTime; + ALMicroTime releaseTime; + u8 attackVolume; + u8 decayVolume; +} ALEnvelope; + +typedef struct { + u8 velocityMin; + u8 velocityMax; + u8 keyMin; + u8 keyMax; + u8 keyBase; + s8 detune; +} ALKeyMap; + +typedef struct { + ALADPCMloop *loop; + ALADPCMBook *book; +} ALADPCMWaveInfo; + +typedef struct { + ALRawLoop *loop; +} ALRAWWaveInfo; + +typedef struct ALWaveTable_s { + u8 *base; /* ptr to start of wave data */ + s32 len; /* length of data in bytes */ + u8 type; /* compression type */ + u8 flags; /* offset/address flags */ + union { + ALADPCMWaveInfo adpcmWave; + ALRAWWaveInfo rawWave; + } waveInfo; +} ALWaveTable; + +typedef struct ALSound_s { + ALEnvelope *envelope; + ALKeyMap *keyMap; + ALWaveTable *wavetable; /* offset to wavetable struct */ + ALPan samplePan; + u8 sampleVolume; + u8 flags; +} ALSound; + +typedef struct { + u8 volume; /* overall volume for this instrument */ + ALPan pan; /* 0 = hard left, 127 = hard right */ + u8 priority; /* voice priority for this instrument */ + u8 flags; + u8 tremType; /* the type of tremelo osc. to use */ + u8 tremRate; /* the rate of the tremelo osc. */ + u8 tremDepth; /* the depth of the tremelo osc */ + u8 tremDelay; /* the delay for the tremelo osc */ + u8 vibType; /* the type of tremelo osc. to use */ + u8 vibRate; /* the rate of the tremelo osc. */ + u8 vibDepth; /* the depth of the tremelo osc */ + u8 vibDelay; /* the delay for the tremelo osc */ + s16 bendRange; /* pitch bend range in cents */ + s16 soundCount; /* number of sounds in this array */ + ALSound *soundArray[1]; +} ALInstrument; + +typedef struct ALBank_s { + s16 instCount; /* number of programs in this bank */ + u8 flags; + u8 pad; + s32 sampleRate; /* e.g. 44100, 22050, etc... */ + ALInstrument *percussion; /* default percussion for GM */ + ALInstrument *instArray[1]; /* ARRAY of instruments */ +} ALBank; + +typedef struct { /* Note: sizeof won't be correct */ + s16 revision; /* format revision of this file */ + s16 bankCount; /* number of banks */ + ALBank *bankArray[1]; /* ARRAY of bank offsets */ +} ALBankFile; + +void alBnkfNew(ALBankFile *f, u8 *table); + +/*********************************************************************** + * Sequence Files + ***********************************************************************/ +#define AL_SEQBANK_VERSION 'S1' + +typedef struct { + u8 *offset; + s32 len; +} ALSeqData; + +typedef struct { /* Note: sizeof won't be correct */ + s16 revision; /* format revision of this file */ + s16 seqCount; /* number of sequences */ + ALSeqData seqArray[1]; /* ARRAY of sequence info */ +} ALSeqFile; + +void alSeqFileNew(ALSeqFile *f, u8 *base); + +/*********************************************************************** + * Synthesis driver stuff + ***********************************************************************/ +typedef ALMicroTime (*ALVoiceHandler)(void *); + +typedef struct { + s32 maxVVoices; /* obsolete */ + s32 maxPVoices; + s32 maxUpdates; + s32 maxFXbusses; + void *dmaproc; + ALHeap *heap; + s32 outputRate; /* output sample rate */ + ALFxId fxType; + s32 *params; +} ALSynConfig; + +typedef struct ALPlayer_s { + struct ALPlayer_s *next; + void *clientData; /* storage for client callback */ + ALVoiceHandler handler; /* voice handler for player */ + ALMicroTime callTime; /* usec requested callback */ + s32 samplesLeft; /* usec remaining to callback */ +} ALPlayer; + +typedef struct ALVoice_s { + ALLink node; + struct PVoice_s *pvoice; + ALWaveTable *table; + void *clientPrivate; + s16 state; + s16 priority; + s16 fxBus; + s16 unityPitch; +} ALVoice; + +typedef struct ALVoiceConfig_s { + s16 priority; /* voice priority */ + s16 fxBus; /* bus assignment */ + u8 unityPitch; /* unity pitch flag */ +} ALVoiceConfig; + +typedef struct { + ALPlayer *head; /* client list head */ + ALLink pFreeList; /* list of free physical voices */ + ALLink pAllocList; /* list of allocated physical voices */ + ALLink pLameList; /* list of voices ready to be freed */ + s32 paramSamples; + s32 curSamples; /* samples from start of game */ + ALDMANew dma; + ALHeap *heap; + + struct ALParam_s *paramList; + + struct ALMainBus_s *mainBus; + struct ALAuxBus_s *auxBus; /* ptr to array of aux bus structs */ + struct ALFilter_s *outputFilter; /* last filter in the filter chain */ + + s32 numPVoices; + s32 maxAuxBusses; + s32 outputRate; /* output sample rate */ + s32 maxOutSamples; /* Maximum samples rsp can generate + at one time at output rate */ +} ALSynth; + +void alSynNew(ALSynth *s, ALSynConfig *config); +void alSynDelete(ALSynth *s); + +void alSynAddPlayer(ALSynth *s, ALPlayer *client); +void alSynRemovePlayer(ALSynth *s, ALPlayer *client); + +s32 alSynAllocVoice(ALSynth *s, ALVoice *v, ALVoiceConfig *vc); +void alSynFreeVoice(ALSynth *s, ALVoice *voice); + +void alSynStartVoice(ALSynth *s, ALVoice *voice, ALWaveTable *w); +void alSynStartVoiceParams(ALSynth *s, ALVoice *voice, ALWaveTable *w, + f32 pitch, s16 vol, ALPan pan, u8 fxmix, + ALMicroTime t); +void alSynStopVoice(ALSynth *s, ALVoice *voice); + +void alSynSetVol(ALSynth *s, ALVoice *v, s16 vol, ALMicroTime delta); +void alSynSetPitch(ALSynth *s, ALVoice *voice, f32 ratio); +void alSynSetPan(ALSynth *s, ALVoice *voice, ALPan pan); +void alSynSetFXMix(ALSynth *s, ALVoice *voice, u8 fxmix); +void alSynSetPriority(ALSynth *s, ALVoice *voice, s16 priority); +s16 alSynGetPriority(ALSynth *s, ALVoice *voice); + +ALFxRef *alSynAllocFX(ALSynth *s, s16 bus, ALSynConfig *c, ALHeap *hp); +ALFxRef alSynGetFXRef(ALSynth *s, s16 bus, s16 index); +void alSynFreeFX(ALSynth *s, ALFxRef *fx); +void alSynSetFXParam(ALSynth *s, ALFxRef fx, s16 paramID, void *param); + +/*********************************************************************** + * Audio Library (AL) stuff + ***********************************************************************/ +typedef struct { + ALSynth drvr; +} ALGlobals; + +extern ALGlobals *alGlobals; + +void alInit(ALGlobals *glob, ALSynConfig *c); +void alClose(ALGlobals *glob); + +Acmd *alAudioFrame(Acmd *cmdList, s32 *cmdLen, s16 *outBuf, s32 outLen); + +/*********************************************************************** + * Sequence Player stuff + ***********************************************************************/ + +/* + * Play states + */ +#define AL_STOPPED 0 +#define AL_PLAYING 1 +#define AL_STOPPING 2 + +#define AL_DEFAULT_PRIORITY 5 +#define AL_DEFAULT_VOICE 0 +#define AL_MAX_CHANNELS 16 + +/* + * Audio Library event type definitions + */ +enum ALMsg { + AL_SEQ_REF_EVT, /* Reference to a pending event in the sequence. */ + AL_SEQ_MIDI_EVT, + AL_SEQP_MIDI_EVT, + AL_TEMPO_EVT, + AL_SEQ_END_EVT, + AL_NOTE_END_EVT, + AL_SEQP_ENV_EVT, + AL_SEQP_META_EVT, + AL_SEQP_PROG_EVT, + AL_SEQP_API_EVT, + AL_SEQP_VOL_EVT, + AL_SEQP_LOOP_EVT, + AL_SEQP_PRIORITY_EVT, + AL_SEQP_SEQ_EVT, + AL_SEQP_BANK_EVT, + AL_SEQP_PLAY_EVT, + AL_SEQP_STOP_EVT, + AL_SEQP_STOPPING_EVT, + AL_TRACK_END, + AL_CSP_LOOPSTART, + AL_CSP_LOOPEND, + AL_CSP_NOTEOFF_EVT, + AL_TREM_OSC_EVT, + AL_VIB_OSC_EVT, + AL_UNK18_EVT +}; + +/* + * Midi event definitions + */ +#define AL_EVTQ_END 0x7fffffff + +enum AL_MIDIstatus { + /* For distinguishing channel number from status */ + AL_MIDI_ChannelMask = 0x0F, + AL_MIDI_StatusMask = 0xF0, + + /* Channel voice messages */ + AL_MIDI_ChannelVoice = 0x80, + AL_MIDI_NoteOff = 0x80, + AL_MIDI_NoteOn = 0x90, + AL_MIDI_PolyKeyPressure = 0xA0, + AL_MIDI_ControlChange = 0xB0, + AL_MIDI_ChannelModeSelect = 0xB0, + AL_MIDI_ProgramChange = 0xC0, + AL_MIDI_ChannelPressure = 0xD0, + AL_MIDI_PitchBendChange = 0xE0, + + /* System messages */ + AL_MIDI_SysEx = 0xF0, /* System Exclusive */ + + /* System common */ + AL_MIDI_SystemCommon = 0xF1, + AL_MIDI_TimeCodeQuarterFrame = 0xF1, + AL_MIDI_SongPositionPointer = 0xF2, + AL_MIDI_SongSelect = 0xF3, + AL_MIDI_Undefined1 = 0xF4, + AL_MIDI_Undefined2 = 0xF5, + AL_MIDI_TuneRequest = 0xF6, + AL_MIDI_EOX = 0xF7, /* End of System Exclusive */ + + /* System real time */ + AL_MIDI_SystemRealTime = 0xF8, + AL_MIDI_TimingClock = 0xF8, + AL_MIDI_Undefined3 = 0xF9, + AL_MIDI_Start = 0xFA, + AL_MIDI_Continue = 0xFB, + AL_MIDI_Stop = 0xFC, + AL_MIDI_Undefined4 = 0xFD, + AL_MIDI_ActiveSensing = 0xFE, + AL_MIDI_SystemReset = 0xFF, + AL_MIDI_Meta = 0xFF /* MIDI Files only */ +}; + +enum AL_MIDIctrl { + AL_MIDI_VOLUME_CTRL = 0x07, + AL_MIDI_PAN_CTRL = 0x0A, + AL_MIDI_PRIORITY_CTRL = 0x10, /* use general purpose controller for priority */ + AL_MIDI_FX_CTRL_0 = 0x14, + AL_MIDI_FX_CTRL_1 = 0x15, + AL_MIDI_FX_CTRL_2 = 0x16, + AL_MIDI_FX_CTRL_3 = 0x17, + AL_MIDI_FX_CTRL_4 = 0x18, + AL_MIDI_FX_CTRL_5 = 0x19, + AL_MIDI_FX_CTRL_6 = 0x1A, + AL_MIDI_FX_CTRL_7 = 0x1B, + AL_MIDI_FX_CTRL_8 = 0x1C, + AL_MIDI_FX_CTRL_9 = 0x1D, + AL_MIDI_SUSTAIN_CTRL = 0x40, + AL_MIDI_FX1_CTRL = 0x5B, + AL_MIDI_FX3_CTRL = 0x5D +}; + +enum AL_MIDImeta { + AL_MIDI_META_TEMPO = 0x51, + AL_MIDI_META_EOT = 0x2f +}; + + +#define AL_CMIDI_BLOCK_CODE 0xFE +#define AL_CMIDI_LOOPSTART_CODE 0x2E +#define AL_CMIDI_LOOPEND_CODE 0x2D +#define AL_CMIDI_CNTRL_LOOPSTART 102 +#define AL_CMIDI_CNTRL_LOOPEND 103 +#define AL_CMIDI_CNTRL_LOOPCOUNT_SM 104 +#define AL_CMIDI_CNTRL_LOOPCOUNT_BIG 105 + +typedef struct { + u8 *curPtr; /* ptr to the next event */ + s32 lastTicks; /* sequence clock ticks (used by alSeqSetLoc) */ + s32 curTicks; /* sequence clock ticks of next event (used by loop end test) */ + s16 lastStatus; /* the last status msg */ +} ALSeqMarker; + +typedef struct { + s32 ticks; /* MIDI, Tempo and End events must start with ticks */ + u8 status; + u8 byte1; + u8 byte2; + u32 duration; +} ALMIDIEvent; + +typedef struct { + s32 ticks; + u8 status; + u8 type; + u8 len; + u8 byte1; + u8 byte2; + u8 byte3; +} ALTempoEvent; + +typedef struct { + s32 ticks; + u8 status; + u8 type; + u8 len; +} ALEndEvent; + +typedef struct { + struct ALVoice_s *voice; +} ALNoteEvent; + +typedef struct { + struct ALVoice_s *voice; + ALMicroTime delta; + u8 vol; +} ALVolumeEvent; + +typedef struct { + s16 vol; +} ALSeqpVolEvent; + +typedef struct { + ALSeqMarker *start; + ALSeqMarker *end; + s32 count; +} ALSeqpLoopEvent; + +typedef struct { + u8 chan; + u8 priority; +} ALSeqpPriorityEvent; + +typedef struct { + void *seq; /* pointer to a seq (could be an ALSeq or an ALCSeq). */ +} ALSeqpSeqEvent; + +typedef struct { + ALBank *bank; +} ALSeqpBankEvent; + +typedef struct { + struct ALVoiceState_s *vs; + void *oscState; + u8 chan; +} ALOscEvent; + +typedef struct { + float unk0; + float unk4; +} ALUnk18Event; + +typedef struct { + struct struct_81_s * unk0; + s32 unk4; +} ALUnk_Core1_3A70_Event; + +typedef struct { + ALVoice voice; + ALSound *sound; /* sound referenced here */ + s16 priority; + f32 pitch; /* current playback pitch */ + s32 state; /* play state for this sound */ + s16 vol; /* volume - combined with volume from bank */ + ALPan pan; /* pan - 0 = left, 127 = right */ + u8 fxMix; /* wet/dry mix - 0 = dry, 127 = wet */ +} ALSoundState; + +typedef struct { + s16 type; + union { + ALMIDIEvent midi; + ALTempoEvent tempo; + ALEndEvent end; + ALNoteEvent note; + ALVolumeEvent vol; + ALSeqpLoopEvent loop; + ALSeqpVolEvent spvol; + ALSeqpPriorityEvent sppriority; + ALSeqpSeqEvent spseq; + ALSeqpBankEvent spbank; + ALOscEvent osc; + ALUnk18Event unk18; + ALUnk_Core1_3A70_Event unk3A70; + } msg; +} ALEvent; + +typedef struct { + ALLink node; + ALMicroTime delta; + ALEvent evt; +} ALEventListItem; + +typedef struct { + ALLink freeList; + ALLink allocList; + s32 eventCount; +} ALEventQueue; + +void alEvtqNew(ALEventQueue *evtq, ALEventListItem *items, + s32 itemCount); +ALMicroTime alEvtqNextEvent(ALEventQueue *evtq, ALEvent *evt); +void alEvtqPostEvent(ALEventQueue *evtq, ALEvent *evt, + ALMicroTime delta); +void alEvtqFlush(ALEventQueue *evtq); +void alEvtqFlushType(ALEventQueue *evtq, s16 type); + + +#define AL_PHASE_ATTACK 0 +#define AL_PHASE_NOTEON 0 +#define AL_PHASE_DECAY 1 +#define AL_PHASE_SUSTAIN 2 +#define AL_PHASE_RELEASE 3 +#define AL_PHASE_SUSTREL 4 + +typedef struct ALVoiceState_s { + struct ALVoiceState_s *next;/* MUST be first */ + ALVoice voice; + ALSound *sound; + ALMicroTime envEndTime; /* time of envelope segment end */ + f32 pitch; /* currect pitch ratio */ + f32 vibrato; /* current value of the vibrato */ + u8 envGain; /* current envelope gain */ + u8 channel; /* channel assignment */ + u8 key; /* note on key number */ + u8 velocity; /* note on velocity */ + u8 envPhase; /* what envelope phase */ + u8 phase; + u8 tremelo; /* current value of the tremelo */ + u8 flags; /* bit 0 tremelo flag + bit 1 vibrato flag */ +} ALVoiceState; + +typedef struct { + ALInstrument *instrument; /* instrument assigned to this chan */ + s16 bendRange; /* pitch bend range in cents */ + ALFxId fxId; /* type of fx assigned to this chan */ + ALPan pan; /* overall pan for this chan */ + u8 priority; /* priority for this chan */ + u8 vol; /* current volume for this chan */ + u8 unk9; + u8 fxmix; /* current fx mix for this chan */ + u8 sustain; /* current sustain pedal state */ + f32 pitchBend; /* current pitch bend val in cents */ +} ALChanState; + +typedef struct ALSeq_s { + u8 *base; /* ptr to start of sequence file */ + u8 *trackStart; /* ptr to first MIDI event */ + u8 *curPtr; /* ptr to next event to read */ + s32 lastTicks; /* MIDI ticks for last event */ + s32 len; /* length of sequence in bytes */ + f32 qnpt; /* qrter notes / tick (1/division) */ + s16 division; /* ticks per quarter note */ + s16 lastStatus; /* for running status */ +} ALSeq; + +typedef struct { + u32 trackOffset[16]; + u32 division; +} ALCMidiHdr; + +typedef struct ALCSeq_s { + ALCMidiHdr *base; /* ptr to start of sequence file */ + u32 validTracks; /* set of flags, showing valid tracks */ + f32 qnpt; /* qrter notes / tick (1/division) */ + u32 lastTicks; /* keep track of ticks incase app wants */ + u32 lastDeltaTicks; /* number of delta ticks of last event */ + u32 deltaFlag; /* flag: set if delta's not subtracted */ + u8 *curLoc[16]; /* ptr to current track location, */ + /* may point to next event, or may point */ + /* to a backup code */ + u8 *curBUPtr[16]; /* ptr to next event if in backup mode */ + u8 curBULen[16]; /* if > 0, then in backup mode */ + u8 lastStatus[16]; /* for running status */ + u32 evtDeltaTicks[16]; /* delta time to next event */ +} ALCSeq; + +typedef struct { + u32 validTracks; + s32 lastTicks; + u32 lastDeltaTicks; + u8 *curLoc[16]; + u8 *curBUPtr[16]; + u8 curBULen[16]; + u8 lastStatus[16]; + u32 evtDeltaTicks[16]; +} ALCSeqMarker; + +#define NO_SOUND_ERR_MASK 0x01 +#define NOTE_OFF_ERR_MASK 0x02 +#define NO_VOICE_ERR_MASK 0x04 + +typedef struct { + s32 maxVoices; /* max number of voices to alloc */ + s32 maxEvents; /* max internal events to support */ + u8 maxChannels; /* max MIDI channels to support (16)*/ + u8 debugFlags; /* control which error get reported */ + ALHeap *heap; /* ptr to initialized heap */ + void *initOsc; + void *updateOsc; + void *stopOsc; +} ALSeqpConfig; + +typedef ALMicroTime (*ALOscInit)(void **oscState,f32 *initVal, u8 oscType, + u8 oscRate, u8 oscDepth, u8 oscDelay); +typedef ALMicroTime (*ALOscUpdate)(void *oscState, f32 *updateVal); +typedef void (*ALOscStop)(void *oscState); + +typedef struct { + ALPlayer node; /* note: must be first in structure */ + ALSynth *drvr; /* reference to the client driver */ + ALSeq *target; /* current sequence */ + ALMicroTime curTime; + ALBank *bank; /* current ALBank */ + s32 uspt; /* microseconds per tick */ + s32 nextDelta; /* microseconds to next callback */ + s32 state; + u16 chanMask; /* active channels */ + s16 vol; /* overall sequence volume */ + u8 maxChannels; /* number of MIDI channels */ + u8 debugFlags; /* control which error get reported */ + ALEvent nextEvent; + ALEventQueue evtq; + ALMicroTime frameTime; + ALChanState *chanState; /* 16 channels for MIDI */ + ALVoiceState *vAllocHead; /* list head for allocated voices */ + ALVoiceState *vAllocTail; /* list tail for allocated voices */ + ALVoiceState *vFreeList; /* list of free voice state structs */ + ALOscInit initOsc; + ALOscUpdate updateOsc; + ALOscStop stopOsc; + ALSeqMarker *loopStart; + ALSeqMarker *loopEnd; + s32 loopCount; /* -1 = loop forever, 0 = no loop */ +} ALSeqPlayer; + +typedef struct { + ALPlayer node; /* note: must be first in structure */ + ALSynth *drvr; /* reference to the client driver */ + ALCSeq *target; /* current sequence */ + ALMicroTime curTime; + ALBank *bank; /* current ALBank */ + s32 uspt; /* microseconds per tick */ + s32 nextDelta; /* microseconds to next callback */ + s32 state; + u16 chanMask; /* active channels */ + s16 vol; /* overall sequence volume */ + u8 maxChannels; /* number of MIDI channels */ + u8 debugFlags; /* control which error get reported */ + ALEvent nextEvent; + ALEventQueue evtq; + ALMicroTime frameTime; + ALChanState *chanState; /* 16 channels for MIDI */ + ALVoiceState *vAllocHead; /* list head for allocated voices */ + ALVoiceState *vAllocTail; /* list tail for allocated voices */ + ALVoiceState *vFreeList; /* list of free voice state structs */ + ALOscInit initOsc; + ALOscUpdate updateOsc; + ALOscStop stopOsc; +} ALCSPlayer; + +/* + * Sequence data representation routines + */ +void alSeqNew(ALSeq *seq, u8 *ptr, s32 len); +void alSeqNextEvent(ALSeq *seq, ALEvent *event); +s32 alSeqGetTicks(ALSeq *seq); +f32 alSeqTicksToSec(ALSeq *seq, s32 ticks, u32 tempo); +u32 alSeqSecToTicks(ALSeq *seq, f32 sec, u32 tempo); +void alSeqNewMarker(ALSeq *seq, ALSeqMarker *m, u32 ticks); +void alSeqSetLoc(ALSeq *seq, ALSeqMarker *marker); +void alSeqGetLoc(ALSeq *seq, ALSeqMarker *marker); +/* + * Compact Sequence data representation routines + */ +void alCSeqNew(ALCSeq *seq, u8 *ptr); +void alCSeqNextEvent(ALCSeq *seq,ALEvent *evt); +s32 alCSeqGetTicks(ALCSeq *seq); +f32 alCSeqTicksToSec(ALCSeq *seq, s32 ticks, u32 tempo); +u32 alCSeqSecToTicks(ALCSeq *seq, f32 sec, u32 tempo); +void alCSeqNewMarker(ALCSeq *seq, ALCSeqMarker *m, u32 ticks); +void alCSeqSetLoc(ALCSeq *seq, ALCSeqMarker *marker); +void alCSeqGetLoc(ALCSeq *seq, ALCSeqMarker *marker); + +/* + * Sequence Player routines + */ +f32 alCents2Ratio(s32 cents); + +void alSeqpNew(ALSeqPlayer *seqp, ALSeqpConfig *config); +void alSeqpDelete(ALSeqPlayer *seqp); +void alSeqpSetSeq(ALSeqPlayer *seqp, ALSeq *seq); +ALSeq *alSeqpGetSeq(ALSeqPlayer *seqp); +void alSeqpPlay(ALSeqPlayer *seqp); +void alSeqpStop(ALSeqPlayer *seqp); +s32 alSeqpGetState(ALSeqPlayer *seqp); +void alSeqpSetBank(ALSeqPlayer *seqp, ALBank *b); +void alSeqpSetTempo(ALSeqPlayer *seqp, s32 tempo); +s32 alSeqpGetTempo(ALSeqPlayer *seqp); +s16 alSeqpGetVol(ALSeqPlayer *seqp); /* Master volume control */ +void alSeqpSetVol(ALSeqPlayer *seqp, s16 vol); +void alSeqpLoop(ALSeqPlayer *seqp, ALSeqMarker *start, ALSeqMarker *end, s32 count); + +void alSeqpSetChlProgram(ALSeqPlayer *seqp, u8 chan, u8 prog); +s32 alSeqpGetChlProgram(ALSeqPlayer *seqp, u8 chan); +void alSeqpSetChlFXMix(ALSeqPlayer *seqp, u8 chan, u8 fxmix); +u8 alSeqpGetChlFXMix(ALSeqPlayer *seqp, u8 chan); +void alSeqpSetChlVol(ALSeqPlayer *seqp, u8 chan, u8 vol); +u8 alSeqpGetChlVol(ALSeqPlayer *seqp, u8 chan); +void alSeqpSetChlPan(ALSeqPlayer *seqp, u8 chan, ALPan pan); +ALPan alSeqpGetChlPan(ALSeqPlayer *seqp, u8 chan); +void alSeqpSetChlPriority(ALSeqPlayer *seqp, u8 chan, u8 priority); +u8 alSeqpGetChlPriority(ALSeqPlayer *seqp, u8 chan); +void alSeqpSendMidi(ALSeqPlayer *seqp, s32 ticks, u8 status, u8 byte1, u8 byte2); + + +/* Maintain backwards compatibility with old routine names. */ +#define alSeqpSetProgram alSeqpSetChlProgram +#define alSeqpGetProgram alSeqpGetChlProgram +#define alSeqpSetFXMix alSeqpSetChlFXMix +#define alSeqpGetFXMix alSeqpGetChlFXMix +#define alSeqpSetPan alSeqpSetChlPan +#define alSeqpGetPan alSeqpGetChlPan +#define alSeqpSetChannelPriority alSeqpSetChlPriority +#define alSeqpGetChannelPriority alSeqpGetChlPriority + + + +/* + * Compressed Sequence Player routines + */ +void alCSPNew(ALCSPlayer *seqp, ALSeqpConfig *config); +void alCSPDelete(ALCSPlayer *seqp); +void alCSPSetSeq(ALCSPlayer *seqp, ALCSeq *seq); +ALCSeq *alCSPGetSeq(ALCSPlayer *seqp); +void alCSPPlay(ALCSPlayer *seqp); +void alCSPStop(ALCSPlayer *seqp); +s32 alCSPGetState(ALCSPlayer *seqp); +void alCSPSetBank(ALCSPlayer *seqp, ALBank *b); +void alCSPSetTempo(ALCSPlayer *seqp, s32 tempo); +s32 alCSPGetTempo(ALCSPlayer *seqp); +s16 alCSPGetVol(ALCSPlayer *seqp); +void alCSPSetVol(ALCSPlayer *seqp, s16 vol); + +void alCSPSetChlProgram(ALCSPlayer *seqp, u8 chan, u8 prog); +s32 alCSPGetChlProgram(ALCSPlayer *seqp, u8 chan); +void alCSPSetChlFXMix(ALCSPlayer *seqp, u8 chan, u8 fxmix); +u8 alCSPGetChlFXMix(ALCSPlayer *seqp, u8 chan); +void alCSPSetChlPan(ALCSPlayer *seqp, u8 chan, ALPan pan); +ALPan alCSPGetChlPan(ALCSPlayer *seqp, u8 chan); +void alCSPSetChlVol(ALCSPlayer *seqp, u8 chan, u8 vol); +u8 alCSPGetChlVol(ALCSPlayer *seqp, u8 chan); +void alCSPSetChlPriority(ALCSPlayer *seqp, u8 chan, u8 priority); +u8 alCSPGetChlPriority(ALCSPlayer *seqp, u8 chan); +void alCSPSendMidi(ALCSPlayer *seqp, s32 ticks, u8 status, + u8 byte1, u8 byte2); + + +/* Maintain backwards compatibility with old routine names. */ +#define alCSPSetProgram alCSPSetChlProgram +#define alCSPGetProgram alCSPGetChlProgram +#define alCSPSetFXMix alCSPSetChlFXMix +#define alCSPGetFXMix alCSPGetChlFXMix +#define alCSPSetPan alCSPSetChlPan +#define alCSPGetPan alCSPGetChlPan +#define alCSPSetChannelPriority alCSPSetChlPriority +#define alCSPGetChannelPriority alCSPGetChlPriority + + + +/*********************************************************************** + * Sound Player stuff + ***********************************************************************/ + +typedef struct { + s32 maxSounds; + s32 maxEvents; + ALHeap *heap; +} ALSndpConfig; + +typedef struct { + ALPlayer node; /* note: must be first in structure */ + ALEventQueue evtq; + ALEvent nextEvent; + ALSynth *drvr; /* reference to the client driver */ + s32 target; + void *sndState; + s32 maxSounds; + ALMicroTime frameTime; + ALMicroTime nextDelta; /* microseconds to next callback */ + ALMicroTime curTime; +} ALSndPlayer; + +typedef s16 ALSndId; + +void alSndpNew(ALSndPlayer *sndp, ALSndpConfig *c); +void alSndpDelete(ALSndPlayer *sndp); + +ALSndId alSndpAllocate(ALSndPlayer *sndp, ALSound *sound); +void alSndpDeallocate(ALSndPlayer *sndp, ALSndId id); + +void alSndpSetSound(ALSndPlayer *sndp, ALSndId id); +ALSndId alSndpGetSound(ALSndPlayer *sndp); + +void alSndpPlay(ALSndPlayer *sndp); +void alSndpPlayAt(ALSndPlayer *sndp, ALMicroTime delta); +void alSndpStop(ALSndPlayer *sndp); + +void alSndpSetVol(ALSndPlayer *sndp, s16 vol); +void alSndpSetPitch(ALSndPlayer *sndp, f32 pitch); +void alSndpSetPan(ALSndPlayer *sndp, ALPan pan); +void alSndpSetPriority(ALSndPlayer *sndp, ALSndId id, u8 priority); + +void alSndpSetFXMix(ALSndPlayer *sndp, u8 mix); +s32 alSndpGetState(ALSndPlayer *sndp); + +#ifndef _FINALROM +void alParseAbiCL(Acmd *cmdList, u32 nbytes); +#endif +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !__LIB_AUDIO__ */ + + + diff --git a/include/2.0L/PR/mbi.h b/include/2.0L/PR/mbi.h new file mode 100644 index 00000000..ac900a54 --- /dev/null +++ b/include/2.0L/PR/mbi.h @@ -0,0 +1,100 @@ +#ifndef _MBI_H_ +#define _MBI_H_ + +/************************************************************************** + * * + * Copyright (C) 1994, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * $Revision: 1.136 $ + * $Date: 1999/01/05 13:04:00 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/mbi.h,v $ + * + **************************************************************************/ + +/* + * Header file for the Media Binary Interface + * + * NOTE: This file is included by the RSP microcode, so any C-specific + * constructs must be bracketed by #ifdef _LANGUAGE_C + * + */ + + +/* + * the SHIFT macros are used to build display list commands, inserting + * bit-fields into a 32-bit word. They take a value, a shift amount, + * and a width. + * + * For the left shift, the lower bits of the value are masked, + * then shifted left. + * + * For the right shift, the value is shifted right, then the lower bits + * are masked. + * + * (NOTE: _SHIFTL(v, 0, 32) won't work, just use an assignment) + * + */ +#define _SHIFTL(v, s, w) \ + ((unsigned int) (((unsigned int)(v) & ((0x01 << (w)) - 1)) << (s))) +#define _SHIFTR(v, s, w) \ + ((unsigned int)(((unsigned int)(v) >> (s)) & ((0x01 << (w)) - 1))) + +#define _SHIFT _SHIFTL /* old, for compatibility only */ + +#define G_ON (1) +#define G_OFF (0) + +/************************************************************************** + * + * Graphics Binary Interface + * + **************************************************************************/ + +#include + +/************************************************************************** + * + * Audio Binary Interface + * + **************************************************************************/ + +#include + +/************************************************************************** + * + * Task list + * + **************************************************************************/ + +#define M_GFXTASK 1 +#define M_AUDTASK 2 +#define M_VIDTASK 3 +#define M_HVQTASK 6 +#define M_HVQMTASK 7 + +/************************************************************************** + * + * Segment macros and definitions + * + **************************************************************************/ + +#define NUM_SEGMENTS (16) +#define SEGMENT_OFFSET(a) ((unsigned int)(a) & 0x00ffffff) +#define SEGMENT_NUMBER(a) (((unsigned int)(a) << 4) >> 28) +#define SEGMENT_ADDR(num, off) (((num) << 24) + (off)) + +#ifndef NULL +#define NULL 0 +#endif + +#endif /* !_MBI_H_ */ diff --git a/include/2.0L/PR/n_abi.h b/include/2.0L/PR/n_abi.h new file mode 100644 index 00000000..fc9c135c --- /dev/null +++ b/include/2.0L/PR/n_abi.h @@ -0,0 +1,122 @@ +/*==================================================================== + * + * Copyright 1993, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +#ifndef __N_ABI__ +#define __N_ABI__ + +/* + * BEGIN C-specific section: (typedef's) + */ + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + + +/* + * Macros to assemble the audio command list + */ + +#define n_aADPCMdec(pkt, s, f, c, a, d) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_ADPCM, 24, 8) | _SHIFTL(s, 0, 24)); \ + _a->words.w1 = (_SHIFTL(f, 28, 4) | _SHIFTL(c, 16, 12) | \ + _SHIFTL(a, 12, 4) | _SHIFTL(d, 0, 12)); \ +} + +#define n_aPoleFilter(pkt, f, g, t, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_POLEF, 24, 8) | _SHIFTL(f, 16, 8) | \ + _SHIFTL(g, 0, 16)); \ + _a->words.w1 = (_SHIFTL(t, 24, 8) | \ + _SHIFTL((unsigned int)(s), 0, 24)); \ +} + +#define n_aEnvMixer(pkt, f, t, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_ENVMIXER, 24, 8) | _SHIFTL(f, 16, 8) |\ + _SHIFTL(t, 0, 16)); \ + _a->words.w1 = (unsigned int)(s); \ +} + +#define n_aInterleave(pkt) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_INTERLEAVE, 24, 8); \ +} + +#define n_aLoadBuffer(pkt, c, d, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_LOADBUFF, 24, 8) | _SHIFTL(c, 12, 12)|\ + _SHIFTL(d, 0, 12)); \ + _a->words.w1 = (unsigned int)(s); \ +} + +#define n_aResample(pkt, s, f, p, i, o) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_RESAMPLE, 24, 8) | _SHIFTL(s, 0, 24));\ + _a->words.w1 = (_SHIFTL(f, 30, 2) | _SHIFTL(p, 14, 16) | \ + _SHIFTL(i, 2, 12) | _SHIFTL(o, 0, 2)); \ +} + +#define n_aSaveBuffer(pkt, c, d, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_SAVEBUFF, 24, 8) | _SHIFTL(c, 12, 12)|\ + _SHIFTL(d, 0, 12)); \ + _a->words.w1 = (unsigned int)(s); \ +} + +#define n_aSetVolume(pkt, f, v, t, r) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_SETVOL, 24, 8) | _SHIFTL(f, 16, 8) | \ + _SHIFTL(v, 0, 16)); \ + _a->words.w1 = _SHIFTL(t, 16, 16) | _SHIFTL(r, 0, 16); \ +} + +#define n_aLoadADPCM(pkt, c, d) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_LOADADPCM, 24, 8) | _SHIFTL(c, 0, 24); \ + _a->words.w1 = (unsigned int) d; \ +} + +#endif /* _LANGUAGE_C */ + +#endif /* __N_ABI__ */ + + + + + + + diff --git a/include/2.0L/PR/n_libaudio.h b/include/2.0L/PR/n_libaudio.h new file mode 100644 index 00000000..0fc0c637 --- /dev/null +++ b/include/2.0L/PR/n_libaudio.h @@ -0,0 +1,380 @@ +/*==================================================================== + * + * Copyright 1993, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +#ifndef __N_LIBAUDIO__ +#define __N_LIBAUDIO__ + +#include + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include + + +/* + * Synthesis driver stuff + */ +typedef struct N_ALVoice_s { + ALLink node; + struct N_PVoice_s *pvoice; + ALWaveTable *table; + void *clientPrivate; + s16 state; + s16 priority; + s16 fxBus; + s16 unityPitch; +} N_ALVoice; + +typedef struct { + ALPlayer *head; /* client list head */ + ALPlayer *n_seqp1; /* for fade in / fade out */ + ALPlayer *n_seqp2; + ALPlayer *n_sndp; + + ALLink pFreeList; /* list of free physical voices */ + ALLink pAllocList; /* list of allocated physical voices */ + ALLink pLameList; /* list of voices ready to be freed */ + s32 paramSamples; + s32 curSamples; /* samples from start of game */ + ALDMANew dma; + ALHeap *heap; + struct ALParam_s *paramList; + struct N_ALMainBus_s *mainBus; + struct N_ALAuxBus_s *auxBus; + s32 numPVoices; + s32 maxAuxBusses; + s32 outputRate; + s32 maxOutSamples; + s32 sv_dramout; + s32 sv_first; + ALPlayer *unk5C; + ALPlayer *unk60; + ALPlayer *unk64; + ALPlayer *unk68; + ALPlayer *unk6C; + ALPlayer *unk70; +} N_ALSynth; + + +void n_alSynAddPlayer(ALPlayer *client); +void n_alSynAddSndPlayer(ALPlayer *client); +void n_alSynAddSeqPlayer(ALPlayer *client); + +ALFxRef n_alSynAllocFX( s16 bus,ALSynConfig *c, ALHeap *hp); +s32 n_alSynAllocVoice( N_ALVoice *voice, ALVoiceConfig *vc); + + +void n_alSynFreeVoice(N_ALVoice *voice); +ALFxRef n_alSynGetFXRef( s16 bus, s16 index); +s16 n_alSynGetPriority( N_ALVoice *voice); +void n_alSynRemovePlayer( ALPlayer *client); +void n_alSynSetFXMix(N_ALVoice *v, u8 fxmix); +void n_alSynSetFXParam(ALFxRef fx, s16 paramID, void *param); +void n_alSynFreeFX(ALFxRef *fx); +void n_alSynSetPan(N_ALVoice *v, u8 pan); +void n_alSynSetPitch( N_ALVoice *v, f32 pitch); +void n_alSynSetPriority( N_ALVoice *voice, s16 priority); +void n_alSynSetVol( N_ALVoice *v, s16 volume, ALMicroTime t); +void n_alSynStartVoice(N_ALVoice *v, ALWaveTable *table); +void n_alSynStartVoiceParams(N_ALVoice *v, ALWaveTable *w,f32 pitch, s16 vol, + ALPan pan, u8 fxmix, ALMicroTime t); +void n_alSynStopVoice( N_ALVoice *v); + +void n_alSynNew(ALSynConfig *c); +void n_alSynDelete(void); + + +/* + * Audio Library (AL) stuff + */ +typedef struct { + N_ALSynth drvr; +} N_ALGlobals; + +extern N_ALGlobals *n_alGlobals; +// extern N_ALSynth *n_syn; + +void n_alInit(N_ALGlobals *g, ALSynConfig *c); +void n_alClose(N_ALGlobals *glob); +Acmd *n_alAudioFrame(Acmd *cmdList, s32 *cmdLen, + s16 *outBuf, s32 outLen); + + +/* + * Sequence Player stuff + */ +typedef struct { + struct N_ALVoice_s *voice; +} N_ALNoteEvent; + + +typedef struct { + struct N_ALVoice_s *voice; + ALMicroTime delta; + u8 vol; +} N_ALVolumeEvent; + + +typedef struct { + struct N_ALVoiceState_s *vs; + void *oscState; + u8 chan; +} N_ALOscEvent; + + +typedef struct { + s16 type; + union { + ALMIDIEvent midi; + ALTempoEvent tempo; + ALEndEvent end; + N_ALNoteEvent note; + N_ALVolumeEvent vol; + ALSeqpLoopEvent loop; + ALSeqpVolEvent spvol; + ALSeqpPriorityEvent sppriority; + ALSeqpSeqEvent spseq; + ALSeqpBankEvent spbank; + N_ALOscEvent osc; + } msg; +} N_ALEvent; + + +typedef struct { + ALLink node; + ALMicroTime delta; + N_ALEvent evt; +} N_ALEventListItem; + +void n_alEvtqNew(ALEventQueue *evtq, N_ALEventListItem *items, s32 itemCount); +ALMicroTime n_alEvtqNextEvent(ALEventQueue *evtq, N_ALEvent *evt); +void n_alEvtqPostEvent(ALEventQueue *evtq, N_ALEvent *evt, ALMicroTime delta, s32 foo); +void n_alEvtqFlushType(ALEventQueue *evtq, s16 type); + +//N_ALVoiceState? +typedef struct struct_81_s{ + ALLink node; + ALSound *unk8; + N_ALVoice voice; + f32 unk28; //pitch? + f32 unk2C; //vibrato? + struct struct_81_s **unk30; + s16 unk34; + s8 unk36; + u8 pad37[1]; + s32 unk38; + u8 envPhase; + u8 unk3D; + u8 unk3E; + u8 unk3F; //key + u8 unk40; + u8 pad41[3]; + f32 unk44; //volume + ALMicroTime unk48; //time_remaining? + s32 unk4C; +} Struct81s; + +typedef struct N_ALVoiceState_s { + struct N_ALVoiceState_s *next;/* MUST be first */ + N_ALVoice voice; + ALSound *sound; + ALMicroTime envEndTime; /* time of envelope segment end */ + f32 pitch; /* currect pitch ratio */ + f32 vibrato; /* current value of the vibrato */ + u8 envGain; /* current envelope gain */ + u8 channel; /* channel assignment */ + u8 key; /* note on key number */ + u8 velocity; /* note on velocity */ + u8 envPhase; /* what envelope phase */ + u8 phase; + u8 tremelo; /* current value of the tremelo */ + u8 flags; /* bit 0 tremelo flag + bit 1 vibrato flag */ +} N_ALVoiceState; + +typedef struct { + ALPlayer node; /* note: must be first in structure */ + N_ALSynth *drvr; /* reference to the client driver */ + ALSeq *target; /* current sequence */ + ALMicroTime curTime; + ALBank *bank; /* current ALBank */ + s32 uspt; /* microseconds per tick */ + s32 nextDelta; /* microseconds to next callback */ + s32 state; + u16 chanMask; /* active channels */ + s16 vol; /* overall sequence volume */ + u8 maxChannels; /* number of MIDI channels */ + u8 debugFlags; /* control which error get reported */ + N_ALEvent nextEvent; + ALEventQueue evtq; + ALMicroTime frameTime; + ALChanState *chanState; /* 16 channels for MIDI */ + N_ALVoiceState *vAllocHead; /* list head for allocated voices */ + N_ALVoiceState *vAllocTail; /* list tail for allocated voices */ + N_ALVoiceState *vFreeList; /* list of free voice state structs */ + ALOscInit initOsc; + ALOscUpdate updateOsc; + ALOscStop stopOsc; + ALSeqMarker *loopStart; + ALSeqMarker *loopEnd; + s32 loopCount; /* -1 = loop forever, 0 = no loop */ +} N_ALSeqPlayer; + +typedef struct { + ALPlayer node; /* note: must be first in structure */ + N_ALSynth *drvr; /* reference to the client driver */ + ALCSeq *target; /* current sequence */ + ALMicroTime curTime; + ALBank *bank; /* current ALBank */ + s32 uspt; /* microseconds per tick */ + s32 nextDelta; /* microseconds to next callback */ + s32 state; + u16 chanMask; /* active channels */ + s16 vol; /* overall sequence volume */ + u8 maxChannels; /* number of MIDI channels */ + u8 debugFlags; /* control which error get reported */ + N_ALEvent nextEvent; + ALEventQueue evtq; + ALMicroTime frameTime; + ALChanState *chanState; /* 16 channels for MIDI */ + N_ALVoiceState *vAllocHead; /* list head for allocated voices */ + N_ALVoiceState *vAllocTail; /* list tail for allocated voices */ + N_ALVoiceState *vFreeList; /* list of free voice state structs */ + ALOscInit initOsc; + ALOscUpdate updateOsc; + ALOscStop stopOsc; +} N_ALCSPlayer; + + +/* + * Sequence data representation routines + */ +void n_alSeqNextEvent(ALSeq *seq, N_ALEvent *event); +void n_alSeqNewMarker(ALSeq *seq, ALSeqMarker *m, u32 ticks); + +void n_alCSeqNew(ALCSeq *seq, u8 *ptr); +void n_alCSeqNextEvent(ALCSeq *seq, N_ALEvent *evt); +void n_alCSeqNewMarker(ALCSeq *seq, ALCSeqMarker *m, u32 ticks); + + +/* + * Sequence Player routines + */ +void n_alSeqpNew(N_ALSeqPlayer *seqp, ALSeqpConfig *config); +void n_alSeqpDelete(N_ALSeqPlayer *seqp); +u8 n_alSeqpGetChlVol(N_ALSeqPlayer *seqp, u8 chan); +u8 n_alSeqpGetChlFXMix(N_ALSeqPlayer *seqp, u8 chan); +ALPan n_alSeqpGetChlPan(N_ALSeqPlayer *seqp, u8 chan); +u8 n_alSeqpGetChlPriority(N_ALSeqPlayer *seqp, u8 chan); +s32 n_alSeqpGetChlProgram(N_ALSeqPlayer *seqp, u8 chan); +ALSeq *n_alSeqpGetSeq(N_ALSeqPlayer *seqp); +s32 n_alSeqpGetState(N_ALSeqPlayer *seqp); +s32 n_alSeqpGetTempo(N_ALSeqPlayer *seqp); +s16 n_alSeqpGetVol(N_ALSeqPlayer *seqp); /* Master volume control */ +void n_alSeqpPlay(N_ALSeqPlayer *seqp); +void n_alSeqpSendMidi(N_ALSeqPlayer *seqp, s32 ticks, u8 status, u8 byte1, u8 byte2); +void n_alSeqpSetBank(N_ALSeqPlayer *seqp, ALBank *b); +void n_alSeqpSetChlVol(N_ALSeqPlayer *seqp, u8 chan, u8 vol); +void n_alSeqpSetChlFXMix(N_ALSeqPlayer *seqp, u8 chan, u8 fxmix); +void n_alSeqpSetChlPan(N_ALSeqPlayer *seqp, u8 chan, ALPan pan); +void n_alSeqpSetChlPriority(N_ALSeqPlayer *seqp, u8 chan, u8 priority); +void n_alSeqpSetChlProgram(N_ALSeqPlayer *seqp, u8 chan, u8 prog); +void n_alSeqpSetSeq(N_ALSeqPlayer *seqp, ALSeq *seq); +void n_alSeqpSetTempo(N_ALSeqPlayer *seqp, s32 tempo); +void n_alSeqpSetVol(N_ALSeqPlayer *seqp, s16 vol); +void n_alSeqpStop(N_ALSeqPlayer *seqp); +void n_alSeqpLoop(N_ALSeqPlayer *seqp, ALSeqMarker *start, ALSeqMarker *end, s32 count); + + +/* + * Compressed Sequence Player routines + */ +void n_alCSPNew(N_ALCSPlayer *seqp, ALSeqpConfig *config); +void n_alCSPDelete(N_ALCSPlayer *seqp); +u8 n_alCSPGetChlVol(N_ALCSPlayer *seqp, u8 chan); +u8 n_alCSPGetChlFXMix(N_ALCSPlayer *seqp, u8 chan); +ALPan n_alCSPGetChlPan(N_ALCSPlayer *seqp, u8 chan); +u8 n_alCSPGetChlPriority(N_ALCSPlayer *seqp, u8 chan); +s32 n_alCSPGetChlProgram(N_ALCSPlayer *seqp, u8 chan); +ALCSeq *n_alCSPGetSeq(N_ALCSPlayer *seqp); +s32 n_alCSPGetState(N_ALCSPlayer *seqp); +s32 n_alCSPGetTempo(N_ALCSPlayer *seqp); +s16 n_alCSPGetVol(N_ALCSPlayer *seqp); +void n_alCSPPlay(N_ALCSPlayer *seqp); +void n_alCSPSendMidi(N_ALCSPlayer *seqp, s32 ticks, u8 status, u8 byte1, u8 byte2); +void n_alCSPSetBank(N_ALCSPlayer *seqp, ALBank *b); +void n_alCSPSetChlVol(N_ALCSPlayer *seqp, u8 chan, u8 vol); +void n_alCSPSetChlFXMix(N_ALCSPlayer *seqp, u8 chan, u8 fxmix); +void n_alCSPSetChlPan(N_ALCSPlayer *seqp, u8 chan, ALPan pan); +void n_alCSPSetChlPriority(N_ALCSPlayer *seqp, u8 chan, u8 priority); +void n_alCSPSetChlProgram(N_ALCSPlayer *seqp, u8 chan, u8 prog); +void n_alCSPSetSeq(N_ALCSPlayer *seqp, ALCSeq *seq); +void n_(N_ALCSPlayer *seqp, s32 tempo); +void n_alCSPSetVol(N_ALCSPlayer *seqp, s16 vol); +void n_alCSPStop(N_ALCSPlayer *seqp); + + +/* + * Sound Player stuff + */ +typedef struct { + ALPlayer node; /* note: must be first in structure */ + ALEventQueue evtq; + N_ALEvent nextEvent; + N_ALSynth *drvr; /* reference to the client driver */ + s32 target; + void *sndState; + s32 maxSounds; + ALMicroTime frameTime; + ALMicroTime nextDelta; /* microseconds to next callback */ + ALMicroTime curTime; +} N_ALSndPlayer; + +void n_alSndpNew(N_ALSndPlayer *sndp, ALSndpConfig *c); +void n_alSndpDelete(void); +ALSndId n_alSndpAllocate(ALSound *sound); +void n_alSndpDeallocate(ALSndId id); +s32 n_alSndpGetState(void); +void n_alSndpPlay(void); +void n_alSndpPlayAt(ALMicroTime delta); +void n_alSndpSetFXMix(u8 mix); +void n_alSndpSetPan(ALPan pan); +void n_alSndpSetPitch(f32 pitch); +void n_alSndpSetPriority(ALSndId id, u8 priority); +void n_alSndpSetVol(s16 vol); +void n_alSndpStop(void); +ALSndId n_alSndpGetSound(void); +void n_alSndpSetSound(ALSndId id); + + +/* + * for n_audio micro code + */ +extern long long int n_aspMainTextStart[], n_aspMainTextEnd[]; +extern long long int n_aspMainDataStart[], n_aspMainDataEnd[]; + + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* __N_LIBAUDIO__ */ diff --git a/include/2.0L/PR/n_libaudio_s_to_n.h b/include/2.0L/PR/n_libaudio_s_to_n.h new file mode 100644 index 00000000..4fb19ee8 --- /dev/null +++ b/include/2.0L/PR/n_libaudio_s_to_n.h @@ -0,0 +1,120 @@ +#define ALVoice N_ALVoice +#define ALSynth N_ALSynth +#define ALGlobals N_ALGlobals + +#define n_alSynAddPlayer( a, b) n_alSynAddPlayer( b) +#define alSynAllocFX( a, b, c, d) n_alSynAllocFX( b, c, d) +#define alSynAllocVoice( a, b, c) n_alSynAllocVoice( b, c) +#define alSynDelete( a) n_alSynDelete() +#define alSynFreeVoice( a, b) n_alSynFreeVoice( b) +#define alSynGetFXRef( a, b, c) n_alSynGetFXRef( b, c) +#define alSynGetPriority( a, b) n_alSynGetPriority( b) +#define alSynRemovePlayer( a, b) n_alSynRemovePlayer( b) +#define alSynSetFXMix( a, b, c) n_alSynSetFXMix( b, c) +#define alSynSetFXParam( a, b, c, d) n_alSynSetFXParam( b, c, d) +#define alSynFreeFX( a, b) n_alSynFreeFX( b) +#define alSynSetPan( a, b, c) n_alSynSetPan( b, c) +#define alSynSetPitch( a, b, c) n_alSynSetPitch( b, c) +#define alSynSetPriority( a, b, c) n_alSynSetPriority( b, c) +#define alSynSetVol( a, b, c, d) n_alSynSetVol( b, c, d) +#define alSynStartVoice( a, b, c) n_alSynStartVoice( b, c) +#define n_alSynStartVoiceParams( a, b, c, d, e, f, g, h) \ + n_n_alSynStartVoiceParams( b, c, d, e, f, g, h) +#define alSynStopVoice( a, b) n_alSynStopVoice( b) +#define alSynNew( a, b) n_alSynNew( b) + +#define alInit n_alInit +#define alClose n_alClose +#define alAudioFrame n_alAudioFrame + +#define ALVoiceState N_ALVoiceState +#define ALSeqPlayer N_ALSeqPlayer +#define ALCSPlayer N_ALCSPlayer + +#define alSeqNextEvent n_alSeqNextEvent +#define alSeqNewMarker n_alSeqNewMarker + +#define alCSeqNew n_alCSeqNew +#define alCSeqNextEvent n_alCSeqNextEvent +#define alCSeqNewMarker n_alCSeqNewMarker + +#define alSeqpNew n_alSeqpNew +#define alSeqpDelete n_alSeqpDelete +#define alSeqpGetChlVol n_alSeqpGetChlVol +#define alSeqpGetChlFXMix n_alSeqpGetChlFXMix +#define alSeqpGetChlPan n_alSeqpGetChlPan +#define alSeqpGetChlPriority n_alSeqpGetChlPriority +#define alSeqpGetChlProgram n_alSeqpGetChlProgram +#define alSeqpGetSeq n_alSeqpGetSeq +#define alSeqpGetState n_alSeqpGetState +#define alSeqpGetTempo n_alSeqpGetTempo +#define alSeqpGetVol n_alSeqpGetVol +#define alSeqpPlay n_alSeqpPlay +#define alSeqpSendMidi n_alSeqpSendMidi +#define alSeqpSetBank n_alSeqpSetBank +#define alSeqpSetChlVol n_alSeqpSetChlVol +#define alSeqpSetChlFXMix n_alSeqpSetChlFXMix +#define alSeqpSetChlPan n_alSeqpSetChlPan +#define alSeqpSetChlPriority n_alSeqpSetChlPriority +#define alSeqpSetChlProgram n_alSeqpSetChlProgram +#define alSeqpSetSeq n_alSeqpSetSeq +#define alSeqpSetTempo n_alSeqpSetTempo +#define alSeqpSetVol n_alSeqpSetVol +#define alSeqpStop n_alSeqpStop +#define alSeqpLoop n_alSeqpLoop + +#define alCSPNew n_alCSPNew +#define alCSPDelete n_alCSPDelete +#define alCSPGetChlVol n_alCSPGetChlVol +#define alCSPGetChlFXMix n_alCSPGetChlFXMix +#define alCSPGetChlPan n_alCSPGetChlPan +#define alCSPGetChlPriority n_alCSPGetChlPriority +#define alCSPGetChlProgram n_alCSPGetChlProgram +#define alCSPGetSeq n_alCSPGetSeq +#define alCSPGetState n_alCSPGetState +#define alCSPGetTempo n_alCSPGetTempo +#define alCSPGetVol n_alCSPGetVol +#define alCSPPlay n_alCSPPlay +#define alCSPSendMidi n_alCSPSendMidi +#define alCSPSetBank n_alCSPSetBank +#define alCSPSetChlVol n_alCSPSetChlVol +#define alCSPSetChlFXMix n_alCSPSetChlFXMix +#define alCSPSetChlPan n_alCSPSetChlPan +#define alCSPSetChlPriority n_alCSPSetChlPriority +#define alCSPSetChlProgram n_alCSPSetChlProgram +#define alCSPSetSeq n_alCSPSetSeq +#define n_ +#define alCSPSetVol n_alCSPSetVol +#define alCSPStop n_alCSPStop + +#define ALSoundState N_ALSoundState +#define ALSndpEvent N_ALSndpEvent +#define ALSndPlayer N_ALSndPlayer + +#define alSndpNew( a, b) n_alSndpNew( a, b) +#define alSndpDelete( a) n_alSndpDelete() +#define alSndpAllocate( a, b) n_alSndpAllocate( b) +#define alSndpDeallocate( a, b) n_alSndpDeallocate( b) +#define alSndpGetState( a) n_alSndpGetState() +#define alSndpPlay( a) n_alSndpPlay() +#define alSndpPlayAt( a, b) n_alSndpPlayAt( b) +#define alSndpSetFXMix( a, b) n_alSndpSetFXMix( b) +#define alSndpSetPan( a, b) n_alSndpSetPan( b) +#define alSndpSetPitch( a, b) n_alSndpSetPitch( b) +#define alSndpSetPriority( a, b, c) n_alSndpSetPriority( b, c) +#define alSndpSetVol( a, b) n_alSndpSetVol( b) +#define alSndpStop( a) n_alSndpStop() +#define alSndpGetSound( a) n_alSndpGetSound() +#define alSndpSetSound( a, b) n_alSndpSetSound( b) + +#define alEvtqNew n_alEvtqNew +#define alEvtqNextEvent n_alEvtqNextEvent +#define alEvtqPostEvent n_alEvtqPostEvent +#define alEvtqFlushType n_alEvtqFlushType +#define alEvtqPrintEvtQueue n_alEvtqPrintEvtQueue +#define alEvtqPrintAllocEvts n_alEvtqPrintAllocEvts + + + + + diff --git a/include/2.0L/PR/os.h b/include/2.0L/PR/os.h new file mode 100644 index 00000000..4b52dfb2 --- /dev/null +++ b/include/2.0L/PR/os.h @@ -0,0 +1,108 @@ + +/*==================================================================== + * os.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os.h,v $ + $Revision: 1.168 $ + $Date: 2000/06/15 06:24:52 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_H_ +#define _OS_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +/************************************************************************** + * + * Global definitions + * + */ + +/* + * Stack size for I/O device managers: PIM (PI Manager), VIM (VI Manager), + * SIM (SI Manager) + * + */ +#define OS_PIM_STACKSIZE 4096 +#define OS_VIM_STACKSIZE 4096 +#define OS_SIM_STACKSIZE 4096 + +#define OS_MIN_STACKSIZE 72 + +/* + * Leo Disk + */ + +/* transfer mode */ + +#define LEO_BLOCK_MODE 1 +#define LEO_TRACK_MODE 2 +#define LEO_SECTOR_MODE 3 + +/* + * Boot addresses + */ +#define BOOT_ADDRESS_ULTRA 0x80000400 +#define BOOT_ADDRESS_COSIM 0x80002000 +#define BOOT_ADDRESS_EMU 0x20010000 +#define BOOT_ADDRESS_INDY 0x88100000 + + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_H */ diff --git a/include/2.0L/PR/os_ai.h b/include/2.0L/PR/os_ai.h new file mode 100644 index 00000000..f89d87cf --- /dev/null +++ b/include/2.0L/PR/os_ai.h @@ -0,0 +1,92 @@ + +/*==================================================================== + * os_ai.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_ai.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:04 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_AI_H_ +#define _OS_AI_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Audio interface (Ai) */ +extern u32 osAiGetStatus(void); +extern u32 osAiGetLength(void); +extern s32 osAiSetFrequency(u32); +extern s32 osAiSetNextBuffer(void *, u32); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_AI_H_ */ diff --git a/include/2.0L/PR/os_cache.h b/include/2.0L/PR/os_cache.h new file mode 100644 index 00000000..54ed9230 --- /dev/null +++ b/include/2.0L/PR/os_cache.h @@ -0,0 +1,96 @@ + +/*==================================================================== + * os_cache.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_cache.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:04 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_CACHE_H_ +#define _OS_CACHE_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + +#define OS_DCACHE_ROUNDUP_ADDR(x) (void *)(((((u32)(x)+0xf)/0x10)*0x10)) +#define OS_DCACHE_ROUNDUP_SIZE(x) (u32)(((((u32)(x)+0xf)/0x10)*0x10)) + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Cache operations and macros */ + +extern void osInvalDCache(void *, s32); +extern void osInvalICache(void *, s32); +extern void osWritebackDCache(void *, s32); +extern void osWritebackDCacheAll(void); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_CACHE_H_ */ diff --git a/include/2.0L/PR/os_cont.h b/include/2.0L/PR/os_cont.h new file mode 100644 index 00000000..2754f250 --- /dev/null +++ b/include/2.0L/PR/os_cont.h @@ -0,0 +1,207 @@ + +/*==================================================================== + * os_cont.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_cont.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:05 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_CONT_H_ +#define _OS_CONT_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include "os_message.h" + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +/* + * Structure for controllers + */ + +typedef struct { + u16 type; /* Controller Type */ + u8 status; /* Controller status */ + u8 errno; +}OSContStatus; + +typedef struct { + u16 button; + s8 stick_x; /* -80 <= stick_x <= 80 */ + s8 stick_y; /* -80 <= stick_y <= 80 */ + u8 errno; +} OSContPad; + +typedef struct { + void *address; /* Ram pad Address: 11 bits */ + u8 databuffer[32]; /* address of the data buffer */ + u8 addressCrc; /* CRC code for address */ + u8 dataCrc; /* CRC code for data */ + u8 errno; +} OSContRamIo; + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* + * Controllers number + */ + +#ifndef _HW_VERSION_1 +#define MAXCONTROLLERS 4 +#else +#define MAXCONTROLLERS 6 +#endif + +/* controller errors */ +#define CONT_NO_RESPONSE_ERROR 0x8 +#define CONT_OVERRUN_ERROR 0x4 +#ifdef _HW_VERSION_1 +#define CONT_FRAME_ERROR 0x2 +#define CONT_COLLISION_ERROR 0x1 +#endif + +/* Controller type */ + +#define CONT_ABSOLUTE 0x0001 +#define CONT_RELATIVE 0x0002 +#define CONT_JOYPORT 0x0004 +#define CONT_EEPROM 0x8000 +#define CONT_EEP16K 0x4000 +#define CONT_TYPE_MASK 0x1f07 +#define CONT_TYPE_NORMAL 0x0005 +#define CONT_TYPE_MOUSE 0x0002 +#define CONT_TYPE_VOICE 0x0100 + +/* Controller status */ + +#define CONT_CARD_ON 0x01 +#define CONT_CARD_PULL 0x02 +#define CONT_ADDR_CRC_ER 0x04 +#define CONT_EEPROM_BUSY 0x80 + +/* Buttons */ + +#define CONT_A 0x8000 +#define CONT_B 0x4000 +#define CONT_G 0x2000 +#define CONT_START 0x1000 +#define CONT_UP 0x0800 +#define CONT_DOWN 0x0400 +#define CONT_LEFT 0x0200 +#define CONT_RIGHT 0x0100 +#define CONT_L 0x0020 +#define CONT_R 0x0010 +#define CONT_E 0x0008 +#define CONT_D 0x0004 +#define CONT_C 0x0002 +#define CONT_F 0x0001 + +/* Nintendo's official button names */ + +#define A_BUTTON CONT_A +#define B_BUTTON CONT_B +#define L_TRIG CONT_L +#define R_TRIG CONT_R +#define Z_TRIG CONT_G +#define START_BUTTON CONT_START +#define U_JPAD CONT_UP +#define L_JPAD CONT_LEFT +#define R_JPAD CONT_RIGHT +#define D_JPAD CONT_DOWN +#define U_CBUTTONS CONT_E +#define L_CBUTTONS CONT_C +#define R_CBUTTONS CONT_F +#define D_CBUTTONS CONT_D + +/* Controller error number */ + +#define CONT_ERR_NO_CONTROLLER PFS_ERR_NOPACK /* 1 */ +#define CONT_ERR_CONTRFAIL CONT_OVERRUN_ERROR /* 4 */ +#define CONT_ERR_INVALID PFS_ERR_INVALID /* 5 */ +#define CONT_ERR_DEVICE PFS_ERR_DEVICE /* 11 */ +#define CONT_ERR_NOT_READY 12 +#define CONT_ERR_VOICE_MEMORY 13 +#define CONT_ERR_VOICE_WORD 14 +#define CONT_ERR_VOICE_NO_RESPONSE 15 + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Controller interface */ + +extern s32 osContInit(OSMesgQueue *, u8 *, OSContStatus *); +extern s32 osContReset(OSMesgQueue *, OSContStatus *); +extern s32 osContStartQuery(OSMesgQueue *); +extern s32 osContStartReadData(OSMesgQueue *); +#ifndef _HW_VERSION_1 +extern s32 osContSetCh(u8); +#endif +extern void osContGetQuery(OSContStatus *); +extern void osContGetReadData(OSContPad *); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_CONT_H_ */ diff --git a/include/2.0L/PR/os_convert.h b/include/2.0L/PR/os_convert.h new file mode 100644 index 00000000..0a5da10a --- /dev/null +++ b/include/2.0L/PR/os_convert.h @@ -0,0 +1,111 @@ + +/*==================================================================== + * os_convert.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_convert.h,v $ + $Revision: 1.2 $ + $Date: 1999/04/21 02:53:11 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_CONVERT_H_ +#define _OS_CONVERT_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +#define OS_CLOCK_RATE 62500000LL +#define OS_CPU_COUNTER (OS_CLOCK_RATE*3/4) + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + +#define OS_NSEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625000LL))/(1000000000LL/15625000LL)) +#define OS_USEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625LL))/(1000000LL/15625LL)) +#define OS_CYCLES_TO_NSEC(c) (((u64)(c)*(1000000000LL/15625000LL))/(OS_CPU_COUNTER/15625000LL)) +#define OS_CYCLES_TO_USEC(c) (((u64)(c)*(1000000LL/15625LL))/(OS_CPU_COUNTER/15625LL)) + +/* OS_K?_TO_PHYSICAL macro bug fix for CodeWarrior */ +#ifndef __MWERKS__ +#define OS_K0_TO_PHYSICAL(x) (u32)(((char *)(x)-0x80000000)) +#define OS_K1_TO_PHYSICAL(x) (u32)(((char *)(x)-0xa0000000)) +#else +#define OS_K0_TO_PHYSICAL(x) ((char *)(x)-0x80000000) +#define OS_K1_TO_PHYSICAL(x) ((char *)(x)-0xa0000000) +#endif + +#define OS_PHYSICAL_TO_K0(x) (void *)(((u32)(x)+0x80000000)) +#define OS_PHYSICAL_TO_K1(x) (void *)(((u32)(x)+0xa0000000)) + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Address translation routines and macros */ + +extern u32 osVirtualToPhysical(void *); +extern void * osPhysicalToVirtual(u32); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_CONVERT_H_ */ diff --git a/include/2.0L/PR/os_debug.h b/include/2.0L/PR/os_debug.h new file mode 100644 index 00000000..f8f5a89a --- /dev/null +++ b/include/2.0L/PR/os_debug.h @@ -0,0 +1,117 @@ + +/*==================================================================== + * os_debug.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_debug.h,v $ + $Revision: 1.4 $ + $Date: 1999/06/30 03:04:08 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_DEBUG_H_ +#define _OS_DEBUG_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +/* + * Structure for Profiler + */ +typedef struct { + u16 *histo_base; /* histogram base */ + u32 histo_size; /* histogram size */ + u32 *text_start; /* start of text segment */ + u32 *text_end; /* end of text segment */ +} OSProf; + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* + * Profiler constants + */ +#define PROF_MIN_INTERVAL 50 /* microseconds */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Profiler Interface */ + +extern void osProfileInit(OSProf *, u32 profcnt); +extern void osProfileStart(u32); +extern void osProfileFlush(void); +extern void osProfileStop(void); + +/* Thread Profiler Interface */ +extern void osThreadProfileClear(OSId); +extern void osThreadProfileInit(void); +extern void osThreadProfileStart(void); +extern void osThreadProfileStop(void); +extern u32 osThreadProfileReadCount(OSId); +extern u32 osThreadProfileReadCountTh(OSThread*); +extern OSTime osThreadProfileReadTime(OSId); +extern OSTime osThreadProfileReadTimeTh(OSThread*); + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_DEBUG_H_ */ diff --git a/include/2.0L/PR/os_eeprom.h b/include/2.0L/PR/os_eeprom.h new file mode 100644 index 00000000..b3bca814 --- /dev/null +++ b/include/2.0L/PR/os_eeprom.h @@ -0,0 +1,107 @@ + +/*==================================================================== + * os_eeprom.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_eeprom.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:06 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_EEPROM_H_ +#define _OS_EEPROM_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include "os_message.h" + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* EEPROM TYPE */ + +#define EEPROM_TYPE_4K 0x01 +#define EEPROM_TYPE_16K 0x02 + +/* definition for EEPROM */ + +#define EEPROM_MAXBLOCKS 64 +#define EEP16K_MAXBLOCKS 256 +#define EEPROM_BLOCK_SIZE 8 + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* EEPROM interface */ + +extern s32 osEepromProbe(OSMesgQueue *); +extern s32 osEepromRead(OSMesgQueue *, u8, u8 *); +extern s32 osEepromWrite(OSMesgQueue *, u8, u8 *); +extern s32 osEepromLongRead(OSMesgQueue *, u8, u8 *, int); +extern s32 osEepromLongWrite(OSMesgQueue *, u8, u8 *, int); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_EEPROM_H_ */ diff --git a/include/2.0L/PR/os_error.h b/include/2.0L/PR/os_error.h new file mode 100644 index 00000000..f4c3b83c --- /dev/null +++ b/include/2.0L/PR/os_error.h @@ -0,0 +1,86 @@ + +/*==================================================================== + * os_error.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_error.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:06 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_ERROR_H_ +#define _OS_ERROR_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_ERROR_H_ */ diff --git a/include/2.0L/PR/os_exception.h b/include/2.0L/PR/os_exception.h new file mode 100644 index 00000000..245e5e69 --- /dev/null +++ b/include/2.0L/PR/os_exception.h @@ -0,0 +1,119 @@ + +/*==================================================================== + * os_exception.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_exception.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:07 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_EXCEPTION_H_ +#define _OS_EXCEPTION_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +typedef u32 OSIntMask; +typedef u32 OSHWIntr; + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* Flags for debugging purpose */ + +#define OS_FLAG_CPU_BREAK 1 /* Break exception has occurred */ +#define OS_FLAG_FAULT 2 /* CPU fault has occurred */ + +/* Interrupt masks */ + +#define OS_IM_NONE 0x00000001 +#define OS_IM_SW1 0x00000501 +#define OS_IM_SW2 0x00000601 +#define OS_IM_CART 0x00000c01 +#define OS_IM_PRENMI 0x00001401 +#define OS_IM_RDBWRITE 0x00002401 +#define OS_IM_RDBREAD 0x00004401 +#define OS_IM_COUNTER 0x00008401 +#define OS_IM_CPU 0x0000ff01 +#define OS_IM_SP 0x00010401 +#define OS_IM_SI 0x00020401 +#define OS_IM_AI 0x00040401 +#define OS_IM_VI 0x00080401 +#define OS_IM_PI 0x00100401 +#define OS_IM_DP 0x00200401 +#define OS_IM_ALL 0x003fff01 +#define RCP_IMASK 0x003f0000 +#define RCP_IMASKSHIFT 16 + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Interrupt operations */ + +extern OSIntMask osGetIntMask(void); +extern OSIntMask osSetIntMask(OSIntMask); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_EXCEPTION_H_ */ diff --git a/include/2.0L/PR/os_flash.h b/include/2.0L/PR/os_flash.h new file mode 100644 index 00000000..4e0a129b --- /dev/null +++ b/include/2.0L/PR/os_flash.h @@ -0,0 +1,71 @@ +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. + + $RCSfile: os_flash.h,v $ + $Revision: 1.1 $ + $Date: 2000/06/15 06:24:55 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_FLASH_H_ +#define _OS_FLASH_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* + * defines for FLASH + */ +#define FLASH_START_ADDR 0x08000000 + +#define FLASH_SIZE 0x20000 +#define FLASH_LATENCY 0x5 +#define FLASH_PULSE 0x0c +#define FLASH_PAGE_SIZE 0xf +#define FLASH_REL_DURATION 0x2 +#define DEVICE_TYPE_FLASH 8 + +#define FLASH_VERSION_MX_PROTO_A 0x00c20000 +#define FLASH_VERSION_MX_A 0x00c20001 +#define FLASH_VERSION_MX_C 0x00c2001e +#define FLASH_VERSION_MX_B_AND_D 0x00c2001d +#define FLASH_VERSION_MEI 0x003200f1 + +#define OLD_FLASH 0 +#define NEW_FLASH 1 +/* OLD_FLASH is MX_PROTO_A, MX_A and MX_C */ +/* NEW_FLASH is MX_B_AND_D and MATSUSHITA flash */ + +#define FLASH_STATUS_ERASE_BUSY 2 +#define FLASH_STATUS_ERASE_ERROR -1 +#define FLASH_STATUS_ERASE_OK 0 + +extern OSPiHandle *osFlashReInit(u8 latency, u8 pulse, + u8 page_size, u8 rel_duration, u32 start); +extern OSPiHandle *osFlashInit(void); +extern void osFlashReadStatus(u8 *flash_status); +extern void osFlashReadId(u32 *flash_type, u32 *flash_maker); +extern void osFlashClearStatus(void); +extern s32 osFlashAllErase(void); +extern s32 osFlashSectorErase(u32 page_num); +extern s32 osFlashWriteBuffer(OSIoMesg *mb, s32 priority, + void *dramAddr, OSMesgQueue *mq); +extern s32 osFlashWriteArray(u32 page_num); +extern s32 osFlashReadArray(OSIoMesg *mb, s32 priority, u32 page_num, + void *dramAddr, u32 n_pages, OSMesgQueue *mq); +extern void osFlashChange(u32 flash_num); +extern void osFlashAllEraseThrough(void); +extern void osFlashSectorEraseThrough(u32 page_num); +extern s32 osFlashCheckEraseEnd(void); + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_FLASH_H_ */ diff --git a/include/2.0L/PR/os_gbpak.h b/include/2.0L/PR/os_gbpak.h new file mode 100644 index 00000000..0a999945 --- /dev/null +++ b/include/2.0L/PR/os_gbpak.h @@ -0,0 +1,107 @@ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. + + $RCSfile: os_gbpak.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:07 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_GBPAK_H_ +#define _OS_GBPAK_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include "os_message.h" +#include "os_pfs.h" + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +typedef struct { + u16 fixed1; + u16 start_address; + u8 nintendo_chr[0x30]; + u8 game_title[16]; + u16 company_code; + u8 body_code; + u8 cart_type; + u8 rom_size; + u8 ram_size; + u8 country_code; + u8 fixed2; + u8 version; + u8 isum; + u16 sum; +} OSGbpakId; + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* definition for 64GB-PAK */ + +#define OS_GBPAK_POWER 0x01 +#define OS_GBPAK_RSTB_DETECTION 0x04 +#define OS_GBPAK_RSTB_STATUS 0x08 +#define OS_GBPAK_GBCART_PULL 0x40 +#define OS_GBPAK_GBCART_ON 0x80 + +#define OS_GBPAK_POWER_OFF 0x00 /* power of 64GB-PAK */ +#define OS_GBPAK_POWER_ON 0x01 + +#define OS_GBPAK_ROM_ID_SIZE 0x50 /* ID size of GB cartridge */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* 64GB-PAK */ +extern s32 osGbpakInit(OSMesgQueue *, OSPfs *, int); +extern s32 osGbpakPower(OSPfs *, s32); +extern s32 osGbpakGetStatus(OSPfs *, u8 *); +extern s32 osGbpakReadWrite(OSPfs *, u16, u16, u8 *, u16); +extern s32 osGbpakReadId(OSPfs *, OSGbpakId *, u8 *); +extern s32 osGbpakCheckConnector(OSPfs *, u8 *); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_GBPAK_H_ */ diff --git a/include/2.0L/PR/os_gio.h b/include/2.0L/PR/os_gio.h new file mode 100644 index 00000000..ad3c020f --- /dev/null +++ b/include/2.0L/PR/os_gio.h @@ -0,0 +1,86 @@ + +/*==================================================================== + * os_gio.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_gio.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:08 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_GIO_H_ +#define _OS_GIO_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_GIO_H_ */ diff --git a/include/2.0L/PR/os_host.h b/include/2.0L/PR/os_host.h new file mode 100644 index 00000000..0cc1ae5b --- /dev/null +++ b/include/2.0L/PR/os_host.h @@ -0,0 +1,161 @@ + +/*==================================================================== + * os_host.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_host.h,v $ + $Revision: 1.3 $ + $Date: 1999/06/24 09:23:06 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_HOST_H_ +#define _OS_HOST_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + +extern void __osInitialize_common(void); + +#if defined(_FINALROM) + +#define osInitialize() __osInitialize_common() + +#else + +/* PARTNER-N64 */ +#if defined(PTN64) +extern void __osInitialize_kmc(void); +#define osReadHost osReadHost_pt +#define osWriteHost osWriteHost_pt +#define osInitialize() \ +{ \ + __osInitialize_common(); \ + __osInitialize_kmc(); \ +} + +/* MONEGI SMART PACK A */ +#elif defined(MWN64) +extern void __osInitialize_msp(void); +#define osReadHost osReadHost_pt +#define osWriteHost osWriteHost_pt +#define osInitialize() \ +{ \ + __osInitialize_common(); \ + __osInitialize_msp(); \ +} + +/* IS-Viewer(for Debugger) */ +#elif defined(ISV64) +extern void __osInitialize_isv(void); +#define osInitialize() \ +{ \ + __osInitialize_common(); \ + __osInitialize_isv(); \ +} + +/* Emulation board for INDY */ +#elif defined(EMU64) +extern void __osInitialize_emu(void); +#define osInitialize() \ +{ \ + __osInitialize_common(); \ + __osInitialize_emu(); \ +} + +#else +/* Default (auto detect) */ +extern void __osInitialize_autodetect(void); +extern void __osInitialize_msp(void); +extern void __osInitialize_kmc(void); +extern void __osInitialize_isv(void); +extern void __osInitialize_emu(void); +#define osInitialize() \ +{ \ + __osInitialize_common(); \ + __osInitialize_autodetect(); \ +} +#endif + +#endif /* _FINAL_ROM */ + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Game <> Host data transfer functions */ + +extern s32 osTestHost(void); +extern void osReadHost(void *, u32); +extern void osWriteHost(void *, u32); +extern void osAckRamromRead(void); +extern void osAckRamromWrite(void); + +/* RDB port operations */ + +extern void osInitRdb(u8 *sendBuf, u32 sendSize); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_HOST_H_ */ diff --git a/include/2.0L/PR/os_internal.h b/include/2.0L/PR/os_internal.h new file mode 100644 index 00000000..754d1ee2 --- /dev/null +++ b/include/2.0L/PR/os_internal.h @@ -0,0 +1,49 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_internal.h,v $ + $Revision: 1.20 $ + $Date: 1998/10/09 08:01:09 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_INTERNAL_H_ +#define _OS_INTERNAL_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +#include "os_internal_reg.h" +#include "os_internal_exception.h" +#include "os_internal_tlb.h" +#include "os_internal_si.h" +#include "os_internal_rsp.h" +#include "os_internal_error.h" +#include "os_internal_gio.h" +#include "os_internal_thread.h" +#include "os_internal_debug.h" +#include "os_internal_host.h" + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_INTERNAL_H */ diff --git a/include/2.0L/PR/os_internal_debug.h b/include/2.0L/PR/os_internal_debug.h new file mode 100644 index 00000000..7b307d6e --- /dev/null +++ b/include/2.0L/PR/os_internal_debug.h @@ -0,0 +1,43 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_internal_debug.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:09 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_INTERNAL_DEBUG_H_ +#define _OS_INTERNAL_DEBUG_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* Debug port */ +extern void __osSyncPutChars(int, int, const char *); +extern int __osAtomicDec(unsigned int *p); + + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_INTERNAL_DEBUG_H */ diff --git a/include/2.0L/PR/os_internal_error.h b/include/2.0L/PR/os_internal_error.h new file mode 100644 index 00000000..de188d23 --- /dev/null +++ b/include/2.0L/PR/os_internal_error.h @@ -0,0 +1,45 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_internal_error.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:10 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_INTERNAL_ERROR_H_ +#define _OS_INTERNAL_ERROR_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* Error handling */ + +extern void __osError(s16, s16, ...); +extern OSThread * __osGetCurrFaultedThread(void); +extern OSThread * __osGetNextFaultedThread(OSThread *); + + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_INTERNAL_ERROR_H */ diff --git a/include/2.0L/PR/os_internal_exception.h b/include/2.0L/PR/os_internal_exception.h new file mode 100644 index 00000000..530b3d2b --- /dev/null +++ b/include/2.0L/PR/os_internal_exception.h @@ -0,0 +1,49 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_internal_exception.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:10 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_INTERNAL_EXCEPTION_H_ +#define _OS_INTERNAL_EXCEPTION_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* Routine for HW interrupt "handler" */ +extern void __osSetHWIntrRoutine(OSHWIntr interrupt, + s32 (*handler)(void)); // no stackEnd +extern void __osGetHWIntrRoutine(OSHWIntr interrupt, + s32 (**handler)(void), void **stackEnd); + +/* Routine for global interrupt mask */ +extern void __osSetGlobalIntMask(OSHWIntr); +extern void __osResetGlobalIntMask(OSHWIntr); + + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_INTERNAL_EXCEPTION_H */ diff --git a/include/2.0L/PR/os_internal_gio.h b/include/2.0L/PR/os_internal_gio.h new file mode 100644 index 00000000..ff133850 --- /dev/null +++ b/include/2.0L/PR/os_internal_gio.h @@ -0,0 +1,45 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_internal_gio.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:11 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_INTERNAL_GIO_H_ +#define _OS_INTERNAL_GIO_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* Development board functions */ + +extern void __osGIOInit(s32); +extern void __osGIOInterrupt(s32); +extern void __osGIORawInterrupt(s32); + + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_INTERNAL_GIO_H */ diff --git a/include/2.0L/PR/os_internal_host.h b/include/2.0L/PR/os_internal_host.h new file mode 100644 index 00000000..b6d19513 --- /dev/null +++ b/include/2.0L/PR/os_internal_host.h @@ -0,0 +1,42 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_internal_host.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:11 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_INTERNAL_HOST_H_ +#define _OS_INTERNAL_HOST_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* routine for rdb port */ +extern u32 __osRdbSend(u8 *buf, u32 size, u32 type); + + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_INTERNAL_HOST_H */ diff --git a/include/2.0L/PR/os_internal_reg.h b/include/2.0L/PR/os_internal_reg.h new file mode 100644 index 00000000..a1619981 --- /dev/null +++ b/include/2.0L/PR/os_internal_reg.h @@ -0,0 +1,59 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_internal_reg.h,v $ + $Revision: 1.2 $ + $Date: 1999/03/10 12:19:14 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_INTERNAL_REG_H_ +#define _OS_INTERNAL_REG_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* Routines to get/fetch coprocessor 0 registers */ + +extern u32 __osGetCause(void); +extern void __osSetCause(u32); +extern u32 __osGetCompare(void); +extern void __osSetCompare(u32); +extern u32 __osGetConfig(void); +extern void __osSetConfig(u32); +extern void __osSetCount(u32); +extern u32 __osGetSR(void); +extern void __osSetSR(u32); +extern u32 __osDisableInt(void); +extern void __osRestoreInt(u32); +extern u32 __osGetWatchLo(void); +extern void __osSetWatchLo(u32); + +/* Routines to get/set floating-point control and status register */ +extern u32 __osSetFpcCsr(u32); +extern u32 __osGetFpcCsr(void); + + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_INTERNAL_REG_H */ diff --git a/include/2.0L/PR/os_internal_rsp.h b/include/2.0L/PR/os_internal_rsp.h new file mode 100644 index 00000000..646e6679 --- /dev/null +++ b/include/2.0L/PR/os_internal_rsp.h @@ -0,0 +1,48 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_internal_rsp.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:12 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_INTERNAL_RSP_H_ +#define _OS_INTERNAL_RSP_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* Signal processor interface (Sp) */ + +extern u32 __osSpGetStatus(void); +extern void __osSpSetStatus(u32); +extern s32 __osSpSetPc(u32); +extern s32 __osSpRawWriteIo(u32, u32); +extern s32 __osSpRawReadIo(u32, u32 *); +extern s32 __osSpRawStartDma(s32, u32, void *, u32); + + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_INTERNAL_RSP_H */ diff --git a/include/2.0L/PR/os_internal_si.h b/include/2.0L/PR/os_internal_si.h new file mode 100644 index 00000000..d0eeedcc --- /dev/null +++ b/include/2.0L/PR/os_internal_si.h @@ -0,0 +1,46 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_internal_si.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:13 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_INTERNAL_SI_H_ +#define _OS_INTERNAL_SI_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* Serial interface (Si) */ + +extern u32 __osSiGetStatus(void); +extern s32 __osSiRawWriteIo(u32, u32); +extern s32 __osSiRawReadIo(u32, u32 *); +extern s32 __osSiRawStartDma(s32, void *); + + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_INTERNAL_SI_H */ diff --git a/include/2.0L/PR/os_internal_thread.h b/include/2.0L/PR/os_internal_thread.h new file mode 100644 index 00000000..1305eb58 --- /dev/null +++ b/include/2.0L/PR/os_internal_thread.h @@ -0,0 +1,43 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_internal_thread.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:13 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_INTERNAL_THREAD_H_ +#define _OS_INTERNAL_THREAD_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* For debugger use */ + +extern OSThread * __osGetActiveQueue(void); + + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_INTERNAL_THREAD_H */ diff --git a/include/2.0L/PR/os_internal_tlb.h b/include/2.0L/PR/os_internal_tlb.h new file mode 100644 index 00000000..b92918ff --- /dev/null +++ b/include/2.0L/PR/os_internal_tlb.h @@ -0,0 +1,47 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_internal_tlb.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:14 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_INTERNAL_TLB_H_ +#define _OS_INTERNAL_TLB_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* Routines for fetch TLB info */ + +extern u32 __osGetTLBASID(void); +extern u32 __osGetTLBPageMask(s32); +extern u32 __osGetTLBHi(s32); +extern u32 __osGetTLBLo0(s32); +extern u32 __osGetTLBLo1(s32); + + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_INTERNAL_TLB_H */ diff --git a/include/2.0L/PR/os_libc.h b/include/2.0L/PR/os_libc.h new file mode 100644 index 00000000..35d0e8e6 --- /dev/null +++ b/include/2.0L/PR/os_libc.h @@ -0,0 +1,100 @@ + +/*==================================================================== + * os_libc.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_libc.h,v $ + $Revision: 1.3 $ + $Date: 1999/07/13 01:43:47 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_LIBC_H_ +#define _OS_LIBC_H_ + +#include "os_pfs.h" + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* byte string operations */ + + +extern void bcopy(const void *, void *, int); +extern int bcmp(const void *, const void *, int); +extern void bzero(void *, int); + +/* Printf */ + +extern int sprintf(char *s, const char *fmt, ...); +extern void osSyncPrintf(const char *fmt, ...); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_LIBC_H_ */ diff --git a/include/2.0L/PR/os_message.h b/include/2.0L/PR/os_message.h new file mode 100644 index 00000000..5bc565e3 --- /dev/null +++ b/include/2.0L/PR/os_message.h @@ -0,0 +1,163 @@ + +/*==================================================================== + * os_message.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_message.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:15 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_MESSAGE_H_ +#define _OS_MESSAGE_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +typedef u32 OSEvent; + +/* + * Structure for message + */ +typedef void * OSMesg; + +/* + * Structure for message queue + */ +typedef struct OSMesgQueue_s { + OSThread *mtqueue; /* Queue to store threads blocked + on empty mailboxes (receive) */ + OSThread *fullqueue; /* Queue to store threads blocked + on full mailboxes (send) */ + s32 validCount; /* Contains number of valid message */ + s32 first; /* Points to first valid message */ + s32 msgCount; /* Contains total # of messages */ + OSMesg *msg; /* Points to message buffer array */ +} OSMesgQueue; + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* Events */ +#ifdef _FINALROM +#define OS_NUM_EVENTS 15 +#else +#define OS_NUM_EVENTS 23 +#endif + +#define OS_EVENT_SW1 0 /* CPU SW1 interrupt */ +#define OS_EVENT_SW2 1 /* CPU SW2 interrupt */ +#define OS_EVENT_CART 2 /* Cartridge interrupt: used by rmon */ +#define OS_EVENT_COUNTER 3 /* Counter int: used by VI/Timer Mgr */ +#define OS_EVENT_SP 4 /* SP task done interrupt */ +#define OS_EVENT_SI 5 /* SI (controller) interrupt */ +#define OS_EVENT_AI 6 /* AI interrupt */ +#define OS_EVENT_VI 7 /* VI interrupt: used by VI/Timer Mgr */ +#define OS_EVENT_PI 8 /* PI interrupt: used by PI Manager */ +#define OS_EVENT_DP 9 /* DP full sync interrupt */ +#define OS_EVENT_CPU_BREAK 10 /* CPU breakpoint: used by rmon */ +#define OS_EVENT_SP_BREAK 11 /* SP breakpoint: used by rmon */ +#define OS_EVENT_FAULT 12 /* CPU fault event: used by rmon */ +#define OS_EVENT_THREADSTATUS 13 /* CPU thread status: used by rmon */ +#define OS_EVENT_PRENMI 14 /* Pre NMI interrupt */ +#ifndef _FINALROM +#define OS_EVENT_RDB_READ_DONE 15 /* RDB read ok event: used by rmon */ +#define OS_EVENT_RDB_LOG_DONE 16 /* read of log data complete */ +#define OS_EVENT_RDB_DATA_DONE 17 /* read of hostio data complete */ +#define OS_EVENT_RDB_REQ_RAMROM 18 /* host needs ramrom access */ +#define OS_EVENT_RDB_FREE_RAMROM 19 /* host is done with ramrom access */ +#define OS_EVENT_RDB_DBG_DONE 20 +#define OS_EVENT_RDB_FLUSH_PROF 21 +#define OS_EVENT_RDB_ACK_PROF 22 +#endif + +/* Flags to turn blocking on/off when sending/receiving message */ + +#define OS_MESG_NOBLOCK 0 +#define OS_MESG_BLOCK 1 + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + +/* Get count of valid messages in queue */ +#define MQ_GET_COUNT(mq) ((mq)->validCount) + +/* Figure out if message queue is empty or full */ +#define MQ_IS_EMPTY(mq) (MQ_GET_COUNT(mq) == 0) +#define MQ_IS_FULL(mq) (MQ_GET_COUNT(mq) >= (mq)->msgCount) + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Message operations */ + +extern void osCreateMesgQueue(OSMesgQueue *, OSMesg *, s32); +extern s32 osSendMesg(OSMesgQueue *, OSMesg, s32); +extern s32 osJamMesg(OSMesgQueue *, OSMesg, s32); +extern s32 osRecvMesg(OSMesgQueue *, OSMesg *, s32); + +/* Event operations */ + +extern void osSetEventMesg(OSEvent, OSMesgQueue *, OSMesg); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_MESSAGE_H_ */ diff --git a/include/2.0L/PR/os_motor.h b/include/2.0L/PR/os_motor.h new file mode 100644 index 00000000..eb8c7d6c --- /dev/null +++ b/include/2.0L/PR/os_motor.h @@ -0,0 +1,75 @@ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. + + $RCSfile: os_motor.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:15 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_MOTOR_H_ +#define _OS_MOTOR_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include "os_message.h" +#include "os_pfs.h" + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Rumble PAK interface */ + +extern s32 osMotorInit(OSMesgQueue *, OSPfs *, int); +extern s32 osMotorStop(OSPfs *); +extern s32 osMotorStart(OSPfs *); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_MOTOR_H_ */ diff --git a/include/2.0L/PR/os_pfs.h b/include/2.0L/PR/os_pfs.h new file mode 100644 index 00000000..188f9d28 --- /dev/null +++ b/include/2.0L/PR/os_pfs.h @@ -0,0 +1,174 @@ + +/*==================================================================== + * os_pfs.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_pfs.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:16 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_PFS_H_ +#define _OS_PFS_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include "os_message.h" + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +/* + * Structure for file system + */ +typedef struct { + int status; + OSMesgQueue *queue; + int channel; + u8 id[32]; + u8 label[32]; + int version; + int dir_size; + int inode_table; /* block location */ + int minode_table; /* mirrioring inode_table */ + int dir_table; /* block location */ + int inode_start_page; /* page # */ + u8 banks; + u8 activebank; +} OSPfs; + +typedef struct { + u32 file_size; /* bytes */ + u32 game_code; + u16 company_code; + char ext_name[4]; + char game_name[16]; +} OSPfsState; + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* File System size */ +#define OS_PFS_VERSION 0x0200 +#define OS_PFS_VERSION_HI (OS_PFS_VERSION >> 8) +#define OS_PFS_VERSION_LO (OS_PFS_VERSION & 255) + +#define PFS_FILE_NAME_LEN 16 +#define PFS_FILE_EXT_LEN 4 +#define BLOCKSIZE 32 /* bytes */ +#define PFS_ONE_PAGE 8 /* blocks */ +#define PFS_MAX_BANKS 62 + +/* File System flag */ + +#define PFS_READ 0 +#define PFS_WRITE 1 +#define PFS_CREATE 2 + +/* File System status */ +#define PFS_INITIALIZED 0x1 +#define PFS_CORRUPTED 0x2 /* File system was corrupted */ +#define PFS_ID_BROKEN 0x4 +#define PFS_MOTOR_INITIALIZED 0x8 +#define PFS_GBPAK_INITIALIZED 0x10 + +/* File System error number */ + +#define PFS_ERR_NOPACK 1 /* no memory card is plugged or */ +#define PFS_ERR_NEW_PACK 2 /* ram pack has been changed to a */ + /* different one */ +#define PFS_ERR_INCONSISTENT 3 /* need to run Pfschecker */ +#define PFS_ERR_CONTRFAIL CONT_OVERRUN_ERROR +#define PFS_ERR_INVALID 5 /* invalid parameter or file not exist*/ +#define PFS_ERR_BAD_DATA 6 /* the data read from pack are bad*/ +#define PFS_DATA_FULL 7 /* no free pages on ram pack */ +#define PFS_DIR_FULL 8 /* no free directories on ram pack*/ +#define PFS_ERR_EXIST 9 /* file exists */ +#define PFS_ERR_ID_FATAL 10 /* dead ram pack */ +#define PFS_ERR_DEVICE 11 /* wrong device type*/ +#define PFS_ERR_NO_GBCART 12 /* no gb cartridge (64GB-PAK) */ +#define PFS_ERR_NEW_GBCART 13 /* gb cartridge may be changed */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* file system interface */ + +extern s32 osPfsInitPak(OSMesgQueue *, OSPfs *, int); +extern s32 osPfsRepairId(OSPfs *); +extern s32 osPfsInit(OSMesgQueue *, OSPfs *, int); +extern s32 osPfsReFormat(OSPfs *, OSMesgQueue *, int); +extern s32 osPfsChecker(OSPfs *); +extern s32 osPfsAllocateFile(OSPfs *, u16, u32, u8 *, u8 *, int, s32 *); +extern s32 osPfsFindFile(OSPfs *, u16, u32, u8 *, u8 *, s32 *); +extern s32 osPfsDeleteFile(OSPfs *, u16, u32, u8 *, u8 *); +extern s32 osPfsReadWriteFile(OSPfs *, s32, u8, int, int, u8 *); +extern s32 osPfsFileState(OSPfs *, s32, OSPfsState *); +extern s32 osPfsGetLabel(OSPfs *, u8 *, int *); +extern s32 osPfsSetLabel(OSPfs *, u8 *); +extern s32 osPfsIsPlug(OSMesgQueue *, u8 *); +extern s32 osPfsFreeBlocks(OSPfs *, s32 *); +extern s32 osPfsNumFiles(OSPfs *, s32 *, s32 *); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_PFS_H_ */ diff --git a/include/2.0L/PR/os_pi.h b/include/2.0L/PR/os_pi.h new file mode 100644 index 00000000..11e3454a --- /dev/null +++ b/include/2.0L/PR/os_pi.h @@ -0,0 +1,228 @@ + +/*==================================================================== + * os_pi.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_pi.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:16 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_PI_H_ +#define _OS_PI_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include "os_thread.h" +#include "os_message.h" + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +/* + * Structure for Enhanced PI interface + */ + +/* + * OSTranxInfo is set up for Leo Disk DMA. This info will be maintained + * by exception handler. This is how the PIMGR and the ISR communicate. + */ + +typedef struct { + u32 errStatus; /* error status */ + void *dramAddr; /* RDRAM buffer address (DMA) */ + void *C2Addr; /* C2 buffer address */ + u32 sectorSize; /* size of transfering sector */ + u32 C1ErrNum; /* total # of C1 errors */ + u32 C1ErrSector[4]; /* error sectors */ +} __OSBlockInfo; + +typedef struct { + u32 cmdType; /* for disk only */ + u16 transferMode; /* Block, Track, or sector? */ + u16 blockNum; /* which block is transfering */ + s32 sectorNum; /* which sector is transfering */ + u32 devAddr; /* Device buffer address */ + u32 bmCtlShadow; /* asic bm_ctl(510) register shadow ram */ + u32 seqCtlShadow; /* asic seq_ctl(518) register shadow ram */ + __OSBlockInfo block[2]; /* bolck transfer info */ +} __OSTranxInfo; + + +typedef struct OSPiHandle_s { + struct OSPiHandle_s *next; /* point to next handle on the table */ + u8 type; /* DEVICE_TYPE_BULK for disk */ + u8 latency; /* domain latency */ + u8 pageSize; /* domain page size */ + u8 relDuration; /* domain release duration */ + u8 pulse; /* domain pulse width */ + u8 domain; /* which domain */ + u32 baseAddress; /* Domain address */ + u32 speed; /* for roms only */ + /* The following are "private" elements" */ + __OSTranxInfo transferInfo; /* for disk only */ +} OSPiHandle; + +typedef struct { + u8 type; + u32 address; +} OSPiInfo; + +/* + * Structure for I/O message block + */ +typedef struct { + u16 type; /* Message type */ + u8 pri; /* Message priority (High or Normal) */ + u8 status; /* Return status */ + OSMesgQueue *retQueue; /* Return message queue to notify I/O + * completion */ +} OSIoMesgHdr; + +typedef struct { + OSIoMesgHdr hdr; /* Message header */ + void * dramAddr; /* RDRAM buffer address (DMA) */ + u32 devAddr; /* Device buffer address (DMA) */ + u32 size; /* DMA transfer size in bytes */ + OSPiHandle *piHandle; /* PI device handle */ +} OSIoMesg; + +/* + * Structure for device manager block + */ +typedef struct { + s32 active; /* Status flag */ + OSThread *thread; /* Calling thread */ + OSMesgQueue *cmdQueue; /* Command queue */ + OSMesgQueue *evtQueue; /* Event queue */ + OSMesgQueue *acsQueue; /* Access queue */ + /* Raw DMA routine */ + s32 (*dma)(s32, u32, void *, u32); + s32 (*edma)(OSPiHandle *, s32, u32, void *, u32); +} OSDevMgr; + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* Flags to indicate direction of data transfer */ + +#define OS_READ 0 /* device -> RDRAM */ +#define OS_WRITE 1 /* device <- RDRAM */ +#define OS_OTHERS 2 /* for Leo disk only */ + +/* + * I/O message types + */ +#define OS_MESG_TYPE_BASE (10) +#define OS_MESG_TYPE_LOOPBACK (OS_MESG_TYPE_BASE+0) +#define OS_MESG_TYPE_DMAREAD (OS_MESG_TYPE_BASE+1) +#define OS_MESG_TYPE_DMAWRITE (OS_MESG_TYPE_BASE+2) +#define OS_MESG_TYPE_VRETRACE (OS_MESG_TYPE_BASE+3) +#define OS_MESG_TYPE_COUNTER (OS_MESG_TYPE_BASE+4) +#define OS_MESG_TYPE_EDMAREAD (OS_MESG_TYPE_BASE+5) +#define OS_MESG_TYPE_EDMAWRITE (OS_MESG_TYPE_BASE+6) + +/* + * I/O message priority + */ +#define OS_MESG_PRI_NORMAL 0 +#define OS_MESG_PRI_HIGH 1 + +/* + * PI/EPI + */ +#define PI_DOMAIN1 0 +#define PI_DOMAIN2 1 + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + +extern OSPiHandle *__osPiTable; /* The head of OSPiHandle link list */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Peripheral interface (Pi) */ +extern u32 osPiGetStatus(void); +extern s32 osPiGetDeviceType(void); +extern s32 osPiWriteIo(u32, u32); +extern s32 osPiReadIo(u32, u32 *); +extern s32 osPiStartDma(OSIoMesg *, s32, s32, u32, void *, u32, + OSMesgQueue *); +extern void osCreatePiManager(OSPri, OSMesgQueue *, OSMesg *, s32); + +extern s32 osEPiRawStartDma(OSPiHandle *, s32 , u32 , void *, u32 ); + +/* Enhanced PI interface */ + +extern OSPiHandle *osCartRomInit(void); +extern OSPiHandle *osLeoDiskInit(void); +extern OSPiHandle *osDriveRomInit(void); + +extern s32 osEPiDeviceType(OSPiHandle *, OSPiInfo *); +extern s32 osEPiWriteIo(OSPiHandle *, u32 , u32 ); +extern s32 osEPiReadIo(OSPiHandle *, u32 , u32 *); +extern s32 osEPiStartDma(OSPiHandle *, OSIoMesg *, s32); +extern s32 osEPiLinkHandle(OSPiHandle *); + +extern s32 osPiRawStartDma(s32, u32, void *, u32); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_PI_H_ */ diff --git a/include/2.0L/PR/os_rdp.h b/include/2.0L/PR/os_rdp.h new file mode 100644 index 00000000..6b3d288c --- /dev/null +++ b/include/2.0L/PR/os_rdp.h @@ -0,0 +1,92 @@ + +/*==================================================================== + * os_rdp.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_rdp.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:16 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_RDP_H_ +#define _OS_RDP_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Display processor interface (Dp) */ +extern u32 osDpGetStatus(void); +extern void osDpSetStatus(u32); +extern void osDpGetCounters(u32 *); +extern s32 osDpSetNextBuffer(void *, u64); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_RDP_H_ */ diff --git a/include/2.0L/PR/os_reg.h b/include/2.0L/PR/os_reg.h new file mode 100644 index 00000000..50aa2188 --- /dev/null +++ b/include/2.0L/PR/os_reg.h @@ -0,0 +1,90 @@ + +/*==================================================================== + * os_reg.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_reg.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:17 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_REG_H_ +#define _OS_REG_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Miscellaneous operations */ + +extern u32 osGetCount(void); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_REG_H_ */ diff --git a/include/2.0L/PR/os_rsp.h b/include/2.0L/PR/os_rsp.h new file mode 100644 index 00000000..12116053 --- /dev/null +++ b/include/2.0L/PR/os_rsp.h @@ -0,0 +1,86 @@ + +/*==================================================================== + * os_rsp.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_rsp.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:17 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_RSP_H_ +#define _OS_RSP_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_RSP_H_ */ diff --git a/include/2.0L/PR/os_si.h b/include/2.0L/PR/os_si.h new file mode 100644 index 00000000..23b07c07 --- /dev/null +++ b/include/2.0L/PR/os_si.h @@ -0,0 +1,86 @@ + +/*==================================================================== + * os_si.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_si.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:18 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_SI_H_ +#define _OS_SI_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_SI_H_ */ diff --git a/include/2.0L/PR/os_system.h b/include/2.0L/PR/os_system.h new file mode 100644 index 00000000..1179189a --- /dev/null +++ b/include/2.0L/PR/os_system.h @@ -0,0 +1,118 @@ + +/*==================================================================== + * os_system.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_system.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:18 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_SYSTEM_H_ +#define _OS_SYSTEM_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* + * Values for osTvType + */ +#define OS_TV_PAL 0 +#define OS_TV_NTSC 1 +#define OS_TV_MPAL 2 + +/* + * Size of buffer the retains contents after NMI + */ +#define OS_APP_NMI_BUFSIZE 64 + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + +extern s32 osRomType; /* Bulk or cartridge ROM. 0=cartridge 1=bulk */ +extern void *osRomBase; /* Rom base address of the game image */ +extern s32 osTvType; /* 0 = PAL, 1 = NTSC, 2 = MPAL */ +extern s32 osResetType; /* 0 = cold reset, 1 = NMI */ +extern s32 osCicId; +extern s32 osVersion; +extern u32 osMemSize; /* Memory Size */ +extern s32 osAppNMIBuffer[]; + +extern u64 osClockRate; + +extern OSIntMask __OSGlobalIntMask; /* global interrupt mask */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +extern void osInitialize(void); +extern void osExit(void); +extern u32 osGetMemSize(void); + +/* pre-NMI */ +extern s32 osAfterPreNMI(void); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_SYSTEM_H_ */ diff --git a/include/2.0L/PR/os_thread.h b/include/2.0L/PR/os_thread.h new file mode 100644 index 00000000..7b82dc79 --- /dev/null +++ b/include/2.0L/PR/os_thread.h @@ -0,0 +1,154 @@ + +/*==================================================================== + * os_thread.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_thread.h,v $ + $Revision: 1.3 $ + $Date: 1999/06/15 12:39:40 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_THREAD_H_ +#define _OS_THREAD_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +typedef s32 OSPri; +typedef s32 OSId; +typedef union { struct { f32 f_odd; f32 f_even; } f; f64 d; } __OSfp; + +typedef struct { + u64 at, v0, v1, a0, a1, a2, a3; + u64 t0, t1, t2, t3, t4, t5, t6, t7; + u64 s0, s1, s2, s3, s4, s5, s6, s7; + u64 t8, t9, gp, sp, s8, ra; + u64 lo, hi; + u32 sr, pc, cause, badvaddr, rcp; + u32 fpcsr; + __OSfp fp0, fp2, fp4, fp6, fp8, fp10, fp12, fp14; + __OSfp fp16, fp18, fp20, fp22, fp24, fp26, fp28, fp30; +} __OSThreadContext; + +typedef struct { + u32 flag; + u32 count; + u64 time; +} __OSThreadprofile_s; + +typedef struct OSThread_s { + struct OSThread_s *next; /* run/mesg queue link */ + OSPri priority; /* run/mesg queue priority */ + struct OSThread_s **queue; /* queue thread is on */ + struct OSThread_s *tlnext; /* all threads queue link */ + u16 state; /* OS_STATE_* */ + u16 flags; /* flags for rmon */ + OSId id; /* id for debugging */ + int fp; /* thread has used fp unit */ + __OSThreadprofile_s *thprof; /* workarea for thread profiler */ + __OSThreadContext context; /* register/interrupt mask */ +} OSThread; + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* Thread states */ + +#define OS_STATE_STOPPED 1 +#define OS_STATE_RUNNABLE 2 +#define OS_STATE_RUNNING 4 +#define OS_STATE_WAITING 8 + +/* Recommended thread priorities for the system threads */ + +#define OS_PRIORITY_MAX 255 +#define OS_PRIORITY_VIMGR 254 +#define OS_PRIORITY_RMON 250 +#define OS_PRIORITY_RMONSPIN 200 +#define OS_PRIORITY_PIMGR 150 +#define OS_PRIORITY_SIMGR 140 +#define OS_PRIORITY_APPMAX 127 +#define OS_PRIORITY_IDLE 0 /* Must be 0 */ + +/* for thread profiler */ +#define THPROF_IDMAX 64 +#define THPROF_STACKSIZE 256 + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Thread operations */ + +extern void osCreateThread(OSThread *, OSId, void (*)(void *), + void *, void *, OSPri); +extern void osDestroyThread(OSThread *); +extern void osYieldThread(void); +extern void osStartThread(OSThread *); +extern void osStopThread(OSThread *); +extern OSId osGetThreadId(OSThread *); +extern void osSetThreadPri(OSThread *, OSPri); +extern OSPri osGetThreadPri(OSThread *); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_THREAD_H_ */ diff --git a/include/2.0L/PR/os_time.h b/include/2.0L/PR/os_time.h new file mode 100644 index 00000000..deaec659 --- /dev/null +++ b/include/2.0L/PR/os_time.h @@ -0,0 +1,114 @@ + +/*==================================================================== + * os_time.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_time.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:19 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_TIME_H_ +#define _OS_TIME_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include "os_message.h" + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +/* + * Structure for time value + */ +typedef u64 OSTime; + +/* + * Structure for interval timer + */ +typedef struct OSTimer_s { + struct OSTimer_s *next; /* point to next timer in list */ + struct OSTimer_s *prev; /* point to previous timer in list */ + OSTime interval; /* duration set by user */ + OSTime value; /* time remaining before */ + /* timer fires */ + OSMesgQueue *mq; /* Message Queue */ + OSMesg msg; /* Message to send */ +} OSTimer; + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Timer interface */ + +extern OSTime osGetTime(void); +extern void osSetTime(OSTime); +extern int osSetTimer(OSTimer *, OSTime, OSTime, + OSMesgQueue *, OSMesg); +extern int osStopTimer(OSTimer *); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_TIME_H_ */ diff --git a/include/2.0L/PR/os_tlb.h b/include/2.0L/PR/os_tlb.h new file mode 100644 index 00000000..2cdd5c9c --- /dev/null +++ b/include/2.0L/PR/os_tlb.h @@ -0,0 +1,107 @@ + +/*==================================================================== + * os_tlb.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_tlb.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:20 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_TLB_H_ +#define _OS_TLB_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +typedef u32 OSPageMask; + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* + * Page size argument for TLB routines + */ +#define OS_PM_4K 0x0000000 +#define OS_PM_16K 0x0006000 +#define OS_PM_64K 0x001e000 +#define OS_PM_256K 0x007e000 +#define OS_PM_1M 0x01fe000 +#define OS_PM_4M 0x07fe000 +#define OS_PM_16M 0x1ffe000 + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* TLB management routines */ + +extern void osMapTLB(s32, OSPageMask, void *, u32, u32, s32); +extern void osMapTLBRdb(void); +extern void osUnmapTLB(s32); +extern void osUnmapTLBAll(void); +extern void osSetTLBASID(s32); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_TLB_H_ */ diff --git a/include/2.0L/PR/os_version.h b/include/2.0L/PR/os_version.h new file mode 100644 index 00000000..c485a438 --- /dev/null +++ b/include/2.0L/PR/os_version.h @@ -0,0 +1,16 @@ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. + + $RCSfile: os_version.h,v $ + $Revision: 1.2 $ + $Date: 1999/06/17 01:33:01 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_VERSION_H_ +#define _OS_VERSION_H_ + +#define OS_MAJOR_VERSION "2.0K" /* major version */ +#define OS_MINOR_VERSION 0 /* patch level */ + +#endif /* !_OS_VERSION_H_ */ diff --git a/include/2.0L/PR/os_vi.h b/include/2.0L/PR/os_vi.h new file mode 100644 index 00000000..5a17f258 --- /dev/null +++ b/include/2.0L/PR/os_vi.h @@ -0,0 +1,298 @@ + +/*==================================================================== + * os_vi.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. (Originated by SGI) + + $RCSfile: os_vi.h,v $ + $Revision: 1.1 $ + $Date: 1998/10/09 08:01:20 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_VI_H_ +#define _OS_VI_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include "os_thread.h" +#include "os_message.h" + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +/* + * Structure to store VI register values that remain the same between 2 fields + */ +typedef struct { + u32 ctrl; + u32 width; + u32 burst; + u32 vSync; + u32 hSync; + u32 leap; + u32 hStart; + u32 xScale; + u32 vCurrent; +} OSViCommonRegs; + + +/* + * Structure to store VI register values that change between fields + */ +typedef struct { + u32 origin; + u32 yScale; + u32 vStart; + u32 vBurst; + u32 vIntr; +} OSViFieldRegs; + + +/* + * Structure for VI mode + */ +typedef struct { + u8 type; /* Mode type */ + OSViCommonRegs comRegs; /* Common registers for both fields */ + OSViFieldRegs fldRegs[2]; /* Registers for Field 1 & 2 */ +} OSViMode; + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* + * Video Interface (VI) mode type + */ +#define OS_VI_NTSC_LPN1 0 /* NTSC */ +#define OS_VI_NTSC_LPF1 1 +#define OS_VI_NTSC_LAN1 2 +#define OS_VI_NTSC_LAF1 3 +#define OS_VI_NTSC_LPN2 4 +#define OS_VI_NTSC_LPF2 5 +#define OS_VI_NTSC_LAN2 6 +#define OS_VI_NTSC_LAF2 7 +#define OS_VI_NTSC_HPN1 8 +#define OS_VI_NTSC_HPF1 9 +#define OS_VI_NTSC_HAN1 10 +#define OS_VI_NTSC_HAF1 11 +#define OS_VI_NTSC_HPN2 12 +#define OS_VI_NTSC_HPF2 13 + +#define OS_VI_PAL_LPN1 14 /* PAL */ +#define OS_VI_PAL_LPF1 15 +#define OS_VI_PAL_LAN1 16 +#define OS_VI_PAL_LAF1 17 +#define OS_VI_PAL_LPN2 18 +#define OS_VI_PAL_LPF2 19 +#define OS_VI_PAL_LAN2 20 +#define OS_VI_PAL_LAF2 21 +#define OS_VI_PAL_HPN1 22 +#define OS_VI_PAL_HPF1 23 +#define OS_VI_PAL_HAN1 24 +#define OS_VI_PAL_HAF1 25 +#define OS_VI_PAL_HPN2 26 +#define OS_VI_PAL_HPF2 27 + +#define OS_VI_MPAL_LPN1 28 /* MPAL - mainly Brazil */ +#define OS_VI_MPAL_LPF1 29 +#define OS_VI_MPAL_LAN1 30 +#define OS_VI_MPAL_LAF1 31 +#define OS_VI_MPAL_LPN2 32 +#define OS_VI_MPAL_LPF2 33 +#define OS_VI_MPAL_LAN2 34 +#define OS_VI_MPAL_LAF2 35 +#define OS_VI_MPAL_HPN1 36 +#define OS_VI_MPAL_HPF1 37 +#define OS_VI_MPAL_HAN1 38 +#define OS_VI_MPAL_HAF1 39 +#define OS_VI_MPAL_HPN2 40 +#define OS_VI_MPAL_HPF2 41 + +#define OS_VI_FPAL_LPN1 42 /* FPAL - Full screen PAL */ +#define OS_VI_FPAL_LPF1 43 +#define OS_VI_FPAL_LAN1 44 +#define OS_VI_FPAL_LAF1 45 +#define OS_VI_FPAL_LPN2 46 +#define OS_VI_FPAL_LPF2 47 +#define OS_VI_FPAL_LAN2 48 +#define OS_VI_FPAL_LAF2 49 +#define OS_VI_FPAL_HPN1 50 +#define OS_VI_FPAL_HPF1 51 +#define OS_VI_FPAL_HAN1 52 +#define OS_VI_FPAL_HAF1 53 +#define OS_VI_FPAL_HPN2 54 +#define OS_VI_FPAL_HPF2 55 + +/* + * Video Interface (VI) special features + */ +#define OS_VI_GAMMA_ON 0x0001 +#define OS_VI_GAMMA_OFF 0x0002 +#define OS_VI_GAMMA_DITHER_ON 0x0004 +#define OS_VI_GAMMA_DITHER_OFF 0x0008 +#define OS_VI_DIVOT_ON 0x0010 +#define OS_VI_DIVOT_OFF 0x0020 +#define OS_VI_DITHER_FILTER_ON 0x0040 +#define OS_VI_DITHER_FILTER_OFF 0x0080 + +/* + * Video Interface (VI) mode attribute bit + */ +#define OS_VI_BIT_NONINTERLACE 0x0001 /* lo-res */ +#define OS_VI_BIT_INTERLACE 0x0002 /* lo-res */ +#define OS_VI_BIT_NORMALINTERLACE 0x0004 /* hi-res */ +#define OS_VI_BIT_DEFLICKINTERLACE 0x0008 /* hi-res */ +#define OS_VI_BIT_ANTIALIAS 0x0010 +#define OS_VI_BIT_POINTSAMPLE 0x0020 +#define OS_VI_BIT_16PIXEL 0x0040 +#define OS_VI_BIT_32PIXEL 0x0080 +#define OS_VI_BIT_LORES 0x0100 +#define OS_VI_BIT_HIRES 0x0200 +#define OS_VI_BIT_NTSC 0x0400 +#define OS_VI_BIT_PAL 0x0800 + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + +extern OSViMode osViModeTable[]; /* Global VI mode table */ + +extern OSViMode osViModeNtscLpn1; /* Individual VI NTSC modes */ +extern OSViMode osViModeNtscLpf1; +extern OSViMode osViModeNtscLan1; +extern OSViMode osViModeNtscLaf1; +extern OSViMode osViModeNtscLpn2; +extern OSViMode osViModeNtscLpf2; +extern OSViMode osViModeNtscLan2; +extern OSViMode osViModeNtscLaf2; +extern OSViMode osViModeNtscHpn1; +extern OSViMode osViModeNtscHpf1; +extern OSViMode osViModeNtscHan1; +extern OSViMode osViModeNtscHaf1; +extern OSViMode osViModeNtscHpn2; +extern OSViMode osViModeNtscHpf2; + +extern OSViMode osViModePalLpn1; /* Individual VI PAL modes */ +extern OSViMode osViModePalLpf1; +extern OSViMode osViModePalLan1; +extern OSViMode osViModePalLaf1; +extern OSViMode osViModePalLpn2; +extern OSViMode osViModePalLpf2; +extern OSViMode osViModePalLan2; +extern OSViMode osViModePalLaf2; +extern OSViMode osViModePalHpn1; +extern OSViMode osViModePalHpf1; +extern OSViMode osViModePalHan1; +extern OSViMode osViModePalHaf1; +extern OSViMode osViModePalHpn2; +extern OSViMode osViModePalHpf2; + +extern OSViMode osViModeMpalLpn1; /* Individual VI MPAL modes */ +extern OSViMode osViModeMpalLpf1; +extern OSViMode osViModeMpalLan1; +extern OSViMode osViModeMpalLaf1; +extern OSViMode osViModeMpalLpn2; +extern OSViMode osViModeMpalLpf2; +extern OSViMode osViModeMpalLan2; +extern OSViMode osViModeMpalLaf2; +extern OSViMode osViModeMpalHpn1; +extern OSViMode osViModeMpalHpf1; +extern OSViMode osViModeMpalHan1; +extern OSViMode osViModeMpalHaf1; +extern OSViMode osViModeMpalHpn2; +extern OSViMode osViModeMpalHpf2; + +extern OSViMode osViModeFpalLpn1; /* Individual VI FPAL modes */ +extern OSViMode osViModeFpalLpf1; +extern OSViMode osViModeFpalLan1; +extern OSViMode osViModeFpalLaf1; +extern OSViMode osViModeFpalLpn2; +extern OSViMode osViModeFpalLpf2; +extern OSViMode osViModeFpalLan2; +extern OSViMode osViModeFpalLaf2; +extern OSViMode osViModeFpalHpn1; +extern OSViMode osViModeFpalHpf1; +extern OSViMode osViModeFpalHan1; +extern OSViMode osViModeFpalHaf1; +extern OSViMode osViModeFpalHpn2; +extern OSViMode osViModeFpalHpf2; + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Video interface (Vi) */ +extern u32 osViGetStatus(void); +extern u32 osViGetCurrentMode(void); +extern u32 osViGetCurrentLine(void); +extern u32 osViGetCurrentField(void); +extern void *osViGetCurrentFramebuffer(void); +extern void *osViGetNextFramebuffer(void); +extern void osViSetXScale(f32); +extern void osViSetYScale(f32); +extern void osViExtendVStart(u32); +extern void osViSetSpecialFeatures(u32); +extern void osViSetMode(OSViMode *); +extern void osViSetEvent(OSMesgQueue *, OSMesg, u32); +extern void osViSwapBuffer(void *); +extern void osViBlack(u8); +extern void osViFade(u8, u16); +extern void osViRepeatLine(u8); +extern void osCreateViManager(OSPri); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_VI_H_ */ diff --git a/include/2.0L/PR/os_voice.h b/include/2.0L/PR/os_voice.h new file mode 100644 index 00000000..4e3cf6ec --- /dev/null +++ b/include/2.0L/PR/os_voice.h @@ -0,0 +1,108 @@ + +/*---------------------------------------------------------------------* + Copyright (C) 1998 Nintendo. + + $RCSfile: os_voice.h,v $ + $Revision: 1.2 $ + $Date: 1999/07/13 08:36:42 $ + *---------------------------------------------------------------------*/ + +#ifndef _OS_VOICE_H_ +#define _OS_VOICE_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +typedef struct { /* Voice Recognition System */ + OSMesgQueue *__mq; /* SI Message Queue */ + int __channel; /* Controller Port # */ + s32 __mode; + u8 cmd_status; /* Command Status */ +} OSVoiceHandle; + +typedef struct { /* Voice Recognition System */ + u16 warning; + u16 answer_num; /* 0...5 */ + u16 voice_level; + u16 voice_sn; + u16 voice_time; + u16 answer[5]; + u16 distance[5]; +} OSVoiceData; + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +/************************************************************************** + * + * Global definitions + * + */ + +/* definition for Voice Recognition System */ + +#define VOICE_WARN_TOO_SMALL 0x0400 +#define VOICE_WARN_TOO_LARGE 0x0800 +#define VOICE_WARN_NOT_FIT 0x4000 +#define VOICE_WARN_TOO_NOISY 0x8000 + +#define VOICE_STATUS_READY 0 +#define VOICE_STATUS_START 1 +#define VOICE_STATUS_CANCEL 3 +#define VOICE_STATUS_BUSY 5 +#define VOICE_STATUS_END 7 + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* Voice Recognition System */ +extern s32 osVoiceInit(OSMesgQueue *, OSVoiceHandle *, int); +extern s32 osVoiceCheckWord(u8 *data); +extern s32 osVoiceClearDictionary(OSVoiceHandle *, u8); +extern s32 osVoiceControlGain(OSVoiceHandle *, s32, s32); +extern s32 osVoiceSetWord(OSVoiceHandle *, u8 *); +extern s32 osVoiceStartReadData(OSVoiceHandle *); +extern s32 osVoiceStopReadData(OSVoiceHandle *); +extern s32 osVoiceGetReadData(OSVoiceHandle *, OSVoiceData *); +extern s32 osVoiceMaskDictionary(OSVoiceHandle *, u8 *, int); +extern void osVoiceCountSyllables(u8 *, u32 *); + + +#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_VOICE_H_ */ diff --git a/include/2.0L/PR/ramrom.h b/include/2.0L/PR/ramrom.h new file mode 100644 index 00000000..42e5c2d5 --- /dev/null +++ b/include/2.0L/PR/ramrom.h @@ -0,0 +1,113 @@ +#ifndef _RAMROM_H +#define _RAMROM_H + +/************************************************************************** + * * + * Copyright (C) 1994, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * $Revision: 1.20 $ + * $Date: 1997/02/11 08:26:47 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/ramrom.h,v $ + * + **************************************************************************/ + +/* + * Defines for the GIO card in the Nintendo Development Station + * + * The RAM on the GIO card acts as ROM for the game + * Interrupts available between the game and the Indy host + * + * The last part of the ramrom is used for communication between + * game and host. There are 6 4K buffers defined: + * log, printf, rmon to indy, rmon from indy, app to indy, app from indy + * The last 8 bytes of the buffer are used in the emulator environment + */ + +#define RAMROM_SIZE (0x1000000) + +#define RAMROM_BUF_SIZE (4096) +#define RAMROM_MSG_SIZE (RAMROM_BUF_SIZE*6) +#define RAMROM_MSG_ADDR (RAMROM_SIZE - RAMROM_MSG_SIZE) +#define RAMROM_MSG_HDR_SIZE (3*sizeof(long)) +#define RAMROM_USER_DATA_SIZE (RAMROM_MSG_SIZE-RAMROM_MSG_HDR_SIZE) + +#define RAMROM_APP_READ_ADDR (RAMROM_MSG_ADDR + (0*RAMROM_BUF_SIZE)) +#define RAMROM_APP_WRITE_ADDR (RAMROM_MSG_ADDR + (1*RAMROM_BUF_SIZE)) +#define RAMROM_RMON_READ_ADDR (RAMROM_MSG_ADDR + (2*RAMROM_BUF_SIZE)) +#define RAMROM_RMON_WRITE_ADDR (RAMROM_MSG_ADDR + (3*RAMROM_BUF_SIZE)) +#define RAMROM_PRINTF_ADDR (RAMROM_MSG_ADDR + (4*RAMROM_BUF_SIZE)) +#define RAMROM_LOG_ADDR (RAMROM_MSG_ADDR + (5*RAMROM_BUF_SIZE)) + +/*#define RAMROM_GIO_INTERRUPT (RAMROM_MSG_ADDR + RAMROM_MSG_SIZE - 4)*/ + +/* + * For the initial round of PIF bringup, we will load in a bootstrap loader + * 0x400 bytes into the ramrom, and the rom will be loaded at 0x2000 + */ +#ifndef _HW_VERSION_1 +#define RAMROM_BOOTSTRAP_OFFSET 0x40 +#define RAMROM_GAME_OFFSET 0x1000 +#define RAMROM_FONTDATA_OFFSET 0xb70 +#define RAMROM_FONTDATA_SIZE 1152 +#else +#define RAMROM_BOOTSTRAP_OFFSET 0x400 +#define RAMROM_GAME_OFFSET 0x2000 +#endif +#define RAMROM_CLOCKRATE_OFFSET 0x4 +#define RAMROM_CLOCKRATE_MASK 0xfffffff0 +#define RAMROM_BOOTADDR_OFFSET 0x8 +#define RAMROM_RELEASE_OFFSET 0xc +/* + * Second version of the PIF jumps to location 0x1000, and we'll put a jump to + * location 0x400 into the ramrom (for backwards compatibility). + */ +#define RAMROM_PIF2BOOTSTRAP_OFFSET 0x1000 + +typedef struct { + long type; + long length; /* in bytes of userdata */ + long magic; + char userdata[RAMROM_USER_DATA_SIZE]; +} RamRomBuffer; + +/* + * Interrupt values (must fit in 6 bits!) + * values are used for both request & response + * Transactions initiated by the host start with HOST + * and those initiated by the target start with GAME. + */ + +#define HOST_PIACCESS_REQ 1 +#define HOST_DBG_CMD_READY 2 +#define GAME_DBG_DATA_SEND 3 +#define HOST_DBG_DATA_ACK 4 +#define GAME_PRINTF_SEND 5 +#define HOST_PRINTF_ACK 6 +#define GAME_LOG_SEND 7 +#define HOST_LOG_ACK 8 +#define HOST_APP_CMD_READY 9 +#define GAME_APP_DATA_READY 10 +#define HOST_PROF_REQ 11 +#define GAME_PROF_SEND 12 +#define HOST_PROF_ACK 13 +#define GAME_FAULT_SEND 14 +#define HOST_FAULT_ACK 15 +#define GAME_EXIT 16 +#define HOST_DATA_ACK 17 + +#ifdef _EMULATOR +void __RamRomInit(int key, void *romaddr); +void __RamRomDestroy(int key); +#endif /* _EMULATOR */ + +#endif /* !_RAMROM_H */ diff --git a/include/2.0L/PR/rcp.h b/include/2.0L/PR/rcp.h new file mode 100644 index 00000000..980f21f0 --- /dev/null +++ b/include/2.0L/PR/rcp.h @@ -0,0 +1,885 @@ +#ifndef _RCP_H_ +#define _RCP_H_ + +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * File: rcp.h + * + * This file contains register and bit definitions for RCP memory map. + * $Revision: 1.22 $ + * $Date: 1999/05/20 03:01:49 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/rcp.h,v $ + * + **************************************************************************/ + +#include +#include + +/********************************************************************** + * + * Here is a quick overview of the RCP memory map: + * + +0x0000_0000 .. 0x03ef_ffff RDRAM memory +0x03f0_0000 .. 0x03ff_ffff RDRAM registers + + RCP registers (see below) +0x0400_0000 .. 0x040f_ffff SP registers +0x0410_0000 .. 0x041f_ffff DP command registers +0x0420_0000 .. 0x042f_ffff DP span registers +0x0430_0000 .. 0x043f_ffff MI registers +0x0440_0000 .. 0x044f_ffff VI registers +0x0450_0000 .. 0x045f_ffff AI registers +0x0460_0000 .. 0x046f_ffff PI registers +0x0470_0000 .. 0x047f_ffff RI registers +0x0480_0000 .. 0x048f_ffff SI registers +0x0490_0000 .. 0x04ff_ffff unused + +0x0500_0000 .. 0x05ff_ffff cartridge domain 2 +0x0600_0000 .. 0x07ff_ffff cartridge domain 1 +0x0800_0000 .. 0x0fff_ffff cartridge domain 2 +0x1000_0000 .. 0x1fbf_ffff cartridge domain 1 + +0x1fc0_0000 .. 0x1fc0_07bf PIF Boot Rom (1984 bytes) +0x1fc0_07c0 .. 0x1fc0_07ff PIF (JoyChannel) RAM (64 bytes) +0x1fc0_0800 .. 0x1fcf_ffff Reserved +0x1fd0_0000 .. 0x7fff_ffff cartridge domain 1 +0x8000_0000 .. 0xffff_ffff external SysAD device + +The Indy development board use cartridge domain 1: +0x1000_0000 .. 0x10ff_ffff RAMROM +0x1800_0000 .. 0x1800_0003 GIO interrupt (6 bits valid in 4 bytes) +0x1800_0400 .. 0x1800_0403 GIO sync (6 bits valid in 4 bytes) +0x1800_0800 .. 0x1800_0803 CART interrupt (6 bits valid in 4 bytes) + + + +**************************************************************************/ + + +/************************************************************************* + * RDRAM Memory (Assumes that maximum size is 4 MB) + */ +#define RDRAM_0_START 0x00000000 +#define RDRAM_0_END 0x001FFFFF +#define RDRAM_1_START 0x00200000 +#define RDRAM_1_END 0x003FFFFF + +#define RDRAM_START RDRAM_0_START +#define RDRAM_END RDRAM_1_END + + +/************************************************************************* + * Address predicates + */ +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) +#define IS_RDRAM(x) ((unsigned)(x) >= RDRAM_START && \ + (unsigned)(x) < RDRAM_END) +#endif + + +/************************************************************************* + * RDRAM Registers (0x03f0_0000 .. 0x03ff_ffff) + */ +#define RDRAM_BASE_REG 0x03F00000 + +#define RDRAM_CONFIG_REG (RDRAM_BASE_REG+0x00) +#define RDRAM_DEVICE_TYPE_REG (RDRAM_BASE_REG+0x00) +#define RDRAM_DEVICE_ID_REG (RDRAM_BASE_REG+0x04) +#define RDRAM_DELAY_REG (RDRAM_BASE_REG+0x08) +#define RDRAM_MODE_REG (RDRAM_BASE_REG+0x0c) +#define RDRAM_REF_INTERVAL_REG (RDRAM_BASE_REG+0x10) +#define RDRAM_REF_ROW_REG (RDRAM_BASE_REG+0x14) +#define RDRAM_RAS_INTERVAL_REG (RDRAM_BASE_REG+0x18) +#define RDRAM_MIN_INTERVAL_REG (RDRAM_BASE_REG+0x1c) +#define RDRAM_ADDR_SELECT_REG (RDRAM_BASE_REG+0x20) +#define RDRAM_DEVICE_MANUF_REG (RDRAM_BASE_REG+0x24) + +#define RDRAM_0_DEVICE_ID 0 +#define RDRAM_1_DEVICE_ID 1 + +#define RDRAM_RESET_MODE 0 +#define RDRAM_ACTIVE_MODE 1 +#define RDRAM_STANDBY_MODE 2 + +#define RDRAM_LENGTH (2*512*2048) +#define RDRAM_0_BASE_ADDRESS (RDRAM_0_DEVICE_ID*RDRAM_LENGTH) +#define RDRAM_1_BASE_ADDRESS (RDRAM_1_DEVICE_ID*RDRAM_LENGTH) + +#define RDRAM_0_CONFIG 0x00000 +#define RDRAM_1_CONFIG 0x00400 +#define RDRAM_GLOBAL_CONFIG 0x80000 + + +/************************************************************************* + * PIF Physical memory map (total size = 2 KB) + * + * Size Description Mode + * 1FC007FF +-------+-----------------+-----+ + * | 64 B | JoyChannel RAM | R/W | + * 1FC007C0 +-------+-----------------+-----+ + * |1984 B | Boot ROM | * | * = Reserved + * 1FC00000 +-------+-----------------+-----+ + * + */ +#define PIF_ROM_START 0x1FC00000 +#define PIF_ROM_END 0x1FC007BF +#define PIF_RAM_START 0x1FC007C0 +#define PIF_RAM_END 0x1FC007FF + + +/************************************************************************* + * Controller channel + * Each game controller channel has 4 error bits that are defined in bit 6-7 of + * the Rx and Tx data size area bytes. Programmers need to clear these bits + * when setting the Tx/Rx size area values for a channel + */ +#define CHNL_ERR_NORESP 0x80 /* Bit 7 (Rx): No response error */ +#define CHNL_ERR_OVERRUN 0x40 /* Bit 6 (Rx): Overrun error */ +#define CHNL_ERR_FRAME 0x80 /* Bit 7 (Tx): Frame error */ +#define CHNL_ERR_COLLISION 0x40 /* Bit 6 (Tx): Collision error */ + +#define CHNL_ERR_MASK 0xC0 /* Bit 6-7: channel errors */ + + +/************************************************************************* + * External device info + */ +#define DEVICE_TYPE_CART 0 /* ROM cartridge */ +#define DEVICE_TYPE_BULK 1 /* ROM bulk */ +#define DEVICE_TYPE_64DD 2 /* 64 Disk Drive */ +#define DEVICE_TYPE_SRAM 3 /* SRAM */ +/* 4-6 are reserved */ +#define DEVICE_TYPE_INIT 7 /* initial value */ +/* 8-14 are reserved */ + +/************************************************************************* + * SP Memory + */ +#define SP_DMEM_START 0x04000000 /* read/write */ +#define SP_DMEM_END 0x04000FFF +#define SP_IMEM_START 0x04001000 /* read/write */ +#define SP_IMEM_END 0x04001FFF + +/************************************************************************* + * SP CP0 Registers + */ + +#define SP_BASE_REG 0x04040000 + +/* SP memory address (R/W): [11:0] DMEM/IMEM address; [12] 0=DMEM,1=IMEM */ +#define SP_MEM_ADDR_REG (SP_BASE_REG+0x00) /* Master */ + +/* SP DRAM DMA address (R/W): [23:0] RDRAM address */ +#define SP_DRAM_ADDR_REG (SP_BASE_REG+0x04) /* Slave */ + +/* SP read DMA length (R/W): [11:0] length, [19:12] count, [31:20] skip */ +/* direction: I/DMEM <- RDRAM */ +#define SP_RD_LEN_REG (SP_BASE_REG+0x08) /* R/W: read len */ + +/* SP write DMA length (R/W): [11:0] length, [19:12] count, [31:20] skip */ +/* direction: I/DMEM -> RDRAM */ +#define SP_WR_LEN_REG (SP_BASE_REG+0x0C) /* R/W: write len */ + +/* SP status (R/W): [14:0] valid bits; see below for write/read mode */ +#define SP_STATUS_REG (SP_BASE_REG+0x10) + +/* SP DMA full (R): [0] valid bit; dma full */ +#define SP_DMA_FULL_REG (SP_BASE_REG+0x14) + +/* SP DMA busy (R): [0] valid bit; dma busy */ +#define SP_DMA_BUSY_REG (SP_BASE_REG+0x18) + +/* SP semaphore (R/W): Read: [0] semaphore flag (set on read) */ +/* Write: [] clear semaphore flag */ +#define SP_SEMAPHORE_REG (SP_BASE_REG+0x1C) + +/* SP PC (R/W): [11:0] program counter */ +#define SP_PC_REG 0x04080000 + +/* SP MEM address: bit 12 specifies if address is IMEM or DMEM */ +#define SP_DMA_DMEM 0x0000 /* Bit 12: 0=DMEM, 1=IMEM */ +#define SP_DMA_IMEM 0x1000 /* Bit 12: 0=DMEM, 1=IMEM */ + +/* + * Values to clear/set bit in status reg (SP_STATUS_REG - write) + */ +#define SP_CLR_HALT 0x00001 /* Bit 0: clear halt */ +#define SP_SET_HALT 0x00002 /* Bit 1: set halt */ +#define SP_CLR_BROKE 0x00004 /* Bit 2: clear broke */ +#define SP_CLR_INTR 0x00008 /* Bit 3: clear intr */ +#define SP_SET_INTR 0x00010 /* Bit 4: set intr */ +#define SP_CLR_SSTEP 0x00020 /* Bit 5: clear sstep */ +#define SP_SET_SSTEP 0x00040 /* Bit 6: set sstep */ +#define SP_CLR_INTR_BREAK 0x00080 /* Bit 7: clear intr on break */ +#define SP_SET_INTR_BREAK 0x00100 /* Bit 8: set intr on break */ +#define SP_CLR_SIG0 0x00200 /* Bit 9: clear signal 0 */ +#define SP_SET_SIG0 0x00400 /* Bit 10: set signal 0 */ +#define SP_CLR_SIG1 0x00800 /* Bit 11: clear signal 1 */ +#define SP_SET_SIG1 0x01000 /* Bit 12: set signal 1 */ +#define SP_CLR_SIG2 0x02000 /* Bit 13: clear signal 2 */ +#define SP_SET_SIG2 0x04000 /* Bit 14: set signal 2 */ +#define SP_CLR_SIG3 0x08000 /* Bit 15: clear signal 3 */ +#define SP_SET_SIG3 0x10000 /* Bit 16: set signal 3 */ +#define SP_CLR_SIG4 0x20000 /* Bit 17: clear signal 4 */ +#define SP_SET_SIG4 0x40000 /* Bit 18: set signal 4 */ +#define SP_CLR_SIG5 0x80000 /* Bit 19: clear signal 5 */ +#define SP_SET_SIG5 0x100000 /* Bit 20: set signal 5 */ +#define SP_CLR_SIG6 0x200000 /* Bit 21: clear signal 6 */ +#define SP_SET_SIG6 0x400000 /* Bit 22: set signal 6 */ +#define SP_CLR_SIG7 0x800000 /* Bit 23: clear signal 7 */ +#define SP_SET_SIG7 0x1000000 /* Bit 24: set signal 7 */ + +/* + * Patterns to interpret status reg (SP_STATUS_REG - read) + */ +#define SP_STATUS_HALT 0x001 /* Bit 0: halt */ +#define SP_STATUS_BROKE 0x002 /* Bit 1: broke */ +#define SP_STATUS_DMA_BUSY 0x004 /* Bit 2: dma busy */ +#define SP_STATUS_DMA_FULL 0x008 /* Bit 3: dma full */ +#define SP_STATUS_IO_FULL 0x010 /* Bit 4: io full */ +#define SP_STATUS_SSTEP 0x020 /* Bit 5: single step */ +#define SP_STATUS_INTR_BREAK 0x040 /* Bit 6: interrupt on break */ +#define SP_STATUS_SIG0 0x080 /* Bit 7: signal 0 set */ +#define SP_STATUS_SIG1 0x100 /* Bit 8: signal 1 set */ +#define SP_STATUS_SIG2 0x200 /* Bit 9: signal 2 set */ +#define SP_STATUS_SIG3 0x400 /* Bit 10: signal 3 set */ +#define SP_STATUS_SIG4 0x800 /* Bit 11: signal 4 set */ +#define SP_STATUS_SIG5 0x1000 /* Bit 12: signal 5 set */ +#define SP_STATUS_SIG6 0x2000 /* Bit 13: signal 6 set */ +#define SP_STATUS_SIG7 0x4000 /* Bit 14: signal 7 set */ + +/* + * Use of SIG bits + */ +#define SP_CLR_YIELD SP_CLR_SIG0 +#define SP_SET_YIELD SP_SET_SIG0 +#define SP_STATUS_YIELD SP_STATUS_SIG0 +#define SP_CLR_YIELDED SP_CLR_SIG1 +#define SP_SET_YIELDED SP_SET_SIG1 +#define SP_STATUS_YIELDED SP_STATUS_SIG1 +#define SP_CLR_TASKDONE SP_CLR_SIG2 +#define SP_SET_TASKDONE SP_SET_SIG2 +#define SP_STATUS_TASKDONE SP_STATUS_SIG2 +#define SP_CLR_RSPSIGNAL SP_CLR_SIG3 +#define SP_SET_RSPSIGNAL SP_SET_SIG3 +#define SP_STATUS_RSPSIGNAL SP_STATUS_SIG3 +#define SP_CLR_CPUSIGNAL SP_CLR_SIG4 +#define SP_SET_CPUSIGNAL SP_SET_SIG4 +#define SP_STATUS_CPUSIGNAL SP_STATUS_SIG4 + +/* SP IMEM BIST REG (R/W): [6:0] BIST status bits; see below for detail */ +#define SP_IBIST_REG 0x04080004 + +/* + * Patterns to interpret status reg (SP_BIST_REG - write) + */ +#define SP_IBIST_CHECK 0x01 /* Bit 0: BIST check */ +#define SP_IBIST_GO 0x02 /* Bit 1: BIST go */ +#define SP_IBIST_CLEAR 0x04 /* Bit 2: BIST clear */ + +/* + * Patterns to interpret status reg (SP_BIST_REG - read) + */ +/* First 2 bits are same as in write mode: + * Bit 0: BIST check; Bit 1: BIST go + */ +#define SP_IBIST_DONE 0x04 /* Bit 2: BIST done */ +#define SP_IBIST_FAILED 0x78 /* Bit [6:3]: BIST fail */ + + +/************************************************************************* + * DP Command Registers + */ +#define DPC_BASE_REG 0x04100000 + +/* DP CMD DMA start (R/W): [23:0] DMEM/RDRAM start address */ +#define DPC_START_REG (DPC_BASE_REG+0x00) + +/* DP CMD DMA end (R/W): [23:0] DMEM/RDRAM end address */ +#define DPC_END_REG (DPC_BASE_REG+0x04) + +/* DP CMD DMA end (R): [23:0] DMEM/RDRAM current address */ +#define DPC_CURRENT_REG (DPC_BASE_REG+0x08) + +/* DP CMD status (R/W): [9:0] valid bits - see below for definitions */ +#define DPC_STATUS_REG (DPC_BASE_REG+0x0C) + +/* DP clock counter (R): [23:0] clock counter */ +#define DPC_CLOCK_REG (DPC_BASE_REG+0x10) + +/* DP buffer busy counter (R): [23:0] clock counter */ +#define DPC_BUFBUSY_REG (DPC_BASE_REG+0x14) + +/* DP pipe busy counter (R): [23:0] clock counter */ +#define DPC_PIPEBUSY_REG (DPC_BASE_REG+0x18) + +/* DP TMEM load counter (R): [23:0] clock counter */ +#define DPC_TMEM_REG (DPC_BASE_REG+0x1C) + +/* + * Values to clear/set bit in status reg (DPC_STATUS_REG - write) + */ +#define DPC_CLR_XBUS_DMEM_DMA 0x0001 /* Bit 0: clear xbus_dmem_dma */ +#define DPC_SET_XBUS_DMEM_DMA 0x0002 /* Bit 1: set xbus_dmem_dma */ +#define DPC_CLR_FREEZE 0x0004 /* Bit 2: clear freeze */ +#define DPC_SET_FREEZE 0x0008 /* Bit 3: set freeze */ +#define DPC_CLR_FLUSH 0x0010 /* Bit 4: clear flush */ +#define DPC_SET_FLUSH 0x0020 /* Bit 5: set flush */ +#define DPC_CLR_TMEM_CTR 0x0040 /* Bit 6: clear tmem ctr */ +#define DPC_CLR_PIPE_CTR 0x0080 /* Bit 7: clear pipe ctr */ +#define DPC_CLR_CMD_CTR 0x0100 /* Bit 8: clear cmd ctr */ +#define DPC_CLR_CLOCK_CTR 0x0200 /* Bit 9: clear clock ctr */ + +/* + * Patterns to interpret status reg (DPC_STATUS_REG - read) + */ +#define DPC_STATUS_XBUS_DMEM_DMA 0x001 /* Bit 0: xbus_dmem_dma */ +#define DPC_STATUS_FREEZE 0x002 /* Bit 1: freeze */ +#define DPC_STATUS_FLUSH 0x004 /* Bit 2: flush */ +/*#define DPC_STATUS_FROZEN 0x008*/ /* Bit 3: frozen */ +#define DPC_STATUS_START_GCLK 0x008 /* Bit 3: start gclk */ +#define DPC_STATUS_TMEM_BUSY 0x010 /* Bit 4: tmem busy */ +#define DPC_STATUS_PIPE_BUSY 0x020 /* Bit 5: pipe busy */ +#define DPC_STATUS_CMD_BUSY 0x040 /* Bit 6: cmd busy */ +#define DPC_STATUS_CBUF_READY 0x080 /* Bit 7: cbuf ready */ +#define DPC_STATUS_DMA_BUSY 0x100 /* Bit 8: dma busy */ +#define DPC_STATUS_END_VALID 0x200 /* Bit 9: end valid */ +#define DPC_STATUS_START_VALID 0x400 /* Bit 10: start valid */ + + +/************************************************************************* + * DP Span Registers + */ +#define DPS_BASE_REG 0x04200000 + +/* DP tmem bist (R/W): [10:0] BIST status bits; see below for detail */ +#define DPS_TBIST_REG (DPS_BASE_REG+0x00) + +/* DP span test mode (R/W): [0] Span buffer test access enable */ +#define DPS_TEST_MODE_REG (DPS_BASE_REG+0x04) + +/* DP span buffer test address (R/W): [6:0] bits; see below for detail */ +#define DPS_BUFTEST_ADDR_REG (DPS_BASE_REG+0x08) + +/* DP span buffer test data (R/W): [31:0] span buffer data */ +#define DPS_BUFTEST_DATA_REG (DPS_BASE_REG+0x0C) + +/* + * Patterns to interpret status reg (DPS_TMEM_BIST_REG - write) + */ +#define DPS_TBIST_CHECK 0x01 /* Bit 0: BIST check */ +#define DPS_TBIST_GO 0x02 /* Bit 1: BIST go */ +#define DPS_TBIST_CLEAR 0x04 /* Bit 2: BIST clear */ + +/* + * Patterns to interpret status reg (DPS_TMEM_BIST_REG - read) + */ +/* First 2 bits are same as in write mode: + * Bit 0: BIST check; Bit 1: BIST go + */ +#define DPS_TBIST_DONE 0x004 /* Bit 2: BIST done */ +#define DPS_TBIST_FAILED 0x7F8 /* Bit [10:3]: BIST fail */ + + +/************************************************************************* + * MIPS Interface (MI) Registers + */ +#define MI_BASE_REG 0x04300000 + +/* + * MI init mode (W): [6:0] init length, [7] clear init mode, [8] set init mode + * [9/10] clear/set ebus test mode, [11] clear DP interrupt + * (R): [6:0] init length, [7] init mode, [8] ebus test mode + */ +#define MI_INIT_MODE_REG (MI_BASE_REG+0x00) +#define MI_MODE_REG MI_INIT_MODE_REG + +/* + * Values to clear/set bit in mode reg (MI_MODE_REG - write) + */ +#define MI_CLR_INIT 0x0080 /* Bit 7: clear init mode */ +#define MI_SET_INIT 0x0100 /* Bit 8: set init mode */ +#define MI_CLR_EBUS 0x0200 /* Bit 9: clear ebus test */ +#define MI_SET_EBUS 0x0400 /* Bit 10: set ebus test mode */ +#define MI_CLR_DP_INTR 0x0800 /* Bit 11: clear dp interrupt */ +#define MI_CLR_RDRAM 0x1000 /* Bit 12: clear RDRAM reg */ +#define MI_SET_RDRAM 0x2000 /* Bit 13: set RDRAM reg mode */ + +/* + * Patterns to interpret mode reg (MI_MODE_REG - read) + */ +#define MI_MODE_INIT 0x0080 /* Bit 7: init mode */ +#define MI_MODE_EBUS 0x0100 /* Bit 8: ebus test mode */ +#define MI_MODE_RDRAM 0x0200 /* Bit 9: RDRAM reg mode */ + +/* MI version (R): [7:0] io, [15:8] rac, [23:16] rdp, [31:24] rsp */ +#define MI_VERSION_REG (MI_BASE_REG+0x04) +#define MI_NOOP_REG MI_VERSION_REG + +/* MI interrupt (R): [5:0] valid bits - see below for bit patterns */ +#define MI_INTR_REG (MI_BASE_REG+0x08) + +/* + * MI interrupt mask (W): [11:0] valid bits - see below for bit patterns + * (R): [5:0] valid bits - see below for bit patterns + */ +#define MI_INTR_MASK_REG (MI_BASE_REG+0x0C) + +/* + * The following are values to check for interrupt setting (MI_INTR_REG) + */ +#define MI_INTR_SP 0x01 /* Bit 0: SP intr */ +#define MI_INTR_SI 0x02 /* Bit 1: SI intr */ +#define MI_INTR_AI 0x04 /* Bit 2: AI intr */ +#define MI_INTR_VI 0x08 /* Bit 3: VI intr */ +#define MI_INTR_PI 0x10 /* Bit 4: PI intr */ +#define MI_INTR_DP 0x20 /* Bit 5: DP intr */ + +/* + * The following are values to clear/set various interrupt bit mask + * They can be ORed together to manipulate multiple bits + * (MI_INTR_MASK_REG - write) + */ +#define MI_INTR_MASK_CLR_SP 0x0001 /* Bit 0: clear SP mask */ +#define MI_INTR_MASK_SET_SP 0x0002 /* Bit 1: set SP mask */ +#define MI_INTR_MASK_CLR_SI 0x0004 /* Bit 2: clear SI mask */ +#define MI_INTR_MASK_SET_SI 0x0008 /* Bit 3: set SI mask */ +#define MI_INTR_MASK_CLR_AI 0x0010 /* Bit 4: clear AI mask */ +#define MI_INTR_MASK_SET_AI 0x0020 /* Bit 5: set AI mask */ +#define MI_INTR_MASK_CLR_VI 0x0040 /* Bit 6: clear VI mask */ +#define MI_INTR_MASK_SET_VI 0x0080 /* Bit 7: set VI mask */ +#define MI_INTR_MASK_CLR_PI 0x0100 /* Bit 8: clear PI mask */ +#define MI_INTR_MASK_SET_PI 0x0200 /* Bit 9: set PI mask */ +#define MI_INTR_MASK_CLR_DP 0x0400 /* Bit 10: clear DP mask */ +#define MI_INTR_MASK_SET_DP 0x0800 /* Bit 11: set DP mask */ + +/* + * The following are values to check for interrupt mask setting + * (MI_INTR_MASK_REG - read) + */ +#define MI_INTR_MASK_SP 0x01 /* Bit 0: SP intr mask */ +#define MI_INTR_MASK_SI 0x02 /* Bit 1: SI intr mask */ +#define MI_INTR_MASK_AI 0x04 /* Bit 2: AI intr mask */ +#define MI_INTR_MASK_VI 0x08 /* Bit 3: VI intr mask */ +#define MI_INTR_MASK_PI 0x10 /* Bit 4: PI intr mask */ +#define MI_INTR_MASK_DP 0x20 /* Bit 5: DP intr mask */ + + +/************************************************************************* + * Video Interface (VI) Registers + */ +#define VI_BASE_REG 0x04400000 + +/* VI status/control (R/W): [15-0] valid bits: + * [1:0] = type[1:0] (pixel size) + * 0: blank (no data, no sync) + * 1: reserved + * 2: 5/5/5/3 ("16" bit) + * 3: 8/8/8/8 (32 bit) + * [2] = gamma_dither_enable (normally on, unless "special effect") + * [3] = gamma_enable (normally on, unless MPEG/JPEG) + * [4] = divot_enable (normally on if antialiased, unless decal lines) + * [5] = reserved - always off + * [6] = serrate (always on if interlaced, off if not) + * [7] = reserved - diagnostics only + * [9:8] = anti-alias (aa) mode[1:0] + * 0: aa & resamp (always fetch extra lines) + * 1: aa & resamp (fetch extra lines if needed) + * 2: resamp only (treat as all fully covered) + * 3: neither (replicate pixels, no interpolate) + * [11] = reserved - diagnostics only + * [15:12] = reserved + * + */ +#define VI_STATUS_REG (VI_BASE_REG+0x00) +#define VI_CONTROL_REG VI_STATUS_REG + +/* VI origin (R/W): [23:0] frame buffer origin in bytes */ +#define VI_ORIGIN_REG (VI_BASE_REG+0x04) +#define VI_DRAM_ADDR_REG VI_ORIGIN_REG + +/* VI width (R/W): [11:0] frame buffer line width in pixels */ +#define VI_WIDTH_REG (VI_BASE_REG+0x08) +#define VI_H_WIDTH_REG VI_WIDTH_REG + +/* VI vertical intr (R/W): [9:0] interrupt when current half-line = V_INTR */ +#define VI_INTR_REG (VI_BASE_REG+0x0C) +#define VI_V_INTR_REG VI_INTR_REG + +/* + * VI current vertical line (R/W): [9:0] current half line, sampled once per + * line (the lsb of V_CURRENT is constant within a field, and in + * interlaced modes gives the field number - which is constant for non- + * interlaced modes) + * - Any write to this register will clear interrupt line + */ +#define VI_CURRENT_REG (VI_BASE_REG+0x10) +#define VI_V_CURRENT_LINE_REG VI_CURRENT_REG + +/* + * VI video timing (R/W): [ 7: 0] horizontal sync width in pixels, + * [15: 8] color burst width in pixels, + * [19:16] vertical sync width in half lines, + * [29:20] start of color burst in pixels from h-sync + */ +#define VI_BURST_REG (VI_BASE_REG+0x14) +#define VI_TIMING_REG VI_BURST_REG + +/* VI vertical sync (R/W): [9:0] number of half-lines per field */ +#define VI_V_SYNC_REG (VI_BASE_REG+0x18) + +/* VI horizontal sync (R/W): [11: 0] total duration of a line in 1/4 pixel + * [20:16] a 5-bit leap pattern used for PAL only + * (h_sync_period) + */ +#define VI_H_SYNC_REG (VI_BASE_REG+0x1C) + +/* + * VI horizontal sync leap (R/W): [11: 0] identical to h_sync_period + * [27:16] identical to h_sync_period + */ +#define VI_LEAP_REG (VI_BASE_REG+0x20) +#define VI_H_SYNC_LEAP_REG VI_LEAP_REG + +/* + * VI horizontal video (R/W): [ 9: 0] end of active video in screen pixels + * : [25:16] start of active video in screen pixels + */ +#define VI_H_START_REG (VI_BASE_REG+0x24) +#define VI_H_VIDEO_REG VI_H_START_REG + +/* + * VI vertical video (R/W): [ 9: 0] end of active video in screen half-lines + * : [25:16] start of active video in screen half-lines + */ +#define VI_V_START_REG (VI_BASE_REG+0x28) +#define VI_V_VIDEO_REG VI_V_START_REG + +/* + * VI vertical burst (R/W): [ 9: 0] end of color burst enable in half-lines + * : [25:16] start of color burst enable in half-lines + */ +#define VI_V_BURST_REG (VI_BASE_REG+0x2C) + +/* VI x-scale (R/W): [11: 0] 1/horizontal scale up factor (2.10 format) + * [27:16] horizontal subpixel offset (2.10 format) + */ +#define VI_X_SCALE_REG (VI_BASE_REG+0x30) + +/* VI y-scale (R/W): [11: 0] 1/vertical scale up factor (2.10 format) + * [27:16] vertical subpixel offset (2.10 format) + */ +#define VI_Y_SCALE_REG (VI_BASE_REG+0x34) + +/* + * Patterns to interpret VI_CONTROL_REG + */ +#define VI_CTRL_TYPE_16 0x00002 /* Bit [1:0] pixel size: 16 bit */ +#define VI_CTRL_TYPE_32 0x00003 /* Bit [1:0] pixel size: 32 bit */ +#define VI_CTRL_GAMMA_DITHER_ON 0x00004 /* Bit 2: default = on */ +#define VI_CTRL_GAMMA_ON 0x00008 /* Bit 3: default = on */ +#define VI_CTRL_DIVOT_ON 0x00010 /* Bit 4: default = on */ +#define VI_CTRL_SERRATE_ON 0x00040 /* Bit 6: on if interlaced */ +#define VI_CTRL_ANTIALIAS_MASK 0x00300 /* Bit [9:8] anti-alias mode */ +#define VI_CTRL_DITHER_FILTER_ON 0x10000 /* Bit 16: dither-filter mode */ + +/* + * Possible video clocks (NTSC or PAL) + */ +#define VI_NTSC_CLOCK 48681812 /* Hz = 48.681812 MHz */ +#define VI_PAL_CLOCK 49656530 /* Hz = 49.656530 MHz */ +#define VI_MPAL_CLOCK 48628316 /* Hz = 48.628316 MHz */ + + +/************************************************************************* + * Audio Interface (AI) Registers + * + * The address and length registers are double buffered; that is, they + * can be written twice before becoming full. + * The address must be written before the length. + */ +#define AI_BASE_REG 0x04500000 + +/* AI DRAM address (W): [23:0] starting RDRAM address (8B-aligned) */ +#define AI_DRAM_ADDR_REG (AI_BASE_REG+0x00) /* R0: DRAM address */ + +/* AI length (R/W): [14:0] transfer length (v1.0) - Bottom 3 bits are ignored */ +/* [17:0] transfer length (v2.0) - Bottom 3 bits are ignored */ +#define AI_LEN_REG (AI_BASE_REG+0x04) /* R1: Length */ + +/* AI control (W): [0] DMA enable - if LSB == 1, DMA is enabled */ +#define AI_CONTROL_REG (AI_BASE_REG+0x08) /* R2: DMA Control */ + +/* + * AI status (R): [31]/[0] ai_full (addr & len buffer full), [30] ai_busy + * Note that a 1->0 transition in ai_full will set interrupt + * (W): clear audio interrupt + */ +#define AI_STATUS_REG (AI_BASE_REG+0x0C) /* R3: Status */ + +/* + * AI DAC sample period register (W): [13:0] dac rate + * - vid_clock/(dperiod + 1) is the DAC sample rate + * - (dperiod + 1) >= 66 * (aclockhp + 1) must be true + */ +#define AI_DACRATE_REG (AI_BASE_REG+0x10) /* R4: DAC rate 14-lsb*/ + +/* + * AI bit rate (W): [3:0] bit rate (abus clock half period register - aclockhp) + * - vid_clock/(2 * (aclockhp + 1)) is the DAC clock rate + * - The abus clock stops if aclockhp is zero + */ +#define AI_BITRATE_REG (AI_BASE_REG+0x14) /* R5: Bit rate 4-lsb */ + +/* Value for control register */ +#define AI_CONTROL_DMA_ON 0x01 /* LSB = 1: DMA enable*/ +#define AI_CONTROL_DMA_OFF 0x00 /* LSB = 1: DMA enable*/ + +/* Value for status register */ +#define AI_STATUS_FIFO_FULL 0x80000000 /* Bit 31: full */ +#define AI_STATUS_DMA_BUSY 0x40000000 /* Bit 30: busy */ + +/* DAC rate = video clock / audio frequency + * - DAC rate >= (66 * Bit rate) must be true + */ +#define AI_MAX_DAC_RATE 16384 /* 14-bit+1 */ +#define AI_MIN_DAC_RATE 132 + +/* Bit rate <= (DAC rate / 66) */ +#define AI_MAX_BIT_RATE 16 /* 4-bit+1 */ +#define AI_MIN_BIT_RATE 2 + +/* + * Maximum and minimum values for audio frequency based on video clocks + * max frequency = (video clock / min dac rate) + * min frequency = (video clock / max dac rate) + */ +#define AI_NTSC_MAX_FREQ 368000 /* 368 KHz */ +#define AI_NTSC_MIN_FREQ 3000 /* 3 KHz ~ 2971 Hz */ + +#define AI_PAL_MAX_FREQ 376000 /* 376 KHz */ +#define AI_PAL_MIN_FREQ 3050 /* 3 KHz ~ 3031 Hz */ + +#define AI_MPAL_MAX_FREQ 368000 /* 368 KHz */ +#define AI_MPAL_MIN_FREQ 3000 /* 3 KHz ~ 2968 Hz */ + + +/************************************************************************* + * Peripheral Interface (PI) Registers + */ +#define PI_BASE_REG 0x04600000 + +/* PI DRAM address (R/W): [23:0] starting RDRAM address */ +#define PI_DRAM_ADDR_REG (PI_BASE_REG+0x00) /* DRAM address */ + +/* PI pbus (cartridge) address (R/W): [31:0] starting AD16 address */ +#define PI_CART_ADDR_REG (PI_BASE_REG+0x04) + +/* PI read length (R/W): [23:0] read data length */ +#define PI_RD_LEN_REG (PI_BASE_REG+0x08) + +/* PI write length (R/W): [23:0] write data length */ +#define PI_WR_LEN_REG (PI_BASE_REG+0x0C) + +/* + * PI status (R): [0] DMA busy, [1] IO busy, [2], error + * (W): [0] reset controller (and abort current op), [1] clear intr + */ +#define PI_STATUS_REG (PI_BASE_REG+0x10) + +/* PI dom1 latency (R/W): [7:0] domain 1 device latency */ +#define PI_BSD_DOM1_LAT_REG (PI_BASE_REG+0x14) + +/* PI dom1 pulse width (R/W): [7:0] domain 1 device R/W strobe pulse width */ +#define PI_BSD_DOM1_PWD_REG (PI_BASE_REG+0x18) + +/* PI dom1 page size (R/W): [3:0] domain 1 device page size */ +#define PI_BSD_DOM1_PGS_REG (PI_BASE_REG+0x1C) /* page size */ + +/* PI dom1 release (R/W): [1:0] domain 1 device R/W release duration */ +#define PI_BSD_DOM1_RLS_REG (PI_BASE_REG+0x20) + +/* PI dom2 latency (R/W): [7:0] domain 2 device latency */ +#define PI_BSD_DOM2_LAT_REG (PI_BASE_REG+0x24) /* Domain 2 latency */ + +/* PI dom2 pulse width (R/W): [7:0] domain 2 device R/W strobe pulse width */ +#define PI_BSD_DOM2_PWD_REG (PI_BASE_REG+0x28) /* pulse width */ + +/* PI dom2 page size (R/W): [3:0] domain 2 device page size */ +#define PI_BSD_DOM2_PGS_REG (PI_BASE_REG+0x2C) /* page size */ + +/* PI dom2 release (R/W): [1:0] domain 2 device R/W release duration */ +#define PI_BSD_DOM2_RLS_REG (PI_BASE_REG+0x30) /* release duration */ + +#define PI_DOMAIN1_REG PI_BSD_DOM1_LAT_REG +#define PI_DOMAIN2_REG PI_BSD_DOM2_LAT_REG + +#define PI_DOM_LAT_OFS 0x00 +#define PI_DOM_PWD_OFS 0x04 +#define PI_DOM_PGS_OFS 0x08 +#define PI_DOM_RLS_OFS 0x0C + +/* + * PI status register has 3 bits active when read from (PI_STATUS_REG - read) + * Bit 0: DMA busy - set when DMA is in progress + * Bit 1: IO busy - set when IO is in progress + * Bit 2: Error - set when CPU issues IO request while DMA is busy + */ +#define PI_STATUS_ERROR 0x04 +#define PI_STATUS_IO_BUSY 0x02 +#define PI_STATUS_DMA_BUSY 0x01 + +/* PI status register has 2 bits active when written to: + * Bit 0: When set, reset PIC + * Bit 1: When set, clear interrupt flag + * The values of the two bits can be ORed together to both reset PIC and + * clear interrupt at the same time. + * + * Note: + * - The PIC does generate an interrupt at the end of each DMA. CPU + * needs to clear the interrupt flag explicitly (from an interrupt + * handler) by writing into the STATUS register with bit 1 set. + * + * - When a DMA completes, the interrupt flag is set. CPU can issue + * another request even while the interrupt flag is set (as long as + * PIC is idle). However, it is the CPU's responsibility for + * maintaining accurate correspondence between DMA completions and + * interrupts. + * + * - When PIC is reset, if PIC happens to be busy, an interrupt will + * be generated as PIC returns to idle. Otherwise, no interrupt will + * be generated and PIC remains idle. + */ +/* + * Values to clear interrupt/reset PIC (PI_STATUS_REG - write) + */ +#define PI_STATUS_RESET 0x01 +#define PI_SET_RESET PI_STATUS_RESET + +#define PI_STATUS_CLR_INTR 0x02 +#define PI_CLR_INTR PI_STATUS_CLR_INTR + +#define PI_DMA_BUFFER_SIZE 128 + +#define PI_DOM1_ADDR1 0x06000000 /* to 0x07FFFFFF */ +#define PI_DOM1_ADDR2 0x10000000 /* to 0x1FBFFFFF */ +#define PI_DOM1_ADDR3 0x1FD00000 /* to 0x7FFFFFFF */ +#define PI_DOM2_ADDR1 0x05000000 /* to 0x05FFFFFF */ +#define PI_DOM2_ADDR2 0x08000000 /* to 0x0FFFFFFF */ + + +/************************************************************************* + * RDRAM Interface (RI) Registers + */ +#define RI_BASE_REG 0x04700000 + +/* RI mode (R/W): [1:0] operating mode, [2] stop T active, [3] stop R active */ +#define RI_MODE_REG (RI_BASE_REG+0x00) + +/* RI config (R/W): [5:0] current control input, [6] current control enable */ +#define RI_CONFIG_REG (RI_BASE_REG+0x04) + +/* RI current load (W): [] any write updates current control register */ +#define RI_CURRENT_LOAD_REG (RI_BASE_REG+0x08) + +/* RI select (R/W): [2:0] receive select, [2:0] transmit select */ +#define RI_SELECT_REG (RI_BASE_REG+0x0C) + +/* RI refresh (R/W): [7:0] clean refresh delay, [15:8] dirty refresh delay, + * [16] refresh bank, [17] refresh enable + * [18] refresh optimize + */ +#define RI_REFRESH_REG (RI_BASE_REG+0x10) +#define RI_COUNT_REG RI_REFRESH_REG + +/* RI latency (R/W): [3:0] DMA latency/overlap */ +#define RI_LATENCY_REG (RI_BASE_REG+0x14) + +/* RI error (R): [0] nack error, [1] ack error */ +#define RI_RERROR_REG (RI_BASE_REG+0x18) + +/* RI error (W): [] any write clears all error bits */ +#define RI_WERROR_REG (RI_BASE_REG+0x1C) + + +/************************************************************************* + * Serial Interface (SI) Registers + */ +#define SI_BASE_REG 0x04800000 + +/* SI DRAM address (R/W): [23:0] starting RDRAM address */ +#define SI_DRAM_ADDR_REG (SI_BASE_REG+0x00) /* R0: DRAM address */ + +/* SI address read 64B (W): [] any write causes a 64B DMA write */ +#define SI_PIF_ADDR_RD64B_REG (SI_BASE_REG+0x04) /* R1: 64B PIF->DRAM */ + +/* Address SI_BASE_REG + (0x08, 0x0c, 0x14) are reserved */ + +/* SI address write 64B (W): [] any write causes a 64B DMA read */ +#define SI_PIF_ADDR_WR64B_REG (SI_BASE_REG+0x10) /* R4: 64B DRAM->PIF */ + +/* + * SI status (W): [] any write clears interrupt + * (R): [0] DMA busy, [1] IO read busy, [2] reserved + * [3] DMA error, [12] interrupt + */ +#define SI_STATUS_REG (SI_BASE_REG+0x18) /* R6: Status */ + +/* SI status register has the following bits active: + * 0: DMA busy - set when DMA is in progress + * 1: IO busy - set when IO access is in progress + * 3: DMA error - set when there are overlapping DMA requests + * 12: Interrupt - Interrupt set + */ +#define SI_STATUS_DMA_BUSY 0x0001 +#define SI_STATUS_RD_BUSY 0x0002 +#define SI_STATUS_DMA_ERROR 0x0008 +#define SI_STATUS_INTERRUPT 0x1000 + +/************************************************************************* + * Development Board GIO Control Registers + */ + +#define GIO_BASE_REG 0x18000000 + +/* Game to Host Interrupt */ +#define GIO_GIO_INTR_REG (GIO_BASE_REG+0x000) + +/* Game to Host SYNC */ +#define GIO_GIO_SYNC_REG (GIO_BASE_REG+0x400) + +/* Host to Game Interrupt */ +#define GIO_CART_INTR_REG (GIO_BASE_REG+0x800) + + +/************************************************************************* + * Common macros + */ +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) +#define IO_READ(addr) (*(vu32 *)PHYS_TO_K1(addr)) +#define IO_WRITE(addr,data) (*(vu32 *)PHYS_TO_K1(addr)=(u32)(data)) +#define RCP_STAT_PRINT \ + rmonPrintf("current=%x start=%x end=%x dpstat=%x spstat=%x\n", \ + IO_READ(DPC_CURRENT_REG), \ + IO_READ(DPC_START_REG), \ + IO_READ(DPC_END_REG), \ + IO_READ(DPC_STATUS_REG), \ + IO_READ(SP_STATUS_REG)) + +#endif + +#endif /* _RCP_H_ */ + diff --git a/include/2.0L/PR/rdb.h b/include/2.0L/PR/rdb.h new file mode 100644 index 00000000..e0897493 --- /dev/null +++ b/include/2.0L/PR/rdb.h @@ -0,0 +1,93 @@ + +/************************************************************************** + * + * $Revision: 1.6 $ + * $Date: 1997/02/11 08:29:31 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/rdb.h,v $ + * + **************************************************************************/ + +#ifndef _RDB_H +#define _RDB_H + +/* U64 side address */ +#define RDB_BASE_REG 0xc0000000 +#define RDB_WRITE_INTR_REG (RDB_BASE_REG + 0x8) +#define RDB_READ_INTR_REG (RDB_BASE_REG + 0xc) +#define RDB_BASE_VIRTUAL_ADDR 0x80000000 + +/* packet type Have six bits, so can have up to 63 types */ +#define RDB_TYPE_INVALID 0 +#define RDB_TYPE_GtoH_PRINT 1 +#define RDB_TYPE_GtoH_FAULT 2 +#define RDB_TYPE_GtoH_LOG_CT 3 +#define RDB_TYPE_GtoH_LOG 4 +#define RDB_TYPE_GtoH_READY_FOR_DATA 5 +#define RDB_TYPE_GtoH_DATA_CT 6 +#define RDB_TYPE_GtoH_DATA 7 +#define RDB_TYPE_GtoH_DEBUG 8 +#define RDB_TYPE_GtoH_RAMROM 9 +#define RDB_TYPE_GtoH_DEBUG_DONE 10 +#define RDB_TYPE_GtoH_DEBUG_READY 11 +#define RDB_TYPE_GtoH_KDEBUG 12 +#define RDB_TYPE_GtoH_PROF_DATA 22 + + +#define RDB_TYPE_HtoG_LOG_DONE 13 +#define RDB_TYPE_HtoG_DEBUG 14 +#define RDB_TYPE_HtoG_DEBUG_CT 15 +#define RDB_TYPE_HtoG_DATA 16 +#define RDB_TYPE_HtoG_DATA_DONE 17 +#define RDB_TYPE_HtoG_REQ_RAMROM 18 +#define RDB_TYPE_HtoG_FREE_RAMROM 19 +#define RDB_TYPE_HtoG_KDEBUG 20 +#define RDB_TYPE_HtoG_PROF_SIGNAL 21 + + +#define RDB_PROF_ACK_SIG 1 +#define RDB_PROF_FLUSH_SIG 2 +#define PROF_BLOCK_SIZE 2048 + +#define RDB_LOG_MAX_BLOCK_SIZE 0x8000 +#define RDB_DATA_MAX_BLOCK_SIZE 0x8000 + + +/* GIO side address */ +#define GIO_RDB_BASE_REG 0xbf480000 +#define GIO_RDB_WRITE_INTR_REG (GIO_RDB_BASE_REG + 0x8) +#define GIO_RDB_READ_INTR_REG (GIO_RDB_BASE_REG + 0xc) + +/* minor device number */ +#define GIO_RDB_PRINT_MINOR 1 +#define GIO_RDB_DEBUG_MINOR 2 + +/* interrupt bit */ +#define GIO_RDB_WRITE_INTR_BIT 0x80000000 +#define GIO_RDB_READ_INTR_BIT 0x40000000 + +/* debug command */ +#define DEBUG_COMMAND_NULL 0 +#define DEBUG_COMMAND_MEMORY 1 +#define DEBUG_COMMAND_REGISTER 2 +#define DEBUG_COMMAND_INVALID 255 + +/* debug state */ +#define DEBUG_STATE_NULL 0 +#define DEBUG_STATE_RECEIVE 1 +#define DEBUG_STATE_INVALID 255 + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/* Structure for debug port */ +typedef struct { + unsigned type : 6; /* 0: invalid, 1: print, 2: debug */ + unsigned length : 2; /* 1, 2, or 3 */ + char buf[3]; /* character buffer */ +} rdbPacket; + +extern unsigned int __osRdbWriteOK; +extern unsigned int __osRdbSendMessage; + +#endif /* _LANGUAGE_C */ + +#endif /* !_RDB_H */ diff --git a/include/2.0L/PR/region.h b/include/2.0L/PR/region.h new file mode 100644 index 00000000..0ac8a253 --- /dev/null +++ b/include/2.0L/PR/region.h @@ -0,0 +1,123 @@ + +/************************************************************************** + * * + * Copyright (C) 1994, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * Module: region.h + * + * $Revision: 1.8 $ + * $Date: 1997/11/26 00:30:56 $ + * $Author: mitu $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/region.h,v $ + * + * Description: + * This file contains macros and structure definitions for the region + * library. + * + **************************************************************************/ + + +#ifndef _REGION_H_ +#define _REGION_H_ + + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + + +/*************************************** + * + * Global defines + * + */ + /* Alignment sizes */ +#define ALIGNSZ (sizeof(long long)) /* 8 bytes */ +#define ALIGNOFFST (ALIGNSZ-1) + + /* size for storing index to free buffer */ +#define BUF_CTRL_SIZE ALIGNSZ + + /* Max bufcount = 32K */ +#define MAX_BUFCOUNT 0x8000 + /* code for last free buffer */ +#define BUF_FREE_WO_NEXT 0x8000 + +/* + * Global defines for alignment size (default is 8-byte alignment) + */ +#define OS_RG_ALIGN_2B 2 /* 2 bytes = 16-bit alignment */ +#define OS_RG_ALIGN_4B 4 /* 4 bytes = 32-bit alignment */ +#define OS_RG_ALIGN_8B 8 /* 8 bytes = 64-bit alignment */ +#define OS_RG_ALIGN_16B 16 /* 16 bytes = 128-bit alignment */ + +#define OS_RG_ALIGN_DEFAULT OS_RG_ALIGN_8B + + +/*************************************** + * + * Macro definitions + * + */ + +/* Perform alignment on input 's' */ +#define ALIGN(s, align) (((u32)(s) + ((align)-1)) & ~((align)-1)) + + +/*************************************** + * + * Typedefs & structure definitions + * + */ +/* + * Structure for region header/control area + */ +typedef struct _Region_s { + u8 *r_startBufferAddress; /* start address to data buffer */ + u8 *r_endAddress; /* end address of region */ + s32 r_bufferSize; /* size of buffers for this region */ + s32 r_bufferCount; /* up to 32K entries; MSB is used for + setting end-of-list/used */ + u16 r_freeList; /* point to array index of first + available memory buffer */ + u16 r_alignSize; /* alignment size (# of bytes) */ +} OSRegion; + +/* + * Macro to simplify accessing region header structure + */ +#define RP(x) rp->r_##x + + +/*************************************** + * + * Function prototypes + * + */ +extern void *osCreateRegion(void *, u32, u32, u32); +extern void *osMalloc(void *); +extern void osFree(void *, void *); +extern s32 osGetRegionBufCount(void *); +extern s32 osGetRegionBufSize(void *); + + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + + +#endif /* _REGION_H_ */ + + diff --git a/include/2.0L/PR/rmon.h b/include/2.0L/PR/rmon.h new file mode 100644 index 00000000..199e5699 --- /dev/null +++ b/include/2.0L/PR/rmon.h @@ -0,0 +1,39 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * $Revision: 1.6 $ + * $Date: 1997/02/11 08:30:08 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/rmon.h,v $ + * + **************************************************************************/ + +#ifndef _RMON_H_ +#define _RMON_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#define RMON_DBG_BUF_SIZE 2048 +#define RMON_STACKSIZE 0x1000 + +extern void rmonMain( void * ); +extern void rmonPrintf( const char *, ... ); + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_OS_H */ diff --git a/include/2.0L/PR/sched.h b/include/2.0L/PR/sched.h new file mode 100644 index 00000000..2d305a2e --- /dev/null +++ b/include/2.0L/PR/sched.h @@ -0,0 +1,115 @@ +/*==================================================================== + * sched.h + * + * Synopsis: + * + * Copyright 1993, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/************************************************************************** + * + * $Revision: 1.7 $ + * $Date: 1997/02/11 08:32:02 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/sched.h,v $ + * + **************************************************************************/ + +#ifndef __sched__ +#define __sched__ + +#include + +#define OS_SC_STACKSIZE 0x2000 + +#define OS_SC_RETRACE_MSG 1 +#define OS_SC_DONE_MSG 2 +#define OS_SC_RDP_DONE_MSG 3 +#define OS_SC_PRE_NMI_MSG 4 +#define OS_SC_LAST_MSG 4 /* this should have highest number */ +#define OS_SC_MAX_MESGS 8 + +typedef struct { + short type; + char misc[30]; +} OSScMsg; + +typedef struct OSScTask_s { + struct OSScTask_s *next; /* note: this must be first */ + u32 state; + u32 flags; + void *framebuffer; /* used by graphics tasks */ + + OSTask list; + OSMesgQueue *msgQ; + OSMesg msg; +#ifndef _FINALROM /* all #ifdef items should */ + OSTime startTime; /* remain at the end!!, or */ + OSTime totalTime; /* possible conflict if */ +#endif /* FINALROM library used with */ +} OSScTask; /* non FINALROM code */ + +/* + * OSScTask flags: + */ +#define OS_SC_NEEDS_RDP 0x0001 /* uses the RDP */ +#define OS_SC_NEEDS_RSP 0x0002 /* uses the RSP */ +#define OS_SC_DRAM_DLIST 0x0004 /* SP & DP communicate through DRAM */ +#define OS_SC_PARALLEL_TASK 0x0010 /* must be first gfx task on list */ +#define OS_SC_LAST_TASK 0x0020 /* last task in queue for frame */ +#define OS_SC_SWAPBUFFER 0x0040 /* swapbuffers when gfx task done */ + +#define OS_SC_RCP_MASK 0x0003 /* mask for needs bits */ +#define OS_SC_TYPE_MASK 0x0007 /* complete type mask */ +/* + * OSScClient: + * + * Data structure used by threads that wish to communicate to the + * scheduling thread + * + */ +typedef struct SCClient_s { + struct SCClient_s *next; /* next client in the list */ + OSMesgQueue *msgQ; /* where to send the frame msg */ +} OSScClient; + +typedef struct { + OSScMsg retraceMsg; + OSScMsg prenmiMsg; + OSMesgQueue interruptQ; + OSMesg intBuf[OS_SC_MAX_MESGS]; + OSMesgQueue cmdQ; + OSMesg cmdMsgBuf[OS_SC_MAX_MESGS]; + OSThread thread; + OSScClient *clientList; + OSScTask *audioListHead; + OSScTask *gfxListHead; + OSScTask *audioListTail; + OSScTask *gfxListTail; + OSScTask *curRSPTask; + OSScTask *curRDPTask; + u32 frameCount; + s32 doAudio; +} OSSched; + +void osCreateScheduler(OSSched *s, void *stack, OSPri priority, + u8 mode, u8 numFields); +void osScAddClient(OSSched *s, OSScClient *c, OSMesgQueue *msgQ); +void osScRemoveClient(OSSched *s, OSScClient *c); +OSMesgQueue *osScGetCmdQ(OSSched *s); + +#endif + diff --git a/include/2.0L/PR/sp.h b/include/2.0L/PR/sp.h new file mode 100644 index 00000000..8167ca23 --- /dev/null +++ b/include/2.0L/PR/sp.h @@ -0,0 +1,196 @@ +/************************************************************************** + * * + * Copyright (C) 1994, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * Sprite library include file + * + * $Revision: 1.16 $ + * $Date: 1998/04/17 05:03:46 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/sp.h,v $ + * + **************************************************************************/ + +#ifndef _SP_H_ +#define _SP_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include +#include + +struct bitmap { + s16 width; /* Size across to draw in texels */ + /* Done if width = 0 */ + + s16 width_img; /* Size across of bitmap in texels */ + /* Done if width = 0 */ + + s16 s; /* Horizontal offset into bitmap */ + /* if (s > width), then load only! */ + + s16 t; /* Vertical offset into base */ + + void *buf; /* Pointer to bitmap data */ + /* Don't re-load if new buf */ + /* is the same as the old one */ + /* Skip if NULL */ + + s16 actualHeight; /* True Height of this bitmap piece */ + + s16 LUToffset; /* LUT base index */ +}; + +typedef struct bitmap Bitmap; + +struct sprite { + s16 x,y; /* Target position */ + + s16 width, height; /* Target size */ + + f32 scalex, scaley; /* Texel to Pixel scale factor */ + + s16 expx, expy; /* Explosion spacing */ + + u16 attr; /* Attribute Flags */ + s16 zdepth; /* Z Depth */ + + u8 red; /* Red component */ + u8 green; /* Green component */ + u8 blue; /* Blue component */ + u8 alpha; /* Alpha component */ + + s16 startTLUT; /* Lookup Table Entry Starting index */ + s16 nTLUT; /* Total number of Lookup Table Entries */ + + int *LUT; /* Pointer to Lookup Table */ + + s16 istart; /* Starting bitmap index */ + s16 istep; /* Bitmaps index step (see SP_INCY) */ + /* if 0, then variable width bitmaps */ + + s16 nbitmaps; /* Total number of bitmaps */ + s16 ndisplist; /* Total number of display-list words */ + + s16 bmheight; /* Bitmap Texel height (Used) */ + s16 bmHreal; /* Bitmap Texel height (Real) */ + u8 bmfmt; /* Bitmap Format */ + u8 bmsiz; /* Bitmap Texel Size */ + + Bitmap *bitmap; /* Pointer to first bitmap */ + + Gfx *rsp_dl; /* Pointer to RSP display list */ + + Gfx *rsp_dl_next; /* Pointer to next RSP display entry */ + + s16 frac_s, /* Fractional Texture offsets */ + frac_t; /* These have 5 fraction bits */ +}; + +typedef struct sprite Sprite; + +/* + * DANGER! + * This is bad programming. Where the *heck* do these numbers come + * from? + * + * They are obviously 'maximums' from the sprite library, but since + * the sprite library is built on top of gbi.h, which includes macros + * that decode into multiple macros, etc., it is nearly impossible to + * know what these maximums should be. + * + * Worse, there are some gbi macros (texture alignment mostly) that + * decode into *many* macros, so if we choose that as a maximum, we + * are wasting TONS of space... + * + * These numbers work for "reasonable" sprite library usage, and + * there is an assert() in the library to detect when they aren't + * enough. (use the debug version) + */ +#define DL_BM_OVERHEAD (12) +#define DL_SPRITE_OVERHEAD (24) + +#define NUM_DL(nb) ((nb)*DL_BM_OVERHEAD +DL_SPRITE_OVERHEAD) + +/* + * Misc constants + */ + +#ifndef NULL +#define NULL 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +/* + * For sprite->attr + */ + +#define SP_TRANSPARENT 0x00000001 +#define SP_CUTOUT 0x00000002 +#define SP_HIDDEN 0x00000004 +#define SP_Z 0x00000008 +#define SP_SCALE 0x00000010 +#define SP_FASTCOPY 0x00000020 +#define SP_OVERLAP 0x00000040 +#define SP_TEXSHIFT 0x00000080 +#define SP_FRACPOS 0x00000100 +#define SP_TEXSHUF 0x00000200 +#define SP_EXTERN 0x00000400 + +/* + * Function wrapper + */ +#if defined(F3DEX_GBI_2) +#define spMove spX2Move +#define spSetZ spX2SetZ +#define spScissor spX2Scissor +#define spDraw spX2Draw +#define spInit spX2Init +#define spFinish spX2Finish +#elif defined(F3DEX_GBI) +#define spMove spXMove +#define spSetZ spXSetZ +#define spScissor spXScissor +#define spDraw spXDraw +#define spInit spXInit +#define spFinish spXFinish +#endif + +/* + * Function prototypes + */ + +void spSetAttribute (Sprite *sp, s32 attr); +void spClearAttribute (Sprite *sp, s32 attr); +void spMove (Sprite *sp, s32 x, s32 y); +void spScale (Sprite *sp, f32 sx, f32 sy); +void spSetZ (Sprite *sp, s32 z ); +void spColor (Sprite *sp, u8 red, u8 green, u8 blue, u8 alpha); +Gfx *spDraw (Sprite *sp); +void spInit( Gfx **glistp ); +void spScissor( s32 xmin, s32 xmax, s32 ymin, s32 ymax ); +void spFinish( Gfx **glistp ); + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* _SP_H_ */ diff --git a/include/2.0L/PR/sptask.h b/include/2.0L/PR/sptask.h new file mode 100644 index 00000000..960cab9b --- /dev/null +++ b/include/2.0L/PR/sptask.h @@ -0,0 +1,201 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * $Revision: 1.9 $ + * $Date: 1998/03/05 06:40:29 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/sptask.h,v $ + * + **************************************************************************/ + +#ifndef _SPTASK_H_ +#define _SPTASK_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Type definitions + * + */ + +/* + * Task List Structure. + * + * Things an app might pass to the SP via the task list. + * Not every task ucode would need/use every field, but + * + * - type (audio, gfx, video, ...) + * - flags + * - wait for DP to drain before running new task + * - SEE BIT DEFINITIONS UNDER "Task Flags field" + * - pointer to boot ucode + * - size of boot ucode + * - pointer to ucode + * - size of ucode + * - pointer to initial DMEM data + * - size of initial DMEM data + * - pointer to DRAM stack + * - size of DRAM stack (max) + * - pointer to output buffer + * - pointer to store output buffer length + * - generic data pointer (for display list, etc.) + * - generic data length (for display list, etc.) + * - pointer to buffer where to store saved DMEM (in yield case) + * - size of buffer to store saved DMEM. + * + * IMPORTANT!!! Watch alignment issues. + * + * IMPORTANT!!! Watch data cache issues. The RCP may write data into the + * dram_stack, output_buff, output_buff_size, and the yield_data_ptr areas. + * These buffers should be cache aligned and use the entire line (16 bytes) to + * avoid corruption by writebacks by the CPU (cache tearing). + * + * IMPORTANT!!! all addresses are virtual addresses. Library does + * any necessary translation. + * + */ +typedef struct { + u32 type; + u32 flags; + + u64 *ucode_boot; + u32 ucode_boot_size; + + u64 *ucode; + u32 ucode_size; + + u64 *ucode_data; + u32 ucode_data_size; + + u64 *dram_stack; + u32 dram_stack_size; + + u64 *output_buff; + u64 *output_buff_size; + + u64 *data_ptr; + u32 data_size; + + u64 *yield_data_ptr; + u32 yield_data_size; + +} OSTask_t; + +typedef union { + OSTask_t t; + long long int force_structure_alignment; +} OSTask; + +typedef u32 OSYieldResult; + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_ASSEMBLY + +/* + * For the RSP ucode: + * offsets into the task structure + */ + +#include + +#endif + +/* + * Task Flags field + */ +#define OS_TASK_YIELDED 0x0001 +#define OS_TASK_DP_WAIT 0x0002 +#define OS_TASK_LOADABLE 0x0004 +#define OS_TASK_SP_ONLY 0x0008 +#define OS_TASK_USR0 0x0010 +#define OS_TASK_USR1 0x0020 +#define OS_TASK_USR2 0x0040 +#define OS_TASK_USR3 0x0080 + +/* + * Size of Yield buffer. The taskHdrPtr->t.yield_data_ptr must point to a + * buffer of this size. (The size is in bytes). ONLY If the task will NEVER + * yield it may be a null pointer. The buffer must be aligned to a 64 bit + * boundary. The taskHdrPtr->t.yield_data_ptr must be set to point to the + * buffer BEFORE the task is started. + */ +#if (defined(F3DEX_GBI)||defined(F3DLP_GBI)||defined(F3DEX_GBI_2)) +#define OS_YIELD_DATA_SIZE 0xc00 +#else +#define OS_YIELD_DATA_SIZE 0x900 +#endif +#define OS_YIELD_AUDIO_SIZE 0x400 + +/************************************************************************** + * + * Global definitions + * + */ + + + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + +/* + * this macro simulates atomic action. + */ +#define osSpTaskStart(tp) \ + { \ + osSpTaskLoad((tp)); \ + osSpTaskStartGo((tp)); \ + } + + +/************************************************************************** + * + * Extern variables + * + */ + + +/************************************************************************** + * + * Function prototypes + * + */ + +/* + * break this up into two steps for debugging. + */ +extern void osSpTaskLoad(OSTask *tp); +extern void osSpTaskStartGo(OSTask *tp); + +extern void osSpTaskYield(void); +extern OSYieldResult osSpTaskYielded(OSTask *tp); + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_SPTASK_H */ diff --git a/include/2.0L/PR/ucode.h b/include/2.0L/PR/ucode.h new file mode 100644 index 00000000..e43f52ae --- /dev/null +++ b/include/2.0L/PR/ucode.h @@ -0,0 +1,192 @@ +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +/************************************************************************** + * + * $Revision: 1.15 $ + * $Date: 1998/03/31 07:58:57 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/ucode.h,v $ + * + **************************************************************************/ + +#ifndef _UCODE_H_ +#define _UCODE_H_ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +/************************************************************************** + * + * Macro definitions + * + */ + +/* + * This is the recommended size of the SP DRAM stack area, used + * by the graphics ucode. This stack is used primarily for the + * matrix stack, so it needs to be AT LEAST (10 * 64bytes) in size. + */ +#define SP_DRAM_STACK_SIZE8 (1024) +#define SP_DRAM_STACK_SIZE64 (SP_DRAM_STACK_SIZE8 >> 3) + +/* + * This is the size of the IMEM, which is also the size of the + * graphics microcode. (other ucode might be less) + * This value is used in apps to tell the OS how much ucode to + * load. + */ +#define SP_UCODE_SIZE 4096 + +/* + * This is 1/2 the size of DMEM, which is the maximum amount of + * initialized DMEM data any of the ucode tasks need to start up. + * This value is dependent on all of the task ucodes, and is therefore + * fixed per release. + */ +#define SP_UCODE_DATA_SIZE 2048 + + +/************************************************************************** + * + * Extern variables + * + */ + +/* + * Symbols generated by "rsp2elf", included by "makerom" that indicate + * the location and size of the SP microcode objects. The ucode objects + * are loaded as part of the codesegment (arbitrary, could do other + * ways) + * + */ + +/* standard boot ucode: */ +extern long long int rspbootTextStart[], rspbootTextEnd[]; + +/* standard 3D ucode: */ +extern long long int gspFast3DTextStart[], gspFast3DTextEnd[]; +extern long long int gspFast3DDataStart[], gspFast3DDataEnd[]; + +/* 3D ucode with output to DRAM: */ +extern long long int gspFast3D_dramTextStart[], gspFast3D_dramTextEnd[]; +extern long long int gspFast3D_dramDataStart[], gspFast3D_dramDataEnd[]; + +/* 3D ucode with output through DRAM FIFO to RDP: */ +extern long long int gspFast3D_fifoTextStart[], gspFast3D_fifoTextEnd[]; +extern long long int gspFast3D_fifoDataStart[], gspFast3D_fifoDataEnd[]; + +/* 3D ucode without nearclip: */ +extern long long int gspF3DNoNTextStart[], gspF3DNoNTextEnd[]; +extern long long int gspF3DNoNDataStart[], gspF3DNoNDataEnd[]; + +/* 3D ucode without nearclip with output to DRAM: */ +extern long long int gspF3DNoN_dramTextStart[]; +extern long long int gspF3DNoN_dramTextEnd[]; +extern long long int gspF3DNoN_dramDataStart[]; +extern long long int gspF3DNoN_dramDataEnd[]; + +/* 3D ucode without nearclip with output through DRAM FIFO to RDP: */ +extern long long int gspF3DNoN_fifoTextStart[]; +extern long long int gspF3DNoN_fifoTextEnd[]; +extern long long int gspF3DNoN_fifoDataStart[]; +extern long long int gspF3DNoN_fifoDataEnd[]; + +/* 3D line ucode: */ +extern long long int gspLine3DTextStart[], gspLine3DTextEnd[]; +extern long long int gspLine3DDataStart[], gspLine3DDataEnd[]; + +/* 3D line ucode with output to DRAM: */ +extern long long int gspLine3D_dramTextStart[], gspLine3D_dramTextEnd[]; +extern long long int gspLine3D_dramDataStart[], gspLine3D_dramDataEnd[]; + +/* 3D line ucode with output through DRAM FIFO to RDP: */ +extern long long int gspLine3D_fifoTextStart[], gspLine3D_fifoTextEnd[]; +extern long long int gspLine3D_fifoDataStart[], gspLine3D_fifoDataEnd[]; + +/* 2D sprite ucode: */ +extern long long int gspSprite2DTextStart[], gspSprite2DTextEnd[]; +extern long long int gspSprite2DDataStart[], gspSprite2DDataEnd[]; + +/* 2D sprite ucode with output to DRAM: */ +extern long long int gspSprite2D_dramTextStart[], gspSprite2D_dramTextEnd[]; +extern long long int gspSprite2D_dramDataStart[], gspSprite2D_dramDataEnd[]; + +/* 2D sprite ucode with output through DRAM FIFO to RDP: */ +extern long long int gspSprite2D_fifoTextStart[], gspSprite2D_fifoTextEnd[]; +extern long long int gspSprite2D_fifoDataStart[], gspSprite2D_fifoDataEnd[]; + +/* basic audio ucode: */ +extern long long int aspMainTextStart[], aspMainTextEnd[]; +extern long long int aspMainDataStart[], aspMainDataEnd[]; + +/*========== F3DEX/F3DLX/F3DLP/L3DEX ==========*/ +/* FIFO version only */ +extern long long int gspF3DEX_fifoTextStart[], gspF3DEX_fifoTextEnd[]; +extern long long int gspF3DEX_fifoDataStart[], gspF3DEX_fifoDataEnd[]; +extern long long int gspF3DEX_NoN_fifoTextStart[], gspF3DEX_NoN_fifoTextEnd[]; +extern long long int gspF3DEX_NoN_fifoDataStart[], gspF3DEX_NoN_fifoDataEnd[]; + +extern long long int gspF3DLX_fifoTextStart[], gspF3DLX_fifoTextEnd[]; +extern long long int gspF3DLX_fifoDataStart[], gspF3DLX_fifoDataEnd[]; +extern long long int gspF3DLX_NoN_fifoTextStart[], gspF3DLX_NoN_fifoTextEnd[]; +extern long long int gspF3DLX_NoN_fifoDataStart[], gspF3DLX_NoN_fifoDataEnd[]; +extern long long int gspF3DLX_Rej_fifoTextStart[], gspF3DLX_Rej_fifoTextEnd[]; +extern long long int gspF3DLX_Rej_fifoDataStart[], gspF3DLX_Rej_fifoDataEnd[]; + +extern long long int gspF3DLP_Rej_fifoTextStart[], gspF3DLP_Rej_fifoTextEnd[]; +extern long long int gspF3DLP_Rej_fifoDataStart[], gspF3DLP_Rej_fifoDataEnd[]; +extern long long int gspL3DEX_fifoTextStart[], gspL3DEX_fifoTextEnd[]; +extern long long int gspL3DEX_fifoDataStart[], gspL3DEX_fifoDataEnd[]; + +/*========== F3DEX2/F3DLX2/F3DLP2/L3DEX2 ==========*/ +/* FIFO version */ +extern long long int gspF3DEX2_fifoTextStart[], gspF3DEX2_fifoTextEnd[]; +extern long long int gspF3DEX2_fifoDataStart[], gspF3DEX2_fifoDataEnd[]; +extern long long int gspF3DEX2_NoN_fifoTextStart[],gspF3DEX2_NoN_fifoTextEnd[]; +extern long long int gspF3DEX2_NoN_fifoDataStart[],gspF3DEX2_NoN_fifoDataEnd[]; +extern long long int gspF3DEX2_Rej_fifoTextStart[],gspF3DEX2_Rej_fifoTextEnd[]; +extern long long int gspF3DEX2_Rej_fifoDataStart[],gspF3DEX2_Rej_fifoDataEnd[]; +extern long long int gspF3DLX2_Rej_fifoTextStart[],gspF3DLX2_Rej_fifoTextEnd[]; +extern long long int gspF3DLX2_Rej_fifoDataStart[],gspF3DLX2_Rej_fifoDataEnd[]; +extern long long int gspL3DEX2_fifoTextStart[], gspL3DEX2_fifoTextEnd[]; +extern long long int gspL3DEX2_fifoDataStart[], gspL3DEX2_fifoDataEnd[]; + +/* XBUS version */ +extern long long int gspF3DEX2_xbusTextStart[], gspF3DEX2_xbusTextEnd[]; +extern long long int gspF3DEX2_xbusDataStart[], gspF3DEX2_xbusDataEnd[]; +extern long long int gspF3DEX2_NoN_xbusTextStart[],gspF3DEX2_NoN_xbusTextEnd[]; +extern long long int gspF3DEX2_NoN_xbusDataStart[],gspF3DEX2_NoN_xbusDataEnd[]; +extern long long int gspF3DEX2_Rej_xbusTextStart[],gspF3DEX2_Rej_xbusTextEnd[]; +extern long long int gspF3DEX2_Rej_xbusDataStart[],gspF3DEX2_Rej_xbusDataEnd[]; +extern long long int gspF3DLX2_Rej_xbusTextStart[],gspF3DLX2_Rej_xbusTextEnd[]; +extern long long int gspF3DLX2_Rej_xbusDataStart[],gspF3DLX2_Rej_xbusDataEnd[]; +extern long long int gspL3DEX2_xbusTextStart[], gspL3DEX2_xbusTextEnd[]; +extern long long int gspL3DEX2_xbusDataStart[], gspL3DEX2_xbusDataEnd[]; + +/************************************************************************** + * + * Function prototypes + * + */ + +#endif /* _LANGUAGE_C */ + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* !_UCODE_H */ diff --git a/include/2.0L/PR/ucode_debug.h b/include/2.0L/PR/ucode_debug.h new file mode 100644 index 00000000..189a7f21 --- /dev/null +++ b/include/2.0L/PR/ucode_debug.h @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------* + Copyright (C) 1998, Nintendo. + + File ucode_debug.h + Coded by Yoshitaka Yasumoto. Nov 15, 1998. + + $Id: ucode_debug.h,v 1.1 1998/12/25 01:06:21 has Exp $ + *---------------------------------------------------------------------*/ +#ifndef _UCODE_DEBUG_H_ +#define _UCODE_DEBUG_H_ + +#define DEBUG_DL_PTR() IO_READ(SP_DMEM_START+0xfc0) + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) +/*========== F3DEX2/F3DLX2/L3DEX2/S2DEX2 ==========*/ +/* FIFO version */ +extern long long int gspF3DEX2d_fifoTextStart[], gspF3DEX2d_fifoTextEnd[]; +extern long long int gspF3DEX2d_fifoDataStart[], gspF3DEX2d_fifoDataEnd[]; +extern long long int gspF3DEX2d_NoN_fifoTextStart[],gspF3DEX2d_NoN_fifoTextEnd[]; +extern long long int gspF3DEX2d_NoN_fifoDataStart[],gspF3DEX2d_NoN_fifoDataEnd[]; +extern long long int gspF3DEX2d_Rej_fifoTextStart[],gspF3DEX2d_Rej_fifoTextEnd[]; +extern long long int gspF3DEX2d_Rej_fifoDataStart[],gspF3DEX2d_Rej_fifoDataEnd[]; +extern long long int gspF3DLX2d_Rej_fifoTextStart[],gspF3DLX2d_Rej_fifoTextEnd[]; +extern long long int gspF3DLX2d_Rej_fifoDataStart[],gspF3DLX2d_Rej_fifoDataEnd[]; +extern long long int gspL3DEX2d_fifoTextStart[], gspL3DEX2d_fifoTextEnd[]; +extern long long int gspL3DEX2d_fifoDataStart[], gspL3DEX2d_fifoDataEnd[]; +extern long long int gspS2DEX2d_fifoTextStart[], gspS2DEX2d_fifoTextEnd[]; +extern long long int gspS2DEX2d_fifoDataStart[], gspS2DEX2d_fifoDataEnd[]; + +/* XBUS version */ +extern long long int gspF3DEX2d_xbusTextStart[], gspF3DEX2d_xbusTextEnd[]; +extern long long int gspF3DEX2d_xbusDataStart[], gspF3DEX2d_xbusDataEnd[]; +extern long long int gspF3DEX2d_NoN_xbusTextStart[],gspF3DEX2d_NoN_xbusTextEnd[]; +extern long long int gspF3DEX2d_NoN_xbusDataStart[],gspF3DEX2d_NoN_xbusDataEnd[]; +extern long long int gspF3DEX2d_Rej_xbusTextStart[],gspF3DEX2d_Rej_xbusTextEnd[]; +extern long long int gspF3DEX2d_Rej_xbusDataStart[],gspF3DEX2d_Rej_xbusDataEnd[]; +extern long long int gspF3DLX2d_Rej_xbusTextStart[],gspF3DLX2d_Rej_xbusTextEnd[]; +extern long long int gspF3DLX2d_Rej_xbusDataStart[],gspF3DLX2d_Rej_xbusDataEnd[]; +extern long long int gspL3DEX2d_xbusTextStart[], gspL3DEX2d_xbusTextEnd[]; +extern long long int gspL3DEX2d_xbusDataStart[], gspL3DEX2d_xbusDataEnd[]; +extern long long int gspS2DEX2d_xbusTextStart[], gspS2DEX2d_xbusTextEnd[]; +extern long long int gspS2DEX2d_xbusDataStart[], gspS2DEX2d_xbusDataEnd[]; + +#endif /* _LANGUAGE_C */ +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif +#endif /* !_UCODE_DEBUG_H */ + +/*======== End of ucode_debug.h ========*/ diff --git a/include/2.0L/PR/ultraerror.h b/include/2.0L/PR/ultraerror.h new file mode 100644 index 00000000..b05b24a6 --- /dev/null +++ b/include/2.0L/PR/ultraerror.h @@ -0,0 +1,179 @@ +/*==================================================================== + * ultraerror.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/************************************************************************** + * + * $Revision: 1.27 $ + * $Date: 1999/07/14 02:44:00 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/ultraerror.h,v $ + * + **************************************************************************/ + +#ifndef __ULTRAERROR_H__ +#define __ULTRAERROR_H__ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#define OS_ERROR_FMT "/usr/lib/PR/error.fmt" +#define OS_ERROR_MAGIC 0x6b617479 + +/* OS error codes */ + +#define ERR_OSCREATETHREAD_SP 1 +#define ERR_OSCREATETHREAD_PRI 2 +#define ERR_OSSTARTTHREAD 3 +#define ERR_OSSETTHREADPRI 4 +#define ERR_OSCREATEMESGQUEUE 5 +#define ERR_OSSENDMESG 6 +#define ERR_OSJAMMESG 7 +#define ERR_OSRECVMESG 8 +#define ERR_OSSETEVENTMESG 9 +#define ERR_OSMAPTLB_INDEX 10 +#define ERR_OSMAPTLB_ASID 11 +#define ERR_OSUNMAPTLB 12 +#define ERR_OSSETTLBASID 13 +#define ERR_OSAISETFREQUENCY 14 +#define ERR_OSAISETNEXTBUFFER_ADDR 15 +#define ERR_OSAISETNEXTBUFFER_SIZE 16 +#define ERR_OSDPSETNEXTBUFFER_ADDR 17 +#define ERR_OSDPSETNEXTBUFFER_SIZE 18 +#define ERR_OSPIRAWREADIO 19 +#define ERR_OSPIRAWWRITEIO 20 +#define ERR_OSPIRAWSTARTDMA_DIR 21 +#define ERR_OSPIRAWSTARTDMA_DEVADDR 22 +#define ERR_OSPIRAWSTARTDMA_ADDR 23 +#define ERR_OSPIRAWSTARTDMA_SIZE 24 +#define ERR_OSPIRAWSTARTDMA_RANGE 25 +#define ERR_OSPIREADIO 26 +#define ERR_OSPIWRITEIO 27 +#define ERR_OSPISTARTDMA_PIMGR 28 +#define ERR_OSPISTARTDMA_PRI 29 +#define ERR_OSPISTARTDMA_DIR 30 +#define ERR_OSPISTARTDMA_DEVADDR 31 +#define ERR_OSPISTARTDMA_ADDR 32 +#define ERR_OSPISTARTDMA_SIZE 33 +#define ERR_OSPISTARTDMA_RANGE 34 +#define ERR_OSCREATEPIMANAGER 35 +#define ERR_OSVIGETCURRENTMODE 36 +#define ERR_OSVIGETCURRENTFRAMEBUFFER 37 +#define ERR_OSVIGETNEXTFRAMEBUFFER 38 +#define ERR_OSVISETXSCALE_VALUE 39 +#define ERR_OSVISETXSCALE_VIMGR 40 +#define ERR_OSVISETYSCALE_VALUE 41 +#define ERR_OSVISETYSCALE_VIMGR 42 +#define ERR_OSVISETSPECIAL_VALUE 43 +#define ERR_OSVISETSPECIAL_VIMGR 44 +#define ERR_OSVISETMODE 45 +#define ERR_OSVISETEVENT 46 +#define ERR_OSVISWAPBUFFER_ADDR 47 +#define ERR_OSVISWAPBUFFER_VIMGR 48 +#define ERR_OSCREATEVIMANAGER 49 +#define ERR_OSCREATEREGION_ALIGN 50 +#define ERR_OSCREATEREGION_SIZE 51 +#define ERR_OSMALLOC 52 +#define ERR_OSFREE_REGION 53 +#define ERR_OSFREE_ADDR 54 +#define ERR_OSGETREGIONBUFCOUNT 55 +#define ERR_OSGETREGIONBUFSIZE 56 +#define ERR_OSSPTASKLOAD_DRAM 57 +#define ERR_OSSPTASKLOAD_OUT 58 +#define ERR_OSSPTASKLOAD_OUTSIZE 59 +#define ERR_OSSPTASKLOAD_YIELD 60 +#define ERR_OSPROFILEINIT_STR 61 +#define ERR_OSPROFILEINIT_CNT 62 +#define ERR_OSPROFILEINIT_ALN 63 +#define ERR_OSPROFILEINIT_ORD 64 +#define ERR_OSPROFILEINIT_SIZ 65 +#define ERR_OSPROFILESTART_TIME 66 +#define ERR_OSPROFILESTART_FLAG 67 +#define ERR_OSPROFILESTOP_FLAG 68 +#define ERR_OSPROFILESTOP_TIMER 69 +#define ERR_OSREADHOST_ADDR 70 +#define ERR_OSREADHOST_SIZE 71 +#define ERR_OSWRITEHOST_ADDR 72 +#define ERR_OSWRITEHOST_SIZE 73 +#define ERR_OSGETTIME 74 +#define ERR_OSSETTIME 75 +#define ERR_OSSETTIMER 76 +#define ERR_OSSTOPTIMER 77 +#define ERR_ALSEQP_NO_SOUND 100 +#define ERR_ALSEQP_NO_VOICE 101 +#define ERR_ALSEQP_MAP_VOICE 102 +#define ERR_ALSEQP_OFF_VOICE 103 +#define ERR_ALSEQP_POLY_VOICE 104 +#define ERR_ALSNDP_NO_VOICE 105 +#define ERR_ALSYN_NO_UPDATE 106 +#define ERR_ALSNDPDEALLOCATE 107 +#define ERR_ALSNDPDELETE 108 +#define ERR_ALSNDPPLAY 109 +#define ERR_ALSNDPSETSOUND 110 +#define ERR_ALSNDPSETPRIORITY 111 +#define ERR_ALSNDPSETPAR 112 +#define ERR_ALBNKFNEW 113 +#define ERR_ALSEQNOTMIDI 114 +#define ERR_ALSEQNOTMIDI0 115 +#define ERR_ALSEQNUMTRACKS 116 +#define ERR_ALSEQTIME 117 +#define ERR_ALSEQTRACKHDR 118 +#define ERR_ALSEQSYSEX 119 +#define ERR_ALSEQMETA 120 +#define ERR_ALSEQPINVALIDPROG 121 +#define ERR_ALSEQPUNKNOWNMIDI 122 +#define ERR_ALSEQPUNMAP 123 +#define ERR_ALEVENTNOFREE 124 +#define ERR_ALHEAPNOFREE 125 +#define ERR_ALHEAPCORRUPT 126 +#define ERR_ALHEAPFIRSTBLOCK 127 +#define ERR_ALCSEQZEROSTATUS 128 +#define ERR_ALCSEQZEROVEL 129 +#define ERR_ALCSPVNOTFREE 130 +#define ERR_ALSEQOVERRUN 131 +#define ERR_OSAISETNEXTBUFFER_ENDADDR 132 +#define ERR_ALMODDELAYOVERFLOW 133 +#define ERR_OSVIEXTENDVSTART_VIMGR 134 +#define ERR_OSVIEXTENDVSTART_VALUE 135 +#define ERR_OSTHPROFILESTART_FLAG 136 +#define ERR_OSTHPROFILESTART_START 137 +#define ERR_OSTHPROFILESTOP_FLAG 138 +#define ERR_OSTHPROFILEREADCOUNT_FLAG 139 +#define ERR_OSTHPROFILEREADTIME_FLAG 140 +#define ERR_OSTHPROFILEREADCOUNTTH_FLAG 141 +#define ERR_OSTHPROFILEREADTIMETH_FLAG 142 +#define ERR_OSTHPROFILEREADCOUNT_LAR 143 +#define ERR_OSTHPROFILEREADTIME_LAR 144 +#define ERR_OSTHPROFILEREADCOUNTTH_LAR 145 +#define ERR_OSTHPROFILEREADTIMETH_LAR 146 +#define ERR_OSTHPROFILESTOP_LAR 147 + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) +typedef void (*OSErrorHandler)(s16, s16, ...); + +OSErrorHandler osSetErrorHandler(OSErrorHandler); +#endif + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif /* __ULTRAERROR_H__ */ diff --git a/include/2.0L/PR/ultralog.h b/include/2.0L/PR/ultralog.h new file mode 100644 index 00000000..48b84b97 --- /dev/null +++ b/include/2.0L/PR/ultralog.h @@ -0,0 +1,74 @@ +/*==================================================================== + * ultralog.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/************************************************************************** + * + * $Revision: 1.6 $ + * $Date: 1997/02/11 08:39:05 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/ultralog.h,v $ + * + **************************************************************************/ + +#ifndef __log__ +#define __log__ + +#ifdef _LANGUAGE_C_PLUS_PLUS +extern "C" { +#endif + +#include + +#define OS_LOG_MAX_ARGS 16 +#define OS_LOG_MAGIC 0x20736a73 +#define OS_LOG_FLOAT(x) (*(int *) &(x)) +#define OS_LOG_VERSION 1 + +typedef struct { + u32 magic; /* log identifier */ + u32 len; /* length of log data + log structure */ + u32 *base; /* starting addr array */ + s32 startCount; /* read offset from dataBase */ + s32 writeOffset; /* write offset from dataBase */ +} OSLog; + +typedef struct { + u32 magic; + u32 timeStamp; + u16 argCount; + u16 eventID; +} OSLogItem; + +typedef struct { + u32 magic; /* log identifier */ + u32 version; /* 1 */ +} OSLogFileHdr; + +void osCreateLog(OSLog *log, u32 *base, s32 len); +void osLogEvent(OSLog *log, s16 code, s16 numArgs, ...); +void osFlushLog(OSLog *log); +u32 osLogFloat(f32); + +extern void osDelay(int count); + +#ifdef _LANGUAGE_C_PLUS_PLUS +} +#endif + +#endif diff --git a/include/2.0L/PR/ultratypes.h b/include/2.0L/PR/ultratypes.h new file mode 100644 index 00000000..ff7305ec --- /dev/null +++ b/include/2.0L/PR/ultratypes.h @@ -0,0 +1,90 @@ +#ifndef _ULTRATYPES_H_ +#define _ULTRATYPES_H_ + + +/************************************************************************** + * * + * Copyright (C) 1995, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + + +/************************************************************************* + * + * File: ultratypes.h + * + * This file contains various types used in Ultra64 interfaces. + * + * $Revision: 1.6 $ + * $Date: 1997/12/17 04:02:06 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/ultratypes.h,v $ + * + **************************************************************************/ + + + +/********************************************************************** + * General data types for R4300 + */ +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + +typedef unsigned char u8; /* unsigned 8-bit */ +typedef unsigned short u16; /* unsigned 16-bit */ +typedef unsigned long u32; /* unsigned 32-bit */ +typedef unsigned long long u64; /* unsigned 64-bit */ + +typedef signed char s8; /* signed 8-bit */ +typedef short s16; /* signed 16-bit */ +typedef long s32; /* signed 32-bit */ +typedef long long s64; /* signed 64-bit */ + +typedef volatile unsigned char vu8; /* unsigned 8-bit */ +typedef volatile unsigned short vu16; /* unsigned 16-bit */ +typedef volatile unsigned long vu32; /* unsigned 32-bit */ +typedef volatile unsigned long long vu64; /* unsigned 64-bit */ + +typedef volatile signed char vs8; /* signed 8-bit */ +typedef volatile short vs16; /* signed 16-bit */ +typedef volatile long vs32; /* signed 32-bit */ +typedef volatile long long vs64; /* signed 64-bit */ + +typedef float f32; /* single prec floating point */ +typedef double f64; /* double prec floating point */ + +#if !defined(_SIZE_T) && !defined(_SIZE_T_) && !defined(_SIZE_T_DEF) +#define _SIZE_T +#define _SIZE_T_DEF /* exeGCC size_t define label */ +#if (_MIPS_SZLONG == 32) +typedef unsigned int size_t; +#endif +#if (_MIPS_SZLONG == 64) +typedef unsigned long size_t; +#endif +#endif + +#endif /* _LANGUAGE_C */ + + +/************************************************************************* + * Common definitions + */ +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef NULL +#define NULL 0 +#endif + +#endif /* _ULTRATYPES_H_ */ + diff --git a/include/2.0L/PR/uportals.h b/include/2.0L/PR/uportals.h new file mode 100644 index 00000000..129c47ce --- /dev/null +++ b/include/2.0L/PR/uportals.h @@ -0,0 +1,134 @@ +/*==================================================================== + * uportals.h + * + * Copyright 1995, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +/************************************************************************** + * + * uportals.h - header file for the ultraportals library + * + * $Revision: 1.12 $ + * $Date: 1997/02/11 08:40:49 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/uportals.h,v $ + * + **************************************************************************/ + + + +#ifndef __ULTRAPORTALS_H__ +#define __ULTRAPORTALS_H__ + +#include +#include "matrix.h" +#include "vector.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef ENABLEPORTALS +#define ENABLEPORTALS +#endif + +#define UP_MAXPVERTS 16 /* max number of portal verts */ +#define UP_MAXCELLS 50 /* max number of cells */ +#define UP_CELLNL 32 /* max length of cell names */ +#define UP_OBNL 32 /* max length of obejct names */ + +typedef struct +{ + vec3 min, max; /* min and max pts of the box */ +} upBox; + +typedef struct _upPortalData * _portalptr; +typedef struct _upCellData * _cellptr; +typedef struct _upObjectData * _objectptr; + +typedef struct _upPortalData +{ + int numverts; /* number of verts in the portal*/ + _cellptr attached_cell; /* cell on the 'other side' */ + vec3 verts[UP_MAXPVERTS]; /* the actual vertices */ +#ifdef MVTVIEW + int mvt_id; /* if has mvt, this is the id */ +#endif +} upPortalData; + +typedef struct _upCellData +{ + int numportals; /* number of portals */ + int numobjects; /* number of objects */ + int rendered; /* last frame number rendered */ + _portalptr *portals; /* array for the actual portals */ + _objectptr *objects; /* array for 'detail' objects */ + upBox bbox; /* bounding box of the cell */ + Gfx *dlist; /* associated display list */ + char name[UP_CELLNL]; /* name of the cell */ + float eyeheight; /* height to constrain eyept to */ + int zone; /* current zone number */ +} upCellData; + +typedef struct _upObjectData +{ + int rendered; /* last frame number rendered */ + upBox bbox; /* bounding box for the object */ + Gfx *dlist; /* associated display list */ + char name[UP_OBNL]; /* name of the object */ +} upObjectData; + +typedef struct +{ + int numcells; /* how many cells are there? */ + upCellData cells[UP_MAXCELLS]; /* the actual cells */ + Gfx *rootdlist; /* display list for all cells */ + vec2 portalmin, portalmax; /* XY bbox used by upCheckCells */ + float near, far; /* near, far clipping planes */ + FMatrix viewmat; /* viewing matrix (world->eye) */ + FMatrix projmat; /* proj matrix (eye->screen) */ + FMatrix compmat; /* view * proj (world->screen) */ + int portaldepth; /* depth of the portal stack */ + int framecount; /* current frame number */ +} upLocateData; + +/* + * Functions: + */ +extern void upInit(); /* generated automatically by flt2walk */ +extern Gfx *upAddVisibleCells(Gfx * glistp, vec3 eyept); +extern void upTogglePortalBounds(); +extern void upToggleScissorBox(); + +/* + * Globals: + */ +extern upLocateData upLocator; /* also extern by test_portals.h */ + +/* + * Macros: + */ +#define UP_HUGEVAL 3.40282347e+37 +#define PT_IN_BOX(p,box) ((p)[0] > (box).min[0] && (p)[0] < (box).max[0] &&\ + (p)[1] > (box).min[1] && (p)[1] < (box).max[1] &&\ + (p)[2] > (box).min[2] && (p)[2] < (box).max[2]) + + +#ifdef __Cplusplus +} +#endif + +#endif diff --git a/include/2.0L/assert.h b/include/2.0L/assert.h new file mode 100644 index 00000000..5f92bf37 --- /dev/null +++ b/include/2.0L/assert.h @@ -0,0 +1,54 @@ +#ifndef __ASSERT_H__ +#define __ASSERT_H__ +#ifdef __cplusplus +extern "C" { +#endif +/************************************************************************** + * * + * Copyright (C) 1984, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ +/* Copyright (c) 1984 AT&T */ +/* All Rights Reserved */ + +/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */ +/* The copyright notice above does not evidence any */ +/* actual or intended publication of such source code. */ + +#ident "$Revision: 1.17 $" + +/* ANSI C Notes: + * + * - THE IDENTIFIERS APPEARING OUTSIDE OF #ifdef __EXTENSIONS__ IN THIS + * standard header ARE SPECIFIED BY ANSI! CONFORMANCE WILL BE ALTERED + * IF ANY NEW IDENTIFIERS ARE ADDED TO THIS AREA UNLESS THEY ARE IN ANSI's + * RESERVED NAMESPACE. (i.e., unless they are prefixed by __[a-z] or + * _[A-Z]. For external objects, identifiers with the prefix _[a-z] + * are also reserved.) + */ + +#ifdef NDEBUG +#undef assert +#define assert(EX) ((void)0) + +#else + +extern void func_8033F000(const char *, const char *, int); +#ifdef __ANSI_CPP__ +#define assert(EX) ((EX)?((void)0):func_8033F000( # EX , __FILE__, __LINE__)) +#else +#define assert(EX) ((EX)?((void)0):func_8033F000("EX", __FILE__, __LINE__)) +#endif +#endif /* NDEBUG */ + +#ifdef __cplusplus +} +#endif + +#endif /* !__ASSERT_H__ */ diff --git a/include/2.0L/ultra64.h b/include/2.0L/ultra64.h new file mode 100644 index 00000000..053db38e --- /dev/null +++ b/include/2.0L/ultra64.h @@ -0,0 +1,40 @@ + +/************************************************************************** + * * + * Copyright (C) 1994, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + *************************************************************************/ + +/************************************************************************** + * + * $Revision: 1.10 $ + * $Date: 1997/02/11 08:37:33 $ + * $Source: /exdisk2/cvs/N64OS/Master/cvsmdev2/PR/include/ultra64.h,v $ + * + **************************************************************************/ + +#ifndef _ULTRA64_H_ +#define _ULTRA64_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/include/SnS.h b/include/SnS.h new file mode 100644 index 00000000..dcac6456 --- /dev/null +++ b/include/SnS.h @@ -0,0 +1,137 @@ +#ifndef __SNS_H__ +#define __SNS_H__ +#include + +/** + * sns sets + */ +// Flag set used when collecting an already-unlocked Stop 'n' Swop item in-game +#define SNS_COLLECTED (0) +// Flag set used when making a Stop 'n' Swop item visible and collectable in-game +#define SNS_UNLOCKED (1) + +/** + * sns mode (read FROM other game, or write TO other game) + */ +#define SNS_MODE_READ (0) +#define SNS_MODE_WRITE (1) + +/** + * sns item keys + */ +#define SNS_ITEM_COLLECTED_EggYellow (0x100) +#define SNS_ITEM_COLLECTED_EggRed (0x101) +#define SNS_ITEM_COLLECTED_EggGreen (0x102) +#define SNS_ITEM_COLLECTED_EggBlue (0x103) +#define SNS_ITEM_COLLECTED_EggPink (0x104) +#define SNS_ITEM_COLLECTED_EggCyan (0x105) +#define SNS_ITEM_COLLECTED_IceKey (0x106) +/* 0x107 unknown */ +#define SNS_ITEM_UNLOCKED_EggYellow (0x108) +#define SNS_ITEM_UNLOCKED_EggRed (0x109) +#define SNS_ITEM_UNLOCKED_EggGreen (0x10A) +#define SNS_ITEM_UNLOCKED_EggBlue (0x10B) +#define SNS_ITEM_UNLOCKED_EggPink (0x10C) +#define SNS_ITEM_UNLOCKED_EggCyan (0x10D) +#define SNS_ITEM_UNLOCKED_IceKey (0x10E) + +#define SNS_NUM_FLAGS (14) + +#define SNS_PAYLOAD_DATALEN (0x1C) +#define SNS_HEADER_MAGIC (('2B1K' << 2 | 3)) /* 0xC908C52F */ + +enum StopNSwop_Item { + SNS_ITEM_NULL, + + SNS_ITEM_EGG_YELLOW, + SNS_ITEM_EGG_RED, + SNS_ITEM_EGG_GREEN, + SNS_ITEM_EGG_BLUE, + SNS_ITEM_EGG_PINK, + SNS_ITEM_EGG_CYAN, + SNS_ITEM_ICE_KEY, + + SNS_ITEM_length +}; + +struct StopNSwop_Bitfield { + /* Flags to record that the item is UNLOCKED and can be collected */ + u32 uEggYellow : 1; + u32 uEggRed : 1; + u32 uEggGreen : 1; + u32 uEggBlue : 1; + u32 uEggPink : 1; + u32 uEggCyan : 1; + u32 uIceKey : 1; + + /* Flags to record that the item was COLLECTED */ + u32 cEggYellow : 1; + u32 cEggRed : 1; + u32 cEggGreen : 1; + u32 cEggBlue : 1; + u32 cEggPink : 1; + u32 cEggCyan : 1; + u32 cIceKey : 1; + + u32 : 18; +}; + +typedef u32 StopNSwop_Data[SNS_PAYLOAD_DATALEN]; + +struct SnsPayload { + u32 magic; + StopNSwop_Data data; + u32 pad; + u32 checksum[2]; +}; + +struct GlobalSave { + union { + struct StopNSwop_Bitfield sns; + u32 snsw; + }; + u8 UNUSED[0x18]; + u32 crc; +}; + +/** + * Global save data area. + * + * It's saved to the cartridge in a special area at + * the end of the EEPROM which is shared by all + * three in-game save slots. + * + * Only the first two bytes are ever used in the + * game, and it's for saving the Stop 'n' Swop items. + */ +extern struct GlobalSave gSaveData; + +/** + * An array of keys that were read in from a payload + * at boot. + */ +extern StopNSwop_Data snsParsedKeys; + +extern s32 snsMinKeyToParse; +extern s32 snsMaxKeyToParse; +extern s32 snsParsedCurrPos; + +extern bool snsToRestoreItems; +extern u32 snsBackedUpItems; + +// the 4 base areas that outgoing payloads are written to +extern struct SnsPayload *snsBasePayloadPtr1; +extern struct SnsPayload *snsBasePayloadPtr2; +extern struct SnsPayload *snsBasePayloadPtr3; +extern struct SnsPayload *snsBasePayloadPtr4; + +struct SnsPayload *snspayload_find_payload_in_ram (void); +struct SnsPayload *snspayload_init_new_payload (struct SnsPayload *payload); + +void sns_unlock_parsed_items (void); +void sns_stub (void); + +void snspayload_append_key_to_outgoing_payload (struct SnsPayload *payload, s32 key); +void snspayload_calc_checksum (struct SnsPayload *payload); + +#endif diff --git a/include/animation.h b/include/animation.h new file mode 100644 index 00000000..d8561538 --- /dev/null +++ b/include/animation.h @@ -0,0 +1,50 @@ +#ifndef ANIMATION_H +#define ANIMATION_H + +#include "prop.h" +s32 func_80289680(void); +enum asset_e anim_getIndex(Animation *this); +f32 anim_getTimer(Animation *this); +f32 anim_getDuration(Animation *this); +void func_802896EC(Animation *this, s32 arg1); +void anim_setTimer(Animation *this, f32 arg1); +void anim_80289790(Animation* this, void (*arg1)(s32, s32)); +void anim_80289798(Animation *this, s32 arg1); +void anim_setDuration(Animation *this, f32 arg1); + +typedef struct { + u8 pad0[40]; +}Struct_B1400; + +typedef union +{ + struct{ + u16 unk0_15: 2; + u16 unk0_13: 14; + s16 unk2; + }; +}AnimationFileData; + + +typedef struct animation_file_elem_s{ + u16 unk0_15:12; + u16 unk0_3:4; + s16 data_cnt; + AnimationFileData data[]; +}AnimationFileElement; + +typedef struct animation_file_s{ + s16 unk0; + s16 unk2; + s16 elem_cnt; + u8 pad6[2]; +} AnimationFile; + +typedef struct animation_cache_s{ + AnimationFile *unk0; + u16 unk4_15:15; + u16 unk4_0:1; + u8 pad6[2]; +}AnimationCache; + +#endif diff --git a/include/assets.h b/include/assets.h new file mode 100644 index 00000000..a762c0e1 --- /dev/null +++ b/include/assets.h @@ -0,0 +1,21 @@ +#ifndef ASSETS_H +#define ASSETS_H + +#include +#include "structs.h" + +typedef struct asset_rom_table_head_s{ + u32 count; + u32 unk4; +} AssetROMHead; + +typedef struct asset_file_meta_s{ + u32 offset; + s16 compFlag; + s16 unk6; +} AssetFileMeta; + + +extern u8 D_5E90; //rom file asset bin; + +#endif diff --git a/include/bs_funcs.h b/include/bs_funcs.h new file mode 100644 index 00000000..271ec66c --- /dev/null +++ b/include/bs_funcs.h @@ -0,0 +1,715 @@ +#ifndef __BS_FUNCS__ +#define __BS_FUNCS__ + +//interrupt +void func_802B5350(void); +void func_80296608(void); +void func_80296590(void); //bsow + +//bsstand +void bsstand_init(void); +void bsstand_update(void); +void bsstand_end(void); +//bswalkslow +void bswalk_slow_init(void); +void bswalk_slow_upate(void); +//bswalk +void bswalk_init(void); +void bswalk_update(void); +//bswalkfast +void bswalk_fast_init(void); +void bswalk_fast_update(void); +void bswalk_fast_end(void); +//bsjump +void bsjump_init(void); +void bsjump_update(void); +void bsjump_end(void); +//bspunch +int bsclaw_hitboxActive(void); +void bsclaw_init(void); +void bsclaw_update(void); +void bsclaw_end(void); +//bscrouch +void bscrouch_init(void); +void bscrouch_update(void); +void bscrouch_end(void); +//bsbtrotjump +void bsbtrot_jump_init(void); +void bsbtrot_jump_update(void); +void bsbtrot_jump_end(void); +//bsskid +void bsturn_init(void); +void bsturn_update(void); +void bsturn_end(void); +//0xd +void func_802B63F8(void); +void func_802B64D0(void); +void func_802B6500(void); +//bsow +void bsow_init(void); +void bsow_update(void); +void bsow_end(void); +//bsbuster +void bsbbuster_init(void); +void bsbbuster_update(void); +void bsbbuster_end(void); +//bsflap +void bsbflap_init(void); +void bsbflap_update(void); +void bsbflap_end(void); +//bsbpeck +void bsbpeck_init(void); +void bsbpeck_update(void); +void bsbpeck_end(void); +//bsbflip +void bsbflip_init(void); +void bsbflip_update(void); +void bsbflip_end(void); +//bsbbarge +void bsbarge_init(void); +void bsbarge_update(void); +void bsbarge_end(void); +//bsbtrot_enter +void bsbtrot_enter_init(void); +void bsbtrot_enter_update(void); +void bsbtrot_enter_end(void); +//bsbtrot_idle +void bsbtrot_stand_init(void); +void bsbtrot_stand_update(void); +void bsbtrot_stand_end(void); +//bsbtrot_walk +void bsbtrot_walk_init(void); +void bsbtrot_walk_update(void); +void bsbtrot_walk_end(void); +//bsbtrot_exit +void bsbtrot_exit_init(void); +void bsbtrot_exit_update(void); +void bsbtrot_exit_end(void); +//bsfly_knockback +void func_802A4D90(void); +void func_802A4EC8(void); +void func_802A4F44(void); +//BS_1A_WONDERWING_ENTER +void bsbwhirl_enter_init(void); +void bsbwhirl_enter_update(void); +void bsbwhirl_enter_end(void); +//BS_1B_WONDERWING_IDLE +void bsbwhirl_stand_init(void); +void bsbwhirl_stand_update(void); +void bsbwhirl_stand_end(void); +//BS_1C_WONDERWING_WALK, +void bsbwhirl_walk_init(void); +void bsbwhirl_walk_update(void); +void bsbwhirl_walk_end(void); +//BS_1D_WONDERWING_JUMP +void bsbwhirl_jump_init(void); +void bsbwhirl_jump_update(void); +void bsbwhirl_jump_end(void); +//BS_1E_WONDERWING_EXIT +void bsbwhirl_exit_init(void); +void bsbwhirl_exit_update(void); +void bsbwhirl_exit_end(void); +//BS_9_EGG_HEAD +void bsegghead_init(void); +void bsegghead_update(void); +void bsegghead_end(void); +//BS_A_EGG_ASS +void bseggass_init(void); +void bseggass_update(void); +void bseggass_end(void); +//BS_WALK_CREEP(void); +void bswalk_creep_init(void); +void bswalk_creep_update(void); +//BS_20_LANDING(void); +void bsstand_landing_init(void); +void bsstand_landing_update(void); +//BS_BSHOCK_CHARGE(void); +void bsbshock_charge_init(void); +void bsbshock_charge_update(void); +void bsbshock_charge_end(void); +//BS_BSHOCK_JUMP(void); +void bsbshock_init(void); +void bsbshock_update(void); +void bsbshock_end(void); +//BS_23_FLY_ENTER(void); +void bsbfly_enter_init(void); +void bsbfly_enter_update(void); +void bsbfly_enter_end(void); +void func_802A505C(void); +//BS_FLY(void); +void bsbfly_init(void); +void bsbfly_update(void); +void func_802A3F70(void); +//BS_25_LONGLEG_ENTER(void); +void bsblongleg_enter_init(void); +void bsblongleg_enter_update(void); +void bsblongleg_enter_end(void); +//BS_26_LONGLEG_IDLE(void); +void bsblongleg_stand_enter(void); +void bsblongleg_stand_update(void); +void bsblongleg_stand_end(void); +//BS_LONGLEG_WALK(void); +void bsblongleg_walk_init(void); +void bsblongleg_walk_update(void); +void bsblongleg_walk_end(void); +//BS_LONGLEG_JUMP(void); +void bsblongleg_jump_init(void); +void bsblongleg_jump_update(void); +void bsblongleg_jump_end(void); +//BS_LONGLEG_EXIT(void); +void bsblongleg_exit_init(void); +void bsblongleg_exit_update(void); +void bsblongleg_exit_end(void); +//BS_BOMB(void); +void func_802A3F9C(void); +void func_802A411C(void); +void func_802A4404(void); +//BS_2B_DIVE_IDLE(void); +void func_802A762C(void); +void func_802A7674(void); +void func_802A7718(void); +//BS_2C_DIVE_B(void); +void func_802A7738(void); +void func_802A7838(void); +void func_802A7A2C(void); +//BS_2D_SWIM_IDLE, +void func_802B5774(void); +void func_802B5950(void); +void func_802B5AF8(void); +//BS_2E_SWIM(void); +void func_802B5B18(void); +void func_802B5C40(void); +void func_802B5E10(void); +//BS_2F_FALL(void); +void bsjump_fall_init(void); +void bsjump_fall_update(void); +void bsjump_fall_end(void); +//BS_30_DIVE_ENTER +void func_802A7DAC(void); +void func_802A7E2C(void); +void func_802A7F4C(void); +//BS_ROLL(void); +int bstwirl_hitboxActive(void); +void bstwirl_init(void); +void bstwirl_update(void); +void bstwirl_end(void); +//BS_SLIDE +void bsslide_init(void); +void bsslide_update(void); +void bsslide_end(void); +//0x33(void); +void func_802B9ACC(void); +void func_802B9B14(void); +void func_802B9AAC(void); +void func_802B9D00(void); +//BS_34_JIG_NOTEDOOR(void); +void bsjig_notedoor_init(void); +void bsjig_notedoor_update(void); +void bsjig_notedoor_end(void); +//BS_35_ANT_IDLE +void bsant_idle_init(void); +void bsant_idle_update(void); +void bsant_idle_end(void); +//BS_ANT_WALK +void bsant_walk_init(void); +void bsant_walk_update(void); +void bsant_walk_end(void); +//BS_ANT_JUMP +void bsant_jump_init(void); +void bsant_jump_update(void); +void bsant_jump_end(void); +//BS_39_DIVE_A +void func_802A7A54(void); +void func_802A7AB0(void); +void func_802A7BA8(void); +//BS_3A_CARRY_IDLE(void); +void bscarry_idle_init(void); +void bscarry_idle_update(void); +void bscarry_idle_end(void); +void bscarry_interrupt(void); +//BS_CARRY_WALK(void); +void bscarry_walk_init(void); +void bscarry_walk_update(void); +void bscarry_walk_end(void); +//0x3C (void); +void func_802B6130(void); +void func_802B61E0(void); +void func_802B6218(void); +void func_802B6220(void); +//BS_3D_FALL_TUMBLING(void); +void bsjump_tumble_init(void); +void bsjump_tumble_update(void); +void bsjump_tumble_end(void); +//BS_38_ANT_FALL(void); +void bsant_fall_init(void); +void bsant_fall_update(void); +void bsant_fall_end(void); +//BS_3E_ANT_OW +void bsant_ow_init(void); +void bsant_ow_update(void); +void bsant_ow_end(void); + //0x3F +void func_802B1BF4(void); +void func_802B1CF8(void); +void func_802B1DA4(void); + //0x40 +void func_802B2BF0(void); +void func_802B2C58(void); +void func_802B2D50(void); + //BS_41_DIE +void bsdie_init(void); +void bsdie_update(void); +void bsdie_end(void); + //BS_42_DINGPOT +void func_802A5120(void); +void func_802A5190(void); +void func_802A51C0(void); + //BS_43_ANT_DIE +void bsant_die_init(void); +void bsant_die_update(void); +void bsant_die_end(void); +//BS_44_JIG_JIGGY +void bsjig_jiggy_init(void); +void bsjig_jiggy_update(void); +void bsjig_jiggy_end(void); +void bsjig_jiggy_interrupt(void); +//BS_45_BTROT_SLIDE +void bsbtrot_slide_init(void); +void bsbtrot_slide_update(void); +void bsbtrot_slide_end(void); +//0x46 +void func_802A2098(void); +void func_802A2130(void); +void func_802A2054(void); +//BS_48_PUMPKIN_IDLE +void func_802B2384(void); +void func_802B242C(void); +void func_802B24AC(void); +//BS_49_PUMPKIN_WALK +void func_802B24D4(void); +void func_802B2580(void); +void func_802B2610(void); +//BS_4A_PUMPKIN_JUMP +void func_802B2638(void); +void func_802B2750(void); +void func_802B2990(void); +//BS_4B_PUMPKIN_FALL +void func_802B29C0(void); +void func_802B2A5C(void); +void func_802B2BD0(void); +//BS_4C_LANDING_IN_WATER +void func_802A846C(void); +void func_802A85EC(void); +void func_802A872C(void); +//BS_4D_PUMPKIN_OW +void func_802B2FDC(void); +void func_802B2FFC(void); +void func_802B301C(void); +//BS_4E_PUMPKIN_DIE +void func_802B309C(void); +void func_802B3240(void); +void func_802B3448(void); +//BS_4F_CLIMB_IDLE +void bsclimb_idle_init(void); +void bsclimb_idle_update(void); +void bsclimb_idle_end(void); +void func_802ABD60(void); +//BS_50_CLIMB_MOVE +void bsclimb_move_init(void); +void bsclimb_move_update(void); +void bsclimb_move_end(void); +//BS_51_CLIMB_EXIT +void func_802B1928(void); +void func_802B1A54(void); +void func_802B1BCC(void); +//0x52 +void func_802B5FD0(void); +void func_802B6064(void); +void func_802B60D0(void); +void func_802B60D8(void); + //0x53 +void func_802B6270(void); +void func_802B6314(void); +void func_802B63C8(void); + + //0x55 +void bsblongleg_slide_init(void); +void bsblongleg_slide_update(void); +void bsblongleg_slide_end(void); + + //0x56 +void func_802B3868(void); +void func_802B3954(void); +void func_802B3A20(void); + + //0x57 +void func_802A4430(void); +void func_802A4548(void); +void func_802A4664(void); +void func_802A505C(void); + //0x58 +void func_802A4748(void); +void func_802A48B4(void); +void func_802A4A40(void); + + //0x59 +void func_802A4CD0(void); +void func_802A4CF0(void); +void func_802A4D10(void); +void func_802A505C(void); + //0x54 +void func_802A7F6C(void); +void func_802A8098(void); +void func_802A82D4(void); + + //0x5B +void bsthrow_init(void); +void bsthrow_update(void); +void bsthrow_end(void); +void bsthrow_interrupt(void); + //0x5E +void bscroc_idle_init(void); +void bscroc_idle_update(void); +void bscroc_idle_end(void); + + //0x5F +void bscroc_walk_init(void); +void bscroc_walk_update(void); +void bscroc_walk_end(void); + + //0x60 +void bscroc_jump_init(void); +void bscroc_jump_update(void); +void bscroc_jump_end(void); + + //0x61 +void bscroc_fall_init(void); +void bscroc_fall_update(void); +void bscroc_fall_end(void); + + //0x62 +void func_802A6394(void); +void func_802A63F0(void); +void func_802A6450(void); + //0x63 +void bscroc_ow_init(void); +void bscroc_ow_update(void); +void bscroc_ow_end(void); + + //0x64 +void bscroc_die_init(void); +void bscroc_die_update(void); +void bscroc_die_end(void); + + //0x67 +void bswalrus_idle_init(void); +void bswalrus_idle_update(void); +void bswalrus_idle_end(void); + + //0x68 +void bswalrus_walk_init(void); +void bswalrus_walk_update(void); +void bswalrus_walk_end(void); + + //0x69 +void bswalrus_jump_init(void); +void bswalrus_jump_update(void); +void bswalrus_jump_end(void); + + //0x6A +void bswalrus_fall_init(void); +void bswalrus_fall_update(void); +void bswalrus_fall_end(void); + + //0x6B +void func_802A1F6C(void); +void func_802A1FC8(void); +void func_802A2014(void); +//0x0000006C +void bswalrus_ow_init(void); +void bswalrus_ow_update(void); +void bswalrus_ow_end(void); + +//0x0000006D +void bswalrus_die_init(void); +void bswalrus_die_update(void); +void bswalrus_die_end(void); + +//0x0000006E +void bscroc_bite_init(void); +void bscroc_bite_update(void); +void bscroc_bite_end(void); + +//0x0000006F +void bscroc_eat_bad_init(void); +void bscroc_eat_bad_update(void); +void bscroc_eat_bad_end(void); + +//0x00000070 +void bscroc_eat_good_init(void); +void bscroc_eat_good_update(void); +void bscroc_eat_good_end(void); + +//0x00000071 +void bsbtrot_fall_init(void); +void bsbtrot_fall_update(void); +void bsbtrot_fall_end(void); +//0x00000072 +void bssplat_init(void); +void bssplat_update(void); +void bssplat_end(void); + +//0x00000073 +void func_802B3CEC(void); +void func_802B3D1C(void); +void func_802B3D6C(void); +//0x00000074 +void func_802B3E2C(void); +void func_802B3E64(void); +void func_802B3EF4(void); + +//0x00000075 +void func_802B3D8C(void); +void func_802B3DBC(void); +void func_802B3E0C(void); + +//0x00000076 +void func_802A4F74(void); +void func_802A4FC8(void); +void func_802A503C(void); + +//0x00000077 +void func_802B5E8C(void); +void func_802B5EFC(void); +void func_802B5F38(void); + +//0x00000078 +void func_802A83C0(void); +void func_802A8410(void); +void func_802A844C(void); + +//0x00000079 +void bsbtrot_unk79_init(void); +void bsbtrot_unk79_update(void); +void bsbtrot_unk79_end(void); + +//0x0000007A +void bswalk_mud_init(void); +void bswalk_mud_update(void); +//0x0000007B +void bsbtrot_ow_init(void); +void bsbtrot_ow_update(void); +void bsbtrot_ow_end(void); + +//0x0000007C +void bssled_init(void); +void bssled_update(void); +void bssled_end(void); +void bssled_interrupt(void); +//0x0000007D +void bswalrus_sled_init(void); +void bswalrus_sled_update(void); +void bswalrus_sled_end(void); +void func_802B98C0(void); +//0x0000007E +void bswalrus_sled_jump_init(void); +void bswalrus_sled_jump_update(void); +void bswalrus_sled_jump_end(void); +void func_802B98C0(void); +//0x0000007F +void func_802A7BD0(void); +void func_802A7CA8(void); +void func_802A7D74(void); + +//0x00000080 +void func_802B978C(void); +void func_802B9830(void); +void func_802B9880(void); + +//0x00000081 +void func_802B90D0(void); +void func_802B9130(void); +void func_802B917C(void); +void func_802B98C0(void); +//0x00000082 +void func_802B95A0(void); +void func_802B963C(void); +void func_802B976C(void); +void func_802B98C0(void); +//0x00000085 +void func_802A1080(void); +void func_802A10D4(void); +void func_802A117C(void); + +//0x00000086 +void func_802A11A4(void); +void func_802A1214(void); +void func_802A12D4(void); + +//0x00000087 +void func_802A12FC(void); +void func_802A1438(void); +void func_802A163C(void); + +//0x00000088 +void func_802A1664(void); +void func_802A170C(void); +void func_802A18C8(void); + +//0x00000089 +void func_802A1B68(void); +void func_802A1B88(void); +void func_802A1BA8(void); + +//0x0000008A +void bsbeemain_die_init(void); +void func_802A1DD8(void); +void func_802A1F2C(void); + +//0x0000008B +void func_802A0590(void); +void func_802A0630(void); +void func_802A0704(void); + +//0x0000008C +void bsbeefly_enter(void); +void bsbeefly_update(void); +void bsbeefly_end(void); + +//0x0000008D +void func_802AD56C(void); +void func_802AD5C0(void); +void func_802AD614(void); + +//0x0000008E +void func_8029F398(void); +void func_8029F3F4(void); +void func_8029F440(void); + +//0x0000008F +void func_802B34A0(void); +void func_802B34F8(void); +void func_802B353C(void); + +//0x00000091 +void func_802A4D30(void); +void func_802A4D50(void); +void func_802A4D70(void); +void func_802A505C(void); +//0x00000092 +void bsant_drone_init(void); +void bsant_drone_update(void); +void bsant_drone_end(void); +void bsdrone_interrupt(void); +//0x00000093 +void bspumpkin_drone_init(void); +void bspumpkin_drone_update(void); +void bspumpkin_drone_end(void); +void bsdrone_interrupt(void); +//0x00000094 +void bscroc_drone_init(void); +void bscroc_drone_update(void); +void bscroc_drone_end(void); +void bsdrone_interrupt(void); +//0x00000095 +void bswalrus_drone_init(void); +void bswalrus_drone_update(void); +void bswalrus_drone_end(void); +void bsdrone_interrupt(void); +//0x00000096 +void func_802B5F58(void); +void func_802B5F80(void); +void func_802B5FA0(void); +void bsdrone_interrupt(void); +//0x00000097 +void func_802A874C(void); +void func_802A8774(void); +void func_802A8794(void); +void bsdrone_interrupt(void); +//0x00000098 +void bswalk_drone_init(void); +void bswalk_drone_update(void); +void bswalk_drone_end(void); +void bsdrone_interrupt(void); +//0x00000099 +void func_802A50B0(void); +void func_802A50D8(void); +void func_802A50F8(void); +void bsdrone_interrupt(void); +//0x0000009A +void bsbtrot_drone_init(void); +void bsbtrot_drone_update(void); +void bsbtrot_drone_end(void); +void bsdrone_interrupt(void); +//0x0000009B +void bsblongleg_drone_init(void); +void bsblongleg_drone_update(void); +void bsblongleg_drone_end(void); +void bsdrone_interrupt(void); +//0x0000009C +void bswalrus_sled_drone_init(void); +void bswalrus_sled_drone_update(void); +void bswalrus_sled_drone_end(void); +void bsdrone_interrupt(void); +//0x0000009D +void bsbee_drone_init(void); +void bsbee_drone_update(void); +void bsbee_drone_end(void); +void bsdrone_interrupt(void); +//0x0000009E +void func_802ABCCC(void); +void func_802ABD0C(void); +void func_802ABD40(void); +void func_802ABD60(void); +//0x0000009F +void bsant_bounce_init(void); +void bsant_bounce_update(void); +void bsant_bounce_end(void); + +//0x000000A0 +void func_802B303C(void); +void func_802B305C(void); +void func_802B307C(void); + +//0x000000A1 +void bscroc_bounce_init(void); +void bscroc_bounce_update(void); +void bscroc_bounce_end(void); + +//0x000000A2 +void bswalrus_bounce_init(void); +void bswalrus_bounce_update(void); +void bswalrus_bounce_end(void); + +//0x000000A3 +void func_802A1BC8(void); +void func_802A1BE8(void); +void func_802A1C08(void); + +//0x000000A4 +void bsbwhirl_drone_init(void); +void bsbwhirl_drone_update(void); +void bsbwhirl_drone_end(void); + +//0x000000A5 +void func_802AADBC(void); +void func_802AAE08(void); +void func_802AAE4C(void); + +void func_802AEDE8(void); +void func_802AEE48(void); +void func_802AEE9C(void); +void func_802AEEF4(void); +void func_802AEFB0(void); +void func_802AF164(void); +void bsdronexform_init(void); +void bsdronexform_update(void); +void bsdronexform_end(void); +void bsdronexform_interrupt(void); +void func_802AE9C8(void); +void func_802AEA2C(void); +void func_802AEB24(void); +void func_802AF604(void); +void func_802AF668(void); +void func_802AF768(void); +#endif diff --git a/include/bsint.h b/include/bsint.h new file mode 100644 index 00000000..3257bab6 --- /dev/null +++ b/include/bsint.h @@ -0,0 +1,31 @@ +#ifndef __BS_INT_H__ +#define __BS_INT_H__ + +#include +#include "functions.h" +#include "variables.h" + +typedef void (*bsStateMethod)(void); + +typedef struct bs_state_s{ + bsStateMethod init_func; + bsStateMethod update_func; + bsStateMethod end_func; + bsStateMethod interrupt_func; +} bsState; + +typedef struct bs_map_s{ + s32 uid; + bsState behavior; +} bsMap; + +void bsList_clearAll(void); +void bsList_setInitMethod(enum bs_e i, bsStateMethod func); +void bsList_setUpdateMethod(s32 i, bsStateMethod func); +void bsList_setEndMethod(s32 i, bsStateMethod func); +void bsList_setInterruptMethod(s32 i, bsStateMethod func); +bsStateMethod bsList_getInitMethod(s32 i); +bsStateMethod bsList_getUpdateMethod(s32 i); +bsStateMethod bsList_getEndMethod(s32 i); +bsStateMethod bsList_getInterruptMethod(s32 i); +#endif diff --git a/include/core1/core1.h b/include/core1/core1.h new file mode 100644 index 00000000..82b04394 --- /dev/null +++ b/include/core1/core1.h @@ -0,0 +1,11 @@ +#ifndef __CORE_1_H__ +#define __CORE_1_H__ + +#include "core1/mem.h" + +void func_8025235C(f32[3], f32[3]); +void func_80252C08(f32[3], f32[3], f32, f32[3]); + +void func_80252C08(f32 arg0[3], f32 arg1[3], f32 scale, f32 arg3[3]); + +#endif diff --git a/include/core1/mem.h b/include/core1/mem.h new file mode 100644 index 00000000..069133a4 --- /dev/null +++ b/include/core1/mem.h @@ -0,0 +1,6 @@ +#ifndef __MEM_H__ +#define __MEM_H__ + +void memcpy(void * dst, void *src, int size); +void func_80254630(void * dst, void *src, int size); //memcopy_fast +#endif diff --git a/include/core1/rarezip.h b/include/core1/rarezip.h new file mode 100644 index 00000000..2c472403 --- /dev/null +++ b/include/core1/rarezip.h @@ -0,0 +1,87 @@ +#ifndef RAREZIP_H +#define RAREZIP_H +#include + + +extern u8 D_80275670[]; +//border[]= { /* Order of the bit length code lengths */ + //16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; +extern u16 D_80275684[]; +// static ush cplens[] = { /* Copy lengths for literal codes 257..285 */ +// 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, +// 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; +// /* note: see note #13 above about the 258 in this list. */ + +extern u8 D_802756C4[]; +// static ush cplext[] = { /* Extra bits for literal codes 257..285 */ +// 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, +// 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99}; /* 99==invalid */ + +extern u16 D_802756E4[]; +// static ush cpdist[] = { /* Copy offsets for distance codes 0..29 */ +// 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, +// 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, +// 8193, 12289, 16385, 24577}; + +extern u8 D_80275720[]; +// static ush cpdext[] = { /* Extra bits for distance codes */ +// 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, +// 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, +// 12, 12, 13, 13}; + +extern u16 D_80275740[]; +/*ush mask_bits[] = { + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff +};*/ + +extern s32 D_80275764; //lbits +extern s32 D_80275768; //dbits + +extern struct huft *D_8027BF00; +extern u8 *D_8027BF10; //inbuf +extern u8 *D_8027BF14; //slide +extern u32 D_8027BF18; //inptr +extern u32 D_8027BF1C; //wp +extern struct huft *D_8027BF20; //unk +extern u32 D_8027BF24; //bb +extern u32 D_8027BF28; //bk +extern u32 D_8027BF2C; //crc1 +extern u32 D_8027BF30; //crc2 +extern u32 D_8027BF34; //hufts + + +#ifndef WSIZE +# define WSIZE 0x8000 /* window size--must be a power of two, and */ +#endif /* at least 32K for zip's deflate method */ + +//#define get_byte() (D_8027BF18 < insize ? inbuf[D_8027BF18++] : fill_inbuf(0)) +#define get_byte() (D_8027BF10[D_8027BF18++]) + +#ifdef CRYPT + uch cc; +# define NEXTBYTE() \ + (decrypt ? (cc = get_byte(), zdecode(cc), cc) : get_byte()) +#else +# define NEXTBYTE() (u8)get_byte() +#endif +#define NEEDBITS(n) {while(k<(n)){b|=((u32)NEXTBYTE())<>=(n);k-=(n);} + +struct huft { + u8 e; /* number of extra bits or operation */ + u8 b; /* number of bits in this code or subcode */ + union { + u16 n; /* literal, length base, or distance base */ + struct huft *t; /* pointer to next level of table */ + } v; +}; + +/* If BMAX needs to be larger than 16, then h and x[] should be ulg. */ +#define BMAX 16 /* maximum bit length of any code (16 for explode) */ +#define N_MAX 288 /* maximum number of codes in any set */ + +int bkboot_inflate(void); + +#endif diff --git a/include/core2/animctrl.h b/include/core2/animctrl.h new file mode 100644 index 00000000..8dede6e6 --- /dev/null +++ b/include/core2/animctrl.h @@ -0,0 +1,93 @@ +#ifndef __ANIM_CTRL_H__ +#define __ANIM_CTRL_H__ + +#include + +#ifndef NONMATCHING +#define func_802875AC(this, file, line) _func_802875AC(this, file, line) +#else +#define func_802875AC(this, file, line) _func_802875AC(this, __FILE__, __LINE__) +#endif + +enum animctrl_playback_e{ + ANIMCTRL_ONCE = 1, + ANIMCTRL_LOOP = 2, + ANIMCTRL_STOPPED = 3, + ANIMCTRL_SUBRANGE_LOOP = 4 +}; + + +typedef struct animation_s{ + void (* matrices)(s32, s32); + s32 unk4; + u8 unk8; + u8 unk9; + s16 unkA[3]; + u32 index; + f32 timer; + f32 duration; + u8 unk1C; + u8 unk1D; + u8 unk1E; + u8 unk1F; +} Animation; + +typedef struct animctrl_s{ + Animation *animation; + f32 timer; + f32 subrange_start; + f32 subrange_end; + f32 animation_duration; + f32 transition_duration; + float unk18; + s32 index; + u8 playback_type; + u8 playback_direction; + u8 smooth_transition; + u8 unk23; + u8 unk24; + u8 unk25; + u8 pad26[2]; +} AnimCtrl; + +typedef struct actorAnimCtrl_s{ + AnimCtrl animctrl; + Animation animation; +} ActorAnimCtrl; + +AnimCtrl *animctrl_new(s32 arg0); +void animctrl_free(AnimCtrl * this); +void animctrl_update(AnimCtrl *this); +AnimCtrl *animctrl_defrag(AnimCtrl *this); +void animctrl_setIndex(AnimCtrl *this, enum asset_e index); +Animation *animctrl_getAnimPtr(AnimCtrl *this); +void func_8028746C(AnimCtrl *this, void (* arg1)(s32,s32)); +void func_8028748C(AnimCtrl *this, s32 arg1); +void animctrl_reset(AnimCtrl *this); +void func_8028752C(AnimCtrl *this); +void _func_802875AC(AnimCtrl * this, char *file, s32 line); +void animctrl_setAnimTimer(AnimCtrl *this, f32 timer); +void animctrl_setPlaybackType(AnimCtrl *this, enum animctrl_playback_e arg1); +void animctrl_setDirection(AnimCtrl *this, s32 arg1); +void animctrl_setSmoothTransition(AnimCtrl *this, s32 arg1); +void animctrl_setDuration(AnimCtrl *this, f32 arg1); +void animctrl_setTransitionDuration(AnimCtrl *this, f32 arg1); +void animctrl_setSubRange(AnimCtrl *this, f32 start, f32 end); +void animctrl_getSubRange(AnimCtrl *this, f32 *startPtr, f32 *endPtr); +void func_8028774C(AnimCtrl *this, f32 arg1); +void func_80287784(AnimCtrl *this, s32 arg1); +enum asset_e animctrl_getIndex(AnimCtrl *this); +enum animctrl_playback_e animctrl_getPlaybackType(AnimCtrl *this); +s32 animctrl_isPlayedForwards(AnimCtrl *this); +s32 animctrl_isSmoothTransistion(AnimCtrl *this); +f32 animctrl_getDuration(AnimCtrl *this); +f32 animctrl_getTransistionDuration(AnimCtrl *this); +f32 animctrl_getAnimTimer(AnimCtrl *this); +f32 animctrl_getTimer(AnimCtrl *this); +void animctrl_setTimer(AnimCtrl *this, f32 arg1); +s32 animctrl_8028780C(AnimCtrl *this, s32 arg1); +s32 func_8028781C(AnimCtrl *this, f32 *arg1, s32 arg2); +s32 animctrl_isStopped(AnimCtrl *this); +int animctrl_isAt(AnimCtrl *this, f32 arg1); +s32 animctrl_isContiguous(AnimCtrl *this); +#endif diff --git a/include/core2/code_6DA30.h b/include/core2/code_6DA30.h new file mode 100644 index 00000000..90ca7837 --- /dev/null +++ b/include/core2/code_6DA30.h @@ -0,0 +1,10 @@ +#ifndef __CORE2_6DA30__ +#define __CORE2_6DA30__ + + void print_bold_overlapping(s32 x, s32 y, f32 arg2, u8* string); + void print_bold_spaced(s32 x, s32 y, u8* string); + void print_dialog(s32 x, s32 y, u8* string); + void print_dialog_w_bg(s32 x, s32 y, u8* string); + void print_dialog_gradient(s32 x, s32 y, u8* string, u8 arg3, u8 arg4); + void func_802F79D0(s32 x, s32 y, u8* string, s32 arg3, s32 arg4); +#endif diff --git a/include/core2/code_C9E70.h b/include/core2/code_C9E70.h new file mode 100644 index 00000000..480ac104 --- /dev/null +++ b/include/core2/code_C9E70.h @@ -0,0 +1,84 @@ +#ifndef __CORE2_C9E70_H__ +#define __CORE2_C9E70_H__ + +#include +#include "structs.h" + +typedef struct { + s16 unk0[4]; + u8 unk8; //FF_TileType + u8 unk9; + s16 unkA; + u8 unkC[3]; + // u8 padF[0x1]; + f32 unk10; + u8 pad14[0xC]; +}Struct_lair_5ED0_0; + +struct FF_StorageStruct_48_sub { + f32 unk0[3]; + + f32 unkC; + f32 UNK_10; + + u32 unk14[3]; + + u8 unk20; + u8 UNK_21; + u8 UNK_22; + u8 UNK_23; +}; // 0x24 + +// FF: pointer at 0x48 in the generic storage struct +struct FF_StorageStruct_48 { + /** + * Judging by how this var is referenced throughout the + * code, I thought may instead be four standalone vars + * of the same type, instead of in an array. + * + * But near the end of the file (e.g. in func_8038E968), + * they're indexed by $a0, so it must be an array... + */ + struct FF_StorageStruct_48_sub data[4]; +}; // 0x90 + + + +// FF: generic storage struct +struct FF_StorageStruct { + /* 00 */ BKModel *unk0; + /* 04 */ Struct_lair_5ED0_0 *unk4; + /* 08 */ s16 unk8; + /* 0A */ u8 currFfMode; + /* 0B */ u8 ffQuestionType; + /* 0C */ u8 unkC; + /* 0D */ u8 unkD; //question_indx + /* 0E */ s8 unkE; + /* 0F */ s8 unkF; + + /* 10 */ u8 unk10; + /* 11 */ u8 unk11; + /* 12 */ u8 unk12; + // u8 pad13[1]; + + /* 14 */ f32 unk14; + + /* 18 */ u8 UNK_18; + /* 19 */ u8 UNK_19; + /* 1A */ u8 UNK_1A; + /* 1B */ u8 UNK_1B; + + // holds moves involved with the FFM glitch + /* 1C */ u32 unlockedMoves; + /* 20 */ gczoombox_t *unk20; + /* 24 */ f32 playerPosition[3]; + /* 30 */ f32 playerRotation[3]; + + /* 3C */ s16 unk3C[5]; + + /* 46 */ u8 UNK_46; + /* 47 */ u8 UNK_47; + + /* 48 */ struct FF_StorageStruct_48 *unk48; +}; // 0x4C +#endif diff --git a/include/core2/core2.h b/include/core2/core2.h new file mode 100644 index 00000000..0c401741 --- /dev/null +++ b/include/core2/core2.h @@ -0,0 +1,15 @@ +#ifndef __CORE_2_H__ +#define __CORE_2_H__ + +#include "core2/timedfunc.h" +#include "gc/gc.h" +#include "core2/code_6DA30.h" +#include "core2/animctrl.h" + +void func_80351A04(Struct68s *arg0, s32 arg1); +void func_80351A14(Struct68s *arg0, Struct68DrawMethod arg1); +void func_8035179C(Struct68s* arg0, f32 arg1[3]); +void func_80351814(Struct68s *arg0, f32 arg1[3]); +f32 func_80351830(Struct68s *arg0); + +#endif diff --git a/include/core2/timedfunc.h b/include/core2/timedfunc.h new file mode 100644 index 00000000..c475bff6 --- /dev/null +++ b/include/core2/timedfunc.h @@ -0,0 +1,25 @@ +#ifndef __TIMED_FUNC_H__ +#define __TIMED_FUNC_H__ +#include + +typedef void (* TFQM0)(void); +typedef void (* TFQM1)(s32); +typedef void (* TFQM2)(s32, s32); +typedef void (* TFQM3)(s32, s32, s32); +typedef void (* TFQM4)(s32, s32, s32, s32); +typedef void (* TFQM5)(s32, s32, s32, s32, s32); +typedef void (* TFQM6)(void *); + +#define reinterpret_cast(type, var) (*((type *)&var)) + + +void timedFunc_set_0(f32 time, TFQM0 funcPtr); +void timedFunc_set_1(f32 time, TFQM1 funcPtr, s32 arg0); +void timedFunc_set_2(f32 time, TFQM2 funcPtr, s32 arg0, s32 arg1); +void timedFunc_set_3(f32 time, TFQM3 funcPtr, s32 arg0, s32 arg1, s32 arg2); +void timedFunc_set_4(f32 time, TFQM4 funcPtr, s32 arg0, s32 arg1, s32 arg2, s32 arg3); +void timedFunc_set_5(f32 time, TFQM5 funcPtr, s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4); +void timedFunc_set_6(f32 time, TFQM6 funcPtr, void* argPtr ); +void timedJiggySpawn(f32 time, s32 jiggyId, f32 *position); + +#endif diff --git a/include/cseq.h b/include/cseq.h new file mode 100755 index 00000000..0342398f --- /dev/null +++ b/include/cseq.h @@ -0,0 +1,11 @@ + + + +#ifndef __cseq__ +#define __cseq__ + + +char __alCSeqNextDelta(ALCSeq *seq, s32 *pDeltaTicks); + + +#endif /* __cseq__ */ diff --git a/include/cseqp.h b/include/cseqp.h new file mode 100755 index 00000000..bb72541d --- /dev/null +++ b/include/cseqp.h @@ -0,0 +1,10 @@ + + +#ifndef __cseqp__ +#define __cseqp__ + + +void __CSPPostNextSeqEvent(ALCSPlayer *seqp); + + +#endif /* __cseqp__ */ diff --git a/include/enums.h b/include/enums.h new file mode 100644 index 00000000..34be74bb --- /dev/null +++ b/include/enums.h @@ -0,0 +1,2851 @@ +#ifndef ENUMS_H +#define ENUMS_H + +#define SPRITE_TYPE_CI4 (1 << 0) +#define SPRITE_TYPE_CI8 (1 << 2) +#define SPRITE_TYPE_I4 (1 << 5) +#define SPRITE_TYPE_I8 (1 << 6) +#define SPRITE_TYPE_IA4 (1 << 7) +#define SPRITE_TYPE_IA8 (1 << 8) +#define SPRITE_TYPE_RGBA16 (1 << 10) +#define SPRITE_TYPE_RGBA32 (1 << 11) + +enum bkprog_e{ + + // BKPROG_03_ "1st Note Text"}, -- 0x00 > 3 + // BKPROG_04_ "1st Mumbo Token Text"}, -- 0x00 > 4 + // BKPROG_05_ "1st Egg Text"}, -- 0x00 > 5 + // BKPROG_06_ "1st Red Feather Text"}, -- 0x00 > 6 + // BKPROG_07_ "1st Gold Feather Text"}, -- 0x00 > 7 + // BKPROG_08_ "1st Gold Bullion Text"}, -- 0x01 > 1 (flipped, but only for this byte, no idea why) + // BKPROG_09_ "1st Orange Text"}, -- 0x01 > 0 (flipped, but only for this byte, no idea why) + // BKPROG_0A_ "1st Honeycomb Text"}, -- 0x01 > 2 + // BKPROG_0B_ "1st Empty Honeycomb Text"}, -- 0x01 > 3 + // BKPROG_0C_ "1st Extra Life Text"}, + // BKPROG_0D_ "1st Beehive Text"}, + BKPROG_D_BEEHIVE_TEXT = 0xD, + BKPROG_E_JINJO_TEXT, + BKPROG_F_HAS_TOUCHED_PIRAHANA_WATER, + BKPROG_10_HAS_TOUCHED_SAND_EEL_SAND, + BKPROG_11_HAS_MET_MUMBO, + BKPROG_12_HAS_TRANSFORMED_BEFORE, + BKPROG_13, //something with xmas tree jiggy progress + BKPROG_14_HAS_TOUCHED_FP_ICY_WATER, + BKPROG_15_ENTER_MMM_TEXT, + // {index=0x16, type="Prog", level=6, name="1st Time in Jigsaw Text"}, + // {index=0x17, type="Prog", level=6, name="1st Time Enough Pieces Jigsaw Text"}, + BKPROG_18_MM_WITCH_SWITCH_JIGGY_SPAWNED = 0x18, + BKPROG_19_MMM_WITCH_SWITCH_JIGGY_SPAWNED, + BKPROG_1A_TTC_WITCH_SWITCH_JIGGY_SPAWNED, + BKPROG_1B_CC_WITCH_SWITCH_JIGGY_SPAWNED, + BKPROG_1C_RBB_WITCH_SWITCH_JIGGY_SPAWNED, + BKPROG_1D_MMM_DINNING_ROOM_CUTSCENE, + // {index=0x1E, type="Prog", level=6, name="Grate to BGS Puzzle Open"}, + BKPROG_1F_CC_LOBBY_PIPE_1_RAISED = 0x1F, + BKPROG_20_CC_LOBBY_PIPE_2_RAISED, + BKPROG_21_CC_LOBBY_PIPE_3_RAISED, + BKPROG_22_WATER_SWITCH_1_PRESSED, + BKPROG_23_LAIR_WATER_LEVEL_1, + BKPROG_24_WATER_SWITCH_2_PRESSED, + BKPROG_25_LAIR_WATER_LEVEL_2 = 0x25, + BKPROG_26_WATER_SWITCH_3_PRESSED, + BKPROG_27_LAIR_WATER_LEVEL_3 = 0x27, + + BKPROG_31_MM_OPEN = 0x31, + BKPROG_32_TTC_OPEN, + BKPROG_33_CC_OPEN, + BKPROG_34_BGS_OPEN, + BKPROG_35_FP_OPEN, + BKPROG_36_GV_OPEN, + BKPROG_37_MMM_OPEN, + BKPROG_38_RBB_OPEN, + BKPROG_39_CCW_OPEN, + BKPROG_3A_NOTE_DOOR_50_OPEN, + BKPROG_3B_NOTE_DOOR_180_OPEN, + BKPROG_3C_NOTE_DOOR_260_OPEN, + BKPROG_3D_NOTE_DOOR_350_OPEN, + BKPROG_3E_NOTE_DOOR_450_OPEN, + BKPROG_3F_NOTE_DOOR_640_OPEN, + BKPROG_40_NOTE_DOOR_765_OPEN, + BKPROG_41_NOTE_DOOR_810_OPEN, + BKPROG_42_NOTE_DOOR_828_OPEN, + BKPROG_43_NOTE_DOOR_846_OPEN, + BKPROG_44_NOTE_DOOR_864_OPEN, + BKPROG_45_NOTE_DOOR_882_OPEN, + BKPROG_46_CCW_WITCH_SWITCH_JIGGY_SPAWNED, + + // {index=0x48, type="Prog", level=6, name="FP WS Advent Door Open"}, + // {index=0x49, type="Prog", level=6, name="Pink Cauldron 1 Active"}, + // {index=0x4A, type="Prog", level=6, name="Pink Cauldron 2 Active"}, + // {index=0x4B, type="Prog", level=6, name="Green Cauldron 1 Active"}, + // {index=0x4C, type="Prog", level=6, name="Green Cauldron 2 Active"}, + // {index=0x4D, type="Prog", level=6, name="Red Cauldron 1 Active"}, + // {index=0x4E, type="Prog", level=6, name="Red Cauldron 2 Active"}, + // -- 0x4F - Unused Cauldron Pair? + // -- 0x50 - Unused Cauldron Pair? + // {index=0x51, type="Prog", level=6, name="Yellow Cauldron 1 Active"}, + // {index=0x52, type="Prog", level=6, name="Yellow Cauldron 2 Active"}, + // {index=0x53, type="Prog", level=6, name="CCW Puzzle Podium Switch Pressed"}, + // {index=0x54, type="Prog", level=6, name="CCW Puzzle Podium Active"}, + // {index=0x55, type="Prog", level=6, name="1st FF BK Square Text"}, + // {index=0x56, type="Prog", level=6, name="1st FF Pic Square Text"}, + // {index=0x57, type="Prog", level=6, name="1st FF Music Square Text"}, + // {index=0x58, type="Prog", level=6, name="1st FF Mini-Game Square Text"}, + // {index=0x59, type="Prog", level=6, name="1st FF Grunty Square Text"}, + // {index=0x5A, type="Prog", level=6, name="1st FF Death Square Text"}, + // {index=0x5B, type="Prog", level=6, name="1st FF Joker Square Text"}, + + // {index=0x5C, type="Prog", level=6, name="??FF Pattern Set"}, + + // -- Pieces places in puzzles info + // -- TODO: Read/write these as ints? + // {index=0x5D, type="Prog", level=6, name="Puzzle: # Pieces in MM Puzzle (2^0)"}, + // {index=0x5E, type="Prog", level=6, name="Puzzle: # Pieces in TTC Puzzle (2^0)"}, + // {index=0x5F, type="Prog", level=6, name="Puzzle: # Pieces in TTC Puzzle (2^1)"}, + // {index=0x60, type="Prog", level=6, name="Puzzle: # Pieces in CC Puzzle (2^0)"}, + // {index=0x61, type="Prog", level=6, name="Puzzle: # Pieces in CC Puzzle (2^1)"}, + // {index=0x62, type="Prog", level=6, name="Puzzle: # Pieces in CC Puzzle (2^2)"}, + // {index=0x63, type="Prog", level=6, name="Puzzle: # Pieces in BGS Puzzle (2^0)"}, + // {index=0x64, type="Prog", level=6, name="Puzzle: # Pieces in BGS Puzzle (2^1)"}, + // {index=0x65, type="Prog", level=6, name="Puzzle: # Pieces in BGS Puzzle (2^2)"}, + // {index=0x66, type="Prog", level=6, name="Puzzle: # Pieces in FP Puzzle (2^0)"}, + // {index=0x67, type="Prog", level=6, name="Puzzle: # Pieces in FP Puzzle (2^1)"}, + // {index=0x68, type="Prog", level=6, name="Puzzle: # Pieces in FP Puzzle (2^2)"}, + // {index=0x69, type="Prog", level=6, name="Puzzle: # Pieces in FP Puzzle (2^3)"}, + // {index=0x6A, type="Prog", level=6, name="Puzzle: # Pieces in GV Puzzle (2^0)"}, + // {index=0x6B, type="Prog", level=6, name="Puzzle: # Pieces in GV Puzzle (2^1)"}, + // {index=0x6C, type="Prog", level=6, name="Puzzle: # Pieces in GV Puzzle (2^2)"}, + // {index=0x6D, type="Prog", level=6, name="Puzzle: # Pieces in GV Puzzle (2^3)"}, + // {index=0x6E, type="Prog", level=6, name="Puzzle: # Pieces in MMM Puzzle (2^0)"}, + // {index=0x6F, type="Prog", level=6, name="Puzzle: # Pieces in MMM Puzzle (2^1)"}, + // {index=0x70, type="Prog", level=6, name="Puzzle: # Pieces in MMM Puzzle (2^2)"}, + // {index=0x71, type="Prog", level=6, name="Puzzle: # Pieces in MMM Puzzle (2^3)"}, + // {index=0x72, type="Prog", level=6, name="Puzzle: # Pieces in RBB Puzzle (2^0)"}, + // {index=0x73, type="Prog", level=6, name="Puzzle: # Pieces in RBB Puzzle (2^1)"}, + // {index=0x74, type="Prog", level=6, name="Puzzle: # Pieces in RBB Puzzle (2^2)"}, + // {index=0x75, type="Prog", level=6, name="Puzzle: # Pieces in RBB Puzzle (2^3)"}, + // {index=0x76, type="Prog", level=6, name="Puzzle: # Pieces in CCW Puzzle (2^0)"}, + // {index=0x77, type="Prog", level=6, name="Puzzle: # Pieces in CCW Puzzle (2^1)"}, + // {index=0x78, type="Prog", level=6, name="Puzzle: # Pieces in CCW Puzzle (2^2)"}, + // {index=0x79, type="Prog", level=6, name="Puzzle: # Pieces in CCW Puzzle (2^3)"}, + // {index=0x7A, type="Prog", level=6, name="Puzzle: # Pieces in DoG Puzzle (2^0)"}, + // {index=0x7B, type="Prog", level=6, name="Puzzle: # Pieces in DoG Puzzle (2^1)"}, + // {index=0x7C, type="Prog", level=6, name="Puzzle: # Pieces in DoG Puzzle (2^2)"}, + // {index=0x7D, type="Prog", level=6, name="Puzzle: # Pieces in DoG Puzzle (2^3)"}, + // {index=0x7E, type="Prog", level=6, name="Puzzle: # Pieces in DoG Puzzle (2^4)"}, + // {index=0x7F, type="Prog", level=6, name="Puzzle: # Pieces in Double Health Puzzle (2^0)"}, + // {index=0x80, type="Prog", level=6, name="Puzzle: # Pieces in Double Health Puzzle (2^1)"}, + // {index=0x81, type="Prog", level=6, name="Puzzle: # Pieces in Double Health Puzzle (2^2)"}, + + BKPROG_83_MAGIC_GET_WEAK_TEXT = 0x83, + BKPROG_84_MAGIC_ALL_GONE_TEXT, + // {index=0x85, type="Prog", level=6, name="Lair Crypt Gate Open"}, + BKPROG_86_HAS_TOUCHED_MMM_THORN_HEDGE = 0x86, + + BKPROG_88_TRIED_LOGGO_AS_BEAR = 0x88, + BKPROG_89_ENTERED_LOGGO_AS_PUMPKIN, + BKPROG_8A_EXITED_LOGGO, + + // {index=0x8B, type="Prog", level=8, name="CCW Spring Open"}, + // {index=0x8C, type="Prog", level=8, name="CCW Summer Open"}, + // {index=0x8D, type="Prog", level=8, name="CCW Autumn Open"}, + // {index=0x8E, type="Prog", level=8, name="CCW Winter Open"}, + // {index=0x8F, type="Prog", level=8, name="Mumbo's Magic Getting Weak Text"}, + BKPROG_90_PAID_TERMITE_COST = 0x90, + BKPROG_91_PAID_PUMPKIN_COST, + BKPROG_92_PAID_WALRUS_COST, + BKPROG_93_PAID_CROC_COST, + BKPROG_94_PAID_BEE_COST, + + // {index=0x96, type="Prog", level=6, name="1st Time Brentilda Text"}, + BKPROG_97_ENTERED_LAIR_TEXT = 0x97, + BKPROG_98_EXITED_LEVEL_TEXT, + BKPROG_99_PAST_50_NOTE_DOOR_TEXT, + // {index=0x99, type="Prog", level=6, name="1st Time Past 50 ND Text"}, + + // {index=0x9B, type="Prog", level=6, name="CC WS Eyes Active"}, + // {index=0x9C, type="Prog", level=6, name="CC WS Left Eye Pressed"}, + // {index=0x9D, type="Prog", level=6, name="CC WS Right Eye Pressed"}, + // {index=0x9E, type="Prog", level=6, name="Crypt Coffin Lid Open"}, + BKPROG_9E_CRYPT_COFFIN_LID_OPEN = 0x9E, + + BKPROG_A1_STATUE_HAT_OPEN = 0xA1, + BKPROG_A2_GV_LOBBY_COFFIN_OPEN, + BKPROG_A3_UNKOWN, //tied to actor_244/marker_23B + BKPROG_A4_UNKOWN, //tied to actor_244/marker_23B + + BKPROG_A6_FURNACE_FUN_COMPLETE = 0xA6, + BKPROG_A7_NEAR_PUZZLE_PODIUM_TEXT, + BKPROG_A8_HAS_DIED, + BKPROG_A9_HAS_TOUCHED_RBB_OVEN, + BKPROG_AA_HAS_TOUCHED_CCW_BRAMBLE_FIELD, + // {index=0xAA, type="Prog", level=8, name="1st CCW Bramble Field Text"}, + // {index=0xAB, type="Prog", level=9, name="Oily Water Surface Text"}, + // {index=0xAC, type="Prog", level=9, name="Oily Water Underwater Text"}, + // {index=0xAD, type="Prog", level=6, name="Cheato: BLUEEGGS Unlocked"}, + // {index=0xAE, type="Prog", level=6, name="Cheato: REDFEATHERS Unlocked"}, + // {index=0xAF, type="Prog", level=6, name="Cheato: GOLDFEATHERS Unlocked"}, + BKPROG_B0_HAS_ENTERED_MM = 0xb0, + BKPROG_B1_HAS_ENTERED_BGS, + BKPROG_B2_HAS_ENTERED_TTC, + BKPROG_B3_HAS_ENTERED_GV, + BKPROG_B4_HAS_ENTERED_RBB, + BKPROG_B5_HAS_ENTERED_CCW, + BKPROG_B6_HAS_ENTERED_FP, + BKPROG_B7_HAS_ENTERED_MMM, + BKPROG_B8_HAS_ENTERED_CC, + BKPROG_B9_DOUBLE_HEALTH, + // {index=0xBA, type="Prog", level=6, name="1st Time T. Rex"}, + BK_PROG_BB_MUMBO_MISTAKE_INDEX = 0xBB, //2 bits + // BK_PROG_BC_MUMBO_MISTAKE_INDEX = 0xBC, //2 bits + BKPROG_BD_ENTER_LAIR_CUTSCENE = 0xBD, + BKPROG_BE_CHEATO_BLUEEGGS, + BKPROG_BF_CHEATO_REDFEATHERS, + BKPROG_C0_CHEATO_GOLDFEATHERS, + + BKPROG_C2_GRATE_TO_RBB_PUZZLE_OPEN = 0xc2, + BKPROG_C3_ICE_BALL_TO_CHEATO_BROKEN, + BKPROG_C4_STATUE_EYE_BROKEN, + BKPROG_C5_RAREWARE_BOX_BROKEN, + // {index=0xC6, type="Prog", level=6, name="Jump Pad Switch Pressed"}, + // {index=0xC7, type="Prog", level=6, name="Jump Pad Active"}, + // {index=0xC8, type="Prog", level=6, name="Wall to Wading Boots Broken"}, + // {index=0xC9, type="Prog", level=6, name="Wall to Jump Pad Switch Broken"}, + // {index=0xCA, type="Prog", level=6, name="Cobweb to Purple Cauldron Broken"}, + // {index=0xCB, type="Prog", level=6, name="Cobweb to Flight Pad Broken"}, + // {index=0xCC, type="Prog", level=6, name="Cobweb to Green Cauldron Broken"}, + BKPROG_CD_GRATE_TO_WATER_SWITCH_3_OPEN = 0xcd, + BKPROG_CE_GRATE_TO_MMM_PUZZLE_OPEN, + + // {index=0xD1, type="Prog", level=12, name="Fight 1st Jinjo Statue Activated Cutscene"}, + // {index=0xD2, type="Prog", level=12, name="Fight 1st Jinjo Statue Rising Cutscene"}, + // {index=0xD3, type="Prog", level=6, name="??FF PATTERN 2^0"}, + // {index=0xD4, type="Prog", level=6, name="??FF PATTERN 2^1"}, + // {index=0xD5, type="Prog", level=6, name="??FF PATTERN 2^2"}, + // {index=0xD6, type="Prog", level=6, name="??FF PATTERN 2^3"}, + // {index=0xD7, type="Prog", level=6, name="??FF PATTERN 2^4"}, + // {index=0xD8, type="Prog", level=6, name="??FF PATTERN 2^5"}, + // {index=0xD9, type="Prog", level=6, name="??FF PATTERN 2^6"}, + // {index=0xDA, type="Prog", level=6, name="??FF PATTERN 2^7"}, + + BKPROG_DC_HAS_HAD_ENOUGH_TOKENS_BEFORE = 0xDC, + // {index=0xDD, type="Prog", level=8, name="1st CCW Icy Water Text"}, + + // {index=0xDF, type="Prog", level=6, name="Remove Puzzle Piece Text"}, + // {index=0xE0, type="Prog", level=6, name="Place All Puzzle Pieces Text"}, + + // {index=0xE2, type="Prog", level=6, name="DoG Open"}, + // {index=0xE3, type="Prog", level=8, name="CCW Flower Spring"}, + // {index=0xE4, type="Prog", level=8, name="CCW Flower Summer"}, + // {index=0xE5, type="Prog", level=8, name="CCW Flower Autumn"}, + BKPROG_E6_SPRING_EYRIE_HATCHED = 0xE6, + BKPROG_E7_SUMMER_EYRIE_FED, + // {index=0xE7, type="Prog", level=8, name="Summer Eyrie Fed"}, + // {index=0xE8, type="Prog", level=8, name="Autumn Eyrie Fed"}, + + // {index=0xF3, type="Prog", level=6, name="Talked to Dingpot"}, + BKPROG_F4_ENTER_FF_CUTSCENE = 0xF4, + // {index=0xF4, type="Prog", level=6, name="1st Time FF Cutscene"}, + + // {index=0xF6, type="Prog", level=6, name="1st Time Near DoG Puzzle Podium"}, + // {index=0xF7, type="Prog", level=10, name="Pumpkin Making Mumbo Hungry Text"}, + BKPROG_F7_HAS_TRANSFORMED_IN_CRYPT = 0xF7, + BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE = 0xF8, //2bit + // BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE = 0xF9, //2bit + + BKPROG_FC_DEFEAT_GRUNTY = 0xFC +}; + +enum unkflags_1{ + UNKFLAGS1_73_SANDCASTLE_INFINITE_LIVES = 0x73, + UNKFLAGS1_74_SANDCASTLE_INFINITE_EGGS, + UNKFLAGS1_75_SANDCASTLE_INFINITE_RED_FEATHERS, + UNKFLAGS1_76_SANDCASTLE_INFINITE_GOLD_FEATHERS, + + UNKFLAGS1_78_SANDCASTLE_NO_BONUS = 0x78, + + UNKFLAGS1_7F_SANDCASTLE_OPEN_CC = 0x7F, + + UNKFLAGS1_86_SANDCASTLE_SHOCKSPRING_JUMP_UNLOCKED = 0x86, + UNKFLAGS1_87_SANDCASTLE_OPEN_GV,// 0X87 + + UNKFLAGS1_8A_SANDCASTLE_FLIGHT_UNLOCKED = 0x8A,// 0X8A + UNKFLAGS1_8B_SANDCASTLE_OPEN_FP,// 0X8B + UNKFLAGS1_8C_SANDCASTLE_OPEN_MMM,// 0X8C + UNKFLAGS1_8D_SANDCASTLE_REMOVE_CRYPT_GATE,// 0X8D + UNKFLAGS1_8E_SANDCASTLE_REMOVE_CRYPT_COFFIN_LID,// 0X8E + UNKFLAGS1_8F_SANDCASTLE_REMOVE_GRATE_NEAR_WATER_SWITCH,// 0X8F + UNKFLAGS1_90_SANDCASTLE_OPEN_RBB, + + UNKFLAGS1_93_SANDCASTLE_OPEN_CCW = 0x93, + UNKFLAGS1_94_SANDCASTLE_INFINITE_HEALTH,// 0X94 + UNKFLAGS1_95_SANDCASTLE_INFINTE_MUMBO_TOKENS,// 0X95 + UNKFLAGS1_96_SANDCASTLE_INFINITE_AIR,// 0X96 + UNKFLAGS1_97_SANDCASTLE_BOTTLES_BONUS_1,// 0X97 + UNKFLAGS1_98_SANDCASTLE_BOTTLES_BONUS_2,// 0X98 + UNKFLAGS1_99_SANDCASTLE_BOTTLES_BONUS_3,// 0X99 + UNKFLAGS1_9A_SANDCASTLE_BOTTLES_BONUS_4,// 0X9A + UNKFLAGS1_9B_SANDCASTLE_BOTTLES_BONUS_5,// 0X9B + UNKFLAGS1_9C_SANDCASTLE_BOTTLES_BONUS_6,// 0X9C + UNKFLAGS1_9D_SANDCASTLE_WISHY_WASHY,// 0X9D + + UNKFLAGS1_C1 = 0xC1 +}; + +enum level_flags_e +{ + LEVEL_FLAG_0_CC_TOKEN_TOOTH_OPEN = 0, + LEVEL_FLAG_1_CC_JIGGY_TOOTH_OPEN = 1 +}; + +enum transformation_e +{ + unknown, + TRANSFORM_1_BANJO, + TRANSFORM_2_TERMITE, + TRANSFORM_3_PUMPKIN, + TRANSFORM_4_WALRUS, + TRANSFORM_5_CROC, + TRANSFORM_6_BEE, + TRANSFORM_7_WISHWASHY +}; + +enum ability_e +{ + ABILITY_0_BARGE = 0x0, + ABILITY_1_BEAK_BOMB = 0x1, + ABILITY_2_BEAK_BUSTER = 0x2, + ABILITY_3_CAMERA_CONTROL = 0x3, + ABILITY_4_BEAR_PUNCH = 0x4, + ABILITY_5_CLIMB = 0x5, + ABILITY_6_EGGS = 0x6, + ABILITY_7_FLAP = 0x7, + ABILITY_8_FLIP = 0x8, + ABILITY_9_FLY = 0x9, + ABILITY_A_HOLD_A_JUMP_HIGHER = 0xA, + ABILITY_B_RATATAT_RAP = 0xB, + ABILITY_C_ROLL = 0xC, + ABILITY_D_SHOCK_JUMP = 0xD, + ABILITY_E_WADING_BOOTS = 0xE, + ABILITY_F_DIVE = 0xF, + ABILITY_10_TALON_TROT = 0x10, + ABILITY_11_TURBO_TALON = 0x11, + ABILITY_12_WONDERWING = 0x12, + ABILITY_13_1ST_NOTEDOOR = 0x13 +}; + +enum button_e{ + BUTTON_START = 0x0, + BUTTON_Z = 0x1, + BUTTON_L = 0x2, + BUTTON_R = 0x3, + BUTTON_D_UP = 0x4, + BUTTON_D_DOWN = 0x5, + BUTTON_D_LEFT = 0x6, + BUTTON_D_RIGHT = 0x7, + BUTTON_A = 0x8, + BUTTON_B = 0x9, + BUTTON_C_LEFT = 0xA, + BUTTON_C_DOWN = 0xB, + BUTTON_C_UP = 0xC, + BUTTON_C_RIGHT = 0xD +}; + +enum map_e +{ + MAP_1_SM_SPIRAL_MOUNTAIN = 0x01, + MAP_2_MM_MUMBOS_MOUNTAIN, + MAP_3_UNUSED, + MAP_4_UNUSED, + MAP_5_TTC_BLUBBERS_SHIP, + MAP_6_TTC_NIPPERS_SHELL, + MAP_7_TTC_TREASURE_TROVE_COVE, + // Unused + // Unused + MAP_A_TTC_SANDCASTLE = 0x0A, + MAP_B_CC_CLANKERS_CAVERN, + MAP_C_MM_TICKERS_TOWER = 0x0C, + MAP_D_BGS_BUBBLEGLOOP_SWAMP, + MAP_E_MM_MUMBOS_SKULL, + // Unused + MAP_10_BGS_MR_VILE = 0x10, + MAP_11_BGS_TIPTUP, + MAP_12_GV_GOBIS_VALLEY, + MAP_13_GV_MEMORY_GAME, + MAP_14_GV_SANDYBUTTS_MAZE, + MAP_15_GV_WATER_PYRAMID, + MAP_16_GV_RUBEES_CHAMBER, + // Unused + // Unused + // Unused + MAP_1A_GV_INSIDE_JINXY = 0x1A, + MAP_1B_MMM_MAD_MONSTER_MANSION = 0x1B, + MAP_1C_MMM_CHURCH = 0x1C, + MAP_1D_MMM_CELLAR = 0x1D, + MAP_1E_CS_START_NINTENDO = 0x1E, + MAP_1F_CS_START_RAREWARE = 0x1F, + MAP_20_CS_END_NOT_100, + MAP_21_CC_WITCH_SWITCH_ROOM, + MAP_22_CC_INSIDE_CLANKER, + MAP_23_CC_GOLDFEATHER_ROOM, + MAP_24_MMM_TUMBLARS_SHED, + MAP_25_MMM_WELL, + MAP_26_MMM_NAPPERS_ROOM, + MAP_27_FP_FREEZEEZY_PEAK, + MAP_28_MMM_EGG_ROOM = 0x28, + MAP_29_MMM_NOTE_ROOM = 0x29, + MAP_2A_MMM_FEATHER_ROOM = 0x2A, + MAP_2B_MMM_SECRET_CHURCH_ROOM = 0x2B, + MAP_2C_MMM_BATHROOM = 0x2C, + MAP_2D_MMM_BEDROOM = 0x2D, + MAP_2E_MMM_HONEYCOMB_ROOM = 0x2E, + MAP_2F_MMM_WATERDRAIN_BARREL = 0x2F, + MAP_30_MMM_MUMBOS_SKULL = 0x30, + MAP_31_RBB_RUSTY_BUCKET_BAY = 0x31, + MAP_32_UNUSED, + MAP_33_UNUSED, + MAP_34_RBB_ENGINE_ROOM, + MAP_35_RBB_WAREHOUSE, + MAP_36_RBB_BOATHOUSE, + MAP_37_RBB_CONTAINER_1, + MAP_38_RBB_CONTAINER_3, + MAP_39_RBB_CREW_CABIN, + MAP_3A_RBB_BOSS_BOOM_BOX, + MAP_3B_RBB_STORAGE_ROOM, + MAP_3C_RBB_KITCHEN, + MAP_3D_RBB_NAVIGATION_ROOM, + MAP_3E_RBB_CONTAINER_2, + MAP_3F_RBB_CAPTAINS_CABIN, + MAP_40_CCW_HUB, + MAP_41_FP_BOGGYS_IGLOO, + // Unused + MAP_43_CCW_SPRING = 0x43, + MAP_44_CCW_SUMMER = 0x44, + MAP_45_CCW_AUTUMN = 0x45, + MAP_46_CCW_WINTER = 0x46, + MAP_47_BGS_MUMBOS_SKULL = 0x47, + MAP_48_FP_MUMBOS_SKULL = 0x48, + // Unused + MAP_4A_CCW_SPRING_MUMBOS_SKULL = 0x4A, + MAP_4B_CCW_SUMMER_MUMBOS_SKULL = 0x4B, + MAP_4C_CCW_AUTUMN_MUMBOS_SKULL = 0x4C, + MAP_4D_CCW_WINTER_MUMBOS_SKULL = 0x4D, + // Unused + // Unused + // Unused + // Unused + // Unused + MAP_53_FP_CHRISTMAS_TREE = 0x53, + MAP_54_UNUSED, + MAP_55_UNUSED, + MAP_56_UNUSED, + MAP_57_UNUSED, + MAP_58_UNUSED, + MAP_59_UNUSED, + MAP_5A_CCW_SUMMER_ZUBBA_HIVE = 0x5A, // Summer & Spring are swapped here + MAP_5B_CCW_SPRING_ZUBBA_HIVE, + MAP_5C_CCW_AUTUMN_ZUBBA_HIVE, + // Unused + MAP_5E_CCW_SPRING_NABNUTS_HOUSE = 0x5E, + MAP_5F_CCW_SUMMER_NABNUTS_HOUSE = 0x5F, + MAP_60_CCW_AUTUMN_NABNUTS_HOUSE = 0x60, + MAP_61_CCW_WINTER_NABNUTS_HOUSE = 0x61, + MAP_62_CCW_WINTER_HONEYCOMB_ROOM = 0x62, + MAP_63_CCW_AUTUMN_NABNUTS_WATER_SUPPLY = 0x63, + MAP_64_CCW_WINTER_NABNUTS_WATER_SUPPLY = 0x64, + MAP_65_CCW_SPRING_WHIPCRACK_ROOM = 0x65, + MAP_66_CCW_SUMMER_WHIPCRACK_ROOM = 0x66, + MAP_67_CCW_AUTUMN_WHIPCRACK_ROOM = 0x67, + MAP_68_CCW_WINTER_WHIPCRACK_ROOM = 0x68, + MAP_69_GL_MM_LOBBY = 0x69, + MAP_6A_GL_TTC_AND_CC_PUZZLE = 0x6A, + MAP_6B_GL_180_NOTE_DOOR = 0x6B, + MAP_6C_GL_RED_CAULDRON_ROOM = 0x6C, + MAP_6D_GL_TTC_LOBBY = 0x6D, + MAP_6E_GL_GV_LOBBY = 0x6E, + MAP_6F_GL_FP_LOBBY = 0x6F, + MAP_70_GL_CC_LOBBY = 0x70, + MAP_71_GL_STATUE_ROOM, + MAP_72_GL_BGS_LOBBY, + // Unused + MAP_74_GL_GV_PUZZLE = 0x74, + MAP_75_GL_MMM_LOBBY, + MAP_76_GL_640_NOTE_DOOR, + MAP_77_GL_RBB_LOBBY, + MAP_78_GL_RBB_AND_MMM_PUZZLE, + MAP_79_GL_CCW_LOBBY, + MAP_7A_GL_CRYPT, + MAP_7B_CS_INTRO_GL_DINGPOT_1, + MAP_7C_CS_INTRO_BANJOS_HOUSE_1, + MAP_7D_CS_SPIRAL_MOUNTAIN_1, + MAP_7E_CS_SPIRAL_MOUNTAIN_2, + MAP_7F_FP_WOZZAS_CAVE, + MAP_80_GL_FF_ENTRANCE, + MAP_81_CS_INTRO_GL_DINGPOT_2, + MAP_82_CS_ENTERING_GL_MACHINE_ROOM, + MAP_83_CS_GAME_OVER_MACHINE_ROOM, + MAP_84_CS_UNUSED_MACHINE_ROOM, // Klungo walks to the Controltable + MAP_85_CS_SPIRAL_MOUNTAIN_3, + MAP_86_CS_SPIRAL_MOUNTAIN_4, + MAP_87_CS_SPIRAL_MOUNTAIN_5, + MAP_88_CS_SPIRAL_MOUNTAIN_6, + MAP_89_CS_INTRO_BANJOS_HOUSE_2, + MAP_8A_CS_INTRO_BANJOS_HOUSE_3, + MAP_8B_RBB_ANCHOR_ROOM, + MAP_8C_SM_BANJOS_HOUSE, + MAP_8D_MMM_INSIDE_LOGGO, + MAP_8E_GL_FURNACE_FUN, + MAP_8F_TTC_SHARKFOOD_ISLAND, + MAP_90_GL_BATTLEMENTS, + MAP_91_FILE_SELECT, + MAP_92_GV_SNS_CHAMBER, + MAP_93_GL_DINGPOT, + MAP_94_CS_INTRO_SPIRAL_7, + MAP_95_CS_END_ALL_100, + MAP_96_CS_END_BEACH_1, + MAP_97_CS_END_BEACH_2, + MAP_98_CS_END_SPIRAL_MOUNTAIN_1, + MAP_99_CS_END_SPIRAL_MOUNTAIN_2 +}; + + +enum comusic_e +{ + COMUSIC_0_DING_A = 0x00, + COMUSIC_1_FINAL_BATTLE, + COMUSIC_2_MM, + COMUSIC_3_FP_TWINKLIES_TALKING, + COMUSIC_4_MMM_CLOCK_VERSION, + COMUSIC_5_TTC_VACATION_VERSION, + COMUSIC_6_BGS, + COMUSIC_7_CC_MUTANT_CRABS, + COMUSIC_8_STARTUP_MUSICAL, + COMUSIC_9_NOTE_COLLECTED, + COMUSIC_A_JINJO_COLLECTED, + COMUSIC_B_RED_FEATHER_COLLECTED, + COMUSIC_C_EGG_COLLECTED, + COMUSIC_D_JINGLE_JIGGY_COLLECTED, + COMUSIC_E_MMM_BACKGROUND_WIND, + COMUSIC_F_MMM_ALTERNATIVE, + COMUSIC_10_SM, + COMUSIC_11_SEAGULLS, + COMUSIC_12_TTC_NIPPER, + COMUSIC_13_INSIDE_SANDCASTLE, + COMUSIC_14_GOLD_FEATHER_COLLECTED, + COMUSIC_15_EXTRA_LIFE_COLLECTED, + COMUSIC_16_HONEYCOMB_COLLECTED, + COMUSIC_17_EMPTY_HONEYCOMB_COLLECTED, + COMUSIC_18_HEALTH_UPGRADE, + COMUSIC_19_LOW_PITCH_FLUTES, + COMUSIC_1A_DEATH, + COMUSIC_1B_MYSTERIOUS_INDOORS, + COMUSIC_1C_CC_ALTERNATIVE, + COMUSIC_1D_MUMBO_TRANSFORMATION, + COMUSIC_1E_GL_MM_VERSION, + COMUSIC_1F_CC_INSIDE_CLANKER, + COMUSIC_20_GV_ALTERNATIVE, + COMUSIC_21_MMM_INSIDE_MMM_MANSION, + COMUSIC_22_MMM, + COMUSIC_23_MMM_INSIDE_CHURCH, + COMUSIC_24_GV_INSIDE_PYRAMID, + COMUSIC_25_USING_GOLD_FEATHERS, + COMUSIC_26_GV_SANDYBUTT_DANGER, + COMUSIC_27_GV_RUBEES_SONG, + COMUSIC_28_SOMETHING_AQUATIC, + COMUSIC_28_CCW_SUMMER, + COMUSIC_28_CCW_WINTER, + COMUSIC_2B_DING_B, + COMUSIC_2C_BUZZER, + COMUSIC_2D_PUZZLE_SOLVED_FANFARE, + COMUSIC_2E_CCW_FALL_AQUATIC, + COMUSIC_2F_CCW_HUBROOM, + COMUSIC_30_5TH_JINJO_COLLECTED, + COMUSIC_31_GAME_OVER, + COMUSIC_32_STARTUP_LOGO_SCENE, + COMUSIC_33_RBB_ALTERNATIVE, + COMUSIC_34_SNACKER_DANGER, + COMUSIC_35_RBB_MASCHINE_ROOM_AQUATIC, + COMUSIC_36_100TH_NOTE_COLLECTED, + COMUSIC_37_DOUBLE_HEALTH_UPGRADE, + COMUSIC_38_MOTZAND_BEATEN, + COMUSIC_39_DK64_FUNGI_FOREST, + COMUSIC_3A_FP_BOGGY_RACE, + COMUSIC_3B_MINIGAME_VICTORY, + COMUSIC_3C_MINIGAME_LOSS, + COMUSIC_3D_JIGGY_SPAWN, + COMUSIC_3E_SANDYBUTT_FAILURE, + COMUSIC_3F_MAGIC_CARPET_RISING, + COMUSIC_40_MAGIC_CARPET_SINKING, + COMUSIC_41_MUMBOS_HUT, + COMUSIC_42_NOTEDOOR_OPENING_FANFARE, + COMUSIC_43_ENTER_LEVEL_GLITTER, // Looping + COMUSIC_44_CCW_NABNUT, + COMUSIC_45_CCW_NABNUT_ATTIC_A, + COMUSIC_46_CCW_SPRING, + COMUSIC_47_BGS_INSIDE_TANKTUP, + COMUSIC_48_CCW_ALTERNATIVE_A, + COMUSIC_49_CCW_ALTERNATIVE_QUICK, + COMUSIC_4A_RBB_INSIDE_CONTAINER, + COMUSIC_4B_CCW_ZUBBA_FIGHT, + COMUSIC_4C_RBB_CREWMATE_CABIN, + COMUSIC_4D_MUMBO_DANCE, + COMUSIC_4E_IN_TRANSITION, + COMUSIC_4F_OUT_TRANSITION, + COMUSIC_50_GL_TTC_VERSION, + COMUSIC_51_GL_CCW_VERSION, + COMUSIC_52_GL_BGS_RBB_VERSION, + COMUSIC_53_GL_FP_VERSION_A, + COMUSIC_54_GL_GV_VERSION, + COMUSIC_55_BGS_MR_VILE, + COMUSIC_56_SM_HANGBRIDGE, + COMUSIC_57_TURBO_TRAINERS, + COMUSIC_58_WADING_BOOTS, + COMUSIC_59_GL_FP_VERSION_B, + COMUSIC_5A_FP_IGLOO_SAD, + COMUSIC_5B_FP_IGLOO_HAPPY, + COMUSIC_5C_BETA_GAME_OVER, // at least I guess so + COMUSIC_5D_GL_MMM_VERSION, + COMUSIC_5E_GL_MMM_RBB_VERSION, + COMUSIC_5F_CCW_ALTERNATIVE_B, + COMUSIC_60_NABNUT_ATTIC_B = 0x60, + COMUSIC_61_XMAS_TREE_LIGHTS_UP, + COMUSIC_62_RBB_BOOMBOX, + COMUSIC_63_GL_FF_VERSION, + COMUSIC_64_WORLD_OPENING_A, + COMUSIC_65_WORLD_OPENING_B, + COMUSIC_66_FP_INSIDE_WOZZAS_CAVE, + COMUSIC_67_INSERTING_JIGGY, + COMUSIC_68_TWINKLY_MINIGAME, + COMUSIC_69_FF_WARP, + COMUSIC_6A_MMM_TUMBLARS_SHED, + COMUSIC_6B_FP_ALTERNATIVE, + COMUSIC_6C_INTRO_TOWER_SCENE, + COMUSIC_6D_CCW_GNAWTYS_HOUSE, + COMUSIC_6E_GAME_SELECT, + COMUSIC_6F_PAUSE_SCREEN, + MUSIC_MMM_INSIDE_LOGGO = 0x70, + MUSIC_FF, + MUSIC_BGS_FLIBBIT_FIGHT, + COMUSIC_73_GAMEBOY, + MUSIC_GL_FINAL_SECTION, + SFX_RED_FEATHER_REFILL, + SFX_GOLD_FEATHER_REFILL, + SFX_EGG_REFILL, + JINGLE_DOOR_OF_GRUNTY_OPENED, + COMUSIC_79_CHEATO, + COMUSIC_7A_BRENTILDA, + COMUSIC_7B_STEP_ON_SKULL_TILE, // Not 100% sure on these + COMUSIC_7C_STEP_ON_GRUNTY_TILE, + COMUSIC_7D_STEP_ON_BK_TILE, + COMUSIC_7E_STEP_ON_MINIGAME_TILE, + COMUSIC_7F_STEP_ON_JOKER_TILE, + MUSIC_GAME_OVER_CUTSCENE = 0x80, + COMUSIC_81_ACTIVATING_BRENTILDA, + SFX_REMOVE_JIGGY, + MUSIC_GV_SNS, // Not 100% sure on these + MUSIC_TTC_SNS, + MUSIC_FP_SNS, + MUSIC_MMM_SNS, + MUSIC_MMM_SNS_HAPPIER, + COMUSIC_88_BIG_SNS_FANFARE, + SFX_JINJO_STATUE_POWERUP, + COMUSIC_8A_GETTING_TURBO_TRAINERS, + COMUSIC_8B_DEACTIVATE_BRENTILDA, + COMUSIC_8C_JINJONATOR_POWERUP, + JINGLE_MENACING_GRUNTILDA_A, + MUSIC_CREDITS, + JINGLE_MENACING_GRUNTILDA_B, + JINGLE_END_OF_INTRO = 0x90, + MUSIC_GRUNTY_FALLING, + SFX_GRUNTY_SPELL_POWERUP, + SFX_AIR_METER_DROPPING, + COMUSIC_94_BBONUS, + COMUSIC_95_BBONUS_A, + COMUSIC_96_BBONUS_PICKUP_PIECE, + COMUISC_97_BBONUS_DROP_PIECE, + COMUSIC_98_BBONUS_PIECES_SHUFFLE, // Looping + MUSIC_MUMBO_BBQ, + SFX_JINJONATOR_HITS_GRUNTY_A, + SFX_JINJONATOR_HITS_GRUNTY_B, + SFX_JINJONATOR_HITS_GRUNTY_C, + SFX_JINJONATOR_HITS_GRUNTY_D, + SFX_JINJONATOR_HITS_GRUNTY_E, + SFX_JINJONATOR_HITS_GRUNTY_F, + SFX_JINJONATOR_HITS_GRUNTY_G = 0xA0, + SFX_JINJONATOR_HITS_GRUNTY_H, + SFX_JINJONATOR_HITS_GRUNTY_I, + SFX_JINJONATOR_HITS_GRUNTY_J, + JINGLE_JINJONATOR_DRUMMING_A, + JINGLE_JINJONATOR_DRUMMING_B, + JINGLE_JINJONATOR_DRUMMING_C, + JINGLE_JINJONATOR_DRUMMING_D, + MUSIC_KLUNGO_BY_FALLEN_GRUNTY, + COMUSIC_A9_TOOTY, + MUSIC_BEACH, + JINGLE_JINJOATOR_FINAL_HIT, + COMUSIC_AC_GOOD_ENDING = 0xAC +}; + +// SFXR_ = Repeating SFX +enum sfx_e +{ + SFX_0_BLOOP = 0x0000, + SFX_1_MUMBO_UMENAKA, + SFX_2_CLAW_SWIPE, + SFX_3_DULL_CANNON_SHOT, + // Long Beakbarge 2nd Part + SFX_4_KAZOOIE_RUUUUUH, + SFX_5_BANJO_LANDING_01, + SFX_6_BANJO_LANDING_02, + SFX_7_BANJO_LANDING_03, + SFX_8_BANJO_LANDING_04, + SFX_9_SQUEAKY_TOY, + SFX_A_BANJO_LANDING_05, + SFX_B_BANJO_LANDING_06, + SFX_C_TAKING_FLIGHT_LIFTOFF, + SFX_D_EGGSHELL_BREAKING, + SFX_E_SHOCKSPRING_BOING, + SFX_F_SMALL_WATER_SPLASH, + // shallow water + SFX_10_BANJO_LANDING_07, + // Blubber's Ship's Trapdoor eg. + SFX_11_WOOD_BREAKING_1, + SFX_12_WATER_PADDLING_1, + SFX_13_BEAKBUSTER_GROUND, + // sounds like a muffled frying pan + SFX_14_METALLIC_HIT_1, + // less frying pan-ish + SFX_15_METALLIC_HIT_2, + // In the Opening Musical, when Mumbo's Xylophone drops + SFX_16_HEAVY_FALL_VIBRATO, + SFX_17_JINJO_WHISTLE, + SFX_18_BIGBUTT_SLIDE, + SFX_19_BANJO_LANDING_08, + SFX_1A_BIG_THINGS_FALL_OVER, + // from the sea-mines + SFX_1B_EXPLOSION_1, + SFX_1C_ALARMCLOCK, + // hitting the Bull eg. + SFX_1D_HITTING_AN_ENEMY_1, + // might also be used for breaking boulders + SFX_1E_HITTING_AN_ENEMY_2, + // hitting a Gruntling eg. + SFX_1F_HITTING_AN_ENEMY_3, + // Cauldrons make this sound when landing + SFX_20_METAL_CLANK_1, + SFX_21_EGG_BOUNCE_1, + SFX_22_KONGA_NOISE_1, + SFX_23_KONGA_NOISE_2, + SFX_24_KONGA_NOISE_3, + // might be part of Clankers Bolt + SFX_25_METAL_SLIDING_OVER_SMTH, + SFX_26_BANJO_LANDING_09, + SFX_27_JINJO_HI, + SFX_28_RUSTLING_NOISE, + SFX_29_GRUBLIN_NYAHAHA, + SFX_2A_CLOCK_TIC_1, + // passive version + SFX_2B_BULL_MOO_1, + // when Trunker or the CCW plant grow eg. + SFX_2C_PULLING_NOISE, + // incomplete cauldron spitout AND Banjo pulling on Kazooies Throat in Idle Anim + SFX_2D_KABOING, + SFX_2E_BIGBUTT_RUNNING, + SFX_2F_ORANGE_SPLAT, + SFX_30_MAGIC_POOF, + // starting to ride the FP sled to rescue Boggy + SFX_31_BANJO_OHHWAAOOO, + // when rolling AND when taking damage + SFX_32_BANJO_EGHEE, + // inital Shockspring Jump + SFX_33_BANJO_AHOO, + SFX_34_BANJO_AGHOAA, + SFX_35_BANJO_WOAH, + // death inducing damage + SFX_36_BANJO_DOH, + SFX_37_BANJO_OHWW, + // less intense version + SFX_38_BANJO_AYE_1, + // more intense version + SFX_39_BANJO_AYE_2, + SFX_3A_BANJO_HOUW, + SFX_3B_BANJO_GAAH, + SFX_3C_BULL_GROWN, + SFX_3D_TICKER_WALKING, + // egg pooping ? + SFX_3E_POOP_NOISE, + // higher pitch + SFX_3F_CAULDRON_SQEAK_1, + // lower pitch + SFX_40_CAULDRON_SQEAK_2, + // waking up + SFX_41_MUMBO_ERGHHH, + // short and dull + SFX_42_KAZOOIE_RAH, + // Short Beakbarge 2nd Part + SFX_43_KAZOOIE_RUH, + // peeking out of the backpack + SFX_44_KAZOOIE_AUW, + // Beakbbuster going down ? + SFX_45_KAZOOIE_HUGHH, + // egg shot 1st Part + SFX_46_KAZOOIE_CHOKING_UP, + // FeatherFlap exhausting + SFX_47_KAZOOIE_HEUGH, + // TalonTrot Jump + SFX_48_KAZOOIE_RUUH, + // TalonTrot Walking + SFX_49_KAZOOIE_RA, + // the CCW Birds when comming out + SFX_4A_CLUCKER_AHH, + SFX_4B_GULPING, + // eating yumblies + SFX_4C_LIP_SMACK, + // like when a fish flops around in shallow water + SFX_4D_WET_WIGGLING, + // sounds like split-up from Tooie + SFX_4E_KAZOOIE_BRUIII, + // selecting a SaveFile + SFX_4F_BANJO_WAHOO, + // during Beakbomb + SFX_50_KAZOOIE_RRRUH, + SFX_51_CLOCK_TIC_2, + // starting a Beakbomb + SFX_52_BANJO_YAH_OH, + // shockspring jump liftoff + SFX_53_BANJO_HUIII, + // jumping + SFX_54_BANJO_HOO_1, + // jumping + SFX_55_BANJO_HOO_2, + // jumping + SFX_56_BANJO_HUI, + // egg shot 2nd part + SFX_57_KAZOOIE_HEGH, + SFX_58_CHIMPY_NOISE_1, + SFX_59_CHIMPY_NOISE_2, + SFX_5A_CHIMPY_NOISE_3, + SFX_5B_HEAVY_STUFF_FALLING, + SFX_5C_HEAVY_STUFF_FALLING_DELAYED, + // sleeping while snoring, inhale + SFX_5D_BANJO_RAAOWW, + // sleeping while snoring, exhale + SFX_5E_BANJO_PHEWWW, + // while channeling a spell + SFX_5F_MUMBO_BUGABUGOW_MUFFLED, + // in the GameOver CS when Mumbo appears + SFX_60_MUMBO_SKIDDING, + // in the Musical when the buzzbomb falls (slowed down) + SFX_61_CARTOONY_FALL, + // annoyed at Kazooie, Idle Animation + SFX_62_BANJO_ERGHH, + // huge fall starts + SFX_63_BANJO_UWAAAAOOH, + // in the Musical, when the Bulls run across + SFX_64_STAMPEDE, + SFX_65_METALLIC_SCRATCH, + SFX_66_BIRD_AUUGHH, + SFX_67_BEEHIVE_CLONK, + SFX_68_CLUCKER_AAEEGHH, + SFX_69_WHIPCRACK_CREAKING, + // flagpoles during the boggy races + SFX_6A_FLAGPOLE_WOBBLE, + SFX_6B_LOCKUP_OPENING, + SFX_6C_LOCKUP_CLOSING, + SFX_6D_CROC_BITE, + SFX_6E_VILE_EGH, + // bottles uses this too I think + SFX_6F_BANJO_HEADSCRATCH, + SFX_70_WALKING_NOISE_1, + SFX_71_WALKING_NOISE_2, + SFX_72_WALKING_NOISE_3, + SFX_73_WALKING_NOISE_4, + SFX_74_WALKING_NOISE_5, + SFX_75_WALKING_NOISE_6, + SFX_76_WALKING_NOISE_7, + SFX_77_WALKING_NOISE_8, + SFX_78_EAGLECRY, + SFX_79_TICKER_DEATH, + // SFX_TICKER_DEATH but higher pitch + SFX_7A_TERMITE_DEATH, + SFX_7B_ICE_BREAKING_1, + // entering a cauldron + SFX_7C_CHEBOOF, + // RBB, might be cranes aswell + SFX_7D_ANCHOR_LIFTING, + SFX_7E_CREAKY_DOOR_OPENING, + SFX_7F_HEAVYDOOR_SLAM, + SFX_80_YUMYUM_CLACK, + // like polishing glass + SFX_81_UUU, + // when gates are broken, and probably when clankers bolt lands + SFX_82_METAL_BREAK, + SFX_83_BLUBBER_CRYING, + SFX_84_GOBI_CRYING, + SFX_85_ROUGH_COUGH, + SFX_86_TIPTUP_CHORUS_AH, + // when beakbustering his feet + SFX_87_TANKTUP_OOOHW, + SFX_88_WOZZA_NOISE, + // unsure + SFX_89_PARTYTOOL, + // unsure, sounds like tooie's + SFX_8A_ALTERNATIVE_EGG_SHOT, + // when Banjo pulls on her throat in the idle anim + SFX_8B_KAZOOIE_RAWW, + SFX_8C_BOGGY_WAHEY, + SFX_8D_BOGGY_OHWW, + // tooie mingy sounds super similar + SFX_8E_GRUNTLING_DAMAGE, + SFX_8F_SNOWBALL_FLYING, + SFX_90_SWITCH_PRESS, + // might be clankers bolt landing + SFX_91_METALLIC_SOUND, + SFX_92_TOILET_FLUSH, + // or some elevator + SFX_93_MICROWAVE, + SFX_94_COGS_ROTATING, + SFX_95_BANJO_TALKING, + SFX_96_HOTSAND_EEL_HISS, + // twinklies box maybe + SFX_97_BLUBBER_BURPS, + SFX_98_DEAF_THUD, + SFX_99_METALLIC_THUD, + // grunty fight + SFX_9A_MECHANICAL_CLOSING, + SFX_9B_BOULDER_BREAKING_1, + SFX_9C_BOULDER_BREAKING_2, + SFX_9D_BOULDER_BREAKING_3, + // might be enemys hitting the ground + SFX_9E_BOULDER_BREAKING_4, + SFX_9F_GENERATOR_RUNNING, + // Tanktup maybe + SFX_A0_COUGHING = 0x00A0, + SFX_A1_BANJO_COUGHING, + SFX_A2_BANJO_AHOOA, + // from the idle anim + SFX_A3_BANJO_DOUBLE_COUGH, + // from the idle anim, but only once + SFX_A4_BANJO_SINGLE_COUGH, + SFX_A5_EYRIE_CRY, + // final part of entering a cauldron warp + SFX_A6_MAGICAL_FINISH, + SFX_A7_WOODEN_SWOSH, + SFX_A8_BLUBBER_DOUBLE_CRY, + SFX_A9_BLUBBER_SINGLE_CRY, + // this sounds like the used version + SFX_AA_BGS_EGG_BREAKING_1, + SFX_AB_BGS_EGG_BREAKING_2, + SFX_AC_GOLDFEATHER_TALKING, + SFX_AD_CATERPILLAR_SQUEAK, + SFX_AE_YUMYUM_TALKING, + SFX_AF_BANJO_CATCHING_BREATH, + // might be from the grunty machine's doors + SFX_B0_SIZZLING_NOISE, + SFX_B1_BOGGY_KID_CRYING, + SFX_B2_BOGGY_KID_HAPPY, + SFX_B3_ORANGE_TALKING, + SFX_B4_BOTTLES_TALKING_1, + SFX_B5_THUNDERBOLT, + // 1-6 are getting increasingly higher in pitch + SFX_B6_GLASS_BREAKING_1, + // 1-6 are getting increasingly higher in pitch + SFX_B7_GLASS_BREAKING_2, + // 1-6 are getting increasingly higher in pitch + SFX_B8_GLASS_BREAKING_3, + // 1-6 are getting increasingly higher in pitch + SFX_B9_GLASS_BREAKING_4, + // 1-6 are getting increasingly higher in pitch + SFX_BA_GLASS_BREAKING_5, + // 1-6 are getting increasingly higher in pitch + SFX_BB_GLASS_BREAKING_6, + SFX_BC_BOTTLES_TALKING_2, + SFX_BD_BOTTLES_TALKING_3, + SFX_BE_WATERFALL, + SFX_BF_EYRIE_SLEEPING_1, + SFX_C0_EYRIE_SLEEPING_2, + // from the opening CS + SFX_C1_BUZZBOMB_ATTACK, + // death + SFX_C2_GRUBLIN_EGH, + // some talking ? + SFX_C3_HEGH, + SFX_C4_TWINKLY_MUNCHER_GRR, + SFX_C5_TWINKLY_POP, + SFX_C6_SHAKING_MOUTH, //bottles leaving/entering molehill + // from the jinjo's flying + SFX_C7_SHWOOP, + // eating twinklies + SFX_C8_CRUNCH, + SFX_C9_PAUSEMENU_ENTER, + SFX_CA_BANJO_DROWNING_1, + SFX_CB_BANJO_DROWNING_2, + // also the scrolling sound + SFX_CC_PAUSEMENU_ENTER_SUBMENU, + SFX_CD_PAUSEMENU_LEAVE_SUBMENU, + // when the page is changed + SFX_CE_PAUSEMENU_HOIP, + SFX_CF_PAUSEMENU_SHWOOP, + SFX_D0_GRIMLET_SQUEAK, + SFX_D1_SNORKEL_WAH, + // barely noticable + SFX_D2_QUIET_METALLIC, + SFX_D3_JINXIE_SNIFFLING_1, + SFX_D4_JINXIE_SNIFFLING_2, + SFX_D5_JINXIE_SNEEZING, + SFX_D6_UGH, + SFX_D7_GRABBA_DEATH, + SFX_D8_CRANE, + SFX_D9_WOODEN_CRATE_BREAKING_1, + SFX_DA_WOODEN_CRATE_BREAKING_2, + SFX_DB_WOODEN_CRATE_BREAKING_3, + SFX_DC_IDLE_PADDLING, + SFX_DD_JINJO_TALKING, + SFX_DE_WOOD_SQUEAK, + SFX_DF_KAZOOIE_TALKING_1, + SFX_E0_KAZOOIE_TALKING_2, + SFX_E1_KAZOOIE_TALKING_3, + SFX_E2_KAZOOIE_TALKING_4, + SFX_E3_KONGA_TALKING_1, + SFX_E4_KONGA_TALKING_2, + SFX_E5_KONGA_TALKING_3, + // extra life talking ? + SFX_E6_MEEP_1, + // extra life talking ? + SFX_E7_MEEP_2, + SFX_E8_TOOTY_TALKING_1, + SFX_E9_TOOTY_TALKING_2, + // from enter_Lair CS + SFX_EA_GRUNTY_LAUGH_1, + // from Gameover CS + SFX_EB_GRUNTY_LAUGH_2, + SFX_EC_GRUNTY_TALKING_1, + SFX_ED_GRUNTY_TALKING_2, + SFX_EE_GRUNTY_TALKING_3, + SFX_EF_TIPTUP_TALKING, + // pages flipping + SFX_F0_CHEATO_IDLE_1 = 0x00F0, + // book closing thud + SFX_F1_CHEATO_IDLE_2, + SFX_F2_CUCKOO_CLOCK, + SFX_F3_TRUNKER_TALKING, + SFX_F4_TAP, + SFX_F5_BLUBBER_TALKING_1, + SFX_F6_BLUBBER_TALKING_2, + SFX_F7_BLUBBER_TALKING_3, + SFX_F8_BLUBBER_TALKING_4, + SFX_F9_GRUNTLING_NOISE_1, + SFX_GRUNTLING_NOISE_2, + SFX_GRUNTLING_NOISE_3, + SFX_RUBEE_TALKING_1, + SFX_RUBEE_TALKING_2, + SFX_RUBEE_TALKING_3, + SFX_TANKTUP_TALKING_1, + SFX_TANKTUP_TALKING_2, + SFX_100_TANKTUP_TALKING_3 = 0x0100, + SFX_101_LOGGO_TALKING, + SFX_102_ZUBBA_TALKING, + SFX_103_FLOTSAM_DEATH, + // might also be zubba wings or similar + SFX_104_PROPELLER_NOISE, + SFX_105_EYRIE_YAWN, + SFX_106_EYRIE_LIPSMACK, + // full version + SFX_107_CAULDRON_ACTIVATION_1, + // abbreviated version + SFX_108_CAULDRON_ACTIVATION_2, + SFX_109_LOGGO_LID_CLAP, + SFX_10A_TUMBLAR_TALKING, + SFX_10B_GNAWTY_TALKING, + SFX_10C_MUMMY_TALKING, + SFX_10D_ANCIENT_ONE_TALKING, + SFX_10E_TWINKLY_TALKING, + SFX_10F_BOGGY_TALKING, + SFX_110_TWINKLY_DEATH = 0x0110, + SFX_111_WHIPCRACK_DEATH, + SFX_112_TINKER_ATTENTION, + SFX_113_PAD_APPEARS, + SFX_114_BRICKWALL_BREAKING, + SFX_115_BUZZBOMB_DEATH, + SFX_116_DEAF_RUSTLING, + SFX_117_LIMBO_COLLAPSING, + SFX_118_LIMBO_REASSEMBLING, + SFX_119_FISH_DEATH, + SFX_11A_MATROSE_GRUBLIN_AYE, + // 1-6 are getting increasingly shorter + SFX_11B_TUMBLAR_DISAPPEARING_1, + // 1-6 are getting increasingly shorter + SFX_11C_TUMBLAR_DISAPPEARING_2, + // 1-6 are getting increasingly shorter + SFX_11D_TUMBLAR_DISAPPEARING_3, + // 1-6 are getting increasingly shorter + SFX_11E_TUMBLAR_DISAPPEARING_4, + // 1-6 are getting increasingly shorter + SFX_11F_TUMBLAR_DISAPPEARING_5, + // 1-6 are getting increasingly shorter + SFX_120_TUMBLAR_DISAPPEARING_6, + // sounds like an OOT sound + SFX_121_AWAWAU, + SFX_122_TOOTY_TALKING_3, + // on rooftiles + SFX_123_BANJO_LANDING_10, + // shorter version + SFX_124_AUDIENCE_CHEERING_1, + // longer version + SFX_125_AUDIENCE_CHEERING_2, + SFX_126_AUDIENCE_BOOING, + SFX_127_AUDIENCE_MIXED, + SFX_128_FIRE_CRACKING, + // might be skeleton grimlets riiping the painting + SFX_129_SWOOSH, + SFX_12A_GRUNTY_AH, + SFX_12B_BOILING_AND_BUBBLING, + SFX_12C_FF_QUESTION_START, + SFX_12D_CAMERA_ZOOM_CLOSEST, + SFX_12E_CAMERA_ZOOM_MEDIUM, + SFX_12F_FUUUCK_YOUUU, + // from her final fall + SFX_130_GRUNTY_ECHOING_CRY = 0x0130, + SFX_131_GRUNTY_WEEEGH, + SFX_132_GRUNTY_YOW, + SFX_133_GRUNTY_OHW, + SFX_134_FREEZING_SHIVER, + // FileSelect, when Banjo's Bed ejects him + SFX_135_CARTOONY_SPRING, + SFX_136_GAMEBOY_STARTUP, + SFX_137_GAMEBOY_BOIN, + SFX_138_GAMEBOY_BOIOIN, + SFX_139_GAMEBOY_GLITCH, + SFX_13A_GLASS_BREAKING_7, + // 1-6 are getting increasingly distant + SFX_GRUNTY_FINAL_SCREAM_1, + // 1-6 are getting increasingly distant + SFX_GRUNTY_FINAL_SCREAM_2, + // 1-6 are getting increasingly distant + SFX_GRUNTY_FINAL_SCREAM_3, + // 1-6 are getting increasingly distant + SFX_GRUNTY_FINAL_SCREAM_4, + // 1-6 are getting increasingly distant + SFX_GRUNTY_FINAL_SCREAM_5, + // 1-6 are getting increasingly distant + SFX_GRUNTY_FINAL_SCREAM_6 = 0x0140, + SFX_141_MECHANICAL_WINCH, + // pretty short + SFX_142_GRUNTY_LAUGH_3, + SFX_143_BULL_DAMAGE, + SFX_144_DOUBLE_CAMERA_CLICK, + SFX_145_SINGLE_CAMERA_CLICK, + // the normal attack + SFX_146_GRUNTY_SPELL_ATTACK_1, + // the homing attack + SFX_147_GRUNTY_SPELL_ATTACK_2, + SFX_148_GRUNTY_SPELL_LANDING, + SFX_149_CHEATO_TALKING_1, + SFX_14A_CHEATO_TALKING_2, + // when attacking with the broom + SFX_14B_GRUNTY_LAUGH_4, + SFX_14C_BRENTILDA_TALKING, + SFX_14D_BANJO_FREEZING, + SFX_14E_SOFT_EXPLOSION, + // grunty's spell attacks flying + SFX_14F_FIREWORK_WHISTLING, + SFX_150_PORCELAIN_CRASH, + // FileSelect, when Banjo's Bed ejects him + SFX_151_CAT_MEOW, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_152_MOTOR_BREAKDOWN_01, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_02, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_03, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_04, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_05, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_06, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_07, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_08, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_09, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_10, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_11, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_12, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_13, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_14, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_15 = 0x0160, + // Grunty's Broom; 01-16 getting shorter, more delay + SFX_MOTOR_BREAKDOWN_16, + // Grunty's Broom + SFX_162_MOTOR_RUCKUS, + SFX_163_GRUNTY_WILD_SCREAM, + SFX_164_EH, + // 00-15 getting increasingly delayed and shorter + SFX_HEAVY_THUNDERSTORM_01, + // 00-15 getting increasingly delayed and shorter + SFX_HEAVY_THUNDERSTORM_02, + // 00-15 getting increasingly delayed and shorter + SFX_HEAVY_THUNDERSTORM_03, + // 00-15 getting increasingly delayed and shorter + SFX_HEAVY_THUNDERSTORM_04, + // 00-15 getting increasingly delayed and shorter + SFX_HEAVY_THUNDERSTORM_05, + // 00-15 getting increasingly delayed and shorter + SFX_HEAVY_THUNDERSTORM_06, + // 00-15 getting increasingly delayed and shorter + SFX_HEAVY_THUNDERSTORM_07, + // 00-15 getting increasingly delayed and shorter + SFX_HEAVY_THUNDERSTORM_08, + // 00-15 getting increasingly delayed and shorter + SFX_HEAVY_THUNDERSTORM_09, + // 00-15 getting increasingly delayed and shorter + SFX_170_HEAVY_THUNDERSTORM_10 = 0x170, + // 00-15 getting increasingly delayed and shorter + SFX_171_HEAVY_THUNDERSTORM_11, + // 00-15 getting increasingly delayed and shorter + SFX_172_HEAVY_THUNDERSTORM_12, + // 00-15 getting increasingly delayed and shorter + SFX_173_HEAVY_THUNDERSTORM_13, + // 00-15 getting increasingly delayed and shorter + SFX_174_HEAVY_THUNDERSTORM_14, + // 00-15 getting increasingly delayed and shorter + SFX_175_HEAVY_THUNDERSTORM_15, + // 1-3 are having less and less echo + SFX_176_JINJONATOR_JINJOOO_1, + // 1-3 are having less and less echo + SFX_177_JINJONATOR_JINJOOO_2, + // 1-3 are having less and less echo + SFX_178_JINJONATOR_JINJOOO_3, + SFX_179_GRUNTY_DAMAGE, + SFX_17A_SHIPHORN, + SFX_17B_AIRPLANE_FALLING, + SFX_17C_GRUNTY_FALLING_OFF_1, + SFX_17D_GRUNTY_FALLING_OFF_2, + // 01-14 are getting slower and lower pitch + SFX_17E_MUMBO_TRANSFORMATION_01, + // 01-14 are getting slower and lower pitch + SFX_17F_MUMBO_TRANSFORMATION_02, + // 01-14 are getting slower and lower pitch + SFX_180_MUMBO_TRANSFORMATION_03, + // 01-14 are getting slower and lower pitch + SFX_181_MUMBO_TRANSFORMATION_04, + // 01-14 are getting slower and lower pitch + SFX_182_MUMBO_TRANSFORMATION_05, + // 01-14 are getting slower and lower pitch + SFX_183_MUMBO_TRANSFORMATION_06, + // 01-14 are getting slower and lower pitch + SFX_184_MUMBO_TRANSFORMATION_07, + // 01-14 are getting slower and lower pitch + SFX_185_MUMBO_TRANSFORMATION_08, + // 01-14 are getting slower and lower pitch + SFX_186_MUMBO_TRANSFORMATION_09, + // 01-14 are getting slower and lower pitch + SFX_187_MUMBO_TRANSFORMATION_10, + // 01-14 are getting slower and lower pitch + SFX_188_MUMBO_TRANSFORMATION_11, + // 01-14 are getting slower and lower pitch + SFX_189_MUMBO_TRANSFORMATION_12, + // 01-14 are getting slower and lower pitch + SFX_18A_MUMBO_TRANSFORMATION_13, + // 01-14 are getting slower and lower pitch + SFX_18B_MUMBO_TRANSFORMATION_14, + SFX_18C_EYRIE_MAMA, + SFX_18D_SEXY_GRUNTY_TALKING_1, + SFX_18E_SEXY_GRUNTY_TALKING_2, + SFX_18F_FREEZE_FRAME, + SFX_190_GULP = 0x0190, + SFX_191_STATIC, + + SFX_3E9_UNKNOWN = 0x3e9, //bsbwhirl + SFX_3EA_UNKNOWN, //chjig + SFX_3EB_UNKNOWN, //bstimeout + SFX_3EC_CCW_DOOR_OPENING, //ccw and GV opening + SFX_3ED, + SFX_3EE, + SFX_3EF, + + SFX_3F1_UNKNOWN = 0x3f1, //bsstand + SFX_3F2_UNKNOWN, //gold_chest_ttc + + SFX_3F5_UNKNOWN = 0x3F5, //RBB/code_5F80 + SFX_3F6_UNKNOWN, //lair/code_0 func_803880BC + SFX_3F7_UNKNOWN, //gv/histup + SFX_3F8_UNKNOWN, //gv/histup + SFX_3F9_UNKNOWN, //chmole + + SFX_3FB_UNKNOWN = 0x3fb, //conga + + SFX_40E_UNKNOWN = 0x40e, + + SFX_413_UNKNOWN = 0x413, //water ripple? + + SFX_415_UNKNOWN = 0x415, //xmas tree + SFX_416, + SFX_417_UNKNOWN = 0x417, //lair/func_8038EB94, double health + + SFX_419_UNKNOWN = 0x419, + SFX_41A_UNKNOWN = 0x41a +}; + + +enum level_e +{ + LEVEL_1_MUMBOS_MOUNTAIN = 0x1, + LEVEL_2_TREASURE_TROVE_COVE, + LEVEL_3_CLANKERS_CAVERN, + LEVEL_4_BUBBLEGLOOP_SWAMP, + LEVEL_5_FREEZEEZY_PEAK, + LEVEL_6_LAIR, + LEVEL_7_GOBIS_VALLEY, + LEVEL_8_CLICK_CLOCK_WOOD, + LEVEL_9_RUSTY_BUCKET_BAY, + LEVEL_A_MAD_MONSTER_MANSION, + LEVEL_B_SPIRAL_MOUNTAIN, + LEVEL_C_BOSS, + LEVEL_D_CUTSCENE +}; + +enum jiggy_e +{ + JIGGY_01_MM_JINJO = 0x1, + JIGGY_02_MM_TICKERS_TOWER, + JIGGY_03_MM_MUMBOS_SKULL, + JIGGY_4_MM_JUJU, + JIGGY_5_MM_HUTS, + JIGGY_06_MM_RUINS, + JIGGY_07_MM_HILL, + JIGGY_8_MM_ORANGE_PADS, + JIGGY_9_MM_CHIMPY, + JIGGY_A_MM_CONGA, + JIGGY_0B_TTC_JINJO, + JIGGY_0C_TTC_LIGHTHOUSE, + JIGGY_0D_TTC_ALCOVE_1, + JIGGY_0E_TTC_ALCOVE_2, + JIGGY_0F_TTC_POOL, + JIGGY_10_TTC_SANDCASTLE, + JIGGY_11_TTC_RED_X, + JIGGY_12_TTC_NIPPER, + JIGGY_13_TTC_LOCKUP, + JIGGY_14_TTC_BLUBBER, + JIGGY_15_CC_JINJO, + JIGGY_16_CC_SNIPPETS, + JIGGY_17_CC_CLANKER_RAISED, + JIGGY_18_CC_BOLT, + JIGGY_19_CC_TAIL, + JIGGY_1A_CC_LONG_PIPE, + JIGGY_1B_CC_TOOTH, + JIGGY_1C_CC_RINGS, + JIGGY_1D_CC_SLOW_SAWBLADES, + JIGGY_1E_CC_FAST_SAWBLADES, + JIGGY_1F_BGS_JINGO, + JIGGY_20_BGS_ELEVATED_WALKWAY, + JIGGY_21_BGS_PINKEGG, + JIGGY_22_CROCTUS, + JIGGY_23_BGS_HUTS, + JIGGY_24_BGS_FLIBBITS, + JIGGY_25_BGS_MAZE, + JIGGY_26_BGS_TANKTUP, + JIGGY_27_BGS_TIPTUP, + JIGGY_28_BGS_MR_VILE, + JIGGY_29_FP_JINJO, + JIGGY_2A_FP_BOGGY_1, + JIGGY_2B_FP_PIPE, + JIGGY_2C_FP_BOGGY_3, + JIGGY_2D_FP_SNOWMAN_BUTTONS, + JIGGY_2E_FP_PRESENTS, + JIGGY_2F_FP_XMAS_TREE, + JIGGY_30_FP_BOGGY_2, + JIGGY_31_FP_SIR_SLUSH, + JIGGY_32_FP_WOZZA, + JIGGY_33_LAIR_1ST_JIGGY, + JIGGY_34_LAIR_MM_WITCH_SWITCH, + JIGGY_35_LAIR_CC_WITCH_SWITCH, + JIGGY_36_LAIR_TTC_WITCH_SWITCH, + JIGGY_37_LAIR_BGS_WITCH_SWITCH, + JIGGY_38_LAIR_FP_WITCH_SWITCH, + JIGGY_39_LAIR_MMM_WITCH_SWITCH, + JIGGY_3A_LAIR_GV_WITCH_SWITCH, + JIGGY_3B_LAIR_RBB_WITCH_SWITCH, + JIGGY_3C_LAIR_CCW_WITCH_SWITCH, + JIGGY_3D_GV_JINJO, + JIGGY_3E_GV_GRABBA, + JIGGY_3F_GV_SHYINX, + JIGGY_40_GV_MATCHING_GAME, + JIGGY_41_GV_MAZE, + JIGGY_42_GV_WATER_PYRAMID, + JIGGY_43_GV_HISTUP, + JIGGY_44_GV_GOBI_1, + JIGGY_45_GV_GOBI_2, + JIGGY_46_GV_ANCIENT_ONES, + JIGGY_47_CCW_JINJO, + JIGGY_48_CCW_HOUSE, + JIGGY_49_CCW_EYRIE, + JIGGY_4A_CCW_NABNUT, + JIGGY_4B_CCW_GNAWTY, + JIGGY_4C_CCW_ZUBBAS, + JIGGY_4D_CCW_FLOWER, + JIGGY_4E_CCW_SUMMER_LEAF_JUMPS, + JIGGY_4F_CCW_TREE_TOP, + JIGGY_50_CCW_TOP_ROOM, + JIGGY_51_RBB_JINJO, + JIGGY_52_RBB_WAREHOUSE, + JIGGY_53_RBB_SNORKEL, + JIGGY_54_RBB_WHISTLE, + JIGGY_55_RBB_FUNNEL, + JIGGY_56_RBB_BOSS_BOOM_BOX, + JIGGY_57_RBB_PROPELLOR, + JIGGY_58_RBB_CAPTAINS_CABIN, + JIGGY_59_RBB_CRANE_CAGE, + JIGGY_5A_RBB_ENGINE_ROOM, + JIGGY_5B_MMM_JINJO, + JIGGY_5C_MMM_WELL, + JIGGY_5D_MMM_NAPPER, + JIGGY_5E_MMM_CELLAR, + JIGGY_5F_MMM_CHURCH_ROOF, + JIGGY_60_MMM_MOTZHAND, + JIGGY_61_MMM_RAIN_BARREL, + JIGGY_62_MMM_TUMBLAR, + JIGGY_63_MMM_FLOWER_POTS, + JIGGY_64_MMM_LOGGO +}; + +enum honeycomb_e +{ + HONEYCOMB_1_MM_HILL = 1, + HONEYCOMB_2_MM_JUJU, + HONEYCOMB_3_TTC_UNDERWATER, + HONEYCOMB_4_TTC_FLOATING_BOX, + HONEYCOMB_5_CC_UNDERWATER, + HONEYCOMB_6_CC_ABOVE_WATER, + HONEYCOMB_7_BGS_MUMBOS, + HONEYCOMB_8_BGS_TANKTUP, + HONEYCOMB_9_FP_WOZZAS_CAVE, + HONEYCOMB_A_FP_SIR_SLUSH, + HONEYCOMB_B_GV_CACTUS, + HONEYCOMB_C_GV_GOBI_3, + HONEYCOMB_D_CCW_GNAWTYS, + HONEYCOMB_E_CCW_NABNUTS, + HONEYCOMB_F_RBB_BOAT_HOUSE, + HONEYCOMB_10_RBB_ENGINE_ROOM, + HONEYCOMB_11_MMM_CHURCH_RAFTERS, + HONEYCOMB_12_MMM_FLOORBOARD, + HONEYCOMB_13_SM_STUMP, + HONEYCOMB_14_SM_WATERFALL, + HONEYCOMB_15_SM_UNDERWATER, + HONEYCOMB_16_SM_TREE, + HONEYCOMB_17_SM_COLIWOBBLE, + HONEYCOMB_18_SM_QUARRIES +}; + +enum actor_e +{ + ACTOR_4_BIGBUTT = 0x4, + + ACTOR_6_GRUBLIN = 0x6, + + ACTOR_8_CONGA = 0x8, + ACTOR_9_MM_HUT, + + ACTOR_B_SHOCKSPRING_PAD = 0xB, + ACTOR_C_MUD_HUT, + ACTOR_D_WOOD_DEMOLISHED, + ACTOR_E_BULL_INTRO, + ACTOR_F_CHIMPY = 0xF, + + ACTOR_11_JUJU_CTRL = 0x11, + ACTOR_12_BEEHIVE, + //ACTOR_13_SINKING_BOBBER + + ACTOR_14_ORANGE_PROJECTILE = 0x14, + + ACTOR_17_PLAYER_SHADOW = 0x17, + + ACTOR_1E_LEAKY = 0x1E, + + ACTOR_25_CEMETARY_POT = 0x25, + + ACTOR_29_ORANGE_COLLECTABLE = 0x29, + ACTOR_2A_GOLD_BULLION, + ACTOR_2B_GOLD_BULLION_THROW_TARGET, + ACTOR_2C_TURBO_TALON_TRAINERS, + + //ACTOR_2F_WATERFALL_START + //ACTOR_30_WATERFALL_END + + //ACTOR_37_WATER_BOBBER + //ACTOR_38_TUNBLAR_MOVEMENT + + ACTOR_39_NAPPER = 0x39, + ACTOR_3A_MOTZHAND, + + ACTOR_3D_CLANKER_SAWBLADE_PROPELLOR_1 = 0x3D, + ACTOR_3E_CLANKER_SAWBLADE_PROPELLOR_2, + ACTOR_3F_CLANKER_SAWBLADE_PROPELLOR_3, + ACTOR_40_CLANKER_SAWBLADE_PROPELLOR_4, + ACTOR_41_CLANKER_SAWBLADE_PROPELLOR_5, + ACTOR_42_CLANKER_SAWBLADE_PROPELLOR_6, + + ACTOR_44_CLANKER_TOKEN_TOOTH_EXTERIOR = 0x44, + ACTOR_45_CLANKER_JIGGY_TOOTH_EXTERIOR, + ACTOR_46_JIGGY, + ACTOR_47_EMPTY_HONEYCOMB, + + ACTOR_49_EXTRA_LIFE = 0x49, + + ACTOR_4A_WOOD_EXPLOSION = 0x4A, + + ACTOR_4C_STEAM = 0x4C, + ACTOR_4D_STEAM_2, + + ACTOR_50_HONEYCOMB = 0x50, + ACTOR_51_MUSIC_NOTE, + + ACTOR_53_RED_ARROW = 0x53, + ACTOR_54_RED_QUESTION_MARK, + ACTOR_55_RED_X, + + ACTOR_57_ORANGE_PAD = 0x57, + + ACTOR_59_JUJU = 0x59, + ACTOR_5A_JIGGY_IN_HAND, + + ACTOR_65_WADING_BOOTS = 0x65, + + ACTOR_69_CLAM = 0x69, + + ACTOR_6D_GV_BANJO_DOOR = 0x6D, + + ACTOR_C5_CHIMPY_STUMP = 0xC5, + + ACTOR_C8_BOGGY_2 = 0xC8, + + ACTOR_CA_TEEHEE = 0xCA, + + ACTOR_E4_FLIGHT_PAD = 0xE4, + + ACTOR_E6_GLOOP = 0xE6, + ACTOR_E7_GLOOP_BUBBLE, + + actor_leafboat = 0xF1, + + ACTOR_F4_BURIED_TREASURE = 0xF4, + + actor_bigalligator = 0xF6, + + ACTOR_101_CLANKER_TOKEN_TOOTH = 0x101, + ACTOR_102_CLANKER_JIGGY_TOOTH, + + ACTOR_114_CHURCH_DOOR = 0x114, + ACTOR_115_BLUBBER, + ACTOR_116_FP_SNOWMAN_BUTTON, + ACTOR_117_NIPPER, + ACTOR_118_GRABBA, + ACTOR_119_MAGIC_CARPET_1, + + ACTOR_11D_RUBEES_EGG_POT = 0x11D, + + ACTOR_11B_RUBEE = 0x11B, + + ACTOR_120_SLAPPA = 0x120, + + ACTOR_122_MAGIC_CARPET_SHADOW = 0x122, + ACTOR_123_MAGIC_CARPET_2, + ACTOR_124_SIR_SLUSH, + ACTOR_125_SNOWBALL, + ACTOR_126_SIR_SLUSH_HAT, + + ACTOR_12B_TUTORIAL_BOTTLES = 0x12B, + ACTOR_12C_MOLEHILL, + + ACTOR_12E_GOBI_1 = 0x12E, + ACTOR_12F_GOBI_ROPE, + + ACTOR_131_GOBI_2 = 0x131, + ACTOR_132_TRUNKER, + + ACTOR_135_GOBI_3 = 0x135, + ACTOR_136_YELLOW_FLIBBIT_CONTROLLER, + + actor_yumblie = 0x139, + + ACTOR_13E_LIGHTHOUSE_DOOR = 0x13E, + ACTOR_13F_GV_SUN_SWITCH, + ACTOR_140_GV_SUN_DOOR, + + ACTOR_142_GV_STAR_HATCH = 0x142, + ACTOR_143_GV_KAZOOIE_DOOR, + ACTOR_144_GV_STAR_SWITCH, + ACTOR_145_HONEYCOMB_SWITCH, + ACTOR_146_GV_KAZOOIE_TARGET, + ACTOR_147_ANCIENT_ONE, + + ACTOR_14F_DESTROYED_JIGGY = 0x14f, + + ACTOR_15F_XMAS_TREE = 0x15F, + ACTOR_160_BOGGY_1, + + ACTOR_164_COLLYWOBBLE_A = 0x164, + ACTOR_BAWL_A = 0x165, + ACTOR_TOPPER_A = 0x166, + ACTOR_ATTACK_TUTORIAL = 0x167, + + ACTOR_172_RBB_EGG_TOLL = 0x172, + + ACTOR_181_SCARF_SLED = 0x181, + ACTOR_182_RACE_SLED = 0x182, + + ACTOR_1CC_GRILL_CHOMPA = 0x1CC, + + ACTOR_1E4_TOOTS = 0x1E4, + + ACTOR_1EA_POLAR_BEAR_CUB_BLUE = 0x1EA, + ACTOR_1EB_POLAR_BEAR_CUB_GREEN, + ACTOR_1EC_POLAR_BEAR_CUB_RED, + ACTOR_1ED_BLUE_PRESENT_COLLECTABLE, + + ACTOR_1EF_GREEN_PRESENT_COLLECTABLE = 0x1EF, + + ACTOR_1F1_RED_PRESENT_COLLECTABLE = 0x1F1, + + ACTOR_1F3_WOZZA = 0x1F3, + ACTOR_1F4_WOZZAS_JIGGY, + ACTOR_1F5_GV_KAZOOIE_DOOR, + + ACTOR_1F7_JINXY = 0x1F7, + + ACTOR_1FA_CROCTUS = 0x1FA, + + ACTOR_204_MM_WITCH_SWITCH = 0x204, + + ACTOR_206_MMM_WITCH_SWITCH = 0x206, + + ACTOR_208_TTC_WITCH_SWITCH = 0x208, + + ACTOR_20B_RBB_WITCH_SWITCH = 0x20B, + + ACTOR_20E_MM_ENTRANCE_DOOR = 0x20E, + ACTOR_20F_RBB_ENTRANCE_DOOR, + ACTOR_210_BGS_ENTRANCE_DOOR, + ACTOR_211_CHEST_LID, //CC ENTRANCE + ACTOR_212_IRON_BARS, //TTC_ENTRANCE + + ACTOR_226_GV_ENTRANCE = 0x226, + + ACTOR_228_INVISIBLE_WALL = 0x228, //MMM ENTRANCE DOOR??? + + ACTOR_234_CCW_ENTRANCE_DOOR = 0x234, + ACTOR_235_FP_ENTANCE_DOOR, + + ACTOR_237_CCW_WITCH_SWITCH = 0x237, + + ACTOR_239_FP_WITCH_SWITCH = 0x239, + + ACTOR_243_GV_SNS_CHAMBER_DOOR = 0x243, + + ACTOR_245_GV_SNS_SWITCH = 0x245, + + ACTOR_256_GV_WITCH_SWITCH = 0x256, + ACTOR_257_BGS_WITCH_SWITCH = 0x257, + + ACTOR_25B_CC_WITCH_SWITCH = 0x25B, + ACTOR_25C_SHARKFOOD_ISLAND, + ACTOR_25D_ICE_KEY, + ACTOR_25E_SNS_EGG, + + ACTOR_28A_CLANKER_WHIPCRACK = 0x28A, + ACTOR_28B_SOUND_SOURCE, + + ACTOR_290_CLANKER_SAWBLADE_PROPELLOR_7 = 0x290, + ACTOR_291_CLANKER_SAWBLADE_PROPELLOR_8, + ACTOR_292_CLANKER_SAWBLADE_PROPELLOR_9, + ACTOR_293_CLANKER_SAWBLADE_PROPELLOR_10, + ACTOR_294_CLANKER_SAWBLADE_PROPELLOR_11, + ACTOR_295_CLANKER_SAWBLADE_PROPELLOR_12, + + ACTOR_29B_ZUBBA = 0x29B, + + ACTOR_29F_CLUCKER = 0x29F, + + ACTOR_2A2_CATERPILLAR = 0x2A2, + + ACTOR_2A8_NABNUT = 0x2A8, + ACTOR_2A9_ACORN, + + ACTOR_2E5_WOODEN_DOOR = 0x2e5, + + ACTOR_30F_WHIPCRACK = 0x30f, + + ACTOR_319_GV_MAZE_CTRL = 0x319, + + ACTOR_31D_SANDYBUTT_PYRAMID = 0x31D, + ACTOR_31E_PALM_TREE, + + ACTOR_332_TWINKLY_BLUE = 0x332, + ACTOR_333_TWINKLY_GREEN, + ACTOR_334_TWINKLY_ORANGE, + ACTOR_335_TWINKLY_RED, + + ACTOR_337_TWINKLY_MUNCHER = 0x337, + ACTOR_338_XMAS_TREE_SWITCH, + + ACTOR_33A_BLUE_PRESENT = 0x33A, + ACTOR_33B_GREEN_PRESENT, + ACTOR_33C_RED_PRESENT, + + ACTOR_33F_WOZZA_IN_CAVE = 0x33F, + + ACTOR_34D_BEE_SWARM = 0x34D, + + ACTOR_354_DRIPS = 0x354, + + ACTOR_368_5_MUMBO_TOKEN_SIGN = 0x368, + ACTOR_369_20_MUMBO_TOKEN_SIGN, + ACTOR_36A_15_MUMBO_TOKEN_SIGN, + ACTOR_36B_10_MUMBO_TOKEN_SIGN, + ACTOR_36C_25_MUMBO_TOKEN_SIGN, + + ACTOR_COLLYWOBBLE_B = 0x36D, + ACTOR_BAWL_B = 0x36E, + ACTOR_TOPPER_B = 0x36F, + + ACTOR_37A_BOTTLES = 0x37a, + + ACTOR_37F_LOGGO = 0x37F, + ACTOR_380_SCARAB_BEETLE, + ACTOR_381_PORTRAIT_CHOMPA, + ACTOR_382_PORTRAIT_OF_GRUNTY, + ACTOR_383_FIRE_FX, + ACTOR_384_PORTRAIT_OF_BLACKEYE, + ACTOR_385_PORTRAIT_OF_TOWER, + ACTOR_386_PORTRAIT_OF_TREE_AND_MOON, + ACTOR_387_PORTRAIT_OF_TEEHEE, + ACTOR_388_PORTRAIT_OF_MINION, + + ACTOR_39F_FIGHT_FLIGHT_PAD = 0x39F, + + ACTOR_3BA_UNKOWN = 0x3ba, + + ACTOR_3C1_PURPLE_TEEHEE = 0x3C1 +}; + +enum bs_e +{ + BS_1_IDLE = 0x1, + BS_2_WALK_SLOW, + BS_WALK = 0x3, + BS_WALK_FAST = 0x4, + BS_5_JUMP, + BS_CLAW = 0x6, + BS_CROUCH = 0x7, + BS_8_BTROT_JUMP, + BS_9_EGG_HEAD, + BS_A_EGG_ASS, + BS_B_UNKOWN, + BS_SKID = 0xC, + BS_D_TIMEOUT, + BS_E_OW, + BS_F_BBUSTER, + BS_BFLAP = 0x10, + BS_11_BPECK, + BS_12_BFLIP, + BS_BBARGE = 0x13, + BS_14_BTROT_ENTER, + BS_15_BTROT_IDLE, + BS_16_BTROT_WALK, + BS_17_BTROT_EXIT , + BS_18_FLY_KNOCKBACK, + + BS_1A_WONDERWING_ENTER = 0x1A, + BS_1B_WONDERWING_IDLE, + BS_1C_WONDERWING_WALK, + BS_1D_WONDERWING_JUMP, + BS_1E_WONDERWING_EXIT, + BS_WALK_CREEP = 0x1F, + BS_20_LANDING = 0x20, + BS_BSHOCK_CHARGE = 0x21, + BS_BSHOCK_JUMP = 0x22, + BS_23_FLY_ENTER, + BS_24_FLY, + BS_25_LONGLEG_ENTER, + BS_26_LONGLEG_IDLE = 0x26, + BS_LONGLEG_WALK = 0x27, + BS_LONGLEG_JUMP = 0x28, + BS_LONGLEG_EXIT = 0x29, + BS_BOMB = 0x2A, + BS_2B_DIVE_IDLE = 0x2B, + BS_2C_DIVE_B = 0x2C, + BS_2D_SWIM_IDLE = 0x2D, + BS_2E_SWIM = 0x2E, + BS_2F_FALL = 0x2F, + BS_30_DIVE_ENTER = 0x30, + BS_ROLL = 0x31, + BS_SLIDE = 0x32, + //unk33, + BS_34_JIG_NOTEDOOR = 0x34, + BS_35_ANT_IDLE, + BS_ANT_WALK = 0x36, + BS_ANT_JUMP = 0x37, + BS_38_ANT_FALL, + BS_39_DIVE_A, + BS_3A_CARRY_IDLE, + BS_CARRY_WALK = 0x3B, + BS_3C, + BS_3D_FALL_TUMBLING = 0x3D, + BS_3E_ANT_OW = 0x3E, + BS_3F, + //BS_PUMPKIN_unk40, + BS_41_DIE = 0x41, + BS_42_DINGPOT, + BS_43_ANT_DIE, + BS_44_JIG_JIGGY, + BS_45_BTROT_SLIDE, + //unk46 + //unk47 + BS_48_PUMPKIN_IDLE = 0x48, + BS_49_PUMPKIN_WALK = 0x49, + BS_4A_PUMPKIN_JUMP = 0x4A, + BS_4B_PUMPKIN_FALL = 0x4B, + BS_4C_LANDING_IN_WATER = 0x4c, + BS_4D_PUMPKIN_OW = 0x4D, + BS_4E_PUMPKIN_DIE = 0x4E, + BS_4F_CLIMB_IDLE, + BS_50_CLIMB_MOVE, + BS_51_CLIMB_EXIT, + //unk52 //tumblar??? a.k.a bssurf + BS_53_TIMEOUT = 0x53, + BS_54_SWIM_DIE = 0x54, + BS_LONGLEG_SLIDE = 0x55, + BS_56_RECOIL = 0x56, + BS_57_BOMB_END = 0x57, + BS_58, + BS_59_BFLY_UNK59 = 0x59, + BS_5A_LOADZONE = 0x5A, + BS_CARRY_THROW = 0x5B, + + BS_5E_CROC_IDLE = 0x5E, + BS_CROC_WALK = 0x5F, + BS_CROC_JUMP = 0x60, + BS_61_CROC_FALL = 0x61, + BS_LONGLEG_UNK62 = 0x62, + BS_CROC_OW = 0x63, + BS_CROC_DIE = 0x64, + + + BS_67_WALRUS_IDLE = 0x67, + BS_WALRUS_WALK = 0x68, + BS_WALRUS_JUMP = 0x69, + BS_6A_WALRUS_FALL = 0x6A, + //unk0x6B //[107] = "Locked", -- Bee, Mumbo Transform Cutscene + BS_WALRUS_OW = 0x6C, + BS_WALRUS_DIE = 0x6D, + BS_6E_CROC_BITE = 0x6E, + BS_CROC_EAT_BAD = 0x6F, + BS_70_CROC_EAT_GOOD = 0x70, + BS_71_BTROT_FALL = 0x71, + BS_SPLAT = 0x72, //get up after fall damage + //0x73 locked_cutscene + //0x74 locked jiggypad, xform, bottles + //0x75 locked bottles + BS_BFLY_UNK76 = 0x76, + BS_77 = 0x77, //0x77 locked swim + BS_78 = 0x78,//0x78 locked dive + //0x79 locked holding jiggy in tt + BS_WALK_MUD = 0x7A, + BS_BTROT_OW = 0x7B, + BS_7C_SLED, + BS_7D_WALRUS_SLED, + BS_7E_WALRUS_SLED, + BS_7F_DIVE_OW = 0x7F, + //BS_7D_WALRUS_SLED_LOSE = 0x80, + //BS_7D_WALRUS_SLED_LOCKED = 0x81, + BS_82_WALRUS_SLED_LOSE_IN_AIR = 0x82, + + BS_85_BEE_IDLE = 0x85, + BS_BEE_WALK = 0x86, + BS_BEE_JUMP = 0x87, + BS_88_BEE_FALL = 0x88, + BS_BEE_OW = 0x89, + BS_BEE_DIE = 0x8A, + + BS_BEE_FLY = 0x8c, + BS_CROC_LOCKED = 0x8D, + //0x8E, //[142] = "Locked", -- Jiggy podium, Bottles' text outside Mumbo's + BS_8F_PUMPKIN_LOCKED = 0x8F, + BS_FLY_OW = 0x91, + BS_ANT_DRONE = 0x92, + BS_93_PUMPKIN_DRONE = 0x93,//0x93 BS_8F_PUMPKIN_LOCKED_2? + BS_CROC_DRONE = 0x94, + BS_WALRUS_DRONE = 0x95, + BS_96_SWIM_LOCKED = 0x96, + BS_97_DIVE_LOCKED = 0x97, + BS_WALK_DRONE = 0x98, + BS_BFLY_UNK99= 0x99, + BS_BTROT_DRONE = 0x9A, + BS_LONGLEG_DRONE = 0x9B, + BS_7D_WALRUS_SLED_DRONE = 0x9C, + BS_BEE_DRONE = 0x9D, + BS_9E_CLIMB_UNKOWN_9E, + BS_ANT_BOUNCE = 0x9F, + BS_PUMPKIN_BOUNCE = 0xA0, + BS_CROC_BOUNCE = 0xA1, + BS_WALRUS_BOUNCE = 0xA2, + BS_BEE_BOUNCE = 0xA3, + BS_A4_WONDERWING_DRONE = 0xA4, + BS_A5_WONDERWING_UNKA5 +}; + +enum map_flags_e +{ + mapflag_mm_main_hit_with_orange = 8 +}; + +enum item_e +{ + ITEM_0_HOURGLASS_TIMER = 0x0, + ITEM_1_SKULL_HOURGLASS_TIMER, + + ITEM_3_PROPELLOR_TIMER = 0x3, + + ITEM_5_XMAS_TREE_TIMER = 0x5, + ITEM_6_HOURGLASS, + ITEM_7_SKULL_HOURGLASS, + + + ITEM_9_PROPELLOR = 0x9, + + ITEM_B_XMAS_TREE = 0xb, + ITEM_C_NOTE = 0xC, + ITEM_D_EGGS, + ITEM_E_JIGGY, + ITEM_F_RED_FEATHER, + ITEM_10_GOLD_FEATHER, + + ITEM_12_JINJOS = 0x12, + ITEM_13_EMPTY_HONEYCOMB, + ITEM_14_HEALTH, + ITEM_15_HEALTH_TOTAL, + ITEM_16_LIFE, + ITEM_17_AIR, + ITEM_18_GOLD_BULLIONS, + ITEM_19_ORANGE, + ITEM_1A_PLAYER_VILE_SCORE, + ITEM_1B_VILE_VILE_SCORE, + ITEM_1C_MUMBO_TOKEN, + ITEM_1D_GRUMBLIE, + ITEM_1E_YUMBLIE, + ITEM_1F_GREEN_PRESENT, + ITEM_20_BLUE_PRESENT, + ITEM_21_RED_PRESENT, + ITEM_22_CATERPILLAR, + ITEM_23_ACORNS, + ITEM_24_TWINKLY_SCORE, + ITEM_25_MUMBO_TOKEN_TOTAL, + ITEM_26_JIGGY_TOTAL, + ITEM_27_JOKER_CARD, + + ITEM_2B_UNKNOWN = 0x2B //uses jiggy model +}; + +enum animctrl_direction_e +{ + mvmt_dir_forwards = 1 +}; + +enum game_mode_e +{ + GAME_MODE_3_NORMAL = 3, + GAME_MODE_4_PAUSED = 4, + GAME_MODE_6_FILE_PLAYBACK = 6, + GAME_MODE_7_ATTRACT_DEMO = 7, + GAME_MODE_8_BOTTLES_BONUS = 8, + GAME_MODE_9_BANJO_AND_KAZOOIE = 9, + GAME_MODE_A_SNS_PICTURE = 10 +}; + +enum asset_e +{ + ANIM_BANJO_CROUCH_ENTER = 0x1, + ANIM_BANJO_WALK_CREEP = 0x2, + ANIM_BANJO_WALK = 0x3, + + ANIM_BANJO_BTROT_EXIT = 0x7, + ANIM_BANJO_JUMP = 0x8, + ASSET_9_ANIM_BANJO_DIE = 0x9, + ASSET_A_ANIM_BANJO_CLIMB_MOVE, + ANIM_BANJO_WALK_MUD, + ANIM_BANJO_RUN, + + ANIM_BANJO_TURN = 0xe, + + ASSET_10_ANIM_BIGBUTT_RUN = 0x10, + ANIM_BANJO_WONDERWING_WALK = 0x11, + + + ANIM_BANJO_LONGLEG_ENTER_AS_BEAR = 0x16, + ANIM_BANJO_BFLAP = 0x17, + + ANIM_BANJO_BPECK_ENTER = 0x19, + ANIM_BANJO_BPECK = 0x1A, + ANIM_BANJO_WONDERWING_JUMP = 0x1B, + ANIM_BANJO_BBARGE = 0x1C, + ANIM_BANJO_BBUSTER = 0x1D, + + ASSET_21_ANIM_BIGBUTT_SLIDE = 0x21, + ANIM_BANJO_WONDERWING_EXIT = 0x22, + ANIM_BANJO_WONDERWING_IDLE = 0x23, + + ANIM_BANJO_BTROT_IDLE = 0x26, + ANIM_BANJO_BTROT_JUMP = 0x27, + ANIM_TERMITE_OW = 0x28, + ANIM_TERMITE_DIE = 0x29, + + ANIM_BANJO_BJIG_JIGGY = 0x2e, + + ASSET_32_ANIM_BIGBUTT_ATTACK = 0x32, + ASSET_33_ANIM_BIGBUTT_EAT, + ASSET_34_ANIM_BIGBUTT_DIE, + ASSET_35_ANIM_BIGBUTT_ALERT, + ASSET_36_ANIM_BIGBUTT_WALK, + + ANIM_BANJO_FLY = 0x38, + + ANIM_BANJO_LONGLEG_JUMP = 0x3D, + + ANIM_BANJO_LONGLEG_ENTER_AS_BIRD = 0x40, + ANIM_BANJO_LONGLEG_IDLE = 0x41, + ANIM_BANJO_LONGLEG_WALK = 0x42, + ASSET_43_ANIM_BANJO_BEAKBOMB_START, + + ANIM_BANJO_FLY_ENTER = 0x45, + + ANIM_BANJO_BSHOCK_CHARGE = 0x48, + ANIM_BANJO_BSHOCK_JUMP = 0x49, + + ANIM_BANJO_BFLIP = 0x4B, + + ANIM_BANJO_OW = 0x4D, + anim_mudhut_smashing = 0x4E, + ANIM_BANJO_ROLL = 0x4F, + + ASSET_51_ANIM_CONGA_IDLE = 0x51, + ASSET_52_ANIM_CONGA_OW, + ASSET_53_ANIM_CONGA_DEFEAT, + ASSET_54_ANIM_CONGA_THROW, + ASSET_55_ANIM_CONGA_BEAT_CHEST, + ASSET_56_ANIM_CONGA_RAISE_ARMS, + + ANIM_BANJO_SLIDE_BACK = 0x59, + ANIM_BANJO_SLIDE_FRONT = 0x5A, + + ANIM_TERMITE_IDLE = 0x5E, + ANIM_TERMITE_WALK = 0x5F, + ANIM_TERMITE_JUMP = 0x60, + + ASSET_65_ANIM_BEEHIVE_DIE = 0x65, + + ASSET_94_ANIM_GRUBLIN_DIE = 0x94, + + ASSET_9E_ANIM_TEEHEE_IDLE = 0x9E, + ASSET_9F_ANIM_TEEHEE_ALERTED, + + ASSET_A3_ANIM_NAPPER_SLEEPING = 0xA3, + ASSET_A4_ANIM_NAPPER_AWAKE, + + ASSET_A9_ANIM_FLOWER_POT = 0xA9, + + ASSET_AC_ANIM_TEEHEE_CHASE = 0xAC, + + ASSET_B1_ANIM_BANJO_CLIMB_IDLE_1 = 0xb1, + ASSET_B2_ANIM_BANJO_CLIMB_IDLE_2, + + ASSET_C3_ANIM_CLANKER_IDLE = 0xC3, + ASSET_C4_ANIM_CLANKER_BITE, + ASSET_C5_ANIM_GRABBA_APPEAR, + ASSET_C6_ANIM_GRABBA_HIDE, + ASSET_C7_ANIM_GRABBA_IDLE, + ASSET_C8_ANIM_GRABBA_DEFEATED, + + ASSET_CA_ANIM_GLOOP_SWIMMING = 0xCA, + ASSET_CB_ANIM_GLOOP_BLOWING_BUBBLE, + ASSET_CC_ANIM_BANJO_BEAKBOMB_END, + + ASSET_D2_ANIM_BANJO_GETTING_UP = 0xD2, + + ASSET_D4_ANIM_SWITCH_DOWN = 0xD4, + ASSET_D5_ANIM_SWITCH_UP, + + ASSET_DB_ANIM_FLIBBIT_HOP = 0xDB, + ASSET_DC_ANIM_GOBI_ROPE_PULLING, + ASSET_DD_ANIM_GOBI_ROPE, + + // ASSET_E5_ANIM_SLAPPA_APPEAR = 0xE5, + // ASSET_E6_ANIM_SLAPPA_IDLE, + // ASSET_E7_ANIM_SLAPPA_HIDE, + // ASSET_E8_ANIM_SLAPPA_DIE, + + ASSET_ED_ANIM_ANCIENT_ONE = 0xED, + + ASSET_F0_ANIM_MINI_SHPYNX_EATING = 0xF0, + ASSET_F1_ANIM_MAGIC_CARPET, + + ASSET_F4_ANIM_GOBI_IDLE = 0xF4, + + ASSET_F8_ANIM_GOBI_RUNNING = 0xF8, + + ASSET_FA_ANIM_FLIBBIT_IDLE = 0xFA, + ASSET_FB_ANIM_FLIBBIT_TURN, + ASSET_FC_ANIM_GOBI_SPITTING, + ASSET_FD_ANIM_GOBI2_GETTING_UP, + ASSET_FE_ANIM_TRUCKER_SHORT, + ASSET_FF_ANIM_TRUCKER_GROW, + + ASSET_100_ANIM_GOBI_SPIT = 0x100, + + ASSET_108_ANIM_SIR_SLUSH_IDLE = 0x108, + ASSET_109_ANIM_SIR_SLUSH_ATTACK, + + ANIM_BANJO_CROUCH = 0x10C, + + ASSET_112_ANIM_FLIBBIT_DIE = 0x112, + ASSET_113_ANIM_FLIBBIT_DEAD, + + ANIM_BANJO_CROUCH_NOINPUT = 0x116, + + ASSET_125_ANIM_YUMBLIE_APPEAR = 0x125, + ASSET_126_ANIM_YUMBLIE_HIDE, + ASSET_127_ANIM_YUMBLIE_IDLE, + ASSET_128_ANIM_GRUMBLIE_APPEAR, + ASSET_129_ANIM_GRUMBLIE_HIDE, + ASSET_12A_ANIM_GRUMBLIE_IDLE, + ASSET_12B_ANIM_TIPTUP_IDLE, + ASSET_12C_ANIM_TIPTUP_TAPPING, + + ASSET_132_ANIM_FLOTSAM_MOVE = 0x132, + + ASSET_138_ANIM_ZOOMBOX = 0x138, + ASSET_139_ANIM_BOTTLES_EXIT, + ASSET_13A_ANIM_BOTTLES_ENTER, + ASSET_13B_ANIM_BOTTLES_IDLE, + + ASSET_13E_ANIM_SNORKEL_SWIM = 0x13E, + ASSET_13F_ANIM_SNORKEL_STUCK, + + ASSET_141_ANIM_ANCHOR_LOWERED = 0x141, + ASSET_142_ANIM_ANCHOR_RISING, + ASSET_143_ANIM_SNOWMAN_BUTTON, + + ASSET_146_ANIM_BOSS_BOOMBOX_APPEAR = 0x146, + ASSET_147_ANIM_BOOMBOX_MOVE, + ASSET_148_ANIM_BOOMBOX_DIE, + + ASSET_153_ANIM_BURIED_TREASURE_APPEAR = 0x153, + + ASSET_15A_ANIM_GRILL_CHOMPA_ATTACK = 0x15A, + ASSET_15B_ANIM_GRILL_CHOMPA_DIE, + ASSET_15C_ANIM_CLANKER_WHIPCRACK_IDLE, + ASSET_15D_ANIM_CLANKER_WHIPCRACK_ATTACK, + + ASSET_162_ANIM_TOOTS_IDLE = 0x162, + + ASSET_164_ANIM_TOOTS_SING = 0x164, + ASSET_165_ANIM_BEEHIVE_IDLE, + ASSET_166_ANIM_BURIED_TREASURE_BOUNCE, + + ASSET_16F_ANIM_ZUBBA_FLY_MOVE = 0x16F, + ASSET_170_ANIM_ZUBBA_FLY_IDLE, + ASSET_171_ANIM_ZUBBA_DIE, + ASSET_172_ANIM_ZUBBA_LAND, + + ASSET_176_ANIM_GOBI_YAWN = 0x176, + ASSET_177_ANIM_GOBI_SLEEP, + + ASSET_17C_ANIM_TWINKLY_IDLE = 0x17C, + ASSET_17D_ANIM_POLAR_BEAR_CUB_HAPPY = 0x17D, + ASSET_17E_ANIM_POLAR_BEAR_CUB_SAD, + + ASSET_184_ANIM_CLUCKER_ATTACK_SHORT = 0x184, + ASSET_185_ANIM_CLUCKER_ATTACK_LONG, + ASSET_186_ANIM_CLUCKER_DIE, + + ASSET_189_ANIM_FLOTSAM_DIE = 0x189, + ASSET_18A_XMAS_GIFT, + + ASSET_18E_ANIM_CATERPILLAR_IDLE = 0x18E, + + ASSET_1A1_ANIM_SLED = 0x1A1, + ASSET_1A2_ANIM_NABNUT_SLEEP, + + ASSET_1AF_ANIM_TWINKLY_MUNCHER_APPEAR = 0x1AF, + ASSET_1B0_ANIM_TWINKLY_MUNCHER_DIE, + ASSET_1B1_ANIM_TWINKLY_MUNCHER_IDLE, + ASSET_1B2_ANIM_TWINKLY_MUNCHER_ATTACK, + + ASSET_1DC_ANIM_BEE_FLY = 0x1dc, + ASSET_1DD_ANIM_BEE_WALK, + ASSET_1DE_ANIM_BEE_IDLE, + + ASSET_1E0_ANIM_BEE_OW = 0x1e0, + ASSET_1E1_ANIM_BEE_DIE, + ASSET_1E2_ANIM_BEE_JUMP, + + ASSET_220_ANIM_SIR_SLUSH_DIE = 0x220, + ASSET_221_ANIM_WOZZA_IN_CAVE, + + ASSET_228_ANIM_BANJO_SLED = 0x228, + ASSET_229_ANIM_WHIPCRACK_ATTACK, + ASSET_22A_ANIM_WHIPCRACK_IDLE, + ASSET_22B_ANIM_NABNUT_FAT, + ASSET_22C_ANIM_NAMBUT_CRY, + ASSET_22D_ANIM_NAMBUT_BACKFLIP, + ASSET_22E_ANIM_NAMBUT_STAND, + ASSET_22F_ANIM_NAMBUT_RUN, + + ASSET_233_ANIM_ICECUBE = 0x233, + + ASSET_238_ANIM_LOGGO_IDLE = 0x238, + + ASSET_240_ANIM_LOGGO_FLUSH = 0x240, + + ASSET_242_ANIM_GOBI_RELAXING = 0x242, + + ASSET_253_ANIM_BIGBUTT_OW = 0x253, + ASSET_254_ANIM_BIGBUTT_FALL, + ASSET_255_ANIM_BIGBUTT_GET_UP, + + ASSET_25B_ANIM_ACORN_IDLE = 0x25B, + + ASSET_281_ANIM_WISHYWASHY_DOOOH = 0x281, + + ASSET_288_ANIM_FLIBBIT_OW = 0x288, + + ASSET_2AB_ANIM_TEEHEE_DIE = 0x2AB, + + ASSET_2D2_MODEL_ORANGE = 0x2d2, //projectile + + ASSET_2E6_MODEL_JUJU = 0x2e6, + + ASSET_2EB_MODEL_ORANGE_PAD = 0x2eb, + + ASSET_301_MODEL_5_MUMBO_TOKEN_SIGN = 0x301, + ASSET_302_MODEL_10_MUMBO_TOKEN_SIGN, + ASSET_303_MODEL_15_MUMBO_TOKEN_SIGN, + ASSET_304_MODEL_20_MUMBO_TOKEN_SIGN, + ASSET_305_MODEL_25_MUMBO_TOKEN_SIGN, + + ASSET_309_MODEL_CLANKER_TOKEN_TOOTH_EXTERIOR = 0x309, + ASSET_30A_MODEL_CLANKER_JIGGY_TOOTH_EXTERIOR, + + + ASSET_34F_MODEL_BANJO_TERMITE = 0x34F, + ASSET_350_MODEL_TERMITE, + ASSET_351_MODEL_CLAM, + ASSET_352_MODEL_SLED, + ASSET_353_MODEL_BIGBUTT, + ASSET_354_MODEL_BULL_INTRO, + + ASSET_356_MODEL_BANJO_WISHYWASHY = 0x356, + + ASSET_359_MODEL_BANJO_WALRUS = 0x359, + + ASSET_35C_MODEL_CONGA = 0x35c, + ASSET_35D_MODEL_CHIMPY = 0x35d, + + ASSET_35F_MODEL_JIGGY = 0x35F, + + ASSET_361_MODEL_EMPTY_HONEYCOMB = 0x361, + ASSET_362_MODEL_BANJO_BEE, + ASSET_363_MODEL_HONEYCOMB, + ASSET_364_MODEL_BEEHIVE, + + ASSET_366_MODEL_WADING_BOOTS = 0x366, + ASSET_367_MODEL_TURBO_TALON_TRAINERS, + + ASSET_36D_SPRITE_BLUE_EGG = 0x36D, + ASSET_36E_MODEL_EXTRA_LIFE, + ASSET_36F_MODEL_BANJO_PUMPKIN, + ASSET_370_MODEL_BLUBBER, + ASSET_371_MODEL_GRABBA, + ASSET_372_MODEL_GLOOP, + + ASSET_374_MODEL_BANJO_CROC = 0x374, + + ASSET_376_MODEL_SLAPPA = 0x376, + ASSET_377_MODEL_SIR_SLUSH, + ASSET_378_MODEL_SNOWBALL, + + ASSET_387_MODEL_BOTTLES = 0x387, + ASSET_388_MODEL_MOLEHILL, + + ASSET_38A_MODEL_BOGGY_1 = 0x38A, + + ASSET_3A9_MODEL_PALM_TREE = 0x3A9, + + ASSET_3AE_MODEL_GRAVE_FLOWER_POT = 0x3AE, + + ASSET_3BF_MODEL_PLAYER_SHADOW = 0x3BF, + + ASSET_3C5_MODEL_GRUBLIN = 0x3c5, + + ASSET_3C7_MODEL_GOLD_BULLION = 0x3c7, + ASSET_3C8_MODEL_CHIMPY_STUMP, + + ASSET_3CB_MODEL_TEEHEE = 0x3cb, + + ASSET_3D5_MODEL_NIPPER = 0x3d5, + ASSET_3D6_MODEL_LIGHTHOUSE_DOOR = 0x3d5, + + ASSET_3D7_MODEL_STAR_SWITCH = 0x3d7, + ASSET_3D8_MODEL_GV_BANJO_DOOR, + ASSET_3D9_MODEL_GV_KAZOOIE_DOOR, + + ASSET_3DB_MODEL_GV_STAR_HATCH = 0x3db, + ASSET_3DC_MODEL_MAGIC_CARPET, + ASSET_3DD_MODEL_RUBEE, + ASSET_3DE_MODEL_HISTUP, + ASSET_3DF_MODEL_TRUNKER, + ASSET_3E0_MODEL_GOBI, + ASSET_3E1_MODEL_RUBEES_EGG_POT = 0x3E1, + ASSET_3E2_MODEL_GV_KAZOOIE_TARGET = 0x3E2, + ASSET_3E3_MODEL_GOBI_ROPE, + + ASSET_3E7_MODEL_MAGIC_CARPET_SHADOW = 0x3e7, + ASSET_3E8_MODEL_ANCIENT_ONE, + ASSET_3E9_MODEL_RED_ARROW, + ASSET_3EA_MODEL_RED_X, + ASSET_3EB_MODEL_RED_QUESTION_MARK, + + ASSET_3F3_MODEL_GOBI_SPIT = 0x3F3, + + ASSET_3F6_MODEL_YUMBLIE = 0x3F6, + ASSET_3F7_MODEL_GRUMBLIE, + + ASSET_3FF_MODEL_GV_SUN_DOOR = 0x3FF, + ASSET_400_MODEL_SUN_SWITCH, + + ASSET_402_MODEL_RBB_EGG_TOLL = 0x402, + + ASSET_41A_SPRITE_MUMBO_TOKEN = 0x41A, + + ASSET_421_MODEL_FP_SNOWMAN_BUTTON = 0x421, + ASSET_422_MODEL_JINXY, + + ASSET_425_MODEL_CROCTUS = 0x425, + + ASSET_42C_MODEL_BURIED_TREASURE = 0x42C, + + ASSET_430_MODEL_GRILL_CHOMPA = 0x430, + + ASSET_432_MODEL_CLANKER_WHIPCRACK = 0x432, + + ASSET_434_MODEL_TOOTS = 0x434, + + ASSET_438_MODEL_HONEYCOMB_SWITCH = 0x438, + + ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR = 0x43A, + + ASSET_446_MODEL_ZUBBA = 0x446, + + ASSET_448_MODEL_TWINKLY_BLUE = 0x448, + ASSET_449_MODEL_TWINKLY_GREEN, + ASSET_44A_MODEL_TWINKLY_ORANGE, + ASSET_44B_MODEL_TWINKLY_RED, + ASSET_44C_MODEL_POLAR_BEAR_CUB_BLUE, + ASSET_44D_MODEL_POLAR_BEAR_CUB_GREEN, + ASSET_44E_MODEL_POLAR_BEAR_CUB_RED, + + ASSET_45A_SPRITE_GREEN_GLOW = 0x45A, + + ASSET_476_SPRITE_BLUE_GLOW = 0x476, + ASSET_477_SPRITE_YELLOW_GLOW, + + + ASSET_47B_MODEL_ROCK = 0x47b, + + ASSET_47F_MODEL_XMAS_GIFT_BLUE = 0x47F, + ASSET_480_MODEL_XMAS_GIFT_GREEN, + ASSET_481_MODEL_XMAS_GIFT_RED, + ASSET_482_MODEL_CLUCKER, + ASSET_483_MODEL_EAGLE_EGG, + ASSET_484_MODEL_EAGLE_BABY, + ASSET_485_MODEL_CATERPILLAR, + ASSET_486_MODEL_XMAS_TREE_SWITCH, + ASSET_487_MODEL_EAGLE_ADULT, + ASSET_488_MODEL_XMAS_TREE, + ASSET_489_MODEL_SHOCKSPRING_PAD, + ASSET_48A_MODEL_FLIGHT_PAD, + ASSET_48B_MODEL_JIGGY_PODIUM, + + ASSET_48E_MODEL_ACORN = 0x48E, + + ASSET_494_MODEL_WOZZA = 0x494, + ASSET_495_MODEL_WOZZAS_JIGGY, + ASSET_496_MODEL_TWINKLY_MUNCHER, + ASSET_497_MODEL_TWINKLY_SHARD_BLUE, + ASSET_498_MODEL_TWINKLY_SHARD_YELLOW, + ASSET_499_MODEL_TWINKLY_SHARD_GREEN = 0x499, + ASSET_49A_MODLE_TWINKLY_SHARD_ORANGE, + ASSET_49B_MODLE_TWINKLY_SHARD_RED, + + ASSET_4A0_SPRITE_EXPLOSION = 0x4A0, + + ASSET_4D4_MODEL_TWINKLY_BOX_PAPER_SHARD = 0x4D4, + + ASSET_4DC_MODEL_WITCH_SWITCH = 0x4DC, + + MODEL_TOPPER = 0x4ed, + MODEL_COLLYWOBBLE = 0x4ee, + MODEL_BAWL = 0x4ef, + + ASSET_4FD_MODEL_WHIPCRACK = 0x4fd, + ASSET_4FE_MODEL_WHIPCRACK_PART_1, + ASSET_4FF_MODEL_WHIPCRACK_PART_2, + ASSET_500_MODEL_WHIPCRACK_PART_3, + + ASSET_502_MODEL_NABNUT = 0x502, + + ASSET_504_MODEL_ICECUBE = 0x504, + ASSET_505_MODEL_ICECUBE_CHUNK, + + ASSET_50A_MODEL_SHARKFOOD_ISLAND = 0x50A, + + ASSET_50C_MODEL_ICE_KEY = 0x50C, + ASSET_50D_MODEL_SNS_EGG, + + ASSET_514_MODEL_GV_SNS_CHAMBER_DOOR = 0x514, + ASSET_515_MODEL_GV_SNS_SWITCH, + + ASSET_519_MODEL_LOGGO = 0x519, + ASSET_51A_MODEL_LEAKY, + ASSET_51B_MODEL_SCARAB_BEETLE, + ASSET_51C_MODEL_SCARAB_BEETLE_PART_1, + + ASSET_51E_MODEL_SCARAB_BEETLE_PART_2 = 0x51e, + ASSET_51F_MODEL_SCARAB_BEETLE_PART_3, + ASSET_520_MODEL_SCARAB_BEETLE_PART_4, + ASSET_521_MODEL_PORTRAIT_CHOMPA, + ASSET_522_MODEL_PORTRAIT_OF_GRUNTY, + ASSET_523_MODEL_PORTRAIT_CHOMPA_TEETH, + ASSET_524_MODEL_PORTRAIT_CHOMPA_HEAD, + ASSET_525_MODEL_PORTRAIT_CHOMPA_PART, + ASSET_526_SPRITE_FIRE, + ASSET_527_MODEL_PORTRAIT_OF_BLACKEYE, + ASSET_528_MODEL_PORTRAIT_OF_TOWER, + ASSET_529_MODEL_PORTRAIT_OF_TREE_AND_MOON, + ASSET_52A_MODEL_PORTRAIT_OF_TEEHEE, + ASSET_52B_MODEL_PORTRAIT_OF_MINION, + + ASSET_52D_MODEL_GRUBLIN_HOOD_HAT = 0x52D, + + ASSET_55E_MODEL_NAPPER = 0x55E, + + ASSET_564_MODEL_PURPLE_TEEHEE = 0x564, + + ASSET_580_SPRITE_RED_FEATHER = 0x580, + + ASSET_56B_MODEL_SANDYBUTT_PYRAMID = 0x56B, + + ASSET_6C1_SPRITE_SMOKE = 0x6C1, + ASSET_6C2_SPRITE_SMOKE_WHITE, + ASSET_6C3_SPRITE_SMOKE_GREEN, + ASSET_6C4_SPRITE_SMOKE_YELLOW, + ASSET_6C5_SPRITE_SMOKE_ORANGE, + ASSET_6C6_SPRITE_SMOKE_PINK, + ASSET_6C7_SPRITE_SMOKE_GREEN_2, + ASSET_6C8_SPRITE_SMOKE_BLUE, + ASSET_6C9_SPRITE_SMOKE_GREEN_BIG, + + ASSET_6D1_SPRITE_GOLDFEATHTER = 0x6d1, + + ASSET_6D6_MODEL_MUSIC_NOTE = 0x6d6, + + ASSET_6D9_SPRITE_PROPELLOR_TIMER = 0x6d9, + ASSET_6DA_SPRITE_HOURGLASS, + ASSET_6DB_SPRITE_SKULL_HOURGLASS, + ASSET_6DC_SPRITE_XMAS_TREE_TIMER, + + SPRITE_DIALOG_FONT_ALPHAMASK = 0x6eb, + SPRITE_BOLD_FONT_LETTERS_ALPHAMASK = 0x6ec, + SPRITE_BOLD_FONT_NUMBERS_ALPHAMASK = 0x6ed, + + ASSET_700_SPRITE_DUST = 0x700, + ASSET_701_SPRITE_LENS_SHUTTER_MASK, + ASSET_702_SPRITE_UNKNOWN, + + ASSET_708_SPRITE_EGG_PROJECTILE = 0x708, + + ASSET_70A_SPRITE_BUBBLE_1 = 0x70a, + ASSET_70B_SPRITE_BUBBLE_2 = 0x70b, + ASSET_70C_SPRITE_RIPPLE = 0x70c, + ASSET_70D_SPRITE_SMOKE_1 = 0x70d, + ASSET_70E_SPRITE_SMOKE_2 = 0x70e, + + ASSET_710_SPRITE_SPARKLE_PURPLE = 0x710, + ASSET_711_SPRITE_SPARKLE_DARK_BLUE, + + + ASSET_713_SPRITE_SPARKLE_YELLOW = 0x713, + + ASSET_715_SPRITE_SPARKLE_RED = 0x715, + ASSET_716_SPRITE_SPARKLE_WHITE, + ASSET_717_SPRITE_SPARKLE_YELLOW_2, + ASSET_718_SPRITE_SPARKLE_WHITE_2, + ASSET_719_SPRITE_SPARKLE_GREEN_2, + ASSET_71A_SPRITE_SPARKLE_PINK_2, + ASSET_71B_SPRITE_SPARKLE_ORANGE_2, + + + + ASSET_7D7_MODEL_MM_HUT = 0x7d7, + ASSET_7D8_MODEL_MM_HUT_TOP, + ASSET_7D9_SPRITE_NOTE, + + ASSET_7DD_SPRITE_HEALTH = 0x7dd, + + ASSET_7E6_SPRITE_VILE = 0x7e6, + ASSET_7E7_SPRITE_CROC_BANJO, + + ASSET_7EE_JOKER_CARD = 0x7ee, + + ASSET_88C_MODEL_MOTZHAND = 0x88c, + + ASSET_88E_MODEL_CLANKER_CHAIN = 0x88e, + + ASSET_891_MODEL_CLANKER_TOKEN_TOOTH_OPEN = 0x891, + ASSET_892_MODEL_CLANKER_TOKEN_TOOTH_CLOSED, + ASSET_893_MODEL_CLANKER_JIGGY_TOOTH_OPEN, + ASSET_894_MODEL_CLANKER_JIGGY_TOOTH_CLOSED, + + + ASSET_896_MODEL_GOLD_ROCK = 0x896, + + ASSET_89D_ZOOMBOX_SPRITE = 0x89d, + + ASSET_8A0_SPRITE_WATER_DROP = 0x8a0, + + ASSET_A17_TEXT_BURIED_TREASURE_SPAWNED = 0xa17, + + ASSET_A6F_TEXT_CHARMER_MEET = 0xA6F, + ASSET_A70_TEXT_CHARMER_HELPED, + ASSET_A71_TEXT_TRUNKER_MEET, + ASSET_A72_TEXT_TRUNKER_HELPED, + ASSET_A73_TEXT_GOBI_MEET, + ASSET_A74_TEXT_GOBI_HELPED, + ASSET_A75_TEXT_GOBI2_MEET, + ASSET_A76_TEXT_GOBI2_DONE, + ASSET_A77_TEXT_GOBI3_DONE, + ASSET_A78_TEXT_GRABBA_MEET, + ASSET_A79_TEXT_GRABBA_DEFEAT, + ASSET_A7A_TEXT_GRABBA_TOO_FAST, + ASSET_A7B_TEXT_JINXY_MEET, + ASSET_A7C_TEXT_JINXY_ONE_EGG, + ASSET_A7D_TEXT_JINXY_HELPED, + ASSET_A7E_TEXT_SAND_EELS_MEET, + ASSET_A7F_TEXT_ANICIENT_ONES_MEET, + ASSET_A80_TEXT_ANICIENT_ONES_DONE, + ASSET_A81_TEXT_SANDYBUTT_ENTER, + ASSET_A82_TEXT_SANDYBUTT_START_MAZE, + ASSET_A83_TEXT_SANDYBUTT_DONE, + + ASSET_ADE_TEXT_LOGGO_AS_BEAR = 0xade, + ASSET_ADF_TEXT_ENTER_LOGGO, + ASSET_AE0_TEXT_EXIT_LOGGO, + + ASSET_B37_TEXT_CONGA_SAFE_UP_HERE = 0xb37, + ASSET_B38_TEXT_CONGA_DEFEAT, + ASSET_B39_TEXT_CONGA_HIT_BY_EGG, + ASSET_B3A_TEXT_CONGA_HITS_PLAYER, + ASSET_B3B_TEXT_CONGA_ORANGE_PAD_JIGGY, + ASSET_B3C_TEXT_CONGA_MEET, + + ASSET_B3E_TEXT_CONGA_MEET_AS_TERMITE = 0xb3e, + + ASSET_B44_TEXT_JUJU_MEET = 0xb44, + ASSET_B45_TEXT_JIGGY_COLLECT_10, + + ASSET_B51_TEXT_BOTTLES_HOW_TO_EXIT_LEVEL = 0xb51, + + ASSET_C15_TEXT_TWINKLIE_MINIGAME_LOST = 0xc15, + + text_flibbits_meet = 0xc81, + text_flibbits_defeat = 0xc82, + text_flibbits_return = 0xc83, + + ASSET_D34_TEXT_GLOOP_MEET = 0xd34, + + ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH = 0xd39, + + ASSET_D96_TEXT_BEEHIVE = 0xd96, + + ASSET_DA6_TEXT_BEEHIVE_WITH_BEES = 0xda6 + +}; + +enum overlay_e{ + OVERLAY_1_COSHOW = 0x1, + OVERLAY_2_WHALE = 0x2, + OVERLAY_3_HAUNTED = 0x3, + OVERLAY_4_DESERT = 0x4, + OVERLAY_5_BEACH = 0x5, + OVERLAY_6_JUNGLE = 0x6, + OVERLAY_7_SWAMP = 0x7, + OVERLAY_8_SHIP = 0x8, + OVERLAY_9_SNOW = 0x9, + OVERLAY_A_TREE = 0xA, + OVERLAY_B_TRAINING = 0xB, + OVERLAY_C_INTRO = 0xC, + OVERLAY_D_WITCH = 0xD, + OVERLAY_E_BATTLE = 0xE +}; + +enum marker_e{ + MARKER_5_GRUBLIN = 0x5, + + MARKER_7_CONGA = 0x7, + + MARKER_A_CHIMPY = 0xA, + + MARKER_C_ORANGE_PROJECTILE = 0xC, + + MARKER_11_WADING_BOOTS = 0x11, + + MARKER_15_CLAM = 0x15, + + MARKER_32_PLAYER_SHADOW = 0x32, + MARKER_33_LEAKY, + MARKER_34_CEMETARY_POT, + + MARKER_36_ORANGE_COLLECTABLE = 0x36, + MARKER_37_GOLD_BULLION, + MARKER_38_TURBO_TALON_TRAINERS, + + MARKER_3B_SCARF_SLED = 0x3B, + MARKER_3C_RACE_SLED, + + MARKER_48_NAPPER = 0x48, + MARKER_49_MOTZHAND, + + MARKER_4C_CLANKER_TOKEN_TOOTH_EXT = 0x4C, + MARKER_4D_CLANKER_JIGGY_TOOTH_EXT, + + MARKER_51_MM_HUT = 0x51, + MARKER_52_JIGGY, + MARKER_53_EMPTY_HONEYCOMB, + + MARKER_55_HONEYCOMB = 0x55, + + MARKER_5F_MUSIC_NOTE = 0x5F, + + MARKER_61_EXTRA_LIFE = 0x61, + MARKER_62_RED_ARROW, + MARKER_63_RED_QUESTION_MARK, + MARKER_64_RED_X, + + MARKER_66_ORANGE_PAD = 0x66, + MARKER_67_JUJU = 0x67, + + MARKER_6A_GLOOP = 0x6A, + + MARKER_95_CHIMPY_STUMP = 0x95, + + MARKER_A3_BLUBBER = 0xA3, + + MARKER_A5_NIPPER = 0xA5, + MARKER_A6_GRABBA, + MARKER_A7_MAGIC_CARPET_1, + + MARKER_A9_RUBEE = 0xA9, + + MARKER_AB_RUBEES_EGG_POT = 0xAB, + + MARKER_AD_SLAPPA = 0xAD, + + MARKER_AF_MAGIC_CARPET_SHADOW = 0xAF, + MARKER_B0_MAGIC_CARPET_2, + + MARKER_B7_TUTORIAL_BOTTLES = 0xB7, + + MARKER_B9_FP_SNOWMAN_BUTTON = 0xB9, + MARKER_BA_XMAS_TREE, + + MARKER_BC_GOBI_1 = 0xBC, + MARKER_BD_GOBI_ROPE, + + MARKER_BF_GOBI_2 = 0xBF, + MARKER_C0_TRUNKER, + + MARKER_C3_GOBI_3 = 0xC3, + + MARKER_DB_BURIED_TREASURE = 0xDB, + + MARKER_EA_LIGHTHOUSE_DOOR = 0xEA, + MARKER_EB_GV_BANJO_DOOR, + MARKER_EC_GV_SUN_SWITCH, + MARKER_ED_GV_SUN_DOOR, + + MARKER_EF_GV_STAR_HATCH = 0xEF, + MARKER_F0_GV_KAZOOIE_DOOR, + MARKER_F1_GV_STAR_SWITCH, + MARKER_F2_HONEYCOMB_SWITCH, + MARKER_F3_GV_KAZOOIE_TARGET, + MARKER_F4_ANCIENT_ONE, + + MARKER_F8_GV_KAZOOIE_DOOR = 0xF8, + MARKER_F9_JINXY, + + MARKER_FC_CROCTUS = 0xFC, + + MARKER_FE_MMM_CLOCK_SWITCH = 0xFE, + + MARKER_103_MM_WITCH_SWITCH = 0x103, + MARKER_104_MMM_WITCH_SWITCH, + MARKER_105_TTC_WITCH_SWITCH, + MARKER_106_RBB_WITCH_SWITCH, + + MARKER_11B_WATER_LEVEL_SWITCH_1 = 0x11B, + MARKER_11C_WATER_LEVEL_SWITCH_2, + MARKER_11D_WATER_LEVEL_SWITCH_3, + + MARKER_124_BOGGY_1 = 0x124, + + MARKER_12B_ATTACK_TUTORIAL = 0x12B, + + MARKER_161_GV_WITCH_SWITCH = 0x161, + MARKER_162_BGS_WITCH_SWITCH, + + MARKER_166_CC_WITCH_SWITCH = 0x166, + MARKER_167_SHARKFOOD_ISLAND, + MARKER_168_ICE_KEY, + MARKER_169_SNS_EGG, + + MARKER_182_RBB_EGG_TOLL = 0x182, + + MARKER_1AE_ZUBBA = 0x1AE, + + MARKER_1B5_CATERPILLAR = 0x1B5, + + MARKER_1BB_NABNUT = 0x1BB, + + MARKER_1CD_GV_MAZE_CTRL = 0x1CD, + + MARKER_1D4_SANDYBUTT_PYRAMID = 0x1D4, + MARKER_1D5_PALM_TREE, + + MARKER_1E9_MUMBO_COST_SIGN = 0x1E9, + + MARKER_1F4_TOOTS = 0x1F4, + + MARKER_1FA_POLAR_BEAR_CUB_BLUE = 0x1FA, + MARKER_1FB_POLAR_BEAR_CUB_GREEN, + MARKER_1FC_POLAR_BEAR_CUB_RED, + MARKER_1FD_BLUE_PRESENT_COLLECTABLE, + MARKER_1FE_GREEN_PRESENT_COLLECTABLE, + MARKER_1FF_RED_PRESENT_COLLECTABLE, + MARKER_200_TWINKLY_BLUE, + MARKER_201_TWINKLY_GREEN, + MARKER_202_TWINKLY_ORANGE, + MARKER_203_TWINKLY_RED, + + MARKER_205_TWINKLY_MUNCHER = 0x205, + + MARKER_208_BLUE_PRESENT = 0x208, + MARKER_209_GREEN_PRESENT, + MARKER_20A_RED_PRESENT, + MARKER_20B_WOZZA, + MARKER_20C_WOZZAS_JIGGY, + + MARKER_20F_WOZZA_IN_CAVE = 0x20F, + + MARKER_22A_CCW_WITCH_SWITCH = 0x22A, + MARKER_22B_FP_WITCH_SWITCH, + + MARKER_23A_GV_SNS_CHAMBER_DOOR = 0x23A, + + MARKER_23C_GV_SNS_SWITCH = 0x23C, + + MARKER_23F_LAIR_FLIGHT_PAD_SWITCH = 0x23F, + + MARKER_252_LOGGO = 0x252, + + MARKER_254_PORTRAIT_CHOMPA = 0x254, + MARKER_255_PORTRAIT_OF_GRUNTY, + + MARKER_257_PORTRAIT_OF_BLACKEYE = 0x257, + MARKER_258_PORTRAIT_OF_TOWER, + MARKER_259_PORTRAIT_OF_TREE_AND_MOON, + MARKER_25A_PORTRAIT_OF_TEEHEE, + MARKER_25B_PORTRAIT_OF_MINION +}; + +enum hitbox_e{ + HITBOX_0_NONE, + HITBOX_1_BEAK_BUSTER, + HITBOX_2_BEAK_BARGE, + HITBOX_3_BEAK_BOMB, + HITBOX_4_CLAW, + HITBOX_5_PECK, + HITBOX_6_WONDERWING, + HITBOX_7_ROLL, + HITBOX_8_CLAW_DOWN, + HITBOX_9_CROC_BITE, + HITBOX_A_FAST_FALLING +}; + +enum collision_e{ + COLLISION_0_TOUCH, + COLLISION_1_OW, + COLLISION_2_DIE +}; + +enum ff_question_type_e{ + FFQT_0_TEXT, + FFQT_1_PICTURE, + FFQT_2_SOUND, + FFQT_3_GRUNTY, + FFQT_4_MINIGAME +}; + +enum common_particle_e{ + COMMON_PARTICLE_1_EGG_HEAD = 1, + COMMON_PARTICLE_4_EGG_ASS = 4 +}; + +enum bsgroup_e { + BSGROUP_3_WONDERWING = 0x3, + + BSGROUP_5_CLIMB = 0x5, + BSGROUP_6_TURBO_TALON_TRAINERS, + BSGROUP_7_CROC_ATTACK, + BSGROUP_8_TROT, + BSGROUP_9_LONG_LEG, + BSGROUP_A_FLYING, + BSGROUP_B_ATTACKING, + BSGROUP_C_WALRUS_SLED, + BSGROUP_D_TRANSFORMING +}; + +enum bswatergroup_e{ + BSWATERGROUP_0_NONE, + BSWATERGROUP_1_SURFACE, + BSWATERGROUP_2_UNDERWATER +}; + +enum misc_flag_e{ + MISC_FLAG_1_ON_FLIGHT_PAD = 0x1, + MISC_FLAG_2_ON_SPRING_PAD, + + MISC_FLAG_E_TOUCHING_WADING_BOOTS = 0xE, + + MISC_FLAG_10_TOUCHING_TURBO_TRAINERS = 0x10, + + MISC_FLAG_1B_TRANSFORMING = 0x1B +}; + +#endif diff --git a/include/functions.h b/include/functions.h new file mode 100644 index 00000000..acc0ec22 --- /dev/null +++ b/include/functions.h @@ -0,0 +1,590 @@ +#ifndef FUNCTIONS_H +#define FUNCTIONS_H + +#include + +#include "enums.h" +#include "structs.h" +#include "string.h" +#include "rand.h" + +#include "prop.h" + +#include "core1/core1.h" +#include "core2/core2.h" + +#include "ml.h" +#include "ml/mtx.h" +#include "bs_funcs.h" + +extern f32 fabsf(f32); +#pragma intrinsic (fabsf) + +typedef void (* GenMethod_0)(void); +typedef void (* GenMethod_1)(s32); +typedef void (* GenMethod_4)(s32, s32, s32, s32); +#define NOT(boolean) ((boolean) ^ 1) + +#define TUPLE_ASSIGN(out, a, b, c) {\ + out[0] = a;\ + out[1] = b;\ + out[2] = c;\ +} + +#define TUPLE_COPY(dst, src) {\ + dst[0] = src[0];\ + dst[1] = src[1];\ + dst[2] = src[2];\ +} + +#define v3Copy(dst, src) {\ + dst[0] = src[0];\ + dst[1] = src[1];\ + dst[2] = src[2];\ +} + +#define TUPLE_OP(out, a, op, b) {\ + out##_x = a##_x op b##_x;\ + out##_y = a##_y op b##_y;\ + out##_z = a##_z op b##_z;\ +} + +//known it uses "+" instead of "|" for fight/code_9D40.c, func_8039049C, case 6 +#define FUNC_8030E624(sfx_e, vol, sample_rate) func_8030E624(\ + _SHIFTL((vol*1023), 21, 11) + _SHIFTL(sample_rate >> 5, 11, 10) + _SHIFTL(sfx_e, 0, 11)\ +) + +#define FUNC_8030E8B4(sfx_e, vol, sample_rate, position, e, f) func_8030E8B4(\ + _SHIFTL((vol*1023), 21, 11) + _SHIFTL(sample_rate >> 5, 11, 10) + _SHIFTL(sfx_e, 0, 11), \ + position, \ + _SHIFTL(f, 16, 16) + _SHIFTL(e, 0, 16) \ +) + +void func_80241304(Mtx *m, float x, float y, float z); + +void _guMtxIdentF_80245D44(float mf[4][4]); //static should NOT be here + +void * malloc(s32 size); +void free(void*); +void *realloc(void* ptr, s32 size); + +f32 ml_map_f(f32 val, f32 in_min, f32 in_max, f32 out_min, f32 out_max); +float mlNormalizeAngle(float); +f32 max_f(f32, f32); +f32 min_f(f32, f32); +void ml_vec3f_copy(f32 dst[3], f32 src[3]); + +void ml_vec3f_add(f32 dst[3], f32 src1[3], f32 src2[3]); +void ml_vec3f_scale(f32 vec[3], f32 scale); +void ml_vec3f_scale_copy(f32 dst[3], f32 src[3], f32 scale); + +float gu_sqrtf(float val); + +BKSpriteFrame *spriteGetFramePtr(BKSprite *, u32); + +bool baanim_isAt(f32); +void func_8028A180(enum asset_e anim_id, f32 duration); +void func_8028A37C(f32); + +int player_inWater(void); + +ActorMarker *_player_getMarker(void); + +u32 player_getTransformation(void); + +void func_8028E7EC(f32 arg0[3]); + +void _player_getPosition(f32 dst[3]); +void player_getPosition(f32 dst[3]); +void player_getRotation(f32 *dst); + +void func_80291A60(s32 arg0, f32* arg1); + +int button_pressed(s32); +u32 button_held(s32); + +void pitch_setIdeal(f32); +f32 pitch_get(void); +f32 player_getYPosition(void); + +void func_80297970(f32); + +f32 func_80297AAC(void); + +void climbGetBottom(f32 dst[3]); + +void yaw_setIdeal(f32); + +void func_80299BFC(f32); + +f32 roll_get(void); + +f32 yaw_get(void); +f32 yaw_getIdeal(void); + +/* core2/code_13780.c */ +void bs_clearState(void); +void bs_setState(s32 state_id); +s32 bs_getPrevState(void); +s32 bs_getState(void); +s32 bs_getNextState(void); +void bs_updateState(void); +s32 bs_checkInterrupt(s32 arg0); +void func_8029A86C(s32 arg0); +s32 bs_getInterruptType(void); + +/* vla - variable length array*/ +void vector_clear(VLA *this); +void * vector_getBegin(VLA *this); +void * vector_at(VLA *this, u32 n); +s32 vector_getIndex(VLA *this, void *element); +s32 vector_size(VLA *this); +void * vector_getEnd(VLA *this); +void * vector_pushBackNew(VLA **thisPtr); +void * vector_insertNew(VLA **thisPtr, s32 indx); +void vector_free(VLA *this); +VLA * vector_new(u32 elemSize, u32 cnt); +void vector_remove(VLA *this, u32 indx); +void vector_popBack_n(VLA *this, u32 n); +void vector_assign(VLA *this, s32 indx, void* value); +VLA * vector_defrag(VLA *this); + + +void actor_collisionOff(Actor *); + +void *assetcache_get(s32 arg0); + +Actor *actor_new(s32 (*position)[3], s32 yaw, ActorInfo *actorInfo, u32 flags); +Actor *func_802C8A54(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags); +Actor *func_802C8AA8(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags); +Actor *func_802C8AF8(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags); +Actor *func_802C8B4C(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags); +Actor *func_802C8BA8(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags); +Actor *func_802C8C04(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags); + +Actor *marker_getActor(ActorMarker *); + +f32 time_getDelta(void); +void jiggySpawn(u32 indx, f32 pos[3]); + +struct3s *func_802F8264(s32 arg0); +struct6s *func_802F8BE0(s32 arg0); +struct8s *func_802FD320(enum asset_e item_id); +void func_802FD330(enum item_e, struct8s *); +void func_802FD33C(enum item_e arg0, struct8s *arg1, Gfx **arg2, Mtx **arg3, Vtx **arg4); +void func_802FD350(enum item_e item_id, struct8s *); + +struct8s *func_802FD7B0(enum item_e); +void func_802FD80C(s32, struct8s *); +void func_802FDAF4(enum item_e, struct8s *, Gfx**, Mtx**, Vtx **); +void func_802FDC80(enum item_e, struct8s *); + +struct8s *func_802FDE2C(s32); +void func_802FE844(s32, struct8s *); +void func_802FDEE0(s32, struct8s *, Gfx**, Mtx**, s32*); +void func_802FDDC4(s32, struct8s *); + +struct8s *func_802FF090(s32); +void func_802FFA50(s32, struct8s *); +void func_802FF3B8(s32, struct8s *, Gfx**, Mtx**, s32); +void func_802FF358(s32, struct8s *); + +struct8s *func_802FFE4C(s32); +void func_803005BC(s32, struct8s *); +void func_802FFF34(enum item_e, struct8s *, Gfx**, Mtx**, Vtx **); +void func_802FFED4(s32, struct8s *); + +void *fxcommon3score_new(enum item_e); +void fxcommon3score_update(enum item_e, void *); +void fxcommon3score_draw(enum item_e, void *, Gfx**, Mtx**, Vtx **); +void fxcommon3score_free(enum item_e item_id, void *); + +struct8s *func_80300CD8(s32); +void func_80301348(s32, struct8s *); +void func_80300D0C(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80300C70(s32, struct8s *); + + +struct8s *func_8030179C(s32); +void func_80301DE4(s32, struct8s *); +void func_803017D0(s32, struct8s *, Gfx**, Mtx**, s32); +void func_80301754(s32, struct8s *); + + + + +void marker_despawn(ActorMarker *marker); + +Actor * spawn_child_actor(enum actor_e id, Actor ** parent); + + +void func_80324D2C(f32, enum comusic_e); +void func_80324DBC(f32 time, enum asset_e text_id, s32 arg2, f32 position[3], ActorMarker *caller, void (*callback_method_1)(ActorMarker *, enum asset_e, s32), void (*callback_method_2)(ActorMarker *, enum asset_e, s32)); +void particleEmitter_setSprite(ParticleEmitter *, enum asset_e); +void particleEmitter_setPosition(ParticleEmitter *, f32[3]); +ParticleEmitter *partEmitList_pushNew(u32); +void func_802BB3DC(s32, f32, f32); +void func_802C3F04(GenMethod_4, s32, s32, s32, s32); +Actor *func_802C4140(enum actor_e actor_id, s32 x, s32 y, s32 z); +void func_8030DA44(u8); + + +void func_802EF3F4(ParticleEmitter *, f32[3], f32[3], s32); +ParticleEmitter *particleEmitter_new(u32 capacity); +void particleEmitter_setParticleAccelerationRange(ParticleEmitter *, f32, f32, f32, f32, f32, f32); +void func_802EF9F8(ParticleEmitter *, f32); +void func_802EFA18(ParticleEmitter *, s32); +void func_802EFA5C(ParticleEmitter *, f32, f32); +void func_802EFA70(ParticleEmitter *, s32); +void particleEmitter_setStartingFrameRange(ParticleEmitter *this, s32 arg1, s32 arg2); +void particleEmitter_setParticleFramerateRange(ParticleEmitter *, f32, f32); +void particleEmitter_setParticleSpawnPositionRange(ParticleEmitter *, f32, f32, f32, f32, f32, f32); +void func_802EFB70(ParticleEmitter *, f32, f32); +void func_802EFB84(ParticleEmitter *, f32, f32); +void func_802EFB98(ParticleEmitter *, struct31s *); +void particleEmitter_setVelocityAndAccelerationRanges(ParticleEmitter *, struct41s *); +void particleEmitter_setPositionAndVelocityRanges(ParticleEmitter *this, struct42s *arg1); +void func_802EFE24(ParticleEmitter *, f32, f32, f32, f32, f32, f32); +void particleEmitter_setSpawnIntervalRange(ParticleEmitter *, f32, f32); +void func_802EFEC0(ParticleEmitter *, f32, f32); +void particleEmitter_setParticleVelocityRange(ParticleEmitter *, f32, f32, f32, f32, f32, f32); +void func_802EFF50(ParticleEmitter *, f32); +void func_802EFFA8(ParticleEmitter *this, s32 arg1[3]); +void particleEmitter_setSpawnInterval(ParticleEmitter *, f32); + +int func_8024DC04(f32, f32, f32); +void func_8024E3A8(f32 [3], f32); +OSMesgQueue *func_8024F344(void); + +void ml_vec3f_clear(f32 dst[3]); +void ml_vec3f_roll_rotate_copy(f32[3], f32[3], f32); +void func_80250D94(f32, f32, f32); +void func_80256E24(f32[3], f32, f32, f32, f32, f32); +void func_8025727C(f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2, f32 *o1, f32 *o2); +f32 func_80257A44(f32, f32); +f32 func_80257C48(f32, f32, f32); +f32 func_80257D30(f32, f32, f32, f32, f32); +int func_80257F18(f32 src[3], f32 target[3], f32 *yaw); +bool func_8025801C(f32[3], f32*); + +f32 mlAbsF(f32); +f32 mlClamp_f(f32, f32, f32); +f32 func_802588B0(f32, f32); +void func_802589E4(f32 dst[3], f32 yaw, f32 length); +f32 mlDiffDegF(f32, f32); + +void func_8025A6EC(enum comusic_e, s32); +void func_8025A70C(enum comusic_e); +void comusic_8025AB44(enum comusic_e comusic_id, s32 arg1, s32 arg2); + +f32 cosf(f32); + +struct54s * func_80287CA8(void); +void func_80287F50(struct54s *, struct53s *, s32); +void func_80287FD0(struct54s *, f32); +void func_80287F7C(struct54s *arg0, s32 arg1); +void func_80287F98(struct54s *arg0, s32 arg1); +void func_80287FDC(struct54s *arg0, s32 arg1); + +void func_80289EA8(f32, f32); + + +void func_8028A010(enum asset_e anim_id, f32 duration); +void func_8028A100(enum asset_e anim_id, f32, f32); +void func_8028A1F4(enum asset_e anim_id, f32 duration, f32 arg2); +void func_8028A274(enum asset_e, f32); +void func_8028A3B8(f32, f32); +int func_8028AED4(f32*, f32); +void func_8028E668(f32[3], f32, f32, f32); +f32 func_8028E80C(s32); +bool func_8028F364(f32[3], f32, f32, enum actor_e actor_id, Actor**); +void func_8028FA54(f32[3]); + +f32 func_802915D8(void); +f32 func_80291604(void); +f32 func_80291670(s32); +f32 func_80291684(s32); +int func_80291698(s32); +int func_80291700(s32, f32); +void func_802917E4(s32, f32); + +void func_80292078(s32, f32); +void func_80292158(f32); +f32 func_80292230(void); + + +void func_802927E0(f32, f32); +void func_80292974(f32, f32, f32); +void func_80292900(f32, f32); + +void func_80292E80(s32, f32); +void func_80293350(void); +void func_80293D48(f32, f32); +f32 func_80294438(void); +f32 func_80294500(void); +Struct60s *func_802946F0(void); +void func_80294980(f32 arg0[3]); +f32 get_slope_timer(void); +f32 func_80294A40(void); +void func_80295C08(void (* arg0)(void)); +void func_802978DC(int); +void func_80297970(f32); +void func_8029797C(f32); +void player_setYVelocity(f32); +void func_802979AC(f32, f32); +f32 func_80297A64(void); +f32 func_80297A70(void); +f32 func_80297A7C(void); +f32 func_80297AB8(void); +f32 func_80297AF0(void); +void gravity_set(f32); +void func_80297B64(f32); +void func_80297BF8(f32); +int func_80297C04(f32); +void func_80297CCC(f32); +f32 pitch_getIdeal(void); +void pitch_setAngVel(f32, f32); +void func_80298528(f32); +f32 func_802987C4(void); +f32 func_802987D4(void); +f32 func_802987E4(void); +void roll_setIdeal(f32); +void roll_setAngularVelocity(f32, f32); +void yaw_set(f32); +void yaw_applyIdeal(void); +void func_80299234(f32, f32); +void func_80299254(f32); +void func_8029932C(f32); +void func_80299594(s32, f32); +void func_80299628(s32); +void func_80299650(f32, f32); +void func_80299B58(f32, f32); +void func_80299CF4(enum sfx_e, f32, s32); +void func_80299D2C(enum sfx_e, f32, s32); +void func_80289EC8(f32, f32, f32, f32); +void func_80289EF8(f32); +f32 func_8029A900(void); +f32 func_8029A90C(void); +void func_8029A968(f32); +void func_8029A980(s32); +void func_8029A974(f32); +void func_8029AD28(f32, s32); +f32 func_8029B2DC(void); +f32 func_8029B2E8(void); +f32 func_8029B30C(void); +void func_8029B324(s32, f32); +f32 func_8029B33C(void); +f32 func_8029B41C(void); +ParticleEmitter *func_8029B950(f32[3],f32); +void func_8029C3E8(f32, f32); +void func_8029CF48(s32, s32, f32); +f32 func_8029DFC8(void); +f32 func_8029DFD4(void); +void func_8029E090(bool, f32); +void func_8029E0C4(f32); +void func_8029E0D0(f32); +void func_8029E180(s32, f32); +void func_8029E3C0(s32, f32); +f32 func_8029E270(s32); +void func_802BD8A4(f32, f32, f32); +f32 func_802BD8D4(void); +void func_802BE244(f32, f32); +void func_802BE230(f32, f32); +void func_802BF2C0(f32); +f32 func_802B6F9C(void); + +void func_802C1B20(f32); +int func_802C1DB0(f32); + +void func_802D6264(f32, enum map_e, s32, s32, s32, enum bkprog_e); + +Actor *func_802DC7E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +void particleEmitter_emitN(ParticleEmitter *, int); +void func_802EFA20(ParticleEmitter *, f32, f32); + +ParticleEmitter *func_802F0D74(ParticleEmitter *); +ParticleEmitter *func_802F4094(f32[3], f32); + + +extern s32 func_802F9AA8(enum sfx_e); + + +Actor * func_803055E0(enum actor_e id, s32 pos[3], s32 arg2, s32 arg3, s32 arg4); +Actor * func_803056FC(enum actor_e id, s32 pos[3], s32 yaw); +f32 func_80309724(f32[3]); +BKModelBin *func_8030A428(s32); +u8 func_8030D90C(void); +void sfxsource_setSfxId(u8 indx, enum sfx_e uid); +void func_8030DBB4(u8, f32); +void func_8030DD14(u8, int); +void func_8030DF68(u8, f32[3]); +void func_8030DFF0(u8, s32); +void func_8030E04C(u8, f32, f32, f32); +void func_8030E0FC(u8, f32, f32, f32); +f32 func_8030E200(u8); +void func_8030E2C4(u8); +void func_8030E394(u8 indx); +void func_8030E484(enum sfx_e uid); +void func_8030E4E4(enum sfx_e uid); +void func_8030E510(enum sfx_e uid, s32 arg1); +void func_8030E540(enum sfx_e uid); +void func_8030E560(enum sfx_e uid, s32 arg1); +void func_8030E58C(enum sfx_e uid, f32 arg1); +void func_8030E5F4(enum sfx_e uid, f32 arg1); +void func_8030E624(u32); +void func_8030E6A4(enum sfx_e uid, f32 arg1, s32 arg2); +void func_8030E6D4(enum sfx_e uid); +void func_8030E704(enum sfx_e uid); +void func_8030E760(enum sfx_e uid, f32 arg1, s32 arg2); +void func_8030E878(enum sfx_e uid, f32 arg1, u32 arg2, f32 arg3[3], f32 arg4, f32 arg5); +void func_8030E8B4(u32,f32 [3], u32); +void func_8030E988(enum sfx_e uid, f32 arg1, u32 arg2, f32 arg3[3], f32 arg4, f32 arg5); +void func_8030E9C4(enum sfx_e uid, f32 arg1, u32 arg2, f32 arg3[3], f32 arg4, f32 arg5); +void func_8030EAAC(enum sfx_e uid, f32 arg1, s32 arg2, s32 arg3); +void func_8030EB00(enum sfx_e uid, f32, f32); +void func_8030EB88(enum sfx_e uid, f32 arg1, f32 arg2); +void func_8030EBC8(enum sfx_e uid, f32 arg1, f32 arg2, s32 arg3, s32 arg4); +void func_8030EC20(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, u32 arg4); +u8 func_8030ED2C(enum sfx_e uid, s32 arg1); + +void func_80320044(s32, s32, s32); +Actor *func_80325300(ActorMarker *marker, f32 rotation[3]); +Actor *func_80325934(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +Actor *func_80325E78(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +void func_80326244(Actor *); + +void func_8032728C(f32[3], f32, s32, int(*)(Actor *)); + +Actor *func_8032813C(enum actor_e actor_id, f32 position[3], s32 yaw); +int func_8032863C(AnimCtrl *, f32, f32); +int func_80328A2C(Actor *, f32, s32, f32); +void func_80328A84(Actor *, u32); +ActorMarker *func_8032B16C(enum jiggy_e jiggy_id); +int func_80328B38(Actor *, s32, f32); +void func_80328B8C(Actor * this, s32 myAnimId, f32 arg2, s32 direction); +int func_80328BD4(Actor *, s32, f32, s32, f32 ); +void func_80328CEC(Actor *, s32, s32, s32); +void func_80328FB0(Actor *, f32); +int func_80329030(Actor *, s32); +int func_80329078(Actor *, s32, s32); +int func_80329480(Actor *); +s32 func_80329784(Actor *); +void func_80329878(Actor *, f32); +struct5Bs *func_80329934(void); +Actor *func_8032A7AC(Actor *); +Prop *func_8032F528(void); +ActorMarker *func_8032FBE4(f32 *pos, MarkerDrawFunc arg1, int arg2, enum asset_e model_id); + +void func_803300D8(ActorMarker *, void (*)(Actor *)); +void marker_setCollisionScripts(ActorMarker *this, MarkerCollisionFunc ow_func, MarkerCollisionFunc arg2, MarkerCollisionFunc die_func); +BKModelBin * func_80330B1C(ActorMarker *marker); +BKVertexList *func_80330C74(Actor *actor); +BKModelBin * func_80330DE4(ActorMarker *marker); +f32 func_80335684(Struct80s *); +void func_8033568C(Struct80s *, f32 *, f32*); +void func_80335800(Struct80s *, f32, void (*)(ActorMarker *), ActorMarker *); +Struct80s *func_803358B4(void); +void func_80335924(Struct80s *, enum asset_e anim_id, f32, f32); +void func_80335A74(Struct80s *self, f32 arg1); +void func_80335A94(Struct80s *, f32, s32); +int func_803391A4(Gfx**, Mtx**, f32 [3], f32[3], f32, f32*, BKModelBin*); +void func_8033A280(f32); + +void func_80346C10(enum bs_e *retVal, enum bs_e fail_state, enum bs_e success_state, enum item_e item_id, int use_item); +void func_80347A14(s32); +void func_8034A174(struct5Bs *this, s32 indx,f32 dst[3]); +Struct61s *func_8034AB6C(enum map_e map_id); +Struct6Ds *func_8034C528(s32); +Struct73s *func_8034C5AC(s32); +void func_8034DC08(Struct6Ds *, f32[3], f32[3], f32, s32); +void func_8034DDF0(Struct6Ds *arg0, f32 arg1[3], f32 arg2[3], f32 arg3, s32 arg4); +void func_8034DE60(Struct6Ds *, f32, f32, f32, s32); +void func_8034DEB4(Struct6Ds *, f32); +void func_8034DFB0(Struct6Ds *arg0, s32 arg1[4], s32 arg2[4], f32 arg3); +void func_8034E1A4(Struct6Ds *arg0, enum sfx_e, f32, f32); +void func_8034E71C(Struct73s *arg0, s32 arg1, f32 arg2); +void func_8034E78C(Struct73s *arg0, s32 arg1, f32 arg2); +void func_8034E7B8(Struct73s *, s32, f32, s32, f32); + +void func_80352CF4(f32 *, f32 *, f32, f32); + + + +AnimCtrl *_player_getAnimCtrlPtr(void); +void _get_velocity(f32 dst[3]); +void player_setYPosition(f32); + +NodeProp *func_80304C38(enum actor_e arg0, Actor *arg1); +NodeProp *func_80304CAC(s32 arg0, f32 position[3]); +Actor *func_80326D68(f32 position[3], enum actor_e actor_id, s32 arg2, f32 *min_distance_ptr); +Actor *func_80329980(Actor *); + + /* used in RBB */ +void ml_vec3f_pitch_rotate_copy(f32 dst[3], f32 src[3], f32 pitch); +int func_8025773C(f32 *arg0, f32 arg1); +Actor *func_80325888(ActorMarker *, Gfx**, Mtx**, Vtx **); + +Actor *func_80325340(ActorMarker *, Gfx **, Mtx **, Vtx **); +void func_8032AA58(Actor *, f32); +void func_80324E38(f32, s32); +void timed_playSfx(f32, enum sfx_e, f32, s32); +f32 ml_vec3f_distance(f32 [3], f32 [3]); +void timed_setCameraToNode(f32, s32); +void func_80324E88(f32); +int actor_animationIsAt(Actor*, f32); + +void func_80250E94(f32, f32, f32, f32, f32, f32); + + +void func_802C8F70(f32); +void func_802F9DB8(s32, f32, f32, f32); +void func_802F9F80(s32, f32, f32, f32); +void func_802FA060(s32, s32, s32, f32); +Actor *func_80326EEC(enum actor_e); +f32 func_8038A6B8(ActorMarker *); +void *defrag_asset(void *); +void func_80255FE4(f32 [3], f32 [3], f32 [3], f32); +void func_8030DEB4(u8, f32, f32); +void func_8030DB04(u8, s32, f32 position[3], f32, f32); +void func_80258A4C(f32 [3], f32, f32 [3], f32 *, f32 *, f32 *); + + +void func_802E4078(enum map_e map, s32 exit, s32 transition); +void levelSpecificFlags_set(s32, s32); +void func_803228D8(void); + +void func_803253A0(Actor *); +void mapSpecificFlags_set(s32, s32); + +struct0 *func_8031B9D8(void); + +extern int func_80259808(f32); +void actor_playAnimationOnce(Actor *); +void actor_loopAnimation(Actor *); + +/* used in fight */ +void func_80326224(Actor *this); + +void func_802F9FD0(s32, f32, f32, f32); +void func_80324D54(f32, enum sfx_e, f32, s32, f32 [3], f32, f32); + +void glcrc_calc_checksum(void *start, void *end, u32 *checksum); +f32 climbGetBottomY(void); +f32 climbGetTopY(void); +void func_802596AC(f32 a0[3], f32 a1[3], f32 a2[3], f32 a3[3]); + +void func_8024E55C(s32, void *); +void func_802C3C88(GenMethod_1, s32); +void func_802FAD64(enum item_e); +void nodeprop_getPosition(NodeProp *, f32[3]); +bool func_80311480(s32 text_id, s32 arg1, f32 *pos, ActorMarker *marker, void(*callback)(ActorMarker *, enum asset_e, s32), void(*arg5)(ActorMarker *, enum asset_e, s32)); +void ability_unlock(enum ability_e); + +extern void func_802EE278(Actor *, s32, s32, s32, f32, f32); +extern void func_802F3BF4(s16[3]); +extern void actor_collisionOn(Actor *); +extern void func_80328AC8(Actor *, s32); + +#endif diff --git a/include/gc/gc.h b/include/gc/gc.h new file mode 100644 index 00000000..9a4b3879 --- /dev/null +++ b/include/gc/gc.h @@ -0,0 +1,8 @@ +#ifndef __GC_H__ +#define __GC_H__ + +#include "gc/gcbound.h" +#include "gc/gctransition.h" +#include "gc/gczoombox.h" + +#endif diff --git a/include/gc/gcbound.h b/include/gc/gcbound.h new file mode 100644 index 00000000..aa3ddb5f --- /dev/null +++ b/include/gc/gcbound.h @@ -0,0 +1,12 @@ +#ifndef GCBOUND_H +#define GCBOUND_H +#include + +#include "structs.h" + + +void gcbound_draw(Gfx **dl); +void gcbound_alpha(s32 a); +void gcbound_color(s32 r, s32 g, s32 b); +void gcbound_reset(void); +#endif diff --git a/include/gc/gctransition.h b/include/gc/gctransition.h new file mode 100644 index 00000000..c5b2ad44 --- /dev/null +++ b/include/gc/gctransition.h @@ -0,0 +1,17 @@ +#ifndef __GC_TRANSITION__ +#define __GC_TRANSITION__ + +void gctransition_8030B740(void); +void gctransition_draw(Gfx **arg0, Mtx **arg1, Vtx **arg2); +void gctransition_8030BD4C(void); +f32 gctransition_8030BD88(void); +int gctransition_8030BD98(void); +int gctransition_8030BDAC(void); +int gctransition_8030BDC0(void); +void gctransition_8030BE3C(void); +void gctransition_8030BE60(void); +void gctransition_8030BEA4(s32 arg0); +void gctransition_update(void); +void gctransition_reset(void); + +#endif diff --git a/include/gc/gczoombox.h b/include/gc/gczoombox.h new file mode 100644 index 00000000..71c6310e --- /dev/null +++ b/include/gc/gczoombox.h @@ -0,0 +1,104 @@ +#ifndef GCZOOMBOX_H +#define GCZOOMBOX_H + +#include + +#include "structs.h" + + + +typedef struct { + u8 unk0[0x30]; //string1 + u8 unk30[0x30]; //string2 + u8 unk60[0x30]; + u8 unk90[0x20]; + u8 unkB0[0x40]; + BKModelBin *unkF0; + AnimCtrl *unkF4; + BKSprite *unkF8; + BKSpriteDisplayData *unkFC; + BKSprite *unk100; + BKSpriteDisplayData *unk104; + u8 unk108[5]; //sfx_ids + u8 pad10D[3]; + f32 unk110[5]; //sfx_??? + s16 unk124[5]; //sfx_??? + s16 unk12E; + void (*unk130)(s32, s32); + u8 unk134; + u8 unk135; + u8 portrait_id; //0x136 + u8 unk137; //string_cnt + u8 unk138; //current_string + u8 unk139; + u8 unk13A; + u8 unk13B; //sfx_count + u8 *unk13C[8]; //string_ptrs + u8 unk15C; + u8 unk15D; + u8 unk15E; + u8 pad15F[0x1]; + u8 *unk160; + s16 unk164; + s16 unk166; //top_transparency??? + s16 unk168; //rgb??? + s16 unk16A; //x_pos + s16 unk16C; //y1_pos + s16 unk16E; //y2_pos + s16 unk170; + s16 unk172; + s16 unk174; + s8 unk176; + s8 unk177; + s8 unk178; + s8 unk179; + u8 pad17A[0x2]; + f32 unk17C; + s8 unk180; + s8 unk181; + u8 unk182; + u8 unk183; + u8 unk184; + u8 unk185; + s8 unk186; + u8 unk187; + u8 unk188; //sprite frame count + u8 unk189; + u8 unk18A; + u8 unk18B; //next_sfx + f32 unk18C; + f32 unk190; + f32 unk194; + f32 unk198; + f32 unk19C; + f32 unk1A0; + u32 unk1A4_31:1; + u32 unk1A4_30:1; + u32 unk1A4_29:1; + u32 unk1A4_28:1; + u32 unk1A4_27:1; + u32 unk1A4_26:1; + u32 unk1A4_25:1; + u32 unk1A4_24:1; + u32 unk1A4_23:1; + u32 unk1A4_22:1; + u32 unk1A4_21:1; + u32 unk1A4_20:1; + u32 unk1A4_19:1; + u32 unk1A4_18:1; //highlighted + u32 unk1A4_17:1; + u32 unk1A4_16:1; + u32 unk1A4_15:1; + u32 unk1A4_14:1; + u32 unk1A4_13:1; + u32 unk1A4_12:1; + u32 unk1A4_11:1; + u32 unk1A4_10:1; + u32 pad1A4_9:10; +}gczoombox_t; //size 0x1A8 + +void gczoombox_draw(gczoombox_t *this, Gfx **gdl, Mtx ** mptr, void *vptr); +void gczoombox_free(gczoombox_t* this); +gczoombox_t *gczoombox_new(s32 arg0, s32 arg1, s32 arg2, s32 arg3, void (*arg4)(s32, s32)); + +#endif diff --git a/include/initfx.h b/include/initfx.h new file mode 100755 index 00000000..704e1f4a --- /dev/null +++ b/include/initfx.h @@ -0,0 +1,59 @@ +/*==================================================================== + * initfx.h + * + * Copyright 1993, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +#ifndef __initfx__ +#define __initfx__ + +#define MAX_L0 AL_FX_BUFFER_SIZE/4 +#define MAX_L1 AL_FX_BUFFER_SIZE/4 +#define MAX_L2 AL_FX_BUFFER_SIZE/2 + +#define L0_INC MAX_L0/128 +#define L1_INC MAX_L1/128 +#define L2_INC MAX_L2/128 + +#define SMALLROOM_SECT_CNT 3 +#define SMALLROOM_SIZE AL_FX_BUFFER_SIZE +#define SMALLROOM_L0 880 /* 22 ms */ +#define SMALLROOM_C0 9830 +#define SMALLROOM_L1 1400 /* 35 ms */ +#define SMALLROOM_C1 3276 +#define SMALLROOM_L2 2640 /* 66 ms */ +#define SMALLROOM_C2 10000 +#define SMALLROOM_FILT_CNT 1 +#define SMALLROOM_FC0 0x4000 /* .25 */ + +#define BIGROOM_SECT_CNT 3 +#define BIGROOM_SIZE AL_FX_BUFFER_SIZE +#define BIGROOM_L0 1408 /* 32 ms */ +#define BIGROOM_C0 9830 +#define BIGROOM_L1 1984 /* 45 ms */ +#define BIGROOM_C1 9830 +#define BIGROOM_L2 3792 /* 86 ms */ +#define BIGROOM_C2 12000 +#define BIGROOM_FILT_CNT 1 +#define BIGROOM_FC0 0x4000 /* .25 */ + +#define ECHO_SIZE AL_FX_BUFFER_SIZE +#define ECHO_SECT_CNT 1 +#define ECHO_L0 7936 /* 180 ms */ +#define ECHO_C0 0x6000 + +#endif diff --git a/include/macro.inc b/include/macro.inc new file mode 100644 index 00000000..e1048cf1 --- /dev/null +++ b/include/macro.inc @@ -0,0 +1,25 @@ +# Assembly Macros + +.set K0BASE, 0x80000000 +.set K1BASE, 0xA0000000 +.set K2BASE, 0xC0000000 + +.macro glabel label + .global \label + .ent \label + .balign 4 + \label: +.endm + +.macro dlabel label + .global \label + \label: +.endm + +.macro endlabel label + .end \label +.endm + +.macro .word32 x + .word \x +.endm diff --git a/include/ml.h b/include/ml.h new file mode 100644 index 00000000..5e168f1f --- /dev/null +++ b/include/ml.h @@ -0,0 +1,10 @@ +#ifndef __MATH_LIBRARY_H__ +#define __MATH_LIBRARY_H__ + +void ml_vec3f_normalize_copy(f32 arg0[3], f32 arg1[3]); +void ml_vec3f_yaw_rotate_copy(f32 arg0[3], f32 arg1[3], f32 arg2); +void ml_vec3f_diff_copy(f32 dst[3], f32 src1[3], f32 src2[3]); +void ml_vec3f_set_length_copy(f32 dst[3], f32 src[3], f32 len); +void ml_vec3f_set_length(f32 arg0[3], f32 arg2); + +#endif diff --git a/include/ml/mtx.h b/include/ml/mtx.h new file mode 100644 index 00000000..dd179e4c --- /dev/null +++ b/include/ml/mtx.h @@ -0,0 +1,11 @@ +#ifndef __ML_MTX__ +#define __ML_MTX__ + +void mlMtxIdent(void); +void mlMtxRotPitch(f32 pitch); +void mlMtxRotYaw(f32 yaw); +void mlMtxRotRoll(f32 roll); +void mlMtxScale_xyz(f32 x, f32 y, f32); +void mlMtxTranslate(f32 x, f32 y, f32 z); + +#endif diff --git a/include/model.h b/include/model.h new file mode 100644 index 00000000..df953840 --- /dev/null +++ b/include/model.h @@ -0,0 +1,182 @@ +#ifndef __MODEL_H__ +#define __MODEL_H__ +#include + +typedef struct { + Vtx v; + s16 unk10; //vtx_indx + u8 pad12[2]; + u8 pad14[4]; +} BKVtxRef; + +/* BKMesh + * This struct is a set of Vtx that will be modified at runtime. + * This struct is followed by an array of s16 containing the + * Vtx index inside the model's BKVertexList. +*/ +typedef struct { + s16 uid_0; + s16 vtxCount_2; +} BKMesh; + +typedef struct { + s32 cmd_0; + s32 size_4; +}BKGeoList; + +/* BKMeshList + * This struct is followed by an array of BKMesh which contain + * lists of Vtx that are modified at runtime. + */ +typedef struct { + s16 meshCount_0; +} BKMeshList; + +typedef struct { + s16 minCoord_0[3]; + s16 maxCoord_6[3]; + s16 unkC[3]; + s16 unk12; + s16 cnt_14; + s16 unk16; + Vtx vtx_18[]; +} BKVertexList; + +typedef struct { + s16 start_tri_index; //start_tri + s16 tri_count; //tri_cnt +} BKCollisionGeo; //BKCollisionGeometry + +typedef struct { + s16 unk0[3]; //vtx_indx + //u8 pad6[2]; + s32 flags; //flags +} BKCollisionTri; //BKCollisionTri + +typedef struct { + s16 unk0[3]; //min + s16 unk6[3]; //max + s16 unkC; //y_stride + s16 unkE; //z_stride + s16 unk10; //geo_cnt + s16 unk12; //scale + s16 unk14; //tri_cnt + u8 pad16[0x2]; + //BKCollisionGeo[] + //BKCollisionTri[] +}BKCollisionList; + +typedef struct { + u8 pad0[0]; +}BKEffectsList; //see BKMeshList + +typedef struct { + f32 unk0[3]; + s16 unkC; + s16 unkE; +}BKAnimation; + +typedef struct { + f32 unk0; + s16 cnt_4; + BKAnimation anim[]; +}BKAnimationList; + +typedef struct { + u8 pad0[8]; + Gfx list[]; +} BKGfxList; + +typedef struct { + s32 offset_0; + s16 type_4; + u8 pad6[2]; + u8 width_8; + u8 height_9; + u8 padA[6]; +}BKTextureHeader; + +typedef struct { + s32 size_0; + s16 cnt_4; + u8 pad6[2]; +}BKTextureList; + +typedef struct { + s16 unk0[3]; + s16 unk6[3]; + s16 unkC[3]; + u8 unk12[3]; + u8 unk15; + u8 pad16[2]; +}BKModelUnk14_0; + +typedef struct { + s16 unk0; + s16 unk2; + s16 unk4[3]; + u8 unkA[3]; + u8 unkD; + u8 padE[2]; +}BKModelUnk14_1; + +typedef struct { + s16 unk0; + s16 unk2[3]; + u8 unk8; + u8 pad9[3]; +}BKModelUnk14_2; + +typedef struct { + s16 cnt0; //number of BKModelUnk14_0 structs + s16 cnt2; //number of BKModelUnk14_1 structs + s16 unk4; + s16 unk6; + //BKModelUnk14_0[] + //BKModelUnk14_1[] + //BKModelUnk14_2[] +}BKModelUnk14List; + +typedef struct{ + s16 unk0[3]; + s16 unk6[3]; + u8 unkC; + u8 padD[0x1]; +}BKModelUnk20_0; + +typedef struct{ + u8 unk0; + u8 pad1[1]; + //BKModelUnk20_0[] +}BKModelUnk20List; + +typedef struct{ + u8 pad0[1]; + //BKModelUnk20_0[] +}BKModelUnk2C; + +typedef struct { + BKMeshList *meshList_0; + BKVertexList *vtxList_4; +} BKModel; + +typedef struct{ + u8 pad0[0x4]; + s32 geo_list_offset_4; + s16 texture_list_offset_8; + s16 geo_typ_A; + s32 gfx_list_offset_C; + s32 vtx_list_offset_10; + s32 unk14; + s32 animation_list_offset_18; + s32 collision_list_offset_1C; + s32 unk20; + s32 effects_list_setup_24; + s32 unk28; + s32 unk2C; +}BKModelBin; + +BKVertexList *func_8033A148(BKModelBin *arg0); +Vtx *vtxList_getVertices(BKVertexList *vtxList); +void func_80333D48(BKVertexList *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, BKVertexList *arg5); +#endif diff --git a/include/music.h b/include/music.h new file mode 100644 index 00000000..baae070d --- /dev/null +++ b/include/music.h @@ -0,0 +1,34 @@ +#ifndef MUSIC_H +#define MUSIC_H +#include +#include "structs.h" + +typedef struct struct_B_s{ + s32 unk0; + s32 chan; + f32 unk8; + f32 unkC; + f32 unk10; +} structBs; + +typedef struct music_track_s{ + s16 unk0; + u8 unk2; + u8 unk3; + ALCSeq cseq; + ALCSPlayer cseqp; + s16 index; + s16 index_cpy; + f32 unk17C; + f32 unk180; + u8 unk184[0xE]; + u8 unk192[0xE]; +} MusicTrack; + +typedef struct music_track_meta_s{ + char *name; + u16 unk4; + u8 pad6[2]; +}MusicTrackMeta; + +#endif diff --git a/include/n_abi.h b/include/n_abi.h new file mode 100644 index 00000000..fc9c135c --- /dev/null +++ b/include/n_abi.h @@ -0,0 +1,122 @@ +/*==================================================================== + * + * Copyright 1993, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +#ifndef __N_ABI__ +#define __N_ABI__ + +/* + * BEGIN C-specific section: (typedef's) + */ + +#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) + + +/* + * Macros to assemble the audio command list + */ + +#define n_aADPCMdec(pkt, s, f, c, a, d) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_ADPCM, 24, 8) | _SHIFTL(s, 0, 24)); \ + _a->words.w1 = (_SHIFTL(f, 28, 4) | _SHIFTL(c, 16, 12) | \ + _SHIFTL(a, 12, 4) | _SHIFTL(d, 0, 12)); \ +} + +#define n_aPoleFilter(pkt, f, g, t, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_POLEF, 24, 8) | _SHIFTL(f, 16, 8) | \ + _SHIFTL(g, 0, 16)); \ + _a->words.w1 = (_SHIFTL(t, 24, 8) | \ + _SHIFTL((unsigned int)(s), 0, 24)); \ +} + +#define n_aEnvMixer(pkt, f, t, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_ENVMIXER, 24, 8) | _SHIFTL(f, 16, 8) |\ + _SHIFTL(t, 0, 16)); \ + _a->words.w1 = (unsigned int)(s); \ +} + +#define n_aInterleave(pkt) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_INTERLEAVE, 24, 8); \ +} + +#define n_aLoadBuffer(pkt, c, d, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_LOADBUFF, 24, 8) | _SHIFTL(c, 12, 12)|\ + _SHIFTL(d, 0, 12)); \ + _a->words.w1 = (unsigned int)(s); \ +} + +#define n_aResample(pkt, s, f, p, i, o) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_RESAMPLE, 24, 8) | _SHIFTL(s, 0, 24));\ + _a->words.w1 = (_SHIFTL(f, 30, 2) | _SHIFTL(p, 14, 16) | \ + _SHIFTL(i, 2, 12) | _SHIFTL(o, 0, 2)); \ +} + +#define n_aSaveBuffer(pkt, c, d, s) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_SAVEBUFF, 24, 8) | _SHIFTL(c, 12, 12)|\ + _SHIFTL(d, 0, 12)); \ + _a->words.w1 = (unsigned int)(s); \ +} + +#define n_aSetVolume(pkt, f, v, t, r) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = (_SHIFTL(A_SETVOL, 24, 8) | _SHIFTL(f, 16, 8) | \ + _SHIFTL(v, 0, 16)); \ + _a->words.w1 = _SHIFTL(t, 16, 16) | _SHIFTL(r, 0, 16); \ +} + +#define n_aLoadADPCM(pkt, c, d) \ +{ \ + Acmd *_a = (Acmd *)pkt; \ + \ + _a->words.w0 = _SHIFTL(A_LOADADPCM, 24, 8) | _SHIFTL(c, 0, 24); \ + _a->words.w1 = (unsigned int) d; \ +} + +#endif /* _LANGUAGE_C */ + +#endif /* __N_ABI__ */ + + + + + + + diff --git a/include/n_cseqp.h b/include/n_cseqp.h new file mode 100755 index 00000000..03ee5535 --- /dev/null +++ b/include/n_cseqp.h @@ -0,0 +1,10 @@ + + +#ifndef __n_cseqp__ +#define __n_cseqp__ + + +void __n_CSPPostNextSeqEvent(N_ALCSPlayer *seqp); + + +#endif /* __cseqp__ */ diff --git a/include/n_synth.h b/include/n_synth.h new file mode 100644 index 00000000..b0576c79 --- /dev/null +++ b/include/n_synth.h @@ -0,0 +1,157 @@ +#ifndef __N_AUDIO_INT__ +#define __N_AUDIO_INT__ +#include +#include +#include "synthInternals.h" +#include + +#define SAMPLES 184 +#define SAMPLE184(delta) (((delta) + (SAMPLES / 2)) / SAMPLES) * SAMPLES +#define FIXED_SAMPLE SAMPLES + +#define N_AL_DECODER_IN 0 +#define N_AL_RESAMPLER_OUT 0 +#define N_AL_TEMP_0 0 +#define N_AL_DECODER_OUT 368 +#define N_AL_TEMP_1 368 +#define N_AL_TEMP_2 736 +#define N_AL_MAIN_L_OUT 1248 +#define N_AL_MAIN_R_OUT 1616 +#define N_AL_AUX_L_OUT 1984 +#define N_AL_AUX_R_OUT 2352 + +#define N_AL_DIVIDED 368 + +typedef struct N_ALLoadFilter_s{ + //ALFilter filter; + ADPCM_STATE *state; //0xC + ADPCM_STATE *lstate; //0x10 + ALRawLoop loop; //0x14 + struct ALWaveTable_s *table; //0x20 + s32 bookSize; + ALDMAproc dma; + void *dmaState; + s32 sample; + s32 lastsam; + s32 first; + s32 memin; +} N_ALLoadFilter; + +typedef struct N_ALResampler_s { + //ALFilter filter; + RESAMPLE_STATE *state; + f32 ratio; + s32 upitch; + f32 delta; + s32 first; +} N_ALResampler; + +typedef struct N_ALEnvMixer_s { + ENVMIX_STATE *state; + s16 pan; + s16 volume; + s16 cvolL; + s16 cvolR; + s16 dryamt; + s16 wetamt; + u16 lratl; + s16 lratm; + s16 ltgt; + u16 rratl; + s16 rratm; + s16 rtgt; + s32 delta; + s32 segEnd; + s32 first; +} N_ALEnvMixer; + + +typedef struct N_PVoice_s { + ALLink node; + struct N_ALVoice_s *vvoice; +/** ALLoadFilter *********************************/ + ADPCM_STATE *dc_state; + ADPCM_STATE *dc_lstate; + ALRawLoop dc_loop; + struct ALWaveTable_s *dc_table; + s32 dc_bookSize; + ALDMAproc dc_dma; + void *dc_dmaState; + s32 dc_sample; + s32 dc_lastsam; + s32 dc_first; + s32 dc_memin; +/** ALResampler *********************************/ + RESAMPLE_STATE *rs_state; + f32 rs_ratio; + s32 rs_upitch; + f32 rs_delta; + s32 rs_first; +/** ALEnvMixer *********************************/ + ENVMIX_STATE *em_state; + s16 em_pan; + s16 em_volume; + s16 em_cvolL; + s16 em_cvolR; + s16 em_dryamt; + s16 em_wetamt; + u16 em_lratl; + s16 em_lratm; + s16 em_ltgt; + u16 em_rratl; + s16 em_rratm; + s16 em_rtgt; + s32 em_delta; + s32 em_segEnd; + s32 em_first; + ALParam *em_ctrlList; + ALParam *em_ctrlTail; + s32 em_motion; + s32 offset; +} N_PVoice; + +#define N_AL_MAX_RSP_SAMPLES 184 + + +typedef Acmd *(*N_ALCmdHandler)(s32, Acmd *); + +typedef struct N_ALFilter_s { + struct N_ALFilter_s *source; + N_ALCmdHandler handler; + ALSetParam setParam; + s16 inp; + s16 outp; + s32 type; +} N_ALFilter; + + +typedef struct N_ALMainBus_s { + N_ALFilter filter; +} N_ALMainBus; + +typedef struct N_ALAuxBus_s { + ALFilter filter; + s32 sourceCount; + s32 maxSources; + N_PVoice **sources; + ALFx *fx; + ALFx *fx_array[AL_MAX_AUX_BUS_SOURCES]; +} N_ALAuxBus; + +extern N_ALSynth *n_syn; + +/* + * prototypes for private driver functions + */ +ALParam *__n_allocParam(void); +void __n_freeParam(ALParam *param); +void _n_freePVoice(N_PVoice *pvoice); +void _n_collectPVoices(); + +s32 _n_timeToSamples(s32 micros); +ALMicroTime _n_samplesToTime(s32 samples); + +int n_alEnvmixerResampleParam(N_PVoice *v, s32 paramId, void* param); +//n_alLoadParam +int n_alLoadParam(N_PVoice *v, s32 paramId, void* param); +#endif diff --git a/include/osint.h b/include/osint.h new file mode 100644 index 00000000..82d78080 --- /dev/null +++ b/include/osint.h @@ -0,0 +1,48 @@ +#ifndef _OSINT_H +#define _OSINT_H +#include +typedef struct __OSEventState +{ + OSMesgQueue *messageQueue; + OSMesg message; +} __OSEventState; +extern struct __osThreadTail +{ + OSThread *next; + OSPri priority; +} __osThreadTail; + +//maybe should be in exceptasm.h? +extern void __osEnqueueAndYield(OSThread **); +extern void __osDequeueThread(OSThread **, OSThread *); +extern void __osEnqueueThread(OSThread **, OSThread *); +extern OSThread *__osPopThread(OSThread **); +extern void __osDispatchThread(void); + +extern void __osSetTimerIntr(OSTime); +extern OSTime __osInsertTimer(OSTimer *); +extern void __osTimerInterrupt(void); +extern u32 __osProbeTLB(void *); +extern int __osSpDeviceBusy(void); + +extern OSThread *__osRunningThread; +extern OSThread *__osActiveQueue; +extern OSThread *__osFaultedThread; +extern OSThread *__osRunQueue; + +extern OSTimer *__osTimerList; +extern OSTimer __osBaseTimer; +extern OSTime __osCurrentTime; +extern u32 __osBaseCounter; +extern u32 __osViIntrCount; +extern u32 __osTimerCounter; + +extern __OSEventState __osEventStateTab[OS_NUM_EVENTS]; + + +//not sure if this should be here +extern s32 osViClock; +extern void __osTimerServicesInit(void); +extern s32 __osAiDeviceBusy(void); +extern int __osDpDeviceBusy(void); +#endif diff --git a/include/overlays.h b/include/overlays.h new file mode 100644 index 00000000..c0c7066e --- /dev/null +++ b/include/overlays.h @@ -0,0 +1,15 @@ +OVERLAY(core2,0) +OVERLAY(emptyLvl,1) +OVERLAY(CC,2) +OVERLAY(MMM,3) +OVERLAY(GV,4) +OVERLAY(TTC,5) +OVERLAY(MM,6) +OVERLAY(BGS,7) +OVERLAY(RBB,8) +OVERLAY(FP,9) +OVERLAY(CCW,10) +OVERLAY(SM,11) +OVERLAY(cutscenes,12) +OVERLAY(lair,13) +OVERLAY(fight,14) diff --git a/include/piint.h b/include/piint.h new file mode 100644 index 00000000..b618cd3a --- /dev/null +++ b/include/piint.h @@ -0,0 +1,145 @@ +#ifndef _PIINT_H +#define _PIINT_H +#include +#include + +//https://github.com/LuigiBlood/64dd/wiki/Memory-Map + +#define LEO_BASE_REG 0x05000000 + +#define LEO_CMD (LEO_BASE_REG + 0x508) +#define LEO_STATUS (LEO_BASE_REG + 0x508) + +#define LEO_BM_CTL (LEO_BASE_REG + 0x510) +#define LEO_BM_STATUS (LEO_BASE_REG + 0x510) + +#define LEO_SEQ_CTL (LEO_BASE_REG + 0x518) +#define LEO_SEQ_STATUS (LEO_BASE_REG + 0x518) + +#define LEO_C2_BUFF (LEO_BASE_REG + 0x000) //C2 Sector Buffer +#define LEO_SECTOR_BUFF (LEO_BASE_REG + 0x400) //Data Sector Buffer +#define LEO_DATA (LEO_BASE_REG + 0x500) //Data +#define LEO_MISC_REG (LEO_BASE_REG + 0x504) //Misc Register +#define LEO_CUR_TK (LEO_BASE_REG + 0x50C) //Current Track +#define LEO_ERR_SECTOR (LEO_BASE_REG + 0x514) //Sector Error Status +#define LEO_CUR_SECTOR (LEO_BASE_REG + 0x51C) //Current Sector +#define LEO_HARD_RESET (LEO_BASE_REG + 0x520) //Hard Reset +#define LEO_C1_S0 (LEO_BASE_REG + 0x524) //C1 +#define LEO_HOST_SECBYTE (LEO_BASE_REG + 0x528) //Sector Size (in bytes) +#define LEO_C1_S2 (LEO_BASE_REG + 0x52C) //C1 +#define LEO_SEC_BYTE (LEO_BASE_REG + 0x530) //Sectors per Block, Full Size +#define LEO_C1_S4 (LEO_BASE_REG + 0x534) //C1 +#define LEO_C1_S6 (LEO_BASE_REG + 0x538) //C1 +#define LEO_CUR_ADDR (LEO_BASE_REG + 0x53C) //Current Address? +#define LEO_ID_REG (LEO_BASE_REG + 0x540) //ID +#define LEO_TEST_REG (LEO_BASE_REG + 0x544) //Test Read +#define LEO_TEST_PIN_SEL (LEO_BASE_REG + 0x548) //Test Write +#define LEO_RAM_ADDR (LEO_BASE_REG + 0x580) //Microsequencer RAM + +#define LEO_STATUS_PRESENCE_MASK 0xFFFF + +#define LEO_STATUS_DATA_REQUEST 0x40000000 +#define LEO_STATUS_C2_TRANSFER 0x10000000 +#define LEO_STATUS_BUFFER_MANAGER_ERROR 0x08000000 +#define LEO_STATUS_BUFFER_MANAGER_INTERRUPT 0x04000000 +#define LEO_STATUS_MECHANIC_INTERRUPT 0x02000000 +#define LEO_STATUS_DISK_PRESENT 0x01000000 +#define LEO_STATUS_BUSY_STATE 0x00800000 +#define LEO_STATUS_RESET_STATE 0x00400000 +#define LEO_STATUS_MOTOR_NOT_SPINNING 0x00100000 +#define LEO_STATUS_HEAD_RETRACTED 0x00080000 +#define LEO_STATUS_WRITE_PROTECT_ERROR 0x00040000 +#define LEO_STATUS_MECHANIC_ERROR 0x00020000 +#define LEO_STATUS_DISK_CHANGE 0x00010000 + +#define LEO_STATUS_MODE_MASK (LEO_STATUS_MOTOR_NOT_SPINNING | LEO_STATUS_HEAD_RETRACTED) +#define LEO_STATUS_MODE_SLEEP (LEO_STATUS_MOTOR_NOT_SPINNING | LEO_STATUS_HEAD_RETRACTED) +#define LEO_STATUS_MODE_STANDBY (LEO_STATUS_HEAD_RETRACTED) +#define LEO_STATUS_MODE_ACTIVE 0 + +#define LEO_CUR_TK_INDEX_LOCK 0x60000000 + +#define LEO_BM_STATUS_RUNNING 0x80000000 //Running +#define LEO_BM_STATUS_ERROR 0x04000000 //Error +#define LEO_BM_STATUS_MICRO 0x02000000 //Micro Status? +#define LEO_BM_STATUS_BLOCK 0x01000000 //Block Transfer +#define LEO_BM_STATUS_C1CORRECTION 0x00800000 //C1 Correction +#define LEO_BM_STATUS_C1DOUBLE 0x00400000 //C1 Double +#define LEO_BM_STATUS_C1SINGLE 0x00200000 //C1 Single +#define LEO_BM_STATUS_C1ERROR 0x00010000 //C1 Error + +#define LEO_BM_CTL_START 0x80000000 //Start Buffer Manager +#define LEO_BM_CTL_MODE 0x40000000 //Buffer Manager Mode +#define LEO_BM_CTL_IMASK 0x20000000 //BM Interrupt Mask +#define LEO_BM_CTL_RESET 0x10000000 //Buffer Manager Reset +#define LEO_BM_CTL_DISABLE_OR 0x08000000 //Disable OR Check? +#define LEO_BM_CTL_DISABLE_C1 0x04000000 //Disable C1 Correction +#define LEO_BM_CTL_BLOCK 0x02000000 //Block Transfer +#define LEO_BM_CTL_CLR_MECHANIC_INTR 0x01000000 //Mechanic Interrupt Reset + +#define LEO_BM_CTL_CONTROL_MASK 0xFF000000 +#define LEO_BM_CTL_SECTOR_MASK 0x00FF0000 +#define LEO_BM_CTL_SECTOR_SHIFT 16 + +#define LEO_CMD_TYPE_0 0 //TODO: name +#define LEO_CMD_TYPE_1 1 //TODO: name +#define LEO_CMD_TYPE_2 2 //TODO: name + +#define LEO_ERROR_GOOD 0 +#define LEO_ERROR_4 4 //maybe busy? +#define LEO_ERROR_22 22 // +#define LEO_ERROR_23 23 //unrecovered read error? +#define LEO_ERROR_24 24 //no reference position found? +#define LEO_ERROR_29 29 // + +extern OSDevMgr __osPiDevMgr; +extern OSPiHandle *__osCurrentHandle[2]; +extern OSPiHandle CartRomHandle; +extern OSPiHandle LeoDiskHandle; +extern OSMesgQueue __osPiAccessQueue; +extern u32 __osPiAccessQueueEnabled; + +int __osPiDeviceBusy(void); +void __osDevMgrMain(void *); +void __osPiCreateAccessQueue(void); +void __osPiRelAccess(void); +void __osPiGetAccess(void); +OSMesgQueue *osPiGetCmdQueue(void); + +#define OS_RAMROM_STACKSIZE 1024 + +#define WAIT_ON_IOBUSY(stat) \ + stat = IO_READ(PI_STATUS_REG); \ + while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) \ + stat = IO_READ(PI_STATUS_REG); + +#define UPDATE_REG(reg, var) \ + if (cHandle->var != pihandle->var) \ + IO_WRITE(reg, pihandle->var); + +#define EPI_SYNC(pihandle, stat, domain) \ + \ + WAIT_ON_IOBUSY(stat) \ + \ + domain = pihandle->domain; \ + if (__osCurrentHandle[domain] != pihandle) \ + { \ + OSPiHandle *cHandle = __osCurrentHandle[domain]; \ + if (domain == PI_DOMAIN1) \ + { \ + UPDATE_REG(PI_BSD_DOM1_LAT_REG, latency); \ + UPDATE_REG(PI_BSD_DOM1_PGS_REG, pageSize); \ + UPDATE_REG(PI_BSD_DOM1_RLS_REG, relDuration); \ + UPDATE_REG(PI_BSD_DOM1_PWD_REG, pulse); \ + } \ + else \ + { \ + UPDATE_REG(PI_BSD_DOM2_LAT_REG, latency); \ + UPDATE_REG(PI_BSD_DOM2_PGS_REG, pageSize); \ + UPDATE_REG(PI_BSD_DOM2_RLS_REG, relDuration); \ + UPDATE_REG(PI_BSD_DOM2_PWD_REG, pulse); \ + } \ + __osCurrentHandle[domain] = pihandle; \ + } + +#endif diff --git a/include/prelude.s b/include/prelude.s new file mode 100644 index 00000000..216bf780 --- /dev/null +++ b/include/prelude.s @@ -0,0 +1,15 @@ +.set noat +.set noreorder +.set gp=64 +.macro glabel label + .global \label + \label: +.endm + +.macro dlabel label + .global \label + \label: +.endm + +.macro endlabel label +.endm \ No newline at end of file diff --git a/include/prop.h b/include/prop.h new file mode 100644 index 00000000..2d4250a5 --- /dev/null +++ b/include/prop.h @@ -0,0 +1,361 @@ +#ifndef PROP_H +#define PROP_H + +#include + +#include "structs.h" +#include "core2/animctrl.h" + +typedef struct sprite_prop_s{ + u32 unk0_31:0xC; + u32 pad0_19:0x1; + u32 unk0_18:0x3; + u32 unk0_15:0x3; + u32 unk0_12:0x3; + u32 unk0_9:0x8; + u32 unk0_1:0x1; + u32 pad0_0:0x1; + s16 unk4[3]; + u16 unk8_15: 5; + u16 pad8_10: 6; + u16 unk8_4: 1; + u16 pad8_3: 2; + u16 unk8_1:1; + u16 unk8_0:1; +} SpriteProp; + +typedef struct prop_prop_s{ + u16 unk0_31:12; + u16 pad0_19:4; + u8 unk0_15; + u8 unk0_7; + s16 unk4[3]; + u8 unkA; + u8 padB_7 :2; + u8 unkB_5 :1; + u8 unkB_4 :1; + u8 padB_3 :4; +} PropProp; + +typedef struct actor_prop_s{ + struct actorMarker_s* marker; + s16 x; + s16 y; + s16 z; + u16 unk8_15:5; + u16 unk8_10:5; + u16 unk8_5:1; + u16 unk8_4:1; + u16 unk8_3:1; + u16 unk8_2:1; + u16 unk8_1:1; + u16 unk8_0:1; +} ActorProp; + +typedef void(*MarkerCollisionFunc)(struct actorMarker_s *this, struct actorMarker_s *other); +typedef struct actor_s *(*MarkerDrawFunc)(struct actorMarker_s *, Gfx **, Mtx **, Vtx **); +typedef void (*ActorUpdateFunc)(struct actor_s *); + +typedef struct actorMarker_s{ + ActorProp* propPtr; + struct cude_s* cubePtr; + MarkerDrawFunc unk8; + MarkerCollisionFunc unkC; //ow_func + MarkerCollisionFunc unk10; + u32 yaw:9; + u32 unk14_22:1; + u32 unk14_21:1; + u32 unk14_20:10; //contains jingo_id for chjinjo + u32 unk14_10:11; //used in ch/jiggy + Struct6Cs *unk18; + MarkerCollisionFunc unk1C; //die_func + s32 unk20; + ActorUpdateFunc unk24; + s32 unk28; + u32 actrArrayIdx:11; //unk2C + u32 pitch:9; + u32 roll:9; + u32 unk2C_2:1; + u32 unk2C_1:1; + u32 collidable:1; + void (*unk30)(struct actor_s *); //actor free method + s32 unk34; + s16 unk38[3]; + u16 pad3E_15:1; + u16 modelId:13; + u16 unk3E_1:1; + u16 unk3E_0:1; //scaled + u32 unk40_31:4; + u32 unk40_27:4; + u32 unk40_23:1; + u32 unk40_22:1; + u32 unk40_21:1; + u32 unk40_20:1; + u32 unk40_19:1; + u32 pad40_18:19; + struct5Bs * unk44; + BKModel * unk48; + vector(Struct70s) * unk4C; + s32 unk50; + void (*unk54)(struct actorMarker_s *, struct actorMarker_s *, s16*); + s32 (*unk58)(struct actorMarker_s *, struct actorMarker_s *); + s32 unk5C; +} ActorMarker; + +typedef struct ch_bgs_6730_s{ + u32 unk0; + u32 unk4; + s32 unk8; + s32 unkC; +} ActorLocal_BGS_6730; + +typedef struct chtanktupbody_s{ + s32 unk0[4]; + s32 unk10; + s32 unk14; + f32 unk18[3]; +}ActorLocal_TanktupBody; + + +typedef struct actor_anim_info_s{ + u32 index; + f32 duration; +} ActorAnimationInfo; + +typedef struct jinjo_s{ + s32 unk0; + s32 unk4; + s32 unk8; + s32 unkC; +}ActorLocal_Jinjo; + +typedef struct ch_sm_4070{ + s32 unk0; +}ActorLocal_SM_4070; + +typedef struct actor_s{ + ActorMarker* marker; + TUPLE(f32,position); + u32 state:6; /* unk10_31*/ + u32 unk10_25:7; + u32 unk10_18:6; + u32 unk10_12:4; + u32 unk10_8:1; + u32 unk10_7:1; + u32 unk10_6:2; + u32 unk10_4:1; + u32 unk10_3:2; + u32 unk10_1:1; + u32 unk10_0:1; + AnimCtrl *animctrl; + ActorAnimationInfo *unk18; + TUPLE(f32, unk1C); + f32 unk28; //used in cheggs + TUPLE(f32, velocity); + u32 unk38_31:10; + u32 unk38_21:9; + u32 unk38_13:9; + u32 stored_animctrl_playbackType_:3; //animctrlPlaybackType + u32 unk38_0:1; + u32 unk3C; + s32 unk40; + u32 unk44_31:8; + u32 modelCacheIndex:10; //modelCacheIndex + s32 unk44_14:10; + u32 despawn_flag:1; + u32 unk44_2:1; + u32 unk44_1:1; + u32 unk44_0:1; + f32 unk48; //used in chlmonkey (chimpy) + f32 unk4C; + /* 0x50 */ f32 yaw; //0x50 + f32 unk54; //0x54 + u32 unk58_31: 15; + u32 stored_animctrl_index: 14; //animctrlAnimIndex; + u32 unk58_2: 1; + u32 unk58_1: 1; + u32 unk58_0: 1; + f32 unk5C; + f32 unk60; //0x60 + f32 yaw_moving; //0x64 + f32 pitch;//0x68 + f32 unk6C; + f32 unk70; + f32 unk74; + u32 unk78_31:9; + u32 unk78_22:9; + u32 unk78_13:12; + u32 stored_animctrl_forwards:1; //animCtrlDirection + u32 stored_animctrl_smoothTransistion:1; //animCtrlSmoothTransition + union + { //DON'T DO THIS JUST DEFINE STATICLY IN ch/ FILE AND CAST FROM &Actor->local + ActorLocal_BGS_6730 bgs_6730; + ActorLocal_TanktupBody tanktup; + ActorLocal_Jinjo jinjo; + ActorLocal_SM_4070 sm_4070; + u8 local[1]; + struct{ + u8 unk7C[0x40]; + u8 unkBC[0x30]; + }; + + }; + //u8 padAC[0x44]; + f32 unkEC; //animCtrl??? + f32 stored_animctrl_duration; //animCtrlDuration + u32 unkF4_31:1; + u32 unkF4_30:1; + u32 unkF4_29:1; + u32 unkF4_28:1; //saved marker->propPtr->unk8_3 + u32 unkF4_27:1; //saved marker->propPtr->unk8_2 + u32 unkF4_26:1; //saved marker->unk2C_1 + u32 stored_marker_collidable:1; //saved marker->collidable + u32 unkF4_24:2; + u32 unkF4_22:1; + u32 initialized:1; //unkF4_21; + u32 unkF4_20:12; + u32 unkF4_8:9; + f32 stored_animctrl_subrangeMin; //animCtrl_SubRangeStart + f32 stored_animctrl_subrangeMax; //animCtrl_SubRangeEnd + ActorMarker *unk100; + ActorMarker *unk104; + Struct62s *unk108; + // void ( *unk108)(struct actorMarker_s *, s32); //saved from marker->unkC + s32 unk10C; //saved marker->unk10 + f32 roll;//110 + f32 sound_timer; + TUPLE(f32, spawn_position); //0x118 + u32 unk124_31:12; + u32 alpha_124_19:8; + u32 unk124_11:2; //blend_mode? + u32 unk124_9:2; //render_mode (passed to set_model_render_mode()) + u32 unk124_7:1; + u32 unk124_6:1; + u32 unk124_5:2; + u32 unk124_3:3; + u32 unk124_0:1; //read in bsbbuster func + f32 scale; + /* 0x12C */ struct actor_info_s *actor_info; + void (* unk130)(struct actor_s *); + vector(struct2s) **unk134; //vector //saved marker->unk1C + u32 unk138_31:1; + u32 unk138_30:1; + u32 unk138_29:1; + u32 unk138_28:1; + u32 unk138_27:2; + u32 unk138_25:1; + u32 unk138_24:1; + u32 unk138_23:1; + u32 unk138_22:1; + u32 unk138_21:1; + u32 unk138_20:1; + u32 unk138_19:10; //saved maker->unk14_20 + u32 unk138_9:1; + u32 unk138_8:1; + u32 unk138_7:4; + u32 unk138_3:4; + void (*unk13C)(struct actorMarker_s *);//saved marker->unk30 + f32 unk140; + f32 unk144; + Struct80s *unk148; + void *unk14C[2]; + // void *unk150; + u32 unk154; + ParticleEmitter *unk158[2]; + void *unk160; //saved marker->unk54 + u8 unk164[0x2]; + u8 unk166; + s8 pad167[0x1]; + s32 unk168; //saved marker->unk58 + u32 unk16C_31:27; //saved s1->marker->unk5C + u32 unk16C_4:1; + u32 unk16C_3:1; + u32 unk16C_2:1; + u32 unk16C_1:1; + u32 unk16C_0:1; + f32 unk170; + f32 unk174; + f32 unk178; + u32 unk17C_31:1; + u32 pad17C_30:31; +} Actor; + +typedef struct actor_info_s{ + s16 markerId; + s16 actorId; + s16 modelId; + s16 startAnimation; + ActorAnimationInfo* animations; + void (* update_func)(Actor *); + void (* unk10)(Actor *); + Actor* (* draw_func)(ActorMarker *, Gfx **, Mtx **, Vtx **); + u16 unk18; + u16 draw_distance; + f32 shadow_scale; + u16 unk20; + //u8 pad22[2]; +} ActorInfo; + +typedef struct actor_spawn_s{ + ActorInfo *infoPtr; + Actor *(*spawnFunc)(s32[3], s32, ActorInfo*, u32); + s32 unk8; +} ActorSpawn; + +typedef union prop_s +{ + ActorProp actorProp; + SpriteProp spriteProp; + PropProp propProp; + struct{ + u8 pad0[4]; + s16 unk4[3]; + // s16 unk6; + s16 pad8_15: 11; + u16 unk8_4: 1; + u16 unk8_3: 1; + u16 unk8_2: 1; + u16 unk8_1: 1; + u16 markerFlag: 1; + }; +} Prop; + +typedef struct { + s16 x; + s16 y; + s16 z; + u16 unk6_15: 9; //selector_value + u16 unk6_6: 6; //category + u16 unk6_0: 1; + u16 unk8; + u8 unkA; + u8 padB[1]; + u32 unkC_31:9; + u32 unkC_22:23; + u32 unk10_31 : 12; + u32 pad10_19 : 12; + u32 unk10_7 : 1; + u32 unk10_6 : 1; + u32 pad10_5 : 1; + u32 unk10_4 : 4; + u32 pad10_0 : 1; +} NodeProp; + +typedef struct cude_s{ + s32 x:5; + s32 y:5; + s32 z:5; + u32 prop1Cnt:6; + u32 prop2Cnt:6; + u32 unk0_4:5; + NodeProp *prop1Ptr; + Prop *prop2Ptr; +}Cube; + +typedef struct actor_array{ + s32 cnt; + s32 max_cnt; + Actor data[]; //variable size array +}ActorArray; + +#endif diff --git a/include/rand.h b/include/rand.h new file mode 100644 index 00000000..85764b9d --- /dev/null +++ b/include/rand.h @@ -0,0 +1,8 @@ +#ifndef __RANDOM_H__ +#define __RANDOM_H__ +#include + +f32 randf (void); +f32 randf2(f32 min, f32 max); +s32 randi2(s32 min, s32 max); +#endif diff --git a/include/rarezip.h b/include/rarezip.h new file mode 100644 index 00000000..d66d058c --- /dev/null +++ b/include/rarezip.h @@ -0,0 +1,51 @@ +#ifndef RAREZIP_H +#define RAREZIP_H +#include + +extern struct huft *D_80007270; + +extern u8 *inbuf; //inbuf +extern u8 *D_80007284; //slide +extern u32 inptr; //inptr +extern u32 wp; //wp +extern struct huft *D_80007290; //unk +extern u32 bb; //bb +extern u32 bk; //bk +extern u32 crc1; //crc1 +extern u32 crc2; //crc2 +extern u32 hufts; //hufts + + +#ifndef WSIZE +# define WSIZE 0x8000 /* window size--must be a power of two, and */ +#endif /* at least 32K for zip's deflate method */ + +//#define get_byte() (inptr < insize ? inbuf[inptr++] : fill_inbuf(0)) +#define get_byte() (inbuf[inptr++]) + +#ifdef CRYPT + uch cc; +# define NEXTBYTE() \ + (decrypt ? (cc = get_byte(), zdecode(cc), cc) : get_byte()) +#else +# define NEXTBYTE() (u8)get_byte() +#endif +#define NEEDBITS(n) {while(k<(n)){b|=((u32)NEXTBYTE())<>=(n);k-=(n);} + +struct huft { + u8 e; /* number of extra bits or operation */ + u8 b; /* number of bits in this code or subcode */ + union { + u16 n; /* literal, length base, or distance base */ + struct huft *t; /* pointer to next level of table */ + } v; +}; + +/* If BMAX needs to be larger than 16, then h and x[] should be ulg. */ +#define BMAX 16 /* maximum bit length of any code (16 for explode) */ +#define N_MAX 288 /* maximum number of codes in any set */ + +int bkboot_inflate(void); + +#endif diff --git a/include/save.h b/include/save.h new file mode 100644 index 00000000..8ed8dc73 --- /dev/null +++ b/include/save.h @@ -0,0 +1,23 @@ +#ifndef __SAVE_H__ +#define __SAVE_H__ + +typedef struct { + u8 unk0[0x4]; + u8 unk4[0x14]; + u8 pad28[0x5C]; + u32 checksum; +}SaveFile; + +typedef struct{ + u8 unk0; + u8 unk1; + u8 pad2[0x76]; +}SaveData; + +typedef struct { + u8 unk0[0x04]; + u8 unk4[0x18]; + u32 checksum; +}SaveSettings; + +#endif diff --git a/include/seqp.h b/include/seqp.h new file mode 100755 index 00000000..c9ab02ba --- /dev/null +++ b/include/seqp.h @@ -0,0 +1,37 @@ + + +#define KILL_TIME 50000 /* 50 ms */ + +#ifndef MIN +#define MIN(a,b) (((a)<(b))?(a):(b)) +#endif + +#ifndef MAX +#define MAX(a,b) (((a)>(b))?(a):(b)) +#endif + +ALVoiceState *__mapVoice(ALSeqPlayer *, u8, u8, u8); +void __unmapVoice(ALSeqPlayer *seqp, ALVoice *voice); +char __voiceNeedsNoteKill(ALSeqPlayer *seqp, ALVoice *voice, ALMicroTime killTime); /* sct 1/5/96 */ + +ALVoiceState *__lookupVoice(ALSeqPlayer *, u8, u8); +ALSound *__lookupSound(ALSeqPlayer *, u8, u8, u8); +ALSound *__lookupSoundQuick(ALSeqPlayer *, u8, u8, u8); + +s16 __vsVol(ALVoiceState *voice, ALSeqPlayer *seqp); +ALMicroTime __vsDelta(ALVoiceState *voice, ALMicroTime t); +ALPan __vsPan(ALVoiceState *voice, ALSeqPlayer *seqp); + +void __initFromBank(ALSeqPlayer *seqp, ALBank *b); +void __initChanState(ALSeqPlayer *seqp); +void __resetPerfChanState(ALSeqPlayer *seqp, s32 chan); +void __setInstChanState(ALSeqPlayer *seqp, ALInstrument *inst, s32 chan); + +void __seqpPrintVoices(ALSeqPlayer *); +void __seqpReleaseVoice(ALSeqPlayer *seqp, ALVoice *voice, + ALMicroTime deltaTime); + +void __seqpStopOsc(ALSeqPlayer *seqp, ALVoiceState *vs); + +void __postNextSeqEvent(ALSeqPlayer *seqp); /* sct 11/7/95 */ + diff --git a/include/stdarg.h b/include/stdarg.h new file mode 100644 index 00000000..a5d0b13f --- /dev/null +++ b/include/stdarg.h @@ -0,0 +1,42 @@ +#ifndef STDARG_H +#define STDARG_H + +// When not building with IDO, use the builtin vaarg macros for portability. +#ifndef __sgi +#define va_list __builtin_va_list +#define va_start __builtin_va_start +#define va_arg __builtin_va_arg +#define va_end __builtin_va_end +#else + +typedef char *va_list; +#define _FP 1 +#define _INT 0 +#define _STRUCT 2 + +#define _VA_FP_SAVE_AREA 0x10 +#define _VA_ALIGN(p, a) (((unsigned int)(((char *)p) + ((a) > 4 ? (a) : 4) - 1)) & -((a) > 4 ? (a) : 4)) +#define va_start(vp, parmN) (vp = ((va_list)&parmN + sizeof(parmN))) + +#define __va_stack_arg(list, mode) \ + ( \ + ((list) = (char *)_VA_ALIGN(list, __builtin_alignof(mode)) + \ + _VA_ALIGN(sizeof(mode), 4)), \ + (((char *)list) - (_VA_ALIGN(sizeof(mode), 4) - sizeof(mode)))) + +#define __va_double_arg(list, mode) \ + ( \ + (((long)list & 0x1) /* 1 byte aligned? */ \ + ? (list = (char *)((long)list + 7), (char *)((long)list - 6 - _VA_FP_SAVE_AREA)) \ + : (((long)list & 0x2) /* 2 byte aligned? */ \ + ? (list = (char *)((long)list + 10), (char *)((long)list - 24 - _VA_FP_SAVE_AREA)) \ + : __va_stack_arg(list, mode)))) + +#define va_arg(list, mode) ((mode *)(((__builtin_classof(mode) == _FP && \ + __builtin_alignof(mode) == sizeof(double)) \ + ? __va_double_arg(list, mode) \ + : __va_stack_arg(list, mode))))[-1] +#define va_end(__list) + +#endif +#endif diff --git a/include/string.h b/include/string.h new file mode 100644 index 00000000..5bb8ee7f --- /dev/null +++ b/include/string.h @@ -0,0 +1,18 @@ +#ifndef STRING_H +#define STRING_H + +#include "structs.h" + +void strcat(char *dst, char *src); +void strcatc(char *dst, char src); +void strFToA(char *dst, f32 val); +void _strFToA(char *dst, f32 val, s32 decPlaces); +void strIToA(char *str, s32 num); +void _strIToA(char *str, s32 num, char base); +void strcpy(char *dst, char *src); +s32 strlen(char *str); +void strToUpper(char *str); + + + +#endif diff --git a/include/structs.h b/include/structs.h new file mode 100644 index 00000000..5c89b946 --- /dev/null +++ b/include/structs.h @@ -0,0 +1,873 @@ +#ifndef STRUCTS_H +#define STRUCTS_H + +#include +#include "model.h" +#define MERGE(a, b) a ## b + +#define UNK_TYPE(t) t + +typedef int bool; + +typedef struct{ + f32 x; + f32 y; + f32 z; +} vec3f; + +#define TUPLE(t, n) union{\ + struct{ t n##_x; t n##_y; t n##_z; };\ + struct{ t n##_pitch; t n##_yaw; t n##_roll; };\ + t n[3];\ +} + +#define PAIR(t, n) union{\ + struct{ t n##_first; t n##_second;};\ + struct{ t n##_min; t n##_max;};\ + struct{ t n##_x; t n##_y;};\ + t n[2];\ +} + +#define TUPLE_PAIR(t, n) union{\ + struct{ TUPLE(t, n##_min); TUPLE(t, n##_max);};\ + t n[2][3];\ +} + + +typedef struct variable_length_array{ + s32 elem_size; + void * begin; + void * end; + void * mem_end; + u8 data[]; +}VLA; + +#define vector(T) struct variable_length_array +//^defined to keep element type with vla + +typedef struct static_length_array{ + s16 elem_size; + s16 elem_cnt; + u8 unk4[]; +}SLA; + +#define array(T) struct static_length_array +//^defined to keep element type with sla + +typedef struct bk_sprite_s{ + s16 frameCnt; + s16 type; + s16 unk4; + s16 unk6; + s16 unk8; + s16 unkA; + u8 unkC[4]; + s32 offsets[]; +} BKSprite; + +typedef struct{ + Gfx *gfx; //gfx_offset + Vtx *vtx; //vtx_offset +}BKSpriteFrameDisplayData; + +typedef struct{ + BKSprite *sprite; + BKSpriteFrameDisplayData frame[]; +}BKSpriteDisplayData; + +typedef struct bk_sprite_frame_s{ + s16 unk0; + s16 unk2; + s16 w; + s16 h; + s16 chunkCnt; + s16 unkA; + s16 unkC; + s16 unkE; + s16 unk10; + s16 unk12; +} BKSpriteFrame; + +typedef struct bk_sprite_texture_block_s{ + s16 x; + s16 y; + s16 w; + s16 h; +} BKSpriteTextureBlock; + +typedef struct model_cache_s{ + BKModelBin * modelPtr; + BKSprite * unk4; + BKSpriteDisplayData *unk8; + u32 unkC; + u32 unk10; +} ModelCache; + +typedef struct portrait_voice_s{ + u16 sfxIndex; + u8 pad2[2]; + f32 duration; +} PortraitVoice; + +typedef struct portrait_info_s{ + u16 assetIndx; + u8 pad2[2]; + PortraitVoice voiceInfo[5]; +} PortraitInfo; + +typedef struct struct_60_s{ + s16 unk0[3]; + s16 unk6; + s32 unk8; +}Struct60s; + +typedef struct struct_0_s{ //floor + void * model; + Struct60s unk4; + Struct60s unk10; + f32 unk1C[3]; + f32 unk28[3]; + f32 normX; + f32 normY; + f32 normZ; + f32 posX; //40 + f32 posY; //44 + f32 posZ; //48 + union{ + struct{ + u32 unk4C_0:32; + }; + u32 unk4C; + }; + s16 unk50; + s16 unk52; + u32 unk54; + u8 unk58; + u8 unk59; + u8 unk5A; + u8 unk5B; + u8 unk5C; + u8 unk5D; + u8 unk5E; + u8 unk5F; +} struct0; //geo(used for floor) + +typedef struct struct_2_s{ + f32 unk0; + u8 unk4; //argument_count + u8 unk5; + u8 pad6[2]; + u32 unk8; + s32 unkC; + s32 unk10; + void *unk14; //function_ptr +} struct2s; + +typedef struct struct_3_s{ + u32 unk0; + f32 unk4[3]; + f32 unk10[3]; + u8 unk1C; + u8 pad1D[0x3]; + vector(struct struct_4_s) *unk20; + s32 unk24; + s32 unk28; + void *unk2C; + f32 unk30; + u8 unk34; + u8 pad35[0x3]; + f32 unk38; + f32 unk3C; + f32 unk40[0x4]; +} struct3s; + +typedef struct struct_4_s{ + f32 unk0[3]; + f32 unkC[3]; + u8 unk18; + u8 pad19[3]; +} struct4s; + +typedef struct struct_5_s{ + BKModelBin *unk0; + f32 unk4[3]; + f32 unk10[3]; + f32 unk1C[3]; + f32 unk28[3]; + u8 unk34; + u8 pad35[0x3]; +}struct5s; + +typedef struct struct_6_s{ + f32 unk0; + f32 unk4; + f32 unk8; + f32 unkC; + f32 unk10; + f32 unk14; + u32 unk18; + vector(struct5s) *unk1C; + s16 unk20; + u8 unk22; + u8 pad23[1]; + void *unk24[4]; + u8 unk34; + u8 pad35[0x3]; + f32 unk38; +}struct6s; + +typedef struct struct_8_s{ + s32 unk0; + s32 unk4; + f32 unk8; + f32 unkC; + f32 unk10; + s32 unk14; + s32 unk18; + f32 unk1C; + u32 unk20; //item_id + s32 unk24; //asset_id + u32 unk28; + s32 unk2C; + f32 unk30; + f32 unk34; + f32 unk38; //added to x string print position (position?) + f32 unk3C; //added to y string print position (position?) + f32 unk40; //scale??? + f32 unk44; //added to x string print position (sprite w) + f32 unk48; //added to y string print position (sprite h) + f32 unk4C; + u32 unk50; //asset_ptr (indx in unk24) + s8 string_54[0xC]; //value string + f32 unk60; +}struct8s; + +typedef struct struct_9_s{ + u8 uid; + u8 unk1; + u8 unk2; + u8 pad3[1]; + f32 unk4; //duration + s32 unk8; //asset_indx + s32 unkC; //animation_indx + f32 unk10; +}struct9s; + +typedef struct struct_10_s{ + u8 map_indx; + u8 unk1; + u8 unk2; +}struct10s; + +typedef struct struct_11_s{ + f32 unk0; + f32 unk4; + s32 unk8; + s32 unkC; + s16 unk10; //trackId + s16 unk12; + u8 unk14; + u8 unk15; + u8 pad16[0x2]; + array(struct12s) *unk18; + s32 unk1C[0xE]; +} CoMusic; + +typedef struct struct_12_s{ + s32 unk0; + s32 unk1; +} struct12s; + +typedef struct struct_13_s{ + s32 cmd; + u8* str; +}struct13s; + +typedef struct struct_14_s{ + s16 unk0; + s16 unk2; + TUPLE(f32, unk4); + struct actorMarker_s *unk10; + s32 unk14; + void (*unk18)(struct actorMarker_s *, s32, s32); + void (*unk1C)(struct actorMarker_s *, s32, s32); + s32 unk20; +}struct14s; + +typedef struct struct_15_s{ + u8 unk0_7:2; + u8 unk0_5:2; + u8 pad0_3:4; +}struct15s; + +typedef struct struct_16_s{ + s32 unk0; + s32 unk4; + s32 unk8; + s32 unkC; +}struct16s; + +typedef struct struct_18_s{ + s16 uid; /* enum sfx_e */ + s16 unk2; + f32 unk4; +}struct18s; + +typedef struct struct_17_s{ + s16 uid; + s8 unk2; + s8 unk3; + struct18s soundInfo[5]; +}struct17s; + +typedef struct struct_1A_s{ + u8 pad0[0x8]; + u8 *str; + s16 unkC; + u8 unkE; + u8 unkF; +}struct1As; + +typedef struct struct_1B_s{ + s16 map; + s16 exit; +}struct1Bs; + +typedef struct struct_1C_s{ + s8 unk0; + s8 unk1; + s16 x; //0x2 + u8 *string; //0x4 +}struct1Cs; + +typedef struct struct_1D_s{ + BKModel *unk0; + s16 unk4; + u8 unk6; + u8 pad7[1]; + u8 pad8[0xA0];//union of subtypes +}struct1Ds; + +typedef struct struct_1E_s{ + void (* unk0)(void * arg0, s32 arg1, s32 arg2, s32 arg3); + void (* unk4)(void * arg0, s32 arg1, s32 arg2); + void (* unk8)(void * arg0); +}struct1Es; + +typedef struct struct_21_s{ + s32 unk0; + void * unk1; +}struct21s; + +//particle +typedef struct struct_2F_s{ + f32 unk0[3]; + f32 unkC; + f32 frame_10; //frame + f32 framerate_14; //framerate + f32 position_18[3]; + f32 unk24[3]; + f32 size_30; //size + f32 initialSize_34; //initial_size + f32 finalSizeDiff; //delta_size + f32 unk3C[3]; + f32 age_48; + f32 lifetime_4C; + f32 velocity_50[3]; + u8 unk5C; + u8 pad5D[3]; +} Particle; + +//particle_ctrl +typedef struct struct_30_s{ + u32 pad0_31:8; + u32 doneSpawning_0_23:7; //doneSpawning + u32 unk0_16:1; + u32 assetId_0_15:14; //uid + u32 unk0_1:1; + u32 unk0_0:1; + f32 unk4[3]; + f32 unk10; + f32 unk14; + u32 unk18; + BKSprite *sprite_1C; //sprite_ptr + BKModelBin *model_20; //model_ptr + f32 particleSpawnTimer_24; //particleSpawnTimer? + f32 postion_28[3]; //position + BKSpriteDisplayData *unk34; + f32 spawnIntervalTimer_38; //spawnIntervalTimer + s32 unk3C[3]; + u8 sphericalParticleVelocity_48; //sphericalParticalVelocity + u8 unk49; + u8 pad4A[0x2]; + TUPLE_PAIR(f32, particleAccerationRange_4C); + s16 unk64; + s16 unk66; + f32 unk68; + f32 unk6C; + f32 unk70; + f32 unk74; + f32 unk78; + s32 unk7C; + void (*particleCallback_80)(struct struct_30_s *, f32 [3]); //particleCallback + PAIR(s32, particleStartingFrameRange_84); + PAIR(f32, particleFramerateRange_8C); + TUPLE_PAIR(f32, particleSpawnPositionRange_94); + PAIR(f32, particleStartingScaleRange_AC); + PAIR(f32, particleFinalScaleRange_B4); + f32 unkBC[3]; + f32 unkC8[3]; + PAIR(f32, spawnIntervalRange_D4); + f32 unkDC[2]; //particleLifetimeRange + union + { + TUPLE_PAIR(f32, cartisian); + struct{ + PAIR(f32, yaw); + PAIR(f32, pitch); + PAIR(f32, radius); + }spherical; + } particleVelocityRange_E4; + f32 unkFC; + s32 unk100; + s16 unk104; + u8 pad106[0x2]; + f32 unk108; + f32 unk10C[3]; + f32 unk118[3]; + Particle *pList_start_124; //start_ptr? + Particle *pList_end_128; //end_ptr + Particle *pList_capacity_12C; //capacity_end_ptr; + Particle data[];//end of struct 0x130 +} ParticleEmitter; + +typedef struct struct_31_s{ + f32 unk0[2]; + f32 unk8[2]; + f32 unk10[2]; + f32 unk18[2]; + f32 unk20; + f32 unk24; +} struct31s; + +typedef struct struct_32_s{ + f32 unk0[3]; + f32 unkC[3]; +} struct32s; + +typedef struct struct_33_s{ + f32 unk0[3]; + f32 unkC[3]; +} struct33s; + +typedef struct struct_34_s{ + f32 unk0[3]; + f32 unkC[3]; +} struct34s; + +typedef struct struct_40_s{ + struct31s unk0; + f32 unk28; + f32 unk2C; +} struct40s; + +typedef struct struct_41_s{ + struct32s unk0; + struct33s unk18; +} struct41s; + +typedef struct struct_42_s{ + struct32s unk0; + struct34s unk18; +} struct42s; + +typedef struct struct_43_s{ + struct32s unk0; + struct33s unk18; + struct34s unk30; +} struct43s; + +typedef struct { + u32 unk0_31:11; + u32 unk0_20:10; + u32 unk0_10:11; +}struct44s; + +typedef struct { + struct struct_81_s *unk0; + s32 unk4; +}struct46s; + + +typedef struct { + s16 unk0; + u8 pad2[0x2]; + f32 unk4; + f32 unk8; +}struct47s; + +typedef struct { + s16 map; + u8 pad2[2]; + struct47s unk4[3]; +}struct48s; + + + +typedef struct{ + f32 unk0[3]; + f32 unkC[3]; + u8 unk18; + u8 pad19[3]; + struct struct_4D_s *unk1C; +}struct4Cs; + +typedef struct struct_4D_s{ + u8 unk0[0x18]; +}struct4Ds; + +typedef struct{ + u8 unk0; + u8 pad1[0x3]; + f32 unk4; + f32 unk8; + f32 unkC; + f32 unk10; + f32 unk14; + f32 unk18; + f32 unk1C; + f32 unk20; + f32 unk24; + f32 unk28; + f32 unk2C; + f32 unk30; + f32 unk34; + s16 unk38; + s16 unk3A; + u8 unk3C; + u8 unk3D; + u8 unk3E; + u8 unk3F; +}struct4Es; + +typedef struct{ + u8 unk0; + u8 unk1; + f32 unk4[3]; +}struct50s; + +typedef struct{ + s16 unk0; + u8 pad2[4]; + s16 unk6; + u8 pad8[4]; +}struct51s; + +typedef struct{ + s32 unk0; + u8 pad4[8]; +}struct52s; + +typedef struct{ + u8 unk0; + u8 unk1; +} struct53s; + +typedef struct{ + struct53s *unk0; + f32 unk4; + f32 unk8; + u32 unkC_31:7; + u32 unkC_24:7; + u32 unkC_17:7; + u32 unkC_10:7; + u32 unkC_3:2; + u32 unkC_1:1; + u32 unkC_0:1; +} struct54s; + +typedef struct{ + s32 unk0; + s32 unk4; + f32 unk8[0][3]; +} struct56s; + +typedef struct{ + Mtx mtx_0; + s32 size_40; + s32 capacity_44; + Mtx data[]; +}struct58s; + +typedef struct { + f32 (*unk0)[3]; + f32 (*unk4)[3]; +}struct5Bs; + +typedef struct{ + u16 unk0_15 : 4; + u16 unk0_11 : 2; + u16 unk0_9 : 3; + u16 unk0_6 : 2; + u16 unk0_4 : 3; + u16 unk0_1 : 2; +}struct5Cs; + +typedef struct struct_5d_s{ + s32 unk0; + f32 unk4[3]; + f32 unk10; + void (*unk14)(struct struct_5d_s *, s32); + void (*unk18)(struct struct_5d_s *, s32); + u8 unk1C; + u8 unk1D; + u8 unk1E; + u8 unk1F; +}Struct5Ds; + +typedef struct struct_5e_s{ + u8 pad0[0x8]; + union{ + u32 unk8; + struct{ + u32 pad8_31 : 4; + s32 unk8_27 : 1; + u32 pad8_26 : 27; + }; + }; +}Struct5Es; + +typedef struct { + f32 unk0; + f32 unk4; + u8 unk8; + u8 unk9; + u8 unkA; + //u8 padB; + f32 unkC; + f32 unk10; + f32 unk14; +} Struct5Fs; + +//Struct60s moved to top + +typedef struct{ + void *unk0; + void *unk4; + void *unk8; //start_ptr + void *unkC; //current_ptr + void *unk10; //end_ptr + s32 unk14; + u8 pad18[0x64]; + s32 unk7C; + s32 unk80; +}Struct61s; //file stream + +typedef struct { + s16 unk0; + // u8 pad2[2]; + struct struct_63_s *unk4; +}Struct62s; + +typedef struct struct_63_s{ + s16 unk0; + // u8 pad2[2]; + void (*unk4)(s32, struct actor_marker_s *); +} Struct63s; + +typedef struct struct_64_s{ + struct struct_65_s *unk0; + s32 unk4; +} Struct64s; + +typedef struct struct_65_s{ + f32 unk0[3]; + struct actor_marker_s *unkC; + s32 (*unk10)(f32[3], f32, struct actor_marker_s *); + s16 unk14[3]; + s16 unk1A[3]; + u8 unk20; + u8 unk21; + u8 unk22; + u8 unk23; + s8 unk24; + u8 unk25; + u8 unk26; + u8 unk27; +}Struct65s; + +typedef struct struct_66_s{ + u8 pad0[0x8]; + s32 unk8; +}Struct66s; + +typedef void (*Struct68DrawMethod)(void *, struct struct_68_s *, f32[3], f32[3], f32, BKModelBin*, Gfx**, Mtx**, Vtx**); + +typedef struct struct_68_s{ + u8 unk0; + // u8 pad1[0x3]; + struct actor_marker_s *unk4; + Struct68DrawMethod unk8; + BKModelBin *unkC; + u8 pad10[0x4]; + f32 unk14[3]; //position + f32 unk20[3]; //rotation + f32 unk2C; //scale + u8 unk30; + u8 unk31; + u8 pad32[2]; + u8 local[0x80]; +} Struct68s; + +typedef struct { + f32 unk0; + f32 unk4[3]; + f32 unk10[3]; + f32 unk1C[3]; + f32 unk28[3]; + f32 unk34; +} Struct6Bs; + +typedef struct{ + s32 (* unk0)(struct actor_marker_s *, f32[3], f32, f32[3], s32); + s32 (* unk4)(struct actor_marker_s *, f32[3], f32, f32[3], s32); + s32 (* unk8)(struct actor_marker_s *, f32[3], f32, f32[3], s32); + s32 (* unkC)(struct actor_marker_s *, f32[3], f32, f32[3], s32); +} Struct6Cs; + +typedef struct struct_6D_s{ + u8 unk0; + // u8 pad1[3]; + f32 unk4; + f32 unk8; + void (*unkC)(struct struct_6D_s *); + void (*unk10)(struct struct_6D_s *); + s16 unk14[3];//min_vtx + s16 unk1A[3];//max_vtx + f32 unk20; + f32 unk24; + u8 unk28; + u8 unk29; + u8 pad2A[2]; + f32 unk2C[3]; + f32 unk38[3]; + f32 unk44; + f32 unk48; + s16 unk4C; + s16 unk4E; + f32 unk50[4]; + f32 unk60[4]; + f32 unk70; + f32 unk74; + f32 unk78[3]; + f32 unk84; + f32 unk88[3]; + f32 unk94; + f32 unk98; + f32 unk9C; +}Struct6Ds; + + + +typedef struct { + f32 unk0; + f32 unk4; +}Struct6Fs; + +typedef struct { + s32 unk0; + f32 unk4; + f32 unk8; + f32 unkC; +}Struct71s; + +typedef struct { + f32 unk0; +}Struct72s; + +typedef struct { + s16 d_tc[2]; + f32 unk4; + f32 unk8; + s16 unkC; + s16 unkE; + s16 dy; + //u8 pad12[2]; + f32 unk14; + f32 unk18; + f32 unk1C; +}Struct73s; + +typedef struct { + u8 pad0[0x4]; + f32 unk4; + f32 unk8; + f32 unkC; + f32 unk10; + f32 unk14; + u8 unk18[0x8]; + f32 unk20; + f32 unk24; + f32 unk28[2]; +}Struct74s; + +typedef struct { + f32 unk0; +}Struct75s; + +typedef struct { + s16 alpha; + s16 unk2; + s32 unk4; + s32 unk8; + s32 unkC; + f32 unk10; + f32 unk14; +}Struct76s; + +typedef union { + Struct6Ds type_6D; + Struct6Fs type_6F; + Struct71s type_71; + Struct72s type_72; + Struct73s type_73; + Struct74s type_74; +}Struct70s; + +typedef struct { + u8 unk0; + // u8 pad1[0x3]; + BKModel *unk4; + s16 unk8; + u8 padA[2]; + Struct70s unkC; +}Struct6Es; + +typedef struct { + f32 unk0; + u8 unk4; + u8 pad5[0x3]; + void (* unk8)(struct actor_marker_s *); + s32 unkC; +}Struct7Fs; + +typedef struct { + s32 unk0; + struct animation_file_s *unk4; + f32 unk8; + f32 unkC; + vector(Struct7Fs) *unk10; + u8 unk14; + u8 unk15; + s16 unk16; + s32 unk18; + f32 unk1C; + f32 unk20; + s32 unk24; + s32 unk28; + f32 unk2C; + u8 unk30; + // u8 pad31[3]; +}Struct80s; + +#endif diff --git a/include/synthInternals.h b/include/synthInternals.h new file mode 100755 index 00000000..d25bb944 --- /dev/null +++ b/include/synthInternals.h @@ -0,0 +1,340 @@ +/*==================================================================== + * audioInternals.h + * + * Synopsis: + * + * Copyright 1993, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ + +#ifndef __audioInternals__ +#define __audioInternals__ + +#include + +/* + * filter message ids + */ +enum { + AL_FILTER_FREE_VOICE, + AL_FILTER_SET_SOURCE, + AL_FILTER_ADD_SOURCE, + AL_FILTER_ADD_UPDATE, + AL_FILTER_RESET, + AL_FILTER_SET_WAVETABLE, +/* AL_FILTER_SET_DMA_PROC,*/ +/* AL_FILTER_SKIP_LOOP,*/ + AL_FILTER_SET_DRAM, + AL_FILTER_SET_PITCH, + AL_FILTER_SET_UNITY_PITCH, + AL_FILTER_START, +/* AL_FILTER_SET_DECAY,*/ +/* AL_FILTER_SET_FC,*/ + AL_FILTER_SET_STATE, + AL_FILTER_SET_VOLUME, + AL_FILTER_SET_PAN, + AL_FILTER_START_VOICE_ALT, + AL_FILTER_START_VOICE, + AL_FILTER_STOP_VOICE, + AL_FILTER_SET_FXAMT +}; + +#define AL_MAX_RSP_SAMPLES 160 + +/* + * buffer locations based on AL_MAX_RSP_SAMPLES + */ +#define AL_DECODER_IN 0 +#define AL_RESAMPLER_OUT 0 +#define AL_TEMP_0 0 +#define AL_DECODER_OUT 320 +#define AL_TEMP_1 320 +#define AL_TEMP_2 640 +#define AL_MAIN_L_OUT 1088 +#define AL_MAIN_R_OUT 1408 +#define AL_AUX_L_OUT 1728 +#define AL_AUX_R_OUT 2048 + +/* + * filter types + */ +enum { + AL_ADPCM, + AL_RESAMPLE, + AL_BUFFER, + AL_SAVE, + AL_ENVMIX, + AL_FX, + AL_AUXBUS, + AL_MAINBUS +}; + +typedef struct ALParam_s { + struct ALParam_s *next; + s32 delta; + s16 type; + union { + f32 f; + s32 i; + } data; + union { + f32 f; + s32 i; + } moredata; + union { + f32 f; + s32 i; + } stillmoredata; + union { + f32 f; + s32 i; + } yetstillmoredata; +} ALParam; + +typedef struct { + struct ALParam_s *next; + s32 delta; + s16 type; + s16 unity; /* disable resampler */ + f32 pitch; + s16 volume; + ALPan pan; + u8 fxMix; + s32 samples; + struct ALWaveTable_s *wave; +} ALStartParamAlt; + +typedef struct { + struct ALParam_s *next; + s32 delta; + s16 type; + s16 unity; /* disable resampler */ + struct ALWaveTable_s *wave; +} ALStartParam; + +typedef struct { + struct ALParam_s *next; + s32 delta; + s16 type; + struct PVoice_s *pvoice; +} ALFreeParam; + +typedef Acmd *(*ALCmdHandler)(void *, s16 *, s32, s32, Acmd *); +typedef s32 (*ALSetParam)(void *, s32, void *); + +typedef struct ALFilter_s { + struct ALFilter_s *source; + ALCmdHandler handler; + ALSetParam setParam; + s16 inp; + s16 outp; + s32 type; +} ALFilter; + +void alFilterNew(ALFilter *f, ALCmdHandler h, ALSetParam s, s32 type); + +#define AL_MAX_ADPCM_STATES 3 /* Depends on number of subframes + * per frame and loop length + */ +typedef struct { + ALFilter filter; + ADPCM_STATE *state; + ADPCM_STATE *lstate; + ALRawLoop loop; + struct ALWaveTable_s *table; + s32 bookSize; + ALDMAproc dma; + void *dmaState; + s32 sample; + s32 lastsam; + s32 first; + s32 memin; +} ALLoadFilter; + +void alLoadNew(ALLoadFilter *f, ALDMANew dma, ALHeap *hp); +Acmd *alAdpcmPull(void *f, s16 *outp, s32 byteCount, s32 sampleOffset, Acmd *p); +Acmd *alRaw16Pull(void *f, s16 *outp, s32 byteCount, s32 sampleOffset, Acmd *p); +s32 alLoadParam(void *filter, s32 paramID, void *param); + +typedef struct ALResampler_s { + ALFilter filter; + RESAMPLE_STATE *state; + f32 ratio; + s32 upitch; + f32 delta; + s32 first; + ALParam *ctrlList; + ALParam *ctrlTail; + s32 motion; +} ALResampler; + +typedef struct { + s16 fc; + s16 fgain; + union { + s16 fccoef[16]; + s64 force_aligned; + } fcvec; + POLEF_STATE *fstate; + s32 first; +} ALLowPass; + +typedef struct { + u32 input; + u32 output; + s16 ffcoef; + s16 fbcoef; + s16 gain; + f32 rsinc; + f32 rsval; + s32 rsdelta; + f32 rsgain; + ALLowPass *lp; + ALResampler *rs; +} ALDelay; + +typedef s32 (*ALSetFXParam)(void *, s32, void *); +typedef struct { + struct ALFilter_s filter; + s16 *base; + s16 *input; + u32 length; + ALDelay *delay; + u8 section_count; + ALSetFXParam paramHdl; +} ALFx; + +void alFxNew(ALFx *r, ALSynConfig *c, ALHeap *hp); +Acmd *alFxPull(void *f, s16 *outp, s32 out, s32 sampleOffset, Acmd *p); +s32 alFxParam(void *filter, s32 paramID, void *param); +s32 alFxParamHdl(void *filter, s32 paramID, void *param); + +#define AL_MAX_MAIN_BUS_SOURCES 1 +typedef struct ALMainBus_s { + ALFilter filter; + s32 sourceCount; + s32 maxSources; + ALFilter **sources; +} ALMainBus; + +void alMainBusNew(ALMainBus *m, void *ptr, s32 len); +Acmd *alMainBusPull(void *f, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p); +s32 alMainBusParam(void *filter, s32 paramID, void *param); + +#define AL_MAX_AUX_BUS_SOURCES 8 +#define AL_MAX_AUX_BUS_FX 1 +typedef struct ALAuxBus_s { + ALFilter filter; + s32 sourceCount; + s32 maxSources; + ALFilter **sources; + ALFx fx[AL_MAX_AUX_BUS_FX]; +} ALAuxBus; + +void alAuxBusNew(ALAuxBus *m, void *ptr, s32 len); +Acmd *alAuxBusPull(void *f, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p); +s32 alAuxBusParam(void *filter, s32 paramID, void *param); + +void alResampleNew(ALResampler *r, ALHeap *hp); +Acmd *alResamplePull(void *f, s16 *outp, s32 out, s32 sampleOffset, Acmd *p); +s32 alResampleParam(void *f, s32 paramID, void *param); + +typedef struct ALSave_s { + ALFilter filter; + s32 dramout; + s32 first; +} ALSave; + +void alSaveNew(ALSave *r); +Acmd *alSavePull(void *f, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p); +s32 alSaveParam(void *f, s32 paramID, void *param); + +typedef struct ALEnvMixer_s { + ALFilter filter; + ENVMIX_STATE *state; + s16 pan; + s16 volume; + s16 cvolL; + s16 cvolR; + s16 dryamt; + s16 wetamt; + u16 lratl; + s16 lratm; + s16 ltgt; + u16 rratl; + s16 rratm; + s16 rtgt; + s32 delta; + s32 segEnd; + s32 first; + ALParam *ctrlList; + ALParam *ctrlTail; + ALFilter **sources; + s32 motion; +} ALEnvMixer; + +void alEnvmixerNew(ALEnvMixer *e, ALHeap *hp); +Acmd *alEnvmixerPull(void *f, s16 *outp, s32 out, s32 sampleOffset, Acmd *p); +s32 alEnvmixerParam(void *filter, s32 paramID, void *param); + + +/* + * heap stuff + */ +typedef struct { + s32 magic; /* check structure integrety */ + s32 size; /* size of this allocated block */ + u8 *file; /* file that this alloc was called from */ + s32 line; /* line that it was called from */ + s32 count; /* heap call number */ + s32 pad0; + s32 pad1; + s32 pad2; /* Make it 32 bytes */ +} HeapInfo; + +#define AL_CACHE_ALIGN 15 + +/* + * synth stuff + */ + +typedef struct PVoice_s { + ALLink node; + struct ALVoice_s *vvoice; + ALFilter *channelKnob; + ALLoadFilter decoder; + ALResampler resampler; + ALEnvMixer envmixer; + s32 offset; +} PVoice; + + + +/* + * prototypes for private driver functions + */ +ALParam *__allocParam(void); +void __freeParam(ALParam *param); +void _freePVoice(ALSynth *drvr, PVoice *pvoice); +void _collectPVoices(ALSynth *drvr); + +s32 _timeToSamples(ALSynth *drvr, s32 micros); +ALMicroTime _samplesToTime(ALSynth *synth, s32 samples); + + + +#endif + diff --git a/include/variables.h b/include/variables.h new file mode 100644 index 00000000..da10714b --- /dev/null +++ b/include/variables.h @@ -0,0 +1,21 @@ +#ifndef VARIABLES_H +#define VARIABLES_H + +#define RARE_PI 3.141592654 + +#define M_TAU (2*M_PI) + + +struct Overlay { + void *start; + void *end; +}; + +extern struct Overlay gOverlayTable[]; + +extern s32 D_80276588; +extern s32 D_8027658C; + +extern f32 climbPoleBottom[3]; +extern f32 climbPoleTop[3]; +#endif diff --git a/include/viint.h b/include/viint.h new file mode 100644 index 00000000..68b53610 --- /dev/null +++ b/include/viint.h @@ -0,0 +1,70 @@ +#ifndef _VIINT_H +#define _VIINT_H +#include + +#define OS_TV_TYPE_PAL 0 +#define OS_TV_TYPE_NTSC 1 +#define OS_TV_TYPE_MPAL 2 + +//TODO: figure out what this is +#define VI_STATE_01 0x01 +#define VI_STATE_XSCALE_UPDATED 0x02 +#define VI_STATE_YSCALE_UPDATED 0x04 +#define VI_STATE_08 0x08 //related to control regs changing +#define VI_STATE_10 0x10 //swap buffer +#define VI_STATE_BLACK 0x20 //probably related to a black screen +#define VI_STATE_REPEATLINE 0x40 //repeat line? +#define VI_STATE_FADE 0x80 //fade + +#define VI_CTRL_ANTIALIAS_MODE_3 0x00300 /* Bit [9:8] anti-alias mode */ +#define VI_CTRL_ANTIALIAS_MODE_2 0x00200 /* Bit [9:8] anti-alias mode */ +#define VI_CTRL_ANTIALIAS_MODE_1 0x00100 /* Bit [9:8] anti-alias mode */ + +#define VI_SCALE_MASK 0xfff //see rcp scale_x/scale_y +#define VI_2_10_FPART_MASK 0x3ff +#define VI_SUBPIXEL_SH 0x10 + +#define BURST(hsync_width, color_width, vsync_width, color_start) \ + (hsync_width | (color_width << 8) | (vsync_width << 16) | (color_start << 20)) +#define WIDTH(v) v +#define VSYNC(v) v +#define HSYNC(duration, leap) (duration | (leap << 16)) +#define LEAP(upper, lower) ((upper << 16) | lower) +#define START(start, end) ((start << 16) | end) + +#define FTOFIX(val, i, f) ((u32)(val * (f32)(1 << f)) & ((1 << (i + f)) - 1)) + +#define F210(val) FTOFIX(val, 2, 10) +#define SCALE(scaleup, off) (F210((1.0f / (f32)scaleup)) | (F210((f32)off) << 16)) + +#define VCURRENT(v) v //seemingly unused +#define ORIGIN(v) v +#define VINTR(v) v +#define HSTART START + +typedef struct +{ + /* 0x0 */ f32 factor; + /* 0x4 */ u16 offset; + /* 0x8 */ u32 scale; +} __OSViScale; + +typedef struct +{ + /* 0x0 */ u16 state; + /* 0x2 */ u16 retraceCount; + /* 0x4 */ void *framep; + /* 0x8 */ OSViMode *modep; + /* 0xC */ u32 control; + /* 0x10 */ OSMesgQueue *msgq; + /* 0x14 */ OSMesg msg; + /* 0x18 */ __OSViScale x; + /* 0x24 */ __OSViScale y; +} __OSViContext; + +void __osViSwapContext(void); +extern __OSViContext *__osViCurr; +extern __OSViContext *__osViNext; +__OSViContext *__osViGetCurrentContext(void); +void __osViInit(void); +#endif diff --git a/level_symbols.us.v10.txt b/level_symbols.us.v10.txt new file mode 100644 index 00000000..209ecfeb --- /dev/null +++ b/level_symbols.us.v10.txt @@ -0,0 +1,23 @@ +sm_func_80386810 = 0x80386810; +mm_func_803888B0 = 0x803888B0; +ttc_func_80388AC0 = 0x80388AC0; +ttc_func_8038BF8C = 0x8038BF8C; +cc_func_803870E0 = 0x803870E0; +cc_func_80387DA0 = 0x80387DA0; +bgs_func_803885DC = 0x803885DC; +bgs_func_8038F1E0 = 0x8038F1E0; +fp_func_80391324 = 0x80391324; +gv_func_80387118 = 0x80387118; +gv_func_8038F154 = 0x8038F154; +mmm_func_803890E0 = 0x803890E0; +rbb_func_80386C48 = 0x80386C48; +ccw_func_8038DB6C = 0x8038DB6C; +lair_func_8038A0C4 = 0x8038A0C4; +lair_func_8038CD48 = 0x8038CD48; +lair_func_8038CF18 = 0x8038CF18; +lair_func_8038E0B0 = 0x8038E0B0; +lair_func_8038E768 = 0x8038E768; +fight_func_803863F0 = 0x803863F0; +cutscene_func_8038C4E0 = 0x8038C4E0; +func_802DA498 = 0x802DA498; + diff --git a/packages.txt b/packages.txt new file mode 100644 index 00000000..c298e896 --- /dev/null +++ b/packages.txt @@ -0,0 +1,11 @@ +binutils-mips-linux-gnu +build-essential +cmake +gcc-mips-linux-gnu +less +libglib2.0-0 +libssl-dev +python3 +python3-pip +unzip +wget diff --git a/progress/progress_BGS.svg b/progress/progress_BGS.svg new file mode 100644 index 00000000..ad432b0f --- /dev/null +++ b/progress/progress_BGS.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + BGS + BGS + + + 97.1656% + 97.1656% + + \ No newline at end of file diff --git a/progress/progress_CC.svg b/progress/progress_CC.svg new file mode 100644 index 00000000..dc8cafcd --- /dev/null +++ b/progress/progress_CC.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + CC + CC + + + 92.1429% + 92.1429% + + \ No newline at end of file diff --git a/progress/progress_CCW.svg b/progress/progress_CCW.svg new file mode 100644 index 00000000..db7c9a15 --- /dev/null +++ b/progress/progress_CCW.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + CCW + CCW + + + 100.0000% + 100.0000% + + \ No newline at end of file diff --git a/progress/progress_FP.svg b/progress/progress_FP.svg new file mode 100644 index 00000000..b6291413 --- /dev/null +++ b/progress/progress_FP.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + FP + FP + + + 93.8359% + 93.8359% + + \ No newline at end of file diff --git a/progress/progress_GV.svg b/progress/progress_GV.svg new file mode 100644 index 00000000..4a795999 --- /dev/null +++ b/progress/progress_GV.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + GV + GV + + + 100.0000% + 100.0000% + + \ No newline at end of file diff --git a/progress/progress_MM.svg b/progress/progress_MM.svg new file mode 100644 index 00000000..d5ab492e --- /dev/null +++ b/progress/progress_MM.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + MM + MM + + + 100.0000% + 100.0000% + + \ No newline at end of file diff --git a/progress/progress_MMM.svg b/progress/progress_MMM.svg new file mode 100644 index 00000000..09721f69 --- /dev/null +++ b/progress/progress_MMM.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + MMM + MMM + + + 100.0000% + 100.0000% + + \ No newline at end of file diff --git a/progress/progress_RBB.svg b/progress/progress_RBB.svg new file mode 100644 index 00000000..5c9761d1 --- /dev/null +++ b/progress/progress_RBB.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + RBB + RBB + + + 100.0000% + 100.0000% + + \ No newline at end of file diff --git a/progress/progress_SM.svg b/progress/progress_SM.svg new file mode 100644 index 00000000..61e19fb4 --- /dev/null +++ b/progress/progress_SM.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + SM + SM + + + 100.0000% + 100.0000% + + \ No newline at end of file diff --git a/progress/progress_TTC.svg b/progress/progress_TTC.svg new file mode 100644 index 00000000..e4ddd7bf --- /dev/null +++ b/progress/progress_TTC.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + TTC + TTC + + + 84.8564% + 84.8564% + + \ No newline at end of file diff --git a/progress/progress_bk_boot.svg b/progress/progress_bk_boot.svg new file mode 100644 index 00000000..0df03f2f --- /dev/null +++ b/progress/progress_bk_boot.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + bk_boot + bk_boot + + + 100.0000% + 100.0000% + + \ No newline at end of file diff --git a/progress/progress_core1.svg b/progress/progress_core1.svg new file mode 100644 index 00000000..d43aa0fe --- /dev/null +++ b/progress/progress_core1.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + core1 + core1 + + + 69.9776% + 69.9776% + + \ No newline at end of file diff --git a/progress/progress_core2.svg b/progress/progress_core2.svg new file mode 100644 index 00000000..06f9bc16 --- /dev/null +++ b/progress/progress_core2.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + core2 + core2 + + + 73.1304% + 73.1304% + + \ No newline at end of file diff --git a/progress/progress_cutscenes.svg b/progress/progress_cutscenes.svg new file mode 100644 index 00000000..dceb5d5f --- /dev/null +++ b/progress/progress_cutscenes.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + cutscenes + cutscenes + + + 100.0000% + 100.0000% + + \ No newline at end of file diff --git a/progress/progress_fight.svg b/progress/progress_fight.svg new file mode 100644 index 00000000..6fd3aa1f --- /dev/null +++ b/progress/progress_fight.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + fight + fight + + + 83.6508% + 83.6508% + + \ No newline at end of file diff --git a/progress/progress_lair.svg b/progress/progress_lair.svg new file mode 100644 index 00000000..1ffa11bb --- /dev/null +++ b/progress/progress_lair.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + lair + lair + + + 100.0000% + 100.0000% + + \ No newline at end of file diff --git a/progress/progress_total.svg b/progress/progress_total.svg new file mode 100644 index 00000000..e9e4269f --- /dev/null +++ b/progress/progress_total.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + Banjo-Kazooie (us.v10) + Banjo-Kazooie (us.v10) + + + 79.1959% + 79.1959% + + \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..0879cb35 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,12 @@ +ansiwrap +anybadge +capstone +colorama +cxxfilt +pycparser +pylibyaml +pypng +python-Levenshtein +python-ranges +pyyaml +watchdog diff --git a/src/BGS/ch/croctus.c b/src/BGS/ch/croctus.c new file mode 100644 index 00000000..a7228ef9 --- /dev/null +++ b/src/BGS/ch/croctus.c @@ -0,0 +1,232 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80328748(ActorAnimCtrl *, f32, f32); +extern void func_8028F94C(s32, f32[3]); +extern void func_80324CFC(f32, enum comusic_e, s32); +extern void func_803289EC(Actor *, f32, s32); +extern void func_80326310(Actor *); +extern void actor_setOpacity(Actor *, s32); +extern void func_802C3D3C(void (*)(s32, s32), s32, s32); +extern void func_802BAFE4(s32 arg0); + + + +void func_80387D18(ActorMarker *, u32); +Actor *func_8038860C(ActorMarker *, Gfx**, Mtx **, Vtx**); +void func_80387FD4(Actor *this); + +/* .data */ +s16 D_803907B0[4] = {0x15, 0x16, 0x17, 0x18}; +ActorMarker *bgs_D_803907B8[5] = {NULL}; +ActorAnimationInfo D_803907CC[] = { + {0x000, 0.0f}, + {0x14B, 3.3e+7f}, + {0x14B, 1.4f}, + {0x14B, 3.3e+7f}, + {0x14B, 1.4f}, + {0x14B, 2.0f}, + {0x14B, 2.0f} +}; +ActorInfo D_80390804 ={MARKER_FC_CROCTUS, ACTOR_1FA_CROCTUS, ASSET_425_MODEL_CROCTUS, + 1, D_803907CC, + func_80387FD4, func_80326224, func_8038860C, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_80387C90(Actor *arg0){ + animctrl_setDuration(arg0->animctrl, 0.4 + 0.9999999999999999 * ((f32)(5 - arg0->unkF4_8) * 0.25)); +} + +void func_80387D18(ActorMarker * arg0, u32 arg1){ + Actor* this; + Actor* nextActPtr; + + this = marker_getActor(arg0); + nextActPtr = spawn_child_actor(0x6A, &this); + nextActPtr->state = 2; + nextActPtr->unkF4_8 = 0x8C; + nextActPtr->unk60 = 3.0f; + nextActPtr->unk38_31 = arg1; + if(arg0); +} + +void *func_80387D90(ActorMarker * arg0){ + ActorMarker *marker; + Actor* this; + f32 spawnPos[3]; + + marker = reinterpret_cast(ActorMarker *, arg0); + this = marker_getActor(marker); + spawnPos[0] = this->position_x; + spawnPos[1] = this->position_y; + spawnPos[2] = this->position_z; + marker->propPtr->unk8_3 = 0; + func_802BAFE4(0x19); + jiggySpawn(JIGGY_22_CROCTUS, spawnPos); + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF); +} + +void func_80387E00(s32 arg0){ + ActorMarker *marker = reinterpret_cast(ActorMarker *, arg0); + Actor * this = marker_getActor(marker); + + func_803262E4(this); + func_802C3D3C(func_80387D18, reinterpret_cast(s32, marker), 0x1E); +} + +void func_80387E40(ActorMarker * arg0){ + Actor *thisActor = marker_getActor(arg0); + func_80326310(thisActor); + if(arg0); +} + +void func_80387E68(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *this; + + if(text_id == 0xC86){ + this = marker_getActor(caller); + timed_playSfx(0.4f, SFX_C9_PAUSEMENU_ENTER, 1.0f, 32000); + timed_playSfx(1.4f, SFX_C9_PAUSEMENU_ENTER, 1.0f, 32000); + func_80324CFC(0.4f, COMUSIC_43_ENTER_LEVEL_GLITTER, 22000); + func_80324D2C(4.5f, COMUSIC_43_ENTER_LEVEL_GLITTER); + func_80328B8C(this, 5, 0.79f, 1); + func_80326310(this); + bgs_D_803907B8[this->unkF4_8]->propPtr->unk8_4 = TRUE; + timedFunc_set_1(1.1f, func_80387E00, bgs_D_803907B8[this->unkF4_8]); + timed_setCameraToNode(0.8f, 9); + func_80324DBC(3.4f, 0xC87, 0xE, NULL, NULL, func_80387E68, NULL); + func_802C3D3C(&func_80387D18, this->marker, 0x46); + } + else{ + func_80324E88(0.0f); + func_8028F918(0); + } +} + +void func_80387FD4(Actor *this){ + int j; + + if(!this->unk16C_4){ + if(jiggyscore_isCollected(JIGGY_22_CROCTUS)){ + marker_despawn(this->marker); + return; + } + this->unk16C_4 = TRUE; + if(bgs_D_803907B8[this->unkF4_8 - 1] == 0){ + bgs_D_803907B8[this->unkF4_8 - 1] = this->marker; + for(j = this->unkF4_8; j < 6; j++){ + if(bgs_D_803907B8[j] != NULL){ + bgs_D_803907B8[j]->propPtr->unk8_4 = FALSE; + actor_setOpacity(marker_getActor(bgs_D_803907B8[j]), 0); + } + }//L803880C8 + + for( j = this->unkF4_8 - 2; j >= 0 && bgs_D_803907B8[j] == NULL; j--); + + + if(j >= 0){ + this->marker->propPtr->unk8_4 = FALSE; + actor_setOpacity(this, 0); + } + this->marker->propPtr->unk8_3 = TRUE; + }//L80388144 + func_803289EC(this, 0.0f, 1); + this->unk60 = 0.0f; + return; + }//L80388160 + + if(this->unk38_31){ + if ((this->state != 5) && (this->state != 6)) { + func_8025A6EC(COMUSIC_2B_DING_B, 28000); //TODO ISSUE HERE + if (this->unkF4_8 == 1) { + func_8028F94C(2, this->position); + func_80311480(0xC86, 0xE, this->position, this->marker, func_80387E68, NULL); + func_80328B8C(this, 6, 0.79f, 1); + } else { + timed_playSfx(0.4f, SFX_C9_PAUSEMENU_ENTER, 1.0f, 32000); //0.4f + timed_playSfx(1.4f, SFX_C9_PAUSEMENU_ENTER, 1.0f, 32000); //1.4f + func_80324CFC(0.4f, COMUSIC_43_ENTER_LEVEL_GLITTER, 22000); + func_80324D2C(4.5f, COMUSIC_43_ENTER_LEVEL_GLITTER); + func_80328B8C(this, 5, 0.79f, 1); + if (this->unkF4_8 == 5) { + timedFunc_set_1(0.9f, (TFQM1) func_80387E40, (s32) this->marker); + } else { + func_80326310(this); + } + if (this->unkF4_8 < 5) { + bgs_D_803907B8[this->unkF4_8]->propPtr->unk8_4 = TRUE; + timedFunc_set_1(1.1f, (TFQM1)func_80387E00, bgs_D_803907B8[this->unkF4_8]); + func_802BAFE4(D_803907B0[this->unkF4_8-1]); + } else { + timedFunc_set_1(0.8f, (TFQM1)func_80387D90, (s32) this->marker); + } + func_802C3D3C(&func_80387D18, this->marker, 0x46); + } + } + }//L80388348 + + switch(this->state){ + case 1:// L80388370 + this->unk60 += time_getDelta(); + if(0.7 <= this->unk60){ + func_80328B8C(this, 2, 0.0f, 1); + func_80387C90(this); + this->unk60 = 0.0f; + func_80324D54(0.1f, SFX_D0_GRIMLET_SQUEAK, 1.0f, 0x7530, this->position, 0.0f, 1800.0f); + } + break; + + case 2:// L80388400 + if(actor_animationIsAt(this, 0.62f)){ + func_80328B8C(this, 3, 0.62f, 1); + } + break; + + case 3:// L80388434 + this->unk60 += time_getDelta(); + if( this->unk60 >= 0.13 + 0.7/4 * (5 - this->unkF4_8)){ + func_80328B8C(this, 4, 0.62f, 1); + func_80387C90(this); + this->unk60 = 0.0f; + func_80324D54(0.3f, 0x406, 1.0f, 0x55f0, this->position, 0.0f, 1800.0f); + } + break; + + case 4:// L8038850C + if(actor_animationIsAt(this, 0.0f)){ + func_80328B8C(this, 1, 0.0f, 1); + } + break; + + case 5:// L80388538 + func_80328748(this->animctrl, 0.79f, 0.97f); + if( actor_animationIsAt(this, 0.84f) + && !animctrl_isPlayedForwards(this->animctrl) + && func_802BB270() + ){ + func_8030E6A4(SFX_C8_CRUNCH, randf2(0.93f, 1.07f), 22000); + } + break; + + case 6:// L803885B0 + func_80328748(this->animctrl, 0.79f, 0.97f); + + break; + } +} + +void bgs_func_803885DC(void){ + s32 i; + for(i = 0; i<5; i++) + bgs_D_803907B8[i] = 0; +} + +Actor *func_8038860C(ActorMarker *this, Gfx** gdl, Mtx ** mptr, Vtx **vtx){ + Actor *thisActor; + thisActor = marker_getActor(this); + func_8033A45C(1, thisActor->unkF4_8); + return func_80325888(this, gdl, mptr, vtx); +} diff --git a/src/BGS/ch/flibbit.c b/src/BGS/ch/flibbit.c new file mode 100644 index 00000000..0a462f89 --- /dev/null +++ b/src/BGS/ch/flibbit.c @@ -0,0 +1,452 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + u8 unk0; + u8 unk1; + s16 unk2[3]; + s16 unk8[3]; + s16 unkE[3]; + f32 unk14; + f32 unk18; + f32 unk1C[2]; + // f32 unk20; + f32 unk24; +}ActorLocal_Flibbit; + + +extern f32 func_80309724(f32 *); +extern void func_80256E24(f32 [3], f32, f32, f32, f32, f32); + +void chflibbit_update(Actor *this); +Actor *chflibbit_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorInfo D_80390690 = { + 0xC1, 0x133, 0x375, + 0, NULL, + chflibbit_update, NULL, chflibbit_draw, + 0, 0, 1.0f, 0 +}; + +f32 D_803906B4[3] = {0.0f, 0.0f, 0.0f}; + +/* .code */ +bool func_803863F0(Actor *this, f32 arg1[3], s32 arg2){ + + ActorLocal_Flibbit *local = (ActorLocal_Flibbit *)&this->local; + + local->unk1 = arg2; + + local->unk2[0] = this->position[0];\ + local->unk2[1] = this->position[1];\ + local->unk2[2] = this->position[2]; + local->unk8[0] = arg1[0]; + local->unk8[1] = arg1[1]; + local->unk8[2] = arg1[2]; + + local->unk8[1] = func_80309724(arg1); + func_80335924(this->unk148, 0xdb, 0.2f,(arg2) ? randf2(0.7f, 0.8f) : randf2(0.75f, 0.85f)); + func_80335A8C(this->unk148, 2); + func_80324D54(0.2f, 0x3f2, randf2(0.7f, 1.3f), randi2(0x61A8, 0x6978), this->position, 500.0f, 2500.0f); + return TRUE; +} + +bool func_80386564(Actor *this){ + f32 plyrPos[3]; //sp54 + f32 sp48; + f32 sp44; + f32 sp40; + f32 sp3C[3]; //sp3C + f32 sp30[3]; //sp30 + + player_getPosition(plyrPos); + func_80258A4C(this->position, this->yaw - 90.0f, plyrPos, &sp48, &sp44, &sp40); + if(func_80329210(this, plyrPos)){ + if((-0.7 <= sp40) && (sp40 <= 0.7)){ + sp3C[0] = plyrPos[0] - this->position_x; + sp3C[1] = plyrPos[1] - this->position_y; + sp3C[2] = plyrPos[2] - this->position_z; + ml_vec3f_set_length(sp3C,180.0f); + sp30[0] = sp3C[0] + this->position_x; + sp30[1] = sp3C[1] + this->position_y; + sp30[2] = sp3C[2] + this->position_z; + if(func_80329210(this, sp30)) + return func_803863F0(this, sp30, 1); + } + } + return 0; + +} + +s32 func_803866A4(Actor *this) { + f32 sp64[3]; + f32 sp60; + f32 sp5C; + f32 sp58; + f32 sp4C[3]; + ActorLocal_Flibbit *local = (ActorLocal_Flibbit *)&this->local; + f32 sp3C[3]; + + + sp64[0] = (f32) local->unkE[0]; + sp64[1] = (f32) local->unkE[1]; + sp64[2] = (f32) local->unkE[2]; + func_80258A4C(this->position, this->yaw - 90.0f, sp64, &sp60, &sp5C, &sp58); + if ((-0.9 <= sp58) && (sp58 <= 0.9)) { + if ((f64) sp60 > 216.0) { + sp4C[0] = sp64[0] - this->position[0]; + sp4C[1] = sp64[1] - this->position[1]; + sp4C[2] = sp64[2] - this->position[2]; + ml_vec3f_set_length(sp4C, 180.0f); + sp3C[0] = this->position[0] + sp4C[0]; + sp3C[1] = this->position[1] + sp4C[1]; + sp3C[2] = this->position[2] + sp4C[2]; + } else { + sp3C[0] = (f32) local->unkE[0]; + sp3C[1] = (f32) local->unkE[1]; + sp3C[2] = (f32) local->unkE[2]; + } + if (func_80329210(this, sp3C) != 0) { + return func_803863F0(this, sp3C, 0); + } + } + return 0; +} + + +bool func_8038686C(Actor *this) { + f32 sp84[3]; + f32 sp80; + f32 sp7C; + f32 sp78; + f32 *temp_s2; + f32 sp68[3]; + f32 phi_f2; + int i; + + player_getPosition(sp84); + func_80258A4C(this->position, this->yaw - 90.0f, sp84, &sp80, &sp7C, &sp78); + for(i = 0; i < 0xA; i++){ + if (i < 5) { + if (sp78 > 0.0f) { + phi_f2 = randf2(10.0f, 90.0f) + this->yaw; + } else { + phi_f2 = randf2(-90.0f, -10.0f) + this->yaw; + } + } else { + phi_f2 = randf2(-110.0f, 110.0f) + this->yaw; + } + func_80256E24(sp68, 0.0f, phi_f2, 0.0f, 0.0f, 180.0f); + sp68[0] += this->position[0]; + sp68[1] += this->position[1]; + sp68[2] += this->position[2]; + if (func_80329210(this, sp68)) { + return func_803863F0(this, sp68, 0); + } + } + return FALSE; +} + + +bool func_80386A34(Actor * this){ + f32 plyrPos[3]; + bool out; + + if(func_803203FC(0xC1)) + return 0; + + player_getPosition(plyrPos); + if(func_80329210(this, plyrPos)){ + if(!(out = func_80386564(this)) && (0.5 < randf ())){ + return 0; + } + }else{ + out = func_803866A4(this); + } + + if(!out) + out = func_8038686C(this); + + return out; +} + +void func_80386AEC(Actor *this, s32 next_state) { + ActorLocal_Flibbit *local; + + local = (ActorLocal_Flibbit *) &this->local; + local->unk1 = FALSE; + local->unk18 = 0.0f; + local->unk24 = 0.0f; + + if (next_state == 1) { + func_80335924(this->unk148, ASSET_FA_ANIM_FLIBBIT_IDLE, 0.2f, randf2(1.0f, 2.0f)); + func_80335A74(this->unk148, randf2(0.0f, 0.9f)); + func_80335A8C(this->unk148, 1); + this->position[0] = (f32) local->unkE[0]; + this->position[1] = (f32) local->unkE[1]; + this->position[2] = (f32) local->unkE[2]; + local->unk24 = randf2(1.0f, 3.0f); + } + + if (next_state == 2){ + if(!func_80386A34(this)) { + if (this->state != 3) { + next_state = 3; + func_80386AEC(this, next_state); + } + return; + } + } + + if (next_state == 3) { + func_80335924(this->unk148, ASSET_FB_ANIM_FLIBBIT_TURN, 0.2f, 1.0f); + func_80335A74(this->unk148, randf2(0.0f, 1.0f)); + func_80335A8C(this->unk148, 1); + local->unk24 = randf2(1.0f, 3.0f); + } + + if (next_state == 4) { + func_80335924(this->unk148, ASSET_FA_ANIM_FLIBBIT_IDLE, 0.2f, randf2(1.0f, 2.0f)); + func_80335A74(this->unk148, randf2(0.0f, 0.9f)); + func_80335A8C(this->unk148, 1); + this->position[1] = func_80309724(this->position); + local->unk18 = 1.0f; + } + + if (next_state == 5) { + FUNC_8030E8B4(SFX_8E_GRUNTLING_DAMAGE, 1.5f, 32200, this->position, 500, 2500); + func_80335924(this->unk148, ASSET_288_ANIM_FLIBBIT_OW, 0.1f, 0.65f); + func_80335A8C(this->unk148, 2); + this->position[1] = func_80309724(this->position); + local->unk18 = 1.0f; + } + + if (next_state == 6) { + func_80335924(this->unk148, ASSET_112_ANIM_FLIBBIT_DIE, 0.2f, 0.4f); + FUNC_8030E8B4(SFX_115_BUZZBOMB_DEATH, 1.0f, 32200, this->position, 500, 2500); + this->marker->collidable = FALSE; + this->unk10_1 = FALSE; + local->unk14 = 1000.0f; + } + if (next_state == 7) { + func_80335924(this->unk148, ASSET_113_ANIM_FLIBBIT_DEAD, 0.2f, 1.0f); + func_80335A8C(this->unk148, 2); + FUNC_8030E8B4(SFX_2F_ORANGE_SPLAT, 0.8f, 32200, this->position, 500, 2500); + } + if (next_state == 8) { + func_80326310(this); + } + this->state = next_state; + +} + +void func_80386E30(ActorMarker *this, ActorMarker *other){ + Actor *thisActor = marker_getActor(this); + if(thisActor->state < 6){ + func_80386AEC(thisActor, 4); + } +} + +void func_80386E70(ActorMarker *this, ActorMarker *other){ + Actor *thisActor = marker_getActor(this); + if(thisActor->state < 6){ + func_80386AEC(thisActor, 5); + } +} + +void func_80386EB0(ActorMarker *this, ActorMarker *other){ + Actor *thisActor = marker_getActor(this); + if(thisActor->state < 6){ + func_80386AEC(thisActor, 6); + } +} + +Actor *chflibbit_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this; + ActorLocal_Flibbit *local; + s32 temp_a0; + int i; + f32 sp7C[3]; + f32 phi_f2; + + this = marker_getActor(marker); + local = (ActorLocal_Flibbit *)&this->local; + if (local->unk0){ + if(((this->state == 1)) || (this->state == 3)) { + temp_a0 = func_803356A0(this->unk148); + for(i = 0; i < 2; i++){ + + if (0.1 <= local->unk1C[i]) { + phi_f2 = (f32) ((local->unk1C[i] - 0.1) / 0.1); + } else if (local->unk1C[i] >= 0.0f) { + phi_f2 = (f32) (1.0 - (local->unk1C[i] / 0.1)); + } else { + phi_f2 = 1.0f; + } + sp7C[0] = 1.0f; + // sp7C[1] = 1.0f; + sp7C[2] = 1.0f; + sp7C[1] = (f32) (((f64) phi_f2 * 0.99) + 0.01); + + func_8033A928(temp_a0, (i != 0)?0x2D :0x2E, sp7C); + } + } + } + func_80325888(marker, gfx, mtx, vtx); + local->unk0 = marker->unk14_21; + + return this; +} + +void chflibbit_update(Actor *this){ + f32 player_position[3]; + f32 spB0[3]; + f32 player_distance; + ActorLocal_Flibbit *local = (ActorLocal_Flibbit *)&this->local; + f32 spA4 = time_getDelta(); + f32 spA0; + f32 sp9C; + f32 sp98; + f32 sp94; + f32 sp90; + f32 sp84[3]; + f32 temp_f12; + f32 sp7C; + f32 sp78; + f32 sp74; + f32 sp68[3]; + f32 phi_f2; + f32 sp60; + f32 sp5C; + f32 sp58; + f32 sp4C[3]; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + marker_setCollisionScripts(this->marker, func_80386E30, func_80386E70, func_80386EB0); + local->unk1C[0] = randf2(-2.0f, -1.0f); + local->unk1C[1] = randf2(-2.0f, -1.0f); + + local->unkE[0] = (s16) this->position_x; + local->unkE[1] = (s16) this->position_y; + local->unkE[2] = (s16) this->position_z; + + local->unkE[1] = func_80309724(this->position); + func_80386AEC(this, 1); + } + player_getPosition(player_position); + + spB0[0] = player_position[0] - this->position[0]; + spB0[1] = player_position[1] - this->position[1]; + spB0[2] = player_position[2] - this->position[2]; + player_distance = gu_sqrtf(spB0[0]*spB0[0] + spB0[1]*spB0[1] + spB0[2]*spB0[2]); + + if(func_8025773C(&local->unk24, spA4)){ + func_8030E878(0x3f0, randf2(0.9f, 1.1f), randi2(12000, 19000), this->position, 500.0f, 2500.0f); + local->unk24 = randf2(1.0f, 6.0f); + }//L80387274 + + local->unk1C[0] += spA4; + local->unk1C[0] = (0.2 < local->unk1C[0]) ? randf2(-3.0f, -1.0f) : local->unk1C[0]; + + local->unk1C[1] += spA4; + local->unk1C[1] = (0.2 < local->unk1C[1]) ? randf2(-3.0f, -1.0f) : local->unk1C[1]; + + if(this->state == 1){ + if(func_80329210(this, player_position)){ + func_80386AEC(this, 2); + return; + } + + if(player_distance < 2000.0f){ + func_80258A4C(this->position, this->yaw - 90.0f, player_position, &spA0, &sp9C, &sp98); + this->yaw += (sp98*90.0f) *spA4; + } + }//L803873D0 + + if(this->state == 2){ + func_8033568C(this->unk148, &sp94, &sp90); + if(sp94 < 0.8 && 0.8 <= sp90){ + func_8030E878(SFX_8_BANJO_LANDING_04, randf2(0.8f, 0.9f), randi2(25000, 27000), this->position, 100.0f, 1500.0f); + }//L8038747C + if(func_80335794(this->unk148) > 0){ + sp84[0] = (f32)local->unkE[0]; + sp84[1] = (f32)local->unkE[1]; + sp84[2] = (f32)local->unkE[2]; + if(ml_vec3f_distance(this->position, sp84) < 30.0f){ + func_80386AEC(this, 1); + } + else{ + func_80386AEC(this, 2); + + } + } + else{//L80387514 + if(0.2 <= sp90 && sp90 <= 0.8){ + temp_f12 = ((sp90 - 0.2) / 0.60000000000000009); + this->position_x = local->unk2[0] + (local->unk8[0] - local->unk2[0])*temp_f12; + this->position_y = local->unk2[1] + (local->unk8[1] - local->unk2[1])*temp_f12; + this->position_z = local->unk2[2] + (local->unk8[2] - local->unk2[2])*temp_f12; + if(local->unk1){ + if(sp90 <= 0.5){ + phi_f2 = ((sp90 - 0.2)/0.3) * 70.0; + } + else{ + phi_f2 = (1.0 - (sp90 - 0.5)/ 0.30000000000000004) *70.0; + } + this->position_y += phi_f2; + }//L80387684 + sp68[0] = (f32)(local->unk8[0] - local->unk2[0]); + sp68[1] = (f32)(local->unk8[1] - local->unk2[1]); + sp68[2] = (f32)(local->unk8[2] - local->unk2[2]); + func_80258A4C(D_803906B4, this->yaw - 90.0f, sp68, &sp7C, &sp78, &sp74); + this->yaw += (sp74 * 220.0f * spA4); + + } + } + }//L80387734 + + if (this->state == 3) { + func_80258A4C(this->position, this->yaw - 90.0f, player_position, &sp60, &sp5C, &sp58); + this->yaw += sp58 * 90.0f * spA4; + if ((-0.4 <= sp58) && (sp58 <= 0.4) && ((f64) randf() > 0.5)) { + func_80386AEC(this, 2); + } + if ((sp5C < 0.0f) && (randf() > 0.5)) { + func_80386AEC(this, 2); + } + } + + + if(this->state == 4 || this->state == 5){ + if(func_8025773C(&local->unk18, spA4)){ + func_80386AEC(this, 3); + } + } + + if(this->state == 6){ + sp4C[0] = this->position[0] - player_position[0]; + sp4C[1] = this->position[1] - player_position[1]; + sp4C[2] = this->position[2] - player_position[2]; + sp4C[1] = 0.0f; + ml_vec3f_set_length(sp4C, 400.0f * spA4); + + this->position[0] = this->position[0] + sp4C[0]; + this->position[1] = this->position[1] + sp4C[1]; + this->position[2] = this->position[2] + sp4C[2]; + + this->position_y += local->unk14*spA4; + local->unk14 -= 3000.0f*spA4; + if(this->position_y < func_80309724(this->position)){ + this->position_y = func_80309724(this->position); + func_80386AEC(this, 7); + } + } + + if(this->state == 7){ + if(func_80335794(this->unk148) > 0) + func_80386AEC(this, 8); + } +} diff --git a/src/BGS/ch/leafboat.c b/src/BGS/ch/leafboat.c new file mode 100644 index 00000000..07bf2ed0 --- /dev/null +++ b/src/BGS/ch/leafboat.c @@ -0,0 +1,216 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct chleafboat_s{ + f32 unk0[3]; + f32 unkC[3]; + f32 unk18[3]; + f32 unk24[3]; + f32 unk30[3]; + f32 unk3C[3]; + f32 unk48[3]; + f32 unk54[3]; + f32 unk60[3]; + f32 unk6C; +} ActorLocal_Leafboat; + +void func_8038FD9C(Actor *this); +Actor *func_8038FD10(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3); + + +/* .data section */ +u8 D_80390DA0[6] = {0, 0, 0, 1, 1, 1}; + +ActorInfo D_80390DA8 = {0xDA, actor_leafboat, 0x30D, + 0x01, NULL, + func_8038FD9C, func_8038FD9C, func_8038FD10, + 0, 0, 0.0f, 0 +}; + + +/* .code section */ +Actor *func_8038FD10(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3){ + Actor * thisActor; + + thisActor = marker_getActor(this); + if((thisActor->unk1C_x != 0.0f) && (0x80 < thisActor->alpha_124_19)){ + thisActor = func_80325888(this, gdl, mtx, arg3); + } + return thisActor; +} + +void func_8038FD88(ActorMarker *this, u32 arg1){ + this->unk3E_1 = 1; +} + +void func_8038FD9C(Actor *this){ + f32 sp64[3]; + f32 sp58[3]; + ActorLocal_Leafboat *local; + u8 tmp[6] = D_80390DA0; + f32 pad0; + f32 sp44; + f32 sp40; + f32 sp3C; + f32 sp38; + + local = (ActorLocal_Leafboat *)&this->local; + if(!this->initialized){ + this->initialized = TRUE; + marker_setCollisionScripts(this->marker, func_8038FD88, NULL, NULL); + local->unk6C = randf2(80.0f, 100.0f); + this->unk1C[0] = this->unk1C[1] = this->unk1C[2] = 0.0f; + local->unk0[0] = local->unk0[1] = local->unk0[2] = 0.0f; + local->unkC[0] = local->unkC[1] = local->unkC[2] = 0.0f; + local->unk18[0] = local->unk18[1] = local->unk18[2] = 0.0f; + local->unk24[0] = local->unk24[1] = local->unk24[2] = 0.0f; + local->unk30[0] = local->unk30[1] = local->unk30[2] = 0.0f; + local->unk3C[0] = local->unk3C[1] = local->unk3C[2] = 0.0f; + local->unk48[0] = local->unk48[1] = local->unk48[2] = 0.0f; + local->unk54[0] = this->position_x; + local->unk54[1] = this->position_y; + local->unk54[2] = this->position_z; + local->unk60[0] = this->pitch; + local->unk60[1] = this->yaw; + local->unk60[2] = this->roll; + this->unk60 = 0.0f; + this->velocity_x = 0.0f; + this->unk10_12 = 0; + } + + this->position_x = local->unk54[0]; + this->position_y = local->unk54[1]; + this->position_z = local->unk54[2]; + this->pitch = local->unk60[0]; + this->yaw = local->unk60[1]; + this->roll = local->unk60[2]; + switch(this->state){ + case 1: + if(this->marker->unk2C_2) + func_80326224(this); + this->marker->propPtr->unk8_3 = 1; + this->unk1C[0] = 1.0f; + this->alpha_124_19 = 0xff; + if(this->unk54 != 0.0f){ + func_80328A84(this, 2); + } + break; + + case 2: + if(this->marker->unk2C_2) + func_80326224(this); + + this->marker->propPtr->unk8_3 = 1; + this->unk1C[0] = 1.0f; + if(15.0f <= this->velocity_x){ + func_80328A84(this, 3); + this->velocity_x = 0.0f; + } + else{ + if(!tmp[((s32)this->velocity_x)%6]) + this->alpha_124_19 -= 0x55; + else + this->alpha_124_19 += 0x55; + this->velocity_x = this->velocity_x + 1.0f; + } + + break; + case 3: + if (this->marker->unk2C_2) { + func_80326224(this); + } + this->marker->propPtr->unk8_3 = FALSE; + this->unk1C[0] = 0.0f; + this->alpha_124_19 = 0; + if (this->unk54 == 0.0f) { + func_80328A84(this, 4); + } + break; + + case 4: + this->marker->propPtr->unk8_3 = 1; + this->unk1C[0] = 1.0f; + if (this->velocity[0] >= 15.0f) { + func_80328A84(this, 1); + this->velocity[0] = 0.0f; + } else { + if(tmp[5-(((s32)this->velocity_x)%6)]) { + this->alpha_124_19 += 0x55; + } else { + this->alpha_124_19 -= 0x55; + } + this->velocity[0] += 1.0f; + } + break; + } + + local->unk54[0] = this->position_x; + local->unk54[1] = this->position_y; + local->unk54[2] = this->position_z; + local->unk60[0] = this->pitch; + local->unk60[1] = this->yaw; + local->unk60[2] = this->roll; + this->unk60 += time_getDelta(); + _player_getPosition(&sp58); + if( func_80294660() == 0x100 + && func_8028F20C() + && this->marker->unk3E_1 + ){ + sp44 = local->unk54[0] - sp58[0]; + sp40 = local->unk54[2] - sp58[2]; + sp3C = cosf((local->unk60[1] * M_PI) / 180.0); + sp38 = sinf((local->unk60[1] * M_PI) / 180.0); + local->unkC[0] = -((sp44 * sp38) + (sp40 * sp3C)) / 8; + local->unkC[2] = ((sp44 * sp3C) - (sp40 * sp38)) / 8; + if(this->unk10_12){ + if(local->unk24[1] < -20.0f){ + local->unk30[1] = -7.0f; + } + } + else{ + local->unk30[1] = -32.0f; + } + this->unk10_12 = 1; + } else { + local->unkC[0] = local->unkC[1] = local->unkC[2] = 0.0f; + if(!this->unk10_12){ + if(local->unk24[1] > 5.0f){ + local->unk30[1] = 0.0f; + } + } + else{ + local->unk30[1] = 10.0f; + } + this->unk10_12 = 0; + } + this->marker->unk3E_1 = 0; + + local->unk18[1] = 10 * sinf((((this->unk60 * local->unk6C) / 180.0) * RARE_PI)); + this->unk1C[0] = 4.5 * cosf((((this->unk60 * local->unk6C) / 180.0) * RARE_PI)); + this->unk1C[1] = 2*sinf((((this->unk60 * local->unk6C) / 180.0) * RARE_PI)); + sp64[0] = local->unk3C[0] + local->unk24[0]; + sp64[1] = local->unk3C[1] + local->unk24[1]; + sp64[2] = local->unk3C[2] + local->unk24[2]; + + sp64[0] = sp64[0] + local->unk18[0]; + sp64[1] = sp64[1] + local->unk18[1]; + sp64[2] = sp64[2] + local->unk18[2]; + + this->position[0] = this->position[0] + sp64[0]; + this->position[1] = this->position[1] + sp64[1]; + this->position[2] = this->position[2] + sp64[2]; + + local->unk0[2] += (local->unkC[2] - local->unk0[2]) * 0.075; + local->unk0[0] += (local->unkC[0] - local->unk0[0]) * 0.075; + local->unk24[1] += (local->unk30[1] - local->unk24[1]) * 0.2; + sp64[0] = local->unk48[0] + this->unk1C[0]; + sp64[1] = local->unk48[1] + this->unk1C[1]; + sp64[2] = local->unk48[2] + this->unk1C[2]; + sp64[0] = sp64[0] + local->unk0[0]; + sp64[1] = sp64[1] + local->unk0[1]; + sp64[2] = sp64[2] + local->unk0[2]; + this->pitch += sp64[0]; + this->yaw += sp64[1]; + this->roll += sp64[2]; +} diff --git a/src/BGS/ch/mrvile.c b/src/BGS/ch/mrvile.c new file mode 100644 index 00000000..fedc905d --- /dev/null +++ b/src/BGS/ch/mrvile.c @@ -0,0 +1,453 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + +void func_80335A24(void *, u32, f32, f32); +void set_model_render_mode(u32); +Actor *chvile_draw(ActorMarker*, Gfx **, Mtx **, Vtx **); +void chvile_update(Actor *); +void func_8038BB40(ActorMarker *); +extern void func_80335A80(void *, f32); +extern bool func_80320C94(f32[3], f32[3], f32, f32[3], s32, u32); + +extern bool chvilegame_find_closest_piece(ActorMarker *, f32[3], f32, f32[3]); + +typedef struct chmrvile_s{ + u8 unk0; + // u8 pad1[0x3]; + BKModelBin *unk4; //yumblie_model + ActorMarker *game_marker; //game_marker + u8 unkC; + // u8 padD[0x3]; + f32 unk10; //movement_speed + f32 unk14; //yumblie_eating_timer + f32 target_position[3]; //target_position + f32 unk24; + f32 unk28[3]; //target_rotation? +} ActorLocal_MrVile; + +/* .data */ +ActorInfo D_80390A70 = {0xC8, 0x13A, 0x373, 0x00, NULL, + chvile_update, NULL, chvile_draw, + 0, 0, 0.0f, 0 +}; + +f32 D_80390A94[7] = {0.0f, 0.8f, 0.9f, 1.0f, 0.9f, 0.95f, 1.0f}; + +/* .code */ +void func_8038B9F0(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3, s32 arg4) { + f32 sp64[3]; + f32 pad60; + f32 sp54[3]; + f32 pad50; + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + f32 var_f0; + + sp44[0] = arg0[0]; + sp44[1] = arg0[1] + arg2; + sp44[2] = arg0[2]; + + sp38[0] = arg1[0]; + sp38[1] = arg1[1] + arg2; + sp38[2] = arg1[2]; + + sp2C[0] = sp38[0]; + sp2C[1] = sp38[1]; + sp2C[2] = sp38[2]; + if (func_80320C94(sp44, sp38, arg3, sp54, 3, arg4)) { + sp64[0] = sp38[0] - sp2C[0]; + sp64[1] = sp38[1] - sp2C[1]; + sp64[2] = sp38[2] - sp2C[2]; + var_f0 = sp54[0]*sp64[0] + sp54[1]*sp64[1] + sp54[2]*sp64[2]; + if (var_f0 < 1.0f) { + var_f0 = 1.0f; + } + ml_vec3f_set_length(sp54, var_f0); + arg1[0] = arg1[0] + sp54[0]; + arg1[1] = arg1[1] + sp54[1]; + arg1[2] = arg1[2] + sp54[2]; + } +} + +void func_8038BB40(ActorMarker * arg0){ + Actor *this; + ActorLocal_MrVile *local; + + this = marker_getActor(arg0); + local = (ActorLocal_MrVile *)&this->local; + if(func_8038A9E0(local->game_marker) >= 3){ + item_set(ITEM_14_HEALTH, 0); + func_8028F66C(0xF); + } + else{ + item_dec(ITEM_14_HEALTH); + func_8028F590(4, arg0); + } +} + +void func_8038BBA0(Actor *this, s32 arg1){ + ActorLocal_MrVile *local; + + local = (ActorLocal_MrVile *)&this->local; + local->unk14 = 0.0f; + if(arg1 == 101){ + local->unk24 = 0.0f; + local->unk28[0] = local->unk28[1] = local->unk28[2] = 0.0f; + func_80335924(this->unk148, 0xe1, 0.10000000149f, 1.0f); //0xe1 = croc_idle + } + if(arg1 == 102){ + if(local->unk24 < 100.0f){ + local->unk24 = 100.0f; + }; + func_80335A24(this->unk148, 0xe0, 0.1f, 0.5f); //0xe1 = croc_walk + } + if(arg1 == 103){ + func_80335A24(this->unk148, 0x124, 0.1f, 0.5f); //0x124 = croc_munch + if(this->state == 4){ + timed_playSfx(0.31f, SFX_4C_LIP_SMACK, 0.90f, 0x61A8); + timedFunc_set_1(0.31f, func_8038BB40, this->marker); + } + else{ + timed_playSfx(0.31f, SFX_4C_LIP_SMACK, 0.90f, 0x61A8); + timed_playSfx(0.81f, SFX_4C_LIP_SMACK, 0.93f, 0x61A8); + timed_playSfx(1.31f, SFX_4C_LIP_SMACK, 0.91f, 0x61A8); + } + } + if(arg1 == 104){ + local->unk14 = 1.0f; + timed_playSfx(randf2(1.2f, 1.3f), SFX_97_BLUBBER_BURPS, randf2(0.8f, 1.1f), randi2(25000, 32000)); + } + local->unkC = arg1; +} + +void func_8038BD84(Actor *this){ + ActorLocal_MrVile *local; + + local = (ActorLocal_MrVile *)&this->local; + local->unkC = 100; + local->unk10 = 0.0f; + local->unk14 = 0.0f; + local->unk24 = 0.0f; + local->target_position[0] = 0.0f; + local->target_position[1] = 0.0f; + local->target_position[2] = 0.0f; + local->unk28[0] = 0.0f; + local->unk28[1] = 0.0f; + local->unk28[2] = 0.0f; + func_8038BBA0(this, 101); +} + +void func_8038BDD4(Actor *this) { + ActorLocal_MrVile *local; + f32 sp60[3]; + f32 sp5C; + f32 sp58; + f32 sp54; + f32 sp50; + f32 sp44[3]; + f32 temp_f0_3; + + local = (ActorLocal_MrVile *)&this->local; + sp5C = time_getDelta(); + sp60[0] = this->position[0]; + sp60[1] = this->position[1]; + sp60[2] = this->position[2]; + func_8025773C(&local->unk14, sp5C); + if ((local->unkC == 102) || (local->unkC == 103) || (local->unkC == 104)) { + sp44[0] = 0.0f; + sp44[1] = 0.0f; + sp44[2] = local->unk24 * sp5C; + ml_vec3f_yaw_rotate_copy(sp44, sp44, this->yaw); + this->position[0] = this->position[0] + sp44[0]; + this->position[1] = this->position[1] + sp44[1]; + this->position[2] = this->position[2] + sp44[2]; + this->pitch += local->unk28[0] * sp5C; + this->yaw += local->unk28[1] * sp5C; + this->roll += local->unk28[2] * sp5C; + func_80258A4C(this->position, this->yaw - 90.0f, local->target_position, &sp58, &sp54, &sp50); + if ((sp54 > 0.0f) && (sp58 > 200.0f)) { + local->unk24 += 100.0f * sp5C; + } + if ((sp54 < 0.0f) && (sp58 > 100.0f)) { + local->unk24 -= 100.0f * sp5C; + } + + local->unk24 = (local->unk24 < 10.0f) ? 10.0f + : (local->unk10 < local->unk24) ? local->unk10 + : local->unk24; + func_80335A80(this->unk148, (200.0f / local->unk24) * 0.5); + local->unk28[1] = sp50 * 200.0f; + temp_f0_3 = func_80309724(this->position); + if (temp_f0_3 > 125.0f) { + this->position[1] = 125.0f; + } else if (temp_f0_3 > 80.0f) { + this->position[1] = temp_f0_3; + } else { + this->position[1] = 0.0f; + } + } + if (this->position[1] > 100.0f) { + func_8038B9F0(&sp60, this->position, 90.0f, 70.0f, 0); + } +} + +void func_8038C0C8(Actor * this, s32 next_state){ + ActorLocal_MrVile *local; + + local = (ActorLocal_MrVile *)&this->local; + if(next_state == 1) + func_8038BBA0(this, 101); + + if(next_state == 2) + func_8038BBA0(this, 101); + + if(next_state == 3) + func_8038BBA0(this, 102); + + if(next_state == 4) + func_8038BBA0(this, 102); + + if(next_state == 5){ + local->target_position[0] = local->target_position[1] = local->target_position[2] = 0.0f; + func_8038BBA0(this, 102); + } + + if(next_state == 6){ + local->target_position[0] = local->target_position[1] = local->target_position[2] = 0.0f; + local->unk24 = 300.0f; + func_8038BBA0(this, 102); + } + + this->state = next_state; +} + +Actor *chvile_draw(ActorMarker *marker, Gfx **gfx, Mtx** mtx, Vtx **vtx){ + Actor *this; + ActorLocal_MrVile *local; + f32 sp34[3]; + + + this = func_80325888(marker, gfx, mtx, vtx); + local = (ActorLocal_MrVile *)&this->local; + if ( + (local->unkC == 104) && + (local->unk14 > 0.0f) + && (this->marker->unk14_21) + ) { + func_8034A174(func_80329934(), 5, &sp34); + sp34[1] -= 30.0f; + set_model_render_mode(1); + func_803391A4(gfx, mtx, &sp34, 0, local->unk14, 0, local->unk4); + } + return this; +} + +//chvile_get_position +f32 *func_8038C284(ActorMarker *marker){ + Actor *this; + + this = marker_getActor(marker); + return this->position; +} + +bool func_8038C2A8(ActorMarker *marker) { + f32 sp24[3]; + Actor *this; + ActorLocal_MrVile *local; + + this = marker_getActor(marker); + local = (ActorLocal_MrVile *)&this->local; + player_getPosition(&sp24); + if (this->state == 6) { + return ml_vec3f_distance(this->position, &sp24) < 150.0f; + } + return local->unk0 == 1; +} + + +bool func_8038C338(ActorMarker *marker){ + Actor *this; + + this = marker_getActor(marker); + return this->state == 1; +} + +void chvile_free(Actor *this){ + ActorLocal_MrVile *local; + + local = (ActorLocal_MrVile *)&this->local; + assetcache_release(local->unk4); + +} + +void func_8038C384(ActorMarker *marker){ + Actor *this; + + this = marker_getActor(marker); + func_8038C0C8(this, 4); +} + +void func_8038C3B0(ActorMarker *marker){ + Actor *this; + + this = marker_getActor(marker); + func_8038C0C8(this, 2); +} + +void func_8038C3DC(ActorMarker *marker){ + Actor *this; + + this = marker_getActor(marker); + func_8038C0C8(this, 3); +} + +void func_8038C408(ActorMarker *marker){ + Actor *this; + + this = marker_getActor(marker); + func_8038C0C8(this, 5); +} + +void func_8038C434(ActorMarker *marker){ + Actor *this; + + this = marker_getActor(marker); + func_8038C0C8(this, 6); +} + +void func_8038C460(ActorMarker *arg0){ + func_8038C0C8(marker_getActor(arg0), 1); +} + +void chvile_update(Actor *this) { + ActorLocal_MrVile *local; + bool var_v1; + f32 sp94; + f32 sp90; + f32 temp_a0; + f32 temp_f0; + f32 sp84; + f32 sp80; + f32 sp7C; + s32 temp_v0; + s32 i; + f32 sp70; + f32 sp6C; + f32 sp68; + f32 sp50; + f32 sp58[3]; + + local = (ActorLocal_MrVile *)&this->local; + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->marker->unk30 = chvile_free; + local->unk0 = 0; + local->unk4 = assetcache_get(0x3F6); + local->game_marker = NULL; + func_8038BD84(this); + func_8038C0C8(this, 1); + return; + } + if (local->game_marker == NULL) { + local->game_marker = func_80326D68(this->position, 0x138, -1, &sp90)->marker; + } + player_getPosition(&sp94); + sp90 = ml_vec3f_distance(this->position, &sp94); + if (sp90 <= 300.0f) { + local->unk0 = (local->unk0 == 0) ? 1 : 2; + } else if (sp90 > 300.0f) { + local->unk0 = 0U; + } + if (this->state == 2) { + func_80258A4C(this->position, this->yaw - 90.0f, &sp94, &sp84, &sp80, &sp7C); + if (((sp84 > 50.0f) && (0.05 < sp7C)) || (sp7C < -0.05)) { + this->yaw += sp7C * 20.0f; + } else { + func_8038C0C8(this, 1); + } + } + if (this->state == 3) { + var_v1 = chvilegame_find_closest_piece(local->game_marker, this->position, this->yaw, local->target_position) && mapSpecificFlags_get(6); + if (!var_v1) { + local->target_position[0] = 0.0f; + local->target_position[1] = 0.0f; + local->target_position[2] = 0.0f; + } + if (local->game_marker != NULL) { + temp_v0 = chvilegame_get_score_difference(local->game_marker); + if (temp_v0 >= 2) { + local->unk10 = 200.0f; + } else if (temp_v0 >= 0) { + local->unk10 = 310.0f; + } else if (temp_v0 >= -2) { + local->unk10 = 350.0f; + } else { + local->unk10 = 450.0f; + } + local->unk10 *= D_80390A94[func_8038A9E0(local->game_marker)]; + } + if (func_8038A9E0(local->game_marker) < 7) { + func_80258A4C(this->position, this->yaw - 90.0f, local->target_position, &sp70, &sp6C, &sp68); + if (local->unkC == 102) { + if ((-0.8 < sp68) && (sp68 < 0.8) && (sp70 <= 150.0f) && var_v1) { + func_8038BBA0(this, 103); + } + } + if (local->unkC == 103) { + if (sp70 <= 50.0f) { + if (chvilegame_cpu_consume_piece(local->game_marker, local->target_position)) { + func_8038BBA0(this, 104); + } else { + func_8038BBA0(this, 102); + } + } else if (func_80335794(this->unk148) >= 3) { + func_8038BBA0(this, 102); + } + } + if ((local->unkC == 104) && (func_80335794(this->unk148) >= 3)) { + func_8038BBA0(this, 102); + } + } + } + if (this->state == 4) { + player_getPosition(local->target_position); + local->unk10 = 500.0f; + if ((local->unkC == 102) && (ml_vec3f_distance(this->position, local->target_position) < 200.0f)) { + func_8038BBA0(this, 103); + } + if ((local->unkC == 103) && (func_80335794(this->unk148) >= 2)) { + func_8038C0C8(this, 1); + } + } + if (this->state == 5) { + local->unk10 = 200.0f; + if (ml_vec3f_distance(this->position, local->target_position) < 100.0f) { + local->target_position[0] = randf2(-500.0f, 500.0f); + local->target_position[1] = 0.0f; + local->target_position[2] = randf2(-500.0f, 500.0f); + } + } + if ((this->state == 6)){ + local->unk10 = 400.0f; + if((ml_vec3f_distance(this->position, local->target_position) < 100.0f) || (ml_vec3f_distance(&sp94, local->target_position) < 300.0f)) { + for(i = 0; i < 10; i++){ + sp58[0] = randf2(-500.0f, 500.0f); + sp58[1] = 0.0f; + sp58[2] = randf2(-500.0f, 500.0f); + if ((i == 0) || (ml_vec3f_distance(&sp94, &sp58) > ml_vec3f_distance(&sp94, local->target_position))) { + local->target_position[0] = sp58[0]; + local->target_position[1] = sp58[1]; + local->target_position[2] = sp58[2]; + } + }; + } + } + func_8038BDD4(this); + if (this->state != 4) { + func_8028E668(this->position, 100.0f, -50.0f, 120.0f); + } +} diff --git a/src/BGS/ch/tanktup.c b/src/BGS/ch/tanktup.c new file mode 100644 index 00000000..5a3d5dd6 --- /dev/null +++ b/src/BGS/ch/tanktup.c @@ -0,0 +1,199 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + +void func_80324E88(f32); + +void timedFunc_set_2(f32, void(*)(s32, s32), s32, s32); + +void func_8028E668(f32[3], f32, f32, f32); +extern void func_802C3E10(void(*arg0)(void), ActorMarker *, s32, s32); + +void func_8038F6A4(Actor *); + +/* .data */ +ActorAnimationInfo D_80390C20[] = { + {0, 0.0f}, + {0x101, 7.5f}, + {0x102, 1.75f}, + {0x107, 1.75f} +}; + +ActorInfo D_80390C40 = {0x6C, 0xE8, 0x3EE, 0x01, D_80390C20, + func_8038F6A4, func_80326224, func_80325888, + 0, 0x80, 0.0f, 0 +}; + +/* .code */ +void func_8038F470(ActorMarker *this, s32 arg1, s32 arg2){ + Actor* thisActor; + f32 pad; + Actor* sp24; + f32 sp18[3]; + + thisActor = marker_getActor(this); + sp18[0] = thisActor->position_x; + sp18[1] = thisActor->position_y; + sp18[2] = thisActor->position_z; + sp18[1] += 50.0f; + + sp24 = func_8032813C(arg2 + 0xe9, sp18, (s32)thisActor->yaw); + func_80328B8C(sp24, arg1 + 1, 0, -1); + sp24->unk10_12 = arg2; +} + +void func_8038F51C(Actor *this){ + Actor * spawnPtr; + spawnPtr = func_80326D68(this->position, 0xe8, -1, 0); + spawnPtr->tanktup.unk0[this->unk10_12] = 1; + spawnPtr->tanktup.unk10 = 1; +} + +s32 func_8038F570(s16 *arg0){ + f32 pos[3]; + Actor * spawnPtr; + + pos[0] = (f32)arg0[0]; + pos[1] = (f32)arg0[1]; + pos[2] = (f32)arg0[2]; + spawnPtr = func_80326D68(pos, 0xe8, -1, 0); + return spawnPtr->state == 3; + + +} + +void func_8038F5E4(s32 arg0, s32 arg1, s32 arg2){ + func_80324E88(0.0f); +} + +void func_8038F610(Actor *this) { + f32 sp24[3]; + + func_8034A174(this->marker->unk44, 8, &sp24); + if (func_80258368(&sp24) != 0) { + func_8028E668(&sp24, 200.0f, -600.0f, 300.0f); + } + func_8034A174(this->marker->unk44, 7, &sp24); + if (func_80258368(&sp24) != 0) { + func_8028E668(&sp24, 200.0f, -600.0f, 200.0f); + } +} + +extern f32 D_803911B0; +extern f32 D_803911B4; + +void func_8028F94C(s32, f32[3]); +void func_8028F918(s32); + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/BGS/ch/tanktup/func_8038F6A4.s") +#else +void func_8038F6A4(Actor *this) { + f32 sp48[3]; + s32 sp44; + f32 sp34[3]; + Prop *temp_v0; + ActorLocal_TanktupBody * local = (ActorLocal_TanktupBody *)&this->local; + + + if(!this->initialized){ + temp_v0 = func_80304C38(0x32B, this); + if (temp_v0 == NULL) { + local->unk18[0] = D_803911B0; + local->unk18[1] = 100.0f; + local->unk18[2] = D_803911B4; + } else { + nodeprop_getPosition(temp_v0, local->unk18); + } + this->unk138_24 = FALSE; + this->initialized = TRUE; + } + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + this->scale = 1.0f; + for(sp44 = 0; sp44 < 4; sp44++){ + if (local->unk0[sp44] == 0) { + func_802C3E10(&func_8038F470, this->marker, local->unk0[sp44], sp44); + } + } + } + switch(this->state){ + case 1: + func_8038F610(this); + player_getPosition(&sp48); + if (!this->unk138_24) { + if( ml_vec3f_distance(local->unk18, &sp48) < 250.0f + && ml_vec3f_distance(local->unk18, &sp48) > 80.0f + && !func_8028ECAC() + && player_getTransformation() == TRANSFORM_1_BANJO + ) { + func_80311480(0xC7E, 0, NULL, NULL, NULL, NULL); + this->unk138_24 = TRUE; + } + } + if (local->unk10) { + func_80328B8C(this, 2, 0.0f, -1); + local->unk10 = 0; + local->unk14 = TRUE; + for(sp44 = 0; sp44 < 4; sp44++){ + if(local->unk0[sp44] == 0){ + local->unk14 = FALSE; + } + } + if(!this->unk138_23 && !local->unk14){ + if(func_80311480(0xC80, 0, NULL, NULL, NULL, NULL)) + this->unk138_23 = TRUE; + } + } + break; + + case 2: + func_8038F610(this); + if (actor_animationIsAt(this, 0.6f) && local->unk14) { + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + func_8028F94C(2, local->unk18); + } + if (actor_animationIsAt(this, 0.99f)) { + if (!local->unk14) { + func_80328B8C(this, 1, 0.0f, -1); + } + else{ + func_80328B8C(this, 3, 0.0f, -1); + actor_playAnimationOnce(this); + } + } + break; + + case 3: + if (actor_animationIsAt(this, 0.1f) != 0) { + timed_setCameraToNode(0.0f, 0xD); + } + if (actor_animationIsAt(this, 0.55f) != 0) { + func_8030E624(0x797FF885U); + } + if (actor_animationIsAt(this, 0.4f) != 0) { + func_8034A174(this->marker->unk44, 6, sp34); + func_802C8F70(this->yaw); + sp34[1] -= 125.0f; + jiggySpawn(JIGGY_26_BGS_TANKTUP, sp34); + } + if (actor_animationIsAt(this, 0.9f) != 0) { + func_8028F918(0); + if (jiggyscore_isCollected(JIGGY_26_BGS_TANKTUP) == 0) { + func_80311480(0xC7F, 0xF, this->position, this->marker, func_8038F5E4, NULL); + } + else{ + func_8038F5E4(this->marker, 0xC7F, -1); + } + } + break; + } +} +#endif + + diff --git a/src/BGS/ch/yellowflibbit.c b/src/BGS/ch/yellowflibbit.c new file mode 100644 index 00000000..f1ae417c --- /dev/null +++ b/src/BGS/ch/yellowflibbit.c @@ -0,0 +1,496 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + u8 unk0; + u8 unk1; + u8 unk2; + u8 pad3[1]; + s16 unk4[3]; + s16 unkA[3]; + s16 unk10[3]; + u8 pad16[0x2]; + f32 unk18; + f32 unk1C; + f32 unk20[2]; + f32 unk28; +}ActorLocal_Yellow_Flibbit; + +Actor *func_8038DE5C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx** vtx); +void func_8038E034(Actor *this); + +/* .data */ +ActorInfo D_80390AE0 = { + 0xC5, 0x137, 0x385, + 0, NULL, + func_8038E034, NULL, func_8038DE5C, + 0, 0, 1.0f, 0 +}; +s32 D_80390B04[3] = {0xFF, 0xB3, 0}; +f32 D_80390B10[3] = {0.0f, 0.0f, 0.0f}; + +/* .code */ +void func_8038D1E0(Actor *this) { + ParticleEmitter *temp_s0; + + temp_s0 = partEmitList_pushNew(4U); + particleEmitter_setSprite(temp_s0, ASSET_70E_SPRITE_SMOKE_2); + func_802EFA5C(temp_s0, 0.01f, 0.7f); + particleEmitter_setStartingFrameRange(temp_s0, 0, 7); + particleEmitter_setPosition(temp_s0, this->position); + func_802EFFA8(temp_s0, D_80390B04); + func_802EFB70(temp_s0, 1.0f, 1.5f); + func_802EFB84(temp_s0, 2.5f, 3.0f); + particleEmitter_setParticleVelocityRange(temp_s0, -70.0f, 50.0f, -70.0f, 70.0f, 100.0f, 70.0f); + func_802EFEC0(temp_s0, 3.0f, 4.0f); + particleEmitter_emitN(temp_s0, 4); + FUNC_8030E8B4(SFX_30_MAGIC_POOF, 1.0f, 25000, this->position, 500, 2500); +} + +s32 func_8038D2F4(Actor *this, f32 *arg1, bool arg2) { + ActorLocal_Yellow_Flibbit *local; + + local = (ActorLocal_Yellow_Flibbit *)&this->local; + local->unk1 = arg2; + local->unk4[0] = (s16) this->position[0];\ + local->unk4[1] = (s16) this->position[1];\ + local->unk4[2] = (s16) this->position[2]; + + local->unkA[0] = (s16) arg1[0]; + local->unkA[1] = (s16) arg1[1]; + local->unkA[2] = (s16) arg1[2]; + local->unkA[1] = (s16) (s32) func_80309724(arg1); + func_80335924(this->unk148, ASSET_DB_ANIM_FLIBBIT_HOP, 0.2f, (arg2) ? randf2(0.7f, 0.8f) : randf2(0.7f, 0.8f)); + func_80335A8C(this->unk148, 2); + func_80324D54(0.2f, SFX_3F2_UNKNOWN, randf2(0.7f, 1.3f), randi2(25000, 27000), this->position, 500.0f, 2500.0f); + return TRUE; +} + +bool func_8038D468(Actor *this) { + f32 player_position[3]; + f32 sp50; + f32 sp4C; + f32 sp48; + f32 sp3C[3]; + f32 sp30[3]; + + player_getPosition(player_position); + func_80258A4C(this->position, this->yaw - 90.0f, player_position, &sp50, &sp4C, &sp48); + if (func_80329210(this, &player_position)) { + if ((-0.7 <= sp48) && (sp48 <= 0.7)) { + sp3C[0] = player_position[0] - this->position[0]; + sp3C[1] = player_position[1] - this->position[1]; + sp3C[2] = player_position[2] - this->position[2]; + ml_vec3f_set_length(sp3C, 210.0f); + sp30[0] = this->position[0] + sp3C[0]; + sp30[1] = this->position[1] + sp3C[1]; + sp30[2] = this->position[2] + sp3C[2]; + if (func_80329210(this, sp30)) { + return func_8038D2F4(this, sp30, 1); + } + } + } + return FALSE; +} + +bool func_8038D5A8(Actor *this) { + f32 sp64[3]; + f32 sp60; + f32 sp5C; + f32 sp58; + f32 sp4C[3]; + ActorLocal_Yellow_Flibbit *local; + f32 sp3C[3]; + + local = (ActorLocal_Yellow_Flibbit *)&this->local; + sp64[0] = (f32) local->unk10[0]; + sp64[1] = (f32) local->unk10[1]; + sp64[2] = (f32) local->unk10[2]; + func_80258A4C(this->position, this->yaw - 90.0f, sp64, &sp60, &sp5C, &sp58); + if ((-0.9 <= sp58) && (sp58 <= 0.9)) { + if (252.0 < sp60) { + sp4C[0] = sp64[0] - this->position[0]; + sp4C[1] = sp64[1] - this->position[1]; + sp4C[2] = sp64[2] - this->position[2]; + ml_vec3f_set_length(sp4C, 210.0f); + sp3C[0] = this->position[0] + sp4C[0]; + sp3C[1] = this->position[1] + sp4C[1]; + sp3C[2] = this->position[2] + sp4C[2]; + } else { + sp3C[0] = (f32) local->unk10[0]; + sp3C[1] = (f32) local->unk10[1]; + sp3C[2] = (f32) local->unk10[2]; + } + if (func_80329210(this, sp3C) != 0) { + return func_8038D2F4(this, sp3C, 0); + } + } + return FALSE; +} + +s32 func_8038D768(Actor *this) { + f32 player_position[3]; + f32 sp80; + f32 sp7C; + f32 sp78; + s32 var_s1; + f32 sp68[3]; + f32 var_f2; + + player_getPosition(player_position); + func_80258A4C(this->position, this->yaw - 90.0f, player_position, &sp80, &sp7C, &sp78); + for(var_s1 = 0; var_s1 != 10; var_s1++){ + if (var_s1 < 5) { + if (sp78 > 0.0f) { + var_f2 = randf2(10.0f, 90.0f) + this->yaw; + } else { + var_f2 = randf2(-90.0f, -10.0f) + this->yaw; + } + } else { + var_f2 = randf2(-110.0f, 110.0f) + this->yaw; + } + func_80256E24(sp68, 0.0f, var_f2, 0.0f, 0.0f, 210.0f); + sp68[0] = this->position[0] + sp68[0]; + sp68[1] = this->position[1] + sp68[1]; + sp68[2] = this->position[2] + sp68[2]; + if (func_80329210(this, sp68)) { + return func_8038D2F4(this, sp68, 0); + } + } + return FALSE; +} + +bool func_8038D930(Actor *this) { + f32 player_position[3]; + s32 var_v1; + + player_getPosition(player_position); + if (func_80329210(this, &player_position)) { + var_v1 = func_8038D468(this); + if (var_v1 == 0) { + if (randf() > 0.5) { + return FALSE; + } + } + } + else{ + var_v1 = func_8038D5A8(this); + } + + if (var_v1 == 0) { + var_v1 = func_8038D768(this); + } + return var_v1; +} + +void func_8038D9D0(Actor *this, s32 next_state) { + ActorLocal_Yellow_Flibbit *local; + + local = (ActorLocal_Yellow_Flibbit *)&this->local; + local->unk1 = 0; + local->unk1C = 0.0f; + local->unk28 = 0.0f; + if (next_state == 1) { + if (this->state != 0) { + func_8038CEB8(); + func_8038D1E0(this); + } + actor_collisionOff(this); + } + if (next_state == 2) { + func_8038CE88(); + func_8038D1E0(this); + local->unk1C = 0.5f; + } + if (next_state == 3) { + func_80335924(this->unk148, ASSET_FA_ANIM_FLIBBIT_IDLE, 0.2f, randf2(1.0f, 2.0f)); + func_80335A74(this->unk148, randf2(0.0f, 0.9)); + func_80335A8C(this->unk148, 1); + actor_collisionOn(this); + this->position[0] = (f32) local->unk10[0]; + this->position[1] = (f32) local->unk10[1]; + this->position[2] = (f32) local->unk10[2]; + local->unk28 = randf2(1.0f, 3.0f); + } + if (next_state == 5) { + if (mapSpecificFlags_get(0x10)) { + func_8038D9D0(this, 4); + return; + } + if (!func_8038D930(this)){ + if ((this->state != 6)) { + func_8038D9D0(this, 6); + } + return; + } + } + if (next_state == 6) { + func_80335924(this->unk148, ASSET_FB_ANIM_FLIBBIT_TURN, 0.2f, 1.0f); + func_80335A74(this->unk148, randf2(0.0f, 1.0f)); + func_80335A8C(this->unk148, 1); + local->unk28 = randf2(1.0f, 3.0f); + } + if (next_state == 7) { + func_80335924(this->unk148, ASSET_FA_ANIM_FLIBBIT_IDLE, 0.2f, randf2(1.0f, 2.0f)); + func_80335A74(this->unk148, randf2(0.0f, 0.9)); + func_80335A8C(this->unk148, 1); + this->position[1] = func_80309724(this->position); + local->unk1C = 1.0f; + } + if (next_state == 8) { + FUNC_8030E8B4(SFX_8E_GRUNTLING_DAMAGE, 1.5f, 32200, this->position, 500, 2500); + func_80335924(this->unk148, ASSET_288_ANIM_FLIBBIT_OW, 0.1f, 0.65f); + func_80335A8C(this->unk148, 2); + this->position[1] = func_80309724(this->position); + local->unk1C = 1.0f; + } + if (next_state == 9) { + func_80335924(this->unk148, ASSET_112_ANIM_FLIBBIT_DIE, 0.2f, 0.4f); + FUNC_8030E8B4(SFX_115_BUZZBOMB_DEATH, 1.0f, 32200, this->position, 500, 2500); + this->marker->collidable = FALSE; + this->unk10_1 = FALSE; + func_8038CEA0(); + local->unk18 = 1000.0f; + } + if (next_state == 0xA) { + func_80335924(this->unk148, ASSET_113_ANIM_FLIBBIT_DEAD, 0.2f, 1.0f); + func_80335A8C(this->unk148, 2); + FUNC_8030E8B4(SFX_2F_ORANGE_SPLAT, 0.8f, 32200, this->position, 500, 2500); + } + if (next_state == 0xB) { + func_80326310(this); + } + this->state = next_state; +} + +void func_8038DD9C(ActorMarker *marker, ActorMarker *other_marker){ + Actor *this; + + this = marker_getActor(marker); + if(this->state < 9){ + func_8038D9D0(this, 7); + } +} + +void func_8038DDDC(ActorMarker *marker, ActorMarker *other_marker){ + Actor *this; + + this = marker_getActor(marker); + if(this->state < 9){ + func_8038D9D0(this, 8); + } +} + +void func_8038DE1C(ActorMarker *marker, ActorMarker *other_marker){ + Actor *this; + + this = marker_getActor(marker); + if(this->state < 9){ + func_8038D9D0(this, 9); + } +} + +Actor *func_8038DE5C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *this; + ActorLocal_Yellow_Flibbit *local; + s32 var_s0; + f32 var_f2; + f32 sp7C[3]; + s32 temp_a0_2; + + this = marker_getActor(marker); + local = (ActorLocal_Yellow_Flibbit *)&this->local; + if (this->state < 3) { + return this; + } + if (local->unk0 && ((this->state == 3) || (this->state == 6))) { + temp_a0_2 = func_803356A0(this->unk148); + for(var_s0 = 0; var_s0 < 2; var_s0++){ + if (0.1 <= local->unk20[var_s0]) { + var_f2 = (f32) ((local->unk20[var_s0] - 0.1) / 0.1); + } else if (local->unk20[var_s0] >= 0.0f) { + var_f2 = (f32) (1.0 - (local->unk20[var_s0] / 0.1)); + } else { + var_f2 = 1.0f; + } + sp7C[0] = 1.0f; + sp7C[1] = var_f2 * 0.99 + 0.01; + sp7C[2] = 1.0f; + func_8033A928(temp_a0_2, (var_s0 != 0) ? 0x2D : 0x2E, sp7C); + }; + } + func_80325888(marker, gfx, mtx, vtx); + local->unk0 = marker->unk14_21; + return this; +} + +void func_8038E034(Actor *this) { + f32 spB4[3]; + f32 spA8[3]; + f32 spA4; + ActorLocal_Yellow_Flibbit *local = (ActorLocal_Yellow_Flibbit *)&this->local; + f32 sp9C; + f32 sp98; + f32 sp94; + f32 sp90; + f32 sp8C; + f32 sp88; + f32 sp7C[3]; + f32 temp_f12; + f32 sp74; + f32 sp70; + f32 sp6C; + f32 sp60[3]; + f32 sp5C; + f32 sp58; + f32 sp54; + f32 sp48[3]; + + sp9C = time_getDelta(); + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + marker_setCollisionScripts(this->marker, &func_8038DD9C, &func_8038DDDC, &func_8038DE1C); + local->unk2 = 0U; + local->unk20[0] = randf2(-2.0f, -1.0f); + local->unk20[1] = randf2(-2.0f, -1.0f); + local->unk10[0] = (s16) (s32) this->position[0]; + local->unk10[1] = (s16) (s32) this->position[1]; + local->unk10[2] = (s16) (s32) this->position[2]; + func_8038D9D0(this, 1); + if (jiggyscore_isSpawned(JIGGY_24_BGS_FLIBBITS) != 0) { + marker_despawn(this->marker); + } + return; + } + if (!local->unk2) { + local->unk2 = TRUE; + func_8038CED0(); + } + player_getPosition(spB4); + spA8[0] = spB4[0] - this->position[0]; + spA8[1] = spB4[1] - this->position[1]; + spA8[2] = spB4[2] - this->position[2]; + spA4 = gu_sqrtf(spA8[0]*spA8[0] + spA8[1]*spA8[1] + spA8[2]*spA8[2]); + if (func_8025773C(&local->unk28, sp9C) != 0) { + func_8030E878(0x3F0, randf2(0.9f, 1.1f), randi2(12000, 19000), this->position, 500.0f, 2500.0f); + local->unk28 = randf2(1.0f, 6.0f); + } + local->unk20[0] += sp9C; + local->unk20[0] = (0.2 < (f64) local->unk20[0]) ? randf2(-3.0f, -1.0f) : local->unk20[0]; + + local->unk20[1] += sp9C; + local->unk20[1] = (0.2 < (f64) local->unk20[1]) ? randf2(-3.0f, -1.0f) : local->unk20[1]; + + if(this->state == 1){ + if(mapSpecificFlags_getClear(0x12)){ + func_8038D9D0(this, 2); + return; + } + + if(spA4 < 2000.0f){ + func_80258A4C(this->position, this->yaw - 90.0f, spB4, &sp98, &sp94, &sp90); + this->yaw += (sp90*90.0f) *sp9C; + } + } + + if(this->state == 2){ + if(func_8025773C(&local->unk1C, sp9C)){ + func_8038D9D0(this, 3); + } + } + + if(this->state == 3){ + if (func_80329210(this, spB4)) { + func_8038D9D0(this, 5); + } else { + func_8038D9D0(this, 1); + } + } + + + if(this->state == 4){ + if(!mapSpecificFlags_get(0x10)) + func_8038D9D0(this, 5); + } + + if (this->state == 5) { + func_8033568C(this->unk148, &sp8C, &sp88); + if (sp8C < 0.8 && 0.8 <= sp88) { + func_8030E878(SFX_8_BANJO_LANDING_04, randf2(0.8f, 0.9f), randi2(0x61A8, 0x6978), this->position, 100.0f, 1500.0f); + } + if (func_80335794(this->unk148) > 0) { + sp7C[0] = (f32) local->unk10[0]; + sp7C[1] = (f32) local->unk10[1]; + sp7C[2] = (f32) local->unk10[2]; + if (ml_vec3f_distance(this->position, sp7C) < 30.0f) { + func_8038D9D0(this, 1); + } else { + func_8038D9D0(this, 5); + } + } else { + + if ((0.2 <= sp88) && (sp88 <= 0.8)) { + temp_f12 = ((sp88 - 0.2) / 0.60000000000000009); + this->position_x = local->unk4[0] + (local->unkA[0] - local->unk4[0])*temp_f12; + this->position_y = local->unk4[1] + (local->unkA[1] - local->unk4[1])*temp_f12; + this->position_z = local->unk4[2] + (local->unkA[2] - local->unk4[2])*temp_f12; + + if (local->unk1 != 0) { + if (sp88 <= 0.5) { + this->position[1] = (f32) ((f64) this->position[1] + ((sp88 / 0.5) * 70.0)); + } else { + this->position[1] = (f32) ((f64) this->position[1] + ((1.0 - ((sp88 - 0.5) / 0.5)) * 70.0)); + } + } + sp60[0] = (f32) (local->unkA[0] - local->unk4[0]); + sp60[1] = (f32) (local->unkA[1] - local->unk4[1]); + sp60[2] = (f32) (local->unkA[2] - local->unk4[2]); + func_80258A4C(D_80390B10, this->yaw - 90.0f, sp60, &sp74, &sp70, &sp6C); + this->yaw += sp6C * 220.0f * sp9C; + } + } + } + + if (this->state == 6) { + func_80258A4C(this->position, this->yaw - 90.0f, spB4, &sp5C, &sp58, &sp54); + this->yaw += sp54 * 90.0f * sp9C; + if ((-0.4 <= sp54) && (sp54 <= 0.4) && ((f64) randf() > 0.5)) { + func_8038D9D0(this, 5); + } + if ((sp58 < 0.0f) && (randf() > 0.5)) { + func_8038D9D0(this, 5); + } + } + + if(this->state == 7 || this->state == 8){ + if(func_8025773C(&local->unk1C, sp9C)){ + func_8038D9D0(this, 6); + } + } + + if(this->state == 9){ + sp48[0] = this->position[0] - spB4[0]; + sp48[1] = this->position[1] - spB4[1]; + sp48[2] = this->position[2] - spB4[2]; + sp48[1] = 0.0f; + ml_vec3f_set_length(sp48, 400.0f * sp9C); + + this->position[0] = this->position[0] + sp48[0]; + this->position[1] = this->position[1] + sp48[1]; + this->position[2] = this->position[2] + sp48[2]; + + this->position_y += local->unk18*sp9C; + local->unk18 -= 3000.0f*sp9C; + if(this->position_y < func_80309724(this->position)){ + this->position_y = func_80309724(this->position); + func_8038D9D0(this, 10); + } + } + + if(this->state == 10){ + if(func_80335794(this->unk148) > 0){ + func_8038D9D0(this, 11); + } + } +} diff --git a/src/BGS/ch/yumblie.c b/src/BGS/ch/yumblie.c new file mode 100644 index 00000000..6bf0c930 --- /dev/null +++ b/src/BGS/ch/yumblie.c @@ -0,0 +1,216 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" +extern void func_803253A0(Actor *); +extern void func_80325794(ActorMarker *); +extern f32 randf (void); + +enum chyumblie_state_e{ + YUMBLIE_STATE_1_UNDER_GROUND = 1, + YUMBLIE_STATE_2_APPEAR, + YUMBLIE_STATE_3_ABOVE_GROUND, + YUMBLIE_STATE_4_DISAPPEAR, + YUMBLIE_STATE_5_BEING_EATEN, +}; + +typedef struct chyumblie_s{ + f32 unk0; + u8 unk4; + u8 pad7[3]; + f32 unk8; //wait_timer + ActorMarker *game_marker; +} ActorLocal_Yumblie; + +void chyumblie_set_state(Actor*, enum chyumblie_state_e); +void chyumblie_update(Actor *); +Actor *chyumblie_draw(ActorMarker *this, Gfx **gfx, Mtx** mtx, Vtx **vtx); + +/* .data */ +ActorInfo D_80390A40 = {0xC7, actor_yumblie, 0x3F6, 0x00, NULL, + chyumblie_update, NULL, chyumblie_draw, + 0, 0, 0.0f, 0 +}; + +/* .code */ +bool func_8038B160(Actor *this){ + ActorLocal_Yumblie *local; + s32 temp_v0; + + local = (ActorLocal_Yumblie *)&this->local; + temp_v0 = func_8038A9E0(local->game_marker); + if ((temp_v0 == 1) || (temp_v0 == 4)) + return FALSE; + + if ((temp_v0 == 2) || (temp_v0 == 5)) + return (0.7 <= randf ()) ? TRUE : FALSE; + + return (randf () >= 0.5)? TRUE : FALSE; +} + +void chyumblie_set_state(Actor* this, enum chyumblie_state_e next_state){ + + ActorLocal_Yumblie *s0; + s0 = (ActorLocal_Yumblie *)&this->local; + s0->unk8 = 0; + if(next_state == 1){ + s0->unk8 = randf2(1.0f, 10.0f); + } + + if(next_state == 2){ + this->yaw = randf2(0.0f, 360.0f); + s0->unk4 = func_8038B160(this); + func_8038AC54(s0->game_marker, this->marker, this->position, s0->unk4); + func_80335924(this->unk148, (s0->unk4)? ASSET_128_ANIM_GRUMBLIE_APPEAR : ASSET_125_ANIM_YUMBLIE_APPEAR, 0.0f, 1.5f); + func_80335A8C(this->unk148, 2); + } + if(next_state == 3){ + s0->unk8 = randf2(5.0f, 10.0f); + func_80335924(this->unk148, (s0->unk4)? ASSET_12A_ANIM_GRUMBLIE_IDLE : ASSET_127_ANIM_YUMBLIE_IDLE, 0.1f, randf2(0.5f, 1.0f)); + func_80335A8C(this->unk148, 1); + if(s0->unk4){ + func_8030E6A4(SFX_C4_TWINKLY_MUNCHER_GRR,randf2(1.0f, 1.2), 30000); + }else{ + func_8030E878(SFX_C3_HEGH,randf2(1.0f, 1.2), 30000, this->position, 500.0f, 3000.0f); + } + } + + if(next_state == 4){ + chvilegame_remove_piece(s0->game_marker, this->marker); + func_80335924(this->unk148, (s0->unk4)? ASSET_129_ANIM_GRUMBLIE_HIDE : ASSET_126_ANIM_YUMBLIE_HIDE, 0.1f, 0.5f); + func_80335A8C(this->unk148, 2); + } + if(next_state == 5){ + s0->unk8 = randf2(10.0f, 20.0f); + chvilegame_remove_piece(s0->game_marker, this->marker); + func_8030E878((s0->unk4)? SFX_C4_TWINKLY_MUNCHER_GRR: SFX_C3_HEGH, 1.4f, 32000, this->position, 500.0f, 3000.0f); + } + this->state = next_state; +} + +bool chyumblie_is_edible(ActorMarker * arg0){ + volatile Actor* actPtr; + + actPtr = marker_getActor(arg0); + return (actPtr->state >= 2) && (actPtr->state < 5); +} + +Actor *chyumblie_draw(ActorMarker *this, Gfx **gfx, Mtx** mtx, Vtx **vtx){ + Actor *thisActor; + ActorLocal_Yumblie *sp40; + f32 sp44[3]; + f32 sp38[3]; + + thisActor = marker_getActor(this); + sp40 = (ActorLocal_Yumblie *)&thisActor->local; + if ( thisActor->state < 2 || thisActor->state > 4){ + thisActor->marker->unk14_21 = 0; + return thisActor; + } + + func_8033A2D4(func_803253A0, thisActor, sp40); + func_8033A2E8(func_80325794, this); + sp44[0] = thisActor->position_x; + sp44[1] = thisActor->position_y + sp40->unk0*75.0f; + sp44[2] = thisActor->position_z; + sp38[0] = thisActor->pitch; + sp38[1] = thisActor->yaw; + sp38[2] = thisActor->roll; + if(sp40->unk4 && sp40->game_marker){ + func_803391A4(gfx, mtx, sp44, sp38, 1.0f, NULL, chvilegame_get_grumblie_model(sp40->game_marker)); + } + else{ + func_803391A4(gfx, mtx, sp44, sp38, 1.0f, NULL, func_80330B1C(this)); + } + return thisActor; +} + +bool func_8038B684(ActorMarker * arg0){ + Actor* actPtr = marker_getActor(arg0); + + if( actPtr->state < 5){ + chyumblie_set_state(actPtr, YUMBLIE_STATE_5_BEING_EATEN); + return TRUE; + } + + return FALSE; +} + +void chyumblie_update(Actor *this){ + ActorLocal_Yumblie *s0; + f32 sp50; + f32 sp4C; + f32 sp48; + s32 pad44; + f32 tmp; + + s0 = (ActorLocal_Yumblie *)&this->local; + sp4C = time_getDelta(); + if(!this->unk16C_4){ + this->unk16C_4 = 1; + s0->unk0 = 0.0f; + s0->unk4 = 0; + s0->game_marker = NULL; + chyumblie_set_state(this, YUMBLIE_STATE_1_UNDER_GROUND); + return; + } + + if(s0->game_marker == NULL){ + s0->game_marker = func_80326D68(this->position, 0x138, -1, &sp48)->marker; + } + sp50 = func_80335684(this->unk148); + if(this->state == YUMBLIE_STATE_1_UNDER_GROUND){ + if(func_8025773C(&s0->unk8, sp4C)){ + if(mapSpecificFlags_get(6) && (12 > chvilegame_get_piece_count(s0->game_marker))){ + chyumblie_set_state(this, YUMBLIE_STATE_2_APPEAR); + } + else{ + chyumblie_set_state(this, YUMBLIE_STATE_1_UNDER_GROUND); + } + } + } + if(this->state == YUMBLIE_STATE_2_APPEAR){ + tmp = s0->unk0; + if(s0->unk4){ + if(sp50 <= 0.3){ + s0->unk0 = sp50/0.3; + } + }else{ + if(sp50 <= 0.6){ + s0->unk0 = sp50/0.6; + } + } + + if((tmp < 0.5) && (0.5 <= s0->unk0)){ + func_8030E878(SFX_C5_TWINKLY_POP, randf2(1.0f, 1.2f), 30000, this->position, 500.0f, 3000.0f); + } + + if( 0 < func_80335794(this->unk148)){ + s0->unk0 = 1.0f; + chyumblie_set_state(this,YUMBLIE_STATE_3_ABOVE_GROUND); + } + + } + if(this->state == YUMBLIE_STATE_3_ABOVE_GROUND){ + if( func_8025773C(&s0->unk8,sp4C) || !mapSpecificFlags_get(6) ){ + chyumblie_set_state(this,YUMBLIE_STATE_4_DISAPPEAR); + } + } + + if(this->state == YUMBLIE_STATE_4_DISAPPEAR){ + if(sp50 >= 0.25 ) + s0->unk0 -= 2.0f*(f64)sp4C; + + if(0.0f >= s0->unk0){ + s0->unk0 = 0.0f; + chyumblie_set_state(this,YUMBLIE_STATE_1_UNDER_GROUND); + } + } + + if(this->state == YUMBLIE_STATE_5_BEING_EATEN){ + if( func_8025773C(&s0->unk8,sp4C)){ + chyumblie_set_state(this,YUMBLIE_STATE_1_UNDER_GROUND); + } + } +} diff --git a/src/BGS/code_3030.c b/src/BGS/code_3030.c new file mode 100644 index 00000000..ca3b55e8 --- /dev/null +++ b/src/BGS/code_3030.c @@ -0,0 +1,105 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + s32 unk0; + ActorMarker *unk4; //tiptup_marker + f32 unk8; + s32 unkC; +}ActorLocal_BGS_3030; + +void func_80389668(Actor *this); +Actor *func_80389610(ActorMarker *marker, Gfx **, Mtx **, Vtx**); + +/* .data */ +ActorInfo D_80390880 = { 0x019B, 0x27B, 0x3F9, 0, NULL, func_80389668, NULL, func_80389610, 0, 0, 1.5f, 0}; +ActorInfo D_803908A4 = { 0x019C, 0x27C, 0x3F9, 0, NULL, func_80389668, NULL, func_80389610, 0, 0, 1.5f, 0}; +ActorInfo D_803908C8 = { 0x019D, 0x27D, 0x3F9, 0, NULL, func_80389668, NULL, func_80389610, 0, 0, 1.5f, 0}; +ActorInfo D_803908EC = { 0x019E, 0x27E, 0x3F9, 0, NULL, func_80389668, NULL, func_80389610, 0, 0, 1.5f, 0}; +ActorInfo D_80390910 = { 0x019F, 0x27F, 0x3F9, 0, NULL, func_80389668, NULL, func_80389610, 0, 0, 1.5f, 0}; +ActorInfo D_80390934 = { 0x01A0, 0x280, 0x3F9, 0, NULL, func_80389668, NULL, func_80389610, 0, 0, 1.5f, 0}; + +/* .code */ +void func_80389420(ActorMarker *marker) { + Actor *this; + + this = marker_getActor(marker); + func_8030E878(SFX_C5_TWINKLY_POP, randf2(1.0f, 1.2f), 25000, this->position, 500.0f, 3000.0f); +} + +void func_80389488(Actor *this, s32 next_state) { + ActorLocal_BGS_3030 *local; + + local = (ActorLocal_BGS_3030 *)&this->local; + if (next_state == 1) { + func_80335924(this->unk148, 0x12D, 0.2f, randf2(2.0f, 2.5f)); + func_80335A74(this->unk148, randf2(0.0f, 1.0f)); + } + if (next_state == 2) { + func_80335924(this->unk148, 0x12E, 0.1f, 1.6666666f); + timed_playSfx(0.8333333, SFX_86_TIPTUP_CHORUS_AH, local->unk8, 0x7FFF); + } + if (next_state == 3) { + func_8030E6A4(SFX_86_TIPTUP_CHORUS_AH, local->unk8, 0x7FFF); + func_80335924(this->unk148, 0x12F, 0.1f, 1.75f); + func_80335800(this->unk148, 0.9f, func_80389420, (s32)this->marker); + if (local->unk4 != NULL) { + func_80388E94(local->unk4, local->unk0); + } + } + this->state = next_state; +} + +void func_803895D0(ActorMarker *marker, ActorMarker *other_marker){ + Actor *this; + + this = marker_getActor(marker); + if(this->state != 3){ + func_80389488(this, 3); + } +} + +Actor *func_80389610(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + func_8033A45C(4, marker->unk14_20 - 0x19A); + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_80389668(Actor *this) { + ActorLocal_BGS_3030 *local; + f32 sp30; + Actor *temp_v0_2; + + local = (ActorLocal_BGS_3030 *)&this->local; + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + marker_setCollisionScripts(this->marker, NULL, func_803895D0, NULL); + local->unk0 = 1; + local->unkC = 0; + local->unk4 = NULL; + local->unk8 = 1.0f; + func_80389488(this, 1); + if (jiggyscore_isSpawned(JIGGY_27_BGS_TIPTUP) && !func_803203FC(2) && !func_803203FC(1)) { + marker_despawn(this->marker); + } + return; + } + + local->unkC++; + if (local->unkC == 2) { + temp_v0_2 = func_80326D68(this->position, 0x27A, -1, &sp30); + local->unk4 = (temp_v0_2 != NULL) ? temp_v0_2->marker : NULL; + if (local->unk4 != NULL) { + func_80388FFC(local->unk4, &local->unk0, &local->unk8); + } + } + if (this->state == 1) { + if (local->unk4 != NULL && (func_80388E70(local->unk4) == local->unk0)) { + func_80389488(this, 2); + } + } + if (((this->state == 2) || (this->state == 3)) && (func_80335794(this->unk148) > 0)) { + func_80389488(this, 1); + } +} diff --git a/src/BGS/code_3420.c b/src/BGS/code_3420.c new file mode 100644 index 00000000..e5945c62 --- /dev/null +++ b/src/BGS/code_3420.c @@ -0,0 +1,646 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_80256AB4(f32, f32, f32, f32); +extern f32 func_8025715C(f32, f32); +extern f32 *func_8038C284(ActorMarker *); +extern void func_802C8F7C(f32); +extern void func_802FDCB8(s32); + +enum chvilegame_piece_type_e { + YUMBLIE, + GRUMBLIE +}; + +struct vilegame_piece{ + enum chvilegame_piece_type_e type; + f32 position[3]; + ActorMarker *marker; //yumblie ptr; +}; + +typedef struct { + u8 current_type; + // u8 pad1[3]; + vector(struct vilegame_piece) *game_pieces; + BKModelBin *grumblie_model_bin; + u8 unkC; + u8 unkD; + u8 player_score; + u8 vile_score; + f32 type_change_timer; + ActorMarker *vile_marker; +}ActorLocal_BGS_3420; + +void func_8038A068(Actor *this, s32 next_state); +void chvilegame_update(Actor *this); + +/* .data */ +ActorInfo D_80390960 = {0xC6, 0x138, 0, 0, NULL, chvilegame_update, NULL, func_80325340, 0, 0, 0.0f, 0}; +enum asset_e D_80390984[] = { 0, 0xC66, 0xC68, 0xC6A, 0xC92, 0xC93, 0xC94, 0}; +enum asset_e D_803909A4[] = { 0, 0xC67, 0xC69, 0, 0xC95, 0xC96, 0xC97}; +enum asset_e D_803909C0[] = { 0, 0xC6E, 0xC6F, 0, 0xC95, 0xC96, 0xC97}; +enum asset_e D_803909DC[] = {0xC65, 0xC65, 0xC65, 0xC8F, 0, 0, 0}; +enum asset_e D_803909F8[] = {0xC64, 0, 0, 0xC8E, 0, 0, 0, 0}; +enum asset_e D_80390A18[] = {0xC6D, 0xC70, 0xC71, 0xC8E, 0, 0, 0, 0}; + +/* .code */ +bool func_80389810(f32 arg0[3]) { + if (func_8028ECAC() != BSGROUP_7_CROC_ATTACK) { + return FALSE; + } + func_8028E9C4(2, arg0); + return TRUE; +} + +void func_80389850(Actor *this, s32 arg1) { + ActorLocal_BGS_3420 *local; + Actor *vile; + f32 sp94[3]; + f32 sp88[3]; + f32 sp7C[3]; + s32 var_s0; + s32 var_v0; + + local = (ActorLocal_BGS_3420 *)&this->local; + vile = marker_getActor(local->vile_marker); + if (arg1 != 0) { + if (gu_sqrtf(this->position[0]*this->position[0] + this->position[1]*this->position[1] + this->position[2]*this->position[2]) < 800.0f) { + sp7C[0] = 0.0f; + sp7C[1] = 150.0f; + sp7C[2] = 300.0f; + ml_vec3f_yaw_rotate_copy(sp7C, sp7C, vile->yaw); + sp94[0] = vile->position[0] + sp7C[0]; + sp94[1] = vile->position[1] + sp7C[1]; + sp94[2] = vile->position[2] + sp7C[2]; + func_802C8F70(vile->yaw); + jiggySpawn(JIGGY_28_BGS_MR_VILE, sp94); + } else { + sp7C[0] = 0.0f - vile->position[0]; + sp7C[1] = 0.0f; + sp7C[2] = 0.0f - vile->position[2]; + ml_vec3f_set_length(sp7C, 150.0f); + sp7C[1] = 75.0f; + sp94[0] = vile->position[0] + sp7C[0]; + sp94[1] = vile->position[1] + sp7C[1]; + sp94[2] = vile->position[2] + sp7C[2]; + func_802C8F70(func_8025715C(sp7C[0], sp7C[2])); + jiggySpawn(JIGGY_28_BGS_MR_VILE, sp94); + } + } + for(var_s0 = 2; var_s0 != 0x3C; var_s0++){ + var_v0 = ((var_s0 & 1)) ? -(var_s0 / 2) * 0xA : (var_s0 / 2) * 0xA; + sp7C[0] = 0.0f; + sp7C[1] = 600.0f; + sp7C[2] = 1200.0f; + ml_vec3f_yaw_rotate_copy(sp7C, sp7C, vile->yaw + var_v0); + + sp94[0] = vile->position[0] + sp7C[0]; + sp94[1] = vile->position[1] + sp7C[1]; + sp94[2] = vile->position[2] + sp7C[2]; + + + sp88[0] = -30.0f; + sp88[1] = vile->yaw + var_v0; + sp88[2] = 0.0f; + + sp7C[2] = 0.0f; + sp7C[1] = sp94[1]; + sp7C[0] = 0.0f; + if(ml_vec3f_distance(sp94, sp7C) <= 1000.0f){ + break; + } + } + func_802BAE6C(sp94, sp88); +} + +void func_80389B48(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *this; + + this = marker_getActor(marker); + if(arg2 == 1){ + func_8038A068(this, 4); + } + else{ + func_8038A068(this, 3); + } +} + +void func_80389B98(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *this; + + this = marker_getActor(marker); + func_8038A068(this, 1); +} + +void func_80389BC8(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *this; + + this = marker_getActor(marker); + func_8038A068(this, 5); +} + +void func_80389BF8(ActorMarker *marker, enum asset_e text_id, s32 arg2) { + Actor *this; + ActorLocal_BGS_3420 *local; + + this = marker_getActor(marker); + local = (ActorLocal_BGS_3420 *)&this->local; + func_80324E88(0.0f); + func_80324E38(0.0f, 0); + local->unkC--; + func_8038A068(this, 7); +} + +void func_80389C58(ActorMarker *marker) { + Actor *this; + ActorLocal_BGS_3420 *local; + + this = marker_getActor(marker); + local = (ActorLocal_BGS_3420 *)&this->local; + func_80389850(this, 0); + func_80311480(D_80390984[local->unkC], 0xF, func_8038C284(local->vile_marker), this->marker, func_80389BF8, NULL); +} + +void func_80389CD8(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *this; + + this = marker_getActor(marker); + func_80324E88(0.0f); + func_80324E38(0.0f, 0); + func_8038A068(this, 5); +} + +void func_80389D20(ActorMarker *marker) { + Actor *this; + ActorLocal_BGS_3420 *local; + + this = marker_getActor(marker); + local = (ActorLocal_BGS_3420 *)&this->local; + func_80389850(this, 0); + if (local->unkC == local->unkD) { + func_80311480(D_803909A4[local->unkC], 0xF, func_8038C284(local->vile_marker), this->marker, func_80389CD8, NULL); + } else { + func_80311480(D_803909C0[local->unkC], 0xF, func_8038C284(local->vile_marker), this->marker, func_80389CD8, NULL); + } + func_80347A14(0); +} + +void func_80389DF8(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *this; + + this = marker_getActor(marker); + func_80324E88(0.0f); + func_80324E38(0.0f, 0); + func_8038A068(this, 1); +} + +void func_80389E40(ActorMarker *marker) { + Actor *this; + ActorLocal_BGS_3420 *local; + + this = marker_getActor(marker); + local = (ActorLocal_BGS_3420 *)&this->local; + + func_80389850(this, 1); + func_80311480(0xC6B, 0xF, func_8038C284(local->vile_marker), this->marker, func_80389DF8, NULL); +} + +void func_80389EAC(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *this; + ActorLocal_BGS_3420 *local; + + this = marker_getActor(marker); + local = (ActorLocal_BGS_3420 *)&this->local; + func_80324E88(0.0f); + func_80324E38(0.0f, 0); + local->unkC = 3; + func_8038A068(this, 1); +} + +void func_80389F08(ActorMarker *marker) { + Actor *vile; + Actor *this; + ActorLocal_BGS_3420 *local; + s32 i; + s32 var_s2; + + this = marker_getActor(marker); + local = (ActorLocal_BGS_3420 *)&this->local; + func_80389850(this, 0); + var_s2 = func_80326F58(0x49); + vile = marker_getActor(local->vile_marker); + if (var_s2 > 0) { + func_8025A6EC(COMUSIC_15_EXTRA_LIFE_COLLECTED, 0x7FF8); + } + for(i = 0; i < 3; i++){ + if (var_s2 < 3) { + func_802C8F70(vile->yaw + (f32) (i * 30)); + func_802C8F7C(2.0f); + func_802C937C(6, vile->position); + var_s2 += 1; + } else { + item_inc(ITEM_16_LIFE); + } + } + func_80311480(0xC98, 0xF, func_8038C284(local->vile_marker), this->marker, func_80389EAC, NULL); +} + + +void func_8038A044(void){ + func_8025A58C(-1, 400); +} + +void func_8038A068(Actor *this, s32 next_state) { + ActorLocal_BGS_3420 *local; + + local = (ActorLocal_BGS_3420 *)&this->local; + mapSpecificFlags_set(6, FALSE); + if (next_state == 1) { + if (local->vile_marker != NULL) { + func_8038C408(local->vile_marker); + } + } + if (next_state == 2) { + func_8038C3B0(local->vile_marker); + if (local->unkC == 3) { + if (local->unkD >= 4) { + func_80311480(0xC91, 0xE, func_8038C284(local->vile_marker), this->marker, func_80389B48, NULL); + } else { + func_80311480((local->unkC == local->unkD) ? 0xC8D : 0xC90, 0xE, func_8038C284(local->vile_marker), this->marker, func_80389B48, NULL); + } + } else { + func_80311480((local->unkC == local->unkD) ? 0xC63 : 0xC6C, 0xE, func_8038C284(local->vile_marker), this->marker, func_80389B48, NULL); + } + } + if (next_state == 3) { + func_80311480(D_803909DC[local->unkC], 4, func_8038C284(local->vile_marker), this->marker, func_80389B98, NULL); + } + if (next_state == 4) { + if (local->unkC == local->unkD) { + func_80311480(D_803909F8[local->unkC], 0xE | ((D_803909F8[local->unkC] == 0xC8E) ? 1 : 0) | 0xE, func_8038C284(local->vile_marker), this->marker, func_80389BC8, NULL); + } else { + func_80311480(D_80390A18[local->unkC], 0xF , func_8038C284(local->vile_marker), this->marker, func_80389BC8, NULL); + } + func_80347A14(0); + } + if (next_state == 5) { + local->unkC++; + if (local->unkD < local->unkC) { + local->unkD = local->unkC; + } + if (local->unkC == 7) { + func_8038C434(local->vile_marker); + } else { + local->current_type = YUMBLIE; + local->player_score = 0; + local->vile_score = 0; + if (func_803203FC(2) != 0) { + local->type_change_timer = 5.0f; + } else { + local->type_change_timer = 10.0f; + } + item_set(ITEM_0_HOURGLASS_TIMER, 3600-1); + item_set(ITEM_6_HOURGLASS, TRUE); + mapSpecificFlags_set(6, TRUE); + func_8038C3DC(local->vile_marker); + func_8025A58C(0, 4000); + timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_55_BGS_MR_VILE, 28000); + } + } + if (this->state == 5) { + if (local->unkC != 7) { + item_set(ITEM_6_HOURGLASS, FALSE); + if ((next_state != 6) && (next_state != 8) && (next_state != 9)) { + func_8038A044(); + } + } + func_8038C460(local->vile_marker); + func_80347A14(1); + } + if (next_state == 6) { + func_8038C3B0(local->vile_marker); + func_80324E38(0.0f, 3); + timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_3C_MINIGAME_LOSS, 28000); + timedFunc_set_0(4.0f, func_8038A044); + timedFunc_set_1(4.0f, func_80389C58, (s32) this->marker); + } + if (next_state == 8) { + func_8038C3B0(local->vile_marker); + func_80324E38(0.0f, 3); + timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_3B_MINIGAME_VICTORY, 28000); + timedFunc_set_0(3.0f, func_8038A044); + timedFunc_set_1(3.0f, func_80389D20, (s32) this->marker); + } + if (next_state == 9) { + func_8038C3B0(local->vile_marker); + func_80324E38(0.0f, 3); + timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_3B_MINIGAME_VICTORY, 28000); + timedFunc_set_0(3.0f, func_8038A044); + timedFunc_set_1(3.0f, func_80389E40, (s32) this->marker); + } + if (next_state == 0xA) { + func_8038C3B0(local->vile_marker); + func_80324E38(0.5f, 3); + timedFunc_set_2(1.0f, func_8025A6EC, COMUSIC_3B_MINIGAME_VICTORY, 28000); + timedFunc_set_1(3.0f, func_80389F08, (s32) this->marker); + } + if (next_state == 7) { + func_8038C384(local->vile_marker); + } + this->state = next_state; +} + +void chvilegame_player_consume_piece(Actor *this) { + ActorLocal_BGS_3420 *local; + bool is_correct_type; + f32 sp44[3]; + struct vilegame_piece *begin; + struct vilegame_piece *end; + struct vilegame_piece *i_ptr; + + local = (ActorLocal_BGS_3420 *)&this->local; + + begin = (struct vilegame_piece *)vector_getBegin(local->game_pieces); + end = (struct vilegame_piece *) vector_getEnd(local->game_pieces); + if ((end != begin) && func_80389810(sp44)){ + sp44[1] = 0.0f; + for(i_ptr = begin; i_ptr < end; i_ptr++){ + if ((ml_vec3f_distance(i_ptr->position, sp44) < 65.25) && chyumblie_is_edible(i_ptr->marker)) { + is_correct_type = ((local->current_type != YUMBLIE) && (i_ptr->type != YUMBLIE)) || (((local->current_type == YUMBLIE) && i_ptr->type == YUMBLIE)); + if (is_correct_type) { + local->player_score++; + if (local->player_score == 35) { + item_inc(ITEM_16_LIFE); + func_8025A6EC(COMUSIC_15_EXTRA_LIFE_COLLECTED, 0x7FF8); + } + timedFunc_set_1(0.0f, func_802FDCB8, 0x1A); + timedFunc_set_1(0.5f, func_802FDCB8, 0x1A); + timedFunc_set_1(1.0f, func_802FDCB8, 0x1A); + } + func_8028F6B8(0x17, (i_ptr->type != YUMBLIE) ? 0x3F7 : 0x3F6); + if (!is_correct_type) { + func_8028F66C(0x18); + } + func_8038B684(i_ptr->marker); + return; + } + } + } +} + +bool chvilegame_cpu_consume_piece(ActorMarker *marker, f32 position[3]) { + Actor *this; + ActorLocal_BGS_3420 *local; + struct vilegame_piece *begin; + struct vilegame_piece *end; + struct vilegame_piece *i_ptr; + + this = marker_getActor(marker); + local = (ActorLocal_BGS_3420 *)&this->local; + if (this->state != 5){ + return FALSE; + } + begin = vector_getBegin(local->game_pieces); + end = vector_getEnd(local->game_pieces); + for(i_ptr = begin; i_ptr < end; i_ptr++){ + if ((ml_vec3f_distance(i_ptr->position, position) < 50.0f) && func_8038B684(i_ptr->marker)) { + local->vile_score++; + timedFunc_set_1(0.0f, func_802FDCB8, 0x1B); + timedFunc_set_1(0.5f, func_802FDCB8, 0x1B); + timedFunc_set_1(1.0f, func_802FDCB8, 0x1B); + return TRUE; + } + } + return FALSE; +} + +BKModelBin *chvilegame_get_grumblie_model(ActorMarker *marker){ + Actor *this; + ActorLocal_BGS_3420 *local; + + + this = marker_getActor(marker); + local = (ActorLocal_BGS_3420 *)&this->local; + return local->grumblie_model_bin; +} + +s32 chvilegame_get_piece_count(ActorMarker *marker){ + Actor *this; + ActorLocal_BGS_3420 *local; + + + this = marker_getActor(marker); + local = (ActorLocal_BGS_3420 *)&this->local; + return vector_size(local->game_pieces); +} + +s32 func_8038A9E0(ActorMarker *marker){ + Actor *this; + ActorLocal_BGS_3420 *local; + + + this = marker_getActor(marker); + local = (ActorLocal_BGS_3420 *)&this->local; + return local->unkC; +} + +s32 chvilegame_get_score_difference(ActorMarker *marker){ + Actor *this; + ActorLocal_BGS_3420 *local; + + + this = marker_getActor(marker); + local = (ActorLocal_BGS_3420 *)&this->local; + return local->vile_score - local->player_score; +} + +bool chvilegame_find_closest_piece(ActorMarker *marker, f32 position[0], f32 yaw, f32 dst[3]) { + f32 piece_direction[3]; + f32 target_direction[3]; + Actor *this; + ActorLocal_BGS_3420 *local; + struct vilegame_piece *closest_piece; + struct vilegame_piece *begin; + struct vilegame_piece *end; + struct vilegame_piece *i_ptr; + f32 distance; + f32 angle_diff; + + this = marker_getActor(marker); + local = (ActorLocal_BGS_3420 *)&this->local; + target_direction[0] = 0.0f; + target_direction[1] = 0.0f; + target_direction[2] = 100.0f; + ml_vec3f_yaw_rotate_copy(target_direction, target_direction, yaw); + closest_piece = NULL; + begin = (struct vilegame_piece *) vector_getBegin(local->game_pieces); + end = (struct vilegame_piece *) vector_getEnd(local->game_pieces); + for(i_ptr = begin; i_ptr < end; i_ptr++){ + if( ((local->current_type != YUMBLIE) && (i_ptr->type != YUMBLIE)) + || ((local->current_type == YUMBLIE) && (i_ptr->type == YUMBLIE)) + ){ + piece_direction[0] = i_ptr->position[0] - position[0]; + piece_direction[1] = i_ptr->position[1] - position[1]; + piece_direction[2] = i_ptr->position[2] - position[2]; + distance = ml_vec3f_distance(i_ptr->position, position); + angle_diff = func_80256AB4(target_direction[0], target_direction[2], piece_direction[0], piece_direction[2]); + if( (distance > 300.0f) + || ((-0.8 < angle_diff) && (angle_diff < 0.8) && ((piece_direction[0]*target_direction[0] + piece_direction[1]*target_direction[1] + piece_direction[2]*target_direction[2]) >= 0.0f)) + ) { + if ((closest_piece == NULL) || (distance < ml_vec3f_distance(position, closest_piece->position))){ + closest_piece = i_ptr; + } + } + } + } + if (closest_piece != NULL) { + dst[0] = closest_piece->position[0]; + dst[1] = closest_piece->position[1]; + dst[2] = closest_piece->position[2]; + return TRUE; + } + return FALSE; +} + +void chvilegame_new_piece(ActorMarker *game_marker, ActorMarker *piece_marker, f32 position[3], enum chvilegame_piece_type_e yumblie_type){ + Actor *this; + ActorLocal_BGS_3420 *local; + struct vilegame_piece *temp_v0; + + this = marker_getActor(game_marker); + local = (ActorLocal_BGS_3420 *)&this->local; + temp_v0 = (struct vilegame_piece *)vector_pushBackNew(&local->game_pieces); + temp_v0->type = yumblie_type; + temp_v0->marker = piece_marker; + temp_v0->position[0] = position[0]; + temp_v0->position[1] = position[1]; + temp_v0->position[2] = position[2]; + temp_v0->position[1] = 0.0f; +} + +void chvilegame_free(Actor *this){ + ActorLocal_BGS_3420 *local; + + local = (ActorLocal_BGS_3420 *)&this->local; + func_8038A068(this, 0); + vector_free(local->game_pieces); + assetcache_release(local->grumblie_model_bin); +} + +void chvilegame_remove_piece(ActorMarker *game_marker, ActorMarker *piece_marker) { + Actor *this; + ActorLocal_BGS_3420 *local; + struct vilegame_piece *begin; + struct vilegame_piece *end; + struct vilegame_piece *i_ptr; + + this = marker_getActor(game_marker); + local = (ActorLocal_BGS_3420 *)&this->local; + begin = (struct vilegame_piece *)vector_getBegin(local->game_pieces); + end = (struct vilegame_piece *)vector_getEnd(local->game_pieces); + for(i_ptr = begin; i_ptr < end; i_ptr++){ + if (piece_marker == i_ptr->marker) { + vector_remove(local->game_pieces, i_ptr - begin); + return; + } + } +} + +void chvilegame_update(Actor *this) { + ActorLocal_BGS_3420 *local; + f32 sp50; + f32 sp4C; + u8 temp_v0; + s32 sp30[6]; + s32 sp2C; + + sp50 = time_getDelta(); + local = (ActorLocal_BGS_3420 *)&this->local; + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->marker->unk30 = &chvilegame_free; + local->game_pieces = vector_new(sizeof(struct vilegame_piece), 0x20); + local->grumblie_model_bin = assetcache_get(0x3F7); + local->unkC = 0; + local->vile_marker = NULL; + if (this->state == 0) { + local->unkD = 0; + } else { + this->state = 0; + } + if (jiggyscore_isSpawned(JIGGY_28_BGS_MR_VILE)) { + local->unkC = 3; + local->unkD = 3; + } + if (func_803203FC(2)) { + local->unkC = 2; + local->unkD = 3; + } + func_8038A068(this, 1); + return; + } + if (local->vile_marker == NULL) { + local->vile_marker = func_80326D68(this->position, 0x13A, -1, &sp4C)->marker; + } + if (this->state == 1) { + if (func_803203FC(2)) { + if (func_803203FC(3)) { + func_8038A068(this, 5); + } + } else if (func_8038C2A8(local->vile_marker)) { + func_8038A068(this, 2); + } + } + if (this->state == 5) { + if (local->unkC == 7) { + func_8024E55C(0, sp30); + if ((sp30[BUTTON_Z] > 0) && func_8038C2A8(local->vile_marker)) { + func_8038A068(this, 0xA); + } + } else { + chvilegame_player_consume_piece(this); + if ((local->unkC == 3) || (local->unkC == 6)) { + if (func_8025773C(&local->type_change_timer, sp50)) { + local->current_type = !local->current_type; + if (func_803203FC(2)) { + local->type_change_timer = 5.0f; + } else { + local->type_change_timer = 10.0f; + } + } + if (local->type_change_timer > 3.5) { + if (local->current_type != 0) { + func_803463D4(ITEM_1D_GRUMBLIE, FALSE); + } else { + func_803463D4(ITEM_1E_YUMBLIE, FALSE); + } + } + } + sp2C = item_getCount(ITEM_1A_PLAYER_VILE_SCORE); + item_set(ITEM_1A_PLAYER_VILE_SCORE, local->player_score); + item_set(ITEM_1B_VILE_VILE_SCORE, local->vile_score); + if ((sp2C != 0) && (local->player_score == 0)) { + func_802FA5D0(); + } + if (item_empty(ITEM_6_HOURGLASS)) { + if (func_803203FC(2)) { + func_803204E4(3, 0); + func_803204E4(5, ( local->vile_score < local->player_score) ? TRUE : FALSE); + func_8038A068(this, 1); + } else if (local->vile_score < local->player_score) { + if (local->unkC == 3) { + func_8038A068(this, 9); + } else { + func_8038A068(this, 8); + } + } else { + func_8038A068(this, 6); + } + } + } + } + if ((this->state == 7) && (func_8038C338(local->vile_marker) != 0)) { + func_8038A068(this, 1); + } +} diff --git a/src/BGS/code_9750.c b/src/BGS/code_9750.c new file mode 100644 index 00000000..e50bd3df --- /dev/null +++ b/src/BGS/code_9750.c @@ -0,0 +1,94 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_80324E88(f32); +void timedFunc_set_2(f32, void(*)(s32, s32), s32, s32); +void func_8028E668(f32[3], f32, f32, f32); + +void func_8038FBF8(Actor *); + + +ActorAnimationInfo D_80390C70[3] = { + {0, 0.0f}, + {0x103, 8000000.0f}, + {0x103, 0.75f} +}; + +ActorInfo D_80390C88 = {0x6D, 0xE9, 0x3EF, 0x01, D_80390C70, + func_8038FBF8, func_80326224, func_80325888, + 0, 0x166, 0.0f, 0 +}; +u8 pad_80390CCC[4] = {0}; + +ActorAnimationInfo D_80390CB0[3] = { + {0, 0.0f}, + {0x104, 8000000.0f}, + {0x104, 0.75f} +}; + +ActorInfo D_80390CC8 = {0x6D, 0xEA, 0x3F0, 0x01, D_80390CB0, + func_8038FBF8, func_80326224, func_80325888, + 0, 0x166, 0.0f, 0 +}; +u8 pad_80390CEC[4] = {0}; + +ActorAnimationInfo D_80390CF0[3] = { + {0, 0.0f}, + {0x105, 8000000.0f}, + {0x105, 0.75f} +}; + +ActorInfo D_80390D08 = {0x6D, 0xEB, 0x3F1, 0x01, D_80390CF0, + func_8038FBF8, func_80326224, func_80325888, + 0, 0x166, 0.0f, 0 +}; +u8 pad_80390C2C[4] = {0}; + +ActorAnimationInfo D_80390C30[3] = { + {0, 0.0f}, + {0x106, 8000000.0f}, + {0x106, 0.75f} +}; + +ActorInfo D_80390D48 = {0x6D, 0xEC, 0x3F2, 0x01, D_80390C30, + func_8038FBF8, func_80326224, func_80325888, + 0, 0x166, 0.0f, 0 +}; + +/* .code */ +void func_8038FB40(ActorMarker *this, s32 arg1){ + Actor * thisActor; + + thisActor = marker_getActor(this); + func_80328A84(thisActor, 2); + actor_playAnimationOnce(thisActor); + FUNC_8030E624(SFX_A_BANJO_LANDING_05, 0.8f, 32750); +} + +void func_8038FB84(ActorMarker *this, ActorMarker *other_marker){ + Actor *thisActor; + + thisActor = marker_getActor(this); + FUNC_8030E8B4( SFX_87_TANKTUP_OOOHW, 1.0f, 32750, thisActor->position, 1000, 3000); + timedFunc_set_2(0.65f, (TFQM2) func_8038FB40, (s32) this, (s32) other_marker); + func_8038F51C(thisActor); + this->collidable = 0; +} + +void func_8038FBF8(Actor *this){ + if(!this->initialized){ + this->initialized = 1; + this->marker->propPtr->unk8_3 = 1; + marker_setCollisionScripts(this->marker, NULL, NULL, func_8038FB84); + } + if(this->state == 2){ + if(animctrl_isAt(this->animctrl, 0.65f)){ + func_8030E540(SFX_7C_CHEBOOF); + } + if(animctrl_isStopped(this->animctrl)){ + marker_despawn(this->marker); + } + } +} diff --git a/src/BGS/done/ch/bigalligator.c b/src/BGS/done/ch/bigalligator.c new file mode 100644 index 00000000..04540ddf --- /dev/null +++ b/src/BGS/done/ch/bigalligator.c @@ -0,0 +1,24 @@ +#include +#include "functions.h" +#include "variables.h" + + + + + +void func_8038FCB0(Actor *); + +/* .data */ +ActorInfo D_80390D70 = {0xDC, actor_bigalligator, 0x397, 0x01, NULL, + func_8038FCB0, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_8038FCB0(Actor *this){ + if(this->initialized) + return; + this->marker->propPtr->unk8_3 = 1; + actor_collisionOff(this); + this->initialized = 1; +} diff --git a/src/BGS/done/ch/code_2270.c b/src/BGS/done/ch/code_2270.c new file mode 100644 index 00000000..0b06cc3b --- /dev/null +++ b/src/BGS/done/ch/code_2270.c @@ -0,0 +1,347 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80324E88(f32); +void func_803888E4(Actor *this, s32 arg1); + +typedef struct{ + u32 unk0; +}Struct_BGS_2270_0s; + +typedef struct ch_bgs_2270_s{ + u32 unk0; + vector(Struct_BGS_2270_0s) *unk4; + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; + f32 unkC; +} ActorLocal_BGS_2270; + +void func_80389080(Actor *this); +Actor *func_80325888(ActorMarker *, Gfx **, Mtx **, Vtx **); + +ActorInfo D_80390830 = { + 0x19A, 0x27A, 0x3F8, + 0, NULL, + func_80389080, NULL, func_80325888, + 0, 0, 2.5f, 0 +}; +s16 D_80390854[] = {0, 0xC78, 0xC7A, 0xC7C}; //see again texts +s16 D_8039085C[] = {0, 0xC77, 0xC79, 0xC7B}; //success texts +u8 D_80390864[] = {3, 3, 5, 7}; //chchoirgame_sequence_length +f32 D_80390868[3] = {0.0f, 100.0f, -1020.0f}; //chchoirgame_jiggy_position + +void func_80388660(ActorMarker *this){ + func_803888E4(marker_getActor(this), 6); +} + +void func_8038868C(void){ + jiggySpawn(JIGGY_27_BGS_TIPTUP, D_80390868); +} + +void func_803886B4(ActorMarker *this, s32 arg1){ + Actor *thisActor; + ActorLocal_BGS_2270 *actLocalPtr; + Struct_BGS_2270_0s *tmpPtr; + + thisActor = marker_getActor(this); + actLocalPtr = (ActorLocal_BGS_2270 *)&thisActor->local; + actLocalPtr->unkB = arg1; + if(arg1){ + tmpPtr = vector_pushBackNew(&actLocalPtr->unk4); + tmpPtr->unk0 = arg1; + } +} + +void func_803886F4(ActorMarker *this){ + Actor *thisActor; + + thisActor = marker_getActor(this); + item_set(ITEM_6_HOURGLASS, 1); + item_set(ITEM_0_HOURGLASS_TIMER, 30*60-1); + func_803888E4(thisActor, 5); +} + +void func_8038873C(void){ + func_8025A6EC(COMUSIC_2B_DING_B, 28000); +} + +void func_80388760(void){ + func_8025A6EC(COMUSIC_2C_BUZZER, 28000); +} + +void func_80388784(ActorMarker *this, s32 arg1, s32 arg2){ + Actor *thisActor; + + thisActor = marker_getActor(this); + switch(arg1){ + case 0xc72: + case 0xc74: + func_803888E4(thisActor, 3); + break; + case 0xc78: + case 0xc7a: + case 0xc7c: + func_803888E4(thisActor, 4); + break; + case 0xc77: + case 0xc79: + func_80324E38(0.0f, 0); + func_803888E4(thisActor, 3); + break; + case 0xc7b: + timedFunc_set_0(0.0f, func_8038868C); + func_80324E88(2.5f); + func_80324E38(2.5f, 0); + break; + } +} + +void func_80388848(ActorMarker *this){ + Actor *thisActor; + ActorLocal_BGS_2270 *unqPtr; + s32 sp1C; + + thisActor = marker_getActor(this); + unqPtr = (ActorLocal_BGS_2270 *)&thisActor->local; + sp1C = vector_size(unqPtr->unk4); + func_8038873C(); + if(sp1C != ++unqPtr->unk0) + return; + + if(func_803203FC(2)){ + item_set(ITEM_6_HOURGLASS,0); + func_803204E4(3,0); + func_803204E4(5,1); + } + else{ + func_80388660(thisActor->marker); + } +} + +void func_803888E4(Actor *this, s32 arg1){ + ActorLocal_BGS_2270 *unqPtr; + f32 sp54; + + f32 tmpf; + s32 i; + s32 j; + s32 prev_member; + s32 rand2; + Struct_BGS_2270_0s *s1; + + unqPtr = (ActorLocal_BGS_2270 *)&this->local; + this->state = arg1; + unqPtr->unkC = 0.0f; + if(this->state == 1){ + func_80335924(this->unk148, ASSET_12B_ANIM_TIPTUP_IDLE, 1.0f, 9.0f); + unqPtr->unkC = randf2(5.0f, 15.0f); + } + if(this->state == 2){ + func_80335924(this->unk148, ASSET_12B_ANIM_TIPTUP_IDLE, 1.0f, 9.0f); + unqPtr->unkC = randf2(5.0f, 15.0f); + if(!this->unk138_24){ + this->unk138_24 = 1; + if(unqPtr->unkA == 0){ + func_80311480(0xc72, 0xe, this->position, this->marker, func_80388784, 0); + }else{ + func_80311480(0xc74, 0xf, this->position, this->marker, func_80388784, 0); + + } + } + else{ + func_80311480(D_80390854[unqPtr->unkA], 0xf, this->position, this->marker, func_80388784, 0); + } + } + if(this->state == 3){ + unqPtr->unk0 = 0; + vector_clear(unqPtr->unk4); + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.5f, 0); + tmpf = 0.5f; + i = 0; + prev_member = 0; + + for(; i < D_80390864[unqPtr->unkA]; i++){ + tmpf += randf2(1.0f, 1.5f); + while((rand2 = randi2(1,7)) == prev_member); + timedFunc_set_2(tmpf, func_803886B4, this->marker, rand2); + timedFunc_set_2(tmpf + 0.1, func_803886B4, this->marker, 0); + prev_member = rand2; + }//L80388B7C + + func_80324E88(tmpf += 2.5); + if(!unqPtr->unkA && !func_803203FC(2)){ + func_80324DBC(tmpf + 0.5, 0xc73, 0xe, this->position, this->marker, func_80388784, 0); + unqPtr->unkA = 1; + } + func_80324E38(sp54 = tmpf + 0.6, 0); + if(func_803203FC(2)){ + timedFunc_set_1(sp54, func_803886F4, this->marker); + }else{ + this->state = 0x05; + } + mapSpecificFlags_set(0, 0); + }//L80388C6C + if(this->state == 4){ + + unqPtr->unk0 = 0; + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.5f, 0); + tmpf = 0.5f; + for(j = 0; j < vector_size(unqPtr->unk4); j++){ + s1 = (Struct_BGS_2270_0s *)vector_at(unqPtr->unk4,j); + tmpf += randf2(1.0f, 1.5f); + timedFunc_set_2(tmpf, func_803886B4, this->marker, s1->unk0); + timedFunc_set_2(tmpf + 0.1, func_803886B4, this->marker, 0); + } + func_80324E88(tmpf += 2.5); + func_80324E38(tmpf + 0.6,0); + vector_clear(unqPtr->unk4); + this->state = 0x05; + }//L80388D8C + if(this->state == 6){ + if(unqPtr->unkA == 3){ + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + } + func_80324E38(0.5f, 3); + timed_setCameraToNode(1.5f, 1); + func_80324DBC(2.0f, D_8039085C[unqPtr->unkA++], 0xF, this->position, this->marker, func_80388784, 0); + } +} + +void func_80388E44(ActorMarker *arg0, ActorMarker *arg1){ + func_8028F428(2,arg0); +} + +s32 func_80388E70(ActorMarker *this){ + Actor *ptr; + ActorLocal_BGS_2270 *local; + + ptr = marker_getActor(this); + local = (ActorLocal_BGS_2270 *)&ptr->local; + return local->unkB; +} + +void func_80388E94(ActorMarker *this, s32 arg1){ + Actor * thisActor; + ActorLocal_BGS_2270 *unqPtr; + Struct_BGS_2270_0s * tmp; + + thisActor = marker_getActor(this); + unqPtr = (ActorLocal_BGS_2270 *)&thisActor->local; + if((s32)unqPtr->unk0 >= (s32) vector_size(unqPtr->unk4)){ + if(!mapSpecificFlags_get(0) && func_80311480(0xc76, 0, 0, 0, 0, 0)) + mapSpecificFlags_set(0,1); + }else{ + tmp = (Struct_BGS_2270_0s *)vector_at(unqPtr->unk4, unqPtr->unk0); + if(arg1 == tmp->unk0){ + timedFunc_set_1(0.5f, func_80388848, thisActor->marker); + } + else{ + func_8028F55C(1, thisActor->marker); + timedFunc_set_0(0.5f, func_80388760); + if(!mapSpecificFlags_get(1) && !func_803203FC(2) && func_80311480(0xc75, 0, NULL, NULL, NULL, NULL)) + mapSpecificFlags_set(1,TRUE); + } + } +} + +void func_80388FC0(Actor *this){ + ActorLocal_BGS_2270 *local; + + local = (ActorLocal_BGS_2270 *)&this->local; + func_80320044(0, local->unkA, 2); + vector_free(local->unk4); +} + +void func_80388FFC(ActorMarker *this, s32 *arg1, f32* arg2){ + Actor *thisActor; + ActorLocal_BGS_2270 *localPtr; + + thisActor = marker_getActor(this); + localPtr = (ActorLocal_BGS_2270 *)&thisActor->local; + + *arg2 = 0.52 + (f64)localPtr->unk9 * 0.12; + localPtr->unk9++; + *arg1 = localPtr->unk9; + +} + +void func_80389080(Actor *this){ + f32 sp44[3]; + ActorLocal_BGS_2270 *unqPtr; + f32 sp3C; + f32 sp38; + f32 sp34; + f32 sp30; + + unqPtr = (ActorLocal_BGS_2270 *)&this->local; + sp3C = time_getDelta(); + if(!this->unk16C_4){ + this->unk16C_4 = 1; + this->marker->unk30 = func_80388FC0; + marker_setCollisionScripts(this->marker, func_80388E44, NULL, NULL); + + unqPtr->unk0 = 0; + unqPtr->unk4 = vector_new(sizeof(Struct_BGS_2270_0s), 8); + unqPtr->unk8 = 0; + unqPtr->unk9 = 0; + unqPtr->unkA = func_8031FF44(0,2); + unqPtr->unkB = 0; + unqPtr->unkC = 0.0f; + if(func_803203FC(2)){ + unqPtr->unkA = 3; + this->position_y = this->position_y - 300.0f; + } + func_803888E4(this, 1); + if(jiggyscore_isSpawned(JIGGY_27_BGS_TIPTUP) && !func_803203FC(2) && !func_803203FC(1)) + marker_despawn(this->marker); + } + else{ + player_getPosition(&sp44); + if(func_8033567C(this->unk148) == ASSET_12C_ANIM_TIPTUP_TAPPING && func_80335794(this->unk148) > 0){ + func_80335924(this->unk148, ASSET_12B_ANIM_TIPTUP_IDLE, 1.0f, 9.0f); + unqPtr->unkC = randf2(5.0f, 15.0f); + } + if(func_8025773C(&unqPtr->unkC, sp3C)){ + func_80335924(this->unk148, ASSET_12C_ANIM_TIPTUP_TAPPING, 1.0f, 4.0f); + } + func_80258A4C(this->position, this->yaw - 90.0f, &sp44, &sp38, &sp34, &sp30); + this->yaw = this->yaw + 5.0f*sp30; + if(this->state == 1){ + if(func_803203FC(2)){ + if(func_803203FC(3)){ + func_80324E38(0.0f,0); + func_803888E4(this, 3); + } + } + else{ + if(ml_vec3f_distance(this->position, &sp44) < 300.0f && player_getTransformation() == TRANSFORM_1_BANJO && !jiggyscore_isSpawned(JIGGY_27_BGS_TIPTUP)){ + func_803888E4(this, 2); + } + } + } + if(this->state == 5){ + if(func_803203FC(2)){ + if(item_empty(ITEM_0_HOURGLASS_TIMER)){ + item_set(ITEM_6_HOURGLASS,1); + func_803204E4(3,0); + func_803204E4(5,0); + } + } //L80389370 + else{ + if(ml_vec3f_distance(this->position, &sp44) >= 300.0f) + func_803888E4(this, 1); + } + }//L803893A0 + if(this->state == 6){ + if(ml_vec3f_distance(this->position, &sp44) < 300.0f && !unqPtr->unk8){ + unqPtr->unk8 = 1; + func_80311480(0xc7d, 4, 0, 0, 0, 0); + } + } + } +} diff --git a/src/BGS/done/ch/code_6730.c b/src/BGS/done/ch/code_6730.c new file mode 100644 index 00000000..a3900438 --- /dev/null +++ b/src/BGS/done/ch/code_6730.c @@ -0,0 +1,203 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_8038CEE8(Actor *); +void func_8038CC08(Actor * arg0, u32 arg1); +void func_8025A58C(u32, u32); +void func_80324E88(f32); + + +ActorInfo D_80390AB0 = {0xC4, ACTOR_136_YELLOW_FLIBBIT_CONTROLLER, 0x00, 0x00, NULL, + func_8038CEE8, NULL, func_80325340, + 0, 0, 0.0f, 0 +}; + +f32 D_80390AD4[3] = {1985.0f, 200.0f, -1386.0f}; + +/* .bss */ +u8 D_80391240[4]; + +/* .code */ +void func_8038CB20(void){ + jiggySpawn(JIGGY_24_BGS_FLIBBITS, D_80390AD4); +} + +void func_8038CB48(ActorMarker *arg0, u32 arg1, u32 arg2){ + Actor *actPtr = marker_getActor(arg0); + mapSpecificFlags_set(0x10, 0); + if(actPtr->state == 4){ + func_8038CC08(actPtr,5); + } + else{ + func_8038CC08(actPtr,3); + } +} + +void func_8038CBB4(Actor * arg0){ + if(!arg0->bgs_6730.unk4) + return; + func_8025A58C(-1, 400); + comusic_8025AB44(MUSIC_BGS_FLIBBIT_FIGHT,0, 400); + func_8025AABC(MUSIC_BGS_FLIBBIT_FIGHT); + + arg0->bgs_6730.unk4 = 0; +} + +void func_8038CC08(Actor * arg0, u32 arg1){ + ActorLocal_BGS_6730 *s0; + + s0 = &arg0->bgs_6730; + if(arg1 == 2){ + func_8028F8F8(0x12, 1); + func_8028F8F8(0x1F, 0); + mapSpecificFlags_set(0x10, 1); + if(!func_8031FF1C(0x1B)){ + func_80320004(0x1B, 1); + func_80311480(text_flibbits_meet, 0xf, arg0->position, arg0->marker, func_8038CB48, 0); + }else{ + if(!arg0->bgs_6730.unk8){ + func_80311480(text_flibbits_return, 0x4, arg0->position, arg0->marker, func_8038CB48, 0); + } + else{ + func_8038CB48(arg0->marker, text_flibbits_return, 0); + return; + } + } + } + if(arg1 == 3){ + s0->unk0 = 1; + if(!s0->unk4){ + func_8025A58C(0, 400); + func_8025A6EC(MUSIC_BGS_FLIBBIT_FIGHT, 30000); + s0->unk4 = 1; + } + else{ + comusic_8025AB44(MUSIC_BGS_FLIBBIT_FIGHT, 30000, 400); + } + } + + if(arg0->state == 3){ + func_8028F8F8(0x12, 0); + func_8028F8F8(0x1F, 1); + if(arg1 == 1){ + if(s0->unk4){ + comusic_8025AB44(MUSIC_BGS_FLIBBIT_FIGHT, 18000, 100); + } + } + else{ + func_8038CBB4(arg0); + } + } + + if(arg1 == 4){ + func_80311480(text_flibbits_defeat, 0xf, arg0->position, arg0->marker, func_8038CB48, 0); + } + if(arg1 == 5){ + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.0f, 0x27); + timedFunc_set_0(0.2f, func_8038CB20); + func_80324E88(3.0f); + func_80324E38(3.0f, 0); + arg1 = 6; + } + if(arg1 == 6){ + func_8028F8F8(0x12, 0); + func_8028F8F8(0x1F, 1); + } + arg0->state = arg1; +} + +void func_8038CE88(void){ + D_80391240[0]++; +} + +void func_8038CEA0(void){ + D_80391240[1]++; +} + +void func_8038CEB8(void){ + D_80391240[2]++; +} + +void func_8038CED0(void){ + D_80391240[3]++; +} + +void func_8038CEE8(Actor *this){ + f32 sp34[3]; + u32 sp28; + ActorLocal_BGS_6730 *bgs6730; + + bgs6730 = &this->bgs_6730; + if(!this->unk16C_4){ + this->unk16C_4 = 1; + bgs6730->unk0 = 0; + bgs6730->unk4 = 0; + bgs6730->unk8 = 0; + bgs6730->unkC = 0; + D_80391240[0] = 0; + D_80391240[1] = 0; + D_80391240[2] = 0; + D_80391240[3] = 0; + mapSpecificFlags_set(0x12, 0); + mapSpecificFlags_set(0x10, 0); + if(jiggyscore_isSpawned(JIGGY_24_BGS_FLIBBITS)){ + func_8038CC08(this,6); + return; + }else{ + func_8038CC08(this,1); + return; + } + } + if(D_80391240[0]>0){ + bgs6730->unk8 += D_80391240[0]; + bgs6730->unkC -= D_80391240[0]; + D_80391240[0] = 0; + } + if(D_80391240[1]>0){ + bgs6730->unk8 -= D_80391240[1]; + D_80391240[1] = 0; + } + if(D_80391240[2]>0){ + bgs6730->unk8 -= D_80391240[2]; + bgs6730->unkC += D_80391240[2]; + D_80391240[2] = 0; + } + if(D_80391240[3]>0){ + bgs6730->unkC += D_80391240[3]; + D_80391240[3] = 0; + } + player_getPosition(&sp34); + sp28 = (sp34[1] < 500.0f) && (func_80329210(this,sp34) != 0); + if(this->state == 1){ + if(sp28 && ((bgs6730->unk8 > 0) || (bgs6730->unkC > 0)) && !func_8028FB48(0xe000)){ + func_8038CC08(this,2); + } + else{ + //L8038D0E0 + if(bgs6730->unk4 && !bgs6730->unk8){ + func_8038CBB4(this); + } + } + } + if(this->state == 3){ + if(!sp28){ + func_8038CC08(this, 1); + }else{ + if(bgs6730->unk8 < 2 && bgs6730->unkC > 0){ + mapSpecificFlags_set(0x12, 1); + } + } + } + if(this->state == 1 || this->state == 3){ + if( (bgs6730->unk0) + && !jiggyscore_isSpawned(JIGGY_24_BGS_FLIBBITS) + && !bgs6730->unk8 + && !bgs6730->unkC + ){ + func_8038CC08(this, 4); + } + } +} diff --git a/src/BGS/done/ch/code_8A60.c b/src/BGS/done/ch/code_8A60.c new file mode 100644 index 00000000..f598462b --- /dev/null +++ b/src/BGS/done/ch/code_8A60.c @@ -0,0 +1,100 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void timedFunc_set_0(f32, void (*)(void)); + +void func_8038EEA4(Actor *this); +void func_8038F06C(Actor *this); + +ActorAnimationInfo D_80390B90[] = { + {0x00, 0.0f}, + {0x00, 0.0f}, + {0xD4, 0.15f}, + {0xD5, 0.5f}, + {0x00, 0.0f}, + {0x00, 0.0f}, + {0xD4, 0.15f}, + {0xD5, 0.5f}, + {0xD5, 1e+8f} +}; +ActorInfo D_80390BD8 = {0xF5, 0x14E, 0x3F5, 1, D_80390B90, func_8038EEA4, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +ActorInfo D_80390BFC = {0xFD, 0x1FB, 0x3F5, 1, D_80390B90, func_8038F06C, func_80326224, func_80325888, 0, 0, 0.0f, 0}; + +void func_8038EE50(void){ + f32 sp24[3]; + + if(func_80304E24(0x14d, sp24)){ + jiggySpawn(JIGGY_20_BGS_ELEVATED_WALKWAY, sp24); + func_802C3F04(func_802C4140, 0x4C, *((u32 *) &sp24[0]), *((u32 *) &sp24[1]), *((u32 *) &sp24[2])); + } +} + +void func_8038EEA4(Actor *this){ + func_8038EA90(); + if(mapSpecificFlags_get(7)){ + mapSpecificFlags_set(7, 0); + if(!mapSpecificFlags_get(3) || (item_getCount(0) > 0)){ + func_802D68F0(0x2D); + } + } + if(!mapSpecificFlags_get(5)){ + func_802D4928(this, 1, 6, 7); + } + if(mapSpecificFlags_get(2)){ + this->velocity_x = 0.0f; + mapSpecificFlags_set(3,0); + mapSpecificFlags_set(4,0); + mapSpecificFlags_set(1,0); + mapSpecificFlags_set(2,0); + } + if( this->velocity_x == 0.0f && mapSpecificFlags_get(1)){ + this->velocity_x = 1.0f; + func_802BAFE4(0xc); + timedFunc_set_0(1.2f, func_8038EE50); + } //L8038EFB4 + if( this->velocity_x != 0.0f && !mapSpecificFlags_get(3) && func_802BB270()){ + mapSpecificFlags_set(3,1); + func_802D68F0(0x2D); + item_set(ITEM_6_HOURGLASS,1); + } //L8038EFB4 +} + +void func_8038F018(void){ + f32 sp24[3]; + + if(func_80304E24(0x1fc, sp24)){ + jiggySpawn(JIGGY_25_BGS_MAZE, sp24); + func_802C3F04(func_802C4140, 0x4C, *((u32 *) &sp24[0]), *((u32 *) &sp24[1]), *((u32 *) &sp24[2])); + } +} + +void func_8038F06C(Actor *this){ + func_8038EA90(); + if(mapSpecificFlags_get(8)){ + mapSpecificFlags_set(8, 0); + if(!mapSpecificFlags_get(0xC) || (item_getCount(0) > 0)){ + func_802D68F0(0xA); + } + } + if(!mapSpecificFlags_get(9)){ + func_802D4928(this, 0xA, 6, 7); + } + if(mapSpecificFlags_get(0xB)){ + this->velocity_x = 0.0f; + mapSpecificFlags_set(0xC,0); + mapSpecificFlags_set(0xD,0); + mapSpecificFlags_set(0xA,0); + mapSpecificFlags_set(0xB,0); + } + if( this->velocity_x == 0.0f && mapSpecificFlags_get(0xA)){ + this->velocity_x = 1.0f; + func_802BAFE4(0x1D); + timedFunc_set_0(1.2f, func_8038F018); + } //L8038EFB4 + if( this->velocity_x != 0.0f && !mapSpecificFlags_get(0xC) && func_802BB270()){ + mapSpecificFlags_set(0xC,1); + func_802D68F0(0xA); + item_set(ITEM_6_HOURGLASS,1); + } //L8038EFB4 +} diff --git a/src/BGS/done/ch/mudhut.c b/src/BGS/done/ch/mudhut.c new file mode 100644 index 00000000..e8f47787 --- /dev/null +++ b/src/BGS/done/ch/mudhut.c @@ -0,0 +1,125 @@ +#include +#include "functions.h" +#include "variables.h" + +/* TODO move declarations to respective headers*/ +void func_8028F710(s32, f32); + +void func_802C4218(u32,f32,f32,f32); +void func_80328A84(Actor *, u32); + +/* local declarations */ +Actor *func_8038EAD0(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3); +void func_8038EB4C(ActorMarker *); +void func_8038EB8C(Actor *this); + +/* .data section */ +ActorAnimationInfo D_80390B30[4] = { + {0, 0.0f}, + {0, 0.0f}, + {anim_mudhut_smashing, 0.25f}, + {anim_mudhut_smashing, 1000000.0f} +}; + +u32 D_80390B50[6] = {0xA, 0xA, 0xB, 0xA, 0xA, 0xC}; + +ActorInfo D_80390B68 = {0xD5, ACTOR_C_MUD_HUT, ASSET_7D8_MODEL_MM_HUT_TOP, 0x01, D_80390B30, + func_8038EB8C, func_80326224, func_8038EAD0, + 0, 0, 0.0f, 0 +}; + +/* .code section */ +void func_8038EA30(void){ + if((getGameMode() != GAME_MODE_7_ATTRACT_DEMO) && (1.5 < func_8028E80C(2)) ){ + func_8028F710(2, 1.5); + } +} + +void func_8038EA90(void){ + u32 sp1C; + osPiReadIo(0xD10, &sp1C); + if(sp1C = (u16)(sp1C-0x400)){ + func_8038EA30(); + } +} + +Actor *func_8038EAD0(ActorMarker *this, Gfx** gdl, Mtx** mtx, u32 arg3){ + Actor *thisActor; + + thisActor = marker_getActor(this); + func_8033A45C(1, thisActor->state == 1); + if(thisActor->state == 3) + return thisActor; + + return func_80325888(this, gdl, mtx, arg3); +} + +void func_8038EB4C(ActorMarker *this){ + Actor *thisActor; + + thisActor = marker_getActor(this); + thisActor = func_8032813C(ACTOR_D_WOOD_DEMOLISHED, thisActor->position, NULL); + thisActor = func_8032813C(ACTOR_4D_STEAM_2, thisActor->position, NULL); + if(this); +} + +void func_8038EB8C(Actor *this){ + + f32 diffPos[3]; + f32 plyrPos[3]; + s32 tmp; + + if(func_80334904() == 2){ + if(!this->initialized){ + this->marker->collidable = 0; + this->initialized = 1; + } + + switch(this->state){ + case 1: + this->marker->propPtr->unk8_3 = 1; + player_getPosition(&plyrPos); + diffPos[0] = plyrPos[0] - this->position_x; + diffPos[1] = plyrPos[1] - this->position_y; + diffPos[2] = plyrPos[2] - this->position_z; + if( (150.0f < diffPos[1]) + && (player_getActiveHitbox(this->marker) == HITBOX_1_BEAK_BUSTER) + && (func_8028F20C()) + && (gu_sqrtf(diffPos[0]*diffPos[0] + diffPos[1]*diffPos[1] + diffPos[2]*diffPos[2]) < 350.f) + ){ + tmp = (s32)( (this->position_y - 600.f)/430.0f); + diffPos[0] = this->position_x; + diffPos[1] = this->position_y; + diffPos[2] = this->position_z; + diffPos[1] += 130.0; + + FUNC_8030E8B4(SFX_5B_HEAVY_STUFF_FALLING, 1.0f, 28000, this->position, 0x12C, 0xBB8); + func_80328A84(this, 2); + this->marker->propPtr->unk8_3 = 0; + actor_playAnimationOnce(this); + if(tmp == 5){ + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + } + func_802C3C88(func_8038EB4C, this->marker); + if(tmp < 5){ + func_802C3F04(func_802C4218,D_80390B50[tmp], ((u32 *)diffPos)[0], ((u32 *)diffPos)[1], ((u32 *)diffPos)[2]); + } else { + jiggySpawn(JIGGY_23_BGS_HUTS, diffPos); + } + } + break; + case 2: + this->marker->propPtr->unk8_3 = 0; + if(0.99 < animctrl_getAnimTimer(this->animctrl)){ + this->state = 3; + } + break; + case 3: + this->marker->propPtr->unk8_3 = 0; + break; + } + } + else{ + + } +} diff --git a/src/BGS/done/ch/pinkegg.c b/src/BGS/done/ch/pinkegg.c new file mode 100644 index 00000000..fd5c6752 --- /dev/null +++ b/src/BGS/done/ch/pinkegg.c @@ -0,0 +1,119 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct chpinkegg_s{ + u32 unk0; + u32 unk4; +} ActorLocal_PinkEgg; + +void chpinkegg_draw(ActorMarker *this, Gfx ** gdl, Mtx** mptr, u32 arg3); +void chpinkegg_collision(ActorMarker *this, ActorMarker *other_marker); +void chpinkegg_update(Actor *this); + +u32 D_803906C0 = 0x5B; +enum actor_e D_803906C4[5] = {0xED, 0xEE, 0xEF, 0xF0, 0x00}; +ActorAnimationInfo D_803906D8[4] = { + {0, 0.0f}, + {0, 0.0f}, + {0, 0.0f}, + {0x10B, 2.0f} +}; + +ActorInfo D_803906F8 = {0x6E, 0x5B, 0x380, 0x01, D_803906D8, + chpinkegg_update, func_80326224, chpinkegg_draw, + 0, 0x2CC, 6.0f, 0 +}; + +ActorInfo D_8039071C = {0xD6, 0xED, 0x381, 0x01, D_803906D8, + chpinkegg_update, func_80326224, chpinkegg_draw, + 0, 0x2CC, 5.0f, 0 +}; + +ActorInfo D_80390740 = {0xD7, 0xEE, 0x382, 0x01, D_803906D8, + chpinkegg_update, func_80326224, chpinkegg_draw, + 0, 0x2CC, 4.0f, 0 +}; + +ActorInfo D_80390764 = {0xD8, 0xEF, 0x383, 0x01, D_803906D8, + chpinkegg_update, func_80326224, chpinkegg_draw, + 0, 0x2CC, 3.0f, 0 +}; + +ActorInfo D_80390788 = {0xD9, 0xF0, 0x384, 0x01, D_803906D8, + chpinkegg_update, func_80326224, chpinkegg_draw, + 0, 0x2CC, 2.0f, 0 +}; + +/* .code */ +void chpinkegg_spawn_next(ActorMarker * arg0, u32 arg1){ + ActorLocal_PinkEgg *local; + Actor *actorPtr; + Actor *unkActor; + actorPtr = marker_getActor(arg0); + local = (ActorLocal_PinkEgg *)&actorPtr->local; + unkActor = spawn_child_actor( D_803906C4[arg1], &actorPtr); + + ((ActorLocal_PinkEgg *) &unkActor->local)->unk0 = arg1 + 1; + ((ActorLocal_PinkEgg *) &unkActor->local)->unk4 = 5; + unkActor->marker->collidable = 0; + +} + +void chpinkegg_draw(ActorMarker *this, Gfx ** gdl, Mtx** mptr, u32 arg3){ + u32 sp18; + u32 t7; + + t7 = marker_getActor(this)->state == 3; + func_8033A45C(1, (sp18 = t7) ^ 1); + func_8033A45C(2, sp18); + func_80325888(this, gdl, mptr, arg3); +} + + +void chpinkegg_collision(ActorMarker *this, ActorMarker *other_marker){ + Actor *thisActor; + ActorLocal_PinkEgg *tmp; + + thisActor = marker_getActor(this); + this->propPtr->unk8_3 = 0; + func_8030E510(SFX_AA_BGS_EGG_BREAKING_1, 28000); + func_80328A84(thisActor, 3); + actor_playAnimationOnce(thisActor); + this->collidable = 0; + thisActor->unk124_6 = 0; + if(D_803906C4[(tmp = (ActorLocal_PinkEgg *) &thisActor->local)->unk0] != 0){ + func_802C3D3C(chpinkegg_spawn_next, thisActor->marker, tmp->unk0); + } else { + jiggySpawn(JIGGY_21_BGS_PINKEGG, thisActor->position); + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + } +} + +void chpinkegg_update(Actor *this){ + if(!this->initialized){ + this->marker->propPtr->unk8_3 = 1; + marker_setCollisionScripts(this->marker, NULL, NULL, chpinkegg_collision); + this->initialized = 1; + } + + switch(this->state){ + case 1: + if(!((ActorLocal_PinkEgg *) &this->local)->unk4){ + this->marker->collidable = 1; + func_80328A84(this,2); + + }else{ + ((ActorLocal_PinkEgg *) &this->local)->unk4--; + } + break; + case 3: + if(animctrl_isStopped(this->animctrl)){ + func_80326310(this); + if(this->alpha_124_19 < 0x60){ + this->unk124_9 = 0x2; + } + } + break; + } +} diff --git a/src/BGS/done/code_8DF0.c b/src/BGS/done/code_8DF0.c new file mode 100644 index 00000000..e448f2c8 --- /dev/null +++ b/src/BGS/done/code_8DF0.c @@ -0,0 +1,68 @@ +#include +#include "functions.h" +#include "variables.h" +#include "prop.h" + +extern ActorInfo D_80390804; +extern ActorInfo D_80390690; +extern ActorInfo D_803906F8; +extern ActorInfo D_8039071C; +extern ActorInfo D_80390740; +extern ActorInfo D_80390764; +extern ActorInfo D_80390788; +extern ActorInfo D_80390B68; +extern ActorInfo D_80390C40; +extern ActorInfo D_80390C88; +extern ActorInfo D_80390CC8; +extern ActorInfo D_80390D08; +extern ActorInfo D_80390D48; +extern ActorInfo D_80390AB0; +extern ActorInfo D_80390AE0; +extern ActorInfo D_80390960; +extern ActorInfo D_80390A40; +extern ActorInfo D_80390A70; +extern ActorInfo D_80390830; +extern ActorInfo D_80390880; +extern ActorInfo D_803908A4; +extern ActorInfo D_803908C8; +extern ActorInfo D_803908EC; +extern ActorInfo D_80390910; +extern ActorInfo D_80390934; +extern ActorInfo D_80390DA8; +extern ActorInfo D_80390D70; +extern ActorInfo D_80390BD8; +extern ActorInfo D_80390BFC; + +void bgs_func_8038F1E0(void){//bgs_updateSpawnableActors + spawnableActorList_add(&D_80390804, actor_new, 0x00000088);//croctus + spawnableActorList_add(&D_80390690, actor_new, 0x020108A1); //flibbit + spawnableActorList_add(&D_803906F8, actor_new, 0x400); //pink_egg_largest + spawnableActorList_add(&D_8039071C, actor_new, 0x400); //pink_egg_large + spawnableActorList_add(&D_80390740, actor_new, 0x400); //pink_egg_medium + spawnableActorList_add(&D_80390764, actor_new, 0x400); //pink_egg_small + spawnableActorList_add(&D_80390788, actor_new, 0x400); //pink_egg_smallest + spawnableActorList_add(&D_80390B68, actor_new, 0); //mudhut_top + spawnableActorList_add(&D_80390C40, actor_new, 0x4000548);//tanktup + spawnableActorList_add(&D_80390C88, actor_new, 0x400042c);//tanktup_leg + spawnableActorList_add(&D_80390CC8, actor_new, 0x400042c);//tanktup_leg + spawnableActorList_add(&D_80390D08, actor_new, 0x400042c);//tanktup_leg + spawnableActorList_add(&D_80390D48, actor_new, 0x400042c);//tanktup_leg + spawnableActorList_add(&D_80390AB0, actor_new, 0x81); + spawnableActorList_add(&D_80390AE0, actor_new, 0x20108a1); //yellow_flibbit + spawnableActorList_add(&D_80390960, actor_new, 0); + spawnableActorList_add(&D_80390A40, actor_new, 0x880); //yumblie + spawnableActorList_add(&D_80390A70, actor_new, 0x9a2); //mr. vile + spawnableActorList_add(&D_80390830, actor_new, 0x888); //tiptup + spawnableActorList_add(&D_80390880, actor_new, 0x9a8); //tiptup_chiorMember + spawnableActorList_add(&D_803908A4, actor_new, 0x9a8); //tiptup_chiorMember + spawnableActorList_add(&D_803908C8, actor_new, 0x9a8); //tiptup_chiorMember + spawnableActorList_add(&D_803908EC, actor_new, 0x9a8); //tiptup_chiorMember + spawnableActorList_add(&D_80390910, actor_new, 0x9a8); //tiptup_chiorMember + spawnableActorList_add(&D_80390934, actor_new, 0x9a8); //tiptup_chiorMember + spawnableActorList_add(&D_80390DA8, actor_new, 0x4000); //leafboat + spawnableActorList_add(&D_80390D70, actor_new, 0x580); //bigAlligator + spawnableActorList_add(&D_80390BD8, actor_new, 8); //green_jiggy_switch + spawnableActorList_add(&D_80390BFC, actor_new, 8); //green_jiggy_switch +} + + diff --git a/src/CC/CC.h b/src/CC/CC.h new file mode 100644 index 00000000..c2cfa77d --- /dev/null +++ b/src/CC/CC.h @@ -0,0 +1,7 @@ +#ifndef CC_H +#define CC_H + +s32 func_80388010(void); +void func_8038803C(s32 arg0); + +#endif diff --git a/src/CC/ch/sawblade.c b/src/CC/ch/sawblade.c new file mode 100644 index 00000000..c28c8f54 --- /dev/null +++ b/src/CC/ch/sawblade.c @@ -0,0 +1,162 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + f32 unk0; + f32 unk4; +}Struct_CC_3130_0; + +typedef struct { + Struct_CC_3130_0 *unk0; + s32 unk4; +}ActorLocal_CC_3130; + +void chSawblade_update(Actor *this); + +/* .data */ +Struct_CC_3130_0 D_80389C30[] = { + { -80.0f, 0.4f}, + {-160.0f, 0.6f}, + {-240.0f, 0.8f}, + { 80.0f, 0.4f}, + { 160.0f, 0.6f}, + { 240.0f, 0.8f}, + { -80.0f, 0.4f}, + {-160.0f, 0.6f}, + {-240.0f, 0.8f}, + { 80.0f, 0.4f}, + { 160.0f, 0.6f}, + { 240.0f, 0.8f} +}; + +ActorInfo D_80389C90 = { + 0x28, ACTOR_3D_CLANKER_SAWBLADE_PROPELLOR_1, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR, + 0, NULL, + chSawblade_update, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80389CB4 = { + 0x28, ACTOR_3E_CLANKER_SAWBLADE_PROPELLOR_2, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR, + 0, NULL, + chSawblade_update, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80389CD8 = { + 0x28, ACTOR_3F_CLANKER_SAWBLADE_PROPELLOR_3, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR, + 0, NULL, + chSawblade_update, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80389CFC = { + 0x28, ACTOR_40_CLANKER_SAWBLADE_PROPELLOR_4, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR, + 0, NULL, + chSawblade_update, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80389D20 = { + 0x28, ACTOR_41_CLANKER_SAWBLADE_PROPELLOR_5, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR, + 0, NULL, + chSawblade_update, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80389D44 = { + 0x28, ACTOR_42_CLANKER_SAWBLADE_PROPELLOR_6, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR, + 0, NULL, + chSawblade_update, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80389D68 = { + 0x28, ACTOR_290_CLANKER_SAWBLADE_PROPELLOR_7, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR, + 0, NULL, + chSawblade_update, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80389D8C = { + 0x28, ACTOR_291_CLANKER_SAWBLADE_PROPELLOR_8, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR, + 0, NULL, + chSawblade_update, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80389DB0 = { + 0x28, ACTOR_292_CLANKER_SAWBLADE_PROPELLOR_9, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR, + 0, NULL, + chSawblade_update, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80389DD4 = { + 0x28, ACTOR_293_CLANKER_SAWBLADE_PROPELLOR_10, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR, + 0, NULL, + chSawblade_update, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80389DF8 = { + 0x28, ACTOR_294_CLANKER_SAWBLADE_PROPELLOR_11, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR, + 0, NULL, + chSawblade_update, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80389E1C = { + 0x28, ACTOR_295_CLANKER_SAWBLADE_PROPELLOR_12, ASSET_43A_MODEL_CLANKER_SAWBLADE_PROPELLOR, + 0, NULL, + chSawblade_update, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_80389520(ActorMarker *marker, ActorMarker *otherMarker){ + FUNC_8030E624(SFX_65_METALLIC_SCRATCH, 1.0f, 30000); +} + +void func_8038954C(ActorMarker *marker, ActorMarker *otherMarker){ + Actor *actor = marker_getActor(marker); + ActorLocal_CC_3130 *local = (ActorLocal_CC_3130 *) &actor->local; + + if(local->unk4 == 0){ + FUNC_8030E624(SFX_20_METAL_CLANK_1, 1.0f, 30000); + } + local->unk4 = 2; +} + +void chSawblade_update(Actor *this){ + ActorLocal_CC_3130 *local = (ActorLocal_CC_3130 *)&this->local; + f32 tmp_f2; + f32 sp34 = time_getDelta(); + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->roll = this->yaw; + this->yaw = 0.0f; + marker_setCollisionScripts(this->marker, func_80389520, NULL, func_8038954C); + local->unk0 = &D_80389C30[(this->modelCacheIndex < 0x43) ? this->modelCacheIndex - 0x3D : this->modelCacheIndex - 0x28A]; + local->unk4 = 0; + func_80256C60(this->position, 100); + if(map_get() == MAP_21_CC_WITCH_SWITCH_ROOM){ + this->position_z += 64.0f; + } + }//L80389660 + tmp_f2 = this->roll; + this->roll += local->unk0->unk0 * sp34; + this->roll += (this->roll < 0.0f)? 360 : 0; + this->roll -= (this->roll >= 360.0f)? 360 : 0; + if( ( tmp_f2 < 90.0f && this->roll >= 90.0f ) + || ( tmp_f2 < 270.0f && this->roll >= 270.0f ) + || ( 90.0f < tmp_f2 && this->roll <= 90.0f ) + || ( 270.0f < tmp_f2 && this->roll <= 270.0f ) + ){//L80389790 + func_8030E878(SFX_2_CLAW_SWIPE, local->unk0->unk4, 30000, this->position, 500.0f, 1000.0f); + }//L803897C8 + if(local->unk4 > 0) + local->unk4--; +} diff --git a/src/CC/ch/tooth.c b/src/CC/ch/tooth.c new file mode 100644 index 00000000..b3dc0756 --- /dev/null +++ b/src/CC/ch/tooth.c @@ -0,0 +1,100 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80333334(enum jiggy_e arg0); + +typedef struct { + f32 position[3];//position + u8 level_flag; + u8 jiggy_id; + s16 open_model; + s16 closed_model; + //u8 pad12[0x2]; + f32 jiggy_position[3]; +} Struct_CC_1120_0; + +typedef struct { + Struct_CC_1120_0 *unk0; +} ActorLocal_CC_1120; + +void chTooth_update(Actor *); + +/* .data */ +Struct_CC_1120_0 D_80389B50[] = { + { { 522.9976f, 1135.8192f, 5503.4833f}, LEVEL_FLAG_0_CC_TOKEN_TOOTH_OPEN, 0x00, ASSET_891_MODEL_CLANKER_TOKEN_TOOTH_OPEN, ASSET_892_MODEL_CLANKER_TOKEN_TOOTH_CLOSED, { 540.0f, 1627.0f, 6641.0f}}, + { {-713.4896f, 1135.8192f, 5152.913f}, LEVEL_FLAG_1_CC_JIGGY_TOOTH_OPEN, JIGGY_1B_CC_TOOTH, ASSET_893_MODEL_CLANKER_JIGGY_TOOTH_OPEN, ASSET_894_MODEL_CLANKER_JIGGY_TOOTH_CLOSED, {-700.0f, 1536.0f, 6268.0f}} +}; + +ActorInfo D_80389B90 = { + 0x4E, ACTOR_101_CLANKER_TOKEN_TOOTH, ASSET_891_MODEL_CLANKER_TOKEN_TOOTH_OPEN, + 0, NULL, + chTooth_update, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80389BB4 = { + 0x4F, ACTOR_102_CLANKER_JIGGY_TOOTH, ASSET_893_MODEL_CLANKER_JIGGY_TOOTH_OPEN, + 0, NULL, + chTooth_update, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +extern void __chTooth_setState(Actor *this, s32 next_state){ + ActorMarker *marker = this->marker; + ActorLocal_CC_1120 * local = (ActorLocal_CC_1120 *) &this->local; + this->state = next_state; + + if(next_state == 2){ + marker->modelId = local->unk0->open_model; + } + if(next_state == 1){ + marker->modelId = local->unk0->closed_model; + } +} + +extern void chTooth_update(Actor * this){ + ActorMarker *marker = this->marker; + ActorLocal_CC_1120 * local = (ActorLocal_CC_1120 *) &this->local; + f32 sp24[3]; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + marker->propPtr->unk8_3 = 1; + local->unk0 = &D_80389B50[(this->modelCacheIndex == ACTOR_101_CLANKER_TOKEN_TOOTH) ? 0 : 1]; + this->position[0] = local->unk0->position[0]; + this->position[1] = local->unk0->position[1]; + this->position[2] = local->unk0->position[2]; + + this->position[0] *= 1.25; + this->position[1] *= 1.25; + this->position[2] *= 1.25; + }//L80387660 + if(this->state == 0){ + if(levelSpecificFlags_get(local->unk0->level_flag)){ + __chTooth_setState(this, 2); + } + else{ + __chTooth_setState(this, 1); + } + } + else if(this->state == 2){//L803876B4 + if(local->unk0->jiggy_id && !jiggyscore_isSpawned(local->unk0->jiggy_id)){ + player_getPosition(sp24); + if(sp24[0] < 0.0f && 5400.0f < sp24[2]){ + func_80333334(local->unk0->jiggy_id); + jiggySpawn(local->unk0->jiggy_id, local->unk0->jiggy_position); + } + else{//L8038774C + sp24[0] = local->unk0->jiggy_position[0]; + sp24[1] = local->unk0->jiggy_position[1]; + sp24[2] = local->unk0->jiggy_position[2]; + + sp24[1] = 1470.0f; + func_80333388(local->unk0->jiggy_id); + func_803331D8(local->unk0->jiggy_id, sp24); + } + } + } +} diff --git a/src/CC/code_0.c b/src/CC/code_0.c new file mode 100644 index 00000000..62733fbf --- /dev/null +++ b/src/CC/code_0.c @@ -0,0 +1,142 @@ +#include +#include "functions.h" +#include "variables.h" + + +typedef struct { + f32 unk0; + f32 unk4; + f32 unk8; + u8 unkC; +} ActorLocal_CC_0; + +void func_803864D4(Actor *this); + +/* .data */ +ActorInfo D_80389AA0 = { + 0x4B, 0x43, 0x890, 0, NULL, + func_803864D4, func_80326224 , func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .rodata */ +extern f32 D_80389EB0; +extern f32 D_80389EB4; +extern f64 D_80389EB8; +extern f64 D_80389EC0; +extern f64 D_80389EC8; +extern f64 D_80389ED0; +extern f64 D_80389ED8; +extern f64 D_80389EE0; +extern f64 D_80389EE8; +extern f64 D_80389EF0; +// 0000 3AC0: 45B1F800 3D4CCCCD 3FE3333333333333 +// 0000 3AD0: 4056800000000000 4066800000000000 +// 0000 3AE0: 400921FB54524550 3FB999999999999A +// 0000 3AF0: 4056800000000000 4066800000000000 +// 0000 3B00: 400921FB54524550 0000000000000000 + +/* .code */ +void func_803863F0(Actor *this, s32 next_state){ + ActorLocal_CC_0 * local = (ActorLocal_CC_0 *)this->local; + if(this->state == 4){ + func_80388ED4(0); + } + this->state = next_state; + local->unkC = 1; + local->unk0 = 0.0f; + local->unk4 = 0.0f; + local->unk8 = 0.0f; + if(1 == this->state){ + local->unk4 = 2.0f; + } + if(this->state == 2){ + func_80388ED4(1); + } + if(this->state == 3){ + local->unk0 = 1.0f; + } + +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/CC/code_0/func_803864D4.s") +#else +void func_803864D4(Actor *this){ + ActorMarker *marker = this->marker;//sp5C; + ActorLocal_CC_0 * local = (ActorLocal_CC_0 *)this->local; + f32 sp4C[3]; + f32 sp40[3]; + f32 sp3C = time_getDelta(); + f32 sp30[3]; + f32 sp2C; + f32 sin_result; + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + marker->propPtr->unk8_3 = 1; + func_803863F0(this, 1); + }//L80386530 + + func_80388B4C(&sp4C); + TUPLE_ASSIGN(sp40, 2640.0f, 5695.0f, -10.0f); + local->unk8 += sp3C; + if(func_8025773C(&local->unk4, sp3C)){ + sp30[0] = sp4C[0] - sp40[0]; + sp30[1] = 0.0f; + sp30[2] = sp4C[2] - sp40[2]; + if(!func_80388CA0()){ + local->unk4 = 2.0f; + } + else if(60.0f < gu_sqrtf(sp30[0]*sp30[0] + sp30[1]*sp30[1] + sp30[2]*sp30[2])){ + local->unk4 = 0.05f; + } + else{ + func_803863F0(this, 2); + } + }//L80386634 + + if(func_8025773C(&local->unk0, sp3C)){ + func_803863F0(this, 4); + } + + if(this->state == 2){ + if(1.0 <= local->unk8) + func_803863F0(this, 3); + }//L803866B4 + + if(this->state == 4){ + if(1.0 <= local->unk8) + func_803863F0(this, 1); + }//L80386714 + + if(this->state == 1){ + TUPLE_COPY(this->position, sp4C); + } + else if(this->state == 2) + {//L80386734 + sp2C = local->unk8*(f64)1; + if(local->unkC && 0.6 < sp2C){ + FUNC_8030E8B4(SFX_91_METALLIC_SOUND, 1.0f, 32000, this->position, 100, 6000); + local->unkC = 0; + }//L80386798 + sin_result = sinf(((sp2C*90.0)/180.0)*M_PI); + this->position_x = (sp40[0] - sp4C[0])*sin_result + sp4C[0]; + this->position_y = (sp40[1] - sp4C[1])*sin_result + sp4C[1]; + this->position_z = (sp40[2] - sp4C[2])*sin_result + sp4C[2]; + }//L80386818 + else if(this->state == 3){ + TUPLE_COPY(this->position, sp40); + } + else if(this->state == 4){ + sp2C = 1 - local->unk8*(f64)1; + if(local->unkC && sp2C < 0.1){ + local->unkC = 0; + }//L8038688C + sin_result = sinf(((sp2C*90.0)/180.0)*M_PI); + this->position_x = (sp40[0] - sp4C[0])*sin_result + sp4C[0]; + this->position_y = (sp40[1] - sp4C[1])*sin_result + sp4C[1]; + this->position_z = (sp40[2] - sp4C[2])*sin_result + sp4C[2]; + }//L80386904 +} +#endif diff --git a/src/CC/code_13C0.c b/src/CC/code_13C0.c new file mode 100644 index 00000000..1d994465 --- /dev/null +++ b/src/CC/code_13C0.c @@ -0,0 +1,172 @@ +#include +#include "functions.h" +#include "variables.h" +#include "CC.h" + +typedef struct{ + void (*unk0)(s32 arg0); + u8 pad4[0x14]; + s32 unk10; + u8 pad14[0x4]; + f32 unk18[3]; + u8 unk24[8]; +}Struct_CC_13C0_0; + +typedef struct{ + s32 unk0; + s32 unk4; + s32 unk8; + f32 unkC; +}Struct_CC_13C0_1; + +extern Struct_CC_13C0_0 D_8036E834[]; + +extern s32 D_80383568; + +// Struct5Fs *, struct struct_68_s *, f32[3], f32[3], f32, BKModelBin*, Gfx**, Mtx**, Vtx**); + +void func_803877B0(Struct_CC_13C0_1* arg0, void* arg1, f32 position[3], f32 rotation[3], f32 arg4, BKModelBin* modeL_ptr, Gfx** gfx, Mtx** mtx, Vtx **vtx) { + s32 temp_v0 = arg0->unk4; + + if (temp_v0 == 3) + return; + + if (temp_v0 == 0) { + func_8033A45C(1, 1); + } else if (temp_v0 == 1) { + func_8033A45C(1, 2); + } else if (temp_v0 == 2) { + func_8033A45C(1, 2); + rotation[2] += (arg0->unkC * 20.0f); + arg4 = arg4*(1.0f - arg0->unkC); + } + func_8033A45C(2, 0); + set_model_render_mode(1); + func_803391A4(gfx, mtx, position, rotation, arg4, NULL, modeL_ptr); +} + +void func_803878AC(Struct_CC_13C0_1 *arg0, Struct68s *arg1, s32 arg2) { + arg0->unk4 = arg2; + arg0->unkC = 0.0f; + if ((arg2 == 2) || (arg2 == 3)) { + func_80351A04(arg1, 1); + } +} + +void func_803878F0(Struct_CC_13C0_1 *arg0, Struct68s *arg1, s32 arg2) { + arg0->unk0 = arg2; + arg0->unk4 = 0; + arg0->unk8 = 0; + arg0 = arg0; + func_80351A14(arg1, (s32) func_803877B0); + func_803878AC(arg0, arg1, 0); +} + +void func_80387940(Struct_CC_13C0_1 *arg0, Struct68s *arg1) { + func_803878F0(arg0, arg1, 1); +} + +void func_80387960(Struct_CC_13C0_1 *arg0, Struct68s *arg1) { + func_803878F0(arg0, arg1, 2); +} + +void func_80387980(Struct_CC_13C0_1 *arg0, Struct68s *arg1) { + func_803878F0(arg0, arg1, 3); +} + +void func_803879A0(Struct_CC_13C0_1 *arg0, Struct68s *arg1) { + func_803878F0(arg0, arg1, 4); +} + +void func_803879C0(Struct_CC_13C0_1 *arg0, Struct68s *arg1) { + func_803878F0(arg0, arg1, 5); +} + +void func_803879E0(Struct_CC_13C0_1 *arg0, Struct68s *arg1) { + func_803878F0(arg0, arg1, 6); +} + +void func_80387A00(Struct_CC_13C0_1 *arg0, Struct68s *arg1) { + func_803878F0(arg0, arg1, 7); +} + +void func_80387A20(Struct_CC_13C0_1 *arg0, Struct68s *arg1) { + func_803878F0(arg0, arg1, 8); +} + +void func_80387A40(Struct_CC_13C0_1* arg0, Struct68s* arg1, f32 arg2) { + s32 temp_v0; + f32 sp50[3]; + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + s32 sp28; + + arg0->unkC += arg2; + temp_v0 = func_80388010(); + if (temp_v0 == 0) { + func_803878AC(arg0, arg1, 3); + } else { + if (temp_v0 < arg0->unk0) { + func_803878AC(arg0, arg1, 0); + } else if (temp_v0 == arg0->unk0) { + func_803878AC(arg0, arg1, 1); + } else if ((arg0->unk0 < temp_v0) && ((arg0->unk4 != 2)) && (arg0->unk4 != 3)) { + func_803878AC(arg0, arg1, 2); + } else if ((arg0->unk4 == 2) && (arg0->unkC >= 1.0f)) { + func_803878AC(arg0, arg1, 3); + } + } + if ((arg0->unk4 == 0) || (arg0->unk4 == 1)) { + func_8035179C(arg1, sp38); + func_80351814(arg1, sp2C); + sp44[0] = 0.0f; + sp44[1] = 0.0f; + sp44[2] = 1.0f; + mlMtxIdent(); + func_80252C08(NULL, sp2C, 1.0f, NULL); + func_8025235C(sp44, sp44); + player_getPosition(sp50); + sp50[1] += 50.0f; + sp50[0] -= sp38[0]; + sp50[1] -= sp38[1]; + sp50[2] -= sp38[2]; + sp28 = ((sp50[0]*sp44[0] + sp50[1]*sp44[1] + sp50[2]*sp44[2]) >= 0.0f) ? 1 : -1; + if (sp28 == -arg0->unk8) { + if (gu_sqrtf(sp50[0]*sp50[0] + sp50[1]*sp50[1] + sp50[2] * sp50[2]) < (func_80351830(arg1) * 250.0f)) { + func_8038803C(arg0->unk0); + } + } + arg0->unk8 = sp28; + } +} + +void func_80387CC0(void){ + f32 sp1C[3]; + s32 tmp_v0; + if(getGameMode() == GAME_MODE_7_ATTRACT_DEMO) + return; + + func_8024C764(sp1C); + tmp_v0 = func_8023DB4C(0x7F); + if(tmp_v0 >= 0x40){ + tmp_v0 = 0x7F - tmp_v0; + } + sp1C[2] += tmp_v0 + 0x94; + if(360.0f <= sp1C[2]){ + sp1C[2] -= 360.0f; + } + func_8024CE18(sp1C); + +} + +void func_80387D4C(void){ + u32 sp1C; + u32 tmp_v0; + osPiReadIo(0x504, &sp1C); + sp1C = (sp1C & 0xffff) + 0xffff5BA0; + if(sp1C){ + func_80387CC0(); + } +} + diff --git a/src/CC/code_19B0.c b/src/CC/code_19B0.c new file mode 100644 index 00000000..6f45c521 --- /dev/null +++ b/src/CC/code_19B0.c @@ -0,0 +1,51 @@ +#include +#include "functions.h" +#include "variables.h" + +extern ActorInfo D_80389AA0; +extern ActorInfo D_80389AD0; +extern ActorInfo D_80389B00; +extern ActorInfo D_80389B24; +extern ActorInfo D_80389B90; +extern ActorInfo D_80389BB4; +extern ActorInfo D_80389C90; +extern ActorInfo D_80389CB4; +extern ActorInfo D_80389CD8; +extern ActorInfo D_80389CFC; +extern ActorInfo D_80389D20; +extern ActorInfo D_80389D44; +extern ActorInfo D_80389D68; +extern ActorInfo D_80389D8C; +extern ActorInfo D_80389DB0; +extern ActorInfo D_80389DD4; +extern ActorInfo D_80389DF8; +extern ActorInfo D_80389E1C; +extern ActorInfo D_80389E44; +extern ActorInfo D_80389E68; +extern ActorInfo D_80389E8C; + + +void func_80387DA0(void) +{ + spawnableActorList_add(&D_80389AA0, actor_new, 0X4080); + spawnableActorList_add(&D_80389E44, actor_new, 0X10080); + spawnableActorList_add(&D_80389E68, actor_new, 0X10080); + spawnableActorList_add(&D_80389E8C, actor_new, 0X10080); + spawnableActorList_add(&D_80389AD0, actor_new, 0X80); + spawnableActorList_add(&D_80389B00, actor_new, 0X80); + spawnableActorList_add(&D_80389B24, actor_new, 0X80); + spawnableActorList_add(&D_80389B90, actor_new, 0X80); + spawnableActorList_add(&D_80389BB4, actor_new, 0X80); + spawnableActorList_add(&D_80389C90, actor_new, 0X2488); + spawnableActorList_add(&D_80389CB4, actor_new, 0X2488); + spawnableActorList_add(&D_80389CD8, actor_new, 0X2488); + spawnableActorList_add(&D_80389CFC, actor_new, 0X2488); + spawnableActorList_add(&D_80389D20, actor_new, 0X2488); + spawnableActorList_add(&D_80389D44, actor_new, 0X2488); + spawnableActorList_add(&D_80389D68, actor_new, 0X2488); + spawnableActorList_add(&D_80389D8C, actor_new, 0X2488); + spawnableActorList_add(&D_80389DB0, actor_new, 0X2488); + spawnableActorList_add(&D_80389DD4, actor_new, 0X2488); + spawnableActorList_add(&D_80389DF8, actor_new, 0X2488); + spawnableActorList_add(&D_80389E1C, actor_new, 0X2488); +} diff --git a/src/CC/code_1B90.c b/src/CC/code_1B90.c new file mode 100644 index 00000000..38c7629c --- /dev/null +++ b/src/CC/code_1B90.c @@ -0,0 +1,115 @@ +#include +#include "functions.h" +#include "variables.h" +#include "CC.h" + +/* .data */ +f32 D_80389BF0[3] = {0.0f, 1300.0f, -2800.0f}; + +/* .bss */ +extern struct { + u8 unk0; + u8 unk1; + //u8 pad2[2]; + f32 unk4; + f32 unk8; +} D_80389F90; + +/* .code */ +void func_80387F80(void){ + func_8034E71C(func_8034C5AC(0x131), 0x190, 0.0f); +} + +void func_80387FB0(void){ + item_set(ITEM_0_HOURGLASS_TIMER, 48*60 - 1); + item_set(ITEM_6_HOURGLASS, 1); + D_80389F90.unk1 = 1; +} + +void func_80387FE8(void){ + item_set(ITEM_6_HOURGLASS, 0); + D_80389F90.unk1 = 0; +} + +s32 func_80388010(void){ + if(D_80389F90.unk0 > 0 && D_80389F90.unk0 < 0xA){ + return D_80389F90.unk0; + } + return 0; +} + +void func_8038803C(s32 arg0){ + if(arg0 == D_80389F90.unk0){ + if(arg0 == 1){ + func_80387FB0(); + } + D_80389F90.unk0++; + if(D_80389F90.unk0 >= 9){ + func_80387FE8(); + D_80389F90.unk8 = 1.0f; + } + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + } + else{//L803880BC + func_8025A6EC(COMUSIC_2C_BUZZER, 28000); + } +} + +void func_803880D4(void){ + if(D_80389F90.unk0 != 0){ + func_80387FE8(); + } +} + +void func_80388104(void){ + D_80389F90.unk0 = 0; + if(map_get() == MAP_22_CC_INSIDE_CLANKER){ + if(jiggyscore_isSpawned(JIGGY_1C_CC_RINGS)){ + timedFunc_set_0(0.0f, func_80387F80); + } + else{ + D_80389F90.unk0 = 1; + D_80389F90.unk1 = 0; + D_80389F90.unk8 = 0.0f; + D_80389F90.unk4 = 0.0f; + } + } +} + +void func_8038817C(void){ + f32 sp24[3]; + f32 sp20 = time_getDelta(); + s32 tmp_v0; + + if(D_80389F90.unk0 != 0){ + D_80389F90.unk4 += sp20; + player_getPosition(sp24); + if(func_8025773C(&D_80389F90.unk8, sp20)){ + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + func_80324E38(0.0f, 3); + timed_setCameraToNode(2.0f, 0); + timedJiggySpawn(2.1f, JIGGY_1C_CC_RINGS, D_80389BF0); + func_80324E38(5.0f, 0); + func_80324E88(5.0f); + tmp_v0 = func_8034C5AC(0x131); + if(tmp_v0){ + func_8034E78C(tmp_v0, 0x190, 12.0f); + } + D_80389F90.unk4 = 0.0f; + }//L80388264 + if(!(D_80389F90.unk0 < 2) && D_80389F90.unk1 != 0){ + if( (sp24[0] < -1100.0f && sp24[1] < -40.0f) + || (1560.0f < sp24[0]) + || (2850.0f < sp24[2]) + || (sp24[2] < -3000.0f) + || (D_80389F90.unk0 < 9 && item_empty(ITEM_6_HOURGLASS)) + ){ + func_80387FE8(); + func_8025A6EC(COMUSIC_3C_MINIGAME_LOSS, 28000); + func_803880D4(); + func_80388104(); + } + }//L8038834C + }//L8038834C +} + diff --git a/src/CC/code_1F70.c b/src/CC/code_1F70.c new file mode 100644 index 00000000..74ceab21 --- /dev/null +++ b/src/CC/code_1F70.c @@ -0,0 +1,440 @@ +#include +#include "functions.h" +#include "variables.h" + +extern Struct60s *func_8028EF48(void); +extern void func_8030E9FC(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, f32 arg4[3], f32 arg5, f32 arg6); +extern void func_8030EA54(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, f32 arg4[3], f32 arg5, f32 arg6); +extern void func_8031CE28(s32, s32, f32); +void func_80324E88(f32); +extern int func_802E805C(BKCollisionList *, BKVertexList *, f32[3], s32, f32, s32, s32, s32, s32); +extern void func_80340200(s32, f32[3], s32, f32, s32, s32, BKVertexList *, s32); +extern void func_802E9118(BKCollisionList *, BKVertexList *, f32[3], s32, f32, s32, s32, f32, s32, s32, s32); +extern void func_802E9DD8(BKCollisionList *, BKVertexList *, f32[3], s32, f32, s32, f32, s32, s32); +extern int func_80340020(s32, f32[3], s32, f32, s32, BKVertexList *, f32[3], f32[3]); + +extern void func_8033A670(s32, s32, f32[3]); +extern void func_8033A928(s32, s32, f32[3]); +extern void func_8033A9A8(s32, s32, f32[3]); +extern void func_8024C5CC(f32[3]); +extern void ml_vec3f_normalize(f32[3]); +extern void func_8033A45C(s32, s32); +extern void func_8033A238(s32); +extern void func_8033A450(s32); +extern void func_8028FAB0(f32[3]); +extern void func_802921D4(f32[3]); + +/* .data */ +f32 D_80389C00[3] = {5700.0f, 4300.0f, 0.0f}; +f32 D_80389C0C[3] = {0.0f, 27.0f, 0.0f}; +f32 D_80389C18[3] = {0.0f, -27.0f, 0.0f}; +f32 D_80389C24[3] = {4000.0f, 3500.0f, 0.0f}; + +/* .bss */ +struct { + s32 unk0; + u8 unk4; + //u8 pad5[0x3]; + f32 unk8; + f32 unkC[3]; + s32 unk18; + BKCollisionList *unk1C; + u8 unk20; + u8 unk21; + //u8 pad22[0x2]; + BKModelBin * unk24; + f32 unk28[3]; + s32 unk34; + f32 unk38; + f32 unk3C; + BKVertexList *unk40; + BKVertexList *unk44; + u8 unk48; + u8 unk49; + //u8 pad4A[2]; + f32 unk4C; + s32 unk50; + f32 unk54; +}D_80389FA0; + +s32 func_80388360(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ + s32 out_v0; + + out_v0 = func_802E805C(D_80389FA0.unk1C, D_80389FA0.unk40, D_80389FA0.unk28, 0, 1.0f, arg0, arg1, arg2, arg3); + if(out_v0 && func_8029453C()){ + func_80340200(D_80389FA0.unk18, D_80389FA0.unk28, 0, 1.0f, 0, out_v0, D_80389FA0.unk40, arg1); + + } + return out_v0; +} + +void func_80388428(s32 arg0, s32 arg1, f32 arg2, s32 arg3, s32 arg4, s32 arg5){ + func_802E9118(D_80389FA0.unk1C, D_80389FA0.unk40, D_80389FA0.unk28, 0, 1.0f, arg0, arg1, arg2, arg3, arg4, arg5); +} + +void func_803884A8(s32 arg0, f32 arg1, s32 arg2, s32 arg3){ + func_802E9DD8(D_80389FA0.unk1C, D_80389FA0.unk40, D_80389FA0.unk28, 0, 1.0f, arg0, arg1, arg2, arg3); +} + +void func_80388518(s32 arg0){ + s32 sp24; + if(D_80389FA0.unk21 == 2){ + func_8030E394(D_80389FA0.unk4); + func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.6f, 20000); + func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.8f, 20000); + func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.9f, 20000); + func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 20000); + }//L80388594 + sp24 = D_80389FA0.unk21; + D_80389FA0.unk21 = arg0; + D_80389FA0.unk38 = 0.0f; + if(D_80389FA0.unk21 == 1){ + func_80335924(D_80389FA0.unk0, ASSET_C3_ANIM_CLANKER_IDLE, 0.0f, 10.0f); + } + if(D_80389FA0.unk21 == 2){ + func_8030DD90(D_80389FA0.unk4, 0); + func_8030DBB4(D_80389FA0.unk4, 1.0f); + sfxsource_setSfxId(D_80389FA0.unk4, SFX_7D_ANCHOR_LIFTING); + func_8030DD14(D_80389FA0.unk4, 3); + sfxsource_setSampleRate(D_80389FA0.unk4, 27000); + func_8030E2C4(D_80389FA0.unk4); + } + + if(D_80389FA0.unk21 == 3){ + if(sp24 != 2){ + func_80335924(D_80389FA0.unk0, ASSET_C3_ANIM_CLANKER_IDLE, 0.0f, 10.0f); + } + D_80389FA0.unk28[1] = 1100.0f; + } +} + +void func_80388664(void) { + jiggySpawn(JIGGY_17_CC_CLANKER_RAISED, D_80389C00); +} + +void func_8038868C(void) { + func_80324E38(0, 3); + timed_setCameraToNode(0, 0); + timed_setCameraToNode(5.5f, 1); + timed_setCameraToNode(7.0f, 2); + timed_setCameraToNode(12.5f, 3); + timedFunc_set_0(13.0f, &func_80388664); + timed_setCameraToNode(16.0f, 1); + if (jiggyscore_isCollected(JIGGY_17_CC_CLANKER_RAISED) == 0) { + func_80324DBC(18.0f, 0xD2C, 4, NULL, NULL, NULL, 0); + } + func_80324E88(18.0f); + func_80324E38(18.0f, 0); +} + + +void func_80388760(Gfx **gfx, Mtx **mtx, Vtx **vtx){ + BKVertexList *tmp_v0; + s32 s1; + f32 spA4[3]; + f32 sp98[3]; + int i; + s32 tmp_s0; + f32 sp84[3]; + s32 pad80; + f32 sp74[3]; + f32 sp68[3]; + f32 sp5C[3]; + + + if(D_80389FA0.unk21 == 0) + return; + + func_8024C5CC(sp98); + + if(sp98[0] < -2600.0f || 11600.0f < sp98[0]) + return; + + s1 = func_803356A0(D_80389FA0.unk0); + func_8033A670(s1, 0x40, sp84); + for( i = 0; i < 3; i++){ + sp84[i] = sp84[i] + (1.3 - sp84[i])*D_80389FA0.unk8; + } + + func_8033A928(s1, 0x40, sp84); + + if(D_80389FA0.unk21 == 1){ + func_8033A9A8(s1, 0x44, D_80389C0C); + func_8033A9A8(s1, 0x45, D_80389C0C); + func_8033A9A8(s1, 0x46, D_80389C0C); + + func_8033A9A8(s1, 0x47, D_80389C18); + func_8033A9A8(s1, 0x48, D_80389C18); + func_8033A9A8(s1, 0x49, D_80389C18); + } + + player_getPosition(spA4); + + for(i = 0; i < 2; i++){//L803888FC + func_8034A174(D_80389FA0.unk34, (i == 0) ? 0x10 : 0xf, sp74); + sp68[0] = spA4[0] - sp74[0]; + sp68[1] = spA4[1] - sp74[1]; + sp68[2] = spA4[2] - sp74[2]; + ml_vec3f_normalize(sp68); + + sp5C[0] = 0.0f; + sp5C[1] = sp68[2]*45.0f; + sp5C[2] = -sp68[1]*45.0f; + func_8033A9A8(s1, (i == 0)?0x42:0x43, sp5C); + } + tmp_v0 = D_80389FA0.unk40; + D_80389FA0.unk40 = D_80389FA0.unk44; + D_80389FA0.unk44 = tmp_v0; + + func_8033A45C(1, (D_80389FA0.unk21 == 3) ? 1 : 0); + tmp_s0 = (sp98[0] < 100.0f)? 0 : 1; + func_8033A45C(2, 1); + func_8033A45C(3, 1); + func_8033A45C(4, tmp_s0); + func_8033A45C(5, tmp_s0); + func_8033A45C(6, tmp_s0); + func_8033A45C(7, tmp_s0); + func_8033A45C(8, tmp_s0); + if(tmp_s0){ + tmp_s0 = (s32)(D_80389FA0.unk4C*3.99 + 1.0); + func_8033A45C(2, tmp_s0); + func_8033A45C(3, tmp_s0); + } + func_8033A238(s1); + func_8033A450(D_80389FA0.unk34); + func_8033A4C0(D_80389FA0.unk40); + set_model_render_mode(1); + func_803391A4(gfx, mtx, D_80389FA0.unk28, NULL, 1.0f, NULL, D_80389FA0.unk24); + if(func_80340020(D_80389FA0.unk18, D_80389FA0.unk28, 0, 1.0f, 0, D_80389FA0.unk40, spA4, spA4)){ + func_8028FAB0(spA4); + func_802921D4(spA4); + } +} + +void func_80388B4C(s32 arg0) { + func_8034A174(D_80389FA0.unk34, 5, arg0); +} + +void func_80388B78(f32 arg0[3], f32 arg1[3]){ + func_8034A174(D_80389FA0.unk34, 7, arg0); + func_8034A174(D_80389FA0.unk34, 8, arg1); +} + +void func_80388BBC(f32 arg0[3], f32 arg1[3]){ + func_8034A174(D_80389FA0.unk34, 9, arg0); + func_8034A174(D_80389FA0.unk34, 10, arg1); +} + +void func_80388C00(s32 arg0, s32 arg1){ + func_8031CD20(arg0, 0xb, 3); +} + +void func_80388C28(s32 arg0, s32 arg1){ + func_8031CD20(arg0, 0xb, 4); +} + +void func_80388C50(s32 arg0, s32 arg1){ + func_8031CD20(arg0, 0xb, 1); +} + +void func_80388C78(s32 arg0, s32 arg1){ + func_8031CD20(arg0, 0xb, 2); +} + +int func_80388CA0(void){ + return D_80389FA0.unk21 == 3; +} + +void func_80388CB4(void){ + if(D_80389FA0.unk21){ + func_80335874(D_80389FA0.unk0); + func_8030DA44(D_80389FA0.unk4); + func_80340690(D_80389FA0.unk18); + func_8034A2A8(D_80389FA0.unk34); + if(func_8033A148(D_80389FA0.unk24) != D_80389FA0.unk40) + vtxList_free(D_80389FA0.unk40); + if(func_8033A148(D_80389FA0.unk24) != D_80389FA0.unk44) + vtxList_free(D_80389FA0.unk44); + assetcache_release((void *)D_80389FA0.unk24); + D_80389FA0.unk34 = NULL; + D_80389FA0.unk0 = NULL; + D_80389FA0.unk18 = NULL; + } +} + +void func_80388D54(void){ + D_80389FA0.unk21 = 0; + if(map_get() == MAP_B_CC_CLANKERS_CAVERN){ + D_80389FA0.unk0 = func_803358B4(); + D_80389FA0.unk4 = func_8030D90C(); + D_80389FA0.unk8 = 1.0f; + D_80389FA0.unk18 = func_803406B0(); + D_80389FA0.unk21 = 0; + D_80389FA0.unk24 = assetcache_get(ASSET_88E_MODEL_CLANKER_CHAIN); + D_80389FA0.unk1C = func_8033A084(D_80389FA0.unk24); + D_80389FA0.unk34 = func_8034A2C8(); + D_80389FA0.unk3C = 1.0f; + D_80389FA0.unk40 = func_8033A148(D_80389FA0.unk24); + D_80389FA0.unk44 = vtxList_clone(D_80389FA0.unk40); + D_80389FA0.unk48 = 0; + D_80389FA0.unk49 = 0; + D_80389FA0.unk50 = 0; + D_80389FA0.unk4C = 0.0f; + D_80389FA0.unk54 = 1.0f; + D_80389FA0.unk28[0] = 5500.0f; + D_80389FA0.unk28[2] = 0.0f; + D_80389FA0.unk28[1] = 0.0f; + func_80320B24(func_80388360, func_80388428, func_803884A8); + if(!func_80304E24(0x3B, D_80389FA0.unkC)){ + D_80389FA0.unkC[0] = 0.0f; + D_80389FA0.unkC[1] =-1e+06f; + D_80389FA0.unkC[2] = 0.0f; + } + if(jiggyscore_isSpawned(JIGGY_17_CC_CLANKER_RAISED)){ + func_80388518(3); + } + else{ + func_80388518(1); + } + } +} + +void func_80388EA4(void){ + if(D_80389FA0.unk21 == 1){ + func_80388518(2); + } +} + +void func_80388ED4(s32 arg0){ + f32 sp1C[3]; + func_8034A174(D_80389FA0.unk34, 5, sp1C); + if(arg0 != 0){ + FUNC_8030E8B4(SFX_91_METALLIC_SOUND, 0.7f, 32675, sp1C, 100, 6000); + } + else{ + FUNC_8030E8B4(SFX_82_METAL_BREAK, 0.9f, 24000, sp1C, 100, 6000); + } + D_80389FA0.unk8 = 1.0f; +} + +void func_80388F4C(void){ + f32 sp6C[3]; + f32 sp68 = time_getDelta(); + f32 sp64; + f32 sp60; + f32 sp54[3]; + f32 sp48[3]; + Struct60s *tmp_v0; + f32 pad[3]; + + func_80387D4C(); + if(D_80389FA0.unk21 != 0 && func_80334904() == 2){ + player_getPosition(sp6C); + D_80389FA0.unk20 = (ml_vec3f_distance(sp6C, D_80389FA0.unkC) < 200.0f); + + D_80389FA0.unk38 += sp68; + sp64 = func_80335684(D_80389FA0.unk0); + func_80335A94(D_80389FA0.unk0, sp68, 1); + sp60 = func_80335684(D_80389FA0.unk0); + if(D_80389FA0.unk21 == 3){ + func_8034A174(D_80389FA0.unk34, 5, sp54); + if(sp60 < sp64){ + FUNC_8030E8B4(SFX_7E_CREAKY_DOOR_OPENING, 0.6f, 32300, sp54, 1000, 5000); + }//L80389058 + + if(sp64 < 0.3 && 0.3 <= sp60){ + FUNC_8030E8B4(SFX_7E_CREAKY_DOOR_OPENING, 0.5f, 32300, sp54, 1000, 5000); + } + }//L8038909C + + if(D_80389FA0.unk21 == 2){ + D_80389FA0.unk28[1] += 100.0f*sp68; + } + + if(0.0f < D_80389FA0.unk8){ + D_80389FA0.unk8 -= sp68/2; + if(D_80389FA0.unk8 <= 0.0f) + D_80389FA0.unk8 = 0.0f; + } + + if(D_80389FA0.unk21 == 1){ + if(D_80389FA0.unk20 && func_8033567C(D_80389FA0.unk0) != ASSET_C4_ANIM_CLANKER_BITE){ + func_80335924(D_80389FA0.unk0, ASSET_C4_ANIM_CLANKER_BITE, 1.0f, 10.0f); + if(!D_80389FA0.unk48){ + func_80311480(0xd2b, 0xE, D_80389FA0.unk28, NULL, NULL, NULL); + D_80389FA0.unk48 = TRUE; + } + }//L8038918C + + if(!D_80389FA0.unk20 && func_8033567C(D_80389FA0.unk0) == ASSET_C4_ANIM_CLANKER_BITE){ + func_80335924(D_80389FA0.unk0, ASSET_C3_ANIM_CLANKER_IDLE, 1.0f, 10.0f); + } + }//L803891BC + + if(D_80389FA0.unk21 == 2){ + func_803114D0(); + if(1100.0f <= D_80389FA0.unk28[1]){ + func_80388518(3); + } + }//L803891F8 + + if(D_80389FA0.unk21 == 3){ + func_8034A174(D_80389FA0.unk34, 6, sp48); + if(ml_vec3f_distance(sp48, sp6C) <= 130.0f && sp6C[1] - sp48[1] < 50.0f){ + func_8031D04C(0x21, 1); + } + }//L80389260 + + if( D_80389FA0.unk21 == 3){ + tmp_v0 = func_8028EF48(); + if( tmp_v0 && !D_80389FA0.unk49 + ){ + if(tmp_v0->unk8 & 2){ + func_8031CE28(0x22, 5, 180.0f); + D_80389FA0.unk49++; + } + else if(tmp_v0->unk8 & 4){ + func_8031CE28(0x22, 4, 0.0f); + D_80389FA0.unk49++; + } + } + }//L803892DC + if(func_8025773C(&D_80389FA0.unk3C, sp68)){ + if(D_80389FA0.unk21 == 3){ + func_8030E9FC(SFX_D0_GRIMLET_SQUEAK, 0.5f, 0.7f, 20000, D_80389C24, 2000.0f, 4000.0f); + }else{ + func_8030EA54(SFX_D0_GRIMLET_SQUEAK, 0.5f, 0.7f, 20000, D_80389C24, 2000.0f, 4000.0f); + }//L80389384 + D_80389FA0.unk3C = randf2(3.0f, 6.0f); + }//L803893A0 + if(D_80389FA0.unk50 == 0){ + if(func_8025773C(&D_80389FA0.unk54, sp68)) + D_80389FA0.unk50 = 1; + } + + if(D_80389FA0.unk50){ + D_80389FA0.unk4C += D_80389FA0.unk50 * ((sp68 * 30.0)/4); + if(1.0f < D_80389FA0.unk4C){ + D_80389FA0.unk50 = -1; + D_80389FA0.unk4C = 1.0f; + } + else if(D_80389FA0.unk4C < 0.0f){ + D_80389FA0.unk50 = 0; + D_80389FA0.unk4C = 0.0f; + D_80389FA0.unk54 = randf2(0.1f, 7.0f); + } + } + }//L80389490 + +} + +void func_803894A0(void){ + if(D_80389FA0.unk34) + D_80389FA0.unk34 = func_8034A348(D_80389FA0.unk34); + + if(D_80389FA0.unk0) + D_80389FA0.unk0 = defrag(D_80389FA0.unk0); + + if(D_80389FA0.unk18) + D_80389FA0.unk18 = func_803406D4(D_80389FA0.unk18); +} diff --git a/src/CC/code_3400.c b/src/CC/code_3400.c new file mode 100644 index 00000000..8bc6de96 --- /dev/null +++ b/src/CC/code_3400.c @@ -0,0 +1,104 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + u8 *unk0; + f32 unk4; + s32 unk8; +} ActorLocal_CC_3400; + +void func_80389900(Actor *this); +/* .data */ +u8 D_80389E40[] = {3, 3, 2, 0}; + +ActorInfo D_80389E44 = { + 0x1A9, 0x28C, 0x435, + 0, NULL, + func_80389900, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80389E68 = { + 0x1A9, 0x28D, 0x436, + 0, NULL, + func_80389900, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80389E8C = { + 0x1A9, 0x28E, 0x437, + 0, NULL, + func_80389900, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + + +/* .code */ +void func_803897F0(Actor *this, s32 next_state){ + ActorLocal_CC_3400 *local = (ActorLocal_CC_3400 *) &this->local; + + if(next_state == 3) + FUNC_8030E624(SFX_1E_HITTING_AN_ENEMY_2, 1.0f, 25000); + + if(next_state == 2){ + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, -1); + FUNC_8030E624(SFX_3F6_UNKNOWN, 0.9f, 29000); + local->unk4 = 0.0f; + } + + if(next_state == 4){ + marker_despawn(this->marker); + } + + this->state = next_state; +} + +void func_80389890(ActorMarker *marker, ActorMarker *other_marker){ + func_8025A6EC(COMUSIC_2B_DING_B, -1); +} + +void func_803898BC(ActorMarker *marker, ActorMarker *other_marker){ + Actor *actor = marker_getActor(marker); + ActorLocal_CC_3400 *local = (ActorLocal_CC_3400 *) &actor->local; + + if(actor->state == 1){ + func_803897F0(actor, *local->unk0); + } +} + +void func_80389900(Actor * this){ + ActorLocal_CC_3400 *local = (ActorLocal_CC_3400 *) &this->local; + f32 sp20 = time_getDelta(); + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = 1; + local->unk0 = &D_80389E40[this->modelCacheIndex - 0x28C]; + local->unk8 = 0; + marker_setCollisionScripts(this->marker, NULL, func_80389890, func_803898BC); + func_803897F0(this, 1); + if(this->modelCacheIndex == 0x28E && jiggyscore_isSpawned(JIGGY_18_CC_BOLT)){ + marker_despawn(this->marker); + } + return; + }//L803899D4 + + if(this->state == 1){ + if(local->unk8){ + func_803897F0(this, *local->unk0); + } + }//L80389A10 + + if(this->state == 3){ + func_803897F0(this, 4); + } + + if(this->state == 2){ + local->unk4 += 250.0f*sp20; + this->position_y += 250.0f*sp20; + if(250.0f <= local->unk4){ + func_803897F0(this, 4); + } + } +} diff --git a/src/CC/code_530.c b/src/CC/code_530.c new file mode 100644 index 00000000..6f939cd8 --- /dev/null +++ b/src/CC/code_530.c @@ -0,0 +1,200 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8030E730(s32, f32, s32); + +void func_80388EA4(void); + + +typedef struct { + u8 unk0; + u8 unk1; + u8 unk2; + u8 unk3; + f32 unk4[3]; + s16 unk10; + u8 pad12[2]; + f32 unk14; +} ActorLocal_CC_530; + +void func_80386B28(Actor* this); + +/* .data */ +ActorInfo D_80389AD0 = { + 0x4A, 0x3C, 0x429, 0, NULL, + func_80386B28, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +f32 D_80389AF4[3] = {6200.0f, -2600.0f, 0.0f}; + +/* .code */ +void func_80386920(Actor *this, s32 next_state){ + ActorLocal_CC_530 *local = (ActorLocal_CC_530 *)&this->local; + f32 sp28[3]; + s16 sp20[3]; + + local->unk14 = 0.0f; + if(this->state == 2 || this->state == 3 || this->state == 4){ + func_8030E394(local->unk0); + } + + if(next_state == 2 || next_state == 3 || next_state == 4){ + func_8030DD90(local->unk0, 1); + func_8030DBB4(local->unk0, 0.3f); + sfxsource_setSfxId(local->unk0, 0x3ec); + func_8030DD14(local->unk0, 3); + sfxsource_setSampleRate(local->unk0, 28000); + func_8030E2C4(local->unk0); + } + + if(next_state == 2 || next_state == 4){ + func_8025A6EC(COMUSIC_2B_DING_B, 0x7fff); + player_getPosition(&sp28); + TUPLE_COPY(sp20, sp28); + func_802F3A60(&sp20); + } + + if(next_state == 4){ + func_8038868C(); + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF); + } + + if(this->state == 4) + func_8030E730(0x7f, 0.7f, 0x7FFF); + + this->state = next_state; +} + + +void func_80386AD0(ActorMarker *arg0, s32 arg1) { + Actor *actor = marker_getActor(arg0); + ActorLocal_CC_530 *local = (ActorLocal_CC_530 *)&actor->local; + local-> unk1 = 1; +} + +void func_80386AF8(Actor *arg0) { + ActorLocal_CC_530 *local = (ActorLocal_CC_530 *)&arg0->local; + func_80386920(arg0, 0); + func_8030DA44(local->unk0); +} + +void func_80386B28(Actor *this){ + ActorMarker *marker = this->marker; + f32 sp58[3]; + ActorLocal_CC_530 * local = (ActorLocal_CC_530 *)&this->local; + int temp_v0; + f32 sp44[3]; + f32 sp38[3]; + int temp_a0; + + + f32 tick = time_getDelta(); + if(!this->unk16C_4){ + this->unk16C_4 = 1; + marker_setCollisionScripts(this->marker, NULL, func_80386AD0, NULL); + local->unk0 = func_8030D90C(); + local->unk1 = 0; + local->unk2 = 0; + local->unk10 = this->pitch; + local->unk14 = 0.0f; + player_getPosition(&local->unk4); + local->unk3 = 3; + marker->unk30 = func_80386AF8; + marker->propPtr->unk8_3 = 1; + this->position_x = 5700.0f; + this->position_y = -2620.0f; + this->position_z = -20.0f; + if(jiggyscore_isSpawned(JIGGY_17_CC_CLANKER_RAISED)){ + func_80386920(this, 5); + } + else{ + func_80386920(this, 1); + } + } + else{//L80386C40 + local->unk14 += tick; + player_getPosition(&sp58); + if(local->unk1 && ! local->unk2){ + sp38[0] = 0.0f; + sp38[1] = 0.0f; + sp38[2] = -200.0f; + ml_vec3f_pitch_rotate_copy(&sp38, &sp38, this->pitch); + + sp44[0] = local->unk4[0] - D_80389AF4[0]; + sp44[1] = local->unk4[1] - D_80389AF4[1]; + sp44[2] = local->unk4[2] - D_80389AF4[2]; + + temp_a0 = (0.0f <= sp44[0]*sp38[0] + sp44[1]*sp38[1] + sp44[2]*sp38[2]) ? 1 : -1; + + TUPLE_ASSIGN(sp44, + sp58[0] - D_80389AF4[0], + sp58[1] - D_80389AF4[1], + sp58[2] - D_80389AF4[2] + ); + + + temp_v0 = (0.0f <= sp44[0]*sp38[0] + sp44[1]*sp38[1] + sp44[2]*sp38[2]) ? 1 : -1; + + if(temp_a0 != temp_v0){ + local->unk2 = 1; + } + else{ + local->unk2 = 0; + } + } + else{//L80386DA0 + if(local->unk1){ + local->unk2 = 2; + } + else{ + local->unk2 = 0; + } + }//L80386DB4 + + local->unk1 = 0; + local->unk4[0] = sp58[0]; + local->unk4[1] = sp58[1]; + local->unk4[2] = sp58[2]; + if(this->state == 0x1 && local->unk2 == 1){ + if(--local->unk3 == 0){ + func_80386920(this, 4); + } + else{ + func_80386920(this, 2); + } + }//L80386E4C + + if(this->state == 2){ + if(1.0f <= local->unk14){ + local->unk14 = 1.0f; + } + this->pitch = (f32)local->unk10 + 30.0f*local->unk14; + if(1.0f <= local->unk14){ + func_80386920(this, 3); + } + }//L80386EC0 + + if(this->state == 3){ + if(1.0f <= local->unk14){ + local->unk14 = 1.0f; + } + this->pitch = (f32)local->unk10 + 30.0f*(1.0f - local->unk14); + if(1.0f <= local->unk14){ + func_80386920(this, 1); + } + }//L80386F44 + + if(this->state == 4){ + if(5.0f <= local->unk14){ + local->unk14 = 5.0f; + } + this->pitch = (f32)local->unk10 + 180.0f*(local->unk14/5.0f); + if(5.0f <= local->unk14){ + func_80386920(this, 5); + func_80388EA4(); + } + }//L80386FC0 + } +} diff --git a/src/CC/code_BF0.c b/src/CC/code_BF0.c new file mode 100644 index 00000000..730ea07d --- /dev/null +++ b/src/CC/code_BF0.c @@ -0,0 +1,145 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + s32 unk0; + s32 egg_count; + f32 unk8; +}ActorLocal_CC_BF0; + +void func_803870F8(Actor *this); + +/* .data */ +extern ActorInfo D_80389B00 = { + MARKER_4C_CLANKER_TOKEN_TOOTH_EXT, ACTOR_44_CLANKER_TOKEN_TOOTH_EXTERIOR, ASSET_309_MODEL_CLANKER_TOKEN_TOOTH_EXTERIOR, + 0, NULL, + func_803870F8, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_80389B24 = { + MARKER_4D_CLANKER_JIGGY_TOOTH_EXT, ACTOR_45_CLANKER_JIGGY_TOOTH_EXTERIOR, ASSET_30A_MODEL_CLANKER_JIGGY_TOOTH_EXTERIOR, + 0, NULL, + func_803870F8, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +u8 D_80389F80; + +/* .code */ +void func_80386FE0(Actor *this, s32 next_state){ + ActorLocal_CC_BF0 *local = (ActorLocal_CC_BF0 *)&this->local; + s32 prev_state = this->state; + this->state = next_state; + local->unk8 = 0.0f; + if(this->state == 2){ + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + } + else if(this->state == 3){ + if(prev_state == 2){ + levelSpecificFlags_set((local->unk0 == 1) ? 0 : 1, TRUE); + } + if(local->unk0 == 1){ + this->yaw = -30.0f; + this->pitch = -90.0f; + this->roll = -5.0f; + } + else{ + this->yaw = 30.0f; + this->pitch = 90.0f; + this->roll = 5.0f; + } + } +} + +void func_803870E0(void) { + D_80389F80 = 0; +} + +void func_803870EC(s32 arg0) { + D_80389F80 = arg0; +} + +void func_803870F8(Actor *this){ + ActorMarker *marker = this->marker; + f32 sp70[3]; + ActorLocal_CC_BF0 *local = (ActorLocal_CC_BF0 *)&this->local; + f32 sp68 = time_getDelta(); + f32 sp5C[3]; + f32 sp50[3]; + f32 temp_f2; + s32 flagCnt; + f32 sp3C[3]; + + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + marker->propPtr->unk8_3 = 1; + this->pitch = 0.0f; + this->yaw = 0.0f; + this->roll = 0.0f; + local->unk0 = (marker->modelId == 0x309) ? 1 : 2; + local->egg_count = 0; + func_80386FE0(this, 1); + if(levelSpecificFlags_get((local->unk0 == 1)? LEVEL_FLAG_0_CC_TOKEN_TOOTH_OPEN: LEVEL_FLAG_1_CC_JIGGY_TOOTH_OPEN)){ + func_80386FE0(this, 3); + } + }//L803871D8 + player_getPosition(&sp70); + local->unk8 += sp68; + if(this->state == 2){ + temp_f2 = local->unk8/1; + if(local->unk0 == 1){ + this->yaw = -temp_f2*30.0f; + this->pitch = -temp_f2*90.0f; + this->roll = -temp_f2*5.0f; + + }//L8038726C + else{ + this->yaw = temp_f2*30.0f; + this->pitch = temp_f2*90.0f; + this->roll = temp_f2*5.0f; + } + }//L803872A0 + + if(local->unk0 == 1){ + func_80388B78(&sp5C, &sp50); + } + else{ + func_80388BBC(&sp5C, &sp50); + }//L803872D4 + TUPLE_COPY(this->position, sp5C); + + if(this->state == 1) + func_8028E668(&this->position, 290.0f, -10.0f, 150.0f); + + if(this->state == 1 && D_80389F80 == local->unk0){ + D_80389F80 = 0; + local->egg_count++; + if(local->egg_count == 3){ + func_80386FE0(this, 2); + }else{ + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + } + } + else if(this->state == 2 && 1.0f <= local->unk8){ + flagCnt = levelSpecificFlags_get(LEVEL_FLAG_0_CC_TOKEN_TOOTH_OPEN) + levelSpecificFlags_get(LEVEL_FLAG_1_CC_JIGGY_TOOTH_OPEN); + if(!jiggyscore_isCollected(JIGGY_1B_CC_TOOTH)){ + func_80311480((local->unk0 == 1)? + ((flagCnt == 0)? 0xd30 : 0xd31) : + ((flagCnt == 0)? 0xd2e : 0xd2f), 4, NULL, NULL, NULL, NULL); + } + func_80386FE0(this, 3); + }//L80387474 + + if(this->state == 3){ + sp3C[0] = this->position_x; + sp3C[1] = this->position_y + 100; + sp3C[2] = this->position_z; + if(ml_vec3f_distance(&sp3C, &sp70) < 120.0f){ + func_8031D04C(0x22, (local->unk0 == 1)? 7 : 6); + } + }//L80387500 +} diff --git a/src/CCW/code_0.c b/src/CCW/code_0.c new file mode 100644 index 00000000..8025906d --- /dev/null +++ b/src/CCW/code_0.c @@ -0,0 +1,37 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_803864B8(Actor *this); + +extern ActorInfo D_8038EB50 = { 0x1AC, 0x298, 0x444, 0x0, NULL, func_803864B8, NULL, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038EB74 = { 0x1AC, 0x29A, 0x445, 0x0, NULL, func_803864B8, NULL, func_80325888, 0, 0, 0.0f, 0}; + +/* .code */ +void func_803863F0(Actor *this, s32 next_state){ + if(next_state == 2){ + FUNC_8030E8B4(SFX_2F_ORANGE_SPLAT, 1.0f, 32000, this->position, 500, 3000); + levelSpecificFlags_set(0x10, TRUE); + marker_despawn(this->marker); + } + this->state = next_state; +} + +void func_80386468(ActorMarker* marker, ActorMarker *arg1) { + Actor* actor = marker_getActor(marker); + if (actor->state == 1 && map_get() == MAP_44_CCW_SUMMER) { + func_803863F0(actor, 2); + } +} + +void func_803864B8(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + marker_setCollisionScripts(this->marker, NULL, NULL, func_80386468); + func_803863F0(this, 1); + if(levelSpecificFlags_get(0x10)){ + marker_despawn(this->marker); + } + } +} diff --git a/src/CCW/code_14B0.c b/src/CCW/code_14B0.c new file mode 100644 index 00000000..4f3a783c --- /dev/null +++ b/src/CCW/code_14B0.c @@ -0,0 +1,125 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8030DBFC(u8, f32, f32, f32); +extern void sfxsource_setSampleRate(u8, s32); + +typedef struct{ + s16 unk0; + u8 unk2; + u8 unk3; + s16 unk4; +}Struct_CCW_14B0_0; + +typedef struct { + u8 unk0; + // u8 pad1[3]; + Struct_CCW_14B0_0 *unk4; + f32 unk8; + f32 unkC[3]; + f32 unk18[3]; +}ActorLocal_CCW_14B0; + +void func_80387A40(Actor *this); + +/* .data */ +extern Struct_CCW_14B0_0 D_8038EC00[]; +extern ActorInfo D_8038EC14 = { 0x1AF, 0x29C, 0x446, 0x0, NULL, func_80387A40, NULL, func_80325888, 0, 0, 1.0f, 0}; + +/* .code */ +void func_803878A0(Actor *this, s32 next_state) { + ActorLocal_CCW_14B0 *local = (ActorLocal_CCW_14B0 *)&this->local; + int i; + + if (next_state == 1) { + if (func_8033567C(this->unk148) != 0x16F) { + func_80335924(this->unk148, 0x16F, 0.1f, 0.65f); + } + for(i = 0; i < 10; i++){ + local->unkC[0] = randf2(-500.0f, 500.0f); + local->unkC[1] = randf2(400.0f, 900.0f); + local->unkC[2] = randf2(-400.0f, 700.0f); + if(ml_vec3f_distance(this->position, local->unkC) > 800.0f) + break; + } + local->unk8 = randf2(500.0f, 1000.0f); + } + this->state = next_state; +} + +void func_80387A20(Actor *this){ + ActorLocal_CCW_14B0 *local = (ActorLocal_CCW_14B0 *)&this->local; + func_8030DA44(local->unk0); +} + +void func_80387A40(Actor *this) { + ActorLocal_CCW_14B0 *local; + f32 sp68; + f32 sp5C[3]; + f32 sp58; + f32 sp54; + f32 sp50; + f32 sp44[3]; + + local = (ActorLocal_CCW_14B0 *)&this->local; + sp68 = time_getDelta(); + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->marker->unk30 = func_80387A20; + local->unk4 = &D_8038EC00[0]; + while((local->unk4->unk0 != 0) && (map_get() != local->unk4->unk0)) { + local->unk4++; + } + local->unk0 = func_8030D90C(); + local->unk18[0] = local->unk18[1] = local->unk18[2] = 0.0f; + sfxsource_setSfxId(local->unk0, 0x3FA); + func_8030DD14(local->unk0, 2); + func_8030DBB4(local->unk0, 0.9f); + sfxsource_setSampleRate(local->unk0, 0); + func_803878A0(this, 1); + return; + } + + if (this->state == 1) { + sp5C[0] = local->unkC[0] - this->position[0]; + sp5C[1] = local->unkC[1] - this->position[1]; + sp5C[2] = local->unkC[2] - this->position[2]; + if (ml_vec3f_distance(this->position, local->unkC) < 500.0f) { + ml_vec3f_set_length(sp5C, local->unk8 * 8.0f); + } else { + ml_vec3f_set_length(sp5C, local->unk8 * 2); + } + this->position[0] += (local->unk18[0] * sp68) + (sp5C[0] * sp68 * sp68); + this->position[1] += (local->unk18[1] * sp68) + (sp5C[1] * sp68 * sp68); + this->position[2] += (local->unk18[2] * sp68) + (sp5C[2] * sp68 * sp68); + local->unk18[0] += sp5C[0] * sp68; + local->unk18[1] += sp5C[1] * sp68; + local->unk18[2] += sp5C[2] * sp68; + if (local->unk8 < gu_sqrtf(local->unk18[0]*local->unk18[0] + local->unk18[1]*local->unk18[1] + local->unk18[2]*local->unk18[2])) { + ml_vec3f_set_length(local->unk18, local->unk8); + } + func_80258A4C(this->position, this->yaw - 90.0f, local->unkC, &sp58, &sp54, &sp50); + this->yaw += 140.0f * sp50 * sp68; + if (ml_vec3f_distance(this->position, local->unkC) < 100.0f) { + func_803878A0(this, 1); + } + } + + if(this->position[0]); + + func_8030DBFC(local->unk0, 0.8f, 0.9f, 0.05f); + func_8030DEB4(local->unk0, 500.0f, 1500.0f); + func_8030DF68(local->unk0, this->position); + func_8030E2C4(local->unk0); + sfxsource_setSampleRate(local->unk0, 2000.0f + 8000.0f*(gu_sqrtf(local->unk18[0]*local->unk18[0] + local->unk18[1]*local->unk18[1] + local->unk18[2]*local->unk18[2])/ local->unk8)); + if (!mapSpecificFlags_get(local->unk4->unk2)) { + player_getPosition(sp44); + if (sp44[2] > -600.0f) { + if (!local->unk4->unk3 || !jiggyscore_isCollected(local->unk4->unk3) ) { + func_80311480(local->unk4->unk4, 4, NULL, NULL, NULL, NULL); + mapSpecificFlags_set(local->unk4->unk2, TRUE); + } + } + } +} diff --git a/src/CCW/code_160.c b/src/CCW/code_160.c new file mode 100644 index 00000000..8a6f2376 --- /dev/null +++ b/src/CCW/code_160.c @@ -0,0 +1,217 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + ActorMarker *unk0; + s32 unk4; + s32 unk8; + f32 unkC; +}ActorLocal_CCW_160; + +void func_803865F4(Actor *this, s32 next_state); +void func_8038687C(Actor *this); + +/* .data */ +extern ActorInfo D_8038EBA0 = { 0x1AD, 0x299, 0x443, 0x0, NULL, func_8038687C, NULL, func_80325888, 0, 0, 0.0f, 0}; + +/* .code */ +void func_80386550(ActorMarker *marker){ + Actor *this; + ActorLocal_CCW_160 *local; + + + this = marker_getActor(marker); + local = (ActorLocal_CCW_160 *)&this->local; + this->unk124_11 = 2; + this->alpha_124_19 = 0xFF; + if (local->unk0 != NULL) { + actor_collisionOn(marker_getActor(local->unk0)); + } + func_8025A6EC(COMUSIC_3D_JIGGY_SPAWN, 28000); +} + +void func_803865C4(ActorMarker* marker, enum asset_e text_id, s32 arg2) { + func_803865F4(marker_getActor(marker), 3); +} + +void func_803865F4(Actor *this, s32 next_state) { + ActorLocal_CCW_160 *local; + + local = (ActorLocal_CCW_160 *)&this->local; + local->unkC = 0.0f; + if (next_state == 2) { + if (!func_80320454(0xB5, 1)) { + func_80311480(0xCE2, 4, NULL, this->marker, func_803865C4, NULL); + } else { + func_80311480(0xCE3, 4, NULL, NULL, NULL, NULL); + func_803865F4(this, 3); + return; + } + } + + if (next_state == 3) { + local->unkC = 0.1f; + func_8025A58C(0, 4000); + func_8025A6EC(COMUSIC_4B_CCW_ZUBBA_FIGHT, 30000); + } + + if (next_state == 4) { + if (func_803203FC(2)) { + item_set(ITEM_6_HOURGLASS, FALSE); + func_803204E4(3, 0); + func_803204E4(5, 1); + } else { + func_80311480(0xCE4, 4, NULL, NULL, NULL, NULL); + func_8025A58C(-1, 400); + comusic_8025AB44(COMUSIC_4B_CCW_ZUBBA_FIGHT, 0, 400); + func_8025AABC(COMUSIC_4B_CCW_ZUBBA_FIGHT); + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + func_80324E38(0.0f, 3); + timed_setCameraToNode(2.0f, 4); + timedFunc_set_1(2.0f, (TFQM1)func_80386550, (s32) this->marker); + func_80324E88(4.0f); + func_80324E38(4.0f, 0); + } + } + this->state = next_state; +} + +void func_803867C8(ActorMarker *marker){ + Actor *this; + ActorLocal_CCW_160 *local; + + this = marker_getActor(marker); + local = (ActorLocal_CCW_160 *)&this->local; + local->unk8++; + local->unk4--; + if(local->unk8 == 10){ + func_803865F4(this, 4); + } +} + +void func_80386814(ActorMarker *marker){ + Actor *this; + ActorLocal_CCW_160 *local; + + this = marker_getActor(marker); + local = (ActorLocal_CCW_160 *)&this->local; + local->unk4--; +} + +void func_80386840(ActorMarker *marker, s32 *score, s32 *total){ + Actor *this; + ActorLocal_CCW_160 *local; + + this = marker_getActor(marker); + local = (ActorLocal_CCW_160 *)&this->local; + + *score = local->unk8; + *total = 10; +} + +void func_8038687C(Actor *this) { + ActorLocal_CCW_160 *local; + f32 sp88; + Actor *other; + f32 sp78[3]; + f32 sp6C[3]; + s32 pad68; + f32 sp5C[3]; + s32 phi_s0; + f32 sp4C[3]; + f32 sp40[3]; + s32 phi_v0; + f32 tmp; + + sp88 = time_getDelta(); + local = (ActorLocal_CCW_160 *)&this->local; + if(!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + local->unk0 = 1; + local->unk4 = 0; + local->unk8 = 0; + local->unkC = 0.0f; + if (func_803203FC(2)) { + this->position_y -= 300.0f; + } + func_803865F4(this, 1); + return; + } + if ((s32)local->unk0 == 1) { + other = func_80326EEC(0x46); + if(func_803203FC(2)) { + local->unk0 = NULL; + if (other != NULL) { + actor_collisionOff(other); + other->position[1] -= 300.0f; + } + } else if (other != NULL) { + local->unk0 = other->marker; + actor_collisionOff(other); + if (jiggyscore_isCollected(JIGGY_4C_CCW_ZUBBAS) != 0) { + marker_despawn(local->unk0); + marker_despawn(this->marker); + } + } else { + marker_despawn(this->marker); + } + return; + } + + if (local->unk0 != NULL) { + other = marker_getActor(local->unk0); + func_8024C5CC(sp78); + sp6C[0] = this->position[0] - sp78[0]; + sp6C[1] = this->position[1] - sp78[1]; + sp6C[2] = this->position[2] - sp78[2]; + sp6C[1] = 0.0f; + ml_vec3f_set_length(sp6C, 20.0f); + other->position[0] = this->position[0] + sp6C[0]; + other->position[1] = this->position[1] + sp6C[1]; + other->position[2] = this->position[2] + sp6C[2]; + } + if (func_8025773C(&local->unkC, sp88)) { + if ((local->unk4 < 3) && ((local->unk8 + local->unk4) < 10)) { + player_getPosition(sp5C); + for(phi_s0 = 0; phi_s0 < 20; phi_s0++){ + sp4C[0] = randf2(-500.0f, 500.0f); + sp4C[1] = -100.0f; + sp4C[2] = randf2(-500.0f, 900.0f); + + if(ml_vec3f_distance(this->position, sp4C) < 400.0f) + continue; + + tmp = ml_vec3f_distance(sp5C, sp4C); + phi_v0 = (phi_s0 < 0xA) ? 500 : 200; + if(tmp < (f32) phi_v0) + continue; + + if(func_8024DC04(sp4C[0], 0.0f, sp4C[2])) + break; + + } + func_802C3F04(func_802C4140, 0x29B, reinterpret_cast(s32, sp4C[0]), reinterpret_cast(s32, sp4C[1]), reinterpret_cast(s32, sp4C[2])); + local->unk4++; + } + local->unkC = randf2(0.5 - ((local->unk8 / 10) * 0.4), 1.0 - ((local->unk8 / 10) * 0.8)); + } + if (this->state == 1) { + if (func_803203FC(2) && func_803203FC(3)) { + item_set(ITEM_6_HOURGLASS, 1); + item_set(ITEM_0_HOURGLASS_TIMER, 1800 - 1); + func_803865F4(this, 3); + } else if ((local->unk0 != NULL) && (map_get() == MAP_5A_CCW_SUMMER_ZUBBA_HIVE)) { + player_getPosition(sp40); + if ((ml_vec3f_distance(this->position, sp40) < 300.0f) && (player_getTransformation() == TRANSFORM_1_BANJO)) { + func_803865F4(this, 2); + } + } + } + if ((this->state == 3) && func_803203FC(2) && item_empty(ITEM_0_HOURGLASS_TIMER)) { + item_set(ITEM_6_HOURGLASS, 0); + func_803204E4(3, 0); + func_803204E4(5, 0); + } +} diff --git a/src/CCW/code_1B20.c b/src/CCW/code_1B20.c new file mode 100644 index 00000000..ac5af406 --- /dev/null +++ b/src/CCW/code_1B20.c @@ -0,0 +1,162 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + s16 unk0; + u8 unk2; + u8 unk3; + s16 unk4; + s16 unk6; + s16 unk8; + s16 unkA; +}Struct_CCW_1B20_0; + +typedef struct{ + Struct_CCW_1B20_0 *unk0; +}ActorLocal_CCW_1B20; + +void func_80387F64(Actor *this, s32 next_state); +Actor *func_803882F4(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80388478(Actor *this); + +/* .data */ +extern Struct_CCW_1B20_0 D_8038EC40[4]; +extern ActorInfo D_8038EC70 = { 0x1B0, 0x29D, 0x447, 0x0, NULL, func_80388478, NULL, func_803882F4, 0, 0, 1.0f, 0}; +extern f32 D_8038EC94[3]; + +/* .code */ +void func_80387F10() { + jiggySpawn(JIGGY_4D_CCW_FLOWER, D_8038EC94); +} + +void func_80387F38(ActorMarker* marker, s32 arg1) { + func_80387F64(marker_getActor(marker), arg1); +} + +void func_80387F64(Actor *this, s32 next_state){ + ActorLocal_CCW_1B20 *local; + f32 phi_f22; + + local = (ActorLocal_CCW_1B20 *)&this->local; + + if (next_state == 1) { + this->marker->propPtr->unk8_3 = local->unk0->unk3; + func_80335924(this->unk148, local->unk0->unk0, 0.0f, 5.0f); + func_80335A8C(this->unk148, local->unk0->unk2); + } + if (next_state == 2) { + if (map_get() == MAP_43_CCW_SPRING) { + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + } + func_80320004(local->unk0->unk8, 1); + func_80335924(this->unk148, local->unk0->unk4, 0.0f, 6.0f); + func_80335A8C(this->unk148, 2); + if (map_get() == MAP_43_CCW_SPRING) { + func_80324E38(0.0f, 3); + } + timed_setCameraToNode(0.0f, 0); + for( phi_f22 = 0.0f; phi_f22 <= 1.0f; phi_f22 += 0.1) { + timed_playSfx(phi_f22 * 5.7, 0x2C, phi_f22 * 0.3 + 0.7, (s32) (32000.0f - phi_f22 * 5000.0f)); + } + if (local->unk0->unkA != 0) { + timed_setCameraToNode(6.0f, 1); + timedFunc_set_0(6.1f, func_80387F10); + timedFunc_set_2(8.0f, func_80387F38, (s32) this->marker, 3); + } else { + if (map_get() == MAP_43_CCW_SPRING) { + func_80324E88(7.0f); + func_80324E38(7.0f, 0); + } + timedFunc_set_2(7.0f, func_80387F38, (s32) this->marker, 3); + } + } + + if (next_state == 3) { + this->marker->propPtr->unk8_3 = TRUE; + func_80335924(this->unk148, local->unk0->unk6, 0.1f, 5.0f); + func_80335A8C(this->unk148, 1); + } + this->state = next_state; +} + + + +bool func_80388260(ActorMarker *marker, s32 arg1){ + return marker->unk40_31 != 1; +} + +void func_80388278(ActorMarker *marker, ActorMarker *other_marker) { + func_8025A6EC(COMUSIC_2B_DING_B, 28000); +} + +void func_803882A4(ActorMarker* marker, ActorMarker *other_marker) { + Actor* actor = marker_getActor(marker); + + if (map_get() == MAP_43_CCW_SPRING && actor->state == 1) { + func_80387F64(actor, 2); + } +} + +Actor *func_803882F4(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *this; + s32 sp18; + + this = marker_getActor(marker); + if ((this->state == 1) && !func_8031FF1C(0xE3)) { + return func_80325340(marker, gfx, mtx, vtx); + } + + if ((func_8033567C(this->unk148) == 0x175) && (0.49 <= func_80335684(this->unk148))) { + sp18 = 1; + } else { + sp18 = 0; + } + sp18 = (func_8033567C(this->unk148) == 0x183)? 1 : sp18; + func_8033A45C(3, sp18); + func_8033A45C(4, sp18); + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_803883F4() { + Actor* actor = func_80326EEC(0x29D); + if (actor && actor->state == 1) { + func_80387F64(actor, 2); + } +} + +bool func_80388438() { + Actor* actor = func_80326EEC(0x29D); + if (actor && actor->state == 2) { + return TRUE; + } + return FALSE; +} + +void func_80388478(Actor *this) { + ActorLocal_CCW_1B20 *local; + + local = (ActorLocal_CCW_1B20 *)&this->local; + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + func_803300C0(this->marker, func_80388260); + marker_setCollisionScripts(this->marker, NULL, func_80388278, func_803882A4); + actor_collisionOn(this); + if (!jiggyscore_isSpawned(JIGGY_4D_CCW_FLOWER)) { + func_80320004(0xE5, FALSE); + } + + for(local->unk0 = &D_8038EC40[0]; local->unk0 < D_8038EC40 + 3; local->unk0++){ + if(!func_8031FF1C(local->unk0->unk8)){ + break; + } + } + + if (!func_8031FF1C(0xE3) && (map_get() != MAP_43_CCW_SPRING)) { + marker_despawn(this->marker); + } + else{ + func_80387F64(this, 1); + } + } +} diff --git a/src/CCW/code_21A0.c b/src/CCW/code_21A0.c new file mode 100644 index 00000000..295a1bba --- /dev/null +++ b/src/CCW/code_21A0.c @@ -0,0 +1,34 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_803885F8(Actor *this); + +/* .data */ +extern ActorInfo D_8038ECA0 = { + 0x1C2, 0x30B, 0x4E3, + 0x0, NULL, + func_803885F8, NULL, func_80325888, + 0, 0, 1.0f, 0 +}; + +/* .code */ +void func_80388590(Actor *this, s32 next_state){ + if(next_state == 1){ + func_80335924(this->unk148, 0x219, 0.0f, 1.0f); + func_80335A8C(this->unk148, 4); + } + this->state = next_state; +} + +void func_803885F8(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(func_8031FF1C(0xe5)){ + func_80388590(this, 1); + } + else{ + marker_despawn(this->marker); + } + } +} diff --git a/src/CCW/code_2270.c b/src/CCW/code_2270.c new file mode 100644 index 00000000..78927edc --- /dev/null +++ b/src/CCW/code_2270.c @@ -0,0 +1,207 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + s16 map_id; + s16 unk2; + s16 unk4; + s16 unk6; +}Struct_CCW_2270_0; + +typedef struct{ + Struct_CCW_2270_0 *unk0; + void *unk4; + void *unk8; +}ActorLocal_CCW_2270; + +void func_8038868C(Actor *this, s32 next_state); +Actor *func_803889AC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80388AA0(Actor *this); + +/* .data */ +extern Struct_CCW_2270_0 D_8038ECD0[]; +extern ActorInfo D_8038ECE8 = { 0x1B1, 0x29E, ASSET_3E0_MODEL_GOBI, 0x0, NULL, func_80388AA0, func_80388AA0, func_803889AC, 0, 0, 1.0f, 0}; + +/* .code */ +void func_80388660(ActorMarker* marker, s32 arg1) { + func_8038868C(marker_getActor(marker), arg1); +} + +void func_8038868C(Actor *this, s32 next_state) { + ActorLocal_CCW_2270 *local; + + local = (ActorLocal_CCW_2270*)&this->local; + + if (next_state == 1) { + func_80335924(this->unk148, ASSET_F4_ANIM_GOBI_IDLE, 0.5f, 12.0f); + } + if (next_state == 2) { + if (local->unk0->unk4 != 0) { + func_80311480(local->unk0->unk4, 4, NULL, NULL, NULL, NULL); + } + func_80335924(this->unk148, ASSET_FC_ANIM_GOBI_SPITTING, 0.2f, 3.0f); + func_80335A8C(this->unk148, 2); + func_80335924(local->unk4, ASSET_100_ANIM_GOBI_SPIT, 0.0f, 3.0f); + func_80335A8C(local->unk4, 2); + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.0f, (map_get() == MAP_44_CCW_SUMMER) ? 1 : 2); + timed_playSfx(0.05f, SFX_84_GOBI_CRYING, 1.1f, 32000); + timed_playSfx(0.8f, SFX_4B_GULPING, 0.8f, 28000); + timed_playSfx(1.4f, SFX_4B_GULPING, 0.8f, 28000); + timed_playSfx(2.0f, SFX_4B_GULPING, 0.8f, 28000); + timedFunc_set_2(3.2f, (TFQM2) func_80388660, (s32) this->marker, 3); + } + if (next_state == 3) { + func_803883F4(); + } + if (next_state == 4) { + func_80335924(this->unk148, ASSET_176_ANIM_GOBI_YAWN, 0.5f, 4.0f); + func_80335A8C(this->unk148, 2); + func_80324E88(0.0f); + func_80324E38(0.0f, 0); + } + if (next_state == 5) { + if (local->unk0->unk6 != 0) { + func_80311480((s32) local->unk0->unk6, 4, NULL, NULL, NULL, NULL); + } + func_80335924(this->unk148, ASSET_FD_ANIM_GOBI2_GETTING_UP, 0.23f, 0.5f); + timed_setCameraToNode(0.0f, 3); + } + if (next_state == 6) { + func_80335924(this->unk148, ASSET_F8_ANIM_GOBI_RUNNING, 0.1f, 0.71f); + func_80335A8C(this->unk148, 1); + } + if (next_state == 7) { + func_80324E88(0.0f); + func_80324E38(0.0f, 0); + marker_despawn(this->marker); + } + + this->state = next_state; +} + +void func_8038894C(ActorMarker* marker, ActorMarker *other_marker) { + Actor* actor = marker_getActor(marker); + if (actor->state == 1) { + actor_collisionOff(actor); + timedFunc_set_2(0.5f, (TFQM2)func_80388660, (s32)actor->marker, 2); + } +} + +Actor *func_803889AC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this; + ActorLocal_CCW_2270 *local; + f32 sp2C[3]; + + this = marker_getActor(marker); + local = (ActorLocal_CCW_2270*)&this->local; + + if (this->state == 2) { + sp2C[0] = this->pitch; + sp2C[1] = this->yaw; + sp2C[2] = this->roll; + + func_8033A238(func_803356A0(local->unk4, local)); + set_model_render_mode(2); + func_803391A4(gfx, mtx, this->position, sp2C, 1.0f, NULL, local->unk8); + } + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_80388A70(Actor *this){ + ActorLocal_CCW_2270 *local = (ActorLocal_CCW_2270*)&this->local; + + func_80335874(local->unk4); + assetcache_release(local->unk8); +} + +void func_80388AA0(Actor *this) { + ActorLocal_CCW_2270 *local; + f32 sp48[3]; + f32 sp44; + f32 sp40; + + local = (ActorLocal_CCW_2270*)&this->local; + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + this->marker->unk30 = func_80388A70; + this->unk138_24 = FALSE; + local->unk4 = func_803358B4(); + local->unk8 = assetcache_get(0x3F3); + marker_setCollisionScripts(this->marker, 0, func_8038894C, 0); + if(!jiggyscore_isSpawned(JIGGY_4D_CCW_FLOWER)) { + func_80320004(0xE5, 0); + } + local->unk0 = &D_8038ECD0[0]; + while((local->unk0->map_id != 0) && (map_get() != local->unk0->map_id)) { + local->unk0++; + } + + if( (map_get() == MAP_44_CCW_SUMMER) && func_8031FF1C(0xE3) && !func_8031FF1C(0xE4)) { + func_8038868C(this, 1); + } else if( (map_get() == MAP_45_CCW_AUTUMN) && func_8031FF1C(0xE4) && !func_8031FF1C(0xE5) ) { + func_8038868C(this, 1); + } else{ + marker_despawn(this->marker); + } + return; + } + if(this->state == 1){ + if (!this->unk138_24) { + player_getPosition(sp48); + if (ml_vec3f_distance(this->position, sp48) < 600.0f) { + if (local->unk0->unk2 != 0) { + func_80311480((s32) local->unk0->unk2, 4, NULL, NULL, NULL, NULL); + } + this->unk138_24 = TRUE; + } + } + } + + if (this->state == 2) { + func_80335A94(local->unk4, time_getDelta(), 1); + } + + if(this->state == 3){ + if (!func_80388438()) { + if (map_get() == MAP_44_CCW_SUMMER) { + func_8038868C(this, 4); + } else { + func_8038868C(this, 5); + } + } + } + + if (this->state == 4) { + if ((func_8033567C(this->unk148) == ASSET_176_ANIM_GOBI_YAWN) && (func_80335794(this->unk148) > 0)) { + func_80335924(this->unk148, ASSET_177_ANIM_GOBI_SLEEP, 0.1f, 4.0f); + func_80335A8C(this->unk148, 1); + } + if (func_8033567C(this->unk148) == ASSET_177_ANIM_GOBI_SLEEP) { + func_8033568C(this->unk148, &sp44, &sp40); + if ((sp44 < 0.1) && (0.1 <= (f64) sp40)) { + FUNC_8030E8B4(SFX_5E_BANJO_PHEWWW, 0.8f, 15000, this->position, 500, 1500); + } + if ((sp44 < 0.8) && (0.8 <= (f64) sp40)) { + FUNC_8030E8B4(SFX_5D_BANJO_RAAOWW, 0.8f, 15000, this->position, 500, 1500); + + } + } + } + + if (this->state == 5){ + if(func_80335794(this->unk148) > 0) { + func_8038868C(this, 6); + } + } + + if (this->state == 6) { + func_80326224(this); + if (0.99 < (f64) this->unk48) { + func_8038868C(this, 7); + } + } +} + diff --git a/src/CCW/code_2B00.c b/src/CCW/code_2B00.c new file mode 100644 index 00000000..6360e709 --- /dev/null +++ b/src/CCW/code_2B00.c @@ -0,0 +1,170 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + u8 unk0; + u8 unk1; + u8 unk2; + u8 unk3; +}Struct_CCW_2B00_0; + +void func_80389268(Actor *this); +void func_80388FD4(Actor *this); + +/* .data */ +Struct_CCW_2B00_0 D_8038ED10[] = { + {0, 0x40, 0, 5}, + {0, 0x43, 1, 5}, + {0, 0x44, 2, 5}, + {0, 0x45, 3, 15} +}; + +ActorAnimationInfo D_8038ED20[] = { + {0, 0.0f}, + {0, 0.0f}, + {0, 0.0f}, + {0, 0.0f}, + {ASSET_D4_ANIM_SWITCH_DOWN, 0.5f}, + {ASSET_D4_ANIM_SWITCH_DOWN, 100000000.0f} +}; + +ActorInfo D_8038ED50 = { 0x133, 0x1E3, 0x52E, 0x1, NULL, func_80389268, func_80326224, func_80325E78, 0, 0x4000, 0.0f, 0}; +ActorInfo D_8038ED74 = { 0x132, 0x1E2, 0x4F5, 0x5, D_8038ED20, func_80388FD4, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +ActorInfo D_8038ED98 = { 0x131, 0x16D, 0x52E, 0x1, NULL, func_80389268, func_80326224, func_80325E78, 0, 0x4000, 0.0f, 0}; +ActorInfo D_8038EDBC = { 0x130, 0x16C, 0x4F6, 0x5, D_8038ED20, func_80388FD4, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +ActorInfo D_8038EDE0 = { 0x12F, 0x16B, 0x52E, 0x1, NULL, func_80389268, func_80326224, func_80325E78, 0, 0x4000, 0.0f, 0}; +ActorInfo D_8038EE04 = { 0x12E, 0x16A, 0x4F7, 0x5, D_8038ED20, func_80388FD4, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +ActorInfo D_8038EE28 = { 0x12D, 0x169, 0x52E, 0x1, NULL, func_80389268, func_80326224, func_80325E78, 0, 0x4000, 0.0f, 0}; +ActorInfo D_8038EE4C = { 0x12C, 0x168, 0x4F8, 0x5, D_8038ED20, func_80388FD4, func_80326224, func_80325888, 0, 0, 0.0f, 0}; + +/* .code */ +s32 func_80388EF0(Actor *this){ + switch(this->marker->unk14_20){ + case 0x133: //L80388F28 + case 0x132: //L80388F28 + return 0; + + case 0x131: //L80388F30 + case 0x130: //L80388F30 + return 1; + + case 0x12F: //L80388F38 + case 0x12E: //L80388F38 + return 2; + + case 0x12D: //L80388F40 + case 0x12C: //L80388F40 + return 3; + + default: + return 0; + } +} + + +void func_80388F50(ActorMarker *marker, ActorMarker *other_marker){ + Actor *this; + + this = marker_getActor(marker); + if ((func_8028ECAC() != 1) && !this->unk38_0) { + this->unk38_0 = TRUE; + actor_collisionOff(this); + func_80328B8C(this, 4, 0.0f, 1); + actor_playAnimationOnce(this); + func_8030E6D4(SFX_90_SWITCH_PRESS); + } +} + +void func_80388FD4(Actor *this) { + + if (!this->initialized) { + this->unk138_31 = this->unk124_0 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + this->unk10_12 = func_80388EF0(this); + this->initialized = TRUE; + } + if (!this->unk16C_4) { + if (func_8031FF1C(this->unk10_12 + 0x8B)) { + actor_playAnimationOnce(this); + func_80328B8C(this, 4, 0.999f, 1); + actor_collisionOff(this); + } else { + marker_setCollisionScripts(this->marker, 0, &func_80388F50, 0); + } + this->unk38_0 = FALSE; + this->unk16C_4 = TRUE; + } + if( (this->state == 4) + && this->unk38_0 + && actor_animationIsAt(this, 0.999f) + ){ + func_802D6264(1.1f, 0x40, this->unk10_12 + 0x3C, 0x2B, D_8038ED10[this->unk10_12].unk3, this->unk10_12 + 0x8B); + func_80324E38(0.5f, 3); + timedFunc_set_2(1.1f, levelSpecificFlags_set, this->unk10_12 + 7, TRUE); + func_80324E38(5.6f, 0); + } +} + +void func_803891B0(void* marker) { + Actor* actor = marker_getActor(reinterpret_cast(ActorMarker*, marker)); + actor->unk44_31 = func_8030ED2C(SFX_3EC_CCW_DOOR_OPENING, 3); + func_8030DD90(actor->unk44_31, 0); + sfxsource_setSampleRate(actor->unk44_31, 0x2AF8); + func_8030DBB4(actor->unk44_31, 0.3f); + func_8030E2C4(actor->unk44_31); +} + +void func_8038921C(void* marker) { + Actor* actor = marker_getActor(reinterpret_cast(ActorMarker*, marker)); + func_8030E394(actor->unk44_31); + func_8030DA44(actor->unk44_31); + actor->unk44_31 = 0U; + FUNC_8030E624(SFX_6C_LOCKUP_CLOSING, 1.0f, 25000); +} + +void func_80389268(Actor *this) { + ActorProp *temp_v1; + u32 temp_v0; + u32 temp_v1_2; + + if(!this->initialized) { + this->unk58_2 = FALSE; + this->unk10_12 = func_80388EF0(this); + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + this->initialized = TRUE; + } + if (!this->unk16C_4) { + this->unk1C[0] = this->position[0]; + this->unk1C[1] = this->position[1]; + this->unk1C[2] = this->position[2]; + this->unk1C[1] += 250.0f; + + this->unk16C_4 = TRUE; + if (func_8031FF1C(this->unk10_12 + 0x8B)) { + func_80328A84(this, 3); + } + } + + + switch (this->state) { /* irregular */ + case 1: + if (levelSpecificFlags_get(this->unk10_12 + 7)) { + timedFunc_set_1(0.05f, func_803891B0, (s32) this->marker); + timedFunc_set_1(4.0f, func_8038921C, (s32) this->marker); + func_80328A84(this, 2); + } + break; + case 2: + this->position[1] += 60.0f * time_getDelta(); + if (this->unk1C[1] <= this->position[1]) { + levelSpecificFlags_set(this->unk10_12 + 7, FALSE); + func_80328A84(this, 3); + } + break; + case 3: + this->position[1] = this->unk1C[1]; + break; + } +} diff --git a/src/CCW/code_3050.c b/src/CCW/code_3050.c new file mode 100644 index 00000000..6078defe --- /dev/null +++ b/src/CCW/code_3050.c @@ -0,0 +1,69 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *func_8038954C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_803895F4(Actor *this); + +/* .data */ +extern ActorInfo D_8038EE70 = { 0x1B3, 0x2A0, 0x483, 0x0, NULL, func_803895F4, NULL, func_8038954C, 0, 0, 0.0f, 0}; + +/* .code */ +void func_80389440(Actor *this, s32 next_state) { + void *temp_v0; + + if (next_state == 2) { + func_8030E510(SFX_AA_BGS_EGG_BREAKING_1, 28000); + this->marker->propPtr->unk8_3 = FALSE; + func_80320004(0xE6, 1); + func_80335924(this->unk148, 0x187, 0.0f, 2.0f); + func_80335A8C(this->unk148, 2); + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.0f, 2); + func_80324E88(8.0f); + func_80324E38(8.0f, 0); + } + this->state = next_state; +} + +void func_8038950C(ActorMarker* marker, ActorMarker* other_marker) { + Actor* actor = marker_getActor(marker); + if (actor->state == 1) { + func_80389440(actor, 2); + } +} + +Actor *func_8038954C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *this; + + this = marker_getActor(marker); + if (this->state == 0) + return this; + + func_8033A45C(3, (this->state < 2) ? 1 : 0); + func_8033A45C(4, (this->state < 2) ? 0 : 1); + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_803895F4(Actor *this) { + f32 sp2C; + f32 sp28; + + if(!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + marker_setCollisionScripts(this->marker, NULL, NULL, &func_8038950C); + func_80389440(this, 1); + if ((func_8031FF1C(0xE6) != 0) || jiggyscore_isSpawned(JIGGY_49_CCW_EYRIE)) { + marker_despawn(this->marker); + } + return; + } + + if (this->state == 2) { + func_8033568C(this->unk148, &sp2C, &sp28); + if ((sp2C < 0.5) && (sp28 >= 0.5)) { + func_80326310(this); + } + } +} diff --git a/src/CCW/code_3310.c b/src/CCW/code_3310.c new file mode 100644 index 00000000..fa021c00 --- /dev/null +++ b/src/CCW/code_3310.c @@ -0,0 +1,251 @@ +#include +#include "functions.h" +#include "variables.h" + + +typedef struct { + f32 unk0; + s16 unk4; + f32 unk8; + s16 unkC; +}Struct_CCW_3310_1; + +typedef struct { + s16 map_id; + s16 unk2; + s16 unk4; + s16 unk6; + Struct_CCW_3310_1 *unk8; + s16 unkC; + s16 unkE; + Struct_CCW_3310_1 *unk10; + s16 unk14; + // u8 pad16[2]; + Struct_CCW_3310_1 *unk18; + s16 unk1C; + // u8 pad1E[0x2]; + Struct_CCW_3310_1 *unk20; + u8 unk24; + u8 unk25; + s16 unk26; + s16 unk28; + // u8 pad2A[2]; +}Struct_CCW_3310_0; + +typedef struct { + Struct_CCW_3310_0 *unk0; + u8 unk4; + //u8 pad5[3]; + Struct_CCW_3310_1 *unk8; + s32 unkC[3]; +}ActorLocal_CCW_3310; + +Actor *func_80389B24(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80389BFC(Actor *this); + +/* .data */ +extern Struct_CCW_3310_1 D_8038F060[]; +extern Struct_CCW_3310_0 D_8038F080[]; +extern ActorInfo D_8038F130 = { 0x1B4, 0x2A1, 0x484, 0x0, NULL, func_80389BFC, NULL, func_80389B24, 0, 0, 0.0f, 0}; + +/* .bss */ +extern f32 D_8038FDE0[3]; + +/* .code */ +void func_80389700(ActorMarker *marker, enum asset_e text_id, s32 arg2) { + func_80324E88(0.5f); + func_80324E38(0.5f, 0); +} + +void func_80389740(ActorMarker *marker) { + Actor *this = marker_getActor(marker); + if (this->marker->unk14_21) { + func_802C3F04(func_802C4140, 0x30C, reinterpret_cast(s32, D_8038FDE0[0]), reinterpret_cast(s32, D_8038FDE0[1]), reinterpret_cast(s32, D_8038FDE0[2])); + } +} + +void func_80389798() { + func_8030E6D4(SFX_18C_EYRIE_MAMA); +} + +void func_803897B8(Actor *this, s32 next_state) { + ActorLocal_CCW_3310 *local; + + local = (ActorLocal_CCW_3310 *)&this->local; + local->unk8 = NULL; + if (next_state == 1) { + if (local->unk0->unk6 != 0) { + func_80335924(this->unk148, local->unk0->unk6, 0.2f, 6.0f); + func_80335A8C(this->unk148, 1); + } + local->unk8 = local->unk0->unk8; + } + if ((this->state == 1) && (next_state == 2)) { + func_80320004(local->unk0->unk4, TRUE); + } + if (next_state == 5) { + func_8028F784(1); + func_80335924(this->unk148, local->unk0->unk26, 0.2f, 2.0f); + func_80335A8C(this->unk148, 2); + local->unk8 = &D_8038F060[0]; + } + + if (next_state == 2) { + func_80335924(this->unk148, local->unk0->unkE, 0.2f, 8.0f); + func_80335A8C(this->unk148, 2); + func_80324E38(0.5f, 3); + timed_setCameraToNode(0.5f, local->unk0->unk24); + func_80324E88(16.5f); + func_80324E38(16.5f, 0); + local->unk8 = local->unk0->unk10; + } + if (next_state == 3) { + actor_collisionOff(this); + func_80335924(this->unk148, local->unk0->unk14, 0.5f, 8.5f); + func_80335A8C(this->unk148, 2); + if (local->unk0->map_id == MAP_43_CCW_SPRING) { + func_80311480(0xCD6, 4, NULL, NULL, NULL, NULL); + func_8033579C(this->unk148, 0x3F266666, &func_80389798); + } + if (local->unk0->map_id == MAP_44_CCW_SUMMER) { + func_80311480(0xCD9, 4, NULL, NULL, NULL, NULL); + } + if (local->unk0->map_id == MAP_45_CCW_AUTUMN) { + func_80311480(0xCDB, 4, NULL, NULL, NULL, NULL); + } + local->unk8 = local->unk0->unk18; + } + if (next_state == 4) { + func_8028F784(0); + func_80335924(this->unk148, local->unk0->unk1C, 0.2f, 6.0f); + func_80335A8C(this->unk148, 1); + func_80335800(this->unk148, 0.2f, func_80389740, this->marker); + func_80335800(this->unk148, 0.3f, func_80389740, this->marker); + func_80335800(this->unk148, 0.4f, func_80389740, this->marker); + func_80335800(this->unk148, 0.72f, func_80389740, this->marker); + func_80335800(this->unk148, 0.82f, func_80389740, this->marker); + func_80335800(this->unk148, 0.92f, func_80389740, this->marker); + local->unk8 = local->unk0->unk20; + } + this->state = next_state; +} + +Actor *func_80389B24(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this; + ActorLocal_CCW_3310 *local; + + this = marker_getActor(marker); + local = (ActorLocal_CCW_3310 *)&this->local; + if( (this->state == 0) + || ((this->state == 1) && (local->unk0->unk6 == 0)) + ) { + return this; + } + func_8033A45C(3, (this->state == 4) ? 2 : 1); + func_80325888(marker, gfx, mtx, vtx); + func_8034A174(func_80329934(), 5, D_8038FDE0); + return this; +} + +void func_80389BD8(f32 dst[3]){ + dst[0] = D_8038FDE0[0]; + dst[1] = D_8038FDE0[1]; + dst[2] = D_8038FDE0[2]; +} + +void func_80389BFC(Actor *this) { + Struct_CCW_3310_1 *iPtr; + ActorLocal_CCW_3310 *local; + f32 sp5C; + f32 sp58; + f32 sp4C[3]; + + local = (ActorLocal_CCW_3310 *)&this->local; + + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + this->unk138_24 = FALSE; + this->position[0] = -4900.0f; + this->position[1] = 4619.0f; + this->position[2] = 0.0f; + D_8038FDE0[0] = this->position[0]; + D_8038FDE0[1] = this->position[1]; + D_8038FDE0[2] = this->position[2]; + if (this->state == 0) { + local->unk4 = 0U; + } + local->unk0 = &D_8038F080[0]; + while(local->unk0->map_id != 0 && map_get() != local->unk0->map_id){ + local->unk0++; + } + + if ((local->unk0->unk2 != 0) && !func_8031FF1C(local->unk0->unk2)) { + marker_despawn(this->marker); + } else if (!func_8031FF1C(local->unk0->unk4)) { + func_803897B8(this, 1); + } else { + func_803897B8(this, 4); + } + + if (jiggyscore_isSpawned(JIGGY_49_CCW_EYRIE) != 0) { + marker_despawn(this->marker); + } + return; + } + + if (local->unk8) { + func_8033568C(this->unk148, &sp5C, &sp58); + for(iPtr = local->unk8; iPtr->unk0 > 0.0f; iPtr ++){ + if ((sp5C < iPtr->unk0) && (iPtr->unk0 <= sp58)) { + func_8030E878((s32) iPtr->unk4, randf2(iPtr->unk8 - 0.05, iPtr->unk8 + 0.05), iPtr->unkC, this->position, 500.0f, 2500.0f); + } + } + } + if (this->state == 1) { + player_getPosition(sp4C); + if( !this->unk138_24 + && (local->unkC[2] >= 6500) + && (sp4C[2] < 6500.0f) + && (local->unk0->unk28 != 0) + ){ + this->unk138_24 = TRUE; + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.0f, local->unk0->unk24); + func_80324DBC(0.0f, local->unk0->unk28, 6, NULL, this->marker, func_80389700, NULL); + } + local->unkC[0] = (s32) sp4C[0]; + local->unkC[1] = (s32) sp4C[1]; + local->unkC[2] = (s32) sp4C[2]; + if (item_getCount(ITEM_22_CATERPILLAR) == 0) { + func_8028F784(0); + } + if ((local->unk0->map_id != MAP_43_CCW_SPRING) && ((this->position[0] + 500.0f) < sp4C[0])) { + func_8028F364(this->position, 1110.0f, 200.0f, ACTOR_2A2_CATERPILLAR, &this); + if ((local->unk0->unkE != 0) && (func_8028E8C0() == ACTOR_2A2_CATERPILLAR) && (ml_vec3f_distance(this->position, sp4C) < 1010.0f) && (func_8028FC34() != 0)) { + func_8028FA54(D_8038FDE0); + if ((local->unk0->map_id == MAP_44_CCW_SUMMER) && (local->unk4 == 0)) { + func_80311480(0xCD8, 4, NULL, NULL, NULL, NULL); + } + local->unk4++; + if (local->unk4 < local->unk0->unk25) { + func_803897B8(this, 5); + } else { + func_803897B8(this, 2); + } + } + } + if (func_8031FF1C(local->unk0->unk4)) { + func_803897B8(this, local->unk0->unkC); + } + } + if ((this->state == 2) && (func_80335794(this->unk148) > 0)) { + func_803897B8(this, 3); + } + if ((this->state == 3) && (func_80335794(this->unk148) > 0)) { + func_803897B8(this, 4); + } + if ((this->state == 5) && (func_80335794(this->unk148) > 0)) { + func_803897B8(this, 1); + } +} diff --git a/src/CCW/code_3DA0.c b/src/CCW/code_3DA0.c new file mode 100644 index 00000000..6dd61181 --- /dev/null +++ b/src/CCW/code_3DA0.c @@ -0,0 +1,187 @@ +#include +#include "functions.h" +#include "variables.h" + +extern ActorMarker *func_8028E86C(void); +extern void func_8028F7D4(f32, f32); + +typedef struct { + f32 unk0[3]; + f32 unkC[3]; + f32 unk18[3]; + f32 unk24; +} ActorLocal_Caterpillar; + +void chcaterpillar_update(Actor *this); +Actor* chcaterpillar_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorInfo chCaterpillar = { + MARKER_1B5_CATERPILLAR, ACTOR_2A2_CATERPILLAR, ASSET_485_MODEL_CATERPILLAR, + 0x0, NULL, + chcaterpillar_update, NULL, chcaterpillar_draw, + 0, 0, 1.0f, 0 +}; + +/* .code */ +f32 func_8038A190(Actor *this, f32 *arg1) { + f32 temp_f0; + f32 temp_f2; + + temp_f0 = func_80309724(arg1); + temp_f2 = this->position[1]; + if (((temp_f2 + 50.0f) < temp_f0) || (temp_f0 < (temp_f2 - 50.0f))) { + return temp_f2; + } + return temp_f0; +} + +void chcaterpillar_setState(Actor *this, s32 next_state) { + ActorLocal_Caterpillar *local = (ActorLocal_Caterpillar *)&this->local; + + if (next_state == 1) { + func_80335924(this->unk148, 0x18D, 0.0f, randf2(1.9f, 2.1f)); + } + if (next_state == 2) { + func_8028F7D4(-25.0f, 90.0f); + func_80335924(this->unk148, 0x18E, 0.2f, 2.0f); + } + if (next_state == 3) { + func_80335924(this->unk148, 0x18E, 0.2f, 2.0f); + local->unkC[0] = this->position[0]; + local->unkC[1] = this->position[1]; + local->unkC[2] = this->position[2]; + local->unk24 = 0.0f; + } + if (next_state == 4) { + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + marker_despawn(this->marker); + } + if (next_state == 5) { + actor_collisionOff(this); + } + this->state = next_state; +} + +Actor* chcaterpillar_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + if(this->state == 5){ + return func_80325340(marker, gfx, mtx, vtx); + } + return func_80325888(marker, gfx, mtx, vtx); +} + +void chcaterpillar_update(Actor *this){ + bool sp8C; + ActorLocal_Caterpillar *local = (ActorLocal_Caterpillar *)&this->local; + f32 sp84; + enum map_e map_id; + f32 sp74[3]; + f32 sp70; + f32 sp6C; + f32 sp68; + f32 sp64; + f32 sp60; + f32 sp54[3]; + int i; + + sp8C = func_8028E86C() == this->marker; + sp84 = time_getDelta(); + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + local->unk0[0] = this->position[0]; + local->unk0[1] = this->position[1]; + local->unk0[2] = this->position[2]; + if(sp8C){ + chcaterpillar_setState(this, 2); + } + else{//L8038A408 + map_id = map_get(); + if ( !func_8031FF1C(BKPROG_E6_SPRING_EYRIE_HATCHED) + || ( map_id == MAP_45_CCW_AUTUMN && !func_8031FF1C(BKPROG_E7_SUMMER_EYRIE_FED)) + ) { + chcaterpillar_setState(this, 5); + } else { + chcaterpillar_setState(this, 1); + }//L8038A45C + } + }//L8038A45C + + if(this->state == 1){ + func_8033568C(this->unk148, &sp64, &sp60); + player_getPosition(sp74); + if(ml_vec3f_distance(this->position, local->unk0) < 10.0f){ + for(i = 0; i < 10; i++){ + + local->unk0[0] = randf2(-300.0f, 300.0f) + this->position_x; + local->unk0[1] = this->position_y; + local->unk0[2] = randf2(-300.0f, 300.0f) + this->position_z; + if( !(ml_vec3f_distance(local->unk0, this->position) < 50.0f) && func_80329210(this, local->unk0)) + break; + }//L8038A544 + if(i == 10){ + local->unk0[0] = this->position[0];\ + local->unk0[1] = this->position[1];\ + local->unk0[2] = this->position[2]; + }//L8038A564 + if (i); + local->unk0[1] = func_8038A190(this, local->unk0); + }//L8038A570 + + if(sp64 <= 0.1 && 0.1 < sp60){ + func_8030E878(SFX_AD_CATERPILLAR_SQUEAK, randf2(0.78f, 0.81f), 0x3a98, this->position, 500.0f, 1500.0f); + }//L8038A5EC + + if(0.65 < sp60){ + func_80258A4C(this->position, this->yaw - 90.0f, local->unk0, &sp70, &sp6C, &sp68); + this->yaw += (sp68*100.0f)*sp84; + }//L8038A668 + + if(sp60 <= 0.4){ + sp54[1] = 0.0f; + sp54[2] = 0.0f; + sp54[0] = 65.0f; + ml_vec3f_yaw_rotate_copy(sp54, sp54, this->yaw - 90.0f); + this->position[0] += sp84*sp54[0]; + this->position[2] += sp84*sp54[2]; + if(this->marker->unk14_21){ + this->position[1] = func_8038A190(this, this->position); + } + }//L8038A714 + + if(ml_vec3f_distance(this->position, sp74) < 50.0f){ + func_8028F030(ACTOR_2A2_CATERPILLAR); + if(!func_803203FC(0xb2)){ + func_80311480(0xcc7, 4, NULL, NULL, NULL, NULL); + func_803204E4(0xb2, TRUE); + } + FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 25000, this->position, 0x1f4, 0x9c4); + marker_despawn(this->marker); + } + }//L8038A794 + + if(this->state == 2){ + if(this->unk138_21){ + func_8028F010(ACTOR_2A2_CATERPILLAR); + chcaterpillar_setState(this, 3); + } + else if(!sp8C){ + func_8028F050(ACTOR_2A2_CATERPILLAR); + marker_despawn(this->marker); + } + }//L8038A804 + + if(this->state == 3){ + func_80389BD8(local->unk18); + local->unk24 += 3.3333333333333335*sp84; + + local->unk24 = (1.0 < local->unk24) ? 1.0 : local->unk24; + func_80255FE4(this->position, local->unkC, local->unk18, local->unk24); + + this->position[1] += 50.0f*sinf(local->unk24*3.141592654); + if(1.0 == local->unk24){ + chcaterpillar_setState(this, 4); + } + }//L8038A8FC +} diff --git a/src/CCW/code_4530.c b/src/CCW/code_4530.c new file mode 100644 index 00000000..b0851510 --- /dev/null +++ b/src/CCW/code_4530.c @@ -0,0 +1,107 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + f32 unk0; + f32 unk4; + s16 unk8; + s16 unkA; +}Struct_CCW_4530_0; + +void func_8038A950(Actor *this, s32 next_state); +Actor *func_8038AA38(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_8038AA8C(Actor *this); + +/* .data */ +extern ActorInfo D_8038F190 = { + 0x1B6, 0x2A3, 0x487, + 0x0, NULL, + func_8038AA8C, NULL, func_8038AA38, + 0, 0, 0.0f, 0 +}; +extern Struct_CCW_4530_0 D_8038F1B4[]; + +/* .code */ +void func_8038A920(ActorMarker* marker, enum asset_e text_id, s32 arg2) { + func_8038A950(marker_getActor(marker), 3); +} + +void func_8038A950(Actor *this, s32 next_state) { + if (next_state == 1) { + func_80335924(this->unk148, 0x199, 0.0f, 6.5f); + } + if (next_state == 2) { + func_80311480(0xCDC, 0xA, this->position, this->marker, func_8038A920, NULL); + } + if (next_state == 3) { + func_80335924(this->unk148, 0x19A, 0.0f, 7.0f); + func_80335A8C(this->unk148, 2); + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.0f, 0); + } + if (next_state == 4) { + mapSpecificFlags_set(5, 1); + marker_despawn(this->marker); + } + this->state = next_state; +} + +Actor *func_8038AA38(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this; + + this = marker_getActor(marker); + if(this->state == 0) + return this; + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_8038AA8C(Actor *this) { + f32 sp54[3]; + f32 sp50; + f32 sp4C; + Struct_CCW_4530_0 *iPtr; + f32 sp44; + f32 sp40; + + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + mapSpecificFlags_set(5, FALSE); + if( (!func_8031FF1C(0xE8) || jiggyscore_isSpawned(JIGGY_49_CCW_EYRIE)) + && !func_803203FC(0x1F) + ) { + marker_despawn(this->marker); + } + else{ + func_8038A950(this, 1); + } + return; + } + + if (this->state == 1) { + func_8033568C(this->unk148, &sp50, &sp4C); + if ((sp50 < 0.21) && (0.21 <= sp4C)) { + func_8030E878(0xA5, randf2(0.9f, 1.1f), 32000, this->position, 500.0f, 2500.0f); + } + + if ((sp50 < 0.56) && (0.56 <= sp4C)) { + func_8030E878(0xA5, randf2(0.9f, 1.1f), 32000, this->position, 500.0f, 2500.0f); + } + + player_getPosition(sp54); + if (ml_vec3f_distance(this->position, sp54) < 850.0f) { + func_8038A950(this, 2); + } + } + if (this->state == 3) { + func_8033568C(this->unk148, &sp44, &sp40); + for(iPtr = &D_8038F1B4[0]; iPtr->unk0 > 0.0f; iPtr++){ + if ((sp44 < iPtr->unk0) && (iPtr->unk0 <= sp40)) { + func_8030E878(iPtr->unk8, iPtr->unk4, iPtr->unkA, this->position, 500.0f, 2500.0f); + } + } + if (func_80335794(this->unk148) > 0) { + func_8038A950(this, 4); + } + } +} diff --git a/src/CCW/code_4960.c b/src/CCW/code_4960.c new file mode 100644 index 00000000..f68c9f48 --- /dev/null +++ b/src/CCW/code_4960.c @@ -0,0 +1,100 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + f32 unk0; + f32 unk4; + s16 unk8; + s16 unkA; +}Struct_CCW_4960_0; + +Actor *func_8038AE64(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_8038AEBC(Actor *this); + +/* .data */ +extern ActorInfo D_8038F230 = { + 0x1C4, 0x30E, 0x487, + 0x0, NULL, + func_8038AEBC, func_8038AEBC, func_8038AE64, + 0, 0, 0.0f, 0 +}; +extern Struct_CCW_4960_0 D_8038F254[]; + +/* .code */ +void func_8038AD50(Actor *this, s32 next_state) { + if (next_state == 2) { + func_80311480(0xCDD, 0, NULL, NULL, NULL, NULL); + if (this->state == 1) { + mapSpecificFlags_set(6, 0); + timed_setCameraToNode(0.0f, 1); + } + func_80335924(this->unk148, 0x21D, 0.2f, 0.5f); + func_80335A8C(this->unk148, 1); + } + if (next_state == 3) { + func_80335924(this->unk148, 0x21E, 0.2f, 2.0f); + func_80335A8C(this->unk148, 2); + } + if (next_state == 4) { + func_80324E88(0.0f); + func_80324E38(0.0f, 0); + marker_despawn(this->marker); + } + this->state = next_state; +} + +Actor *func_8038AE64(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this; + + this = marker_getActor(marker); + if(this->state < 2) + return this; + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_8038AEBC(Actor *this) { + Struct_CCW_4960_0 *iPtr; + f32 sp38; + f32 sp34; + f32 sp30; + f32 sp2C; + + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + func_8038AD50(this, 1); + return; + } + if (this->state == 1){ + if(mapSpecificFlags_get(5)) { + mapSpecificFlags_set(5, FALSE); + func_8038AD50(this, 2); + } + } + if (this->state == 2) { + func_80326224(this); + func_8033568C(this->unk148, &sp38, &sp34); + for(iPtr = &D_8038F254[0]; iPtr->unk0 > 0.0f; iPtr++){ + if ((sp38 < iPtr->unk0) && (iPtr->unk0 <= sp34)) { + func_8030E878((s32) iPtr->unk8, iPtr->unk4, iPtr->unkA, this->position, 1500.0f, 4500.0f); + } + } + if (mapSpecificFlags_get(6)) { + mapSpecificFlags_set(6, FALSE); + func_8038AD50(this, 3); + } + if (0.99 < this->unk48) { + func_8038AD50(this, 4); + } + } + if (this->state == 3) { + func_80326224(this); + func_8033568C(this->unk148, &sp30, &sp2C); + if ((sp30 <= 0.5) && (sp2C >= 0.5)) { + jiggySpawn(JIGGY_49_CCW_EYRIE, this->position); + } + if (func_80335794(this->unk148) > 0) { + func_8038AD50(this, 2); + } + } +} diff --git a/src/CCW/code_4D00.c b/src/CCW/code_4D00.c new file mode 100644 index 00000000..31d8aa2c --- /dev/null +++ b/src/CCW/code_4D00.c @@ -0,0 +1,83 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80335A24(void *, s32, f32, f32); + +typedef struct { + f32 unk0; +}ActorLocal_CCW_4D00; + +typedef struct { + f32 unk0; + f32 unk4; + s16 unk8; + s16 unkA; +}Struct_CCW_4D00_0; + +void func_8038B19C(Actor *this); + +/* .data */ +extern ActorInfo D_8038F270 = { 0x1B9, 0x2A6, 0x502, 0x0, NULL, func_8038B19C, NULL, func_80325888, 0, 0, 0.0f, 0}; +extern Struct_CCW_4D00_0 D_8038F294[]; + +/* .code */ +void func_8038B0F0(Actor *this, s32 next_state) { + ActorLocal_CCW_4D00 *local = (ActorLocal_CCW_4D00 *)&this->local; + + local->unk0 = 0.0f; + if (next_state == 1) { + func_80335A24(this->unk148, 0x1A3, 0.2f, 11.0f); + local->unk0 = randf2(3.0f, 10.0f); + } + if (next_state == 2) { + func_80335924(this->unk148, 0x1A4, 0.2f, 3.0f); + } + this->state = next_state; +} + +void func_8038B19C(Actor *this) { + ActorLocal_CCW_4D00 *local; + f32 tick; + Struct_CCW_4D00_0 *iPtr; + f32 sp50; + f32 sp4C; + + local = (ActorLocal_CCW_4D00 *)&this->local; + tick = time_getDelta(); + + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->unk138_24 = FALSE; + func_8038B0F0(this, 1); + } + + if ((this->state == 1) && func_8025773C(&local->unk0, tick)) { + func_8038B0F0(this, 2); + } + + if (this->state == 2) { + func_8033568C(this->unk148, &sp50, &sp4C); + for(iPtr = &D_8038F294[0]; iPtr->unk0 > 0.0f; iPtr++){ + if ((sp50 < iPtr->unk0) && (iPtr->unk0 <= sp4C)) { + func_8030E878(iPtr->unk8, randf2(iPtr->unk4 - 0.05, iPtr->unk4 + 0.05), randi2(iPtr->unkA - 0x1F4, iPtr->unkA + 0x1F4), this->position, 500.0f, 2500.0f); + } + } + + if ((sp50 < 0.97) && (0.97 <= sp4C)) { + if (randf() >= 0.5) { + func_8030E878(SFX_AE_YUMYUM_TALKING, randf2(1.8f, 1.85f), randi2(19000, 21000), this->position, 500.0f, 2500.0f); + } else { + func_8030E878(SFX_4B_GULPING, randf2(1.4f, 1.45f), randi2(24000, 26000), this->position, 500.0f, 2500.0f); + } + } + if (func_80335794(this->unk148) > 0) { + func_8038B0F0(this, 1); + } + } + if (!this->unk138_24 && func_803292E0(this)) { + this->unk138_24 = TRUE; + func_80311480(0xCC8, 0, NULL, NULL, NULL, NULL); + } + func_8028E668(this->position, 300.0f, -50.0f, 120.0f); +} diff --git a/src/CCW/code_50D0.c b/src/CCW/code_50D0.c new file mode 100644 index 00000000..91059ef5 --- /dev/null +++ b/src/CCW/code_50D0.c @@ -0,0 +1,98 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8038B87C(Actor *this); + +/* .data */ +ActorInfo D_8038F300 = { + 0x1BA, 0x2A7, 0x503, + 0x0, NULL, + func_8038B87C, NULL, func_80325888, + 0, 0, 2.0f, 0 +}; + +s32 D_8038F324[] = { + SFX_97_BLUBBER_BURPS, + SFX_3E_POOP_NOISE, + SFX_F6_BLUBBER_TALKING_2, + SFX_F7_BLUBBER_TALKING_3, + SFX_F8_BLUBBER_TALKING_4, + SFX_F5_BLUBBER_TALKING_1, + 0 +}; + +/* .code */ +void func_8038B4C0(ActorMarker *marker) { + Actor *this; + static s32 D_8038F340 = 0; + + this = marker_getActor(marker); + func_8030E878(D_8038F324[D_8038F340], randf2(1.1f, 1.2f), (s32) randf2(31000.0f, 32000.0f), this->position, 500.0f, 2500.0f); + D_8038F340++; + if (D_8038F324[D_8038F340] == 0) { + D_8038F340 = 0; + } +} + +void func_8038B58C(ActorMarker* marker) { + Actor* actor = marker_getActor(marker); + + func_8030E878(0x81, randf2(1.0f, 1.1f), (s32) randf2(31000.0f, 32000.0f), actor->position, 500.0f, 2500.0f); +} + +void func_8038B610(ActorMarker* marker) { + Actor* actor; + s32 temp_s0; + f32 sp24; + s32 sp20; + + actor = marker_getActor(marker); + temp_s0 = func_802F9AA8(SFX_12B_BOILING_AND_BUBBLING); + sp24 = randf2(1.0f, 1.0f); + sp20 = randf2(29000.0f, 32000.0f); + func_802F9DB8(temp_s0, sp24, sp24, 0.0f); + func_802F9EC4(temp_s0, actor->position, 0xC8, 0x7D0); + func_802F9F80(temp_s0, 0.05f, 0.2f, 0.3f); + func_802FA060(temp_s0, sp20, sp20, 0.0f); +} + +void func_8038B6DC(ActorMarker *marker) { + Actor *this; + f32 phi_f20; + int i; + + this = marker_getActor(marker); + func_80335650(this->unk148); + phi_f20 = randf2(0.1f, 0.3f); + for(i = 0; i < 3; i++){ + func_80335800(this->unk148, phi_f20, func_8038B610, this->marker); + phi_f20 += randf2(0.15f, 0.3f); + if(0.85 < phi_f20) + break; + } + func_80335800(this->unk148, 0.35f, func_8038B4C0, this->marker); + func_80335800(this->unk148, 0.63f, func_8038B58C, this->marker); + func_80335800(this->unk148, 0.9f, func_8038B6DC, this->marker); +} + +void func_8038B814(Actor *this, s32 next_state) { + if (next_state == 1) { + func_80335924(this->unk148, 0x22B, 0.2f, 11.0f); + func_8038B6DC(this->marker); + } + this->state = next_state; +} + +void func_8038B87C(Actor *this) { + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->unk138_24 = FALSE; + func_8038B814(this, 1); + } + if (!this->unk138_24 && func_803292E0(this)) { + this->unk138_24 = TRUE; + func_80311480(0xCC9, 0, NULL, NULL, NULL, NULL); + } + func_8028E668(this->position, 300.0f, -50.0f, 120.0f); +} diff --git a/src/CCW/code_5540.c b/src/CCW/code_5540.c new file mode 100644 index 00000000..790fb676 --- /dev/null +++ b/src/CCW/code_5540.c @@ -0,0 +1,171 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + s32 returned_acorn_count; +}ActorLocal_CCW_5540; + +void chnabnut_setState(Actor *this, s32 next_state); +Actor *chnabnut_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void chnabnut_update(Actor *this); + +enum nabnut_state_e{ + NABNUT_STATE_1_SAD = 1, + NABNUT_STATE_2_WAIT, + NABNUT_STATE_3_BACKFLIP, + NABNUT_STATE_4_THANK_PLAYER, + NABNUT_STATE_5_EXIT, + NABNUT_STATE_6_DESPAWN +}; + +/* .data */ +extern f32 D_8038F350[3]; +extern ActorInfo D_8038F35C = { + MARKER_1BB_NABNUT, ACTOR_2A8_NABNUT, ASSET_502_MODEL_NABNUT, + 0x0, NULL, + chnabnut_update, chnabnut_update, chnabnut_draw, + 0, 0, 1.2f, 0 +}; + +/* .code */ +void __chnabnut_setState_method(ActorMarker* marker, s32 next_state) { + chnabnut_setState(marker_getActor(marker), next_state); +} + +void chnabnut_setState(Actor *this, s32 next_state) { + + if (next_state == NABNUT_STATE_1_SAD) { + func_80335924(this->unk148, ASSET_22C_ANIM_NAMBUT_CRY, 0.2f, 10.6f); + } + + if (next_state == NABNUT_STATE_2_WAIT) { + timedFunc_set_2(1.0f, (TFQM2)__chnabnut_setState_method, (s32)this->marker, NABNUT_STATE_3_BACKFLIP); + } + + if (next_state == NABNUT_STATE_3_BACKFLIP) { + this->marker->propPtr->unk8_3 = FALSE; + func_80335924(this->unk148, ASSET_22D_ANIM_NAMBUT_BACKFLIP, 0.2f, 3.13f); + func_80335A8C(this->unk148, 2); + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.0f, 0xB); + func_80311480(0xCCC, 0x20, this->position, NULL, NULL, NULL); + } + + if (next_state == NABNUT_STATE_4_THANK_PLAYER) { + func_80335924(this->unk148, ASSET_22E_ANIM_NAMBUT_STAND, 0.2f, 3.53f); + func_80335A8C(this->unk148, 1); + func_802C8F70(this->yaw - 40.0f); + jiggySpawn(JIGGY_4A_CCW_NABNUT, this->position); + } + + if (next_state == NABNUT_STATE_5_EXIT) { + func_80335924(this->unk148, ASSET_22F_ANIM_NAMBUT_RUN, 0.2f, 0.34f); + } + + if (next_state == NABNUT_STATE_6_DESPAWN) { + func_80324E38(0.0f, 0); + func_80324E88(0.0f); + marker_despawn(this->marker); + } + + this->state = next_state; +} + +Actor *chnabnut_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *this; + Actor *out; + void *sp24; + f32 temp_f2; + + this = marker_getActor(marker); + func_8033A45C(3, 0); + func_8033A45C(4, 0); + func_8033A45C(5, 1); + func_8033A45C(6, 0); + func_8033A45C(7, 1); + func_8033A45C(8, 1); + func_8033A45C(9, 0); + func_8033A45C(0xA, 1); + if (this->state == 1) { + temp_f2 = func_80335684(this->unk148); + if ((0.116 <= temp_f2) && (temp_f2 <= 0.32)) { + sp24 = this->unk130; + this->unk130 = NULL; + func_8033A45C(1, 4); + out = func_80325888(marker, gfx, mtx, vtx); + out->unk130 = sp24; + return out; + } + } + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_8038BC50(f32 dst[3]){ + dst[0] = D_8038F350[0]; + dst[1] = D_8038F350[1]; + dst[2] = D_8038F350[2]; +} + +void chnabnut_update(Actor *this) { + ActorLocal_CCW_5540 *local; + f32 sp30[3]; + f32 sp2C; + f32 sp28; + f32 sp24; + + local = (ActorLocal_CCW_5540 *)&this->local; + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + D_8038F350[0] = this->position[0]; + D_8038F350[1] = this->position[1]; + D_8038F350[2] = this->position[2]; + if (this->state == 0) { + this->unk138_24 = FALSE; + local->returned_acorn_count = NULL; + } + chnabnut_setState(this, 1); + if(jiggyscore_isSpawned(JIGGY_4A_CCW_NABNUT)) { + marker_despawn(this->marker); + } + return; + } + + if (this->state == NABNUT_STATE_1_SAD) { + player_getPosition(sp30); + if (!this->unk138_24 && (ml_vec3f_distance(this->position, sp30) < 400.0f)) { + this->unk138_24 = TRUE; + func_80311480(0xCCA, 0xE, this->position, NULL, NULL, NULL); + } + if (item_getCount(ITEM_23_ACORNS) > 0) { + func_80258A4C(this->position, this->yaw - 90.0f, sp30, &sp2C, &sp28, &sp24); + this->yaw += sp24 * 10.0f; + } + if (this->unk138_24 && !func_803114B0()) { + func_8028F364(this->position, 500.0f, 200.0f, ACTOR_2A9_ACORN, &this); + if ((func_8028E8C0() == ACTOR_2A9_ACORN) && (ml_vec3f_distance(this->position, sp30) < 300.0f) && func_8028FC34()) { + func_8028FA54(D_8038F350); + local->returned_acorn_count++; + if (local->returned_acorn_count == 6) { + chnabnut_setState(this, NABNUT_STATE_2_WAIT); + } else if (item_getCount(ITEM_23_ACORNS) == 1) { + func_80311480(0xCCB, 0x20, this->position, NULL, NULL, NULL); + } + } + } + } + if ((this->state == NABNUT_STATE_3_BACKFLIP) && (func_80335794(this->unk148) > 0)) { + chnabnut_setState(this, NABNUT_STATE_4_THANK_PLAYER); + } + if ((this->state == NABNUT_STATE_4_THANK_PLAYER) && (func_80335794(this->unk148) > 0)) { + chnabnut_setState(this, NABNUT_STATE_5_EXIT); + } + if (this->state == NABNUT_STATE_5_EXIT) { + func_80326224(this); + func_8028FC8C(this->position); + if (0.99 < this->unk48) { + chnabnut_setState(this, NABNUT_STATE_6_DESPAWN); + } + } + func_8028E668(this->position, 300.0f, -50.0f, 120.0f); +} diff --git a/src/CCW/code_5BF0.c b/src/CCW/code_5BF0.c new file mode 100644 index 00000000..14b8be19 --- /dev/null +++ b/src/CCW/code_5BF0.c @@ -0,0 +1,123 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8028E668(f32[3], f32, f32, f32); + +Actor *func_8038C380(ActorMarker* marker, Gfx** gfx, Mtx** mtx, Vtx** vtx); +void func_8038C41C(Actor *this); + +/* .data */ +extern ActorInfo D_8038F380 = { 0x1C6, 0x310, 0x501, 0x0, NULL, func_8038C41C, NULL, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038F3A4 = { 0x1C7, 0x311, 0x462, 0x0, NULL, func_8038C41C, NULL, func_8038C380, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038F3C8 = { 0x1C8, 0x312, 0x463, 0x0, NULL, func_8038C41C, NULL, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038F3EC = { 0x1C9, 0x313, 0x464, 0x0, NULL, func_8038C41C, NULL, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038F410 = { 0x1CA, 0x314, 0x502, 0x0, NULL, func_8038C41C, NULL, func_80325888, 0, 0, 2.0f, 0}; +extern ActorInfo D_8038F434 = { 0x1CB, 0x315, 0x48D, 0x0, NULL, func_8038C41C, NULL, func_8038C380, 0, 0, 0.0f, 0}; + +/* .code */ +void func_8038BFE0(ActorMarker* marker) { + Actor* sp2C = marker_getActor(marker); + func_8030E878(SFX_5D_BANJO_RAAOWW, randf2(1.0f, 1.1f), (s32)randf2(21000.0f, 22000.0f), sp2C->position, 500.0f, 2500.0f); +} + +void func_8038C064(ActorMarker* marker) { + Actor* sp2C = marker_getActor(marker); + func_8030E878(SFX_5E_BANJO_PHEWWW, randf2(1.0f, 1.1f), (s32)randf2(21000.0f, 22000.0f), sp2C->position, 500.0f, 2500.0f); +} + +void func_8038C0E8(ActorMarker* marker) { + Actor* sp24 = marker_getActor(marker); + f32 sp20 = randf2(0.9f, 1.1f); + + func_8030E878(SFX_81_UUU, sp20, (s32)randf2(10000.0f, 31000.0f), sp24->position, 500.0f, 2500.0f); +} + +void func_8038C16C(Actor *this, s32 next_state) { + Actor *other; + + if (next_state == 1) { + this->position[1] -= 300.0f; + } + + if (this->state == 1) { + this->position[1] += 300.0f; + } + + if (next_state == 2) { + if (this->marker->unk14_20 == 0x1CA) { + func_80335924(this->unk148, 0x22E, 0.2f, 3.53f); + func_80335800(this->unk148, 0.1f, func_8038C0E8, this->marker); + } + if (this->marker->unk14_20 == 0x1C7) { + func_80335924(this->unk148, 0x230, 0.2f, 4.0f); + } + if (this->marker->unk14_20 == 0x1CB) { + func_80335924(this->unk148, 0x1A2, 0.2f, 4.0f); + func_80335800(this->unk148, 0.3f, func_8038BFE0, this->marker); + func_80335800(this->unk148, 0.65f, func_8038C064, this->marker); + } + if (this->marker->unk14_20 == 0x1C8) { + func_80335924(this->unk148, 0x231, 0.2f, 4.0f); + } + if ((this->marker->unk14_20 == 0x1C7) || (this->marker->unk14_20 == 0x1CB) || (this->marker->unk14_20 == 0x1C8)) { + other = func_80326EEC(0x313); + if (other != 0) { + this->position[0] = other->position[0]; + this->position[1] = other->position[1]; + this->position[2] = other->position[2]; + this->pitch = other->pitch; + this->yaw = other->yaw; + this->roll = other->roll; + } + } + } + this->state = next_state; +} + +Actor *func_8038C380(ActorMarker* marker, Gfx** gfx, Mtx** mtx, Vtx** vtx) { + func_8033A45C(3, 0); + func_8033A45C(4, 0); + func_8033A45C(5, 0); + func_8033A45C(6, 1); + func_8033A45C(7, 0); + func_8033A45C(8, 0); + func_8033A45C(9, 0); + func_8033A45C(0xA, 1); + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_8038C41C(Actor *this) { + f32 sp2C[3]; + + if (!this->unk16C_4) { + this->marker->propPtr->unk8_3 = TRUE; + this->unk16C_4 = TRUE; + this->unk138_24 = FALSE; + return; + } + + if (this->state == 0) { + if( map_get() == MAP_60_CCW_AUTUMN_NABNUTS_HOUSE + && !jiggyscore_isSpawned(JIGGY_4A_CCW_NABNUT) + && (this->marker->unk14_20 == 0x1C6 || this->marker->unk14_20 == 0x1CA) + ){ + func_8038C16C(this, 1); + } else { + func_8038C16C(this, 2); + } + } + + if ((this->marker->unk14_20 == 0x1CA) && (this->state != 1)) { + func_8028E668(this->position, 300.0f, -50.0f, 120.0f); + } + + if ((this->marker->unk14_20 == 0x1CB) && (this->state == 2)) { + player_getPosition(sp2C); + if (!this->unk138_24 && (ml_vec3f_distance(this->position, sp2C) < 400.0f)) { + this->unk138_24 = TRUE; + func_80311480(0xCCD, 0, NULL, NULL, NULL, NULL); + } + } +} + diff --git a/src/CCW/code_61E0.c b/src/CCW/code_61E0.c new file mode 100644 index 00000000..93e75ad6 --- /dev/null +++ b/src/CCW/code_61E0.c @@ -0,0 +1,100 @@ +#include +#include "functions.h" +#include "variables.h" + +extern ActorMarker *func_8028E86C(void); + +typedef struct { + f32 unk0[3]; + f32 unkC[3]; + f32 unk18; +}ActorLocal_CCW_61E0; + +void func_8038C7A8(Actor *this); + +/* .data */ +extern ActorInfo D_8038F460 = { 0x1BC, 0x2A9, 0x48E, 0x0, NULL, func_8038C7A8, NULL, func_80325888, 0, 0, 0.8f, 0}; + +/* .code */ +void func_8038C5D0(ActorMarker* marker) { + Actor* actor = marker_getActor(marker); + func_8030E878(SFX_3F2_UNKNOWN, randf2(0.95f, 1.05f), 26000, actor->position, 500.0f, 1000.0f); +} + +void func_8038C638(ActorMarker* marker) { + Actor* actor = marker_getActor(marker); + func_8030E878(SFX_5_BANJO_LANDING_01, randf2(0.95f, 1.05f), 22000, actor->position, 500.0f, 1000.0f); +} + +void func_8038C6A0(Actor *this, s32 next_state) { + ActorLocal_CCW_61E0 *local; + + local = (ActorLocal_CCW_61E0 *)&this->local; + if (next_state == 1) { + func_80335924(this->unk148, 0x25B, 0.0f, 1.0f); + func_80335800(this->unk148, 0.5f, func_8038C5D0, this->marker); + func_80335800(this->unk148, 0.7f, func_8038C638, this->marker); + } + if (next_state == 3) { + local->unk0[0] = this->position[0]; + local->unk0[1] = this->position[1]; + local->unk0[2] = this->position[2]; + func_8038BC50(local->unkC); + local->unk18 = 0.0f; + } + if (next_state == 4) { + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + marker_despawn(this->marker); + } + if (next_state == 5) { + marker_despawn(this->marker); + } + this->state = next_state; +} + + +void func_8038C7A8(Actor *this) { + bool sp4C; + ActorLocal_CCW_61E0 *local; + f32 sp44; + f32 sp38[3]; + + local = (ActorLocal_CCW_61E0 *)&this->local; + sp44 = time_getDelta(); + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + return; + } + + sp4C = (func_8028E86C() == this->marker); + if (this->state == 0) { + func_8038C6A0(this, sp4C ? 2 : 1); + } + + if (this->state == 1) { + player_getPosition(sp38); + if (ml_vec3f_distance(this->position, sp38) < 50.0f) { + func_8028F030(0x2A9); + FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 25000, this->position, 500, 2500); + func_8038C6A0(this, 5); + } + } + if (this->state == 2) { + if (this->unk138_21) { + func_8028F010(0x2A9); + func_8038C6A0(this, 3); + } else if (!sp4C) { + func_8028F050(0x2A9); + func_8038C6A0(this, 5); + } + } + if (this->state == 3) { + local->unk18 += 3.3333333333333333 * sp44; + local->unk18 = (local->unk18 > 1.0) ? 1.0 : local->unk18; + func_80255FE4(this->position, local->unk0, local->unkC, local->unk18); + this->position[1] += 50.0f * sinf(local->unk18 * RARE_PI); + if (local->unk18 == 1.0) { + func_8038C6A0(this, 4); + } + } +} diff --git a/src/CCW/code_6620.c b/src/CCW/code_6620.c new file mode 100644 index 00000000..fdb709ad --- /dev/null +++ b/src/CCW/code_6620.c @@ -0,0 +1,114 @@ +#include +#include "functions.h" +#include "variables.h" + +extern ParticleEmitter *func_802EDD8C(f32[3], f32, f32); + +typedef struct{ + s16 map_id; + s16 unk2; + s16 unk4; +}Struct_CCW_6620_0; + +typedef struct{ + Struct_CCW_6620_0 *unk0; + f32 unk4[3]; +}ActorLocal_CCW_6620; + +Actor *func_8038CBF0(ActorMarker *this, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_8038CC4C(Actor *this); + +/* .data */ +extern Struct_CCW_6620_0 D_8038F490[]; +extern ActorInfo D_8038F4A8 = { 0x1BD, 0x2AA, 0x48F, 0x0, NULL, func_8038CC4C, NULL, func_8038CBF0, 0, 0, 2.2f, 0}; + +/* .code */ +void func_8038CA10(ActorMarker *marker) { + Actor *this; + ActorLocal_CCW_6620 *local; + ParticleEmitter *pCtrl; + + this = marker_getActor(marker); + local = (ActorLocal_CCW_6620 *)&this->local; + + if (this->marker->unk14_21) { + if (0.65 < (f64) randf()) { + pCtrl = func_802EDD8C(local->unk4, 0.0f, this->position[1] + 500.0f); + func_802EFB70(pCtrl, 0.04f, 0.05f); + func_802EFB84(pCtrl, 0.18f, 0.2f); + particleEmitter_setParticleSpawnPositionRange(pCtrl, -10.0f, 0.0f, -10.0f, 10.0f, 20.0f, 10.0f); + particleEmitter_setParticleVelocityRange(pCtrl, 0.0f, 31.0f, 0.0f, 0.0f, 37.0f, 0.0f); + particleEmitter_emitN(pCtrl, 1); + } + } +} + +void func_8038CB40(Actor *this, s32 next_state) { + int i; + + if (next_state == 1) { + func_80335924(this->unk148, 0x289, 0.2f, 1.1f); + for(i = 0; i < 10; i++){ + func_80335800(this->unk148, randf(), func_8038CA10, this->marker); + } + } + this->state = next_state; +} + + +Actor *func_8038CBF0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *this; + ActorLocal_CCW_6620 *local; + + this = func_80325888(marker, gfx, mtx, vtx); + local = (ActorLocal_CCW_6620 *)&this->local; + if (this->marker->unk14_21) { + func_8034A174(func_80329934(), 5, local->unk4); + } + return this; +} + +void func_8038CC4C(Actor *this) { + ActorLocal_CCW_6620 *local; + f32 sp50[3]; + f32 sp4C; + f32 sp48; + f32 sp44; + f32 sp38[3]; + + local = (ActorLocal_CCW_6620 *)&this->local; + if (!this->unk16C_4) { + this->marker->propPtr->unk8_3 = TRUE; + this->unk16C_4 = TRUE; + this->unk138_24 = FALSE; + local->unk0 = &D_8038F490[0]; + while(local->unk0->map_id != 0 && map_get() != local->unk0->map_id){ + local->unk0++; + } + func_8038CB40(this, 1); + if (jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY)) { + levelSpecificFlags_set(0x25, TRUE); + } + if ((local->unk0->unk2 != 0) && levelSpecificFlags_get(0x25)) { + marker_despawn(this->marker); + } + return; + } + + if (this->state == 1 && this->marker->unk14_21) { + player_getPosition(sp50); + func_80258A4C(this->position, this->yaw - 90.0f, sp50, &sp4C, &sp48, &sp44); + if (sp4C > 100.0f) { + this->yaw += 30.0f * sp44; + } + } + if (!this->unk138_24) { + player_getPosition(sp38); + if (ml_vec3f_distance(this->position, sp38) < 900.0f) { + if (local->unk0->map_id != MAP_46_CCW_WINTER || func_8028F2FC()) { + func_80311480(local->unk0->unk4, 4, NULL, NULL, NULL, NULL); + this->unk138_24 = TRUE; + } + } + } +} diff --git a/src/CCW/code_6AC0.c b/src/CCW/code_6AC0.c new file mode 100644 index 00000000..4b3ab244 --- /dev/null +++ b/src/CCW/code_6AC0.c @@ -0,0 +1,114 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + f32 unk0; + f32 unk4; + s16 unk8; + s16 unkA; +}Struct_CCW_6AC0_0; + +void func_8038CFB4(Actor *this); + +/* .data */ +extern ActorInfo D_8038F4D0 = { + 0x1BE, 0x2AB, 0x48F, + 0x0, NULL, + func_8038CFB4, func_8038CFB4, func_80325888, + 0, 0, 2.2f, 0 +}; + +extern Struct_CCW_6AC0_0 D_8038F4F4[]; +extern Struct_CCW_6AC0_0 D_8038F53C[]; +extern Struct_CCW_6AC0_0 D_8038F5D8[]; + +/* .code */ +void func_8038CEB0(Actor *this, s32 next_state) { + ActorProp *temp_v0; + + if (next_state == 1) { + func_80335924(this->unk148, 0x1A6, 0.2f, 4.5f); + } + if (next_state == 2) { + this->marker->propPtr->unk8_3 = FALSE; + func_80335924(this->unk148, 0x1A7, 0.2f, 3.0f); + func_80335A8C(this->unk148, 2); + func_80311480(0xCD0, 0x24, NULL, NULL, NULL, NULL); + } + if (next_state == 3) { + func_80335924(this->unk148, 0x1A8, 0.2f, 0.5f); + func_80335A8C(this->unk148, 1); + } + if (next_state == 4) { + marker_despawn(this->marker); + } + this->state = next_state; +} + +void func_8038CFB4(Actor *this) { + Struct_CCW_6AC0_0 *phi_s0; + f32 sp70; + f32 sp6C; + f32 sp60[3]; + + if (!this->unk16C_4) { + this->marker->propPtr->unk8_3 = TRUE; + this->unk16C_4 = TRUE; + this->unk138_24 = FALSE; + func_8038CEB0(this, 1); + if (jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY) != 0) { + levelSpecificFlags_set(0x25, 1); + } + if (levelSpecificFlags_get(0x25) != 0) { + marker_despawn(this->marker); + } + return; + } + + if (this->state == 1) { + phi_s0 = &D_8038F4F4; + } else if (this->state == 2) { + phi_s0 = &D_8038F53C; + } else if (this->state == 3) { + phi_s0 = &D_8038F5D8; + } else{ + phi_s0 = NULL; + } + + if (phi_s0 != NULL) { + func_8033568C(this->unk148, &sp70, &sp6C); + while(phi_s0->unk0 > 0.0f){ + if (((sp70 < phi_s0->unk0) || (sp6C < sp70)) && (phi_s0->unk0 <= sp6C)) { + func_8030E878(phi_s0->unk8, randf2(phi_s0->unk4 - 0.05, phi_s0->unk4 + 0.05), randi2(phi_s0->unkA - 200, phi_s0->unkA + 100), this->position, 500.0f, 1500.0f); + } + phi_s0++; + } + } + + if (this->state == 1) { + if (!this->unk138_24) { + player_getPosition(&sp60); + if (ml_vec3f_distance(this->position, &sp60) < 900.0f) { + func_80311480(0xCCF, 4, NULL, NULL, NULL, NULL); + this->unk138_24 = TRUE; + } + } + if (levelSpecificFlags_get(0x25) != 0) { + func_8038CEB0(this, 2); + } + } + + if (this->state == 2){ + if((func_80335794(this->unk148) > 0)) { + func_8038CEB0(this, 3); + } + } + + if (this->state == 3) { + func_80326224(this); + if (0.99 < (f64) this->unk48) { + func_8038CEB0(this, 4); + } + } +} diff --git a/src/CCW/code_6EC0.c b/src/CCW/code_6EC0.c new file mode 100644 index 00000000..ab2facc6 --- /dev/null +++ b/src/CCW/code_6EC0.c @@ -0,0 +1,79 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + s16 map; + s16 unk2; + s16 unk4; +}Struct_CCW_6EC0_0; + +typedef struct{ + Struct_CCW_6EC0_0 *unk0; +}ActorLocal_CCW_6EC0; + +void func_8038D368(Actor *this); +Actor *func_8038D30C(ActorMarker* marker, Gfx** gfx, Mtx** mtx, Vtx** vtx); + +/* .data */ +extern Struct_CCW_6EC0_0 D_8038F600[]; + +extern ActorInfo D_8038F614 = { + 0x1CE, 0x31A, 0x48F, + 0x0, NULL, + func_8038D368, NULL, func_8038D30C, + 0, 0, 2.2f, 0 +}; + +/* .code */ +void func_8038D2B0(Actor *this, s32 next_state) { + if (next_state == 1) { + func_80335924(this->unk148, 0x1A6, 0.2f, 5.5f); + } + + this->state = next_state; +} + +Actor *func_8038D30C(ActorMarker* marker, Gfx** gfx, Mtx** mtx, Vtx** vtx) { + if (levelSpecificFlags_get(0x25) == 0) { + return func_80325340(marker, gfx, mtx, vtx); + } + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_8038D368(Actor *this) { + ActorLocal_CCW_6EC0 *local; + f32 plyr_pos[3]; + + local = (ActorLocal_CCW_6EC0 *)&this->local; + if (!this->unk16C_4) { + this->marker->propPtr->unk8_3 = TRUE; + this->unk16C_4 = TRUE; + this->unk138_24 = FALSE; + local->unk0 = D_8038F600; + while (local->unk0->map != 0 && map_get() != local->unk0->map) { + local->unk0++; + } + + func_8038D2B0(this, 1); + if (jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY)) { + levelSpecificFlags_set(0x25, TRUE); + } + return; + } + + if(!this->unk138_24){ + player_getPosition(plyr_pos); + if (ml_vec3f_distance(this->position, plyr_pos) < 600.0f) { + if (!jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY)) { + func_80311480(local->unk0->unk2, 4, NULL, NULL, NULL, NULL); + } else { + if (local->unk0->unk4) { + func_80311480(local->unk0->unk4, 4, NULL, NULL, NULL, NULL); + } + } + this->unk138_24 = TRUE; + } + } + +} diff --git a/src/CCW/code_7120.c b/src/CCW/code_7120.c new file mode 100644 index 00000000..d7aded4c --- /dev/null +++ b/src/CCW/code_7120.c @@ -0,0 +1,114 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + f32 unk0; +} ActorLocal_CCW_7120; + +void func_8038D85C(Actor *this); + +/* .data */ +extern ActorInfo D_8038F640 = { + 0x1BF, 0x2AC, 0x490, + 0x0, NULL, + func_8038D85C, NULL, func_80325888, + 0, 0, 2.2f, 0 +}; +extern s32 D_8038F664[3]; +extern struct42s D_8038F670; +extern struct43s D_8038F6A0; + +void func_8038D510(Actor *this) { + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(6); + particleEmitter_setSprite(pCtrl, ASSET_70E_SPRITE_SMOKE_2); + func_802EFA5C(pCtrl, 0.01f, 0.5f); + particleEmitter_setStartingFrameRange(pCtrl, 0, 7); + particleEmitter_setPosition(pCtrl, this->position); + func_802EFB70(pCtrl, 1.0f, 2.0f); + func_802EFB84(pCtrl, 3.0f, 4.0f); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038F670); + func_802EFFA8(pCtrl, D_8038F664); + func_802EFEC0(pCtrl, 3.0f, 4.0f); + particleEmitter_emitN(pCtrl, 6); +} + +void func_8038D5DC(Actor *this) { + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(30); + func_802EF9F8(pCtrl, 0.6f); + func_802EFA18(pCtrl, 3); + particleEmitter_setModel(pCtrl, 0x896); + particleEmitter_setPosition(pCtrl, this->position); + func_802EFB70(pCtrl, 0.05f, 0.3f); + func_802EFE24(pCtrl, + -600.0f, -600.0f, -600.0f, + 600.0f, 600.0f, 600.0f + ); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 10.0f, 10.0f); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8038F6A0); + particleEmitter_emitN(pCtrl, 30); +} + +void func_8038D6D8(Actor *this, s32 next_state) { + ActorLocal_CCW_7120 *local = (ActorLocal_CCW_7120 *)&this->local; + + local->unk0 = 0.0f; + if (next_state == 2) { + this->marker->propPtr->unk8_3 = FALSE; + func_802BB3DC(0, 60.0f, 0.7f); + func_8038D510(this); + func_8038D5DC(this); + FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.3f, 15000); + FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.5f, 15000); + FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.7f, 15000); + FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.9f, 15000); + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.5f, 3); + timedFunc_set_2(0.5f, levelSpecificFlags_set, 0x25, TRUE); + func_80324E88(4.0f); + func_80324E38(4.0f, 0); + local->unk0 = 0.5f; + marker_despawn(this->marker); + } + if (next_state == 3) { + marker_despawn(this->marker); + } + this->state = next_state; +} + +void func_8038D81C(ActorMarker* marker, ActorMarker *other_marker) { + Actor* actor = marker_getActor(marker); + if (actor->state == 1) { + func_8038D6D8(actor, 2); + } +} + +void func_8038D85C(Actor *this) { + ActorLocal_CCW_7120 *local = (ActorLocal_CCW_7120 *)&this->local; + f32 tick; + + tick = time_getDelta(); + if (!this->unk16C_4) { + this->marker->propPtr->unk8_3 = TRUE; + this->unk16C_4 = TRUE; + marker_setCollisionScripts(this->marker, 0, &func_8038D81C, 0); + func_8038D6D8(this, 1); + if (jiggyscore_isCollected(JIGGY_4B_CCW_GNAWTY) != 0) { + levelSpecificFlags_set(0x25, 1); + } + if ((levelSpecificFlags_get(0x25) != 0) && (map_get() != MAP_43_CCW_SPRING)) { + marker_despawn(this->marker); + } + return; + } + if(this->state == 2){ + if (func_8025773C(&local->unk0, tick) ) { + func_8038D6D8(this, 3); + } + } +} diff --git a/src/CCW/code_7570.c b/src/CCW/code_7570.c new file mode 100644 index 00000000..57d4d9ae --- /dev/null +++ b/src/CCW/code_7570.c @@ -0,0 +1,40 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8038D9E0(Actor *this); + +/* .data */ +extern ActorInfo D_8038F6F0 = { 0x1C3, 0x30C, 0x4E4, 0x0, NULL, func_8038D9E0, NULL, func_80325888, 0, 0, 0.0f, 0}; + +/* .code */ +void func_8038D960(Actor *this, s32 next_state) { + if (next_state == 1) { + func_80335924(this->unk148, 0x21C, 0.0f, 6.0f); + func_80335A8C(this->unk148, 2); + } + if (next_state == 2) { + func_80326310(this); + } + this->state = next_state; +} + +void func_8038D9E0(Actor *this) { + f32 sp24; + f32 sp20; + ActorMarker *temp_v0; + + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->unk124_9 = 2; + this->marker->unk40_22 = TRUE; + func_8038D960(this, 1); + } + if (this->state == 1) { + this = this; + func_8033568C(this->unk148, &sp24, &sp20); + if ((sp24 < 0.25f) && (sp20 >= 0.25f)) { + func_8038D960(this, 2); + } + } +} diff --git a/src/CCW/code_76C0.c b/src/CCW/code_76C0.c new file mode 100644 index 00000000..91f09d99 --- /dev/null +++ b/src/CCW/code_76C0.c @@ -0,0 +1,155 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + +extern void func_802D3D54(Actor *); +extern void func_802D3D74(Actor *); +extern void func_80325F84(Actor *); + + +extern ActorInfo D_8038EB50; +extern ActorInfo D_8038EB74; +extern ActorInfo D_8038EBA0; +extern ActorInfo D_8038EBD0; +extern ActorInfo D_8038EC14; +extern ActorInfo D_8038EC70; +extern ActorInfo D_8038ECA0; +extern ActorInfo D_8038ECE8; +extern ActorInfo D_8038EE70; +extern ActorInfo D_8038F130; +extern ActorInfo chCaterpillar; +extern ActorInfo D_8038F190; +extern ActorInfo D_8038F230; +extern ActorInfo D_8038F6F0; +extern ActorInfo D_8038ED50; +extern ActorInfo D_8038ED98; +extern ActorInfo D_8038EDE0; +extern ActorInfo D_8038EE28; +extern ActorInfo D_8038ED74; +extern ActorInfo D_8038EDBC; +extern ActorInfo D_8038EE04; +extern ActorInfo D_8038EE4C; +extern ActorInfo D_8038F270; +extern ActorInfo D_8038F300; +extern ActorInfo D_8038F35C; +extern ActorInfo D_8038F380; +extern ActorInfo D_8038F3A4; +extern ActorInfo D_8038F3C8; +extern ActorInfo D_8038F3EC; +extern ActorInfo D_8038F410; +extern ActorInfo D_8038F434; +extern ActorInfo D_8038F460; +extern ActorInfo D_8038F4A8; +extern ActorInfo D_8038F4D0; +extern ActorInfo D_8038F614; +extern ActorInfo D_8038F640; +extern ActorInfo D_8038F908; +extern ActorInfo D_8038F8C0; +extern ActorInfo D_8038F720; +extern ActorInfo D_8038F744; +extern ActorInfo D_8038F768; +extern ActorInfo D_8038F78C; +extern ActorInfo D_8038F988; +extern ActorInfo D_8038FA00; +extern ActorInfo D_8038F7D4; +extern ActorInfo D_8038F7B0; +extern ActorInfo D_8038F888; +extern ActorInfo D_8038F7F8; +extern ActorInfo D_8038F81C; +extern ActorInfo D_8038F840; +extern ActorInfo D_8038F864; + +void func_8038DB0C(Actor *this); +void func_8038DAB0(Actor *this); + +/* .data */ +extern ActorInfo D_8038F720 = { 0x239, 0x25F, 0x4FC, 0x1, NULL, func_802D3D54, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038F744 = { 0x236, 0x260, 0x4F9, 0x1, NULL, func_802D3D54, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038F768 = { 0x237, 0x261, 0x4FA, 0x1, NULL, func_802D3D54, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038F78C = { 0x238, 0x262, 0x4FB, 0x1, NULL, func_802D3D54, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038F7B0 = { 0x243, 0x2E6, 0x533, 0x1, NULL, func_802D3D54, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038F7D4 = { 0x263, 0x2E7, 0x518, 0x1, NULL, func_8038DAB0, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038F7F8 = { 0x21E, 0x233, 0x3B3, 0x1, NULL, func_802D3D74, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038F81C = { 0x26B, 0x2DE, 0x531, 0x1, NULL, func_8038DB0C, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038F840 = { 0x26C, 0x2DD, 0x53E, 0x1, NULL, func_8038DB0C, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038F864 = { 0x26D, 0x2DC, 0x53F, 0x1, NULL, func_8038DB0C, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_8038F888 = { 0x1CC, 0x318, 0x0, 0x0, NULL, func_80325F84, NULL, func_80325340, 0, 0, 0.0f, 0}; + + +/* .code */ +void func_8038DAB0(Actor *this){ + if(!this->initialized){ + func_802D3CE8(this); + this->initialized = TRUE; + if(levelSpecificFlags_get(0x38)){ + marker_despawn(this->marker); + } + } +} + +void func_8038DB0C(Actor *this){ + if(!this->initialized){ + func_802D3D74(this); + this->initialized = TRUE; + this->position_x = 325.8f; + this->position_y = 600.0f; + this->position_z = 0.0f; + } +} + +void func_8038DB6C(void) +{ + spawnableActorList_add(&D_8038EB50, actor_new, 0X80); + spawnableActorList_add(&D_8038EB74, actor_new, 0X80); + spawnableActorList_add(&D_8038EBA0, actor_new, 0X180); + spawnableActorList_add(&D_8038EBD0, actor_new, 0X200080C); + spawnableActorList_add(&D_8038EC14, actor_new, 0X888); + spawnableActorList_add(&D_8038EC70, actor_new, 0X94C88); + spawnableActorList_add(&D_8038ECA0, actor_new, 0X84C88); + spawnableActorList_add(&D_8038ECE8, actor_new, 0X809A8); + spawnableActorList_add(&D_8038EE70, actor_new, 0XC80); + spawnableActorList_add(&D_8038F130, actor_new, 0X84C2A); + spawnableActorList_add(&chCaterpillar, actor_new, 0X881); + spawnableActorList_add(&D_8038F190, actor_new, 0X80D80); + spawnableActorList_add(&D_8038F230, actor_new, 0XD80); + spawnableActorList_add(&D_8038F6F0, actor_new, 0X804); + spawnableActorList_add(&D_8038ED50, actor_new, 0X400); + spawnableActorList_add(&D_8038ED98, actor_new, 0X400); + spawnableActorList_add(&D_8038EDE0, actor_new, 0X400); + spawnableActorList_add(&D_8038EE28, actor_new, 0X400); + spawnableActorList_add(&D_8038ED74, actor_new, 0); + spawnableActorList_add(&D_8038EDBC, actor_new, 0); + spawnableActorList_add(&D_8038EE04, actor_new, 0); + spawnableActorList_add(&D_8038EE4C, actor_new, 0); + spawnableActorList_add(&D_8038F270, actor_new, 0X989); + spawnableActorList_add(&D_8038F300, actor_new, 0X989); + spawnableActorList_add(&D_8038F35C, actor_new, 0X909); + spawnableActorList_add(&D_8038F380, actor_new, 0X80); + spawnableActorList_add(&D_8038F3A4, actor_new, 0X888); + spawnableActorList_add(&D_8038F3C8, actor_new, 0X888); + spawnableActorList_add(&D_8038F3EC, actor_new, 0X80); + spawnableActorList_add(&D_8038F410, actor_new, 0X988); + spawnableActorList_add(&D_8038F434, actor_new, 0X888); + spawnableActorList_add(&D_8038F460, actor_new, 0X880); + spawnableActorList_add(&D_8038F4A8, actor_new, 0X98A); + spawnableActorList_add(&D_8038F4D0, actor_new, 0X988); + spawnableActorList_add(&D_8038F614, actor_new, 0X988); + spawnableActorList_add(&D_8038F640, actor_new, 0X80); + spawnableActorList_add(&D_8038F908, actor_new, 8); + spawnableActorList_add(&D_8038F8C0, actor_new, 8); + spawnableActorList_add(&D_8038F720, actor_new, 0); + spawnableActorList_add(&D_8038F744, actor_new, 0); + spawnableActorList_add(&D_8038F768, actor_new, 0); + spawnableActorList_add(&D_8038F78C, actor_new, 0); + spawnableActorList_add(&D_8038F988, actor_new, 0X2010121); + spawnableActorList_add(&D_8038FA00, actor_new, 0); + spawnableActorList_add(&D_8038F7D4, actor_new, 0X400); + spawnableActorList_add(&D_8038F7B0, actor_new, 0X400); + spawnableActorList_add(&D_8038F888, actor_new, 0X80); + spawnableActorList_add(&D_8038F7F8, actor_new, 0X400); + spawnableActorList_add(&D_8038F81C, actor_new, 0X400); + spawnableActorList_add(&D_8038F840, actor_new, 0X400); + spawnableActorList_add(&D_8038F864, actor_new, 0X400); +} diff --git a/src/CCW/code_7BC0.c b/src/CCW/code_7BC0.c new file mode 100644 index 00000000..f74077a0 --- /dev/null +++ b/src/CCW/code_7BC0.c @@ -0,0 +1,20 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8038DFB0(Actor *this); + + +extern ActorAnimationInfo D_8038F8B0[]; + +extern ActorInfo D_8038F8C0 = { 0x251, 0x37E, 0x506, + 0x1, D_8038F8B0, + func_8038DFB0, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_8038DFB0(Actor *this){ + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); +} diff --git a/src/CCW/code_7BF0.c b/src/CCW/code_7BF0.c new file mode 100644 index 00000000..68dec012 --- /dev/null +++ b/src/CCW/code_7BF0.c @@ -0,0 +1,117 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_8038E0C8(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_8038F8F0[]; + +extern ActorInfo D_8038F908 = { + 0x1F9, 0x1E9, 0x440, + 0x1, D_8038F8F0, + func_8038E0C8, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_8038DFE0(Actor* actor) { + func_80328B8C(actor, 1, 0.001f, 1); + actor->unk38_31 = randi2(0, 0); +} + +void func_8038E034(Actor* actor) { + func_80328B8C(actor, 2, 0.001f, 1); +} + +void func_8038E060(s32 arg0, ActorMarker *marker){ + Actor *this; + f32 sp28[3]; + s32 pad24; + f32 sp18[3]; + + this = marker_getActor(marker); + if(arg0){ + sp28[0] = 0.0f; + sp28[1] = this->unk1C[0]; + sp28[2] = 0.0f; + + + func_80345C78(sp18, sp28); + func_8033A8F0(arg0, 1, sp18); + func_8033A238(arg0); + } +} + +void func_8038E0C8(Actor *this) { + f32 sp44[3]; + f32 sp40; + f32 sp3C; + f32 sp38; + f32 sp34; + + sp34 = time_getDelta(); + + if(!actor_playerIsWithinDist(this, 3000)) return; + + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + func_8028746C(this->animctrl, func_8038E060); + func_8028748C(this->animctrl, (s32) this->marker); + this->marker->propPtr->unk8_3 = TRUE; + this->unk1C[0] = 0.0f; + this->unk38_31 = 0; + } + + if (player_getTransformation() == TRANSFORM_6_BEE) { + actor_collisionOff(this); + } else { + actor_collisionOn(this); + player_getPosition(sp44); + func_80258A4C(this->position, this->yaw - 90.0f, sp44, &sp40, &sp3C, &sp38); + if( (sp40 < 1050.0f) + && (sp38 > -1.0f) + && (sp38 < 1.0f) + ) { + func_80258A4C(this->position, this->unk1C[0] + (this->yaw - 90.0f), sp44, &sp40, &sp3C, &sp38); + this->unk1C[0] += sp38 * 160.0f * sp34; + } else { + if (this->unk1C[0] > 0.0f) { + this->unk1C[0] -= (30.0f * sp34); + this->unk1C[0] = (this->unk1C[0] < 0.0f) ? 0.0f : this->unk1C[0]; + + } else if (this->unk1C[0] < 0.0f) { + this->unk1C[0] += (30.0f * sp34); + this->unk1C[0] = (this->unk1C[0] > 0.0f) ? 0.0f : this->unk1C[0]; + } + } + } + switch (this->state) { + case 1: + if (this->unk38_31 != 0) { + this->unk38_31--; + break; + } + if( func_80329530(this, 0x2A8) + && (this->unk38_31 == 0) + && (player_getTransformation() == TRANSFORM_1_BANJO) + ) { + func_8038E034(this); + } + break; + + case 2: + if (actor_animationIsAt(this, 0.999f)) { + func_8038DFE0(this); + break; + } + if( actor_animationIsAt(this, 0.18f) + || actor_animationIsAt(this, 0.47f) + || actor_animationIsAt(this, 0.78f) + ) { + FUNC_8030E8B4(SFX_80_YUMYUM_CLACK, 1.0f, 32000, this->position, 1500, 3000); + } + break; + } +} diff --git a/src/CCW/code_8050.c b/src/CCW/code_8050.c new file mode 100644 index 00000000..c807602e --- /dev/null +++ b/src/CCW/code_8050.c @@ -0,0 +1,178 @@ +#include +#include "functions.h" +#include "variables.h" + + + +extern void func_802DABA0(ParticleEmitter *, f32[3], f32, enum asset_e); +extern void func_8033A45C(s32, s32); +extern void func_802DB548(void); + +enum ccw_season_e +{ + SPRING, + SUMMER, + AUTUMN, + WINTER +}; + +typedef struct { + f32 unk0; + f32 unk4; + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; + u32 unkC_31:3; + u32 unkC_28:1; + u32 season:28; + s16 unk10; + s16 unk12; + f32 unk14; + u8 pad18[0x18]; + void (*unk30)(void); + void (*unk34)(ActorMarker *, s32); + u8 pad38[4]; + f32 unk3C; +} ActorLocal_CCW_8050; + +void func_8038E964(Actor *this); +Actor *func_8038E56C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +extern ActorAnimationInfo D_8038F930[]; +extern ActorInfo D_8038F988 = { + 0x1E2, 0x375, 0x52C, + 0x1, D_8038F930, + func_8038E964, func_80326224, func_8038E56C, + 2500, 0, 1.0f, 0 +}; +extern struct43s D_8038F9AC; + +/* .code */ +void func_8038E440(ParticleEmitter *pCtrl, Actor *actor, enum asset_e model_id){ + func_802DABA0(pCtrl, actor->position, actor->scale, model_id); + func_802EFE24(pCtrl, + -600.0f, -600.0f, -600.0f, + 600.0f, 600.0f, 600.0f + ); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8038F9AC); + particleEmitter_emitN(pCtrl, 1); +} + +void func_8038E4C0(ActorMarker* marker, s32 arg1) { + Actor* actor = marker_getActor(marker); + ParticleEmitter *pCtrl; + + func_80328B8C(actor, 5, 0.0f, 1); + actor_playAnimationOnce(actor); + FUNC_8030E8B4(SFX_C2_GRUBLIN_EGH, 1.0f, 32000, actor->position, 1250, 2500); + pCtrl = partEmitList_pushNew(1); + func_8038E440(pCtrl, actor, ASSET_52D_MODEL_GRUBLIN_HOOD_HAT); + func_802C3F04((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32,actor->position_x), reinterpret_cast(s32,actor->position_y), reinterpret_cast(s32,actor->position_z)); + actor_collisionOff(actor); + actor->unk138_24 = 1; +} + +Actor *func_8038E56C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this; + ActorLocal_CCW_8050 *local; + + this = marker_getActor(marker); + local = (ActorLocal_CCW_8050 *)&this->local; + func_8033A45C(3, (local->season == SUMMER) ? 1 : 2); + func_8033A45C(4, (local->season == SUMMER) ? 1 : 2); + func_8033A45C(5, (local->season < AUTUMN) ? 1 : 2); + func_8033A45C(6, (local->season < AUTUMN) ? 1 : 2); + func_8033A45C(7, (local->season < AUTUMN) ? 1 : 2); + func_8033A45C(8, (local->season < AUTUMN) ? 1 : 2); + func_8033A45C(9, (local->season == SUMMER) ? 1 : 0); + func_8033A45C(10, (local->season < AUTUMN) ? 0 : (local->season == AUTUMN) ? 1 : 2); + func_8033A45C(11, (local->season < AUTUMN) ? 0 : (local->season == AUTUMN) ? 1 : 2); + func_8033A45C(12, (local->season == WINTER) ? 2 : 1); + func_8033A45C(13, (local->season == WINTER) ? 1 : 0); + func_8033A45C(14, (this->unk138_24)? 0 : 1); + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_8038E868(Actor *this){ + ActorLocal_CCW_8050 *local = (ActorLocal_CCW_8050 *)&this->local; + + + local->unk8 = 6; + local->unk9 = 0xC; + local->unkA = 0x10; + local->unkB = 8; + local->unkC_31 = 1; + local->unk10 = 0x29; + local->unk12 = 25000; + local->unkC_28 = 1; + local->unk30 = func_802DB548; + local->unk34 = func_8038E4C0; + local->unk0 = 5.0f; + local->unk4 = 8.0f; + local->unk14 = 1.0f; + local->unk3C = 1.5f; +} + +enum ccw_season_e func_8038E8FC(Actor *this){ + switch(map_get()){ + case MAP_43_CCW_SPRING: //// 8038E930 + case MAP_4A_CCW_SPRING_MUMBOS_SKULL:// 8038E930 + case MAP_5B_CCW_SPRING_ZUBBA_HIVE:// 8038E930 + case MAP_5E_CCW_SPRING_NABNUTS_HOUSE:// 8038E930 + case MAP_65_CCW_SPRING_WHIPCRACK_ROOM:// 8038E930 + return SPRING; + + case MAP_44_CCW_SUMMER:// 8038E938 + case MAP_4B_CCW_SUMMER_MUMBOS_SKULL:// 8038E938 + case MAP_5A_CCW_SUMMER_ZUBBA_HIVE:// 8038E938 + case MAP_5F_CCW_SUMMER_NABNUTS_HOUSE:// 8038E938 + case MAP_66_CCW_SUMMER_WHIPCRACK_ROOM:// 8038E938 + return SUMMER; + + case MAP_45_CCW_AUTUMN:// 8038E940 + case MAP_4C_CCW_AUTUMN_MUMBOS_SKULL:// 8038E940 + case MAP_5C_CCW_AUTUMN_ZUBBA_HIVE:// 8038E940 + case MAP_60_CCW_AUTUMN_NABNUTS_HOUSE:// 8038E940 + case MAP_63_CCW_AUTUMN_NABNUTS_WATER_SUPPLY:// 8038E940 + case MAP_67_CCW_AUTUMN_WHIPCRACK_ROOM:// 8038E940 + return AUTUMN; + + case MAP_46_CCW_WINTER:// 8038E948 + case MAP_4D_CCW_WINTER_MUMBOS_SKULL:// 8038E948 + case MAP_61_CCW_WINTER_NABNUTS_HOUSE:// 8038E948 + case MAP_62_CCW_WINTER_HONEYCOMB_ROOM:// 8038E948 + case MAP_64_CCW_WINTER_NABNUTS_WATER_SUPPLY:// 8038E948 + case MAP_68_CCW_WINTER_WHIPCRACK_ROOM:// 8038E948 + return WINTER; + + default: + return SPRING; + + } +} + +void func_8038E964(Actor *this) { + ActorLocal_CCW_8050 *local; + f32 temp_a0; + + local = (ActorLocal_CCW_8050 *)&this->local; + + if (!this->unk16C_4) { + func_8038E868(this); + local->season = func_8038E8FC(this); + } + + if(local->season < 4){ + func_802DB5A0(this); + if (this->state == 5) { + if (actor_animationIsAt(this, 0.18f)) { + FUNC_8030E8B4(SFX_2_CLAW_SWIPE, 1.0f, 28000, this->position, 1250, 2500); + } + if (actor_animationIsAt(this, 0.7f)) { + FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 1.0f, 28000, this->position, 1250, 2500); + } + } + } +} diff --git a/src/CCW/code_8670.c b/src/CCW/code_8670.c new file mode 100644 index 00000000..7b741a25 --- /dev/null +++ b/src/CCW/code_8670.c @@ -0,0 +1,31 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8038EAD4(Actor *this); + +/* .data */ +extern ActorInfo D_8038FA00 = { 0x1E3, 0x374, 0x0, 0x0, NULL, func_8038EAD4, func_80326224, func_80325340, 0, 0, 0.0f, 0}; + +/* .code */ +bool func_8038EA60(s32 arg0, s32 arg1, s32 arg2) { + s32 sp24; + s32 temp_a0; + s32 sp1C; + s32 temp_v1; + + func_8028EB3C(&sp1C); + temp_v1 = arg1 - sp24; + temp_a0 = arg0 - sp1C; + return ((temp_v1 * temp_v1) + (temp_a0 * temp_a0)) < (arg2 * arg2); +} +void func_8038EAD4(Actor* this) { + if (func_803203FC(0x13)) { + marker_despawn(this->marker); + return; + } + if (func_8038EA60(0, -0x6B, 0xBC) != 0) { + func_80311480(0xDA9, 4, NULL, NULL, NULL, NULL); + func_803204E4(0x13, 1); + } +} diff --git a/src/CCW/code_950.c b/src/CCW/code_950.c new file mode 100644 index 00000000..a494a0ff --- /dev/null +++ b/src/CCW/code_950.c @@ -0,0 +1,215 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8030DBFC(u8, f32, f32, f32); + +typedef struct{ + u8 unk0; + //u8 pad1[3]; + ActorMarker *unk4; + f32 unk8[3]; + f32 unk14; + f32 unk18; +}ActorLocal_CCW_950; + +void chwasp_update(Actor *this); + +/* .data */ +extern ActorInfo D_8038EBD0 = { MARKER_1AE_ZUBBA, ACTOR_29B_ZUBBA, ASSET_446_MODEL_ZUBBA, 0x0, NULL, chwasp_update, NULL, func_80325888, 0, 0, 1.0f, 0}; + +/* .code */ +void chwasp_setState(Actor *this, s32 next_state) { + ActorLocal_CCW_950 *local; + f32 sp50[3]; + f32 sp44[3]; + + local = (ActorLocal_CCW_950 *)&this->local; + local->unk18 = 0.0f; + if (next_state == 1) { + local->unk18 = 800.0f; + func_80335924(this->unk148, ASSET_16F_ANIM_ZUBBA_FLY_MOVE, 0.0f, 0.65f); + } + if (next_state == 2) { + func_80335924(this->unk148, ASSET_170_ANIM_ZUBBA_FLY_IDLE, 0.1f, 0.65f); + player_getPosition(sp50); + sp50[1] += 50.0f; + local->unk8[0] = sp50[0] - this->position[0]; + local->unk8[1] = sp50[1] - this->position[1]; + local->unk8[2] = sp50[2] - this->position[2]; + ml_vec3f_normalize(local->unk8); + if ((local->unk8[0] == 0.0f) && (local->unk8[1] == 0.0f) && (local->unk8[2] == 0.0f)) { + local->unk8[1] = -1.0f; + } + } + if (next_state == 3) { + FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200, this->position, 500, 3000); + func_80324D54(randf2(0.1f, 0.4f), 0x3FC, randf2(0.95f, 1.1f), 32000, this->position, 500.0f, 3000.0f); + actor_collisionOff(this); + } + if (next_state == 4) { + func_80335924(this->unk148, ASSET_171_ANIM_ZUBBA_DIE, 0.1f, 0.2f); + FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200, this->position, 500, 3000); + func_80324D54(0.1f, 0x66, randf2(1.6f, 1.7f), 32000, this->position, 500.0f, 3000.0f); + func_803867C8(local->unk4); + actor_collisionOff(this); + player_getPosition(sp44); + sp44[1] += 50.0f; + local->unk8[0] = this->position[0] - sp44[0]; + local->unk8[1] = this->position[1] - sp44[1]; + local->unk8[2] = this->position[2] - sp44[2]; + ml_vec3f_normalize(local->unk8); + if ((local->unk8[0] == 0.0f) && (local->unk8[1] == 0.0f) && (local->unk8[2] == 0.0f)) { + local->unk8[1] = -1.0f; + } + } + if (next_state == 5) { + func_8030E878(SFX_A_BANJO_LANDING_05, randf2(0.85f, 0.95f), 18000, this->position, 500.0f, 3000.0f); + func_80335924(this->unk148, ASSET_172_ANIM_ZUBBA_LAND, 0.0f, 1.0f); + func_80335A8C(this->unk148, 2); + } + if (next_state == 6) { + marker_despawn(this->marker); + } + if (next_state == 7) { + func_80386814(local->unk4); + marker_despawn(this->marker); + } + this->state = next_state; +} + + +void func_80387124(ActorMarker* marker, ActorMarker *other_marker) { + chwasp_setState(marker_getActor(marker), 3); +} + +void func_80387150(ActorMarker* marker, ActorMarker *other_marker) { + chwasp_setState(marker_getActor(marker), 4); +} + +void func_8038717C(Actor *this){ + ActorLocal_CCW_950 *local; + + local = (ActorLocal_CCW_950 *)&this->local; + func_8030DA44(local->unk0); +} + +void chwasp_update(Actor *this) { + ActorLocal_CCW_950 *local; + f32 sp68; + Actor *other; + s32 sp60; + s32 sp5C; + f32 sp50[3]; + f32 sp4C; + f32 sp48; + f32 sp44; + f32 temp_f0; + f32 pad; + + + sp68 = time_getDelta(); + local = (ActorLocal_CCW_950 *)&this->local; + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->marker->unk30 = func_8038717C; + local->unk0 = func_8030D90C(); + local->unk4 = 0; + local->unk14 = 1000.0f; + sfxsource_setSfxId(local->unk0, 0x3FA); + func_8030DD14(local->unk0, 2); + func_8030DBB4(local->unk0, 0.9f); + sfxsource_setSampleRate(local->unk0, 0); + marker_setCollisionScripts(this->marker, func_80387124, NULL, func_80387150); + chwasp_setState(this, 1); + return; + } + if(local->unk4 == NULL) { + other = func_80326EEC(0x299); + if (other == NULL) { + marker_despawn(this->marker); + return; + } + local->unk4 = other->marker; + func_80386840(local->unk4, &sp60, &sp5C); + local->unk14 = (((f32)sp60 /(f32)sp5C) * 1000.0f) + 1000.0f; + } + + if (this->state == 1) { + temp_f0 = this->position[1]; + this->position[0] += 0.1 * sp68; + this->position[1] += local->unk18 * sp68; + if ((temp_f0 < 0.0f) && (this->position[1] >= 0.0f)) { + func_8030E878(SFX_A_BANJO_LANDING_05, randf2(1.0f, 1.1f), 18000, this->position, 500.0f, 3000.0f); + } + player_getPosition(sp50); + func_80258A4C(this->position, this->yaw - 90.0f, sp50, &sp4C, &sp48, &sp44); + this->yaw += 360.0f * sp44 * sp68; + if (this->position[1] > 150.0f) { + local->unk18 -= 2000.0f * sp68; + if (local->unk18 < 0.0f) { + chwasp_setState(this, 2); + } + } + } + + if (this->state == 2) { + if (local->unk18 < local->unk14) { + local->unk18 += (4.0f * local->unk14 * sp68); + } + this->position[0] += local->unk8[0] * local->unk18 * sp68; + this->position[1] += local->unk8[1] * local->unk18 * sp68; + this->position[2] += local->unk8[2] * local->unk18 * sp68; + if( (this->position[0] < -1500.0f) || (1500.0f < this->position[0]) + || (this->position[1] < -100.0f) || (1300.0f < this->position[1]) + || (this->position[2] < -1200.0f) || (this->position[2] > 2000.0f) + ){ + chwasp_setState(this, 7); + } + } + + if (this->state == 3) { + this->position[1] += local->unk18 * sp68; + if (local->unk18 < local->unk14) { + local->unk18 += 2000.0f * sp68; + } + + if( (this->position[0] < -1500.0f) || (1500.0f < this->position[0]) + || (this->position[1] < -100.0f) || (1300.0f < this->position[1]) + || (this->position[2] < -1200.0f) || (this->position[2] > 2000.0f) + ) { + chwasp_setState(this, 7); + } + } + + if (this->state == 4) { + this->position[0] += local->unk8[0] * 1000.0f * sp68; + this->position[1] -= local->unk18 * sp68; + this->position[2] += local->unk8[2] * 1000.0f * sp68; + if (local->unk18 < local->unk14) { + local->unk18 += (1000.0f * sp68); + } + if (this->position[1] <= 0.0f) { + this->position[1] = 0.0f; + chwasp_setState(this, 5); + } + } + + if (this->state == 5) { + this->position[1] -= 300.0f * sp68; + if (this->position[1] < -200.0f) { + chwasp_setState(this, 6); + } + } + + if(this->state); + if (this->state == 2) { + func_8030DBFC(local->unk0, 1.0f, 1.1f, 0.05f); + } else { + func_8030DBFC(local->unk0, 0.8f, 0.9f, 0.05f); + } + func_8030DEB4(local->unk0, 500.0f, 1500.0f); + func_8030DF68(local->unk0, this->position); + func_8030E2C4(local->unk0); + sfxsource_setSampleRate(local->unk0, (s32) ((local->unk18 / local->unk14) * 10000.0f)); +} diff --git a/src/FP/ch/wozzasjig.c b/src/FP/ch/wozzasjig.c new file mode 100644 index 00000000..17ff4cef --- /dev/null +++ b/src/FP/ch/wozzasjig.c @@ -0,0 +1,91 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *func_8038FF00(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_8038FF54(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_803925C0[]; + +extern ActorInfo D_80392628 = { MARKER_20C_WOZZAS_JIGGY, ACTOR_1F4_WOZZAS_JIGGY, ASSET_495_MODEL_WOZZAS_JIGGY, + 0x1, D_803925C0, + func_8038FF54, func_80326224, func_8038FF00, + 0, 0, 0.0f, 0 +}; + +extern struct31s D_8039264C; + +/* .code */ +Actor *func_8038FF00(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + if(func_8038BFA0()) return this; + + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_8038FF54(Actor *this){ + Actor *other; + f32 sp40[3]; + ParticleEmitter *sp3C; + + if( func_8038BFA0() ) return; + if( !actor_playerIsWithinDist(this, 4500) ) return; + + this->marker->propPtr->unk8_3 = FALSE; + actor_collisionOff(this); + if(this->unk100){ + other = marker_getActor(this->unk100); + if(this->state != 9){ + if(other->state == 9){ + func_80328B8C(this, 9, 0.01f, 1); + actor_playAnimationOnce(this); + } + else{ + animctrl_setIndex(this->animctrl, animctrl_getIndex(other->animctrl)); + func_8028774C(this->animctrl, animctrl_getAnimTimer(other->animctrl)); + animctrl_setDuration(this->animctrl, animctrl_getDuration(other->animctrl)); + animctrl_setSmoothTransition(this->animctrl, FALSE); + func_802875AC(this->animctrl, "chwozzasjig.c", 0x87); + this->position[0] = other->position[0]; + this->position[1] = other->position[1]; + this->position[2] = other->position[2]; + this->yaw = other->yaw; + } + } + }//L8039008C + + if(this->state == 9){ + if(0.99999 <= animctrl_getAnimTimer(this->animctrl)){ + func_8034A174(this->marker->unk44, 5, sp40); + sp40[0] = (f32)(s32)sp40[0]; + sp40[1] = (f32)(s32)sp40[1]; + sp40[2] = (f32)(s32)sp40[2]; + func_802C8F70(this->yaw + 90.0f); + jiggySpawn(JIGGY_32_FP_WOZZA, sp40); + levelSpecificFlags_set(0x26, TRUE); + marker_despawn(this->marker); + } + else if(this->marker->unk14_21){//L8039016C + sp3C = partEmitList_pushNew(1); + func_8034A174(this->marker->unk44, 5, sp40); + particleEmitter_setSprite(sp3C, ASSET_713_SPRITE_SPARKLE_YELLOW); + particleEmitter_setStartingFrameRange(sp3C, 1, 6); + particleEmitter_setPosition(sp3C, sp40); + particleEmitter_setParticleSpawnPositionRange(sp3C, + 0.0f, 20.0f, 0.0f, + 0.0f, 20.0f, 0.0f + ); + particleEmitter_setParticleVelocityRange(sp3C, + -180.0f, 0.0f, -180.0f, + 180.0f, 280.0f, 180.0f + ); + particleEmitter_setParticleAccelerationRange(sp3C, + 0.0f, -60.0f, 0.0f, + 0.0f, -90.0f, 0.0f + ); + func_802EFB98(sp3C, &D_8039264C); + particleEmitter_emitN(sp3C, 1); + } + } +} diff --git a/src/FP/code_0.c b/src/FP/code_0.c new file mode 100644 index 00000000..786f30a0 --- /dev/null +++ b/src/FP/code_0.c @@ -0,0 +1,148 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_803867BC(Actor *this); + +/* .data */ +ActorAnimationInfo D_803919F0[] ={ + {ASSET_1A1_ANIM_SLED, 1.0f}, + {ASSET_1A1_ANIM_SLED, 1.0f}, + {ASSET_1A1_ANIM_SLED, 1.0f}, + {ASSET_1A1_ANIM_SLED, 1.0f} +}; + +ActorInfo D_80391A10 = { + MARKER_3B_SCARF_SLED, ACTOR_181_SCARF_SLED, ASSET_352_MODEL_SLED, + 0, D_803919F0, + NULL, func_803867BC, func_80325888, + 1000, 0, 0.0f, 0 +}; + +/* .code */ +void func_803863F0(Actor *this, s32 next_state){ + func_80328A84(this, next_state); + + if(next_state == 2){ + mapSpecificFlags_set(0xB, TRUE); + timed_setCameraToNode(0.0f, 0x27); + timed_playSfx(0.6f, SFX_52_BANJO_YAH_OH, 1.0f, 28000); + timed_playSfx(1.25f, SFX_31_BANJO_OHHWAAOOO, 1.0f, 28000); + + timed_setCameraToNode(1.5f, 0x26); + timed_setCameraToNode(2.75f, 0x25); + timed_playSfx(3.5f, SFX_63_BANJO_UWAAAAOOH, 1.0f, 28000); + + timed_setCameraToNode(3.75f, 0x24); + timed_playSfx(4.25f, SFX_A7_WOODEN_SWOSH, 1.2f, 18000); + timed_playSfx(4.45f, SFX_C1_BUZZBOMB_ATTACK, 1.0f, 0x7fff); + timed_setCameraToNode(4.75f, 0x23); + } +} + +void func_803864F4(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor * this = marker_getActor(this_marker); + + if(this->state != 1) return; + if(player_getTransformation() != TRANSFORM_1_BANJO) return; + + if(func_8028F68C(0x27, this->marker)) + func_803863F0(this, 2); +} + +void func_8038655C(Actor *this){ + int tmp_bool; + int tmp; + tmp_bool = (mlAbsF(this->position_y - this->velocity_y) < 100.0f); + tmp = this->unk10_12; + this->unk10_12 = FALSE; + if(!tmp_bool){ + if(tmp != 0){ + func_8030E6A4(SFX_19_BANJO_LANDING_08, func_8030E200(this->unk44_31), 0x55f0); + } + } + else{ + if(this->unk44_31 == 0){ + this->unk44_31 = func_8030ED2C(SFX_18_BIGBUTT_SLIDE, 2); + func_8030E0FC(this->unk44_31, 0.9f, 1.5f, 1.2f); + } + this->unk10_12 = TRUE; + func_8030E2C4(*((u8*)this + 0x44)); + } +} + +void func_80386630(Actor *this){ + f32 sp7C[3]; + f32 sp70[3]; + f32 sp64[3]; + f32 sp24[4][4]; + + func_80343DEC(this); + mapSpecificFlags_set(9, 1); + func_8038655C(this); + if(this->unk138_20){ + + this->yaw = 0.0f; + sp64[0] = this->pitch; + sp64[1] = this->yaw; + sp64[2] = this->roll; + mlMtxIdent(); + mlMtxRotYaw(sp64[1]); + mlMtxRotPitch(sp64[0]); + func_802513B0(sp24); + + sp70[0] = 0.0f; + sp70[1] = 18.0f; + sp70[2] = 0.0f; + func_8025235C(sp70, sp70); + + sp70[0] += this->position[0]; + sp70[1] += this->position[1]; + sp70[2] += this->position[2]; + func_8028FAB0(sp70); + + sp64[0] = this->pitch; + sp64[1] = this->yaw; + sp64[2] = this->roll; + func_8028FAEC(sp64); + }//L80386724 + + if(1.0 == this->unk48){ + mapSpecificFlags_set(1, TRUE); + FUNC_8030E624(SFX_103_FLOTSAM_DEATH, 1.0f, 30000); + FUNC_8030E624(SFX_11_WOOD_BREAKING_1, 0.8f, 25000); + FUNC_8030E624(SFX_D_EGGSHELL_BREAKING, 1.0f, 25000); + + sp7C[0] = -1000.0f; + sp7C[1] = 1727.0f; + sp7C[2] = 6218.0f; + func_8028F490(sp7C); + marker_despawn(this->marker); + }//L803867AC +} + +void func_803867BC(Actor *this){ + if(!this->initialized){ + this->initialized = TRUE; + marker_setCollisionScripts(this->marker, func_803864F4, NULL, NULL); + this->marker->propPtr->unk8_3 = TRUE; + this->unk10_12 = 0; + ml_vec3f_clear(this->velocity); + func_803863F0(this, 1); + } + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(jiggyscore_isCollected(JIGGY_2A_FP_BOGGY_1)){ + marker_despawn(this->marker); + return; + } + } + + this->velocity_x = this->position_x; + this->velocity_y = func_80309724(this->position); + this->velocity_z = this->position_z; + if(this->state == 2){ + func_80386630(this); + } +} diff --git a/src/FP/code_11F0.c b/src/FP/code_11F0.c new file mode 100644 index 00000000..9862d114 --- /dev/null +++ b/src/FP/code_11F0.c @@ -0,0 +1,201 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80324CD8(f32); + +Actor *func_803875E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_8038774C(Actor *this); +void func_8038794C(Actor *this); + +/* .data */ +ActorAnimationInfo D_80391B80[] = { + {0x000, 0.0f}, + {0x14E, 2.0f}, + {0x14D, 7.0f}, + {0x14C, 2.0f}, + {0x14F, 0.5f}, + {0x14F, 1.0f} +}; + +ActorInfo D_80391BB0 = { + MARKER_124_BOGGY_1, ACTOR_160_BOGGY_1, ASSET_38A_MODEL_BOGGY_1, + 0x1, D_80391B80, + func_8038774C, func_8038794C, func_803875E0, + 2500, 0, 1.4f, 0 +}; + +f32 D_80391BD4[3] = {1592.0f, 673.0f, 5895.0f}; +f32 D_80391BE0[3] = { 0.0f, 0.0f, 0.0f}; +f32 D_80391BEC[5] = {2.0f, 2.8f, 4.3f, 5.1f, 5.7f}; + +/* .code */ +Actor *func_803875E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + + if(!this->unk38_31 || this->state == 5) + return this; + + func_8033A45C(1, 0); + func_8033A45C(3, 1); + this = func_80325888(marker, gfx, mtx, vtx); + if(marker->unk14_21){ + func_8034A174(func_80329934(), 5, this->velocity); + } + return this; +} + +void func_803876A4(Actor *this){ + func_80328B8C(this, 2, 0.0001f, 1); + actor_playAnimationOnce(this); + FUNC_8030E8B4(SFX_8E_GRUNTLING_DAMAGE, 1.0f, 32000, this->position, 1250, 2500); +} + +void func_803876F8(Actor *this){ + this->marker->propPtr->unk8_3 = FALSE; + func_80328B8C(this, 5, 0.0001f, 1); + this->unk48 = 0.0f; + func_80343DEC(this); +} + +void func_8038774C(Actor *this){} + +void func_80387754(ActorMarker *this_marker, ActorMarker *other_marker){} + +void func_80387760(ActorMarker *marker){ + Actor *other = func_80328230(ACTOR_C8_BOGGY_2, D_80391BD4, D_80391BE0); + other->unk4C = 1.0f; + func_80343DEC(other); +} + +void func_803877A8(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *this = marker_getActor(caller); + + if(arg2 == 1){ + jiggySpawn(JIGGY_2A_FP_BOGGY_1, this->velocity); + } + else if(arg2 == 2){ + func_80328B8C(this, 4, 0.0001f, 1); + actor_loopAnimation(this); + actor_collisionOff(this); + } +} + +void func_80387828(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *this = marker_getActor(caller); + + if(text_id == 0xc00){ + func_80311480(0xc2b, 0xf, NULL, this->marker, NULL, func_803877A8); + } +} + +void func_8038787C(ActorMarker *marker){ + Actor *this = marker_getActor(marker); + s32 s0; + f32 sp24; + s32 sp20; + + s0 = func_802F9AA8(SFX_12B_BOILING_AND_BUBBLING); + sp24 = randf2(0.9f, 1.1f); + sp20 = (s32)randf2(16000.0f, 23000.0f); + func_802F9DB8(s0, sp24, sp24, 0.0f); + func_802F9EC4(s0, this->position, 500, 1200); + func_802F9F80(s0, 0.05f, 0.2f, 0.3f); + func_802FA060(s0, sp20, sp20, 0.0f); +} + +void func_8038794C(Actor *this){ + int i; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + marker_setCollisionScripts(this->marker, NULL, func_80387754, NULL); + this->unk38_31 = 1; + ml_vec3f_copy(this->velocity, this->position); + + if(func_803203FC(1)) + return; + + if(!jiggyscore_isCollected(JIGGY_2A_FP_BOGGY_1) && jiggyscore_isSpawned(JIGGY_2A_FP_BOGGY_1)){ + func_803876F8(this); + actor_collisionOff(this); + } + + if(jiggyscore_isCollected(JIGGY_2A_FP_BOGGY_1)){ + if(!jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3) && !jiggyscore_isSpawned(JIGGY_2C_FP_BOGGY_3)){ + func_802C3C88(func_80387760, this->marker); + } + this->unk38_31 = 0; + actor_collisionOff(this); + this->marker->propPtr->unk8_3 = FALSE; + } + }//L80387A68 + + if( !this->unk38_31 ) return; + switch(this->state){ + case 1://L80387AB0 + if(mapSpecificFlags_get(0xb)) + this->unk138_24 = TRUE; + + if(mapSpecificFlags_get(0x1)){ + func_8028F94C(1, this->position); + timed_setCameraToNode(0.0f, 0x12); + func_80324DBC(1.0f, 0xc00, 0xe, NULL, this->marker, func_80387828, func_803877A8); + func_803876A4(this); + break; + }//L80387B38 + + if(!this->unk138_24 && func_80329530(this, 0x1f4)){ + if(!func_8028ECAC() || func_8028ECAC() == BSGROUP_8_TROT){ + if(func_80311480(0xbff, 0x2a, this->position, NULL, NULL, NULL)){ + for(i = 0; i <5; i++ ){ + timedFunc_set_1(D_80391BEC[i], (TFQM1)func_8038787C, (s32)this->marker); + } + this->unk138_24 = TRUE; + } + } + } + + break; + case 2://L80387BEC + func_8028FC8C(this->position); + if(actor_animationIsAt(this, 0.1f)){ + FUNC_8030E8B4(SFX_F6_BLUBBER_TALKING_2, 1.0f, 32000, this->position, 1250, 2500); + } + else if(actor_animationIsAt(this, 0.24f)){//L80387C2C + FUNC_8030E8B4(SFX_A0_COUGHING, 0.7f, 32000, this->position, 1250, 2500); + } + else if(actor_animationIsAt(this, 0.52f)){//L80387C60 + FUNC_8030E8B4(SFX_A0_COUGHING, 0.67f, 32000, this->position, 1250, 2500); + } + else if(actor_animationIsAt(this, 0.61f)){//L80387C94 + FUNC_8030E8B4(SFX_A0_COUGHING, 0.64f, 32000, this->position, 1250, 2500); + } + else if(actor_animationIsAt(this, 0.69f)){//L80387CC8 + FUNC_8030E8B4(SFX_A0_COUGHING, 0.61f, 32000, this->position, 1250, 2500); + }//L80387CF4 + + if(actor_animationIsAt(this, 0.9999f)){ + func_80328B8C(this, 3, 0.0001f, 1); + actor_loopAnimation(this); + } + break; + case 4://L80387D2C + func_80343DEC(this); + func_8028FC8C(this->position); + if(0.99 <= this->unk48){ + func_8028F918(0); + func_80324CD8(0.0f); + func_80324E88(0.0f); + func_803876F8(this); + } + break; + case 5://L80387D90 + if(jiggyscore_isCollected(JIGGY_2A_FP_BOGGY_1)){ + this->unk38_31 = 0; + func_802C3C88(func_80387760, this->marker); + } + break; + } +} diff --git a/src/FP/code_19E0.c b/src/FP/code_19E0.c new file mode 100644 index 00000000..50cad812 --- /dev/null +++ b/src/FP/code_19E0.c @@ -0,0 +1,102 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + u8 pad0[1]; + u8 unk1; +} ActorLocal_FP_19E0; + +void func_803289EC(Actor *, f32, s32); +void func_8028E668(f32[3], f32, f32, f32); + +Actor *func_80387DD0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_803881AC(Actor *this); + +/* .data */ +ActorAnimationInfo D_80391C00[] = { + {0x000, 0.0f}, + {0x152, 4.0f}, + {0x151, 1.2f} +}; + +ActorInfo D_80391C18 = { + 0x125, 0x161, 0x38b, + 0x1, D_80391C00, + func_803881AC, func_80326224, func_80387DD0, + 0, 0, 0.35f, 0 +}; + +/* .code */ +Actor *func_80387DD0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + + if(this->velocity[0] == 0.0f || 0.0f != this->velocity[1]) + return this; + func_8033A45C(2, this->velocity[0] == 1.0f ? 1 : 0); + func_8033A45C(3, this->velocity[0] == 3.0f ? 1 : 0); + func_8033A45C(4, this->velocity[0] == 2.0f ? 1 : 0); + return func_80325888(marker, gfx, mtx, vtx); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_19E0/func_80387EE4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_19E0/func_80388000.s") + +void func_8038811C(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + if(this->state == 2) + return; + + func_80328B8C(this, 2, 0.0001, 1); + func_8030E878(SFX_6A_FLAGPOLE_WOBBLE, randf2(0.9f, 1.1f), 32000, this->position, 1000.0f, 2000.0f); + +} + +void func_803881AC(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3)){ + marker_despawn(this->marker); + return; + } + marker_setCollisionScripts(this->marker, NULL, func_8038811C, NULL); + this->marker->propPtr->unk8_3 = FALSE; + this->unk124_6 = FALSE; + func_803289EC(this, randf(), 1); + if(this->unk38_31 == 0){ + func_8038B8B0(this->marker); + this->velocity_x = 0.0f; + } + this->initialized = FALSE; + this->velocity_z = 0.0f; + }//L8038827C + + if(0.0f == this->velocity_x || 0.0f != this->velocity_y) { + this->marker->collidable = FALSE; + if(0.0f == this->velocity_x) + return; + }else{ + if(!func_80329530(this, 2000) && !func_8038BFE8(this->position, 2000)) + return; + this->marker->collidable = TRUE; + this->unk124_6 = TRUE; + + }//L80388314 + func_8028E668(this->position, 200.0f, -10.0f, 30.0f); + + if(this->state == 2){ + if(actor_animationIsAt(this, 0.9999f)){ + func_80328B8C(this, 1, 0.0001f, 1); + } + } + + if( 1.0f == this->velocity_x && func_80387EE4(this)){ + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + func_8038BA88(this->unkF4_8); + } + + if(func_80388000(this)){ + func_8038BC0C(this->unkF4_8); + } +} diff --git a/src/FP/code_1FF0.c b/src/FP/code_1FF0.c new file mode 100644 index 00000000..d190ee9c --- /dev/null +++ b/src/FP/code_1FF0.c @@ -0,0 +1,84 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_803289EC(Actor *, f32, s32); +extern void func_8028E668(f32[3], f32, f32, f32); + +void func_80388584(Actor *this); +Actor *func_803883E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorAnimationInfo D_80391C40[] = { + {0x000, 0.0f}, + {0x152, 4.0f}, + {0x151, 1.2f} +}; + +ActorInfo D_80391C58 = { + 0x126, 0x162, 0x38B, + 0x1, D_80391C40, + func_80388584, func_80326224, func_803883E0, + 0, 0, 0.35f, 0 +}; + +/* .code */ +Actor *func_803883E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + + if(this->velocity[0] == 0.0f || 0.0f != this->velocity[1]) + return this; + func_8033A45C(2, this->velocity[0] == 1.0f ? 1 : 0); + func_8033A45C(3, this->velocity[0] == 3.0f ? 1 : 0); + func_8033A45C(4, this->velocity[0] == 2.0f ? 1 : 0); + return func_80325888(marker, gfx, mtx, vtx); + +} + +void func_803884F4(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + if(this->state != 2){ + func_80328B8C(this, 2, 0.0001f, 1); + func_8030E878(SFX_6A_FLAGPOLE_WOBBLE, randf2(0.9f, 1.1f), 32000, this->position, 1000.0f, 2000.0f); + } +} + +void func_80388584(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3)){ + marker_despawn(this->marker); + return; + } + marker_setCollisionScripts(this->marker, NULL, func_803884F4, NULL); + this->marker->propPtr->unk8_3 = FALSE; + func_803289EC(this, randf(), 1); + this->unk124_6 = 0; + if(this->unk38_31 == 0){ + func_8038B930(this->marker); + this->velocity[0] = 0.0f; + } + }//L8038863C + + if((this->velocity[0] == 0.0f || this->velocity[1] != 0.0f)){//L8038866C + this->marker->collidable = FALSE; + if(this->velocity[0] != 0.0f){ + + } + else{ + return; + } + } + else{//L80388694 + if(!func_80329530(this, 2000)&& !func_8038BFE8(this->position, 2000)) + return; + this->marker->collidable = TRUE; + this->unk124_6 = TRUE; + } + func_8028E668(this->position, 200.0f, -10.0f, 30.0f); + if(this->state == 2){ + if(actor_animationIsAt(this, 0.9999f)){ + func_80328B8C(this, 1, 0.0001f, 1); + } + } +} diff --git a/src/FP/code_2350.c b/src/FP/code_2350.c new file mode 100644 index 00000000..c212949e --- /dev/null +++ b/src/FP/code_2350.c @@ -0,0 +1,661 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8028E668(f32[3], f32, f32, f32); + +extern f32 func_8038BE20(f32 arg0[3]); + +typedef struct { + ParticleEmitter *unk0; + ParticleEmitter *unk4; + f32 unk8; + f32 unkC; + f32 unk10; + f32 unk14; + u8 unk18; + u8 unk19; +}ActorLocal_FP_2350; + +typedef struct { + s32 unk0; + s32 actor_id; +}Struct_FP_2350; + +Actor *func_80388740(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80388D70(ActorMarker *caller, enum asset_e text_id, s32 arg2); +void func_80388EE8(ParticleEmitter *pCtrl); +void func_80388F4C(Actor *this); +void func_803896FC(Actor *this); + +/* .data */ +ActorAnimationInfo D_80391C80[] = { + {0x000, 0.0f}, + {0x150, 0.6f}, + {0x150, 0.6f}, + {0x150, 0.6f}, + {0x150, 0.6f}, + {0x179, 2.3f}, + {0x17A, 1.3f}, + {0x17B, 2.0f}, + {0x150, 1.0f}, + {0x1AA, 4.3f}, + {0x1AB, 4.3f}, + {0x150, 1.0f}, + {0x150, 0.6f} +}; + +ActorInfo D_80391CE8 = { 0x97, ACTOR_C8_BOGGY_2, ASSET_38A_MODEL_BOGGY_1, + 0x1, D_80391C80, + func_80388F4C, func_803896FC, func_80388740, + 0, 0, 1.4f, 0 +}; +f32 D_80391D0C[3] = {1842.0f, 658.0f, 5758.0f}; +f32 D_80391D18[3] = {1463.0f, 635.0f, 5193.0f}; +s32 D_80391D24[3] = {0xc8, 0xc8, 0xe6}; +struct31s D_80391D30 = { + {0.2f, 0.4f}, + {1.2f, 1.6f}, + {0.0f, 0.001f}, + {0.3f, 0.45f}, + 0.0f, 0.01f +}; + +struct42s D_80391D58 = { + {{-10.0f, 10.0f, -10.0f}, {10.0f, 240.0f, 10.0f}}, + {{0.0f, 0.0f, 0.0f}, {0.0f, 20.0f, 0.0f}} +}; + +f32 D_80391D88[3] = { 1592.0f, 673.0f, 5895.0f}; +f32 D_80391D94[3] = {0.0f, 0.0f, 0.0f}; +s32 D_80391DA0[3] = {0x5F5, 0x292, 0x1539}; +s32 D_80391DAC[3] = {-0x11F8, 0x637, -0x1816}; +Struct_FP_2350 D_80391DB8[7]={ + {0x361, 0x35D}, + {0x365, 0x35D}, + {0x362, 0x360}, + {0x366, 0x35D}, + {0x37B, 0x35D}, + {0x363, 0x35F}, + {0x364, 0x35E} +}; + +f64 D_80392CB8; + +s32 D_80392F20[3]; + +/* .code */ +Actor *func_80388740(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + ActorLocal_FP_2350 * local = (ActorLocal_FP_2350 *) &this->local; + f32 sp2C[3]; + + func_8033A45C(1, 1); + func_8033A45C(3, 1); + this = func_80325888(marker, gfx, mtx, vtx); + if(this->unk16C_4 && marker->unk14_21){ + if( this->state == 4 + || this->state == 5 + || this->state == 6 + || this->state == 8 + ){ + if(this->unk4C != 0.0f && (func_8023DB5C() & 1)){ + if(-2.0 < this->roll){ + func_8034A174(func_80329934(), 6, sp2C); + particleEmitter_setPosition(local->unk0, sp2C); + particleEmitter_emitN(local->unk0, 1); + } + + if(this->roll < 2.0){ + func_8034A174(func_80329934(), 7, sp2C); + particleEmitter_setPosition(local->unk4, sp2C); + particleEmitter_emitN(local->unk4, 1); + } + } + }//L803888D4 + } + return this; +} + +void func_803888E4(Actor *this){ + func_80328B8C(this, 0xC, 0.0001f, 1); + if(!jiggyscore_isSpawned(JIGGY_30_FP_BOGGY_2)){ + if(mapSpecificFlags_get(5)){ + func_80324DBC(0.1f, 0xc06, 0x2a, D_80391D18, this->marker, func_80388D70, NULL); + } + else{//L80388964 + func_80324DBC(0.1f, 0xc03, 0x2a, D_80391D18, this->marker, func_80388D70, NULL); + } + } + else{//L803889A0 + func_8028F490(D_80391D0C); + if(mapSpecificFlags_get(6)){ + func_80324DBC(0.1f, 0xc29, 0x2a, D_80391D18, this->marker, func_80388D70, NULL); + } + else{ + func_80324DBC(0.1f, 0xc28, 0x2a, D_80391D18, this->marker, func_80388D70, NULL); + } + }//L80388A30 + mapSpecificFlags_set(5, TRUE); + func_8038B9C8(); +} + +void func_80388A50(Actor *this){ + ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local; + + func_80328B8C(this, 2, 0.0001f, 1); + timed_setCameraToNode(0.0f, 4); + local->unk18 = 0; +} + +void func_80388A94(Actor *this){ + func_80388A50(this); + if(mapSpecificFlags_get(6)){ + func_80311480(0xc0a, 0xe, this->position, this->marker, func_80388D70, NULL); + } + else{ + func_80311480(0xc09, 0xe, this->position, this->marker, func_80388D70, NULL); + } +} + +void func_80388B18(Actor *this, u8 arg1){ + if(arg1 == TRUE){ + if(player_getTransformation() == TRANSFORM_4_WALRUS){ + func_80388A50(this); + if(mapSpecificFlags_get(5)){ + func_80311480(0xc05, 0xf, this->position, this->marker, func_80388D70, NULL); + } + else{ + func_80311480(0xc02, 0xf, this->position, this->marker, func_80388D70, NULL); + } + } + else{//L80388BB8 + if(!func_803203FC(0xb3)){ + if(func_80311480(0xc01, 0xe, this->position, this->marker, func_80388D70, NULL)){ + func_803204E4(0xb3, TRUE); + func_80388A50(this); + } + } + } + } + else{//L80388C08 + if(player_getTransformation() == TRANSFORM_4_WALRUS){ + if(!func_803203FC(0xb4)){ + if(func_80311480(0xc08, 0xe, this->position, this->marker, func_80388D70, NULL)){ + func_803204E4(0xb4, TRUE); + func_80388A50(this); + } + } + } + else{ + func_80388A94(this); + } + } +} + +void func_80388C88(Actor *this){ + ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local; + + this->unk10_12 = 0; + local->unk18 = 1; +} + +bool func_80388CA0(Actor *this){ + ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local; + u32 sp20; + + if(func_8028ECAC() != 0 && func_8028ECAC() != BSGROUP_8_TROT) + return FALSE; + + if( !func_80329530(this, 1100) ){ + local->unk18 = TRUE; + } + + sp20 = this->unk10_12; + this->unk10_12 = func_80329530(this, 0x1C2); + return (sp20 == 0 && this->unk10_12 && local->unk18); +} + +void func_80388D70(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *this = marker_getActor(caller); + ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local; + + func_80324E88(0.0f); + switch(text_id){ + case 0xc03: + case 0xc06: + case 0xc28: + case 0xc29://L80388DC4 + func_8025A6EC(COMUSIC_3A_FP_BOGGY_RACE, 25000); + func_8025A58C(0, 4000); + func_8024BD08(0); + func_802BE720(); + local->unk0 = partEmitList_pushNew(16); + local->unk4 = partEmitList_pushNew(16); + func_80388EE8(local->unk0); + func_80388EE8(local->unk4); + func_80328B8C(this, 4, 0.0001f, 1); + local->unk14 = (local->unk19 == 2) ? 1.0f : 0.0f; + this->marker->unk40_23 = TRUE; + break; + default://L80388E78 + switch(arg2){ + case 1: + func_803888E4(this); + mapSpecificFlags_set(6, TRUE); + break; + case 0: + func_80328B8C(this, 1, 0.0001f, 1); + break; + default: + func_80328B8C(this, 1, 0.0001f, 1); + break; + } + break; + } +} + +void func_80388EE8(ParticleEmitter *pCtrl){ + particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST); + func_802EFFA8(pCtrl, D_80391D24); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_80391D58); + func_802EFB98(pCtrl, &D_80391D30); + func_802F0D54(pCtrl); +} + +void func_80388F4C(Actor *this){} + +void func_80388F54(ActorMarker *marker){ + Actor *other = func_80328230(ACTOR_C8_BOGGY_2, D_80391D88, D_80391D94); + func_80343DEC(other); +} + +void func_80388F90(Actor *this){ + ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local; + + func_8030DB04(this->unk44_31, 32000, this->position, 1000.0f, 4000.0f); + func_8030DBB4(this->unk44_31, local->unk8); + func_8030E2C4(this->unk44_31); +} + +bool func_80388FE8(Actor *this, f32 arg1, f32 arg2){ + if(arg2 < 0.0f && 0.0f < arg1){ + func_8030E878(SFX_8D_BOGGY_OHWW, randf2(1.04f, 1.12f), 32000, this->position, 600.0f, 1200.0f); + return TRUE; + } + else if( 0.0f < arg2 && arg1 < 0.0f){ + func_8030E878(SFX_F9_GRUNTLING_NOISE_1, randf2(1.04f, 1.12f), 32000, this->position, 600.0f, 1200.0f); + return TRUE; + } + return FALSE; +} + +void func_803890DC(Actor *this, u8 arg1){ + ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local; + + f32 yaw_to_target; + f32 yaw; + f32 f16; + f32 prev_roll; + f32 dyaw; + + yaw_to_target = (this->unk1C[0] < 180.0f) ? this->unk1C[0] : this->unk1C[0] - 360.0f; + yaw = (this->yaw < 180.0f) ? this->yaw : this->yaw - 360.0f; + + prev_roll = this->roll; + f16 = (arg1 == 2) ? 1100.0f : 780.0f; + dyaw = yaw - yaw_to_target; + dyaw = (180.0f < dyaw) ? 360.0f - dyaw + : (dyaw < -180.0f) ? 360.0f + dyaw + : dyaw; + + this->roll += (2.0*dyaw)*(this->unk4C / f16); + + this->roll = (26.0f < this->roll) ? 26.0f + : (this->roll < -26.0f) ? -26.0f + : this->roll; + + this->roll += (this->roll < 0.0f) ? 1.8 + : (0.0f < this->roll) ? -1.8 + : 0.0; + + if(local->unk10 == 0.0){ + if(this->state != 9 && this->state != 10 && this->state != 11){ + if( (23.0f < this->roll && prev_roll < 23.0f) + || (this->roll < -23.0f && -23.0f < prev_roll) + ){//L8038933C + func_8030E878(SFX_8C_BOGGY_WAHEY, randf2(1.04f, 1.12f), 32000, this->position, 600.0f, 1500.0f); + local->unk10 = 1.5f; + }//L80389394 + } + }//L80389398 + + if(this->roll <= 1.8 && -1.8 <= this->roll){ + this->roll = 0.0f; + } +} + +void func_803893E4(Actor *this, f32 arg1, u8 arg2){ + ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local; + f32 sp30; + f32 sp2C; + f32 sp28; + if((u8)arg2 != 2){ + sp30 = 575.0f; + sp2C = 780.0f; + sp28 = 1.7f; + } + else{ + sp30 = 700.0f; + sp2C = 1100.0f; + sp28 = 2.3f; + } + + func_80343DEC(this); + if(this->state == 7){ + this->unk4C += ((f32)D_80392F20[1] - this->position_y)*0.02; + } + else{ + this->unk4C += ((f32)D_80392F20[1] - this->position_y)*0.03 + sp28*func_8038BE20(this->position); + } + + if(this->unk4C < sp30){ + this->unk4C = sp30; + } + if(sp2C < this->unk4C){ + this->unk4C = sp2C; + } + + if((u8)arg2 == 2 && func_8028ECAC() != 6){ + this->unk4C = 1200.0f; + } + + local->unk8 = ((this->unk4C - sp30)/(sp2C - sp30))*(0.6000000000000001) + 0.7; + func_803890DC(this, (u8)(arg2)); +} + +void func_803895E0(void){ + int i; + s16 *s0; + f32 sp64[3]; + Actor *actor; + f32 f20; + f32 f22; + f32 f8; + + for (i = 0; i< 7; i++){ + s0 = (i < 3) + ? func_803049CC(D_80391DB8[i].unk0, D_80391DA0) + : func_803049CC(D_80391DB8[i].unk0, D_80391DAC); + + nodeprop_getPosition(s0, sp64); + f20 = (f32)func_80304DA8(s0); + f8 = (f32)func_80304DB8(s0); + f22 = f8*0.01; + actor = func_8032813C(D_80391DB8[i].actor_id, sp64, (s32)f20); + actor->scale = f22; + } +} + +void func_803896FC(Actor *this){ + ActorLocal_FP_2350 *local = (ActorLocal_FP_2350 *)&this->local; + f32 sp58; + f32 sp54; + s32 sp3C[6]; + + sp58 = func_8038BE20(this->position); + sp54 = time_getDelta(); + func_8024E55C(0, sp3C); + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->unk40_23 = FALSE; + this->marker->propPtr->unk8_3 = FALSE; + this->marker->unk2C_1 = TRUE; + this->unk44_31 = func_8030ED2C(SFX_18_BIGBUTT_SLIDE, 2); + D_80392F20[0] = this->position_x; + D_80392F20[1] = this->position_y; + D_80392F20[2] = this->position_z; + this->unk1C[0] = this->yaw; + local->unk0 = NULL; + local->unk4 = NULL; + local->unk8 = 0.0f; + local->unkC = 0.0f; + local->unk10 = 0.0f; + local->unk8 = 1.0f; + func_8038B9B0(this->marker); + this->unk38_31 = 0; + func_80388C88(this); + func_802C3BF8(func_803895E0); + if(jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){ + local->unk19 = 2; + this->unk4C = 900.0f; + } + else if(jiggyscore_isSpawned(JIGGY_30_FP_BOGGY_2)){ + local->unk19 = 1; + this->unk38_31 = 2; + this->unk4C = 600.0f; + func_80328B8C(this, 11, 0.0001f, 1); + } + else{ + local->unk19 = 1; + this->unk4C = 600.0f; + mapSpecificFlags_set(4, TRUE); + } + }//L803898CC + + func_8028E668(this->position, 200.0f, -200.0f, 140.0f); + if(!func_8038A1A0(this->marker)){ + switch(this->unk38_31){ + case 1://L80389920 + func_80328B8C(this, 9, 0.0001f, 1); + break; + case 2://L80389938 + func_80328B8C(this, 10, 0.0001f, 1); + break; + } + }//L80389950 + + if(0.0 unk10 - sp54) + local->unk10 =local->unk10 - sp54; + else + local->unk10 = 0.0f; + + switch(this->state){ + case 1:// L803899B8 + if(func_80388CA0(this)){ + func_80388B18(this, local->unk19); + }//L803899DC + else if(!jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2) && func_8028ECAC() == BSGROUP_C_WALRUS_SLED){ + func_803888E4(this); + } + else if( func_80329530(this, 0x1C2) + && func_8028ECAC() == 0 + && func_8028F20C() + && func_8028EFC8() + && sp3C[1] == 1 + && !func_803114B0() + ){ + if( local->unk19 == 1 + && player_getTransformation() != TRANSFORM_4_WALRUS + && func_803203FC(0xb3) + ){ + func_80311480(0xC01, 0xf, this->position, this->marker, func_80388D70, NULL); + } + else if( local->unk19 == 2){ + if( player_getTransformation() == TRANSFORM_4_WALRUS + && func_803203FC(0xb4) + ){ + func_80311480(0xC08, 0xf, this->position, this->marker, func_80388D70, NULL); + } + else if( player_getTransformation() != TRANSFORM_4_WALRUS){ + func_80388A94(this); + } + } + } + break; + + case 4:// L80389B50 + if(0.0 < local->unk14){ + local->unk14 -= sp54; + } + else{ + local->unk14 = 0.0f; + if( randf() < 0.02 && sp58 < 0.0){ + if(randf() < 0.5) + func_80328B8C(this, 5, 0.0001f, 1); + else + func_80328B8C(this, 6, 0.0001f, 1); + }//L80389C18 + + func_803893E4(this, sp58, local->unk19); + func_80388F90(this); + if(0.0 ==local->unk10 && func_80388FE8(this, sp58,local->unkC)){ + local->unk10 = 1.5f; + } + }//L80389C78 + break; + + case 5:// L80389C80 + case 6:// L80389C80 + if(actor_animationIsAt(this, 0.9999f) || sp58 >= 0.0){ + func_80328B8C(this, 4, 0.0001f, 1); + }//L80389CC8 + + func_803893E4(this, sp58, local->unk19); + func_80388F90(this); + if(0.0 == local->unk10 && func_80388FE8(this, sp58, local->unkC)){ + local->unk10 = 1.5f; + } + break; + + case 7:// L80389D34 + if(actor_animationIsAt(this, 0.9999f)){ + func_80328B8C(this, 4, 0.0001f, 1); + }//L80389D60 + func_803893E4(this, sp58, local->unk19); + func_80388F90(this); + break; + + case 8:// L80389D84 + func_80343DEC(this); + if(this->unk4C < 740.0f){ + this->unk4C += 10.0f; + } + else if(740.0f < this->unk4C) { + this->unk4C -= 10.0f; + } + func_803890DC(this, local->unk19); + func_80388F90(this); + if(0.0 == local->unk10 && func_80388FE8(this, sp58, local->unkC)){ + local->unk10 = 1.5f; + } + + break; + + case 9:// L80389E48 + func_803893E4(this, sp58, local->unk19); + if(this->unk48 < 0.99999999999){ + func_80388F90(this); + } + if(actor_animationIsAt(this, 0.9999f)){ + func_80328B8C(this, 11, 0.0001f, 1); + } + break; + + case 10:// L80389EB4 + func_803893E4(this, sp58, local->unk19); + if(this->unk48 < 0.99999999999){ + func_80388F90(this); + } + + if(actor_animationIsAt(this, 0.9999f)){ + func_80328B8C(this, 11, 0.0001f, 1); + } + break; + + case 11:// L80389F20 + func_803890DC(this, local->unk19); + + if(!actor_playerIsWithinDist(this, 2000) + && !this->marker->unk14_21 + ){ + switch(local->unk19){ + case 1: //L80389F78 + if(this->unk38_31 == 2){ + if(jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){ + func_802C3C88(func_80388F54, this->marker); + func_8038B9BC(); + marker_despawn(this->marker); + } + } + else{ + func_8038B9BC(); + marker_despawn(this->marker); + } + + break; + + case 2: //L80389FDC + if(this->unk38_31 == 2){ + if(jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3)){ + func_8038B9BC(); + marker_despawn(this->marker); + mapSpecificFlags_set(0xC, TRUE); + } + } + else{ + func_8038B9BC(); + marker_despawn(this->marker); + } + break; + } + } + break; + }//L8038A034 + + D_80392F20[0] = (s32)this->position[0]; + D_80392F20[1] = (s32)this->position[1]; + D_80392F20[2] = (s32)this->position[2]; + this->unk1C[0] = this->yaw; + local->unkC = sp58; +} + +void func_8038A09C(f32 arg0[3]){ + arg0[0] = (f32)D_80392F20[0]; + arg0[1] = (f32)D_80392F20[1]; + arg0[2] = (f32)D_80392F20[2]; +} + +void func_8038A0E4(UNK_TYPE(s32) arg0, ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + + if(actor){ + if(actor->state != 7){ + func_80328B8C(actor, 7, 0.0001f, 1); + } + else{ + func_80328B8C(actor, 4, 0.0001f, 1); + } + }; +} + +void func_8038A150(UNK_TYPE(s32) arg0, ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + + if(actor && actor->state != 8){ + func_80328B8C(actor, 8, 0.0001f, 1); + }; +} + +bool func_8038A1A0(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + switch (actor->state){ + case 9: + case 10: + case 11: + return TRUE; + default: + return FALSE; + } +} diff --git a/src/FP/code_3E00.c b/src/FP/code_3E00.c new file mode 100644 index 00000000..f98cba88 --- /dev/null +++ b/src/FP/code_3E00.c @@ -0,0 +1,179 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8028E668(f32[3], f32, f32, f32); +extern s32 func_8028F31C(f32[3], f32, s32, Actor **); + +typedef struct { + s32 unk0; + s32 unk4; + s32 unk8; + s32 unkC; +} Struct_FP_3E00; + +void func_8038A384(Actor *this); + +/* .data */ +ActorAnimationInfo D_80391DF0[] = { + {0, 0.0f}, + {ASSET_17E_ANIM_POLAR_BEAR_CUB_SAD, 5.5f}, + {ASSET_17D_ANIM_POLAR_BEAR_CUB_HAPPY, 2.5f} +}; + +ActorInfo D_80391E08 = { MARKER_1FA_POLAR_BEAR_CUB_BLUE, ACTOR_1EA_POLAR_BEAR_CUB_BLUE, ASSET_44C_MODEL_POLAR_BEAR_CUB_BLUE, + 0x1, D_80391DF0, + func_8038A384, func_80326224, func_80325888, + 2500, 0, 1.2f, 0 +}; + +ActorInfo D_80391E2C = { MARKER_1FB_POLAR_BEAR_CUB_GREEN, ACTOR_1EB_POLAR_BEAR_CUB_GREEN, ASSET_44D_MODEL_POLAR_BEAR_CUB_GREEN, + 0x1, D_80391DF0, + func_8038A384, func_80326224, func_80325888, + 2500, 0, 1.2f, 0 +}; + +ActorInfo D_80391E50 = { MARKER_1FC_POLAR_BEAR_CUB_RED, ACTOR_1EC_POLAR_BEAR_CUB_RED, ASSET_44E_MODEL_POLAR_BEAR_CUB_RED, + 0x1, D_80391DF0, + func_8038A384, func_80326224, func_80325888, + 2500, 0, 1.2f, 0 +}; + +f32 D_80391E74[3] = {-5.0f, 180.0f, 1.0f}; +Struct_FP_3E00 D_80391E80[] ={ + {0x11, 0x1FD, 0x1ED, 0x1EE}, + {0x12, 0x1FE, 0x1EF, 0x1F0}, + {0x13, 0x1FF, 0x1F1, 0x1F2} +}; + +/* .code */ +void func_8038A1F0(Actor **this_ptr, s32 arg1, enum actor_e actor_id, s32 arg3){ + func_8028F31C((*this_ptr)->position, 600.0f, actor_id, this_ptr); + + if(!func_80329530(*this_ptr, 400)) return; + if(func_8028E88C() != arg1) return; + if(!func_8028FC34()) return; + + func_8028FA34(arg3, *this_ptr); +} + +void func_8038A274(Actor *this){ + if(actor_animationIsAt(this, 0.4f)){ + func_8030E878(SFX_B2_BOGGY_KID_HAPPY, this->unk1C[0], 32000, this->position, 100.0f, 600.0f); + return; + } + + if(actor_animationIsAt(this, 0.75f)){ + func_8030E878(SFX_53_BANJO_HUIII, this->unk1C[1], 32000, this->position, 100.0f, 600.0f); + } + +} + +void func_8038A318(ActorMarker *caller, enum asset_e text_id, s32 arg1){ + if(text_id == 0xc19){ + func_802BAFE4(0x25); + jiggySpawn(JIGGY_2E_FP_PRESENTS, D_80391E74); + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 32000); + func_8025A6EC(COMUSIC_5B_FP_IGLOO_HAPPY, 25000); + func_8025A58C(0, 4000); + func_8024BD08(0); + } +} + +void func_8038A384(Actor *this){ + s32 sp3C; + enum asset_e sp38; + s32 sp34; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = FALSE; + switch(this->marker->unk14_20){ + case MARKER_1FA_POLAR_BEAR_CUB_BLUE://L8038A404 + this->unk1C[0] = 1.0f; + this->unk1C[1] = 1.2f; + animctrl_setAnimTimer(this->animctrl, 0.0f); + break; + + case MARKER_1FB_POLAR_BEAR_CUB_GREEN://L8038A438 + this->unk1C[0] = 1.1f; + this->unk1C[1] = 1.3f; + animctrl_setAnimTimer(this->animctrl, 0.4f); + break; + + case MARKER_1FC_POLAR_BEAR_CUB_RED://L8038A470 + this->unk1C[0] = 1.2f; + this->unk1C[1] = 1.4f; + animctrl_setAnimTimer(this->animctrl, 0.7f); + break; + }//L8038A4A0 + + if( jiggyscore_isCollected(JIGGY_2E_FP_PRESENTS) + || func_803203FC(0xC1) + ){ + func_80328B8C(this, 2, randf2(0.0f, 0.9f), 1); + } + }//L8038A4E4 + + sp34 = levelSpecificFlags_get(0x11) + levelSpecificFlags_get(0x12) + levelSpecificFlags_get(0x13); + sp38 = (sp34 == 1) ? 0xC17 + : (sp34 == 2) ? 0xC18 + : 0xC19; + + this->yaw_moving = (f32)func_80329784(this); + func_80328FB0(this, 2.0f); + func_8028E668(this->position, 100.0f, -10.0f, 100.0f); + + switch(this->state){ + case 1://L8038A5B0 + if(!levelSpecificFlags_get(0x19) && func_80329530(this, 0xfa)){ + if(func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT){ + if(sp34 == 0 + && !jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3) + && !jiggyscore_isSpawned(JIGGY_2C_FP_BOGGY_3) + ){ + if(func_80311480(0xc1a, 0x2a, NULL, NULL, NULL, NULL)) + levelSpecificFlags_set(0x19, TRUE); + } + } + + }//L8038A648 + + switch(this->marker->unk14_20){ + case MARKER_1FA_POLAR_BEAR_CUB_BLUE: + sp3C = 0; + break; + + case MARKER_1FB_POLAR_BEAR_CUB_GREEN: + sp3C = 1; + break; + + case MARKER_1FC_POLAR_BEAR_CUB_RED: + sp3C = 2; + break; + } + if(levelSpecificFlags_get(D_80391E80[sp3C].unk0)){ + func_80328B8C(this, 2, 0.001f, 1); + if(sp38 == 0xc19){ + func_80311480(sp38, 0x2f, this->position, this->marker, func_8038A318, NULL); + } + else{ + func_80311480(sp38, 0x3, this->position, this->marker, func_8038A318, NULL); + } + } + else{//L8038A73C + func_8038A1F0(&this, D_80391E80[sp3C].unk4, D_80391E80[sp3C].unk8, D_80391E80[sp3C].unkC); + if( actor_animationIsAt(this, 0.45f) + && !func_803114B0() + ){ + func_8030E878(SFX_B1_BOGGY_KID_CRYING, randf2(0.9f, 1.1f), 32000, this->position, 150.0f, 700.0f); + } + }//L8038A7DC + break; + case 2://L8038A7C0 + if(!func_803114B0()){ + func_8038A274(this); + } + break; + }//L8038A7DC +} diff --git a/src/FP/code_4400.c b/src/FP/code_4400.c new file mode 100644 index 00000000..5322a5c2 --- /dev/null +++ b/src/FP/code_4400.c @@ -0,0 +1,80 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +extern struct { + u8 unk0; + s32 unk4; + s32 unk8; + s32 unkC; + f32 spawn_pos[3]; + u8 unk1C; +} D_80392F30; + +/* .code */ +void func_8038A7F0(void){ + if( map_get() != MAP_27_FP_FREEZEEZY_PEAK + || jiggyscore_isCollected(JIGGY_31_FP_SIR_SLUSH) + || jiggyscore_isSpawned(JIGGY_31_FP_SIR_SLUSH) + ){ + D_80392F30.unk0 = 0; + return; + } + + D_80392F30.unk1C = 0; + if(func_80304E24(0x128, D_80392F30.spawn_pos)){ + D_80392F30.unk1C = 1; + } + D_80392F30.unk0 = 1; + D_80392F30.unk4 = 0; + D_80392F30.unk8 = 0; +} + +void func_8038A888(void){} + +void func_8038A890(void){ + switch(D_80392F30.unk0){ + case 0: + break; + + case 1://L8038A8CC + if(D_80392F30.unk4) break; + if(!D_80392F30.unk8) break; + + D_80392F30.unk0 = 2; + D_80392F30.unkC = 0; + break; + + case 2://L8038A8F4 + if(D_80392F30.unkC >= 0x4b){ + + if(D_80392F30.unk1C){ + func_802BAFE4(0x12); + jiggySpawn(JIGGY_31_FP_SIR_SLUSH, D_80392F30.spawn_pos); + func_802C3F04(func_802C4140, ACTOR_4C_STEAM, + reinterpret_cast(s32, D_80392F30.spawn_pos[0]), + reinterpret_cast(s32, D_80392F30.spawn_pos[1]), + reinterpret_cast(s32, D_80392F30.spawn_pos[2]) + ); + } + D_80392F30.unk0 = 3; + } + else{ + D_80392F30.unkC++; + } + break; + + case 3://L8038A96C + break; + } +} + +void func_8038A978(void){ + D_80392F30.unk4--; +} + +void func_8038A990(void){ + D_80392F30.unk8++; + D_80392F30.unk4++; +} diff --git a/src/FP/code_45D0.c b/src/FP/code_45D0.c new file mode 100644 index 00000000..9494f9db --- /dev/null +++ b/src/FP/code_45D0.c @@ -0,0 +1,79 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + u8 unk0; + // u8 pad1[3]; + s32 unk4; + s32 unk8; + f32 spawn_pos[3]; + u8 unk18; +} Struct_FP_45D0_0; + +extern Struct_FP_45D0_0 D_80392F50; + +/* .code */ +void func_8038A9C0(void){ + if( map_get() != MAP_27_FP_FREEZEEZY_PEAK + || jiggyscore_isCollected(JIGGY_2D_FP_SNOWMAN_BUTTONS) + || jiggyscore_isSpawned(JIGGY_2D_FP_SNOWMAN_BUTTONS) + ){ + D_80392F50.unk0 = 0; + return; + } + + D_80392F50.unk18 = 0; + if(func_80304E24(0x15E, D_80392F50.spawn_pos)){ + D_80392F50.unk18 = 1; + } + D_80392F50.unk0 = 1; + D_80392F50.unk4 = 3; +} + +void func_8038AA58(void){} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_45D0/func_8038AA60.s") +#else +void func_8038AA60(void){ + switch(D_80392F50.unk0){ + // case 0: + // break; + + case 1: + if(D_80392F50.unk4 <= 0){ + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + D_80392F50.unk0 = 2; + D_80392F50.unk8 = 0; + } + break; + + case 2://L8038A8F4 + if(D_80392F50.unk8 >= 0x1e){ + + if(D_80392F50.unk18){ + func_802BAFE4(0x11); + jiggySpawn(JIGGY_2D_FP_SNOWMAN_BUTTONS, D_80392F50.spawn_pos); + func_802C3F04(func_802C4140, ACTOR_4C_STEAM, + reinterpret_cast(s32, D_80392F50.spawn_pos[0]), + reinterpret_cast(s32, D_80392F50.spawn_pos[1]), + reinterpret_cast(s32, D_80392F50.spawn_pos[2]) + ); + } + D_80392F50.unk0 = 3; + } + else{ + D_80392F50.unk8++; + } + break; + + case 3://L8038A96C + break; + } +} +#endif + +void func_8038AB40(void){ + D_80392F50.unk4--; +} diff --git a/src/FP/code_4770.c b/src/FP/code_4770.c new file mode 100644 index 00000000..fe5e40d9 --- /dev/null +++ b/src/FP/code_4770.c @@ -0,0 +1,611 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8028F710(s32, f32); + +typedef struct { + ActorMarker *marker; + f32 position[3]; + f32 unk10; +}Struct_FP_4770; + +/* .data */ +extern f32 D_80391ED0[3]; +extern f32 D_80391EDC; +extern f32 D_80391EE0[3]; +extern f32 D_80391EEC; +extern f32 D_80391EF0[3]; +extern f32 D_80391EFC; +extern f32 D_80391F00[3]; +extern f32 D_80391F0C; +extern f32 D_80391F10[3]; +extern f32 D_80391F1C; +extern f32 D_80391F20[3]; +extern f32 D_80391F2C[3]; +extern f32 D_80391F38[3]; + +/* .bss */ +extern ActorMarker *D_80393590[5]; +extern struct { + u8 unk0; + // u8 pad1[0x3]; + s32 unk4; + s32 unk8; + s32 unkC; + s32 unk10; + ActorMarker *unk14; + u8 unk18; + u8 unk19; + u8 unk1A; +}D_803935A8; +extern Struct_FP_4770 D_80392F70[0x27]; +extern Struct_FP_4770 D_80393280[0x27]; + + +/* .code */ +void func_8038AB60(s32 arg0){ + int i; + + func_8028F8F8(0xe, arg0 ^ 1); + + for (i = 0x14; i < 0x23; i++){ + func_8028F8F8(i, arg0); + } + + for (i = 0x32; i < 0x38; i++){ + func_8028F8F8(i, arg0); + } +} + +void func_8038ABDC(void){ + comusic_8025AB44(COMUSIC_3A_FP_BOGGY_RACE, 0, 4000); + func_8025AABC(COMUSIC_3A_FP_BOGGY_RACE); + func_8025A58C(-1, 4000); + func_8024BD08(1); +} + +void func_8038AC20(s32 gate_indx, s32 arg1){ + Actor *a1; + Actor *a2; + + a1 = marker_getActor(D_80392F70[gate_indx].marker); + a2 = marker_getActor(D_80393280[gate_indx].marker); + + a1->velocity[0] = (f32)arg1; + a2->velocity[0] = (f32)arg1; +} + +//spawn race flag pair +void func_8038AC90(s32 indx, s32 arg1){ + ActorMarker *m1; + ActorMarker *m2; + Actor *a1; + Actor *a2; + + m1 = func_8032813C(0x161, D_80392F70[indx].position, 0)->marker; + m2 = func_8032813C(0x162, D_80393280[indx].position, 0)->marker; + a1 = marker_getActor(m1); + a2 = marker_getActor(m2); + + a1->unk38_31 = 1; + a2->unk38_31 = 1; + + a1->unkF4_8 = indx + 1; + a2->unkF4_8 = indx + 1; + + D_80392F70[indx].marker = a1->marker; + D_80393280[indx].marker = a2->marker; + + func_8038AC20(indx, arg1); + + a1->unk1C[0] = a2->position_x; + a1->unk1C[1] = a2->position_y; + a1->unk1C[2] = a2->position_z; + + if(indx + 1 == 0x27){ + a1->velocity[1] = 1.0f; + a2->velocity[1] = 1.0f; + } +} + +void func_8038ADE4(s32 indx, s32 arg1){ + func_802C3D3C(func_8038AC90, indx, arg1); +} + +void func_8038AE14(s32 indx){ + if(D_80392F70[indx].marker){ + func_80326310(marker_getActor(D_80392F70[indx].marker)); + D_80392F70[indx].marker = NULL; + } + + if(D_80393280[indx].marker){ + func_80326310(marker_getActor(D_80393280[indx].marker)); + D_80393280[indx].marker = NULL; + } +} + +void func_8038AEA0(void){ + int i; + for(i = 0; i < 0x27; i++){ + func_8038AE14(i); + } +} + +void func_8038AEE0(s32 indx){ + Actor *sp1C; + switch(indx){ + case 0:// L8038AF0C + sp1C = func_8032813C(0x22d, D_80391ED0, D_80391EDC); + break; + + case 1:// L8038AF38 + sp1C = func_8032813C(0x22e, D_80391EE0, D_80391EEC); + break; + + case 2:// L8038AF64 + sp1C = func_8032813C(0x22d, D_80391EF0, D_80391EFC); + break; + + case 3:// L8038AF90 + sp1C = func_8032813C(0x22d, D_80391F00, D_80391F0C); + break; + + case 4:// L8038AFBC + sp1C = func_8032813C(0x22d, D_80391F10, D_80391F1C); + break; + } + D_80393590[indx] = sp1C->marker; +} + +void func_8038B00C(s32 indx){ + func_802C3C88(func_8038AEE0, indx); +} + +void func_8038B034(void){ + int i; + for(i = 0; i < 5; i++){ + func_8038B00C(i); + } +} + +void func_8038B074(s32 indx){ + if(D_80393590[indx]){ + marker_despawn(D_80393590[indx]); + D_80393590[indx] = NULL; + } +} + +void func_8038B0B8(void){ + int i; + for(i = 0; i < 5; i++){ + func_8038B074(i); + } +} + +void func_8038B0F8(void){ + Actor *trainers = func_8032813C(ACTOR_2C_TURBO_TALON_TRAINERS, D_80391F20, 100); + trainers->unk10_1 = FALSE; +} + +void func_8038B130(enum jiggy_e jiggy_id){ + if(jiggy_id == JIGGY_2C_FP_BOGGY_3 && !jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){ + jiggySpawn(jiggy_id, D_80391F38); + } + else{ + jiggySpawn(jiggy_id, D_80391F2C); + } +} + +void func_8038B190(void){ + func_8028F66C(0x2B); + mapSpecificFlags_set(4, FALSE); + func_8028F918(0); +} + +void func_8038B1C4(void){ + D_803935A8.unk0 = 0; +} + +void func_8038B1D0(enum jiggy_e jiggy_id){ + timed_setCameraToNode(0.0f, 3); + timedFunc_set_0(0.0f, func_8038AEA0); + timedFunc_set_0(0.0f, func_8038B0B8); + timedFunc_set_1(0.1f, (TFQM1) func_8038B130, jiggy_id); + timedFunc_set_0(5.0f, func_8038B190); + timedFunc_set_0(5.0f, func_8038B1C4); + func_80324E88(5.0f); + +} + +void func_8038B268(void){ + func_80324E88(0.0f); + timedFunc_set_0(0.0f, func_8038AEA0); + timedFunc_set_0(0.0f, func_8038B0B8); + func_8028FA14(map_get(), 0x11); + func_8028F66C(0x2A); +} + +void func_8038B2C8(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *actor; + if(D_803935A8.unk14){ + actor = marker_getActor(D_803935A8.unk14); + } + + switch(text_id){ + case 0xc04: //8038B318 + func_8038B268(); + break; + + case 0xc07: //8038B328 + func_8038B1D0(JIGGY_30_FP_BOGGY_2); + break; + + case 0xc0b: //8038B338 + func_8038B268(); + break; + + case 0xc0d: //8038B348 + func_8038B1D0(JIGGY_2C_FP_BOGGY_3); + break; + + case 0xc10: //8038B358 + func_8038ABDC(); + func_8028FA14(map_get(), 0x11); + func_8028F66C(0x2A); + timedFunc_set_0(0.0f, func_8038B1C4); + break; + }//L8038B38C +} + +void func_8038B39C(void){ + if(jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2) && func_8028ECAC() == BSGROUP_6_TURBO_TALON_TRAINERS){ + func_8028F710(3, 2.0f); + } + func_8028F918(1); + func_8025A6EC(COMUSIC_3B_MINIGAME_VICTORY, 28000); + func_8038AB60(0); + func_8038ABDC(); + timed_setCameraToNode(0.0f, 1); +} + +void func_8038B410(void){ + Actor *sp2C; + + func_8028F918(2); + if(D_803935A8.unk14) + sp2C = marker_getActor(D_803935A8.unk14); + + sp2C->unk38_31 = 1; + func_8025A6EC(COMUSIC_3C_MINIGAME_LOSS, 28000); + func_8038AB60(0); + func_8038ABDC(); + if(!jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){ + timed_setCameraToNode(0.0f, 1); + timed_playSfx(1.0f, SFX_8C_BOGGY_WAHEY, 1.0f, 32000); + func_80324DBC(2.0f, 0xC04, 0x2b, sp2C->position, NULL, func_8038B2C8, NULL); + }//L8038B4E0 + else{ + timed_setCameraToNode(0.0f, 1); + timed_playSfx(1.0f, SFX_8C_BOGGY_WAHEY, 1.0f, 32000); + func_80324DBC(2.0f, 0xC0b, 0x2b, sp2C->position, NULL, func_8038B2C8, NULL); + + } +} + +void func_8038B544(void){ + Actor *sp2C; + int i; + f32 f2; + f32 f0; + + switch(D_803935A8.unk0){ + case 1: //L8038B57C + if(D_803935A8.unk4 < 0x4e) break; + + for(i = 0; i < 0x27; i++){ + if(i < 0x26){ + f0 = D_80392F70[i+1].position[2] - D_80392F70[i].position[2]; + f2 = D_80392F70[i+1].position[0] - D_80392F70[i].position[0]; + D_80392F70[i].unk10 = f0*f0 + f2*f2; + } + if(D_80392F70[0x26].unk10 < D_80392F70[i].unk10) + D_80392F70[0x26].unk10 = D_80392F70[i].unk10; + } + func_8038AEA0(); + D_803935A8.unk0 = NULL; + break; + + case 2: //L8038B61C + if(jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2) && func_8028ECAC() == BSGROUP_6_TURBO_TALON_TRAINERS){ + func_8028F710(3, 20.0f); + } + + if(D_80392F70[0x26].marker == NULL) break; + + if(3.0f == marker_getActor(D_80392F70[0x26].marker)->velocity[0]){ + func_8038B39C(); + D_803935A8.unk0 = 3; + break; + } + + if(D_803935A8.unk10){ + func_8038B410(); + D_803935A8.unk0 = 4; + } + break; + + case 3: //L8038B6C4 + if(D_803935A8.unk14){ + sp2C = marker_getActor(D_803935A8.unk14); + } + sp2C->unk38_31 = 2; + timed_playSfx(1.0f, SFX_8D_BOGGY_OHWW, 1.0f, 32000); + if(jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2) || jiggyscore_isSpawned(JIGGY_30_FP_BOGGY_2)){ + func_80324DBC(2.0f, 0xc0d, 0x2a, sp2C->position, NULL, func_8038B2C8, NULL); + } + else{ + func_80324DBC(2.0f, 0xc07, 0x22, sp2C->position, NULL, func_8038B2C8, NULL); + } + D_803935A8.unk0 = 4; + break; + }//L8038B794 +} + +void func_8038B7A4(void){ + int i; + + func_8038AB60(0); + + if(map_get() != MAP_27_FP_FREEZEEZY_PEAK || jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3)){ + D_803935A8.unk0 = 0; + return; + } + + D_803935A8.unk0 = 1; + D_803935A8.unk14 = NULL; + D_803935A8.unk4 = 0; + D_803935A8.unk8 = -1; + D_803935A8.unkC = -1; + D_803935A8.unk10 = 0; + D_803935A8.unk18 = 0; + D_803935A8.unk19 = 0; + D_803935A8.unk1A = 0; + + for(i = 0; i < 0x27; i++){ + D_80392F70[i].marker = NULL; + D_80393280[i].marker = NULL; + D_80392F70[i].position[0] = D_80392F70[i].position[1] = D_80392F70[i].position[2] = 0.0f; + D_80393280[i].position[0] = D_80393280[i].position[1] = D_80393280[i].position[2] = 0.0f; + D_80392F70[i].unk10 = 0.0f; + D_80393280[i].unk10 = 0.0f; + } + for(i = 0; i < 5; i++){ + D_80393590[i] = NULL; + } +} + +void func_8038B8A8(){} + +void func_8038B8B0(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + s32 tmp_a0; + + tmp_a0 = actor->unkF4_8 - 1; + if(tmp_a0 < 0x27){ + D_80392F70[tmp_a0].marker = actor->marker; + D_80392F70[tmp_a0].position[0] = actor->position[0]; + D_80392F70[tmp_a0].position[1] = actor->position[1]; + D_80392F70[tmp_a0].position[2] = actor->position[2]; + D_803935A8.unk4++; + }//L8038B920 +} + +void func_8038B930(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + s32 tmp_a0; + + tmp_a0 = actor->unkF4_8 - 1; + if(tmp_a0 < 0x27){ + D_80393280[tmp_a0].marker = actor->marker; + D_80393280[tmp_a0].position[0] = actor->position[0]; + D_80393280[tmp_a0].position[1] = actor->position[1]; + D_80393280[tmp_a0].position[2] = actor->position[2]; + D_803935A8.unk4++; + }//L8038B9A0 +} + +void func_8038B9B0(ActorMarker *marker){ + D_803935A8.unk14 = marker; +} + +void func_8038B9BC(void){ + D_803935A8.unk14 = NULL; +} + +void func_8038B9C8(void){ + int i; + + func_8038ADE4(0, 1); + for(i = 1; i < 4; i++){ + func_8038ADE4(i, 2); + } + func_8038ADE4(0x26, 2); + func_8038B034(); + if(jiggyscore_isSpawned(JIGGY_30_FP_BOGGY_2) || jiggyscore_isCollected(JIGGY_30_FP_BOGGY_2)){ + func_802C3BF8(func_8038B0F8); + } + + D_803935A8.unk8 = -1; + D_803935A8.unkC = -1; + D_803935A8.unk10 = 0; + D_803935A8.unk18 = 0; + D_803935A8.unk19 = 0; + D_803935A8.unk1A = 0; + func_8038AB60(1); + D_803935A8.unk0 = 2; +} + +void func_8038BA88(s32 arg0){ + + D_803935A8.unk8 = --arg0; + func_8038AC20(arg0, 3); + if(arg0 + 1 < 39){ + func_8038AC20(arg0 + 1, 1); + } + + if(arg0 + 4 < 38){ + func_8038ADE4(arg0 + 4, 2); + } + + if(arg0 >= 2){ + func_8038AE14(arg0 - 2); + } + + if(arg0 + 4 < 11){ + func_8028F8F8(20, 1); + func_8028F8F8(20, 1); + func_8028F8F8(21, 1); + func_8028F8F8(22, 1); + func_8028F8F8(30, 0); + } + else{ + func_8028F8F8(20, 0); + func_8028F8F8(21, 0); + func_8028F8F8(22, 0); + func_8028F8F8(30, 1); + } + + switch(D_803935A8.unkC - D_803935A8.unk8){ + case 3: + func_8025AEA0(0x3a, 0x411aa); + break; + case 2: + func_8025AEA0(0x3a, 0x493e0); + break; + case 4: + break; + default: + func_8025AEA0(0x3a, 0x51615); + break; + + + } +} + +void func_8038BC0C(s32 arg0){ + + if(D_803935A8.unkC - D_803935A8.unk8 < 4 || 0x23 < D_803935A8.unkC){ + if(D_803935A8.unk14) + marker_getActor(D_803935A8.unk14); + + if(func_8038A1A0(D_803935A8.unk14)) + return; + + D_803935A8.unkC = arg0-1; + if(D_803935A8.unkC >= 0x26){ + D_803935A8.unk10 = 1; + return; + } + + if(D_803935A8.unk0 == 3) return; + if(D_803935A8.unk0 == 4) return; + if(D_803935A8.unkC >= 0x25) return; + + switch(D_803935A8.unkC - D_803935A8.unk8){ + case 4: + if(D_803935A8.unk1A) + break; + D_803935A8.unk1A = TRUE; + func_8038AB60(0); + if(!func_8028F22C()){ + func_8028F918(2); + func_80311480(0xc10, 0x20, NULL, NULL, func_8038B2C8, NULL); + }//L8038BD40 + D_803935A8.unk0 = 4; + break; + + case 3: + if(!D_803935A8.unk19 && !func_8028F22C()){ + D_803935A8.unk19 = 1; + func_80311480(0xc0f, 0x20, NULL, NULL, NULL, NULL); + }//L8038BD94 + func_8025AEA0(0x3a, 0x411aa); + break; + + case 2: + if(!D_803935A8.unk18 && !func_8028F22C()){ + D_803935A8.unk18 = 1; + func_80311480(0xc0e, 0x20, NULL, NULL, NULL, NULL); + }//L8038BDF0 + func_8025AEA0(0x3a, 0x493e0); + break; + + default: + func_8025AEA0(0x3a, 0x51615); + break; + } + } +} + +f32 func_8038BE20(f32 arg0[3]){ + f32 sp38[4]; + f32 f18; + f32 sp30; + f32 sp2C; + f32 tmp_f12; + + tmp_f12 = (f32)(D_803935A8.unkC - D_803935A8.unk8); + if(D_803935A8.unk0 != 2 || D_803935A8.unkC < 0 || D_803935A8.unk8 < 0) + return 0.0f; + + if(tmp_f12 == 0.0f){ + player_getPosition(sp38); + + f18 = D_80392F70[D_803935A8.unkC].unk10; + if( 0.0 == f18 ) + return 0.5f; + + sp30 = ((arg0[0] - D_80392F70[D_803935A8.unkC].position[0])*(D_80392F70[D_803935A8.unkC+1].position[0] - D_80392F70[D_803935A8.unkC].position[0]) + (arg0[2] - D_80392F70[D_803935A8.unkC].position[2])*(D_80392F70[D_803935A8.unkC+1].position[2] - D_80392F70[D_803935A8.unkC].position[2]))/f18; + sp2C = ((sp38[0] - D_80392F70[D_803935A8.unkC].position[0])*(D_80392F70[D_803935A8.unkC+1].position[0] - D_80392F70[D_803935A8.unkC].position[0]) + (sp38[2] - D_80392F70[D_803935A8.unkC].position[2])*(D_80392F70[D_803935A8.unkC+1].position[2] - D_80392F70[D_803935A8.unkC].position[2]))/f18; + return -(sp30 - sp2C); + }//L8038BF58 + + tmp_f12 += (tmp_f12 < 0.0f) ? -0.5 : 0.5; + return -tmp_f12; +} + +bool func_8038BFA0(void){ + if ( D_803935A8.unk0 == 2 + || D_803935A8.unk0 == 3 + || D_803935A8.unk0 == 4 + || D_803935A8.unk1A + ){ + return TRUE; + } + return FALSE; +} + +bool func_8038BFE8(f32 arg0[3], s32 arg1){ + Actor *actor; + + if(D_803935A8.unk14){ + actor = marker_getActor(D_803935A8.unk14); + } + else{ + return FALSE; + } + + if( (actor->position[0] - arg0[0])*(actor->position[0] - arg0[0]) + + (actor->position[1] - arg0[1])*(actor->position[1] - arg0[1]) + + (actor->position[2] - arg0[2])*(actor->position[2] - arg0[2]) + < arg1*arg1 + ){ + return TRUE; + } + return FALSE; +} + +s32 func_8038C098(void){ + return D_803935A8.unk10; +} diff --git a/src/FP/code_4D0.c b/src/FP/code_4D0.c new file mode 100644 index 00000000..f31b5551 --- /dev/null +++ b/src/FP/code_4D0.c @@ -0,0 +1,93 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *func_803868C0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80386AA4(Actor *this); + +/* .data */ +ActorAnimationInfo D_80391A40 []= { + { ASSET_1A1_ANIM_SLED, 1.0f}, + { ASSET_1A1_ANIM_SLED, 1.0f}, + { ASSET_1A1_ANIM_SLED, 1.0f}, + { ASSET_1A1_ANIM_SLED, 1.0f} +}; + +ActorInfo D_80391A60 = { + MARKER_3C_RACE_SLED, ACTOR_182_RACE_SLED, ASSET_352_MODEL_SLED, + 0x0, D_80391A40, + func_80386AA4, NULL, func_803868C0, + 1000, 0, 0.0f, 0 +}; + +/* .code */ +Actor *func_803868C0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + if(this->unk10_12 == FALSE){ + return func_80325888(marker, gfx, mtx, vtx); + } + return this; +} + +void func_80386920(Actor *this, s32 next_state){ + if(this->state != 1 || next_state != 1){ + func_80328A84(this, next_state); + switch(next_state){ + case 1: //L8038697C + this->unk10_12 = TRUE; + this->marker->propPtr->unk8_3 = FALSE; + break; + case 2: //L803869A4 + this->unk10_12 = FALSE; + this->marker->propPtr->unk8_3 = TRUE; + break; + case 3: //L803869CC + this->unk10_12 = TRUE; + this->marker->propPtr->unk8_3 = FALSE; + break; + } + } +} + +void func_803869FC(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + f32 plyr_pos[3]; + + if(this->state == 2){ + player_getPosition(plyr_pos); + if( this->position_y + 20.0f < plyr_pos[1] + && func_8028F20C() + && player_getTransformation() == TRANSFORM_4_WALRUS + && func_8028F68C(0x29, this->marker) + ){ + func_80386920(this, 3); //start_race + } + } +} + +void func_80386AA4(Actor *this){ + s32 sp24; + if(!this->initialized){ + this->initialized = TRUE; + marker_setCollisionScripts(this->marker, func_803869FC, NULL, NULL); + func_80386920(this, 1); + } + + sp24 = mapSpecificFlags_get(4); + if(sp24 == 0){ + func_80386920(this, 1); + } + + switch (this->state){ + case 1://L80386B38 + if(sp24){ + func_80386920(this, 2); + } + break; + case 3://L80386B50 + if(func_8028ECAC() != BSGROUP_C_WALRUS_SLED){ + func_80386920(this, 2); + } + break; + } +} diff --git a/src/FP/code_5CC0.c b/src/FP/code_5CC0.c new file mode 100644 index 00000000..0758f46d --- /dev/null +++ b/src/FP/code_5CC0.c @@ -0,0 +1,392 @@ +#include +#include "functions.h" +#include "variables.h" + +extern Actor *func_802EBAE0(UNK_TYPE(s32), f32 position[3], f32 rotation[3], f32 scale, UNK_TYPE(s32), UNK_TYPE(s32), UNK_TYPE(s32), f32, UNK_TYPE(s32)); + +Actor *func_8038C1F8(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_8038C9A0(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_80391F50[]; + +extern ActorInfo D_80391F88 = { MARKER_200_TWINKLY_BLUE, ACTOR_332_TWINKLY_BLUE, ASSET_448_MODEL_TWINKLY_BLUE, + 0x1, D_80391F50, + func_8038C9A0, func_80326224, func_8038C1F8, + 0, 0, 1.0f, 0 +}; + +extern ActorInfo D_80391FAC = { MARKER_201_TWINKLY_GREEN, ACTOR_333_TWINKLY_GREEN, ASSET_449_MODEL_TWINKLY_GREEN, + 0x1, D_80391F50, + func_8038C9A0, func_80326224, func_8038C1F8, + 0, 0, 1.0f, 0 +}; + +extern ActorInfo D_80391FD0 = { MARKER_202_TWINKLY_ORANGE, ACTOR_334_TWINKLY_ORANGE, ASSET_44A_MODEL_TWINKLY_ORANGE, + 0x1, D_80391F50, + func_8038C9A0, func_80326224, func_8038C1F8, + 0, 0, 1.0f, 0 +}; + +extern ActorInfo D_80391FF4 = { MARKER_203_TWINKLY_RED, ACTOR_335_TWINKLY_RED, ASSET_44B_MODEL_TWINKLY_RED, + 0x1, D_80391F50, + func_8038C9A0, func_80326224, func_8038C1F8, + 0, 0, 1.0f, 0 +}; + +extern s32 D_80392018[4]; +extern struct43s D_80392028; +extern f32 D_80392070[3]; +extern f32 D_8039207C[3]; +extern f32 D_80392088[3]; +extern f32 D_80392094[3]; +extern s32 D_803920A0[4]; +extern s32 D_803920B0[4]; + +extern f64 D_80392D80; +extern f64 D_80392D88; +extern f64 D_80392D90; +extern f32 D_80392D98; +extern f32 D_80392D9C; +extern f32 D_80392DA0; +extern f32 D_80392DA4; +extern f32 D_80392DA8; +extern f32 D_80392DAC; +extern f32 D_80392DB0; +extern f64 D_80392DB8; +extern f64 D_80392DC0; +extern f64 D_80392DC8; + +// C00999999999999A +// C00999999999999A +// 3FEFFFEB074A771D +// 3F99999A +// 3FA66666 +// 44DAC000 +// 455AC000 +// 3FB33333 +// 44DAC000 +// 455AC000 +// C00999999999999A +// 3FEFFF2E48E8A71E +// 3FEFFFFDE7210BE9 + +/* .code */ +Actor *func_8038C0B0(ActorMarker *marker, UNK_TYPE(s32) arg1, f32 arg2, UNK_TYPE(s32) arg3){ + UNK_TYPE(s32) sp5C = func_8033A12C(func_80330B1C(marker)); + Actor *this = marker_getActor(marker); + f32 sp4C[3]; + f32 sp40[3]; + f32 sp3C; + + sp4C[0] = (f32)marker->propPtr->x; + sp4C[1] = (f32)marker->propPtr->y; + sp4C[2] = (f32)marker->propPtr->z; + + sp40[0] = (f32)marker->pitch; + sp40[1] = this->unk60; + sp40[2] = (f32)marker->roll; + sp3C = this->scale; + if(func_802EA190(marker->unk20)){ + return func_802EBAE0(sp5C, sp4C, sp40, sp3C, NULL, marker->unk20, arg1, arg2, arg3); + } + else{ + return NULL; + } +} + +Actor *func_8038C1F8(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + func_8033A45C(2, this->unk38_31); + func_8033A45C(1, func_8033A0F0(2) ^ 1); + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_8038C260(f32 position[3], s32 count, enum asset_e model_id){ + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(count); + particleEmitter_setModel(pCtrl, model_id); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80392028); + func_802EFE24(pCtrl, + 400.0f, 400.0f, 400.0f, + 800.0f, 800.0f, 800.0f + ); + func_802EFB70(pCtrl, 0.1f, 0.2f); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.02f); + func_802EFEC0(pCtrl, 1.5f, 1.5f); + func_802EFA5C(pCtrl, 0.0f, 0.3f); + func_802EF9F8(pCtrl, 0.6f); + func_802EFA18(pCtrl, 0); + func_802EFA20(pCtrl, 1.0f, 1.3f); + func_802EF9EC(pCtrl, 0x7B, 8000); + particleEmitter_emitN(pCtrl, count); +} + +void func_8038C398(f32 position[3], enum marker_e marker_id){ + enum asset_e sp1C; + switch(marker_id){ + case MARKER_200_TWINKLY_BLUE: + sp1C = ASSET_497_MODEL_TWINKLY_SHARD_BLUE; + break; + + case MARKER_201_TWINKLY_GREEN: + sp1C = ASSET_499_MODEL_TWINKLY_SHARD_GREEN; + break; + + case MARKER_202_TWINKLY_ORANGE: + sp1C = ASSET_49A_MODLE_TWINKLY_SHARD_ORANGE; + break; + + case MARKER_203_TWINKLY_RED: + sp1C = ASSET_49B_MODLE_TWINKLY_SHARD_RED; + break; + } + func_8038C260(position, 12, sp1C); + func_8038C260(position, 4, ASSET_498_MODEL_TWINKLY_SHARD_YELLOW); +} + +#ifndef NONMATCHING +void func_8038C428(Actor *this, f32 arg1[3], f32 arg2); +#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_5CC0/func_8038C428.s") +#else +void func_8038C428(Actor *this, f32 arg1[3], f32 arg2) { + u8 sp7F; + s32 sp78; + f32 sp74; + f32 sp70; + f32 sp5C[3]; + f32 sp54; + f32 sp50; + f32 sp48; + f32 temp_f0_2; + f32 phi_f22; + f32 phi_f24; + f32 phi_f16; + s32 phi_v0; + s32 phi_v1; + + sp74 = arg2; + sp70 = this->position[1]; + phi_v1 = (arg2 == 0.0f) ? FALSE : TRUE; + phi_f22 = arg1[0] - this->position[0]; + phi_f24 = arg1[2] - this->position[2]; + sp78 = 0; + sp48 = phi_f22 / sp54; + sp50 = phi_f24 / sp54; + sp54 = gu_sqrtf((phi_f22 * phi_f22) + (phi_f24 * phi_f24)); + if (sp7F = phi_v1) { + temp_f0_2 = randf2(130.0f, 150.0f); + if (!(sp54 < temp_f0_2)) { + sp54 = temp_f0_2; + } + phi_f22 = sp48 * sp54; + phi_f24 = sp50 * sp54; + } + sp5C[0] = this->position[0] + phi_f22; + sp5C[1] = this->position[1]; + sp5C[2] = this->position[2] + phi_f24; + sp78 = 0; + if (sp7F) { + do { + // sp70 += arg2 += D_80392D80; + // sp70 += arg2 += D_80392D80; + sp70 += arg2 += -3.2; + sp78++; + } while (func_80309724(sp5C) < sp70 || arg2 > 0.0f); + } else { + sp74 = (f32) ((f64) (((arg1[1] + 40.0f) - this->position[1]) / 28.0f) - (-3.2 * (f64) 28.0f * 0.5)); + sp78 = 0x1C; + } + animctrl_setAnimTimer(this->animctrl, 0.0f); + this->unk1C[0] = D_80392D90 / sp78; + this->velocity[1] = sp74; + this->velocity[0] = phi_f22 / sp78; + this->velocity[2] = phi_f24 / sp78; + if (sp7F) { + func_8030E878(SFX_3F2_UNKNOWN, randf2(D_80392D98, D_80392D9C), 32000, this->position, D_80392DA0, D_80392DA4); + } + else{ + func_8030E878(SFX_53_BANJO_HUIII, randf2(D_80392DA8, 1.5f), 32000, this->position, D_80392DAC, D_80392DB0); + } +} +#endif + +bool func_8038C718(Actor *this, f32 arg1){ + f32 tmp; + + this->position[0] += this->velocity[0]; + this->position_y += (this->velocity_y += D_80392DB8); + this->position_z += this->velocity_z; + tmp = D_80392DC0 < animctrl_getAnimTimer(this->animctrl) + this->unk1C[0] ? D_80392DC8 : animctrl_getAnimTimer(this->animctrl) + this->unk1C[0]; + animctrl_setAnimTimer(this->animctrl, tmp); + + if(arg1 == 0.0f) + arg1 = func_80309724(this->position); + + if(this->position_y <= arg1){ + this->position_y = arg1; + return FALSE; + } + return TRUE; +} + +bool func_8038C844(f32 arg0[3], f32 arg1[3]){ + if( (arg0[0] - arg1[0] < 26.0f && -26.0f < arg0[0] - arg1[0]) + && (arg0[1] - arg1[1] < 26.0f && -26.0f < arg0[1] - arg1[1]) + && (arg0[2] - arg1[2] < 26.0f && -26.0f < arg0[2] - arg1[2]) + ){ + return TRUE; + } + return FALSE; +} + +void func_8038C8F0(ActorMarker *marker){ + Actor *this; + Actor *muncher; + Actor *other; + s32 pad; + + this = marker_getActor(reinterpret_cast(ActorMarker *, marker)); + other = marker_getActor(this->unk100); + muncher = func_8032813C(ACTOR_337_TWINKLY_MUNCHER, D_80392070, 170); + muncher->unk100 = other->marker; + muncher->unkF4_8 = 1; + + if(pad); +} + +void func_8038C94C(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *this = marker_getActor(caller); + if(!func_803203FC(0xC1)){ + func_80328A84(this, 6); + func_802C3C88(func_8038C8F0, this->marker); + } +} + +#ifndef NONAMTCHING +#pragma GLOBAL_ASM("asm/nonmatchings/FP/code_5CC0/func_8038C9A0.s") +#else +void func_8038C9A0(Actor *this){ + Actor *other; //sp34 + void * sp30; + + if(this->marker->unk14_20 == 0x200){ + sp30 = func_8034C2C4(this->marker, 0x190); + } + other = marker_getActor(this->unk100); + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->unk18 = &D_80392018; + this->unk38_31 = 0; + if(0.0f != other->velocity[0]){ + func_80328A84(this, 4); + this->unk1C[1] = this->position_y + 50.0f; + this->unk1C[2] = this->position_y; + } + else{ + this->velocity_x = 0.0f; + this->velocity_y = 0.0f; + this->velocity_z = 0.0f; + this->unk1C[0] = 0.0f; + animctrl_setAnimTimer(this->animctrl, 0.0f); + func_8038C428(this, &D_8039207C, 0); + return; + } + }//L8038CA9C + + if(1.0f == other->unk1C[1]){ + func_8038C398(this->position, this->marker->unk14_20); + FUNC_8030E8B4(SFX_7B_ICE_BREAKING_1, 1.0f, 32000, this->position, 0x6d6, 0xdac);\ + marker_despawn(this->marker); + return; + }//L8038CB04 + + switch(this->state){ + case 1:// 8038CB2C + if(func_8038C718(this, 0)) + break; + + func_80328B8C(this, 2, 0.001f, 1); + func_8038C428(this, D_80392088, randf2(20.0f, 24.0f)); + this->unk60 = this->yaw; + break; + + case 2:// 8038CB8C + this->yaw += 4.0f; + if(actor_animationIsAt(this, 0.999)){ + func_8034DFB0(sp30, D_803920A0, D_803920B0, 0.14f); + } + + if(actor_animationIsAt(this, 0.8f)){ + func_8034DFB0(sp30, D_803920B0, D_803920A0, 0.14f); + } + + if(0.8 < animctrl_getAnimTimer(this->animctrl) || animctrl_getAnimTimer(this->animctrl) < 0.2){ + this->unk38_31 = TRUE; + } + else{ + this->unk38_31 = FALSE; + } + + if(func_8038C718(this, 0.0f)) + return; + + if(func_8038C844(this->position, D_80392088)){ + func_80328B8C(this, 3, 0.001f, 1); + func_8038C428(this, D_80392094, 0.0f); + } + else{ + func_8038C428(this, D_80392088, randf2(20.0f, 24.0f)); + } + break; + + case 3:// 8038CCFC + if(func_8038C718(this, 0.0f)) + break; + + if(other->unk38_31 != 0){ + other->unk38_31--; + } + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + marker_despawn(this->marker); + break; + + case 4:// 8038CD58 + this->position_y += 3.0f; + if(this->unk1C[1] <= this->position_y){ + this->position_y = this->unk1C[1]; + if(!func_8031FF1C(0x82)){ + func_80311480(0xc12, 0x2a, this->position, this->marker, func_8038C94C, NULL); + func_80320004(0x82, TRUE); + } + else{ + func_80311480(0xc25, 0x2b, this->position, this->marker, func_8038C94C, NULL); + } + func_80328A84(this, 5); + this->pitch -= 3.0f; + } + break; + + case 5:// 8038CE14 + this->yaw_moving = (f32)func_80329784(this); + func_80328FB0(this, 8.0f); + if(func_8038C718(this, this->unk1C[1])) + break; + + this->velocity[1] = randf2(14.0f, 20.0f); + break; + + case 6:// 8038CE64 + this->position_y -= 5.0f; + if(this->position_y < this->unk1C[2] - 50.0f){ + this->velocity_x = 0.0f; + marker_despawn(this->marker); + return; + } + break; + }//L8038CEB0 +} +#endif diff --git a/src/FP/code_6AE0.c b/src/FP/code_6AE0.c new file mode 100644 index 00000000..6d73a8b7 --- /dev/null +++ b/src/FP/code_6AE0.c @@ -0,0 +1,445 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80324CD8(f32); +extern Actor *func_8032813C(enum actor_e, f32[3], s32); + +Actor *func_8038CED0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_8038D6C8(Actor *this); + +/* .data */ +ActorAnimationInfo D_803920C0[] ={ + {0x000, 0.0f}, + {0x16D, 10000000.0f}, + {0x237, 2.0f}, + {0x16D, 0.8f}, + {0x16D, 0.8f} +}; + +ActorInfo D_803920E8 = { 0x204, 0x336, 0x442, + 0x1, D_803920C0, + func_8038D6C8, func_80326224, func_8038CED0, + 0, 0, 0.0f, 0 +}; + +struct31s D_8039210C = { + { 0.4f, 0.8f }, + {-1.0f, -1.0f }, + { 0.0f, 0.02f}, + { 1.8f, 2.2f }, + 0.0f, + 0.7f +}; + +struct43s D_80392134 = { + {{-200.0f, 200.0f, -200.0f}, {200.0f, 400.0f, 200.0f}}, + {{ 0.0f, -800.0f, 0.0f}, { 0.0f, -800.0f, 0.0f}}, + {{-100.0f, 0.0f, -100.0f}, {100.0f, 100.0f, 100.0f}} +}; + +struct31s D_8039217C = { + {0.8f, 1.2f }, + {1.4f, 2.0f }, + {0.0f, 0.01f}, + {1.2f, 1.8f }, + 0.0f, + 0.01f +}; + +s32 D_803921A4[3] = { 0xDC, 0xDC, 0xE6}; + +struct43s D_803921B0 = { + {{-200.0f, 0.0f, -200.0f}, {200.0f, 200.0f, 200.0f}}, + {{ 0.0f, -10.0f, 0.0f}, { 0.0f, -10.0f, 0.0f}}, + {{-50.0f, 0.0f, -50.0f}, {50.0f, 200.0f, 50.0f}} +}; + +struct31s D_803921F8 = { + { 0.2f, 0.3f }, + {-1.0f, -1.0f }, + { 0.0f, 0.02f}, + { 2.0f, 2.5f }, + 0.0f, 0.3f +}; + +struct43s D_80392220 = { + {{-300.0f, 400.0f, -300.0f}, {300.0f, 800.0f, 300.0f}}, + {{ 0.0f, -800.0f, 0.0f}, { 0.0f, -800.0f, 0.0f}}, + {{-80.0f, 80.0f, -80.0f}, {80.0f, 80.0f, 80.0f}} +}; + +struct31s D_80392268 ={ + { 0.4f, 0.6f }, + {-1.0f, -1.0f }, + { 0.0f, 0.02f}, + { 2.0f, 2.5f }, + 0.0f, + 0.3f +}; + +struct43s D_80392290 = { + {{-300.0f, 400.0f, -300.0f}, {300.0f, 800.0f, 300.0f}}, + {{ 0.0f, -800.0f, 0.0f}, { 0.0f, -800.0f, 0.0f}}, + {{-80.0f, 80.0f, -80.0f}, {80.0f, 80.0f, 80.0f}} +}; + +struct31s D_803922D8 = { + {0.5f, 0.7f }, + {1.4f, 1.7f }, + {0.0f, 0.01f}, + {0.6f, 0.9f }, + 0.0f, 0.01f +}; + +s32 D_80392300[3] = { 0xDC, 0xDC, 0xE6}; + +struct43s D_8039230C = { + {{-100.0f, 0.0f, -100.0f}, {100.0f, 100.0f, 100.0f}}, + {{0.0f, -10.0f, 0.0f}, {0.0f, -10.0f, 0.0f}}, + {{-80.0f, 0.0f, -80.0f}, {50.0f, 200.0f, 80.0f}} +}; + +f32 D_80392354[3] = {-4165.0f, 73.0f, 4483.0f}; + +f32 D_80392360[3] = {-4292.0f, 73.0f, 5054.0f}; + +enum actor_e D_8039236C[4] = { + ACTOR_332_TWINKLY_BLUE, + ACTOR_333_TWINKLY_GREEN, + ACTOR_334_TWINKLY_ORANGE, + ACTOR_335_TWINKLY_RED, + +}; + +f32 D_8039237C[3] = {-3940.0f, 69.0f, 3570.0f}; + +/* .code */ +Actor *func_8038CED0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + if( func_8038BFA0() || func_8031FF1C(BKPROG_13) ){ + if(0.0f == this->velocity[1]) + return this; + } + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_8038CF54(f32 position[3], s32 count, enum asset_e model_id){ + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(count); + particleEmitter_setModel(pCtrl, model_id); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80392134); + func_802EFE24(pCtrl, + 100.0f, 100.0f, 100.0f, + 200.0f, 200.0f, 200.0f + ); + func_802EFB98(pCtrl, &D_8039210C); + func_802EF9F8(pCtrl, 0.6f); + func_802EFA18(pCtrl, 3); + particleEmitter_emitN(pCtrl, count); +} + +void func_8038D01C(f32 position[3], s32 count, enum asset_e sprite_id){ + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(count); + func_802EFFA8(pCtrl, D_803921A4); + particleEmitter_setSprite(pCtrl, sprite_id); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_803921B0); + func_802EFB98(pCtrl, &D_8039217C); + particleEmitter_emitN(pCtrl, count); +} + +void func_8038D0A8(f32 position[3], s32 count, enum asset_e model_id){ + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(count); + particleEmitter_setModel(pCtrl, model_id); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80392220); + func_802EFE24(pCtrl, + 200.0f, 200.0f, 200.0f, + 300.0f, 300.0f, 300.0f + ); + func_802EFB98(pCtrl, &D_803921F8); + func_802EF9F8(pCtrl, 0.2f); + func_802EFA18(pCtrl, 2); + particleEmitter_emitN(pCtrl, count); +} + +void func_8038D170(f32 position[3], s32 count, enum asset_e sprite_id){ + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(count); + particleEmitter_setSprite(pCtrl, sprite_id); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80392290); + func_802EFB98(pCtrl, &D_80392268); + func_802EF9F8(pCtrl, 0.2f); + func_802EFA18(pCtrl, 2); + particleEmitter_emitN(pCtrl, count); +} + +void func_8038D208(f32 position[3], s32 count, enum asset_e sprite_id){ + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(count); + func_802EFFA8(pCtrl, D_80392300); + particleEmitter_setSprite(pCtrl, sprite_id); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8039230C); + func_802EFB98(pCtrl, &D_803922D8); + particleEmitter_emitN(pCtrl, count); +} + +void func_8038D294(ActorMarker *marker){ + Actor *this = marker_getActor(marker); + func_8038CF54(this->position, 12, ASSET_4D4_MODEL_TWINKLY_BOX_PAPER_SHARD); + func_8038D01C(this->position, 12, ASSET_700_SPRITE_DUST); + this->velocity[1] = 0.0f; + FUNC_8030E8B4(SFX_30_MAGIC_POOF, 1.0f, 32000, this->position, 1000, 3500); + func_80311480(0xc13, 0, NULL, NULL, NULL, NULL); +} + +void func_8038D324(Actor *this){ + int i; + + func_8038D0A8(this->position, 24, ASSET_4D4_MODEL_TWINKLY_BOX_PAPER_SHARD); + for(i = 0; i < 24; i++){ + func_8038D170(this->position, 1, ASSET_710_SPRITE_SPARKLE_PURPLE + randi2(0, 10)); + } + func_8038D208(this->position, 8, ASSET_700_SPRITE_DUST); + FUNC_8030E624(SFX_30_MAGIC_POOF, 1.0f, 32000); +} + +void func_8038D3B0(Actor *arg0){ + item_set(ITEM_6_HOURGLASS, FALSE); +} + +void func_8038D3D8(void){ + comusic_8025AB44(COMUSIC_68_TWINKLY_MINIGAME, 0, 4000); + func_8025AABC(COMUSIC_68_TWINKLY_MINIGAME); + func_8025A58C(-1, 4000); + func_8024BD08(1); +} + +void func_8038D41C(ActorMarker *marker){ + s32 pad[2]; + ActorMarker *_marker = reinterpret_cast(ActorMarker *, marker); + Actor *actor; + + actor = func_8032813C(ACTOR_337_TWINKLY_MUNCHER, D_80392354, 170); + actor->unk100 = _marker; + actor = func_8032813C(ACTOR_337_TWINKLY_MUNCHER, D_80392360, 170); + actor->unk100 = _marker; + if(pad[0]); +} + +void func_8038D474(ActorMarker *marker){ + Actor *actor = marker_getActor(reinterpret_cast(ActorMarker*, marker)); + Actor *child; + s32 pad; + + if((s32)actor->unk1C[0] >= 3){ + actor->unk1C[0] = -1.0f; + } + actor->unk1C[0] += 1.0; + child = spawn_child_actor(D_8039236C[(s32)actor->unk1C[0]], &actor); + child->unk100 = actor->marker; +} + +void func_8038D51C(ActorMarker *marker){ + Actor *this = marker_getActor(marker); + + item_set(ITEM_6_HOURGLASS, FALSE); + func_80320004(BKPROG_13, TRUE); + FUNC_8030E624(SFX_416, 0.8f, 32000); + func_8028F8F8(7, 0); + this->unk1C[1] = 1.0f; + func_80324E88(1.7f); + func_80324E38(1.7f, 0); + timedFunc_set_1(2.3f, (TFQM1)func_8038D294, (s32)this->marker); + this->velocity[1] = 1.0f; +} + +void func_8038D5C8(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + + if(this->state == 1 || this->state == 2){ + actor_collisionOff(this); + timed_setCameraToNode(0.0f, 0xa); + func_80324CD8(0.1f); + func_8028F784(1); + func_8028F490(D_8039237C); + func_8028F8F8(7, 1); + this->unk1C[1] = 0.0f; + func_8025A6EC(COMUSIC_68_TWINKLY_MINIGAME, 25000); + func_8025A58C(0, 4000); + func_8024BD08(0); + this->unk1C[2] = 428571.0f; + func_8025AEA0(0x68, (s32)this->unk1C[2]); + func_80328B8C(this, 3, 0.001f, 1); + actor_playAnimationOnce(this); + this->velocity[0] = 1.0f; + }//L8038D6B8 +} + +void func_8038D6C8(Actor *this){ + f32 sp24; + bool sp20; + + sp24 = time_getDelta(); + mapSpecificFlags_set(0xd, (this->state != 1 && this->state != 2) ? TRUE : FALSE); + + if(func_8038BFA0() || func_8031FF1C(BKPROG_13)){ + this->marker->propPtr->unk8_3 = FALSE; + actor_collisionOff(this); + func_8028F8F8(7, FALSE); + return; + } + + + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOn(this); + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + func_803300D8(this->marker, func_8038D3B0); + marker_setCollisionScripts(this->marker, NULL, func_8038D5C8, NULL); + this->unk38_31 = 0; + this->unk1C[1] = 0.0f; + this->velocity[0] = 0.0f; + this->velocity[1] = 0.0f; + this->unk1C[0] = -1.0f; + func_8028F8F8(7, FALSE); + if(func_803203FC(0xC1) && func_8031B4F4() == -1){ + func_80328B8C(this, 3, 0.001f, 1); + actor_playAnimationOnce(this); + this->velocity[0] = 1.0f; + } + }//L8038D844 + + if(func_803203FC(0xc1)){ + this->velocity[0] = 1.0f; + } + + switch (this->state) + { + case 1: //L8038D89C + if(!func_80329530(this, 800)) + break; + + if(!(func_8023DB5C() & 1)) + func_80328B8C(this, 2, 0.001f, 1); + else + func_80328B8C(this, 2, 0.999f, 0); + + actor_playAnimationOnce(this); + this->velocity[2] = randf2(1.4f, 2.0f); + + break; + + case 2: //L8038D91C + sp20 = animctrl_isPlayedForwards(this->animctrl); + animctrl_setDuration(this->animctrl, this->velocity[2]); + if( ( sp20 == TRUE && actor_animationIsAt(this, 0.999f) ) + || ( sp20 == FALSE && actor_animationIsAt(this, 0.001f) ) + ){ + func_80328B8C(this, 1, 0.001f, 0); + actor_playAnimationOnce(this); + break; + } + + if( actor_animationIsAt(this, 0.02f) + || actor_animationIsAt(this, 0.15f) + || actor_animationIsAt(this, 0.28f) + || actor_animationIsAt(this, 0.63f) + || actor_animationIsAt(this, 0.81f) + ){ + FUNC_8030E8B4(SFX_98_DEAF_THUD, 1.0f, 32000, this->position, 400, 2000); + } + break; + + case 3: //L8038DA24 + if(actor_animationIsAt(this, 0.3f)) + func_8038D324(this); + + if(actor_animationIsAt(this, 0.999f)) + func_802C3C88((GenMethod_1)func_8038D474, (s32)this->marker); + + if(this->velocity[0] != 0.0f) + break; + + func_80324E88(0.0f); + func_8028F784(0); + func_80328B8C(this, 4, 0.999f, 1); + actor_playAnimationOnce(this); + item_set(ITEM_0_HOURGLASS_TIMER, 80*60 - 1); + item_set(ITEM_6_HOURGLASS, TRUE); + this->unk38_31 = 0xA; + item_set(ITEM_24_TWINKLY_SCORE, this->unk38_31); + func_802C3C88((GenMethod_1)func_8038D41C, (s32)this->marker); + this->unk60 = 0.0f; + func_80347A14(0); + func_802FAD64(ITEM_14_HEALTH); + break; + + case 4: //L8038DB18 + this->unk1C[2] += (sp24*-195238.0f)/80.0f; + if(this->unk1C[2] < 233333.0f) + this->unk1C[2] = 233333.0f; + + func_8025AEA0(COMUSIC_68_TWINKLY_MINIGAME, (s32)this->unk1C[2]); + if(item_getCount(ITEM_24_TWINKLY_SCORE) == 0){ + func_80328B8C(this, 1, 0.001f, 1); + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + func_8038D3D8(); + func_80324E38(0.0f, 3); + timedFunc_set_1(1.3f, (TFQM1)func_8038D51C, (s32)this->marker); + timed_setCameraToNode(0.9f, 0xC); + item_set(ITEM_24_TWINKLY_SCORE, this->unk38_31); + func_80347A14(1); + break; + } + + if(item_empty(ITEM_6_HOURGLASS)){ + func_80328B8C(this, 1, 0.001f, 0); + actor_playAnimationOnce(this); + this->unk38_31 = 0; + item_set(ITEM_6_HOURGLASS, FALSE); + func_8025A6EC(COMUSIC_3C_MINIGAME_LOSS, 28000); + func_8028F8F8(7, FALSE); + this->unk1C[1] = 1.0f; + func_8038D3D8(); + func_80347A14(1); + break; + } + + + if(0.96 < animctrl_getAnimTimer(this->animctrl)){ + if(this->unk60 <= 0.0){ + func_802C3C88((GenMethod_1)func_8038D474, (s32)this->marker); + this->unk60 = 2.9f; + } + else{ + this->unk60 -= sp24; + } + item_set(ITEM_24_TWINKLY_SCORE, this->unk38_31); + } + break; + } +} + +bool func_8038DD14(void){ + return mapSpecificFlags_get(0xD); +} + +bool func_8038DD34(ActorMarker *marker){ + Actor *this = marker_getActor(marker); + if(func_80329530(this, 800)) + return TRUE; + return FALSE; +} diff --git a/src/FP/code_790.c b/src/FP/code_790.c new file mode 100644 index 00000000..8d06a42d --- /dev/null +++ b/src/FP/code_790.c @@ -0,0 +1,102 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *func_80386B80(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80386CF8(Actor *this); + +/* .data */ +ActorAnimationInfo D_80391A90[] ={ + {0, 0.0}, + {ASSET_143_ANIM_SNOWMAN_BUTTON, 800000.0f}, + {ASSET_143_ANIM_SNOWMAN_BUTTON, 0.5f}, + {ASSET_143_ANIM_SNOWMAN_BUTTON, 800000.0f} +}; + +ActorInfo D_80391AB0 = { + MARKER_B9_FP_SNOWMAN_BUTTON, ACTOR_116_FP_SNOWMAN_BUTTON, ASSET_421_MODEL_FP_SNOWMAN_BUTTON, + 0x1, D_80391A90, + func_80386CF8, func_80326224, func_80386B80, + 0, 0x800, 0.0f, 0 +}; + +struct31s D_80391AD4 = { + {0.4f, 0.6f}, + {1.8f, 3.6f}, + {0.0f, 0.01f}, + {0.5f, 1.4f}, + 0.0f, 0.01f, +}; + +struct43s D_80391AFC = { + {{-300.0f, 350.0f, -300.0f}, {300.0f, 800.0f, 300.0f}}, + {{0.0f, -800.0f, 0.0f}, {0.0f, -800.0f, 0.0f}}, + {{-50.0f, -50.0f, -50.0f}, {50.0f, 50.0f, 50.0f}} +}; + +s32 D_80391B44[3] = {225, 225, 245}; + +/* .code */ +Actor *func_80386B80(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + func_8033A45C(1, this->state == 3); + func_8033A45C(2, func_8033A0F0(1) ^ 1); + return func_80325888(marker, gfx, mtx, vtx); + +} + +void func_80386BEC(Actor *this){ + f32 plyr_pos[3]; + ParticleEmitter *pCtrl = partEmitList_pushNew(12); + + player_getPosition(plyr_pos); + func_80328B8C(this, 2, 0.01f, 1); + actor_collisionOff(this); + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + FUNC_8030E624(SFX_90_SWITCH_PRESS, 1.0f, 32000); + func_8038AB40(); + func_802EFFA8(pCtrl, D_80391B44); + particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST); + particleEmitter_setPosition(pCtrl, plyr_pos); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80391AFC); + func_802EFB98(pCtrl, &D_80391AD4); + particleEmitter_emitN(pCtrl, 12); +} + +void func_80386CB8(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + + if(this->state == 1) + func_80386BEC(this); + +} + +void func_80386CF8(Actor *this){ + marker_setCollisionScripts(this->marker, NULL, NULL, func_80386CB8); + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOn(this); + + if(!this->initialized){ + this->initialized = TRUE; + this->pitch += (f32)(this->unkF4_8 - 1); + } + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(this->state == 3){ + func_8038AB40(); + } + } + + switch(this->state){ + case 1: + break; + case 2: + if(actor_animationIsAt(this, 0.99f)){ + func_80328B8C(this, 3, 0.99f, 0); + } + break; + case 3: + break; + } +} diff --git a/src/FP/code_7980.c b/src/FP/code_7980.c new file mode 100644 index 00000000..939223de --- /dev/null +++ b/src/FP/code_7980.c @@ -0,0 +1,236 @@ +#include +#include "functions.h" +#include "variables.h" + +extern ActorProp *func_80320EB0(ActorMarker *, f32, s32); + +Actor *func_8038DD70(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_8038E094(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_80392390[] ={ + {0, 0.0f}, + {ASSET_1AF_ANIM_TWINKLY_MUNCHER_APPEAR, 10000000.0f}, + {ASSET_1B0_ANIM_TWINKLY_MUNCHER_DIE, 1.0f}, + {ASSET_1B1_ANIM_TWINKLY_MUNCHER_IDLE, 1.0f}, + {ASSET_1B2_ANIM_TWINKLY_MUNCHER_ATTACK, 1.0f}, + {ASSET_1AF_ANIM_TWINKLY_MUNCHER_APPEAR, 0.667f}, + {ASSET_1B1_ANIM_TWINKLY_MUNCHER_IDLE, 1.0f}, + {ASSET_1AF_ANIM_TWINKLY_MUNCHER_APPEAR, 0.667f} +}; + +extern ActorInfo D_803923D0 = { MARKER_205_TWINKLY_MUNCHER, ACTOR_337_TWINKLY_MUNCHER, ASSET_496_MODEL_TWINKLY_MUNCHER, + 0x1, D_80392390, + func_8038E094, func_80326224, func_8038DD70, + 2500, 0, 1.0f, 0 +}; + +/* .code */ +Actor *func_8038DD70(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + if(this->state == 1) + return this; + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_8038DDC8(Actor *this){ + actor_collisionOn(this); + func_80328B8C(this, 2, 0.03f, 1); + actor_playAnimationOnce(this); +} + +void func_8038DE08(Actor *this){ + func_80328B8C(this, 3, 0.03f, 1); + actor_loopAnimation(this); +} + +void func_8038DE40(Actor *this){ + func_80328B8C(this, 4, 0.03f, 1); + actor_playAnimationOnce(this); +} + +void func_8038DE78(Actor *this){ + actor_collisionOff(this); + func_80328B8C(this, 5, 0.03f, 1); + actor_playAnimationOnce(this); +} + +void func_8038DEB8(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + if(this->state != 1 && this->state != 5){ + func_8038DE78(this); + FUNC_8030E8B4(SFX_87_TANKTUP_OOOHW, 1.6f, 32000, this->position, 1250, 2500); + FUNC_8030E8B4(SFX_1D_HITTING_AN_ENEMY_1, 1.0f, 26000, this->position, 1250, 2500); + } +} + +Actor *func_8038DF34(Actor *this){ + ActorProp *prop; + Actor *other; + s32 marker_id; + f32 sp18[3]; + + func_8034A174(this->marker->unk44, 5, sp18); + this->marker->unk38[0] = sp18[0] - this->position[0]; + this->marker->unk38[1] = sp18[1] - this->position[1]; + this->marker->unk38[2] = sp18[2] - this->position[2]; + prop = func_80320EB0(this->marker, 75.0f, 1); + + if(prop && prop->unk8_0){ + other = marker_getActor(prop->marker); + marker_id = other->marker->unk14_20; + if( marker_id == MARKER_200_TWINKLY_BLUE + || marker_id == MARKER_201_TWINKLY_GREEN + || marker_id == MARKER_202_TWINKLY_ORANGE + || marker_id == MARKER_203_TWINKLY_RED + ){ + return other; + } + } + return NULL; +} + +void func_8038E040(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *this = marker_getActor(caller); + func_80324E88(0.5f); + func_80328B8C(this, 7, 0.03f, 1); + actor_playAnimationOnce(this); +} + +void func_8038E094(Actor *this){ + s32 sp3C; + Actor *sp38; + f32 sp34 = time_getDelta(); + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + marker_setCollisionScripts(this->marker, NULL, func_8038DEB8, NULL); + this->marker->propPtr->unk8_3 = TRUE; + animctrl_setAnimTimer(this->animctrl, 0.99999f); + this->unk60 = 0.0f; + if(this->unkF4_8 == 1){ + func_8038DDC8(this); + } + if(this->unkF4_8 == 2){ + if(func_803203FC(UNKFLAGS1_C1) && func_8031B4F4() == -2){ + func_8038DDC8(this); + } + else{ + marker_despawn(this->marker); + return; + } + } + }//L8038E180 + if(this->unk100){ + sp38 = marker_getActor(this->unk100); + if(sp38->unk1C[1] == 1.0f){ + if(this->unkF4_8 == 1 && !func_8031FF1C(BKPROG_13)){ + if(this->state != 6 && this->state != 7 && 0.0f == this->velocity[0]){ + timed_setCameraToNode(0.5f, 0xd); + func_80311480(ASSET_C15_TEXT_TWINKLIE_MINIGAME_LOST, 0x2b, this->position, this->marker, func_8038E040, NULL); + this->velocity[0] = 1.0f; + func_80328B8C(this, 6, 0.03f, 1); + actor_loopAnimation(this); + } + } + else{//L8038E274 + if(this->state == 1){ + marker_despawn(this->marker); + } + else if( this->state != 1 && this->state != 5){ + func_8038DE78(this); + } + } + } + }//L8038E2B4 + + switch(this->state){ + case 1: //L8038E2DC + this->marker->propPtr->unk8_3 = FALSE; + animctrl_setAnimTimer(this->animctrl, 0.99f); + if(this->unk60 < 5.0){ + this->unk60 += sp34; + } + else{ + if(10.0 <= this->unk60 || randf() < this->unk60/10.0){ + if(!func_8038DF34(this)){ + this->unk60 = 0.0f; + func_8038DDC8(this); + break; + } + } + this->unk60 += sp34; + } + break; + + case 2: //L8038E3C0 + this->marker->propPtr->unk8_3 = TRUE; + sp38 = func_8038DF34(this); + if(sp38){ + func_8038DE40(this); + this->unk38_31 = sp38->marker->unk14_20; + break; + } + + if(actor_animationIsAt(this, 0.15f)) + FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 1250, 2500); + + if(actor_animationIsAt(this, 0.35f)) + FUNC_8030E8B4(SFX_C4_TWINKLY_MUNCHER_GRR, 1.2f, 32000, this->position, 1250, 2500); + + if(actor_animationIsAt(this, 0.97f)) + func_8038DE08(this); + break; + + case 3: //L8038E498 + this->marker->propPtr->unk8_3 = TRUE; + sp38 = func_8038DF34(this); + if(sp38){ + func_8038DE40(this); + this->unk38_31 = sp38->marker->unk14_20; + } + break; + + case 4: //L8038E4F0 + this->marker->propPtr->unk8_3 = TRUE; + sp38 = func_8038DF34(this); + if(sp38 && sp38->marker->unk14_20 == this->unk38_31){ + if(actor_animationIsAt(this, 0.23)){ + func_8038C398(sp38->position, sp38->marker->unk14_20); + FUNC_8030E8B4(SFX_110_TWINKLY_DEATH, 1.0f, 32000, this->position, 1250, 2500); + FUNC_8030E8B4(SFX_27_JINJO_HI, 1.6f, 32000, this->position, 1250, 2500); + func_80324D54(0.35f, SFX_110_TWINKLY_DEATH, 1.0f, 32000, this->position, 1250.0f, 2500.0f); + marker_despawn(sp38->marker); + if( !mapSpecificFlags_get(0xa) && func_80311480(0xc16, 0, NULL, NULL, NULL, NULL)){ + mapSpecificFlags_set(0xa, TRUE); + } + } + }//L8038E620 + if(actor_animationIsAt(this, 0.97f)){ + func_8038DE08(this); + } + break; + + case 5: //L8038E644 + this->marker->propPtr->unk8_3 = TRUE; + if(actor_animationIsAt(this, 0.97f)){ + func_80328B8C(this, 1, 0.97f, 0); + actor_playAnimationOnce(this); + this->unk60 = 0.0f; + } + break; + + case 6: //L8038E698 + this->marker->propPtr->unk8_3 = FALSE; + this->yaw_moving = (f32)func_80329784(this); + func_80328FB0(this, 12.0f); + break; + + case 7: //L8038E6D4 + this->marker->propPtr->unk8_3 = FALSE; + if(actor_animationIsAt(this, 0.97f)){ + marker_despawn(this->marker); + } + break; + } +} diff --git a/src/FP/code_8330.c b/src/FP/code_8330.c new file mode 100644 index 00000000..ebd0ea04 --- /dev/null +++ b/src/FP/code_8330.c @@ -0,0 +1,115 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *func_8038E720(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_8038E940(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_80392400[]; + +extern ActorInfo D_80392420 = { 0x206, 0x338, 0x486, + 0x1, D_80392400, + func_8038E940, func_80326224, func_8038E720, + 4500, 0, 0.0f, 0 +}; + +struct31s *D_80392444; + +/* .code */ +Actor *func_8038E720(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + func_8033A45C(1, 0); + func_8033A45C(2, 1); + return func_80325888(marker, gfx, mtx, vtx); +} + + +void func_8038E774(Actor *this){ + func_80328B8C(this, 2, 0.05f, 1); + actor_playAnimationOnce(this); + this->marker->collidable = TRUE; + this->unk38_31 = 0; +} + +void func_8038E7CC(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + + if(this->state == 2){ + this->unk38_31++; + if(this->unk38_31 < 4){ + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + } + } +} + +void func_8038E840(f32 position[3], s32 cnt, enum asset_e sprite_id){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + particleEmitter_setSprite(pCtrl, sprite_id); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setParticleSpawnPositionRange(pCtrl, + -100.0f, -80.0f, -70.0f, + 100.0f, 100.0f, 70.0f + ); + particleEmitter_setParticleAccelerationRange(pCtrl, + 0.0f, -200.0f, 0.0f, + 0.0f, -200.0f, 0.0f + ); + particleEmitter_setParticleVelocityRange(pCtrl, + -200.0f, -100.0f, -200.0f, + 200.0f, 300.0f, 200.0f + ); + func_802EFB98(pCtrl, &D_80392444); + particleEmitter_emitN(pCtrl, cnt); +} + +void func_8038E940(Actor *this){ + if(jiggyscore_isCollected(JIGGY_2F_FP_XMAS_TREE) || levelSpecificFlags_get(0x29)){ + this->marker->propPtr->unk8_3 = TRUE; + this->marker->collidable = FALSE; + func_80328B8C(this, 3, 0.95f, 0); + return; + }//L8038E9B8 + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + this->marker->collidable = FALSE; + marker_setCollisionScripts(this->marker, NULL, func_8038E7CC, NULL); + func_80328B8C(this, 1, 0.05f, 1); + this->unk38_31 = 0; + this->unk60 = 0.0f; + }//L8038EA3C + + this->unk58_0 = (this->state == 1) ? FALSE : TRUE; + + switch(this->state){ + case 1: //L8038EA98 + if(func_8031FF1C(BKPROG_13) && !mapSpecificFlags_get(2)) + func_8038E774(this); + break; + case 2: //L8038EAC8 + if(actor_animationIsAt(this, 0.2f)) + func_8038E840(this->position, 0x20, ASSET_717_SPRITE_SPARKLE_YELLOW_2); + + if(this->unk38_31 < 3) + break; + + func_80328B8C(this, 3, 0.05f, 1); + actor_playAnimationOnce(this); + FUNC_8030E624(SFX_416, 0.8f, 32000); + this->marker->collidable = FALSE; + this->unk60 = 0.0f; + break; + case 3: //L8038EB44 + if(this->unk60 == 0.0f && actor_animationIsAt(this, 0.95f)){ + this->unk60 = 1.0f; + mapSpecificFlags_set(2, TRUE); + break; + } + + if(this->unk60 != 0.0f && !mapSpecificFlags_get(2)){ + func_8038E774(this); + } + break; + }//L8038EBC0 +} diff --git a/src/FP/code_87E0.c b/src/FP/code_87E0.c new file mode 100644 index 00000000..30a814ef --- /dev/null +++ b/src/FP/code_87E0.c @@ -0,0 +1,148 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + f32 unk0[3]; + f32 unkC[3]; + u8 unk18; + u8 unk19; + u8 unk1A; + u8 unk1B; +} ActorLocal_FP_87E0; + +Actor *func_8038EBD0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_8038ECD8(Actor *this); + +/* .data */ +ActorInfo D_80392470 = { 0x207, 0x339, 0x426, + 0x1, NULL, + func_8038ECD8, func_80326224, func_8038EBD0, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +f32 D_803935D0[3]; + +/* .code */ +Actor *func_8038EBD0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + func_8033A45C( 2, mapSpecificFlags_get(0)); + func_8033A45C( 1, mapSpecificFlags_get(0) ^ 1); + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_8038EC34(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + ActorLocal_FP_87E0 *local = (ActorLocal_FP_87E0 *)&this->local; + local->unk1B = TRUE; +} + +void func_8038EC5C(Actor *this){ + if(0.0f == this->unk60){ + this->unk38_31++; + this->unk60 = 0.33f; + if(this->unk38_31 < 4){ + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + } + + } +} + +void func_8038ECD8(Actor *this){ + ActorLocal_FP_87E0 *local = (ActorLocal_FP_87E0 *)&this->local; + f32 sp68[3]; + s32 sp64; + f32 sp58[3]; + f32 sp4C[3]; + f32 sp40[3]; + s32 sp3C; + f32 sp30[3]; + + if(jiggyscore_isCollected(JIGGY_2F_FP_XMAS_TREE)){ + this->marker->collidable = FALSE; + return; + } + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + marker_setCollisionScripts(this->marker, NULL, func_8038EC34, NULL); + this->marker->propPtr->unk8_3 = TRUE; + player_getPosition(D_803935D0); + local->unk1B = 0; + this->unk38_31 = 0; + local->unk1A = 0; + } + + local->unk19 = 0; + if(!local->unk1A && this->marker->unk14_21){ + func_8034A174(this->marker->unk44, 5, sp58); + func_8034A174(this->marker->unk44, 6, sp4C); + local->unk0[0] = sp58[0] - sp4C[0]; + local->unk0[1] = sp58[1] - sp4C[1]; + local->unk0[2] = sp58[2] - sp4C[2]; + player_getPosition(sp40); + sp40[0] -= sp4C[0]; + sp40[1] -= sp4C[1]; + sp40[2] -= sp4C[2]; + local->unk18 = (0.0f <= sp40[0]*local->unk0[0] + sp40[1]*local->unk0[1] + sp40[2]*local->unk0[2]) ? 0 : 1; + local->unkC[0] = sp4C[0]; + local->unkC[1] = sp4C[1]; + local->unkC[2] = sp4C[2]; + local->unk1A = TRUE; + }//L8038EE98 + + if(0.0f != this->unk60){ + if(time_getDelta() < this->unk60){ + this->unk60 -= time_getDelta(); + }else{ + this->unk60 = 0.0f; + } + }//L8038EEF0 + switch(this->state){ + case 1: //L8038EF10 + this->marker->collidable = FALSE; + if(!mapSpecificFlags_get(2)) break; + if(mapSpecificFlags_get(3)) break; + + func_80328A84(this, 2); + this->unk38_31 = 0; + break; + + case 2://L8038EF5C + if(!local->unk1A) return; + if(item_empty(ITEM_6_HOURGLASS)){ + func_80328A84(this, 1); + } + else{ + this->marker->collidable = TRUE; + player_getPosition(sp68); + sp68[0] -= local->unkC[0]; + sp68[1] -= local->unkC[1]; + sp68[2] -= local->unkC[2]; + sp64 = (0.0f <= sp68[0]*local->unk0[0] + sp68[1]*local->unk0[1] + sp68[2]*local->unk0[2]) ? 0 : 1; + if(sp64 == (local->unk18 ^ 1)){ + local->unk19 = TRUE; + if(local->unk1B){ + func_8038EC5C(this); + } + else{ + player_getPosition(sp68); + sp3C = func_80320B98(D_803935D0, sp68, sp30, 0); + if(sp3C){ + if(*(s32 *)(sp3C + 8) << 9 < 0) + func_8038EC5C(this); + } + } + }//L8038F090 + + if(!(this->unk38_31 < 3)){ + func_80328A84(this, 1); + mapSpecificFlags_set(3, 1); + } + } + break; + }//L8038F0BC + local->unk18 = sp64; + local->unk1B = 0; + player_getPosition(D_803935D0); +} diff --git a/src/FP/code_8D00.c b/src/FP/code_8D00.c new file mode 100644 index 00000000..de650c9b --- /dev/null +++ b/src/FP/code_8D00.c @@ -0,0 +1,57 @@ +#include +#include "functions.h" +#include "variables.h" +Actor *func_8038F0F0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_8038F144(Actor *this); + +/* .data */ +ActorAnimationInfo D_803924A0[] = { + {0, 0.0f}, + {ASSET_18A_XMAS_GIFT, 1.5f} +}; + +ActorInfo D_803924B0 = { MARKER_208_BLUE_PRESENT, ACTOR_33A_BLUE_PRESENT, ASSET_47F_MODEL_XMAS_GIFT_BLUE, + 0x1, D_803924A0, + func_8038F144, func_80326224, func_8038F0F0, + 2500, 0, 1.2f, 0 +}; + +ActorInfo D_803924D4 = { MARKER_209_GREEN_PRESENT, ACTOR_33B_GREEN_PRESENT, ASSET_480_MODEL_XMAS_GIFT_GREEN, + 0x1, D_803924A0, + func_8038F144, func_80326224, func_8038F0F0, + 2500, 0, 1.2f, 0 +}; + +ActorInfo D_803924F8 = { MARKER_20A_RED_PRESENT, ACTOR_33C_RED_PRESENT, ASSET_481_MODEL_XMAS_GIFT_RED, + 0x1, D_803924A0, + func_8038F144, func_80326224, func_8038F0F0, + 2500, 0, 1.2f, 0 +}; + +/* .code */ +Actor *func_8038F0F0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + if(this->unk38_31) + return this; + else + return func_80325888(marker, gfx, mtx, vtx); + +} + +void func_8038F144(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(!jiggyscore_isCollected(JIGGY_2E_FP_PRESENTS)){ + this->unk38_31 = TRUE; + this->marker->collidable = FALSE; + this->marker->propPtr->unk8_3 = FALSE; + } + else{ + this->unk38_31 = FALSE; + this->marker->collidable = FALSE; + this->marker->propPtr->unk8_3 = TRUE; + animctrl_setAnimTimer(this->animctrl, randf()); + } + } + if (this) if (this); +} diff --git a/src/FP/code_8E20.c b/src/FP/code_8E20.c new file mode 100644 index 00000000..043dbe66 --- /dev/null +++ b/src/FP/code_8E20.c @@ -0,0 +1,341 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + f32 unk0[3]; + f32 unkC[3]; + f32 unk18[3]; + f32 unk24[3]; + u8 unk30; +} ActorLocal_Wozza; + +Actor *func_8038F210(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_8038F7AC(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_80392520[]; + +extern ActorInfo D_80392588 = { MARKER_20B_WOZZA, ACTOR_1F3_WOZZA, ASSET_494_MODEL_WOZZA, + 0x1, D_80392520, + func_8038F7AC, func_80326224, func_8038F210, + 0, 0, 1.6f, 0 +}; + +extern f32 D_803925AC[3]; + +/* .code */ +Actor *func_8038F210(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + if(func_8038BFA0() || this->unk38_31) + return this; + + return func_80325888(marker, gfx, mtx, vtx); + +} + +void func_8038F274(void){ + UNK_TYPE(s32) v0 = func_8034C528(0x191); + if(v0){ + func_8034DE60(v0, 0.0f, -500.0f, 0.2f, 1); + } +} + +void func_8038F2B8(Actor *this){ + func_80328B8C(this, 3, 0.02f, 1); + actor_loopAnimation(this); +} + +void func_8038F2F0(Actor *this){ + func_80328B8C(this, 11, 0.02f, 1); + actor_loopAnimation(this); + func_8038F274(); +} + +void func_8038F330(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *this = marker_getActor(caller); + switch(text_id){ + case 0xC1B: + func_80324E88(0.0f); + break; + + case 0xC1C: + func_80324E88(0.0f); + func_8038F2F0(this); + break; + } +} + +void func_8038F3A0(void){ + mapSpecificFlags_set(8, 1); +} + +void func_8038F3C4(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + if(arg2 == 1){ + func_8038F3A0(); + } +} + +void func_8038F3F4(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + func_8038F2B8(actor); +} + +void func_8038F41C(Actor *this){ + func_80328B8C(this, 1, 0.02f, 1); + actor_loopAnimation(this); +} + +void func_8038F454(Actor *this){ + if(!mapSpecificFlags_get(7) && func_8028ECAC() != BSGROUP_A_FLYING && func_80329530(this, 1000) ){ + mapSpecificFlags_set(7, TRUE); + func_80328A84(this, 2); + actor_loopAnimation(this); + timed_setCameraToNode(0.0f, 0x2e); + func_80324DBC(0.0f, 0xc1b, 0x2a, this->position, this->marker, func_8038F330, NULL); + timedFunc_set_1(2.5f, (TFQM1)func_8038F3F4, (s32)this->marker); + } + else{ + func_8038F2B8(this); + } +} + +void func_8038F528(Actor *this){ + func_80328B8C(this, 4, 0.02f, 1); + actor_loopAnimation(this); +} + +void func_8038F560(Actor *this){ + func_80328B8C(this, 7, 0.02f, 1); + actor_loopAnimation(this); +} + +void func_8038F598(Actor *this, f32 arg1){ + this->yaw_moving = func_80329784(this); + func_80328FB0(this, arg1); +} + +bool func_8038F5D4(Actor *this, f32 arg1[3], f32 arg2, f32 arg3, s32 arg4){ + f32 sp24; + + sp24 = animctrl_getAnimTimer(this->animctrl); + this->yaw_moving = (f32) func_803297C8(this, arg1); + func_80328FB0(this, arg3); + if(actor_animationIsAt(this, 0.9f)){ + FUNC_8030E8B4(SFX_3F2_UNKNOWN, 0.8f, 24000, this->position, 500, 2000); + } + this->unk28 = (1.0f- sp24)*arg2; + func_80329054(this, 2); + if(ml_vec3f_distance(this->position, arg1) <= arg4) + return TRUE; + return FALSE; + +} + +bool func_8038F6C4(Actor *this, f32 arg1[3], f32 arg2){ + s32 dTheta; + + func_80328C64(this, func_803297C8(this, arg1)); + func_80328FB0(this, arg2); + dTheta = this->yaw - this->yaw_moving; + if(-arg2 <= dTheta && dTheta <= arg2){ + return TRUE; + } + return FALSE; +} + +void func_8038F758(ActorMarker *marker){ + Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, marker)); + Actor *jiggy = spawn_child_actor(ACTOR_1F4_WOZZAS_JIGGY, &this); + s32 pad; + + jiggy->yaw = this->yaw; + this->unk100 = jiggy->marker; + jiggy->unk100 = this->marker; + +} + +void func_8038F7AC(Actor *this){ + ActorLocal_Wozza * local = (ActorLocal_Wozza *)&this->local; + + if(func_803203FC(0xC4)){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = FALSE; + actor_collisionOff(this); + this->unk58_0 = FALSE; + func_8038F274(); + } + return; + } + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = FALSE; + if(jiggyscore_isCollected(JIGGY_32_FP_WOZZA)){ + func_8038F274(); + marker_despawn(this->marker); + return; + } + + if(levelSpecificFlags_get(0x26)){ + this->unk38_31 = TRUE; + func_8038F274(); + } + else{//L8038F8A0 + func_80304E24(0x359, local->unk24); + func_80304E24(0x35A, local->unk0); + func_80304E24(0x35B, local->unkC); + func_80304E24(0x35C, local->unk18); + this->position[0] = local->unkC[0];\ + this->position[1] = local->unkC[1];\ + this->position[2] = local->unkC[2]; + func_802C3C88(func_8038F758, this->marker); + local->unk30 = FALSE; + } + }//L8038F910 + + if(func_8038BFA0() || this->unk38_31 || !actor_playerIsWithinDist(this, 3000)){ + actor_collisionOff(this); + return; + } + + actor_collisionOn(this); + switch(this->state){ + case 1: //L8038F984 + if(func_8028ECAC() == BSGROUP_A_FLYING){ + func_8038F454(this); + break; + } + + if(func_80329530(this, 1300) && player_getTransformation() == TRANSFORM_4_WALRUS){ + func_80328B8C(this, 8, 0.02f, 1); + actor_loopAnimation(this); + break; + } + + if(func_80329530(this, 1000) && !func_803203FC(0x1f)){ + func_8038F454(this); + break; + } + + func_8038F598(this, 1.0f); + if( actor_animationIsAt(this, 0.38f) || actor_animationIsAt(this, 0.7f)){ + if(randf() < 0.4) + animctrl_setDirection(this->animctrl, animctrl_isPlayedForwards(this->animctrl) ^ 1); + } + break; + + case 3: //L8038FA9C + if(func_8038F5D4(this, local->unk24, 30.0f, 12.0f, 0x3C)) + func_8038F528(this); + break; + + case 4: //L8038FAD0 + if(!func_80329530(this, 2000) && func_8028ECAC() != BSGROUP_A_FLYING){ + func_8038F560(this); + break; + } + + if(func_8038F5D4(this, local->unk0, 30.0f, 12.0f, 0x3C)){ + func_80328B8C(this, 5, 0.02f, 1); + actor_playAnimationOnce(this); + } + break; + + case 5: //L8038FB50 + func_8038F6C4(this, local->unk18, 1.0f); + if(0.97 < animctrl_getAnimTimer(this->animctrl)){ + func_80328B8C(this, 6, 0.02f, 1); + actor_loopAnimation(this); + } + break; + + case 6: //L8038FBA8 + func_8038F6C4(this, local->unk18, 1.0f); + if( func_80329530(this, 1700) ) break; + if( func_8028ECAC() == BSGROUP_A_FLYING ) break; + + func_8038F560(this); + + if(!local->unk30){ + if(func_80311480(0xc1d, 0x20, NULL, NULL, NULL, NULL)){ + local->unk30 = TRUE; + } + } + break; + + case 7: //L8038FC30 + if(!func_8038F6C4(this, local->unkC, 4.5f)) + break; + + if(func_80329530(this, 1000) || func_8028ECAC() == BSGROUP_A_FLYING){ + func_8038F528(this); + break; + } + + if(func_8038F5D4(this, local->unkC, 30.0f, 12.0f, 0x3C)){ + func_8038F41C(this); + } + break; + + case 8: //L8038FCB0 + if(player_getTransformation() != TRANSFORM_4_WALRUS){ + func_8038F41C(this); + break; + } + + if(func_80329530(this, 500) && !this->unk138_24){ + if(func_80311480(0xc1c, 0xAA, this->position, this->marker, func_8038F330, func_8038F3C4)){ + timed_setCameraToNode(0.0f, 0x2E); + this->unk138_24 = TRUE; + } + break; + }//L8038FD40 + + if(mapSpecificFlags_get(8)){ + if(func_8038F6C4(this, D_803925AC, 9.0f)){ + func_80328B8C(this, 9, 0.02f, 1); + actor_playAnimationOnce(this); + } + break; + } + + func_8038F598(this, 2.0f); + + if(!func_803114B0()){ + if( actor_animationIsAt(this, 0.02f) + || actor_animationIsAt(this, 0.14f) + || actor_animationIsAt(this, 0.28f) + || actor_animationIsAt(this, 0.42f) + ){ + FUNC_8030E8B4(SFX_88_WOZZA_NOISE, 1.0f, 32000, this->position, 500, 2000); + } + } + break; + + case 9: //L8038FE14 + func_8038F6C4(this, D_803925AC, 9.0f); + if(0.97 < animctrl_getAnimTimer(this->animctrl)){ + func_80328B8C(this, 10, 0.02f, 1); + actor_loopAnimation(this); + } + break; + + case 10: //L8038FE70 + func_8038F598(this, 9.0f); + break; + + case 11: //L8038FE84 + if(func_8038F5D4(this, local->unk24, 30.0f, 12.0f, 0x3C)){ + func_80328A84(this, 12); + } + break; + + case 12: //L8038FEB8 + if(func_8038F5D4(this, local->unk18, 30.0f, 12.0f, 0x3C)){ + this->unk38_31 = TRUE; + } + break; + }//L8038FEEC +} diff --git a/src/FP/code_9EA0.c b/src/FP/code_9EA0.c new file mode 100644 index 00000000..c5da6925 --- /dev/null +++ b/src/FP/code_9EA0.c @@ -0,0 +1,89 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *func_80390290(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80390388(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_80392680[]; + +extern ActorInfo D_80392690 = { 0x20D, 0x33D, 0x38A, + 0x1, D_80392680, + func_80390388, func_80326224, func_80390290, + 2500, 0, 1.0f, 0 +}; + +/* .code */ +Actor *func_80390290(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + s32 sp18; + + sp18 = 2; + + if(this->unk38_31) return this; + + if(func_803114C4() == 0xC1F || func_803114C4() == 0xC1E){ + sp18 = 1; + } + func_8033A45C(1, 0); + func_8033A45C(3, sp18); + func_80325888(marker, gfx, mtx, vtx); +} + + +int func_80390334(void){ + if( levelSpecificFlags_get(0x11) && levelSpecificFlags_get(0x12) && levelSpecificFlags_get(0x13)){ + return TRUE; + } + return FALSE; +} + +void func_80390388(Actor *this){ + actor_collisionOff(this); + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(jiggyscore_isSpawned(JIGGY_2E_FP_PRESENTS) || jiggyscore_isCollected(JIGGY_2E_FP_PRESENTS)){ + levelSpecificFlags_set(0x11, TRUE); + levelSpecificFlags_set(0x12, TRUE); + levelSpecificFlags_set(0x13, TRUE); + } + if(jiggyscore_isCollected(JIGGY_2C_FP_BOGGY_3) || jiggyscore_isSpawned(JIGGY_2C_FP_BOGGY_3)){ + this->unk38_31 = FALSE; + this->marker->propPtr->unk8_3 = TRUE; + } + else{ + this->unk38_31 = TRUE; + this->marker->propPtr->unk8_3 = FALSE; + return; + } + }//L80390468 + + if( this->unk38_31 ) return; + if( this->state != 1 ) return; + + if( jiggyscore_isSpawned(JIGGY_2E_FP_PRESENTS) + || jiggyscore_isCollected(JIGGY_2E_FP_PRESENTS) + || func_80390334() + ){ + this->unk138_24 = TRUE; + } + + if( func_80329530(this, 0xFA) + && (func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT) + ){ + if(0.0f == this->unk1C[0] && func_80390334()){ + if(func_80311480(0xc1f, 0xb, this->position, NULL, NULL, NULL)){ + this->unk138_24 = TRUE; + this->unk1C[0] = 1.0f; + } + } + else{ + if( !this->unk138_24 ){ + if(func_80311480(0xc1e, 0x2b, this->position, NULL, NULL, NULL)){ + this->unk138_24 = TRUE; + } + } + } + } +} diff --git a/src/FP/code_A1C0.c b/src/FP/code_A1C0.c new file mode 100644 index 00000000..487195d0 --- /dev/null +++ b/src/FP/code_A1C0.c @@ -0,0 +1,21 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_803905B0(Actor *this); + +/* .data */ +ActorInfo D_803926C0 = { 0x20E, 0x33E, 0x49C, + 0x1, NULL, + func_803905B0, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_803905B0(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + actor_collisionOff(this); + } + this->marker->propPtr->unk8_3 = func_8038DD14(this) ? TRUE : FALSE; +} diff --git a/src/FP/code_A240.c b/src/FP/code_A240.c new file mode 100644 index 00000000..dddbe56c --- /dev/null +++ b/src/FP/code_A240.c @@ -0,0 +1,86 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8028E668(f32[3], f32, f32, f32); + +void func_80390630(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_803926F0[]= { + {0, 0.0f}, + {ASSET_221_ANIM_WOZZA_IN_CAVE, 5.0f} +}; + +extern ActorInfo D_80392700 = { MARKER_20F_WOZZA_IN_CAVE, ACTOR_33F_WOZZA_IN_CAVE, ASSET_494_MODEL_WOZZA, + 0x1, D_803926F0, + func_80390630, func_80326224, func_80325888, + 2500, 0, 1.6f, 0 +}; + +/* .code */ +void func_80390630(Actor *this){ + if(func_803203FC(0xC4)){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = FALSE; + actor_collisionOff(this); + this->unk58_0 = FALSE; + } + return; + } + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = FALSE; + actor_collisionOn(this); + this->unk38_31 = jiggyscore_isCollected(JIGGY_32_FP_WOZZA) || levelSpecificFlags_get(0x26) ? 0 : 1; + }//L80390714 + + if(this->unk38_31){ + this->unk58_0 = FALSE; + return; + } + + this->unk58_0 = TRUE; + func_8028E668(this->position, 200.0f, -40.0f, 160.0f); + + if(this->state == 1){ + this->yaw_moving = (f32)func_80329784(this); + func_80328FB0(this, 1.0f); + + if(!func_803114B0()){ + if( actor_animationIsAt(this, 0.09f) + || actor_animationIsAt(this, 0.19f) + ){ + FUNC_8030E8B4(SFX_88_WOZZA_NOISE, 1.0f, 22000, this->position, 500, 2000); + } + + if( actor_animationIsAt(this, 0.68f) + || actor_animationIsAt(this, 0.78f) + || actor_animationIsAt(this, 0.85f) + || actor_animationIsAt(this, 0.92f) + + ){ + FUNC_8030E8B4(SFX_3F2_UNKNOWN, 0.8f, 24000, this->position, 500, 2000); + } + } + + if(func_80329530(this, 350)){ + if(player_getTransformation() == TRANSFORM_4_WALRUS){ + if(!levelSpecificFlags_get(0x31)){ + if(func_80311480(0xc27, 0x23, NULL, NULL, NULL, NULL)){ + levelSpecificFlags_set(0x31, TRUE); + } + } + } + else{ + if(!levelSpecificFlags_get(0x32)){ + if(func_80311480(0xc26, 0x23, NULL, NULL, NULL, NULL)){ + levelSpecificFlags_set(0x32, TRUE); + } + } + } + } + } +} diff --git a/src/FP/code_A40.c b/src/FP/code_A40.c new file mode 100644 index 00000000..5ea76857 --- /dev/null +++ b/src/FP/code_A40.c @@ -0,0 +1,210 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *func_80386E30(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void chXmasTree_update(Actor *this); + +/* .data */ +ActorInfo D_80391B50 = { + MARKER_BA_XMAS_TREE, ACTOR_15F_XMAS_TREE, ASSET_488_MODEL_XMAS_TREE, + 0x1, NULL, + chXmasTree_update, func_80326224, func_80386E30, + 0, 0, 0.0f, 0 +}; + +s32 chXmasTree_switch_spawn_position[3] = {-0x1220, 0x6A, 0x1945}; + +/* .code */ +Actor *func_80386E30(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + func_8033A45C(5, this->unk38_31); + func_8033A45C(6, func_8031FF1C(0x13) && !func_8033A0F0(5)); + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_80386EAC(Actor *this){ + u8 tmp_a0; + + item_set(ITEM_6_HOURGLASS, FALSE); + tmp_a0 = this->unk44_31; + if(tmp_a0){ + func_8030DA44(tmp_a0); + this->unk44_31 = 0; + } +} + +void func_80386EF4(Actor *this, int arg1){ + this->unk38_31 = arg1; + mapSpecificFlags_set(0, this->unk38_31); + +} + +void func_80386F3C(void){ + levelSpecificFlags_set(0x29, TRUE); + func_803228D8(); + func_803204E4(0xe, 1); + func_802E4078(MAP_53_FP_CHRISTMAS_TREE, 1, 0); +} + +void func_80386F84(Actor * this){ + func_80328A84(this, 2); + func_80386EF4(this, 0); +} + +void func_80386FB4(void){ + func_8032811C(ACTOR_338_XMAS_TREE_SWITCH, chXmasTree_switch_spawn_position, 350); +} + +void func_80386FE0(void *marker){ + Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, marker)); + Actor *child = spawn_child_actor(0x339, &this); + s32 pad; + + child->position_x += 20.0f; + child->position_z += 25.0f; +} + +void func_80387038(Actor *this){ + if(func_8030E3FC(this->unk44_31)) + func_8030E394(this->unk44_31); + func_8030DBB4(this->unk44_31, randf2(0.9f, 1.1f)); + func_8030E2C4(this->unk44_31); +} + +void func_8038709C(Actor *this){ + if(this->state == 5){ + if(!mapSpecificFlags_get(0)) + func_80387038(this); + return; + } + + if(mapSpecificFlags_get(0) && !func_8030E3FC(this->unk44_31)) + func_80387038(this); +} + +void chXmasTree_update(Actor *this){ + f32 sp2C = time_getDelta(); + u8 tmp_a0; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + this->marker->collidable = FALSE; + func_803300D8(this->marker, func_80386EAC); + if(this->unk44_31 == 0){ + this->unk44_31 = func_8030D90C(); + sfxsource_setSfxId(this->unk44_31, SFX_415_UNKNOWN); + func_8030DD14(this->unk44_31, 3); + sfxsource_setSampleRate(this->unk44_31, 28000); + } + func_802C3BF8(func_80386FB4); + func_802C3C88(func_80386FE0, this->marker); + if(func_8031FF1C(0x13)){ + func_80386F84(this); + mapSpecificFlags_set(2, FALSE); + } + } + + this->unk124_9 = 1; + if(jiggyscore_isCollected(JIGGY_2F_FP_XMAS_TREE) || levelSpecificFlags_get(0x29)){ + func_80386EF4(this, 1); + return; + } + + switch(this->state){ + case 1: // L80387268 + func_80386EF4(this, 0); + if(func_8031FF1C(0x13)){ + func_80386F84(this); + } + break; + + case 2: // L80387294 + if(!mapSpecificFlags_get(2)) break; + + func_80328A84(this, 3); + this->unk60 = 2.0f; + func_8025A6EC(COMUSIC_61_XMAS_TREE_LIGHTS_UP, 28000); + func_802BAFE4(0x1A); + func_80311480(0xC14, 0, NULL, NULL, NULL, NULL); + break; + + case 3: // L803872F0 + if(0.0 <= this->unk60){ + if( 1.8 < this->unk60){ + func_80386EF4(this, 0); + } + else if(this->unk60 < 0.2){//L80387340 + func_80386EF4(this, 1); + } + else{ + if(randf() < 0.2){ + func_80386EF4(this, this->unk38_31 ^ 1); + func_8038709C(this); + } + }//L803873AC + this->unk60 -= sp2C; + } + else{//L803873BC + if(func_802BB270()){ + func_80328A84(this, 4); + func_80386EF4(this, 1); + item_set(ITEM_0_HOURGLASS_TIMER, 3600 - 1); + item_set(ITEM_6_HOURGLASS, TRUE); + + } + } + break; + + case 4: // L80387400 + if(mapSpecificFlags_get(3)){ + func_80328A84(this, 6); + func_80386EF4(this, 1); + item_set(ITEM_6_HOURGLASS, FALSE); + tmp_a0 = this->unk44_31; + if(tmp_a0){ + func_8030DA44(tmp_a0); + this->unk44_31 = 0; + } + func_80324E38(0.0f, 3); + timedFunc_set_0(0.5f, func_80386F3C); + } + else{//L80387470 + if(item_empty(ITEM_6_HOURGLASS)){ + func_80328A84(this, 5); + mapSpecificFlags_set(2, FALSE); + this->unk60 = 0.1f; + if(!func_8038BFA0()){ + if(!mapSpecificFlags_get(9) || mapSpecificFlags_get(1)){ + func_8025A6EC(COMUSIC_3C_MINIGAME_LOSS, 28000); + func_802BAFE4(0x1a); + this->unk60 = 2.0f; + } + } + } + } + break; + + case 5: // L803874EC + if(0.0 <= this->unk60){ + if( 1.8 < this->unk60){ + func_80386EF4(this, 1); + } + else if(this->unk60 < 0.2){ + func_80386EF4(this, 0); + } + else{ + if(randf() < 0.2){ + func_80386EF4(this, this->unk38_31 ^ 1); + func_8038709C(this); + } + } + this->unk60 -= sp2C; + } + else{ + func_80386F84(this); + } + break; + } +} diff --git a/src/FP/code_A500.c b/src/FP/code_A500.c new file mode 100644 index 00000000..2825fd7e --- /dev/null +++ b/src/FP/code_A500.c @@ -0,0 +1,93 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *func_803908F0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80390BDC(Actor *this); + +/* .data */ +extern ActorInfo D_80392730 = { 0x210, 0x340, 0x4D2, + 0x0, NULL, + func_80390BDC, func_80326224, func_803908F0, + 0, 0, 1.0f, 0 +}; + +extern struct31s D_80392754; +extern struct43s D_8039277C; +extern struct31s D_803927C4; +extern struct43s D_803927EC; +extern s32 D_80392834[3]; + +/* .code */ +Actor *func_803908F0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + if(this->unk38_31 != 0) return this; + + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_80390944(f32 position[3], s32 cnt, enum asset_e model_id){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + particleEmitter_setModel(pCtrl, model_id); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8039277C); + func_802EFE24(pCtrl, + 100.0f, 100.0f, 100.0f, + 250.0f, 250.0f, 250.0f + ); + func_802EFB98(pCtrl, &D_80392754); + func_802EF9F8(pCtrl, 0.6f); + func_802EFA18(pCtrl, 0); + func_802EFA20(pCtrl, 1.0f, 1.3f); + func_802EF9EC(pCtrl, 0x7B, 8000); + particleEmitter_emitN(pCtrl, cnt); +} + +void func_80390A30(f32 position[3], s32 cnt, enum asset_e sprite_id){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + func_802EFFA8(pCtrl, D_80392834); + particleEmitter_setSprite(pCtrl, sprite_id); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_803927EC); + func_802EFB98(pCtrl, &D_803927C4); + particleEmitter_emitN(pCtrl, cnt); +} + +void func_80390ABC(ActorMarker *marker){ + Actor *this = marker_getActor(marker); + func_80390944(this->position, 0xA, 0x4D3); + func_80390A30(this->position, 6, ASSET_700_SPRITE_DUST); + func_8030E6D4(SFX_B6_GLASS_BREAKING_1); + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + this->unk38_31 = 1; +} + +void func_80390B2C(ActorMarker *marker){ + Actor *this = marker_getActor(marker); + func_803228D8(); + func_802E4078(MAP_27_FP_FREEZEEZY_PEAK, 0xd, 0); + marker_despawn(this->marker); +} + +void func_80390B70(Actor *this){ + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.0f, 0); + timedFunc_set_1(0.6f, (TFQM1)func_80390ABC, this->marker); + timedFunc_set_1(2.5f, func_80390B2C, this->marker); +} + +void func_80390BDC(Actor *this){ + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(jiggyscore_isCollected(JIGGY_2F_FP_XMAS_TREE)){ + marker_despawn(this->marker); + } + else{ + if(levelSpecificFlags_get(0x29)){ + func_80390B70(this); + } + } + } +} diff --git a/src/FP/code_A880.c b/src/FP/code_A880.c new file mode 100644 index 00000000..9d8cb688 --- /dev/null +++ b/src/FP/code_A880.c @@ -0,0 +1,83 @@ +#include +#include "functions.h" +#include "variables.h" + +extern s32 func_8024DB50(f32[3], f32); + +void func_80390EB0(Actor *this); + +/* .data */ +extern ActorInfo D_80392840 = { 0x245, 0x353, 0x402, + 0x0, NULL, + func_80390EB0, func_80326224, func_80325340, + 2000, 0, 0.0f, 0 +}; +struct40s D_80392864; +s32 D_80392894[3]; +struct40s D_803928A0; +s32 D_803928D0[3]; + +/* .code */ +void func_80390C70(f32 position[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_80392894); + func_802EF9E4(pCtrl, 0x41); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setParticleSpawnPositionRange(pCtrl, + -40.0f, 110.0f, -40.0f, + 40.0f, 110.0f, 40.0f + ); + particleEmitter_setParticleVelocityRange(pCtrl, + 0.0f, 40.0f, 0.0f, + 0.0f, 90.0f, 0.0f + ); + func_802EFC28(pCtrl, &D_80392864); +} + +void func_80390D58(f32 position[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, ASSET_713_SPRITE_SPARKLE_YELLOW); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_803928D0); + func_802EF9E4(pCtrl, 0xFF); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setParticleSpawnPositionRange(pCtrl, + -40.0f, 50.0,-40.0f, + 40.0f, 70.0, 40.0f + ); + particleEmitter_setParticleVelocityRange(pCtrl, + -40.0f, 120.0,-40.0f, + 40.0f, 180.0, 40.0f + ); + particleEmitter_setParticleAccelerationRange(pCtrl, + 0.0f, -60.0f, 0.0f, + 0.0f, -100.0f, 0.0f + ); + func_802EFC28(pCtrl, &D_803928A0); +} + +void func_80390E78(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + FUNC_8030E8B4(SFX_96_HOTSAND_EEL_HISS, 1.0f, 32000, this->position, 1000, 2000); +} + +void func_80390EB0(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + actor_collisionOn(this); + marker_setCollisionScripts(this->marker, func_80390E78, NULL, NULL); + } + + if(func_8024DB50(this->position, 150.0f) || func_80329530(this, 1200)) + { + if( !(func_8023DB5C() & 3) && randf() < 0.2){ + func_80390C70(this->position); + } + + if( !(func_8023DB5C() & 3) && randf() < 0.7){ + func_80390D58(this->position); + } + } +} diff --git a/src/FP/code_ABD0.c b/src/FP/code_ABD0.c new file mode 100644 index 00000000..047533a8 --- /dev/null +++ b/src/FP/code_ABD0.c @@ -0,0 +1,245 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" +#include "SnS.h" + +extern ActorInfo D_80367FE0; + +extern ActorInfo D_80391A10; +extern ActorInfo D_80391A60; +extern ActorInfo D_80391AB0; +extern ActorInfo D_80391B50; +extern ActorInfo D_80391BB0; +extern ActorInfo D_80391C18; +extern ActorInfo D_80391C58; +extern ActorInfo D_80391CE8; +extern ActorInfo D_80391E08; +extern ActorInfo D_80391E2C; +extern ActorInfo D_80391E50; +extern ActorInfo D_80391F88; +extern ActorInfo D_80391FAC; +extern ActorInfo D_80391FD0; +extern ActorInfo D_80391FF4; +extern ActorInfo D_803920E8; +extern ActorInfo D_803923D0; +extern ActorInfo D_80392420; +extern ActorInfo D_80392470; +extern ActorInfo D_803924B0; +extern ActorInfo D_803924D4; +extern ActorInfo D_803924F8; +extern ActorInfo D_80392588; +extern ActorInfo D_80392628; +extern ActorInfo D_80392690; +extern ActorInfo D_803926C0; +extern ActorInfo D_80392700; +extern ActorInfo D_80392730; +extern ActorInfo D_80392840; + +void func_80391040(Actor *this); +void func_80391180(Actor *this); +void func_80391254(Actor *this); +void func_803912EC(Actor *this); +void func_8039180C(Actor *this); +void func_80391894(Actor *this); + +/* .data */ +ActorInfo D_803928E0 = { 0x247, 0x355, 0x4E5, 0x0, NULL, func_80391040, func_80326224, func_80325888, 3000, 0, 0.0f, 0}; +ActorInfo D_80392904 = { 0x248, 0x356, 0x4E6, 0x0, NULL, func_80391040, func_80326224, func_80325888, 3000, 0, 0.0f, 0}; +ActorInfo D_80392928 = { 0x249, 0x357, 0x4E7, 0x0, NULL, func_80391040, func_80326224, func_80325888, 3000, 0, 0.0f, 0}; +ActorInfo D_8039294C = { 0x24A, 0x358, 0x4E8, 0x0, NULL, func_80391040, func_80326224, func_80325888, 3000, 0, 0.0f, 0}; +ActorInfo D_80392970 = { 0x21F, 0x22B, 0x4C4, 0x1, NULL, func_80391180, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +ActorInfo D_80392994 = { 0x220, 0x22C, 0x4C5, 0x1, NULL, func_80391180, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +ActorInfo D_803929B8 = { 0x221, 0x22D, 0x4C6, 0x1, NULL, func_80391254, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +ActorInfo D_803929DC = { 0x222, 0x22E, 0x4C6, 0x1, NULL, func_80391254, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +ActorInfo D_80392A00 = { 0x223, 0x22F, 0x4C6, 0x1, NULL, func_80391254, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +ActorInfo D_80392A24 = { 0x24B, 0x35D, 0x4E9, 0x1, NULL, func_803912EC, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +ActorInfo D_80392A48 = { 0x24C, 0x35E, 0x4EC, 0x1, NULL, func_803912EC, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +ActorInfo D_80392A6C = { 0x24D, 0x35F, 0x4EA, 0x1, NULL, func_803912EC, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +ActorInfo D_80392A90 = { 0x24E, 0x360, 0x4EB, 0x1, NULL, func_803912EC, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +ActorInfo D_80392AB4 = { 0x23D, 0x253, 0x512, 0x1, NULL, func_8039180C, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +ActorInfo D_80392AD8 = { 0x23E, 0x254, 0x513, 0x1, NULL, func_80391894, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +ActorInfo D_80392AFC = { 0x286, 0x3AE, 0x55B, 0x1, NULL, func_80391180, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +ActorInfo D_80392B20 = { 0x21D, 0x229, 0x4C3, 0x1, NULL, func_80391180, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +ActorInfo D_80392B44 = { 0x289, 0x3B0, 0x56A, 0x1, NULL, func_80391180, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; + +/* .code */ +int func_80390FC0(void){ + f32 sp1C[3]; + + player_getVelocity(sp1C); + + if ( 0.0 == sp1C[0] && -1.0 == sp1C[1] && 0.0 == sp1C[2]) + return 0; + return 1; +} + +void func_80391040(Actor *this){ + f32 sp34[3]; + s32 a1; + s32 sp2C; + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + actor_collisionOff(this); + this->marker->propPtr->unk8_3 = TRUE; + } + + if( !this->marker->unk14_21 ) return; + if( !func_80390FC0() ) return; + if( func_8023DB5C() & 7 ) return; + + if(randf() < 0.5){ + a1 = 8; + switch(this->marker->unk14_20){ + case 0x247://L80391128 + sp2C = 0x710; + break; + + case 0x248://L80391130 + sp2C = 0x711; + break; + + case 0x249://L80391138 + sp2C = 0x712; + break; + + case 0x24A://L80391140 + sp2C = 0x711; + a1 = 6; + break; + + default: + sp2C = 0x711; + break; + } + func_8034A174(this->marker->unk44, randi2(0,a1) + 5, sp34); + func_802DC110(sp34, sp2C); + } +} + +void func_80391180(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + } + this->unk58_0 = func_8038DD14() ? 0 : 1; + + if(this->marker->unk14_20 == 0x21F){ + this->marker->unk40_22 = actor_playerIsWithinDist(this, 2000) ? 1 : 0; + } +} + +void func_80391254(Actor *this){ + func_802D3D74(this); + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(this->marker->unk14_20 == 0x221 || this->marker->unk14_20 == 0x223){ + this->pitch = 3.0f; + } + if(this->marker->unk14_20 == 0x222){ + this->pitch = 2.0f; + } + } +} + +void func_803912EC(Actor *this){ + func_802D3D74(this); + if(mapSpecificFlags_get(0xC)){ + marker_despawn(this->marker); + } + +} + +void func_80391324(void) +{ + spawnableActorList_add(&D_80391AB0, actor_new, 0X600); + spawnableActorList_add(&D_80391BB0, actor_new, 0X2A); + spawnableActorList_add(&D_80391C18, actor_new, 0X180084); + spawnableActorList_add(&D_80391C58, actor_new, 0X180084); + spawnableActorList_add(&D_80391CE8, actor_new, 0X2002E); + spawnableActorList_add(&D_80391E08, actor_new, 0X100); + spawnableActorList_add(&D_80391E2C, actor_new, 0X100); + spawnableActorList_add(&D_80391E50, actor_new, 0X100); + spawnableActorList_add(&D_80391F88, actor_new, 0X2100C); + spawnableActorList_add(&D_80391FAC, actor_new, 0X2100C); + spawnableActorList_add(&D_80391FD0, actor_new, 0X2100C); + spawnableActorList_add(&D_80391FF4, actor_new, 0X2100C); + spawnableActorList_add(&D_803920E8, actor_new, 0X408); + spawnableActorList_add(&D_803923D0, actor_new, 0X100006C); + spawnableActorList_add(&D_80391B50, actor_new, 0X20400); + spawnableActorList_add(&D_80392420, actor_new, 4); + spawnableActorList_add(&D_80392470, actor_new, 0X444); + spawnableActorList_add(&D_803924B0, actor_new, 8); + spawnableActorList_add(&D_803924D4, actor_new, 8); + spawnableActorList_add(&D_803924F8, actor_new, 8); + spawnableActorList_add(&D_80391A10, actor_new, 0); + spawnableActorList_add(&D_80391A60, actor_new, 0X20); + spawnableActorList_add(&D_80392588, actor_new, 0X80108); + spawnableActorList_add(&D_80392628, actor_new, 0X44); + spawnableActorList_add(&D_80392690, actor_new, 0XA8); + spawnableActorList_add(&D_803926C0, actor_new, 0X8000400); + spawnableActorList_add(&D_80392700, actor_new, 0X108); + spawnableActorList_add(&D_80392840, actor_new, 0); + spawnableActorList_add(&D_80392730, actor_new, 0X20000); + spawnableActorList_add(&D_80367FE0, actor_new, 0); + spawnableActorList_add(&D_803928E0, actor_new, 0X40); + spawnableActorList_add(&D_80392904, actor_new, 0X40); + spawnableActorList_add(&D_80392928, actor_new, 0X40); + spawnableActorList_add(&D_8039294C, actor_new, 0X40); + spawnableActorList_add(&D_80392B20, actor_new, 0X400); + spawnableActorList_add(&D_80392B44, actor_new, 0X400); + spawnableActorList_add(&D_80392970, actor_new, 0X400); + spawnableActorList_add(&D_80392994, actor_new, 0X400); + spawnableActorList_add(&D_803929B8, actor_new, 0X404); + spawnableActorList_add(&D_803929DC, actor_new, 0X404); + spawnableActorList_add(&D_80392A00, actor_new, 0X404); + spawnableActorList_add(&D_80392A24, actor_new, 0X20004); + spawnableActorList_add(&D_80392A48, actor_new, 4); + spawnableActorList_add(&D_80392A6C, actor_new, 0X20004); + spawnableActorList_add(&D_80392A90, actor_new, 0X20004); + spawnableActorList_add(&D_80392AB4, actor_new, 0X400); + spawnableActorList_add(&D_80392AD8, actor_new, 0X400); + spawnableActorList_add(&D_80392AFC, actor_new, 0X400); +} + + +void func_80391744(Actor *this, Actor* other){ + f32 sp34[3] = {0.0f, 0.0f, 0.0f}; + f32 sp28[3]; + void *sp24; + f32 tmp_f0; + + sp24 = func_80304C38(0x22A, this); + tmp_f0 = (f32)func_80304DA8(sp24); + other->yaw = tmp_f0; + this->yaw = tmp_f0; + ml_vec3f_yaw_rotate_copy(sp28, sp34, tmp_f0); + nodeprop_getPosition(sp24, sp34); + this->position_x = sp34[0] - sp28[0]; + this->position_z = sp34[2] - sp28[2]; + + other->position_x = sp34[0] + sp28[0]; + other->position_z = sp34[2] + sp28[2]; +} + +void func_8039180C(Actor *this){ + ActorMarker *sp24; + + if(!this->initialized){ + sp24 = func_80326EEC(0x254); + if(sns_get_item_state(SNS_ITEM_ICE_KEY, 1) == 1){ + marker_despawn(this->marker); + } + else{ + func_802D3D74(this); + func_80391744(this, sp24); + this->initialized = TRUE; + } + } +} + +void func_80391894(Actor *this){ + func_802D3D74(this); +} diff --git a/src/FP/code_B4D0.c b/src/FP/code_B4D0.c new file mode 100644 index 00000000..e02f592a --- /dev/null +++ b/src/FP/code_B4D0.c @@ -0,0 +1,40 @@ +#include +#include "functions.h" +#include "variables.h" + +struct { + u8 unk0; + f32 unk4[3]; +} D_803935E0; + +/* .code */ +void func_803918C0(void){ + Actor *actor; + if(map_get() == MAP_7F_FP_WOZZAS_CAVE){ + D_803935E0.unk0 = func_8030ED2C(SFX_128_FIRE_CRACKING, 2); + func_8030DBB4(D_803935E0.unk0, 1.0f); + actor = func_80326EEC(0x353); + if(actor){ + D_803935E0.unk4[0] = actor->position_x; + D_803935E0.unk4[1] = actor->position_y; + D_803935E0.unk4[2] = actor->position_z; + } + else{ + D_803935E0.unk4[0] = D_803935E0.unk4[1] = D_803935E0.unk4[2] = 0.0f; + } + } +} + +void func_8039195C(void){ + if(D_803935E0.unk0){ + func_8030DA44(D_803935E0.unk0); + D_803935E0.unk0 = 0; + } +} + +void func_80391994(void){ + if(map_get() == MAP_7F_FP_WOZZAS_CAVE){ + func_8030DB04(D_803935E0.unk0, 22000, D_803935E0.unk4, 400.0f, 1200.0f); + func_8030E2C4(D_803935E0.unk0); + } +} diff --git a/src/GV/code_0.c b/src/GV/code_0.c new file mode 100644 index 00000000..66c78f7c --- /dev/null +++ b/src/GV/code_0.c @@ -0,0 +1,87 @@ +#include +#include "functions.h" +#include "variables.h" + +void chtoots_update(Actor *this); + +/* .data */ +ActorAnimationInfo D_80390BD0[] = { + {0x000, 0.0f}, + {ASSET_162_ANIM_TOOTS_IDLE, 5.0f}, + {ASSET_162_ANIM_TOOTS_IDLE, 2.5f}, + {ASSET_164_ANIM_TOOTS_SING, 1.0f} +}; + +ActorInfo D_80390BF0 = { MARKER_1F4_TOOTS, ACTOR_1E4_TOOTS, ASSET_434_MODEL_TOOTS, + 0x1, D_80390BD0, + chtoots_update, func_80326224, func_80325888, + 2000, 0, 0.5f, 0 +}; + +/*.bss */ +s32 D_80391A30; +s32 D_80391A34; + +/* .code */ +void func_803863F0(Actor *this){ + func_80328B8C(this, 1, 0.0001f, 1); + D_80391A30 = FALSE; +} + +void func_80386420(Actor *this){ + func_80328B8C(this, 2, 0.0001f, 1); + this->unk38_31 = 0x23; +} + +void func_80386464(Actor *this){ + func_80328B8C(this, 3, 0.0001f, 1); +} + +void chtoots_update(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + D_80391A30 = 0; + D_80391A34 = 0; + } + + switch(this->state){ + case 1://L80386500 + if(D_80391A34){ + func_80386464(this); + } + else if(D_80391A30 == TRUE){ + func_80386420(this); + } + break; + case 2://L80386540 + if(D_80391A34){ + func_80386464(this); + } + else if(this->unk38_31 != 0){ + this->unk38_31--; + if(this->unk38_31 == 6){ + FUNC_8030E8B4(SFX_DD_JINJO_TALKING, 1.0f, 20000, this->position, 1500, 4500); + } + } + else{ + func_803863F0(this); + } + break; + case 3://L803865C8 + if(!D_80391A34) + func_803863F0(this); + break; + }//L803865DC +} + +void func_803865E8(void){ + D_80391A30 = TRUE; +} + +void func_803865F8(void){ + D_80391A34 = TRUE; +} + +void func_80386608(void){ + D_80391A34 = FALSE; +} diff --git a/src/GV/code_1570.c b/src/GV/code_1570.c new file mode 100644 index 00000000..9e78b2f2 --- /dev/null +++ b/src/GV/code_1570.c @@ -0,0 +1,237 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + u8 pad0[4]; + Struct80s *unk4; + BKModelBin *unk8; +}ActorLocal_Gobi2; + +void chgobi2_setState(Actor *this, s32 next_state); +void chgobi2_update(Actor *this); +Actor *chgobi2_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorInfo D_80390CB0 = { MARKER_BF_GOBI_2, ACTOR_131_GOBI_2, ASSET_3E0_MODEL_GOBI, + 0x0, NULL, + NULL, chgobi2_update, chgobi2_draw, + 0, 0x533, 0.0f, 0 +}; +f32 D_80390CD4[3] = {1475.0f, 442.0f, 8870.0f}; +f32 chgobi2_jiggy_position[3] = {1150.0f, 1150.0f, 9200.0f}; //jiggy spawn position +f32 D_80390CEC[3] = {1145.0f, 443.0f, 9197.0f}; + +/* .bss */ +extern u8 D_80391A50; + +/* .code */ +void func_80387960(void){ + func_8028F490(D_80390CD4); +} + +void func_80387984(ActorMarker *this){ + mapSpecificFlags_set(0xC, 1); +} + +void __chgobi2_spawnJIggy(void){ + jiggySpawn(JIGGY_45_GV_GOBI_2, chgobi2_jiggy_position); +} + +void func_803879D4(ActorMarker *this_marker){ + Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, this_marker)); + chgobi2_setState(this, 4); +} + +void func_80387A00(ActorMarker *this_marker){ + Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, this_marker)); + chgobi2_setState(this, 7); +} + +void func_80387A2C(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + timed_setCameraToNode(0.0f, 0xC); + timedFunc_set_1(0.5f, (TFQM1) func_80387984, reinterpret_cast(s32, caller)); + timed_playSfx(0.5f, SFX_2C_PULLING_NOISE, 0.9f, 32000); + timed_playSfx(1.8f, SFX_2C_PULLING_NOISE, 1.0f, 32000); + timed_playSfx(2.5f, SFX_2C_PULLING_NOISE, 1.1f, 32000); + timed_setCameraToNode(3.0f, 0xd); + timedFunc_set_0(3.5f, __chgobi2_spawnJIggy); + func_80324E88(6.0f); + timedFunc_set_1(6.0f, (TFQM1) func_80387A00, reinterpret_cast(s32, caller)); + func_80324E38(6.0f, 0); +} + +void chgobi2_setState(Actor *this, s32 next_state){ + ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local; + + if(next_state == 1) + actor_collisionOff(this); + + if(this->state == 1) + actor_collisionOn(this); + + if(next_state == 2){ + this->marker->propPtr->unk8_3 = TRUE; + func_80335924(this->unk148, ASSET_F4_ANIM_GOBI_IDLE, 0.5f, 12.0f); + } + + if(next_state == 3){ + timedFunc_set_0(0.05f, func_80387960); + timed_playSfx(0.05f, SFX_84_GOBI_CRYING, 1.1f, 32000); + func_80324E38(0.051f, 1); + timedFunc_set_1(0.06f, (TFQM1)func_803879D4, reinterpret_cast(s32, this->marker)); + timed_setCameraToNode(0.86f, 0xb); + timed_playSfx(0.8f, SFX_4B_GULPING, 0.8f, 28000); + timed_playSfx(1.4f, SFX_4B_GULPING, 0.8f, 28000); + timed_playSfx(2.0f, SFX_4B_GULPING, 0.8f, 28000); + func_80324DBC(3.0f, ASSET_A72_TEXT_TRUNKER_HELPED, 0x2A, D_80390CEC, this->marker, func_80387A2C, NULL); + }//L80387C94 + + if(next_state == 4){ + func_80335924(this->unk148, ASSET_FC_ANIM_GOBI_SPITTING, 0.2f, 3.0f); + func_80335924(local->unk4, ASSET_100_ANIM_GOBI_SPIT, 0.0f, 3.0f); + } + + if(next_state == 5){ + func_80335924(this->unk148, ASSET_FD_ANIM_GOBI2_GETTING_UP, 0.43f, 0.5f); + func_80335A8C(this->unk148, 2); + } + + if(next_state == 6){ + func_80335924(this->unk148, ASSET_F8_ANIM_GOBI_RUNNING, 0.4f, 0.71f); + func_80335A8C(this->unk148, 1); + } + + if(next_state == 7){ + marker_despawn(this->marker); + } + + if(next_state == 8){ + FUNC_8030E8B4(SFX_84_GOBI_CRYING, 0.9f, 20000, this->position, 1500, 2500); + func_80335924(this->unk148, ASSET_242_ANIM_GOBI_RELAXING, 0.2f, 0.5f); + } + + this->state = next_state; +} + +Actor *chgobi2_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(this_marker); + ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local; + f32 sp3C[3]; + + if(this->state == 0 || this->state == 1){ + return this; + } + + if(this->state == 6) + func_8033A280(2.0f); + + sp3C[0] = this->pitch; + sp3C[1] = this->yaw; + sp3C[2] = this->roll; + func_8033A238(func_803356A0(this->unk148)); + func_8033A2D4(func_803253A0, this); + func_803391A4(gfx, mtx, this->position, sp3C, 1.0f, NULL, func_80330B1C(this_marker)); + + if(this->state == 4){ + func_8033A238(func_803356A0(local->unk4)); + set_model_render_mode(2); + func_803391A4(gfx, mtx, this->position, sp3C, 1.0f, NULL, local->unk8); + } + return this; +} + + +void __chgobi2_80387EFC(Actor *this){ + ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local; + + chgobi2_setState(this, 0); + func_80335874(local->unk4); + assetcache_release(local->unk8); + +} + +void __chgobi2_ow(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + enum hitbox_e hitbox; + hitbox = player_getActiveHitbox(NULL); + if(hitbox == HITBOX_1_BEAK_BUSTER) + D_80391A50 = TRUE; + else if(hitbox == HITBOX_A_FAST_FALLING){ + this->unk1C[0] = 1.0f; + } +} + +void chgobi2_update(Actor *this){ + ActorMarker *sp34; + ActorLocal_Gobi2 *local = (ActorLocal_Gobi2 *)&this->local; + f32 sp2C; + + sp34 = this->marker; + sp2C = time_getDelta(); + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + marker_setCollisionScripts(this->marker, __chgobi2_ow, NULL, NULL); + sp34->unk30 = __chgobi2_80387EFC; + local->unk4 = func_803358B4(); + local->unk8 = (BKModelBin*) assetcache_get(ASSET_3F3_MODEL_GOBI_SPIT); + D_80391A50 = 0; + this->unk1C[0] = 0.0f; + this->unk1C[1] = 0.0f; + chgobi2_setState(this, 1); + if(jiggyscore_isSpawned(JIGGY_45_GV_GOBI_2)) + marker_despawn(this->marker); + return; + }//L80388060 + + if(this->state == 1){ + if(jiggyscore_isCollected(JIGGY_44_GV_GOBI_1)) + chgobi2_setState(this, 2); + } + + if(this->state == 2){ + if(this->unk1C[0] != 0.0f && this->unk1C[1] == 0){ + chgobi2_setState(this, 8); + } + else if(D_80391A50){ + chgobi2_setState(this, 3); + } + }//L80388114 + + if(this->state == 2){ + if(!this->unk138_24){ + if(func_80329530(this, 0xFA) && !func_80329530(this, 0x50)){ + if(func_8028F2A0()){ + if(func_80311480(ASSET_A75_TEXT_GOBI2_MEET, 0, this->position, NULL, NULL, NULL)) + this->unk138_24 = TRUE; + } + } + } + }//L80388194 + + if(this->state == 4){ + func_80335A94(local->unk4, sp2C, 1); + if(func_80335794(this->unk148) > 0){ + chgobi2_setState(this, 5); + } + } + + if(this->state == 5){ + if(func_80335794(this->unk148) > 0){ + chgobi2_setState(this, 6); + } + } + + if(this->state == 6){ + func_80326224(this); + } + + if(this->state == 8){ + if(func_80335794(this->unk148) > 0){ + chgobi2_setState(this, 2); + } + } + D_80391A50 = FALSE; + this->unk1C[1] = this->unk1C[0]; + this->unk1C[0] = 0.0f; +} diff --git a/src/GV/code_1E80.c b/src/GV/code_1E80.c new file mode 100644 index 00000000..e23e2640 --- /dev/null +++ b/src/GV/code_1E80.c @@ -0,0 +1,158 @@ +#include +#include "functions.h" +#include "variables.h" + +void chgobi3_setState(Actor *this, s32 next_state); +void chgobi3_update(Actor *this); +Actor *chgobi3_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorInfo D_80390D00 = { MARKER_C3_GOBI_3, ACTOR_135_GOBI_3, ASSET_3E0_MODEL_GOBI, + 0, NULL, + NULL, chgobi3_update, chgobi3_draw, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_80388270(Actor *this){ + func_8028F428(2, this->marker); +} + +void func_80388298(Actor *this){ + s32 pad24; + f32 sp18[3]; + TUPLE_ASSIGN(sp18, -6885.0f, 2383.0f, 1335.0f); + func_802C8F70(this->yaw); + func_802CA1CC(HONEYCOMB_C_GV_GOBI_3); + func_802C937C(0xd, sp18); +} + +void func_803882F0(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *this = marker_getActor(caller); + chgobi3_setState(this, 4); + timed_playSfx(0.0f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000); + timed_playSfx(0.0f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000); + + timed_playSfx(0.65f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000); + timed_playSfx(0.65f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000); + timed_playSfx(1.25f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 15000); + timed_playSfx(1.25f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 15000); + + timed_playSfx(1.81f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 10000); + timed_playSfx(1.81f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 10000); + + timed_playSfx(2.6f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 5000); + timed_playSfx(2.6f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 5000); + + func_80324E88(3.0f); + func_80324E38(3.0f, 0); +} + +void chgobi3_setState(Actor *this, s32 next_state){ + + if(next_state == 1) + actor_collisionOff(this); + + if(this->state == 1) + actor_collisionOn(this); + + if(next_state == 2){ + this->marker->propPtr->unk8_3 = TRUE; + func_80335924(this->unk148, ASSET_F4_ANIM_GOBI_IDLE, 0.5f, 12.0f); + } + + if(next_state == 3){ + func_80324E38(0.0f, 3); + timedFunc_set_1(0.02f, (TFQM1)func_80388270, (s32)this); + timed_setCameraToNode(0.1f, 0x12); + timed_playSfx(0.2f, SFX_4C_LIP_SMACK, 1.0f, 32000); + timedFunc_set_1(0.2f, (TFQM1)func_80388298, (s32)this); + func_80335924(this->unk148, ASSET_FC_ANIM_GOBI_SPITTING, 0.2f, 1.0f); + } + + if(next_state == 5){ + func_80335924(this->unk148, 0xd9, 0.5f, 4.0f); + func_80311480(ASSET_A77_TEXT_GOBI3_DONE, 0xe, this->position, this->marker, func_803882F0, NULL); + } + + if(next_state == 4){ + this->marker->propPtr->unk8_3 = FALSE; + func_80335924(this->unk148, ASSET_F8_ANIM_GOBI_RUNNING, 0.3f, 0.71f); + } + + if(next_state == 6){ + marker_despawn(this->marker); + } + + if(next_state == 7){ + FUNC_8030E8B4(SFX_84_GOBI_CRYING, 0.9f, 20000, this->position, 1500, 2500); + func_80335924(this->unk148, ASSET_242_ANIM_GOBI_RELAXING, 0.2f, 0.5f); + } + + this->state = next_state; +} + +Actor *chgobi3_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(this_marker); + + if(this->state == 0 || this->state == 1) return this; + + return func_80325888(this_marker, gfx, mtx, vtx); +} + +void chgobi3_ow(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + enum hitbox_e hitbox; + + hitbox = player_getActiveHitbox(NULL); + if(hitbox == HITBOX_1_BEAK_BUSTER){ + if(this->state == 2) + chgobi3_setState(this, 3); + } + else if(hitbox == HITBOX_A_FAST_FALLING){ + this->unk1C[0] = 1.0f; + } +} + +void chgobi3_update(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + marker_setCollisionScripts(this->marker, chgobi3_ow, NULL, NULL); + this->unk1C[0] = 0.0f; + this->unk1C[1] = 0.0f; + chgobi3_setState(this, 1); + if(honeycombscore_get(HONEYCOMB_C_GV_GOBI_3)) + marker_despawn(this->marker); + return; + } + + if(this->state == 1){ + if(jiggyscore_isSpawned(JIGGY_45_GV_GOBI_2)) + chgobi3_setState(this, 2); + } + + if(this->state == 2){ + if(this->unk1C[0] != 0.0f && this->unk1C[1] == 0){ + chgobi3_setState(this, 7); + } + } + + if(this->state == 3){ + if(func_80335794(this->unk148) > 0) + chgobi3_setState(this, 5); + } + + if(this->state == 4){ + func_80326224(this); + if(timedFuncQueue_is_empty()) + chgobi3_setState(this, 6); + } + + if(this->state == 7){ + if(func_80335794(this->unk148) > 0) + chgobi3_setState(this, 2); + } + + this->unk1C[1] = this->unk1C[0]; + this->unk1C[0] = 0.0f; +} diff --git a/src/GV/code_230.c b/src/GV/code_230.c new file mode 100644 index 00000000..8fadb690 --- /dev/null +++ b/src/GV/code_230.c @@ -0,0 +1,267 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80244BB0(s32, s32, s32, f32); + +typedef struct { + f32 unk0[3]; + u32 unk4_31:1; + u32 unk4_30:31; + f32 unk10[3]; + f32 unk1C; +}ActorLocal_GV_230; +#define LOCAL_GV_230(s) ((ActorLocal_GV_230 *)&s->local) + +void chancientone_update(Actor *this); +Actor *chancientone_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +s16 D_80390C20[4] = {5, 6, 7, 8}; +ActorMarker *D_80390C28[5] = {NULL}; +ActorAnimationInfo D_80390C3C[] = { + {0, 0.0f}, + {0, 0.0f}, + {ASSET_ED_ANIM_ANCIENT_ONE, 2.0f}, + {ASSET_ED_ANIM_ANCIENT_ONE, 33000000.f} +}; + +ActorInfo D_80390C5C = { MARKER_F4_ANCIENT_ONE, ACTOR_147_ANCIENT_ONE, ASSET_3E8_MODEL_ANCIENT_ONE, + 0x1, D_80390C3C, + chancientone_update, func_80326224, chancientone_draw, + 0, 0x100, 0.0f, 0 +}; + +/* .code */ +void func_80386620(Actor *this){ + int i; + s32 *temp_v0; + ActorMarker *temp_a0; + s32 temp_a1; + Actor *temp_v0_3; + s32 phi_s2; + s32 phi_s1; + s32 phi_s3; + + for(i = 0; i <5; i++){ + if(D_80390C28[i] == NULL) + return; + } + + D_80390C20[0] = 5; + D_80390C20[1] = 6; + D_80390C20[2] = 7; + D_80390C20[3] = 8; + + phi_s3 = (randf() * 1.0737418e9f); + phi_s2 = 1; + phi_s1 = 0; + while(phi_s2 != 0x40000000){ + if ((phi_s3 & phi_s2) != 0) { + temp_a1 = D_80390C20[phi_s1]; + D_80390C20[phi_s1] = D_80390C20[phi_s1 + 1]; + D_80390C20[phi_s1 + 1] = temp_a1; + temp_a0 = D_80390C28[phi_s1 + 1]; + D_80390C28[phi_s1 + 1] = D_80390C28[phi_s1 + 2]; + D_80390C28[phi_s1 + 2] = temp_a0; + temp_v0_3 = marker_getActor(D_80390C28[phi_s1 + 1]); + temp_v0_3->unkF4_8 = phi_s1 + 2; + temp_v0_3 = marker_getActor(D_80390C28[phi_s1 + 2]); + temp_v0_3->unkF4_8 = phi_s1 + 3; + } + phi_s1 = (phi_s1 == 2) ? 0 : phi_s1 + 1; + phi_s2 <<= 1; + }; +} + +void func_8038678C(void){ + func_80244BB0(3, 0x85, 0x7ff8, 1.0f); + func_80244BB0(4, 0x85, 0x7ff8, 1.0f); +} + +void func_803867CC(void){ + func_80244C78(3); + func_80244C78(4); +} + +void func_803867F4(void){ + f32 sp24[3]; + func_802BAFE4(4); + if(func_80304E24(0x148, sp24)){ + jiggySpawn(JIGGY_46_GV_ANCIENT_ONES, sp24); + func_802C3F04((GenMethod_4)func_802C4140, 0x4C, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); + } +} + +void func_80386850(ActorMarker *caller_marker, enum asset_e text_id, s32 arg2){ + Actor *caller = marker_getActor(caller_marker); + if(text_id == 0xA80){ + func_80328B8C(caller, 2, 0.0f, 1); + actor_playAnimationOnce(caller); + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff); + timedFunc_set_0(1.0f, func_803867F4); + } +} + +void chancientone_update(Actor *this){ + f32 sp44[3]; + s32 sp40; + s32 sp38; + s32 pad; + f32 sp34; + + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(jiggyscore_isSpawned(JIGGY_46_GV_ANCIENT_ONES)){ + marker_despawn(this->marker); + return; + } + } + if(!this->initialized){ + if(D_80390C28[this->unkF4_8 - 1]) + return; + + LOCAL_GV_230(this)->unk1C = this->position_y; + this->position_y -= 1100.0f; + D_80390C28[this->unkF4_8 - 1] = this->marker; + if(this->unkF4_8 != 1){ + this->marker->propPtr->unk8_4 = FALSE; + } + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + func_80386620(this); + } + else{//L803869B4 + switch(this->state){ + case 1: //L803869E4 + player_getPosition(sp44); + sp44[0] -= LOCAL_GV_230(this)->unk10[0]; + sp44[1] -= LOCAL_GV_230(this)->unk10[1]; + sp44[2] -= LOCAL_GV_230(this)->unk10[2]; + sp40 = (0.0f <= sp44[0]*LOCAL_GV_230(this)->unk0[0] + sp44[1]*LOCAL_GV_230(this)->unk0[1] + sp44[2]*LOCAL_GV_230(this)->unk0[2]) ? 0 : 1; + if(LOCAL_GV_230(this)->unk1C <= this->position_y){ + this->position_y = LOCAL_GV_230(this)->unk1C; + if( sp40 == (LOCAL_GV_230(this)->unk4_31 ^ 1)){ + if((sp44[0]*sp44[0] + sp44[1]*sp44[1] + sp44[2]*sp44[2]) < (f32)LOCAL_GV_230(this)->unk4_30){ + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + for(sp38= 7; sp38< 0xC && mapSpecificFlags_get(sp38);sp38++); + mapSpecificFlags_set(sp38, TRUE); + if(sp38== 0xB){ + if(!jiggyscore_isCollected(JIGGY_46_GV_ANCIENT_ONES)){ + func_80311480(ASSET_A80_TEXT_ANICIENT_ONES_DONE, 0xE, NULL, this->marker, func_80386850, NULL); + } + else{ + func_80386850(this->marker, 0xA80, -1); + } + }//L80386B98 + else { + if(sp38== 7){ + if(!jiggyscore_isCollected(JIGGY_46_GV_ANCIENT_ONES)){ + func_80311480(ASSET_A7F_TEXT_ANICIENT_ONES_MEET, 0x4, NULL, NULL, NULL, NULL); + } + } + + func_80328B8C(this, 2, 0.0f, 1); + actor_playAnimationOnce(this); + if(this->unkF4_8 < 5){ + D_80390C28[this->unkF4_8]->propPtr->unk8_4 = TRUE; + func_802BAFE4(D_80390C20[this->unkF4_8 - 1]); + func_80244BB0(2, 0x86, 0x7ff8, 0.3f); + timedFunc_set_0(0.45f, func_8038678C); + + }//L80386DB0 + } + } + } + } + else{//L80386C64 + sp38 = func_8023DB5C() & 0xF; + sp34 = LOCAL_GV_230(this)->unk1C + 40.0f; + this->position_y += 18.0; + this->position_x += (sp38 & 1) ? 0x17 : -0x17; + this->position_z += (sp38 & 2) ? 0xC : -0xC; + if(this->unkF4_8 != 1){ + if(sp38 == 6){ + func_802C3F04((GenMethod_4)func_802C4140, 0x4C, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, sp34), reinterpret_cast(s32, this->position_z)); + } + if(sp38 == 4 && this->position_y < LOCAL_GV_230(this)->unk1C - 600.0f){ + func_802C3F04((GenMethod_4)func_802C4140, 0x11f, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, sp34), reinterpret_cast(s32, this->position_z)); + }//L80386D80 + } + if(LOCAL_GV_230(this)->unk1C <= this->position_y){ + func_80244C78(2); + timedFunc_set_0(0.5f, func_803867CC); + } + }//L80386DB0 + LOCAL_GV_230(this)->unk4_31 = sp40; + break; + case 2: //L80386DCC + if(actor_animationIsAt(this, 0.999f)){ + func_80328B8C(this, 3, 0.9999f, 1); + actor_playAnimationOnce(this); + } + break; + case 3: //L80386E04 + if(LOCAL_GV_230(this)->unk1C - 1100.0f < this->position_y){ + this->position_y -= 10.0; + } + else{ + this->marker->propPtr->unk8_4 = FALSE; + } + break; + }//L80386E60 + }//L80386E60 +} + +Actor *chancientone_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(this_marker); + int sp58; + s32 sp4C[3]; + s32 sp40[3]; + s32 sp34[3]; + f32 sp28[3]; + s32 tmp_v0; + + sp58 = (this->state == 3) ? 0 : 1; + func_8033A45C(3, sp58); + func_8033A45C(4, sp58); + func_80325888(this_marker, gfx, mtx, vtx); + if( !this->initialized && this_marker->unk14_21){ + func_8034A1B4(func_80329934(), 5, sp4C); + func_8034A1B4(func_80329934(), 6, sp40); + func_8034A1B4(func_80329934(), 7, sp34); + sp4C[1] += 1100; + sp40[1] += 1100; + sp34[1] += 1100; + LOCAL_GV_230(this)->unk0[0] = (sp4C[0] - sp40[0]); + LOCAL_GV_230(this)->unk0[1] = (sp4C[1] - sp40[1]); + LOCAL_GV_230(this)->unk0[2] = (sp4C[2] - sp40[2]); + player_getPosition(sp28); + + sp28[0] -= sp40[0]; + sp28[1] -= sp40[1]; + sp28[2] -= sp40[2]; + + if(0.0f <= sp28[0] *LOCAL_GV_230(this)->unk0[0] + sp28[1]*LOCAL_GV_230(this)->unk0[1] + sp28[2]*LOCAL_GV_230(this)->unk0[2]) + LOCAL_GV_230(this)->unk4_31 = FALSE; + else + LOCAL_GV_230(this)->unk4_31 = TRUE; + + LOCAL_GV_230(this)->unk10[0] = (f32)sp40[0]; + LOCAL_GV_230(this)->unk10[1] = (f32)sp40[1]; + LOCAL_GV_230(this)->unk10[2] = (f32)sp40[2]; + tmp_v0 = (sp34[1]- sp40[1]); + LOCAL_GV_230(this)->unk4_30 = (s32)(0.95*(f32)(tmp_v0*tmp_v0)); + this->initialized = TRUE; + } + return this; +} + + +void func_80387118(void){ + int i; + for(i = 0; i < 5; i++){ + D_80390C28[i] = NULL; + } +} diff --git a/src/GV/code_24D0.c b/src/GV/code_24D0.c new file mode 100644 index 00000000..aa3bbcee --- /dev/null +++ b/src/GV/code_24D0.c @@ -0,0 +1,76 @@ +#include +#include "functions.h" +#include "variables.h" + + +void chgobirope_update(Actor *this); + +/* .data */ +ActorInfo D_80390D30 = { MARKER_BD_GOBI_ROPE, ACTOR_12F_GOBI_ROPE, ASSET_3E3_MODEL_GOBI_ROPE, + 0, NULL, + chgobirope_update, func_80326224, func_80325888, + 0, 0x533, 0.0f, 0 +}; + +/* .code */ +void chgobirope_setState(Actor *this, s32 next_state){ + this->state = next_state; + + if(this->state == 1){ + func_80335924(this->unk148, ASSET_DD_ANIM_GOBI_ROPE, 0.5f, 4.0f); + } + + if(this->state == 2){ + func_80335924(this->unk148, ASSET_DC_ANIM_GOBI_ROPE_PULLING, 1.0f, 5.0f); + } + + if(this->state == 3){ + func_80335924(this->unk148, 0xF5, 0.1f, 1.0f); + func_80335A8C(this->unk148, 2); + } + + if(this->state == 4){ + marker_despawn(this->marker); + } +} + +void chgobirope_update(Actor *this){ + Actor *sp2C; + f32 sp28; + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + sp2C = func_80326D68(this->position, ACTOR_12E_GOBI_1, -1, &sp28); + if(sp2C){ + this->position_x = sp2C->position_x; + this->position_y = sp2C->position_y; + this->position_z = sp2C->position_z; + } + chgobirope_setState(this, 1); + if( jiggyscore_isSpawned(JIGGY_44_GV_GOBI_1) + && !func_803203FC(1) + ){ + marker_despawn(this->marker); + } + } + else{ + if(this->state == 1 || this->state == 2){ + if(this->state == 1 && func_80387354()){ + chgobirope_setState(this, 2); + } + else{ + if(func_80387360()) + chgobirope_setState(this, 4); + } + }//L80388AB4 + if(this->state == 2){ + if(func_80335794(this->unk148) > 0) + chgobirope_setState(this, 1); + } + if(this->state == 3){ + if(func_80335794(this->unk148) > 0) + chgobirope_setState(this, 4); + } + } +} diff --git a/src/GV/code_2730.c b/src/GV/code_2730.c new file mode 100644 index 00000000..7b7f862c --- /dev/null +++ b/src/GV/code_2730.c @@ -0,0 +1,131 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802EF3A8(ParticleEmitter *, Gfx **, Mtx **, Vtx**); + +typedef struct { + f32 unk0[3]; + ParticleEmitter *unkC; + ParticleEmitter *unk10; + f32 unk14; +}ActorLocal_GV_2730; + +void func_80388DC8(Actor *this); +Actor *func_80388C64(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorInfo D_80390D60 = { 0xBE, 0x130, 0x3E4, + 0, NULL, + func_80388DC8, func_80326224, func_80388C64, + 0, 0x533, 0.0f, 0 +}; + +f32 D_80390D84[3] = {5644.0f, 2930.0f, -3258.0f}; + +/*.bss */ +u8 D_80391A60; + +/* .code */ +void func_80388B20(Actor *this, s32 next_state){ + ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local; + + this->state = next_state; + local->unk14 = 0.0f; + D_80391A60 = FALSE; + if(this->state == 2){ + this->marker->propPtr->unk8_3 = FALSE; + local->unk14 = 2.6f; + D_80391A60 = TRUE; + func_8028F428(2, this->marker); + FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.3f, 9000); + FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.5f, 9000); + FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.7f, 9000); + FUNC_8030E624(SFX_9B_BOULDER_BREAKING_1, 0.9f, 9000); + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + func_802F066C(local->unkC, local->unk0); + particleEmitter_emitN(local->unkC, 10); + func_802F053C(local->unk10, local->unk0); + particleEmitter_emitN(local->unk10, 10); + + } +} + +void func_80388C24(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + if(this->state == 1) + func_80388B20(this, 2); +} + +Actor *func_80388C64(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(this_marker); + ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local; + f32 sp3C[3]; + + func_802EF3A8(local->unkC, gfx, mtx, vtx); + func_802EF3A8(local->unk10, gfx, mtx, vtx); + if(this->state == 0 || this->state == 2) + return this; + + sp3C[0] = this->pitch; + sp3C[1] = this->yaw; + sp3C[2] = this->roll; + func_8033A2D4(func_803253A0, this); + func_8033A450(func_80329934()); + func_803391A4(gfx, mtx, this->position, sp3C, 1.0f, NULL,func_80330B1C(this_marker)); + func_8034A174(func_80329934(), 5, local->unk0); + return this; + +} + +s32 func_80388D78(void){ + return D_80391A60; +} + +void func_80388D84(Actor *this){ + ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local; + func_80388B20(this, 0); + func_802EF684(local->unkC); + func_802EF684(local->unk10); +} + +void func_80388DC8(Actor *this){ + ActorMarker *sp34 = this->marker; + ActorLocal_GV_2730 *local = (ActorLocal_GV_2730 *)&this->local; + f32 sp2C; + Actor *sp28; + f32 sp24 = time_getDelta(); + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + sp34->unk30 = func_80388D84; + sp34->propPtr->unk8_3 = TRUE; + marker_setCollisionScripts(this->marker, NULL, NULL, func_80388C24); + local->unkC = particleEmitter_new(20); + local->unk10 = particleEmitter_new(30); + D_80391A60 = FALSE; + sp28 = func_80326D68(this->position, ACTOR_12E_GOBI_1, -1, &sp2C); + if(sp28){ + this->position_x = sp28->position_x; + this->position_y = sp28->position_y; + this->position_z = sp28->position_z; + } + func_80388B20(this, 1); + if(jiggyscore_isSpawned(JIGGY_44_GV_GOBI_1) && !func_803203FC(1)){ + marker_despawn(this->marker); + } + } + else{//L80388ED0 + particleEmitter_update(local->unkC); + particleEmitter_update(local->unk10); + if(func_8025773C(&local->unk14, sp24)){ + jiggySpawn(JIGGY_44_GV_GOBI_1, D_80390D84); + func_802BB3DC(0, 60.0f, 0.65f); + } + if(this->state == 2){ + if(func_802EF648(local->unkC) && func_802EF648(local->unk10)){ + marker_despawn(sp34); + } + } + } +} diff --git a/src/GV/code_2B80.c b/src/GV/code_2B80.c new file mode 100644 index 00000000..f5215359 --- /dev/null +++ b/src/GV/code_2B80.c @@ -0,0 +1,91 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_80389144(Actor *this); +Actor *func_80389050(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorInfo D_80390D90 = { + MARKER_C0_TRUNKER, ACTOR_132_TRUNKER, ASSET_3DF_MODEL_TRUNKER, + 0, NULL, + func_80389144, NULL, func_80389050, + 0, 0x599, 2.0f, 0 +}; + +/* .code */ +void func_80388F70(Actor *this, s32 next_state){ + this->state = next_state; + if(this->state == 1){ + func_80335924(this->unk148, ASSET_FE_ANIM_TRUCKER_SHORT, 0.1f, 2.5f); + } + + if(this->state == 2){ + func_80335924(this->unk148, ASSET_FF_ANIM_TRUCKER_GROW, 0.1f, 2.5f); + func_80335A8C(this->unk148, 2); + } + + if(this->state == 3){ + func_80335924(this->unk148, ASSET_FF_ANIM_TRUCKER_GROW, 0.0f, 2.5f); + func_80335A74(this->unk148, 0.999f); + func_80335A8C(this->unk148, 2); + } +} + +Actor *func_80389050(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(this_marker); + f32 sp38[3]; + f32 sp2C[3]; + + if(this->state == 0) return this; + + this = func_80325888(this_marker, gfx, mtx, vtx); + sp38[0] = this->position_x - 150.0f; + sp38[1] = this->position_y + 2.0f; + sp38[2] = this->position_z - 170.0f; + sp2C[0] = this->pitch; + sp2C[1] = this->yaw + 220.0f; + sp2C[2] = this->roll; + set_model_render_mode(2); + func_803391A4(gfx, mtx, sp38, sp2C, 1.0f, NULL, func_8030A428(3)); + return this; +} + + +void func_80389144(Actor *this){ + ActorMarker *marker = this->marker; + s32 sp28 = 0; + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + mapSpecificFlags_set(0xC, FALSE); + if(jiggyscore_isSpawned(JIGGY_45_GV_GOBI_2) && !func_803203FC(1)){ + func_80388F70(this, 3); + } + else{//L803891CC + func_80388F70(this, 1); + } + }//L803891D8 + if( this->state == 1 + && !this->unk138_24 + && func_80329530(this, 250) + && !func_80329530(this, 80) + && func_8028F2A0() + ){ + func_80311480(ASSET_A71_TEXT_TRUNKER_MEET, 0xe, this->position, NULL, NULL, NULL); + this->unk138_24 = 1; + }//L80389254 + + if(this->state == 1 && mapSpecificFlags_get(0xC)){ + sp28 = 2; + } + + if(this->state == 2 && func_80335794(this->unk148) > 0){ + sp28 = 3; + } + + if(sp28) + func_80388F70(this, sp28); +} diff --git a/src/GV/code_2EE0.c b/src/GV/code_2EE0.c new file mode 100644 index 00000000..ca5facad --- /dev/null +++ b/src/GV/code_2EE0.c @@ -0,0 +1,50 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8038938C(Actor *this); +Actor *func_803892D0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +extern ActorAnimationInfo D_80390DC0[]={ + {0, 0.0f}, + {ASSET_F1_ANIM_MAGIC_CARPET, 2.0f} +}; + +extern ActorInfo D_80390DD0 = { MARKER_AF_MAGIC_CARPET_SHADOW, ACTOR_122_MAGIC_CARPET_SHADOW, ASSET_3E7_MODEL_MAGIC_CARPET_SHADOW, + 0x1, D_80390DC0, + func_8038938C, func_80326224, func_803892D0, + 2500, 0, 0.0f, 0 +}; + +/* .code */ +Actor *func_803892D0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + f32 rotation[3]; + f32 position[3]; + Actor *this; + + this = func_80325300(this_marker, rotation); + if(this->unk1C[2] != 0.0f){ + position[0] = this->position_x; + position[1] = this->position_y; + position[2] = this->position_z; + position[1] += 8.0f; + func_8033A2D4(func_803253A0, this); + func_803391A4(gfx, mtx, position, rotation, this->unk1C[0], NULL, func_80330B1C(this_marker)); + } + return this; +} + +void func_8038938C(Actor *this){ + if(!this->initialized){ + this->initialized = TRUE; + this->unk124_11 = 3; + this->unk1C[2] = 1.0f; + this->velocity[0] = 0.0f; + actor_collisionOff(this); + } + + if(this->velocity[0] != 0.0f){ + this->alpha_124_19 = this->velocity[1]; + } +} diff --git a/src/GV/code_30C0.c b/src/GV/code_30C0.c new file mode 100644 index 00000000..fac21b22 --- /dev/null +++ b/src/GV/code_30C0.c @@ -0,0 +1,152 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802EE6CC(f32[3], s32[4], s32[4], s32, f32, f32, s32, s32, s32); + + +void func_80389634(Actor *this); +void func_803898B8(Actor *this); + +/* .data */ +ActorAnimationInfo D_80390E00[] = { + {0x00, 0.0f}, + {0xCD, 8000000.0f}, + {0xCD, 2.5f}, + {0xCD, 8000000.0f}, + {0xCD, 1.6f}, + {0xCD, 4.5f}, +}; + +ActorInfo D_80390E30 = { 0xA8, 0x11A, 0x33D, + 0x1, D_80390E00, + func_80389634, func_80326224, func_80325888, + 2500, 0, 0.0f, 0 +}; + +ActorInfo D_80390E54 = { 0x23B, 0x244, 0x33D, + 0x1, D_80390E00, + func_803898B8, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; +s32 D_80390E78[4] = {0xff, 0xd0, 0x5d, 0xb4}; +s32 D_80390E88[4] = {0, 0, 0, 0}; + +/* .code */ +void func_803894B0(Actor *this){ + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + func_80328B8C(this, 1, 0.01f, 1); + this->unk38_31 = 0; + this->initialized = TRUE; +} + +void func_80389518(Actor *this){ + func_802EE6CC(this->unk1C, D_80390E88, D_80390E78, 0, + 0.55f, 50.0f, 0xDC, 0x168, 0 + ); +} + +int func_8038957C(Actor *this){ + f32 f0; + + f0 = this->yaw - func_80329784(this); + if(180.0f <= f0) + f0 -= 360; + else if(f0 < -180.0f) + f0 += 360; + + if(f0 <= 0.0f && -180.0f <= f0){ + return 1; + } + return 0; +} + +void func_80389634(Actor *this){ + int i; + + switch(this->state){ + case 1: //L80389680 + if(!this->initialized){ + func_803894B0(this); + } + if(func_80329530(this, 500) && func_8038957C(this)){ + func_80328B8C(this, 2, 0.01f, 1); + FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 1.0f, 32000, this->position, 1250, 2500); + FUNC_8030E8B4(SFX_3F6_UNKNOWN, 1.0f, 32000, this->position, 1250, 2500); + + } + break; + + case 2: //L8038970C + if( this->unk38_31 == 0 + && actor_animationIsAt(this, 0.1f) + && !jiggyscore_isCollected(JIGGY_41_GV_MAZE) + ){ + func_8025A6EC(COMUSIC_3D_JIGGY_SPAWN, 0x7fff); + this->unk38_31 = 1; + } + if(actor_animationIsAt(this, 0.5f)){ + func_80328B8C(this, 3, 0.5f, 1); + } + break; + + case 3: //L80389788 + if(!func_80329530(this, 0x2bc)){ + func_80328B8C(this, 4, 0.5f, 1); + FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 1.0f, 32000, this->position, 1250, 2500); + FUNC_8030E8B4(SFX_3F6_UNKNOWN, 1.0f, 32000, this->position, 1250, 2500); + } + break; + case 4: //L803897E4 + if(actor_animationIsAt(this, 0.9f) && this->marker->unk14_21){ + i = 6; + do{ + func_8034A174((struct5Bs*)this->marker->unk44, i, this->unk1C); + func_80389518(this); + i++; + }while(i < 17); + } + + if(actor_animationIsAt(this, 0.99f)){ + func_80328B8C(this, 1, 0.01f, 1); + } + else if(actor_animationIsAt(this, 0.9f)){ + FUNC_8030E8B4(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 32000, this->position, 1250, 2500); + } + break; + }//L803898A8 +} + +void func_803898B8(Actor *this){ + if(!this->initialized){ + func_803894B0(this); + if(func_8031FF1C(BKPROG_A4_UNKOWN)) + func_80328B8C(this, 3, 0.5f, 1); + this->unk1C[0] = 0.0f; + } + + switch(this->state){ + case 1://L80389934 + if(this->unk1C[0] != 0.0f){ + this->unk1C[0] -= 1.0f; + if(this->unk1C[0] == 0.0f){ + func_80328B8C(this, 5, 0.01f, 1); + FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 0.5f, 32000, this->position, 1250, 2500); + FUNC_8030E8B4(SFX_3F6_UNKNOWN, 0.5f, 32000, this->position, 1250, 2500); + } + } + else{//L803899C0 + if(func_8031FF1C(BKPROG_A3_UNKOWN)){ + this->unk1C[0] = 33.0f; + } + } + break; + case 5://L803899DC + if(actor_animationIsAt(this, 0.5f)){ + func_80328B8C(this, 3, 0.5f, 1); + FUNC_8030E624(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 25000); + } + break; + }//L80389A0C +} diff --git a/src/GV/code_3630.c b/src/GV/code_3630.c new file mode 100644 index 00000000..7bf4a338 --- /dev/null +++ b/src/GV/code_3630.c @@ -0,0 +1,117 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80389B1C(Actor *this); + +/* .data */ +ActorAnimationInfo D_80390EA0[] = { + {0x00, 0.0f}, + {0xDF, 4.5f}, + {0xE3, 2.0f}, + {0xE4, 1.95f}, + {0xCE, 2.4f}, + {0xDF, 4.5f} +}; + +ActorInfo D_80390ED0 = { MARKER_A9_RUBEE, ACTOR_11B_RUBEE, ASSET_3DD_MODEL_RUBEE, + 0x2, D_80390EA0, + func_80389B1C, func_80326224, func_80325888, + 2500, 0, 1.6f, 0 +}; + + +/* .code */ +void func_80389A20(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *this = marker_getActor(caller); + func_8038E18C(); + func_80328B8C(this, 3, 0.0f, 1); +} + +void func_80389A60(Actor *this){ + func_80311480(ASSET_A70_TEXT_CHARMER_HELPED, 4, NULL, this->marker, func_80389A20, NULL); + this->unk138_24 = TRUE; + func_80328A84(this, 5); +} + +void func_80389ABC(Actor *this){ + if(this->unk138_23){ + func_80389A20(this->marker, ASSET_A70_TEXT_CHARMER_HELPED, -1); + } + else{ + this->unk138_23 = TRUE; + mapSpecificFlags_set(2, TRUE); + func_80389A60(this); + } +} + +void func_80389B1C(Actor *this){ + if(!this->unk16C_4){ + this->unk60 = (f32) func_8038E184(); + this->unk138_24 = jiggyscore_isCollected(JIGGY_43_GV_HISTUP) || mapSpecificFlags_get(0); + this->unk138_23 = jiggyscore_isCollected(JIGGY_43_GV_HISTUP) || mapSpecificFlags_get(2); + this->unk16C_4 = TRUE; + } + + if(!this->initialized){ + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + this->initialized = TRUE; + } + + animctrl_setTransitionDuration(this->animctrl, 0.15f); + + if(this->state == 1 || this->state == 2){ + if(! this->unk138_24 && func_80329530(this, 250) && !func_80329530(this, 0x50)){ + func_80311480(ASSET_A6F_TEXT_CHARMER_MEET, 0xe, this->position, NULL, NULL, NULL); + this->unk138_24 = TRUE; + mapSpecificFlags_set(0, TRUE); + } + } + + switch(this->state){ + case 1://L80389CC4 + if(this->unk60 <= (f32)func_8038E178()){ + func_80389ABC(this); + } + else if(actor_animationIsAt(this, 0.99f)){ + func_80328B38(this, 2, 0.9f); + } + + if( actor_animationIsAt(this, 0.42f) + || actor_animationIsAt(this, 0.46f) + || actor_animationIsAt(this, 0.51f) + || actor_animationIsAt(this, 0.57f) + ){ + FUNC_8030E8B4(SFX_8_BANJO_LANDING_04, 3.802f, 8000, this->position, 1500, 4500); + } + + if( actor_animationIsAt(this, 0.4f)){ + func_803865E8(); + } + break; + + case 2: //L80389DB0 + if(this->unk60 <= (f32)func_8038E178()){ + func_80389ABC(this); + } + else if(actor_animationIsAt(this, 0.99f)){ + func_80328B38(this, 1, 0.4f); + } + break; + case 3: //L80389E14 + if( actor_animationIsAt(this, 0.2f)){ + func_8025A58C(500, 400); + func_8025A6EC(COMUSIC_27_GV_RUBEES_SONG, 28000); + } + + if( actor_animationIsAt(this, 0.99f)){ + func_80328A84(this, 4); + } + break; + case 4: //L80389E64 + if(!func_8038E178()) + func_80328A84(this, 2); + break; + }//L80389E80 +} diff --git a/src/GV/code_3AA0.c b/src/GV/code_3AA0.c new file mode 100644 index 00000000..3a312bc8 --- /dev/null +++ b/src/GV/code_3AA0.c @@ -0,0 +1,25 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80389E90(Actor *this); +void func_80389EA8(Actor *this); + +/* .data */ +ActorInfo D_80390F00 = { MARKER_AB_RUBEES_EGG_POT, ACTOR_11D_RUBEES_EGG_POT, ASSET_3E1_MODEL_RUBEES_EGG_POT, + 0x1, NULL, + func_80389E90, func_80389EA8, func_80325888, + 2500, 0, 0.9f, 0 +}; + +/* .code */ +void func_80389E90(Actor *this){ + this->marker->propPtr->unk8_3 = FALSE; +} + +void func_80389EA8(Actor *this){ + this->marker->propPtr->unk8_3 = FALSE; + this->unk4C = 100 + 40*func_8038E178(); + func_80343DEC(this); + +} diff --git a/src/GV/code_3B10.c b/src/GV/code_3B10.c new file mode 100644 index 00000000..5f2a1ccb --- /dev/null +++ b/src/GV/code_3B10.c @@ -0,0 +1,28 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8028F710(s32, f32); + +/* .data */ +u8 D_80390F30[] = { + 0x00, 0x27, 0x45, 0x30, + 0xAA, 0x18, 0xBB, 0xF3, + 0x00, 0x03, 0x03, 0x1C, + 0x00, 0x00, 0x00, 0x00 +}; + +/* .code */ +void func_80389F00(void){ + if(getGameMode() != GAME_MODE_7_ATTRACT_DEMO && 2.0f < func_8028E80C(3)){ + func_8028F710(3, 2.0f); + } +} + +void func_80389F5C(void){ + u32 sp1C; + osPiReadIo(0x800, &sp1C); + sp1C <<= 0x10; + if(sp1C != 0x10000) + func_80389F00(); +} diff --git a/src/GV/code_3BB0.c b/src/GV/code_3BB0.c new file mode 100644 index 00000000..dbf05953 --- /dev/null +++ b/src/GV/code_3BB0.c @@ -0,0 +1,63 @@ +#include +#include "functions.h" +#include "variables.h" + +extern int func_8024DB50(f32[3], f32); + +void func_8038A084(Actor *this); + +/* .data */ +ActorInfo D_80390F40 = { 0x24F, 0x37C, 0x0, + 0, NULL, + func_8038A084, func_80326224, func_80325340, + 2000, 0, 0.0f, 0 +}; + +struct40s D_80390F64 = { + { {2.5f, 2.8f}, + {4.0f, 5.0f}, + {0.0f, 0.01f}, + {2.0f, 2.5f}, + 0.1f, 0.4f + }, + 4.0f, + 1.0f +}; + +s32 D_80390F94[3] = {0xFF, 0xFF, 0x9B}; + +/* .code */ +void func_80389FA0(f32 position[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_80390F94); + func_802EF9E4(pCtrl, 100); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setParticleSpawnPositionRange( pCtrl, + -700.0f, 0.0f, -700.0f, + 700.0f, 0.0f, 700.0f + ); + particleEmitter_setParticleVelocityRange(pCtrl, + 0.0f, 40.0f, 0.0f, + 0.0f, 90.0f, 0.0f + ); + func_802EFC28(pCtrl, &D_80390F64); +} + +void func_8038A084(Actor *this){ + if(this->unkF4_8 == 6 && !this->unk16C_4){ + this->unk16C_4 = TRUE; + if( jiggyscore_isCollected(JIGGY_42_GV_WATER_PYRAMID) && this->yaw == 1.0f){ + this->unk38_31 = TRUE; + } + } + + if(this->unkF4_8 == 6 + && func_8024DB50(this->position, 50.0f) + && !this->unk38_31 + && randf() < 0.2 + ){ + func_80389FA0(this->position); + } +} diff --git a/src/GV/code_3D90.c b/src/GV/code_3D90.c new file mode 100644 index 00000000..52c42b36 --- /dev/null +++ b/src/GV/code_3D90.c @@ -0,0 +1,158 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_80309724(f32[3]); +void func_80329904(ActorMarker *, s32, void *); + +void func_8038A314(Actor *this); +void func_8038A31C(Actor *this); +Actor *func_8038A180(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorAnimationInfo D_80390FA0[] = { + {0, 0.0f}, + {0xC9, 2.0f}, + {0xC9, 2.0f}, + {0xC9, 2.0f}, + {0xC9, 2.0f}, + {0xC9, 2.0f}, +}; +ActorInfo D_80390FD0 = { MARKER_B0_MAGIC_CARPET_2, ACTOR_123_MAGIC_CARPET_2, ASSET_3DC_MODEL_MAGIC_CARPET, + 0x1, D_80390FA0, + func_8038A314, func_8038A31C, func_8038A180, + 0, 0, 0.0f, 0 +}; +u8 D_80390FF4[6] = {0,0,0,1,1,1}; + +/* .code */ +Actor *func_8038A180(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor * this = marker_getActor(this_marker); + + if(this->unk1C[0] != 0.0f){ + this = func_80325888(this_marker, gfx, mtx, vtx); + + if( this->unk54 == 0.0f + && this->unk48 != this->unk1C[1] + && this_marker->unk14_21 + && func_80329530(this, 0xbb8) + ){ + func_8033E73C(this->marker, 6, func_80329904); + func_8033E3F0(0xc, this->marker->unk14_21); + } + } + return this; +} + + +f32 func_8038A264(Actor *shadow, Actor* this){ + if(this && shadow){ + return ml_map_f(this->position_y - shadow->position_y, 0.0f, 2200.0f, 1.0f, 0.35f); + } + else{ + return 0.0; + } +} + +void func_8038A2C0(void *this_marker){ + Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, this_marker)); + Actor *shadow = spawn_child_actor(ACTOR_122_MAGIC_CARPET_SHADOW, &this); + s32 pad; + + func_8032AA58(shadow, this->scale); + this->unk100 = shadow->marker; +} + +void func_8038A314(Actor *this){} + +void func_8038A31C(Actor *this){ + Actor *sp24; + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + actor_collisionOff(this); + func_802C3C88((GenMethod_1)func_8038A2C0, reinterpret_cast(s32, this->marker)); + this->velocity[0] = 0.0f; + } + + if(this->unk100) + sp24 = func_80329980(this); + + this->unk1C[1] = this->unk48; + ; + + switch(func_8038F4C0(this, 3)) + { + case 1: //L8038A3C0 + func_80343DEC(this); + this->marker->propPtr->unk8_3 = TRUE; + this->unk1C[0] = 1.0; + this->alpha_124_19 = 0xff; + if(this->unk54 != 0.0f){ + func_80328B8C(this, 2, 0.02f, 1); + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_STOPPED); + } + break; + case 2: //L8038A440 + this->marker->propPtr->unk8_3 = TRUE; + this->unk1C[0] = 1.0; + if(45.0f <= this->velocity[0]){ + func_80328B8C(this, 3, 0.02f, 1); + this->velocity[0] = 0.0f; + } + else{ + if(D_80390FF4[((s32)this->velocity[0])%6] == 0){ + this->alpha_124_19 -= 0x55; + } + else{ + this->alpha_124_19 += 0x55; + } + this->velocity[0] += 1.0f; + } + break; + case 3: //L8038A534 + func_80343DEC(this); + this->marker->propPtr->unk8_3 = FALSE; + this->unk1C[0] = 0.0; + this->alpha_124_19 = 0; + if(this->unk54 == 0.0f){ + func_80328B8C(this, 4, 0.02f, 1); + } + break; + + case 4: //L8038A5A4 + this->marker->propPtr->unk8_3 = TRUE; + this->unk1C[0] = 1.0; + if(45.0f <= this->velocity[0]){ + func_80328B8C(this, 1, 0.02f, 1); + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_LOOP); + this->velocity[0] = 0.0f; + } + else{ + if(D_80390FF4[5 - ((s32)this->velocity[0])%6 ] != 0){ + this->alpha_124_19 += 0x55; + } + else{ + this->alpha_124_19 -= 0x55; + } + this->velocity[0] += 1.0f; + } + + break; + }//L8038A6A4 + this->unk124_11 = 0x3; + this->pitch = 0.0f; + if(this->unk100 && sp24 && this->unk100->unk14_20 == MARKER_AF_MAGIC_CARPET_SHADOW){ + sp24->position_x = this->position_x; + sp24->position_y = func_80309724(this->position) + 60.0f; + sp24->position_z = this->position_z; + sp24->unk1C[0] = func_8038A264(sp24, this); + sp24->yaw = this->yaw; + sp24->velocity[0] = 1.0; + sp24->velocity[1] = this->alpha_124_19; + if (0.0f != this->unk1C[0]) + sp24->unk1C[2] = 1.0; + else + sp24->unk1C[2] = 0.0f; + + }//L8038A780 +} diff --git a/src/GV/code_43B0.c b/src/GV/code_43B0.c new file mode 100644 index 00000000..c5fd3d01 --- /dev/null +++ b/src/GV/code_43B0.c @@ -0,0 +1,110 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_80309724(f32[3]); +void func_80329904(ActorMarker *, s32, void *); + + +void func_8038A948(Actor *this); +void func_8038A9C0(Actor *this); +Actor *func_8038A7A0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorAnimationInfo D_80391000[] = { + {0, 0.0f}, + {0xC9, 2.0f} +}; + +ActorInfo D_80391010 = { MARKER_A7_MAGIC_CARPET_1, ACTOR_119_MAGIC_CARPET_1, ASSET_3DC_MODEL_MAGIC_CARPET, + 0x1, D_80391000, + func_8038A948, func_8038A9C0, func_8038A7A0, + 2500, 0, 0.0f, 0 +}; + + +/* .code */ +Actor *func_8038A7A0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor * this; + + this = func_80325888(this_marker, gfx, mtx, vtx); + + if( this->velocity_y != 0.0f + && this_marker->unk14_21 + && this->unk48 != this->unk1C[2] + ){ + func_8033E73C(this->marker, 5, func_80329904); + func_8033E3F0(0xa, this->marker->unk14_21); + this->unk38_31++; + } + + return this; +} + +f32 func_8038A860(Actor *shadow, Actor* this){ + f32 out = 0.0f; + + if(this && shadow){ + out = this->scale * ml_map_f(this->position_y - shadow->position_y, 0.0f, 2200.0f, 1.2f, 0.35f); + } + + return out; +} + +void func_8038A8CC(ActorMarker *this_marker){ + Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, this_marker)); + Actor *shadow = spawn_child_actor(ACTOR_122_MAGIC_CARPET_SHADOW, &this); + s32 pad; + + this->unk100 = shadow->marker; + shadow->position_y = func_80309724(this->position); + shadow->unk1C[0] = func_8038A860(shadow, this); + shadow->yaw = this->yaw; + func_8032AA58(shadow, this->scale); +} + +void func_8038A948(Actor *this){ + if(!this->initialized){ + this->initialized = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + func_802C3C88((GenMethod_1)func_8038A8CC, (s32)this->marker); + this->velocity_y = 0.0f; + } +} + +void func_8038A9C0(Actor *this){ + Actor * sp24; + if(!this->initialized){ + this->initialized = TRUE; + this->velocity_y = 0.0f; + } + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + func_802C3C88((GenMethod_1)func_8038A8CC, (s32)this->marker); + sp24 = func_80329980(this); + this->unk1C[1] = this->unk48; + this->pitch = 0.0f; + this->yaw = 90.0f; + } + + if(this->unk100) + sp24 = func_80329980(this); + + if(this->velocity_y != 0.0f){ + func_80343DEC(this); + if(this->unk48 < this->unk1C[1]){ + this->velocity_y = 0.0f; + } + this->unk1C[2] = this->unk1C[1]; + this->unk1C[1] = this->unk48; + if(this->unk100 && sp24 && this->unk100->unk14_20 == MARKER_AF_MAGIC_CARPET_SHADOW){ + sp24->unk1C[0] = func_8038A860(sp24, this); + } + } + this->pitch = 0.0f; + this->yaw = 90.0f; +} diff --git a/src/GV/code_4740.c b/src/GV/code_4740.c new file mode 100644 index 00000000..7ec147f5 --- /dev/null +++ b/src/GV/code_4740.c @@ -0,0 +1,325 @@ +#include +#include "functions.h" +#include "variables.h" + +f32 func_80257204(f32, f32, f32, f32); +void func_8038B124(Actor *this); + +/* .data */ +ActorAnimationInfo D_80391040[] ={ + {0x00, 0.0f}, + {0xE9, 800000.0f}, + {0xE9, 0.8f}, + {0xEA, 1.0f}, + {0xEA, 2.0f}, + {0xEB, 0.8f}, + {0xEB, 800000.0f}, + {0xEC, 1.2f}, + {0xEF, 1.4f}, + {0xEE, 1.4f}, + {0xEE, 1.4f} +}; + +ActorInfo D_80391098 = { MARKER_AD_SLAPPA, ACTOR_120_SLAPPA, ASSET_376_MODEL_SLAPPA, + 0x1, D_80391040, + func_8038B124, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; +s32 D_803910BC[3] = {175, 100, 0}; +s32 D_803910C8[3] = {175, 140, 0}; +struct43s D_803910D4 = { + {{-120.0f, 550.0f, -120.0f}, {120.0f, 950.0f, 120.0f}}, + {{0.0f, -1400.0f, 0.0f}, {0.0f, -1400.0f, 0.0f}}, + {{-100.0f, 0.0f, -100.0f}, {100.0f, 30.0f, 100.0f}} +}; + +/* .bss */ +f32 D_80391A70[3]; + +/* .code */ +void func_8038AB30(ParticleEmitter *pCtrl, f32 position[3], s32 cnt){ + if(map_get() != MAP_1A_GV_INSIDE_JINXY) + func_802EFFA8(pCtrl, D_803910BC); + else + func_802EFFA8(pCtrl, D_803910C8); + + func_802EF9E4(pCtrl, 0xBE); + particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST); + func_802EFA5C(pCtrl, 0.0f, 0.01f); + particleEmitter_setStartingFrameRange(pCtrl, 0, 7); + particleEmitter_setPosition(pCtrl, position); +} + +void func_8038ABD8(f32 position[3], s32 cnt){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + func_8038AB30(pCtrl, position, cnt); + particleEmitter_setParticleSpawnPositionRange(pCtrl, + -40.0f, -5.0f, -40.0f, + 60.0f, 20.0f, 60.0f + ); + particleEmitter_setParticleVelocityRange(pCtrl, + -100.0f, 10.0f, -100.0f, + 100.0f, 60.0f, 100.0f + ); + func_802EFB70(pCtrl, 0.1f, 0.5f); + func_802EFB84(pCtrl, 1.2f, 2.6f); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 0.5f, 1.4f); + particleEmitter_emitN(pCtrl, cnt); +} + +void func_8038ACEC(f32 pos[3], s32 cnt){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + func_8038AB30(pCtrl, pos, cnt); + particleEmitter_setParticleSpawnPositionRange(pCtrl, + -80.0f, 20.0f, -80.0f, + 120.0f, 120.0f, 120.0f + ); + particleEmitter_setParticleVelocityRange(pCtrl, + -200.0f, 20.0f, -200.0f, + 300.0f, 120.0f, 200.0f + ); + func_802EFB70(pCtrl, 1.0f, 2.6f); + func_802EFB84(pCtrl, 3.0f, 5.5f); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 1.2f, 3.2f); + particleEmitter_emitN(pCtrl, cnt); +} + +void func_8038ADFC(f32 pos[3], s32 cnt){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + particleEmitter_setModel(pCtrl, 0x389); + particleEmitter_setPosition(pCtrl, pos); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_803910D4); + func_802EFE24(pCtrl, -500.0f, -500.0f, -500.0f, 500.0f, 500.0f, 500.0f); + func_802EF9F8(pCtrl, 0.6f); + func_802EFA18(pCtrl, 2); + func_802EFB70(pCtrl, 1.0f, 1.0f); + func_802EFA70(pCtrl, 2); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 4.0f, 6.0f); + func_802EFA5C(pCtrl, 0.0f, 0.05f); + particleEmitter_emitN(pCtrl, cnt); +} + +void func_8038AF10(Actor *this){ + animctrl_setSmoothTransition(this->animctrl, TRUE); + func_80328B8C(this, 3, 0.00001f, 1); + actor_loopAnimation(this); + this->unk28 = 16.0f; + this->unk1C[0] = 1.0f; +} + +int func_8038AF78(Actor *this, f32 arg1, f32 arg2){ + this->unk28 = arg2; + this->yaw_moving = (f32)func_80329784(this); + func_80328FB0(this, arg1); + if(!func_80329030(this, 0) && func_80329480(this)) + return 0; + return 1; + +} + +void func_8038AFF4(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + func_8032B4DC(this, other_marker, 0xC); + actor_collisionOff(this); + func_80328B8C(this, ASSET_9_ANIM_BANJO_DIE, 0.00001f, 1); + actor_playAnimationOnce(this); + this->unk1C[0] = 0.0f; + func_8030E878(SFX_D7_GRABBA_DEATH, 1.0f, 32000, this->position, 2250.0f, 4500.0f); + + +} + +void func_8038B08C(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + func_8032B4DC(this, other_marker, 0xC); +} + + +void func_8038B0BC(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + func_8030E878(SFX_3F5_UNKNOWN, randf2(0.95f, 1.05f), 32000, this->position, 2250.0f, 4500.0f); +} + + +void func_8038B124(Actor *this){ + if(!this->initialized){ + this->initialized = TRUE; + this->unk38_31 = 0; + this->unk1C[0] = 0.0f; + this->unk1C[2] = 240.0f; + this->velocity_x = this->position_x; + this->velocity_y = this->position_y; + this->velocity_z = this->position_z; + } + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(this->state == 0xa) + marker_despawn(this->marker); + + marker_setCollisionScripts(this->marker, func_8038B0BC, func_8038B08C, func_8038AFF4); + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOn(this); + this->unk138_27 = 1; + this->unk1C[1] = 0.0f; + if(this->unk44_31 == 0){ + this->unk44_31 = func_8030D90C(); + sfxsource_setSfxId(this->unk44_31, SFX_3EC_CCW_DOOR_OPENING); + func_8030DD14(this->unk44_31, 2); + func_8030DBB4(this->unk44_31, 0.1f); + sfxsource_setSampleRate(this->unk44_31, 32000); + } + }//L8038B25C + + if(!actor_playerIsWithinDist(this, 4500)) return; + + this->unk58_0 = TRUE; + switch(this->state){ + case 1: //L8038B2A4 + this->unk58_0 = FALSE; + if(0.0 < this->unk1C[1]){ + this->unk1C[1] = MAX((f64)(this->unk1C[1] - time_getDelta()), 0.0); + }//L8038B33C + + if( this->unk1C[1] == 0.0 + && func_80329530(this, 0x320) + && func_803292E0(this) + ){ + animctrl_setSmoothTransition(this->animctrl, 0); + func_80328B8C(this, 2, 0.00001f, 1); + actor_playAnimationOnce(this); + this->yaw = (f32)func_80329784(this); + this->unk28 = 0.0f; + this->unk1C[0] = 1.0f; + func_802BB3DC(0, 14.0f, 0.92f); + func_8038ABD8(this->position, 8); + } + else{//L8038B3E0 + this->yaw_moving = func_80257204(this->position_x, this->position_z, this->velocity_x, this->velocity_z); + func_80328FB0(this, 18.0f); + this->unk28 = 18.0f; + func_80329030(this, 0); + animctrl_setAnimTimer(this->animctrl, 0.0f); + + } + break; + + case 2: //L8038B430 + func_8030E2C4(this->unk44_31); + if(0.98 < animctrl_getAnimTimer(this->animctrl)){ + func_8038AF10(this); + } + else{ + this->yaw_moving = func_80329784(this); + func_80328FB0(this, 8.0f); + } + break; + + case 3: //L8038B494 + func_8030E2C4(this->unk44_31); + if(func_80329530(this, 175)){ + func_80328B8C(this, 4, 0.00001f, 1); + actor_loopAnimation(this); + this->unk1C[0] = 1.0f; + } + else if(!func_80329530(this, 1100) || !func_8038AF78(this, 8.0f, 16.0f)){ + func_80328B8C(this, 8, 0.00001f, 1); + actor_playAnimationOnce(this); + this->unk1C[0] = 1.0f; + func_802BB3DC(0, 6.0f, 0.92f); + func_8038ABD8(this->position, 8); + } + else{ + D_80391A70[0] = 2*this->unk28; + D_80391A70[1] = 0.0f; + D_80391A70[2] = 0.0f; + ml_vec3f_yaw_rotate_copy(D_80391A70, D_80391A70, this->yaw - 90.0); + + D_80391A70[0] = D_80391A70[0] + this->position[0]; + D_80391A70[1] = D_80391A70[1] + this->position[1]; + D_80391A70[2] = D_80391A70[2] + this->position[2]; + func_8038ABD8(D_80391A70, 1); + } + break; + + case 4: //L8038B5F0 + this->yaw_moving = func_80329784(this); + func_80328FB0(this, 8.0f); + if(this->unk38_31 >= 20){ + func_80328B8C(this, 5, 0.00001f, 1); + actor_playAnimationOnce(this); + this->unk38_31 = 0; + this->unk1C[0] = 1.0f; + } + else{//L8038B660 + this->unk38_31++; + } + break; + + case 5: //L8038B67C + if(this->marker->unk14_21 && actor_animationIsAt(this, 0.79f)){ + func_8034A174(this->marker->unk44, 5, D_80391A70); + func_8038ACEC(D_80391A70, 2); + func_8034A174(this->marker->unk44, 6, D_80391A70); + func_8038ACEC(D_80391A70, 3); + func_802BB3DC(0, 18.0f, 0.92f); + func_8030E878(SFX_3_DULL_CANNON_SHOT, 1.0f, 32000, this->position, 2250.0f, 4500.0f); + }//L8038B734 + if(0.98 < animctrl_getAnimTimer(this->animctrl)){ + func_80328B8C(this, 6, 0.99f, 0); + actor_playAnimationOnce(this); + this->unk60 = 0.0f; + this->unk1C[0] = 1.0f; + } + break; + + case 6: //L8038B78C + if(75.0f <= this->unk60){ + func_80328B8C(this, 7, 0.00001f, 1); + actor_playAnimationOnce(this); + this->unk1C[0] = 1.0f; + } + else{ + this->unk60 += 1.0f; + } + break; + + case 7: //L8038B7EC + if(0.98 < animctrl_getAnimTimer(this->animctrl)){ + func_8038AF10(this); + } + break; + + case 8: //L8038B820 + if(0.98 < animctrl_getAnimTimer(this->animctrl)){ + func_80328B8C(this, 1, 0.00001f, 1); + this->unk1C[0] = 0.0f; + this->unk1C[1] = 2.0f; + } + break; + + case 9: //L8038B870 + func_80328A84(this, 0xA); + func_8038ACEC(this->position, 2); + func_8034A174(this->marker->unk44, 5, D_80391A70); + func_8038ACEC(D_80391A70, 2); + func_8038ADFC(D_80391A70, 3); + func_8034A174(this->marker->unk44, 6, D_80391A70); + func_8038ACEC(D_80391A70, 3); + func_8038ADFC(D_80391A70, 2); + break; + + case 10: //L8038B900 + this->unk58_0 = FALSE; + if(0.0f != this->unk1C[2]){ + this->unk1C[2] -= 1.0f; + } + else{ + marker_despawn(this->marker); + } + break; + } +} diff --git a/src/GV/code_5570.c b/src/GV/code_5570.c new file mode 100644 index 00000000..5b234675 --- /dev/null +++ b/src/GV/code_5570.c @@ -0,0 +1,323 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8025AE50(s32, f32); +extern void func_8028F710(s32, f32); + +typedef struct { + s32 unk0; +}ActorLocal_Grabba; + +void func_8038BEA0(Actor *this); + +/* .data */ +ActorAnimationInfo D_80391120[] ={ + {0x00, 0.0f}, + {ASSET_C5_ANIM_GRABBA_APPEAR, 8000000.0f}, + {ASSET_C5_ANIM_GRABBA_APPEAR, 1.6f}, + {ASSET_C7_ANIM_GRABBA_IDLE, 1.8f}, + {ASSET_C6_ANIM_GRABBA_HIDE, 0.55f}, + {ASSET_C8_ANIM_GRABBA_DEFEATED, 0.8f}, + {ASSET_C7_ANIM_GRABBA_IDLE, 1.8f} +}; + +ActorInfo D_80391158 = { MARKER_A6_GRABBA, ACTOR_118_GRABBA, ASSET_371_MODEL_GRABBA, + 0x1, D_80391120, + func_8038BEA0, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +s32 D_8039117C[3] = {160, 100, 0}; + + +/* .bss */ +extern s32 D_80391A80; + +/* .code */ +void func_8038B960(void){ + func_8025AE50(5000, 3.19f); +} + +/* .bss */ +extern s32 D_80391A80; + +/* .code */ +void func_8038B988(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *this = marker_getActor(caller); + func_80328B8C(this, 5, 0.01f, 1); + actor_loopAnimation(this); + func_802BAFE4(0x13); + FUNC_8030E624(SFX_8D_BOGGY_OHWW, 0.9f, 32000); + timedFunc_set_0(2.5f, func_8038B960); + D_80391A80 = this->state; +} + +void func_8038BA08(Actor *this){ + func_80328B8C(this, 6, 0.01f, 1); + actor_loopAnimation(this); + this->unk100 = NULL; + D_80391A80 = 3; + if(func_8028ECAC() == BSGROUP_6_TURBO_TALON_TRAINERS) + func_8028F710(3, 0.0f); + + func_80311480(ASSET_A79_TEXT_GRABBA_DEFEAT, 0xf, this->position, this->marker, func_8038B988, NULL); + comusic_8025AB44(COMUSIC_57_TURBO_TRAINERS, 7000, 700); +} + +s32 func_8038BAA4(Actor *jiggy){ + s32 tmp_v0; + s32 sp18[3]; + + map_get(); + sp18[0] = (s32)jiggy->position_x; + sp18[1] = (s32)jiggy->position_y; + sp18[2] = (s32)jiggy->position_z; + tmp_v0 = func_80307164(sp18, jiggy); + if( tmp_v0 < 0) + return 0; + else + return func_80306DBC(tmp_v0) + 1; + +} + +int func_8038BB24(Actor *this){ + if(func_80329530(this, 1560) && !func_80329530(this, 1380)){ + return TRUE; + } + else{ + return FALSE; + } +} + +void func_8038BB6C(Actor *jiggy, ActorMarker * grabba_marker) +{ + Actor *grabba; + ActorLocal_Grabba *grabba_local; + ActorMarker *tmp = reinterpret_cast(ActorMarker *, grabba_marker); + grabba = marker_getActor(tmp); + grabba_local = (ActorLocal_Grabba *)&grabba->local; + + grabba->unk100 = jiggy->marker; + grabba_local->unk0 = grabba->unk100->unk5C; + jiggy->unk10_1 = TRUE; + grabba->unk1C[2] = (f32)func_8038BAA4(jiggy); + if(jiggyscore_isCollected((s32)grabba->unk1C[2])){ + func_8038C748(); + marker_despawn(grabba->marker); + } +} + +void func_8038BBFC(ParticleEmitter *pCtrl, f32 position[3], s32 cnt){ + func_802EFFA8(pCtrl, D_8039117C); + func_802EF9E4(pCtrl, 0x96); + particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST); + func_802EFA5C(pCtrl, 0.0f, 0.01f); + particleEmitter_setStartingFrameRange(pCtrl, 0, 7); + particleEmitter_setPosition(pCtrl, position); +} + +void func_8038BC7C(f32 position[3], s32 cnt){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + func_8038BBFC(pCtrl, position, cnt); + particleEmitter_setParticleSpawnPositionRange(pCtrl, + -60.0f, 0.0f, -60.0f, + 60.0f, 30.0f, 60.0f + ); + particleEmitter_setParticleVelocityRange(pCtrl, + -250.0f, 10.0f, -250.0f, + 250.0f, 110.0f, 250.0f + ); + func_802EFB70(pCtrl, 0.1f, 0.5f); + func_802EFB84(pCtrl, 2.0f, 2.6f); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 0.5f, 1.4f); + particleEmitter_emitN(pCtrl, cnt); +} + +void func_8038BD8C(f32 position[3], s32 cnt){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + func_8038BBFC(pCtrl, position, cnt); + particleEmitter_setParticleSpawnPositionRange(pCtrl, + -40.0f, 0.0f, -40.0f, + 40.0f, 30.0f, 40.0f + ); + particleEmitter_setParticleVelocityRange(pCtrl, + -100.0f, 20.0f, -100.0f, + 100.0f, 60.0f, 100.0f + ); + func_802EFB70(pCtrl, 0.1f, 0.5f); + func_802EFB84(pCtrl, 1.2, 1.6f); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 0.5f, 1.4f); + particleEmitter_emitN(pCtrl, cnt); +} + +void func_8038BEA0(Actor *this){ + ActorLocal_Grabba *local = (ActorLocal_Grabba *)&this->local; + f32 sp38[3]; + + if(!this->initialized){ + this->initialized = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + this->unk38_31 = 0; + this->unk1C[1] = this->position_y; + D_80391A80 = this->state; + func_80333270(JIGGY_3E_GV_GRABBA, this->position, func_8038BB6C, this->marker); + }//L8038BF24 + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(this->unk44_31 == 0){ + this->unk44_31 = func_8030D90C(); + sfxsource_setSfxId(this->unk44_31, SFX_3EC_CCW_DOOR_OPENING); + func_8030DD14(this->unk44_31, 2); + func_8030DBB4(this->unk44_31, 0.1f); + sfxsource_setSampleRate(this->unk44_31, 32000); + } + if(this->unk100 == NULL){ + this->unk100 = func_8032B16C(JIGGY_3E_GV_GRABBA); + local->unk0 = this->unk100 != NULL ? this->unk100->unk5C : NULL; + } + func_80328B8C(this, this->state, 0.01f, 1); + this->unk58_0 = FALSE; + this->marker->propPtr->unk8_3 = FALSE; + }//L8038BFF4 + + if(actor_playerIsWithinDist(this, 4000) || this->state == 5){ + this->unk58_0 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + switch(this->state){ + case 1: //L8038C064 + this->unk58_0 = FALSE; + this->marker->propPtr->unk8_3 = FALSE; + if(func_8038BB24(this)){ + func_80328B8C(this, 2, 0.01f, 1); + actor_playAnimationOnce(this); + this->unk38_31 = 0; + D_80391A80 = this->state; + func_802BB3DC(0, 14.0f, 0.92f); + func_802C3F04((GenMethod_4)func_802C4140, 0x11f, + reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, this->position_y), reinterpret_cast(s32, this->position_z) + ); + } + break; + + case 2: //L8038C108 + if(actor_animationIsAt(this, 0.69f)){ + func_80328B8C(this, 3, 0.01f, 1); + actor_loopAnimation(this); + D_80391A80 = this->state; + if(this->unk100){ + this->unk100->collidable = TRUE; + } + } + else{ + if(animctrl_getAnimTimer(this->animctrl) < 0.55){ + func_8030E2C4(this->unk44_31); + if(randf() < 0.6){ + func_8038BC7C(this->position, 0xA); + } + } + } + break; + + case 3: //L8038C1CC + if(this->unk100 && this->unk100->unk5C != local->unk0){ + func_8038BA08(this); + } + else if(this->unk38_31 >= 0xC){ + func_80328B8C(this, 4, 0.01f, 1); + actor_playAnimationOnce(this); + D_80391A80 = this->state; + func_802BB3DC(0, 12.0f, 0.92f); + } + else if(func_80329530(this, 600)){ + if(func_8028ECAC() == BSGROUP_6_TURBO_TALON_TRAINERS){ + this->unk38_31++; + } + else{ + this->unk38_31 += 4; + } + } + else{ + if(!this->unk138_24){ + if(func_80311480(ASSET_A78_TEXT_GRABBA_MEET, 0, NULL, NULL, NULL, NULL)){ + this->unk138_24 = TRUE; + } + } + } + break; + + case 4: //L8038C304 + if(this->unk100 && this->unk100->unk5C != local->unk0){ + func_8038BA08(this); + } + else if(actor_animationIsAt(this, 0.89f)){ + func_80328B8C(this, 1, 0.01f, 1); + actor_loopAnimation(this); + D_80391A80 = this->state; + } + else{ + if(0.35 < animctrl_getAnimTimer(this->animctrl)){ + func_8030E2C4(this->unk44_31); + if(randf() < 0.6){ + func_8038BC7C(this->position, 5); + } + } + + if(actor_animationIsAt(this, 0.4f)){ + if(this->unk100){ + this->unk100->collidable = FALSE; + func_8030E878(SFX_3F5_UNKNOWN, randf2(0.95f, 1.05f), 32000, this->position, 1250.0f, 2500.0f); + } + + if(!this->unk138_23){ + if(func_80311480(ASSET_A7A_TEXT_GRABBA_TOO_FAST, 0, NULL, NULL, NULL, NULL)){ + this->unk138_23 = TRUE; + } + } + } + + } + break; + + case 5: //L8038C488 + if(this->position_y <= this->unk1C[1] - 330.0f){ + marker_despawn(this->marker); + func_8038C748(); + } + else{ + func_8030E2C4(this->unk44_31); + this->position_y -= 7.0; + if(func_8023DB5C() & 1){ + sp38[0] = this->position_x; + sp38[1] = this->position_y; + sp38[2] = this->position_z; + sp38[1] = this->unk1C[1]; + func_8038BD8C(sp38, 1); + } + } + break; + + }//L8038C528 + if(this->unk100 && this->unk100->unk5C == local->unk0){ + Actor *tmp_v0; + tmp_v0 = func_80329980(this); + if(this->marker->unk14_21){ + func_8034A174(this->marker->unk44, 5, tmp_v0->position); + } + else{ + tmp_v0->position_x = this->position_x; + tmp_v0->position_y = this->position_y; + tmp_v0->position_z = this->position_z; + tmp_v0->position_y -= 200.0f; + } + } + }//L8038C5AC +} + +s32 func_8038C5BC(void){ + return D_80391A80; +} diff --git a/src/GV/code_61E0.c b/src/GV/code_61E0.c new file mode 100644 index 00000000..147a65a5 --- /dev/null +++ b/src/GV/code_61E0.c @@ -0,0 +1,63 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8038C658(Actor *this); +Actor *func_8038C5D0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorAnimationInfo D_80391190[] = { + {0x00, 0.0f}, + {0xE5, 80000000.0f}, + {0xE6, 1.6f}, + {0xE5, 1.8f}, + {0xE7, 0.55f}, + {0xE8, 0.8f} +}; + +ActorInfo D_803911C0 = { 0xAC, 0x11E, 0x3E5, + 0, D_80391190, + func_8038C658, func_80326224, func_8038C5D0, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +s32 D_80391A90; + +/* .code */ +Actor *func_8038C5D0(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(this_marker); + if( this->state == 2 + || this->state == 3 + || this->state == 4 + || this->state == 5 + ){ + if(!D_80391A90) + return func_80325888(this_marker, gfx, mtx, vtx); + } + return this; +} + +void func_8038C658(Actor *this){ + s32 sp24; + if(!this->initialized){ + actor_collisionOff(this); + D_80391A90 = FALSE; + this->initialized = TRUE; + this->position_y += 4.0f; + } + + if(!this->unk16C_4 && this->initialized){ + this->unk16C_4 = TRUE; + func_80328B8C(this, this->state, 0.01f, 1); + } + sp24 = func_8038C5BC(); + if(D_80391A90) + marker_despawn(this->marker); + if(this->state != sp24) + func_80328A84(this, sp24); +} + +void func_8038C748(void){ + D_80391A90 = TRUE; +} diff --git a/src/GV/code_6370.c b/src/GV/code_6370.c new file mode 100644 index 00000000..e7a2de6f --- /dev/null +++ b/src/GV/code_6370.c @@ -0,0 +1,295 @@ +#include +#include "functions.h" +#include "variables.h" + + +typedef struct { + s32 unk0; + u8 unk4; + //u8 pad5[3]; + u8 *unk8; + f32 unkC; + u8 unk10; + //u8 pad11[3]; + ActorMarker *unk14; + f32 unk18[3]; + f32 unk24; +}ActorLocal_GV_6370; + +void func_8038C8A0(Actor *this, s32 next_state); +void func_8038CC98(Actor *this); +Actor *func_8038CC40(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +u8 D_803911F0[3] = {0, 1, 2}; +ActorInfo D_803911F4 = { 0xBB, 0x285, 0x3E6, + 0, NULL, + func_8038CC98, func_80326224, func_8038CC40, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80391218 = { 0xBB, 0x286, 0x3E6, + 0, NULL, + func_8038CC98, func_80326224, func_8038CC40, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8039123C = { 0xBB, 0x287, 0x3E6, + 0, NULL, + func_8038CC98, func_80326224, func_8038CC40, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_8038C760(Actor *this, s32 arg1){ + ActorLocal_GV_6370 *local = (ActorLocal_GV_6370 *)&this->local; + func_8038FD50(local->unk14, arg1); + FUNC_8030E624(SFX_3F6_UNKNOWN, 0.7f, 28000); + FUNC_8030E624(SFX_3F6_UNKNOWN, 0.9f, 29000); + FUNC_8030E624(SFX_3F6_UNKNOWN, 1.0f, 30000); + timed_setCameraToNode(0.0f, 8); + if(arg1 < 3){ + timed_setCameraToNode(3.5f, arg1 + 0x15); + timedFunc_set_3(3.5f, (TFQM3)func_80320044, BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, arg1, 2); + func_80324E88(6.5f); + func_80324E38(6.5f, 0); + } + else{ + timedFunc_set_2(3.5f, (TFQM2)func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff); + timedFunc_set_3(3.5f, (TFQM3)func_80320044, BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, arg1, 2); + func_80324E88(6.0f); + func_80324E38(6.0f, 0); + } +} + +void func_8038C880(Actor *this){ + func_8038C8A0(this, 0); +} + +void func_8038C8A0(Actor *this, s32 next_state){ + ActorLocal_GV_6370 *local = (ActorLocal_GV_6370 *)&this->local; + + local->unk0 = 0; + local->unk24 = 0.0f; + this->marker->propPtr->unk8_3 = (next_state == 1) ? FALSE : TRUE; + this->marker->collidable = (next_state == 1) ? FALSE : TRUE; + if(this->state == 4 || this->state == 5) + func_8030DA44(local->unk4); + + if(next_state == 4 || next_state == 5){ + local->unk4 = func_8030D90C(); + sfxsource_setSfxId(local->unk4, SFX_3EC_CCW_DOOR_OPENING); + func_8030DD14(local->unk4, 3); + func_8030DBB4(local->unk4, 0.8f); + sfxsource_setSampleRate(local->unk4, 0); + func_8030E2C4(local->unk4); + }//L8038C9B8 + + if(next_state == 2){ + func_80335924(this->unk148, ASSET_F0_ANIM_MINI_SHPYNX_EATING, 1.0f, 3.0f); + func_80335A74(this->unk148, 0.27f); + func_80335A8C(this->unk148, 4); + local->unkC = 0.0f; + local->unk18[0] = this->position_x; + local->unk18[1] = this->position_y; + local->unk18[2] = this->position_z; + if(this->state == 1){ + func_80250E94(0.0f, 0.6f, 1.0f, 0, 1.3f, 0.0f); + timed_playSfx(1.0f, SFX_3F6_UNKNOWN, 0.8f, 30000); + } + }//L8038CA6C + + if(next_state == 3){ + local->unk24 = 3.0f; + func_80335924(this->unk148, ASSET_F0_ANIM_MINI_SHPYNX_EATING, 1.0f, 3.0f); + func_80335A74(this->unk148, 0.27f); + func_80335A8C(this->unk148, 4); + }//L8038CAB4 + + if(this->state == 3){ + func_80335924(this->unk148, ASSET_F0_ANIM_MINI_SHPYNX_EATING, 0.5f, 3.0f); + func_80335A74(this->unk148, 0.99f); + func_80335A8C(this->unk148, 2); + if(next_state == 4 || next_state == 5) + FUNC_8030E8B4(SFX_DE_WOOD_SQUEAK, 1.0f, 32675, this->position, 500, 1500); + }//L8038CB20 + + if(next_state == 6){ + func_80324E38(0.0f, 3); + func_80335924(this->unk148, ASSET_F0_ANIM_MINI_SHPYNX_EATING, 0.0f, 3.0f); + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + } + + if(next_state == 7){ + local->unkC = 0.0f; + local->unk18[0] = this->position_x; + local->unk18[1] = this->position_y; + local->unk18[2] = this->position_z; + func_80250D94(0.7f, 0.5f, 1.3f); + FUNC_8030E624(SFX_3F6_UNKNOWN, 0.8f, 30000); + } + + if(next_state == 8){ + if(this->state == 7){ + func_80250D94(0.8f, 0.7f, 3.0f); + func_8038C760(this, *local->unk8 + 1); + } + marker_despawn(this->marker); + } + this->state = next_state; +} + +Actor *func_8038CC40(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(this_marker); + if(this->state == 1) return this; + return func_80325888(this_marker, gfx, mtx, vtx); +} + +void func_8038CC98(Actor *this){ + ActorLocal_GV_6370 *local = (ActorLocal_GV_6370 *)&this->local; + f32 sp80 = time_getDelta(); + s32 sp7C; + f32 pad70; + f32 sp6C[3]; + f32 f12; + f32 sp5C[3]; + f32 sp58; + f32 sp54; + f32 sp48[3]; + + if(!this->unk16C_4){ + sp7C = func_8031FF44(BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, 2); + this->unk16C_4 = TRUE; + this->marker->unk30 = func_8038C880; + local->unk8 = &D_803911F0[this->modelCacheIndex - 0x285]; + local->unk10 = 0; + local->unk14 = 0; + local->unkC = 0.0f; + local->unk18[0] = this->position_x; + local->unk18[1] = this->position_y; + local->unk18[2] = this->position_z; + if(*local->unk8 < sp7C){ + func_8038C8A0(this, 8); + } + else if(sp7C == *local->unk8){ + func_8038C8A0(this, 2); + } + else{ + func_8038C8A0(this, 1); + } + return; + } + + if(!local->unk14){ + local->unk14 = func_80326EEC(ACTOR_31D_SANDYBUTT_PYRAMID)->marker; + } + + if(this->state == 1){ + if(func_8031FF44(BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, 2) == *local->unk8){ + func_8038C8A0(this, 2); + } + } + + if(this->state == 2){ + local->unkC += 0.5*sp80; + if(1.0f <= local->unkC){ + local->unkC = 1.0f; + func_8038C8A0(this, 3); + } + sp6C[0] = 0.0f; + sp6C[1] = 0.0f; + sp6C[2] = (1.0f - local->unkC) * -600.0f; + ml_vec3f_yaw_rotate_copy(sp6C, sp6C, this->yaw); + this->position_x = local->unk18[0] + sp6C[0]; + this->position_y = local->unk18[1] + sp6C[1]; + this->position_z = local->unk18[2] + sp6C[2]; + }//L8038CECC + + if(this->state == 3){ + if(0.0f < local->unk24){ + local->unk24 -= sp80; + } + else{ + if(func_8038D388()) + func_8038C8A0(this, 5); + } + }//L8038CF1C + + if(this->state == 4 || this->state == 5){ + local->unkC += ((this->state == 4)? -1 : 1) * sp80; + if(1.0f < local->unkC){ + local->unkC = 1.0f; + func_8038C8A0(this, 4); + return; + } + else if(local->unkC < -1.0f){ + local->unkC = -1.0f; + func_8038C8A0(this, 5); + return; + } + sp5C[0] = local->unkC*300.0f; + sp5C[1] = 0.0f; + sp5C[2] = 0.0f; + ml_vec3f_yaw_rotate_copy(sp5C, sp5C, this->yaw); + this->position_x = local->unk18[0] + sp5C[0]; + this->position_y = local->unk18[1] + sp5C[1]; + this->position_z = local->unk18[2] + sp5C[2]; + if(0.8 <= local->unkC){ + f12 = 1.0 - (local->unkC - 0.8)/0.2; + } + else if(local->unkC <= -0.8){ + f12 = 1.0 - (-local->unkC - 0.8)/0.2; + } + else{ + f12 = 1.0f; + } + func_8030DB04(local->unk4, f12*24000.0f, this->position, 200.0f, 1500.0f); + if(!func_8038D388()){ + func_8038C8A0(this, 3); + } + }//L8038D110 + + if(this->state == 6){ + func_8033568C(this->unk148, &sp58, &sp54); + if(sp58 < 0.28 && 0.28 <= sp54){ + FUNC_8030E624(SFX_4C_LIP_SMACK, 1.0f, 28000); + } + if(sp58 < 0.52 && 0.52 <= sp54){ + FUNC_8030E624(SFX_4C_LIP_SMACK, 0.9f, 28000); + } + if(sp58 < 0.7 && 0.7 <= sp54){ + FUNC_8030E624(SFX_4C_LIP_SMACK, 1.0f, 28000); + } + if(0.81 <= sp54){ + FUNC_8030E624(SFX_97_BLUBBER_BURPS, 1.0f, 28000); + func_8038C8A0(this, 7); + } + }//L8038D228 + + if(this->state == 7){ + local->unkC += 0.5*sp80; + if(1.0f < local->unkC){ + func_8038C8A0(this, 8); + } + sp48[0] = 0.0f; + sp48[1] = 0.0f; + sp48[2] = local->unkC*-600.0f; + ml_vec3f_yaw_rotate_copy(sp48, sp48, this->yaw); + this->position_x = local->unk18[0] + sp48[0]; + this->position_y = local->unk18[1] + sp48[1]; + this->position_z = local->unk18[2] + sp48[2]; + }//L8038D2F0 + + if(local->unk0){ + if(this->state == 4 || this->state == 5){ + local->unk0 = 0; + local->unk10++; + if(local->unk10 == 3){ + func_8038C8A0(this, 6); + } + else{ + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + } + } + } +} diff --git a/src/GV/code_6F80.c b/src/GV/code_6F80.c new file mode 100644 index 00000000..97fb5399 --- /dev/null +++ b/src/GV/code_6F80.c @@ -0,0 +1,40 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8038D3AC(Actor *this); + +/* .data */ +ActorInfo D_80391260 = { 0x1A5, 0x288, 0x402, + 0, NULL, + func_8038D3AC, NULL, func_80325340, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +u8 D_80391AA0; + +/* .code */ +void func_8038D370(ActorMarker *this_marker, ActorMarker *other_marker){ + D_80391AA0 = 5; +} + +int func_8038D388(void){ + return D_80391AA0 ? 1 : 0; +} + +void func_8038D3AC(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + marker_setCollisionScripts(this->marker, func_8038D370, NULL, NULL); + D_80391AA0 = 0; + if(func_8031FF44(BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, 2) == 3){ + marker_despawn(this->marker); + } + } + else{ + if(D_80391AA0 > 0){ + D_80391AA0--; + } + } +} diff --git a/src/GV/code_7060.c b/src/GV/code_7060.c new file mode 100644 index 00000000..702b9a45 --- /dev/null +++ b/src/GV/code_7060.c @@ -0,0 +1,135 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + +void func_8038D47C(Actor *this); + +/* .data */ +ActorAnimationInfo D_80391290[] = { + {0, 0.0f}, + {0x144, 32000000.0f}, + {0x144, 0.95f}, + {0x145, 1.92f}, + {0x144, 32000000.0f} +}; +ActorInfo D_803912B8 = { MARKER_F9_JINXY, ACTOR_1F7_JINXY, ASSET_422_MODEL_JINXY, + 0x1, D_80391290, + func_8038D47C, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_8038D450(ActorMarker *this_marker){ + Actor *this = marker_getActor(this_marker); + func_80328AC8(this, 3); +} + +void func_8038D47C(Actor *this){ + f32 sp3C[3]; + NodeProp *tmp_v0; + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + func_80287784(this->animctrl, 0); + if(!this->initialized){ + if(!func_80304E24(0x331, this->spawn_position)){ + this->spawn_position_x = -2569.0f; + this->spawn_position_y = 2997.0f; + this->spawn_position_z = 5884.0f; + }//L8038D4FC + tmp_v0 = func_80304CAC(0x32f, this->spawn_position); + if(!tmp_v0){ + this->unk1C_x = -1394.0f; + this->unk1C_y = 2811.0f; + this->unk1C_z = 6277.0f; + } + else{ + nodeprop_getPosition(tmp_v0, this->unk1C); + } + + tmp_v0 = func_80304CAC(0x330, this->spawn_position); + if(!tmp_v0){ + this->velocity_x = -1424.0f; + this->velocity_y = 2811.0f; + this->velocity_z = 5463.0f; + } + else{ + nodeprop_getPosition(tmp_v0, this->velocity); + } + + this->initialized = TRUE; + }//L8038D590 + + if(!this->unk16C_4){ + mapSpecificFlags_set(0x10, 0); + this->unk16C_4 = TRUE; + if(func_803203FC(0xC1) && func_8031B4F4() == -3){ + timedFunc_set_1(1.5f, (TFQM1)func_8038D450, reinterpret_cast(s32, this->marker)); + } + }//L8038D5EC + + if(!mapSpecificFlags_get(0x14)){ + player_getPosition(sp3C); + if(func_8028ECAC() == 0){ + if( ml_vec3f_distance(sp3C, this->unk1C) < 100.0f || ml_vec3f_distance(sp3C, this->velocity) < 100.0f){ + if(func_80311480(ASSET_A7B_TEXT_JINXY_MEET, 0, NULL, NULL, NULL, NULL)){ + mapSpecificFlags_set(0x14, 1); + } + } + } + }//L8038D688 + switch(this->state){ + case 1: //L8038D6C0 + if(!mapSpecificFlags_get(0xE) && mapSpecificFlags_get(0) + mapSpecificFlags_get(1) == 1){ + mapSpecificFlags_set(0xE, TRUE); + func_80328AC8(this, 2); + this->unk38_31 = 1; + } + else if(!mapSpecificFlags_get(0xF) && mapSpecificFlags_get(0) + mapSpecificFlags_get(1) == 2){ + mapSpecificFlags_set(0xF, TRUE); + func_8028F918(2); + func_80328AC8(this, 3); + func_802BAFE4(0); + } + break; + case 2: //L8038D78C + if( actor_animationIsAt(this, 0.2f) + || actor_animationIsAt(this, 0.45f) + || actor_animationIsAt(this, 0.8f) + ){ + FUNC_8030E624(SFX_D4_JINXIE_SNIFFLING_2, 0.8f, 32000); + } + if( actor_animationIsAt(this, 0.99f) ){ + if(--this->unk38_31 == 0){ + func_80311480(ASSET_A7C_TEXT_JINXY_ONE_EGG, 4, NULL, NULL, NULL, NULL); + mapSpecificFlags_set(0x14, TRUE); + func_80328AC8(this, 1); + } + } + break; + case 3: //L8038D84C + if( actor_animationIsAt(this, 0.135f) + || actor_animationIsAt(this, 0.3f) + ){ + FUNC_8030E624(SFX_D4_JINXIE_SNIFFLING_2, 0.8f, 32000); + } + if(actor_animationIsAt(this, 0.63f)){ + FUNC_8030E624(SFX_D5_JINXIE_SNEEZING, 0.8f, 32750); + } + if(actor_animationIsAt(this, 0.83f)){ + FUNC_8030E624(SFX_D6_UGH, 0.8f, 32750); + } + if(actor_animationIsAt(this, 0.94f)){ + if(!func_803203FC(0xC1)){ + mapSpecificFlags_set(0x10, 1); + } + } + if(actor_animationIsAt(this, 0.99f)){ + func_80328AC8(this, 1); + } + break; + case 4: //L8038D910 + break; + }//L8038D910 +} diff --git a/src/GV/code_7530.c b/src/GV/code_7530.c new file mode 100644 index 00000000..7034defc --- /dev/null +++ b/src/GV/code_7530.c @@ -0,0 +1,230 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8028F738(f32[3], f32[3], f32, s32); +extern int func_8030E3FC(u8); + + +void func_8038DBDC(Actor *this); +Actor *func_8038DA18(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorAnimationInfo D_803912E0[] = { + {0x00, 0.0f}, + {0xD1, 800000.0f}, + {0xE2, 2.0f}, + {0xD1, 800000.0f}, + {0xD0, 6.0f}, + {0xCF, 2.0f}, + {0xD1, 1.6f}, +}; +ActorInfo D_80391318 = { 0xAA, 0x11C, 0x3DE, + 0x1, D_803912E0, + func_8038DBDC, func_80326224, func_8038DA18, + 2500, 0, 1.7f, 0 +}; + +/* .bss */ +extern struct { + s32 unk0; + s32 unk4; +}D_80391AB0; +extern s32 D_80391AB8; + +/* .code */ +int func_8038D920(Actor *this, f32 arg1){ + f32 sp2C[3]; + f32 sp20[3]; + f32 sp1C; + + this->unkF4_8 = 20; + sp1C = (f32)(this->unkF4_8 + 25); + player_getPosition(sp20); + ml_vec3f_diff_copy(sp2C, this->position, sp20); + return this->position_y < sp20[1] && sp20[1] <= arg1 && sp2C[0]*sp2C[0] + sp2C[2]*sp2C[2] < sp1C*sp1C; +} + +Actor *func_8038DA18(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this; + f32 sp38[3]; + f32 sp2C[3]; + + this = func_80325888(this_marker, gfx, mtx, vtx); + + if(!this_marker->unk14_21) return this; + + sp2C[0] = this->position_x; + sp2C[1] = this->position_y + 100.0f; + sp2C[2] = this->position_z; + func_8034A174(func_80329934(), 5, sp38); + if(this->state == 1 || this->state == 2){ + sp38[1] = this->position_y; + } + if(func_8038D920(this, sp38[1])){ + func_8028F738(sp2C, sp38, (f32)this->unkF4_8, 2); + } + + return this; +} + + +void func_8038DB0C(Actor *this){ + func_80328B8C(this, 1, 0.99f, 0); + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_STOPPED); +} + +void func_8038DB4C(s32 arg0){ + D_80391AB0.unk0 = arg0; +} + +void func_8038DB58(s32 arg0){ + D_80391AB0.unk4 = arg0; +} + +s32 func_8038DB64(void){ + return D_80391AB0.unk4; +} + +void func_8038DB70(void){ + D_80391AB0.unk4++; +} + + +void func_8038DB88(Actor *this){ + u8 tmp; + tmp = this->unk44_31; + if(tmp){ + if(func_8030E3FC(tmp)){ + func_8030E394(this->unk44_31); + } + func_8030DA44(this->unk44_31); + this->unk44_31 = 0; + } +} + +void func_8038DBDC(Actor *this){ + u8 tmp; + + switch(this->state){ + case 1: //8038DC18 + if(!this->initialized){ + this->initialized = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + func_80328B8C(this, 1, 0.99f, 0); + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_STOPPED); + D_80391AB8 = 0; + func_8038DB4C(0); + this->unk1C[0] = 0.0f; + }//L8038DC90 + if(func_8038E178() != (s32)this->unk1C[0] || func_803203FC(0xC1)){ + if(15.0f <= this->unk60){ + func_80328B8C(this, 2, 0.01f, 1); + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_ONCE); + animctrl_setDuration(this->animctrl, 2.0f); + this->unk1C[0] = (f32)func_8038E178(); + this->unk60 = 0.0f; + } + else{//L8038DD2C + this->unk60 += 1.0f; + } + } + break; + case 2: //8038DD3C + if(!(func_8038E178() < 5)){ + func_8038DB88(this); + if(D_80391AB8){ + func_80328B8C(this, 3, 0.99f, 0); + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_STOPPED); + this->unk1C[0] = 0.0f; + } + } + else if(actor_animationIsAt(this, 0.99f)){//L8038DD94 + func_8038DB0C(this); + func_8038DB88(this); + } + else{ //L8038DDC0 + if(actor_animationIsAt(this, 0.2f) && this->unk44_31 == 0){ + this->unk44_31 = func_8030ED2C(0x3F7, 3); + this->unk1C[1] = 1.0f; + func_8030E2C4(this->unk44_31); + }//L8038DE08 + if(actor_animationIsAt(this, 0.7f)){ + func_8038DB88(this); + FUNC_8030E8B4(SFX_3F8_UNKNOWN, 1.0f, 32000, this->position, 1250, 2500); + } + } + break; + case 3: //8038DE44 + if(!(this->unk38_31 < 0x21)){ + func_80328B8C(this, 4, 0.01f, 1); + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_ONCE); + animctrl_setDuration(this->animctrl, 3.0f); + func_803865F8(); + this->unk38_31 = 0; + } + else{//L8038DEA0 + this->unk38_31++; + } + break; + case 4: //8038DEBC + if(actor_animationIsAt(this, 0.99f)){ + func_80328B8C(this, 5, 0.01f, 1); + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_LOOP); + animctrl_setDuration(this->animctrl, 2.0f); + func_8038DB58(0); + } + else{ + if(actor_animationIsAt(this, 0.04f)) + FUNC_8030E8B4(SFX_7C_CHEBOOF, 1.0f, 32000, this->position, 1250, 2500); + + if(actor_animationIsAt(this, 0.04f)) + FUNC_8030E8B4(SFX_2C_PULLING_NOISE, 1.0f, 32000, this->position, 1250, 2500); + + if(actor_animationIsAt(this, 0.33f)) + FUNC_8030E8B4(SFX_2C_PULLING_NOISE, 1.2f, 32000, this->position, 1250, 2500); + + if(actor_animationIsAt(this, 0.66f)) + FUNC_8030E8B4(SFX_2C_PULLING_NOISE, 1.4f, 32000, this->position, 1250, 2500); + } + break; + case 5: //8038DFC8 + if(func_8038DB64() == 0x127){ + func_80328B8C(this, 6, 0.01f, 1); + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_LOOP); + animctrl_setDuration(this->animctrl, 1.6f); + func_80386608(); + func_8038DB4C(0); + D_80391AB8 = FALSE; + func_8025A58C(-1, 0x190); + func_8025A7DC(COMUSIC_27_GV_RUBEES_SONG); + if(!this->unk44_31){ + this->unk44_31 = func_8030ED2C(SFX_2C_PULLING_NOISE, 3); + this->unk1C[1] = 1.9f; + func_8030E2C4(this->unk44_31); + } + } + else{//L8038E070 + func_8038DB70(); + } + break; + case 6: //8038E080 + if(actor_animationIsAt(this, 0.89f)){ + func_8038DB0C(this); + func_8038DB88(this); + } + else{ + if(actor_animationIsAt(this, 0.42f)) + func_8030E510(SFX_7C_CHEBOOF, 32000); + tmp = this->unk44_31; + if(tmp && func_8030E3FC(tmp)){ + if(1.0 < this->unk1C[1]){ + this->unk1C[1] -= 0.1; + } + func_8030DBB4(this->unk44_31, this->unk1C[1]); + } + } + break; + }//L8038E12C +} diff --git a/src/GV/code_7D50.c b/src/GV/code_7D50.c new file mode 100644 index 00000000..eb901ff9 --- /dev/null +++ b/src/GV/code_7D50.c @@ -0,0 +1,27 @@ +#include +#include "functions.h" +#include "variables.h" + +struct { + s32 unk0; + u8 pad4[4]; + s32 unk8; +}D_80391AB0; + +/* .code */ +void func_8038E140(void){ + D_80391AB0.unk0++; + func_8025A6EC(COMUSIC_2B_DING_B, 26000); +} + +s32 func_8038E178(void){ + return D_80391AB0.unk0; +} + +s32 func_8038E184(void){ + return 5; +} + +void func_8038E18C(void){ + D_80391AB0.unk8 = TRUE; +} diff --git a/src/GV/code_7DB0.c b/src/GV/code_7DB0.c new file mode 100644 index 00000000..510928b6 --- /dev/null +++ b/src/GV/code_7DB0.c @@ -0,0 +1,75 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_8038E1A0(Actor *this); +void func_8038E1A8(Actor *this); + +/* .data */ +ActorAnimationInfo D_80391340[] ={ + {0x00, 0.0f}, + {0xF0, 80000000.0f}, + {0xF0, 1.6f}, +}; + +ActorInfo D_80391358 = { 0xAE, 0x121, 0x3E6, + 0x1, D_80391340, + func_8038E1A0, func_8038E1A8, func_80325888, + 2500, 0, 0.0f, 0 +}; + +/* .code */ +void func_8038E1A0(Actor *this){} + +void func_8038E1A8(Actor *this){ + Actor *sp24 = func_8032A7AC(this); + this->marker->propPtr->unk8_3 = TRUE; + + switch(this->state){ + case 1: + break; + case 2: + if(actor_animationIsAt(this, 0.98f)){ + if(sp24){ + sp24->velocity_y = 1.0f; + } + func_80328B8C(this, 1, 0.02f, 1); + } + else{ + if(actor_animationIsAt(this, 0.2f)) + FUNC_8030E8B4(SFX_4C_LIP_SMACK, 1.0f, 32000, this->position, 1250, 2500); + + if(actor_animationIsAt(this, 0.4f)) + FUNC_8030E8B4(SFX_4C_LIP_SMACK, 1.0f, 26000, this->position, 1250, 2500); + + if(actor_animationIsAt(this, 0.6f)) + FUNC_8030E8B4(SFX_4C_LIP_SMACK, 1.0f, 20000, this->position, 1250, 2500); + + if(actor_animationIsAt(this, 0.8f)) + FUNC_8030E8B4(SFX_97_BLUBBER_BURPS, 1.0f, 32000, this->position, 1250, 2500); + } + break; + }//L8038E2E8 +} + +void func_8038E2FC(ActorMarker *this_marker){ + Actor *this = marker_getActor(this_marker); + Actor *other = func_8032A7AC(this); + if(other){ + func_80328B8C(this, 2, 0.02f, 1); + } +} + +int func_8038E344(ActorMarker *this_marker){ + Actor *this = marker_getActor(this_marker); + Actor *other = func_8032A7AC(this); + + if(other){ + if(0.0f == other->velocity_y){ + if(this->state != 2) + return 1; + } + } + return 0; +} diff --git a/src/GV/code_7FC0.c b/src/GV/code_7FC0.c new file mode 100644 index 00000000..4c3c2294 --- /dev/null +++ b/src/GV/code_7FC0.c @@ -0,0 +1,28 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8038E3B0(Actor *this); + +/* .data */ +ActorAnimationInfo D_80391380[] = { + {0, 0.0f}, + {0, 0.0f} +}; +ActorInfo D_80391390 = { 0xFA, 0x1F8, 0x423, + 0x1, D_80391380, + func_8038E3B0, func_80326224, func_80325888, + 0, 0x100, 0.0f, 0 +}; + +ActorInfo D_803913B4 = { 0xFB, 0x1F9, 0x424, + 0x1, D_80391380, + func_8038E3B0, func_80326224, func_80325888, + 0, 0x100, 0.0f, 0 +}; + +/* .code */ +void func_8038E3B0(Actor *this){ + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); +} diff --git a/src/GV/code_7FF0.c b/src/GV/code_7FF0.c new file mode 100644 index 00000000..ce83fcb1 --- /dev/null +++ b/src/GV/code_7FF0.c @@ -0,0 +1,522 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "SnS.h" + +extern void func_80244BB0(s32, s32, s32, f32); +extern void func_802D3D54(Actor *this); +extern void func_802D3D74(Actor *this); +extern Actor *func_80325F2C(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +extern void func_8032BC3C(Actor *, f32); +extern void func_80343E20(s32, s32, f32, s32); + +extern ActorInfo D_80390BF0; +extern ActorInfo D_80390C5C; +extern ActorInfo D_80390C80; +extern ActorInfo D_80390D30; +extern ActorInfo D_80390D60; +extern ActorInfo D_80390CB0; +extern ActorInfo D_80390D00; +extern ActorInfo D_80390D90; +extern ActorInfo D_80390DD0; +extern ActorInfo D_80390E30; +extern ActorInfo D_80390E54; +extern ActorInfo D_80390ED0; +extern ActorInfo D_80390F00; +extern ActorInfo D_80390FD0; +extern ActorInfo D_80391010; +extern ActorInfo D_80391098; +extern ActorInfo D_80391158; +extern ActorInfo D_803911C0; +extern ActorInfo D_803911F4; +extern ActorInfo D_80391218; +extern ActorInfo D_8039123C; +extern ActorInfo D_80391260; +extern ActorInfo D_80391318; +extern ActorInfo D_80391358; +extern ActorInfo D_803912B8; +extern ActorInfo D_80391390; +extern ActorInfo D_803913B4; +extern ActorInfo D_80390F40; +extern ActorInfo D_80391494; +extern ActorInfo D_803915C0; +extern ActorInfo D_80391620; +extern ActorInfo D_803914B8; +extern ActorInfo D_803914DC; +extern ActorInfo D_80391500; +extern ActorInfo D_80391524; +extern ActorInfo D_8039156C; +extern ActorInfo D_80391428; +extern ActorInfo D_8039144C; +extern ActorInfo D_80391470; +extern ActorInfo D_80391548; +extern ActorInfo D_80391590; + + + +void func_8038E460(Actor *this); +void func_8038E4DC(Actor *this); +void func_8038E648(Actor *this); +void func_8038E914(Actor *this); +void func_8038E97C(Actor *this); +void chKazooieDoor_update(Actor *this); +void chSunSwitch_update(Actor *this); +void chStarSwitch_update(Actor *this); +void chHoneycombSwitch_update(Actor *this); +void func_8038EF14(Actor *this); +void chKazooieTarget_update(Actor *this); + +/* .data */ +ActorAnimationInfo D_803913E0[] = { + {0, 0.0f}, + {0, 0.0f}, + {ASSET_D4_ANIM_SWITCH_DOWN, 0.15f}, + {ASSET_D5_ANIM_SWITCH_UP, 0.5f}, + {0, 0.0f}, + {0, 0.0f}, + {0, 0.0f}, + {0, 0.0f}, + {0, 0.0f} +}; + +ActorInfo D_80391428 = { MARKER_EC_GV_SUN_SWITCH, ACTOR_13F_GV_SUN_SWITCH, ASSET_400_MODEL_SUN_SWITCH, + 0x1, D_803913E0, + chSunSwitch_update, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8039144C = { MARKER_F1_GV_STAR_SWITCH, ACTOR_144_GV_STAR_SWITCH, ASSET_3D7_MODEL_STAR_SWITCH, + 0x1, D_803913E0, + chStarSwitch_update, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80391470 = { MARKER_F2_HONEYCOMB_SWITCH, ACTOR_145_HONEYCOMB_SWITCH, ASSET_438_MODEL_HONEYCOMB_SWITCH, + 0x1, D_803913E0, + chHoneycombSwitch_update, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80391494 = { MARKER_23C_GV_SNS_SWITCH, ACTOR_245_GV_SNS_SWITCH, ASSET_515_MODEL_GV_SNS_SWITCH, + 0x1, D_803913E0, + func_8038EF14, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_803914B8 = { MARKER_EB_GV_BANJO_DOOR, ACTOR_6D_GV_BANJO_DOOR, ASSET_3D8_MODEL_GV_BANJO_DOOR, + 0x1, 0x0, + func_802D3D54, func_8038E460, func_80325F2C, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_803914DC = { MARKER_ED_GV_SUN_DOOR, ACTOR_140_GV_SUN_DOOR, ASSET_3FF_MODEL_GV_SUN_DOOR, + 0x1, 0x0, + func_802D3D54, func_8038E4DC, func_80325F2C, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80391500 = { MARKER_F0_GV_KAZOOIE_DOOR, ACTOR_143_GV_KAZOOIE_DOOR, ASSET_3D9_MODEL_GV_KAZOOIE_DOOR, + 0x1, 0x0, + chKazooieDoor_update, func_80326224, func_80325F2C, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80391524 = { MARKER_EF_GV_STAR_HATCH, ACTOR_142_GV_STAR_HATCH, ASSET_3DB_MODEL_GV_STAR_HATCH, + 0x1, 0x0, + func_8038E648, func_80326224, func_80325F2C, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80391548 = { MARKER_F3_GV_KAZOOIE_TARGET, ACTOR_146_GV_KAZOOIE_TARGET, ASSET_3E2_MODEL_GV_KAZOOIE_TARGET, + 0x1, 0x0, + chKazooieTarget_update, func_80326224, func_80325E78, + 0, 0x400, 0.0f, 0 +}; + +ActorInfo D_8039156C = { MARKER_F8_GV_KAZOOIE_DOOR, ACTOR_1F5_GV_KAZOOIE_DOOR, ASSET_3D9_MODEL_GV_KAZOOIE_DOOR, + 0x1, 0x0, + func_8038E97C, func_80326224, func_80325F2C, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80391590 = { MARKER_23A_GV_SNS_CHAMBER_DOOR, ACTOR_243_GV_SNS_CHAMBER_DOOR, ASSET_514_MODEL_GV_SNS_CHAMBER_DOOR, + 0x1, 0x0, + func_8038E914, func_80326224, func_80325F2C, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +extern f32 D_80391AC0; +extern f32 D_80391AC4; +extern f32 D_80391AC8; + +/* .code */ +void func_8038E3E0(Actor *this){ + D_80391AC0 = this->yaw; + D_80391AC4 = this->pitch; + D_80391AC8 = this->roll; +} + +void func_8038E408(Actor *this){ + this->yaw = D_80391AC0; + this->pitch = D_80391AC4; + this->roll = D_80391AC8; +} + +void func_8038E430(Actor *this){ + func_8038E3E0(this); + func_80343DEC(this); + func_8038E408(this); +} + +void func_8038E460(Actor *this){//banjo_door + func_802D3D74(this); + if(mapSpecificFlags_get(0x10)){ + func_8038E430(this); + if(!mapSpecificFlags_get(2)){ + mapSpecificFlags_set(2, TRUE); + func_8028F918(0); + func_80324DBC(4.0f, ASSET_A7D_TEXT_JINXY_HELPED, 4, NULL, NULL, NULL, NULL); + } + } +} + +void func_8038E4DC(Actor *this){ + f32 sp24; + func_802D3D74(this); + if(!this->initialized){ + this->initialized = TRUE; + this->unk1C[0] = this->unk48; + } + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(func_803348CC() == 3){ + if(0.65 < this->unk48 && this->unk48 < 0.95){ + func_80343E20(0x6a, 0x7ff8, 0.32842f, 0x34); + } + } + else{//L8038E594 + func_8032BC3C(this, this->unk1C[0]); + mapSpecificFlags_set(3, FALSE); + mapSpecificFlags_set(4, FALSE); + return; + } + }//L8038E5BC + + if(!mapSpecificFlags_get(3)) return; + + sp24 = this->unk48; + func_8038E430(this); + if(this->unk48 < sp24){ + mapSpecificFlags_set(3, FALSE); + mapSpecificFlags_set(4, FALSE); + } + else{ + if(!mapSpecificFlags_get(4)){ + mapSpecificFlags_set(4, TRUE); + func_802BAFE4(1); + } + } +} + +void func_8038E648(Actor *this){ + f32 tmp_f18; + + func_802D3D74(this); + switch(this->state){ + case 1: //L8038E690 + this->pitch = 0.0f; + if(mapSpecificFlags_get(5)){ + func_802BAFE4(2); + func_80328A84(this, 6); + this->unk38_31 = 600; + func_80244BB0(0, 0x6A, 0x7ff8, 0.3f); + func_802D68F0(25); + item_set(ITEM_6_HOURGLASS, 1); + } + break; + + case 6: //L8038E700 + this->pitch += (this->pitch < 1.0) ? 0.017 : 1.09; + if(90.0f <= this->pitch){ + func_80328A84(this, 7); + this->pitch = 90.0f; + func_8030E540(SFX_7F_HEAVYDOOR_SLAM); + func_80244C78(0); + } + break; + + case 7: //L8038E78C + this->unk38_31 -= time_getDelta(); + if(this->unk38_31 == 0){ + func_80328A84(this, 8); + func_80244BB0(0, 0x6A, 0x7ff8, 0.3f); + } + break; + + case 8: //L8038E894 + this->pitch -= 1.5; + if(this->pitch <= 0.0f){ + func_80328A84(this, 1); + this->pitch = 0.0f; + func_8030E540(SFX_7F_HEAVYDOOR_SLAM); + mapSpecificFlags_set(5, FALSE); + func_80244C78(0); + func_80356520(0xAC); + } + break; + }//L8038E904: +} + +void func_8038E914(Actor *this){ + func_80389F5C(this); + if(!this->initialized){ + func_802D3D74(this); + this->initialized = TRUE; + if(sns_get_item_state(SNS_ITEM_EGG_BLUE, 1)) + marker_despawn(this->marker); + } +} + +void func_8038E97C(Actor *this){ + f32 tmp_f0; + if(!this->initialized){ + this->initialized = TRUE; + this->scale = 1.35f; + func_802D3D74(this); + this->unk1C[0] = this->position_y; + this->position_y += -300.0f; + } + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(func_803348CC() == 7){ + this->position_z += 117.0; + this->position_y += 130.0; + this->unk38_31 = 30; + func_80328A84(this, 8); + func_80244BB0(1, 0x6A, 0x7ff8, 0.3f); + } + }//L8038EA6C + + if(this->position_y == this->unk1C[0] + -300.0f){ + if(func_8031FF44(BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, 2) == 3){ + this->position_y = this->unk1C[0]; + } + } + + if(this->state == 8){ + + this->position_z = this->position_z - (f32)117.0/30.0f; + tmp_f0 = this->position_y; + this->position_y = tmp_f0 - (f32)130.0/30.0f; + this->unk38_31 -= 1; + if(this->unk38_31 == 0){ + func_80328A84(this, 1); + func_80244C78(1); + func_8030E540(SFX_7F_HEAVYDOOR_SLAM); + } + + } +} + +void chKazooieDoor_update(Actor *this){ + func_802D3D74(this); + func_8032AA58(this, 1.3f); + switch(this->state){ + case 1: //L8038EB98 + if(mapSpecificFlags_get(6)){ + func_8025A6EC(COMUSIC_2B_DING_B, -1); + func_802BAFE4(3); + func_80328A84(this, 6); + func_80244BB0(1, 0x6a, 0x7ff8, 0.3f); + this->unk1C[1] = this->position_y + 210.0f; + this->unk1C[0] = this->position_y; + } + break; + + case 6: //L8038EBF8 + this->position_y += 1.8; + this->position_z -= 1.3319999999999999; + if(this->unk1C[1] <= this->position_y){ + func_80328A84(this, 7); + func_8030E540(SFX_7F_HEAVYDOOR_SLAM); + func_80244C78(1); + this->unk38_31 = 450; + } + break; + + case 7: //L8038EC70 + this->unk38_31--; + if(this->unk38_31 == 0){ + func_80328A84(this, 8); + func_80244BB0(1, 0x6a, 0x7ff8, 0.3f); + } + break; + + case 8: //L8038ECD0 + this->position_y -= 1.8; + this->position_z += 1.3319999999999999; + if(this->position_y <= this->unk1C[0]){ + this->position_y = this->unk1C[0]; + func_80328A84(this, 1); + func_8030E540(SFX_7F_HEAVYDOOR_SLAM); + func_80244C78(1); + mapSpecificFlags_set(6, FALSE); + } + break; + }//L8038ED40 +} + +void chSunSwitch_update(Actor *this){ + + func_802D4A9C(this, 3); + + if( this->velocity_x == 0.0f + && mapSpecificFlags_get(3) == TRUE + && func_802BB270() + ){ + this->velocity_x = 1.0f; + func_802D68F0(10); + item_set(ITEM_6_HOURGLASS, 1); + }//L8038EDC8 + + if( this->velocity_x == 1.0f + && mapSpecificFlags_get(3) == FALSE + ){ + this->velocity_x = 0.0f; + } +} + +void chStarSwitch_update(Actor *this){ + if( this->velocity_x == 0.0f + && mapSpecificFlags_get(5) == TRUE + && func_802BB270() + ){ + this->velocity_x = 1.0f; + }//L8038EDC8 + + if( this->velocity_x == 1.0f + && mapSpecificFlags_get(5) == FALSE + ){ + this->velocity_x = 0.0f; + } + func_802D4A9C(this, 5); +} + +void chHoneycombSwitch_update(Actor *this){ + if(!mapSpecificFlags_get(0xd) && honeycombscore_get(HONEYCOMB_B_GV_CACTUS)){ + mapSpecificFlags_set(0xd, TRUE); + } + func_802D4A9C(this, 0xd); +} + +void func_8038EF14(Actor *this){ + func_802D4AC0(this, 0x8000a3, 0xa4); +} + +void chKazooieTarget_update(Actor *this){ + this->marker->propPtr->unk8_3 = TRUE; + if( this->velocity_x == 0.0f + && mapSpecificFlags_get(6) == TRUE + && func_802BB270() + ){ + this->velocity_x = 1.0f; + func_802D68F0(0x15); + item_set(ITEM_6_HOURGLASS, 1); + }//L8038EDC8 + + if( this->velocity_x == 1.0f + && mapSpecificFlags_get(6) == FALSE + ){ + this->velocity_x = 0.0f; + } +} + +void func_8038F004(void){ + func_8025A6EC(SFX_2D_KABOING, 0x7fff); +} + +void func_8038F028(UNK_TYPE(s32) arg0, ActorMarker *arg1, s32 arg2, s32 arg3){ + f32 sp24[3]; + s16 *tmp_v1; + + if(mapSpecificFlags_get(arg2) == FALSE){ + mapSpecificFlags_set(arg2, 1); + + sp24[0] = (f32)arg1->propPtr->x; + sp24[1] = (f32)arg1->propPtr->y; + sp24[2] = (f32)arg1->propPtr->z; + func_802C3F04((GenMethod_4)func_802C4140, 0x4e, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); + func_8025A6EC(COMUSIC_2B_DING_B, 22000); + if(mapSpecificFlags_get(arg3)){ + timedFunc_set_0(2.0f, func_8038F004); + } + } + func_80353580(arg1); +} + +void func_8038F10C(UNK_TYPE(s32) arg0, ActorMarker *arg1){ + func_8038F028(arg0, arg1, 0, 1); //JINXY egg flags? +} + +void func_8038F130(UNK_TYPE(s32) arg0, ActorMarker *arg1){ + func_8038F028(arg0, arg1, 1, 0); //JINXY egg flags? +} + +void func_8038F154(void) +{ + spawnableActorList_add(&D_80390BF0, actor_new, 0X180); + spawnableActorList_add(&D_80390C5C, actor_new, 0X58A); + spawnableActorList_add(&D_80390C80, actor_new, 0X9A8); + spawnableActorList_add(&D_80390D30, actor_new, 0X880); + spawnableActorList_add(&D_80390D60, actor_new, 0X80); + spawnableActorList_add(&D_80390CB0, actor_new, 0XDA8); + spawnableActorList_add(&D_80390D00, actor_new, 0X9A8); + spawnableActorList_add(&D_80390D90, actor_new, 0XD80); + spawnableActorList_add(&D_80390DD0, actor_new, 0X4004); + spawnableActorList_add(&D_80390E30, actor_new, 0X448); + spawnableActorList_add(&D_80390E54, actor_new, 0X48); + spawnableActorList_add(&D_80390ED0, actor_new, 0X180); + spawnableActorList_add(&D_80390F00, actor_new, 0X80); + spawnableActorList_add(&D_80390FD0, actor_new, 0X4048); + spawnableActorList_add(&D_80391010, actor_new, 0X4048); + spawnableActorList_add(&D_80391098, actor_new, 0X10069); + spawnableActorList_add(&D_80391158, actor_new, 0X48); + spawnableActorList_add(&D_803911C0, actor_new, 8); + spawnableActorList_add(&D_803911F4, actor_new, 0X80988); + spawnableActorList_add(&D_80391218, actor_new, 0X80988); + spawnableActorList_add(&D_8039123C, actor_new, 0X80988); + spawnableActorList_add(&D_80391260, actor_new, 0X80); + spawnableActorList_add(&D_80391318, actor_new, 0X78A); + spawnableActorList_add(&D_80391358, actor_new, 0X518); + spawnableActorList_add(&D_803912B8, actor_new, 0X500); + spawnableActorList_add(&D_80391390, actor_new, 0X500); + spawnableActorList_add(&D_803913B4, actor_new, 0X500); + spawnableActorList_add(&D_80390F40, actor_new, 0); + spawnableActorList_add(&D_80391494, actor_new, 0X408); + spawnableActorList_add(&D_803915C0, actor_new, 0); + spawnableActorList_add(&D_80391620, actor_new, 0X400); + spawnableActorList_add(&D_803914B8, actor_new, 0X400); + spawnableActorList_add(&D_803914DC, actor_new, 0X400); + spawnableActorList_add(&D_80391500, actor_new, 0X400); + spawnableActorList_add(&D_80391524, actor_new, 0X400); + spawnableActorList_add(&D_8039156C, actor_new, 0X400); + spawnableActorList_add(&D_80391428, actor_new, 8); + spawnableActorList_add(&D_8039144C, actor_new, 8); + spawnableActorList_add(&D_80391470, actor_new, 8); + spawnableActorList_add(&D_80391548, actor_new, 0X400); + spawnableActorList_add(&D_80391590, actor_new, 0X400); +} + +s32 func_8038F4C0(Actor *arg0, s32 arg1){ + if( getGameMode() != GAME_MODE_7_ATTRACT_DEMO + && (0xDBF4E829 + *(s32*)PHYS_TO_K1(0x284)) + ){ + return arg1; + } + else{ + return arg0->state; + } +} diff --git a/src/GV/code_9130.c b/src/GV/code_9130.c new file mode 100644 index 00000000..a848d59f --- /dev/null +++ b/src/GV/code_9130.c @@ -0,0 +1,206 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80324CD8(f32); + +typedef struct { + u8 pad0[4]; + s16 unk4; + //u8 pad6[2]; + f32 unk8; +} ActorLocal_GVMazeCtrl; + +void __chmazectrl_setState(Actor *this, s32 next_state); +void chmazectrl_update(Actor *this); + +/* .data */ +ActorInfo D_803915C0 = { MARKER_1CD_GV_MAZE_CTRL, ACTOR_319_GV_MAZE_CTRL, 0x0, + 0, NULL, + chmazectrl_update, 0x0, func_80325340, + 0, 0, 0.0f, 0 +}; +f32 D_803915E4[3] = {460.0f, 1400.0f, 0.0f}; +f32 D_803915F0[3] = {0.0f, 0.0f, 0.0f}; +f32 D_803915FC[3] = {0.0f, 0.0f, 0.0f}; +f32 D_80391608[3] = {460.0f, 1400.0f, 0.0f}; + +/* .code */ +void func_8038F520(f32 arg0){ + Struct6Ds *tmp_v0 = func_8034C528(0x19A); + if(tmp_v0 != NULL){ + func_8034DDF0(tmp_v0, D_803915E4, D_803915F0, arg0, 1); + } +} + +void func_8038F56C(f32 arg0){ + Struct6Ds *tmp_v0 = func_8034C528(0x19A); + if(tmp_v0 != NULL){ + func_8034DDF0(tmp_v0, D_803915FC, D_80391608, arg0, 1); + } +} + +void __chmazectrl_markerSetState(ActorMarker *this_marker, s32 arg1){ + Actor *this = marker_getActor(this_marker); + __chmazectrl_setState(this, arg1); +} + +void __chmazectrl_8038F5E4(Actor *this){ + if(this->state == 2){ + comusic_8025AB44(COMUSIC_26_GV_SANDYBUTT_DANGER, 0, 30000); + item_set(ITEM_6_HOURGLASS, FALSE); + } +} + +void __chmazectrl_setState(Actor *this, s32 next_state){ + f32 plyr_pos[3]; + Struct6Ds *tmp_v0; + ActorLocal_GVMazeCtrl *local; + f32 sp28[3]; + + local = (ActorLocal_GVMazeCtrl *)&this->local; + player_getPosition(plyr_pos); + local->unk8 = 0.0f; + if(next_state == 2){ + func_8025A58C(0, 4000); + func_8025A6EC(COMUSIC_26_GV_SANDYBUTT_DANGER, 30000); + item_set(ITEM_0_HOURGLASS_TIMER, 0xdd3); + item_set(ITEM_6_HOURGLASS, TRUE); + func_8038F520(1.0f); + FUNC_8030E624(SFX_3F6_UNKNOWN, 0.8f, 25000); + FUNC_8030E624(SFX_3F6_UNKNOWN, 0.7f, 25000); + FUNC_8030E624(SFX_3F6_UNKNOWN, 0.5f, 25000); + if(1500.0f < plyr_pos[0]){ + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.0f, 8); + timed_playSfx(1.0f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 32000); + func_80324CD8(1.2f); + func_80324E88(1.2f); + func_80324E38(1.2f, 0); + } + else{//L8038F754 + timed_playSfx(1.0f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 32000); + } + if(!levelSpecificFlags_get(0x16)){ + func_80311480(ASSET_A82_TEXT_SANDYBUTT_START_MAZE, 4, NULL, NULL, NULL, NULL); + levelSpecificFlags_set(0x16, TRUE); + } + }//L8038F794 + + if(this->state == 2){ + func_8025A58C(-1, 400); + comusic_8025AB44(COMUSIC_26_GV_SANDYBUTT_DANGER, 0, 0x190); + func_8025AABC(COMUSIC_26_GV_SANDYBUTT_DANGER); + item_set(ITEM_6_HOURGLASS, FALSE); + } + + if(next_state == 3){ + func_80324E38(0.0f, 3); + timedFunc_set_2(0.0f, (TFQM2)func_8025A6EC, COMUSIC_3E_SANDYBUTT_FAILURE, 0x7FFF); + timedFunc_set_2(1.0f, (TFQM2)__chmazectrl_markerSetState, reinterpret_cast(s32, this->marker), 6); + timedFunc_set_2(2.0f, (TFQM2)__chmazectrl_markerSetState, reinterpret_cast(s32, this->marker), 4); + }//L8038F850 + + if(next_state == 4){ + FUNC_8030E624(SFX_3F6_UNKNOWN, 1.0f, 30000); + FUNC_8030E624(SFX_3F6_UNKNOWN, 0.8f, 29000); + FUNC_8030E624(SFX_3F6_UNKNOWN, 0.7f, 28000); + FUNC_8030E624(SFX_3F6_UNKNOWN, 0.5f, 31000); + func_8030E6D4(SFX_52_BANJO_YAH_OH); + tmp_v0 = func_8034C528(400); + if(tmp_v0){ + func_8034DE60(tmp_v0, 0.0f, -1700.0f, 1.0f, 1); + } + }//L8038F8C4 + + if(this->state == 4){ + FUNC_8030E624(SFX_7F_HEAVYDOOR_SLAM, 0.6f, 32750); + FUNC_8030E624(SFX_7F_HEAVYDOOR_SLAM, 0.8f, 32725); + func_8030E6D4(SFX_7F_HEAVYDOOR_SLAM); + func_8028F66C(0x26); + } + + if(next_state == 6){ + player_getPosition(sp28); + sp28[1] = 2000.0f; + func_8028F94C(4, sp28); + } + + if(next_state == 5){ + func_8038F56C(0.0f); + if(++local->unk4 == 1) + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff); + + if(!levelSpecificFlags_get(0x17)){ + func_80311480(ASSET_A83_TEXT_SANDYBUTT_DONE, 4, NULL, NULL, NULL, NULL); + levelSpecificFlags_set(0x17, TRUE); + } + } + + this->state = next_state; +} + +void chmazectrl_update(Actor *this){ + f32 sp3C[3]; + Struct6Ds *sp38; + f32 sp34; + Struct6Ds *sp30; + ActorLocal_GVMazeCtrl *local = (ActorLocal_GVMazeCtrl *)&this->local; + + sp34 = time_getDelta(); + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->unk30 = __chmazectrl_8038F5E4; + if(this->state == 2){ + comusic_8025AB44(COMUSIC_26_GV_SANDYBUTT_DANGER, 30000, 30000); + item_set(ITEM_6_HOURGLASS, TRUE); + } + else{ + func_8038F56C(0.0f); + local->unk4 = 0; + this->state = 0; + __chmazectrl_setState(this, 1); + local->unk8 = 1.0f; + }//L8038FA8C + if(jiggyscore_isCollected(JIGGY_41_GV_MAZE)) + levelSpecificFlags_set(0x17, TRUE); + }//L8038FAA4 + + player_getPosition(sp3C); + if(this->state == 1){ + sp38 = func_8034C528(0x191); + if(sp38 != NULL && func_8034DC80(sp38, sp3C)){ + __chmazectrl_setState(this, 2); + } + if( !levelSpecificFlags_get(0x15) + && func_8025773C(&local->unk8, sp34) + && func_80311480(ASSET_A81_TEXT_SANDYBUTT_ENTER, 0, NULL, NULL, NULL, NULL) + ){ + levelSpecificFlags_set(0x15, TRUE); + } + }//L8038FB34 + + if(this->state == 2){ + if( sp3C[0] <= -1750.0f && 80.0f <= sp3C[2] && sp3C[2] <= 350.0f){ + __chmazectrl_setState(this, 5); + } + else{ + if(item_empty(ITEM_6_HOURGLASS)){ + __chmazectrl_setState(this, 3); + } + } + }//L8038FBBC + + if(this->state == 5){ + if(-1700.0f < sp3C[0]){ + __chmazectrl_setState(this, 2); + } + } + + if(this->state == 4){ + sp30 = func_8034C528(0x190); + if(sp30 != NULL && func_8034DC78(sp30)){ + __chmazectrl_setState(this, 0); + } + } +} diff --git a/src/GV/code_9860.c b/src/GV/code_9860.c new file mode 100644 index 00000000..6b0dbf85 --- /dev/null +++ b/src/GV/code_9860.c @@ -0,0 +1,80 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + f32 unk0; + s32 unk4; +}ActorLocal_GV_9860; + +void func_8038FD8C(Actor *this); +Actor *func_8038FCF4(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorInfo D_80391620 = { MARKER_1D4_SANDYBUTT_PYRAMID, ACTOR_31D_SANDYBUTT_PYRAMID, ASSET_56B_MODEL_SANDYBUTT_PYRAMID, + 0, NULL, + func_8038FD8C, NULL, func_8038FCF4, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_8038FC50(Actor *this, s32 next_state){ + s32 sp1C; + + if(next_state == 2){ + sp1C = func_802F9AA8(SFX_3EC_CCW_DOOR_OPENING); + func_802F9DB8(sp1C, 0.7f, 0.9f, 0.03f); + func_802F9F80(sp1C, 0.3f, 2.4f, 0.3f); + func_802FA060(sp1C, 32000, 32000, 0.0f); + } + this->state = next_state; +} + +Actor *func_8038FCF4(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(this_marker); + ActorLocal_GV_9860 *local = (ActorLocal_GV_9860 *)&this->local; + + if(local->unk4 == 0){ + return func_80325340(this_marker, gfx, mtx, vtx); + } + else{ + return func_80325888(this_marker, gfx, mtx, vtx); + } +} + +void func_8038FD50(ActorMarker *this_marker, s32 arg1){ + Actor *this = marker_getActor(this_marker); + ActorLocal_GV_9860 *local = (ActorLocal_GV_9860 *)&this->local; + + local->unk0 = 0.0f; + local->unk4 = arg1; + func_8038FC50(this, 2); +} + +void func_8038FD8C(Actor *this){ + ActorLocal_GV_9860 *local = (ActorLocal_GV_9860 *)&this->local; + f32 tmp_f2; + f32 tmp_f0; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + local->unk4 = func_8031FF44(BKPROG_F8_KING_SANDYBUTT_PYRAMID_STATE, 2); + this->position_x = 67.0f; + this->position_y = (local->unk4/3.0)*1050.0 + 1375.0; + this->position_z = 400.0f; + func_8038FC50(this, 1); + }//L8038FE48 + + if(this->state == 2){ + local->unk0 += time_getDelta()/3.0f; + if(1.0f < local->unk0) + local->unk0 = 1.0f; + + tmp_f0 = ((local->unk4 - 1)/3.0)*1050.0 + 1375.0; + tmp_f2 = (local->unk4/3.0)*1050.0 + 1375.0; + this->position_y = local->unk0*(tmp_f2 - tmp_f0) + tmp_f0; + if(1.0f == local->unk0) + func_8038FC50(this, 1); + }//L8038FF48 +} diff --git a/src/GV/code_9B70.c b/src/GV/code_9B70.c new file mode 100644 index 00000000..c7064d2b --- /dev/null +++ b/src/GV/code_9B70.c @@ -0,0 +1,20 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_8038FF60(void){} + +void func_8038FF68(void){ + + if(map_get() != MAP_12_GV_GOBIS_VALLEY) return; + + if(jiggyscore_isCollected(JIGGY_42_GV_WATER_PYRAMID)){ + func_8034DE60(func_8034C528(0x190), 0.0f, 270.0f, 0.0f, 1); + } + else{ + func_8034E71C(func_8034C5AC(0x130), -1500, 0.0f); + } +} + +void func_8038FFF4(void){} diff --git a/src/GV/code_9C10.c b/src/GV/code_9C10.c new file mode 100644 index 00000000..162f5337 --- /dev/null +++ b/src/GV/code_9C10.c @@ -0,0 +1,54 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +extern u8 D_80391AD0; + +/* .code */ +void func_80390000(s32 arg0){ + Struct73s *tmp_v0; + Struct6Ds *tmp_v0_2; + + D_80391AD0 = arg0; + if(D_80391AD0 == 1){ + set_camera_to_node(0x14); + func_80324E38(0.0f, 3); + timed_setCameraToNode(4.0f, 0x15); + func_80324E38(8.0f, 0); + + tmp_v0 = func_8034C5AC(0x130); + if(tmp_v0){ + func_8034E71C(tmp_v0, -1000, 0.0f); + func_8034E71C(tmp_v0, 0, 10.0f); + } + + tmp_v0_2 = func_8034C528(0x190); + if(tmp_v0_2){ + func_8034DE60(tmp_v0_2, 0.0f, 270.0f, 0.0f, 1); + } + }//L803900AC + + if(D_80391AD0 == 2){ + levelSpecificFlags_set(6, FALSE); + func_803228D8(); + func_802E4078(MAP_15_GV_WATER_PYRAMID, 1, 0); + } +} + +void func_803900F8(void){} + +void func_80390100(void){ + D_80391AD0 = 0; + if(levelSpecificFlags_get(6)){ + func_80390000(1); + } +} + +void func_80390138(void){ + if(D_80391AD0 && func_80334904() == 2){ + if(D_80391AD0 == 1 && timedFuncQueue_is_empty()){ + func_80390000(2); + } + } +} diff --git a/src/GV/code_9DB0.c b/src/GV/code_9DB0.c new file mode 100644 index 00000000..8ea912f8 --- /dev/null +++ b/src/GV/code_9DB0.c @@ -0,0 +1,239 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8034E120(void *, f32, f32, f32, s32); + +typedef struct { + s16 unk0; + s16 unk2; + Struct6Ds *unk4; +}Struct_GV_9DB0_1; + +/* .data */ +Struct_GV_9DB0_1 D_80391650[] = { + {0x190, 1, 0 }, + {0x191, 5, 0 }, + {0x192, 3, 0 }, + {0x193, 4, 0 }, + {0x194, 3, 0 }, + {0x195, 7, 0 }, + {0x196, 0, 0 }, + {0x197, 4, 0 }, + {0x198, 0, 0 }, + {0x199, 2, 0 }, + {0x19A, 6, 0 }, + {0x19B, 1, 0 }, + {0x19C, 6, 0 }, + {0x19D, 5, 0 }, + {0x19E, 2, 0 }, + {0x19F, 7, 0 }, + {0x000, 0, 0 }, +}; +f32 D_803916D8[3] = {0.0f, 100.0f, 0.0f}; + +/*.bss */ +extern struct { + Struct_GV_9DB0_1 *tile1_0; + Struct_GV_9DB0_1 *tile2_4; + u8 matchCnt_8;//match_count + u8 state_9; + //u8 padA[0x2]; + f32 unkC; + ActorMarker *unk10; +}D_80391AE0; + +/* .code */ +Struct_GV_9DB0_1 * func_803901A0(s32 arg0){ + int i; + for(i = 0; D_80391650[i].unk0 != 0; i++){ + if(arg0 == D_80391650[i].unk0) + return D_80391650 + i; + } + return NULL; +} + +void func_803901F0(void *arg0){ + FUNC_8030E624(SFX_3F6_UNKNOWN, 1.0f, 30000); +} + +void func_80390218(void *arg0){ + FUNC_8030E624(SFX_7F_HEAVYDOOR_SLAM, 0.8f, 32725); + func_8030E6D4(SFX_7F_HEAVYDOOR_SLAM); +} + +void func_80390248(void){ + jiggySpawn(JIGGY_40_GV_MATCHING_GAME, D_803916D8); +} + +//matchingGame_setState +void func_80390270(s32 next_state){ + if(next_state == 2){ + item_set(ITEM_6_HOURGLASS, 1); + if(func_803203FC(2)) + item_set(ITEM_0_HOURGLASS_TIMER, 4499); + else + item_set(ITEM_0_HOURGLASS_TIMER, 5999); + } + if(D_80391AE0.state_9 == 2){ + item_set(ITEM_6_HOURGLASS, 0); + } + + if(next_state == 3){ + if(func_803203FC(2)){ + func_803204E4(3, 0); + func_803204E4(5, 0); + } + else{ + func_8028F66C(0xf); + } + } + + if(next_state == 4){ + if(func_803203FC(2)){ + func_803204E4(3, 0); + func_803204E4(5, 1); + } + else{ + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7fff); + if(D_80391AE0.unk10){ + func_8035D490(D_80391AE0.unk10); + } + func_80324E38(0.5f, 3); + timed_setCameraToNode(1.5f, 2); + timedFunc_set_0(1.7f, func_80390248); + func_80324E88(4.0f); + func_80324E38(4.0f, 0); + + } + }//L803903D8 + D_80391AE0.state_9 = next_state; +} + +//matchingGame_reset +void func_803903EC(void){ + func_80390270(0); +} + +//matchingGame_init +void func_8039040C(void){ + Actor *actor; + D_80391AE0.state_9 = 0; + if(map_get() == MAP_13_GV_MEMORY_GAME){ + if( !jiggyscore_isSpawned(JIGGY_40_GV_MATCHING_GAME) //jiggy is collected + || func_803203FC(2) //in FF minigame + ){ + D_80391AE0.matchCnt_8 = 0; + D_80391AE0.tile1_0 = NULL; + D_80391AE0.tile2_4 = NULL; + D_80391AE0.state_9 = 1; + D_80391AE0.unkC = 0.0f; + actor = func_80326EEC(0x34f); + if(actor){ + D_80391AE0.unk10 = actor->marker; + } + else{ + D_80391AE0.unk10 = NULL; + } + } + } +} + +void func_803904A8(void){ + f32 sp5C; + f32 sp50[3]; + s32 sp4C; + Struct6Ds *sp48; + Struct_GV_9DB0_1 * sp44; + f32 sp38[3]; + f32 pad34; + + sp5C = time_getDelta(); + if(!D_80391AE0.state_9) + return; + + if(D_80391AE0.unk10 && !D_80391AE0.unk10->unk5C){ + D_80391AE0.unk10 = NULL; + } + + if(D_80391AE0.tile1_0 == NULL || D_80391AE0.tile2_4 == NULL){ + if( player_getActiveHitbox(0) == HITBOX_1_BEAK_BUSTER && func_8028F20C()){ + player_getPosition(sp50); + sp4C = func_8033F3E8(func_80309744(0), sp50, 0x190, 0x1a0); + if(sp4C){ + sp48 = func_8034C528(sp4C); + if(D_80391AE0.state_9 == 1){ + func_80390270(2); + } + if(func_8034DC78(sp48) != 1){ + sp44 = func_803901A0(sp4C); + func_8034E254(sp48, func_803901F0); + func_8034E25C(sp48, func_80390218); + func_8034E120(sp48, 0.0f, 180.0f, 0.7f, 1); + + D_80391AE0.tile2_4 = D_80391AE0.tile1_0; + D_80391AE0.tile1_0 = sp44; + sp44->unk4 = sp48; + + if(D_80391AE0.unk10){ + func_8035D4F0(D_80391AE0.unk10, sp4C); + } + } + } + } + }//L80390608 + + if(D_80391AE0.tile1_0 && D_80391AE0.tile2_4){ + s32 sp48; + if( func_8034DC78(D_80391AE0.tile1_0->unk4) == 1 && func_8034DC78(D_80391AE0.tile2_4->unk4) == 1){ + if(0.0f < D_80391AE0.unkC){ + if(0.6 < D_80391AE0.unkC && D_80391AE0.unkC - sp5C <= 0.6){ + func_8025A6EC(COMUSIC_2C_BUZZER, 0x7fff); + }//L803906AC + D_80391AE0.unkC -= sp5C; + if(D_80391AE0.unkC <= 0.0f){ + func_8034E254(D_80391AE0.tile1_0->unk4, 0); + func_8034E25C(D_80391AE0.tile1_0->unk4, 0); + func_8034E120(D_80391AE0.tile1_0->unk4, 180.0f, 0.0f, 0.5f, 2); + func_8034E120(D_80391AE0.tile2_4->unk4, 180.0f, 0.0f, 0.5f, 2); + player_getPosition(sp38); + sp48 = func_8033F3E8(func_80309744(0), sp38, 0x190, 0x1a0); + if(sp48 == D_80391AE0.tile1_0->unk0 || sp48 == D_80391AE0.tile2_4->unk0){ + func_8028F66C(0x14); + } + D_80391AE0.tile1_0 = D_80391AE0.tile2_4 = NULL; + } + }//L80390788 + else{ + if(D_80391AE0.tile2_4->unk2 == D_80391AE0.tile1_0->unk2){ + D_80391AE0.matchCnt_8++; + if(D_80391AE0.matchCnt_8 == 8){ + func_80390270(4); //end game state + } + else{ + func_8025A6EC(COMUSIC_2B_DING_B, 0x7fff); + } + D_80391AE0.tile1_0 = D_80391AE0.tile2_4 = NULL; + }//L803907E4 + else{ + D_80391AE0.unkC = 1.0f; + } + }//L803907EC + }//L803907F0 + }//L803907F0 + + if( D_80391AE0.state_9 == 1 + && func_803203FC(2) + && func_803203FC(3) + ){ + func_80390270(2); + } + + if(D_80391AE0.state_9 == 2){ + if(D_80391AE0.tile1_0 == NULL || D_80391AE0.tile2_4 == NULL){ + if(item_empty(ITEM_6_HOURGLASS)){ + func_80390270(3); + } + } + } +} diff --git a/src/GV/code_A490.c b/src/GV/code_A490.c new file mode 100644 index 00000000..e918e662 --- /dev/null +++ b/src/GV/code_A490.c @@ -0,0 +1,105 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +struct { + u8 unk0; + f32 unk4; +}D_80391B00; + +/* .code */ +void func_80390880(void){ + void *tmp_v0; + + tmp_v0 = func_8034C5AC(300); + if(tmp_v0){ + func_8034E7B8(tmp_v0, -1460, 20.0f, 2, 20.0f); + } +} + +void func_803908C4(s32 arg0){ + void *tmp_v0; + D_80391B00.unk0 = arg0; + if(D_80391B00.unk0 == 2){ + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.0f, 0); + timedFunc_set_0(3.0f, func_80390880); + timed_setCameraToNode(3.0f, 1); + func_80324E38(6.0f, 0); + tmp_v0 = func_8034C528(400); + if(tmp_v0){ + func_8030E760(SFX_3F6_UNKNOWN, 0.7f, 28000); + func_8030E760(SFX_3F6_UNKNOWN, 0.9f, 29000); + func_8030E760(SFX_3F6_UNKNOWN, 1.0f, 30000); + func_8034DE60(tmp_v0, 0.0f, 400.0f, 2.5f, 1); + } + } + + if(D_80391B00.unk0 == 3){ + levelSpecificFlags_set(6, TRUE); + func_803228D8(); + func_803204E4(0xe, 1); + func_802E4078(MAP_12_GV_GOBIS_VALLEY, 0, 0); + } +} + +void func_803909EC(void){} + +void func_803909F4(void){ + void *tmp_v0; + void *tmp_v0_2; + + + D_80391B00.unk0 = 0; + if(map_get() != MAP_15_GV_WATER_PYRAMID) return; + + if(jiggyscore_isCollected(JIGGY_42_GV_WATER_PYRAMID)){ + tmp_v0 = func_8034C528(400); + if(tmp_v0) + func_8034DE60(tmp_v0, 0.0f, 400.0f, 0.0f, 2); + + tmp_v0_2 = func_8034C5AC(300); + if(tmp_v0_2) + func_8034E71C(tmp_v0_2, -1460, 0.0f); + } + else{ + D_80391B00.unk4 = 0.0f; + func_803908C4(1); + } +} + +void func_80390A94(void){ + f32 time_delta; + void *tmp_v0; + + time_delta = time_getDelta(); + + if(!D_80391B00.unk0) return; + + if(D_80391B00.unk0 == 1){ + if(0.0f < D_80391B00.unk4){ + D_80391B00.unk4 -= time_delta; + if(D_80391B00.unk4 <= 0.0f){ + func_803908C4(2); + } + } + else{ + if(jiggyscore_isCollected(JIGGY_42_GV_WATER_PYRAMID)){ + D_80391B00.unk4 = 0.01f; + } + } + }//L80390B34 + + if(D_80391B00.unk0 == 2){ + tmp_v0 = func_8034C528(0x190); + if(tmp_v0 && func_8034DC78(tmp_v0) == 1){ + func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.8f, 0x7fd0); + func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.9f, 0x7fc6); + func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 0x7fc6); + func_8034E264(tmp_v0, 2); + } + if(timedFuncQueue_is_empty()) + func_803908C4(3); + } +} diff --git a/src/GV/code_D60.c b/src/GV/code_D60.c new file mode 100644 index 00000000..70555018 --- /dev/null +++ b/src/GV/code_D60.c @@ -0,0 +1,232 @@ +#include +#include "functions.h" +#include "variables.h" + +extern func_802EBA98(s32, f32[3], s32, f32, s32, f32[3], f32, f32[3]); + +typedef struct { + u8 unk0[2]; + //u8 pad2[2]; + f32 unk4; + f32 unk8; + f32 unkC; + f32 unk10; + f32 unk14; +}ActorLocal_GV_D60; + +void func_80387408(Actor *this); +Actor *chgobi1_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorInfo D_80390C80 = { MARKER_BC_GOBI_1, ACTOR_12E_GOBI_1, ASSET_3E0_MODEL_GOBI, + 0, NULL, + NULL, func_80387408, chgobi1_draw, + 0, 0x533, 0.0f, 0 +}; + +/* .bss */ +struct { + u8 unk0; + u8 unk1; +}D_80391A40; + + +/* .code */ +void func_80387150(Actor *this, s32 next_state){ + ActorLocal_GV_D60 *local = (ActorLocal_GV_D60 *)&this->local; + + this->state = next_state; + D_80391A40.unk0 = FALSE; + D_80391A40.unk1 = FALSE; + + if(this->state == 1){ + func_80335924(this->unk148, 0xd9, 0.5f, 4.0f); + local->unk4 = randf2(2.0f, 10.0f); + } + + if(this->state == 2){ + func_80335924(this->unk148, 0xda, 1.0f, 5.0f); + local->unkC = 0.9f; + D_80391A40.unk0 = TRUE; + } + + if(this->state == 3){ + func_8028F918(2); + func_80335924(this->unk148, 0xf7, 1.0f, 5.33f); + local->unk14 = 0.01f; + D_80391A40.unk1 = TRUE; + } + + if(this->state == 4){ + func_80335924(this->unk148, 0xf8, 0.7f, 0.71f); + } + + if(this->state == 6){ + FUNC_8030E8B4(SFX_84_GOBI_CRYING, 0.9f, 20000, this->position, 1500, 2500); + func_80335924(this->unk148, 0x241, 0.2f, 0.5f); + } +} + +Actor *chgobi1_draw(ActorMarker *this_marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(this_marker); + if(this->state == 0 || this->state == 5){ + return this; + } + else{ + return func_80325888(this_marker, gfx, mtx, vtx); + } +} + +s32 func_80387354(void){ + return D_80391A40.unk0; +} + +s32 func_80387360(void){ + return D_80391A40.unk1; +} + +void func_8038736C(Actor *this){ + ActorLocal_GV_D60 *local = (ActorLocal_GV_D60 *)&this->local; + func_80387150(this, 0); + func_8030DA44(local->unk0[0]); + func_8030DA44(local->unk0[1]); +} + +void func_803873B0(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + if( player_getActiveHitbox(NULL) == HITBOX_A_FAST_FALLING + || player_getActiveHitbox(NULL) == HITBOX_1_BEAK_BUSTER + ){ + this->unk1C[0] = 1.0f; + } +} + +void func_80387408(Actor *this){ + ActorMarker *marker = this->marker; + ActorLocal_GV_D60 *local = (ActorLocal_GV_D60 *)&this->local; + s32 sp6C = 0; + f32 tick; //sp68; + int i; + s32 tmp_s1; + f32 sp54[3]; + f32 sp48[3]; + + tick = time_getDelta(); + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + marker_setCollisionScripts(this->marker, func_803873B0, NULL, NULL); + marker->unk30 = func_8038736C; + marker->propPtr->unk8_3 = TRUE; + marker->collidable = TRUE; + D_80391A40.unk0 = 0; + D_80391A40.unk1 = 0; + local->unk0[0] = func_8030D90C(); + local->unk0[1] = func_8030D90C(); + local->unk8 = 0.0f; + local->unkC = 0.0f; + local->unk10 = 0.0f; + local->unk14 = 0.0f; + this->unk1C[0] = 0.0f; + this->unk1C[1] = 0.0f; + func_80387150(this, 1); + if(jiggyscore_isSpawned(JIGGY_44_GV_GOBI_1) && ! func_803203FC(1)){ + marker_despawn(this->marker); + } + return; + }//L80387514 + + if(func_8025773C(&local->unk8, tick)) + sp6C = 5; + + if(func_8025773C(&local->unkC, tick)) + FUNC_8030E8B4(SFX_84_GOBI_CRYING, 0.9f, 32000, this->position, 1500, 2500); + + if(func_8025773C(&local->unk10, tick)){ + for(i = 0; i < 2; i++){ + sfxsource_setSfxId(local->unk0[i], SFX_3F9_UNKNOWN); + func_8030DD14(local->unk0[i], 3); + sfxsource_setSampleRate(local->unk0[i], 32000); + func_8030E2C4(local->unk0[i]); + } + } + + if(func_8025773C(&local->unk14, tick)){ + local->unk10 = 0.75f; + local->unk8 = 7.5f; + timed_setCameraToNode(0.5f, 0xa); + timed_playSfx(1.0f, SFX_84_GOBI_CRYING, 1.1f, 30000); + timed_playSfx(2.0f, SFX_84_GOBI_CRYING, 1.3f, 30000); + timed_playSfx(2.5f, SFX_74_WALKING_NOISE_5, 0.5f, 30000); + func_80324DBC(3.0f, ASSET_A74_TEXT_GOBI_HELPED, 0x2a, this->position, NULL, NULL, NULL); + timed_playSfx(5.0f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000); + timed_playSfx(5.6f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000); + timed_playSfx(6.5f, SFX_2E_BIGBUTT_RUNNING, 1.0f, 20000); + func_80324E88(7.6f); + } + + if(this->state == 1 || this->state == 2){ + if(func_80388D78()) + sp6C = 3; + } + + if(this->state == 2){ + if(func_80335794(this->unk148) > 0) + sp6C = 1; + } + + if(this->state == 1 || this->state == 2){ + if( !this->unk138_24 + && func_80329530(this, 250) + && !func_80329530(this, 80) + && func_8028F2A0() + && func_80311480(0xa73, 0, NULL, NULL, NULL, NULL) + ){ + this->unk138_24 = 1; + } + }//L803877A4 + + if(this->state == 1){ + if(this->unk1C[0] != 0.0f && this->unk1C[1] == 0.0f ){ + sp6C = 6; + }//L803877F0 + else{ + if(func_8025773C(&local->unk4, tick)) + sp6C = 2; + } + }//L80387808 + + if(this->state == 3){ + if(func_80335794(this->unk148) > 0) + sp6C = 4; + }//L80387830 + + if(this->state == 4){ + func_80326224(this); + tmp_s1 = func_8033A12C(func_80330B1C(this->marker)); + if(tmp_s1){ + player_getPosition(sp54); + sp54[1] += 50.0f; + if(func_802EBA98(tmp_s1, this->position, 0, 1.0f, 0, sp54, 40.0f, sp48)){ + func_8028F428(2, this->marker); + } + } + } + + if(this->state == 5){ + if(timedFuncQueue_is_empty()){ + func_8028F918(0); + marker_despawn(this->marker); + } + } + + if(this->state == 6){ + if(func_80335794(this->unk148) > 0) + sp6C = 1; + } + + this->unk1C[1] = this->unk1C[0]; + this->unk1C[0] = 0.0f; + + if(sp6C) + func_80387150(this, sp6C); +} diff --git a/src/MM/ch/chimpystump.c b/src/MM/ch/chimpystump.c new file mode 100644 index 00000000..4d2eb198 --- /dev/null +++ b/src/MM/ch/chimpystump.c @@ -0,0 +1,66 @@ +/*DONE!!!*/ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + +/* external function declarations */ +void func_80353064(f32 *, f32); +void func_802BB3DC(s32, f32, f32); +void func_80244BB0(s32, s32, s32, f32); + +/* public function declarations */ +void chchimpystump_update(Actor *this); + +/* .data */ +ActorInfo chchimpystump = { MARKER_95_CHIMPY_STUMP, ACTOR_C5_CHIMPY_STUMP, ASSET_3C8_MODEL_CHIMPY_STUMP, + 1, NULL, + chchimpystump_update, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +void _chchimpystump_80386CA0(Actor *this){ + if(mapSpecificFlags_get(4)){ + if(this->unk10_12 == 0){ + this->unk10_12 = 1; + func_802BB3DC(1, 3.0f, 1.0f); + func_80244BB0(0, 0x6A, 0x7FF8, 0.2f); + }//L80386D0C + this->position_x = ((func_8023DB5C() & 1) * 2) ^ (s32)this->position_x; + this->position_z = ((func_8023DB5C() & 2) * 2) ^ (s32)this->position_z; + } +} + +void chchimpystump_update(Actor *this){ + if(!this->initialized){ + actor_collisionOff(this); + this->initialized = 1; + this->unk28 = this->position_y; + this->position_y -= 134.0f; + this->marker->propPtr->unk8_3 = 1; + } + switch (this->state) + { + case 1: + if(mapSpecificFlags_get(0)) + func_80328A84(this, 2); + + _chchimpystump_80386CA0(this); + break; + case 2: + _chchimpystump_80386CA0(this); + this->position_y += 2.5; + if(this->unk28 <= this->position_y){ + this->position_y = this->unk28; + func_80328A84(this, 3); + func_802BB41C(1); + func_80244C78(0); + } + if((func_8023DB5C() & 3) == 2) + func_80353064(this->position, 40.0f); + break; + case 3: + break; + } +} diff --git a/src/MM/ch/conga.c b/src/MM/ch/conga.c new file mode 100644 index 00000000..d6ac7faf --- /dev/null +++ b/src/MM/ch/conga.c @@ -0,0 +1,374 @@ +#include +#include "rand.h" +#include "functions.h" +#include "variables.h" + +#ifndef MIN +#define MIN(s,t) ((s)<(t)?(s):(t)) +#endif + +#ifndef MAX +#define MAX(s,t) ((s)<(t)?(t):(s)) +#endif + +#ifndef SQUARE +#define SQUARE(s) ((s)*(s)) +#endif + +void func_80328FB0(Actor *, f32); + +void func_80328B8C(Actor*, s32, f32, s32); +void func_802C8F70(f32); +void func_80324E88(f32); +Actor *func_8032811C(s32 actor_id, s32 position[3], s32 yaw); +void func_80387F44(void); + +void func_803876D0(Actor *); + +typedef struct chconga_s{ + TUPLE(s32, orangeSpawnPosition); + s32 unkC; + s32 unk10; + u8 pad14[0x4]; + s32 unk18; + s32 unk1C; +}ActorLocal_Conga; + + +/* .data */ +ActorAnimationInfo chCongaAnimations[9] = { + {0, 0.0f}, + {ASSET_51_ANIM_CONGA_IDLE, 3.8f}, + {ASSET_52_ANIM_CONGA_OW, 1.0f}, + {ASSET_53_ANIM_CONGA_DEFEAT, 2.0f}, + {ASSET_54_ANIM_CONGA_THROW, 1.4f}, + {ASSET_55_ANIM_CONGA_BEAT_CHEST, 0.4f}, + {ASSET_56_ANIM_CONGA_RAISE_ARMS, 0.9f}, + {0xA2, 1.6f}, + {ASSET_52_ANIM_CONGA_OW, 1.0f} +}; + +ActorInfo D_80389998 = { MARKER_7_CONGA, ACTOR_8_CONGA, ASSET_35C_MODEL_CONGA, + 1, chCongaAnimations, + func_803876D0, func_80326224, func_80325888, + 0, 0x333, 0.0f, 0 +}; + + +/* code */ +int func_80386ED0(Actor * this){ + f32 plyrPos[3]; + f32 tmpz; + + if(map_get() != MAP_2_MM_MUMBOS_MOUNTAIN) + return 0; + + if(!this->unk10_12) + return 0; + + player_getPosition(plyrPos); + if(plyrPos[1] < 300.0f || 600.0f < plyrPos[1]) + return 0; + + tmpz = plyrPos[2]- 5029.0f; + if(52900.0f < (plyrPos[0]- -5011.0f)*(plyrPos[0]- -5011.0f) + (plyrPos[2]- 5029.0f)*(plyrPos[2]- 5029.0f)) + return 0; + + return 1; +} + +void func_80386FB0(Actor *this){ + func_80328C64(this, func_80329784(this)); + func_80328FB0(this, 3.0f); +} + +void func_80386FE8(void){ + if( (func_8023DB5C() & 0xF) == 0xB + && 0.85 < randf () + && !func_803114B0() + ){ + func_8030E58C(((s32)(randf ()*256.0f) & 1)? SFX_22_KONGA_NOISE_1: SFX_23_KONGA_NOISE_2, 1.0f); + } +} + +void func_8038708C(Actor *this, s32 anim_id){ + func_80328B8C(this, anim_id, 0.0f, 1); + func_8030E58C(SFX_24_KONGA_NOISE_3, randf2(0.9f, 1.1f)); +} + +void func_803870D0(Actor *this, ActorMarker *arg1){ + marker_getActor(arg1)->unk100 = this->marker; +} + +void func_80387100(ActorMarker *this){ + ActorMarker *m = *(ActorMarker **)&this; + Actor* actorPtr; + f32 sp1C[3]; + + actorPtr = marker_getActor(m); + sp1C[0] = actorPtr->position_x; + sp1C[1] = actorPtr->position_y + 60.0f; + sp1C[2] = actorPtr->position_z; + func_802C8F70(0.0f); + func_80333270(JIGGY_A_MM_CONGA, sp1C, func_803870D0, m); + +} + +void func_80387168(ActorMarker *marker, ActorMarker *other_marker){ + Actor *actorPtr; + + actorPtr = marker_getActor(marker); + if(((ActorLocal_Conga *)&actorPtr->local)->unkC == 1){ + if(actorPtr->unk10_12 == 0){ + ((ActorLocal_Conga *)&actorPtr->local)->unkC = 0; + if(mapSpecificFlags_get(0xA)) + actorPtr->unk38_31++; + + actorPtr->unk10_12 = MIN(actorPtr->unk38_31, 0xA); + if( actorPtr->unk38_31 == 3 + && !jiggyscore_isCollected(JIGGY_A_MM_CONGA) + ){ + func_80328B8C(actorPtr, 8, 0 ,1); + timed_setCameraToNode(0.0f, 0x10); + func_80324E38(0.0f, 3); + FUNC_8030E624(SFX_84_GOBI_CRYING, 0.8f, 32750); + FUNC_8030E624(SFX_84_GOBI_CRYING, 0.8f, 32750); + } + else if( actorPtr->state != 3 + && actorPtr->state != 8 + ){ + func_8038708C(actorPtr, 2); + if(actorPtr->unk38_31 == 1){ + func_80311480(ASSET_B39_TEXT_CONGA_HIT_BY_EGG, 4, actorPtr->position, 0, 0, 0); + } + } + } + } + +} + +int func_803872EC(void){ + s32 text_id = func_803114C4(); + + return text_id == ASSET_B37_TEXT_CONGA_SAFE_UP_HERE + || text_id == ASSET_B38_TEXT_CONGA_DEFEAT + || func_803203FC(0x1F) + || text_id == ASSET_B3B_TEXT_CONGA_ORANGE_PAD_JIGGY + || text_id == ASSET_B45_TEXT_JIGGY_COLLECT_10 + || text_id == ASSET_B51_TEXT_BOTTLES_HOW_TO_EXIT_LEVEL; +} + +void func_80387370(ActorMarker *this, enum asset_e text_id, s32 arg2){ + marker_getActor(this)->velocity_x = 9.0f; + timed_setCameraToNode(0.0f, 0x11); + func_80324E88(3.2f); + func_80324E38(3.2f, 0); +} + +void func_803873C8(ActorMarker *congaMarker){ + ActorMarker *m = *(ActorMarker **)&congaMarker; //sp84 + Actor * congaPtr = marker_getActor(m); //sp80 + ActorLocal_Conga *conga_localPtr = (ActorLocal_Conga *)&congaPtr->local; //sp7C + s32 conga_state = congaPtr->state; + Actor * orangePtr; + f32 pad0; + TUPLE(f32, pos) plyr; + f32 temp_f22; + f32 temp_f20; + f32 temp_f18; + f32 iHeight; + f32 iVelY; + + congaPtr->unk10_12 -= (congaPtr->unk10_12 && ( conga_state == 7)); + func_80387F44(); + congaPtr->unk28 = 2.0f; + orangePtr = func_8032811C(ACTOR_14_ORANGE_PROJECTILE, conga_localPtr->orangeSpawnPosition, congaPtr->yaw); + + if(orangePtr != NULL){ + player_getPosition(plyr.pos); + orangePtr->velocity_x = plyr.pos_x - orangePtr->position_x; + orangePtr->velocity_y = (60.0)*((conga_state == 7) ? 0.5: 1.0); + orangePtr->velocity_z = plyr.pos_z - orangePtr->position_z; + if(SQUARE(plyr.pos_z - m->propPtr->z) + SQUARE(plyr.pos_x - m->propPtr->x) < 40000.0f ){ + temp_f20 = randf2(2.4f, 4.4f); temp_f22 = randf2(2.4f, 4.4f); //f22 + orangePtr->velocity[0] *= (randf() < 0.5)? temp_f20 : -temp_f20; + orangePtr->velocity[1] = randf2(1.8f, 2.2f) * 60.0; + orangePtr->velocity[2] *= (randf() < 0.5)? temp_f22 : -temp_f22; + } + + iHeight = orangePtr->position_y; + iVelY = orangePtr->velocity_y; + for(temp_f18 = 0.0f; !(iHeight < plyr.pos_y && iVelY < 0.0f); temp_f18++){ + iHeight += (iVelY -= 5.0); + } + orangePtr->velocity_x /= temp_f18; + orangePtr->velocity_z /= temp_f18; + } +} + +void func_803876D0(Actor *this){ + f32 tmp_f4; + NodeProp *sp40; + s32 sp3C; + + this->marker->propPtr->unk8_3 = (timedFuncQueue_is_empty(this))?1:0; + if(!this->initialized){ + ((ActorLocal_Conga *)&this->local)->unkC = 1; + this->unk16C_0 = 1; + this->initialized = 1; + this->velocity_x = 0.0f; + this->unk28 = 0.0f; + sp40 = func_80304C38(0x150, this); + ((ActorLocal_Conga *)&this->local)->unk1C = nodeprop_getRadius(sp40); + func_80304D4C(sp40, &((ActorLocal_Conga *)&this->local)->unk10); + } + if(0.0f == this->unk28){ + this->unk28 = (func_80326CCC(0x36) != NULL)? 2.0f: 1.0f; + } + if(0.0f != this->velocity_x){ + this->velocity_x -= 1.0f; + if(0.0f == this->velocity_x){ + func_802C3C88((GenMethod_1)func_80387100, (s32)this->marker); + } + } + marker_setCollisionScripts(this->marker, NULL, NULL, func_80387168); + if( !func_80329530(this, 2100) + && this->state != 2 + && this->state != 8 + ){ + if(this->state > 3 && this->state < 8){ + actor_loopAnimation(this); + func_80328B8C(this, 1, 0.76f, 1); + } + return; + } + + sp3C = func_80329530(this, 1000); + if( func_8032A9E4(((ActorLocal_Conga *)&this->local)->unk10, ((ActorLocal_Conga *)&this->local)->unk18, ((ActorLocal_Conga *)&this->local)->unk1C) + && !this->unk138_23 + && func_80311480(ASSET_B37_TEXT_CONGA_SAFE_UP_HERE, 0, 0, 0, 0, 0) + ){ + this->unk138_23 = 1; + mapSpecificFlags_set(0xA, 1); + }//L803878F8 + + if( sp3C && !this->unk138_24){ + if(func_80311480((player_getTransformation()== TRANSFORM_2_TERMITE) ? ASSET_B3E_TEXT_CONGA_MEET_AS_TERMITE : ASSET_B3C_TEXT_CONGA_MEET, 0, this->position, 0,0,0)){ + this->unk138_24 = 1; + } + } //L80387968 + + switch(this->state){ + case 1://80387990 + actor_loopAnimation(this); + func_80386FB0(this); + func_80386FE8(); + if(actor_animationIsAt(this, 0.0f) || actor_animationIsAt(this, 0.45f)){ + if(randf() < 0.2){ + animctrl_setDirection(this->animctrl, animctrl_isPlayedForwards(this->animctrl)?0:1); + }; + }//L80387A18 + if(actor_animationIsAt(this, 0.66f)){ + func_80328BD4(this, 6, 0, 1, 0.38f); + } + if( sp3C + && func_8028ECAC() != 1 + && !func_80386ED0(this) + && timedFuncQueue_is_empty() + && !func_8032A9E4(((ActorLocal_Conga *)&this->local)->unk10, ((ActorLocal_Conga *)&this->local)->unk18, ((ActorLocal_Conga *)&this->local)->unk1C) + && !func_803872EC() + ){ + func_80328B8C(this, 4, 0.0f, 1); + }//L80387AC0 + if( func_8028ECAC() != 1 + && func_80386ED0(this) + && this->unk38_31 != 0 + && !func_803872EC() + ){ + func_80328B8C(this, 7, 0.0f, 1); + } + break; + + case 6: //L80387B24 + ((ActorLocal_Conga *)&this->local)->unkC = 1; + actor_playAnimationOnce(this); + func_80386FE8(); + if( animctrl_isPlayedForwards(this->animctrl) == TRUE + && actor_animationIsAt(this, 0.0f) + ){ + func_80328B8C(this, 5, 0.0f, 1); + } + else if( !animctrl_isPlayedForwards(this->animctrl) + && actor_animationIsAt(this, 0.001f) + ){ + func_80328B8C(this, 1, 0.76f, 1); + } + break; + + case 5: //L80387BC0 + ((ActorLocal_Conga *)&this->local)->unkC = 1; + actor_loopAnimation(this); + func_80386FE8(); + if( actor_animationIsAt(this, 0.99f)){ + func_80328BD4(this, 6, 0.999f, 0, sp3C ? 1.0 : 0.4); + }//L80387C30 + if( actor_animationIsAt(this, 0.9f) + || actor_animationIsAt(this, 0.4f) + ){ + func_8030E6D4(SFX_3FB_UNKNOWN); + } + break; + + case 4: //L80387C74 + if(actor_animationIsAt(this, 0.6f)){ + func_8030E58C(SFX_2_CLAW_SWIPE, 0.7f); + } + func_80386FB0(this); + if( !sp3C + || player_is_in_jiggy_jig() + || func_80386ED0(this) + || !timedFuncQueue_is_empty() + || func_803872EC() + ){ + func_80328B8C(this, 1, 0.0f, 1); + } + break; + + case 2: //L80387D0C + actor_playAnimationOnce(this); + if(actor_animationIsAt(this, 0.99f)){ + func_80328B8C(this, 1, 0.0f, 1); + } + break; + + case 8: //L80387D4C + actor_playAnimationOnce(this); + if(actor_animationIsAt(this, 0.99f)){ + func_80328B8C(this, 3, 0.0f, 1); + func_80311480(ASSET_B38_TEXT_CONGA_DEFEAT, 0xe, this->position, this->marker, func_80387370, NULL); + } + break; + + case 3: //L80387DB8 + actor_loopAnimation(this); + if(jiggyscore_isCollected(JIGGY_A_MM_CONGA)){ + func_80328B8C(this, 1, 0.0f, 1); + } + break; + + case 7: //L80387DF0 + if(this->unk10_12 == 0){ + if(actor_animationIsAt(this, 0.97f)){ + ((ActorLocal_Conga *)&this->local)->unkC = 1; + func_80328B8C(this, 6, 0.0f, 1); + } + } + break; + }//L80387E38 + if( (this->state == 4 && actor_animationIsAt(this, 0.56f)) + || (this->state == 7 && actor_animationIsAt(this, 0.468f)) + ){ + func_8034A1B4(this->marker->unk44, 5, &this->local); + func_802C3C88((GenMethod_1)func_803873C8, (s32)this->marker); //spawn orange + } +} diff --git a/src/MM/ch/grublin.c b/src/MM/ch/grublin.c new file mode 100644 index 00000000..9b345c80 --- /dev/null +++ b/src/MM/ch/grublin.c @@ -0,0 +1,91 @@ +/*!!!DONE!!!*/ +#include +#include "functions.h" +#include "variables.h" + +typedef struct chgrublin_s{ + f32 unk0; + f32 unk4; + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; + u32 unkC_31:3; + u32 unkC_28:1; + u32 padC_27:28; + s16 unk10; + s16 unk12; + f32 unk14; //90 + u8 unk18[0x18]; + s32 unk30; + void (*unk34)(ActorMarker *, s32); +}ActorLocal_Grublin; + +void func_80328B8C(Actor *, s32, f32, s32); + +void func_80388A80(Actor *); + +/* .data */ +ActorAnimationInfo chGrublinAnimations[11] = { + {0, 0.0f}, + {0x62, 4.0f}, + {0x62, 0.7f}, + {0x63, 0.7f}, + {0x64, 0.9f}, + {ASSET_94_ANIM_GRUBLIN_DIE, 1.0f}, + {0x62, 1.5f}, + {0x63, 0.5f}, + {0x62, 1.5f}, + {0x62, 1000000.0f}, + {0x62, 1000000.0f} +}; + +ActorInfo chgrublinInfo = { MARKER_5_GRUBLIN, ACTOR_6_GRUBLIN, ASSET_3C5_MODEL_GRUBLIN, + 1, chGrublinAnimations, + func_80388A80, func_80326224, func_80325888, + 2500, 0, 1.0f, 0 +}; + +/* .code */ +void func_803889A0(ActorMarker *this, s32 arg1){ + Actor *actorPtr; + + actorPtr = marker_getActor(this); + func_80328B8C(actorPtr, 5, 0.0f, 1); + actor_playAnimationOnce(actorPtr); + FUNC_8030E8B4(SFX_C2_GRUBLIN_EGH, 1.0f, 32000, actorPtr->position, 1250, 2500); + + actor_collisionOff(actorPtr); +} + +void func_80388A04(Actor *this){ + ActorLocal_Grublin *local = (ActorLocal_Grublin *)&this->local; + local->unk0 = 1.5f; + local->unk4 = 2.3f; + local->unk8 = 5; + local->unk9 = 7; + local->unkC_31 = 2; + local->unkA = 9; + local->unkB = 9; + local->unk10 = 0x29; + local->unk12 = 25000; + local->unkC_28 = 1; + local->unk30 = 0; + local->unk34 = func_803889A0; + local->unk14 = 1.0f; +} + +void func_80388A80(Actor *this) { + if (!this->unk16C_4){ + func_80388A04(this); + } + func_802DB5A0(this); + if (this->state == 5) { + if (actor_animationIsAt(this, 0.18f)) { + FUNC_8030E8B4(SFX_2_CLAW_SWIPE, 1.0f, 28000, this->position, 1250, 2500); + } + if (actor_animationIsAt(this, 0.7f)) { + FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 1.0f, 28000, this->position, 1250, 2500); + } + } +} diff --git a/src/MM/ch/hut.c b/src/MM/ch/hut.c new file mode 100644 index 00000000..3c02a056 --- /dev/null +++ b/src/MM/ch/hut.c @@ -0,0 +1,121 @@ +/*!!!DONE!!!*/ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + + + +/* extern function declarations */ + +void func_802C8F70(f32); +void func_802C4218(s32, s32, s32, s32); + +/* public function declarations */ +Actor *chhut_draw(ActorMarker *, Gfx **, Mtx**, Vtx **); +void chhut_update(Actor *); + +/* .bss */ +extern s32 D_8037DCB0; //mm_hut_smash_count + + +/* .data */ +ActorAnimationInfo chhutAnimations[3] = { + {0, 0.0f}, + {0x4E, 0.25f}, + {0x4E, 1000000.0f} +}; + +s32 D_803898D8[6] = { 0, 1, 2, 3, 6, 4}; + +ActorInfo chhutInfo = { MARKER_51_MM_HUT, ACTOR_9_MM_HUT, ASSET_7D7_MODEL_MM_HUT, + 0, chhutAnimations, + chhut_update, func_80326224, chhut_draw, + 0, 0x100, 0.0f, 0 +}; + + +/* .code */ +Actor *chhut_draw(ActorMarker *this, Gfx **arg1, Mtx **arg2, Vtx **arg3){ + Actor *actorPtr; + s32 temp_a1; + s32 temp_a2; + + actorPtr = marker_getActor(this); + + temp_a1 = actorPtr->state != 2; + temp_a2 = actorPtr->state == 0 || actorPtr->state == 2; + this->propPtr->unk8_3 = temp_a2; + func_8033A45C(1, temp_a1, temp_a2); + + return func_80325888(this, arg1, arg2, arg3); +} + +void func_803869EC(ActorMarker *this){ + Actor * actorPtr; + f32 *pos; + + actorPtr = marker_getActor(this); + actorPtr = func_8032813C(0x4B, actorPtr->position, 0); + func_8032813C(ACTOR_4D_STEAM_2, actorPtr->position, 0); + + if(this); +} + +void chhut_update(Actor *this){ + f32 sp3C[3]; + f32 sp30[3]; + + if(func_80334904() != 2) + return; + + if(!this->initialized){ + this->marker->collidable = 0; + this->initialized = 1; + } + switch(this->state){ + case 0: //L80386AA4 + player_getPosition(sp30); + sp3C[0] = sp30[0] - this->position_x; + sp3C[1] = sp30[1] - this->position_y; + sp3C[2] = sp30[2] - this->position_z; + if(150.0f < sp3C[1] + && player_getActiveHitbox(this->marker) == HITBOX_1_BEAK_BUSTER + && func_8028F20C() + && gu_sqrtf(sp3C[0]*sp3C[0] + sp3C[1]*sp3C[1] + sp3C[2]*sp3C[2]) < 350.0f + ){ + sp3C[0] = this->position_x; + sp3C[1] = this->position_y; + sp3C[2] = this->position_z; + sp3C[1] += 125.0; + func_8030E484(SFX_5B_HEAVY_STUFF_FALLING); + func_80328A84(this, 1); + actor_playAnimationOnce(this); + func_802C3C88((GenMethod_1)func_803869EC, (s32)this->marker); + func_802C8F70(this->yaw); + if(D_8037DCB0 < 5){ + func_802C3F04(func_802C4218, D_803898D8[D_8037DCB0], *(s32*)(&sp3C[0]),*(s32*)(&sp3C[1]),*(s32*)(&sp3C[2])); + } + else{ + jiggySpawn(JIGGY_5_MM_HUTS, sp3C); + } + D_8037DCB0 = ( D_8037DCB0 + 1 ) % 6; + } + break; + case 1: //L80386C2C + if(animctrl_getAnimTimer(this->animctrl) > 0.99){ + animctrl_setTransitionDuration(this->animctrl, 0.0f); + func_80328A84(this, 2); + this->position_y -= 160.0f; + } + break; + case 2: //L80386C80 + break; + } + +} + +void func_80386C90(void){ + D_8037DCB0 = 0; +} diff --git a/src/MM/ch/juju.c b/src/MM/ch/juju.c new file mode 100644 index 00000000..c8cd9093 --- /dev/null +++ b/src/MM/ch/juju.c @@ -0,0 +1,227 @@ +#include +#include "functions.h" +#include "variables.h" + +/* extern functions */ +int func_80353064(f32*, f32); +void func_802BB3DC(s32, f32, f32); + +typedef struct{ + s32 unk0; + s32 unk4; + TUPLE(f32, unk8); + f32 unk14; + s32 unk18; +}ActorLocal_Juju_2; + +/* public functions */ +void func_80389598(Actor *this); +Actor* func_80389014(ActorMarker *, Gfx **, Mtx**, Vtx** ); + +extern s32 D_80389C90; + +/* .data */ +ActorInfo chjujuInfo = { MARKER_67_JUJU, ACTOR_59_JUJU, ASSET_2E6_MODEL_JUJU, + 0, NULL, + func_80389598, func_80326224, func_80389014, + 0, 0, 0.0f, 0 +}; + +void func_80388FD0(Actor *this, f32 *arg1, f32 *arg2, s32 arg3){ + ActorLocal_Juju_2 *local; + + local = (ActorLocal_Juju_2 *)&this->local; + local->unk0 = arg3; + local->unk14 = 1.0f; + + this->position_x = arg1[0]; + this->position_y = arg1[1]; + this->position_z = arg1[2]; + + local->unk8_x = arg2[0]; + local->unk8_y = arg2[1]; + local->unk8_z = arg2[2]; +} + +Actor* func_80389014(ActorMarker *this, Gfx **dl, Mtx **mPtr, Vtx **arg2){ + f32 sp34[3]; + Actor * actorPtr; + ActorLocal_Juju_2 *jujuPtr; + + actorPtr = func_80325300(this, sp34); + jujuPtr = (ActorLocal_Juju_2 *)&actorPtr->local; + if(jujuPtr->unk0 != 2){ + set_model_render_mode(1); + func_803391A4(dl, mPtr, actorPtr->position, sp34, jujuPtr->unk14, NULL, func_80330B1C(this)); + } + return actorPtr; +} + +void func_803890A0(ActorMarker *arg0, s32 arg1){ + int s1; + Actor* actorPtr = marker_getActor(arg0); + f32 sp5C[3]; + s32 i; + Actor* jujuPtr; + + sp5C[0] = actorPtr->position_x; + sp5C[1] = actorPtr->position_y; + sp5C[2] = actorPtr->position_z; + for(i = 0; i < 4; i++){ + jujuPtr = func_8032813C(ACTOR_59_JUJU, actorPtr->position, actorPtr->yaw); + jujuPtr->marker->collidable = 0; + actorPtr = marker_getActor(arg0); + func_80388DE8(actorPtr, i, jujuPtr); + s1 = (i >= arg1); + func_80388FD0(jujuPtr, sp5C, actorPtr->position, (s1)? 1 : 2); + if(s1){ + sp5C[1] += 250.0f; + } + if(i == arg1){ + ((ActorLocal_Juju_2 *)&jujuPtr->local)->unk18 = 1; + } + } +} + +void func_803891E8(s32 x, s32 y, s32 z, s32 yaw){ + f32 sp1C[3]; + sp1C[0] = x; + sp1C[1] = y + 0x14; + sp1C[2] = z; + jiggySpawn(JIGGY_4_MM_JUJU, sp1C); +} + +void func_80389244(s32 x, s32 y, s32 z, s32 yaw){ + func_802C3F04(func_803891E8, x, y, z, yaw); + func_802BB3DC(0, 10.0f, 0.8f); + func_80314AC8(1); +} + +void func_803892A8(ActorMarker **ptr){ + s32 i; + s32 j; + s32 s2; + s32 s6; + Actor *actorPtr; + ActorLocal_Juju_2 *jujuPtr; + + for(i = 0; i < 4; i++){ + actorPtr = marker_getActor(ptr[i]); + jujuPtr = (ActorLocal_Juju_2 *)&actorPtr->local; + if(jujuPtr->unk0 != 2){ + jujuPtr->unk0 = 5; + jujuPtr->unk4 = 0xC; + func_8030E484(0x3f6); + if(i == 3){ + func_80314AC8(0); + timedFunc_set_4(1.25f, func_80389244, jujuPtr->unk8_x, jujuPtr->unk8_y, jujuPtr->unk8_z, actorPtr->yaw); + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x6d60); + } + else{//L80389384 + func_8025A6EC(COMUSIC_2B_DING_B, 0x7fff); + } + for(s2 = 3, j = i + 1; j < 4; s2+=5, j++){ + actorPtr = marker_getActor(ptr[j]); + jujuPtr = (ActorLocal_Juju_2 *)&actorPtr->local; + if(j == i+1){ + jujuPtr->unk18 = 1; + } + jujuPtr->unk4 = s2; + jujuPtr->unk0 = 3; + + } + return; + } + } +} + +int func_8038941C(ActorMarker **ptr){ + s32 i; + ActorLocal_Juju_2 *jujuPtr; + + for(i = 0; i < 4; i++){ + jujuPtr = (ActorLocal_Juju_2 *)&marker_getActor(ptr[i])->local; + if(jujuPtr->unk0 != 2) + return 0; + } + return 1; +} + +int func_8038948C(ActorMarker **ptr){ + s32 i; + ActorLocal_Juju_2 *jujuPtr; + + for(i = 0; i < 4; i++){ + jujuPtr = (ActorLocal_Juju_2 *)&marker_getActor(ptr[i])->local; + if(jujuPtr->unk0 != 1 && jujuPtr->unk0 != 2) + return 0; + } + return 1; +} + +void func_80389514(ActorMarker **ptr){ + s32 i; + D_80389C90 = 0; + for(i = 0; i < 4; i++){ + if(((ActorLocal_Juju_2 *)&marker_getActor(ptr[i])->local)->unk0 != 2){ + D_80389C90++; + }; + } +} + +void func_80389598(Actor *this){ + ActorLocal_Juju_2 *jujuPtr = (ActorLocal_Juju_2 *)&this->local; + s32 sp38 = 0; + f32 sp34; + f32 sp28[3]; + + this->marker->propPtr->unk8_3 = (jujuPtr->unk0 != 2) && (jujuPtr->unk0 != 5); + + switch(jujuPtr->unk0){ + case 1: //L80389624 + sp34 = this->yaw; + this->yaw += ((0xb - D_80389C90*2)*time_getDelta()*60.0f)/2; + if(360.0f < this->yaw){ + sp38 = 1; + this->yaw -= 360.0f; + }//L803896B4 + if(jujuPtr->unk18){ + if(sp38 || (sp34 < 180.0f && 180.0f <= this->yaw)){ + mapSpecificFlags_set(9,1); + } + } + break; + case 3: //L80389700 + if(--jujuPtr->unk4 == 0){ + jujuPtr->unk0 = 4; + jujuPtr->unk8_y = this->position_y - 250.0f; + } + break; + case 5: //L80389738 + jujuPtr->unk4--; + jujuPtr->unk14 *= 0.85; + {sp28[0] = 100.0f; + sp28[1] = 0.0f; + sp28[2] = 0.0f;} + ml_vec3f_yaw_rotate_copy(sp28, sp28, this->yaw + 90.0); + this->position_x += sp28[0]; + this->position_y += sp28[1]; + this->position_z += sp28[2]; + if(!jujuPtr->unk4){ + jujuPtr->unk0 = 2; + } + break; + case 4: //L803897F8 + this->position_y -= 25.0; + if(jujuPtr->unk8_y == this->position_y){ + jujuPtr->unk0 = 1; + func_8030E484(SFX_3_DULL_CANNON_SHOT); + func_802BB3DC(0, 10.0f, 0.8f); + if(jujuPtr->unk18) + func_80353064(this->position, 24.0f); + } + break; + + }//L8038987C +} + diff --git a/src/MM/ch/jujuhitbox.c b/src/MM/ch/jujuhitbox.c new file mode 100644 index 00000000..a090fa5c --- /dev/null +++ b/src/MM/ch/jujuhitbox.c @@ -0,0 +1,161 @@ +/*!!!DONE!!!*/ +#include +#include "functions.h" +#include "variables.h" + +/* extern functions */ +void func_80388DFC(ActorMarker *, s32); +s32 func_80329784(Actor *); +void func_80353580(ActorMarker *); + +typedef struct juju_hitbox_s{ + u8 pad0[0x4]; + s32 unk4; + ActorMarker *unk8[4]; + f32 unk18; +}ActorLocal_JujuHitbox; + +/* public functions */ +void func_80388E20(Actor *this); +Actor* func_80388DC0(ActorMarker *, Gfx **, Mtx**, Vtx **); +void func_80388DE8(Actor* this, s32 slave_id, Actor *slavePtr); + +/* .data */ +ActorInfo chjujuhitboxInfo = { MARKER_67_JUJU, ACTOR_11_JUJU_CTRL, 0, + 3, NULL, + func_80388E20, func_80326224, func_80388DC0, + 0, 0, 0.0f, 0 +}; + +int func_80388B30(Actor *this, float arg1){ + f32 yaw; + + yaw = this->yaw - func_80329784(this); + + if(180.0f <= yaw){ + yaw -= 360.0f; + } + else if(yaw < -180.0f){ + yaw += 360.0f; + } + + if (yaw < 0.0f){ + yaw = -yaw; + } + + if (yaw < arg1){ + return 1; + } + return 0; +} + +void func_80388BEC(s16 *arg0, ActorMarker *arg1){ + f32 sp34; + Actor *sp30; + Actor *temp_v0; + f32 sp20[3]; + + + sp20[0] = (f32)arg0[0]; + sp20[1] = (f32)arg0[1]; + sp20[2] = (f32)arg0[2]; + sp30 = func_80326D68(sp20, 0x11, -1, &sp34); + if( sp30 != NULL + && !( sp34 > 500.0f ) + && (sp30->state ==3) + ){ + temp_v0 = marker_getActor(((ActorLocal_JujuHitbox *)&sp30->local)->unk8[((ActorLocal_JujuHitbox *)&sp30->local)->unk4]); + if(temp_v0 != NULL){ + if(func_80388B30(temp_v0, 90.0f)){ + sp30->state = 1; + ((ActorLocal_JujuHitbox *)&sp30->local)->unk4++; + func_803892A8(((ActorLocal_JujuHitbox *)&sp30->local)->unk8); + func_80353580(arg1); + func_802C3F04((GenMethod_4)func_802C4140, 0x58, *(s32 *)&sp20[0], *(s32 *)&sp20[1], *(s32 *)&sp20[2]); + } + } + } +} + +void func_80388D14(Actor *this){ + ActorLocal_JujuHitbox *jujuCtlPtr; + + jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local; + func_8030E878(0x3F6, jujuCtlPtr->unk18, 20000, this->position, 300.0f, 2000.0f); +} + +void func_80388D60(Actor *this){ + ActorLocal_JujuHitbox *jujuCtlPtr; + + jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local; + if(!func_8038941C(jujuCtlPtr->unk8)){ + jujuCtlPtr->unk18 *= 1.05; + } + this->state = 3; +} + +Actor* func_80388DC0(ActorMarker *this, Gfx **dl, Mtx**mPtr, Vtx **arg3){ + return marker_getActor(this); +} + +void func_80388DE8(Actor *this, s32 child_id, Actor *childPtr){ + ActorLocal_JujuHitbox *jujuCtlPtr; + + jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local; + jujuCtlPtr->unk8[child_id] = childPtr->marker; +} + +void func_80388DFC(ActorMarker *arg0, s32 arg1){ + func_803890A0(arg0, arg1); + + if(arg0 && arg1); //for args to save +} + +void func_80388E20(Actor *this){ + ActorLocal_JujuHitbox *jujuCtlPtr; + s32 i; + + jujuCtlPtr = (ActorLocal_JujuHitbox *)&this->local; + if(!this->initialized){ + this->initialized = 1; + this->unk138_24 = 0; + jujuCtlPtr->unk18 = 0.5f; + } + if(!this->unk16C_4){ + this->unk16C_4 = 1; + func_802C3D3C(func_80388DFC,this->marker, jujuCtlPtr->unk4); + func_80388D14(this); + }else{ + if( func_80329530(this, 0xfa) + && !func_80329530(this, 0x50) + && !func_8028ECAC() + ){ + if( !this->unk138_24 ){ + if(func_80311480(ASSET_B44_TEXT_JUJU_MEET, 0, 0, 0, NULL, NULL)){ + this->unk138_24 = 1; + } + } + } + + if(this->state == 1){ + if(func_8038948C(jujuCtlPtr->unk8)){ + func_80388D60(this); + } + if(func_8038941C(jujuCtlPtr->unk8)){ + marker_despawn(this->marker); + for(i = 0; i < 4; i++){ + marker_despawn(jujuCtlPtr->unk8[i]); + } + return; + } + } + else{ + func_80389514(jujuCtlPtr->unk8); + } + + if(mapSpecificFlags_get(0x9)){ + func_80388D14(this); + mapSpecificFlags_set(0x9, 0); + } + } +} diff --git a/src/MM/ch/lmonkey.c b/src/MM/ch/lmonkey.c new file mode 100644 index 00000000..ff7684b2 --- /dev/null +++ b/src/MM/ch/lmonkey.c @@ -0,0 +1,138 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8028E668(f32 *, f32, f32, f32); +int actor_animationIsAt(Actor *, f32); +void func_80328B8C(Actor *, s32, f32, s32); +void func_80324E88(f32); +void func_80324E38(f32,s32); +void timed_setCameraToNode(f32, s32); +s32 func_8028F31C(f32 *, f32, s32, Actor **); +void func_8028FA34(s32, Actor *); + + +void func_803885D0(Actor *); + +/* .data */ +ActorAnimationInfo chlmonkeyAnimations[5] = { + {0, 0.0f}, + {0x5C, 2.3f}, + {0x5B, 0.67f}, + {0x5D, 0.5f}, + {0x5C, 2.3f} +}; + +ActorInfo chlmonkeyInfo = { MARKER_A_CHIMPY, ACTOR_F_CHIMPY, ASSET_35D_MODEL_CHIMPY, + 1, chlmonkeyAnimations, + NULL, func_803885D0, func_80325888, + 2500, 0, 0.8f, 0 +}; + +/* .code */ +void func_80388300(Actor **arg0){ + func_8028F31C((*arg0)->position, 800.0f, ACTOR_29_ORANGE_COLLECTABLE, arg0); + if( func_80329530(*arg0, 0x159) + && func_8028E88C() == 0x36 + && func_8028FC34() + ){ + func_8028FA34(0xc6, *arg0); + (*arg0)->unk138_24 = 1; + timed_setCameraToNode(1.2f, 0xF); + func_80324E38(1.2f, 3); + } + if(arg0); +} + +void func_803883AC(Actor *this){ + f32 sp2C; + f32 sp28; + static D_80389A5C = 0; + + + sp2C = ml_map_f(func_8032970C(this), 1000000.0f, 343000000.0f, 18000.0f, 0.0f); + sp28 = randf(); + D_80389A5C--; + if(D_80389A5C < 0){ + if(randf() < 0.2){ + D_80389A5C = 6; + func_8030E6A4(((sp28 < 0.5) ? SFX_58_CHIMPY_NOISE_1 : SFX_59_CHIMPY_NOISE_2 ), randf()*0.25 + 0.85, sp2C); + } + } +} + +void func_803884C0(s32 x, s32 y, s32 z){ + f32 sp1C[3]; + TUPLE_ASSIGN(sp1C, x, y, z); + jiggySpawn(JIGGY_9_MM_CHIMPY, sp1C); +} + +void func_80388514(ActorMarker *marker, enum asset_e arg1, s32 arg2){ + Actor * actor = marker_getActor(marker); + mapSpecificFlags_set(4,1); + func_80328A84(actor, 3); + timed_setCameraToNode(2.3f, 0x12); + timedFunc_set_3(2.9f,func_803884C0, actor->position_x, actor->position_y + 150.0f, actor->position_z); + func_80324E88(4.3f); + func_80324E38(4.3f, 0); +} + +void func_803885D0(Actor *this){ + func_8028E668(this->position, 35.0f, 0.0f, 65.0f); + actor_collisionOff(this); + this->marker->propPtr->unk8_3 = 1; + if(map_get() != MAP_2_MM_MUMBOS_MOUNTAIN){ + func_80343DEC(this); + }else{//L80388630 + if(func_80329530(this, 0x2BC) && !func_803114B0()){ + func_803883AC(this); + }//L8038865C + switch(this->state){ + case 1://L80388690 + if(mapSpecificFlags_get(2)){ + func_80328A84(this, 4); + if(!jiggyscore_isCollected(JIGGY_9_MM_CHIMPY)){ + func_80311480(0xB40, 0xE, this->position, this->marker, func_80388514, NULL); + }else{//L803886E8 + func_80388514(this->marker, 0xB40, -1); + }//L80388898 + }else{ + func_80388300(&this); + if( func_80329530(this, 0x159) + && !func_80329530(this, 0x96) + && !item_getCount(ITEM_19_ORANGE) + && !this->unk138_24 + ){ + func_80311480(0xb3f, 0xe, this->position, NULL, NULL, NULL); + this->unk138_24 = 1; + }//L80388774 + actor_loopAnimation(this); + func_80328BD4(this, 2, 0.0f, -1, 0.02f); + } + break; + case 2: //L803887A4 + func_80388300(&this); + actor_playAnimationOnce(this); + if(actor_animationIsAt(this, 0.99f)){ + func_80328B8C(this,1,0.0f,-1); + } + break; + case 4: //L803887E4 + actor_loopAnimation(this); + break; + case 3: //L803887F4 + func_80343DEC(this); + actor_loopAnimation(this); + if(0.19 <= this->unk48){ + mapSpecificFlags_set(0, 1); + } + if(0.24 <= this->unk48){ + mapSpecificFlags_set(3, 1); + } + if(0.99 <= this->unk48){ + marker_despawn(this->marker); + } + break; + } + }//L80388898 +} diff --git a/src/MM/ch/orange.c b/src/MM/ch/orange.c new file mode 100644 index 00000000..646f2ad9 --- /dev/null +++ b/src/MM/ch/orange.c @@ -0,0 +1,97 @@ +/*!!!DONE!!!*/ +#include +#include "functions.h" +#include "variables.h" + +#ifndef MIN +#define MIN(s,t) ((s < t)?(s):(t)) +#endif + +/* extern functions */ +f32 func_80309724(f32*); + +/* public functions */ +void func_80387FF4(Actor *this); +Actor* func_80388188(ActorMarker *, Gfx **, Mtx**, Vtx**); + +/* .data */ +ActorInfo chorangeInfo = { MARKER_C_ORANGE_PROJECTILE, ACTOR_14_ORANGE_PROJECTILE, ASSET_2D2_MODEL_ORANGE, + 1, NULL, + func_80387FF4, func_80326224, func_80388188, + 0, 0, 0.6f, 0 +}; + +f32 D_803899F4[3] = {0.0f,-8.0f, 0.0f}; +f32 D_80389A00[3] = {0.0f, 0.0f, 0.0f}; + +void func_80387F90(ActorMarker *arg0, ActorMarker *other_marker){ + if( !func_8028F22C(arg0) + && !mapSpecificFlags_get(mapflag_mm_main_hit_with_orange) + && func_80311480(ASSET_B3A_TEXT_CONGA_HITS_PLAYER, 0, 0, 0, NULL, NULL) + ){ + mapSpecificFlags_set(mapflag_mm_main_hit_with_orange, 1); + } + + if(arg0); +} + +void func_80387FF4(Actor * this){ + f32 temp_f2; + f32 temp_f0; + + if(!this->initialized){ + this->marker->unk2C_1 = 1; + marker_setCollisionScripts(this->marker, NULL, func_80387F90, NULL); + } + switch(this->state){ + case 1://L80388060 + this->position_x += this->velocity_x; + temp_f0 = this->velocity_y - 5.0; + this->velocity_y = temp_f0; + this->position_y += temp_f0; + this->position_z += this->velocity_z; + + + temp_f2 = func_80309724(this->position); + if(this->position_y < temp_f2){ + this->position_y = temp_f2; + this->unk1C_y = temp_f2; + func_8030E6D4(SFX_2F_ORANGE_SPLAT); + + this->unk28 = 1.0f; + this->unk60 = 340.0f; + this->state = 2; + } + break; + case 2://L8038810C + if(this->unk60 < 324.0){ + this->marker->collidable = 0; + } + this->unk60 -= 4.0; + if(this->unk60 < 4.0){ + marker_despawn(this->marker); + } + break; + } +} + +Actor *func_80388188(ActorMarker *this, Gfx **dl, Mtx **mptr, Vtx **vtx){ + Actor* actorPtr = func_80325E78(this, dl, mptr, vtx); + f32 sp60[3] = D_803899F4; + f32 sp54[3] = D_80389A00; + f32 sp48[3]; + + if(actorPtr->state == 2){ + sp48[0] = actorPtr->position_x; + sp48[1] = actorPtr->unk1C_y + 3.0f; + sp48[2] = actorPtr->position_z; + func_8033A410( (s32) MIN(255.0f, actorPtr->unk60) ); + set_model_render_mode(1); + func_803391A4(dl, mptr, sp48, sp54, actorPtr->unk28, sp60, func_8030A428(0x18)); + actorPtr->position_y -= 1.9; + if(actorPtr->unk28 < 2.428){ + actorPtr->unk28 += 0.1; + } + } + return actorPtr; +} diff --git a/src/MM/ch/orangepad.c b/src/MM/ch/orangepad.c new file mode 100644 index 00000000..50f4675d --- /dev/null +++ b/src/MM/ch/orangepad.c @@ -0,0 +1,141 @@ +#include +#include "functions.h" +#include "variables.h" + +/* extern functions */ +void func_80326224(Actor *); +void func_80329904(ActorMarker *, s32, void *); +extern void func_802EFA20(ParticleEmitter *, f32, f32); + + +/* public functions */ +void func_80386768(Actor *); + + + +/* .data */ +ActorInfo chorangepadInfo = { MARKER_66_ORANGE_PAD, ACTOR_57_ORANGE_PAD, ASSET_2EB_MODEL_ORANGE_PAD, + 0, NULL, + func_80386768, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +extern f32 D_80389B40; +extern f64 D_80389B48; + +/*.code */ +void func_803863F0(s32 x, s32 y, s32 z){ + f32 pos[3]; + + TUPLE_ASSIGN(pos, x, y, z); + + jiggySpawn(JIGGY_8_MM_ORANGE_PADS, pos); +} + +void func_80386444(ActorMarker *arg0){ + f32 sp54; + Actor *actor; + f32 sp44[3]; + ParticleEmitter *s0; + s32 temp_a0; + + sp44[0] = arg0->propPtr->x; + sp44[1] = arg0->propPtr->y; + sp44[2] = arg0->propPtr->z; + actor = func_80326D68(sp44, 0x57, 1, &sp54); + + + if(actor && !(500.0f < sp54)){ + actor->state = 1; + if(func_80326D68(sp44, 0x57, 1, &sp54)){ + func_8025A6EC(COMUSIC_2B_DING_B, 22000); + }else{ + temp_a0 = (actor->unk78_13 == 0x106) ? 0x10 : (actor->unk78_13 == 0x76) ? 0xf : 0xe; + + func_802BAFE4(temp_a0); + sp44[1] += 50.0f; + timedFunc_set_3(0.6f, (TFQM3) func_803863F0, (s32)sp44[0], (s32)sp44[1], (s32)sp44[2]); + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF); + if(!jiggyscore_isCollected(JIGGY_8_MM_ORANGE_PADS)){ + func_80311480(0xB3B, 4, NULL, NULL, NULL, NULL); + } + }// L803865D8 + + s0 = partEmitList_pushNew(0x1e); + particleEmitter_setPosition(s0, actor->position); + particleEmitter_setModel(s0, 0x89f); + func_802EFB70(s0, 0.09f, 0.19f); + func_802EFB84(s0, 0.0f, 0.0f); + + particleEmitter_setParticleVelocityRange(s0, + -200.0f, 500.0f, -200.0f, + 200.0f, 700.0f, 200.0f + ); + + particleEmitter_setParticleAccelerationRange(s0, + 0.0f, -1200.0f, 0.0f, + 0.0f, -1200.0f, 0.0f + ); + + func_802EFE24(s0, + -600.0f, -600.0f, -600.0f, + 600.0f, 600.0f, 600.0f + ); + particleEmitter_setSpawnIntervalRange(s0, 0.0f, 0.01f); + func_802EFEC0(s0, 4.0f, 4.0f); + func_802EF9F8(s0, 0.01f); + func_802EFA18(s0, 3); + func_802EFA20(s0, 1.0f, 1.3f); + particleEmitter_emitN(s0, 0x1e); + } +} + +void func_80386744(s32 arg0, ActorMarker *arg1) { + func_80386444(arg1); +} + +void func_80386768(Actor * this){ + Actor *sp3C; + f32 pad; + f32 sp34; + + + if(!this->initialized){ + this->marker->propPtr->unk8_3 = 1; + actor_collisionOff(this); + this->initialized = 1; + }//L803867B0 + + if(!this->unk16C_4){ + this->unk100 = func_80326D68(this->position, 8,-1, &sp34)->marker; + this->unk16C_4 = 1; + }//L803867E0 + + if(this->unk100){ + sp3C = marker_getActor(this->unk100); + } + + if( func_80329530(this, 0x28) + && !func_8028ECAC() + && !mapSpecificFlags_get(6) + && sp3C->state != 3 + ){ + if(func_80311480(0xb3d, 0, NULL, NULL, NULL, NULL)) + mapSpecificFlags_set(6,1); + } + + if(this->state == 1){ + if(this->unk60 < 72.0f){ + func_8033E73C(this->marker, 5, func_80329904); + func_8033E3F0(9, this->marker->unk14_21); + } + this->unk60 = MIN(255.0, this->unk60 + 7.0); + + if(255.0 == this->unk60){ + marker_despawn(this->marker); + } + }else{ + }//L80386928 + + actor_setOpacity(this, 0xFF - (s32)this->unk60); +}//*/ diff --git a/src/MM/code_1AD0.c b/src/MM/code_1AD0.c new file mode 100644 index 00000000..8fd4a676 --- /dev/null +++ b/src/MM/code_1AD0.c @@ -0,0 +1,34 @@ +//!!!DONE +#include +#include "functions.h" +#include "variables.h" + +u8 D_803899C0[] = {0x00, 0x0C, 0x74, 0x0C, 0xCD, 0x24, 0x9C, 0xB3, 0x00, 0x00, 0xD4, 0x4F}; + +void func_802D1724(void); + +void func_80387EC0(void) { + u32 *temp_v0; + u32 temp_a0; + + temp_v0 = (u32* )func_802D1724; + if (getGameMode() != 7) { + temp_a0 = (temp_v0[2] & 0x03FFFFFF)*4; //get offset + temp_a0 += (u32)&temp_v0[3] & 0xF0000000; //get region + ((u32 *)temp_a0)[0] = 0x03E00008; //jr $ra + ((u32 *)temp_a0)[1] = 0x24020002; //addiu $v0, $zero, 0x2 + + osWritebackDCache((void *)temp_a0, 8); + osInvalICache((void *)temp_a0, 8); + } +} + +void func_80387F44(void) { + s32 sp1C; + + osPiReadIo(0x578, (u32 *)&sp1C); + sp1C = sp1C & (sp1C ^ 0xFFFF0000); + if (sp1C != 0x8965){ + func_80387EC0(); + } +} diff --git a/src/MM/code_24C0.c b/src/MM/code_24C0.c new file mode 100644 index 00000000..949ae3bc --- /dev/null +++ b/src/MM/code_24C0.c @@ -0,0 +1,28 @@ +/*!!!DONE!!!*/ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + +extern ActorInfo chhutInfo; +extern ActorInfo chchimpystump; +extern ActorInfo chgrublinInfo; +extern ActorInfo chcongaInfo; +extern ActorInfo chorangeInfo; +extern ActorInfo chjujuhitboxInfo; +extern ActorInfo chjujuInfo; +extern ActorInfo chorangepadInfo; +extern ActorInfo chlmonkeyInfo; + +void func_803888B0(void){ + spawnableActorList_add( &chhutInfo, actor_new, 0X400); + spawnableActorList_add( &chchimpystump, actor_new, 0x0); + spawnableActorList_add( &chgrublinInfo, actor_new, 0X2000121); + spawnableActorList_add( &chcongaInfo, actor_new, 0X2000160); + spawnableActorList_add( &chorangeInfo, actor_new, 0x0); + spawnableActorList_add( &chjujuhitboxInfo, actor_new, 0x0); + spawnableActorList_add( &chjujuInfo, actor_new, 0X4004); + spawnableActorList_add( &chorangepadInfo, actor_new, 0X40); + spawnableActorList_add( &chlmonkeyInfo, actor_new, 0X100); +} diff --git a/src/MMM/ch/loggo.c b/src/MMM/ch/loggo.c new file mode 100644 index 00000000..04473b51 --- /dev/null +++ b/src/MMM/ch/loggo.c @@ -0,0 +1,123 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void ml_vec3f_assign(f32[3], f32, f32, f32); + +void chLoggo_update(Actor *this); + +/* .data */ +ActorAnimationInfo chLoggoAnimations[] = { + {0, 0.0f}, + {ASSET_238_ANIM_LOGGO_IDLE, 0.8f}, + {ASSET_240_ANIM_LOGGO_FLUSH, 3.0f} +}; + +ActorInfo chLoggo = { + MARKER_252_LOGGO, ACTOR_37F_LOGGO, ASSET_519_MODEL_LOGGO, + 0x1, chLoggoAnimations, + chLoggo_update, func_80326224, func_80325888, + 1000, 0, 0.0f, 0 +}; + +/* .code */ +void __chLoggo_flush(ActorMarker* marker) { + Actor* sp1C = marker_getActor(marker); + func_8028F918(2); + func_80328B8C(sp1C, 2, 0.01, 1); + actor_playAnimationOnce(sp1C); + sp1C->unk60 = 3.2f; +} + +void __chLoggo_textCallback(ActorMarker* caller, enum asset_e text_id, s32 arg3) { + __chLoggo_flush(caller); +} + +void __chLoggo_collide(ActorMarker* this_marker, ActorMarker *other_marker) { + Actor *this = marker_getActor(this_marker); + if ((player_getTransformation() == TRANSFORM_3_PUMPKIN) && !func_8031FF1C(BKPROG_89_ENTERED_LOGGO_AS_PUMPKIN)) { + if (func_80311480(ASSET_ADF_TEXT_ENTER_LOGGO, 0x2B, this->position, this->marker, &__chLoggo_textCallback, 0) != 0) { + actor_collisionOff(this); + + func_80320004(BKPROG_89_ENTERED_LOGGO_AS_PUMPKIN, TRUE); + } + return; + } + if ((player_getTransformation() == TRANSFORM_3_PUMPKIN) && func_8031FF1C(BKPROG_89_ENTERED_LOGGO_AS_PUMPKIN)) { + actor_collisionOff(this); + __chLoggo_flush(this_marker); + return; + } + + if ((player_getTransformation() == TRANSFORM_1_BANJO) && !func_8031FF1C(BKPROG_88_TRIED_LOGGO_AS_BEAR)){ + if(func_80311480(ASSET_ADE_TEXT_LOGGO_AS_BEAR, 0x2A, this->position, NULL, NULL, NULL)) { + func_80320004(BKPROG_88_TRIED_LOGGO_AS_BEAR, TRUE); + } + } +} + +void chLoggo_update(Actor *this){ + f32 sp44; + f32 sp38[3]; + s32 sp34; + + sp44 = time_getDelta(); + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOn(this); + marker_setCollisionScripts(this->marker, __chLoggo_collide, NULL, NULL); + func_80328B8C(this, 1, 0.01f, 1); + actor_loopAnimation(this); + this->unk60 = 0.0f; + if(!func_8031FF1C(BKPROG_8A_EXITED_LOGGO) && levelSpecificFlags_get(0x33)){ + if(func_80311480(ASSET_AE0_TEXT_EXIT_LOGGO, 4, NULL, NULL, NULL, NULL)){ + func_80320004(BKPROG_8A_EXITED_LOGGO, TRUE); + } + } + } + + switch(this->state){ + case 1: + sp34 = func_803114B0() ? 12000 : 0; + + if(actor_animationIsAt(this, 0.09f)){ + func_8030E878(SFX_109_LOGGO_LID_CLAP, randf2(0.975f, 1.025f), MAX(0, 22000 - sp34), this->position, 400.0f, 1000.0f); + break; + } + + if(actor_animationIsAt(this, 0.37f)){ + func_8030E878(SFX_20_METAL_CLANK_1, randf2(1.675f, 1.725f), MAX(0, 12000 - sp34), this->position, 400.0f, 1000.0f); + break; + } + + if(actor_animationIsAt(this, 0.6f)){ + func_8030E878(SFX_3F_CAULDRON_SQEAK_1, randf2(0.975f, 1.025f), MAX(0, 7000 - sp34), this->position, 400.0f, 1000.0f); + break; + } + + if(actor_animationIsAt(this, 0.16f)){ + func_8030E878(SFX_40_CAULDRON_SQEAK_2, randf2(0.975f, 1.025f), MAX(0, 7000 - sp34), this->position, 400.0f, 1000.0f); + break; + } + + break; + + case 2: + if(actor_animationIsAt(this, 0.46f)){ + this->marker->propPtr->unk8_3 = FALSE; + FUNC_8030E8B4(SFX_92_TOILET_FLUSH, 1.0f, 32000, this->position, 600, 1500); + levelSpecificFlags_set(0x33, TRUE); + ml_vec3f_assign(sp38, this->position_x - 50.0f, this->position_y + 50.0f, this->position_z); + func_8028F6E4(0x2F, sp38); + } + + if(0.0 < this->unk60){ + this->unk60 -= sp44; + } + else{ + func_8031F7D4(0, 0); + } + break; + } +} diff --git a/src/MMM/ch/motzhand.c b/src/MMM/ch/motzhand.c new file mode 100644 index 00000000..49b02517 --- /dev/null +++ b/src/MMM/ch/motzhand.c @@ -0,0 +1,202 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + f32 alpha; //motzhand_alpha + u8 *pattern_ptr; + u8 unk8; //pattern_id + u8 unk9; //end_current seq? + f32 unkC[3]; +}ActorLocal_Motzhand; + +void chmotzhand_update(Actor *this); +Actor *chMotzhand_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorInfo chMotzhand = { + MARKER_49_MOTZHAND, ACTOR_3A_MOTZHAND, ASSET_88C_MODEL_MOTZHAND, + 0x0, NULL, + chmotzhand_update, func_80326224, chMotzhand_draw, + 0, 0, 0.0f, 0 +}; + +u8 sMotzhandPattern1[] = {7, 14, 13, 9, 17, 0xFF}; +u8 sMotzhandPattern2[] = {10, 18, 15, 9, 14, 13, 9, 17, 11, 15, 0xFF}; + +/* .code */ +void func_80387410(f32 dst[3]){ + dst[0] = 0.0f; + dst[1] = 1500.0f; + dst[2] = -2400.0f; +} + +void chMotzhand_setState(Actor *this, s32 next_state){ + ActorLocal_Motzhand * local = (ActorLocal_Motzhand *) &this->local; + + if(next_state == 1 && this->state == 0){ + func_80335924(this->unk148, 0xa7, 0.0f, 1.8f); + func_80387410(this->position); + } + + if(next_state == 2){ + func_80335924(this->unk148, 0xA7, 0.9f, 1.8f); + } + + if(next_state == 3){ + func_80335924(this->unk148, 0xA8, 0.9f, 1.8f); + } + + if(next_state == 4){ + local->alpha = 1.0f; + } + + if(next_state == 5){ + marker_despawn(this->marker); + } + + this->state = next_state; +} + +Actor *chMotzhand_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + ActorLocal_Motzhand * local = (ActorLocal_Motzhand *) &this->local; + f32 sp3C[3]; + + if(this->state == 0 || this->state == 5) + return this; + + func_8033A238(func_803356A0(this->unk148)); + + if(this->state == 4){ + func_8033A410((s32) (local->alpha * 255.0f)); + } + else{ + func_8033A410((s32) 255); + } + + sp3C[0] = sp3C[1] = sp3C[2] = 0.0f; + sp3C[1] = 180.0f; + set_model_render_mode(1); + func_803391A4(gfx, mtx, this->position, sp3C, 1.0f, NULL, func_80330B1C(marker)); + this->marker->unk14_21 = func_8033A170(); + return this; +} + + +void func_80387654(ActorMarker* marker) { + Actor* actor = marker_getActor(marker); + + if ((actor->state != 4) && (actor->state != 5)) { + chMotzhand_setState(actor, 4); + } +} + +bool func_8038769C(ActorMarker *marker) { + return marker_getActor(marker)->state == 1; +} + +// chMotzhand_startPattern +void func_803876C8(ActorMarker *marker, s32 arg1){ + Actor *this = marker_getActor(marker); + ActorLocal_Motzhand * local = (ActorLocal_Motzhand *) &this->local; + + local->unk8 = arg1; + if(arg1 == TRUE){ + local->pattern_ptr = sMotzhandPattern1; + } + else{ + local->pattern_ptr = sMotzhandPattern2; + } + + chMotzhand_setState(this, 2); +} + +void func_80387720(ActorMarker *marker) { + Actor * this = marker_getActor(marker); + ActorLocal_Motzhand * local = (ActorLocal_Motzhand *) &this->local; + local->unk9 = TRUE; +} + +void chmotzhand_update(Actor *this){ + ActorLocal_Motzhand * local = (ActorLocal_Motzhand *) &this->local; + f32 sp48; + f32 sp3C[3]; + f32 sp30[3]; + + sp48 = time_getDelta(); + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(jiggyscore_isSpawned(JIGGY_60_MMM_MOTZHAND)){ + marker_despawn(this->marker); + return; + } + local->unk8 = FALSE; + local->unk9 = FALSE; + local->unkC[0] = this->position_x; + local->unkC[1] = this->position_y; + local->unkC[2] = this->position_z; + chMotzhand_setState(this, 1); + }//L803877CC + + if(this->state == 2){ + if(local->unk9){ + while(*local->pattern_ptr != 0xff){ + *local->pattern_ptr++; //find_seq end + } + local->unk9 = FALSE; + }//L80387820 + + if(0xff == *local->pattern_ptr){ + func_80387410(sp30); + } + else{ + func_80389BCC(*local->pattern_ptr, sp30); + sp30[0] += local->unkC[0]; + sp30[1] += local->unkC[1]; + sp30[2] += local->unkC[2]; + }//L80387880 + + sp3C[0] = sp30[0] - this->position_x; + sp3C[1] = sp30[1] - this->position_y; + sp3C[2] = sp30[2] - this->position_z; + if(gu_sqrtf(sp3C[0]*sp3C[0] + sp3C[1]*sp3C[1] + sp3C[2]*sp3C[2]) < 5.0f){ + if(*local->pattern_ptr == 0xff){ + chMotzhand_setState(this, 1); + } + else{ + chMotzhand_setState(this, 3); + } + } + else{//L80387930 + ml_vec3f_set_length(sp3C, ((local->unk8 == TRUE) ? 150.0f : 225.0f)*sp48); + this->position_x = sp3C[0] + this->position_x; + this->position_y = sp3C[1] + this->position_y; + this->position_z = sp3C[2] + this->position_z; + } + }//L803879A4 + + if(this->state == 3){ + if(func_80335794(this->unk148) > 0){ + func_80389D9C(*local->pattern_ptr); + if(local->unk9){ + while(*local->pattern_ptr != 0xff){ + *local->pattern_ptr++; //find_seq end + } + local->unk9 = FALSE; + } + else{//L80387A18 + *local->pattern_ptr++; + } + chMotzhand_setState(this, 2); + } + }//L80387A2C + + if(this->state == 4){ + local->alpha -= 0.25*sp48; + if(local->alpha <= 0.0f){ + chMotzhand_setState(this, 5); + } + } +} diff --git a/src/MMM/ch/napper.c b/src/MMM/ch/napper.c new file mode 100644 index 00000000..41b1bbc1 --- /dev/null +++ b/src/MMM/ch/napper.c @@ -0,0 +1,225 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + ActorMarker *jiggy_marker; + f32 unk4; + f32 unk8; + f32 unkC; + u8 unk10; +} ActorLocal_Napper; + +void chnapper_update(Actor *this); +Actor *chnapper_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorInfo chNapper = { + MARKER_48_NAPPER, ACTOR_39_NAPPER, ASSET_55E_MODEL_NAPPER, + 0x0, NULL, + chnapper_update, chnapper_update, chnapper_draw, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void __chnapper_setState(Actor *this, s32 next_state){ + ActorLocal_Napper *local = (ActorLocal_Napper *)&this->local; + + local->jiggy_marker->collidable = TRUE; + local->unk4 = 0.0f; + actor_collisionOff(this); + if(next_state == 1) + func_80335924(this->unk148, ASSET_A3_ANIM_NAPPER_SLEEPING, 0.2f, 2.5f); + + if(next_state == 2){ + func_80335924(this->unk148, ASSET_A4_ANIM_NAPPER_AWAKE, 0.2f, 5.0f); + actor_collisionOn(this); + local->jiggy_marker->collidable = FALSE; + local->unk8 = randf2(2.0f, 6.0f); + } + + if(next_state == 3){ + func_80335924(this->unk148, 0xA5, 0.2f, 1.5f); + func_80335A8C(this->unk148, 2); + func_8030E484(SFX_41_MUMBO_ERGHHH); + } + + if(next_state == 4){ + func_8030E484(SFX_C_TAKING_FLIGHT_LIFTOFF); + func_803895B0(0); + } + + if(next_state == 5){ + func_80335924(this->unk148, 0xA6, 2.0f, 4.0f); + actor_collisionOn(this); + local->jiggy_marker->collidable = FALSE; + } + + this->state = next_state; +} + +void func_80386ACC(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + + if(!this->unk138_24){ + if(func_80311480(0xad8, 0, NULL, NULL, NULL, NULL)){ + this->unk138_24 = TRUE; + } + } +} + +Actor *chnapper_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + ActorLocal_Napper *local = (ActorLocal_Napper *)&this->local; + + if(this->state == 1){ + func_8033A45C(1, TRUE); + func_8033A45C(2, FALSE); + func_8033A45C(3, FALSE); + } + else { + func_8033A45C(1, FALSE); + func_8033A45C(2, (local->unk10) ? TRUE : FALSE); + func_8033A45C(3, (local->unk10) ? FALSE : TRUE); + } + + if(this->state == 1){ //set model alpha + func_8033A410(0x80); + } + else{ + func_8033A410(0xdc); + } + + return func_80325888(marker, gfx, mtx, vtx); +} + +void chnapper_update(Actor *this){ + f32 sp74; + f32 sp70; + ActorLocal_Napper *local = (ActorLocal_Napper *)&this->local; + f32 sp68; + Actor *jiggy; + f32 sp58[3]; + f32 sp4C[3]; + s32 pad; + f32 player_position[3]; + f32 sp30[3]; + + sp68 = time_getDelta(); + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->scale = 0.5f; + marker_setCollisionScripts(this->marker, func_80386ACC, NULL, NULL); + local->unk10 = TRUE; + local->jiggy_marker = NULL; + local->unk4 = 0.0f; + local->unk8 = 0.0f; + local->unkC = 1.0f; + return; + }//L80386CBC + + if(this->state == 0){ + jiggy = func_80326EEC(ACTOR_46_JIGGY); + if(jiggy){ + local->jiggy_marker = jiggy->marker; + this->position_x = jiggy->position_x;\ + this->position_y = jiggy->position_y;\ + this->position_z = jiggy->position_z; + this->position_y -= 50.0f; + __chnapper_setState(this, 1); + } + else{ + marker_despawn(this->marker); + } + return; + } + + func_8033568C(this->unk148, &sp70, &sp74); + local->unk4 += sp68; + + if(this->state != 1){ + local->unkC -= sp68; + if(local->unkC <= 0.0f){ + local->unk10 = 1 - local->unk10; + if(local->unk10 == 0){ + local->unkC = randf2(0.1f, 0.2f); + + } + else{ + local->unkC = randf2(1.5f, 5.0f); + } + } + }//L80386DF4 + + if(this->state != 4){ + func_8024C5CC(sp58); + sp4C[0] = this->position_x - sp58[0]; + sp4C[1] = this->position_y - sp58[1]; + sp4C[2] = this->position_z - sp58[2]; + ml_vec3f_set_length(sp4C, 5.0f); + jiggy = marker_getActor(local->jiggy_marker); + jiggy->position_x = sp4C[0] + this->position_x; + jiggy->position_y = sp4C[1] + this->position_y; + jiggy->position_z = sp4C[2] + this->position_z; + }//L80386E98 + + if(this->state == 1){ + if(sp74 < sp70) + FUNC_8030E624(SFX_5E_BANJO_PHEWWW, 0.8f, 11000); + + if(sp70 < 0.5 && 0.5 <= sp74) + FUNC_8030E624(SFX_5D_BANJO_RAAOWW, 0.8f, 11000); + + if(!func_80389510()){ + __chnapper_setState(this, 2); + } + + if(func_80389530() || func_803203FC(0x1f)){ + __chnapper_setState(this, 3); + } + }//L80386F74 + + if(this->state == 2 && func_8025773C(&local->unk8, sp68)){ + player_getPosition(player_position); + sp30[0] = player_position[0] - this->position_x; + sp30[1] = player_position[1] - this->position_y; + sp30[2] = player_position[2] - this->position_z; + if( 0.0f < sp30[2] + && gu_sqrtf(sp30[0]*sp30[0] + sp30[1]*sp30[1] + sp30[2]*sp30[2]) < 600.0f + ){ + __chnapper_setState(this, 5); + } + else{//L8038703C + local->unk8 = randf2(1.0f, 2.0f); + } + }//L80387058 + + if(this->state == 5){ + if(4.0f <= local->unk4){ + __chnapper_setState(this, 2); + } + + if(sp70 < 0.35 && 0.35 <= sp74){ + if(!func_803114B0()){ + func_8030E6A4(SFX_3F5_UNKNOWN, randf2(0.9f, 1.1f), 0x7fff); + } + } + }//L803870F8 + + if(this->state == 3){ + if(func_80335794(this->unk148) > 0){ + func_80335924(this->unk148, ASSET_A4_ANIM_NAPPER_AWAKE, 1.0f, 5.0f); + func_80335A8C(this->unk148, 1); + } + + if(func_80389524()) + __chnapper_setState(this, 4); + }//L80387154 + + if(this->state == 4){ + func_80326224(this); + if(0.99 <= this->unk48) + marker_despawn(this->marker); + } +} \ No newline at end of file diff --git a/src/MMM/code_16B0.c b/src/MMM/code_16B0.c new file mode 100644 index 00000000..74220975 --- /dev/null +++ b/src/MMM/code_16B0.c @@ -0,0 +1,246 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80389484(ActorMarker *, f32); + +typedef struct { + f32 unk0; +}ActorLocal_PortraitChompa; + +void func_80388028(Actor *this); +Actor *func_80387AA0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +extern ActorInfo D_8038BAD0 = { + MARKER_254_PORTRAIT_CHOMPA, ACTOR_381_PORTRAIT_CHOMPA, ASSET_521_MODEL_PORTRAIT_CHOMPA, + 0x0, NULL, + func_80388028, NULL, func_80387AA0, + 0, 0, 0.0f, 0 +}; + +extern s32 D_8038BAF4[3]; +extern struct31s D_8038BB00; +extern struct43s D_8038BB28; +extern struct31s D_8038BB70; +extern struct43s D_8038BB98; + +/* .code */ +Actor *func_80387AA0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor* actor = marker_getActor(marker); + if ((actor->state == 0) || (actor->state == 1) || (actor->state == 6) || (actor->state == 2)) { + return actor; + } + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_80387B14(Actor *this, s32 next_state){ + ActorLocal_PortraitChompa *local = (ActorLocal_PortraitChompa *) &this->local; + f32 tmp = 2.5f; + this->marker->unk14_20 = 0x1d1; + + if(next_state == 1 || next_state == 2){ + func_80335924(this->unk148, 0x23e, 0.0f, 2.5f); + func_80335A74(this->unk148, 0.99f); + func_80335A8C(this->unk148, 4); + if(this->state == 4){ + local->unk0 = randf2(0.5f, 1.0f); + } + else{ + local->unk0 = 0.0f; + } + }//L80387BD0 + + if(this->state == 1 && next_state == 2){ + FUNC_8030E624(SFX_3EF, 0.9f, 32675); + } + + if(next_state == 3){ + local->unk0 = 0.2f; + } + + if(next_state == 4){ + this->marker->unk14_20 = 0x254; + func_80335924(this->unk148, 0x23e, 0.0f, 2.5f); + func_80335A8C(this->unk148, 2); + if(this->unk100){ + func_80389484(this->unk100, tmp + 0.55); + } + FUNC_8030E624(SFX_3EF, 1.1f, 25000); + FUNC_8030E624(SFX_3EF, 1.1f, 25000); + }//L80387CAC + + if(next_state == 5){ + func_8030E6D4(SFX_1E_HITTING_AN_ENEMY_2); + actor_collisionOff(this); + } + this->state = next_state; +} + + +void func_80387CF4(ActorMarker *this_marker, ActorMarker *other_marker) { + func_8030E6D4(0x1E); +} + +void func_80387D1C(ActorMarker* this_marker, ActorMarker *other_marker) { + Actor *this = marker_getActor(this_marker); + func_80387B14(this, 5); +} + +void func_80387D48(ActorMarker *marker){ + Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, marker)); + enum asset_e portrait_id; + Actor *portrait; + + switch(this->unkF4_8){ + case 0x32: + portrait_id = ACTOR_382_PORTRAIT_OF_GRUNTY; + break; + case 0x33: + portrait_id = ACTOR_384_PORTRAIT_OF_BLACKEYE; + break; + case 0x34: + portrait_id = ACTOR_385_PORTRAIT_OF_TOWER; + break; + case 0x35: + portrait_id = ACTOR_386_PORTRAIT_OF_TREE_AND_MOON; + break; + case 0x36: + portrait_id = ACTOR_387_PORTRAIT_OF_TEEHEE; + break; + case 0x37: + portrait_id = ACTOR_388_PORTRAIT_OF_MINION; + break; + default: + portrait_id = ACTOR_382_PORTRAIT_OF_GRUNTY; + break; + } + portrait = spawn_child_actor(portrait_id, &this); + portrait->yaw = this->yaw; + this->unk100 = portrait->marker; + portrait->unk10_1 = FALSE; +} + +void func_80387DF8(f32 position[3], s32 count, enum asset_e sprite_id) { + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(count); + func_802EFFA8(pCtrl, &D_8038BAF4); + particleEmitter_setSprite(pCtrl, sprite_id); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8038BB28); + func_802EFB98(pCtrl, &D_8038BB00); + particleEmitter_emitN(pCtrl, count); +} + +void func_80387E84(f32 position[3], s32 count, enum asset_e model_id) { + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(count); + particleEmitter_setModel(pCtrl, model_id); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8038BB98); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + func_802EF9F8(pCtrl, 0.4f); + func_802EFA18(pCtrl, 3); + func_802EFA20(pCtrl, 1.0f, 1.3f); + func_802EF9EC(pCtrl, 0x2F, 0x3E80); + func_802EFA70(pCtrl, 2); + func_802EFB98(pCtrl, &D_8038BB70); + particleEmitter_emitN(pCtrl, count); +} + +void func_80387F7C(Actor *this){ + f32 sp2C[3]; + f32 sp20[3]; + + if(!this->marker->unk14_21) return; + + func_8034A174(this->marker->unk44, 5, sp2C); + func_8034A174(this->marker->unk44, 6, sp20); + func_80387E84(sp2C, 1, ASSET_523_MODEL_PORTRAIT_CHOMPA_TEETH); + func_80387E84(sp2C, 1, ASSET_524_MODEL_PORTRAIT_CHOMPA_HEAD); + func_80387E84(sp20, 6, ASSET_525_MODEL_PORTRAIT_CHOMPA_PART); + func_80387DF8(sp2C, 2, ASSET_700_SPRITE_DUST); + func_80387DF8(sp20, 2, ASSET_700_SPRITE_DUST); +} + +void func_80388028(Actor *this){ + ActorLocal_PortraitChompa *local = (ActorLocal_PortraitChompa *) &this->local; + f32 sp58 = time_getDelta(); + f32 plyr_position[3]; + f32 plyr_dist; + f32 sp44; + f32 sp40; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->unk16C_0 = TRUE; + marker_setCollisionScripts(this->marker, NULL, func_80387CF4, func_80387D1C); + func_802C3C88(func_80387D48, this->marker); + func_80387B14(this, (this->state < 5) ? 1 : 6); + }//L803880B4 + + player_getPosition(plyr_position); + plyr_dist = ml_vec3f_distance(this->position, plyr_position); + + if(this->state == 4) + actor_collisionOn(this); + else + actor_collisionOff(this); + + + if(this->state == 1 && plyr_dist < this->scale*400.0f){ + func_80387B14(this, 2); + } + + if(this->state == 2){ + if(0.0f < local->unk0){ + local->unk0 -= sp58; + } + else if(plyr_dist < this->scale*300.0f){ + func_80387B14(this, 3); + } + else if(this->scale*500.0f < plyr_dist){ + func_80387B14(this, 1); + } + }//L80388204 + + if(this->state == 3){ + if(func_8025773C(&local->unk0, sp58)){ + func_80387B14(this, 4); + } + } + + if(this->state == 4){ + func_8033568C(this->unk148, &sp44, &sp40); + if(sp44 < 0.56 && 0.56 <= sp40){ + this->marker->unk14_20 = 0x1d1; + } + + if(sp44 < 0.5 && 0.5 <= sp40){ + FUNC_8030E624(SFX_2_CLAW_SWIPE, 0.9f, 32000); + } + + if( (sp44 < 0.11 && 0.11 <= sp40) + || (sp44 < 0.32 && 0.32 <= sp40) + || (sp44 < 0.53 && 0.53 <= sp40) + ){ + func_8030E6A4(SFX_6D_CROC_BITE, randf2(0.95f, 1.05f), 32000); + } + + if(sp44 < 0.9 && 0.9 <= sp40){ + func_8030E6D4(SFX_2_CLAW_SWIPE); + } + if(func_80335794(this->unk148) > 0){ + func_80387B14(this, 2); + } + } + + if(this->state == 5){ + func_8030E6D4(SFX_D7_GRABBA_DEATH); + func_80387F7C(this); + func_80387B14(this, 6); + } + +} diff --git a/src/MMM/code_2040.c b/src/MMM/code_2040.c new file mode 100644 index 00000000..fab04702 --- /dev/null +++ b/src/MMM/code_2040.c @@ -0,0 +1,421 @@ +#include +#include "functions.h" +#include "variables.h" +#include "SnS.h" + +extern ActorInfo D_8038BC28; +extern ActorInfo D_8038BCDC; +extern ActorInfo D_8038BC4C; +extern ActorInfo D_8038BDB4; +extern ActorInfo D_8038BDD8; +extern ActorInfo D_8038BDFC; +extern ActorInfo D_8038BC94; +extern ActorInfo D_8038BC70; +extern ActorInfo D_8038BD00; +extern ActorInfo D_8038BD24; +extern ActorInfo D_8038BD48; +extern ActorInfo D_8038BD6C; +extern ActorInfo D_8038BCB8; +extern ActorInfo D_8038BD90; +extern ActorInfo chNapper; +extern ActorInfo D_8038BA68; +extern ActorInfo chMotzhand; +extern ActorInfo chLoggo; +extern ActorInfo D_8038BAD0; +extern ActorInfo D_8038BE48; +extern ActorInfo D_8038BE6C; +extern ActorInfo D_8038BE90; +extern ActorInfo D_8038BEB4; +extern ActorInfo D_8038BED8; +extern ActorInfo D_8038BEFC; + +extern ActorInfo D_80367E70; +extern ActorInfo D_80372C3C; + +extern void func_80244BB0(s32, s32, s32, f32); +extern void func_8025AE0C(s32, f32); +extern void func_802EE6CC(f32[3], f32[3], s32[4], s32, f32, f32, s32, s32, s32); +extern void *func_80309B48(f32[3], f32[3], f32[3], u32); + +void func_802D3D54(Actor *this); +void func_803888B8(Actor *this); +Actor *func_80388994(ActorMarker *marker, Gfx ** gfx, Mtx **mtx, Vtx **vtx); +void func_80388BDC(Actor *this); +void func_80388FE4(Actor *this); +void func_80389004(Actor *this); +void func_80389060(Actor *this); +void func_803890B8(Actor *this); + +/* .data */ +ActorAnimationInfo D_8038BBE0[] = { + {0x00, 0.0f}, + {0x00, 0.0f}, + {0xD4, 0.15f}, + {0xD5, 0.5f}, + {0x00, 0.0f}, + {0x00, 0.0f}, + {0x00, 0.0f}, + {0x00, 0.0f}, + {0x00, 0.0f} +}; + +ActorInfo D_8038BC28 = { + 0x9C, 0x109, 0x3CD, + 0x1, NULL, + func_802D3D54, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BC4C = { + 0x9E, 0x10B, 0x3CF, + 0x1, NULL, + func_802D3D54, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BC70 = { + 0x9A, 0xCB, 0x3CC, + 0x1, NULL, + func_802D3D54, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BC94 = { + 0xA2, 0x114, 0x3D3, + 0x1, NULL, + func_80388BDC, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BCB8 = { + 0xE7, 0x265, 0x4DA, + 0x1, NULL, + func_80389004, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BCDC = { + 0x9D, 0x10A, 0x3CE, + 0x1, NULL, + func_80389004, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BD00 = { + 0xD3, 0x191, 0x50B, + 0x1, NULL, + func_80389060, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BD24 = { +0x123, 0x2E8, 0x4C0, + 0x1, NULL, + func_803890B8, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BD48 = { +0x1F2, 0x2E9, 0x4C1, + 0x1, NULL, + func_803890B8, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BD6C = { +0x1F3, 0x2EA, 0x4C2, + 0x1, NULL, + func_803890B8, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BD90 = { + 0xFE, 0x1FD, 0x43D, + 0x1, D_8038BBE0, + func_80388FE4, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BDB4 = { + 0x9F, 0x10C, 0x3D0, + 0x1, NULL, + func_803888B8, func_80326224, func_80388994, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BDD8 = { + 0xA0, 0x10D, 0x3D1, + 0x1, NULL, + func_803888B8, func_80326224, func_80388994, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BDFC = { + 0xFF, 0x1FE, 0x43E, + 0x1, NULL, + func_803888B8, func_80326224, func_80388994, + 0, 0, 0.0f, 0 +}; + +s32 D_8038BE20[4] = {0x87, 0x87, 0x87, 0xB4}; + +/* .code */ +f32 func_80388430(Actor *this, s32 arg1, s32 arg2, f32 arg3) { + f32 sp4C[3]; + f32 sp40[3]; + f32 sp34[3]; + + if (this->unk38_31 == 0) { + this->unk38_31 = 1; + this->unk1C[1] = 71.0f; + } + this->position[arg1] += (f32) (arg2 * 0x13); + + sp34[0] = sp4C[0] = this->position[0]; + sp4C[1] = this->position[1]; + sp34[2] = sp4C[2] = this->position[2]; + + this->position[1] += this->unk1C[1]; + this->unk1C[1] -= 8.0; + sp34[1] = this->position[1] - 400.0f; + if (this->unk1C[1] < 0.0f) { + if (func_80309B48(sp4C, sp34, sp40, 0) && (this->position[1] <= sp34[1])) { + this->position[1] = sp34[1] + 6.0f; + switch (this->unk38_31) { + case 1: + this->unk38_31 = 2; + this->unk1C[1] = 38.0f; + break; + case 2: + this->unk38_31 = 3; + this->unk1C[1] = 11.0f; + break; + case 3: + func_80328A84(this, 5); + break; + } + func_8030E878(SFX_82_METAL_BREAK, randf2(0.93f, 1.07f), 0x7FF8, this->position, 100.0f, 900.0f); + this->unk60 = 1.0f; + } + } + arg3 += 4.5; + return (arg3 >= 90.0f) ? 90.0f : arg3; +} + +bool func_80388670(ActorMarker * this_marker, ActorMarker * other_marker){ + Actor *this = marker_getActor(this_marker); + f32 sp20[3]; + + player_getPosition(sp20); + switch(this->marker->unk14_20){ + case 0x9f: //L803886D0 + return (-335.0f < sp20[0] && sp20[0] < -200.0f) && (-2730.0f < sp20[2] && sp20[2] < -2400.0f); + + case 0xa0: //L80388770 + return (-2915.0f < sp20[0] && sp20[0] < -2584.0f) && ( -500.0f < sp20[2] && sp20[2] < -355.0f); + + case 0xFF: //L80388810 + return (5470.0f < sp20[0] && sp20[0] < 5920.0f) && ( -850.0f < sp20[2] && sp20[2] < -780.0f); + + default: + return FALSE; + } +} + +void func_803888B8(Actor *this){ + func_803300C0(this->marker, func_80388670); + func_802D3CE8(this); + this->unk60 = 0.0f; + switch(this->state){ + case 4: + switch(this->marker->unk14_20){ + case 0x9F: + this->roll = func_80388430(this, 0, -1, this->roll); + break; + case 0xa0: + case 0xff: + this->pitch = func_80388430(this, 2, 1, this->pitch); + break; + } + break; + case 5: + func_80326310(this); + break; + } +} + +Actor *func_80388994(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + static u8 pad[0x10]; + static s32 i; + Actor *this; + f32 sp90[3]; + f32 sp84[3]; + f32 sp78[3]; + f32 sp6C[3]; + + this = func_80325E78(marker, gfx, mtx, vtx); + if (marker->unk14_21 && (this->unk60 != 0.0f)) { + func_8034A174((struct5Bs *) marker->unk44, 5, &sp84); + func_8034A174((struct5Bs *) marker->unk44, 6, &sp78); + for(i = 0; i < 8; i++){ + sp6C[0] = sp6C[2] = 0.0f; + sp6C[1] = randf2(5.0f, 20.0f); + sp90[0] = sp84[0] + (sp78[0] - sp84[0]) * randf(); + sp90[1] = sp84[1]; + sp90[2] = sp84[2] + (sp78[2] - sp84[2]) * randf(); + func_802EE6CC(sp90, sp6C, D_8038BE20, 1, 0.3f, 50.0f, 0xB4, randi2(0x82, 0xC8), 0); + } + } + return this; +} + +void func_80388B2C(Actor *this, f32 arg1) { + + this->yaw += arg1; + + while ((arg1 > 0.0f) && (this->yaw >= 360.0f)) { + this->yaw -= 360.0f; + } + + while ((arg1 < 0.0f) && (this->yaw < 0.0f)) { + this->yaw += 360.0f; + } +} + +void func_80388BDC(Actor *this) { + f64 phi_f0; + + func_802D3D74(this); + mapSpecificFlags_set(1, ((this->yaw > 260.0f) && (this->yaw < 330.0f)) ? TRUE : FALSE); + if (!this->unk16C_4) { + if (this->yaw != 0.0f) { + this->unk60 = 0.5f; + func_80328A84(this, 7); + this->unk38_31 = 1; + this->yaw = 270.0f; + } else { + this->unk38_31 = 0; + this->unk60 = 0.0f; + } + this->unk16C_4 = TRUE; + } + + switch (this->state) { + case 1: + this->yaw = 0.0f; + if(mapSpecificFlags_get(0)) { + func_802BAFE4(0x21); + func_80328A84(this, 6); + func_80244BB0(0, 0x6A, 0x7FF8, 0.3f); + mapSpecificFlags_set(2, 0); + func_8025A6EC(COMUSIC_4_MMM_CLOCK_VERSION, -1); + func_8025AE0C(2000, 3.0f); + } + break; + + case 6: + func_80388B2C(this, - (((this->yaw == 0.0f) || (359.0 < this->yaw)) ? 0.023 : 1.09)); + if ((this->yaw <= 270.0f) && (this->yaw > 260.0f)) { + func_80328A84(this, 7U); + this->yaw = 270.0f; + func_8030E540(0x7F); + func_80244C78(0); + func_802D68F0(0xE); + item_set(6, 1); + } + break; + case 7: + if (this->unk38_31) { + this->unk60 -= time_getDelta(); + if (this->unk60 < 0.0f) { + this->unk60 = 0.0f; + } + } + if( (!this->unk38_31 && item_empty(ITEM_0_HOURGLASS_TIMER)) + || ((this->unk38_31) && (this->unk60 == 0.0f)) + ) { + if (!this->unk38_31) { + func_802BAFE4(0x22); + } else { + func_802BAFE4(0x23); + } + func_80328A84(this, 8); + func_80244BB0(0, 0x6A, 0x7FF8, 0.3f); + } + break; + case 8: + func_80388B2C(this, 1.3f); + if ((this->yaw >= 0.0f) && (this->yaw < 10.0f)) { + func_80328A84(this, 1U); + this->yaw = 0.0f; + func_8030E540(SFX_7F_HEAVYDOOR_SLAM); + mapSpecificFlags_set(0, 0); + func_80244C78(0); + if (!this->unk38_31) { + func_8025A6EC(COMUSIC_3C_MINIGAME_LOSS, 0x7FF8); + func_8025AE0C(0x7D0, 2.5f); + } + this->unk38_31 = 0; + this->unk60 = 0.0f; + func_80356520(0xAD); + } + break; + } +} + +void func_80388FE4(Actor *this) { + func_802D4A9C(this,0); +} + +void func_80389004(Actor *this){ + func_802D3CE8(this); + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(levelSpecificFlags_get(0x2e)) + marker_despawn(this->marker); + } +} + +void func_80389060(Actor *this){ + if(!this->initialized && sns_get_item_state(SNS_ITEM_EGG_CYAN, TRUE)){ + marker_despawn(this->marker); + } + else{ + func_802D3CE8(this); + } +} + +void func_803890B8(Actor *this) { + func_802D3D54(this); + func_8038AC04(); +} + +void func_803890E0(void){ + spawnableActorList_add(&D_8038BC28, actor_new, 0); + spawnableActorList_add(&D_8038BCDC, actor_new, 0); + spawnableActorList_add(&D_8038BC4C, actor_new, 0); + spawnableActorList_add(&D_8038BDB4, actor_new, 0x40); + spawnableActorList_add(&D_8038BDD8, actor_new, 0x40); + spawnableActorList_add(&D_8038BDFC, actor_new, 0x440); + spawnableActorList_add(&D_8038BC94, actor_new, 0); + spawnableActorList_add(&D_8038BC70, actor_new, 0); + spawnableActorList_add(&D_8038BD00, actor_new, 0); + spawnableActorList_add(&D_8038BD24, actor_new, 0x8600); + spawnableActorList_add(&D_8038BD48, actor_new, 0x8600); + spawnableActorList_add(&D_8038BD6C, actor_new, 0x8600); + spawnableActorList_add(&D_8038BCB8, actor_new, 0x8600); + spawnableActorList_add(&D_8038BD90, actor_new, 8); + spawnableActorList_add(&chNapper, actor_new, 0x18A0); + spawnableActorList_add(&D_8038BA68, actor_new, 0x100); + spawnableActorList_add(&chMotzhand, actor_new, 0x20880); + spawnableActorList_add(&D_80367E70, actor_new, 0); + spawnableActorList_add(&chLoggo, actor_new, 0x108); + spawnableActorList_add(&D_8038BAD0, actor_new, 0x2800960); + spawnableActorList_add(&D_8038BE48, actor_new, 0x800040); + spawnableActorList_add(&D_8038BE6C, actor_new, 0x800040); + spawnableActorList_add(&D_8038BE90, actor_new, 0x800040); + spawnableActorList_add(&D_8038BEB4, actor_new, 0x800040); + spawnableActorList_add(&D_8038BED8, actor_new, 0x800040); + spawnableActorList_add(&D_8038BEFC, actor_new, 0x800040); + spawnableActorList_add(&D_80372C3C, actor_new, 0xA11A9); +} diff --git a/src/MMM/code_2F60.c b/src/MMM/code_2F60.c new file mode 100644 index 00000000..da92d0de --- /dev/null +++ b/src/MMM/code_2F60.c @@ -0,0 +1,94 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *func_80389350(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_803893A4(Actor *this); + +/* .data */ +ActorAnimationInfo D_8038BE30[] ={ + {0x000, 0.0f}, + {0x23F, 10000000.0f}, + {0x23F, 2.0f}, +}; + +ActorInfo D_8038BE48 = { + MARKER_255_PORTRAIT_OF_GRUNTY, ACTOR_382_PORTRAIT_OF_GRUNTY, ASSET_522_MODEL_PORTRAIT_OF_GRUNTY, + 0x1, D_8038BE30, + func_803893A4, func_80326224, func_80389350, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BE6C = { + MARKER_257_PORTRAIT_OF_BLACKEYE, ACTOR_384_PORTRAIT_OF_BLACKEYE, ASSET_527_MODEL_PORTRAIT_OF_BLACKEYE, + 0x1, D_8038BE30, + func_803893A4, func_80326224, func_80389350, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BE90 = { + MARKER_258_PORTRAIT_OF_TOWER, ACTOR_385_PORTRAIT_OF_TOWER, ASSET_528_MODEL_PORTRAIT_OF_TOWER, + 0x1, D_8038BE30, + func_803893A4, func_80326224, func_80389350, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BEB4 = { + MARKER_259_PORTRAIT_OF_TREE_AND_MOON, ACTOR_386_PORTRAIT_OF_TREE_AND_MOON, ASSET_529_MODEL_PORTRAIT_OF_TREE_AND_MOON, + 0x1, D_8038BE30, + func_803893A4, func_80326224, func_80389350, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BED8 = { + MARKER_25A_PORTRAIT_OF_TEEHEE, ACTOR_387_PORTRAIT_OF_TEEHEE, ASSET_52A_MODEL_PORTRAIT_OF_TEEHEE, + 0x1, D_8038BE30, + func_803893A4, func_80326224, func_80389350, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038BEFC = { + MARKER_25B_PORTRAIT_OF_MINION, ACTOR_388_PORTRAIT_OF_MINION, ASSET_52B_MODEL_PORTRAIT_OF_MINION, + 0x1, D_8038BE30, + func_803893A4, func_80326224, func_80389350, + 0, 0, 0.0f, 0 +}; + + +/* .code */ +Actor *func_80389350(ActorMarker* marker, Gfx** graphics, Mtx** matrix, Vtx** vertex) { + func_8033A45C(3, marker_getActor(marker)->unk38_31); + return func_80325888(marker, graphics, matrix, vertex); +} + +void func_803893A4(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + this->unk38_31 = 2; + } + + switch(this->state){ + case 1: + animctrl_setAnimTimer(this->animctrl, 0.0f); + break; + case 2: + if(actor_animationIsAt(this, 0.999f)){ + func_80328B8C(this, 1, 0.001f, 0); + actor_playAnimationOnce(this); + this->unk38_31 = 2; + } + break; + } +} + +void func_80389484(ActorMarker * marker, f32 anim_duration){ + Actor *this = marker_getActor(marker); + + func_80328B8C(this, 2, 0.001f, 1); + actor_playAnimationOnce(this); + animctrl_setDuration(this->animctrl, anim_duration); + this->unk38_31 = 1; + FUNC_8030E8B4(SFX_129_SWOOSH, 1.0f, 32000, this->position, 1000, 2000); +} diff --git a/src/MMM/code_3120.c b/src/MMM/code_3120.c new file mode 100644 index 00000000..c1c6cc6d --- /dev/null +++ b/src/MMM/code_3120.c @@ -0,0 +1,115 @@ +#include +#include "functions.h" +#include "variables.h" + +Struct5Es * func_80309B48(f32[3], f32[3], f32[3], u32); + +/* .bss */ +extern struct{ + u8 unk0; + u8 unk1; + u8 unk2; +} D_8038C4E0; + +/* .code */ +s32 func_80389510() { + return D_8038C4E0.unk1 == 1; +} + +u8 func_80389524() { + return D_8038C4E0.unk0; +} + +u8 func_80389530() { + return D_8038C4E0.unk2; +} + +void func_8038953C() { + return; +} + +void func_80389544(void){ + D_8038C4E0.unk0 = 0; + D_8038C4E0.unk2 = 0; + if(map_get() == MAP_26_MMM_NAPPERS_ROOM){ + if(jiggyscore_isCollected(JIGGY_5D_MMM_NAPPER)){ + D_8038C4E0.unk1 = 2; + } + else{ + D_8038C4E0.unk1 = 1; + } + } + else{ + D_8038C4E0.unk1 = 0; + } + +} + +void func_803895B0(s32 arg0) { + if (arg0 != 0) { + D_8038C4E0.unk1 = 1; + return; + } + D_8038C4E0.unk1 = 2; +} + +void func_803895D8(ActorMarker *caller, enum asset_e text_id, s32 arg2) { + if (text_id == 0xAD7) { + timed_playSfx(0.1f, SFX_3F5_UNKNOWN, 1.0f, 30000); + func_80324E88(1.5f); + func_80324E38(1.5f, 0); + return; + } + D_8038C4E0.unk0 = 1; + func_80324E88(1.5f); + func_80324E38(1.5f, 0); +} + +void func_8038966C(void){ + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + f32 sp30[3]; + BKCollisionTri *tmp_v0; + + if(D_8038C4E0.unk1 == 0) return; + + if( !D_8038C4E0.unk2 + && D_8038C4E0.unk1 == 1 + && jiggyscore_isCollected(JIGGY_5D_MMM_NAPPER) + ){ + D_8038C4E0.unk2 = TRUE; + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.2f, 1); + func_80324DBC(0.2f, 0xad9, 6, NULL, NULL, func_803895D8, NULL); + }//L80389700 + + if(D_8038C4E0.unk1 != 1) + return; + + player_getPosition(sp54); + + sp48[0] = sp54[0]; + sp3C[0] = sp54[0]; + + sp48[1] = sp54[1] + 10.0f; + sp3C[1] = sp54[1] - 10.0f; + + sp48[2] = sp54[2]; + sp3C[2] = sp54[2]; + + tmp_v0 = func_80309B48(sp48, sp3C, sp30, 0); + + if(tmp_v0 != NULL){ + if((s32)(tmp_v0->flags << 4) < 0){ + FUNC_8030E624(SFX_6B_LOCKUP_OPENING, 1.4f, 32750); + D_8038C4E0.unk1 = 2; + if(!levelSpecificFlags_get(0x1b)){ + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.0f, 0); + func_80324DBC(0.0f, 0xad7, 6, NULL, NULL, func_803895D8, NULL); + levelSpecificFlags_set(0x1b, TRUE); + } + } + } +} diff --git a/src/MMM/code_3420.c b/src/MMM/code_3420.c new file mode 100644 index 00000000..343914bf --- /dev/null +++ b/src/MMM/code_3420.c @@ -0,0 +1,380 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8038B6D4(f32* arg0, s32 arg1); + +/* internal definitions */ +typedef struct { + s32 unk0; + s32 unk4; +} Struct_MMM_3420_0; + +typedef struct { + u8 unk0; + u8 unk1; +} Struct_MMM_3420_1; + +void func_80389A0C(s32 arg0); + +/* .data */ +Struct_MMM_3420_0 D_8038BF20[] = { + { 0, 11}, + { 0xC05, 0}, + { 0x1E00, 8}, + { 0x2400, 3}, + { 0x2A00, 1}, + { 0x3000, 0}, + { 0x3600, 8}, + { 0x3C00, 7}, + { 0x3F00, 7}, + { 0x4200, 0}, + { 0x49D0, 0}, + { 0x4E00, 8}, + { 0x5400, 3}, + { 0x5A00, 6}, + { 0x6000, 7}, + { 0x6600, 8}, + { 0x6C00, 0}, + { 0x6F00, 7}, + { 0x7200, 0}, + { 0x7800, 10}, + { 0x7E00, 3}, + { 0x8400, 8}, + { 0x8A00, 1}, + { 0x9000, 2}, + { 0x9600, 3}, + { 0x9C00, 8}, + { 0xA200, 7}, + { 0xA800, 0}, + { 0xAE00, 8}, + { 0xB400, 3}, + { 0xBA00, 6}, + { 0xC000, 7}, + { 0xC600, 8}, + { 0xCC00, 0}, + { 0xCF00, 7}, + { 0xD200, 3}, + { 0xD800, 1}, + { 0xDB00, 7}, + { 0xDE00, 1}, + { 0xE100, 0}, + { 0xE400, 1}, + { 0xE700, 7}, + { 0xEA00, 1}, + { 0xED00, 2}, + { 0xF000, 1}, + { 0xF600, 9}, + { 0xFC00, 1}, + {0x10200, 7}, + {0x10800, 1}, + {0x10E00, 9}, + {0x11400, 1}, + {0x11700, 8}, + {0x11A00, 1}, + {0x12000, 11}, + {0x12600, 4}, + {0x12C00, 9}, + {0x13200, 2}, + {0x13800, 11}, + {0x13E00, 4}, + {0x14400, 9}, + {0x14A00, 8}, + {0x15000, 1}, + {0x15600, 9}, + {0x15C00, 1}, + {0x16200, 7}, + {0x16800, 1}, + {0x16E00, 9}, + {0x17400, 1}, + {0x17700, 8}, + {0x17A00, 1}, + {0x18000, 0}, + {0x18300, 6}, + {0x18600, 3}, + {0x18900, 11}, + {0x18C00, 7}, + {0x18F60, 6}, + {0x19260, 0}, + {0x19500, 11}, + {0x19802, -1} +}; + +Struct_MMM_3420_1 D_8038C198[] = { + {01, 00}, + {02, 00}, + {03, 00}, + {04, 00}, + {05, 00}, + {06, 00}, + {04, 00}, + {07, 00}, + {04, 00}, + {07, 00}, + {04, 00}, + {05, 00}, + {06, 00}, + {04, 00}, + {07, 00}, + {04, 00}, + {05, 00}, + {06, 00}, + {04, 00}, + {07, 00}, + {04, 00}, + {07, 00}, + {04, 00}, + {05, 00}, + {00, 00}, + {00, 00}, +}; + +u8 D_8038C1CC[] = {0x7, 0xE, 0xD, 0x9, 0x11, 0, 0, 0}; +u8 D_8038C1D4[] = {0xA, 0x12, 0xF, 0x9, 0xE, 0xD, 0x9, 0x11, 0xB, 0xF, 0, 0}; +f32 D_8038C1E0[3] = {0.0f, 3250.0f, -3200.0f}; //jiggy spawn position + +/* .bss */ +extern struct { + s32 unk0; + ActorMarker *unk4; //motzhand_marker + Struct_MMM_3420_0 *unk8; + u8 unkC; //state + u8 unkD; //pattern id + //u8 padE[2]; + u8 *unk10; +}D_8038C4F0; + +/* .code */ +void func_80389810(ActorMarker *caller, enum asset_e text_id, s32 arg2) { + switch (D_8038C4F0.unkC) { + case 2: + func_80389A0C(3); + return; + case 4: + func_80389A0C(1); + return; + case 5: + func_80389A0C(3); + return; + case 6: + func_80389A0C(7); + return; + } +} + +void func_803898A0() { + jiggySpawn(JIGGY_60_MMM_MOTZHAND, D_8038C1E0); +} + +void func_803898C8() { + func_8025A58C(0, 450); +} + +void func_803898EC() { + func_8025A58C(-1, 300); +} + +void func_80389910() { + func_80311480(0xAD5, 0xE, NULL, NULL, func_80389810, NULL); + timedFunc_set_2(0.0f, func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF); + timed_setCameraToNode(2.0f, 0); + timedFunc_set_0(2.1f, func_803898A0); + timedFunc_set_0(6.0f, func_803898EC); + func_80324E88(6.0f); + func_80324E38(6.0f, 0); +} + +void func_803899BC(void){ + func_80324E38(0.0f, 3); + timedFunc_set_2(0.0f, (TFQM2)func_8025A6EC, COMUSIC_38_MOTZAND_BEATEN, 0x7fff); + timedFunc_set_0(2.25f, func_80389910); +} + +void func_80389A0C(s32 next_state){ + func_8028F8F8(1, FALSE); + if(next_state == 2){ + if(D_8038C4F0.unkD == 0){ + D_8038C4F0.unkD = 1; + func_80311480(0xad3, 4, NULL, NULL, func_80389810, NULL); + } + else{//L80389A84 + func_80311480(0xad6, 4, NULL, NULL, func_80389810, NULL); + } + }//L80389A9C + + if(next_state == 3){ + D_8038C4F0.unk0 = 0; + if(D_8038C4F0.unkD == 1){ + D_8038C4F0.unk10 = D_8038C1CC; + } + else{ + D_8038C4F0.unk10 = D_8038C1D4; + } + func_8028F8F8(1, TRUE); + func_803876C8(D_8038C4F0.unk4, D_8038C4F0.unkD); + }//L80389AF4 + + if(next_state == 4){ + func_80311480(0xadd, 4, NULL, NULL, func_80389810, NULL); + func_80387720(D_8038C4F0.unk4); + } + + if(next_state == 5){ + D_8038C4F0.unkD++; + func_80311480(0xad4, 4, NULL, NULL, func_80389810, NULL); + func_80387720(D_8038C4F0.unk4); + } + + if(next_state == 6){ + func_803898C8(); + timedFunc_set_0(1.25f, func_803899BC); + func_80387654(D_8038C4F0.unk4); + } + + D_8038C4F0.unkC = next_state; +} + +s32 func_80389BBC(void){ + return D_8038C4F0.unk8->unk4; +} + +//organCtrl_getKeyPosition +void func_80389BCC(s32 key_indx, f32 position[3]) { + Struct_MMM_3420_1 *iPtr; + s32 is_black_key; + + position[0] = -145.0f; + position[1] = 0.0f; + position[2] = 0.0f; + for (iPtr = &D_8038C198[0]; iPtr <= &D_8038C198[key_indx]; iPtr++) { + is_black_key = (iPtr->unk0 == 2 || iPtr->unk0 == 4); + if (is_black_key != 0) { + position[0] += 67.0f; + position[1] += 12.5; + position[2] += -230.0f; + } else { + position[0] += 170.0f; + } + if (iPtr == &D_8038C198[key_indx]) + break; + + if (is_black_key != 0) { + position[0] -= 67.0f; + position[1] -= 12.5; + position[2] -= -230.0f; + } + } +} + +void func_80389CD8() {} + +void func_80389CE0() {} + +int func_80389CE8(s32 arg0, s32 arg1, s32 arg2){ + if(D_8038C4F0.unkC == 3){ + if(*D_8038C4F0.unk10 == arg2){ + D_8038C4F0.unk0--; + D_8038C4F0.unk10++; + if(*D_8038C4F0.unk10 == 0){ + if(D_8038C4F0.unkD == 1){ + func_80389A0C(5); + } + else{ + func_80389A0C(6); + } + } + return 1; + }//L80389D6C + else{ + func_8028F55C(0xD, func_80351794(arg1)); + return 2; + } + } + return 0; +} + +void func_80389D9C(s32 key_id){ + s32 sp24; + sp24 = D_8038C198[key_id].unk1; + func_8038B6D4(func_803517B8(sp24), func_803517E8(sp24)); + D_8038C4F0.unk0++; +} + +void func_80389DF4(s32 arg0, s32 arg1) { + Struct_MMM_3420_1 *iPtr; + f32 key_position[3]; + bool is_black_key; + + D_8038C4F0.unk8 = &D_8038BF20; + func_80250170(0, 0x6A, 0); + D_8038C4F0.unkC = 0; + if ((map_get() == MAP_1C_MMM_CHURCH) && (arg1 == 2)) { + D_8038C4F0.unk4 = NULL; + D_8038C4F0.unkD = 0; + key_position[0] = -1345.0f; + key_position[1] = 1150.0f; + key_position[2] = -2300.0f; + for(iPtr = &D_8038C198[0]; iPtr->unk0; iPtr++){ + is_black_key = (iPtr->unk0 == 2 || iPtr->unk0 == 4); + if (is_black_key) { + key_position[0] += 122.0f; + key_position[1] += 12.5; + } else { + key_position[0] += 170.0f; + } + iPtr->unk1 = func_80351838(key_position, iPtr->unk0, iPtr - &D_8038C198[0]); + if (is_black_key) { + key_position[0] -= 122.0f; + key_position[1] -= 12.5; + } + } + if (jiggyscore_isSpawned(JIGGY_60_MMM_MOTZHAND)) { + func_80389A0C(7); + return; + } + func_80389A0C(1); + } +} + + +void func_80389FC0(void){ + UNK_TYPE(u32) sp4C; + f32 sp48; + Actor *motzhand; + f32 sp38[3]; + f32 plyr_pos[3]; + Actor *motzhand_2; + + + if(D_8038C4F0.unkC == 0) return; + + if(func_802501A0(0, 0x6A, &sp4C)){ + func_80250170(0, 0x6A, 0); + D_8038C4F0.unk8++; + if(D_8038C4F0.unk8->unk4 == -1){ + D_8038C4F0.unk8 = &D_8038BF20[10]; + } + }//L8038A02C + + if(D_8038C4F0.unkC == 1 && D_8038C4F0.unk4 == NULL){ + sp38[0] = sp38[1] = sp38[2] = 0.0f; + motzhand = func_80326D68(sp38, ACTOR_3A_MOTZHAND, -1, &sp48); + D_8038C4F0.unk4 = motzhand->marker; + }//L8038A078 + + if(D_8038C4F0.unkC == 1 || D_8038C4F0.unkC == 3){ + if(func_8038769C(D_8038C4F0.unk4)){ + player_getPosition(plyr_pos); + motzhand_2 = marker_getActor(D_8038C4F0.unk4); + if( ml_vec3f_distance(motzhand_2->position, plyr_pos) < 400.0f + && motzhand_2->position_y - 50.0f <= plyr_pos[1] + ){ + func_80389A0C(2); + } + } + }//L8038A104 + + if(D_8038C4F0.unkC == 3 && D_8038C4F0.unk0 >= 3){ + func_80389A0C(4); + } +} diff --git a/src/MMM/code_3D50.c b/src/MMM/code_3D50.c new file mode 100644 index 00000000..fe8c81cd --- /dev/null +++ b/src/MMM/code_3D50.c @@ -0,0 +1,293 @@ +#include +#include "functions.h" +#include "variables.h" + + +typedef struct { + s16 unk0; + u8 unk2; + u8 unk3; + f32 unk4; +}Struct_MMM_3D50_0; + +extern void func_8028F620(Struct_MMM_3D50_0 *, f32, f32); + +typedef struct { + u8 *unk0; + u8 unk4; +}Struct_MMM_3D50_1; + +/* .data */ +Struct_MMM_3D50_0 D_8038C1F0[] = { + {0x01, 'X', 0, 0.0f}, + {0x02, 'J', 0, 0.0f}, + {0x03, 'X', 0, 0.0f}, + {0x04, 'X', 0, 0.0f}, + {0x05, 'X', 0, 0.0f}, + {0x06, 'A', 0, 0.0f}, + {0x07, 'X', 0, 0.0f}, + {0x08, 'N', 0, 0.0f}, + {0x09, 'X', 0, 0.0f}, + {0x0A, 'O', 0, 0.0f}, + {0x0B, 'X', 0, 0.0f}, + {0x0C, 'X', 0, 0.0f}, + {0x0D, 'X', 0, 0.0f}, + {0x0E, 'K', 0, 0.0f}, + {0x0F, 'X', 0, 0.0f}, + {0x10, 'B', 0, 0.0f}, + {0x11, 'X', 0, 0.0f}, + {0x12, 'A', 0, 0.0f}, + {0x13, 'X', 0, 0.0f}, + {0x14, 'X', 0, 0.0f}, + {0x15, 'Z', 0, 0.0f}, + {0x16, 'X', 0, 0.0f}, + {0x17, 'E', 0, 0.0f}, + {0x18, 'X', 0, 0.0f}, + {0x19, 'O', 0, 0.0f}, + {0x1A, 'X', 0, 0.0f}, + {0x1B, 'I', 0, 0.0f}, + {0x1C, 'X', 0, 0.0f}, + {0x1D, 'X', 0, 0.0f}, + {0x1E, 'O', 0, 0.0f}, + {0x1F, 'X', 0, 0.0f}, + {0x00, 0x00, 0, 0.0f} +}; + +Struct_MMM_3D50_1 D_8038C2F0[] = { + {"BANJOKAZOOIE", 0}, + {0}, +}; + +/* .bss */ +struct { + BKModel *unk0; + Struct_MMM_3D50_0 *unk4; + u8 unk8; + BKModel *unkC; + s32 unk10; +} D_8038C510; + +/* .code */ +void func_8038A140(UNK_TYPE(s32) arg0) { + if (arg0 == 2) { + func_80324E38(0.3f, 3); + timed_setCameraToNode(0.3f, 1); + timedFunc_set_2(0.3f, mapSpecificFlags_set, 3, 1); + func_80324E38(3.0f, 0); + func_80324E88(3.0f); + timedFunc_set_1(3.0f, func_8038A140, 3); + } + if (arg0 == 3) { + if (D_8038C510.unk8 == 1) { + mapSpecificFlags_set(3, 1); + } + item_set(ITEM_0_HOURGLASS_TIMER, 75*60 - 1); + item_set(6, 1); + } + if (D_8038C510.unk8 == 3) { + item_set(6, 0); + mapSpecificFlags_set(4, 1); + } + if (arg0 == 4) { + func_8028F66C(0xF); + } + D_8038C510.unk8 = arg0; +} + +Struct_MMM_3D50_0 *func_8038A26C(s32 arg0){ + Struct_MMM_3D50_0 *v1; + s32 v0; + + + for(v1 = &D_8038C1F0[0]; v1->unk0 != 0; v1++){ + if(arg0 == v1->unk0){ + return v1; + } + } + return NULL; +} + +void func_8038A2B8(void){ + Struct_MMM_3D50_0 *v1; + + for(v1 = &D_8038C1F0[0]; v1->unk0 != 0; v1++){ + v1->unk3 = 2; + v1->unk4 = 0.0f; + } +} + +void func_8038A2F0(s32 mesh_id, BKVtxRef *ref_vert, Vtx* vert, Struct_MMM_3D50_0 *arg3) { + f32 temp_f2; + + if (arg3->unk4 < 0.5) { + temp_f2 = arg3->unk4 / 0.5; + vert->v.cn[0] = 255.0f + (ref_vert->v.v.cn[0] - 0xFF) * temp_f2; + vert->v.cn[1] = ref_vert->v.v.cn[1] * temp_f2; + vert->v.cn[2] = ref_vert->v.v.cn[2] * temp_f2; + } + else{ + vert->v.cn[0] = ref_vert->v.v.cn[0]; + vert->v.cn[1] = ref_vert->v.v.cn[1]; + vert->v.cn[2] = ref_vert->v.v.cn[2]; + arg3->unk3 = 2; + } +} + + +void func_8038A54C(Struct_MMM_3D50_0 *arg0, s32 arg1){ + s32 v0 = arg0->unk3; + arg0->unk3 = arg1; + arg0->unk4 = 0.0f; + if(arg1 == 1 && v0 != arg1){ + func_8025A6EC(COMUSIC_2C_BUZZER, 32000); + } +} + +void func_8038A58C(s32 mesh_id, BKVtxRef *ref_vert, Vtx* vert, Struct_MMM_3D50_0 *arg3){ + f32 temp_f12; + + if (arg3->unk4 <= 0.5) { + temp_f12 = (arg3->unk4 / 0.5); + vert->v.cn[0] = ref_vert->v.v.cn[0] * (1 - temp_f12); + vert->v.cn[1] = 255.0f; + vert->v.cn[2] = ref_vert->v.v.cn[2] * (1 - temp_f12); + } + if (arg3->unk4 >= 0.5) { + arg3->unk3 = 4; + } +} + +void func_8038A750(void){ + Struct_MMM_3D50_0 *v1; + f32 f20; + + f20 = time_getDelta(); + for(v1 = &D_8038C1F0[0]; v1->unk0 != 0; v1++){ + v1->unk4 += f20; + if(v1->unk3 == 1){ + func_8033F120(D_8038C510.unk0, v1->unk0, func_8038A2F0, v1); + } + else if(v1->unk3 == 3){ + func_8033F120(D_8038C510.unk0, v1->unk0, func_8038A58C, v1); + } + } +} + +void func_8038A82C(Struct_MMM_3D50_0 * arg0){ + f32 sp44[3]; + f32 sp38[3]; + Struct_MMM_3D50_1 *iPtr; + + if(arg0->unk2 == 'X'){ + func_8038A54C(arg0, 1); + player_getPosition(sp44); + func_8038AD10(D_8038C510.unkC, D_8038C510.unk10, sp38); + sp38[1] = sp44[1]; + func_8028F620(sp38, 300.0f, -1500.0f); + return; + } + for(iPtr = &D_8038C2F0[0]; iPtr->unk0 != 0; iPtr++){//L8038A8C8 + if(arg0->unk2 == iPtr->unk0[iPtr->unk4]){ + iPtr->unk4++; + func_8038A54C(arg0, 3); + if( iPtr->unk0[iPtr->unk4] == 0){ + func_8038A140(5); + func_8038AF3C(D_8038C510.unkC, D_8038C510.unk10); + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 32000); + } + else{ + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + } + } + } +} + +void func_8038A964(void){ + Struct_MMM_3D50_1 *v0; + + for(v0 = &D_8038C2F0[0]; v0->unk0 != 0; v0++){ + v0->unk4 = 0; + } +} + +void func_8038A994() { + func_8038A140(0); +} + +void func_8038A9B4(void){ + + D_8038C510.unk8 = 0; + + if(map_get() == MAP_24_MMM_TUMBLARS_SHED){ + D_8038C510.unkC = NULL; + D_8038C510.unk0 = func_80309744(0); + D_8038C510.unk4 = NULL; + + func_8038A2B8(); + func_8038A964(); + if(jiggyscore_isCollected(JIGGY_62_MMM_TUMBLAR)){ + func_8038A140(6); + } + else{ + func_8038A140(1); + } + } +} + +void func_8038AA30(BKModel *arg0, s32 arg1){ + D_8038C510.unkC = arg0; + D_8038C510.unk10 = arg1; +} + +void func_8038AA44(void){ + s32 tmp_v0; + f32 sp28[3]; + Struct_MMM_3D50_0 *sp24; + + if(D_8038C510.unk8 == 0) return; + + func_8038A750(); + if( D_8038C510.unk8 == 1 + && D_8038C510.unkC != NULL + && func_8038AD4C(D_8038C510.unkC, D_8038C510.unk10) + ){ + if(!levelSpecificFlags_get(0x2f)){ + levelSpecificFlags_set(0x2f, TRUE); + func_8038A140(2); + } + else{ + func_8038A140(3); + } + } + + if(D_8038C510.unk8 == 3){ + if(item_empty(ITEM_6_HOURGLASS)){ + func_8038A140(4); + } + else if( D_8038C510.unkC != NULL + && func_8038AD4C(D_8038C510.unkC, D_8038C510.unk10) + ){ + func_8038AD10(D_8038C510.unkC, D_8038C510.unk10, sp28); + tmp_v0 = func_8033F3C0(D_8038C510.unk0, sp28); + if(tmp_v0){ + sp24 = func_8038A26C(tmp_v0); + if( sp24 + && sp24->unk3 == 2 + && sp24 != D_8038C510.unk4 + ){ + func_8038A82C(sp24); + D_8038C510.unk4 = sp24; + } + } + else{ + D_8038C510.unk4 = 0; + } + } + }//L8038AB7C + + if( D_8038C510.unk8 == 5 + && func_8038AD38(D_8038C510.unkC, D_8038C510.unk10) + ){ + func_8038A140(6); + } +} diff --git a/src/MMM/code_47D0.c b/src/MMM/code_47D0.c new file mode 100644 index 00000000..8d638f12 --- /dev/null +++ b/src/MMM/code_47D0.c @@ -0,0 +1,191 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void sfxsource_setSampleRate(u8, s32); +extern f32 func_80258640(f32[3], f32[3]); + +typedef struct { + ActorMarker *unk0; + u8 unk4; + u8 pad5[3]; + f32 unk8; + f32 unkC[3]; +}Struct_MMM_47D0_0; + +/* .code */ +void func_8038ABC0(s32 arg0) { + if (getGameMode() != 7) { + func_80295864(func_802957F0() & ~arg0); + } +} + +void func_8038AC04(void){ + if((*(u32*)PHYS_TO_K1(0x1D0)) - 0x356BAAAE){ + func_8038ABC0(0x820); + } +} + +//BREAK???========== +void func_8038AC40(Struct_MMM_47D0_0 *arg0, struct struct_68_s *arg1, f32 position[3], f32 rotation[3], f32 scale, BKModelBin *model_bin, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + u8 temp_v0; + + if (arg0->unk4 != 3) { + if ((arg0->unk4 == 0) || (arg0->unk4 == 1)) { + func_8033A410(0xFF, arg0); + } else if (arg0->unk4 == 2) { + func_8033A410((s32)((1 - ((f64)arg0->unk8 * 1)) * 255.0), arg0); + } + set_model_render_mode(1); + func_803391A4(gfx, mtx, position, rotation, scale, NULL, model_bin); + } +} + +void func_8038AD10(s32 arg0, s32 arg1, f32 arg2[3]) { + func_8035179C(arg1, arg2); +} + +bool func_8038AD38(Struct_MMM_47D0_0 *arg0, s32 arg1){ + return arg0->unk4 == 3; +} + +bool func_8038AD4C(s32 arg0, s32 arg1) { + f32 plyr_pos[3]; + f32 sp18[3]; + + player_getPosition(plyr_pos); + func_8035179C(arg1, sp18); + return func_803518D4(arg1) + && (func_80258640(sp18, plyr_pos) < 40.0f) + && (player_getTransformation() == TRANSFORM_1_BANJO) + && (func_8028ECAC() == 0); +} + +void func_8038ADF0(Struct_MMM_47D0_0 *arg0, Struct68s *arg1) { + u8 sp3F; + f32 sp38; + Actor *jiggy; + f32 sp28[3]; + + arg0->unk4 = 0; + arg0->unk8 = 0.0f; + arg0->unkC[0] = 0.0f; + arg0->unkC[1] = 0.0f; + arg0->unkC[2] = 0.0f; + func_8038AA30(arg0, arg1); + func_80351A14(arg1, (Struct68DrawMethod)func_8038AC40); + sp3F = func_80351758(arg1); + sfxsource_setSfxId(sp3F, SFX_3EC_CCW_DOOR_OPENING); + func_8030DD14(sp3F, 3); + func_8030DBB4(sp3F, 0.6f); + sfxsource_setSampleRate(sp3F, 0); + func_8030E2C4(sp3F); + func_8035179C(arg1, sp28); + sp38 = 500.0f; + jiggy = func_80326D68(sp28, ACTOR_46_JIGGY, -1, &sp38); + if (jiggy != NULL) { + arg0->unk0 = jiggy->marker; + } else { + arg0->unk0 = NULL; + } + + if (arg0->unk0 != NULL) { + arg0->unk0->collidable = FALSE; + } + if (jiggyscore_isCollected(JIGGY_62_MMM_TUMBLAR)) { + func_80351A04(arg1, 1); + arg0->unk4 = 3; + } +} + +void func_8038AF0C(ActorMarker *marker, enum asset_e text_id, s32 arg2) { + mapSpecificFlags_set(1, 1); +} + +void func_8038AF3C(Struct_MMM_47D0_0 *arg0, s32 arg1) { + func_80311480(0xADB, 4, NULL, arg0->unk0, func_8038AF0C, NULL); + arg0->unk4 = 1; +} + +void func_8038AF90(Struct_MMM_47D0_0 *arg0, Struct68s *arg1, f32 arg2) { + f32 sp7C[3]; + f32 sp70[3]; + f32 sp64[3]; + Actor *temp_v0_2; + f32 sp54[3]; + f32 sp48[3]; + f32 sp40[2]; + s32 sp3C; + u8 sp38; + + + arg0->unk8 += arg2; + if (arg0->unk4 == 0) { + func_8035179C(arg1, sp54); + func_8024E71C(0, sp40); + sp3C = func_8038AD4C(arg0, arg1); + if (sp3C) { + func_8028F66C(0xD); + } + if (sp3C && ((sp40[0] != 0.0f) || (sp40[1] != 0.0f))) { + func_8024C764(sp70); + sp64[0] = sp40[0]; + sp64[1] = 0.0f; + sp64[2] = -sp40[1]; + ml_vec3f_yaw_rotate_copy(sp64, sp64, sp70[1]); + arg0->unkC[0] += sp64[0] * 2500.0f * arg2; + arg0->unkC[2] += sp64[2] * 2500.0f * arg2; + } else { + arg0->unkC[0] *= 0.7; + arg0->unkC[2] *= 0.7; + } + if (gu_sqrtf(arg0->unkC[0]*arg0->unkC[0] + arg0->unkC[1]*arg0->unkC[1] + arg0->unkC[2]*arg0->unkC[2]) > 400.0f) { + ml_vec3f_set_length(arg0->unkC, 400.0f); + } + sp54[0] += arg0->unkC[0] * arg2; + sp54[2] += arg0->unkC[2] * arg2; + func_80351B28(arg1, sp54); + func_8035179C(arg1, sp54); + if (arg0->unk0 != NULL) { + func_8024C5CC(sp7C); + sp64[0] = sp54[0] - sp7C[0]; + sp64[2] = sp54[2] - sp7C[2]; + sp64[1] = 0.0f; + ml_vec3f_normalize(sp64); + temp_v0_2 = marker_getActor(arg0->unk0); + temp_v0_2->position[0] = sp54[0] + (sp64[0] * 20.0f); + temp_v0_2->position[2] = sp54[2] + (sp64[2] * 20.0f); + } + } else if (arg0->unk4 == 2) { + if (arg0->unk8 >= 1.0f) { + arg0->unk4 = 3U; + if (arg0->unk0 != NULL) { + arg0->unk0->collidable = TRUE; + } + func_80351A04(arg1, 1); + } + arg0->unkC[0] *= 0.7; + arg0->unkC[2] *= 0.7; + } + if (arg0->unk4 == 1) { + sp38 = func_80351758(arg1); + sfxsource_setSampleRate(sp38, 0); + } else { + sp38 = func_80351758(arg1); + sfxsource_setSampleRate(sp38, (s32) ((gu_sqrtf(arg0->unkC[0]*arg0->unkC[0] + arg0->unkC[1]*arg0->unkC[1] + arg0->unkC[2]*arg0->unkC[2]) / 400.0) * 15000.0)); + } + player_getPosition(sp48); + func_8035179C(arg1, sp54); + if (!mapSpecificFlags_get(0) && (arg0->unk4 == 0) && (func_80258640(sp54, sp48) < 250.0f)){ + if(func_80311480(0xADA, 0, NULL, NULL, NULL, NULL)) { + mapSpecificFlags_set(0, TRUE); + } + } + if ((arg0->unk4 == 1) && mapSpecificFlags_get(1)) { + arg0->unk4 = 2U; + arg0->unk8 = 0.0f; + mapSpecificFlags_set(1, 0); + FUNC_8030E8B4(SFX_11B_TUMBLAR_DISAPPEARING_1, 1.0f, 30000, sp54, 500, 2500); + + } +} diff --git a/src/MMM/code_5000.c b/src/MMM/code_5000.c new file mode 100644 index 00000000..31c634fb --- /dev/null +++ b/src/MMM/code_5000.c @@ -0,0 +1,161 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void sfxsource_setSampleRate(u8, s32); + +void func_8038B6FC(Struct5Fs *arg0, Struct68s *arg1); + +s32 __mmm_5000_red[4] = {0xFF, 0, 0, 0xFF}; +s32 __mmm_5000_green[4] = {0, 0xFF, 0, 0xFF}; +s32 __mmm_5000_blue[4] = {0, 0, 0xFF, 0xFF}; + +/* .code */ +void func_8038B3F0(Struct5Fs *arg0, struct struct_68_s *arg1, f32 position[3], f32 rotation[3], f32 scale, BKModelBin *model_bin, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + s32 sp58[4]; + s32 temp_f4; + s32 sp44[4]; + s32 temp_f6; + s32 sp30[4]; + s32 temp_f8; + + if (arg0->unkC > 0.0f) { + temp_f4 = (s32) (((1.0f - arg0->unkC) * 223.0f) + 32.0f); + sp58[0] = temp_f4; + sp58[1] = temp_f4; + sp58[2] = temp_f4; + sp58[3] = 0xFF; + func_8033A334(sp58, __mmm_5000_red); + } else if (arg0->unk4 > 0.0f) { + temp_f6 = (s32) (((1.0f - arg0->unk4) * 223.0f) + 32.0f); + sp44[0] = temp_f6; + sp44[1] = temp_f6; + sp44[2] = temp_f6; + sp44[3] = 0xFF; + func_8033A334(sp44, __mmm_5000_green); + } else if (arg0->unk0 > 0.0f) { + temp_f8 = (s32) (((1.0f - arg0->unk0) * 223.0f) + 32.0f); + sp30[0] = temp_f8; + sp30[1] = temp_f8; + sp30[2] = temp_f8; + sp30[3] = 0xFF; + func_8033A334(sp30, __mmm_5000_blue); + } + set_model_render_mode(1); + func_803391A4(gfx, mtx, position, rotation, scale, NULL, model_bin); +} + +void func_8038B590(Struct5Fs *arg0, Struct68s *arg1){ + f32 sp1C[3]; + + arg0->unkA = 1; + arg0->unk10 = 0.0f; + sp1C[2] = sp1C[1] = arg0->unk10; + sp1C[0] = 5.0f; + func_80351C2C(arg1, sp1C); +} + +void func_8038B5D8(Struct5Fs *arg0, Struct68s *arg1, s32 arg2, s32 arg3){ + arg0->unk8 = arg3; + arg0->unk9 = arg2; + arg0->unkA = 0; + arg0->unk0 = 0.0f; + arg0->unk4 = 0.0f; + arg0->unkC = 0.0f; + arg0->unk10 = 0.0f; + arg0->unk14 = 0.0f; + func_80351A14(arg1, (Struct68DrawMethod)func_8038B3F0); +} + +void func_8038B630(Struct5Fs *arg0, Struct68s *arg1){ + u8 phi_s0; + u32 pad; + u32 pad1; + f32 sp20; + + sp20 = alCents2Ratio(func_80389BBC()*100); + phi_s0 = func_80351758(arg1); + func_8030E394(phi_s0); + func_8030DBB4(phi_s0, sp20); + sfxsource_setSfxId(phi_s0, 0x3f3); + func_8030DD14(phi_s0, 3); + sfxsource_setSampleRate(phi_s0, 0x7fff); + func_8030E2C4(phi_s0); + arg0->unk14 = 1.5f; + if(pad); + +} + +void func_8038B6D4(Struct5Fs * arg0, Struct68s *arg1) { + arg0->unk0 = 1.0f; + func_8038B6FC(arg0, arg1); +} + +void func_8038B6FC(Struct5Fs *arg0, Struct68s *arg1){ + func_8038B590(arg0, arg1); + func_8038B630(arg0, arg1); +} + +void func_8038B72C(Struct5Fs *arg0, Struct68s * arg1) { + arg0->unk4 = 1.0f; + func_8038B6FC(arg0, arg1); +} + +void func_8038B754(Struct5Fs *arg0, Struct68s * arg1){ + func_8038B590(arg0, arg1); + arg0->unkC = 1.0f; + func_8025A6EC(COMUSIC_2C_BUZZER, 28000); +} + +void func_8038B790(Struct5Fs *arg0, Struct68s *arg1, f32 arg2) { + f32 sp2C[3]; + f32 temp_f0_6; + s32 temp_v0; + + arg0->unk10 += arg2; + if (arg0->unk14 > 0.0f) { + arg0->unk14 -= arg2; + if (arg0->unk14 <= 0.0f) { + func_80351954(arg1); + } else if (arg0->unk14 <= 1.0f) { + sfxsource_setSampleRate(func_80351758(arg1), (s32)(arg0->unk14 * 32767.0f)); + } + } + + if (arg0->unkC > 0.0f) { + arg0->unkC -= 1 * arg2; + } + + if (arg0->unk4 > 0.0f) { + arg0->unk4 -= 1 * arg2; + } + + if (arg0->unk0 > 0.0f) { + arg0->unk0 -= 1 * arg2; + } + + func_80351814(arg1, sp2C); + if (func_803518C0(arg1) != 0) { + temp_v0 = func_80389CE8(arg0, arg1, arg0->unk8); + if (temp_v0 == 0) { + func_8038B6FC(arg0, arg1); + } + else if (temp_v0 == 1) { + func_8038B72C(arg0, arg1); + } + else if (temp_v0 == 2) { + func_8038B754(arg0, arg1); + } + } else { + if (arg0->unkA == 1) { + temp_f0_6 = arg0->unk10 / 0.3; + if (temp_f0_6 >= 1.0f) { + sp2C[0] = 0.0f; + arg0->unkA = 0U; + } else { + sp2C[0] = (1 - temp_f0_6) * 5.0f; + } + } + func_80351C2C(arg1, sp2C); + } +} diff --git a/src/MMM/code_DC0.c b/src/MMM/code_DC0.c new file mode 100644 index 00000000..312454f0 --- /dev/null +++ b/src/MMM/code_DC0.c @@ -0,0 +1,94 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80387280(Actor *this); + +/* .data */ +ActorAnimationInfo D_8038BA50[] = { + {0x00, 0.0f}, + {ASSET_A9_ANIM_FLOWER_POT, 2.0f}, + {ASSET_A9_ANIM_FLOWER_POT, 2.0f} +}; + +ActorInfo D_8038BA68 = { + MARKER_34_CEMETARY_POT, ACTOR_25_CEMETARY_POT, ASSET_3AE_MODEL_GRAVE_FLOWER_POT, + 0x1, D_8038BA50, + func_80387280, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +//chflowerpots_getRemaining +s32 func_803871B0(void) { + return levelSpecificFlags_getN(0x39, 3); +} + +//chflowerpots_setRemaining +void func_803871D4(s32 arg0) { + levelSpecificFlags_setN(0x39, arg0, 3); +} + +void func_803871FC(Actor *this){ + switch(this->state){ + case 1: + func_8033A45C(3, FALSE); + break; + case 2: + func_8033A45C(3, TRUE); + break; + } + func_803255FC(this); +} + +void func_80387260() { + func_803871D4(5); +} + +//chflowerpots_update +void func_80387280(Actor *this){ + this->marker->propPtr->unk8_3 = TRUE; + if(!this->initialized){ + this->initialized = TRUE; + this->unk130 = func_803871FC; + } + + switch(this->state){ + case 1: + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_STOPPED); + break; + + case 2: + if(actor_animationIsAt(this, 0.2f)){ + FUNC_8030E8B4(SFX_12F_FUUUCK_YOUUU, 1.0f, 30000, this->position, 300, 2000); + } + break; + } +} + +bool func_80387340(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + f32 sp20[3]; + s32 sp1C; + + if(actor->state == 2) + return FALSE; + + func_80328A84(actor, 2); + animctrl_setPlaybackType(actor->animctrl, ANIMCTRL_ONCE); + sp1C = func_803871B0(); + if(sp1C != 0){ + sp1C--; + if(sp1C == 0){ + ml_vec3f_copy(sp20, actor->position); + sp20[1] += 80.0f; + func_8025A70C(COMUSIC_2D_PUZZLE_SOLVED_FANFARE); + jiggySpawn(JIGGY_63_MMM_FLOWER_POTS, sp20); + } + else{ + func_8025A70C(COMUSIC_2B_DING_B); + } + } + func_803871D4(sp1C); + return TRUE; +} \ No newline at end of file diff --git a/src/RBB/code_0.c b/src/RBB/code_0.c new file mode 100644 index 00000000..5e3ef733 --- /dev/null +++ b/src/RBB/code_0.c @@ -0,0 +1,169 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80324E88(f32); + +/* typedefs and declarations */ +typedef struct { + s32 unk0; + s32 unk4; + s32 unk8; + s32 unkC; +}ActorLocal_RBB_0; + +typedef struct { + u8 unk0; + u8 unk1; + u8 unk2; + //u8 pad3[1]; + f32 unk4; + s16 unk8; + s16 unkA; + s16 unkC; + //u8 padE[2]; +}Struct_RBB_0_1; + + +void func_803866F4(Actor *this, s32 arg1); +void func_803868F0(Actor* this); + +/* .data */ +ActorInfo D_80390050 = { + MARKER_182_RBB_EGG_TOLL, ACTOR_172_RBB_EGG_TOLL, ASSET_402_MODEL_RBB_EGG_TOLL, + 0x0, NULL, + func_803868F0, NULL, func_80325340, + 0, 0, 0.0f, 0 +}; +Struct_RBB_0_1 D_80390074[4] = { + {0x0, 0x2, 0x4, 3.0f, 550, 200, -300}, + {0x1, 0x4, 0x0, 4.0f, -600, 0, 0}, + {0x2, 0x6, 0x0, 4.0f, -700, 0, 0}, + {0x3, 0x8, 0x0, 4.0f, -1010, 0, 0} +}; + +/* .code */ +void func_803863F0(Actor *actor, s32 arg1){ + ActorLocal_RBB_0 * local = (ActorLocal_RBB_0 *) &actor->local; + void *temp_a0; + f32 sp3C[3]; + f32 sp30[3]; + + temp_a0 = func_8034C528(local->unk4 + 0x190); + if(temp_a0){ + if(local->unk8 == 0){ + sp3C[2] = 0.0f; + sp30[0] = 0.0f; + sp30[1] = 0.0f; + sp3C[0] = sp3C[1] = sp3C[2]; + sp30[2] = (f32) D_80390074[local->unk4].unk8; + } + else if(local->unk8 == 1){ + sp3C[0] = 0.0f; + sp3C[1] = 0.0f; + sp3C[2] = (f32) D_80390074[local->unk4].unk8; + sp30[1] = 0.0f; + sp30[0] = 0.0f; + sp30[2] = (f32) D_80390074[local->unk4].unkA; + } + else{ + sp3C[0] = 0.0f; + sp3C[1] = 0.0f; + sp3C[2] = (f32) D_80390074[local->unk4].unkA; + sp30[1] = 0.0f; + sp30[0] = 0.0f; + sp30[2] = (f32) D_80390074[local->unk4].unkC; + + } + if(arg1){ + func_8034DDF0(temp_a0, &sp3C, &sp30, D_80390074[local->unk4].unk4, 1); + func_8034E174(temp_a0); + } + else{ + func_8034DDF0(temp_a0, &sp3C, &sp30, 0.0f, 1); + } + } +} + +void func_803865A4(ActorMarker *marker, s32 arg1){ + func_803866F4(marker_getActor(marker), arg1); +} + +void func_803865D0(ActorMarker *marker){ + Actor* actor = marker_getActor(marker); + ActorLocal_RBB_0 * local = (ActorLocal_RBB_0 *) &actor->local; + func_803863F0(actor, 1); + timed_setCameraToNode(0.0f, D_80390074[local->unk4].unk0); + timedFunc_set_2(0.75*D_80390074[local->unk4].unk4, (TFQM2) func_803865A4, actor->marker, 4); + func_80324E88(0.75*D_80390074[local->unk4].unk4); + func_80324E38(0.75*D_80390074[local->unk4].unk4, 0); + timed_playSfx(D_80390074[local->unk4].unk4, SFX_7F_HEAVYDOOR_SLAM, 0.8f, 0x7fd0); +} + +void func_803866F4(Actor *this, s32 arg1){ + ActorLocal_RBB_0 *local = (ActorLocal_RBB_0 *) &this->local; + + + if(arg1 == 2){ + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + local = (ActorLocal_RBB_0 *) &this->local; + local->unkC = 3; + } + if(arg1 == 3){ + local->unk8++; + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + func_80324E38(0.0f, 3); + timedFunc_set_2(0.5f, (TFQM2) func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + timedFunc_set_1(1.0f, (TFQM1) func_803865D0, this->marker); + }//L803867D4 + if(arg1 == 4){ + if(local->unk8 == 1 && D_80390074[local->unk4].unk2 > 0){ + func_803866F4(this, 1); + return; + } + } + + this->state = arg1; +} + +void func_8038685C(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + ActorLocal_RBB_0 *local = (ActorLocal_RBB_0 *) &actor->local; + + if(actor->state == 1){ + local->unk0++; + if( D_80390074[local->unk4].unk1 == local->unk0 + || D_80390074[local->unk4].unk1 + D_80390074[local->unk4].unk2 == local->unk0 + ){ + func_803866F4(actor, 3); + }else{ + func_803866F4(actor, 2); + } + } +} + +void func_803868F0(Actor *this){ + ActorLocal_RBB_0 *local = (ActorLocal_RBB_0 *) &this->local; + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + if(this->state == 0){ + local->unk0 = 0; + local->unk4 = 0; + local->unk8 = 0; + local->unkC = 0; + local->unk4 = (this->unk78_13 == 0x15)? 0: local->unk4; + local->unk4 = (this->unk78_13 == 0x13)? 1: local->unk4; + local->unk4 = (this->unk78_13 == 0x14)? 2: local->unk4; + local->unk4 = (this->unk78_13 == 0xB)? 3: local->unk4; + func_803866F4(this, 1); + } + func_803863F0(this, 0); + }//L803869F4 + if(this->state == 2){ + if(--local->unkC <= 0){ + func_803866F4(this, 1); + } + + } +} \ No newline at end of file diff --git a/src/RBB/code_1570.c b/src/RBB/code_1570.c new file mode 100644 index 00000000..7283eb4a --- /dev/null +++ b/src/RBB/code_1570.c @@ -0,0 +1,236 @@ +#include +#include "functions.h" +#include "variables.h" + + + + +/* typedefs and declarations */ +void func_803881E8(Actor *this, s32 arg1); +void func_803882F4(Actor *this); + +/* .data */ +ActorInfo D_80390270 = { + 0x184, 0x174, 0x402, 0x0, NULL, + func_803882F4, NULL, func_80325340, + 0, 0, 0.0f, 0 +}; + +s32 D_80390294[4] = { 0xff, 0, 0, 0xff}; +s32 D_803902A4[4] = { 0x76, 0, 0, 0xff}; +s32 D_803902B4[4] = { 0x76, 0, 0, 0xff}; +s32 D_803902C4[4] = { 0xff, 0, 0, 0xff}; + + +f32 D_803902D4[3] = {4500.0f, 0.0f, 500.0f}; +f32 D_803902E0[3] = {4500.0f, 0.0f, 500.0f}; +f32 D_803902EC[3] = {4000.0f, -600.0f, 0.0f}; +f32 D_803902F8[3] = {4500.0f, 0.0f, 500.0f}; +struct31s D_80390304 = { + { 5.0f, 5.0f}, + { 5.0f, 5.0f}, + { 0.0f, 0.01f}, + { 3.0f, 5.0f}, + 0.0f, + 0.1f +}; + +f32 D_8039032C[3] = {3700.0f, -300.0f, -300.0f}; +f32 D_80390338[3] = {4500.0f, 100.0f, 400.0f}; +struct41s D_80390344= { + {{-700.0f, 200.0f, -700.0f}, {700.0f, 500.0f, 700.0f}}, + {{ 0.0f, -800.0f, 0.0f}, { 0.0f, -800.0f, 0.0f}} +}; + +/*.code */ +void func_80387960(f32 arg0){ + f32 sp34[3]; + void * temp_v0; + f32 sp24[3]; + + sp34[0] = sp34[1] = sp34[2] =0.0f; + sp24[0] = 0.0f; + sp24[1] = 0.0f; + sp24[2] = -40.0f; + + if(temp_v0 = func_8034C528(0x19e)){ + func_8034DDF0(temp_v0, &sp34, &sp24, arg0, 1); + } + if(temp_v0 = func_8034C528(0x19f)){ + func_8034DDF0(temp_v0, &sp34, &sp24, arg0, 1); + } +} + +void func_803879F0(void){ + s32 temp_v0 = func_8034C528(0x19b); + f32 sp30[3]; + f32 sp24[3]; + if(temp_v0){ + TUPLE_ASSIGN(sp30, 0.0f, 0.0f, 0.0f); + TUPLE_ASSIGN(sp24, 0.0f, -1000.0f, 0.0f); + func_8034DC08(temp_v0, &sp30, &sp24, 1.5f, 1); + } +} + +void func_80387A54(void){ + s32 temp_v0 = func_8034C528(0x19b); + f32 sp30[3]; + f32 sp24[3]; + if(temp_v0){ + TUPLE_ASSIGN(sp30, 0.0f, -1000.0f, 0.0f); + TUPLE_ASSIGN(sp24, 0.0f, -2000.0f, 0.0f); + func_8034DDF0(temp_v0, &sp30, &sp24, 1.0f, 1); + } +} + +void func_80387AC0(void){ + s32 temp_v0 = func_8034C528(0x19b); + f32 sp30[3]; + f32 sp24[3]; + if(temp_v0){ + TUPLE_ASSIGN(sp30, 0.0f, 0.0f, 0.0f); + TUPLE_ASSIGN(sp24, 0.0f, -2000.0f, 0.0f); + func_8034DDF0(temp_v0, &sp30, &sp24, 0.0f, 1); + } +} + +void func_80387B24(void){ + s32 temp_v0 = func_8034C528(0x1a0); + f32 sp30[3]; + f32 sp24[3]; + if(temp_v0){ + TUPLE_ASSIGN(sp30, 0.0f, 0.0f, 0.0f); + TUPLE_ASSIGN(sp24, 0.0f, -500.0f, 0.0f); + func_8034DDF0(temp_v0, &sp30, &sp24, 0.1f, 1); + } +} + +void func_80387B8C(s32 arg0, s32 arg1){ + s32 v0 = func_8034C528(arg0); + if(v0){ + func_8034DFB0(v0, &D_80390294, &D_803902A4, (f64)arg1/1000.0); + } +} + +void func_80387BEC(s32 arg0, s32 arg1){ + s32 v0; + func_8030E6D4(SFX_90_SWITCH_PRESS); + if(v0 = func_8034C528(arg0)){ + func_8034DFB0(v0, &D_803902B4, &D_803902C4, (f64)arg1/1000.0); + } +} + +void func_80387C5C(void){ + ParticleEmitter *actor; + + func_802BB3DC(0, 60.0f, 0.9f); + actor = partEmitList_pushNew(1); + particleEmitter_setSprite(actor, ASSET_4A0_SPRITE_EXPLOSION); + func_802EFA5C(actor, 0.1f, 0.2f); + func_802EFA70(actor, 8); + particleEmitter_setStartingFrameRange(actor, 0, 0); + particleEmitter_setParticleFramerateRange(actor, 4.0f, 4.0f); + func_802EFB70(actor, 10.0f, 10.0f); + func_802EFB84(actor, 15.0f, 20.0f); + func_802EFEC0(actor, 4.0f, 4.0f); + particleEmitter_setParticleVelocityRange(actor, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + func_802EF3F4(actor, &D_803902D4, &D_803902E0, 1); +} + +void func_80387D80(void){ + ParticleEmitter *actor = partEmitList_pushNew(3); + particleEmitter_setSprite(actor, ASSET_70E_SPRITE_SMOKE_2); + particleEmitter_setStartingFrameRange(actor, 0, 7); + func_802EFB98(actor, &D_80390304); + particleEmitter_setParticleVelocityRange(actor, 0.0f, 100.0f, 0.0f, 0.0f, 200.0f ,0.0f); + func_802EF3F4(actor, &D_803902EC, &D_803902F8, 3); +} + +void func_80387E20(void){ + ParticleEmitter *actor = partEmitList_pushNew(0x19); + func_802EF9F8(actor, 0.6f); + func_802EFA18(actor, 3); + particleEmitter_setModel(actor, 0x427); + func_802EFB70(actor, 0.05f, 0.4f); + func_802EFE24(actor, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setSpawnIntervalRange(actor, 0.0f, 0.01f); + func_802EFEC0(actor, 10.0f, 10.0f); + particleEmitter_setVelocityAndAccelerationRanges(actor, &D_80390344); + func_802EF3F4(actor, &D_8039032C, &D_80390338, 0x19); +} + +void func_80387F18(ActorMarker *marker, s32 arg1){ + func_803881E8(marker_getActor(marker), arg1); +} + +void func_80387F44(void){ + func_80250E94(0.5f, 1.0f, 1.5f, 0.0f, 1.0f, 1.5f); +} + +void func_80387F88(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + + timedFunc_set_0(0.0f, func_80387C5C); + timed_playSfx(0.1f, SFX_1B_EXPLOSION_1, 1.0f, 22000); + timed_playSfx(0.1f, SFX_1B_EXPLOSION_1, 1.0f, 22000); + timedFunc_set_0(0.3f, func_80387E20); + timedFunc_set_0(0.5f, func_80387A54); + timedFunc_set_0(0.4f, func_80387B24); + timed_playSfx(0.41f, SFX_1B_EXPLOSION_1, 0.8f, 22000); + timed_playSfx(0.41f, SFX_1B_EXPLOSION_1, 0.8f, 22000); + timedFunc_set_0(0.55f, func_80387D80); + timed_playSfx(0.71f, SFX_1B_EXPLOSION_1, 0.6f, 22000); + timed_playSfx(0.71f, SFX_1B_EXPLOSION_1, 0.6f, 22000); + timedFunc_set_0(0.8f, func_80387D80); + timed_playSfx(1.0f, SFX_1A_BIG_THINGS_FALL_OVER, 1.0f, 22000); + timed_playSfx(2.0f, SFX_1A_BIG_THINGS_FALL_OVER, 0.8f, 22000); + timed_playSfx(3.0f, SFX_1A_BIG_THINGS_FALL_OVER, 0.6f, 22000); + func_80324E88(4.0f); + func_80324E38(4.0f, 0); + timedFunc_set_2(4.0f, (TFQM2) func_80387F18, (s32) actor->marker, 3); +} + +void func_80388154(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + func_803879F0(); + timedFunc_set_0(0.0f, (TFQM0) func_80387F44); + timed_playSfx(0.0f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 0x7fc6); + timedFunc_set_2(1.2f, (TFQM2) func_80387B8C, 0x19f, 0); + timed_setCameraToNode(1.2f, 8); + timedFunc_set_1(1.5f, (TFQM1) func_80387F88, (s32) actor->marker); +} + +void func_803881E8(Actor *this, s32 arg1){ + this->state = arg1; + if(this->state == 2){ + func_80387960(0.05f); + timedFunc_set_2(0.05f, (TFQM2)func_80387BEC, 0x19f, 0x1f4); + timedFunc_set_2(0.1f, (TFQM2)func_8025A6EC, COMUSIC_2B_DING_B, 28000); + func_80324E38(0.2f, 3); + timed_setCameraToNode(1.1f, 7); + timedFunc_set_1(1.6f, (TFQM1)func_80388154, (s32)this->marker); + levelSpecificFlags_set(0x2D, 1); + } +} + +void func_803882B4(ActorMarker *marker, s32 arg1){ + Actor *actor = marker_getActor(marker); + if(actor->state == 1) + func_803881E8(actor, 2); +} + +void func_803882F4(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = 1; + if(levelSpecificFlags_get(0x2d)){ + func_80387AC0(); + func_80387960(0.0f); + func_80387B24(); + func_803881E8(this, 3); + }else{ + marker_setCollisionScripts(this->marker, NULL, func_803882B4, NULL); + func_8032AA58(this, 1.1f); + func_803881E8(this, 1); + } + } +} \ No newline at end of file diff --git a/src/RBB/code_1FC0.c b/src/RBB/code_1FC0.c new file mode 100644 index 00000000..586638ba --- /dev/null +++ b/src/RBB/code_1FC0.c @@ -0,0 +1,183 @@ +#include +#include "functions.h" +#include "variables.h" + +/* typedefs and declarations */ +typedef struct { + f32 unk0; + u8 unk4; + u8 unk5; + f32 unk8; + f32 unkC; + f32 unk10; + f32 unk14; +}ActorLocal_RBB_1FC0; + +Actor *func_8038846C(ActorMarker * marker, Gfx **gdl, Mtx **mptr, Vtx **arg3); +void func_80388620(Actor *this); + +/* .data */ +ActorInfo D_80390380 = { + 0x2E, 0x1C6, 0x419, 0x0, NULL, + func_80388620, NULL, func_8038846C, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_803883B0(Actor *this, s32 arg1){ + ActorLocal_RBB_1FC0 *local = (ActorLocal_RBB_1FC0 *)&this->local; + + local->unk5 = 0; + if(arg1 == 2){ + FUNC_8030E624(SFX_66_BIRD_AUUGHH, 0.6f, 32675); + func_80335924(this->unk148, 0x137, 0.0f, 0.8f); + func_80335A8C(this->unk148, 2); + } + this->state = arg1; +} + +void func_80388430(ActorMarker * marker, ActorMarker *other_marker){ + Actor * actor = marker_getActor(marker); + ActorLocal_RBB_1FC0 *local = (ActorLocal_RBB_1FC0 *) &actor->local; + func_8030E6D4(SFX_111_WHIPCRACK_DEATH); + local->unk5 = 1; +} + +Actor *func_8038846C(ActorMarker * marker, Gfx **gdl, Mtx **mptr, Vtx **vtx){ + Actor *actor = marker_getActor(marker); + ActorLocal_RBB_1FC0 *local = (ActorLocal_RBB_1FC0 *) &actor->local; + s32 sp5C; + f32 pad58; + f32 sp4C[3]; + f32 sp40[3]; + f32 sp34[3]; + + if(actor->state == 0){ + return actor; + } + + if(local->unk4){ + sp5C = func_803356A0(actor->unk148); + sp40[0] = 0.0f; + sp40[1] = local->unk0; + sp40[2] = 0.0f; + func_80345C78(&sp4C, &sp40); + func_8033A8F0(sp5C, 1, &sp4C); + + sp34[0] = 0.0f; + sp34[1] = 0.0f; + sp34[2] = (local->unkC*0.5)/200.0; + ml_vec3f_yaw_rotate_copy(sp34, sp34, local->unk0); + func_8033A968(sp5C, 1, sp34); + + sp34[0] = 0.0f; + sp34[1] = 0.0f; + sp34[2] = local->unkC/200.0f; + func_8033A968(sp5C, 0x12, sp34); + func_80335918(actor->unk148); + } + func_8033A45C(3, (0.0f < local->unk8)? 1 : 0); + func_8033A45C(4, (0.0f < local->unk8)? 1 : 0); + func_80325888(marker, gdl, mptr, vtx); + local->unk4 = actor->marker->unk14_21; + return actor; +} + +void func_80388620(Actor *this){ + f32 plyr_pos[3]; + f32 sp60; + f32 sp5C; + f32 sp58; + ActorLocal_RBB_1FC0 *local = (ActorLocal_RBB_1FC0 *)&this->local; + f32 sp50 = time_getDelta(); + f32 sp4C; + f32 sp48; + f32 tmp_f2; + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + this->marker->propPtr->unk8_3 = 1; + marker_setCollisionScripts(this->marker, func_80388430, NULL, NULL); + local->unk4 = 0; + local->unk0 = 0.0f; + local->unk8 = 0.0f; + local->unkC = 0.0f; + local->unk10 = 0.0f; + local->unk14 = 0.0f; + func_803883B0(this, 1); + } + player_getPosition(plyr_pos); + func_80258A4C(this->position, this->yaw + -90.0f, plyr_pos, &sp60, &sp5C, &sp58); + if(sp60 < 600.0f) + local->unk8 = 1.0f; + else{ + local->unk8 -= sp50; + local->unk8 = MAX(0.0f, local->unk8); + } + + if( 500.0f <= local->unk10 + && sp60 < 500.0f + && (sp58 < -0.2 || 0.2 < sp58) + ){ + FUNC_8030E624(SFX_C4_TWINKLY_MUNCHER_GRR, 0.8f, 32675); + } + + local->unk10 = sp60; + local->unk14 = local->unk14 + sp50; + + if( sp60 < 600.0f + && -1.0f < sp58 + && sp58 < 1.0f + && plyr_pos[1] < this->position_y + this->scale*200.0f + ){ + func_80258A4C(this->position, (this->yaw + -90.0f) + local->unk0, plyr_pos, &sp60, &sp5C, &sp58); + local->unk0 += (sp58*200.0f)*sp50; + if(1.0f < local->unk14 && (sp58 < -0.1 || 0.1 < sp58)){ + func_8030E6A4(SFX_D0_GRIMLET_SQUEAK, mlAbsF(sp58) * 0.1 + 0.9, 0x4e20); + local->unk14 = 0.0f; + } + } + else{//L80388964 + if(0.0f < local->unk0){ + local->unk0 -= 30.0f*sp50; + local->unk0 = MAX(0.0f, local->unk0); + }//L803889B4 + else{ + if(local->unk0 < 0.0f){ + local->unk0 += 30.0f*sp50; + local->unk0 = MIN(0.0f, local->unk0); + } + } + }//L803889F8 + + if(this->state == 1){ + if( sp60 < 400.0f + && -0.8 <= sp58 + && sp58 <= 0.8 + && (plyr_pos[1] - this->position_y) < 100.0f + && -100.0f < (plyr_pos[1] - this->position_y) + ){ + func_803883B0(this, 2); + } + }//L80388AB8 + + if(this->state == 2){ + func_8033568C(this->unk148, &sp4C, &sp48); + if(0.6 <= sp48) + tmp_f2 = 1.0 - 2*(sp48 - 0.6); + else + tmp_f2 = sp48*1.6666666666666667; + //L80388B34 + local->unkC = tmp_f2*sp60; + + if( sp4C < 0.55 + && 0.55 <= sp48 + && !local->unk5 + ){ + FUNC_8030E8B4(SFX_20_METAL_CLANK_1, 1.0f, 32000, this->position, 500, 2500); + } + + if(func_80335794(this->unk148) > 0) + func_803883B0(this, 1); + }//L80388BB0 +} diff --git a/src/RBB/code_27E0.c b/src/RBB/code_27E0.c new file mode 100644 index 00000000..939ec8b6 --- /dev/null +++ b/src/RBB/code_27E0.c @@ -0,0 +1,84 @@ +#include +#include "functions.h" +#include "variables.h" + +/* typedefs and declarations */ +typedef struct { + u8 unk0; +}ActorLocal_RBB_27E0; + +void func_80388C20(Actor *this); + +/* .data */ +ActorInfo D_803903B0 = { + 0x18B, 0x17B, 0x409, 0x0, NULL, + func_80388C20, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_803903D4 = { + 0x18C, 0x17C, 0x40A, 0x0, NULL, + func_80388C20, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_803903F8 = { + 0x18D, 0x17D, 0x40B, 0x0, NULL, + func_80388C20, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +f32 D_8039041C[3] = {40.0f, -30.0f, 20.0f}; //rotation rates (deg/sec); + +/* .code */ +void func_80388BD0(Actor *this, s32 arg1){ + this->state = arg1; +} + +void func_80388BE8(Actor *actor){ + ActorLocal_RBB_27E0 *local = (ActorLocal_RBB_27E0 *)&actor->local; + if(actor->modelCacheIndex == 0x17b){ + func_8030DA44(local->unk0); + } +} + +void func_80388C20(Actor *this){ + ActorLocal_RBB_27E0 *local = (ActorLocal_RBB_27E0 *)&this->local; + f32 sp28 = time_getDelta(); + if(!this->unk16C_4){ + actor_collisionOff(this); + this->marker->propPtr->unk8_3 = 1; + this->marker->unk30 = func_80388BE8; + this->unk16C_4 = 1; + if(this->modelCacheIndex == 0x17B){ + local->unk0 = func_8030D90C(); + func_8030DEB4(local->unk0, 1000.0f, 2000.0f); + func_8030DF68(local->unk0, &this->position); + func_8030DBB4(local->unk0, 0.5f); + sfxsource_setSfxId(local->unk0, SFX_9F_GENERATOR_RUNNING); + func_8030DD14(local->unk0, 3); + sfxsource_setSampleRate(local->unk0, 0); + func_8030E2C4(local->unk0); + }//L80388CFC + if(this->state == 0){ + if(this->modelCacheIndex == 0x17B){ + TUPLE_ASSIGN(this->position, 0.0f, -50.0f, 700.0f); + } + else if(this->modelCacheIndex == 0x17C){//L80388DA8 + TUPLE_ASSIGN(this->position, 0.0f, -50.0f, 500.0f); + } + else if(this->modelCacheIndex == 0x17D){ + TUPLE_ASSIGN(this->position, 0.0f, -50.0f, 300.0f); + } + func_80388BD0(this, 1); + } + }//L80388DA8 + if(this->state == 1){ + this->roll += D_8039041C[this->modelCacheIndex - 0x17B]*sp28; + if(360.0f <= this->roll) + this->roll -= 360.0f; + if(this->modelCacheIndex == 0x17B){ + func_8030DB04(local->unk0, 0x61a8, &this->position, 1000.0f, 2000.0f); + } + } +} diff --git a/src/RBB/code_2A70.c b/src/RBB/code_2A70.c new file mode 100644 index 00000000..b5c07402 --- /dev/null +++ b/src/RBB/code_2A70.c @@ -0,0 +1,129 @@ +#include +#include "functions.h" +#include "variables.h" + +/* typedefs and declarations */ +typedef struct { + s16 unk0; + f32 unk4[3]; + f32 unk10; + f32 unk14; + f32 unk18[3]; +}ActorLocal_RBB_2A70_0; + +typedef struct { + ActorLocal_RBB_2A70_0 *unk0; + f32 unk4[3]; + f32 unk10[3]; + f32 unk1C; + u8 pad20[0x4]; + f32 unk24; +}ActorLocal_RBB_2A70; + +void func_803890BC(Actor *this); + +/* .data */ +ActorLocal_RBB_2A70_0 D_80390430[] = { + {0x178, {0.0f, -60.0f, 2450.0f}, 0.0f, 6.0f, { 0.0f, -100.0f, 1900.0f}}, + {0x179, {-1600.0f, 730.0f, -700.0f}, 270.0f, 6.0f, { -1600.0f, 810.0f, -1400.0f}}, + {0x17A, {1600.0f, 730.0f, -700.0f}, 270.0f, 5.0f, { 1600.0f, 810.0f, -1400.0f}}, + 0 +}; + +ActorInfo D_803904C0 = { + 0x188, 0x178, 0x40C, 0x0, NULL, + func_803890BC, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_803904E4 = { + 0x189, 0x179, 0x40D, 0x0, NULL, + func_803890BC, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80390508 = { + 0x18A, 0x17A, 0x40E, 0x0, NULL, + func_803890BC, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +ActorLocal_RBB_2A70_0 *func_80388E60(Actor *this){ + ActorLocal_RBB_2A70_0 * iPtr; + for(iPtr = D_80390430; iPtr->unk0 != 0; iPtr++){ + if(iPtr->unk0 == this->modelCacheIndex) + return iPtr; + } + return NULL; +} + +void func_80388EB8(Actor *this, s32 arg1){ + ActorLocal_RBB_2A70 *local = (ActorLocal_RBB_2A70 *)&this->local; + s32 sp30; + + if(this->state == 2) + FUNC_8030E8B4(SFX_7F_HEAVYDOOR_SLAM, 0.8f, 32000, this->position, 1000, 2300); + + this->state = arg1; + local->unk24 = 0.0f; + + if(this->state == 1) + local->unk24 = local->unk0->unk14; + + if(this->state == 2){ + sp30 = func_802F9AA8(SFX_94_COGS_ROTATING); + func_802F9DB8(sp30, 1.0f, 1.0f, 0.0f); + func_802F9EC4(sp30, &local->unk0->unk18, 1700, 2500); + func_802F9F80(sp30, 0.3f, 3.4f, 0.3f); + func_802FA060(sp30, 25000, 25000, 0.0f); + this->pitch += ( 360.0f <= this->pitch) ? -360 : 0; + this->yaw += ( 360.0f <= this->yaw) ? -360 : 0; + this->roll += ( 360.0f <= this->roll) ? -360 : 0; + + local->unk4[0] = this->pitch; + local->unk4[1] = this->yaw; + local->unk4[2] = this->roll; + + local->unk10[0] = this->pitch; + local->unk10[1] = this->yaw; + local->unk10[2] = this->roll + 360.0f; + + local->unk1C = 0.0f; + FUNC_8030E8B4(SFX_7F_HEAVYDOOR_SLAM, 0.8f, 32000, this->position, 900, 1800); + }//L803890A8 +} + +void func_803890BC(Actor *this){ + ActorLocal_RBB_2A70 *local = (ActorLocal_RBB_2A70 *)&this->local; + f32 sp38 = time_getDelta(); + f32 sp2C[3]; + if(!this->unk16C_4){ + actor_collisionOff(this); + this->marker->propPtr->unk8_3 = 1; + this->unk16C_4 = 1; + local->unk0 = func_80388E60(this); + this->position[0] = local->unk0->unk4[0]; + this->position[1] = local->unk0->unk4[1]; + this->position[2] = local->unk0->unk4[2]; + this->roll = local->unk0->unk10; + if(this->state == 0) + func_80388EB8(this, 1); + }//L80389164 + + if(func_8025773C(&local->unk24, sp38)) + func_80388EB8(this, (this->state == 1) ? 2 : 1); + //L803891A8 + + if(this->state == 2){ + local->unk1C += 0.25 * sp38; + if(1.0f < local->unk1C) + local->unk1C = 1.0f; + func_80255FE4(sp2C, local->unk4, local->unk10, local->unk1C); + this->pitch = sp2C[0]; + this->yaw = sp2C[1]; + this->roll = sp2C[2]; + if(local->unk1C == 1.0f) + func_80388EB8(this, 1); + }//L80389264 +} diff --git a/src/RBB/code_2E90.c b/src/RBB/code_2E90.c new file mode 100644 index 00000000..ab3c05a4 --- /dev/null +++ b/src/RBB/code_2E90.c @@ -0,0 +1,200 @@ +#include +#include "functions.h" +#include "variables.h" + +/* typedefs and declarations */ +typedef struct { + s16 uid; + f32 unk4[3]; + f32 unk10[3]; + f32 unk1C[3]; + f32 unk28[3]; + f32 unk34[3]; + f32 unk40; +}Struct_RBB_2E90_0; + +typedef struct { + f32 unk0[3]; + Struct_RBB_2E90_0 *unkC; + f32 unk10[3]; + f32 unk1C[3]; + f32 unk28; +}ActorLocal_RBB_2E90; + +void func_8038944C(Actor *this); + + +/* .data */ +Struct_RBB_2E90_0 D_80390530[] = { + { + 0x1BB, + {0.0f, 641.45f, -1400.0f}, + {0.0f, 0.0f, 90.0f}, + {0.0f, 0.0f, 360.0f}, + {0.0f, 0.0f, 270.0f}, + {0.0f, 0.0f, 90.0f}, + 4.0f + }, + { + 0x1BC, + {-800.0f, 641.45f, -2400.0f}, + { 95.0f, 0.0f, 0.0f}, + {380.0f, 0.0f, 0.0f}, + {285.0f, 0.0f, 0.0f}, + { 90.0f, 0.0f, 0.0f}, + 4.25f + }, + { + 0x1BD, + {800.0f, 641.45f, -2400.0f}, + {100.0f, 0.0f, 0.0f}, + {400.0f, 0.0f, 0.0f}, + {300.0f, 0.0f, 0.0f}, + {90.0f, 0.0f, 0.0f}, + 4.5f + }, + {0} +}; + +ActorInfo D_80390640 = { + 0x191, 0x1BB, 0x40F, 0x0, NULL, + func_8038944C, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80390664 = { + 0x192, 0x1BC, 0x410, 0x0, NULL, + func_8038944C, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80390688 = { + 0x193, 0x1BD, 0x411, 0x0, NULL, + func_8038944C, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +Struct_RBB_2E90_0 * func_80389280(Actor *this){ + Struct_RBB_2E90_0 * iPtr; + for(iPtr = D_80390530; iPtr->uid != 0; iPtr++){ + if(iPtr->uid == this->modelCacheIndex) + return iPtr; + } + return NULL; +} + +void func_803892D8(Actor *this, s32 arg1){ + f32 pad; + ActorLocal_RBB_2E90 *local = (ActorLocal_RBB_2E90 *)&this->local; + this->state = arg1; + + local->unk28 = 0.0f; + if(this->state == 1){ + local->unk0[2] = 0.0f; + local->unk0[1] = 0.0f; + local->unk0[0] = 0.0f; + ml_vec3f_copy(&local->unk10, &local->unkC->unk1C); + ml_vec3f_copy(&local->unk1C, &local->unkC->unk1C); + }//L8038935C + + if(this->state == 2){ + ml_vec3f_copy(&local->unk0, &local->unkC->unk28); + ml_vec3f_copy(&local->unk1C, &local->unkC->unk10); + local->unk28 = local->unkC->unk40; + }//L803893A8 + + if(this->state == 3){ + ml_vec3f_copy(&local->unk0, &local->unkC->unk28); + ml_vec3f_copy(&local->unk1C, &local->unkC->unk1C); + local->unk28 = local->unkC->unk40; + }//L803893F4 + + if(this->state == 4){ + ml_vec3f_copy(&local->unk0, &local->unkC->unk34); + ml_vec3f_copy(&local->unk10, &local->unkC->unk1C); + local->unk1C[2] = 0.0f; + local->unk1C[1] = 0.0f; + local->unk1C[0] = 0.0f; + } +} + +void func_8038944C(Actor *this){ + ActorLocal_RBB_2E90 *local = (ActorLocal_RBB_2E90 *)&this->local; + f32 tick; + int i; + f32 sp50[3]; + f32 sp44[3]; + + tick = time_getDelta(); + + if(!this->unk16C_4){ + this->marker->propPtr->unk8_3 = 1; + this->unk16C_4 = TRUE; + local->unkC = func_80389280(this); + if(this->state == 0){ + ml_vec3f_copy(&this->position, &local->unkC->unk4); + local->unk0[0] = local->unk0[1] = local->unk0[2] = 0.0f; + local->unk10[0] = local->unk10[1] = local->unk10[2] = 0.0f; + local->unk1C[0] = local->unk1C[1] = local->unk1C[2] = 0.0f; + + local->unk28 = 0.0f; + func_803892D8(this, 1); + } + }//L80389508 + + if(func_8025773C(&local->unk28, tick)){ + if(this->state == 2) + func_803892D8(this, 3); + else if(this->state == 3) + func_803892D8(this, 2); + }//L80389568 + + switch (this->state) + { + case 1: + case 2: + case 3: + case 4: + sp50[0] = this->pitch; + sp50[1] = this->yaw; + sp50[2] = this->roll; + this->pitch += local->unk10[0]*tick ; + this->yaw += local->unk10[1]*tick ; + this->roll += local->unk10[2]*tick ; + + sp44[0] = this->pitch; + sp44[1] = this->yaw; + sp44[2] = this->roll; + + for(i = 0; i < 3; i++){ + if( (sp50[i] < 90.0f && 90.0f <= sp44[i]) + || (sp50[i] < 270.0f && 270.0f <= sp44[i]) + || (sp50[i] < 180.0f && 180.0f <= sp44[i]) + || (sp50[i] < 360.0f && 360.0f <= sp44[i]) + ){ + FUNC_8030E8B4(SFX_2_CLAW_SWIPE, 0.4f, 23000, this->position, 50, 1000); + } + } + this->pitch += (360.0f <= this->pitch)? -360 : 0; + this->yaw += (360.0f <= this->yaw)? -360 : 0; + this->roll += (360.0f <= this->roll)? -360 : 0; + + for(i = 0; i < 3; i++){//L803897B8 + if( local->unk10[i] < local->unk1C[i] ){ + local->unk10[i] += local->unk0[i]*tick; + local->unk10[i] = MIN(local->unk1C[i] , local->unk10[i]); + } + else if( local->unk1C[i] < local->unk10[i]){ + local->unk10[i] -= local->unk0[i]*tick; + local->unk10[i] = MAX(local->unk1C[i] , local->unk10[i]); + } + } + break; + }//L80389860 + + if(this->state == 1 && mapSpecificFlags_get(0)){ + func_803892D8(this, 2); + } + if(tick); +} diff --git a/src/RBB/code_34B0.c b/src/RBB/code_34B0.c new file mode 100644 index 00000000..19378aa3 --- /dev/null +++ b/src/RBB/code_34B0.c @@ -0,0 +1,53 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_803899C0(Actor *this); + +/* .data */ +ActorInfo D_803906B0 = { + 0x194, 0x1BE, 0x412, 0x0, NULL, + func_803899C0, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_803898A0(void){ + mapSpecificFlags_set(0, 1); +} + +void func_803898C4(Actor * this, s32 arg1){ + this->state = arg1; + if(this->state == 2){ + func_8030E6D4(SFX_90_SWITCH_PRESS); + this->position_y -= 35.0f; + func_80324E38(1.0f, 3); + timed_setCameraToNode(1.0f, 0); + timedFunc_set_0(1.0f, func_803898A0); + func_80324E88(5.0f); + func_80324E38(5.0f, 0); + } +} + +void func_80389980(ActorMarker *marker, s32 arg1){ + Actor *actor = marker_getActor(marker); + if(actor->state == 1){ + func_803898C4(actor, 2); + } +} + +void func_803899C0(Actor *this){ + if(!this->unk16C_4){ + this->marker->propPtr->unk8_3 = 1; + this->unk16C_4 = 1; + mapSpecificFlags_set(0, 0); + marker_setCollisionScripts(this->marker, NULL, func_80389980, NULL); + if(this->state == 0){ + this->position_x = -3209.95f; + this->position_y = 1164.5f; + this->position_z = -2649.95f; + this->yaw = -90.0f; + func_803898C4(this, 1); + } + } +} diff --git a/src/RBB/code_36A0.c b/src/RBB/code_36A0.c new file mode 100644 index 00000000..476f0780 --- /dev/null +++ b/src/RBB/code_36A0.c @@ -0,0 +1,128 @@ +#include +#include "functions.h" +#include "variables.h" + +/* typedefs and declarations */ +typedef struct { + s32 unk0; + f32 unk4; + s32 unk8; + f32 unkC; +}ActorLocal_RBB_36A0; + +void func_80389C78(Actor *this); + +/* .data */ +ActorInfo D_803906E0 = { + 0x185, 0x175, 0x403, 0x0, NULL, + func_80389C78, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +s32 D_80390704[4] = {0x258, 0x12C, 0x12C, 0}; + +/*.code */ +f32 func_80389A90(void){ + return (f32) D_80390704[2*levelSpecificFlags_get(0x27) + levelSpecificFlags_get(0x28)]; +} + +void func_80389ADC(Actor *this, s32 arg1){ + ActorLocal_RBB_36A0 * local = (ActorLocal_RBB_36A0 *)&this->local; + if(arg1 == 1){ + local->unkC = func_80389A90(); + local->unk4 = func_80389A90(); + } + this->state = arg1; +} + +int func_80389B44(ActorMarker* marker, s32 arg1){ + Actor *actor = marker_getActor(marker); + ActorLocal_RBB_36A0 * local = (ActorLocal_RBB_36A0 *)&actor->local; + + return (0.0f < local->unk4); +} + + +void func_80389B80(Actor *this, f32 arg1){ + ActorLocal_RBB_36A0 * local = (ActorLocal_RBB_36A0 *)&this->local; + local->unk0 = func_802F9AA8(0x400); + func_802F9DB8(local->unk0, arg1, arg1, 0.0f); + func_802F9F80(local->unk0, 0.0f, 8999999488.0f, 0.0f); + func_802FA060(local->unk0, 0x4650, 0x4650, 0.0f); + if(!levelSpecificFlags_get(3) && !levelSpecificFlags_get(4)){ + func_802F9EC4(local->unk0, &this->position, 0x1f4, 0x7d0); + func_802FA0B0(local->unk0, 1); + } +} + +void func_80389C44(Actor *actor){ + ActorLocal_RBB_36A0 * local = (ActorLocal_RBB_36A0 *)&actor->local; + if(func_802F9C0C(local->unk0)) + func_802F9D38(local->unk0); +} + + +void func_80389C78(Actor *this){ + ActorLocal_RBB_36A0 * local = (ActorLocal_RBB_36A0 *)&this->local; + f32 tmp; + f32 sp34 = time_getDelta(); + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + this->marker->propPtr->unk8_3 = 1; + this->pitch = randf2(0.0f, 300.0f); + func_803300C0(this->marker, func_80389B44); + func_803300D8(this->marker, func_80389C44); + func_80389B80(this, 1.0f); + if(this->unk78_13 == 0x1C){ + local->unk8 = 0; + this->position_x = 7625.5f; + this->position_y = -1950.0f; + this->position_z = 300.0f; + } + else{//L80389D4C + local->unk8 = 1; + this->position_x = 7625.5f; + this->position_y = -1950.0f; + this->position_z = -300.0f; + }//L80389D7C + local->unk4 = 0.0f; + local->unkC = 0.0f; + func_80389ADC(this, 1); + if(levelSpecificFlags_get(local->unk8 ? 4 : 3)){ + set_camera_to_node(9); + func_80324E38(0.0f, 3); + timedFunc_set_2(0.1f, (TFQM2)levelSpecificFlags_set, local->unk8 ? 0x28 : 0x27, 1); + func_80324E88(4.5f); + func_80324E38(4.5f, 0); + timedFunc_set_2(4.5f, (TFQM2)levelSpecificFlags_set, local->unk8 ? 0x4 : 0x3, 0); + timedFunc_set_3(4.5f, (TFQM3)func_802E4078, MAP_34_RBB_ENGINE_ROOM, !local->unk8 ? 3 : 2, 0); + func_803228D8(); + } + }//L80389EA8 + + tmp = this->pitch; + this->pitch -= local->unkC*sp34; + if( (0.0f < tmp && this->pitch <= 0.0f) + || (180.0f < tmp && this->pitch <= 180.0f) + ){ + if(levelSpecificFlags_get(3) || levelSpecificFlags_get(4)) + func_8030E760(SFX_2_CLAW_SWIPE, 0.4f, 0x4e20); + else + func_8030E988(SFX_2_CLAW_SWIPE, 0.4f, 0x4e20, &this->position, 500.0f, 1000.0f); + }//L80389F94 + if(this->pitch < 0.0f) + this->pitch += 360.0f; + + if(this->state == 1){ + local->unk4 = func_80389A90(); + if(local->unkC < local->unk4){ + local->unkC += 75*sp34; + local->unkC = MIN(local->unk4, local->unkC); + }//L8038A03C + if(local->unk4 < local->unkC){ + local->unkC -= 75*sp34; + local->unkC = MAX(local->unk4, local->unkC); + } + }//L8038A08C +} \ No newline at end of file diff --git a/src/RBB/code_3CB0.c b/src/RBB/code_3CB0.c new file mode 100644 index 00000000..94ebf95c --- /dev/null +++ b/src/RBB/code_3CB0.c @@ -0,0 +1,124 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8028F9DC(s32); +extern void func_803253A0(Actor *); +extern void func_8033A2D4(void(*)(Actor *), Actor *); + +/* typedefs and declarations */ +typedef struct { + s16 unk0[3]; + s16 unk6; + s16 unk8; + s16 unkA; +}Struct_RBB_3CB0; + +typedef struct { + Struct_RBB_3CB0 *unk0; + void *unk4; +}ActorLocal_RBB_3CB0; + +void func_8038A324(Actor *this); +Actor *func_8038A224(ActorMarker *marker, Gfx **gdl, Mtx **mptr, s32 arg3); + +/* .data */ +Struct_RBB_3CB0 D_80390720[2] = { + {{0x0640, 0x324, 0xF6A0}, 0, 3, 0x27}, + {{0xF9C0, 0x324, 0xF6A0}, 0x405, 4, 0x28} +}; + +ActorInfo D_80390738 = { + 0x186, 0x176, 0x404, 0x0, NULL, + func_8038A324, NULL, func_8038A224, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_8038A0A0(Actor *this, s32 arg1){ + ActorLocal_RBB_3CB0 *local = (ActorLocal_RBB_3CB0 *)&this->local; + + if(arg1 == 1) + if(this->state == 2) + this->position_y += 40.0f; + + if(arg1 == 2){ + if(this->state == 1) + func_8030E6D4(SFX_90_SWITCH_PRESS); + this->position_y -= 40.0f; + if(this->state == 1){ + levelSpecificFlags_set(local->unk0->unk8, 1); + func_803228D8(); + timedFunc_set_1(1.1f, (TFQM1)func_8028F9DC, 2); + timedFunc_set_3(1.1f, (TFQM3)func_802E4078, MAP_31_RBB_RUSTY_BUCKET_BAY, 0, 0); + }else{ + levelSpecificFlags_set(local->unk0->unkA, 1); + } + }//L8038A1A0 + + this->state = arg1; +} + +void func_8038A1C8(ActorMarker *marker, s32 arg1){ + Actor *actor = marker_getActor(marker); + if(actor->state == 1){ + func_8038A0A0(actor, 2); + } + else if(actor->state == 2){ + func_8038FF40(); + } +} + +Actor *func_8038A224(ActorMarker *marker, Gfx **gdl, Mtx **mptr, s32 arg3){ + Actor *actor = marker_getActor(marker); + ActorLocal_RBB_3CB0 *local = (ActorLocal_RBB_3CB0 *)&actor->local; + + if(actor->state == 0){ + return actor; + } + + func_8033A2D4(func_803253A0, actor); + if(local->unk4){ + func_803391A4(gdl, mptr, &actor->position, NULL, 1.0f, NULL, local->unk4); + } + else{ + func_803391A4(gdl, mptr, &actor->position, NULL, 1.0f, NULL, func_80330B1C(marker)); + } + return actor; +} + +void func_8038A2F8(Actor *actor){ + ActorLocal_RBB_3CB0 *local = (ActorLocal_RBB_3CB0 *)&actor->local; + if(local->unk4) + assetcache_release(local->unk4); +} + +void func_8038A324(Actor *this){ + ActorLocal_RBB_3CB0 *local = (ActorLocal_RBB_3CB0 *)&this->local; + if(!this->unk16C_4){ + this->marker->propPtr->unk8_3 = 1; + this->marker->unk30 = func_8038A2F8; + this->unk16C_4 = 1; + local->unk0 = &D_80390720[((this->unk78_13 == 2) ? 0:1)]; + if(local->unk0->unk6 == 0) + local->unk4 = NULL; + else + local->unk4 = assetcache_get(local->unk0->unk6); + marker_setCollisionScripts(this->marker, NULL, func_8038A1C8, NULL); + this->position_x = (f32)local->unk0->unk0[0]; + this->position_y = (f32)local->unk0->unk0[1]; + this->position_z = (f32)local->unk0->unk0[2]; + if(levelSpecificFlags_get(local->unk0->unkA)) + func_8038A0A0(this, 2); + else + func_8038A0A0(this, 1); + }//L8038A47C + if(this->state == 2){ + if( !levelSpecificFlags_get(local->unk0->unkA) + && !levelSpecificFlags_get(3) + && !levelSpecificFlags_get(4) + ){ + func_8038A0A0(this, 1); + } + } +} \ No newline at end of file diff --git a/src/RBB/code_40F0.c b/src/RBB/code_40F0.c new file mode 100644 index 00000000..444aec03 --- /dev/null +++ b/src/RBB/code_40F0.c @@ -0,0 +1,178 @@ +#include +#include "functions.h" +#include "variables.h" + +#ifndef ABS +#define ABS(d) ((d) >= 0) ? (d) : -(d) +#endif + +/* typedefs and declarations */ +typedef struct { + f32 unk0[3]; + f32 unkC[3]; + s16 unk18; + s16 unk1A; +}Struct_RBB_40F0; + +typedef struct { + s32 unk0; + f32 unk4[3]; + f32 unk10[3]; + f32 unk1C; +}ActorLocal_RBB_40F0; + +void func_8038A724(Actor *this); + +/* .data */ +Struct_RBB_40F0 D_80390760[4] = { + {{ 1600.0f, 641.5f, -2700.0f}, {0.0f, 0.0f, 500.0f}, 0x27, 0}, + {{-1600.0f, 641.5f, -2700.0f}, {0.0f, 0.0f, 500.0f}, 0x28, 0}, + {{ 300.0f, 641.5f, -400.0f}, {-500.0f, 0.0f, 0.0f}, 0x27, 1}, + {{ -300.0f, 641.5f, -400.0f}, {-500.0f, 0.0f, 0.0f}, 0x28, 1}, +}; + +ActorInfo D_803907D0 = { + 0x187, 0x177, 0x406, 0x0, NULL, + func_8038A724, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_803907F4 = { + 0x18E, 0x17E, 0x406, 0x0, NULL, + func_8038A724, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80390818 = { + 0x18F, 0x17F, 0x407, 0x0, NULL, + func_8038A724, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8039083C = { + 0x190, 0x180, 0x408, 0x0, NULL, + func_8038A724, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +f32 D_80390860[3] = {1.0f, 0.5f, 0.5f}; + +/* .code */ +f32 func_8038A4E0(void){ + return D_80390860[2*levelSpecificFlags_get(0x27) + levelSpecificFlags_get(0x28)]; +} + +void func_8038A524(Actor *this, s32 arg1){ + ActorLocal_RBB_40F0 *local = (ActorLocal_RBB_40F0 *)&this->local; + + local->unk1C = 0.0f; + + if(arg1 == 1){ + if(D_80390760[local->unk0].unk1A){ + func_8038A524(this, 2); + return; + } + local->unk10[0] = D_80390760[local->unk0].unkC[0]*func_8038A4E0(); + local->unk10[1] = D_80390760[local->unk0].unkC[1]*func_8038A4E0(); + local->unk10[2] = D_80390760[local->unk0].unkC[2]*func_8038A4E0(); + } + + + if(arg1 == 2){ + local->unk10[0] = D_80390760[local->unk0].unkC[0]*func_8038A4E0(); + local->unk10[1] = D_80390760[local->unk0].unkC[1]*func_8038A4E0(); + local->unk10[2] = D_80390760[local->unk0].unkC[2]*func_8038A4E0(); + } + + if(arg1 == 3){ + local->unk10[2] = 0.0f; + local->unk10[1] = 0.0f; + local->unk10[0] = 0.0f; + } + this->state = arg1; +} + +f32 func_8038A6B8(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + ActorLocal_RBB_40F0 *local = (ActorLocal_RBB_40F0 *)&actor->local; + int i; + f32 f12 = 0; + + for(i = 0; i < 3; i++){ + f12 += ABS(local->unk4[i]); + } + return f12/500.0f; +} + +void func_8038A724(Actor *this){ + ActorLocal_RBB_40F0 *local = (ActorLocal_RBB_40F0 *)&this->local; + int i; + f32 sp1C = time_getDelta(); + + + if(!this->unk16C_4){ + this->marker->propPtr->unk8_3 = 1; + this->unk16C_4 = 1; + actor_collisionOff(this); + local->unk0 = 0; + local->unk0 = (this->modelCacheIndex == 0x17E) ? 1: local->unk0; + local->unk0 = (this->modelCacheIndex == 0x17F) ? 2: local->unk0; + local->unk0 = (this->modelCacheIndex == 0x180) ? 3: local->unk0; + + this->position_x = D_80390760[local->unk0].unk0[0]; + this->position_y = D_80390760[local->unk0].unk0[1]; + this->position_z = D_80390760[local->unk0].unk0[2]; + func_8038A524(this, 1); + }//L8038A884 + + this->pitch += local->unk4[0]*sp1C; + this->yaw += local->unk4[1]*sp1C; + this->roll += local->unk4[2]*sp1C; + + for(i = 0; i < 3; i++){//L8038A8D4 + if(local->unk10[i] < local->unk4[i]){ + local->unk4[i] -= 75.0f*sp1C; + local->unk4[i] = MAX(local->unk10[i], local->unk4[i]); + }//L8038A924 + else if(local->unk4[i] < local->unk10[i]){ + local->unk4[i] += 75.0f*sp1C; + local->unk4[i] = MIN(local->unk10[i], local->unk4[i]); + } + } + + if(this->state == 1){ + local->unk10[0] = D_80390760[local->unk0].unkC[0]*func_8038A4E0(); + local->unk10[1] = D_80390760[local->unk0].unkC[1]*func_8038A4E0(); + local->unk10[2] = D_80390760[local->unk0].unkC[2]*func_8038A4E0(); + } + + if(this->state == 2){ + if(0.0f < local->unk1C){ + if(func_8025773C(&local->unk1C, sp1C)){ + func_8038A524(this, 3); + }//L8038AA8C + }else{ + if( local->unk4[0] == local->unk10[0] + && local->unk4[1] == local->unk10[1] + && local->unk4[2] == local->unk10[2] + ){ + local->unk1C = 1.0f; + } + } + }//L8038AB04 + + if(this->state == 3){ + if(0.0f < local->unk1C){ + if(func_8025773C(&local->unk1C, sp1C)){ + func_8038A524(this, 2); + }//L8038AA8C + }else{ + if( local->unk4[0] == local->unk10[0] + && local->unk4[1] == local->unk10[1] + && local->unk4[2] == local->unk10[2] + ){ + local->unk1C = 1.0f; + } + } + } +} diff --git a/src/RBB/code_47D0.c b/src/RBB/code_47D0.c new file mode 100644 index 00000000..b36642e3 --- /dev/null +++ b/src/RBB/code_47D0.c @@ -0,0 +1,160 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void vtxList_tint(s32, s32 (*)[3], f32, BKVertexList*); + +/* typedefs and declarations */ +typedef struct { + s16 unk0; + f32 unk4[3]; + s16 unk10; + u8 pad12[2]; +}Struct_RBB_47D0; + +typedef struct { + u8 unk0; + u8 pad1[3]; + Struct_RBB_47D0 *unk4; + f32 unk8; + s32 unkC; +}ActorLocal_RBB_47D0; + +Actor *func_8038AD9C(ActorMarker *marker, Gfx** gdl, Mtx** mptr, s32 arg3); +void func_8038AEB8(Actor *this); + + +/* .data */ +Struct_RBB_47D0 D_80390870[4] = { + {0x1BF, {-3950.0f, 690.0f, -350.0f}, 1}, + {0x1C0, {-3950.0f, 690.0f, 0.0f}, 2}, + {0x1C1, {-3950.0f, 690.0f, 350.0f}, 3}, + 0 +}; + +extern ActorInfo D_803908C0 = { + 0x195, 0x1BF, 0x413, 0x0, NULL, + func_8038AEB8, NULL, func_8038AD9C, + 0, 0, 0.0f, 0 +}; +extern ActorInfo D_803908E4 = { + 0x196, 0x1C0, 0x414, 0x0, NULL, + func_8038AEB8, NULL, func_8038AD9C, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_80390908 = { + 0x197, 0x1C1, 0x415, 0x0, NULL, + func_8038AEB8, NULL, func_8038AD9C, + 0, 0, 0.0f, 0 +}; + +s32 D_8039092C[3] = { 0, 0xFF, 0}; +s32 D_80390938[3] = { 0xFF, 0, 0}; + +/* .code */ +Struct_RBB_47D0 *func_8038ABC0(Actor *arg0){ + Struct_RBB_47D0 *iPtr = D_80390870; + while(iPtr->unk0 != 0){ + if(iPtr->unk0 == arg0->modelCacheIndex) + return iPtr; + iPtr++; + } + return NULL; +} + +void func_8038AC18(Actor *this, s32 new_state){ + ActorLocal_RBB_47D0 *local = (ActorLocal_RBB_47D0 *)&this->local; + Actor *other; + local->unk8 = 0.0f; + if(new_state == 2){ + func_8030E6D4(SFX_90_SWITCH_PRESS); + local->unkC = vtxList_clone(func_8033A148(func_80330B1C(this->marker))); + + mapSpecificFlags_set(local->unk4->unk10, TRUE); + this->position_y -= 30.0f; + local->unk8 = 1.0f; + other = func_80326EEC(0x1c5); + if(other){ + local->unk0 = func_8038B56C(other, this->modelCacheIndex - 0x1be, this); + } + }//L8038ACD0 + + if(this->state == 2){ + this->position_x = local->unk4->unk4[0]; + this->position_y = local->unk4->unk4[1]; + this->position_z = local->unk4->unk4[2]; + vtxList_free(local->unkC); + } + this->state = new_state; +} + +void func_8038AD3C(ActorMarker *marker, s32 arg1){ + Actor *actor = marker_getActor(marker); + if(actor->state == 1) + func_8038AC18(actor, 2); +} + +void func_8038AD7C(Actor *this){ + func_8038AC18(this, 0); +} + +Actor *func_8038AD9C(ActorMarker *marker, Gfx **gdl, Mtx **mptr, s32 arg3){ + Actor * actor = marker_getActor(marker); + ActorLocal_RBB_47D0 *local = (ActorLocal_RBB_47D0 *)&actor->local; + s32 temp_v0; + f32 pad0; + s32 (*sp1C)[3]; + + + if(actor->state == 0) + return actor; + + if( actor->state == 2 + && local->unk0 != 0 + ){ + temp_v0 = func_80330B1C(marker); + sp1C = (local->unk0 == 2) ? &D_80390938 : &D_8039092C; + vtxList_tint(local->unkC, sp1C, + (local->unk4->unk4[1] - actor->position_y)/30.0, + func_8033A148(temp_v0) + ); + func_8033A4C0(local->unkC); + } + return func_80325888(marker, gdl, mptr, arg3); +} + +void func_8038AEB8(Actor *this){ + ActorLocal_RBB_47D0 *local = (ActorLocal_RBB_47D0 *)&this->local; + f32 sp20 = time_getDelta(); + s32 tmp; + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + this->marker->propPtr->unk8_3 = 1; + this->marker->unk30 = func_8038AD7C; + marker_setCollisionScripts(this->marker, NULL, func_8038AD3C, NULL); + local->unk4 = func_8038ABC0(this); + mapSpecificFlags_set(local->unk4->unk10, FALSE); + this->position_x = local->unk4->unk4[0]; + this->position_y = local->unk4->unk4[1]; + this->position_z = local->unk4->unk4[2]; + this->yaw = -90.0f; + func_8038AC18(this, 1); + }//L8038AF88 + + if(func_8025773C(&local->unk8, sp20)) + func_8038AC18(this, 1); + + if(this->state == 2){ + tmp = (s32)this->position_y; + if(this->position_y < local->unk4->unk4[1]) + this->position_y += 60.0f*sp20; + + if( tmp < local->unk4->unk4[1] - 15.0f + && local->unk4->unk4[1] - 15.0f <= this->position_y + ){ + mapSpecificFlags_set(local->unk4->unk10, FALSE); + } + }//L8038B044 +} diff --git a/src/RBB/code_4C70.c b/src/RBB/code_4C70.c new file mode 100644 index 00000000..1fa12dd8 --- /dev/null +++ b/src/RBB/code_4C70.c @@ -0,0 +1,152 @@ +#include +#include "functions.h" +#include "variables.h" + +/* typedefs and declarations */ +typedef struct { + s16 unk0; + f32 unk4[3]; + s16 unk10; + s16 unk12; + s16 unk14; + //u8 pad16[2]; +}Struct_RBB_4C70; + +typedef struct { + Struct_RBB_4C70 *unk0; + f32 unk4[3]; +}ActorLocal_RBB_4C70; + +Actor *func_8038B230(ActorMarker *marker, Gfx** gdl, Mtx** mptr, s32 arg3); +void func_8038B340(Actor *this); + +/* .data */ +Struct_RBB_4C70 D_80390950[] = { + { 0x1C2, {-3720.0f, 800.0f, -350.0f}, 0x1, 0x136, 0x3FF}, + { 0x1C3, {-3720.0f, 800.0f, 0.0f}, 0x2, 0x135, 0x3FE}, + { 0x1C4, {-3720.0f, 800.0f, 350.0f}, 0x3, 0x134, 0x3FD}, + 0 +}; + +ActorInfo D_803909B0 = { + 0x2A, 0x1C2, 0x416, 0x0, NULL, + func_8038B340, NULL, func_8038B230, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_803909D4 = { + 0x2B, 0x1C3, 0x416, 0x0, NULL, + func_8038B340, NULL, func_8038B230, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_803909F8 = { + 0x2C, 0x1C4, 0x416, 0x0, NULL, + func_8038B340, NULL, func_8038B230, + 0, 0, 0.0f, 0 +}; + +struct31s D_80390A1C = { + { 1.0f, 2.0f}, + { 3.0f, 5.0f}, + { 0.05f, 0.1f}, + { 1.5f, 2.5f}, + 0.0f, + 0.5f +}; + +/* .code */ +Struct_RBB_4C70 *func_8038B060(Actor *this){ + Struct_RBB_4C70 * iPtr; + for(iPtr = D_80390950; iPtr->unk0 != 0; iPtr++){ + if(iPtr->unk0 == this->modelCacheIndex) + return iPtr; + } + return NULL; +} + +void func_8038B0B8(Actor *this, s32 arg1){ + ActorLocal_RBB_4C70 *local = (ActorLocal_RBB_4C70 *)&this->local; + ParticleEmitter *other; + + this->state = arg1; + + if(this->state == 2){ + func_80335924(this->unk148, local->unk0->unk12, 0.0f, 0.5f); + func_80335A8C(this->unk148, 2); + timed_playSfx(0.1f, local->unk0->unk14, 1.0f, 0x7d00); + other = partEmitList_pushNew(0xa); + particleEmitter_setSprite(other, ASSET_70E_SPRITE_SMOKE_2); + particleEmitter_setParticleAccelerationRange(other, + 0.0f, 100.0f, 0.0f, + 0.0f, 250.0f, 0.0f + ); + particleEmitter_setStartingFrameRange(other, 0, 7); + particleEmitter_setParticleSpawnPositionRange(other, + -5.0f, -5.0f, 0.0f, + 5.0f, 5.0f, 0.0f + ); + particleEmitter_setPosition(other, &local->unk4); + particleEmitter_setParticleVelocityRange(other, + -400.0f, 0.0f, -30.0f, + -800.0f, 0.0f, 30.0f + ); + func_802EFB98(other, &D_80390A1C); + particleEmitter_setSpawnInterval(other, 0.5f); + } +} + +Actor *func_8038B230(ActorMarker *marker, Gfx** gdl, Mtx** mptr, s32 arg3){ + Actor *actor = marker_getActor(marker); + ActorLocal_RBB_4C70 *local = (ActorLocal_RBB_4C70 *)&actor->local; + f32 sp3C[3]; + + if(actor->state == 0) + return actor; + + if(actor->state == 2){ + func_8033A238(func_803356A0(actor->unk148)); + } + + sp3C[0] = actor->pitch; + sp3C[1] = actor->yaw; + sp3C[2] = actor->roll; + func_8033A2D4(&func_803253A0, actor); + func_8033A450(func_80329934()); + func_803391A4(gdl, mptr, &actor->position, &sp3C, actor->scale, NULL, func_80330B1C(marker)); + func_8034A174(func_80329934(), 5, &local->unk4); + local->unk4[0] -= 60.0f; + return actor; +} + +void func_8038B340(Actor * this){ + ActorLocal_RBB_4C70 *local = (ActorLocal_RBB_4C70 *)&this->local; + if(!this->unk16C_4){ + this->marker->propPtr->unk8_3 = 1; + this->unk16C_4 = 1; + local->unk0 = func_8038B060(this); + + local->unk4[2] = 0.0f; + local->unk4[1] = 0.0f; + local->unk4[0] = 0.0f; + + this->position_x = local->unk0->unk4[0]; + this->position_y = local->unk0->unk4[1]; + this->position_z = local->unk0->unk4[2]; + + this->yaw = -90.0f; + this->scale = 0.25f; + + func_8038B0B8(this, 1); + }//L8038B3E4 + + if(this->state == 1){ + if(mapSpecificFlags_get(local->unk0->unk10)) + func_8038B0B8(this, 2); + } + + if(this->state == 2){ + if( func_80335794(this->unk148) > 0 ) + func_8038B0B8(this, 1); + } +} diff --git a/src/RBB/code_5060.c b/src/RBB/code_5060.c new file mode 100644 index 00000000..512278a2 --- /dev/null +++ b/src/RBB/code_5060.c @@ -0,0 +1,87 @@ +#include +#include "functions.h" +#include "variables.h" + +extern ActorInfo D_80390FD0; + +typedef struct { + s16 unk0; + s16 unk2; + u8 *unk4; +}ActorLocal_RBB_5060; + +void func_8038B654(Actor * this); + +/* .data */ +ActorInfo D_80390A50 = { + 0x2D, 0x1C5, 0x0, 0x0, NULL, + func_8038B654, NULL, func_80325340, + 0, 0, 0.0f, 0 +}; + +f32 D_80390A74[3] = {-3820.0f, 850.0f, 0.0f}; //whistle jiggy spawn position + +/* .code */ +void func_8038B450(Actor *actor, s32 arg1){ + actor->state = arg1; +} + +void func_8038B468(void){ + func_802C8F70(225.0f); + jiggySpawn(JIGGY_54_RBB_WHISTLE, D_80390A74); +} + +void func_8038B4A0(void){ + func_8025A6EC(COMUSIC_2B_DING_B, 28000); +} + +void func_8038B4C4(ActorMarker *marker){ + func_8025A6EC(COMUSIC_2C_BUZZER, 28000); + func_8028F530(0xD); +} + +void func_8038B4F4(void){ + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 28000); + func_80324E38(1.0f, 3); + timed_setCameraToNode(2.0f, 10); + timedFunc_set_0(2.2f, func_8038B468); + func_80324E88(5.0f); + func_80324E38(5.0f, 0); +} + +s32 func_8038B56C(Actor *this, s32 whistle_id, Actor *other){ + ActorLocal_RBB_5060 *local = (ActorLocal_RBB_5060 *)&this->local; + + if(this->state != 1) + return 0; + + if(whistle_id + 0x30 == local->unk4[local->unk0]){ //correct + if(local->unk4[++local->unk0] == 0){ //end of string + timedFunc_set_0(0.6f, func_8038B4F4); //spawn jiggy + func_8038B450(this, 2); + return 3; + }else{ + timedFunc_set_0(0.6f, func_8038B4A0); + return 1; + } + } + else{ //wrong + timedFunc_set_1(1.0f, func_8038B4C4, other->marker); + local->unk0 = 0; + return 2; + } +} + +void func_8038B654(Actor *this){ + ActorLocal_RBB_5060 *local = (ActorLocal_RBB_5060 *)&this->local; + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + local->unk2 = 1; + local->unk4 = "312111"; + if(jiggyscore_isSpawned(JIGGY_54_RBB_WHISTLE)) + func_8038B450(this, 2); + else + func_8038B450(this, 1); + } +} diff --git a/src/RBB/code_52F0.c b/src/RBB/code_52F0.c new file mode 100644 index 00000000..8dce12b2 --- /dev/null +++ b/src/RBB/code_52F0.c @@ -0,0 +1,47 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8038B7E8(Actor *this); + +/* .data */ +ActorInfo D_80390A80 = { + 0x2F, 0x1C7, 0x41B, 0x0, NULL, + func_8038B7E8, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_8038B6E0(Actor *this, s32 arg1){ + if(arg1 == 2){ + if(this->state == 1){ + func_8030E6D4(SFX_90_SWITCH_PRESS); + } + actor_collisionOff(this); + this->position_y -= 35.0f; + if(this->state == 1){ + levelSpecificFlags_set(0x30, TRUE); + func_803204E4(0xe, 1); + timedFunc_set_0(1.0f, func_803228D8); + timedFunc_set_3(1.0f, (TFQM3)func_802E4078, MAP_31_RBB_RUSTY_BUCKET_BAY, 0, 0); + } + } + this->state = arg1; +} + +void func_8038B7BC(ActorMarker *marker, s32 arg1){ + Actor *actor = marker_getActor(marker); + func_8038B6E0(actor, 2); +} + +void func_8038B7E8(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = 1; + this->marker->propPtr->unk8_3 = 1; + marker_setCollisionScripts(this->marker, NULL, func_8038B7BC, NULL); + if(jiggyscore_isSpawned(JIGGY_53_RBB_SNORKEL)) + func_8038B6E0(this, 2); + else + func_8038B6E0(this, 1); + } +} \ No newline at end of file diff --git a/src/RBB/code_5490.c b/src/RBB/code_5490.c new file mode 100644 index 00000000..df016795 --- /dev/null +++ b/src/RBB/code_5490.c @@ -0,0 +1,116 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80335A24(void *, s32, f32, f32); +extern s32 func_802EDD8C(f32 (*)[3], f32, f32); + +void func_8038B900(Actor *this); + +/* .data */ +ActorInfo D_80390AB0 = { + 0x30, 0x1C8, 0x41C, 0x0, NULL, + NULL, func_8038B900, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_8038B880(Actor *this, s32 new_state){ + if(new_state == 1) + func_80335924(this->unk148, ASSET_13F_ANIM_SNORKEL_STUCK, 0.0f, 5.5f); + + if(new_state == 2) + func_80335A24(this->unk148, ASSET_13E_ANIM_SNORKEL_SWIM, 1.0f, 0.65f); + + this->state = new_state; +} + +void func_8038B900(Actor *this){ + f32 sp5C; + f32 sp58; + f32 sp54; + f32 sp48[3]; + ParticleEmitter *other; + + this->marker->propPtr->unk8_3 = 1; + if(this->marker->unk14_21){ + sp54 = func_80335684(this->unk148); + if( ( func_8023DB5C() & (1 << 4) ) + && ( func_8023DB5C() & (1 << 2) ) + && ( randf() < 0.90 ) + ){ + if( ( this->state == 3 + && (0.255 <= sp54 && sp54 <= 0.856) + ) + || ( this->state == 1 + && ( (0.053 <= sp54 && sp54 <= 0.35) + || (0.39 <= sp54 && sp54 <= 0.44999999999999996) + || (0.45999999999999996 <= sp54 && sp54 <= 0.52) + || (0.54 <= sp54 && sp54 <= 0.73) + || (0.76 <= sp54 && sp54 <= 0.8200000000000001) + || (0.84 <= sp54 && sp54 <= 0.9) + || (0.94 <= sp54 && sp54 <= 1.0) + ) + ) + ){//L8038BB24 + func_8034A174(this->marker->unk44, 5, &sp48); + other = func_802EDD8C(&sp48, 0.0f, -1300.0f); + func_802EFB70(other, 0.04f, 0.04f); + func_802EFB84(other, 0.18f, 0.18f); + particleEmitter_setParticleSpawnPositionRange(other, -10.0f, 0.0f, -10.0f, 10.0f, 20.0f, 10.0f); + particleEmitter_setParticleVelocityRange(other, 0.0f, 31.0f, 0.0f, 0.0f, 37.0f, 0.0f); + particleEmitter_emitN(other, 1); + } + } + }////L8038BBFC + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + this->position_x = -5100.0f; + this->position_y = -2600.0f; + this->position_z = 1460.0f; + this->yaw = 0.0f; + func_8038B880(this, 1); + if(jiggyscore_isSpawned(JIGGY_53_RBB_SNORKEL)){ + marker_despawn(this->marker); + } + } + else{//L8038BC74 + func_8033568C(this->unk148, &sp5C, &sp58); + if( sp5C < 0.22 && 0.22 <= sp58 ){ + func_8030E988(SFX_D1_SNORKEL_WAH, randf2(0.8f, 0.9f), 0x3a98, &this->position, 1500.0f, 2000.0f); + } + + if( sp5C < 0.54 && 0.54 <= sp58 ){ + func_8030E988(SFX_D1_SNORKEL_WAH, randf2(0.9f, 1.0f), 0x4a38, &this->position, 1500.0f, 2000.0f); + } + + if(this->state == 1){ + if( !this->unk138_24 + && func_80329530(this, 0x258) + && !func_8028ECAC() + ){ + func_80311480(0xb9b, 4, 0, 0, 0, 0); + this->unk138_24 = 1; + } + } + + if(this->state == 1){ + if(mapSpecificFlags_get(4)) + func_8038B880(this, 2); + } + + if(this->state == 2){ + if(jiggyscore_isSpawned(JIGGY_53_RBB_SNORKEL)) + func_8038B880(this, 3); + } + + if(this->state == 3){ + func_80326224(this); + if(0.99 < this->unk48){ + mapSpecificFlags_set(4, FALSE); + marker_despawn(this->marker); + } + } + }//L8038BE90 +} diff --git a/src/RBB/code_5AB0.c b/src/RBB/code_5AB0.c new file mode 100644 index 00000000..a1767c92 --- /dev/null +++ b/src/RBB/code_5AB0.c @@ -0,0 +1,45 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8038BF28(Actor *this); + +/* .data */ +ActorInfo D_80390AE0 = { + 0x31, 0x1C9, 0x41D, 0x0, NULL, + func_8038BF28, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_8038BEA0(Actor *this, s32 arg1){ + if(arg1 == 1) + func_80335924(this->unk148, ASSET_141_ANIM_ANCHOR_LOWERED, 0.0f, 5.5f); + + if(arg1 == 2){ + func_80335924(this->unk148, ASSET_142_ANIM_ANCHOR_RISING, 0.0f, 8.0f); + func_80335A8C(this->unk148, 2); + } + this->state = arg1; +} + +void func_8038BF28(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = 1; + this->position_x = -5100.0f; + this->position_y = -2600.0f; + this->position_z = 1460.0f; + this->marker->propPtr->unk8_3 = 1; + this->yaw = 0.0f; + func_8038BEA0(this, 1); + if(jiggyscore_isSpawned(JIGGY_53_RBB_SNORKEL)){ + marker_despawn(this->marker); + } + } + else{ + if(this->state == 1 && mapSpecificFlags_get(8)){ + func_8038BEA0(this, 2); + } + } +} + diff --git a/src/RBB/code_5C10.c b/src/RBB/code_5C10.c new file mode 100644 index 00000000..d14bf256 --- /dev/null +++ b/src/RBB/code_5C10.c @@ -0,0 +1,71 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_8038C0FC(Actor *this, s32 new_state); + +void func_8038C204(Actor *this); + +/* .data */ +ActorInfo D_80390B10 = { + 0x199, 0x1CB, 0x0, 0x0, NULL, + func_8038C204, NULL, func_80325340, + 0, 0, 0.0f, 0 +}; + +f32 D_80390B34[3] = {-5100.0f, -2550.0f, 1470.0f}; + +/* .code */ +void func_8038C000(void){ + s32 sp1C = func_802F9AA8(SFX_7D_ANCHOR_LIFTING); + func_802FA060(sp1C, 0x6978, 0x6978, 0.0f); + func_802F9F80(sp1C, 0.5f, 7.0f, 0.5f); +} + +void func_8038C058(void){ + func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.8f, 0x55f0); + func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 0.9f, 0x55f0); + func_8030E760(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 0x55f0); +} + +void func_8038C0A8(ActorMarker *marker, s32 arg1, s32 arg2){ + Actor *actor = marker_getActor(marker); + jiggySpawn(JIGGY_53_RBB_SNORKEL, &D_80390B34); + timed_setCameraToNode(0.5f, 0xb); + func_8038C0FC(actor, 3); +} + +void func_8038C0FC(Actor *this, s32 new_state){ + if(new_state == 2){ + set_camera_to_node(0xC); + func_80324E38(0.0f, 3); + timedFunc_set_0(1.0f, func_8038C000); + timedFunc_set_2(1.0f, (TFQM2)mapSpecificFlags_set, 8, TRUE); + timed_playSfx(2.1f, SFX_3F6_UNKNOWN, 0.6f, 0x7fbc); + timedFunc_set_2(2.7f, (TFQM2)mapSpecificFlags_set, 4, TRUE); + timedFunc_set_0(3.0f, func_8038C058); + func_80324DBC(3.0f, 0xb9C, 7, NULL, this->marker, func_8038C0A8, NULL); + }//L8038C1D8 + this->state = new_state; +} + +void func_8038C204(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = 1; + if(levelSpecificFlags_getSet(0x30, FALSE)) + func_8038C0FC(this, 2); + else + func_8038C0FC(this, 1); + + if(jiggyscore_isSpawned(JIGGY_53_RBB_SNORKEL)) + marker_despawn(this->marker); + }//L8038C27C + + if(this->state == 3 && !mapSpecificFlags_get(4)){ + func_80324E88(0.0f); + func_80324E38(0.0f, 0); + timedFunc_set_0(0.0f, func_803228D8); + timedFunc_set_3(0.0f, (TFQM3)func_802E4078, MAP_8B_RBB_ANCHOR_ROOM, 2, 0); + }//L8038C2E4 +} \ No newline at end of file diff --git a/src/RBB/code_5F10.c b/src/RBB/code_5F10.c new file mode 100644 index 00000000..56841854 --- /dev/null +++ b/src/RBB/code_5F10.c @@ -0,0 +1,19 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8038C300(Actor *this); + +ActorInfo D_80390B40 = { + 0x198, 0x1ca, 0x41e, 0x0, NULL, + func_8038C300, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +void func_8038C300(Actor *this){ + if(!this->unk16C_4){ + this->marker->propPtr->unk8_3 = 1; + this->unk16C_4 = 1; + func_80335924(this->unk148, 0x140, 0.0f, 1.0f); + } +} \ No newline at end of file diff --git a/src/RBB/code_5F80.c b/src/RBB/code_5F80.c new file mode 100644 index 00000000..752156aa --- /dev/null +++ b/src/RBB/code_5F80.c @@ -0,0 +1,613 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_803253A0(Actor *); +extern void func_80325794(ActorMarker *); +extern void func_8030E394(u8); +extern void func_80326310(Actor *); +extern int func_803342AC(f32 (*)[3], f32(*)[3], f32); +extern void particleEmitter_setModel(ParticleEmitter *, s32); + + +typedef struct{ + s16 unk0; + //u8 pad2[2]; + f32 unk4; + f32 unk8; + u8 unkC; + u8 unkD; + u8 unkE; + //u8 padF[1]; + f32 unk10; + f32 unk14; +} Struct_RBB_5F80; + +typedef struct{ + Struct_RBB_5F80 *unk0; + u8 unk4; + u8 pad5[3]; + f32 unk8[3]; + f32 unk14[3]; + s32 unk20; + f32 unk24; + f32 unk28; +} ActorLocal_RBB_5F80; + +void func_8038CC9C(Actor *this, s32 new_state); +void func_8038D7E8(ActorMarker *marker, s32 arg1); +Actor *func_8038D638(ActorMarker *marker, Gfx **gdl, Mtx ** mptr, s32 arg3); +void func_8038D8BC(Actor *this); + +/* .data */ +Struct_RBB_5F80 D_80390B70[4] = { + {0x281, 1.1f, 1.0f, 0x14, 0x01, 0x5, 0.9f, 0.8f}, + {0x282, 0.75f, 1.0f, 0xF, 0x02, 0x4, 1.1f, 0.9f}, + {0x283, 0.5f, 2.0f, 0xA, 0x02, 0x3, 1.3f, 1.0f}, + {0x284, 0.25f, 2.0f, 0x5, 0x02, 0x2, 1.5f, 1.1f}, +}; + +ActorInfo D_80390BD0 = { + 0x1A1, 0x281, 0x428, 0x0, NULL, + func_8038D8BC, NULL, func_8038D638, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80390BF4 = { + 0x1A2, 0x282, 0x428, 0x0, NULL, + func_8038D8BC, NULL, func_8038D638, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80390C18 = { + 0x1A3, 0x283, 0x428, 0x0, NULL, + func_8038D8BC, NULL, func_8038D638, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80390C3C = { + 0x1A4, 0x284, 0x428, 0x0, NULL, + func_8038D8BC, NULL, func_8038D638, + 0, 0, 0.0f, 0 +}; + +s32 D_80390C60[3] = {0xDE, 0xA7, 0x71}; + +struct41s D_80390C6C = { + { {-200.0f, 200.0f, -200.0f}, {200.0f, 500.0f, 200.0f} }, + { {0.0f, -800.0f, 0.0f}, {0.0f, -800.0f, 0.0f} } +}; + +s32 D_80390C9C[3] = {0xDE, 0xA7, 0x71}; + +struct43s D_80390CA8 = { + { {-200.0f, 0.0f, -200.0f}, {200.0f, -50.0f, 200.0f} }, + { {0.0f, 200.0f, 0.0f}, {0.0f, 400.0f, 0.0f} }, + { {-10.0f, -10.0f, -10.0f}, {10.0f, 10.0f, 10.0f} } +}; + +/* .bss */ +s32 pad_80391270[4]; +u8 D_80391280; +s32 pad_80391284; +f32 D_80391288[3]; + +/* .code */ +void func_8038C370(ActorMarker *marker, s32 arg1){ + Actor *actor = marker_getActor(marker); + func_8038CC9C(actor, arg1); +} + +void func_8038C39C(Actor *this){ + ActorLocal_RBB_5F80 *local = (ActorLocal_RBB_5F80 *) &this->local; + ParticleEmitter *other = partEmitList_pushNew(local->unk0->unkE); + particleEmitter_setSprite(other, ASSET_70E_SPRITE_SMOKE_2); + func_802EFA5C(other, 0.0f, 0.1f); + particleEmitter_setStartingFrameRange(other, 0, 7); + func_802EFA70(other, 4); + particleEmitter_setPosition(other, &this->position); + func_802EFB70(other, local->unk0->unk4*1, local->unk0->unk4*3.0f); + func_802EFB84(other, 3.0f*local->unk0->unk4, local->unk0->unk4*7.0f); + particleEmitter_setParticleSpawnPositionRange(other, + local->unk0->unk4*-200.0f, local->unk0->unk4*100.0f, local->unk0->unk4*-200.0f, + local->unk0->unk4*200.0f, local->unk0->unk4*100.0f, local->unk0->unk4*200.0f + ); + particleEmitter_setParticleVelocityRange(other, + -50.0f, 100.0f, -50.0f, + 50.0f, 200.0f, 50.0f + ); + func_802EFEC0(other, 0.5f, 1.0f); + particleEmitter_emitN(other, local->unk0->unkE); +} + +void func_8038C538(Actor *this){ + ActorLocal_RBB_5F80 *local = (ActorLocal_RBB_5F80 *) &this->local; + ParticleEmitter *other = partEmitList_pushNew(3*local->unk0->unkE); + particleEmitter_setSprite(other, ASSET_70E_SPRITE_SMOKE_2); + func_802EFA5C(other, 0.1f, 0.3f); + func_802EFA70(other, 4); + particleEmitter_setStartingFrameRange(other, 0, 7); + particleEmitter_setPosition(other, &this->position); + func_802EFB70(other, local->unk0->unk4*1, local->unk0->unk4*6.0f); + func_802EFB84(other, 0.5*local->unk0->unk4, local->unk0->unk4*3.0f); + particleEmitter_setParticleSpawnPositionRange(other, + local->unk0->unk4*-300.0f, local->unk0->unk4*100.0f, local->unk0->unk4*-300.0f, + local->unk0->unk4*300.0f, local->unk0->unk4*300.0f, local->unk0->unk4*300.0f + ); + particleEmitter_setParticleVelocityRange(other, + -70.0f, 50.0f, -70.0f, + 70.0f, 100.0f, 70.0f + ); + func_802EFFA8(other, &D_80390C60); + func_802EFEC0(other, 3.0f, 4.0f); + particleEmitter_emitN(other, 3*local->unk0->unkE); + +} + +void func_8038C70C(Actor *this){ + ActorLocal_RBB_5F80 *local = (ActorLocal_RBB_5F80 *) &this->local; + ParticleEmitter *other = partEmitList_pushNew(0xa); + + func_802EF9F8(other, 0.6f); + func_802EFA18(other, 3); + func_802EFA70(other, 4); + particleEmitter_setModel(other, 0x427); + particleEmitter_setParticleSpawnPositionRange(other, + local->unk0->unk4 * -300.0f, local->unk0->unk4 * 100.0f, local->unk0->unk4 * -300.0f, + local->unk0->unk4 * 300.0f, local->unk0->unk4 * 200.0f, local->unk0->unk4 * 300.0f + ); + particleEmitter_setPosition(other, &this->position); + func_802EFB70(other, local->unk0->unk4*0.3, local->unk0->unk4*0.8); + func_802EFE24(other, + -600.0f, -600.0f, -600.0f, + 600.0f, 600.0f, 600.0f + ); + particleEmitter_setSpawnIntervalRange(other, 0.0f, 0.01f); + func_802EFEC0(other, 10.0f, 10.0f); + particleEmitter_setVelocityAndAccelerationRanges(other, &D_80390C6C); + particleEmitter_emitN(other, 10); + +} + +void func_8038C8A8(Actor * this){ + ActorLocal_RBB_5F80 *local = (ActorLocal_RBB_5F80 *) &this->local; + ParticleEmitter *other = partEmitList_pushNew(5); + f32 sp24[3]; + + + player_getPosition(&sp24); + sp24[1] += 50.0f; + + particleEmitter_setSprite(other, ASSET_70E_SPRITE_SMOKE_2); + func_802EFA5C(other, 0.0, 0.5f); + func_802EFA70(other, 4); + particleEmitter_setStartingFrameRange(other, 0, 7); + particleEmitter_setPosition(other, &sp24); + func_802EFB70(other, local->unk0->unk4*1, local->unk0->unk4*3.0f); + func_802EFB84(other, local->unk0->unk4*3.0f, local->unk0->unk4*6.0f); + particleEmitter_setPositionVelocityAndAccelerationRanges(other, &D_80390CA8); + func_802EFEC0(other, 1.0f, 2.0f); + func_802EFFA8(other, &D_80390C9C); + particleEmitter_emitN(other, 5); +} + +void func_8038C9F0(s32 arg0, s32 arg1, s32 arg2){ + Actor *actor = func_80326EEC(0x46); + if(actor) + marker_despawn(actor->marker); + + D_80391288[0] = (f32)arg0; + D_80391288[1] = (f32)(arg1 + 0x28); + D_80391288[2] = (f32)arg2; + jiggySpawn(JIGGY_56_RBB_BOSS_BOOM_BOX, &D_80391288); +} + +void func_8038CA70(Actor *this, f32(*arg1)[3]){ + f32 tmp_f; + ActorLocal_RBB_5F80 *local = (ActorLocal_RBB_5F80 *) &this->local; + + tmp_f = local->unk0->unk4 * 300.0f; + + if( (*arg1)[0] - tmp_f < -1400.0f) + (*arg1)[0] = -1400.0f + tmp_f; + + if(1400.0f < (*arg1)[0] + tmp_f) + (*arg1)[0] = 1400.0f - tmp_f; + + if( (*arg1)[2] - tmp_f < -1200.0f) + (*arg1)[2] = -1200.0f + tmp_f; + + if(1200.0f < (*arg1)[2] + tmp_f) + (*arg1)[2] = 1200.0f - tmp_f; + +} + +void func_8038CB34(ActorMarker *marker, s32 arg1, s32 arg2){ + comusic_8025AB44(COMUSIC_62_RBB_BOOMBOX, -1, 0x12C); +} + +void func_8038CB68(ActorMarker *marker, s32 arg1, s32 arg2){ + Actor *actor = marker_getActor(marker); + func_80324E88(0.0f); + func_80324E38(0.0f, 0); + timedFunc_set_2(0.0f, (TFQM2)func_8038C370, actor->marker, 3); +} + +void func_8038CBC0(void){ + Actor * actor = func_80326EEC(0x46); + if(actor) + func_802C8090(actor); +} + +int func_8038CBF0(Actor *this){ + f32 sp2C[3]; + f32 sp20[3]; + ActorLocal_RBB_5F80 *local = (ActorLocal_RBB_5F80 *) &this->local; + + sp2C[0] = local->unk8[0]; + sp2C[1] = local->unk8[1]; + sp2C[2] = local->unk8[2]; + + sp20[0] = local->unk14[0]; + sp20[1] = local->unk14[1]; + sp20[2] = local->unk14[2]; + + sp2C[1] += 300.0f * local->unk0->unk4; + sp20[1] += 300.0f * local->unk0->unk4; + return func_803342AC(&sp2C, &sp20, local->unk0->unk4 * 400.0f); + +} + +void func_8038CC9C(Actor *this, s32 new_state){ + f32 sp8C[3]; + f32 sp80[3]; + ActorLocal_RBB_5F80 *local = (ActorLocal_RBB_5F80 *) &this->local; + int i; + f32 pad; + f32 sp68[3]; + f32 sp64; + f32 sp60; + f32 sp5C; + f32 sp58; + + + + player_getPosition(&sp8C); + + sp8C[1] = 0.0f; + + sp80[0] = sp8C[0] - this->position_x; + sp80[1] = sp8C[1] - this->position_y; + sp80[2] = sp8C[2] - this->position_z; + if(this->state == 2){ + func_8038CBC0(); + } + + if(this->state == 7){ + actor_collisionOn(this); + } + + local->unk8[0] = this->position_x; + local->unk8[1] = this->position_y; + local->unk8[2] = this->position_z; + local->unk24 = local->unk28 = this->yaw; + this->state = new_state; + + if(local->unk20){ + func_803343F8(local->unk20); + local->unk20 = NULL; + } + + if(this->state == 1){ + func_80335924(this->unk148, ASSET_146_ANIM_BOSS_BOOMBOX_APPEAR, 0.0f, 2.0f); + func_80335A8C(this->unk148, 4); + } + + if(this->state == 2){ + func_8025A58C(0, 0xfa0); + func_8025A6EC(COMUSIC_62_RBB_BOOMBOX, -1); + func_8025AABC(COMUSIC_62_RBB_BOOMBOX); + func_80335924(this->unk148, ASSET_146_ANIM_BOSS_BOOMBOX_APPEAR, 0.0f, 2.4f); + func_80335A8C(this->unk148, 2); + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.0f, 0); + timed_playSfx(0.5f, SFX_3F5_UNKNOWN, 1.0f, 0x7fc6); + timed_playSfx(1.25f, SFX_6C_LOCKUP_CLOSING, 1.05f, 0x7d00); + timed_playSfx(1.35f, SFX_6C_LOCKUP_CLOSING, 1.0f, 0x7d00); + timed_playSfx(1.8f, SFX_6C_LOCKUP_CLOSING, 1.0f, 0x7d00); + if(func_803203FC(2)){ + item_set(ITEM_6_HOURGLASS, 1); + item_set(ITEM_0_HOURGLASS_TIMER, 0x1067); + func_80324E88(2.4f); + func_80324E38(2.4f, 0); + timedFunc_set_2(2.4f, (TFQM2)func_8038C370, (s32)this->marker, 3); + } + else{//L8038CEFC + timedFunc_set_3(2.4f, (TFQM3)comusic_8025AB44, COMUSIC_62_RBB_BOOMBOX, 0x1f40, 0x12C); + func_80324DBC(2.4f, 0xb9e, 4, NULL, this->marker, func_8038CB34, func_8038CB68); + } + }//L8038CF60 + + if(this->state == 3 || this->state == 4){ + func_8030E878(0x3f2, local->unk0->unk14, 0x6d60, &this->position, 500.0f, 1000.0f); + func_80335924(this->unk148, ASSET_147_ANIM_BOOMBOX_MOVE, 0.2f, (1.0/(local->unk0->unk8)*randf2(1.0f, 1.1f))); + func_80335A8C(this->unk148, 2); + ml_vec3f_set_length(sp80, (this->state == 4)? -0x32*(2 + func_80326218()) : 300.0f/local->unk0->unk8); + local->unk14[0] = sp80[0] + this->position_x; + local->unk14[1] = sp80[1] + this->position_y; + local->unk14[2] = sp80[2] + this->position_z; + local->unk14[1] = 0.0f; + func_8038CA70(this, &local->unk14); + }//L8038D0B8 + + if(this->state == 5){ + actor_collisionOff(this); + timed_playSfx(0.2f, SFX_D9_WOODEN_CRATE_BREAKING_1, 0.9f, 0x7530); + func_80335924(this->unk148, ASSET_148_ANIM_BOOMBOX_DIE, 0.2f, 1.0f); + func_80335A8C(this->unk148, 2); + ml_vec3f_set_length(sp80, -300.f); + local->unk14[0] = sp80[0] + this->position_x; + local->unk14[1] = sp80[1] + this->position_y; + local->unk14[2] = sp80[2] + this->position_z; + local->unk14[1] = 0.0f; + func_8038CA70(this, &local->unk14); + func_8038C70C(this); + func_8038C538(this); + }//L8038D17C + + if(this->state == 6){ + func_80326310(this); + if(local->unk0->unk0 == 0x284){ + if(++D_80391280 == 8){ + func_8025A58C(-1, 0x190); + comusic_8025AB44(COMUSIC_62_RBB_BOOMBOX, 0, 0x190); + func_8025AABC(COMUSIC_62_RBB_BOOMBOX); + if(func_803203FC(2)){ + item_set(ITEM_6_HOURGLASS, 0); + func_803204E4(3, 0); + func_803204E4(5, 1); + } + else{//L8038D220 + timedFunc_set_3(0.0f, (TFQM3)func_8038C9F0, (s32)this->position_x, (s32)this->position_y, (s32)this->position_z); + func_80311480(0xb9f, 4, 0, 0, 0, 0); + } + }//L8038D278 + } + else{//L8038D28C + sp68[0] = this->position_x + 200.0f*local->unk0->unk4; + sp68[1] = this->position_y + 80.0f*local->unk0->unk4; + sp68[2] = this->position_z; + func_802C3F04(func_802C4140, local->unk0->unk0 + 1, reinterpret_cast(s32, sp68[0]), reinterpret_cast(s32, sp68[1]), reinterpret_cast(s32, sp68[2])); + + sp68[0] = this->position_x - 200.0f*local->unk0->unk4; + sp68[1] = this->position_y + 80.0f*local->unk0->unk4; + sp68[2] = this->position_z; + func_802C3F04(func_802C4140, local->unk0->unk0 + 1, reinterpret_cast(s32, sp68[0]), reinterpret_cast(s32, sp68[1]), reinterpret_cast(s32, sp68[2])); + } + }//L8038D378 + + if(this->state == 7){ + actor_collisionOff(this); + func_803262E4(this); + func_80335924(this->unk148, ASSET_147_ANIM_BOOMBOX_MOVE, 0.0f, 1.0f); + func_80335A8C(this->unk148, 2); + local->unk8[0] = this->position_x; + local->unk8[1] = this->position_y; + local->unk8[2] = this->position_z; + + local->unk14[0] = this->position_x; + local->unk14[1] = this->position_y; + local->unk14[2] = this->position_z; + local->unk20 = func_8038CBF0(this); + }//L8038D3FC + + if(this->state == 3 || this->state == 4 || this->state == 5){ + local->unk20 = func_8038CBF0(this); + if( local->unk20 == 0){ + sp64 = local->unk0->unk4*300.0f; + for(i = 0; i < 10; i++){ + local->unk14[0] = local->unk8[0] + randf2(-sp64, sp64); + local->unk14[1] = local->unk14[1]; + local->unk14[2] = local->unk8[2] + randf2(-sp64, sp64); + func_8038CA70(this, &local->unk14); + local->unk20 = func_8038CBF0(this); + if(local->unk20) + break; + } + if(i == 0xa){ + local->unk14[0] = local->unk8[0]; + local->unk14[2] = local->unk8[2]; + local->unk14[1] = 0.0f; + } + } + }//L8038D4DC + + if(this->state == 3){ + func_80258A4C(&this->position, this->yaw - 90.0f, &sp8C, &sp60, &sp5C, &sp58); + if(0.7 < sp58) + local->unk28 += 90.0f; + else if(sp58 < -0.7){ + local->unk28 -= 90.0f; + } + } +} + +void func_8038D590(ActorMarker *marker, s32 arg1){ + Actor *actor = marker_getActor(marker); + func_8038CC9C(actor, 4); +} + +void func_8038D5BC(ActorMarker *marker, s32 arg1){ + Actor *actor = marker_getActor(marker); + ActorLocal_RBB_5F80 *local = (ActorLocal_RBB_5F80 *) &actor->local; + + func_8030E6A4(0x3f5, local->unk0->unk10, 0x4e20); + func_8038CC9C(actor, 4); + func_8038C8A8(actor); +} + +void func_8038D608(ActorMarker *marker, ActorMarker *other){ + func_8038D7E8(marker, other->unk14_20 == 1); +} + +Actor *func_8038D638(ActorMarker *marker, Gfx **gdl, Mtx ** mptr, s32 arg3){ + f32 sp3C[3]; + Actor *actor = func_80325300(marker, &sp3C); + ActorLocal_RBB_5F80 *local = (ActorLocal_RBB_5F80 *) &actor->local; + func_8033A45C(1, local->unk0->unkD); + if(local->unk0->unkD == 1){ + func_8033A45C(2, (actor->state == 4)? 2: 1); + func_8033A45C(4, (actor->state == 4)? 2: 1); + func_8033A45C(5, (actor->state == 4)? 2: 1); + }//L8038D714 + else{ + func_8033A45C(3, (actor->state == 4)? 2: 1); + func_8033A45C(6, (actor->state == 4)? 2: 1); + func_8033A45C(7, (actor->state == 4)? 2: 1); + } + func_8033A2D4(func_803253A0, actor); + func_8033A2E8(func_80325794, marker); + func_803391A4(gdl, mptr, &actor->position, &sp3C, actor->scale, NULL, func_80330B1C(marker)); + + return actor; +} + +void func_8038D7E8(ActorMarker *marker, s32 arg1){ + Actor *actor = marker_getActor(marker); + ActorLocal_RBB_5F80 *local = (ActorLocal_RBB_5F80 *) &actor->local; + + FUNC_8030E8B4(SFX_1E_HITTING_AN_ENEMY_2, 1.0f, 20000, actor->position, 1000, 2000); + func_8030E6A4(SFX_D7_GRABBA_DEATH, local->unk0->unk10, 0x7530); + local->unk4 += (arg1) ? 1 : 5; + if(local->unk4 >= local->unk0->unkC) + func_8038CC9C(actor, 5); + else{ + func_8038CC9C(actor, 4); + } + + if(!arg1) + func_8038C8A8(actor); + +} + +void func_8038D8B4(Actor *actor){} + +void func_8038D8BC(Actor *this){ + f32 sp64[3]; + ActorLocal_RBB_5F80 *local = (ActorLocal_RBB_5F80 *) &this->local; + f32 sp5C; + f32 sp58; + f32 sp54; + f32 sp50; + f32 sp4C; + f32 tmp_f2; + f32 pad; + + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + local->unk0 = &D_80390B70[this->marker->unk14_20 - 0x1A1]; + local->unk4 = 0; + local->unk20 = 0; + + this->marker->propPtr->unk8_3 = 0; + this->scale = local->unk0->unk4; + if(local->unk0 == D_80390B70){ + this->yaw = 270.0f; + } + marker_setCollisionScripts(this->marker, func_8038D590, func_8038D5BC, func_8038D608); + func_803300D8(this->marker, func_8038D8B4); + if(local->unk0->unk0 == 0x281){ + func_8038CC9C(this, 1); + D_80391280 = 0; + } + else{ + func_8038CC9C(this, 7); + } + + if(jiggyscore_isSpawned(JIGGY_56_RBB_BOSS_BOOM_BOX) && !func_803203FC(2)) + marker_despawn(this->marker); + + if(func_803203FC(2)) + func_8038CBC0(); + + if(func_803203FC(0x1F)){ + func_8038CBC0(); + func_80335924(this->unk148, ASSET_146_ANIM_BOSS_BOOMBOX_APPEAR, 0.0f, 2.4f); + func_80335A8C(this->unk148, 2); + this->state = 2; + } + return; + } + + player_getPosition(&sp64); + if(this->state == 1){ + if(func_803203FC(2)){ + if(func_803203FC(3)){ + func_8038CC9C(this, 2); + } + } + else{//L8038DAA8 + if(ml_vec3f_distance(&this->position, &sp64) < 1200.0f){ + func_8038CC9C(this, 2); + } + } + }//L8038DAD8 + + if(this->state == 2){ + if(func_8033567C(this->unk148) == ASSET_146_ANIM_BOSS_BOOMBOX_APPEAR && func_80335794(this->unk148) > 0){ + func_80335924(this->unk148, ASSET_147_ANIM_BOOMBOX_MOVE, 0.2, 1.0f); + func_80335A8C(this->unk148, 1); + } + }//L8038DB30 + + if( this->state == 2 || this->state == 3 || this->state == 4){ + if(func_8033567C(this->unk148) == ASSET_147_ANIM_BOOMBOX_MOVE){ + func_8033568C(this->unk148, &sp5C, &sp58); + if(sp5C < 0.6 && 0.6 <= sp58){ + func_8030E878(SFX_6C_LOCKUP_CLOSING, randf2(-0.05f, 0.05f) + local->unk0->unk14, 0x4e20, &this->position, 500.0f, 1000.0f); + }//L8038DC04 + if(sp5C < 0.1 && 0.1 <= sp58){ + func_8038C39C(this); + } + } + }//L8038DC48 + + if(this->state == 3 || this->state == 4){ + if(func_803203FC(2)){ + if(item_empty(ITEM_0_HOURGLASS_TIMER)){ + func_803204E4(3, 0); + func_803204E4(5, 0); + func_8038CC9C(this, 8); + } + } + func_8033568C(this->unk148, &sp54, &sp50); + if(0.1 <= sp50 && sp50 <= 0.6){ + sp4C = (sp50 - 0.1)/0.5; + func_80255FE4(&this->position, &local->unk8, &local->unk14, sp4C); + this->yaw = local->unk24 + sp4C*(local->unk28 - local->unk24); + } + + if(func_80335794(this->unk148) > 0) + func_8038CC9C(this, 3); + + }//L8038DD64 + + if(this->state == 5){ + if(func_80335794(this->unk148) > 0){ + func_8038CC9C(this, 6); + }else{ + tmp_f2 = func_80335684(this->unk148); + if(tmp_f2 <= 0.3) + tmp_f2 = tmp_f2/0.3; + else + tmp_f2 = 1.0f; + func_80255FE4(&this->position, &local->unk8, &local->unk14, tmp_f2); + } + }//L8038DE10 + + if(this->state == 7){ + if(func_80335794(this->unk148) > 0) + func_8038CC9C(this, 3); + } +} diff --git a/src/RBB/code_640.c b/src/RBB/code_640.c new file mode 100644 index 00000000..76ae5f01 --- /dev/null +++ b/src/RBB/code_640.c @@ -0,0 +1,224 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + +extern ActorInfo D_80390D20; +extern ActorInfo D_80390050; +extern ActorInfo D_80390200; +extern ActorInfo D_80390270; +extern ActorInfo D_80390D50; +extern ActorInfo D_803906E0; +extern ActorInfo D_80390738; +extern ActorInfo D_803907D0; +extern ActorInfo D_803907F4; +extern ActorInfo D_80390818; +extern ActorInfo D_8039083C; +extern ActorInfo D_803904C0; +extern ActorInfo D_803904E4; +extern ActorInfo D_80390508; +extern ActorInfo D_803903B0; +extern ActorInfo D_803903D4; +extern ActorInfo D_803903F8; +extern ActorInfo D_80390640; +extern ActorInfo D_80390664; +extern ActorInfo D_80390688; +extern ActorInfo D_803906B0; +extern ActorInfo D_803908C0; +extern ActorInfo D_803908E4; +extern ActorInfo D_80390908; +extern ActorInfo D_803909B0; +extern ActorInfo D_803909D4; +extern ActorInfo D_803909F8; +extern ActorInfo D_80390A50; +extern ActorInfo D_80390380; +extern ActorInfo D_80390A80; //anchorswitch +extern ActorInfo D_80390AB0; //dolphin +extern ActorInfo D_80390AE0; //anchor +extern ActorInfo D_80390B10; +extern ActorInfo D_80390B40; //rarewareflag +extern ActorInfo D_80390BD0; +extern ActorInfo D_80390BF4; +extern ActorInfo D_80390C18; +extern ActorInfo D_80390C3C; +extern ActorInfo D_80390CF0; +extern ActorInfo D_80390D88; +extern ActorInfo D_80390DAC; //TNTpart_IDStruct; +extern ActorInfo D_80390E00; +extern ActorInfo D_80390E34; +extern ActorInfo D_80390E58; +extern ActorInfo D_803900E0; +extern ActorInfo D_80390104; //captcabinwooddoor +extern ActorInfo D_80390128; +extern ActorInfo D_8039014C; +extern ActorInfo D_803901B8; +extern ActorInfo D_803901DC; +extern ActorInfo D_80390170;//skylight +extern ActorInfo D_80390194;//honeycombswitch + + + +extern void func_802D3D54(Actor *); + +void func_80386A7C(Actor *); +void func_80386BF8(Actor *arg0); +Actor *func_80386B9C(ActorMarker *marker, Gfx **gdl, Mtx **mptr, s32 arg3); + + +/* .data */ +ActorAnimationInfo D_803900C0[4] = { + {0, 0.0f}, + {0, 0.0f}, + {0xD4, 0.15f}, + {0xD5, 0.5f} +}; + +ActorInfo D_803900E0 = { + 0x107, 0x21D, 0x493, 0x1, NULL, + func_802D3D54, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80390104 = { + 0x108, 0x21C, 0x492, 0x1, NULL, + func_802D3D54, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80390128 = { + 0x22D, 0x266, 0x4BA, 0x1, NULL, + func_802D3D54, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8039014C = { + 0x22E, 0x267, 0x4BB, 0x1, NULL, + func_802D3D54, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80390170 = { + 0x235, 0x23F, 0x4E2, 0x1, NULL, + func_802D3D54, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80390194 = { + 0x15F, 0x18F, 0x42F, 0x1, D_803900C0, + func_80386BF8, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_803901B8 = { + 0x22F, 0x263, 0x4DB, 0x1, NULL, + func_80386A7C, func_80326224, func_80386B9C, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_803901DC = { + 0x230, 0x264, 0x4DE, 0x1, NULL, + func_80386A7C, func_80326224, func_80386B9C, + 0, 0, 0.0f, 0 +}; + + +/* .code */ +s32 func_80386A30(f32 (*arg0)[3]){ + s32 r; + + r = ((*arg0)[0] < 0.0f)? 0 : 1; + + return (((*arg0)[2] < 0.0f)? 0 : 2) + r; +} + +void func_80386A7C(Actor *this){ + f32 sp2C[3]; + s32 sp28; + s32 temp_v0; + + func_802D3D74(this); + this->unk124_9 = 1; + func_8024C5CC(&sp2C); + sp28 = func_80386A30(&this->position); + temp_v0 = func_80386A30(&sp2C); + this->unk38_0 = 0; + if(sp2C[0] + 8000.0f < this->position_x || this->position_x < sp2C[0] - 8000.0f) + return; + + if( !( (sp28 ^ temp_v0) & 2 + && (-5000.0f < sp2C[0] && sp2C[0] < 6000.0f) + && (sp2C[2] < -600.0f || 600.0f < sp2C[2]) + ) + && ( sp28 ^ temp_v0) != 3 + ){ + this->unk38_0 = 1; + } +} + +Actor *func_80386B9C(ActorMarker *marker, Gfx **gdl, Mtx **mptr, s32 arg3){ + Actor *actor = marker_getActor(marker); + + return (actor->unk38_0) ? func_80325E78(marker, gdl, mptr, arg3): NULL; +} + +void func_80386BF8(Actor *arg0){ + if(!mapSpecificFlags_get(0) && honeycombscore_get(HONEYCOMB_F_RBB_BOAT_HOUSE)) + mapSpecificFlags_set(0, TRUE); + func_802D4A9C(arg0, 0); +} + +void rbb_func_80386C48(void){ + spawnableActorList_add(&D_80390D20, actor_new, 0x4880); + spawnableActorList_add(&D_80390050, actor_new, 0); + spawnableActorList_add(&D_80390200, actor_new, 0x80); + spawnableActorList_add(&D_80390270, actor_new, 0x80); + spawnableActorList_add(&D_80390D50, actor_new, 0x8004480); + spawnableActorList_add(&D_803906E0, actor_new, 0x80); + spawnableActorList_add(&D_80390738, actor_new, 0x80); + spawnableActorList_add(&D_803907D0, actor_new, 0x6488); + spawnableActorList_add(&D_803907F4, actor_new, 0x6488); + spawnableActorList_add(&D_80390818, actor_new, 0x6488); + spawnableActorList_add(&D_8039083C, actor_new, 0x6488); + spawnableActorList_add(&D_803904C0, actor_new, 0x6408); + spawnableActorList_add(&D_803904E4, actor_new, 0x6408); + spawnableActorList_add(&D_80390508, actor_new, 0x6408); + spawnableActorList_add(&D_803903B0, actor_new, 0x6408); + spawnableActorList_add(&D_803903D4, actor_new, 0x6408); + spawnableActorList_add(&D_803903F8, actor_new, 0x6408); + spawnableActorList_add(&D_80390640, actor_new, 0x400); + spawnableActorList_add(&D_80390664, actor_new, 0x400); + spawnableActorList_add(&D_80390688, actor_new, 0x400); + spawnableActorList_add(&D_803906B0, actor_new, 0); + spawnableActorList_add(&D_803908C0, actor_new, 0x80); + spawnableActorList_add(&D_803908E4, actor_new, 0x80); + spawnableActorList_add(&D_80390908, actor_new, 0x80); + spawnableActorList_add(&D_803909B0, actor_new, 0x880); + spawnableActorList_add(&D_803909D4, actor_new, 0x880); + spawnableActorList_add(&D_803909F8, actor_new, 0x880); + spawnableActorList_add(&D_80390A50, actor_new, 0x80); + spawnableActorList_add(&D_80390380, actor_new, 0x9aa); + spawnableActorList_add(&D_80390A80, actor_new, 0x80); //anchorswitch + spawnableActorList_add(&D_80390AB0, actor_new, 0x8C8); //dolphin + spawnableActorList_add(&D_80390AE0, actor_new, 0xC80); //anchor + spawnableActorList_add(&D_80390B10, actor_new, 0x80); + spawnableActorList_add(&D_80390B40, actor_new, 0x880); //rarewareflag + spawnableActorList_add(&D_80390BD0, actor_new, 0xc2c); + spawnableActorList_add(&D_80390BF4, actor_new, 0xc2c); + spawnableActorList_add(&D_80390C18, actor_new, 0xc2c); + spawnableActorList_add(&D_80390C3C, actor_new, 0xc2c); + spawnableActorList_add(&D_80390CF0, actor_new, 0x80); + spawnableActorList_add(&D_80390D88, actor_new, 0x2000889); + spawnableActorList_add(&D_80390DAC, actor_new, 0x2000889); + spawnableActorList_add(&D_80390E00, actor_new, 0x80); + spawnableActorList_add(&D_80390E34, actor_new, 0x80); + spawnableActorList_add(&D_80390E58, actor_new, 0x80); + spawnableActorList_add(&D_803900E0, actor_new, 0); + spawnableActorList_add(&D_80390104, actor_new, 0x8600); //captcabinwooddoor + spawnableActorList_add(&D_80390128, actor_new, 0); + spawnableActorList_add(&D_8039014C, actor_new, 0); + spawnableActorList_add(&D_803901B8, actor_new, 0x8600); + spawnableActorList_add(&D_803901DC, actor_new, 0x8600); + spawnableActorList_add(&D_80390170, actor_new, 0x8600); //skylight + spawnableActorList_add(&D_80390194, actor_new, 0x8); //honeycombswitch +} diff --git a/src/RBB/code_7A60.c b/src/RBB/code_7A60.c new file mode 100644 index 00000000..24eeae77 --- /dev/null +++ b/src/RBB/code_7A60.c @@ -0,0 +1,31 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_8038DE68(Actor *this); + +/* .data */ +ActorInfo D_80390CF0 = { + 0x1C0, 0x2AD, 0x0, 0x0, NULL, + func_8038DE68, NULL, func_80325340, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_8038DE50(Actor *this, s32 new_state){ + this->state = new_state; +} + +void func_8038DE68(Actor *this){ + if(!this->unk16C_4){ + + this->unk16C_4 = 1; + if(jiggyscore_isSpawned(JIGGY_56_RBB_BOSS_BOOM_BOX) && !func_803203FC(2)){ + marker_despawn(this->marker); + }else{ + func_802C3F04(func_802C4140, 0x281, reinterpret_cast(s32,this->position_x), reinterpret_cast(s32,this->position_y), reinterpret_cast(s32,this->position_z)); + func_8038DE50(this, 1); + } + }//L8038DEF4 +} \ No newline at end of file diff --git a/src/RBB/code_7B20.c b/src/RBB/code_7B20.c new file mode 100644 index 00000000..5ee2e864 --- /dev/null +++ b/src/RBB/code_7B20.c @@ -0,0 +1,122 @@ +#include +#include "functions.h" +#include "variables.h" + +/* typedefs and declarations */ +typedef struct { + f32 unk0; + ActorMarker *unk4; + f32 unk8[3]; + f32 unk14[3]; + s32 unk20; + f32 unk24[3]; +}ActorLocal_7B20; + +void func_8038DF6C(Actor* this); + + +/* .data */ +ActorInfo D_80390D20 = { + 0x1AA, 0x296, 0x43B, 0x0, NULL, + func_8038DF6C, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + + +/*.code */ +void func_8038DF10(Actor *this, int arg1){ + if(arg1 == 1){ + func_80335924(this->unk148, 0x16a, 0, 1.2f); + } + this->state = arg1; +} + +void func_8038DF6C(Actor* this){ + f32 sp7C[3]; + f32 sp70[3]; + f32 sp6C; + f32 sp68 = time_getDelta(); + f32 sp5C[3]; + f32 sp58; + ActorLocal_7B20 *local = (ActorLocal_7B20 *)&this->local; + Actor* other; + int i; + + if(!this->unk16C_4){ + this->marker->propPtr->unk8_3 = 1; + this->unk16C_4 = 1; + local->unk0 = randf2(80.0f, 100.0f); + local->unk4 = NULL; + local->unk20 = 0; + local->unk24[0] = 0.0f; + local->unk24[1] = 1.0f; + local->unk24[2] = 0.5f; + local->unk8[0] = this->position_x; + local->unk8[1] = this->position_y; + local->unk8[2] = this->position_z; + local->unk14[0] = this->pitch; + local->unk14[1] = this->yaw; + local->unk14[2] = this->roll; + func_8038DF10(this, 1); + }//L8038E050 + if(++local->unk20 == 2){ + for(i = 0x5e; i < 0x63; i++){ + + other = func_80326D68(this->position, i, -1, &sp58); + if(sp58 < 300.0f){ + local->unk4 = other->marker; + other->position_x = this->position_x; + other->position_y = this->position_y; + other->position_z = this->position_z; + break; + } + } + } + if(func_8025773C(&local->unk24[1], sp68)){ + local->unk24[1] = randf2(1.5f, 2.5f); + FUNC_8030E8B4(SFX_40E_UNKNOWN, 1.5f, 20000, this->position, 500, 1500); + }//L8038E118 + + if(func_8025773C(&local->unk24[2], sp68)){ + local->unk24[2] = randf2(3.5f, 5.5f); + func_8030E878(SFX_69_WHIPCRACK_CREAKING, randf2(1.1f, 1.2f), 0x55f0, this->position, 500.0f, 1500.0f); + }//L8038E184 + + local->unk24[0] += sp68; + sp70[0] = 0.0f; + sp70[1] = sinf((local->unk24[0]*local->unk0)/ 180.0 * 3.141592654) * 10.0f; + sp70[2] = 0.0f; + + sp7C[0] = cosf((local->unk24[0]*local->unk0)/ 180.0 * 3.141592654)*7.5; + sp7C[1] = sinf((local->unk24[0]*local->unk0)/ 180.0 * 3.141592654)*3.0; + sp7C[2] = 0.0f; + + this->position_x = local->unk8[0] + sp70[0]; + this->position_y = local->unk8[1] + sp70[1]; + this->position_z = local->unk8[2] + sp70[2]; + + sp5C[0] = local->unk14[0] + sp7C[0]; + sp5C[1] = local->unk14[1] + sp7C[1]; + sp5C[2] = local->unk14[2] + sp7C[2]; + + this->pitch = sp5C[0]; + this->yaw = sp5C[1]; + this->roll = sp5C[2]; + + if(local->unk4){ + other = marker_getActor(local->unk4); + if(!(other->state < 7)){ + local->unk4 = NULL; + }else{ + other->pitch = sp5C[0]; + other->roll = sp5C[2]; + TUPLE_ASSIGN(sp5C, 0.0f, 48.0f, 0.0f); + ml_vec3f_pitch_rotate_copy(sp5C, sp5C, this->pitch); + ml_vec3f_yaw_rotate_copy(sp5C, sp5C, this->yaw); + + other->position_x = sp5C[0] + this->position_x; + other->position_y = sp5C[1] + this->position_y; + other->position_z = sp5C[2] + this->position_z; + } + }//L8038E39C +} diff --git a/src/RBB/code_7FD0.c b/src/RBB/code_7FD0.c new file mode 100644 index 00000000..a379cc67 --- /dev/null +++ b/src/RBB/code_7FD0.c @@ -0,0 +1,110 @@ +#include +#include "functions.h" +#include "variables.h" + +/* typedefs and declarations */ +typedef struct { + f32 unk0; + f32 unk4[3]; + f32 unk10[3]; + f32 unk1C[3]; + f32 unk28; + f32 unk2C; +}ActorLocal_RBB_7FD0; + +void func_8038E3D8(Actor *this); + +/* .data */ +ActorInfo D_80390D50 = { + 0x1ab, 0x297, 0x43C, 0x0, NULL, + func_8038E3D8, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + + +/* .code */ +void func_8038E3C0(Actor *this, s32 arg1){ + this->state = arg1; +} + +void func_8038E3D8(Actor *this){ + f32 sp74[3]; + f32 sp68[3]; + ActorLocal_RBB_7FD0 *local = (ActorLocal_RBB_7FD0 *) &this->local; + int i; + f32 sp5C = time_getDelta(); + f32 sp50[3]; + f32 sp44[3]; + + if(!this->unk16C_4){ + this->marker->propPtr->unk8_3 = 1; + this->unk16C_4 = 1; + local->unk0 = randf2(80.0f, 100.0f); + local->unk28 = 0.0f; + local->unk2C = 0.5f; + this->position_y -= 10.0f; + local->unk4[0] = 0.0f; + local->unk4[1] = 0.0f; + local->unk4[2] = 0.0f; + local->unk10[0] = this->position_x; + local->unk10[1] = this->position_y; + local->unk10[2] = this->position_z; + local->unk1C[0] = this->pitch; + local->unk1C[1] = this->yaw; + local->unk1C[2] = this->roll; + func_8038E3C0(this, 1); + }//L8038E4C8 + + if(func_8025773C(&local->unk2C, sp5C)){ + local->unk2C = randf2(3.5f, 5.5f); + func_8030E878(SFX_69_WHIPCRACK_CREAKING, randf2(1.1f, 1.2f), 22000, &this->position, 500.0f, 1500.0f); + }//L8038E544 + + if(func_8032DCAC() == (int)this->marker && func_8028F20C()){ + player_getPosition(&sp44); + if(sp44[0] < this->position_x - 10.0f && local->unk4[2] < 3.0f) + local->unk4[2] += 5.0f*sp5C; + + if(this->position_x + 10.0f < sp44[0] && -3.0f < local->unk4[2]) + local->unk4[2] -= 5.0f*sp5C; + + if(this->position_z + 10.0f < sp44[2] && local->unk4[0] < 5.0f) + local->unk4[0] += 5.0f*sp5C; + + if(sp44[2] < this->position_z - 10.0f && -5.0f < local->unk4[0]) + local->unk4[0] -= 5.0f*sp5C; + } + else{ + for(i= 0; i< 3; i++){ + if(0.0f < local->unk4[i]){ + local->unk4[i] -= 2.5*sp5C; + if(local->unk4[i] < 0.0f) + local->unk4[i] = 0.0f; + } else if(local->unk4[i] < 0.0f) { //L8038E710 + local->unk4[i] += 2.5*sp5C; + if(0.0f < local->unk4[i]) + local->unk4[i] = 0.0f; + }//L8038E74C + } + }//L8038E754 + + local->unk28 += sp5C; + sp68[0] = 0.0f; + sp68[1] = 5.0f * sinf((((local->unk28*0.8)*local->unk0)/180.0)*3.141592654); + sp68[2] = 0.0f; + sp74[0] = 4.5 * cosf(((local->unk28*local->unk0)/180.0) * 3.141592654); + sp74[1] = 1.5 * sinf((((local->unk28*0.9)*local->unk0)/180.0)*3.141592654); + sp74[2] = 0.0f; + + this->position_x = local->unk10[0] + sp68[0]; + this->position_y = local->unk10[1] + sp68[1]; + this->position_z = local->unk10[2] + sp68[2]; + + sp50[0] = local->unk1C[0] + sp74[0]; + sp50[1] = local->unk1C[1] + sp74[1]; + sp50[2] = local->unk1C[2] + sp74[2]; + + this->pitch = sp50[0] + local->unk4[0]; + this->yaw = sp50[1] + local->unk4[1]; + this->roll = sp50[2] + local->unk4[2]; +} diff --git a/src/RBB/code_8520.c b/src/RBB/code_8520.c new file mode 100644 index 00000000..8868dd02 --- /dev/null +++ b/src/RBB/code_8520.c @@ -0,0 +1,398 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80255FE4(f32 [3], f32 [3], f32 [3], f32); +extern void func_802C8F70(f32); +extern int func_80309EB0(f32(*)[3], f32, f32 (*)[3], s32); +extern int func_803342AC(f32(*)[3], f32(*)[3],f32); + +/* typedefs and declarations */ +typedef struct { + f32 *unk0; + f32 unk4; + f32 unk8[3]; + f32 unk14[3]; + f32 unk20[3]; + f32 unk2C; + f32 unk30; + s32 unk34; + u8 unk38; + u8 unk39; +}ActorLocal_RBB_8520; + +void func_8038F190(Actor *this, s32 arg1); +Actor *func_8038F4B0(ActorMarker *marker, Gfx **gdl, Mtx **mptr, s32 arg3); +void func_8038F618(Actor *this); + + +/* .data */ +f32 D_80390D80[2] = {1.8f, 1.0f}; + +ActorInfo D_80390D88 = { + 0x1B7, 0x2A4, 0x48C, 0x0, NULL, + func_8038F618, NULL, func_8038F4B0, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80390DAC = { + 0x1B7, 0x30D, 0x48C, 0x0, NULL, + func_8038F618, NULL, func_8038F4B0, + 0, 0, 0.0f, 0 +}; + +s32 D_80390DD0[3] = {0xDE, 0xA7, 0x71}; +s32 D_80390DDC[4] = {0xFF, 0xFF, 0xFF, 0xFF}; +s32 D_80390DEC[4] = {0,0,0,0}; + +/* .rodata */ + + +/* .bss */ +f32 D_803912A0[3]; + +/* .code */ +void func_8038E910(Actor *this){ + ActorLocal_RBB_8520 *local = (ActorLocal_RBB_8520 *)&this->local; + local->unk30 = 3.0f; +} + +void func_8038E920(Actor *this){ + ActorLocal_RBB_8520 *local = (ActorLocal_RBB_8520 *)&this->local; + local->unk30 = 0.0f; +} + +void func_8038E92C(Actor *this){ + ActorLocal_RBB_8520 *local = (ActorLocal_RBB_8520 *)&this->local; + + if(this->state == 2 && local->unk34 == 0) + return; + if(func_8025773C( &local->unk30, time_getDelta())) + func_8038F190(this, 3); +} + +void func_8038E998(Actor *this){ + ParticleEmitter *other = partEmitList_pushNew(2); + f32 temp_f0; + + particleEmitter_setSprite(other, ASSET_70E_SPRITE_SMOKE_2); + func_802EFA5C(other, 0.0f, 0.1f); + particleEmitter_setStartingFrameRange(other, 0, 7); + particleEmitter_setPosition(other, &this->position); + func_802EFB70(other, 0.25f, 0.75f); + func_802EFB84(other, 0.75f, 1.75f); + particleEmitter_setParticleSpawnPositionRange(other, -50.0f, 25.0f, -50.0f, 50.0f, 25.0f, 50.0f); + particleEmitter_setParticleVelocityRange(other, -50.0f, 100.0f, -50.0f, 50.0f, 200.0f, 50.0f); + func_802EFEC0(other, 0.5f, 1.0f); + particleEmitter_emitN(other, 2); +} + +void func_8038EAB4(Actor *this){ + ParticleEmitter *other; + func_802BB3DC(0, 60.0f, 0.9f); + other = partEmitList_pushNew(1); + particleEmitter_setSprite(other, ASSET_4A0_SPRITE_EXPLOSION); + func_802EFA5C(other, 0.1f, 0.2f); + func_802EFA70(other, 8); + particleEmitter_setStartingFrameRange(other, 0, 0); + particleEmitter_setParticleFramerateRange(other, 4.0f, 4.0f); + particleEmitter_setParticleSpawnPositionRange(other, 0.0f, 200.0f, 0.0f, 0.0f, 200.0f, 0.0f); + particleEmitter_setPosition(other, &this->position); + func_802EFB70(other, 3.0f, 3.0f); + func_802EFB84(other, 8.0f, 8.0f); + func_802EFEC0(other, 0.5f, 0.5f); + particleEmitter_setParticleVelocityRange(other, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + particleEmitter_emitN(other, 1); +} + +void func_8038EC14(Actor *this){ + ParticleEmitter *other; + other = partEmitList_pushNew(6); + particleEmitter_setSprite(other, ASSET_70E_SPRITE_SMOKE_2); + func_802EFA5C(other, 0.05f, 0.1f); + particleEmitter_setStartingFrameRange(other, 0, 7); + particleEmitter_setPosition(other, &this->position); + func_802EFB70(other, 1.0f, 1.5f); + func_802EFB84(other, 2.0f, 3.0f); + particleEmitter_setParticleSpawnPositionRange(other, -75.0f, 25.0f, -75.0f, 75.0f, 75.0f, 75.0f); + particleEmitter_setParticleVelocityRange(other, -70.0f, 50.0f, -70.0f, 70.0f, 100.0f, 70.0f); + func_802EFFA8(other, &D_80390DD0); + func_802EFEC0(other, 3.0f, 4.0f); + particleEmitter_emitN(other, 6); +} + +void func_8038ED3C(Actor * actor, s32 arg1){ + ParticleEmitter *other = partEmitList_pushNew(0xa); + particleEmitter_setParticleAccelerationRange(other, 0.0f, -800.0f, 0.0f, 0.0f, -800.0f, 0.0f); + func_802EF9F8(other, 0.6f); + func_802EFA18(other, 3); + particleEmitter_setModel(other, arg1); + particleEmitter_setPosition(other, &actor->position); + func_802EFB70(other, 0.05f, 0.4f); + func_802EFE24(other, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setSpawnIntervalRange(other, 0.0f, 0.01f); + func_802EFEC0(other, 10.0f, 10.0f); + particleEmitter_setParticleVelocityRange(other, -700.0f, 200.0f, -700.0f, 700.0f, 500.0f, 700.0f); + particleEmitter_emitN(other, 0xa); +} + +int func_8038EE90(Actor *this){ + f32 sp2C[3]; + f32 sp20[3]; + ActorLocal_RBB_8520 *local = (ActorLocal_RBB_8520 *)&this->local; + + sp2C[0] = local->unk14[0]; + sp2C[1] = local->unk14[1]; + sp2C[2] = local->unk14[2]; + + sp20[0] = local->unk20[0]; + sp20[1] = local->unk20[1]; + sp20[2] = local->unk20[2]; + + sp2C[1] += 75.0f; + sp20[1] += 75.0f; + return func_803342AC(&sp2C, &sp20, 100.0f); +} + +int func_8038EF08(Actor *this, f32 (*position)[3], f32 arg2){ + f32 sp54[3]; + int sp50; + ActorLocal_RBB_8520 *local = (ActorLocal_RBB_8520 *)&this->local; + f32 sp40[3]; + f32 sp3C; + f32 sp30[3]; + + + sp54[0] = (*position)[0] - this->position_x; + sp54[1] = (*position)[1] - this->position_y; + sp54[2] = (*position)[2] - this->position_z; + if(180.0 < gu_sqrtf(sp54[0]*sp54[0] + sp54[1]*sp54[1] + sp54[2]*sp54[2])) + ml_vec3f_set_length(&sp54, 150.0f); + + local->unk20[0] = sp54[0] + this->position_x; + local->unk20[1] = sp54[1] + this->position_y; + local->unk20[2] = sp54[2] + this->position_z; + + local->unk20[1] = func_80309724(&local->unk20); + + sp40[0] = local->unk20[0]; + sp40[1] = local->unk20[1] + this->scale*100.0f; + sp40[2] = local->unk20[2]; + sp3C = this->scale*60.0f; + if(func_80309EB0(&sp40, sp3C, &sp30, 0)){ + sp50 = 1; + }else{ + sp50 = 0; + } + if( !func_80329210(this, &local->unk20) + || ((local->unk2C + 30.0f) < local->unk20[1]) + || sp50 + ){ + local->unk20[0] = this->position_x; + local->unk20[1] = this->position_y; + local->unk20[2] = this->position_z; + if(local->unk39 < 3 && ++local->unk39 == 3){ + local->unk39 = 0; + return 0; + } + }else{ + local->unk34 = func_8038EE90(this); + if(local->unk34 == 0){ + local->unk20[0] = this->position_x; + local->unk20[1] = this->position_y; + local->unk20[2] = this->position_z; + } + } + func_80335924(this->unk148, ASSET_147_ANIM_BOOMBOX_MOVE, 0.1f, randf2(-0.1f, 0.1f) + (1.0/arg2)*0.4); + func_80335A8C(this->unk148, 2); + local->unk14[0] = this->position_x; + local->unk14[1] = this->position_y; + local->unk14[2] = this->position_z; + return 1; +} + +void func_8038F190(Actor *this, s32 arg1){ + f32 sp44[3]; + ActorLocal_RBB_8520 *local = (ActorLocal_RBB_8520 *)&this->local; + + player_getPosition(&sp44); + + if(local->unk34){ + func_803343F8(local->unk34); + local->unk34 = FALSE; + } + + if(arg1 == 1){ + func_80335924(this->unk148, ASSET_147_ANIM_BOOMBOX_MOVE, 0.2f, 1.0f); + func_80335A8C(this->unk148, 4); + }//L8038F204 + + if(arg1 == 2){ + int sp3C = 0; + if(func_80329210(this, &sp44)){ + local->unk4 += 0.3; + if(*local->unk0 < local->unk4) + local->unk4 = *local->unk0; + sp3C = func_8038EF08(this, &sp44, local->unk4); + }//L8038F28C + if(!sp3C){ + func_8038E920(this); + local->unk4 -= 0.5; + if(local->unk4 < 0.5) + local->unk4 = 0.5f; + func_8038EF08(this, &local->unk8, local->unk4); + } + }//L8038F2FC + + if(arg1 == 3){ + func_8038FB6C(); + actor_collisionOff(this); + func_80324D54(0.0f, SFX_1B_EXPLOSION_1, 1.0f, 0x7d00, &this->position, 1000.0f, 2000.0f); + func_80335924(this->unk148, ASSET_148_ANIM_BOOMBOX_DIE, 0.2f, 1.0f); + func_80335A8C(this->unk148, 2); + func_8038EAB4(this); + func_8038EC14(this); + func_8038ED3C(this, 0x53a); + func_8038ED3C(this, 0x53b); + func_8038ED3C(this, 0x53c); + func_80326310(this); + this->unk10_1 = 0; + func_8038E920(this); + + }//L8038F3C8 + this->state = arg1; +} + + +void func_8038F3F0(ActorMarker *marker, s32 arg1){ + Actor* actor = marker_getActor(marker); + if(actor->state < 3){ + func_8038F190(actor, 3); + } +} + +void func_8038F430(ActorMarker *marker, s32 arg1){ + Actor* actor = marker_getActor(marker); + f32 sp18[3]; + + if(actor->state < 3){ + player_getPosition(&sp18); + if(ml_vec3f_distance(&actor->position, &sp18) < 300.0f) + func_8028F55C(5, actor->marker); + func_8038F190(actor, 3); + }//L8038F4A4 +} + +Actor * func_8038F4B0(ActorMarker *marker, Gfx **gdl, Mtx **mptr, s32 arg3){ + Actor *actor; + ActorLocal_RBB_8520 *local; + s32 sp28[4]; + f32 temp_f2; + //s32 temp_v0; + + actor = marker_getActor(marker); + local = (ActorLocal_RBB_8520 *)&actor->local; + func_8033A45C(1,2); + func_8033A45C(3,1); + func_8033A45C(6,1); + func_8033A45C(7,1); + if(local->unk30 > 0.0f && local->unk30 <= 1.0){ + temp_f2 = 2*(3*local->unk30 - (s32)(3*local->unk30)); + if (temp_f2 > 1.0f) + temp_f2 = 2 - temp_f2; + + sp28[0] = (s32) (temp_f2*255);\ + sp28[1] = (s32) (temp_f2*255);\ + sp28[2] = (s32) (temp_f2*255); + sp28[3] = 255; + D_803912A0[0] = actor->pitch; + D_803912A0[1] = actor->yaw; + D_803912A0[2] = actor->roll; + func_8033A334(sp28, &D_80390DDC); + }//L8038F5F8 + return func_80325888(marker, gdl, mptr, arg3); +} + +void func_8038F618(Actor *this){ + f32 sp7C[3]; + int sp78; + ActorLocal_RBB_8520 *local = (ActorLocal_RBB_8520 *)&this->local; + f32 sp70 = time_getDelta(); + f32 sp6C; + f32 sp68; + f32 sp5C[3]; + f32 sp50[3]; + f32 sp4C; + f32 sp48; + f32 sp44; + f32 pad0; + + + if(!this->unk16C_4){ + this->marker->propPtr->unk8_3 = 0; + this->unk16C_4 = 1; + local->unk8[0] = this->position_x; + local->unk8[1] = this->position_y; + local->unk8[2] = this->position_z; + local->unk38 = 0; + local->unk39 = 0; + local->unk0 = &D_80390D80[(this->modelCacheIndex == 0x30d)? 1 : 0]; + local->unk2C = func_80309724(&this->position); + local->unk34 = 0; + local->unk4 = 0.5f; + local->unk30 = 0.0f; + marker_setCollisionScripts(this->marker, func_8038F430, func_8038F3F0, func_8038F430); + func_8038F190(this, 1); + return; + }//L8038F714 + + player_getPosition(sp7C); + sp78 = func_80329210(this, sp7C); + if(!local->unk38){ + local->unk38 = TRUE; + func_8038FB54(); + } + func_8038E92C(this); + if(this->state == 1){ + if(sp78 && ml_vec3f_distance(&this->position, &sp7C) < 500.0f){ + func_8038F190(this, 2); + } + }//L8038F7A0 + + if(this->state == 2){ + sp5C[0] = this->position_x; + sp5C[1] = this->position_y; + sp5C[2] = this->position_z; + + if(0.0f != local->unk30 && !sp78) + func_8038E920(this); + + if(0.0f == local->unk30 && sp78) + func_8038E910(this); + + func_8033568C(this->unk148, &sp6C, &sp68); + + if(0.1 <= sp68 && sp68 <= 0.6) + func_80255FE4(this->position, &local->unk14, &local->unk20, (sp68 - 0.1) /0.5 ); + if(sp6C < 0.6 && 0.6 <= sp68) + func_8030E878(SFX_6C_LOCKUP_CLOSING, 1.1 + randf2(-0.05f, 0.05f), 20000, this->position, 500.0f, 1000.0f); + + if(sp6C < 0.1 && 0.1 <= sp68) + func_8038E998(this); + + sp50[0] = local->unk20[0] - local->unk14[0]; + sp50[1] = local->unk20[1] - local->unk14[1]; + sp50[2] = local->unk20[2] - local->unk14[2]; + + func_80258A4C(&D_80390DEC,this->yaw - 90.0f, &sp50, &sp4C, &sp48, &sp44); + + this->yaw += (sp44*400.0f)*sp70; + if(func_80335794(this->unk148) > 0){ + if(ml_vec3f_distance(&this->position, &local->unk8) < 10.0f){ + func_8038F190(this, 1); + }else{ + func_8038F190(this, 2); + } + } + }//L8038FA50 +} diff --git a/src/RBB/code_9670.c b/src/RBB/code_9670.c new file mode 100644 index 00000000..ad487d2b --- /dev/null +++ b/src/RBB/code_9670.c @@ -0,0 +1,62 @@ +#include +#include "functions.h" +#include "variables.h" + +extern + +void func_8038FB84(Actor *this); + +/* .data */ +ActorInfo D_80390E00 = { + 0x1B8, 0x2A5, 0x0, 0x0, NULL, + func_8038FB84, NULL, func_80325340, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +u8 D_803912B0; + +/* .code */ +void func_8038FA60(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + func_802C8F70(actor->yaw); + func_802C937C(6, &actor->position); +} + +void func_8038FA9C(Actor *this, s32 arg1){ + if(arg1 == 3){ + func_80324E38(0.0f, 3); + timedFunc_set_2(1.0f, (TFQM2)func_8025A6EC, COMUSIC_2B_DING_B, 28000); + timed_setCameraToNode(1.8f, 1); + timedFunc_set_1(2.0f, (TFQM1) func_8038FA60, (s32)this->marker); + func_80324E88(5.0f); + func_80324E38(5.0f, 0); + } + this->state = arg1; +} + +void func_8038FB54(void){ + D_803912B0++; +} + +void func_8038FB6C(void){ + D_803912B0--; +} + +void func_8038FB84(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = 1; + D_803912B0 = 0; + func_8038FA9C(this, 1); + } + + if(this->state == 1){ + if(D_803912B0 > 0) + func_8038FA9C(this, 2); + } + + if(this->state == 2){ + if(D_803912B0 == 0) + func_8038FA9C(this, 3); + } +} diff --git a/src/RBB/code_9840.c b/src/RBB/code_9840.c new file mode 100644 index 00000000..b6144824 --- /dev/null +++ b/src/RBB/code_9840.c @@ -0,0 +1,60 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8038FC48(Actor *this); + +/* typedefs and declarations */ +typedef struct { + s32 unk0; + s16 *unk4; + ActorMarker *unk8; +}ActorLocal_RBB_9840; + +/* .data */ +s16 D_80390E30[2] = {0x177, 0x17F}; +ActorInfo D_80390E34 = { + 0x1D2, 0x31B, 0x0, 0x0, NULL, + func_8038FC48, NULL, func_80325340, + 0, 0, 0.0f, 0 +}; +ActorInfo D_80390E58 = { + 0x1D3, 0x31C, 0x0, 0x0, NULL, + func_8038FC48, NULL, func_80325340, + 0, 0, 0.0f, 0 +}; + +/*.code */ +void func_8038FC30(Actor *this, s32 arg1){ + this->state = arg1; +} + +void func_8038FC48(Actor *this){ + ActorLocal_RBB_9840 *local = (ActorLocal_RBB_9840 *)&this->local; + f32 sp20; + f32 tmp_f2; + s32 tmp_a1; + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + actor_collisionOff(this); + local->unk4 = D_80390E30 + (this->marker->unk14_20 - 0x1d2); + local->unk8 = NULL; + + local->unk0 = func_802F9AA8(0x400); + func_802F9DB8(local->unk0, 1.0f, 1.0f, 0.0f); + func_802F9EC4(local->unk0, &this->position, 0x1f4, 0x3e8); + func_802F9F80(local->unk0, 0.0f, 8999999488.0f, 0.0f); + func_802FA060(local->unk0, 22000, 22000, 0.0f); + func_8038FC30(this, 1); + } + else{//L8038FD34 + if(local->unk8 == NULL) + local->unk8 = func_80326EEC(*local->unk4)->marker; + sp20 = func_8038A6B8(local->unk8); + tmp_f2 = 1.5* sp20 + 0.5; + func_802F9DB8(local->unk0, tmp_f2, tmp_f2, 0.0f); + tmp_a1 = (s32) (sp20*32000.0f); + func_802FA060(local->unk0, tmp_a1, tmp_a1, 0.0f); + } +} diff --git a/src/RBB/code_99F0.c b/src/RBB/code_99F0.c new file mode 100644 index 00000000..42dd9272 --- /dev/null +++ b/src/RBB/code_99F0.c @@ -0,0 +1,68 @@ +#include +#include "functions.h" +#include "variables.h" + + +s32 pad_803912C0[2]; +u8 D_803912C8; + +void func_8038FDE0(s32 arg0){ + static f32 D_803912CC; + + D_803912CC = 0.0f; + if(arg0 == 1) + D_803912CC = 6.5f; + + if(arg0 == 2){ + item_set(ITEM_3_PROPELLOR_TIMER, 0xf3b); + item_set(ITEM_9_PROPELLOR, 1); + } + + if(arg0 == 3 || arg0 == 4){ + levelSpecificFlags_set(0x27, FALSE); + levelSpecificFlags_set(0x28, FALSE); + item_set(ITEM_9_PROPELLOR,0); + if(arg0 == 3 && !jiggyscore_isCollected(0x57)){ + timedFunc_set_1(0.5f, (TFQM1)func_802FAD64, 3); + func_80324DBC(1.0f, 0xb9d, 4, NULL, NULL, NULL, NULL); + } + else{ + func_802FAD64(3); + } + }//L8038FED4 + D_803912C8 = arg0; +} + +void func_8038FEE8(void){ + if(D_803912C8 == 2) + func_8038FDE0(4); +} + +void func_8038FF18(void){ + D_803912C8 = 0; + func_8038FDE0(0); +} + +void func_8038FF40(void){ + if(D_803912C8 == 2) + func_8038FDE0(2); +} + +void func_8038FF70(void){ + extern static f32 D_803912CC; + + if( D_803912C8 == 0) + if(levelSpecificFlags_get(0x27) && levelSpecificFlags_get(0x28)) + func_8038FDE0(1); + + if(D_803912C8 == 1) + if(func_8025773C(&D_803912CC,time_getDelta())) + func_8038FDE0(2); + + if(D_803912C8 == 2) + if(item_getCount(ITEM_3_PROPELLOR_TIMER) == 0) + func_8038FDE0(3); + + if(D_803912C8 == 3) + func_8038FDE0(0); +} \ No newline at end of file diff --git a/src/RBB/code_CA0.c b/src/RBB/code_CA0.c new file mode 100644 index 00000000..1ce858d0 --- /dev/null +++ b/src/RBB/code_CA0.c @@ -0,0 +1,214 @@ +#include +#include "functions.h" +#include "variables.h" + + +/* typedefs and declarations */ +void func_803878B0(Actor *this); +void func_8038756C(Actor *this, s32 arg1); + +/* .data */ +ActorInfo D_80390200 = { + 0x183, 0x173, 0x402, 0x0, NULL, + func_803878B0, NULL, func_80325340, + 0, 0, 0.0f, 0 +}; + +s32 D_80390224[4] = { 0xff, 0, 0, 0xff}; +s32 D_80390234[4] = { 0x76, 0, 0, 0xff}; +s32 D_80390244[4] = { 0x76, 0, 0, 0xff}; +s32 D_80390254[4] = { 0xff, 0, 0, 0xff}; + +f32 D_80390264[3] = {-4900.0f, 0.0f, 0.0f}; + +/* .code */ +void func_80387090(ActorMarker *marker, s32 arg1){ + func_8038756C(marker_getActor(marker), arg1); +} + +void func_803870BC(s32 arg0, s32 arg1){ + s32 temp_v0; + + if(temp_v0 = func_8034C528(arg0)) + func_8034DFB0(temp_v0, &D_80390224, &D_80390234, (f64)arg1/1000.0); +} + +void func_8038711C(s32 arg0, s32 arg1){ + s32 temp_v0; + + func_8030E6D4(SFX_90_SWITCH_PRESS); + if(temp_v0 = func_8034C528(arg0)) + func_8034DFB0(temp_v0, &D_80390244, &D_80390254, (f64)arg1/1000.0); +} + +void func_8038718C(ActorMarker *marker){ + void *sp44; + f32 sp38[3]; + f32 sp2C[3]; + + if(sp44 = func_8034C528(0x19a)){ + sp38[0] = sp38[1] = sp38[2] = 0.0f; + sp2C[0] = 0.0f; + sp2C[2] = 0.0f; + sp2C[1] = 450.0f; + func_8034DDF0(sp44, &sp38, &sp2C, 4.0f, 1); + func_8034E1A4(sp44, SFX_D8_CRANE, 1.0f, 1.0f); + } + timed_setCameraToNode(0.0f, 4); + timed_setCameraToNode(2.5f, 5); + timed_playSfx(4.0f, SFX_7F_HEAVYDOOR_SLAM, 0.5f, 19000); + timed_playSfx(4.0f, SFX_7F_HEAVYDOOR_SLAM, 0.6f, 19000); + timed_playSfx(4.0f, SFX_7F_HEAVYDOOR_SLAM, 0.7f, 19000); + timed_playSfx(4.0f, SFX_7F_HEAVYDOOR_SLAM, 0.8f, 19000); + timed_playSfx(4.0f, SFX_7F_HEAVYDOOR_SLAM, 0.9f, 19000); + timed_playSfx(4.0f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 19000);\ + func_80324E88(5.0f); + func_80324E38(5.0f, 0); + timedFunc_set_2(5.0f, (TFQM2) func_80387090, (s32) marker, 3); +} + +void func_80387308(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + void *sp40; + f32 sp34[3]; + f32 sp28[3]; + + if(sp40 = func_8034C528(0x19a)){ + TUPLE_ASSIGN(sp34, 0.0f,200.0f,0.0f); + TUPLE_ASSIGN(sp28, 0.0f, 0.0f, 0.0f); + func_8034DDF0(sp40, &sp34, &sp28, 0.5f, 1); + func_8034E1A4(sp40, SFX_D8_CRANE, 1.0f, 1.0f); + }//L80387394 + + timed_playSfx(0.5f, SFX_7F_HEAVYDOOR_SLAM, 0.5f, 19000); + timed_playSfx(0.5f, SFX_7F_HEAVYDOOR_SLAM, 0.6f, 19000); + timed_playSfx(0.5f, SFX_7F_HEAVYDOOR_SLAM, 0.7f, 19000); + timed_playSfx(0.5f, SFX_7F_HEAVYDOOR_SLAM, 0.8f, 19000); + timed_playSfx(0.5f, SFX_7F_HEAVYDOOR_SLAM, 0.9f, 19000); + timed_playSfx(0.5f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 19000); + timedFunc_set_2(0.5f, (TFQM2) func_80387090, (s32) actor->marker, 1); + + timedFunc_set_2(1.5f, (TFQM2) func_803870BC, 0x19d, 0x1f4); + func_80324E88(1.5f); + func_80324E38(1.5f, 0); + +} + +void func_80387488(ActorMarker *marker){ + f32 sp1C[3]; + Actor *actor = marker_getActor(marker); + + player_getPosition(&sp1C); + if(-50.0f < sp1C[1] && sp1C[1] < 600.0f){ + sp1C[1] = 0; + if(ml_vec3f_distance(&sp1C, &D_80390264) < 500.0f){ + timedFunc_set_1(1.0f, (TFQM1) func_80387488, (s32)actor->marker); + return; + } + } + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.0f, 6); + timedFunc_set_1(0.5f, (TFQM1) func_80387308, (s32) actor->marker); +} + +void func_8038756C(Actor *this, s32 arg1){ + f32 sp6C[3]; + f32 sp60[3]; + void * temp_v0; + f32 sp50[3]; + f32 sp44[3]; + f32 sp40; + void * sp3C; + f32 sp30[3]; + f32 sp24[3]; + + if(arg1 == 1){ + if(this->state != 0){ + sp6C[0] = 0.0f; + sp6C[1] = 0.0f; + sp6C[2] = -40.0f; + sp60[0] = sp60[1] = sp60[2] = 0.0f; + + if(temp_v0 = func_8034C528(0x19C)) + func_8034DDF0(temp_v0, &sp6C, &sp60, 0.1f, 1); + + if(temp_v0 = func_8034C528(0x19D)) + func_8034DDF0(temp_v0, &sp6C, &sp60, 0.1f, 1); + } + }//L80387610 + + if(arg1 == 2){ + sp50[0] = sp50[1] = sp50[2] = 0.0f; + sp44[0] = 0.0f; + sp44[1] = 0.0f; + sp44[2] = -40.0f; + + if(temp_v0 = func_8034C528(0x19C)) + func_8034DDF0(temp_v0, &sp50, &sp44, 0.1f, 1); + + if(temp_v0 = func_8034C528(0x19D)) + func_8034DDF0(temp_v0, &sp50, &sp44, 0.1f, 1); + + timedFunc_set_2(0.1f, func_8038711C, 0x19d, 0x1f4); + timedFunc_set_2(0.1f, func_8025A6EC, COMUSIC_2B_DING_B, 28000); + func_80324E38(0.2f, 3); + timedFunc_set_1(1.1f, func_8038718C, this->marker); + }//L80387704 + + if(arg1 == 3){ + item_set(ITEM_6_HOURGLASS, 1); + item_set(ITEM_0_HOURGLASS_TIMER, 0x3bf); + } + + if(this->state == 3){ + item_set(ITEM_6_HOURGLASS, 0); + } + + if(arg1 == 4){ + sp3C = func_8034C528(0x19a); + if(sp3C){ + sp30[0] = 0.0f; + sp30[1] = 450.0f; + sp30[2] = 0.0f; + sp24[0] = 0.0f; + sp24[1] = 200.0f; + sp24[2] = 0.0f; + + + func_8034DDF0(sp3C, &sp30, &sp24, 3.0f, 1); + func_8034E1A4(sp3C, SFX_D8_CRANE, 1.0f, 1.0f); + }//L803877D4 + timed_playSfx(3.0f, SFX_7F_HEAVYDOOR_SLAM, 0.5f, 25000); + timed_playSfx(3.0f, SFX_7F_HEAVYDOOR_SLAM, 0.6f, 25000); + timedFunc_set_1(4.0f, func_80387488, this->marker); + }//L80387828 + + this->state = arg1; +} + +void func_80387850(ActorMarker *marker, s32 arg1){ + Actor *actor = marker_getActor(marker); + if(actor->state == 1){ + func_8038756C(actor, 2); + } +} + +void func_80387890(Actor *this){ + func_8038756C(this, 0); +} + +void func_803878B0(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = 1; + this->marker->unk30 = func_80387890; + marker_setCollisionScripts(this->marker, 0, func_80387850, 0); + func_8032AA58(this, 1.1f); + func_8038756C(this, 1); + } + + if(this->state == 3){ + if(item_empty(ITEM_0_HOURGLASS_TIMER)){ + func_8038756C(this, 4); + } + } +} diff --git a/src/SM/ch/attacktutorial.c b/src/SM/ch/attacktutorial.c new file mode 100644 index 00000000..cea6acae --- /dev/null +++ b/src/SM/ch/attacktutorial.c @@ -0,0 +1,219 @@ +#include +#include "functions.h" +#include "variables.h" + +/* chAttackTutorial - controls bottle teaching moves in spiral*/ + +//external +void func_80324E88(f32); +void func_8028F918(s32); + +//public +void func_80387764(ActorMarker *); +void chAttackTutorial_setState(Actor * this, s32 arg1); +void chAttackTutorial_update(Actor *); + + +/* .data */ +ActorInfo D_8038AC20 = { MARKER_12B_ATTACK_TUTORIAL, ACTOR_ATTACK_TUTORIAL, 0, + 1, NULL, + chAttackTutorial_update, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void __chAttackTutorial_spawnEnemy(ActorMarker *marker, s32 enemy_id){ + Actor *actor = marker_getActor(marker); + s32 pad; + Actor *other = spawn_child_actor(enemy_id, &actor); + + actor->unk100 = other->marker; + other->unk100 = actor->marker; + if(actor->unk10_12 == 3 && actor->unk38_31 == 1){ + other->unk38_31 = 1; + }else{//L803871D4 + other->unk38_31 = 0; + } + other->unk10_12 = 1; + if(marker); +} + +s32 func_803871FC(Actor *this, s32 arg1){ + volatile s32 sp1C; + s32 tmp_v0; + + sp1C = (arg1 == 1)? ACTOR_TOPPER_A : (tmp_v0 = (arg1 == 2)? ACTOR_BAWL_A : ACTOR_164_COLLYWOBBLE_A); + func_802C3D3C(__chAttackTutorial_spawnEnemy, this->marker, sp1C); + +} + +void func_80387258(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + chAttackTutorial_setState(marker_getActor(marker), 2); +} + +void func_80387288(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *actor = marker_getActor(marker); + func_8028F918(0); + switch(text_id){ + case 0xe15://L803872C8 + ability_unlock(ABILITY_C_ROLL); + chAttackTutorial_setState(actor, 2); + break; + case 0xe17://L803872E4 + ability_unlock(ABILITY_B_RATATAT_RAP); + chAttackTutorial_setState(actor, 2); + break; + }//L803872FC + func_80324E88(0.0f); +} + +void chAttackTutorial_setState(Actor * this, s32 arg1){ + switch (arg1) + { + case 5: + if(this->unk10_12 == 0){ + ability_unlock(ABILITY_4_BEAR_PUNCH); + func_80311480(0xDFF, 0xE, this->unk1C, this->marker, func_80387288, func_80387258); + } + else{ + func_80311480((this->unk10_12 == 1) ? 0xe15 : 0xe17, 0xE, this->unk1C, this->marker, func_80387288, NULL); + } + break; + case 2://L803873E0 + + this->unk38_31 = 0; + func_803871FC(this, ++this->unk10_12); + break; + case 3://L8038742C + mapSpecificFlags_set(5,1); + mapSpecificFlags_set(0xC, 1); + marker_despawn(this->marker); + break; + case 4://L80387454 + mapSpecificFlags_set(0xC, 1); + if(!honeycombscore_get(HONEYCOMB_17_SM_COLIWOBBLE)){ + this->unk10_12 = 3; + this->unk38_31 = 1; + func_803871FC(this, this->unk10_12); + } + break; + }//L803874A8 + func_80328A84(this, arg1); +} + +int func_803874C4(void){ + return ability_isUnlocked(ABILITY_4_BEAR_PUNCH) + && ability_isUnlocked(ABILITY_C_ROLL) + && ability_isUnlocked(ABILITY_B_RATATAT_RAP); +} + +void chAttackTutorial_update(Actor *this){ + f32 sp2C; + Actor *bottles; + + if(!this->initialized){ + //find closest tutorial bottles + bottles = func_80326D68(this->position, ACTOR_12B_TUTORIAL_BOTTLES, -1, &sp2C); + if(bottles != NULL){ + this->unk1C_x = bottles->position_x; + this->unk1C_y = bottles->position_y; + this->unk1C_z = bottles->position_z; + }else{ + {this->unk1C_x = this->position_x; + this->unk1C_y = this->position_y; + this->unk1C_z = this->position_z;} + } + this->unk10_12 = (ability_isUnlocked(ABILITY_C_ROLL))? 2 : (ability_isUnlocked(ABILITY_4_BEAR_PUNCH)? 1:0); + this->initialized = 1; + } + + switch(this->state){ + case 1://L80387610 + if(mapSpecificFlags_get(4)) + chAttackTutorial_setState(this, 5); + + if(func_803874C4() || func_803203FC(0xc1)) + chAttackTutorial_setState(this, 4); + break; + case 2://L80387658 + if(mapSpecificFlags_get(7)){ + func_80387764(this->marker); + mapSpecificFlags_set(7,0); + } + break; + case 5://L80387680 + break; + }////L80387680 +} + +void func_80387690(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *actor = marker_getActor(marker); + switch(text_id){ + case 0xDFF: + func_8028F918(0); + break; + case 0xE14: + case 0xE16: + case 0xE18: + func_803871FC(actor, actor->unk10_12); + break; + case 0xE15: + ability_unlock(ABILITY_C_ROLL); + chAttackTutorial_setState(actor, 2); + break; + case 0xE17: + ability_unlock(ABILITY_B_RATATAT_RAP); + chAttackTutorial_setState(actor, 2); + break; + case 0xE12: + case 0xE19: + chAttackTutorial_setState(actor, 3); + break; + } + func_80324E88(0.0f); +}//*/ + +void func_80387764(ActorMarker * marker){ + s32 sp34; + int temp_a2; + s32 sp2C = 4; + + Actor *actor = marker_getActor(marker); + + temp_a2 = actor->unk38_31 ? 1 : 0 ; + if( temp_a2 ){ + sp2C = 0xE; + } + + switch (actor->unk10_12) + { + case 0x1: //L803877D8 + sp34 = temp_a2 ? 0xe15 : 0xe14; //dialog enums + break; + + case 0x2: //L803877F4 + sp34 = temp_a2 ? 0xe17 : 0xe16; //dialog enums + break; + + case 3: //L80387810 + sp34 = temp_a2 ? 0xe19 : 0xe18; //dialog enums + break; + default: + //sp34 = actor->unk38_31; + break; + }//L8038782C + if(sp34 == 0xe19){ + func_8028F94C(2, actor->unk1C); + } + //L80387848 + if(!mapSpecificFlags_get(3) && func_802DA498() && temp_a2){ + mapSpecificFlags_set(3, 1); + sp34 = 0xE12; + }//L80387898 + if(temp_a2){ + timed_setCameraToNode(0.0f, 6); + }//L803878B0 + + func_80311480(sp34, sp2C, actor->unk1C, actor->marker, func_80387690, NULL); + actor->unk38_31++; +} diff --git a/src/SM/ch/vegetables.c b/src/SM/ch/vegetables.c new file mode 100644 index 00000000..d9b10e9f --- /dev/null +++ b/src/SM/ch/vegetables.c @@ -0,0 +1,494 @@ +#include +#include "functions.h" +#include "variables.h" + + + +//external +f32 func_80309724(f32*); +void func_802C4218(s32, f32, f32, f32); +void func_803252D0(f32, s32); +void func_80328B8C(Actor *, s32, f32, s32); + +//typedefs +typedef struct ch_vegatable{ + TUPLE(f32, unk0); + s32 unkC; + u32 pad10_31: 19; + u32 unk10_12: 4; + u32 pad10_8: 9; +} ChVeg; + +//public +Actor *func_80387DF4(ActorMarker *, Gfx**, Mtx**, Vtx **); +void func_80388080(Actor *); + +/* .data */ +ActorAnimationInfo chCarrotAnimations[5] = { + {0, 0.0f}, + {0x223, 1000000.0f}, + {0x223, 1.0f}, + {0x224, 0.75f}, + {0x223, 1.0f} +}; + +ActorInfo D_8038AC78 = { 0x12A, ACTOR_TOPPER_A, MODEL_TOPPER, 1, chCarrotAnimations, + func_80388080, func_80326224, func_80387DF4, + 2000, 0, 1.0f, 0 +}; + +ActorInfo D_8038AC9C = { 0x1E6, ACTOR_TOPPER_B, MODEL_TOPPER, 1, chCarrotAnimations, + func_80388080, func_80326224, func_80387DF4, + 2000, 0, 1.0f, 0 +}; + +ActorAnimationInfo chOnionAnimations[5] = { + {0, 0.0f}, + {0x226, 1000000.0f}, + {0x226, 1.0f}, + {0x227, 0.75f}, + {0x226, 1.0f} +}; + +ActorInfo D_8038ACE8 = { 0x129, ACTOR_BAWL_A, MODEL_BAWL, 1, chOnionAnimations, + func_80388080, func_80326224, func_80387DF4, + 0, 0, 1.0f, 0 +}; + +ActorInfo D_8038AD0C = { 0x1E7, ACTOR_BAWL_B, MODEL_BAWL, 1, chOnionAnimations, + func_80388080, func_80326224, func_80387DF4, + 0, 0, 1.0f, 0 +}; + +ActorAnimationInfo chCauliflowerAnimations[5] = { + {0, 0.0f}, + {0x225, 10000000.0f}, + {0x225, 1.0f}, + {0x225, 10000000.0f}, + {0x225, 1.0f} +}; + +ActorInfo D_8038AD58 = { 0x128, ACTOR_164_COLLYWOBBLE_A, MODEL_COLLYWOBBLE, 1, chCauliflowerAnimations, + func_80388080, func_80326224, func_80387DF4, + 0, 0, 2.0f, 0 +}; + +ActorInfo D_8038AD7C = { 0x1E8, ACTOR_COLLYWOBBLE_B, MODEL_COLLYWOBBLE, 1, chCauliflowerAnimations, + func_80388080, func_80326224, func_80387DF4, + 0, 0, 2.0f, 0 +}; + +s32 D_8038ADA0[3] = {0xFF, 0xFF, 0xFF}; + +struct31s D_8038ADAC = { + {0.1f, 0.5f}, + {1.5f, 3.0f}, + {0.0f, 0.01f}, + {1.0f, 1.5f}, + 0.0f, 0.01f, +}; + +struct42s D_8038ADD4 = { + {{-100.0f, -100.0f, -100.0f}, {100.0f, 100.0f, 100.0f}}, + {{-40.0f, -40.0f, -40.0f}, {40.0f, 40.0f, 40.0f}} +}; + +struct31s D_8038AE04 = { + {0.5f, 0.75f}, + {0.4f, 0.6f}, + {0.0f, 0.01f}, + {4.0f, 4.0f}, + 0.0f, 0.2f +}; + +struct43s D_8038AE2C = { + {{-100.0f, 200.0f, -100.0f}, {100.0f, 400.0f, 100.0f}}, + {{0.0f, -600.0f, 0.0f}, {0.0f, -600.0f, 0.0f}}, + {{-80.0f, -80.0f, -80.0f}, {80.0f, 80.0f, 80.0f}} +}; + +struct31s D_8038AE74 = { + {1.0f, 1.0f}, + {1.0f, 1.0f}, + {0.0f, 0.01f}, + {2.0f, 2.0f}, + 0.0f, 0.5f +}; + +struct43s D_8038AE9C = { + {{-100.0f, 400.0f, -100.0f}, {100.0f, 600.0f, 100.0f}}, + {{0.0f, -600.0f, 0.0f}, {0.0f, -600.0f, 0.0f}}, + {{-20.0f, -20.0f, -20.0f}, {20.0f, 20.0f, 20.0f}} +}; + +struct31s D_8038AEE4 = { + {0.6f, 0.8f}, + {0.5f, 0.7f}, + {0.0f, 0.01f}, + {4.0f, 4.0f}, + 0.0f, 0.5f +}; + +struct43s D_8038AF0C ={ + {{-200.0f, 200.0f, -200.0f}, {200.0f, 600.0f, 200.0f}}, + {{0.0f, -900.0f, 0.0f}, {0.0f, -900.0f, 0.0f}}, + {{-100.0f, -100.0f, -100.0f}, {100.0f, 100.0f, 100.0f}}, +}; + +/* .code */ +void func_80387910(ParticleEmitter *arg0, f32 *arg1, s32 arg2){ + s32 sp24[3] = D_8038ADA0; + func_802EFFA8(arg0, sp24); + particleEmitter_setSprite(arg0, ASSET_700_SPRITE_DUST); + particleEmitter_setStartingFrameRange(arg0, 0, 7); + particleEmitter_setPosition(arg0, arg1); + func_802EFB98(arg0, &D_8038ADAC); + particleEmitter_setPositionAndVelocityRanges(arg0, &D_8038ADD4); + particleEmitter_emitN(arg0, arg2); +} + +void func_803879B8(ParticleEmitter *arg0, f32 *arg1, s32 arg2, enum asset_e model_id){ + func_802EF9F8(arg0, 0.6f); + func_802EFA18(arg0, 2); + particleEmitter_setModel(arg0, model_id); + particleEmitter_setPosition(arg0, arg1); + func_802EFA70(arg0, 2); + func_802EFE24(arg0, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); + func_802EFB98(arg0, &D_8038AE04); + particleEmitter_setPositionVelocityAndAccelerationRanges(arg0, &D_8038AE2C); + particleEmitter_emitN(arg0, arg2); +} + +void func_80387A80(ParticleEmitter *arg0, f32 *arg1, s32 arg2, enum asset_e model_id){ + func_802EF9F8(arg0, 0.6f); + func_802EFA18(arg0, 3); + particleEmitter_setModel(arg0, model_id); + particleEmitter_setPosition(arg0, arg1); + func_802EFA70(arg0, 2); + func_802EFE24(arg0, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); + func_802EFB98(arg0, &D_8038AE74); + particleEmitter_setPositionVelocityAndAccelerationRanges(arg0, &D_8038AE9C); + particleEmitter_emitN(arg0, arg2); +} + +void func_80387B48(ParticleEmitter *arg0, f32 arg1[3], s32 arg2, enum asset_e model_id){ + func_802EF9F8(arg0, 0.7f); + func_802EFA18(arg0, 4); + particleEmitter_setModel(arg0, model_id); + particleEmitter_setPosition(arg0, arg1); + func_802EFA70(arg0, 2); + func_802EFE24(arg0, 150.0f, -300.0f, -300.0f, 300.0f, 300.0f, -150.0f); + func_802EF9EC(arg0, 0x1f, 0x1f40); + func_802EFB98(arg0, &D_8038AEE4); + particleEmitter_setPositionVelocityAndAccelerationRanges(arg0, &D_8038AF0C); + particleEmitter_emitN(arg0, arg2); +} + +void func_80387C28(Actor * this){ + ChVeg * local = (ChVeg *)&this->local; + f32 sp30[3]; + + FUNC_8030E8B4(SFX_111_WHIPCRACK_DEATH, 1.0f, 32000, this->position, 1000, 2000); + if(local->unkC == 3){ + sp30[0] = this->position_x; + sp30[1] = this->position_y; + sp30[2] = this->position_z; + sp30[1] += 50.0f; + func_80387B48(partEmitList_pushNew(0xC), sp30, 0xC, 0x4F4); + func_803879B8(partEmitList_pushNew(4), sp30, 0x4, 0x4F2); + func_803879B8(partEmitList_pushNew(4), sp30, 0x4, 0x4F3); + sp30[1] += 50.0f; + func_80387910(partEmitList_pushNew(8), sp30, 8); + }//L80387D18 + if(this->unk38_31){ + this->position_y += 100.0f; + func_802CA1CC(HONEYCOMB_17_SM_COLIWOBBLE); + func_802C3F04((GenMethod_4)func_802C4218, 0x1f, reinterpret_cast(s32, this->position_x), reinterpret_cast(s32, this->position_y), reinterpret_cast(s32, this->position_z)); + }//L80387D64 + func_803252D0(1.5f, 7); + actor_collisionOff(this); + if(local->unkC != 3){ + func_80328B8C(this, 3, 0.0f, 1); + actor_playAnimationOnce(this); + } + else{ + marker_despawn(this->marker); + } +} + +void func_80387DCC(ActorMarker *marker, ActorMarker *other_marker){ + func_80387C28(marker_getActor(marker)); +} + +Actor *func_80387DF4(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3){ + Actor *actor = marker_getActor(marker); + + if(actor->unk138_24) + func_8033A470(3, 7); + else + func_8033A45C(3, 0); + + return func_80325888(marker, gdl, mptr, arg3); +} + +void func_80387E64(Actor *this){ + ChVeg *local = (ChVeg *)&this->local; + + this->unk1C_x = randf2(-50.0f, 50.0f); + this->unk1C_y = randf2(-50.0f, 50.0f); + this->unk1C_z = randf2(-50.0f, 50.0f); + + this->unk1C_x = local->unk0_x + this->unk1C_x; + this->unk1C_y = local->unk0_y + this->unk1C_y; + this->unk1C_z = local->unk0_z + this->unk1C_z; +} + +void func_80387F00(Actor *this){ + ChVeg *local = (ChVeg *)&this->local; + + this->position_y += (mapSpecificFlags_get(0xC) || func_803203FC(0xC1, this)) ? 120.0 : 180.0; + local->unk0_x = this->position_x; + local->unk0_y = this->position_y; + local->unk0_z = this->position_z; + this->velocity_x = 0.0f; + this->velocity_y = 0.0f; + this->velocity_z = 0.0f; + func_80387E64(this); +} + +int func_80387FA8(Actor *this, ChVeg *local, s32 yaw, s32 arg3){ + f32 sp24[3]; + f32 sp18[3]; + + sp18[0] = arg3; + sp18[1] = 0.0f; + sp18[2] = 0.0f; + ml_vec3f_yaw_rotate_copy(sp18, sp18, yaw - 90.0); + sp24[0] = sp18[0] + local->unk0_x; + sp24[1] = sp18[1] + local->unk0_y; + sp24[2] = sp18[2] + local->unk0_z; + if(func_80307258(sp24, this->unk10_25 - 1, this->unk10_18 - 1) == -1) + return 0; + else + return 1; +} + +void func_80388080(Actor *this){ + f32 temp_velZ; + f32 temp_velX; + f32 temp_f0; + f32 sp78; + f32 sp6C[3]; + f32 sp60[3]; + f32 sp54[3]; + ChVeg *local = (ChVeg *)&this->local; //sp38 + f32 sp30; + + + + if(!this->initialized){ + switch(this->marker->unk14_20){ + default: + local->unkC = 3; //cauliflower + break; + case 0x12A: //L803880F0 + case 0x1E6: //L803880F0 + local->unkC = 1; //carrot + break; + case 0x129: //L80388100 + case 0x1E7: //L80388100 + local->unkC = 2; //onion + break; + } + actor_collisionOff(this); + marker_setCollisionScripts(this->marker, NULL, NULL, func_80387DCC); + this->unk1C_x = this->position_x; + this->unk1C_y = this->position_y; + this->unk1C_z = this->position_z; + this->position_y -= 200.f; + + do{//L80388154 + temp_velX = randf2(-10.0f, 10.0f); + temp_f0 =(0.0f <= temp_velX) ? temp_velX : -temp_velX; + }while(temp_f0 < 5.0); + + do{//L803881AC + temp_velZ = randf2(-10.0f, 10.0f); + temp_f0 =(0.0f <= temp_velZ) ? temp_velZ : -temp_velZ; + }while(temp_f0 < 5.0); + + this->velocity_x = temp_velX; + this->velocity_y = (local->unkC == 3) ? 90.0f : 70.0f; + this->velocity_z = temp_velZ; + this->unk138_24 = 1; + this->unk138_23 = 0; + this->unk38_0 = 0; + this->initialized = 1; + this->scale = 0.5; + }//L80388278 + switch (this->state) + { + case 1: //L803882B0 + if(mapSpecificFlags_get(0xC) || func_803203FC(0xC1) || this->unk10_12){ + //L803882E4 + if(mapSpecificFlags_get(0xC) || func_803203FC(0xC1)){ //L8038830C + this->unk1C_y += (local->unkC == 3)? 120.0 : 0.0; + }else{//L80388350 + this->unk1C_y += (local->unkC == 3)? 270.0 : 85.0; + } + //L80388384 + func_80328A84(this, 4); + } + break; + case 4: //L8038839C + this->position_x = this->velocity_x + this->position_x; + this->position_y = this->velocity_y + this->position_y; + this->position_z = this->velocity_z + this->position_z; + this->velocity_y -= 5.0f; + this->scale = MIN(this->scale + 0.05, 1.0); + if(this->velocity_y < 0.0f && this->position_y < this->unk1C_y){ + this->position_y = func_80309724(this->position); + if(local->unkC == 3) + func_80387F00(this); + + actor_collisionOn(this); + func_80328A84(this, 2); + }//L80388494 + + if(!this->unk138_23){ + if(0.0f < this->position_y){ + FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 1000, 2000); + this->unk138_23 = 1; + this->scale = 1.0f; + } + } + + break; + case 2: //L803884E4 + if(this->unk38_0){ + if(func_80329480(this)){ + this->unk38_0 = 0; + } + }else{//L80388520 + if(local->unkC == 1){ + this->unk28 = 3.0f; + if(mapSpecificFlags_get(0xC) || func_803203FC(0xC1)){//L80388554 + if(!func_80329030(this, 0) && func_80329480(this)){ + func_80328CEC(this, (s32)this->yaw, 0x78, 0xb4); + this->unk38_0 = 1; + }//L803885A0 + if(func_803292E0(this)){ + this->yaw_moving = func_80329784(this); + } + else{//L803885CC + if(randf() < 0.02){ + func_80328CEC(this, (s32)this->yaw, 0x1E, 0x5A); + } + }//L80388B68 + } + else{//L80388618 + this->yaw_moving = func_80329784(this); + } + } + else if(local->unkC == 2){//L80388634 + this->unk28 = 4.0f; + if(!func_80329030(this, 0) && func_80329480(this)){ + func_80328CEC(this, (s32)this->yaw, 0x78, 0xB4); + this->unk38_0 = 1; + }//L80388698 + if(mapSpecificFlags_get(0xC) || (func_803203FC(0xC1) && func_803292E0(this))){ + this->yaw_moving = func_80329784(this); + }else{//L803886E4 + if(randf() < 0.02){//D_8038B1D0){ + func_80328CEC(this, (s32)this->yaw, 0x1E, 0x5A); + } + } + }else{//L80388730 + sp78 = time_getDelta(); + sp6C[0] = this->unk1C_x - this->position_x; + sp6C[1] = this->unk1C_y - this->position_y; + sp6C[2] = this->unk1C_z - this->position_z; + if( gu_sqrtf(sp6C[0]*sp6C[0] + sp6C[1]*sp6C[1] + sp6C[2]*sp6C[2] ) < 40.0f){ + ml_vec3f_set_length(sp6C, 400.0f); + } + else{ + ml_vec3f_set_length(sp6C, 100.0f); + } + this->position_x += this->velocity_x*sp78 + sp6C[0]*sp78*sp78; + this->position_y += this->velocity_y*sp78 + sp6C[1]*sp78*sp78; + this->position_z += this->velocity_z*sp78 + sp6C[2]*sp78*sp78; + this->velocity_x += sp6C[0]*sp78; + this->velocity_y += sp6C[1]*sp78; + this->velocity_z += sp6C[2]*sp78; + if(gu_sqrtf(this->velocity_z*this->velocity_z + (this->velocity_x*this->velocity_x + this->velocity_y*this->velocity_y)) > 50.0f){ + ml_vec3f_set_length(this->velocity, 50.0f); + } + if(ml_vec3f_distance(this->position, this->unk1C) < 20.0f){ + func_80387E64(this); + } + this->unk28 = 5.0f; + if(mapSpecificFlags_get(0xC) || (func_803203FC(0xc1))){ //L8038892C + if(!func_80387FA8(this, local, (s32)this->yaw, (s32)this->unk28)){ + if(func_80329480(this)){ + func_80328CEC(this, (s32)this->yaw, 0x78, 0xb4); + this->unk38_0 = 1; + }//L80388994 + }else{ //L803889A0 + + this->position_x -= local->unk0_x; + this->position_y -= local->unk0_y; + this->position_z -= local->unk0_z; + this->unk1C_x -= local->unk0_x; + this->unk1C_y -= local->unk0_y; + this->unk1C_z -= local->unk0_z; + TUPLE_ASSIGN(sp60, this->unk28, 0.0f, 0.0f); + ml_vec3f_yaw_rotate_copy(sp60, sp60, this->yaw - 90.0); + local->unk0_x = sp60[0] + local->unk0_x; + local->unk0_y = sp60[1] + local->unk0_y; + local->unk0_z = sp60[2] + local->unk0_z; + this->position_x = local->unk0_x + this->position_x; + this->position_y = local->unk0_y + this->position_y; + this->position_z = local->unk0_z + this->position_z; + this->unk1C_x = local->unk0_x + this->unk1C_x; + this->unk1C_y = local->unk0_y + this->unk1C_y; + this->unk1C_z = local->unk0_z + this->unk1C_z; + }//L80388AD8 + if(func_803292E0(this)){ + this->yaw_moving = func_80329784(this); + }else{//L80388B04 + if(randf() < 0.01){ + func_80328CEC(this, (s32)this->yaw, 0x1e, 0x5A); + } + } + }else{ + //L80388B50 + this->yaw_moving = func_80329784(this); + } + + } + }//L80388B68 + func_80328FB0(this, 2.0f); + + if(local->unkC != 3 && actor_animationIsAt(this, 0.3f)) + FUNC_8030E8B4(SFX_3F2_UNKNOWN, 1.0f, 22000, this->position, 1000, 2000); + + if(local->unkC == 3 && actor_animationIsAt(this, 0.4f)){ + FUNC_8030E8B4(SFX_2_CLAW_SWIPE, 0.9f, 8000, this->position, 1000, 2000); + } + break; + case 3: //L80388BFC + if(actor_animationIsAt(this, (local->unkC == 2) ? 0.4 : 0.05)){ + sp54[0] = this->position_x; + sp54[1] = this->position_y; + sp54[2] = this->position_z; + if(local->unkC == 1) + sp54[1] += 150.0f; + this->unk138_24 = 0; + func_80387A80(partEmitList_pushNew(3), sp54, 3, (local->unkC == 1)? 0x4f0: 0x4f1); + }//L80388CC4 + + if(actor_animationIsAt(this, 0.75f)) + func_80326310(this); + break; + }//L80388CE0 +}//*/ diff --git a/src/SM/code_0.c b/src/SM/code_0.c new file mode 100644 index 00000000..9e0b419c --- /dev/null +++ b/src/SM/code_0.c @@ -0,0 +1,33 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80288F78(Actor*, f32, s32); + +typedef struct { + s16 unk0; + //u8 pad2[2]; + void (*unk4)(Actor *, s32); + s32 pad8; + s32 padC; +}Struct_SM_0; + +/* .code */ +void func_803863F0(Actor *this, s32 arg1) { + func_80288F78(this, 0.20f, 0xF280FA); +} + +void func_80386420(Actor *arg0, s32 arg1) { + func_80288F78(arg0, 0.20f, 0x3ED803E); + func_80288F78(arg0, 0.35f, 0x3ED8C3E); + func_80288F78(arg0, 0.71f, 0x21F336); + func_80288F78(arg0, 0.79f, 0x21F336); + func_80288F78(arg0, 0.80f, 0x3ED8C3E); + func_80288F78(arg0, 0.87f, 0x21F336); +} + +/* .data */ +Struct_SM_0 D_8038AAC0[2] = { + {0x20A, func_803863F0, 0, 0}, + {0x208, func_80386420, 0, 0}, +}; diff --git a/src/SM/code_2900.c b/src/SM/code_2900.c new file mode 100644 index 00000000..8e3f2836 --- /dev/null +++ b/src/SM/code_2900.c @@ -0,0 +1,17 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .code */ +void func_80388CF0(void){ + if(getGameMode() != GAME_MODE_7_ATTRACT_DEMO){ + func_8034DEB4(func_8034C528(0x1F2), 0.0f); + func_8034DEB4(func_8034C528(0x1F3), -5000.0f); + } +} + +void func_80388D48(void){ + if(*(u32*)PHYS_TO_K1(0x200) - PHYS_TO_K1(0xC290000)){ + func_80388CF0(); + } +} diff --git a/src/SM/code_2990.c b/src/SM/code_2990.c new file mode 100644 index 00000000..b8c65257 --- /dev/null +++ b/src/SM/code_2990.c @@ -0,0 +1,563 @@ +#include +#include "functions.h" +#include "variables.h" + +//external +Actor *func_802D94B4(ActorMarker*, Gfx**, Mtx**, Vtx**); +void func_8028E668(f32*, f32, f32, f32); +void func_80328FB0(Actor *, f32); +void func_8030DA44(u8); +void func_80324E88(f32); +void func_80328B8C(Actor *, s32, f32, s32); + +//static types +typedef struct sm_2900_struct{ + s16 unk0; //text_id + s16 unk2; //text_id + s8 unk4; + s8 unk5; //ability_id +}SM2900Struct; + +//public +void func_803899B0(Actor * this); +void func_80389610(Actor * this); + +/* .data */ +ActorAnimationInfo D_8038AF60[6] = { + {0, 0.0f}, + {ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f}, + {ASSET_13A_ANIM_BOTTLES_ENTER, 4.5f}, + {ASSET_13B_ANIM_BOTTLES_IDLE, 7.0f}, + {ASSET_139_ANIM_BOTTLES_EXIT, 1.7f}, + {ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f} +}; + +ActorInfo D_8038AF90 = { MARKER_B7_TUTORIAL_BOTTLES, ACTOR_12B_TUTORIAL_BOTTLES, ASSET_387_MODEL_BOTTLES, 1, D_8038AF60, //bottles + func_803899B0, func_80326224, func_802D94B4, + 0, 0, 0.0f, 0 +}; + +SM2900Struct D_8038AFB4[8] = { + {0xdf3, 0xe08, 1, -1}, + {0xdf4, 0xdf5, 3, ABILITY_3_CAMERA_CONTROL}, + {0xdfb, 0xdfe, 5, ABILITY_F_DIVE}, + { -1, 0xe00, 6, ABILITY_B_RATATAT_RAP}, + {0xe04, 0xe06, 8, ABILITY_0_BARGE}, + { -1, 0xdfa, 4, ABILITY_8_FLIP}, + {0xe01, 0xe03, 7, ABILITY_5_CLIMB}, + {0xe10, 0xe11, 0x11, -1}, +}; + +s32 D_8038AFE4 = 0; + + +/* .code */ +int func_80388D80(void){ + return ability_isUnlocked(ABILITY_F_DIVE) + || ability_isUnlocked(ABILITY_4_BEAR_PUNCH) + || ability_isUnlocked(ABILITY_C_ROLL) + || ability_isUnlocked(ABILITY_B_RATATAT_RAP) + || ability_isUnlocked(ABILITY_0_BARGE) + || ability_isUnlocked(ABILITY_A_HOLD_A_JUMP_HIGHER) + || ability_isUnlocked(ABILITY_7_FLAP) + || ability_isUnlocked(ABILITY_8_FLIP) + || ability_isUnlocked(ABILITY_5_CLIMB); +} + +void func_80388E48(void){ + ability_unlock(ABILITY_3_CAMERA_CONTROL); + ability_setHasUsed(ABILITY_0_BARGE); + ability_setHasUsed(ABILITY_1_BEAK_BOMB); + ability_setHasUsed(ABILITY_2_BEAK_BUSTER); + ability_setHasUsed(ABILITY_3_CAMERA_CONTROL); + ability_setHasUsed(ABILITY_4_BEAR_PUNCH); + ability_setHasUsed(ABILITY_5_CLIMB); + ability_setHasUsed(ABILITY_B_RATATAT_RAP); + ability_setHasUsed(ABILITY_C_ROLL); + ability_setHasUsed(ABILITY_A_HOLD_A_JUMP_HIGHER); +} + +void func_80388EB0(void){ + ability_unlock(ABILITY_F_DIVE); + ability_unlock(ABILITY_4_BEAR_PUNCH); + ability_unlock(ABILITY_C_ROLL); + ability_unlock(ABILITY_B_RATATAT_RAP); + ability_unlock(ABILITY_0_BARGE); + ability_unlock(ABILITY_A_HOLD_A_JUMP_HIGHER); + ability_unlock(ABILITY_7_FLAP); + ability_unlock(ABILITY_8_FLIP); + ability_unlock(ABILITY_5_CLIMB); + func_80388E48(); + mapSpecificFlags_set(3,1); +} + +void func_80388F24(Actor *this){ + if(this->unkF4_8 == 1 && !mapSpecificFlags_get(1)){ + timed_setCameraToNode(0.0f, 0x12); + } + else{ //L80388F68 + timed_setCameraToNode(0.0f, D_8038AFB4[this->unkF4_8 -1].unk4); + } +} + +void func_80388FA0(Actor *this, s32 arg1){ + Actor *other; + ActorMarker *myOther; + + switch(this->state){ + case 1://L80388FE8 + this->unk138_23 = 1; + break; + case 4://L80388FF8 + this->unk138_23 = 0; + case 2://L80389004 + func_8030DA44(this->unk44_31); + this->unk44_31 = 0; + break; + case 5://L80389018 + this->unk138_23 = 0; + func_8028F918(0); + + break; + }//L8038902C + + switch(arg1){ + case 4: + other = func_80329980(this); + myOther = this->unk100; + if(myOther && other && myOther->unk14_20 == 0xB8) + func_80328B8C(other, 3, 0.0001f, 1); + actor_playAnimationOnce(this); + this->unk44_31 = func_8030D90C(); + sfxsource_setSfxId(this->unk44_31, 0x3f9); + func_8030DD14(this->unk44_31, 2); + func_8030DBB4(this->unk44_31, 1.4f); + sfxsource_setSampleRate(this->unk44_31, 0x6590); + func_8028F918(0); + break; + case 1: + animctrl_setSmoothTransition(this->animctrl, 0); + break; + case 5: + func_80388F24(this); + func_8028F94C(2,this->position); + func_80389610(this); + break; + case 3: + actor_loopAnimation(this); + break; + case 2: + other = func_80329980(this); + myOther = this->unk100; + if(myOther && other && myOther->unk14_20 == 0xB8) + func_80328B8C(other, 2, 0.0001f, 1); + animctrl_setSmoothTransition(this->animctrl, 1); + actor_playAnimationOnce(this); + this->unk44_31 = func_8030D90C(); + sfxsource_setSfxId(this->unk44_31, 0x3f9); + func_8030DD14(this->unk44_31, 2); + func_8030DBB4(this->unk44_31, 1.4f); + sfxsource_setSampleRate(this->unk44_31, 0x6590); + func_80388F24(this); + func_8028F94C(2, this->position); + break; + } + func_80328B8C(this, arg1, 0.0001f, 1); +} + +void func_80389214(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *actor = marker_getActor(marker); + switch(arg2){ + case 3: + timed_setCameraToNode(0.0f, 2); + break; + case 4: + mapSpecificFlags_set(4,1); + break; + case 5: + timed_setCameraToNode(0.0f, 0x12); + break; + case 6: + func_8025A70C(COMUSIC_2B_DING_B); + break; + case 0xff: + func_80388F24(actor); + break; + } +} + +void func_803892C8(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *actor; + + actor = marker_getActor(marker); + if(!mapSpecificFlags_get(3) && func_802DA498()){ + mapSpecificFlags_set(3, 1); + func_80311480(0xe12, 0xe, actor->position, actor->marker, func_803892C8, NULL); + }//L8038933C + else{ + if( !(text_id == 0xdf3 || text_id == 0xe1f || text_id == 0xe1d) ){ + func_80324E88(0.0f); + } + switch(text_id){ + case 0xd38: + break; + case 0xdf3:/* 2FB8 803893A8 3C188039 */ + func_80311480(0xe1f, 0x8e, actor->position, actor->marker, func_803892C8, func_80389214); + break; + + case 0xe1f:/* 2FEC 803893DC 9209003B */ + actor->unk38_0 = 1; + break; + + case 0xe1d:/* 2FFC 803893EC 920B0138 */ + actor->unk138_24 = 0; + actor->unk60 = 0.0f; + break; + + case 0xdf6: /* 3014 80389404 0C0A3E46 */ + case 0xdff: /* 3014 80389404 0C0A3E46 */ + func_8028F918(0); + break; + + case 0xe09: + case 0xe12: + func_80388FA0(actor,4); + break; + + default: + if(actor->state !=5 ) + func_80311480(0xd38, 4, NULL, NULL, NULL, NULL); + + func_80388FA0(actor, actor->state == 5 ? 1:4); + break; + } + } +} + +void func_80389494(Actor * this, s32* arg1, s32 *arg2){ + if(ability_isUnlocked(D_8038AFB4[this->unkF4_8 -1].unk5)){ + if(func_8031FF1C(0xDB)){ + *arg1 = D_8038AFE4 + 0xE0A; //dialog index + D_8038AFE4++; + D_8038AFE4 = MIN(D_8038AFE4, 5); + if(*arg1 != 0xE0E){ + *arg2 |= 1; + } + }else{//L8038956C + *arg2 |= 1; + *arg1 = D_8038AFB4[this->unkF4_8 -1].unk2; + if(*arg1 == 0xdfe && !ability_hasUsed(ABILITY_3_CAMERA_CONTROL)){ + *arg1 = 0xdfd; + } + } + }else{//L803895C0 + *arg1 = D_8038AFB4[this->unkF4_8 -1].unk0; + ability_unlock(D_8038AFB4[this->unkF4_8 -1].unk5); + } +} + +void func_80389610(Actor * this){ + s32 sp2C; + s32 sp28; + + sp28 = 0xe; + sp2C = 0; + + switch(this->unkF4_8){ + case 1://L8038965C + if(mapSpecificFlags_get(1)){ + sp28 |= 1; + if(func_8031FF1C(0xDB)){ + sp2C = D_8038AFE4 + 0xE0A; //dialog index + D_8038AFE4++; + D_8038AFE4 = MIN(D_8038AFE4, 5); + }else{//L803896C0 + sp2C = D_8038AFB4[this->unkF4_8 -1].unk2; + } + } + else{//L803896E8 + sp2C = D_8038AFB4[this->unkF4_8 -1].unk0; + mapSpecificFlags_set(1,1); + } + break; + case 8://L80389720 + if(mapSpecificFlags_get(3)){ + if(func_8031FF1C(BKPROG_A6_FURNACE_FUN_COMPLETE)){ + sp2C = 0xe37; + sp28 |= 1; + }else{//L80389758 + if(mapSpecificFlags_get(0xf)){ + sp2C = 0xe0f; + sp28 |= 1; + }else{//L80389780 + func_80388E48(); + sp2C = func_8031FF1C(0xdb) ? 0xe1e : 0xe13; + mapSpecificFlags_set(0xf, 1); + } + } //L803897B4 + mapSpecificFlags_set(2, 1); + } + else{//L803897C8 + if(mapSpecificFlags_get(2)){ + sp2C = D_8038AFB4[this->unkF4_8 -1].unk2; + sp28 |= 1; + } + else{ + sp2C = D_8038AFB4[this->unkF4_8 -1].unk0; + mapSpecificFlags_set(2, 1); + } + + } + break; + + case 4://L80389848 + if( !ability_isUnlocked(ABILITY_4_BEAR_PUNCH) + || !ability_isUnlocked(ABILITY_C_ROLL) + || !ability_isUnlocked(ABILITY_B_RATATAT_RAP) + ){//L803898D4 + mapSpecificFlags_set(4, 1); + } + else{//L803898E4 + func_80389494(this, &sp2C, &sp28); + } + break; + + case 6://L803898A0 + if( !ability_isUnlocked(ABILITY_A_HOLD_A_JUMP_HIGHER) + || !ability_isUnlocked(ABILITY_7_FLAP) + || !ability_isUnlocked(ABILITY_8_FLIP) + ){//L803898D4 + mapSpecificFlags_set(0xE, 1); + } + else{//L803898E4 + func_80389494(this, &sp2C, &sp28); + } + break; + default://L803898F8 + func_80389494(this, &sp2C, &sp28); + break; + }//L80389904 + if(sp2C){ + func_80311480(sp2C, sp28, this->position, this->marker, func_803892C8, func_80389214); + } +} + +void func_80389948(ActorMarker * marker){ + Actor *actor; + Actor *other; + s32 pad; + + actor = marker_getActor(marker); + other = spawn_child_actor(0x12c, &actor); + actor->unk100 = other->marker; + + if(marker); +} + +void func_80389984(Actor * this){ + u8 tmp; + + tmp = this->unk44_31; + if(tmp) + func_8030DA44(tmp); +} + +void func_803899B0(Actor * this){ + s32 sp50[6]; //face buttons + f32 sp44[3]; //player position + void *sp40; + int sp34; + int sp38; + + if(this->unkF4_8 >= 9) + return; + + if(!this->initialized){ + this->marker->propPtr->unk8_3 = 0; + actor_collisionOff(this); + this->initialized = 1; + func_803300D8(this->marker, func_80389984); + if(this->unkF4_8 == 1 || this->unkF4_8 == 8){//L80389A30 + sp40 = func_80304C38(0x349, this); + if(!sp40){ + this->unk1C_x = this->position_x; + this->unk1C_y = this->position_y; + this->unk1C_z = this->position_z; + this->unk28 = 300.0f; + } else{ //L80389A68 + nodeprop_getPosition(sp40, this->unk1C); + this->unk28 = nodeprop_getRadius(sp40); + }//L80389A8C + if(this->unkF4_8 == 1){ + if(func_803203FC(1) || func_803203FC(0x1F)){ + func_80388FA0(this, 3); + } + } + }//L80389AC8 + if(func_80388D80()){ + mapSpecificFlags_set(1,1); + + if(func_802DA498()){ + mapSpecificFlags_set(3, 1); + mapSpecificFlags_set(2, 1); + mapSpecificFlags_set(0xC, 1); + mapSpecificFlags_set(0xF, 1); + } + } + }//L80389B20 + + if(!this->unk16C_4){ + func_802C3C88((GenMethod_1)func_80389948, reinterpret_cast(s32, this->marker)); + this->unk16C_4 = 1; + }//L80389B4C + + if(this->unk138_23){ + func_8028E668(this->position, 180.0f, -40.0f, 120.0f); + }//L80389B64 + + func_8024E55C(0,sp50); //get face buttons press counters + player_getPosition(sp44); + switch (this->state) + { + case 1://L80389BAC + this->yaw_moving = (f32)func_80329784(this); + func_80328FB0(this, 4.0f); + if( (this->unkF4_8 == 1 && !mapSpecificFlags_get(1)) + || (this->unkF4_8 == 8 && !mapSpecificFlags_get(2)) + || (this->unkF4_8 == 8 && mapSpecificFlags_get(3) && !mapSpecificFlags_get(0xF)) + ){//L80389C50 + + if( ((ml_vec3f_distance(sp44, this->unk1C) < this->unk28) && func_8028F20C()) + || mapSpecificFlags_get(0x10) + ){//L80389C8C + if(func_80329530(this, 0x96)) + func_8028F45C(9, this->position); + //L80389CA4 + func_80388FA0(this, 2); + } + } + else{//L80389CBC + if( !func_80329530(this, 0xfa) + || func_8028ECAC() + || !func_8028F20C() + || func_8028EC04() + ) break; + + sp34 = !((!(D_8038AFB4[this->unkF4_8-1].unk5 + 1)) || (!ability_isUnlocked( D_8038AFB4[this->unkF4_8-1].unk5))); + if( (!sp34 && this->unkF4_8 != 1) + || func_8031FF1C(0xDB) == 0 + || D_8038AFE4 < 6 + ){ + if(this->unkF4_8 != 8 || !func_8031FF1C(0xFC)){ + if( func_8028EFC8() + && sp50[1] == 1 + ){ + if(sp34 || this->unkF4_8 == 1 || this->unkF4_8 == 8){ + func_80388FA0(this, 5); + } + else{ + if(func_80329530(this, 0x96) && !sp34){ + func_8028F45C(9, this->position); + } + func_80388FA0(this, 2); + } + } + } + } + } + break; + case 2://L80389E2C + this->yaw_moving = func_80329784(this); + func_80328FB0(this, 4.0f); + if( (f64) 0.0 < animctrl_getAnimTimer(this->animctrl) + && animctrl_getAnimTimer(this->animctrl) < 0.16 + ){ + func_8030E2C4(this->unk44_31); + }//L80389EA0 + if(actor_animationIsAt(this, 0.9999f)){ + if(!mapSpecificFlags_get(1)){ + func_80389610(this); + } + func_80388FA0(this, 3); + }//L80389EE0 + else if(actor_animationIsAt(this, 0.14f)){ + FUNC_8030E8B4(SFX_C6_SHAKING_MOUTH, 1.2f, 24000, this->position, 1250, 2500); + }else if(actor_animationIsAt(this, 0.4f)){ //L80389F14 + FUNC_8030E8B4(SFX_2C_PULLING_NOISE, 1.2f, 24000, this->position, 1250, 2500); + }else if(actor_animationIsAt(this, 0.75f)){//L80389F48 + FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 1250, 2500); + + }else if(actor_animationIsAt(this, 0.35f)){//L80389F78 + if(mapSpecificFlags_get(1)){ + func_80389610(this); + } + } + break; + case 3://L80389FAC + this->yaw_moving = func_80329784(this); + func_80328FB0(this, 4.0f); + if( ( actor_animationIsAt(this, 0.37f) + || actor_animationIsAt(this, 0.66f) + || actor_animationIsAt(this, 0.85f) + ) + && randf() < 0.2 + ){ + animctrl_setDirection(this->animctrl, animctrl_isPlayedForwards(this->animctrl)^1); + }//L8038A088 + else if( actor_animationIsAt(this, 0.25f) + || actor_animationIsAt(this, 0.28f) + || actor_animationIsAt(this, 0.31f) + ){ + func_8030E878(SFX_6F_BANJO_HEADSCRATCH, randf2(1.4f, 1.55f), 16000, this->position, 1250.0f, 2500.0f); + } //L8038A0D8 + else if( actor_animationIsAt(this, 0.45f) + || actor_animationIsAt(this, 0.48f) + || actor_animationIsAt(this, 0.51f) + || actor_animationIsAt(this, 0.7f) + || actor_animationIsAt(this, 0.73f) + || actor_animationIsAt(this, 0.76f) + ){ + func_8030E878(SFX_6F_BANJO_HEADSCRATCH, randf2(1.35f, 1.5f), 6000, this->position, 1250.0f, 2500.0f); + }//L8038A194 + + if(mapSpecificFlags_get(5)){ + mapSpecificFlags_set(5,0); + func_80388FA0(this, 4); + }//L8038A1B8 + sp38 = -1; + if(this->unk38_0){ + this->unk60 += time_getDelta(); + if(func_803114C4() != 0xe1d){ + if(sp50[0] == 1) + sp38 = 1; //A button pressed + else if(sp50[1] == 1) + sp38 = 0; //B button pressed + }//L8038A218 + + if( sp38 != -1){ //button was pressed + func_80320004(0xdb, (sp38)?0:1); + func_80311480((sp38)? 0xe07 : 0xe09, 0xe, this->position, this->marker, func_803892C8, func_80389214); + if(!sp38){ + func_80388EB0(); //give all SM moves + } + this->unk38_0 = 0; + }else if(!this->unk138_24 && 5.0 < this->unk60){ + func_80311480(0xe1d, 0x86, this->position, this->marker, func_803892C8, NULL); + this->unk138_24 = 1; + } + } + break; + case 4://L8038A31C + if( 0.35 < animctrl_getAnimTimer(this->animctrl) + && animctrl_getAnimTimer(this->animctrl) < 0.9 + ){ + func_8030E2C4(this->unk44_31); + }else{//L8038A378 + if(actor_animationIsAt(this, 0.9999f)){ + func_80388FA0(this, 1); + func_80386540(); + } + } + break; + }//L8038A3A0 +} diff --git a/src/SM/code_3FC0.c b/src/SM/code_3FC0.c new file mode 100644 index 00000000..f97e5174 --- /dev/null +++ b/src/SM/code_3FC0.c @@ -0,0 +1,64 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern f32 D_80365E04[3][3]; + +void func_8038A3B0(Actor *this); + +/* .data */ +ActorAnimationInfo D_8038AFF0[] = { + {0, 0.0f}, + {0x248, 1.816f}, + {0x248, 9e+09f}, +};//chBanjosBedAnimations + +ActorInfo D_8038B008 = { + 0xE1, 0x198, 0x530, + 2, D_8038AFF0, + func_8038A3B0, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +};//chBanjosBed + +ActorAnimationInfo D_8038B02C[] = { + {0, 0.0f}, + {0x247, 3.0f}, + {0x247, 9e+09f}, +};//chBanjosChairAnimations + +ActorInfo D_8038B044 ={ + 0xE2, 0x199, 0x52F, + 2, D_8038B02C, + func_8038A3B0, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +};//chBanjosChair + +ActorAnimationInfo D_8038B068[] = { + {0, 0.0f}, + {0x249, 1.0f}, + {0x249, 9e+09f}, +};//chBanjosStoveAnimations + +ActorInfo D_8038B080 ={ + 0xE3, 0x19A, 0x337, + 2, D_8038B068, + func_8038A3B0, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +};//chBanjosStove + + +/* .code */ +void func_8038A3B0(Actor *this){ + s32 sp24 = this->marker->unk14_20 - 0xe1; + + if(this->marker->unk14_21) + func_8034A174(this->marker->unk44, 0x1f, D_80365E04[sp24]); + + actor_collisionOff(this); + if(this->state == 2 && levelSpecificFlags_get(sp24 + 0x35)){ + func_80328A84(this, 1); + actor_playAnimationOnce(this); + } + +} diff --git a/src/SM/code_4070.c b/src/SM/code_4070.c new file mode 100644 index 00000000..9d5e9e08 --- /dev/null +++ b/src/SM/code_4070.c @@ -0,0 +1,145 @@ +#include +#include "functions.h" +#include "variables.h" + +//extern +Actor *func_802D94B4(ActorMarker *, Gfx **, Mtx **, Vtx**); +void func_8024E55C(s32, void *); +void func_80324E88(f32); + +//public +void func_8038A5D8(Actor *this); +void func_8038A4DC(Actor *this, s32 arg1); + +/* .data */ +ActorInfo D_8038B0B0 = { 0x1ED, 0x3B9, 0, 1, NULL, + func_8038A5D8, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; + + +/* .code */ +void func_8038A460(Actor *this){ + timed_setCameraToNode(0.0f,4); +} + +void func_8038A488(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *actor = marker_getActor(caller); + if(text_id == 0xdf9 || text_id == 0xe12){ + func_8038A4DC(actor, 3); + } + func_80324E88(0.0f); +} + +void func_8038A4DC(Actor *this, s32 arg1){ + switch(arg1){ + case 2://L8038A50C + this->sm_4070.unk0 = 0; + player_getPosition(this->velocity); + func_8028F918(0); + if(ability_isUnlocked(ABILITY_7_FLAP)){ + mapSpecificFlags_set(9,1); + }else if(ability_isUnlocked(ABILITY_A_HOLD_A_JUMP_HIGHER)){//L8038A540 + mapSpecificFlags_set(8,1); + }else{//L8038A560 + func_8038A460(this); + ability_unlock(ABILITY_A_HOLD_A_JUMP_HIGHER); + func_80311480(0xdf6, 0xe, this->unk1C, this->marker, func_8038A488, NULL); + this->sm_4070.unk0 = 0xe1a; + mapSpecificFlags_set(8, 0); + } + break; + case 3://L8038A5B0 + mapSpecificFlags_set(5, 1); + break; + }//L8038A5BC + func_80328A84(this, arg1); +} + +void func_8038A5D8(Actor *this){ + f32 sp5C[3]; + s32 sp44[6]; + f32 sp40; + Actor *temp_v0; + s32 temp_a0; + + if(!this->initialized){ + temp_v0 = func_80326D68(this->position, ACTOR_12B_TUTORIAL_BOTTLES, -1, &sp40); + if(temp_v0){ + this->unk1C_x = temp_v0->position_x; + this->unk1C_y = temp_v0->position_y; + this->unk1C_z = temp_v0->position_z; + } + else{//L8038A630 + this->unk1C_x = this->position_x; + this->unk1C_y = this->position_y; + this->unk1C_z = this->position_z; + }//L8038A644 + this->initialized = 1; + }//L8038A650 + + func_8024E55C(0, sp44); + switch (this->state) + { + case 1://L8038A688 + if(func_8031FF1C(0xdb)){ + marker_despawn(this->marker); + }else{ + if(mapSpecificFlags_get(0xe)){ + func_8038A4DC(this, 2); + } + } + break; + + case 2://L8038A6C8 + if(!func_803114B0()){ + if(mapSpecificFlags_get(8)){ + func_8038A460(this); + ability_unlock(ABILITY_7_FLAP); + func_80311480(0xdf7, 0xa, this->unk1C, this->marker, func_8038A488, NULL); + this->sm_4070.unk0 = 0xe1b; + mapSpecificFlags_set(8,0); + }//L8038A730 + + if(mapSpecificFlags_get(9)){ + func_8038A460(this); + ability_unlock(ABILITY_8_FLIP); + func_80311480(0xdf8, 0xa, this->unk1C, this->marker, func_8038A488, NULL); + this->sm_4070.unk0 = 0xe1c; + mapSpecificFlags_set(9,0); + }//L8038A794 + + if(mapSpecificFlags_get(0xa)){ + func_8038A460(this); + func_8028F94C(2, this->unk1C); + + if(!mapSpecificFlags_get(3) && func_802DA498()){ + mapSpecificFlags_set(3,1); + temp_a0 = 0xe12; + }else{ + temp_a0 = 0xdf9; + } + + func_80311480(temp_a0, 0xe, this->unk1C, this->marker, func_8038A488, NULL); + mapSpecificFlags_set(0xa,0); + this->sm_4070.unk0 = 0; + } + }//L8038A828 + player_getPosition(sp5C); + sp5C[0] = this->velocity_x; + sp5C[2] = this->velocity_z; + func_8028FAB0(sp5C); + if( func_8028EFC8() + && sp44[1] == 1 + && func_8028F20C() + ){ + if(this->sm_4070.unk0) + func_80311480(temp_a0 = this->sm_4070.unk0, 0, NULL, NULL, NULL, NULL); + } + break; + + case 3://L8038A8A0 + marker_despawn(this->marker); + break; + }//L8038A8AC +} diff --git a/src/SM/code_44D0.c b/src/SM/code_44D0.c new file mode 100644 index 00000000..87de1336 --- /dev/null +++ b/src/SM/code_44D0.c @@ -0,0 +1,57 @@ +#include +#include "functions.h" +#include "variables.h" + + +f32 func_8028E82C(void); +void func_8028F3D8(f32 *, f32, void(*)(ActorMarker *), ActorMarker *); + +// prototypes +void func_8038A8F8(Actor *this); + +/* .data */ +ActorInfo D_8038B0E0 = { 0x1F0, 0x3BD, 0, 0, NULL, + func_8038A8F8, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; + + +/* .code */ +void func_8038A8C0(ActorMarker *arg0){ + mapSpecificFlags_set(0x10, 0); + func_8028E6EC(2); + func_8028F918(0); +} + +void func_8038A8F8(Actor *this){ + f32 sp2C; + NodeProp *other; + + if(!this->unk16C_4){ + other = func_80304C38(0x3be, this); + if(!other){ + this->unk1C_x = this->position_x; + this->unk1C_y = this->position_y; + this->unk1C_z = this->position_z; + }else{ + nodeprop_getPosition(other, this->unk1C); + } + actor_collisionOff(this); + this->unk16C_4 = 1; + }//L8038A968 + player_getPosition(this->velocity); + sp2C = ml_vec3f_distance(this->velocity, this->position); + if(sp2C < (f32) this->unkF4_8) + func_80388D48(); + + if( !mapSpecificFlags_get(0x10) && sp2C < (f32) this->unkF4_8 && 1780.0f < func_8028E82C()){ + if( !mapSpecificFlags_get(2) + || (mapSpecificFlags_get(3) && !mapSpecificFlags_get(0xf)) + ){ //L8038AA54 + this->yaw_moving = ml_vec3f_distance(this->velocity, this->unk1C) / 150.0; + func_8028F3D8(this->unk1C, this->yaw_moving, func_8038A8C0, this->marker); + mapSpecificFlags_set(0x10, 1); + } + } +} + diff --git a/src/SM/code_46C0.c b/src/SM/code_46C0.c new file mode 100644 index 00000000..d00ade88 --- /dev/null +++ b/src/SM/code_46C0.c @@ -0,0 +1,64 @@ +#include +#include "functions.h" +#include "variables.h" + +#define US_1_0 0 +#define PAL 1 + +u8 D_8038BFC2; + + +#if VERSION == US_1_0 +int func_8038AAB0(void){return 0;} + +#elif VERSION == PAL +void func_8038AAB0(s32 arg0, s32 arg1){ + if(arg1 < 0){ + func_8031A844(); + } + else{ + D_8038BFC2 = arg1; + func_8038B4D0(3); + } +} + +// #pragma GLOBAL_ASM("asm/nonmatchings/SM/code_46C0/func_8038A8F0.s") +void func_8038A8F0(s32 arg0) { + u8 temp_v0; + + switch (arg0) { /* irregular */ + case 1: + D_8038BFC1 = 1; + func_80319400(); + break; + case 2: + D_8038BFC8->unk0 = (s32) D_8038BD38; + D_8038BFC8->unk4 = (s32) D_8038BD3C; + D_8038BFC8->unk10 = (s32) D_8038BD40; + D_8038BFC8->unk20 = (s32) D_8038BD44; + D_8038BFC8->unk30 = (s32) D_8038BD48; + func_8031A5E4(&D_8038BD30, &D_8038BD34, (void *)0x8038BFC8, 0xA, &D_8038B490); + break; + case 3: + temp_v0 = *(u8 *)0x8038BFC2; + if (temp_v0 != 0) { + func_8031B9A4(temp_v0 - 1, 0x80390000); + } + func_802FAF44(0); + D_8038BFC1 = 0; + break; + } + D_8038BFC0 = (s8) arg0; +} + + +// #pragma GLOBAL_ASM("asm/nonmatchings/SM/code_46C0/func_8038A9E4.s") + +// #pragma GLOBAL_ASM("asm/nonmatchings/SM/code_46C0/func_8038AA30.s") + +// #pragma GLOBAL_ASM("asm/nonmatchings/SM/code_46C0/func_8038AA64.s") + +// #pragma GLOBAL_ASM("asm/nonmatchings/SM/code_46C0/func_8038AA74.s") + +// #pragma GLOBAL_ASM("asm/nonmatchings/SM/code_46C0/func_8038AAE8.s") +#endif diff --git a/src/SM/code_46C0.us.v10.c b/src/SM/code_46C0.us.v10.c new file mode 100644 index 00000000..41513f9d --- /dev/null +++ b/src/SM/code_46C0.us.v10.c @@ -0,0 +1,5 @@ +#include +#include "functions.h" +#include "variables.h" + +int func_8038AAB0(void){return 0;} diff --git a/src/SM/code_5B0.c b/src/SM/code_5B0.c new file mode 100644 index 00000000..a5cea74a --- /dev/null +++ b/src/SM/code_5B0.c @@ -0,0 +1,151 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + +void func_803869A0(Actor*, f32, f32); +void func_802C4218(s32, f32, f32, f32); +void func_80386EF4(Actor *this); +void func_80386A00(Actor *this); + +/*.data */ +ActorAnimationInfo D_8038AAF0[] = { + {0, 0.f}, + {0x2B9, 5.0f} +}; + +ActorInfo D_8038AB00 = { + 0x135, 0x16F, 0x42D, + 1, NULL, + func_80386EF4, func_80326224, func_80325E78, + 2000, 0, 5.0f, 0 +}; + +ActorInfo D_8038AB24 = { + 0x29D, 0x3CA, 0x47B, + 1, D_8038AAF0, + func_80386A00, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +struct43s D_8038AB48 = { + {{-200.0f, 600.0f, -200.0f}, {200.0f, 800.0f, 200.0f}}, + {{0.0f, -1800.0f, 0.0f}, {0.0f, -1800.0f, 0.0f}}, + {{-100.0f, -100.0f, -100.0f}, {100.0f, 100.0f, 100.0f}} +}; + +s32 D_8038AB90[3] = {0xFF, 0xFF, 0xFF}; + +struct43s D_8038AB9C = { + {{-100.0f, -100.0f, -100.0f}, {100.0f, 100.0f, 100.0f}}, + {{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}}, + {{-100.0f, -100.0f, -100.0f}, {100.0f, 100.0f, 100.0f}} +}; + +/* .code */ +void func_803869A0(Actor *this, f32 arg1, f32 arg2) { + if (actor_animationIsAt(this, arg1)) { + func_8030E878(SFX_98_DEAF_THUD, arg2, 32000, this->position, 2000.0f, 4000.0f); + } +} + +void func_80386A00(Actor *this) { + if (this->unk16C_4 <= 0) { + if (func_8031FF1C(BKPROG_FC_DEFEAT_GRUNTY) == 0) { + marker_despawn(this->marker); + return; + } + actor_collisionOff(this); + if(0); + this->marker->propPtr->unk8_3 = 1; + this->unk16C_4 = 1; + } + func_803869A0(this, 0.20f, 1.00f); + func_803869A0(this, 0.27f, 1.05f); + func_803869A0(this, 0.50f, 0.95f); + func_803869A0(this, 0.65f, 1.05f); + func_803869A0(this, 0.90f, 1.00f); + func_803869A0(this, 0.95f, 0.95f); +} + +void func_80386B04(ParticleEmitter *p_ctrl, f32 *arg1, s32 arg2, f32 arg3) { + func_802EF9F8(p_ctrl, 0.6f); + func_802EFA18(p_ctrl, 4); + func_802EFA5C(p_ctrl, 0.00f, 0.75f); + particleEmitter_setModel(p_ctrl, 0x42E); + particleEmitter_setPosition(p_ctrl, arg1); + func_802EFA70(p_ctrl, 2); + func_802EFB70(p_ctrl, arg3, arg3); + func_802EFB84(p_ctrl, arg3, arg3); + func_802EFE24(p_ctrl, -100.0f, -100.0f, -100.0f, 100.0f, 100.0f, 100.0f); + particleEmitter_setSpawnIntervalRange(p_ctrl, 0.00f, 0.01f); + func_802EFEC0(p_ctrl, 2.0f, 2.0f); + particleEmitter_setPositionVelocityAndAccelerationRanges(p_ctrl, &D_8038AB48); + particleEmitter_emitN(p_ctrl, arg2); +} + +void func_80386C2C(ParticleEmitter *p_ctrl, f32 *arg1, s32 arg2, f32 arg3) { + func_802EFFA8(p_ctrl, D_8038AB90); + particleEmitter_setSprite(p_ctrl, ASSET_700_SPRITE_DUST); + func_802EFA5C(p_ctrl, 0.00f, 0.01f); + particleEmitter_setStartingFrameRange(p_ctrl, 0, 7); + particleEmitter_setPosition(p_ctrl, arg1); + func_802EFB70(p_ctrl, (arg3 * 0.1), (arg3 * 0.5)); + func_802EFB84(p_ctrl, (arg3 * 1.5), (arg3 * 3.0)); + particleEmitter_setSpawnIntervalRange(p_ctrl, 0.0f, 0.01f); + func_802EFEC0(p_ctrl, 1.5f, 2.0f); + particleEmitter_setPositionVelocityAndAccelerationRanges(p_ctrl, &D_8038AB9C); + particleEmitter_emitN(p_ctrl, arg2); +} + +void func_80386D68(Actor *this){ + FUNC_8030E8B4(SFX_9B_BOULDER_BREAKING_1, 1.0f, 32000, this->position, 1000, 2000); + + this->unk44_31 = func_8030D90C(); + sfxsource_setSfxId(this->unk44_31, 0x3F9); + func_8030DD14(this->unk44_31, 3); + sfxsource_setSampleRate(this->unk44_31, 32000); + func_8030DBB4(this->unk44_31, (0.01 < (2.0 - this->scale))? (2.0 - this->scale): 0.01); + func_8030E2C4(this->unk44_31); + func_80386B04(partEmitList_pushNew(0xA), this->position, 0xA, this->scale); + func_80386C2C(partEmitList_pushNew(0x10), this->position, 0x10, this->scale); + + if(this->unk100 && func_803870E8(this->unk100)){ + func_802CA1CC(HONEYCOMB_18_SM_QUARRIES); + func_802C3F04((GenMethod_4)func_802C4218, 0x1F, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); + } + marker_despawn(this->marker); +} + +void func_80386EB4(ActorMarker *marker, ActorMarker *other_marker) { + Actor *this; + this = marker_getActor(marker); + if ((this->state ) == 2) { + func_80386D68(this); + } +} + +void func_80386EF4(Actor *this) { + u32 temp_t3; + Actor *other; + if ((this->unk16C_4) <= 0) { + this->marker->propPtr->unk8_3 = 1; + marker_setCollisionScripts(this->marker, 0, 0, func_80386EB4); + this->unk38_31 = 0; + this->unk138_31 = 1; + this->unk16C_4 = 1; + } + if ((this->state) == 1) { + temp_t3 = this->unk38_31++ ^ 2; + if ((temp_t3) == 0) { + other = func_80326EEC(0x16E); + if (other != NULL) { + this->unk100 = other->marker; + } else { + this->unk100 = NULL; + } + func_80328A84(this, 2); + } + } +} diff --git a/src/SM/code_BF0.c b/src/SM/code_BF0.c new file mode 100644 index 00000000..6d9a75f2 --- /dev/null +++ b/src/SM/code_BF0.c @@ -0,0 +1,43 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80386FE0(Actor *this); + +/* .data */ +ActorInfo D_8038ABF0 = { + 0x134, 0x16E, 0, + 1, NULL, + func_80386FE0, func_80326224, func_80325340, + 2000, 0, 0.0f, 0 +}; + +/* .code */ +void func_80386FE0(Actor *this){ + if(!this->unk16C_4){ + this->unk10_12 = 0; + this->unk38_31 = this->unk10_12; + this->unk16C_4 = 1; + actor_collisionOff(this); + } + + switch(this->state){ + case 1://L80387064 + if(this->unk38_31++ == 2){ + this->unk10_12 = func_80326F58(0x16f); + func_80328A84(this, 2); + } + break; + case 2://L803870C4 + if(this->unk10_12 == 0) + marker_despawn(this->marker); + break; + }//L803870DC +} + +int func_803870E8(ActorMarker * arg0){ + Actor *actor = marker_getActor(arg0); + + return (--actor->unk10_12)==0 ? 1 : 0; + +} diff --git a/src/SM/code_F0.c b/src/SM/code_F0.c new file mode 100644 index 00000000..3a1d0823 --- /dev/null +++ b/src/SM/code_F0.c @@ -0,0 +1,161 @@ +#include +#include "functions.h" +#include "variables.h" +#include "prop.h" + +int ability_hasLearned(s32); + +extern s32 D_80275650; + + +extern ActorInfo D_8038AB00; +extern ActorInfo D_8038ABF0; +extern ActorInfo D_8038AC20; //chAttackTutorial +extern ActorInfo D_8038AC78; //chCarrot Slave? +extern ActorInfo D_8038ACE8; //ch onion A +extern ActorInfo D_8038AD58; //ch cauliflower A +extern ActorInfo D_8038AC9C; //chCarrot FreeRange? +extern ActorInfo D_8038AD0C; //ch onion B +extern ActorInfo D_8038AD7C; //ch cauliflower B +extern ActorInfo D_8038AF90; //D_8038AF90 bottles +extern ActorInfo D_8038B0B0; //chJumpTutorial code_4070 +extern ActorInfo D_8038B0E0; +extern ActorInfo D_8038B008; //chBanjosBed +extern ActorInfo D_8038B044; //chBanjosChair +extern ActorInfo D_8038B080; //chBanjosStove +extern ActorInfo D_8038AB24; + +extern u32 D_803FFE00; +extern u32 D_803FFE04; +extern u32 D_803FFE08; +extern u32 D_803FFE0C; + +/* .data */ +s32 D_8038AAE0 = 0x000FE2C1; //compiled SM_code_crc_1 +s32 D_8038AAE4 = 0x8C0992D1; //compiled SM_code_crc_2 +union { + u8 byte[4]; + s32 word; +} D_8038AAE8 = {0x00, 0x01, 0xEB, 0x56}; //compiled SM_data_crc_1 (with this zeroed out) +s32 D_8038AAEC = 0; + +/* .bss */ +struct { + s32 unk0; //calculated SM_code_crc1 + s32 unk4; //calculated SM_code_crc2 + s32 unk8; //calculated SM_data_crc1 + s32 unkC; //calculated SM_data_crc2 +} D_8038B320; + + +/* .code */ +//dynamically gets learned ability bitfield address +u32 *func_803864E0(void){ + s16 *addr; + addr = (s16*)ability_hasLearned; + return (u32 *)((addr[1] << 0x10) + addr[3]); +} + +void func_803864FC(enum ability_e arg0){ + u32 *addr; + if(getGameMode() != GAME_MODE_7_ATTRACT_DEMO){ + addr = func_803864E0(); + *addr = 1 << arg0; + } +} + +void func_80386540(void){ + u32 *sp2C; + s32 sp28; + u32 *addr; + u32 sp20; + sp2C = func_803864E0(); + sp28 = *sp2C; + *sp2C = 0; + if(ability_hasLearned(ABILITY_1_BEAK_BOMB)){ + addr = (u32*)ability_hasLearned; + addr[2] = 0x03E00008; //jr $ra + addr[3] = 0x00001025; //or $v0, $zero, $zero + osWritebackDCache(addr, 0x10); + osInvalICache(addr, 0x10); + } + + *sp2C = sp28; + osPiReadIo(0x574, &sp20); + if((sp20 = (sp20 & 0xffff)) != 0x6c07) + func_803864FC(ABILITY_A_HOLD_A_JUMP_HIGHER); + + if(!SM_CRCs_are_valid()) + func_803864FC(ABILITY_10_TALON_TROT); + + + if(!func_803866CC()) + func_803864FC(ABILITY_C_ROLL); +} + +void func_80386614(u8 *arg0, u8 *arg1, s32 *arg2, s32 *arg3){ + s32 temp_v0 = 0; + s32 temp_v1 = -1; + s32 i; + s32 val; + u8* iPtr; + + iPtr = arg0; + + for(i = (arg1 - arg0); i > 0 ; i--){ + val = *(iPtr++); + temp_v0 += val; + temp_v1 ^= val << (temp_v0 & 0x17); + } + + if(arg1); //make $a1 not used in loop + + *arg2 = temp_v0; + *arg3 = temp_v1; +} + +extern s32 D_00005E70; + +int func_803866CC(void){ + u32 sp24; + + if( (osPiReadIo((u32)&D_00005E70 + 8, &sp24), sp24 == D_803FFE00) + && (osPiReadIo((u32)&D_00005E70 + 12, &sp24), sp24 == D_803FFE04) + && (osPiReadIo((u32)&D_00005E70 + 16, &sp24), sp24 == D_803FFE08) + && (osPiReadIo((u32)&D_00005E70 + 20, &sp24), sp24 == D_803FFE0C) + ){ + return 1; + } + return 0; +} + +bool SM_CRCs_are_valid(void){ + if( D_8038B320.unk0 == D_8038AAE0 + && D_8038B320.unk4 == D_8038AAE4 + && D_8038B320.unkC == D_80275650 + && D_8038B320.unk8 == D_8038AAE8.word + D_8038AAE8.byte[0] + D_8038AAE8.byte[1] + D_8038AAE8.byte[2] + D_8038AAE8.byte[3] + ){ + return TRUE; + } + return FALSE; +} + +void func_80386810(void) +{ + spawnableActorList_add(&D_8038AB00, actor_new, 0X2000180); + spawnableActorList_add(&D_8038ABF0, actor_new, 0X80); + spawnableActorList_add(&D_8038AC20, actor_new, 0); + spawnableActorList_add(&D_8038AC78, actor_new, 0X2000121); + spawnableActorList_add(&D_8038ACE8, actor_new, 0X2000121); + spawnableActorList_add(&D_8038AD58, actor_new, 0X2200121); + spawnableActorList_add(&D_8038AC9C, actor_new, 0X2000121); + spawnableActorList_add(&D_8038AD0C, actor_new, 0X2000121); + spawnableActorList_add(&D_8038AD7C, actor_new, 0X2200121); + spawnableActorList_add(&D_8038AF90, actor_new, 0X100); + spawnableActorList_add(&D_8038B0B0, actor_new, 0); + spawnableActorList_add(&D_8038B0E0, actor_new, 0); + spawnableActorList_add(&D_8038B008, actor_new, 0X6C8); + spawnableActorList_add(&D_8038B044, actor_new, 0X6C8); + spawnableActorList_add(&D_8038B080, actor_new, 0X6C8); + spawnableActorList_add(&D_8038AB24, actor_new, 0X400); +} diff --git a/src/TTC/ch/lockup.c b/src/TTC/ch/lockup.c new file mode 100644 index 00000000..979ea614 --- /dev/null +++ b/src/TTC/ch/lockup.c @@ -0,0 +1,153 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802EE6CC(f32[3], s32[4], s32[4], s32, f32, f32, s32, s32, s32); + +typedef struct { + s32 unk0; + s32 unk4; +}ActorLocal_Lockup; + +Actor *func_803894C0(ActorMarker *this, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80389600(Actor *this); + +/* .data */ +ActorAnimationInfo D_8038C760[] ={ + {0, 0.0f}, + {0xBC, 8000000.0f}, + {0xBC, 4.0f}, + {0xBC, 8000000.0f}, + {0xBC, 1.4f}, + {0xBC, 8000000.0f} +}; + +ActorInfo D_8038C790 = { + 0xA4, 0x151, 0x3D4, + 1, D_8038C760, + func_80389600, func_80326224, func_803894C0, + 2500, 0x366, 0.0f, 0 +}; + +ActorInfo D_8038C7B4 = { + 0xF6, 0x152, 0x3D4, + 1, D_8038C760, + func_80389600, func_80326224, func_803894C0, + 2500, 0x366, 0.0f, 0 +}; + +ActorInfo D_8038C7D8 = { + 0xF7, 0x153, 0x3D4, + 1, D_8038C760, + func_80389600, func_80326224, func_803894C0, + 2500, 0x366, 0.0f, 0 +}; + +s32 D_8038C7FC[4] = {120, 120, 120, 120}; +s32 D_8038C80C[4] = {0,0,0,0}; + +/* .code */ +Actor *func_803894C0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor * actor = marker_getActor(marker); + func_8033A45C(3, actor->unk38_31); + func_8033A45C(4, actor->unk38_31); + func_80325888(marker, gfx, mtx, vtx); + +} + +void func_80389530(Actor *this){ + func_80328B8C(this, 1, 0.2f, 1); + this->marker->collidable = FALSE; + this->unk38_31 = 0; + FUNC_8030E8B4(SFX_6C_LOCKUP_CLOSING, 1.0f, 32000, this->position, 1250, 2500); + +} + +void func_8038959C(Actor *this){ + func_80389468(); + func_80328B8C(this, 2, 0.2f, 1); + this->unk38_31 = 1; + FUNC_8030E8B4(SFX_6B_LOCKUP_OPENING, 1.0f, 32000, this->position, 1250, 2500); +} + +void func_80389600(Actor *this){ + ActorLocal_Lockup *local = (ActorLocal_Lockup *)&this->local; + s32 tmp_v1; + int i; + + if( !this->unk138_24 + && this->unkF4_8 == 0xA + && !jiggyscore_isCollected(JIGGY_13_TTC_LOCKUP) + && func_80329530(this, 320) + && !func_80329530(this, 160) + && !func_8028ECAC() + && func_80311480(0xA15, 0, NULL, NULL, NULL, NULL) + ){ + this->unk138_24 = 1; + }//L803896AC + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + } + + switch(this->state){ + case 1: //L803896F0 + if(!this->initialized){ + this->marker->propPtr->unk8_3 = TRUE; + func_80328B8C(this, 1, 0.2f, 1); + this->marker->collidable = FALSE; + this->unk38_31 = 0; + this->initialized = TRUE; + }//L80389758 + local->unk0++; + + tmp_v1 = (this->modelCacheIndex == 0x151) ? 0x1E : + (this->modelCacheIndex == 0x152) ? 0x14 : + (this->modelCacheIndex == 0x153) ? 0xA : + 10000; + + + if(!(local->unk0 < tmp_v1)){ + local->unk0 = 0; + func_8038959C(this); + } + break; + + case 2: //L803897DC + if(actor_playerIsWithinDist(this, 400) && func_8028FB48(0x8000000)){ + func_8028F428(0xA, this->marker); + } + + if(actor_animationIsAt(this, 0.5f)){ + func_80328B8C(this, 3, 0.5f, 1); + } + if(0.15 < animctrl_getAnimTimer(this->animctrl)){ + this->marker->collidable = TRUE; + } + break; + + case 3: //L80389864 + local->unk4++; + tmp_v1 = (this->modelCacheIndex == 0x151) ? 0x1E : + (this->modelCacheIndex == 0x152) ? 0x14 : + (this->modelCacheIndex == 0x153) ? 0xA : + 10000; + + if(!(local->unk4 < tmp_v1)){ + local->unk4 = 0; + func_80328B8C(this, 4, 0.5f, 1); + } + break; + + case 4: //L803898F4 + case 5: //L803898F4 + if(this->marker->unk14_21 && actor_animationIsAt(this, 0.99f)){ + func_80389530(this); + for(i = 5; i < 0xe; i++){ + func_8034A174(this->marker->unk44, i, this->unk1C); + func_802EE6CC(this->unk1C, &D_8038C80C, &D_8038C7FC, 1, 0.4f, 50.0f, 0xb4, 0xa0, 0); + } + } + break; + }//L8038999C +} diff --git a/src/TTC/ch/treasure.c b/src/TTC/ch/treasure.c new file mode 100644 index 00000000..7f00b898 --- /dev/null +++ b/src/TTC/ch/treasure.c @@ -0,0 +1,94 @@ +#include +#include "functions.h" +#include "variables.h" + +void chtreasure_update(Actor *this); + +/* .data */ +ActorAnimationInfo gChTreasureAnim[]={ + {0, 0.0f}, + {ASSET_153_ANIM_BURIED_TREASURE_APPEAR, 2.0f}, + {ASSET_166_ANIM_BURIED_TREASURE_BOUNCE, 0.33f}, + {0, 0.0} +}; + +ActorInfo gChTreasureInfo = { + MARKER_DB_BURIED_TREASURE, ACTOR_F4_BURIED_TREASURE, ASSET_42C_MODEL_BURIED_TREASURE, + 1, gChTreasureAnim, + chtreasure_update, func_80326224, func_80325888, + 0, 0, 1.7f, 0 +}; + +/* .code */ +void __chtreasure_die(ActorMarker *marker, ActorMarker *otherMarker){ + Actor *this = marker_getActor(marker); + func_802C3F04(func_802C4140, 0x4C, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); + func_802EE278(this, 3, 0xf, 0x3C, 0.2f, 1.2f); + func_803115C4(0xA19); + jiggySpawn(JIGGY_11_TTC_RED_X, this->position); + marker_despawn(marker); +} + +void __chtreasure_updatePosition(Actor *this){ + this->position[0] = this->unk1C[0];\ + this->position[1] = this->unk1C[1];\ + this->position[2] = this->unk1C[2]; + + this->position[0] += this->unk5C*cosf(this->unk60); + this->position[2] += this->unk5C*sinf(this->unk60); + this->unk60 += 2.0*time_getDelta()*this->unk5C/300.0; + if(2*M_PI <= this->unk60) + this->unk60 -= 2*M_PI; + this->yaw = this->unk60*180.0/M_PI; +} + +void chtreasure_update(Actor *this){ + f32 sp3C[3]; + s16 sp34[3]; + + if(!this->initialized){ + this->initialized = TRUE; + if(this->unkF4_8 == 1 && !func_803203FC(0xC1)){ + marker_despawn(this->marker); + return; + } + actor_collisionOff(this); + this->scale = 0.5f; + this->unk60 = M_PI/2; + this->unk5C = 0.0f; + this->unk1C[0] = this->position[0]; + this->unk1C[1] = this->position[1]; + this->unk1C[2] = this->position[2]; + + actor_playAnimationOnce(this); + marker_setCollisionScripts(this->marker, NULL, NULL, __chtreasure_die); + }//L8038C214 + __chtreasure_updatePosition(this); + func_8034A174(this->marker->unk44, 5, sp3C); + sp34[0] = (s16)sp3C[0]; + sp34[1] = (s16)sp3C[1]; + sp34[2] = (s16)sp3C[2]; + sp34[1] += 50; + func_802F3BF4(sp34); + + switch(this->state){ + case 1://L8038C29C + this->unk5C = animctrl_getAnimTimer(this->animctrl) *300.0; //radius of 300.0f + if(animctrl_isStopped(this->animctrl)){ + actor_loopAnimation(this); + func_80328AC8(this, 2); + this->marker->propPtr->unk8_3 = 1; + actor_collisionOn(this); + func_8030E878(SFX_3F2_UNKNOWN, randf2(1.2f, 1.3f), 20000, this->position, 200.0f, 1500.0f); + } + break; + case 2://L8038C344 + if(actor_animationIsAt(this, 0.99f)){ + func_8030E878(SFX_3F2_UNKNOWN, randf2(1.2f, 1.3f), 20000, this->position, 200.0f, 1500.0f); + + } + break; + case 3: + break; + }//L8038C398 +} diff --git a/src/TTC/code_0.c b/src/TTC/code_0.c new file mode 100644 index 00000000..4c9cc95d --- /dev/null +++ b/src/TTC/code_0.c @@ -0,0 +1,338 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802C4218(s32, s32, s32, s32); +extern f32 func_80257204(f32, f32, f32, f32); +extern ActorProp * func_80320EB0(ActorMarker *, f32, s32); + +void func_80386FDC(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_8038C3B0[]; + +extern ActorInfo D_8038C3D0 = { + MARKER_15_CLAM, ACTOR_69_CLAM, ASSET_351_MODEL_CLAM, + 0x1, D_8038C3B0, + func_80386FDC, func_80326224, func_80325888, + 4500, 0x366, 1.6f, 0 +}; +extern struct41s *D_8038C3F4; +extern struct41s *D_8038C424; +extern struct41s *D_8038C454; +extern struct31s *D_8038C484; +extern struct41s *D_8038C4AC; + +/* .code */ +void func_803863F0(enum sfx_e sfx_id, f32 arg1, s32 arg2, f32 position[3], f32 arg4, f32 arg5){ + if(func_803114B0()){ + arg2 -= 10000; + if(arg2 < 0) + arg2 = 0; + } + func_8030E878(sfx_id, arg1, arg2, position, arg4, arg5); +} + +void func_80386454(Actor *this){ + func_80328B8C(this, 1, 0.01f, 1); + actor_loopAnimation(this); + animctrl_setDuration(this->animctrl, randf2(1.9f, 2.1f)); +} + +bool func_803864B0(Actor *this, f32 arg1) { + f32 sp5C; + f32 sp58; + f32 pad; + Actor *sp50; + Actor *sp4C; + f32 phi_f2; + f32 sp3C[3]; + s32 sp38; + + sp50 = func_80326D68(this->position, 0x52, -1, &sp5C); + sp4C = func_80326D68(this->position, 0x129, -1, &sp58); + sp38 = 0; + if( (sp58 < sp5C) + && (sp58 < 16000.0f) + && (sp4C != 0) + && func_80307258(sp4C->position, this->unk10_25 - 1, this->unk10_18 - 1) != -1 + ) { + sp3C[0] = sp4C->position[0]; + sp3C[1] = sp4C->position[1]; + sp3C[2] = sp4C->position[2]; + phi_f2 = sp58; + } + else if( + (sp5C < sp58) + && (sp5C < 16000.0f) + && (sp50 != 0) + && func_80307258(sp50->position, this->unk10_25 - 1, this->unk10_18 - 1) != -1 + ){ + sp3C[0] = sp50->position[0]; + sp3C[1] = sp50->position[1]; + sp3C[2] = sp50->position[2]; + phi_f2 = sp5C; + } + else if ((func_80329530(this, 0x4B0) != 0) && (func_803292E0(this) != 0)) { + phi_f2 = gu_sqrtf((f32) func_8032970C(this)); + player_getPosition(sp3C); + sp38 = 1; + } + else{ + return FALSE; + } + + this->unk28 = phi_f2 / arg1; + this->yaw_moving = func_80257204(this->position[0], this->position[2], sp3C[0], sp3C[2]); + if ((func_803203FC(0xC1) ? 0 : 0x11) < this->unk28) { + this->unk28 = (func_803203FC(0xC1) != 0) ? 0.0f : 17.0f; + } else if (sp38 == 0) { + func_803863F0(SFX_AE_YUMYUM_TALKING, randf2(0.9f, 1.0f), 22000, this->position, 500.0f, 2000.0f); + } + return 1; + +} + +bool func_80386760(Actor *this, s32 arg1) { + f32 temp_f0_2; + s32 sp24; + s32 sp2C; + + if(this->unk10_25 == 0) return FALSE; + + + animctrl_setDuration(this->animctrl, 1.0f); + sp2C = (s32) ((f64) (60.0f / (f32) func_8033DD90()) * 0.5); + if ((this->unk1C[0] != 0.0f) || !func_803864B0(this, sp2C)) { + if (((f64) animctrl_getAnimTimer(this->animctrl) < 0.1) && ((f64) randf() < 0.5)) { + if (this->unk1C[0] != 0.0f) { + arg1 *= 2; + this->unk28 = (f32) randi2(0, 0.5*(func_803203FC(0xC1) ? 0 : 0x11)); + this->yaw_moving += (f32) randi2(-arg1, arg1); + } else if ((f64) randf() < 0.4) { + this->unk28 = 0.0f; + this->yaw_moving += (f32) randi2(-arg1, arg1); + } else { + this->unk28 = (f32) randi2(0.33 * (func_803203FC(0xC1) ? 0 : 0x11), func_803203FC(0xC1) ? 0 : 0x11); + this->yaw_moving = this->yaw; + } + this->unk1C[0] = 0.0f; + } + else{ + this->unk1C[0] = 0.0f; + return FALSE; + } + } + temp_f0_2 = this->unk28 * sp2C; + this->velocity[1] = ((f32)(0.3*temp_f0_2) / sp2C) - (f32) ((s32) (sp2C * -5) / 2); + if (func_80329078(this, this->yaw_moving, temp_f0_2)) { + return TRUE; + } + this->unk1C[0] = 1.0f; + this->unk28 = 0.0f; + this->yaw_moving = this->yaw; + return FALSE; +} + + +void func_80386A9C(ParticleEmitter *pCtrl, f32 position[3]){ + particleEmitter_setPosition(pCtrl, position); + func_802EF9F8(pCtrl, 0.7f); + func_802EFA18(pCtrl, 3); + func_802EFA20(pCtrl, 0.8f, 1.0f); + func_802EF9EC(pCtrl, 0x1f, 10000); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 3.5f, 3.5f); + func_802EFA5C(pCtrl, 0.0f, 0.65f); + func_802EFA70(pCtrl, 2); +} + +void func_80386B54(f32 position[3], s32 count){ + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(count); + func_80386A9C(pCtrl, position); + particleEmitter_setModel(pCtrl, 0x37c); + particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C3F4); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + func_802EFB70(pCtrl, 1.0f, 1.0f); + particleEmitter_emitN(pCtrl, count); +} + +void func_80386C08(f32 position[3], s32 count){ + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(count); + func_80386A9C(pCtrl, position); + particleEmitter_setModel(pCtrl, 0x37d); + particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C424); + func_802EFE24(pCtrl, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); + func_802EFB70(pCtrl, 1.0f, 1.0f); + particleEmitter_emitN(pCtrl, count); +} + +void func_80386CBC(f32 position[3], s32 count){ + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(count); + func_80386A9C(pCtrl, position); + particleEmitter_setModel(pCtrl, 0x37E); + particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C454); + func_802EFE24(pCtrl, -800.0f, -800.0f, -800.0f, 800.0f, 800.0f, 800.0f); + func_802EFB70(pCtrl, 0.5f, 0.8f); + particleEmitter_emitN(pCtrl, count); +} + +void func_80386D68(f32 position[3], enum asset_e sprite_id, s32 count){ + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(count); + particleEmitter_setSprite(pCtrl, sprite_id); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038C4AC); + func_802EFB98(pCtrl, &D_8038C484); + particleEmitter_emitN(pCtrl, count); +} + +void func_80386DF4(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this; + + this = marker_getActor(this_marker); + this->marker->collidable = FALSE; + this->unk138_27 = TRUE; + func_803863F0(SFX_1D_HITTING_AN_ENEMY_1, 1.0f, 26000, this->position, 1500.0f, 2000.0f); + func_803863F0(SFX_115_BUZZBOMB_DEATH, 1.2f, 26000, this->position, 1500.0f, 2000.0f); + func_80386B54(this->position, 2); + func_80386C08(this->position, 2); + func_80386CBC(this->position, 0xC); + func_803115C4(0xa14); + marker_despawn(this->marker); +} + +void func_80386EDC(s32 this, enum item_e item_id){ + f32 sp24[3]; + + player_getPosition(sp24); + func_802C8F70(randf2(0.0f, 359.0f)); + func_802C3F04(func_802C4218, this, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); + item_dec(item_id); +} + +void func_80386F44(ActorMarker *this_marker, ActorMarker *other_marker){ + + if(func_80297C6C() == 3) return; + + if( !mapSpecificFlags_get(5) && func_80311480(0xA14, 0, NULL, NULL, NULL, NULL)){ + mapSpecificFlags_set(5, TRUE); + } + + if(item_getCount(ITEM_D_EGGS) != 0) + func_80386EDC(0xe, ITEM_D_EGGS); + + if(item_getCount(ITEM_F_RED_FEATHER) != 0) + func_80386EDC(0xf, ITEM_F_RED_FEATHER); +} + +void func_80386FDC(Actor *this){ + ActorProp *sp4C = func_80320EB0(this->marker, 30.0f, 1); + f32 sp48; + s32 sp44; + f32 sp38[3]; + + if(!this->initialized){ + this->initialized = TRUE; + animctrl_setDuration(this->animctrl, 2.0f); + } + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + marker_setCollisionScripts(this->marker, NULL, func_80386F44, func_80386DF4); + } + + if(this->state != 3){ + sp48 = func_80309724(this->position); + if(sp4C != NULL){ + sp44 = sp4C->marker->unk14_20; + } + + if(sp44 == 0x60 || sp44 == 0xb5){ + if(this->position_y <= sp48 + 15.0f && sp48 - 15.0f <= this->position_y){ + this->position_y = sp48; + this->unk38_31 = sp44; + func_80328B8C(this, 3, 0.01f, 1); + actor_loopAnimation(this); + this->velocity_x = 0.0f; + animctrl_setDuration(this->animctrl, 0.6f); + marker_despawn(sp4C->marker); + } + }//L80387140 + }//L80387144 + + switch(this->state){ + case 1://L80387170 + if(func_80386760(this, 140)){ + func_80328B8C(this, 2, 0.01f, 1); + actor_playAnimationOnce(this); + animctrl_setDuration(this->animctrl, 1.0f); + func_803863F0(SFX_3F2_UNKNOWN, randf2(1.0f, 1.1f), 22000, this->position, 1500.0f, 2000.0f); + } + else{ + animctrl_setDuration(this->animctrl, 2.0f); + } + break; + + case 2://L8038720C + this->position_y += this->velocity_y; + this->velocity_y += -5.0f; + if(actor_animationIsAt(this, 0.63f)){ + func_803863F0(SFX_80_YUMYUM_CLACK, 1.0f, 20000, this->position, 1500.0f, 2000.0f); + } + + if(this->position_y <= sp48){ + this->position_y = sp48; + if(actor_animationIsAt(this, 0.99f) || 0.98 < animctrl_getAnimTimer(this->animctrl)){ + func_80386454(this); + } + } + else{//L803872D4 + if(!func_80329054(this, 0)){ + this->unk1C[0] = 1.0f; + } + } + break; + + case 3://L803872F0 + if(actor_animationIsAt(this, 0.99f)){ + this->velocity_x += 1.0f; + } + + if(3.0f <= this->velocity_x){ + func_80386454(this); + break; + } + + if(actor_animationIsAt(this, 0.8f) && 2.0f == this->velocity_x){ + func_803863F0(SFX_4B_GULPING, randf2(0.8f, 0.9f), 22000, this->position, 700.0f, 2000.0f); + break; + }//L803873C4 + + if(!actor_animationIsAt(this, 0.01f)) break; + + if(!this->marker->unk14_21) break; + + func_803863F0(SFX_4C_LIP_SMACK, 1.0f, 20000, this->position, 500.0f, 2000.0f); + func_8034A174(this->marker->unk44, 5, sp38); + + switch(this->unk38_31){ + case 0x60: + func_80386D68(sp38, ASSET_718_SPRITE_SPARKLE_WHITE_2, 8); + break; + case 0xb5: + func_80386D68(sp38, ASSET_715_SPRITE_SPARKLE_RED, 8); + break; + } + break; + } + func_80328FB0(this, 5.0f); +} diff --git a/src/TTC/code_10A0.c b/src/TTC/code_10A0.c new file mode 100644 index 00000000..434f22e9 --- /dev/null +++ b/src/TTC/code_10A0.c @@ -0,0 +1,246 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8028E668(f32[3], f32, f32, f32); +extern void func_8028FA34(s32, Actor*); +extern s32 func_802E0970(s32, f32, f32, f32, s32, s32, f32[3]); + +typedef struct { + u8 unk0[0xE]; + s16 unkE; + f32 throw_target_position[3]; + s32 throw_target_radius; + NodeProp* unk20; + s32 unk24; +}ActorLocal_Blubber; + +void func_803878CC(Actor *this); +void func_80387CF4(Actor *this); +Actor *func_80387D6C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +extern ActorAnimationInfo D_8038C4E0[]; + +extern ActorInfo D_8038C510 = { + MARKER_A3_BLUBBER, ACTOR_115_BLUBBER, ASSET_370_MODEL_BLUBBER, + 0x1, D_8038C4E0, + func_803878CC, func_80387CF4, func_80387D6C, + 0, 0x399, 1.8f, 0 +}; + +/* .code */ +void func_80387490(Actor *this){ + ActorLocal_Blubber *local = (ActorLocal_Blubber *)&this->local; + + animctrl_setTransitionDuration(this->animctrl, 0.2f); + this->initialized = TRUE; + local->unk20 = func_80304C38(ACTOR_2B_GOLD_BULLION_THROW_TARGET, this); + if(local->unk20){ + + nodeprop_getPosition(local->unk20, local->throw_target_position); + local->throw_target_radius = nodeprop_getRadius(local->unk20); + } + local->unk24 = 4; + func_8032A82C(this, 0x14C); +} + +void func_80387520(ActorMarker *caller, enum asset_e text_id, s32 arg1){ + Actor *this = marker_getActor(caller); + ActorLocal_Blubber *local = (ActorLocal_Blubber*)&this->local; + + if(text_id == 0xa0d || text_id == 0xa2a){ + local->unk24 = 0; + } + else{ + func_80328B8C(this, 2, 0, 1); + } +} + +void func_80387574(ActorMarker *caller, enum asset_e text_id, s32 arg1){ + f32 sp24[3]; + + if(func_80304E24(0x14b, sp24)){ + jiggySpawn(JIGGY_14_TTC_BLUBBER, sp24); + func_802C3F04((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, sp24[0]), reinterpret_cast(s32, sp24[1]), reinterpret_cast(s32, sp24[2])); + } +} + +void func_803875D4(ActorMarker *marker){ + Actor *this = marker_getActor(reinterpret_cast(ActorMarker *, marker)); + enum asset_e text_id; + + func_80328A84(this, 4); + actor_loopAnimation(this); + this->unk28 = 0.0f; + + if(!mapSpecificFlags_get(2)) { + text_id = jiggyscore_isCollected(JIGGY_14_TTC_BLUBBER) ? 0xa2a : 0xa0d; + func_80311480( text_id, 0xf, this->position, this->marker, func_80387520, func_80387574); + mapSpecificFlags_set(2, TRUE); + } +} + +void func_80387678(Actor *this){ + if( !mapSpecificFlags_get(1) ) return; + if( mapSpecificFlags_get(3) ) return; + + this->yaw_moving = (f32) func_80329784(this); + mapSpecificFlags_set(3, TRUE); + func_8028F918(2); + timed_setCameraToNode(0.0f, 4); + timedFunc_set_1(1.0f, (TFQM1)func_803875D4, (s32)this->marker); + func_80328B8C(this, 1, 0.0f, 1); +} + +void func_8038771C(Actor *this){ + if( !func_80329030(this, 0) + && func_80329480(this) + ){ + func_80328CEC(this, (s32)this->yaw_moving, 120, 180); + } +} + +void func_80387774(Actor **this_ptr){ + ActorLocal_Blubber *local = (ActorLocal_Blubber *)&(*this_ptr)->local; + + func_8028F364(local->throw_target_position, local->throw_target_radius, 100.0f, ACTOR_2A_GOLD_BULLION, this_ptr); + if( func_80329530(*this_ptr, 200) + && func_8028E88C() == 0x37 + && func_8028FC34() + ){ + func_8028FA34(!mapSpecificFlags_get(0)? 0x149 : 0x14a, *this_ptr); + (*this_ptr)->unk138_24 = TRUE; + } + +} + +void func_80387830(Actor *this , f32 arg1, f32 arg2){ + if( actor_animationIsAt(this, arg1) + || actor_animationIsAt(this, arg2) + ){ + this->unk10_12 = func_802E0970(0x26, 0.75f, 0.85f, 0.05f, 11000, this->unk10_12, this->position); + } +} + +void func_803878CC(Actor * this){ + ActorLocal_Blubber *local; + + this->marker->propPtr->unk8_3 = TRUE; + func_8028E668(this->position, 90.0f, -10.0f, 110.0f); + if(!mapSpecificFlags_get(1) && !func_80329530(this, 2500)) + return; + + if(!this->unk16C_4){ + if(this->state == 3){ + func_80328B8C(this, 2, 0.0f, 1); + } + this->unk16C_4 = TRUE; + }//L80387970 + + if(func_80329530(this, 250) && !func_80329530(this, 80) + && !this->unk138_24 + && item_getCount(ITEM_18_GOLD_BULLIONS) == 0 + ){ + func_80311480(0xa0b, 0xe, this->position, this->marker, func_80387520, NULL); + this->unk138_24 = TRUE; + func_80328AC8(this, 3); + } + + if( mapSpecificFlags_get(0) + && !this->unk138_23 + ){ + if(item_getCount(ITEM_18_GOLD_BULLIONS) == 0) + func_80311480(0xa0c, 4, NULL, NULL, NULL, NULL); + + this->unk138_23 = TRUE; + this->unk138_24 = TRUE; + + }//L80387A54 + + switch(this->state){//D_8038CD40 + case 1:// 80387A84 + if(!this->initialized){ + actor_collisionOff(this); + func_80387490(this); + } + func_80387774(&this); + + if(func_80328BD4(this, 2, 0.0f, 1, 0.007f)) + break; + + func_80328FB0(this, 3.0f); + func_8038771C(this); + func_80387830(this, 0.14f, 0.68f); + func_80387678(this); + break; + + case 2:// 80387B10 + func_80387774(&this); + if( actor_animationIsAt(this, 0.99f) + && func_80328BD4(this, 1, 0.0f, 1, 0.78f) + ){ + this->unk28 = 4.0f; + break; + } + + if(actor_animationIsAt(this, 0.3f)){ + FUNC_8030E8B4(SFX_83_BLUBBER_CRYING, 0.95f, 17000, this->position, 1250, 2500); + } + + if(actor_animationIsAt(this, 0.53f)){ + FUNC_8030E8B4(SFX_83_BLUBBER_CRYING, 0.93f, 17000, this->position, 1250, 2500); + } + + if(actor_animationIsAt(this, 0.72f)){ + FUNC_8030E8B4(SFX_83_BLUBBER_CRYING, 0.91f, 17000, this->position, 1250, 2500); + } + + func_80387678(this); + break; + + case 3: + break; + + case 4:// 80387C04 + { + func_80328FB0(this, 3.0f); + local = (ActorLocal_Blubber*)&this->local; + if(actor_animationIsAt(this, 0.99f) && !local->unk24){ + func_80328A84(this, 5); + this->unk28 = 8.0f; + } + } + + if(actor_animationIsAt(this, 0.3f) && !func_803114B0()){ + FUNC_8030E624(SFX_8C_BOGGY_WAHEY, 1.0f, 27000); + } + + if(actor_animationIsAt(this, 0.28f) || + (actor_animationIsAt(this, 0.78f) && !func_803114B0()) + ){ + FUNC_8030E624(SFX_80_YUMYUM_CLACK, 0.9f, 13000); + } + break; + + case 5:// 80387CD4 + local = (ActorLocal_Blubber*)&this->local; + func_8032A95C(this, local->unkE, 0x21c); + break; + } +} + +void func_80387CF4(Actor *this){ + func_80343DEC(this); + if(0.99 <= this->unk48){ + func_8028F918(0); + func_80324E88(0.0f); + marker_despawn(this->marker); + } + func_80387830(this, 0.5f, 0.97f); +} + +Actor *func_80387D6C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + func_8033A45C(4, 0); + return func_80325888(marker, gfx, mtx, vtx); +} diff --git a/src/TTC/code_19D0.c b/src/TTC/code_19D0.c new file mode 100644 index 00000000..4f7197ca --- /dev/null +++ b/src/TTC/code_19D0.c @@ -0,0 +1,330 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80388434(Actor *this); +Actor *func_80387EB0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + + +/* .data */ +extern ActorAnimationInfo D_8038C540[]; + +extern ActorInfo D_8038C580 = { + MARKER_A5_NIPPER, ACTOR_117_NIPPER, ASSET_3D5_MODEL_NIPPER, + 0x1, D_8038C540, + func_80388434, func_80326224, func_80387EB0, + 0, 0x299, 10.0f, 0 +}; + +extern s32 D_8038C5A4[3]; +extern struct31s D_8038C5B0; + +/* .code */ +void func_80387DC0(f32 *position, s32 count) { + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(count); + pCtrl = pCtrl; + particleEmitter_setSprite(pCtrl, ASSET_700_SPRITE_DUST); + func_802EFFA8(pCtrl, D_8038C5A4); + particleEmitter_setStartingFrameRange(pCtrl, 0, 7); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setParticleSpawnPositionRange(pCtrl, + -10.0f, -5.0f, -10.0f, + 10.0f, 10.0f, 10.0f + ); + particleEmitter_setParticleVelocityRange(pCtrl, + -40.0f, 10.0f, -40.0f, + 40.0f, 40.0f, 40.0f + ); + func_802EFB98(pCtrl, &D_8038C5B0); + particleEmitter_emitN(pCtrl, count); +} + +Actor *func_80387EB0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *this; + + this = marker_getActor(marker); + func_8033A45C(3, (this->state == 7)? 0 : 1); + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_80387F18(Actor *this) { + func_80328AEC(this, 3); + this->unk1C[0] = 0.0f; + switch((s32)this->unk60){ + case 0x78: + animctrl_setDuration(this->animctrl, 1.2f); + break; + + case 0x50: + animctrl_setDuration(this->animctrl, 1.05f); + break; + + case 0x28: + animctrl_setDuration(this->animctrl, 0.9f); + break; + } +} + +void func_80387FB0(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *this; + this = marker_getActor(caller); + func_80387F18(this); + func_802BAE4C(); + comusic_8025AB44(COMUSIC_12_TTC_NIPPER, -1, 300); +} + +void func_80387FF4(Actor *this) { + s32 i; + + func_80328B8C(this, 4, 0.01f, 1); + actor_playAnimationOnce(this); + for(i = 0; i < 3; i ++){ + FUNC_8030E8B4(SFX_79_TICKER_DEATH, 0.5f, 17000, this->position, 1500, 3000); + }; +} + +bool func_80388088(Actor *this){ + f32 sp2C; + f32 sp20[3]; + bool out; + + sp2C = this->yaw - func_80329784(this); + player_getPosition(sp20); + if(sp20[0] < -5680.0f){ + return FALSE; + } + + return (-35.0f < sp2C && sp2C < 35.0f) ? TRUE : FALSE; +} + +bool func_8038812C(Actor *this){ + return (func_80329530(this, 1300) && func_80388088(this)) ? TRUE : FALSE; +} + +void func_80388178(ActorMarker *this_marker, ActorMarker *other_marker) { + Actor *this; + s32 i; + + this = marker_getActor(this_marker); + func_8032B4DC(this, other_marker, 7); + + if (this->unk60 == 40.0f) { + func_80328B8C(this, 6, 0.01f, 1); + actor_playAnimationOnce(this); + for(i = 0; i < 3; i++){ + FUNC_8030E8B4(SFX_78_EAGLECRY, 0.7f, 20000, this->position, 1500, 3000); + }; + comusic_8025AB44(COMUSIC_12_TTC_NIPPER, 0, 300); + func_8025AABC(0x12); + func_8032BB88(this, -1, 300); + func_802BAFE4(0x1C); + return; + } + + if (this->unk60 == 80.0f) { + func_80387FF4(this); + this->unk60 = 40.0f; + return; + } + + func_80387FF4(this); + this->unk60 = 80.0f; + func_80311480(0xA10, 4, NULL, NULL, NULL, NULL); + return; +} + +bool func_803882E4(ActorMarker * this_marker, ActorMarker * other_marker){ + if(this_marker->unk40_31 == 1){ + this_marker->unk14_20 = 0x16C; + } + else{ + this_marker->unk14_20 = 0xA5; + } + return TRUE; +} + +void func_80388344(ActorMarker * this_marker, ActorMarker *other_marker){ + Actor *this; + + if(other_marker->unk14_20 == 1){ + this = marker_getActor(this_marker); + if( !mapSpecificFlags_get(7) + && this->unk138_24 + && func_80311480(0xa0f, 0, NULL, NULL, NULL, NULL) + ){ + mapSpecificFlags_set(7, TRUE); + } + } +} + +void func_803883C8(ActorMarker * this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + if( !this->unk138_23 + && this->unk138_24 + && func_80311480(0xa11, 0, NULL, NULL, NULL, NULL) + ){ + this->unk138_23 = TRUE; + } +} + +void func_80388434(Actor *this){ + f32 sp4C[3]; + s32 sp48; + s32 sp44; + f32 sp38[3]; + s32 temp_v0; + + player_getPosition(sp38); + sp44 = func_80309D58(sp38, 1); + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->velocity_x = sp44; + func_8032BC18(this); + } + + if(this->state != 7){ + // sp30 = sp44; + if(0.0f == this->velocity_x && sp44){ + comusic_8025AB44(COMUSIC_12_TTC_NIPPER, -1, 5000); + func_8032BB88(this, 0, 4000); + func_8024BD08(0); + } + else if(!sp44 && 0.0f != this->velocity_x){ + comusic_8025AB44(COMUSIC_12_TTC_NIPPER, 0, 300); + func_8025AABC(COMUSIC_12_TTC_NIPPER); + func_8032BB88(this, -1, 300); + func_8024BD08(1); + } + this->velocity_x = sp44; + }//L80388554 + + switch(this->state){ + case 1:// L80388578 + if(!this->initialized){ + animctrl_setTransitionDuration(this->animctrl, 0.35f); + func_80328B8C(this, 1, 0.01f, 1); + this->unk60 = 120.0f; + this->marker->propPtr->unk8_3 = TRUE; + marker_setCollisionScripts(this->marker, func_803883C8, func_80388344, func_80388178); + func_803300C0(this->marker, func_803882E4); + this->initialized = TRUE; + }//L8038860C + if(func_8038812C(this)){ + temp_v0 = func_8028ECAC(); + if( !this->unk138_24 + && temp_v0 != 1 + && temp_v0 != 10 + ){ + func_80328B8C(this, 5, 0.01f, 1); + if(func_80311480(0xa0e, 0xf, this->position, this->marker, func_80387FB0, NULL)){ + this->unk138_24 = TRUE; + } + comusic_8025AB44(COMUSIC_12_TTC_NIPPER, 5000, 300); + set_camera_to_node(11); + } + else{//L803886B0 + func_80387F18(this); + } + break; + } + + //L803886C0 + if( actor_animationIsAt(this, 0.2f) + || actor_animationIsAt(this, 0.2f) + || actor_animationIsAt(this, 0.6f) + || actor_animationIsAt(this, 0.7f) + ){ + FUNC_8030E8B4(SFX_3D_TICKER_WALKING, 0.75f, 12000, this->position, 0x5dc, 0xbb8); + } + break; + + case 2:// L8038872C + if(!func_8038812C(this)){ + func_80328AEC(this, 1); + break; + } + + if(this->unk60 <= this->unk38_31){ + func_80387F18(this); + break; + } + this->unk38_31++; + break; + + case 3:// L803887B4 + if(actor_animationIsAt(this, 0.5f) && this->marker->unk14_21){ + func_8034A174(this->marker->unk44, 6, sp4C); + func_80387DC0(sp4C, 2); + } + else if(actor_animationIsAt(this, 0.95f) && this->marker->unk14_21){//L80388800 + func_8034A174(this->marker->unk44, 5, sp4C); + func_80387DC0(sp4C, 2); + }//L80388848 + + if(actor_animationIsAt(this, 0.99f)){ + this->unk1C[0] += 1.0f; + } + + if(2.0f <= this->unk1C[0]){ + func_80328AEC(this, 2); + this->unk38_31 = 0; + break; + } + + if( actor_animationIsAt(this, 0.5f) + || actor_animationIsAt(this, 0.95f) + ){ + for(sp48 = 0; sp48 < 3; sp48++){ + FUNC_8030E8B4(SFX_3D_TICKER_WALKING, 0.75f, 12000, this->position, 1500, 3000); + } + } + break; + + case 4:// L80388910 + if(actor_animationIsAt(this, 0.99f)){ + func_80387F18(this); + } + break; + + case 5:// L80388938 + if( actor_animationIsAt(this, 0.2f) + || actor_animationIsAt(this, 0.2f) + || actor_animationIsAt(this, 0.6f) + || actor_animationIsAt(this, 0.7f) + ){ + FUNC_8030E8B4(SFX_3D_TICKER_WALKING, 0.75f, 12000, this->position, 0x5dc, 0xbb8); + } + break; + + case 6:// L803889A8 + this->marker->collidable = FALSE; + if(actor_animationIsAt(this, 0.6f)){ + FUNC_8030E8B4(SFX_7C_CHEBOOF, 0.9f, 20000, this->position, 1500, 3000); + break; + } + + if(actor_animationIsAt(this, 0.99f)){ + func_80328B8C(this, 7, 0.01f, 1); + } + break; + + case 7:// L80388A20 + this->marker->collidable = FALSE; + break; + + }//L80388A30 +} + +bool func_80388A44(s16 arg0[3]){ + f32 sp1C[3]; + Actor *nipper; + + sp1C[0] = (f32) arg0[0]; + sp1C[1] = (f32) arg0[1]; + sp1C[2] = (f32) arg0[2]; + + nipper = func_80326D68(&sp1C, ACTOR_117_NIPPER, -1, NULL); + return nipper->state == 7; +} diff --git a/src/TTC/code_26D0.c b/src/TTC/code_26D0.c new file mode 100644 index 00000000..443e88b2 --- /dev/null +++ b/src/TTC/code_26D0.c @@ -0,0 +1,173 @@ +#include +#include "functions.h" +#include "variables.h" +#include "prop.h" +#include "SnS.h" + +extern ActorInfo D_8038C3D0; +extern ActorInfo D_8038C510; +extern ActorInfo D_8038C580; +extern ActorInfo D_8038C5E0; +extern ActorInfo D_8038C604; +extern ActorInfo D_8038C628; +extern ActorInfo D_8038C64C; +extern ActorInfo D_8038C670; +extern ActorInfo D_8038C694; +extern ActorInfo D_8038C6B8; +extern ActorInfo D_8038C6DC; +extern ActorInfo D_8038C718; +extern ActorInfo D_8038C790; +extern ActorInfo D_8038C7B4; +extern ActorInfo D_8038C7D8; +extern ActorInfo D_8038C8B0; +extern ActorInfo D_8038C8D4; +extern ActorInfo D_8038C8F8; +extern ActorInfo gChTreasureInfo; + +void func_80388C78(Actor *this); +void func_80388CB8(Actor *this); +void func_80388D34(Actor *this); +void func_802D3D54(Actor *this); +void func_80388D8C(Actor *this); + +/* .data */ +extern ActorInfo D_8038C5E0 = { + 0xA1, 0x10E, 0x3D2, + 0x1, NULL, + func_802D3D54, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_8038C604 = { + MARKER_EA_LIGHTHOUSE_DOOR, ACTOR_13E_LIGHTHOUSE_DOOR, ASSET_3D6_MODEL_LIGHTHOUSE_DOOR, + 0x1, NULL, + func_802D3D54, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_8038C628 = { + MARKER_167_SHARKFOOD_ISLAND, ACTOR_25C_SHARKFOOD_ISLAND, ASSET_50A_MODEL_SHARKFOOD_ISLAND, + 0x1, NULL, + func_80388D8C, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_8038C64C = { + 0x267, 0x2E2, 0x3BD, + 0x1, NULL, + func_80388D34, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_8038C670 = { + 0x26A, 0x2DF, 0x3BE, + 0x1, NULL, + func_80388C78, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_8038C694 = { + 0x268, 0x2E0, 0x3B6, + 0x1, NULL, + func_80388C78, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_8038C6B8 = { + 0x269, 0x2E1, 0x3B7, + 0x1, NULL, + func_80388C78, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_8038C6DC = { + MARKER_1D5_PALM_TREE, ACTOR_31E_PALM_TREE, ASSET_3A9_MODEL_PALM_TREE, + 0x1, NULL, + func_80388CB8, func_80326224, func_80325E78, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_80388AC0(void) +{ + spawnableActorList_add(&D_8038C5E0, actor_new, 0); + spawnableActorList_add(&D_8038C604, actor_new, 0); + spawnableActorList_add(&D_8038C580, actor_new, 0X4100168); + spawnableActorList_add(&D_8038C510, actor_new, 0X4000101); + spawnableActorList_add(&D_8038C718, actor_new, 0X188); + spawnableActorList_add(&D_8038C790, actor_new, 0X148); + spawnableActorList_add(&D_8038C7B4, actor_new, 0X148); + spawnableActorList_add(&D_8038C7D8, actor_new, 0X148); + spawnableActorList_add(&D_8038C8B0, actor_new, 0X400); + spawnableActorList_add(&D_8038C8D4, actor_new, 0X400); + spawnableActorList_add(&D_8038C8F8, actor_new, 0X400); + spawnableActorList_add(&gChTreasureInfo, actor_new, 0X2000048); + spawnableActorList_add(&D_8038C628, actor_new, 0X8680); + spawnableActorList_add(&D_8038C64C, actor_new, 0X400); + spawnableActorList_add(&D_8038C670, actor_new, 0X20404); + spawnableActorList_add(&D_8038C694, actor_new, 0X400); + spawnableActorList_add(&D_8038C6B8, actor_new, 0X400); + spawnableActorList_add(&D_8038C6DC, actor_new, 0X400); + spawnableActorList_add(&D_8038C3D0, actor_new, 0X2000041); +} + +void func_80388C78(Actor *this){ + if(!this->initialized){ + func_802D3D74(this); + this->initialized = TRUE; + } +} + +void func_80388CB8(Actor *this){ + if(!this->initialized){ + func_802D3D74(this); + this->initialized = TRUE; + this->scale = 2.55f; + } +} + +void func_80388D04(s32 arg0){ + ActorMarker *marker = reinterpret_cast(ActorMarker *, arg0); + Actor *this = marker_getActor(marker); + spawn_child_actor(0x2df, &this); +} + +void func_80388D34(Actor *this){ + func_80388C78(this); + if(!this->unk16C_4){ + func_802C3C88(func_80388D04, this->marker); + this->unk16C_4 = TRUE; + } +} + +void func_80388D8C(Actor *this){ + f32 sp1C[3]; + + if(!this->initialized){ + func_802D3CE8(this); + this->initialized = TRUE; + this->position_x = 0.412*(8831.0f - this->position_x) + this->position_x; + this->position_z = 0.412*(13535.0f - this->position_z) + this->position_z; + this->yaw = 199.0f; + } + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if(sns_get_item_state(SNS_ITEM_EGG_PINK, TRUE)){ + this->position_y = 700.0f; + } + else{ + this->position_y = -1000.0f; + } + }//L80388E7C + + if(this->position_y == 700.0f){ + player_getPosition(sp1C); + if( 695.0f <= sp1C[1] && sp1C[1] < 1000.0f + && (sp1C[0] - 5542.0f)*(sp1C[0] - 5542.0f) + (sp1C[2] - 8687.0f)*(sp1C[2] - 8687.0f) < 96100.0f + && (sp1C[0] - 6837.0f)*(sp1C[0] - 6837.0f) + (sp1C[2] - 12714.0f)*(sp1C[2] - 12714.0f) < 17640000.0f + ){ + func_8031D04C(0x8f, 1); + } + } +} diff --git a/src/TTC/code_2B80.c b/src/TTC/code_2B80.c new file mode 100644 index 00000000..79d6933f --- /dev/null +++ b/src/TTC/code_2B80.c @@ -0,0 +1,121 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8028E668(f32 [3], f32, f32, f32); +extern void func_8028F9DC(s32); +extern void func_803272D0(f32 arg0[3], f32 arg1, s32 arg2, int (*arg3)(Actor *)); + +void func_80388FBC(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_8038C700[]; + +extern ActorInfo D_8038C718 = { + MARKER_33_LEAKY, ACTOR_1E_LEAKY, ASSET_51A_MODEL_LEAKY, + 0x1, D_8038C700, + func_80388FBC, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +extern f32 D_8038C73C[3]; + +/* .rodata */ +extern f32 D_8038CDD0; +extern f32 D_8038CDD4; +extern f32 D_8038CDD8; +extern f32 D_8038CDDC; +extern f32 D_8038CDE0; +extern f32 D_8038CDE4; + +/* .code */ +bool func_80388F70(Actor *this){ + return this->modelCacheIndex == 0x56; +} + +void func_80388F88(void){ + func_803272D0(D_8038C73C, 2000.0f, 2, func_80388F70); +} + +void func_80388FBC(Actor *this) { + void *temp_v0_2; + + func_8028E668(this->position, 100.0f, -20.0f, 100.0f); + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = FALSE; + if (levelSpecificFlags_get(5) != 0) { + levelSpecificFlags_set(5, 0); + timedFunc_set_1(0.5f, func_8025A70C, 0x2D); + } + if (levelSpecificFlags_get(2) != 0) { + temp_v0_2 = func_8034C5AC(300); + if (temp_v0_2 != 0) { + func_8034E71C(temp_v0_2, -600, 0.0f); + } + this->state = 2; + } else { + this->state = 1; + } + } + if( this->state == 1 + && !this->unk138_24 + && func_80329530(this, 250) && !func_80329530(this, 160) + && !func_8028ECAC() + && func_80311480(0xA1A, 0, NULL, NULL, NULL, NULL) + ){ + this->unk138_24 = TRUE; + } + if (func_803114B0() == 0) { + if (actor_animationIsAt(this, 0.83f)) { + func_8030E878(0x109, randf2(D_8038CDD0, D_8038CDD4), 22000, this->position, 400.0f, 1000.0f); + return; + } + if (actor_animationIsAt(this, 0.01f)) { + func_8030E878(0x109, randf2(D_8038CDD8, D_8038CDDC), 18000, this->position, 400.0f, 1000.0f); + return; + } + if( actor_animationIsAt(this, 0.15f) + || actor_animationIsAt(this, 0.34f) + || actor_animationIsAt(this, 0.53f) + || actor_animationIsAt(this, 0.66f) + ){ + func_8030E878(0x109, randf2(D_8038CDE0, D_8038CDE4), 14000, this->position, 400.0f, 1000.0f); + } + } +} + +void func_80389288(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *this = marker_getActor(caller); + s32 temp_v0; + func_80328A84(this, 2); + temp_v0 = func_8034C5AC(300); + if(temp_v0){ + func_8034E7B8(temp_v0, -600, 4.0f, 2, 10.0f); + } + + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.5f, 7); + timedFunc_set_0(1.0f, func_80388F88); + func_80324E38(2.5f, 0); + timedFunc_set_1(2.5f, func_8028F9DC, 2); + timedFunc_set_3(2.5f, (TFQM3)func_802E4078, MAP_A_TTC_SANDCASTLE, 0, 0); + func_803228D8(); +} + +bool func_80389364(ActorMarker *marker){ + Actor *this = marker_getActor(marker); + + if(levelSpecificFlags_get(2)) + return TRUE; + + func_8025A70C(COMUSIC_2B_DING_B); + this->unk38_31++; + if(this->unk38_31 < 2) + return TRUE; + + levelSpecificFlags_set(2, TRUE); + levelSpecificFlags_set(5, TRUE); + func_80311480(0xa28, 0x2a, this->position, this->marker, func_80389288, NULL); + return TRUE; +} \ No newline at end of file diff --git a/src/TTC/code_3040.c b/src/TTC/code_3040.c new file mode 100644 index 00000000..31d0a08d --- /dev/null +++ b/src/TTC/code_3040.c @@ -0,0 +1,29 @@ +#include +#include "functions.h" +#include "variables.h" + +extern s32 D_80276CB0; + +/* .data */ +extern s32 D_8038C754; + +/* .bss */ +struct { + u8 pad0[4]; + s32 unk4; + u8 pad8[4]; + s32 unkC; +}D_8038D6F0; + +/* .code */ +void func_80389430(void){ + if(getGameMode() != GAME_MODE_7_ATTRACT_DEMO){ + func_8029CF48(2, 1, 0.0f); + } +} + +void func_80389468(void){ + if(D_8038D6F0.unk4 != D_8038C754 || D_8038D6F0.unkC != D_80276CB0){ + func_80389430(); + } +} diff --git a/src/TTC/code_35D0.c b/src/TTC/code_35D0.c new file mode 100644 index 00000000..4c00e545 --- /dev/null +++ b/src/TTC/code_35D0.c @@ -0,0 +1,245 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_80309724(f32[3]); +extern void func_8028F45C(s32, f32[3]); + +typedef struct { + s32 unk0; +}ActorLocal_TreasureHunt; + +void func_80389E90(Actor *this); +Actor *func_8038A0D0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +extern u32 D_8037DCB4; + +/* .data */ +f32 D_8038C820[6][3] = { + {2904.0f, 2458.0f, -7351.0f}, + {-7007.0f, 2013.0f, 401.0f}, + {-3388.0f, 1519.0f, 5939.0f}, + {1399.0f, 1519.0f, 6126.0f}, + {5953.0f, 1819.0f, 56.0f}, + {7667.0f, 717.0f, 1676.0f} +}; + +f32 D_8038C868[6] = { 300.0f, 180.0f, 220.0f, 270.0f, 330.0f, 255.0f}; +s32 D_8038C880[6] = {0x6E, 0xD2, 0x10E, 0x145, 0x14A, 0}; +s32 D_8038C898[6] = { + ACTOR_53_RED_ARROW, + ACTOR_53_RED_ARROW, + ACTOR_53_RED_ARROW, + ACTOR_53_RED_ARROW, + ACTOR_54_RED_QUESTION_MARK, + 0x46 +}; //enum actor_e + +ActorInfo D_8038C8B0 = { + MARKER_62_RED_ARROW, ACTOR_53_RED_ARROW, ASSET_3E9_MODEL_RED_ARROW, + 0, NULL, + func_80389E90, func_80326224, func_8038A0D0, + 0, 0x400, 0.0f, 0 +}; + +ActorInfo D_8038C8D4 = { + MARKER_63_RED_QUESTION_MARK, ACTOR_54_RED_QUESTION_MARK, ASSET_3EB_MODEL_RED_QUESTION_MARK, + 0, NULL, + func_80389E90, func_80326224, func_8038A0D0, + 0, 0x400, 0.0f, 0 +}; + +ActorInfo D_8038C8F8 = { + MARKER_64_RED_X, ACTOR_55_RED_X, ASSET_3EA_MODEL_RED_X, + 0, NULL, + func_80389E90, func_80326224, func_8038A0D0, + 0, 0x400, 0.0f, 0 +}; + +s32 D_8038C91C[3] = {160, 120, 20}; +struct31s D_8038C928 = { + {1.1f, 1.5f}, + {4.0f, 4.6f}, + {0.0f, 0.01f}, + {0.5f, 1.0f}, + 0.0f, 0.01f +}; + +struct42s D_8038C950 = { + {{-230.0f, 30.0f, -230.0f}, {230.0f, 110.0f, 230.0f}}, + {{-60.0f, 0.0f, -60.0f}, {60.0f, 30.0f, 60.0f}}, +}; + +/* .code */ +bool func_803899C0(void) { + enum comusic_e phi_a0; + s32 phi_a1; + + if (player_getActiveHitbox(0) == HITBOX_1_BEAK_BUSTER) { + phi_a0 = COMUSIC_2B_DING_B; + phi_a1 = 28000; + if (D_8037DCB4 == 5) { + phi_a0 = COMUSIC_2D_PUZZLE_SOLVED_FANFARE; + phi_a1 = 0x7FFF; + } + func_8025A6EC(phi_a0, phi_a1); + return TRUE; + } + return FALSE; +} + +void func_80389A1C(void) { + Actor *actor; + ActorLocal_TreasureHunt *local; + + actor = func_8032813C(0x55, D_8038C820[D_8037DCB4], 0); + local = (ActorLocal_TreasureHunt *)&actor->local; + actor->yaw = D_8038C868[D_8037DCB4]; + local->unk0 = D_8037DCB4; + actor->unk60 = 0.0f; + actor->state = 0; +} + +void func_80389A9C(void) { + Actor *actor; + ActorLocal_TreasureHunt *local; + s32 actor_id; + + actor = func_8032813C((D_8038C898 - 1)[D_8037DCB4], D_8038C820[D_8037DCB4 - 1], 0); + local = (ActorLocal_TreasureHunt *)&actor->local; + actor->yaw = D_8038C880[D_8037DCB4 - 1]; + local->unk0 = D_8037DCB4; + actor->unk60 = 0.0f; + actor->state = 0; +} + +void func_80389B38(s32 arg0){ + if(D_8037DCB4 == arg0 && func_803899C0()){ + if(arg0 == 0 && !jiggyscore_isCollected(JIGGY_11_TTC_RED_X)){ + func_80311480(0xA18, 4, NULL, NULL, NULL, NULL); + } + else if(arg0 == 4){ + func_80311480(0xA19, 4, NULL, NULL, NULL, NULL); + } + + D_8037DCB4++; + func_802C3BF8(func_80389A9C); + func_802C3BF8(func_80389A1C); + } +} + +void func_80389BFC(ActorMarker *this, ActorMarker *arg1){\ + func_80389B38(0); +} + +void func_80389C24(ActorMarker *this, ActorMarker *arg1){\ + func_80389B38(1); +} + +void func_80389C4C(ActorMarker *this, ActorMarker *arg1){\ + func_80389B38(2); +} + +void func_80389C74(ActorMarker *this, ActorMarker *arg1){\ + func_80389B38(3); +} + +void func_80389C9C(ActorMarker *this, ActorMarker *arg1){\ + func_80389B38(4); +} + +void func_80389CC4(s16 arg0[3], s32 arg1){ + static ParticleEmitter *D_8038D700; + static f32 D_8038D708[3]; + + if(D_8037DCB4 == 5 && func_803899C0()){ + D_8038D708[0] = (f32)arg0[0]; + D_8038D708[1] = (f32)arg0[1]; + D_8038D708[2] = (f32)arg0[2]; + D_8038D708[1] = func_80309724(D_8038D708); + func_802C3F04((GenMethod_4)func_802C4140, 0xF4, reinterpret_cast(s32, D_8038D708[0]), reinterpret_cast(s32, D_8038D708[1]), reinterpret_cast(s32, D_8038D708[2])); + D_8038D700 = partEmitList_pushNew(3); + func_802EFFA8(D_8038D700, D_8038C91C); + particleEmitter_setSprite(D_8038D700, ASSET_700_SPRITE_DUST); + particleEmitter_setStartingFrameRange(D_8038D700, 0, 7); + particleEmitter_setPosition(D_8038D700, D_8038D708); + particleEmitter_setPositionAndVelocityRanges(D_8038D700, &D_8038C950); + func_802EFB98(D_8038D700, &D_8038C928); + particleEmitter_emitN(D_8038D700, 5); + D_8038D708[2] += 300.0f; + func_80314AC8(0); + timedFunc_set_2(0.1f, (TFQM2) func_8028F45C, 9, (s32)&D_8038D708); + timedFunc_set_1(0.1f, (TFQM1) func_80314AC8, 1); + func_80311480(ASSET_A17_TEXT_BURIED_TREASURE_SPAWNED, 4, NULL, NULL, NULL, NULL); + D_8037DCB4++; + }//L80389E70 +} + +void func_80389E84(void){ + D_8037DCB4 = 0; +} + +void func_80389E90(Actor *this){ + f32 tick = time_getDelta(); + ActorLocal_TreasureHunt *local = (ActorLocal_TreasureHunt*)&this->local; + f64 tmp_f12; + + if(!this->initialized){ + actor_collisionOff(this); + this->marker->collidable = FALSE; + this->initialized = TRUE; + } + + switch(this->state){ + case 0://L80389F20 + this->unk60 = MIN(255.0, this->unk60 + tick*150.0); + if(255.0 == this->unk60){ + this->state = 1; + } + break; + case 1://L80389F94 + if(local->unk0 < D_8037DCB4){ + this->state = 2; + } + break; + case 2://L80389FC4 + this->unk60 = MAX(0.0, this->unk60 - tick*((this->marker->modelId == ASSET_3EA_MODEL_RED_X)? 200.0 : 150.0)); + if(0.0 == this->unk60) + marker_despawn(this->marker); + break; + }//L8038A094 + actor_setOpacity(this, (s32)this->unk60); + this->unk124_9 = 2; +} + +Actor *func_8038A0D0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + f32 sp4C[3]; + f32 sp40[3]; + f32 sp3C; + f32 sp38; + Actor *actor; + + actor = func_80325300(marker, sp4C); + switch(marker->modelId){ + case ASSET_3E9_MODEL_RED_ARROW://L8038A12C + sp3C = 1.0f; + sp38 = 8.0f; + break; + case ASSET_3EB_MODEL_RED_QUESTION_MARK: //L8038A14C + sp3C = 1.0f; + sp38 = 8.0f; + break; + case ASSET_3EA_MODEL_RED_X://L8038A164 + sp3C = (((ActorLocal_TreasureHunt *)&actor->local)->unk0 == 5)? 0.8f : 0.4f; + sp38 = 4.0f; + break; + }//L8038A1A0 + sp40[0] = actor->position[0]; + sp40[1] = actor->position[1] + sp38; + sp40[2] = actor->position[2]; + + func_8032AA58(actor, sp3C); + func_8033A2D4(func_803253A0, actor); + func_803391A4(gfx, mtx, sp40, sp4C, sp3C, NULL, func_80330B1C(marker)); + return actor; +} diff --git a/src/TTC/code_3E30.c b/src/TTC/code_3E30.c new file mode 100644 index 00000000..c492ead5 --- /dev/null +++ b/src/TTC/code_3E30.c @@ -0,0 +1,587 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "SnS.h" + +/* extern */ +extern void func_802D6310(f32, enum map_e, s32, s32, enum bkprog_e); + +/* .h */ +void func_8038B5B4(void); + + +typedef struct { + u8 *unk0; + u8 unk4; + u8 unk5; + s16 unk6; +} struct_ttc_3E30_s; + +typedef struct { + s16 unk0; + u8 unk2; + u8 unk3; + f32 unk4; +}Struct_TTC_3E30_1; + +typedef struct { + s16 unk0; + s16 unk2; +}Struct_TTC_3E30_2; + +s32 func_8038B778(void); + +extern s32 D_8038C980; +extern Struct_TTC_3E30_1 D_8038C984[]; +extern struct_ttc_3E30_s D_8038CA6C[]; +extern u8 D_8038CC78; +extern Struct_TTC_3E30_2 D_8038CC7C[]; +extern s32 D_8038CAD4; +extern struct_ttc_3E30_s D_8038CAD8[]; +extern u8 D_8038CF0C[] = "j4663n86pink"; +extern u8 D_8038CF1C[] = "knip68n3664j"; + + +extern struct{ + BKModel *unk0; + BKModel *unk4; + u8 unk8; + u8 unk9; + u8 unkA; + u8 padB[1]; + f32 unkC; + u8 unk10; +} D_8038D720; + + + +/* .code */ +void func_8038A220( s32 arg0, BKVtxRef *vtx_ref, Vtx *vtx, s32 arg2){ + vtx->v.ob[1] += 2; +} + +void func_8038A23C( s32 arg0, BKVtxRef *vtx_ref, Vtx *vtx, s32 arg2){ + vtx->v.ob[1] += 0xf0; +} + +void func_8038A258(s32 arg0) { + if (arg0 == 1) { + if (func_803203FC(2)) { + item_set(ITEM_0_HOURGLASS_TIMER, 3000 - 1); + } else { + item_set(ITEM_0_HOURGLASS_TIMER, 6000 - 1); + } + item_set(ITEM_6_HOURGLASS, TRUE); + } + if (D_8038D720.unk10 == 1) { + item_set(ITEM_6_HOURGLASS, FALSE); + } + D_8038D720.unk10 = arg0; +} + +Struct_TTC_3E30_1 *func_8038A2DC(s32 mesh_id) { + Struct_TTC_3E30_1 *i_ptr; + + for(i_ptr = D_8038C984; i_ptr->unk0 != 0; i_ptr++){ + if(i_ptr->unk0 == mesh_id){ + return i_ptr; + } + } + return NULL; +} + +void func_8038A328(void) { + Struct_TTC_3E30_1 *i_ptr; + + for(i_ptr = D_8038C984; i_ptr->unk0 != 0; i_ptr++){ + i_ptr->unk3 = 2; + i_ptr->unk4 = 0.0f; + } + mapSpecificFlags_set(1, FALSE); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038A37C.s") + +void func_8038A5D8(Struct_TTC_3E30_1 *arg0, s32 arg1) { + s32 temp_v0; + + temp_v0 = arg0->unk3; + arg0->unk3 = arg1; + arg0->unk4 = 0.0f; + if ((arg1 == 1) && (temp_v0 != arg1)) { + func_8025A6EC(COMUSIC_2C_BUZZER, 32000); + } +} + +#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038A618.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038A7DC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038AA2C.s") + +void func_8038AB44(void){ + D_8038C980 = func_8038B600(); +} + +u32 func_8038AB68(s32 arg0){ + if(func_8031FF1C(0xAC + arg0)){ + return 1 << arg0; + } + return 0; +} + +void func_8038ABA0(u32 arg0){ + int i; + func_80356520(0xC2); + if(arg0 & 0x400){ + func_80356560(0xC5); + } + func_803204E4(0x78, 0); + for(i = 4; i < 0xb; i++){ + if( arg0 & (1 << i)){ + func_803204E4(0x93 + i, TRUE); + func_803204E4(0x78, TRUE); + } + else{ + func_803204E4(0x93 + i, FALSE); + } + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038AC48.s") +#else +void func_8038AC48(Struct_TTC_3E30_1 *arg0) { + s32 sp3C; + s16 temp_a0; + s16 temp_v0; + s32 temp_s0; + s32 temp_s0_2; + s32 temp_s1; + s32 temp_s5; + s32 temp_t9; + s32 temp_v1; + s32 phi_s0; + u8 *phi_v0; + s32 phi_s0_2; + struct_ttc_3E30_s *phi_s2; + s32 phi_s1; + s32 phi_s7; + s32 phi_s1_2; + s32 phi_s1_3; + s32 phi_s7_2; + s32 phi_s1_4; + s32 phi_s1_5; + + temp_s5 = func_803203FC(2); + sp3C = func_8038BD10(arg0); + phi_s7 = 0; + for(phi_s2 = &D_8038CA6C; phi_s2->unk0 != 0; phi_s2++){ + phi_s0 = 1; + phi_s1_2 = 0; + if (D_8038D720.unk8 == 0) { + phi_s1_2 = 1; + } + phi_s1 = phi_s1_2; + phi_s1_5 = phi_s1_2; + if (temp_s5 == 0) { + do { + temp_s0 = phi_s0 + 1; + temp_s1 = phi_s1_5 | func_8038AB68(phi_s0); + phi_s0 = temp_s0; + phi_s1_4 = temp_s1; + phi_s1_5 = temp_s1; + } while (temp_s0 < 4); + phi_v0 = &D_8037DCC0; + phi_s0_2 = 0; + do { + phi_s1_3 = phi_s1_4; + if (*phi_v0 != 0) { + phi_s1_3 = phi_s1_4 | (0x10 << phi_s0_2); + } + temp_s0_2 = phi_s0_2 + 1; + phi_v0 += 1; + phi_s0_2 = temp_s0_2; + phi_s1 = phi_s1_3; + phi_s1_4 = phi_s1_3; + } while (temp_s0_2 != 7); + if (func_803203FC(0x78)) { + phi_s1 = phi_s1_3 | 0x800; + } + } + if ((phi_s2->unk4 & phi_s1) != 0) { + if ((func_8038BF68() != 0) && (temp_s5 == 0)) { + phi_s2->unk6 = 0; + func_8038A258(2); + } + temp_v0 = phi_s2->unk6; + if (arg0->unk2 == *(phi_s2->unk0 + temp_v0)) { + phi_s2->unk6 = (s16) (temp_v0 + 1); + if (func_8038BF68() != 0) { + phi_s2->unk6 = 0; + phi_s7_2 = 1; + } else { + if ((phi_s2->unk4 & 0xFFE) != 0) { + func_8038A258(2); + func_8038A5D8(arg0, 5); + } else { + func_8038A5D8(arg0, 3); + } + if (*(phi_s2->unk0 + phi_s2->unk6) == 0) { + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 32000); + if (temp_s5 != 0) { + item_set(ITEM_6_HOURGLASS, FALSE); + func_803204E4(3, 0); + func_803204E4(5, 1); + func_8038A258(2); + phi_s7_2 = 1; + } else { + temp_a0 = phi_s2->unk4; + if ((temp_a0 & 1) != 0) { + D_8038D720.unk8 = 2U; + D_8038D720.unkC = 0.0f; + mapSpecificFlags_set(1, TRUE); + func_80320004(0xFA, TRUE); + func_8030E2C4(D_8038D720.unk9); + func_8038A258(2); + } else if ((temp_a0 & 0xE) != 0) { + temp_t9 = (s32) (phi_s2 - &D_8038CA6C) >> 3; + func_8035644C(temp_t9 + 0xBD, 1); + temp_v1 = temp_t9 - 1; + switch (temp_v1) { /* irregular */ + default: + break; + case 0: + func_80346448(ITEM_D_EGGS); + func_802FAFAC(ITEM_D_EGGS, COMUSIC_C_EGG_COLLECTED); + break; + case 1: + func_80346448(ITEM_F_RED_FEATHER); + func_802FAFAC(ITEM_F_RED_FEATHER, COMUSIC_B_RED_FEATHER_COLLECTED); + break; + case 2: + func_80346448(ITEM_10_GOLD_FEATHER); + func_802FAFAC(ITEM_10_GOLD_FEATHER, COMUSIC_14_GOLD_FEATHER_COLLECTED); + break; + } + } else { + if ((temp_a0 & 0xFF0) != 0) { + func_8038ABA0(temp_a0, 1); + } + } + phi_s7_2 = 1; + } + } else { + func_8025A6EC(COMUSIC_2B_DING_B, 0x6D60); + phi_s7_2 = 1; + } + } + } else if (sp3C != 0) { + phi_s7_2 = 1; + } + } + if ((func_8038BF68() == 0) && (phi_s7 == 0) && (D_8038D720.unk8 == 0)) { + func_8038A5D8(arg0, 1); + } +} +#endif + + + +void func_8038AFC8(void){ + struct_ttc_3E30_s *iPtr; + + for(iPtr = D_8038CA6C; iPtr->unk0 != NULL; iPtr++){ + iPtr->unk6 = 0; + } + + if(func_803203FC(2)) + strcpy(D_8038CA6C[0].unk0, D_8038CF0C); + else + strcpy(D_8038CA6C[0].unk0, D_8038CF1C); + + func_8038B5B4(); +} + +void func_8038B04C(void){ + if(D_8038D720.unk0){ + func_8038A258(0); + func_8030DA44(D_8038D720.unk9); + func_8030DA44(D_8038D720.unkA); + } +} + +void func_8038B094(void){ + void *sp2C; + void *sp28; + + if( map_get() == MAP_7_TTC_TREASURE_TROVE_COVE + && levelSpecificFlags_get(0x2) + ){ + sp2C = func_8034C5AC(0x12C); + if(sp2C){ + func_8034E71C(sp2C, -600, 0.0f); + } + } + D_8038D720.unk0 = 0; + if(map_get() != MAP_A_TTC_SANDCASTLE){ + func_8038AB44(); + } + else{ + sp2C = func_8034C5AC(0x131); + sp28 = func_8034C5AC(0x12C); + if(levelSpecificFlags_get(5)){ + func_8034E71C(sp2C, -500, 10.0f); + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.0f, 1); + func_80324E88(2.0f); + func_80324E38(2.0f, 0); + func_803228D8(); + timedFunc_set_3(2.0f, (TFQM3) func_802E4078, MAP_7_TTC_TREASURE_TROVE_COVE, 1, 0); + } + else if(levelSpecificFlags_get(2) || func_803203FC(2)){ + func_8034E71C(sp2C, -500, 0.0f); + } + else{ + func_8034E71C(sp28, -500, 0.0f); + }//L8038B1EC + + D_8038D720.unk0 = func_80309744(0); + D_8038D720.unk4 = func_80309744(1); + D_8038D720.unk8 = 0; + D_8038D720.unk10 = 0; + D_8038D720.unkC = 0.0f; + + D_8038D720.unk9 = func_8030D90C(); + func_8030DBB4(D_8038D720.unk9, 0.1f); + sfxsource_setSfxId(D_8038D720.unk9, SFX_3EC_CCW_DOOR_OPENING); + func_8030DD14(D_8038D720.unk9, 3); + sfxsource_setSampleRate(D_8038D720.unk9, 28000); + + D_8038D720.unkA = func_8030D90C(); + sfxsource_setSfxId(D_8038D720.unkA, SFX_3_DULL_CANNON_SHOT); + func_8030DD14(D_8038D720.unkA, 3); + sfxsource_setSampleRate(D_8038D720.unkA, 0x7fff); + func_8038A328(); + func_8038AFC8(); + + if( jiggyscore_isCollected(JIGGY_10_TTC_SANDCASTLE) + && !func_803203FC(2) + ){ + func_8033F120(D_8038D720.unk4, 0x3C, func_8038A23C, 0); + D_8038D720.unk8 = 3; + }//L8038B2CC + func_8038AB44(); + func_8038B5B4(); + }//L8038B2E0 +} + +void func_8038B2F0(void) { + f32 sp2C[3]; + s32 mesh_id; + f32 sp24; + u8 temp_v0; + Struct_TTC_3E30_1 *temp_v0_3; + + sp24 = time_getDelta(); + if (func_8038B778() == 3) { + func_802C5A3C(-1); + } + if (D_8038D720.unk0 != 0) { + func_8038AA2C(); + player_getPosition(sp2C); + if ((D_8038D720.unk10 == 0) && func_803203FC(2) && func_803203FC(3)) { + func_8038A258(1); + } + if ((D_8038D720.unk10 == 1) && item_empty(ITEM_0_HOURGLASS_TIMER)) { + func_8038A258(2); + if (func_803203FC(2)) { + func_803204E4(3, FALSE); + func_803204E4(5, FALSE); + } else { + func_8028F66C(0xF); + } + } + if ((D_8038D720.unk8 == 0) || (D_8038D720.unk8 == 3)) { + if( (levelSpecificFlags_get(2) || func_803203FC(3)) + && (player_getActiveHitbox(0) == HITBOX_1_BEAK_BUSTER) + && func_8028F20C() + ) { + mesh_id = func_8033F3C0(D_8038D720.unk0, sp2C); + if (mesh_id != 0) { + temp_v0_3 = func_8038A2DC(mesh_id); + if ((temp_v0_3 != NULL) && ((temp_v0_3->unk3 == 2) || (D_8038D720.unk8 == 3))) { + func_8038AC48(temp_v0_3); + if ((D_8038D720.unk8 == 0) && (D_8038D720.unk10 == 0) && (func_803203FC(2) == 0)) { + func_8038A258(1); + } + } + } + } + } else if (D_8038D720.unk8 == 2) { + D_8038D720.unkC = (f32) (D_8038D720.unkC + sp24); + func_8033F120(D_8038D720.unk4, 0x3C, func_8038A220, 0); + if (D_8038D720.unkC > 4.0f) { + D_8038D720.unk8 = 3; + func_8030E2C4(D_8038D720.unkA); + func_8030E394(D_8038D720.unk9); + } + } + } +} + +bool func_8038B550(void){ + return NOT(D_8038D720.unk8 < 2); +} + +void func_8038B564(s32 arg0, s32 arg1, enum map_e map_id, s32 arg3, s32 arg4){ + if(arg1 == D_8038CAD8[arg0].unk5){ + func_802D6310(1.0f, map_id, arg3, arg4, 0); + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038B5B4.s") +#else +void func_8038B5B4(void) { + s32 i; + + for(i = 0; D_8038CAD8[i].unk0 != NULL; i++){ + D_8038CAD8[i].unk4 = 0; + } + D_8038CC78 = 0; + func_8038AB44(); +} +#endif + + +#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038B600.s") + +void func_8038B6D4(s32 arg0, s32 arg1, s32 arg2, enum bkprog_e prog_id, s32 prog_val, s32 prog_bit_size, enum bkprog_e arg6){ + if( ((arg2 + 20 == D_8038CAD8[arg1].unk5) && func_803203FC(arg2)) + || arg0 == 3 + ){ + func_80320044(prog_id, prog_val, prog_bit_size); + if(arg6){ + func_80320004(arg6, TRUE); + } + } +} + +void func_8038B750(s32 arg0){ + func_80320044(0xfd, arg0, 2); +} + +s32 func_8038B778(void){ + return func_8031FF44(0xFD, 2); +} + +void func_8038B79C(s32 arg0, s32 arg1, s32 arg2, enum item_e item_id, s32 item_diff, s32 item_val) { + if (((arg2 + 0x14) == D_8038CAD8[arg1].unk5) || (arg0 == 1)) { + if (item_diff != 0) { + func_803463D4(item_id, item_diff); + return; + } + item_set(item_id, item_val); + } +} + +void func_8038B800(s32 arg0) { + struct_ttc_3E30_s *sp30; + s32 sp38; + + sp30 = &D_8038CAD8[arg0]; + sp38 = sp30->unk5 - 0x14; + sns_set_item_and_update_payload(sp30->unk5, 1, 1); + func_8038B564(arg0, 1, MAP_61_CCW_WINTER_NABNUTS_HOUSE, 0x83, 0x1B); + func_8038B564(arg0, 2, MAP_3F_RBB_CAPTAINS_CABIN, 0x84, 0x1C); + func_8038B564(arg0, 3, MAP_2C_MMM_BATHROOM, 0x85, 0x1D); + func_8038B564(arg0, 4, MAP_12_GV_GOBIS_VALLEY, 0x86, 0x1E); + func_8038B564(arg0, 5, MAP_7_TTC_TREASURE_TROVE_COVE, 0x87, 0x1F); + func_8038B564(arg0, 6, MAP_1D_MMM_CELLAR, 0x88, 0x20); + func_8038B564(arg0, 7, MAP_7F_FP_WOZZAS_CAVE, 0x89, 0x21); + if (sp30->unk5 >= 0x14) { + func_8030E58C(SFX_2B_BULL_MOO_1, 1.5f); + func_803204E4(0x65, 1); + func_803204E4(sp38, 1); + } + func_8038B6D4(0, arg0, 0x6C, 0x60, 5, 3, 0x33); + func_8038B6D4(0, arg0, 0x6D, 0x63, 7, 3, 0x34); + func_8038B6D4(0, arg0, 0x6E, 0x66, 8, 4, 0x35); + func_8038B6D4(0, arg0, 0x6F, 0x6A, 9, 4, 0x36); + func_8038B6D4(0, arg0, 0x70, 0x6E, 0xA, 4, 0x37); + func_8038B6D4(0, arg0, 0x71, 0x72, 0xC, 4, 0x38); + func_8038B6D4(0, arg0, 0x72, 0x76, 0xF, 4, 0x39); + func_8038B79C(0, arg0, 0x94, ITEM_15_HEALTH_TOTAL, 0, 8); + func_8038B79C(0, arg0, 0x77, ITEM_14_HEALTH, 0, item_getCount(ITEM_15_HEALTH_TOTAL)); + func_8038B79C(0, arg0, 0x95, ITEM_1C_MUMBO_TOKEN, 0, 99); + if (sp38 == 0x81) { + func_80320004(0x53, 1); + func_80320004(0x54, 1); + } + func_8038B5B4(); +} + +void func_8038BB10(ActorMarker *caller, enum asset_e text_id, s32 arg2) { + if (arg2 == 1) { + func_8038B750(3); + func_8038B800(D_8038CAD4); + func_80311480(0xFBF, 0xC, NULL, NULL, NULL, NULL); + func_8033D0FC(func_802C5A30()); + func_8033CFD4(func_802C5A30()); + func_802C5A3C(-1); + return; + } + func_8038B5B4(); +} + +void func_8038BBA0(s32 arg0) { + s32 i; + + if ((s32) D_8038CAD8[arg0].unk5 >= 0x14) { + if (func_803203FC(D_8038CAD8[arg0].unk5 - 0x14)) { + func_8038B5B4(); + return; + } + for( i = 0; D_8038CC7C[i].unk0 != 0; i++){ + if ((D_8038CAD8[arg0].unk5 >= D_8038CC7C[i].unk0) && (D_8038CC7C[i].unk2 >= D_8038CAD8[arg0].unk5)) { + switch (func_8038B778()) { + case 0: + func_8038B750(1); + func_8038B800(arg0); + func_8038B5B4(); + return; + case 1: + func_8038B750(2); + func_8038B800(arg0); + func_8038B5B4(); + func_80311480(0xFBE, 0xC, NULL, NULL, NULL, NULL); + return; + case 2: + D_8038CAD4 = arg0; + func_80311480(0xE38, 0xC, NULL, NULL, func_8038BB10, NULL); + return; + } + return; + } + } + } + func_8038B800(arg0); + func_8038B5B4(); +} + +extern f32 D_8038D68C; +extern f32 D_8038D690; + +bool func_8038BD10(Struct_TTC_3E30_1 *arg0); +#pragma GLOBAL_ASM("asm/nonmatchings/TTC/code_3E30/func_8038BD10.s") + +bool func_8038BF68(void){ + return *(u8*)(D_8038CAD8[0].unk4 + (s32)D_8038CAD8[0].unk0) == 0; +} + + +int ttc_func_8038BF8C(void){ + return func_8038B600() == D_8038C980; +} diff --git a/src/core1/audio/n_adpcm.c b/src/core1/audio/n_adpcm.c new file mode 100644 index 00000000..c6686ea3 --- /dev/null +++ b/src/core1/audio/n_adpcm.c @@ -0,0 +1,7 @@ +#include +#include "n_synth.h" +//see libultre src/audio/load.c + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/audio/n_adpcm/_n_decodeChunk.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/audio/n_adpcm/n_alAdpcmPull.s") diff --git a/src/core1/audio/n_csplayer.c b/src/core1/audio/n_csplayer.c new file mode 100644 index 00000000..d8347220 --- /dev/null +++ b/src/core1/audio/n_csplayer.c @@ -0,0 +1,20 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/audio/n_csplayer/func_8025D7C0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/audio/n_csplayer/func_8025D830.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/audio/n_csplayer/func_8025D838.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/audio/n_csplayer/func_8025D840.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/audio/n_csplayer/func_8025DA30.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/audio/n_csplayer/func_8025E430.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/audio/n_csplayer/__n_CSPVoiceHandler.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/audio/n_csplayer/n_alCSPNew.s") diff --git a/src/core1/code_0.c b/src/core1/code_0.c new file mode 100644 index 00000000..81bfeb40 --- /dev/null +++ b/src/core1/code_0.c @@ -0,0 +1,224 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "gc/gctransition.h" + + +void func_8023E00C(s32); +void func_8023DFF0(s32); + + +extern s32 D_80275610; +extern u32 D_80275618; + +/* .bss */ +u32 D_8027A130; +u8 pad_8027A138[0x400]; +u64 D_8027A538; +u8 pad_8027A540[0x17F8]; +OSThread D_8027BD38; +s32 D_8027BEE8; +s32 D_8027BEEC; +u64 D_8027BEF0; + +extern u8 D_80286F90; + +extern u8 D_803A5D00[2][0x1ECC0]; + +void func_8023DA20(s32 arg0){ + bzero(&D_8027A130, &D_80286F90 - (u8*)&D_8027A130); + osWriteBackDCacheAll(); + sns_find_and_parse_payload(); + osInitialize(); + func_80240BE0(); +} + +void func_8023DA74(void){ + func_8033BD6C(); + func_80255198(); //heap_flush_free_queue +} + +void func_8023DA9C(s32 arg0){ + func_80254008(); + func_8024C428(); + if (D_8027A130 == 4){ + func_802E3580(); + } + if (D_8027A130 == 3){ + func_802E4170(); + } + func_8023DA74(); + D_8027A130 = arg0; + if (D_8027A130 == 3){ + func_802E4214(D_8027BEE8); + } + if (D_8027A130 == 4){ + func_802E35D0(); + } + func_80255CD8(); +} + +u32 func_8023DB4C(u32 arg0){ + return D_80275618 & arg0; +} + +s32 func_8023DB5C(void){ + return D_80275618; +} + +void func_8023DB68(void){ + D_80275618 = 0; +} + +s32 func_8023DB74(void){ + return (DEBUG_use_special_bootmap())? MAP_80_GL_FF_ENTRANCE : MAP_91_FILE_SELECT; +} + +s32 func_8023DBA4(void){ + return MAP_1F_CS_START_RAREWARE; +} + +void func_8023DBAC(void){ + func_8023E00C(func_8023DBA4()); + func_8023DFF0(3); +} + +void func_8023DBDC(void){ + func_8023E00C(func_8023DB74()); + func_8023DFF0(3); +} + +void func_8023DC0C(void){ + func_80255C30(); + func_8023E00C(func_8023DBA4()); + rarezip_init(); //initialize decompressor's huft table + func_8024BE30(); + func_80251308(); + D_8027BEF0 = D_8027A538; + heap_init(); + func_80254028(); + func_8025AFB0(); + func_8033EF58(); + func_8033BB84(); + func_8024F05C(); + func_80250C84(); + func_8023FB1C(); + func_8025425C(); + func_80257424(); + gctransition_reset(); + D_8027A130 = 0; + D_80275618 = 0; + func_8023DA9C(3); +} + +void func_8023DCDC(void){ + D_80275618++; +} + +void func_8023DCF4(void){ + D_80275618--; +} + + + +#ifndef NOMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_0/func_8023DD0C.s") +#else +void func_8023DD0C(void){ + s32 x; + s32 y; + s32 r; + s32 g; + s32 b; + + if((func_8023DB5C() & 0x7f) == 0x11) + sns_write_payload_over_heap(); + func_8023DA74(); + + if(D_8027A130 != 3 || getGameMode() != GAME_MODE_4_PAUSED) + func_8023DCDC(); + + if(!D_8027BEEC) + func_8024E7C8(); + D_8027BEEC = 0; + func_80250C08(); + + if(!mapSpecificFlags_validateCRC1()){ + write_file_blocks(0, 0, 0x80397AD0, 0x40); + } + + switch(D_8027A130){ + case 4: + func_802E35D8(); + break; + case 3: + func_80255524(); + func_80255ACC(); + func_802C3A18(); + if(func_802E4424()) + func_802E3F8C(0); + func_802C3A38(); + break; + }//L8023DE34 + + if(D_80275610){ + func_8023DA9C(D_80275610 - 1); + D_80275610 = 0; + }//L8023DE54 + if( !func_8032056C() + || !levelSpecificFlags_validateCRC1() + || !func_80320240() + ){ + //render weird CRC failure image + for(x= 0x1e; x< D_8027658C - 0x1e; x++){//L8023DEB4 + for(y = 0x14; y < 0xeb; y++){ + b = ((func_8023DB5C() << 3) + y*y + x*x) >> 3; + g = x >> 3; + r = y >> 3; + *(u16*)&D_803A5D00[1][((D_80276588 - 0xff)/2 + y + x*D_80276588)*2] = + *(u16*)&D_803A5D00[0][((D_80276588 - 0xff)/2 + y + x*D_80276588)*2] = + _SHIFTL(b, 1, 5) + | _SHIFTL(g, 6, 5) + | _SHIFTL(r, 11, 5) + | _SHIFTL(1, 0, 1 ) + ; + } + } + }//L8023DF70 +} +#endif + +void func_8023DF9C(void *arg0){ + func_8023DC0C(); + sns_write_payload_over_heap(); + while(1){ //main loop + func_8023DD0C(); + } +} + +void func_8023DFF0(s32 arg0){ + D_80275610 = arg0 + 1; +} + +s32 func_8023E000(void){ + return D_8027A130; +} + +void func_8023E00C(s32 arg0){ + D_8027BEE8 = arg0; +} + +void func_8023E018(void){ + // 5th argument should be a pointer to the end of an array, but the start is unknown + // D_8027A538 is not the right symbol, but the end of the array is the important port and this is the closest symbol currently + osCreateThread(&D_8027BD38, 6, func_8023DF9C, NULL, ((u8*)&D_8027A538) + 0x1800, 0x14); +} + +OSThread *func_8023E060(void){ + return &D_8027BD38; +} + +void func_8023E06C(void){ + D_8027BEEC = 1; +} \ No newline at end of file diff --git a/src/core1/code_11AC0.c b/src/core1/code_11AC0.c new file mode 100644 index 00000000..be0886b4 --- /dev/null +++ b/src/core1/code_11AC0.c @@ -0,0 +1,498 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "music.h" + +extern void func_8025F570(ALCSPlayer *, u8); +extern void func_8025F510(ALCSPlayer *, u8, u8); +extern void func_8025F5C0(ALCSPlayer *, u8); + +extern ALBankFile D_EA3EB0; +extern ALWaveTable D_EADE60; + +/* dependent functions */ +void func_8024FA98(u8, enum comusic_e); +void func_8024FD28(u8, s16); +int func_80250074(u8); +u8 func_8025F4A0(ALCSPlayer *, u8); + +void func_8025F3F0(ALCSPlayer *, f32, f32); +u16 func_80250474(s32 arg0); +void func_8024AF48(void); +void func_8024FB8C(void); + +/* .data */ +extern MusicTrackMeta D_80275D40[0xB0]; +extern s32 D_802762C0; +extern s32 D_802762C4; + +/* .rodata */ +extern f32 D_80278180; +extern f32 D_80278184; + + +/* .data */ +MusicTrack D_80281720[6]; +MusicTrack **D_802820E0; +ALSeqpConfig D_802820E8; +u16 D_80282104; //called as u16 someplaces and s16 others +ALBank * D_80282108; +structBs D_80282110[0x20]; + + + +/* .rodata */ + +/* .code */ +void func_8024F4E0(void){ + s32 size; + ALBankFile * bnk_f; //sp38 + s32 i; + f32 tmpf1; + + size = (u8*)&D_EADE60 - (u8*)&D_EA3EB0; + bnk_f = malloc(size); + osWriteBackDCacheAll(); + osPiStartDma(func_802405D0(), 0, 0, &D_EA3EB0, bnk_f, size, func_802405C4()); + osRecvMesg(func_802405C4(), 0, 1); //osRecvMesg + D_80282104 = 0xAD; + D_802820E0 = (MusicTrack **) malloc(D_80282104 * sizeof(MusicTrack *)); + for(i = 0; i < D_80282104; i++){ + D_802820E0[i] = NULL; + } + D_802820E8.maxVoices = 0x18; + D_802820E8.maxEvents = 0x55; + D_802820E8.maxChannels = 0x10; + D_802820E8.heap = func_802405B8(); + D_802820E8.initOsc = NULL; + D_802820E8.updateOsc = NULL; + D_802820E8.stopOsc = NULL; + func_8023FA64(&D_802820E8); + for(i = 0; i < 6; i++){ + n_alCSPNew(&D_80281720[i].cseqp, &D_802820E8); //alCSPNew + } + + alBnkfNew(bnk_f, (u8 *)&D_EADE60); + D_80282108 = bnk_f->bankArray[0]; + for(i = 0; i < 6; i++){ + alCSPSetBank(&D_80281720[i].cseqp, D_80282108); + } + + for(i = 0; i < 6; i++){ + D_80281720[i].unk2 = 0; + D_80281720[i].unk3 = 0; + D_80281720[i].index_cpy = 0; + D_80281720[i].unk17C = 0.0f; + D_80281720[i].unk180 = 1.0f; + } + func_8024FB8C(); +} + +ALBank *func_8024F758(void){ + return D_80282108; +} + +void func_8024F764(s32 arg0){//music track load + if(D_802820E0[arg0] == NULL){ + func_8033B788(); + D_802820E0[arg0] = assetcache_get(arg0 + 0x1516); + } +} + +void func_8024F7C4(s32 arg0){ + s32 i; + if(D_802820E0[arg0] != NULL){ + i = 0; + for(i = 0; i != 6; i++){ + if(D_80281720[i].index == arg0) + return; + } + assetcache_release(D_802820E0[arg0]); + D_802820E0[arg0] = 0; + } +} + +void func_8024F83C(void){ + s32 i; + for(i = 0; i < D_80282104; i++){ + func_8024F7C4(i); + } +} + +void func_8024F890(u8 arg0, enum comusic_e arg1){ + s32 i; + if(arg1 == -1){ + if(arg1 != D_80281720[arg0].index) + alCSPStop(&D_80281720[arg0].cseqp); + D_80281720[arg0].index = arg1; + + } + else{ + if(-1 != D_80281720[arg0].index){ + func_8024F890(arg0, -1); + } + D_80281720[arg0].unk2 = 0; + D_80281720[arg0].unk3 = 0; + D_80281720[arg0].index = arg1; + for(i = 0; i < 0xe; i++){ + D_80281720[arg0].unk184[i] = 0; + D_80281720[arg0].unk192[i] = 0; + } + func_8024F764(D_80281720[arg0].index); + n_alCSeqNew(&D_80281720[arg0].cseq, D_802820E0[D_80281720[arg0].index]); + + D_80281720[arg0].cseqp.chanMask = func_80250474(arg0); + alCSPSetSeq(&D_80281720[arg0].cseqp, &D_80281720[arg0].cseq); + alCSPPlay(&D_80281720[arg0].cseqp); + alCSPSetVol(&D_80281720[arg0].cseqp, D_80281720[arg0].unk0); + if(player_is_present() && func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + func_8025F3F0(&D_80281720[arg0].cseqp, 0.0f, 1.0f); + } + else{ + func_8025F3F0(&D_80281720[arg0].cseqp, D_80281720[arg0].unk17C, D_80281720[arg0].unk180); + } + } +} + +s32 func_8024FA6C(u8 arg0){ + return D_80281720[arg0].index; +} + +void func_8024FA98(u8 arg0, enum comusic_e arg1){ + s32 sp2C; + s32 sp24; + volatile s64 sp20; + + sp2C = D_80281720[arg0].index; + if(arg1 == sp2C || sp2C == -1){ + func_8024F890(arg0, arg1); + }else{ + func_8024F890(arg0, -1); + sp20 = osGetTime(); + while(D_80281720[arg0].cseqp.state != AL_STOPPED){ + osGetTime(); + }; + func_8024F7C4(sp2C); + func_8024F890(arg0, arg1); + } +} + +s32 func_8024FB60(u8 arg0){ + return D_80281720[arg0].cseqp.state; +} + +void func_8024FB8C(void){ + s32 i, allStopped; + volatile s64 sp2C; + + for(i = 0; i < 6; i++){ + func_8024F890(i,-1); + } + sp2C = osGetTime(); + + do{ + allStopped = 0; + for(i = 0; i < 6; i++){ + if(func_8024FB60(i) != AL_STOPPED) + allStopped++; + } + osGetTime(); + }while(allStopped); + +} + +void func_8024FC1C(u8 arg0, enum comusic_e arg1){ + D_80281720[arg0].index_cpy = arg1; + D_80281720[arg0].unk2 = 1; + D_80281720[arg0].unk3 = 0; + D_80281720[arg0].unk0 = D_80275D40[arg1].unk4; +} + +void func_8024FC6C(u8 arg0){ + s32 indx; + indx = D_80281720[arg0].index; + if(indx == 0x2D || indx == 0x3D){ + D_80281720[arg0].unk2 = 1; + D_80281720[arg0].unk3 = 0; + D_80281720[arg0].index_cpy = D_80281720[arg0].index; + }else{ + D_80281720[arg0].index_cpy = -1; + D_80281720[arg0].unk3 = 1; + D_80281720[arg0].unk2 = 1; + D_80281720[arg0].unk0 = 0; + } +} + +void func_8024FCE0(u8 arg0, s16 arg1){ + D_80281720[arg0].unk3 = 1; + D_80281720[arg0].unk2 = 1; + D_80281720[arg0].unk0 = arg1; + D_80281720[arg0].index_cpy = D_80281720[arg0].index; +} + +//musicTrack_setVolume +void func_8024FD28(u8 arg0, s16 arg1){ + D_80281720[arg0].unk0 = arg1; + alCSPSetVol(&D_80281720[arg0].cseqp, arg1); + if(D_80281720[arg0].unk3 && arg1){ + func_8024FCE0(arg0, arg1); + } + else if(!D_80281720[arg0].unk3 && arg1 == 0){ + if(func_80250074(arg0) == 0) + func_8024FC6C(arg0); + } +} + +//musicTrack_setTempo +void func_8024FDDC(u8 arg0, s32 tempo){ + if(func_80250074(arg0) == 0){ + if(!D_80281720[arg0].unk2){ + alCSPSetTempo(&D_80281720[arg0].cseqp, tempo); + } + } +} + +void func_8024FE44(u8 arg0, f32 arg1, f32 arg2){ + D_80281720[arg0].unk17C = arg1; + D_80281720[arg0].unk180 = arg2; + if(func_80250074(arg0) == 0){ + if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + func_8025F3F0(&D_80281720[arg0].cseqp, 0.0f, 1.0f); + }else{ + func_8025F3F0(&D_80281720[arg0].cseqp, arg1, arg2); + } + } +} + +void func_8024FEEC(u8 arg0){ + alCSeqGetTicks(&D_80281720[arg0].cseq); +} + +void func_8024FF34(void){ + s32 i; + + for(i = 0; i < 6 ; i++){ + switch(D_80281720[i].cseqp.state){ + case AL_PLAYING://L8024FF94 + if(D_80281720[i].unk2){ + alCSPStop(&(D_80281720[i].cseqp)); + + if(D_80281720[i].unk3) + D_80281720[i].unk2 = 0; + } + break; + + case AL_STOPPED: //L8024FFBC + if(D_80281720[i].unk2){ + if(D_80281720[i].unk3){ + alCSPPlay(&D_80281720[i].cseqp); + } else{ + func_8024FA98(i, D_80281720[i].index_cpy); + } + D_80281720[i].unk3 = 0; + D_80281720[i].unk2 = 0; + func_8024FD28(i, D_80281720[i].unk0); + } + break; + case AL_STOPPING: //L80250008 + break; + } + } +} + +s32 func_80250034(enum comusic_e track_id){ + return D_80275D40[track_id].unk4; +} + +void func_80250048(enum comusic_e track_id, u16 arg1){ + D_80275D40[track_id].unk4 = arg1; +} + +//song_getName +char *func_80250060(enum comusic_e track_id){ + return D_80275D40[track_id].name; +} + +int func_80250074(u8 arg0){ + return (D_80281720[arg0].cseqp.state == AL_STOPPED && D_80281720[arg0].unk3 == 0); +} + +s32 func_802500C0(void){ + return *(s16 *)&D_80282104; +} + +ALCSPlayer *func_802500CC(s32 arg0){ + return &D_80281720[arg0].cseqp; +} + +void func_802500F4(s32 arg0){} + +void func_802500FC(s32 arg0){} + +void func_80250104(ALCSeq *arg0, s32 arg1, s32 arg2){ + u8 i; + for(i = 0; i < 6; i++){ + if(arg0 == &D_80281720[i].cseq){ + D_80281720[i].unk184[arg1 - 0x6A] = 1; + D_80281720[i].unk192[arg1 - 0x6A] = arg2; + return; + } + } +} + +void func_80250170(u8 arg0, s32 arg1, s32 arg2){ + D_80281720[arg0].unk184[arg1 - 0x6A] = arg2; +} + +s32 func_802501A0(u8 arg0, s32 arg1, s32 *arg2){ + if(arg2 != 0){ + *arg2 = D_80281720[arg0].unk192[arg1 - 0x6A]; + } + return D_80281720[arg0].unk184[arg1 - 0x6A]; +} + +void func_80250200(s32 arg0, s16 chan, s16 arg2, f32 arg3){ + s32 i; + ALCSPlayer *sp28; + f32 tmpf; + s32 mask; + + sp28 = func_802500CC(arg0); + mask = osSetIntMask(OS_IM_NONE); + tmpf = (!func_80250074(arg0))? func_8025F4A0(sp28, chan) :127.0f; + + if(arg3 < D_80278180){ + arg3 = D_80278180; + } + + for(i = 0; i< 0x20; i++){ + if( (D_80282110[i].unk8 == D_80282110[i].unk10) + || (D_80282110[i].unk0 == arg0 && chan ==D_80282110[i].chan) + ){ + D_80282110[i].unk0 = arg0; + D_80282110[i].chan = chan; + D_80282110[i].unk8 = tmpf; + D_80282110[i].unkC = (arg2 - tmpf)/((arg3 * 60.0f)/2); + D_80282110[i].unk10 = arg2; + osSetIntMask(mask); + return; + } + } + osSetIntMask(mask); +} + +void func_80250360(s32 arg0, s32 arg1, f32 arg2){ + ALCSPlayer * sp24; + s32 i; + s32 sp1C; + f32 tempo; + + sp24 = func_802500CC(arg0); + sp1C = osSetIntMask(1); + tempo = alCSPGetTempo(sp24); + if( arg2 < D_80278184){ + arg2 = D_80278184; + } + for(i = 0; i < 0x20; i++){ + if(D_80282110[i].unk8 == D_80282110[i].unk10 + || (D_80282110[i].unk0 == arg0 && -1 ==D_80282110[i].chan) + ){ + D_80282110[i].unk0 = arg0; + D_80282110[i].chan = -1; + D_80282110[i].unk8 = tempo; + D_80282110[i].unkC = (arg1 - tempo)/((arg2 * 60.0f)/2); + D_80282110[i].unk10 = arg1; + osSetIntMask(sp1C); + return; + } + } + osSetIntMask(sp1C); +} + +u16 func_80250474(s32 arg0){ + ALCSPlayer * sp24; + s32 i; + s32 sp1C; + f32 tmpf; + + + if(arg0 != 0) + return ~0; + D_802762C0 = (D_802762C4 = -1); + sp1C = osSetIntMask(1); + for(i = 0; i < 0x20; i++){ + D_80282110[i].unk8 = -1.0f; + D_80282110[i].unk10 = -1.0f; + } + osSetIntMask(sp1C); + func_8024AF48(); + if(D_802762C0 == -1){ + D_802762C0 = 0xFFFF; + } + return D_802762C0; + +} + +void func_80250530(s32 arg0, u16 chan_mask, f32 arg2){ + s32 chan; + if(D_802762C0 != chan_mask){ + if(D_802762C0 == -1){ + arg2 = 0.0f; + } + D_802762C0 = chan_mask; + for(chan = 0; chan < 16; chan++){ + if(chan_mask & (1 << chan)){ + func_80250200(arg0, chan, 0x7F, arg2); + } + else{ + func_80250200(arg0, chan, 0, arg2); + } + } + }//L802505E4 +} + +void func_80250604(s32 arg0, s32 arg1, f32 arg2){ + if(arg1 != D_802762C4){ + if(D_802762C4 == -1){ + arg2 = 0.0f; + } + D_802762C4 = arg1; + func_80250360(arg0, arg1, arg2); + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_11AC0/func_80250650.s") +#else +void func_80250650(void) { + ALCSPlayer *csplayer; + s32 i; + s32 mask; + + for(i = 0; i < 0x20; i++){ + csplayer = func_802500CC(D_80282110[i].unk0); + if ((D_80282110[i].unk8 != D_80282110[i].unk10) && (func_80250074((u8)D_80282110[i].unk0) == 0)) { + if (D_80282110[i].unkC >= 0.0f) { + D_80282110[i].unk8 = MIN(D_80282110[i].unk8 + D_80282110[i].unkC, D_80282110[i].unk10); + } else { + D_80282110[i].unk8 = MAX(D_80282110[i].unk8 + D_80282110[i].unkC, D_80282110[i].unk10); + } + if (D_80282110[i].chan == -1) { + alCSPSetTempo(csplayer, (s32) D_80282110[i].unk8); + } else { + func_8025F510(csplayer,D_80282110[i].chan, D_80282110[i].unk8); + if ((csplayer->chanMask) & (1U << D_80282110[i].chan)) { + if (D_80282110[i].unk8 == 0.0) { + func_8025F5C0(csplayer, D_80282110[i].chan); + } + } else { + if (D_80282110[i].unk8 != 0.0f) { + func_8025F570(csplayer, D_80282110[i].chan); + } + } + } + } + } +} +#endif diff --git a/src/core1/code_12F10.c b/src/core1/code_12F10.c new file mode 100644 index 00000000..37de28df --- /dev/null +++ b/src/core1/code_12F10.c @@ -0,0 +1,176 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_8024F35C(s32); + +extern f64 D_80278190; + + +OSMesgQueue D_80282390; +OSMesg D_802823A8; +s32 D_802823AC; +s32 D_802823B0; +OSMesgQueue *D_802823B4; +OSPfs D_802823B8; +f32 D_80282420; +f32 D_80282424; +f32 D_80282428; +f32 D_8028242C; +OSThread D_80282430; +u8 pad_D_80282430[0x200]; + +/* .code */ +void func_80250D94(f32, f32, f32); + +void func_80250890(void){ + u32 motor_status; + + if(D_802823B0){ + func_8024F35C(4); + motor_status = osMotorStart(&D_802823B8); + D_802823B0 = (motor_status == 0); + func_8024F35C(0); + } +} + +void func_802508E0(void){ + u32 motor_status; + + if(D_802823B0){ + func_8024F35C(4); + motor_status = osMotorStop(&D_802823B8); + D_802823B0 = (motor_status == 0); + func_8024F35C(0); + } +} + +void func_80250930(void){ + u32 motor_status; + + if(!D_802823B0){ + func_8024F35C(4); + motor_status = osMotorInit(D_802823B4, &D_802823B8, 0); + D_802823B0 = (motor_status == 0); + func_8024F35C(0); + } +} + +void func_8025098C(void *arg0) { + static s32 D_802827E0; + static s32 D_802827E4; + f32 temp_f2; + f32 temp_f0; + f32 temp_f12; + f32 temp_f14; + s32 temp_a0; + s32 var_v0; + s32 var_v1; + + do{ + osRecvMesg(&D_80282390, NULL, 1); + D_802827E0++; + if (!D_802823B0 && ((D_802827E0 % 60) == 0)) { + func_80250930(); + } + temp_a0 = D_802827E4; + if (D_80282424 != D_80282420) { + temp_f2 = D_80282428 + ((D_8028242C - D_80282428) * D_80282424 / D_80282420); + var_v0 = (s32) (((1.0 - temp_f2) * 8.0) + 1); + if (var_v0 < 2) { + D_802827E4 = var_v0; + } else { + D_802827E4 = (D_802827E0 % var_v0) == 0; + } + } else { + D_802827E4 = 0; + } + if (D_802827E4 != temp_a0) { + D_802827E4 = D_802827E4; + if (D_802827E4) { + func_80250890(); //start_motor + } + else{ + func_802508E0(); //stop_motor + } + } + }while(1); +} + +void func_80250BA4(s32 arg0, s32 arg1, s32 arg2){ + f64 f0 = 524288.0; + func_80250D94(arg0/f0, arg1/f0, arg2/f0); +} + +void func_80250C08(void) { + if (D_802823AC != 0) { + D_80282424 = MIN(D_80282420, D_80282424 + time_getDelta()); + } +} + +void func_80250C84(void){ + extern s32 D_802827E0; + s32 pfs_status; + + func_8024F35C(4); + D_802823B4 = func_8024F344(); + pfs_status = osPfsInit(D_802823B4, &D_802823B8, 0); + if(pfs_status == PFS_ERR_ID_FATAL || pfs_status == PFS_ERR_DEVICE){ + pfs_status = osMotorInit(D_802823B4, &D_802823B8, 0); + } + func_8024F35C(0); + D_802823AC = (pfs_status == 0); + D_802823B0 = D_802823AC; + if(D_802823AC){ + osCreateMesgQueue(&D_80282390, &D_802823A8, 1); + osCreateThread(&D_80282430, 8, func_8025098C, NULL, &D_802827E0, 0x19); + osStartThread(&D_80282430); + func_8024BDAC(&D_80282390, 0); + } +} + +void func_80250D8C(void){} + +void func_80250D94(f32 arg0, f32 arg1, f32 arg2){ + f32 f4; + if(arg2 != 0.0f && D_802823AC){ + if(func_802E4A08() == 0){ + if(!(D_80278190 < D_80282420 - D_80282424) || !(arg0 + arg1 < D_80282428 + D_8028242C)){ + D_80282420 = arg2; + D_80282424 = 0.0f; + D_80282428 = arg0; + D_8028242C = arg1; + } + } + } +} + +void func_80250E6C(f32 arg0, f32 arg1){ + func_80250D94(arg0, arg0, arg1); +} + +void func_80250E94(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5){ + + if(D_802823AC){ + timedFunc_set_3(0.0f, (TFQM3) func_80250BA4, 0, (s32) (arg0 * 524288.0f), (s32) (arg2*524288.0f)); + timedFunc_set_3(arg2, (TFQM3) func_80250BA4, (s32) (arg0 * 524288.0f), (s32) (arg1 * 524288.0f), (s32) (arg3*524288.0f)); + timedFunc_set_3(arg2 + arg3, (TFQM3) func_80250BA4, (s32) (arg1 * 524288.0f), (s32) (arg1 * 524288.0f), (s32) (arg4*524288.0f)); + timedFunc_set_3(arg2 + arg3 + arg4, (TFQM3) func_80250BA4, (s32) (arg1 * 524288.0f), 0, (s32) (arg5*524288.0f)); + } +} + +void func_80250FC0(void){ + int i; + u32 motor_status; + if(D_802823B0){ + func_8024F35C(4); + motor_status = osMotorInit(D_802823B4, &D_802823B8, 0); + D_802823B0 = (motor_status == 0); + for(i=0; i < 3 && D_802823B0; i++){ + motor_status = osMotorStop(&D_802823B8); + D_802823B0 = (motor_status == 0); + } + func_8024F35C(0); + } +} diff --git a/src/core1/code_13640.c b/src/core1/code_13640.c new file mode 100644 index 00000000..48bce137 --- /dev/null +++ b/src/core1/code_13640.c @@ -0,0 +1,21 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8025108C(s32 arg0); + +/* .bss */ +s32 D_802827F0; + +/* .code */ +s32 func_80251060(void){ + return D_802827F0; +} + +void func_8025106C(void){ + func_8025108C(0); +} + +void func_8025108C(s32 arg0){ + D_802827F0 = arg0; +} diff --git a/src/core1/code_13680.c b/src/core1/code_13680.c new file mode 100644 index 00000000..a381154d --- /dev/null +++ b/src/core1/code_13680.c @@ -0,0 +1,35 @@ +#include +#include "functions.h" +#include "variables.h" + + +u32 func_802510A0(BKSprite *this){ + return this->unk8; +} + +u32 func_802510A8(BKSprite *this){ + return this->unkA; +} + +u32 func_802510B0(BKSprite *this){ + return this->unk6; +} + +u32 func_802510B8(BKSprite *this){ + return this->unk4; +} + +s32 spriteGetFrameCount(BKSprite *this){ + return this->frameCnt; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13680/spriteGetFramePtr.s") +// //NONMATCHING bad RegAlloc +/*BKSpriteFrame *spriteGetFramePtr(BKSprite *this, u32 frame){ + u32 f_data; + u32 *f_array = this + 1; + + + f_data = (u32)(f_array + this->frameCnt) + f_array[frame]; + return f_data; +}//*/ \ No newline at end of file diff --git a/src/core1/code_136D0.c b/src/core1/code_136D0.c new file mode 100644 index 00000000..f69cfef1 --- /dev/null +++ b/src/core1/code_136D0.c @@ -0,0 +1,153 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct struct_2a_s{ + char *name; + u32 ram_start; + u32 ram_end; + u32 unkC; //uncompressed_rom_range_start + u32 unk10; //uncompressed_rom_range_end + u32 code_start; + u32 code_end; + u32 data_start; + u32 data_end; + u32 bss_start; + u32 bss_end; +} struct2As; + +extern u8 D_80363590; +extern u8 D_80379B90; +extern u8 D_80286F90; +extern u8 D_803863F0; +extern u8 D_803A5D00; +extern u8 D_F55960; +extern u8 D_1048560; + + +extern struct2As D_802762D0[] = { + {"gs", 0x80286F90, 0x803863F0, 0x00F55960, 0x01048560, 0x80286F90, 0x80363590, 0x80363590, 0x80379B90, 0x80379B90, 0x803863F0}, + {"coshow", 0x803863F0, 0x80386430, 0x010BCD00, 0x010BCD20, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, + {"whale", 0x803863F0, 0x8038A000, 0x01048560, 0x0104C0E0, 0x803863F0, 0x80389AA0, 0x80389AA0, 0x80389F70, 0x80389F70, 0x8038A000}, + {"haunted", 0x803863F0, 0x8038C530, 0x01057710, 0x0105D7E0, 0x803863F0, 0x8038B9E0, 0x8038B9E0, 0x8038C4C0, 0x8038C4C0, 0x8038C530}, + {"desert", 0x803863F0, 0x80391B10, 0x0104C0E0, 0x01057710, 0x803863F0, 0x80390BD0, 0x80390BD0, 0x80391A20, 0x80391A20, 0x80391B10}, + {"beach", 0x803863F0, 0x8038D740, 0x0105D7E0, 0x01064AE0, 0x803863F0, 0x8038C3B0, 0x8038C3B0, 0x8038D6F0, 0x8038D6F0, 0x8038D740}, + {"jungle", 0x803863F0, 0x80389CA0, 0x01064AE0, 0x01068370, 0x803863F0, 0x80389890, 0x80389890, 0x80389C80, 0x80389C80, 0x80389CA0}, + {"swamp", 0x803863F0, 0x80391250, 0x01068370, 0x010731B0, 0x803863F0, 0x80390690, 0x80390690, 0x80391230, 0x80391230, 0x80391250}, + {"ship", 0x803863F0, 0x803912D0, 0x010731B0, 0x0107E030, 0x803863F0, 0x80390050, 0x80390050, 0x80391270, 0x80391270, 0x803912D0}, + {"snow", 0x803863F0, 0x803935F0, 0x0107E030, 0x0108AB50, 0x803863F0, 0x803919F0, 0x803919F0, 0x80392F10, 0x80392F10, 0x803935F0}, + {"tree", 0x803863F0, 0x8038FDF0, 0x010B3320, 0x010BCD00, 0x803863F0, 0x8038EB50, 0x8038EB50, 0x8038FDD0, 0x8038FDD0, 0x8038FDF0}, + {"training", 0x803863F0, 0x8038B330, 0x0108AB50, 0x0108FA80, 0x803863F0, 0x8038AAC0, 0x8038AAC0, 0x8038B320, 0x8038B320, 0x8038B330}, + {"intro", 0x803863F0, 0x8038E9F0, 0x0108FA80, 0x01098070, 0x803863F0, 0x8038D350, 0x8038D350, 0x8038E9E0, 0x8038E9E0, 0x8038E9F0}, + {"witch", 0x803863F0, 0x80395470, 0x01098070, 0x010A6FD0, 0x803863F0, 0x80392CB0, 0x80392CB0, 0x80395350, 0x80395350, 0x80395470}, + {"battle", 0x803863F0, 0x80392930, 0x010A6FD0, 0x010B3320, 0x803863F0, 0x80391380, 0x80391380, 0x80392740, 0x80392740, 0x80392930}, +}; +extern s32 D_80276564 = 15; + +enum overlay_e D_80282800; + +void func_802513A4(void); + +/* .code */ +struct2As *func_802510F0(void){ + //returns struct2As ptr with largest RAM size + int i; + struct2As * v1; + + v1 = &D_802762D0[1]; + for(i = 1; i < D_80276564; i++){ + if(v1->ram_end - v1->ram_start < D_802762D0[i].ram_end - D_802762D0[i].ram_start){ + v1 = &D_802762D0[i]; + } + } + return v1; +} + +s32 func_80251170(void){ + return 0; +} + +s32 func_80251178(void){ + int sp24; + struct2As *sp20; + s32 sp1C; + s32 sp18; + + + sp20 = func_802510F0(); + sp18 = func_802546DC(); + sp1C = func_80251170(); + + return ((sp1C + (u32)&D_803A5D00) - sp20->ram_end) + sp18; +} + +void func_802511C4(void){ + s32 sp24; + int sp20; + int sp1C; + int sp18; + u32 tmp_v0; + + sp24 = func_80251178(); + sp18 = heap_get_size(); + sp20 = func_802546DC(); + sp1C = sp18 - sp20; + + if(sp24 < 0){ + func_802513A4(); + tmp_v0 = sp1C + sp24; + while( tmp_v0 & 0xF){tmp_v0--;} + } +} + +int get_loaded_overlay_id(void){ + return D_80282800; +} + +int is_overlay_loaded(int overlay_id){ + return D_80282800 == overlay_id; +} + +//load_overlay +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_136D0/load_overlay.s") +#else +bool load_overlay(enum overlay_e overlay_id){ + struct2As *rom_info; + + if(overlay_id == 0) + return FALSE; + + if(overlay_id == D_80282800) + return FALSE; + + D_80282800 = overlay_id; + rom_info = &D_802762D0[D_80282800]; + func_80253050( + overlay_id, + rom_info->ram_start, rom_info->ram_end, + rom_info->unkC, rom_info->unk10, + rom_info->code_start, rom_info->code_end, + rom_info->data_start, rom_info->data_end, + rom_info->bss_start, rom_info->bss_end + ); + return TRUE; +} +#endif + +//clear_loaded_overlay_id +s32 func_802512FC(void){ + D_80282800 = 0; +} + +#ifdef NONMATCHING +void func_80251308(void){ + func_802512FC(); + func_80253050(0, &D_80286F90, &D_803863F0, &D_F55960, &D_1048560, &D_80286F90, &D_80363590, &D_80363590, &D_80379B90, &D_80379B90, &D_803863F0); + func_802511C4(); +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_136D0/func_80251308.s") +#endif + +void func_802513A4(void){} \ No newline at end of file diff --git a/src/core1/code_13990.c b/src/core1/code_13990.c new file mode 100644 index 00000000..fec223f3 --- /dev/null +++ b/src/core1/code_13990.c @@ -0,0 +1,387 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "ml/mtx.h" + +extern Mtx *D_80282FD0; +extern Mtx_t D_80282810; + +f32 func_80263FF0(f32); +f32 cosf(f32); +extern f64 D_80278220; + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_802513B0.s") +#else +void func_802513B0(f32 arg0[4][4]){ + s32 i; + s32 j; + for(i = 0; i < 4; i++){ + for(j = 0; j < 4; j++){ + reinterpret_cast(f32, arg0[i][j]) = reinterpret_cast(f32, D_80282FD0->m[i][j]); + } + } +} +#endif + +Mtx *func_80251488(void){ + return D_80282FD0; +} + +void mlMtxApply(Mtx *mPtr){ + func_80245A7C(D_80282FD0, mPtr); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_802514BC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_802515D4.s") + +void mlMtxPop(void){ + D_80282FD0--; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_802516E0.s") + +void func_80251738(void){ + s32 i; + f32 *v0 = ++D_80282FD0; + for(i = 0; i<3; i++){ + v0[0] = 1.0f; + v0[1] = 0.0f; + v0[2] = 0.0f; + v0[3] = 0.0f; + v0[4] = 0.0f; + v0 += 5; + } + v0[0] = 1.0f; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_80251788.s") +#else +f32 *func_80251788(f32 arg0, f32 arg1, f32 arg2){ + f32 (* v0)[4][4] = (f32 *) ++D_80282FD0; + + (*v0)[0][3] = 0.0f; + (*v0)[0][2] = 0.0f; + (*v0)[0][1] = 0.0f; + (*v0)[1][3] = 0.0f; + (*v0)[1][2] = 0.0f; + (*v0)[1][0] = 0.0f; + (*v0)[2][3] = 0.0f; + (*v0)[2][1] = 0.0f; + (*v0)[2][0] = 0.0f; + (*v0)[0][0] = 1.0f; + (*v0)[1][1] = 1.0f; + (*v0)[2][2] = 1.0f; + (*v0)[3][3] = 1.0f; + (*v0)[3][2] = arg2; + (*v0)[3][1] = arg1; + (*v0)[3][0] = arg0; + return &(*v0)[3][3]; +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_802517F8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_80251878.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_802519C8.s") + +//mlMtx +void mlMtxIdent(void){ + s32 i; + f32 *v0 = D_80282FD0 = D_80282810; + for(i = 0; i<3; i++){ + v0[0] = 1.0f; + v0[1] = 0.0f; + v0[2] = 0.0f; + v0[3] = 0.0f; + v0[4] = 0.0f; + v0 += 5; + } + v0[0] = 1.0f; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_80251B5C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_80251BCC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_80251C20.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/mlMtxRotPitch.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/mlMtxRotYaw.s") +/*void mlMtxRotYaw(f32 yaw) { + f32 sin; + f32 cos; + f32 phi_f12; + f32 phi_f10; + f32 phi_f8; + f32 phi_f4; + f32 *phi_v0; + s32 phi_v1; + + if (yaw == 0.0f) + return; + + sin = sinf(yaw*0.0174533); + cos = cosf(yaw*0.0174533); + phi_v0 = D_80282FD0; + for(phi_v1 = 0; phi_v1 < 0xC; phi_v1 += 4){ + phi_v0 = (u32)D_80282FD0 + phi_v1; + phi_f12 = phi_v0[0] * cos; + phi_f10 = phi_v0[8] * sin; + phi_f8 = phi_v0[0] * sin; + phi_f4 = phi_v0[8] * cos; + phi_v0[0] = phi_f12 - phi_f10; + phi_v0 = (u32)D_80282FD0 + phi_v1; + phi_v0[8] = phi_f8 + phi_f4; + } + +}//*/ + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/mlMtxRotRoll.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_80251F8C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_8025208C.s") + +void mlMtxRotate(f32 pitch, f32 yaw, f32 roll){ + mlMtxRotYaw(yaw); + mlMtxRotPitch(pitch); + mlMtxRotRoll(roll); +} + +void mlMtxScale_xyz(f32 x, f32 y, f32 z){ + int i; + for(i = 0; i < 3; i++){ + reinterpret_cast(f32, D_80282FD0->m[0][i]) *= x; + reinterpret_cast(f32, D_80282FD0->m[1][i]) *= y; + reinterpret_cast(f32, D_80282FD0->m[2][i]) *= z; + } +} + +void mlMtxScale(f32 scale){ + int i; + for(i = 0; i < 3; i++){ + reinterpret_cast(f32, D_80282FD0->m[0][i]) *= scale; + reinterpret_cast(f32, D_80282FD0->m[1][i]) *= scale; + reinterpret_cast(f32, D_80282FD0->m[2][i]) *= scale; + } +} + +void func_80252330(f32 x, f32 y, f32 z){ + reinterpret_cast(f32, D_80282FD0->m[3][0]) = x; + reinterpret_cast(f32, D_80282FD0->m[3][1]) = y; + reinterpret_cast(f32, D_80282FD0->m[3][2]) = z; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_8025235C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_80252434.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_802524F0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_802525A4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_8025276C.s") + +void mlMtxTranslate(f32 x, f32 y, f32 z) { + f32 *temp_t6; + f32 *phi_v0; + f32 phi_f18; + f32 phi_f16; + f32 phi_f10; + s32 phi_v1; + + phi_v0 = D_80282FD0; + for(phi_v1 = 0; phi_v1 < 0xC; phi_v1 +=4){ + phi_v0 = (u32)D_80282FD0 + phi_v1; + phi_f18 = phi_v0[0] * x; + phi_f16 = phi_v0[4] * y; + phi_v0[0xC] += phi_f18 + phi_f16 + (phi_v0[8] * z); + } +} + +void func_80252A38(f32 x, f32 y, f32 z) { + s32 var_v1; + + for(var_v1 = 0; var_v1 != 3; var_v1++){ + reinterpret_cast(f32, D_80282FD0->m[3][var_v1]) += reinterpret_cast(f32, D_80282FD0->m[0][var_v1])*x + reinterpret_cast(f32, D_80282FD0->m[1][var_v1])*y + reinterpret_cast(f32, D_80282FD0->m[2][var_v1])*z; + } +} + +void func_80252AF0(f32 arg0[3], f32 arg1[3], f32 rotation[3], f32 scale, f32 arg4[3]) { + f32 sp1C[3]; + + if (arg1 != NULL) { + sp1C[0] = arg1[0] - arg0[0]; + sp1C[1] = arg1[1] - arg0[1]; + sp1C[2] = arg1[2] - arg0[2]; + } else { + sp1C[0] = arg0[0] * -1.0f; + sp1C[1] = arg0[1] * -1.0f; + sp1C[2] = arg0[2] * -1.0f; + } + mlMtxTranslate(sp1C[0], sp1C[1], sp1C[2]); + if (rotation != NULL) { + mlMtxRotYaw(rotation[1]); + mlMtxRotPitch(rotation[0]); + mlMtxRotRoll(rotation[2]); + } + if (scale != 1.0f) { + mlMtxScale_xyz(scale, scale, scale); + } + if (arg4 != NULL) { + mlMtxTranslate(-arg4[0], -arg4[1], -arg4[2]); + } +} + + +void func_80252C08(f32 arg0[3], f32 arg1[3], f32 scale, f32 arg3[3]){ + if(arg0 != NULL) + mlMtxTranslate(arg0[0], arg0[1], arg0[2]); + + if(arg1 != NULL){ + mlMtxRotYaw(arg1[1]); + mlMtxRotPitch(arg1[0]); + mlMtxRotRoll(arg1[2]); + } + + if(scale != 1.0f){ + mlMtxScale_xyz(scale, scale, scale); + } + + if(arg3 != NULL) + mlMtxTranslate(-arg3[0], -arg3[1], -arg3[2]); + +} + +void func_80252CC4(f32 arg0[3], f32 arg1[3], f32 scale, f32 arg3[3]){ + if(arg3 != NULL) + mlMtxTranslate(arg3[0], arg3[1], arg3[2]); + + if(scale != 1.0f){ + mlMtxScale_xyz(1.0f/scale, 1.0f/scale, 1.0f/scale); + } + + if(arg1 != NULL){ + mlMtxRotRoll(-arg1[2]); + mlMtxRotPitch(-arg1[0]); + mlMtxRotYaw(-arg1[1]); + } + + if(arg0 != NULL) + mlMtxTranslate(-arg0[0], -arg0[1], -arg0[2]); + +} + +void func_80252D8C(f32 arg0[3], f32 arg1[3]){ + mlMtxTranslate(arg0[0], arg0[1], arg0[2]); + mlMtxRotRoll(arg1[2]); + mlMtxRotPitch(arg1[0]); + mlMtxRotYaw(arg1[1]); +} + +void func_80252DDC(f32 arg0[3], f32 arg1[3]){ + mlMtxRotYaw(-arg1[1]); + mlMtxRotPitch(-arg1[0]); + mlMtxRotRoll(-arg1[2]); + mlMtxTranslate(-arg0[0], -arg0[1], -arg0[2]); +} + +void func_80252E4C(f32 arg0[3], f32 arg1[3]){ + mlMtxTranslate(arg0[0], arg0[1], arg0[2]); + mlMtxRotRoll(arg1[2]); + mlMtxRotPitch(arg1[0]); + mlMtxRotYaw(arg1[1]); + mlMtxTranslate(-arg0[0], -arg0[1], -arg0[2]); +} + +void func_80252EC8(f32 arg0[3], f32 arg1[3]){ + mlMtxTranslate(arg0[0], arg0[1], arg0[2]); + mlMtxRotYaw(-arg1[1]); + mlMtxRotPitch(-arg1[0]); + mlMtxRotRoll(-arg1[2]); + mlMtxTranslate(-arg0[0], -arg0[1], -arg0[2]); +} + +void func_80252F50(f32 arg0[3]){ + mlMtxRotYaw(arg0[1]); + mlMtxRotPitch(arg0[0]); + mlMtxRotRoll(arg0[2]); +} + +void func_80252F8C(f32 arg0[3]){ + mlMtxRotRoll(arg0[2]); + mlMtxRotPitch(arg0[0]); + mlMtxRotYaw(arg0[1]); +} + +void func_80252FC8(f32 arg0[3]){ + mlMtxRotYaw(-arg0[1]); + mlMtxRotPitch(-arg0[0]); + mlMtxRotRoll(-arg0[2]); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_80253010.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_13990/func_80253034.s") + +typedef struct{ + u32 unk0; + u32 unk4; +}struct49s; + +extern struct49s D_803FFE10[]; + +extern u8 D_8000E800; +extern u8 D_8002D500; +extern u32 D_8027BF2C; +extern u32 D_8027BF30; + +void func_80253050( + s32 overlay_id, u32 ram_start, u32 ram_end, u32 rom_start, u32 rom_end, + u32 code_start, u32 code_end, u32 data_start, u32 data_end, u32 bss_start, u32 bss_end +){ + u32 sp34; + u32 sp30; + u32 sp2C; + u32 *tmp; + + osWriteBackDCacheAll(); + osInvalDCache(ram_start, ram_end - ram_start); + osInvalICache(ram_start, ram_end - ram_start); + + if(bss_start){ + osInvalDCache(bss_start, bss_end - bss_start); + } + + rom_start = D_803FFE10[overlay_id].unk0; + rom_end = D_803FFE10[overlay_id].unk4; + + if(overlay_id){ + func_80254008(); + sp34 = &D_8000E800; + } + else{ + sp34 = &D_8002D500; + } + func_802405F0(sp34, rom_start, rom_end - rom_start); + rarezip_uncompress(&sp34, &ram_start); + sp2C = D_8027BF2C; + sp30 = D_8027BF30; + rarezip_uncompress(&sp34, &ram_start); + + if(bss_start){ + bzero(bss_start, bss_end - bss_start); + osWriteBackDCacheAll(); + tmp = (u32*) bss_start; + tmp[0] = sp2C; + tmp[1] = sp30; + tmp[2] = D_8027BF2C; + tmp[3] = D_8027BF30; + } +} diff --git a/src/core1/code_15770.c b/src/core1/code_15770.c new file mode 100644 index 00000000..09bb089d --- /dev/null +++ b/src/core1/code_15770.c @@ -0,0 +1,77 @@ +#include +#include "functions.h" +#include "variables.h" + +extern struct { + void *unk0; + int unk4; +} D_80282FE0; + +extern u8 D_8000E800; +extern u8 D_803A5D00[2][0x1ecc0]; + +void func_80253208(Gfx **gdl, s32 x, s32 y, s32 w, s32 h, void *color_buffer); + +void func_80253190(Gfx **gdl){ + func_80253208(gdl, 0, 0, D_80276588, D_8027658C, D_803A5D00[func_8024BDA0()]); +} + +void func_80253208(Gfx **gdl, s32 x, s32 y, s32 w, s32 h, void *color_buffer){ + if( D_80282FE0.unk0 != NULL && (getGameMode() != GAME_MODE_4_PAUSED || func_80335134())){ + //draw z_buffer + gDPPipeSync((*gdl)++); + gDPSetColorImage((*gdl)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_80276588, OS_K0_TO_PHYSICAL(D_80282FE0.unk0)); + gDPSetCycleType((*gdl)++, G_CYC_FILL); + gDPSetRenderMode((*gdl)++, G_RM_NOOP, G_RM_NOOP2); + gDPSetFillColor((*gdl)++, 0xFFFCFFFC); + gDPScisFillRectangle((*gdl)++, x, y, x + w - 1, y + h - 1); + + //draw color_buffer + gDPPipeSync((*gdl)++); + gDPSetColorImage((*gdl)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_80276588, OS_K0_TO_PHYSICAL(color_buffer)); + } +} + +int func_80253400(void){ + return D_80282FE0.unk4; +} + +int func_8025340C(void){ + return D_80282FE0.unk0 != NULL; +} + +void func_80253420(void){} + +#ifdef NONMATCHING +s32 func_80253428(int arg0){ + if(arg0){ + D_80282FE0.unk0 = &D_8000E800; + while((s32)D_80282FE0.unk0 % 0x40){ + D_80282FE0.unk0 = (s32)D_80282FE0.unk0 + 2; + } + }else{//L80253494 + D_80282FE0.unk0 = NULL; + + }//L802534A0 + D_80282FE0.unk4 = 0; +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_15770/func_80253428.s") +#endif + +void func_802534A8(int arg0){ + D_80282FE0.unk4 = (D_80282FE0.unk0 != NULL && arg0); +} + +//zBuffer_set +void func_802534CC(Gfx **gdl){ + if(D_80282FE0.unk0 && getGameMode() != GAME_MODE_4_PAUSED){ + gDPPipeSync((*gdl)++); + gDPSetDepthImage((*gdl)++, D_80282FE0.unk0); + } +} + +//zBuffer_get +void *func_80253540(void){ + return D_80282FE0.unk0; +} diff --git a/src/core1/code_15B30.c b/src/core1/code_15B30.c new file mode 100644 index 00000000..43780c51 --- /dev/null +++ b/src/core1/code_15B30.c @@ -0,0 +1,268 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + s32 unk0; + s32 unk4; + s32 unk8; + s32 unkC; + s32 unk10; + s32 unk14; +}Struct_Core1_15B30; + +extern Gfx *D_80276580[2]; +extern Mtx *D_80282FF0[2]; +extern Vtx *D_80282FF8[2]; +extern s32 D_80283000; +extern s32 D_80283004; +extern Struct_Core1_15B30 D_80283008[]; +extern s32 D_802831E8; +extern OSMesgQueue D_802831F0; +extern OSMesg D_80283208; +extern u16 D_8028320C; +extern u16 D_8028320E; +extern u16 D_80283210; +extern u16 D_80283212; +extern Gfx *D_80283214; + +extern u8 D_803A5D00[2][0x1ecc0]; + +void func_80254348(void); +void func_80254464(void); + +/* .code */ +void func_80253550(void){ + osRecvMesg(&D_802831F0, NULL, OS_MESG_BLOCK); +} + +void func_8025357C(void){ + osSendMesg(&D_802831F0, NULL, OS_MESG_BLOCK); +} + +void func_802535A8(UNK_TYPE(s32) arg0, UNK_TYPE(s32)arg1, UNK_TYPE(s32) arg2, UNK_TYPE(s32) arg3) { + Struct_Core1_15B30 *sp1C; + + func_80253550(); + sp1C = &D_80283008[D_802831E8]; + D_802831E8 = (s32) (D_802831E8 + 1) % 20; + func_8025357C(); + sp1C->unk0 = 0; + sp1C->unk8 = arg0; + sp1C->unkC = arg1; + sp1C->unk10 = arg2; + sp1C->unk14 = arg3; + func_80246670(sp1C); +} + + +void func_80253640(Gfx ** gdl, void *arg1){ + D_80283214 = *gdl; + gSPSegment((*gdl)++, 0x00, 0x00000000); + gDPSetRenderMode((*gdl)++, G_RM_NOOP, G_RM_NOOP2); + gSPClearGeometryMode((*gdl)++, G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH); + gDPPipeSync((*gdl)++); + gDPPipelineMode((*gdl)++, G_PM_NPRIMITIVE); + gDPSetAlphaCompare((*gdl)++, G_AC_NONE); + gDPSetColorDither((*gdl)++, G_CD_MAGICSQ); + gDPSetScissor((*gdl)++, G_SC_NON_INTERLACE, D_8028320C, D_8028320E, D_80283210, D_80283212); + func_80253208(gdl, 0, 0, D_80276588, D_8027658C, arg1); + gDPSetColorImage((*gdl)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_80276588, OS_K0_TO_PHYSICAL(arg1)); + gDPSetCycleType((*gdl)++, G_CYC_1CYCLE); + gDPSetTextureConvert((*gdl)++, G_TC_FILT); + gDPSetTextureDetail((*gdl)++, G_TD_CLAMP); + if(D_80283004){ + gDPSetTextureFilter((*gdl)++, G_TF_POINT); + }else{ + gDPSetTextureFilter((*gdl)++, G_TF_BILERP); + } + gDPSetTextureLOD((*gdl)++, G_TL_TILE); + gDPSetTextureLUT((*gdl)++, G_TT_NONE); + gDPSetTexturePersp((*gdl)++, G_TP_PERSP); + func_802534CC(gdl); +} + +void func_802539AC(Gfx **gdl, s32 arg1){ + if(getGameMode() == GAME_MODE_8_BOTTLES_BONUS || getGameMode() == GAME_MODE_A_SNS_PICTURE) + { + func_8030C710(); + func_80253640(gdl, func_8030C704()); + } + else{ + func_80254348(); + func_80253640(gdl, D_803A5D00[arg1]); + } +} + +void func_80253A58(Gfx **gfx, s32 arg1){ + gSPSegment((*gfx)++, 0x00, 0x00000000); + gDPSetColorImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_80276588, OS_PHYSICAL_TO_K0(arg1)); + gSPClearGeometryMode((*gfx)++, G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH); + gSPTexture((*gfx)++, 0, 0, 0, G_TX_RENDERTILE, G_OFF); + gSPSetGeometryMode((*gfx)++, G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH); + gDPSetCycleType((*gfx)++, G_CYC_1CYCLE); + gDPPipelineMode((*gfx)++, G_PM_NPRIMITIVE); + gDPSetCombineMode((*gfx)++, G_CC_SHADE, G_CC_SHADE); + gDPSetAlphaCompare((*gfx)++, G_AC_NONE); + gDPSetColorDither((*gfx)++, G_CD_DISABLE); + gDPSetRenderMode((*gfx)++, G_RM_AA_ZB_XLU_LINE, G_RM_AA_ZB_XLU_LINE2); + gSPClipRatio((*gfx)++, FRUSTRATIO_1); + gDPSetScissor((*gfx)++, G_SC_NON_INTERLACE, D_8028320C, D_8028320E, D_80283210, D_80283212); + gDPPipeSync((*gfx)++); +} + +void func_80253D60(Gfx **gfx, s32 arg1){ + func_80254348(); + func_80253A58(gfx, D_803A5D00[arg1]); +} + +void func_80253DC0(Gfx **gfx){ + func_802476EC(gfx); +} + +void func_80253DE0(Gfx **gdl) { + gDPFullSync((*gdl)++); + gSPEndDisplayList((*gdl)++); +} + +void func_80253E14(Gfx **arg0, Gfx **arg1, s32 arg2){ + Struct_Core1_15B30 *sp1C; + func_80253550(); + sp1C = D_80283008 + D_802831E8; + D_802831E8 = (D_802831E8 + 1) % 0x14; + func_8025357C(); + sp1C->unk0 = 1; + sp1C->unk4 = arg2; + sp1C->unk8 = arg0; + sp1C->unkC = arg1; + func_80246670((OSMesg) sp1C); +} + +void func_80253EA4(Gfx **arg0, Gfx **arg1){ + func_80253E14(arg0, arg1, 0); +} + +void func_80253EC4(Gfx **arg0, Gfx **arg1){ + func_80253E14(arg0, arg1, 0x40000000); +} + +void func_80253EE4(Gfx **arg0, Gfx **arg1, s32 arg2) { + Struct_Core1_15B30 *sp1C; + + func_80253550(); + sp1C = &D_80283008[D_802831E8]; + D_802831E8 = (s32) (D_802831E8 + 1) % 20; + func_8025357C(); + sp1C->unk0 = 2; + sp1C->unk4 = arg2; + sp1C->unk8 = arg0; + sp1C->unkC = arg1; + func_80246670(sp1C); +} + +void func_80253F74(Gfx **arg0, Gfx **arg1){ + func_80253EE4(arg0, arg1, 0); +} + +void func_80253F94(Gfx **arg0, Gfx **arg1){ + func_80253EE4(arg0, arg1, 0x40000000); +} + +void func_80253FB4(u32 *arg0, u32 *arg1, u32 *arg2, u32 *arg3){ + *arg0 = D_8028320C; + *arg1 = D_80283210; + *arg2 = D_8028320E; + *arg3 = D_80283212; +} + +void func_80253FE8(void){ + func_8024BFAC(); +} + +void func_80254008(void){ + func_80246670(3); +} + +void func_80254028(void){ + D_802831E8 = 0; + osCreateMesgQueue(&D_802831F0, &D_80283208, 1); + osSendMesg(&D_802831F0, NULL, 1); + func_80247560(); + func_80254348(); +} + +void func_80254084(Gfx **gfx, s32 x, s32 y, s32 w, s32 h, s32 r, s32 g, s32 b){ + gDPPipeSync((*gfx)++); + gDPPipelineMode((*gfx)++, G_PM_NPRIMITIVE); + gDPSetCycleType((*gfx)++, G_CYC_FILL); + gDPSetFillColor((*gfx)++, GPACK_RGBA5551(r, g, b, 1) << 16 | GPACK_RGBA5551(r, g, b, 1)); + gDPSetRenderMode((*gfx)++, G_RM_NOOP, G_RM_NOOP2); + gDPScisFillRectangle((*gfx)++, x, y, x + w -1, y + h -1); +} + +void func_802541E8(void){ + if(D_80276580[0]){ + free(D_80276580[0]); + free(D_80276580[1]); + free(D_80282FF0[0]); + free(D_80282FF0[1]); + free(D_80282FF8[0]); + free(D_80282FF8[1]); + D_80276580[0] = NULL; + } +} + +void func_8025425C(void){ + if(D_80276580[0] == NULL){ + D_80276580[0] = (Gfx *)malloc(29600); + D_80276580[1] = (Gfx *)malloc(29600); + D_80282FF0[0] = (Mtx *)malloc(44800); + D_80282FF0[1] = (Mtx *)malloc(44800); + D_80282FF8[0] = malloc(6880); + D_80282FF8[1] = malloc(6880); + func_80254464(); + } + D_80283000 = 0; + D_80283004 = 0; +} + +void func_802542F4(s32 arg0, s32 arg1, s32 arg2, s32 arg3) { + D_8028320C = arg0; + D_80283210 = arg1; + D_8028320E = arg2; + D_80283212 = arg3; + D_80276588 = arg1 - arg0; + D_8027658C = arg3 - arg2; + func_8024CC5C(); +} + + +void func_80254348(void){ + func_802542F4(0, 0x124, 0, 0xd8); +} + +void func_80254374(s32 arg0) { + Struct_Core1_15B30 *sp1C; + + func_80253550(); + func_8024C2A0(arg0); + sp1C = &D_80283008[D_802831E8]; + D_802831E8 = (s32) (D_802831E8 + 1) % 20; + func_8025357C(); + sp1C->unk0 = 7; + func_80246670(sp1C); +} + +void func_802543EC(void){ + u32 ret_val = D_80283004; + D_80283004 = ret_val < 1; +} + +void func_80254404(Gfx **gfx, Mtx **mtx, Vtx **vtx){ + D_80283000 = (1 - D_80283000); + *gfx = D_80276580[D_80283000]; + *mtx = D_80282FF0[D_80283000]; + *vtx = D_80282FF8[D_80283000]; +} + +void func_80254464(void){} diff --git a/src/core1/code_18110.c b/src/core1/code_18110.c new file mode 100644 index 00000000..3eb04714 --- /dev/null +++ b/src/core1/code_18110.c @@ -0,0 +1,28 @@ +#include +#include "functions.h" +#include "variables.h" +#include "save.h" + +#define ROUND_UP_DIVIDE(a, b) (((a) + (b) - 1) / (b)) +// The round up divide is not technically needed, but will come in handy for modding +#define SAVEFILE_NUM_BLOCKS ROUND_UP_DIVIDE(sizeof(SaveFile),EEPROM_BLOCK_SIZE) + +s32 write_file_blocks(s32 filenum, s32 blockOffset, u8 *buffer, s32 blockCount) { + s32 address = (filenum * SAVEFILE_NUM_BLOCKS) + blockOffset; + s32 ret; + + func_8024F35C(3); + ret = osEepromLongWrite(func_8024F344(), address, buffer, blockCount * EEPROM_BLOCK_SIZE); + func_8024F35C(0); + return ret; +} + +s32 load_file_blocks(s32 filenum, s32 blockOffset, u8 *buffer, s32 blockCount) { + s32 address = (filenum * SAVEFILE_NUM_BLOCKS) + blockOffset; + s32 ret; + + func_8024F35C(3); + ret = osEepromLongRead(func_8024F344(), address, buffer, blockCount * EEPROM_BLOCK_SIZE); + func_8024F35C(0); + return ret; +} diff --git a/src/core1/code_18210.c b/src/core1/code_18210.c new file mode 100644 index 00000000..f6e0f013 --- /dev/null +++ b/src/core1/code_18210.c @@ -0,0 +1,32 @@ +#include +#include "functions.h" +#include "variables.h" + +extern u64 D_80283280[]; + +extern s32 D_80283380; +extern s32 D_80283384; +extern s32 D_80283388; + +void func_80255C30(void) { + D_80283384 = *(s32 *)0xA4000000 ^ -1; + D_80283388 = (D_80283384) ? 1 :0; + D_80283380 = *(s32 *)0xA4001000 ^ 0x17D7; + D_80283388 |= (D_80283380) ? 2 :0; + if (D_80283388 == 0) { + func_802405F0(&D_80283280, 0xB0000B70, 0x100); + } +} + +void func_80255CD8(void){} + +void func_80255CE0(void){ + osPiReadIo(0, NULL); +} + +s32 func_80255D04(void){return 0;} + +void func_80255D0C(u64 **ucode_ptr, u32 *ucode_size){ + *ucode_ptr = &D_80283280; + *ucode_size = 0x100; +} diff --git a/src/core1/code_18310.c b/src/core1/code_18310.c new file mode 100644 index 00000000..152adaf3 --- /dev/null +++ b/src/core1/code_18310.c @@ -0,0 +1,137 @@ +#include +#include "functions.h" +#include "variables.h" + +s16 D_802765C0[] ={ + 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, + 0x0009, 0x000A, 0x029E, 0x000C, 0x000D, 0x000E, 0x029F, 0x0010, + 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, + 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, 0x0020, + 0x0021, 0x0022, 0x0023, 0x0291, 0x0292, 0x029B, 0x0024, 0x029D, + 0x02B2, 0x0025, 0x0026, 0x0027, 0x02B8, 0x02B9, 0x002A, 0x002B, + 0x002C, 0x002D, 0xFFFE, 0x002F, 0x0295, 0x0031, 0x0032, 0x0033, + 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, + 0x003C, 0x003D, 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, + 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, + 0x004C, 0x004D, 0x004E, 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, + 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, + 0x005C, 0x005D, 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, + 0x0064, 0x0065, 0x020D, 0x020E, 0x020F, 0x0210, 0x006A, 0x006B, + 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x0072, 0x0073, + 0x0074, 0x0075, 0x0076, 0x0294, 0x008F, 0x0090, 0x0293, 0x0078, + 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, 0x0080, + 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x008F, 0x008F, 0x008F, + 0x008F, 0x008F, 0x008F, 0x008C, 0x008E, 0x008D, 0x0091, 0x0093, + 0x0098, 0x0161, 0x015E, 0x00F9, 0x010E, 0x010F, 0x015F, 0x0110, + 0x0163, 0x0160, 0x0296, 0x01B7, 0x00AE, 0x009D, 0x00AD, 0x01B8, + 0x01B9, 0x01BA, 0x013A, 0x013B, 0x0139, 0x013D, 0x013C, 0x01BB, + 0x01BC, 0x01BD, 0x01BE, 0x01BF, 0x01C0, 0xFFFE, 0x01C2, 0x01C3, + 0x01C4, 0x01C5, 0x01C6, 0x01C7, 0x01C8, 0x01C9, 0x01CA, 0x01CB, + 0x01CC, 0x01CD, 0x01CE, 0x01CF, 0x01D0, 0x01D1, 0x01D2, 0x01D3, + 0x01D4, 0x01D5, 0x02A0, 0xFFFE, 0x01F8, 0x01F9, 0x01F7, 0x01F5, + 0x01FA, 0x01FB, 0x01FC, 0x01FD, 0x01FE, 0x01FF, 0x0200, 0x0201, + 0x0202, 0x0204, 0x0205, 0x0206, 0x0207, 0x0208, 0x0209, 0x020A, + 0x020B, 0x020C, 0x01C1, 0x0297, 0x0298, 0x0299, 0x029A, 0x029C, + 0x02AE, 0x02AF, 0x02B0, 0x02B1, 0x02B3, 0x02B4, 0x02B5, 0x02B6, + 0x02B7, 0x02BA, 0x02BB, 0x02BC, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x008F, + 0x0090, 0x0092, 0x0094, 0x0095, 0x0096, 0x0097, 0x0099, 0x009A, + 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, 0x00A0, 0x00A1, 0x00A2, + 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, 0x00A8, 0x00A9, 0x00AA, + 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, 0x00B0, 0x00B1, 0x00B2, + 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7, 0x00B8, 0x00B9, 0x00BA, + 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, 0x00C0, 0x00C1, 0x00C2, + 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7, 0x00C8, 0x00C9, 0x00CA, + 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x00D1, 0x00D2, + 0x00D3, 0x00D4, 0x00D5, 0xFFFE, 0x00D7, 0x00D8, 0x00D9, 0x00DA, + 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF, 0x00E0, 0x00E1, 0x00E2, + 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, 0x00E8, 0x00E9, 0x00EA, + 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, 0x00F0, 0x00F1, 0x00F2, + 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, 0x00F8, 0x00F9, 0x00FA, + 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF, 0x0100, 0x0101, 0x0102, + 0x0103, 0x0104, 0x0105, 0x0106, 0x0107, 0x0108, 0x0109, 0x010A, + 0x010B, 0x010C, 0x010D, 0x010E, 0x010F, 0x0110, 0x0111, 0x0112, + 0x0113, 0x0114, 0x0115, 0x0116, 0x0117, 0x0118, 0x0119, 0x011A, + 0x011B, 0x011C, 0x011D, 0x011E, 0x011F, 0x0120, 0x0121, 0x0122, + 0x0123, 0x0124, 0x0125, 0x0126, 0x0127, 0x0128, 0x0129, 0x012A, + 0x012B, 0x012C, 0x012D, 0x012E, 0x012F, 0xFFFF +}; + +s16 D_802769AC[] = { + 0x0000, 0x0001, + 0x0002, 0x0003, 0x018F, 0x0005, 0x008C, 0x0007, 0x0008, 0xFFFE, + 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0063, + 0x0064, 0x03F0, 0x0011, 0x0012, 0x0013, 0x0027, 0x0014, 0x0015, + 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x0066, 0x001D, + 0x001E, 0x001F, 0x0152, 0x0021, 0x0022, 0x0023, 0x0024, 0xFFFE, + 0x0026, 0x03E9, 0x0028, 0xFFFE, 0xFFFE, 0x002B, 0x002C, 0x002D, + 0x002E, 0x002F, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, + 0x0036, 0x0037, 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, + 0x003E, 0x003F, 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, + 0x0046, 0x0047, 0x0048, 0x0049, 0xFFFE, 0x004B, 0x004C, 0x004D, + 0x004E, 0x004F, 0x0050, 0x03EE, 0x0052, 0x0053, 0x0054, 0x0055, + 0x0056, 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, + 0x005E, 0x005F, 0x0060, 0x0061, 0x0062, 0x03E9, 0x03EA, 0x03EB, + 0x03EC, 0x03ED, 0x03EF, 0xFFFE, 0xFFFE, 0x0069, 0x006A, 0x006B, + 0x006C, 0x006D, 0x00D0, 0x00C1, 0x03FA, 0x0066, 0x03FC, 0x03F2, + 0x00C9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x0128, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0x03F9, 0x0405, 0x0190, 0xFFFE, 0x0131, + 0x0133, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0x03F6, 0x007F, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x0419, 0xFFFE, 0x007C, 0x007D, 0x007E, 0x007F, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + 0x0090, 0xFFFE, 0xFFFE, 0x0093, 0x0094, 0xFFFE, 0xFFFE, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0xFFFE, 0x00A7, + 0x00A8, 0x00A9, 0xFFFF, 0x0000 +}; + +s16 D_80276B98[] = { + 0x002F, 0x0030, 0x0099, 0x005F, + 0x0002, 0x0003, 0xFFFE, 0x0005, 0x0006, 0xFFFE, 0x0008, 0x0009, + 0x000A, 0x000B, 0x000C, 0x000D, 0xFFFE, 0x000F, 0x0010, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, + 0x0016, 0x0017, 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, + 0xFFFE, 0x001F, 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, + 0x0026, 0x0027, 0x0028, 0xFFFE, 0x0029, 0x002A, 0x0030, 0x0031, + 0x0032, 0xFFFE, 0xFFFE, 0x002B, 0x002C, 0x003F, 0x0040, 0x0043, + 0x000E, 0x0091, 0x00AB, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, 0xFFFE, + 0xFFFE, 0xFFFE, 0xFFFE, 0x0044, 0xFFFF, 0x0000, 0x0000, 0x0000, +}; + +s32 func_80255D30(s32 arg0){ + return D_80276B98[arg0]; +} + +s32 func_80255D44(s32 arg0){ + return D_802769AC[arg0]; +} + +s32 func_80255D58(s32 arg0){ + return D_802765C0[arg0]; +} diff --git a/src/core1/code_18350.c b/src/core1/code_18350.c new file mode 100644 index 00000000..8ebcf1ae --- /dev/null +++ b/src/core1/code_18350.c @@ -0,0 +1,1491 @@ +#include +#include "functions.h" +#include "variables.h" + +#define RARE_DTOR (RARE_PI/180.0) + +/* .data*/ +extern u16 *D_80276CB8; //! ml_acosPrecValTblPtr +//! Might not be 90, but 91 or 92? Initial lowerIdx is OOB if 90 +extern f32 ml_acosValTbl[90]; //D_80276CBC + +// extern +f32 func_8024C788(void); + +// .h +void func_80257918(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3[3]); +void ml_vec3f_roll_rotate_copy(f32 arg0[3], f32 arg1[3], f32); + +#define _SQ2(x, y) ((x) * (x) + (y) * (y)) +#define _SQ3(x, y, z) (((x) * (x)) + ((y) * (y)) + ((z) * (z))) +#define _SQ3v1(v) (v[0] * v[0] + v[1] * v[1] + v[2] * v[2]) +#define _SQ3v2(v1, v2) (v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]) + +/* .code */ +f32 func_80255D70(f32 x) +{ + s32 sign; + s32 upperIdx; + s32 lowerIdx; + + f32 res; + + f32 *table = &ml_acosValTbl[0]; + + if (x < 0) + { + // Invert the result + sign = -1; + + // Precomputed values are all positive + x = -x; + } + else + { + sign = 1; + } + + upperIdx = 0; + lowerIdx = 90 + 1; + + while (TRUE) + { + s32 idx = (upperIdx + lowerIdx) / 2; + + if (x > table[idx]) + lowerIdx = idx; + else + upperIdx = idx; + + if (upperIdx + 1 == lowerIdx) + // Found the 1 degree range containing the result + break; + } + + // Check for trivial result + if (upperIdx == 90) + return 0; + + // Linearly approximate the result in the calculated range + res = (x - table[upperIdx]) / (table[lowerIdx] - table[upperIdx]) + upperIdx; + + return sign > 0 ? res : 180 - res; +} + +void func_80255E58(f32 vec1[3], f32 vec2[3], f32 vec3[3], f32 vec4[3]) +{ + f32 tmp[3]; + + tmp[0] = vec3[0] - vec1[0]; + tmp[1] = vec3[1] - vec1[1]; + tmp[2] = vec3[2] - vec1[2]; + + ml_vec3f_yaw_rotate_copy(tmp, tmp, -vec2[1]); + ml_vec3f_pitch_rotate_copy( tmp, tmp, -vec2[0]); + ml_vec3f_roll_rotate_copy(vec4, tmp, -vec2[2]); +} + +f32 func_80255F14(f32 vec1[3], f32 vec2[3]) +{ + f32 tmp1[3]; + f32 tmp2[3]; + + ml_vec3f_normalize_copy(tmp1, vec1); + ml_vec3f_normalize_copy(tmp2, vec2); + + return tmp1[0] * tmp2[0] + + tmp1[1] * tmp2[1] + + tmp1[2] * tmp2[2]; +} + +//ml_vec3f_cross_product +void func_80255F74(f32 dst[3], f32 src1[3], f32 src2[3]) +{ + dst[0] = src1[1] * src2[2] - src1[2] * src2[1]; + dst[1] = src1[2] * src2[0] - src1[0] * src2[2]; + dst[2] = src1[0] * src2[1] - src1[1] * src2[0]; +} + +void func_80255FE4(f32 dst[3], f32 vec1[3], f32 vec2[3], f32 scale) +{ + dst[0] = vec1[0] + (vec2[0] - vec1[0]) * scale; + dst[1] = vec1[1] + (vec2[1] - vec1[1]) * scale; + dst[2] = vec1[2] + (vec2[2] - vec1[2]) * scale; +} + +f32 ml_vec3f_dot_product(f32 vec1[3], f32 vec2[3]) +{ + return vec1[0] * vec2[0] + + vec1[1] * vec2[1] + + vec1[2] * vec2[2]; +} + +f32 ml_vec3f_distance(f32 vec1[3], f32 vec2[3]) +{ + f32 diff[3]; + + diff[0] = vec1[0] - vec2[0]; + diff[1] = vec1[1] - vec2[1]; + diff[2] = vec1[2] - vec2[2]; + + return gu_sqrtf(_SQ3(diff[0], diff[1], diff[2])); +} + +f32 func_802560D0(f32 arg0[3], f32 arg1[3], f32 arg2[3]) { + f32 sp4C[3]; + f32 pad48; + f32 sp3C[3]; + f32 sp38; + f32 sp34; + f32 sp30; + f32 sp24[3]; + f32 sp20; + f32 pad58; + + sp24[0] = arg1[0] - arg0[0]; + sp24[1] = arg1[1] - arg0[1]; + sp24[2] = arg1[2] - arg0[2]; + sp20 = gu_sqrtf(sp24[0]*sp24[0] + sp24[1]*sp24[1] + sp24[2]*sp24[2]); + if (sp20 < 0.01) { + return ml_vec3f_distance(arg0, arg2); + } + + sp3C[0] = arg2[0] - arg0[0]; + sp3C[1] = arg2[1] - arg0[1]; + sp3C[2] = arg2[2] - arg0[2]; + sp38 = gu_sqrtf(sp3C[0]*sp3C[0] + sp3C[1]*sp3C[1] + sp3C[2]*sp3C[2]); + if (sp38 < 0.01) { + return sp38; + } + + sp34 = ((sp24[0]*sp3C[0] + sp24[1]*sp3C[1] + sp24[2]*sp3C[2]) / (sp20 * sp38)); + sp30 = (sp34 *sp38) / sp20; + sp4C[0] = arg0[0] + (sp24[0] * sp30); + sp4C[1] = arg0[1] + (sp24[1] * sp30); + sp4C[2] = arg0[2] + (sp24[2] * sp30); + return ml_vec3f_distance(sp4C, arg2); +} + +f32 ml_vec3f_distance_squared(f32 vec1[3], f32 vec2[3]) +{ + f32 diff[3]; + + diff[0] = vec1[0] - vec2[0]; + diff[1] = vec1[1] - vec2[1]; + diff[2] = vec1[2] - vec2[2]; + + return _SQ3(diff[0], diff[1], diff[2]); +} + +void func_802562DC(f32 vec1[3], f32 vec2[3], f32 vec3[3]) +{ + f32 tmp = vec2[1] == 0 + ? vec1[1] * 100 + : vec1[1] / -vec2[1]; + + vec2[0] *= tmp; + vec2[1] *= tmp; + vec2[2] *= tmp; + + vec3[0] = vec1[0] + vec2[0]; + vec3[1] = vec1[1] + vec2[1]; + vec3[2] = vec1[2] + vec2[2]; +} + +f32 ml_vec2f_length(f32 vec[3]) +{ + return gu_sqrtf(_SQ3(vec[0], vec[1], vec[2])); +} + +void ml_vec3f_normalize_copy(f32 arg0[3], f32 arg1[3]) +{ + f32 length_squared = _SQ3(arg1[0], arg1[1], arg1[2]); + f32 inverse; + + if (length_squared != 0) + { + inverse = 1.0 / gu_sqrtf(length_squared); + ml_vec3f_scale_copy(arg0, arg1, inverse); + } + else + { + ml_vec3f_copy(arg0, arg1); + } +} + +void ml_vec3f_normalize(f32 vec[3]) +{ + f32 length_squared = _SQ3(vec[0], vec[1], vec[2]); + + if (length_squared != 0) + { + f32 inverse = 1.0 / gu_sqrtf(length_squared); + + vec[0] *= inverse; + vec[1] *= inverse; + vec[2] *= inverse; + } +} + +void ml_vec2f_normalize(f32 vec[2]) +{ + f32 length = gu_sqrtf(_SQ2(vec[0], vec[1])); + + if (length != 0) + { + vec[0] /= length; + vec[1] /= length; + } +} + +void ml_3f_normalize(f32 *x, f32 *y, f32 *z) +{ + f32 length = gu_sqrtf(_SQ3(*x, *y, *z)); + + if (length != 0) + { + *x /= length; + *y /= length; + *z /= length; + } +} + +void ml_vec3f_set_length_copy(f32 dst[3], f32 src[3], f32 len) +{ + f32 mag = gu_sqrtf(_SQ3(src[0], src[1], src[2])); + + if (mag != 0) + ml_vec3f_scale_copy(dst, src, len / mag); + else + ml_vec3f_copy(dst, src); +} + +void func_80256664(f32 ptr[3]) +{ + u32 i; + + for (i = 0; i < 3; i++) + { + if (ptr[i] >= 0) + ptr[i] = (s32)ptr[i] % 360; + else + ptr[i] += ((360 - (s32)ptr[i]) / 360) * 360; + } +} + +void func_80256740(f32 vec[3]) +{ + u32 i; + + for (i = 0; i < 3; i++) + { + if (vec[i] >= 0) + { + vec[i] = (s32)vec[i] % 360; + + if (vec[i] > 180) + vec[i] -= 360; + } + else + { + vec[i] += (((360 - (s32)vec[i]) / 360) * 360); + + if (vec[i] <= -180) + vec[i] += 360; + } + } +} + +void ml_vec3f_pitch_rotate_copy(f32 dst[3], f32 src[3], f32 pitch) +{ + f32 cos, sin; + f32 val; + + pitch *= RARE_DTOR; // M_DTOR + + cos = cosf(pitch); + sin = sinf(pitch); + + // weird temp needed for match + dst[0] = src[0]; + val = (src[1] * cos) - (src[2] * sin); + dst[2] = (src[1] * sin) + (src[2] * cos); + dst[1] = val; +} + +void ml_vec3f_yaw_rotate_copy(f32 dst[3], f32 src[3], f32 yaw) +{ + f32 cos, sin; + f32 val; + + yaw *= RARE_DTOR; // M_DTOR + + cos = cosf(yaw); + sin = sinf(yaw); + + // weird temp needed for match + val = (src[2] * sin) + (src[0] * cos); + dst[1] = src[1]; + dst[2] = (src[2] * cos) - (src[0] * sin); + dst[0] = val; +} + +void ml_vec3f_roll_rotate_copy(f32 dst[3], f32 src[3], f32 roll) +{ + f32 cos, sin; + f32 val; + + roll *= RARE_DTOR; // M_DTOR + + cos = cosf(roll); + sin = sinf(roll); + + // weird temp needed for match + val = (src[0] * cos) - (src[1] * sin); + dst[1] = (src[0] * sin) + (src[1] * cos); + dst[2] = src[2]; + dst[0] = val; +} + +void ml_vec3f_set_length(f32 arg0[3], f32 arg1) +{ + f32 length = gu_sqrtf(_SQ3(arg0[0], arg0[1], arg0[2])); + + if (length != 0) + { + f32 inv_length = arg1 / length; + + arg0[0] = arg0[0] * inv_length; + arg0[1] = arg0[1] * inv_length; + arg0[2] = arg0[2] * inv_length; + } +} + +//ml_f_sin_of_angle_between_points_2D +f32 func_80256AB4(f32 x1, f32 y1, f32 x2, f32 y2) +{ + f32 val = gu_sqrtf(y1 * y1 + x1 * x1) * gu_sqrtf(x2 * x2 + y2 * y2); + + if (val) + return (y1 * x2 - x1 * y2) / val; + + return 0; +} + +//ml_vec3f_sin_of_angle_between_vectors +f32 func_80256B54(f32 vec1[3], f32 vec2[3]) +{ + f32 a = gu_sqrtf(_SQ3v1(vec1)); + f32 b = gu_sqrtf(_SQ3v1(vec2)); + + f32 tmp[3]; + + tmp[0] = vec1[1] * vec2[2] - vec1[2] * vec2[1]; + tmp[1] = vec1[2] * vec2[0] - vec1[0] * vec2[2]; + tmp[2] = vec1[0] * vec2[1] - vec1[1] * vec2[0]; + + return gu_sqrtf(_SQ3v1(tmp)) / (a * b); +} + +f32 func_80256C60(f32 vec[3], s32 val) +{ + f32 tmp = (f32)val / 2; + u32 i; + + for (i = 0; i != 3; i++) + { + vec[i] += vec[i] >= 0 ? tmp : -tmp; + vec[i] -= (s32)vec[i] % val; + } +} + +void func_80256D0C(f32 val1, f32 val2, f32 x, f32 y, f32 z, f32 *dstX, f32 *dstY, f32 *dstZ) +{ + f32 tmp; + + val1 *= RARE_DTOR; // M_DTOR + val2 *= RARE_DTOR; + + tmp = y * sinf(val1) + cosf(val1) * z; + + *dstX = tmp * sinf(val2) + cosf(val2) * x; + *dstY = y * cosf(val1) - sinf(val1) * z; + *dstZ = tmp * cosf(val2) - sinf(val2) * x; +} + +void func_80256E24(f32 dst[3], f32 theta, f32 phi, f32 x, f32 y, f32 z) +{ + f32 tmp; + + theta *= RARE_DTOR; // M_DTOR + phi *= RARE_DTOR; + + tmp = y * sinf(theta) + cosf(theta) * z; + + dst[0] = tmp * sinf(phi) + cosf(phi) * x; + dst[1] = y * cosf(theta) - sinf(theta) * z; + dst[2] = tmp * cosf(phi) - sinf(phi) * x; +} + +void func_80256F44(f32 vec1[3], f32 vec2[3], f32 vec3[3], f32 dst[3]) +{ + f32 tmp1[3]; + f32 tmp2[3]; + + ml_vec3f_roll_rotate_copy(tmp1, vec3, vec2[2]); + ml_vec3f_pitch_rotate_copy(tmp2, tmp1, vec2[0]); + ml_vec3f_yaw_rotate_copy(tmp1, tmp2, vec2[1]); + + dst[0] = vec1[0] + tmp1[0]; + dst[1] = vec1[1] + tmp1[1]; + dst[2] = vec1[2] + tmp1[2]; +} + +f32 ml_acosf(f32 x) +{ + u16 lowerIdx = 0; + u16 upperIdx = 10000; + u16 idx = 10000; + + f32 x_abs = ((x >= 0) ? x : -x); + + u16 target = x_abs * 65535.0; + + while ((upperIdx - lowerIdx >= 2) && (target != D_80276CB8[idx])){ + idx = (upperIdx + lowerIdx) / 2; + + if (target < D_80276CB8[idx]) + upperIdx = idx; + else + lowerIdx = idx; + }; + + return idx * 90.0 / 10000.0; +} + +f32 func_8025715C(f32 val1, f32 val2) +{ + f32 tmp = ml_acosf(func_80256AB4(0, 100, val1, val2)); + + if (val1 >= 0) + { + if (val2 < 0) + return 180 - tmp; + } + else + { + if (val2 < 0) + return tmp + 180; + else + return 360 - tmp; + } + + return tmp; +} + +f32 func_80257204(f32 val1, f32 val2, f32 val3, f32 val4) +{ + return func_8025715C(val3 - val1, val4 - val2); +} + +f32 func_80257248(f32 vec1[3], f32 vec2[3]) +{ + return func_8025715C(vec2[0] - vec1[0], vec2[2] - vec1[2]); +} + +void func_8025727C(f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2, f32 *o1, f32 *o2) +{ + f32 dz; + f32 dy; // unused + f32 dx; //these 3 are probably a f32[3]^ + f32 ft2; + f32 horz_dist; + f32 dist; // unused + + dx = x2 - x1; + dy = y2 - y1; + dz = z2 - z1; + ft2 = (dx * dx) + (dz * dz); + + horz_dist = gu_sqrtf(ft2); + + if (horz_dist > 0.01) + { + *o2 = ml_acosf(dx / horz_dist); + + if (dz < 0) + *o2 = 180 - *o2; + + if (dx < 0) + *o2 = 360 - *o2; + } + else + { + *o2 = 0; + } + + + dist = gu_sqrtf((dy * dy) + ft2); + + if (dist > 0.01) + { + *o1 = ml_acosf(dy / dist); + + if (horz_dist < 0) + *o1 = 180 - *o1; + + if (dy < 0) + *o1 = 360 - *o1; + } + else + { + *o1 = 0; + } +} + +//ml_init +void func_80257424(void) +{ + u16 i; + + // Allocate table + D_80276CB8 = (u16 *)malloc(10001 * sizeof(u16)); + + // Generate all entries in the table + for (i = 0; i < 10001; i++) + { + // Save value + D_80276CB8[i] = sinf(i * 90.0 / 10000 * M_PI / 180) * 65535.f; + } +} + +/** + * Deallocates the ushort table used for asin + */ +//ml_free +void func_80257594(void) +{ + free(D_80276CB8); + D_80276CB8 = NULL; +} + +f32 func_802575BC(f32 val) +{ + return (sinf(val * RARE_PI + -RARE_PI/2) + 1) / 2.0; +} + +f32 func_80257618(f32 val) +{ + return sinf(val * RARE_PI / 2); +} + +f32 func_80257658(f32 val) +{ + return func_802575BC(func_802575BC(val)); +} + +f32 func_80257680(f32 val1, f32 val2, f32 val3) +{ + f32 tmp; + + if (val1 > val3) + return 0; + + if (val2 <= val3) + return 1; + + tmp = (val3 - val1) / (val2 - val1); + return tmp * tmp * (3 - tmp - tmp); +} + +void func_802576F8(void) +{ + void *defrag(void *); + + if (!func_802559A0() && D_80276CB8 != NULL) + // Updates heap location for asin/acos value table? + D_80276CB8 = defrag(D_80276CB8); +} + +//ml_timer_update +//decrement a counter and returns True if timer reaches 0 +bool func_8025773C(f32 *timer, f32 delta) +{ + if (*timer > 0) + { + *timer -= delta; + + if (*timer <= 0) + { + *timer = 0; + + return TRUE; + } + } + + return FALSE; +} + +void func_8025778C(f32 dst[3], f32 arg1[3], f32 arg2[9]){ + f32 sp54; + f32 sp50; + f32 sp4C; + f32 sp40[3]; + f32 sp34[3]; + f32 sp28[3]; + + func_802596AC(sp40, arg2, &arg2[3], arg1); + func_802596AC(sp34, &arg2[3], &arg2[6], arg1); + func_802596AC(sp28, &arg2[6], arg2, arg1); + + sp54 = ml_vec3f_distance_squared(sp40, arg1); + sp50 = ml_vec3f_distance_squared(sp34, arg1); + sp4C = ml_vec3f_distance_squared(sp28, arg1); + + if(sp54 < sp50){ + if(sp4C < sp54){ + ml_vec3f_copy(dst, sp28); + } + else{ + ml_vec3f_copy(dst, sp40); + } + } + else{//L80257868 + if(sp4C < sp50) + ml_vec3f_copy(dst, sp28); + else + ml_vec3f_copy(dst, sp34); + } + + +} + +void func_802578A4(f32 dst[3], f32 vec1[3], f32 vec2[3]) +{ + f32 tmp1[3]; + f32 tmp2[3]; + f32 tmp3[3]; + + ml_vec3f_diff_copy(tmp1, &vec2[3], vec2); + ml_vec3f_diff_copy(tmp2, &vec2[6], vec2); + func_80255F74(tmp3, tmp1, tmp2); + ml_vec3f_normalize(tmp3); + func_80257918(dst, vec1, vec2, tmp3); +} + +void func_80257918(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3[3]){ + f32 sp2C[3]; + f32 scale; + + scale = _SQ3v2(arg3, arg1) - _SQ3v2(arg3, arg2); + ml_vec3f_scale_copy(sp2C, arg3, scale); + ml_vec3f_diff_copy(arg0, arg1, sp2C); +} + +bool func_802579B0(f32 vec[3], f32 x1, f32 z1, f32 x2, f32 z2) +{ + return x1 <= vec[0] + && x2 >= vec[0] + && z1 <= vec[2] + && z2 >= vec[2]; +} + +f32 func_80257A44(f32 val1, f32 val2) +{ + return func_802588B0(val1, val2) / val2; +} + +f32 func_80257A6C(f32 val1, f32 val2) +{ + f32 tmp = func_802588B0(val1, val2) / val2; + + return (sinf(tmp * (2*RARE_PI)) + 1.0) / 2.0; +} + +f32 func_80257AD4(f32 val1, f32 val2) +{ + return sinf((func_802588B0(val1, val2) / val2) * (2*RARE_PI)); +} + +f32 ml_f_map(f32 a, f32 b, f32 c, f32 d, f32 e) +{ + f32 val; + + if (c != b) + { + if (d < e) + { + val = (((a - b) / (c - b)) * (e - d)) + d; + + if (val > e) + return e; + + if (val < d) + return d; + } + else + { + val = (((a - b) / (c - b)) * (e - d)) + d; + + if (val < e) + return e; + + if (val > d) + return d; + } + + return val; + } + + return e; +} + +f32 func_80257BFC(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4) +{ + if (arg2 != arg1) + return ((arg0 - arg1) / (arg2 - arg1)) * (arg4 - arg3) + arg3; + + return arg4; +} + +//ml_f_interpolate +f32 func_80257C48(f32 arg0, f32 arg1, f32 arg2) +{ + return arg0 * (arg2 - arg1) + arg1; +} + +f32 func_80257C60(f32 a, f32 b, f32 c, f32 d, f32 e, f32 (*func)(f32)) +{ + f32 val = func(ml_f_map(a, b, c, 0.f, 1.f)); + + return ml_f_map(val, 0, 1, d, e); +} + +f32 func_80257CC0(f32 a, f32 b, f32 c, f32 d, f32 e) +{ + return func_80257C60(a, b, c, d, e, func_802575BC); +} + +f32 func_80257CF8(f32 a, f32 b, f32 c, f32 d, f32 e) +{ + return func_80257C60(a, b, c, d, e, func_80257658); +} + +f32 func_80257D30(f32 a, f32 b, f32 c, f32 d, f32 e) +{ + if (a < 0) + return ml_f_map(a, -b, -c, -d, -e); + else + return ml_f_map(a, b, c, d, e); +} + +void func_80257DB0(f32 arg0[3], f32 arg1[3], f32 arg2[3]) +{ + f32 dot_product; + f32 tmp[3]; + + ml_vec3f_scale_copy(arg0, arg1, -1); + dot_product = ml_vec3f_dot_product(arg0, arg2); + ml_vec3f_scale_copy(tmp, arg2, 2 * dot_product); + ml_vec3f_diff_copy(arg0, tmp, arg0); +} + +void func_80257E14(f32 v[3], f32 a) +{ + if (_SQ3(v[0], v[1], v[2]) > a * a) + { + ml_vec3f_normalize_copy(v, v); + v[0] *= a; + v[1] *= a; + v[2] *= a; + } +} + +// int clamp +s32 func_80257EA8(s32 val, s32 min, s32 max) +{ + if (val < min) + return min; + + if (val > max) + return max; + + return val; +} + +//ml_clamp_f +f32 mlClamp_f(f32 arg0, f32 arg1, f32 arg2) +{ + if (arg0 < arg1) + return arg1; + + if (arg0 > arg2) + return arg2; + + return arg0; +} + +//ml_vec3f_yaw_between +int func_80257F18(f32 src[3], f32 target[3], f32 *yaw) +{ + f32 diff[3]; + f32 h; + + *yaw = 0; + + diff[0] = target[0] - src[0]; + diff[1] = target[1] - src[1]; + diff[2] = target[2] - src[2]; + + h = gu_sqrtf(_SQ2(diff[2], diff[0])); + + if (h < 0.01) // (f64) 0.01 + return 0; + + *yaw = ml_acosf(diff[0] / h); + + if (diff[2] < 0) + *yaw = 180 - *yaw; + + if (diff[0] < 0) + *yaw = 360 - *yaw; + + return 1; +} + +//ml_vec3f_yaw_towards +int func_8025801C(f32 target[3], f32 *yaw) +{ + f32 diff[3]; + f32 h; + + *yaw = 0; + + diff[0] = target[0]; + diff[1] = target[1]; + diff[2] = target[2]; + + h = gu_sqrtf(_SQ2(diff[2], diff[0])); + + if (h < 0.01) // (f64) 0.01 + return 0; + + *yaw = ml_acosf(diff[0] / h); + + if (diff[2] < 0) + *yaw = 180 - *yaw; + + if (diff[0] < 0) + *yaw = 360 - *yaw; + + return 1; +} + +int func_80258108(f32 vec[3], f32 *arg1, f32 *arg2) +{ + f32 horz_len; + + *arg1 = 0; + *arg2 = 0; + + horz_len = gu_sqrtf(_SQ2(vec[2], vec[0])); + + if (horz_len < 0.01) + return 0; + + *arg1 = ml_acosf(vec[0] / horz_len); + + if (vec[2] < 0) + *arg1 = 180 - *arg1; + + if (vec[0] < 0) + *arg1 = 360 - *arg1; + + *arg2 = ml_acosf(horz_len); + + return 1; +} + +int func_80258210(f32 x, f32 y, f32 *dst) +{ + f32 tmp; + + *dst = 0; + + tmp = gu_sqrtf(_SQ2(y, x)); + + if (tmp < 0.01) + return FALSE; + + *dst = ml_acosf(x / tmp); + + if (y < 0) + *dst = 180 - *dst; + + if (x < 0) + *dst = 360 - *dst; + + return TRUE; +} + +//ml_vec3f_is_zero +int func_802582EC(f32 vec[3]) +{ + return !(vec[0] != 0 || vec[1] != 0 || vec[2] != 0); +} + +//ml_vec3f_is_not_zero +int func_80258368(f32 vec[3]) +{ + return vec[0] != 0 || vec[1] != 0 || vec[2] != 0; +} + +//ml_vec3f_not_on_vertical_axis +int func_802583D8(f32 vec[3]) +{ + return vec[0] != 0 && vec[2] != 0; +} + +//ml_vec3f_inside_box_f +int func_80258424(f32 vec[3], f32 minX, f32 minY, f32 minZ, f32 maxX, f32 maxY, f32 maxZ) +{ + return vec[0] > minX && vec[0] < maxX + && vec[1] > minY && vec[1] < maxY + && vec[2] > minZ && vec[2] < maxZ; +} + +//ml_vec3f_inside_box +int func_802584FC(f32 vec[3], f32 min[3], f32 max[3]) +{ + return vec[0] > min[0] && vec[0] < max[0] + && vec[1] > min[1] && vec[1] < max[1] + && vec[2] > min[2] && vec[2] < max[2]; +} + +//ml_vec3w_inside_box_w +int func_802585E0(s32 vec[3], s32 minX, s32 minY, s32 minZ, s32 maxX, s32 maxY, s32 maxZ) +{ + return vec[0] > minX && vec[0] < maxX + && vec[1] > minY && vec[1] < maxY + && vec[2] > minZ && vec[2] < maxZ; +} + +//ml_vec3f_horizontal_distance_zero_likely +f32 func_80258640(f32 vec1[3], f32 vec2[3]) +{ + f32 dX = vec1[0] - vec2[0]; + f32 dZ = vec1[2] - vec2[2]; + + if (dX != 0 || dZ != 0) + return gu_sqrtf(_SQ2(dX, dZ)); + + return 0; +} + +//ml_vec3f_horizontal_distance_squared_zero_likely +f32 func_802586B0(f32 vec1[3], f32 vec2[3]) +{ + f32 dX = vec1[0] - vec2[0]; + f32 dZ = vec1[2] - vec2[2]; + + if (dX != 0 || dZ != 0) + return _SQ2(dX, dZ); + + return 0; +} + +f32 func_80258708(f32 vec1[3], f32 vec2[3]) +{ + f32 val = vec1[0] - vec2[0]; + f32 dY = vec1[1] - vec2[1]; + f32 dZ = vec1[2] - vec2[2]; + + val = _SQ3(val, dY, dZ); + + if (val != 0) + return gu_sqrtf(val); + + return 0; +} + +f32 func_80258780(f32 vec1[3], f32 vec2[3]) +{ + f32 dX = vec1[0] - vec2[0]; + f32 dY = vec1[1] - vec2[1]; + f32 dZ = vec1[2] - vec2[2]; + + return _SQ3(dX, dY, dZ); +} + +f32 ml_sin_deg(f32 angle_deg) +{ + return sinf(angle_deg * RARE_DTOR); +} + +f32 ml_cos_deg(f32 angle_deg) +{ + return cosf(angle_deg * RARE_DTOR); +} + +f32 mlNormalizeAngle(f32 angle) +{ + if (angle < 0.0) // f64 + { + // recursive call + angle = mlNormalizeAngle(-angle); + angle = 360.0 - angle; + } + + if (angle >= 360.0) + angle -= 360.0 * (s32)(angle / 360.0); + + return angle; +} + +f32 func_802588B0(f32 arg0, f32 arg1) +{ + f32 val = arg0 / arg1; + + return (val - (s32)val) * arg1; +} + +f32 max_f(f32 arg0, f32 arg1) +{ + return arg0 > arg1 ? arg0 : arg1; +} + +f32 min_f(f32 arg0, f32 arg1) +{ + return arg0 < arg1 ? arg0 : arg1; +} + +int ml_max_w(int arg0, int arg1) +{ + return arg0 > arg1 ? arg0 : arg1; +} + +int ml_min_w(int arg0, int arg1) +{ + return arg1 > arg0 ? arg0 : arg1; +} + +f32 mlAbsF(f32 arg0) +{ + return arg0 > 0 ? arg0 : -arg0; +} + +f32 func_80258994(f32 arg0[3]) +{ + return mlAbsF(arg0[0]) + mlAbsF(arg0[2]); +} + +int ml_abs_w(int arg0) +{ + return arg0 > 0 ? arg0 : -arg0; +} + +void func_802589E4(f32 dst[3], f32 yaw, f32 length) +{ + yaw *= RARE_DTOR; + + dst[0] = sinf(yaw) * length; + dst[2] = cosf(yaw) * length; +} + +void func_80258A4C(f32 vec1[3], f32 arg1, f32 vec2[3], f32 *arg3, f32 *arg4, f32 *arg5) +{ + f32 t1[3]; + f32 t2[3]; + + t1[0] = vec2[0] - vec1[0]; + t1[1] = vec2[1] - vec1[1]; + t1[2] = vec2[2] - vec1[2]; + + t1[1] = 0; + + *arg3 = gu_sqrtf(_SQ3(t1[0], t1[1], t1[2])); + + t2[2] = 0; + t2[1] = 0; + t2[0] = 100; + + ml_vec3f_yaw_rotate_copy(t2, t2, arg1); + + *arg4 = t1[0] * t2[0] + t1[1] * t2[1] + t1[2] * t2[2]; + *arg5 = func_80256AB4(t2[0], t2[2], t1[0], t1[2]); + + if (*arg4 < 0) + *arg5 = *arg5 < 0 ? -1 : 1; +} + +void ml_vec3f_clear(f32 dst[3]) +{ + dst[2] = 0; + dst[1] = 0; + dst[0] = 0; +} + +void ml_vec3f_copy(f32 dst[3], f32 src[3]) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; +} + +void ml_vec3f_diff_copy(f32 dst[3], f32 src1[3], f32 src2[3]) +{ + dst[0] = src1[0] - src2[0]; + dst[1] = src1[1] - src2[1]; + dst[2] = src1[2] - src2[2]; +} + +void ml_vec3f_diff(f32 dst[3], f32 src[3]) +{ + dst[0] -= src[0]; + dst[1] -= src[1]; + dst[2] -= src[2]; +} + +void ml_vec3f_assign(f32 dst[3], f32 x, f32 y, f32 z) +{ + dst[0] = x; + dst[1] = y; + dst[2] = z; +} + +void ml_vec3f_add(f32 dst[3], f32 src1[3], f32 src2[3]) +{ + dst[0] = src1[0] + src2[0]; + dst[1] = src1[1] + src2[1]; + dst[2] = src1[2] + src2[2]; +} + +void ml_vec3f_scale(f32 vec[3], f32 scale) +{ + vec[0] *= scale; + vec[1] *= scale; + vec[2] *= scale; +} + +void ml_vec3f_scale_copy(f32 dst[3], f32 src[3], f32 scale) +{ + dst[0] = src[0] * scale; + dst[1] = src[1] * scale; + dst[2] = src[2] * scale; +} + +void func_80258CDC(f32 vec1[3], f32 vec2[3]) +{ + vec1[0] = mlAbsF(vec1[0]) + mlAbsF(vec2[0]); + vec1[1] = mlAbsF(vec1[1]) + mlAbsF(vec2[1]); + vec1[2] = mlAbsF(vec1[2]) + mlAbsF(vec2[2]); +} + +void ml_vec3w_to_vec3f(f32 dst[3], s32 src[3]) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; +} + +void ml_vec3h_to_vec3f(f32 dst[3], s16 src[3]) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; +} + +void ml_vec3f_to_vec3w(s32 dst[3], f32 src[3]) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; +} + +void ml_vec3f_to_vec3h(s16 dst[3], f32 src[3]) +{ + dst[0] = src[0]; + dst[1] = src[1]; + dst[2] = src[2]; +} + +void func_80258E60(f32 dst[3], f32 src[3], f32 amount) +{ + f32 vec[3]; + + vec[0] = 0; + vec[1] = amount; + vec[2] = 0; + + ml_vec3f_pitch_rotate_copy(vec, vec, src[0]); + ml_vec3f_yaw_rotate_copy(vec, vec, src[1]); + + dst[0] += vec[0]; + dst[1] += vec[1]; + dst[2] += vec[2]; +} + +void func_80258EF4(f32 dst[3], f32 src[3], f32 amount) +{ + f32 vec[3]; + + vec[0] = 0; + vec[1] = 0; + vec[2] = amount; + + ml_vec3f_pitch_rotate_copy(vec, vec, src[0]); + ml_vec3f_yaw_rotate_copy(vec, vec, src[1]); + + dst[0] += vec[0]; + dst[1] += vec[1]; + dst[2] += vec[2]; +} + +void func_80258F88(f32 dst[3], f32 src[3], f32 amount) +{ + f32 vec[3]; + + vec[0] = amount; + vec[1] = 0; + vec[2] = 0; + + ml_vec3f_pitch_rotate_copy(vec, vec, src[0]); + ml_vec3f_yaw_rotate_copy(vec, vec, src[1]); + + dst[0] += vec[0]; + dst[1] += vec[1]; + dst[2] += vec[2]; +} + +void func_8025901C(f32 arg0, f32 arg1[3], f32 arg2[3], f32 arg3){ + f32 sp44; + f32 sp40; + f32 sp3C; + f32 diff; + int tmp; + + ml_vec3f_clear(arg2); + tmp = func_80258108(arg1, &sp40, &sp44); + sp44 *= arg3; + if(tmp){ + diff = arg0 - sp40; + if(diff < -180.0f) + diff += 360.0f; + + if(180.0f <= diff) + diff -= 360.0f; + + sp3C = (0.0f <= diff)?diff:-diff; + arg2[0] = ml_map_f(sp3C, 0.0f, 180.0f, sp44, -sp44); + if(sp3C < 90.0f){ + arg2[2] = ml_map_f(sp3C, 0.0f, 90.0f, 0.0f, sp44); + } + else{ + arg2[2] = ml_map_f(sp3C, 90.0f, 180.0f, sp44, 0.0f); + } + if(diff < 0.0f) + arg2[2] = -arg2[2]; + }//L80259184 +} + +f32 func_80259198(f32 arg0, f32 arg1) +{ + if (arg0 > arg1) + return arg1; + + if (arg0 < -arg1) + return -arg1; + + return arg0; +} + +f32 mlDiffDegF(f32 arg0, f32 arg1) +{ + f32 diff = arg0 - arg1; + + while (diff > 180) + diff -= 360; + + while (diff <= -180) + diff += 360; + + return diff; +} + +bool func_80259254(f32 vec[3], f32 x, f32 z, f32 val) +{ + f32 t[3]; + + t[0] = x - vec[0]; + t[1] = 0; + t[2] = z - vec[2]; + + return _SQ3(t[0], 0, t[2]) <= val * val; +} + +bool func_802592C4(f32 v1[3], f32 v2[3], f32 a) +{ + f32 t[3]; + + t[0] = v1[0] - v2[0]; + t[2] = v1[2] - v2[2]; + + return _SQ3(t[0], 0, t[2]) < a * a; +} + +bool func_80259328(s32 v1[3], s32 v2[3], s32 a) +{ + s32 t[3]; + + t[0] = v1[0] - v2[0]; + t[2] = v1[2] - v2[2]; + + return _SQ3(t[0], 0, t[2]) < a * a; +} + +bool func_80259384(f32 v1[3], f32 v2[3], f32 a) +{ + f32 t[3]; + + t[0] = v2[0] - v1[0]; + t[1] = v2[1] - v1[1]; + t[2] = v2[2] - v1[2]; + + return _SQ3(t[0], t[1], t[2]) <= a * a; +} + +bool func_80259400(f32 a0) +{ + // wtf? + return *(u32 *)&a0 == 0x80 || *(u32 *)&a0 == 0x2A8800; +} + +void func_80259430(f32 *val) +{ + *val -= time_getDelta(); + + if (*val < 0) + *val = 0; + + return; +} + +void func_8025947C(f32 a0[3], f32 a1[3], f32 a2[3], f32 a3[3]) +{ + f32 f0; + f32 f12; + f32 f16; + f32 f8; + f32 f18; + f32 f4; + + a0[1] = a1[1]; + + f0 = a2[0] - a1[0]; + + if (f0 == 0) + { + a0[0] = a1[0]; + a0[2] = a3[2]; + + return; + } + + f12 = a2[2] - a1[2]; + + if (f12 == 0) + { + a0[0] = a3[0]; + a0[2] = a1[2]; + + return; + } + + f16 = f12 / f0; + f18 = a1[2] - (a1[0] * f16); + + f8 = -1.0 / f16; + + f4 = a3[2] - (a3[0] * f8); + + f8 = (f4 - f18) / (f16 - f8); + + a0[0] = f8; + a0[2] = f8 * f16 + f18; +} + + +f32 func_80259554(f32 dst[3], f32 vec1[3], f32 vec2[3], f32 vec3[3]) +{ + f32 tmp1[3]; + f32 tmp2[3]; + f32 tmp3; + f32 PAD; + f32 mag; + + ml_vec3f_diff_copy(tmp1, vec2, vec1); + ml_vec3f_diff_copy(tmp2, vec3, vec1); + + mag = gu_sqrtf(_SQ3v1(tmp2)); + + if (mag == 0.0) // f64 + { + ml_vec3f_copy(dst, vec1); + } + else + { + tmp3 = ml_acosf((func_80256B54(tmp1, tmp2) * mag) / mag); + + ml_vec3f_set_length_copy(tmp1, tmp1, ml_cos_deg(tmp3) * mag); + + if (_SQ3v2(tmp1, tmp2) > 0) + ml_vec3f_add(dst, vec1, tmp1); + else + ml_vec3f_diff_copy(dst, vec1, tmp1); + } +} + +void func_802596AC(f32 a0[3], f32 a1[3], f32 a2[3], f32 a3[3]) +{ + f32 a, b, c; + + func_80259554(a0, a1, a2, a3); + + a = ml_vec3f_distance_squared(a1, a2); + b = ml_vec3f_distance_squared(a1, a0); + c = ml_vec3f_distance_squared(a2, a0); + + if (a < b || a < c) + { + if (b < c) + ml_vec3f_copy(a0, a1); + else + ml_vec3f_copy(a0, a2); + } + +} + +s32 func_8025975C(f32 a0) +{ + f32 val = (s32)(func_8024C788() - a0); + + while (val < 0) + val += 360; + + while (val >= 360) + val -= 360; + + return val; +} + +bool func_80259808(f32 a0) +{ + return func_8025975C(a0) < 0xB4; +} + +void func_8025982C(f32 dst[3], f32 arg1[3], f32 arg2[3], f32 arg3){ + int i; + for(i=0; i< 3; i++){ + dst[i] = arg1[i] + (arg2[i]-arg1[i])*arg3; + } +} \ No newline at end of file diff --git a/src/core1/code_1BE90.c b/src/core1/code_1BE90.c new file mode 100644 index 00000000..f187acba --- /dev/null +++ b/src/core1/code_1BE90.c @@ -0,0 +1,628 @@ +#include +#include "functions.h" +#include "variables.h" + + + +extern func_8024FDDC(u8, s32); + +void func_8025AE50(s32, f32); + +bool func_80250074(u8); +void func_8024FD28(u8, s32); +void func_8024FC1C(u8, s32); +void func_8025AC20(enum comusic_e, s32, s32, f32, char*, s32); +void func_8025AC7C(enum comusic_e, s32, s32, f32, s32, char*, s32); +void func_80259B14(void); +void func_8025A55C(s32, s32, s32); +void func_8025A7DC(enum comusic_e); +void func_8025ABB8(enum comusic_e, s32, s32, s32); +void *func_802EDAA4(SLA **, s32*); + +/* .bss */ +extern CoMusic *D_80276E30; //active track ptr +extern int D_80276E34; + +/* .code */ +CoMusic *func_802598B0(enum comusic_e track_id) { + CoMusic *iMusPtr; + CoMusic *freeSlotPtr; + + freeSlotPtr = NULL; + for(iMusPtr = D_80276E30 + 1; iMusPtr < D_80276E30 + 5; iMusPtr++) { + if (track_id == iMusPtr->unk10) { + return iMusPtr; + } + if (freeSlotPtr == 0) { + if ((s32) iMusPtr->unk10 < 0) { + freeSlotPtr = iMusPtr; + } + } + } + return freeSlotPtr; +} + +void func_80259914(CoMusic *this, s32 arg1, s32 arg2){ + s32 sp2C; + s32 i; + struct12s *tmp; + + array_clear(this->unk18); + for(i = 0; i < 0xE; i++){ + this->unk1C[i] = 0; + } + tmp = (struct12s *)func_802EDAA4(&this->unk18, &sp2C); + tmp->unk0 = arg1; + tmp->unk1 = arg2; +} + +void func_80259994(CoMusic *this, s32 arg1){ + func_80259914(this, arg1, arg1); +} + +void func_802599B4(CoMusic *this){ + func_80259994(this, func_80250034(this->unk10)); + this->unk10 = -1; + this->unk14 = 0; + this->unk15 = 0; + func_8024FC1C(this - D_80276E30, -1); +} + +void func_80259A24(void){ + CoMusic * iPtr; + s32 i; + + if(D_80276E30 != NULL) + func_80259B14(); + + D_80276E30 = (CoMusic *) malloc(6*sizeof(CoMusic)); + for(iPtr = D_80276E30; iPtr < D_80276E30 + 6; iPtr++){ + iPtr->unk10 = -1; + iPtr->unk8 = 0; + iPtr->unk12 = 0; + iPtr->unkC = 0; + iPtr->unk4 = 0.0f; + iPtr->unk14 = 0; + iPtr->unk15 = 0; + iPtr->unk0 = 0.0f; + iPtr->unk18 = array_new(sizeof(struct12s),4); + for(i = 0; i < 0xE; i++){ + iPtr->unk1C[i] = 0; + } + } +} + +//comusic_freeAll +void func_80259B14(void){ + CoMusic *iPtr; + func_8024FB8C(); + func_8024F83C(); + + for(iPtr = D_80276E30; iPtr < D_80276E30 + 6; iPtr++){ + array_free(iPtr->unk18); + } + free(D_80276E30); + D_80276E30 = NULL; +} + +//comusic_count +s32 func_80259B8C(void){ + CoMusic * iPtr; + s32 cnt = 0; + for(iPtr = D_80276E30; iPtr < D_80276E30 + 6; iPtr++){ + if(iPtr->unk10 >= 0) + cnt++; + } + return cnt; +} + +void func_80259BD0(void) { + s32 temp_lo; + CoMusic *var_s0; + f32 sp3C; + + + sp3C = time_getDelta(); + for(var_s0 = D_80276E30; var_s0 < &D_80276E30[6]; var_s0++){ + if (var_s0->unk10 >= 0) { + temp_lo = var_s0 - D_80276E30; + var_s0->unk4 = min_f(var_s0->unk4 + sp3C, 600.0f); + if ((var_s0->unk4 > 1.0f) && func_80250074(temp_lo)) { + func_8025A7DC(var_s0->unk10); + } + } + } + func_8024FF34(); + if (!D_80276E34) + return; + + D_80276E34 = FALSE; + for(var_s0 = D_80276E30; var_s0 < &D_80276E30[6]; var_s0++){ + if (var_s0->unk10 >= 0) { + if (var_s0->unk12 != 0) { + temp_lo = var_s0 - D_80276E30; + if (var_s0->unk0 > 0.0f) { + var_s0->unk0 -= time_getDelta(); + D_80276E34 = TRUE; + } else if (var_s0->unk12 < 0) { + var_s0->unk8 += var_s0->unk12; + if (var_s0->unk15 && (var_s0->unkC == 0) && (var_s0->unk8 <= 0)) { + func_802599B4(var_s0); + continue; + } else { + if (var_s0->unkC >= var_s0->unk8) { + var_s0->unk8 = var_s0->unkC; + var_s0->unk12 = 0; + } else { + D_80276E34 = TRUE; + } + func_8024FD28(temp_lo, (s16)var_s0->unk8); + } + } else if (var_s0->unk8 < var_s0->unkC) { + if (var_s0->unk8 == 0) { + var_s0->unk4 = 0.0f; + } + var_s0->unk8 += var_s0->unk12; + if (var_s0->unk8 >= var_s0->unkC) { + var_s0->unk8 = var_s0->unkC; + var_s0->unk12 = 0; + } else { + D_80276E34 = TRUE; + } + func_8024FD28(temp_lo, (s16)var_s0->unk8); + } else { + var_s0->unk12 = 0; + } + } + } + } +} + +void func_80259EA8(CoMusic *this, s32 *arg1, s32 *arg2){ + int i; + int cnt = array_size(this->unk18); + s32 tmp_s1 = 0x7FFF; + s32 tmp_s2 = 0x40000000; + struct12s *tmp_ptr; + + for(i = 1; i < cnt; i++){ + if(func_802EDC18(this->unk18, i)){ + tmp_ptr = (struct12s*)array_at(this->unk18, i); + if(tmp_ptr->unk0 < tmp_s1 || (tmp_s1 == tmp_ptr->unk0 && tmp_ptr->unk1 < tmp_s2)){ + tmp_s1 = tmp_ptr->unk0; + tmp_s2 = tmp_ptr->unk1; + }//L80259F40 + } + } + *arg1 = tmp_s1; + *arg2 = tmp_s2; +} + +void func_80259F7C(CoMusic *self, s32 *arg1, s32 *arg2, s32 *arg3) { + struct12s *temp_v0; + f32 pad; + s32 sp34; + s32 var_s2; + + var_s2 = *arg1; + sp34 = *arg2; + if ((*arg3 != 0) && !func_802EDC18(self->unk18, *arg3)) { + *arg3 = 0; + } + + if (var_s2 < 0) { + temp_v0 = (struct12s *)array_at(self->unk18, 1); + if (temp_v0->unk0 < func_80250034(self->unk10)) { + var_s2 = func_80250034(self->unk10); + } + else{ + var_s2 = temp_v0->unk0; + } + if (*arg3 != 0) { + temp_v0 = (struct12s *)array_at(self->unk18, *arg3); + *arg2 = temp_v0->unk1; + func_802EDCDC(self->unk18, *arg3); + *arg3 = 0; + func_80259EA8(self, arg1, &sp34); + return; + } + } + + if (*arg3 == 0) { + temp_v0 = (struct12s *)array_at(self->unk18, 1); + if ((temp_v0->unk0 < var_s2) || ((var_s2 == temp_v0->unk0) && (sp34 >= temp_v0->unk1))) { + func_80259914(self, var_s2, sp34); + } else { + func_802EDAA4(&self->unk18, arg3); + } + } + if (*arg3 != 0) { + temp_v0 = (struct12s *)array_at(self->unk18, *arg3); + temp_v0->unk0 = var_s2; + temp_v0->unk1 = sp34; + } + func_80259EA8(self, arg1, arg2); +} + +void func_8025A104(enum comusic_e arg0, s32 arg1){ + if (arg0 != D_80276E30[0].unk10){ + func_8024FC1C(0, arg0); + } + func_8024FD28(0, (s16)arg1); + D_80276E30[0].unk10 = (s16) arg0; + D_80276E30[0].unk8 = arg1; + D_80276E30[0].unk0 = 0.0f; + D_80276E30[0].unk12 = 0; + D_80276E30[0].unk4 = 0.0f; + D_80276E30[0].unk15 = 0; + func_80259994(&D_80276E30[0], arg1); +} + +void func_8025A1A8(enum comusic_e arg0){ + + if (arg0 != D_80276E30[0].unk10){ + func_8024FC1C(0, arg0); + D_80276E30[0].unk10 = (s16) arg0; + D_80276E30[0].unk8 = func_80250034(arg0); + D_80276E30[0].unk0 = 0.0f; + D_80276E30[0].unk12 = 0; + D_80276E30[0].unk4 = 0.0f; + D_80276E30[0].unk15 = 0; + func_80259994(&D_80276E30[0], D_80276E30[0].unk8); + } +} + +void func_8025A23C(s32 arg0){ + CoMusic *music = &D_80276E30[5]; + s32 temp_v0; + + if (arg0 != music->unk10){ + func_8024FC1C(5, arg0); + music->unk10 = (s16) arg0; + temp_v0 = func_80250034(arg0); + music->unk8 = temp_v0; + music->unk12 = 0; + music->unk15 = 0; + music->unk0 = 0.0f; + music->unk4 = 0.0f; + func_80259994(music, temp_v0); + } +} + +void func_8025A2B0(void){ + func_802599B4(&D_80276E30[5]); +} + +void func_8025A2D8(void){ + func_802599B4(&D_80276E30[0]); +} + +void func_8025A2FC(s32 arg0, s32 arg1){ + s32 i; + + func_8025A55C(arg0, arg1, 1); + for (i = 1; i < 5; i++){ + s16 val = (i + D_80276E30)->unk10; // Doesn't match with D_80276E30[i] + if (val >= 0){ + func_8025ABB8(val, arg0, arg1, 1); + } + } +} + +void func_8025A388(s32 arg0, s32 arg1) { + s32 i; + + if (D_80276E30->unk14 == 0){ + func_8025A55C(arg0, arg1, 1); + } + for (i = 1; i < 5; i++){ + CoMusic *current = (i + D_80276E30); // Doesn't match with D_80276E30[i] + if (current->unk10 >= 0 && current->unk14 == 0){ + func_8025ABB8(current->unk10, arg0, arg1, 1); + } + } +} + +void func_8025A430(s32 arg0, s32 arg1, s32 arg2){ + s32 i; + + func_8025A55C(arg0, arg1, arg2); + for (i = 1; i < 5; i++){ + s16 val = (i + D_80276E30)->unk10; // Doesn't match with D_80276E30[i] + if (val >= 0){ + func_8025ABB8(val, arg0, arg1, arg2); + } + } +} + +void func_8025A4C4(s32 arg0, s32 arg1, s32 *arg2){ + if(D_80276E30[0].unk10 >= 0){ + func_80259F7C(&D_80276E30[0], &arg0, &arg1, arg2); + if(arg0 != D_80276E30[0].unk8){ + if(D_80276E30[0].unk8 < arg0){ + D_80276E30[0].unk12 = arg1; + } + else{ + D_80276E30[0].unk12 = -arg1; + } + D_80276E30[0].unkC = arg0; + D_80276E34 = 1; + } + } +} + +void func_8025A55C(s32 arg0, s32 arg1, s32 arg2){ + func_8025A4C4(arg0, arg1, &D_80276E30->unk1C[arg2]); +} + +void func_8025A58C(s32 arg0, s32 arg1){ + func_8025A55C(arg0, arg1, 0); +} + + +void func_8025A5AC(enum comusic_e comusic_id, s32 arg1, s32 arg2){ + CoMusic *tmp_a2; + s32 sp20; + + if(arg1 == -1){ + arg1 = func_80250034(comusic_id); + } + + tmp_a2 = func_802598B0(comusic_id); + if(tmp_a2 == NULL) + return; + + sp20 = (tmp_a2 - D_80276E30); + if(tmp_a2->unk10 < 0 || arg2){ + switch(comusic_id){ + case COMUSIC_15_EXTRA_LIFE_COLLECTED: + if(map_get() != MAP_10_BGS_MR_VILE){ + case COMUSIC_3B_MINIGAME_VICTORY: + case COMUSIC_3C_MINIGAME_LOSS: + func_8025AE50(4000, 2.0f); + }//L8025A668 + } + tmp_a2->unk10 = comusic_id; + tmp_a2->unk12 = 0; + tmp_a2->unk15 = 0; + tmp_a2->unk4 = 0.0f; + func_80259994(tmp_a2, arg1); + func_8024FC1C(sp20, comusic_id); + } + func_8024FD28(sp20, (s16) arg1); + tmp_a2->unk8 = arg1; + +} + +void func_8025A6CC(enum comusic_e arg0, s32 arg1){ + func_8025A5AC(arg0, arg1, 0); +} + +void func_8025A6EC(enum comusic_e track_id, s32 arg1){ + func_8025A5AC(track_id, arg1, 1); +} + +//comusic_queueTrack +void func_8025A70C(enum comusic_e track_id){ + CoMusic *trackPtr; + s32 indx; + + trackPtr = func_802598B0(track_id); + if(trackPtr == NULL) + return; + + indx = trackPtr - D_80276E30; + if(trackPtr->unk10 < 0){ + trackPtr->unk10 = track_id; + trackPtr->unk12 = 0; + trackPtr->unk4 = 0.0f; + func_8024FC1C( indx, track_id); + func_80259994(trackPtr, trackPtr->unk8 = func_80250034(track_id)); + } + +} + +void func_8025A788(enum comusic_e comusic_id, f32 delay1, f32 delay2){ + timedFunc_set_1(delay1, (TFQM1) func_8025A70C, comusic_id); + timedFunc_set_1(delay1 + delay2, (TFQM1) func_8025A7DC, comusic_id); +} + +void func_8025A7DC(enum comusic_e track_id){ + CoMusic *trackPtr; + + trackPtr = func_802598B0(track_id); + if (trackPtr != NULL && trackPtr->unk10 >= 0){ + func_802599B4(trackPtr); + } +} + +s32 func_8025A818(void){ + if (D_80276E30[0].unkC == 0 && D_80276E30[0].unk8 <= 0){ + func_802599B4(&D_80276E30[0]); + return 1; + } + return 0; +} + +s32 func_8025A864(enum comusic_e track_id){ + CoMusic *trackPtr; + + trackPtr = func_802598B0(track_id); + if (trackPtr != NULL && trackPtr->unkC == 0 && trackPtr->unk8 <= 0){ + func_802599B4(trackPtr); + return 1; + } + return 0; +} + +void func_8025A8B8(enum comusic_e track_id, s32 arg1){ + CoMusic *trackPtr; + + trackPtr = func_802598B0(track_id); + if (trackPtr != NULL){ + trackPtr->unk14 = arg1; + } +} + +void func_8025A8E4(s32 arg0) { + if (D_80276E30[0].unk10 >= 0) { + D_80276E30[0].unk14 = arg0; + } +} + +void func_8025A904(void){ + CoMusic *trackPtr = &D_80276E30[0]; + + while (trackPtr < &D_80276E30[6]){ + if (trackPtr->unk10 >= 0){ + func_802599B4(trackPtr); + } + trackPtr++; + } +} + +//dequeue_allTracks +void func_8025A96C(void){ + CoMusic *iPtr; + + for(iPtr = &D_80276E30[1]; iPtr < &D_80276E30[6]; iPtr++){ + if(iPtr->unk10 >= 0){ + func_802599B4(iPtr); + } + } +} + +//dequeue_allTracks +void func_8025A9D4(void){ + CoMusic *iPtr; + + for(iPtr = &D_80276E30[0]; iPtr < &D_80276E30[6]; iPtr++){ + if(iPtr->unk10 >= 0 && !iPtr->unk14){ + func_802599B4(iPtr); + } + } +} + +//dequeue_nonmainTracks +void func_8025AA48(void){ + CoMusic *iPtr; + + for(iPtr = &D_80276E30[1]; iPtr < &D_80276E30[6]; iPtr++){ + if(iPtr->unk10 >= 0 && !iPtr->unk14){ + func_802599B4(iPtr); + } + } +} + +//dequeue_track? +void func_8025AABC(enum comusic_e track_id){ + CoMusic *trackPtr; + + if(trackPtr = func_802598B0(track_id)){ + trackPtr->unk15 = 1; + if(!trackPtr->unk8) + func_802599B4(trackPtr); + } +} + +void func_8025AB00(void){ + D_80276E30[0].unk15 = 1; + if (!D_80276E30[0].unk8){ + func_802599B4(&D_80276E30[0]); + } +} + +void comusic_8025AB44(enum comusic_e comusic_id, s32 arg1, s32 arg2){ + func_8025AC20(comusic_id, arg1, arg2, 0.0f, "comusic.c", 0x39e); +} + +void comusic_8025AB78(enum comusic_e comusic_id, s32 arg1, s32 arg2, s32 arg3){ + func_8025AC7C(comusic_id, arg1, arg2, 0.0f, arg3, "comusic.c", 0x3a3); +} + +void func_8025ABB8(enum comusic_e comusic_id, s32 arg1, s32 arg2, s32 arg3){ + func_8025AC7C(comusic_id, arg1, arg2, 0.0f, (s32)&(func_802598B0(comusic_id)->unk1C[arg3]), "comusic.c", 0x3aa); +} + +void func_8025AC20(enum comusic_e comusic_id, s32 arg1, s32 arg2, f32 arg3, char* arg4, s32 char5){ + func_8025AC7C(comusic_id, arg1, arg2, 0.0f, (s32) func_802598B0(comusic_id)->unk1C, "comusic.c", 0x3b1); +} + +void func_8025AC7C(enum comusic_e comusic_id, s32 arg1, s32 arg2, f32 arg3, s32 arg4, char* arg5, s32 arg6){ + CoMusic *trackPtr; + u32 sp24; + + trackPtr = func_802598B0(comusic_id); + if(trackPtr == NULL) + return; + + if(trackPtr->unk10 < 0){ //Track not ready + if(arg1 == 0) + return; + sp24 = (trackPtr - D_80276E30); + func_8024FC1C(sp24, comusic_id); + trackPtr->unk10 = comusic_id; + trackPtr->unk8 = 0; + trackPtr->unk15 = 0; + trackPtr->unk4 = 0.0f; + func_80259994(trackPtr, 0); + func_8024FD28(sp24, 0); + } + func_80259F7C(trackPtr,&arg1, &arg2, arg4); + trackPtr->unk0 = arg3; + trackPtr->unk12 = (trackPtr->unk8 < arg1)? arg2: -arg2; + trackPtr->unkC = arg1; + D_80276E34 = 1; + +} + +//comusic_trackQueued +int func_8025AD7C(enum comusic_e arg0){ + CoMusic * trackPtr = func_802598B0(arg0); + return (trackPtr == NULL || trackPtr->unk10 == -1)? 0 : 1; +} + +//comusic_isPrimaryTrack +int func_8025ADBC(enum comusic_e arg0){ + return D_80276E30[0].unk10 == arg0; +} + +s32 func_8025ADD4(enum comusic_e id){ + CoMusic * ptr = func_802598B0(id); + return ptr - D_80276E30; +} + +void func_8025AE0C(s32 arg0, f32 arg1){ + func_8025A58C(0, arg0); + timedFunc_set_2(arg1, (TFQM2)func_8025A58C, -1, arg0); +} + +void func_8025AE50(s32 arg0, f32 arg1){ + func_8025A430(0, arg0, 6); + timedFunc_set_3(arg1, (TFQM3)func_8025A430, -1, arg0, 6); +} + +void func_8025AEA0(enum comusic_e track_id, s32 arg1){ + CoMusic *ptr = func_802598B0(track_id); + + if(!ptr) return; + func_8024FDDC(ptr - D_80276E30, arg1); +} + +int func_8025AEEC(void){ + s32 out = func_802501A0(0, 0x6A, 0); + if(out) + func_80250170(0, 0x6A, 0); + return out; +} + +void func_8025AF38(void){ + CoMusic *iPtr; + + if(!D_80276E30) return; + + for(iPtr = &D_80276E30[0]; iPtr < &D_80276E30[6]; iPtr++){ + iPtr->unk18 = array_defrag(iPtr->unk18); + } + D_80276E30 = defrag(D_80276E30); +} diff --git a/src/core1/code_1D00.c b/src/core1/code_1D00.c new file mode 100644 index 00000000..8d8628f6 --- /dev/null +++ b/src/core1/code_1D00.c @@ -0,0 +1,577 @@ +#include +#include "functions.h" +#include "variables.h" +#include "2.0L/PR/sched.h" +#include "n_libaudio.h" + +extern void func_8025C320(s32, ALSynConfig *); + +typedef struct AudioInfo_s { + short *data; /* Output data pointer */ + short frameSamples; /* # of samples synthesized in this frame */ + u8 pad4[2]; + s16 unk8; + u8 padA[2]; + struct AudioInfo_s *unkC; +} AudioInfo; + +typedef struct Struct_1D00_1_s{ + void *unk0; + u8 pad4[4]; + s16 unk8; + u8 pada[2]; + struct Struct_1D00_1_s *unkC; +} Struct_1D00_1; + +typedef struct { + u8 pad0[4]; + AudioInfo *unk4; +} Struct_1D00_2; + +typedef struct Struct_1D00_3_s{ + ALLink unk0; + u32 unk8; + u32 unkC; + u32 unk10; +} Struct_1D00_3; + +typedef struct{ + u8 pad0[0x18]; +}Struct_core1_1D00_4; + +typedef struct struct_core1_1D00_5_s{ + struct struct_core1_1D00_5_s * next; + u8 type; + // u8 pad5[1]; + u16 unk6; + u16 unk8; + union{ + struct{u8 unk0; u8 unk1;}type1; + struct{f32 unk0;}type80; + }unkC; +}OscState; + +void func_8023FBB8(void); +void func_8023FE80(void *); +// void func_802403B8(void); +void amgrHandleDoneMsg(AudioInfo *info); +void *func_802403B8(void *state); +void func_802403F0(void); +void amgrStartThread(void); + + + +extern s32 D_80000300; + +s32 D_80275770 = 0; +s32 D_80275774 = 0; +u8 D_80275778 = 0; +s32 D_8027577C[] = { + 6, /* number of sections in this effect */ + 0x1900, /* total allocated memory */ + /* SECTION 1 */ + 0, /* input */ + 0xA0, /* output */ + 900, /* fbcoef */ + -900, /* ffcoef */ + 500, /* out gain */ + 0x0, /* no chorus rate */ + 0x0, /* no chorus delay */ + 0x0, /* no low-pass filter */ + /* SECTION 2 */ + 0xA0, /* input */ + 0x140, /* output */ + 900, /* fbcoef */ + -900, /* ffcoef */ + 500, /* out gain */ + 0x0, /* no chorus rate */ + 0x0, /* no chorus delay */ + 0x2500, /* low-pass filter */ + /* SECTION 3 */ + 0x320, /* input */ + 0xA00, /* output */ + 13000, /* fbcoef */ + -13000, /* ffcoef */ + 0xE03, /* out gain */ + 0x0, /* no chorus rate */ + 0x0, /* no chorus delay */ + 0x3000, /* low-pass filter */ + /* SECTION 4 */ + 0xC80, /* input */ + 0x15E0, /* output */ + 13000, /* fbcoef */ + -13000, /* ffcoef */ + 0xE03, /* out gain */ + 0x0, /* no chorus rate */ + 0x0, /* no chorus delay */ + 0x3500, /* low-pass filter */ + /* SECTION 5 */ + 0xD20, /* input */ + 0x12C0, /* output */ + 0x2000, /* fbcoef */ + -0x2000, /* ffcoef */ + 0x0, /* no out gain */ + 0x0, /* no chorus rate */ + 0x0, /* no chorus delay */ + 0x4000, /* low-pass filter */ + /* SECTION 6 */ + 0x0, /* input */ + 0x1720, /* output */ + 11000, /* fbcoef */ + -11000, /* ffcoef */ + 0x0, /* no out gain */ + 0x17C, /* chorus rate */ + 0xA, /* chorus delay */ + 0x4500 /* low-pass filter */ +}; + +Struct_1D00_2 *D_80275844 = NULL; +AudioInfo *D_80275848 = NULL; +// extern int D_8027584C;//static int D_8027584C = 0; + +extern s32 osViClock; //0x80277128 + +extern f32 D_80277620; +extern f64 D_80277628; +extern f64 D_80277630; +extern f32 D_80277638; + +struct { + Acmd* ACMDList[2]; + AudioInfo *audioInfo[3]; + OSThread thread; + OSMesgQueue audioFrameMsgQ; + OSMesg audioFrameMsgBuf[8]; + OSMesgQueue audioReplyMsgQ; + OSMesg audioReplyMsgBuf[8]; +} g_AudioManager; +u8 pad_8027C178[0xE78]; +ALHeap D_8027CFF0; +u8 * D_8027D000; +s32 D_8027D004; +OSMesgQueue D_8027D008; +OSMesg D_8027D020; +OSIoMesg D_8027D0E8; +Struct_core1_1D00_4 D_8027D100[58]; +struct { + u8 unk0; + Struct_1D00_3 *unk4; + Struct_1D00_3 *unk8; + u8 padC[0x4]; +} D_8027D5B0; +Struct_1D00_3 D_8027D5C0[90]; +s32 D_8027DCC8; +s32 D_8027DCCC; +s32 D_8027DCD0; +N_ALSynth D_8027DCD8; +ALSynConfig D_8027DD50; +s32 D_8027DD74; +s32 D_8027DD78; +s32 D_8027DD7C; +s32 D_8027DD80; +OscState *freeOscStateList; +OscState oscStates[48]; + + +/* .code */ +f32 _depth2Cents(u8 depth) +{ + f32 x = /*1.0309929847717f*/ D_80277620; + f32 cents = 1.0f; + + while (depth) { + if (depth & 1) { + cents *= x; + } + + x *= x; + depth >>= 1; + } + + return cents; +} + +ALMicroTime initOsc(void **oscState, f32 *initVal, u8 oscType, u8 oscRate, u8 oscDepth, u8 oscDelay, u8 arg6) +{ + OscState *state; + ALMicroTime result = 0; + + if (freeOscStateList != NULL) { + state = freeOscStateList; + freeOscStateList = freeOscStateList->next; + state->type = oscType; + *oscState = state; + result = oscDelay << 14; + + switch (oscType) { + case 1: + state->unk8 = 0; + state->unk6 = 259 - oscRate; + state->unkC.type1.unk0 = oscDepth >> 1; + state->unkC.type1.unk1 = 127 - state->unkC.type1.unk0; + *initVal = state->unkC.type1.unk1; + break; + case 0x80: + state->unkC.type80.unk0 = _depth2Cents(oscDepth); + state->unk8 = 0; + state->unk6 = 259 - oscRate; + *initVal = 1.0f; + break; + default: + break; + } + } + + return result; +} + +ALMicroTime updateOsc(void *oscState, f32 *updateVal) +{ + f32 sp2c; + OscState *state = oscState; + ALMicroTime result = AL_USEC_PER_FRAME; + + switch (state->type) { + case 0x01: + state->unk8++; + + if (state->unk8 >= state->unk6) { + state->unk8 = 0; + } + + sp2c = (f32)state->unk8 / (f32)state->unk6; + sp2c = sinf(sp2c * /*M_TAU*/D_80277628); + sp2c = sp2c * state->unkC.type1.unk0; + *updateVal = state->unkC.type1.unk1 + sp2c; + break; + + case 0x80: + state->unk8++; + + if (state->unk8 >= state->unk6) { + state->unk8 = 0; + } + + sp2c = (f32)state->unk8 / (f32)state->unk6; + sp2c = sinf(sp2c * /*M_TAU*/D_80277630) * state->unkC.type80.unk0; + *updateVal = alCents2Ratio(sp2c); + break; + default: + break; + } + + return result; +} + +void stopOsc(OscState *oscState){ + oscState->next = freeOscStateList; + freeOscStateList = oscState; +} + +void func_8023FA64(ALSeqpConfig *arg0) { + OscState *item; + s32 i; + + freeOscStateList = &oscStates[0]; + item = &oscStates[0]; + for(i = 0; i< 0x2F; i++){ + item->next = &oscStates[i+1]; + item = item->next; + } + item->next = NULL; + arg0->initOsc = initOsc; + arg0->updateOsc = updateOsc; + arg0->stopOsc = stopOsc; +} + +void func_8023FB1C(void){ + D_8027D000 = (u8 *) malloc(0x21000); + bzero(D_8027D000, 0x21000); + alHeapInit(&D_8027CFF0, D_8027D000, 0x21000); + if(D_80000300 != 1) + osViClock = 0x2e6025c; + func_8023FBB8(); + func_80335220(); + func_8024F4E0(); + amgrStartThread(); +} + +//amgrCreate +void func_8023FBB8(void) { + int i; + + osCreateMesgQueue(&D_8027D008, &D_8027D020, 0x32); + osCreateMesgQueue(&g_AudioManager.audioReplyMsgQ, g_AudioManager.audioReplyMsgBuf, 8); //audioReplyMesgQueue + osCreateMesgQueue(&g_AudioManager.audioFrameMsgQ, g_AudioManager.audioFrameMsgBuf, 8); + D_8027DD74 = (s32)D_80277638; + if ((f32) D_8027DD74 < D_80277638) { + D_8027DD74++; + } + D_8027DD74 = ((D_8027DD74 / 0xB8) * 0xB8) + 0xB8; + D_8027DD78 = D_8027DD74 - 0xB8; + D_8027DD7C = D_8027DD74; + D_8027DD50.maxVVoices = 0x18; + D_8027DD50.maxPVoices = 0x18; + D_8027DD50.maxUpdates = 0x80; + D_8027DD50.dmaproc = (void*)func_802403B8; + D_8027DD50.fxType = AL_FX_CUSTOM; + D_8027DD50.params = (void*) &D_8027577C; + D_8027DD50.heap = &D_8027CFF0; + D_8027DD50.outputRate = osAiSetFrequency(22000); + func_8025C320(&D_8027DCD8, &D_8027DD50); + D_8027D5C0[0].unk0.prev = NULL; + D_8027D5C0[0].unk0.next = NULL; + for(i = 0; i < 89; i++){ + alLink((ALLink *)&D_8027D5C0[i+1], (ALLink *)&D_8027D5C0[i]); + D_8027D5C0[i].unk10 = alHeapDBAlloc(0, 0, D_8027DD50.heap, 1, 0x200); + } + D_8027D5C0[i].unk10 = alHeapDBAlloc(0, 0, D_8027DD50.heap, 1, 0x200); + + for(i = 0; i < 2; i++){ + g_AudioManager.ACMDList[i] = malloc(20000); + } + D_8027DD80 = 2500; + for(i = 0; i < 3; i++){ + g_AudioManager.audioInfo[i] = alHeapDBAlloc(0, 0, D_8027DD50.heap, 1, 0x10); + g_AudioManager.audioInfo[i]->unk8 = 0; + g_AudioManager.audioInfo[i]->unkC = g_AudioManager.audioInfo[i]; + g_AudioManager.audioInfo[i]->data = malloc(D_8027DD7C * 4); + } + osCreateThread(&g_AudioManager.thread, 4, &func_8023FE80, 0, &D_8027CFF0, 0x32); +} + +void func_8023FE80(void *arg0) { + s32 phi_s1; + + phi_s1 = 1; + while(1){ + osRecvMesg(&g_AudioManager.audioFrameMsgQ, NULL, OS_MESG_BLOCK); + if (amgr_handleFrameMsg(g_AudioManager.audioInfo[D_8027DCC8 % 3], D_80275848)){ + if(phi_s1 == 0){ + osRecvMesg(&g_AudioManager.audioReplyMsgQ, &D_80275844, OS_MESG_BLOCK); + amgrHandleDoneMsg(D_80275844->unk4); + D_80275848 = D_80275844->unk4; + }else{ + phi_s1 += -1; + } + } + } +} + +void func_8023FFAC(void){ + D_80275770 = osAiGetLength()/4; +} + +void func_8023FFD4(s32 arg0, s32 arg1, s32 arg2){ + return; +} + +bool amgr_handleFrameMsg(AudioInfo *info, AudioInfo *prev_info){ + s16 *outbuffer; + Acmd *sp38; + s32 sp34; + s32 sp30 = 0; + f32 pad; + + outbuffer = (s16 *)osVirtualToPhysical(info->data); + func_802403F0(); + func_8023FFAC(); + if(prev_info){ + sp30 = osAiSetNextBuf(prev_info->data, prev_info->frameSamples*4); + }//L8024003C + if(sp30 == -1){ + func_80247F24(2, 0x7d2); + func_80247F9C(prev_info->frameSamples); + func_80247F9C(info->frameSamples); + func_802483D8(); + + } + + if((D_80275770 >= 0x139) & !D_80275778){ + info->frameSamples = D_8027DD78; + D_80275778 = 2; + } + else{ + info->frameSamples = D_8027DD74; + if(D_80275778) + D_80275778--; + } + + if(info->frameSamples < D_8027DD78){ + info->frameSamples = D_8027DD78; + } + + sp38 = n_alAudioFrame(g_AudioManager.ACMDList[D_8027DCD0], &sp34, outbuffer, info->frameSamples); + + if(D_8027DD80 < sp34){ + func_80247F24(2, 2000); + func_80247F9C(sp34); + func_80247F9C(D_8027DD80); + func_802483D8(); + } + + if(sp34 == 0){ + return 0; + }else{ + func_802535A8(g_AudioManager.ACMDList[D_8027DCD0], sp38, &g_AudioManager.audioReplyMsgQ, &info->unk8); + func_80250650(); + D_8027DCD0 ^= 1; + return 1; + } +} + +void amgrHandleDoneMsg(AudioInfo *info) +{ + static int D_8027584C = TRUE; + if (osAiGetLength() >> 2 == 0 && D_8027584C == FALSE) { + D_8027584C = FALSE; + } +} + +#ifndef NONMATCHING +s32 func_80240204(s32 addr, s32 len, void *state); +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_1D00/func_80240204.s") +#else +s32 func_80240204(s32 addr, s32 len, void *state){ + void *sp44; + s32 sp40; + Struct_1D00_3 *sp30; + Struct_1D00_3 *temp_s0; + ALLink *temp_s0_2; + Struct_1D00_3 *temp_s0_3; + Struct_1D00_3 *temp_v0_2; + s32 temp_t4; + s32 temp_v0_3; + s32 temp_v1; + u32 temp_a3; + u32 temp_v0; + void *temp_t0; + Struct_1D00_3 *phi_s0; + Struct_1D00_3 *phi_a2; + + phi_s0 = D_8027D5B0.unk4; + sp30 = NULL; + while (temp_s0 != NULL) { + temp_v0 = phi_s0->unk8; + if (addr >= temp_v0) { + sp30 = phi_s0; + if ((temp_v0 + 0x200) >= (addr + len)) { + phi_s0->unkC = (s32) D_8027DCC8; + return osVirtualToPhysical((phi_s0->unk10 + addr) - temp_v0); + } + phi_s0 = phi_s0->unk0.next; + } + } + temp_s0_3 = D_8027D5B0.unk8; + if (temp_s0_3 == NULL) { + func_80247F24(2, 0x7D1, sp30, addr); + func_802483D8(); + return osVirtualToPhysical(D_8027D5B0.unk4); + } + D_8027D5B0.unk8 = temp_s0_3->unk0.next; + alUnlink(temp_s0_3); + if (sp30 != NULL) { + alLink(temp_s0_3, sp30); + } else { + temp_v0_2 = D_8027D5B0.unk4; + if (temp_v0_2 != NULL) { + D_8027D5B0.unk4 = temp_s0_3; + temp_s0_3->unk0.next = (ALLink *)temp_v0_2; + temp_s0_3->unk0.prev = NULL; + temp_v0_2->unk0.prev = (ALLink *)temp_s0_3; + } else { + D_8027D5B0.unk4 = temp_s0_3; + temp_s0_3->unk0.next = NULL; + temp_s0_3->unk0.prev = NULL; + } + } + sp40 = addr & 1; + sp44 = temp_s0_3->unk10; + sp40 = temp_v0_3; + temp_s0_3->unk8 = addr - sp40; + temp_s0_3->unkC = (s32) D_8027DCC8; + osPiStartDma(&D_8027D100[D_8027DCCC++], 1, 0, temp_a3, sp44, 0x200U, &D_8027D008); + return osVirtualToPhysical(sp44) + sp40; +} +#endif + +void *func_802403B8(void *state) { + if (D_8027D5B0.unk0 == 0) { + D_8027D5B0.unk4 = NULL; + D_8027D5B0.unk8 = &D_8027D5C0; + D_8027D5B0.unk0 = 1; + } + *(void **)state = &D_8027D5B0; + return &func_80240204; +} + +void func_802403F0(void) { + u32 phi_s0; + OSMesg sp40; + Struct_1D00_3 *phi_s1; + Struct_1D00_3 *phi_s0_2; + + sp40 = NULL; + for(phi_s0 = 0; phi_s0 < D_8027DCCC; phi_s0++){ + if (osRecvMesg(&D_8027D008, &sp40, 0) == -1) { + func_80247F24(2, 0x7D5); + func_80247F9C(D_8027DCCC); + func_80247F9C(phi_s0); + func_802483D8(); + } + } + phi_s0_2 = D_8027D5B0.unk4; + while(phi_s0_2 != NULL){ + phi_s1 = (Struct_1D00_3 *)phi_s0_2->unk0.next; + if (phi_s0_2->unkC + 1 < D_8027DCC8) { + if (phi_s0_2 == D_8027D5B0.unk4) { + D_8027D5B0.unk4 = phi_s0_2->unk0.next; + } + alUnlink(phi_s0_2); + if (D_8027D5B0.unk8 != NULL) { + alLink(&phi_s0_2->unk0, &D_8027D5B0.unk8->unk0); + } else { + D_8027D5B0.unk8 = phi_s0_2; + phi_s0_2->unk0.next = NULL; + phi_s0_2->unk0.prev = NULL; + } + } + phi_s0_2 = phi_s1; + } + D_8027DCCC = 0; + D_8027DCC8 += 1; +} + +void amgrStopThread(void){ + if(D_80275774){ + D_80275774 = 0; + osStopThread(&g_AudioManager.thread); + } +} + +void amgrStartThread(void){ + if(D_80275774 == 0){ + D_80275774 = 1; + osStartThread(&g_AudioManager.thread); + } +} + +OSThread * amgrGetThread(void){ + return &g_AudioManager.thread; +} + +ALHeap * func_802405B8(void){ + return &D_8027CFF0; +} + +OSMesgQueue * func_802405C4(void){ + return &D_8027D008; +} + +OSIoMesg * func_802405D0(void){ + return &D_8027D0E8; +} + +OSMesgQueue * amgr_getFrameMesgQueue(void){ + return &g_AudioManager.audioFrameMsgQ; +} \ No newline at end of file diff --git a/src/core1/code_1D5D0.c b/src/core1/code_1D5D0.c new file mode 100644 index 00000000..0cf244f1 --- /dev/null +++ b/src/core1/code_1D5D0.c @@ -0,0 +1,364 @@ +#include +#include "functions.h" +#include "variables.h" +#include "SnS.h" +#include "save.h" + + + +void sns_init_parsing_params(s32 min, s32 max) +{ + snsMinKeyToParse = min; + snsMaxKeyToParse = max; + snsParsedCurrPos = 0; +} + +u32 sns_get_next_key_in_range(void) +{ + while (snsParsedCurrPos < SNS_PAYLOAD_DATALEN) + { + if (snsParsedKeys[snsParsedCurrPos] >= snsMinKeyToParse + && snsParsedKeys[snsParsedCurrPos] <= snsMaxKeyToParse) + return snsParsedKeys[snsParsedCurrPos++]; + + snsParsedCurrPos++; + } + + return 0; +} + +void sns_update_global_save_data_checksum(void) +{ + s32 i; + + /** + * Updates the save data checksum multiple times (?) + * + * Running this multiple times seems to achieve nothing. + * A debug leftover? + */ + for (i = 5; i != 0 && func_8033CD0C(&gSaveData); i--) + ; +} + +void sns_save_and_update_global_data(void) +{ + s32 i; + + /** + * Triggers a save of the global save data to EEPROM, + * and validates the checksum. + */ + + if (func_8033CA9C(&gSaveData)) + { + /** + * Failed, hide the evidence. + * + * Clears the entire global data area. + */ + + gSaveData.sns.uEggYellow = FALSE; + gSaveData.sns.uEggRed = FALSE; + gSaveData.sns.uEggGreen = FALSE; + gSaveData.sns.uEggBlue = FALSE; + gSaveData.sns.uEggPink = FALSE; + gSaveData.sns.uEggCyan = FALSE; + gSaveData.sns.uIceKey = FALSE; + + gSaveData.sns.cEggYellow = FALSE; + gSaveData.sns.cEggRed = FALSE; + gSaveData.sns.cEggGreen = FALSE; + gSaveData.sns.cEggBlue = FALSE; + gSaveData.sns.cEggPink = FALSE; + gSaveData.sns.cEggCyan = FALSE; + gSaveData.sns.cIceKey = FALSE; + + gSaveData.snsw = gSaveData.snsw << SNS_NUM_FLAGS >> SNS_NUM_FLAGS ^ gSaveData.snsw; + + for (i = 0; i < sizeof(gSaveData.UNUSED); i++) + gSaveData.UNUSED[i] = 0; + + sns_update_global_save_data_checksum(); + } + + sns_unlock_parsed_items(); + sns_update_global_save_data_checksum(); +} + +/** + * Scans N64 RDRAM for a valid payload, and if found, + * parses it for the key values and saves them internally. + */ +void sns_find_and_parse_payload(void) +{ + struct SnsPayload *payload; + s32 i; + + for (i = 0; i < SNS_PAYLOAD_DATALEN; i++) + snsParsedKeys[i] = 0; + + payload = snspayload_find_payload_in_ram(); + + if (payload) + { + snspayload_rewind_incoming(); + + i = 0; + while (i < SNS_PAYLOAD_DATALEN) + { + u32 val = snspayload_get_next_key(payload); + + snsParsedKeys[i] = val; + + if (val) + i++; + else + i = SNS_PAYLOAD_DATALEN; + } + } +} + +void sns_init_base_payloads(void) +{ + snsBasePayloadPtr3 = snspayload_init_new_payload((struct SnsPayload *)0x803FFF00); + snsBasePayloadPtr4 = snspayload_init_new_payload((struct SnsPayload *)0x803A5C00); + snsBasePayloadPtr1 = snspayload_init_new_payload((struct SnsPayload *)func_8025484C(0x100)); + snsBasePayloadPtr2 = snspayload_init_new_payload((struct SnsPayload *)func_80254898(0x100)); +} + +bool sns_get_or_set_key(bool state, struct SnsPayload *payload, s32 key, s32 mode) +{ + if (mode == SNS_MODE_WRITE) + { + if (state) + snspayload_append_key_to_outgoing_payload(payload, key); + + return state; + } + + if (mode == SNS_MODE_READ) + { + /** + * A VERY roundabout way of simply searching through the + * parsed values to see if the given key is present. + * + * It feels like a leftover remnant from code written + * hastily during testing of SnS. + */ + + sns_init_parsing_params(key, key); + + return sns_get_next_key_in_range() ? TRUE : state; + } + + return FALSE; +} + +void sns_commit_collected_flags(s32 mode, struct SnsPayload *payload) +{ + gSaveData.sns.cEggYellow = sns_get_or_set_key(gSaveData.sns.cEggYellow, payload, SNS_ITEM_COLLECTED_EggYellow, mode); + gSaveData.sns.cEggRed = sns_get_or_set_key(gSaveData.sns.cEggRed, payload, SNS_ITEM_COLLECTED_EggRed, mode); + gSaveData.sns.cEggGreen = sns_get_or_set_key(gSaveData.sns.cEggGreen, payload, SNS_ITEM_COLLECTED_EggGreen, mode); + gSaveData.sns.cEggBlue = sns_get_or_set_key(gSaveData.sns.cEggBlue, payload, SNS_ITEM_COLLECTED_EggBlue, mode); + gSaveData.sns.cEggPink = sns_get_or_set_key(gSaveData.sns.cEggPink, payload, SNS_ITEM_COLLECTED_EggPink, mode); + gSaveData.sns.cEggCyan = sns_get_or_set_key(gSaveData.sns.cEggCyan, payload, SNS_ITEM_COLLECTED_EggCyan, mode); + gSaveData.sns.cIceKey = sns_get_or_set_key(gSaveData.sns.cIceKey, payload, SNS_ITEM_COLLECTED_IceKey, mode); +} + +void sns_commit_unlocked_flags(s32 mode, struct SnsPayload *payload) +{ + gSaveData.sns.uEggYellow = sns_get_or_set_key(gSaveData.sns.uEggYellow, payload, SNS_ITEM_UNLOCKED_EggYellow, mode); + gSaveData.sns.uEggRed = sns_get_or_set_key(gSaveData.sns.uEggRed, payload, SNS_ITEM_UNLOCKED_EggRed, mode); + gSaveData.sns.uEggGreen = sns_get_or_set_key(gSaveData.sns.uEggGreen, payload, SNS_ITEM_UNLOCKED_EggGreen, mode); + gSaveData.sns.uEggBlue = sns_get_or_set_key(gSaveData.sns.uEggBlue, payload, SNS_ITEM_UNLOCKED_EggBlue, mode); + gSaveData.sns.uEggPink = sns_get_or_set_key(gSaveData.sns.uEggPink, payload, SNS_ITEM_UNLOCKED_EggPink, mode); + gSaveData.sns.uEggCyan = sns_get_or_set_key(gSaveData.sns.uEggCyan, payload, SNS_ITEM_UNLOCKED_EggCyan, mode); + gSaveData.sns.uIceKey = sns_get_or_set_key(gSaveData.sns.uIceKey, payload, SNS_ITEM_UNLOCKED_IceKey, mode); +} + +void sns_unlock_parsed_items(void) +{ + sns_commit_unlocked_flags(SNS_MODE_READ, NULL); +} + +void sns_generate_payload(struct SnsPayload *payload) +{ + snspayload_rewind_outgoing(); + snspayload_append_key_to_outgoing_payload(payload, 1); + sns_commit_collected_flags(SNS_MODE_WRITE, payload); + snspayload_finalise_outgoing_payload(payload); +} + +/** + * Writes payload to RAM for another Rareware game + * to read and parse after swapping cartridges. + */ +void sns_write_payload_over_heap(void) +{ + s32 val2; + u32 i; + + if (func_8023DB5C() <= 0x3B || snsToRestoreItems) + return; + + sns_generate_payload(snsBasePayloadPtr2); + + // memcpy + func_80254630(snsBasePayloadPtr3, snsBasePayloadPtr2, sizeof(*snsBasePayloadPtr2)); + func_80254630(snsBasePayloadPtr4, snsBasePayloadPtr2, sizeof(*snsBasePayloadPtr2)); + + for (i = 1; i < 5; i++) + { + u32 val1 = func_80254BD0(&val2, i); + + if (val1 && val2 > 0x4000) + { + s32 val3 = val1 - 0x400 + val2; + + val1 -= val1 & 0x1FFF; + + for (val1 += 0x2C00; val1 < val3; val1 += 0x2000) + // memcpy + func_80254630((void *)val1, snsBasePayloadPtr2, sizeof(*snsBasePayloadPtr2)); + } + } +} + +void sns_stub(void) {} + +/** + * Dev flag: to boot straight to a specific map. + * + * This value is unused in the retail builds, but may have + * been used in debug builds. + * + * If TRUE, on boot, the game will start in the furnace fun + * portal room (used for testing furnace fun?) + * + * If FALSE, on boot, the game will start on the file select + * screen (skips all the logo cutscenes) + */ +bool DEBUG_use_special_bootmap(void) +{ + return FALSE; +} + +/** + * Dev flag: purpose unknown? + */ +bool func_8025B818(void) +{ + return TRUE; +} + +bool sns_get_item_state(enum StopNSwop_Item item, s32 set) +{ + switch (item) + { + case SNS_ITEM_EGG_YELLOW: return set == SNS_COLLECTED ? gSaveData.sns.cEggYellow : gSaveData.sns.uEggYellow; + case SNS_ITEM_EGG_RED: return set == SNS_COLLECTED ? gSaveData.sns.cEggRed : gSaveData.sns.uEggRed; + case SNS_ITEM_EGG_GREEN: return set == SNS_COLLECTED ? gSaveData.sns.cEggGreen : gSaveData.sns.uEggGreen; + case SNS_ITEM_EGG_BLUE: return set == SNS_COLLECTED ? gSaveData.sns.cEggBlue : gSaveData.sns.uEggBlue; + case SNS_ITEM_EGG_PINK: return set == SNS_COLLECTED ? gSaveData.sns.cEggPink : gSaveData.sns.uEggPink; + case SNS_ITEM_EGG_CYAN: return set == SNS_COLLECTED ? gSaveData.sns.cEggCyan : gSaveData.sns.uEggCyan; + case SNS_ITEM_ICE_KEY: return set == SNS_COLLECTED ? gSaveData.sns.cIceKey : gSaveData.sns.uIceKey; + default: + return FALSE; + } +} + +void sns_set_item_state(enum StopNSwop_Item item, s32 set, s32 state) +{ + if (set == SNS_COLLECTED) + { + switch (item) + { + case SNS_ITEM_EGG_YELLOW: gSaveData.sns.cEggYellow = state; return; + case SNS_ITEM_EGG_RED: gSaveData.sns.cEggRed = state; return; + case SNS_ITEM_EGG_GREEN: gSaveData.sns.cEggGreen = state; return; + case SNS_ITEM_EGG_BLUE: gSaveData.sns.cEggBlue = state; return; + case SNS_ITEM_EGG_PINK: gSaveData.sns.cEggPink = state; return; + case SNS_ITEM_EGG_CYAN: gSaveData.sns.cEggCyan = state; return; + // debug string? + case SNS_ITEM_ICE_KEY: gSaveData.sns.cIceKey = state; if (0); return; + default: + return; + } + } + else // SNS_UNLOCKED + { + switch (item) + { + case SNS_ITEM_EGG_YELLOW: gSaveData.sns.uEggYellow = state; return; + case SNS_ITEM_EGG_RED: gSaveData.sns.uEggRed = state; return; + case SNS_ITEM_EGG_GREEN: gSaveData.sns.uEggGreen = state; return; + case SNS_ITEM_EGG_BLUE: gSaveData.sns.uEggBlue = state; return; + case SNS_ITEM_EGG_PINK: gSaveData.sns.uEggPink = state; return; + case SNS_ITEM_EGG_CYAN: gSaveData.sns.uEggCyan = state; return; + case SNS_ITEM_ICE_KEY: gSaveData.sns.uIceKey = state; return; + default: + return; + } + } +} + +void sns_set_item_and_update_payload(enum StopNSwop_Item item, s32 set, s32 state) +{ + sns_set_item_state(item, set, state); + sns_update_global_save_data_checksum(); + sns_write_payload_over_heap(); +} + +/** + * Used for the cutscene at the end of the game where Mumbo shows + * you Stop 'n' Swop hints. + * + * Backs up your item flags, then forces them all to be unlocked + * and not collected, so they can be seen during the hint sequences. + */ +void sns_backup_items_and_unlock_all(void) +{ + u32 i; + + if (snsToRestoreItems) + return; + + sns_write_payload_over_heap(); + + snsToRestoreItems = TRUE; + + // statements on same line for match (why?) + snsBackedUpItems = 0; for (i = 1; i < SNS_ITEM_length; i++) + { + snsBackedUpItems = (sns_get_item_state(i, SNS_UNLOCKED) ? 1 : 0) + (snsBackedUpItems << 1); + snsBackedUpItems = (sns_get_item_state(i, SNS_COLLECTED) ? 1 : 0) + (snsBackedUpItems << 1); + sns_set_item_state(i, SNS_UNLOCKED, TRUE); + sns_set_item_state(i, SNS_COLLECTED, FALSE); + } +} + +/** + * Used when ending the cutscene where Mumbo shows you Stop 'n' + * Swop hints. + * + * It restores whatever item flags you had before it was triggered. + */ +void sns_restore_backed_up_items(void) +{ + u32 i; + + if (!snsToRestoreItems) + return; + + for (i = SNS_ITEM_length - 1; i > 0; i--) + { + sns_set_item_state(i, SNS_COLLECTED, snsBackedUpItems & 1); + snsBackedUpItems >>= 1; + sns_set_item_state(i, SNS_UNLOCKED, snsBackedUpItems & 1); + snsBackedUpItems >>= 1; + } + + snsToRestoreItems = FALSE; +} + diff --git a/src/core1/code_1E6E0.c b/src/core1/code_1E6E0.c new file mode 100644 index 00000000..1dd29784 --- /dev/null +++ b/src/core1/code_1E6E0.c @@ -0,0 +1,47 @@ +#include +#include "functions.h" +#include "variables.h" + +// transform seed (in mips3 file) +u32 func_8025C29C(u32 *seed); + +void glcrc_calc_checksum(void *start, void *end, u32 checksum[2]) +{ + u8 *p; + + u32 shift = 0; + + u64 seed = 0x8F809F473108B3C1; + + u32 crc1 = 0; + u32 crc2 = 0; + + u32 tmp; + + // CRC1: Iterate forwards over bytes + for (p = start; (void *)p < end; p++) + { + seed += *p << (shift & 15); + + tmp = func_8025C29C(&seed); + + shift += 7; + + crc1 ^= tmp; + } + + // CRC2: Iterate backwards over bytes + for (p = (u8 *)end - 1; (void *)p >= start; p--) + { + seed += *p << (shift & 15); + + tmp = func_8025C29C(&seed); + + shift += 3; + + crc2 ^= tmp; + } + + checksum[0] = crc1; + checksum[1] = crc2; +} diff --git a/src/core1/code_1E820.c b/src/core1/code_1E820.c new file mode 100644 index 00000000..12f7934d --- /dev/null +++ b/src/core1/code_1E820.c @@ -0,0 +1,12 @@ +#include +#include "functions.h" +#include "variables.h" + +s64 D_80376E70; + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_1E820/func_8025C240.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_1E820/func_8025C288.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_1E820/func_8025C29C.s") + diff --git a/src/core1/code_22E40.c b/src/core1/code_22E40.c new file mode 100644 index 00000000..4bb21c69 --- /dev/null +++ b/src/core1/code_22E40.c @@ -0,0 +1,86 @@ +#include +#include "functions.h" +#include "variables.h" + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/func_80260860.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/func_802609E0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/func_80260BD4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/n_alEnvmixerPull.s") + +void __postNextSeqEvent(ALSeqPlayer *seqp) +{ + ALEvent evt; + s32 deltaTicks; + ALSeq *seq = seqp->target; + + /* sct 1/5/96 - Do nothing if we're not playing or don't have a target sequence. */ + if ((seqp->state != AL_PLAYING) || (seq == NULL)) + return; + + /* Get the next event time in ticks. */ + /* If false is returned, then there is no next delta (ie. end of sequence reached). */ + if (!__alSeqNextDelta(seq, &deltaTicks)) + return; + + /* Handle loops. */ + if (seqp->loopCount) + { + /* Assume that the loop end falls on a MIDI event. Delta time + will be correct even if we loop */ + if (alSeqGetTicks(seq) + deltaTicks >= seqp->loopEnd->curTicks) + { + alSeqSetLoc(seq, seqp->loopStart); + + if (seqp->loopCount != -1) + seqp->loopCount--; + } + } + + evt.type = AL_SEQ_REF_EVT; + //alEvtqPostEvent(&seqp->evtq, &evt, deltaTicks * seqp->uspt); + alEvtqPostEvent(&seqp->evtq, &evt, deltaTicks * seqp->uspt); + +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/__setInstChanState.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/func_80261348.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/__initFromBank.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/func_80261490.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/__vsDelta.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/__vsVol.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/__seqpReleaseVoice.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/__voiceNeedsNoteKill.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/__unmapVoice.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/func_802617A0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/__vsPan.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/__lookupVoice.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/__mapVoice.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/__lookupSoundQuick.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/func_80261A94.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/func_802623F4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/func_802623FC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/__seqpStopOsc.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/__initChanState.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_22E40/func_80262BFC.s") diff --git a/src/core1/code_25E20.c b/src/core1/code_25E20.c new file mode 100644 index 00000000..0d12a1f9 --- /dev/null +++ b/src/core1/code_25E20.c @@ -0,0 +1,16 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_80263840(void){} + +void func_80263848(void){} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_25E20/func_80263850.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_25E20/func_802639FC.s") + +void func_80263B1C(void){} + +void func_80263B24(void){} diff --git a/src/core1/code_26110.c b/src/core1/code_26110.c new file mode 100644 index 00000000..b06731ec --- /dev/null +++ b/src/core1/code_26110.c @@ -0,0 +1,8 @@ +#include +#include "functions.h" +#include "variables.h" + + +n_alSynSetPriority(ALVoice *voice, s16 priority){ + voice->priority = priority; +} diff --git a/src/core1/code_2BD0.c b/src/core1/code_2BD0.c new file mode 100644 index 00000000..7d1f0906 --- /dev/null +++ b/src/core1/code_2BD0.c @@ -0,0 +1,42 @@ +#include +#include "functions.h" +#include "variables.h" + +OSIoMesg D_8027E090; +OSMesg D_8027E0A8; +OSMesgQueue D_8027E0AC; +OSMesg D_8027E0C8[16]; //g_PimgrMesgBuffer +OSMesgQueue D_8027E108; //g_PimgrMesgQueue + + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_2BD0/func_802405F0.s") +#else +void func_802405F0(u32 arg0, u32 arg1, s32 size){ + int i; + s32 block_cnt; + s32 block_remainder; + s32 block_size = 0x20000; + + osWritebackDCache(arg0, size); + block_cnt = size/block_size; + for(i = 0; i < block_cnt; i++){ + osPiStartDma(&D_8027E090, OS_MESG_PRI_NORMAL, OS_READ, arg1, arg0, block_size, &D_8027E0AC); + osRecvMesg(&D_8027E0AC, NULL, 1); + arg0 += 0x20000; + arg1 += 0x20000; + } + + block_remainder = size%0x20000; + osPiStartDma(&D_8027E090, OS_MESG_PRI_NORMAL, OS_READ, arg1, arg0, block_remainder, &D_8027E0AC); + osRecvMesg(&D_8027E0AC, NULL, 1); + osInvalDCache(arg0, size); + +} +#endif + +void func_80240754(void){ + osCreateMesgQueue(&D_8027E0AC, &D_8027E0A8, 1); + osCreateMesgQueue(&D_8027E108, &D_8027E0C8[0], 16); + osCreatePiManager(OS_PRIORITY_PIMGR, &D_8027E108, &D_8027E0C8[0], 16); +} diff --git a/src/core1/code_2DA0.c b/src/core1/code_2DA0.c new file mode 100644 index 00000000..f96b4578 --- /dev/null +++ b/src/core1/code_2DA0.c @@ -0,0 +1,57 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80240924(s32 arg0); + +OSMesgQueue D_8027E120; +OSMesg D_8027E138; +OSMesgQueue D_8027E140; +OSMesg D_8027E158; +OSThread D_8027E160; +u8 pad_8027E310[0x800]; +extern u8 D_8027EB10; + +/* .code */ +void func_802407C0(void){ + osCreateMesgQueue(&D_8027E120, &D_8027E138, 1); + osCreateMesgQueue(&D_8027E140, &D_8027E158, 1); + osCreateThread(&D_8027E160, 2, func_80240924, NULL, &D_8027EB10, 10); + osStartThread(&D_8027E160); +} + +void func_80240844(void){ + osStopThread(&D_8027E160); + osDestroyThread(&D_8027E160); +} + +void func_80240874(void){ + if(func_8023E000() == 3){ + osSendMesg(&D_8027E120, NULL, OS_MESG_BLOCK); + } +} + +void func_802408B0(void){ + if(func_8023E000() == 3){ + osSendMesg(&D_8027E140, NULL, OS_MESG_BLOCK); + } +} + +void func_802408EC(OSPri pri){ + if(func_8023E000() == 3){ + osSetThreadPri(&D_8027E160, pri); + } +} + +void func_80240924(s32 arg0){ + int tmp_v0; + do{ + osRecvMesg(&D_8027E120, NULL, OS_MESG_BLOCK); + if(!D_8027E140.validCount){ + do{ + tmp_v0 = func_802E48D8(); + }while(!D_8027E140.validCount && tmp_v0); + } + osRecvMesg(&D_8027E140, NULL, OS_MESG_BLOCK); + }while(1); +} diff --git a/src/core1/code_2FA0.c b/src/core1/code_2FA0.c new file mode 100644 index 00000000..223ff49c --- /dev/null +++ b/src/core1/code_2FA0.c @@ -0,0 +1,68 @@ +#include +#include "functions.h" +#include "variables.h" + +s32 D_80275860 = 0; + +void func_802409C0(f32 arg0[3], f32 arg1){ + f32 sp3C[3]; + f32 sp30[3]; + f32 sp28[2]; + f32 sp24; + + sp24 = time_getDelta()*arg1; + func_8024E71C(0, sp28); + + sp30[0] = sp28[0] * sp24; + sp30[1] = 0.0f; + sp30[2] = -(sp28[1] * sp24); + + func_8024C764(&sp3C); + ml_vec3f_yaw_rotate_copy(sp30, sp30, sp3C[1]); + + arg0[0] = arg0[0] + sp30[0]; + arg0[1] = arg0[1] + sp30[1]; + arg0[2] = arg0[2] + sp30[2]; +} + +void func_80240A74(f32 arg0[3]){ + func_802409C0(arg0, 400.0f); +} + +f32 func_80240A94(s32 arg0, f32 arg1){ + if(arg0 >= 0x29){ + arg0 = 0x28; + } + return arg1 + (f32)arg0*(arg1)/16 ; +} + +void func_80240AC8(f32 arg0[3], f32 arg1){ + f32 sp3C[3]; + f32 sp30[3]; + f32 sp28[2]; + f32 sp24; + + sp24 = time_getDelta()*arg1; + func_8024E71C(0, sp28); + + if(0.0f != sp28[0] || 0.0f != sp28[1]){ + D_80275860++; + if(D_80275860 >= 0x12D) + D_80275860 = 0x12C; + } + else{ + D_80275860 = 1; + } + + sp24 = func_80240A94(D_80275860, sp24); + sp30[0] = sp28[0] * sp24; + sp30[1] = 0.0f; + sp30[2] = -(sp28[1] * sp24); + + func_8024C764(&sp3C); + ml_vec3f_yaw_rotate_copy(sp30, sp30, sp3C[1]); + + arg0[0] = arg0[0] + sp30[0]; + arg0[1] = arg0[1] + sp30[1]; + arg0[2] = arg0[2] + sp30[2]; +} diff --git a/src/core1/code_31C0.c b/src/core1/code_31C0.c new file mode 100644 index 00000000..5ed688c6 --- /dev/null +++ b/src/core1/code_31C0.c @@ -0,0 +1,123 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern f64 D_80277640; + +u8 D_8027EB10[0x200]; // Size based on the previous symbol's address +OSThread D_8027ED10; + + +void func_80240C30(void*); + +void func_80240BE0(void){ + osCreateThread(&D_8027ED10, 1, func_80240C30, NULL, &D_8027EB10[0x200], 0); + osStartThread(&D_8027ED10); +} + +void func_80240754(void); +void func_8023E018(void); +OSThread *func_8023E060(void); + +void func_80240C30(void *arg) +{ + func_80240754(); + func_8023E018(); + osStartThread(func_8023E060()); + while (1); +} + +static void _guMtxF2L(float mf[4][4], Mtx *m) +{ + int i, j; + int e1,e2; + int *ai,*af; + + + ai=(int *) &m->m[0][0]; + af=(int *) &m->m[2][0]; + + for (i=0; i<4; i++) + for (j=0; j<2; j++) { + e1=FTOFIX32(mf[i][j*2]); + e2=FTOFIX32(mf[i][j*2+1]); + *(ai++) = ( e1 & 0xffff0000 ) | ((e2 >> 16)&0xffff); + *(af++) = ((e1 << 16) & 0xffff0000) | (e2 & 0xffff); + } +} + +static void _guMtxIdentF(float mf[4][4]) +{ + int i, j; + + for (i=0; i<4; i++) + for (j=0; j<4; j++) + if (i == j) mf[i][j] = 1.0; + else mf[i][j] = 0.0; +} + +void guScaleF(float mf[4][4], float x, float y, float z) +{ + _guMtxIdentF(mf); + + mf[0][0] = x; + mf[1][1] = y; + mf[2][2] = z; + mf[3][3] = 1; +} + +void func_80240E4C(f32 mf[4][4], LookAt *l, float xEye, float yEye, float zEye, + float xAt, float yAt, float zAt, + float xUp, float yUp, float zUp); +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_31C0/func_80240E4C.s") + +void func_8024128C (Mtx *m, LookAt *l, float xEye, float yEye, float zEye, + float xAt, float yAt, float zAt, + float xUp, float yUp, float zUp) +{ + float mf[4][4]; + + func_80240E4C(mf, l, xEye, yEye, zEye, xAt, yAt, zAt, + xUp, yUp, zUp); + + guMtxF2L(mf, m); +} + +void guScale(Mtx *m, float x, float y, float z) +{ + float mf[4][4]; + + guScaleF(mf, x, y, z); + _guMtxF2L(mf, m); +} + +void guRotateRPYF(f32 mf[4][4], f32 r, f32 p, f32 h) { + static f32 dtor = 3.1415926 / 180.0; + s32 pad; + f32 sinp, sinh, sinr; + f32 cosp, cosh, cosr; + + r *= dtor; + p *= dtor; + h *= dtor; + sinr = sinf(r); + cosr = cosf(r); + sinp = sinf(p); + cosp = cosf(p); + sinh = sinf(h); + cosh = cosf(h); + guMtxIdentF(mf); + mf[0][0] = cosp * cosh; + mf[0][1] = cosp * sinh; + mf[0][2] = -sinp; + + mf[1][0] = (sinr*sinp*cosh - cosr*sinh); + mf[1][1] = (sinr*sinp*sinh + cosr*cosh); + mf[1][2] = (sinr*cosp); + + + mf[2][0] = (cosr*sinp*cosh + sinr*sinh); + mf[2][1] = (cosr*sinp*sinh - sinr*cosh); + mf[2][2] = (cosr*cosp); +} diff --git a/src/core1/code_3A70.c b/src/core1/code_3A70.c new file mode 100644 index 00000000..c838d51c --- /dev/null +++ b/src/core1/code_3A70.c @@ -0,0 +1,625 @@ +#include +#include "functions.h" +#include "variables.h" +#include "n_libaudio.h" + +void func_802444C0(Struct81s *arg0); +void func_80244050(ALEventQueue *arg0, Struct81s *arg1, u16 arg2); + +extern Gfx D_80275880[]; + +extern f64 D_80277650; +extern f64 D_80277658; + +/* .code */ +void func_80241490(Gfx **gfx, Vtx **vtx, s32 *arg2[3], s32 arg3[3], s32 arg4[3], s32 arg5[3], s32 arg6, s32 arg7) { + s32 spB4[3]; + s32 var_a0; + s32 var_v0; + s32 var_v1; + s32 sp78[3][4]; + s32 i; + + func_8024C5F0(&spB4); + gSPDisplayList((*gfx)++, D_80275880); + if (arg6 != 0) { + gSPSetGeometryMode((*gfx)++, G_ZBUFFER | G_CULL_BACK); + } else { + gSPSetGeometryMode((*gfx)++, G_ZBUFFER | G_CULL_FRONT); + } + gSPVertex((*gfx)++, *vtx, 8, 0); + for(i = 0; i < 2; i++){ + for(var_a0 = 0; var_a0 < 2; var_a0++){ + for(var_v1 = 0; var_v1 < 2; var_v1++){ + var_v0 = (var_v1 == 0) ? arg2[0] : arg3[0]; + (*vtx)->v.ob[0] = (s16) (var_v0 - spB4[0]); + + var_v0 = (i == 0) ? arg2[1] : arg3[1]; + (*vtx)->v.ob[1] = (s16) (var_v0 - spB4[1]); + + var_v0 = (var_a0 == 0) ? arg2[2] : arg3[2]; + (*vtx)->v.ob[2] = (s16) (var_v0 - spB4[2]); + + (*vtx)->v.flag = 0; + (*vtx)->v.tc[0] = 0; + (*vtx)->v.tc[1] = 0; + (*vtx)->v.cn[0] = 0; + (*vtx)->v.cn[1] = 0; + (*vtx)->v.cn[2] = 0; + (*vtx)->v.cn[3] = 0; + (*vtx)++; + } + } + } + + if (arg7 != 0) { + for(i = 0; i < 3; i++){ + for(var_v1 = 0; var_v1 < 3; var_v1++){ + sp78[i][var_v1] = (arg4[var_v1] * arg5[i]) / 255; + } + sp78[i][3] = 0xFF; + } + } else { + for(i = 0; i < 3; i++){ + for(var_v1 = 0; var_v1 < 3; var_v1++){ + sp78[i][var_v1] = arg4[var_v1]; + } + sp78[i][3] = arg5[i]; + } + } + gDPPipeSync((*gfx)++); + gDPSetPrimColor((*gfx)++, 0, 0, sp78[0][0], sp78[0][1], sp78[0][2], sp78[0][3]); + gSP2Triangles((*gfx)++, 7, 3, 5, 0, 5, 3, 1, 0); + gSP1Quadrangle((*gfx)++, 6, 4, 0, 2, 0); + + gDPPipeSync((*gfx)++); + gDPSetPrimColor((*gfx)++, 0, 0, sp78[1][0], sp78[1][1], sp78[1][2], sp78[1][3]); + gSP1Quadrangle((*gfx)++, 7, 6, 2, 3, 0); + gSP2Triangles((*gfx)++, 4, 5, 0, 0, 5, 1, 0, 0); + + gDPPipeSync((*gfx)++); + gDPSetPrimColor((*gfx)++, 0, 0, sp78[2][0], sp78[2][1], sp78[2][2], sp78[2][3]); + gSP1Quadrangle((*gfx)++, 5, 4, 6, 7, 0); + gSP2Triangles((*gfx)++, 0, 1, 2, 0, 1, 3, 2, 0); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_3A70/func_80241928.s") + +void func_802424D4(Gfx **gfx, Mtx **mtx, Vtx **vtx, f32 arg3[3], f32 arg4[3], f32 arg5, s32 arg6[4]) { + s32 var_a0; + s32 var_v0; + s32 var_v1; + f32 sp80[3]; + f32 sp74[3]; + f32 sp68[3]; + f32 sp5C[3]; + f32 sp50[3]; + f32 sp44[3]; + + sp50[0] = arg4[0]; + sp50[1] = arg4[1]; + sp50[2] = arg4[2]; + if ((arg3[0] != sp50[0]) || (arg3[1] != sp50[1]) || (arg3[2] != sp50[2])) { + if ((arg3[0] == sp50[0]) && (arg3[2] == sp50[2])) { + sp50[0] += D_80277658; + } + sp80[0] = sp50[0] - arg3[0]; + sp80[1] = sp50[1] - arg3[1]; + sp80[2] = sp50[2] - arg3[2]; + ml_vec3f_normalize_copy(sp44, sp80); + + sp74[0] = -sp44[2]; + sp74[1] = 0.0f; + sp74[2] = sp44[0]; + ml_vec3f_normalize(sp74); + sp74[0] *= arg5; + sp74[1] *= arg5; + sp74[2] *= arg5; + + sp68[0] = (sp44[1] * sp74[2]) - (sp44[2]*sp74[1]); + sp68[1] = (sp44[2] * sp74[0]) - (sp44[0]*sp74[2]); + sp68[2] = (sp44[0] * sp74[1]) - (sp44[1]*sp74[0]); + ml_vec3f_normalize(sp68); + sp68[0] *= arg5; + sp68[1] *= arg5; + sp68[2] *= arg5; + + func_8024C5CC(sp5C); + gSPDisplayList((*gfx)++, D_80275880); + gSPSetGeometryMode((*gfx)++, G_ZBUFFER); + gSPVertex((*gfx)++, *vtx, 8, 0); + for( var_a0 = 0; var_a0 < 2; var_a0++){ + for(var_v0 = -1; var_v0 < 3; var_v0+=2) { + (*vtx)->v.ob[0] = (arg3[0] + (var_a0 * sp80[0]) + (var_v0 * sp74[0])) - sp5C[0]; + (*vtx)->v.ob[1] = (arg3[1] + (var_a0 * sp80[1]) + (var_v0 * sp74[1])) - sp5C[1]; + (*vtx)->v.ob[2] = (arg3[2] + (var_a0 * sp80[2]) + (var_v0 * sp74[2])) - sp5C[2]; + (*vtx)->v.tc[0] = 0; + (*vtx)->v.tc[1] = 0; + (*vtx)->v.cn[0] = 0; + (*vtx)->v.cn[1] = 0; + (*vtx)->v.cn[2] = 0; + (*vtx)->v.cn[3] = 0; + (*vtx)++; + } + } + + for( var_a0 = 0; var_a0 < 2; var_a0++){ + for(var_v0 = -1; var_v0 < 3; var_v0+=2) { + (*vtx)->v.ob[0] = (arg3[0] + (var_a0 * sp80[0]) + (var_v0 * sp68[0])) - sp5C[0]; + (*vtx)->v.ob[1] = (arg3[1] + (var_a0 * sp80[1]) + (var_v0 * sp68[1])) - sp5C[1]; + (*vtx)->v.ob[2] = (arg3[2] + (var_a0 * sp80[2]) + (var_v0 * sp68[2])) - sp5C[2]; + (*vtx)->v.tc[0] = 0; + (*vtx)->v.tc[1] = 0; + (*vtx)->v.cn[0] = 0; + (*vtx)->v.cn[1] = 0; + (*vtx)->v.cn[2] = 0; + (*vtx)->v.cn[3] = 0; + (*vtx)++; + } + } + gDPPipeSync((*gfx)++); + gDPSetPrimColor((*gfx)++, 0, 0, arg6[0], arg6[1], arg6[2], arg6[3]); + gSP1Quadrangle((*gfx)++, 0, 1, 3, 2, 0); + gSP1Quadrangle((*gfx)++, 4, 5, 7, 6, 0); + } +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_3A70/func_80242BE8.s") + +// BREAK???=== +extern struct{ + Struct81s *unk0; + Struct81s *unk4; + Struct81s *unk8; +}D_802758C0; + +extern N_ALSndPlayer *D_802758CC; +extern s32 D_802758D0; +extern s16 D_802758D4; + +extern ALEventUnknown; + +u8 pad_8027EEC0[0x54]; +u16 *D_8027EF14; +extern struct { + u8 pad0[4]; + s32 volume[3]; +}D_8027EF18; + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_3A70/func_80243070.s") +// void func_80243070(void *arg0) { + // s16 sp40; + // ALLink *temp_a0; + // s32 var_s1; + // s32 var_v0; + // u32 var_s0; + // u32 var_s0_2; + // void *temp_s0; + // void *temp_s0_2; + // void *temp_s0_3; + + // D_802758CC->maxSounds = (s32) arg0->unk8; + // D_802758CC->target = NULL; + // D_802758CC->frameTime = 33000; + // ; + // D_802758CC->sndState = alHeapDBAlloc(NULL, 0, arg0->unkC, 1, arg0->unk0 * sizeof(Struct81s)); + // alEvtqNew(&D_802758CC->evtq, alHeapDBAlloc(NULL, 0, arg0->unkC, 1, arg0->unk4 * 0x1C), arg0->unk4); + // // var_s0 = 1; + // // var_s1 = 0x50; + // D_802758C0.unk8 = D_802758CC->sndState; + // if ((u32) arg0->unk0 >= 2U) { + // do { + // temp_a0 = var_s1 + D_802758CC->unk40; + // alLink(temp_a0, temp_a0 - 0x50); + // var_s0 += 1; + // var_s1 += 0x50; + // } while (var_s0 < (u32) arg0->unk0); + // } + // D_8027EF14 = alHeapDBAlloc(NULL, 0, arg0->unkC, 2, (s32) arg0->unk10); + // var_v0 = 0; + // var_s0_2 = 0; + // if (arg0->unk10 != 0) { + // do { + // var_s0_2 += 1; + // *(D_8027EF14 + var_v0) = 0x7FFF; + // var_v0 += 2; + // } while (var_s0_2 < (u16) arg0->unk10); + // } + // D_802758CC->unk0 = 0; + // D_802758CC->unk8 = &func_8024324C; + // temp_s0 = D_802758CC; + // temp_s0->unk4 = temp_s0; + // n_alSynAddSndPlayer(D_802758CC); + // temp_s0_2 = D_802758CC; + // sp40 = 0x20; + // alEvtqPostEvent(temp_s0_2 + 0x14, (ALEvent *) &sp40, temp_s0_2->unk48); + // temp_s0_3 = D_802758CC; + // D_802758CC->unk4C = alEvtqNextEvent(temp_s0_3 + 0x14, temp_s0_3 + 0x28); +// } + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_3A70/func_8024324C.s") +#else +void func_8024324C(N_ALSndPlayer *arg0) { + N_ALEvent sp3C; + + do { + if (arg0->nextEvent.type == 0x20) { + sp3C.type = 0x20; + alEvtqPostEvent(&arg0->evtq, (ALEvent *) &sp3C, arg0->frameTime); + func_80244190(arg0); + } else { + func_802432F8(arg0, &arg0->nextEvent); + } + arg0->nextDelta = alEvtqNextEvent(&arg0->evtq, &arg0->nextEvent); + } while (arg0->nextDelta == 0); + arg0->curTime += arg0->nextDelta; +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_3A70/func_802432F8.s") + +void func_80243F84(Struct81s *arg0) { + if (arg0->unk3F & 4) { + n_alSynStopVoice(&arg0->voice); + n_alSynFreeVoice(&arg0->voice); + } + func_802444C0(arg0); + func_80244050(&D_802758CC->evtq, arg0, 0xFFFF); +} + +void func_80243FE4(Struct81s *arg0) { + ALEvent evt; + f32 sp1C; + + sp1C = alCents2Ratio(arg0->unk8->keyMap->detune)* arg0->unk2C; + evt.type = 0x10; + evt.msg.unk3A70.unk0 = arg0; + evt.msg.unk3A70.unk4 = reinterpret_cast(s32, sp1C); + alEvtqPostEvent(&D_802758CC->evtq, &evt, 33333); +} + +void func_80244050(ALEventQueue *arg0, Struct81s *arg1, u16 arg2) { + s32 pad[5]; + u32 mask; + ALEventListItem *next_event_list; + ALEventListItem *event_list; + + mask = osSetIntMask(OS_IM_NONE); + for(event_list = (ALEventListItem *)arg0->allocList.next; event_list != NULL; event_list = next_event_list) { + next_event_list = (ALEventListItem *)event_list->node.next; + if ((arg1 == event_list->evt.msg.unk3A70.unk0) && (reinterpret_cast(u16, event_list->evt.type) & arg2)) { + if (next_event_list != NULL) { + next_event_list->delta += event_list->delta; + } + alUnlink((ALLink *)event_list); + alLink((ALLink *)event_list, (ALLink *)arg0); + } + } + osSetIntMask(mask); +} + +s32 func_80244110(u16 *arg0, u16 *arg1) { + Struct81s *var_v0; + Struct81s *var_v1_2; + Struct81s *var_a2; + u16 var_a0; + u16 var_a3; + u16 var_v1; + + var_v0 = D_802758C0.unk0; + var_v1_2 = D_802758C0.unk8; + var_a2 = D_802758C0.unk4; + + for(var_a3 = 0; var_v0 != NULL; var_a3++){ + var_v0 = (Struct81s *) var_v0->node.next; + } + + + for(var_a0 = 0; var_v1_2 != NULL; var_a0++) { + var_v1_2 = (Struct81s *) var_v1_2->node.next; + } + + for(var_v1 = 0; var_a2 != NULL; var_v1++) { + var_a2 = (Struct81s *) var_a2->node.prev; + } + + *arg0 = var_a0; + *arg1 = var_a3; + return var_v1; +} + + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_3A70/func_80244190.s") +#else +void func_80244190(Struct81s *arg0) { + ALMicroTime *temp_a1; + s32 prev_volume; + s32 temp_t1; + s32 temp_t5; + s32 var_t0; + ALMicroTime var_t1; + u8 temp_t6; + u8 var_a2; + ALEnvelope *envelope; + Struct81s *var_v0; + Struct81s *var_v1; + + for(var_v0 = D_802758C0.unk0; var_v0 != NULL; var_v0 = (Struct81s *)var_v0->node.next){ + var_v1 = var_v0; + envelope = var_v0->unk8->envelope; + temp_a1 = &envelope->attackTime; + D_8027EF18.volume[AL_PHASE_ATTACK] = (s32) envelope->attackVolume; + D_8027EF18.volume[AL_PHASE_DECAY] = (s32) envelope->decayVolume; + while( var_v0->envPhase < AL_PHASE_RELEASE + && var_v0->unk48 >= temp_a1[var_v0->envPhase] + && temp_a1[var_v0->envPhase] != -1 + ){ + var_v0->unk48 -= temp_a1[var_v0->envPhase]; + var_v0->envPhase++; + } + + if (var_v0->envPhase < AL_PHASE_RELEASE) { + if (temp_a1[var_v1->envPhase] != -1) { + var_v0->unk44 = D_8027EF18.volume[var_v0->envPhase - 1] + ((s32) ((D_8027EF18.volume[var_v0->envPhase] - D_8027EF18.volume[var_v0->envPhase - 1]) * var_v0->unk48) / temp_a1[var_v0->envPhase]); + } else { + var_v0->unk44 = D_8027EF18.volume[var_v0->envPhase - 1]; // + } + } + var_v0->unk48 += arg0->unk48; + } +} +#endif + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_3A70/func_8024431C.s") +#else +Struct81s *func_8024431C(ALBank *bank, ALSound *sound) { + s32 pad; + ALKeyMap *sp30; + Struct81s *temp_s0; + OSIntMask mask; + s32 sp24; + + temp_s0 = D_802758C0.unk8; + sp30 = sound->keyMap; + if (temp_s0 != NULL) { + mask = osSetIntMask(OS_IM_NONE); + D_802758C0.unk8 = (Struct81s *) temp_s0->unk0.next; + alUnlink((ALLink *)temp_s0); + if (D_802758C0.unk0 != NULL) { + temp_s0->unk0.next = D_802758C0.unk0; + temp_s0->unk0.prev = NULL; + D_802758C0.unk0->unk0.prev = temp_s0; + D_802758C0.unk0 = temp_s0; + } else { + temp_s0->unk0.prev = NULL; + temp_s0->unk0.next = NULL; + D_802758C0.unk0 = temp_s0; + D_802758C0.unk4 = temp_s0; + } + osSetIntMask(mask); + sp24 = ((sound->envelope->decayTime + 1) == 0) + 0x40; + temp_s0->unk36 = sp24; + temp_s0->unk40 = 5; + temp_s0->unk38 = 2; + temp_s0->unk8 = sound; + temp_s0->unk2C = 1.0f; + temp_s0->unk3F = sp30->keyMax & 0xF0; + temp_s0->unk30 = 0; + temp_s0->envPhase = AL_PHASE_ATTACK; + temp_s0->unk44 = 0.0f; + temp_s0->unk48 = 0; + if (temp_s0->unk3F & 0x20) { + temp_s0->unk28 = alCents2Ratio((sp30->keyBase * 0x64) - 0x1770); + } else { + temp_s0->unk28 = alCents2Ratio(((sp30->keyBase * 0x64) + sp30->detune) - 0x1770); + } + if (sp24 != 0x40) { + temp_s0->unk3F |= 2; + } + temp_s0->unk3E = 0; + temp_s0->unk3D = 0x40; + temp_s0->unk34 = 0x7FFF; + } + return temp_s0; +} +#endif + +void func_802444C0(Struct81s *arg0){ + Struct81s *var_v0; + + sizeof(ALVoice); + + var_v0 = D_802758C0.unk0; + if(arg0 == D_802758C0.unk0){ + D_802758C0.unk0 = (Struct81s *)arg0->node.next; + } + + if(arg0 == D_802758C0.unk4){ + D_802758C0.unk4 = (Struct81s *)arg0->node.prev; + } + + alUnlink((ALLink *)arg0); + + if(D_802758C0.unk8 != NULL){ + arg0->node.next = (ALLink *)D_802758C0.unk8; + arg0->node.prev = NULL; + D_802758C0.unk8->node.prev = (ALLink *)arg0; + D_802758C0.unk8 = arg0; + } + else{ + arg0->node.prev = NULL; + arg0->node.next = NULL; + D_802758C0.unk8 = arg0; + } + + if(arg0->unk3F & 0x4){ + D_802758D4--; + } + + arg0->unk40 = 0; + if(arg0->unk30 != NULL){ + if(*arg0->unk30 == arg0){ + *arg0->unk30 = NULL; + } + arg0->unk30 = NULL; + } +} + +void func_80244594(Struct81s *arg0, u8 arg1){ + if(arg0 != NULL) + arg0->unk36 = arg1; +} + +s32 func_802445AC(Struct81s *arg0){ + if(arg0 != NULL) + return arg0->unk40; + return 0; +} + +bool func_802445C4(ALBank *bank, s16 arg1){ + ALSound *snd = bank->instArray[0]->soundArray[arg1-1]; + if (snd->envelope->decayTime == -1) + return TRUE; + else + return FALSE; +} + +void *func_80244608(ALBank *bank, s16 arg1, struct46s *arg2) { + ALKeyMap *temp_v0_2; + ALSound *temp_s2; + Struct81s *temp_v0; + s32 var_s3; + s16 sp6E; + s32 sp68; + s32 var_s4; + Struct81s *var_fp; + ALEvent sp50; + ALEvent sp40; + + var_fp = NULL; + sp6E = 0; + var_s3 = 0; + if (arg1 == 0) { + return NULL; + } + + do{ + temp_s2 = bank->instArray[0]->soundArray[arg1-1]; + temp_v0 = func_8024431C(bank, temp_s2); + if (temp_v0 != NULL) { + temp_v0->unk4C = (s32) (arg1 - 1); + D_802758CC->target = temp_v0; + sp50.type = AL_SEQ_MIDI_EVT; + ((s32 *)&sp50.msg)[0] = temp_v0; + var_s4 = temp_s2->keyMap->velocityMax * 0x8235; + if (temp_v0->unk3F & 0x10) { + temp_v0->unk3F &= ~(0x10); + alEvtqPostEvent(&D_802758CC->evtq, (ALEvent *) &sp50, var_s3 + 1); + sp68 = var_s4 + 1; + sp6E = arg1; + } else { + alEvtqPostEvent(&D_802758CC->evtq, (ALEvent *) &sp50, var_s4 + 1); + } + var_fp = temp_v0; + } + temp_v0_2 = temp_s2->keyMap; + var_s3 += var_s4; + arg1 = temp_v0_2->velocityMin + ((temp_v0_2->keyMin & 0xC0) * 4); + } while (arg1 != 0 && temp_v0 != NULL); + + if (var_fp != NULL) { + var_fp->unk3F |= 1; + var_fp->unk30 = arg2; + if (sp6E != 0) { + var_fp->unk3F |= 0x10; + sp40.type = 0x200; + ((s32 *)&sp40.msg)[0] = var_fp; + ((s32 *)&sp40.msg)[1] = sp6E; + ((s32 *)&sp40.msg)[2] = bank; + alEvtqPostEvent(&D_802758CC->evtq, &sp40, sp68); + } + } + if (arg2 != NULL) { + arg2->unk0 = (s32) var_fp; + } + return var_fp; +} + +void func_80244814(Struct81s *arg0){ + ALEvent evt; + + evt.type = 0x400; + ((s32 *)&evt.msg)[0] = arg0; + if(arg0 != NULL){ + arg0->unk3F &= ~(0x10); + alEvtqPostEvent(&D_802758CC->evtq, &evt, 0); + } +} + +void func_80244860(u8 arg0) { + OSIntMask mask; + ALEvent evt; + Struct81s *var_s0; + + mask = osSetIntMask(1U); + for(var_s0 = D_802758C0.unk0; var_s0 != NULL; var_s0 = (Struct81s *)var_s0->node.next){ + evt.type = 0x400; + ((s32 *)&evt.msg)[0] = (s32)var_s0; + if ((var_s0->unk3F & arg0) == arg0) { + var_s0->unk3F &= ~(0x10); + alEvtqPostEvent(&D_802758CC->evtq, &evt, 0); + } + } + osSetIntMask(mask); +} + +void func_80244918(void){ + func_80244860(1); +} + +void func_80244938(void){ + func_80244860(0x11); +} + +void func_80244958(void){ + func_80244860(3); +} + +void func_80244978(s32 arg0, s16 type, s32 arg2){ + ALEvent sp18; + if(arg0){ + sp18.type = type; + ((s32 *)&sp18.msg)[0] = arg0; + ((s32 *)&sp18.msg)[1] = arg2; + + alEvtqPostEvent(&D_802758CC->evtq, &sp18, 0); + } +} + +s32 func_802449C4(u8 arg0){ + return D_8027EF14[arg0]; +} + +void func_802449E4(u8 arg0, u16 arg1) { + Struct81s *var_s0; + s32 pad30; + ALEvent evt; + + var_s0 = D_802758C0.unk0; + D_8027EF14[arg0] = arg1; + while(var_s0 != NULL){ + if ((var_s0->unk8->keyMap->keyMin & 0x3F) == arg0) { + evt.type = 0x800; + ((s32 *)&evt.msg)[0] = var_s0; + alEvtqPostEvent(&D_802758CC->evtq, &evt, 0); + } + var_s0 = (Struct81s *)var_s0->node.next; + } +} + +void func_80244A98(s32 arg0){ + D_802758D0 = arg0; +} diff --git a/src/core1/code_660.c b/src/core1/code_660.c new file mode 100644 index 00000000..93282f78 --- /dev/null +++ b/src/core1/code_660.c @@ -0,0 +1,109 @@ +#include +#include "functions.h" +#include "variables.h" +#include "core1/rarezip.h" + + +static int _rarezip_uncompress(u8 **arg0, u8 **arg1, struct huft * arg2); + +#define COMP_HEADER_SIZE 6 + +//border[]= { /* Order of the bit length code lengths */ +u8 D_80275670[] = { + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 +}; + +// static ush cplens[] = { /* Copy lengths for literal codes 257..285 */ +u16 D_80275684[] = { + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 +}; +// /* note: see note #13 above about the 258 in this list. */ + +// static uch cplext[] = { /* Extra bits for literal codes 257..285 */ +u8 D_802756C4[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99 +}; /* 99==invalid */ + +// static ush cpdist[] = { /* Copy offsets for distance codes 0..29 */ +u16 D_802756E4[] = { + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577 +}; + +// static uch cpdext[] = { /* Extra bits for distance codes */ +u8 D_80275720[] = { + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13 +}; + +// ush mask_bits[] = { +u16 D_80275740[] = { + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff +}; + +s32 D_80275764 = 9; //lbits +s32 D_80275768 = 6; //dbits + +/* .data */ +extern struct huft D_803FBE00; +struct huft *D_8027BF00; +u8 pad_8027BF00[0xC]; +u8 *D_8027BF10; //inbuf +u8 *D_8027BF14; //slide +u32 D_8027BF18; //inptr +u32 D_8027BF1C; //wp +struct huft *D_8027BF20; //unk +u32 D_8027BF24; //bb +u32 D_8027BF28; //bk +u32 D_8027BF2C; //crc1 +u32 D_8027BF30; //crc2 +u32 D_8027BF34; //hufts + + +/* .code */ +s32 rarezip_get_uncompressed_size(u8 *arg0) { + return *((s32*) (arg0 + 2)); +} + +void rarezip_init(void){ + D_8027BF00 = &D_803FBE00; +} + +void rarezip_inflate(u8 *src, u8 *dst){ + _rarezip_inflate(src, dst, D_8027BF00); +} + +void rarezip_uncompress(u8 **srcPtr, u8 **dstPtr){ + //updates in and out buffer ptrs, + _rarezip_uncompress(srcPtr, dstPtr, D_8027BF00); +} + +void func_8023E0E8(void){ + return; +} + +static int _rarezip_inflate(u8 * src, u8 * dst, struct huft * arg2){ + D_8027BF10 = src; + D_8027BF14 = dst; + D_8027BF20 = arg2; + D_8027BF10 += COMP_HEADER_SIZE; + D_8027BF1C = 0; + D_8027BF18 = 0; + inflate(); + return D_8027BF1C; +} + +static int _rarezip_uncompress(u8 **srcPtr, u8 **dstPtr, struct huft * arg2){ + int result; + result = _rarezip_inflate(*srcPtr, *dstPtr, arg2); + *dstPtr = *dstPtr + D_8027BF1C; + *dstPtr = ((u32)*dstPtr & 0xF) ? ((u32)*dstPtr & -0x10) + 0x10: *dstPtr; + *srcPtr = *srcPtr + D_8027BF18 + COMP_HEADER_SIZE; + return result; +} diff --git a/src/core1/code_7090.c b/src/core1/code_7090.c new file mode 100644 index 00000000..db8c1a5f --- /dev/null +++ b/src/core1/code_7090.c @@ -0,0 +1,70 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void sfxsource_setSampleRate(u8, s32); +extern void func_8030E2C4(u8); + + +typedef struct struct_27_s{ + s16 unk0; + u8 pad2[0x12]; +}struct27s; + +extern s16 * D_802758E0; + +void func_80244C78(int arg0); + +/* .code */ +void func_80244AB0(void){ + int i; + if(D_802758E0) + return; + + D_802758E0 = (struct16s *) malloc(10*sizeof(s16)); + for(i = 0; i < 10; i++){ + D_802758E0[i] = 0; + } +} + +void func_80244B3C(void){ + int i; + + if(!D_802758E0) + return; + + for(i = 0; i < 10; i++){ + if(D_802758E0[i]) + func_8030E394((u8)D_802758E0[i]); + } + free(D_802758E0); + D_802758E0 = NULL; + +} + +void func_80244BB0(s32 arg0, s32 arg1, s32 arg2, f32 arg3){ + s32 i; + u8 indx; + if(func_8030ED70(func_80255D44(arg1))){ + i = func_8030D90C(); + indx = i; + if(i){ + sfxsource_setSfxId(indx, func_80255D44(arg1)); + func_8030DBB4(indx, arg3); + sfxsource_setSampleRate(indx, arg2); + func_8030E2C4(indx); + func_80244C78(arg0); + D_802758E0[arg0] = indx; + } + } + else{ + func_8030E6A4(func_80255D44(arg1), arg3, arg2); + } +} + +void func_80244C78(int arg0){ + if(D_802758E0[arg0]){ + func_8030DA44(D_802758E0[arg0]); + } + D_802758E0[arg0] = 0; +} diff --git a/src/core1/code_72B0.c b/src/core1/code_72B0.c new file mode 100644 index 00000000..7ba95af5 --- /dev/null +++ b/src/core1/code_72B0.c @@ -0,0 +1,228 @@ +#include +#include "functions.h" +#include "variables.h" + +int func_802458E0(f32 arg0[3], Actor *arg1, s32 arg2); +extern bool func_80320DB0(f32[3], f32, f32[3], u32); +extern bool func_80323240(struct56s *, f32, f32[3]); +extern f32 ml_vec3f_dot_product(f32[3], f32[3]); +extern Struct66s *func_80320B98(f32[3], f32[3], f32[3], u32); + +/* .rodata */ +extern f64 D_802776C8; + +/* .bss */ +u8 pad_D_8027EF20[0x10]; +f32 D_8027EF30; + +/* .code */ +void func_80244CD0(f32 arg0[3], u32 arg1) { + f32 sp34[3]; + f32 sp28[3]; + f32 sp1C[3]; + Struct66s *temp_v0; + + ml_vec3f_copy(sp28, arg0); + ml_vec3f_copy(sp1C, arg0); + sp28[1] += 100.0f; + sp1C[1] -= 500.0f; + temp_v0 = func_80320B98(sp28, sp1C, sp34, arg1); + if ((temp_v0 != NULL) && (!(sp34[1] < 0.0f) || (temp_v0->unk8 & 0x10000)) && (arg0[1] < sp1C[1])) { + arg0[1] = sp1C[1]; + } +} + +Struct66s *func_80244D94(f32 arg0[3], f32 arg1[3], f32 arg2[3], u32 arg3, f32 arg4) { + f32 sp2C[3]; + f32 sp20[3]; + Struct66s *sp1C; + + ml_vec3f_copy(sp20, arg1); + ml_vec3f_diff_copy(sp2C, sp20, arg0); + ml_vec3f_set_length_copy(sp2C, sp2C, arg4); + sp20[0] += sp2C[0]; + sp20[1] += sp2C[1]; + sp20[2] += sp2C[2]; + sp1C = func_80320B98(arg0, sp20, arg2, arg3); + if (sp1C == NULL) { + return 0; + } + ml_vec3f_diff(sp20, sp2C); + ml_vec3f_copy(arg1, sp20); + return sp1C; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_72B0/func_80244E54.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_72B0/func_80244F00.s") + +void func_80244FC0(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3, s32 arg4, u32 arg5) { + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + f32 pad[2]; + + sp2C[0] = arg0[0]; + sp2C[1] = arg0[1] + arg3; + sp2C[2] = arg0[2]; + ml_vec3f_copy(arg1, arg0); + if (func_80320DB0(sp2C, arg2, sp38, arg5)) { + arg1[0] = arg0[0] + (sp38[0] * arg2); + arg1[1] = arg0[1] + (sp38[1] * arg2); + arg1[2] = arg0[2] + (sp38[2] * arg2); + sp44[0] = arg0[0] + (sp38[0] * arg2); + sp44[1] = arg0[1] + (sp38[1] * arg2); + sp44[2] = arg0[2] + (sp38[2] * arg2); + ml_vec3f_copy(arg0, sp44); + if (arg4 != 0) { + func_80244CD0(arg0, arg5); + } + } +} + +void func_802450DC(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3[3], f32 arg4[3]) { + f32 sp3C[3]; + f32 sp30[3]; + f32 sp24[3]; + f32 phi_f12; + + ml_vec3f_diff_copy(sp3C, arg1, arg0); + ml_vec3f_diff_copy(sp30, arg3, arg2); + ml_vec3f_diff_copy(sp24, sp3C, sp30); + phi_f12 = -ml_vec3f_dot_product(arg4, sp24); + phi_f12 = MAX(5.0f, phi_f12); + arg1[0] += phi_f12 * arg4[0]; + arg1[1] += phi_f12 * arg4[1]; + arg1[2] += phi_f12 * arg4[2]; +} + +void func_802451A4(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3[3], f32 arg4[3], s32 arg5) { + f32 sp6C[3]; + f32 sp60[3]; + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + f32 sp30[3]; + s32 phi_v0; + f32 sp28; + f32 phi_f12; + + ml_vec3f_diff_copy(sp6C, arg1, arg0); + ml_vec3f_diff_copy(sp60, arg3, arg2); + ml_vec3f_diff_copy(sp54, sp6C, sp60); + ml_vec3f_normalize_copy(sp3C, sp54); + ml_vec3f_yaw_rotate_copy(sp30, sp3C, 90.0f); + sp28 = ml_vec3f_dot_product(arg4, sp3C); + if (arg5 != 0) { + D_8027EF30 = ml_vec3f_dot_product(arg4, sp30); + } + phi_v0 = (D_8027EF30 < 0.0f) ? -1 : 1; + ml_vec3f_yaw_rotate_copy(sp48, arg4,(phi_v0 * sp28) * D_802776C8); + phi_f12 = -ml_vec3f_dot_product(&sp48, &sp54); + phi_f12 = MAX(5.0f, phi_f12); + arg1[0] += phi_f12 * sp48[0]; + arg1[1] += phi_f12 * sp48[1]; + arg1[2] += phi_f12 * sp48[2]; +} + +bool func_80245314(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3, s32 arg4) { + f32 sp2C[3]; + f32 sp20[3]; + bool temp_v0; + + ml_vec3f_copy(sp2C, arg0); + ml_vec3f_copy(sp20, arg0); + sp2C[1] += arg2; + sp20[1] += arg3; + temp_v0 = func_80320B98(sp2C, sp20, arg1, arg4); + if (temp_v0 != 0) { + arg0[1] = sp20[1]; + } + return temp_v0; +} + +bool func_802453A0(f32 arg0[3], f32 arg1[3], f32 arg2[3]){ + f32 sp24[3]; + f32 sp18[3]; + ml_vec3f_copy(sp18, arg1); + return func_80320B98(arg0, sp18, sp24, arg2); +} + +f32 func_802453DC(f32 arg0[3], f32 arg1, f32 arg2[3], s32 arg3) { + f32 sp24[3]; + f32 phi_f0; + + func_80323240(arg0, arg1, sp24); + if (!func_802453A0(arg2, sp24, arg3)) { + return arg1; + } + func_80323240(arg0, 1.0f, sp24); + if (!func_802453A0(arg2, sp24, arg3)) { + return 1.0f; + } + + func_80323240(arg0, 0.0f, sp24); + if (!func_802453A0(arg2, sp24, arg3)) { + return 0.0f; + } + return arg1; +} + +//over_water? +int func_8024549C(f32 arg0[3], f32 arg1){ + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + f32 sp20[3]; + int sp1C; + + sp20[0] = sp20[1] = sp20[2] = 0.0f; + sp20[1] = arg1; + + ml_vec3f_diff_copy(sp2C, arg0, sp20); + ml_vec3f_add(sp38, arg0, sp20); + sp1C = func_80309B48(sp2C, sp38, sp44, 0xf800ff0f); + if(sp1C){ + ml_vec3f_copy(arg0, sp38); + } + return sp1C; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_72B0/func_80245524.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_72B0/func_8024559C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_72B0/func_8024560C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_72B0/func_8024575C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_72B0/func_802457C4.s") + +void func_8024587C(Struct60s *dst, Struct60s *src){ + dst->unk0[0] = src->unk0[0]; + dst->unk0[1] = src->unk0[1]; + dst->unk0[2] = src->unk0[2]; + dst->unk8 = src->unk8; + dst->unk6 = src->unk6; +} + +int func_802458A8(f32 arg0[3], ActorMarker *arg1, s32 arg2){ + return func_802458E0(arg0, marker_getActor(arg1), arg2); +} + +int func_802458E0(f32 arg0[3], Actor *arg1, s32 arg2){ + f32 sp34[3]; + f32 sp28[3]; + f32 sp1C[3]; + + ml_vec3f_copy(sp28, arg0); + ml_vec3f_copy(sp1C, arg1->position); + sp1C[1] += (f32)arg2; + if(sp1C[1] < sp28[1]) + return FALSE; + + if(func_80320B98(sp28, sp1C, sp34, 0x25e0000)){ + return FALSE; + } + return TRUE; +} diff --git a/src/core1/code_7F60.c b/src/core1/code_7F60.c new file mode 100644 index 00000000..2a242356 --- /dev/null +++ b/src/core1/code_7F60.c @@ -0,0 +1,58 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/func_80245980.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/func_802459A0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/func_80245A7C.s") +// void func_80245A7C(Mtx *m0, Mtx *m1){ +// u32 *v0 = &m1->m[0][0]; +// u32 *v1 = &m1->m[2][0]; +// f32 *a2 = &m0->m[0][0]; +// s32 a0; +// s32 a1; +// int i; + +// for(i = 0; i < 8; i++){ +// a0 = a2[2*i]*65536.0f; +// a1 = a2[2*i+1]*65536.0f; + +// v0[i] = (a0 & 0xffff0000) | ((a1 >> 16) & 0xffff); +// v1[i] = ((a0 << 16) & 0xffff0000) | (a1 & 0xffff); +// } +// } + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/func_80245BE4.s") + +void _guMtxIdentF_80245D44(float mf[4][4]) //static +{ + int i, j; + + for (i=0; i<4; i++) + for (j=0; j<4; j++) + if (i == j) mf[i][j] = 1.0; + else mf[i][j] = 0.0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/func_80245DCC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/func_80245F34.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/func_80245FB8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/guPerspective.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/func_8024632C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/func_802464B0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/func_80246510.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/func_80246570.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/func_802465D0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_7F60/func_80246624.s") diff --git a/src/core1/code_8C50.c b/src/core1/code_8C50.c new file mode 100644 index 00000000..493742e7 --- /dev/null +++ b/src/core1/code_8C50.c @@ -0,0 +1,392 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern s32 D_80000300; + +typedef struct { + s32 unk0; + s32 unk4; + s32 unk8; + s32 unkC; +}Struct_Core1_8C50_s; + +void func_80247224(void); + +#define CORE1_8C50_EVENT_DP 4 +#define CORE1_8C50_EVENT_SP 6 +#define CORE1_8C50_EVENT_AUDIO_TIMER 8 +#define CORE1_8C50_EVENT_FAULT 10 +#define CORE1_8C50_EVENT_PRENMI 11 +#define CORE1_8C50_EVENT_CONT_TIMER 13 + +/* .data */ +extern u64 D_80272590[]; // ucode +extern u64 D_802731F0[]; +extern u64 D_80274620[]; +extern OSTask D_80275910; +extern OSTask D_80275950; +extern s32 D_80275990; +extern s32 D_80275994; +extern s32 D_80275998; +extern s32 D_8027599C; +extern s32 D_802759A0; +// static s32 D_802759A4; +extern OSViMode D_802759A8; +extern OSViMode D_802759F8; +extern u64 D_80278E80[]; //ucode_data +extern u64 D_80279130[]; +extern u64 D_80279930[]; + + +/* .bss */ +s32 D_8027EF40; +u8 D_8027EF44[0xC20]; +OSMesgQueue D_8027FB60; +OSMesg D_8027FB78[20]; +OSMesgQueue D_8027FBC8; +OSMesg D_8027FBE0[10]; +Struct_Core1_8C50_s *D_8027FC08; +s32 D_8027FC0C; +bool D_8027FC10; +s32 D_8027FC14; +s32 D_8027FC18; +s32 D_8027FC1C; +s32 D_8027FC20; +s32 D_8027FC24; +u8 pad_8027FC28[0x7F8]; +OSThread D_80280428; +Struct_Core1_8C50_s * D_802805D8[20]; +volatile s32 D_80280628; +volatile s32 D_8028062C; +Struct_Core1_8C50_s * D_80280630[20]; +volatile s32 D_80280680; +volatile s32 D_80280684; +s32 D_80280688; +OSTimer D_80280690; //audio_timer +OSTimer D_802806B0; //controller_timer +s32 D_802806D0; + +/* .code */ +void func_80246670(OSMesg arg0){ + sizeof(OSThread); + osSendMesg(&D_8027FB60, arg0, 1); + if((s32) arg0 == 3 ){ + D_80275994 = 0x1e; + if(D_802759A0){ + osDpSetStatus(DPC_CLR_FREEZE); + D_802759A0 = 0; + } + osRecvMesg(&D_8027FBC8, NULL, 1); + D_80275994 = 0; + } +} + +void func_802466F4(OSMesg arg0){ + s32 tmp = (D_80280680 + 1) % 0x14; + if(D_80280684 != tmp){ + D_80280630[D_80280680] = arg0; + D_80280680 = tmp; + } +} + +void func_80246744(OSMesg arg0){ + s32 tmp = (D_80280628 + 1) % 0x14; + if(D_8028062C != tmp){ + D_802805D8[D_80280628] = arg0; + D_80280628 = tmp; + } +} + +void func_80246794(Struct_Core1_8C50_s * arg0){ + func_80255D0C(&D_80275910.t.ucode_boot, &D_80275910.t.ucode_boot_size); + D_80275910.t.ucode = D_80272590; + D_80275910.t.ucode_data = D_80278E80; + D_80275910.t.data_ptr = (void*) arg0->unk8; + D_80275910.t.data_size = (arg0->unkC - arg0->unk8) >> 3 << 3; + osWritebackDCache(D_80275910.t.data_ptr , D_80275910.t.data_size); + osWritebackDCache(&D_80275910, sizeof(OSTask)); + D_8027FC08 = arg0; + osSpTaskLoad(&D_80275910); + osSpTaskStartGo(&D_80275910); + D_8027FC1C = 4; +} + +void func_80246844(Struct_Core1_8C50_s * arg0){ + func_80255D0C(&D_80275950.t.ucode_boot, &D_80275950.t.ucode_boot_size); + D_80275950.t.ucode = D_802731F0; + D_80275950.t.ucode_data = D_80279130; + D_80275950.t.data_ptr = (void*) arg0->unk8; + D_80275950.t.data_size = (arg0->unkC - arg0->unk8) >> 3 << 3; + osWritebackDCache(D_80275950.t.data_ptr , D_80275950.t.data_size); + osWritebackDCache(&D_80275950, sizeof(OSTask)); + osSpTaskLoad(&D_80275950); + osSpTaskStartGo(&D_80275950); + D_8027FC1C = arg0->unk4 | 0x8; + D_8027FC18 = arg0->unk4 | 0x1; + if(!(osDpGetStatus() & DPC_STATUS_FREEZE)){ + D_8027FC14 = D_8027FC18; + D_80275998 = 0x1e; + } +} + +void func_8024692C(Struct_Core1_8C50_s * arg0){ + func_80255D0C(&D_80275950.t.ucode_boot, &D_80275950.t.ucode_boot_size); + D_80275950.t.ucode = D_80274620; + D_80275950.t.ucode_data = D_80279930; + D_80275950.t.data_ptr = (void*) arg0->unk8; + D_80275950.t.data_size = (arg0->unkC - arg0->unk8) >> 3 << 3; + osWritebackDCache(D_80275950.t.data_ptr , D_80275950.t.data_size); + osWritebackDCache(&D_80275950, sizeof(OSTask)); + osSpTaskLoad(&D_80275950); + osSpTaskStartGo(&D_80275950); + D_8027FC1C = arg0->unk4 | 0x8; + D_8027FC18 = arg0->unk4 | 0x1; + if(!(osDpGetStatus() & DPC_STATUS_FREEZE)){ + D_8027FC14 = D_8027FC18; + D_80275998 = 0x1e; + } +} + +void func_80246A14(Struct_Core1_8C50_s *arg0){ + switch(arg0->unk0){ + case 1: + func_80246844(arg0); + break; + + case 2: + func_8024692C(arg0); + break; + } +} + +void func_80246A64(OSMesg msg){ + func_802466F4(msg); +} + +void func_80246A84(OSMesg msg){ + func_80246744(msg); + if(D_8027FC1C == 0x10 && !D_8027FC10){ + func_80246844(D_802805D8[D_8028062C]); + D_8028062C = (D_8028062C + 1) % 0x14; + } +} + +void func_80246B0C(OSMesg msg){ + func_80246744(msg); + if(D_8027FC1C == 0x10 && !D_8027FC10){ + func_8024692C(D_802805D8[D_8028062C]); + D_8028062C = (D_8028062C + 1) % 0x14; + } +} + +void func_80246B94(void){ + if( D_8027FC1C == 0x10 + && D_8027FC14 == 2 + && D_8028062C == D_80280628 + && !(osDpGetStatus() & DPC_STATUS_FREEZE) + ){ + osSendMesg(&D_8027FBC8, NULL, OS_MESG_NOBLOCK); + } + else{ + D_8027FC0C++; + } +} + +void func_80246C2C(void){ + if((D_8027FC14 << 1) < 0){ + osDpSetStatus(DPC_SET_FREEZE); + D_80280688 = osViGetCurrFrameBuffer(); + func_8024BFAC(); + } + D_8027FC14 = D_8027FC18 = 2; + D_80275998 = 0; + if(D_8027FC1C == 0x10 && D_8028062C != D_80280628 && !D_8027FC10){ + func_80246A14(D_802805D8[D_8028062C]); + D_8028062C = (D_8028062C + 1) % 0x14; + } + else{ + if(D_8027FC0C && D_8028062C == D_80280628 && !(osDpGetStatus() & DPC_STATUS_FREEZE)){ + osSendMesg(&D_8027FBC8, NULL, 0); + D_8027FC0C--; + } + } +} + +#ifndef NONMATCHING //MATCHES but requires .data defined for local static variable +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_8C50/func_80246D78.s") +#else +static s32 D_802759A4; +void func_80246D78(void){ + s32 sp2C = (D_8027FC0C != 0) && (D_8028062C == D_80280628) && (D_8027FC18 == 2) && (D_8027FC1C == 0x10); + volatile s32 sp30; + + sp30 = FALSE; + if( osViGetCurrFrameBuffer() != D_80280688 || sp2C){ + if(osDpGetStatus() & DPC_STATUS_FREEZE){ + osDpSetStatus(DPC_CLR_FREEZE); + + D_8027FC14 = D_8027FC18; + func_8025AFB8(); + + if(D_8027FC14 & 1){ + D_80275998 = 0x1E; + } + } + + if(sp2C){ + osSendMesg(&D_8027FBC8, NULL, OS_MESG_NOBLOCK); + D_8027FC0C--; + } + } + + D_80275990 = 0; + + if(D_80275994 != 0){ + D_80275994--; + } + + if(D_8027599C != 0){ + D_8027599C--; + } + + if(D_80275998 != 0){ + D_80275998--; + if(D_80275998 == 0){ + sp30 = TRUE; + } + } + D_8027FC10 = 0; + D_802759A4++; + if(!(D_802759A4 & 1)){ + osStopTimer(&D_80280690); + osSetTimer(&D_80280690, 280000, 0, &D_8027FB60, CORE1_8C50_EVENT_AUDIO_TIMER); + } + + if(D_802806D0){ + osStopTimer(&D_802806B0); + osSetTimer(&D_802806B0, ((osClockRate / 60)* 2) / 3, 0, &D_8027FB60, CORE1_8C50_EVENT_CONT_TIMER); + } +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_8C50/func_80247000.s") + +void func_802471D8(OSMesg arg0){ + D_8027FC10 = TRUE; +} + +void func_802471EC(void){ + osSendMesg(amgr_getFrameMesgQueue(), NULL, OS_MESG_NOBLOCK); + func_80247224(); +} + +void func_80247224(void){ + Struct_Core1_8C50_s *ptr; + if((D_8027FC1C == 0x10) && (D_80280684 != D_80280680)){ + ptr = D_80280630[D_80280684]; + D_80280684 = (D_80280684 + 1) % 0x14; + func_80246794(ptr); + } else if((D_8027FC1C & 0x8) && (D_80280684 != D_80280680)){ + osSpTaskYield(); + D_8027FC20 = D_8027FC1C; + D_8027FC1C = 0x20; + D_8027599C = 0x1E; + } +} + +void func_80247304(void){}; + +void func_8024730C(void){ + static s32 D_802806D4; + + if(!D_802806D4){ + D_802806D4 = TRUE; + if(D_80000300 != TRUE){ + osViSetMode(&D_802759A8); + } else { + osViSetMode(&D_802759F8); + } + func_80250FC0(); //stop controller motors + do{ + osDpSetStatus(DPC_STATUS_FLUSH); + }while(1); + } +} + +void func_80247380(void){ + if(!(___osGetSR() & SR_IBIT5)){ + func_8024730C(); + } +} + +void func_802473B4(void *arg0){ + OSMesg msg = NULL; + do{ + osRecvMesg(&D_8027FB60, &msg, OS_MESG_BLOCK); + func_80247380(); + if((s32)msg == 3){ func_80246B94(); } + else if((u32)msg == 5) { func_80246D78(); } + else if((u32)msg == CORE1_8C50_EVENT_DP) { func_80246C2C(); } + else if((u32)msg == CORE1_8C50_EVENT_SP) { func_80247000(); } + else if((u32)msg == CORE1_8C50_EVENT_AUDIO_TIMER) { func_802471EC(); } + else if((u32)msg == CORE1_8C50_EVENT_FAULT) { do{}while(1); } + else if((u32)msg == CORE1_8C50_EVENT_PRENMI) { func_8024730C(); } + else if((u32)msg == 12) { } + else if((u32)msg == CORE1_8C50_EVENT_CONT_TIMER) { func_8024F1B0(); } + else if((u32)msg >= 100) { + if(*(u32*)msg == 0){ func_80246A64(msg); } + else if(*(u32*)msg == 1){ func_80246A84(msg); } + else if(*(u32*)msg == 2){ func_80246B0C(msg); } + else if(*(u32*)msg == 7){ func_802471D8(msg); } + } + }while(1); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_8C50/func_80247560.s") +#else +void func_80247560(void){ + u32 tmp_v0; + osCreateMesgQueue(&D_8027FB60, &D_8027FB78, 20); + osCreateMesgQueue(&D_8027FBC8, &D_8027FBE0, 10); + osSetEventMesg(OS_EVENT_DP, &D_8027FB60, CORE1_8C50_EVENT_DP); + osSetEventMesg(OS_EVENT_SP, &D_8027FB60, CORE1_8C50_EVENT_SP); + osSetEventMesg(OS_EVENT_FAULT, &D_8027FB60, CORE1_8C50_EVENT_FAULT); + osSetEventMesg(OS_EVENT_PRENMI, &D_8027FB60, CORE1_8C50_EVENT_PRENMI); + func_8024BDAC(&D_8027FB60, 5); + D_8027FC0C = 0; + D_8027FC10 = 0; + D_8027FC14 = D_8027FC18 = 2; + D_8027FC1C = D_8027FC20 = 0x10; + D_8027FC24 = 0; + D_80280628 = D_8028062C = 0; + D_80280680 = D_80280684 = 0; + for(tmp_v0 = &D_8027EF40; tmp_v0 & 0xF; tmp_v0++){} + D_80275950.yield_data_size = tmp_v0; + osCreateThread(&D_80280428, 5, func_802473B4, NULL, &D_80280428, 60); + osStartThread(&D_80280428); +} +#endif + +void func_802476DC(void){ + D_802806D0 = 1; +} + +void func_802476EC(Gfx **gfx){ + gDPPipeSync((*gfx)++); + gSPEndDisplayList((*gfx)++); +} + +s32 func_80247720(void){ + return D_8027FC1C; +} + +OSMesgQueue *func_8024772C(void){ + return &D_8027FB60; +} + +OSThread *func_80247738(void){ + return &D_80280428; +} diff --git a/src/core1/code_9D30.c b/src/core1/code_9D30.c new file mode 100644 index 00000000..e28f5c3a --- /dev/null +++ b/src/core1/code_9D30.c @@ -0,0 +1,173 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8024A840(s32 arg0, s32 arg1, s32 arg2); +void func_8024A85C(s32 arg0); + +extern s16 D_80275BBC; + + +extern s16 D_80275BC4; + +extern s16 D_80275BCC; +extern s16 D_80275BD0; +extern s16 D_80275BD4; + +/* .bss */ +s32 D_802806E0; +s32 D_802806E4; +s32 D_802806E8; +s32 D_802806EC; + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80247750.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_8024776C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80247818.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_802478C0.s") + +void func_8024792C(void){} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80247934.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80247978.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_802479E4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80247A40.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80247A7C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80247C20.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80247CEC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80247D80.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80247F24.s") + +void func_80247F9C(s32 arg0){ + func_80247D80(D_80275BCC, arg0, 2); + func_802484D0(); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80247FD0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80248098.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_8024824C.s") + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80248330.s") +#else +void func_80248330(u8 *arg0){ + s32 i; + s32 val; + + D_80275BC4 = D_80275BBC; + D_80275BD4 = 2; + for(i = 0; arg0[i] != 0; i++){ + func_8024824C(arg0[i]); + func_80247CEC(D_80275BCC, arg0[i], 2); + } + func_80248520(); +} +#endif + +void func_802483B8(void){ + D_80275BD0 = 1; + do{}while(1); +} + +void func_802483D8(void){ + s32 i; + D_80275BD0 = 1; + for(i = 30000000; i != 0; i--){} + D_80275BD0 = 0; +} + +void func_80248404(s32 arg0){ + s32 i; + + D_80275BD0 = 1; + while(arg0 != 0){ + for(i = 30000000; i != 0; i--){} + arg0--; + } + D_80275BD0 = 0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80248444.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_802484D0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80248500.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80248520.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_8024856C.s") + +s32 func_802485BC(void){ + return D_80275BD0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_802485C8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_802485D0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80248870.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80248B40.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80248D40.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80248F9C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80249210.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80249428.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80249644.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_802499BC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_802499D0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_802499E4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80249CEC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80249DE0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_80249F34.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_8024A284.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_8024A3C8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_8024A490.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_8024A564.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_9D30/func_8024A770.s") + +void func_8024A810(void){ + func_8024A840(0, 0x80, 0); + func_8024A85C(0); +} + +void func_8024A840(s32 arg0, s32 arg1, s32 arg2){ + D_802806E0 = arg0; + D_802806E4 = arg1; + D_802806E8 = arg2; +} + +void func_8024A85C(s32 arg0){ + D_802806EC = arg0; +} + +s32 func_8024A868(void){ + return D_802806EC; +} diff --git a/src/core1/code_E360.c b/src/core1/code_E360.c new file mode 100644 index 00000000..1c9e0305 --- /dev/null +++ b/src/core1/code_E360.c @@ -0,0 +1,196 @@ +#include +#include "functions.h" +#include "variables.h" + + + +void func_8024BF94(s32 arg0); +void func_8024C2F8(void *); + +typedef struct struct_1_s{ + OSMesgQueue *messageQueue; + OSMesg message; +} struct1; + +extern u32 D_80000300; + +extern OSViMode D_80275C80; +extern OSViMode D_80275CD0; + +u32 D_80280720; +u32 D_80280724; +u32 D_80280728; +struct1 D_80280730[8]; +OSMesgQueue D_80280770; +OSMesgQueue D_802807B0; +OSMesgQueue D_802807D0; +volatile s32 D_802808D8; +s32 D_802808DC; +OSThread D_802808E0; +u8 pad_80280970[0x520]; + + +extern u8 D_803A5D00[2][0x1ECC0]; //framebuffer + +void func_8024C428(void); + +/* .code */ +bool func_8024BD80(void){ + sizeof(OSThread); + return NOT(D_80280720); +} + +s32 func_8024BD94(void){ + return D_80280724; +} + +s32 func_8024BDA0(void){ + return D_80280720; +} + +void func_8024BDAC(OSMesgQueue *mq, OSMesg msg){ + s32 i; + for(i = 0; i < 8; i++){ + if(D_80280730[i].messageQueue == NULL){ + D_80280730[i].messageQueue = mq; + D_80280730[i].message = msg; + return; + } + } + +} + +void func_8024BE30(void){ + extern s32 D_80280E90; + s32 i; + + func_8024C428(); + osCreateViManager(0xfe); + if(D_80000300 != 1) + osViSetMode(&D_80275CD0); //PAL + else + osViSetMode(&D_80275C80); //NTSC + + osViSetSpecialFeatures(OS_VI_DITHER_FILTER_ON); + osViSetSpecialFeatures(OS_VI_GAMMA_OFF); + osViSwapBuffer(&D_803A5D00); + osCreateMesgQueue(&D_80280770, (&D_80280770 + 1), 10); + osCreateMesgQueue(&D_802807B0, (&D_802807B0 + 1), 1); + osCreateMesgQueue(&D_802807D0, (&D_802807D0 + 1), 0x3C); + osViSetEvent(&D_80280770,NULL,1); + D_80280720 = 0; + D_80280724 = 1; + D_80280728 = 0; + for(i = 0; i<8; i++){ + D_80280730[i].messageQueue = NULL; + } + D_802808D8 = 0; + func_8024BF94(2); + osCreateThread(&D_802808E0,0,func_8024C2F8,NULL,&D_80280E90,0x50); + osStartThread(&D_802808E0); +} + +void func_8024BF94(s32 arg0){ + D_802808DC = arg0; +} + +s32 func_8024BFA0(void){ + return D_802808DC; +} + +void func_8024BFAC(void){ + osSendMesg(&D_802807B0, 0, OS_MESG_NOBLOCK); +} + +void func_8024BFD8(s32 arg0){ + static s32 D_80280E90; + + osSetThreadPri(NULL, 0x7f); + func_802408EC(0x1E); + func_80240874(); + if(arg0){ + osRecvMesg(&D_802807B0, NULL, OS_MESG_BLOCK); + } + + while(D_802808D8 < func_8024BFA0() - D_80280E90){ + osRecvMesg(&D_802807D0, NULL, OS_MESG_BLOCK); + } + + while(D_802807D0.validCount){ + osRecvMesg(&D_802807D0, NULL, OS_MESG_NOBLOCK); + } + + osViSwapBuffer(D_803A5D00[D_80280720 = func_8024BD80()]); + D_80280E90 = 0; + while(!(osDpGetStatus() & 2) && osViGetCurrFrameBuffer() != osViGetNextFrameBuffer()){ + osRecvMesg(&D_802807D0, NULL, OS_MESG_BLOCK); + D_80280E90++; + }//L8024C178 + D_80280724 = D_802808D8; + D_802808D8 = 0; + func_802408B0(); + osSetThreadPri(NULL, 0x14); + func_802408EC(0xA); +} + +void func_8024C1B4(void){ + func_8024BFD8(0); + func_8025AFB8(); +} + +void func_8024C1DC(void){ + func_8024BFD8(1); +} + +void func_8024C1FC(OSMesgQueue *mq, OSMesg msg){ + s32 i; + for(i = 0; i < 8; i++){ + if(D_80280730[i].messageQueue == mq && D_80280730[i].message == msg){ + D_80280730[i].messageQueue = NULL; + return; + } + } +} + +void func_8024C2A0(s32 arg0) { + D_80280720 = arg0; + osViSwapBuffer(D_803A5D00[D_80280720]); +} + +void func_8024C2F8(void *arg0){ + s32 i; + OSMesg sp48; + do{ + osRecvMesg(&D_80280770, &sp48, OS_MESG_BLOCK); + func_80247380(); + D_802808D8++; + if(D_802808D8 == 420){ + func_802485BC(); + } + osSendMesg(&D_802807D0, NULL, OS_MESG_NOBLOCK); + + for(i = 0; i < 8; i++){ + if(D_80280730[i].messageQueue != NULL){ + osSendMesg(D_80280730[i].messageQueue, D_80280730[i].message, OS_MESG_NOBLOCK); + } + } + }while(1); +} + +void func_8024C408(s32 arg0){ + osViBlack(arg0); +} + +void func_8024C428(void) { + //zeros all both framebuffers + func_80253034(&D_803A5D00, 0, (s32) ((f32)D_80276588*2*D_8027658C*2)); + osWritebackDCache(&D_803A5D00, (s32) ((f32)D_80276588*2* D_8027658C*2)); +} + +s32 func_8024C4E8(void){ + return D_802808D8; +} + +void func_8024C4F8(s32 arg0){ + D_802808D8 = arg0; +} diff --git a/src/core1/code_EAF0.c b/src/core1/code_EAF0.c new file mode 100644 index 00000000..c7519e9d --- /dev/null +++ b/src/core1/code_EAF0.c @@ -0,0 +1,575 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void guPerspective(Mtx *, u16*, f32, f32, f32, f32, f32); +extern s32 D_A00001D8; + +/* .data */ +extern f32 D_80275D20; //fovy +extern f32 D_80275D24; //aspect +extern f32 D_80275D28; //near +extern f32 D_80275D2C; //far + +extern s32 D_80275D38; + +/* .rodata */ +extern f64 D_802779F0; +extern f32 D_80277A08; +extern f64 D_80277A30; +extern f32 D_80277A00; +extern f32 D_80277A04; +extern f32 D_80277A0C; +extern f32 D_80277A10; +extern f32 D_80277A14; +extern f32 D_80277A18; +extern f32 D_80277A1C; +extern f32 D_80277A20; + +/* .data */ +f32 D_80280EA0[3]; +f32 D_80280EB0[3]; +f32 D_80280EC0[3]; +f32 D_80280ECC; +f32 D_80280ED0[4][4]; +Vp D_80280F10[8]; +int D_80280F90; +Mtx D_80280F98; +Mtx D_80280FD8; +s32 D_80281018; //viewport indx +u8 pad_D_8028101C[0x104]; +u8 D_80281130[0x188]; +OSMesg D_802812B0; +OSMesg D_802812B4; +OSContPad D_802812B8[4]; +OSContPad D_802812D0; +OSMesgQueue D_802812D8; +OSMesgQueue D_802812F0; +u8 pad_D_80281308[0x10]; +OSContStatus D_80281318; +u8 pad_D_80281320[0x8]; +s32 D_80281328; +OSThread D_80281330; +u8 pad_D_802814E0[0x200]; +f32 D_802816E0; +OSMesgQueue D_802816E8; +OSMesg D_80281700[4]; +u8 pad_D_80281710[1]; + +void func_8024F450(void); +void func_8024F4AC(void); +void func_8024C964(Gfx **, Mtx **, f32, f32); +void func_8024CD7C(int); +void func_8024CDF8(f32, f32, f32); +void func_8024CE40(f32, f32, f32); +void func_8024CE60(f32, f32); +void func_8024CE74(s32 arg0, s32 arg1, s32 arg2, s32 arg3); +void func_8024DDB4(f32); + +void func_80256E24(f32 [3], f32, f32, f32, f32, f32); + +/* .code */ +void func_8024C510(f32 arg0){ + f32 sp24[3]; + func_80256E24(sp24, D_80280EC0[0], D_80280EC0[1], 0.0f, 0.0f, arg0); + D_80280EB0[0] += sp24[0]; + D_80280EB0[1] += sp24[1]; + D_80280EB0[2] += sp24[2]; +} + +void func_8024C584(f32 arg0[3]){ + ml_vec3f_distance(arg0, D_80280EB0); +} + +void func_8024C5A8(f32 arg0[3]){ + ml_vec3f_copy(arg0, D_80280EA0); +} + +void func_8024C5CC(f32 arg0[3]){ + ml_vec3f_copy(arg0, D_80280EB0); +} + +void func_8024C5F0(s32 dst[3]){ + dst[0] = ((f32)(s32)(D_80280EB0[0]*500.0))/500.0; + dst[1] = ((f32)(s32)(D_80280EB0[1]*500.0))/500.0; + dst[2] = ((f32)(s32)(D_80280EB0[2]*500.0))/500.0; +} + +void func_8024C6A0(s16 dst[3]){ + dst[0] = ((f32)(s32)(D_80280EB0[0]*500.0))/500.0; + dst[1] = ((f32)(s32)(D_80280EB0[1]*500.0))/500.0; + dst[2] = ((f32)(s32)(D_80280EB0[2]*500.0))/500.0; +} + +void func_8024C764(f32 arg0[3]){ + ml_vec3f_copy(arg0, D_80280EC0); +} + +f32 func_8024C788(void){ + return D_80280EC0[1]; +} + +void func_8024C794(f32 *arg0, f32 *arg1, f32 *arg2){ + *arg0 = D_80280EC0[0]; + *arg1 = D_80280EC0[1]; + *arg2 = D_80280EC0[2]; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024C7B8.s") +#else +void func_8024C7B8(Gfx **gfx, Mtx **mtx){ + f32 tmp_f0; + f32 tmp_f16; + f32 tmp_f2; + f32 tmp_f18; + gSPViewport((*gfx)++, &D_80280F10[D_80281018]); + + tmp_f0 = 2*(f32)D_80276588; + tmp_f2 = 2*(f32)D_8027658C; + guOrtho(*mtx, -tmp_f0, tmp_f0, -tmp_f2, tmp_f2, 1.0f, 20.0f, 1.0f); + gSPMatrix((*gfx)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + + guTranslate(*mtx, 0.0f, 0.0f, 0.0f); + gSPMatrix((*gfx)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); +} +#endif + +void func_8024C904(Gfx **gfx, Mtx **mtx){ + gSPViewport((*gfx)++, &D_80280F10[D_80281018]); + func_8024C964(gfx, mtx, D_80275D28, D_80275D2C); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024C964.s") +#else +void func_8024C964(Gfx **gfx, Mtx **mtx, f32 near, f32 far){ + u16 sp5e; + + near = MAX(D_80275D28, near); + far = MIN(D_80275D2C, far); + + if(D_A00001D8 + 0x53D4FFF0){ + near = D_80277A00; + far = D_80277A04; + } + + guPerspective(*mtx, &sp5e, D_80275D20, D_80275D24, near, far, 0.5f); + gSPPerspNormalize((*gfx)++, sp5e); + gSPMatrix((*gfx)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); + + guRotate(*mtx, -D_80280EC0[2], 0.0f, 0.0f, -1.0f); + gSPMatrix((*gfx)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + + guRotate(*mtx, -D_80280EC0[0], 1.0f, 0.0f, 0.0f); + gSPMatrix((*gfx)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + + guRotate(*mtx, -D_80280EC0[1], 0.0f, 1.0f, 0.0f); + gSPMatrix((*gfx)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + + guTranslate(*mtx, 0.0f, 0.0f, 0.0f); + gSPMatrix((*gfx)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); +} +#endif + +void func_8024CBD4(Gfx **gfx, Mtx **mtx){ + func_8024C964(gfx, mtx, D_80275D28, D_80275D2C); +} + +void func_8024CC00(void){} + +void func_8024CC08(f32 arg0){ + if(90.0f < arg0) arg0 = 90.0f; + if(arg0 < 5.0f) arg0 = 10.0f; + D_80280ECC = arg0; +} + +f32 func_8024CC50(void){ + return D_80280ECC; +} + +void func_8024CC5C(void){ + func_8024CE74((s32) ((f32)D_80276588/2), (s32) ((f32)D_8027658C/2), (s32) ((f32)D_80276588/2), (s32) ((f32)D_8027658C/2)); +} + +void func_8024CCC4(void){ + func_8024CD7C(1); + func_8024CDF8(0.0f, 0.0f, 0.0f); + func_8024CE40(0.0f, 0.0f, 0.0f); + func_8024CC08(40.0f); + func_8024CE60(1.0f, D_80277A08); + func_8024CC5C(); + func_8024DDB4(40.0f); + mlMtxIdent(); + mlMtxRotYaw(-60.0f); + mlMtxRotPitch(-90.0f); + func_802513B0(&D_80280FD8); +} + +void func_8024CD7C(int arg0){ + D_80280F90 = arg0; +} + +void func_8024CD88(f32 src[3]){ + ml_vec3f_copy(D_80280EB0, src); +} + +void func_8024CDB0(s32 src[3]){ + D_80280EB0[0] = (f32)src[0]; + D_80280EB0[1] = (f32)src[1]; + D_80280EB0[2] = (f32)src[2]; +} + +void func_8024CDF8(f32 arg0, f32 arg1, f32 arg2){ + D_80280EB0[0] = arg0; + D_80280EB0[1] = arg1; + D_80280EB0[2] = arg2; +} + +void func_8024CE18(f32 src[3]){ + ml_vec3f_copy(D_80280EC0, src); +} + +void func_8024CE40(f32 arg0, f32 arg1, f32 arg2){ + D_80280EC0[0] = arg0; + D_80280EC0[1] = arg1; + D_80280EC0[2] = arg2; +} + +void func_8024CE60(f32 near, f32 far){ + D_80275D28 = near; + D_80275D2C = far; +} + +void func_8024CE74(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ + D_80281018 = (D_80281018 + 1) % 8; + D_80280F10[D_80281018].vp.vscale[0] = arg0 << 2; + D_80280F10[D_80281018].vp.vscale[1] = arg1 << 2; + D_80280F10[D_80281018].vp.vscale[2] = 0x1ff; + D_80280F10[D_80281018].vp.vscale[3] = 0; + D_80280F10[D_80281018].vp.vtrans[0] = arg2 << 2; + D_80280F10[D_80281018].vp.vtrans[1] = arg3 << 2; + D_80280F10[D_80281018].vp.vtrans[2] = 0x1ff; + D_80280F10[D_80281018].vp.vtrans[3] = 0; + osWritebackDCache(&D_80280F10[D_80281018], sizeof(Vp)*8); +} + +void func_8024CF10(f32 arg0, f32 arg1, f32 arg2, f32 arg3){ + D_80281018 = (D_80281018 + 1) % 8; + D_80280F10[D_80281018].vp.vscale[0] = arg0*4; + D_80280F10[D_80281018].vp.vscale[1] = arg1*4; + D_80280F10[D_80281018].vp.vscale[2] = 0x1ff; + D_80280F10[D_80281018].vp.vscale[3] = 0; + D_80280F10[D_80281018].vp.vtrans[0] = arg2*4; + D_80280F10[D_80281018].vp.vtrans[1] = arg3*4; + D_80280F10[D_80281018].vp.vtrans[2] = 0x1ff; + D_80280F10[D_80281018].vp.vtrans[3] = 0; + osWritebackDCache(&D_80280F10[D_80281018], sizeof(Vp)*8); +} + +void func_8024CFD4(void){ + func_80256E24(D_80280ED0[0], D_80280EC0[0], D_80280EC0[1], -89.21774f, 0.0f, D_80277A0C); + func_80256E24(D_80280ED0[1], D_80280EC0[0], D_80280EC0[1], 89.21774f, 0.0f, D_80277A10); + func_80256E24(D_80280ED0[2], D_80280EC0[0], D_80280EC0[1], 0.0f, D_80277A14, D_80277A18); + func_80256E24(D_80280ED0[3], D_80280EC0[0], D_80280EC0[1], 0.0f, D_80277A1C, D_80277A20); + ml_vec3f_normalize(D_80280ED0[0]); + ml_vec3f_normalize(D_80280ED0[1]); + ml_vec3f_normalize(D_80280ED0[2]); + ml_vec3f_normalize(D_80280ED0[3]); + D_80280ED0[0][3] = -(D_80280EB0[0]*D_80280ED0[0][0] + D_80280EB0[1]*D_80280ED0[0][1] + D_80280EB0[2]*D_80280ED0[0][2]); + D_80280ED0[1][3] = -(D_80280EB0[0]*D_80280ED0[1][0] + D_80280EB0[1]*D_80280ED0[1][1] + D_80280EB0[2]*D_80280ED0[1][2]); + D_80280ED0[2][3] = -(D_80280EB0[0]*D_80280ED0[2][0] + D_80280EB0[1]*D_80280ED0[2][1] + D_80280EB0[2]*D_80280ED0[2][2]); + D_80280ED0[3][3] = -(D_80280EB0[0]*D_80280ED0[3][0] + D_80280EB0[1]*D_80280ED0[3][1] + D_80280EB0[2]*D_80280ED0[3][2]); + mlMtxIdent(); + mlMtxRotYaw(D_80280EC0[1]); + mlMtxRotPitch(D_80280EC0[0]); + func_802513B0(&D_80280F98); + D_80280EA0[0] = 0.0f; + D_80280EA0[1] = 0.0f; + D_80280EA0[2] = -1.0f; + func_8025235C(D_80280EA0, D_80280EA0); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024D1EC.s") +#else +void func_8024D1EC(f32 arg0[4], f32 arg1[4], f32 arg2[4], f32 arg3[4]){ + arg0[0] = D_80280ED0[0][0]; + arg1[0] = D_80280ED0[1][0]; + arg2[0] = D_80280ED0[2][0]; + arg3[0] = D_80280ED0[3][0]; + arg0[1] = D_80280ED0[0][1]; + arg1[1] = D_80280ED0[1][1]; + arg2[1] = D_80280ED0[2][1]; + arg3[1] = D_80280ED0[3][1]; + arg0[2] = D_80280ED0[0][2]; + arg1[2] = D_80280ED0[1][2]; + arg2[2] = D_80280ED0[2][2]; + arg3[2] = D_80280ED0[3][2]; + arg0[3] = D_80280ED0[0][3]; + arg1[3] = D_80280ED0[1][3]; + arg2[3] = D_80280ED0[2][3]; + arg3[3] = D_80280ED0[3][3]; +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024D2B0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024D374.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024D8F4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024D9B0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024DB50.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024DC04.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024DD0C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024DD34.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024DD90.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024DD9C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024DDA8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024DDB4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024DDC0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024DDCC.s") + +f32 func_8024DDD8(s32 arg0, f32 arg1){ + return mlNormalizeAngle((D_80280EC0[1] + arg1) + D_80277A30); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024DE1C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E030.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E258.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E2FC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E3A8.s") + +#ifndef CORE2_DATA_CRC2 + #define CORE2_DATA_CRC2 0 +#endif + +extern s32 D_803727F4 = CORE2_DATA_CRC2; + +extern s32 D_80276574; + +extern f32 D_80277A70; +extern f32 D_80277A74; + + +extern struct { + u8 pad0[4]; + s32 unk4; + u8 pad8[4]; + s32 unkC; +} D_80379B90; + +f32 func_8024E420(s32 arg0, s32 arg1, s32 arg2) { + f32 phi_f2; + + phi_f2 = D_80277A70; + if ((D_80379B90.unk4 != D_803727F4) || (D_80379B90.unkC != D_80276574)) { + phi_f2 = D_80277A74; + } + if (arg0 > 0) { + arg0 = (arg2 < arg0) ? arg2 : (arg0 < arg1) ? arg1 : arg0; + arg0 = (s32) ((arg0 - arg1) * 0x50) / (s32) (arg2 - arg1); + } else { + if (arg0 < 0) { + arg0 = (arg0 < -arg2) ? -arg2 : (-arg1 < arg0) ? -arg1 : arg0; + arg0 = (s32) ((arg0 + arg1) * 0x50) / (s32) (arg2 - arg1); + } + } + return phi_f2 *= arg0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E55C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E5A8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E5E8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E60C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E640.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E668.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E67C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E698.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E6E0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E71C.s") + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024E7C8.s") +#else +void func_8024E7C8(void){ + u32 s0; + s32 sp5C; + + if(func_8023E000() == 3) + func_802E4384(); + + osSetThreadPri(NULL, 0x29); + D_802812D0.stick_x = D_802812B8[0].stick_x; + D_802812D0.stick_y = D_802812B8[0].stick_y; + D_802812D0.button = D_802812B8[0].button; + if( getGameMode() == GAME_MODE_6_FILE_PLAYBACK + || getGameMode() == GAME_MODE_7_ATTRACT_DEMO + || getGameMode() == GAME_MODE_8_BOTTLES_BONUS + || getGameMode() == GAME_MODE_A_SNS_PICTURE + || getGameMode() == GAME_MODE_9_BANJO_AND_KAZOOIE + ){ + s0 = START_BUTTON; + if(gctransition_8030BD98()){ + D_802816E0 += time_getDelta(); + } + if(D_802816E0 < 1.0 || getGameMode() == GAME_MODE_9_BANJO_AND_KAZOOIE){ + s0 = 0; + } + + if(D_802812D0.button & s0 || demo_readInput(D_802812B8, &sp5C) < 1){ + if(D_802812D0.button & s0){ + func_803204E4(0x64, 1); + } + else{ + func_803204E4(0x63, 1); + } + func_8033DD90(); + }//L8024E944 + }//L8024E94C +} +#endif + +void func_8024EF74(void){ + func_8024F35C(0); + if(!D_80281318.errno) + osContGetReadData(D_802812B8); +} + +#ifndef NONMATCHING +void func_8024EFB0(void *); +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024EFB0.s") +#else +void func_8024EFB0(void *arg0){ + while(1){ + osRecvMesg(&D_802812D8, &D_802812F0, 1); + if(D_80281328 == TRUE){ + func_8024EF74(); + } + else{ + osSendMesg(&D_802812D8, 0, 0); + } + } +} +#endif + +void func_8024F05C(void){ + osCreateMesgQueue(&D_802812D8, &D_802812B0, 1); + osCreateMesgQueue(&D_802812F0, &D_802812B4, 1); + osCreateThread(&D_80281330, 7, func_8024EFB0, NULL, &D_802816E0, 0x28); + osSetEventMesg(OS_EVENT_SI, &D_802812D8, &D_802812B0); + osContInit(&D_802812D8, &D_80281130, &D_80281318); + osContSetCh(1); + func_8024F224(); + func_802476DC(); + osStartThread(&D_80281330); +} + +int func_8024F12C(void){ + return D_80281318.errno ? 1 : 0; +} + +void func_8024F150(void){ + if(func_8024F12C()) + func_802DD008(0,0); +} + +void func_8024F180(void){ + if(func_8024F12C()) + func_802DD040(0,0); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024F1B0.s") +#else +void func_8024F1B0(void){ + if(D_80281328 == 0){ + func_8024F35C(1); + osContStartReadData(&D_802812D8); + } +} +#endif + +void func_8024F1F0(void){ + osRecvMesg(&D_802812D8, NULL, 1); + func_8024E7C8(); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024F224.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024F2E4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024F328.s") + +OSMesgQueue * func_8024F344(void){ + return &D_802812F0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024F350.s") + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024F35C.s") +#else +void func_8024F35C(int arg0){ + if(!arg0) + func_8024F4AC(); + else + func_8024F450(); + + if(arg0 || D_802816E8.validCount == 1) + D_80281328[0] = arg0; + +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/code_EAF0/func_8024F3B4.s") + +int func_8024F3C4(int arg0){ + return D_802812B8[arg0].button + D_802812B8[arg0].stick_x + D_802812B8[arg0].stick_y; +} + +OSContPad *func_8024F3F4(void){ + return &D_802812D0; +} + +/* initilizes D_802816E8 message queue */ +void func_8024F400(void){ + D_80275D38 = TRUE; + osCreateMesgQueue(&D_802816E8, &D_80281700, 5); + osSendMesg(&D_802816E8, 0, 0); +} + +void func_8024F450(void){ + if(!D_80275D38) + func_8024F400(); + osRecvMesg(&D_802816E8, 0, 1); + osSetEventMesg(OS_EVENT_SI, &D_802812D8, &D_802812B0); +} + +void func_8024F4AC(void){ + osSendMesg(&D_802816E8, 0, 0); +} \ No newline at end of file diff --git a/src/core1/done/audio/auxbus.c b/src/core1/done/audio/auxbus.c new file mode 100644 index 00000000..2eb4efc4 --- /dev/null +++ b/src/core1/done/audio/auxbus.c @@ -0,0 +1,42 @@ +#include +#include "synthInternals.h" + +Acmd *alAuxBusPull(void *filter, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p) +{ + Acmd *ptr = p; + ALAuxBus *m = (ALAuxBus *)filter; + ALFilter **sources = m->sources; + s32 i; + + /* + * clear the output buffers here + */ + aClearBuffer(ptr++, AL_AUX_L_OUT, outCount<<1); + aClearBuffer(ptr++, AL_AUX_R_OUT, outCount<<1); + + for (i = 0; i < m->sourceCount; i++) { + ptr = (sources[i]->handler)(sources[i], outp, outCount, sampleOffset, + ptr); + } + + return ptr; +} + +s32 alAuxBusParam(void *filter, s32 paramID, void *param) +{ + ALAuxBus *m = (ALAuxBus *) filter; + ALFilter **sources = m->sources; + + switch (paramID) { + + case (AL_FILTER_ADD_SOURCE): + sources[m->sourceCount++] = (ALFilter *) param; + break; + + default: + /* ??? */ + break; + } + + return 0; +} diff --git a/src/core1/done/audio/bnkf.c b/src/core1/done/audio/bnkf.c new file mode 100644 index 00000000..9985a4c9 --- /dev/null +++ b/src/core1/done/audio/bnkf.c @@ -0,0 +1,118 @@ +#include +#include "functions.h" +#include "variables.h" + + +/* copt used??? */ + +void alSeqFileNew(ALSeqFile *file, u8 *base) +{ + s32 offset = (s32) base; + s32 i; + + /* + * patch the file so that offsets are pointers + */ + for (i = 0; i < file->seqCount; i++) { + file->seqArray[i].offset = (u8 *)((u8 *)file->seqArray[i].offset + offset); + } +} + +static void _bnkfPatchWaveTable(ALWaveTable *w, s32 offset, s32 table) +{ + if (w->flags) + return; + + w->flags = 1; + + w->base += table; + + /* sct 2/14/96 - patch wavetable loop info based on type. */ + if (w->type == AL_ADPCM_WAVE) + { + w->waveInfo.adpcmWave.book = (ALADPCMBook *)((u8 *)w->waveInfo.adpcmWave.book + offset); + if (w->waveInfo.adpcmWave.loop) + w->waveInfo.adpcmWave.loop = (ALADPCMloop *)((u8 *)w->waveInfo.adpcmWave.loop + offset); + } + else if (w->type == AL_RAW16_WAVE) + { + if (w->waveInfo.rawWave.loop) + w->waveInfo.rawWave.loop = (ALRawLoop *)((u8 *)w->waveInfo.rawWave.loop + offset); + } +} + +static void _bnkfPatchSound(ALSound *s, s32 offset, s32 table) +{ + if (s->flags) + return; + + s->flags = 1; + + s->envelope = (ALEnvelope *)((u8 *)s->envelope + offset); + s->keyMap = (ALKeyMap *)((u8 *)s->keyMap + offset); + + s->wavetable = (ALWaveTable *)((u8 *)s->wavetable + offset); + _bnkfPatchWaveTable(s->wavetable, offset, table); +} + +static void _bnkfPatchInst(ALInstrument *inst, s32 offset, s32 table) +{ + s32 i; + + if (inst->flags) + return; + + inst->flags = 1; + + for (i = 0; i < inst->soundCount; i++) { + inst->soundArray[i] = (ALSound *)((u8 *)inst->soundArray[i] + + offset); + _bnkfPatchSound(inst->soundArray[i], offset, table); + + } +} + +static void _bnkfPatchBank(ALBank *bank, s32 offset, s32 table) +{ + s32 i; + + if (bank->flags) + return; + + bank->flags = 1; + + if (bank->percussion) { + bank->percussion = (ALInstrument *)((u8 *)bank->percussion + offset); + _bnkfPatchInst(bank->percussion, offset, table); + } + + for (i = 0; i < bank->instCount; i++) { + bank->instArray[i] = (ALInstrument *)((u8 *)bank->instArray[i] + + offset); + if(bank->instArray[i]) + _bnkfPatchInst(bank->instArray[i], offset, table); + } +} + +void alBnkfNew(ALBankFile *file, u8 *table) +{ + s32 offset = (s32) file; + s32 woffset = (s32) table; + + s32 i; + + /* + * check the file format revision in debug libraries + */ + ALFailIf(file->revision != AL_BANK_VERSION, ERR_ALBNKFNEW); + + /* + * patch the file so that offsets are pointers + */ + for (i = 0; i < file->bankCount; i++) { + file->bankArray[i] = (ALBank *)((u8 *)file->bankArray[i] + offset); + if(file->bankArray[i]) + _bnkfPatchBank(file->bankArray[i], offset, woffset); + } +} + diff --git a/src/core1/done/audio/cents2ratio.c b/src/core1/done/audio/cents2ratio.c new file mode 100644 index 00000000..497b5dbc --- /dev/null +++ b/src/core1/done/audio/cents2ratio.c @@ -0,0 +1,23 @@ +#include + +f32 alCents2Ratio(s32 cents) +{ + f32 x; + f32 ratio = 1.0f; + + if (cents >= 0) { + x = 1.00057779f; /* 2^(1/1200) */ + } else { + x = 0.9994225441f; /* 2^(-1/1200) */ + cents = -cents; + } + + while (cents) { + if (cents & 1) + ratio *= x; + x *= x; + cents >>= 1; + } + + return ratio; +} diff --git a/src/core1/done/audio/code_219D0.c b/src/core1/done/audio/code_219D0.c new file mode 100644 index 00000000..bb5e4ee6 --- /dev/null +++ b/src/core1/done/audio/code_219D0.c @@ -0,0 +1,14 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_8025F3F0(ALCSPlayer *seqp, f32 arg1, f32 arg2) +{ + ALEvent evt; + + evt.type = AL_UNK18_EVT; //event type not listed; + evt.msg.unk18.unk0 = arg1; + evt.msg.unk18.unk4 = arg2; + alEvtqPostEvent(&seqp->evtq, &evt, 0); +} diff --git a/src/core1/done/audio/code_21A80.c b/src/core1/done/audio/code_21A80.c new file mode 100644 index 00000000..9bb69a19 --- /dev/null +++ b/src/core1/done/audio/code_21A80.c @@ -0,0 +1,9 @@ +#include +#include "functions.h" +#include "variables.h" +#include "n_synth.h" + +u8 func_8025F4A0(N_ALCSPlayer *seqp, u8 chan) +{ + return seqp->chanState[chan].unk9; +} diff --git a/src/core1/done/audio/code_21AF0.c b/src/core1/done/audio/code_21AF0.c new file mode 100644 index 00000000..fef4130f --- /dev/null +++ b/src/core1/done/audio/code_21AF0.c @@ -0,0 +1,16 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8025F510(ALCSPlayer *seqp, u8 chan, u8 arg2) +{ + ALEvent evt; + + evt.type = AL_SEQP_MIDI_EVT; + evt.msg.midi.ticks = 0; + evt.msg.midi.status = AL_MIDI_ControlChange | chan; + evt.msg.midi.byte1 = 0x7D; + evt.msg.midi.byte2 = arg2; + + alEvtqPostEvent(&seqp->evtq, &evt, 0); +} diff --git a/src/core1/done/audio/code_21B50.c b/src/core1/done/audio/code_21B50.c new file mode 100644 index 00000000..c97eb318 --- /dev/null +++ b/src/core1/done/audio/code_21B50.c @@ -0,0 +1,40 @@ +#include +#include "functions.h" +#include "variables.h" +#include "n_synth.h" + + +void func_8025F610(void){ + n_syn->head = NULL; + n_syn->n_seqp1 = NULL; + n_syn->n_seqp2 = NULL; + n_syn->unk5C = NULL; + n_syn->unk60 = NULL; + n_syn->unk64 = NULL; + n_syn->unk68 = NULL; + n_syn->unk6C = NULL; + n_syn->unk70 = NULL; + n_syn->n_sndp = NULL; +} + +void func_8025F5C0(N_ALSeqPlayer *arg0, u8 arg1){ + ALEvent evt; + + evt.type = AL_SEQP_MIDI_EVT; + evt.msg.midi.ticks = 0; + evt.msg.midi.status = AL_MIDI_ChannelModeSelect; + evt.msg.midi.byte1 = 0x7E; + evt.msg.midi.byte2 = arg1; + alEvtqPostEvent(&arg0->evtq, &evt, 0); +} + +void func_8025F570(N_ALSeqPlayer *arg0, u8 arg1){ + ALEvent evt; + + evt.type = AL_SEQP_MIDI_EVT; + evt.msg.midi.ticks = 0; + evt.msg.midi.status = AL_MIDI_ChannelModeSelect; + evt.msg.midi.byte1 = 0x7F; + evt.msg.midi.byte2 = arg1; + alEvtqPostEvent(&arg0->evtq, &evt, 0); +} diff --git a/src/core1/done/audio/copy.c b/src/core1/done/audio/copy.c new file mode 100644 index 00000000..ef27d6e9 --- /dev/null +++ b/src/core1/done/audio/copy.c @@ -0,0 +1,14 @@ +#include +#include "functions.h" +#include "variables.h" + +void alCopy(void *src, void *dest, s32 len) +{ + s32 i; + u8 *s = (u8 *)src; + u8 *d = (u8 *)dest; + + for (i = 0; i < len; i++){ + *d++ = *s++; + } +} diff --git a/src/core1/done/audio/cseq.c b/src/core1/done/audio/cseq.c new file mode 100644 index 00000000..142b1a3b --- /dev/null +++ b/src/core1/done/audio/cseq.c @@ -0,0 +1,375 @@ +#include + +static u32 __readVarLen(ALCSeq *s,u32 track); +static u8 __getTrackByte(ALCSeq *s,u32 track); +static u32 __alCSeqGetTrackEvent(ALCSeq *seq, u32 track, ALEvent *event); + +void alCSeqNew(ALCSeq *seq, u8 *ptr) +{ + u32 i,tmpOff,flagTmp; + + /* load the seqence pointed to by ptr */ + seq->base = (ALCMidiHdr*)ptr; + seq->validTracks = 0; + seq->lastDeltaTicks = 0; + seq->lastTicks = 0; + seq->deltaFlag = 1; + + for(i = 0; i < 16; i++) + { + seq->lastStatus[i] = 0; + seq->curBUPtr[i] = 0; + seq->curBULen[i] = 0; + tmpOff = seq->base->trackOffset[i]; + if(tmpOff) /* if the track is valid */ + { + flagTmp = 1 << i; + seq->validTracks |= flagTmp; + seq->curLoc[i] = (u8*)((u32)ptr + tmpOff); + seq->evtDeltaTicks[i] = __readVarLen(seq,i); + /*__alCSeqGetTrackEvent(seq,i); prime the event buffers */ + } + else + seq->curLoc[i] = 0; + } + + seq->qnpt = 1.0/(f32)seq->base->division; +} + +void alCSeqNextEvent(ALCSeq *seq,ALEvent *evt) +{ + u32 i; + u32 firstTime = 0xFFFFFFFF; + u32 firstTrack; + u32 lastTicks = seq->lastDeltaTicks; + +#ifdef _DEBUG + /* sct 1/17/96 - Warn if we are beyond the end of sequence. */ + if (!seq->validTracks) + __osError(ERR_ALSEQOVERRUN, 0); +#endif + + + for(i = 0; i < 16 ; i++) + { + if((seq->validTracks >> i) & 1) + { + if(seq->deltaFlag) + seq->evtDeltaTicks[i] -= lastTicks; + if(seq->evtDeltaTicks[i] < firstTime) + { + firstTime = seq->evtDeltaTicks[i]; + firstTrack = i; + } + } + } + + __alCSeqGetTrackEvent(seq,firstTrack,evt); + + evt->msg.midi.ticks = firstTime; + seq->lastTicks += firstTime; + seq->lastDeltaTicks = firstTime; + if(evt->type != AL_TRACK_END) + seq->evtDeltaTicks[firstTrack] += __readVarLen(seq,firstTrack); + seq->deltaFlag = 1; + +} + + +/* + Note: If there are no valid tracks (ie. all tracks have + reached the end of their data stream), then return FALSE + to indicate that there is no next event. +*/ +char __alCSeqNextDelta(ALCSeq *seq, s32 *pDeltaTicks) +{ + u32 i; + u32 firstTime = 0xFFFFFFFF; + u32 lastTicks = seq->lastDeltaTicks; + + if (!seq->validTracks) + return FALSE; + + for(i = 0; i < 16 ; i++) + { + if((seq->validTracks >> i) & 1) + { + if(seq->deltaFlag) + seq->evtDeltaTicks[i] -= lastTicks; + + if(seq->evtDeltaTicks[i] < firstTime) + firstTime = seq->evtDeltaTicks[i]; + } + } + + seq->deltaFlag = 0; + *pDeltaTicks = firstTime; + + return TRUE; +} + +/* only call alCSeqGetTrackEvent with a valid track !! */ +static u32 __alCSeqGetTrackEvent(ALCSeq *seq, u32 track, ALEvent *event) +{ + u32 offset; + u8 status, loopCt, curLpCt, *tmpPtr; + + + status = __getTrackByte(seq,track); /* read the status byte */ + + if (status == AL_MIDI_Meta) /* running status not allowed on meta events!! */ + { + u8 type = __getTrackByte(seq,track); + + if (type == AL_MIDI_META_TEMPO) + { + event->type = AL_TEMPO_EVT; + event->msg.tempo.status = status; + event->msg.tempo.type = type; + event->msg.tempo.byte1 = __getTrackByte(seq,track); + event->msg.tempo.byte2 = __getTrackByte(seq,track); + event->msg.tempo.byte3 = __getTrackByte(seq,track); + seq->lastStatus[track] = 0; /* lastStatus not supported after meta */ + } + else if (type == AL_MIDI_META_EOT) + { + u32 flagMask; + + flagMask = 0x01 << track; + seq->validTracks = seq->validTracks ^ flagMask; + + if(seq->validTracks) /* there is music left don't end */ + event->type = AL_TRACK_END; + else /* no more music send AL_SEQ_END_EVT msg */ + event->type = AL_SEQ_END_EVT; + } + else if (type == AL_CMIDI_LOOPSTART_CODE) + { + status = __getTrackByte(seq,track); /* get next two bytes, ignore them */ + status = __getTrackByte(seq,track); + seq->lastStatus[track] = 0; + event->type = AL_CSP_LOOPSTART; + } + else if (type == AL_CMIDI_LOOPEND_CODE) + { + tmpPtr = seq->curLoc[track]; + loopCt = *tmpPtr++; + curLpCt = *tmpPtr; + if(curLpCt == 0) /* done looping */ + { + *tmpPtr = loopCt; /* reset current loop count */ + seq->curLoc[track] = tmpPtr + 5; /* move pointer to end of event */ + } + else + { + if(curLpCt != 0xFF) /* not a loop forever */ + *tmpPtr = curLpCt - 1; /* decrement current loop count */ + tmpPtr++; /* get offset from end of event */ + offset = (*tmpPtr++) << 24; + offset += (*tmpPtr++) << 16; + offset += (*tmpPtr++) << 8; + offset += *tmpPtr++; + seq->curLoc[track] = tmpPtr - offset; + } + seq->lastStatus[track] = 0; + event->type = AL_CSP_LOOPEND; + } + +#ifdef _DEBUG + else + __osError(ERR_ALSEQMETA, 1, type); +#endif + + } + else + { + event->type = AL_SEQ_MIDI_EVT; + if (status & 0x80) /* if high bit is set, then new status */ + { + event->msg.midi.status = status; + event->msg.midi.byte1 = __getTrackByte(seq,track); + seq->lastStatus[track] = status; + } + else /* running status */ + { +#ifdef _DEBUG + if(seq->lastStatus[track] == 0) + __osError(ERR_ALCSEQZEROSTATUS, 1, track); +#endif + event->msg.midi.status = seq->lastStatus[track]; + event->msg.midi.byte1 = status; + } + + if (((event->msg.midi.status & 0xf0) != AL_MIDI_ProgramChange) && + ((event->msg.midi.status & 0xf0) != AL_MIDI_ChannelPressure)) + { + event->msg.midi.byte2 = __getTrackByte(seq,track); + if((event->msg.midi.status & 0xf0) == AL_MIDI_NoteOn) + { + event->msg.midi.duration = __readVarLen(seq,track); +#ifdef _DEBUG + if(event->msg.midi.byte2 == 0) + __osError( ERR_ALCSEQZEROVEL, 1, track); +#endif + } + } + else + event->msg.midi.byte2 = 0; + } + return TRUE; +} + +f32 alCSeqTicksToSec(ALCSeq *seq, s32 ticks, u32 tempo) +{ + return ((f32) (((f32)(ticks) * (f32)(tempo)) / + ((f32)(seq->base->division) * 1000000.0))); +} + +u32 alCSeqSecToTicks(ALCSeq *seq, f32 sec, u32 tempo) +{ + return (u32)(((sec * 1000000.0) * seq->base->division) / tempo); +} + + +s32 alCSeqGetTicks(ALCSeq *seq) +{ + return seq->lastTicks; +} + + +void alCSeqNewMarker(ALCSeq *seq, ALCSeqMarker *m, u32 ticks) +{ + ALEvent evt; + ALCSeq tempSeq; + s32 i; + + + alCSeqNew(&tempSeq, (u8*)seq->base); + + do { + m->validTracks = tempSeq.validTracks; + m->lastTicks = tempSeq.lastTicks; + m->lastDeltaTicks = tempSeq.lastDeltaTicks; + + for(i=0;i<16;i++) + { + m->curLoc[i] = tempSeq.curLoc[i]; + m->curBUPtr[i] = tempSeq.curBUPtr[i]; + m->curBULen[i] = tempSeq.curBULen[i]; + m->lastStatus[i] = tempSeq.lastStatus[i]; + m->evtDeltaTicks[i] = tempSeq.evtDeltaTicks[i]; + } + + alCSeqNextEvent(&tempSeq, &evt); + + if (evt.type == AL_SEQ_END_EVT) + break; + + } while (tempSeq.lastTicks < ticks); + +} + +void alCSeqSetLoc(ALCSeq *seq, ALCSeqMarker *m) +{ + s32 i; + + seq->validTracks = m->validTracks; + seq->lastTicks = m->lastTicks; + seq->lastDeltaTicks = m->lastDeltaTicks; + + for(i=0;i<16;i++) + { + seq->curLoc[i] = m->curLoc[i]; + seq->curBUPtr[i] = m->curBUPtr[i]; + seq->curBULen[i] = m->curBULen[i]; + seq->lastStatus[i] = m->lastStatus[i]; + seq->evtDeltaTicks[i] = m->evtDeltaTicks[i]; + } +} + +void alCSeqGetLoc(ALCSeq *seq, ALCSeqMarker *m) +{ + s32 i; + + m->validTracks = seq->validTracks; + m->lastTicks = seq->lastTicks; + m->lastDeltaTicks = seq->lastDeltaTicks; + + for(i=0;i<16;i++) + { + m->curLoc[i] = seq->curLoc[i]; + m->curBUPtr[i] = seq->curBUPtr[i]; + m->curBULen[i] = seq->curBULen[i]; + m->lastStatus[i] = seq->lastStatus[i]; + m->evtDeltaTicks[i] = seq->evtDeltaTicks[i]; + } +} + +/* non-aligned byte reading routines */ +static u8 __getTrackByte(ALCSeq *seq,u32 track) +{ + u8 theByte; + + + if(seq->curBULen[track]) + { + theByte = *seq->curBUPtr[track]; + seq->curBUPtr[track]++; + seq->curBULen[track]--; + } + else /* need to handle backup mode */ + { + theByte = *seq->curLoc[track]; + seq->curLoc[track]++; + if(theByte == AL_CMIDI_BLOCK_CODE) + { + u8 loBackUp,hiBackUp,theLen,nextByte; + u32 backup; + + nextByte = *seq->curLoc[track]; + seq->curLoc[track]++; + if(nextByte != AL_CMIDI_BLOCK_CODE) + { + /* if here, then got a backup section. get the amount of + backup, and the len of the section. Subtract the amount of + backup from the curLoc ptr, and subtract four more, since + curLoc has been advanced by four while reading the codes. */ + hiBackUp = nextByte; + loBackUp = *seq->curLoc[track]; + seq->curLoc[track]++; + theLen = *seq->curLoc[track]; + seq->curLoc[track]++; + backup = (u32)hiBackUp; + backup = backup << 8; + backup += loBackUp; + seq->curBUPtr[track] = seq->curLoc[track] - (backup + 4); + seq->curBULen[track] = (u32)theLen; + + /* now get the byte */ + theByte = *seq->curBUPtr[track]; + seq->curBUPtr[track]++; + seq->curBULen[track]--; + } + } + } + + return theByte; +} + +static u32 __readVarLen(ALCSeq *seq,u32 track) +{ + u32 value; + u32 c; + + value = (u32)__getTrackByte(seq,track); + if ( value & 0x00000080 ) + { + value &= 0x7f; + do + { + c = (u32)__getTrackByte(seq,track); + value = (value << 7) + (c & 0x7f); + } while (c & 0x80); + } + return (value); +} diff --git a/src/core1/done/audio/cspgettempo.c b/src/core1/done/audio/cspgettempo.c new file mode 100644 index 00000000..0f22e99b --- /dev/null +++ b/src/core1/done/audio/cspgettempo.c @@ -0,0 +1,10 @@ +#include +#include "functions.h" +#include "variables.h" + +s32 alCSPGetTempo(ALCSPlayer *seqp){ + if(seqp->target == NULL) + return 0; + return seqp->uspt / seqp->target->qnpt; +} + diff --git a/src/core1/done/audio/cspplay.c b/src/core1/done/audio/cspplay.c new file mode 100644 index 00000000..0de783d5 --- /dev/null +++ b/src/core1/done/audio/cspplay.c @@ -0,0 +1,12 @@ +#include +#include "functions.h" +#include "variables.h" + + +void alCSPPlay(ALCSPlayer *seqp) +{ + ALEvent evt; + + evt.type = AL_SEQP_PLAY_EVT; + alEvtqPostEvent(&seqp->evtq, &evt, 0); +} diff --git a/src/core1/done/audio/cspsetbank.c b/src/core1/done/audio/cspsetbank.c new file mode 100644 index 00000000..2170fdcb --- /dev/null +++ b/src/core1/done/audio/cspsetbank.c @@ -0,0 +1,13 @@ +#include +#include "functions.h" +#include "variables.h" + +void alCSPSetBank(ALCSPlayer *seqp, ALBank *b) +{ + ALEvent evt; + + evt.type = AL_SEQP_BANK_EVT; + evt.msg.spbank.bank = b; + + alEvtqPostEvent(&seqp->evtq, &evt, 0); +} diff --git a/src/core1/done/audio/cspsetseq.c b/src/core1/done/audio/cspsetseq.c new file mode 100644 index 00000000..09dc5c9e --- /dev/null +++ b/src/core1/done/audio/cspsetseq.c @@ -0,0 +1,11 @@ +#include + +void alCSPSetSeq(ALCSPlayer *seqp, ALCSeq *seq) +{ + ALEvent evt; + + evt.type = AL_SEQP_SEQ_EVT; + evt.msg.spseq.seq = seq; + + alEvtqPostEvent(&seqp->evtq, &evt, 0); +} diff --git a/src/core1/done/audio/cspsettempo.c b/src/core1/done/audio/cspsettempo.c new file mode 100644 index 00000000..cbee2a44 --- /dev/null +++ b/src/core1/done/audio/cspsettempo.c @@ -0,0 +1,17 @@ +#include +#include "functions.h" +#include "variables.h" + +void alCSPSetTempo(ALCSPlayer *seqp, s32 tempo) +{ + ALEvent evt; + + evt.type = AL_SEQP_META_EVT; + evt.msg.tempo.status = AL_MIDI_Meta; + evt.msg.tempo.type = AL_MIDI_META_TEMPO; + evt.msg.tempo.byte1 = (tempo & 0xff0000)>>16; + evt.msg.tempo.byte2 = (tempo & 0xff00)>>8; + evt.msg.tempo.byte3 = tempo & 0xff; + + alEvtqPostEvent(&seqp->evtq, &evt, 0); +} diff --git a/src/core1/done/audio/cspsetvol.c b/src/core1/done/audio/cspsetvol.c new file mode 100644 index 00000000..f937be63 --- /dev/null +++ b/src/core1/done/audio/cspsetvol.c @@ -0,0 +1,15 @@ +#include +#include "functions.h" +#include "variables.h" + + +void alCSPSetVol(ALCSPlayer *seqp, s16 vol) +{ + ALEvent evt; + + evt.type = AL_SEQP_VOL_EVT; + evt.msg.spvol.vol = vol; + + alEvtqPostEvent(&seqp->evtq, &evt, 0); +} + diff --git a/src/core1/done/audio/cspstop.c b/src/core1/done/audio/cspstop.c new file mode 100644 index 00000000..9f92c21e --- /dev/null +++ b/src/core1/done/audio/cspstop.c @@ -0,0 +1,10 @@ +#include + + +void alCSPStop(ALCSPlayer *seqp) +{ + ALEvent evt; + + evt.type = AL_SEQP_STOPPING_EVT; + alEvtqPostEvent(&seqp->evtq, &evt, 0); +} diff --git a/src/core1/done/audio/drvrNew.c b/src/core1/done/audio/drvrNew.c new file mode 100644 index 00000000..760e8922 --- /dev/null +++ b/src/core1/done/audio/drvrNew.c @@ -0,0 +1,280 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "synthInternals.h" + +/* + * WARNING: THE FOLLOWING CONSTANT MUST BE KEPT IN SYNC + * WITH SCALING IN MICROCODE!!! + */ +#define SCALE 16384 + +/* + * the following arrays contain default parameters for + * a few hopefully useful effects. + */ +#define ms *(((s32)((f32)44.1))&~0x7) + + +static s32 SMALLROOM_PARAMS[26] = { + /* sections length */ + 3, 100 ms, + /* chorus chorus filter + input output fbcoef ffcoef gain rate depth coef */ + 0, 54 ms, 9830, -9830, 0, 0, 0, 0, + 19 ms, 38 ms, 3276, -3276, 0x3fff, 0, 0, 0, + 0, 60 ms, 5000, 0, 0, 0, 0, 0x5000 +}; + +static s32 BIGROOM_PARAMS[34] = { + /* sections length */ + 4, 100 ms, + /* chorus chorus filter + input output fbcoef ffcoef gain rate depth coef */ + 0, 66 ms, 9830, -9830, 0, 0, 0, 0, + 22 ms, 54 ms, 3276, -3276, 0x3fff, 0, 0, 0, + 66 ms, 91 ms, 3276, -3276, 0x3fff, 0, 0, 0, + 0, 94 ms, 8000, 0, 0, 0, 0, 0x5000 +}; + +static s32 ECHO_PARAMS[10] = { + /* sections length */ + 1, 200 ms, + /* chorus chorus filter + input output fbcoef ffcoef gain rate depth coef */ + 0, 179 ms, 12000, 0, 0x7fff, 0, 0, 0 +}; + +static s32 CHORUS_PARAMS[10] = { + /* sections length */ + 1, 20 ms, + /* chorus chorus filter + input output fbcoef ffcoef gain rate depth coef */ + 0, 5 ms, 0x4000, 0, 0x7fff, 7600, 700, 0 +}; + +static s32 FLANGE_PARAMS[10] = { + /* sections length */ + 1, 20 ms, + /* chorus chorus filter + input output fbcoef ffcoef gain rate depth coef */ + 0, 5 ms, 0, 0x5fff, 0x7fff, 380, 500, 0 +}; + +static s32 NULL_PARAMS[10] = { + 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +void init_lpfilter(ALLowPass *lp) +{ + s32 i, temp; + s16 fc; + f64 ffc, fcoef; + + temp = lp->fc * SCALE; + fc = temp >> 15; + lp->fgain = SCALE - fc; + + lp->first = 1; + for (i=0; i<8; i++) + lp->fcvec.fccoef[i] = 0; + + lp->fcvec.fccoef[i++] = fc; + fcoef = ffc = (f64)fc/SCALE; + + for (; i<16; i++){ + fcoef *= ffc; + lp->fcvec.fccoef[i] = (s16)(fcoef * SCALE); + } +} + +void alFxNew(ALFx *r, ALSynConfig *c, ALHeap *hp) +{ + u16 i, j, k; + s32 *param = 0; + ALFilter *f = (ALFilter *) r; + ALDelay *d; + + alFilterNew(f, 0, alFxParam, AL_FX); + f->handler = alFxPull; + r->paramHdl = (ALSetFXParam)alFxParamHdl; + + switch (c->fxType) { + case AL_FX_SMALLROOM: param = SMALLROOM_PARAMS; break; + case AL_FX_BIGROOM: param = BIGROOM_PARAMS; break; + case AL_FX_ECHO: param = ECHO_PARAMS; break; + case AL_FX_CHORUS: param = CHORUS_PARAMS; break; + case AL_FX_FLANGE: param = FLANGE_PARAMS; break; + case AL_FX_CUSTOM: param = c->params; break; + default: param = NULL_PARAMS; break; + } + + + j = 0; + + r->section_count = param[j++]; + r->length = param[j++]; + + r->delay = alHeapAlloc(hp, r->section_count, sizeof(ALDelay)); + r->base = alHeapAlloc(hp, r->length, sizeof(s16)); + r->input = r->base; + + for ( k=0; k < r->length; k++) + r->base[k] = 0; + + for ( i=0; isection_count; i++ ){ + d = &r->delay[i]; + d->input = param[j++]; + d->output = param[j++]; + d->fbcoef = param[j++]; + d->ffcoef = param[j++]; + d->gain = param[j++]; + + if (param[j]) { +#define RANGE 2.0 +/* d->rsinc = ((f32) param[j++])/0xffffff; */ + d->rsinc = ((((f32)param[j++])/1000) * RANGE)/c->outputRate; + + /* + * the following constant is derived from: + * + * ratio = 2^(cents/1200) + * + * and therefore for hundredths of a cent + * x + * ln(ratio) = --------------- + * (120,000)/ln(2) + * where + * 120,000/ln(2) = 173123.40... + */ +#define CONVERT 173123.404906676 +#define LENGTH (d->output - d->input) + d->rsgain = (((f32) param[j++])/CONVERT) * LENGTH; + d->rsval = 1.0; + d->rsdelta = 0.0; + d->rs = alHeapAlloc(hp, 1, sizeof(ALResampler)); + d->rs->state = alHeapAlloc(hp, 1, sizeof(RESAMPLE_STATE)); + d->rs->delta = 0.0; + d->rs->first = 1; + } else { + d->rs = 0; + j++; + j++; + } + + if (param[j]) { + d->lp = alHeapAlloc(hp, 1, sizeof(ALLowPass)); + d->lp->fstate = alHeapAlloc(hp, 1, sizeof(POLEF_STATE)); + d->lp->fc = param[j++]; + init_lpfilter(d->lp); + } else { + d->lp = 0; + j++; + } + } +} + +void alEnvmixerNew(ALEnvMixer *e, ALHeap *hp) +{ + alFilterNew((ALFilter *) e, alEnvmixerPull, alEnvmixerParam, AL_ENVMIX); + + e->state = alHeapAlloc(hp, 1, sizeof(ENVMIX_STATE)); + + e->first = 1; + e->motion = AL_STOPPED; + e->volume = 1; + e->ltgt = 1; + e->rtgt = 1; + e->cvolL = 1; + e->cvolR = 1; + e->dryamt = 0; + e->wetamt = 0; + e->lratm = 1; + e->lratl = 0; + e->lratm = 1; + e->lratl = 0; + e->delta = 0; + e->segEnd = 0; + e->pan = 0; + e->ctrlList = 0; + e->ctrlTail = 0; + e->sources = 0; +} + +void alLoadNew(ALLoadFilter *f, ALDMANew dmaNew, ALHeap *hp) +{ + s32 + i; + + /* + * init filter superclass + */ + + alFilterNew((ALFilter *) f, alAdpcmPull, alLoadParam, AL_ADPCM); + + f->state = alHeapAlloc(hp, 1, sizeof(ADPCM_STATE)); + f->lstate = alHeapAlloc(hp, 1, sizeof(ADPCM_STATE)); + + f->dma = dmaNew(&f->dmaState); + + /* + * init the adpcm state + */ + f->lastsam = 0; + f->first = 1; + f->memin = 0; +} + +void alResampleNew(ALResampler *r, ALHeap *hp) +{ + alFilterNew((ALFilter *) r, alResamplePull, alResampleParam, AL_RESAMPLE); + + /* + * Init resampler state + */ + r->state = alHeapAlloc(hp, 1, sizeof(RESAMPLE_STATE)); + r->delta = 0.0; + r->first = 1; + r->motion = AL_STOPPED; + r->ratio = 1.0; + r->upitch = 0; + r->ctrlList = 0; + r->ctrlTail = 0; + + /* state in the ucode is initialized by the A_INIT flag */ +} + +void alAuxBusNew(ALAuxBus *m, void *sources, s32 maxSources) +{ + alFilterNew((ALFilter *) m, alAuxBusPull, alAuxBusParam, AL_AUXBUS); + m->sourceCount = 0; + m->maxSources = maxSources; + m->sources = (ALFilter **)sources; +} + +void alMainBusNew(ALMainBus *m, void *sources, s32 maxSources) +{ + alFilterNew((ALFilter *) m, alMainBusPull, alMainBusParam, AL_MAINBUS); + m->sourceCount = 0; + m->maxSources = maxSources; + m->sources = (ALFilter **)sources; +} + +void alSaveNew(ALSave *f) +{ + /* + * init filter superclass + */ + + alFilterNew((ALFilter *) f, alSavePull, alSaveParam, AL_SAVE); + + /* + * init the save state, which is a virtual dram address + */ + + f->dramout = 0; + f->first = 1; + +} diff --git a/src/core1/done/audio/env.c b/src/core1/done/audio/env.c new file mode 100644 index 00000000..07239b24 --- /dev/null +++ b/src/core1/done/audio/env.c @@ -0,0 +1,495 @@ +#include +#include "synthInternals.h" + +#ifndef assert +#define assert(s) +#endif + +#ifdef AUD_PROFILE +extern u32 cnt_index, env_num, env_cnt, env_max, env_min, lastCnt[]; +extern u32 rate_num, rate_cnt, rate_max, rate_min; +extern u32 vol_num, vol_cnt, vol_max, vol_min; +#endif + +#define EQPOWER_LENGTH 128 +static s16 eqpower[ EQPOWER_LENGTH ] = { + 32767, 32764, 32757, 32744, 32727, 32704, + 32677, 32644, 32607, 32564, 32517, 32464, + 32407, 32344, 32277, 32205, 32127, 32045, + 31958, 31866, 31770, 31668, 31561, 31450, + 31334, 31213, 31087, 30957, 30822, 30682, + 30537, 30388, 30234, 30075, 29912, 29744, + 29572, 29395, 29214, 29028, 28838, 28643, + 28444, 28241, 28033, 27821, 27605, 27385, + 27160, 26931, 26698, 26461, 26220, 25975, + 25726, 25473, 25216, 24956, 24691, 24423, + 24151, 23875, 23596, 23313, 23026, 22736, + 22442, 22145, 21845, 21541, 21234, 20924, + 20610, 20294, 19974, 19651, 19325, 18997, + 18665, 18331, 17993, 17653, 17310, 16965, + 16617, 16266, 15913, 15558, 15200, 14840, + 14477, 14113, 13746, 13377, 13006, 12633, + 12258, 11881, 11503, 11122, 10740, 10357, + 9971, 9584, 9196, 8806, 8415, 8023, + 7630, 7235, 6839, 6442, 6044, 5646, + 5246, 4845, 4444, 4042, 3640, 3237, + 2833, 2429, 2025, 1620, 1216, 810, + 405, 0 +}; + +extern f64 __pow(f64, f64); + +/* + * prototypes for private enveloper functions + */ +static Acmd *_pullSubFrame(void *filter, s16 *inp, s16 *outp, s32 outCount, + s32 sampleOffset, Acmd *p) ; +static s16 _getRate(f64 vol, f64 tgt, s32 count, u16* ratel); + +static f32 _getVol(f32 ivol, s32 samples, s16 ratem, u16 ratel); + +/*********************************************************************** + * Enveloper filter public interfaces + ***********************************************************************/ +Acmd *alEnvmixerPull(void *filter, s16 *outp, s32 outCount, s32 sampleOffset, + Acmd *p) +{ + Acmd *ptr = p; + ALEnvMixer *e = (ALEnvMixer *)filter; + s16 inp; + s32 lastOffset; + s32 thisOffset = sampleOffset; + s32 samples; + s16 loutp = 0; + s32 fVol; + ALParam *thisParam; + +#ifdef AUD_PROFILE + lastCnt[++cnt_index] = osGetCount(); +#endif + + /* + * Force the input to be the resampler output + */ + inp = AL_RESAMPLER_OUT; + + while (e->ctrlList != 0) { + + lastOffset = thisOffset; + thisOffset = e->ctrlList->delta; + samples = thisOffset - lastOffset; + if (samples > outCount) + break; + + assert(samples >= 0); + assert(samples <= AL_MAX_RSP_SAMPLES); + + switch (e->ctrlList->type) { + case (AL_FILTER_START_VOICE_ALT): + { + ALStartParamAlt *param = (ALStartParamAlt *)e->ctrlList; + ALFilter *f = (ALFilter *) e; + s32 tmp; + + if (param->unity) { + (*e->filter.setParam)(&e->filter, + AL_FILTER_SET_UNITY_PITCH, 0); + } + + (*e->filter.setParam)(&e->filter, AL_FILTER_SET_WAVETABLE, + param->wave); + (*e->filter.setParam)(&e->filter, AL_FILTER_START, 0); + + e->first = 1; + + e->delta = 0; + e->segEnd = param->samples; + tmp = ((s32)param->volume + (s32)param->volume) /2; + //tmp = ((s32)param->volume * (s32)param->volume) >> 15; + e->volume = (s16) tmp; + e->pan = param->pan; + e->dryamt = eqpower[param->fxMix]; + e->wetamt = eqpower[EQPOWER_LENGTH - param->fxMix - 1]; + + if (param->samples) { + e->cvolL = 1; + e->cvolR = 1; + } else { + /* + * Attack time is zero. Simply set the + * volume. We don't want an attack segment. + */ + e->cvolL = (e->volume * eqpower[e->pan]) >> 15; + e->cvolR = (e->volume * + eqpower[EQPOWER_LENGTH - e->pan - 1]) >> 15; + } + + if (f->source) { + union { + f32 f; + s32 i; + } data; + data.f = param->pitch; + (*f->source->setParam)(f->source, AL_FILTER_SET_PITCH, + (void *)data.i); + } + + } + + break; + + case (AL_FILTER_SET_FXAMT): + case (AL_FILTER_SET_PAN): + case (AL_FILTER_SET_VOLUME): + ptr = _pullSubFrame(e, &inp, &loutp, samples, sampleOffset, ptr); + e->delta += samples; + if (e->delta >= e->segEnd){ + /* + * We should have reached our target, calculate + * target in case e->segEnd was 0 + */ + e->ltgt = (e->volume * eqpower[e->pan]) >> 15; + e->rtgt = (e->volume * + eqpower[EQPOWER_LENGTH - e->pan - 1]) >> 15; + e->delta = e->segEnd; /* To prevent overflow */ + e->cvolL = e->ltgt; + e->cvolR = e->rtgt; + } else { + /* + * Estimate the current volume + */ + e->cvolL = _getVol(e->cvolL, e->delta, e->lratm, e->lratl); + e->cvolR = _getVol(e->cvolR, e->delta, e->rratm, e->rratl); + } + + /* + * We can't have volume of zero, because the envelope + * would never go anywhere from there + */ + if( e->cvolL == 0 ) e->cvolL = 1; + if( e->cvolR == 0 ) e->cvolR = 1; + + if (e->ctrlList->type == AL_FILTER_SET_PAN) + + /* + * This should result in a change to the current + * segment rate and target + */ + e->pan = (s16) e->ctrlList->data.i; + + if (e->ctrlList->type == AL_FILTER_SET_VOLUME){ + + /* + * Switching to a new segment + */ + e->delta = 0; + + /* + * Map volume non-linearly to give something close to + * loudness + */ + fVol = (e->ctrlList->data.i); + //fVol = (fVol*fVol)>>15; + fVol = (fVol+fVol)/2; + e->volume = (s16) fVol; + + e->segEnd = e->ctrlList->moredata.i; + + } + + if (e->ctrlList->type == AL_FILTER_SET_FXAMT){ + e->dryamt = eqpower[e->ctrlList->data.i]; + e->wetamt = eqpower[EQPOWER_LENGTH - e->ctrlList->data.i - 1]; + } + + /* + * Force a volume update + */ + e->first = 1; + break; + + case (AL_FILTER_START_VOICE): + { + ALStartParam *p = (ALStartParam *)e->ctrlList; + + /* + * Changing to PLAYING (since the previous state was + * persumable STOPPED, we'll just bump the output + * pointer rather than pull a subframe of zeros). + */ + if (p->unity) { + (*e->filter.setParam)(&e->filter, + AL_FILTER_SET_UNITY_PITCH, 0); + } + + (*e->filter.setParam)(&e->filter, AL_FILTER_SET_WAVETABLE, + p->wave); + (*e->filter.setParam)(&e->filter, AL_FILTER_START, 0); + } + break; + + case (AL_FILTER_STOP_VOICE): + { + /* + * Changing to STOPPED and reset the filter + */ + ptr = _pullSubFrame(e, &inp, &loutp, samples, sampleOffset, ptr); + (*e->filter.setParam)(&e->filter, AL_FILTER_RESET, 0); + } + break; + + case (AL_FILTER_FREE_VOICE): + { + ALSynth *drvr = &alGlobals->drvr; + ALFreeParam *param = (ALFreeParam *)e->ctrlList; + param->pvoice->offset = 0; + _freePVoice(drvr, (PVoice *)param->pvoice); + } + break; + + default: + /* + * Pull the reuired number of samples and then pass the message + * on down the chain + */ + ptr = _pullSubFrame(e, &inp, &loutp, samples, sampleOffset, ptr); + e->delta += samples; + (*e->filter.setParam)(&e->filter, e->ctrlList->type, + (void *) e->ctrlList->data.i); + break; + } + loutp += (samples<<1); + outCount -= samples; + + /* + * put the param record back on the free list + */ + thisParam = e->ctrlList; + e->ctrlList = e->ctrlList->next; + if (e->ctrlList == 0) + e->ctrlTail = 0; + + __freeParam(thisParam); + + } + + if(e->motion == 1){ + ptr = _pullSubFrame(e, &inp, &loutp, outCount, sampleOffset, ptr); + e->delta += outCount; + } + /* + * Prevent overflow in e->delta + */ + if (e->delta > e->segEnd) + e->delta = e->segEnd; + +#ifdef AUD_PROFILE + PROFILE_AUD(env_num, env_cnt, env_max, env_min); +#endif + return ptr; +} + +s32 +alEnvmixerParam(void *filter, s32 paramID, void *param) +{ + ALFilter *f = (ALFilter *) filter; + ALEnvMixer *e = (ALEnvMixer *) filter; + + switch (paramID) { + + case (AL_FILTER_ADD_UPDATE): + if (e->ctrlTail) { + e->ctrlTail->next = (ALParam *)param; + } else { + e->ctrlList = (ALParam *)param; + } + e->ctrlTail = (ALParam *)param; + + break; + + case (AL_FILTER_RESET): + e->first = 1; + e->motion = AL_STOPPED; + e->volume = 1; + if (f->source) + (*f->source->setParam)(f->source, AL_FILTER_RESET, param); + break; + + case (AL_FILTER_START): + e->motion = AL_PLAYING; + if (f->source) + (*f->source->setParam)(f->source, AL_FILTER_START, param); + break; + + case (AL_FILTER_SET_SOURCE): + f->source = (ALFilter *) param; + break; + + default: + if (f->source) + (*f->source->setParam)(f->source, paramID, param); + } + return 0; +} + +static +Acmd* _pullSubFrame(void *filter, s16 *inp, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p) +{ + Acmd *ptr = p; + ALEnvMixer *e = (ALEnvMixer *)filter; + ALFilter *source= e->filter.source; + + /* filter must be playing and request non-zero output samples to pull. */ + //if (e->motion != AL_PLAYING || !outCount) + // return ptr; + + if(!outCount) + return ptr; + /* + * ask all filters upstream from us to build their command + * lists. + */ + assert(source); + + ptr = (*source->handler)(source, inp, outCount, sampleOffset, p); + + /* + * construct our portion of the command list + */ + aSetBuffer(ptr++, A_MAIN, *inp, AL_MAIN_L_OUT + *outp, outCount<<1); + aSetBuffer(ptr++, A_AUX, AL_MAIN_R_OUT + *outp, AL_AUX_L_OUT + *outp, + AL_AUX_R_OUT + *outp); + + if (e->first){ + e->first = 0; + + /* + * Calculate derived parameters + */ + e->ltgt = (e->volume * eqpower[e->pan]) >> 15; + e->lratm = _getRate((f64)e->cvolL, (f64)e->ltgt, + e->segEnd, &(e->lratl)); + e->rtgt = (e->volume * + eqpower[EQPOWER_LENGTH - e->pan - 1]) >> 15; + e->rratm = _getRate((f64)e->cvolR, (f64)e->rtgt, e->segEnd, + &(e->rratl)); + + aSetVolume(ptr++, A_LEFT | A_VOL, e->cvolL, 0, 0); + aSetVolume(ptr++, A_RIGHT | A_VOL, e->cvolR, 0, 0); + aSetVolume(ptr++, A_LEFT | A_RATE, e->ltgt, e->lratm, e->lratl); + aSetVolume(ptr++, A_RIGHT | A_RATE, e->rtgt, e->rratm, e->rratl); + aSetVolume(ptr++, A_AUX, e->dryamt, 0, e->wetamt); + aEnvMixer (ptr++, A_INIT | A_AUX, osVirtualToPhysical(e->state)); + } + else + aEnvMixer(ptr++, A_CONTINUE | A_AUX, osVirtualToPhysical(e->state)); + + /* + * bump the input buffer pointer + */ + + *inp += (outCount<<1); + //e->delta += outCount; + + return ptr; +} + +#define EXP_MASK 0x7f800000 +#define MANT_MASK 0x807fffff + +f64 +_frexpf(f64 value, s32 *eptr) +{ + f64 absvalue; + + *eptr = 0; + if (value == 0.0) /* nothing to do for zero */ + return (value); + absvalue = (value > 0.0) ? value : -value; + for ( ; absvalue >= 1.0; absvalue *= 0.5) + ++*eptr; + for ( ; absvalue < 0.5; absvalue += absvalue) + --*eptr; + return (value > 0.0 ? absvalue : -absvalue); +} + +f64 +_ldexpf(f64 in, s32 ex) +{ + s32 exp; + + if ( ex ) { + exp = 1 << ex; + in *= (f64)exp; + } + + return ( in ); +} + +/* + _getRate() -- This function determines how to go from the + current volume level (vol) to the target + volume level (tgt) in some number of steps + (count). Two values are returned that are + used as multipliers to incrementally scale + the volume. Some tricky math is used and + is explained below. + RWW 28jun95 +*/ + +static +s16 _getRate(f64 vol, f64 tgt, s32 count, u16* ratel) +{ + s16 s; + f64 a; + + + #ifdef AUD_PROFILE + lastCnt[++cnt_index] = osGetCount(); + #endif + + if (count == 0){ + if (tgt >= vol){ + *ratel = 0xffff; + return 0x7fff; + } + else{ + *ratel = 0; + return -0x8000; + } + } + + a = ((tgt - vol)/(f32)count) * 8.0; + if(a < 0.0) + a = a - 1.0; + s = (s16) a; + *ratel = (s16)(0xffff * (a - (f32) s)); + +#ifdef AUD_PROFILE + PROFILE_AUD(rate_num, rate_cnt, rate_max, rate_min); +#endif + return (s16)a; + +} + +static +f32 _getVol(f32 ivol, s32 samples, s16 ratem, u16 ratel) +{ + f32 r; + +#ifdef AUD_PROFILE + lastCnt[++cnt_index] = osGetCount(); +#endif + + + r = ((f32) (ratem<<16) + (f32) ratel)/65536.0; + + ivol += r* samples * 0.125; +#ifdef AUD_PROFILE + PROFILE_AUD(vol_num, vol_cnt, vol_max, vol_min); +#endif + + + return ivol; +} + diff --git a/src/core1/done/audio/event.c b/src/core1/done/audio/event.c new file mode 100644 index 00000000..cd14ecf6 --- /dev/null +++ b/src/core1/done/audio/event.c @@ -0,0 +1,137 @@ +#include +#include "functions.h" +#include "variables.h" + +void alEvtqNew(ALEventQueue *evtq, ALEventListItem *items, s32 itemCount) +{ + s32 i; + + evtq->eventCount = 0; + evtq->allocList.next = 0; + evtq->allocList.prev = 0; + evtq->freeList.next = 0; + evtq->freeList.prev = 0; + if(itemCount > 0){ + i = 0; + do{ + alLink(&items[i].node, &evtq->freeList); + i++; + } while (i != itemCount); + } +} + +ALMicroTime alEvtqNextEvent(ALEventQueue *evtq, ALEvent *evt) +{ + ALEventListItem *item; + ALMicroTime delta; + OSIntMask mask; + + mask = osSetIntMask(OS_IM_NONE); + + item = (ALEventListItem *)evtq->allocList.next; + + if (item) + { + alUnlink((ALLink *)item); + alCopy(&item->evt, evt, sizeof(*evt)); + alLink((ALLink *)item, &evtq->freeList); + delta = item->delta; + } + else + { + /* sct 11/28/95 - If we get here, most like we overflowed the event queue */ + /* with non-self-perpetuating events. Eg. if we filled the evtq with volume */ + /* events, then when the seqp is told to play it will handle all the events */ + /* at once completely emptying out the queue. At this point this problem */ + /* must be treated as an out of resource error and the evtq should be increased. */ + evt->type = -1; + delta = 0; + } + + osSetIntMask(mask); + + return delta; +} + +void alEvtqPostEvent(ALEventQueue *evtq, ALEvent *evt, ALMicroTime delta) +{ + ALEventListItem *item; + ALEventListItem *nextItem; + ALLink *node; + s32 postAtEnd=0; + OSIntMask mask; + + mask = osSetIntMask(OS_IM_NONE); + + + item = (ALEventListItem *)evtq->freeList.next; + if (!item) { + osSetIntMask(mask); + return; + } + + alUnlink(&item->node); + alCopy(evt, &item->evt, sizeof(item->evt)); + + if (delta == AL_EVTQ_END) + postAtEnd = -1; + + for (node = &evtq->allocList; node != 0; node = node->next) { + if (!node->next) { /* end of the list */ + if (postAtEnd) + item->delta = 0; + else + item->delta = delta; + alLink(&item->node, node); + break; + } else { + nextItem = (ALEventListItem *)node->next; + + if (delta < nextItem->delta) { + item->delta = delta; + nextItem->delta -= delta; + + alLink(&item->node, node); + break; + } + + delta -= nextItem->delta; + + } + } + + osSetIntMask(mask); + +} + + + +void alEvtqFlushType(ALEventQueue *evtq, s16 type) +{ + ALLink *thisNode; + ALLink *nextNode; + ALEventListItem *thisItem, *nextItem; + OSIntMask mask; + + mask = osSetIntMask(OS_IM_NONE); + + thisNode = evtq->allocList.next; + while( thisNode != 0 ) + { + nextNode = thisNode->next; + thisItem = (ALEventListItem *)thisNode; + nextItem = (ALEventListItem *)nextNode; + if (thisItem->evt.type == type) + { + if (nextItem) + nextItem->delta += thisItem->delta; + alUnlink(thisNode); + alLink(thisNode, &evtq->freeList); + } + thisNode = nextNode; + } + + osSetIntMask(mask); +} + + diff --git a/src/core1/done/audio/filter.c b/src/core1/done/audio/filter.c new file mode 100644 index 00000000..e6f2ce89 --- /dev/null +++ b/src/core1/done/audio/filter.c @@ -0,0 +1,12 @@ +#include +#include "synthInternals.h" + +void alFilterNew(ALFilter *f, ALCmdHandler h, ALSetParam s, s32 type) +{ + f->source = 0; + f->handler = h; + f->setParam = s; + f->inp = 0; + f->outp = 0; + f->type = type; +} diff --git a/src/core1/done/audio/heapalloc.c b/src/core1/done/audio/heapalloc.c new file mode 100644 index 00000000..084c1544 --- /dev/null +++ b/src/core1/done/audio/heapalloc.c @@ -0,0 +1,43 @@ +#include +#include "synthInternals.h" + +void *alHeapDBAlloc(u8 *file, s32 line, ALHeap *hp, s32 num, s32 size) +{ + s32 bytes; + u8 *ptr = 0; + + bytes = (num*size + AL_CACHE_ALIGN) & ~AL_CACHE_ALIGN; + +#ifdef _DEBUG + hp->count++; + bytes += sizeof(HeapInfo); +#endif + + if ((hp->cur + bytes) <= (hp->base + hp->len)) { + + ptr = hp->cur; + hp->cur += bytes; + +#ifdef _DEBUG + ((HeapInfo *)ptr)->magic = AL_HEAP_MAGIC; + ((HeapInfo *)ptr)->size = bytes; + ((HeapInfo *)ptr)->count = hp->count; + if (file) { + ((HeapInfo *)ptr)->file = file; + ((HeapInfo *)ptr)->line = line; + } else { + ((HeapInfo *)ptr)->file = (u8 *) "unknown"; + ((HeapInfo *)ptr)->line = 0; + } + + ptr += sizeof(HeapInfo); +#endif + + } else { +#ifdef _DEBUG + __osError(ERR_ALHEAPNOFREE, 1, size); +#endif + } + + return ptr; +} diff --git a/src/core1/done/audio/heapinit.c b/src/core1/done/audio/heapinit.c new file mode 100644 index 00000000..2116d62e --- /dev/null +++ b/src/core1/done/audio/heapinit.c @@ -0,0 +1,16 @@ +#include "synthInternals.h" +#include + +void alHeapInit(ALHeap *hp, u8 *base, s32 len) +{ + s32 extraAlign = (AL_CACHE_ALIGN+1) - ((s32) base & AL_CACHE_ALIGN); + + if (extraAlign != AL_CACHE_ALIGN+1) + hp->base = base + extraAlign; + else + hp->base = base; + + hp->len = len; + hp->cur = hp->base; + hp->count = 0; +} diff --git a/src/core1/done/audio/load.c b/src/core1/done/audio/load.c new file mode 100644 index 00000000..0c9c578d --- /dev/null +++ b/src/core1/done/audio/load.c @@ -0,0 +1,446 @@ +#include +#include "synthInternals.h" + +#ifndef MIN +# define MIN(a,b) (((a)<(b))?(a):(b)) +#endif + +#ifdef AUD_PROFILE +extern u32 cnt_index, adpcm_num, adpcm_cnt, adpcm_max, adpcm_min, lastCnt[]; +#endif + +#define ADPCMFBYTES 9 +#define LFSAMPLES 4 + +static +Acmd *_decodeChunk(Acmd *ptr, ALLoadFilter *f, s32 tsam, s32 nbytes, s16 outp, s16 inp, u32 flags); + +Acmd *alAdpcmPull(void *filter, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p) +{ + Acmd *ptr = p; + s16 inp; + s32 tsam; + s32 nframes; + s32 nbytes; + s32 overFlow; + s32 startZero; + s32 nOver; + s32 nSam; + s32 op; + s32 nLeft; + s32 bEnd; + s32 decoded = 0; + s32 looped = 0; + + ALLoadFilter *f = (ALLoadFilter *)filter; + +#ifdef AUD_PROFILE + lastCnt[++cnt_index] = osGetCount(); +#endif + + if (outCount == 0) + return ptr; + + inp = AL_DECODER_IN; + aLoadADPCM(ptr++, f->bookSize, + K0_TO_PHYS(f->table->waveInfo.adpcmWave.book->book)); + + looped = (outCount + f->sample > f->loop.end) && (f->loop.count != 0); + if (looped) + nSam = f->loop.end - f->sample; + else + nSam = outCount; + + if (f->lastsam) + nLeft = ADPCMFSIZE - f->lastsam; + else + nLeft = 0; + tsam = nSam - nLeft; + if (tsam<0) tsam = 0; + + nframes = (tsam+ADPCMFSIZE-1)>>LFSAMPLES; + nbytes = nframes*ADPCMFBYTES; + + if (looped){ + + ptr = _decodeChunk(ptr, f, tsam, nbytes, *outp, inp, f->first); + + /* + * Fix up output pointer, which will be used as the input pointer + * by the following module. + */ + if (f->lastsam) + *outp += (f->lastsam<<1); + else + *outp += (ADPCMFSIZE<<1); + + /* + * Now fix up state info to reflect the loop start point + */ + f->lastsam = f->loop.start &0xf; + f->memin = (s32) f->table->base + ADPCMFBYTES * + ((s32) (f->loop.start>>LFSAMPLES) + 1); + f->sample = f->loop.start; + + bEnd = *outp; + while (outCount > nSam){ + + outCount -= nSam; + + /* + * Put next one after the end of the last lot - on the + * frame boundary (32 byte) after the end. + */ + op = (bEnd + ((nframes+1)<<(LFSAMPLES+1))) & ~0x1f; + + /* + * The actual end of data + */ + bEnd += (nSam<<1); + + /* + * -1 is loop forever - the loop count is not exact now + * for small loops! + */ + if ((f->loop.count != -1) && (f->loop.count != 0)) + f->loop.count--; + + /* + * What's left to compute. + */ + nSam = MIN(outCount, f->loop.end - f->loop.start); + tsam = nSam - ADPCMFSIZE + f->lastsam; + if (tsam<0) tsam = 0; + nframes = (tsam+ADPCMFSIZE-1)>>LFSAMPLES; + nbytes = nframes*ADPCMFBYTES; + ptr = _decodeChunk(ptr, f, tsam, nbytes, op, inp, f->first | A_LOOP); + /* + * Merge the two sections in DMEM. + */ + aDMEMMove(ptr++, op+(f->lastsam<<1), bEnd, nSam<<1); + + } + + f->lastsam = (outCount + f->lastsam) & 0xf; + f->sample += outCount; + f->memin += ADPCMFBYTES*nframes; +#ifdef AUD_PROFILE + PROFILE_AUD(adpcm_num, adpcm_cnt, adpcm_max, adpcm_min); +#endif + return ptr; + } + + /* + * The unlooped case, which is executed most of the time + */ + + nSam = nframes<memin + nbytes - ((s32) f->table->base + f->table->len); + if (overFlow < 0) + overFlow = 0; + nOver = (overFlow/ADPCMFBYTES)< nSam + nLeft) + nOver = nSam + nLeft; + + nbytes -= overFlow; + + if ((nOver - (nOver & 0xf))< outCount){ + decoded = 1; + ptr = _decodeChunk(ptr, f, nSam - nOver, nbytes, *outp, inp, f->first); + + if (f->lastsam) + *outp += (f->lastsam<<1); + else + *outp += (ADPCMFSIZE<<1); + + f->lastsam = (outCount + f->lastsam) & 0xf; + f->sample += outCount; + f->memin += ADPCMFBYTES*nframes; + } else { + f->lastsam = 0; + f->memin += ADPCMFBYTES*nframes; + } + + /* + * Put zeros in if necessary + */ + if (nOver){ + f->lastsam = 0; + if (decoded) + startZero = (nLeft + nSam - nOver)<<1; + else + startZero = 0; + aClearBuffer(ptr++, startZero + *outp, nOver<<1); + } +#ifdef AUD_PROFILE + PROFILE_AUD(adpcm_num, adpcm_cnt, adpcm_max, adpcm_min); +#endif + + return ptr; +} + +Acmd *alRaw16Pull(void *filter, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p) +{ + Acmd *ptr = p; + s32 nbytes; + s32 dramLoc; + s32 dramAlign; + s32 dmemAlign; + s32 overFlow; + s32 startZero; + s32 nSam; + s32 op; + + ALLoadFilter *f = (ALLoadFilter *)filter; + ALFilter *a = (ALFilter *) filter; + + if (outCount == 0) + return ptr; + + if ((outCount + f->sample > f->loop.end) && (f->loop.count != 0)){ + + nSam = f->loop.end - f->sample; + nbytes = nSam<<1; + if (nSam > 0){ + dramLoc = (f->dma)(f->memin, nbytes, f->dmaState); + + /* + * Make sure enough is loaded into DMEM to take care + * of 8 byte alignment + */ + dramAlign = dramLoc & 0x7; + nbytes += dramAlign; + aSetBuffer(ptr++, 0, *outp, 0, nbytes + 8 - (nbytes & 0x7)); + aLoadBuffer(ptr++, dramLoc - dramAlign); + } else + dramAlign = 0; + + /* + * Fix up output pointer to allow for dram alignment + */ + *outp += dramAlign; + + f->memin = (s32) f->table->base + (f->loop.start<<1); + f->sample = f->loop.start; + op = *outp; + + while (outCount > nSam){ + + op += (nSam<<1); + outCount -= nSam; + /* + * -1 is loop forever + */ + if ((f->loop.count != -1) && (f->loop.count != 0)) + f->loop.count--; + + /* + * What to compute. + */ + nSam = MIN(outCount, f->loop.end - f->loop.start); + nbytes = nSam<<1; + + /* + * Do the next section, same as last. + */ + dramLoc = (f->dma)(f->memin, nbytes, f->dmaState); + + /* + * Make sure enough is loaded into DMEM to take care + * of 8 byte alignment + */ + dramAlign = dramLoc & 0x7; + nbytes += dramAlign; + if (op & 0x7) + dmemAlign = 8 - (op & 0x7); + else + dmemAlign = 0; + + aSetBuffer(ptr++, 0, op + dmemAlign, 0, nbytes + 8 - (nbytes & 0x7)); + aLoadBuffer(ptr++, dramLoc - dramAlign); + + /* + * Merge the two sections in DMEM. + */ + if (dramAlign || dmemAlign) + aDMEMMove(ptr++, op+dramAlign+dmemAlign, op, nSam<<1); + + } + + f->sample += outCount; + f->memin += (outCount<<1); + + return ptr; + } + + /* + * The unlooped case, which is executed most of the time + * + * overFlow is the number of bytes past the end + * of the bitstream I try to generate + */ + + nbytes = outCount<<1; + overFlow = f->memin + nbytes - ((s32) f->table->base + f->table->len); + if (overFlow < 0) + overFlow = 0; + if (overFlow > nbytes) + overFlow = nbytes; + + if (overFlow < nbytes){ + if (outCount > 0){ + nbytes -= overFlow; + dramLoc = (f->dma)(f->memin, nbytes, f->dmaState); + + /* + * Make sure enough is loaded into DMEM to take care + * of 8 byte alignment + */ + dramAlign = dramLoc & 0x7; + nbytes += dramAlign; + aSetBuffer(ptr++, 0, *outp, 0, nbytes + 8 - (nbytes & 0x7)); + aLoadBuffer(ptr++, dramLoc - dramAlign); + } else + dramAlign = 0; + *outp += dramAlign; + + f->sample += outCount; + f->memin += outCount<<1; + } else { + f->memin += outCount<<1; + } + + /* + * Put zeros in if necessary + */ + if (overFlow){ + startZero = (outCount<<1) - overFlow; + if (startZero < 0) + startZero = 0; + aClearBuffer(ptr++, startZero + *outp, overFlow); + } + return ptr; +} + + +s32 +alLoadParam(void *filter, s32 paramID, void *param) +{ + ALLoadFilter *a = (ALLoadFilter *) filter; + ALFilter *f = (ALFilter *) filter; + + switch (paramID) { + case (AL_FILTER_SET_WAVETABLE): + a->table = (ALWaveTable *) param; + a->memin = (s32) a->table->base; + a->sample = 0; + switch (a->table->type){ + case (AL_ADPCM_WAVE): + + /* + * Set up the correct handler + */ + f->handler = alAdpcmPull; + + /* + * Make sure the table length is an integer number of + * frames + */ + a->table->len = ADPCMFBYTES * + ((s32) (a->table->len/ADPCMFBYTES)); + + a->bookSize = 2*a->table->waveInfo.adpcmWave.book->order* + a->table->waveInfo.adpcmWave.book->npredictors*ADPCMVSIZE; + if (a->table->waveInfo.adpcmWave.loop) { + a->loop.start = a->table->waveInfo.adpcmWave.loop->start; + a->loop.end = a->table->waveInfo.adpcmWave.loop->end; + a->loop.count = a->table->waveInfo.adpcmWave.loop->count; + alCopy(a->table->waveInfo.adpcmWave.loop->state, + a->lstate, sizeof(ADPCM_STATE)); + } else { + a->loop.start = a->loop.end = a->loop.count = 0; + } + break; + + case (AL_RAW16_WAVE): + f->handler = alRaw16Pull; + if (a->table->waveInfo.rawWave.loop) { + a->loop.start = a->table->waveInfo.rawWave.loop->start; + a->loop.end = a->table->waveInfo.rawWave.loop->end; + a->loop.count = a->table->waveInfo.rawWave.loop->count; + } else { + a->loop.start = a->loop.end = a->loop.count = 0; + } + break; + + default: + break; + + } + break; + + case (AL_FILTER_RESET): + a->lastsam = 0; + a->first = 1; + a->sample = 0; + + /* sct 2/14/96 - Check table since it is initialized to null and */ + /* Get loop info according to table type. */ + if (a->table) + { + a->memin = (s32) a->table->base; + if (a->table->type == AL_ADPCM_WAVE) + { + if (a->table->waveInfo.adpcmWave.loop) + a->loop.count = a->table->waveInfo.adpcmWave.loop->count; + } + else if (a->table->type == AL_RAW16_WAVE) + { + if (a->table->waveInfo.rawWave.loop) + a->loop.count = a->table->waveInfo.rawWave.loop->count; + } + } + + break; + + default: + break; + } +} + +Acmd *_decodeChunk(Acmd *ptr, ALLoadFilter *f, s32 tsam, s32 nbytes, s16 outp, s16 inp, u32 flags) + +{ + + s32 + dramAlign, + dramLoc; + + if (nbytes > 0){ + dramLoc = (f->dma)(f->memin, nbytes, f->dmaState); + /* + * Make sure enough is loaded into DMEM to take care + * of 8 byte alignment + */ + dramAlign = dramLoc & 0x7; + nbytes += dramAlign; + aSetBuffer(ptr++, 0, inp, 0, nbytes + 8 - (nbytes & 0x7)); + aLoadBuffer(ptr++, dramLoc - dramAlign); + } else + dramAlign = 0; + + if (flags & A_LOOP){ + aSetLoop(ptr++, K0_TO_PHYS(f->lstate)); + } + + aSetBuffer(ptr++, 0, inp + dramAlign, outp, tsam<<1); + aADPCMdec(ptr++, flags, K0_TO_PHYS(f->state)); + f->first = 0; + + return ptr; +} diff --git a/src/core1/done/audio/mainbus.c b/src/core1/done/audio/mainbus.c new file mode 100644 index 00000000..ad18c2e4 --- /dev/null +++ b/src/core1/done/audio/mainbus.c @@ -0,0 +1,46 @@ +#include +#include "synthInternals.h" + +Acmd *alMainBusPull(void *filter, s16 *outp, s32 outCount, s32 sampleOffset, Acmd *p) +{ + Acmd *ptr = p; + ALMainBus *m = (ALMainBus *)filter; + ALFilter **sources = m->sources; + s32 i; + + /* + * clear the output buffers here + */ + aClearBuffer(ptr++, AL_MAIN_L_OUT, outCount<<1); + aClearBuffer(ptr++, AL_MAIN_R_OUT, outCount<<1); + + for (i = 0; i < m->sourceCount; i++) { + ptr = (sources[i]->handler)(sources[i], outp, outCount, sampleOffset, + ptr); + aSetBuffer(ptr++, 0, 0, 0, outCount<<1); + aMix(ptr++, 0, 0x7fff, AL_AUX_L_OUT, AL_MAIN_L_OUT); + aMix(ptr++, 0, 0x7fff, AL_AUX_R_OUT, AL_MAIN_R_OUT); + } + + return ptr; +} + +s32 alMainBusParam(void *filter, s32 paramID, void *param) +{ + ALMainBus *m = (ALMainBus *) filter; + ALFilter **sources = m->sources; + + switch (paramID) { + + case (AL_FILTER_ADD_SOURCE): + sources[m->sourceCount++] = (ALFilter *) param; + break; + + default: + /* ??? */ + break; + } + + return 0; + +} diff --git a/src/core1/done/audio/n_auxbus.c b/src/core1/done/audio/n_auxbus.c new file mode 100644 index 00000000..ca779c14 --- /dev/null +++ b/src/core1/done/audio/n_auxbus.c @@ -0,0 +1,23 @@ +#include +#include "functions.h" +#include "variables.h" +#include "n_synth.h" + +Acmd *n_alAuxBusPull(s32 sampleOffset, Acmd *p) +{ + Acmd *ptr = p; + N_ALAuxBus *m = (N_ALAuxBus *)n_syn->auxBus; + N_PVoice **sources = m->sources; + s32 i; + +#ifndef N_MICRO + aClearBuffer(ptr++, AL_AUX_L_OUT, FIXED_SAMPLE<<1); + aClearBuffer(ptr++, AL_AUX_R_OUT, FIXED_SAMPLE<<1); +#else + aClearBuffer(ptr++, N_AL_AUX_L_OUT, N_AL_DIVIDED<<1); +#endif + + for (i = 0; i < m->sourceCount; i++) + ptr = n_alEnvmixerPull(sources[i],sampleOffset,ptr); + return ptr; +} diff --git a/src/core1/done/audio/n_csplayer.c b/src/core1/done/audio/n_csplayer.c new file mode 100644 index 00000000..06940386 --- /dev/null +++ b/src/core1/done/audio/n_csplayer.c @@ -0,0 +1,870 @@ +#include +#include "n_synth.h" +#include + +#include "seqp.h" +#include "n_cseqp.h" +#include "cseq.h" + +#ifndef assert +#define assert(s) +#endif + +static ALMicroTime __n_CSPVoiceHandler(void *node); +static void __n_CSPHandleNextSeqEvent(N_ALCSPlayer *seqp); +static void __n_CSPHandleMIDIMsg(N_ALCSPlayer *seqp, N_ALEvent *event); +static void __n_CSPHandleMetaMsg(N_ALCSPlayer *seqp, N_ALEvent *event); +static void __n_CSPRepostEvent(ALEventQueue *evtq, N_ALEventListItem *item); +static void __n_setUsptFromTempo(N_ALCSPlayer *seqp, ALCSeq *target, f32 tempo); /* sct 1/8/96 */ + + +/* + * Sequence Player public functions + */ +/*done*/ +void n_alCSPNew(N_ALCSPlayer *seqp, ALSeqpConfig *c) +{ + s32 i; + N_ALEventListItem *items; + N_ALVoiceState *vs; + N_ALVoiceState *voices; + + ALHeap *hp = c->heap; + + /* + * initialize member variables + */ + seqp->bank = 0; + seqp->target = NULL; + seqp->drvr = n_syn; + seqp->chanMask = 0xffff; + seqp->uspt = 488; + seqp->nextDelta = 0; + seqp->state = AL_STOPPED; + seqp->vol = 0x7FFF; /* full volume */ + seqp->debugFlags = c->debugFlags; + seqp->frameTime = AL_USEC_PER_FRAME; /* should get this from driver */ + seqp->curTime = 0; + seqp->initOsc = c->initOsc; + seqp->updateOsc = c->updateOsc; + seqp->stopOsc = c->stopOsc; + + seqp->nextEvent.type = AL_SEQP_API_EVT; /* this will start the voice handler "spinning" */ + + /* + * init the channel state + */ + seqp->maxChannels = c->maxChannels; + seqp->chanState = alHeapAlloc(hp, c->maxChannels, sizeof(ALChanState) ); + __initChanState((ALSeqPlayer*)seqp); /* sct 11/6/95 */ + + /* + * init the voice state array + */ + voices = alHeapAlloc(hp, c->maxVoices, sizeof(ALVoiceState)); + seqp->vFreeList = 0; + for (i = 0; i < c->maxVoices; i++) { + vs = &voices[i]; + vs->next = seqp->vFreeList; + seqp->vFreeList = vs; + } + + seqp->vAllocHead = 0; + seqp->vAllocTail = 0; + + /* + * init the event queue + */ + items = alHeapAlloc(hp, c->maxEvents, sizeof(ALEventListItem)); + alEvtqNew(&seqp->evtq, items, c->maxEvents); + + + /* + * add ourselves to the driver + */ + seqp->node.next = NULL; + seqp->node.handler = __n_CSPVoiceHandler; + seqp->node.clientData = seqp; + n_alSynAddSeqPlayer(&seqp->node); +} + +/************************************************************* + * private routines or driver callback routines + *************************************************************/ +static ALMicroTime __n_CSPVoiceHandler(void *node) +{ + N_ALCSPlayer *seqp = (N_ALCSPlayer *) node; + N_ALEvent evt; + ALVoice *voice; + ALMicroTime delta; + ALVoiceState *vs; + void *oscState; + f32 oscValue; + u8 chan; + do { + switch (seqp->nextEvent.type) + { + case (AL_SEQ_REF_EVT): + __n_CSPHandleNextSeqEvent(seqp); + break; + + case (AL_SEQP_API_EVT): + evt.type = AL_SEQP_API_EVT; + alEvtqPostEvent(&seqp->evtq, (ALEvent *)&evt, seqp->frameTime); + break; + + case (AL_NOTE_END_EVT): + voice = seqp->nextEvent.msg.note.voice; + + n_alSynStopVoice(voice); + n_alSynFreeVoice(voice); + vs = (ALVoiceState *)voice->clientPrivate; + if(vs->flags) + __seqpStopOsc((ALSeqPlayer*)seqp,vs); + __unmapVoice((ALSeqPlayer*)seqp, voice); + break; + + case (AL_SEQP_ENV_EVT): + voice = seqp->nextEvent.msg.vol.voice; + vs = (ALVoiceState *)voice->clientPrivate; + + if(vs->envPhase == AL_PHASE_ATTACK) + vs->envPhase = AL_PHASE_DECAY; + + delta = seqp->nextEvent.msg.vol.delta; + vs->envEndTime = seqp->curTime + delta; + vs->envGain = seqp->nextEvent.msg.vol.vol; + n_alSynSetVol(voice, __vsVol(vs, (ALSeqPlayer*)seqp), delta); + break; + + case (AL_TREM_OSC_EVT): + vs = seqp->nextEvent.msg.osc.vs; + oscState = seqp->nextEvent.msg.osc.oscState; + delta = (*seqp->updateOsc)(oscState,&oscValue); + vs->tremelo = (u8)oscValue; + n_alSynSetVol(&vs->voice, __vsVol(vs,(ALSeqPlayer*)seqp), + __vsDelta(vs,seqp->curTime)); + evt.type = AL_TREM_OSC_EVT; + evt.msg.osc.vs = vs; + evt.msg.osc.oscState = oscState; + alEvtqPostEvent(&seqp->evtq, &evt, delta); + break; + + case (AL_VIB_OSC_EVT): + vs = seqp->nextEvent.msg.osc.vs; + oscState = seqp->nextEvent.msg.osc.oscState; + chan = seqp->nextEvent.msg.osc.chan; + delta = (*seqp->updateOsc)(oscState,&oscValue); + vs->vibrato = oscValue; + n_alSynSetPitch(&vs->voice, vs->pitch * vs->vibrato + * seqp->chanState[chan].pitchBend); + evt.type = AL_VIB_OSC_EVT; + evt.msg.osc.vs = vs; + evt.msg.osc.oscState = oscState; + evt.msg.osc.chan = chan; + alEvtqPostEvent(&seqp->evtq, &evt, delta); + break; + + case (AL_SEQP_MIDI_EVT): + case (AL_CSP_NOTEOFF_EVT): /* nextEvent is a note off midi message */ + __n_CSPHandleMIDIMsg(seqp, &seqp->nextEvent); + break; + + case (AL_SEQP_META_EVT): + __n_CSPHandleMetaMsg(seqp, &seqp->nextEvent); + break; + + case (AL_SEQP_VOL_EVT): + seqp->vol = seqp->nextEvent.msg.spvol.vol; + for (vs = seqp->vAllocHead; vs != 0; vs = vs->next) + { + n_alSynSetVol(&vs->voice, + __vsVol(vs, (ALSeqPlayer*)seqp), + __vsDelta(vs, seqp->curTime)); + } + break; + + case (AL_SEQP_PLAY_EVT): + if (seqp->state != AL_PLAYING) + { + seqp->state = AL_PLAYING; + func_80250650(); + __n_CSPPostNextSeqEvent(seqp); /* seqp must be AL_PLAYING before we call this routine. */ + } + break; + + case (AL_SEQP_STOP_EVT): + if ( seqp->state == AL_STOPPING ) + { + for (vs = seqp->vAllocHead; vs != 0; vs = seqp->vAllocHead) + { + #ifdef _DEBUG + __osError(ERR_ALCSPVNOTFREE, 2, vs->channel, vs->key); + #endif + n_alSynStopVoice(&vs->voice); + n_alSynFreeVoice(&vs->voice); + if(vs->flags) + __seqpStopOsc((ALSeqPlayer*)seqp,vs); + __unmapVoice((ALSeqPlayer*)seqp, &vs->voice); + } + seqp->state = AL_STOPPED; + + /* alEvtqFlush(&seqp->evtq); - Don't flush event queue + anymore. */ + /* sct 1/3/96 - Don't overwrite nextEvent with + AL_SEQP_API_EVT or set nextDelta to + AL_USEC_PER_FRAME since we're not stopping event + processing. */ + /* sct 1/3/96 - Don't return here since we keep + processing events as usual. */ + } + break; + + case (AL_SEQP_STOPPING_EVT): + if (seqp->state == AL_PLAYING) + { + /* sct 12/29/95 - Remove events associated with the + * stopping sequence. For compact sequence player, + * also remove all queued note off events since they + * are not contained in a compact sequence but are + * generated in response to note ons. Note that + * flushing AL_SEQP_MIDI_EVTs may flush events that + * were posted after the call to alSeqpStop, so the + * application must queue these events either when + * the player is fully stopped, or when it is + * playing. */ + alEvtqFlushType(&seqp->evtq, AL_SEQ_REF_EVT); + alEvtqFlushType(&seqp->evtq, AL_CSP_NOTEOFF_EVT); + alEvtqFlushType(&seqp->evtq, AL_SEQP_MIDI_EVT); + + /* sct 1/3/96 - Check to see which voices need to be + killed and release them. */ + /* Unkilled voices should have note end events + occurring prior to KILL_TIME. */ + for (vs = seqp->vAllocHead; vs != 0; vs = vs->next) + { + if (__voiceNeedsNoteKill ((ALSeqPlayer*)seqp, &vs->voice, KILL_TIME)) + __seqpReleaseVoice((ALSeqPlayer*)seqp, &vs->voice, KILL_TIME); + } + + seqp->state = AL_STOPPING; + evt.type = AL_SEQP_STOP_EVT; + alEvtqPostEvent(&seqp->evtq, &evt, AL_EVTQ_END); + } + break; + + case (AL_SEQP_PRIORITY_EVT): + chan = seqp->nextEvent.msg.sppriority.chan; + seqp->chanState[chan].priority = seqp->nextEvent.msg.sppriority.priority; + break; + + case (AL_SEQP_SEQ_EVT): + //assert(seqp->state != AL_PLAYING); /* Must be done playing to change sequences. */ + ((seqp->state != AL_PLAYING)?((void)0):func_8033F000("seqp->state != AL_PLAYING","n_csplayer.c", 272)); + + seqp->target = seqp->nextEvent.msg.spseq.seq; + seqp->chanMask = 0xFFFF; + if (seqp->bank) + __initFromBank((ALSeqPlayer *)seqp, seqp->bank); + break; + + case (AL_SEQP_BANK_EVT): + //assert(seqp->state == AL_STOPPED); /* Must be fully stopped to change banks. */ + ((seqp->state == AL_STOPPED)?((void)0):func_8033F000("seqp->state == AL_STOPPED","n_csplayer.c", 283)); + + seqp->bank = seqp->nextEvent.msg.spbank.bank; + __initFromBank((ALSeqPlayer *)seqp, seqp->bank); + break; + + /* sct 11/6/95 - these events should now be handled by __n_CSPHandleNextSeqEvent */ + case (AL_SEQ_END_EVT): + case (AL_TEMPO_EVT): + case (AL_SEQ_MIDI_EVT): + //assert(FALSE); + ((FALSE)?((void)0):func_8033F000("FALSE","n_csplayer.c", 296)); + break; + } + seqp->nextDelta = alEvtqNextEvent(&seqp->evtq, &seqp->nextEvent); + + } while (seqp->nextDelta == 0); + + /* + * assume that next callback won't be more than half an + * hour away + */ + seqp->curTime += seqp->nextDelta; /* sct 11/7/95 */ + return seqp->nextDelta; +} + +/* + Calculates the delta time in ticks until the next sequence + event and posts a sequence reference event with the time in usecs. + Loops are handled automatically by the compact sequence. + Does nothing if the sequence player is not playing or if there + is no target sequence. + sct 11/7/95 +*/ +/*DONE*/ +void __n_CSPPostNextSeqEvent(N_ALCSPlayer *seqp) +{ + ALEvent evt; + s32 deltaTicks; + + if (seqp->state != AL_PLAYING || seqp->target == NULL) + return; + + /* Get the next event time in ticks. */ + /* If false is returned, then there is no next delta (ie. end of sequence reached). */ + if (!__alCSeqNextDelta(seqp->target, &deltaTicks)) + return; + + evt.type = AL_SEQ_REF_EVT; + alEvtqPostEvent(&seqp->evtq, &evt, deltaTicks * seqp->uspt); +} + + +/* + Call this routine to handle the next event in the sequence. + Assumes that the next sequence event is scheduled to be processed + immediately since it does not check the event's tick time. + sct 11/7/95 +*/ +static void +__n_CSPHandleNextSeqEvent(N_ALCSPlayer *seqp) +{ + ALEvent evt; + + /* sct 1/5/96 - Do nothing if we don't have a target sequence. */ + if (seqp->target == NULL) + return; + + alCSeqNextEvent(seqp->target, &evt); + + switch (evt.type) + { + case AL_SEQ_MIDI_EVT: + __n_CSPHandleMIDIMsg(seqp, &evt); + __n_CSPPostNextSeqEvent(seqp); + break; + + case AL_TEMPO_EVT: + __n_CSPHandleMetaMsg(seqp, &evt); + __n_CSPPostNextSeqEvent(seqp); + break; + + case AL_SEQ_END_EVT: + seqp->state = AL_STOPPING; + evt.type = AL_SEQP_STOP_EVT; + alEvtqPostEvent(&seqp->evtq, &evt, AL_EVTQ_END); + break; + + case AL_TRACK_END: + case AL_CSP_LOOPSTART: + case AL_CSP_LOOPEND: + __n_CSPPostNextSeqEvent(seqp); + break; + + default: + //assert(FALSE); /* Sequence event type not supported. */ + ((FALSE)?((void)0):func_8033F000("FALSE","n_csplayer.c", 353)); + break; + } +} + + +static void __n_CSPHandleMIDIMsg(N_ALCSPlayer *seqp, N_ALEvent *event) +{ + N_ALVoice *voice; + N_ALVoiceState *vs; + s32 status; + u8 chan; + u8 key; + u8 vel; + u8 byte1; + u8 byte2; + ALMIDIEvent *midi = &event->msg.midi; + s16 vol; + N_ALEvent evt; + ALMicroTime deltaTime; + N_ALVoiceState *vstate; + ALPan pan; + ALFxRef fxref; + + + status = midi->status & AL_MIDI_StatusMask; + chan = midi->status & AL_MIDI_ChannelMask; + byte1 = key = midi->byte1; + byte2 = vel = midi->byte2; + + if(status == AL_MIDI_ChannelModeSelect){ + if(byte1 == 0x7E){ + seqp->chanMask &= ~(1 << byte2); + vstate = seqp->vAllocHead; + while(vs){ + if(vstate->channel == byte2){ + __seqpReleaseVoice(seqp, &vstate->voice.node.next, vstate->sound->envelope->releaseTime); + } + vs = vs->next; + } + return; + }else if(byte1 == 0x7F){ + seqp->chanMask |= (1 << byte2); + return; + } + } + + if(!((seqp->chanMask & (1 << chan)) || status != AL_MIDI_NoteOn)) + return; + + //L8025DB08 + switch (status) + { + case (AL_MIDI_NoteOn): + + if (vel != 0) /* a real note on */ + { + ALVoiceConfig config; + ALSound *sound; + s16 cents; + f32 pitch,oscValue; + u8 fxmix; + void *oscState; + ALInstrument *inst; + + /* If we're not playing, don't process note ons. */ + if (seqp->state != AL_PLAYING) + break; + + sound = __lookupSoundQuick((ALSeqPlayer*)seqp, key, vel, chan); + ALFlagFailIf(!sound, seqp->debugFlags & NO_SOUND_ERR_MASK, + ERR_ALSEQP_NO_SOUND); + + config.priority = seqp->chanState[chan].priority; + config.fxBus = 0; + config.unityPitch = 0; + + vstate = __mapVoice((ALSeqPlayer*)seqp, key, vel, chan); + ALFlagFailIf(!vstate, seqp->debugFlags & NO_VOICE_ERR_MASK, + ERR_ALSEQP_NO_VOICE ); + + voice = &vstate->voice; + n_alSynAllocVoice(voice, &config); + + /* + * set up the voice state structure + */ + vstate->sound = sound; + vstate->envPhase = AL_PHASE_ATTACK; + if (seqp->chanState[chan].sustain > AL_SUSTAIN) + vstate->phase = AL_PHASE_SUSTAIN; + else + vstate->phase = AL_PHASE_NOTEON; + + cents = (key - sound->keyMap->keyBase) * 100 + + sound->keyMap->detune; + + vstate->pitch = alCents2Ratio(cents); + vstate->envGain = sound->envelope->attackVolume; + vstate->envEndTime = seqp->curTime + + sound->envelope->attackTime; + + /* + * setup tremelo and vibrato if active + */ + vstate->flags = 0; + inst = seqp->chanState[chan].instrument; + + oscValue = (f32)AL_VOL_FULL; /* set this as a default */ + if(inst->tremType) + { + if(seqp->initOsc) + { + deltaTime = (*seqp->initOsc)(&oscState,&oscValue,inst->tremType, + inst->tremRate,inst->tremDepth,inst->tremDelay); + + if(deltaTime) /* a deltaTime of zero means don't run osc */ + { + evt.type = AL_TREM_OSC_EVT; + evt.msg.osc.vs = vstate; + evt.msg.osc.oscState = oscState; + alEvtqPostEvent(&seqp->evtq, &evt, deltaTime); + vstate->flags |= 0x01; /* set tremelo flag bit */ + } + } + } + vstate->tremelo = (u8)oscValue; /* will default if not changed by initOsc */ + + oscValue = 1.0f; /* set this as a default */ + if(inst->vibType) + { + if(seqp->initOsc) + { + deltaTime = (*seqp->initOsc)(&oscState,&oscValue,inst->vibType, + inst->vibRate,inst->vibDepth,inst->vibDelay); + + if(deltaTime) /* a deltaTime of zero means don't run osc. */ + { + evt.type = AL_VIB_OSC_EVT; + evt.msg.osc.vs = vstate; + evt.msg.osc.oscState = oscState; + evt.msg.osc.chan = chan; + alEvtqPostEvent(&seqp->evtq, &evt, deltaTime); + vstate->flags |= 0x02; /* set the vibrato flag bit */ + } + } + } + vstate->vibrato = oscValue; /* will default if not changed by initOsc */ + + /* + * calculate the note on parameters + */ + pitch = vstate->pitch * seqp->chanState[chan].pitchBend * + vstate->vibrato; + fxmix = seqp->chanState[chan].fxmix; + pan = __vsPan(vstate, (ALSeqPlayer*)seqp); + vol = __vsVol(vstate, (ALSeqPlayer*)seqp); + deltaTime = sound->envelope->attackTime; + + n_alSynStartVoiceParams(voice, sound->wavetable, + pitch, vol, pan, fxmix, deltaTime); + /* + * set up callbacks for envelope + */ + evt.type = AL_SEQP_ENV_EVT; + evt.msg.vol.voice = voice; + evt.msg.vol.vol = sound->envelope->decayVolume; + evt.msg.vol.delta = sound->envelope->decayTime; + + alEvtqPostEvent(&seqp->evtq, &evt, deltaTime); + + if(midi->duration) + { + /* + * set up note off evt. if no duration don't do this + */ + evt.type = AL_CSP_NOTEOFF_EVT; + evt.msg.midi.status = chan | AL_MIDI_NoteOff; + evt.msg.midi.byte1 = key; + evt.msg.midi.byte2 = 0; /* not needed ? */ + deltaTime = seqp->uspt * midi->duration; + + /* max time would be about one hour ten minutes */ + alEvtqPostEvent(&seqp->evtq, &evt, deltaTime); + } + + break; + } + + /* + * NOTE: intentional fall-through for note on with zero + * velocity (Should never happen with compact midi sequence, + * but could happen with real time midi.) + */ + + case (AL_MIDI_NoteOff): + vstate = __lookupVoice((ALSeqPlayer*)seqp, key, chan); + ALFlagFailIf(!vstate, seqp->debugFlags & NOTE_OFF_ERR_MASK, + ERR_ALSEQP_OFF_VOICE ); + + if (vstate->phase == AL_PHASE_SUSTAIN) + vstate->phase = AL_PHASE_SUSTREL; + else + { + vstate->phase = AL_PHASE_RELEASE; + __seqpReleaseVoice((ALSeqPlayer*)seqp, &vstate->voice, + vstate->sound->envelope->releaseTime); + } + + break; + + case (AL_MIDI_PolyKeyPressure): + /* + * Aftertouch per key (hardwired to volume). Note that + * aftertouch affects only notes that are already + * sounding. + */ + vstate = __lookupVoice((ALSeqPlayer*)seqp, key, chan); + ALFailIf(!vstate, ERR_ALSEQP_POLY_VOICE ); + + vstate->velocity = byte2; + n_alSynSetVol(&vstate->voice, + __vsVol(vstate, (ALSeqPlayer*)seqp), + __vsDelta(vstate,seqp->curTime)); + break; + + case (AL_MIDI_ChannelPressure): + /* + * Aftertouch per channel (hardwired to volume). Note that + * aftertouch affects only notes that are already + * sounding. + */ + for (vs = seqp->vAllocHead; vs != 0; vs = vs->next) { + if (vs->channel == chan) { + vs->velocity = byte1; + n_alSynSetVol(&vs->voice, + __vsVol(vs, (ALSeqPlayer*)seqp), + __vsDelta(vs,seqp->curTime)); + } + } + break; + + case (AL_MIDI_ControlChange): + switch (byte1) + { + case (AL_MIDI_PAN_CTRL): + seqp->chanState[chan].pan = byte2; + for (vs = seqp->vAllocHead; vs != 0; vs = vs->next) + { + if (vs->channel == chan) + { + pan = __vsPan(vs, (ALSeqPlayer*)seqp); + n_alSynSetPan(&vs->voice, pan); + } + } + break; + + case (AL_MIDI_VOLUME_CTRL): + seqp->chanState[chan].vol = byte2; + for (vs = seqp->vAllocHead; vs != 0; vs = vs->next) + { + if ((vs->channel == chan) && (vs->envPhase != AL_PHASE_RELEASE)) + { + vol = __vsVol(vs, (ALSeqPlayer*)seqp); + n_alSynSetVol(&vs->voice, vol, + __vsDelta(vs,seqp->curTime)); + } + } + break; + case (0x7D): + seqp->chanState[chan].unk9 = byte2; + for (vs = seqp->vAllocHead; vs != 0; vs = vs->next) + { + if ((vs->channel == chan) && (vs->envPhase != AL_PHASE_RELEASE)) + { + vol = __vsVol(vs, (ALSeqPlayer*)seqp); + n_alSynSetVol(&vs->voice, vol, + __vsDelta(vs,seqp->curTime)); + } + } + break; + case (AL_MIDI_PRIORITY_CTRL): + /* leave current voices where they are */ + seqp->chanState[chan].priority = byte2; + break; + case (AL_MIDI_SUSTAIN_CTRL): + seqp->chanState[chan].sustain = byte2; + for (vs = seqp->vAllocHead; vs != 0; vs = vs->next) + { + if ((vs->channel == chan) && (vs->phase != AL_PHASE_RELEASE)) + { + if ( byte2 > AL_SUSTAIN ) + { + /* + * sustain pedal down + */ + if (vs->phase == AL_PHASE_NOTEON) + vs->phase = AL_PHASE_SUSTAIN; + } + else + { + /* + * sustain pedal up + */ + if (vs->phase == AL_PHASE_SUSTAIN) + vs->phase = AL_PHASE_NOTEON; + + else if(vs->phase == AL_PHASE_SUSTREL) + { + vs->phase = AL_PHASE_RELEASE; + __seqpReleaseVoice((ALSeqPlayer*)seqp, + &vs->voice, + vs->sound->envelope->releaseTime); + } + } + } + } + break; + case (AL_MIDI_FX1_CTRL): + seqp->chanState[chan].fxmix = byte2; + for (vs = seqp->vAllocHead; vs != 0; vs = vs->next) + { + if (vs->channel == chan) + n_alSynSetFXMix(&vs->voice, byte2); + } + break; + case (0x6A): + case (0x6B): + case (0x6C): + case (0x6D): + case (0x6E): + case (0x6F): + case (0x70): + case (0x71): + case (0x72): + case (0x73): + case (0x74): + case (0x75): + case (0x76): + case (0x77): + func_80250104(seqp->target,key, chan); + break; + default: + break; + } + break; + case (AL_MIDI_ProgramChange): + /* sct 1/16/96 - We must have a valid bank in order to process the program change. */ + //assert(seqp->bank != NULL); + ((seqp->bank != NULL)?((void)0):func_8033F000("seqp->bank != NULL", "n_csplayer.c", 715)); + if (key < seqp->bank->instCount) + { + ALInstrument *inst = seqp->bank->instArray[key]; + __setInstChanState((ALSeqPlayer*)seqp, inst, chan); /* sct 11/6/95 */ + } + else + { +#ifdef _DEBUG + __osError(ERR_ALSEQPINVALIDPROG, 2, key, seqp->bank->instCount); +#endif + } + break; + case (AL_MIDI_PitchBendChange): + { + s32 bendVal; + f32 bendRatio; + s32 cents; + + /* get 14-bit unsigned midi value */ + bendVal = ( (byte2 << 7) + byte1) - 8192; + + /* calculate pitch bend in cents */ + cents = (seqp->chanState[chan].bendRange * bendVal)/8192; + + /* calculate the corresponding ratio */ + bendRatio = alCents2Ratio(cents); + seqp->chanState[chan].pitchBend = bendRatio; + + for (vs = seqp->vAllocHead; vs != 0; vs = vs->next) + if (vs->channel == chan) + n_alSynSetPitch(&vs->voice, + vs->pitch * bendRatio * vs->vibrato); + + } + break; + + default: +#ifdef _DEBUG + __osError(ERR_ALSEQPUNKNOWNMIDI, 1, status); +#endif + break; + } +} + +/*Done*/ +static void __n_CSPHandleMetaMsg(N_ALCSPlayer *seqp, N_ALEvent *event) +{ + ALTempoEvent *tevt = &event->msg.tempo; + ALEvent evt; + s32 tempo; + s32 oldUspt; + u32 ticks; + ALMicroTime tempDelta,curDelta = 0; + ALEventListItem *thisNode,*nextNode,*firstTemp = 0; + + + if (event->msg.tempo.status == AL_MIDI_Meta) + { + if (event->msg.tempo.type == AL_MIDI_META_TEMPO) + { + oldUspt = seqp->uspt; + tempo = (tevt->byte1 << 16) | (tevt->byte2 << 8) | (tevt->byte3 << 0); + __n_setUsptFromTempo (seqp, seqp->target, (f32)tempo); /* sct 1/8/96 */ + + thisNode = (ALEventListItem*)seqp->evtq.allocList.next; + while(thisNode) + { + curDelta += thisNode->delta; + nextNode = (ALEventListItem*)thisNode->node.next; + if(thisNode->evt.type == AL_CSP_NOTEOFF_EVT) + { + alUnlink((ALLink*)thisNode); + + if(firstTemp) + alLink((ALLink*)thisNode,(ALLink*)firstTemp); + else + { + thisNode->node.next = 0; + thisNode->node.prev = 0; + firstTemp = thisNode; + } + tempDelta = curDelta; /* record the current delta */ + if(nextNode) /* don't do this if no nextNode */ + { + curDelta -= thisNode->delta; /* subtract out this delta */ + nextNode->delta += thisNode->delta; /* add it to next event */ + } + thisNode->delta = tempDelta; /* set this event delta from current */ + } + thisNode = nextNode; + } + + thisNode = firstTemp; + while(thisNode) + { + nextNode = (ALEventListItem*)thisNode->node.next; + ticks = thisNode->delta/oldUspt; + thisNode->delta = ticks * seqp->uspt; + __n_CSPRepostEvent(&seqp->evtq,thisNode); + thisNode = nextNode; + } + } + } +} +/*Done*/ +static void __n_CSPRepostEvent(ALEventQueue *evtq, N_ALEventListItem *item) +{ + OSIntMask mask; + ALLink *node; + N_ALEventListItem *nextItem; + + mask = osSetIntMask(OS_IM_NONE); + + for (node = &evtq->allocList; node != 0; node = node->next) + { + if (!node->next) /* end of the list */ + { + alLink((ALLink *)item, node); + break; + } + else + { + nextItem = (N_ALEventListItem *)node->next; + if (item->delta < nextItem->delta) + { + nextItem->delta -= item->delta; + alLink((ALLink *)item, node); + break; + } + item->delta -= nextItem->delta; + } + } + osSetIntMask(mask); +} + + +/* + This routine safely calculates the sequence player's + uspt value based on the given tempo. It does this safely + by making sure that the player has a target sequence and + therefore a qnpt value which is needed for the calculation. + Compact sequence player needs its own version of this routine + since the ALCSeq's qnpt field is at a different offset. +*/ +/* DONE */ +static void __n_setUsptFromTempo(N_ALCSPlayer *seqp, ALCSeq *target, f32 tempo) +{ + if (target) + seqp->uspt = (s32)((f32)tempo * target->qnpt); + else + seqp->uspt = 488; /* This is the initial value set by alSeqpNew. */ +} diff --git a/src/core1/done/audio/n_csq.c b/src/core1/done/audio/n_csq.c new file mode 100644 index 00000000..cf19d896 --- /dev/null +++ b/src/core1/done/audio/n_csq.c @@ -0,0 +1,292 @@ +#include +#include "n_libaudio.h" + +static u32 __readVarLen(ALCSeq *s,u32 track); +static u8 __getTrackByte(ALCSeq *s,u32 track); +static u32 __n_alCSeqGetTrackEvent(ALCSeq *seq, u32 track, N_ALEvent *event); + +void n_alCSeqNew(ALCSeq *seq, u8 *ptr) +{ + u32 i,tmpOff,flagTmp; + + /* load the seqence pointed to by ptr */ + seq->base = (ALCMidiHdr*)ptr; + seq->validTracks = 0; + seq->lastDeltaTicks = 0; + seq->lastTicks = 0; + seq->deltaFlag = 1; + + for(i = 0; i < 16; i++) + { + seq->lastStatus[i] = 0; + seq->curBUPtr[i] = 0; + seq->curBULen[i] = 0; + tmpOff = seq->base->trackOffset[i]; + if(tmpOff) /* if the track is valid */ + { + flagTmp = 1 << i; + seq->validTracks |= flagTmp; + seq->curLoc[i] = (u8*)((u32)ptr + tmpOff); + seq->evtDeltaTicks[i] = __readVarLen(seq,i); + /*__n_alCSeqGetTrackEvent(seq,i); prime the event buffers */ + } + else + seq->curLoc[i] = 0; + } + + seq->qnpt = 1.0/(f32)seq->base->division; +} + +void n_alCSeqNextEvent(ALCSeq *seq,N_ALEvent *evt) +{ + u32 i; + u32 firstTime = 0xFFFFFFFF; + u32 firstTrack; + u32 lastTicks = seq->lastDeltaTicks; + +#ifdef _DEBUG + /* sct 1/17/96 - Warn if we are beyond the end of sequence. */ + if (!seq->validTracks) + __osError(ERR_ALSEQOVERRUN, 0); +#endif + + + for(i = 0; i < 16 ; i++) + { + if((seq->validTracks >> i) & 1) + { + if(seq->deltaFlag) + seq->evtDeltaTicks[i] -= lastTicks; + if(seq->evtDeltaTicks[i] < firstTime) + { + firstTime = seq->evtDeltaTicks[i]; + firstTrack = i; + } + } + } + + __n_alCSeqGetTrackEvent(seq,firstTrack,evt); + + evt->msg.midi.ticks = firstTime; + seq->lastTicks += firstTime; + seq->lastDeltaTicks = firstTime; + if(evt->type != AL_TRACK_END) + seq->evtDeltaTicks[firstTrack] += __readVarLen(seq,firstTrack); + seq->deltaFlag = 1; + +} + + +/* only call n_alCSeqGetTrackEvent with a valid track !! */ +static u32 __n_alCSeqGetTrackEvent(ALCSeq *seq, u32 track, N_ALEvent *event) +{ + u32 offset; + u8 status, loopCt, curLpCt, *tmpPtr; + + + status = __getTrackByte(seq,track); /* read the status byte */ + + if (status == AL_MIDI_Meta) /* running status not allowed on meta events!! */ + { + u8 type = __getTrackByte(seq,track); + + if (type == AL_MIDI_META_TEMPO) + { + event->type = AL_TEMPO_EVT; + event->msg.tempo.status = status; + event->msg.tempo.type = type; + event->msg.tempo.byte1 = __getTrackByte(seq,track); + event->msg.tempo.byte2 = __getTrackByte(seq,track); + event->msg.tempo.byte3 = __getTrackByte(seq,track); + seq->lastStatus[track] = 0; /* lastStatus not supported after meta */ + } + else if (type == AL_MIDI_META_EOT) + { + u32 flagMask; + + flagMask = 0x01 << track; + seq->validTracks = seq->validTracks ^ flagMask; + + if(seq->validTracks) /* there is music left don't end */ + event->type = AL_TRACK_END; + else /* no more music send AL_SEQ_END_EVT msg */ + event->type = AL_SEQ_END_EVT; + } + else if (type == AL_CMIDI_LOOPSTART_CODE) + { + status = __getTrackByte(seq,track); /* get next two bytes, ignore them */ + status = __getTrackByte(seq,track); + seq->lastStatus[track] = 0; + event->type = AL_CSP_LOOPSTART; + } + else if (type == AL_CMIDI_LOOPEND_CODE) + { + tmpPtr = seq->curLoc[track]; + loopCt = *tmpPtr++; + curLpCt = *tmpPtr; + if(curLpCt == 0) /* done looping */ + { + *tmpPtr = loopCt; /* reset current loop count */ + seq->curLoc[track] = tmpPtr + 5; /* move pointer to end of event */ + } + else + { + if(curLpCt != 0xFF) /* not a loop forever */ + *tmpPtr = curLpCt - 1; /* decrement current loop count */ + tmpPtr++; /* get offset from end of event */ + offset = (*tmpPtr++) << 24; + offset += (*tmpPtr++) << 16; + offset += (*tmpPtr++) << 8; + offset += *tmpPtr++; + seq->curLoc[track] = tmpPtr - offset; + } + seq->lastStatus[track] = 0; + event->type = AL_CSP_LOOPEND; + } + +#ifdef _DEBUG + else + __osError(ERR_ALSEQMETA, 1, type); +#endif + + } + else + { + event->type = AL_SEQ_MIDI_EVT; + if (status & 0x80) /* if high bit is set, then new status */ + { + event->msg.midi.status = status; + event->msg.midi.byte1 = __getTrackByte(seq,track); + seq->lastStatus[track] = status; + } + else /* running status */ + { +#ifdef _DEBUG + if(seq->lastStatus[track] == 0) + __osError(ERR_ALCSEQZEROSTATUS, 1, track); +#endif + event->msg.midi.status = seq->lastStatus[track]; + event->msg.midi.byte1 = status; + } + + if (((event->msg.midi.status & 0xf0) != AL_MIDI_ProgramChange) && + ((event->msg.midi.status & 0xf0) != AL_MIDI_ChannelPressure)) + { + event->msg.midi.byte2 = __getTrackByte(seq,track); + if((event->msg.midi.status & 0xf0) == AL_MIDI_NoteOn) + { + event->msg.midi.duration = __readVarLen(seq,track); +#ifdef _DEBUG + if(event->msg.midi.byte2 == 0) + __osError( ERR_ALCSEQZEROVEL, 1, track); +#endif + } + } + else + event->msg.midi.byte2 = 0; + } + return TRUE; +} + + +void n_alCSeqNewMarker(ALCSeq *seq, ALCSeqMarker *m, u32 ticks) +{ + N_ALEvent evt; + ALCSeq tempSeq; + s32 i; + + + n_alCSeqNew(&tempSeq, (u8*)seq->base); + + do { + m->validTracks = tempSeq.validTracks; + m->lastTicks = tempSeq.lastTicks; + m->lastDeltaTicks = tempSeq.lastDeltaTicks; + + for(i=0;i<16;i++) + { + m->curLoc[i] = tempSeq.curLoc[i]; + m->curBUPtr[i] = tempSeq.curBUPtr[i]; + m->curBULen[i] = tempSeq.curBULen[i]; + m->lastStatus[i] = tempSeq.lastStatus[i]; + m->evtDeltaTicks[i] = tempSeq.evtDeltaTicks[i]; + } + + n_alCSeqNextEvent(&tempSeq, &evt); + + if (evt.type == AL_SEQ_END_EVT) + break; + + } while (tempSeq.lastTicks < ticks); + +} + + +/* non-aligned byte reading routines */ +static u8 __getTrackByte(ALCSeq *seq,u32 track) +{ + u8 theByte; + + + if(seq->curBULen[track]) + { + theByte = *seq->curBUPtr[track]; + seq->curBUPtr[track]++; + seq->curBULen[track]--; + } + else /* need to handle backup mode */ + { + theByte = *seq->curLoc[track]; + seq->curLoc[track]++; + if(theByte == AL_CMIDI_BLOCK_CODE) + { + u8 loBackUp,hiBackUp,theLen,nextByte; + u32 backup; + + nextByte = *seq->curLoc[track]; + seq->curLoc[track]++; + if(nextByte != AL_CMIDI_BLOCK_CODE) + { + /* if here, then got a backup section. get the amount of + backup, and the len of the section. Subtract the amount of + backup from the curLoc ptr, and subtract four more, since + curLoc has been advanced by four while reading the codes. */ + hiBackUp = nextByte; + loBackUp = *seq->curLoc[track]; + seq->curLoc[track]++; + theLen = *seq->curLoc[track]; + seq->curLoc[track]++; + backup = (u32)hiBackUp; + backup = backup << 8; + backup += loBackUp; + seq->curBUPtr[track] = seq->curLoc[track] - (backup + 4); + seq->curBULen[track] = (u32)theLen; + + /* now get the byte */ + theByte = *seq->curBUPtr[track]; + seq->curBUPtr[track]++; + seq->curBULen[track]--; + } + } + } + + return theByte; +} + +static u32 __readVarLen(ALCSeq *seq,u32 track) +{ + u32 value; + u32 c; + + value = (u32)__getTrackByte(seq,track); + if ( value & 0x00000080 ) + { + value &= 0x7f; + do + { + c = (u32)__getTrackByte(seq,track); + value = (value << 7) + (c & 0x7f); + } while (c & 0x80); + } + return (value); +} diff --git a/src/core1/done/audio/n_drvrNew.c b/src/core1/done/audio/n_drvrNew.c new file mode 100644 index 00000000..940cd08c --- /dev/null +++ b/src/core1/done/audio/n_drvrNew.c @@ -0,0 +1,188 @@ +#include +#include "functions.h" +#include "variables.h" +#include "n_synth.h" + +/* + * WARNING: THE FOLLOWING CONSTANT MUST BE KEPT IN SYNC + * WITH SCALING IN MICROCODE!!! + */ +#define SCALE 16384 + +/* + * the following arrays contain default parameters for + * a few hopefully useful effects. + */ +#define ms *(((s32)((f32)44.1))&~0x7) + +s32 SMALLROOM_PARAMS_N[26] = { + /* sections length */ + 3, 100 ms, + /* chorus chorus filter + input output fbcoef ffcoef gain rate depth coef */ + 0, 54 ms, 9830, -9830, 0, 0, 0, 0, + 19 ms, 38 ms, 3276, -3276, 0x3fff, 0, 0, 0, + 0, 60 ms, 5000, 0, 0, 0, 0, 0x5000 +}; + +s32 BIGROOM_PARAMS_N[34] = { + /* sections length */ + 4, 100 ms, + /* chorus chorus filter + input output fbcoef ffcoef gain rate depth coef */ + 0, 66 ms, 9830, -9830, 0, 0, 0, 0, + 22 ms, 54 ms, 3276, -3276, 0x3fff, 0, 0, 0, + 66 ms, 91 ms, 3276, -3276, 0x3fff, 0, 0, 0, + 0, 94 ms, 8000, 0, 0, 0, 0, 0x5000 +}; + +s32 ECHO_PARAMS_N[10] = { + /* sections length */ + 1, 200 ms, + /* chorus chorus filter + input output fbcoef ffcoef gain rate depth coef */ + 0, 179 ms, 12000, 0, 0x7fff, 0, 0, 0 +}; + +s32 CHORUS_PARAMS_N[10] = { + /* sections length */ + 1, 20 ms, + /* chorus chorus filter + input output fbcoef ffcoef gain rate depth coef */ + 0, 5 ms, 0x4000, 0, 0x7fff, 7600, 700, 0 +}; + +s32 FLANGE_PARAMS_N[10] = { + /* sections length */ + 1, 20 ms, + /* chorus chorus filter + input output fbcoef ffcoef gain rate depth coef */ + 0, 5 ms, 0, 0x5fff, 0x7fff, 380, 500, 0 +}; + +s32 NULL_PARAMS_N[10] = { + 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +void n_alFxNew(ALFx **fx_ar, ALSynConfig *c, ALHeap *hp) +{ + u16 i, j, k; + s32 *param = 0; + ALDelay *d; + ALFx *r; + + *fx_ar = r = (ALFx *)alHeapAlloc(hp, 1, sizeof(ALFx)); + + switch (c->fxType) { + case AL_FX_SMALLROOM: param = SMALLROOM_PARAMS_N; break; + case AL_FX_BIGROOM: param = BIGROOM_PARAMS_N; break; + case AL_FX_ECHO: param = ECHO_PARAMS_N; break; + case AL_FX_CHORUS: param = CHORUS_PARAMS_N; break; + case AL_FX_FLANGE: param = FLANGE_PARAMS_N; break; + case AL_FX_CUSTOM: param = c->params; break; + default: param = NULL_PARAMS_N; break; + } + + + j = 0; + + r->section_count = param[j++]; + r->length = param[j++]; + + r->delay = alHeapAlloc(hp, r->section_count, sizeof(ALDelay)); + r->base = alHeapAlloc(hp, r->length, sizeof(s16)); + r->input = r->base; + + for ( k=0; k < r->length; k++) + r->base[k] = 0; + + for ( i=0; isection_count; i++ ){ + d = &r->delay[i]; + d->input = param[j++]; + d->output = param[j++]; + d->fbcoef = param[j++]; + d->ffcoef = param[j++]; + d->gain = param[j++]; + + if (param[j]) { +#define RANGE 2.0 +/* d->rsinc = ((f32) param[j++])/0xffffff; */ + d->rsinc = ((((f32)param[j++])/1000) * RANGE)/c->outputRate; + + /* + * the following constant is derived from: + * + * ratio = 2^(cents/1200) + * + * and therefore for hundredths of a cent + * x + * ln(ratio) = --------------- + * (120,000)/ln(2) + * where + * 120,000/ln(2) = 173123.40... + */ +#define CONVERT 173123.404906676 +#define LENGTH (d->output - d->input) + d->rsgain = (((f32) param[j++])/CONVERT) * LENGTH; + d->rsval = 1.0; + d->rsdelta = 0.0; + d->rs = alHeapAlloc(hp, 1, sizeof(ALResampler)); + d->rs->state = alHeapAlloc(hp, 1, sizeof(RESAMPLE_STATE)); + d->rs->delta = 0.0; + d->rs->first = 1; + } else { + d->rs = 0; + j++; + j++; + } + + if (param[j]) { + d->lp = alHeapAlloc(hp, 1, sizeof(ALLowPass)); + d->lp->fstate = alHeapAlloc(hp, 1, sizeof(POLEF_STATE)); + d->lp->fc = param[j++]; + _init_lpfilter(d->lp); + } else { + d->lp = 0; + j++; + } + } +} + +void alN_PVoiceNew(N_PVoice *mv, ALDMANew dmaNew, ALHeap *hp) +{ + mv->dc_state = alHeapAlloc(hp, 1, sizeof(ADPCM_STATE)); + mv->dc_lstate = alHeapAlloc(hp, 1, sizeof(ADPCM_STATE)); + mv->dc_dma = dmaNew(&mv->dc_dmaState); + mv->dc_lastsam = 0; + mv->dc_first = 1; + mv->dc_memin = 0; + + mv->rs_state = alHeapAlloc(hp, 1, sizeof(RESAMPLE_STATE)); + mv->rs_delta = 0.0; + mv->rs_first = 1; + mv->rs_ratio = 1.0; + mv->rs_upitch = 0; + + mv->em_state = alHeapAlloc(hp, 1, sizeof(ENVMIX_STATE)); + mv->em_first = 1; + mv->em_motion = AL_STOPPED; + mv->em_volume = 1; + mv->em_ltgt = 1; + mv->em_rtgt = 1; + mv->em_cvolL = 1; + mv->em_cvolR = 1; + mv->em_dryamt = 0; + mv->em_wetamt = 0; + mv->em_lratm = 1; + mv->em_lratl = 0; + mv->em_lratm = 1; + mv->em_lratl = 0; + mv->em_delta = 0; + mv->em_segEnd = 0; + mv->em_pan = 0; + mv->em_ctrlList = 0; + mv->em_ctrlTail = 0; +} + + diff --git a/src/core1/done/audio/n_envresample.c b/src/core1/done/audio/n_envresample.c new file mode 100644 index 00000000..b88f3a41 --- /dev/null +++ b/src/core1/done/audio/n_envresample.c @@ -0,0 +1,40 @@ +#include +#include "n_synth.h" + + +s32 + n_alEnvmixerParam(N_PVoice *filter, s32 paramID, void *param) +{ + N_PVoice *e = filter; + + switch (paramID) { + case (AL_FILTER_ADD_UPDATE): + if (e->em_ctrlTail) { + e->em_ctrlTail->next = (ALParam *)param; + } else { + e->em_ctrlList = (ALParam *)param; + } + e->em_ctrlTail = (ALParam *)param; + break; + case (AL_FILTER_RESET): + e->em_first = 1; + e->em_motion = AL_STOPPED; + e->em_volume = 1; + e->rs_delta = 0.0; + e->rs_first = 1; + e->rs_upitch = 0; + n_alLoadParam(e, AL_FILTER_RESET, param); + break; + case (AL_FILTER_START): + e->em_motion = AL_PLAYING; + break; + default: +#if 1 + n_alLoadParam(e, paramID, param); +#else + n_alResampleParam(e, paramID, param); +#endif + break; + } + return 0; +} diff --git a/src/core1/done/audio/n_load.c b/src/core1/done/audio/n_load.c new file mode 100644 index 00000000..2ebd2cd5 --- /dev/null +++ b/src/core1/done/audio/n_load.c @@ -0,0 +1,87 @@ +#include +#include "n_synth.h" + +#define ADPCMFBYTES 9 + +int +n_alLoadParam(N_PVoice *v, s32 paramID, void *param) +{ + ALLoadFilter *a = (ALLoadFilter *) v; + + switch (paramID) { + case (AL_FILTER_SET_WAVETABLE): + v->dc_table = (ALWaveTable *) param; + v->dc_memin = (s32) v->dc_table->base; + v->dc_sample = 0; + switch (v->dc_table->type){ + case (AL_ADPCM_WAVE): + + /* + * Set up the correct handler + */ + + /* + * Make sure the table length is an integer number of + * frames + */ + v->dc_table->len = ADPCMFBYTES * + ((s32) (v->dc_table->len/ADPCMFBYTES)); + + v->dc_bookSize = 2*v->dc_table->waveInfo.adpcmWave.book->order* + v->dc_table->waveInfo.adpcmWave.book->npredictors*ADPCMVSIZE; + if (v->dc_table->waveInfo.adpcmWave.loop) { + v->dc_loop.start = v->dc_table->waveInfo.adpcmWave.loop->start; + v->dc_loop.end = v->dc_table->waveInfo.adpcmWave.loop->end; + v->dc_loop.count = v->dc_table->waveInfo.adpcmWave.loop->count; + alCopy(v->dc_table->waveInfo.adpcmWave.loop->state, + v->dc_lstate, sizeof(ADPCM_STATE)); + } else { + v->dc_loop.start = v->dc_loop.end = v->dc_loop.count = 0; + } + break; + + case (AL_RAW16_WAVE): + //f->handler = alRaw16Pull; + if (v->dc_table->waveInfo.rawWave.loop) { + v->dc_loop.start = v->dc_table->waveInfo.rawWave.loop->start; + v->dc_loop.end = v->dc_table->waveInfo.rawWave.loop->end; + v->dc_loop.count = v->dc_table->waveInfo.rawWave.loop->count; + } else { + v->dc_loop.start = v->dc_loop.end = v->dc_loop.count = 0; + } + break; + + default: + break; + + } + break; + + case (AL_FILTER_RESET): + v->dc_lastsam = 0; + v->dc_first = 1; + v->dc_sample = 0; + + /* sct 2/14/96 - Check table since it is initialized to null and */ + /* Get loop info according to table type. */ + if (v->dc_table) + { + v->dc_memin = (s32) v->dc_table->base; + if (v->dc_table->type == AL_ADPCM_WAVE) + { + if (v->dc_table->waveInfo.adpcmWave.loop) + v->dc_loop.count = v->dc_table->waveInfo.adpcmWave.loop->count; + } + else if (v->dc_table->type == AL_RAW16_WAVE) + { + if (v->dc_table->waveInfo.rawWave.loop) + v->dc_loop.count = v->dc_table->waveInfo.rawWave.loop->count; + } + } + + break; + + default: + break; + } +} diff --git a/src/core1/done/audio/n_mainbus.c b/src/core1/done/audio/n_mainbus.c new file mode 100644 index 00000000..a29d9746 --- /dev/null +++ b/src/core1/done/audio/n_mainbus.c @@ -0,0 +1,28 @@ +#include +#include "n_synth.h" + +Acmd *n_alMainBusPull( s32 sampleOffset, Acmd *p) +{ + Acmd *ptr = p; + +#ifndef N_MICRO + aClearBuffer(ptr++, AL_MAIN_L_OUT, FIXED_SAMPLE<<1); + aClearBuffer(ptr++, AL_MAIN_R_OUT, FIXED_SAMPLE<<1); +#else + aClearBuffer(ptr++, N_AL_MAIN_L_OUT, N_AL_DIVIDED<<1); +#endif + + ptr = (n_syn->mainBus->filter.handler)(sampleOffset,ptr); + +#ifndef N_MICRO + aSetBuffer(ptr++, 0, 0, 0, FIXED_SAMPLE<<1); + aMix(ptr++, 0, 0x7fff, AL_AUX_L_OUT, AL_MAIN_L_OUT); + aMix(ptr++, 0, 0x7fff, AL_AUX_R_OUT, AL_MAIN_R_OUT); +#else + aMix(ptr++, 0, 0x7fff, N_AL_AUX_L_OUT, N_AL_MAIN_L_OUT); + aMix(ptr++, 0, 0x7fff, N_AL_AUX_R_OUT, N_AL_MAIN_R_OUT); +#endif + + return ptr; +} + diff --git a/src/core1/done/audio/n_resample.c b/src/core1/done/audio/n_resample.c new file mode 100644 index 00000000..b4c6cbe8 --- /dev/null +++ b/src/core1/done/audio/n_resample.c @@ -0,0 +1,116 @@ +#include +#include "n_synth.h" + +#ifdef AUD_PROFILE +extern u32 cnt_index, resampler_num, resampler_cnt, resampler_max, resampler_min, lastCnt[]; +#endif + +/*********************************************************************** + * Resampler filter public interfaces + ***********************************************************************/ +Acmd *n_alResamplePull(N_PVoice *e, s16 *outp, Acmd *p) +{ + Acmd *ptr = p; + s16 inp; + s32 inCount; + s32 incr; + f32 finCount; + +#ifdef AUD_PROFILE + lastCnt[++cnt_index] = osGetCount(); +#endif + +#ifndef N_MICRO + inp = AL_DECODER_OUT; +#else + inp = N_AL_DECODER_OUT; +#endif + + /* + * check if resampler is required + */ + if (e->rs_upitch) { + + ptr = n_alAdpcmPull(e, &inp, FIXED_SAMPLE, p); + aDMEMMove(ptr++, inp, *outp , FIXED_SAMPLE<<1); + + } else { + + /* + * clip to maximum allowable pitch + * FIXME: should we check for some minimum as well? + */ + if (e->rs_ratio > MAX_RATIO) e->rs_ratio = MAX_RATIO; + + /* + * quantize the pitch + */ + e->rs_ratio = (s32)(e->rs_ratio * UNITY_PITCH); + e->rs_ratio = e->rs_ratio / UNITY_PITCH; + + /* + * determine how many samples to generate + */ + finCount = e->rs_delta + (e->rs_ratio * (f32)FIXED_SAMPLE); + inCount = (s32) finCount; + e->rs_delta = finCount - (f32)inCount; + + /* + * ask all filters upstream from us to build their command + * lists. + */ + ptr = n_alAdpcmPull(e, &inp, inCount, p); + + /* + * construct our portion of the command list + */ + incr = (s32)(e->rs_ratio * UNITY_PITCH); +#ifndef N_MICRO + aSetBuffer(ptr++, 0, inp , *outp, FIXED_SAMPLE<<1); + aResample(ptr++, e->rs_first, incr, osVirtualToPhysical(e->rs_state)); +#else +#include "n_resample_add01.c_" +#endif + e->rs_first = 0; + } + +#ifdef AUD_PROFILE + PROFILE_AUD(resampler_num, resampler_cnt, resampler_max, resampler_min); +#endif + return ptr; +} + +s32 n_alResampleParam(N_PVoice *filter, s32 paramID, void *param) +{ + N_PVoice *r = filter; + union { + f32 f; + s32 i; + } data; + + switch (paramID) { +#if 0 + case (AL_FILTER_RESET): + r->rs_delta = 0.0; + r->rs_first = 1; + r->rs_upitch = 0; + n_alLoadParam(filter, AL_FILTER_RESET, 0); + break; + case (AL_FILTER_START): + n_alLoadParam(filter, AL_FILTER_START, 0); + break; + case (AL_FILTER_SET_PITCH): + data.i = (s32) param; + r->rs_ratio = data.f; + break; + case (AL_FILTER_SET_UNITY_PITCH): + r->rs_upitch = 1; + break; +#endif + default: + n_alLoadParam(filter, paramID, param); + break; + } + return 0; +} + diff --git a/src/core1/done/audio/n_resample_add01.c_ b/src/core1/done/audio/n_resample_add01.c_ new file mode 100644 index 00000000..1b7aec45 --- /dev/null +++ b/src/core1/done/audio/n_resample_add01.c_ @@ -0,0 +1,2 @@ + n_aResample(ptr++, osVirtualToPhysical(e->rs_state), e->rs_first, incr, inp, 0); + diff --git a/src/core1/done/audio/n_save.c b/src/core1/done/audio/n_save.c new file mode 100644 index 00000000..90edb3e6 --- /dev/null +++ b/src/core1/done/audio/n_save.c @@ -0,0 +1,19 @@ +#include +#include "n_synth.h" + +Acmd *n_alSavePull( s32 sampleOffset, Acmd *p) +{ + Acmd *ptr = p; + + ptr = n_alMainBusPull(sampleOffset, ptr); + +#ifndef N_MICRO + aSetBuffer (ptr++, 0, 0, 0, FIXED_SAMPLE<<1); + aInterleave(ptr++, AL_MAIN_L_OUT, AL_MAIN_R_OUT); + aSetBuffer (ptr++, 0, 0, 0, FIXED_SAMPLE<<2); + aSaveBuffer(ptr++, n_syn->sv_dramout); +#else +#include "n_save_add01.c_" +#endif + return ptr; +} diff --git a/src/core1/done/audio/n_save_add01.c_ b/src/core1/done/audio/n_save_add01.c_ new file mode 100644 index 00000000..8b3bdc34 --- /dev/null +++ b/src/core1/done/audio/n_save_add01.c_ @@ -0,0 +1,2 @@ + n_aInterleave(ptr++); + n_aSaveBuffer(ptr++, FIXED_SAMPLE<<2, 0, n_syn->sv_dramout); diff --git a/src/core1/done/audio/n_synaddplayer.c b/src/core1/done/audio/n_synaddplayer.c new file mode 100644 index 00000000..accd558b --- /dev/null +++ b/src/core1/done/audio/n_synaddplayer.c @@ -0,0 +1,68 @@ +#include +#include "synthInternals.h" +#include "n_synth.h" + + +void n_alSynAddPlayer( ALPlayer *client) +{ + OSIntMask mask = osSetIntMask(OS_IM_NONE); + + client->samplesLeft = n_syn->curSamples; + + client->next = n_syn->head; + n_syn->head = client; + + osSetIntMask(mask); +} + +void n_alSynAddSndPlayer( ALPlayer *client) +{ + OSIntMask mask = osSetIntMask(OS_IM_NONE); + + client->samplesLeft = n_syn->curSamples; + +#if 1 + client->next = n_syn->head; + n_syn->head = client; +#endif + + if( !(n_syn->n_sndp) ) + n_syn->n_sndp = client; + + osSetIntMask(mask); +} + +void n_alSynAddSeqPlayer(ALPlayer *client) +{ + OSIntMask mask = osSetIntMask(OS_IM_NONE); + + client->samplesLeft = n_syn->curSamples; + client->next = n_syn->head; + n_syn->head = client; + if(n_syn->n_seqp1 == 0){ + n_syn->n_seqp1 = client; + } + else if(n_syn->n_seqp2 == 0){ + n_syn->n_seqp2 = client; + } + else if(n_syn->unk5C == 0){ + n_syn->unk5C = client; + } + else if(n_syn->unk60 == 0){ + n_syn->unk60 = client; + } + else if(n_syn->unk64 == 0){ + n_syn->unk64 = client; + } + else if(n_syn->unk68 == 0){ + n_syn->unk68 = client; + } + else if(n_syn->unk6C == 0){ + n_syn->unk6C = client; + } + else if(n_syn->unk70 == 0){ + n_syn->unk70 = client; + } + + osSetIntMask(mask); +} diff --git a/src/core1/done/audio/n_synallocfx.c b/src/core1/done/audio/n_synallocfx.c new file mode 100644 index 00000000..cbdb852d --- /dev/null +++ b/src/core1/done/audio/n_synallocfx.c @@ -0,0 +1,10 @@ +#include +#include "functions.h" +#include "variables.h" +#include "n_synth.h" + +ALFxRef n_alSynAllocFX( s16 bus, ALSynConfig *c, ALHeap *hp) +{ + n_alFxNew(&n_syn->auxBus->fx_array[bus], c, hp); + return(n_syn->auxBus->fx_array[bus]); +} diff --git a/src/core1/done/audio/n_synallocvoice.c b/src/core1/done/audio/n_synallocvoice.c new file mode 100644 index 00000000..b80d6014 --- /dev/null +++ b/src/core1/done/audio/n_synallocvoice.c @@ -0,0 +1,107 @@ +#include +#include "n_synth.h" + +static s32 _n_allocatePVoice(N_PVoice **pvoice, s16 priority); + +s32 n_alSynAllocVoice( N_ALVoice *voice, ALVoiceConfig *vc) +{ + N_PVoice *pvoice = 0; + ALParam *update; + s32 stolen; + +#ifdef _DEBUG + /* need two updates if voice is stolen */ + if (drvr->paramList == 0) { + __osError(ERR_ALSYN_NO_UPDATE, 0); + return 0; + } else if (drvr->paramList->next == 0) { + __osError(ERR_ALSYN_NO_UPDATE, 0); + return 0; + } +#endif + + voice->priority = vc->priority; + voice->unityPitch = vc->unityPitch; + voice->table = 0; + voice->fxBus = vc->fxBus; + voice->state = AL_STOPPED; + voice->pvoice = 0; + + stolen = _n_allocatePVoice(&pvoice, vc->priority); + + if (pvoice) { /* if we were able to allocate a voice */ + + if (stolen) { + + pvoice->offset = 512; + pvoice->vvoice->pvoice = 0; /* zero stolen voice */ + pvoice->vvoice = voice; + voice->pvoice = pvoice; + /* + * ramp down stolen voice + */ + update = __n_allocParam(); + update->delta = n_syn->paramSamples; + update->type = AL_FILTER_SET_VOLUME; + update->data.i = 0; + update->moredata.i = pvoice->offset - 64; + n_alEnvmixerResampleParam(voice->pvoice, AL_FILTER_ADD_UPDATE, update); + + /* + * stop stolen voice + */ + update = __n_allocParam(); + if (update) { + update->delta = n_syn->paramSamples + pvoice->offset; + update->type = AL_FILTER_STOP_VOICE; + update->next = 0; + n_alEnvmixerResampleParam(voice->pvoice, AL_FILTER_ADD_UPDATE, update); + } else { +#ifdef _DEBUG + __osError(ERR_ALSYN_NO_UPDATE, 0); +#endif + } + + } else { + pvoice->offset = 0; + pvoice->vvoice = voice; /* assign new voice */ + voice->pvoice = pvoice; + } + } + + return (pvoice != 0); +} + +static +s32 _n_allocatePVoice(N_PVoice **pvoice, s16 priority) +{ + ALLink *dl; + N_PVoice *pv; + s32 stolen = 0; + + if ((dl = n_syn->pLameList.next) != 0) { /* check the lame list first */ + *pvoice = (N_PVoice *) dl; + alUnlink(dl); + alLink(dl, &n_syn->pAllocList); + } else if ((dl = n_syn->pFreeList.next) != 0) { /* from the free list */ + *pvoice = (N_PVoice *) dl; + alUnlink(dl); + alLink(dl, &n_syn->pAllocList); + } else { /* steal one */ + for (dl = n_syn->pAllocList.next; dl != 0; dl = dl->next) { + pv = (N_PVoice *)dl; + + /* + * if it is lower priority and not already stolen, keep it + * as a candidate for stealing + */ + if ((pv->vvoice->priority <= priority) && (pv->offset == 0)) { + *pvoice = pv; + priority = pv->vvoice->priority; + stolen = 1; + } + } + } + + return stolen; +} diff --git a/src/core1/done/audio/n_synfreevoice.c b/src/core1/done/audio/n_synfreevoice.c new file mode 100644 index 00000000..8352cd60 --- /dev/null +++ b/src/core1/done/audio/n_synfreevoice.c @@ -0,0 +1,30 @@ +#include +#include "n_synth.h" + +void n_alSynFreeVoice(N_ALVoice *voice) +{ + ALFilter *f; + ALFreeParam *update; + + if (voice->pvoice) { + + if (voice->pvoice->offset) { /* if voice was stolen */ + update = (ALFreeParam *)__n_allocParam(); + ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); + + /* + * set voice data + */ + update->delta = n_syn->paramSamples + voice->pvoice->offset; + update->type = AL_FILTER_FREE_VOICE; + update->pvoice = (PVoice *)voice->pvoice; + + n_alEnvmixerResampleParam(voice->pvoice, AL_FILTER_ADD_UPDATE, update); + } else { + _n_freePVoice(voice->pvoice); + } + + voice->pvoice = 0; + + } +} diff --git a/src/core1/done/audio/n_synsetfxmix.c b/src/core1/done/audio/n_synsetfxmix.c new file mode 100644 index 00000000..7f4fb024 --- /dev/null +++ b/src/core1/done/audio/n_synsetfxmix.c @@ -0,0 +1,29 @@ +#include +#include "n_synth.h" + + +void n_alSynSetFXMix(N_ALVoice *v, u8 fxmix) +{ + ALParam *update; + + if (v->pvoice) { + /* + * get new update struct from the free list + */ + update = __n_allocParam(); + ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); + + /* + * set offset and fxmix data + */ + update->delta = n_syn->paramSamples + v->pvoice->offset; + update->type = AL_FILTER_SET_FXAMT; + if (fxmix < 0) + update->data.i = -fxmix; + else + update->data.i = fxmix; + update->next = 0; + + n_alEnvmixerResampleParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); + } +} diff --git a/src/core1/done/audio/n_synsetpan.c b/src/core1/done/audio/n_synsetpan.c new file mode 100644 index 00000000..0eb251d3 --- /dev/null +++ b/src/core1/done/audio/n_synsetpan.c @@ -0,0 +1,27 @@ +#include +#include "n_synth.h" + +void n_alSynSetPan(N_ALVoice *v, u8 pan) +{ + ALParam *update; + ALFilter *f; + + if (v->pvoice) { + + /* + * get new update struct from the free list + */ + update = __n_allocParam(); + ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); + + /* + * set offset and pan data + */ + update->delta = n_syn->paramSamples + v->pvoice->offset; + update->type = AL_FILTER_SET_PAN; + update->data.i = pan; + update->next = 0; + + n_alEnvmixerResampleParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); + } +} diff --git a/src/core1/done/audio/n_synsetpitch.c b/src/core1/done/audio/n_synsetpitch.c new file mode 100644 index 00000000..ce54e25e --- /dev/null +++ b/src/core1/done/audio/n_synsetpitch.c @@ -0,0 +1,27 @@ +#include +#include "n_synth.h" + +void n_alSynSetPitch( N_ALVoice *v, f32 pitch) +{ + ALParam *update; + ALFilter *f; + + if (v->pvoice) { + /* + * get new update struct from the free list + */ + + update = __n_allocParam(); + ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); + + /* + * set offset and pitch data + */ + update->delta = n_syn->paramSamples + v->pvoice->offset; + update->type = AL_FILTER_SET_PITCH; + update->data.f = pitch; + update->next = 0; + + n_alEnvmixerResampleParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); + } +} diff --git a/src/core1/done/audio/n_synsetvol.c b/src/core1/done/audio/n_synsetvol.c new file mode 100644 index 00000000..941e183f --- /dev/null +++ b/src/core1/done/audio/n_synsetvol.c @@ -0,0 +1,30 @@ +#include +#include "n_synth.h" + + +void n_alSynSetVol( N_ALVoice *v, s16 volume, ALMicroTime t) +{ + ALParam *update; + ALFilter *f; + + if (v->pvoice) { + /* + * get new update struct from the free list + */ + update = __n_allocParam(); + ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); + + /* + * set offset and volume data + */ + update->delta = n_syn->paramSamples + v->pvoice->offset; + update->type = AL_FILTER_SET_VOLUME; + update->data.i = volume; + update->moredata.i = _n_timeToSamples( t); + update->next = 0; + + //f = v->pvoice->channelKnob; + //(*f->setParam)(f, AL_FILTER_ADD_UPDATE, update); + n_alEnvmixerResampleParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); + } +} \ No newline at end of file diff --git a/src/core1/done/audio/n_synstartvoice.c b/src/core1/done/audio/n_synstartvoice.c new file mode 100644 index 00000000..78401da5 --- /dev/null +++ b/src/core1/done/audio/n_synstartvoice.c @@ -0,0 +1,49 @@ +/*==================================================================== + * + * Copyright 1993, Silicon Graphics, Inc. + * All Rights Reserved. + * + * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, + * Inc.; the contents of this file may not be disclosed to third + * parties, copied or duplicated in any form, in whole or in part, + * without the prior written permission of Silicon Graphics, Inc. + * + * RESTRICTED RIGHTS LEGEND: + * Use, duplication or disclosure by the Government is subject to + * restrictions as set forth in subdivision (c)(1)(ii) of the Rights + * in Technical Data and Computer Software clause at DFARS + * 252.227-7013, and/or in similar or successor clauses in the FAR, + * DOD or NASA FAR Supplement. Unpublished - rights reserved under the + * Copyright Laws of the United States. + *====================================================================*/ +#include +#include +#include "n_synth.h" + +void n_alSynStartVoice( N_ALVoice *v, ALWaveTable *table) +{ + ALStartParam *update; + + if (v->pvoice) { + + update = (ALStartParam *)__n_allocParam(); + ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); + + /* + * send the start message to the motion control filter + */ +#ifdef SAMPLE_ROUND + update->delta = SAMPLE184( n_syn->paramSamples + v->pvoice->offset); +#else + update->delta = n_syn->paramSamples + v->pvoice->offset; +#endif + + update->type = AL_FILTER_START_VOICE; + update->wave = table; + update->next = 0; + update->unity = v->unityPitch; + + n_alEnvmixerResampleParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); + } +} + diff --git a/src/core1/done/audio/n_synstartvoiceparam.c b/src/core1/done/audio/n_synstartvoiceparam.c new file mode 100644 index 00000000..10483fc5 --- /dev/null +++ b/src/core1/done/audio/n_synstartvoiceparam.c @@ -0,0 +1,42 @@ +#include +#include "synthInternals.h" +#include "n_synth.h" + + +void n_alSynStartVoiceParams(N_ALVoice *v, ALWaveTable *w, + f32 pitch, s16 vol, ALPan pan, u8 fxmix, + ALMicroTime t) +{ + ALStartParamAlt *update; + + + + if ( v->pvoice) { + /* + * get new update struct from the free list + */ + update = (ALStartParamAlt *)__n_allocParam(); + ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); + + if (fxmix < 0) + fxmix = -fxmix; + + /* + * set offset and fxmix data + */ + update->delta = n_syn->paramSamples + v->pvoice->offset; + update->next = 0; + update->type = AL_FILTER_START_VOICE_ALT; + + update->unity = v->unityPitch; + update->pan = pan; + update->volume = vol; + update->fxMix = fxmix; + update->pitch = pitch; + update->samples = _n_timeToSamples( t); + update->wave = w; + + n_alEnvmixerResampleParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); + } + +} diff --git a/src/core1/done/audio/n_synstopvoice.c b/src/core1/done/audio/n_synstopvoice.c new file mode 100644 index 00000000..19e3bf60 --- /dev/null +++ b/src/core1/done/audio/n_synstopvoice.c @@ -0,0 +1,20 @@ +#include +#include "n_synth.h" + + +void n_alSynStopVoice( N_ALVoice *v) +{ + ALParam *update; + + if (v->pvoice) { + + update = __n_allocParam(); + ALFailIf(update == 0, ERR_ALSYN_NO_UPDATE); + + update->delta = n_syn->paramSamples + v->pvoice->offset; + update->type = AL_FILTER_STOP_VOICE; + update->next = 0; + + n_alEnvmixerResampleParam(v->pvoice, AL_FILTER_ADD_UPDATE, update); + } +} diff --git a/src/core1/done/audio/n_synthesizer.c b/src/core1/done/audio/n_synthesizer.c new file mode 100644 index 00000000..5921ae4d --- /dev/null +++ b/src/core1/done/audio/n_synthesizer.c @@ -0,0 +1,359 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "n_synth.h" + +#ifndef assert +#define assert(s) +#endif + +extern ALCmdHandler n_alAuxBusPull; +extern ALCmdHandler func_8025FE6C; +extern void alN_PVoiceNew(N_PVoice *mv, ALDMANew dmaNew, ALHeap *hp); + + +#ifdef AUD_PROFILE +#include +extern u32 cnt_index, drvr_num, drvr_cnt, drvr_max, drvr_min, lastCnt[]; +extern u32 client_num, client_cnt, client_max, client_min; +#endif + +#ifndef MIN +# define MIN(a,b) (((a)<(b))?(a):(b)) +#endif + +static s32 func_8025C370(ALPlayer **client); +static s32 _n_timeToSamplesNoRound(s32 micros); +/*********************************************************************** + * Synthesis driver public interfaces + ***********************************************************************/ +void n_alSynNew(ALSynConfig *c) +{ + s32 i; + N_PVoice *pv; + N_PVoice *pvoices; + ALHeap *hp = c->heap; + ALFilter *sources; + ALParam *params; + ALParam *paramPtr; + + n_syn->head = NULL; + n_syn->n_seqp1 = NULL; + n_syn->n_seqp2 = NULL; + n_syn->unk5C = NULL; + n_syn->unk60 = NULL; + n_syn->unk64 = NULL; + n_syn->unk68 = NULL; + n_syn->unk6C = NULL; + n_syn->unk70 = NULL; + n_syn->n_sndp = NULL; + n_syn->numPVoices = c->maxPVoices; + n_syn->curSamples = 0; + n_syn->paramSamples = 0; + n_syn->outputRate = c->outputRate; + n_syn->maxOutSamples = N_AL_MAX_RSP_SAMPLES; + n_syn->dma = (ALDMANew) c->dmaproc; + + n_syn->sv_dramout = 0; + n_syn->sv_first = 1; + + /* + * allocate and initialize the auxilliary effects bus. at present + * we only support 1 effects bus. + */ + n_syn->auxBus = alHeapAlloc(hp, 1, sizeof(N_ALAuxBus)); + n_syn->auxBus->sourceCount = 0; + n_syn->auxBus->maxSources = c->maxPVoices; + n_syn->auxBus->sources = alHeapAlloc(hp, c->maxPVoices, sizeof(ALFilter *)); + + /* + * allocate and initialize the main bus. + */ + n_syn->mainBus = alHeapAlloc(hp, 1, sizeof(N_ALMainBus)); + + if (c->fxType != AL_FX_NONE){ + /* + * Allocate an effect and set parameters + */ + n_syn->auxBus->fx = n_alSynAllocFX(0, c, hp); + n_syn->mainBus->filter.handler = &func_8025FE6C; + } else{ + /* + * Connect the aux bus to the main bus + */ + n_syn->mainBus->filter.handler = &n_alAuxBusPull; + } + /* + * Build the physical voice lists + */ + n_syn->pFreeList.next = 0; + n_syn->pFreeList.prev = 0; + n_syn->pLameList.next = 0; + n_syn->pLameList.prev = 0; + n_syn->pAllocList.next = 0; + n_syn->pAllocList.prev = 0; + + pvoices = alHeapAlloc(hp, c->maxPVoices, sizeof(N_PVoice)); + for (i = 0; i < c->maxPVoices; i++) { + pv = &pvoices[i]; + alLink((ALLink *)pv, &n_syn->pFreeList); + pv->vvoice = 0; + alN_PVoiceNew(pv, n_syn->dma, hp); + n_syn->auxBus->sources[n_syn->auxBus->sourceCount] = pv; + n_syn->auxBus->sourceCount++; + } + + /* + * build the parameter update list + */ + params = alHeapAlloc(hp, c->maxUpdates, sizeof(ALParam)); + n_syn->paramList = 0; + for (i = 0; i < c->maxUpdates; i++) { + paramPtr= ¶ms[i]; + paramPtr->next = n_syn->paramList; + n_syn->paramList = paramPtr; + } + + n_syn->heap = hp; +} + +/* + * slAudioFrame() is called every video frame, and is based on the video + * frame interrupt. It is assumed to be an accurate time source for the + * clients. + */ +Acmd *n_alAudioFrame(Acmd *cmdList, s32 *cmdLen, s16 *outBuf, s32 outLen) +{ + ALPlayer *client; + ALFilter *output; + s16 tmp; /* Starting buffer in DMEM */ + Acmd *cmdlEnd = cmdList; + s32 nOut; + s16 *lOutBuf = outBuf; + +#ifdef AUD_PROFILE + lastCnt[++cnt_index] = osGetCount(); +#endif + + if (n_syn->head == 0) { + *cmdLen = 0; + return cmdList; /* nothing to do */ + } + + /* + * run down list of clients and execute callback if needed this + * subframe. Here we do all the work for the frame at the + * start. Time offsets that occur before the next frame are + * executed "early". + */ + +#ifdef AUD_PROFILE + lastCnt[++cnt_index] = osGetCount(); +#endif + + /* + * paramSamples = time of next parameter change. + * curSamples = current sample time. + * so paramSamples - curSamples is the time until the next parameter change. + * if the next parameter change occurs within this frame time (outLen), + * then call back the client that contains the parameter change. + * Note, paramSamples must be rounded down to 16 sample boundary for use + * during the client handler. + */ + + for (n_syn->paramSamples = func_8025C370(&client); + n_syn->paramSamples - n_syn->curSamples < outLen; + n_syn->paramSamples = func_8025C370(&client)) + { + n_syn->paramSamples &= ~0xf; + client->samplesLeft += _n_timeToSamplesNoRound((*client->handler)(client)); + } + + /* for safety's sake, always store paramSamples aligned to 16 sample boundary. + * this way, if an voice handler routine gets called outside the ALVoiceHandler + * routine (alSynAllocVoice) it will get timestamped with an aligned value and + * will be processed immediately next audio frame. + */ + n_syn->paramSamples &= ~0xf; + + +#ifdef AUD_PROFILE + PROFILE_AUD(client_num, client_cnt, client_max, client_min); +#endif + + /* + * Now build the command list in small chunks + */ + while (outLen > 0){ + nOut = MIN(n_syn->maxOutSamples, outLen); + + /* + * construct the command list for each physical voice by calling + * the head of the filter chain. + */ + n_syn->sv_dramout = (s32) lOutBuf; + cmdlEnd = n_alSavePull(n_syn->curSamples, cmdlEnd); + outLen -= nOut; + lOutBuf += nOut<<1; /* For Stereo */ + n_syn->curSamples += nOut; + + } + *cmdLen = (s32) (cmdlEnd - cmdList); + + _n_collectPVoices(); /* collect free physical voices */ + +#ifdef AUD_PROFILE + PROFILE_AUD(drvr_num, drvr_cnt, drvr_max, drvr_min); +#endif + return cmdlEnd; +} + +/*********************************************************************** + * Synthesis driver private interfaces + ***********************************************************************/ + +ALParam *__allocParam() +{ + ALParam *update = 0; + + if (n_syn->paramList) { + update = n_syn->paramList; + n_syn->paramList =n_syn->paramList->next; + update->next = 0; + } + return update; +} + +void __n_freeParam(ALParam *param) +{ + param->next = n_syn->paramList; + n_syn->paramList = param; +} + +void _n_collectPVoices() +{ + ALLink *dl; + N_PVoice *pv; + + while ((dl = n_syn->pLameList.next) != 0) { + pv = (N_PVoice *)dl; + + /* ### remove from mixer */ + + alUnlink(dl); + alLink(dl, &n_syn->pFreeList); + } +} + +void _n_freePVoice(N_PVoice *pvoice) +{ + /* + * move the voice from the allocated list to the lame list + */ + alUnlink((ALLink *)pvoice); + alLink((ALLink *)pvoice, &n_syn->pLameList); +} + + +/* + Add 0.5 to adjust the average affect of + the truncation error produced by casting + a float to an int. +*/ +s32 _n_timeToSamplesNoRound(s32 micros) +{ + f32 tmp = ((f32)micros) * n_syn->outputRate / 1000000.0 + 0.5; + + return (s32)tmp; +} + +s32 _n_timeToSamples(s32 micros) +{ + return _n_timeToSamplesNoRound(micros) & ~0xf; +} + +static s32 func_8025C370(ALPlayer **client) +{ + ALMicroTime idelta; + ALMicroTime delta = 0x7fffffff; /* max delta for s32 */ + ALPlayer *cl; + + *client = 0; + + + if(n_syn->n_sndp != NULL){ + idelta = (n_syn->n_sndp->samplesLeft - n_syn->curSamples); + if (idelta < delta) { + *client = n_syn->n_sndp; + delta = idelta; + } + } + + cl = n_syn->n_seqp1; + if(cl != NULL){ + idelta = (cl->samplesLeft - n_syn->curSamples); + if (idelta < delta) { + *client = cl; + delta = idelta; + } + } + + cl = n_syn->n_seqp2; + if(cl != NULL){ + if ((cl->samplesLeft - n_syn->curSamples) < delta) { + *client = cl; + delta = idelta; + } + } + + cl = n_syn->unk5C; + if(cl != NULL){ + if ((cl->samplesLeft - n_syn->curSamples) < delta) { + *client = cl; + delta = idelta; + } + } + + cl = n_syn->unk60; + if(cl != NULL){ + if ((cl->samplesLeft - n_syn->curSamples) < delta) { + *client = cl; + delta = idelta; + } + } + + cl = n_syn->unk64; + if(cl != NULL){ + if ((cl->samplesLeft - n_syn->curSamples) < delta) { + *client = cl; + delta = idelta; + } + } + + cl = n_syn->unk68; + if(cl != NULL){ + if ((cl->samplesLeft - n_syn->curSamples) < delta) { + *client = cl; + delta = idelta; + } + } + + cl = n_syn->unk6C; + if(cl != NULL){ + if ((cl->samplesLeft - n_syn->curSamples) < delta) { + *client = cl; + delta = idelta; + } + } + + cl = n_syn->unk70; + if(cl != NULL){ + if ((cl->samplesLeft - n_syn->curSamples) < delta) { + *client = cl; + delta = idelta; + } + } + + return (*client)->samplesLeft; +} diff --git a/src/core1/done/audio/resample.c b/src/core1/done/audio/resample.c new file mode 100644 index 00000000..d8278ca7 --- /dev/null +++ b/src/core1/done/audio/resample.c @@ -0,0 +1,125 @@ +#include +#include "synthInternals.h" + +#ifdef AUD_PROFILE +extern u32 cnt_index, resampler_num, resampler_cnt, resampler_max, resampler_min, lastCnt[]; +#endif + +/*********************************************************************** + * Resampler filter public interfaces + ***********************************************************************/ +Acmd *alResamplePull(void *filter, s16 *outp, s32 outCnt, s32 sampleOffset, Acmd *p) +{ + ALResampler *f = (ALResampler *)filter; + Acmd *ptr = p; + s16 inp; + s32 inCount; + ALFilter *source = f->filter.source; + s32 incr; + f32 finCount; + +#ifdef AUD_PROFILE + lastCnt[++cnt_index] = osGetCount(); +#endif + + inp = AL_DECODER_OUT; + + if (!outCnt) + return ptr; + + /* + * check if resampler is required + */ + if (f->upitch) { + + ptr = (*source->handler)(source, &inp, outCnt, sampleOffset, p); + aDMEMMove(ptr++, inp, *outp, outCnt<<1); + + } else { + + /* + * clip to maximum allowable pitch + * FIXME: should we check for some minimum as well? + */ + if (f->ratio > MAX_RATIO) f->ratio = MAX_RATIO; + + /* + * quantize the pitch + */ + f->ratio = (s32)(f->ratio * UNITY_PITCH); + f->ratio = f->ratio / UNITY_PITCH; + + /* + * determine how many samples to generate + */ + finCount = f->delta + (f->ratio * (f32) outCnt); + inCount = (s32) finCount; + f->delta = finCount - (f32)inCount; + + /* + * ask all filters upstream from us to build their command + * lists. + */ + ptr = (*source->handler)(source, &inp, inCount, sampleOffset, p); + + /* + * construct our portion of the command list + */ + incr = (s32)(f->ratio * UNITY_PITCH); + aSetBuffer(ptr++, 0, inp, *outp, outCnt<<1); + aResample(ptr++, f->first, incr, osVirtualToPhysical(f->state)); + f->first = 0; + } + +#ifdef AUD_PROFILE + PROFILE_AUD(resampler_num, resampler_cnt, resampler_max, resampler_min); +#endif + return ptr; +} + +s32 alResampleParam(void *filter, s32 paramID, void *param) +{ + ALFilter *f = (ALFilter *) filter; + ALResampler *r = (ALResampler *) filter; + union { + f32 f; + s32 i; + } data; + + switch (paramID) { + + case (AL_FILTER_SET_SOURCE): + f->source = (ALFilter *) param; + break; + + case (AL_FILTER_RESET): + r->delta = 0.0; + r->first = 1; + r->motion = AL_STOPPED; + r->upitch = 0; + if (f->source) + (*f->source->setParam)(f->source, AL_FILTER_RESET, 0); + break; + + case (AL_FILTER_START): + r->motion = AL_PLAYING; + if (f->source) + (*f->source->setParam)(f->source, AL_FILTER_START, 0); + break; + + case (AL_FILTER_SET_PITCH): + data.i = (s32) param; + r->ratio = data.f; + break; + + case (AL_FILTER_SET_UNITY_PITCH): + r->upitch = 1; + break; + + default: + if (f->source) + (*f->source->setParam)(f->source, paramID, param); + break; + } + return 0; +} diff --git a/src/core1/done/audio/reverb.c b/src/core1/done/audio/reverb.c new file mode 100644 index 00000000..e89f979a --- /dev/null +++ b/src/core1/done/audio/reverb.c @@ -0,0 +1,431 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "synthInternals.h" +#include "initfx.h" + +#ifndef assert +#define assert(s) +#endif + + + +#define RANGE 2.0 +extern ALGlobals *alGlobals; + +#ifdef AUD_PROFILE +extern u32 cnt_index, reverb_num, reverb_cnt, reverb_max, reverb_min, lastCnt[]; +extern u32 load_num, load_cnt, load_max, load_min, save_num, save_cnt, save_max, save_min; +#endif + +/* + * macros + */ +#define SWAP(in, out) \ +{ \ + s16 t = out; \ + out = in; \ + in = t; \ +} + + + +Acmd *_loadOutputBuffer(ALFx *r, ALDelay *d, s32 buff, s32 incount, Acmd *p); +Acmd *_loadBuffer(ALFx *r, s16 *curr_ptr, s32 buff, s32 count, Acmd *p); +Acmd *_saveBuffer(ALFx *r, s16 *curr_ptr, s32 buff, s32 count, Acmd *p); +Acmd *_filterBuffer(ALLowPass *lp, s32 buff, s32 count, Acmd *p); +f32 _doModFunc(ALDelay *d, s32 count); + +static s32 L_INC[] = { L0_INC, L1_INC, L2_INC }; + +/*********************************************************************** + * Reverb filter public interfaces + ***********************************************************************/ +Acmd *alFxPull(void *filter, s16 *outp, s32 outCount, s32 sampleOffset, + Acmd *p) +{ + Acmd *ptr = p; + ALFx *r = (ALFx *)filter; + ALFilter *source = r->filter.source; + s16 i, buff1, buff2, input, output; + s16 *in_ptr, *out_ptr, gain, *prev_out_ptr = 0; + ALDelay *d, *pd; + +#ifdef AUD_PROFILE + lastCnt[++cnt_index] = osGetCount(); +#endif + + assert(source); + /* + * pull channels going into this effect first + */ + ptr = (*source->handler)(source, outp, outCount, sampleOffset, p); + + input = AL_AUX_L_OUT; + output = AL_AUX_R_OUT; + buff1 = AL_TEMP_0; + buff2 = AL_TEMP_1; + + aSetBuffer(ptr++, 0, 0, 0, outCount<<1); /* set the buffer size */ + aMix(ptr++, 0, 0xda83, AL_AUX_L_OUT, input); /* .707L = L - .293L */ + aMix(ptr++, 0, 0x5a82, AL_AUX_R_OUT, input); /* mix the AuxL and AuxR into the AuxL */ + /* and write the mixed value to the delay line at r->input */ + ptr = _saveBuffer(r, r->input, input, outCount, ptr); + + aClearBuffer(ptr++, output, outCount<<1); /* clear the AL_AUX_R_OUT */ + + for (i = 0; i < r->section_count; i++) { + d = &r->delay[i]; /* get the ALDelay structure */ + in_ptr = &r->input[-d->input]; + out_ptr = &r->input[-d->output]; + + if (in_ptr == prev_out_ptr) { + SWAP(buff1, buff2); + } else { /* load data at in_ptr into buff1 */ + ptr = _loadBuffer(r, in_ptr, buff1, outCount, ptr); + } + ptr = _loadOutputBuffer(r, d, buff2, outCount, ptr); + + if (d->ffcoef) { + aMix(ptr++, 0, (u16)d->ffcoef, buff1, buff2); + if (!d->rs && !d->lp) { + ptr = _saveBuffer(r, out_ptr, buff2, outCount, ptr); + } + } + + if (d->fbcoef) { + aMix(ptr++, 0, (u16)d->fbcoef, buff2, buff1); + ptr = _saveBuffer(r, in_ptr, buff1, outCount, ptr); + } + + if (d->lp) + ptr = _filterBuffer(d->lp, buff2, outCount, ptr); + + if (!d->rs) + ptr = _saveBuffer(r, out_ptr, buff2, outCount, ptr); + + if (d->gain) + aMix(ptr++, 0, (u16)d->gain, buff2, output); + + prev_out_ptr = &r->input[d->output]; + } + + /* + * bump the master delay line input pointer + * modulo the length + */ + r->input += outCount; + if (r->input > &r->base[r->length]) + r->input -= r->length; + + /* + * output already in AL_AUX_R_OUT + * just copy to AL_AUX_L_OUT + */ + aDMEMMove(ptr++, output, AL_AUX_L_OUT, outCount<<1); + +#ifdef AUD_PROFILE + PROFILE_AUD(reverb_num, reverb_cnt, reverb_max, reverb_min); +#endif + return ptr; +} + +s32 alFxParam(void *filter, s32 paramID, void *param) +{ + if(paramID == AL_FILTER_SET_SOURCE) + { + ALFilter *f = (ALFilter *) filter; + f->source = (ALFilter*) param; + } + return 0; +} + +/* + * This routine gets called by alSynSetFXParam. No checking takes place to + * verify the validity of the paramID or the param value. input and output + * values must be 8 byte aligned, so round down any param passed. + */ +s32 alFxParamHdl(void *filter, s32 paramID, void *param) +{ + ALFx *f = (ALFx *) filter; + s32 p = (paramID - 2) % 8; + s32 s = (paramID - 2) / 8; + s32 val = *(s32*)param; + +#define INPUT_PARAM 0 +#define OUTPUT_PARAM 1 +#define FBCOEF_PARAM 2 +#define FFCOEF_PARAM 3 +#define GAIN_PARAM 4 +#define CHORUSRATE_PARAM 5 +#define CHORUSDEPTH_PARAM 6 +#define LPFILT_PARAM 7 + + switch(p) + { + case INPUT_PARAM: + f->delay[s].input = (u32)val & 0xFFFFFFF8; + break; + case OUTPUT_PARAM: + f->delay[s].output = (u32)val & 0xFFFFFFF8; + break; + case FFCOEF_PARAM: + f->delay[s].ffcoef = (s16)val; + break; + case FBCOEF_PARAM: + f->delay[s].fbcoef = (s16)val; + break; + case GAIN_PARAM: + f->delay[s].gain = (s16)val; + break; + case CHORUSRATE_PARAM: + /* f->delay[s].rsinc = ((f32)val)/0xffffff; */ + f->delay[s].rsinc = ((((f32)val)/1000) * RANGE)/alGlobals->drvr.outputRate; + break; + +/* + * the following constant is derived from: + * + * ratio = 2^(cents/1200) + * + * and therefore for hundredths of a cent + * x + * ln(ratio) = --------------- + * (120,000)/ln(2) + * where + * 120,000/ln(2) = 173123.40... + */ +#define CONVERT 173123.404906676 +#define LENGTH (f->delay[s].output - f->delay[s].input) + + case CHORUSDEPTH_PARAM: + /*f->delay[s].rsgain = (((f32)val) / CONVERT) * LENGTH; */ + f->delay[s].rsgain = (((f32)val) / CONVERT) * LENGTH; + break; + case LPFILT_PARAM: + if(f->delay[s].lp) + { + f->delay[s].lp->fc = (s16)val; + init_lpfilter(f->delay[s].lp); + } + break; + } + return 0; +} + +Acmd *_loadOutputBuffer(ALFx *r, ALDelay *d, s32 buff, s32 incount, Acmd *p) +{ + Acmd *ptr = p; + s32 ratio, count, rbuff = AL_TEMP_2; + s16 *out_ptr; + f32 fincount, fratio, delta; + s32 ramalign = 0, length; + static f32 val=0.0, lastval=-10.0; + static f32 blob=0; +/* + * The following section implements the chorus resampling. Modulate where you pull + * the samples from, since you need varying amounts of samples. + */ + if (d->rs) { + length = d->output - d->input; + delta = _doModFunc(d, incount); /* get the number of samples to modulate by */ + /* + * find ratio of delta to delay length and quantize + * to same resolution as resampler + */ + delta /= length; /* convert delta from number of samples to a pitch ratio */ + delta = (s32)(delta * UNITY_PITCH); /* quantize to value microcode will use */ + delta = delta / UNITY_PITCH; + fratio = 1.0 - delta; /* pitch ratio needs to be centered around 1, not zero */ + + /* d->rs->delta is the difference between the fractional and integer value + * of the samples needed. fratio * incount + rs->delta gives the number of samples + * needed for this frame. + */ + fincount = d->rs->delta + (fratio * (f32)incount); + count = (s32) fincount; /* quantize to s32 */ + d->rs->delta = fincount - (f32)count; /* calculate the round off and store */ + + /* + * d->rsdelta is amount the out_ptr has deviated from its starting position. + * You calc the out_ptr by taking d->output - d->rsdelta, and then using the + * negative of that as an index into the delay buffer. loadBuffer that uses this + * value then bumps it up if it is below the delay buffer. + */ + out_ptr = &r->input[-(d->output - d->rsdelta)]; + ramalign = ((s32)out_ptr & 0x7) >> 1; /* calculate the number of samples needed + to align the buffer*/ +#ifdef _DEBUG +#if 0 + if(length > 0) { + if (length - d->rsdelta > (s32)r->length) { + __osError(ERR_ALMODDELAYOVERFLOW, 1, length - d->rsdelta - r->length); + } + } + else if(length < 0) { + if ((-length) - d->rsdelta > (s32)r->length) { + __osError(ERR_ALMODDELAYOVERFLOW, 1, (-length) - d->rsdelta - r->length); + } + } +#endif +#endif + /* load the rbuff with samples, note that there will be ramalign worth of + * samples at the begining which you don't care about. */ + ptr = _loadBuffer(r, out_ptr - ramalign, rbuff, count + ramalign, ptr); + + /* convert fratio to 16 bit fraction for microcode use */ + ratio = (s32)(fratio * UNITY_PITCH); + /* set the buffers, and do the resample */ + aSetBuffer(ptr++, 0, rbuff + (ramalign<<1), buff, incount<<1); + aResample(ptr++, d->rs->first, ratio, osVirtualToPhysical(d->rs->state)); + + d->rs->first = 0; /* turn off first time flag */ + d->rsdelta += count - incount; /* add the number of samples to d->rsdelta */ + } else { + out_ptr = &r->input[-d->output]; + ptr = _loadBuffer(r, out_ptr, buff, incount, ptr); + } + + return ptr; +} +/* + * This routine is for loading data from the delay line buff. If the + * address of curr_ptr < r->base, it will force it to be within r->base + * space, If the load goes past the end of r->base it will wrap around. + * Cause count bytes of data at curr_ptr (within the delay line) to be + * loaded into buff. (Buff is a dmem buffer) + */ +Acmd *_loadBuffer(ALFx *r, s16 *curr_ptr, s32 buff, s32 count, Acmd *p) +{ + Acmd *ptr = p; + s32 after_end, before_end; + s16 *updated_ptr, *delay_end; + +#ifdef AUD_PROFILE + lastCnt[++cnt_index] = osGetCount(); +#endif + + delay_end = &r->base[r->length]; + +#ifdef _DEBUG + if(curr_ptr > delay_end) + __osError(ERR_ALMODDELAYOVERFLOW, 1, delay_end - curr_ptr); +#endif + + if (curr_ptr < r->base) + curr_ptr += r->length; + updated_ptr = curr_ptr + count; + + if (updated_ptr > delay_end) { + after_end = updated_ptr - delay_end; + before_end = delay_end - curr_ptr; + + aSetBuffer(ptr++, 0, buff, 0, before_end<<1); + aLoadBuffer(ptr++, osVirtualToPhysical(curr_ptr)); + aSetBuffer(ptr++, 0, buff+(before_end<<1), 0, after_end<<1); + aLoadBuffer(ptr++, osVirtualToPhysical(r->base)); + } else { + aSetBuffer(ptr++, 0, buff, 0, count<<1); + aLoadBuffer(ptr++, osVirtualToPhysical(curr_ptr)); + } + + aSetBuffer(ptr++, 0, 0, 0, count<<1); + +#ifdef AUD_PROFILE + PROFILE_AUD(load_num, load_cnt, load_max, load_min); +#endif + return ptr; + +} + +/* + * This routine is for writing data to the delay line buff. If the + * address of curr_ptr < r->base, it will force it to be within r->base + * space. If the write goes past the end of r->base, it will wrap around + * Cause count bytes of data at buff to be written to delay line, curr_ptr. + */ +Acmd *_saveBuffer(ALFx *r, s16 *curr_ptr, s32 buff, s32 count, Acmd *p) +{ + Acmd *ptr = p; + s32 after_end, before_end; + s16 *updated_ptr, *delay_end; + +#ifdef AUD_PROFILE + lastCnt[++cnt_index] = osGetCount(); +#endif + + delay_end = &r->base[r->length]; + if (curr_ptr < r->base) /* probably just security */ + curr_ptr += r->length; /* shouldn't occur */ + updated_ptr = curr_ptr + count; + + if (updated_ptr > delay_end) { /* if the data wraps past end of r->base */ + after_end = updated_ptr - delay_end; + before_end = delay_end - curr_ptr; + + aSetBuffer(ptr++, 0, 0, buff, before_end<<1); + aSaveBuffer(ptr++, osVirtualToPhysical(curr_ptr)); + aSetBuffer(ptr++, 0, 0, buff+(before_end<<1), after_end<<1); + aSaveBuffer(ptr++, osVirtualToPhysical(r->base)); + aSetBuffer(ptr++, 0, 0, 0, count<<1); + } else { + aSetBuffer(ptr++, 0, 0, buff, count<<1); + aSaveBuffer(ptr++, osVirtualToPhysical(curr_ptr)); + } + +#ifdef AUD_PROFILE + PROFILE_AUD(save_num, save_cnt, save_max, save_min); +#endif + return ptr; + +} + +Acmd *_filterBuffer(ALLowPass *lp, s32 buff, s32 count, Acmd *p) +{ + Acmd *ptr = p; + + aSetBuffer(ptr++, 0, buff, buff, count<<1); + aLoadADPCM(ptr++, 32, osVirtualToPhysical(lp->fcvec.fccoef)); + aPoleFilter(ptr++, lp->first, lp->fgain, osVirtualToPhysical(lp->fstate)); + lp->first = 0; + + return ptr; +} + + + +/* + * Generate a triangle wave from -1 to 1, and find the current position + * in the wave. (Rate of the wave is controlled by d->rsinc, which is chorus + * rate) Multiply the current triangle wave value by d->rsgain, (chorus depth) + * which is expressed in number of samples back from output pointer the chorus + * should go at it's full chorus. In otherwords, this function returns a number + * of samples the output pointer should modulate backwards. + */ +f32 _doModFunc(ALDelay *d, s32 count) +{ + f32 val; + + /* + * generate bipolar sawtooth + * from -RANGE to +RANGE + */ + d->rsval += d->rsinc * count; + d->rsval = (d->rsval > RANGE) ? d->rsval-(RANGE*2) : d->rsval; + + /* + * convert to monopolar triangle + * from 0 to RANGE + */ + val = d->rsval; + val = (val < 0) ? -val : val; + + /* + * convert to bipolar triangle + * from -1 to 1 + */ + val -= RANGE/2; + + return(d->rsgain * val); +} diff --git a/src/core1/done/audio/save.c b/src/core1/done/audio/save.c new file mode 100644 index 00000000..7d8754d4 --- /dev/null +++ b/src/core1/done/audio/save.c @@ -0,0 +1,41 @@ +#include +#include "synthInternals.h" + +Acmd *alSavePull(void *filter, s16 *outp, s32 outCount, s32 sampleOffset, + Acmd *p) + +{ + Acmd *ptr = p; + ALSave *f = (ALSave *)filter; + ALFilter *source = f->filter.source; + + ptr = (*source->handler)(source, outp, outCount, sampleOffset, ptr); + + aSetBuffer (ptr++, 0, 0, 0, outCount<<1); + aInterleave(ptr++, AL_MAIN_L_OUT, AL_MAIN_R_OUT); + aSetBuffer (ptr++, 0, 0, 0, outCount<<2); + aSaveBuffer(ptr++, f->dramout); + return ptr; +} + +s32 alSaveParam(void *filter, s32 paramID, void *param) +{ + ALSave *a = (ALSave *) filter; + ALFilter *f = (ALFilter *) filter; + s32 pp = (s32) param; + + switch (paramID) { + case (AL_FILTER_SET_SOURCE): + f->source = (ALFilter *) param; + break; + + case (AL_FILTER_SET_DRAM): + a->dramout = pp; + break; + + default: + break; + } + return 0; + +} diff --git a/src/core1/done/audio/seq.c b/src/core1/done/audio/seq.c new file mode 100644 index 00000000..496de64a --- /dev/null +++ b/src/core1/done/audio/seq.c @@ -0,0 +1,309 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f64 D_80278D50; +extern f64 D_80278D58; + +#define IFF_FILE_HDR 0x4d546864 /* 'MThd' */ +#define IFF_TRACK_HDR 0x4d54726b /* 'MTrk' */ + +static s32 readVarLen(ALSeq *s); +static u8 read8(ALSeq *s); +static s16 read16(ALSeq *s); +static s32 read32(ALSeq *s); + +void alSeqNew(ALSeq *seq, u8 *ptr, s32 len) +{ + /* + * load the seqence pointed to by ptr + */ + seq->base = ptr; + seq->len = len; + seq->lastStatus = 0; + seq->lastTicks = 0; + seq->curPtr = ptr; + + if (read32(seq) != IFF_FILE_HDR) { +#ifdef _DEBUG + __osError(ERR_ALSEQNOTMIDI, 1, ptr); +#endif + return; + } + + read32(seq); /* skip the length field */ + + if (read16(seq) != 0) { +#ifdef _DEBUG + __osError(ERR_ALSEQNOTMIDI0, 1, ptr); +#endif + return; + } + + if (read16(seq) != 1) { +#ifdef _DEBUG + __osError(ERR_ALSEQNUMTRACKS, 1, ptr); +#endif + return; + } + + seq->division = read16(seq); + if (seq->division & 0x8000) { +#ifdef _DEBUG + __osError(ERR_ALSEQTIME, 1, ptr); +#endif + return; + } + + seq->qnpt = 1.0/(f32)seq->division; + + if (read32(seq) != IFF_TRACK_HDR) { +#ifdef _DEBUG + __osError(ERR_ALSEQTRACKHDR, 1, ptr); +#endif + return; + } + + read32(seq); /* skip the length field */ + + seq->trackStart = seq->curPtr; +} + +void alSeqNextEvent(ALSeq *seq, ALEvent *event) +{ + u8 status; + s16 delta; + s32 len; + s32 deltaTicks; + s32 i; + +#ifdef _DEBUG + /* sct 1/17/96 - Warn if curPtr is beyond the end of sequence. */ + if (seq->curPtr >= seq->base + seq->len) + __osError(ERR_ALSEQOVERRUN, 0); +#endif + + deltaTicks = readVarLen(seq); /* read the delta time */ + seq->lastTicks += deltaTicks; + status = read8(seq); + +#if _DEBUG + /* + * System exclusives are not supported, so just skip them and read + * the next event + */ + if ((status == 0xf0) || (status == 0xf7)) { + __osError(ERR_ALSEQSYSEX, 0); + len = readVarLen(seq); + for (i = 0; i < len; i++) { + read8(seq); + } + alSeqNextEvent(seq,event); + return; + } +#endif + + if (status == AL_MIDI_Meta) { + u8 type = read8(seq); + + if (type == AL_MIDI_META_TEMPO) { + event->type = AL_TEMPO_EVT; + event->msg.tempo.ticks = deltaTicks; + event->msg.tempo.status = status; + event->msg.tempo.type = type; + event->msg.tempo.len = read8(seq); + event->msg.tempo.byte1 = read8(seq); + event->msg.tempo.byte2 = read8(seq); + event->msg.tempo.byte3 = read8(seq); + } else if (type == AL_MIDI_META_EOT) { + event->type = AL_SEQ_END_EVT; + event->msg.end.ticks = deltaTicks; + event->msg.end.status = status; + event->msg.end.type = type; + event->msg.end.len = read8(seq); + } else { +#ifdef _DEBUG + __osError(ERR_ALSEQMETA, 1, type); + len = readVarLen(seq); + for (i = 0; i < len; i++) { + read8(seq); + } + alSeqNextEvent(seq,event); + return; +#endif + } + + seq->lastStatus = 0; + + } else { + event->type = AL_SEQ_MIDI_EVT; + event->msg.midi.ticks = deltaTicks; + if (status & 0x80) { + event->msg.midi.status = status; + event->msg.midi.byte1 = read8(seq); + seq->lastStatus = status; + } else { + /* running status */ + event->msg.midi.status = seq->lastStatus; + event->msg.midi.byte1 = status; + } + + if (((event->msg.midi.status & 0xf0) != AL_MIDI_ProgramChange) && + ((event->msg.midi.status & 0xf0) != AL_MIDI_ChannelPressure)) { + event->msg.midi.byte2 = read8(seq); + } else { + event->msg.midi.byte2 = 0; + } + } +} + + +/* + Returns the delta time in ticks for the next event in the sequence. + Assumes that the sequence data pointer is pointing to the delta time. + + If the curPtr is at or beyond the end of the sequence, then return FALSE + to indicate no next event. + sct 11/6/95 +*/ +char __alSeqNextDelta (ALSeq *seq, s32 *pDeltaTicks) +{ + u8 * savedPtr; + + /* sct 1/16/96 - Put in safety check here to make sure we don't read past sequence data. */ + if (seq->curPtr >= seq->base + seq->len) + return FALSE; + + savedPtr = seq->curPtr; + *pDeltaTicks = readVarLen(seq); /* read the delta time */ + seq->curPtr = savedPtr; + + return TRUE; +} + +f32 alSeqTicksToSec(ALSeq *seq, s32 ticks, u32 tempo) +{ + return ((f32) (((f32)(ticks) * (f32)(tempo)) / + ((f32)(seq->division) * 1000000.0))); +} + +u32 alSeqSecToTicks(ALSeq *seq, f32 sec, u32 tempo) +{ + return (u32)(((sec * 1000000.0) * seq->division) / tempo); +} + +void alSeqNewMarker(ALSeq *seq, ALSeqMarker *m, u32 ticks) +{ + ALEvent evt; + u8 *savePtr, *lastPtr; + s32 saveTicks, lastTicks; + s16 saveStatus, lastStatus; + + /* does not check that ticks is within bounds */ + + if (ticks == 0) { /* common case */ + m->curPtr = seq->trackStart; + m->lastStatus = 0; + m->lastTicks = 0; + m->curTicks = 0; + return; + } else { + savePtr = seq->curPtr; + saveStatus = seq->lastStatus; + saveTicks = seq->lastTicks; + + seq->curPtr = seq->trackStart; + seq->lastStatus = 0; + seq->lastTicks = 0; + + do { + lastPtr = seq->curPtr; + lastStatus = seq->lastStatus; + lastTicks = seq->lastTicks; + + alSeqNextEvent(seq, &evt); + + if (evt.type == AL_SEQ_END_EVT) + { + lastPtr = seq->curPtr; + lastStatus = seq->lastStatus; + lastTicks = seq->lastTicks; + break; + } + + } while (seq->lastTicks < ticks); + + m->curPtr = lastPtr; + m->lastStatus = lastStatus; + m->lastTicks = lastTicks; + m->curTicks = seq->lastTicks; /* Used by test loop condition. */ + + seq->curPtr = savePtr; + seq->lastStatus = saveStatus; + seq->lastTicks = saveTicks; + + } +} + +s32 alSeqGetTicks(ALSeq *seq){ + return seq->lastTicks; +} + +void alSeqSetLoc(ALSeq *seq, ALSeqMarker *m){ + seq->curPtr = m->curPtr; + seq->lastStatus = m->lastStatus; + seq->lastTicks = m->lastTicks; +} + +void alSeqGetLoc(ALSeq *seq, ALSeqMarker *m){ + m->curPtr = seq->curPtr; + m->lastStatus = seq->lastStatus; + m->lastTicks = seq->lastTicks; +} + +/* non-aligned byte reading routines */ +static u8 read8(ALSeq *seq) +{ + return *seq->curPtr++; +} + +static s16 read16(ALSeq *seq) +{ + s16 tmp; + + tmp = *seq->curPtr++ << 8; + tmp |= *seq->curPtr++; + + return tmp; +} + +static s32 read32(ALSeq *seq) +{ + s32 tmp; + + tmp = *seq->curPtr++ << 24; + tmp |= *seq->curPtr++ << 16; + tmp |= *seq->curPtr++ << 8; + tmp |= *seq->curPtr++; + + return tmp; +} + +static s32 readVarLen(ALSeq *seq) +{ + s32 value; + s32 c; + + c = *seq->curPtr++; + value = c; + if ( c & 0x80 ) { + value &= 0x7f; + do { + c = *seq->curPtr++; + value = (value << 7) + (c & 0x7f); + } while (c & 0x80); + } + return (value); +} + + diff --git a/src/core1/done/audio/sl.c b/src/core1/done/audio/sl.c new file mode 100644 index 00000000..9242ece5 --- /dev/null +++ b/src/core1/done/audio/sl.c @@ -0,0 +1,38 @@ +#include +#include "functions.h" +#include "variables.h" + +void alInit(ALGlobals *g, ALSynConfig *c){ + if (!alGlobals) { /* already initialized? */ + alGlobals = g; + alSynNew(&alGlobals->drvr, c); + } +} + +void alClose(ALGlobals *glob) +{ + if (alGlobals) { + alSynDelete(&glob->drvr); + alGlobals = 0; + } +} + +void alLink(ALLink *ln, ALLink *to){ + ln->next = to->next; + ln->prev = to; + if (to->next) + to->next->prev = ln; + to->next = ln; +} + +void alUnlink(ALLink *ln){ + if (ln->next) + ln->next->prev = ln->prev; + if (ln->prev) + ln->prev->next = ln->next; +} + + + + + diff --git a/src/core1/done/audio/synallocfx.c b/src/core1/done/audio/synallocfx.c new file mode 100644 index 00000000..fca6277b --- /dev/null +++ b/src/core1/done/audio/synallocfx.c @@ -0,0 +1,12 @@ +#include +#include "synthInternals.h" + +ALFxRef *alSynAllocFX(ALSynth *s, s16 bus, ALSynConfig *c, ALHeap *hp) +{ + alFxNew(&s->auxBus[bus].fx[0], c, hp); + alFxParam(&s->auxBus[bus].fx[0], AL_FILTER_SET_SOURCE, + &s->auxBus[bus]); + alMainBusParam(s->mainBus, AL_FILTER_ADD_SOURCE,&s->auxBus[bus].fx[0]); + + return (ALFxRef)(&s->auxBus[bus].fx[0]); +} diff --git a/src/core1/done/audio/syndelete.c b/src/core1/done/audio/syndelete.c new file mode 100644 index 00000000..8a30c697 --- /dev/null +++ b/src/core1/done/audio/syndelete.c @@ -0,0 +1,6 @@ +#include + +void alSynDelete(ALSynth *drvr) +{ + drvr->head = 0; +} diff --git a/src/core1/done/audio/synthesizer.c b/src/core1/done/audio/synthesizer.c new file mode 100644 index 00000000..3e56a21c --- /dev/null +++ b/src/core1/done/audio/synthesizer.c @@ -0,0 +1,303 @@ +#include +#include "synthInternals.h" + +#ifdef AUD_PROFILE +#include +extern u32 cnt_index, drvr_num, drvr_cnt, drvr_max, drvr_min, lastCnt[]; +extern u32 client_num, client_cnt, client_max, client_min; +#endif + +#ifndef MIN +# define MIN(a,b) (((a)<(b))?(a):(b)) +#endif + +#ifndef assert +#define assert(s) +#endif + +static s32 __nextSampleTime(ALSynth *drvr, ALPlayer **client); +static s32 _timeToSamplesNoRound(ALSynth *ALSynth, s32 micros); + +/*********************************************************************** + * Synthesis driver public interfaces + ***********************************************************************/ +void alSynNew(ALSynth *drvr, ALSynConfig *c) +{ + s32 i; + ALVoice *vv; + PVoice *pv; + ALVoice *vvoices; + PVoice *pvoices; + ALHeap *hp = c->heap; + ALSave *save; + ALFilter *sources; + ALParam *params; + ALParam *paramPtr; + + drvr->head = NULL; + drvr->numPVoices = c->maxPVoices; + drvr->curSamples = 0; + drvr->paramSamples = 0; + drvr->outputRate = c->outputRate; + drvr->maxOutSamples = AL_MAX_RSP_SAMPLES; + drvr->dma = (ALDMANew) c->dmaproc; + + save = alHeapAlloc(hp, 1, sizeof(ALSave)); + alSaveNew(save); + drvr->outputFilter = (ALFilter *)save; + + /* + * allocate and initialize the auxilliary effects bus. at present + * we only support 1 effects bus. + */ + drvr->auxBus = alHeapAlloc(hp, 1, sizeof(ALAuxBus)); + drvr->maxAuxBusses = 1; + sources = alHeapAlloc(hp, c->maxPVoices, sizeof(ALFilter *)); + alAuxBusNew(drvr->auxBus, sources, c->maxPVoices); + + /* + * allocate and initialize the main bus. + */ + drvr->mainBus = alHeapAlloc(hp, 1, sizeof(ALMainBus)); + sources = alHeapAlloc(hp, c->maxPVoices, sizeof(ALFilter *)); + alMainBusNew(drvr->mainBus, sources, c->maxPVoices); + + if (c->fxType != AL_FX_NONE){ + /* + * Allocate an effect and set parameters + */ + alSynAllocFX(drvr, 0, c, hp); + } else + /* + * Connect the aux bus to the main bus + */ + alMainBusParam(drvr->mainBus, AL_FILTER_ADD_SOURCE, &drvr->auxBus[0]); + + /* + * Build the physical voice lists + */ + drvr->pFreeList.next = 0; + drvr->pFreeList.prev = 0; + drvr->pLameList.next = 0; + drvr->pLameList.prev = 0; + drvr->pAllocList.next = 0; + drvr->pAllocList.prev = 0; + + pvoices = alHeapAlloc(hp, c->maxPVoices, sizeof(PVoice)); + for (i = 0; i < c->maxPVoices; i++) { + pv = &pvoices[i]; + alLink((ALLink *)pv, &drvr->pFreeList); + pv->vvoice = 0; + + alLoadNew(&pv->decoder, drvr->dma, hp); + alLoadParam(&pv->decoder, AL_FILTER_SET_SOURCE, 0); + + alResampleNew(&pv->resampler, hp); + alResampleParam(&pv->resampler, AL_FILTER_SET_SOURCE, &pv->decoder); + + alEnvmixerNew(&pv->envmixer, hp); + alEnvmixerParam(&pv->envmixer, AL_FILTER_SET_SOURCE, &pv->resampler); + + alAuxBusParam(drvr->auxBus, AL_FILTER_ADD_SOURCE, &pv->envmixer); + + pv->channelKnob = (ALFilter *)&pv->envmixer; + } + + alSaveParam(save, AL_FILTER_SET_SOURCE, drvr->mainBus); + + /* + * build the parameter update list + */ + params = alHeapAlloc(hp, c->maxUpdates, sizeof(ALParam)); + drvr->paramList = 0; + for (i = 0; i < c->maxUpdates; i++) { + paramPtr= ¶ms[i]; + paramPtr->next = drvr->paramList; + drvr->paramList = paramPtr; + } + + drvr->heap = hp; +} + +/* + * slAudioFrame() is called every video frame, and is based on the video + * frame interrupt. It is assumed to be an accurate time source for the + * clients. + */ +Acmd *alAudioFrame(Acmd *cmdList, s32 *cmdLen, s16 *outBuf, s32 outLen) +{ + ALPlayer *client; + ALFilter *output; + ALSynth *drvr = &alGlobals->drvr; + s16 tmp = 0; /* Starting buffer in DMEM */ + Acmd *cmdlEnd = cmdList; + Acmd *cmdPtr; + s32 nOut; + s16 *lOutBuf = outBuf; + +#ifdef AUD_PROFILE + lastCnt[++cnt_index] = osGetCount(); +#endif + + if (drvr->head == 0) { + *cmdLen = 0; + return cmdList; /* nothing to do */ + } + + /* + * run down list of clients and execute callback if needed this + * subframe. Here we do all the work for the frame at the + * start. Time offsets that occur before the next frame are + * executed "early". + */ + +#ifdef AUD_PROFILE + lastCnt[++cnt_index] = osGetCount(); +#endif + + /* + * paramSamples = time of next parameter change. + * curSamples = current sample time. + * so paramSamples - curSamples is the time until the next parameter change. + * if the next parameter change occurs within this frame time (outLen), + * then call back the client that contains the parameter change. + * Note, paramSamples must be rounded down to 16 sample boundary for use + * during the client handler. + */ + + for (drvr->paramSamples = __nextSampleTime(drvr, &client); + drvr->paramSamples - drvr->curSamples < outLen; + drvr->paramSamples = __nextSampleTime(drvr, &client)) + { + drvr->paramSamples &= ~0xf; + client->samplesLeft += _timeToSamplesNoRound(drvr, (*client->handler)(client)); + } + + /* for safety's sake, always store paramSamples aligned to 16 sample boundary. + * this way, if an voice handler routine gets called outside the ALVoiceHandler + * routine (alSynAllocVoice) it will get timestamped with an aligned value and + * will be processed immediately next audio frame. + */ + drvr->paramSamples &= ~0xf; + + +#ifdef AUD_PROFILE + PROFILE_AUD(client_num, client_cnt, client_max, client_min); +#endif + + /* + * Now build the command list in small chunks + */ + while (outLen > 0){ + nOut = MIN(drvr->maxOutSamples, outLen); + + /* + * construct the command list for each physical voice by calling + * the head of the filter chain. + */ + cmdPtr = cmdlEnd; + aSegment(cmdPtr++, 0, 0); + output = drvr->outputFilter; + (*output->setParam)(output, AL_FILTER_SET_DRAM, lOutBuf); + cmdlEnd = (*output->handler)(output, &tmp, nOut, drvr->curSamples, + cmdPtr); + + outLen -= nOut; + lOutBuf += nOut<<1; /* For Stereo */ + drvr->curSamples += nOut; + + } + *cmdLen = (s32) (cmdlEnd - cmdList); + + _collectPVoices(drvr); /* collect free physical voices */ + +#ifdef AUD_PROFILE + PROFILE_AUD(drvr_num, drvr_cnt, drvr_max, drvr_min); +#endif + return cmdlEnd; +} + +/*********************************************************************** + * Synthesis driver private interfaces + ***********************************************************************/ + +ALParam *__allocParam() +{ + ALParam *update = 0; + ALSynth *drvr = &alGlobals->drvr; + + if (drvr->paramList) { + update = drvr->paramList; + drvr->paramList = drvr->paramList->next; + update->next = 0; + } + return update; +} + +void __freeParam(ALParam *param) +{ + ALSynth *drvr = &alGlobals->drvr; + param->next = drvr->paramList; + drvr->paramList = param; +} + +void _collectPVoices(ALSynth *drvr) +{ + ALLink *dl; + PVoice *pv; + + while ((dl = drvr->pLameList.next) != 0) { + pv = (PVoice *)dl; + + /* ### remove from mixer */ + + alUnlink(dl); + alLink(dl, &drvr->pFreeList); + } +} + +void _freePVoice(ALSynth *drvr, PVoice *pvoice) +{ + /* + * move the voice from the allocated list to the lame list + */ + alUnlink((ALLink *)pvoice); + alLink((ALLink *)pvoice, &drvr->pLameList); +} + + +/* + Add 0.5 to adjust the average affect of + the truncation error produced by casting + a float to an int. +*/ +s32 _timeToSamplesNoRound(ALSynth *synth, s32 micros) +{ + f32 tmp = ((f32)micros) * synth->outputRate / 1000000.0 + 0.5; + + return (s32)tmp; +} + +s32 _timeToSamples(ALSynth *synth, s32 micros) +{ + return _timeToSamplesNoRound(synth, micros) & ~0xf; +} + +static s32 __nextSampleTime(ALSynth *drvr, ALPlayer **client) +{ + ALMicroTime delta = 0x7fffffff; /* max delta for s32 */ + ALPlayer *cl; + + assert(drvr->head); + *client = 0; + + for (cl = drvr->head; cl != 0; cl = cl->next) { + if ((cl->samplesLeft - drvr->curSamples) < delta) { + *client = cl; + delta = cl->samplesLeft - drvr->curSamples; + } + } + + return (*client)->samplesLeft; +} + diff --git a/src/core1/done/code_1D590.c b/src/core1/done/code_1D590.c new file mode 100644 index 00000000..4d2e8c18 --- /dev/null +++ b/src/core1/done/code_1D590.c @@ -0,0 +1,15 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_8025AFB0(void) {} + +void func_8025AFB8(void) {} + +void func_8025AFC0(Gfx **arg0, Mtx **arg1, Vtx **arg2) {} + +s32 func_8025AFD0(void) +{ + return 0; +} diff --git a/src/core1/done/code_1E360.c b/src/core1/done/code_1E360.c new file mode 100644 index 00000000..7db3a0f8 --- /dev/null +++ b/src/core1/done/code_1E360.c @@ -0,0 +1,133 @@ +#include +#include "functions.h" +#include "variables.h" +#include "SnS.h" + +/** + * An index used to track the position in the incoming payload + * we should read the next key from. + */ +extern s32 snsPayloadInCurrPos; + +/** + * An index used to track the position in the outgoing payload + * it should write the next key to. + */ +extern s32 snsPayloadOutCurrPos; + + +struct SnsPayload *snspayload_init_new_payload(struct SnsPayload *payload) +{ + u32 i; + + payload->magic = SNS_HEADER_MAGIC; + + for (i = 0; i < SNS_PAYLOAD_DATALEN; i++) + payload->data[i] = 0; + + payload->pad = 0; + + snspayload_calc_checksum(payload); + + return payload; +} + +void snspayload_set_key_at_idx(struct SnsPayload *payload, s32 idx, s32 key) +{ + payload->data[idx] = key; + snspayload_calc_checksum(payload); +} + +void snspayload_calc_checksum(struct SnsPayload *payload) +{ + glcrc_calc_checksum(payload, &payload->checksum, payload->checksum); +} + +bool snspayload_validate(struct SnsPayload *payload) +{ + u32 checksum[2]; + + glcrc_calc_checksum(payload, payload->checksum, checksum); + + if ((payload->checksum[0] == checksum[0]) && (payload->checksum[1] == checksum[1])) + return TRUE; + + return FALSE; +} + +struct SnsPayload *snspayload_find_payload_in_ram(void) +{ + struct SnsPayload *payload; + + for (payload = (struct SnsPayload *)0x80000000; payload < (struct SnsPayload *)0x80400080; payload++) + if (payload->magic == SNS_HEADER_MAGIC && snspayload_validate(payload)) + return payload; + + return NULL; +} + +s32 snspayload_contains_key(struct SnsPayload *payload, s32 key) +{ + u32 i; + + for (i = 0; i < SNS_PAYLOAD_DATALEN; i++) + if (payload->data[i] == key) + return key; + + return 0; +} + +s32 snspayload_get_key_in_range(struct SnsPayload *payload, s32 min, s32 max) +{ + s32 i; + + for (i = 0; i < SNS_PAYLOAD_DATALEN; i++) + { + if (payload->data[i] < min) + continue; + + if (payload->data[i] > max) + continue; + + return payload->data[i]; + } + + return 0; +} + +void snspayload_rewind_incoming(void) +{ + snsPayloadInCurrPos = 0; +} + +u32 snspayload_get_next_key(struct SnsPayload *payload) +{ + while (snsPayloadInCurrPos < SNS_PAYLOAD_DATALEN) + { + if (payload->data[snsPayloadInCurrPos]) + return payload->data[snsPayloadInCurrPos++]; + + snsPayloadInCurrPos++; + } + + return 0; +} + +void snspayload_rewind_outgoing(void) +{ + snsPayloadOutCurrPos = 0; +} + +void snspayload_append_key_to_outgoing_payload(struct SnsPayload *payload, s32 key) +{ + payload->data[snsPayloadOutCurrPos++] = key; +} + +void snspayload_finalise_outgoing_payload(struct SnsPayload *payload) +{ + while (snsPayloadOutCurrPos < SNS_PAYLOAD_DATALEN) + payload->data[snsPayloadOutCurrPos++] = 0; + + snspayload_calc_checksum(payload); +} + diff --git a/src/core1/done/code_1E8C0.c b/src/core1/done/code_1E8C0.c new file mode 100644 index 00000000..8c6fef8d --- /dev/null +++ b/src/core1/done/code_1E8C0.c @@ -0,0 +1,36 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "n_libaudio.h" + + +extern N_ALSynth *D_80276E80; +extern N_ALSynth *D_80276E84; + +void func_8025C2E0(s32 a0) +{ + if (D_80276E80) + { + func_8025F610(); + + D_80276E80 = NULL; + D_80276E84 = NULL; + } +} + +void func_8025C320(N_ALSynth *synth, ALSynConfig *config) +{ + if (D_80276E80 != NULL) + return; + + D_80276E80 = synth; + + if (D_80276E84 != NULL) + return; + + D_80276E84 = synth; + + n_alSynNew(config); +} + diff --git a/src/core1/done/code_CE60.c b/src/core1/done/code_CE60.c new file mode 100644 index 00000000..608793ea --- /dev/null +++ b/src/core1/done/code_CE60.c @@ -0,0 +1,651 @@ +#include +#include "functions.h" +#include "variables.h" +#include "SnS.h" + +typedef struct { + s16 x_min; + s16 x_max; + s16 y_min; + s16 y_max; + s16 z_min; + s16 z_max; +} Struct_Core1_CE60_0s; + +void func_80250530(s32, u16 chan_mask, f32); + +/* .data */ +extern s32 D_80275C10; +extern s32 D_80275C14; +extern u8 D_80275C18; +extern u8 D_80275C1C; +extern Struct_Core1_CE60_0s D_80275C20[]; + +/* .bss */ +s32 D_802806F0; +int D_802806F4; +s32 D_802806F8[4]; +s32 D_80280708[4]; + + +/* .code */ +void func_8024A880(s32 chan_mask){ + func_80250530(0, chan_mask, 3.0f); +} + +void func_8024A8AC(s32 chan_mask, f32 arg1){ + func_80250530(0, chan_mask, arg1); +} + +int func_8024A8DC(s32 arg0, s32 arg1, s32 arg2){ + return (arg0 - D_802806F8[0])*(arg0 - D_802806F8[0]) + (arg1 - D_802806F8[2])*(arg1 - D_802806F8[2]) < arg2*arg2; +} + +f32 func_8024A928(f32 arg0, f32 arg1){ + return gu_sqrtf((arg0 - D_802806F8[0])*(arg0 - D_802806F8[0]) + (arg1 - D_802806F8[2])*(arg1 - D_802806F8[2])); +} + +int func_8024A984(s32 arg0){ + func_802585E0(D_802806F8, D_80275C20[arg0].x_min, D_80275C20[arg0].y_min, D_80275C20[arg0].z_min, D_80275C20[arg0].x_max, D_80275C20[arg0].y_max, D_80275C20[arg0].z_max); +} + +void func_8024A9EC(s32 arg0){ + if(!func_8025ADBC(D_80280708[0]) && D_80280708[2]){ + func_8025A104(D_80280708[0], 0); + } + func_8025A55C(D_80280708[2], arg0 ? arg0 : 0x1f4, 4 ); + if(func_8025AD7C(D_80280708[1]) || D_80280708[3]){ + func_8025ABB8(D_80280708[1], D_80280708[3], arg0 ? arg0 : 0x1f4, 4 ); + }//L8024AA94 + func_8025A864(D_80280708[1]); +} + +void func_8024AAB0(void){ + f32 plyr_pos[3]; //sp34 + f32 sp30; + + func_8028EB3C(&D_802806F8); + player_getPosition(plyr_pos); + D_80280708[0] = func_8032274C(); + D_80280708[1] = func_80322758(); + D_80280708[2] = D_80280708[3] = 0; + if(0 <= D_80280708[0]) + D_80280708[2] = func_80250034(D_80280708[0]); + if(0 <= D_80280708[1]) + D_80280708[3] = func_80250034(D_80280708[1]); + switch(map_get()){ + case MAP_7_TTC_TREASURE_TROVE_COVE: //L8024ABA8 + D_80280708[2] = ml_map_f(4700 - D_802806F8[1], 0.0f, 900.0f, 0.0f, D_80280708[2]); + D_80280708[3] = ml_map_f(4700 - D_802806F8[1], 0.0f, 900.0f, D_80280708[3], 0.0f); + break; + case MAP_B_CC_CLANKERS_CAVERN: // + sp30 = func_8024A928(13909.0f, -26.0f); + D_80280708[2] = ml_map_f(sp30, 1500.0f, 1800.0f, 0.0f, D_80280708[2]); + D_80280708[3] = ml_map_f(sp30, 1500.0f, 1800.0f, D_80280708[3], 0.0f); + break; + case MAP_1_SM_SPIRAL_MOUNTAIN: //L8024ACC4 + if(func_8024A984(4)) + D_80280708[2] = 0; + else + D_80280708[3] = 0; + break; + case MAP_1B_MMM_MAD_MONSTER_MANSION: //L8024ACE4 + if(func_80309D58(plyr_pos, 1)){ + D_80280708[2] = 0; + } + else{ + D_80280708[3] = 0; + } + break; + case MAP_41_FP_BOGGYS_IGLOO: //L8024AD08 + if( jiggyscore_isCollected(JIGGY_2E_FP_PRESENTS) + || (levelSpecificFlags_get(0x11) && levelSpecificFlags_get(0x12) && levelSpecificFlags_get(0x13)) + ){ + D_80280708[2] = 0; + } + else{ + D_80280708[3] = 0; + } + break; + case MAP_1D_MMM_CELLAR: //L8024AD58 + if(sns_get_item_state(SNS_ITEM_EGG_CYAN, 1) && D_802806F8[0] >= 0x23A){ + D_80280708[2] = 0; + } + else{ + D_80280708[3] = 0; + } + break; + case MAP_7F_FP_WOZZAS_CAVE: //L8024AD8C + if(sns_get_item_state(SNS_ITEM_ICE_KEY, 1) && func_8024A8DC(0x619, 0x97a, 0x69a)){ + D_80280708[2] = 0; + } + else{ + D_80280708[3] = 0; + } + break; + case MAP_45_CCW_AUTUMN: //L8024ADC0 + case MAP_46_CCW_WINTER: //L8024ADC0 + if(func_8024A984(5)){ + D_80280708[2] = 0; + } + else{ + D_80280708[3] = 0; + } + break; + }//L8024ADE0 +} + +void func_8024ADF0(s32 arg0){ + func_8024AAB0(); + if(arg0) + func_8025A9D4(); + + if(0 < D_80280708[0] && 0 < D_80280708[2]) + func_8025A104(D_80280708[0], D_80280708[2]); + + if(0 < D_80280708[1] && 0 < D_80280708[3]) + func_8025A6CC(D_80280708[1], D_80280708[3]); +} + +void func_8024AE74(void){ + D_802806F0 = 0; + D_80275C10 = -1; + D_80275C14 = 0; + D_80275C1C = D_80275C18 = func_8024A8DC(0xb43, -0x2918, 0x1950) ? 1 : 0; +} + +void func_8024AED8(void){ + D_80275C10 = -1; + D_80275C14 = 0; + D_80275C18 = 0; + D_80275C1C = 0; +} + +void func_8024AF00(s32 arg0, s32 arg1){ + if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + func_8024A880(arg0); + } + else{ + func_8024A880(arg1); + } +} + +void func_8024AF48(void){ + + if(!D_802806F4) return; + if(func_803203FC(1)) return; + if(func_803203FC(0x1f)) return; + if(func_802D686C()) return; + if(func_8028F22C()) return; + if(gctransition_8030BDC0()) return; + if(getGameMode() == GAME_MODE_A_SNS_PICTURE) return; + + func_8028EB3C(D_802806F8); + func_8024AAB0(); + switch(map_get()){ + case MAP_2_MM_MUMBOS_MOUNTAIN: // L8024B000 + if(func_8024A8DC(-4450, 4550, 1900) ||func_8024A8DC(-0x1777, 0x1820, 0x26c)){ + func_8024A880(0x1cc0); + } + else if(func_8024A8DC(0x119F, -0x760, 0x7d0)){ + func_8024A880(0xb0c0); + } + else if(func_8024A8DC(0x12c, -0x35a, 0x898)){ + func_8024A880(0x513f); + } + else{ + func_8024AF00(0x200, 0x103f); + } + break; + + case MAP_7_TTC_TREASURE_TROVE_COVE: // L8024B094 + func_8024A9EC(0); + if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + func_8024A880(0x600); + } + else if(func_8024A8DC(-0x12C, 0x58c, 0x866) + || (func_8024A8DC(-0x12c, 0x58c, 0xc1c) + && D_802806F8[1] < 0x514 + && !func_8024A8DC(-0x49, 0x2c43, 0x1c0c) + && !func_8024A8DC(0x6c8, 0xe04, 0x1c7) + && !func_8024A8DC(0x564, 0xf9a, 0x190) + ) + ){ + func_8024A880(0x7800); + } + else{ + func_8024A880(0x60ff); + } + break; + + case MAP_B_CC_CLANKERS_CAVERN: // L8024B158 + func_8024A9EC(0); + if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + if(!(D_802806F8[1] < 0x28b)){ + func_8024A8AC(0x8180, 5.0f); + } + else{ + func_8024A8AC(0x3e00, 5.0f); + } + } + else{ + func_8024A880(0x407f); + } + break; + + case MAP_12_GV_GOBIS_VALLEY:// L8024B1BC + if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + func_8024A880(0x8020); + } + else if(func_8024A8DC(-0xf96, 0x1626, 0xe74)){ + func_8024A880(0x797f); + } + else{ + func_8024A880(0x67fe); + } + break; + + case MAP_3_UNUSED: // L8024B214 + func_8024AF00(0x1800, 0x67fe); + break; + + case MAP_5_TTC_BLUBBERS_SHIP: // L8024B228 + func_8024AF00(0x600, 0x7800); + break; + + case MAP_1_SM_SPIRAL_MOUNTAIN: // L8024B23C + if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + func_8024A880(0x9000); + } + else{ + if(func_802DA498()) + func_8024A9EC(0); + func_8024A880(0x6fff); + } + break; + + case MAP_21_CC_WITCH_SWITCH_ROOM:// L8024B288 + case MAP_22_CC_INSIDE_CLANKER:// L8024B288 + case MAP_23_CC_GOLDFEATHER_ROOM:// L8024B288 + func_8024AF00(0x3c00, 0x61ff); + break; + + case MAP_25_MMM_WELL:// L8024B29C + case MAP_2F_MMM_WATERDRAIN_BARREL:// L8024B29C + func_8024AF00(0x1000, 0xcfff); + break; + + case MAP_13_GV_MEMORY_GAME:// L8024B2B0 + case MAP_14_GV_SANDYBUTTS_MAZE:// L8024B2B0 + case MAP_15_GV_WATER_PYRAMID:// L8024B2B0 + case MAP_16_GV_RUBEES_CHAMBER:// L8024B2B0 + case MAP_1A_GV_INSIDE_JINXY:// L8024B2B0 + func_8024AF00(0x3ffe, 0x4ffe); + break; + + case MAP_1B_MMM_MAD_MONSTER_MANSION:// L8024B2C4 + if( !mapSpecificFlags_get(1) + && !func_8025AD7C(COMUSIC_4_MMM_CLOCK_VERSION) + && !func_8025AD7C(COMUSIC_3C_MINIGAME_LOSS) + ){ + func_8024A9EC(0); + } + + func_8024A880((mapSpecificFlags_get(1) ? 0x2000: 0) + 0xcfff); + break; + + case MAP_D_BGS_BUBBLEGLOOP_SWAMP: // L8024B328 + if( func_8024A8DC(0x762, -0x542, 0x578) + || func_8024A8DC(-0x85, 0x7d8, 0x384) + || func_8024A8DC(-0xe2d, -0x217, 0x578) + ){ + func_8024A8AC(0x2f4f, 2.0f); + } + else{ + func_8024A8AC(0x6f4f, 2.0f); + } + break; + + case MAP_31_RBB_RUSTY_BUCKET_BAY:// L8024B38C + if( (-4200 <= D_802806F8[0] && D_802806F8[0] < -3700) + && (-900 <= D_802806F8[2] && D_802806F8[2] < 900) + ){ + func_8024A880(0x51ff); + } + else{ + func_8024AF00(0x800, 0x71bf); + } + break; + + case MAP_35_RBB_WAREHOUSE:// L8024B3E8 + case MAP_36_RBB_BOATHOUSE:// L8024B3E8 + case MAP_37_RBB_CONTAINER_1:// L8024B3E8 + case MAP_38_RBB_CONTAINER_3:// L8024B3E8 + case MAP_3E_RBB_CONTAINER_2:// L8024B3E8 + func_8024AF00(0x800, 0xfe); + break; + + case MAP_40_CCW_HUB:// L8024B3FC + if(func_8024A8DC(0, 0, 0x802)){ + func_8024A8AC(7, 2.0f); + } + else if(0x5aa <= D_802806F8[2]){ + func_8024A8AC(0x407, 2.0f); + } + else if(D_802806F8[0] < -0x5a9){ + func_8024A8AC(0x707, 2.0f); + } + else if(D_802806F8[2] < -0x5a9){ + func_8024A8AC(0x1067, 2.0f); + } + else if(0x5aa <= D_802806F8[0]) { + func_8024A8AC(0x7007, 2.0f); + } + break; + + case MAP_A_TTC_SANDCASTLE: // L8024B4AC + func_8024AF00(0xCE, 0x3C); + break; + + case MAP_43_CCW_SPRING:// L8024B4C0 + func_8024AF00(0x400, 0x7bbf); + break; + + case MAP_45_CCW_AUTUMN:// L8024B4D4 + if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + func_8024A880(0x600); + } + else{ + func_8024A9EC(0); + func_8024A880(0x7BEF); + } + break; + + case MAP_54_UNUSED:// L8024B510 + case MAP_55_UNUSED:// L8024B510 + case MAP_57_UNUSED:// L8024B510 + case MAP_58_UNUSED:// L8024B510 + case MAP_59_UNUSED:// L8024B510 + func_8024AF00(0xc, 0x307b); + break; + + case MAP_56_UNUSED:// L8024B524 + func_8024AF00(0x10, 0x4f6f); + break; + + case MAP_27_FP_FREEZEEZY_PEAK:// L8024B538 + if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + func_8024A880(0x400); + } + else if( mapSpecificFlags_get(0) && !jiggyscore_isCollected(JIGGY_2F_FP_XMAS_TREE)){ + func_8024A880(0x4bff); + } + else{ + func_8024A880(0x43ff); + } + break; + + case MAP_65_CCW_SPRING_WHIPCRACK_ROOM:// L8024B59C + func_8024A880(0x107); + break; + + case MAP_66_CCW_SUMMER_WHIPCRACK_ROOM:// L8024B5AC + func_8024A880(0x1C7); + break; + + case MAP_67_CCW_AUTUMN_WHIPCRACK_ROOM:// L8024B5BC + func_8024A880(0xC07); + break; + + case MAP_68_CCW_WINTER_WHIPCRACK_ROOM:// L8024B5CC + func_8024A880(0x1407); + break; + + case MAP_5E_CCW_SPRING_NABNUTS_HOUSE:// L8024B5DC + func_8024A880(0x41fe); + break; + + case MAP_5F_CCW_SUMMER_NABNUTS_HOUSE:// L8024B5EC + func_8024A880(0x71fe); + break; + + case MAP_60_CCW_AUTUMN_NABNUTS_HOUSE:// L8024B5FC + func_8024A880(0x7fe); + break; + + case MAP_61_CCW_WINTER_NABNUTS_HOUSE:// L8024B60C + func_8024A880(0xbfe); + break; + + case MAP_63_CCW_AUTUMN_NABNUTS_WATER_SUPPLY:// L8024B61C + func_8024AF00(1, 0x7fe); + break; + + case MAP_64_CCW_WINTER_NABNUTS_WATER_SUPPLY:// L8024B630 + func_8024AF00(1, 0xbfe); + break; + + case MAP_69_GL_MM_LOBBY:// L8024B644 + if(func_8024A8DC(0xdb6, -0x65e, 0x4e2)) + func_8024A880(0x7c00); + else + func_8024A880(0x41ff); + break; + + case MAP_6A_GL_TTC_AND_CC_PUZZLE:// L8024B67C + if(0x2b8 <= D_802806F8[1] && func_8024A8DC(-0x615, -0x389, 0x1dd)){ + func_8024A880(0x8e40); + } + else if(func_8024A8DC(0x5dc, -0x37a, 0x226) || func_8024A8DC(0x754, -0x453, 0x172)){ + func_8024A880(0xf040); + } + else{ + func_8024A880(0x81ff); + } + break; + + case MAP_6B_GL_180_NOTE_DOOR:// L8024B704 + if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + func_8024A880(0x8800); + } + else if(func_8024A8DC(0x10eb, 0x4f5, 0x730)) { + func_8024A880(0x8640); + } + else if(func_8024A8DC(-0x526, 0x777, 0x125) || func_8024A8DC(-0x515, 0x878, 0xea)){ + func_8024A880(0xf000); + }else{ + func_8024A880(0x81bf); + } + + break; + + case MAP_6C_GL_RED_CAULDRON_ROOM:// L8024B794 + func_8024A880(0x81bf); + break; + + case MAP_6D_GL_TTC_LOBBY:// L8024B7A4 + func_8024A880(0xf000); + break; + + case MAP_70_GL_CC_LOBBY:// L8024B7B4 + if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + func_8024A880(0x8100); + } + else if(func_8024A8DC(-0x19d6, -0x1d3, 0x71e)){ + func_8024A880(0xf047); + } + else{ + func_8024A880(0x8e41); + } + break; + + case MAP_6E_GL_GV_LOBBY:// L8024B80C + if(func_8024A8DC(0, -0x1996, 0xe42)){ + func_8024A880(0xfe00); + } + else{ + func_8024A880(0x81ff); + } + break; + + case MAP_6F_GL_FP_LOBBY:// L8024B844 + if(0xe75 <= D_802806F8[2]){ + func_8024A880(0xe040); + } + else{ + func_8024A880(0x81bf); + } + break; + + case MAP_74_GL_GV_PUZZLE:// L8024B878 + if(func_8024A8DC(-0xa49, -0x1f, 0x203)){ + func_8024A880(0xe600); + } + else{ + func_8024A880(0x81ff); + } + break; + + case MAP_75_GL_MMM_LOBBY:// L8024B8B0 + case MAP_7A_GL_CRYPT:// L8024B8B0 + func_8024A880(0xd800); + break; + + case MAP_71_GL_STATUE_ROOM:// L8024B8C0 + if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + func_8024A880(0x200); + } + else if(func_8024A8DC(-0xf0e, -0x15a, 0x302)){ + func_8024A880(0x9c00); + } + else{ + func_8024A880(0x81bf); + } + break; + + case MAP_72_GL_BGS_LOBBY:// L8024B918 + if(D_80275C10 == -1 && D_80275C18 == 0){ + D_80275C10 = func_802F9AA8(0x410); + func_802F9F80(D_80275C10, 3.0f, 16777216.0f, 0.0f); + func_802FA060(D_80275C10, 3500, 3500, 0.0f); + + D_80275C14 = func_802F9AA8(0x411); + func_802F9F80(D_80275C14, 3.0f, 16777216.0f, 0.0f); + func_802FA060(D_80275C14, 3500, 3500, 0.0f); + }//L8024B9BC + + if(D_80275C1C != D_80275C18){ + D_80275C1C = D_80275C18; + if(D_80275C18){ + func_802F9FD0(D_80275C10, 0.0f, 0.0f, 3.0f); + func_802F9FD0(D_80275C14, 0.0f, 0.0f, 3.0f); + D_80275C10 = -1; + D_80275C14 = 0; + } + }//L8024BA2C + if(func_8024A8DC(0xb43, -0x2918, 0x1950)){ + D_80275C18 = 1; + func_8024A880(0xe040); + } + else{ + D_80275C18 = 0; + func_8024A880(0x9c00); + } + break; + + case MAP_76_GL_640_NOTE_DOOR:// L8024BA70 + func_8024AF00(0x8200, 0x81bf); + break; + + case MAP_77_GL_RBB_LOBBY:// L8024BA84 + func_8024AF00(0x8200, 0xf000); + break; + + case MAP_78_GL_RBB_AND_MMM_PUZZLE:// L8024BA98 + if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + func_8024A880(0x8200); + } + else if(0x15a <= D_802806F8[1] && func_8024A8DC(-0x89a, 0x21a, 0x368)){ + func_8024A880(0x8C00); + } + else if(func_8024A8DC(-0x36, 0x14, 0xa5c)){ + func_8024A880(0x81bf); + } + else{ + func_8024A880(0xf000); + } + break; + + case MAP_79_GL_CCW_LOBBY:// L8024BB2C + if(0x31c <= D_802806F8[1] && D_802806F8[1] < 0x44c && func_8024A8DC(0x1c, 0x11c9, 0x431)) + func_8024A880(0x81bf); + else if(-4 <= D_802806F8[1] && D_802806F8[1] < 0x168 && func_8024A8DC(0x87, 0x1373, 0x86c)) + func_8024A880(0x81bf); + else + func_8024A880(0x9e00); + break; + + case MAP_80_GL_FF_ENTRANCE:// L8024BBBC + if(D_802806F8[2] < 0x4e2) + func_8024A880(0xe040); + else + func_8024A880(0x9e00); + break; + + case MAP_7F_FP_WOZZAS_CAVE:// L8024BBF0 + func_8024A9EC((sns_get_item_state(SNS_ITEM_ICE_KEY, 1) && func_8024A8DC(0x619, 0x97a, 0x69a))? 0x7ff8 : 0); + func_8024AF00(0x20, 0x1f); + break; + + case MAP_8B_RBB_ANCHOR_ROOM:// L8024BC40 + func_8024AF00(0x800, 0x51ff); + break; + + case MAP_34_RBB_ENGINE_ROOM:// L8024BC54 + func_8024AF00(0x800, 0x43fe); + break; + + case MAP_91_FILE_SELECT:// L8024BC68 + if(!func_802C5A30()){ + func_8024A8AC(0x200, 0.5f); + } + else{ + func_8024A8AC(0x1ff, 0.5f); + } + break; + + case MAP_8C_SM_BANJOS_HOUSE:// L8024BC9C + func_8024A8AC(0x1ff, 0.5f); + break; + + case MAP_1D_MMM_CELLAR:// L8024BCB0 + func_8024A9EC((sns_get_item_state(SNS_ITEM_EGG_CYAN, 1) && !(D_802806F8[0] < 0x23a))? 0x7ff8 : 0); + break; + + case MAP_46_CCW_WINTER:// L8024BCF0 + func_8024A9EC(0); + break; + }//L8024BCF8 +} + +void func_8024BD08(s32 arg0){ + if(arg0){ + D_802806F0++; + } + else{ + D_802806F0--; + } +} + +void func_8024BD40(s32 arg0, s32 arg1){ + if(arg1 == 3){ + } + else{ + if(arg1 == 2){ + D_802806F4 = TRUE; + } + else{ + D_802806F4 = FALSE; + } + } +} diff --git a/src/core1/done/gu/guint.h b/src/core1/done/gu/guint.h new file mode 100644 index 00000000..c3206dd5 --- /dev/null +++ b/src/core1/done/gu/guint.h @@ -0,0 +1,42 @@ +/************************************************************************** + * * + * Copyright (C) 1994, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +#include "mbi.h" +#include "gu.h" + +typedef union +{ + struct + { + unsigned int hi; + unsigned int lo; + } word; + + double d; +} du; + +typedef union +{ + unsigned int i; + float f; +} fu; + +#ifndef __GL_GL_H__ + +typedef float Matrix[4][4]; + +#endif + +#define ROUND(d) (int)(((d) >= 0.0) ? ((d) + 0.5) : ((d) - 0.5)) +#define ABS(d) ((d) > 0) ? (d) : -(d) + +extern float __libm_qnan_f; diff --git a/src/core1/done/gu/normalize.c b/src/core1/done/gu/normalize.c new file mode 100644 index 00000000..99475210 --- /dev/null +++ b/src/core1/done/gu/normalize.c @@ -0,0 +1,15 @@ +#include +#include "functions.h" +#include "variables.h" + + +void guNormalize(float *x, float *y, float *z) +{ + float m; + + m = gu_sqrtf((*x)*(*x) + (*y)*(*y) + (*z)*(*z)); + m = (f32)1.0/ m; + *x *= m; + *y *= m; + *z *= m; +} diff --git a/src/core1/done/gu/ortho.c b/src/core1/done/gu/ortho.c new file mode 100644 index 00000000..71cb582a --- /dev/null +++ b/src/core1/done/gu/ortho.c @@ -0,0 +1,31 @@ +#include +#include "functions.h" +#include "variables.h" + + +void guOrthoF(float mf[4][4], float l, float r, float b, float t, float n, float f, float scale) +{ + int i, j; + + guMtxIdentF(mf); + + mf[0][0] = 2/(r-l); + mf[1][1] = 2/(t-b); + mf[2][2] = -2/(f-n); + mf[3][0] = -(r+l)/(r-l); + mf[3][1] = -(t+b)/(t-b); + mf[3][2] = -(f+n)/(f-n); + mf[3][3] = 1; + + for (i=0; i<4; i++) + for (j=0; j<4; j++) + mf[i][j] *= scale; +} + +void guOrtho(Mtx *m, float l, float r, float b, float t, float n, float f, float scale) +{ + float mf[4][4]; + + guOrthoF(mf, l, r, b, t, n, f, scale); + guMtxF2L(mf, m); +} diff --git a/src/core1/done/gu/sinf.c b/src/core1/done/gu/sinf.c new file mode 100644 index 00000000..c90c6f4c --- /dev/null +++ b/src/core1/done/gu/sinf.c @@ -0,0 +1,157 @@ +/************************************************************************** + * * + * Copyright (C) 1994, Silicon Graphics, Inc. * + * * + * These coded instructions, statements, and computer programs contain * + * unpublished proprietary information of Silicon Graphics, Inc., and * + * are protected by Federal copyright law. They may not be disclosed * + * to third parties or copied or duplicated in any form, in whole or * + * in part, without the prior written consent of Silicon Graphics, Inc. * + * * + **************************************************************************/ + +#include "guint.h" + +/* ==================================================================== + * ==================================================================== + * + * Module: fsin.c + * $Revision: 1.2 $ + * $Date: 1995/07/12 17:48:01 $ + * $Author: jeffd $ + * $Source: /disk6/Master/cvsmdev2/PR/libultra/gu/sinf.c,v $ + * + * Revision history: + * 09-Jun-93 - Original Version + * + * Description: source code for fsin function + * + * ==================================================================== + * ==================================================================== + */ + +#pragma weak fsin = __sinf +#pragma weak sinf = __sinf +#define fsin __sinf + +/* coefficients for polynomial approximation of sin on +/- pi/2 */ + +static const du P[] = +{ +{0x3ff00000, 0x00000000}, +{0xbfc55554, 0xbc83656d}, +{0x3f8110ed, 0x3804c2a0}, +{0xbf29f6ff, 0xeea56814}, +{0x3ec5dbdf, 0x0e314bfe}, +}; + +static const du rpi = +{0x3fd45f30, 0x6dc9c883}; + +static const du pihi = +{0x400921fb, 0x50000000}; + +static const du pilo = +{0x3e6110b4, 0x611a6263}; + +static const fu zero = {0x00000000}; + + +/* ==================================================================== + * + * FunctionName fsin + * + * Description computes sine of arg + * + * ==================================================================== + */ + +float +sinf( float x ) +{ +double dx, xsq, poly; +double dn; +int n; +double result; +int ix, xpt; + + + ix = *(int *)&x; + xpt = (ix >> 22); + xpt &= 0x1ff; + + /* xpt is exponent(x) + 1 bit of mantissa */ + + if ( xpt < 0xff ) + { + /* |x| < 1.5 */ + + dx = x; + + if ( xpt >= 0xe6 ) + { + /* |x| >= 2^(-12) */ + + /* compute sin(x) with a standard polynomial approximation */ + + xsq = dx*dx; + + poly = ((P[4].d*xsq + P[3].d)*xsq + P[2].d)*xsq + P[1].d; + + result = dx + (dx*xsq)*poly; + + return ( (float)result ); + } + + return ( x ); + } + + if ( xpt < 0x136 ) + { + /* |x| < 2^28 */ + + dx = x; + + /* reduce argument to +/- pi/2 */ + + dn = dx*rpi.d; + + n = ROUND(dn); + dn = n; + + dx = dx - dn*pihi.d; + dx = dx - dn*pilo.d; /* dx = x - n*pi */ + + /* compute sin(dx) as before, negating result if n is odd + */ + + xsq = dx*dx; + + poly = ((P[4].d*xsq + P[3].d)*xsq + P[2].d)*xsq + P[1].d; + + result = dx + (dx*xsq)*poly; + + + if ( (n & 1) == 0 ) + return ( (float)result ); + + return ( -(float)result ); + } + + if ( x != x ) + { + /* x is a NaN; return a quiet NaN */ + +#ifdef _IP_NAN_SETS_ERRNO + + *__errnoaddr = EDOM; +#endif + + return ( __libm_qnan_f ); + } + + /* just give up and return 0.0 */ + + return ( zero.f ); +} + diff --git a/src/core1/done/gu/sqrtf.c b/src/core1/done/gu/sqrtf.c new file mode 100644 index 00000000..017d1e4c --- /dev/null +++ b/src/core1/done/gu/sqrtf.c @@ -0,0 +1,8 @@ +#include +#include "functions.h" +#include "variables.h" + + +float gu_sqrtf(float val){ + return sqrtf(val); +} diff --git a/src/core1/done/gu/translate.c b/src/core1/done/gu/translate.c new file mode 100644 index 00000000..609d5bb0 --- /dev/null +++ b/src/core1/done/gu/translate.c @@ -0,0 +1,22 @@ +#include +#include "functions.h" +#include "variables.h" + + +void guTranslateF(float mf[4][4], float x, float y, float z) +{ + guMtxIdentF(mf); + + mf[3][0] = x; + mf[3][1] = y; + mf[3][2] = z; +} + + +void guTranslate(Mtx *m, float x, float y, float z) +{ + float mf[4][4]; + + guTranslateF(mf, x, y, z); + guMtxF2L(mf, m); +} diff --git a/src/core1/done/io/ai.c b/src/core1/done/io/ai.c new file mode 100644 index 00000000..4773f385 --- /dev/null +++ b/src/core1/done/io/ai.c @@ -0,0 +1,12 @@ +#include +#include + +s32 __osAiDeviceBusy(void) +{ + register s32 status = IO_READ(AI_STATUS_REG); + if (status & AI_STATUS_FIFO_FULL) + + return 1; + + return 0; +} diff --git a/src/core1/done/io/aigetlen.c b/src/core1/done/io/aigetlen.c new file mode 100644 index 00000000..a7404228 --- /dev/null +++ b/src/core1/done/io/aigetlen.c @@ -0,0 +1,6 @@ +#include + +u32 osAiGetLength(void) +{ + return IO_READ(AI_LEN_REG); +} diff --git a/src/core1/done/io/aisetfreq.c b/src/core1/done/io/aisetfreq.c new file mode 100644 index 00000000..78289793 --- /dev/null +++ b/src/core1/done/io/aisetfreq.c @@ -0,0 +1,20 @@ +#include +#include "osint.h" + +s32 osAiSetFrequency(u32 frequency) +{ + register unsigned int dacRate; + register int bitRate; + register float f; + f = osViClock / (float)frequency + .5f; + dacRate = f; + if (dacRate < AI_MIN_DAC_RATE) + return -1; + bitRate = (dacRate / 66) & 0xFF; + if (bitRate > AI_MAX_BIT_RATE) + bitRate = AI_MAX_BIT_RATE; + IO_WRITE(AI_DACRATE_REG, dacRate - 1); + IO_WRITE(AI_BITRATE_REG, bitRate - 1); + IO_WRITE(AI_CONTROL_REG, AI_CONTROL_DMA_ON); + return osViClock / (s32)dacRate; +} diff --git a/src/core1/done/io/aisetnextbuf.c b/src/core1/done/io/aisetnextbuf.c new file mode 100644 index 00000000..9e23f8c2 --- /dev/null +++ b/src/core1/done/io/aisetnextbuf.c @@ -0,0 +1,23 @@ +#include +#include +#include "osint.h" + +s32 osAiSetNextBuffer(void *bufPtr, u32 size) +{ + static u8 hdwrBugFlag = 0; + char *bptr = bufPtr; + if (hdwrBugFlag != 0) + bptr -= 0x2000; + + if ((((u32)bufPtr + size) & 0x3fff) == 0x2000) + hdwrBugFlag = 1; + else + hdwrBugFlag = 0; + + if (__osAiDeviceBusy()) + return -1; + + IO_WRITE(AI_DRAM_ADDR_REG, osVirtualToPhysical(bptr)); + IO_WRITE(AI_LEN_REG, size); + return 0; +} diff --git a/src/core1/done/io/cartrominit.c b/src/core1/done/io/cartrominit.c new file mode 100644 index 00000000..7e8b2c8b --- /dev/null +++ b/src/core1/done/io/cartrominit.c @@ -0,0 +1,36 @@ +#include +#include "functions.h" +#include "variables.h" + +extern OSPiHandle *__osPiTable; + +OSPiHandle CartRomHandle; +OSPiHandle *osCartRomInit(void) +{ + u32 domain; + u32 saveMask; + + domain = 0; + + if (CartRomHandle.baseAddress == PHYS_TO_K1(PI_DOM1_ADDR2)) + return &CartRomHandle; + + CartRomHandle.type = DEVICE_TYPE_CART; + CartRomHandle.baseAddress = PHYS_TO_K1(PI_DOM1_ADDR2); + osPiRawReadIo(NULL, &domain); + CartRomHandle.latency = domain & 0xff; + CartRomHandle.pulse = (domain >> 8) & 0xff; + CartRomHandle.pageSize = (domain >> 0x10) & 0xf; + CartRomHandle.relDuration = (domain >> 0x14) & 0xf; + CartRomHandle.domain = PI_DOMAIN1; + CartRomHandle.speed = 0; + + bzero(&CartRomHandle.transferInfo, sizeof(__OSTranxInfo)); + + saveMask = __osDisableInt(); + CartRomHandle.next = __osPiTable; + __osPiTable = &CartRomHandle; + __osRestoreInt(saveMask); + + return &CartRomHandle; +}//*/ diff --git a/src/core1/done/io/conteeplongread.c b/src/core1/done/io/conteeplongread.c new file mode 100644 index 00000000..a116cfe7 --- /dev/null +++ b/src/core1/done/io/conteeplongread.c @@ -0,0 +1,15 @@ +#include +#include "controller.h" +s32 osEepromLongRead(OSMesgQueue *mq, u8 address, u8 *buffer, int length) +{ + s32 ret; + ret = 0; + while (length > 0) + { + ERRCK(osEepromRead(mq, address, buffer)); + length -= EEPROM_BLOCK_SIZE; + address++; + buffer += EEPROM_BLOCK_SIZE; + } + return ret; +} diff --git a/src/core1/done/io/conteeplongwrite.c b/src/core1/done/io/conteeplongwrite.c new file mode 100644 index 00000000..2a10b666 --- /dev/null +++ b/src/core1/done/io/conteeplongwrite.c @@ -0,0 +1,18 @@ +#include +#include "controller.h" + +s32 osEepromLongWrite(OSMesgQueue *mq, u8 address, u8 *buffer, int length) +{ + s32 ret; + ret = 0; + while (length > 0) + { + ERRCK(osEepromWrite(mq, address, buffer)); + length -= EEPROM_BLOCK_SIZE; + address++; + buffer += EEPROM_BLOCK_SIZE; + osSetTimer(&__osEepromTimer, 12000 * osClockRate / 1000000, 0, &__osEepromTimerQ, &__osEepromTimerMsg); + osRecvMesg(&__osEepromTimerQ, NULL, OS_MESG_BLOCK); + } + return ret; +} diff --git a/src/core1/done/io/conteepread.c b/src/core1/done/io/conteepread.c new file mode 100644 index 00000000..46a9512d --- /dev/null +++ b/src/core1/done/io/conteepread.c @@ -0,0 +1,106 @@ +#include +#include "controller.h" +#include "siint.h" + +static void __osPackEepReadData(u8 address); +extern OSPifRam __osEepPifRam; // todo bss +s32 osEepromRead(OSMesgQueue *mq, u8 address, u8 *buffer) +{ + s32 ret; + int i; + u16 type; + u8 *ptr; + OSContStatus sdata; + __OSContEepromFormat eepromformat; + ret = 0; + i = 0; + ptr = (u8 *)&__osEepPifRam.ramarray; + __osSiGetAccess(); + ret = __osEepStatus(mq, &sdata); + type = sdata.type & (CONT_EEPROM | CONT_EEP16K); + + if (ret != 0) + { + __osSiRelAccess(); + return CONT_NO_RESPONSE_ERROR; + } + switch (type) + { + case CONT_EEPROM: + if (address > EEPROM_MAXBLOCKS) + { + __osSiRelAccess(); + return -1; + } + + break; + case CONT_EEPROM | CONT_EEP16K: + if (address > EEP16K_MAXBLOCKS) //not technically possible + { + __osSiRelAccess(); + return -1; + } + break; + default: + __osSiRelAccess(); + return CONT_NO_RESPONSE_ERROR; + break; + } + while (sdata.status & CONT_EEPROM_BUSY) + { + __osEepStatus(mq, &sdata); + } + __osPackEepReadData(address); + ret = __osSiRawStartDma(OS_WRITE, &__osEepPifRam); //send command to pif + osRecvMesg(mq, NULL, OS_MESG_BLOCK); + for (i = 0; i < ARRLEN(__osEepPifRam.ramarray) + 1; i++) { + __osEepPifRam.ramarray[i] = 0xFF; + } + __osEepPifRam.pifstatus = 0; + ret = __osSiRawStartDma(OS_READ, &__osEepPifRam); //recv response + __osContLastCmd = CONT_CMD_READ_EEPROM; + osRecvMesg(mq, NULL, OS_MESG_BLOCK); + for (i = 0; i < 4; i++) //skip the first 4 bytes + { + ptr++; + } + eepromformat = *(__OSContEepromFormat *)ptr; + + ret = CHNL_ERR(eepromformat); + + if (ret == 0) + for (i = 0; i < ARRLEN(eepromformat.data); i++) + *buffer++ = eepromformat.data[i]; + + __osSiRelAccess(); + return ret; +} + +static void __osPackEepReadData(u8 address) +{ + u8 *ptr; + __OSContEepromFormat eepromformat; + int i; + ptr = (u8 *)&__osEepPifRam.ramarray; + for (i = 0; i < ARRLEN(__osEepPifRam.ramarray) + 1; i++) + { + __osEepPifRam.ramarray[i] = CONT_CMD_NOP; + } + __osEepPifRam.pifstatus = CONT_CMD_EXE; + + eepromformat.txsize = CONT_CMD_READ_EEPROM_TX; + eepromformat.rxsize = CONT_CMD_READ_EEPROM_RX; + eepromformat.cmd = CONT_CMD_READ_EEPROM; + eepromformat.address = address; + for (i = 0; i < ARRLEN(eepromformat.data); i++) + { + eepromformat.data[i] = 0; + } + for (i = 0; i < 4; i++) //skip the first 4 bytes + { + *ptr++ = 0; + } + *(__OSContEepromFormat *)(ptr) = eepromformat; + ptr += sizeof(__OSContEepromFormat); + ptr[0] = CONT_CMD_END; +} diff --git a/src/core1/done/io/conteepwrite.c b/src/core1/done/io/conteepwrite.c new file mode 100644 index 00000000..435f6d5f --- /dev/null +++ b/src/core1/done/io/conteepwrite.c @@ -0,0 +1,167 @@ +#include +#include "controller.h" +#include "siint.h" +#include + +static void __osPackEepWriteData(u8 address, u8 *buffer); +s32 osEepromWrite(OSMesgQueue *mq, u8 address, u8 *buffer) +{ + + s32 ret; + int i; + u16 type; + u8 *ptr; + __OSContEepromFormat eepromformat; + OSContStatus sdata; + + ret = 0; + ptr = (u8 *)&__osEepPifRam.ramarray; + __osSiGetAccess(); + ret = __osEepStatus(mq, &sdata); //why is this duplicated? + ret = __osEepStatus(mq, &sdata); + + type = sdata.type & (CONT_EEPROM | CONT_EEP16K); + + if (ret != 0) + { + __osSiRelAccess(); + return CONT_NO_RESPONSE_ERROR; + } + switch (type) + { + case CONT_EEPROM: + if (address > EEPROM_MAXBLOCKS) + { + __osSiRelAccess(); + return -1; + } + + break; + case CONT_EEPROM | CONT_EEP16K: + if (address > EEP16K_MAXBLOCKS) //not technically possible + { + __osSiRelAccess(); + return -1; + } + break; + default: + __osSiRelAccess(); + return CONT_NO_RESPONSE_ERROR; + break; + } + while (sdata.status & CONT_EEPROM_BUSY) + { + __osEepStatus(mq, &sdata); + } + __osPackEepWriteData(address, buffer); + ret = __osSiRawStartDma(OS_WRITE, &__osEepPifRam); //send command to pif + osRecvMesg(mq, NULL, OS_MESG_BLOCK); + + for (i = 0; i < ARRLEN(__osEepPifRam.ramarray) + 1; i++) { + __osEepPifRam.ramarray[i] = 0xFF; + } + + __osEepPifRam.pifstatus = 0; + + ret = __osSiRawStartDma(OS_READ, &__osEepPifRam); //recv response + __osContLastCmd = CONT_CMD_WRITE_EEPROM; + osRecvMesg(mq, NULL, OS_MESG_BLOCK); + for (i = 0; i < 4; i++) //skip the first 4 bytes + { + ptr++; + } + eepromformat = *(__OSContEepromFormat *)ptr; + + //probably indicates an error, from PIF + ret = CHNL_ERR(eepromformat); //TODO: remove magic constants + + __osSiRelAccess(); + return ret; +} +static void __osPackEepWriteData(u8 address, u8 *buffer) +{ + u8 *ptr; + __OSContEepromFormat eepromformat; + int i; + ptr = (u8 *)&__osEepPifRam.ramarray; + for (i = 0; i < ARRLEN(__osEepPifRam.ramarray) + 1; i++) + { + __osEepPifRam.ramarray[i] = CONT_CMD_NOP; + } + __osEepPifRam.pifstatus = CONT_CMD_EXE; + + eepromformat.txsize = CONT_CMD_WRITE_EEPROM_TX; + eepromformat.rxsize = CONT_CMD_WRITE_EEPROM_RX; + eepromformat.cmd = CONT_CMD_WRITE_EEPROM; + eepromformat.address = address; + for (i = 0; i < ARRLEN(eepromformat.data); i++) + { + eepromformat.data[i] = *buffer++; + } + for (i = 0; i < 4; i++) //skip the first 4 bytes + { + *ptr++ = 0; + } + *(__OSContEepromFormat *)(ptr) = eepromformat; + ptr += sizeof(__OSContEepromFormat); + ptr[0] = CONT_CMD_END; +} +s32 __osEepStatus(OSMesgQueue *mq, OSContStatus *data) +{ + s32 ret; + int i; + u8 *ptr; + __OSContRequesFormat requestformat; + + //addiu sp,sp,-48 + //lui t6,__osEepPifRam + //addiu t6,t6,__osEepPifRam + //sw ra,20(sp) + //sw a0,48(sp) + //sw a1,52(sp) + //sw zero,44(sp) + ret = 0; + //sw t6,36(sp) + ptr = (u8 *)__osEepPifRam.ramarray; + //could be bset or bzero intrinsic + for (i = 0; i < ARRLEN(__osEepPifRam.ramarray) + 1; i++) //still has the buffer overflow =/, just sets status to 0 + { + __osEepPifRam.ramarray[i] = 0; + } + __osEepPifRam.pifstatus = CONT_CMD_EXE; + ptr = (u8 *)__osEepPifRam.ramarray; + for (i = 0; i < 4; i++) //zero 4 bytes? + *ptr++ = 0; + requestformat.dummy = CONT_CMD_NOP; + requestformat.txsize = CONT_CMD_REQUEST_STATUS_TX; + requestformat.rxsize = CONT_CMD_REQUEST_STATUS_RX; + requestformat.cmd = CONT_CMD_REQUEST_STATUS; + requestformat.typeh = CONT_CMD_NOP; + requestformat.typel = CONT_CMD_NOP; + requestformat.status = CONT_CMD_NOP; + requestformat.dummy1 = CONT_CMD_NOP; + *(__OSContRequesFormat *)ptr = requestformat; + ptr += sizeof(__OSContRequesFormat); + *ptr = CONT_CMD_END; + + ret = __osSiRawStartDma(OS_WRITE, &__osEepPifRam); + osRecvMesg(mq, NULL, OS_MESG_BLOCK); + __osContLastCmd = CONT_CMD_REQUEST_STATUS; + ret = __osSiRawStartDma(OS_READ, &__osEepPifRam); + osRecvMesg(mq, NULL, OS_MESG_BLOCK); + + if (ret != 0) + return ret; + + ptr = (u8 *)&__osEepPifRam; + for (i = 0; i < 4; i++) + *ptr++ = 0; + + requestformat = *(__OSContRequesFormat *)ptr; + data->errno = CHNL_ERR(requestformat); + data->type = (requestformat.typel << 8) | requestformat.typeh; + data->status = requestformat.status; + if (data->errno != 0) + return data->errno; + return 0; +} diff --git a/src/core1/done/io/contpfs.c b/src/core1/done/io/contpfs.c new file mode 100644 index 00000000..7c4253c3 --- /dev/null +++ b/src/core1/done/io/contpfs.c @@ -0,0 +1,302 @@ +#include +#include "functions.h" +#include "variables.h" +#include "controller.h" + +u16 __osSumcalc(u8 *ptr, int length) +{ + int i; + u32 sum; + u8 *tmp; + + sum = 0; + tmp = ptr; + for (i = 0; i < length; i++) + { + sum += *tmp++; + sum &= 0xffff; + } + return sum; +} + +s32 __osIdCheckSum(u16 *ptr, u16 *csum, u16 *icsum) +{ + u16 data; + u32 j; + data = 0; + *icsum = 0; + *csum = *icsum; + for (j = 0; j < 28; j += 2) + { + //feels like this should be a compiler optimization not manual.. + //but it doesn't match and I'm pretty sure this is just -O1 + data = *(u16 *)((u8 *)ptr + j); + //data = ptr[j] + *csum += data; + *icsum += ~data; + } + return 0; +} + +s32 __osRepairPackId(OSPfs *pfs, __OSPackId *badid, __OSPackId *newid) +{ + + s32 ret; + u8 temp[32]; + u8 comp[32]; + u8 mask; + int i; + int j; + u16 index[4]; + + ret = 0; + mask = 0; + SET_ACTIVEBANK_TO_ZERO; + newid->repaired = -1; + newid->random = osGetCount(); + newid->serial_mid = badid->serial_mid; + newid->serial_low = badid->serial_low; + for (j = 0; j < PFS_MAX_BANKS;) + { + pfs->activebank = j; + ERRCK(__osPfsSelectBank(pfs)) + ERRCK(__osContRamRead(pfs->queue, pfs->channel, 0, (u8*)&temp)); //TODO: fix magic number + temp[0] = j | 0x80; + for (i = 1; i < ARRLEN(temp); i++) + { + + temp[i] = ~temp[i]; + } + + ERRCK(__osContRamWrite(pfs->queue, pfs->channel, 0, (u8*)temp, FALSE)); //oddr 0, don't force + ERRCK(__osContRamRead(pfs->queue, pfs->channel, 0, (u8*)&comp)); + + for (i = 0; i < ARRLEN(temp); i++) + { + if (comp[i] != temp[i]) + break; + } + if (i != ARRLEN(temp)) + break; + if (j > 0) + { + pfs->activebank = 0; + ERRCK(__osPfsSelectBank(pfs)); + ERRCK(__osContRamRead(pfs->queue, pfs->channel, 0, (u8*)temp)); + if (temp[0] != 128) + break; //TODO: remove magic constant + } + j++; + } + pfs->activebank = 0; + ERRCK(__osPfsSelectBank(pfs)); + if (j > 0) + mask = 1; + else + mask = 0; + newid->deviceid = (badid->deviceid & (u16)~1) | mask; + newid->banks = j; + newid->version = badid->version; + __osIdCheckSum((u16*)newid, &newid->checksum, &newid->inverted_checksum); + index[0] = 1; + index[1] = 3; + index[2] = 4; + index[3] = 6; + for (i = 0; i < ARRLEN(index); i++) + { + ERRCK(__osContRamWrite(pfs->queue, pfs->channel, index[i], (u8*)newid, TRUE)); + } + ERRCK(__osContRamRead(pfs->queue, pfs->channel, 1, (u8*)temp)); + for (i = 0; i < ARRLEN(temp); i++) + { + if (temp[i] != ((u8 *)newid)[i]) + return PFS_ERR_ID_FATAL; + } + return 0; +} + +s32 __osCheckPackId(OSPfs *pfs, __OSPackId *temp) +{ + u16 index[4]; + s32 ret; + u16 sum; + u16 isum; + int i; + int j; + + ret = 0; + SET_ACTIVEBANK_TO_ZERO; + index[0] = 1; + index[1] = 3; + index[2] = 4; + index[3] = 6; + for (i = 1; i < ARRLEN(index); i++) + { + ERRCK(__osContRamRead(pfs->queue, pfs->channel, index[i], (u8*)temp)); + __osIdCheckSum((u16 *)temp, &sum, &isum); + if (temp->checksum == sum && temp->inverted_checksum == isum) + break; + } + if (i == ARRLEN(index)) + return PFS_ERR_ID_FATAL; + + for (j = 0; j < ARRLEN(index); j++) + { + if (j != i) + { + ERRCK(__osContRamWrite(pfs->queue, pfs->channel, index[j], (u8*)temp, TRUE)); + } + } + return 0; +} + +s32 __osGetId(OSPfs *pfs) +{ + int k; + u16 sum; + u16 isum; + u8 temp[32]; + __OSPackId newid; + s32 ret; + __OSPackId *id; + + SET_ACTIVEBANK_TO_ZERO; + ERRCK(__osContRamRead(pfs->queue, pfs->channel, 1, (u8*)temp)); + __osIdCheckSum((u16*)temp, &sum, &isum); + id = (__OSPackId*)temp; + if (id->checksum != sum || id->inverted_checksum != isum) + { + ret = __osCheckPackId(pfs, id); + if (ret == PFS_ERR_ID_FATAL) + { + ERRCK(__osRepairPackId(pfs, id, &newid)); + id = &newid; + } + else if (ret != 0) + { + return ret; + } + } + if ((id->deviceid & 1) == 0) //TODO: remove magic constant + { + ERRCK(__osRepairPackId(pfs, id, &newid)); + id = &newid; + if ((id->deviceid & 1) == 0) + return PFS_ERR_DEVICE; + } + for (k = 0; k < ARRLEN(pfs->id); k++) + { + pfs->id[k] = ((u8 *)id)[k]; + } + pfs->version = id->version; + pfs->banks = id->banks; + pfs->inode_start_page = pfs->banks * 2 + 3; //TODO: loads of magic constants.. + pfs->dir_size = 16; + pfs->inode_table = 8; + pfs->minode_table = pfs->banks * PFS_ONE_PAGE + 8; + pfs->dir_table = pfs->minode_table + pfs->banks * PFS_ONE_PAGE; + ERRCK(__osContRamRead(pfs->queue, pfs->channel, 7, pfs->label)); + return 0; +} + +s32 __osCheckId(OSPfs *pfs) +{ + int k; + u8 temp[32]; + s32 ret; + + SET_ACTIVEBANK_TO_ZERO; + ret = __osContRamRead(pfs->queue, pfs->channel, 1, (u8*)temp); + if (ret != 0) + { + if (ret != 2) + return ret; + else + ERRCK(__osContRamRead(pfs->queue, pfs->channel, 1, (u8*)temp)); + } + + for (k = 0; k < ARRLEN(temp); k++) + { + if (pfs->id[k] != temp[k]) + return PFS_ERR_NEW_PACK; + } + + return 0; +} + +s32 __osPfsRWInode(OSPfs *pfs, __OSInode *inode, u8 flag, u8 bank) +{ + u8 sum; + int j; + s32 ret; + int offset; + u8 *addr; + + SET_ACTIVEBANK_TO_ZERO; + + if (bank > 0) + offset = 1; + else + offset = pfs->inode_start_page; + + if (flag == PFS_WRITE) + inode->inode_page[0].inode_t.page = __osSumcalc((u8*)&inode->inode_page[offset], (-offset) * 2 + 256); + + for (j = 0; j < 8; j++) + { + addr = ((u8 *)inode->inode_page + j * 32); //TODO: don't like this =/ //maybe &inode->inode_table[j*PFS_ONE_PAGE].ipage or something + if (flag == PFS_WRITE) + { + ret = __osContRamWrite(pfs->queue, pfs->channel, pfs->inode_table + bank * 8 + j, addr, FALSE); + ret = __osContRamWrite(pfs->queue, pfs->channel, pfs->minode_table + bank * 8 + j, addr, FALSE); + } + else + { + ret = __osContRamRead(pfs->queue, pfs->channel, pfs->inode_table + bank * 8 + j, addr); + } + if (ret != 0) + return ret; + } + if (flag == PFS_READ) + { + sum = __osSumcalc((u8*)&inode->inode_page[offset], (-offset) * 2 + 256); + if (sum != inode->inode_page[0].inode_t.page) + { + for (j = 0; j < PFS_ONE_PAGE; j++) + { + addr = ((u8 *)inode->inode_page + j * 32); + ret = __osContRamRead(pfs->queue, pfs->channel, pfs->minode_table + bank * PFS_ONE_PAGE + j, addr); + } + if (sum != inode->inode_page[0].inode_t.page) + return PFS_ERR_INCONSISTENT; + for (j = 0; j < PFS_ONE_PAGE; j++) + { + addr = ((u8 *)inode->inode_page + j * 32); + ret = __osContRamWrite(pfs->queue, pfs->channel, pfs->inode_table + bank * PFS_ONE_PAGE + j, addr, FALSE); + } + } + else + { + for (j = 0; j < PFS_ONE_PAGE; j++) + { + addr = ((u8 *)inode->inode_page + j * 32); + ret = __osContRamWrite(pfs->queue, pfs->channel, pfs->minode_table + bank * PFS_ONE_PAGE + j, addr, FALSE); + } + } + } + return 0; +} + +s32 __osPfsSelectBank(OSPfs *pfs) +{ + u8 temp[BLOCKSIZE]; + int i; + s32 ret; + ret = 0; + for (i = 0; i < ARRLEN(temp); i++) + { + temp[i] = pfs->activebank; + } + ret = __osContRamWrite(pfs->queue, pfs->channel, 1024, (u8*)temp, FALSE); + return ret; +} diff --git a/src/core1/done/io/contramread.c b/src/core1/done/io/contramread.c new file mode 100644 index 00000000..2ae9602f --- /dev/null +++ b/src/core1/done/io/contramread.c @@ -0,0 +1,102 @@ +#include +#include +#include "controller.h" +#include "siint.h" + +static void __osPackRamReadData(int channel, u16 address); +s32 __osContRamRead(OSMesgQueue *mq, int channel, u16 address, u8 *buffer) +{ + s32 ret; + int i; + u8 *ptr; + __OSContRamReadFormat ramreadformat; + int retry; + ret = 0; + ptr = (u8 *)&__osPfsPifRam; + retry = 2; + __osSiGetAccess(); + __osContLastCmd = CONT_CMD_READ_MEMPACK; + __osPackRamReadData(channel, address); + ret = __osSiRawStartDma(OS_WRITE, &__osPfsPifRam); + osRecvMesg(mq, NULL, OS_MESG_BLOCK); + do + { + ret = __osSiRawStartDma(OS_READ, &__osPfsPifRam); + osRecvMesg(mq, NULL, OS_MESG_BLOCK); + ptr = (u8 *)&__osPfsPifRam; + if (channel != 0) + { + for (i = 0; i < channel; i++) + { + ptr++; + } + } + ramreadformat = *(__OSContRamReadFormat *)ptr; + ret = CHNL_ERR(ramreadformat); + if (ret == 0) + { + u8 c; + c = __osContDataCrc((u8*)&ramreadformat.data); + if (c != ramreadformat.datacrc) + { + ret = __osPfsGetStatus(mq, channel); + if (ret != 0) + { + __osSiRelAccess(); + return ret; + } + ret = PFS_ERR_CONTRFAIL; + } + else + { + for (i = 0; i < ARRLEN(ramreadformat.data); i++) + { + *buffer++ = ramreadformat.data[i]; + } + } + } + else + { + ret = PFS_ERR_NOPACK; + } + if (ret != PFS_ERR_CONTRFAIL) + break; + } while (retry-- >= 0); + __osSiRelAccess(); + return ret; +} + +static void __osPackRamReadData(int channel, u16 address) +{ + u8 *ptr; + __OSContRamReadFormat ramreadformat; + int i; + + ptr = (u8 *)__osPfsPifRam.ramarray; + + for (i = 0; i < ARRLEN(__osPfsPifRam.ramarray) + 1; i++) { // also clear pifstatus + __osPfsPifRam.ramarray[i] = 0; + } + + __osPfsPifRam.pifstatus = CONT_CMD_EXE; + ramreadformat.dummy = CONT_CMD_NOP; + ramreadformat.txsize = CONT_CMD_READ_MEMPACK_TX; + ramreadformat.rxsize = CONT_CMD_READ_MEMPACK_RX; + ramreadformat.cmd = CONT_CMD_READ_MEMPACK; + ramreadformat.address = (address << 0x5) | __osContAddressCrc(address); + ramreadformat.datacrc = CONT_CMD_NOP; + for (i = 0; i < ARRLEN(ramreadformat.data); i++) + { + ramreadformat.data[i] = CONT_CMD_NOP; + } + if (channel != 0) + { + for (i = 0; i < channel; i++) + { + *ptr++ = 0; + } + } + *(__OSContRamReadFormat *)ptr = ramreadformat; + ptr += sizeof(__OSContRamReadFormat); + ptr[0] = CONT_CMD_END; +} diff --git a/src/core1/done/io/contramwrite.c b/src/core1/done/io/contramwrite.c new file mode 100644 index 00000000..67ef6059 --- /dev/null +++ b/src/core1/done/io/contramwrite.c @@ -0,0 +1,94 @@ +#include +#include +#include "controller.h" +#include "siint.h" + +static void __osPackRamWriteData(int channel, u16 address, u8 *buffer); +s32 __osContRamWrite(OSMesgQueue *mq, int channel, u16 address, u8 *buffer, int force) +{ + s32 ret; + int i; + u8 *ptr; + __OSContRamReadFormat ramreadformat; + int retry; + + ret = 0; + ptr = (u8 *)&__osPfsPifRam; + retry = 2; + if (force != 1 && address < 7 && address != 0) + return 0; + __osSiGetAccess(); + __osContLastCmd = CONT_CMD_WRITE_MEMPACK; + __osPackRamWriteData(channel, address, buffer); + ret = __osSiRawStartDma(OS_WRITE, &__osPfsPifRam); + osRecvMesg(mq, NULL, OS_MESG_BLOCK); + do + { + ret = __osSiRawStartDma(OS_READ, &__osPfsPifRam); + osRecvMesg(mq, NULL, OS_MESG_BLOCK); + ptr = (u8 *)&__osPfsPifRam; + if (channel != 0) + for (i = 0; i < channel; i++) + ptr++; + + ramreadformat = *(__OSContRamReadFormat *)ptr; + + ret = CHNL_ERR(ramreadformat); + if (ret == 0) + { + if (__osContDataCrc(buffer) != ramreadformat.datacrc) + { + ret = __osPfsGetStatus(mq, channel); + if (ret != 0) + { + __osSiRelAccess(); + return ret; + } + ret = PFS_ERR_CONTRFAIL; + } + } + else + { + ret = PFS_ERR_NOPACK; + } + if (ret != PFS_ERR_CONTRFAIL) + break; + } while ((retry-- >= 0)); + __osSiRelAccess(); + return ret; +} + +static void __osPackRamWriteData(int channel, u16 address, u8 *buffer) +{ + u8 *ptr; + __OSContRamReadFormat ramreadformat; + int i; + + ptr = (u8 *)__osPfsPifRam.ramarray; + + for (i = 0; i < ARRLEN(__osPfsPifRam.ramarray) + 1; i++) { // also clear pifstatus + __osPfsPifRam.ramarray[i] = 0; + } + + __osPfsPifRam.pifstatus = CONT_CMD_EXE; + ramreadformat.dummy = CONT_CMD_NOP; + ramreadformat.txsize = CONT_CMD_WRITE_MEMPACK_TX; + ramreadformat.rxsize = CONT_CMD_WRITE_MEMPACK_RX; + ramreadformat.cmd = CONT_CMD_WRITE_MEMPACK; + ramreadformat.address = (address << 0x5) | __osContAddressCrc(address); + ramreadformat.datacrc = CONT_CMD_NOP; + for (i = 0; i < ARRLEN(ramreadformat.data); i++) + { + ramreadformat.data[i] = *buffer++; + } + if (channel != 0) + { + for (i = 0; i < channel; i++) + { + *ptr++ = 0; + } + } + *(__OSContRamReadFormat *)ptr = ramreadformat; + ptr += sizeof(__OSContRamReadFormat); + ptr[0] = CONT_CMD_END; +} diff --git a/src/core1/done/io/contreaddata.c b/src/core1/done/io/contreaddata.c new file mode 100644 index 00000000..8dbfb6ce --- /dev/null +++ b/src/core1/done/io/contreaddata.c @@ -0,0 +1,75 @@ +#include +#include +#include "siint.h" +#include "controller.h" + +static void __osPackReadData(void); +s32 osContStartReadData(OSMesgQueue *mq) +{ + s32 ret; + int i; + + ret = 0; + __osSiGetAccess(); + if (__osContLastCmd != CONT_CMD_READ_BUTTON) + { + __osPackReadData(); + ret = __osSiRawStartDma(OS_WRITE, &__osContPifRam); + osRecvMesg(mq, NULL, OS_MESG_BLOCK); + } + for (i = 0; i < ARRLEN(__osContPifRam.ramarray) + 1; i++) + { + __osContPifRam.ramarray[i] = 0xFF; + } + __osContPifRam.pifstatus = 0; + ret = __osSiRawStartDma(OS_READ, &__osContPifRam); + + __osContLastCmd = CONT_CMD_READ_BUTTON; + __osSiRelAccess(); + return ret; +} + +void osContGetReadData(OSContPad *data) +{ + u8 *ptr; + __OSContReadFormat readformat; + int i; + ptr = (u8 *)&__osContPifRam.ramarray; + for (i = 0; i < __osMaxControllers; i++, ptr += sizeof(__OSContReadFormat), data++) + { + readformat = *(__OSContReadFormat *)ptr; + data->errno = CHNL_ERR(readformat); + if (data->errno == 0) + { + data->button = readformat.button; + data->stick_x = readformat.stick_x; + data->stick_y = readformat.stick_y; + } + } +} + +static void __osPackReadData(void) +{ + u8 *ptr; + __OSContReadFormat readformat; + int i; + + ptr = (u8*)&__osContPifRam.ramarray; + for (i = 0; i < ARRLEN(__osContPifRam.ramarray) + 1; i++) + { + __osContPifRam.ramarray[i] = 0; + } + __osContPifRam.pifstatus = CONT_CMD_EXE; + readformat.dummy = CONT_CMD_NOP; + readformat.txsize = CONT_CMD_READ_BUTTON_TX; + readformat.rxsize = CONT_CMD_READ_BUTTON_RX; + readformat.cmd = CONT_CMD_READ_BUTTON; + readformat.button = -1; + readformat.stick_x = -1; + readformat.stick_y = -1; + for(i=0; i < __osMaxControllers; i++){ + *(__OSContReadFormat*)ptr = readformat; + ptr += sizeof(__OSContReadFormat); + } + *ptr = CONT_CMD_END; +} diff --git a/src/core1/done/io/controller.c b/src/core1/done/io/controller.c new file mode 100644 index 00000000..2bfb79e4 --- /dev/null +++ b/src/core1/done/io/controller.c @@ -0,0 +1,95 @@ +#include +#include +#include "controller.h" +#include "siint.h" + +#define HALF_A_SECOND OS_USEC_TO_CYCLES(500000) + +u32 __osContinitialized = 0; +OSPifRam __osContPifRam; +u8 __osContLastCmd; +u8 __osMaxControllers; +OSTimer __osEepromTimer; +OSMesgQueue __osEepromTimerQ; +OSMesg __osEepromTimerMsg; +s32 osContInit(OSMesgQueue *mq, u8 *bitpattern, OSContStatus *data) +{ + OSMesg dummy; + s32 ret; + OSTime t; + OSTimer mytimer; + OSMesgQueue timerMesgQueue; + + ret = 0; + if (__osContinitialized) + return ret; + __osContinitialized = TRUE; + t = osGetTime(); + if (500000 * osClockRate / 1000000 > t) + { + osCreateMesgQueue(&timerMesgQueue, &dummy, 1); + osSetTimer(&mytimer, 500000 * osClockRate / 1000000 - t, 0, &timerMesgQueue, &dummy); + osRecvMesg(&timerMesgQueue, &dummy, OS_MESG_BLOCK); + } + __osMaxControllers = MAXCONTROLLERS; + __osPackRequestData(CONT_CMD_REQUEST_STATUS); + + ret = __osSiRawStartDma(OS_WRITE, &__osContPifRam); + osRecvMesg(mq, &dummy, OS_MESG_BLOCK); + + ret = __osSiRawStartDma(OS_READ, &__osContPifRam); + osRecvMesg(mq, &dummy, OS_MESG_BLOCK); + __osContGetInitData(bitpattern, data); + __osContLastCmd = CONT_CMD_REQUEST_STATUS; + __osSiCreateAccessQueue(); + osCreateMesgQueue(&__osEepromTimerQ, &__osEepromTimerMsg, 1); + return ret; +} +void __osContGetInitData(u8 *pattern, OSContStatus *data) +{ + u8 *ptr; + __OSContRequesFormat requestformat; + int i; + u8 bits; + bits = 0; + ptr = (u8 *)&__osContPifRam; + for (i = 0; i < __osMaxControllers; i++, ptr += sizeof(__OSContRequesFormat), data++) + { + requestformat = *(__OSContRequesFormat *)ptr; + data->errno = CHNL_ERR(requestformat); + if (data->errno == 0) + { + data->type = (requestformat.typel << 8) | requestformat.typeh; + data->status = requestformat.status; + bits |= 1 << i; + } + } + *pattern = bits; +} +void __osPackRequestData(u8 cmd) +{ + u8 *ptr; + __OSContRequesFormat requestformat; + int i; + for (i = 0; i < ARRLEN(__osContPifRam.ramarray) + 1; i++) + { + __osContPifRam.ramarray[i] = 0; + } + __osContPifRam.pifstatus = CONT_CMD_EXE; + ptr = (u8 *)&__osContPifRam.ramarray; + requestformat.dummy = CONT_CMD_NOP; + requestformat.txsize = CONT_CMD_REQUEST_STATUS_TX; + requestformat.rxsize = CONT_CMD_REQUEST_STATUS_RX; + requestformat.cmd = cmd; + requestformat.typeh = CONT_CMD_NOP; + requestformat.typel = CONT_CMD_NOP; + requestformat.status = CONT_CMD_NOP; + requestformat.dummy1 = CONT_CMD_NOP; + + for (i = 0; i < __osMaxControllers; i++) + { + *(__OSContRequesFormat *)ptr = requestformat; + ptr += sizeof(__OSContRequesFormat); + } + ptr[0] = CONT_CMD_END; +} diff --git a/src/core1/done/io/controller.h b/src/core1/done/io/controller.h new file mode 100755 index 00000000..3daa018b --- /dev/null +++ b/src/core1/done/io/controller.h @@ -0,0 +1,207 @@ +#ifndef _CONTROLLER_H +#define _CONTROLLER_H +#include +#include + +//should go somewhere else but +#define ARRLEN(x) ((s32)(sizeof(x) / sizeof(x[0]))) +#define CHNL_ERR(format) ((format.rxsize & CHNL_ERR_MASK) >> 4) + +typedef struct +{ + /* 0x0 */ u32 ramarray[15]; + /* 0x3C */ u32 pifstatus; +} OSPifRam; + +typedef struct +{ + /* 0x0 */ u8 dummy; + /* 0x1 */ u8 txsize; + /* 0x2 */ u8 rxsize; + /* 0x3 */ u8 cmd; + /* 0x4 */ u16 button; + /* 0x6 */ s8 stick_x; + /* 0x7 */ s8 stick_y; +} __OSContReadFormat; + +typedef struct +{ + /* 0x0 */ u8 dummy; + /* 0x1 */ u8 txsize; + /* 0x2 */ u8 rxsize; + /* 0x3 */ u8 cmd; + /* 0x4 */ u8 typeh; + /* 0x5 */ u8 typel; + /* 0x6 */ u8 status; + /* 0x7 */ u8 dummy1; +} __OSContRequesFormat; + +typedef struct +{ + /* 0x0 */ u8 txsize; + /* 0x1 */ u8 rxsize; + /* 0x2 */ u8 cmd; + /* 0x3 */ u8 typeh; + /* 0x4 */ u8 typel; + /* 0x5 */ u8 status; +} __OSContRequesFormatShort; + +typedef struct +{ + /* 0x0 */ u8 dummy; + /* 0x1 */ u8 txsize; + /* 0x2 */ u8 rxsize; + /* 0x3 */ u8 cmd; + /* 0x4 */ u16 address; + /* 0x6 */ u8 data[BLOCKSIZE]; + /* 0x26 */ u8 datacrc; +} __OSContRamReadFormat; + +typedef union { + /* 0x0 */ struct + { + /* 0x0 */ u8 bank; + /* 0x1 */ u8 page; + } inode_t; + /* 0x0 */ u16 ipage; +} __OSInodeUnit; + +typedef struct +{ + /* 0x0 */ u32 game_code; + /* 0x4 */ u16 company_code; + /* 0x6 */ __OSInodeUnit start_page; + /* 0x8 */ u8 status; + /* 0x9 */ s8 reserved; + /* 0xA */ u16 data_sum; + /* 0xC */ u8 ext_name[PFS_FILE_EXT_LEN]; + /* 0x10 */ u8 game_name[PFS_FILE_NAME_LEN]; +} __OSDir; + +typedef struct +{ + /* 0x0 */ __OSInodeUnit inode_page[128]; +} __OSInode; + +typedef struct +{ + /* 0x0 */ u32 repaired; + /* 0x4 */ u32 random; + /* 0x8 */ u64 serial_mid; + /* 0x10 */ u64 serial_low; + /* 0x18 */ u16 deviceid; + /* 0x1A */ u8 banks; + /* 0x1B */ u8 version; + /* 0x1C */ u16 checksum; + /* 0x1E */ u16 inverted_checksum; +} __OSPackId; + +typedef struct +{ + /* 0x0 */ u8 txsize; + /* 0x1 */ u8 rxsize; + /* 0x2 */ u8 cmd; + /* 0x3 */ u8 address; + /* 0x4 */ u8 data[EEPROM_BLOCK_SIZE]; +} __OSContEepromFormat; + +//from: http://en64.shoutwiki.com/wiki/SI_Registers_Detailed#CONT_CMD_Usage +#define CONT_CMD_REQUEST_STATUS 0 +#define CONT_CMD_READ_BUTTON 1 +#define CONT_CMD_READ_MEMPACK 2 +#define CONT_CMD_WRITE_MEMPACK 3 +#define CONT_CMD_READ_EEPROM 4 +#define CONT_CMD_WRITE_EEPROM 5 +#define CONT_CMD_RESET 0xff + +#define CONT_CMD_REQUEST_STATUS_TX 1 +#define CONT_CMD_READ_BUTTON_TX 1 +#define CONT_CMD_READ_MEMPACK_TX 3 +#define CONT_CMD_WRITE_MEMPACK_TX 35 +#define CONT_CMD_READ_EEPROM_TX 2 +#define CONT_CMD_WRITE_EEPROM_TX 10 +#define CONT_CMD_RESET_TX 1 + +#define CONT_CMD_REQUEST_STATUS_RX 3 +#define CONT_CMD_READ_BUTTON_RX 4 +#define CONT_CMD_READ_MEMPACK_RX 33 +#define CONT_CMD_WRITE_MEMPACK_RX 1 +#define CONT_CMD_READ_EEPROM_RX 8 +#define CONT_CMD_WRITE_EEPROM_RX 1 +#define CONT_CMD_RESET_RX 3 + +#define CONT_CMD_NOP 0xff +#define CONT_CMD_END 0xfe //indicates end of a command +#define CONT_CMD_EXE 1 //set pif ram status byte to this to do a command + +#define DIR_STATUS_EMPTY 0 +#define DIR_STATUS_UNKNOWN 1 +#define DIR_STATUS_OCCUPIED 2 + + +typedef struct +{ + /* 0x0 */ __OSInode inode; + /* 0x100 */ u8 bank; + /* 0x101 */ u8 map[256]; +} __OSInodeCache; + +extern s32 __osEepStatus(OSMesgQueue *, OSContStatus *); +u16 __osSumcalc(u8 *ptr, int length); +s32 __osIdCheckSum(u16 *ptr, u16 *csum, u16 *icsum); +s32 __osRepairPackId(OSPfs *pfs, __OSPackId *badid, __OSPackId *newid); +s32 __osCheckPackId(OSPfs *pfs, __OSPackId *temp); +s32 __osGetId(OSPfs *pfs); +s32 __osCheckId(OSPfs *pfs); +s32 __osPfsRWInode(OSPfs *pfs, __OSInode *inode, u8 flag, u8 bank); +s32 __osPfsSelectBank(OSPfs *pfs); +s32 __osPfsDeclearPage(OSPfs *pfs, __OSInode *inode, int file_size_in_pages, int *first_page, u8 bank, int *decleared, int *last_page); +s32 __osPfsReleasePages(OSPfs *pfs, __OSInode *inode, u8 start_page, u16 *sum, u8 bank, __OSInodeUnit *last_page, int flag); +s32 __osBlockSum(OSPfs *pfs, u8 page_no, u16 *sum, u8 bank); +s32 __osContRamRead(OSMesgQueue *mq, int channel, u16 address, u8 *buffer); +s32 __osContRamWrite(OSMesgQueue *mq, int channel, u16 address, u8 *buffer, int force); +void __osContGetInitData(u8 *pattern, OSContStatus *data); +void __osPackRequestData(u8 cmd); +void __osPfsRequestData(u8 cmd); +void __osPfsGetInitData(u8* pattern, OSContStatus* data); +u8 __osContAddressCrc(u16 addr); +u8 __osContDataCrc(u8 *data); +s32 __osPfsGetStatus(OSMesgQueue *queue, int channel); + +extern u8 __osContLastCmd; +extern OSTimer __osEepromTimer; +extern OSMesg __osEepromTimerMsg; +extern OSMesgQueue __osEepromTimerQ; +extern OSPifRam __osEepPifRam; +extern OSPifRam __osContPifRam; +extern OSPifRam __osPfsPifRam; +extern u8 __osMaxControllers; + +//some version of this almost certainly existed since there's plenty of times where it's used right before a return 0 +#define ERRCK(fn) \ + ret = fn; \ + if (ret != 0) \ + return ret; + +#define SET_ACTIVEBANK_TO_ZERO \ + if (pfs->activebank != 0) \ + { \ + pfs->activebank = 0; \ + ERRCK(__osPfsSelectBank(pfs)) \ + } + +#define PFS_CHECK_ID \ + if (__osCheckId(pfs) == PFS_ERR_NEW_PACK) \ + return PFS_ERR_NEW_PACK; +#endif + +#define PFS_CHECK_STATUS \ + if ((pfs->status & PFS_INITIALIZED) == 0) \ + return PFS_ERR_INVALID; + +#define PFS_GET_STATUS \ + __osSiGetAccess(); \ + ret = __osPfsGetStatus(queue, channel); \ + __osSiRelAccess(); \ + if (ret != 0) \ + return ret; diff --git a/src/core1/done/io/contsetch.c b/src/core1/done/io/contsetch.c new file mode 100644 index 00000000..50540087 --- /dev/null +++ b/src/core1/done/io/contsetch.c @@ -0,0 +1,21 @@ +#include +#include "controller.h" +#include "siint.h" + +s32 osContSetCh(u8 ch) +{ + s32 ret; + ret = 0; + __osSiGetAccess(); + if (ch > MAXCONTROLLERS) + { + __osMaxControllers = 4; + } + else + { + __osMaxControllers = ch; + } + __osContLastCmd = CONT_CMD_END; //TODO: is this right? + __osSiRelAccess(); + return ret; +} diff --git a/src/core1/done/io/crc.c b/src/core1/done/io/crc.c new file mode 100644 index 00000000..22fb09a8 --- /dev/null +++ b/src/core1/done/io/crc.c @@ -0,0 +1,47 @@ +#include + +u8 __osContAddressCrc(u16 addr) +{ + u8 temp; + u8 temp2; + int i; + temp = 0; + for (i = 0; i < 16; i++) + { + if (temp & 0x10) + temp2 = 21; + else + temp2 = 0; + + temp <<= 1; + temp |= (u8)((addr & 0x400) ? 1 : 0); + addr <<= 1; + temp ^= temp2; + } + return temp & 0x1f; +} +u8 __osContDataCrc(u8 *data) +{ + u8 temp; + u8 temp2; + int i; + int j; + temp = 0; + for (i = 0; i <= 32; i++, data++) + { + for (j = 7; j >= 0; j--) + { + if (temp & 0x80) + temp2 = 133; + else + temp2 = 0; + temp <<= 1; + if (i == 32) + temp &= -1; + else + temp |= ((*data & (1 << j)) ? 1 : 0); + temp ^= temp2; + } + } + return temp; +} diff --git a/src/core1/done/io/devmgr.c b/src/core1/done/io/devmgr.c new file mode 100644 index 00000000..d0dc1c0b --- /dev/null +++ b/src/core1/done/io/devmgr.c @@ -0,0 +1,113 @@ +#include +#include "piint.h" + +void __osDevMgrMain(void *args) +{ + OSIoMesg *mb; + OSMesg em; + OSMesg dummy; + s32 ret; + OSDevMgr *dm; + s32 messageSend; + + messageSend = 0; + mb = NULL; + ret = 0; + dm = (OSDevMgr *)args; + while (TRUE) + { + osRecvMesg(dm->cmdQueue, (OSMesg)&mb, OS_MESG_BLOCK); + if (mb->piHandle != NULL && + mb->piHandle->type == DEVICE_TYPE_64DD && + (mb->piHandle->transferInfo.cmdType == LEO_CMD_TYPE_0 || + mb->piHandle->transferInfo.cmdType == LEO_CMD_TYPE_1)) + { + __OSBlockInfo *blockInfo; + __OSTranxInfo *info; + info = &mb->piHandle->transferInfo; + blockInfo = &info->block[info->blockNum]; + info->sectorNum = -1; + if (info->transferMode != LEO_SECTOR_MODE) + { + blockInfo->dramAddr = (void *)((u32)blockInfo->dramAddr - blockInfo->sectorSize); + } + if (info->transferMode == LEO_TRACK_MODE && mb->piHandle->transferInfo.cmdType == LEO_CMD_TYPE_0) + messageSend = 1; + else + messageSend = 0; + osRecvMesg(dm->acsQueue, &dummy, OS_MESG_BLOCK); + __osResetGlobalIntMask(OS_IM_PI); + osEPiRawWriteIo(mb->piHandle, LEO_BM_CTL, (info->bmCtlShadow | 0x80000000)); + while (TRUE) + { + + osRecvMesg(dm->evtQueue, &em, OS_MESG_BLOCK); + info = &mb->piHandle->transferInfo; + blockInfo = &info->block[info->blockNum]; + if (blockInfo->errStatus == LEO_ERROR_29) + { + u32 stat; + osEPiRawWriteIo(mb->piHandle, LEO_BM_CTL, info->bmCtlShadow | LEO_BM_CTL_RESET); //TODO: remove magic constants + osEPiRawWriteIo(mb->piHandle, LEO_BM_CTL, info->bmCtlShadow); + osEPiRawReadIo(mb->piHandle, LEO_STATUS, &stat); + + if (stat & LEO_STATUS_MECHANIC_INTERRUPT) //TODO: remove magic constants + { + osEPiRawWriteIo(mb->piHandle, LEO_BM_CTL, info->bmCtlShadow | LEO_BM_CTL_CLR_MECHANIC_INTR); + } + + blockInfo->errStatus = LEO_ERROR_4; + IO_WRITE(PI_STATUS_REG, PI_CLR_INTR); + __osSetGlobalIntMask(OS_IM_PI | SR_IBIT4); + } + osSendMesg(mb->hdr.retQueue, mb, OS_MESG_NOBLOCK); + + if (messageSend != 1) + break; + if (mb->piHandle->transferInfo.block[0].errStatus != LEO_ERROR_GOOD) + break; + messageSend = 0; + } + osSendMesg(dm->acsQueue, NULL, OS_MESG_NOBLOCK); + if (mb->piHandle->transferInfo.blockNum == 1) + osYieldThread(); + } + else + { + switch (mb->hdr.type) + { + case OS_MESG_TYPE_DMAREAD: + osRecvMesg(dm->acsQueue, &dummy, OS_MESG_BLOCK); + ret = dm->dma(OS_READ, mb->devAddr, mb->dramAddr, mb->size); + break; + case OS_MESG_TYPE_DMAWRITE: + osRecvMesg(dm->acsQueue, &dummy, OS_MESG_BLOCK); + ret = dm->dma(OS_WRITE, mb->devAddr, mb->dramAddr, mb->size); + break; + case OS_MESG_TYPE_EDMAREAD: + osRecvMesg(dm->acsQueue, &dummy, OS_MESG_BLOCK); + ret = dm->edma(mb->piHandle, OS_READ, mb->devAddr, mb->dramAddr, + mb->size); + break; + case OS_MESG_TYPE_EDMAWRITE: + osRecvMesg(dm->acsQueue, &dummy, OS_MESG_BLOCK); + ret = dm->edma(mb->piHandle, OS_WRITE, mb->devAddr, mb->dramAddr, + mb->size); + break; + case OS_MESG_TYPE_LOOPBACK: + osSendMesg(mb->hdr.retQueue, mb, OS_MESG_NOBLOCK); + ret = -1; + break; + default: + ret = -1; + break; + } + if (ret == 0) + { + osRecvMesg(dm->evtQueue, &em, OS_MESG_BLOCK); + osSendMesg(mb->hdr.retQueue, mb, OS_MESG_NOBLOCK); + osSendMesg(dm->acsQueue, NULL, OS_MESG_NOBLOCK); + } + } + } +} diff --git a/src/core1/done/io/dpgetstat.c b/src/core1/done/io/dpgetstat.c new file mode 100644 index 00000000..a1c32f08 --- /dev/null +++ b/src/core1/done/io/dpgetstat.c @@ -0,0 +1,6 @@ +#include +#include + +u32 osDpGetStatus(){ + return IO_READ(DPC_STATUS_REG); +} diff --git a/src/core1/done/io/dpsetstat.c b/src/core1/done/io/dpsetstat.c new file mode 100644 index 00000000..eb0cd4cb --- /dev/null +++ b/src/core1/done/io/dpsetstat.c @@ -0,0 +1,7 @@ +#include +#include + +void osDpSetStatus(u32 data) +{ + IO_WRITE(DPC_STATUS_REG, data); +} diff --git a/src/core1/done/io/epirawdma.c b/src/core1/done/io/epirawdma.c new file mode 100644 index 00000000..19ef62c1 --- /dev/null +++ b/src/core1/done/io/epirawdma.c @@ -0,0 +1,66 @@ +#include +#include "functions.h" +#include "variables.h" + +extern OSPiHandle *__osCurrentHandle[2]; + +#define OS_RAMROM_STACKSIZE 1024 + +#ifndef WAIT_ON_IOBUSY +#define WAIT_ON_IOBUSY(stat) \ + stat = IO_READ(PI_STATUS_REG); \ + while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) \ + stat = IO_READ(PI_STATUS_REG); +#endif + +#define UPDATE_REG(reg, var) \ + if (cHandle->var != pihandle->var) \ + IO_WRITE(reg, pihandle->var); + +#define EPI_SYNC(pihandle, stat, domain) \ + \ + WAIT_ON_IOBUSY(stat) \ + \ + domain = pihandle->domain; \ + if (__osCurrentHandle[domain] != pihandle) \ + { \ + OSPiHandle *cHandle = __osCurrentHandle[domain]; \ + if (domain == PI_DOMAIN1) \ + { \ + UPDATE_REG(PI_BSD_DOM1_LAT_REG, latency); \ + UPDATE_REG(PI_BSD_DOM1_PGS_REG, pageSize); \ + UPDATE_REG(PI_BSD_DOM1_RLS_REG, relDuration); \ + UPDATE_REG(PI_BSD_DOM1_PWD_REG, pulse); \ + } \ + else \ + { \ + UPDATE_REG(PI_BSD_DOM2_LAT_REG, latency); \ + UPDATE_REG(PI_BSD_DOM2_PGS_REG, pageSize); \ + UPDATE_REG(PI_BSD_DOM2_RLS_REG, relDuration); \ + UPDATE_REG(PI_BSD_DOM2_PWD_REG, pulse); \ + } \ + __osCurrentHandle[domain] = pihandle; \ + } + +s32 osEPiRawStartDma(OSPiHandle *pihandle, s32 direction, u32 devAddr, void *dramAddr, u32 size) +{ + u32 stat; + u32 domain; + + EPI_SYNC(pihandle, stat, domain); + + IO_WRITE(PI_DRAM_ADDR_REG, osVirtualToPhysical(dramAddr)); + IO_WRITE(PI_CART_ADDR_REG, K1_TO_PHYS(pihandle->baseAddress | devAddr)); + switch (direction) + { + case OS_READ: + IO_WRITE(PI_WR_LEN_REG, size - 1); + break; + case OS_WRITE: + IO_WRITE(PI_RD_LEN_REG, size - 1); + break; + default: + return -1; + } + return 0; +} diff --git a/src/core1/done/io/epirawread.c b/src/core1/done/io/epirawread.c new file mode 100644 index 00000000..75766a72 --- /dev/null +++ b/src/core1/done/io/epirawread.c @@ -0,0 +1,14 @@ +#include +#include +#include "piint.h" + +s32 osEPiRawReadIo(OSPiHandle *pihandle, u32 devAddr, u32 *data) +{ + register u32 stat; + register u32 domain; + + WAIT_ON_IOBUSY(stat); + + *data = IO_READ(pihandle->baseAddress | devAddr); + return 0; +} diff --git a/src/core1/done/io/epirawwrite.c b/src/core1/done/io/epirawwrite.c new file mode 100644 index 00000000..e7e474f0 --- /dev/null +++ b/src/core1/done/io/epirawwrite.c @@ -0,0 +1,13 @@ +#include +#include "piint.h" + +s32 osEPiRawWriteIo(OSPiHandle *pihandle, u32 devAddr, u32 data) +{ + register u32 stat; + register u32 domain; + + WAIT_ON_IOBUSY(stat); + + IO_WRITE(pihandle->baseAddress | devAddr, data); + return 0; +} diff --git a/src/core1/done/io/leodiskinit.c b/src/core1/done/io/leodiskinit.c new file mode 100644 index 00000000..a0381c88 --- /dev/null +++ b/src/core1/done/io/leodiskinit.c @@ -0,0 +1,29 @@ +#include +#include +#include + +OSPiHandle LeoDiskHandle; +OSPiHandle *__osDiskHandle; +OSPiHandle *osLeoDiskInit() +{ + u32 saveMask; + LeoDiskHandle.type = DEVICE_TYPE_64DD; + LeoDiskHandle.baseAddress = PHYS_TO_K1(PI_DOM2_ADDR1); + LeoDiskHandle.latency = 3; + LeoDiskHandle.pulse = 6; + LeoDiskHandle.pageSize = 6; + LeoDiskHandle.relDuration = 2; + LeoDiskHandle.domain = PI_DOMAIN2; + IO_WRITE(PI_BSD_DOM2_LAT_REG, LeoDiskHandle.latency); + IO_WRITE(PI_BSD_DOM2_PWD_REG, LeoDiskHandle.pulse); + IO_WRITE(PI_BSD_DOM2_PGS_REG, LeoDiskHandle.pageSize); + IO_WRITE(PI_BSD_DOM2_RLS_REG, LeoDiskHandle.relDuration); + LeoDiskHandle.speed = 0; + bzero(&LeoDiskHandle.transferInfo, sizeof(__OSTranxInfo)); + saveMask = __osDisableInt(); + LeoDiskHandle.next = __osPiTable; + __osPiTable = &LeoDiskHandle; + __osDiskHandle = &LeoDiskHandle; + __osRestoreInt(saveMask); + return &LeoDiskHandle; +} diff --git a/src/core1/done/io/leointerrupt.c b/src/core1/done/io/leointerrupt.c new file mode 100644 index 00000000..4e9a1b2f --- /dev/null +++ b/src/core1/done/io/leointerrupt.c @@ -0,0 +1,215 @@ +#include +#include "osint.h" +#include "piint.h" + +#define WAIT_ON_IOBUSY2(stat) \ + stat = IO_READ(PI_STATUS_REG); \ + while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) \ + stat = IO_READ(PI_STATUS_REG); + +static void __osLeoResume(void); +static void __osLeoAbnormalResume(void); + +extern OSThread *__osRunQueue; +extern OSIntMask __OSGlobalIntMask; +extern OSPiHandle *__osDiskHandle; + +u8 leoDiskStack[OS_PIM_STACKSIZE]; + +s32 __osLeoInterrupt() +{ + u32 stat; + volatile u32 pi_stat; + u32 bm_stat; + __OSTranxInfo *info; + __OSBlockInfo *blockInfo; + stat = 0; + info = &__osDiskHandle->transferInfo; + blockInfo = &info->block[info->blockNum]; + pi_stat = IO_READ(PI_STATUS_REG); + if (pi_stat & PI_STATUS_DMA_BUSY) + { + __OSGlobalIntMask = __OSGlobalIntMask & ~SR_IBIT4; //cartridge interrupt + blockInfo->errStatus = LEO_ERROR_29; + __osLeoResume(); + return 1; + } + WAIT_ON_IOBUSY(pi_stat); + stat = IO_READ(LEO_STATUS); + if (stat & LEO_STATUS_MECHANIC_INTERRUPT) + { + WAIT_ON_IOBUSY(pi_stat); + IO_WRITE(LEO_BM_CTL, info->bmCtlShadow | LEO_BM_CTL_CLR_MECHANIC_INTR); + blockInfo->errStatus = LEO_ERROR_GOOD; + return 0; + } + if (info->cmdType == LEO_CMD_TYPE_2) + return 1; + if (stat & LEO_STATUS_BUFFER_MANAGER_ERROR) + { + WAIT_ON_IOBUSY(pi_stat); + stat = IO_READ(LEO_STATUS); + blockInfo->errStatus = LEO_ERROR_22; + __osLeoResume(); + IO_WRITE(PI_STATUS_REG, PI_STATUS_CLR_INTR); + __OSGlobalIntMask |= OS_IM_PI; + return 1; + } + if (info->cmdType == LEO_CMD_TYPE_1) + { + if ((stat & LEO_STATUS_DATA_REQUEST) == 0) + { + if (info->sectorNum + 1 != info->transferMode * 85) + { + blockInfo->errStatus = LEO_ERROR_24; + __osLeoAbnormalResume(); + return 1; + } + IO_WRITE(PI_STATUS_REG, PI_STATUS_CLR_INTR); + __OSGlobalIntMask |= OS_IM_PI; + blockInfo->errStatus = LEO_ERROR_GOOD; + __osLeoResume(); + return 1; + } + blockInfo->dramAddr = (void *)((u32)blockInfo->dramAddr + blockInfo->sectorSize); + info->sectorNum++; + osEPiRawStartDma(__osDiskHandle, OS_WRITE, LEO_SECTOR_BUFF, blockInfo->dramAddr, blockInfo->sectorSize); + return 1; + } + if (info->cmdType == LEO_CMD_TYPE_0) + { + if (info->transferMode == LEO_SECTOR_MODE) + { + if ((s32)blockInfo->C1ErrNum + 17 < info->sectorNum) + { + blockInfo->errStatus = LEO_ERROR_GOOD; + __osLeoAbnormalResume(); + return 1; + } + if ((stat & LEO_STATUS_DATA_REQUEST) == 0) + { + blockInfo->errStatus = LEO_ERROR_23; + __osLeoAbnormalResume(); + return 1; + } + } + else + { + blockInfo->dramAddr = (void *)((u32)blockInfo->dramAddr + blockInfo->sectorSize); + } + bm_stat = IO_READ(LEO_BM_STATUS); + if ((bm_stat & LEO_BM_STATUS_C1SINGLE && bm_stat & LEO_BM_STATUS_C1DOUBLE) || bm_stat & LEO_BM_STATUS_MICRO) + { + if (blockInfo->C1ErrNum > 3) + { + if (info->transferMode != LEO_SECTOR_MODE || info->sectorNum > 0x52) + { + blockInfo->errStatus = LEO_ERROR_23; + __osLeoAbnormalResume(); + return 1; + } + } + else + { + int errNum = blockInfo->C1ErrNum; + blockInfo->C1ErrSector[errNum] = info->sectorNum + 1; + } + blockInfo->C1ErrNum += 1; + } + if (stat & LEO_STATUS_C2_TRANSFER) + { + if (info->sectorNum + 1 != 88) + { + blockInfo->errStatus = LEO_ERROR_24; + __osLeoAbnormalResume(); + } + if (info->transferMode == LEO_TRACK_MODE && info->blockNum == 0) + { + info->blockNum = 1; + info->sectorNum = -1; + info->block[1].dramAddr = (void *)((u32)info->block[1].dramAddr - info->block[1].sectorSize); + + blockInfo->errStatus = LEO_ERROR_22; + } + else + { + IO_WRITE(PI_STATUS_REG, PI_STATUS_CLR_INTR); + __OSGlobalIntMask |= OS_IM_PI; + info->cmdType = LEO_CMD_TYPE_2; + blockInfo->errStatus = LEO_ERROR_GOOD; + } + osEPiRawStartDma(__osDiskHandle, OS_READ, LEO_C2_BUFF, blockInfo->C2Addr, blockInfo->sectorSize * 4); + return 1; + } + + if (info->sectorNum == -1 && info->transferMode == LEO_TRACK_MODE && info->blockNum == 1) + { + __OSBlockInfo *bptr = &info->block[0]; + if (bptr->C1ErrNum == 0) + { + if (((u32 *)bptr->C2Addr)[0] | ((u32 *)bptr->C2Addr)[1] | ((u32 *)bptr->C2Addr)[2] | ((u32 *)bptr->C2Addr)[3]) + { + bptr->errStatus = LEO_ERROR_24; + __osLeoAbnormalResume(); + return 1; + } + } + bptr->errStatus = 0; + __osLeoResume(); + } + info->sectorNum++; + if (stat & LEO_STATUS_DATA_REQUEST) + { + if (info->sectorNum > 0x54) + { + blockInfo->errStatus = LEO_ERROR_24; + __osLeoAbnormalResume(); + return 1; + } + osEPiRawStartDma(__osDiskHandle, 0, LEO_SECTOR_BUFF, blockInfo->dramAddr, blockInfo->sectorSize); + blockInfo->errStatus = LEO_ERROR_GOOD; + return 1; + } + if (info->sectorNum <= 0x54) + { + blockInfo->errStatus = LEO_ERROR_24; + __osLeoAbnormalResume(); + return 1; + } + return 1; + } + blockInfo->errStatus = LEO_ERROR_4; + __osLeoAbnormalResume(); + return 1; +} + +static void __osLeoAbnormalResume(void) +{ + __OSTranxInfo *info; + u32 pi_stat; + info = &__osDiskHandle->transferInfo; + pi_stat = pi_stat; + WAIT_ON_IOBUSY2(pi_stat); + IO_WRITE(LEO_BM_CTL, info->bmCtlShadow | LEO_BM_CTL_RESET); + WAIT_ON_IOBUSY2(pi_stat); + IO_WRITE(LEO_BM_CTL, info->bmCtlShadow); + __osLeoResume(); + IO_WRITE(PI_STATUS_REG, PI_STATUS_CLR_INTR); + __OSGlobalIntMask |= OS_IM_PI; +} + +static void __osLeoResume(void) +{ + __OSEventState *es; + OSMesgQueue *mq; + s32 last; + es = &__osEventStateTab[OS_EVENT_PI]; + mq = es->messageQueue; + if (mq == NULL || MQ_IS_FULL(mq)) + return; + last = (mq->first + mq->validCount) % mq->msgCount; + mq->msg[last] = es->message; + mq->validCount++; + if (mq->mtqueue->next != NULL) + __osEnqueueThread(&__osRunQueue, __osPopThread(&mq->mtqueue)); +} diff --git a/src/core1/done/io/motor.c b/src/core1/done/io/motor.c new file mode 100644 index 00000000..984b322e --- /dev/null +++ b/src/core1/done/io/motor.c @@ -0,0 +1,170 @@ +#include +#include "controller.h" +#include "siint.h" + +static void _MakeMotorData(int channel, u16 address, u8 *buffer, OSPifRam *mdata); +// u32 __osMotorinitialized[MAXCONTROLLERS] = {0, 0, 0, 0}; +OSPifRam _MotorStopData[MAXCONTROLLERS]; +OSPifRam _MotorStartData[MAXCONTROLLERS]; +u8 _motorstopbuf[32]; +u8 _motorstartbuf[32]; +s32 osMotorStop(OSPfs *pfs) +{ + int i; + s32 ret; + u8 *ptr; + __OSContRamReadFormat ramreadformat; + + ptr = (u8 *)&__osPfsPifRam; + + // if (!__osMotorinitialized[pfs->channel]) + // return PFS_ERR_INVALID; + + __osSiGetAccess(); + + __osContLastCmd = CONT_CMD_WRITE_MEMPACK; + __osSiRawStartDma(OS_WRITE, &_MotorStopData[pfs->channel]); + osRecvMesg(pfs->queue, NULL, OS_MESG_BLOCK); + ret = __osSiRawStartDma(OS_READ, &__osPfsPifRam); + osRecvMesg(pfs->queue, NULL, OS_MESG_BLOCK); + ptr = (u8 *)&__osPfsPifRam; + + if (pfs->channel != 0) + for (i = 0; i < pfs->channel; i++) + ptr++; + + ramreadformat = *(__OSContRamReadFormat *)ptr; + ret = CHNL_ERR(ramreadformat); + if (ret == 0 && ramreadformat.datacrc != 0) //!= __osContDataCrc((u8*)&_motorstopbuf)) + { + ret = PFS_ERR_CONTRFAIL; + } + __osSiRelAccess(); + return ret; +} + +s32 osMotorStart(OSPfs *pfs) +{ + + int i; + s32 ret; + u8 *ptr; + __OSContRamReadFormat ramreadformat; + + ptr = (u8 *)&__osPfsPifRam; + + // if (!__osMotorinitialized[pfs->channel]) + // return PFS_ERR_INVALID; + + __osSiGetAccess(); + + __osContLastCmd = CONT_CMD_WRITE_MEMPACK; + __osSiRawStartDma(OS_WRITE, &_MotorStartData[pfs->channel]); + osRecvMesg(pfs->queue, NULL, OS_MESG_BLOCK); + ret = __osSiRawStartDma(OS_READ, &__osPfsPifRam); + osRecvMesg(pfs->queue, NULL, OS_MESG_BLOCK); + ptr = (u8 *)&__osPfsPifRam; + + if (pfs->channel != 0) + for (i = 0; i < pfs->channel; i++) + ptr++; + + ramreadformat = *(__OSContRamReadFormat *)ptr; + ret = CHNL_ERR(ramreadformat); + if (ret == 0 && ramreadformat.datacrc != 0xEB)//__osContDataCrc((u8*)&_motorstartbuf)) + { + ret = PFS_ERR_CONTRFAIL; + } + __osSiRelAccess(); + return ret; +} + +static void _MakeMotorData(int channel, u16 address, u8 *buffer, OSPifRam *mdata) +{ + u8 *ptr; + __OSContRamReadFormat ramreadformat; + int i; + + ptr = (u8 *)mdata->ramarray; + for (i = 0; i < ARRLEN(mdata->ramarray); i++) + mdata->ramarray[i] = 0; + mdata->pifstatus = CONT_CMD_EXE; + ramreadformat.dummy = CONT_CMD_NOP; + ramreadformat.txsize = CONT_CMD_WRITE_MEMPACK_TX; + ramreadformat.rxsize = CONT_CMD_WRITE_MEMPACK_RX; + ramreadformat.cmd = CONT_CMD_WRITE_MEMPACK; + + ramreadformat.address = (address << 0x5) | __osContAddressCrc(address); + ramreadformat.datacrc = CONT_CMD_NOP; + for (i = 0; i < ARRLEN(ramreadformat.data); i++) + + ramreadformat.data[i] = *buffer++; + if (channel != 0) + { + for (i = 0; i < channel; i++) + { + *ptr++ = 0; + } + } + *(__OSContRamReadFormat *)ptr = ramreadformat; + ptr += sizeof(__OSContRamReadFormat); + ptr[0] = CONT_CMD_END; +} + +s32 osMotorInit(OSMesgQueue *mq, OSPfs *pfs, int channel) +{ + int i; + s32 ret; + u8 temp[32]; + pfs->queue = mq; + pfs->channel = channel; + pfs->status = 0; + pfs->activebank = 128; + + for (i = 0; i < ARRLEN(temp); i++) + temp[i] = 0x80; + + ret = __osContRamWrite(mq, channel, 1024, temp, FALSE); + if (ret == 2) //TODO: remove magic constant + ret = __osContRamWrite(mq, channel, 1024, temp, FALSE); + if (ret != 0) + return ret; + + ret = __osContRamRead(mq, channel, 1024, temp); + if (ret == 2) + ret = PFS_ERR_CONTRFAIL; //is this right? + if (ret != 0) + return ret; + if (temp[31] != 0x80) + return PFS_ERR_DEVICE; + + // for (i = 0; i < ARRLEN(temp); i++) + // temp[i] = 128; + + // ret = __osContRamWrite(mq, channel, 1024, temp, FALSE); + // if (ret == 2) + // ret = __osContRamWrite(mq, channel, 1024, temp, FALSE); + // if (ret != 0) + // return ret; + + // ret = __osContRamRead(mq, channel, 1024, temp); + // if (ret == 2) + // ret = PFS_ERR_CONTRFAIL; + // if (ret != 0) + // return ret; + // if (temp[31] != 128) + // return PFS_ERR_DEVICE; + + // if (!__osMotorinitialized[channel]) + // { + for (i = 0; i < ARRLEN(_motorstartbuf); i++) + { + _motorstartbuf[i] = 1; + _motorstopbuf[i] = 0; + } + _MakeMotorData(channel, 1536, _motorstartbuf, &_MotorStartData[channel]); + _MakeMotorData(channel, 1536, _motorstopbuf, &_MotorStopData[channel]); + // __osMotorinitialized[channel] = 1; + // } + return 0; +} diff --git a/src/core1/done/io/pfschecker.c b/src/core1/done/io/pfschecker.c new file mode 100644 index 00000000..3b36a0b4 --- /dev/null +++ b/src/core1/done/io/pfschecker.c @@ -0,0 +1,207 @@ +#include +#include "controller.h" + +s32 corrupted_init(OSPfs *pfs, __OSInodeCache *cache); +s32 corrupted(OSPfs *pfs, __OSInodeUnit fpage, __OSInodeCache *cache); +s32 osPfsChecker(OSPfs *pfs) +{ + int j; //1156 + s32 ret; //1152 + __OSInodeUnit next_page; + __OSInode checked_inode; + __OSInode tmp_inode; //636 + __OSDir tmp_dir; + __OSInodeUnit file_next_node[16]; + __OSInodeCache cache; //56 + int fixed; //52 + u8 bank; //51 + s32 cc; //44 + s32 cl; //40 + int offset; //36 + + fixed = 0; + ret = __osCheckId(pfs); + if (ret == PFS_ERR_NEW_PACK) + ret = __osGetId(pfs); + if (ret != 0) + return ret; + ERRCK(corrupted_init(pfs, &cache)); + for (j = 0; j < pfs->dir_size; j++) + { + ERRCK(__osContRamRead(pfs->queue, pfs->channel, pfs->dir_table + j, (u8*)&tmp_dir)); + if (tmp_dir.company_code != 0 && tmp_dir.game_code != 0) + { + next_page = tmp_dir.start_page; + cc = 0; + cl = 0; + bank = 255; + while (next_page.ipage >= pfs->inode_start_page && next_page.inode_t.bank < pfs->banks && next_page.inode_t.page > 0 && next_page.inode_t.page < 128) + { + if (bank != next_page.inode_t.bank) + { + bank = next_page.inode_t.bank; + ret = __osPfsRWInode(pfs, &tmp_inode, OS_READ, bank); + if (ret != 0 && ret != PFS_ERR_INCONSISTENT) + return ret; + } + cc = corrupted(pfs, next_page, &cache) - cl; + if (cc != 0) + break; + cl = 1; + next_page = tmp_inode.inode_page[next_page.inode_t.page]; + } + if (cc == 0 && next_page.ipage == 1) + continue; + + tmp_dir.company_code = 0; + tmp_dir.game_code = 0; + tmp_dir.start_page.ipage = 0; + tmp_dir.status = DIR_STATUS_EMPTY; + tmp_dir.data_sum = 0; + SET_ACTIVEBANK_TO_ZERO; + ERRCK(__osContRamWrite(pfs->queue, pfs->channel, pfs->dir_table + j, (u8*)&tmp_dir, FALSE)); + fixed++; + } + else + { + if (tmp_dir.company_code == 0 && tmp_dir.game_code == 0) + continue; + tmp_dir.company_code = 0; + tmp_dir.game_code = 0; + tmp_dir.start_page.ipage = 0; + tmp_dir.status = DIR_STATUS_EMPTY; + tmp_dir.data_sum = 0; + + SET_ACTIVEBANK_TO_ZERO; + ERRCK(__osContRamWrite(pfs->queue, pfs->channel, pfs->dir_table + j, (u8*)&tmp_dir, FALSE)); + fixed++; + } + } + for (j = 0; j < pfs->dir_size; j++) + { + ERRCK(__osContRamRead(pfs->queue, pfs->channel, pfs->dir_table + j, (u8*)&tmp_dir)); + + if (tmp_dir.company_code != 0 && tmp_dir.game_code != 0 && + tmp_dir.start_page.ipage >= ((__OSInodeUnit *)&(pfs->inode_start_page) + 1)->ipage) //weird + { + file_next_node[j].ipage = tmp_dir.start_page.ipage; + } + else + { + file_next_node[j].ipage = 0; + } + } + for (bank = 0; bank < pfs->banks; bank++) + { + ret = __osPfsRWInode(pfs, &tmp_inode, 0, bank); + if (ret != 0 && ret != PFS_ERR_INCONSISTENT) + return ret; + if (bank > 0) + { + offset = 1; + } + else + { + offset = pfs->inode_start_page; + } + for (j = 0; j < offset; j++) + { + checked_inode.inode_page[j].ipage = tmp_inode.inode_page[j].ipage; + } + for (; j < 128; j++) + { + checked_inode.inode_page[j].ipage = 3; + } + for (j = 0; j < pfs->dir_size; j++) + { + while (file_next_node[j].inode_t.bank == bank && file_next_node[j].ipage >= ((__OSInodeUnit *)&(pfs->inode_start_page) + 1)->ipage) + { + u8 pp = file_next_node[j].inode_t.page; + file_next_node[j] = checked_inode.inode_page[pp] = tmp_inode.inode_page[pp]; + } + } + ERRCK(__osPfsRWInode(pfs, &checked_inode, OS_WRITE, bank)); + } + if (fixed) + pfs->status |= PFS_CORRUPTED; + else + pfs->status &= ~PFS_CORRUPTED; + + return 0; +} + +s32 corrupted_init(OSPfs *pfs, __OSInodeCache *cache) +{ + int i; + int n; + int offset; + u8 bank; + __OSInodeUnit tpage; + __OSInode tmp_inode; + s32 ret; + + for (i = 0; i < ARRLEN(cache->map); i++) + cache->map[i] = 0; + cache->bank = -1; + for (bank = 0; bank < pfs->banks; bank++) + { + if (bank > 0) + offset = 1; + else + offset = pfs->inode_start_page; + + ret = __osPfsRWInode(pfs, &tmp_inode, OS_READ, bank); + if (ret != 0 && ret != PFS_ERR_INCONSISTENT) + return ret; + for (i = offset; i < ARRLEN(tmp_inode.inode_page); i++) + { + tpage = tmp_inode.inode_page[i]; + if (tpage.ipage >= pfs->inode_start_page && tpage.inode_t.bank != bank) + { + n = (tpage.inode_t.page / 4) + ((tpage.inode_t.bank % PFS_ONE_PAGE) * BLOCKSIZE); + cache->map[n] |= 1 << (bank % PFS_ONE_PAGE); + } + } + } + return 0; +} + +s32 corrupted(OSPfs *pfs, __OSInodeUnit fpage, __OSInodeCache *cache) +{ + int j; + int n; + int hit; + u8 bank; + int offset; + s32 ret; + + hit = 0; + ret = 0; + n = (fpage.inode_t.page / 4) + (fpage.inode_t.bank % 8) * BLOCKSIZE; + for (bank = 0; bank < pfs->banks; bank++) + { + if (bank > 0) + offset = 1; + else + offset = pfs->inode_start_page; + if (bank == fpage.inode_t.bank || cache->map[n] & (1 << (bank % 8))) + { + if (bank != cache->bank) + { + ret = __osPfsRWInode(pfs, &cache->inode, 0, bank); + if (ret != 0 && ret != PFS_ERR_INCONSISTENT) + return ret; + cache->bank = bank; + } + + for (j = offset; hit < 2 && (j < ARRLEN(cache->inode.inode_page)); j++) + { + if (cache->inode.inode_page[j].ipage == fpage.ipage) + hit++; + } + if (1 < hit) + return PFS_ERR_NEW_PACK; + } + } + return hit; +} diff --git a/src/core1/done/io/pfsgetstatus.c b/src/core1/done/io/pfsgetstatus.c new file mode 100644 index 00000000..96bce3d2 --- /dev/null +++ b/src/core1/done/io/pfsgetstatus.c @@ -0,0 +1,26 @@ +#include +#include "controller.h" +#include "siint.h" + +OSPifRam __osPfsPifRam; +s32 __osPfsGetStatus(OSMesgQueue *queue, int channel) +{ + s32 ret; + OSMesg dummy; + u8 pattern; + OSContStatus data[4]; + ret = 0; + __osPfsRequestData(CONT_CMD_REQUEST_STATUS); + ret = __osSiRawStartDma(OS_WRITE, &__osPfsPifRam); + osRecvMesg(queue, &dummy, OS_MESG_BLOCK); + ret = __osSiRawStartDma(OS_READ, &__osPfsPifRam); + osRecvMesg(queue, &dummy, OS_MESG_BLOCK); + __osPfsGetInitData(&pattern, data); + if (((data[channel].status & CONT_CARD_ON) != 0) && ((data[channel].status & CONT_CARD_PULL) != 0)) + return PFS_ERR_NEW_PACK; + if ((data[channel].errno != 0) || ((data[channel].status & CONT_CARD_ON) == 0)) + return PFS_ERR_NOPACK; + if ((data[channel].status & CONT_ADDR_CRC_ER) != 0) + return PFS_ERR_CONTRFAIL; + return ret; +} diff --git a/src/core1/done/io/pfsinit.c b/src/core1/done/io/pfsinit.c new file mode 100644 index 00000000..46d70cb5 --- /dev/null +++ b/src/core1/done/io/pfsinit.c @@ -0,0 +1,24 @@ +#include +#include "controller.h" +#include "siint.h" + +s32 osPfsInit(OSMesgQueue *queue, OSPfs *pfs, int channel) +{ + s32 ret; + ret = 0; + __osSiGetAccess(); + ret = __osPfsGetStatus(queue, channel); + __osSiRelAccess(); + if (ret != 0) + return ret; + + pfs->queue = queue; + pfs->channel = channel; + pfs->status = 0; + pfs->activebank = -1; + ERRCK(__osGetId(pfs)); + + ret = osPfsChecker(pfs); + pfs->status |= PFS_INITIALIZED; + return ret; +} diff --git a/src/core1/done/io/pfsisplug.c b/src/core1/done/io/pfsisplug.c new file mode 100644 index 00000000..5add6ecb --- /dev/null +++ b/src/core1/done/io/pfsisplug.c @@ -0,0 +1,99 @@ +#include +#include "controller.h" +#include "siint.h" + +extern OSPifRam __osPfsPifRam; // TODO bss +s32 osPfsIsPlug(OSMesgQueue *queue, u8 *pattern) +{ + s32 ret; + OSMesg dummy; + u8 bitpattern; + OSContStatus data[MAXCONTROLLERS]; + int channel; + u8 bits; + int crc_error_cnt; + ret = 0; + bits = 0; + crc_error_cnt = 3; + __osSiGetAccess(); + while (TRUE) + { + __osPfsRequestData(CONT_CMD_REQUEST_STATUS); + ret = __osSiRawStartDma(OS_WRITE, &__osPfsPifRam); + osRecvMesg(queue, &dummy, OS_MESG_BLOCK); + ret = __osSiRawStartDma(OS_READ, &__osPfsPifRam); + osRecvMesg(queue, &dummy, OS_MESG_BLOCK); + __osPfsGetInitData(&bitpattern, data); + for (channel = 0; channel < __osMaxControllers; channel++) + { + if ((data[channel].status & CONT_ADDR_CRC_ER) == 0) + { + crc_error_cnt--; + break; + } + } + if (__osMaxControllers == channel) + crc_error_cnt = 0; + if (crc_error_cnt < 1) + { + for (channel = 0; channel < __osMaxControllers; channel++) + { + if (data[channel].errno == 0 && (data[channel].status & CONT_CARD_ON) != 0) + bits |= 1 << channel; + } + __osSiRelAccess(); + *pattern = bits; + return ret; + } + } +} +void __osPfsRequestData(u8 cmd) +{ + u8 *ptr; + __OSContRequesFormat requestformat; + int i; + __osContLastCmd = cmd; + + for (i = 0; i < ARRLEN(__osPfsPifRam.ramarray) + 1; i++) { // also clear pifstatus + __osPfsPifRam.ramarray[i] = 0; + } + + __osPfsPifRam.pifstatus = CONT_CMD_EXE; + ptr = (u8 *)&__osPfsPifRam; + requestformat.dummy = CONT_CMD_NOP; + requestformat.txsize = CONT_CMD_REQUEST_STATUS_TX; + requestformat.rxsize = CONT_CMD_REQUEST_STATUS_RX; + requestformat.cmd = cmd; + requestformat.typeh = CONT_CMD_NOP; + requestformat.typel = CONT_CMD_NOP; + requestformat.status = CONT_CMD_NOP; + requestformat.dummy1 = CONT_CMD_NOP; + for (i = 0; i < __osMaxControllers; i++) + { + *(__OSContRequesFormat *)ptr = requestformat; + ptr += sizeof(__OSContRequesFormat); + } + *ptr = CONT_CMD_END; +} +void __osPfsGetInitData(u8 *pattern, OSContStatus *data) +{ + u8 *ptr; + __OSContRequesFormat requestformat; + int i; + u8 bits; + bits = 0; + ptr = (u8 *)&__osPfsPifRam; + for (i = 0; i < __osMaxControllers; i++, ptr += sizeof(__OSContRequesFormat)) + { + requestformat = *(__OSContRequesFormat *)ptr; + data->errno = CHNL_ERR(requestformat); + if (data->errno == 0) + { + data->type = (requestformat.typel << 8) | (requestformat.typeh); + data->status = requestformat.status; + bits |= 1 << i; + } + data++; + } + *pattern = bits; +} diff --git a/src/core1/done/io/piacs.c b/src/core1/done/io/piacs.c new file mode 100644 index 00000000..67a55fb0 --- /dev/null +++ b/src/core1/done/io/piacs.c @@ -0,0 +1,24 @@ +#include + +#define PI_Q_BUF_LEN 1 +u32 __osPiAccessQueueEnabled = 0; +extern OSMesg piAccessBuf[PI_Q_BUF_LEN]; // todo bss +extern OSMesgQueue __osPiAccessQueue; +void __osPiCreateAccessQueue(void) +{ + + __osPiAccessQueueEnabled = 1; + osCreateMesgQueue(&__osPiAccessQueue, piAccessBuf, PI_Q_BUF_LEN); + osSendMesg(&__osPiAccessQueue, NULL, OS_MESG_NOBLOCK); +} +void __osPiGetAccess(void) +{ + OSMesg dummyMesg; + if (!__osPiAccessQueueEnabled) + __osPiCreateAccessQueue(); + osRecvMesg(&__osPiAccessQueue, &dummyMesg, OS_MESG_BLOCK); +} +void __osPiRelAccess(void) +{ + osSendMesg(&__osPiAccessQueue, NULL, OS_MESG_NOBLOCK); +} diff --git a/src/core1/done/io/pigetcmdq.c b/src/core1/done/io/pigetcmdq.c new file mode 100644 index 00000000..7f643890 --- /dev/null +++ b/src/core1/done/io/pigetcmdq.c @@ -0,0 +1,11 @@ +#include +#include "functions.h" +#include "variables.h" + +extern OSDevMgr __osPiDevMgr; + +OSMesgQueue *osPiGetCmdQueue(void){ + if (!__osPiDevMgr.active) + return NULL; + return __osPiDevMgr.cmdQueue; +} diff --git a/src/core1/done/io/pimgr.c b/src/core1/done/io/pimgr.c new file mode 100644 index 00000000..1b8e3761 --- /dev/null +++ b/src/core1/done/io/pimgr.c @@ -0,0 +1,50 @@ +#include +#include "piint.h" + + +extern u32 __osPiAccessQueueEnabled; + +OSDevMgr __osPiDevMgr = {0}; +OSPiHandle *__osPiTable = NULL; +OSPiHandle *__osCurrentHandle[2] = {&CartRomHandle, &LeoDiskHandle}; +extern OSThread piThread; +extern char piThreadStack[OS_PIM_STACKSIZE]; +extern OSMesgQueue piEventQueue; +extern OSMesg piEventBuf; + +void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt) +{ + u32 savedMask; + OSPri oldPri; + OSPri myPri; + if (!__osPiDevMgr.active) + { + osCreateMesgQueue(cmdQ, cmdBuf, cmdMsgCnt); + osCreateMesgQueue(&piEventQueue, (OSMesg*)&piEventBuf, 1); + if (!__osPiAccessQueueEnabled) + __osPiCreateAccessQueue(); + osSetEventMesg(OS_EVENT_PI, &piEventQueue, (OSMesg)0x22222222); + oldPri = -1; + myPri = osGetThreadPri(NULL); + if (myPri < pri) + { + oldPri = myPri; + osSetThreadPri(NULL, pri); + } + savedMask = __osDisableInt(); + __osPiDevMgr.active = 1; + __osPiDevMgr.thread = &piThread; + __osPiDevMgr.cmdQueue = cmdQ; + __osPiDevMgr.evtQueue = &piEventQueue; + __osPiDevMgr.acsQueue = &__osPiAccessQueue; + __osPiDevMgr.dma = osPiRawStartDma; + __osPiDevMgr.edma = osEPiRawStartDma; + osCreateThread(&piThread, 0, __osDevMgrMain, &__osPiDevMgr, &piThreadStack[OS_PIM_STACKSIZE], pri); + osStartThread(&piThread); + __osRestoreInt(savedMask); + if (oldPri != -1) + { + osSetThreadPri(NULL, oldPri); + } + } +} diff --git a/src/core1/done/io/pirawdma.c b/src/core1/done/io/pirawdma.c new file mode 100644 index 00000000..da9105e3 --- /dev/null +++ b/src/core1/done/io/pirawdma.c @@ -0,0 +1,28 @@ +#include + +#ifndef WAIT_ON_IOBUSY +#define WAIT_ON_IOBUSY(stat) \ + stat = IO_READ(PI_STATUS_REG); \ + while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) \ + stat = IO_READ(PI_STATUS_REG); +#endif + +s32 osPiRawStartDma(s32 direction, u32 devAddr, void *dramAddr, u32 size) +{ + register u32 stat; + WAIT_ON_IOBUSY(stat); + IO_WRITE(PI_DRAM_ADDR_REG, osVirtualToPhysical(dramAddr)); + IO_WRITE(PI_CART_ADDR_REG, K1_TO_PHYS((u32)osRomBase | devAddr)); + switch (direction) + { + case OS_READ: + IO_WRITE(PI_WR_LEN_REG, size - 1); + break; + case OS_WRITE: + IO_WRITE(PI_RD_LEN_REG, size - 1); + break; + default: + return -1; + } + return 0; +} diff --git a/src/core1/done/io/pirawread.c b/src/core1/done/io/pirawread.c new file mode 100644 index 00000000..33795911 --- /dev/null +++ b/src/core1/done/io/pirawread.c @@ -0,0 +1,11 @@ +#include +#include "piint.h" + +s32 osPiRawReadIo(u32 devAddr, u32 *data) +{ + register u32 stat; + WAIT_ON_IOBUSY(stat); + *data = IO_READ((u32)osRomBase | devAddr); + return 0; +} + diff --git a/src/core1/done/io/piread.c b/src/core1/done/io/piread.c new file mode 100644 index 00000000..5ce83c18 --- /dev/null +++ b/src/core1/done/io/piread.c @@ -0,0 +1,11 @@ +#include +#include "piint.h" + +s32 osPiReadIo(u32 devAddr, u32 *data) +{ + register s32 ret; + __osPiGetAccess(); + ret = osPiRawReadIo(devAddr, data); + __osPiRelAccess(); + return ret; +} diff --git a/src/core1/done/io/si.c b/src/core1/done/io/si.c new file mode 100644 index 00000000..8f821b6f --- /dev/null +++ b/src/core1/done/io/si.c @@ -0,0 +1,11 @@ +#include +#include "functions.h" +#include "variables.h" + +int __osSiDeviceBusy() +{ + register u32 stat = IO_READ(SI_STATUS_REG); + if (stat & (SI_STATUS_DMA_BUSY | SI_STATUS_RD_BUSY)) + return 1; + return 0; +} diff --git a/src/core1/done/io/siacs.c b/src/core1/done/io/siacs.c new file mode 100644 index 00000000..efe5693a --- /dev/null +++ b/src/core1/done/io/siacs.c @@ -0,0 +1,24 @@ +#include + +#define SI_Q_BUF_LEN 1 +u32 __osSiAccessQueueEnabled = 0; +extern OSMesg siAccessBuf[SI_Q_BUF_LEN]; +extern OSMesgQueue __osSiAccessQueue; + +void __osSiCreateAccessQueue(void) +{ + __osSiAccessQueueEnabled = 1; + osCreateMesgQueue(&__osSiAccessQueue, siAccessBuf, SI_Q_BUF_LEN); + osSendMesg(&__osSiAccessQueue, NULL, OS_MESG_NOBLOCK); +} +void __osSiGetAccess(void) +{ + OSMesg dummyMesg; + if (!__osSiAccessQueueEnabled) + __osSiCreateAccessQueue(); + osRecvMesg(&__osSiAccessQueue, &dummyMesg, OS_MESG_BLOCK); +} +void __osSiRelAccess(void) +{ + osSendMesg(&__osSiAccessQueue, NULL, OS_MESG_NOBLOCK); +} diff --git a/src/core1/done/io/siint.h b/src/core1/done/io/siint.h new file mode 100644 index 00000000..45bf56bf --- /dev/null +++ b/src/core1/done/io/siint.h @@ -0,0 +1,10 @@ +#ifndef _SIINT_H +#define _SIINT_H +#include +#include + +void __osSiGetAccess(void); +void __osSiRelAccess(void); +int __osSiDeviceBusy(void); +void __osSiCreateAccessQueue(void); +#endif diff --git a/src/core1/done/io/sirawdma.c b/src/core1/done/io/sirawdma.c new file mode 100644 index 00000000..40d92261 --- /dev/null +++ b/src/core1/done/io/sirawdma.c @@ -0,0 +1,22 @@ +#include + +s32 __osSiRawStartDma(s32 direction, void *dramAddr) +{ + if (__osSiDeviceBusy()) + return -1; + + if (direction == OS_WRITE) + osWritebackDCache(dramAddr, 64); + + IO_WRITE(SI_DRAM_ADDR_REG, osVirtualToPhysical(dramAddr)); + + if (direction == OS_READ) + IO_WRITE(SI_PIF_ADDR_RD64B_REG, 0x1FC007C0); + else + IO_WRITE(SI_PIF_ADDR_WR64B_REG, 0x1FC007C0); + + if (direction == OS_READ) + osInvalDCache(dramAddr, 64);//bzero(dramAddr, 64); + + return 0; +} diff --git a/src/core1/done/io/sirawread.c b/src/core1/done/io/sirawread.c new file mode 100644 index 00000000..5cecb6c9 --- /dev/null +++ b/src/core1/done/io/sirawread.c @@ -0,0 +1,9 @@ +#include + +s32 __osSiRawReadIo(u32 devAddr, u32 *data) +{ + if (__osSiDeviceBusy()) + return -1; + *data = IO_READ(devAddr); + return 0; +} diff --git a/src/core1/done/io/sirawwrite.c b/src/core1/done/io/sirawwrite.c new file mode 100644 index 00000000..74027b87 --- /dev/null +++ b/src/core1/done/io/sirawwrite.c @@ -0,0 +1,10 @@ +#include + +s32 __osSiRawWriteIo(u32 devAddr, u32 data) +{ + + if (__osSiDeviceBusy()) + return -1; + IO_WRITE(devAddr, data); + return 0; +} diff --git a/src/core1/done/io/sp.c b/src/core1/done/io/sp.c new file mode 100644 index 00000000..7b7d8c22 --- /dev/null +++ b/src/core1/done/io/sp.c @@ -0,0 +1,12 @@ +#include +#include +#include +#include "osint.h" + +int __osSpDeviceBusy() +{ + register u32 stat = IO_READ(SP_STATUS_REG); + if (stat & (SP_STATUS_DMA_BUSY | SP_STATUS_DMA_FULL | SP_STATUS_IO_FULL)) + return 1; + return 0; +} diff --git a/src/core1/done/io/spgetstat.c b/src/core1/done/io/spgetstat.c new file mode 100644 index 00000000..826e50e9 --- /dev/null +++ b/src/core1/done/io/spgetstat.c @@ -0,0 +1,7 @@ +#include +#include + +u32 __osSpGetStatus() +{ + return IO_READ(SP_STATUS_REG); +} diff --git a/src/core1/done/io/sprawdma.c b/src/core1/done/io/sprawdma.c new file mode 100644 index 00000000..26f77be3 --- /dev/null +++ b/src/core1/done/io/sprawdma.c @@ -0,0 +1,16 @@ +#include +#include +#include "osint.h" + +s32 __osSpRawStartDma(s32 direction, u32 devAddr, void *dramAddr, u32 size) +{ + if (__osSpDeviceBusy()) + return -1; + IO_WRITE(SP_MEM_ADDR_REG, devAddr); + IO_WRITE(SP_DRAM_ADDR_REG, osVirtualToPhysical(dramAddr)); + if (direction == OS_READ) + IO_WRITE(SP_WR_LEN_REG, size - 1); + else + IO_WRITE(SP_RD_LEN_REG, size - 1); + return 0; +} diff --git a/src/core1/done/io/spsetpc.c b/src/core1/done/io/spsetpc.c new file mode 100644 index 00000000..94c35ff2 --- /dev/null +++ b/src/core1/done/io/spsetpc.c @@ -0,0 +1,14 @@ +#include +#include + +s32 __osSpSetPc(u32 data) +{ + register u32 stat = IO_READ(SP_STATUS_REG); + if (!(stat & SP_STATUS_HALT)) + return -1; + else + { + IO_WRITE(SP_PC_REG, data); + } + return 0; +} diff --git a/src/core1/done/io/spsetstat.c b/src/core1/done/io/spsetstat.c new file mode 100644 index 00000000..408eac48 --- /dev/null +++ b/src/core1/done/io/spsetstat.c @@ -0,0 +1,6 @@ +#include +#include + +void __osSpSetStatus(u32 data){ + IO_WRITE(SP_STATUS_REG, data); +} diff --git a/src/core1/done/io/sptask.c b/src/core1/done/io/sptask.c new file mode 100644 index 00000000..c6339495 --- /dev/null +++ b/src/core1/done/io/sptask.c @@ -0,0 +1,61 @@ +#include + +#define _osVirtualToPhysical(ptr) \ + if (ptr != NULL) \ + { \ + ptr = (void *)osVirtualToPhysical(ptr); \ + } +extern OSTask tmp_task; // TODO bss (static) +static OSTask *_VirtualToPhysicalTask(OSTask *intp) +{ + OSTask *tp; + tp = &tmp_task; + bcopy(intp, tp, sizeof(OSTask)); + + _osVirtualToPhysical(tp->t.ucode); + _osVirtualToPhysical(tp->t.ucode_data); + _osVirtualToPhysical(tp->t.dram_stack); + _osVirtualToPhysical(tp->t.output_buff); + _osVirtualToPhysical(tp->t.output_buff_size); + _osVirtualToPhysical(tp->t.data_ptr); + _osVirtualToPhysical(tp->t.yield_data_ptr); + return tp; +} +void osSpTaskLoad(OSTask *intp) +{ + + OSTask *tp; + tp = _VirtualToPhysicalTask(intp); + if (tp->t.flags & OS_TASK_YIELDED) + { + tp->t.ucode_data = tp->t.yield_data_ptr; + tp->t.ucode_data_size = tp->t.yield_data_size; + intp->t.flags &= ~OS_TASK_YIELDED; + if (tp->t.flags & OS_TASK_LOADABLE) + tp->t.ucode = (u64 *)IO_READ((u32)intp->t.yield_data_ptr + OS_YIELD_DATA_SIZE - 4); + } + osWritebackDCache(tp, sizeof(OSTask)); + __osSpSetStatus(SP_CLR_YIELD | SP_CLR_YIELDED | SP_CLR_TASKDONE | SP_SET_INTR_BREAK); + while (__osSpSetPc(SP_IMEM_START) == -1) + ; + + while (__osSpRawStartDma(1, (SP_IMEM_START - sizeof(*tp)), tp, + sizeof(OSTask)) == -1) + ; + + while (__osSpDeviceBusy()) + ; + + while (__osSpRawStartDma(1, SP_IMEM_START, tp->t.ucode_boot, + tp->t.ucode_boot_size) == -1) + ; +} +void osSpTaskStartGo(OSTask *tp) +{ + + while (__osSpDeviceBusy()) + ; + + __osSpSetStatus(SP_SET_INTR_BREAK | SP_CLR_SSTEP | SP_CLR_BROKE | SP_CLR_HALT); + +} diff --git a/src/core1/done/io/sptaskyield.c b/src/core1/done/io/sptaskyield.c new file mode 100644 index 00000000..61d62f5c --- /dev/null +++ b/src/core1/done/io/sptaskyield.c @@ -0,0 +1,7 @@ +#include +#include + +void osSpTaskYield(void) +{ + __osSpSetStatus(SP_SET_YIELD); +} diff --git a/src/core1/done/io/sptaskyielded.c b/src/core1/done/io/sptaskyielded.c new file mode 100644 index 00000000..f036be12 --- /dev/null +++ b/src/core1/done/io/sptaskyielded.c @@ -0,0 +1,20 @@ +#include +#include +#include + +OSYieldResult osSpTaskYielded(OSTask *tp) +{ + u32 status; + OSYieldResult result; + status = __osSpGetStatus(); + if (status & SP_STATUS_YIELDED) + result = OS_TASK_YIELDED; + else + result = 0; + if (status & SP_STATUS_YIELD) + { + tp->t.flags |= result; + tp->t.flags &= ~(OS_TASK_DP_WAIT); + } + return result; +} diff --git a/src/core1/done/io/vi.c b/src/core1/done/io/vi.c new file mode 100644 index 00000000..1b33e077 --- /dev/null +++ b/src/core1/done/io/vi.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include "viint.h" + +static __OSViContext vi[2] = {0}; +__OSViContext *__osViCurr = &vi[0]; +__OSViContext *__osViNext = &vi[1]; +void __osViInit(void) +{ + bzero(vi, sizeof(vi)); + __osViCurr = &vi[0]; + __osViNext = &vi[1]; + __osViNext->retraceCount = 1; + __osViCurr->retraceCount = 1; + __osViNext->framep = (void*)K0BASE; + __osViCurr->framep = (void*)K0BASE; + if (osTvType == OS_TV_TYPE_PAL) + { + __osViNext->modep = &osViModePalLan1; + } + else if (osTvType == OS_TV_TYPE_MPAL) + { + __osViNext->modep = &osViModeMpalLan1; + } + else + { + __osViNext->modep = &osViModeNtscLan1; + } + __osViNext->state = VI_STATE_BLACK; + __osViNext->control = __osViNext->modep->comRegs.ctrl; + while (IO_READ(VI_CURRENT_REG) > 10) //wait for vsync? + ; + IO_WRITE(VI_CONTROL_REG, 0); //pixel size blank (no data, no sync) + __osViSwapContext(); +} diff --git a/src/core1/done/io/viblack.c b/src/core1/done/io/viblack.c new file mode 100644 index 00000000..37190a08 --- /dev/null +++ b/src/core1/done/io/viblack.c @@ -0,0 +1,14 @@ +#include +#include "functions.h" +#include "variables.h" +#include "viint.h" + +void osViBlack(u8 active) +{ + register u32 saveMask = __osDisableInt(); + if (active) + __osViNext->state |= VI_STATE_BLACK; + else + __osViNext->state &= ~VI_STATE_BLACK; + __osRestoreInt(saveMask); +} diff --git a/src/core1/done/io/vigetcurrcontext.c b/src/core1/done/io/vigetcurrcontext.c new file mode 100644 index 00000000..b2fe98ea --- /dev/null +++ b/src/core1/done/io/vigetcurrcontext.c @@ -0,0 +1,7 @@ +#include +#include "viint.h" + +__OSViContext *__osViGetCurrentContext(void) +{ + return __osViCurr; +} diff --git a/src/core1/done/io/vigetcurrframebuf.c b/src/core1/done/io/vigetcurrframebuf.c new file mode 100644 index 00000000..62c74896 --- /dev/null +++ b/src/core1/done/io/vigetcurrframebuf.c @@ -0,0 +1,12 @@ +#include +#include "viint.h" + +void *osViGetCurrentFramebuffer(void) +{ + register u32 saveMask; + void *framep; + saveMask = __osDisableInt(); + framep = __osViCurr->framep; + __osRestoreInt(saveMask); + return framep; +} diff --git a/src/core1/done/io/vigetnextframebuf.c b/src/core1/done/io/vigetnextframebuf.c new file mode 100644 index 00000000..5b580ba9 --- /dev/null +++ b/src/core1/done/io/vigetnextframebuf.c @@ -0,0 +1,14 @@ +#include +#include "functions.h" +#include "variables.h" +#include "viint.h" + +void *osViGetNextFramebuffer(void) +{ + register u32 saveMask; + void *framep; + saveMask = __osDisableInt(); + framep = __osViNext->framep; + __osRestoreInt(saveMask); + return framep; +} diff --git a/src/core1/done/io/vimgr.c b/src/core1/done/io/vimgr.c new file mode 100644 index 00000000..358b3772 --- /dev/null +++ b/src/core1/done/io/vimgr.c @@ -0,0 +1,107 @@ +#include +#include +#include "viint.h" +#include "osint.h" + +OSDevMgr __osViDevMgr = {0}; +/*static*/ OSThread viThread; +/*static*/ unsigned char viThreadStack[OS_VIM_STACKSIZE]; +/*static*/ OSMesgQueue viEventQueue; +/*static*/ OSMesg viEventBuf[5]; +/*static*/ OSIoMesg viRetraceMsg; +/*static*/ OSIoMesg viCounterMsg; + +static void viMgrMain(void *arg); +void osCreateViManager(OSPri pri) +{ + u32 savedMask; + OSPri oldPri; + OSPri myPri; + if (__osViDevMgr.active == 0) + { + __osTimerServicesInit(); + osCreateMesgQueue(&viEventQueue, viEventBuf, 5); + viRetraceMsg.hdr.type = OS_MESG_TYPE_VRETRACE; + viRetraceMsg.hdr.pri = OS_MESG_PRI_NORMAL; + viRetraceMsg.hdr.retQueue = NULL; + viCounterMsg.hdr.type = OS_MESG_TYPE_COUNTER; + viCounterMsg.hdr.pri = OS_MESG_PRI_NORMAL; + viCounterMsg.hdr.retQueue = NULL; + osSetEventMesg(OS_EVENT_VI, &viEventQueue, &viRetraceMsg); + osSetEventMesg(OS_EVENT_COUNTER, &viEventQueue, &viCounterMsg); + oldPri = -1; + myPri = osGetThreadPri(NULL); + if (myPri < pri) + { + oldPri = myPri; + osSetThreadPri(NULL, pri); + } + savedMask = __osDisableInt(); + __osViDevMgr.active = 1; + __osViDevMgr.thread = &viThread; + __osViDevMgr.cmdQueue = &viEventQueue; + __osViDevMgr.evtQueue = &viEventQueue; + __osViDevMgr.acsQueue = NULL; + __osViDevMgr.dma = NULL; + __osViDevMgr.edma = NULL; + osCreateThread(&viThread, 0, viMgrMain, &__osViDevMgr, &viThreadStack[OS_VIM_STACKSIZE], pri); + __osViInit(); + osStartThread(&viThread); + __osRestoreInt(savedMask); + if (oldPri != -1) + { + osSetThreadPri(0, oldPri); + } + } +} +extern u16 retrace; +static void viMgrMain(void *arg) +{ + __OSViContext *vc; + OSDevMgr *dm; + OSIoMesg *mb; + // static u16 retrace; + s32 first; + u32 count; + + mb = NULL; + first = 0; + vc = __osViGetCurrentContext(); + retrace = vc->retraceCount; + if (retrace == 0) + retrace = 1; + dm = (OSDevMgr *)arg; + while (TRUE) + { + osRecvMesg(dm->evtQueue, (OSMesg)&mb, OS_MESG_BLOCK); + switch (mb->hdr.type) + { + case OS_MESG_TYPE_VRETRACE: + __osViSwapContext(); + retrace--; + if (retrace == 0) + { + vc = __osViGetCurrentContext(); + if (vc->msgq != NULL) + osSendMesg(vc->msgq, vc->msg, OS_MESG_NOBLOCK); + retrace = vc->retraceCount; + } + __osViIntrCount++; + if (first) + { + + count = osGetCount(); + __osCurrentTime = count; + first = 0; + } + count = __osBaseCounter; + __osBaseCounter = osGetCount(); + count = __osBaseCounter - count; + __osCurrentTime = __osCurrentTime + count; + break; + case OS_MESG_TYPE_COUNTER: + __osTimerInterrupt(); + break; + } + } +} diff --git a/src/core1/done/io/vimodempallan1.c b/src/core1/done/io/vimodempallan1.c new file mode 100644 index 00000000..3246075b --- /dev/null +++ b/src/core1/done/io/vimodempallan1.c @@ -0,0 +1,36 @@ +#include +#include +#include "viint.h" + +OSViMode osViModeMpalLan1 = { + OS_VI_MPAL_LAN1, // type + { + // comRegs + VI_CTRL_TYPE_16 | VI_CTRL_GAMMA_DITHER_ON | VI_CTRL_GAMMA_ON | + VI_CTRL_DIVOT_ON | VI_CTRL_ANTIALIAS_MODE_1 | 0x3000, // ctrl + WIDTH(320), // width + BURST(57, 30, 5, 70), // burst + VSYNC(525), // vSync + HSYNC(3089, 4), // hSync + LEAP(3097, 3098), // leap + HSTART(108, 748), // hStart + SCALE(2, 0), // xScale + VCURRENT(0), // vCurrent + }, + {// fldRegs + { + //[0] + ORIGIN(640), // origin + SCALE(1, 0), // yScale + HSTART(37, 511), // vStart + BURST(4, 2, 14, 0), // vBurst + VINTR(2), // vIntr + }, + { + //[1] + ORIGIN(640), // origin + SCALE(1, 0), // yScale + HSTART(37, 511), // vStart + BURST(4, 2, 14, 0), // vBurst + VINTR(2), // vIntr + }}}; diff --git a/src/core1/done/io/vimodentsclan1.c b/src/core1/done/io/vimodentsclan1.c new file mode 100644 index 00000000..696cd683 --- /dev/null +++ b/src/core1/done/io/vimodentsclan1.c @@ -0,0 +1,36 @@ +#include +#include +#include "viint.h" + +OSViMode osViModeNtscLan1 = { + OS_VI_NTSC_LAN1, // type + { + // comRegs + VI_CTRL_TYPE_16 | VI_CTRL_GAMMA_DITHER_ON | VI_CTRL_GAMMA_ON | + VI_CTRL_DIVOT_ON | VI_CTRL_ANTIALIAS_MODE_1 | 0x3000, // ctrl + WIDTH(320), // width + BURST(57, 34, 5, 62), // burst + VSYNC(525), // vSync + HSYNC(3093, 0), // hSync + LEAP(3093, 3093), // leap + HSTART(108, 748), // hStart + SCALE(2, 0), // xScale + VCURRENT(0), // vCurrent + }, + {// fldRegs + { + //[0] + ORIGIN(640), // origin + SCALE(1, 0), // yScale + HSTART(37, 511), // vStart + BURST(4, 2, 14, 0), // vBurst + VINTR(2), // vIntr + }, + { + //[1] + ORIGIN(640), // origin + SCALE(1, 0), // yScale + HSTART(37, 511), // vStart + BURST(4, 2, 14, 0), // vBurst + VINTR(2), // vIntr + }}}; diff --git a/src/core1/done/io/vimodepallan1.c b/src/core1/done/io/vimodepallan1.c new file mode 100644 index 00000000..35f8496c --- /dev/null +++ b/src/core1/done/io/vimodepallan1.c @@ -0,0 +1,36 @@ +#include +#include +#include "viint.h" + +OSViMode osViModePalLan1 = { + OS_VI_PAL_LAN1, // type + { + // comRegs + VI_CTRL_TYPE_16 | VI_CTRL_GAMMA_DITHER_ON | VI_CTRL_GAMMA_ON | + VI_CTRL_DIVOT_ON | VI_CTRL_ANTIALIAS_MODE_1 | 0x3000, // ctrl + WIDTH(320), // width + BURST(58, 30, 4, 69), // burst + VSYNC(625), // vSync + HSYNC(3177, 23), // hSync + LEAP(3183, 3181), // leap + HSTART(128, 768), // hStart + SCALE(2, 0), // xScale + VCURRENT(0), // vCurrent + }, + {// fldRegs + { + //[0] + ORIGIN(640), // origin + SCALE(1, 0), // yScale + HSTART(95, 569), // vStart + BURST(107, 2, 9, 0), // vBurst + VINTR(2), // vIntr + }, + { + //[1] + ORIGIN(640), // origin + SCALE(1, 0), // yScale + HSTART(95, 569), // vStart + BURST(107, 2, 9, 0), // vBurst + VINTR(2), // vIntr + }}}; diff --git a/src/core1/done/io/visetevent.c b/src/core1/done/io/visetevent.c new file mode 100644 index 00000000..28ae7d12 --- /dev/null +++ b/src/core1/done/io/visetevent.c @@ -0,0 +1,13 @@ +#include +#include "functions.h" +#include "variables.h" +#include "viint.h" + +void osViSetEvent(OSMesgQueue *mq, OSMesg m, u32 retraceCount){ + register u32 saveMask; + saveMask = __osDisableInt(); + __osViNext->msgq = mq; + __osViNext->msg = m; + __osViNext->retraceCount = retraceCount; + __osRestoreInt(saveMask); +} diff --git a/src/core1/done/io/visetmode.c b/src/core1/done/io/visetmode.c new file mode 100644 index 00000000..7c1d43a6 --- /dev/null +++ b/src/core1/done/io/visetmode.c @@ -0,0 +1,12 @@ +#include +#include "viint.h" + +void osViSetMode(OSViMode *modep) +{ + register u32 saveMask; + saveMask = __osDisableInt(); + __osViNext->modep = modep; + __osViNext->state = VI_STATE_01; + __osViNext->control = __osViNext->modep->comRegs.ctrl; + __osRestoreInt(saveMask); +} diff --git a/src/core1/done/io/visetspecial.c b/src/core1/done/io/visetspecial.c new file mode 100644 index 00000000..31e027ae --- /dev/null +++ b/src/core1/done/io/visetspecial.c @@ -0,0 +1,38 @@ +#include +#include +#include "viint.h" + +void osViSetSpecialFeatures(u32 func){ + + register u32 saveMask; + saveMask = __osDisableInt(); + if ((func & OS_VI_GAMMA_ON) != 0) { + __osViNext->control |= VI_CTRL_GAMMA_ON; + } + if ((func & OS_VI_GAMMA_OFF) != 0) { + __osViNext->control &= ~VI_CTRL_GAMMA_ON; + } + if ((func & OS_VI_GAMMA_DITHER_ON) != 0) { + __osViNext->control |= VI_CTRL_GAMMA_DITHER_ON; + } + if ((func & OS_VI_GAMMA_DITHER_OFF) != 0) { + __osViNext->control &= ~VI_CTRL_GAMMA_DITHER_ON; + } + if ((func & OS_VI_DIVOT_ON) != 0) { + __osViNext->control |= VI_CTRL_DIVOT_ON; + } + if ((func & OS_VI_DIVOT_OFF) != 0) { + __osViNext->control &= ~VI_CTRL_DIVOT_ON; + } + if ((func & OS_VI_DITHER_FILTER_ON) != 0) { + __osViNext->control |= VI_CTRL_DITHER_FILTER_ON; + __osViNext->control &= ~VI_CTRL_ANTIALIAS_MASK; + } + if ((func & OS_VI_DITHER_FILTER_OFF) != 0) { + __osViNext->control &= ~VI_CTRL_DITHER_FILTER_ON; + __osViNext->control |= __osViNext->modep->comRegs.ctrl & VI_CTRL_ANTIALIAS_MASK; + } + __osViNext->state |= VI_STATE_08; + + __osRestoreInt(saveMask); +} diff --git a/src/core1/done/io/viswapbuf.c b/src/core1/done/io/viswapbuf.c new file mode 100644 index 00000000..e29eb463 --- /dev/null +++ b/src/core1/done/io/viswapbuf.c @@ -0,0 +1,11 @@ +#include +#include "functions.h" +#include "variables.h" +#include "viint.h" + +void osViSwapBuffer(void* frameBufPtr){ + u32 saveMask = __osDisableInt(); + __osViNext->framep = frameBufPtr; + __osViNext->state |= VI_STATE_10; + __osRestoreInt(saveMask); +} diff --git a/src/core1/done/io/viswapcontext.c b/src/core1/done/io/viswapcontext.c new file mode 100644 index 00000000..34795453 --- /dev/null +++ b/src/core1/done/io/viswapcontext.c @@ -0,0 +1,71 @@ +#include +#include +#include "viint.h" + +void __osViSwapContext() +{ + register OSViMode *vm; + register __OSViContext *vc; + u32 origin; + u32 hStart; + u32 nomValue; + u32 field; + + field = 0; + vc = __osViNext; + vm = vc->modep; + + field = IO_READ(VI_CURRENT_REG) & 1; //field num + + origin = osVirtualToPhysical(vc->framep) + (vm->fldRegs[field].origin); + if (vc->state & VI_STATE_XSCALE_UPDATED) + { + vc->x.scale |= (vm->comRegs.xScale & ~VI_SCALE_MASK); + } + else + { + vc->x.scale = vm->comRegs.xScale; + } + if (vc->state & VI_STATE_YSCALE_UPDATED) + { + nomValue = vm->fldRegs[field].yScale & VI_SCALE_MASK; + vc->y.scale = vc->y.factor * nomValue; + vc->y.scale |= vm->fldRegs[field].yScale & ~VI_SCALE_MASK; + } + else + { + vc->y.scale = vm->fldRegs[field].yScale; + } + hStart = vm->comRegs.hStart; + if (vc->state & VI_STATE_BLACK) + { + hStart = 0; + } + if (vc->state & VI_STATE_REPEATLINE) + { + vc->y.scale = 0; + origin = osVirtualToPhysical(vc->framep); + } + if (vc->state & VI_STATE_FADE) + { + vc->y.scale = (vc->y.offset << VI_SUBPIXEL_SH) & (VI_2_10_FPART_MASK << VI_SUBPIXEL_SH); + origin = osVirtualToPhysical(vc->framep); + } + IO_WRITE(VI_ORIGIN_REG, origin); + IO_WRITE(VI_WIDTH_REG, vm->comRegs.width); + IO_WRITE(VI_BURST_REG, vm->comRegs.burst); + IO_WRITE(VI_V_SYNC_REG, vm->comRegs.vSync); + IO_WRITE(VI_H_SYNC_REG, vm->comRegs.hSync); + IO_WRITE(VI_LEAP_REG, vm->comRegs.leap); + IO_WRITE(VI_H_START_REG, hStart); + IO_WRITE(VI_V_START_REG, vm->fldRegs[field].vStart); + IO_WRITE(VI_V_BURST_REG, vm->fldRegs[field].vBurst); + IO_WRITE(VI_INTR_REG, vm->fldRegs[field].vIntr); + IO_WRITE(VI_X_SCALE_REG, vc->x.scale); + IO_WRITE(VI_Y_SCALE_REG, vc->y.scale); + IO_WRITE(VI_CONTROL_REG, vc->control); + + __osViNext = __osViCurr; + __osViCurr = vc; + *__osViNext = *__osViCurr; +} diff --git a/src/core1/done/ll.c b/src/core1/done/ll.c new file mode 100644 index 00000000..a50fc92d --- /dev/null +++ b/src/core1/done/ll.c @@ -0,0 +1,53 @@ +unsigned long long __ull_rshift(unsigned long long a0, unsigned long long a1) +{ + return a0 >> a1; +} +unsigned long long __ull_rem(unsigned long long a0, unsigned long long a1) +{ + return a0 % a1; +} +unsigned long long __ull_div(unsigned long long a0, unsigned long long a1) +{ + return a0 / a1; +} + +unsigned long long __ll_lshift(unsigned long long a0, unsigned long long a1) +{ + return a0 << a1; +} + +long long __ll_rem(unsigned long long a0, long long a1) +{ + return a0 % a1; +} + +long long __ll_div(long long a0, long long a1) +{ + return a0 / a1; +} + +unsigned long long __ll_mul(unsigned long long a0, unsigned long long a1) +{ + return a0 * a1; +} + +void __ull_divremi(unsigned long long *div, unsigned long long *rem, unsigned long long a2, unsigned short a3) +{ + *div = a2 / a3; + *rem = a2 % a3; +} +long long __ll_mod(long long a0, long long a1) +{ + long long tmp = a0 % a1; + if ((tmp < 0 && a1 > 0) || (tmp > 0 && a1 < 0)) + { + + tmp += a1; + } + return tmp; +} + +long long __ll_rshift(long long a0, long long a1) +{ + return a0 >> a1; +} diff --git a/src/core1/done/os/createmesgqueue.c b/src/core1/done/os/createmesgqueue.c new file mode 100644 index 00000000..97ad6a04 --- /dev/null +++ b/src/core1/done/os/createmesgqueue.c @@ -0,0 +1,19 @@ +#include +#include "functions.h" +#include "variables.h" + +extern struct __osThreadTail +{ + OSThread *next; + OSPri priority; +} __osThreadTail; + +void osCreateMesgQueue(OSMesgQueue *mq, OSMesg *msg, s32 msgCount) +{ + mq->mtqueue = (OSThread *)&__osThreadTail; + mq->fullqueue = (OSThread *)&__osThreadTail; + mq->validCount = 0; + mq->first = 0; + mq->msgCount = msgCount; + mq->msg = msg; +} diff --git a/src/core1/done/os/createthread.c b/src/core1/done/os/createthread.c new file mode 100644 index 00000000..80748844 --- /dev/null +++ b/src/core1/done/os/createthread.c @@ -0,0 +1,31 @@ +#include +#include "functions.h" +#include "variables.h" + +void __osCleanupThread(void); +extern OSThread *__osActiveQueue; +void osCreateThread(OSThread *t, OSId id, void (*entry)(void *), void *arg, void *sp, OSPri p) +{ + register u32 saveMask; + OSIntMask mask; + t->id = id; + t->priority = p; + t->next = NULL; + t->queue = NULL; + t->context.pc = (u32)entry; + t->context.a0 = (u64)arg; + t->context.sp = (u64)sp - 16; + t->context.ra = (u64)__osCleanupThread; + // t->context.ra = (u64)func_8026ABE0; + mask = OS_IM_ALL; + t->context.sr = SR_IMASK | SR_EXL | SR_IE; + t->context.rcp = (mask & RCP_IMASK) >> RCP_IMASKSHIFT; + t->context.fpcsr = (u32)(FPCSR_FS | FPCSR_EV); + t->fp = 0; + t->state = OS_STATE_STOPPED; + t->flags = 0; + saveMask = __osDisableInt(); + t->tlnext = __osActiveQueue; + __osActiveQueue = t; + __osRestoreInt(saveMask); +} diff --git a/src/core1/done/os/destroythread.c b/src/core1/done/os/destroythread.c new file mode 100644 index 00000000..69e57803 --- /dev/null +++ b/src/core1/done/os/destroythread.c @@ -0,0 +1,48 @@ +#include +#include "functions.h" +#include "variables.h" + +extern OSThread *__osRunningThread; +extern OSThread *__osActiveQueue; +extern void __osDispatchThread(void); + +void osDestroyThread(OSThread *t) +{ + register u32 saveMask; + register OSThread *pred; + register OSThread *succ; + saveMask = __osDisableInt(); + if (t == NULL) + { + t = __osRunningThread; + } + else + { + if (t->state != OS_STATE_STOPPED) + { + __osDequeueThread(t->queue, t); + } + } + if (__osActiveQueue == t) + { + __osActiveQueue = __osActiveQueue->tlnext; + } + else + { + pred = __osActiveQueue; + while (succ = pred->tlnext) + { + if (succ == t) + { + pred->tlnext = t->tlnext; + break; + } + pred = succ; + } + } + if (t == __osRunningThread) + { + __osDispatchThread(); + } + __osRestoreInt(saveMask); +} diff --git a/src/core1/done/os/getthreadpri.c b/src/core1/done/os/getthreadpri.c new file mode 100644 index 00000000..efeaf729 --- /dev/null +++ b/src/core1/done/os/getthreadpri.c @@ -0,0 +1,12 @@ +#include +#include "functions.h" +#include "variables.h" + +extern OSThread *__osRunningThread; + +OSPri osGetThreadPri(OSThread *thread) +{ + if (thread == NULL) + thread = __osRunningThread; + return thread->priority; +} diff --git a/src/core1/done/os/gettime.c b/src/core1/done/os/gettime.c new file mode 100644 index 00000000..0f4b981c --- /dev/null +++ b/src/core1/done/os/gettime.c @@ -0,0 +1,17 @@ +#include +#include "osint.h" + + +OSTime osGetTime() +{ + u32 tmptime; + u32 elapseCount; + OSTime currentCount; + register u32 saveMask; + saveMask = __osDisableInt(); + tmptime = osGetCount(); + elapseCount = tmptime - __osBaseCounter; + currentCount = __osCurrentTime; + __osRestoreInt(saveMask); + return currentCount + elapseCount; +} diff --git a/src/core1/done/os/jammesg.c b/src/core1/done/os/jammesg.c new file mode 100644 index 00000000..43fa40b0 --- /dev/null +++ b/src/core1/done/os/jammesg.c @@ -0,0 +1,33 @@ +#include +#include "functions.h" +#include "variables.h" + +extern OSThread *__osRunningThread; + +s32 osJamMesg(OSMesgQueue *mq, OSMesg msg, s32 flag) +{ + register u32 saveMask = __osDisableInt(); + while (mq->validCount >= mq->msgCount) + { + if (flag == OS_MESG_BLOCK) + { + __osRunningThread->state = OS_STATE_WAITING; + __osEnqueueAndYield(&mq->fullqueue); + } + else + { + __osRestoreInt(saveMask); + return -1; + } + } + + mq->first = (mq->first + mq->msgCount - 1) % mq->msgCount; + mq->msg[mq->first] = msg; + mq->validCount++; + if (mq->mtqueue->next != NULL) + { + osStartThread(__osPopThread(&mq->mtqueue)); + } + __osRestoreInt(saveMask); + return 0; +} diff --git a/src/core1/done/os/pidma.c b/src/core1/done/os/pidma.c new file mode 100644 index 00000000..61adc721 --- /dev/null +++ b/src/core1/done/os/pidma.c @@ -0,0 +1,31 @@ +#include +#include "functions.h" +#include "variables.h" + +extern OSDevMgr __osPiDevMgr; + +s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, u32 devAddr, void *dramAddr, u32 size, OSMesgQueue *mq) +{ + register s32 ret; + if (!__osPiDevMgr.active) + return -1; + if (direction == OS_READ) + mb->hdr.type = OS_MESG_TYPE_DMAREAD; + else + mb->hdr.type = OS_MESG_TYPE_DMAWRITE; + mb->hdr.pri = priority; + mb->hdr.retQueue = mq; + mb->dramAddr = dramAddr; + mb->devAddr = devAddr; + mb->size = size; + mb->piHandle = NULL; + if (priority == OS_MESG_PRI_HIGH) + { + ret = osJamMesg(osPiGetCmdQueue(), (OSMesg)mb, OS_MESG_NOBLOCK); + } + else + { + ret = osSendMesg(osPiGetCmdQueue(), (OSMesg)mb, OS_MESG_NOBLOCK); + } + return ret; +} diff --git a/src/core1/done/os/recvmesg.c b/src/core1/done/os/recvmesg.c new file mode 100644 index 00000000..d8dccc69 --- /dev/null +++ b/src/core1/done/os/recvmesg.c @@ -0,0 +1,35 @@ +#include +#include "functions.h" +#include "variables.h" + +extern OSThread *__osRunningThread;//_osRunningThread; + +s32 osRecvMesg(OSMesgQueue *mq, OSMesg *msg, s32 flags) +{ + register u32 saveMask; + saveMask = __osDisableInt(); + + while (MQ_IS_EMPTY(mq)) + { + if (flags == OS_MESG_NOBLOCK) + { + __osRestoreInt(saveMask); + return -1; + } + __osRunningThread->state = OS_STATE_WAITING; + __osEnqueueAndYield(&mq->mtqueue); + } + + if (msg != NULL) + { + *msg = mq->msg[mq->first]; + } + mq->first = (mq->first + 1) % mq->msgCount; + mq->validCount--; + if (mq->fullqueue->next != NULL) + { + osStartThread(__osPopThread(&mq->fullqueue)); + } + __osRestoreInt(saveMask); + return 0; +} diff --git a/src/core1/done/os/resetglobalintmask.c b/src/core1/done/os/resetglobalintmask.c new file mode 100644 index 00000000..d849dfd7 --- /dev/null +++ b/src/core1/done/os/resetglobalintmask.c @@ -0,0 +1,13 @@ +#include +#include + +void __osResetGlobalIntMask(OSHWIntr interrupt) +{ + register u32 saveMask = __osDisableInt(); + + //not sure about these constants, SR_IBIT3 is external level 3 INT0, which I think corresponds to the rcp + //os.h has several masks defined that end in 401 but non that are just 401 + __OSGlobalIntMask &= ~(interrupt & ~(SR_IBIT3 | SR_IE)); + + __osRestoreInt(saveMask); +} diff --git a/src/core1/done/os/sendmesg.c b/src/core1/done/os/sendmesg.c new file mode 100644 index 00000000..aea77379 --- /dev/null +++ b/src/core1/done/os/sendmesg.c @@ -0,0 +1,34 @@ +#include +#include "functions.h" +#include "variables.h" + +extern OSThread *__osRunningThread; + +s32 osSendMesg(OSMesgQueue *mq, OSMesg msg, s32 flags) +{ + register u32 saveMask; + register s32 last; + saveMask = __osDisableInt(); + while (MQ_IS_FULL(mq)) + { + if (flags == OS_MESG_BLOCK) + { + __osRunningThread->state = OS_STATE_WAITING; + __osEnqueueAndYield(&mq->fullqueue); + } + else + { + __osRestoreInt(saveMask); + return -1; + } + } + last = (mq->first + mq->validCount) % mq->msgCount; + mq->msg[last] = msg; + mq->validCount++; + if (mq->mtqueue->next != NULL) + { + osStartThread(__osPopThread(&mq->mtqueue)); + } + __osRestoreInt(saveMask); + return 0; +} diff --git a/src/core1/done/os/seteventmesg.c b/src/core1/done/os/seteventmesg.c new file mode 100644 index 00000000..5911e2f5 --- /dev/null +++ b/src/core1/done/os/seteventmesg.c @@ -0,0 +1,13 @@ +#include +#include "osint.h" +__OSEventState __osEventStateTab[OS_NUM_EVENTS]; +void osSetEventMesg(OSEvent event, OSMesgQueue *mq, OSMesg msg) +{ + register u32 saveMask = __osDisableInt(); + __OSEventState *es; + + es = &__osEventStateTab[event]; + es->messageQueue = mq; + es->message = msg; + __osRestoreInt(saveMask); +} diff --git a/src/core1/done/os/setglobalintmask.c b/src/core1/done/os/setglobalintmask.c new file mode 100644 index 00000000..3fda389a --- /dev/null +++ b/src/core1/done/os/setglobalintmask.c @@ -0,0 +1,9 @@ +#include +#include + +void __osSetGlobalIntMask(OSHWIntr mask) +{ + register u32 saveMask = __osDisableInt(); + __OSGlobalIntMask |= mask; + __osRestoreInt(saveMask); +} diff --git a/src/core1/done/os/settimer.c b/src/core1/done/os/settimer.c new file mode 100644 index 00000000..6dbf92d5 --- /dev/null +++ b/src/core1/done/os/settimer.c @@ -0,0 +1,19 @@ +#include +#include "osint.h" +int osSetTimer(OSTimer *t, OSTime value, OSTime interval, OSMesgQueue *mq, OSMesg msg) +{ + OSTime time; + t->next = NULL; + t->prev = NULL; + t->interval = interval; + if(value != 0) t->value = value; + else t->value = interval; + t->mq = mq; + t->msg = msg; + time = __osInsertTimer(t); + if(__osTimerList->next == t) { + __osSetTimerIntr(time); + } + return 0; +} + diff --git a/src/core1/done/os/settreadpri.c b/src/core1/done/os/settreadpri.c new file mode 100644 index 00000000..c4cf1bac --- /dev/null +++ b/src/core1/done/os/settreadpri.c @@ -0,0 +1,28 @@ +#include +#include "functions.h" +#include "variables.h" + +extern OSThread *__osRunningThread; +extern OSThread *__osRunQueue; + +void osSetThreadPri(OSThread *t, OSPri pri) +{ + register u32 saveMask = __osDisableInt(); + if (t == NULL) + t = __osRunningThread; + if (t->priority != pri) + { + t->priority = pri; + if (t != __osRunningThread && t->state != OS_STATE_STOPPED) + { + __osDequeueThread(t->queue, t); + __osEnqueueThread(t->queue, t); + } + if (__osRunningThread->priority < __osRunQueue->priority) + { + __osRunningThread->state = OS_STATE_RUNNABLE; + __osEnqueueAndYield(&__osRunQueue); + } + } + __osRestoreInt(saveMask); +} diff --git a/src/core1/done/os/startthread.c b/src/core1/done/os/startthread.c new file mode 100644 index 00000000..7158bbdf --- /dev/null +++ b/src/core1/done/os/startthread.c @@ -0,0 +1,45 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern OSThread * __osRunQueue; +extern OSThread * __osRunningThread; + +void osStartThread(OSThread *t) +{ + register u32 saveMask = __osDisableInt(); + switch (t->state) + { + case OS_STATE_WAITING: + t->state = OS_STATE_RUNNABLE; + __osEnqueueThread(&__osRunQueue, t); + break; + case OS_STATE_STOPPED: + if (t->queue == NULL || t->queue == &__osRunQueue) + { + t->state = OS_STATE_RUNNABLE; + __osEnqueueThread(&__osRunQueue, t); + } + else + { + t->state = OS_STATE_WAITING; + __osEnqueueThread(t->queue, t); + __osEnqueueThread(&__osRunQueue, __osPopThread(t->queue)); + } + break; + } + if (__osRunningThread == NULL) + { + __osDispatchThread(); + } + else + { + if (__osRunningThread->priority < __osRunQueue->priority) + { + __osRunningThread->state = OS_STATE_RUNNABLE; + __osEnqueueAndYield(&__osRunQueue); + } + } + __osRestoreInt(saveMask); +} diff --git a/src/core1/done/os/stopthread.c b/src/core1/done/os/stopthread.c new file mode 100644 index 00000000..b410a019 --- /dev/null +++ b/src/core1/done/os/stopthread.c @@ -0,0 +1,32 @@ +#include +#include "functions.h" +#include "variables.h" + +extern OSThread *__osRunningThread; + +void osStopThread(OSThread *t) +{ + register u32 saveMask = __osDisableInt(); + register u16 state; + if (t == NULL) + { + state = OS_STATE_RUNNING; + } + else + { + state = t->state; + } + switch (state) + { + case OS_STATE_RUNNING: + __osRunningThread->state = OS_STATE_STOPPED; + __osEnqueueAndYield(NULL); + break; + case OS_STATE_RUNNABLE: + case OS_STATE_WAITING: + t->state = OS_STATE_STOPPED; + __osDequeueThread(t->queue, t); + break; + } + __osRestoreInt(saveMask); +} diff --git a/src/core1/done/os/stoptimer.c b/src/core1/done/os/stoptimer.c new file mode 100644 index 00000000..9bdf8dab --- /dev/null +++ b/src/core1/done/os/stoptimer.c @@ -0,0 +1,27 @@ +#include +#include "osint.h" + +int osStopTimer(OSTimer *t) +{ + register u32 savedMask; + OSTimer *timep; + + if (t->next == NULL) + return -1; + savedMask = __osDisableInt(); + timep = t->next; + if (timep != __osTimerList) + { + timep->value += t->value; + } + t->prev->next = t->next; + t->next->prev = t->prev; + t->next = NULL; + t->prev = NULL; + if (__osTimerList->next == __osTimerList) + { + __osSetCompare(0); + } + __osRestoreInt(savedMask); + return 0; +} diff --git a/src/core1/done/os/thread.c b/src/core1/done/os/thread.c new file mode 100644 index 00000000..102f88db --- /dev/null +++ b/src/core1/done/os/thread.c @@ -0,0 +1,26 @@ +#include +#include "osint.h" + +struct __osThreadTail __osThreadTail = {0, -1}; +OSThread *__osRunQueue = (OSThread *)&__osThreadTail; +OSThread *__osActiveQueue = (OSThread *)&__osThreadTail; +OSThread *__osRunningThread = {0}; +OSThread *__osFaultedThread = {0}; +void __osDequeueThread(OSThread **queue, OSThread *t) +{ + register OSThread *pred; + register OSThread *succ; + pred = (OSThread *)queue; //this is actually legit.. + succ = pred->next; + while (succ != NULL) + { + if (succ == t) + { + pred->next = t->next; + return; + } + pred = succ; + succ = pred->next; + } +} + diff --git a/src/core1/done/os/timerintr.c b/src/core1/done/os/timerintr.c new file mode 100644 index 00000000..156f2b28 --- /dev/null +++ b/src/core1/done/os/timerintr.c @@ -0,0 +1,99 @@ +#include +#include "osint.h" + +OSTimer *__osTimerList = &__osBaseTimer; +OSTimer __osBaseTimer; +OSTime __osCurrentTime; +u32 __osBaseCounter; +u32 __osViIntrCount; +u32 __osTimerCounter; +void __osTimerServicesInit(void) +{ + __osCurrentTime = 0; + __osBaseCounter = 0; + __osViIntrCount = 0; + __osTimerList->prev = __osTimerList; + __osTimerList->next = __osTimerList->prev; + __osTimerList->value = 0; + __osTimerList->interval = __osTimerList->value; + __osTimerList->mq = NULL; + __osTimerList->msg = 0; +} + +void __osTimerInterrupt(void) +{ + OSTimer *t; + u32 count; + u32 elapsed_cycles; + + if (__osTimerList->next == __osTimerList) + return; + while (1) + { + t = __osTimerList->next; + if (t == __osTimerList) + { + __osSetCompare(0); + __osTimerCounter = 0; + break; + } + count = osGetCount(); + elapsed_cycles = count - __osTimerCounter; + __osTimerCounter = count; + if (elapsed_cycles < t->value) + { + t->value -= elapsed_cycles; + __osSetTimerIntr(t->value); + return; + } + else + { + t->prev->next = t->next; + t->next->prev = t->prev; + t->next = NULL; + t->prev = NULL; + if (t->mq != NULL) + { + osSendMesg(t->mq, t->msg, OS_MESG_NOBLOCK); + } + if (t->interval != 0) + { + t->value = t->interval; + __osInsertTimer(t); + } + } + } +} +// +void __osSetTimerIntr(OSTime tim) +{ + OSTime NewTime; + u32 savedMask; + savedMask = __osDisableInt(); + __osTimerCounter = osGetCount(); + NewTime = tim + __osTimerCounter; + __osSetCompare(NewTime); + __osRestoreInt(savedMask); +} +OSTime __osInsertTimer(OSTimer *t) +{ + OSTimer *timep; + OSTime tim; + u32 savedMask; + savedMask = __osDisableInt(); + for (timep = __osTimerList->next, tim = t->value; + timep != __osTimerList && tim > timep->value; + tim -= timep->value, timep = timep->next) + { + ; + } + t->value = tim; + if (timep != __osTimerList) + timep->value -= tim; + t->next = timep; + t->prev = timep->prev; + timep->prev->next = t; + timep->prev = t; + __osRestoreInt(savedMask); + return tim; +} diff --git a/src/core1/done/os/virtualtophysical.c b/src/core1/done/os/virtualtophysical.c new file mode 100644 index 00000000..e952a60b --- /dev/null +++ b/src/core1/done/os/virtualtophysical.c @@ -0,0 +1,19 @@ +#include +#include +#include "osint.h" + +u32 osVirtualToPhysical(void *addr) +{ + if (IS_KSEG0(addr)) + { + return K0_TO_PHYS(addr); + } + else if (IS_KSEG1(addr)) + { + return K1_TO_PHYS(addr); + } + else + { + return __osProbeTLB(addr); + } +} diff --git a/src/core1/done/os/yieldthread.c b/src/core1/done/os/yieldthread.c new file mode 100644 index 00000000..9dcf6c72 --- /dev/null +++ b/src/core1/done/os/yieldthread.c @@ -0,0 +1,9 @@ +#include +#include "osint.h" + +void osYieldThread(void){ + register u32 saveMask = __osDisableInt(); + __osRunningThread->state = OS_STATE_RUNNABLE; + __osEnqueueAndYield(&__osRunQueue); + __osRestoreInt(saveMask); +} diff --git a/src/core1/done/syncprintf.c b/src/core1/done/syncprintf.c new file mode 100644 index 00000000..55aecf1a --- /dev/null +++ b/src/core1/done/syncprintf.c @@ -0,0 +1,15 @@ +#include +#include +#include + +void osSyncPrintf(const char *fmt, ...) +{ + int ans; + va_list ap; + // these functions intentionally left blank. ifdeffed out in rom release +} +void rmonPrintf(const char *fmt, ...) +{ + int ans; + va_list ap; +} diff --git a/src/core1/exceptasm.c b/src/core1/exceptasm.c new file mode 100644 index 00000000..4dc96e6b --- /dev/null +++ b/src/core1/exceptasm.c @@ -0,0 +1,24 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/exceptasm/func_8026A2E0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/exceptasm/func_8026A2F0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/exceptasm/func_8026A300.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/exceptasm/func_8026A824.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/exceptasm/__osEnqueueAndYield.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/exceptasm/__osEnqueueThread.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/exceptasm/__osPopThread.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/exceptasm/__osDispatchThread.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/exceptasm/__osCleanupThread.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/exceptasm/osMapTLBRdb.s") diff --git a/src/core1/gu/cosf.c b/src/core1/gu/cosf.c new file mode 100644 index 00000000..49e68b3e --- /dev/null +++ b/src/core1/gu/cosf.c @@ -0,0 +1,6 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/gu/cosf/cosf.s") diff --git a/src/core1/gu/mtxutil.c b/src/core1/gu/mtxutil.c new file mode 100644 index 00000000..396fc5ca --- /dev/null +++ b/src/core1/gu/mtxutil.c @@ -0,0 +1,62 @@ +#include +#include "functions.h" +#include "variables.h" + +void guMtxF2L(float mf[4][4], Mtx *m) +{ + int i, j; + int e1,e2; + int *ai,*af; + + + ai=(int *) &m->m[0][0]; + af=(int *) &m->m[2][0]; + + for (i=0; i<4; i++) + for (j=0; j<2; j++) { + e1=FTOFIX32(mf[i][j*2]); + e2=FTOFIX32(mf[i][j*2+1]); + *(ai++) = ( e1 & 0xffff0000 ) | ((e2 >> 16)&0xffff); + *(af++) = ((e1 << 16) & 0xffff0000) | (e2 & 0xffff); + } +} + +void guMtxIdentF(float mf[4][4]) +{ + int i, j; + + for (i=0; i<4; i++) + for (j=0; j<4; j++) + if (i == j) mf[i][j] = 1.0; + else mf[i][j] = 0.0; +} + +void guMtxIdent(Mtx *m){ + float mf[4][4]; + + guMtxIdentF(mf); + guMtxF2L(mf, m); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/gu/mtxutil/guMtxL2F.s") +// void guMtxL2F(float mf[4][4], Mtx *m) +// { +// int i, j; +// unsigned int e1,e2; +// unsigned int *ai,*af; +// int q1,q2; + +// ai=(unsigned int *) &m->m[0][0]; +// af=(unsigned int *) &m->m[2][0]; + +// for (i=0; i<4; i++) +// for (j=0; j<2; j++) { +// e1 = (*ai & 0xffff0000) | ((*af >> 16) & 0xffff); +// e2 = ((*(ai++) << 16) & 0xffff0000) | (*(af++) & 0xffff); +// q1 = *((int *)&e1); +// q2 = *((int *)&e2); + +// mf[i][j*2] = FIX32TOF(q1); +// mf[i][j*2+1] = FIX32TOF(q2); +// } +// } diff --git a/src/core1/gu/rotate.c b/src/core1/gu/rotate.c new file mode 100644 index 00000000..7683fd9a --- /dev/null +++ b/src/core1/gu/rotate.c @@ -0,0 +1,55 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 D_80285900; + +f32 sinf(f32); +f32 cosf(f32); + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/gu/rotate/guRotateF.s") +// MATCHING but need to resolve core1 data section for static D_80285900 +// void guRotateF(float mf[4][4], float a, float x, float y, float z) +// { +// static f32 D_80285900 = 3.1415926 / 180.0; +// float sine; +// float cosine; +// float ab, bc, ca, t; + + +// guNormalize(&x, &y, &z); +// a *= D_80285900; +// sine = sinf(a); +// cosine = cosf(a); +// t = (1-cosine); +// ab = x*y*t; +// bc = y*z*t; +// ca = z*x*t; + +// guMtxIdentF(mf); + +// t = x*x; +// mf[0][0] = t+cosine*(1-t); +// mf[2][1] = bc-x*sine; +// mf[1][2] = bc+x*sine; + +// t = y*y; +// mf[1][1] = t+cosine*(1-t); +// mf[2][0] = ca+y*sine; +// mf[0][2] = ca-y*sine; + +// t = z*z; +// mf[2][2] = t+cosine*(1-t); +// mf[1][0] = ab-z*sine; +// mf[0][1] = ab+z*sine; +// } + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/gu/rotate/guRotate.s") +// MATCHING with -O3, need to resolve data section +// void guRotate(Mtx *m, float a, float x, float y, float z) +// { +// float mf[4][4]; + +// guRotateF(mf, a, x, y, z); +// guMtxF2L(mf, m); +// } diff --git a/src/core1/inflate.c b/src/core1/inflate.c new file mode 100644 index 00000000..cae594e4 --- /dev/null +++ b/src/core1/inflate.c @@ -0,0 +1,546 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "core1/rarezip.h" + +/* static */ int huft_build(b, n, s, d, e, t, m) +unsigned *b; /* code lengths in bits (all assumed <= BMAX) */ +unsigned n; /* number of codes (assumed <= N_MAX) */ +unsigned s; /* number of simple-valued codes (0..s-1) */ +u16 *d; /* list of base values for non-simple codes */ +u16 *e; /* list of extra bits for non-simple codes */ +struct huft **t; /* result: starting table */ +int *m; /* maximum lookup bits, returns actual */ +/* Given a list of code lengths and a maximum table size, make a set of + tables to decode that set of codes. Return zero on success, one if + the given code set is incomplete (the tables are still built in this + case), two if the input is invalid (all zero length codes or an + oversubscribed set of lengths), and three if not enough memory. */ +{ + unsigned a; /* counter for codes of length k */ + unsigned c[BMAX+1]; /* bit length count table */ + unsigned f; /* i repeats in table every f entries */ + int g; /* maximum code length */ + int h; /* table level */ + register unsigned i; /* counter, current code */ + register unsigned j; /* counter */ + register int k; /* number of bits in current code */ + int l; /* bits per table (returned in m) */ + register unsigned *p; /* pointer into c[], b[], or v[] */ + register struct huft *q; /* points to current table */ + struct huft r; /* table entry for structure assignment */ + struct huft *u[BMAX]; /* table stack */ + unsigned v[N_MAX]; /* values in order of bit length */ + register int w; /* bits before this table == (l * h) */ + unsigned x[BMAX+1]; /* bit offsets, then code stack */ + unsigned *xp; /* pointer into x */ + int y; /* number of dummy codes added */ + unsigned z; /* number of entries in current table */ + + + /* Generate counts for each bit length */ + bzero(c, sizeof(c)); + p = b; i = n; + do { + c[*p]++; /* assume all entries <= BMAX */ + p++; /* Can't combine with above line (Solaris bug) */ + } while (--i); + if (c[0] == n) /* null input--all zero length codes */ + { + *t = (struct huft *)NULL; + *m = 0; + return 0; + } + + + /* Find minimum and maximum length, bound *m by those */ + l = *m; + for (j = 1; j <= BMAX; j++) + if (c[j]) + break; + k = j; /* minimum code length */ + if ((unsigned)l < j) + l = j; + for (i = BMAX; i; i--) + if (c[i]) + break; + g = i; /* maximum code length */ + if ((unsigned)l > i) + l = i; + *m = l; + + + /* Adjust last length count to fill out codes, if needed */ + for (y = 1 << j; j < i; j++, y <<= 1){ + (y -= c[j]); + } + y -= c[i]; + c[i] += y; + + + /* Generate starting offsets into the value table for each length */ + x[1] = j = 0; + p = c + 1; xp = x + 2; + while (--i) { /* note that i == g from above */ + *xp++ = (j += *p++); + } + + + /* Make a table of values in order of bit lengths */ + p = b; i = 0; + do { + if ((j = *p++) != 0) + v[x[j]++] = i; + } while (++i < n); + + + /* Generate the Huffman codes and for each, make the table entries */ + x[0] = i = 0; /* first Huffman code is zero */ + p = v; /* grab values in bit order */ + h = -1; /* no tables yet--level -1 */ + w = -l; /* bits decoded == (l * h) */ + u[0] = (struct huft *)NULL; /* just to keep compilers happy */ + q = (struct huft *)NULL; /* ditto */ + z = 0; /* ditto */ + + /* go through the bit lengths (k already is bits in shortest code) */ + for (; k <= g; k++) + { + a = c[k]; + while (a--) + { + /* here i is the Huffman code of length k bits for value *p */ + /* make tables up to required level */ + while (k > w + l) + { + h++; + w += l; /* previous table always l bits */ + + /* compute minimum size table less than or equal to l bits */ + z = (z = g - w) > (unsigned)l ? l : z; /* upper limit on table size */ + if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ + { /* too few codes for k-w bit table */ + f -= a + 1; /* deduct codes from patterns left */ + xp = c + k; + while (++j < z) /* try smaller tables up to z bits */ + { + if ((f <<= 1) <= *++xp) + break; /* enough codes to use up j bits */ + f -= *xp; /* else deduct codes from patterns */ + } + } + z = 1 << j; /* table entries for j-bit table */ + + /* allocate and link in new table */ + q = D_8027BF20 + D_8027BF34; + + D_8027BF34 += z + 1; /* track memory usage */ + *t = q + 1; /* link to list for huft_free() */ + *(t = &(q->v.t)) = (struct huft *)NULL; + u[h] = ++q; /* table starts after link */ + + /* connect to last table, if there is one */ + if (h) + { + x[h] = i; /* save pattern for backing up */ + r.b = (u8)l; /* bits to dump before this table */ + r.e = (u8)(16 + j); /* bits in this table */ + r.v.t = q; /* pointer to this table */ + j = i >> (w - l); /* (get around Turbo C bug) */ + u[h-1][j] = r; /* connect to last table */ + } + } + + /* set up table entry in r */ + r.b = (u8)(k - w); + if (p >= v + n) + r.e = 99; /* out of values--invalid code */ + else if (*p < s) + { + r.e = (u8)(*p < 256 ? 16 : 15); /* 256 is end-of-block code */ + r.v.n = *p; /* simple code is just the value */ + p++; /* one compiler does not like *p++ */ + } + else + { + r.e = *((u8 *)e + (*p - s)); /* non-simple--look up in lists */ + r.v.n = d[*p++ - s]; + } + + /* fill code-like entries with r */ + f = 1 << (k - w); + for (j = i >> w; j < z; j += f) + q[j] = r; + + /* backwards increment the k-bit code i */ + for (j = 1 << (k - 1); i & j; j >>= 1) + i ^= j; + i ^= j; + + /* backup over finished tables */ + while ((i & ((1 << w) - 1)) != x[h]) + { + h--; /* don't need to update q */ + w -= l; + } + } + } + + + /* Return true (1) if we were given an incomplete table */ + return y != 0 && g != 1; +} + +/* static */ int inflate_codes(struct huft *tl, struct huft *td, s32 bl, s32 bd) +{ + register unsigned e; /* table entry flag/number of extra bits */ + unsigned n, d; /* length and index for copy */ + unsigned w; /* current window position */ + struct huft *t; /* pointer to table entry */ + unsigned ml, md; /* masks for bl and bd bits */ + register u32 b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + register u8 tmp; + + /* make local copies of globals */ + b = D_8027BF24; /* initialize bit buffer */ + k = D_8027BF28; + w = D_8027BF1C; /* initialize window position */ + + /* inflate the coded data */ + ml = D_80275740[bl]; /* precompute masks for speed */ + md = D_80275740[bd]; + + for (;;) /* do until end of block */ + {//L80000D78 + NEEDBITS((unsigned)bl) + if ((e = (t = tl + ((unsigned)b & ml))->e) > 16) + do { + DUMPBITS(t->b) + e -= 16; + NEEDBITS(e) + } while ((e = (t = t->v.t + ((unsigned)b & D_80275740[e]))->e) > 16); + DUMPBITS(t->b) + if (e == 16) /* then it's a literal */ + { + + tmp = (u8)t->v.n; + D_8027BF14[w++] = tmp; + D_8027BF2C += tmp; + D_8027BF30 ^= tmp << (D_8027BF2C & 0x17); + } + else /* it's an EOB or a length */ + {//L80000EAC + /* exit if end of block */ + if (e == 15) + break; + + /* get length of block to copy */ + NEEDBITS(e) //L80000EAC - L80000ED8 + n = t->v.n + ((unsigned)b & D_80275740[e]); + DUMPBITS(e); + + /* decode distance of block to copy */ + NEEDBITS((unsigned)bd)//L80000F04 - L80000F2C + if ((e = (t = td + ((unsigned)b & md))->e) > 16) + do { + DUMPBITS(t->b) + e -= 16; + NEEDBITS(e) + } while ((e = (t = t->v.t + ((unsigned)b & D_80275740[e]))->e) > 16); + //L80000FC8 + DUMPBITS(t->b) + NEEDBITS(e) //L80000FE0 - L80001008 + d = w - t->v.n - ((unsigned)b & D_80275740[e]); + DUMPBITS(e) + + /* do the copy */ + do{ + tmp = D_8027BF14[d++]; + D_8027BF14[w++] = tmp; + D_8027BF2C += tmp; + D_8027BF30 ^= tmp << (D_8027BF2C & 0x17); + }while(--n); + } + } + /* restore the globals from the locals */ + D_8027BF1C = w; /* restore global window pointer */ + D_8027BF24 = b; /* restore global bit buffer */ + D_8027BF28 = k; + /* done */ + return 0; +} + +/* static */ int inflate_stored(void) +/* "decompress" an inflated type 0 (stored) block. */ +{ + unsigned n; /* number of bytes in block */ + unsigned w; /* current window position */ + register u32 b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + + /* make local copies of globals */ + b = D_8027BF24; /* initialize bit buffer */ + k = D_8027BF28; + w = D_8027BF1C; /* initialize window position */ + + + /* go to byte boundary */ + n = k & 7; + DUMPBITS(n); + + + /* get the length and its complement */ + NEEDBITS(16) + n = ((unsigned)b & 0xffff); + DUMPBITS(16) + NEEDBITS(16) + DUMPBITS(16) + + + /* read and output the compressed data */ + while (n--) + { + NEEDBITS(8) + D_8027BF14[w++] = (u8) b; + D_8027BF2C += b & 0xFF; + D_8027BF30 ^= (b &0xFF) << (D_8027BF2C & 0x17); + DUMPBITS(8) + } + + /* restore the globals from the locals */ + D_8027BF1C = w; /* restore global window pointer */ + D_8027BF24 = b; /* restore global bit buffer */ + D_8027BF28 = k; + return 0; +} + +/* static */ int inflate_fixed(void) +/* decompress an inflated type 1 (fixed Huffman codes) block. We should + either replace this with a custom decoder, or at least precompute the + Huffman tables. */ +{ + int i; /* temporary variable */ + struct huft *tl; /* literal/length code table */ + struct huft *td; /* distance code table */ + int bl; /* lookup bits for tl */ + int bd; /* lookup bits for td */ + unsigned l[288]; /* length list for huft_build */ + + + /* set up literal table */ + for (i = 0; i < 144; i++) + l[i] = 8; + for (; i < 256; i++) + l[i] = 9; + for (; i < 280; i++) + l[i] = 7; + for (; i < 288; i++) /* make a complete, but wrong code set */ + l[i] = 8; + bl = 7; + huft_build(l, 288, 257, D_80275684, D_802756C4, &tl, &bl); + + /* set up distance table */ + for (i = 0; i < 30; i++) /* make an incomplete code set */ + l[i] = 5; + bd = 5; + huft_build(l, 30, 0, D_802756E4, D_80275720, &td, &bd); + + /* decompress until an end-of-block code */ + inflate_codes(tl, td, bl, bd); + + return 0; +} + +/* static */ int inflate_dynamic(void)/* decompress an inflated type 2 (dynamic Huffman codes) block. */ +{ + int i; /* temporary variables */ + unsigned j; + unsigned l; /* last length */ + unsigned m; /* mask for bit lengths table */ + unsigned n; /* number of lengths to get */ + struct huft *tl; /* literal/length code table */ + struct huft *td; /* distance code table */ + int bl; /* lookup bits for tl */ + int bd; /* lookup bits for td */ + unsigned nb; /* number of bit length codes */ + unsigned nl; /* number of literal/length codes */ + unsigned nd; /* number of distance codes */ + + register unsigned k; /* number of bits in bit buffer */ + + register u32 b; /* bit buffer */ + + unsigned ll[286+30]; /* literal/length and distance code lengths */ + + /* make local bit buffer */ + b = D_8027BF24; + k = D_8027BF28; + + + /* read in table lengths */ + NEEDBITS(5) + nl = 257 + ((unsigned)b & 0x1f); /* number of literal/length codes */ + DUMPBITS(5) + NEEDBITS(5) + nd = 1 + ((unsigned)b & 0x1f); /* number of distance codes */ + DUMPBITS(5) + NEEDBITS(4) + nb = 4 + ((unsigned)b & 0xf); /* number of bit length codes */ + DUMPBITS(4) + + /* read in bit-length-code lengths */ + for (j = 0; j < nb; j++) + { + NEEDBITS(3) + ll[D_80275670[j]] = (unsigned)b & 7; + DUMPBITS(3) + } + for (; j < 19; j++) + ll[D_80275670[j]] = 0; + + + /* build decoding table for trees--single level, 7 bit lookup */ + bl = 7; + huft_build(ll, 19, 19, NULL, NULL, &tl, &bl); + + + /* read in literal and distance code lengths */ + n = nl + nd; + m = D_80275740[bl]; + i = l = 0; + while ((unsigned)i < n) + { + NEEDBITS((unsigned)bl) + j = (td = tl + ((unsigned)b & m))->b; + DUMPBITS(j) + j = td->v.n; + if (j < 16) /* length of code in bits (0..15) */ + ll[i++] = l = j; /* save last length in l */ + else if (j == 16) /* repeat last length 3 to 6 times */ + { + NEEDBITS(2) + j = 3 + ((unsigned)b & 3); + DUMPBITS(2) + while (j--) + ll[i++] = l; + } + else if (j == 17) /* 3 to 10 zero length codes */ + { + NEEDBITS(3) + j = 3 + ((unsigned)b & 7); + DUMPBITS(3) + while (j--) + ll[i++] = 0; + l = 0; + } + else /* j == 18: 11 to 138 zero length codes */ + { + NEEDBITS(7) + j = 11 + ((unsigned)b & 0x7f); + DUMPBITS(7) + while (j--) + ll[i++] = 0; + l = 0; + } + } + + /* restore the global bit buffer */ + D_8027BF24 = b; + D_8027BF28 = k; + + /* build the decoding tables for literal/length and distance codes */ + bl = D_80275764; + huft_build(ll, nl, 257, D_80275684, D_802756C4, &tl, &bl); + bd = D_80275768; + huft_build(ll + nl, nd, 0, D_802756E4, D_80275720, &td, &bd); + + /* decompress until an end-of-block code */ + inflate_codes(tl, td, bl, bd); + + return 0; +} + +/* static */ int inflate_block(int *e) +/* decompress an inflated block */ +{ + u32 t; /* block type */ + register u32 b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + + + /* make local bit buffer */ + b = D_8027BF24; + k = D_8027BF28; + + + /* read in last block bit */ + NEEDBITS(1) + *e = (int)b & 1; + DUMPBITS(1) + + + /* read in block type */ + NEEDBITS(2) + t = (unsigned)b & 3; + DUMPBITS(2) + + + /* restore the global bit buffer */ + D_8027BF24 = b; + D_8027BF28 = k; + + + /* inflate that block type */ + if (t == 2) + return inflate_dynamic(); + if (t == 0) + return inflate_stored(); + if (t == 1) + return inflate_fixed(); + + + /* bad block type */ + return 2; +} + +/* decompress an inflated entry */ +int inflate(void) //int inflate() +{ + int e; /* last block flag */ + int r; /* result code */ + unsigned h; /* maximum struct huft's malloc'ed */ + + /* initialize window, bit buffer */ + D_8027BF1C = 0; + D_8027BF28 = 0; + D_8027BF24 = 0; + + D_8027BF2C = 0; + D_8027BF30 = -1; + + /* decompress until the last block */ + h = 0; + do { + D_8027BF34 = 0; + if ((r = inflate_block(&e)) != 0) + return r; + if (D_8027BF34 > h) + h = D_8027BF34; + } while (!e); + + /* Undo too much lookahead. The next read will be byte aligned so we + * can discard unused bits in the last meaningful byte. + */ + while (D_8027BF28 >= 8) { + D_8027BF28 -= 8; + D_8027BF18--; + } + + /* return success */ + #ifdef DEBUG + fprintf(stderr, "<%u> ", h); + #endif /* DEBUG */ + return 0; +} diff --git a/src/core1/memory.c b/src/core1/memory.c new file mode 100644 index 00000000..80449588 --- /dev/null +++ b/src/core1/memory.c @@ -0,0 +1,832 @@ +#include +#include "functions.h" +#include "variables.h" +#include "SnS.h" + +/* + * Every chunk of allocated memory is prefixed with a HeapHeader. + * + * Chunks are 0x10 aligned, and cannot have a capacity < 1. + * This means the smallest chunksize with the header is 0x20. + * + * If a chunk is empty, it's contains ptrs to the previous and + * next empty chunks. This forms a link list over all the empty + * chunks (EmptyHeapBlock) + */ +extern void func_80253010(void *dest, void *src, s32 size); + +#define chunkSize(s) ((u32)(s)->next - (u32)(s) - sizeof(HeapHeader)) +#define HEAP_SIZE 0x210520 +#define LAST_HEAP_BLOCK HEAP_SIZE/sizeof(EmptyHeapBlock) - 1 + +enum { + HEAP_BLOCK_EMPTY = 0, + HEAP_BLOCK_USED = 1, + HEAP_BLOCK_PERM = 2 +} heap_block_type_e; + +typedef struct heap_header{ + struct heap_header * prev; + struct heap_header * next; + u8 pad8[4]; + u32 unusedBytes_C_31:24; //size? + u32 unkC_7:2; //state? + u32 padC_5:6; +}HeapHeader; + +typedef struct empty_heap_block{ + HeapHeader hdr; + struct empty_heap_block *prev_free; + struct empty_heap_block *next_free; + u8 pad18[0x8]; +} EmptyHeapBlock; + +extern EmptyHeapBlock D_8002D500[LAST_HEAP_BLOCK + 1]; +extern EmptyHeapBlock D_8023DA00; +extern struct{ + bool unk0; +}D_802765B0; +extern void *D_80283224; +extern void *D_80283228; +extern s32 D_8028322C; +extern u32 heap_requested_size; +extern HeapHeader * D_80283234; +extern u32 heap_occupiedBytes; //occupied heap size +extern u8 D_80276594; +extern u8 D_80276598; +extern void *D_8027659C; +extern void *D_802765A0; +extern s32 D_802765A4; +extern void *D_802765A8; +extern s32 D_802765AC; +extern UNK_TYPE(void *) D_802765B4; + +extern s32 D_80283220; +extern struct { + void *unk0[0x10]; + void **unk40; +}D_80283238; + + + +EmptyHeapBlock *func_802549BC(s32 size); +void _heap_sortEmptyBlock(EmptyHeapBlock * arg0); +void func_80255ACC(void); + +/* .code */ +s32 __heap_align(s32 size){ + s32 misalign = size & 0xf; + return(misalign)? (size - misalign + 0x10) : size; +} + +int func_80254490(int arg0){ + return FALSE; +} + +void _heap_defragEmptyBlock(EmptyHeapBlock * arg0){ + EmptyHeapBlock * defrag_ptr = NULL; + if(arg0->hdr.next->unkC_7 == HEAP_BLOCK_EMPTY){ //absorb next block + defrag_ptr = arg0; + //remove next from empty block link list + ((EmptyHeapBlock *)arg0->hdr.next)->next_free->prev_free = ((EmptyHeapBlock *)arg0->hdr.next)->prev_free; + ((EmptyHeapBlock *)arg0->hdr.next)->prev_free->next_free = ((EmptyHeapBlock *)arg0->hdr.next)->next_free; + //remove next from block link list + arg0->hdr.next->next->prev = arg0; + arg0->hdr.next = arg0->hdr.next->next; + } + if(arg0->hdr.prev->unkC_7 == HEAP_BLOCK_EMPTY){ + defrag_ptr = arg0->hdr.prev; + //remove self from empty block link list + arg0->next_free->prev_free = arg0->prev_free; + arg0->prev_free->next_free = arg0->next_free; + //remove self from block link list + arg0->hdr.prev->next = arg0->hdr.next; + arg0->hdr.next->prev = arg0->hdr.prev; + } + if(defrag_ptr != NULL){ + _heap_sortEmptyBlock(defrag_ptr); + }else{ + _heap_sortEmptyBlock(arg0); + } +} + +void func_8025456C(EmptyHeapBlock * arg0){ + arg0->hdr.unkC_7 = HEAP_BLOCK_EMPTY; + arg0->hdr.unusedBytes_C_31 = 0; + if((u8*)arg0->hdr.next - (u8*)arg0 < 10000){ + arg0->prev_free = &D_8002D500; + arg0->next_free = D_8002D500->next_free; + D_8002D500->next_free->prev_free = arg0; + D_8002D500->next_free = arg0; + }else{ + arg0->prev_free = D_8002D500[LAST_HEAP_BLOCK].prev_free; + arg0->next_free = & D_8002D500[LAST_HEAP_BLOCK]; + + D_8002D500[LAST_HEAP_BLOCK].prev_free->next_free = arg0; + D_8002D500[LAST_HEAP_BLOCK].prev_free = arg0; + + } + _heap_defragEmptyBlock(arg0); +} + +void memcpy(void * dst, void *src, int size){ + while(size > 0){ + *(u8*)dst = *(u8*)src; + size--; + ((u8*)dst)++; + ((u8*)src)++; + } +} + +void func_80254630(void * dst, void *src, int size){ + while(size > 0){ + *(u32*)dst = *(u32*)src; + size -= 4; + ((u32*)dst)++; + ((u32*)src)++; + } +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/memory/func_80254658.s") + +s32 heap_get_size(void){ return HEAP_SIZE; } + +s32 func_802546DC(void){ return 0; } + +u32 func_802546E4(void * arg0){ + HeapHeader *sPtr = (HeapHeader *)arg0 - 1; + return chunkSize(sPtr) - sPtr->unusedBytes_C_31; +} + +void func_802546FC(void){ + D_80283224 = NULL; + D_80283228 = NULL; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/memory/heap_init.s") +#else +void heap_init(void){ + bzero(D_8002D500, HEAP_SIZE); + func_802546FC(); + D_80283238.unk40 = &D_80283238.unk0[0]; + heap_occupiedBytes = 0; + D_80276594 = 0; + D_802765A0 = 0; + D_802765A4 = 0; + D_802765A8 = 0; + D_802765AC = 0; + D_802765B0.unk0 = FALSE; + D_8002D500[0].hdr.unkC_7 = 2; + D_8002D500[0].hdr.prev = NULL; + D_8002D500[0].hdr.next = &D_8002D500[1]; + D_8002D500[0].hdr.unusedBytes_C_31 = 0; + D_8002D500[0].prev_free = NULL; + D_8002D500[0].next_free = &D_8002D500[1]; + + D_8002D500[1].hdr.unkC_7 = 0; + D_8002D500[1].hdr.prev = &D_8002D500[0]; + D_8002D500[1].hdr.next = &D_8002D500[LAST_HEAP_BLOCK]; + D_8002D500[1].hdr.unusedBytes_C_31 = 0; + D_8002D500[1].prev_free = &D_8002D500[0]; + D_8002D500[1].next_free = &D_8002D500[LAST_HEAP_BLOCK]; + + D_8002D500[LAST_HEAP_BLOCK].hdr.unkC_7 = 2; + D_8002D500[LAST_HEAP_BLOCK].hdr.prev = &D_8002D500[0]; + D_8002D500[LAST_HEAP_BLOCK].hdr.next = &D_8002D500[LAST_HEAP_BLOCK + 1]; + D_8002D500[LAST_HEAP_BLOCK].hdr.unusedBytes_C_31 = 0; + D_8002D500[LAST_HEAP_BLOCK].prev_free = &D_8002D500[0]; + D_8002D500[LAST_HEAP_BLOCK].next_free = NULL; + sns_init_base_payloads(); +} +#endif + +void *func_8025484C(s32 size){ + D_802765B4 = malloc(ALIGN((u32)&D_8002D500[1] + 0x100, 0x100) - (u32)&D_8002D500[1] - sizeof(EmptyHeapBlock)); + return malloc(0x80); +} + +void *func_80254898(s32 arg0){ + void * sp1C = malloc(ALIGN(((u32)&D_8002D500[LAST_HEAP_BLOCK] - (u32)D_8002D500[LAST_HEAP_BLOCK].prev_free) - 0x2FF, 0x100) + - sizeof(EmptyHeapBlock)); + void * sp18 = malloc(0x80); + free(sp1C); + free(D_802765B4); + D_802765B4 = NULL; + return sp18; +} + +void func_80254908(void){ + if(D_802765A0){ + free(D_802765A0); + D_802765A0 = NULL; + } + + if(D_802765A8){ + free(D_802765A8); + D_802765A8 = NULL; + } +} + +u32 _heap_get_occupied_size(void){ + return heap_occupiedBytes; +} + +u32 func_8025496C(void){ + return _heap_get_occupied_size(); +} + +bool func_8025498C(s32 size){ + s32 v0 = func_802549BC(size); + return v0 ? TRUE : FALSE; +} + +EmptyHeapBlock *func_802549BC(s32 size){ + EmptyHeapBlock *a1; + s32 aligned_size; + u32 block_size; + + a1 = D_8002D500->next_free; + aligned_size = __heap_align(size > 0 ? size : 1); + while( chunkSize(&a1->hdr) < aligned_size && a1->next_free != &D_8002D500[LAST_HEAP_BLOCK] ){ + a1 = a1->next_free; + } + return (chunkSize(&a1->hdr) < aligned_size)? 0 : a1; +} + +EmptyHeapBlock *func_80254A60(bool arg0){ + EmptyHeapBlock *v1; + EmptyHeapBlock *v0; + if(!arg0){ + //from start + v1 = D_8002D500->next_free; + while( chunkSize(&v1->hdr) < heap_requested_size && v1->next_free != &D_8002D500[LAST_HEAP_BLOCK] ){ + v1 = v1->next_free; + } + + if(chunkSize(&v1->hdr) < heap_requested_size) + return NULL; + return v1; + }else{ + //from back + v1 = NULL; + v0 = D_8002D500->next_free; + while(v0 != &D_8002D500[LAST_HEAP_BLOCK]){ + if(chunkSize(&v0->hdr) >= heap_requested_size && v1 < v0) + v1 = v0; + v0 = v0->next_free; + } + + if(!v1) + return NULL; + + if(chunkSize(&v1->hdr) < heap_requested_size) + return NULL; + return v1; + } +} + +EmptyHeapBlock *func_80254B84(s32 arg0){ + if(D_80283234){ + return func_80254A60(1); //closest to back + }else{ + return func_80254A60(0); //closest to from + } +} + +int func_80254BC4(int arg0){ + return FALSE; +} + +//returns n'th free block and size +void *func_80254BD0(s32 *size, u32 arg1) { + EmptyHeapBlock *var_v1; + + var_v1 = &D_8023DA00; + while(arg1 != 0){ + var_v1 = var_v1->prev_free; + if (var_v1 == &D_8002D500[0]) { + return NULL; + } + arg1--; + } + *size = ((s32)(var_v1->hdr.next) - (s32)var_v1) - sizeof(HeapHeader); + return (s32)var_v1 + 0x10; +} + +void func_80254C98(void){ + D_802765B0.unk0 = TRUE; +} + +void *malloc(s32 size){ + u32 capacity; + EmptyHeapBlock *v1; + EmptyHeapBlock *a0; + + D_80283234 = D_802765B0.unk0; + D_802765B0.unk0 = FALSE; + if(D_8002D500->next_free == &D_8002D500[LAST_HEAP_BLOCK]) + return NULL; + + heap_requested_size = __heap_align((size > 0 )? size : 1); + if(!(v1 = func_80254B84(0))){ //remove stall cache ptrs + D_80283234 = NULL; + func_803306C8(2); + if(!func_80254B84(0)) + func_8030A850(2); + + if(!func_80254B84(0)) + func_80288120(); + + if(!func_80254B84(0)) + func_8028873C(0); + + if(!func_80254B84(0)) + func_8032AD7C(2); + + if(!(v1 = func_80254B84(0))){ + func_8033B61C(); + func_802E49E0(); + func_803306C8(3); //modelCache + + if(!func_80254B84(0)) + func_8030A850(3); //propModelCache + + if(!func_80254B84(0)) + func_8032AD7C(2); //actorArray + + if(!(v1 = func_80254B84(0))){ + if(!func_80254B84(0)) + func_802F1294(); //particleEmitters + + if(!func_80254B84(0)) + func_8028873C(1); //animationCache + + if(v1 = func_80254B84(0)){} + else + return NULL; + } + }//L80254E38 + }//L80254E38 + + if( heap_requested_size + sizeof(HeapHeader) < chunkSize(&v1->hdr)){ + if(D_80283234){ + //reverse split chunk => //split empty chunk: |prev| a0 |next| => |prev| a0 | v1 |next| + a0 = v1; + v1 = (EmptyHeapBlock *)((u32)v1->hdr.next - (heap_requested_size + sizeof(HeapHeader))); + v1->hdr.next = a0->hdr.next; + a0->hdr.next->prev = v1; + a0->hdr.next = v1; + v1->hdr.prev = a0; + _heap_sortEmptyBlock(a0); + } + else{//L80254EA4 + //split chunk: |prev| v1 |next| => |prev| v1 | __a0__ |next| + a0 = (HeapHeader *)((u32)v1 + (heap_requested_size + sizeof(HeapHeader))); + a0->next_free = v1->next_free; + a0->prev_free = v1->prev_free; + a0->next_free->prev_free = a0; + a0->prev_free->next_free = a0; + a0->hdr.prev = v1; + a0->hdr.next = v1->hdr.next; + a0->hdr.next->prev = a0; + a0->hdr.unkC_7 = 0; + a0->hdr.unusedBytes_C_31 = 0; + v1->hdr.next = a0; + _heap_sortEmptyBlock(a0); + } + } + else{//L80254F08 + //use full chunk/ remove chunk from empty chunk link list + v1->next_free->prev_free = v1->prev_free; + v1->prev_free->next_free = v1->next_free; + }//L80254F20 + capacity = (u32)v1->hdr.next - (u32)v1 ; + v1->hdr.unusedBytes_C_31 = capacity - size - 0x10; + v1->hdr.unkC_7 = 1; + heap_occupiedBytes += capacity; + return (u8*)v1 + sizeof(HeapHeader); +} + +void func_80254F90(void){ + int i; + for(i = 0; i < 50; i++){ + func_80255ACC(); + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/memory/_heap_sortEmptyBlock.s") +#else +//moves empty block (arg0) to keep empty block list sorted by size +void _heap_sortEmptyBlock(EmptyHeapBlock * arg0){ + EmptyHeapBlock *v0 = arg0; + EmptyHeapBlock *v1; + EmptyHeapBlock *a2 = &D_8002D500[LAST_HEAP_BLOCK]; + + //move arg0 back while larger than next + while( arg0->next_free < a2 + && (s32)chunkSize(&v0->next_free->hdr) + 0x10 < (s32)chunkSize(&v0->hdr) + 0x10 + ){ + v1 = arg0->next_free; + arg0->next_free = v1->next_free; + v1->next_free->prev_free = arg0; + v1->next_free = arg0; + arg0->prev_free->next_free = v1; + v1->prev_free = arg0->prev_free; + arg0->prev_free = v1; + } + + //move arg0 foward while smaller prev + while( ( arg0->prev_free >= (EmptyHeapBlock *)((u8*)D_8002D500 + 1)) + && (s32)chunkSize(&v0->hdr) + 0x10 < (s32)chunkSize(&v0->prev_free->hdr) + 0x10 + ){ + a2 = arg0->prev_free; + arg0->next_free->prev_free = a2; + a2->next_free = arg0->next_free; + arg0->next_free = a2; + arg0->prev_free = a2->prev_free; + a2->prev_free->next_free = arg0; + a2->prev_free = arg0; + } +} +#endif + +void free(void * ptr){ + HeapHeader *sPtr; //stack_ptr + + if(ptr){ + sPtr = (HeapHeader *) ptr - 1; + heap_occupiedBytes = heap_occupiedBytes - (u32)((u8*)sPtr->next - (u8*)ptr) - sizeof(HeapHeader); + + func_8025456C(sPtr); + + if((u32)ptr == (u32)D_802765A0) + D_802765A0 = NULL; + + if((u32)ptr == (u32)D_802765A8) + D_802765A8 = NULL; + } +} + +void func_80255170(void **arg0){ + *D_80283238.unk40 = *arg0; + D_80283238.unk40++; + *arg0 = NULL; +} + +//heap_free_queue_flush +void func_80255198(void){ + while(D_80283238.unk40 > &D_80283238.unk0[0]){ + D_80283238.unk40--; + free(*D_80283238.unk40); + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/memory/func_80255200.s") +#else +//resizes and fragments a block; +void func_80255200(HeapHeader *block, s32 size){ + u32 chnk_size; + u32 remaining_bytes; + EmptyHeapBlock *a0; + + chnk_size = (u32)block->next - (u32)block; + remaining_bytes = chnk_size - 0x20; + block->unusedBytes_C_31 = chnk_size - sizeof(HeapHeader) - size; + if(size > 0) + remaining_bytes = chunkSize(block) - __heap_align(size); + else{ + remaining_bytes = remaining_bytes; + } + + + if(remaining_bytes >= 0x20){ + heap_occupiedBytes = heap_occupiedBytes - remaining_bytes; + a0 = (s32)block + (chnk_size - remaining_bytes); + + a0->hdr.prev = block; + a0->hdr.next = block->next; + block->next = &a0->hdr; + a0->hdr.next->prev = &a0->hdr; + block->unusedBytes_C_31 = chunkSize(block) - size; + func_8025456C(a0); + } +} +#endif + +void func_80255300(HeapHeader *block, s32 size){ + func_80255200(block, size); + if(block->next->unkC_7 == HEAP_BLOCK_EMPTY){ + _heap_sortEmptyBlock(block->next); + } +} + +void *func_80255340(void){ + return D_80283224; +} + +void *func_8025534C(void){ + return D_80283228; +} + +void *realloc(void *ptr, s32 size){ + + HeapHeader *sPtr; + void *newSeg; + EmptyHeapBlock *emptySeg; + + + D_80283224 = ptr; + D_80283228 = ptr; + sPtr = (HeapHeader *)ptr - 1; + if(!((u32)((u8*) sPtr->next - (u8*)ptr) < size)){ + //current pointer has enough free space to accomidate size change + func_80255300(sPtr, size); + return ptr; + } + + D_8027659C = ptr; + emptySeg = (EmptyHeapBlock*) sPtr->next; + if( emptySeg->hdr.unkC_7 == HEAP_BLOCK_EMPTY + && !((u32)((u8*)emptySeg->hdr.next - (u8*)sPtr) - 0x10 < size) + ){//combine current heap segment with the next one (if next one is free). + //remove empty segment from list + emptySeg->next_free->prev_free = emptySeg->prev_free; + emptySeg->prev_free->next_free = emptySeg->next_free; + heap_occupiedBytes += (u8*)emptySeg->hdr.next - (u8*)emptySeg; + sPtr->next = emptySeg->hdr.next; + emptySeg->hdr.next->prev = sPtr; + func_80255300(sPtr, size); + D_8027659C = 0; + return ptr; + }//L80255430 + + if(!(newSeg = malloc(size))){ + return 0; + } + + func_80253010(newSeg, ptr, __heap_align(size)); + free(ptr); + ptr = newSeg; + D_8027659C = 0; + D_80283228 = newSeg; + + if(newSeg); + + return ptr; +} + +u32 func_80255498(void){ + return HEAP_SIZE - func_8025496C(); +} + +s32 heap_findLargestEmptyBlock(s32 *size_ptr){ + EmptyHeapBlock *v0; + s32 i; + s32 size; + + v0 = D_8002D500->next_free; + *size_ptr = 0; + i = 0; + while(v0 != &D_8002D500[LAST_HEAP_BLOCK]){ + size = (s32)v0->hdr.next - (s32)v0; + *size_ptr = (size < *size_ptr) ? *size_ptr : size; + v0 = v0->next_free; + i++; + } + return i; +} + +void func_80255524(void){ + D_80283220 = (D_80276598)? -6000000 : 0; + + if(D_802765A0 && D_802765A4 + 1 < D_802765AC){ + free(D_802765A0); + D_802765A0 = NULL; + + if(D_802765A8){ + free(D_802765A8); + D_802765A8 = NULL; + } + } +} + +void func_802555C4(void){ + D_8028322C = FALSE; +} + +bool func_802555D0(void){ + return D_8028322C; +} + +void *defrag(void *this){ + HeapHeader *new_block; + HeapHeader *this_block; + EmptyHeapBlock *new_empty; + EmptyHeapBlock *prev_empty; + EmptyHeapBlock *next_empty; + HeapHeader *prev_block; + s32 size; + + if(this == NULL || this == D_8027659C){ + return this; + } + + size = (s32)((HeapHeader*)this)[-1].next - (s32)this + 0x10; + + this_block = &((HeapHeader*)this)[-1]; + if(D_80283220 + size >= 1000000){ + return this; + } + new_block = this_block->prev; + + if(new_block->unkC_7 != HEAP_BLOCK_EMPTY || chunkSize(new_block) < 0x10){ + return this; + } + + //previous block is empty, move contents of this block forward + D_8028322C = TRUE; + D_80283220 = D_80283220 + size; + + next_empty = ((EmptyHeapBlock *)new_block)->next_free; + prev_empty = ((EmptyHeapBlock *)new_block)->prev_free; + prev_block = new_block->prev; + func_80253010(new_block, this_block, size); + //create new empty block at end of new_block; + new_empty = (EmptyHeapBlock *)((s32)new_block + size); + new_empty->hdr.prev = new_block; + new_empty->hdr.next = new_block->next; + new_block->next = &new_empty->hdr; + new_block->prev = prev_block; + new_empty->hdr.next->prev = &new_empty->hdr; + prev_empty->next_free = new_empty; + next_empty->prev_free = new_empty; + new_empty->next_free = next_empty; + new_empty->prev_free = prev_empty; + new_empty->hdr.unkC_7 = HEAP_BLOCK_EMPTY; + new_empty->hdr.unusedBytes_C_31 = 0; + + if(new_block); + + _heap_defragEmptyBlock(new_empty); //combine new_empty with any surrounding empty blocks + return (void *)((s32)new_block + sizeof(HeapHeader)); +} + +void *defrag_asset(void *arg0){ + void *sp1C; + if(arg0 == NULL || arg0 == D_8027659C) + return arg0; + + sp1C = defrag(arg0); + assetcache_update_ptr(arg0, sp1C); + return sp1C; +} + +//recache??? defrag_cache??? +void *func_80255774(void *this){ + HeapHeader *this_block; + HeapHeader *prev_block; + s32 size; + s32 pad; + void *sp24; + + if( this == NULL + || this == D_8027659C + || D_802765A0 + || func_8033BD8C(this) + ){ + return this; + } + + size = (s32)((HeapHeader*)this)[-1].next - (s32)this + 0x10; + this_block = &((HeapHeader*)this)[-1]; + + if(D_80283220 + size >= 1000000) + return this; + + prev_block = this_block->prev; + if(prev_block->unkC_7 != HEAP_BLOCK_EMPTY){ + return this; + } + + sp24 = malloc(size - sizeof(HeapHeader)); + func_80253010(sp24, this, size - sizeof(HeapHeader)); + osWritebackDCache(sp24, size - sizeof(HeapHeader)); + D_80283220 += size - sizeof(HeapHeader); + D_802765A0 = this; + D_802765A4 = D_802765AC; + return sp24; +} + +//recache asset?? defragment cached obj??? +void *func_80255888(void *arg0){ + void *sp1C; + if(arg0 == NULL || arg0 == D_8027659C){ + return arg0; + } + + sp1C = func_80255774(arg0); + assetcache_update_ptr(arg0, sp1C); + return sp1C; +} + +void *func_802558D8(void *arg0, void *arg1){ + void *v1; + v1 = func_80255888(arg0); + if(v1 == arg0){ + return arg0; + } + else{ + D_802765A8 = arg1; + return v1; + } +} + +bool func_80255920(void *arg0) { + HeapHeader *block; + + if ((arg0 == NULL) || (arg0 == D_8027659C) || (D_802765A0 != NULL)) { + return FALSE; + } + + block = &((HeapHeader*)arg0)[-1]; + return (block->prev->unkC_7 != HEAP_BLOCK_EMPTY ) ? FALSE : TRUE; +} + +HeapHeader * func_80255978(void *ptr){ + return ((HeapHeader* )((s32)ptr - sizeof(HeapHeader)))->prev; +} + +void func_80255980(void *arg0, int arg1){ + D_802765A0 = arg0; + D_802765A4 = D_802765AC; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core1/memory/func_802559A0.s") +#else +bool func_802559A0(){ + s32 var_v0; + s32 var_v1; + + var_v0 = FALSE; + if (D_80276598 == FALSE) { + var_v0 = NOT(D_80283220 < 0xF4240); + if (!var_v0) { + var_v1 = (D_80276594 == TRUE) ? FALSE : TRUE; + var_v0 = var_v1 != 0; + } + return var_v0; + } + return var_v0; +} +#endif + +void func_80255A04(void){ + D_80276594 = 1; +} + +void func_80255A14(void){ + D_80276594 = 0; +} + +void func_80255A20(void){ + D_80276598 = TRUE; +} + +void func_80255A30(void){ + D_80276598 = FALSE; +} + +void func_80255A3C(void){ + func_80255524(); + if(func_802559A0() && D_80276598 != TRUE) + return; + + if(!func_802559A0()) + func_802E6820(1); + + if(!func_802559A0()) + func_802F542C(); + + if(!func_802559A0()){ + func_802576F8(); + func_80254464(); + } + +} + +void func_80255ACC(void){ + D_802765AC++; +} + +bool func_80255AE4(void){ + return (D_802765A0) ? 1 : 0; +} + +int func_80255B08(int arg0){ + if(arg0 == 2) + return 0x3; + return 0x12; +} diff --git a/src/core1/n_reverb.c b/src/core1/n_reverb.c new file mode 100644 index 00000000..7a263343 --- /dev/null +++ b/src/core1/n_reverb.c @@ -0,0 +1,16 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/n_reverb/func_8025F6D0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/n_reverb/func_8025F784.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/n_reverb/func_8025F8B0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/n_reverb/func_8025F9F4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/n_reverb/func_8025FC10.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/n_reverb/func_8025FE6C.s") diff --git a/src/core1/n_reverb_add01.c_ b/src/core1/n_reverb_add01.c_ new file mode 100644 index 00000000..b006d61c --- /dev/null +++ b/src/core1/n_reverb_add01.c_ @@ -0,0 +1,5 @@ + n_aLoadBuffer(ptr++, before_end<<1, buff, osVirtualToPhysical(curr_ptr)); + n_aLoadBuffer(ptr++, after_end<<1, buff+(before_end<<1), osVirtualToPhysical(r->base)); + } else { + n_aLoadBuffer(ptr++, count<<1, buff, osVirtualToPhysical(curr_ptr)); + } diff --git a/src/core1/n_reverb_add02.c_ b/src/core1/n_reverb_add02.c_ new file mode 100644 index 00000000..e502db21 --- /dev/null +++ b/src/core1/n_reverb_add02.c_ @@ -0,0 +1,5 @@ + n_aSaveBuffer(ptr++, before_end<<1, buff, osVirtualToPhysical(curr_ptr)); + n_aSaveBuffer(ptr++, after_end<<1, buff+(before_end<<1), osVirtualToPhysical(r->base)); + } else { + n_aSaveBuffer(ptr++, FIXED_SAMPLE<<1, buff, osVirtualToPhysical(curr_ptr)); + } diff --git a/src/core1/n_reverb_add03.c_ b/src/core1/n_reverb_add03.c_ new file mode 100644 index 00000000..4821ab10 --- /dev/null +++ b/src/core1/n_reverb_add03.c_ @@ -0,0 +1,7 @@ +{ + s16 tmp; + + tmp = buff >> 8; + n_aLoadADPCM(ptr++, 32, osVirtualToPhysical(lp->fcvec.fccoef)); + n_aPoleFilter(ptr++, lp->first, lp->fgain, tmp, osVirtualToPhysical(lp->fstate)); +} diff --git a/src/core1/n_reverb_add04.c_ b/src/core1/n_reverb_add04.c_ new file mode 100644 index 00000000..4d2a6f72 --- /dev/null +++ b/src/core1/n_reverb_add04.c_ @@ -0,0 +1,6 @@ + { + s16 tmp; + + tmp = buff >> 8; + n_aResample(ptr++, osVirtualToPhysical(d->rs->state), d->rs->first, ratio, rbuff + (ramalign<<1), tmp); + } diff --git a/src/core1/os/initialize.c b/src/core1/os/initialize.c new file mode 100644 index 00000000..9db77b66 --- /dev/null +++ b/src/core1/os/initialize.c @@ -0,0 +1,69 @@ +#include +#include "functions.h" +#include "variables.h" + + + +typedef struct +{ + /* 0x0 */ unsigned int inst1; + /* 0x4 */ unsigned int inst2; + /* 0x8 */ unsigned int inst3; + /* 0xC */ unsigned int inst4; +} __osExceptionVector; +// extern __osExceptionVector __osExceptionPreamble; +extern __osExceptionVector D_8026A2E0; + +OSTime osClockRate = OS_CLOCK_RATE; +s32 osViClock = VI_NTSC_CLOCK; +u32 __osShutdown = 0; +u32 __OSGlobalIntMask = OS_IM_ALL; +u32 __osFinalrom; + +void __osInitialize_common() +{ + u32 pifdata; + u32 clock = 0; + __osFinalrom = TRUE; + __osSetSR(__osGetSR() | SR_CU1); //enable fpu + __osSetFpcCsr(FPCSR_FS | FPCSR_EV); //flush denorm to zero, enable invalid operation + + while (__osSiRawReadIo(PIF_RAM_END - 3, &pifdata)) //last byte of joychannel ram + { + ; + } + while (__osSiRawWriteIo(PIF_RAM_END - 3, pifdata | 8)) + { + ; //todo: magic contant + } + *(__osExceptionVector *)UT_VEC = D_8026A2E0; //__osExceptionPreamble; + *(__osExceptionVector *)XUT_VEC = D_8026A2E0; //__osExceptionPreamble; + *(__osExceptionVector *)ECC_VEC = D_8026A2E0; //__osExceptionPreamble; + *(__osExceptionVector *)E_VEC = D_8026A2E0; //__osExceptionPreamble; + osWritebackDCache((void *)UT_VEC, E_VEC - UT_VEC + sizeof(__osExceptionVector)); + osInvalICache((void *)UT_VEC, E_VEC - UT_VEC + sizeof(__osExceptionVector)); + osMapTLBRdb(); + osPiRawReadIo(4, &clock); //TODO: remove magic constant; + clock &= ~0xf; //clear lower 4 bits + if (clock != 0) + { + osClockRate = clock; + } + osClockRate = osClockRate * 3 / 4; + if (osResetType == 0 /*cold reset */) + { + bzero(osAppNMIBuffer, OS_APP_NMI_BUFSIZE); + } + if (osTvType == OS_TV_PAL) + { + osViClock = VI_PAL_CLOCK; + } + else if (osTvType == OS_TV_MPAL) + { + osViClock = VI_MPAL_CLOCK; + } + else + { + osViClock = VI_NTSC_CLOCK; + } +} diff --git a/src/core1/os/writebackdcache.c b/src/core1/os/writebackdcache.c new file mode 100644 index 00000000..1ad06814 --- /dev/null +++ b/src/core1/os/writebackdcache.c @@ -0,0 +1,6 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core1/os/writebackdcache/osWritebackDCache.s") diff --git a/src/core2/animctrl.c b/src/core2/animctrl.c new file mode 100644 index 00000000..7d827ce9 --- /dev/null +++ b/src/core2/animctrl.c @@ -0,0 +1,351 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "core2/animctrl.h" +#include "animation.h" + +extern u32 D_A0000238; + +/* .code */ +void animctrl_80286F90(AnimCtrl *this){ + Animation *anim; + f32 duration; + + if(this->smooth_transition){ + anim = animctrl_getAnimPtr(this); + duration = anim_getDuration(anim); + if( duration < 1.0f ){ + anim_setDuration(anim, min_f(1.0f, time_getDelta()/animctrl_getTransistionDuration(this) + duration)); + } + } +} + +static void __animctrl_update_looped(AnimCtrl *this){ + Animation *anim; + f32 delta; + f32 tmp; + + anim = animctrl_getAnimPtr(this); + animctrl_80286F90(this); + this->timer = anim_getTimer(anim); + delta = time_getDelta() / animctrl_getDuration(this); + if(this->playback_direction == 0){ + delta = -delta; + } + tmp = this->timer + delta; + if(tmp < 0.0f){ + tmp += 1.0f; + } + tmp -= (f32)(s32)tmp;//0.0f to 1.0f + anim_setTimer(anim, tmp); +} + +void func_802870E0(AnimCtrl *this){ + Animation *anim; + f32 delta; + f32 tmpf14; + f32 f_range; + f32 f_percent; + + anim = animctrl_getAnimPtr(this); + animctrl_80286F90(this); + this->timer = anim_getTimer(anim);; + delta = time_getDelta() / animctrl_getDuration(this); + if(this->playback_direction == 0){ + delta = -delta; + } + tmpf14 = this->timer + delta; + if(this->subrange_end <= tmpf14){ + f_range = this->subrange_end - this->subrange_start; + f_percent = (tmpf14 - this->subrange_start)/f_range; + tmpf14 = this->subrange_start + (f_percent - (f32)(s32)f_percent)*f_range; + } + anim_setTimer(anim, tmpf14); +} + +void func_802871A4(AnimCtrl *this){ + Animation *anim; + f32 phi_f0; + f32 phi_f2; + + + anim = animctrl_getAnimPtr(this); + animctrl_80286F90(this); + this->timer = anim_getTimer(anim); + phi_f2 = time_getDelta() / animctrl_getDuration(this); + if (this->playback_direction == 0) { + phi_f2 = -phi_f2; + } + phi_f0 = this->timer + phi_f2; + + + if (phi_f0 < 0.0f) { + phi_f0 = 0.0f; + animctrl_setPlaybackType(this, ANIMCTRL_STOPPED); + + } else { + if ((this->subrange_end < phi_f0) || (0.999999 < (f64) phi_f0)) { + if(this->subrange_end < phi_f0) + phi_f0 = this->subrange_end; + if(0.999999 < (f64) phi_f0) + phi_f0 = 0.9999989867210388f; // D_80373E00 + animctrl_setPlaybackType(this, ANIMCTRL_STOPPED); + } else { + phi_f0 = phi_f0 - (f32) (s32) phi_f0; + } + } + anim_setTimer(anim, phi_f0); +} + +AnimCtrl *animctrl_new(s32 arg0){ //new + ActorAnimCtrl *this; + + this = (ActorAnimCtrl *)malloc( func_80289680() + 0x28); + this->animctrl.animation = &this->animation; + func_802896EC(&this->animation, 1); + this->animctrl.playback_type = 0; + this->animctrl.index = 0; + this->animctrl.unk25 = 1; + this->animctrl.timer = 0.0f; + this->animctrl.unk18 = 0.0f; + func_80287784(&this->animctrl, func_8030C77C()); + animctrl_setSubRange(&this->animctrl, 0.0f, 1.0f); + animctrl_setDuration(&this->animctrl, 2.0f); + animctrl_setTransitionDuration(&this->animctrl, 0.2f); + animctrl_setSmoothTransition(&this->animctrl, 1); + animctrl_setDirection(&this->animctrl, mvmt_dir_forwards); + return &this->animctrl; +} + +void animctrl_free(AnimCtrl * this){ //free + func_802896A0(this->animation); + free(this); +} + +void animctrl_update(AnimCtrl *this){//update + switch (this->playback_type) + { + case 0: + break; + case ANIMCTRL_ONCE: //once + func_802871A4(this); + break; + case ANIMCTRL_LOOP: //loop + __animctrl_update_looped(this); + break; + case ANIMCTRL_SUBRANGE_LOOP: + func_802870E0(this); + break; + case ANIMCTRL_STOPPED: //stopped + animctrl_80286F90(this); + break; + } +} + +AnimCtrl *animctrl_defrag(AnimCtrl *this){ //realloc + ActorAnimCtrl *full_struct; + full_struct = (ActorAnimCtrl *)defrag(this); + full_struct->animctrl.animation = &full_struct->animation; + return &full_struct->animctrl; +} + +void animctrl_setIndex(AnimCtrl *this, enum asset_e index){ + this->index = index; +} + +Animation *animctrl_getAnimPtr(AnimCtrl *this){ + return this->animation; +} + +void func_8028746C(AnimCtrl *this, void (* arg1)(s32,s32)){ + anim_80289790(this->animation, arg1); +} + +void func_8028748C(AnimCtrl *this, s32 arg1){ + anim_80289798(this->animation, arg1); +} + +void animctrl_reset(AnimCtrl *this){ + this->playback_type = ANIMCTRL_LOOP; + this->unk25 = 1; + this->timer = 0.0; + this->unk18 = 0.0; + animctrl_setSmoothTransition(this, 1); + animctrl_setSubRange(this, 0.0, 1.0); + animctrl_setDuration(this, 2.0); + animctrl_setTransitionDuration(this, 0.2); + animctrl_setDirection(this, mvmt_dir_forwards); +} + +void func_8028752C(AnimCtrl *this){ + if(this->unk25){ + if(this->playback_direction) + anim_setTimer(this->animation, 0.0f); + else + anim_setTimer(this->animation, 0.99999899f); + } + else + anim_setTimer(this->animation, this->unk18); + this->timer = anim_getTimer(this->animation); +} + +void _func_802875AC(AnimCtrl * this, char *file, s32 line){ + if(this->smooth_transition && anim_getIndex(this->animation) != 0){ + func_80289674(this->animation); + anim_setIndex(this->animation, this->index); + func_8028752C(this); + anim_setDuration(this->animation, 0.0f); + } else{ + anim_8028980C(this->animation); + anim_setIndex(this->animation, this->index); + func_8028752C(this); + anim_setDuration(this->animation, 1.0f); + } +} + +void animctrl_setAnimTimer(AnimCtrl *this, f32 timer){ + anim_setTimer(this->animation, timer); +} + +void animctrl_setPlaybackType(AnimCtrl *this, enum animctrl_playback_e arg1){ + this->playback_type = arg1; +} + +void animctrl_setDirection(AnimCtrl *this, s32 arg1){ + this->playback_direction = arg1; +} + +void animctrl_setSmoothTransition(AnimCtrl *this, s32 arg1){ + this->smooth_transition = arg1; +} + +void animctrl_setDuration(AnimCtrl *this, f32 arg1){ + if(IO_READ(0x238) - 0x10000003){ + arg1 += 3.0f; + } + this->animation_duration = arg1; +} + +void animctrl_setTransitionDuration(AnimCtrl *this, f32 arg1){ + this->transition_duration = arg1; +} + +void animctrl_setSubRange(AnimCtrl *this, f32 start, f32 end){ + this->subrange_start = start - (f32)(s32)start; + this->subrange_end = (end != 1.0)? end - (f32)(s32)end : end; + +} + +void animctrl_getSubRange(AnimCtrl *this, f32 *startPtr, f32 *endPtr){ + *startPtr = this->subrange_start; + *endPtr = this->subrange_end; +} + +void func_8028774C(AnimCtrl *this, f32 arg1){ + if(arg1 == 1.0) + arg1 = 0.9999989867210388f; // D_80373E18 + + this->unk18 = arg1; + this->unk25 = 0; +} + +void func_80287784(AnimCtrl *this, s32 arg1){ + this->unk23 = arg1; + this->unk24 = 0; +} + +enum asset_e animctrl_getIndex(AnimCtrl *this){ + return anim_getIndex(this->animation); +} + +enum animctrl_playback_e animctrl_getPlaybackType(AnimCtrl *this){ + return this->playback_type; +} + +s32 animctrl_isPlayedForwards(AnimCtrl *this){ + return this->playback_direction; +} + +s32 animctrl_isSmoothTransistion(AnimCtrl *this){ + return this->smooth_transition; +} + +f32 animctrl_getDuration(AnimCtrl *this){ + return this->animation_duration; +} + +f32 animctrl_getTransistionDuration(AnimCtrl *this){ + return this->transition_duration; +} + +f32 animctrl_getAnimTimer(AnimCtrl *this){ + return anim_getTimer(this->animation); +} + +f32 animctrl_getTimer(AnimCtrl *this){ + return this->timer; +} + +void animctrl_setTimer(AnimCtrl *this, f32 arg1){ + this->timer = arg1; +} + +s32 animctrl_8028780C(AnimCtrl *this, s32 arg1){ + return 0; +} + +s32 func_8028781C(AnimCtrl *this, f32 *arg1, s32 arg2){ + s32 map; + map = map_get(); + if( map != MAP_1E_CS_START_NINTENDO + && map != MAP_1F_CS_START_RAREWARE + && map != MAP_20_CS_END_NOT_100 + && this->unk23 !=0 + && arg1 != NULL + ){ + this->unk24 = this->unk24 -1; + if(this->unk24 == 0xFF){ + this->unk24 = animctrl_8028780C(arg1, arg2); + } + else{ + anim_802897A0(this->animation); + return; + } + } + func_802895F8(this->animation); +} + +s32 animctrl_isStopped(AnimCtrl *this){ + return animctrl_getPlaybackType(this) == ANIMCTRL_STOPPED; +} + +int animctrl_isAt(AnimCtrl *this, f32 arg1){ + int retval; + f32 f0 = anim_getTimer(this->animation); + + if(f0 == this->timer){ + return 0; + } + else{ + if(this->playback_direction != 0){ //forward direction + if(this->timer < f0){ + return this->timer <= arg1 && arg1 < f0; //arg1 between last animation time and new animation time + }else{ + return this->timer <= arg1 || arg1 < f0; //animation just looped, arg1 outside of loop + } + }else{ + if(f0 < this->timer){ + return arg1 <= this->timer && f0 < arg1; + }else{ + return arg1 <= this->timer || f0 < arg1; + } + } + } + + return retval; +} + +s32 animctrl_isContiguous(AnimCtrl *this){ + return (s32)this->animation - (s32) this == 0x28; +} diff --git a/src/core2/bs/ant.c b/src/core2/bs/ant.c new file mode 100644 index 00000000..aea37da6 --- /dev/null +++ b/src/core2/bs/ant.c @@ -0,0 +1,485 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80293D48(f32,f32); + +/* .data */ +const f32 D_80364960 = 30.0f; +const f32 D_80364964 = 500.0f; +const f32 D_80364968 = 0.44f; +const f32 D_8036496C = 0.2f; +const f32 D_80364970 = 693.5f; //ant initial jump y velocity +const f32 D_80364974 = -1200.0f; //ant jump gravity +u8 D_80364978 = 0; +s16 D_8036497C[3] = { + SFX_54_BANJO_HOO_1, + SFX_55_BANJO_HOO_2, + SFX_56_BANJO_HUI +}; + +/* .bss */ +f32 D_8037D290; +u8 D_8037D294; +s32 D_8037D298; + +/* .code */ +void func_8029E3E0(void){ + func_8030EB88(D_8036497C[D_80364978], 1.75f, 1.85f); + if(++D_80364978 > 2) + D_80364978 = 0; +} + +void func_8029E448(int arg0){ + func_8030EAAC(SFX_3D_TICKER_WALKING, arg0 ? 0.96f : 1.04f, 14000, 8); + +} + +void func_8029E48C(void){ + f32 sp1C = func_8029B30C(); + + if(func_8029B300() == 0){ + func_80297970(0.0f); + } + else{ + func_80297970(func_80257C48(sp1C, D_80364960, D_80364964)); + } +} + +void func_8029E4EC(void){ + if(!bsant_inSet(bs_getNextState())){ + func_8029B0C0(); + func_8029E070(0); + func_8029E064(0); + miscflag_clear(3); + miscflag_clear(4); + func_80293D74(); + } + func_80289F10(1); +} + +void func_8029E554(void){ + if(!bsant_inSet(bs_getPrevState())) + func_80293D48(50.0f, 25.0f); +} + +int bsant_inSet(s32 move_indx){ + return (move_indx == BS_35_ANT_IDLE) + || (move_indx == BS_ANT_WALK) + || (move_indx == BS_ANT_JUMP) + || (move_indx == BS_38_ANT_FALL) + || (move_indx == BS_3E_ANT_OW) + || (move_indx == BS_43_ANT_DIE) + || (move_indx == 0x8e) + || (move_indx == BS_ANT_DRONE); +} + +void bsant_idle_init(void){ + func_8029E554(); + func_8028A010(ANIM_TERMITE_IDLE, 1.2f); + func_8029C7F4(1,1,1,2); + func_80297970(0.0f); + pitch_setAngVel(1000.0f, 12.0f); + roll_setAngularVelocity(1000.0f, 12.0f); + miscflag_set(3); + miscflag_set(4); + func_802900B4(); +} + +void bsant_idle_update(void){ + enum bs_e new_state = 0; + func_80299628(0); + + if(func_8028B094()) + new_state = BS_38_ANT_FALL; + + if(func_80294F78()) + new_state = func_802926C0(); + + if(func_8029B300() > 0) + new_state = BS_ANT_WALK; + + if(button_pressed(BUTTON_A)) + new_state = BS_ANT_JUMP; + + bs_setState(new_state); +} + +void bsant_idle_end(void){ + func_802900FC(); + func_8029E4EC(); +} + +void bsant_walk_init(void){ + func_8029E554(); + func_8028A010(ANIM_TERMITE_WALK, 0.8f); + func_8029C7F4(2,1,1,2); + func_80289EC8(D_80364960, D_80364964, D_80364968, D_8036496C); + func_802900B4(); +} + +void bsant_walk_update(void){ + enum bs_e sp1C = 0; + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + + func_80299628(0); + func_8029E48C(); + + if(animctrl_isAt(aCtrl, 0.7781f)) + func_8029E448(0); + + if(animctrl_isAt(aCtrl, 0.2781f)) + func_8029E448(1); + + if(func_8029B300() == 0 && func_80297C04(1.0f)) + sp1C = BS_35_ANT_IDLE; + + if(func_8028B094()) + sp1C = BS_38_ANT_FALL; + + if(button_pressed(BUTTON_A)) + sp1C = BS_ANT_JUMP; + + bs_setState(sp1C); +} + +void bsant_walk_end(void){ + func_8029E4EC(); + func_802900FC(); +} + +void bsant_jump_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + func_8029E554(); + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_TERMITE_JUMP); + animctrl_setDuration(aCtrl, 1.0f); + animctrl_setTransitionDuration(aCtrl, 0.1f); + func_8028774C(aCtrl, 0.2987f); + animctrl_setSubRange(aCtrl, 0.0f, 0.4423f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsant.c", 0x17c); + func_8029C7F4(1,1,3,6); + if(func_8029B2E8() != 0.0f) + yaw_setIdeal(func_8029B33C()); + func_8029797C(yaw_getIdeal()); + func_8029E48C(); + func_802979AC(yaw_getIdeal(), func_80297A64()); + player_setYVelocity(D_80364970); + gravity_set(D_80364974); + func_8029E3E0(); + D_8037D294 = 0; +} + +void bsant_jump_update(void){ + enum bs_e sp2C = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + f32 sp1C[3]; + + func_8029E48C(); + _get_velocity(sp1C); + + if(button_released(BUTTON_A) && 0.0f < sp1C[1]) + gravity_reset(); + + switch(D_8037D294){ + case 0://L8029EA88 + if(animctrl_isStopped(aCtrl)){ + animctrl_setDuration(aCtrl, 5.0f); + func_8028A37C(0.5026f); + D_8037D294 = 1; + } + break; + case 1://L8029EABC + if(func_8028B254(0x82)){ + animctrl_setDuration(aCtrl, 1.0f); + func_8028A37C(1.0f); + D_8037D294 = 2; + } + break; + case 2://L8029EAF4 + func_80299628(0); + if(func_8028B2E8()){ + func_8029C5E8(); + D_8037D294 = 3; + } + break; + case 3://L8029EB24 + if(animctrl_isStopped(aCtrl)) + sp2C = BS_35_ANT_IDLE; + break; + }//L8029EB38 + if(func_8028B2E8()){ + func_80297970(0.0f); + if(func_8029B300() > 0) + sp2C = BS_ANT_WALK; + + if(button_pressed(BUTTON_A)) + sp2C = BS_ANT_JUMP; + } + + bs_setState(sp2C); +} + +void bsant_jump_end(void){ + gravity_reset(); + func_8029E4EC(); +} + +void bsant_fall_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + func_8029E554(); + D_8037D298 = 0; + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_TERMITE_JUMP); + animctrl_setDuration(aCtrl, 1.9f); + func_8028774C(aCtrl, 0.4423f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED); + func_802875AC(aCtrl, "bsant.c", 0x208); + func_8029C7F4(1,1,3,6); + D_8037D294 = 0; +} + +void bsant_fall_update(void){ + enum bs_e sp2C = 0; + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + f32 sp1C[3]; + + func_80299628(0); + if(D_8037D298) + func_8029E48C(); + + _get_velocity(sp1C); + switch(D_8037D294){ + case 0: + if(func_8028B254(0x5A)){ + animctrl_setDuration(aCtrl, 2.0f); + func_8028A37C(1.0f); + D_8037D294 = 1; + } + break; + case 1: + break; + } + if(func_8028B2E8()){ + if(miscflag_isTrue(0x19)) + sp2C = func_80292738(); + else + sp2C = BS_35_ANT_IDLE; + } + bs_setState(sp2C); +} + +void bsant_fall_end(void){ + func_8029E4EC(); +} + +static void __bsant_recoil_init(int take_damage){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp38; + f32 sp2C[3]; + f32 sp20[3]; + + func_8029E554(); + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_TERMITE_OW); + animctrl_setDuration(aCtrl, 1.4f); + animctrl_setSubRange(aCtrl, 0.0f, 0.4899f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsant.c", 0x272); + if(take_damage == 1) + func_8030E58C(SFX_38_BANJO_AYE_1, 1.8f); + else + func_8030E58C(SFX_56_BANJO_HUI, 1.8f); + + _player_getPosition(sp2C); + func_80294980(sp20); + func_80257F18(sp20, sp2C, &sp38); + yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f)); + yaw_applyIdeal(); + func_80297970(200.0f); + func_8029797C(sp38); + func_802979AC(sp38, func_80297A64()); + func_8029C7F4(1,1,2,3); + player_setYVelocity(510.0f); + gravity_set(-1200.0f); + func_8028D5DC(); + func_80292E48(); + D_8037D294 = 0; +} + +static void __bsant_recoil_update(void){ + enum bs_e sp1C = 0; + + if(baanim_isAt(0.5f)) + func_80292EA4(); + + switch(D_8037D294){ + case 0: + if(func_8028B254(0x5a)){ + func_8028A37C(1.0f); + D_8037D294 = 1; + } + break; + case 1: + break; + } + + if(func_8028B2E8()) + sp1C = BS_35_ANT_IDLE; + + bs_setState(sp1C); +} + +static void __bsant_recoil_end(void){ + func_80297CA8(); + gravity_reset(); + func_8028D5F4(); + func_80292EA4(); + func_8029E4EC(); +} + +void bsant_ow_init(void){ + __bsant_recoil_init(1); +} + +void bsant_ow_update(void){ + __bsant_recoil_update(); +} + +void bsant_ow_end(void){ + __bsant_recoil_end(); +} + +void bsant_bounce_init(void){ + __bsant_recoil_init(2); +} + +void bsant_bounce_update(void){ + __bsant_recoil_update(); +} + +void bsant_bounce_end(void){ + __bsant_recoil_end(); +} + +void bsant_die_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp38; + f32 sp2C[3]; + f32 sp20[3]; + func_8029E554(); + func_8029B930(); + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, 0); + animctrl_setIndex(aCtrl, ANIM_TERMITE_DIE); + animctrl_setSubRange(aCtrl, 0.0f, 0.523f); + animctrl_setDuration(aCtrl, 1.6f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsant.c", 0x2f6); + func_8030E58C(SFX_36_BANJO_DOH, 1.8f); + _player_getPosition(sp2C); + func_80294980(sp20); + func_80257F18(sp20, sp2C, &sp38); + D_8037D290 = 250.0f; + yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f)); + yaw_applyIdeal(); + func_80297970(D_8037D290); + func_8029797C(sp38); + func_802979AC(sp38, func_80297A64()); + func_8029C7F4(1,1,2,3); + player_setYVelocity(510.0f); + gravity_set(-1200.0f); + pitch_setAngVel(1000.0f, 12.0f); + func_802914CC(0xd); + func_802BF2C0(30.0f); + func_8029C984(); + D_8037D294 = 0; + func_8028D5DC(); + func_80292E48(); + func_8029E3C0(0, 2.9f); +} + +void bsant_die_update(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + func_80297970(D_8037D290); + func_80299628(0); + switch(D_8037D294){ + case 0://L8029F270 + if(func_8028B2E8()){ + func_8028A37C(1.0f); + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); + FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000); + D_8037D290 = 0.0f; + D_8037D294 = 1; + } + break; + case 1://L8029F2C0 + if(animctrl_isAt(aCtrl, 0.72f)){ + D_8037D290 = 0.0f; + D_8037D294 = 2; + } + break; + case 2://L8029F2F0 + if(animctrl_isAt(aCtrl, 0.77f)){ + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); + FUNC_8030E624(SFX_38_BANJO_AYE_1, 1.8f, 18000); + } + break; + } + + if(func_8029E1A8(0)) + func_8029B890(); + + bs_setState(0); +} + +void bsant_die_end(void){ + func_8024BD08(0); + gravity_reset(); + pitch_setIdeal(0.0f); + roll_setIdeal(0.0f); + func_80291548(); + func_80292EA4(); +} + +void func_8029F398(void){ + func_8029E554(); + func_8028A010(ANIM_TERMITE_IDLE, 2.0f); + func_8029C7F4(1,1,3,2); + func_80297970(0.0f); + func_8029C674(); + func_802B3A50(); +} + +void func_8029F3F4(void){ + enum bs_e sp1C = 0; + func_802B3A50(); + func_80299628(0); + func_8029C6D0(); + if(!func_80298850()) + sp1C = BS_35_ANT_IDLE; + + bs_setState(sp1C); +} + +void func_8029F440(void){ + func_8029C748(); + func_8029E4EC(); +} + +void bsant_drone_init(void){ + func_8029E554(); + bsdrone_init(); +} + +void bsant_drone_update(void){ + bsdrone_update(); +} + +void bsant_drone_end(void){ + bsdrone_end(); + func_8029E4EC(); +} \ No newline at end of file diff --git a/src/core2/bs/bBarge.c b/src/core2/bs/bBarge.c new file mode 100644 index 00000000..01e7ccb5 --- /dev/null +++ b/src/core2/bs/bBarge.c @@ -0,0 +1,184 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8029797C(f32); +f32 func_80297A64(void); +void func_80297970(f32); +f32 func_80297A7C(void); + +s32 func_8029E2E0(s32, f32); +void func_80292864(f32, f32); +void func_802979AC(f32, f32); +void func_8029E3C0(s32, f32); + + +/* .bss */ +f32 D_8037D2A0; +u8 D_8037D2A4; +u8 D_8037D2A5; +u8 D_8037D2A6; + +/* .code */ +s32 func_8029F4E0(Actor * arg0){ + return arg0->unk138_31 == 0; +} + +void func_8029F4F0(void){ + u8 val; + f32 tmp_f; + if(func_8029E1A8(2)){ + func_8029AE74(0); + func_8029E3C0(2, 0.12f); + } + if( (++D_8037D2A4) >= 3) + D_8037D2A4 = 0; + + switch(D_8037D2A4){ + case 0: + tmp_f = (func_80297A7C() + 180.0f); + func_80292864(tmp_f - 70.0f, 20.0f); + break; + case 1: + tmp_f = (func_80297A7C() + 180.0f); + func_80292864(tmp_f - 10.0f, 20.0f); + break; + case 2: + tmp_f = (func_80297A7C() + 180.0f); + func_80292864(tmp_f + 50.0f, 20.0f); + break; + } +} + +void func_8029F60C(void){ + f32 plyrPos[3]; + _player_getPosition(&plyrPos); + func_8032728C(plyrPos, 50.0f, 2, func_8029F4E0); +} + + +s32 bsbbarge_hitboxActive(void){ + return D_8037D2A6; +} + +void bsbarge_init(void){ + AnimCtrl *plyrMvmnt; + + plyrMvmnt = _player_getAnimCtrlPtr(); + animctrl_reset(plyrMvmnt); + animctrl_setSmoothTransition(plyrMvmnt, 0); + animctrl_setIndex(plyrMvmnt, ANIM_BANJO_BBARGE); + animctrl_setDuration(plyrMvmnt, 1.0f); + animctrl_setSubRange(plyrMvmnt, 0, 0.375f); + animctrl_setPlaybackType(plyrMvmnt, ANIMCTRL_ONCE); + func_802875AC(plyrMvmnt, "bsbbarge.c", 0x98); + D_8037D2A4 = 0; + func_8029C7F4(1,1,3,3); + func_8029797C(yaw_getIdeal()); + func_80297970(func_80297A64()*0.3); + func_802979AC(yaw_getIdeal(), func_80297A64()); + func_8029E070(1); + D_8037D2A6 = 0; + D_8037D2A5 = 0; + miscflag_clear(0xA); + miscflag_clear(0xB); + miscflag_clear(0xC); + func_8029E3C0(2, 0.01f); + +} + +void bsbarge_update(void){ + s32 sp24; + AnimCtrl *plyrMvmnt; + + sp24 = 0; + plyrMvmnt = _player_getAnimCtrlPtr(); + if(button_released(BUTTON_B)) + miscflag_set(0xA); + switch(D_8037D2A5){ + case 0: + if(animctrl_isAt(plyrMvmnt, 0.1392f)) + func_80299BD4(); + + if(!animctrl_isStopped(plyrMvmnt)) + break; + + if(miscflag_isFalse(0xA)){ + miscflag_set(0xC); + D_8037D2A0 = 850.0f; + }else{ + D_8037D2A0 = 500.0f; + } + func_8029E3C0(1, 0.01f); + D_8037D2A5 = 1; + break; + case 1: + func_8029E1A8(1); + if(miscflag_isFalse(0xB) && func_8029E2E0(1, 0.1f)){ + if(miscflag_isTrue(0xC)){ + func_8030E560(SFX_4_KAZOOIE_RUUUUUH, 30000); + }else{ + func_8030E560(SFX_43_KAZOOIE_RUH, 30000); + } + miscflag_set(0xB); + } + if(!func_8029E384(1)) + break; + + animctrl_setDuration(plyrMvmnt, 1.0f); + func_8028A37C(0.565f); + func_80297970(D_8037D2A0); + func_802979AC(yaw_getIdeal(), func_80297A64()); + func_8030E760(SFX_2_CLAW_SWIPE, 0.558f, 22000); + D_8037D2A5 = 2; + func_8029F4F0(); + D_8037D2A6 = 1; + break; + case 2: + func_80297970(D_8037D2A0); + if(animctrl_isStopped(plyrMvmnt)){ + animctrl_setDuration(plyrMvmnt, 2.0f); + func_8028A37C(0.6f); + func_8029E3C0(0, 0.1f); + D_8037D2A5 = 3; + } + func_8029F4F0(); + break; + case 3: + func_8029E1A8(0); + if(miscflag_isFalse(0xC) || func_8029E384(0)){ + D_8037D2A0 -= 80.0f; + } + func_80297970(D_8037D2A0); + if(D_8037D2A0 < 200.0f){ + animctrl_setDuration(plyrMvmnt, 1.5f); + func_8028A37C(1.0f); + D_8037D2A5 = 4; + } + func_8029F4F0(); + break; + case 4: + if(!func_8028B2E8()) + sp24 = BS_2F_FALL; + if(animctrl_isAt(plyrMvmnt, 0.7f)){ + D_8037D2A0 = 0.0f; + D_8037D2A6 = 0; + } + func_80297970(D_8037D2A0); + if(animctrl_isAt(plyrMvmnt, 0.9193f)) + sp24 = BS_20_LANDING; + break; + } + if(D_8037D2A6) + func_8029F60C(); + + if(player_inWater()) + sp24 = BS_4C_LANDING_IN_WATER; + bs_setState(sp24); +} + +void bsbarge_end(void){ + ability_use(5); + func_8029E070(0); + D_8037D2A6 = 0; +} diff --git a/src/core2/bs/bEggAss.c b/src/core2/bs/bEggAss.c new file mode 100644 index 00000000..321e57f4 --- /dev/null +++ b/src/core2/bs/bEggAss.c @@ -0,0 +1,65 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +u8 D_8037D2E0; +u8 D_8037D2E1; + +/* .code */ +void bseggass_init(void){ + func_8028A274(0x2B, 1.0f); + func_8029C7F4(1,3,1,3); + func_80299234(350.0f, 14.0f); + func_80297970(0.0f); + func_8029E058(1); + D_8037D2E0 = (D_8037D2E1 = 1); + func_802952A8(5,0); +} + +void bseggass_update(void) { + s32 next_state; + AnimCtrl *plyr_mvmt; + s32 has_eggs; + s32 sp28; + s32 fill1; + s32 fill2; + + next_state = 0; + plyr_mvmt = _player_getAnimCtrlPtr(); + has_eggs = (item_empty(ITEM_D_EGGS) == 0); + if (should_poop_egg()) { + if (has_eggs) + D_8037D2E0 = func_80258948(D_8037D2E0 + 1, 3); + else + func_80346C10(&sp28, -1, 0, ITEM_D_EGGS, 0); + } + if (has_eggs) { + if (animctrl_isAt(plyr_mvmt, 0.3837f)) { + func_8030E760(SFX_3E_POOP_NOISE, 1.4f, 28000); + func_8033E3F0(COMMON_PARTICLE_4_EGG_ASS, 1); + item_dec(ITEM_D_EGGS); + ability_use(7); + } + if ((animctrl_isAt(plyr_mvmt, 0.4885f)) && (D_8037D2E1 < D_8037D2E0)) { + func_8028774C(plyr_mvmt, 0.349f); + func_802875AC(plyr_mvmt, "bsbeggass.c", 0x5E); + D_8037D2E1++; + } + } + if (animctrl_isStopped(plyr_mvmt)) { + next_state = (button_held(BUTTON_Z))? BS_CROUCH : BS_1_IDLE; + } else if (0.6 < (f64) animctrl_getAnimTimer(plyr_mvmt)) { + next_state = func_802ADCD4(0); + } + if (func_8028B094()) + next_state = BS_2F_FALL; + bs_setState(next_state); +} + + +void bseggass_end(void){ + func_802952A8(5, 1); + gravity_reset(); + func_8029E058(0); +} diff --git a/src/core2/bs/bEggHead.c b/src/core2/bs/bEggHead.c new file mode 100644 index 00000000..aaf2c38b --- /dev/null +++ b/src/core2/bs/bEggHead.c @@ -0,0 +1,73 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80299234(f32, f32); +void func_802875AC(AnimCtrl *, char*, s32); + +/* .bss */ +u8 D_8037D2F0; +u8 D_8037D2F1; + +/* .code */ +void bsegghead_init(void){ + func_8028A274(0x2A, 1.0f); + func_8029C7F4(1,3,1,3); + func_80299234(350.0f, 14.0f); + func_80297970(0.0f); + func_8029E070(1); + D_8037D2F0 = (D_8037D2F1 = 1); + func_802952A8(2,0); +} + +void bsegghead_update(void) { + s32 next_state; + AnimCtrl *aCtrl; + s32 has_eggs; + s32 sp28; + s32 fill1; + s32 fill2; + + next_state = 0; + aCtrl = _player_getAnimCtrlPtr(); + has_eggs = (item_empty(ITEM_D_EGGS) == 0); + if (should_shoot_egg()) { + if (has_eggs) + D_8037D2F0 = func_80258948(D_8037D2F0 + 1, 3); + else + func_80346C10(&sp28, -1, 0, ITEM_D_EGGS, 0); + } + if (has_eggs) { + if (animctrl_isAt(aCtrl, 0.1f)) + func_8030E760(SFX_46_KAZOOIE_CHOKING_UP, 1.0f, 0x7fff); + + if (animctrl_isAt(aCtrl, 0.4f)) + func_8030E760(SFX_57_KAZOOIE_HEGH, 1.0f, 0x7fff); + + if (animctrl_isAt(aCtrl, 0.4704f)){ + func_8033E3F0(COMMON_PARTICLE_1_EGG_HEAD, 1); + item_dec(ITEM_D_EGGS); + ability_use(7); + } + if ((animctrl_isAt(aCtrl, 0.5919f)) && (D_8037D2F1 < D_8037D2F0)) { + func_8028774C(aCtrl, 0.3878f); + func_802875AC(aCtrl, "bsbegghead.c", 0x62); + D_8037D2F1++; + } + } + if (animctrl_isStopped(aCtrl)) { + next_state = (button_held(BUTTON_Z))? BS_CROUCH : BS_1_IDLE; + + } else if (0.65 < (f64) animctrl_getAnimTimer(aCtrl)) { + next_state = func_802ADCD4(0); + } + if (func_8028B094()) + next_state = BS_2F_FALL; + bs_setState(next_state); +} + +void bsegghead_end(void){ + func_802952A8(2, 1); + gravity_reset(); + func_8029E070(0); +} diff --git a/src/core2/bs/bFlap.c b/src/core2/bs/bFlap.c new file mode 100644 index 00000000..ac810dec --- /dev/null +++ b/src/core2/bs/bFlap.c @@ -0,0 +1,199 @@ +#include +#include "functions.h" +#include "variables.h" + + +f32 func_802A2858(void); + +/*.data*/ +const f32 D_80364A10 = 280.0f; +const f32 D_80364A14 = -1100.0f; +const f32 D_80364A18 = -399.9f; + +/*.bss*/ +u8 D_8037D300; +u8 D_8037D301; +f32 D_8037D304; +f32 D_8037D308; +u8 D_8037D30C; + +void bsbflap_init(void) { + func_8028A274(0x18, 0.3f); + func_8029C7F4(1, 1, 1, 2); + if (func_8029B2E8() != 0.0f) { + yaw_setIdeal(func_8029B33C()); + } + func_8029797C(yaw_getIdeal()); + func_802B6FA8(); + func_802979AC(yaw_getIdeal(), func_80297A64()); + player_setYVelocity(0.0f); + gravity_set(D_80364A14); + func_8029E070(1); + miscflag_set(0x12); + func_8029E3C0(0, 2.5f); + D_8037D30C = func_8030D90C(); + func_80299BD4(); + D_8037D301 = 0; + D_8037D308 = 0.0f; + D_8037D300 = 0; +} + +void func_802A2790(s32 arg0, f32 arg1, s32 arg2) { + func_8030E394(D_8037D30C); + sfxsource_setSfxId(D_8037D30C, arg0); + func_8030DBB4(D_8037D30C, arg1); + sfxsource_setSampleRate(D_8037D30C, arg2); + func_8030DD90(D_8037D30C, 0); + func_8030DD14(D_8037D30C, 3); + func_8030E2C4(D_8037D30C); +} + +void func_802A2810(void) { + AnimCtrl *plyrMvPtr; + plyrMvPtr = _player_getAnimCtrlPtr(); + if (animctrl_isAt(plyrMvPtr, 0.9f)) { + D_8037D301++; + } +} + +f32 func_802A2858(void){ + switch (D_8037D301) + { + case 0: + return 0.15f; + case 1: + return 0.2f; + case 2: + return 0.27f; + case 3: + return 0.38f; + case 4: + return 0.4f; + default: + return 0.7f; + } +} + +void func_802A28CC(void){ + AnimCtrl *sp1c = _player_getAnimCtrlPtr(); + animctrl_setDuration(sp1c, func_802A2858()); +} + +void func_802A2900(void){ + D_8037D304 = D_8037D308; + D_8037D308 += time_getDelta(); +} + +int func_802A293C(f32 arg0){ + return ((D_8037D304 <= arg0) && (arg0 < D_8037D308)); +} + +void func_802A298C(void){ + AnimCtrl * sp1c; + sp1c = _player_getAnimCtrlPtr(); + if(func_802A293C(0.08f)){ + func_802A2790(0x4e, 1.24f, 0x4e20); + } + + if((0.7 < D_8037D308) && animctrl_isAt(sp1c, 0.5698f)){ + func_802A2790(0x47, 1.0f, 0x55f0); + } +} + +void bsbflap_update(void){ + s32 sp1c; + AnimCtrl * sp18; + + sp1c = 0; + sp18 = _player_getAnimCtrlPtr(); + func_802B6FA8(); + switch(D_8037D300){ + case 0: + func_80293350(); + func_802A2900(); + func_802A298C(); + if(animctrl_isAt(sp18, 0.9f)){ + animctrl_setSmoothTransition(sp18, 0); + animctrl_setIndex(sp18, ANIM_BANJO_BFLAP); + animctrl_setDuration(sp18, func_802A2858()); + animctrl_setPlaybackType(sp18, ANIMCTRL_LOOP); + func_8028774C(sp18, 0.0f); + func_802875AC(sp18, "bsbflap.c", 0xe1); + player_setYVelocity(D_80364A10); + gravity_set(D_80364A14); + func_80297BF8(D_80364A18); + D_8037D300 = 1; + } + break; + case 1: + func_80293350(); + func_802A2900(); + func_802A2810(); + func_802A28CC(); + func_802A298C(); + if(0.67 <= D_8037D308){ + D_8037D300 = 2; + } + break; + case 2: + func_80293350(); + func_802A2900(); + func_802A2810(); + func_802A28CC(); + func_802A298C(); + if(D_8037D301 == 4) + D_8037D300 = 3; + if(button_released(BUTTON_A)){ + gravity_reset(); + func_80297B94(); + animctrl_setDuration(sp18, 1.0f); + D_8037D300 = 4; + } + break; + case 3: + func_80293350(); + func_802A2900(); + func_802A2810(); + func_802A28CC(); + func_802A298C(); + if(button_released(BUTTON_A)){ + gravity_reset(); + func_80297B94(); + animctrl_setDuration(sp18, 1.0f); + func_80293240(2); + D_8037D300 = 4; + } + else{ + func_80297970(func_80297A64() * 0.35); + } + break; + case 4: + if(func_8028B424()) + sp1c = BS_3D_FALL_TUMBLING; + break; + }//L802A2C94 + func_8029E1A8(0); + if(func_8029E384(0)) + sp1c = BS_2F_FALL; + + if(should_beak_bust()) + sp1c = BS_F_BBUSTER; + + if(func_8028B2E8()){ + func_8029C5E8(); + sp1c = BS_2_WALK_SLOW; + } + + if(player_inWater()) + sp1c = BS_4C_LANDING_IN_WATER; + + bs_setState(sp1c); +} + +void bsbflap_end(void) { + ability_use(1); + gravity_reset(); + func_80297B94(); + func_8029E090(0, 0.2f); + func_8030DA44(D_8037D30C); +} \ No newline at end of file diff --git a/src/core2/bs/bFlip.c b/src/core2/bs/bFlip.c new file mode 100644 index 00000000..fefc8324 --- /dev/null +++ b/src/core2/bs/bFlip.c @@ -0,0 +1,167 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .data */ +const f32 D_80364A20 = 920.0f; +const f32 D_80364A24 = -1200.0f; +const f32 D_80364A28 = -533.3f; +const f32 D_80364A2C = 80.0f; +const f32 D_80364A30 = 200.0f; + +/* .bss */ +u8 D_8037D310; + + +/* .code */ +void _bsbflip_802A2D60(void){ + f32 sp1C; + sp1C = func_8029B30C(); + if(!func_8029B300()) + func_80297970(0.0f); + else + func_80297970(func_80257C48(sp1C, D_80364A2C, D_80364A30)); +} + +void _bsbflip_802A2DC0(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp20[3]; + + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_BANJO_BFLIP); + animctrl_setDuration(aCtrl, 2.2f); + func_8028774C(aCtrl, 0.8566f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsbflip.c", 0x69); //nice + func_802978DC(3); + func_80297970(0.0f); + ml_vec3f_clear(sp20); + func_80297A0C(sp20); + func_8029C5E8(); +} + +void bsbflip_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, 0); + animctrl_setIndex(aCtrl, ANIM_BANJO_BFLIP); + animctrl_setDuration(aCtrl, 2.3f); + animctrl_setSubRange(aCtrl, 0.0f, 0.7866f); + func_8028774C(aCtrl, 0.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsbflip.c", 0x80); + func_8029C7F4(1,1,2,3); + func_8029B324(0, 0.03f); + func_8029B324(1, 1.0f); + func_8029E070(1); + func_80299BD4(); + D_8037D310 = 0; +} + +void bsbflip_update(void){ + enum bs_e sp24 = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + if( animctrl_isAt(aCtrl, 0.2394f) + && animctrl_getPlaybackType(aCtrl) != 2 + && animctrl_getIndex(aCtrl) == 0x4B + ){ + func_8030E760(SFX_2_CLAW_SWIPE, 0.558f, 22000); + } + + switch(D_8037D310){ + case 0://L802A2FD4 + if(animctrl_isAt(aCtrl, 0.1837f)){ + if(func_8029B2E8() != 0.0f){ + func_802991A8(2); + func_8029957C(3); + if(func_8029B2E8){ //!!! BUG !!! + yaw_setIdeal(func_8029B33C()); + } + func_80299254(1.0f); + func_802978DC(6); + func_8029797C(yaw_getIdeal()); + func_80297970(200.0f); + func_802979AC(yaw_getIdeal(), func_80297A64()); + }else{//L802A3098 + func_802978DC(6); + func_80297970(0.0f); + } + player_setYVelocity(D_80364A20); + gravity_set(D_80364A24); + func_80297BF8(D_80364A28); + animctrl_setDuration(aCtrl, 1.9f); + func_8030E4E4(SFX_33_BANJO_AHOO); + D_8037D310 = 1; + } + break; + case 1://L802A30F8 + _bsbflip_802A2D60(); + if(animctrl_isStopped(aCtrl)){ + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, 0); + animctrl_setIndex(aCtrl, 0x4C); + animctrl_setDuration(aCtrl, 0.13f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_LOOP); + func_802875AC(aCtrl, "bsbflip.c", 0xd9); + D_8037D310 = 2; + }//L802A316C + if(should_beak_bust()){ + sp24 =BS_F_BBUSTER; + } + break; + case 2://L802A3184 + if(func_8028B424()) + sp24 = BS_3D_FALL_TUMBLING; + if(button_released(BUTTON_A)){ + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, 0); + animctrl_setIndex(aCtrl, 0x61); + animctrl_setDuration(aCtrl, 0.8f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsbflip.c", 0xee); + func_80297B94(); + D_8037D310 = 3; + }//L802A320C + if(func_8028B2E8()){ + _bsbflip_802A2DC0(); + sp24 = func_8029C9C0(sp24); + D_8037D310 = 4; + } + else if(should_beak_bust()){ + sp24 = BS_F_BBUSTER; + } + break; + case 3://L802A3258 + if(func_8028B424()) + sp24 = BS_3D_FALL_TUMBLING; + if(func_8028B2E8()){ + func_8029E070(0); + _bsbflip_802A2DC0(); + sp24 = func_8029C9C0(sp24); + D_8037D310 = 4; + } + else if(should_beak_bust()){ + sp24 = BS_F_BBUSTER; + } + break; + case 4://L802A32C0 + if(animctrl_isStopped(aCtrl)) + sp24 = BS_2_WALK_SLOW; + sp24 = func_8029C9C0(sp24); + break; + }//L802A32E0 + + if(player_inWater()) + sp24 = BS_4C_LANDING_IN_WATER; + + bs_setState(sp24); +} + +void bsbflip_end(void){ + ability_use(2); + gravity_reset(); + func_80297B94(); + func_8029E070(0); + func_8029B0C0(); +} diff --git a/src/core2/bs/bFly.c b/src/core2/bs/bFly.c new file mode 100644 index 00000000..c9da9736 --- /dev/null +++ b/src/core2/bs/bFly.c @@ -0,0 +1,823 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8028FDC8(f32); +extern void func_802921BC(f32); +extern f32 func_8029B2D0(void); +extern void func_802BFE50(f32, f32, f32); +extern void func_80354030(f32[3], f32); + + +/* .data */ + + +/* .bss */ +f32 D_8037D320; +f32 D_8037D324; +f32 D_8037D328[3]; +f32 D_8037D338[3]; +u8 D_8037D344; +u8 D_8037D345; +u8 D_8037D346; +u8 D_8037D347; + +/* .code */ +int func_802A3350(void){ + if(!func_8028B2E8()) + return 0; + if(func_80294684() & 8){ + return 0; + } + return 1; +} + +void func_802A339C(f32 arg0[3], f32 arg1[3], f32 arg2){ + func_8024C5A8(arg0); + ml_vec3f_scale(arg0, arg2); + func_8024C764(arg1); +} + +void func_802A33D8(void){ + pitch_setAngVel(500.0f, 1.2f); +} + +void func_802A3404(void){ + pitch_setAngVel(1000.0f, 2.2f); +} + +void func_802A3430(void){ + func_802921BC(60.0f); + func_802991A8(3); + func_80299234(500.0f, 2.0f); + roll_setAngularVelocity(500.0f, 2.0f); + func_802A33D8(); + func_80293D48(60.0f, 45.0f); + func_80294378(4); + func_8028FEF0(); + func_8028FFBC(1); +} + +void func_802A34C8(void){ + if(!bsbfly_inSet(bs_getNextState())){ + gravity_reset(); + func_80297B94(); + func_8029E070(0); + func_802921BC(0.0f); + func_8029CB84(); + func_802991A8(1); + func_80291548(); + func_80293D74(); + func_80294378(1); + func_8028FFBC(0); + } +} + +void func_802A354C(void){ + f32 yaw_range; + f32 roll_range; + f32 sp2C; + + sp2C = func_8029B2D0(); + if(button_held(BUTTON_R)){ + func_80299234(500.0f, 30.0f); + yaw_range = 6.0f; + roll_range = 85.0f; + } + else{ + func_80299234(500.0f, 2.0f); + yaw_range = 3.0f; + roll_range = 75.0f; + } + roll_setIdeal(ml_map_f(sp2C, -1.0f, 1.0f, -roll_range, roll_range)); + yaw_setIdeal(mlNormalizeAngle(yaw_getIdeal() + ml_map_f(sp2C, -1.0f, 1.0f, yaw_range, -yaw_range))); +} + +void func_802A3648(void){ + f32 tmp_f0 = func_8029B2DC(); + + if(tmp_f0 < 0.0f) + pitch_setIdeal(ml_map_f(tmp_f0, -1.0f, 0.0f, 300.0f, 360.0f)); + else + pitch_setIdeal(ml_map_f(tmp_f0, 0.0f, 1.0f, 0.0f, 80.0f)); + + +} + +void func_802A36D0(void){ + f32 plyr_pos[3]; + + _player_getPosition(plyr_pos); + plyr_pos[0] += randf2(-30.0f, 30.0f); + plyr_pos[1] += 50.0f + randf2(0.0f, 30.0f); + plyr_pos[2] += randf2(-30.0f, 30.0f); + func_803541C0(5); + func_803541CC(0x50); + func_80354030(plyr_pos, 0.5f); + +} + +int bsbfly_inSet(enum bs_e arg0){ + return arg0 == BS_BOMB + || arg0 == BS_57_BOMB_END + || arg0 == BS_18_FLY_KNOCKBACK + || arg0 == BS_59_BFLY_UNK59 + || arg0 == BS_FLY_OW + || arg0 == BS_BFLY_UNK76 + || arg0 == BS_24_FLY + || arg0 == BS_BFLY_UNK99; +} + +int func_802A37F8(void){ + return bsbfly_inSet(bs_getState()); +} + +void bsbfly_enter_init(void){ + func_8028A274(ANIM_BANJO_FLY_ENTER, 1.4f); + func_8029C7F4(1,1,3,6); + if(func_8029B2E8() != 0.0f) + yaw_setIdeal(func_8029B33C()); + + func_8029797C(yaw_getIdeal()); + func_80297A0C(0); + func_80297970(0.0f); + gravity_set(-1200.0f); + func_8029E070(1); + func_80299BD4(); + D_8037D344 = 0; + D_8037D346 = 0; +} + +void bsbfly_enter_update(void){ + enum bs_e sp1C = 0; + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + + switch(D_8037D344){ + case 0: + if(animctrl_isAt(aCtrl, 0.2416f)){ + animctrl_setDuration(aCtrl, 2.4f); + player_setYVelocity(1600.0f); + func_8030E58C(SFX_C_TAKING_FLIGHT_LIFTOFF, 0.7f); + D_8037D344 = 1; + } + break; + default: + func_802A36D0(); + if(func_80297AAC() < 0.0f) + sp1C = BS_24_FLY; + break; + } + + bs_setState(sp1C); +} + +void bsbfly_enter_end(void){ + ability_use(8); + func_8029E070(0); +} + +void bsbfly_init(void){ + func_8028A010(ANIM_BANJO_FLY, 0.62f); + func_8029C7F4(1,1,3,3); + if(miscflag_isTrue(9)){ + func_80297970(0.0f); + }else{ + func_80297970(600.0f); + } + + func_802979AC(yaw_getIdeal(), func_80297A64()); + func_8029797C(yaw_getIdeal()); + func_8029E070(1); + gravity_set(-300.0f); + func_80297BF8(-99.9f); + func_802914CC(4); + func_802A3430(); + D_8037D320 = 1.0f; + D_8037D344 = 0; + D_8037D347 = 0; +} + +void bsbfly_update(void){ + enum bs_e sp54 = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + int sp4C; + f32 sp40[3]; + f32 sp3C; + f32 sp38; + f32 sp34; + int sp30; + enum bs_e sp2C; + + + func_802A354C(); + func_802A3648(); + sp3C = pitch_get(); + sp2C = 0; + if(button_pressed(BUTTON_A)) + D_8037D347 = 1; + + if(D_8037D347 && func_8023DB5C()%3 == 0){ + D_8037D347 = 0; + func_80346C10(&sp2C, 0, BS_1_IDLE, ITEM_F_RED_FEATHER, 1); + } + + if(sp2C || D_8037D346){ + if(sp2C){ + animctrl_setDuration(aCtrl, 0.3f); + func_802D8BE4(0); + } + if(D_8037D346){ + D_8037D346 = 0; + func_8028FDC8(0.35f); + }else{ + func_8028FDC8(1.0f); + } + }//L802A3BB4 + + sp30 = func_8028FD30(); + switch(D_8037D344){ + case 0: + if(sp30) + D_8037D344 = 1; + break; + case 1://L802A3BF4 + sp34 = mlNormalizeAngle(pitch_getIdeal() - 30.0f); + if((80.0f < sp34 && sp34 < 300.0f)) + sp34 = 300.0f; + pitch_setIdeal(sp34); + func_802A3404(); + if(sp30){ + player_setYVelocity(sp30 * 400.0); + } + if(!sp30){ + animctrl_setDuration(aCtrl, 0.62f); + func_802A33D8(); + D_8037D344 = 0; + } + break; + }//L802A3CB8 + if(animctrl_isAt(aCtrl, 0.1358f)){ + func_8030EBC8(SFX_2_CLAW_SWIPE, 0.6f, 0.7f, 0x2710, 0x2ee0); + } + gravity_set(-300.0f); + if(miscflag_isTrue(9)){ + func_80297BF8(0.0f); + func_80297A0C(0); + sp38 = 0.0f; + } + else if(sp3C <= 80.0f){ + func_80297BF8(ml_map_f(sp3C, 60.0f, 80.0f, -99.9f, -1000.33)); + gravity_set(ml_map_f(sp3C, 60.0f, 80.0f, -300.0f, -700.0f)); + sp38 = ml_map_f(sp3C, 60.0f, 80.0f, 600.0f, 60.0f); + } + else{ + func_80297BF8(ml_map_f(sp3C, 300.0f, 310.0f, -399.99f, -99.9f)); + sp38 = ml_map_f(sp3C, 300.0f, 340.0f, 0.0f, 600.0f); + }//L802A3E18 + + sp4C = func_802946F0(); + func_8029445C(sp40); + + if(sp4C && -1.0 < sp40[1]) + sp38 = 0.0f; + + func_8029797C(yaw_get()); + func_80297970(sp38); + + if(should_beak_bust()) + sp54 = BS_F_BBUSTER; + + D_8037D320 = max_f(D_8037D320 - time_getDelta(), 0.0f); + if( D_8037D320 == 0.0f + && button_pressed(BUTTON_B) + && can_beak_bomb() + ){ + sp2C = 0; + func_80346C10(&sp2C, 0, 1, ITEM_F_RED_FEATHER, 1); + if(sp2C) + sp54 = BS_BOMB; + } + + if(player_inWater()) + sp54 = BS_2D_SWIM_IDLE; + + if(func_802A3350()) + sp54 = BS_1_IDLE; + + func_8028FFF0(); + bs_setState(sp54); +} + +void func_802A3F70(void){ + func_802A34C8(); +} + + +int bsbfly_bombHitboxActive(void){ + return D_8037D345; +} + +//bsbfly_bomb_init +void func_802A3F9C(void){ + f32 sp1C[3]; + func_8028A180(ASSET_43_ANIM_BANJO_BEAKBOMB_START, 1.0f); + func_8029C7F4(1,1,3,7); + func_802A339C(D_8037D338, sp1C, 4200.0f); + yaw_setIdeal(sp1C[1] + 180.0f); + pitch_setIdeal(sp1C[0]); + roll_setIdeal(0.0f); + func_80297A0C(D_8037D338); + pitch_setIdeal(sp1C[0]); + func_8029E070(1); + func_802914CC(4); + func_802BFE74(1); + func_802A3430(); + FUNC_8030E624(SFX_52_BANJO_YAH_OH, 1.0f, 28000); + D_8037D345 = 0; + _player_getPosition(D_8037D328); + D_8037D344 = 0; + func_802D8BE4(0); +} + +void func_802A4078(void){ + f32 plyr_pos[3]; + + _player_getPosition(plyr_pos); + plyr_pos[0] += D_8037D338[0]; + plyr_pos[1] += D_8037D338[1]; + plyr_pos[2] += D_8037D338[2]; + func_80294A64(plyr_pos); + func_8030E6D4(SFX_13_BEAKBUSTER_GROUND); +} + +s32 func_802A40E0(void){ + func_802A4078(); + item_dec(ITEM_14_HEALTH); + if(item_getCount(ITEM_14_HEALTH)) + return BS_59_BFLY_UNK59; + else + return BS_41_DIE; +} + +void func_802A411C(void) { + s32 next_state; + AnimCtrl *sp58; + Struct60s *phi_v0; + f32 sp48[3]; + s32 sp44; + s32 sp40; + f32 sp34[3]; + f32 sp28[3]; + f32 sp24; + + next_state = 0; + sp58 = _player_getAnimCtrlPtr(); + switch (D_8037D344) { + case 0: + if (animctrl_isAt(sp58, 0.6905f)) { + func_802978DC(8); + func_802914CC(5); + func_802BF590(&D_8037D338); + animctrl_setDuration(sp58, 0.05f); + func_80299CF4(SFX_50_KAZOOIE_RRRUH, 1.3f, 0x7FFF); + D_8037D345 = 1; + D_8037D324 = 0.0f; + D_8037D344 = 1; + } + break; + case 1: + func_802A36D0(); + D_8037D324 += time_getDelta(); + sp40 = func_8028B2E8(); + if (player_inWater()) { + next_state = BS_4C_LANDING_IN_WATER; + } + if ((func_80294530()) || (sp40)) { + if (sp40) { + func_80294480(sp34); + phi_v0 = func_8029463C(); + } else { + func_802944D0(sp34); + phi_v0 = func_802946F0(); + } + if (phi_v0 != NULL) { + sp44 = phi_v0->unk8; + } else { + sp44 = 0; + } + ml_vec3f_copy(sp28, &D_8037D338); + ml_vec3f_normalize(sp28); + sp24 = mlAbsF(sp34[0] * sp28[0] + sp34[1] * sp28[1] + sp34[2] * sp28[2]); + if (miscflag_isTrue(8) || ((sp44 & 0x80) != 0)) { + func_802A4078(); + next_state = BS_18_FLY_KNOCKBACK; + } else if (0.4 < sp24) { + if (0.65 > sp34[1]) { + next_state = func_802A40E0(); + } else { + next_state = BS_58; + } + } else if (sp40 != 0) { + next_state = BS_58; + } + } + _player_getPosition(sp48); + ml_vec3f_diff(sp48, D_8037D328); + if (sp48[0]*sp48[0] + sp48[1]*sp48[1] + sp48[2]*sp48[2] > 16000000.0f) { + next_state = BS_57_BOMB_END; + } + if (animctrl_isStopped(sp58) != 0) { + animctrl_setIndex(sp58, 0x47); + animctrl_setDuration(sp58, 0.3f); + animctrl_setPlaybackType(sp58, ANIMCTRL_LOOP); + func_802875AC(sp58, "bsbfly.c", 0x361); + } + break; + } + bs_setState(next_state); +} + +void func_802A4404(void){ + func_80299E6C(); + D_8037D345 = 0; + func_802A34C8(); +} + +void func_802A4430(void){ + AnimCtrl *plyr_animctrl; + + plyr_animctrl = _player_getAnimCtrlPtr(); + animctrl_reset(plyr_animctrl); + animctrl_setTransitionDuration(plyr_animctrl, 0.3f); + animctrl_setIndex(plyr_animctrl, ASSET_CC_ANIM_BANJO_BEAKBOMB_END); + animctrl_setDuration(plyr_animctrl, 0.38f); + animctrl_setPlaybackType(plyr_animctrl, ANIMCTRL_LOOP); + func_802875AC(plyr_animctrl, "bsbfly.c", 0x38a); + func_8029C7F4(1, 1, 3, 3); + func_8029E070(1); + func_802A3430(); + func_80293D74(); + func_80294378(1); + roll_setIdeal(0.0f); + pitch_setIdeal(0.0f); + gravity_reset(); + func_80297B94(); + func_802921BC(0.0f); + func_80299CF4(SFX_31_BANJO_OHHWAAOOO, 1.0f, 0x7fff); + func_80299D2C(SFX_61_CARTOONY_FALL, 1.0f, 0x7fff); + D_8037D320 = 0.35f; + D_8037D344 = 0; +} + +void func_802A4548(void){ + s32 next_state = 0; + f32 sp20[3]; + _get_velocity(sp20); + switch(D_8037D344){ + case 0://L802A457C + if(func_8028B254(0x5A)){ + func_8028A1F4(8, 2.0f, 0.6667f); + D_8037D344 = 1; + } + break; + case 1://L802A45A8 + break; + }//L802A45A8 + D_8037D320 -= time_getDelta(); + if(D_8037D320 < 0.0f){ + D_8037D346 = 1; + next_state = BS_24_FLY; + } + if(should_peck()) + next_state = BS_11_BPECK; + + if(should_beak_bust()) + next_state = BS_F_BBUSTER; + + if(func_8028B2E8()){ + func_8029C5E8(); + next_state = BS_20_LANDING; + } + + if(player_inWater()) + next_state = BS_2D_SWIM_IDLE; + + bs_setState(next_state); +} + +void func_802A4664(void){ + s32 next_state; + func_80299E6C(); + func_80299E90(); + next_state = bs_getNextState(); + if(next_state == BS_20_LANDING || next_state == BS_24_FLY || next_state == BS_2D_SWIM_IDLE){ + func_8030E484(SFX_3EA_UNKNOWN); + } + func_802A34C8(); + func_8029E070(0); +} + +void func_802A46C8(void) { + f32 phi_f20; + + for(phi_f20 = 0.0f; phi_f20 < 360.0f; phi_f20 += 45.0f){ + func_80292900(phi_f20, 230.0f); + } +} + + +void func_802A4748(void) { + func_8028A180(0x3E, 1.4f); + func_8029C7F4(1, 1, 3, 3); + func_8029E070(1); + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 32750); + func_80299CF4(SFX_36_BANJO_DOH, 1.0f, 28000); + func_80250D94(1.0f, 0.5f, 0.5f); + item_dec(ITEM_14_HEALTH); + func_802A46C8(); + func_8028D5DC(); + D_8037D344 = 0; +} + +void func_802A47E0(void) { + AnimCtrl *sp1C; + + sp1C = _player_getAnimCtrlPtr(); + if (animctrl_isAt(sp1C, 0.3659f)) { + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 1.0f, 14000); + func_80299CF4(SFX_8B_KAZOOIE_RAWW, 1.0f, 28000); + } + if (animctrl_isAt(sp1C, 0.6862f)) { + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); + func_80299CF4(SFX_38_BANJO_AYE_1, 1.0f, 22000); + } + if (animctrl_isAt(sp1C, 0.92f)) { + func_80297970(0.0f); + } + if (animctrl_getAnimTimer(sp1C) < 0.8) { + func_802929F8(); + } +} + +void func_802A48B4(void) { + s32 next_state; + AnimCtrl *sp18; + + next_state = 0; + sp18 = _player_getAnimCtrlPtr(); + func_80299628(0); + switch (D_8037D344) { + case 0: + func_802A47E0(); + if (animctrl_isAt(sp18, 0.2f) != 0) { + if (item_getCount(ITEM_14_HEALTH) == 0) { + func_8029C984(); + func_8029151C(0xD); + func_802BF2C0(30.0f); + func_8029B930(); + func_8029E3C0(0, 2.5f); + D_8037D344 = 2; + } + } else if (animctrl_isAt(sp18, 0.92f)) { + func_8028A180(0xD2, 2.25f); + D_8037D344 = 1; + } + break; + case 1: + if (animctrl_isAt(sp18, 0.219f)) { + func_80299CF4(SFX_36_BANJO_DOH, 1.0f, 0x3E80); + } + if (animctrl_isAt(sp18, 0.63f)) { + next_state = BS_20_LANDING; + } + if (animctrl_isStopped(sp18)) { + next_state = BS_1_IDLE; + } + if (func_8028B094()) { + next_state = BS_2F_FALL; + } + break; + case 2: + func_802A47E0(); + if (func_8029E1A8(0)) { + func_8029B890(); + } + break; + } + bs_setState(next_state); +} + + +void func_802A4A40(void) { + func_80291548(); + func_8029CB84(); + func_8029E070(0); + func_8028D5F4(); +} + +void func_802A4A78(s32 arg0) { + f32 sp3C[3]; + f32 sp30[3]; + f32 sp2C; + f32 sp28; + f32 pad24; + f32 sp20; + + if (arg0 == 0) { + sp2C = -2200.0f; + sp20 = 800.0f; + } else { + sp2C = -1200.0f; + sp20 = 400.0f; + } + func_802BB3DC(2, 100.0f, 0.85f); + func_8028A274(0xD3, 1.2f); + func_80299BFC(1.0f); + func_80250D94(1.0f, 0.5f, 0.5f); + _player_getPosition(sp3C); + func_80294980(sp30); + func_80257F18(sp30, sp3C, &sp28); + yaw_setIdeal(mlNormalizeAngle(sp28 + 180.0f)); + yaw_applyIdeal(); + func_80297970(sp20); + func_8029797C(sp28); + func_802979AC(sp28, func_80297A64()); + if ((arg0 == 1) && (map_get() == MAP_90_GL_BATTLEMENTS)) { + yaw_setIdeal(mlNormalizeAngle(sp28)); + yaw_applyIdeal(); + } + func_8029C7F4(1, 1, 2, 3); + player_setYVelocity(800.0f); + gravity_set(sp2C); + func_80297BF8(-4000.0f); + func_8029E070(1); + func_802914CC(4); + func_802BFE50(12.0f, 10000.0f, 800.0f); + func_8028D5DC(); + func_802A3430(); +} + +void func_802A4C34(s32 arg0) { + s32 next_state; + + next_state = 0; + if (animctrl_isStopped(_player_getAnimCtrlPtr())) { + next_state = BS_24_FLY; + } + if (func_8028B2E8()) { + next_state = BS_2_WALK_SLOW; + } + bs_setState(next_state); +} + +void func_802A4C88(s32 arg0) { + func_80297B3C(); + func_8028D5F4(); + func_80297CA8(); + func_8029E070(0); + func_80291548(); + func_802A34C8(); +} + +void func_802A4CD0(void){ + func_802A4A78(0); +} + +void func_802A4CF0(void){ + func_802A4C34(0); +} + +void func_802A4D10(void){ + func_802A4C88(0); +} + +void func_802A4D30(void){ + func_802A4A78(1); +} + +void func_802A4D50(void){ + func_802A4C34(1); +} + +void func_802A4D70(void){ + func_802A4C88(1); +} + +void func_802A4D90(void) { + f32 sp34; + f32 sp28[3]; + f32 sp1C[3]; + + func_802BB3DC(2, 100.0f, 0.85f); + func_8028A274(0x10D, 1.0f); + func_8030E58C(SFX_56_BANJO_HUI, 1.0f); + _player_getPosition(&sp28); + func_80294980(sp1C); + func_80257F18(sp1C, sp28, &sp34); + yaw_setIdeal(mlNormalizeAngle(sp34 + 180.0f)); + yaw_applyIdeal(); + func_80297970(1300.0f); + func_8029797C(sp34); + func_802979AC(sp34, func_80297A64()); + if (map_get() == MAP_90_GL_BATTLEMENTS) { + yaw_setIdeal(mlNormalizeAngle(sp34)); + yaw_applyIdeal(); + } + func_8029C7F4(1, 1, 2, 3); + player_setYVelocity(400.0f); + gravity_set(-1800.0f); + func_8028D5DC(); + func_802914CC(4); + func_802BFE50(12.0f, 10000.0f, 800.0f); +} + +void func_802A4EC8(void) { + s32 next_state; + AnimCtrl *sp18; + + next_state = 0; + sp18 = _player_getAnimCtrlPtr(); + if (func_8028B2E8()) { + next_state = BS_20_LANDING; + } + if (animctrl_isStopped(sp18) && (func_8028B094() || func_80294530())) { + D_8037D346 = 1; + next_state = BS_24_FLY; + } + bs_setState(next_state); +} + +void func_802A4F44(void){ + gravity_reset(); + func_8028D5F4(); + func_802A34C8(); +} + +void func_802A4F74(void) { + func_8028A010(ANIM_BANJO_FLY, 0.62f); + func_8029C7F4(1, 1, 3, 7); + func_8029E070(1); + func_802914CC(4); + func_802A3430(); +} + +void func_802A4FC8(void) { + s32 next_state; + + next_state = 0; + if (animctrl_isAt(_player_getAnimCtrlPtr(), 0.1358f) != 0) { + func_8030EBC8(SFX_2_CLAW_SWIPE, 0.6f, 0.7f, 10000, 12000); + } + if (func_80298850() == 0) { + next_state = BS_24_FLY; + } + bs_setState(next_state); +} + +void func_802A503C(void){ + func_802A34C8(); +} + +void func_802A505C(void){ + if(bs_getInterruptType() == 9){ + func_8029A86C(2); + miscflag_set(7); + func_8029CCC4(); + }else{ + func_80296608(); + } +} + +/* BREAK??? */ +extern void func_8028A084(s32, f32); + +/* .code */ +void func_802A50B0(void){ + func_802A3430(); + bsdrone_init(); +} + +void func_802A50D8(void){ + bsdrone_update(); +} + +void func_802A50F8(void){ + bsdrone_end(); + func_802A34C8(); +} + +void func_802A5120(void){ + func_8028A084(0x68, 0.35f); + func_8029C7F4(1,1,3,6); + func_80297970(0.0f); + func_80297A0C(0); + player_setYVelocity(2000.0f); + func_80299CF4(SFX_63_BANJO_UWAAAAOOH, 1.0f, 32000); +} + +void func_802A5190(void){ + player_setYVelocity(2000.0f); + bs_setState(0); +} + +void func_802A51C0(void){} diff --git a/src/core2/bs/bLongLeg.c b/src/core2/bs/bLongLeg.c new file mode 100644 index 00000000..7688aeea --- /dev/null +++ b/src/core2/bs/bLongLeg.c @@ -0,0 +1,505 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .data */ +const f32 D_80364A40 = 80.0f; +const f32 D_80364A44 = 500.0f; +const f32 D_80364A48 = 1.0f; +const f32 D_80364A4C = 0.8f; +const f32 D_80364A50 = 400.0f; +const f32 D_80364A54 = -800.0f; + +/* .bss */ +f32 D_8037D350; +f32 D_8037D354; +f32 D_8037D358; +f32 D_8037D35C; +u8 D_8037D360; +u8 D_8037D361; + +/* .code */ +int func_802A51D0(void){ + if(func_8029D66C()) + return 0; + return player_inWater(); +} + +void func_802A5208(int arg0){ + if(arg0) + func_8030E5F4(SFX_49_KAZOOIE_RA, 0.88f); + else + func_8030E5F4(SFX_49_KAZOOIE_RA, 0.96f); +} + +void func_802A524C(void){ + f32 sp1C = func_8029B30C(); + if(!func_8029B300()) + func_80297970(0.0f); + else + func_80297970(func_80257C48(sp1C, D_80364A40, D_80364A44)); +} + +int bslongleg_inSet(s32 move_indx){ + return (move_indx == BS_26_LONGLEG_IDLE) + || (move_indx == BS_LONGLEG_WALK) + || (move_indx == BS_LONGLEG_JUMP) + || (move_indx == BS_LONGLEG_EXIT) + || (move_indx == BS_LONGLEG_SLIDE) + || (move_indx == BS_LONGLEG_DRONE) + || (move_indx == BS_LONGLEG_UNK62); +} + +void func_802A531C(void){ + func_80299650(func_80291684(2), func_80291670(2)); + if(func_80291700(2, 0.01f)) + func_8030E484(0x3eb); +} + +void func_802A5374(void){ + func_80292078(1, -50.0f); + func_8029B324(0, 0.03f); + func_8029B324(1, 1.0f); + func_8029E070(1); + func_8029E064(1); + func_8029E0F4(1); + pitch_setAngVel(1000.0f, 12.0f); + roll_setAngularVelocity(1000.0f, 12.0f); + miscflag_set(3); +} + +void func_802A5404(void){ + if(bslongleg_inSet(bs_getNextState())) + return; + + func_80292078(1,0); + func_8029B0C0(); + func_8029E070(0); + func_8029E064(0); + func_8029E0F4(0); + func_80292090(1); + pitch_setIdeal(0.0f); + roll_setIdeal(0.0f); + func_802917C4(2); + func_803219F4(1); + miscflag_clear(3); + func_8029E180(4, 0.5f); + func_802A531C(); +} + +void func_802A54A8(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, 0); + animctrl_setIndex(aCtrl, ANIM_BANJO_LONGLEG_ENTER_AS_BIRD); + animctrl_setDuration(aCtrl, 1.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsblongleg.c", 0xe1); + func_802917E4(2, D_8037D35C); + func_803219F4(2); + func_8030E2C4(D_8037D361); + D_8037D360 = 1; +} + +void func_802A5548(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, 0); + animctrl_setIndex(aCtrl, ANIM_BANJO_LONGLEG_ENTER_AS_BEAR); + animctrl_setDuration(aCtrl, 0.5f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsblongleg.c", 0xf6); + D_8037D360 = 0; +} + +void bsblongleg_enter_init(void){ + D_8037D361 = func_8030D90C(); + sfxsource_setSfxId(D_8037D361, SFX_2C_PULLING_NOISE); + func_8030E04C(D_8037D361, 0.8f, 1.9f, 1.2f); + miscflag_clear(MISC_FLAG_E_TOUCHING_WADING_BOOTS); + if(bsbtrot_inSet(bs_getPrevState())) + func_802A54A8(); + else + func_802A5548(); + func_8029C7F4(1,1,3,2); + func_80297970(0.0f); + func_802A5374(); + func_80299BD4(); +} + +void bsblongleg_enter_update(void){ + enum bs_e sp1C = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + func_802A531C(); + func_80299594(1, 0.5f); + switch(D_8037D360){ + case 0: + if(animctrl_isStopped(aCtrl)) + func_802A54A8(); + break; + case 1: + if(animctrl_isStopped(aCtrl)) + sp1C = BS_26_LONGLEG_IDLE; + break; + } + bs_setState(sp1C); +} + +void bsblongleg_enter_end(void){ + func_802A5404(); + func_8030DA44(D_8037D361); +} + +void bsblongleg_stand_enter(void){ + func_8028A010(ANIM_BANJO_LONGLEG_IDLE, 1.0f); + func_8029C7F4(1,1,1,2); + func_80297970(0.0f); + func_80292090(2); + func_802A5374(); +} + +void bsblongleg_stand_update(void){ + enum bs_e next_state = 0; + func_802A531C(); + func_80299594(1, 0.5f); + if(func_80294F78()) + next_state = func_802926C0(); + + if(button_pressed(BUTTON_B)) + func_802917C4(2); + + if(func_8029B300() > 0) + next_state = BS_LONGLEG_WALK; + + if(player_shouldSlideTrot()) + next_state = BS_LONGLEG_SLIDE; + + if(button_pressed(BUTTON_A) && func_8028B2E8()) + next_state = BS_LONGLEG_JUMP; + + if(func_802916CC(2)) + next_state = BS_LONGLEG_EXIT; + + if(func_802A51D0()) + next_state = BS_4C_LANDING_IN_WATER; + + bs_setState(next_state); + +} + +void bsblongleg_stand_end(void){ + func_802A5404(); +} + +void bsblongleg_walk_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_BANJO_LONGLEG_WALK); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_LOOP); + func_802875AC(aCtrl, "bsblongleg.c", 0x1a1); + func_8029C7F4(2,1,1,2); + func_80289EC8(D_80364A40, D_80364A44, D_80364A48, D_80364A4C); +} + +void bsblongleg_walk_update(void){ + enum bs_e sp1C = 0; + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + func_802A531C(); + func_80299594(1, 0.5f); + func_8029AD28(0.47f, 4); + func_8029AD28(0.97f, 3); + if(animctrl_isAt(aCtrl, 0.7781f)) + func_802A5208(0); + + if(animctrl_isAt(aCtrl, 0.2781f)) + func_802A5208(1); + + func_802A524C(); + if(button_pressed(BUTTON_B) && func_80297A64() == 0.0f) + func_802917C4(2); + + if(!func_8029B300() && func_80297C04(1.0f)) + sp1C = BS_26_LONGLEG_IDLE; + + if(player_shouldSlideTrot()) + sp1C = BS_LONGLEG_SLIDE; + + if(button_pressed(BUTTON_A) && func_8028B2E8()) + sp1C = BS_LONGLEG_JUMP; + + if(func_802916CC(2)) + sp1C = BS_LONGLEG_EXIT; + + if(func_802A51D0()) + sp1C = BS_4C_LANDING_IN_WATER; + + bs_setState(sp1C); +} + +void bsblongleg_walk_end(void){ + func_802A5404(); +} + +void func_802A5AB0(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, 0); + animctrl_setDirection(aCtrl, 0); + animctrl_setIndex(aCtrl, ANIM_BANJO_LONGLEG_ENTER_AS_BIRD); + animctrl_setDuration(aCtrl, 1.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsblongleg.c", 0x200); + D_8037D360 = 0; +} + +void func_802A5B34(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, 0); + animctrl_setIndex(aCtrl, ANIM_BANJO_BTROT_EXIT); + animctrl_setDuration(aCtrl, 0.6f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsblongleg.c", 0x210); + D_8037D360 = 1; +} + +void bsblongleg_exit_init(void){ + func_802A5AB0(); + func_80289F10(1); + func_8029957C(2); + func_80297970(0.0f); + D_8037D361 = func_8030D90C(); + sfxsource_setSfxId(D_8037D361, SFX_2C_PULLING_NOISE); + func_8030E04C(D_8037D361, 1.4f, 0.4f, -1.2f); +} + +void bsblongleg_exit_update(void){ + enum bs_e sp1C = 0; + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + func_802A531C(); + func_80299628(1); + switch(D_8037D360){ + case 0://L802A5C7C + if(animctrl_isAt(aCtrl, 0.68f)) + func_8030E2C4(D_8037D361); + + if(animctrl_isStopped(aCtrl)) + func_802A5B34(); + + break; + case 1://L802A5CB4 + if(animctrl_isStopped(aCtrl)) + sp1C = BS_1_IDLE; + break; + } + + if(func_802A51D0()) + sp1C = BS_4C_LANDING_IN_WATER; + + bs_setState(sp1C); + +} + +void bsblongleg_exit_end(void){ + func_8030DA44(D_8037D361); + func_802A5404(); +} + +void bsblongleg_jump_init(void){ + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + D_8037D350 = 0.14f; + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_BANJO_LONGLEG_JUMP); + animctrl_setTransitionDuration(aCtrl, 0.134f); + animctrl_setDuration(aCtrl, 1.0f); + func_8028774C(aCtrl, D_8037D350); + animctrl_setSubRange(aCtrl, 0.0f, 0.42f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsblongleg.c", 0x27F); + func_8029C7F4(1,1,3,6); + if(func_8029B2E8() != 0.0f) + yaw_setIdeal(func_8029B33C()); + func_8029797C(yaw_getIdeal()); + func_802A524C(); + func_802979AC(yaw_getIdeal(), func_80297A64()); + player_setYVelocity(D_80364A50); + gravity_set(D_80364A54); + func_8030E58C(SFX_48_KAZOOIE_RUUH, 0.9f); + D_8037D360 = 0; +} + +void bsblongleg_jump_update(void){ + enum bs_e sp44 = 0; + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + f32 sp34[3]; + f32 sp30; + + func_802A531C(); + func_802A524C(); + _get_velocity(&sp34); + if(button_released(BUTTON_A) && 0.0f < sp34[1]) + gravity_reset(); + + sp30 = player_getYPosition() - func_80294438(); + switch(D_8037D360){ + case 0://L802A5F24 + if((sp34[1] < 100.0f) || sp30 < 10.0f) + animctrl_setDuration(aCtrl, 0.4f); + + if(animctrl_isStopped(aCtrl)){ + animctrl_setSubRange(aCtrl, 0.0f, 0.5282f); + animctrl_setDuration(aCtrl, 4.5f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D360 = 1; + } + break; + case 1://L802A5FA8 + if((0.4 < animctrl_getAnimTimer(aCtrl)) && sp30 < 70.0f){ + D_8037D350 = animctrl_getAnimTimer(aCtrl); + D_8037D354 = sp30; + animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED); + D_8037D360 = 2; + } + break; + case 2://L802A6020 + animctrl_setAnimTimer(aCtrl, ml_map_f(sp30, D_8037D354, 1.0f, D_8037D350, 0.6703f)); + func_80299594(1, 0.5f); + if(func_8028B2E8()){ + func_8029C5E8(); + animctrl_setSubRange(aCtrl, 0.0f, 1.0f); + animctrl_setDuration(aCtrl, 1.3f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D360 = 3; + } + break; + case 3://L802A60AC + func_80299594(1, 0.5f); + if(animctrl_isStopped(aCtrl)) + sp44 = BS_26_LONGLEG_IDLE; + + if(button_pressed(BUTTON_A)) + sp44 = BS_LONGLEG_JUMP; + + if(func_802916CC(2)) + sp44 = BS_LONGLEG_EXIT; + + break; + }//L802A60F0 + + + if(func_802A51D0()) + sp44 = BS_4C_LANDING_IN_WATER; + + bs_setState(sp44); +} + +void bsblongleg_jump_end(void){ + gravity_reset(); + func_802A5404(); +} + +void bsblongleg_slide_init(void){ + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_BANJO_LONGLEG_JUMP); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED); + func_8028774C(aCtrl, 0.0865f); + func_802875AC(aCtrl, "bsblongleg.c", 0x339); + func_8029C7F4(1,1,3,3); + func_8029797C(yaw_getIdeal()); + func_802979AC(yaw_getIdeal(), func_80297A64()); + func_8029E070(1); + func_8029E064(1); + pitch_setAngVel(1000.0f, 12.0f); + roll_setAngularVelocity(1000.0f, 12.0f); + func_80297970(0.0f); + func_80299AAC(); + D_8037D358 = 1.0f; +} + +void bsblongleg_slide_update(void){ + enum bs_e sp3C = 0; + f32 sp30[3]; + f32 sp2C; + + func_802A531C(); + func_80299AAC(); + D_8037D358 = max_f(D_8037D358 - time_getDelta(), 0.0f); + + if(player_isSliding()){ + func_80294480(sp30); + func_8025801C(sp30, &sp2C); + func_80299594(1, 0.5f); + func_80297970(ml_map_f(pitch_getIdeal(), 20.0f, 60.0f, 550.0f, 700.0f)); + func_8029797C(sp2C); + func_8029C22C(); + }else{//L802A6304 + sp3C = BS_26_LONGLEG_IDLE; + } + + if(D_8037D358 == 0.0f && button_pressed(BUTTON_A)) + sp3C = BS_LONGLEG_JUMP; + + if(func_802A51D0()) + sp3C = BS_4C_LANDING_IN_WATER; + + bs_setState(sp3C); +} + +void bsblongleg_slide_end(void){ + func_802A5404(); +} + +void func_802A6388(f32 arg0){ + D_8037D35C = arg0; +} + +void func_802A6394(void){ + func_8028A010(ANIM_BANJO_LONGLEG_IDLE, 1.0f); + func_8029C7F4(1,1,3,2); + func_80297970(0.0f); + func_802A5374(); + func_80292090(2); + func_8029C674(); +} + +void func_802A63F0(void){ + enum bs_e sp1C = 0; + func_802A531C(); + func_8029C6D0(); + func_80299628(1); + + if(func_80298850() == 0) + sp1C = BS_26_LONGLEG_IDLE; + + if(func_802A51D0()) + sp1C = BS_4C_LANDING_IN_WATER; + + bs_setState(sp1C); +} + +void func_802A6450(void){ + func_8029C748(); + func_802A5404(); +} + +void bsblongleg_drone_init(void){ + func_802A5374(); + bsdrone_init(); +} + +void bsblongleg_drone_update(void){ + func_802A531C(); + bsdrone_update(); + if(func_802916CC(2)) + bs_setState(BS_LONGLEG_EXIT); +} + +void bsblongleg_drone_end(void){ + bsdrone_end(); + func_802A5404(); +} + diff --git a/src/core2/bs/bPeck.c b/src/core2/bs/bPeck.c new file mode 100644 index 00000000..da78adb0 --- /dev/null +++ b/src/core2/bs/bPeck.c @@ -0,0 +1,137 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80292048(s32, f32, f32, f32); +void func_802875AC(AnimCtrl *, char *, s32); + +/* .data */ +f32 D_80364A60 = -1400.0f; +f32 D_80364A64 = 120.0f; + +/* .bss */ +f32 D_8037D370; +u8 D_8037D374; +u8 D_8037D375; +u8 D_8037D376; +u8 D_8037D377; + +/* .code */ +s32 func_802A6510(void){ + return D_8037D376; +} + +void bsbpeck_init(void){ + D_8037D377 = 0; + switch(bs_getPrevState()){ + case BS_8_BTROT_JUMP://L802A656C + D_8037D377++; + break; + case BS_5_JUMP: + case BS_2F_FALL: + case BS_3D_FALL_TUMBLING: + case BS_57_BOMB_END: + break; + } + if(func_80293234() == 1) + func_80293240(2); + + func_8028A274(0x1a, 0.2f); + func_8029C7F4(1,3,1,6); + func_80299234(1200.0f, 10.0f); + func_8029E070(1); + gravity_set(D_80364A60); + player_setYVelocity(D_80364A64); + func_80292048(1, -38.0f, 0.0f, 105.0f); + func_80292048(0, -38.0f, 0.0f, -7.0f); + func_8028D638(0x23, 0x2A); + D_8037D375 = 0; + D_8037D374 = 0; + D_8037D376 = 1; +} + +void func_802A664C(void){ + f32 sp1C = 1.0f; + switch(D_8037D375){ + case 0: + sp1C = 1.13f; + break; + case 1: + sp1C = 1.1f; + break; + case 2: + sp1C = 1.32f; + break; + } + miscflag_set(5); + func_8030E58C(SFX_42_KAZOOIE_RAH, sp1C); + player_setYVelocity(D_80364A64); + D_8037D375++; +} + +void bsbpeck_update(void){ + enum bs_e sp24 = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + func_802B6FA8(); + if(D_8037D377){ + func_80297970(func_80297A64() * 0.1); + } + + switch(D_8037D374){ + case 0://L802A6770 + if(animctrl_isAt(aCtrl, 0.9126f)){ + animctrl_setIndex(aCtrl, ANIM_BANJO_BPECK_ENTER); + func_8028774C(aCtrl, 0.0f); + animctrl_setDuration(aCtrl, 0.35f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_LOOP); + func_802875AC(aCtrl, "bsbpeck.c", 0xbd); + D_8037D370 = 0.5f; + D_8037D374 = 1; + } + break; + case 1://L802A67E8 + if(animctrl_isAt(aCtrl, 0.1621f)) + func_802A664C(); + + if(animctrl_isAt(aCtrl, 0.7f)) + func_802A664C(); + + D_8037D370 -= time_getDelta(); + if(D_8037D370 < 0.0f){ + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, 0); + animctrl_setIndex(aCtrl, ANIM_BANJO_BPECK); + animctrl_setDirection(aCtrl, 0); + animctrl_setDuration(aCtrl, 0.2f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsbpeck.c", 0xd4); + D_8037D374 = 2; + } + break; + case 2://L802A68C4 + if(animctrl_isStopped(aCtrl)) + sp24 = BS_2F_FALL; + break; + }//L802A68D8 + + if(func_8028B2E8()){ + func_8029C5E8(); + sp24 = BS_1_IDLE; + } + + if(player_inWater()) + sp24 = BS_4C_LANDING_IN_WATER; + + bs_setState(sp24); +} + +void bsbpeck_end(void){ + D_8037D376 = 0; + ability_use(0xa); + func_80292048(1, 0.0f, 0.0f, 0.0f); + func_80292048(0, 0.0f, 0.0f, 0.0f); + func_8028D638(0, 0); + func_8029E070(0); + gravity_reset(); +} diff --git a/src/core2/bs/bShock.c b/src/core2/bs/bShock.c new file mode 100644 index 00000000..6c5f1252 --- /dev/null +++ b/src/core2/bs/bShock.c @@ -0,0 +1,195 @@ +#include +#include "functions.h" +#include "variables.h"s + +/* .data */ +const f32 D_80364A70 = 1250.0f; +const f32 D_80364A74 = -1200.f; + +/* .bss */ +u8 D_8037D380; +u8 D_8037D381; +u8 D_8037D382; + +/* .code */ +void bsbshock_charge_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_BANJO_BSHOCK_CHARGE); + animctrl_setTransitionDuration(aCtrl, 0.4f); + animctrl_setDuration(aCtrl, 4.2f); + animctrl_setSubRange(aCtrl, 0.0f, 0.1061f); + animctrl_setPlaybackType(aCtrl,1); + func_802875AC(aCtrl, "bsbshock.c", 0x61); + func_8029C7F4(1,1,3,6); + + if(func_8029B2E8() != 0.0f) + yaw_setIdeal(func_8029B33C()); + + func_8029797C(yaw_getIdeal()); + func_802B6FA8(); + func_802979AC(yaw_getIdeal(), func_80297A64()); + func_8029E064(1); + func_8029E070(1); + func_80299BD4(); + D_8037D382 = func_8030D90C(); + sfxsource_setSfxId(D_8037D382, SFX_2C_PULLING_NOISE); + func_8030E04C(D_8037D382, 1.4f, 0.4f, -1.2f); + func_80292158(-50.0f); + func_80298528(-50.0f); + D_8037D380 = 1; + D_8037D381 = 0; +} + +void bsbshock_charge_update(void){ + enum bs_e sp2C = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp1C[3]; + + if(func_8028B2E8()){ + if(func_8023DB5C() % 2) + func_8029C348(); + } + else + {//L802A6B94 + func_8029C348(); + } + func_802B6FA8(); + _get_velocity(&sp1C); + if(button_released(BUTTON_A) && 0.0f < sp1C[1]){ + gravity_reset(); + } + + switch(D_8037D381){ + case 0: + if(func_8028B424()) + sp2C = BS_3D_FALL_TUMBLING; + + if(func_8028B254(0x82)){ + animctrl_setSubRange(aCtrl, 0.0f, 1.0f); + animctrl_setDuration(aCtrl, 2.8f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D381 = 1; + } + break; + case 1: + if(animctrl_isAt(aCtrl, 0.11f)) + func_8030E2C4(D_8037D382); + + if(animctrl_isAt(aCtrl, 0.4036f)) + animctrl_setDuration(aCtrl, 1.4f); + + if(animctrl_isStopped(aCtrl)) + sp2C = BS_1_IDLE; + break; + }//L802A6CAC + + if(func_8028B254(0x3C)){ + if(animctrl_getAnimTimer(aCtrl) < 0.3637 && button_released(8)){ + D_8037D380 = 0; + }//L802A6CF4 + if(func_8028B2E8()) + func_80297970(0.0f); + } + else{//L802A6D18 + if(should_flap()) + sp2C = BS_BFLAP; + + if(should_beak_bust()) + sp2C = BS_F_BBUSTER; + }//L802A6D44 + if(animctrl_isAt( aCtrl, 0.3637f) && D_8037D380) + sp2C = BS_BSHOCK_JUMP; + + if(animctrl_isAt(aCtrl, 0.5551f)){ + player_setYVelocity(180.0f); + func_80292158(0.0f); + func_80298528(50.0f); + } + + if(sp1C[1] < 0.0f && player_inWater()) + sp2C = BS_4C_LANDING_IN_WATER; + bs_setState(sp2C); +} + +void bsbshock_charge_end(void){ + func_8030DA44(D_8037D382); + func_8029E064(0); + func_8029E070(0); + if(func_80292230() != 0.0f){ + func_80292158(0.0f); + func_80298528(50.0f); + } +} + +void bsbshock_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, 0); + animctrl_setIndex(aCtrl, ANIM_BANJO_BSHOCK_JUMP); + animctrl_setDuration(aCtrl, 0.8f); + func_8028774C(aCtrl, 0.5304f); + animctrl_setSubRange(aCtrl, 0.0f, 1.0f); + animctrl_setPlaybackType(aCtrl,1); + func_802875AC(aCtrl, "bsbshock.c", 0x13a); + func_8029C7F4(1,1,3,6); + + if(func_8029B2E8() != 0.0f) + yaw_setIdeal(func_8029B33C()); + + func_8029797C(yaw_getIdeal()); + func_802B6FA8(); + func_802979AC(yaw_getIdeal(), func_80297A64()); + player_setYVelocity(D_80364A70); + gravity_set(D_80364A74); + func_8030E484(SFX_E_SHOCKSPRING_BOING); + func_8029E064(1); + func_8029E070(1); + ability_use(9); + func_80292158(-50.0f); + func_80298528(-50.0f); + D_8037D381 = 0; +} + +void bsbshock_update(void){ + enum bs_e sp2C = 0; + f32 sp20[3]; + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + + func_802B6FA8(); + _get_velocity(&sp20); + if(animctrl_isAt(aCtrl, 0.7f)) + func_8030E484(SFX_53_BANJO_HUIII); + + if(button_released(BUTTON_A) && 0.0f < sp20[1]) + gravity_reset(); + + if(D_8037D381 == 0){ + func_8029C348(); + if(sp20[1] < 0.0f) + sp2C = BS_2F_FALL; + } + + if(!func_8028B2E8()){ + if(func_8028B424()) + sp2C = BS_3D_FALL_TUMBLING; + + if(should_flap()) + sp2C = BS_BFLAP; + + if(should_beak_bust()) + sp2C =BS_F_BBUSTER; + } + + bs_setState(sp2C); +} + +void bsbshock_end(void){ + if(bs_getNextState() != BS_11_BPECK) + gravity_reset(); + + func_8029E064(0); + func_8029E070(0); + func_80292158(0.0f); + func_80298528(50.0f); +} diff --git a/src/core2/bs/bSwim.c b/src/core2/bs/bSwim.c new file mode 100644 index 00000000..44adf4f1 --- /dev/null +++ b/src/core2/bs/bSwim.c @@ -0,0 +1,586 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802921BC(f32); +extern f32 func_8029494C(void); +extern f32 func_8029B2D0(void); +extern bool func_8029E284(s32, f32); +extern bool func_8029E314(s32, f32); + +/* .bss */ +f32 D_8037D390; +u8 D_8037D394; +u8 D_8037D395; +u8 D_8037D396; +f32 D_8037D398; + +void func_802A7140() { + func_8029C7F4(1, 3, 3, 9); +} + +f32 func_802A716C() { + f32 sp24[3]; + _get_velocity(&sp24); + ml_map_f(gu_sqrtf((sp24[0] * sp24[0]) + (sp24[1] * sp24[1]) + (sp24[2] * sp24[2])), 50.0f, 200.0f, 0.0f, 1.0f); +} + +void func_802A71D8(void) { + f32 yaw_range; + f32 sp38; + f32 roll_range; + f32 sp30; + + sp30 = func_8029B2D0(); + sp38 = func_802A716C(); + if (button_held(BUTTON_R)) { + roll_range = 45.0f; + yaw_range = 4.3f; + func_80299234(250.0f, 20.0f); + } else { + roll_range = 35.0f; + yaw_range = func_80257C48(sp38, 3.1f, 2.4f); + func_80299234(90.0f, func_80257C48(sp38, 3.8f, 2.2f)); + } + roll_setIdeal(ml_map_f(sp30, -1.0f, 1.0f, -roll_range, roll_range)); + yaw_setIdeal(mlNormalizeAngle(yaw_getIdeal() + ml_map_f(sp30, -1.0f, 1.0f, yaw_range, -yaw_range))); +} + +void func_802A7304() { + f32 temp_f0; + + pitch_setAngVel(func_80257C48(func_802A716C(), 70.0f, 30.0f), 0.9f); + temp_f0 = func_8029B2DC(); + if (temp_f0 < 0.0f) { + pitch_setIdeal(ml_map_f(temp_f0, -1.0f, 0.0f, 275.0f, 360.0f)); + return; + } + pitch_setIdeal(ml_map_f(temp_f0, 0.0f, 1.0f, 0.0f, 85.0f)); +} + +bool func_802A73BC(void) { + f32 sp1C; + + sp1C = (map_get() == MAP_46_CCW_WINTER) ? 90.0f : 130.0f; + return func_80294574() && player_getYPosition() > (func_80294500() - sp1C); +} + +void func_802A744C(void) { + if (func_8028B148() && bs_getState() != BS_4C_LANDING_IN_WATER) { + func_8035644C(0xAC); + } + roll_setAngularVelocity(30.0f, 0.9f); + gravity_set(0.0f); + func_80297BF8(-399.99f); + func_8029B324(0, 0.03f); + func_8029B324(1, 1.0f); + func_8029E070(1); + func_80294378(3); + func_802921BC(60.0f); + func_80297B64(2.0f); +} + + +bool bsbswim_inSet(enum bs_e move_id){ + return move_id == BS_2B_DIVE_IDLE + || move_id == BS_2C_DIVE_B + || move_id == BS_39_DIVE_A + || move_id == BS_30_DIVE_ENTER + || move_id == BS_78 + || move_id == BS_7F_DIVE_OW + || move_id == BS_54_SWIM_DIE + || move_id == BS_97_DIVE_LOCKED + ; +} + +bool func_802A7588(void){ + return bsbswim_inSet(bs_getState()); +} + +void func_802A75B0(void) { + if (!bsbswim_inSet(bs_getNextState())) { + pitch_setIdeal(0.0f); + roll_setIdeal(0.0f); + func_80297B94(); + gravity_reset(); + func_8029B0C0(); + func_8029E070(0); + func_80294378(1); + func_802921BC(0.0f); + } +} + +void func_802A762C() { + func_8028A010(0x70, 2.0f); + func_802A7140(); + func_80297930(0); + func_802A744C(); + func_80297B64(0.4f); +} + +void func_802A7674() { + s32 state_id = 0; + + func_802A71D8(); + func_802A7304(); + + if (func_80294F78()) { + state_id = func_802926C0(); + } + if (button_held(BUTTON_A)) { + state_id = BS_39_DIVE_A; + } + if (button_held(BUTTON_B)) { + state_id = BS_2C_DIVE_B; + } + if (func_802A73BC()) { + state_id = BS_2D_SWIM_IDLE; + } + if (!player_inWater()) { + state_id = BS_1_IDLE; + } + + bs_setState(state_id); +} + +void func_802A7718() { + func_802A75B0(); +} + +void func_802A7738(void) { + AnimCtrl* temp_s0; + AnimCtrl* temp_v0; + + temp_v0 = _player_getAnimCtrlPtr(); + temp_s0 = temp_v0; + animctrl_reset(temp_v0); + animctrl_setIndex(temp_s0, 0x3F); + func_8028774C(temp_s0, 0.4626f); + animctrl_setDuration(temp_s0, 1.0f); + func_802875AC(temp_s0, "bsbswim.c", 0x186); + func_802A7140(); + func_802A744C(); + D_8037D390 = 0.0f; + func_80297B64(1.0f); + func_802906A4(2); +} + +void func_802A77D8(void) { + f32 sp34; + f32 sp30; + f32 sp24[3]; + + sp34 = pitch_get(); + sp30 = yaw_get(); + func_80256E24(sp24, sp34, sp30, 0.0f, 0.0f, D_8037D390); + func_80297930(sp24); + func_80297A0C(sp24); +} + +void func_802A7838(void) { + s32 next_state; + AnimCtrl *anim_ctrl; + f64 temp_f2; + + next_state = 0; + anim_ctrl = _player_getAnimCtrlPtr(); + func_802A71D8(); + func_802A7304(); + if (D_8037D390 > 0.0f) { + func_802A77D8(); + D_8037D390 = max_f(D_8037D390 - 10.0f, 0.0f); + } + if (animctrl_isAt(anim_ctrl, 0.1f)) { + func_8030EB88(SFX_0_BLOOP, 1.2f, 1.4f); + D_8037D390 = 600.0f; + } + if (animctrl_isAt(anim_ctrl, 0.4626f)) { + animctrl_setDuration(anim_ctrl, 1.0f); + } + if (animctrl_isAt(anim_ctrl, 0.2766f)) { + animctrl_setDuration(anim_ctrl, 3.0f); + } + if (!button_held(BUTTON_B)) { + if (button_held(BUTTON_A)) { + temp_f2 = (f64) animctrl_getAnimTimer(anim_ctrl); + if (temp_f2 <= 0.4625 && 0.1 < temp_f2) { + next_state = BS_39_DIVE_A; + } + } else if (animctrl_isAt(anim_ctrl, 0.4625f)) { + next_state = BS_2B_DIVE_IDLE; + } + } + if (animctrl_isAt(anim_ctrl, 0.4625f) && !button_held(BUTTON_B)) { + if (button_held(BUTTON_A)) { + next_state = BS_39_DIVE_A; + } else { + next_state = BS_2B_DIVE_IDLE; + } + } + if (func_802A73BC()) { + next_state = BS_2D_SWIM_IDLE; + } + if (player_inWater() == 0) { + next_state = BS_1_IDLE; + } + bs_setState(next_state); +} + +void func_802A7A2C() { + func_802906A4(1); + func_802A75B0(); +} + +void func_802A7A54() { + func_8028A010(0x71, 0.75f); + func_802A7140(); + func_802A744C(); + D_8037D390 = 120.0f; + func_80297B64(2.0f); + func_802906A4(2); +} + +void func_802A7AB0(void) { + s32 next_state; + AnimCtrl *anim_ctl; + + next_state = 0; + anim_ctl = _player_getAnimCtrlPtr(); + func_802A71D8(); + func_802A7304(); + func_802A77D8(); + if (animctrl_isAt(anim_ctl, 0.17f)) { + func_8030E760(SFX_0_BLOOP, 1.9f, 10000); + } + if (animctrl_isAt(anim_ctl, 0.67f)) { + func_8030E760(SFX_0_BLOOP, 1.7f, 10000); + } + if (animctrl_isAt(anim_ctl, 0.99f)) { + if (!button_held(BUTTON_A)) { + next_state = BS_2B_DIVE_IDLE; + } + if (button_held(BUTTON_B)) { + next_state = BS_2C_DIVE_B; + } + } + if (func_802A73BC()) { + next_state = BS_2D_SWIM_IDLE; + } + if (!player_inWater()) { + next_state = BS_1_IDLE; + } + bs_setState(next_state); +} + +void func_802A7BA8(void) { + func_802906A4(1); + func_802A75B0(); +} + +void func_802A7BD0(void) { + f32 sp3C; + f32 sp30[3]; + f32 sp24[3]; + + func_80298760(func_80296560()); + func_8028A274(0x1A0, 1.4f); + func_80299BFC(1.0f); + _player_getPosition(sp30); + func_80294980(&sp24); + func_80257F18(sp24, sp30, &sp3C); + yaw_setIdeal(mlNormalizeAngle(sp3C)); + yaw_applyIdeal(); + func_80297970(func_802987D4()); + func_8029797C(sp3C); + func_802979AC(sp3C, func_80297A64()); + func_8029C7F4(1, 1, 2, 3); + func_8028D5DC(); + func_80292E48(); + func_802A744C(); +} + +void func_802A7CA8(void) { + s32 next_state; + f32 plyr_pos[3]; + ParticleEmitter *p_ctrl; + + next_state = 0; + _player_getPosition(plyr_pos); + plyr_pos[1] += 60.0f; + p_ctrl = func_8029B950(plyr_pos, 25.0f); + particleEmitter_setParticleVelocityRange(p_ctrl, -60.0f, -50.0f, -60.0f, 60.0f, 100.0f, 60.0f); + particleEmitter_emitN(p_ctrl, 1); + if (baanim_isAt(0.3f)) { + func_80292EA4(); + } + if (animctrl_isStopped(_player_getAnimCtrlPtr())) { + next_state = BS_2B_DIVE_IDLE; + } + bs_setState(next_state); +} + + +void func_802A7D74(void) { + func_80297CA8(); + func_8028D5F4(); + func_80292EA4(); + func_802A75B0(); +} + +void func_802A7DAC(void) { + ability_use(ABILITY_3_CAMERA_CONTROL); + func_8028A180(0x3C, 1.0f); + func_802A7140(); + func_80299234(500.0f, 5.0f); + func_80297930(0); + func_802A744C(); + pitch_setAngVel(200.0f, 2.5f); + func_80299BD4(); + D_8037D396 = 0; +} + + +void func_802A7E2C(void) { + s32 next_state; + AnimCtrl *sp38; + f32 sp34; + f32 sp30; + f32 sp24[3]; + + next_state = 0; + sp38 = _player_getAnimCtrlPtr(); + switch (D_8037D396) { + case 0: + pitch_setIdeal(50.0f); + if (animctrl_isAt(sp38, 0.7247f)) { + sp34 = pitch_get(); + sp30 = yaw_get(); + func_80256E24(sp24, sp34, sp30, 0.0f, 0.0f, 800.0f); + func_80297A0C(sp24); + func_8029E3C0(1, 0.8f); + D_8037D396 = TRUE; + } + break; + case 1: + if (func_8029E1A8(1)) { + next_state = BS_2B_DIVE_IDLE; + } + break; + } + if (animctrl_isAt(sp38, 0.6f)) { + func_8030E4E4(SFX_0_BLOOP); + } + if (!player_inWater()) { + next_state = BS_1_IDLE; + } + bs_setState(next_state); +} + +void func_802A7F4C(void){ + func_802A75B0(); +} + +void func_802A7F6C(void) { + D_8037D394 = (bs_getPrevState() == BS_41_DIE) ? TRUE : FALSE; + + if (D_8037D394 || level_get() == LEVEL_9_RUSTY_BUCKET_BAY || map_get() == MAP_46_CCW_WINTER) { + D_8037D395 = 0; + } else { + D_8037D395 = 1; + } + + func_8029B930(); + func_8028A010(0xB9, 0.7f); + func_802A7140(); + func_802A744C(); + func_80297B64(1.0f); + func_80297930(0); + func_80297A0C(0); + pitch_setIdeal(275.0f); + roll_setIdeal(0.0f); + D_8037D396 = 0; + func_8028D5DC(); + func_8029E3C0(0, 0.0f); + func_8029E3C0(1, 0.0f); + func_802906A4(3); + func_80299CF4(SFX_CA_BANJO_DROWNING_1, 1.0f, 24000); +} + +void func_802A8098(void) { + s32 next_state; + f32 sp40[3]; + ParticleEmitter *p_ctrl; + f32 plyr_pos[3]; + + next_state = 0; + func_80256E24(sp40, -90.0f, 0.0f, 0.0f, 0.0f, 100.0f); + func_80297930(sp40); + func_80297A0C(sp40); + func_8029E22C(1); + if( func_8029E284(1, 0.2f) + || func_8029E284(1, 0.8f) + || func_8029E284(1, 1.4f) + ) { + func_80299CF4(SFX_CB_BANJO_DROWNING_2, 1.0f, 24000); + } + switch (D_8037D396) { + case 0: + if (func_8023DB4C(1) == 0) { + _player_getPosition(plyr_pos); + plyr_pos[1] += 60.0f; + p_ctrl = func_8029B950(plyr_pos, 25.0f); + particleEmitter_setParticleVelocityRange(p_ctrl, -60.0f, -50.0f, -60.0f, 60.0f, 100.0f, 60.0f); + particleEmitter_emitN(p_ctrl, 1); + } + if (func_8029E270(1) < 1.8 && func_802A73BC() && D_8037D395) { + next_state = BS_2D_SWIM_IDLE; + } + if (func_8029E314(1, 1.55f)) { + player_setYVelocity(-50.0f); + } + if (func_8029E284(1, 1.9f)) { + func_802914CC(0xD); + func_802BF2C0(80.0f); + if (D_8037D394) { + func_8029E3C0(0, 0.5f); + } else { + func_8029C984(); + func_8029E3C0(0, 2.75f); + } + } + break; + case 1: + break; + } + if (func_8029E1A8(0)) { + func_8029B890(); + } + bs_setState(next_state); +} + +void func_802A82D4(void) { + func_802906A4(1); + func_80291548(); + func_8024BD08(0); + func_8028D5F4(); + if (bs_getNextState() != BS_5A_LOADZONE) { + func_80346CE8(); + } + func_802A75B0(); +} + +void func_802A8330(void) { + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + + if (func_80298850() && func_80298800(sp2C)) { + _player_getPosition(sp44); + func_8025727C(sp44[0], sp44[1], sp44[2], sp2C[0], sp2C[1], sp2C[2], &sp38[0], &sp38[1]); + pitch_setIdeal(sp38[0]); + yaw_setIdeal(sp38[1]); + roll_setIdeal(0.0f); + } +} + +void func_802A83C0(void) { + func_8028A010(0x70, 2.0f); + func_802A7140(); + func_80297930(0); + func_80297B64(0.4f); + func_802A744C(); + func_802A8330(); +} + +void func_802A8410(void) { + s32 next_state; + + next_state = 0; + if (func_80298850() == 0) { + next_state = BS_2B_DIVE_IDLE; + } + func_802A8330(); + bs_setState(next_state); +} + + +void func_802A844C(void){ + func_802A75B0(); +} + +void func_802A846C(void) { + AnimCtrl *temp_s0; + f32 sp28; + + temp_s0 = _player_getAnimCtrlPtr(); + func_8029CCC4(); + sp28 = func_8029494C(); + if (bs_getPrevState() == 0xF) { + sp28 = max_f(sp28, 600.0f); + } + if (sp28 > 80.0f) { + animctrl_reset(temp_s0); + animctrl_setIndex(temp_s0, ANIM_BANJO_ROLL); + animctrl_setPlaybackType(temp_s0, ANIMCTRL_STOPPED); + animctrl_setDuration(temp_s0, 1.2f); + func_8028774C(temp_s0, 0.8204f); + func_802875AC(temp_s0, "bsbswim.c", 0x417); + } else { + animctrl_reset(temp_s0); + animctrl_setIndex(temp_s0, 0x57); + animctrl_setPlaybackType(temp_s0, ANIMCTRL_LOOP); + animctrl_setDuration(temp_s0, 1.2f); + func_8028774C(temp_s0, 0.6412f); + func_802875AC(temp_s0, "bsbswim.c", 0x41E); + } + D_8037D398 = ml_map_f(sp28, 40.0f, 1000.0f, -300.0f, -1200.0f); + player_setYVelocity(D_8037D398); + func_8029C7F4(1, 3, 3, 9); + func_802A744C(); + func_802978DC(6); +} + +void func_802A85EC(void) { + s32 next_state; + f32 sp38[3]; + ParticleEmitter *sp34; + + next_state = 0; + _player_getPosition(sp38); + sp38[1] += 60.0f; + sp34 = func_8029B950(sp38, 20.0f); + particleEmitter_setParticleVelocityRange(sp34, -30.0f, -30.0f, -30.0f, 30.0f, 30.0f, 30.0f); + particleEmitter_emitN(sp34, 1); + if (D_8037D398 < 0.0f) { + D_8037D398 += max_f(mlAbsF(D_8037D398) * 0.1, 50.0f); + player_setYVelocity(D_8037D398); + } + if (func_8028B2E8()) { + next_state = BS_2D_SWIM_IDLE; + } + if (!player_inWater()) { + next_state = BS_1_IDLE; + } + if (func_80297AAC() >= 0.0f) { + next_state = BS_2D_SWIM_IDLE; + } + bs_setState(next_state); +} + +void func_802A872C(void){ + func_802A75B0(); +} + +void func_802A874C(void){ + func_802A744C(); + bsdrone_init(); +} + +void func_802A8774(void){ + bsdrone_update(); +} + +void func_802A8794(void){ + bsdrone_end(); + func_802A75B0(); +} diff --git a/src/core2/bs/bTrot.c b/src/core2/bs/bTrot.c new file mode 100644 index 00000000..f845d178 --- /dev/null +++ b/src/core2/bs/bTrot.c @@ -0,0 +1,769 @@ +#include +#include "functions.h" +#include "variables.h" + + +/* .data */ +f32 D_80364A90 = 30.0f; +f32 D_80364A94 = 700.0f; +f32 D_80364A98 = 80.0f; +f32 D_80364A9C = 1000.0f; +f32 D_80364AA0 = 300.0f; +f32 D_80364AA4 = 0.56f; +f32 D_80364AA8 = 0.34f; +f32 D_80364AAC = 0.51f; +f32 D_80364AB0 = 0.29f; +f32 D_80364AB4 = 0.8f; +f32 D_80364AB8 = 0.7f; +f32 D_80364ABC = 693.5f; +f32 D_80364AC0 = -1200.0f; + +/* .bss */ +f32 D_8037D3A0; +u8 D_8037D3A4; + +void func_802A87C0(void){ + if(func_80291698(3)) + func_8029C3E8(10.0f, 50.0f); + else + func_8029C22C(); +} + +void func_802A880C(s32 arg0){ + if(arg0) + func_8030E58C(SFX_49_KAZOOIE_RA, 0.96f); + else + func_8030E58C(SFX_49_KAZOOIE_RA, 1.04f); +} + +void func_802A8850(void){ + if( button_pressed(BUTTON_B) + && func_80291698(3) + && func_80297A64() == 0.0f + ){ + func_802917C4(3); + } + +} + +f32 func_802A88B0(void){ + if(func_8028B128()) + return D_80364AA0; + + if(func_80291698(3)) + return D_80364A9C; + + return D_80364A94; +} + +f32 func_802A8900(void){ + + if(func_80291698(3)) + return D_80364A98; + + return D_80364A90; +} + +f32 func_802A8934(void){ + if(func_8028B128()) + return D_80364AB8; + + if(func_80291698(3)) + return D_80364AB0; + + return D_80364AA8; +} + +f32 func_802A8984(void){ + if(func_8028B128()) + return D_80364AB4; + + if(func_80291698(3)) + return D_80364AAC; + + return D_80364AA4; +} + +void func_802A89D4(void){ + f32 sp24 = func_8029B30C(); + if(!func_8029B300()){ + func_80297970(0.0f); + } + else{ + func_80297970(func_80257C48(sp24, func_802A8900(), func_802A88B0())); + } + +} + +void func_802A8A40(void){ + func_8029B324(0, 0.03f); + func_8029B324(1, 1.0f); + func_8029E070(1); + func_8029E064(1); + pitch_setAngVel(1000.0f, 12.0f); + roll_setAngularVelocity(1000.0f, 12.0f); + miscflag_set(3); + func_8029CF48(4,1,0.24f); + func_80292090(2); +} + +void func_802A8AD8(void){ + func_80299650(func_80291684(3), func_80291670(3)); + if(miscflag_isTrue(MISC_FLAG_10_TOUCHING_TURBO_TRAINERS) &&(bs_getState() != BS_17_BTROT_EXIT)){ + miscflag_clear(MISC_FLAG_10_TOUCHING_TURBO_TRAINERS); + func_802917E4(3, func_80294A40()); + func_803219F4(4); + } + + if(func_802916CC(3)){ + if(func_8029DFE0()){ + func_8029E0DC(0); + if(miscflag_isFalse(0x14)) + func_8030E484(0x3eb); + func_803219F4(1); + } + }else{ + func_8029E0DC(1); + } +} + +void func_802A8BB0(void){ + enum bs_e next_state = bs_getNextState(); + + if(bsbtrot_inSet(next_state)) + return; + + func_80292090(1); + func_8029B0C0(); + func_8029E070(0); + func_8029E064(0); + pitch_setIdeal(0.0f); + roll_setIdeal(0.0f); + miscflag_clear(3); + if(next_state != BS_5A_LOADZONE) + func_802917E4(3, 0.0f); + func_802A8AD8(); + func_80289F10(1); + func_8029CF48(4, 0, 0.0f); + + +} + +int func_802A8C60(void){ + if(func_80291698(3)) + return 0; + + return button_released(BUTTON_Z); +} + +void _bsbtrot_802A8C98(AnimCtrl *aCtrl, enum asset_e arg1){ + if(animctrl_getIndex(aCtrl) != arg1){ + animctrl_setIndex(aCtrl, arg1); + func_8028774C(aCtrl, animctrl_getAnimTimer(aCtrl)); + func_802875AC(aCtrl, "bsbtrot.c", 0x12e); + + } +} + +enum asset_e func_802A8D00(enum asset_e arg0, enum asset_e arg1){ + if(func_802916CC(3)) + return arg0; + else + return arg1; +} + +enum bs_e func_802A8D34(enum bs_e arg0){ + if(miscflag_isTrue(0xf)) + return arg0; + + if(miscflag_isTrue(MISC_FLAG_1_ON_FLIGHT_PAD)) + return BS_23_FLY_ENTER; + + return BS_8_BTROT_JUMP; +} + +enum bs_e func_802A8D84(enum bs_e arg0){ + if( func_8029B300(arg0) > 0) + arg0 = BS_16_BTROT_WALK; + + if(func_80294F78()) + arg0 = func_802926C0(); + + if(func_8028B094()) + arg0 = BS_71_BTROT_FALL; + + if(func_802A8C60()) + arg0 = BS_17_BTROT_EXIT; + + if(button_pressed(BUTTON_A)) + arg0 = func_802A8D34(arg0); + + if(player_shouldSlideTrot()) + arg0 = BS_45_BTROT_SLIDE; + + if(player_inWater()) + arg0 = BS_2D_SWIM_IDLE; + + return arg0; +} + +void bsbtrot_enter_init(void){ + func_802A8AD8(); + func_8028A274(0x16, 1.0f); + func_8029C7F4(1,1,2,2); + func_80297970(0.0f); + func_802A8A40(); + func_80299BD4(); + func_802952A8(0,0); +} + +void bsbtrot_enter_update(void){ + enum bs_e next_state = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + func_802952A8(0,1); + func_80299628(1); + if(animctrl_isStopped(aCtrl)) + next_state = BS_15_BTROT_IDLE; + + if(0.5 < animctrl_getAnimTimer(aCtrl)) + next_state = func_802A8D84(next_state); + + bs_setState(next_state); + +} + +void bsbtrot_enter_end(void){ + func_802952A8(0,1); + func_802A8BB0(); +} + +void bsbtrot_stand_init(void){ + func_8028A010(ANIM_BANJO_BTROT_IDLE, 1.2f); + func_8029C7F4(1,1,1,2); + func_80297970(0.0f); + func_802A8A40(); +} + +void bsbtrot_stand_update(void){ + enum bs_e next_state = 0;; + func_802A8850(); + func_802A8AD8(); + if(func_80291698(3)) + func_802A87C0(); + func_80299628(1); + next_state = func_802A8D84(next_state); + next_state = func_8029CA94(next_state); + bs_setState(next_state); + +} + +void bsbtrot_stand_end(void){ + func_802A8BB0(); +} + +enum asset_e func_802A9030(void){ + return func_802A8D00(0x15, 0x44); +} + +void func_802A9054(void){ + f32 tmp = 1.0f; + func_80289EC8(func_802A8900(), func_802A88B0(), func_802A8984(), func_802A8934()); + if(func_8028B394()){ + tmp = ml_map_f(func_80297AF0(), 0.0f, 1.0f, 0.6f, 0.9f); + func_80289EF8(tmp); + } + else{ + func_80289EF8(tmp); + } +} + +void bsbtrot_walk_init(void){ + func_8028A010(func_802A9030(), 0.53f); + func_8029C7F4(2,1,1,2); + func_802A8A40(); + func_802A9054(); +} + +void bsbtrot_walk_update(void){ + enum bs_e sp1C = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + func_802A8850(); + func_802A9054(); + func_802A8AD8(); + _bsbtrot_802A8C98(aCtrl, func_802A9030()); + func_80299628(1); + func_802A89D4(); + if(animctrl_isAt(aCtrl, 0.2781f)) + func_802A880C(1); + + func_8029AD28(0.2781f, 4); + if(animctrl_isAt(aCtrl, 0.7781f)) + func_802A880C(0); + + func_8029AD28(0.7781f, 3); + if(func_80291698(3)){ + func_802A87C0(); + } + else{ + if(animctrl_isAt(aCtrl, 0.2115f) || animctrl_isAt(aCtrl, 0.7115f)) + func_802A87C0(); + } + if(!func_8029B300() && func_80297C04(1.0f)) + sp1C = BS_15_BTROT_IDLE; + + if(func_8028B094()) + sp1C = BS_71_BTROT_FALL; + + if(func_802A8C60()) + sp1C = BS_17_BTROT_EXIT; + + if(button_pressed(BUTTON_A)) + sp1C = func_802A8D34(sp1C); + + if(player_shouldSlideTrot()) + sp1C = BS_45_BTROT_SLIDE; + + if(player_inWater()) + sp1C = BS_2D_SWIM_IDLE; + + sp1C = func_8029CA94(sp1C); + bs_setState(sp1C); +} + +void bsbtrot_walk_end(void){ + func_802A8BB0(); +} + +void func_802A9320(void){} + +void bsbtrot_jump_init(void){ + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_BANJO_BTROT_JUMP); + animctrl_setDuration(aCtrl, 1.4f); + animctrl_setTransitionDuration(aCtrl, 0.1f); + func_8028774C(aCtrl, 0.2f); + animctrl_setSubRange(aCtrl, 0.0f, 0.4002f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsbtrot.c", 0x272); + func_802A8A40(); + func_80289F10(1); + func_802991A8(1); + func_8029957C(3); + func_802978DC(6); + if(func_8029B2E8() != 0.0f) + yaw_setIdeal(func_8029B33C()); + + func_8029797C(yaw_getIdeal()); + func_802A89D4(); + func_802979AC(yaw_getIdeal(), func_80297A64()); + player_setYVelocity(D_80364ABC); + gravity_set(D_80364AC0); + func_8030E484(SFX_48_KAZOOIE_RUUH); + D_8037D3A4 = 0; +} + +void bsbtrot_jump_update(void){ + enum bs_e sp2C = 0; + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + f32 sp1C[3]; + func_802A8AD8(); + if(func_80291698(3)) + func_802A87C0(); + + if(miscflag_isTrue(0xF)) + func_802978A4(); + else + func_802A89D4(); + + _get_velocity(&sp1C); + if(button_released(BUTTON_A) && 0.0f < sp1C[1]) + gravity_reset(); + + switch(D_8037D3A4){ + case 0://L802A9530 + if(animctrl_isStopped(aCtrl)){ + animctrl_setSubRange(aCtrl, 0.0f, 0.4653f); + animctrl_setDuration(aCtrl, 10.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D3A4 = 1; + } + break; + case 1://L802A9578 + if(func_8028B254(0x8C)){ + animctrl_setSubRange(aCtrl, 0.0f, 0.7328f); + animctrl_setDuration(aCtrl, 1.4f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D3A4 = 2; + } + break; + case 2://L802A95C4 + func_80299628(1); + if(func_8028B2E8()){ + func_8029C5E8(); + animctrl_setSubRange(aCtrl, 0.0f, 0.8798f); + animctrl_setDuration(aCtrl, 0.9f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_8029957C(1); + D_8037D3A4 = 3; + if(220.0f < func_80297A64()) + func_80299AAC(); + func_8029C22C(); + } + break; + case 3://L802A9660 + if(220.0f < func_80297A64()) + func_80299AAC(); + func_802A9320(); + func_80299628(1); + if(animctrl_isStopped(aCtrl)){ + animctrl_setSubRange(aCtrl, 0.0f, 0.8898f); + animctrl_setDuration(aCtrl, 2.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D3A4 = 4; + } + func_8029C22C(); + break; + case 4://L802A96F0 + if(220.0f < func_80297A64()) + func_80299AAC(); + + func_802A9320(); + func_80299628(1); + if(animctrl_isStopped(aCtrl)){ + animctrl_setSubRange(aCtrl, 0.0f, 1.0f); + animctrl_setDuration(aCtrl, 1.2f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D3A4 = 5; + } + func_8029C22C(); + break; + case 5://L802A9780 + if(220.0f < func_80297A64()) + func_80299AAC(); + func_802A9320(); + func_80299628(1); + if(animctrl_isStopped(aCtrl)) + sp2C = BS_15_BTROT_IDLE; + break; + }//LL802A97D0 + + if(should_peck()) + sp2C = BS_11_BPECK; + + if(func_8028B424()) + sp2C = BS_3D_FALL_TUMBLING; + + if(player_inWater()) + sp2C = BS_4C_LANDING_IN_WATER; + + if(func_8028B2E8()){ + if(button_pressed(BUTTON_A)) + sp2C = func_802A8D34(sp2C); + + if(player_shouldSlideTrot()) + sp2C = BS_45_BTROT_SLIDE; + } + + bs_setState(sp2C); +} + +void bsbtrot_jump_end(void){ + gravity_reset(); + func_802A8BB0(); +} + +void bsbtrot_exit_init(void){ + func_8028A274(7, 0.6f); + func_80289F10(1); + func_80297970(0.0f); +} + +void bsbtrot_exit_update(void){ + enum bs_e sp1C = 0; + if(animctrl_isStopped(_player_getAnimCtrlPtr())) + sp1C = BS_1_IDLE; + + bs_setState(sp1C); +} + +void bsbtrot_exit_end(void){ + func_802A8BB0(); +} + +void bsbtrot_slide_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_BANJO_BTROT_JUMP); + func_8028774C(aCtrl, 0.069f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED); + func_802875AC(aCtrl, "bsbtrot.c", 0x382); + func_802A8A40(); + func_8029C7F4(1,1,3,3); + func_8029797C(yaw_getIdeal()); + func_802979AC(yaw_getIdeal(), func_80297A64()); + func_8029E070(1); + func_8029E064(1); + pitch_setAngVel(1000.0f, 12.0f); + roll_setAngularVelocity(1000.0f, 12.0f); + func_80297970(0.0f); + func_80299AAC(); + D_8037D3A0 = 1.0f; +} + +void bsbtrot_slide_update(void){ + enum bs_e sp3C = 0; + f32 sp30[3]; + f32 sp2C; + + func_802A8AD8(); + if(func_80291698(3)) + func_802A87C0(); + func_80299AAC(); + D_8037D3A0 = max_f(D_8037D3A0-time_getDelta(), 0.0f); + if(player_shouldSlideTrot()){ + func_80294480(sp30); + func_8025801C(sp30, &sp2C); + func_80299628(1); + func_80297970(ml_map_f(pitch_getIdeal(), 20.0f, 60.0f, 550.0f, 700.0f)); + func_8029797C(sp2C); + func_8029C22C(); + }else{ + sp3C = BS_15_BTROT_IDLE; + } + if(player_inWater()) + sp3C = BS_2D_SWIM_IDLE; + + if(D_8037D3A0 == 0.0f && button_pressed(BUTTON_A) && func_8028B2E8()) + sp3C = func_802A8D34(sp3C); + + + bs_setState(sp3C); +} + +void bsbtrot_slide_end(void){ + func_802A8BB0(); +} + +int bsbtrot_inSet(s32 move_indx){ + return (move_indx == BS_15_BTROT_IDLE) + || (move_indx == BS_16_BTROT_WALK) + || (move_indx == BS_8_BTROT_JUMP) + || (move_indx == BS_17_BTROT_EXIT) + || (move_indx == BS_45_BTROT_SLIDE) + || (move_indx == BS_14_BTROT_ENTER) + || (move_indx == 0x79) + || (move_indx == BS_BTROT_OW) + || (move_indx == BS_71_BTROT_FALL) + || (move_indx == 0x9a); +} + +void bsbtrot_fall_init(void){ + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_BANJO_BTROT_JUMP); + animctrl_setDuration(aCtrl, 1.4f); + func_8028774C(aCtrl, 0.4653f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED); + func_802875AC(aCtrl, "bsbtrot.c", 0x400); + func_802A8A40(); + func_8029C7F4(1,1,3,6); + func_8029797C(yaw_getIdeal()); + func_802A89D4(); + func_802979AC(yaw_getIdeal(), func_80297A64()); + D_8037D3A4 = 0; +} + +void bsbtrot_fall_update(void){ + enum bs_e sp2C = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp1C[3]; + func_802A8AD8(); + if(func_80291698(3)) + func_802A87C0(); + + if(miscflag_isTrue(0xf)) + func_802978A4(); + else + func_802A89D4(); + + _get_velocity(&sp1C); + switch (D_8037D3A4){ + case 0://L802A9D90 + if(func_8028B254(0x8C)){ + animctrl_setSubRange(aCtrl, 0.0f, 0.7328f); + animctrl_setDuration(aCtrl, 1.4f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D3A4 = 1; + } + break; + case 1://L802A9DDC + func_80299628(1); + if(func_8028B2E8()){ + func_8029C5E8(); + animctrl_setSubRange(aCtrl, 0.0f, 0.8798f); + animctrl_setDuration(aCtrl, 0.9f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_8029957C(1); + if(220.0f < func_80297A64()){ + func_80299AAC(); + } + func_8029C22C(); + D_8037D3A4 = 2; + } + break; + case 2://L802A9E78 + if(220.0f < func_80297A64()) + func_80299AAC(); + + func_802A9320(); + func_80299628(1); + if(animctrl_isStopped(aCtrl)){ + animctrl_setSubRange(aCtrl, 0.0f, 0.8898f); + animctrl_setDuration(aCtrl, 2.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D3A4 = 3; + } + func_8029C22C(); + break; + case 3://L802A9F08 + if(220.0f < func_80297A64()) + func_80299AAC(); + + func_802A9320(); + func_80299628(1); + if(animctrl_isStopped(aCtrl)){ + animctrl_setSubRange(aCtrl, 0.0f, 1.0f); + animctrl_setDuration(aCtrl, 1.2f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D3A4 = 4; + } + func_8029C22C(); + break; + case 4://802A9F98 + if(220.0f < func_80297A64()) + func_80299AAC(); + + func_802A9320(); + func_80299628(1); + if(animctrl_isStopped(aCtrl)) + sp2C = BS_15_BTROT_IDLE; + break; + }//LL802A9FE8 + + if(player_inWater()) + sp2C = BS_4C_LANDING_IN_WATER; + + if(func_8028B424()) + sp2C = BS_3D_FALL_TUMBLING; + + if(func_8028B2E8()){ + if(button_pressed(BUTTON_A)) + sp2C = func_802A8D34(sp2C); + + if(player_shouldSlideTrot()) + sp2C = BS_45_BTROT_SLIDE; + } + + bs_setState(sp2C); +} + +void bsbtrot_fall_end(void){ + func_802A8BB0(); +} + +void bsbtrot_unk79_init(void){ + func_8028A010(ANIM_BANJO_BTROT_IDLE, 1.2f); + func_8029C7F4(1,1,3,2); + func_80297970(0.0f); + func_802A8A40(); + func_80292090(2); + func_8029C674(); +} + +void bsbtrot_unk79_update(void){ + enum bs_e sp1C = 0; + func_8029C6D0(); + func_802A8AD8(); + func_80299628(1); + if(!func_80298850()) + sp1C = BS_15_BTROT_IDLE; + bs_setState(sp1C); +} + +void bsbtrot_unk79_end(void){ + func_8029C748(); + func_802A8BB0(); +} + +void bsbtrot_ow_init(void){ + f32 sp3C; + f32 sp30[3]; + f32 sp24[3]; + + func_802A8A40(); + func_80298760(func_80296560()); + func_8028A274(0x66, 1.1f); + func_80299BFC(1.0f); + _player_getPosition(&sp30); + func_80294980(sp24); + func_80257F18(sp24, sp30, &sp3C); + yaw_setIdeal(mlNormalizeAngle(sp3C + 180.0f));\ + yaw_applyIdeal(); + func_80297970(func_802987D4()); + func_8029797C(sp3C); + func_802979AC(sp3C, func_80297A64()); + func_8029C7F4(1,1,2,3); + if(func_802987B4() == 2) + func_802978DC(6); + player_setYVelocity(func_802987C4()); + gravity_set(func_802987E4()); + func_8028D5DC(); + func_80292E48(); +} + +void bsbtrot_ow_update(void){ + enum bs_e sp1C = 0; + if(func_802987B4() == 2) + func_802B6FA8(); + + if(baanim_isAt(0.3f)) + func_80292EA4(); + + if(func_8028B424()) + sp1C = BS_3D_FALL_TUMBLING; + + if(func_8028B2E8() && baanim_isStopped()) + sp1C = BS_15_BTROT_IDLE; + + if(animctrl_isStopped(_player_getAnimCtrlPtr()) && player_inWater()) + sp1C = BS_2D_SWIM_IDLE; + + bs_setState(sp1C); +} + +void bsbtrot_ow_end(void){ + func_80297CA8(); + gravity_reset(); + func_8028D5F4(); + func_80292EA4(); + func_802A8BB0(); +} + +void bsbtrot_drone_init(void){ + func_802A8AD8(); + func_802A8A40(); + bsdrone_init(); +} + +void bsbtrot_drone_update(void){ + bsdrone_update(); + func_802A8AD8(); +} + +void bsbtrot_drone_end(void){ + bsdrone_end(); + func_802A8BB0(); +} diff --git a/src/core2/bs/bWhirl.c b/src/core2/bs/bWhirl.c new file mode 100644 index 00000000..7940f61b --- /dev/null +++ b/src/core2/bs/bWhirl.c @@ -0,0 +1,304 @@ +#include +#include "functions.h" +#include "variables.h" + +const f32 D_80364AD0 = 80.0f; +const f32 D_80364AD4 = 425.0f; +const f32 D_80364AD8 = 0.56f; +const f32 D_80364ADC = 0.4f; +const f32 D_80364AE0 = 693.5f; +const f32 D_80364AE4 = -1200.0f; + +/* .bss */ +float D_8037D3B0; +u8 D_8037D3B4; + +/* .code */ +void func_802AA400(void){ + f32 sp1C = func_8029B30C(); + if(!func_8029B300()){ + func_80297970(0.0f); + }else{ + func_80297970(func_80257C48(sp1C, D_80364AD0, D_80364AD4)); + } +} + +static void __bsbwhirl_end(void){ + enum bs_e state = bs_getNextState(); + if(!( state == BS_1B_WONDERWING_IDLE + || state == BS_1C_WONDERWING_WALK + || state == BS_1D_WONDERWING_JUMP + || state == BS_1E_WONDERWING_EXIT + || state == BS_A4_WONDERWING_DRONE + || state == BS_A5_WONDERWING_UNKA5 + ) + ){ + func_8029B0C0(); + func_8029E070(0); + func_8025A55C(-1, 0xfa0, 0xd); + func_8024BD08(1); + func_8025A7DC(COMUSIC_25_USING_GOLD_FEATHERS); + } + func_80289F10(1); +} + +static void __bsbwhirl_spawnSparkle(void){ + func_8033E3F0(2,1); +} + +enum bs_e func_802AA510(enum bs_e arg0){ + if(func_8029B300(arg0) > 0) + arg0 = BS_1C_WONDERWING_WALK; + + if(button_released(BUTTON_Z)) + arg0 = BS_1E_WONDERWING_EXIT; + + if(button_pressed(BUTTON_A) && func_8028B2E8()) + arg0 = BS_1D_WONDERWING_JUMP; + + if(player_inWater()) + arg0 = BS_2D_SWIM_IDLE; + + return arg0; + +} + +void func_802AA58C(enum bs_e *arg0){ + D_8037D3B0 += time_getDelta(); + if(2.0 < D_8037D3B0){ + D_8037D3B0 = 0.0f; + func_80346C10(arg0, BS_1E_WONDERWING_EXIT, -1, ITEM_10_GOLD_FEATHER, 1); + if(*arg0 != BS_1E_WONDERWING_EXIT){ + FUNC_8030E624(SFX_3E9_UNKNOWN, 0.8f, 28000); + func_802D8BE4(1); + } + } +} + +void bsbwhirl_enter_init(void){ + func_8028A274(0x22, 0.5f); + func_8029C7F4(1,1,1,2); + func_80297970(0.0f); + func_8029B324(0, 0.03f); + func_8029B324(1, 1.0f); + func_8029E070(1); + D_8037D3B0 = 0.0f; + func_8024BD08(0); + func_8025A55C(0, 0xfa0, 0xd); + func_8025A6EC(0x25, 0x6d60); + func_80299BD4(); + func_802952A8(1,0); +} + +void bsbwhirl_enter_update(void){ + enum bs_e sp1C = 0; + func_802952A8(1,1); + if(animctrl_isStopped(_player_getAnimCtrlPtr())) + sp1C = BS_1B_WONDERWING_IDLE; + bs_setState(sp1C); +} + +void bsbwhirl_enter_end(void){ + func_802952A8(1,1); + __bsbwhirl_end(); +} + +void bsbwhirl_stand_init(void){ + func_8028A010(ANIM_BANJO_WONDERWING_IDLE, 1.0f); + func_8029C7F4(1,1,1,2); + func_80297970(0.0f); +} + +void bsbwhirl_stand_update(void){ + enum bs_e sp1C = 0; + __bsbwhirl_spawnSparkle(); + sp1C = func_802AA510(sp1C); + func_802AA58C(&sp1C); + + if(player_isSliding()) + sp1C = BS_SLIDE; + + if(player_inWater()) + sp1C = BS_4C_LANDING_IN_WATER; + + bs_setState(sp1C); + +} + +void bsbwhirl_stand_end(void){ + __bsbwhirl_end(); +} + +void bsbwhirl_walk_init(void){ + func_8028A010(ANIM_BANJO_WONDERWING_WALK, 0.53f); + func_80289EC8(D_80364AD0, D_80364AD4, D_80364AD8, D_80364ADC); + func_8029C7F4(2,1,1,2); + +} + +void bsbwhirl_walk_update(void){ + enum bs_e sp1C = 0; + __bsbwhirl_spawnSparkle(); + func_8029AD28(0.47f, 4); + func_8029AD28(0.97f, 3); + func_802AA400(); + + if(!func_8029B300() && func_80297C04(1.0f)) + sp1C = BS_1B_WONDERWING_IDLE; + + if(button_released(BUTTON_Z)) + sp1C = BS_1E_WONDERWING_EXIT; + + if(button_pressed(BUTTON_A) && func_8028B2E8()) + sp1C = BS_1D_WONDERWING_JUMP; + + if(player_inWater()) + sp1C = BS_4C_LANDING_IN_WATER; + + func_802AA58C(&sp1C); + + if(player_isSliding()) + sp1C = BS_SLIDE; + + bs_setState(sp1C); +} + +void bsbwhirl_walk_end(void){ + __bsbwhirl_end(); +} + +void bsbwhirl_jump_init(void){ + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_BANJO_WONDERWING_JUMP); + animctrl_setDuration(aCtrl, 0.8f); + animctrl_setTransitionDuration(aCtrl, 0.134f); + func_8028774C(aCtrl, 0.14f); + animctrl_setSubRange(aCtrl, 0.0f, 0.4495f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsbwhirl.c", 0x181); + func_8029C7F4(1,1,3,6); + if(func_8029B2E8() != 0.0f) + yaw_setIdeal(func_8029B33C()); + + func_8029797C(yaw_getIdeal()); + func_802AA400(); + func_802979AC(yaw_getIdeal(), func_80297A64()); + player_setYVelocity(D_80364AE0); + gravity_set(D_80364AE4); + func_80299B58(0.91f, 1.09f); + D_8037D3B4 = 0; +} + +void bsbwhirl_jump_update(void){ + enum bs_e sp2C = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp1C[3]; + + __bsbwhirl_spawnSparkle(); + func_802AA400(); + _get_velocity(&sp1C); + if(button_released(BUTTON_A) && 0.0f < sp1C[1]) + gravity_reset(); + + switch(D_8037D3B4){ + case 0://L802AAB48 + if(func_8028B254(0x82)){ + animctrl_setSubRange(aCtrl, 0.0f, 1.0f); + animctrl_setDuration(aCtrl, 0.8f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D3B4 = 1; + } + break; + case 1://L802AAB90 + if(player_inWater()) + sp2C = BS_2D_SWIM_IDLE; + + if(func_8028B2E8()){ + D_8037D3B4 = 2; + func_8029C5E8(); + } + break; + case 2://L802AABC8 + if(animctrl_isStopped(aCtrl)) + sp2C = BS_1B_WONDERWING_IDLE; + sp2C = func_802AA510(sp2C); + break; + }//L802AABE8 + func_802AA58C(&sp2C); + if(player_inWater()) + sp2C = BS_4C_LANDING_IN_WATER; + + bs_setState(sp2C); +} + +void bsbwhirl_jump_end(void){ + gravity_reset(); + __bsbwhirl_end(); +} + +void bsbwhirl_exit_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, 0); + animctrl_setDirection(aCtrl, 0); + animctrl_setIndex(aCtrl, ANIM_BANJO_WONDERWING_EXIT); + animctrl_setDuration(aCtrl, 0.5f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsbwhirl.c", 0x201); + func_80289F10(1); + func_8029957C(2); + func_80297970(0.0f); + comusic_8025AB44(COMUSIC_25_USING_GOLD_FEATHERS, 0.0f, 0xFA0); +} + +void bsbwhirl_exit_update(void){ + enum bs_e sp1C = 0; + + if(animctrl_isStopped(_player_getAnimCtrlPtr())) + sp1C = BS_1_IDLE; + + bs_setState(sp1C); +} + +void bsbwhirl_exit_end(void){ + __bsbwhirl_end(); +} + +void bsbwhirl_drone_init(void){ + bsdrone_init(); +} + +void bsbwhirl_drone_update(void){ + __bsbwhirl_spawnSparkle(); + bsdrone_update(); +} + +void bsbwhirl_drone_end(void){ + bsdrone_end(); + __bsbwhirl_end(); +} + +void func_802AADBC(void){ + func_8028A010(ANIM_BANJO_WONDERWING_IDLE, 1.0f); + func_8029C7F4(1,1,3,2); + func_80297970(0.0f); + func_8029C674(); +} + +void func_802AAE08(void){ + enum bs_e sp1C =0; + __bsbwhirl_spawnSparkle(); + func_8029C6D0(); + if(!func_80298850()) + sp1C = BS_1B_WONDERWING_IDLE; + + bs_setState(sp1C); +} + +void func_802AAE4C(void){ + func_8029C748(); + __bsbwhirl_end(); +} diff --git a/src/core2/bs/bbuster.c b/src/core2/bs/bbuster.c new file mode 100644 index 00000000..538efae9 --- /dev/null +++ b/src/core2/bs/bbuster.c @@ -0,0 +1,208 @@ +#include +#include "functions.h" +#include "variables.h" + +/*.data*/ +const f32 D_80364990 = 400.0f; +const f32 D_80364994 = -800.0f; + +const f32 D_80364998 = 730.0f; +const f32 D_8036499C = -2110.0f; + +const f32 D_803649A0 = 2300.0f; +const f32 D_803649A4 = -20000.0f; +const f32 D_803649A8 = -5000.0f; + +/*.bss*/ +f32 D_8037D2B0; +u8 D_8037D2B4; +u8 D_8037D2B5; +u8 D_8037D2B6; +u8 D_8037D2B7; +u8 D_8037D2B8; +u8 D_8037D2B9; +u8 D_8037D2BA; +u8 D_8037D2BB; +u8 D_8037D2BC; + +void func_802A02B4(s32 arg0); + +/*.code*/ +int func_8029FB20(Actor *arg0){ + return !arg0->unk124_0; +} + +void func_8029FB30(void) { + f32 i; + + for(i = 0.0f; i < 359.0; i += 60.0){ + func_80292974(i, 730.0f, 100.0f); + } + for(i = 0.0f; i < 359.0; i += 60.0){ + func_80292974(mlNormalizeAngle(i + 30.0f), 430.0f, 40.0f); + } +} + +s32 func_8029FC4C(void){ + return D_8037D2B8; +} + +s32 bsbbuster_hitboxActive(void){ + return D_8037D2B7; +} + +void bsbbuster_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp20[3]; + + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, 0); + animctrl_setIndex(aCtrl, ANIM_BANJO_BBUSTER); + animctrl_setDuration(aCtrl, 1.02f); + animctrl_setSubRange(aCtrl, 0.0f, 0.35f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsbbuster.c", 0x81); + func_8029C7F4(1,1,3,6); + gravity_set(0.0f); + func_80297970(0.0f); + ml_vec3f_clear(sp20); + func_80297A0C(sp20); + func_8029E070(1); + func_802A02B4(0); + D_8037D2B9 = 0; + D_8037D2B7 = 0; + D_8037D2B8 = 0; + D_8037D2B0 = 0.0001f; + D_8037D2B4 = 0; + D_8037D2B5 = 0; + D_8037D2B6 = 0; + D_8037D2BC = 0; + D_8037D2BA = 0; +} + +void bsbbuster_update(void){ + enum bs_e sp44 = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + s32 sp3C; + f32 sp30[3]; + s32 sp24[3]; + + D_8037D2B8 = 0; + if(animctrl_isAt(aCtrl, 0.24f)) + func_80299BD4(); + + switch(D_8037D2BA){ + case 0://8029FDF0 + if(animctrl_isStopped(_player_getAnimCtrlPtr())){ + animctrl_setDuration(aCtrl, 0.4f); + D_8037D2BA = 1; + } + break; + case 1://8029FE24 + D_8037D2B0 -= time_getDelta(); + if(D_8037D2B0 <= 0.0f){ + gravity_reset(); + func_80297BF8(D_803649A8); + gravity_set(D_803649A4); + player_setYVelocity(D_803649A0); + D_8037D2B7 = 1; + D_8037D2BA = 2; + } + break; + case 2://8029FEA0 + if(D_8037D2B5 == 0 && func_80297AAC() < 0.0f){ + func_8030E760(SFX_45_KAZOOIE_HUGHH, 1.2f, 0x7530); + D_8037D2B5++; + } + if(D_8037D2B4 == 0 && func_8028B254(0x8c)){ + func_8030E5F4(SFX_13_BEAKBUSTER_GROUND, 1.0f); + D_8037D2B4++; + } + if(D_8037D2B6 == 0 && func_8028B254(0x4b)){ + func_80250D94(1.0f, 0.3f, 0.4f); + D_8037D2B6++; + } + D_8037D2B9 = miscflag_isTrue(8); + func_8029445C(sp30); + //L8029FF78 + if(((0.0f <= sp30[1])? sp30[1] : -sp30[1]) < 1.0){ + D_8037D2BC++; + }else{ + D_8037D2BC = 0; + } + if(D_8037D2B7 == 2){ + D_8037D2B7 = 0; + } + if(func_8028B2E8() || D_8037D2B9 || !(D_8037D2BC < 4)){ + func_802BB3DC( 0, 45.0f, 0.71f); + func_8029AE74(0); + func_8029FB30(); + func_80297A0C(0); + gravity_set(0.0f); + func_80297970(0.0f); + D_8037D2B7 = 2; + D_8037D2B8 = 1; + D_8037D2B0 = 0.09f; + D_8037D2BA = 3; + _player_getPosition(&sp24); + func_8032728C(sp24, 150.0f, 2, func_8029FB20); + if(func_802931DC(&sp3C)){ + sp44 = BS_SPLAT; + } + } + break; + case 3://802A00F0 + D_8037D2B7 = 0; + if(func_80297C6C() == 1){ + func_80297CCC(0.9f); + } + + D_8037D2B0 -= time_getDelta(); + if(D_8037D2B0 <= 0.0f){ + if(D_8037D2BB){ + player_setYVelocity(D_80364990); + gravity_set(D_80364994); + }else{ + player_setYVelocity(D_80364998); + gravity_set(D_8036499C); + } + + animctrl_setSubRange(aCtrl, 0.0f, 0.7299f); + animctrl_setDuration(aCtrl, 1.9f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D2BA = 4; + } + break; + + case 4://802A01CC + func_802B6FA8(); + if(animctrl_isStopped(aCtrl)){ + animctrl_setSubRange(aCtrl, 0.0f, 0.74f); + animctrl_setDuration(aCtrl, 15.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + } + if(func_8028B2E8()){ + animctrl_setSubRange(aCtrl, 0.0f, 1.0f); + animctrl_setDuration(aCtrl, 1.9f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + sp44 = BS_20_LANDING; + } + break; + } + if(player_inWater()) + sp44 = BS_4C_LANDING_IN_WATER; + + bs_setState(sp44); +}//L802A024C + +void bsbbuster_end(void){ + gravity_reset(); + func_80297B94(); + func_8029E070(0); + D_8037D2B7 = 0; + D_8037D2B8 = 0; +} + +void func_802A02B4(s32 arg0){ + D_8037D2BB = arg0; +} \ No newline at end of file diff --git a/src/core2/bs/bee.c b/src/core2/bs/bee.c new file mode 100644 index 00000000..f9c6dea9 --- /dev/null +++ b/src/core2/bs/bee.c @@ -0,0 +1,64 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80293D48(f32, f32); + +void pitch_setAngVel(f32, f32); + +void roll_setAngularVelocity(f32, f32); + +int bsbee_inSet(s32 move_idx); + +void func_802A02C0(void){ + if(bsbee_inSet(bs_getNextState()) == 0){ + pitch_setIdeal(0.0f); //pitch_setIdeal + roll_setIdeal(0.0f); + func_8029B0C0(); + func_8029E070(0); + func_8029E064(0); + miscflag_clear(3); + miscflag_clear(4); + func_80293D74(); + } + func_80289F10(1); +} + +void func_802A0340(void){ + if(bsbee_inSet(bs_getPrevState()) == 0){ + pitch_setAngVel(1000.0f, 12.0f); + roll_setAngularVelocity(1000.0f, 12.0f); + func_80293D48(50.0f, 25.0f); + miscflag_set(3); + miscflag_set(4); + } +} + +// bsBee_inSet +int bsbee_inSet(s32 move_idx){ + return (move_idx == 0x85) + || (move_idx == 0x86) + || (move_idx == 0x87) + || (move_idx == 0x88) + || (move_idx == 0x89) + || (move_idx == 0x8a) + || (move_idx == 0x8b) + || (move_idx == 0x9d) + || (move_idx == 0x6b) + || bsBeeFly_inSet(move_idx); //bsBeeFly_inSet +} + + +void bsbee_drone_init(void){ + func_802A0340(); + bsdrone_init(); +} + +void bsbee_drone_update(void){ + bsdrone_update(); +} + +void bsbee_drone_end(void){ + bsdrone_end(); + func_802A02C0(); +} diff --git a/src/core2/bs/beeFly.c b/src/core2/bs/beeFly.c new file mode 100644 index 00000000..96427458 --- /dev/null +++ b/src/core2/bs/beeFly.c @@ -0,0 +1,270 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80354030(f32*, f32); +f32 func_8029B2E8(void); +f32 func_8029B33C(void); +void func_8029797C(f32); +void func_80297970(f32); + +void func_802921BC(f32); +void func_80297BF8(f32); +void func_802BFE50(f32, f32, f32); +void func_80299234(f32, f32); +f32 func_8029B2D0(void); +f32 func_8029B2DC(void); +f32 func_80297A64(void); +void func_802979AC(f32, f32); +void func_8028FDC8(f32); +void func_80290B40(f32); +void func_80290A6C(void); + +/* .data */ +f32 D_803649B0[5] = {0.38f, 0.3f, 0.24f, 0.18f, 0.14}; +f32 D_803649C4[5] = {0.0f, 0.2f, 0.3f, 0.4f, 0.5f}; + +/* .bss */ +u8 D_8037D2C0; + +int bsBeeFly_inSet(s32); + +void func_802A04F0(void){ + f32 plyrPos[3]; //sp1C + + _player_getPosition(&plyrPos); + plyrPos[0] += randf2(-30.0f, 30.0f); + plyrPos[1] += 30.0f + randf2(0.0f, 30.0f); + plyrPos[2] += randf2(-30.0f, 30.0f); + func_803541C0(3); + func_803541CC(0x50); + func_80354030(plyrPos, 0.5f); + +} + +void func_802A0590(void){ + func_802A0340(); + func_8028A274(0x1df, 1.5f); + func_8029C7F4(1,1,3,6); + if(func_8029B2E8() != 0.0f){ + yaw_setIdeal(func_8029B33C()); + } + func_8029797C(yaw_getIdeal()); + func_80297970(0.0f); + gravity_set(-1200.0f); + D_8037D2C0 = 0; +} + +void func_802A0630(void){ + s32 next_state = 0; + AnimCtrl * mvmnt; //sp1C + + mvmnt = _player_getAnimCtrlPtr(); + switch(D_8037D2C0){ + case 0: + if(!animctrl_isAt(mvmnt, 0.266f)) + break; + player_setYVelocity(1600.0f); + func_8030E58C(SFX_C_TAKING_FLIGHT_LIFTOFF, 0.7f); + D_8037D2C0 = 1; + break; + case 1: + func_802A04F0(); + if(animctrl_isStopped(mvmnt)) + func_8028A010(ASSET_1DC_ANIM_BEE_FLY, 0.38f); + if(func_80297AAC() < 0.0f) + next_state = BS_BEE_FLY; + break; + } + bs_setState(next_state); +} + +void func_802A0704(void){ + func_802A02C0(); +} + +void func_802A0724(void){ + pitch_setAngVel(500.0f, 1.2f); +} + +void func_802A0750(void){ + pitch_setAngVel(1000.0f, 2.2f); +} + +void _bsbeefly_end(void){ + if(bsBeeFly_inSet(bs_getNextState())) + return; + func_802921BC(0.0f); + roll_setIdeal(0.0f); + pitch_setIdeal(0.0f); + func_80291548(); + gravity_reset(); + func_80297B94(); + func_8028FFBC(0); + func_8029099C(); +} + +void func_802A07F8(void){ + if(bsBeeFly_inSet(bs_getPrevState())) + return; + func_802921BC(65.0f); + func_802991A8(3); + roll_setAngularVelocity(500.0f, 2.0f); + func_802A0724(); + gravity_set(-300.0f); + func_80297BF8(-99.9f); + func_8028FEF0(); + func_8028FFBC(1); + func_802909C4(); +} + +void _bsBeeFly_updateYaw(void){ + f32 sp34; + f32 sp30; + f32 stickX; + stickX = func_8029B2D0(); + func_802BFE50(2.0f, 2000.0f, 350.0f); + if(button_held(BUTTON_R)){ + func_80299234(500.0f, 30.0f); + sp34 = 6.0f; + sp30 = 85.0f; + } + else{ + func_80299234(500.0f, 2.0f); + sp34 = 3.0f; + sp30 = 65.0f; + } + roll_setIdeal(ml_map_f(stickX, -1.0f, 1.0f, -sp30, sp30)); + yaw_setIdeal(mlNormalizeAngle(yaw_getIdeal() + ml_map_f(stickX, -1.0f, 1.0f, sp34, -sp34))); +} + +void _bsBeeFly_updatePitch(void){ + f32 stickY = func_8029B2DC(); + if(stickY < 0.0f){ + pitch_setIdeal(ml_map_f(stickY, -1.0f, 0.0f, 300.0f, 360.0f)); + } else { + pitch_setIdeal(ml_map_f(stickY, 0.0f, 1.0f, 0.0f, 80.0f)); + } + +} + +void bsbeefly_enter(void){ + s32 mvmnt; + + mvmnt = bs_getPrevState(); + func_8028A010(ASSET_1DC_ANIM_BEE_FLY, 0.38); + func_8029C7F4(1, 1, 3, 3); + if(miscflag_isTrue(9)) + func_80297970(0.0f); + else + func_80297970(600.0f); + func_802979AC(yaw_getIdeal(), func_80297A64()); + func_8029797C(yaw_getIdeal()); + func_802914CC(4); + func_802A07F8(); + if(mvmnt != 0x8b){ + func_8028FDC8(1.0f); + D_8037D2C0 = 0; + } + else { + D_8037D2C0 = 1; + } +} + +void bsbeefly_update(void){ + s32 sp4C; + AnimCtrl* sp48; + s32 sp44; + f32 sp40; + f32 sp3C; + f32 sp38; + f32 *sp24; + f32 sp30; + + + sp4C = 0; + sp48 = _player_getAnimCtrlPtr(); + _bsBeeFly_updateYaw(); + _bsBeeFly_updatePitch(); + pitch_get(); //return value never used + if(button_pressed(BUTTON_A) && (player_getYPosition() < 7500.0)){ + func_8028FDC8(1.0f); + } + if(!func_8028FD30() && player_inWater()){ + func_8028FDC8(1.0f); + } + sp44 = func_8028FD30(); + animctrl_setDuration(sp48, D_803649B0[sp44]); + sp24 = &D_803649C4[sp44]; + sp40 = 0.9f; + sp40 += *sp24; + sp3C = pitch_get(); + sp30 = 0.0f; + if(func_80297AAC() < 0.0f){ + if(sp3C < 300.0f){ + sp30 = ml_map_f(sp3C, 0.0f, 80.0f, 0.0f, 0.23f); + } + if(80.0f < sp3C){ + sp30 = ml_map_f(sp3C, 300.0f, 360.0f, -0.2f, 0.0f); + } + } + sp40 += sp30; + if(!sp44 && button_held(BUTTON_B)){ + sp40 += 0.12; + } + func_80290B40(sp40); + func_80290A6C(); + switch(D_8037D2C0){ + default: + break; + case 0: + if((s32)sp24 != (s32)&D_803649C4) + D_8037D2C0 = 1; + break; + case 1: + sp40 = mlNormalizeAngle(pitch_getIdeal() - 30.0f); + if(80.0f < sp40 && sp40 <300.0f) + sp40 = 300.0f; + pitch_setIdeal(sp40); + func_802A0750(); + if(sp44 != 0){ + player_setYVelocity(sp44*400.0); + func_802A04F0(); + } + if((s32)sp24 == (s32)&D_803649C4){ + func_802A0724(); + D_8037D2C0 = 0; + } + break; + }//L802A0DF0 + if(miscflag_isTrue(9)){ + func_80297BF8(0.0f); + func_80297A0C(0); + sp38 = 0.0f; + }else{ + if(sp3C <= 80.0f){ + func_80297BF8(ml_map_f(sp3C, 60.0f, 80.0f, -99.9, -1266.66)); + sp38 = ml_map_f(sp3C, 60.0f, 80.0f, 600.0f, 60.0f); + }else{ + func_80297BF8(ml_map_f(sp3C, 300.0f, 310.0f, -399.99, -99.9)); + sp38 = ml_map_f(sp3C, 300.0f, 340.0f, 0.0f, 600.0f); + } + } + func_8029797C(yaw_get()); + if(button_held(9)){ + sp38 += (f64)sp38; + } + func_80297970(sp38); + if(func_8028B2E8() && !player_inWater()) + sp4C = BS_85_BEE_IDLE; + func_8028FFF0(); + bs_setState(sp4C); +} + +void bsbeefly_end(void){ + _bsbeefly_end(); +} + +int bsBeeFly_inSet(s32 move){ + return move == 0x8C; +} diff --git a/src/core2/bs/beeMain.c b/src/core2/bs/beeMain.c new file mode 100644 index 00000000..170ee558 --- /dev/null +++ b/src/core2/bs/beeMain.c @@ -0,0 +1,537 @@ +#include +#include "functions.h" +#include "variables.h" + +f32 func_8029B41C(void); +void func_8029E3C0(s32, f32); +void func_80299628(s32); +void yaw_applyIdeal(void); +void func_8029797C(f32); +f32 func_80297A64(void); +void func_802979AC(f32, f32); +void func_802BF2C0(f32); + +f32 func_80289F70(void); +void func_8028A3B8(f32, f32); +f32 func_8029B2E8(void); +f32 func_8029B33C(void); +f32 func_80257C48(f32, f32, f32); +f32 func_8029B30C(); + +/* .data */ +f32 D_803649E0 = 30.0f; +f32 D_803649E4 = 375.0f; +f32 D_803649E8 = 0.6f; +f32 D_803649EC = 0.4f; +f32 D_803649F0 = 693.5f; +f32 D_803649F4 = -1200.0f; +u8 D_803649F8 = 0; +s16 D_803649FC[3] = {SFX_54_BANJO_HOO_1, SFX_55_BANJO_HOO_2, SFX_56_BANJO_HUI}; + +/* .bss */ +f32 D_8037D2D0; +u8 D_8037D2D4; + +/* .code */ +void func_802A0F90(void){ + FUNC_8030E624(SFX_2F_ORANGE_SPLAT, 1.4f, 8000); + +} + +void func_802A0FB4(void){ + func_8030EB00(D_803649FC[D_803649F8], 1.35f, 1.45f); + if(++D_803649F8 > 2){ + D_803649F8 = 0; + } + +} + +void func_802A1020(void){ + f32 sp1c; + + sp1c = func_8029B30C(); + if(func_8029B300() == 0){ + func_80297970(0.0f); + } + else{ + func_80297970(func_80257C48(sp1c, D_803649E0, D_803649E4)); + } +} + +void func_802A1080(void){ + func_802A0340(); + func_8028A010(ASSET_1DE_ANIM_BEE_IDLE,3.0f); + func_8029C7F4(1,1,1,2); + func_80297970(0.0f); + func_802900B4(); +} + +void func_802A10D4(void){ + s32 s0; + + s0 = 0; + func_80299628(0); + if(func_8028B094()) + s0 = 0x88; + + if(func_80294F78()) + s0 = func_802926C0(); + + if(func_8029B300() > 0) + s0 = BS_BEE_WALK; + + if(button_pressed(BUTTON_A)) + s0 = BS_BEE_JUMP; + + if(player_inWater()) + s0 = BS_BEE_FLY; + + bs_setState(func_8029CA94(s0)); +} + +void func_802A117C(void){ + func_802900FC(); + func_802A02C0(); +} + +void func_802A11A4(void){ + func_802A0340(); + func_8028A010(ASSET_1DD_ANIM_BEE_WALK, 0.38f); + func_8029C7F4(2,1,1,2); + func_80289EC8(D_803649E0, D_803649E4, D_803649E8, D_803649EC); + func_802900B4(); +} + +void func_802A1214(void){ + s32 s0; + + s0 = 0; + func_80299628(0); + func_802A1020(); + func_8029AD28(0.94f, 4); + func_8029AD28(0.44f, 3); + if(func_8029B300() == 0 && func_80297C04(1.0f)) + s0 = BS_85_BEE_IDLE; + + if(func_8028B094()) + s0 = BS_88_BEE_FALL; + + if(button_pressed(BUTTON_A)) + s0 = BS_BEE_JUMP; + + if(player_inWater()) + s0 = BS_BEE_FLY; + + bs_setState(s0); +} + +void func_802A12D4(void){ + func_802900FC(); + func_802A02C0(); +} + +void func_802A12FC(void){ + AnimCtrl * s0; + + s0 = _player_getAnimCtrlPtr(); + func_802A0340(); + animctrl_reset(s0); + animctrl_setSmoothTransition(s0, 0); + animctrl_setIndex(s0, ASSET_1E2_ANIM_BEE_JUMP); + animctrl_setSubRange(s0, 0, 0.34f); + func_8028774C(s0, 0.1f); + animctrl_setDuration(s0, 1.2f); + animctrl_setPlaybackType(s0, ANIMCTRL_ONCE); + func_802875AC(s0, "bsbeemain.c", 0x15b); + func_8029C7F4(1,1,3,6); + if(func_8029B2E8() != 0.0f){ + yaw_setIdeal(func_8029B33C()); + } + func_8029797C(yaw_getIdeal()); + func_802A1020(); + func_802979AC(yaw_getIdeal(), func_80297A64()); + player_setYVelocity(D_803649F0); + gravity_set(D_803649F4); + func_802A0FB4(); + D_8037D2D4 = 0; +} + +void func_802A1438(void){ + s32 sp2c; + AnimCtrl * sp28; + f32 sp1c[3]; + + sp2c = 0; + sp28 = _player_getAnimCtrlPtr(); + func_802A1020(); + _get_velocity(sp1c); + if(button_released(BUTTON_A) && (0.0f < sp1c[1])){ + gravity_reset(); + } + switch (D_8037D2D4) + { + case 0: + if(func_8028B254(0x82)){ + func_8028A3B8(0.715f, 0.7f); + D_8037D2D4 = 2; + }else{ + if(animctrl_isStopped(sp28)){ + func_8028A3B8(0.51f, 4.0f); + D_8037D2D4 = 1; + } + } + break; + case 1: + if(func_8028B254(0x82)){ + func_8028A3B8(0.715f, 1.2f); + D_8037D2D4 = 2; + } + break; + case 2: + func_80299628(0); + if(func_8028B2E8()){ + func_802A0F90(); + func_8028A3B8(1.0f, 0.7f); + D_8037D2D4 = 3; + } + break; + case 3: + func_80299628(0); + if(animctrl_isStopped(sp28)){ + func_80297970(0.0f); + sp2c = BS_85_BEE_IDLE; + } + break; + } + if(func_8028B2E8()){ + if(func_8029B300() > 0) + sp2c = BS_BEE_WALK; + if(button_pressed(BUTTON_A)){ + sp2c = BS_BEE_JUMP; + } + } + else{ + if(button_pressed(BUTTON_A)){ + sp2c = BS_BEE_FLY; + } + } + if(player_inWater()) + sp2c = BS_BEE_FLY; + bs_setState(sp2c); +} + +void func_802A163C(void){ + func_802A02C0(); + gravity_reset(); +} + +void func_802A1664(void){ + AnimCtrl * s0; + + s0 = _player_getAnimCtrlPtr(); + func_802A0340(); + animctrl_reset(s0); + animctrl_setIndex(s0, ASSET_1E2_ANIM_BEE_JUMP); + func_8028774C(s0, 0.34f); + animctrl_setDuration(s0, 8.0f); + animctrl_setSubRange(s0, 0, 0.51f); + animctrl_setPlaybackType(s0, ANIMCTRL_ONCE); + func_802875AC(s0, "bsbeemain.c", 0x1e2); + func_8029C7F4(1,1,3,6); + D_8037D2D4 = 0; +} + +void func_802A170C(void){ + s32 sp2c; //next state + AnimCtrl * sp28; + f32 sp1c[3]; + + sp2c = 0; + sp28 = _player_getAnimCtrlPtr(); + func_80299628(0); + func_802A1020(); + _get_velocity(sp1c); + switch(D_8037D2D4){ + case 0: + if(func_8028B254(0x82)){ + func_8028A3B8(0.715f, 0.7f); + D_8037D2D4 = 1; + } + break; + case 1: + func_80299628(0); + if(func_8028B2E8()){ + func_802A0F90(); + func_80297970(0.0f); + func_8028A3B8(1.0f, 0.7f); + D_8037D2D4 = 2; + } + break; + case 2: + func_80299628(0); + if(animctrl_isStopped(sp28)){ + func_80297970(0.0f); + sp2c = BS_85_BEE_IDLE; + } + break; + } + if(func_8028B2E8()){ + if(miscflag_isTrue(0x19)){ + sp2c = func_80292738(); + }else{ + if(func_8029B300() > 0) + sp2c = BS_BEE_WALK; + if(button_pressed(BUTTON_A)) + sp2c = BS_BEE_JUMP; + sp2c = func_8029CA94(sp2c); + } + } + else{ + if(miscflag_isFalse(0xf) && button_pressed(BUTTON_A)) + sp2c = BS_BEE_FLY; + }//L802A189C + if(player_inWater()) + sp2c = BS_BEE_FLY; + bs_setState(sp2c); +} + +void func_802A18C8(void){ + func_802A02C0(); +} + +void func_802A18E8(s32 arg0){ + ///s32 sp40; + AnimCtrl *sp3C; + f32 sp38; + f32 sp2C[3]; + f32 sp20[3]; + + //sp40 = arg0; + sp3C = _player_getAnimCtrlPtr(); + func_802A0340(); + animctrl_reset(sp3C); + animctrl_setIndex(sp3C, ASSET_1E0_ANIM_BEE_OW); + animctrl_setDuration(sp3C, 1.0f); + animctrl_setSubRange(sp3C, 0, 0.7518f); + animctrl_setPlaybackType(sp3C, ANIMCTRL_ONCE); + func_802875AC(sp3C, "bsbeemain.c", 0x269); + if(arg0 == 1){ + func_8030E58C(SFX_38_BANJO_AYE_1, 1.8f); + }else{ + func_8030E58C(SFX_56_BANJO_HUI, 1.8f); + } + _player_getPosition(sp2C); + func_80294980(sp20); + func_80257F18(sp20, sp2C, &sp38); + yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f)); + yaw_applyIdeal(); + func_80297970(200.0f); + func_8029797C(sp38); + func_802979AC(sp38, func_80297A64()); + func_8029C7F4(1, 1, 2, 3); + player_setYVelocity(510.0f); + gravity_set(-1200.0f); + func_8028D5DC(); + func_80292E48(); + D_8037D2D4 = 0; +} + +void func_802A1A50(void){ + s32 sp1C; + + sp1C= 0; + if(baanim_isAt(0.5f)){ + func_80292EA4(); + } + switch(D_8037D2D4){ + case 0: + if(func_8028B254(0x5A)){ + func_8028A37C(1.0f); + D_8037D2D4 = 1; + } + break; + case 1: + break; + } + if(func_8028B2E8()) + sp1C = BS_85_BEE_IDLE; + if(0.65 < func_80289F70() && player_inWater()){ + sp1C = 0x8C; + } + bs_setState(sp1C); +} + +void func_802A1B28(void){ + func_80297CA8(); + gravity_reset(); + func_8028D5F4(); + func_80292EA4(); + func_802A02C0(); +} + +void func_802A1B68(void){ + func_802A18E8(1); +} + +void func_802A1B88(void){ + func_802A1A50(); +} + +void func_802A1BA8(void){ + func_802A1B28(); +} + +void func_802A1BC8(void){ + func_802A18E8(2); +} + +void func_802A1BE8(void){ + func_802A1A50(); +} + +void func_802A1C08(void){ + func_802A1B28(); +} + +void bsbeemain_die_init(void){ + AnimCtrl* sp3C; + f32 sp38; + f32 sp2C[3]; + f32 sp20[3]; + + sp3C = _player_getAnimCtrlPtr(); + func_8029B930(); + func_802A0340(); + animctrl_reset(sp3C); + animctrl_setSmoothTransition(sp3C, 0); + animctrl_setIndex(sp3C, ASSET_1E1_ANIM_BEE_DIE); + animctrl_setSubRange(sp3C, 0, 0.3966f); + animctrl_setDuration(sp3C, 1.7f); + animctrl_setPlaybackType(sp3C, ANIMCTRL_ONCE); + func_802875AC(sp3C, "bsbeemain.c", 0x2ef); + func_8029C7F4(1,1,2,3); + _player_getPosition(sp2C); + func_80294980(sp20); + func_80257F18(sp20, sp2C, &sp38); + yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f)); + yaw_applyIdeal(); + D_8037D2D0 = 250.f; + func_80297970(D_8037D2D0); + func_8029797C(sp38); + func_802979AC(sp38, func_80297A64()); + player_setYVelocity(420.0f); + gravity_set(-1200.0f); + pitch_setAngVel(1000.0f, 12.0f); + func_8028D5DC(); + func_80292E48(); + func_802914CC(0xd); + func_802BF2C0(30.0f); + func_8029C984(); + func_8030E58C(SFX_36_BANJO_DOH, 1.8f); + func_8029E3C0(0, 2.9f); + D_8037D2D4 = 0; +} + +void func_802A1DD8(void){ + func_80297970(D_8037D2D0); + func_80299628(0); + switch(D_8037D2D4){ + case 0: + if(!func_8028B2E8()) + break; + func_8028A37C(0.7453f); + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); + FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000); + player_setYVelocity(400.0f); + D_8037D2D4 = 1; + break; + case 1: + if(!func_8028B2E8()) + break; + func_8028A37C(1.0f); + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); + FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000); + D_8037D2D4 = 2; + break; + case 2: + D_8037D2D4 = 3; + break; + case 3: + if(0.0f < D_8037D2D0){ + D_8037D2D0 = max_f(0.0f, D_8037D2D0 - 10.0f); + } + break; + }//L802A1EFC + if(func_8029E1A8(0)) + func_8029B890(); + + bs_setState(0); + +} + +void func_802A1F2C(void){ + func_8024BD08(0); + gravity_reset(); + func_80291548(); + func_80292EA4(); + func_802A02C0(); +} + +void func_802A1F6C(void){ + func_802A0340(); + func_8028A010(ASSET_1DE_ANIM_BEE_IDLE, 3.0f); + func_8029C7F4(1,1,3,2); + func_80297970(0.0f); + func_8029C674(); + func_802B3A50(); +} + +void func_802A1FC8(void){ + s32 sp1C; + + sp1C = 0; + func_802B3A50(); + func_80299628(0); + func_8029C6D0(); + if(!func_80298850()){ + sp1C = BS_85_BEE_IDLE; + } + bs_setState(sp1C); +} + +void func_802A2014(void){ + pitch_setIdeal(0.0f); + roll_setIdeal(0.0f); + func_8029C748(); + func_802A02C0(); +} + +void func_802A2054(void){ + func_8028D5F4(); + func_8025A2FC(-1, 0xFA0); + func_8024BD08(1); + func_80291548(); + func_80298A64(); +} + +void func_802A2098(void){ + miscflag_clear(0x1A); + func_8028A010(ASSET_1DE_ANIM_BEE_IDLE, 3.0f); + yaw_setIdeal(func_8029B41C()); + func_8029C7F4(1,1,3,2); + func_80297970(0.0f); + func_8024BD08(0); + func_8025A2FC(0, 0xFA0); + func_8025A6EC(COMUSIC_42_NOTEDOOR_OPENING_FANFARE, -1); + func_8029151C(0xC); + func_8028D5DC(); + func_8029E3C0(0, 3.0f); +} + +void func_802A2130(void){ + s32 next = 0; + if(func_8029E1A8(0)){ + next = BS_85_BEE_IDLE; + } + bs_setState(next); +} diff --git a/src/core2/bs/carry.c b/src/core2/bs/carry.c new file mode 100644 index 00000000..24b892bb --- /dev/null +++ b/src/core2/bs/carry.c @@ -0,0 +1,116 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .data */ +const f32 D_80364AF0 = 30.0f; +const f32 D_80364AF4 = 300.0f; +const f32 D_80364AF8 = 0.84f; +const f32 D_80364AFC = 0.4f; + +void func_802AAE80(void){ + f32 sp1C = func_8029B30C(); + if(func_8029B300() == 0) + func_80297970(0.0f); + else + func_80297970(func_80257C48(sp1C, D_80364AF0, D_80364AF4)); +} + +void func_802AAEE0(void){ + enum bs_e state = bs_getNextState(); + + if(state != BS_3A_CARRY_IDLE && state != BS_CARRY_WALK) + func_8029B0C0(); + + func_80289F10(1); +} + +void bscarry_idle_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, 0x72); + animctrl_setDuration(aCtrl, 1.2f); + func_802875AC(aCtrl, "bscarry.c", 0x6f); + func_8029C7F4(1,1,1,2); + func_80297970(0.0f); + pitch_setAngVel(1000.0f, 12.0f); + roll_setAngularVelocity(1000.0f, 12.0f); +} + +void bscarry_idle_update(void){ + enum bs_e sp1C = 0; + + if(func_8029B300() > 0) + sp1C = BS_CARRY_WALK; + + if(func_802948EC() == 0) + sp1C = BS_1_IDLE; + + bs_setState(sp1C); +} + +void bscarry_idle_end(void){ + func_802AAEE0(); +} + +void bscarry_walk_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, 0x73); + animctrl_setDuration(aCtrl, 0.8f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_LOOP); + func_802875AC(aCtrl, "bscarry.c", 0xac); + func_8029C7F4(2,1,1,2); + func_80289EC8(D_80364AF0, D_80364AF4, D_80364AF8, D_80364AFC); +} + +void bscarry_walk_update(void){ + enum bs_e sp1C = 0; + func_8029AD28(0.4f, 4); + func_8029AD28(0.9f, 3); + func_802AAE80(); + if(func_8029B300() == 0 && func_80297C04(1.0f)) + sp1C = BS_3A_CARRY_IDLE; + + if(!func_802948EC()) + sp1C = BS_1_IDLE; + + bs_setState(sp1C); +} + +void bscarry_walk_end(void){ + func_802AAEE0(); +} + +int bscarry_inSet(enum bs_e state){ + return state == BS_3A_CARRY_IDLE + || state == BS_CARRY_WALK; +} + +void bscarry_interrupt(void){ + switch(bs_getInterruptType()){ + case 7: + func_802948F8(func_8028D688()); + break; + case 8: + func_8029A86C(2); + bs_setState(0x3C); + break; + case 0x12: + func_8028DE6C(carriedObject_getActorID()); + break; + case 0x16: + if(func_802916CC(1)){ + bs_setState(BS_CARRY_THROW); + func_8029A86C(2); + } + else{ + func_8029A86C(1); + } + break; + default://L802AB260 + func_802948E0(); + func_80296608(); + break; + } +} diff --git a/src/core2/bs/claw.c b/src/core2/bs/claw.c new file mode 100644 index 00000000..ac3c1832 --- /dev/null +++ b/src/core2/bs/claw.c @@ -0,0 +1,74 @@ +#include +#include "functions.h" +#include "variables.h" + + + +void func_802915CC(f32); +void func_8029AD28(f32, s32); + +/* .bss */ +u8 _bsclawHitboxActive; + +/* .code */ +int bsclaw_hitboxActive(void){ + return _bsclawHitboxActive; +} + +void bsclaw_init(void){ + func_8028A180(5, 1.3f); + func_8029C7F4(1,1,3,3); + func_8029797C(yaw_getIdeal()); + func_80297970(160.0f); + func_802915CC(80.0f); + _bsclawHitboxActive = 0; +} + +void bsclaw_update(void){ + enum bs_e sp2C = 0; + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + f32 sp24; + + sp24 = animctrl_getAnimTimer(aCtrl); + _bsclawHitboxActive = animctrl_isAt(aCtrl, 0.1488f) + || (0.04879999999999998 < sp24 && sp24 < 0.2488) + || animctrl_isAt(aCtrl, 0.3288f) + || (0.22879999999999998 < sp24 && sp24 < 0.42879999999999998) + || animctrl_isAt(aCtrl, 0.5788f) + || (0.4788 < sp24 && sp24 < 0.6788); + if(animctrl_isAt(aCtrl, 0.5788f)) + func_80297970(0.0f); + + func_8029AD28(0.08f, 3); + func_8029AD28(0.34f, 4); + func_8029AD28(0.53f, 3); + if(animctrl_isAt(aCtrl, 0.1188f)) + func_8030EB00(SFX_2_CLAW_SWIPE, 0.98f, 1.0f); + + if(animctrl_isAt(aCtrl, 0.2888f)) + func_8030EB00(SFX_2_CLAW_SWIPE, 1.04f, 1.06f); + + if(animctrl_isAt(aCtrl, 0.4888f)) + func_8030EB00(SFX_2_CLAW_SWIPE, 1.1f, 1.12f); + + if(animctrl_isStopped(aCtrl)) + sp2C = BS_1_IDLE; + + if(!func_8028B2E8()) + sp2C = BS_2F_FALL; + + if(player_inWater()) + sp2C = BS_4C_LANDING_IN_WATER; + + if(button_pressed(BUTTON_A)) + sp2C = func_8029C780(); + + bs_setState(sp2C); +} + +void bsclaw_end(void){ + ability_use(0xB); + _bsclawHitboxActive = 0; + func_802915B8(); + +} diff --git a/src/core2/bs/climb.c b/src/core2/bs/climb.c new file mode 100644 index 00000000..a90f5e7e --- /dev/null +++ b/src/core2/bs/climb.c @@ -0,0 +1,225 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +u8 D_8037D3D0; +f32 D_8037D3D4; +u8 D_8037D3D8; + +/* .code */ +void func_802AB5C0(void){ + f32 sp2C[3]; + f32 sp28; + f32 f2; + + sp28 = func_8029B2DC(); + if(mlAbsF(sp28) < 0.03){ + f2 = 0.0f; + } + else{ + f2 = func_80257D30(sp28, 0.03f, 1.0f, 100.0f, 300.0f); + } + sp2C[0] = 0.0f; + sp2C[1] = f2; + sp2C[2] = 0.0f; + func_80297930(sp2C); +} + +void func_802AB654(void){ + func_8029957C(6); + func_802991A8(3); + func_80299234(500.0f, 15.0f); + func_8029B324(0, 0.03f); + func_8029B324(1, 1.0f); + func_802978DC(0xA); + func_80297B64(10.0f); + func_80294378(5); + func_80293D48(80.0f, 10.0f); + func_802914CC(0x10); +} + +void func_802AB6F0(void){ + if(!bsclimb_inSet(bs_getNextState())){ + func_80291548(); + func_8029B0C0(); + func_80289F10(1); + func_802978DC(2); + func_80294378(1); + func_80293D74(); + } +} + +void func_802AB750(f32 arg0, f32 arg1){ + D_8037D3D4 = randf()*arg1 + arg0; +} + +int func_802AB788(void){ + return (0.0f < mlAbsF(func_80297A70())) || (yaw_get() != yaw_getIdeal()); +} + +int bsclimb_inSet(s32 move_indx){ + return (move_indx == BS_4F_CLIMB_IDLE) + || (move_indx == BS_50_CLIMB_MOVE) + || (move_indx == 0x9e); +} + +void bsclimb_idle_init(void){ + f32 angle_towards_pole; + f32 plyr_pos[3]; + f32 pole_pos[3]; + + player_getPosition(plyr_pos); + climbGetBottom(pole_pos); + if(!bsclimb_inSet(bs_getPrevState())){ + func_80257F18(plyr_pos, pole_pos, &angle_towards_pole); + yaw_setIdeal(angle_towards_pole); + yaw_applyIdeal(); + } + ability_use(4); + func_8028A010(ASSET_B2_ANIM_BANJO_CLIMB_IDLE_2, 2.64f); + func_80289F10(1); + func_802AB654(); + + D_8037D3D8 = 1; + func_802AB750(1.0f, 0.5f); + D_8037D3D0 = 0; +} + +void bsclimb_idle_update(void){ + s32 next_state = 0; + AnimCtrl *anim_ctrl = _player_getAnimCtrlPtr(); + func_80293350(); + switch(D_8037D3D0){ + case 0: + D_8037D3D4 -= time_getDelta(); + if(D_8037D3D4 <= 0.0f){ + func_8028A180(ASSET_B1_ANIM_BANJO_CLIMB_IDLE_1, 2.96f); + D_8037D3D0 = 1; + } + break; + case 1: + if(animctrl_isStopped(anim_ctrl)){ + func_8028A010(ASSET_B2_ANIM_BANJO_CLIMB_IDLE_2, 2.64f); + func_802AB750(3.0f, 4.0f); + D_8037D3D0 = 0; + } + break; + } + func_802AB5C0(); + if(func_802AB788()) + next_state = BS_50_CLIMB_MOVE; + + + if(button_pressed(BUTTON_A)) + next_state = BS_5_JUMP; + + if(D_8037D3D8 == 0) + next_state = BS_1_IDLE; + D_8037D3D8 = 0; + bs_setState(next_state); +} + +void bsclimb_idle_end(void){ + func_802AB6F0(); +} + +void bsclimb_move_init(void){ + func_8028A010(ASSET_A_ANIM_BANJO_CLIMB_MOVE, 0.9f); + func_80289F10(3); + func_80289EA8(0.3f, 1.5f); + func_80289EC8(100.0f, 300.0f, 0.6f, 0.4f); + func_802AB654(); +} + +void bsclimb_move_update(void){ + s32 next_state = 0; + f32 plyr_pos[3]; + s32 map; + + func_80293350(); + func_802AB5C0(); + map = map_get(); + + if( map == MAP_B_CC_CLANKERS_CAVERN + || map == MAP_1B_MMM_MAD_MONSTER_MANSION + || map == MAP_31_RBB_RUSTY_BUCKET_BAY + ){ + if(baanim_isAt(0.25f)) + func_80299D2C(SFX_D2_QUIET_METALLIC, 1.1f, 32000); + + if(baanim_isAt(0.75f)) + func_80299D2C(SFX_D2_QUIET_METALLIC, 1.2f, 32000); + } + else{//L802ABB34 + if(baanim_isAt(0.25f)) + func_80299D2C(SFX_D3_JINXIE_SNIFFLING_1, 0.77f, 22000); + + if(baanim_isAt(0.75f)) + func_80299D2C(SFX_D3_JINXIE_SNIFFLING_1, 0.87f, 22000); + }//L802ABB84 + + if(!func_802AB788() && func_80297AAC() < 30.0f) + next_state = BS_4F_CLIMB_IDLE; + + _player_getPosition(plyr_pos); + if(func_80297A70() < 0.0f && climbGetBottomY() == plyr_pos[1]) + next_state = BS_1_IDLE; + + if( func_8029825C() == 2 + && 0.0f < func_80297A70() + && climbGetTopY() == plyr_pos[1] + ){ + next_state = BS_51_CLIMB_EXIT; + } + + if(button_pressed(BUTTON_A)) + next_state = BS_5_JUMP; + + if(!D_8037D3D8) + next_state = BS_1_IDLE; + + D_8037D3D8 = FALSE; + + bs_setState(next_state); +} + +void bsclimb_move_end(void){ + func_802AB6F0(); +} + +//bsclimb_unknown_9E_init +void func_802ABCCC(void){ + func_8028A010(ASSET_B2_ANIM_BANJO_CLIMB_IDLE_2, 2.64f); + func_80289F10(1); + func_802AB654(); + func_802978DC(7); +} + +//bsclimb_unknown_9E_update +void func_802ABD0C(void){ + s32 next_state = 0; + if(!func_80298850()) + next_state = BS_4F_CLIMB_IDLE; + + bs_setState(next_state); +} + +//bsclimb_unknown_9E_end +void func_802ABD40(void){ + func_802AB6F0(); +} + +//bsclimb_interrupt +void func_802ABD60(void){ + s32 next_state = 0; + if(bs_getInterruptType() == 0xC){ + D_8037D3D8 = TRUE; + } + else{ + func_80296608(); + return; + } + func_8029A86C(1); + bs_setState(next_state); +} diff --git a/src/core2/bs/croc.c b/src/core2/bs/croc.c new file mode 100644 index 00000000..4373bb32 --- /dev/null +++ b/src/core2/bs/croc.c @@ -0,0 +1,708 @@ +#include +#include "functions.h" +#include "variables.h" + + +int bscroc_inSet(enum bs_e state); + +/* .data */ +const f32 D_80364B00 = 30.0f; +const f32 D_80364B04 = 375.0f; +const f32 D_80364B08 = 500.0f; +const f32 D_80364B0C = 0.5f; +const f32 D_80364B10 = 0.3f; +const f32 D_80364B14 = 0.2f; +const f32 D_80364B18 = 693.5f; //jump initial velocity +const f32 D_80364B1C = -1200.0f; //jump gravity +u8 D_80364B20 = 0; +s16 D_80364B24[] = { + SFX_54_BANJO_HOO_1, + SFX_55_BANJO_HOO_2, + SFX_56_BANJO_HUI +}; + +/* .bss */ +f32 D_8037D3E0; +u8 _bscrocHitboxActive; //8037D3e4 +void *D_8037D3E8; +u8 D_8037D3EC; +f32 D_8037D3F0; +u8 D_8037D3F4; +u8 D_8037D3F5; + +/* .code */ +f32 func_802ABDC0(void){ + if(func_80291670(3) != 0.0f) + return D_80364B08; + else + return D_80364B04; +} + +void func_802ABE04(void){ + func_8030EB00(D_80364B24[D_80364B20], 1.35f, 1.45f); + if(!(++D_80364B20 < 3)) + D_80364B20 = 0; +} + +void func_802ABE70(void){ + f32 sp1C = func_80291670(3); + func_80299650(func_80291684(3), sp1C); + if(miscflag_isTrue(MISC_FLAG_10_TOUCHING_TURBO_TRAINERS) && bs_getState() != BS_17_BTROT_EXIT){ + miscflag_clear(MISC_FLAG_10_TOUCHING_TURBO_TRAINERS); + func_802917E4(3, func_80294A40()); + func_8025A6EC(COMUSIC_8A_GETTING_TURBO_TRAINERS, -1); + func_8029E0DC(1); + } + + if(sp1C != 0.0f ){ + func_8029C3E8(0.0f, 30.0f); + } + + if(func_80291700(3, 0.01f)){ + func_8029E0DC(0); + func_8030E58C(0x3eb, 1.35f); + } +} + +void func_802ABF54(void){ + f32 sp1C = func_8029B30C(); + if(func_8029B300() == 0){ + func_80297970(0.0f); + } + else{ + func_80297970(func_80257C48(sp1C, D_80364B00, func_802ABDC0())); + } +} + +void func_802ABFBC(void){ + if(!bscroc_inSet(bs_getNextState())){ + func_8029B0C0(); + func_8029E070(0); + func_8029E064(0); + miscflag_clear(3); + miscflag_clear(4); + func_80293D74(); + } + func_80289F10(1); +} + +int bscroc_inSet(enum bs_e state){ + return state == BS_5E_CROC_IDLE + || state == BS_CROC_WALK + || state == BS_CROC_JUMP + || state == BS_61_CROC_FALL + || state == BS_CROC_OW + || state == BS_CROC_DIE + || state == BS_6E_CROC_BITE + || state == BS_CROC_EAT_BAD + || state == BS_70_CROC_EAT_GOOD + || state == BS_CROC_LOCKED + || state == BS_CROC_DRONE; +} + +void bscroc_idle_init(void){ + func_8028A010(0xe1, 1.0f); + func_8029C7F4(1,1,1,2); + func_80297970(0.0f); + pitch_setAngVel(1000.0f, 12.0f); + roll_setAngularVelocity(1000.0f, 12.0f); + func_80293D48(50.0f, 25.0f); + miscflag_set(3); + miscflag_set(4); + func_802900B4(); +} + +void bscroc_idle_update(void){ + enum bs_e next_state = 0; + func_802ABE70(); + func_80299628(0); + if(func_8028B094()) + next_state = BS_61_CROC_FALL; + + if(func_80294F78()) + next_state = func_802926C0(); + + if(func_8029B300() > 0) + next_state = BS_CROC_WALK; + + if(button_pressed(BUTTON_B)) + next_state = BS_6E_CROC_BITE; + + if(button_pressed(BUTTON_A)) + next_state = BS_CROC_JUMP; + + next_state = func_8029CA94(next_state); + bs_setState(next_state); + +} + +void bscroc_idle_end(void){ + func_802ABFBC(); + func_802900FC(); +} + +void bscroc_walk_init(void){ + func_8028A100(0xe0, 0.8f, 0.4f); + func_8029C7F4(2,1,1,2); + func_80289EC8(D_80364B00, D_80364B04, D_80364B0C, D_80364B10); + func_802900B4(); +} + +void bscroc_walk_update(void){ + enum bs_e next_state = 0; + + func_802ABE70(); + func_80299628(0); + func_802ABF54(); + + func_8029AD28(0.1f, 4); + func_8029AD28(0.6f, 3); + if(func_8029B300() == 0 && func_80297C04(1.0f)) + next_state = BS_5E_CROC_IDLE; + + if(func_8028B094()) + next_state = BS_61_CROC_FALL; + + if(button_pressed(BUTTON_B)) + next_state = BS_6E_CROC_BITE; + + if(button_pressed(BUTTON_A)) + next_state = BS_CROC_JUMP; + + bs_setState(next_state); +} + +void bscroc_walk_end(void){ + func_802ABFBC(); + func_802900FC(); +} + +void bscroc_jump_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, FALSE); + animctrl_setIndex(aCtrl, 0x11C); + animctrl_setSubRange(aCtrl, 0.0f, 0.35f); + animctrl_setDuration(aCtrl, 1.0f); + func_8028774C(aCtrl, 0.1f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bscroc.c", 0x1ac); + func_8029C7F4(1,1,3,6); + if(func_8029B2E8() != 0.0f){ + yaw_setIdeal(func_8029B33C()); + } + func_8029797C(yaw_getIdeal()); + func_802ABF54(); + func_802979AC(yaw_getIdeal(), func_80297A64()); + player_setYVelocity(D_80364B18); + gravity_set(D_80364B1C); + func_802ABE04(); + D_8037D3EC = 0; +} + +void bscroc_jump_update(void){ + enum bs_e sp2C = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp1C[3]; + + func_802ABE70(); + func_802ABF54(); + _get_velocity(&sp1C); + if(button_released(BUTTON_A) && 0.0f < sp1C[1]) + gravity_reset(); + + switch(D_8037D3EC){ + case 0: + if(func_8028B254(0x82)) + { + func_8028A3B8(0.6538f, 0.7f); + D_8037D3EC = 2; + } + else if(animctrl_isStopped(aCtrl)) + { + func_8028A3B8(0.5036f, 3.0f); + D_8037D3EC = 1; + } + break; + case 1: + if(func_8028B254(0x82)){ + func_8028A3B8(0.6538f, 1.0f); + D_8037D3EC = 2; + } + break; + case 2: + func_80299628(0); + if(func_8028B2E8()){ + func_8029AE48(); + func_8028A3B8(1.0f, 1.0f); + D_8037D3EC = 3; + } + break; + case 3: + func_80299628(0); + if(animctrl_isStopped(aCtrl)){ + func_80297970(0.0f); + sp2C = BS_5E_CROC_IDLE; + } + break; + }//L802AC66C + + if(func_8028B2E8()){ + if(func_8029B300() > 0) + sp2C = BS_CROC_WALK; + + if(button_pressed(BUTTON_A)) + sp2C = BS_CROC_JUMP; + } + + if(button_pressed(BUTTON_B)) + sp2C = BS_6E_CROC_BITE; + + bs_setState(sp2C); +} + +void bscroc_jump_end(void){ + gravity_reset(); + func_802ABFBC(); +} + +void bscroc_fall_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, 0x11C); + func_8028774C(aCtrl, 0.5036f); + animctrl_setDuration(aCtrl, 0.7f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED); + func_802875AC(aCtrl, "bscroc.c", 0x235); + func_8029C7F4(1,1,3,6); + D_8037D3EC = 0; +} + +void bscroc_fall_update(void){ + enum bs_e next_state = 0; + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + f32 velocity[3]; + + func_802ABE70(); + func_80299628(0); + func_802ABF54(); + _get_velocity(&velocity); + + switch(D_8037D3EC){ + case 0: + if(func_8028B254(0x82)){ + func_8028A37C(0.6538f); + D_8037D3EC = 1; + } + break; + case 1: + if(func_8028B2E8()){ + func_8029AE48(); + func_80297970(0.0f); + func_8028A3B8(1.0f, 1.0f); + D_8037D3EC = 2; + } + case 2: + break; + }//L802AC850 + + if(func_8028B2E8()){ + if(func_8029B300() > 0 || (D_8037D3EC == 2 && animctrl_isStopped(aCtrl))){ + if(miscflag_isTrue(0x19)){ + next_state = func_80292738(); + }else{ + next_state = BS_5E_CROC_IDLE; + } + } + }//L802AC8B4 + + bs_setState(next_state); +} + +void bscroc_fall_end(void){ + func_802ABFBC(); +} + +static void __bscroc_recoil_init(s32 damage){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp38; + f32 sp2C[3]; + f32 sp20[3]; + + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, 0x11d); + animctrl_setDuration(aCtrl, 1.0f); + animctrl_setSubRange(aCtrl, 0.0f, 0.7518f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bscroc.c", 0x2a5); + if(damage == 1) + func_8030E58C(SFX_38_BANJO_AYE_1, 1.8f); + else + func_8030E58C(SFX_56_BANJO_HUI, 1.8f); + + _player_getPosition(&sp2C); + func_80294980(&sp20); + func_80257F18(&sp20, &sp2C, &sp38); + yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f)); + yaw_applyIdeal(); + func_80297970(200.0f); + func_8029797C(sp38); + func_802979AC(sp38, func_80297A64()); + func_8029C7F4(1,1,2,3); + player_setYVelocity(510.0f); + gravity_set(-1200.0f); + func_8028D5DC(); + func_80292E48(); + D_8037D3EC = 0; +} + +static void __bscroc_recoil_update(void){ + enum bs_e next_state = 0; + func_802ABE70(); + if(baanim_isAt(0.5f)) + func_80292EA4(); + + switch(D_8037D3EC){ + case 0: + if(func_8028B254(0x5A)){ + func_8028A37C(1.0f); + D_8037D3EC = 1; + } + break; + case 1: + break; + } + if(func_8028B2E8()) + next_state = BS_5E_CROC_IDLE; + + bs_setState(next_state); +} + +void __bscroc_recoil_end(void){ + func_80297CA8(); + gravity_reset(); + func_8028D5F4(); + func_80292EA4(); + func_802ABFBC(); +} + +void bscroc_ow_init(void){ + __bscroc_recoil_init(1); +} + +void bscroc_ow_update(void){ + __bscroc_recoil_update(); +} + +void bscroc_ow_end(void){ + __bscroc_recoil_end(); +} + +void bscroc_bounce_init(void){ + __bscroc_recoil_init(2); +} + +void bscroc_bounce_update(void){ + __bscroc_recoil_update(); +} + +void bscroc_bounce_end(void){ + __bscroc_recoil_end(); +} + +void bscroc_die_init(void){ + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + f32 sp38; + f32 sp2C[3]; + f32 sp20[3]; + + func_8029B930(); + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, FALSE); + animctrl_setIndex(aCtrl, 0x11e); + animctrl_setSubRange(aCtrl, 0.0f, 0.3966f); + animctrl_setDuration(aCtrl, 1.7f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bscroc.c", 0x32b); + func_8029C7F4(1,1,2,3); + _player_getPosition(&sp2C); + func_80294980(&sp20); + func_80257F18(&sp20, &sp2C, &sp38); + yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f)); + yaw_applyIdeal(); + D_8037D3E0 = 250.0f; + func_80297970(D_8037D3E0); + func_8029797C(sp38); + func_802979AC(sp38, func_80297A64()); + player_setYVelocity(420.0f); + gravity_set(-1200.0f); + pitch_setAngVel(1000.0f, 12.0f); + func_8028D5DC(); + func_80292E48(); + func_802914CC(0xd); + func_802BF2C0(30.0f); + func_8029C984(); + func_8030E58C(SFX_36_BANJO_DOH, 1.8f); + func_8029E3C0(0, 2.9f); + D_8037D3EC = 0; +} + +void bscroc_die_update(void){ + enum bs_e next_state = 0; + func_802ABE70(); + func_80297970(D_8037D3E0); + func_80299628(0); + switch(D_8037D3EC){ + case 0: + if(func_8028B2E8()){ + func_8028A37C(0.7453f); + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); + FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000); + player_setYVelocity(400.0f); + D_8037D3EC = 1; + } + break; + case 1: + if(func_8028B2E8()){ + func_8028A37C(1.0f); + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); + FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000); + D_8037D3EC = 2; + } + break; + case 2: + D_8037D3EC = 3; + break; + case 3: + if(0.0f < D_8037D3E0) + D_8037D3E0 = max_f(0.0f, D_8037D3E0 - 10.0f); + break; + }//L802ACECC + + if(func_8029E1A8(0)) + func_8029B890(); + + bs_setState(next_state); +} + +void bscroc_die_end(void){ + func_8024BD08(0); + gravity_reset(); + pitch_setIdeal(0.0f); + roll_setIdeal(0.0f); + func_80291548(); + func_80292EA4(); +} + +int bscroc_hitboxActive(void){ + return _bscrocHitboxActive; +} + +static void func_802ACF58(void){ + f32 sp2C; + f32 sp20[3]; + sp2C = func_8028B2E8() ? 500.0f : 400.0f; + func_802589E4(&sp20, yaw_get(), sp2C); + sp20[1] = 200.0f; + func_80297A0C(&sp20); +} + +void bscroc_bite_init(void){ + func_8028A100(0x122, 0.25f, 0.2f); + func_8029C7F4(1,1,1,3); + func_802ACF58(); + D_8037D3F4 = 0; + _bscrocHitboxActive = TRUE; +} + +void bscroc_bite_update(void){ + enum bs_e next_state = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + func_802ABE70(); + func_80299628(0); + if(animctrl_isAt(aCtrl, 0.99f)){ + switch(++D_8037D3F4){ + case 1: + func_802ACF58(); + animctrl_setDuration(aCtrl, 0.28f); + break; + case 2: + func_802ACF58(); + animctrl_setDuration(aCtrl, 0.32f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + break; + } + } + if(animctrl_isAt(aCtrl, 0.6f)){ + func_8030EB00(SFX_6D_CROC_BITE, 1.0f, 1.1f); + } + + if(D_8037D3F4 == 3){ + if(func_8028B094()) + next_state = BS_61_CROC_FALL; + else + next_state = BS_CROC_WALK; + } + + if(func_8028B2E8() && button_pressed(BUTTON_A)) + next_state = BS_CROC_JUMP; + + bs_setState(next_state); +} + +void bscroc_bite_end(void){ + _bscrocHitboxActive = FALSE; + func_802ABFBC(); +} + +void bscroc_eat_bad_init(void){ + func_8028A180(0x123, 2.41f); + func_8029C7F4(1,1,2,3); + func_80297970(0.0f); +} + +void bscroc_eat_bad_update(void){ + enum bs_e next_state = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + func_802ABE70(); + func_80299628(0); + if(animctrl_isAt(aCtrl, 0.3518f)){ + func_8030E58C(SFX_A0_COUGHING, 0.9f); + } + + if(animctrl_isAt(aCtrl, 0.5282f)){ + func_8030E58C(SFX_A0_COUGHING, 0.85f); + } + + if(animctrl_isAt(aCtrl, 0.6671f)){ + func_8030E484(SFX_C6_SHAKING_MOUTH); + } + + if(animctrl_isStopped(aCtrl)){ + next_state = BS_5E_CROC_IDLE; + } + + bs_setState(next_state); +} + +void bscroc_eat_bad_end(void){ + func_802ABFBC(); +} + + +void func_802AD2A8(Gfx **gdl, Mtx **mPtr, void *arg2){ + f32 sp34[3]; + f32 sp28[3]; + + player_getRotation(&sp34); + func_8028E9C4(2, &sp28); + set_model_render_mode(1); + func_803391A4(gdl, mPtr, &sp28, &sp34, D_8037D3F0, NULL, D_8037D3E8); + +} + +void func_802AD318(void){ + D_8037D3F5 = 1; +} + +void bscroc_eat_good_init(void){ + func_8028A010(0x122, 0.25f); + func_8029C7F4(1,1,1,2); + func_80292188(func_802AD2A8); + D_8037D3E8 = assetcache_get(func_80294974()); + D_8037D3F0 = 1.0f; + D_8037D3F5 = 0; + D_8037D3F4 = 0; +} + +int func_802AD3A0(void){ + return D_8037D3F5; +} + +void bscroc_eat_good_update(void){ + enum bs_e next_state = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + func_802ABE70(); + D_8037D3F0 = max_f(0.1f, D_8037D3F0 - 0.05); + func_80299628(0); + func_802ABF54(); + if(animctrl_isAt(aCtrl, 0.99f)){ + switch(++D_8037D3F4){ + case 1: + animctrl_setDuration(aCtrl, 0.28f); + break; + case 2: + animctrl_setDuration(aCtrl, 0.32f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + break; + case 3: + if(D_8037D3F5) + next_state = BS_CROC_EAT_BAD; + else + next_state = BS_5E_CROC_IDLE; + break; + } + }//L802AD4B0 + + if(animctrl_isAt(aCtrl, 0.62f)) + func_8030EB00(SFX_4C_LIP_SMACK, 1.2f, 1.3f); + + if(D_8037D3F4 == 2 && animctrl_isAt(aCtrl, 0.9)) + func_8030EB00(SFX_AE_YUMYUM_TALKING, 1.45f, 1.55f); + + bs_setState(next_state); +} + +void bscroc_eat_good_end(void){ + D_8037D3F5 = 0; + assetcache_release(D_8037D3E8); + func_80292188(0); + func_802ABFBC(); +} + +void func_802AD56C(void){ + func_8028A010(0xe1, 1.0f); + func_8029C7F4(1,1,3,2); + func_80297970(0.0f); + func_8029C674(); + func_802B3A50(); +} + +void func_802AD5C0(void){ + enum bs_e next_state = 0; + func_802ABE70(); + func_802B3A50(); + func_80299628(0); + func_8029C6D0(); + if(!func_80298850()){ + next_state = BS_5E_CROC_IDLE; + } + + bs_setState(next_state); +} + +void func_802AD614(void){ + pitch_setIdeal(0.0f); + roll_setIdeal(0.0f); + func_8029C748(); + func_802ABFBC(); +} + +void bscroc_drone_init(void){ + bsdrone_init(); +} + +void bscroc_drone_update(void){ + func_802ABE70(); + bsdrone_update(); +} + +void bscroc_drone_end(void){ + bsdrone_end(); + func_802ABFBC(); +} \ No newline at end of file diff --git a/src/core2/bs/crouch.c b/src/core2/bs/crouch.c new file mode 100644 index 00000000..66596377 --- /dev/null +++ b/src/core2/bs/crouch.c @@ -0,0 +1,208 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +f32 D_8037D400; +u8 D_8037D404; + +/* .code */ +enum bs_e func_802ADCD4(enum bs_e arg0); + +void func_802AD6D0(void){ + func_8028A010(ANIM_BANJO_CROUCH, 0.5f); + D_8037D404 = 4; +} + +void func_802AD6FC(void){ + func_8028A180(ANIM_BANJO_CROUCH_NOINPUT, 2.0f); + D_8037D404 = 2; +} + +void func_802AD728(void){ + func_8028A1F4(ANIM_BANJO_CROUCH, 0.5f, 0.9999f); + func_8029E3C0(2, 2.0f); + D_8037D404 = 1; +} + +void func_802AD768(AnimCtrl *aCtrl, f32 arg1){ + animctrl_setDuration(aCtrl, ml_map_f(arg1, 0.0f, 180.0f, 0.5, 0.2f)); +} + +void func_802AD7B0(AnimCtrl *aCtrl){ + func_8029AD28(0.41f, 4); + func_8029AD28(0.91f, 3); +} + +void bscrouch_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp28[3]; + f32 sp24; + f32 sp20; + + switch(bs_getPrevState()){ + case BS_9_EGG_HEAD: + case BS_A_EGG_ASS: + case BS_1A_WONDERWING_ENTER: + sp24 = 0.5357f; + break; + default: + sp24 = 0.0f; + break; + } + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_BANJO_CROUCH_ENTER); + animctrl_setDuration(aCtrl, 0.5f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_8028774C(aCtrl, sp24); + func_802875AC(aCtrl, "bscrouch.c", 0xa0); + func_80289F10(1); + func_802991A8(3); + func_80299234(350.0f, 14.0f); + func_8029957C(7); + func_8029932C(8.0f); + func_802978DC(3); + func_8029E3C0(0, 0.7f); + func_8029E3C0(1, 0.2f); + _get_velocity(&sp28); + D_8037D400 = gu_sqrtf(sp28[0]*sp28[0] + sp28[2]*sp28[2]); + if(140.0f < D_8037D400) + func_80299AAC(); + + if(func_8025801C(sp28, &sp20)) + func_8029797C(sp20); + + D_8037D404 = 0; +} + +void bscrouch_update(void){ + enum bs_e sp34 = 0; + f32 sp30; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); //sp2C + f32 temp_f2; + f32 pad; + f32 sp20; + + func_8029E1A8(0); + func_8029E1A8(1); + + sp30 = ml_map_f(func_8029E270(0), 0.0f, 0.3f, 0.0f, D_8037D400); + func_80297970(sp30); + if(220.0f < sp30) + func_802929F8(); + if(160.0f < sp30) + func_80299AAC(); + sp20 = yaw_getIdeal(); + temp_f2 = mlAbsF(mlDiffDegF(sp20, yaw_get())); + + switch(D_8037D404){ + case 0://802ADA64 + if(sp30 != 0.0f) + break; + func_8029E3C0(2, 2.0f); + D_8037D404 = 1; + break; + + case 1: //802ADA98 + if(temp_f2 != 0.0f){ + func_802AD6D0(); + } + else{ + func_8029E1A8(2); + if(func_8029E384(2)) + func_802AD6FC(); + } + break; + + case 2: //802ADAE8 + if(temp_f2 != 0.0f){ + func_802AD6D0(); + }else{ + if(animctrl_isStopped(aCtrl)) + func_802AD728(); + } + break; + + case 4: //802ADB30 + func_802AD768(aCtrl,temp_f2); + func_802AD7B0(aCtrl); + + if(temp_f2 != 0.0f) + break; + + if((f64)animctrl_getAnimTimer(aCtrl) <= 0.5){ + animctrl_setSubRange(aCtrl, 0.0f, 0.5f); + }else{ + animctrl_setSubRange(aCtrl, 0.0f, 1.0f); + } + animctrl_setPlaybackType(aCtrl,1); + D_8037D404 = 3; + break; + + case 3://802ADBCC + func_802AD768(aCtrl, temp_f2); + func_802AD7B0(aCtrl); + if(temp_f2 != 0.0f){ + animctrl_setSubRange(aCtrl, 0.0f, 1.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_LOOP); + D_8037D404 = 4; + }else{ + if(animctrl_isStopped(aCtrl)){ + yaw_setIdeal(yaw_get()); + func_802AD728(); + } + } + break; + }//L802ADC50 + + if(player_isSliding()) + sp34 = BS_SLIDE; + + if(func_8028B094()) + sp34 = BS_2F_FALL; + + sp34 = func_802ADCD4(sp34); + if(sp34 == BS_1_IDLE && func_8029E348(1)) + sp34 = 0; + + if(player_inWater()) + sp34 = BS_2D_SWIM_IDLE; + + bs_setState(sp34); +}//*/ + +void bscrouch_end(void){} + +enum bs_e func_802ADCD4(enum bs_e arg0){ + if(button_released(BUTTON_Z)){ + arg0 = BS_1_IDLE; + + if(button_pressed(BUTTON_B) && can_claw()) + arg0 = BS_CLAW; + + if(button_pressed(BUTTON_A)) + arg0 = func_8029C780(); + + }else{ + if(should_wonderwing()) + func_80346C10(&arg0, -1, BS_1A_WONDERWING_ENTER, ITEM_10_GOLD_FEATHER, 1); + + if(should_trot()) + arg0 = BS_14_BTROT_ENTER; + + if(should_poop_egg()) + func_80346C10(&arg0, -1, BS_A_EGG_ASS, ITEM_D_EGGS, 0); + + if(should_shoot_egg()) + func_80346C10(&arg0, -1, BS_9_EGG_HEAD, ITEM_D_EGGS, 0); + + if(should_flip()) + arg0 = BS_12_BFLIP; + + if(should_beak_barge()) + arg0 = BS_BBARGE; + + + } + return arg0; +} diff --git a/src/core2/bs/die.c b/src/core2/bs/die.c new file mode 100644 index 00000000..5ebf07ce --- /dev/null +++ b/src/core2/bs/die.c @@ -0,0 +1,132 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +f32 D_8037D410; +s32 D_8037D414; + +/* .code */ +int _bsdie_802ADE00(void){ + return func_8028B2E8(); +} + +void _bsdie_802ADE20(void){ + f32 i; + + for(i = 0.0f; i < 360.0f; i += 45.0f){ + func_80292900(i, 230.0f); + } +} + +void bsdie_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp38; + f32 sp2C[3]; + f32 sp20[3]; + + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, 0); + animctrl_setIndex(aCtrl, ASSET_9_ANIM_BANJO_DIE); + animctrl_setSubRange(aCtrl, 0.0f, 0.3356f); + animctrl_setDuration(aCtrl, 2.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsdie.c", 0x7e); + func_8029B930(); + func_8030E58C(SFX_36_BANJO_DOH, 1.0f); + _player_getPosition(sp2C); + func_80294980(sp20); + func_80257F18(sp20, sp2C, &sp38); + D_8037D410 = 250.0f; + yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f)); + yaw_applyIdeal(); + func_80297970(D_8037D410); + func_8029797C(sp38); + func_802979AC(sp38, func_80297A64()); + func_80289F10(1); + func_802991A8(1); + func_8029957C(2); + func_802978DC(3); + player_setYVelocity(510.0f); + gravity_set(-1400.0f); + pitch_setAngVel(1000.0f, 12.0f); + func_8029E070(1); + func_8029151C(0xd); + func_802BF2C0(30.0f); + func_8029C984(); + func_8029E3C0(0,2.9f); + D_8037D414 = 0; + func_8028D5DC(); + func_80292E48(); +} + +void bsdie_update(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + enum bs_e sp28 = 0; + func_80297970(D_8037D410); + func_80299628(0); + switch(D_8037D414){ + case 0://L802AE0B8 + if(_bsdie_802ADE00()){ + animctrl_setSubRange(aCtrl, 0.0f, 1.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + player_setYVelocity(400.0f); + func_80299DB8(); + FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.0f, 18000); + func_80250D94(1.0f, 1.0f, 0.4f); + _bsdie_802ADE20(); + D_8037D414 = 1; + } + break; + case 1://L802AE134 + if(_bsdie_802ADE00()){ + func_80299E00(); + FUNC_8030E624(SFX_38_BANJO_AYE_1, 1.0f, 18000); + func_80250D94(1.0f, 0.5f, 0.4f); + D_8037D414 = 2; + } + break; + case 2://L802AE184 + D_8037D410 = max_f(D_8037D410 - 12.0f, 0.0f); + if(140.0f < D_8037D410) + func_802929F8(); + + if(animctrl_isAt(aCtrl, 0.6538f)) + animctrl_setDuration(aCtrl, 4.0f); + + if(animctrl_isStopped(aCtrl)){ + D_8037D410 = 0.0f; + D_8037D414 = 3; + } + break; + case 3: + break; + }//L802AE218 + if(func_8029E1A8(0)) + func_8029B890(); + + if( func_8029E270(0) != 0.0f + && func_80294574() + && ( D_8037D414 + || ( animctrl_isStopped(aCtrl) + && ( player_getYPosition() < (func_80294500() - 150.0f)) + ) + ) + && player_inWater() + && 100.0f < (func_80294500() - func_80294438()) + ){ + sp28 = BS_54_SWIM_DIE; + } + + bs_setState(sp28); +} + +void bsdie_end(void){ + func_8024BD08(0); + gravity_reset(); + func_8029E070(0); + pitch_setIdeal(0.0f); + roll_setIdeal(0.0f); + func_80291548(); + func_80292EA4(); +} diff --git a/src/core2/bs/drone.c b/src/core2/bs/drone.c new file mode 100644 index 00000000..cd24e66f --- /dev/null +++ b/src/core2/bs/drone.c @@ -0,0 +1,49 @@ +#include +#include "functions.h" +#include "variables.h" +#include "bsint.h" + +typedef struct{ + u8 unk0; + bsState behavior; +} struct_drone; + +struct_drone D_80364B30[] = { + {01, {func_802AEDE8, func_802AEE48, func_802AEE9C, NULL}}, + {02, {func_802AEEF4, func_802AEFB0, func_802AF164, func_80296608}}, + {04, {bsdronexform_init, bsdronexform_update, bsdronexform_end, bsdronexform_interrupt}}, + {05, {func_802AE9C8, func_802AEA2C, func_802AEB24, NULL}}, + {06, {func_802AF604, func_802AF668, func_802AF768, NULL}}, + {0} +}; + + + +static int __bsdrone_getIndex(void){ + int i; + int val = func_802925EC(); + for(i = 0; D_80364B30[i].unk0 != 0; i++){ + if(val == D_80364B30[i].unk0) + return i; + } + return 0; +} + +void bsdrone_init(void){ + D_80364B30[__bsdrone_getIndex()].behavior.init_func(); +} + +void bsdrone_update(void){ + D_80364B30[__bsdrone_getIndex()].behavior.update_func(); +} + +void bsdrone_end(void){ + D_80364B30[__bsdrone_getIndex()].behavior.end_func(); +} + +void bsdrone_interrupt(void){ + void (* tmp)(void) = D_80364B30[__bsdrone_getIndex()].behavior.interrupt_func; + if(tmp){ + tmp(); + } +} diff --git a/src/core2/bs/dronegoto.c b/src/core2/bs/dronegoto.c new file mode 100644 index 00000000..d31f83e2 --- /dev/null +++ b/src/core2/bs/dronegoto.c @@ -0,0 +1,115 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80297BB8(f32); + +/* .bss */ +u8 D_8037D440; +u8 D_8037D441; + +void func_802AEC08(void); +void func_802AEC70(void); +void func_802AEC78(void); +void func_802AEDC8(void); + +void func_802AEB60(s32 arg0){ + switch(D_8037D440){ + case 1: + func_802AEC70(); + break; + case 2: + func_802AEDC8(); + break; + } + switch(D_8037D440 = arg0){ + case 1: + func_802AEC08(); + break; + case 2: + func_802AEC78(); + break; + } + +} + +void func_802AEC08(void){ + func_802978A4(); +} + +void func_802AEC28(void){ + func_802978A4(); + if(func_8028B2E8() || player_inWater()) + func_802AEB60(2); +} + +void func_802AEC70(void){} + +void func_802AEC78(void){ + f32 sp2C; + f32 sp20[3]; + s32 sp1C; + func_8029BC60(&sp1C, &sp2C); + func_8028A010(sp1C, sp2C); + func_802925F8(&sp20, &sp2C); + func_80297BC4(&sp20); + func_80297BB8(sp2C); + func_8029C7F4(1,1,3,0xC); + func_8029436C(1); + D_8037D441 = 0; +} + +void func_802AECE4(void){ + f32 sp2C; + f32 sp20[3]; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + _get_velocity(&sp20); + if(func_8025801C(sp20, &sp2C)){ + yaw_setIdeal(sp2C); + } + + if( 250.0f <= gu_sqrtf(sp20[0]*sp20[0] + sp20[2]*sp20[2]) + && animctrl_getIndex(aCtrl) == ANIM_BANJO_WALK + ){ + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_BANJO_RUN); + func_802875AC(aCtrl, "bsdronegoto.c", 0x9d); + } + + if(func_80297C48() && D_8037D441 == 0){ + D_8037D441++; + func_80292768(); + } +} + +void func_802AEDC8(void){ + func_8029436C(0); +} + +void func_802AEDE8(void){ + D_8037D440 = 0; + func_8031F9F4(1); + if( !func_8028B2E8() && func_8029BDE8()){ + func_802AEB60(1); + }else{ + func_802AEB60(2); + } + +} + +void func_802AEE48(void){ + switch(D_8037D440){ + case 1: + func_802AEC28(); + break; + case 2: + func_802AECE4(); + break; + } +} + +void func_802AEE9C(void){ + func_802AEB60(0); + func_8031F9F4(0); +} diff --git a/src/core2/bs/dronexform.c b/src/core2/bs/dronexform.c new file mode 100644 index 00000000..52d5d75d --- /dev/null +++ b/src/core2/bs/dronexform.c @@ -0,0 +1,426 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void player_setYPosition(f32); +extern void yaw_applyIdeal(void); +extern void func_802978DC(int); +extern f32 func_80257A44(f32, f32); +extern f32 cosf(f32); +extern f32 func_802588B0(f32, f32); +extern f32 func_80257AD4(f32, f32); + + +extern struct41s D_80364BB0; +extern struct41s D_80364BE0; +extern struct41s D_80364C10; +extern struct41s D_80364C40; +extern struct41s D_80364C70; +extern struct41s D_80364CA0; + +/* .bss */ +struct { + ParticleEmitter *unk0; + ParticleEmitter *unk4; + f32 unk8; + f32 unkC; + f32 unk10; + f32 unk14; + f32 unk18; + u8 unk1C; + u8 pad1D[0x3]; + f32 unk20; + f32 unk24; + f32 unk28; + f32 unk2C; + u8 unk30; + u8 unk31; //enum bs_e + u8 unk32; +} D_8037D470; + +/* .code */ +void func_802AF7A0(ParticleEmitter *arg0, enum asset_e arg1){ + func_802F0D54(arg0); + particleEmitter_setSprite(arg0, arg1); + particleEmitter_setParticleAccelerationRange(arg0, 0.0f, -50.0f, 0.0f, 0.0f, -50.0f, 0.0f); + func_802EFA5C(arg0, 0.4f, 0.8f); + func_802EFB84(arg0, 0.03f, 0.03f); + func_802EFE24(arg0, 0.0f, 0.0f, 300.0f, 0.0f, 0.0f, 300.0f); + func_802EFEC0(arg0, 0.65f, 0.65f); + func_802EFF50(arg0, 1.0f); +} + +void func_802AF88C(Actor * arg0, f32 arg1, f32 arg2){ + particleEmitter_setParticleVelocityRange(arg0, arg1*30.0f, 10.0f, arg2*30.0f, arg1*30.0f, 10.0f, arg2*30.0f); + func_802EFB70(arg0, D_8037D470.unk14, D_8037D470.unk14); +} + +void func_802AF900(void){ + f32 sp4C; + f32 sp48; + f32 sp44; + f32 sp40; + f32 sp3C; + f32 sp30[3]; + + player_getPosition(&sp30); + sp3C = D_8037D470.unk8; + sp48 = func_80257A44(sp3C, 0.38f); + sp4C = sp48 * 6.283185308; + sp40 = sinf(sp4C); + sp44 = cosf(sp4C); + sp30[0] += sp40 * D_8037D470.unk18; + sp30[1] += func_80257C48(func_80257A44(sp3C, 1.14f), 0.0f, 130.0f); + sp30[2] += sp44 * D_8037D470.unk18; + func_802AF88C(D_8037D470.unk4, sp40, sp44); + particleEmitter_setPosition(D_8037D470.unk4, &sp30); + particleEmitter_emitN(D_8037D470.unk4, 1); + + player_getPosition(&sp30); + sp4C = (1.0 - func_802588B0(sp48 + 0.5, 1.0f))* 6.283185308; + sp30[0] -= sinf(sp4C) * D_8037D470.unk18; + sp30[1] += func_80257C48(func_80257A44(sp3C, 1.14f), 130.0f, 0.0f); + sp30[2] -= cosf(sp4C) * D_8037D470.unk18; + func_802AF88C(D_8037D470.unk0, sp40, sp44); + particleEmitter_setPosition(D_8037D470.unk0, &sp30); + particleEmitter_emitN(D_8037D470.unk0, 1); +} + +void func_802AFADC(void){ + func_802F0C78(D_8037D470.unk4); + func_802F0C78(D_8037D470.unk0); +} + +void func_802AFB0C(void){ + D_8037D470.unk0 = partEmitList_pushNew(0x32); + func_802AF7A0(D_8037D470.unk0, ASSET_476_SPRITE_BLUE_GLOW); //blue glow + + D_8037D470.unk4 = partEmitList_pushNew(0x32); + func_802AF7A0(D_8037D470.unk4, ASSET_477_SPRITE_YELLOW_GLOW); //orange glow + + D_8037D470.unkC = 1.0f; + D_8037D470.unk10 = 0.0f; + D_8037D470.unk8 = 0.0f; + D_8037D470.unk18 = 55.0f; + D_8037D470.unk14 = 0.35f; + D_8037D470.unk1C = 0; +} + +void func_802AFB94(f32 arg0){ + D_8037D470.unkC = arg0; +} + +void func_802AFBA0(f32 arg0){ + D_8037D470.unk18 = arg0; +} + +void func_802AFBAC(f32 arg0){ + D_8037D470.unk14 = arg0; +} + +void func_802AFBB8(f32 (* arg0)[3]){ + ParticleEmitter* s0 = partEmitList_pushNew(1); + particleEmitter_setSprite(s0, ASSET_6C4_SPRITE_SMOKE_YELLOW); //yellow blast + func_802EFA5C(s0, 0.7f, 0.8f); + particleEmitter_setParticleFramerateRange(s0, 12.0f, 12.0f); + particleEmitter_setPosition(s0, arg0); + func_802EFB70(s0, 3.2f, 3.2f); + func_802EFB84(s0, 3.2f, 3.2f); + func_802EFEC0(s0, 0.8f, 0.8f); + particleEmitter_emitN(s0, 1); + + s0 = partEmitList_pushNew(1); + particleEmitter_setSprite(s0, ASSET_6C2_SPRITE_SMOKE_WHITE); //smoke + func_802EFA5C(s0, 0.1f, 0.8f); + particleEmitter_setParticleFramerateRange(s0, 15.0f, 15.0f); + particleEmitter_setPosition(s0, arg0); + func_802EFB70(s0, 3.0f, 3.0f); + func_802EFB84(s0, 3.0f, 3.0f); + func_802EFEC0(s0, 0.65f, 0.65f); + particleEmitter_emitN(s0, 1); + + s0 = partEmitList_pushNew(0x11); + particleEmitter_setSprite(s0, ASSET_713_SPRITE_SPARKLE_YELLOW); //sparkle + particleEmitter_setVelocityAndAccelerationRanges(s0, &D_80364BB0); + func_802EFA5C(s0, 0.0f, 0.6f); + func_802EFB70(s0, 0.28f, 0.32f); + func_802EFB84(s0, 0.03f, 0.03f); + func_802EFE24(s0, 0.0f, 0.0f, 300.0f, 0.0f, 0.0f, 300.0f); + func_802EFEC0(s0, 2.0f, 2.0f); + func_802EFF50(s0, 1.0f); + particleEmitter_setPosition(s0, arg0); + particleEmitter_emitN(s0, 8); + + particleEmitter_setVelocityAndAccelerationRanges(s0, &D_80364BE0); + particleEmitter_emitN(s0, 5); + + particleEmitter_setVelocityAndAccelerationRanges(s0, &D_80364C10); + func_802EF9F8(s0, 0.4f); + func_802EFA18(s0, 3); + particleEmitter_emitN(s0, 4); + + s0 = partEmitList_pushNew(0x11); + particleEmitter_setSprite(s0, ASSET_716_SPRITE_SPARKLE_WHITE); //sparkle + particleEmitter_setVelocityAndAccelerationRanges(s0, &D_80364C40); + func_802EFA5C(s0, 0.0f, 0.6f); + func_802EFB70(s0, 0.28f, 0.32f); + func_802EFB84(s0, 0.03f, 0.03f); + func_802EFE24(s0, 0.0f, 0.0f, 300.0f, 0.0f, 0.0f, 300.0f); + func_802EFEC0(s0, 2.0f, 2.0f); + func_802EFF50(s0, 1.0f); + particleEmitter_setPosition(s0, arg0); + particleEmitter_emitN(s0, 8); + + particleEmitter_setVelocityAndAccelerationRanges(s0, &D_80364C70); + particleEmitter_emitN(s0, 5); + + particleEmitter_setVelocityAndAccelerationRanges(s0, &D_80364CA0); + func_802EF9F8(s0, 0.4f); + func_802EFA18(s0, 3); + particleEmitter_emitN(s0, 4); +} + +void func_802AFFAC(void){ + D_8037D470.unk10 -= time_getDelta(); + while(D_8037D470.unk10 < 0.0f){ + func_802AF900(); + D_8037D470.unk8 += 0.017 * D_8037D470.unkC; + D_8037D470.unk10 += 0.017; + } +} + +void func_802B0060(UNK_TYPE(s32) arg0, UNK_TYPE(s32) arg1){ + f32 sp4C[3]; + int i; + + for(i = 0; i < 3; i++){ + sp4C[i] = func_80257AD4(D_8037D470.unk20 + ((f32)i/3.0)*0.5, 0.5f)*(D_8037D470.unk24*D_8037D470.unk28) + D_8037D470.unk24; + } + func_8033A928(arg0, 3, sp4C); +} + + +void func_802B014C(void){ + func_80289EBC(NULL); +} + +void func_802B016C(void){ + D_8037D470.unk20 = 0.0f; + D_8037D470.unk28 = 0.0f; + D_8037D470.unk24 = 1.0f; + func_80289EBC(func_802B0060); +} + +void func_802B01B0(f32 arg0){ + D_8037D470.unk28 = arg0; +} + +void func_802B01BC(f32 arg0){ + D_8037D470.unk24 = arg0; +} + +void func_802B01C8(void){ + D_8037D470.unk20 += time_getDelta(); +} + +static void __bsdronexform_setState(int arg0){ + enum asset_e sp34; + f32 sp30; + f32 sp24[3]; + + D_8037D470.unk32 = arg0; + switch(arg0){ + case 1:// 802B0230 + D_8037D470.unk1C = 1; + D_8037D470.unk2C = player_getYPosition(); + func_802AFB94(0.28f); + func_802AFBA0(180.0f); + func_802AFBAC(0.04f); + func_802B01B0(0.05f); + func_802978DC(7); + func_8029E3C0(0, 2.8f); + FUNC_8030E624(SFX_17E_MUMBO_TRANSFORMATION_01, 1.0f, 15000); + break; + + case 2:// 802B02A8 + func_8029E3C0(0, 0.5f); + func_802978DC(0xb); + break; + + case 3:// 802B02C4 + func_8029E3C0(0, 0.05f); + break; + + case 4:// 802B02DC + func_8029E3C0(0, 0.8f); + break; + + case 5:// 802B02F4 + _player_getPosition(&sp24); + sp24[1] += 30.0f; + func_8024E3A8(&sp24, 80.0f); + func_802AFBB8(&sp24); + func_8029E3C0(0, 0.1f); + break; + + case 6: // 802B033C + func_802BB3DC(2, 80.0f, 0.85f); + func_8030E6D4(SFX_147_GRUNTY_SPELL_ATTACK_2); + if(D_8037D470.unk30 == 7 || D_8037D470.unk31 == 7){ + yaw_setIdeal(yaw_get() + 180.0f); + yaw_applyIdeal(); + } + func_8029A95C(func_80294A4C()); //set player transformation + func_80291D04(); //update player model + func_8029BD44(&sp34, &sp30); + func_8028A010(sp34, sp30); + func_8029E3C0(0, 0.1f); + break; + + case 7: // 802B03E4 + func_8029E3C0(0, 0.8f); + break; + + case 8: // 802B03FC + if(D_8037D470.unk30 == 1 && D_8037D470.unk31 == 1){ + func_8025A6EC(COMUSIC_3C_MINIGAME_LOSS, 28000); + } + func_8029E3C0(0, 1.0f); + break; + + case 9:// 802B0438 + D_8037D470.unk1C = 0; + func_8029E3C0(0, 0.7f); + func_802978DC(7); + break; + } +} + +void bsdronexform_init(void){ + f32 sp1C; + enum asset_e sp18; + func_8029BCAC(&sp18, &sp1C); + func_8028A010(sp18, sp1C); + func_8029C7F4(1,1,3,7); + func_80297A0C(0); + func_80297930(0); + pitch_setIdeal(0.0f); + roll_setIdeal(0.0f); + func_80294378(6); + func_802AFB0C(); + func_802B016C(); + D_8037D470.unk31 = _player_getTransformation(); + D_8037D470.unk30 = func_80294A4C(); + miscflag_set(MISC_FLAG_1B_TRANSFORMING); + D_8037D470.unk32 = 0; + __bsdronexform_setState(1); +} + +f32 func_802B051C(s32 arg0, f32 arg1, f32 arg2, f32 arg3){ + return ml_map_f(func_8029E270(arg0), arg1, 0.0f, arg2, arg3); +} + +void bsdronexform_update(void){ + int sp24; + if(D_8037D470.unk1C) + func_802AFFAC(); + + func_802B01C8(); + switch(D_8037D470.unk32){ + case 1: + sp24 = func_8029E1A8(0); + player_setYPosition(func_802B051C(0, 2.8f, 0.0f, 90.0f) + D_8037D470.unk2C); + func_802AFB94(func_802B051C(0, 2.8f, 0.28f, 1.0f)); + func_802AFBA0(func_802B051C(0, 2.8f, 180.0f, 55.0f)); + func_802AFBAC(func_802B051C(0, 2.8f, 0.04f, 0.35f)); + func_802B01BC(func_802B051C(0, 2.8f, 1.0f, 0.8f)); + func_802B01B0(func_802B051C(0, 2.8f, 0.05f, 0.4f)); + func_8031B990( + (s32)func_802B051C(0, 2.8f, 255.0f, 200.0f), + (s32)func_802B051C(0, 2.8f, 255.0f, 80.0f), + (s32)func_802B051C(0, 2.8f, 255.0f, 80.0f) + ); + + if(sp24) + __bsdronexform_setState(2); + + break; + + case 2: + sp24 = func_8029E1A8(0); + func_802B01B0(func_802B051C(0, 0.5f, 0.4f, 0.6f)); + if(sp24) + __bsdronexform_setState(3); + break; + + case 3: + sp24 = func_8029E1A8(0); + func_802B01BC(func_802B051C(0, 0.05f, 0.8f, 1.2f)); + if(sp24) + __bsdronexform_setState(4); + break; + + case 4: + sp24 = func_8029E1A8(0); + func_802B01BC(func_802B051C(0, 0.8f, 1.2f, 0.09f)); + if(sp24) + __bsdronexform_setState(5); + break; + + case 5: + sp24 = func_8029E1A8(0); + if(sp24) + __bsdronexform_setState(6); + break; + + case 6: + sp24 = func_8029E1A8(0); + if(sp24) + __bsdronexform_setState(7); + break; + + case 7: + sp24 = func_8029E1A8(0); + func_802B01BC(func_802B051C(0, 0.8f, 0.09f, 1.0f)); + if(sp24) + __bsdronexform_setState(8); + break; + + case 8: + func_802AFBAC(func_802B051C(0, 1.0f, 0.35f, 0.03f)); + func_802B01B0(func_802B051C(0, 1.0f, 0.6f, 0.05f)); + func_8031B990( + (s32)func_802B051C(0, 1.0f, 200.0f, 255.0f), + (s32)func_802B051C(0, 1.0f, 80.0f, 255.0f), + (s32)func_802B051C(0, 1.0f, 80.0f, 255.0f) + ); + if(func_8029E1A8(0)){ + if(player_getTransformation() == TRANSFORM_7_WISHWASHY){ + bs_setState(0x33); + }else{ + __bsdronexform_setState(9); + } + } + break; + + case 9: + sp24 = func_8029E1A8(0); + player_setYPosition(func_802B051C(0, 0.7f, 90.0f, 0.0f) + D_8037D470.unk2C); + if(sp24) + bs_setState(bs_getIdleState()); + break; + // 802B08AC 8 + // 802B09A4 9 + } +} + +void bsdronexform_end(void){ + func_80294378(1); + func_8031B990(0xff,0xff,0xff); + func_802AFADC(); + func_802B014C(); + func_80298A64(); + miscflag_clear(MISC_FLAG_1B_TRANSFORMING); +} + +void bsdronexform_interrupt(void){}; \ No newline at end of file diff --git a/src/core2/bs/jig.c b/src/core2/bs/jig.c new file mode 100644 index 00000000..7f11e4c3 --- /dev/null +++ b/src/core2/bs/jig.c @@ -0,0 +1,196 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +u8 D_8037D4B0; +u8 D_8037D4B1; +u8 D_8037D4B2; +ActorMarker *D_8037D4B4; + +/* .code */ +int bsjig_inJiggyJig(enum bs_e state){ + return state == BS_44_JIG_JIGGY; +} + +void bsjig_setJiggyMarkerPtr(ActorMarker * jiggyMarkerPtr){ + D_8037D4B4 = jiggyMarkerPtr; +} + +void bsjig_jiggy_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + int tmp; + + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, FALSE); + animctrl_setIndex(aCtrl, ANIM_BANJO_BJIG_JIGGY); + animctrl_setDuration(aCtrl, 4.3f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsjig.c", 0x7f); + yaw_setIdeal(func_8029B41C()); //face camera + func_8029C7F4(1,1,3,2); + func_80297970(0.0f); + func_8024BD08(0); + func_8025A2FC(0,0xfa0); + tmp = (item_getCount(ITEM_E_JIGGY) == 9); + if(tmp == 0) //weird if... + tmp = 0; + D_8037D4B1 = tmp; + func_8025A6EC(COMUSIC_D_JINGLE_JIGGY_COLLECTED, -1); + func_8029151C(0xC); + func_8029E070(1); + func_8030E6D4(SFX_33_BANJO_AHOO); + miscflag_clear(7); + miscflag_clear(0xf); + func_8028D5DC(); + func_802C82C0(marker_getActor(D_8037D4B4), 1); + D_8037D4B0 = 0; +} + +void func_802B0BA8(void){ + if(D_8037D4B4){ + func_802C82C0(marker_getActor(D_8037D4B4), 4); + } +} + +void bsjig_jiggy_update(void){ + enum bs_e sp1C = 0; + AnimCtrl * aCtrl = _player_getAnimCtrlPtr(); + + yaw_setIdeal(func_8029B41C()); + + if(animctrl_isAt(aCtrl, 0.6502f)) + func_80299BD4(); + + if(animctrl_isAt(aCtrl, 0.835f)){ + D_8037D4B0++; + item_inc(ITEM_E_JIGGY); + func_8030E58C(SFX_4B_GULPING, 1.3f); + } + + if(animctrl_isAt(aCtrl, 0.94f)) + func_8030E484(0x3ea); + + if(animctrl_isStopped(aCtrl)){ + if(D_8037D4B1) + sp1C = BS_34_JIG_NOTEDOOR; + else + sp1C = BS_1_IDLE; + } + + func_80295C08(func_802B0BA8); + bs_setState(sp1C); +} + +void func_802B0CD8(void){ + if(D_8037D4B4){ + func_802C82C0(marker_getActor(D_8037D4B4), 5); + D_8037D4B4 = NULL; + } +} + +void bsjig_jiggy_end(void){ + s32 sp2C; + s32 sp28 = 4; + int sp24; + sp2C = 0; + sp24 = marker_getActor(D_8037D4B4)->unk38_31; + if(D_8037D4B0 == 0) + item_inc(ITEM_E_JIGGY); + + func_802B0CD8(); + func_8029E070(0); + func_80291548(); + + if(bs_getNextState() != BS_34_JIG_NOTEDOOR){ + func_8025A2FC(-1, 0xfa0); + func_8024BD08(1); + } + func_8028D5F4(); + if( jiggyscore_total() == 100 + && func_8031FF1C(BKPROG_FC_DEFEAT_GRUNTY) + && bs_getNextState() != BS_34_JIG_NOTEDOOR + ){ + func_8028F918(2); + func_802E4078(MAP_95_CS_END_ALL_100, 0, 1); + } else {//L802B0DFC + if( jiggyscore_total() == 2 + && map_get() == MAP_2_MM_MUMBOS_MOUNTAIN + ){ + sp2C = 0xb51; + sp28 = 0xe; + } + else{//L802B0E34 + switch(sp24){ + case 0x13: + sp2C = 0xa16; + break; + case 0x17: + if(!levelSpecificFlags_get(0) || !levelSpecificFlags_get(1)) + sp2C = 0xd2d; + break; + } + }//L802B0E88 + if(sp2C != 0){ + func_80311480(sp2C, sp28, 0, 0, 0, 0); + } + }//L802B0EA4 + func_80298A64(); +} + +void bsjig_jiggy_interrupt(void){ + if(bs_getInterruptType() == 0x26) + func_80296608(); +} + +void bsjig_notedoor_end(void){ + func_8028D5F4(); + func_8025A2FC(-1, 0xfa0); + func_8024BD08(1); + func_8029E070(0); + func_80291548(); + if( D_8037D4B2 + && jiggyscore_total() == 100 + && func_8031FF1C(BKPROG_FC_DEFEAT_GRUNTY) + ){ + func_8028F918(2); + func_802E4078(MAP_95_CS_END_ALL_100, 0, 1); + } + func_80298A64(); +} + +void bsjig_notedoor_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + D_8037D4B2 = (bs_getPrevState() == BS_44_JIG_JIGGY); + miscflag_clear(0x1A); + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, 0x282); + animctrl_setDuration(aCtrl, 3.6f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsjig.c", 0x14d); + yaw_setIdeal(func_8029B41C()); + func_8029C7F4(1,1,3,2); + func_80297970(0.0f); + if(bs_getPrevState() != BS_44_JIG_JIGGY){ + func_8024BD08(0); + func_8025A2FC(0,0xfa0); + } + func_8025A6EC(COMUSIC_42_NOTEDOOR_OPENING_FANFARE,-1); + func_8029151C(0xc); + func_8029E070(1); + func_8030E6D4(SFX_33_BANJO_AHOO); + func_8028D5DC(); +} + +void bsjig_notedoor_update(void){ + enum bs_e sp1C = 0; + + if(baanim_isAt(0.59f) || baanim_isAt(0.84f)) + func_80299CF4(SFX_3EA_UNKNOWN, 1.0f, 30000); + + if(baanim_isStopped()) + sp1C = BS_1_IDLE; + + bs_setState(sp1C); +} + diff --git a/src/core2/bs/jump.c b/src/core2/bs/jump.c new file mode 100644 index 00000000..bc2fe9ff --- /dev/null +++ b/src/core2/bs/jump.c @@ -0,0 +1,443 @@ +#include +#include "functions.h" +#include "variables.h" + +f32 func_80294438(void); +void func_8029797C(f32); +void func_802979AC(f32, f32); +f32 func_80297A64(void); +void func_80299B58(f32, f32); +f32 func_8029B2E8(void); +f32 func_8029B33C(void); +void func_802921BC(f32); +void func_8028A084(s32, f32); + +/* .data */ +f32 D_80364CD0 = 710.0f; +f32 D_80364CD4 = -1350.0f; +f32 D_80364CD8 = 0.0f; +f32 D_80364CDC = 710.0f; +f32 D_80364CE0 = -1350.0f; +f32 D_80364CE4 = 610.0f; + +/* .bss */ +u8 D_8037D4C0; +u8 D_8037D4C1; +u8 D_8037D4C2; + +/* .code */ +void func_802B1100(void){ + func_80299B58(0.91f, 1.09f); +} + +void bsjump_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + enum bs_e sp30; + + D_8037D4C2 = miscflag_isTrue(2); + sp30 = bs_getPrevState(); + if(bsclimb_inSet(sp30)){ + climbRelease(); + } + + if(sp30 == BS_11_BPECK){ + animctrl_setSubRange(aCtrl, 0.0f, 0.6667f); + func_8028774C(aCtrl, 0.5042f); + animctrl_setDuration(aCtrl, 8.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D4C0 = 1; + } + else { + D_8037D4C1 = (sp30 == BS_2D_SWIM_IDLE) || (sp30 == BS_2E_SWIM); + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_BANJO_JUMP); + animctrl_setDuration(aCtrl, 1.9f); + animctrl_setTransitionDuration(aCtrl, 0.134f); + func_8028774C(aCtrl, 0.3f); + animctrl_setSubRange(aCtrl, 0.0f, 0.5042f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsjump.c", 0x95); + func_8029C7F4(1,1,3,6); + if(func_8029B2E8() != 0.0f){ + yaw_setIdeal(func_8029B33C()); + } + func_8029797C(yaw_getIdeal()); + func_802B6FA8(); + func_802979AC(yaw_getIdeal(), func_80297A64()); + if(D_8037D4C1){ + player_setYVelocity(D_80364CE4); + } else { + player_setYVelocity(D_80364CD0); + } + gravity_set(D_80364CD4); + D_8037D4C0 = 0; + if(D_8037D4C2){ + func_8030E6D4(SFX_33_BANJO_AHOO); + } else{ + func_802B1100(); + } + }//L802B1340 +} + +void bsjump_update(void){ + enum bs_e sp34 = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 velocity[3]; + + + if(D_8037D4C2) + func_8029C348(); + + if(miscflag_isTrue(0xf)){ + func_802978A4(); + }else{ + func_802B6FA8(); + } + + _get_velocity(&velocity); + if((button_released(BUTTON_A) && 0.0f < velocity[1] && !D_8037D4C2) || !func_8028AB48()){ + gravity_reset(); + } + + switch(D_8037D4C0){ + case 0://L802B1428 + if(animctrl_isStopped(aCtrl)){ + animctrl_setSubRange(aCtrl, 0.0f, 0.6667); + animctrl_setDuration(aCtrl, 4.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D4C0 = 1; + } + if(func_8028B254(0x82)){ + animctrl_setSubRange(aCtrl, 0.0f, 1.0f); + animctrl_setDuration(aCtrl, 1.4f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D4C0 = 2; + } + break; + case 1://L802B14B4 + if( 500.0f < (player_getYPosition() - func_80294438())){ + sp34 = BS_2F_FALL; + } + if(D_8037D4C2){ + D_8037D4C2 = 0; + sp34 = BS_BSHOCK_CHARGE; + } + if(func_8028B254(0x5A)){ + animctrl_setSubRange(aCtrl, 0.0, 1.0f); + animctrl_setDuration(aCtrl, 2.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D4C0 = 2; + } + break; + case 2: + break; + }//L802B1548 + + if(func_8028B424()) + sp34 = BS_3D_FALL_TUMBLING; + + if(button_released(BUTTON_A)) + D_8037D4C2 = 0; + + if(should_flap()) + sp34 = BS_BFLAP; + + if(should_peck()) + sp34 = BS_11_BPECK; + + if(should_beak_bust()) + sp34 = BS_F_BBUSTER; + + if(func_8028B2E8()){ + func_8029C5E8(); + sp34 = BS_20_LANDING; + } + + if(velocity[1] < 0.0f && player_inWater()) + sp34 = BS_4C_LANDING_IN_WATER; + + bs_setState(sp34); +} + +void bsjump_end(void){ + if(ability_hasLearned(ABILITY_A_HOLD_A_JUMP_HIGHER)) + ability_use(0); + + if(bs_getNextState() != BS_11_BPECK) + gravity_reset(); +} + +void bsjump_fall_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + int sp20; + + if(miscflag_isTrue(7) && 700.0f < func_80297AAC()) + player_setYVelocity(700.0f); + + sp20 = (bs_getPrevState() == BS_12_BFLIP)? 0 : 1; + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, sp20); + animctrl_setIndex(aCtrl, 0xb0); + animctrl_setTransitionDuration(aCtrl, 0.3f); + animctrl_setDuration(aCtrl, 0.38f); + func_802875AC(aCtrl, "bsjump.c", 0x188); + func_8029C7F4(1,1,3,6); + D_8037D4C0 = 0; +} + +void bsjump_fall_update(void){ + enum bs_e sp2C = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp1C[3]; + + if(miscflag_isTrue(0xf)) + func_802978A4(); + else + func_802B6FA8(); + + _get_velocity(&sp1C); + + switch(D_8037D4C0){ + case 0://L802B17B8 + if(func_8028B254(0x5a)){ + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, 8); + func_8028774C(aCtrl, 0.6667f); + animctrl_setDuration(aCtrl, 2.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsjump.c", 0x1b5); + D_8037D4C0 = 1; + } + break; + case 1: + break; + }//L802B1824 + if(miscflag_isFalse(0xf)){ + if(func_8028B424()) + sp2C = BS_3D_FALL_TUMBLING; + + if(should_flap() && miscflag_isFalse(5)) + sp2C = BS_BFLAP; + + if(should_peck()) + sp2C = BS_11_BPECK; + + if(should_beak_bust()) + sp2C = BS_F_BBUSTER; + + if(player_inWater()) + sp2C = BS_4C_LANDING_IN_WATER; + } + else if(player_inWater()){ + func_8029CCC4(); + if(miscflag_isTrue(6) || miscflag_isTrue(0x14)){ + sp2C = BS_D_TIMEOUT; + } + + }//L802B18E8 + + if(func_8028B2E8()){ + func_8029C5E8(); + sp2C = BS_20_LANDING; + } + + bs_setState(sp2C); +} + +void bsjump_fall_end(void){}; + +void func_802B1928(void) { + AnimCtrl *anim_ctrl; + + anim_ctrl = _player_getAnimCtrlPtr(); + climbRelease(); + animctrl_reset(anim_ctrl); + animctrl_setIndex(anim_ctrl, ANIM_BANJO_JUMP); + animctrl_setDuration(anim_ctrl, 1.9f); + animctrl_setTransitionDuration(anim_ctrl, 0.134f); + func_8028774C(anim_ctrl, 0.3f); + animctrl_setSubRange(anim_ctrl, 0.0f, 0.5042f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + func_802875AC(anim_ctrl, "bsjump.c", 0x201); + func_80289F10(1); + func_802991A8(1); + func_8029957C(3); + func_802978DC(3); + func_8029797C(yaw_getIdeal()); + func_80297970(60.0f); + func_802979AC(yaw_getIdeal(), func_80297A64()); + player_setYVelocity(D_80364CDC); + gravity_set(D_80364CE0); + func_80294378(6); + D_8037D4C0 = 0; + func_802B1100(); +} + +void func_802B1A54(void) { + s32 next_state; + AnimCtrl *anim_ctrl; + f32 velocity[3]; + + next_state = 0; + anim_ctrl = _player_getAnimCtrlPtr(); + _get_velocity(velocity); + if (velocity[1] < 0.0f) { + func_80294378(1); + } + switch (D_8037D4C0) { + case 0: + if (animctrl_isStopped(anim_ctrl)) { + animctrl_setSubRange(anim_ctrl, 0.0f, 0.6667f); + animctrl_setDuration(anim_ctrl, 4.0f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + D_8037D4C0 = 1; + } + if (func_8028B254(130)) { + animctrl_setSubRange(anim_ctrl, 0.0f, 1.0f); + animctrl_setDuration(anim_ctrl, 1.4f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + D_8037D4C0 = 2; + } + break; + case 1: + if (func_8028B254(90)) { + animctrl_setSubRange(anim_ctrl, 0.0f, 1.0f); + animctrl_setDuration(anim_ctrl, 2.0f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + D_8037D4C0 = 2; + } + break; + case 2: + break; + } + if (func_8028B2E8()) { + func_8029C5E8(); + next_state = BS_20_LANDING; + } + bs_setState(next_state); +} + +void func_802B1BCC(void){ + func_80294378(1); + gravity_reset(); +} + +void func_802B1BF4(void) { + AnimCtrl *anim_ctrl; + bool smooth_transition; + + anim_ctrl = _player_getAnimCtrlPtr(); + smooth_transition = TRUE; + if(bs_getPrevState() == BS_12_BFLIP){ + smooth_transition = FALSE; + } + animctrl_reset(anim_ctrl); + animctrl_setSmoothTransition(anim_ctrl, smooth_transition); + animctrl_setIndex(anim_ctrl, ANIM_BANJO_JUMP); + animctrl_setTransitionDuration(anim_ctrl, 0.3f); + animctrl_setDuration(anim_ctrl, 1.9f); + func_8028774C(anim_ctrl, 0.6667f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_STOPPED); + func_802875AC(anim_ctrl, "bsjump.c", 0x298); + yaw_setIdeal(func_8029B41C()); + func_80289F10(1); + func_802991A8(1); + func_8029957C(3); + func_802978DC(6); + func_80297970(0.0f); + func_80297A0C(0); + D_8037D4C0 = 0; + func_8028D5DC(); +} + +void func_802B1CF8(void) { + enum bs_e next_state; + AnimCtrl *anim_ctrl; + f32 velocity[3]; + + next_state = 0; + anim_ctrl = _player_getAnimCtrlPtr(); + _get_velocity(velocity); + switch (D_8037D4C0) { + case 0: + if (func_8028B254(90)) { + animctrl_setSubRange(anim_ctrl, 0.0f, 1.0f); + animctrl_setDuration(anim_ctrl, 2.0f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + D_8037D4C0 = 1; + } + break; + case 1: + break; + } + if (func_8028B2E8() != 0) { + next_state = 1; + } + bs_setState(next_state); +} + +void func_802B1DA4(void){ + func_8028D5F4(); +} + +bool bsjump_jumpingFromWater(void){ + return D_8037D4C1; +} + +void bsjump_tumble_init(void){ + func_8028A084(0x68, 0.35f); + func_8029C7F4(1,1,3,6); + func_802921BC(60.0f); + if(func_80293234() == 1){ + func_8029E3C0(0, 0.5f); + func_8029E3C0(1, 0.41f); + func_80299CF4(SFX_52_BANJO_YAH_OH, 1.0f, 22000); + }else{ + func_8029E3C0(0, 0.0f); + func_8029E3C0(1, 0.01f); + } + D_8037D4C0 = 0; +} + +void bsjump_tumble_update(void){ + enum bs_e sp1C = 0; + if(func_8029E1A8(1)) + func_80299CF4(SFX_63_BANJO_UWAAAAOOH, 1.0f, 32000); + + func_8029E1A8(0); + func_802B6FA8(); + if(func_8029E384(1)){ + pitch_setIdeal(pitch_getIdeal() + 20.0f); + } + if(func_8029E348(0)){ + if(should_flap()) + sp1C = BS_BFLAP; + + if(should_peck()) + sp1C = BS_11_BPECK; + + if(should_beak_bust()) + sp1C = BS_F_BBUSTER; + }//L802B1F2C + + if(player_inWater()) + sp1C = BS_4C_LANDING_IN_WATER; + + if(func_8028B2E8()) + sp1C = BS_SPLAT; + + bs_setState(sp1C); +} + +void bsjump_tumble_end(void){ + enum bs_e next_state = bs_getNextState(); + if( next_state == BS_F_BBUSTER + || next_state == BS_BFLAP + || next_state == BS_11_BPECK + ){ + func_80293240(3); + } + func_8029CB84(); + func_802921BC(0.0f); + func_80299E6C(); +} diff --git a/src/core2/bs/ow.c b/src/core2/bs/ow.c new file mode 100644 index 00000000..ff2bf1ac --- /dev/null +++ b/src/core2/bs/ow.c @@ -0,0 +1,71 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_802B37DC(void); + +/* .bss */ +u8 D_8037D4D0; + +void func_802B1FD0(s32 arg0){} + +void bsow_init(void){ + AnimCtrl *plyr_mvmnt; + + plyr_mvmnt = _player_getAnimCtrlPtr(); + animctrl_reset(plyr_mvmnt); + animctrl_setSmoothTransition(plyr_mvmnt, 0); + animctrl_setSubRange(plyr_mvmnt, 0.0f, 0.534399986267f); + animctrl_setIndex(plyr_mvmnt, ANIM_BANJO_OW); + animctrl_setDuration(plyr_mvmnt, 1.70000004768f); + animctrl_setPlaybackType(plyr_mvmnt, ANIMCTRL_ONCE); + func_802875AC(plyr_mvmnt, "bsow.c", 0x50); + func_80299BFC(1.0f); + func_802B360C(); + func_8028D5DC(); + func_80292E48(); + D_8037D4D0 = 0; + func_802B1FD0(1); +} + +void bsow_update(void) { + s32 sp1C = 0; + u8 temp_v0; + + sp1C = 0; + func_802B37DC(); + switch(D_8037D4D0){ + case 0: + if (func_8028B254(0x5A) != 0) { + func_8028A37C(1.0f); + D_8037D4D0 = 1; + } + break; + case 1: + break; + } + + if (baanim_isAt(0.3f) != 0) { + func_80292EA4(); + } + if (func_8028B424() != 0) { + sp1C = BS_3D_FALL_TUMBLING; + } + if (func_8028B2E8() != 0) { + sp1C = BS_2_WALK_SLOW; + } + if ((player_inWater() != 0) && (func_80297AAC() <= 0.0f)) { + sp1C = BS_4C_LANDING_IN_WATER; + } + + bs_setState(sp1C); +} + +void bsow_end(void){ + func_802B35DC(); + func_802B1FD0(0); + func_80297CA8(); + gravity_reset(); + func_8028D5F4(); + func_80292EA4(); +} diff --git a/src/core2/bs/pumpkin.c b/src/core2/bs/pumpkin.c new file mode 100644 index 00000000..7440f60e --- /dev/null +++ b/src/core2/bs/pumpkin.c @@ -0,0 +1,568 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802920FC(f32); +extern void func_8028A084(s32, f32); +extern void func_8029AD68(f32, s32); + +/* .data */ +f32 D_80364CF0 = 30.0f; +f32 D_80364CF4 = 500.0f; +f32 D_80364CF8 = 0.44f; +f32 D_80364CFC = 0.2f; +f32 D_80364D00 = 693.5f; +f32 D_80364D04 = -1200.0f; +u8 D_80364D08 = 0; +s16 D_80364D0C[] = { + SFX_54_BANJO_HOO_1, + SFX_55_BANJO_HOO_2, + SFX_56_BANJO_HUI +}; //enum sfx_e + +/* .bss */ +u8 D_8037D4E0; +s32 D_8037D4E4; +f32 D_8037D4E8[3]; +f32 D_8037D4F4; + +/* .code */ +void func_802B21D0(void) { + func_8030EB00(D_80364D0C[D_80364D08], 1.35f, 1.45f); + D_80364D08++; + if (D_80364D08 >= 3) { + D_80364D08 = 0; + } +} + + +void func_802B223C(void) { + f32 sp1C; + + sp1C = func_8029B30C(); + if (func_8029B300() == 0) { + func_80297970(0.0f); + return; + } + func_80297970(func_80257C48(sp1C, D_80364CF0, D_80364CF4)); +} + +void func_802B229C(void) { + if (!bspumpkin_inSet(bs_getNextState())) { + func_8029B0C0(); + func_8029E070(0); + func_8029E064(0); + miscflag_clear(3); + miscflag_clear(4); + func_80293D74(); + } + func_80289F10(1); +} + +int bspumpkin_inSet(s32 move_indx){ + return (move_indx == BS_48_PUMPKIN_IDLE) + || (move_indx == BS_49_PUMPKIN_WALK) + || (move_indx == BS_4A_PUMPKIN_JUMP) + || (move_indx == BS_4B_PUMPKIN_FALL) + || (move_indx == BS_4D_PUMPKIN_OW) + || (move_indx == BS_4E_PUMPKIN_DIE) + || (move_indx == BS_8F_PUMPKIN_LOCKED) + || (move_indx == BS_93_PUMPKIN_DRONE); +} + +void func_802B2384(void) { + func_8028A084(0xA0, 0.8f); + func_8029C7F4(1, 1, 1, 2); + func_80297970(0.0f); + pitch_setAngVel(1000.0f, 12.0f); + roll_setAngularVelocity(1000.0f, 12.0f); + func_80293D48(50.0f, 25.0f); + miscflag_set(3); + miscflag_set(4); + func_802900B4(); +} + +void func_802B242C(void) { + s32 next_state; + + next_state = 0; + if (func_8028B094()) { + next_state = BS_4B_PUMPKIN_FALL; + } + if (func_80294F78()) { + next_state = func_802926C0(); + } + if (func_8029B300() > 0) { + next_state = BS_49_PUMPKIN_WALK; + } + if (button_pressed(BUTTON_A)) { + next_state = BS_4A_PUMPKIN_JUMP; + } + bs_setState(next_state); +} + + +void func_802B24AC(void){ + func_802B229C(); + func_802900FC(); +} + +void func_802B24D4(void) { + AnimCtrl *anim_ctrl; + + anim_ctrl = _player_getAnimCtrlPtr(); + animctrl_reset(anim_ctrl); + animctrl_setIndex(anim_ctrl, 0xA0); + animctrl_setDuration(anim_ctrl, 0.8f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_LOOP); + _func_802875AC(anim_ctrl, "bspumpkin.c", 0x11D); + func_8029C7F4(2, 1, 1, 2); + func_80289EC8(D_80364CF0, D_80364CF4, D_80364CF8, D_80364CFC); + func_802900B4(); +} + + +void func_802B2580(void) { + s32 next_state; + + next_state = 0; + func_802B223C(); + func_8029AD68(0.3f, 4); + if ((func_8029B300() == 0) && func_80297C04(1.0f)) { + next_state = BS_48_PUMPKIN_IDLE; + } + if (func_8028B094()) { + next_state = BS_4B_PUMPKIN_FALL; + } + if (button_pressed(BUTTON_A)) { + next_state = BS_4A_PUMPKIN_JUMP; + } + bs_setState(next_state); +} + +void func_802B2610(void){ + func_802B229C(); + func_802900FC(); +} + +void func_802B2638(void) { + AnimCtrl *anim_ctrl; + + anim_ctrl = _player_getAnimCtrlPtr(); + animctrl_reset(anim_ctrl); + animctrl_setIndex(anim_ctrl, 0xA1); + animctrl_setSubRange(anim_ctrl, 0.0f, 0.3941f); + animctrl_setDuration(anim_ctrl, 1.2f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + func_802875AC(anim_ctrl, "bspumpkin.c", 0x16C); + func_8029C7F4(1, 1, 3, 6); + if (func_8029B2E8() != 0.0f) { + yaw_setIdeal(func_8029B33C()); + } + func_8029797C(yaw_getIdeal()); + func_802B223C(); + func_802979AC(yaw_getIdeal(), func_80297A64()); + player_setYVelocity(D_80364D00); + gravity_set(D_80364D04); + func_802B21D0(); + D_8037D4E0 = 0; +} + +void func_802B2750(void) { + s32 next_state; + AnimCtrl *anim_ctrl; + f32 sp1C[3]; + + next_state = 0; + anim_ctrl = _player_getAnimCtrlPtr(); + func_802B223C(); + _get_velocity(sp1C); + if (button_released(BUTTON_A) && sp1C[1] > 0.0f) { + gravity_reset(); + } + switch (D_8037D4E0) { + case 0: + if (func_80297AAC() < 0.0f) { + if (func_8028B254(130)) { + func_80292E48(); + animctrl_setDuration(anim_ctrl, 0.7f); + animctrl_setSubRange(anim_ctrl, 0.0f, 0.8059f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + D_8037D4E0 = 2; + } else { + animctrl_setSubRange(anim_ctrl, 0.0f, 0.662f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + D_8037D4E0 = 1; + } + } + break; + case 1: + if (func_8028B254(130)) { + func_80292E48(); + animctrl_setSubRange(anim_ctrl, 0.0f, 0.8059f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + D_8037D4E0 = 2; + } + break; + case 2: + if (func_8028B2E8()) { + func_8029AE48(); + animctrl_setSubRange(anim_ctrl, 0.0f, 1.0f); + animctrl_setDuration(anim_ctrl, 1.2f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + D_8037D4E0 = 3; + } + break; + case 3: + if (animctrl_isStopped(anim_ctrl)) { + func_80292EA4(); + func_80297970(0.0f); + next_state = BS_48_PUMPKIN_IDLE; + } + break; + } + if (func_8028B2E8()) { + if (func_8029B300() > 0) { + next_state = BS_49_PUMPKIN_WALK; + } + if (button_pressed(BUTTON_A)) { + next_state = BS_4A_PUMPKIN_JUMP; + } + } + bs_setState(next_state); +} + +void func_802B2990(void){ + func_80292EA4(); + gravity_reset(); + func_802B229C(); +} + +void func_802B29C0(void) { + AnimCtrl *anim_ctrl; + + anim_ctrl = _player_getAnimCtrlPtr(); + D_8037D4E4 = 0; + animctrl_reset(anim_ctrl); + animctrl_setIndex(anim_ctrl, 0xA1); + func_8028774C(anim_ctrl, 0.662f); + animctrl_setDuration(anim_ctrl, 0.7f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_STOPPED); + func_802875AC(anim_ctrl, "bspumpkin.c", 0x1F1); + func_8029C7F4(1, 1, 3, 6); + D_8037D4E0 = 0; +} + + +void func_802B2A5C(void) { + s32 next_state; + AnimCtrl *anim_ctrl; + f32 sp1C[3]; + + next_state = 0; + anim_ctrl = _player_getAnimCtrlPtr(); + if (D_8037D4E4) { + func_802B223C(); + } + _get_velocity(sp1C); + switch (D_8037D4E0) { + case 0: + if (func_8028B254(130)) { + animctrl_setSubRange(anim_ctrl, 0.0f, 0.8059f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + D_8037D4E0 = 1; + } + break; + case 1: + if (func_8028B2E8()) { + func_8029AE48(); + func_80297970(0.0f); + animctrl_setSubRange(anim_ctrl, 0.0f, 1.0f); + animctrl_setDuration(anim_ctrl, 1.2f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + D_8037D4E0 = 2; + } + break; + case 2: + break; + } + if (func_8028B2E8() && ((func_8029B300() > 0) || (D_8037D4E0 == 2 && animctrl_isStopped(anim_ctrl)))) { + if (miscflag_isTrue(0x19)) { + next_state = func_80292738(); + } else { + next_state = BS_48_PUMPKIN_IDLE; + } + } + bs_setState(next_state); +} + +void func_802B2BD0(void){ + func_802B229C(); +} + +void func_802B2BF0(void) { + func_8029656C(D_8037D4E8); + func_8028FAB0(D_8037D4E8); + func_8028A084(0xA0, 0.8f); + func_8029C7F4(1, 1, 2, 7); + func_80294378(6); + func_8029E3C0(0, 0.0f); +} + +void func_802B2C58(void) { + f32 sp3C; + f32 sp38; + f32 sp34; + f32 sp28[3]; + + func_8029E22C(0); + sp34 = func_8029E270(0); + sp38 = yaw_getIdeal(); + sp3C = ml_map_f(sp34, 0.0f, 2.3f, 0.0f, 45.0f); + yaw_setIdeal(mlNormalizeAngle(sp38 + sp3C)); + yaw_applyIdeal(); + func_802920FC(ml_map_f(sp34, 0.0f, 2.3f, 1.0f, 0.3f)); + ml_vec3f_copy(sp28, D_8037D4E8); + sp28[1] = ml_map_f(sp34, 0.0f, 2.3f, D_8037D4E8[1], D_8037D4E8[1] - 50.0); + func_8028FAB0(sp28); +} + +void func_802B2D50(void) { + func_80294378(1); + func_802920FC(1.0f); +} + +void func_802B2D80(s32 arg0) { + AnimCtrl *anim_ctrl; + f32 sp38; + f32 plyr_pos[3]; + f32 sp20[3]; + + anim_ctrl = _player_getAnimCtrlPtr(); + animctrl_reset(anim_ctrl); + animctrl_setIndex(anim_ctrl, 0x236); + animctrl_setDuration(anim_ctrl, 1.3f); + animctrl_setSubRange(anim_ctrl, 0.0f, 0.45f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + func_802875AC(anim_ctrl, "bspumpkin.c", 0x2AB); + if (arg0 == 1) { + func_8030E58C(SFX_38_BANJO_AYE_1, 1.8f); + } else { + func_8030E58C(SFX_56_BANJO_HUI, 1.8f); + } + _player_getPosition(plyr_pos); + func_80294980(sp20); + func_80257F18(sp20, plyr_pos, &sp38); + yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f)); + yaw_applyIdeal(); + func_80297970(200.0f); + func_8029797C(sp38); + func_802979AC(sp38, func_80297A64()); + func_8029C7F4(1, 1, 2, 3); + player_setYVelocity(510.0f); + gravity_set(-1200.0f); + func_8028D5DC(); + func_80292E48(); + D_8037D4E0 = 0; +} + +void func_802B2EE8(void) { + s32 next_state; + + next_state = 0; + if (baanim_isAt(0.61f)) { + func_80292EA4(); + } + switch (D_8037D4E0) { + case 0: + if (func_8028B254(90)) { + func_8028A3B8(1.0f, 0.5f); + func_8029AE48(); + D_8037D4E0 = 1; + } + break; + case 1: + if (baanim_isStopped()) { + next_state = BS_48_PUMPKIN_IDLE; + } + break; + } + bs_setState(next_state); +} + +void func_802B2F9C(void) { + func_80297CA8(); + gravity_reset(); + func_8028D5F4(); + func_80292EA4(); + func_802B229C(); +} + +void func_802B2FDC(void){ + func_802B2D80(1); +} + +void func_802B2FFC(void){ + func_802B2EE8(); +} + +void func_802B301C(void){ + func_802B2F9C(); +} + +void func_802B303C(void){ + func_802B2D80(2); +} + +void func_802B305C(void){ + func_802B2EE8(); +} + +void func_802B307C(void){ + func_802B2F9C(); +} + +void func_802B309C(void) { + AnimCtrl *anim_ctrl; + f32 sp38; + f32 plyr_pos[3]; + f32 sp20[3]; + + anim_ctrl = _player_getAnimCtrlPtr(); + func_8029B930(); + animctrl_reset(anim_ctrl); + animctrl_setSmoothTransition(anim_ctrl, 0); + animctrl_setIndex(anim_ctrl, 0x188); + animctrl_setSubRange(anim_ctrl, 0.0f, 0.1439f); + animctrl_setDuration(anim_ctrl, 3.5f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + func_802875AC(anim_ctrl, "bspumpkin.c", 0x32E); + func_8030E58C(SFX_36_BANJO_DOH, 1.8f); + _player_getPosition(plyr_pos); + func_80294980(sp20); + func_80257F18(sp20, plyr_pos, &sp38); + D_8037D4F4 = 250.0f; + yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f)); + yaw_applyIdeal(); + func_80297970(D_8037D4F4); + func_8029797C(sp38); + func_802979AC(sp38, func_80297A64()); + func_8029C7F4(1, 1, 2, 3); + player_setYVelocity(510.0f); + gravity_set(-1200.0f); + pitch_setAngVel(1000.0f, 12.0f); + func_802914CC(0xD); + func_802BF2C0(30.0f); + func_8029C984(); + func_8028D5DC(); + func_80292E48(); + func_8029E3C0(1, 2.9f); + D_8037D4E0 = 0; +} + +void func_802B3240(void){ + func_80297970(D_8037D4F4); + func_80299628(0); + switch(D_8037D4E0){ + case 0://L802B3284 + if(func_8028B254(90)) { + func_8028A37C(0.1571f); + D_8037D4E0 = 1; + } + break; + + case 1://L802B32AC + if(func_8028B2E8()) { + func_8029AE48(); + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); + FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000); + func_8028A3B8(0.2f, 2.9f); + D_8037D4E0 = 2; + } + break; + + case 2://L802B3300 + if(baanim_isStopped()) { + player_setYVelocity(400.0f); + func_8028A37C(0.355f); + D_8037D4E0 = 3; + } + break; + + case 3://L802B3338 + D_8037D4F4 = max_f(0.0f, D_8037D4F4 - 10.0f); + if (func_8028B254(90)) { + func_8028A37C(0.36f); + D_8037D4E0 = 4; + } + break; + + case 4://L802B3384 + D_8037D4F4 = max_f(0.0f, D_8037D4F4 - 10.0f); + if (func_8028B2E8()) { + func_8029AE48(); + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); + FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000); + func_8028A37C(1.0f); + D_8037D4E0 = 5; + } + break; + + case 5://L802B33F4 + D_8037D4F4 = max_f(0.0f, D_8037D4F4 - 10.0f); + break; + + } + if (func_8029E1A8(1) != 0) { + func_8029B890(); + } + bs_setState(0); +} + +void func_802B3448(void) { + func_802B229C(); + func_8024BD08(0); + gravity_reset(); + pitch_setIdeal(0.0f); + roll_setIdeal(0.0f); + func_80292EA4(); + func_80291548(); +} + +void func_802B34A0(void) { + func_8028A010(0xA0, 0.8f); + func_8029C7F4(1, 1, 3, 2); + func_80297970(0.0f); + func_8029C674(); + func_802B3A50(); +} + +void func_802B34F8(void) { + s32 next_state; + + next_state = 0; + func_802B3A50(); + func_8029C6D0(); + if (func_80298850() == 0) { + next_state = BS_48_PUMPKIN_IDLE; + } + bs_setState(next_state); +} + +void func_802B353C(void) { + func_8029C748(); + func_802B229C(); +} + +void bspumpkin_drone_init(void){ + bsdrone_init(); +} + +void bspumpkin_drone_update(void){ + bsdrone_update(); +} + +void bspumpkin_drone_end(void){ + bsdrone_end(); + func_802B229C(); +} diff --git a/src/core2/bs/rebound.c b/src/core2/bs/rebound.c new file mode 100644 index 00000000..e1a871ea --- /dev/null +++ b/src/core2/bs/rebound.c @@ -0,0 +1,137 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_80296548(void); +extern f32 func_8029653C(void); +extern f32 func_80297A4C(void); +extern f32 func_8029B56C(f32, f32, f32, f32); + +/* .bss */ +s32 D_8037D500; +f32 D_8037D504; + +/* .code */ +void func_802B35D0(s32 arg0){ + D_8037D500 = arg0; +} + +void func_802B35DC(void) { + if (D_8037D500 == 1) { + func_80297A0C(0); + } +} + +void func_802B360C(void) { + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + f32 sp28; + f32 sp24; + f32 sp20; + s32 sp1C; + + sp1C = func_80296560(); + func_80294980(sp38); + _player_getPosition(sp2C); + func_80257F18(sp38, sp2C, &sp28); + if ((sp1C == 0xE) || (sp1C == 0x10)) { + func_802B35D0(1); + func_8029C7F4(1, 1, 2, 1); + yaw_setIdeal(mlNormalizeAngle(sp28)); + gravity_set(func_80296548()); + sp20 = func_8029653C(); + sp24 = func_8029B56C(sp2C[1], sp38[1], sp20, func_80297A4C()); + ml_vec3f_diff_copy(sp44, sp38, sp2C); + D_8037D504 = sp24; + sp44[0] /= sp24; + sp44[1] /= sp24; + sp44[2] /= sp24; + sp44[1] = sp20; + func_80297A0C(sp44); + func_8029E3C0(6, sp24); + } else { + func_802B35D0(0); + func_80298760(sp1C); + yaw_setIdeal(mlNormalizeAngle(sp28 + 180.0f)); + func_80297970(func_802987D4()); + func_8029797C(sp28); + func_802979AC(sp28, func_80297A64()); + player_setYVelocity(func_802987C4()); + gravity_set(func_802987E4()); + func_8029C7F4(1, 1, 2, 3); + if (func_802987B4() == 2) { + func_802978DC(6); + } + } + yaw_applyIdeal(); +} + +void func_802B37DC(void) { + f32 velocity[3]; + + if (D_8037D500 != 0) { + if ((D_8037D500 == 1) && func_8029E1A8(6)) { + _get_velocity(velocity); + velocity[0] = 0.0f; + velocity[2] = 0.0f; + func_80297A0C(velocity); + func_80297970(0.0f); + } + } else if (func_802987B4() == 2) { + func_802B6FA8(); + } +} + +void func_802B3868(void) { + AnimCtrl *anim_ctrl; + f32 sp20; + + anim_ctrl = _player_getAnimCtrlPtr(); + func_802B360C(); + if (D_8037D500 == 0) { + sp20 = 1.4f; + } else { + sp20 = D_8037D504 + 0.5; + } + animctrl_reset(anim_ctrl); + animctrl_setSmoothTransition(anim_ctrl, 0); + animctrl_setSubRange(anim_ctrl, 0.0f, 0.5823f); + animctrl_setIndex(anim_ctrl, 0xF); + animctrl_setDuration(anim_ctrl, sp20); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + _func_802875AC(anim_ctrl, "bsrebound.c", 0xC6); + func_8030E58C(SFX_56_BANJO_HUI, 1.0f); + func_8029E3C0(0, 1.5f); + func_8028D5DC(); +} + + +void func_802B3954(void) { + s32 next_state; + AnimCtrl *anim_ctrl; + + next_state = 0; + anim_ctrl = _player_getAnimCtrlPtr(); + if (func_8029E1A8(0) && map_get() == MAP_93_GL_DINGPOT) { + func_8028D5F4(); + } + func_802B37DC(); + if (func_8028B2E8()) { + next_state = BS_20_LANDING; + } + if (func_8028B424() && D_8037D500 == 0) { + next_state = BS_3D_FALL_TUMBLING; + } + if (animctrl_isStopped(anim_ctrl) && func_8028B094() && (D_8037D500 == 0)) { + next_state = BS_2F_FALL; + } + bs_setState(next_state); +} + + +void func_802B3A20(void) { + func_802B35DC(); + gravity_reset(); + func_8028D5F4(); +} diff --git a/src/core2/bs/rest.c b/src/core2/bs/rest.c new file mode 100644 index 00000000..c8d98581 --- /dev/null +++ b/src/core2/bs/rest.c @@ -0,0 +1,172 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_802B3A50(void) { + f32 sp34; + f32 plyr_pos[3]; + f32 sp1C[3]; + + if (func_80298850()) { + _player_getPosition(plyr_pos); + if (func_80298800(sp1C) && func_80257F18(plyr_pos, sp1C, &sp34)) { + yaw_setIdeal(sp34); + } + } +} + +void func_802B3AAC(enum asset_e anim_id, f32 anim_duration) { + AnimCtrl *anim_ctrl; + + anim_ctrl = _player_getAnimCtrlPtr(); + if (anim_id == 0x14A) { + func_8029E070(1); + switch (animctrl_getIndex(_player_getAnimCtrlPtr())) { + case 0x14A: + func_8028A010(anim_id, anim_duration); + break; + case 0x167: + animctrl_reset(anim_ctrl); + animctrl_setIndex(anim_ctrl, 0x167); + animctrl_setDuration(anim_ctrl, 0.4f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + break; + default: + func_8028A180(0x167, 0.5f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + break; + } + } else { + func_8028A010(anim_id, anim_duration); + } + func_8029C7F4(1, 1, 3, 2); + func_80297970(0.0f); + func_802B3A50(); +} + + +bool func_802B3BB0(void) { + AnimCtrl *anim_ctrl; + bool sp20; + + anim_ctrl = _player_getAnimCtrlPtr(); + func_802B3A50(); + sp20 = FALSE; + switch(animctrl_getIndex(anim_ctrl)){ + case 0x167: + if (baanim_isStopped() != 0) { + if (animctrl_isPlayedForwards(anim_ctrl) != 0) { + func_8028A010(0x14A, 11.4f); + } else if (func_80298850() == 0) { + sp20 = TRUE; + } + } + break; + case 0x14A: + if (func_80298850() == 0) { + animctrl_reset(anim_ctrl); + animctrl_setDirection(anim_ctrl, 0); + animctrl_setIndex(anim_ctrl, 0x167); + func_8028774C(anim_ctrl, 1.0f); + animctrl_setDuration(anim_ctrl, 0.5f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + _func_802875AC(anim_ctrl, "bsrest.c", 0xA3); + } + break; + default: + if (func_80298850() == 0) { + sp20 = TRUE; + } + break; + } + return sp20; +} + +void func_802B3CCC(void){ + func_8029E070(0); +} + +void func_802B3CEC(void){ + enum asset_e anim_id; + f32 anim_duration; + + func_8029BE10(&anim_id, &anim_duration); + func_802B3AAC(anim_id, anim_duration); +} + +void func_802B3D1C(void) { + enum bs_e next_state; + + next_state = 0; + if (player_inWater() != 0) { + next_state = BS_77; + } + if (func_802B3BB0() != 0) { + next_state = bs_getIdleState(); + } + bs_setState(next_state); +} + +void func_802B3D6C(void){ + func_802B3CCC(); +} + +void func_802B3D8C(void){ + enum asset_e anim_id; + f32 anim_duration; + + func_8029BF00(&anim_id, &anim_duration); + func_802B3AAC(anim_id, anim_duration); +} + + +void func_802B3DBC(void) { + enum bs_e next_state; + + next_state = 0; + if (player_inWater() != 0) { + next_state = BS_77; + } + if (func_802B3BB0() != 0) { + next_state = bs_getIdleState(); + } + bs_setState(next_state); +} + + +void func_802B3E0C(void){ + func_802B3CCC(); +} + +void func_802B3E2C(void){ + enum asset_e anim_id; + f32 anim_duration; + + func_8029BE88(&anim_id, &anim_duration); + func_802B3AAC(anim_id, anim_duration); + func_8029C674(); +} + +void func_802B3E64(void) { + s32 next_state; + + next_state = 0; + func_8029C6D0(); + if (player_inWater()) { + next_state = BS_77; + } + if (func_802B3BB0()) { + next_state = bs_getIdleState(); + } + if (map_get() == MAP_27_FP_FREEZEEZY_PEAK && miscflag_isTrue(0x14)) { + next_state = func_8029CA94(next_state); + } + bs_setState(next_state); +} + + +void func_802B3EF4(void){ + func_802B3CCC(); + func_8029C748(); +} diff --git a/src/core2/bs/sled.c b/src/core2/bs/sled.c new file mode 100644 index 00000000..31b41b5f --- /dev/null +++ b/src/core2/bs/sled.c @@ -0,0 +1,57 @@ +#include +#include "functions.h" +#include "variables.h" + +ActorMarker *D_8037D510; + +/* .code */ +void func_802B3F20(void){ + Actor *actor; + + D_8037D510 = func_80296554(); + actor = marker_getActor(D_8037D510); + actor->unk138_20 = TRUE; +} + +void func_802B3F60(void){ + Actor *actor; + if(D_8037D510 != NULL){ + actor = marker_getActor(D_8037D510); + actor->unk138_20 = FALSE; + D_8037D510 = NULL; + } +} + +void bssled_init(void){ + func_802B3F20(); + func_8028A010(ASSET_228_ANIM_BANJO_SLED, 1.8f); + func_8029C7F4(1, 1, 3, 7); + func_80297970(0.0f); + func_80294A8C(0); + func_80294378(6); +} + +void bssled_update(void){ + s32 state = 0; + if(D_8037D510 == NULL) + state = BS_2F_FALL; + bs_setState(state); +} + +void bssled_end(void){ + func_80294A8C(1); + func_80294378(1); + func_802B3F60(); + roll_setIdeal(0.0f); + pitch_setIdeal(0.0f); +} + +void bssled_interrupt(void){ + if(bs_getInterruptType() == 0x28){ + func_802B3F60(); + func_8029A86C(2); + } + else{ + func_80296608(); + } +} diff --git a/src/core2/bs/slide.c b/src/core2/bs/slide.c new file mode 100644 index 00000000..3435365b --- /dev/null +++ b/src/core2/bs/slide.c @@ -0,0 +1,121 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +s32 D_8037D520; +s32 D_8037D524; +f32 D_8037D528; + +void func_802B40D0(void){ + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + f32 sp28; + + _player_getPosition(sp38); + sp38[1] += 20.0f; + D_8037D524++; + if(!(D_8037D524 < 3)) + D_8037D524 = 0; + + if(D_8037D524){ + sp28 = mlNormalizeAngle(yaw_get() + 90.0f); + func_802589E4(sp2C, sp28, randf()*10.0f + 20.0f); + sp2C[1] = 0.0f; + } + + switch(D_8037D524){ + case 1://L802B41A0 + ml_vec3f_scale(sp2C, -1.0f); + sp38[0] += sp2C[0]; + sp38[1] += sp2C[1]; + sp38[2] += sp2C[2]; + break; + case 2://L802B41DC + sp38[0] += sp2C[0]; + sp38[1] += sp2C[1]; + sp38[2] += sp2C[2]; + break; + case 0://L802B4208 + break; + } + func_802589E4(sp44, yaw_get(), 40.0f); + sp44[1] = 50.0f; + func_80352CF4(sp38, sp44, 10.0f, 150.0f); +} + +void bsslide_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp30[3]; + f32 sp2C; + f32 sp28; + f32 tmp_f0; + D_8037D520 = ANIM_BANJO_SLIDE_FRONT; + if(player_isSliding()){ + func_80294480(sp30); + if(func_80258108(sp30, &sp28, &sp2C)){ + tmp_f0 = mlNormalizeAngle(yaw_get() - sp28); + if(tmp_f0 < 90.0f || 270.0f < tmp_f0){ + D_8037D520 = ANIM_BANJO_SLIDE_BACK; + } + } + } + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, D_8037D520); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED); + animctrl_setDuration(aCtrl, 1.0f); + func_802875AC(aCtrl, "bsslide.c", 0x7f); + func_8029C7F4(1,1,3,3); + func_8029797C(yaw_getIdeal()); + func_802979AC(yaw_getIdeal() ,func_80297A64()); + pitch_setAngVel(800.0f, 8.0f); + func_80297970(0.0f); + func_80299AAC(); + D_8037D524 = 0; + D_8037D528 = 1.0f; + +} + +void bsslide_update(void){ + enum bs_e sp3C = 0; + f32 sp30[3]; + f32 sp2C; + f32 sp28; + + func_80299AAC(); + D_8037D528 = max_f(D_8037D528 - time_getDelta(), 0.0f); + if(player_isSliding()){ + func_80294480(sp30); + if(func_80258108(sp30, &sp2C, &sp28)){ + if(D_8037D520 == 0x5A){ + yaw_setIdeal(sp2C + 180.0f); + pitch_setIdeal(-sp28); + }else{ + yaw_setIdeal(sp2C); + pitch_setIdeal(sp28); + } + func_80297970(ml_map_f(sp28,20.0f, 60.0f, 550.0f, 700.0f)); + func_8029797C(sp2C); + }else{ + func_80297970(500.0f); + } + func_802B40D0(); + }else{//L802B44C4 + sp3C = BS_1_IDLE; + }//L802B44C8 + + if(player_inWater()) + sp3C = BS_4C_LANDING_IN_WATER; + + if(D_8037D528 == 0.0f && button_pressed(BUTTON_A)) + sp3C = func_8029C780(); + + bs_setState(sp3C); +} + +void bsslide_end(void){ + if(level_get() != 6) + ability_use(6); + pitch_setIdeal(0.0f); +} diff --git a/src/core2/bs/splat.c b/src/core2/bs/splat.c new file mode 100644 index 00000000..de84c7cd --- /dev/null +++ b/src/core2/bs/splat.c @@ -0,0 +1,87 @@ +#include +#include "functions.h" +#include "variables.h" +#include "bsint.h" + +void func_80292900(f32, f32); +void func_80250D94(f32, f32, f32); + +/* .bss */ +u8 D_8037D530; + +/* .code */ +void func_802B4570(void) { + f32 i; + + for(i = 0.0f; i < 360.0f; i += 45.0f){ + func_80292900(i, 230.0f); + } +} + +void bssplat_init(void){ + s32 sp1C; + func_8028A274(0x149, 1.1f); + func_8029C7F4(1,1,3,3); + func_802931DC(&sp1C); + func_803463D4(ITEM_14_HEALTH, -sp1C); + if(func_8029CEB0() == 4){ + FUNC_8030E624(SFX_116_DEAF_RUSTLING, 0.7f, 32000); + FUNC_8030E624(SFX_116_DEAF_RUSTLING, 0.8f, 32000); + func_80250D94(0.75f, 0.25f, 0.3f); + }else{ + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 32750); + func_80250D94(1.0f, 0.5f, 0.4f); + } + func_80299CF4(SFX_38_BANJO_AYE_1, 1.0f, 28000); + func_802B4570(); + func_802BB3DC(0, 45.0f, 0.71f); + if(item_getCount(ITEM_14_HEALTH) == 0) + bs_setState(BS_41_DIE); + + D_8037D530 = 0; + func_8028D5DC(); +} + +void bssplat_update(void){ + enum bs_e sp1C = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + func_80297970(max_f(0.0f, func_80297A64() - 15.0f)); + + switch (D_8037D530) + { + case 0://L802B4760 + if(140.0f < func_80297A64()) + func_802929F8(); + + if(func_8028B094()) + sp1C = BS_2F_FALL; + + if(animctrl_isStopped(aCtrl)){ + func_8028A180(ASSET_D2_ANIM_BANJO_GETTING_UP, 2.25f); + D_8037D530 = 1; + } + break; + + case 1://L802B47C8 + if(animctrl_isAt(aCtrl, 0.63f)) + sp1C = BS_20_LANDING; + + if(animctrl_isStopped(aCtrl)) + sp1C = BS_1_IDLE; + + if(func_8028B094()) + sp1C = BS_2F_FALL; + break; + }//L802B4808 + + if(func_8028B2E8() == 0 && player_inWater()) + sp1C = BS_2D_SWIM_IDLE; + + bs_setState(sp1C); + +} + +void bssplat_end(void){ + func_8028D5F4(); + func_80297CA8(); +} diff --git a/src/core2/bs/stand.c b/src/core2/bs/stand.c new file mode 100644 index 00000000..a8bdc867 --- /dev/null +++ b/src/core2/bs/stand.c @@ -0,0 +1,336 @@ +#include +#include "functions.h" +#include "variables.h" +#include "bsint.h" + +extern f32 func_8029B2E8(void); +void func_80299234(f32, f32); + +void func_802875AC(AnimCtrl *, char*, s32); + +void func_802900B4(void); +void func_80250D94(f32, f32, f32); + +/* .data */ +u8 D_80364D20[] = { + 0x8 | 0x1, + 0x8 | 0x2, + 0x8 | 0x4, + 0x10, + 0x8 | 0x1, + 0x8 | 0x1, + 0x8 | 0x2, + 0x8 | 0x1, + 0x20, + 0x8 | 0x1, + 0x8 | 0x2, + 0x8 | 0x4, + 0x10, + 0x8 | 0x1, + 0x8 | 0x1, + 0x8 | 0x2, + 0x8 | 0x1, + 0x10, + 0x8 | 0x1, + 0x8 | 0x2, + 0x20 +}; + +//.bss +s32 D_8037D540; +u8 D_8037D544; + +u32 func_802B4870(u32 arg0){ + if(++arg0 > 0x14) + arg0 = 0; + return arg0; +} + +s32 func_802B488C(s32 arg0){ + s32 retVal = arg0; + switch(func_8029B300()){ + case 1: //L802B48CC + retVal = BS_WALK_CREEP; + break; + case 2: //L802B48D4 + retVal = BS_2_WALK_SLOW; + break; + case 3: //L802B48D4 + retVal = BS_WALK; + break; + case 4: //L802B48D4 + retVal = BS_WALK_FAST; + break; + } + if(button_held(BUTTON_Z)) + retVal = BS_CROUCH; + + if(button_pressed(BUTTON_B) && can_claw()) + retVal = BS_CLAW; + + if(button_pressed(BUTTON_A)) + retVal = func_8029C780(); + + if(func_80294F78()) + retVal = func_802926C0(); + + if(player_isSliding()) + retVal = BS_SLIDE; + + retVal = func_8029CA94(retVal); + + if(player_inWater()) + retVal = BS_2D_SWIM_IDLE; + + return retVal; +} + +void bsstand_init(void){ + if(bsclimb_inSet(bs_getPrevState())) + climbRelease(); + + func_8028A180(0x6F, 5.5f); + func_8029C7F4(1,1,1,2); + func_80297970(0.0f); + func_802900B4(); + D_8037D540 = 0; + D_8037D544 = 0; +} + +void func_802B4A10(AnimCtrl *arg0){ + if(animctrl_isAt(arg0, 0.2057f)){ //(30/145) + FUNC_8030E624(SFX_21_EGG_BOUNCE_1, 1.8f, 16000); + func_80250D94(0.5f, 0.25f, 0.4f); + }//L802B4A54 + + if(animctrl_isAt(arg0, 0.2057f)) //(30/145) + func_80292E48(); + //L802B4A78 + + if(animctrl_isAt(arg0, 0.2555f)){ //(37/145) + FUNC_8030E624(SFX_21_EGG_BOUNCE_1, 1.8f, 16000); + func_80250D94(0.5f, 0.25f, 0.4f); + }//L802B4AB0 + + if(animctrl_isAt(arg0, 0.2896f)){ //(42/145) + FUNC_8030E624(SFX_21_EGG_BOUNCE_1, 1.8f, 16000); + func_80250D94(0.5f, 0.25f, 0.4f); + }//L802B4AEC + + if(animctrl_isAt(arg0, 0.3f)){ //(43.5/145)? + FUNC_8030E624(SFX_62_BANJO_ERGHH, 1.0f, 28000); + }//L802B4B0C + + if(animctrl_isAt(arg0, 0.3607f)){ + func_80292EA4(); + }//L802B4B30 + + if(animctrl_isAt(arg0, 0.4183f)){ + func_8030E58C(SFX_3F1_UNKNOWN, 1.6f); + }//L802B4B50 + + if(animctrl_isAt(arg0, 0.455f)){ + func_8030E58C(SFX_3F1_UNKNOWN, 1.45f); + }//L802B4B74 + + if(animctrl_isAt(arg0, 0.49f)){ + func_8030E58C(SFX_3F1_UNKNOWN, 1.4f); + }//L802B4B98 + + if(animctrl_isAt(arg0, 0.5397f)){ + func_802900D8(); + }//L802B4BBC + + if(animctrl_isAt(arg0, 0.6619f)){ + FUNC_8030E624(SFX_21_EGG_BOUNCE_1, 1.8f, 16000); + func_80250D94(0.5f, 0.25f, 0.4f); + }//L802B4BF4 + + if(animctrl_isAt(arg0, 0.6688f)) + func_80292E48(); + //L802B4C18 + + if(animctrl_isAt(arg0, 0.6964f)){ + FUNC_8030E624(SFX_21_EGG_BOUNCE_1, 1.8f, 16000); + func_80250D94(0.5f, 0.25f, 0.4f); + }//L802B4C50 + + if(animctrl_isAt(arg0, 0.7747f)) + func_80292EA4(); + //L802B4C74 + + if(animctrl_isAt(arg0, 0.7822f)){ + FUNC_8030E624(SFX_6F_BANJO_HEADSCRATCH, 1.0f, 14000); + }//L802B4C90 + + if(animctrl_isAt(arg0, 0.8322f)){ + FUNC_8030E624(SFX_6F_BANJO_HEADSCRATCH, 1.0f, 14000); + }//L802B4CB0 + + if(animctrl_isAt(arg0, 0.8669f)){ + FUNC_8030E624(SFX_6F_BANJO_HEADSCRATCH, 1.0f, 14000); + }//L802B4CD0 + + if(animctrl_isAt(arg0, 0.9048f)){ + FUNC_8030E624(SFX_6F_BANJO_HEADSCRATCH, 1.0f, 14000); + }//L802B4CF0 + + if(animctrl_isAt(arg0, 0.9649f)){ + func_802900D8(); + }//L802B4CF0 +} + +void bsstand_update(void) { + s32 next_state; + AnimCtrl *anim_ctrl; + f32 sp1C; + s32 sp18; + + anim_ctrl = _player_getAnimCtrlPtr(); + if ((func_8029B300() == 0) && (func_8029B2E8() > 0.0f)) { + D_8037D544 = 1; + func_802991A8(3); + func_80299234(200.0f, 14.0f); + } else { + if (D_8037D544 != 0) { + yaw_setIdeal(yaw_get()); + } + D_8037D544 = 0; + func_802991A8(1); + } + next_state = func_802B488C(0); + sp18 = D_80364D20[D_8037D540]; + if (sp18 & 8) { + if (sp18 & 4) { + if (animctrl_isAt(anim_ctrl, 0.0909f)) func_80299BD4(); + if (animctrl_isAt(anim_ctrl, 0.0909f)) func_8029E070(1); + if (animctrl_isAt(anim_ctrl, 0.6818f)) func_8029E070(0); + }//L802B4E70 + if (sp18 & 2) { + if (animctrl_isAt(anim_ctrl, 0.7727f)) func_8029E070(1); + if (animctrl_isAt(anim_ctrl, 0.9999f)) func_8029E070(0); + }//L802B50E4 + } else if (sp18 & 0x20) { + if (animctrl_getIndex(anim_ctrl) == 0x95) { + func_802B4A10(anim_ctrl); + if (animctrl_isAt(anim_ctrl, 0.37f)) { + animctrl_reset(anim_ctrl); + animctrl_setTransitionDuration(anim_ctrl, 0.1f); + animctrl_setIndex(anim_ctrl, 0xF6); + animctrl_setDuration(anim_ctrl, 5.0f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_ONCE); + func_802875AC(anim_ctrl, "bsstand.c", 0x170); + } + } else { + if (animctrl_isAt(anim_ctrl, 0.069f)) func_80299D2C(SFX_4B_GULPING, 1.4f, 0x4650); + if (animctrl_isAt(anim_ctrl, 0.1677f)) func_80299D2C(SFX_8B_KAZOOIE_RAWW, 1.0f, 0x4650); + if (animctrl_isAt(anim_ctrl, 0.2441f)) func_80299D2C(SFX_8B_KAZOOIE_RAWW, 1.03f, 0x4650); + if (animctrl_isAt(anim_ctrl, 0.3141f)) func_80299D2C(SFX_8B_KAZOOIE_RAWW, 1.06f, 0x4650); + if (animctrl_isAt(anim_ctrl, 0.3859f)) func_80299D2C(SFX_8B_KAZOOIE_RAWW, 1.5f, 0x7D00); + if (animctrl_isAt(anim_ctrl, 0.414f)) func_80299CF4(SFX_2D_KABOING, 1.0f, 0x4650); + if (animctrl_isAt(anim_ctrl, 0.55f)) func_80299CF4(SFX_A3_BANJO_DOUBLE_COUGH, 1.0f, 0x6D60); + if (animctrl_isAt(anim_ctrl, 0.6187f)) func_80299D2C(SFX_A0_COUGHING, 1.7f, 0x4650); + if (animctrl_isAt(anim_ctrl, 0.7108f)) func_80299D2C(SFX_A0_COUGHING, 1.6f, 0x4650); + if (animctrl_isAt(anim_ctrl, 0.7927f)) func_80299D2C(SFX_A0_COUGHING, 1.5f, 0x4650); + } + } else /*L802B50D4*/if ((sp18 & 0x10) != 0) { + func_802B4A10(anim_ctrl); + } + if (animctrl_isAt(anim_ctrl, 0.9999f) != 0) { + D_8037D540 = func_802B4870(D_8037D540); + sp18 = D_80364D20[D_8037D540]; + if (sp18 & 0x10) { + func_8028A180(0x95, 5.5f); + _func_802875AC(anim_ctrl, "bsstand.c", 0x1AB); + func_8029E070(1); + func_802900FC(); + } else if (sp18 & 0x20) { + func_8028A180(0x95, 5.5f); + func_8029E070(1); + func_802900FC(); + } else if (sp18 & 8) { + if (animctrl_getIndex(anim_ctrl) == 0x6F) { + sp1C = animctrl_getAnimTimer(anim_ctrl); + } else { + sp1C = 0.0f; + func_802900B4(); + } + animctrl_reset(anim_ctrl); + animctrl_setIndex(anim_ctrl, 0x6F); + animctrl_setDuration(anim_ctrl, 5.5f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_LOOP); + func_8028774C(anim_ctrl, sp1C); + func_802875AC(anim_ctrl, "bsstand.c", 0x1C3); + func_8029E070(0); + } + } + if (func_8028B094() != 0) { + next_state = BS_2F_FALL; + } + bs_setState(next_state); +} + +void bsstand_end(void){ + func_8029E070(0); + func_802900FC(); + func_80292EA4(); +} + +//bsStand_Land_init +void bsstand_landing_init(void){ + func_8029C7F4(1,1,1,2); + func_80297970(0.0f); +} + +//bsStand_Land_update +void bsstand_landing_update(void){ + s32 sp1C = 0; + AnimCtrl * sp18 = _player_getAnimCtrlPtr(); + + if(animctrl_getIndex(sp18) == 0xd2){ + if(animctrl_isAt(sp18, 0.8264f)){ + func_80299CF4(SFX_6F_BANJO_HEADSCRATCH, 1.0f, 0x36b0); + } + + //L802B52F8 + if(animctrl_isAt(sp18, 0.8864f)){ + func_80299CF4(SFX_6F_BANJO_HEADSCRATCH, 1.0f, 0x36b0); + } + } + //L802B531C + if(animctrl_isStopped(sp18)) + sp1C = BS_1_IDLE; + + bs_setState(func_802B488C(sp1C)); +} + + +///BREAK??? +void func_802B5350(void){ + s32 sp1C = bs_getInterruptType(); + if(sp1C == 0xd){ + bs_setState(0x52); + } + if(sp1C == 0x7){ + if(_player_getTransformation() != TRANSFORM_1_BANJO) + func_8029A86C(1); + else{ + func_802948F8(func_8028D688()); + bs_setState(BS_3A_CARRY_IDLE); + } + } + else if(sp1C == 0x12){//L802B53D0 + func_8029A86C(1); + if( _player_getTransformation() == TRANSFORM_1_BANJO && !miscflag_isTrue(0xF) && func_802916CC(0)){ + func_8028DE6C(carriedObject_getActorID()); + func_8029A86C(2); + } + } + else if(sp1C == 0x8){//L802B5438 + func_8029A86C(2); + bs_setState(0x3C); + }else{ + func_802948E0(); + func_80296608(); + } +} diff --git a/src/core2/bs/surf.c b/src/core2/bs/surf.c new file mode 100644 index 00000000..f6668f56 --- /dev/null +++ b/src/core2/bs/surf.c @@ -0,0 +1,49 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +s32 D_8037D560; + +/* .code */ +void func_802B5FD0(void) { + AnimCtrl *anim_ctrl; + + anim_ctrl = _player_getAnimCtrlPtr(); + animctrl_reset(anim_ctrl); + animctrl_setIndex(anim_ctrl, 0x69); + animctrl_setDuration(anim_ctrl, 1.8f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_LOOP); + _func_802875AC(anim_ctrl, "bssurf.c", 0x33); + func_8029C7F4(1, 1, 3, 2); + func_80297970(0.0f); + D_8037D560 = 1; +} + +void func_802B6064(void) { + enum bs_e next_state; + + next_state = 0; + if (button_pressed(BUTTON_A)) { + next_state = BS_5_JUMP; + } + if (D_8037D560 == 0) { + next_state = BS_1_IDLE; + } + D_8037D560 = 0; + if (miscflag_isTrue(6)) { + next_state = BS_53_TIMEOUT; + } + bs_setState(next_state); +} + +void func_802B60D0(void){} + +void func_802B60D8(void) { + if (bs_getInterruptType() == 0xD) { + D_8037D560 = 1; + func_8029A86C(2); + return; + } + func_80296608(); +} diff --git a/src/core2/bs/swim.c b/src/core2/bs/swim.c new file mode 100644 index 00000000..67464ed1 --- /dev/null +++ b/src/core2/bs/swim.c @@ -0,0 +1,315 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80295328(s32, f32); + +bool bsswim_inset(enum bs_e state_id); + +/* .data */ +f32 D_80364D40 = 30.0f; +f32 D_80364D44 = 300.0f; +f32 D_80364D48 = 1.2f; +f32 D_80364D4C = 0.7f; +s16 D_80364D50[10] = { + 0x57, + 0x57, + 0x57, + 0x58, + 0x57, + 0x58, + 0x57, + 0x57, + 0x58, + 0x58 +}; + +/* .bss */ +u32 D_8037D550; + +/* .code */ +void func_802B5480(void) { + f32 sp2C[3]; + ParticleEmitter *sp28; + + if (func_80294574()) { + if (randf() > 0.5) { + func_8029223C(sp2C); + } else { + func_80292260(sp2C); + } + sp28 = func_8029B950(&sp2C, 0.0f); + particleEmitter_setParticleVelocityRange(sp28, -60.0f, -100.0f, -60.0f, 60.0f, 0.0f, 60.0f); + particleEmitter_emitN(sp28, 1); + } +} + +void func_802B5538(AnimCtrl *arg0) { + enum asset_e sp24; + + sp24 = D_80364D50[D_8037D550]; + if (animctrl_getIndex(arg0) != sp24) { + func_8028774C(arg0, animctrl_getAnimTimer(arg0)); + animctrl_setIndex(arg0, sp24); + _func_802875AC(arg0, "bsswim.c", 0x79); + } + D_8037D550++; + if (D_8037D550 >= 10) { + D_8037D550 = 0; + } +} + +void func_802B55DC(void) { + f32 sp1C; + + sp1C = func_8029B30C(); + if (func_8029B300() == 0) { + func_80297970(0.0f); + return; + } + func_80297970(func_80257C48(sp1C, D_80364D40, D_80364D44)); +} + +void func_802B563C(void) { + if (level_get() == LEVEL_9_RUSTY_BUCKET_BAY) { + func_8035644C(0xAB); + } else if (map_get() == MAP_46_CCW_WINTER) { + func_8035644C(0xDD); + } + gravity_set(100.0f); + func_80297BF8(133.33f); + func_8029B324(0, 0.03f); + func_8029B324(1, 1.0f); + func_80294378(3); +} + + +void func_802B56D4(void) { + if (!bsswim_inset(bs_getNextState())) { + func_80297B94(); + gravity_reset(); + func_8029B0C0(); + func_80294378(1); + } +} + +bool bsswim_inset(enum bs_e state_id){ + return state_id == BS_2D_SWIM_IDLE + || state_id == BS_2E_SWIM + || state_id == BS_4C_LANDING_IN_WATER + || state_id == BS_77 + || state_id == BS_96_SWIM_LOCKED + ; +} + +void func_802B5774(void) { + AnimCtrl *anim_ctrl; + s32 prev_state; + f32 transition_duration; + + anim_ctrl = _player_getAnimCtrlPtr(); + prev_state = bs_getPrevState(); + if (prev_state == BS_4C_LANDING_IN_WATER) { + transition_duration = 0.8f; + } else { + transition_duration = 0.5f; + } + if (bsbswim_inSet(prev_state) != 0) { + if (prev_state == BS_54_SWIM_DIE) { + func_80299CF4(SFX_AF_BANJO_CATCHING_BREATH, 1.0f, 30000); + } else { + func_80299CF4(SFX_AF_BANJO_CATCHING_BREATH, 1.0f, (s32) ml_map_f(item_getCount(ITEM_17_AIR), 3600.0f, 0.0f, 8000.0f, 30000.0f)); + } + func_80295328(4, 0.7f); + } + if ((animctrl_getIndex(anim_ctrl) == 0x57) && (prev_state != BS_4C_LANDING_IN_WATER)) { + animctrl_setSmoothTransition(anim_ctrl, 0); + animctrl_setIndex(anim_ctrl, 0x57); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_LOOP); + animctrl_setDuration(anim_ctrl, 1.2f); + } else { + animctrl_reset(anim_ctrl); + animctrl_setTransitionDuration(anim_ctrl, transition_duration); + animctrl_setIndex(anim_ctrl, 0x57); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_LOOP); + func_8028774C(anim_ctrl, 0.3f); + animctrl_setDuration(anim_ctrl, 1.2f); + func_802875AC(anim_ctrl, "bsswim.c", 0xFD); + } + func_8029C7F4(1, 3, 3, 2); + func_80299234(500.0f, 5.0f); + func_80297970(0.0f); + func_802B563C(); + D_8037D550 = 0; +} + +void func_802B5950(void) { + s32 next_state; + AnimCtrl *anim_ctrl; + + next_state = 0; + anim_ctrl = _player_getAnimCtrlPtr(); + if ((func_8023DB4C(7) == 0) && ((f64) randf() < 0.5)) { + func_8029C304(1); + } + if ((func_8023DB4C(7) == 0) && ((f64) randf() < 0.5)) { + func_802B5480(); + } + if (animctrl_isAt(anim_ctrl, 0.01f) != 0) { + func_8030EC20(SFX_DC_IDLE_PADDLING, 0.85f, 1.15f, 16000, 16000); + } + if (animctrl_isAt(anim_ctrl, 0.4348f) != 0) { + func_802B5538(anim_ctrl); + } + if (func_8029B300() == 1) { + next_state = BS_2E_SWIM; + } + if (!player_inWater()) { + next_state = BS_1_IDLE; + } + if (func_80294F78()) { + next_state = func_802926C0(); + } + if (should_dive()) { + next_state = BS_30_DIVE_ENTER; + } + if (func_80294524() && button_pressed(BUTTON_A)) { + next_state = BS_5_JUMP; + } + if (miscflag_isTrue(6) || miscflag_isTrue(0x14)) { + next_state = BS_D_TIMEOUT; + } + bs_setState(next_state); +} + +void func_802B5AF8(void){ + func_802B56D4(); +} + +void func_802B5B18(void) { + AnimCtrl *anim_ctrl; + f32 anim_duration; + + anim_ctrl = _player_getAnimCtrlPtr(); + if (bs_getPrevState() == BS_4C_LANDING_IN_WATER) { + anim_duration = 0.8f; + } else { + anim_duration = 0.4f; + } + if (animctrl_getIndex(anim_ctrl) != 0x39) { + animctrl_reset(anim_ctrl); + animctrl_setIndex(anim_ctrl, 0x39); + animctrl_setTransitionDuration(anim_ctrl, anim_duration); + func_8028774C(anim_ctrl, 0.8f); + animctrl_setPlaybackType(anim_ctrl, ANIMCTRL_LOOP); + func_802875AC(anim_ctrl, "bsswim.c", 0x164); + } + func_80289F10(2); + func_80289EA8(0.3f, 1.5f); + func_80289EC8(D_80364D40, D_80364D44, D_80364D48, D_80364D4C); + func_802991A8(3); + func_80299234(500.0f, 5.0f); + func_8029957C(1); + func_802978DC(2); +} + +void func_802B5C40(void) { + s32 next_state; + AnimCtrl *anim_ctrl; + f32 sp1C[3]; + + next_state = 0; + anim_ctrl =_player_getAnimCtrlPtr(); + if (animctrl_isAt(anim_ctrl, 0.38f)) { + func_8029C4E4(1); + } + if (animctrl_isAt(anim_ctrl, 0.88f)) { + func_8029C4E4(0); + } + if (animctrl_isAt(anim_ctrl, 0.2f)) { + func_8030EB88(SFX_12_WATER_PADDLING_1, 0.9f, 1.1f); + } + if (animctrl_isAt(anim_ctrl, 0.7f)) { + func_8030EB88(SFX_12_WATER_PADDLING_1, 0.9f, 1.1f); + } + func_802B55DC(); + if (func_8029B300() == 0) { + next_state = BS_2D_SWIM_IDLE; + } + if (player_inWater() == 0) { + next_state = BS_1_IDLE; + } + if ((func_80294530() != 0) && (can_dive() != 0)) { + func_802944D0(sp1C); + if (sp1C[1] < -0.7) { + if ((func_80294500() - player_getYPosition()) > 90.0f) { + next_state = BS_30_DIVE_ENTER; + } + } + } + if (should_dive() != 0) { + next_state = BS_30_DIVE_ENTER; + } + if (func_80294524() && button_pressed(BUTTON_A)) { + next_state = BS_5_JUMP; + } + if (miscflag_isTrue(6) || miscflag_isTrue(0x14)) { + next_state = BS_D_TIMEOUT; + } + bs_setState(next_state); +} + +void func_802B5E10(void){ + func_802B56D4(); +} + +void func_802B5E30(void) { + f32 sp34; + f32 plyr_pos[3]; + f32 sp1C[3]; + + if (func_80298850() != 0) { + _player_getPosition(plyr_pos); + if (func_80298800(sp1C) && func_80257F18(plyr_pos, sp1C, &sp34)) { + yaw_setIdeal(sp34); + } + } +} + +void func_802B5E8C(void) { + func_8028A010(0x57, 1.2f); + func_8029C7F4(1, 3, 3, 2); + func_80299234(500.0f, 5.0f); + func_80297970(0.0f); + func_802B563C(); + func_802B5E30(); +} + +void func_802B5EFC(void) { + enum bs_e next_state; + + next_state = 0; + if (func_80298850() == 0) { + next_state = BS_2D_SWIM_IDLE; + } + func_802B5E30(); + bs_setState(next_state); +} + +void func_802B5F38(void){ + func_802B56D4(); +} + +void func_802B5F58(void){ + func_802B563C(); + bsdrone_init(); +} + +void func_802B5F80(void){ + bsdrone_update(); +} + +void func_802B5FA0(void){ + bsdrone_end(); + func_802B56D4(); +} diff --git a/src/core2/bs/throw.c b/src/core2/bs/throw.c new file mode 100644 index 00000000..0c22182a --- /dev/null +++ b/src/core2/bs/throw.c @@ -0,0 +1,74 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +u8 D_8037D580; + +/* .code */ +void bsthrow_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, 0x11b); + animctrl_setDuration(aCtrl, 1.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsthrow.c", 0x2e); + + func_80289F10(1); + func_802991A8(1); + func_8029957C(3); + func_802978DC(3); + func_80297970(0.0f); + func_80297A0C(0); + D_8037D580 = 0; +} + +void bsthrow_update(void){ + enum bs_e next_state = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp34[3]; + f32 sp28[3]; + f32 sp24; + ActorMarker *sp20 = func_802948EC(); + + if(D_8037D580 == 0 && sp20 != NULL) + func_802948F8(sp20); + + _player_getPosition(&sp28); + func_80294A1C(&sp34); + func_80257F18(&sp28, &sp34, &sp24); + yaw_setIdeal(sp24); + + if(animctrl_isAt(aCtrl, 0.35f) && sp20){ + D_8037D580 = 1; + marker_getActor(sp20)->unk138_21 = 1; + } + + if(animctrl_isStopped(aCtrl)) + next_state = BS_1_IDLE; + + bs_setState(next_state); +} + +void bsthrow_end(void){ + D_8037D580 = 0; + if(bs_getNextState() == BS_1_IDLE){ + func_802917E4(0, 0.14f); + func_802917E4(1, 0.28f); + } +} + +void bsthrow_interrupt(void){ + if(bs_getInterruptType() == 0x12){ + if(D_8037D580 == 0){ + func_8028DE6C(carriedObject_getActorID()); + } + else{ + func_8029A86C(1); + } + } + else{ //L802B6748 + func_80296608(); + } +} \ No newline at end of file diff --git a/src/core2/bs/timeout.c b/src/core2/bs/timeout.c new file mode 100644 index 00000000..08728d3a --- /dev/null +++ b/src/core2/bs/timeout.c @@ -0,0 +1,75 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_80292E80(s32, f32); +f32 func_8029B41C(void); +void func_802BF2C0(f32); + +void func_802B6270(void){ + func_8028A180(0x77, 3.2f); + func_8029C7F4(1,1,3,2); + func_80297970(0.0f); + func_802914CC(0xd); + yaw_setIdeal(func_8029B41C() + 35.0f); + func_802BF2C0(80.0f); + func_8025A58C(0,0xfa0); + func_8025A70C(COMUSIC_3C_MINIGAME_LOSS); + func_8024BD08(0); + func_8029E070(1); + func_8028D5DC(); +} + +void func_802B6314(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + if(animctrl_isAt(aCtrl, 0.0625f)) + func_80292E48(); + + if(animctrl_isAt(aCtrl, 0.18f)) + FUNC_8030E624(SFX_3EB_UNKNOWN, 1.0f, 18000); + + if(animctrl_isAt(aCtrl, 0.8421f)){ + func_80292E80(0, 0.3f); + func_80292E80(1, 0.3f); + } + + if(animctrl_isAt(aCtrl, 0.84f)) + func_8029B6F0(); +} + +void func_802B63C8(void){ + func_80292EA4(); + func_80291548(); + func_8024BD08(1); +} + +void func_802B63F8(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + func_8029C848(aCtrl); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_LOOP); + func_802875AC(aCtrl, "bstimeout.c", 0x7e); + func_8029C7F4(1,1,3,7); + func_80297970(0.0f); + func_802914CC(0xd); + yaw_setIdeal(func_8029B41C() + 35.0f); + func_802BF2C0(80.0f); + func_8025A58C(0,0xfa0); + func_8025A70C(COMUSIC_3C_MINIGAME_LOSS); + func_8024BD08(0); + func_8028D5DC(); + func_8029E3C0(0, 2.9f); +} + +void func_802B64D0(void){ + if(func_8029E1A8(0)) + func_8029B6F0(); +} + +void func_802B6500(void){ + func_8029E070(0); + func_80291548(); + func_8024BD08(1); + func_8025A904(); +} diff --git a/src/core2/bs/turn.c b/src/core2/bs/turn.c new file mode 100644 index 00000000..312bebbd --- /dev/null +++ b/src/core2/bs/turn.c @@ -0,0 +1,70 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .data */ +f32 D_8037D590; +s32 D_8037D594; + +/* .code */ +void bsturn_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp28[3]; + + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, ANIM_BANJO_TURN); + animctrl_setDuration(aCtrl, 0.3f); + animctrl_setTransitionDuration(aCtrl,0.1f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bsturn.c", 0x37); + func_80289F10(1); + func_802991A8(1); + func_8029957C(2); + func_802978DC(3); + _get_velocity(&sp28); + D_8037D590 = gu_sqrtf(sp28[0]*sp28[0] + sp28[2]*sp28[2]); + func_8030EBC8(SFX_19_BANJO_LANDING_08, 0.95f, 1.05f, 0x7530, 0x7d00); + D_8037D594 = 0; +} + +void bsturn_update(void){ + enum bs_e sp2C = 0; + + func_80297970(ml_map_f(animctrl_getAnimTimer(_player_getAnimCtrlPtr()), 0.18f, 1.0f, D_8037D590, 0.0f)); + + D_8037D594++; + if(!(D_8037D594 < 6)) + D_8037D594 = -1; + + switch(D_8037D594){ + case -1://L802B68DC + func_802927E0(func_80297A7C() - 10.0f, func_80297AB8()*0.88); + break; + case 0://L802B691C + func_802927E0(func_80297A7C(), func_80297AB8()); + break; + case 1://L802B6940 + func_802927E0(func_80297A7C() + 10.0f, func_80297AB8()*0.88); + break; + }//L802B6978 + + if(animctrl_isStopped(_player_getAnimCtrlPtr())) + sp2C = BS_WALK_FAST; + + if(button_held(BUTTON_Z)) + sp2C = BS_CROUCH; + + if(button_pressed(BUTTON_B)) + sp2C = BS_CLAW; + + if(button_pressed(BUTTON_A)) + sp2C = func_8029C780(); + + bs_setState(sp2C); +} + +void bsturn_end(void){ + yaw_set(mlNormalizeAngle(yaw_get() - 180.0f)); + pitch_setIdeal(0.0f); + roll_setIdeal(0.0f); +} diff --git a/src/core2/bs/twirl.c b/src/core2/bs/twirl.c new file mode 100644 index 00000000..a6e15077 --- /dev/null +++ b/src/core2/bs/twirl.c @@ -0,0 +1,84 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +f32 D_8037D5A0; +u8 D_8037D5A4; +u8 _bstwirlHitboxActive; + +/* .code */ +int bstwirl_hitboxActive(void){ + return _bstwirlHitboxActive; +} + +void bstwirl_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, 0); + animctrl_setIndex(aCtrl, ANIM_BANJO_ROLL); + animctrl_setDuration(aCtrl, 0.9f); + animctrl_setSubRange(aCtrl, 0.0f, 1.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bstwirl.c", 0x46); + func_80289F10(1); + func_802991A8(1); + func_8029957C(3); + func_8029797C(yaw_getIdeal()); + func_802979AC(yaw_getIdeal(), func_80297A64()); + func_802978DC(3); + D_8037D5A0 = func_80297A64(); + func_80297970(600.0f); + func_80299CF4(SFX_32_BANJO_EGHEE, 1.0f, 0x6590); + _bstwirlHitboxActive = TRUE; + func_8029E3C0(0, 0.01f); + D_8037D5A4 = 0; +} + +void bstwirl_update(void){ + enum bs_e sp1C = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + switch(D_8037D5A4){ + case 0: + D_8037D5A4 = 1; + break; + case 1: + D_8037D5A4 = 2; + break; + case 2: + if(func_8029E1A8(0)){ + func_8029AE74(0); + func_8029E3C0(0, 0.12f); + } + if(animctrl_isAt(aCtrl, 0.8011f)){ + animctrl_setDuration(aCtrl, 2.5f); + func_80297970(0.0f); + _bstwirlHitboxActive = 0; + D_8037D5A4 = 3; + } + //??? missing break + case 3://L802B6C38 + if(animctrl_isStopped(aCtrl)) + sp1C = BS_1_IDLE; + break; + }//L802B6C4C + + if(button_pressed(BUTTON_A)) + sp1C = func_8029C780(); + + if(0.6 < animctrl_getAnimTimer(aCtrl) && !func_8028B2E8()) + sp1C = BS_2F_FALL; + + if(player_inWater()) + sp1C = BS_4C_LANDING_IN_WATER; + + sp1C = func_8029CA94(sp1C); + + bs_setState(sp1C); +} + +void bstwirl_end(void){ + ability_use(0xC); + _bstwirlHitboxActive = FALSE; +} diff --git a/src/core2/bs/walk.c b/src/core2/bs/walk.c new file mode 100644 index 00000000..a3f27bba --- /dev/null +++ b/src/core2/bs/walk.c @@ -0,0 +1,505 @@ +#include +#include "functions.h" +#include "variables.h" +#include "animation.h" + +void func_80289EA8(f32, f32); +f32 func_80297AB8(void); +void func_802927E0(f32, f32); +f32 func_8029B2E8(void); +int func_80297C04(f32); +void func_8029AD28(f32, s32); +f32 func_80297AF0(void); +void func_80289EF8(f32); +f32 func_8029B30C(void); +f32 func_80257C48(f32, f32, f32); +f32 func_80297A64(void); +void func_80299594(s32, f32); + +// .data +f32 D_80364D70 = 30.0f;//creep_min +f32 D_80364D74 = 80.0f;//creep_max/slow_walk_min +f32 D_80364D78 = 150.0f;//slow_walk_max/walk_min +f32 D_80364D7C = 225.0f;//walk_max/walk_fast_min +f32 D_80364D80 = 500.0f;//walk_fast_max +f32 D_80364D84 = 30.0f; //mud_min +f32 D_80364D88 = 150.0f; //mud_max +f32 D_80364D8C = 125.0f; +f32 D_80364D90 = 1.3f; //walk_slow +f32 D_80364D94 = 0.6f; +f32 D_80364D98 = 1.8f; //creep +f32 D_80364D9C = 1.2f; +f32 D_80364DA0 = 0.92f; //walk +f32 D_80364DA4 = 0.58f; +f32 D_80364DA8 = 0.54f; //walk_fast +f32 D_80364DAC = 0.44f; +f32 D_80364DB0 = 1.2f; //mud +f32 D_80364DB4 = 0.9f; + +// .bss (?) +f32 D_8037D5B0; + +/*.code*/ +void func_802B6D00(void){ + f32 sp1C; + s32 sp18; + + sp1C = func_8029B30C(); + sp18 = func_8029B300(); + if(func_8028B128()){ + if(sp18 == 0){ + func_80297970(0.0f); + }else{//L802B6D48 + func_80297970(func_80257C48(func_8029B2E8(), D_80364D84, D_80364D88)); + } + } + else{//L802B6D78 + switch(sp18){ + case 0://802B6D98 + func_80297970(0.0f); + break; + case 1://802B6DAC + func_80297970(func_80257C48(sp1C, D_80364D70, D_80364D74)); + break; + case 2://802B6DD0 + func_80297970(func_80257C48(sp1C, D_80364D74, D_80364D78)); + break; + case 3://802B6DF4 + func_80297970(func_80257C48(sp1C, D_80364D78, D_80364D7C)); + break; + case 4://802B6E18 + func_80297970(func_80257C48(sp1C, D_80364D7C, D_80364D80)); + break; + } + }//L802B6E34 +} + +void func_802B6E44(void){ + if(func_8028B394()){ + func_80289EF8(ml_map_f(func_80297AF0(), 0.0f, 1.0f, 0.5f, 0.9f)); + }else{ + func_80289EF8(1.0f); + } + +} + +void func_802B6EB0(f32 arg0){ + D_8037D5B0 = arg0; +} + +void func_802B6EBC(void){ + D_8037D5B0 = max_f(0.0f, D_8037D5B0 - time_getDelta()); +} + +int func_802B6EF4(void){ + return D_8037D5B0 == 0.0f; +} + +s32 func_802B6F20(s32 arg0){ + if(button_pressed(BUTTON_B)){ + if( D_80364D7C < func_80297A64()){ + if(can_roll()) + arg0 = BS_ROLL; + }else{//L802B6F74 + if(can_claw()) + arg0 = BS_CLAW; + } + } + return arg0; +} + +f32 func_802B6F9C(void){ + return D_80364D80; +} + +void func_802B6FA8(void){ + func_802B6D00(); +} + +void bswalk_creep_init(void){ + AnimCtrl * s0 = _player_getAnimCtrlPtr(); + f32 sp20; + + if(bs_getPrevState() == BS_2_WALK_SLOW){ + sp20 = anim_getTimer(animctrl_getAnimPtr(s0)); + }else{ + sp20 = 0.0f; + } + animctrl_reset(s0); + animctrl_setIndex(s0, ANIM_BANJO_WALK_CREEP); + animctrl_setDuration(s0, 0.43f); + func_8028774C(s0, sp20); + animctrl_setPlaybackType(s0, ANIMCTRL_LOOP); + func_802875AC(s0, "bswalk.c", 0xe4); + func_8029C7F4(2,1,1,2); + func_80289EA8(0.3f, 1.5f); + func_80289EC8(D_80364D70, D_80364D74, D_80364D98, D_80364D9C); +} + +void bswalk_creep_update(void){ + s32 s0 = 0; + func_802B6E44(); + if(func_8029B2E8() == 0.0f){ + yaw_setIdeal(yaw_get()); + } + + func_8029AD28(0.47f, 4); + func_8029AD28(0.97f, 3); + func_802B6D00(); + switch(func_8029B300()){ + case 0://L802B7160 + if(func_80297C04(1.0f)) + s0 = BS_1_IDLE; + break; + case 2://L802B7180 + s0 = BS_2_WALK_SLOW; + break; + case 3://L802B7188 + s0 = BS_WALK; + break; + case 4: + s0 = BS_WALK_FAST; + break; + }//L802B7194 + if(func_8028B128()) + s0 = BS_WALK_MUD; + + if(func_80294F78()) + s0 = func_802926C0(); + + if(func_8028B094()) + s0 = BS_2F_FALL; + + if(button_held(BUTTON_Z)) + s0 = BS_CROUCH; + + s0 = func_802B6F20(s0); + + if(button_pressed(BUTTON_A)) + s0 = func_8029C780(); + + if(player_isSliding()) + s0 = BS_SLIDE; + + s0 = func_8029CA94(s0); + + if(player_inWater()) + s0 = BS_2D_SWIM_IDLE; + + bs_setState(s0); +} + +void bswalk_slow_init(void){ + AnimCtrl * s0 = _player_getAnimCtrlPtr(); + f32 sp20; + + if(bs_getPrevState() == 3){ + sp20 = anim_getTimer(animctrl_getAnimPtr(s0)); + }else{ + sp20 = 0.0f; + } + animctrl_reset(s0); + animctrl_setIndex(s0, ANIM_BANJO_WALK); + animctrl_setDuration(s0, 0.43f); + func_8028774C(s0, sp20); + animctrl_setPlaybackType(s0, ANIMCTRL_LOOP); + func_802875AC(s0, "bswalk.c", 0x168); + func_8029C7F4(2,1,1,2); + func_80289EA8(0.3f, 1.5f); + func_80289EC8(D_80364D74, D_80364D78, D_80364D90, D_80364D94); +} + +void bswalk_slow_upate(void){ + s32 s0 = 0; + func_802B6E44(); + if(func_8029B2E8() == 0.0f){ + yaw_setIdeal(yaw_get()); + } + + func_8029AD28(0.4f, 4); + func_8029AD28(0.9f, 3); + func_802B6D00(); + switch(func_8029B300()){ + case 0://L802B7160 + if(func_80297C04(3.0f)) + s0 = BS_1_IDLE; + break; + case 1://L802B7180 + s0 = BS_WALK_CREEP; + break; + case 3://L802B7188 + s0 = BS_WALK; + break; + case 4: + s0 = BS_WALK_FAST; + break; + }//L802B7194 + if(func_8028B128()) + s0 = BS_WALK_MUD; + + if(func_80294F78()) + s0 = func_802926C0(); + + if(func_8028B094()) + s0 = BS_2F_FALL; + + if(button_held(BUTTON_Z)) + s0 = BS_CROUCH; + + s0 = func_802B6F20(s0); + + if(button_pressed(BUTTON_A)) + s0 = func_8029C780(); + + if(player_isSliding()) + s0 = BS_SLIDE; + + s0 = func_8029CA94(s0); + + if(player_inWater()) + s0 = BS_2D_SWIM_IDLE; + + bs_setState(s0); +} + +void bswalk_init(void){ + AnimCtrl * s0 = _player_getAnimCtrlPtr(); + f32 sp20 = 0.0f; + + switch(bs_getPrevState()){ + default: + sp20 = 0.0f; + break; + case 2: + case 4: + sp20 = anim_getTimer(animctrl_getAnimPtr(s0)); + break; + } + animctrl_reset(s0); + animctrl_setIndex(s0, ANIM_BANJO_RUN); + animctrl_setDuration(s0, 0.66f); + animctrl_setTransitionDuration(s0, 0.14f); + func_8028774C(s0, sp20); + animctrl_setPlaybackType(s0, ANIMCTRL_LOOP); + func_802875AC(s0, "bswalk.c", 0x1ed); + func_8029C7F4(2,1,1,2); + func_80289EA8(0.3f, 1.5f); + func_80289EC8(D_80364D78, D_80364D7C, D_80364DA0, D_80364DA4); + func_802B6EB0(0.3f); +} + +void bswalk_update(void){ + s32 s0 = 0; + func_802B6E44(); + func_8029AD28(0.4f, 4); + func_8029AD28(0.9f, 3); + func_802B6EBC(); + func_802B6D00(); + switch(func_8029B300()){ + case 0: + case 1: + case 2: + if(func_80297C04(D_80364D78) && func_802B6EF4()) + s0 = BS_2_WALK_SLOW; + break; + case 4: + s0 = BS_WALK_FAST; + break; + }//L802B76B8 + if(func_8028B128()) + s0 = BS_WALK_MUD; + + if(func_8028B4C4() && D_80364D8C < func_80297AB8()){ + s0 = BS_SKID; + } + + if(func_80294F78()) + s0 = func_802926C0(); + + if(func_8028B094()) + s0 = BS_2F_FALL; + + if(button_held(BUTTON_Z)) + s0 = BS_CROUCH; + + s0 = func_802B6F20(s0); + + if(button_pressed(BUTTON_A)) + s0 = func_8029C780(); + + if(player_isSliding()) + s0 = BS_SLIDE; + + s0 = func_8029CA94(s0); + + if(player_inWater()) + s0 = BS_2D_SWIM_IDLE; + + bs_setState(s0); +} + +void bswalk_fast_init(void){ + AnimCtrl * s0 = _player_getAnimCtrlPtr(); + f32 sp28 = 0.0f; + int sp24 = 1; + + switch(bs_getPrevState()){ + case 1: + case 2://L802B780C + if(func_80297AB8() < 200.0f){ + func_802927E0(0.0f, 0.0f); + } + break; + case 0xc: //L802B7844 + sp24 = 0; + break; + case 3: + sp28 = anim_getTimer(animctrl_getAnimPtr(s0)); + + break; + } + animctrl_reset(s0); + animctrl_setSmoothTransition(s0, sp24); + animctrl_setIndex(s0, ANIM_BANJO_RUN); + animctrl_setDuration(s0, 0.66f); + animctrl_setTransitionDuration(s0, 0.1f); + func_8028774C(s0, sp28); + animctrl_setPlaybackType(s0, ANIMCTRL_LOOP); + func_802875AC(s0, "bswalk.c", 0x27d); + func_8029C7F4(2,1,1,2); + func_80289EA8(0.3f, 1.5f); + func_80289EC8(D_80364D7C, D_80364D80, D_80364DA8, D_80364DAC); + pitch_setAngVel(1000.0f, 12.0f); + roll_setAngularVelocity(1000.0f, 12.0f); + func_802B6EB0(0.3f); + +} + +void bswalk_fast_update(void){ + s32 s0 = 0; + func_802B6E44(); + func_80299594(0, 0.5f); + func_8029AD28(0.4f, 4); + func_8029AD28(0.9f, 3); + func_802B6EBC(); + func_802B6D00(); + switch(func_8029B300()){ + case 0://L802B79EC + if(func_80297C04(18.0f)) + s0 = BS_1_IDLE; + + if(func_80294F78()) + s0 = func_802926C0(); + + break; + case 1: + case 2://L802B7A28 + if(func_80297C04(D_80364D78)) + s0 = BS_2_WALK_SLOW; + + if(func_80294F78()) + s0 = func_802926C0(); + + break; + case 3://L802B7A60 + if(func_80297C04(D_80364D7C) && func_802B6EF4()) + s0 = BS_WALK; + + if(func_80294F78()) + s0 = func_802926C0(); + break; + }//L802B7AA4 + if(func_8028B128()) + s0 = BS_WALK_MUD; + + if(func_8028B4C4() && D_80364D8C < func_80297AB8()){ + s0 = BS_SKID; + } + + if(func_8028B094()) + s0 = BS_2F_FALL; + + if(button_held(BUTTON_Z)) + s0 = BS_CROUCH; + + s0 = func_802B6F20(s0); + + if(button_pressed(BUTTON_A)) + s0 = func_8029C780(); + + if(player_isSliding()) + s0 = BS_SLIDE; + + s0 = func_8029CA94(s0); + + if(player_inWater()) + s0 = BS_2D_SWIM_IDLE; + + bs_setState(s0); +} + +void bswalk_fast_end(void){ + pitch_setIdeal(0.0f); + roll_setIdeal(0.0f); +} + +void bswalk_mud_init(void){ + func_8028A010(ANIM_BANJO_WALK_MUD, 0.43f); + func_8029C7F4(2,1,1,2); + func_80289EA8(0.3f, 1.5f); + func_80289EC8(D_80364D84, D_80364D88, D_80364DB0, D_80364DB4); +} + +void bswalk_mud_update(void){ + s32 s0 = 0; + func_802B6E44(); + func_8029AD28(0.4f, 4); + func_8029AD28(0.9f, 3); + func_802B6D00(); + if(!func_8028B128()) + s0 = BS_2_WALK_SLOW; + + if(!func_8029B300()) + s0 = BS_1_IDLE; + + if(func_80294F78()) + s0 = func_802926C0(); + + if(func_8028B094()) + s0 = BS_2F_FALL; + + if(button_held(BUTTON_Z)) + s0 = BS_CROUCH; + + s0 = func_802B6F20(s0); + + if(button_pressed(BUTTON_A)) + s0 = func_8029C780(); + + if(player_isSliding()) + s0 = BS_SLIDE; + + s0 = func_8029CA94(s0); + + if(player_inWater()) + s0 = BS_2D_SWIM_IDLE; + + bs_setState(s0); +} + +void bswalk_drone_init(void){ + bsdrone_init(); + if(func_80289F94(3)){ + func_80289F10(2); + func_80289EA8(0.3f, 1.5f); + func_80289EC8(D_80364D74, D_80364D78, D_80364D90, D_80364D94); + } +} + +void bswalk_drone_update(void){ + bsdrone_update(); +} + +void bswalk_drone_end(void){ + bsdrone_end(); +} diff --git a/src/core2/bs/walrus.c b/src/core2/bs/walrus.c new file mode 100644 index 00000000..909af4a6 --- /dev/null +++ b/src/core2/bs/walrus.c @@ -0,0 +1,777 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8029AD68(f32, s32); +extern f32 ml_vec3f_dot_product(f32[3], f32[3]); + +int func_802B81F0(enum bs_e state); + +/* .data */ +f32 D_80364DC0 = 30.0f; +f32 D_80364DC4 = 400.0f; +f32 D_80364DC8 = 0.6f; +f32 D_80364DCC = 0.4f; +f32 D_80364DD0 = 693.5f; +f32 D_80364DD4 = -1200.0f; +f32 D_80364DD8 = 30.0f; +f32 D_80364DDC = 700.0f; +f32 D_80364DE0 = 0.6f; +f32 D_80364DE4 = 0.44f; +f32 D_80364DE8 = 700.0f; +f32 D_80364DEC = -1200.0f; +u8 D_80364DF0 = 0; +s16 D_80364DF4[] = {SFX_54_BANJO_HOO_1, SFX_55_BANJO_HOO_2, SFX_56_BANJO_HUI}; //sfx_e + +/* .bss */ +f32 D_8037D5C0; +f32 D_8037D5C4; +u8 D_8037D5C8; + +/* .code */ +void func_802B7E00(void) { + u8 temp_t9; + + func_8030EB00(D_80364DF4[D_80364DF0], 1.35f, 1.45f); + D_80364DF0++; + if (D_80364DF0 >= 3) { + D_80364DF0 = 0; + } +} + +void func_802B7E6C(void) { + f32 sp1C; + + sp1C = func_8029B30C(); + if (func_8029B300() == 0) { + func_80297970(0.0f); + return; + } + func_80297970(func_80257C48(sp1C, D_80364DC0, D_80364DC4)); +} + +void func_802B7ECC(void) { + D_8037D5C0 = 0.0f; + if (func_80295530(8) < 3) { + D_8037D5C0 = 1.0f; + } + D_8037D5C0 = mlClamp_f(D_8037D5C0, 0.0f, 1.0f); +} + +void func_802B7F28(void) { + f32 pad44; + f32 sp40; + f32 sp3C; + f32 sp38; + f32 sp2C[3]; + f32 sp20[3]; + + sp38 = D_80364DD8; + sp3C = D_80364DDC; + sp40 = func_8029B30C(); + func_802B7ECC(); + _get_velocity(sp20); + sp20[1] = 0.0f; + if (900.0 < sp20[0] * sp20[0] + sp20[1] * sp20[1] + sp20[2] * sp20[2]) { + ml_vec3f_normalize(sp20); + func_80294480(sp2C); + if ( ml_vec3f_dot_product(sp20, sp2C) < -0.2) { + sp3C += D_8037D5C0 * 350.0; + } + } + if (func_8029B300() == 0) { + func_80297970(0.0f); + return; + } + func_80297970(func_80257C48(sp40, sp38, sp3C)); +} + +void func_802B8048(void){ + if(!func_802B81F0(bs_getNextState())){ + pitch_setIdeal(0.0f); + roll_setIdeal(0.0f); + func_8029B0C0(); + func_8029E070(0); + func_8029E064(0); + miscflag_clear(3); + miscflag_clear(4); + func_80293D74(); + func_8029CF48(4, 0, 0.0f); + } +} + +void func_802B80D0(void) { + if (func_802B8190(bs_getNextState()) == 0) { + func_802B8048(); + func_8029E0E8(0); + } +} + +void func_802B8110(void){ + func_8029CF48(4, 1, 0.15f); +} + +void func_802B813C(void) { + if (func_802B8190(bs_getPrevState()) == 0) { + D_8037D5C0 = 0.0f; + func_8029E0E8(1); + func_8029CF48(4, 1, 0.15f); + } +} + +int func_802B8190(enum bs_e state){ + return state == 0x81 + || state == BS_7D_WALRUS_SLED + || state == BS_7E_WALRUS_SLED + || state == 0x82 + || state == 0x80 + || state == BS_7D_WALRUS_SLED_DRONE; +} + +int func_802B81F0(enum bs_e state){ + return state == BS_67_WALRUS_IDLE + || state == BS_WALRUS_WALK + || state == BS_WALRUS_JUMP + || state == BS_6A_WALRUS_FALL + || state == BS_WALRUS_OW + || state == BS_WALRUS_DIE + || state == BS_WALRUS_DRONE + || func_802B8190(state); +} + +void bswalrus_idle_init(void){ + func_8028A010(0x11f, 4.0f); + func_8029C7F4(1,1,1,2); + func_80297970(0.0f); + pitch_setAngVel(1000.0f, 12.0f); + roll_setAngularVelocity(1000.0f, 12.0f); + func_80293D48(50.0f, 25.0f); + miscflag_set(3); + miscflag_set(4); + func_802900B4(); + func_802B8110(); +} + +void bswalrus_idle_update(void){ + enum bs_e next_state = 0; + + func_80299628(0); + + if(func_8028B094()) + next_state = BS_6A_WALRUS_FALL; + + if(func_80294F78()) + next_state = func_802926C0(); + + if(func_8029B300() > 0) + next_state = BS_WALRUS_WALK; + + if(button_pressed(BUTTON_A)) + next_state = BS_WALRUS_JUMP; + + bs_setState(next_state); +} + +void bswalrus_idle_end(void){ + func_802B8048(); + func_802900FC(); +} + +void bswalrus_walk_init(void){ + func_8028A010(0x120, 0.8f); + func_8029C7F4(2,1,1,2); + func_80289EC8(D_80364DC0, D_80364DC4, D_80364DC8, D_80364DCC); + func_802900B4(); + func_802B8110(); +} + +void bswalrus_walk_update(void){ + enum bs_e next_state = 0; + + func_80299628(0); + func_802B7E6C(); + func_8029AD68(0.3f, 4); + + if(func_8029B300() == 0 && func_80297C04(1.0f)) + next_state = BS_67_WALRUS_IDLE; + + if(func_8028B094()) + next_state = BS_6A_WALRUS_FALL; + + if(button_pressed(BUTTON_A)) + next_state = BS_WALRUS_JUMP; + + bs_setState(next_state); +} + +void bswalrus_walk_end(void){ + func_802B8048(); + func_802900FC(); +} + +void bswalrus_jump_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, FALSE); + animctrl_setIndex(aCtrl, 0x121); + animctrl_setSubRange(aCtrl, 0.0f, 0.514f); + animctrl_setDuration(aCtrl, 1.0f); + func_8028774C(aCtrl, 0.1); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bswalrus.c", 0x1f8); + func_8029C7F4(1,1,3,6); + if(func_8029B2E8() != 0.0f) + yaw_setIdeal(func_8029B33C()); + func_8029797C(yaw_getIdeal()); + func_802B7E6C(); + func_802979AC(yaw_getIdeal(), func_80297A64()); + player_setYVelocity(D_80364DD0); + gravity_set(D_80364DD4); + func_802B7E00(); + func_802B8110(); + D_8037D5C8 = 0; +} + +void bswalrus_jump_update(void){ + enum bs_e next_state = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp1C[3]; + + func_802B7E6C(); + _get_velocity(sp1C); + if(button_released(BUTTON_A) && 0.0f < sp1C[1]) + gravity_reset(); + + switch(D_8037D5C8){ + case 0://L802B86D8 + if(func_8028B254(0x82)){ + animctrl_setDuration(aCtrl, 0.7f); + animctrl_setSubRange(aCtrl, 0.0f, 0.8501f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D5C8 = 2; + } + else if(animctrl_isStopped(aCtrl)){ + animctrl_setSubRange(aCtrl, 0.0f, 0.6734f); + animctrl_setDuration(aCtrl, 3.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D5C8 = 1; + } + break; + case 1://L802B876C + if(func_8028B254(0x82)){ + animctrl_setSubRange(aCtrl, 0.0f, 0.8501f); + animctrl_setDuration(aCtrl, 1.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D5C8 = 2; + } + break; + case 2://L802B87B4 + func_80299628(0); + if(func_8028B2E8()){ + func_8029AE48(); + animctrl_setSubRange(aCtrl, 0.0f, 1.0f); + animctrl_setDuration(aCtrl, 1.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D5C8 = 3; + } + break; + case 3://L802B880C + func_80299628(0); + if(animctrl_isStopped(aCtrl)){ + func_80297970(0.0f); + next_state = BS_67_WALRUS_IDLE; + } + break; + }//L802B8838 + + if(func_8028B2E8()){ + if(func_8029B300() > 0) + next_state = BS_WALRUS_WALK; + + if(button_pressed(BUTTON_A)) + next_state = BS_WALRUS_JUMP; + } + + bs_setState(next_state); +} + +void bswalrus_jump_end(void){ + gravity_reset(); + func_802B8048(); +} + +void bswalrus_fall_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, 0x121); + func_8028774C(aCtrl, 0.662f); + animctrl_setDuration(aCtrl, 0.7f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED); + func_802875AC(aCtrl, "bswalrus.c", 0x284); + func_8029C7F4(1,1,3,6); + func_802B8110(); + D_8037D5C8 = 0; +} + +void bswalrus_fall_update(void){ + enum bs_e next_state = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp1C[3]; + + func_80299628(0); + func_802B7E6C(); + _get_velocity(sp1C); + + switch (D_8037D5C8) + { + case 0://L802B89A4 + if(func_8028B254(0x82)){ + animctrl_setSubRange(aCtrl, 0.0f, 0.8501f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D5C8 = 1; + } + break; + case 1://L802B89E0 + if(func_8028B2E8()){ + func_8029AE48(); + func_80297970(0.0f); + animctrl_setSubRange(aCtrl, 0.0f, 1.0f); + animctrl_setDuration(aCtrl, 1.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + D_8037D5C8 = 2; + } + break; + case 2://L802B8A38 + break; + }//L802B8A38 + + if(func_8028B2E8()){ + if( func_8029B300() > 0 + || (D_8037D5C8 == 2 && animctrl_isStopped(aCtrl)) + ){ + if(miscflag_isTrue(0x19)) + next_state = func_80292738(); + else + next_state = BS_67_WALRUS_IDLE; + } + } + + bs_setState(next_state); +} + +void bswalrus_fall_end(void){ + func_802B8048(); +} + +static void __bswalrus_recoil_init(s32 damage){ + f32 sp3C; + f32 sp30[3]; + f32 sp24[3]; + + func_80298760(func_80296560()); + func_8028A274(0x19c, 1.0f); + if(damage == 1) + func_8030E58C(SFX_38_BANJO_AYE_1, 1.8f); + else + func_8030E58C(SFX_56_BANJO_HUI, 1.8f); + + _player_getPosition(sp30); + func_80294980(sp24); + func_80257F18(sp24, sp30, &sp3C); + yaw_setIdeal(mlNormalizeAngle(sp3C + 180.0f)); + yaw_applyIdeal(); + func_80297970(func_802987D4()); + func_8029797C(sp3C); + func_802979AC(sp3C, func_80297A64()); + func_8029C7F4(1,1,2,3); + player_setYVelocity(func_802987C4()); + gravity_set(func_802987E4()); + func_8028D5DC(); + func_80292E48(); + func_802B8110(); +} + +static void __bswalrus_recoil_update(void){ + enum bs_e next_state = 0; + if(baanim_isAt(0.5f)) + func_80292EA4(); + + if(func_8028B2E8()) + next_state = BS_67_WALRUS_IDLE; + + bs_setState(next_state); +} + +static void __bswalrus_recoil_end(void){ + gravity_reset(); + func_8028D5F4(); + func_80292EA4(); + func_802B8048(); +} + +void bswalrus_ow_init(void){ + __bswalrus_recoil_init(1); +} + +void bswalrus_ow_update(void){ + __bswalrus_recoil_update(); +} + +void bswalrus_ow_end(void){ + __bswalrus_recoil_end(); +} + +void bswalrus_bounce_init(void){ + __bswalrus_recoil_init(2); +} + +void bswalrus_bounce_update(void){ + __bswalrus_recoil_update(); +} + +void bswalrus_bounce_end(void){ + __bswalrus_recoil_end(); +} + +void bswalrus_die_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp38; + f32 sp2C[3]; + f32 sp20[3]; + + func_8029B930(); + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, FALSE); + animctrl_setIndex(aCtrl, 0x19d); + animctrl_setSubRange(aCtrl, 0.0f, 0.4454f); + animctrl_setDuration(aCtrl, 2.2f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bswalrus.c", 0x366); + func_8030E58C(SFX_36_BANJO_DOH, 1.8f); + _player_getPosition(sp2C); + func_80294980(sp20); + func_80257F18(sp20, sp2C, &sp38); + D_8037D5C4 = 250.0f; + yaw_setIdeal(mlNormalizeAngle(sp38 + 180.0f)); + yaw_applyIdeal(); + func_80297970(D_8037D5C4); + func_8029797C(sp38); + func_802979AC(sp38, func_80297A64()); + func_8029C7F4(1,1,2,3); + player_setYVelocity(420.0f); //B) + gravity_set(-1200.0f); + pitch_setAngVel(1000.0f, 12.0f); + func_802914CC(0xd); + func_802BF2C0(30.0f); + func_8025AB00(); + func_8025A2FC(0, 0xfa0); + func_8025A70C(0x1A); + func_8028D5DC(); + func_80292E48(); + func_8029E3C0(0, 1.5f); + func_802B8110(); + D_8037D5C8 = 0; +} + +void bswalrus_die_update(void){ + enum bs_e next_state = 0; + + func_80297970(D_8037D5C4); + func_80299628(0); + switch(D_8037D5C8){ + case 0://L802B8F54 + if(func_8028B2E8()){ + func_8028A37C(1.0f); + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); + FUNC_8030E624(SFX_39_BANJO_AYE_2, 1.8f, 18000); + player_setYVelocity(400.0f); + D_8037D5C8 = 2; + } + break; + case 2://L802B8FA8 + D_8037D5C8 = 3; + break; + case 3://L802B8FB0 + if(0.0f < D_8037D5C4){ + D_8037D5C4 = max_f(0.0f, D_8037D5C4 - 10.0f); + } + break; + }//L802B8FE0 + + if(func_8029E1A8(0)) + func_8029B890(); + + bs_setState(next_state); +} + +void bswalrus_die_end(void){ + func_8024BD08(0); + gravity_reset(); + pitch_setIdeal(0.0f); + roll_setIdeal(0.0f); + func_80291548(); + func_80292EA4(); +} + +void bswalrus_drone_init(void){ + func_802B8110(); + bsdrone_init(); +} + +void bswalrus_drone_update(void){ + bsdrone_update(); +} + +void bswalrus_drone_end(void){ + bsdrone_end(); + func_802B8048(); +} + +void func_802B90D0(void){ + func_8028A010(0x19e, 0.8f); + func_8029C7F4(1,1,3,2); + func_80297970(0.0f); + func_8029C674(); + func_802B813C(); + func_802B3A50(); +} + +void func_802B9130(void){ + enum bs_e next_state = 0; + func_802B3A50(); + func_80299628(0); + func_8029C6D0(); + if(!func_80298850()) + next_state = BS_7D_WALRUS_SLED; + + bs_setState(next_state); +} + +void func_802B917C(void){ + func_8029C748(); + func_802B80D0(); +} + +void bswalrus_sled_init(void){ + func_8028A010(0x19e, 0.8f); + func_8029C7F4(2,1,1,2); + func_80289EC8(D_80364DC0, D_80364DC4, D_80364DE0, D_80364DE4); + func_802900B4(); + func_802B813C(); +} + +void bswalrus_sled_update(void){ + enum bs_e next_state = 0; + f32 sp20[3]; + + if(50.0f < func_80297AB8()){ + if(func_8023DB4C(1)){ + func_80292554(&sp20); + }else{ + func_80292578(&sp20); + } + particleEmitter_emitN(func_802F1EC8(sp20), 1); + }//L802B927C + + func_80299628(0); + func_802B7F28(); + if(func_80294F78()) + next_state = func_802926C0(); + + if(button_pressed(BUTTON_A)) + next_state = BS_7E_WALRUS_SLED; + + next_state = func_8029CA94(next_state); + bs_setState(next_state); +} + +void bswalrus_sled_end(void){ + func_802B80D0(); + func_802900FC(); +} + +void bswalrus_sled_jump_init(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + animctrl_setSmoothTransition(aCtrl, FALSE); + animctrl_setIndex(aCtrl, 0x19f); + animctrl_setSubRange(aCtrl, 0.0f, 0.4285f); + animctrl_setDuration(aCtrl, 1.0f); + func_8028774C(aCtrl, 0.14f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_ONCE); + func_802875AC(aCtrl, "bswalrus.c", 0x477); + func_8029C7F4(1,1,3,6); + if(func_8029B2E8() != 0.0f) + yaw_setIdeal(func_8029B33C()); + func_8029797C(yaw_getIdeal()); + func_802B7F28(); + func_802979AC(yaw_getIdeal(), func_80297A64()); + player_setYVelocity(D_80364DD0); + gravity_set(D_80364DD4); + func_802B7E00(); + func_802B813C(); + D_8037D5C8 = 0; +} + +void bswalrus_sled_jump_update(void){ + enum bs_e next_state = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp1C[3]; + + func_802B7F28(); + _get_velocity(sp1C); + + if(button_released(BUTTON_A) && 0.0f < sp1C[1]) + gravity_reset(); + + switch (D_8037D5C8) + { + case 0: + if(animctrl_isStopped(aCtrl)){ + func_8028A3B8(0.5058f, 7.0f); + D_8037D5C8 = 1; + } + break; + case 1://L802B94F0 + if(func_8028B254(0x82)){ + func_8028A3B8(1.0f, 1.0f); + D_8037D5C8 = 2; + } + break; + case 2://L802B951C + if(animctrl_isStopped(aCtrl)){ + next_state = BS_7D_WALRUS_SLED; + } + break; + }//L802B9530 + + if(func_8028B2E8()){ + if(button_pressed(BUTTON_A)) + next_state = BS_7E_WALRUS_SLED; + + next_state = func_8029CA94(next_state); + } + + bs_setState(next_state); +} + +void bswalrus_sled_jump_end(void){ + gravity_reset(); + func_802B80D0(); +} + +void func_802B95A0(void){ + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + animctrl_reset(aCtrl); + animctrl_setIndex(aCtrl, 0x19f); + animctrl_setSubRange(aCtrl, 0.0f, 0.5058f); + animctrl_setDuration(aCtrl, 1.0f); + animctrl_setPlaybackType(aCtrl, ANIMCTRL_STOPPED); + func_802875AC(aCtrl, "bswalrus.c", 0x4e2); + func_8029C7F4(1,1,3,6); + func_802B813C(); + D_8037D5C8 = 0; +} + +void func_802B963C(void){ + enum bs_e next_state = 0; + AnimCtrl *aCtrl = _player_getAnimCtrlPtr(); + f32 sp1C[3]; + + func_80299628(0); + func_802B7E6C(); + _get_velocity(sp1C); + switch (D_8037D5C8) + { + case 0://L802B9694 + if(func_8028B254(0x82)){ + func_8028A3B8(1.0f, 1.0f); + D_8037D5C8 = 1; + } + break; + case 1://L802B96C0 + if(func_8028B2E8()){ + func_8029AE48(); + func_80297970(0.0f); + D_8037D5C8 = 2; + } + break; + case 2: + break; + }//L802B96F0 + + if(func_8028B2E8()){ + if( func_8029B300() > 0 + || (D_8037D5C8 == 2 && animctrl_isStopped(aCtrl)) + ){ + next_state = BS_7D_WALRUS_SLED; + } + + if(button_pressed(BUTTON_A)) + next_state = BS_7E_WALRUS_SLED; + + next_state = func_8029CA94(next_state); + }//L802B9754 + + + bs_setState(next_state); +} + +void func_802B976C(void){ + func_802B8048(); +} + +void func_802B978C(void) { + func_8028A180(0x1A9, 3.2f); + func_8029C7F4(1, 1, 3, 7); + func_80297970(0.0f); + func_802914CC(0xD); + func_802BF2C0(60.0f); + func_8025A58C(0, 0xFA0); + func_8025A70C(COMUSIC_3C_MINIGAME_LOSS); + func_8024BD08(0); + func_8028D5DC(); + func_8029E3C0(0, 2.9f); + func_802B813C(); + func_80292E48(); +} + +void func_802B9830(void) { + yaw_setIdeal(func_8029B41C() + 35.0f); + func_80299628(0); + if (func_8029E1A8(0) != 0) { + func_8029B6F0(); + } +} + +void func_802B9880(void) { + func_80291548(); + func_8024BD08(1); + func_8025A904(); + func_80292EA4(); + func_802B80D0(); +} + +void func_802B98C0(void) { + if (bs_getInterruptType() == 0x2B) { + func_8029A86C(2); + bs_setState(BS_67_WALRUS_IDLE); + return; + } + func_80296608(); +} + +void bswalrus_sled_drone_init(void){ + func_802B813C(); + bsdrone_init(); +} + +void bswalrus_sled_drone_update(void){ + bsdrone_update(); +} + +void bswalrus_sled_drone_end(void){ + bsdrone_end(); + func_802B80D0(); +} \ No newline at end of file diff --git a/src/core2/bs/washy.c b/src/core2/bs/washy.c new file mode 100644 index 00000000..86299e09 --- /dev/null +++ b/src/core2/bs/washy.c @@ -0,0 +1,103 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +u8 D_8037D5D0; + +/* .code */ +void func_802B9980(s32 arg0){ + AnimCtrl *plyr_anim = _player_getAnimCtrlPtr(); + + switch (arg0) + { + case 1: //L802B99B8 + func_802BB3DC(0, 30.0f, 0.6f); + func_8030E58C(SFX_82_METAL_BREAK, 0.8f); + player_setYVelocity(400.0f); + break; + case 2: //L802B99F4 + func_802BB3DC(0, 10.0f, 0.6f); + player_setYVelocity(300.0f); + break; + case 3: //L802B9A20 + func_8029E3C0(0, 0.01f); + break; + case 4: //L802B9A38 + FUNC_8030E624(SFX_3EB_UNKNOWN, 0.7f, 25000); + func_8029E3C0(0, 0.25f); + break; + case 5: //L802B9A58 + func_8030E58C(SFX_D0_GRIMLET_SQUEAK, 0.9f); + animctrl_setDuration(plyr_anim, 2.2f); + break; + case 6: //L802B9A84 + func_8029E3C0(0, 0.01f); + case 0: //L802B9A94 + break; + } + D_8037D5D0 = arg0; +} + +void func_802B9AAC(void){ + func_802900FC(); +} + +void func_802B9ACC(void){ + func_8028A180(ASSET_281_ANIM_WISHYWASHY_DOOOH, 40.0f); + func_8029C7F4(1, 1, 3, 2); + func_802900B4(); + func_802B9980(0); +} + +void func_802B9B14(void){ + s32 next_state = 0; + s32 sp18; + + switch(D_8037D5D0){ + case 0: // L802B9B48 + if(func_8028B2E8()) + func_802B9980(1); + break; + case 1: // L802B9B68 + if(func_8028B2E8()) + func_802B9980(2); + break; + case 2: // L802B9B88 + if(func_8028B2E8()) + func_802B9980(3); + break; + case 3: // L802B9BA8 + if(func_8029E1A8(0)) + func_802B9980(4); + break; + case 4: // L802B9BC8 + if(func_8029E1A8(0)) + func_802B9980(5); + break; + case 5: // L802B9BE8 + if(baanim_isStopped()){ + if(func_8028ADF0()) + next_state = BS_1_IDLE; + else + func_802B9980(6); + } + break; + case 6: // L802B9C20 + if(func_8029E1A8(0)){ + sp18 = func_802F9AA8(SFX_12B_BOILING_AND_BUBBLING); + func_802F9DB8(sp18, 1.0f, 1.2f, 0.0f); + func_802F9F80(sp18, 0.05f, 0.05 + randf()*0.4, 0.1f); + func_802FA060(sp18, 28000, 32000, 0.0f); + func_8029E3C0(0, 0.8 + randf()*0.7); + } + break; + } + + bs_setState(next_state); +} + +void func_802B9D00(void){ + if(bs_getInterruptType() == 0xA) + func_80296608(); +} diff --git a/src/core2/bsList.c b/src/core2/bsList.c new file mode 100644 index 00000000..a91b677b --- /dev/null +++ b/src/core2/bsList.c @@ -0,0 +1,53 @@ +#include +#include "functions.h" +#include "variables.h" +#include "bsint.h" + + + +//TODO replace with bsList Count +bsState D_8037C700[166]; + +/* .code */ +void bsList_clearAll(void){ + s32 i = 0; + do{ + bsList_setInitMethod(i, NULL); + bsList_setUpdateMethod(i, NULL); + bsList_setEndMethod(i, NULL); + bsList_setInterruptMethod(i, NULL); + i++; + }while(i != 0xa6); +} + +void bsList_setInitMethod(enum bs_e i, bsStateMethod func){ + D_8037C700[i].init_func = func; +} + +void bsList_setUpdateMethod(s32 i, bsStateMethod func){ + D_8037C700[i].update_func = func; +} + +void bsList_setEndMethod(s32 i, bsStateMethod func){ + D_8037C700[i].end_func = func; +} + +void bsList_setInterruptMethod(s32 i, bsStateMethod func){ + D_8037C700[i].interrupt_func = func; +} + +bsStateMethod bsList_getInitMethod(s32 i){ + return D_8037C700[i].init_func; +} + +bsStateMethod bsList_getUpdateMethod(s32 i){ + return D_8037C700[i].update_func; +} + +bsStateMethod bsList_getEndMethod(s32 i){ + return D_8037C700[i].end_func; +} + +bsStateMethod bsList_getInterruptMethod(s32 i){ + return D_8037C700[i].interrupt_func; +} diff --git a/src/core2/ch/badShad.c b/src/core2/ch/badShad.c new file mode 100644 index 00000000..1b9c6542 --- /dev/null +++ b/src/core2/ch/badShad.c @@ -0,0 +1,162 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802C3D3C(void (*)(s32, s32), s32, s32); + +Actor *func_802D6F48(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); +void func_802D6EA0(Actor *this); +void func_802D729C(Actor *actor, f32 arg1); + +/* .data */ +ActorInfo D_80367A50 = { + 0x9B, 0x108, 0x3BF, + 0x1, NULL, + func_802D6EA0, func_80326224, func_802D6F48, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +f32 D_8037DE10[3]; +f32 D_8037DE20[3]; + +/* .code */ +void func_802D6EA0(Actor *this){ + s32 iVar1; + if(!this->initialized){ + this->initialized = 1; + this->marker->collidable = 0; + } + if(!this->despawn_flag && this->unk1C_x < (f32)(func_8023DB5C() - 1) ){ + if(this->unk104){ + marker_getActor(this->unk104)->unk104 = 0; + } + marker_despawn(this->marker); + } +} + +Actor *func_802D6F48(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + f32 sp44[3]; + f32 sp40; + Actor *this = func_80325300(marker, sp44); + Actor *other; + if(this->despawn_flag) + return this; + + if(this->unk104){ + other = marker_getActor(this->unk104); + } + + if(other) + func_8033A410(other->alpha_124_19); + sp40 = ml_map_f(this->unk28, 0.0f , 800.0f, 0.53f, 0.18f)*this->unk1C[1]; + set_model_render_mode(2); + func_803391A4(gfx, mtx, this->position, sp44, sp40, NULL, func_80330B1C(marker)); + return this; +} + +f32 func_802D7038(Actor *this) { + f32 sp34; + f32 sp28[3]; + + sp34 = 0.0f; + if( (this->spawn_position_x == this->position_x) + && (this->spawn_position_z == this->position_z) + ){ + D_8037DE10[0] = this->spawn_position[0]; + D_8037DE10[1] = this->spawn_position[1]; + D_8037DE10[2] = this->spawn_position[2]; + } else { + this->spawn_position[0] = this->position[0]; + this->spawn_position[2] = this->position[2]; + sp28[0] = this->position[0]; + sp28[1] = this->position[1]; + sp28[2] = this->position[2]; + if (func_803209F8(D_8037DE10, D_8037DE20, &sp34, sp28)) { + this->spawn_position[1] = D_8037DE10[1]; + } else { + D_8037DE10[0] = sp28[0]; + D_8037DE10[1] = sp28[1]; + D_8037DE10[2] = sp28[2]; + this->spawn_position[1] = sp28[1]; + } + } + return sp34; +} + +void func_802D7124(Actor *actor, f32 arg1) { + f32 sp1C[3]; + + func_8024C5CC(&sp1C); + if ((actor->position[0] - sp1C[0]) * (actor->position[0] - sp1C[0]) + (actor->position[2] - sp1C[2]) * (actor->position[2] - sp1C[2]) < 12250000.0f) { + func_802D729C(actor, arg1); + } +} + + +void func_802D71A0(s32 this, s32 arg1){ + ActorMarker *marker; + f32 sp40; + Actor *sp3C; + Actor *sp38; + s32 sp2C[3]; + f32 sp28; + + marker = reinterpret_cast(ActorMarker *,this); + sp38 = marker_getActor(marker); + if(!sp38->despawn_flag){ + sp40 = reinterpret_cast(f32,arg1); + sp38 = marker_getActor(marker); + sp28 = func_802D7038(sp38); + sp2C[0] = (s32) D_8037DE10[0]; + sp2C[1] = (s32) D_8037DE10[1]; + sp2C[2] = (s32) D_8037DE10[2]; + sp3C = func_803056FC(0x108, sp2C, (s32)sp38->yaw); + if(sp3C){ + marker_getActor(marker)->unk104 = sp3C->marker; + sp3C->unk104 = marker; + sp3C->unk1C[0] = func_8023DB5C(); + sp3C->unk1C[1] = sp40; + sp3C->unk28 = sp28; + } + } +} + +void func_802D729C(Actor *actor, f32 arg1){ + Actor *sp1C; + if(actor->despawn_flag){ + if(actor->unk104){ + sp1C = marker_getActor(actor->unk104); + sp1C->unk104 = NULL; + marker_getActor(actor->unk104)->despawn_flag = TRUE; + } + else{ + } + actor->unk104 = NULL; + return; + } + if(!actor->unk104){ + func_802C3D3C(func_802D71A0, (s32) actor->marker, reinterpret_cast(s32, arg1)); + return; + } + + sp1C = marker_getActor(actor->unk104); + if(sp1C->despawn_flag == TRUE) + return; + + if(!((func_8023DB5C() ^ actor->marker->actrArrayIdx) & 0x7)){ + sp1C->unk28 = func_802D7038(actor); + sp1C->position_x = D_8037DE10[0]; + sp1C->position_y = D_8037DE10[1] + 6.0f; + sp1C->position_z = D_8037DE10[2]; + sp1C->yaw = D_8037DE20[1]; + sp1C->pitch = D_8037DE20[0]; + sp1C->roll = D_8037DE20[2]; + } + else{ + sp1C->position_x = actor->position_x; + sp1C->position_z = actor->position_z; + } + sp1C->unk1C[0] = func_8023DB5C(); + sp1C->unk1C[1] = arg1; +} diff --git a/src/core2/ch/beehive.c b/src/core2/ch/beehive.c new file mode 100644 index 00000000..db2c57c0 --- /dev/null +++ b/src/core2/ch/beehive.c @@ -0,0 +1,89 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_802CE8D4(Actor *this); + +/* .data */ +ActorAnimationInfo D_803672C0[] ={ + {0x000, 0.0f}, + {ASSET_165_ANIM_BEEHIVE_IDLE, 0.65f}, + {ASSET_65_ANIM_BEEHIVE_DIE, 0.5f}, + {ASSET_65_ANIM_BEEHIVE_DIE, 1000000.0f}, +}; + +ActorInfo D_803672E0 = {0x50, ACTOR_12_BEEHIVE, ASSET_364_MODEL_BEEHIVE, + 1, &D_803672C0, + func_802CE8D4, func_80326224, func_80325888, + 0, 0x333, 0.0f, 0 +}; + +/* .code */ +void func_802CE7E0(ActorMarker *marker, s32 arg1){ + Actor *actor = marker_getActor(marker); + FUNC_8030E8B4(SFX_11_WOOD_BREAKING_1, 1.0f, 28000, actor->position, 300, 3000); + FUNC_8030E8B4(SFX_D_EGGSHELL_BREAKING, 1.0f, 28000, actor->position, 300, 3000); + func_80328A84(actor, 2); + actor_playAnimationOnce(actor); + marker->collidable = FALSE; + actor->unk138_27 = 3; + func_802C3F04(func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, actor->position[0]), reinterpret_cast(s32, actor->position[1]), reinterpret_cast(s32, actor->position[2])); + func_802C3F04(func_802C4140, ACTOR_4A_WOOD_EXPLOSION, reinterpret_cast(s32, actor->position[0]), reinterpret_cast(s32, actor->position[1]), reinterpret_cast(s32, actor->position[2])); + actor->marker->propPtr->unk8_3 = 0; + func_803115C4(ASSET_D96_TEXT_BEEHIVE); + func_803115C4(ASSET_DA6_TEXT_BEEHIVE_WITH_BEES); +} + +void func_802CE8D4(Actor *this){ + if(!this->unk16C_4){ + marker_setCollisionScripts(this->marker, NULL, NULL, func_802CE7E0); + this->marker->propPtr->unk8_3 = 1; + this->unk44_31 = func_8030D90C(); + this->unk16C_4 = 1; + this->unk38_0 = func_803203FC(1)| func_803203FC(0x1F); + }//L802CE960 + if(map_get() == MAP_27_FP_FREEZEEZY_PEAK){ + if(func_8038BFA0()){ + this->unk58_0 = 0; + return; + } + this->unk58_0 = 1; + }//L802CE9A4 + switch(this->state) + { + case 1://L802CE9C4 + if( !func_8031FF1C(BKPROG_D_BEEHIVE_TEXT) + && func_803296B8(this, 250, 300) + ){ + if(func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT){ + if( player_getTransformation() == TRANSFORM_1_BANJO + && func_80311480(ASSET_D96_TEXT_BEEHIVE, 0, NULL, NULL, NULL, 0) + ){ + func_80320004(BKPROG_D_BEEHIVE_TEXT, 1); + } + } + }//L802CEA48 + if( actor_animationIsAt(this, 0.45f) + || actor_animationIsAt(this, 0.55f) + || actor_animationIsAt(this, 0.6f) + ){ + if(!this->unk38_0){ + func_8030E394(this->unk44_31); + sfxsource_setSfxId(this->unk44_31, SFX_67_BEEHIVE_CLONK); + sfxsource_setSampleRate(this->unk44_31, 12000); + func_8030DBB4(this->unk44_31, (animctrl_getAnimTimer(this->animctrl) + 0.9) - 0.4); + func_8030DF68(this->unk44_31, this->position); + func_8030DEB4(this->unk44_31, 300.0f, 1500.0f); + func_8030DD14(this->unk44_31, 3); + func_8030E2C4(this->unk44_31); + } + }//L802CEB48 + break; + case 2://L802CEB2C + if(animctrl_isStopped(this->animctrl)){ + func_80326310(this); + } + break; + }//L802CEB48 +} + diff --git a/src/core2/ch/bigbutt.c b/src/core2/ch/bigbutt.c new file mode 100644 index 00000000..a9a9f558 --- /dev/null +++ b/src/core2/ch/bigbutt.c @@ -0,0 +1,386 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_802C6240(Actor *); +Actor *func_802C6E84(ActorMarker *, Gfx **, Mtx **, Vtx **); +/*.data */ +ActorAnimationInfo D_80366010[] ={ + {0x00, 0.0f}, + {ASSET_33_ANIM_BIGBUTT_EAT, 5.5f}, + {ASSET_36_ANIM_BIGBUTT_WALK, 0.7f}, + {ASSET_10_ANIM_BIGBUTT_RUN, 0.8f}, + {ASSET_21_ANIM_BIGBUTT_SLIDE, 0.9f}, + {ASSET_32_ANIM_BIGBUTT_ATTACK, 1.1f}, + {ASSET_35_ANIM_BIGBUTT_ALERT, 0.6f}, + {ASSET_34_ANIM_BIGBUTT_DIE, 4.0f}, + {ASSET_36_ANIM_BIGBUTT_WALK, 1.3f}, + {ASSET_10_ANIM_BIGBUTT_RUN, 0.6f}, + {ASSET_33_ANIM_BIGBUTT_EAT, 5.5f}, + {ASSET_36_ANIM_BIGBUTT_WALK, 1.3f}, + {ASSET_253_ANIM_BIGBUTT_OW, 0.7f}, + {ASSET_254_ANIM_BIGBUTT_FALL, 1.1f}, + {ASSET_254_ANIM_BIGBUTT_FALL, 1000000000.0f}, + {ASSET_255_ANIM_BIGBUTT_GET_UP, 1.0f}, +}; + + +ActorInfo D_80366090 = {0x3, ACTOR_4_BIGBUTT, ASSET_353_MODEL_BIGBUTT, + 1, D_80366010, + func_802C6240, func_80326224, func_802C6E84, + 3200, 0, 0.0f, 0 +}; + +ActorInfo D_803660B4 = {0x9, ACTOR_E_BULL_INTRO, ASSET_354_MODEL_BULL_INTRO, + 1, D_80366010, + func_802C6240, func_80326224, func_802C6E84, + 3200, 0, 0.0f, 0 +}; + +/* .code */ +void func_802C5E80(Actor *this){ + this->unk28 = randf2(3.5f, 4.9f); +} + +void func_802C5EB8(Actor *this){ + if(func_803203FC(0xC1)) + return; + + if(this->unk38_31){ + this->unk38_31--; + } + else{ + if(func_80329530(this, 1200) && func_803292E0(this)){ + func_80328A84(this, 8); + } + } +} + +void func_802C5F44(Actor *this){ + if(!func_80329530(this, 1200) || !func_803292E0(this)){ + func_80328B8C(this, 1, 0.16f, 1); + } +} + +void func_802C5F94(Actor *this){ + func_80328A84(this, 2); + func_802C5E80(this); + func_80328CEC(this, (s32)this->yaw_moving, 135, 175); + this->unk38_31 = 150; +} + +void func_802C5FF8(Actor *this){ + if( !this->unk138_28 + && actor_animationIsAt(this, 0.4f) + && randf() < 0.14 + && func_8028EE84() != BSWATERGROUP_2_UNDERWATER + ){ + func_8030E878(SFX_2B_BULL_MOO_1, randf2(0.9f, 1.1f), 32000, this->position, 0.0f, 2000.0f); + } +} + +void func_802C60AC(ActorMarker *marker, ActorMarker *other_marker){ + Actor *actor = marker_getActor(marker); + if( actor->state == 4 + && 5.0 <= actor->unk28 + && func_803294F0(actor, 80, func_80329784(actor)) + ){ + animctrl_setPlaybackType(actor->animctrl, ANIMCTRL_ONCE); + func_80328A84(actor, 5); + func_8030E58C(SFX_1E_HITTING_AN_ENEMY_2, 1.0f); + } +} + +void func_802C6150(ActorMarker *marker, ActorMarker *other_marker){ + Actor *actor = marker_getActor(marker); + func_80328AC8(actor, 0xC); + func_8030E878(SFX_2B_BULL_MOO_1, randf2(1.28f, 1.37f), 32000, actor->position, 0.0f, 2000.0f); +} + +void func_802C61C0(ActorMarker *marker, ActorMarker *other_marker){ + Actor *actor = marker_getActor(marker); + if( actor->state != 0xd + && actor->state != 0xe + && actor->state != 0xf + ){ + func_80328AC8(actor, 0xd); + FUNC_8030E8B4(SFX_143_BULL_DAMAGE, 1.0f, 16000, actor->position, 0, 2000); + FUNC_8030E8B4(SFX_143_BULL_DAMAGE, 1.0f, 16000, actor->position, 0, 2000); + } +} + +//chBigbuttUpdate +void func_802C6240(Actor *this){ + s32 sp2C; + u8 tmp_a0; + f32 tmp_f0; + + + if(!this->initialized){ + this->marker->unk1C = func_802C61C0; + this->marker->unkC = func_802C60AC; + this->marker->unk10 = func_802C6150; + this->unk138_24 = 0; + this->unk16C_0 = 1; + this->initialized = TRUE; + return; + }//L802C62BC + switch(this->state){ + case 0x1: //L802C62E4 + this->unk10_12 = 3; + sp2C = func_8032863C(this->animctrl, 0.16f, 0.55f); + if(!this->unk138_28){ + if( actor_animationIsAt(this, 0.157f) + || actor_animationIsAt(this, 0.289f) + || actor_animationIsAt(this, 0.4f) + || actor_animationIsAt(this, 0.536f) + ){ + if(func_8028EE84() != BSWATERGROUP_2_UNDERWATER){ + func_8030E878(SFX_C8_CRUNCH,randf2(0.93f, 1.07f),10000, this->position, 0.0f, 1800.0f); + } + } + }//L802C63C4 + if(sp2C == 2){ + func_80328A2C(this, 0.55f, 1, 0.35f); + } + func_802C5FF8(this); + if( func_8032863C(this->animctrl, 0.65f, 0.99f) >= 2 + && !func_80328A2C(this, 0.0f, -1, 0.45f) + && func_80328BD4(this, 2, 0.0f, -1, 0.58f) + ){ + func_80328CEC(this, (s32)this->yaw, 10, 45); + func_802C5E80(this); + }//L802C647C + func_802C5EB8(this); + break; + + case 0x2: //L802C6494 + func_802C5FF8(this); + func_80328FB0(this, 2.0f); + if(!func_80329030(this, 0) && func_80329480(this)){ + func_80328CEC(this, (s32)this->yaw, 90, 150); + }//L802C64EC + if(!(func_8023DB5C() & 0xf)) + func_80328CEC(this, (s32)this->yaw_moving, 10, 20); + + if(!(func_8023DB5C() & 0x7)) + func_80328BD4(this, 1, 0.16f, 1, 0.02f); + + if( !(func_8023DB5C() & 0xf) + && func_80329078(this, (s32)this->yaw_moving, 150) + && func_80328B38(this, 3, 0.13f) + ){ + this->unk28 = randf2(7.1f, 8.4f); + } + func_802C5EB8(this); + break; + + case 0x8: //L802C65D0 + func_802C5F44(this); + this->yaw_moving = func_80329784(this); + func_80328FB0(this, 4.0f); + if(func_80329480(this)) + func_80328A84(this, 6); + break; + + case 0x3: //L802C6620 + func_80328FB0(this, 3.0f); + if(! func_80329030(this, 0) && func_80329480(this)){ + func_80328CEC(this, (s32)this->yaw, 120, 180); + func_80328A84(this, 2); + func_802C5E80(this); + } + if(!(func_8023DB5C() & 0xf) && func_80328B38(this, 2, 0.08f)) + func_802C5E80(this); + func_802C5EB8(this); + break; + + case 0x6: //L802C66D0 + animctrl_setDuration(this->animctrl, D_80366010[6].duration - (3 - this->unk10_12)*0.1085); + this->yaw_moving = (f32)func_80329784(this); + if(!func_803294B4(this, 0x21)){ + func_80328A84(this, 8); + } + func_802C5F44(this); + if(actor_animationIsAt(this, 0.35f) && func_8028EE84() != BSWATERGROUP_2_UNDERWATER){ + func_8030E58C(SFX_3C_BULL_GROWN, randf()/10.0f + 1.0); + this->unk10_12--; + } + if(!func_80329078(this, (s32)this->yaw, 20)) + func_802C5F94(this); + + if(this->unk10_12 == 0 || (this->unk10_12 < 3 && func_80329530(this, 300))){ + func_80328A84(this, 9); + this->unk28 = 13.0f; + } + break; + + case 0x9: //L802C6878 + if(actor_animationIsAt(this, 0.35f)) + func_8030E58C(SFX_2E_BIGBUTT_RUNNING, 1.0f); + + this->unk28 += 0.15; + if(30.0f < this->unk28) + this->unk28 = 30.0f; + + this->yaw_moving = (f32)func_80329784(this); + func_80328FB0(this, 9.0f); + if(!func_80329030(this, 0)) + func_802C5F94(this); + + if(func_80329530(this, 320)){ + if(func_80329078(this, (s32)this->yaw_moving,200)){ + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_ONCE); + func_80328A84(this, 4); + this->unk28 += 5.7; + tmp_a0 = this->unk44_31; + if(this->unk44_31 == 0){ + this->unk44_31 = func_8030D90C(); + tmp_a0 = this->unk44_31; + } + sfxsource_setSfxId(tmp_a0, SFX_18_BIGBUTT_SLIDE); + func_8030DD14(this->unk44_31, 2); + func_8030DBB4(this->unk44_31, (randf()*0.1 - 0.05) + 1.0); + func_8030E2C4(this->unk44_31); + } + else{//L802C69FC + func_802C5F94(this); + } + }//L802C6A08 + break; + + case 0x4: //L802C6A14 + if(animctrl_getAnimTimer(this->animctrl) < 0.99){ + this->yaw_moving = (f32)func_80329784(this); + func_80328FB0(this, 1.0f); + } + func_80329030(this, 0); + func_8030E2C4(this->unk44_31); + if(0.99 <= animctrl_getAnimTimer(this->animctrl)){ + func_80329878(this, func_80329530(this, 250)? 0.8: 1.2); + if(0.0f == this->unk28){ + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_LOOP); + func_80328B8C(this, 1, 0.65f, 1); + func_8030DA44(this->unk44_31); + this->unk44_31 = 0; + func_8030E484(SFX_19_BANJO_LANDING_08); + } + }//L802C6B1C + break; + + case 0x5: //L802C6B28 + actor_playAnimationOnce(this); + tmp_f0 = animctrl_getAnimTimer(this->animctrl); + animctrl_setDuration(this->animctrl, D_80366010[5].duration + ((0.65 < tmp_f0)? (tmp_f0 - 0.65)*16.0 : 0.0)); + if(actor_animationIsAt(this, 0.95f)){ + actor_loopAnimation(this); + func_802C5F94(this); + } + break; + + case 0xc: //L802C6BDC + actor_playAnimationOnce(this); + if(actor_animationIsAt(this, 0.95f)){ + func_80328B8C(this, 1, 0.65f, 1); + actor_loopAnimation(this); + } + break; + + case 0xd: //L802C6C28 + actor_playAnimationOnce(this); + if(actor_animationIsAt(this, 0.95f)){ + func_80328B8C(this, 0xe, 0.99f, 1); + this->unk60 = 4.0f; + } + break; + + case 0xe: //L802C6C7C + actor_playAnimationOnce(this); + this->unk60 -= time_getDelta(); + if(this->unk60 <= 0.0f){ + this->unk166 = 0x63; + func_80328AC8(this, 0xF); + } + + break; + + case 0xf: //L802C6CD4 + actor_playAnimationOnce(this); + if(actor_animationIsAt(this, 0.95f)){ + func_80328B8C(this, 1, 0.65f, 1); + actor_loopAnimation(this); + } + break; + }//L802C6D1C + if(this->state == 0xe){ + if(this->marker->unk14_20 != 0x29e) + this->marker->unk14_20 = 0x29e; + }else{//L802C6D60 + if(this->marker->unk14_20 != 3) + this->marker->unk14_20 = 3; + } +} + +void func_802C6DA0(s32 arg0, f32 arg1[3], f32 arg2[3]){ + func_8034A174(func_80329934(), arg0, arg2); + arg2[0] = (arg2[0] - arg1[0])*0.2; + arg2[1] = (arg2[1] - arg1[1])*0.2; + arg2[2] = (arg2[2] - arg1[2])*0.2; + +} + +void func_802C6E3C(s32 arg0, f32 arg1[3]){ + f32 sp1C[3]; + func_8034A174(func_80329934(), arg0, sp1C); + func_80352CF4(sp1C, arg1, 170.0f, 50.0f); +} + +Actor *func_802C6E84(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *actor; //sp4C + f32 sp40[3]; + + + actor = func_80325888(marker, gfx, mtx, vtx); + if(marker->unk14_21){ + f32 sp34[3] = {0.0f, 4.0f, -15.0f}; + f32 sp28[3]; + f32 sp1C[3]; + + ml_vec3f_yaw_rotate_copy(sp34, sp34, actor->yaw); + switch(actor->state){ + case 6: + if(actor_animationIsAt(actor, 0.65f)){ + func_8034A174(func_80329934(), 9, sp40); + func_80352CF4(sp40, sp34, 60.0f, 50.0f); + } + break; + case 4://L802C6F50 + if((func_8023DB5C() & 1) == 1){ + if(func_80259808(actor->yaw)){ + func_802C6E3C(0xb, sp34); + func_802C6E3C(0xa, sp34); + } + else{ + func_802C6E3C(0x8, sp34); + func_802C6E3C(0x9, sp34); + } + } + break; + case 1://L802C6FB4 + if(actor_animationIsAt(actor, 0.85f) + && (func_8023DB5C()& 0xe) == 8 + && randf() < 0.6 + ){ + func_8034A174(func_80329934(),5, sp40); + func_802C6DA0(6, sp40, sp28); + func_802C6DA0(7, sp40, sp1C); + func_80352CF4(sp40, sp28, 200.0f, 50.0f); + func_80352CF4(sp40, sp1C, 200.0f, 50.0f); + + } + break; + } + }//L802C7064 + return actor; +} diff --git a/src/core2/ch/clankerwhipcrack.c b/src/core2/ch/clankerwhipcrack.c new file mode 100644 index 00000000..e20e0353 --- /dev/null +++ b/src/core2/ch/clankerwhipcrack.c @@ -0,0 +1,57 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_803567EC(Actor *this); + +/* .data */ +ActorInfo D_80372810 = { + 0x1A7, ACTOR_28A_CLANKER_WHIPCRACK, ASSET_432_MODEL_CLANKER_WHIPCRACK, + 0, NULL, + func_803567EC, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_80356770(Actor *this, s32 next_state){ + if(next_state == 1) + func_80335924(this->unk148, ASSET_15C_ANIM_CLANKER_WHIPCRACK_IDLE, 0.5f, 1.0f); + + if(next_state == 2) + func_80335924(this->unk148, ASSET_15D_ANIM_CLANKER_WHIPCRACK_ATTACK, 0.5f, 1.0f); + + this->state = next_state; +} + +void func_803567EC(Actor *this){ + f32 plyr_pos[3]; + f32 plyr_dist; + f32 sp44; + f32 sp40; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->roll = this->yaw; + this->yaw = 0.0f; + func_80356770(this, 1); + } + + player_getPosition(plyr_pos); + plyr_dist = ml_vec3f_distance(plyr_pos, this->position); + if(this->state == 1){ + if(plyr_dist < 700.0f) + func_80356770(this, 2); + } + + if(this->state == 2){ + func_8033568C(this->unk148, &sp44, &sp40); + if(sp44 < 0.13 && 0.13 <= sp40) + func_8030E9C4(SFX_6A_FLAGPOLE_WOBBLE, randf2(0.9f, 1.0f), 14000, this->position, 500.0f, 1000.0f); + + if(sp44 < 0.8 && 0.8 <= sp40) + func_8030E9C4(SFX_2_CLAW_SWIPE, randf2(0.9f, 1.1f), randi2(10000, 14000), this->position, 500.0f, 1000.0f); + + if(800.0f < plyr_dist) + func_80356770(this, 1); + }//L803569D4 +} diff --git a/src/core2/ch/climbBase.c b/src/core2/ch/climbBase.c new file mode 100644 index 00000000..141fa7a5 --- /dev/null +++ b/src/core2/ch/climbBase.c @@ -0,0 +1,91 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_802D77D4(Actor *this); +extern void func_8028F738(f32[3], f32[3], f32, u32); +extern f32 func_80258640(f32[3], f32[3]); + +typedef struct { + f32 unk0[3]; + s16 unkC; +}ActorLocal_climbBase; + +/* .data */ +extern ActorInfo D_80367B20 = { + 0x35, 0x26, 0x0, + 0x1, NULL, + func_802D77D4, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; + +extern f32 D_8037DE30[3]; +extern u8 D_8037DE3C; + +/* .code */ +s32 func_802D76E0(Actor *this, f32 *arg1) { + ActorLocal_climbBase *local; + f32 sp40[3]; + f32 sp34[3]; + f32 sp30; + s32 temp_v0; + s32 sp28; + + local = (ActorLocal_climbBase *)&this->local; + sp28 = func_8030526C(sp40, 0x27, this->position); + temp_v0 = func_8030526C(sp34, 0x28, this->position); + if (!sp28 && !temp_v0) { + return FALSE; + } + if (sp28 && temp_v0) { + sp30 = func_80258640(this->position, sp40); + if (func_80258640(this->position, sp34) < sp30) { + sp28 = 0; + } + } + if (sp28) { + ml_vec3f_copy(arg1, sp40); + local->unkC = 1; + } else { + ml_vec3f_copy(arg1, sp34); + local->unkC = 2; + } + return TRUE; +} + +void func_802D77D4(Actor *this) { + f32 sp4C[3]; + f32 sp40[3]; + f32 sp3C; + f32 sp30[3]; + ActorLocal_climbBase *local; + + + local = (ActorLocal_climbBase *)&this->local; + switch (this->state) { /* irregular */ + case 1: + func_802D76E0(this, sp30); + ml_vec3f_copy(local->unk0, sp30); + func_80328A84(this, 2); + return; + + case 2: + sp3C = (f32)(this->unkF4_8 + 0x19); + player_getPosition(sp40); + ml_vec3f_diff_copy(sp4C, this->position, sp40); + if (((sp4C[0] * sp4C[0]) + (sp4C[2] * sp4C[2])) < (sp3C * sp3C)) { + if ((this->position[1] < sp40[1]) && (sp40[1] <= local->unk0[1])) { + if (func_803203FC(2) == 0) { + func_8028F738(this->position, local->unk0, (f32)this->unkF4_8, local->unkC); + } + } + } + return; + } +} + +void func_802D7930(void){ + player_getPosition(D_8037DE30); + D_8037DE3C = TRUE; +} diff --git a/src/core2/ch/clucker.c b/src/core2/ch/clucker.c new file mode 100644 index 00000000..fafe204a --- /dev/null +++ b/src/core2/ch/clucker.c @@ -0,0 +1,227 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8033A45C(s32, s32); + +typedef struct{ + u8 unk0; + // u8 pad1[3]; + f32 unk4; +} ActorLocal_Clucker; + +Actor *func_803575B8(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_8035765C(Actor *this); + +/* .data */ +extern ActorInfo D_80372870 = { + 0x1B2, ACTOR_29F_CLUCKER, ASSET_482_MODEL_CLUCKER, + 0, NULL, + func_8035765C, NULL, func_803575B8, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_80357150(Actor *this){ + f32 sp34[3]; + f32 sp28[3]; + f32 sp1C[3]; + + sp1C[0] = 50.0f; + sp1C[1] = 200.0f; + sp1C[2] = 300.0f; + ml_vec3f_yaw_rotate_copy(sp1C, sp1C, this->yaw); + + sp34[0] = sp1C[0] + this->position_x; + sp34[1] = sp1C[1] + this->position_y; + sp34[2] = sp1C[2] + this->position_z; + ml_vec3f_yaw_rotate_copy(sp1C, sp1C, 10.0f); + + sp34[0] += 3.0f*sp1C[0]; + sp34[1] += 3.0f*sp1C[1]; + sp34[2] += 3.0f*sp1C[2]; + + sp28[0] = -50.0f; + sp28[1] = this->yaw + 20.0f; + sp28[2] = 0.0f; + func_802BAE6C(sp34, sp28); +} + +void func_80357264(Actor *this, s32 next_state){ + ActorLocal_Clucker *local = (ActorLocal_Clucker *)&this->local; + f32 sp38; + s32 pad34; + + this->marker->unk14_20 = 0x1d0; + actor_collisionOff(this); + if(next_state == 1 || next_state == 2){ + func_80335924(this->unk148, ASSET_184_ANIM_CLUCKER_ATTACK_SHORT, 0.0f, 2.5f); + func_80335A74(this->unk148, 0.99f); + func_80335A8C(this->unk148, 4); + if(this->state == 4){ + if(local->unk0 == 2){ + local->unk4 = randf2(0.5f, 0.75f); + } + else{//L8035732C + local->unk4 = randf2(0.25f, 0.35f); + }//L8035734C + } + else{//L80357358 + local->unk4 = 0.0f; + } + }//L80357368 + + if(this->state == 1 && next_state == 2) + local->unk0 = -1; + + if(next_state == 3) + local->unk4 = 0.2f; + + if(next_state == 4){ + this->marker->unk14_20 = 0x1b2; + actor_collisionOn(this); + local->unk0 = (local->unk0 + 1) % 3; + if(local->unk0 < 2) + func_80335924(this->unk148, ASSET_184_ANIM_CLUCKER_ATTACK_SHORT, 0.0f, randf2( 0.6f, 1.0f)); + else + func_80335924(this->unk148, ASSET_185_ANIM_CLUCKER_ATTACK_LONG, 0.0f, randf2( 2.3f, 2.7f)); + func_80335A8C(this->unk148, 2); + func_8030E6A4(SFX_4A_CLUCKER_AHH, randf2(0.85f, 0.95f), 32000); + } + + if(next_state == 5){ + if(!levelSpecificFlags_get(0x14) + && !( func_80326D68(this->position, 0x318, -1, &sp38) && ( sp38 < 250.0f)) + ){ + levelSpecificFlags_set(0x14, TRUE); + func_80324E38(0.0f, 3); + func_80357150(this); + func_80324E88(2.0f); + func_80324E38(2.0f, 0); + }//L80357518 + func_8030E6D4(SFX_1E_HITTING_AN_ENEMY_2); + func_80335924(this->unk148, ASSET_186_ANIM_CLUCKER_DIE, 0.05f, 2.0f); + }//L80357540 + + this->state = next_state; +} + +void func_80357564(ActorMarker *this_marker, ActorMarker *other_marker){ + func_8030E6D4(SFX_1E_HITTING_AN_ENEMY_2); +} + +void func_8035758C(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + func_80357264(this, 5); +} + +Actor *func_803575B8(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + + func_8033A45C(3, (this->state == 5)? 1 : 0); + func_8033A45C(4, (this->state == 0 || this->state == 1 || this->state == 6)? 0 : 1); + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_8035765C(Actor *this){ + f32 sp5C[3]; + f32 sp58; + ActorLocal_Clucker *local = (ActorLocal_Clucker *)&this->local; + f32 sp50; + f32 sp4C; + f32 sp48; + f32 sp44; + f32 sp40; + + sp50 = time_getDelta(); + if( !this->unk16C_4){ + this->unk16C_4 = TRUE; + this->unk16C_0 = TRUE; + if(this->state != 6){ + marker_setCollisionScripts(this->marker, NULL, func_80357564, func_8035758C); + local->unk0 = 0xff; + func_80357264(this, 1); + } + else{//L803576E0 + func_80357264(this, 6); + } + }//L803576EC + + player_getPosition(sp5C); + sp58 = ml_vec3f_distance(this->position, sp5C); + if(this->state == 1){ + if(sp58 < this->scale*800.0f){ + func_80357264(this, 2); + } + }//L80357758 + + if(this->state == 2){ + if(0.0f < local->unk4){ + local->unk4 -= sp50; + } + else if(sp58 < this->scale*600.0f){ + func_80357264(this, 3); + } + else if(this->scale*1000.0f < sp58){//L803577DC + func_80357264(this, 1); + } + }//L80357808 + + if(this->state == 3){ + if(func_8025773C(&local->unk4, sp50)){ + func_80357264(this, 4); + } + } + + if(this->state == 4){ + func_8033568C(this->unk148, &sp4C, &sp48); + if(func_8033567C(this->unk148) == 0x185){ + if(sp4C < 0.58 && 0.58 <= sp48){ + this->marker->unk14_20 = 0x1d0; + } + if(sp4C < 0.05 && 0.05 <= sp48){ + FUNC_8030E624(SFX_2_CLAW_SWIPE, 0.9f, 32000); + } + if( (sp4C < 0.11 && 0.11 <= sp48) + || (sp4C < 0.32 && 0.32 <= sp48) + || (sp4C < 0.53 && 0.53 <= sp48) + ){ + func_8030E6A4(SFX_80_YUMYUM_CLACK, randf2(0.75f, 0.95f), 32700); + } + if(sp4C < 0.9 && 0.9 <= sp48){ + func_8030E6D4(SFX_2_CLAW_SWIPE); + } + } + else{//L803579F0 + if(sp4C < 0.63 && 0.63 <= sp48){ + this->marker->unk14_20 = 0x1d0; + } + if(sp4C < 0.1 && 0.1 <= sp48){ + FUNC_8030E624(SFX_2_CLAW_SWIPE, 0.9f, 32000); + } + if(sp4C < 0.5 && 0.5 <= sp48){ + func_8030E6A4(SFX_80_YUMYUM_CLACK, randf2(0.75f, 0.95f), 32700); + } + if(sp4C < 0.9 && 0.9 <= sp48){ + func_8030E6D4(SFX_2_CLAW_SWIPE); + } + }//L80357B30 + if(func_80335794(this->unk148) > 0){ + func_80357264(this, 2); + } + }//L80357B48 + + if(this->state == 5){ + func_8033568C(this->unk148, &sp44, &sp40); + if(sp44 < 0.1 && 0.1 <= sp40){ + func_8030E6A4(SFX_68_CLUCKER_AAEEGHH, randf2(1.0f, 1.1f), 32000); + } + + if(sp44 < 0.7 && 0.7 <= sp40){ + func_8030E6D4(SFX_61_CARTOONY_FALL); + } + if(func_80335794(this->unk148) > 0){ + func_80357264(this, 6); + } + } +} diff --git a/src/core2/ch/code_468E0.c b/src/core2/ch/code_468E0.c new file mode 100644 index 00000000..e947ac5d --- /dev/null +++ b/src/core2/ch/code_468E0.c @@ -0,0 +1,101 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_802CD898(Actor *); +void func_802CD8C0(Actor *); +void func_802CDAC4(Actor *); +void func_802CDB18(Actor *); + +/* .data */ +ActorInfo D_80367160 = {0x12, 0x66, 0, 0, NULL, + func_802CD898, func_802CD8C0, func_80325340, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80367184 = {0x12, 0x6C, 0, 0, NULL, + func_802CD898, func_802CDB18, func_80325340, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_802CD870(Actor *this){ + *(s32 *)this->unkBC = TRUE; + func_8028F918(2); +} + +void func_802CD898(Actor *this){ + marker_despawn(this->marker); + func_802BBC58(2); +} + +void func_802CD8C0(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = 1; + this->marker->unk2C_1 = 1; + this->marker->collidable = 0; + *(s32*)this->unkBC = 0; //TODO Make struct + if(func_803203FC(1) || func_803203FC(0x1F)){ + marker_despawn(this->marker); + return; + } + if(this->unkF4_8 != 0x32 && func_8028E4A4() != this->unkF4_8){ + marker_despawn(this->marker); + return; + } + if(map_get() == MAP_26_MMM_NAPPERS_ROOM){ + if(func_8031FF1C(BKPROG_1D_MMM_DINNING_ROOM_CUTSCENE)){ + marker_despawn(this->marker); + return; + } + else{ + func_802CD870(this); + func_80320004(BKPROG_1D_MMM_DINNING_ROOM_CUTSCENE, TRUE); + } + } + //L802CD9C4 + if(map_get() == MAP_8E_GL_FURNACE_FUN){ + if(func_8031FF1C(BKPROG_F4_ENTER_FF_CUTSCENE)){ + marker_despawn(this->marker); + return; + } + else{ + func_802CD870(this); + } + } + }//L802CDA00 + + if(func_80343D50(this, func_80343654(this) + 1, 20, 20)){ + func_802CDAC4(this); + if(1.0 == this->unk48){ + this->marker->unk2C_2 = 0; + if(*(s32*)this->unkBC) + func_8028F918(0); + if(map_get() == MAP_8E_GL_FURNACE_FUN){ + mapSpecificFlags_set(4, TRUE); + } + else{ + func_802BBC58(2); + func_802BD0D8(0xf); + } + marker_despawn(this->marker); + } + } +} + +void func_802CDAC4(Actor *this){ + f32 sp1C[3]; + + func_802BBC58(1); + func_8024CD88(this->position); + sp1C[0] = this->pitch; + sp1C[1] = this->yaw; + sp1C[2] = 0.0f; + func_8024CE18(sp1C); +} + +void func_802CDB18(Actor *this){ + func_8028FBD4(0); + func_802CD8C0(this); +} diff --git a/src/core2/ch/code_5AB30.c b/src/core2/ch/code_5AB30.c new file mode 100644 index 00000000..25600501 --- /dev/null +++ b/src/core2/ch/code_5AB30.c @@ -0,0 +1,324 @@ +#include +#include "functions.h" +#include "variables.h" + +extern int func_802592C4(f32[3], f32[3], f32); +extern void func_802EFA20(ParticleEmitter *, f32, f32); +extern void func_80328B8C(Actor *, s32, f32, s32); +extern void func_80328FB0(Actor *, f32); +extern void func_803300C0(ActorMarker *, void *); + + +typedef struct { + ActorMarker *unk0; + f32 unk4; + u8 pad8[0x1]; + u8 unk9; + u8 unkA; + u8 unkB; +} ActorLocal_chSirSlush; + +Actor *func_802E1AC0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); //chSirSlush_draw +void func_802E20E8(Actor *this); //chSirSlush_update + +/* .data */ +ActorAnimationInfo D_80368650[] = { + {0, 0.0f}, + {ASSET_108_ANIM_SIR_SLUSH_IDLE, 0.8f}, + {ASSET_109_ANIM_SIR_SLUSH_ATTACK, 4.0f}, + {ASSET_220_ANIM_SIR_SLUSH_DIE, 1.6f} +}; + +ActorInfo D_80368670 = { + 0xB1, ACTOR_124_SIR_SLUSH, ASSET_377_MODEL_SIR_SLUSH, + 1, D_80368650, + func_802E20E8, func_80326224, func_802E1AC0, + 0, 0x199, 0.0f, 0 +}; + +struct31s D_80368694 = { + {0.4f, 1.55f}, + {0.0f, 0.0f}, + {0.0f, 0.01f}, + {4.0f, 4.0f}, + 0.0f, 0.3f +}; + +struct43s D_803686BC = { + {{-250.0f, 600.0f, -250.0f}, {350.0f, 960.0f, 350.0f}}, + {{0.0f, -1200.0f, 0.0f}, {0.0f, -1200.0f, 0.0f}}, + {{-80.0f, 0.0f, -80.0f}, {80.0f, 200.0f, 80.0f}} +}; + +f32 D_80368704[3] = {350.0f, 600.0f, 65.0f}; + +/* .code */ +Actor *func_802E1AC0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *actor; + ActorLocal_chSirSlush *local; + + actor = marker_getActor(marker); + local = (ActorLocal_chSirSlush *)&actor->local; + func_8033A45C(1, local->unk9); + func_8033A45C(2, local->unkA); + func_80325888(marker, gfx, mtx, vtx); +} + +void func_802E1B24(ActorMarker *marker){ + Actor *actor; + Actor *other; + f32 sp1C[3]; + ActorMarker *m = *(ActorMarker **)▮ + + actor = marker_getActor(m); + other = spawn_child_actor(ACTOR_125_SNOWBALL, &actor); + if(m->unk14_21){ + func_8034A174(m->unk44, 5, sp1C); + } + else{ + sp1C[0] = actor->position[0]; + sp1C[1] = actor->position[1]; + sp1C[2] = actor->position[2]; + sp1C[1] += 150.0f; + } + other->position[0] = sp1C[0]; + other->position[1] = sp1C[1]; + other->position[2] = sp1C[2]; +} + +void func_802E1BD0(ActorMarker *marker){ + Actor *actor; + Actor *other; + f32 sp2C[3]; + s32 sp28; + ActorMarker *m = *(ActorMarker **)▮ + + actor = marker_getActor(m); + other = spawn_child_actor(ACTOR_126_SIR_SLUSH_HAT, &actor); + + func_8034A174(m->unk44, 6, sp2C); + + other->position[0] = sp2C[0]; + other->position[1] = sp2C[1]; + other->position[2] = sp2C[2]; + + + other->yaw = actor->yaw + 180.0f; + other->velocity[0] = other->velocity[1] = other->velocity[2] = 0.0f; + + other->velocity[0] = 34.0f; + + sp28 = (func_8023DB5C() & 1)? 0x3C : 0x78; + ml_vec3f_yaw_rotate_copy(other->velocity, other->velocity, other->yaw - sp28); + other->velocity[1] = 30.0f; +} + +void func_802E1CB8(f32 position[3], s32 count){ + ParticleEmitter *particleSpawner = partEmitList_pushNew(count); + + particleEmitter_setModel(particleSpawner, ASSET_378_MODEL_SNOWBALL); + particleEmitter_setPosition(particleSpawner, position); + particleEmitter_setPositionVelocityAndAccelerationRanges(particleSpawner, &D_803686BC); + func_802EFE24(particleSpawner, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + func_802EF9F8(particleSpawner, 0.01f); + func_802EFA18(particleSpawner, 3); + func_802EFA20(particleSpawner, 1.0f, 1.3f); + func_802EF9EC(particleSpawner, 0x2f, 16000); + func_802EFB98(particleSpawner, &D_80368694); + particleEmitter_emitN(particleSpawner, count); +} + +void func_802E1DA0(Actor *this){ + ActorLocal_chSirSlush *local = (ActorLocal_chSirSlush *) &this->local; + func_80328B8C(this, 1, 0.01f, 1); + actor_loopAnimation(this); + local->unk4 = 0.4f; +} + +void func_802E1DE8(Actor *this){ + func_80328B8C(this, 3, 0.01f, 1); + actor_playAnimationOnce(this); +} + +void func_802E1E20(Actor *this, f32 arg1){ + this->yaw_moving = func_80329784(this); + func_80328FB0(this, 6.0f); +} + +int func_802E1E5C(Actor *this, s32 arg1){ + f32 f0; + f0 = this->yaw - this->yaw_moving; + if((f0 < arg1) && (-arg1 < f0)){ + return 1; + } + return 0; +} + +int func_802E1EB4(Actor *this, s32 arg1, s32 arg2){ + f32 sp1C[3]; + if(this->unkF4_8 == 0x33){ + player_getPosition(sp1C); + if( (this->position[1] + 500.0f < sp1C[1]) || (sp1C[1] < this->position[1] - 500.0f)) + return 0; + }//L802E1F28 + if(func_80329530(this, arg2) && !func_80329530(this, arg1)){ + return 1; + } + return 0; +} + +int func_802E1F70(ActorMarker *marker, s32 arg1){ + if(marker->unk40_31 == 0xB){ + marker->unk14_20 = 0x287; + } + else{ + marker->unk14_20 = 0xB1; + } + return 1; +} + +void func_802E1FD0(ActorMarker *marker, ActorMarker *other_marker){ + Actor *actor = marker_getActor(marker); + FUNC_8030E8B4(SFX_15_METALLIC_HIT_2, 1.0f, 30000, actor->position, 1500, 4500); + FUNC_8030E8B4(SFX_3EA_UNKNOWN, 1.0f, 30000, actor->position, 1500, 4500); + FUNC_8030E8B4(SFX_2F_ORANGE_SPLAT, 1.0f, 30000, actor->position, 1500, 4500); + + func_802C3C88((GenMethod_1)func_802E1BD0, (s32)actor->marker); + if(map_get() == MAP_27_FP_FREEZEEZY_PEAK) + func_8038A978(); + func_802E1CB8(actor->position, 0xC); + marker_despawn(actor->marker); +} + +int func_802E208C(void){ + f32 sp1C[3]; + if(map_get() == MAP_46_CCW_WINTER){ + player_getPosition(sp1C); + if(func_802592C4(sp1C, D_80368704, 900.0f)) + return 1; + } + return 0; +} + +//chSirSlush_update +void func_802E20E8(Actor *this){ + ActorLocal_chSirSlush *local = (ActorLocal_chSirSlush *) &this->local; + f32 sp38; + + + sp38 = time_getDelta(); + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = 0; + actor_collisionOn(this); + marker_setCollisionScripts(this->marker, NULL, NULL, func_802E1FD0); + func_803300C0(this->marker, func_802E1F70); + local->unk9 = 0; + local->unkA = 1; + local->unkB = 0; + local->unk4 = 0.0f; + animctrl_setTransitionDuration(this->animctrl, 0.8f); + animctrl_setAnimTimer(this->animctrl, randf()); + func_8032BC18(this); + if(map_get() == MAP_27_FP_FREEZEEZY_PEAK){ + local->unk0 = func_80326EEC(0x336)->marker; + func_8038A990(); + } + }//L802E21D8 + if(map_get() == MAP_27_FP_FREEZEEZY_PEAK){ + if(func_8038BFA0() || func_8038DD14()){ + actor_collisionOff(this); + this->unk58_0 = 0; + return; + } + else{//L802E2224 + actor_collisionOn(this); + this->unk58_0 = 1; + + } + }//L802E223C + if(!actor_playerIsWithinDist(this, 4000)) + return; + + if(!local->unkB && this->marker->unk14_21){ + local->unkB = 1; + }//L802E2280 + switch(this->state){ + case 1://L802E22B0 + local->unk9 = FALSE; + local->unkA = 1; + func_802E1E20(this, 6.0f); + if(!func_80329530(this, 0xC4E)){ + func_802E1DE8(this); + } + else if( + map_get() != MAP_27_FP_FREEZEEZY_PEAK + || func_8038DD34(local->unk0) == 0 + || func_8031FF1C(0x13) + ){//L802E2318 + if(0.0 < local->unk4){ + if( (func_8023DB5C() & 1) + || func_8028ECAC() == BSGROUP_A_FLYING + ){//L802E236C + local->unk4 -= sp38; + } + } + else{//L802E2380 + if( func_802E1EB4(this, 0x1f4, 0xabe) + && func_802E1E5C(this, 3) + && func_8028EE84() != BSWATERGROUP_2_UNDERWATER + && !func_802E208C() + ){ + func_80328B8C(this, 2, 0.01f, 1); + actor_playAnimationOnce(this); + } + } + } + break; + case 2://L802E23E8 + if(!func_80329530(this, 0xC4E)){ + func_802E1DE8(this); + }//L802E240C + else if( + 0.98 < animctrl_getAnimTimer(this->animctrl) + || !func_802E1EB4(this, 0x1f4, 0xabe) + || func_8028EE84() == BSWATERGROUP_2_UNDERWATER + || func_802E208C() + ){ + func_802E1DA0(this); + } + else{ + if(animctrl_getAnimTimer(this->animctrl) < 0.45){ + func_802E1E20(this, 6.0f); + } + if( actor_animationIsAt(this, 0.19f) + || actor_animationIsAt(this, 0.28f) + || actor_animationIsAt(this, 0.37f) + ){ + FUNC_8030E8B4(SFX_A7_WOODEN_SWOSH, 1.3f, 18000, this->position, 800, 3050); + }//L802E24FC + if(actor_animationIsAt(this, 0.15f)){ + func_8030E878(SFX_3F5_UNKNOWN, randf2(1.35f, 1.5f),32000, this->position, 800.0f, 3050.0f); + }//L802E2558 + + if(actor_animationIsAt(this, 0.45f)){ + local->unk9 = TRUE; + } + else if( + actor_animationIsAt(this, 0.58f) + && local->unkB + ){ + func_8030E878(SFX_8F_SNOWBALL_FLYING, randf2(0.95f, 1.05f), 30000, this->position, 800.0f, 3050.0f); + func_802C3C88((GenMethod_1)func_802E1B24, (s32)this->marker); + local->unk9 = FALSE; + } + + } + break; + case 3://L802E2604 + if(func_80329530(this, 0xC4E)){ + func_802E1DA0(this); + } + break; + } +} diff --git a/src/core2/ch/code_CFA60.c b/src/core2/ch/code_CFA60.c new file mode 100644 index 00000000..cf390651 --- /dev/null +++ b/src/core2/ch/code_CFA60.c @@ -0,0 +1,156 @@ +#include +#include "functions.h" +#include "variables.h" + +/* public */ +Actor *func_80356C50(ActorMarker *, Gfx **, Mtx **, Vtx **); +void func_80356CCC(Actor *); + +typedef struct{ + f32 unk0; +}ActorLocal_Core2_CFA60; + +/* .data */ +ActorInfo D_80372840 = { + 0x29, ACTOR_1CC_GRILL_CHOMPA, ASSET_430_MODEL_GRILL_CHOMPA, + 0, NULL, + func_80356CCC, NULL, func_80356C50, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_803569F0(Actor *this, s32 next_state){ + ActorLocal_Core2_CFA60 *local = (ActorLocal_Core2_CFA60 *)&this->local; + + this->marker->unk14_20 = 0x1cf; + actor_collisionOff(this); + if(next_state == 1 || next_state == 2){ + func_80335924(this->unk148, ASSET_15A_ANIM_GRILL_CHOMPA_ATTACK, 0, 2.5f); + func_80335A74(this->unk148, 0.99f); + func_80335A8C(this->unk148, 4); + if(this->state == 4){ + local->unk0 = randf2(0.5f, 1.0f); + } + else{//L80356AA4 + local->unk0 = 0.0f; + } + }////L80356AB8 + if(this->state == 1 && next_state == 2){ + func_8030E760(0x3EF, 0.9f, 32700); + } + if(next_state == 3){ + local->unk0 = 0.2f; + } + if(next_state == 4){ + this->marker->unk14_20 = 0x29; + actor_collisionOn(this); + func_80335924(this->unk148, ASSET_15A_ANIM_GRILL_CHOMPA_ATTACK, 0, randf2(2.3f, 2.7f)); + func_80335A8C(this->unk148, 2); + func_8030E760(0x3ef, 1.1f, 25000); + func_8030E760(0x3ef, 1.1f, 25000); + }//L80356B90 + if(next_state == 5){ + func_8030E760(SFX_1E_HITTING_AN_ENEMY_2, 1.0f, 32000); + func_80335924(this->unk148, ASSET_15B_ANIM_GRILL_CHOMPA_DIE, 0.05f, 2.0f); + func_80335A8C(this->unk148, 2); + } + this->state = next_state; +} + + +void func_80356BF4(ActorMarker *marker, ActorMarker *other_marker){ + func_8030E760(SFX_1E_HITTING_AN_ENEMY_2, 1.0f, 32000); +} + +void func_80356C24(ActorMarker *marker, ActorMarker *other_marker){ + func_803569F0(marker_getActor(marker), 5); +} + +Actor *func_80356C50(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *actor = marker_getActor(marker); + if(actor->state == 0){ + return actor; + } + else{ + func_8033A45C(3, (actor->state == 1 || actor->state == 6)? 0:1); + return func_80325888(marker, gfx, mtx, vtx); + } + +} + +void func_80356CCC(Actor *this){ + f32 sp5C[3]; + f32 sp58; + ActorLocal_Core2_CFA60 *local = (ActorLocal_Core2_CFA60 *)&this->local; + f32 sp50; + f32 sp4C; + f32 sp48; + f32 sp44; + f32 sp40; + + sp50 = time_getDelta(); + if(!this->unk16C_4){ + this->unk16C_4 = 1; + this->unk16C_0 = 1; + marker_setCollisionScripts(this->marker, NULL, func_80356BF4, func_80356C24); + func_803569F0(this, (this->state < 5)? 1 : 6); + }//L80356D48 + player_getPosition(sp5C); + sp58 = ml_vec3f_distance(this->position, sp5C); + if( this->state == 1){ + if( sp58 < this->scale*400.0f + && (map_get() != MAP_3C_RBB_KITCHEN || this->position_z < sp5C[2]) + ){ + func_803569F0(this, 2); + } + }//L80356DCC + if(this->state == 2){ + if(0.0f < local->unk0){ + local->unk0 -= sp50; + } + else if(sp58 < this->scale*300.0f){ + func_803569F0(this, 3); + } + else if(this->scale*500.0f < sp58){ + func_803569F0(this, 1); + } + }//L80356E88 + if(this->state == 3){ + if(func_8025773C(&this->local, sp50)){ + func_803569F0(this, 4); + } + }//L80356EAC + if(this->state == 4){ + func_8033568C(this->unk148, &sp4C, &sp48); + if(sp4C < 0.59 && 0.59 <= sp48){ + this->marker->unk14_20 = 0x1cf; + } + if(sp4C < 0.5 && 0.5 <= sp48){ + func_8030E760(SFX_2_CLAW_SWIPE, 0.9f, 32000); + } + if( (sp4C < 0.11 && 0.11 <= sp48) + || (sp4C < 0.32 && 0.32 <= sp48) + || (sp4C < 0.53 && 0.53 <= sp48) + ){ + func_8030E760(SFX_6D_CROC_BITE, randf2(0.95f, 1.05f), 32000); + }//L80357028 + if(sp4C < 0.9 && 0.9 <= sp48){ + func_8030E760(SFX_2_CLAW_SWIPE, 1.0f, 32000); + } + if(func_80335794(this->unk148) > 0){ + func_803569F0(this, 2); + } + }//L80357078 + if(this->state == 5){ + func_8033568C(this->unk148, &sp44, &sp40); + if(sp44 < 0.1 && 0.1 <= sp40){ + func_8030E760(SFX_D7_GRABBA_DEATH, 1.0f, 32000); + } + if(sp44 < 0.7 && 0.7 <= sp40){ + func_8030E760(SFX_A_BANJO_LANDING_05, 0.8f, 32000); + } + if(func_80335794(this->unk148) > 0){ + func_803569F0(this, 6); + } + }//L8035713C +} diff --git a/src/core2/ch/drips.c b/src/core2/ch/drips.c new file mode 100644 index 00000000..cbcf7b39 --- /dev/null +++ b/src/core2/ch/drips.c @@ -0,0 +1,89 @@ +#include +#include "functions.h" +#include "variables.h" + +#define _HorzDist3v(v1, v2) ((v1[0]-v2[0])*(v1[0]-v2[0]) + (v1[2]-v2[2])*(v1[2]-v2[2])) +extern int func_8024549C(f32[3], f32); + +typedef struct{ + f32 unk0; + f32 unk4; + f32 unk8; + f32 unkC; +}struct_core2_D2AB0; + +void chdrips_update(Actor *this); + +/* .data */ +ActorInfo gChDripsInfo = { + 0x246, ACTOR_354_DRIPS, 0, + 0, NULL, + chdrips_update, func_80326224, func_80325340, + 5000, 0, 0.0f, 0 +}; + +s32 D_80372AE4[3] = {0xff, 0xff, 0xfe}; + +struct_core2_D2AB0 D_80372AF0 = {0.0f, 0.0f, 1.0f, 1.4f}; + +struct43s D_80372B00 = { + {{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}}, + {{0.0f, -650.0f, 0.0f}, {0.0f, -650.0f, 0.0f}}, + {{-400.0f, 0.0f, -400.0f}, {400.0f, 0.0f, 400.0f}} +}; + + +/* .code */ +void func_80359A40(f32 position[3], struct_core2_D2AB0 *arg1, s32 cnt){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + particleEmitter_setSprite(pCtrl, ASSET_70C_SPRITE_RIPPLE); + func_802EFA70(pCtrl, 1); + func_802EFFA8(pCtrl, D_80372AE4); + particleEmitter_setPosition(pCtrl, position); + func_802EFB70(pCtrl, 0.1f, 0.1f); + func_802EFB84(pCtrl, 1.0f, 1.4f); + particleEmitter_setSpawnIntervalRange(pCtrl, arg1->unk0, arg1->unk4); + func_802EFEC0(pCtrl, arg1->unk8, arg1->unkC); + func_802EFA5C(pCtrl, 0.0f, 0.5f); + particleEmitter_emitN(pCtrl, cnt); +} + +void __chdrips_particleCallback(struct31s *pCtrl, f32 position[3]){ + if(func_8024549C(position, 4.0f)){ + position[1] += 2.0f; + func_80359A40(position, &D_80372AF0, 1); + func_8030E878(SFX_413_UNKNOWN, randf2(1.0f, 1.4f), 20000, position, 0.0f, 3500.0f); + } +} + +int __chdrips_playerWithinDist(Actor *this, s32 arg1){ + f32 sp1C[3]; + + player_getPosition(sp1C); + if(_HorzDist3v(this->position, sp1C) < arg1*arg1) + return 1; + return 0; +} + +void chdrips_update(Actor *this){ + ParticleEmitter *pCtrl; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + actor_collisionOff(this); + this->unk60 = this->yaw/360.0; + } + if(__chdrips_playerWithinDist(this, 5000) && randf() < this->unk60){ + pCtrl = partEmitList_pushNew(1); + particleEmitter_setModel(pCtrl, ASSET_8A0_SPRITE_WATER_DROP); + particleEmitter_setPosition(pCtrl, this->position); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80372B00); + func_802EFA18(pCtrl, 1); + particleEmitter_setParticleCallback(pCtrl, __chdrips_particleCallback); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 7.0f, 7.0f); + func_802EFB70(pCtrl, 0.1f, 0.1f); + func_802EFB84(pCtrl, 0.1f, 0.1f); + particleEmitter_emitN(pCtrl, 1); + } +} diff --git a/src/core2/ch/firefx.c b/src/core2/ch/firefx.c new file mode 100644 index 00000000..2965281e --- /dev/null +++ b/src/core2/ch/firefx.c @@ -0,0 +1,91 @@ +#include +#include "functions.h" +#include "variables.h" + +extern int func_8024DB50(f32 arg0[3], f32 arg1); + +void chfirefx_update(Actor *this); + +/* .data */ +ActorInfo gChFireFxInfo = { + 0x256, ACTOR_383_FIRE_FX, ASSET_526_SPRITE_FIRE, + 0, NULL, + chfirefx_update, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* code */ +void __chfirefx_spawnSmoke(f32 position[3], f32 scale){ + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EF9E4(pCtrl, 0x23); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setParticleSpawnPositionRange(pCtrl, 0.0f, 110.0f*scale, 0.0f, 0.0f, 110.0f*scale, 0.0f); + particleEmitter_setParticleVelocityRange(pCtrl, 0.0f, 40.0f*scale, 0.0f, 0.0f, 90.0f*scale, 0.0f); + func_802EFB70(pCtrl, 2.6*scale, 3.2*scale); + func_802EFB84(pCtrl, 5.0*scale, 6.0*scale); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 4.0f, 7.0f); + func_802EFA5C(pCtrl, 0.3f, 0.7f); + func_802EFA70(pCtrl, 4); + particleEmitter_emitN(pCtrl, 1); +} + +void __chfirefx_spawnSpark(f32 position[3], f32 scale){ + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, ASSET_713_SPRITE_SPARKLE_YELLOW); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setParticleSpawnPositionRange(pCtrl, 0.0f, 20.0f*scale, 0.0f, 0.0f, 20.0f*scale, 0.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -30.0f*scale, 120.0f*scale, -30.0f*scale, 60.0f*scale, 360.0f*scale, 60.0f*scale); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -50.0f, 0.0f, 0.0f, -90.0f, 0.0f); + func_802EFB70(pCtrl, 0.1*scale, 0.2*scale); + func_802EFB84(pCtrl, 0.2*scale, 0.4*scale); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 0.9f, 1.3f); + func_802EFA5C(pCtrl, 0.3f, 0.7f); + func_802EFA70(pCtrl, 4); + particleEmitter_emitN(pCtrl, 1); +} + +void __chfirefx_hiss(ActorMarker *marker,ActorMarker *other_marker){ + Actor *actor = marker_getActor(marker); + FUNC_8030E8B4(SFX_96_HOTSAND_EEL_HISS, 1.0f, 32000, actor->position, 1000, 2000); +} + +void chfirefx_update(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = FALSE; + actor_collisionOn(this); + marker_setCollisionScripts(this->marker, __chfirefx_hiss, NULL, NULL); + this->unk38_31 = (0.0f != this->yaw) ? 1 : 0; + if(this->unkF4_8 != 0x32){ + this->unk1C[0] = 1.0f; + this->unk44_31 = func_8030ED2C(SFX_128_FIRE_CRACKING, 2); + func_8030DBB4(this->unk44_31, 1.1f); + } + else{ + this->unk1C[0] = 0.0f; + } + }//L80359934 + if(actor_playerIsWithinDist(this, 2000)){ + if( func_8024DB50(this->position, 50.0f) && this->unk38_31 ){ + if(!(func_8023DB5C() & 3) && randf() < 0.1){ + __chfirefx_spawnSmoke(this->position, this->scale); + } //L803599AC + if(!(func_8023DB5C() & 3) && randf() < 0.3){ + __chfirefx_spawnSpark(this->position, this->scale); + } + }//L803599F4 + if(0.0f != this->unk1C[0]){ + func_8030DB04(this->unk44_31, 7000, this->position, 300.0f, 800.0f); + func_8030E2C4(this->unk44_31); + } + }//L80359A2C +} diff --git a/src/core2/ch/flotsam.c b/src/core2/ch/flotsam.c new file mode 100644 index 00000000..f6ae5bdb --- /dev/null +++ b/src/core2/ch/flotsam.c @@ -0,0 +1,332 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_80309724(f32[3]); + +typedef struct { + f32 unk0; + f32 unk4; + ParticleEmitter *pCtrl_8; + u8 unkC; + u8 unkD; + //u8 padE[2]; + f32 unk10[3]; + f32 unk1C[3]; + f32 unk28[3]; + f32 unk34[3]; +}ActorLocal_Core2_D50F0; + + +void func_8035C8F4(Actor *this); +Actor* func_8035C71C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorInfo D_80372C80 = { + 0xC9, 0x13B, 0x401, + 0, NULL, + func_8035C8F4, NULL, func_8035C71C, + 0, 0, 1.0f, 0 +}; + +struct31s D_80372CA4 = { + {1.0f, 1.2f}, + {1.6f, 2.0f}, + {0.05f, 0.05f}, + {0.3f, 0.5f}, + 0.1f, 0.5f +}; + +struct43s D_80372CCC = { + {{-5.0f, 10.0f, -5.0f}, {5.0f, 50.0f, 5.0f}}, + {{0.0f, 200.0f, 0.0f}, {0.0f, 1000.0f, 0.0f}}, + {{-20.0f, -20.0f, -20.0f}, {20.0f, 20.0f, 20.0f}} +}; + +/* .code */ +void func_8035C080(Actor *this, s32 next_state){ + f32 i; + ActorLocal_Core2_D50F0 *local = (ActorLocal_Core2_D50F0 *)&this->local; //sp60 + f32 sp64[3]; + f32 sp60; + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + s32 sp38; + + local->unk0 = 0.0f; + local->unkD = next_state; + + if(next_state == 1){ + func_80335924(this->unk148, 0, 0.0f, 0.0f); + this->yaw = local->unk34[0]; + } + if( next_state == 3 + || next_state == 4 + || next_state == 7 + || next_state == 6 + ){ + func_80335924(this->unk148, ASSET_132_ANIM_FLOTSAM_MOVE, 0.1f, 0.7f); + local->unk10[0] = this->position_x; + local->unk10[1] = this->position_y; + local->unk10[2] = this->position_z; + actor_collisionOn(this); + if(next_state == 3){ + player_getPosition(sp54); + } + else if(next_state == 4){//L8035C15C + sp54[0] = local->unk28[0];\ + sp54[1] = local->unk28[1];\ + sp54[2] = local->unk28[2]; + } + else if(next_state == 6){//L8035C180 + func_8030E6D4(SFX_1D_HITTING_AN_ENEMY_1); + actor_collisionOff(this); + player_getPosition(sp48); + sp3C[0] = this->position_x - sp48[0]; + sp3C[1] = this->position_y - sp48[1];\ + sp3C[2] = this->position_z - sp48[2];\ + sp3C[1] = 0.0f; + ml_vec3f_set_length(sp3C, 150.0f); + sp54[0] = sp3C[0] + this->position_x;\ + sp54[1] = sp3C[1] + this->position_y;\ + sp54[2] = sp3C[2] + this->position_z; + sp54[1] = local->unk4; + } + else{//L8035C228 + sp54[0] = this->position_x;\ + sp54[1] = this->position_y;\ + sp54[2] = this->position_z; + } //L8035C240 + sp64[0] = sp54[0] - this->position_x;\ + sp64[1] = sp54[1] - this->position_y;\ + sp64[2] = sp54[2] - this->position_z; + sp64[1] = 0.0f; + sp60 = gu_sqrtf(sp64[0]*sp64[0] + sp64[1]*sp64[1] + sp64[2]*sp64[2]); + + if(next_state == 4 && sp60 <= 250.0f){ + local->unk1C[0] = sp54[0];\ + local->unk1C[1] = sp54[1];\ + local->unk1C[2] = sp54[2]; + next_state = 5; + } + else{//L8035C2DC + if(this->state == 2){ + if(300.0f < sp60){ + ml_vec3f_set_length(sp64, 300.0f); + } + } + else{ + if(150.0f < sp60){ + ml_vec3f_set_length(sp64, 150.0f); + } + }////L8035C344 + for(i = 1; 0.025 < i; i -= 0.05){//L8035C378 + local->unk1C[0] = sp64[0] *i + this->position_x; + local->unk1C[1] = local->unk4; + local->unk1C[2] = sp64[2] *i + this->position_z; + if(func_80329210(this, local->unk1C)){ + next_state = 5; + break; + } + } + }//L8035C3F8 + + if(next_state == 5){ + func_8030E878(0x3f2, randf2(1, 1.2f), 0x7530, this->position, 100.0f, 10000.0f); + local->unk34[1] = this->yaw; + if(sp60 <= 250.0f){ + local->unk34[2] = local->unk34[0]; + } + else if(local->unk34[0] < local->unk34[1]){//L8035C47C + local->unk34[2] = local->unk34[0] - 20.0f; + } + else{//L8035C4B0 + local->unk34[2] = local->unk34[0] + 20.0f; + } + } + else if(next_state == 3){//L8035C4C0 + if(ml_vec3f_distance(local->unk28, this->position) < 10.0f){ + func_8035C080(this, 1); + return; + } + else{ + func_8035C080(this, 4); + return; + } + } + else if(next_state == 4){//L8035C514 + local->unk1C[0] = sp54[0]; + local->unk1C[1] = sp54[1]; + local->unk1C[2] = sp54[2]; + next_state = 5; + } + else if(next_state == 7){//L8035C540 + func_8035C080(this, 4); + return; + } + }//L8035C560 + + if(next_state == 8){ + actor_collisionOff(this); + FUNC_8030E624(SFX_1D_HITTING_AN_ENEMY_1, 1.0f, 25000); + timed_playSfx(0.2f, SFX_103_FLOTSAM_DEATH, 1.0f, 32000); + sp38 = func_802F9AA8(SFX_104_PROPELLER_NOISE); + func_802F9DB8(sp38, 1.0f, 1.3f, 0.05f); + func_802F9EC4(sp38, this->position, 0x5dc, 0x9c4); + func_802F9F80(sp38, 0.0f, 2.0f, 2.0f); + func_802FA060(sp38, 0x6590, 0x6d60, 500.0f); + func_80335924(this->unk148, ASSET_189_ANIM_FLOTSAM_DIE, 0.1f, 4.0f); + func_80335A8C(this->unk148, 2); + local->pCtrl_8 = particleEmitter_new(20); + particleEmitter_setSprite(local->pCtrl_8, ASSET_70E_SPRITE_SMOKE_2); + particleEmitter_setStartingFrameRange(local->pCtrl_8, 0, 7); + particleEmitter_setPosition(local->pCtrl_8, this->position); + particleEmitter_setPositionVelocityAndAccelerationRanges(local->pCtrl_8, &D_80372CCC); + func_802EFB98(local->pCtrl_8, &D_80372CA4); + particleEmitter_setSpawnInterval(local->pCtrl_8, 4); + }//L8035C698 + + this->state = next_state; + +} + +void func_8035C6C4(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + func_8035C080(this, 6); +} + +void func_8035C6F0(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + func_8035C080(this, 8); +} + +Actor* func_8035C71C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); //sp64 + ActorLocal_Core2_D50F0 *local = (ActorLocal_Core2_D50F0 *)&this->local; //sp60 + s32 sp5C; + s32 pad58; + f32 sp4C[3]; + f32 sp40[3]; + f32 sp34[3]; + f32 sp28[3]; + + if(this->state == 0) return this; + + if(this->state == 8){ + sp5C = func_803356A0(this->unk148); + if(sp5C){ + sp40[0] = 0.0f; + sp40[1] = 0.0f; + sp40[2] = local->unk0 * -2200.0f; + func_80345C78(sp4C, sp40); + func_8033A8F0(sp5C, 3, sp4C); + sp34[0] = 1.0 - local->unk0*0.5; + sp34[1] = 1.0 - local->unk0*0.5; + sp34[2] = 1.0 - local->unk0*0.5; + func_8033A928(sp5C, 3, sp34); + } + } + + if(local->pCtrl_8){ + func_8033A450(func_80329934()); + } + + func_80325888(marker, gfx, mtx, vtx); + + if(local->pCtrl_8 && this->marker->unk14_21){ + func_8034A174(func_80329934(), 5, sp28); + particleEmitter_setPosition(local->pCtrl_8, sp28); + func_802EF3A8(local->pCtrl_8, gfx, mtx, vtx); + } + return this; +} + +void func_8035C8C8(Actor *this){ + ActorLocal_Core2_D50F0 *local = (ActorLocal_Core2_D50F0 *)&this->local; + + if(local->pCtrl_8) + func_802EF684(local->pCtrl_8); +} + +void func_8035C8F4(Actor *this){ + f32 plyr_pos[3]; + f32 sp40[3]; + f32 sp3C; + ActorLocal_Core2_D50F0 *local = (ActorLocal_Core2_D50F0 *)&this->local; + f32 sp34; + + sp34 = time_getDelta(); + if(this->state == 0){ + this->marker->unk14_21 = FALSE; + this->marker->unk30 = func_8035C8C8; + marker_setCollisionScripts(this->marker, func_8035C6C4, func_8035C6C4, func_8035C6F0); + local->unk4 = func_80309724(this->position); + local->pCtrl_8 = NULL; + local->unk34[0] = this->yaw; + local->unk34[2] = local->unk34[1] = local->unk34[0]; + local->unk28[0] = this->position_x; + local->unk28[1] = this->position_y; + local->unk28[2] = this->position_z; + func_8035C080(this, 1); + }//L8035C9AC + + player_getPosition(plyr_pos); + sp40[0] = plyr_pos[0] - this->position_x; + sp40[1] = plyr_pos[1] - this->position_y; + sp40[2] = plyr_pos[2] - this->position_z; + sp3C = gu_sqrtf(sp40[0]*sp40[0] + sp40[1]*sp40[1] + sp40[2]*sp40[2]); + if(local->pCtrl_8){ + particleEmitter_update(local->pCtrl_8); + } + + if(this->state == 1){ + if( sp3C < 800.0f + && func_80329210(this, plyr_pos) + && plyr_pos[1] < this->position_y + 100.0f + ){ + func_8035C080(this, 3); + } + }//L8035CA80 + + if(this->state == 5){ + local->unk0 += 1.9047619047619049*sp34; + if(1.0f <= local->unk0) + local->unk0 = 1.0f; + func_80255FE4(this->position, local->unk10, local->unk1C, local->unk0); + this->position_y += 100.0f*sinf(local->unk0*3.141592654); + this->yaw = local->unk0*(local->unk34[2] - local->unk34[1]) + local->unk34[1]; + if(func_80335794(this->unk148) > 0){ + if(ml_vec3f_distance(this->position, local->unk28) < 10.0f){ + func_8035C080(this, 1); + } + else if(local->unkC > 0){//L8035CB8C + local->unkC--; + if(local->unkC > 0){ + func_8035C080(this, 7); + } + else{ + func_8035C080(this, 2); + } + } + else{ + func_8035C080(this, 2); + } + } + }//L8035CBD4 + + if(this->state == 2){ + if(sp3C < 800.0f){ + func_8035C080(this, 3); + } + else{ + func_8035C080(this, 4); + } + }//L8035CC38 + + if(this->state == 8){ + local->unk0 += 0.25*sp34; + if(func_80335794(this->unk148) > 0) + marker_despawn(this->marker); + } +} diff --git a/src/core2/ch/gameSelect.c b/src/core2/ch/gameSelect.c new file mode 100644 index 00000000..f1b7bca9 --- /dev/null +++ b/src/core2/ch/gameSelect.c @@ -0,0 +1,606 @@ +#include +#include "functions.h" +#include "variables.h" + +#ifndef ABS +#define ABS(d) ((d) >= 0) ? (d) : -(d) +#endif + +void func_8031FBF8(void); +void func_8031FBA0(void); +void func_803184C8(gczoombox_t *, f32, s32, s32, f32, s32, s32); + +Actor *func_802C4360(ActorMarker *, Gfx **, Mtx **, Vtx **); +Actor *func_802C4464(ActorMarker *, Gfx **, Mtx **, Vtx **); +void func_802C4C14(Actor *this); +void func_802C5740(Actor *this); + +extern void func_802C71F0(Actor *); +extern void func_802C74F4(Actor *, s32, f32 ); +extern void func_8031FB14(s32, s32); +extern void func_8031F678(s32, s32); +extern void func_80335110(s32); + +extern void func_8024E60C(s32, f32*); +extern void func_8024E71C(s32, f32*); + + +/* .data */ +f32 D_80365DD0[3][3] = { + {-320.0f, 340.0f, 350.0f}, + {110.0f, 340.0f, 110.0f}, + {-413.333313f, 353.333313f, -234.305511f} +}; +u8 *D_80365DF4 = "USE THE CONTROL STICK TO SELECT A GAME."; +u8 *D_80365DF8 = "PRESS A TO PLAY THE GAME OR Z TO ERASE IT!"; +u8 *D_80365DFC = "ARE YOU SURE? PRESS A TO CONFIRM, OR B TO CANCEL"; +s32 D_80365E00 = -1; +f32 D_80365E04[3][3] = { + {-435.0f, 278.0f, -159.0f}, + { 444.635437f, 216.0f, -356.591675f}, + { 55.0f, 191.822906f, -905.96875f} +}; + +ActorAnimationInfo D_80365E28[] = { + {0x000, 0.0f}, + {0x24D, 9e+09f}, + {0x24D, 2.0f}, + {0x24E, 1.0f}, + {0x24F, 0.6f}, + {0x24D, 2.0f} +}; +ActorInfo D_80365E58 = { 0xE4, 0x195, 0x532, 0x1, D_80365E28, func_802C5740, func_80326224, func_802C4464, 0, 0, 0.0f, 0}; + +ActorAnimationInfo D_80365E7C[] = { + {0x000, 0.0f}, + {0x250, 9e+09f}, + {0x250, 4.5f}, + {0x251, 1.0f}, + {0x252, 0.67f}, + {0x250, 4.5f}, +}; +ActorInfo D_80365EAC = { 0xE5, 0x196, 0x532, 0x1, D_80365E7C, func_802C4C14, func_80326224, func_802C4360, 0, 0, 0.0f, 0}; + +ActorAnimationInfo D_80365ED0[] = { + {0x000, 0.0f}, + {0x24A, 9e+09f}, + {0x24A, 1.0f}, + {0x24B, 1.0f}, + {0x24C, 1.0f}, + {0x24A, 1.0f} +}; +ActorInfo D_80365F00 = { 0xE6, 0x197, 0x532, 0x1, D_80365ED0, func_802C4C14, func_80326224, func_802C4360, 0, 0, 0.0f, 0}; + + +/* .bss */ +// Remove this when this memory region is properly symbolized +u8 unk_8037DCB0[0x8037DCE0 - 0x8037DCB0]; + +extern u8 D_8037DCCE[0x12]; + +struct { + u8 *unk0; + u8 *unk4; +} D_8037DCE0; +s32 D_8037DCE8; +s32 D_8037DCEC; +gczoombox_t *D_8037DCF0; +gczoombox_t *D_8037DCF4; +f32 D_8037DCF8[2][3]; +f32 D_8037DD10[2][3]; +void *D_8037DD28; +s32 D_8037DD2C; +f32 D_8037DD30; +f32 D_8037DD34; + + + +/* .code */ +Actor *func_802C4360(ActorMarker *marker, Gfx **arg1, Mtx **arg2, Vtx **arg3){ + s32 sp1C = marker->unk14_20 - 0xe4; + func_8033A45C(3, sp1C); + func_8033A45C(1, 1); + func_8033A45C(4, 1); + func_8033A45C(9, 1); + func_8033A45C(5, 0); + func_8033A45C(8, 0); + func_8033A45C(6, 0); + func_8033A45C(7, 0); + func_8033A45C(0xC, 1); + func_8033A45C(0xF, 1); + if(sp1C == D_80365E00){ + func_8033A388(0xFF, 0xFF, 0xFF, 0xFF); + } + else{ + func_8033A388(0x64, 0x64, 0x64, 0xFF); + } + return func_80325888(marker, arg1, arg2, arg3); +} + +Actor *func_802C4464(ActorMarker *marker, Gfx **arg1, Mtx **arg2, Vtx **arg3){ + Actor *ret_val = func_802C4360(marker, arg1, arg2, arg3); + if(D_8037DCF4) + gczoombox_draw(D_8037DCF4, arg1, arg2, arg3); + if(D_8037DCF0) + gczoombox_draw(D_8037DCF0, arg1, arg2, arg3); + return ret_val; + +} + +void func_802C44D0(s32 arg0, s32 arg1){ + if(arg1 == 3) + D_8037DD2C = 0; +} + +void *func_802C44EC(f32 arg0[3], f32 arg1[3], f32 arg2) { + f32 phi_f12; + f32 sp40[3]; + s32 i; + static bool D_8037DD38; + static f32 D_8037DD3C; + static f32 D_8037DD40; + + arg2 = (arg2 > 0.75) ? 0.75 : arg2; + sp40[0] = arg1[0] - arg0[0]; + sp40[1] = arg1[1] - arg0[1]; + sp40[2] = arg1[2] - arg0[2]; + D_8037DD38 = D_8037DD38^1; + phi_f12 = gu_sqrtf(sp40[0]*sp40[0] + sp40[1]*sp40[1] + sp40[2]*sp40[2]); + if (phi_f12 < 10.0f) { + phi_f12 = 500.0f; + } + D_8037DD3C = 1.0 + (9.0f / gu_sqrtf(phi_f12)); + D_8037DD40 = sinf(D_8037DD3C*1.5707963267948966); + for(i = 0; i < 3; i++){ + D_8037DD10[D_8037DD38][i] = arg0[i] + ((arg1[i] - arg0[i])*sinf((((arg2 / 0.75) * 3.1415926535897931) / 2) * D_8037DD3C)) / D_8037DD40; + D_8037DCF8[D_8037DD38][i] += (D_8037DD10[D_8037DD38][i] - D_8037DCF8[D_8037DD38][i]) / 5.0; + + } + return &D_8037DCF8[D_8037DD38]; +} + +void func_802C4768(s32 gamenum){ + u8 * sp20[2]; + static u8 D_8037DD48[0x20]; + static u8 D_8037DD68[0x20]; + + func_8031FBF8(); + D_80365E00 = gamenum; + func_8031FBA0(); + if(func_8033D1BC(gamenum)){ + func_8033D13C(gamenum); + D_8037DCCE[gamenum] = (func_8034717C(6)) ? 1 : 0; + + strcpy(D_8037DD48, ""); + strcat(D_8037DD48, "GAME "); + switch(gamenum){ + case 0: //L802C4820 + strIToA(D_8037DD48, 1); + break; + case 1: //L802C4838 + strIToA(D_8037DD48, 3); + break; + case 2: //L802C484C + strIToA(D_8037DD48, 2); + break; + }//L802C4858 + strcat(D_8037DD48, ": TIME "); + strcat(D_8037DD48, func_80311C64(func_803470A0())); + strcat(D_8037DD48, ","); + strcat(D_8037DD48, ""); + + strcpy(D_8037DD68, ""); + strIToA(D_8037DD68, jiggyscore_total()); + strcat(D_8037DD68, " JIGSAW"); + if(jiggyscore_total() != 1){ + strcat(D_8037DD68, "S"); + } + strcat(D_8037DD68, ", "); + strIToA(D_8037DD68, notescore_getTotal()); + strcat(D_8037DD68, " NOTE"); + if(notescore_getTotal() != 1){ + strcat(D_8037DD68, "S"); + } + strcat(D_8037DD68, "."); + strcat(D_8037DD68, ""); + }//L802C49AC + else{ + D_8037DCCE[gamenum] = 0; + strcpy(D_8037DD48, ""); + strcat(D_8037DD48, "GAME "); + switch (gamenum){ + case 0: + strIToA(D_8037DD48, 1); + break; + case 1: + strIToA(D_8037DD48, 3); + break; + case 2: + strIToA(D_8037DD48, 2); + break; + }//L802C4A40 + strcat(D_8037DD48, ": EMPTY"); + strcpy(D_8037DD68, ""); + }//L802C4A68 + sp20[0] = D_8037DD48;\ + sp20[1] = D_8037DD68; + func_8031877C(D_8037DCF4); + func_80318284(D_8037DCF4, 2, sp20); + gczoombox_maximize(D_8037DCF4); + gczoombox_resolve_minimize(D_8037DCF4); +} + +void func_802C4AC8(s32 arg0){ + func_8033D0FC(arg0); + func_802C4768(arg0); +} + +void func_802C4AF0(Actor * this){ + int i; + + if(D_8037DCF0){ + gczoombox_free(D_8037DCF0); + D_8037DCF0 = NULL; + } + + if(D_8037DCF4){ + gczoombox_free(D_8037DCF4); + D_8037DCF4 = NULL; + } + + for(i = 0; i < 3; i++){ + func_8033CFD4(i); + } + + if(D_8037DD28){ + func_802F9D38(D_8037DD28); + D_8037DD28 = NULL; + } + + comusic_8025AB44(COMUSIC_73_GAMEBOY, 0, 4000); + func_8025AABC(COMUSIC_73_GAMEBOY); + func_8025AB00(); +} + +void func_802C4BB4(ActorMarker *marker){ + Actor *this; + s32 sp20; + Actor *other; + f32 sp18; + sp20 = marker->unk14_20 - 0xe4; + this = marker_getActor(marker); + sp18 = this->scale; + other = func_8032813C(sp20 + 0x198, this->position, (s32)this->yaw); + other->scale = sp18; +} + +void func_802C4C14(Actor *this){ + int sp84; + int sp80; + s32 sp74[3]; + s32 *tmp_a2; //pad70 + s32 pad_6C; + s32 pad_68; + s32 sp5C[3]; + s32 pad_58; + f32 sp54; + f32 sp50; + int i; //sp4C + s32 sp48; + f32 sp44; + s32 tmp_a2_2; + f32 sp34[3]; + + sp84 = this->marker->unk14_20 - 0xe4; + sp80 = (sp84 == D_80365E00); + sp50 = time_getDelta(); + if(!D_8037DCF4) + return; + + if(!this->initialized){ + func_802C3C88(func_802C4BB4, this->marker); + func_802C7318(this); + this->unk130 = func_802C71F0; + if(sp84 == 0){ + func_802C75A0(this, 1); + func_802C74F4(this, 0, 1.0f); + func_802C74F4(this, 1, 1.0f); + }//L802C4CD8 + this->initialized = TRUE; + }//L802C4CE4 + func_802C7478(this); + if(!sp80){ + if(this->state != 1){ + func_80328A84(this, 1); + } + } + else{//L802C4D24 + func_8024E60C(0, sp74); + func_8024E55C(0, sp5C); + func_8024E71C(0, &sp54); + switch(this->state){ + case 2: + case 5: + switch(sp84){ + case 0://L802C4D8C + if(actor_animationIsAt(this, 0.1f)) + func_8030E510(SFX_5D_BANJO_RAAOWW, 8000); + + if(actor_animationIsAt(this, 0.7f)) + func_8030E510(SFX_5E_BANJO_PHEWWW, 8000); + break; + case 1://L802C4DD0 + if(randf() < 0.1){ + // if(randf() < D_80376118){ + func_8030E6A4(MIN(2.0f, randf() *3.0f) + 311.0f, 1.0f, 12000); + } + break; + case 2://L802C4E74 + if(randf() < 0.03){ + func_8030E6A4(0x3ed, randf()*0.3 + 0.7, 15000); + } + break; + }//L802C4ED4 + break; + }//L802C4ED4 + if(!func_8038AAB0()){ + switch(this->state){ + case 1://L802C4F10 + if(sp84 == 1){ + func_8030E510(SFX_136_GAMEBOY_STARTUP, 15000); + timedFunc_set_3(0.25f, comusic_8025AB44, COMUSIC_73_GAMEBOY, -1, 2000); + func_8025A58C(0, 2000); + } + else{ + comusic_8025AB44(COMUSIC_73_GAMEBOY, 0, 4000); + func_8025A58C(-1, 2000); + } + + if(sp84 == 2){ + D_8037DD28 = func_802F9AA8(SFX_12B_BOILING_AND_BUBBLING); + func_802F9F80(D_8037DD28, 0.5f, 9000000000.0f, 0.5f); + func_802F9DB8(D_8037DD28, 0.9f, 0.9f, 0.0f); + func_802FA060(D_8037DD28, 15000, 15000, 0.0f); + } + else{ + if(D_8037DD28){ + func_802F9D38(D_8037DD28); + D_8037DD28 = NULL; + } + } + func_802C4768(sp84); + func_80328A84(this, 2); + break; + case 5://L802C5040 + if(D_8037DD2C == 0 && + (sp5C[0] == 1 || sp5C[1] == 1) + ){ + if(sp5C[0] == 1){ + func_802C4AC8(sp84); + func_8025A6EC(COMUSIC_2B_DING_B, 22000); + } + func_80328A84(this, 2); + func_8031877C(D_8037DCF0); + func_80318284(D_8037DCF0, 2, &D_8037DCE0); + D_8037DD34 = 0.0f; + } + break; + case 3://L802C50C8 + case 4://L802C50C8 + if(animctrl_isStopped(this->animctrl)){ + func_802DEB80(); + if(!func_8033D1BC(sp84)){ + timedFunc_set_3(0.0f, func_802E4078, MAP_85_CS_SPIRAL_MOUNTAIN_3, 0, 1); + } + else{//L802C511C + sp44 = 0.0f; + if(this->state == 4 && (sp84 == 0 || sp84 == 1)) + sp44 = 0.25f; + if(func_802DA498() && func_8031FF1C(BKPROG_BD_ENTER_LAIR_CUTSCENE)){ + timedFunc_set_2(sp44, func_8031FB14, 0, 0); + } + else{//L802C5188 + timedFunc_set_2(sp44, func_8031F678, 0, 0); + }//L802C51A0 + timedFunc_set_1(sp44, func_80335110, 1); + }//L802C51B8 + this->state = 6; + } + break; + case 2://L802C51CC + if(sp74[0] == 1){ + if(func_8033D1BC(sp84)){ + func_8031877C(D_8037DCF0); + func_803183A4(D_8037DCF0, (&D_80365DFC)[func_8031B5B0()]); + D_8037DD2C = 1; + func_80328A84(this, 5); + } + else{//L802C5240 + func_8025A6EC(COMUSIC_2C_BUZZER, 22000); + } + } + else if(sp5C[0] == 1){//L802C5250 + if(func_8033D1BC(sp84)){ + if(randf() < 0.1){ + switch(sp84){ + case 0://L802C52B8 + func_8030E510(SFX_31_BANJO_OHHWAAOOO, 28000); + func_8030E540(SFX_135_CARTOONY_SPRING); + timedFunc_set_2(0.4f, func_8030E510, SFX_13A_GLASS_BREAKING_7, 0x7fff); + timedFunc_set_2(0.9f, func_8030E510, SFX_150_PORCELAIN_CRASH, 0x7fff); + timedFunc_set_2(1.0f, func_8030E510, SFX_151_CAT_MEOW, 0x7fff); + break; + case 1://L802C5320 + timedFunc_set_2(0.4f, func_8030E510, SFX_31_BANJO_OHHWAAOOO, 28000); + timedFunc_set_2(0.2f, func_8030E510, SFX_E_SHOCKSPRING_BOING, 28000); + func_8030E540(SFX_2D_KABOING); + break; + case 2://L802C5364 + timedFunc_set_2(0.15f, func_8030E510, SFX_32_BANJO_EGHEE, 28000); + func_8030E510(SFX_3F6_UNKNOWN, 28000); + func_8030E540(SFX_8F_SNOWBALL_FLYING); + break; + }//L802C5394 + func_80328A84(this, 4); + levelSpecificFlags_set(sp84 + 0x35, 1); + } + else{//L802C53B4 + func_8030E484(SFX_3EA_UNKNOWN); + func_80328A84(this, 3); + } + }else{//L802C53D0 + func_8030E510(SFX_4F_BANJO_WAHOO, 28000); + func_80328A84(this, 3); + }//L802C53E8 + if(sp84 == 0) + func_802C75A0(this, 2); + + if(sp84 == 1) + comusic_8025AB44(COMUSIC_73_GAMEBOY, 0, 4000); + + func_8025A58C(0, 0x1f4); + actor_playAnimationOnce(this); + } + else{//L802C5434 + if((0.7 < ((0.0f <= sp54) ? sp54 : -sp54)) && D_8037DCEC == 0 + ){ + tmp_a2_2 = D_80365E00; + if(sp54 < 0.0f){ + D_8037DCEC = 1; + switch(D_80365E00){ + case 0: + D_8037DCEC = 0; + break; + case 1: + D_80365E00 = 2; + break; + case 2: + D_80365E00 = 0; + break; + } + } + else{//L802C54D4 + D_8037DCEC = 1; + switch(D_80365E00){ + case 0: + D_80365E00 = 2; + break; + case 1: + D_8037DCEC = 0; + break; + case 2: + D_80365E00 = 1; + break; + } + }//L802C550C + if(D_8037DCEC){ + D_8037DCE8 = tmp_a2_2; + D_8037DD30 = 0.0f; + } + }else{//L802C5530 + if(((0.0f <= sp54) ? sp54 : -sp54) < 0.3){ + D_8037DCEC = 0; + } + } + }//L802C556C + if(D_8037DD2C == 0){ + D_8037DD34 += sp50; + if(20.0 < D_8037DD34){ + func_8031877C(D_8037DCF0); + func_80318284(D_8037DCF0, 2, &D_8037DCE0); + D_8037DD34 = 0.0f; + } + } + break; + case 6://L802C55E8 + break; + } + }//L802C55E8 + D_8037DD30 += sp50; + sp48 = func_803097A0(); + if(this->marker->unk14_21){ + for(i = 0; i < 3; i++){ + func_8034A174(sp48, i+5, sp34); + ml_vec3f_copy(D_80365DD0[i], sp34); + } + } + func_802BAEB4( + func_802C44EC(D_80365DD0[D_8037DCE8], D_80365DD0[D_80365E00], D_8037DD30), + func_802C44EC(D_80365E04[D_8037DCE8], D_80365E04[D_80365E00], D_8037DD30) + ); + if(this->marker->unk14_21) + osViBlack(0); + }//L802C5734 +} + +void func_802C5740(Actor * this){ + int i = func_8031B5B0(); + D_8037DCE0.unk0 = (&D_80365DF4)[i]; + D_8037DCE0.unk4 = (&D_80365DF8)[i]; + + if(!this->initialized){ + func_8033CE40(); + if(D_8037DCF4 == NULL){ + D_8037DCF4 = gczoombox_new(0xA0, 0xc, 2, 0, NULL); + gczoombox_open(D_8037DCF4); + func_803184C8(D_8037DCF4, 30.0f, 5, 2, 0.4f, 0, 0); + }//L802C57FC + + if(D_8037DCF0 == NULL){ + D_8037DCF0 = gczoombox_new(0xA, 0xd, 2, 1, func_802C44D0); + func_80318284(D_8037DCF0, 2, &D_8037DCE0); + gczoombox_open(D_8037DCF0); + gczoombox_maximize(D_8037DCF0); + }//L802C5860 + + func_803300D8(this->marker, func_802C4AF0); + D_8037DCEC = 0; + func_8031FBF8(); + func_8031FBA0(); + D_8037DCE8 = 0; + D_80365E00 = 0; + D_8037DCF8[1][0] = D_80365DD0[0][0]; + D_8037DCF8[1][1] = D_80365DD0[0][1]; + D_8037DCF8[1][2] = D_80365DD0[0][2]; + + D_8037DCF8[0][0] = D_80365E04[0][0]; + D_8037DCF8[0][1] = D_80365E04[0][1]; + D_8037DCF8[0][2] = D_80365E04[0][2]; + D_8037DD30 = 0.75f; + D_8037DD34 = func_8038AAB0(&D_80365E04[0], &D_8037DCE8) ? 20.0 : 0.0; + actor_collisionOff(this); + func_8025A6EC(COMUSIC_73_GAMEBOY, 0); + }//L802C5940 + if(!func_8038AAB0()){ + if(D_8037DCF4) + func_80316EF4(D_8037DCF4); + if(D_8037DCF0) + func_80316EF4(D_8037DCF0); + } + func_802C4C14(this); +} + +void func_802C5994(void){ + s32 sp1C = level_get(); + s32 t6 = map_get() == MAP_83_CS_GAME_OVER_MACHINE_ROOM; + s32 a1 = (0 < sp1C && sp1C < 0xd); + if( a1 || t6) + { + if(D_80365E00 != -1 && !func_802E4A08() && map_get() != MAP_91_FILE_SELECT){ + func_8033D17C(D_80365E00); + func_8033CFD4(D_80365E00); + } + } +} + +s32 func_802C5A30(void){ + return D_80365E00; +} + +void func_802C5A3C(s32 arg0){ + D_80365E00 = arg0; +} + +void func_802C5A48(void){ + D_80365E00 = -1; +} \ No newline at end of file diff --git a/src/core2/ch/ghost.c b/src/core2/ch/ghost.c new file mode 100644 index 00000000..fd00bf66 --- /dev/null +++ b/src/core2/ch/ghost.c @@ -0,0 +1,367 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + f32 unk0; + f32 unk4; +} ActorLocal_Core2_D4050; + +void func_8035B900(Actor *this); +void func_8035BD48(Actor *this); + +/* .data */ +ActorAnimationInfo D_80372BE0[] ={ + {0x00, 0.0f}, + {ASSET_9E_ANIM_TEEHEE_IDLE, 2.0f}, + {ASSET_9F_ANIM_TEEHEE_ALERTED, 1.5f}, + {ASSET_AC_ANIM_TEEHEE_CHASE, 1.0f}, + {ASSET_9E_ANIM_TEEHEE_IDLE, 2.0f}, + {ASSET_9E_ANIM_TEEHEE_IDLE, 2.0f}, + {ASSET_2AB_ANIM_TEEHEE_DIE, 1.0f} +}; + +ActorInfo D_80372C18 = { //TEEHEE + 0x99, ACTOR_CA_TEEHEE, ASSET_3CB_MODEL_TEEHEE, + 0x1, D_80372BE0, + func_8035B900, func_80326224, func_80325888, + 6500, 0, 0.9f, 0 +}; + +ActorInfo D_80372C3C = { //PURPLE_TEEHEE (inside tumblar) + 0x296, ACTOR_3C1_PURPLE_TEEHEE, ASSET_564_MODEL_PURPLE_TEEHEE, + 0x1, D_80372BE0, + func_8035B900, func_8035BD48, func_80325888, + 6500, 0, 0.9f, 0 +}; + +s32 D_80372C60[3] = {0x46, 0xFE, 0x46}; + +s32 D_80372C6C[3] = {0xFE, 0x46, 0xFE}; + +/* .code */ +void func_8035AFE0(f32 scale, f32 pos[3], s32 cnt, enum asset_e sprite_id, s32 arg4[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + + particleEmitter_setSprite(pCtrl, sprite_id); + func_802EFFA8(pCtrl, arg4); + particleEmitter_setPosition(pCtrl, pos); + particleEmitter_setParticleSpawnPositionRange(pCtrl, + -100.0f*scale, 20.0f*scale, -100.0f*scale, + 100.0f*scale, 200.0f*scale, 100.0f*scale + ); + particleEmitter_setParticleAccelerationRange(pCtrl, + 0.0f, -10.0f*scale, 0.0f, + 0.0f, -10.0f*scale, 0.0f + ); + particleEmitter_setParticleVelocityRange(pCtrl, + -100.0f*scale, -20.0f*scale, -100.0f*scale, + 100.0f*scale, 100.0f*scale, 100.0f*scale + ); + func_802EFB70(pCtrl, scale*0.4, scale*0.6); + func_802EFB84(pCtrl, scale*1.0, scale*1.4); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 1.0f, 1.4f); + func_802EFA5C(pCtrl, 0.0f, 0.01f); + func_802EFA70(pCtrl, 0x10); + particleEmitter_emitN(pCtrl, cnt); +} + +void func_8035B1CC(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + f32 sp30; + + sp30 = this->scale; + func_8030E878(SFX_121_AWAWAU, 1.3f, 32000, this->position, this->scale*400.0f, this->scale*1800.0f); + func_8030E878(SFX_30_MAGIC_POOF, 1.0f, 32000, this->position, this->scale*400.0f, this->scale*1800.0f); + func_80328B8C(this, 6, 0.01f, 1); + actor_playAnimationOnce(this); + actor_collisionOff(this); + func_80326310(this); + func_8035AFE0(sp30, this->position, 8, ASSET_700_SPRITE_DUST, D_80372C60); +} + +void func_8035B2C4(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + f32 sp30 = this->scale; + func_8030E878(SFX_121_AWAWAU, 1.3f, 32000, this->position, this->scale*400.0f, this->scale*1800.0f); + func_8030E878(SFX_30_MAGIC_POOF, 1.0f, 32000, this->position, this->scale*400.0f, this->scale*1800.0f); + func_80328B8C(this, 6, 0.01f, 1); + actor_playAnimationOnce(this); + actor_collisionOff(this); + func_8035AFE0(sp30, this->position, 8, ASSET_700_SPRITE_DUST, D_80372C6C); +} + +void func_8035B3B4(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + this->unk60 = 1.0f; +} + +int func_8035B3E4(Actor *this){ + if(func_80329530(this, (s32)(this->scale*600.0f)) && func_803292E0(this)) + return 1; + return 0; +} + +int func_8035B444(Actor *this, f32 arg1){ + int out; + func_80328FB0(this, arg1); + + if(!func_80329054(this, 2) && func_80329480(this)) + return 0; + return 1; +} + +void func_8035B49C(Actor *this){ + f32 tmp_f2; + if(this->velocity_x < this->unk1C_x){ + this->velocity_x = (f64)this->velocity_x + this->scale; + } + else if(this->unk1C_x < this->velocity_x){ + this->velocity_x = (f64)this->velocity_x - this->scale; + } + this->velocity_z += (this->velocity_y += (0.0f <= this->velocity_z)? -(0.1*this->scale) : 0.1*this->scale); + this->position_y = this->velocity_z + this->velocity_x; +} + +void func_8035B56C(Actor *this){ + f32 sp2C; + f32 plyr_pos[3]; + + sp2C = 2*(f64)this->scale; + player_getPosition(plyr_pos); + + if(this->position_y < plyr_pos[1]){ + if(this->position_y + sp2C < plyr_pos[1]){ + this->position_y = this->position_y + sp2C; + this->velocity_x += sp2C; + } + else{ + this->velocity_x += plyr_pos[1] - this->position_y; + this->position_y = plyr_pos[1]; + } + } + else if(plyr_pos[1] < this->position_y){ + if(plyr_pos[1] < this->position_y - sp2C){ + this->position_y = this->position_y - sp2C; + this->velocity_x -= sp2C; + } + else{ + this->velocity_x -= (this->position_y - plyr_pos[1]); + this->position_y = plyr_pos[1]; + } + + } + +} + +void func_8035B674(Actor *this){ + ActorLocal_Core2_D4050 *local = (ActorLocal_Core2_D4050 *)&this->local; + + func_80328B8C(this, 1, 0.01f, 1); + actor_loopAnimation(this); + local->unk0 = randf2(1.0f, 4.5f); + +} + +void func_8035B6CC(Actor *this){ + func_80328B8C(this, 2, 0.01f, 1); + actor_playAnimationOnce(this); + this->unk28 = 1.0f; + func_8030E878(0x3F4, randf2(1.0f, 1.2f), 32000, this->position, this->scale*400.0f, this->scale*1800.0f); +} + +void func_8035B75C(Actor *this){ + func_80328B8C(this, 3, 0.01f, 1); + actor_loopAnimation(this); + this->unk28 = func_803203FC(0xC1) ? 0.0 : 12.0; + func_8030E878(0x3F4, randf2(1.0f, 1.2f), 32000, this->position, this->scale*400.0f, this->scale*1800.0f); +} + +void func_8035B824(Actor *this){ + ActorLocal_Core2_D4050 *local = (ActorLocal_Core2_D4050 *)&this->local; + + func_80328B8C(this, 4, 0.01f, 1); + actor_loopAnimation(this); + func_80328CEC(this, (s32)this->yaw_moving, 0xA, 0x1E); + this->unk28 = 4.0f; + local->unk4 = randf2(2.0f, 4.5f); + + +} + +void func_8035B8A8(Actor *this){ + func_80328B8C(this, 5, 0.01f, 1); + actor_loopAnimation(this); + func_80328CEC(this, (s32)this->yaw_moving, 0xE1, 0x87); +} + +void func_8035B900(Actor *this){ + ActorLocal_Core2_D4050 *local = (ActorLocal_Core2_D4050 *)&this->local; + s32 sp30 = func_8023DB5C(); + f32 sp2C = time_getDelta(); + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + marker_setCollisionScripts(this->marker, NULL, func_8035B3B4, func_8035B1CC); + this->marker->propPtr->unk8_3 = FALSE; + actor_collisionOn(this); + this->velocity_z = 0.0f; + this->unk60 = 0.0f; + this->unk1C[0] = this->position_y + this->scale*100.0f; + this->velocity_y = this->scale*2.0; + this->velocity_x = this->unk1C[0]; + local->unk0 = randf2(1.0f, 4.5f); + animctrl_setTransitionDuration(this->animctrl, 0.8f); + }//L8035B9D4 + + if(0.0 < this->unk60 - sp2C){ + this->unk60 -= sp2C; + } + else{//L8035BA08 + switch(this->state){ + case 1: //L8035BA30 + func_8035B49C(this); + if(func_8035B3E4(this)){ + func_8035B6CC(this); + } + else if(0.0 < local->unk0 - sp2C){ + local->unk0 = local->unk0 - sp2C; + } + else{ + func_8035B824(this); + } + break; + case 2: //L8035BA98 + this->yaw_moving = func_80329784(this); + func_8035B444(this, 4.0f); + if(actor_animationIsAt(this, 0.99f)){ + func_8035B75C(this); + } + break; + case 3: //L8035BAE0 + func_8035B56C(this); + if((sp30 & 0x3F) == 7 && randf() < 0.7){ + func_8030E878(0x3F4, randf2(1.0f, 1.2f), 32000, this->position, this->scale*400.0f, this->scale*1800.0f); + }//L8035BB6C + this->yaw_moving = func_80329784(this); + if(!func_8035B3E4(this) || !func_8035B444(this, 5.0f)){ + func_8035B674(this); + } + break; + case 4: //L8035BBB0 + func_8035B49C(this); + if(!func_8035B444(this, 2.0f)){ + func_8035B8A8(this); + } + else if(local->unk4 - sp2C <= 0.0){ + func_8035B674(this); + } + else{ + local->unk4 = local->unk4 - sp2C; + } + break; + case 5: //L8035BC1C + func_8035B49C(this); + func_80328FB0(this, 3.0f); + if(func_80329480(this)){ + func_8035B674(this); + } + break; + case 6: //L8035BC48 + break; + } + }//L8035BC48 +} + +int func_8035BC5C(Actor *this, s32 target, s32 delta){ + s32 done = FALSE; + s32 alpha; + if(delta < 0){ + if((s32)(this->alpha_124_19 + delta) < target){ + this->alpha_124_19 = target; + done = TRUE; + } + + } + else{//L8035BCB8 + if(target < this->alpha_124_19 + delta){ + this->alpha_124_19 = target; + done = TRUE; + } + } + if(!done){ + this->alpha_124_19 += delta; + } + alpha = this->alpha_124_19; + actor_setOpacity(this, alpha); + return done; +} + +void func_8035BD48(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = FALSE; + actor_collisionOn(this); + marker_setCollisionScripts(this->marker, NULL, func_8035B3B4, func_8035B2C4); + mapSpecificFlags_set(3, FALSE); + mapSpecificFlags_set(4, FALSE); + if(map_get() == MAP_24_MMM_TUMBLARS_SHED){ + if( jiggyscore_isSpawned(JIGGY_62_MMM_TUMBLAR) + || jiggyscore_isCollected(JIGGY_62_MMM_TUMBLAR) + ){ + marker_despawn(this->marker); + } + else{//L8035BE04 + func_80328B8C(this, 1, 0.01f, 1); + actor_setOpacity(this, 0); + } + } + else{//L8035BE2C + func_80328B8C(this, 3, 0.01f, 1); + actor_setOpacity(this, 0xff); + } + }//L8035BE50 + + switch(this->state){ + case 1: //L8035BE78 + actor_collisionOff(this); + if(mapSpecificFlags_getClear(4)){ + marker_despawn(this->marker); + } + else if(mapSpecificFlags_getClear(3)){ + func_80328B8C(this, 3, 0.01f, 1); + } + break; + case 3: //L8035BECC + this->unk58_0 = TRUE; + actor_collisionOn(this); + if(mapSpecificFlags_getClear(4)){ + this->unk38_0 = TRUE; + func_8035B2C4(this->marker, NULL); + } + else{//L8035BF14 + if(this->alpha_124_19 == 0xFF || func_8035BC5C(this, 0xff, 0xA)){ + func_80343DEC(this); + } + + if((func_8023DB5C() &0x3F) == 7 && randf() < 0.7){ + func_8030E878(0x3f4, randf2(1.0f, 1.2f), 32000, this->position, this->scale*400.0f, this->scale*1800.0f); + } + } + break; + case 6: //L8035BFD4 + if(func_8035BC5C(this, 0, -7)){ + this->unk58_0 = FALSE; + this->unk48 = 0.0f; + func_80343DEC(this); + if(this->unk38_0){ + marker_despawn(this->marker); + } + else{ + func_80328B8C(this, 1, 0.01f, 1); + timedFunc_set_2(randf2(5.0f, 10.0f), mapSpecificFlags_set, 3, TRUE); + } + } + break; + }//L8035C06C +} diff --git a/src/core2/ch/gloop.c b/src/core2/ch/gloop.c new file mode 100644 index 00000000..b2436ba9 --- /dev/null +++ b/src/core2/ch/gloop.c @@ -0,0 +1,93 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *chgloop_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void chgloop_update(Actor *this); + +/* .data */ +ActorAnimationInfo chgloop_animations[] ={ + {0x00, 0.0f}, + {ASSET_CA_ANIM_GLOOP_SWIMMING, 2.0f}, + {ASSET_CA_ANIM_GLOOP_SWIMMING, 1.0f}, + {ASSET_CA_ANIM_GLOOP_SWIMMING, 0.4f}, + {ASSET_CB_ANIM_GLOOP_BLOWING_BUBBLE, 1.5f}, + {ASSET_CA_ANIM_GLOOP_SWIMMING, 2.0f}, + {ASSET_CA_ANIM_GLOOP_SWIMMING, 2.0f} +}; + +ActorInfo chGloop = { + MARKER_6A_GLOOP, ACTOR_E6_GLOOP, ASSET_372_MODEL_GLOOP, + 0x2, chgloop_animations, + chgloop_update, chgloop_update, chgloop_draw, + 1900, 0, 0.0f, 0 +}; + +/* .code */ +Actor *chgloop_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = func_80325888(marker, gfx, mtx, vtx); + if(!marker->unk14_21) + return this; + + func_8034A174(func_80329934(), 5, this->unk1C); + return this; +} + +void chgloop_spawnBubble(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ + f32 sp1C[3]; + sp1C[0] = reinterpret_cast(f32, arg0); + sp1C[1] = reinterpret_cast(f32, arg1); + sp1C[2] = reinterpret_cast(f32, arg2); + func_8032813C(ACTOR_E7_GLOOP_BUBBLE, sp1C, (s32)reinterpret_cast(f32, arg3)); +} + +void chgloop_update(Actor *this){ + f32 sp34[3]; + + if(!this->initialized){ + actor_collisionOff(this); + this->initialized = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + } + + func_80326224(this); + + switch(this->state){ + case 2://L802D14DC + actor_loopAnimation(this); + if(this->unk54 != 0.0f) + func_80328A84(this, 4); + + if( !mapSpecificFlags_get(2) + && func_80329530(this, 350) + && func_80311480(ASSET_D34_TEXT_GLOOP_MEET, 0, NULL, NULL, NULL, NULL) + ){ + mapSpecificFlags_set(2, TRUE); + } + break; + + case 4://L802D1558 + actor_playAnimationOnce(this); + if(this->unk54 == 0.0f) + func_80328A84(this, 2); + + if(actor_animationIsAt(this, 0.6f)){ + if(this->marker->unk14_21){ + sp34[0] = this->unk1C[0]; + sp34[1] = this->unk1C[1]; + sp34[2] = this->unk1C[2]; + } + else{ + sp34[0] = this->position[0]; + sp34[1] = this->position[1]; + sp34[2] = this->position[2]; + } + if(func_80329530(this, 1900)){ + func_802C3F04(chgloop_spawnBubble, reinterpret_cast(s32, sp34[0]), reinterpret_cast(s32, sp34[1]), reinterpret_cast(s32, sp34[2]), reinterpret_cast(s32, this->yaw)); + } + + func_8030E9C4(SFX_3ED, randf()/2 + 0.6, 32000, this->position, 100.0f, 3000.0f); + } + break; + }//L802D1670 +} diff --git a/src/core2/ch/icecube.c b/src/core2/ch/icecube.c new file mode 100644 index 00000000..8ac0a721 --- /dev/null +++ b/src/core2/ch/icecube.c @@ -0,0 +1,376 @@ +#include +#include "functions.h" +#include "variables.h" + +#define _HorzDist3v(v1, v2) ((v1[0]-v2[0])*(v1[0]-v2[0]) + (v1[2]-v2[2])*(v1[2]-v2[2])) +extern void func_802D729C(Actor *, f32); +extern f32 func_80257204(f32, f32, f32, f32); + +void chicecube_update(Actor *this); +Actor *chicecube_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorAnimationInfo D_80372B50[] = { + {0x000, 0.0f}, + {ASSET_233_ANIM_ICECUBE, 999999.0f}, + {ASSET_233_ANIM_ICECUBE, 1.2f}, + {ASSET_233_ANIM_ICECUBE, 999999.0f}, + {ASSET_233_ANIM_ICECUBE, 999999.0f}, + {ASSET_233_ANIM_ICECUBE, 1.2f} +}; + +ActorInfo D_80372B80 = { + 0x250, 0x37D, ASSET_504_MODEL_ICECUBE, + 1, D_80372B50, + chicecube_update, func_80326224, chicecube_draw, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80372BA4 = { + 0x25F, 0x3A0, ASSET_504_MODEL_ICECUBE, + 1, D_80372B50, + chicecube_update, func_80326224, chicecube_draw, + 0, 0, 0.0f, 0 +}; + +s32 D_80372BC8[3] = {220, 220, 230}; +s32 D_80372BD4[3] = {200, 200, 255}; + +/*.code */ +Actor *chicecube_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *actor = marker_getActor(marker); + func_8033A45C(3, actor->unk38_31); + actor = func_80325888(marker, gfx, mtx, vtx); + return actor; +} + +int func_80359DF4(Actor *this, s32 arg1){ + if(func_80329530(this, arg1) && func_803292E0(this)) + return 1; + return 0; +} + +int func_80359E38(Actor *this, s32 arg1, s32 arg2){ + int sp1C = 0; + if(arg1 < this->alpha_124_19 + arg2){ + this->alpha_124_19 = arg1; + sp1C = 1; + } + else{ + this->alpha_124_19 += arg2; + } + actor_setOpacity(this, this->alpha_124_19); + return sp1C; +} + +int func_80359EBC(Actor *this, s32 arg1, s32 arg2){ + int sp1C = 0; + if((this->alpha_124_19 - arg2) < arg1){ + this->alpha_124_19 = arg1; + sp1C = 1; + } + else{ + this->alpha_124_19 -= arg2; + } + actor_setOpacity(this, this->alpha_124_19); + return sp1C; +} + +int func_80359F40(Actor *this, f32 arg1[3]){ + f32 sp24; + f32 sp20; + + sp24 = func_80257204(this->position[0], this->position[2], arg1[0], arg1[2]); + if((func_8023DB5C() & 0xF) == 4){ + this->velocity[2] = (f32)randi2(-45, 45); + } + sp20 = this->yaw; + sp24 += this->velocity[2]; + this->yaw = sp24; + if(func_80329030(this, 0)){ + this->yaw = sp20; + return 1; + } + else{ + this->yaw = sp20; + return 0; + } +} + +int func_80359FEC(f32 arg0[3], f32 arg1[3], s32 arg2){ + if(_HorzDist3v(arg0, arg1) < arg2*arg2) + return 1; + return 0; +} + +void func_8035A04C(f32 position[3], s32 cnt, enum asset_e model_id, f32 scale){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + + particleEmitter_setModel(pCtrl, model_id); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setParticleSpawnPositionRange(pCtrl, -100.0f*scale, 0.0f, -100.0f*scale, 100.0f*scale, 200.0f*scale, 100.0f*scale); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1000.0f, 0.0f, 0.0f, -1000.0f, 0.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -400.0f*scale, 450.0f*scale, -400.0f*scale, 400.0f*scale, 600.0f*scale, 400.0f*scale); + func_802EFE24(pCtrl, 100.0f*scale, 100.0f*scale, 100.0f*scale, 250.0f*scale, 250.0f*scale, 250.0f*scale); + func_802EFB70(pCtrl, scale*0.2, scale*0.4); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.02f); + func_802EFEC0(pCtrl, 2.2f, 2.2f); + func_802EFA5C(pCtrl, 0.0f, 0.3f); + particleEmitter_emitN(pCtrl, cnt); +} + +void func_8035A228(f32 position[3], s32 cnt, enum asset_e sprite_id, f32 scale){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + + func_802EFFA8(pCtrl, D_80372BC8); + particleEmitter_setSprite(pCtrl, sprite_id); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setParticleSpawnPositionRange(pCtrl, -50.0f*scale, 0.0f, -50.0f*scale, 50.0f*scale, 200.0f*scale, 50.0f*scale); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -10.0f, 0.0f, 0.0f, -10.0f, 0.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -280.0f*scale, 0.0f, -280.0f*scale, 280.0f*scale, 280.0f*scale, 280.0f*scale); + func_802EFB70(pCtrl, scale*0.6, scale*0.8); + func_802EFB84(pCtrl, scale*1.0, scale*1.4); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 1.2f, 1.8f); + func_802EFA5C(pCtrl, 0.0f, 0.01f); + particleEmitter_emitN(pCtrl, cnt); +} + +void func_8035A3F8(f32 position[3], s32 cnt, enum asset_e sprite_id, f32 scale){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + + func_802EFFA8(pCtrl, D_80372BD4); + particleEmitter_setSprite(pCtrl, sprite_id); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -10.0f, 0.0f, 0.0f, -10.0f, 0.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -60.0f*scale, 0.0f, -60.0f*scale, 60.0f*scale, 60.0f*scale, 60.0f*scale); + func_802EFB70(pCtrl, scale*0.4, scale*0.6); + func_802EFB84(pCtrl, scale*0.8, scale*1.2); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 0.5f, 0.7f); + func_802EFA5C(pCtrl, 0.0f, 0.3f); + func_802EFA70(pCtrl, 4); + particleEmitter_emitN(pCtrl, cnt); +} + +void func_8035A594(f32 position[3], f32 arg1, f32 arg2){ + int i; + int v0; + for(i = 60; i != 380; i+=160){ + v0 = i; + if(i > 360) + v0 = i - 360; + + if(v0 < arg1 && arg2 < v0){ + func_8030E878(SFX_28_RUSTLING_NOISE, randf2(1.6f, 1.7f), 17000, position, 500.0f, 1000.0f); + } + } +} + +void func_8035A694(Actor *this){ + f32 sp3C; + f32 sp38; + s32 tmp_v0; + f32 sp28[3]; + + sp3C = this->yaw; + sp38 = this->unk28*1.5 + 1.0; + tmp_v0 = func_8023DB5C(); + this->yaw += sp38; + if(360.0f < this->yaw) + this->yaw -= 360.0f; + if(this->marker->unk14_21 && !(tmp_v0 & 1)){ + func_8034A174(this->marker->unk44, 5, sp28); + func_8035A3F8(sp28, 1, ASSET_70D_SPRITE_SMOKE_1, this->scale); + } + func_8035A594(this->position, this->yaw, sp3C); + +} + +void __chicecube_spawnHalfCubes(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + Actor *other; + f32 sp54[3]; + int i; + f32 pad[1]; + + sp54[0] = actor->position[0]; + sp54[1] = actor->position[1]; + sp54[2] = actor->position[2]; + sp54[1] += 100.0f; + for(i = 0; i < 2; i++){//L8035A7FC + func_802C8F70((i & 1)? actor->yaw : actor->yaw + 180.0f); + other = func_802C937C(0x21, sp54); + other->unkF4_8 = 1; //don't spawn more + other->scale = randf2(0.5f, 0.6f)*actor->scale; + actor->yaw = randi2(0, 359); + } + if(marker); +} + +//__chicecube_ow +void __chicecube_ow(ActorMarker *marker, ActorMarker *other_marker){ + Actor *actor = marker_getActor(marker); + FUNC_8030E8B4(SFX_1D_HITTING_AN_ENEMY_1, 0.9f, 22000, actor->position, 1500, 3000); + actor->velocity[1] = 0.8f; + actor->unk28 = 0.0f; +} + +//__chicecube_die +void __chicecube_die(ActorMarker *marker, ActorMarker *other_marker){ + Actor *actor = marker_getActor(marker); + FUNC_8030E8B4(SFX_B6_GLASS_BREAKING_1, 1.0f, 32000, actor->position, 1500, 4500); + actor->velocity[1] = 0.0f; + func_8035A04C(actor->position, 12, ASSET_505_MODEL_ICECUBE_CHUNK, actor->scale); + func_8035A228(actor->position, 6, ASSET_700_SPRITE_DUST, actor->scale); + if(actor->unkF4_8 != 1){ + func_802C3C88(__chicecube_spawnHalfCubes, actor->marker); + } + marker_despawn(actor->marker); +} + +void func_8035A998(Actor *this){ + func_80328B8C(this, 1, 0.0001f, 1); + actor_playAnimationOnce(this); + this->unk38_31 = 0; +} + +void func_8035A9E0(Actor *this){ + func_80328B8C(this, 3, animctrl_getAnimTimer(this->animctrl), 1); + actor_loopAnimation(this); + this->unk38_31 = 1; + this->unk28 = 0.0f; +} + +void func_8035AA40(Actor *this){ + func_80328B8C(this, 5, 0.9999f, 0); + actor_playAnimationOnce(this); + this->unk38_31 = 1; +} + +void chicecube_update(Actor *this){ + f32 sp3C = time_getDelta(); + f32 sp30[3]; + + if(map_get() == MAP_27_FP_FREEZEEZY_PEAK){ + if(func_8038BFA0()){ + actor_collisionOff(this); + this->unk58_0 = FALSE; + return; + } + actor_collisionOn(this); + this->unk58_0 = TRUE; + }//L8035AAF4 + + if(!actor_playerIsWithinDist(this, 3000)) + return; + + func_802D729C(this, 3.4 * this->scale); + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + marker_setCollisionScripts(this->marker, __chicecube_ow, NULL, __chicecube_die); + this->marker->propPtr->unk8_3 = FALSE; + actor_collisionOff(this); + this->alpha_124_19 = 0x50; + actor_setOpacity(this, this->alpha_124_19); + this->unk38_31 = 0; + this->unk60 = 1.0f; + }//L8035ABC0 + if(this->unk60 <= 0.0){ + if(-99999.0 != this->unk60){ + this->unk60 = -99999.0f; + actor_collisionOn(this); + this->unk1C[0] =this->position[0]; + this->unk1C[1] =this->position[1]; + this->unk1C[2] =this->position[2]; + this->velocity[0] = this->yaw; + } + } + else{//L8035AC3C + this->unk60 -= sp3C; + } + + if(0.0 >= this->velocity[1]){ + this->velocity[1] = 0.0f; + } + else{ + this->velocity[1] -= sp3C; + return; + } + switch(this->state){ + case 1: // L8035AC9C + animctrl_setAnimTimer(this->animctrl, 0.0f); + if( func_80359DF4(this, 900) + || (this->unkF4_8 == 2 && func_803203FC(0xC1)) + ){ + func_80328B8C(this, 2, 0.0001f, 1); + actor_playAnimationOnce(this); + this->unk38_31 = 0x1; + } + break; + case 2: // L8035AD10 + if(actor_animationIsAt(this, 0.1f)){ + FUNC_8030E8B4(SFX_112_TINKER_ATTENTION, 1.3f, 23000, this->position, 1500, 4500); + } + if( func_80359E38(this, 0xff, 0xa) + && 0.98 < animctrl_getAnimTimer(this->animctrl) + ){ + func_8035A9E0(this); + } + break; + case 3: // L8035AD88 + animctrl_setAnimTimer(this->animctrl, 0.999f); + if(this->unk28 + 0.28 < 18.0){ + this->unk28 = this->unk28 + 0.28; + } + else{ + this->unk28 = 18.0f; + } + func_8035A694(this); + if(!func_80359DF4(this, 1300)){ + func_80328B8C(this, 4, animctrl_getAnimTimer(this->animctrl), 1); + actor_loopAnimation(this); + this->unk38_31 = 1; + } + else{ + player_getPosition(sp30); + if(!func_80359F40(this, sp30)){ + func_8035A998(this); + } + } + break; + case 4: // L8035AE64 + animctrl_setAnimTimer(this->animctrl, 0.999f); + if(this->unk28 - 0.28 > 8.0) + this->unk28 = this->unk28 - 0.28; + else + this->unk28 = 8.0f; + func_8035A694(this); + if(func_80359DF4(this, 900)){ + func_8035A9E0(this); + } + else if(func_80359FEC(this->position, this->unk1C, 0x14)){//L8035AEEC + if(func_803294F0(this, 0xa, (s32)this->velocity[0])){ + func_8035AA40(this); + } + } + else{//L8035AF38 + if(!func_80359F40(this, this->unk1C)){ + func_8035AA40(this); + } + } + break; + case 5: // L8035AF58 + if(actor_animationIsAt(this, 0.25f)){ + FUNC_8030E8B4(SFX_112_TINKER_ATTENTION, 1.3f, 23000, this->position, 1500, 4500); + } + if( animctrl_getAnimTimer(this->animctrl) < 0.1 + && func_80359EBC(this, 0x50, 0xA) + ){ + func_8035A998(this); + } + + break; + } + +} diff --git a/src/core2/ch/jiggy.c b/src/core2/ch/jiggy.c new file mode 100644 index 00000000..a7b411bc --- /dev/null +++ b/src/core2/ch/jiggy.c @@ -0,0 +1,212 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802BE720(void); +extern f32 func_8033A244(f32); +extern void func_8033A280(f32); + +extern u8 D_80329904[]; + +typedef struct chjiggy_s{ + u32 unk0; + u32 index; +} ActorLocal_Jiggy; + +Actor *func_802C41D8(f32, f32, f32); +void func_802C7AF8(u32 x, u32 y, u32 z, u32 arg3); +Actor *func_802C7D0C(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); +void func_802C7D98(Actor * arg0); +void func_802C7DC0(Actor *this); +int func_802C8088(Actor *this); + + + +/* .data */ +ActorAnimationInfo D_80366290[] = { + {0, 0.0f}, + {0, 0.0f}, + {0, 0.0f} +}; + +ActorInfo D_803662A8 = { + 0x52, ACTOR_46_JIGGY, ASSET_35F_MODEL_JIGGY, + 1, D_80366290, + func_802C7DC0, func_802C7D98, func_802C7D0C, + 0, 0, 0.9f, 0 +}; + +/* .code */ +enum jiggy_e func_802C7A30(Actor *this){ + s32 id; + s32 sp18[3]; + + id = map_get(); + + sp18[0] = (s32)this->position[0]; + sp18[1] = (s32)this->position[1]; + sp18[2] = (s32)this->position[2]; + id = func_80307164(sp18); + if( id < 0){ + return 0; + } + else{ + return func_80306DBC(id) + 1; + } +} + +void func_802C7AB0(ActorMarker * arg0, u32 arg1){ + func_8030E6D4(SFX_30_MAGIC_POOF); + func_8025A6EC(COMUSIC_3C_MINIGAME_LOSS, 0x7FF8); + mapSpecificFlags_set(arg1, 1); + marker_despawn(arg0); +} + +void func_802C7AF8(u32 x, u32 y, u32 z, u32 arg3){ + func_802C3F04((GenMethod_4)func_802C41D8, ACTOR_4C_STEAM, x, y, z); + func_802C3F04((GenMethod_4)func_802C41D8, ACTOR_14F_DESTROYED_JIGGY, x, y, z); + mapSpecificFlags_set(arg3, 1); +} + +void func_802C7B6C(u32 arg0){ + mapSpecificFlags_set(arg0, 0); +} + +void func_802C7B8C(Actor *this, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6){ + if( !mapSpecificFlags_get(arg1) + && mapSpecificFlags_get(arg2) + && item_getCount(ITEM_0_HOURGLASS_TIMER) == 0 + ){ + func_8028FCC8(1); + actor_collisionOff(this); + func_802BAFE4(arg3); + func_80356520(arg6); + timedFunc_set_4(0.6f, (TFQM4)func_802C7AF8, (s32)this->position[0], (s32)this->position[1], (s32)this->position[2], arg4); + timedFunc_set_2(0.6f, (TFQM2)func_802C7AB0, (s32)this->marker, arg5); + timedFunc_set_0(1.0f, (TFQM0)func_802BE720); + timedFunc_set_1(3.9f, (TFQM1)func_802C7B6C, arg4); + mapSpecificFlags_set(arg1, 1); + } +} + +//chjiggy_updateRotate +void func_802C7CA4(Actor *this){ + f32 delta = time_getDelta(); + this->yaw += delta * 230.0f; + if(360.0f <= this->yaw){ + this->yaw -= 360.0f; + } + this->yaw_moving = this->yaw; +} + +//chjiggy_draw +Actor *func_802C7D0C(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3){ + Actor * thisActor = marker_getActor(this); + ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&thisActor->local; + u32 jiggyId; + + if(!local->unk0){ + jiggyId = func_802C8088(thisActor); + if((jiggyId == JIGGY_1C_CC_RINGS) || (jiggyId == JIGGY_1D_CC_SLOW_SAWBLADES)){ + func_8033A280(10.0f); + func_8033A244(30000.0f); + } + thisActor = func_80325888(this, gdl, mptr, arg3); + } + return thisActor; +} + +void func_802C7D98(Actor * arg0){ + func_80343DEC(arg0); + func_802C7CA4(arg0); +} + +//chjiggy_update +void func_802C7DC0(Actor *this){ + ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&this->local; + int i; + + if(this->marker->unk14_21){ + for(i = 0; i < 4; i++){ + if(randf() < 0.015){ + func_8033E73C(this->marker, i + 5, &D_80329904); + func_8033E3F0(8, 1); + } + } + }//L802C7E44 + switch(this->state){ + case 1: //L802C7E68 + local->unk0 = 0; + if(local->index == 0) + local->index = func_802C7A30(this); + + if(jiggyscore_isCollected(local->index)){ + marker_despawn(this->marker); + } + else{ + func_80328A84(this, 2); + switch(func_802C8088(this)){ + case JIGGY_17_CC_CLANKER_RAISED: //L802C7EF8 + case JIGGY_49_CCW_EYRIE:// L802C7EF8 + this->marker->unk40_21 = 1; + break; + case JIGGY_36_LAIR_TTC_WITCH_SWITCH:// L802C7F0C + this->unk44_14 = func_80341F2C(0x20A); + this->unk48 = 0.0f; + this->unk4C = 300.0f; + this->marker->unk2C_2 = 1; + this->unk54 = 0.0f; + func_80343DEC(this); + func_802C7CA4(this); + break; + case JIGGY_3E_GV_GRABBA:// L802C7F6C + case JIGGY_4D_CCW_FLOWER:// L802C7F6C + this->unk124_6 = 0; + break; + case JIGGY_41_GV_MAZE:// L802C7F7C + this->marker->unk14_10 = 0x1E; + break; + case JIGGY_13_TTC_LOCKUP: //L802C7F94 + this->marker->unk14_10 = 0x28; + break; + } + } + break; + case 2: //L802C7FAC + func_802C7CA4(this); + switch(func_802C8088(this)){ + case JIGGY_20_BGS_ELEVATED_WALKWAY: //L802C7FE8 + func_802C7B8C(this, 4, 3, 0xD, 5, 2, 0xae); + break; + case JIGGY_25_BGS_MAZE://L802C8018 + func_802C7B8C(this, 0xd, 0xc, 0x1e, 9, 0xb, 0xaf); + break; + case JIGGY_2F_FP_XMAS_TREE://L802C8048 + if(levelSpecificFlags_get(0x29)) + actor_collisionOn(this); + else + actor_collisionOff(this); + break; + } + break; + }//L802C8074 +} + +//chjiggy_getId +int func_802C8088(Actor *this){ + ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&this->local; + return local->index; +} + + +void func_802C8090(Actor * this){ + ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&this->local; + local->unk0 = 1; + actor_collisionOff(this); +} + +//chjiggy_setId +void func_802C80B4(Actor *this, u32 id){ + ActorLocal_Jiggy *local = (ActorLocal_Jiggy *)&this->local; + local->index = id; +} diff --git a/src/core2/ch/jigsawdance.c b/src/core2/ch/jigsawdance.c new file mode 100644 index 00000000..01b97887 --- /dev/null +++ b/src/core2/ch/jigsawdance.c @@ -0,0 +1,106 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_8028EBA4(); + +Actor *func_802C80C0(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); +void func_802C811C(Actor * this); + +/* .data */ +ActorAnimationInfo D_803662D0[] = { + {0x00, 0.0f}, + {0x00, 2.0f}, + {0x76, 1.5f}, + {0x76, 1.5f}, + {0x30, 5.0f}, + {0x00, 2.0f} +}; + +ActorInfo D_80366300 = {0x68, 0x5A, 0x35E, + 1, D_803662D0, + func_802C811C, func_80326224, func_802C80C0, + 0, 0, 0.0f, 0 +}; + + +/* .code */ +Actor *func_802C80C0(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3){ + Actor *thisActor = marker_getActor(this); + + if(!thisActor->initialized){ + thisActor->initialized = 1; + return thisActor; + } + else{ + return func_80325888(this, gdl, mptr, arg3); + } +} + +void func_802C811C(Actor * this){ + ActorAnimCtrl *plyrMvmt; + + this->marker->collidable = 0; + switch(this->state){ + case 1: + break; + case 2: + player_getPosition(this->position); + this->yaw = func_8028EBA4(); + plyrMvmt = player_getAnimCtrlPtr(); + animctrl_setSmoothTransition(this->animctrl, 0); + animctrl_setIndex(this->animctrl, animctrl_getIndex(plyrMvmt)); + func_8028774C(this->animctrl,animctrl_getAnimTimer(plyrMvmt)); + animctrl_setDuration(this->animctrl, 1000.0f); + func_802875AC(this->animctrl, "chjigsawdance.c", 0x59); + break; + case 3: + plyrMvmt = player_getAnimCtrlPtr(); + animctrl_setSmoothTransition(this->animctrl, 0); + func_8028774C(this->animctrl,animctrl_getAnimTimer(plyrMvmt)); + animctrl_setDuration(this->animctrl, 1000.0f); + func_802875AC(this->animctrl, "chjigsawdance.c", 0x62); + break; + case 4: + player_getPosition(this->position); + this->yaw = func_8028EBA4(); + plyrMvmt = player_getAnimCtrlPtr(); + animctrl_setSmoothTransition(this->animctrl, 0); + func_8028774C(this->animctrl,animctrl_getAnimTimer(plyrMvmt)); + animctrl_setDuration(this->animctrl, 1000.0f); + func_802875AC(this->animctrl, "chjigsawdance.c", 0x6e); + break; + case 5: + this->marker->propPtr->unk8_4 = 0; + break; + } +} + +void func_802C82C0(Actor * this, u32 arg1){ + switch(arg1){ + case 3: + if(this->state == 1){ + func_80328A84(this, 2); + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_ONCE); + } + break; + case 2: + func_80328A84(this, 3); + break; + case 1: + func_80328A84(this, 4); + break; + case 4: + player_getPosition(this->position); + this->yaw = func_8028EBA4(); + animctrl_setSmoothTransition(this->animctrl, 0); + func_8028774C(this->animctrl, animctrl_getAnimTimer(player_getAnimCtrlPtr())); + animctrl_setDuration(this->animctrl, 1000.0f); + func_802875AC(this->animctrl, "chjigsawdance.c", 0x97); + break; + case 5: + func_80328A84(this, 5); + this->marker->propPtr->unk8_4 = 0; + break; + } +} diff --git a/src/core2/ch/jinjo.c b/src/core2/ch/jinjo.c new file mode 100644 index 00000000..b8ae2ffe --- /dev/null +++ b/src/core2/ch/jinjo.c @@ -0,0 +1,321 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80328B8C(Actor *, s32, f32 , s32); +extern f32 func_80309B24(f32*); +extern void func_80329904(ActorMarker*, s32, f32*); +extern void func_80326310(Actor *); +extern void func_8032BB88(Actor *, s32, s32); + +void func_802CDD78(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_803671B0[]; +extern ActorInfo D_80367200 = { 0x5A, 0x60, 0x3C0, 0x1, D_803671B0, func_802CDD78, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80367224 = { 0x5B, 0x62, 0x3C2, 0x1, D_803671B0, func_802CDD78, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80367248 = { 0x5E, 0x5E, 0x3BB, 0x1, D_803671B0, func_802CDD78, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_8036726C = { 0x5D, 0x61, 0x3C1, 0x1, D_803671B0, func_802CDD78, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80367290 = { 0x5C, 0x5F, 0x3BC, 0x1, D_803671B0, func_802CDD78, func_80326224, func_80325888, 0, 0, 0.0f, 0}; + +/*.rodata */ +//jumptable D_80376560 +extern f64 D_80376578; //45.0 +extern f64 D_80376580; //182.04444 +extern f64 D_803765A8; //0.015 +extern f64 D_803765B0; //0.8 +extern f64 D_803765B8; //0.3 +extern f64 D_803765C0; //0.2 +extern f64 D_803765C8; //0.9 +//0.1 +//.rodata end 803765d0 + +s32 func_802CDB50(s32 arg0){ + switch(arg0){ + case 0x5A: + return 0xD98; + case 0x5B: + return 0xD99; + case 0x5C: + return 0xD9b; + case 0x5d: + return 0xD9a; + case 0x5e: + return 0xD97; + } + return 0; +} + +void func_802CDBA8(ActorMarker *this, s32 arg1){ + Actor *actorPtr = marker_getActor(this); + ActorLocal_Jinjo *localPtr = &actorPtr->jinjo; + + if(actorPtr->state < 5){ + if(!func_8031FF1C(BKPROG_E_JINJO_TEXT)){ + func_80311480(func_802CDB50(actorPtr->marker->unk14_20), 4, 0, 0, 0, 0); + func_80320004(BKPROG_E_JINJO_TEXT, 1); + } + func_80328B8C(actorPtr, 6, 0.0f , -1); + if(func_803463D4(ITEM_12_JINJOS, 1 << (this->unk14_20 + 6) ) == 0x1f) + localPtr->unk4 = 1; + actor_loopAnimation(actorPtr); + this->collidable = 0; + } +} + +void func_802CDC9C(Actor *this, s16 arg1){ + f32 tmpf; + + tmpf = this->yaw; + tmpf -= time_getDelta()*arg1/45.0; + + if(tmpf >= 360.0f) + tmpf -= 360.0f; + else if (tmpf < 0.0f) + tmpf += 360.0f; + + this->yaw = tmpf; +} + + +void func_802CDD3C(Actor * this){ + ActorLocal_Jinjo *localPtr = &this->jinjo; + if(localPtr->unkC != 0){ + func_802F9D38(localPtr->unkC); + localPtr->unkC = 0; + } +} + +#ifdef NONMATCHING +void func_802CDD78(Actor * this){ + f32 sp7C[3]; + f32 sp70[3]; + f32 sp6C; + f32 sp68; //unused?? + s16 sp66; + s16 sp64; + s32 sp60; + // f32 sp5C; + ActorLocal_Jinjo *local; //= &this->jinjo; //sp34 + f32 sp58 = time_getDelta(); + int sp50; + //f32 sp4C; //unused + f32 sp40[3]; + //s32 sp3C; + //s32 sp38; + f32 *sp30; + f32 tmp_f0; + s32 i; + + local = &this->jinjo; + if(!this->initialized){ + this->initialized = 1; + local->unk0 = 1; + local->unk4 = 0; + local->unk8 = (this->position_y < func_80309B24(this->position)); + this->marker->unkC = func_802CDBA8; + func_803300D8(this->marker, func_802CDD3C); + if(func_803203FC(0xc1)){ + marker_despawn(this->marker); + } + }//L802CDE24 + sp30 = this->position; + func_8028E964(sp7C); + func_80257F18(sp30, sp7C, &sp6C); + sp64 = (this->yaw * 182.04444); + sp66 = sp64 - (s32)(sp6C*182.04444); + sp60 = func_8028AED4(sp30, 55.0f); + + switch(this->state){ + case 1: + if(randf() < 0.015){ + if(sp60){ + func_80328B8C(this, 3, 0.0f, -1); + }else{ + func_80328B8C(this, 2, 0.0f, -1); + } + actor_playAnimationOnce(this); + }//L802CDF24 + break; + + case 2: /* 46FA0 802CDF30 3C053F7D */ + case 3: + if(actor_animationIsAt(this, 0.99f)){ + func_80328B8C(this, 1, 0.0f, -1); + } + break; + + case 4: /* 46FD8 802CDF68 3C053F7D */ + if(actor_animationIsAt(this, 0.99f)){ + func_80328B8C(this, 1, 0.0f, -1); + }else{//L802CDF9C + tmp_f0 = this->yaw; + if(sp66 >= 0){ + tmp_f0 -= 80.0f * sp58; + } + else{//L802CDFBC + tmp_f0 += 80.0f * sp58; + }//L802CDFD0 + if(tmp_f0 >= 360.0f) + tmp_f0 -= 360.0f; + else if(tmp_f0 < 0.0f) + tmp_f0 += 360.0f; + + this->yaw = tmp_f0; + }//L802CE018 + break; + case 6:/* 47094 802CE024 02002025 */ + func_802CDC9C(this, sp66); + if(actor_animationIsAt(this, 0.0f) && --(local->unk0) == 0){ + func_80328B8C(this, 7, 0.0f, -1); + actor_playAnimationOnce(this); + if(local->unk4){ + sp40[0] = this->position_x; + sp40[1] = this->position_y; + sp40[2] = this->position_z; + sp40[1] += 50.0f; + jiggySpawn(10*level_get()-9, sp40); + }//L802CE0CC + func_8024BD08(0); + func_8032BB88(this, 0, 4000); + if(local->unk4){ + func_8025A6EC(COMUSIC_30_5TH_JINJO_COLLECTED, 28000); + }else{ + func_8025A6EC(COMUSIC_A_JINJO_COLLECTED, 28000); + } + }//L802CE114 + break; + + case 7: + case 8: + sp50 = this->state == 7; + if(!sp50 || 0.8 < animctrl_getAnimTimer(this->animctrl)){//L802CE158 + player_getVelocity(sp70); + sp70[0] *= sp58*6.0f; + sp70[1] *= sp58*6.0f; + sp70[2] *= sp58*6.0f; + sp70[0] += sp7C[0]; + sp70[1] += sp7C[1]; + sp70[2] += sp7C[2]; + sp70[0] -= this->position_x; + sp70[1] -= this->position_y; + sp70[2] -= this->position_z; + sp70[0] *= sp58*3.0f; + sp70[1] *= sp58*3.0f; + sp70[2] *= sp58*3.0f; + this->position_x += sp70[0]; + this->position_y += sp70[1]; + this->position_z += sp70[2]; + if(sp50 || animctrl_getAnimTimer(this->animctrl) < 0.3){ + for(i = 0; i < 4; i++){ + if(randf() < 0.2){ + func_8033E73C(this->marker, i + 5, func_80329904); + func_8033E3F0(8, this->marker->unk14_21); + } //L802CE2C4 + } + }//L802CE2D0 + } + + if(sp50){ + if(animctrl_getAnimTimer(this->animctrl) < 0.9) + func_802CDC9C(this, sp66); + + if(actor_animationIsAt(this, 0.1f)){ + local->unkC = func_802F9AA8(SFX_18_BIGBUTT_SLIDE); + func_802F9EC4(local->unkC, sp30, 500, 2000); + func_802F9F80(local->unkC, 0.0f, 0x50061c46, 0.0f); + func_802FA0B0(local->unkC, 0); + func_8025A6EC(COMUSIC_43_ENTER_LEVEL_GLITTER, 0x7FFF); + func_8025AABC(COMUSIC_43_ENTER_LEVEL_GLITTER); + func_8030E9C4(SFX_C7_SHWOOP, 0.8f, 0x7FFF, sp30, 300.0f, 2000.0f); + }//L802CE3C4 + + if(actor_animationIsAt(this, 0.434f)){ + func_8030E9C4(SFX_C7_SHWOOP, 0.9f, 0x7fff, sp30, 300.0f, 2000.0f); + }//L802CE408 + + if(actor_animationIsAt(this, 0.811f)){ + func_8030E9C4(SFX_C7_SHWOOP, 1.0f, 0x7fff, sp30, 300.0f, 2000.0f); + } + + }else{//L802CE450 + if(actor_animationIsAt(this,0.214f)){ + func_8030E9C4(SFX_C7_SHWOOP, 1.1f, 0x7fff, sp30, 300.0f, 2000.0f); + }//L802CE490 + + if(actor_animationIsAt(this,0.55f)){ + func_8030E9C4(SFX_53_BANJO_HUIII, 1.5f, 0x7fff, sp30, 300.0f, 2000.0f); + }//L802CE4D0 + + if(actor_animationIsAt(this,0.75f)){ + func_80326310(this); + if(local->unk4 == 0){ + func_8032BB88(this, -1, 4000); + func_8024BD08(1); + } + }//L802CE518 + + if(actor_animationIsAt(this,0.85f)){ + if(local->unk4){ + func_802F9D38(); + local->unk4 = 0; + } + func_8030E4E4(SFX_19_BANJO_LANDING_08); + func_8025A7DC(COMUSIC_43_ENTER_LEVEL_GLITTER); + }//L802CE558 + + if(local->unk4 && actor_animationIsAt(this,0.95f)){ + func_8032BB88(this, -1, 4000); + func_8024BD08(1); + } + }//L802CE598 + + if(sp50){ + if(actor_animationIsAt(this, 0.96f) || actor_animationIsAt(this, 0.99f)){ + func_80328B8C(this, 8, 0.0f, -1); + actor_playAnimationOnce(this); + } + } + break; + }//L802CE5F0 + if(this->state < 4 && !(((sp66 >= 0)? sp66: -sp66) <= 0x100)){ + func_80328B8C(this, 4, 0.0f, -1); + actor_playAnimationOnce(this); + }//L802CE630 + if(!func_803114B0()){ + switch(D_803671B0[this->state].index){ + case 0x31: + if(actor_animationIsAt(this, 0.6f)){ + if(local->unk8){ + func_8030E988(SFX_8_BANJO_LANDING_04, 1.8f, 18000, sp30, 120.0f, 1200.0f); + }else{ + FUNC_8030E8B4(SFX_8_BANJO_LANDING_04, 1.8f, 18000, sp30, 120, 1200); + } + } + break; + case 0x2D: //L802CE6F4 + if(actor_animationIsAt(this, 0.2f)){ + if(local->unk8){ + func_8030E988(SFX_17_JINJO_WHISTLE, 1.0f, 22000, sp30, 120.0f, 1200.0f); + }else{ + FUNC_8030E8B4(SFX_27_JINJO_HI, 1.0f, 22000, sp30, 120, 1200); + } + } + break; + case 0x2F: //L802CE760 + if(actor_animationIsAt(this, 0.2f)){ + if(local->unk8){ + func_8030E988(SFX_27_JINJO_HI, 1.0f, 22000, sp30, 120.0f, 1200.0f); + }else{ + FUNC_8030E8B4(SFX_17_JINJO_WHISTLE, 1.0f, 22000, sp30, 120, 1200); + } + } + break; + default: //L802CE7C8 + break; + } + }//L802CE7CC +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/ch/jinjo/func_802CDD78.s") +#endif \ No newline at end of file diff --git a/src/core2/ch/mole.c b/src/core2/ch/mole.c new file mode 100644 index 00000000..b1c79dc7 --- /dev/null +++ b/src/core2/ch/mole.c @@ -0,0 +1,453 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_802D9D60(Actor *this); +Actor *func_802D94B4(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_802D9830(ActorMarker *marker, enum asset_e arg1, s32 arg2); + +typedef struct{ + s16 unk0; + s16 unk2; + s8 unk4; + s8 unk5; +} struct_core2_52290; + +/* .data */ +ActorAnimationInfo D_80367D70[]= { + {0, 0.0f}, + {ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f}, + {ASSET_13A_ANIM_BOTTLES_ENTER, 4.5f}, + {ASSET_13B_ANIM_BOTTLES_IDLE, 7.0f}, + {ASSET_139_ANIM_BOTTLES_EXIT, 1.7f}, + {ASSET_13A_ANIM_BOTTLES_ENTER, 2000000000.0f}, +}; + +ActorInfo D_80367DA0= { + 0x1DF, ACTOR_37A_BOTTLES, ASSET_387_MODEL_BOTTLES, + 1, D_80367D70, + func_802D9D60, func_80326224, func_802D94B4, + 0, 0, 0.0f, 0 +}; + +struct_core2_52290 D_80367DC4[] = { + {0x0C23, 0x0C24, 0x0F, ABILITY_1_BEAK_BOMB}, + {0x0B47, 0x0B4B, 0x16, ABILITY_6_EGGS}, + {0x0B48, 0x0B4C, 0x17, ABILITY_2_BEAK_BUSTER}, + {0x0B49, 0x0B4A, 0x18, ABILITY_10_TALON_TROT}, + {0x0A1F, 0x0A23, 0x0C, ABILITY_D_SHOCK_JUMP}, + {0x0A20, 0x0A22, 0x0D, ABILITY_9_FLY}, + {0x0D35, 0x0D36, 0x01, ABILITY_12_WONDERWING}, + {0x0C88, 0x0C89, 0x10, ABILITY_E_WADING_BOOTS}, + {0x0A84, 0x0A85, 0x19, ABILITY_11_TURBO_TALON}, + {0x0F64, 0x0F65, 0x0E, ABILITY_13_1ST_NOTEDOOR} +}; + +/* .code */ +int func_802D9220(enum level_e level){ + switch (level){ + case LEVEL_1_MUMBOS_MOUNTAIN: + return ability_isUnlocked(ABILITY_6_EGGS) + && ability_isUnlocked(ABILITY_2_BEAK_BUSTER) + && ability_isUnlocked(ABILITY_10_TALON_TROT); + case LEVEL_2_TREASURE_TROVE_COVE: + return ability_isUnlocked(ABILITY_D_SHOCK_JUMP) + && ability_isUnlocked(ABILITY_9_FLY); + case LEVEL_3_CLANKERS_CAVERN: + return ability_isUnlocked(ABILITY_12_WONDERWING); + case LEVEL_4_BUBBLEGLOOP_SWAMP: + return ability_isUnlocked(ABILITY_E_WADING_BOOTS); + case LEVEL_5_FREEZEEZY_PEAK: + return ability_isUnlocked(ABILITY_1_BEAK_BOMB); + case LEVEL_7_GOBIS_VALLEY: + return ability_isUnlocked(ABILITY_11_TURBO_TALON); + default: + return FALSE; + } +} + +enum asset_e func_802D9304(void){ + s32 level_id = level_get(); + int learned_all_moves = func_802D9220(level_id); + switch(level_id){ + case LEVEL_1_MUMBOS_MOUNTAIN: + return learned_all_moves ? 0xb4e : 0xd38; + case LEVEL_2_TREASURE_TROVE_COVE: + return learned_all_moves ? 0xa27 : 0xd38; + case LEVEL_3_CLANKERS_CAVERN: + return learned_all_moves ? 0xd37 : 0xd38; + case LEVEL_4_BUBBLEGLOOP_SWAMP: + return learned_all_moves ? 0xc8a : 0xd38; + case LEVEL_5_FREEZEEZY_PEAK: + return learned_all_moves ? 0xc2a : 0xd38; + case LEVEL_7_GOBIS_VALLEY: + return learned_all_moves ? 0xc2a : 0xd38; + default: + return 0xd38; + + } +} + + +int func_802D93EC(void){ + return ability_isUnlocked(ABILITY_6_EGGS) + && ability_isUnlocked(ABILITY_2_BEAK_BUSTER) + && ability_isUnlocked(ABILITY_10_TALON_TROT) + && ability_isUnlocked(ABILITY_D_SHOCK_JUMP) + && ability_isUnlocked(ABILITY_9_FLY) + && ability_isUnlocked(ABILITY_12_WONDERWING) + && ability_isUnlocked(ABILITY_E_WADING_BOOTS) + && ability_isUnlocked(ABILITY_1_BEAK_BOMB) + && ability_isUnlocked(ABILITY_11_TURBO_TALON); +} + +Actor *func_802D94B4(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *actor = marker_getActor(marker); + + if(actor->state != 1 && actor->state != 5){ + func_8033A45C(3, 0); + func_8033A45C(4, 0); + actor = func_80325888(marker, gfx, mtx, vtx); + } + + return actor; +} + +void func_802D9530(Actor *this){ + Actor *other = func_80329980(this); + if(this->unk100 && other){ + if(this->unk100->unk14_20 == 0xB8) + func_80328B8C(other, 3, 0.0001f, 1); + } + func_80328B8C(this, 4, 0.0001f, 1); + actor_playAnimationOnce(this); + this->unk44_31 = func_8030D90C(); + sfxsource_setSfxId(this->unk44_31, SFX_3F9_UNKNOWN); + func_8030DD14(this->unk44_31, 2); + func_8030DBB4(this->unk44_31, 1.4f); + sfxsource_setSampleRate(this->unk44_31, 26000); + func_8028F918(0); +} + +void func_802D9600(Actor * this){ + animctrl_setSmoothTransition(this->animctrl, 0); + func_80328B8C(this, 1, 0.0001f, 1); + this->marker->propPtr->unk8_3 = 0; +} + +void func_802D9658(Actor *this){ + timed_setCameraToNode(0.0f, D_80367DC4[this->unkF4_8-9].unk4); +} + +void func_802D9698(ActorMarker *marker, enum asset_e arg1, s32 arg2){ + Actor *actor = marker_getActor(marker); + + if( arg1 == D_80367DC4[actor->unkF4_8-9].unk0 + && item_getCount(ITEM_14_HEALTH) < item_getCount(ITEM_15_HEALTH_TOTAL) + ){ + func_80311480(ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH, 7, 0, actor->marker, func_802D9698, func_802D9830); + }//L802D9738 + else if(arg1 == D_80367DC4[actor->unkF4_8-9].unk0 || arg1 == ASSET_D39_TEXT_BOTTLES_REFILL_HEALTH){ + func_80311480(func_802D93EC()? 0xa87 : func_802D9304(), 7, 0, actor->marker, func_802D9698, NULL); + } + else{//L802D97BC + if(actor->unk138_24){ + func_80347A14(1); + actor->unk138_24 = FALSE; + } + func_80324E88(0.0f); + if(actor->state == 5){ + func_8028F918(0); + func_802D9600(actor); + }//L802D9814 + else{ + func_802D9530(actor); + } + }//L802D9820 +} + +void func_802D9830(ActorMarker *marker, enum asset_e arg1, s32 arg2){ + Actor *actor = marker_getActor(marker); + switch(arg2){ + case 1: + timed_setCameraToNode(0.0f, 0x11); + levelSpecificFlags_set(0x1A, 1); + break; + case 2: + levelSpecificFlags_set(0x1A, 0); + func_802D9658(actor); + break; + case 3: + timed_setCameraToNode(0.0f, 0x29); + levelSpecificFlags_set(0x1A, 1); + break; + case 4: + levelSpecificFlags_set(0x1A, 0); + func_802D9658(actor); + break; + case 5: + func_803463D4(ITEM_D_EGGS, 50); + break; + case 6: + func_803463D4(ITEM_F_RED_FEATHER, 25); + break; + case 7: + func_803463D4(ITEM_10_GOLD_FEATHER, 5); + break; + case 8: + item_set(ITEM_14_HEALTH, item_getCount(ITEM_15_HEALTH_TOTAL)); + break; + case 0xff: + func_802D9658(actor); + break; + } +} + +int func_802D997C(Actor *this){ + s32 sp2C; + s32 sp28 = 0xe; + if(ability_isUnlocked(D_80367DC4[this->unkF4_8-9].unk5)){ + sp28 = 0xf; + sp2C = D_80367DC4[this->unkF4_8-9].unk2; + }//L802D99EC + else{ + func_80347A14(0); + this->unk138_24 = 1; + sp2C = D_80367DC4[this->unkF4_8-9].unk0; + ability_unlock(D_80367DC4[this->unkF4_8-9].unk5); + switch(D_80367DC4[this->unkF4_8-9].unk5){ + case ABILITY_9_FLY: + case ABILITY_D_SHOCK_JUMP: + func_8030E6A4(SFX_113_PAD_APPEARS, 0.9f, 32000); + break; + case ABILITY_13_1ST_NOTEDOOR: + func_802FAD64(ITEM_C_NOTE); + break; + } + }//L802D9A9C + func_80311480(sp2C, sp28, this->position, this->marker, func_802D9698, func_802D9830); + return TRUE; +} + +void func_802D9ADC(Actor *this){ + Actor *other = func_80329980(this); + if(this->unk100 && other && this->unk100->unk14_20 == 0xB8){ + func_80328B8C(other, 2, 0.0001f, 1); + } + this->marker->propPtr->unk8_3 = 1; + animctrl_setSmoothTransition(this->animctrl, TRUE); + func_80328B8C(this, 2, 0.0001f, 1); + actor_playAnimationOnce(this); + this->unk44_31 = func_8030D90C(); + sfxsource_setSfxId(this->unk44_31, SFX_3F9_UNKNOWN); + func_8030DD14(this->unk44_31, 2); + func_8030DBB4(this->unk44_31, 1.4f); + sfxsource_setSampleRate(this->unk44_31, 26000); + func_802D9658(this); + func_8028F94C(2, this->position); +} + +void func_802D9BD8(Actor *this){ + func_80328A84(this, 5); + func_802D9658(this); + func_8028F94C(2, this->position); + func_802D997C(this); +} + +void func_802D9C1C(Actor *this){ + func_80328B8C(this, 3, 0.0001f, 1); + actor_loopAnimation(this); +} + +void func_802D9C54(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + Actor *other = spawn_child_actor(ACTOR_12C_MOLEHILL, &actor); + f32 pad[1]; + + actor->unk100 = other->marker; + if(marker); +} + +void func_802D9C90(Actor *this){ + u8 tmp_a1 = this->unk44_31; + if(tmp_a1){ + func_8030DA44(tmp_a1); + } +} + +void func_802D9CBC(Actor *this){ + if(ability_isUnlocked(D_80367DC4[this->unkF4_8 - 9].unk5)){ + func_802D9BD8(this); + } + else{ + if(func_80329530(this, 150)){ + if(this->unk38_0 == 0) + func_8028F45C(9, this->position); + else + func_8028F490(this->unk1C); + }//L802D9D44 + func_802D9ADC(this); + } +} + +void func_802D9D60(Actor *this){ + s32 sp50[6]; + f32 sp4C; + f32 pad44[2]; + Actor *other; + f32 sp34[3]; + + if(this->unkF4_8 < 8 || this->unkF4_8 >= 0x13) + return; + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + func_803300D8(this->marker, func_802D9C90); + if(this->initialized){ + other = func_80326D68(this->position, ACTOR_12C_MOLEHILL, -1, &sp4C); + this->unk100 = (other) ? other->marker : NULL; + if(this->unk100){ + other = func_80329980(this); + if(other && this->unk100->unk14_20 == 0xB8){ + func_80328A84(other, 1); + } + } + } + }//L802D9E34 + + if(!this->initialized){ + other = func_80304C38(0x372, this); + if(other == NULL){ + this->unk38_0 = FALSE; + } + else{ + this->unk38_0 = TRUE; + nodeprop_getPosition(other, this->unk1C); + } + func_802C3C88(func_802D9C54, this->marker); + this->marker->propPtr->unk8_3 = FALSE; + this->marker->collidable = FALSE; + this->initialized = TRUE; + if(this->unkF4_8 == 0x12){ + other = func_80304C38(0x349, this); + if(other == NULL){ + this->velocity[0] = this->position[0]; + this->velocity[1] = this->position[1]; + this->velocity[2] = this->position[2]; + this->unk28 = 500.0f; + } + else{ //L802D9F08 + nodeprop_getPosition(other, this->velocity); + this->unk28 = 2*nodeprop_getRadius(other); + } + } + }//L802D9F34 + func_8024E55C(0, sp50);//get face buttons press counters + switch(this->state){ + case 1://L802D9F70 + this->yaw_moving = func_80329784(this); + func_80328FB0(this, 4.0f); + if(func_8028F20C() && func_8028F0D4() && !func_8028EC04()){ + if( this->unkF4_8 == 0x12 + && !ability_isUnlocked(D_80367DC4[this->unkF4_8-9].unk5) + && (func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT) + ){ + player_getPosition(sp34); + if(ml_vec3f_distance(sp34, this->velocity) < this->unk28){ + func_802D9CBC(this); + } + } + else{//L802DA054 + if( !func_8028ECAC() + && func_80329530(this, 0xFA) + && func_8028EFC8() + && sp50[BUTTON_Z] == 1 + ){ + func_802D9CBC(this); + } + } + } + break; + case 2://L802DA0A0 + this->marker->propPtr->unk8_3 = TRUE; + this->yaw_moving = func_80329784(this); + func_80328FB0(this, 4.0f); + if( 0.0 < animctrl_getAnimTimer(this->animctrl) + && animctrl_getAnimTimer(this->animctrl) < 0.16 + ){ + func_8030E2C4(this->unk44_31); + }//L802DA128 + if(actor_animationIsAt(this, 0.9999f)){ + func_802D9C1C(this); + func_8030DA44(this->unk44_31); + this->unk44_31 = 0; + } + else if(actor_animationIsAt(this, 0.14f)){//L802DA154 + FUNC_8030E8B4(SFX_C6_SHAKING_MOUTH, 1.2f, 24000, this->position, 1250, 2500); + } + else if(actor_animationIsAt(this, 0.4f)){//L802DA188 + FUNC_8030E8B4(SFX_2C_PULLING_NOISE, 1.2f, 24000, this->position, 1250, 2500); + } + else if(actor_animationIsAt(this, 0.75f)){//L802DA1BC + FUNC_8030E8B4(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 1250, 2500); + } + else if(actor_animationIsAt(this, 0.35f)){//L802DA1EC + func_802D997C(this); + } + break; + case 3://L802DA210 + this->yaw_moving = func_80329784(this); + func_80328FB0(this, 4.0f); + if( ( actor_animationIsAt(this, 0.37f) + || actor_animationIsAt(this, 0.66f) + || actor_animationIsAt(this, 0.85f) + ) + && randf() < 0.2 + ){ + animctrl_setDirection(this->animctrl, 1 ^ animctrl_isPlayedForwards(this->animctrl)); + } + else if( + actor_animationIsAt(this, 0.25f) + || actor_animationIsAt(this, 0.28f) + || actor_animationIsAt(this, 0.31f) + ){//L802DA2B4 + func_8030E878(SFX_6F_BANJO_HEADSCRATCH, randf2(1.4f, 1.55f), 16000, this->position, 1250.0f, 2500.0f); + } + else if( + actor_animationIsAt(this, 0.45f) + || actor_animationIsAt(this, 0.48f) + || actor_animationIsAt(this, 0.51f) + || actor_animationIsAt(this, 0.7f) + || actor_animationIsAt(this, 0.73f) + || actor_animationIsAt(this, 0.76f) + ){//L802DA33C + func_8030E878(SFX_6F_BANJO_HEADSCRATCH, randf2(1.35f, 1.5f), 6000, this->position, 1250.0f, 2500.0f); + } + break; + case 4://L802DA400 + if( 0.35 < animctrl_getAnimTimer(this->animctrl) + && animctrl_getAnimTimer(this->animctrl) < 0.9 + ){ + func_8030E2C4(this->unk44_31); + } + else if(actor_animationIsAt(this, 0.9999f)){//L802DA45C + func_802D9600(this); + func_8030DA44(this->unk44_31); + this->unk44_31 = 0; + } + break; + }//L802DA488 +} + +int func_802DA498(void){ + return ability_isUnlocked(ABILITY_F_DIVE) + && ability_isUnlocked(ABILITY_4_BEAR_PUNCH) + && ability_isUnlocked(ABILITY_C_ROLL) + && ability_isUnlocked(ABILITY_B_RATATAT_RAP) + && ability_isUnlocked(ABILITY_0_BARGE) + && ability_isUnlocked(ABILITY_A_HOLD_A_JUMP_HIGHER) + && ability_isUnlocked(ABILITY_7_FLAP) + && ability_isUnlocked(ABILITY_8_FLIP) + && ability_isUnlocked(ABILITY_5_CLIMB) + ; +} diff --git a/src/core2/ch/molehill.c b/src/core2/ch/molehill.c new file mode 100644 index 00000000..d1ea6607 --- /dev/null +++ b/src/core2/ch/molehill.c @@ -0,0 +1,113 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + u8 unk0; + u8 pad1[3]; + f32 unk4[3]; + f32 unk10[3]; + f32 unk1C[3]; +}ActorLocal_MoleHill; + +Actor *func_802DA560(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_802DA740(Actor *this); + +/*.data */ +ActorAnimationInfo D_80367E00[] = { + {0x000, 0.0f}, + {0x13D, 2000000000.0f}, + {0x13D, 4.5f}, + {0x13C, 1.7f} +}; + +ActorInfo D_80367E20= { + 0xB8, ACTOR_12C_MOLEHILL, ASSET_388_MODEL_MOLEHILL, + 0, D_80367E00, + func_802DA740, func_80326224, func_802DA560, + 0, 0, 0.0f, 0 +}; + +struct31s D_80367E44 = { + {0.05f, 0.1f}, + {0.0f, 0.0f}, + {0.0f, 0.01f}, + {4.0f, 4.0f}, + 0.0f, + 0.3f +}; + +/* .code */ +Actor *func_802DA560(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *actor = marker_getActor(marker); + ActorLocal_MoleHill * local = (ActorLocal_MoleHill *) &actor->local; + if(actor->unk16C_4){ + actor = func_80325888(marker, gfx, mtx, vtx); + func_8034A174(actor->marker->unk44, 5, actor->velocity); + func_8034A174(actor->marker->unk44, 6, actor->unk1C); + func_8034A174(actor->marker->unk44, 7, local->unk4); + func_8034A174(actor->marker->unk44, 8, local->unk10); + func_8034A174(actor->marker->unk44, 9, local->unk1C); + local->unk0 = 1; + } + return actor; +} + +void func_802DA634(ParticleEmitter *pCtrl, f32 arg1[3], s32 cnt){ + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -600.0f, 0.0f, 0.0f, -600.0f, 0.0f); + particleEmitter_setModel(pCtrl, 0x344); + particleEmitter_setPosition(pCtrl, arg1); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -150.0f, 150.0f, -150.0f, 150.0f, 360.0f, 150.0f); + func_802EFB98(pCtrl, &D_80367E44); + func_802EF9F8(pCtrl, 0.01f); + func_802EFA18(pCtrl, 3); + particleEmitter_emitN(pCtrl, cnt); +} + +void func_802DA740(Actor *this){ + ActorLocal_MoleHill * local = (ActorLocal_MoleHill *) &this->local; + + this->marker->propPtr->unk8_3 = TRUE; + this->marker->collidable = FALSE; + if(!this->unk16C_4){ + local->unk0 = 0; + this->unk16C_4 = 1; + } + switch(this->state){ + case 1: + break; + case 2: //L802DA7C4 + if(actor_animationIsAt(this, 0.9999f)){ + func_80328B8C(this, 1, 0.0001f, 1); + } + else{ + if(local->unk0 && actor_animationIsAt(this, 0.05f)){ + func_802DA634(partEmitList_pushNew(6), this->velocity, 6); + } + } + break; + case 3: //L802DA838 + if(actor_animationIsAt(this, 0.9999f)){ + func_80328B8C(this, 1, 0.0001f, 1); + } + else if(local->unk0){ + if(actor_animationIsAt(this, 0.3f)){ + func_802DA634(partEmitList_pushNew(6), this->velocity, 6); + } + else if(actor_animationIsAt(this, 0.4f)){ + func_802DA634(partEmitList_pushNew(4), this->unk1C, 4); + } + else if(actor_animationIsAt(this, 0.45f)){ + func_802DA634(partEmitList_pushNew(4), local->unk4, 4); + } + else if(actor_animationIsAt(this, 0.5f)){ + func_802DA634(partEmitList_pushNew(4), local->unk10, 4); + } + else if(actor_animationIsAt(this, 0.55f)){ + func_802DA634(partEmitList_pushNew(4), local->unk1C, 4); + } + } + break; + }//L802DA984 +} diff --git a/src/core2/ch/musicnote.c b/src/core2/ch/musicnote.c new file mode 100644 index 00000000..4632e9ad --- /dev/null +++ b/src/core2/ch/musicnote.c @@ -0,0 +1,17 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_802C9C30(Actor* this); + +/* .data */ +ActorInfo D_80366C50 = { + MARKER_5F_MUSIC_NOTE, ACTOR_51_MUSIC_NOTE, ASSET_6D6_MODEL_MUSIC_NOTE, 0, NULL, + func_802C9C30, func_80326224, func_80325934, + 0, 0, 0.6f, 0 +}; + +/* .code */ +void func_802C9C30(Actor* this){ + this->scale = 0.42857143f; +} diff --git a/src/core2/ch/soundsource.c b/src/core2/ch/soundsource.c new file mode 100644 index 00000000..4eba7205 --- /dev/null +++ b/src/core2/ch/soundsource.c @@ -0,0 +1,124 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_802D07C8(Actor *this); + +typedef struct{ + s32 unk0; //enum sfx_e + s16 unk4; + s16 unk6; + s32 unk8; + f32 unkC; + f32 unk10; +}struct49570s; + +typedef struct{ + u8 unk0; +}ActorLocal_Core2_49570; + +/* .data */ +struct49570s D_80367340[] = { + {0x03EC, 400, 3200, -1, -1.0f, -1.0f}, + {SFX_128_FIRE_CRACKING, 400, 2600, -1, -1.0f, -1.0f}, + {SFX_12B_BOILING_AND_BUBBLING, 100, 1200, 14000, -1.0f, 2.5f}, + {-1, 0, 0, 0, 0.0f, 0.0f}, +}; + +ActorInfo D_80367390 = {0x1A8, ACTOR_28B_SOUND_SOURCE, 0, + 0, NULL, + func_802D07C8, NULL, func_80325340, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_802D0500(Actor *this){ + ActorLocal_Core2_49570 *local = (ActorLocal_Core2_49570 *)this->local; + if(D_80367340[(s32)this->yaw].unk8 != -1){ + if(this->unk1C[0] == this->unk1C[1]) + sfxsource_setSampleRate(local->unk0, D_80367340[(s32)this->yaw].unk8); + else{ + sfxsource_setSampleRate(local->unk0, (s32)((D_80367340[(s32)this->yaw].unk8/this->unk1C[1])*this->unk1C[0])); + + } + } +} + +void func_802D05A0(Actor *this, s32 next_state){ + ActorLocal_Core2_49570 *local = (ActorLocal_Core2_49570 *)this->local; + if(this->state == 2 && local->unk0){ + func_8030DA44(local->unk0); + local->unk0 = 0; + } + if(next_state == 2){ + this->unk1C[0] = 0.0f; + this->unk1C[1] = 0.0f; + if(-1.0f != D_80367340[(s32)this->yaw].unk10){ + this->unk1C[1] = D_80367340[(s32)this->yaw].unk10; + } + local->unk0 = func_8030D90C(); + sfxsource_setSfxId(local->unk0, D_80367340[(s32)this->yaw].unk0); + func_8030DD14(local->unk0, 3); + func_8030DFF0(local->unk0, 1); + func_8030DF68(local->unk0, this->position); + func_8030DEB4(local->unk0, D_80367340[(s32)this->yaw].unk4*this->scale, D_80367340[(s32)this->yaw].unk6*this->scale); + func_8030DFB4(local->unk0, 1); + func_802D0500(this); + if(-1.0f != D_80367340[(s32)this->yaw].unkC) + func_8030DBB4(local->unk0, D_80367340[(s32)this->yaw].unkC); + func_8030E2C4(local->unk0); + }//L802D0780 + this->state = next_state; +} + +void func_802D07A8(Actor *this){ + func_802D05A0(this, 0); +} + +void func_802D07C8(Actor *this){ + f32 sp2C[3]; + f32 sp28; + if(!this->unk16C_4){ + this->unk16C_4 = 1; + this->marker->unk30 = func_802D07A8; + func_802D05A0(this, 1); + } + player_getPosition(sp2C); + sp28 = ml_vec3f_distance(sp2C, this->position); + if( this->state == 1){ + if(sp28 < D_80367340[(s32)this->yaw].unk6*this->scale){ + func_802D05A0(this, 2); + } + }//L802D08A0 + if(this->state == 2){ + if((D_80367340[(s32)this->yaw].unk6 + 100)*this->scale < sp28){ + func_802D05A0(this, 1); + } + if(this->unk1C[0] != this->unk1C[1]){ + this->unk1C[0] += time_getDelta(); + if(this->unk1C[1] < this->unk1C[0]){ + this->unk1C[0] = this->unk1C[1]; + } + func_802D0500(this); + } + }//L802D095C +} + +void func_802D096C(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ + f32 sp1C[3]; + + sp1C[0] = reinterpret_cast(f32, arg0); + sp1C[1] = reinterpret_cast(f32, arg1); + sp1C[2] = reinterpret_cast(f32, arg2); + func_8032813C(0x28B, sp1C, arg3); + +} + +void func_802D09B8(Actor *this, s32 arg1){ + func_802C3F04(func_802D096C, + reinterpret_cast(s32, this->position[0]), + reinterpret_cast(s32, this->position[1]), + reinterpret_cast(s32, this->position[2]), + arg1 + ); +} diff --git a/src/core2/ch/trainers.c b/src/core2/ch/trainers.c new file mode 100644 index 00000000..0ec19736 --- /dev/null +++ b/src/core2/ch/trainers.c @@ -0,0 +1,123 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *chtrainers_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void chtrainers_update(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_80366EA0[]; +extern ActorInfo D_80366EC0 = { + MARKER_38_TURBO_TALON_TRAINERS, ACTOR_2C_TURBO_TALON_TRAINERS, ASSET_367_MODEL_TURBO_TALON_TRAINERS, + 0x0, D_80366EA0, + chtrainers_update, func_80326224, chtrainers_draw, + 0, 0, 0.0f, 0 +}; + +/* .rodata */ +extern f64 D_80376470; +extern f64 D_80376478; + +/* .code */ +Actor *chtrainers_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + if( !this->unk10_12 ) + return this; + return func_80325888(marker, gfx, mtx, vtx); +} + + +void _chtrainers_802CA378(Actor *this, bool arg1){ + f32 sp24[3]; + if(ability_isUnlocked(ABILITY_11_TURBO_TALON)) + actor_setOpacity(this, 0xff); + else + actor_setOpacity(this, 0x87); + + if( actor_animationIsAt(this, 0.38f) + || actor_animationIsAt(this, 0.88f) + ){ + if(arg1) + FUNC_8030E624(SFX_8_BANJO_LANDING_04, 1.6f, 7000); + else + FUNC_8030E8B4(SFX_8_BANJO_LANDING_04, 1.6f, 7000, this->position, 600, 1500); + } + + func_802589E4(sp24, this->velocity[1], 40.0f); + sp24[1] = 0.0f; + ml_vec3f_add(this->position, this->unk1C, sp24); + this->velocity[1] += D_80376470; + this->yaw = mlNormalizeAngle(this->velocity[1] + D_80376478); +} + +void chtrainers_update(Actor *this){ + s32 sp2C = levelSpecificFlags_get(0x1a); + if(sp2C && this->unkF4_8 != 1){ + return; + } + + if(!this->initialized){ + this->initialized = TRUE; + ml_vec3f_copy(this->unk1C, this->position); + this->velocity[0] = this->yaw; + this->velocity[1] = 0.0f; + this->unk10_12 = !func_803203FC(0x1f) && !func_803203FC(0x1); + func_80328A84(this, 0); + } + + if(!func_803203FC(0xF) && ability_isUnlocked(ABILITY_11_TURBO_TALON)){ + func_803204E4(0xF, TRUE); + } + + switch(this->state){ + case 0://L802CA5A8 + if(func_803296D8(this, 2000) || sp2C){ + if( func_80329530(this, 0xfa) + && !func_803203FC(0xf) + && player_getTransformation() == TRANSFORM_1_BANJO + ){ + if(func_80311480(0xda4, 0, NULL, NULL, NULL, NULL)){ + func_803204E4(0xf, TRUE); + } + }//L802CA620 + _chtrainers_802CA378(this, sp2C); + } + break; + + case 1://L802CA630 + this->velocity[2] -= time_getDelta(); + if(this->velocity[2] <= 0.0f){ + func_80328A84(this, 2); + } + break; + + case 2://L802CA670 + if(func_8028E80C(3) == 0.0f){ + this->velocity[2] = 1.0f; + func_80328A84(this, 3); + } + break; + + case 3://L802CA6AC + this->velocity[2] -= time_getDelta(); + if(this->velocity[2] <= 0.0f){ + this->unk10_12 = 1; + func_80328A84(this, 0); + } + break; + }//L802CA6F8 +} + +bool chtrainers_802CA708(Actor *this){ + return this->unk10_12 && ability_isUnlocked(ABILITY_11_TURBO_TALON); +} + +f32 chtrainers_802CA748(Actor *this){ + return this->velocity[0]; +} + +void chtrainers_802CA750(Actor *this){ + func_80328A84(this, 1); + this->velocity[2] = 1.0f; + this->unk10_12 = 0; +} diff --git a/src/core2/ch/wadingboots.c b/src/core2/ch/wadingboots.c new file mode 100644 index 00000000..cec2da06 --- /dev/null +++ b/src/core2/ch/wadingboots.c @@ -0,0 +1,105 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *chwadingboots_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void chwadingboots_update(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_80367A00[]; +extern ActorInfo D_80367A20 = { + MARKER_11_WADING_BOOTS, ACTOR_65_WADING_BOOTS, ASSET_366_MODEL_WADING_BOOTS, + 0x0, D_80367A00, + chwadingboots_update, func_80326224, chwadingboots_draw, + 0, 0, 0.0f, 0 +}; + +/* .code */ +Actor *chwadingboots_draw(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this = marker_getActor(marker); + + if(!this->unk10_12) return this; + + return func_80325888(marker, gfx, mtx, vtx); +} + +void chwadingboots_update(Actor *this){ + s32 sp2C = levelSpecificFlags_get(0x1a); + if(sp2C && this->unkF4_8 != 1){ + return; + } + + if(!this->initialized){ + this->initialized = TRUE; + this->velocity[0] = this->yaw; + this->unk10_12 = !func_803203FC(0x1f) && !func_803203FC(0x1); + func_80328A84(this, 0); + } + + if(!func_803203FC(0x10) && ability_isUnlocked(ABILITY_E_WADING_BOOTS)){ + func_803204E4(0x10, TRUE); + } + + switch(this->state){ + case 0://L802D6C60 + if(ability_isUnlocked(ABILITY_E_WADING_BOOTS)) + actor_setOpacity(this, 0xff); + else + actor_setOpacity(this, 0x87); + + if(actor_animationIsAt(this, 0.25f)){ + if(sp2C){ + FUNC_8030E624(SFX_3F2_UNKNOWN, 1.4f, 23000); + } + else{ + FUNC_8030E8B4(SFX_3F2_UNKNOWN, 1.4f, 23000, this->position, 600, 1500); + } + } + + if(func_803203FC(0x10)) break; + if(!func_80329530(this, 0xfa)) break; + if(player_getTransformation() != TRANSFORM_1_BANJO) break; + + if(func_80311480(0xda5, 0, NULL, NULL, NULL, NULL)){ + func_803204E4(0x10, TRUE); + } + + break; + + case 1://L802D6D34 + this->velocity[1] -= time_getDelta(); + if(this->velocity[1] <= 0.0f){ + func_80328A84(this, 2); + } + break; + + case 2://L802D6D74 + if(func_8028E80C(2) == 0.0f){ + this->velocity[1] = 1.5f; + func_80328A84(this, 3); + } + break; + + case 3://L802D6DB0 + this->velocity[1] -= time_getDelta(); + if(this->velocity[1] <= 0.0f){ + this->unk10_12 = 1; + func_80328A84(this, 0); + } + break; + }//L802D6DFC +} + +bool chwadingboots_802D6E0C(Actor *this){ + return this->unk10_12 && ability_isUnlocked(ABILITY_E_WADING_BOOTS); +} + +f32 chwadingboots_802D6E4C(Actor *this){ + return this->velocity[0]; +} + +void chwadingboots_802D6E54(Actor *this){ + func_80328A84(this, 1); + this->velocity[1] = 1.5f; + this->unk10_12 = 0; +} diff --git a/src/core2/ch/whipcrack.c b/src/core2/ch/whipcrack.c new file mode 100644 index 00000000..7427712b --- /dev/null +++ b/src/core2/ch/whipcrack.c @@ -0,0 +1,129 @@ +#include +#include "functions.h" +#include "variables.h" + +void chwhipcrack_update(Actor *this); + +/* .data */ +ActorInfo D_80373100 = { + 0x1c5, ACTOR_30F_WHIPCRACK, ASSET_4FD_MODEL_WHIPCRACK, + 0, NULL, + chwhipcrack_update, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +s32 D_80373124[3] = {0xA0, 0x6B, 0x23}; + +/* .code */ +void __chwhipcrack_spawnPieces(Actor *this, enum asset_e model_id, s32 cnt){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + + particleEmitter_setParticleAccelerationRange(pCtrl, + 0.0f, -1000.0f, 0.0f, + 0.0f, -1000.0f, 0.0f + ); + func_802EF9F8(pCtrl, 0.7f); + func_802EFA18(pCtrl, 3); + func_802EFA20(pCtrl, 0.5f, 1.0f); + func_802EF9EC(pCtrl, 0x1f, 10000); + particleEmitter_setModel(pCtrl, model_id); + particleEmitter_setParticleSpawnPositionRange(pCtrl, + -120.0f, 50.0f, -120.0f, + 120.0f, 300.0f, 120.0f + ); + particleEmitter_setPosition(pCtrl, this->position); + func_802EFB70(pCtrl, 0.5f, 1.0f); + func_802EFE24(pCtrl, + -500.0f, -500.0f, -500.0f, + 500.0f, 500.0f, 500.0f + ); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 4.0f, 4.0f); + particleEmitter_setParticleVelocityRange(pCtrl, + -300.0f, 250.0f, -300.0f, + 300.0f, 400.0f, 300.0f + ); + particleEmitter_emitN(pCtrl, cnt); +} + +void __chwhipcrack_spawnSmoke(Actor *this, s32 cnt){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + particleEmitter_setSprite(pCtrl, ASSET_70E_SPRITE_SMOKE_2); + func_802EFA5C(pCtrl, 0.05f, 0.1f); + particleEmitter_setStartingFrameRange(pCtrl, 0, 7); + particleEmitter_setPosition(pCtrl, this->position); + func_802EFB70(pCtrl, 3.0f, 3.5f); + func_802EFB84(pCtrl, 4.5f, 5.5f); + particleEmitter_setParticleSpawnPositionRange(pCtrl, + -50.0f, 50.0f, -50.0f, + 50.0f, 200.0f, 50.0f + ); + particleEmitter_setParticleVelocityRange(pCtrl, + -30.0f, 150.0f, -30.0f, + 30.0f, 300.0f, 30.0f + ); + func_802EFFA8(pCtrl, D_80373124); + func_802EFEC0(pCtrl, 3.0f, 4.0f); + particleEmitter_emitN(pCtrl, cnt); +} + +void __chwhipcrack_setState(Actor *this, s32 next_state){ + if(next_state == 1) + func_80335924(this->unk148, ASSET_22A_ANIM_WHIPCRACK_IDLE, 0.5f, 1.0f); + + if(next_state == 2) + func_80335924(this->unk148, ASSET_229_ANIM_WHIPCRACK_ATTACK, 0.5f, 1.0f); + + if(next_state == 3){ + __chwhipcrack_spawnPieces(this, ASSET_4FE_MODEL_WHIPCRACK_PART_1, 4); + __chwhipcrack_spawnPieces(this, ASSET_4FF_MODEL_WHIPCRACK_PART_2, 4); + __chwhipcrack_spawnPieces(this, ASSET_500_MODEL_WHIPCRACK_PART_3, 4); + __chwhipcrack_spawnSmoke(this, 6); + FUNC_8030E8B4(SFX_2F_ORANGE_SPLAT, 0.8f, 32200, this->position, 500, 2500); + marker_despawn(this->marker); + } + + this->state = next_state; +} + +void __chwhipcrack_die(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + __chwhipcrack_setState(this, 3); +} + +void chwhipcrack_update(Actor *this){ + f32 plyr_pos[3]; + f32 plyr_dist; + f32 sp44; + f32 sp40; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + this->roll = this->yaw; + this->yaw = 0.0f; + marker_setCollisionScripts(this->marker, NULL, NULL, __chwhipcrack_die); + __chwhipcrack_setState(this, 1); + } + player_getPosition(plyr_pos); + plyr_dist = ml_vec3f_distance(plyr_pos, this->position); + if(this->state == 1){ + if(plyr_dist < 700.0f){ + __chwhipcrack_setState(this, 2); + } + } + + if(this->state == 2){ + func_8033568C(this->unk148, &sp44, &sp40); + if((sp44 < 0.13) && (0.13 <= sp40)){ + func_8030E878(SFX_69_WHIPCRACK_CREAKING, randf2(1.05f, 1.1f), 15000, this->position, 500.0f, 1000.0f); + } + + if((sp44 < 0.8) && (0.8 <= sp40)){ + func_8030E878(SFX_2_CLAW_SWIPE, randf2(0.9f, 1.1f), randi2(28000, 32000), this->position, 500.0f, 1000.0f); + } + + if(800.0f < plyr_dist){ + __chwhipcrack_setState(this, 1); + } + } +} diff --git a/src/core2/code_10CD0.c b/src/core2/code_10CD0.c new file mode 100644 index 00000000..733b6bf1 --- /dev/null +++ b/src/core2/code_10CD0.c @@ -0,0 +1,36 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +u8 D_8037C530; + +/* .code */ +void func_80297C60(s32 arg0){ + D_8037C530 = arg0; +} + +s32 func_80297C6C(void){ + return D_8037C530; +} + +void func_80297C78(void){ + D_8037C530 = 0; + func_80297C60(1); + func_802917C4(4); +} + +void func_80297CA8(void){ + func_80297CCC(0.6f); +} + +void func_80297CCC(f32 arg0){ + func_802917E4(4, arg0); + func_80297C60(3); +} + +void func_80297CF8(void){ + if(func_802916CC(4)){ + func_80297C60(1); + } +} diff --git a/src/core2/code_10E0.c b/src/core2/code_10E0.c new file mode 100644 index 00000000..f9989800 --- /dev/null +++ b/src/core2/code_10E0.c @@ -0,0 +1,132 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + s32 unk0; + s16 unk4; + u8 unk6; + u8 pad7[1]; +}struct10E0s; + +/* .bss */ +struct10E0s D_80379E20[340]; + +/* .code */ +void func_80288070(void){ + int i; + + for(i = 0; i<340; i++){ + D_80379E20[i].unk6 = 0; + D_80379E20[i].unk0 = 0; + D_80379E20[i].unk4 = 0; + } +} + +void func_802880C0(void){ + int i; + + for(i = 0; i<340; i++){ + if(D_80379E20[i].unk6){ + if(D_80379E20[i].unk0){ + func_8033A6F0(D_80379E20[i].unk0); + } + } + } +} + +void func_80288120(void){ + int i; + + for(i = 0; i<340; i++){ + if(D_80379E20[i].unk6 == 1 && D_80379E20[i].unk0){ + if(D_80379E20[i].unk4 < 0x3b){ + func_8033A6F0(D_80379E20[i].unk0); + D_80379E20[i].unk0 = 0; + if(func_80254BC4(1)){ + break; + } + } + } + } +} + +void func_802881AC(void){ + int i; + + for(i = 0; i<340; i++){ + if(D_80379E20[i].unk6){ + func_803203FC(0); + D_80379E20[i].unk4 = 0; + func_8033A6F0(D_80379E20[i].unk0); + D_80379E20[i].unk0 = 0; + } + } +} + +void func_80288210(void){ + int i; + + for(i = 0; i<340; i++){ + if(D_80379E20[i].unk6 == 1 && D_80379E20[i].unk0){ + if(--D_80379E20[i].unk4 <= 0){ + func_8033A6F0(D_80379E20[i].unk0); + D_80379E20[i].unk0 = 0; + } + } + } +} + +s16 func_80288298(void){ + int i; + + for(i = 0; i<340; i++){ + if(!D_80379E20[i].unk6){ + return i; + } + } + return -1; +} + +s16 func_80288330(void){ + int indx = func_80288298(); + D_80379E20[indx].unk6 = 1; + D_80379E20[indx].unk4 = 0; + D_80379E20[indx].unk0 = 0; + return indx; +} + +int func_80288374(s16 arg0){ + return (D_80379E20[arg0].unk0) ? 1 : 0; +} + +void func_802883AC(s16 arg0){ + if(D_80379E20[arg0].unk0){ + func_8033A6F0(D_80379E20[arg0].unk0); + } + D_80379E20[arg0].unk6 = 0; + D_80379E20[arg0].unk0 = 0; + D_80379E20[arg0].unk4 = 0; + +} + +int func_80288400(s16 arg0, s32 *arg1){ + D_80379E20[arg0].unk4 = 0x3C; + if(D_80379E20[arg0].unk0){ + *arg1 = D_80379E20[arg0].unk0; + return FALSE; + }else{ + D_80379E20[arg0].unk0 = func_8033A710(); + *arg1 = D_80379E20[arg0].unk0; + return TRUE; + } +} + +void func_80288470(void){ + int i; + for(i = 0; i < 340; i++){ + if(D_80379E20[i].unk6 == 1 && D_80379E20[i].unk0){ + D_80379E20[i].unk0 = func_8033A9E4(D_80379E20[i].unk0); + } + } +} diff --git a/src/core2/code_11040.c b/src/core2/code_11040.c new file mode 100644 index 00000000..827ab117 --- /dev/null +++ b/src/core2/code_11040.c @@ -0,0 +1,58 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +f32 D_8037C550; +f32 D_8037C554; +u8 D_8037C558; + +/* .code */ +void func_80297FD0(s32 arg0){ + D_8037C558 = arg0; +} + +void func_80297FDC(void){ + f32 diff = D_8037C554 - D_8037C550; + if(mlAbsF(diff) < 0.001){ + D_8037C550 = D_8037C554; + } + else{ + D_8037C550 += mlClamp_f(diff, -0.12f, 0.12f); + } +} + +void func_80298068(void){ + f32 f2 = yaw_getIdeal() - yaw_get(); + if(180.0f < f2){ + f2 -= 360.0f; + } + else if(f2 < -180.0f){ + f2 += 360.0f; + } + D_8037C554 = ml_map_f(f2, -40.0f, 40.0f, 1.0f, -1.0f); + func_80297FDC(); +} + +void func_80298114(void){} + +void func_8029811C(void){ + D_8037C554 = D_8037C550 = 0.0f; + D_8037C558 = 0; + func_80297FD0(1); + func_80297FD0(2); +} + +void func_80298168(void){ + if(D_8037C558 != 1 && D_8037C558 == 2){ + func_80298068(); + } +} + +void func_802981A4(void){ + if(D_8037C558 != 1 && D_8037C558 == 2){ + func_80298114(); + } +} + + diff --git a/src/core2/code_11460.c b/src/core2/code_11460.c new file mode 100644 index 00000000..f945cbf8 --- /dev/null +++ b/src/core2/code_11460.c @@ -0,0 +1,65 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +f32 player_position[3]; +f32 D_8037C5B0[3]; +f32 D_8037C5C0[3]; + +/* .code */ +void func_802983F0(void){ + ml_vec3f_clear(D_8037C5C0); + ml_vec3f_clear(player_position); + ml_vec3f_clear(D_8037C5B0); +} + +void func_8029842C(void){ + ml_vec3f_copy(D_8037C5B0, player_position); + ml_vec3f_clear(D_8037C5C0); +} + +void func_80298464(f32 arg0[3]){ + ml_vec3f_copy(player_position, arg0); + ml_vec3f_copy(D_8037C5B0, arg0); +} + +void player_setPosition(f32 arg0[3]){ + ml_vec3f_copy(player_position, arg0); +} + +void player_setYPosition(f32 arg0){ + player_position[1] = arg0; +} + +void _player_getPosition(f32 arg0[3]){ + ml_vec3f_copy(arg0, player_position); +} + +f32 player_getYPosition(void){ + return player_position[1]; +} + +void func_80298504(f32 arg0[3]){ + ml_vec3f_copy(arg0, D_8037C5B0); +} + +void func_80298528(f32 arg0){ + player_position[1] += arg0; +} + +void func_80298540(f32 arg0[3]){ + ml_vec3f_copy(arg0, D_8037C5C0); +} + +void func_80298564(f32 arg0[3]){ + ml_vec3f_copy(D_8037C5C0, arg0); +} + +void func_8029858C(void){ + player_position[0] += D_8037C5C0[0]; + player_position[1] += D_8037C5C0[1]; + player_position[2] += D_8037C5C0[2]; + ml_vec3f_clear(D_8037C5C0); + +} diff --git a/src/core2/code_11660.c b/src/core2/code_11660.c new file mode 100644 index 00000000..a753cde6 --- /dev/null +++ b/src/core2/code_11660.c @@ -0,0 +1,87 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +void *D_8037C5D0; + +/* .code */ +s32 func_802985F0(void){ + switch(_player_getTransformation()) + { + case TRANSFORM_2_TERMITE: //80298624 + return ASSET_34F_MODEL_BANJO_TERMITE; + case TRANSFORM_3_PUMPKIN: //8029862C + return ASSET_36F_MODEL_BANJO_PUMPKIN; + case TRANSFORM_5_CROC: //80298634 + return ASSET_374_MODEL_BANJO_CROC; + case TRANSFORM_4_WALRUS: //8029863C + return ASSET_359_MODEL_BANJO_WALRUS; + case TRANSFORM_6_BEE: //80298644 + return ASSET_362_MODEL_BANJO_BEE; + case TRANSFORM_7_WISHWASHY: //8029864C + return ASSET_356_MODEL_BANJO_WISHYWASHY; + case TRANSFORM_1_BANJO: //80298654 + default: + { + switch (map_get()) + { + case MAP_20_CS_END_NOT_100: + case MAP_7B_CS_INTRO_GL_DINGPOT_1: + case MAP_7C_CS_INTRO_BANJOS_HOUSE_1: + case MAP_7D_CS_SPIRAL_MOUNTAIN_1: + case MAP_7E_CS_SPIRAL_MOUNTAIN_2: + case MAP_81_CS_INTRO_GL_DINGPOT_2: + case MAP_82_CS_ENTERING_GL_MACHINE_ROOM: + case MAP_83_CS_GAME_OVER_MACHINE_ROOM: + case MAP_84_CS_UNUSED_MACHINE_ROOM: + case MAP_85_CS_SPIRAL_MOUNTAIN_3: + case MAP_86_CS_SPIRAL_MOUNTAIN_4: + case MAP_87_CS_SPIRAL_MOUNTAIN_5: + case MAP_88_CS_SPIRAL_MOUNTAIN_6: + case MAP_89_CS_INTRO_BANJOS_HOUSE_2: + case MAP_8A_CS_INTRO_BANJOS_HOUSE_3: + return 0x34d; + + case MAP_1_SM_SPIRAL_MOUNTAIN: + case MAP_2_MM_MUMBOS_MOUNTAIN: + case MAP_7_TTC_TREASURE_TROVE_COVE: + case MAP_B_CC_CLANKERS_CAVERN: + case MAP_D_BGS_BUBBLEGLOOP_SWAMP: + case MAP_12_GV_GOBIS_VALLEY: + case MAP_1B_MMM_MAD_MONSTER_MANSION: + case MAP_27_FP_FREEZEEZY_PEAK: + case MAP_31_RBB_RUSTY_BUCKET_BAY: + case 0x32: + case MAP_43_CCW_SPRING: + case MAP_44_CCW_SUMMER: + case MAP_45_CCW_AUTUMN: + case MAP_46_CCW_WINTER: + case 0x56: + return 0x34d; + + default: + return 0x34e; + } + } + } +} + +void func_802986D0(void){ + if(D_8037C5D0){ + assetcache_release(D_8037C5D0); + } +} + +void func_80298700(void){ + s32 sp1C = func_802985F0(); + if(func_8028ADB4()){ + D_8037C5D0 = 0; + } + else if(sp1C){ + D_8037C5D0 = assetcache_get(sp1C); + } + else{ + D_8037C5D0 = NULL; + } +} \ No newline at end of file diff --git a/src/core2/code_117D0.c b/src/core2/code_117D0.c new file mode 100644 index 00000000..9650e9d5 --- /dev/null +++ b/src/core2/code_117D0.c @@ -0,0 +1,58 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .data */ +struct50s D_80364450[] = +{ + {0x01, 0x01, 510.0f, -1200.0f, 200.0f}, + {0x02, 0x01, 600.0f, -1500.0f, 300.0f}, + {0x03, 0x01, 510.0f, -1200.0f, 100.0f}, + {0x04, 0x01, 510.0f, -1200.0f, 200.0f}, + {0x05, 0x01, 510.0f, -1200.0f, 300.0f}, + {0x06, 0x01, 510.0f, -1200.0f, 400.0f}, + {0x07, 0x01, 510.0f, -1200.0f, 500.0f}, + {0x08, 0x01, 600.0f, -1500.0f, 100.0f}, + {0x09, 0x01, 600.0f, -1500.0f, 200.0f}, + {0x0A, 0x01, 600.0f, -1500.0f, 300.0f}, + {0x0B, 0x01, 600.0f, -1500.0f, 400.0f}, + {0x0C, 0x01, 600.0f, -1500.0f, 500.0f}, + {0x0D, 0x02, 300.0f, -1200.0f, 0.0f}, + {0x0F, 0x01, 300.0f, -1200.0f, 0.0f}, + {0x0E, 0x03, 300.0f, -1200.0f, 0.0f}, + {0x10, 0x03, 300.0f, -1200.0f, 0.0f}, + {00} +}; + +/*.bss*/ +struct{ + struct50s *unk0; + f32 unk4[3]; +}D_8037C5E0; + +/*.code*/ +int func_80298760(s32 arg0){ + int i; + for(i = 0; D_80364450[i].unk0; i++){ + if(arg0 == D_80364450[i].unk0){ + D_8037C5E0.unk0 = D_80364450 + i; + break; + } + } +} + +s32 func_802987B4(void){ + return D_8037C5E0.unk0->unk1; +} + +f32 func_802987C4(void){ + return D_8037C5E0.unk0->unk4[0]; +} + +f32 func_802987D4(void){ + return D_8037C5E0.unk0->unk4[2]; +} + +f32 func_802987E4(void){ + return D_8037C5E0.unk0->unk4[1]; +} diff --git a/src/core2/code_11870.c b/src/core2/code_11870.c new file mode 100644 index 00000000..732b5ee9 --- /dev/null +++ b/src/core2/code_11870.c @@ -0,0 +1,93 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +struct50s D_8037C5F0[8]; +u8 D_8037C670; +u8 D_8037C671; + +/* .code */ +int func_80298800(f32 arg0[3]){ + if(!D_8037C5F0[D_8037C670 - 1].unk1) + return 0; + + ml_vec3f_copy(arg0, D_8037C5F0[D_8037C670 - 1].unk4); + return 1; +} + +s32 func_80298850(void){ + if(!D_8037C670){ + return 0; + } + return D_8037C5F0[D_8037C670 - 1].unk0; +} + +void func_8029887C(void){ + D_8037C671 = 0; + D_8037C670 = 0; +} + +void func_80298890(void){ + if(D_8037C670){ + D_8037C670--; + if(D_8037C670 == 0){ + func_80297CCC(1.2f); + D_8037C671 = 0; + } + } +} + +void func_802988DC(s32 arg0){ + D_8037C5F0[D_8037C670].unk0 = arg0; + D_8037C5F0[D_8037C670].unk1 = 0; + ml_vec3f_clear(D_8037C5F0[D_8037C670].unk4); + D_8037C670++; +} + +void func_8029892C(f32 arg0[3]){ + D_8037C5F0[D_8037C670-1].unk1 = 1; + ml_vec3f_copy(D_8037C5F0[D_8037C670-1].unk4, arg0); +} + +void func_80298970(s32 arg0){ + int val = 0; + switch(arg0){ + case 1: + if(bs_checkInterrupt(0x1E) == 2) + val = 1; + break; + case 2: + if(bs_checkInterrupt(0x1C) == 2) + val = 1; + break; + case 3: + if(bs_checkInterrupt(0x1D) == 2) + val = 1; + break; + case 4: + if(bs_checkInterrupt(0x25) == 2) + val = 1; + break; + default: + val = 1; + break; + } + if(val) + D_8037C671 = arg0; +} + +void func_80298A64(void){ + if(D_8037C670) + D_8037C671 = 0; +} + +void func_80298A84(void){ + s32 tmp; + if(D_8037C670){ + tmp = D_8037C5F0[D_8037C670-1].unk0; + if(D_8037C671 != tmp){ + func_80298970(tmp); + } + } +} diff --git a/src/core2/code_12360.c b/src/core2/code_12360.c new file mode 100644 index 00000000..b2ebbf86 --- /dev/null +++ b/src/core2/code_12360.c @@ -0,0 +1,101 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_80257D30(f32, f32, f32, f32, f32); +extern void func_8025901C(f32, f32 *, f32 *, f32); +extern f32 func_8029B2D0(void); + +void func_8029957C(s32 arg0); + +/* .bss*/ +s32 D_8037C6B0; +f32 D_8037C6B4; + +/* .code */ +void func_802992F0(void){ + func_802990B4(); + D_8037C6B4 = 0.0f; + D_8037C6B0 = 0; + func_8029957C(1); +} + +void func_8029932C(f32 arg0){ + D_8037C6B4 = arg0; +} + +void func_80299338(void){ + f32 stickX = func_8029B2D0(); + f32 sp20; + sp20 =(0.03 < (f64)mlAbsF(stickX)) ? func_80257D30(stickX, 0.0f, 1.0f, 1.0f, 6.0f) : 0.0f; + yaw_setIdeal(yaw_getIdeal() + sp20); +} + +void func_802993C8(void){ + switch(D_8037C6B0){ + case 1://802993F8 + if(func_8029B2E8() != 0.0f){ + yaw_setIdeal(func_8029B33C()); + } + yaw_update(); + break; + case 5://80299438 + if(func_8029B2E8() != 0.0f){ + yaw_setIdeal(func_8029B33C() + 180.0f); + } + yaw_update(); + break; + case 3://80299480 + yaw_update(); + break; + case 6://80299490 + func_80299338(); + yaw_update(); + break; + case 4://802994A8 + if(func_8029B2E8() != 0.0f){ + yaw_setIdeal(func_8029B33C()); + yaw_set(yaw_getIdeal()); + } + yaw_update(); + break; + case 7://802994F8 + if(func_8029B2E8() != 0.0f){ + f32 sp1C = func_8029B33C(); + f32 diff = mlDiffDegF(yaw_getIdeal(), sp1C); + if(D_8037C6B4 <= mlAbsF(diff)){ + yaw_setIdeal(func_8029B33C()); + } + } + yaw_update(); + break; + case 0://8029956C + case 2: + break; + } +} + +void func_8029957C(s32 arg0){ + D_8037C6B0 = arg0; +} + +s32 func_80299588(void){ + return D_8037C6B0; +} + +void func_80299594(s32 arg0, f32 arg1){ + f32 sp2C[3]; + f32 sp20[3]; + func_80294480(sp2C); + if(arg0){ + func_8025901C(mlNormalizeAngle(yaw_get() + 180.0f), sp2C, sp20, arg1); + } else { + func_8025901C(yaw_get(), sp2C, sp20, arg1); + } + pitch_setIdeal(sp20[0]); + roll_setIdeal(sp20[2]); +} + +void func_80299628(s32 arg0){ + func_80299594(arg0, 1.0f); +} diff --git a/src/core2/code_126C0.c b/src/core2/code_126C0.c new file mode 100644 index 00000000..aad6cf83 --- /dev/null +++ b/src/core2/code_126C0.c @@ -0,0 +1,235 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .data */ +s32 D_80364560 = 0; +s16 D_80364564[8] = { + SFX_32_BANJO_EGHEE, + SFX_34_BANJO_AGHOAA, + SFX_35_BANJO_WOAH, + SFX_37_BANJO_OHWW, + SFX_38_BANJO_AYE_1, + SFX_39_BANJO_AYE_2, + SFX_3A_BANJO_HOUW, + SFX_3B_BANJO_GAAH +}; + +s16 D_80364574[3] = { + SFX_54_BANJO_HOO_1, + SFX_55_BANJO_HOO_2, + SFX_56_BANJO_HUI, +}; + + +/* .bss */ +u8 D_8037C6C0; +u8 D_8037C6C1; +u8 D_8037C6C2; +u8 D_8037C6C3; +u8 D_8037C6C4; +u32 D_8037C6C8; +f32 D_8037C6CC; +struct{ + u8 unk0; + f32 unk4; + f32 unk8; + f32 unkC; + f32 unk10; + f32 unk14; + f32 unk18; + f32 unk1C; +} D_8037C6D0; + +/* .code */ +void func_80299650(f32 arg1, f32 arg2){ + f32 f20; + s32 unks0; + if(arg2 == 0.0f){ + func_8030E394(D_8037C6C4); + } + else if(arg2 < 1.0) { + if(1.0 <= arg1){ + sfxsource_setSfxId(D_8037C6C4, SFX_1C_ALARMCLOCK); + sfxsource_setSampleRate(D_8037C6C4, 0x7fff); + func_8030E2C4(D_8037C6C4); + } + } + else{ + unks0 = 0; + f20 = 5.0f; + while(f20 > 0.0f){ + if(f20 <= arg1 && arg2 < f20){ + sfxsource_setSfxId(D_8037C6C4, (unks0) ? SFX_2A_CLOCK_TIC_1 : SFX_51_CLOCK_TIC_2); + sfxsource_setSampleRate(D_8037C6C4, 0x7fff); + func_8030E2C4(D_8037C6C4); + return; + } + unks0 ^= 1; + f20 -= ml_map_f(f20, 0.0f, 5.0f, 0.1f, 0.25f); + } + } +} + +void func_802997E8(void){ + f32 f12; + f32 f2; + if(D_8037C6D0.unk0){ + D_8037C6D0.unk4 += time_getDelta(); + if(D_8037C6D0.unk8 <= D_8037C6D0.unk4){ + func_8030DA44(D_8037C6D0.unk0); + D_8037C6D0.unk0 = 0; + } + else{ + f12 = D_8037C6D0.unk4/D_8037C6D0.unk8; + if(f12 < D_8037C6D0.unkC){ + f2 = ml_map_f(f12, 0.0f, D_8037C6D0.unkC, D_8037C6D0.unk14, D_8037C6D0.unk18); + } + else if(f12 < D_8037C6D0.unk10){ + f2 = D_8037C6D0.unk18; + } + else{ + f2 = ml_map_f(f12, D_8037C6D0.unk10, 1.0f, D_8037C6D0.unk18, D_8037C6D0.unk1C); + } + func_8030DBB4(D_8037C6D0.unk0, f2); + } + } +} + +void func_802998D0(u8 indx){ + func_8030E6A4(SFX_19_BANJO_LANDING_08, D_8037C6CC, 22000); +} + +void func_80299900(void){ + D_8037C6C8 = 0; + D_8037C6C0 = func_8030D90C(); + func_8030DD14(D_8037C6C0, 3); + func_8030DD90(D_8037C6C0, 0); + D_8037C6CC = 1.0f; + + D_8037C6C1 = func_8030D90C(); + sfxsource_setSfxId(D_8037C6C1, SFX_18_BIGBUTT_SLIDE); + func_8030DD54(D_8037C6C1, func_802998D0); + sfxsource_setSampleRate(D_8037C6C1, 28000); + func_8030DD14(D_8037C6C1, 2); + func_8030DD90(D_8037C6C1, 0); + + D_8037C6C2 = func_8030D90C(); + func_8030DD90(D_8037C6C2, 0); + + D_8037C6C3 = func_8030D90C(); + func_8030DD90(D_8037C6C3, 0); + + D_8037C6C4 = func_8030D90C(); + func_8030DD90(D_8037C6C4, 0); + func_8030DD14(D_8037C6C4, 3); + D_8037C6D0.unk0 = 0; +} + +void func_80299A20(void){ + func_8030DA44(D_8037C6C1); + func_8030DA44(D_8037C6C0); + func_8030DA44(D_8037C6C3); + func_8030DA44(D_8037C6C2); + func_8030DA44(D_8037C6C4); + if(D_8037C6D0.unk0){ + func_8030DA44(D_8037C6D0.unk0); + } +} + +void func_80299A8C(void){ + func_802997E8(); +} + +void func_80299AAC(void){ + D_8037C6CC += randf()*0.1 - 0.05; + D_8037C6CC = max_f(D_8037C6CC, 0.9f); + D_8037C6CC = min_f(D_8037C6CC, 1.5f); + func_8030DBB4(D_8037C6C1, D_8037C6CC); + func_8030E2C4(D_8037C6C1); +} + +void func_80299B58(f32 arg0, f32 arg1){ + func_80299CF4(D_80364574[D_80364560], randf2(0.93f, 1.09f), 25000); + D_80364560++; + if(D_80364560 >= 3) + D_80364560 = 0; +} + +void func_80299BD4(void){ + func_8030E5F4(SFX_44_KAZOOIE_AUW, 1.117f); +} + +void func_80299BFC(f32 arg0){ + sfxsource_setSfxId(D_8037C6C0, D_80364564[D_8037C6C8]); + func_8030DBB4(D_8037C6C0, arg0); + func_8030E2C4(D_8037C6C0); + ++D_8037C6C8; + if(D_8037C6C8 >= 8) + D_8037C6C8 = 0; +} + +void func_80299C78(u8 indx, enum sfx_e sfx_id, f32 arg2, s32 arg3){ + sfxsource_setSfxId(indx, sfx_id); + func_8030DBB4(indx, arg2); + sfxsource_setSampleRate(indx, arg3); + func_8030E2C4(indx); +} + +u8 func_80299CC4(void){ + return D_8037C6C2; +} + +void func_80299CD0(void){ + func_8030E3FC(D_8037C6C2); +} + +void func_80299CF4(enum sfx_e sfx_id, f32 arg1, s32 arg2){ + func_80299C78(D_8037C6C2, sfx_id, arg1, arg2); +} + +void func_80299D2C(enum sfx_e sfx_id, f32 arg1, s32 arg2){ + func_80299C78(D_8037C6C3, sfx_id, arg1, arg2); +} + +void func_80299D64(void){ + if(func_8029CEB0() == 4){ + FUNC_8030E624(SFX_116_DEAF_RUSTLING, 0.7f, 32000); + FUNC_8030E624(SFX_116_DEAF_RUSTLING, 0.8f, 32000); + } + else{ + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 32750); + } +} + +void func_80299DB8(void){ + if(func_8029CEB0() == 4){ + FUNC_8030E624(SFX_116_DEAF_RUSTLING, 0.7f, 32000); + } + else{ + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 18000); + } +} + +void func_80299E00(void){ + if(func_8029CEB0() == 4){ + FUNC_8030E624(SFX_116_DEAF_RUSTLING, 0.7f, 27000); + } + else{ + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 1.0f, 14000); + } +} + +void func_80299E48(void){ + func_8030E394(D_8037C6C0); +} + +void func_80299E6C(void){ + func_8030E394(D_8037C6C2); +} + +void func_80299E90(void){ + func_8030E394(D_8037C6C3); +} + +void func_80299EB4(void){} diff --git a/src/core2/code_12F30.c b/src/core2/code_12F30.c new file mode 100644 index 00000000..98f3fdd3 --- /dev/null +++ b/src/core2/code_12F30.c @@ -0,0 +1,177 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_80294404(void); + +extern s16 D_80364580[]; + +extern f32 D_80374CF0; +extern f64 D_80374CF8; +extern f64 D_80374D00; +extern f32 D_80374D08; + +/*.bss*/ +struct { + u8 unk0; + f32 unk4[3]; +} +D_8037C6F0; + +/*.code */ +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_12F30/func_80299EC0.s") +#else +void func_80299EC0(f32 arg0[3]) { + f32 spEC[3]; //player_pos + f32 spE0[3]; + f32 spD4[3]; + BKModelBin *spC8; + f32 spB8[3]; + f32 spAC[3]; + f32 spA0[3]; + f32 sp7C[3][3]; //tri_vtx_colors + s32 sp78; + s32 i; + f32 sp70; + Struct60s *sp6C; //floor_vtx_list + f32 sp48[3][3]; //tri_vtx_coord + f32 temp_f0_2; + f32 temp_f2_2; + f32 temp_f2_4; + Vtx *vtx_buffer; + Vtx *temp_v1; + f32 phi_f18; + + + arg0[0] = 255.0f;\ + arg0[1] = 255.0f;\ + arg0[2] = 255.0f; + if (D_8037C6F0.unk0 == 1) { + sp78 = 50; + } else if (func_8028EE84() != BSWATERGROUP_0_NONE) { + sp78 = 200; + } else { + sp78 = 250; + } + _player_getPosition(spEC); + sp6C = func_8029463C(); + spC8 = func_802946A8(); + if (spC8 == NULL) { + sp6C = NULL; + } + if ((spEC[1] - func_80294438()) > 100.0f) { + sp6C = NULL; + } + if (sp6C == NULL) return; + if (sp6C->unk6 &2) return; + + vtx_buffer = vtxList_getVertices(func_8033A148(spC8)); + for(i = 0; i<3; i++){ + temp_v1 = vtx_buffer + sp6C->unk0[i]; + sp48[i][0] = (f32) temp_v1->v.ob[0]; + sp48[i][1] = (f32) temp_v1->v.ob[1]; + sp48[i][1] = 0.0f; + sp48[i][2] = (f32) temp_v1->v.ob[2]; + + sp7C[i][0] = (f32) temp_v1->v.cn[0]; + sp7C[i][1] = (f32) temp_v1->v.cn[1]; + sp7C[i][2] = (f32) temp_v1->v.cn[2]; + } + // spEC[1] = 0.0f; + + spE0[0] = spEC[0] - sp48[0][0]; + spE0[1] = 0.0f; + spE0[2] = spEC[2] - sp48[0][2]; + + spAC[0] = sp48[0][0] - sp48[1][0]; + spAC[1] = 0.0f; + spAC[2] = sp48[0][2] - sp48[1][2]; + + spB8[0] = -(sp48[2][2] - sp48[1][2]); + spB8[1] = 0.0f; + spB8[2] = sp48[2][0] - sp48[1][0]; + + phi_f18 = (spE0[0] * spB8[0]) + (spE0[1] * spB8[1]) + (spB8[2] * spE0[2]); + if(phi_f18 == 0.0f){ + phi_f18 = D_80374CF0; + } + + temp_f0_2 = -((spB8[2] * spAC[2]) + ((spAC[0] * spB8[0]) + 0.0f)) / phi_f18; + spA0[0] = (spE0[0] * temp_f0_2) + sp48[0][0]; + spA0[1] = 0.0f; + spA0[2] = (spE0[2] * temp_f0_2) + sp48[0][2]; + + spD4[0] = spA0[0] - sp48[1][0]; + spD4[1] = spA0[1] - sp48[1][1]; + spD4[2] = spA0[2] - sp48[1][2]; + + temp_f2_2 = gu_sqrtf(spD4[0]*spD4[0] + spD4[1]*spD4[1] + spD4[2]*spD4[2]) / (gu_sqrtf(spB8[0] * spB8[0] + spB8[1] * spB8[1] + spB8[2] * spB8[2]) + D_80374CF8); + for(i = 0; i < 3; i++){ + arg0[i] = sp7C[1][i] + (sp7C[2][i] - sp7C[1][i])*temp_f2_2; + } + + spD4[0] = spA0[0] - sp48[0][0]; + spD4[1] = spA0[1] - sp48[0][1]; + spD4[2] = spA0[2] - sp48[0][2]; + temp_f2_4 = (1.0 - (gu_sqrtf(spE0[0]*spE0[0] + spE0[1]*spE0[1] + spE0[2]*spE0[2]) / (gu_sqrtf(spD4[0]*spD4[0] + spD4[1]*spD4[1] + spD4[2]*spD4[2]) + D_80374D00))); + + for(i = 0; i < 3; i++){ + arg0[i] += (sp7C[0][i] - arg0[i])*temp_f2_4; + } + + for(i = 0; i < 3; i++){ + arg0[i] += (255.0f - arg0[i]) * (func_80294404() / 100.0f); + } + + for(i = 0; i < 3; i++){ + if(arg0[i] > 255.0f){ arg0[i] = 255.0f; } + if(arg0[i] < 0.0f) { arg0[i] = 0.0f; } + } + arg0[0] = ((arg0[0] + arg0[1] + arg0[2]) * (f32) (0xFF - sp78)) / D_80374D08 + sp78; + arg0[1] = arg0[0]; + arg0[2] = arg0[0]; +} +#endif + +void func_8029A47C(s32 arg0[3]){ + arg0[0] = (s32)(D_8037C6F0.unk4[0] + 0.5); + arg0[1] = (s32)(D_8037C6F0.unk4[1] + 0.5); + arg0[2] = (s32)(D_8037C6F0.unk4[2] + 0.5); +} + +void func_8029A4D0(void){ + int i; + s32 map_id = map_get(); + D_8037C6F0.unk0 = 0; + D_8037C6F0.unk4[0] = 255.0f; + D_8037C6F0.unk4[1] = 255.0f; + D_8037C6F0.unk4[2] = 255.0f; + for(i = 0; D_80364580[i]; i++){ + if(map_id == D_80364580[i]){ + D_8037C6F0.unk0 = 1; + break; + } + } +} + +void func_8029A54C(void){} + +void func_8029A554(void){ + int i; + f32 sp28[3]; + func_80299EC0(sp28); + for(i = 0; i < 3; i++){ + if(D_8037C6F0.unk4[i] < sp28[i]){ + D_8037C6F0.unk4[i] += 40.0f; + if(sp28[i] < D_8037C6F0.unk4[i]) + D_8037C6F0.unk4[i] = sp28[i]; + + } + else{//L8029A5C0 + D_8037C6F0.unk4[i] -= 40.0f; + if( D_8037C6F0.unk4[i] < sp28[i]) + D_8037C6F0.unk4[i] = sp28[i]; + } + } +} diff --git a/src/core2/code_13780.c b/src/core2/code_13780.c new file mode 100644 index 00000000..46ae681b --- /dev/null +++ b/src/core2/code_13780.c @@ -0,0 +1,68 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "bsint.h" + +s32 D_8037D160; //prev_state +s32 D_8037D164; //state +s32 D_8037D168; //next_state +s32 D_8037D16C; +s32 D_8037D170; + +void bs_clearState(void){ + D_8037D160 = 0; + D_8037D164 = 0; + D_8037D168 = 0; +} + +void bs_setState(s32 state_id){ + + if(state_id == 0) + return; + + D_8037D168 = state_id; + if(bsList_getEndMethod(D_8037D164) != NULL) + bsList_getEndMethod(D_8037D164)(); + + + D_8037D160 = D_8037D164; + D_8037D164 = D_8037D168; + D_8037D168 = 0; + + if(bsList_getInitMethod(D_8037D164) != NULL) + bsList_getInitMethod(D_8037D164)(); +} + +s32 bs_getPrevState(void){ + return D_8037D160; +} + +s32 bs_getState(void){ + return D_8037D164; +} + +s32 bs_getNextState(void){ + return D_8037D168; +} + +void bs_updateState(void){ + if(bsList_getUpdateMethod(D_8037D164) != NULL) + bsList_getUpdateMethod(D_8037D164)(); +} + +s32 bs_checkInterrupt(s32 arg0){ + D_8037D16C = arg0; + D_8037D170 = 0; + if(bsList_getInterruptMethod(D_8037D164) != NULL) + bsList_getInterruptMethod(D_8037D164)(); + return D_8037D170; +} + +void func_8029A86C(s32 arg0){ + D_8037D170 = arg0; +} + +s32 bs_getInterruptType(void){ + return D_8037D16C; +} diff --git a/src/core2/code_13900.c b/src/core2/code_13900.c new file mode 100644 index 00000000..fe8a127a --- /dev/null +++ b/src/core2/code_13900.c @@ -0,0 +1,61 @@ +#include +#include "functions.h" +#include "variables.h" + +struct { + f32 unk0; + f32 unk4; + u8 xform_8; +} D_8037D180; +u8 D_8037D18C; + +/* .code */ +void func_8029A890(void){ + func_802957FC(); +} + +void func_8029A8B0(void){ + func_80295804(); + D_8037D180.unk0 = D_8037D180.unk4 = 0.0f; + D_8037D180.xform_8 = TRANSFORM_1_BANJO; + D_8037D18C = FALSE; +} + +enum transformation_e _player_getTransformation(void){ + return D_8037D180.xform_8; +} + +f32 func_8029A900(void){ + return D_8037D180.unk0; +} + +f32 func_8029A90C(void){ + return D_8037D180.unk4; +} + +s32 func_8029A918(void){ + return D_8037D18C; +} + +void func_8029A924(void){} + +void func_8029A92C(void){ + func_8029A968(0.0f); + func_8029A974(0.0f); +} + +void func_8029A95C(enum transformation_e xform_id){ + D_8037D180.xform_8 = xform_id; +} + +void func_8029A968(f32 arg0){ + D_8037D180.unk0 = arg0; +} + +void func_8029A974(f32 arg0){ + D_8037D180.unk4 = arg0; +} + +void func_8029A980(s32 arg0){ + D_8037D18C = arg0; +} diff --git a/src/core2/code_13A00.c b/src/core2/code_13A00.c new file mode 100644 index 00000000..265d0557 --- /dev/null +++ b/src/core2/code_13A00.c @@ -0,0 +1,177 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802F494C(void *, f32); +extern void func_802F4884(void *, s32, f32); +extern f32 func_80294500(void); + + +void func_8029AE74(s32 arg0); +void func_8029AEE4(s32 arg0); + +/* .bss */ +Struct5Ds *D_8037D190; +u8 D_8037D194; + +/* .code */ +void func_8029A990(void){ + f32 plyr_pos[3]; + ParticleEmitter *pCtrl; + + if(map_get() == MAP_2C_MMM_BATHROOM) + func_8029C304(0); + else + func_8029C304(1); + + _player_getPosition(plyr_pos); + plyr_pos[1] = func_80294500(); + pCtrl = func_802F4094(plyr_pos, 25.0f); + particleEmitter_setParticleVelocityRange(pCtrl, + -350.0f, 300.0f, -350.0f, + 350.0f, 500.0f, 350.0f + ); + particleEmitter_emitN(pCtrl, 10); +} + +void func_8029AA3C(void){ + f32 sp34[3]; + f32 sp30; + ParticleEmitter *pCtrl; + if(map_get() == MAP_2C_MMM_BATHROOM) + func_8029C304(0); + else + func_8029C304(2); + + sp30 = ml_map_f(func_80297AB8(), 0.0f, 500.0f, 70.0f, 250.0f); + func_8028E9C4(D_8037D194, sp34); + sp34[1] = func_80294500(); + pCtrl = func_802F4094(sp34, 8.0f); + particleEmitter_setParticleVelocityRange(pCtrl, + -sp30, 300.0f, -sp30, + sp30, 350.0f,sp30 + ); + particleEmitter_emitN(pCtrl, 5); +} + +void func_8029AB14(s32 arg0, s32 arg1){ + int sp24 = (arg1 == 4) || (arg1 == 0xb); + int sp20 = player_inWater(); + if(sp24){ + func_8029AA3C(); + } + + switch(player_getTransformation()){ + case TRANSFORM_3_PUMPKIN: //L8029AB9C + if(arg1 == 7){ + func_802F4900(arg0, arg1); + } + if(sp24 || sp20){ + func_802F4900(arg0, 0xe); + } + else{ + func_802F4900(arg0, 0xd); + } + break; + case TRANSFORM_4_WALRUS://L8029ABEC + if(sp24){ + func_802F4900(arg0, 0x4); + } + else if(sp20){ + func_802F4900(arg0, 0xf); + } + else{ + func_802F4900(arg0, 0xd); + } + break; + default: //L8029AC28 + break; + } +} + +void func_8029AC34(s32 arg0, s32 arg1){ + int sp1C; + sp1C = (arg1 == 4) || (arg1 == 0xb || player_inWater()); + if(sp1C){ + func_8029A990(); + } + + switch(player_getTransformation()){ + case TRANSFORM_3_PUMPKIN: + case TRANSFORM_4_WALRUS: + case TRANSFORM_5_CROC: + if(sp1C) + FUNC_8030E624(SFX_10_BANJO_LANDING_07, 0.9f, 13000); + else + FUNC_8030E624(SFX_2F_ORANGE_SPLAT, 1.4f, 8000); + break; + default: + break; + } +} + +void func_8029ACD4(void){ + f32 plyr_pos[3]; + + _player_getPosition(plyr_pos); + func_802F4894(D_8037D190, plyr_pos); + func_802F4884( D_8037D190, func_80294660(), func_80294500()); +} + +void func_8029AD28(f32 arg0, s32 arg1){ + AnimCtrl *plyr_animCtrl = _player_getAnimCtrlPtr(); + if(animctrl_isAt(plyr_animCtrl, arg0)){ + func_8029AE74(arg1); + } +} + + +void func_8029AD68(f32 arg0, s32 arg1){ + AnimCtrl *plyr_animCtrl = _player_getAnimCtrlPtr(); + if(animctrl_isAt(plyr_animCtrl, arg0)){ + func_8029AEE4(arg1); + } +} + +void func_8029ADA8(void){ + func_802F4798(D_8037D190); +} + +void func_8029ADCC(void){ + D_8037D190 = func_802F47D0(); + func_802F487C(D_8037D190, func_8029AC34); + func_802F48B4(D_8037D190, func_8029AB14); +} + +void func_8029AE1C(void){ + func_8029ACD4(); + func_802F48BC(D_8037D190); +} + +void func_8029AE48(void){ + func_8029ACD4(); + func_802F48E0(D_8037D190); +} + +void func_8029AE74(s32 arg0){ + s32 tmp_v0; + func_8029ACD4(); + D_8037D194 = arg0; + tmp_v0 = func_8028ECAC(); + if(tmp_v0 == BSGROUP_6_TURBO_TALON_TRAINERS || tmp_v0 == BSGROUP_8_TROT || tmp_v0 == BSGROUP_9_LONG_LEG){ + func_802F494C(D_8037D190, 0.2f); + } + else{ + func_802F4924(D_8037D190); + } +} + +void func_8029AEE4(s32 arg0){ + func_8029ACD4(); + D_8037D194 = arg0; + func_802F4978(D_8037D190); +} + +void func_8029AF1C(void){ + D_8037D190 = func_802F499C(D_8037D190); +} diff --git a/src/core2/code_13FC0.c b/src/core2/code_13FC0.c new file mode 100644 index 00000000..5a572459 --- /dev/null +++ b/src/core2/code_13FC0.c @@ -0,0 +1,161 @@ +#include +#include "functions.h" +#include "variables.h" + +f32 func_8024DDD8(f32[3], f32); +extern void func_8024E71C(s32, f32*); +extern f32 ml_acosf(f32); +extern f32 func_8028EBA4(void); +extern void particleEmitter_setSphericalParticleVelocityRange(ParticleEmitter *this, f32 pitch_min, f32 yaw_min, f32 radial_min, f32 pitch_max, f32 yaw_max, f32 radial_max); +ParticleEmitter * func_802EDD8C(f32[3], f32, f32); +extern void func_80354030(f32[3], f32); +extern void func_80356074(f32[3], f32[3], f32, f32); +extern void func_80292864(f32, f32); + +/* .bss */ +struct { + f32 unk0; + s32 unk4; + f32 unk8[5]; + f32 unk1C[2]; + f32 unk24; + f32 unk28; + s32 unk2C; + s32 unk30; + u8 unk34; +} D_8037D1A0; + +/*.code */ +f32 func_8029AF50(f32 arg0, f32 arg1, f32 arg2){ + return (arg0 - arg1)/(arg2 - arg1); +} + +void func_8029AF68(void) { + s32 i; + + if (D_8037D1A0.unk28 <= D_8037D1A0.unk8[0]) { + D_8037D1A0.unk4 = 0; + D_8037D1A0.unk0 = 0.0f; + return; + } + + if ((D_8037D1A0.unk8[0] < D_8037D1A0.unk28) && (D_8037D1A0.unk28 <= D_8037D1A0.unk8[1])) { + D_8037D1A0.unk4 = 1; + D_8037D1A0.unk0 = func_8029AF50(D_8037D1A0.unk28, D_8037D1A0.unk8[0], D_8037D1A0.unk8[1]); + return; + } + if ((D_8037D1A0.unk8[1] < D_8037D1A0.unk28) && (D_8037D1A0.unk28 <= D_8037D1A0.unk8[2])) { + D_8037D1A0.unk4 = 2; + D_8037D1A0.unk0 = func_8029AF50(D_8037D1A0.unk28, D_8037D1A0.unk8[1], D_8037D1A0.unk8[2]); + return; + } + if ((D_8037D1A0.unk8[2] < D_8037D1A0.unk28) && (D_8037D1A0.unk28 <= D_8037D1A0.unk8[3])) { + D_8037D1A0.unk4 = 3; + D_8037D1A0.unk0 = func_8029AF50(D_8037D1A0.unk28, D_8037D1A0.unk8[2], D_8037D1A0.unk8[3]); + return; + } + if ((D_8037D1A0.unk8[3] < D_8037D1A0.unk28) && (D_8037D1A0.unk28 <= D_8037D1A0.unk8[4])) { + D_8037D1A0.unk4 = 4; + D_8037D1A0.unk0 = func_8029AF50(D_8037D1A0.unk28, D_8037D1A0.unk8[3], D_8037D1A0.unk8[4]); + return; + } +} + +void func_8029B0C0(void) { + func_8029B324(0, 0.12f); + func_8029B324(1, 0.2f); + func_8029B324(2, 0.5f); + func_8029B324(3, 0.75f); + func_8029B324(4, 1.0f); +} + +void func_8029B11C(void) { + D_8037D1A0.unk1C[0] = D_8037D1A0.unk1C[1] = D_8037D1A0.unk28 = D_8037D1A0.unk24 = D_8037D1A0.unk0 = 0.0f; + D_8037D1A0.unk34 = 0; + D_8037D1A0.unk30 = 0; + D_8037D1A0.unk2C = 0; + D_8037D1A0.unk4 = 0; + func_8029B0C0(); +} + +void func_8029B174(void) { + func_8024E71C(0, &D_8037D1A0.unk1C); + if (D_8037D1A0.unk34) { + D_8037D1A0.unk1C[0] = D_8037D1A0.unk1C[1] = 0.0f; + } + D_8037D1A0.unk28 = gu_sqrtf(D_8037D1A0.unk1C[0]*D_8037D1A0.unk1C[0] + D_8037D1A0.unk1C[1]*D_8037D1A0.unk1C[1]); + if (D_8037D1A0.unk28 != 0.0f) { + D_8037D1A0.unk2C = 0; + D_8037D1A0.unk30 = (s32) (D_8037D1A0.unk30 + 1); + D_8037D1A0.unk24 = ml_acosf(D_8037D1A0.unk1C[1] / D_8037D1A0.unk28); + if (D_8037D1A0.unk1C[0] < 0.0f) { + D_8037D1A0.unk24 = (f32) (180.0f - D_8037D1A0.unk24); + } + if (D_8037D1A0.unk1C[1] < 0.0f) { + D_8037D1A0.unk24 = (f32) (360.0f - D_8037D1A0.unk24); + } + } else { + D_8037D1A0.unk30 = 0; + D_8037D1A0.unk2C = (s32) (D_8037D1A0.unk2C + 1); + } + if (D_8037D1A0.unk28 > 1.0) { + D_8037D1A0.unk28 = 1.0f; + } + func_8029AF68(); +} + + +f32 func_8029B2D0(void){ + return D_8037D1A0.unk1C[0]; +} + +f32 func_8029B2DC(void){ + return D_8037D1A0.unk1C[1]; +} + +f32 func_8029B2E8(void){ + return D_8037D1A0.unk28; +} + +f32 func_8029B2F4(void){ + return D_8037D1A0.unk24; +} + +s32 func_8029B300(void){ + return D_8037D1A0.unk4; +} + +f32 func_8029B30C(void){ + return D_8037D1A0.unk0; +} + +void func_8029B318(bool arg0){ + D_8037D1A0.unk34 = arg0; +} + +void func_8029B324(s32 arg0, f32 arg1){ + D_8037D1A0.unk8[arg0] = arg1; +} + +f32 func_8029B33C(void){ + f32 sp1C[3]; + + _player_getPosition(sp1C); + return func_8024DDD8(sp1C, func_8029B2F4()); +} + +s32 func_8029B370(void){ + return D_8037D1A0.unk30; +} + +s32 func_8029B37C(void){ + return D_8037D1A0.unk2C; +} + +bool func_8029B388(void){ + return D_8037D1A0.unk30 == 1; +} + +bool func_8029B39C(void){ + return D_8037D1A0.unk2C == 1; +} diff --git a/src/core2/code_14420.c b/src/core2/code_14420.c new file mode 100644 index 00000000..18ae23b3 --- /dev/null +++ b/src/core2/code_14420.c @@ -0,0 +1,817 @@ +#include +#include "functions.h" +#include "variables.h" + +f32 func_8024DDD8(f32[3], f32); +extern void func_8024E71C(s32, f32*); +extern f32 ml_acosf(f32); +extern f32 func_8028EBA4(void); +extern void particleEmitter_setSphericalParticleVelocityRange(ParticleEmitter *this, f32 pitch_min, f32 yaw_min, f32 radial_min, f32 pitch_max, f32 yaw_max, f32 radial_max); +ParticleEmitter * func_802EDD8C(f32[3], f32, f32); +extern void func_80354030(f32[3], f32); +extern void func_80354380(f32[3], f32); +extern void func_80356074(f32[3], f32[3], f32, f32); +extern void func_80292864(f32, f32); + +typedef struct { + s16 state_id; + s16 anim_id; + f32 anim_duration; +} Struct_core2_13FC0; + +enum bs_14420_e{ + BS14420_0_TERMITE, + BS14420_1_PUMPKIN, + BS14420_2_CROC, + BS14420_3_WALRUS, + BS14420_4_WATER_SURFACE, + BS14420_5_UNDERWATER, + + BS14420_7_FLY = 0x7, + BS14420_8_TROT, + + BS14420_A_WALRUS_SLED = 0xA, + BS14420_B_BEE, + BS14420_C_CLIMB, + BS14420_D_WONDERWING, +}; + +/* .data */ +s32 D_80364620 = 0; +s16 D_80364624[14] = {0}; +u8 D_80364640[16] = {0}; +Struct_core2_13FC0 D_80364650[14] = {0}; +Struct_core2_13FC0 D_803646C0[14] = {0}; +Struct_core2_13FC0 D_80364730[14] = {0}; +Struct_core2_13FC0 D_803647A0[14] = {0}; +Struct_core2_13FC0 D_80364810[14] = {0}; +Struct_core2_13FC0 D_80364880[14] = {0}; +Struct_core2_13FC0 D_803648F0[14] = {0}; + +/* .bss */ +// extern struct { +// s32 map_id; +// s32 exit_id; +// }D_8037D1E0; +s32 D_8037D1E0[2]; +extern u8 D_8037D1E8; + +/* .code */ +f32 func_8029B3B0(f32 arg0) { + if (func_8028B128()) { + return arg0 * 0.2; + } + if (func_8028B120()) { + return arg0 * 0.2; + } + return arg0; +} + +f32 func_8029B41C(void){ + f32 sp2C[3]; + f32 sp20[3]; + f32 sp1C; + + player_getPosition(sp2C); + func_8024C5CC(sp20); + func_80257F18(sp2C, sp20, &sp1C); + return sp1C; +} + +enum bs_e func_8029B458(void){ + enum bs_e sp1C; + + sp1C = bs_getState(); + switch(_player_getTransformation()){ + case TRANSFORM_2_TERMITE: + return BS_38_ANT_FALL; + + case TRANSFORM_3_PUMPKIN: + return BS_4B_PUMPKIN_FALL; + + case TRANSFORM_5_CROC: + return BS_61_CROC_FALL; + + case TRANSFORM_4_WALRUS: + if(func_802B8190(sp1C)) + return BS_82_WALRUS_SLED_LOSE_IN_AIR; + return BS_6A_WALRUS_FALL; + + case TRANSFORM_6_BEE: + return BS_88_BEE_FALL; + + default: + if(bsbtrot_inSet(sp1C)) + return BS_71_BTROT_FALL; + return BS_2F_FALL; + } +} + +enum bs_e func_8029B504(void){ + enum bs_e sp1C; + + if(miscflag_isTrue(0xF)) + return 0; + + miscflag_set(0xF); + sp1C = func_8029B458(); + if(bs_getState() != sp1C) + return sp1C; + return 0; + +} + +s32 func_8029B564(void){ + return 1; +} + +f32 func_8029B56C(f32 arg0, f32 arg1, f32 arg2, f32 arg3) { + f32 phi_f0; + f32 phi_f2; + + phi_f0 = arg2; + phi_f2 = 0.0f; + while ((phi_f0 > 0.0f) || (arg1 < arg0)) { + phi_f2 += 0.0166666675f; + arg0 += phi_f0 * 0.0166666675f; + phi_f0 += arg3 * 0.0166666675f; + } + return phi_f2; +} + +void func_8029B5EC(void){ + func_802DC560(0, 0); + func_802E412C(1, 0); + func_802E4078(MAP_1F_CS_START_RAREWARE, 0, 1); +} + +void func_8029B62C(void){ + if(item_empty(ITEM_16_LIFE)){ + if(!func_8031FF1C(BKPROG_BD_ENTER_LAIR_CUTSCENE) || func_8031FF1C(BKPROG_A6_FURNACE_FUN_COMPLETE)){ + func_8025A430(-1, 0x7D0, 3); + func_8025A2B0(); + func_802DC528(0, 0); + func_80324C58(); + timedFunc_set_0(5.0f, func_8029B5EC); + } + else{ + func_802E412C(1, 0); + func_802E4078(MAP_83_CS_GAME_OVER_MACHINE_ROOM, 0, 1); + + } + } + else{ + func_802E4048(D_8037D1E0[0], D_8037D1E0[1], 1); + } +} + +void func_8029B6F0(void){ + if(item_empty(ITEM_16_LIFE)){ + func_8029B62C(); + } + else{ + func_802E4078(D_8037D1E0[0], D_8037D1E0[1], 1); + } +} + +void func_8029B73C(f32 arg0[3], f32 arg1, f32 arg2, f32 arg3, f32 arg4) { + f32 sp3C[3]; + f32 sp30[3]; + f32 temp_f20; + + func_8028FA74(sp3C); + if(sp3C[1] < (arg0[1] + arg2)) + return; + + if(sp3C[1] > (arg0[1] + arg1)) + return; + + sp30[0] = sp3C[0] - arg0[0]; + sp30[1] = 0.0f; + sp30[2] = sp3C[2] - arg0[2]; + temp_f20 = (sp30[0]*sp30[0] + sp30[1]*sp30[1] + sp30[2]*sp30[2]); + + if (!((arg3 * arg3) < temp_f20)) { + temp_f20 = gu_sqrtf(temp_f20); + ml_vec3f_set_length_copy(sp30, sp30, min_f(time_getDelta() * arg4, arg3 - temp_f20)); + ml_vec3f_add(sp3C, sp3C, sp30); + func_8028FAB0(sp3C); + } + +} + +void func_8029B85C(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + func_8030E6D4(SFX_EB_GRUNTY_LAUGH_2); + func_8029B62C(); +} + +void func_8029B890(void){ + if(!func_8031FF1C(BKPROG_A8_HAS_DIED) && !func_803203FC(2)){ + func_803114D0(); + if(bs_getState() == 0x54){ + func_8029B62C(); + return; + } + func_80311480(0xf81, 7, NULL, NULL, func_8029B85C, NULL); + func_80320004(BKPROG_A8_HAS_DIED, TRUE); + } + else{ + func_8029B62C(); + } +} + +void func_8029B930(void){ + func_803114D0(); +} + +ParticleEmitter *func_8029B950(f32 pos[3],f32 arg1){ + return func_802EDD8C(pos, arg1, func_80294500()); +} + +void func_8029B984(f32 dst[3]){ + f32 plyr_pos[3]; + f32 sp18[3]; + + _player_getPosition(plyr_pos); + func_8024C5CC(sp18); + ml_vec3f_diff_copy(dst, sp18, plyr_pos); +} + +f32 func_8029B9C0(void){ + f32 sp1C[3]; + + func_8029B984(sp1C); + return sp1C[0]*sp1C[0] + sp1C[1]*sp1C[1] + sp1C[2]*sp1C[2]; +} + +f32 func_8029B9FC(void){ + f32 sp1C[3]; + + func_8029B984(sp1C); + return gu_sqrtf(sp1C[0]*sp1C[0] + sp1C[1]*sp1C[1] + sp1C[2]*sp1C[2]); +} + +f32 func_8029BA44(void){ + f32 sp1C[3]; + + func_8029B984(sp1C); + return gu_sqrtf(sp1C[0]*sp1C[0] + sp1C[2]*sp1C[2]); +} + +enum bs_e func_8029BA80(void){ + switch (_player_getTransformation()) + { + case TRANSFORM_3_PUMPKIN: + return BS_4B_PUMPKIN_FALL; + + case TRANSFORM_2_TERMITE: + return BS_38_ANT_FALL; + + case TRANSFORM_5_CROC: + return BS_61_CROC_FALL; + + case TRANSFORM_4_WALRUS: + return BS_6A_WALRUS_FALL; + + case TRANSFORM_6_BEE: + return BS_88_BEE_FALL; + + case TRANSFORM_1_BANJO: + default: + return BS_2F_FALL; + } +} + +enum bs_14420_e func_8029BAF0(void){ + enum bs_e state_id = bs_getState(); + switch (_player_getTransformation()) + { + case TRANSFORM_3_PUMPKIN://L8029BB2C + return BS14420_1_PUMPKIN; + + case TRANSFORM_2_TERMITE://L8029BB34 + return BS14420_0_TERMITE; + + case TRANSFORM_5_CROC://L8029BB3C + return BS14420_2_CROC; + + case TRANSFORM_4_WALRUS://L8029BB44 + if (func_802B8190(state_id)) { + return BS14420_A_WALRUS_SLED; + } + return BS14420_3_WALRUS; + + case TRANSFORM_6_BEE://L8029BB64 + return BS14420_B_BEE; + + case TRANSFORM_1_BANJO://L8029BB6C + default: + if (bsclimb_inSet(state_id)) { + return BS14420_C_CLIMB; + } + if (bsbfly_inSet(state_id)) { + return BS14420_7_FLY; + } + if (bsbtrot_inSet(state_id)) { + return BS14420_8_TROT; + } + if (func_80291670(2) != 0.0f) { + return 9; + } + if (miscflag_isTrue(0x18)) { + return BS14420_5_UNDERWATER; + } + if (func_8028ECAC() == BSGROUP_3_WONDERWING) { + return BS14420_D_WONDERWING; + } + if (player_inWater()) { + switch(func_8028EE84()){ + case BSWATERGROUP_2_UNDERWATER: + return BS14420_5_UNDERWATER; + case BSWATERGROUP_1_SURFACE: + default: + return BS14420_4_WATER_SURFACE; + + } + } + return 6; + break; + } +} + +void func_8029BC60(enum asset_e *anim_id, f32 *anim_duration) { + s32 indx; + + indx = func_8029BAF0(); + *anim_id = D_80364650[indx].anim_id; + *anim_duration = D_80364650[indx].anim_duration; +} + +void func_8029BCAC(enum asset_e *anim_id, f32 *anim_duration) { + s32 indx; + + indx = func_8029BAF0(); + *anim_id = D_803646C0[indx].anim_id; + *anim_duration = D_803646C0[indx].anim_duration; +} + +void func_8029BCF8(enum asset_e *anim_id, f32 *anim_duration) { + s32 indx; + + indx = func_8029BAF0(); + *anim_id = D_803647A0[indx].anim_id; + *anim_duration = D_803647A0[indx].anim_duration; +} + +void func_8029BD44(enum asset_e *anim_id, f32 *anim_duration) { + s32 indx; + + indx = func_8029BAF0(); + *anim_id = D_80364730[indx].anim_id; + *anim_duration = D_80364730[indx].anim_duration; +} + +enum bs_e func_8029BD90(void) { + return D_80364650[func_8029BAF0()].state_id; +} + +enum bs_e func_8029BDBC(void) { + return D_80364624[func_8029BAF0()]; +} + +enum bs_e func_8029BDE8(void) { + return D_80364640[func_8029BAF0()]; +} + +void func_8029BE10(enum asset_e *anim_id, f32 *anim_duration) { + s32 indx; + + indx = func_8029BAF0(); + *anim_id = D_80364810[indx].anim_id; + *anim_duration = D_80364810[indx].anim_duration; +} + +enum bs_e func_8029BE5C(void) { + return D_80364810[func_8029BAF0()].state_id; +} + +void func_8029BE88(enum asset_e *anim_id, f32 *anim_duration) { + s32 indx; + + indx = func_8029BAF0(); + *anim_id = D_80364880[indx].anim_id; + *anim_duration = D_80364880[indx].anim_duration; +} + +enum bs_e func_8029BED4(void) { + return D_80364880[func_8029BAF0()].state_id; +} + +void func_8029BF00(enum asset_e *anim_id, f32 *anim_duration) { + s32 indx; + + indx = func_8029BAF0(); + *anim_id = D_803648F0[indx].anim_id; + *anim_duration = D_803648F0[indx].anim_duration; +} + +enum bs_e func_8029BF4C(void) { + return D_803648F0[func_8029BAF0()].state_id; +} + +enum bs_e bs_getIdleState(void){ + switch (_player_getTransformation()) { + case TRANSFORM_3_PUMPKIN: + return BS_48_PUMPKIN_IDLE; + + case TRANSFORM_2_TERMITE: + return BS_35_ANT_IDLE; + + case TRANSFORM_5_CROC: + return BS_5E_CROC_IDLE; + + case TRANSFORM_4_WALRUS: + return BS_67_WALRUS_IDLE; + + case TRANSFORM_6_BEE: + return BS_85_BEE_IDLE; + + case TRANSFORM_1_BANJO: + default: + if (miscflag_isTrue(0x16)) { + return BS_24_FLY; + } + if (miscflag_isTrue(0x18)) { + return BS_2B_DIVE_IDLE; + } + if (func_80291670(3) != 0.0f) { + return BS_15_BTROT_IDLE; + } + if (func_80291670(2) != 0.0f) { + return BS_26_LONGLEG_IDLE; + } + if (player_inWater()) { + if (player_getYPosition() > (func_80294500() - 80.0f)) { + return BS_2D_SWIM_IDLE; + } + return BS_2B_DIVE_IDLE; + } + if (func_8029A918()) { + return BS_15_BTROT_IDLE; + } + return BS_1_IDLE; + break; + } +} + +void func_8029C0D0(void) { + f32 sp3C[3]; + ParticleEmitter *p_ctrl; + f32 sp34; + + if (func_80294574()) { + _player_getPosition(sp3C); + sp3C[1] = sp34 = func_80294500(); + p_ctrl = func_802F4094(sp3C, 35.0f); + func_802F3554(3, sp3C); + particleEmitter_setParticleVelocityRange(p_ctrl, -350.0f, 300.0f, -350.0f, 350.0f, 500.0f, 350.0f); + particleEmitter_emitN(p_ctrl, 0xA); + particleEmitter_setParticleVelocityRange(p_ctrl, -150.0f, 500.0f, -150.0f, 150.0f, 800.0f, 150.0f); + particleEmitter_emitN(p_ctrl, 0xA); + + func_802F4200(sp3C); + sp3C[1] -= 30.0f; + p_ctrl = func_802EDD8C(sp3C, 20.0f, sp34); + particleEmitter_setParticleVelocityRange(p_ctrl, -60.0f, -250.0f, -60.0f, 60.0f, -150.0f, 60.0f); + particleEmitter_emitN(p_ctrl, 8); + } +} + + +void func_8029C22C(void) { + + if(func_80294574() && func_80294500() > player_getYPosition()) + return; + + D_80364620 = D_80364620 ? FALSE : TRUE; + if (func_80297AB8() > 100.0f) { + if (D_80364620) { + func_80292864(func_80297A7C() - 20.0f, 20.0f); + } + else{ + func_80292864(func_80297A7C() + 20.0f, 20.0f); + } + } +} + +void func_8029C304(s32 arg0) { + f32 sp1C[3]; + + _player_getPosition(sp1C); + sp1C[1] = func_80294500(); + func_802F3584(arg0, sp1C, func_802946CC()); +} + +void func_8029C348(void) { + f32 sp1C[3]; + + _player_getPosition(sp1C); + sp1C[0] += randf2(-30.0f, 30.0f); + sp1C[1] += randf2(60.0f, 70.0f); + sp1C[2] += randf2(-30.0f, 30.0f); + func_803541C0(2); + func_803541CC(0x50); + func_80354030(sp1C, 0.5); +} + +void func_8029C3E8(f32 arg0, f32 arg1) { + f32 sp3C[3]; + f32 sp30[3]; + f32 sp2C; + f32 sp28; + + _player_getPosition(sp30); + sp28 = ml_map_f(func_80297AB8(), 0.0f, 1000.0f, arg0, arg1); + sp2C = func_8028EBA4(); + func_802589E4(sp3C, sp2C, sp28); + sp3C[1] = 0.0f; + sp30[0] += sp3C[0];\ + sp30[1] += sp3C[1];\ + sp30[2] += sp3C[2]; + sp30[0] += randf2(-10.0f, 10.0f); + sp30[1] += 4.0f; + sp30[2] += randf2(-10.0f, 10.0f); + func_80354380(sp30, 0.45f); +} + +void func_8029C4E4(bool arg0) { + f32 sp3C[3]; + f32 sp38; + ParticleEmitter *sp34; + + if (func_80294574()) { + if (arg0) { + func_80292260(sp3C); + } else { + func_8029223C(sp3C); + } + sp3C[1] = func_80294500(); + sp38 = yaw_get(); + sp34 = func_802F4094(sp3C, 8.0f); + particleEmitter_setSphericalParticleVelocityRange(sp34, -140.0f, sp38 - 35.0f, 200.0f, -120.0f, sp38 + 35.0f, 250.0f); + particleEmitter_emitN(sp34, 3); + particleEmitter_setSphericalParticleVelocityRange(sp34, -100.0f, sp38 - 35.0f, 300.0f, -90.0f, sp38 + 35.0f, 400.0f); + particleEmitter_emitN(sp34, 2); + } +} + +void func_8029C5E8(void){ + func_8029AE1C(); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_14420/func_8029C608.s") +#else +void func_8029C608(void) { + enum level_e level_id; + enum map_e sp18; + s32 phi_v0; + + level_id = level_get(); + if ((level_id == 0) || (level_id == LEVEL_6_LAIR)) { + sp18 = map_get(); + phi_v0 = func_803348CC(); + } else { + sp18 = func_8030ADD8(level_id); + phi_v0 = func_8030AE24(level_id); + } + D_8037D1E0[1] = phi_v0; + D_8037D1E0[0] = sp18; +} +#endif + +void func_8029C674(void) { + f32 sp1C[3]; + + D_8037D1E8 = FALSE; + if (func_80298850() == 4) { + D_8037D1E8 = TRUE; + miscflag_set(0x17); + func_802BE8D8(); + func_8028E9C4(5, sp1C); + func_802C2A64(sp1C); + } +} + +void func_8029C6D0(void) { + f32 sp3C[3]; + f32 sp30[3]; + f32 sp24[3]; + f32 sp18[3]; + + if (func_80298850() == 4 && D_8037D1E8) { + func_8028E9C4(5, sp18); + func_802C2A64(sp18); + func_8028E9C4(5, sp30); + func_80298800(sp24); + func_802BC434(sp3C, sp24, sp30); + func_802C2A8C(sp3C); + } +} + +void func_8029C748(void) { + if (D_8037D1E8) { + miscflag_clear(0x17); + func_802BE91C(); + } +} + +enum bs_e func_8029C780(void){ + if(button_held(BUTTON_Z) && can_flip()) + return BS_12_BFLIP; + + if(miscflag_isTrue(MISC_FLAG_2_ON_SPRING_PAD)) + return BS_5_JUMP; + + if(miscflag_isTrue(MISC_FLAG_1_ON_FLIGHT_PAD)) + return BS_23_FLY_ENTER; + + return BS_5_JUMP; +} + +void func_8029C7F4(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ + func_80289F10(arg0); + func_802991A8(arg1); + func_8029957C(arg2); + func_802978DC(arg3); +} + +void func_8029C834(enum map_e map_id, s32 exit_id){ + D_8037D1E0[0] = map_id; + D_8037D1E0[1] = exit_id; +} + +void func_8029C848(AnimCtrl *arg0) { + switch(_player_getTransformation()) { + case TRANSFORM_2_TERMITE: //L8029C880 + animctrl_setIndex(arg0, ANIM_TERMITE_IDLE); + animctrl_setDuration(arg0, 2.0f); + break; + + case TRANSFORM_3_PUMPKIN: //L8029C8A0 + animctrl_setIndex(arg0, 0xA0); + animctrl_setDuration(arg0, 0.8f); + break; + + case TRANSFORM_5_CROC: //L8029C8C4 + animctrl_setIndex(arg0, 0xE1); + animctrl_setDuration(arg0, 1.0f); + break; + + case TRANSFORM_4_WALRUS: //L8029C8E4 + animctrl_setIndex(arg0, 0x11F); + animctrl_setDuration(arg0, 1.0f); + break; + + case TRANSFORM_6_BEE: //L8029C904 + animctrl_setIndex(arg0, ASSET_1DC_ANIM_BEE_FLY); + animctrl_setDuration(arg0, 0.38f); + break; + + case TRANSFORM_1_BANJO: + default: + if (player_inWater()) { + animctrl_setIndex(arg0, 0x57); + animctrl_setDuration(arg0, 1.2f); + } + else{ + animctrl_setIndex(arg0, 0x6F); + animctrl_setDuration(arg0, 5.5f); + } + break; + } +} + +void func_8029C984(void){ + func_8025AB00(); + func_8025A2FC(0, 4000); + func_8025A70C(COMUSIC_1A_DEATH); + func_8024BD08(0); +} + +s32 func_8029C9C0(s32 arg0){ + if(miscflag_isTrue(0xF)) + return arg0; + + if(button_pressed(BUTTON_A)) + arg0 = func_8029C780(); + + if(button_pressed(BUTTON_B) && can_claw()) + arg0 = BS_CLAW; + + if(button_held(BUTTON_Z) && should_beak_barge()) + arg0 = BS_BBARGE; + + if(func_80294F78()) + arg0 = func_802926C0(); + + if(player_isSliding()) + arg0 = BS_SLIDE; + + return arg0; +} + +s32 func_8029CA94(s32 arg0){ + if(miscflag_isTrue(0x19)) + arg0 = func_80292738(); + + if(miscflag_isTrue(0x1A)) + arg0 = (player_getTransformation() == TRANSFORM_6_BEE) ? 0x46 : BS_34_JIG_NOTEDOOR; + + if(miscflag_isTrue(MISC_FLAG_E_TOUCHING_WADING_BOOTS)) + arg0 = BS_25_LONGLEG_ENTER; + + if(miscflag_isTrue(MISC_FLAG_10_TOUCHING_TURBO_TRAINERS)) + arg0 = BS_14_BTROT_ENTER; + + if(miscflag_isTrue(0x6)) + arg0 = BS_53_TIMEOUT; + + if(miscflag_isTrue(0x7)) + arg0 = BS_44_JIG_JIGGY; + + if(miscflag_isTrue(0x14)) + arg0 = (player_getTransformation() == TRANSFORM_4_WALRUS) ? 0x80 : 0x53; + + miscflag_clear(0xF); + + return arg0; +} + +void func_8029CB84(void){ + pitch_setIdeal(0.0f); + pitch_applyIdeal(); + + roll_setIdeal(0.0f); + roll_applyIdeal(); +} + +void func_8029CBC4(void){ + func_8025A55C(-1, 4000, 0xc); + func_8024BD08(1); +} + +void func_8029CBF4(void){ + if(item_getCount(ITEM_E_JIGGY) == 10){ + if( jiggyscore_total() == 100 && func_8031FF1C(BKPROG_FC_DEFEAT_GRUNTY)){ + timedFunc_set_3(4.1f, (TFQM3)func_802E4078, MAP_95_CS_END_ALL_100, 0, 1); + }//L8029CC58 + + timedFunc_set_0(4.0f, func_8029CBC4); + func_8025A6EC(COMUSIC_42_NOTEDOOR_OPENING_FANFARE, -1); + }//L8029CC7C + else{ + if( jiggyscore_total() == 100 && func_8031FF1C(BKPROG_FC_DEFEAT_GRUNTY)){ + func_802E4078(MAP_95_CS_END_ALL_100, 0, 1); + } + func_8029CBC4(); + } + +} + +void func_8029CCC4(void){ + if(miscflag_isFalse(7)) return; + if( miscflag_isTrue(0xF) + && miscflag_isFalse(6) + && miscflag_isFalse(20) + ){ + miscflag_clear(0xF); + } + miscflag_clear(7); + func_802B0CD8(); + item_inc(ITEM_E_JIGGY); + if(jiggyscore_total() == 100 && func_8031FF1C(BKPROG_FC_DEFEAT_GRUNTY)){ + func_8028F918(2); + } + func_8024BD08(0); + func_8025A55C(0, 4000, 0xC); + func_8025A6EC(COMUSIC_D_JINGLE_JIGGY_COLLECTED, -1); + timedFunc_set_0(4.0f, func_8029CBF4); +} + +void func_8029CDA0(void){ + item_inc(ITEM_E_JIGGY); +} + +void func_8029CDC0(void) { + f32 sp2C[3]; + f32 sp20[3]; + + _player_getPosition(sp20); + sp20[0] += (randf() * 90.0f) - 45.0f; + sp20[2] += (randf() * 90.0f) - 45.0f; + sp2C[0] = (randf() * 20.0f) - 10.0f; + sp2C[1] = (randf() * 50.0f) + 120.0f; + sp2C[2] = (randf() * 20.0f) - 10.0f; + func_80356074(sp20, sp2C, 80.0f, 220.0f); +} diff --git a/src/core2/code_1550.c b/src/core2/code_1550.c new file mode 100644 index 00000000..6e79577b --- /dev/null +++ b/src/core2/code_1550.c @@ -0,0 +1,95 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "animation.h" + +AnimationFile *animcache_get(enum asset_e assest_id); + +/* .data */ +s16 D_803635C0[] = {0x1, 0x3, 0x5, 0xC, 0xE, 0x17, 0x18, 0x19, 0x1A, 0x1C, 0x1D, 0}; + +/* .bss */ +AnimationCache D_8037A8C0[0x2CA]; + +/* .code */ +void func_802884E0(void){ + s16 *phi_v0; + + for( phi_v0 = D_803635C0; *phi_v0 != 0; phi_v0++){ + D_8037A8C0[*phi_v0].unk4_0 = 1; + + } +} + +void animcache_loadAll(void){ + s32 i; + for(i = 0; i < 0x2CA; i++){ + if(D_8037A8C0[i].unk4_0){ + animcache_get(i); + } + } +} + +AnimationFile *animcache_get(enum asset_e asset_id){ + if(!D_8037A8C0[asset_id].unk0){ + D_8037A8C0[asset_id].unk0 = (AnimationFile *) assetcache_get(asset_id); + } + D_8037A8C0[asset_id].unk4_15 = 30; + return D_8037A8C0[asset_id].unk0; +} + +void animcache_free(void){ + s32 i; + for(i = 0; i < 0x2CA; i++){ + if(D_8037A8C0[i].unk0){ + assetcache_release(D_8037A8C0[i].unk0); + } + } +} + +void animcache_init(void){ + s32 i = 0; + for(i = 0; i < 0x2CA; i++){ + D_8037A8C0[i].unk0 = NULL; + D_8037A8C0[i].unk4_15 = 0; + D_8037A8C0[i].unk4_0 = 0; + } + func_802884E0(); + animcache_loadAll(); +} + +void func_8028873C(s32 arg0){ + s32 i; + if(arg0){ + for(i = 0; i < 0x2CA; i++){ + if(D_8037A8C0[i].unk0 && D_8037A8C0[i].unk4_0 && (D_8037A8C0[i].unk4_15 < 30)){ + assetcache_release(D_8037A8C0[i].unk0); + D_8037A8C0[i].unk0 = NULL; + D_8037A8C0[i].unk4_0 = 0; + } + } + } + else{ + for(i = 0; i < 0x2CA; i++){ + if(D_8037A8C0[i].unk0 && !D_8037A8C0[i].unk4_0 && (D_8037A8C0[i].unk4_15 < 30)){ + assetcache_release(D_8037A8C0[i].unk0); + D_8037A8C0[i].unk0 = NULL; + if(func_80254BC4(1)) + break; + } + } + } +} + +void func_80288834(void){ + s32 i; + for(i = 0; i < 0x2CA; i++){ + if(D_8037A8C0[i].unk0 && !D_8037A8C0[i].unk4_0){ + if(--D_8037A8C0[i].unk4_15 == 0){ + assetcache_release(D_8037A8C0[i].unk0); + D_8037A8C0[i].unk0 = NULL; + } + } + } +} diff --git a/src/core2/code_15F20.c b/src/core2/code_15F20.c new file mode 100644 index 00000000..00febdde --- /dev/null +++ b/src/core2/code_15F20.c @@ -0,0 +1,41 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_8033DE30(s32); + +/* .bss */ +u8 D_8037D1F0[5]; +f32 D_8037D1F8[5]; + +/* .code */ +s32 func_8029CEB0(void){ + return func_802944F4(); +} + +f32 func_8029CED0(void) { + s32 temp_v0; + + temp_v0 = func_8029CEB0(); + if (D_8037D1F0[temp_v0] != 0) { + return D_8037D1F8[temp_v0]; + } + return func_8033DE30(temp_v0); +} + +bool func_8029CF20(s32 arg0) { + return func_802944F4() == arg0; +} + +void func_8029CF48(s32 arg0, s32 arg1, f32 arg2) { + D_8037D1F0[arg0] = arg1; + D_8037D1F8[arg0] = arg2; +} + +void func_8029CF6C(void) { + s32 i; + + for(i = 0; i < 5; i++){ + D_8037D1F0[i] = 0; + } +} diff --git a/src/core2/code_16010.c b/src/core2/code_16010.c new file mode 100644 index 00000000..2fb9f5db --- /dev/null +++ b/src/core2/code_16010.c @@ -0,0 +1,322 @@ +#include +#include "functions.h" +#include "variables.h" + +extern int func_80258424(f32 vec[3], f32 minX, f32 minY, f32 minZ, f32 maxX, f32 maxY, f32 maxZ); + +/* .bss */ +u8 D_8037D210; +u8 D_8037D211; +u8 D_8037D212; +f32 D_8037D218[3]; +f32 D_8037D224; + +/*.code */ +bool func_8029CFA0(void){ + return func_80294574() && func_80294500() > player_getYPosition(); +} + +void func_8029CFF8(void){ + func_8030DA44(D_8037D210); +} + +void func_8029D01C(void){ + miscflag_clear(0x13); + D_8037D210 = func_8030D90C(); + D_8037D212 = 0; +} + +void func_8029D050(void){ + func_80299E48(); + func_8030E394(D_8037D210); + sfxsource_setSfxId(D_8037D210, SFX_14D_BANJO_FREEZING); + sfxsource_setSampleRate(D_8037D210, 30000); + func_8030DBB4(D_8037D210, 1.2f); + func_8030DD14(D_8037D210, 3); + func_8030E2C4(D_8037D210); + + D_8037D211 = 2; + D_8037D224 = 1.0f; +} + +void func_8029D0D8(void) { + func_8030E394(D_8037D210); + sfxsource_setSfxId(D_8037D210, SFX_B0_SIZZLING_NOISE); + sfxsource_setSampleRate(D_8037D210, 32000); + func_8030DBB4(D_8037D210, randf2(0.7f, 0.8f)); + func_8030DD14(D_8037D210, 3); + func_8030E2C4(D_8037D210); +} + +void func_8029D154(void){ + f32 sp1C[3]; + player_getPosition(sp1C); + func_8032813C(0x188, sp1C, (s32)yaw_get()); +} + +void func_8029D194(void) { + func_802C3BF8(&func_8029D154); + FUNC_8030E624(SFX_A_BANJO_LANDING_05, 1.0f, 28000); + func_8030E394(D_8037D210); + sfxsource_setSfxId(D_8037D210, SFX_6D_CROC_BITE); + sfxsource_setSampleRate(D_8037D210, 22000); + func_8030DD14(D_8037D210, 3); + player_getPosition(D_8037D218); + D_8037D218[1] = func_80294500(); + D_8037D212 = 4; + D_8037D224 = 0.0f; +} + +void func_8029D230(void) { + switch (map_get()) { + case MAP_12_GV_GOBIS_VALLEY: //L8029D2C0 + case MAP_31_RBB_RUSTY_BUCKET_BAY: //L8029D2C0 + case MAP_3C_RBB_KITCHEN: //L8029D2C0 + case MAP_6E_GL_GV_LOBBY: + case MAP_8E_GL_FURNACE_FUN: + func_8029D0D8(); + break; + + case MAP_27_FP_FREEZEEZY_PEAK: //L8029D2D0 + case MAP_7F_FP_WOZZAS_CAVE: + func_8029D050(); + break; + + case MAP_D_BGS_BUBBLEGLOOP_SWAMP: + case MAP_72_GL_BGS_LOBBY: + func_8029D194(); + break; + } +} + +void func_8029D2F8(void) { + u8 temp_v0; + + if (D_8037D211 != 0) { + if ((func_8029CFA0() == 0) && (func_8028F2FC() == 0) && (func_8030E3FC(D_8037D210) != 0)) { + func_8030E394(D_8037D210); + D_8037D211 = 0; + return; + } + + D_8037D224 = max_f(0.0f, D_8037D224 - time_getDelta()); + if (D_8037D224 == 0.0f) { + if (D_8037D211 == 1) { + func_8029D050(); + } + else if (D_8037D211 == 2) { + func_8030E394(D_8037D210); + sfxsource_setSfxId(D_8037D210, SFX_134_FREEZING_SHIVER); + sfxsource_setSampleRate(D_8037D210, 20000); + func_8030DBB4(D_8037D210, 1.2f); + func_8030DD14(D_8037D210, 3); + func_8030E2C4(D_8037D210); + D_8037D211 = 2; + D_8037D224 = 1.5f; + } + } + } +} + + +void func_8029D448(void) { + f32 sp1C; + s32 temp_a1; + + if (func_8030E3FC(D_8037D210) != 0) { + sp1C = time_getDelta(); + temp_a1 = func_8030E1C4(D_8037D210) - (s32) (sp1C * 30000.0); + if (temp_a1 <= 0) { + func_8030E394(D_8037D210); + return; + } + sfxsource_setSampleRate(D_8037D210, temp_a1); + } +} + +void func_8029D4D8(void) { + if (D_8037D212 != 0) { + D_8037D224 = max_f(0.0f, D_8037D224 - time_getDelta()); + if (!(D_8037D224 > 0.0f)) { + D_8037D212 += -1; + D_8037D224 = randf2(0.12f, 0.22f); + func_8030DBB4(D_8037D210, randf2(0.95f, 1.05f)); + func_8030E2C4(D_8037D210); + } + } +} + +void func_8029D5A4(void){ + switch (map_get()) { + case MAP_12_GV_GOBIS_VALLEY: + case MAP_31_RBB_RUSTY_BUCKET_BAY: + case MAP_3C_RBB_KITCHEN: + case MAP_6E_GL_GV_LOBBY: + case MAP_8E_GL_FURNACE_FUN: + func_8029D448(); + break; + + case MAP_27_FP_FREEZEEZY_PEAK: + case MAP_7F_FP_WOZZAS_CAVE: + func_8029D2F8(); + break; + + case MAP_D_BGS_BUBBLEGLOOP_SWAMP: + case MAP_72_GL_BGS_LOBBY: + func_8029D4D8(); + break; + } +} + +bool func_8029D66C(void){ + f32 sp2C[3]; + + switch (map_get()) { + case MAP_D_BGS_BUBBLEGLOOP_SWAMP: + case MAP_12_GV_GOBIS_VALLEY: + case MAP_1B_MMM_MAD_MONSTER_MANSION: + case MAP_3C_RBB_KITCHEN: + case MAP_43_CCW_SPRING: + case MAP_44_CCW_SUMMER: + case MAP_45_CCW_AUTUMN: + case MAP_46_CCW_WINTER: + case MAP_6E_GL_GV_LOBBY: + case MAP_72_GL_BGS_LOBBY: + case MAP_8E_GL_FURNACE_FUN://L8029D6FC + return func_80294610(0xE000) && func_8028B2E8(); + + case MAP_31_RBB_RUSTY_BUCKET_BAY: + player_getPosition(sp2C); + return player_inWater() && func_80258424(sp2C, -9000.0f, -3000.0f, -3850.0f, -6820.0f, -700.0f, -1620.0f); + break; + + case MAP_27_FP_FREEZEEZY_PEAK: + case MAP_7F_FP_WOZZAS_CAVE://L8029D790 + return player_inWater(); + } + return FALSE; +} + +//can_take_ground_damage +bool func_8029D7B4(void){ + enum bs_e sp1C; + + sp1C = bs_getState(); + + switch (map_get()) { + case MAP_D_BGS_BUBBLEGLOOP_SWAMP: + case MAP_12_GV_GOBIS_VALLEY: + case MAP_1B_MMM_MAD_MONSTER_MANSION: + case MAP_27_FP_FREEZEEZY_PEAK: + case MAP_31_RBB_RUSTY_BUCKET_BAY: + case MAP_3C_RBB_KITCHEN: + case MAP_43_CCW_SPRING: + case MAP_44_CCW_SUMMER: + case MAP_45_CCW_AUTUMN: + case MAP_46_CCW_WINTER: + case MAP_6E_GL_GV_LOBBY: + case MAP_72_GL_BGS_LOBBY: + case MAP_7F_FP_WOZZAS_CAVE://L8029D84C + case MAP_8E_GL_FURNACE_FUN://L8029D84C + return func_8029D66C() + && _player_getTransformation() == TRANSFORM_1_BANJO + && func_802916CC(2) + && func_8028ECAC() != BSGROUP_3_WONDERWING + && func_8028ECAC() != BSGROUP_9_LONG_LEG + && miscflag_isFalse(MISC_FLAG_E_TOUCHING_WADING_BOOTS) + && sp1C != BS_25_LONGLEG_ENTER + && func_8028EE84() != BSWATERGROUP_2_UNDERWATER + && func_8028EC04() < 1U + && func_80297C6C() != 3 + && bs_getState() != BS_3D_FALL_TUMBLING + && func_8028F22C() < 1U + ; + } + return 0; +} + +void func_8029D968(void){ + s32 sp24; + Struct60s *temp_v0; + s32 sp1C; + s32 sp18; + + func_8029D5A4(); + if(map_get() == MAP_12_GV_GOBIS_VALLEY){ + sp18 = 0; + sp1C = 0; + temp_v0 = func_802946F0(); + if(temp_v0 != NULL){ + sp1C = temp_v0->unk8 & 0x4000; + } + temp_v0 = func_8029463C(); + if(temp_v0 != NULL){ + sp18 = (temp_v0->unk8 & 0x4000) && func_8028B2E8(); + } + if (sp1C || sp18) { + func_80250D94(1.0f, 0.5f, 0.4f); + func_8028F504(0xD); + } + }//L8029DA18 + + sp24 = func_8029D7B4(); + func_8029E1A8(4); + if(sp24){ + if(map_get() == MAP_8E_GL_FURNACE_FUN){ + if(bs_checkInterrupt(0x13)){ + func_8029D230(); + } + } + else{//L8029DA6C + + if(func_8029E384(4)){ + func_8029E3C0(4, 4.0f); + if(func_8028F504(0xD)){ + func_8029D230(); + func_80250D94(1.0f, 0.5f, 0.4f); + } + if(item_empty(ITEM_14_HEALTH)){ + bs_checkInterrupt(0x13); + } + }//L8029DAD0 + + switch (map_get()) { + case MAP_43_CCW_SPRING://8029DB58 + case MAP_44_CCW_SUMMER://8029DB58 + case MAP_45_CCW_AUTUMN://8029DB58 + case MAP_46_CCW_WINTER://8029DB58 + func_8035644C(BKPROG_AA_HAS_TOUCHED_CCW_BRAMBLE_FIELD); + break; + + case MAP_D_BGS_BUBBLEGLOOP_SWAMP://8029DB68 + case MAP_72_GL_BGS_LOBBY: + func_8035644C(BKPROG_F_HAS_TOUCHED_PIRAHANA_WATER); + break; + + case MAP_3C_RBB_KITCHEN://8029DB78 + func_8035644C(BKPROG_A9_HAS_TOUCHED_RBB_OVEN); + break; + + case MAP_12_GV_GOBIS_VALLEY://8029DB88 + case MAP_6E_GL_GV_LOBBY: + case MAP_8E_GL_FURNACE_FUN://8029DB88 + func_8035644C(BKPROG_10_HAS_TOUCHED_SAND_EEL_SAND); + break; + + case MAP_27_FP_FREEZEEZY_PEAK://8029DB98 + case MAP_7F_FP_WOZZAS_CAVE://8029DB98 + func_8035644C(BKPROG_14_HAS_TOUCHED_FP_ICY_WATER); + break; + + case MAP_1B_MMM_MAD_MONSTER_MANSION://8029DBA8 + if(!func_8029CFA0()) + func_8035644C(BKPROG_86_HAS_TOUCHED_MMM_THORN_HEDGE); + break; + } + } + miscflag_set(0x13); + } + else{ + miscflag_clear(0x13); + } +} diff --git a/src/core2/code_16C60.c b/src/core2/code_16C60.c new file mode 100644 index 00000000..bc37b99a --- /dev/null +++ b/src/core2/code_16C60.c @@ -0,0 +1,198 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8029E070(bool); +void func_8029E064(bool); +void func_8029E058(bool); +void func_8029E0C4(f32); +void func_8029E0D0(f32); +void func_8029E0DC(bool); +void func_8029E0F4(bool); +void func_8029E0E8(bool); + +/* .bss */ +f32 D_8037D230; +u8 D_8037D234; +u8 D_8037D235; +u8 D_8037D236; +u8 D_8037D237; +u8 D_8037D238; +u8 D_8037D239; +u8 D_8037D23A; +f32 D_8037D23C; +f32 D_8037D240; + +/* .code */ +void func_8029DBF0(void){ + s32 temp_s0; + switch(func_80291FAC()){ + case 0x34D: //L8029DC24 + case 0x34E: //L8029DC24 + temp_s0 = (s32) func_80257C48(D_8037D23C, 1.0f, 8.0f); + func_8033A45C(0x1B, temp_s0); + func_8033A45C(0x1D, temp_s0); + func_8033A45C(0x1F, temp_s0); + func_8033A45C(0x21, temp_s0); + temp_s0 = (s32) func_80257C48(D_8037D240, 1.0f, 8.0f); + func_8033A45C(0x1A, temp_s0); + func_8033A45C(0x1C, temp_s0); + func_8033A45C(0x1E, temp_s0); + func_8033A45C(0x20, temp_s0); + break; + + case ASSET_34F_MODEL_BANJO_TERMITE: //L8029DCCC + case ASSET_359_MODEL_BANJO_WALRUS: //L8029DCCC + case ASSET_36F_MODEL_BANJO_PUMPKIN: //L8029DCCC + case ASSET_374_MODEL_BANJO_CROC: //L8029DCCC + func_8033A45C(0x1B, (s32) func_80257C48(D_8037D23C, 1.0f, 6.0f)); + func_8033A45C(0x1A, (s32) func_80257C48(D_8037D240, 1.0f, 6.0f)); + break; + + case ASSET_356_MODEL_BANJO_WISHYWASHY: //L8029DD2C + func_8033A45C(1, (s32) func_80257C48(D_8037D240, 1.0f, 4.0f)); + break; + } +} + + + +void func_8029DD6C(void) { + bool temp_s0; + + func_8033A1FC(); + switch (func_80291FAC()) { + case 0x34D: + case 0x34E: + func_8033A45C(1, D_8037D238); + func_8033A45C(9, D_8037D238); + func_8033A45C(0xC, D_8037D238); + func_8033A45C(0xF, D_8037D238); + func_8033A45C(2, D_8037D236); + func_8033A45C(0xA, D_8037D236); + func_8033A45C(0xD, D_8037D236); + func_8033A45C(0x10, D_8037D236); + func_8033A45C(8, D_8037D235); + func_8033A45C(0xB, D_8037D235); + func_8033A45C(0xE, D_8037D235); + func_8033A45C(0x11, D_8037D235); + temp_s0 = D_8037D237 + 1; + func_8033A45C(0x12, temp_s0); + func_8033A45C(0x14, temp_s0); + func_8033A45C(0x16, temp_s0); + func_8033A45C(0x18, temp_s0); + func_8033A45C(0x13, temp_s0); + func_8033A45C(0x15, temp_s0); + func_8033A45C(0x17, temp_s0); + func_8033A45C(0x19, temp_s0); + temp_s0 = D_8037D239 + 1; + func_8033A45C(0x22, temp_s0); + func_8033A45C(0x24, temp_s0); + func_8033A45C(0x26, temp_s0); + func_8033A45C(0x28, temp_s0); + func_8033A45C(0x23, temp_s0); + func_8033A45C(0x25, temp_s0); + func_8033A45C(0x27, temp_s0); + func_8033A45C(0x29, temp_s0); + break; + case ASSET_359_MODEL_BANJO_WALRUS: + func_8033A45C(3, D_8037D23A); + break; + case ASSET_374_MODEL_BANJO_CROC: + temp_s0 = D_8037D237 + 1; + func_8033A45C(4, temp_s0); + func_8033A45C(5, temp_s0); + func_8033A45C(6, temp_s0); + func_8033A45C(7, temp_s0); + break; + } + func_8029DBF0(); +} + +bool func_8029DFA4(void){ + return D_8037D235; +} + +bool func_8029DFB0(void){ + return D_8037D236; +} + +bool func_8029DFBC(void){ + return D_8037D238; +} + +f32 func_8029DFC8(void){ + return D_8037D23C; +} + +f32 func_8029DFD4(void){ + return D_8037D240; +} + +bool func_8029DFE0(void){ + return D_8037D237; +} + +bool func_8029DFEC(void){ + return D_8037D239; +} + +void func_8029DFF8(void) { + func_8029E070(0); + func_8029E064(0); + func_8029E058(0); + func_8029E0C4(0.0f); + func_8029E0D0(0.0f); + func_8029E0DC(0); + func_8029E0F4(0); + func_8029E0E8(0); +} + +void func_8029E058(bool arg0){ + D_8037D235 = arg0; +} + +void func_8029E064(bool arg0){ + D_8037D236 = arg0; +} + +void func_8029E070(bool arg0) { + func_8029E090(arg0, 0.0f); +} + +void func_8029E090(bool arg0, f32 arg1) { + D_8037D230 = arg1; + D_8037D234 = arg0; + if (arg1 == 0.0f) { + D_8037D238 = arg0; + } +} + +void func_8029E0C4(f32 arg0){ + D_8037D23C = arg0; +} + +void func_8029E0D0(f32 arg0){ + D_8037D240 = arg0; +} + +void func_8029E0DC(bool arg0){ + D_8037D237 = arg0; +} + +void func_8029E0E8(bool arg0){ + D_8037D23A = arg0; +} + +void func_8029E0F4(bool arg0){ + D_8037D239 = arg0; +} + +void func_8029E100(void) { + if (D_8037D230 != 0.0f) { + D_8037D230 -= time_getDelta(); + if (D_8037D230 <= 0.0f) { + D_8037D238 = D_8037D234; + } + } +} diff --git a/src/core2/code_171F0.c b/src/core2/code_171F0.c new file mode 100644 index 00000000..93a05f16 --- /dev/null +++ b/src/core2/code_171F0.c @@ -0,0 +1,59 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +struct { + f32 unk0[0x8]; + f32 unk20[0x8]; +} D_8037D250; + +/* .code*/ +void func_8029E180(s32 arg0, f32 arg1){ + D_8037D250.unk20[arg0] = D_8037D250.unk0[arg0]; + D_8037D250.unk0[arg0] += arg1; +} + +int func_8029E1A8(s32 arg0){ + D_8037D250.unk20[arg0] = D_8037D250.unk0[arg0]; + if(0.0f == D_8037D250.unk0[arg0]){ + return 0; + } + D_8037D250.unk0[arg0] = max_f(0.0f, D_8037D250.unk0[arg0] - time_getDelta()); + return D_8037D250.unk0[arg0] == 0.0f; +} + +void func_8029E22C(s32 arg0){ + D_8037D250.unk20[arg0] = D_8037D250.unk0[arg0]; + D_8037D250.unk0[arg0] += time_getDelta(); +} + +f32 func_8029E270(s32 arg0){ + return D_8037D250.unk0[arg0]; +} + +int func_8029E284(s32 arg0, f32 arg1){ + return D_8037D250.unk20[arg0] <= arg1 + && arg1 < D_8037D250.unk0[arg0]; +} + +int func_8029E2E0(s32 arg0, f32 arg1){ + return D_8037D250.unk0[arg0] < arg1; +} + +int func_8029E314(s32 arg0, f32 arg1){ + return arg1 < D_8037D250.unk0[arg0]; +} + +int func_8029E348(s32 arg0){ + return (0.0 != D_8037D250.unk0[arg0]); +} + +int func_8029E384(s32 arg0){ + return (0.0 == D_8037D250.unk0[arg0]); +} + +void func_8029E3C0(s32 arg0, f32 arg1){ + D_8037D250.unk20[arg0] = arg1; + D_8037D250.unk0[arg0] = arg1; +} \ No newline at end of file diff --git a/src/core2/code_1930.c b/src/core2/code_1930.c new file mode 100644 index 00000000..a394cc78 --- /dev/null +++ b/src/core2/code_1930.c @@ -0,0 +1,226 @@ +#include +#include "functions.h" +#include "variables.h" + + + + +extern void func_80250E6C(f32, f32); +extern void func_802BB360(s32, f32); +extern void func_802BB378(s32, f32, f32); +extern void func_802BB3AC(s32, f32); +extern void func_8031B908(u8, u8, u8, f32); + +/* .bss */ +s32 D_8037BF10; + +/* .code */ +#ifndef NONMATCHING +void func_802888C0(s32 arg0, s32 arg1); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_1930/func_802888C0.s") +#else +void func_802888C0(s32 arg0, s32 arg1){ + u8 sp1C[3]; + f32 f0; + sp1C[0] = arg0 >> 16;\ + sp1C[1] = arg0 >> 8;\ + sp1C[2] = arg0 >> 0;\ + f0 = reinterpret_cast(f32, arg1);\ + func_8031B908(sp1C[0], sp1C[1], sp1C[2], f0); +} +#endif + +void func_80288914(s32 arg0, s32 arg1, s32 arg2){ + f32 f0 = reinterpret_cast(f32, arg1); + f32 f2 = reinterpret_cast(f32, arg2); + func_802BB378(arg0, f0, f2); +} + +void func_8028894C(s32 arg0, s32 arg1, s32 arg2){ + f32 f0 = reinterpret_cast(f32, arg1); + f32 f2 = reinterpret_cast(f32, arg2); + func_802BB3DC(arg0, f0, f2); +} + +void func_80288984(s32 arg0, s32 arg1){ + f32 f0 = reinterpret_cast(f32, arg1); + func_802BB360(arg0, f0); + func_802BB3AC(arg0, 1.0f); + func_802BB3C4(arg0); +} + +void func_802889C8(s32 arg0, s32 arg1){ + f32 f0 = reinterpret_cast(f32, arg1); + func_802BB3AC(arg0, f0); +} + +void func_802889F4(s32 arg0) { + s32 sp18; + s32 temp_t6; + s32 phi_a3; + + phi_a3 = arg0 >> 0x10; + if( !(phi_a3 == 0xF2 && map_get() == MAP_91_FILE_SELECT && func_802C5A30() != 0) + && !((phi_a3 == 0x21 || phi_a3 == 0x3ED) && map_get() == MAP_91_FILE_SELECT && (func_802C5A30() == 1)) + ){ + func_8030E6A4(phi_a3, (f32) ((f64) ((arg0 >> 8) & 0xFF) * 0.0078125), (s32) ((f64) (arg0 & 0xFF) * 128.0)); + } +} + + +void func_80288AE0(s32 arg0){ + func_8025A6EC((u16) (arg0 >> 16), (u16)arg0 - 1); +} + +void func_80288B14(enum sfx_e arg0){ + func_8025A7DC(arg0); +} + +void func_80288B34(s32 arg0, s32 arg1){ + f32 f12 = reinterpret_cast(f32, arg0); + f32 f14 = reinterpret_cast(f32, arg1); + func_80250E6C(f12, f14); +} + +void func_80288B60(s32 arg0, s32 arg1, s32 arg2){ + f32 f12 = reinterpret_cast(f32, arg0); + f32 f14 = reinterpret_cast(f32, arg1); + f32 f0 = reinterpret_cast(f32, arg2); + func_80250D94(f12, f14, f0); +} + +void func_80288B98(vector(struct2s) **arg0, struct2s *arg1){ + if(arg1->unk5){ + if(arg1->unk5 == 0xFF) + return; + if(--arg1->unk5) + return; + + arg1->unk5 = 0xFF; + } + + switch(arg1->unk4){ + case 0:// 80288BF8 + ((void (*)(void)) arg1->unk14)(); + break; + case 1:// 80288C0C + ((void (*)(s32)) arg1->unk14)(arg1->unk8); + break; + case 2:// 80288C24 + ((void (*)(s32, s32)) arg1->unk14)(arg1->unk8, arg1->unkC); + break; + case 3:// 80288C40 + ((void (*)(s32, s32, s32)) arg1->unk14)(arg1->unk8, arg1->unkC, arg1->unk10); + break; + case 4:// 80288C5C + ((void (*)(u8*)) arg1->unk14)((u8*)&arg1->unk8); + break; + } +} + +void func_80288C7C(vector(struct2s) **arg0){ + vector_clear(*arg0); +} + +s32 func_80288C9C( vector(struct2s) **arg0, f32 arg1, s32 arg_cnt, void *funcPtr, s32 arg4, s32 arg5, s32 arg6){ + struct2s *ptr = (struct2s *) vector_pushBackNew(arg0); + ptr->unk0 = arg1; + ptr->unk4 = arg_cnt; + ptr->unk14 = funcPtr; + ptr->unk8 = arg4; + ptr->unkC = arg5; + ptr->unk10 = arg6; + ptr->unk5 = D_8037BF10; + D_8037BF10 = 0; + +} + +void func_80288D08(vector(struct2s) **arg0, f32 arg1, void *arg2){ + func_80288C9C(arg0, arg1, 0, arg2, 0, 0, 0); +} + +void func_80288D40(vector(struct2s) **arg0, f32 arg1, void *arg2, s32 arg3){ + func_80288C9C(arg0, arg1, 1, arg2, arg3, 0, 0); +} + +void func_80288D84(vector(struct2s) **arg0, f32 arg1, void *arg2, s32 arg3, s32 arg4){ + func_80288C9C(arg0, arg1, 2, arg2, arg3, arg4, 0); +} + +void func_80288DCC(vector(struct2s) **arg0, f32 arg1, void *arg2, s32 arg3, s32 arg4, s32 arg5){ + func_80288C9C(arg0, arg1, 3, arg2, arg3, arg4, arg5); +} + +void func_80288E18(vector(struct2s) **arg0, f32 arg1, void *func_ptr, void* arg_ptr, s32 arg_size){ + s32 out = func_80288C9C(arg0, arg1, 4, func_ptr, 0, 0, 0); + memcpy(out + 8, arg_ptr, arg_size); +} + +void func_80288E68(vector(struct2s) **arg0, f32 arg1, s32 arg2, s32 arg3, s32 arg4){ + func_80288DCC(arg0, arg1, func_80288914, arg2, arg3, arg4); +} + +void func_80288EB0(vector(struct2s) **arg0, f32 arg1, s32 arg2, s32 arg3, s32 arg4){ + func_80288DCC(arg0, arg1, func_8028894C, arg2, arg3, arg4); +} + +void func_80288EF8(vector(struct2s) **arg0, f32 arg1, s32 arg2, s32 arg3){ + func_80288D84(arg0, arg1, func_80288984, arg2, arg3); +} + +void func_80288F38(vector(struct2s) **arg0, f32 arg1, s32 arg2, s32 arg3){ + func_80288D84(arg0, arg1, func_802889C8, arg2, arg3); +} + +void func_80288F78(vector(struct2s) **arg0, f32 arg1, s32 arg2){ + func_80288D40(arg0, arg1, func_802889F4, arg2); +} + +void func_80288FA8(vector(struct2s) **arg0, f32 arg1, enum sfx_e sfx_id){ + func_80288D40(arg0, arg1, func_80288B14, sfx_id); +} + +void func_80288FD8(vector(struct2s) **arg0, f32 arg1, s32 arg2){ + func_80288D40(arg0, arg1, func_80288AE0, arg2); +} + +void func_80289008(vector(struct2s) **arg0, f32 arg1, s32 arg2, s32 arg3){ + do{ + func_80288D84(arg0, arg1, func_80288B34, arg2, arg3); + }while(0); +} + +void func_80289048(vector(struct2s) **arg0, f32 arg1, s32 arg2, s32 arg3, s32 arg4){ + do{ + func_80288DCC(arg0, arg1, func_80288B60, arg2, arg3, arg4); + }while(0); +} + +void func_80289090(vector(struct2s) **arg0, f32 arg1, s32 arg2, s32 arg3){ + func_80288D84(arg0, arg1, func_802888C0, arg2, arg3); +} + +void func_802890D0(VLA** arg0){ + vector_free(*arg0); + free(arg0); +} + +vector(struct2s) **func_802890FC(void){ + vector(struct2s) **ptr = (vector(struct2s) **)malloc(sizeof(vector(struct2s) **)); + *ptr = vector_new(sizeof(struct2s), 2); + func_80288C7C(ptr); + return ptr; +} + + +void func_8028913C(vector(struct2s) **arg0, s32 arg1){ + D_8037BF10 = arg1; +} + +void func_8028914C(vector(struct2s) **arg0, AnimCtrl *arg1){ + struct2s *iPtr; + for(iPtr = vector_getBegin(*arg0); iPtr != (struct2s*)vector_getEnd(*arg0); iPtr++){ + if(animctrl_isAt(arg1, iPtr->unk0)) + func_80288B98(arg0, iPtr); + } +} diff --git a/src/core2/code_2240.c b/src/core2/code_2240.c new file mode 100644 index 00000000..0b7e0022 --- /dev/null +++ b/src/core2/code_2240.c @@ -0,0 +1,187 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "animation.h" + +//function declarations +void anim_setIndex(Animation *this, enum asset_e arg1); +s32 anim_802897A0(Animation *this); +s32 func_802892FC(Animation *this); +void func_8033AA50(s32, f32, s32); +void func_8033A750(s32, s32, s32, f32); + +//function definitions +void func_802891D0(Animation *this, s32 arg1){ + s32 *tmp; + if(func_80288400(this->unkA[arg1], &tmp) == 0){ + func_8033A510(tmp); + }; +} + +void func_8028920C(Animation *this){ + func_802891D0(this, this->unk8); +} + +void func_8028922C(Animation *this){ + func_802891D0(this, 2); +} + +s32 func_8028924C(Animation *this, s32 arg1){ + return func_80288374(this->unkA[arg1]); +} + +s32 func_80289274(Animation *this){ + return func_8028924C(this, this->unk8); +} + +s32 func_80289294(Animation *this){ + return func_8028924C(this, (this->unk8 != 0)? 0: 1); +} + +s32 func_802892CC(Animation *this, s32 arg1){ + s32 tmp; + func_80288400(this->unkA[arg1], &tmp); + return tmp; +} + +s32 func_802892FC(Animation *this){ + return func_802892CC(this, this->unk8); +} + +s32 func_8028931C(Animation *this){ + return func_802892CC(this, (this->unk8 != 0)? 0: 1); +} + +s32 func_80289354(Animation *this){ + return func_802892CC(this, 2); +} + +void func_80289374(Animation *this){ + if(this->unk1C == 1 && func_80289274(this)){ + this->unk8 = (this->unk8)? 0 : 1; + } + this->unk1C = 0; + if( this->duration < 1.0f && func_80289294(this)){ + func_8033AA50(animcache_get(this->index), this->timer, func_802892FC(this)); + func_8033A750(func_802892FC(this), func_8028931C(this), func_802892FC(this), this->duration); + } + else{ + func_8033AA50(animcache_get(this->index), this->timer, func_802892FC(this)); + } + +} + +void func_8028948C(Animation *this){ + if(this->unk1C == 1 && this->unk1E == 0){ + if(func_80289274(this)){ + this->unk8 = (this->unk8)? 0 : 1; + func_8028922C(this); + } + } + else{ + if(this->unk1C == 2) + func_8028920C(this); + } + this->unk1C = 0; + if( this->duration < 1.0f && func_80289294(this) && !this->unk1E){ + func_8033AA50(animcache_get(this->index), this->timer, func_80289354(this)); + func_8033A750(func_802892FC(this), func_8028931C(this), func_80289354(this), this->duration); + } + else{ + func_8033AA50(animcache_get(this->index), this->timer, func_802892FC(this)); + if(this->unk1E && this->index) + this->unk1E = 0; + } + +} + +void func_802895F8(Animation *this){ + if(this->unk1D == 1){ + func_8028948C(this); + } + else{ + func_80289374(this); + } + if(this->matrices){ + (*(this->matrices))(func_802892FC(this), this->unk4); + } + anim_802897A0(this); +} + + +void func_80289674(Animation *this){ + this->unk1C = 1; +} + +s32 func_80289680(void){ + return 0x20; +} + +enum asset_e anim_getIndex(Animation *this){ + return this->index; +} + +f32 anim_getTimer(Animation *this){ + return this->timer; +} + +f32 anim_getDuration(Animation *this){ + return this->duration; +} + +void func_802896A0(Animation *this){ + func_802883AC(this->unkA[0]); + func_802883AC(this->unkA[1]); + if(this->unk1D == 1){ + func_802883AC(this->unkA[2]); + } +} + +void func_802896EC(Animation *this, s32 arg1){ + this->unk1D = arg1; + anim_setIndex(this,0); + anim_setTimer(this, 0.0f); + anim_setDuration(this, 1.0f); + anim_80289790(this, NULL); + this->unk1C = 0; + this->unk1E = 1; + this->unk8 = 0; + this->unkA[0] = func_80288330(); + this->unkA[1] = func_80288330(); + if(this->unk1D == 1){ + this->unkA[2] = func_80288330(); + } +} + +void anim_setIndex(Animation *this, enum asset_e arg1){ + this->index = arg1; +} + +void anim_setTimer(Animation *this, f32 arg1){ + this->timer = arg1; +} + +void anim_80289790(Animation *this, void (*arg1)(s32, s32)){ + this->matrices = arg1; +} + +void anim_80289798(Animation *this, s32 arg1){ + this->unk4 = arg1; +} + +s32 anim_802897A0(Animation *this){ + return func_8033A238(func_802892FC(this)); +} + +void anim_setDuration(Animation *this, f32 arg1){ + this->duration = arg1; +} + +void anim_802897D4(Animation *this, BKAnimationList *arg0, Animation *dst){ + func_802EA1A8(this, arg0, func_802892FC(dst)); +} + +void anim_8028980C(Animation *this){ + this->unk1C = 2; +} \ No newline at end of file diff --git a/src/core2/code_27550.c b/src/core2/code_27550.c new file mode 100644 index 00000000..88bb5111 --- /dev/null +++ b/src/core2/code_27550.c @@ -0,0 +1,141 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +struct { + ParticleEmitter *unk0; + ParticleEmitter *unk4; + f32 unk8; + f32 unkC; + f32 unk10; +}D_8037D420; +u8 D_8037D438; + +/* .code */ +void func_802AE4E0(s32 arg0) { + switch (arg0) { + case 1: + func_8029E3C0(0, 0.2f); + break; + case 2: + func_8025A6CC(COMUSIC_43_ENTER_LEVEL_GLITTER, 32000); + func_8025AABC(COMUSIC_43_ENTER_LEVEL_GLITTER); + func_8029E3C0(0, 0.4f); + func_80291FB8(0); + func_80291D04(); + break; + case 3: + comusic_8025AB44(COMUSIC_43_ENTER_LEVEL_GLITTER, 0, 2000); + func_8029E3C0(0, 0.55f); + break; + } + D_8037D438 = arg0; +} + +void func_802AE598(void) { + f32 plyr_pos[3]; + + player_getPosition(plyr_pos); + particleEmitter_setParticleAccelerationRange(D_8037D420.unk4, 0.0f, 700.0f, 0.0f, 0.0f, 1200.0f, 0.0f); + particleEmitter_setParticleSpawnPositionRange(D_8037D420.unk4, -45.0f, -5.0f, -45.0f, 45.0f, 10.0f, 45.0f); + particleEmitter_setPosition(D_8037D420.unk4, plyr_pos); + particleEmitter_emitN(D_8037D420.unk4, 1); + particleEmitter_setParticleAccelerationRange(D_8037D420.unk0, 0.0f, 700.0f, 0.0f, 0.0f, 1200.0f, 0.0f); + particleEmitter_setParticleSpawnPositionRange(D_8037D420.unk4, -45.0f, -5.0f, -45.0f, 45.0f, 10.0f, 45.0f); + particleEmitter_setPosition(D_8037D420.unk0, plyr_pos); + particleEmitter_emitN(D_8037D420.unk0, 1); + player_getPosition(plyr_pos); + plyr_pos[1] += 130.0f; + particleEmitter_setParticleAccelerationRange(D_8037D420.unk4, 0.0f, -700.0f, 0.0f, 0.0f, -1200.0f, 0.0f); + particleEmitter_setParticleSpawnPositionRange(D_8037D420.unk4, -45.0f, -10.0f, -45.0f, 45.0f, 10.0f, 45.0f); + particleEmitter_setPosition(D_8037D420.unk4, plyr_pos); + particleEmitter_emitN(D_8037D420.unk4, 1); + particleEmitter_setParticleAccelerationRange(D_8037D420.unk0, 0.0f, -700.0f, 0.0f, 0.0f, -1200.0f, 0.0f); + particleEmitter_setParticleSpawnPositionRange(D_8037D420.unk4, -45.0f, -10.0f, -45.0f, 45.0f, 10.0f, 45.0f); + particleEmitter_setPosition(D_8037D420.unk0, plyr_pos); + particleEmitter_emitN(D_8037D420.unk0, 1); +} + +void func_802AE7AC(ParticleEmitter *p_ctrl, enum asset_e sprite_id) { + func_802F0D54(p_ctrl); + particleEmitter_setSprite(p_ctrl, sprite_id); + func_802EFA5C(p_ctrl, 0.3f, 0.8f); + func_802EFB70(p_ctrl, 0.15f, 0.22f); + func_802EFB84(p_ctrl, 0.03f, 0.05f); + func_802EFE24(p_ctrl, 0.0f, 0.0f, 300.0f, 0.0f, 0.0f, 300.0f); + func_802EFEC0(p_ctrl, 0.55f, 0.55f); +} + +void func_802AE874(void) { + func_802F0C78(D_8037D420.unk4); + func_802F0C78(D_8037D420.unk0); +} + +void func_802AE8A4(void) { + D_8037D420.unk10 = 0.0f; + D_8037D420.unk8 = 0.0f; + D_8037D420.unkC = 1.0f; + D_8037D420.unk0 = partEmitList_pushNew(60); + func_802AE7AC(D_8037D420.unk0, ASSET_716_SPRITE_SPARKLE_WHITE); + D_8037D420.unk4 = partEmitList_pushNew(60); + func_802AE7AC(D_8037D420.unk4, ASSET_713_SPRITE_SPARKLE_YELLOW); +} + +void func_802AE914(void) { + D_8037D420.unk10 -= time_getDelta(); + while ( D_8037D420.unk10 < 0.0f) { + func_802AE598(); + D_8037D420.unk8 += 0.02 * (f64) D_8037D420.unkC; + D_8037D420.unk10 += 0.02; + } +} + +void func_802AE9C8(void) { + f32 anim_duration; + enum asset_e anim_id; + + func_8029BCF8(&anim_id, &anim_duration); + func_8028A010(anim_id, anim_duration); + func_8029C7F4(1, 1, 3, 7); + func_80294378(6); + func_802AE8A4(); + D_8037D438 = 0; + func_802AE4E0(1); +} + +void func_802AEA2C(void) { + s32 next_state; + s32 sp20; + u8 temp_v0; + + next_state = 0; + switch (D_8037D438) { + case 1: + func_802AE914(); + if (func_8029E1A8(0)) { + func_802AE4E0(2); + } + break; + case 2: + func_802AE914(); + sp20 = func_8029E1A8(0); + func_80291FB8((s32) ml_map_f(func_8029E270(0), 0.0f, 0.4f, 255.0f, 0.0f)); + if (sp20) { + func_802AE4E0(3); + } + break; + case 3: + if (func_8029E1A8(0)) { + next_state = bs_getIdleState(); + } + break; + } + bs_setState(next_state); +} + +void func_802AEB24(void){ + func_802AE874(); + func_80294378(1); + func_80291D04(); +} diff --git a/src/core2/code_27F40.c b/src/core2/code_27F40.c new file mode 100644 index 00000000..5806268c --- /dev/null +++ b/src/core2/code_27F40.c @@ -0,0 +1,78 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_8029B2D0(void); + +/* .code */ +void func_802AEED0(f32 arg0[3]) { + func_8028E9C4(5, arg0); +} + +void func_802AEEF4(void) { + f32 anim_duration; + f32 sp28[3]; + f32 sp1C[3]; + enum asset_e anim_id; + + func_80299D2C(SFX_12D_CAMERA_ZOOM_CLOSEST, 1.2f, 12000); + func_8029BCF8(&anim_id, &anim_duration); + func_8028A010(anim_id, anim_duration); + func_8029C7F4(1, 1, 3, 2); + func_80297970(0.0f); + func_80297A0C(0); + func_802BE8D8(); + func_802AEED0(sp28); + func_802C2A64(sp28); + player_getRotation(sp1C); + sp1C[0] = 0.0f; + sp1C[1] += 180.0f; + sp1C[2] = 0.0f; + func_802C2A8C(sp1C); + miscflag_set(0x17); +} + +void func_802AEFB0(void) { + s32 next_state; + f32 sp30[3]; + f32 sp24[3]; + f32 sp20; + s32 sp1C; + + next_state = 0; + sp20 = time_getDelta(); + if (func_802C2B00() == 2) { + func_802C2ADC(sp30); + sp30[0] -= func_8029B2DC() * 90.0f * sp20; + sp30[1] -= func_8029B2D0() * 90.0f * sp20; + sp30[2] = 0.0f; + sp30[0] = (sp30[0] > 180.0f) ? max_f(305.0f, sp30[0]) : min_f(70.0f, sp30[0]); + func_802C2A8C(sp30); + yaw_setIdeal(sp30[1] + 180.0f); + sp1C = 0; + if (button_pressed(BUTTON_B) || button_pressed(BUTTON_A) || button_pressed(BUTTON_C_UP)) { + sp1C = 1; + } + if (player_inWater()) { + if (player_getTransformation() == TRANSFORM_1_BANJO && func_8028EE84() == BSWATERGROUP_0_NONE) { + sp1C += 1; + } + } else if (func_8028B254(25) == 0) { + sp1C += 1; + } + if (sp1C) { + next_state = func_8029BDBC(); + } + } + func_802AEED0(sp24); + func_802C2A64(sp24); + bs_setState(next_state); +} + +void func_802AF164(void) { + if (func_80298850() == 0) { + func_80299D2C(SFX_12E_CAMERA_ZOOM_MEDIUM, 1.2f, 12000); + } + func_802BE91C(); + miscflag_clear(0x17); +} diff --git a/src/core2/code_28220.c b/src/core2/code_28220.c new file mode 100644 index 00000000..a27f45d8 --- /dev/null +++ b/src/core2/code_28220.c @@ -0,0 +1,136 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +struct { + ParticleEmitter *unk0; + ParticleEmitter *unk4; + f32 unk8; + f32 unkC; + f32 unk10; +}D_8037D450; +u8 D_8037D468; + +/* .code */ +void func_802AF1B0(s32 arg0) { + switch (arg0) { + case 1: + func_8029E3C0(0, 0.3f); + break; + case 2: + func_8025A6CC(COMUSIC_43_ENTER_LEVEL_GLITTER, 32000); + func_8025AABC(COMUSIC_43_ENTER_LEVEL_GLITTER); + func_8029E3C0(0, 0.4f); + break; + case 3: + func_80314B30(); + func_802921C8(0); + comusic_8025AB44(COMUSIC_43_ENTER_LEVEL_GLITTER, 0, 2000); + func_8029E3C0(0, 2.0f); + break; + } + D_8037D468 = arg0; +} + +void func_802AF268(void) { + f32 position[3]; + + player_getPosition(position); + particleEmitter_setParticleAccelerationRange(D_8037D450.unk4, 0.0f, 700.0f, 0.0f, 0.0f, 1200.0f, 0.0f); + particleEmitter_setPosition(D_8037D450.unk4, position); + particleEmitter_emitN(D_8037D450.unk4, 1); + particleEmitter_setParticleAccelerationRange(D_8037D450.unk0, 0.0f, 700.0f, 0.0f, 0.0f, 1200.0f, 0.0f); + particleEmitter_setPosition(D_8037D450.unk0, position); + particleEmitter_emitN(D_8037D450.unk0, 1); + position[1] += 130.0f; + particleEmitter_setParticleAccelerationRange(D_8037D450.unk4, 0.0f, -700.0f, 0.0f, 0.0f, -1200.0f, 0.0f); + particleEmitter_setPosition(D_8037D450.unk4, position); + particleEmitter_emitN(D_8037D450.unk4, 1); + particleEmitter_setParticleAccelerationRange(D_8037D450.unk0, 0.0f, -700.0f, 0.0f, 0.0f, -1200.0f, 0.0f); + particleEmitter_setPosition(D_8037D450.unk0, position); + particleEmitter_emitN(D_8037D450.unk0, 1); +} + +void func_802AF3B4(ParticleEmitter *p_ctrl, enum asset_e sprite_id) { + func_802F0D54(); + particleEmitter_setSprite(p_ctrl, sprite_id); + func_802EFA5C(p_ctrl, 0.3f, 0.8f); + particleEmitter_setParticleSpawnPositionRange(p_ctrl, -45.0f, 0.0f, -45.0f, 45.0f, 0.0f, 45.0f); + func_802EFB70(p_ctrl, 0.15f, 0.22f); + func_802EFB84(p_ctrl, 0.03f, 0.05f); + func_802EFE24(p_ctrl, 0.0f, 0.0f, 300.0f, 0.0f, 0.0f, 300.0f); + func_802EFEC0(p_ctrl, 0.55f, 0.55f); +} + +void func_802AF4B0(void) { + func_802F0C78(D_8037D450.unk4); + func_802F0C78(D_8037D450.unk0); +} + +void func_802AF4E0(void) { + D_8037D450.unk10 = 0.0f; + D_8037D450.unk8 = 0.0f; + D_8037D450.unkC = 1.0f; + D_8037D450.unk0 = partEmitList_pushNew(60); + func_802AF3B4(D_8037D450.unk0, ASSET_716_SPRITE_SPARKLE_WHITE); + D_8037D450.unk4 = partEmitList_pushNew(60); + func_802AF3B4(D_8037D450.unk4, ASSET_713_SPRITE_SPARKLE_YELLOW); +} + +void func_802AF550(void) { + D_8037D450.unk10 -= time_getDelta(); + while ( D_8037D450.unk10 < 0.0f) { + func_802AF268(); + D_8037D450.unk8 += 0.02 * (f64) D_8037D450.unkC; + D_8037D450.unk10 += 0.02; + } +} + +void func_802AF604(void){ + f32 anim_duration; + enum asset_e anim_id; + + func_8029BCF8(&anim_id, &anim_duration); + func_8028A010(anim_id, anim_duration); + func_8029C7F4(1,1,3,7); + func_80294378(6); + func_802AF4E0(); + D_8037D468 = 0; + func_802AF1B0(1); +} + +void func_802AF668(void) { + s32 next_state; + bool sp20; + + next_state = 0; + switch (D_8037D468) { + case 1: + func_802AF550(); + if (func_8029E1A8(0)) { + func_802AF1B0(2); + } + break; + case 2: + func_802AF550(); + sp20 = func_8029E1A8(0); + func_80291FB8((s32) ml_map_f(func_8029E270(0), 0.0f, 0.4f, 0.0f, 255.0f)); + if (sp20) { + func_802AF1B0(3); + } + break; + case 3: + if (func_8029E1A8(0)) { + next_state = bs_getIdleState(); + } + break; + } + bs_setState(next_state); +} + +void func_802AF768(void){ + func_802AF4B0(); + func_80294378(1); + func_80291D04(); +} diff --git a/src/core2/code_2890.c b/src/core2/code_2890.c new file mode 100644 index 00000000..787dd28f --- /dev/null +++ b/src/core2/code_2890.c @@ -0,0 +1,290 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_802E4B38(void); +extern f32 func_80257BFC(f32, f32, f32, f32, f32); + +void func_80289F30(void); + +/* .data */ +f32 D_803635E0[3] = {0.0f, 5.0f, 0.0f}; +s32 D_803635EC[7] = {0x4, 0x3, 0x60, 0x18, 0x1B, 0x67, 0x80}; + +/* .bss */ +AnimCtrl *D_8037BF20; +s32 D_8037BF24; +f32 D_8037BF28; +f32 D_8037BF2C; +struct { + f32 unk0; + f32 unk4; + f32 unk8; + f32 unkC; + f32 unk10; + u8 unk14; +}D_8037BF30; +void (*D_8037BF48)(s32, s32); + +/* .code */ +void func_80289820(s32 arg0){ + D_8037BF24 = arg0; +} + +void func_8028982C(void) { + f32 sp2C[3]; + f32 temp_f12; + f32 sp24; + + sp24 = (D_8037BF30.unk14 != 0) ? D_8037BF30.unk10 : 1.0f; + _get_velocity(sp2C); + temp_f12 = func_80257BFC(gu_sqrtf(sp2C[0]*sp2C[0] + sp2C[2] * sp2C[2]), D_8037BF30.unk0, D_8037BF30.unk4, D_8037BF30.unk8 * sp24, D_8037BF30.unkC * sp24); + animctrl_setDuration(D_8037BF20, mlClamp_f(temp_f12, D_8037BF28, D_8037BF2C)); + animctrl_update(D_8037BF20); +} + +void func_802898F8(void) { + animctrl_setDuration(D_8037BF20, mlClamp_f(func_80257BFC(mlAbsF(func_80297AAC()), D_8037BF30.unk0, D_8037BF30.unk4, D_8037BF30.unk8, D_8037BF30.unkC), D_8037BF28, D_8037BF2C)); + animctrl_update(D_8037BF20); +} + + +void func_80289978(f32 sp2C[3], f32 arg1, f32 arg2, f32 arg3) { + s32 phi_s0; + + for(phi_s0 = 0; phi_s0 < 3; phi_s0++){ + sp2C[phi_s0] = ((((f64) sinf((f32) ((f64) func_80257A44((f32) ( arg1 + (2.0 * ((f64) (f32) phi_s0 / 3.0))), 2.0f) * 6.2831853080000002)) * 0.5) + 0.5) * arg3) + arg2; + }; +} + +void func_80289A78(s32 arg0, s32 arg1) { + f32 sp2C[3]; + f32 sp28; + s32 phi_s0; + static s32 D_8037BF4C; + + + sp28 = func_802E4B38(); + if (func_803203FC(0x78) == 0) { + D_8037BF4C = 0; + } else { + for(phi_s0 = 0; phi_s0 < 7; phi_s0++){ + if (func_803203FC(phi_s0 + 0x97)) { + D_8037BF4C = D_803635EC[phi_s0]; + } + } + } + if ((D_8037BF4C & 1)) { + func_80289978(sp2C, sp28, 2.0f, 1.0f); + func_8033A928(arg0, 6, sp2C); + func_8033A928(arg0, 0x14, sp2C); + } + if (D_8037BF4C & 2) { + func_80289978(sp2C, sp28, 2.0f, 1.0f); + func_8033A928(arg0, 0x10, sp2C); + func_8033A928(arg0, 0x1E, sp2C); + } + if (D_8037BF4C & 4) { + func_80289978(sp2C, sp28, 2.0f, 1.0f); + func_8033A928(arg0, 0x12, sp2C); + } + if (D_8037BF4C & 8) { + func_80289978(sp2C, sp28, 0.2f, 0.5f); + func_8033A928(arg0, 0x12, sp2C); + } + if (D_8037BF4C & 0x10) { + func_8033A968(arg0, 1, &D_803635E0); + } + if (D_8037BF4C & 0x20) { + func_80289978(sp2C, sp28, 2.0f, 1.0f); + func_8033A928(arg0, 0x6C, sp2C); + } + if (D_8037BF4C & 0x40) { + func_80289978(sp2C, sp28, 2.0f, 1.0f); + func_8033A928(arg0, 0x64, sp2C); + func_8033A928(arg0, 0x67, sp2C); + } + if (map_get() == MAP_A_TTC_SANDCASTLE) { + if ((D_8037BF4C & 0x80) && (player_getTransformation() != TRANSFORM_7_WISHWASHY)) { + func_8028FB88(7); + } + if (!(D_8037BF4C & 0x80) && (player_getTransformation() == TRANSFORM_7_WISHWASHY)) { + func_8028FB88(1); + } + } + if (D_8037BF48 != NULL) { + D_8037BF48(arg0, arg1); + } +} + +void func_80289D1C(void){ + D_8037BF20 = animctrl_new(1); + func_80287784(D_8037BF20, 0); + animctrl_setSmoothTransition(D_8037BF20, FALSE); + func_8028746C(D_8037BF20, func_80289A78); + D_8037BF48 = NULL; + func_80289F30(); + D_8037BF24 = 0; + func_80289820(1); + func_80289EA8(0.01f, 100.0f); + func_80289EC8(0.0f, 1000.0f, 0.1f, 10.0f); + D_8037BF30.unk14 = 0; + D_8037BF30.unk10 = 1.0f; +} + +void func_80289DDC(void){ + animctrl_free(D_8037BF20); +} + +void func_80289E00(void){ + switch(D_8037BF24){ + case 2: + func_8028982C(); + break; + + case 3: + func_802898F8(); + break; + + case 1: + animctrl_update(D_8037BF20); + break; + + case 0: + break; + } +} + +void func_80289E74(void){ + D_8037BF20 = animctrl_defrag(D_8037BF20); +} + +s32 func_80289E9C(void){ + return D_8037BF24; +} + +void func_80289EA8(f32 arg0, f32 arg1){ + D_8037BF28 = arg0; + D_8037BF2C = arg1; +} + +void func_80289EBC(void (*arg0)(s32, s32)){ + D_8037BF48 = arg0; +} + +void func_80289EC8(f32 arg0, f32 arg1, f32 arg2, f32 arg3){ + D_8037BF30.unk0 = arg0; + D_8037BF30.unk4 = arg1; + D_8037BF30.unk8 = arg2; + D_8037BF30.unkC = arg3; + D_8037BF30.unk14 = 0; +} + +void func_80289EF8(f32 arg0){ + D_8037BF30.unk10 = arg0; + D_8037BF30.unk14 = 1; +} + +void func_80289F10(s32 arg0){ + func_80289820(arg0); +} + +void func_80289F30(void){ + f32 sp1C[3]; + + _player_getPosition(sp1C); + func_8028781C(D_8037BF20, sp1C, 1); +} + +AnimCtrl *_player_getAnimCtrlPtr(void){ + return D_8037BF20; +} + +f32 func_80289F70(void){ + return animctrl_getAnimTimer(D_8037BF20); +} + +bool func_80289F94(enum asset_e anim_id){ + return animctrl_getIndex(D_8037BF20) == anim_id; +} + +bool baanim_isStopped(void){ + return animctrl_isStopped(D_8037BF20); +} + +bool baanim_isAt(f32 time){ + return animctrl_isAt(D_8037BF20, time); +} + +void func_8028A010(enum asset_e anim_id, f32 duration){ + animctrl_reset(D_8037BF20); + animctrl_setIndex(D_8037BF20, anim_id); + animctrl_setDuration(D_8037BF20, duration); + animctrl_setPlaybackType(D_8037BF20, 2); + func_802875AC(D_8037BF20, "baanim.c", 0x188); +} + +void func_8028A084(enum asset_e anim_id, f32 duration){ + animctrl_reset(D_8037BF20); + animctrl_setSmoothTransition(D_8037BF20, FALSE); + animctrl_setIndex(D_8037BF20, anim_id); + animctrl_setDuration(D_8037BF20, duration); + animctrl_setPlaybackType(D_8037BF20, 2); + func_802875AC(D_8037BF20, "baanim.c", 0x193); +} + +void func_8028A100(enum asset_e anim_id, f32 duration, f32 arg2){ + animctrl_reset(D_8037BF20); + animctrl_setIndex(D_8037BF20, anim_id); + animctrl_setDuration(D_8037BF20, duration); + func_8028774C(D_8037BF20, arg2); + animctrl_setPlaybackType(D_8037BF20, 2); + func_802875AC(D_8037BF20, "baanim.c", 0x19e); +} + +void func_8028A180(enum asset_e anim_id, f32 duration){ + animctrl_reset(D_8037BF20); + animctrl_setIndex(D_8037BF20, anim_id); + animctrl_setDuration(D_8037BF20, duration); + animctrl_setPlaybackType(D_8037BF20, 1); + func_802875AC(D_8037BF20, "baanim.c", 0x1a8); +} + +void func_8028A1F4(enum asset_e anim_id, f32 duration, f32 arg2){ + animctrl_reset(D_8037BF20); + animctrl_setIndex(D_8037BF20, anim_id); + animctrl_setDuration(D_8037BF20, duration); + func_8028774C(D_8037BF20, arg2); + animctrl_setPlaybackType(D_8037BF20, 1); + func_802875AC(D_8037BF20, "baanim.c", 0x1b3); +} + +void func_8028A274(enum asset_e anim_id, f32 duration){ + animctrl_reset(D_8037BF20); + animctrl_setSmoothTransition(D_8037BF20, FALSE); + animctrl_setIndex(D_8037BF20, anim_id); + animctrl_setDuration(D_8037BF20, duration); + animctrl_setPlaybackType(D_8037BF20, 1); + func_802875AC(D_8037BF20, "baanim.c", 0x1bd); +} + +void func_8028A2F0(enum asset_e anim_id, f32 duration, f32 arg2){ + animctrl_reset(D_8037BF20); + animctrl_setSmoothTransition(D_8037BF20, FALSE); + animctrl_setIndex(D_8037BF20, anim_id); + animctrl_setDuration(D_8037BF20, duration); + func_8028774C(D_8037BF20, arg2); + animctrl_setPlaybackType(D_8037BF20, 1); + func_802875AC(D_8037BF20, "baanim.c", 0x1c9); +} + +void func_8028A37C(f32 arg0){ + animctrl_setSubRange(D_8037BF20, 0.0f, arg0); + animctrl_setPlaybackType(D_8037BF20, 1); +} + +void func_8028A3B8(f32 arg0, f32 arg1){ + animctrl_setSubRange(D_8037BF20, 0.0f, arg0); + animctrl_setDuration(D_8037BF20, arg1); + animctrl_setPlaybackType(D_8037BF20, 1); +} diff --git a/src/core2/code_32DB0.c b/src/core2/code_32DB0.c new file mode 100644 index 00000000..ed137701 --- /dev/null +++ b/src/core2/code_32DB0.c @@ -0,0 +1,171 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + s32 unk0:24; + s32 unk3:8; + s32 unk4; +} Struct_Core2_32DB0_0s; + +void func_802B9E00(s32 arg0); +s32 func_802B9EA8(s32 arg0); +void func_802B9EBC(s32 arg0, s32 arg1); + +/* .bss */ +Struct_Core2_32DB0_0s D_8037D5E0[0x46]; + +/* .code */ +void func_802B9D40(void){ + int i; + for(i = 0; i< 0x46; i++){ + D_8037D5E0[i].unk3 = 0; + } +} + +void func_802B9D80(void){ + int i; + + for(i=0; i< 0x46; i++){ + if(func_802B9EA8(i)) + func_802B9E00(i); + } +} + +void func_802B9DD0(s32 arg0){ + D_8037D5E0[arg0].unk3 = 1; + D_8037D5E0[arg0].unk0 = 0; + +} + +void func_802B9E00(s32 arg0){ + func_802B9EBC(arg0, 0); + D_8037D5E0[arg0].unk3 = 0; +} + +s32 func_802B9E34(s32 arg0){ + return D_8037D5E0[arg0].unk4; +} + +s32 func_802B9E48(s32 arg0){ + return D_8037D5E0[arg0].unk4; +} + +s32 func_802B9E5C(s32 arg0){ + return D_8037D5E0[arg0].unk4; +} + +s32 func_802B9E70(s32 arg0){ + return D_8037D5E0[arg0].unk4; +} + +s32 func_802B9E84(void){ + return 0x46; +} + +s32 func_802B9E8C(s32 arg0){ + return D_8037D5E0[arg0].unk0; +} + +s32 func_802B9EA8(s32 arg0){ + return D_8037D5E0[arg0].unk3; +} + +void func_802B9EBC(s32 arg0, s32 arg1){ + if(arg1 == D_8037D5E0[arg0].unk0) + return; + switch(D_8037D5E0[arg0].unk0){ + case 4:// L802B9F08 + func_802BA214(D_8037D5E0[arg0].unk4); + break; + case 3:// L802B9F18 + func_802BA398(D_8037D5E0[arg0].unk4); + break; + case 1:// L802B9F28 + func_802BA76C(D_8037D5E0[arg0].unk4); + break; + case 2:// L802B9F38 + func_802BAA88(D_8037D5E0[arg0].unk4); + break; + case 0:// L802B9F40 + break; + } + D_8037D5E0[arg0].unk0 = arg1; + switch (arg1) + { + case 4:// L802B9F80 + D_8037D5E0[arg0].unk4 = func_802BA1E0(); + break; + case 3:// L802B9F90 + D_8037D5E0[arg0].unk4 = func_802BA2F4(); + break; + case 1:// L802B9FA0 + D_8037D5E0[arg0].unk4 = func_802BA6D4(); + break; + case 2:// L802B9FB0 + D_8037D5E0[arg0].unk4 = func_802BAA40(); + break; + case 0:// L802B9FBC + break; + } + +} + +void func_802B9FD0(Struct61s *file_ptr, s32 arg1){ + u8 sp27; + func_802B9DD0(arg1); + func_8034B040(file_ptr, 2, &sp27); + func_802B9EBC(arg1, sp27); + switch(func_802B9E8C(arg1)){ + case 4:// L802BA030 + func_802BA244(file_ptr, func_802B9E34(arg1)); + break; + case 3:// L802BA04C + func_802BA550(file_ptr, func_802B9E48(arg1)); + break; + case 1:// L802BA068 + func_802BA93C(file_ptr, func_802B9E5C(arg1)); + break; + case 2:// L802BA084 + func_802BAB3C(file_ptr, func_802B9E70(arg1)); + break; + case 0:// L802BA098 + break; + } +} + +void func_802BA0AC(Struct61s *file_ptr){ + s16 sp26; + func_802B9D80(); + func_802B9D40(); + while(!func_8034AF98(file_ptr, 0)){ + if(func_8034B220(file_ptr, 1, &sp26)) + func_802B9FD0(file_ptr, sp26); + } + +} + +void func_802BA128(void){ + int i; + for(i = 0; i< 0x46; i++){ + if(D_8037D5E0[i].unk3){ + switch(D_8037D5E0[i].unk0){ + case 4:// L802BA17C + D_8037D5E0[i].unk4 = defrag(D_8037D5E0[i].unk4); + break; + case 3:// L802BA18C + D_8037D5E0[i].unk4 = defrag(D_8037D5E0[i].unk4); + break; + case 1:// L802BA19C + D_8037D5E0[i].unk4 = defrag(D_8037D5E0[i].unk4); + break; + case 2:// L802BA1AC + D_8037D5E0[i].unk4 = defrag(D_8037D5E0[i].unk4); + break; + case 0:// L802BA1B8 + break; + } + } + } +} + diff --git a/src/core2/code_33250.c b/src/core2/code_33250.c new file mode 100644 index 00000000..55fce822 --- /dev/null +++ b/src/core2/code_33250.c @@ -0,0 +1,33 @@ +#include +#include "functions.h" +#include "variables.h" + + + +void func_802BA23C(s32 *arg0, s32 arg1); + +/* .code */ +s32 * func_802BA1E0(void){ + s32 * sp1C = malloc(4); + func_802BA23C(sp1C, 1); + return sp1C; +} + +void func_802BA214(s32 *arg0){ + free(arg0); +} + +s32 func_802BA234(s32 *arg0){ + return *arg0; +} + +void func_802BA23C(s32 *arg0, s32 arg1){ + *arg0 = arg1; +} + +void func_802BA244(Struct61s *file_ptr, s32 *arg1){ + while(!func_8034AF98(file_ptr, 0)){ + func_8034B150(file_ptr, 1, arg1); + } +} + diff --git a/src/core2/code_33310.c b/src/core2/code_33310.c new file mode 100644 index 00000000..874a8870 --- /dev/null +++ b/src/core2/code_33310.c @@ -0,0 +1,154 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + f32 unk0[3]; + f32 unkC; + f32 unk10; + f32 unk14; + f32 unk18; + f32 unk1C; + f32 unk20; + f32 unk24[3]; + s32 unk30; +}Struct_core2_33310; + + +void func_802BA3E8(Struct_core2_33310 *arg0, f32 arg1[3]); +void func_802BA414(Struct_core2_33310 *arg0, f32 arg1); +void func_802BA428(Struct_core2_33310 *arg0, f32 arg1); +void func_802BA460(Struct_core2_33310 *arg0, f32 arg1[3]); +void func_802BA494(Struct_core2_33310 *arg0, f32 arg1, f32 arg2); +void func_802BA4BC(Struct_core2_33310 *arg0, f32 arg1, f32 arg2); +void func_802BA510(Struct_core2_33310 *arg0, bool arg1); +void func_802BA530(Struct_core2_33310 *arg0, bool arg1); + +/* .code */ +void func_802BA2A0(Struct_core2_33310 *arg0, bool arg1, s32 arg2){ + if(arg1){ + arg0->unk30 |= arg2; + } + else{ + arg0->unk30 &= ~arg2; + } +} + +bool func_802BA2D0(Struct_core2_33310 *arg0, s32 arg1){ + if(arg0->unk30 & arg1) + return TRUE; + return FALSE; +} + +Struct_core2_33310 *func_802BA2F4(void){ + Struct_core2_33310 * this; + f32 sp20[3]; + + this = (Struct_core2_33310 *)malloc(sizeof(Struct_core2_33310)); + ml_vec3f_clear(sp20); + func_802BA460(this, sp20); + func_802BA3E8(this, sp20); + func_802BA494(this, 2.84f, 5.68f); + func_802BA4BC(this, 4.0f, 16.0f); + func_802BA428(this, 1000.0f); + func_802BA414(this, 1000.0f); + func_802BA530(this, FALSE); + func_802BA510(this, FALSE); + return this; +} + +void func_802BA398(Struct_core2_33310 *arg0){ + free(arg0); +} + +void func_802BA3B8(Struct_core2_33310 *arg0, f32 arg1[3]){ + ml_vec3f_add(arg1, arg0->unk0, arg0->unk24); +} + +void func_802BA3E8(Struct_core2_33310 *arg0, f32 arg1[3]){ + ml_vec3f_diff_copy(arg0->unk24, arg1, arg0->unk0); +} + +f32 func_802BA40C(Struct_core2_33310 *arg0){ + return arg0->unk20; +} + +void func_802BA414(Struct_core2_33310 *arg0, f32 arg1){ + arg0->unk20 = arg1; +} + +f32 func_802BA420(Struct_core2_33310 *arg0){ + return arg0->unk1C; +} + +void func_802BA428(Struct_core2_33310 *arg0, f32 arg1){ + arg0->unk1C = arg1; +} + +void func_802BA434(Struct_core2_33310 *arg0, f32 arg1[3]){ + ml_vec3f_copy(arg1, arg0->unk0); +} + +void func_802BA460(Struct_core2_33310 *arg0, f32 arg1[3]){ + ml_vec3f_copy(arg0->unk0, arg1); +} + +void func_802BA480(Struct_core2_33310 *arg0, f32 *arg1, f32 *arg2){ + *arg1 = arg0->unkC; + *arg2 = arg0->unk10; +} + +void func_802BA494(Struct_core2_33310 *arg0, f32 arg1, f32 arg2){ + arg0->unkC = arg1; + arg0->unk10 = arg2; +} + +void func_802BA4A8(Struct_core2_33310 *arg0, f32 *arg1, f32 *arg2){ + *arg1 = arg0->unk14; + *arg2 = arg0->unk18; +} + +void func_802BA4BC(Struct_core2_33310 *arg0, f32 arg1, f32 arg2){ + arg0->unk14 = arg1; + arg0->unk18 = arg2; +} + +bool func_802BA4D0(Struct_core2_33310 *arg0){ + return func_802BA2D0(arg0, 4); +} + +bool func_802BA4F0(Struct_core2_33310 *arg0){ + return func_802BA2D0(arg0, 1); +} + +void func_802BA510(Struct_core2_33310 *arg0, bool arg1){ + func_802BA2A0(arg0, arg1, 4); +} + +void func_802BA530(Struct_core2_33310 *arg0, bool arg1){ + func_802BA2A0(arg0, arg1, 1); +} + +void func_802BA550(Struct61s *file_ptr, Struct_core2_33310 *arg1){ + while(!func_8034AF98(file_ptr, 0)){ + if(!func_8034B108(file_ptr, 1, arg1->unk0, 3)){ + if(func_8034AF98(file_ptr, 2)){ + func_8034AD20(file_ptr, &arg1->unkC); + func_8034AD20(file_ptr, &arg1->unk10); + } + else if(func_8034AF98(file_ptr, 3)){ + func_8034AD20(file_ptr, &arg1->unk14); + func_8034AD20(file_ptr, &arg1->unk18); + } + else if(func_8034AF98(file_ptr, 6)){ + func_8034AD20(file_ptr, &arg1->unk1C); + func_8034AD20(file_ptr, &arg1->unk20); + } + else{ + if(!func_8034B108(file_ptr, 4, arg1->unk24, 3)){ + func_8034B150(file_ptr, 5, &arg1->unk30); + } + } + }//L802BA654 + } +} diff --git a/src/core2/code_336F0.c b/src/core2/code_336F0.c new file mode 100644 index 00000000..8a907452 --- /dev/null +++ b/src/core2/code_336F0.c @@ -0,0 +1,133 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + f32 unk0[3]; + f32 unkC; + f32 unk10; + f32 unk14; + f32 unk18; + f32 unk1C[3]; + s32 unk28; +} Struct_core2_336F0; + +void func_802BA7B8(Struct_core2_336F0 *arg0, f32 arg1[3]); +void func_802BA808(Struct_core2_336F0 *arg0, f32 arg1[3]); +void func_802BA840(Struct_core2_336F0 *arg0, f32 arg1, f32 arg2); +void func_802BA868(Struct_core2_336F0 *arg0, f32 arg1, f32 arg2); +void func_802BA8DC(Struct_core2_336F0 *arg0, s32 arg1); +void func_802BA8FC(Struct_core2_336F0 *arg0, s32 arg1); +void func_802BA91C(Struct_core2_336F0 *arg0, s32 arg1); + +void func_802BA680(Struct_core2_336F0 *arg0, s32 arg1, s32 arg2){ + if(arg1){ + arg0->unk28 |= arg2; + }else{ + arg0->unk28 &= ~arg2; + } +} + +bool func_802BA6B0(Struct_core2_336F0 *arg0, s32 arg1){ + if (arg0->unk28 & arg1) + return TRUE; + return FALSE; +} + +Struct_core2_336F0 *func_802BA6D4(void){ + Struct_core2_336F0 *this; + f32 sp20[3]; + + this = (Struct_core2_336F0 *)malloc(sizeof(Struct_core2_336F0)); + ml_vec3f_clear(sp20); + func_802BA7B8(this, sp20); + func_802BA808(this, sp20); + func_802BA840(this, 0.7f, 2.33f); + func_802BA868(this, 4.0f, 16.0f); + func_802BA8DC(this, 0); + func_802BA91C(this, 1); + func_802BA8FC(this, 0); + return this; +} + +void func_802BA76C(Struct_core2_336F0 *arg0){ + free(arg0); +} + +void func_802BA78C(Struct_core2_336F0 *arg0, f32 arg1[3]){ + ml_vec3f_copy(arg1, arg0->unk0); +} + +void func_802BA7B8(Struct_core2_336F0 *arg0, f32 arg1[3]){ + ml_vec3f_copy(arg0->unk0, arg1); +} + +void func_802BA7D8(Struct_core2_336F0 *arg0, f32 arg1[3]){ + ml_vec3f_add(arg1, arg0->unk0, arg0->unk1C); +} + +void func_802BA808(Struct_core2_336F0 *arg0, f32 arg1[3]){ + ml_vec3f_diff_copy(arg0->unk1C, arg1, arg0->unk0); +} + +void func_802BA82C(Struct_core2_336F0 *arg0, f32 *arg1, f32 *arg2){ + *arg1 = arg0->unkC; + *arg2 = arg0->unk10; +} + +void func_802BA840(Struct_core2_336F0 *arg0, f32 arg1, f32 arg2){ + arg0->unkC = arg1; + arg0->unk10 = arg2; +} + +void func_802BA854(Struct_core2_336F0 *arg0, f32 *arg1, f32 *arg2){ + *arg1 = arg0->unk14; + *arg2 = arg0->unk18; +} + +void func_802BA868(Struct_core2_336F0 *arg0, f32 arg1, f32 arg2){ + arg0->unk14 = arg1; + arg0->unk18 = arg2; +} + +bool func_802BA87C(Struct_core2_336F0 *arg0){ + return func_802BA6B0(arg0, 1); +} + +bool func_802BA89C(Struct_core2_336F0 *arg0){ + return func_802BA6B0(arg0, 4); +} + +bool func_802BA8BC(Struct_core2_336F0 *arg0){ + return func_802BA6B0(arg0, 2); +} + +void func_802BA8DC(Struct_core2_336F0 *arg0, s32 arg1){ + func_802BA680(arg0, arg1, 1); +} + +void func_802BA8FC(Struct_core2_336F0 *arg0, s32 arg1){ + func_802BA680(arg0, arg1, 4); +} + +void func_802BA91C(Struct_core2_336F0 *arg0, s32 arg1){ + func_802BA680(arg0, arg1, 2); +} + +void func_802BA93C(Struct61s *file_ptr, Struct_core2_336F0 *arg1){ + while(!func_8034AF98(file_ptr, 0)){ + if(!func_8034B108(file_ptr, 1, arg1->unk0, 3)){ + if(func_8034AF98(file_ptr, 2)){ + func_8034AD20(file_ptr, &arg1->unkC); + func_8034AD20(file_ptr, &arg1->unk10); + } + else if(func_8034AF98(file_ptr, 3)){ + func_8034AD20(file_ptr, &arg1->unk14); + func_8034AD20(file_ptr, &arg1->unk18); + } + else if(!func_8034B108(file_ptr, 4, arg1->unk1C, 3)){ + func_8034B150(file_ptr, 5, &arg1->unk28); + } + }//L802BAA0C + } +} diff --git a/src/core2/code_33AB0.c b/src/core2/code_33AB0.c new file mode 100644 index 00000000..16840018 --- /dev/null +++ b/src/core2/code_33AB0.c @@ -0,0 +1,52 @@ +#include +#include "functions.h" +#include "variables.h" + + +typedef struct { + f32 unk0[3]; + f32 unkC[3]; +} Struct_core2_33AB0_0; + +void func_802BAAD4(Struct_core2_33AB0_0 *this, f32 src[3]); +void func_802BAB1C(Struct_core2_33AB0_0 *this, f32 src[3]); + +/* .code */ +Struct_core2_33AB0_0 *func_802BAA40(void){ + Struct_core2_33AB0_0 *this; + f32 sp18[3]; + + this = (Struct_core2_33AB0_0 *)malloc(sizeof(Struct_core2_33AB0_0)); + ml_vec3f_clear(sp18); + func_802BAAD4(this, sp18); + func_802BAB1C(this, sp18); + return this; +} + +void func_802BAA88(Struct_core2_33AB0_0 *this){ + free(this); +} + +void func_802BAAA8(Struct_core2_33AB0_0 *this, f32 dst[3]){\ + ml_vec3f_copy(dst, this->unk0); +} + +void func_802BAAD4(Struct_core2_33AB0_0 *this, f32 src[3]){ + ml_vec3f_copy(this->unk0, src); +} + +void func_802BAAF4(Struct_core2_33AB0_0 *this, f32 dst[3]){\ + ml_vec3f_copy(dst, this->unkC); +} + +void func_802BAB1C(Struct_core2_33AB0_0 *this, f32 src[3]){ + ml_vec3f_copy(this->unkC, src); +} + +void func_802BAB3C(Struct61s *file_ptr, Struct_core2_33AB0_0 *arg1){ + while(!func_8034AF98(file_ptr, 0)){ + if(!func_8034B108(file_ptr, 1, arg1->unk0, 3)){ + func_8034B108(file_ptr, 2, arg1->unkC, 3); + }//L802BAA0C + } +} diff --git a/src/core2/code_33C30.c b/src/core2/code_33C30.c new file mode 100644 index 00000000..db8007f2 --- /dev/null +++ b/src/core2/code_33C30.c @@ -0,0 +1,45 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802BEA4C(f32[3], f32[3], f32, f32[3]); +extern ActorProp *func_80320EB0(ActorMarker *, f32, s32); + +/* .bss */ +ActorMarker *D_8037D810; + +/* .code */ +Actor *func_802BABC0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + return NULL; +} + +void func_802BABD8(void){ + if(D_8037D810 != NULL){ + marker_free(D_8037D810); + D_8037D810 = NULL; + } +} + +void func_802BAC10(void){ + D_8037D810 = NULL; +} + +bool func_802BAC1C(void) { + return (func_80320EB0(D_8037D810, 100.0f, 1) != NULL) ? TRUE : FALSE; +} + +void func_802BAC58(void) { + f32 sp34[3]; + f32 sp28[3]; + f32 sp1C[3]; + + func_8024C5CC(sp34); + func_8024C764(sp28); + func_802BEA4C(sp28, sp34, 150.0f, sp1C); + if (D_8037D810 == NULL) { + D_8037D810 = func_8032FBE4(sp1C, func_802BABC0, 1, 0x15D); + } + else{ + func_8032F64C(sp1C, D_8037D810); + } +} diff --git a/src/core2/code_33D40.c b/src/core2/code_33D40.c new file mode 100644 index 00000000..073d6ae2 --- /dev/null +++ b/src/core2/code_33D40.c @@ -0,0 +1,71 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8025727C(f32, f32, f32, f32, f32, f32, f32*, f32*); + +/* .bss */ +f32 D_8037D820[4]; +f32 D_8037D830[4]; + +/* .code */ +void func_802BACD0(void){ + ml_vec3f_clear(D_8037D820); + ml_vec3f_clear(D_8037D830); +} + +void func_802BAD00(void){} + +void func_802BAD08(f32 arg0[3]){ + func_8025727C( + arg0[0], arg0[1], arg0[2], + D_8037D820[0], D_8037D820[1], D_8037D820[2], + &D_8037D830[0], &D_8037D830[1] + ); + D_8037D830[0] = mlNormalizeAngle(-D_8037D830[0]); + D_8037D830[2] = 0.0f; +} + +void func_802BAD84(f32 arg0[3]){ + ml_vec3f_copy(D_8037D820, arg0); +} + +void func_802BADAC(void){ + func_8024CD88(D_8037D820); + func_8024CE18(D_8037D830); +} + +void func_802BADDC(s32 arg0){ + UNK_TYPE(s32) sp1C; + + sp1C = func_802B9E70(arg0); + func_802BAAA8(sp1C, D_8037D820); + func_802BAAF4(sp1C, D_8037D830); +} + +void set_camera_to_node(s32 arg0){ + func_802BBC58(3); + func_802BADDC(arg0); +} + +void func_802BAE4C(void){ + func_802BBC58(2); +} + +void func_802BAE6C(f32 arg0[3], f32 arg1[3]){ + func_802BBC58(3); + ml_vec3f_copy(D_8037D820, arg0); + ml_vec3f_copy(D_8037D830, arg1); +} + +void func_802BAEB4(f32 arg0[3], f32 arg1[3]){ + func_802BBC58(3); + ml_vec3f_copy(D_8037D820, arg0); + func_802BAD08(arg1); +} + +void func_802BAEF4(f32 dst[3]){ + dst[0] = D_8037D820[0]; + dst[1] = D_8037D820[1]; + dst[2] = D_8037D820[2]; +} diff --git a/src/core2/code_33F90.c b/src/core2/code_33F90.c new file mode 100644 index 00000000..40ba1fdf --- /dev/null +++ b/src/core2/code_33F90.c @@ -0,0 +1,132 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80250E6C(f32, f32); +extern void func_80258E60(f32[3], f32[3], f32); +extern void func_80258EF4(f32[3], f32[3], f32); +extern void func_80258F88(f32[3], f32[3], f32); +extern void func_802BE720(void); + +typedef struct { + f32 unk0; + f32 unk4; + f32 unk8; + f32 unkC; + f32 unk10; + f32 unk14; + f32 unk18; + u8 unk1C; + // u8 pad1D[3]; +}Struct_core2_33F90_0; + +void func_802BB200(void); +void func_802BB22C(void); +void func_802BB318(s32 arg0); +void func_802BB360(s32 arg0, f32 arg1); +void func_802BB3AC(s32 arg0, f32 arg1); + +/* .data */ +extern s32 D_80364E00; +extern s32 D_80364E04; +extern s16 *D_803654B8[]; + +/* .code */ +void func_802BAF20(void){ + func_802BB200(); +} + +void func_802BAF40(void){ + if(D_80364E00 && timedFuncQueue_is_empty()){ + func_802BB200(); + } +} + +void func_802BAF80(s32 arg0){ + func_802BE720(); +} + +f32 func_802BAFA0(s32 arg0, s32 arg1){ + return (f32)D_803654B8[arg0][arg1]/10.0; +} + +void func_802BAFE4(s32 arg0) { + f32 temp_f0; + s32 phi_s1; + s32 phi_s0; + + phi_s0 = 0; + if (arg0 != D_80364E04) { + D_80364E04 = arg0; + func_802BB22C(); + D_80364E00 = 1; + for(phi_s1 = 0; D_803654B8[arg0][phi_s1] != -1 && D_803654B8[arg0][phi_s1] != -4; phi_s1+=2){ + temp_f0 = func_802BAFA0(arg0, phi_s1); + switch(D_803654B8[arg0][phi_s1 + 1]){ + case -5: + timedFunc_set_6(temp_f0, (TFQM6) func_802BAF80, NULL); + phi_s0++; + break; + + case -3: + func_80324E38(temp_f0, 1); + phi_s0++; + break; + + case -2: + func_80324E38(temp_f0, 2); + phi_s0++; + break; + + case -1: + func_80324E38(temp_f0, 3); + phi_s0++; + break; + + case -4: + func_80324E38(temp_f0, 4); + break; + + case -6: + func_80324E38(temp_f0, 4); + break; + + default: + timed_setCameraToNode(temp_f0, D_803654B8[arg0][phi_s1 + 1]); + break; + } + } + temp_f0 = func_802BAFA0(arg0, phi_s1 + 1); + if (D_803654B8[arg0][phi_s1] == -4) { + func_80324E38(temp_f0, 4); + } else { + func_80324E88(temp_f0); + } + for(phi_s1 = 0; phi_s1 < phi_s0; phi_s1++){ + func_80324E38(temp_f0, 0); + } + } +} + +void func_802BB200(void){ + if(D_80364E00){ + D_80364E00 = FALSE; + D_80364E04 = -1; + } +} + +void func_802BB22C(void){ + if(D_80364E00){ + timedFuncQueue_flush(); + D_80364E00 = FALSE; + D_80364E04 = -1; + } +} + +bool func_802BB270(void){ + return (!D_80364E00) ? TRUE : FALSE; +} + +s32 func_802BB294(void){ + return D_80364E04; +} diff --git a/src/core2/code_34310.c b/src/core2/code_34310.c new file mode 100644 index 00000000..6489bdc2 --- /dev/null +++ b/src/core2/code_34310.c @@ -0,0 +1,137 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern void func_80250E6C(f32, f32); +extern void func_80258E60(f32[3], f32[3], f32); +extern void func_80258EF4(f32[3], f32[3], f32); +extern void func_80258F88(f32[3], f32[3], f32); +extern void func_802BE720(void); + +typedef struct { + f32 unk0; + f32 unk4; + f32 unk8; + f32 unkC; + f32 unk10; + f32 unk14; + f32 unk18; + u8 unk1C; + // u8 pad1D[3]; +}Struct_core2_33F90_0; + +void func_802BB200(void); +void func_802BB22C(void); +void func_802BB318(s32 arg0); +void func_802BB360(s32 arg0, f32 arg1); +void func_802BB3AC(s32 arg0, f32 arg1); + +/* .bss */ +Struct_core2_33F90_0 D_8037D840[4]; + +/* .code */ +void func_802BB2A0(void){} + +void func_802BB2A8(void){ + s32 i; + + for(i = 0; i < 4; i++){ + D_8037D840[i].unk1C = 1; + D_8037D840[i].unk18 = 0.0f; + func_802BB318(i); + } +} + +void func_802BB318(s32 arg0){ + func_802BB360(arg0, 30.0f); + func_802BB3AC(arg0, 0.65f); +} + +f32 func_802BB34C(s32 arg0){ + return D_8037D840[arg0].unk10; +} + +void func_802BB360(s32 arg0, f32 arg1){ + D_8037D840[arg0].unk10 = arg1; +} + +void func_802BB378(s32 arg0, f32 arg1, f32 arg2){ + D_8037D840[arg0].unkC = D_8037D840[arg0].unk10; + D_8037D840[arg0].unk8 = D_8037D840[arg0].unk10 + arg1; + D_8037D840[arg0].unk18 = arg2; + D_8037D840[arg0].unk0 = arg2; +} + +void func_802BB3AC(s32 arg0, f32 arg1){ + D_8037D840[arg0].unk4 = arg1; +} + +void func_802BB3C4(s32 arg0){ + D_8037D840[arg0].unk1C = 2; +} + +void func_802BB3DC(s32 arg0, f32 arg1, f32 arg2){ + func_802BB360(arg0, arg1); + func_802BB3AC(arg0, arg2); + func_802BB3C4(arg0); +} + +void func_802BB41C(s32 arg0){ + D_8037D840[arg0].unk1C = 1; +} + +void func_802BB434(s32 arg0, f32 dst[3], f32 src[3], f32 arg3) { + switch (arg0) { + case 1: + func_80258F88(dst, src, arg3); + return; + case 0: + func_80258E60(dst, src, arg3); + return; + case 2: + func_80258EF4(dst, src, arg3); + return; + case 3: + dst[1] += arg3; + return; + } +} + +void func_802BB4D8(s32 arg0, s32 arg1) { + f32 temp_f0; + f32 temp_f22; + s32 phi_s1; + + temp_f22 = time_getDelta(); + for(phi_s1 = 0; phi_s1 < 4; phi_s1++){ + switch (D_8037D840[phi_s1].unk1C) { + case 2: + if (D_8037D840[phi_s1].unk10 >= 0.0f) { + D_8037D840[phi_s1].unk14 = 1.0f; + } else { + D_8037D840[phi_s1].unk14 = -1.0f; + } + func_802BB434(phi_s1, arg0, arg1, D_8037D840[phi_s1].unk10); + D_8037D840[phi_s1].unk1C = 3; + break; + case 3: + if (D_8037D840[phi_s1].unk18 != 0.0f) { + temp_f0 = max_f(0.0f, D_8037D840[phi_s1].unk18 - temp_f22); + D_8037D840[phi_s1].unk18 = temp_f0; + D_8037D840[phi_s1].unk10 = ml_map_f(temp_f0, D_8037D840[phi_s1].unk0, 0.0f, D_8037D840[phi_s1].unkC, D_8037D840[phi_s1].unk8); + } else { + D_8037D840[phi_s1].unk10 *= D_8037D840[phi_s1].unk4; + } + if (level_get() != LEVEL_D_CUTSCENE) { + func_80250E6C(D_8037D840[phi_s1].unk10 * 0.25, temp_f22); + } + func_802BB434(phi_s1, arg0, arg1, D_8037D840[phi_s1].unk14*D_8037D840[phi_s1].unk10); + D_8037D840[phi_s1].unk14 = (f32) -D_8037D840[phi_s1].unk14; + if (((f64) D_8037D840[phi_s1].unk4 != 1.0) && ((f64) mlAbsF(D_8037D840[phi_s1].unk10) < 0.001)) { + D_8037D840[phi_s1].unk1C = 1U; + } + break; + } + } +} diff --git a/src/core2/code_34790.c b/src/core2/code_34790.c new file mode 100644 index 00000000..1b20a952 --- /dev/null +++ b/src/core2/code_34790.c @@ -0,0 +1,372 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802BEA4C(f32[3], f32[3], f32, f32[3]); +extern void func_802BEBE8(f32[3], f32[3], f32, f32[3]); +extern void func_802BEAAC(f32[3], f32[3], f32, f32[3], f32[3], f32[3], f32[3]); +extern Struct66s *func_80320B98(f32[3], f32[3], f32[3], s32); +f32 func_802BB938(f32[3], f32[3]); +f32 func_802BBD48(void); +f32 func_802BBEA4(f32 arg0[3], f32 arg1[3], f32 arg2, s32 arg3, s32 arg4); + +/* .data */ +extern s16 D_803657E0[]; + +/* .bss */ +s32 D_8037D8C0; +u8 D_8037D8C4; +u8 D_8037D8C5; +u8 D_8037D8C6; +f32 D_8037D8C8; +f32 D_8037D8CC; +struct { + s32 unk0[6]; + f32 unk18[6]; + u8 unk30; + u8 unk31; +}D_8037D8D0; +f32 D_8037D908[3]; +f32 D_8037D918[3]; + +/* .code */ +bool func_802BB720(s32 arg0, f32 arg1[3], f32 arg2[3], s32 *arg3) { + f32 temp_f6; + s16 *temp_v0; + + if (arg0 == 0x65) { + arg0 = 0x1A; + } + if (arg0 >= 0x80) { + arg1[0] = (f32) func_802E4AE8(arg0); + arg1[1] = (f32) func_802E4AFC(arg0); + arg1[2] = (f32) func_802E4B10(arg0); + arg2[0] = 0.0f; + arg2[1] = mlNormalizeAngle((f32) func_802E4B24(arg0) - 180.0f); + arg2[2] = 0.0f; + return TRUE; + } + if ((arg0 >= 0x5B) && (arg0 < 0x63)) { + arg0 -= 0x40; + } + temp_v0 = func_803049CC(D_803657E0[arg0], 0); + if (temp_v0 != NULL) { + nodeprop_getPosition(temp_v0, arg1); + *arg3 = func_80304DB8(temp_v0); + temp_f6 = (f32) func_80304DA8(temp_v0) - 180.0f; + arg2[0] = 0.0f;\ + arg2[1] = mlNormalizeAngle(temp_f6);\ + arg2[2] = 0.0f; + return TRUE; + } + return FALSE; +} + + +bool func_802BB884(f32 arg0[3], f32 *arg1) { + f32 sp24[3]; + f32 sp18[3]; + + if (!player_is_present() || !func_8028F070() || !func_8028F150()) { + return FALSE; + } + player_getPosition(sp24); + sp24[1] += 50.0f; + ml_vec3f_diff_copy(sp18, arg0, sp24); + *arg1 = gu_sqrtf(sp18[0]*sp18[0] + sp18[1]*sp18[1] + sp18[2]*sp18[2]); + return TRUE; +} + + +f32 func_802BB938(f32 arg0[3], f32 arg1[3]) { + f32 sp3C; + f32 phi_f20; + f32 phi_f12; + f32 phi_f14; + + phi_f14 = func_802BBEA4(arg0, arg1, 350.0f, 1, 0x800000); + phi_f12 = (D_8037D8D0.unk31) ? 25.0f : 10.0f; + phi_f20 = max_f(phi_f12, phi_f14* 0.8 - 15.0); + func_802BAC58(); + + if (func_802BB884(arg0, &sp3C)) { + phi_f20 = min_f(phi_f20, ml_map_f(sp3C, 90.0f, 450.0f, 20.0f, 240.0f)); + } + + if (65.0 < phi_f20 && func_802BAC1C()) { + phi_f20 = 65.0f; + } + + if (gctransition_8030BDAC()) { + phi_f20 = min_f(phi_f20, gctransition_8030BD88() * 0.8); + } + return phi_f20; +} + +void func_802BBA84(void) { + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + f32 sp30[3]; + f32 sp24[3]; + + func_80309998(sp30, sp24); + func_8024C5CC(sp54); + func_8024C764(sp3C); + func_8024C5A8(sp48); + D_8037D8CC = (f32) func_8033EAF8(sp30, sp24, sp54, sp48); + D_8037D8CC += 100.0f; + if (D_8037D8CC < 1000.0f) { + D_8037D8CC = 1000.0f; + } + if (20000.0 < D_8037D8CC) { + D_8037D8CC = 20000.0f; + } + if (level_get() == LEVEL_D_CUTSCENE) { + D_8037D8C8 = D_8037D8CC * 0.0078125; + return; + } + if (map_get() == MAP_91_FILE_SELECT) { + D_8037D8C8 = D_8037D8CC * 0.0078125; + return; + } + D_8037D8C8 = D_8037D8CC * 0.0078125; + if (D_8037D8C8 < 10.0) { + D_8037D8C8 = 10.0f; + return; + } + D_8037D8C8 = min_f(D_8037D8C8, func_802BB938(sp54, sp3C)); +} + +void func_802BBC58(s32 arg0) { + switch (D_8037D8C0) { + case 3: + func_802BAD00(); + break; + case 4: + func_802BED00(); + break; + case 1: + case 2: + break; + } + switch (arg0) { + case 3: + func_802BACD0(arg0); + break; + case 4: + func_802BEC60(arg0); + break; + case 1: + case 2: + break; + } + D_8037D8C0 = arg0; +} + + +void func_802BBD0C(Gfx **gdl, Mtx **mptr, Vtx **vptr){ + func_802BEE2C(gdl, mptr, vptr); +} + +void func_802BBD2C(f32 *arg0, f32 *arg1){ + *arg0 = D_8037D8C8; + *arg1 = D_8037D8CC; +} + +f32 func_802BBD48(void) { + f32 min; + s32 val; + s32 i; + + min = 1000.0f; + for(i = 0; i < 6; i++){ + val = (s32)D_8037D8D0.unk18[i]; + if(val < min){ + min = val; + } + } + return min; +} + +f32 func_802BBEA4(f32 arg0[3], f32 arg1[3], f32 arg2, s32 arg3, s32 arg4) { + f32 sp58[6][3]; + f32 sp4C[3]; + f32 phi_f2; + f32 sp3C[3]; + Struct66s *sp38; + s32 i; + + if (arg3 == 0) { + return func_802BBD48(); + } + func_802BEA4C(arg1, arg0, arg2, sp58[0]); + func_802BEBE8(arg1, arg0, arg2, sp58[3]); + func_802BEAAC(arg1, arg0, arg2, sp58[1], sp58[4], sp58[2], sp58[5]); + ml_vec3f_copy(sp4C, sp58[D_8037D8D0.unk30]); + sp38 = func_80320B98(arg0, sp4C, sp3C, arg4); + if (sp38 != NULL) { + phi_f2 = ml_vec3f_distance(arg0, &sp4C); + D_8037D8D0.unk0[D_8037D8D0.unk30] = sp38->unk8; + } else { + phi_f2 = arg2; + D_8037D8D0.unk0[D_8037D8D0.unk30] = 0; + } + D_8037D8D0.unk18[D_8037D8D0.unk30] = phi_f2; + D_8037D8D0.unk30++; + if (D_8037D8D0.unk30 >= 6) { + D_8037D8D0.unk30 = 0; + } + + D_8037D8D0.unk31 = FALSE; + + for(i = 0; i < 6; i++){ + if (D_8037D8D0.unk0[i]){ + if(D_8037D8D0.unk0[i] & 0x1E0000){ + D_8037D8D0.unk31 = TRUE; + } + else{ + D_8037D8D0.unk31 = FALSE; + break; + } + } + } + return func_802BBD48(); +} + +void func_802BC044(void) { + s32 i; + + D_8037D8C4 = 0; + D_8037D8C5 = 0; + D_8037D8C6 = 0; + D_8037D8D0.unk31 = 0; + D_8037D8D0.unk30 = 0; + for(i = 0; i < 6; i++){ + D_8037D8D0.unk18[i] = 1000.0f; + D_8037D8D0.unk0[i] = 0; + } + func_802BAC10(); + func_802BE940(); + func_802BCBD4(); + func_802BEF78(); + func_802BB2A8(); + D_8037D8C0 = 0; + func_802BBC58(2); +} + + +void func_802BC10C(void){ + func_802BB2A0(); + func_802BBC58(1); + func_802BCD30(); + func_802BEF70(); + func_802BABD8(); +} + +void func_802BC14C(void){ + f32 sp2C[3]; + f32 sp20[3]; + s32 v0; + + v0 = D_8037D8C0; + if(!D_8037D8C5 && !D_8037D8C6){ + v0 = 0; + } + + switch(v0){ + case 2: + func_802BCEC4(); + break; + case 3: + func_802BADAC(); + break; + case 4: + func_802BED30(); + break; + } + + func_8024C5CC(sp2C); + func_8024C764(sp20); + func_802BB4D8(sp2C, sp20); + func_8024CD88(sp2C); + func_8024CE18(sp20); + func_8024CFD4(); + func_802BEFB0(); + func_802BBA84(); +} + +void func_802BC21C(s32 arg0, s32 arg1){ + if(arg1 == 2){ + D_8037D8C5 = TRUE; + } + else{ + D_8037D8C5 = FALSE; + } +} + +s32 func_802BC248(void){ + return D_8037D8C0; +} + +void func_802BC254(void){ + D_8037D8C6 = 1; + func_802BC14C(); + D_8037D8C6 = 0; +} + +void func_802BC280(void){ + func_802BC254(); +} + +Actor *func_802BC2A0(f32 position[3], f32 rotation[3]){ + return func_80328230(0x66, position, rotation); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_34790/func_802BC2CC.s") +#else +void func_802BC2CC(s32 arg0) { + f32 *sp24; + f32 *sp20; + s32 sp1C; + + sp24 = &D_8037D908; + sp20 = &D_8037D918; + if (func_803203FC(0xE) != 0) { + func_80347A14(0); + } + if (func_80320454(0xE, 0) || func_802D686C() || (arg0 == 0x63) || !func_802BB720(arg0, D_8037D908, D_8037D918, &sp1C)) { + if (D_8037D8C0 == 2) { + func_802BE794(); + } + func_802BC254(); + func_802BC254(); + return; + } + if (D_8037D8C0 == 2) { + func_802BE894(D_8037D918, D_8037D908); + } + func_8024CD88(D_8037D908); + func_8024CE18(D_8037D918); + func_8024CFD4(); + func_802C3D3C(func_802BC2A0, D_8037D908, D_8037D918); + if (D_8037D8C0 == 2) { + func_802BE720(); + if (sp1C != 0x63) { + func_802BC254(); + func_802BC254(); + } + } +} +#endif + +bool func_802BC428(void){ + return D_8037D8C6; +} + +void func_802BC434(f32 arg0[3], f32 arg1[3], f32 arg2[3]) { + func_8025727C(arg1[0], arg1[1], arg1[2], arg2[0], arg2[1], arg2[2], &arg0[0], &arg0[1]); + arg0[0] = mlNormalizeAngle(-arg0[0]); + arg0[2] = 0.0f; +} diff --git a/src/core2/code_3480.c b/src/core2/code_3480.c new file mode 100644 index 00000000..b0dfb297 --- /dev/null +++ b/src/core2/code_3480.c @@ -0,0 +1,144 @@ +#include +#include "functions.h" +#include "variables.h" + +s32 func_80259254(f32 *, f32, f32, f32); +void func_802C2ADC(f32 *); + +extern u8 D_8037DCCA; +extern u8 D_8037DCCB; +extern u8 D_8037DCCC; + +/* .data */ +f32 D_80363610[3] = {350.0f, 200.0f, -100.0f}; +f32 D_8036361C[2] = {29.25f, 269.5f}; + +/* .bss */ +s32 D_8037BF50; + +/* .code */ +//snacker_clearState +void func_8028A410(void){ + D_8037BF50 = 0; +} + +//__playerWithinHorizontalDistance +s32 func_8028A41C(f32 x, f32 z, f32 dist){ + f32 plyrPos[3]; + + _player_getPosition(&plyrPos); + return func_80259254(plyrPos, x, z, dist); +} + +//_snacker_ttc_update +s32 func_8028A45C(void){ + s32 nextState = 0; + f32 plyrPos[3]; + + _player_getPosition(&plyrPos); + if(func_8028B470() || func_803203FC(0xC1)){ //(swimming || ???) + if(plyrPos[1] < 600.0f + && !func_8028A41C(2478.0f, 4586.0f, 1750.0f) //within 1750 of sandcastle center + && !func_8028A41C(-400.0, 2315.0f, 2000.0f) //within 2000 of blubber's ship center + ){ + nextState = 2; + } + } + func_802E1A04(nextState); + return nextState; +} + +//_snacker_rbb_update +s32 func_8028A504(void){ + s32 nextState = 0; + f32 sp18[3]; + if(func_8028B470()){ + func_8028E964(sp18); + if(func_80309D58(sp18, 0)) + nextState = 1; + } + func_802E1A04(nextState); + return nextState; +} + +void func_8028A558(s32 arg0, s32 arg1, s32 arg2){ + func_8028F918(0); +} + +void func_8028A584(s32 arg0, s32 arg1, s32 arg2){ + func_803219F4(3); + func_8034B9BC(func_802DE41C()); +} + +//snacker_update_bottlesBonusPuzzle +s32 func_8028A5C0(void){ + s32 tmp; + f32 sp30[3]; + + if(gctransition_8030BDC0() || getGameMode() != GAME_MODE_3_NORMAL) + return 0; + + if(func_8034BB48() && func_802DE41C() != 7){ + func_80311480(0xe26 + (func_802DE41C() << 1), 6, &D_80363610, 0, 0, 0); + } + if(!func_8028F25C() && func_80321960() == 3) + func_803219F4(1); + + if(miscflag_isTrue(0x17) && !func_8028F25C()){ + if(func_8028A41C(183.0f, -100.0f, 75.0f)){ + if(func_802DE41C() == 6){ + if(!D_8037DCCC){ + func_8028F94C(4, &D_80363610); + func_80311480(0xe33, 0x6, &D_80363610, 0, func_8028A584, NULL); + } + }//L8028A70C + else if(func_802DE41C() == 7){ + func_8028F94C(4, &D_80363610); + func_80311480(0xe35, 0x6, &D_80363610, 0, func_8028A558, NULL); + D_8037DCCC = 1; + }//L8028A764 + else if(jiggyscore_isCollected(0x10)){ + func_802C2ADC(sp30); + if( (((D_8036361C[0] <= sp30[0])? (sp30[0] - D_8036361C[0]) : -(sp30[0] - D_8036361C[0])) < 4.0f) + && (((D_8036361C[1] <= sp30[1])? (sp30[1] - D_8036361C[1]) : -(sp30[1] - D_8036361C[1])) < 20.0f) + ){ + if(!D_8037DCCA){ + func_8028F94C(4, &D_80363610); + func_80311480(0xe21, 6, &D_80363610, 0, func_8028A584, NULL); + D_8037DCCA = 1; + }else{ + func_8028A584(0,0,0); + } + } + }//L8028A86C + else{ + if(!D_8037DCCB){ + func_8028F94C(4, &D_80363610); + func_80311480(0xe20, 6, &D_80363610, 0, func_8028A558, NULL); + D_8037DCCB = 1; + } + } + } + } + return 0; +} + +//snacker_updateState +void func_8028A8D0(void){ + switch(map_get()){ + case MAP_7_TTC_TREASURE_TROVE_COVE: + D_8037BF50 = func_8028A45C(); + break; + case MAP_31_RBB_RUSTY_BUCKET_BAY: + D_8037BF50 = func_8028A504(); + break; + case MAP_8C_SM_BANJOS_HOUSE: + D_8037BF50 = func_8028A5C0(); + break; + } +} + +//snacker_getState +s32 func_8028A94C(void){ + return D_8037BF50; +} \ No newline at end of file diff --git a/src/core2/code_35520.c b/src/core2/code_35520.c new file mode 100644 index 00000000..c1241dff --- /dev/null +++ b/src/core2/code_35520.c @@ -0,0 +1,170 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + s16 map_id; //map_id + s16 unk2; //other_id + s16 unk4; + s16 unk6; + s16 unk8; + s16 unkA; + s16 unkC; + s16 unkE; + s16 unk10; + s16 unk12; + s16 unk14; +}struct_core2_35520_1; + +typedef struct { + s32 overlay_id; //overlay_id + struct_core2_35520_1 *unk4; +}struct_core2_35520; + +/* .data */ +struct_core2_35520_1 D_80365830[] ={ + {MAP_1_SM_SPIRAL_MOUNTAIN, 0x0001, 0x0320, 0x0352, 0x0177, 0x03B6, 0x03E8, 0x020D, 0x044C, 0x047E, 0x02A3}, + {0x0000, 0x0000, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3} +}; + +struct_core2_35520_1 D_8036585C[] ={ + {MAP_2_MM_MUMBOS_MOUNTAIN, 0x0001, 0x0320, 0x0352, 0x0226, 0x03B6, 0x03E8, 0x02EE, 0x044C, 0x047E, 0x041A}, + {MAP_2_MM_MUMBOS_MOUNTAIN, 0x0000, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3}, + {0x0000, 0x0000, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3} +}; + +struct_core2_35520_1 D_803658A0[] = { + {MAP_8F_TTC_SHARKFOOD_ISLAND, 0x0000, 0x0177, 0x01A9, 0x00AF, 0x020D, 0x023F, 0x023F, 0x02A3, 0x02D5, 0x03CF}, + {MAP_7_TTC_TREASURE_TROVE_COVE, 0x0004, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3}, + {MAP_7_TTC_TREASURE_TROVE_COVE, 0x0003, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3}, + {MAP_7_TTC_TREASURE_TROVE_COVE, 0x0002, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x01DB, 0x03B6, 0x03E8, 0x0307}, + {MAP_7_TTC_TREASURE_TROVE_COVE, 0x0001, 0x02BC, 0x02EE, 0x01C2, 0x0352, 0x0384, 0x02EE, 0x03E8, 0x041A, 0x041A}, + {MAP_7_TTC_TREASURE_TROVE_COVE, 0x0000, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3}, + {0x0000, 0x0000, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3} +}; + +struct_core2_35520_1 D_8036593C[] ={ + {MAP_B_CC_CLANKERS_CAVERN, 0x0001, 0x028A, 0x02BC, 0x0113, 0x036B, 0x039D, 0x01DB, 0x044C, 0x047E,0x02A3}, + {0x0000, 0x0000, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3} +}; + +struct_core2_35520_1 D_80365968[] = { + {MAP_D_BGS_BUBBLEGLOOP_SWAMP, 0x0005, 0x0226, 0x0258, 0x00E1, 0x0352, 0x0384, 0x01C2, 0x044C, 0x047E, 0x02EE}, + {MAP_D_BGS_BUBBLEGLOOP_SWAMP, 0x0003, 0x0226, 0x0258, 0x00E1, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3}, + {MAP_D_BGS_BUBBLEGLOOP_SWAMP, 0x0002, 0x0226, 0x0258, 0x00AF, 0x02EE, 0x0320, 0x01DB, 0x03B6, 0x03E8, 0x02EE}, + {MAP_D_BGS_BUBBLEGLOOP_SWAMP, 0x0001, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x01A9, 0x044C, 0x047E, 0x02A3}, + {0x0000, 0x0000, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3} +}; + +struct_core2_35520_1 D_803659D8[] = { + {0x0000, 0x0000, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3} +}; + +struct_core2_35520_1 D_803659F0[] = { + {MAP_12_GV_GOBIS_VALLEY, 0x0004, 0x0226, 0x0258, 0x00AF, 0x02EE, 0x0320, 0x0177, 0x03B6, 0x03E8, 0x02A3}, + {MAP_12_GV_GOBIS_VALLEY, 0x0003, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3}, + {MAP_12_GV_GOBIS_VALLEY, 0x0002, 0x0226, 0x0258, 0x00AF, 0x02D5, 0x0307, 0x01DB, 0x0384, 0x03B6, 0x0307}, + {MAP_12_GV_GOBIS_VALLEY, 0x0001, 0x0226, 0x0258, 0x00AF, 0x02EE, 0x0320, 0x023F, 0x03B6, 0x03E8, 0x03CF}, + {0x0000, 0x0000, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3} +}; + +struct_core2_35520_1 D_80365A60[] = { + {MAP_26_MMM_NAPPERS_ROOM, 0x0001, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x00E1, 0x044C, 0x047E, 0x0113}, + {MAP_1B_MMM_MAD_MONSTER_MANSION, 0x0003, 0x0226, 0x0258, 0x00C8, 0x02EE, 0x0320, 0x0177, 0x03B6, 0x03E8, 0x02A3}, + {MAP_1B_MMM_MAD_MONSTER_MANSION, 0x0002, 0x0226, 0x0258, 0x00C8, 0x02EE, 0x0320, 0x0145, 0x03B6, 0x03E8, 0x01C2}, + {MAP_1B_MMM_MAD_MONSTER_MANSION, 0x0001, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3}, + {0x0000, 0x0000, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3} +}; + +struct_core2_35520_1 D_80365AD0[] = { + {MAP_34_RBB_ENGINE_ROOM, 0x0001, 0x0226, 0x0258, 0x00AF, 0x0307, 0x0339, 0x023F, 0x0384, 0x03B6, 0x03E8}, + {MAP_34_RBB_ENGINE_ROOM, 0x0000, 0x0226, 0x0258, 0x00AF, 0x0307, 0x0339, 0x01DB, 0x0384, 0x03B6, 0x0307}, + {MAP_31_RBB_RUSTY_BUCKET_BAY, 0x0003, 0x0226, 0x0258, 0x015E, 0x02A3, 0x02D5, 0x02D5, 0x0320, 0x0352, 0x044C}, + {MAP_31_RBB_RUSTY_BUCKET_BAY, 0x0002, 0x0226, 0x0258, 0x00AF, 0x02EE, 0x0320, 0x020D, 0x03B6, 0x03E8, 0x036B}, + {MAP_31_RBB_RUSTY_BUCKET_BAY, 0x0001, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3}, + {0x0000, 0x0000, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3} +}; + +struct_core2_35520_1 D_80365B54[] = { + {MAP_43_CCW_SPRING, 0x0002, 0x0226, 0x0258, 0x00E1, 0x0352, 0x0384, 0x01A9, 0x044C, 0x047E, 0x02A3}, + {MAP_44_CCW_SUMMER, 0x0002, 0x0226, 0x0258, 0x00E1, 0x0352, 0x0384, 0x01A9, 0x044C, 0x047E, 0x02A3}, + {MAP_45_CCW_AUTUMN, 0x0002, 0x0226, 0x0258, 0x00E1, 0x0352, 0x0384, 0x01A9, 0x044C, 0x047E, 0x02A3}, + {MAP_46_CCW_WINTER, 0x0002, 0x0226, 0x0258, 0x00E1, 0x0352, 0x0384, 0x01A9, 0x044C, 0x047E, 0x02A3}, + {MAP_43_CCW_SPRING, 0x0001, 0x0320, 0x0352, 0x0226, 0x03B6, 0x03E8, 0x0320, 0x044C, 0x047E, 0x041A}, + {MAP_44_CCW_SUMMER, 0x0001, 0x0320, 0x0352, 0x0226, 0x03B6, 0x03E8, 0x0320, 0x044C, 0x047E, 0x041A}, + {MAP_45_CCW_AUTUMN, 0x0001, 0x0320, 0x0352, 0x0226, 0x03B6, 0x03E8, 0x0320, 0x044C, 0x047E, 0x041A}, + {MAP_46_CCW_WINTER, 0x0001, 0x0320, 0x0352, 0x0226, 0x03B6, 0x03E8, 0x0320, 0x044C, 0x047E, 0x041A}, + {0x0000, 0x0000, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3} +}; + +struct_core2_35520_1 D_80365C1C [] = { + {0x0000, 0x0000, 0x0226, 0x0258, 0x0096, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3} +}; + +struct_core2_35520_1 D_80365C34 [] ={ + {MAP_90_GL_BATTLEMENTS, 0x0000, 0x0258, 0x028A, 0x00C8, 0x04B0, 0x0514, 0x0145, 0x0708, 0x076C, 0x01C2} +}; + +struct_core2_35520_1 D_80365C4C [] = { + {0x0000, 0x0000, 0x0226, 0x0258, 0x00AF, 0x0352, 0x0384, 0x0177, 0x044C, 0x047E, 0x02A3} +}; + +struct_core2_35520 D_80365C64[] = { + {OVERLAY_6_JUNGLE, D_8036585C}, + {OVERLAY_5_BEACH, D_803658A0}, + {OVERLAY_2_WHALE, D_8036593C}, + {OVERLAY_7_SWAMP, D_80365968}, + {OVERLAY_9_SNOW, D_803659D8}, + {OVERLAY_D_WITCH, D_80365C1C}, + {OVERLAY_4_DESERT, D_803659F0}, + {OVERLAY_A_TREE, D_80365B54}, + {OVERLAY_8_SHIP, D_80365AD0}, + {OVERLAY_3_HAUNTED, D_80365A60}, + {OVERLAY_B_TRAINING, D_80365830}, + {OVERLAY_E_BATTLE, D_80365C34}, + {0} +}; + +/* .bss */ +struct_core2_35520_1 *D_8037D930; + +/* .code */ +struct_core2_35520_1 *func_802BC4B0(s32 arg0) { + s32 map_id; + s32 i; + + map_id = map_get(); + for( i = 0; D_8037D930[i].map_id != 0; i++){ + if(map_id == D_8037D930[i].map_id && (arg0 == D_8037D930[i].unk2)){ + return &D_8037D930[i]; + } + } + return &D_8037D930[i]; +} + +void func_802BC538(s32 arg0, s32 *arg1, s32 *arg2, s32 *arg3, s32 *arg4, s32 *arg5, s32 *arg6, s32 *arg7, s32 *arg8, s32 *arg9) { + struct_core2_35520_1 *temp_v0; + + temp_v0 = func_802BC4B0(arg0); + *arg1 = (s32) temp_v0->unk4; + *arg2 = (s32) temp_v0->unk6; + *arg3 = (s32) temp_v0->unk8; + *arg4 = (s32) temp_v0->unkA; + *arg5 = (s32) temp_v0->unkC; + *arg6 = (s32) temp_v0->unkE; + *arg7 = (s32) temp_v0->unk10; + *arg8 = (s32) temp_v0->unk12; + *arg9 = (s32) temp_v0->unk14; +} + +void func_802BC5CC(void){ + int i; + int overlay; + overlay = get_loaded_overlay_id(); + D_8037D930 = &D_80365C4C[0]; + for(i = 0; D_80365C64[i].overlay_id; i++){ + if(D_80365C64[i].overlay_id == overlay){ + D_8037D930 = D_80365C64[i].unk4; + } + } +} diff --git a/src/core2/code_356B0.c b/src/core2/code_356B0.c new file mode 100644 index 00000000..2ad131d4 --- /dev/null +++ b/src/core2/code_356B0.c @@ -0,0 +1,1000 @@ +#include +#include "functions.h" +#include "variables.h" + +extern bool func_80245314(f32[3], f32[3], f32, f32, u32); +extern int func_80244D94(f32[3], f32[3], f32[3], u32, f32); +extern int func_8024575C(f32[3], f32[3], f32, f32[3], s32, u32); +extern void func_8024C510(f32); +extern f32 func_80258708(f32[3], f32[3]); +extern f32 func_80259198(f32, f32); +extern f32 func_8028E82C(void); +extern f32 func_8028EBA4(void); +extern f32 func_8028EF88(void); +extern int func_80320DB0(f32[3], f32, f32[3], u32); +extern f32 ml_vec3f_dot_product(f32[3], f32[3]); + +typedef struct { + f32* unk0; + s32 unk4; +}Struct_core2_356B0_0; + +void func_802BD0D8(s32 arg0); +void func_802BD334(f32 arg0[3]); +void func_802BD384(f32 arg0[3]); +void func_802BD780(f32[3], f32[3], f32, f32, f32, f32); +void func_802BD840(void); +void func_802BD870(f32 arg0, f32 arg1, f32 arg2, f32 arg3); +f32 func_802BD8C8(void); +void func_802BD8EC(f32 arg0); + + +extern Struct_core2_356B0_0 D_80365D48; +extern Struct_core2_356B0_0 D_80365D50; +extern Struct_core2_356B0_0 D_80365D58; + + +/* .bss */ +s32 D_8037D940; +f32 D_8037D948[3]; +f32 D_8037D958[3]; +f32 D_8037D968[3]; +f32 D_8037D96C; +f32 D_8037D974; +f32 D_8037D978; +f32 D_8037D97C; +f32 D_8037D980; +f32 D_8037D984; +f32 D_8037D988; +f32 D_8037D98C; +f32 D_8037D990; +f32 D_8037D994; +f32 D_8037D998; +f32 D_8037D99C; +f32 D_8037D9A0; +f32 D_8037D9A8[3]; +f32 D_8037D9B8[3]; +f32 D_8037D9C8[3]; +f32 D_8037D9D4; +f32 D_8037D9D8; +f32 D_8037D9E0[3]; +f32 D_8037D9EC; +f32 D_8037D9F0; +u8 D_8037D9F4; +u8 D_8037D9F5; +u8 D_8037D9F6; +u8 D_8037D9F7; + +/* .code */ +bool func_802BC640(f32 arg0[3], f32 arg1[3], f32 arg2, s32 arg3) { + f32 sp9C[3]; + Struct_core2_356B0_0 *phi_s4; + f32 *phi_s0; + f32 sp88[3]; + f32 phi_f20; + f32 sp78[3]; + f32 phi_f26; + + phi_f26 = max_f(150.0f, arg2 - 100.0f); + switch (arg3) { + case 1: + phi_s4 = &D_80365D50; + break; + case 2: + case 3: + phi_s4 = &D_80365D58; + break; + default: + case 0: + phi_s4 = &D_80365D48; + phi_f26 = 150.0f; + break; + } + for(phi_s0 = phi_s4->unk0; phi_s0 < phi_s4->unk0 + phi_s4->unk4; phi_s0++){ + phi_f20 = *phi_s0; + if (arg3 == 3) { + phi_f20 = -phi_f20; + } + ml_vec3f_scale_copy(sp9C, arg1, -arg2); + ml_vec3f_yaw_rotate_copy(sp9C, sp9C, phi_f20); + ml_vec3f_add(sp78, arg0, sp9C); + func_80244D94(arg0, sp78, sp88, 0x9E0000, 40.0f); + func_8024575C(arg0, sp78, 40.0f, sp88, 4, 0x9E0000); + if (phi_f26 < func_80258708(arg0, sp78)) { + func_802BD334(sp78); + ml_vec3f_clear(D_8037D9C8); + ml_vec3f_clear(D_8037D9E0); + return TRUE; + } + } + return FALSE; +} + +s32 func_802BC84C(s32 arg0){ + f32 sp74[3]; + f32 sp68[3]; + f32 sp5C[3]; + f32 sp50[3]; + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + f32 sp20[3]; + f32 sp1C; + + if(player_getTransformation() == TRANSFORM_3_PUMPKIN){ + player_getPosition(sp50); + sp50[1] += 76.0f; + } + else{ + func_8028EC64(sp50); + } + func_802BD384(sp38); + ml_vec3f_diff_copy(sp5C, sp50, sp38); + ml_vec3f_normalize_copy(sp68, sp5C); + ml_vec3f_copy(sp44, sp50); + sp1C = gu_sqrtf(sp5C[0]*sp5C[0] + sp5C[1]*sp5C[1] + sp5C[2]*sp5C[2]); + if (1500.0f < sp1C) { + ml_vec3f_scale_copy(sp5C, sp68, 1500.0f); + ml_vec3f_add(sp44, sp38, sp5C); + } + switch(D_8037D9F6) { + case 0: //802BC94C + ml_vec3f_clear(sp2C); + break; + + case 1: //802BC95C + ml_vec3f_scale_copy(sp2C, sp68, 100.0f); + ml_vec3f_yaw_rotate_copy(sp2C, sp2C, -90.0f); + break; + + case 2: //802BC984 + ml_vec3f_scale_copy(sp2C, sp68, 100.0f); + ml_vec3f_yaw_rotate_copy(sp2C, sp2C, 90.0f); + break; + + case 3: //802BC9AC + sp2C[0] = 0.0f; + sp2C[1] = 100.0f; + sp2C[2] = 0.0f; + break; + + case 4: //802BC9C8 + ml_vec3f_clear(sp2C); + break; + }//L802BC9D0 + ml_vec3f_add(sp20, sp2C, sp44); + if (func_80320B98(sp38, sp20, sp74, 0x9E0000)) { + D_8037D9F6++; + if (D_8037D9F6 >= 5) { + D_8037D9F6 = 0; + return func_802BC640(sp50, sp68, sp1C, arg0); + } + }else{ + D_8037D9F6 = 0; + } + return 0; +} + +void func_802BCA58(void) { + f32 sp4C; + f32 sp48; + s32 pad44; + s32 pad40; + f32 sp34[3]; + f32 sp28[3]; + + player_getPosition(sp28); + ml_vec3f_diff_copy(sp34, sp28, D_8037D958); + sp4C = func_8028EBA4(); + sp48 = ml_map_f(mlAbsF((f32) (mlNormalizeAngle(D_8037D96C - sp4C) - 180.0)), 0.0f, 180.0f, D_8037D97C, D_8037D980); + func_80256E24(D_8037D9A8, 0.0f, sp4C, 0.0f, 0.0f, ml_map_f(gu_sqrtf(sp34[0]*sp34[0] + sp34[2]*sp34[2]), 300.0f, 450.0f, 0.0f, sp48)); + ml_vec3f_diff_copy(sp34, D_8037D9A8, D_8037D9B8); + if (func_802BC428()) { + ml_vec3f_copy(D_8037D9B8, D_8037D9A8); + return; + } + ml_vec3f_scale(sp34, 0.08f); + D_8037D9B8[0] += sp34[0];\ + D_8037D9B8[1] += sp34[1];\ + D_8037D9B8[2] += sp34[2]; +} + +void func_802BCBD4(void) { + D_8037D940 = 0; + D_8037D9F5 = 1; + func_802BD8EC(130.0f); + func_802BD870(10.0f, 10.0f, 120.0f, 120.0f); + func_802BE230(1.4f, 14.0f); + func_802BD840(); + func_802C28C8(); + func_802C0120(); + func_802C2258(); + func_802C0F4C(); + func_8024C764(D_8037D968); + func_8024C5CC(D_8037D958); + ml_vec3f_copy(D_8037D948, D_8037D958); + ml_vec3f_clear(D_8037D9C8); + ml_vec3f_clear(D_8037D9E0); + ml_vec3f_clear(D_8037D9A8); + ml_vec3f_clear(D_8037D9B8); + D_8037D994 = 550.0f; + D_8037D998 = 620.0f; + D_8037D99C = 150.0f; + D_8037D9A0 = 0.0f; + D_8037D9F6 = 0; + D_8037D978 = 100.0f; + D_8037D9F4 = 0; + func_802BD0D8(1); +} + +void func_802BCD30(void){ + func_802BD0D8(0); + func_802C2250(); + func_802C0148(); +} + +f32 func_802BCD60(void) { + f32 sp34[3]; + f32 sp28[3]; + s32 temp_v0; + + if ((D_8037D940 & 1) && !func_802BC428()) + return D_8037D9A0; + + ml_vec3f_copy(sp28, D_8037D958); + temp_v0 = func_80245314(sp28, sp34, 10.0f, -600.0f, 0x800000); + if (temp_v0 == 0) { + D_8037D9A0 = sp28[1] - 600.0f; + } + if (temp_v0 != 0) { + D_8037D9A0 = sp28[1]; + } + + return D_8037D9A0; +} + + +bool func_802BCE0C(f32 arg0[3], f32 arg1[3]) { + f32 sp2C[3]; + f32 sp20[3]; + + ml_vec3f_copy(sp2C, arg1); + if (func_80244D94(arg0, sp2C, sp20, 0x9E0000, 40.0f)) { + return FALSE; + } + if (func_8024575C(arg0, sp2C, 40.0f, sp20, 4, 0x9E0000)) { + return FALSE; + } + return TRUE; +} + + +void func_802BCE94(void){ + if(func_802BE60C()) + func_802BC84C(0); +} + +void func_802BCEC4(void){ + f32 sp24[3]; + f32 sp18[3]; + + if(!D_8037D9F5) + return; + + func_802BCD60(); + D_8037D948[0] = D_8037D958[0]; + D_8037D948[1] = D_8037D958[1]; + D_8037D948[2] = D_8037D958[2]; + func_802BCA58(); + + switch(D_8037D9F4){ + case 1:// L802BCF3C + func_802C18F8(); + func_802BCE94(); + break; + + case 3:// L802BCF54 + func_802C1B2C(); + break; + + case 4:// L802BCF64 + func_802BFAF0(); + func_802BCE94(); + break; + + case 5:// L802BCF7C + func_802BF454(); + func_802BCE94(); + break; + + case 6:// L802BCF94 + func_802BCE94(); + break; + + case 8:// L802BCFA4 + func_802BF888(); + break; + + case 9:// L802BCFB4 + func_802C0D60(); + func_802BCE94(); + break; + + case 0xA:// L802BCFCC + func_802C1F30(); + break; + + case 0xB:// L802BCFDC + func_802C0558(); + break; + + case 0xC:// L802BCFEC + func_802BFF8C(); + func_802BCE94(); + break; + + case 0xD:// L802BD004 + func_802BF2CC(); + func_802BCE94(); + break; + + case 0xF:// L802BD01C + func_802C24B4(); + break; + + case 0x10:// L802BD02C + func_802BF1D4(); + break; + + case 0x11:// L802BD03C + func_802BF5F4(); + break; + + case 0x12:// L802BD04C + func_802C14E0(); + break; + + case 0x13:// L802BD05C + func_802C07A0(); + break; + }//// L802BD064 + ml_vec3f_copy(sp24, D_8037D958); + ml_vec3f_copy(sp18, D_8037D968); + func_802C22C0(sp24, sp18); + if(D_8037D9F7){ + func_802C292C(sp24, sp18); + } + func_8024CD88(sp24); + func_8024CE18(sp18); +} + +int func_802BD0CC(void){ + return D_8037D9F4; +} + +void func_802BD0D8(s32 arg0){ + if(arg0 == D_8037D9F4) + return; + + switch(D_8037D9F4){ + case 0x1://L802BD114 + func_802C18F0(); + break; + + case 0x3://L802BD124 + func_802C1AD0(); + break; + + case 0x4://L802BD134 + func_802BFAE8(); + break; + + case 0x5://L802BD144 + func_802BF44C(); + break; + + case 0x8://L802BD154 + func_802BF880(); + break; + + case 0x9://L802BD164 + func_802C09E0(); + break; + + case 0xa://L802BD174 + func_802C1DA8(); + break; + + case 0xb://L802BD184 + func_802C0550(); + break; + + case 0xc://L802BD194 + func_802BFF78(); + break; + + case 0xd://L802BD1A4 + func_802BF2B8(); + break; + + case 0xf://L802BD1B4 + func_802C24AC(); + break; + + case 0x10://L802BD1C4 + func_802BF1CC(); + break; + + case 0x11://L802BD1D4 + func_802BF5EC(); + break; + + case 0x12://L802BD1E4 + func_802C0FCC(); + break; + + case 0x13://L802BD1F4 + func_802C0694(); + break; + }//L802BD1FC + + switch (arg0) + { + case 0x1: //L802BD224 + func_802C18B0(); + break; + + case 0x3: //L802BD234 + func_802C1AD8(); + break; + + case 0x4: //L802BD244 + func_802BFA60(); + break; + + case 0x5: //L802BD254 + func_802BF3F0(); + break; + + case 0x8: //L802BD264 + func_802BF870(); + break; + + case 0x9: //L802BD274 + func_802C09A0(); + break; + + case 0xa: //L802BD284 + func_802C1DA0(); + break; + + case 0xb: //L802BD294 + func_802C04F8(); + break; + + case 0xc: //L802BD2A4 + func_802BFF1C(); + break; + + case 0xd: //L802BD2B4 + func_802BF270(); + break; + + case 0xf: //L802BD2C4 + func_802C2460(); + break; + + case 0x10: //L802BD2D4 + func_802BF174(); + break; + + case 0x11: //L802BD2E4 + func_802BF5C0(); + break; + + case 0x12: //L802BD2F4 + func_802C0F6C(); + break; + + case 0x13: //L802BD304 + func_802C0710(); + break; + } + D_8037D9F4 = arg0; +} + +void func_802BD328(s32 arg0){ + D_8037D9F5 = arg0; +} + +void func_802BD334(f32 arg0[3]){ + ml_vec3f_copy(D_8037D958, arg0); +} + +void func_802BD35C(f32 arg0[3]){ + ml_vec3f_copy(D_8037D968, arg0); +} + +void func_802BD384(f32 arg0[3]){ + ml_vec3f_copy(arg0, D_8037D958); +} + +void func_802BD3A8(f32 arg0[3]){ + ml_vec3f_copy(arg0, D_8037D968); +} + +void func_802BD3CC(f32 arg0[3]) { + f32 sp2C; + f32 temp_f0; + f32 temp_f2; + + player_getPosition(arg0); + sp2C = func_8028E82C(); + if ((func_8028F2FC() != 0) && (func_8028EE84() != BSWATERGROUP_2_UNDERWATER) && (player_getTransformation() == TRANSFORM_1_BANJO)) { + temp_f0 = func_8028EF88(); + temp_f2 = temp_f0 - 500.0f; + sp2C = ml_map_f(arg0[1], temp_f0 - 80.0f, temp_f2, temp_f0, temp_f2); + } + if ((sp2C + D_8037D974) < arg0[1]) { + arg0[1] = (f32) (arg0[1] + (80.0f - D_8037D974)); + } + else{ + arg0[1] = (f32) (sp2C + 80.0f); + } +} + +void func_802BD4C0(f32 arg0[3]) { + func_802BD3CC(arg0); + arg0[0] += D_8037D9B8[0]; + arg0[1] += D_8037D9B8[1]; + arg0[2] += D_8037D9B8[2]; +} + +f32 func_802BD51C(void) { + f32 sp24[3]; + f32 sp20; + f32 sp1C; + + player_getPosition(sp24); + sp20 = func_8028E82C(); + sp1C = D_8037D9A0 + 35.0f + 20.0f; + if (func_8028F2FC()) { + sp20 = func_8028EF88(); + } + if ((sp24[1] - sp20) > 130.0f) { + D_8037D978 = sp24[1] + func_802BD8C8() - 130.0f; + } else { + D_8037D978 = func_802BD8C8() + sp20; + } + if (D_8037D978 < sp1C) { + D_8037D978 = sp1C; + } + return D_8037D978; +} + +void func_802BD610(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3, f32 arg4, f32 arg5) { + f32 sp24[3]; + + sp24[0] = mlDiffDegF(arg0[0], arg1[0]); + sp24[1] = mlDiffDegF(arg0[1], arg1[1]); + sp24[0] *= 0.003333 * D_8037D984; + sp24[1] *= 0.003333 * D_8037D988; + sp24[0] = func_80259198(sp24[0], D_8037D98C * 0.003333); + sp24[1] = func_80259198(sp24[1], D_8037D990 * 0.003333); + sp24[2] = 0.0f; + arg1[0] = mlNormalizeAngle(arg1[0] + sp24[0]); + arg1[1] = mlNormalizeAngle(arg1[1] + sp24[1]); +} + +void func_802BD720(f32 arg0[3]) { + f32 sp24[3]; + + func_802BD3A8(sp24); + func_802BD780(arg0, sp24, D_8037D984, D_8037D988, D_8037D98C, D_8037D990); + func_802BD35C(sp24); +} + +void func_802BD780(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3, f32 arg4, f32 arg5) { + s32 temp_s0; + s32 temp_s1; + s32 i; + + temp_s1 = func_8033DD90() * 5; + for(i = 0; i < temp_s1; i++){ + func_802BD610(arg0, arg1, arg2, arg3, arg4, arg5); + } +} + +void func_802BD82C(f32 arg0, f32 arg1){ + D_8037D97C = arg0; + D_8037D980 = arg1; +} + +void func_802BD840(void){ + func_802BD82C(110.0f, 180.0f); +} + +void func_802BD870(f32 arg0, f32 arg1, f32 arg2, f32 arg3) { + D_8037D984 = arg0; + D_8037D988 = arg1; + D_8037D98C = arg2; + D_8037D990 = arg3; +} + +void func_802BD8A4(f32 arg0, f32 arg1, f32 arg2) { + D_8037D994 = arg0; + D_8037D998 = arg1; + D_8037D99C = arg2; +} + +f32 func_802BD8C8(void){ + return D_8037D99C; +} + +f32 func_802BD8D4(void){ + return D_8037D994; +} + +f32 func_802BD8E0(void){ + return D_8037D998; +} + +void func_802BD8EC(f32 arg0){ + D_8037D974 = arg0; +} + +f32 func_802BD8F8(void){ + return D_8037D974; +} + +void func_802BD904(f32 arg0[3]) { + f32 sp5C[3]; + f32 sp50[3]; + f32 sp44[3]; + f32 sp38[3]; + f32 sp34; + f32 sp30; + + if (func_802BC428()) { + ml_vec3f_clear(D_8037D9C8); + func_802BD35C(arg0); + return; + } + + sp34 = time_getDelta(); + func_802BD3A8(sp5C); + sp50[0] = mlDiffDegF(arg0[0], sp5C[0]); + sp50[1] = mlDiffDegF(arg0[1], sp5C[1]); + sp50[2] = 0.0f; + sp44[0] = sp50[0] * sp34 * D_8037D9D4; + sp44[1] = sp50[1] * sp34 * D_8037D9D4; + sp44[2] = 0.0f; + sp38[0] = sp44[0] - D_8037D9C8[0]; + sp38[1] = sp44[1] - D_8037D9C8[1]; + sp38[0] = D_8037D9D8*(0.0333*sp38[0]); + sp38[1] = D_8037D9D8*(0.0333*sp38[1]); + D_8037D9C8[0] += sp38[0]; + D_8037D9C8[1] += sp38[1]; + + sp30 = mlAbsF(D_8037D9C8[0]); + if ((mlAbsF(sp50[0]) < sp30) && (D_8037D9C8[0]*sp50[0] > 0.0f)) { + D_8037D9C8[0] = 0.0f; + sp5C[0] = arg0[0]; + } + sp30 = mlAbsF(D_8037D9C8[1]); + if ((mlAbsF(sp50[1]) < sp30) && (D_8037D9C8[1]*sp50[1] > 0.0f)) { + D_8037D9C8[1] = 0.0f; + sp5C[1] = arg0[1]; + } + sp5C[0] = mlNormalizeAngle(sp5C[0] + D_8037D9C8[0]); + sp5C[1] = mlNormalizeAngle(sp5C[1] + D_8037D9C8[1]); + func_802BD35C(sp5C); +} + +void func_802BDB30(f32 arg0, f32 *arg1, f32 *arg2, f32 arg3, f32 arg4, f32 arg5) { + f32 phi_f0; + f32 sp38; + s32 pad34; + f32 sp30; + f32 sp2C; + + if (arg0 == *arg1) { + *arg2 = 0.0f; + return; + } + sp30 = time_getDelta(); + sp38 = mlDiffDegF(arg0, *arg1); + if (mlAbsF(sp38) < arg5) { + *arg2 = func_80257D30(sp38, 0.0f, arg5, 10.0f, arg4); + } else { + phi_f0 = arg3 * sp30; + if (sp38 < 0.0f) { + phi_f0 = -phi_f0; + } + *arg2 += phi_f0; + if (*arg2 < 0.0f) { + if (*arg2 < -arg4) { + *arg2 = -arg4; + } + } else if (arg4 < *arg2) { + *arg2 = arg4; + } + } + sp2C = *arg2 * sp30; + if (( mlAbsF(sp2C) > mlAbsF(sp38)) && ((sp2C * sp38) > 0.0f)) { + *arg2 = 0.0f; + *arg1 = arg0; + sp2C = 0.0f; + } + *arg1 = mlNormalizeAngle(*arg1 + sp2C); +} + +void func_802BDCE0(f32 arg0, f32 *arg1, f32 *arg2, f32 arg3, f32 arg4) { + f32 sp34; + f32 sp30; + f32 sp24; + f32 sp28; + + sp28 = time_getDelta(); + sp34 = mlDiffDegF(arg0, *arg1); + sp30 = (sp34 * sp28 * arg3) - *arg2; + *arg2 = (0.0333*sp30)*arg4; + if ((mlAbsF(sp34) < 0.5) || ((mlAbsF(*arg2) > mlAbsF(sp34)) && ((sp34 * *arg2) > 0.0f))) { + *arg2 = 0.0f; + *arg1 = arg0; + } + *arg1 = mlNormalizeAngle(*arg1 + *arg2); +} + + +int func_802BDE10(f32 arg0, f32 arg1){ + f32 sp1C; + sp1C = mlAbsF(arg0); + return (mlAbsF(arg1) < sp1C) && (0.0f <= arg0*arg1); +} + +void func_802BDE88(f32 *arg0, f32 *arg1, f32 arg2, f32 arg3, f32 arg4) { + f32 temp_f14; + f32 temp_f2; + s32 end; + s32 i; + + end = func_8033DD90()*5; + for(i = 0; i < end; i++){ + temp_f14 = arg2 - *arg1; + temp_f2 = temp_f14*arg3 - *arg0; + *arg0 += temp_f2* arg4; + if (func_802BDE10(*arg0, temp_f14)) { + *arg0 = 0.0f; + *arg1 = arg2; + return; + } + *arg1 = *arg0 + *arg1; + } +} + +void func_802BDF5C(f32 arg0[3], f32 arg1[3]) { + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + + + sp54[0] = arg0[0] - arg1[0]; + sp54[1] = arg0[1] - arg1[1]; + sp54[2] = arg0[2] - arg1[2]; + + sp48[0] = D_8037D9EC * (0.003333 * sp54[0]); + sp48[1] = D_8037D9EC * (0.003333 * sp54[1]); + sp48[2] = D_8037D9EC * (0.003333 * sp54[2]); + + sp3C[0] = sp48[0] - D_8037D9E0[0]; + sp3C[1] = sp48[1] - D_8037D9E0[1]; + sp3C[2] = sp48[2] - D_8037D9E0[2]; + + D_8037D9E0[0] += sp3C[0] * 0.003333 * D_8037D9F0; + D_8037D9E0[1] += sp3C[1] * 0.003333 * D_8037D9F0; + D_8037D9E0[2] += sp3C[2] * 0.003333 * D_8037D9F0; + + if (func_802BDE10(D_8037D9E0[0], sp54[0])) { + D_8037D9E0[0] = 0.0f; + arg1[0] = arg0[0]; + } + if (func_802BDE10(D_8037D9E0[1], sp54[1])) { + D_8037D9E0[1] = 0.0f; + arg1[1] = arg0[1]; + } + if (func_802BDE10(D_8037D9E0[2], sp54[2])) { + D_8037D9E0[2] = 0.0f; + arg1[2] = arg0[2]; + } + + arg1[0] = arg1[0] + D_8037D9E0[0]; + arg1[1] = arg1[1] + D_8037D9E0[1]; + arg1[2] = arg1[2] + D_8037D9E0[2]; +} + +void func_802BE190(f32 arg0[3]){ + f32 sp34[3]; + int i; + int end; + + if(func_802BC428()){ + ml_vec3f_clear(D_8037D9E0); + func_802BD334(arg0); + return; + } + + end = func_8033DD90()*5; + func_802BD384(sp34); + for(i = 0; i < end; i++){ + func_802BDF5C(arg0, sp34); + } + func_802BD334(sp34); +} + +void func_802BE230(f32 arg0, f32 arg1){ + D_8037D9EC = arg0; + D_8037D9F0 = arg1; +} + +void func_802BE244(f32 arg0, f32 arg1){ + D_8037D9D4 = arg0; + D_8037D9D8 = arg1; +} + +void func_802BE258(f32 arg0[3], f32 arg1){ + f32 sp54[3]; + int i; + s32 pad; + + for(i = 0; func_80320DB0(arg0, arg1, sp54, 0x9e0000) && i < 1; i++){//L802BE2C0 + if((sp54[0]*sp54[0] + sp54[1]*sp54[1] + sp54[2]*sp54[2]) < 0.01) + return; + arg0[0] += 1.5f * sp54[0]; + arg0[1] += 1.5f * sp54[1]; + arg0[2] += 1.5f * sp54[2]; + } +} + +void func_802BE384(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3[3], f32 arg4[3]){ + f32 sp34[3]; + f32 sp28[3]; + f32 sp1C[3]; + f32 dp; + + sp34[0] = arg3[0] - arg2[0]; + sp34[1] = arg3[1] - arg2[1]; + sp34[2] = arg3[2] - arg2[2]; + + sp28[0] = arg1[0] - arg0[0]; + sp28[1] = arg1[1] - arg0[1]; + sp28[2] = arg1[2] - arg0[2]; + + sp1C[0] = sp34[0] - sp28[0]; + sp1C[1] = sp34[1] - sp28[1]; + sp1C[2] = sp34[2] - sp28[2]; + dp = -ml_vec3f_dot_product(arg4, sp1C); + arg3[0] += dp*arg4[0]; + arg3[1] += dp*arg4[1]; + arg3[2] += dp*arg4[2]; + +} + +void func_802BE484(f32 arg0[3], f32 arg1[3]){ + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + f32 sp30[3]; + int sp2C; + s32 tmp_v0; + + func_802BE258(arg0, 35.0f); + ml_vec3f_copy(sp48, arg0); + ml_vec3f_copy(sp3C, arg1); + ml_vec3f_diff_copy(sp30, sp3C, sp48); + ml_vec3f_normalize(sp30); + ml_vec3f_scale(sp30, 35.0f); + + sp3C[0] += sp30[0]; + sp3C[1] += sp30[1]; + sp3C[2] += sp30[2]; + sp2C = func_80320B98(sp48, sp3C, sp54, 0x9e0000); + ml_vec3f_diff(sp3C, sp30); + + tmp_v0 = func_8024575C(sp48, sp3C, 35.0f, sp54, 3, 0x9e0000); + if(sp2C || tmp_v0){ + func_802BE384(sp48, sp3C, arg0, arg1, sp54); + ml_vec3f_diff_copy(sp30, arg1, arg0); + ml_vec3f_normalize(sp30); + ml_vec3f_scale(sp30, 35.0f); + arg1[0] += sp30[0]; + arg1[1] += sp30[1]; + arg1[2] += sp30[2]; + func_80320B98(arg0, arg1, sp54, 0x9e0000); + ml_vec3f_diff(arg1, sp30); + } +} + +int func_802BE60C(void){ + f32 sp1C[3]; + + if(func_802BC428()) + return 0; + + if(map_get() == MAP_91_FILE_SELECT) + return 0; + + ml_vec3f_copy(sp1C, D_8037D958); + func_802BE484(D_8037D948, D_8037D958); + return !(sp1C[0] == D_8037D958[0]) || !(sp1C[1] == D_8037D958[1]) || !(sp1C[2] == D_8037D958[2]); +} + +void func_802BE6FC(f32 arg0[3], f32 arg1[3]){ + func_802BC434(arg0, arg1, D_8037D958); +} + +void func_802BE720(void){ + s32 sp34; + f32 sp28[3]; + f32 sp1C[3]; + + func_8024C5CC(sp28); + func_8024C764(sp1C); + func_802BD334(sp28); + func_802BD35C(sp1C); + + sp34 = func_802BD0CC(); + func_802BD0D8(0); + func_802BD0D8(sp34); + ml_vec3f_clear(D_8037D9C8); + ml_vec3f_clear(D_8037D9E0); + func_802C28C8(); +} + +void func_802BE794(void){ + f32 sp2C[3]; + f32 sp20[3]; + if(D_8037D9F4 == 1 || D_8037D9F4 == 0xb || D_8037D9F4 == 3){ + player_getPosition(sp2C); + sp2C[1] += 100.0f; + player_getRotation(sp20); + sp20[1] = mlNormalizeAngle(sp20[1] + 180.0f); + func_8024CD88(sp2C); + func_8024CE18(sp20); + func_8024C510(300.0f); + func_802BE720(); + }//L802BE828 +} + +int func_802BE834(f32 arg0[3]){ + s32 pad; + f32 sp30[3]; + f32 sp24[3]; + f32 sp18[3]; + + ml_vec3f_copy(sp18, arg0); + player_getPosition(sp30); + sp30[1] += 60.0f; + if(func_80320B98(sp30, sp18, sp24, 0x9e0000)) + return 0; + return 1; + +} + +void func_802BE894(f32 arg0[3], f32 arg1[3]){ + f32 sp1C[3]; + func_802C02D4(sp1C); + func_802BC434(arg0, sp1C, arg1); + arg0[2] = 0.0f; +} + +void func_802BE8D8(void){ + D_8037D9F7 = 1; + func_802C29A0(1); + func_802C2A64(D_8037D958); + func_802C2A8C(D_8037D968); +} + +void func_802BE91C(void){ + func_802C29A0(3); +} diff --git a/src/core2/code_379B0.c b/src/core2/code_379B0.c new file mode 100644 index 00000000..1152a503 --- /dev/null +++ b/src/core2/code_379B0.c @@ -0,0 +1,101 @@ +#include +#include "functions.h" +#include "variables.h" + +/*.bss */ +f32 D_8037DA00[3]; +f32 D_8037DA10[3]; +f32 D_8037DA20[3]; +f32 D_8037DA30[3]; +f32 D_8037DA40[3]; + +/* .code */ +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_379B0/func_802BE940.s") +#else +void func_802BE940(void) { + f32 sp3C[3]; + f32 sp38; + f32 sp34; + f32 sp30; + f32 sp24[3]; + f32 sp1C; + + sp3C[0] = sp3C[1] = sp3C[2] = 0.0f; + sp3C[1] = -1.0f; + ml_vec3f_pitch_rotate_copy(sp24, sp3C, 68.0f); + sp1C = 0.0f; + sp34 = sp24[1] * ((f32) D_80276588 / (f32) D_8027658C); + D_8037DA40[0] = sp24[0]; + D_8037DA40[1] = sp24[1]; + D_8037DA40[2] = sp24[2]; + + D_8037DA00[0] = (f32) (sp24[0] + sp34); + D_8037DA00[1] = (f32) (sp24[1] + sp1C); + D_8037DA00[2] = sp24[2]; + + D_8037DA10[0] = (f32) (sp34 - sp24[0]); + D_8037DA10[1] = (f32) (sp1C - sp24[1]); + D_8037DA10[2] = sp24[2]; + + sp30 = -sp34; + sp38 = -0.0f; + D_8037DA20[0] = (f32) (sp30 - sp24[0]); + D_8037DA20[1] = (f32) (sp38 - sp24[1]); + D_8037DA20[2] = sp24[2]; + + D_8037DA30[0] = (f32) (sp24[0] + sp30); + D_8037DA30[1] = (f32) (sp24[1] + sp38); + D_8037DA30[2] = sp24[2]; +} +#endif + +void func_802BEA4C(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3[3]) { + f32 sp24[3]; + + func_80256E24(sp24, arg0[0], arg0[1], 0.0f, 0.0f, -arg2); + ml_vec3f_add(arg3, sp24, arg1); +} + + +void func_802BEAAC(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3[3], f32 arg4[3], f32 arg5[3], f32 arg6[3]) { + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + f32 sp30[3]; + f32 pitch; + f32 yaw; + + pitch = arg0[0]; + yaw = arg0[1]; + ml_vec3f_pitch_rotate_copy(sp54, D_8037DA00, pitch); + ml_vec3f_pitch_rotate_copy(sp48, D_8037DA10, pitch); + ml_vec3f_pitch_rotate_copy(sp3C, D_8037DA20, pitch); + ml_vec3f_pitch_rotate_copy(sp30, D_8037DA30, pitch); + ml_vec3f_yaw_rotate_copy(sp54, sp54, yaw); + ml_vec3f_yaw_rotate_copy(sp48, sp48, yaw); + ml_vec3f_yaw_rotate_copy(sp3C, sp3C, yaw); + ml_vec3f_yaw_rotate_copy(sp30, sp30, yaw); + ml_vec3f_scale(sp54, arg2); + ml_vec3f_scale(sp48, arg2); + ml_vec3f_scale(sp3C, arg2); + ml_vec3f_scale(sp30, arg2); + ml_vec3f_add(arg3, arg1, sp54); + ml_vec3f_add(arg4, arg1, sp48); + ml_vec3f_add(arg5, arg1, sp3C); + ml_vec3f_add(arg6, arg1, sp30); +} + +void func_802BEBE8(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3[3]) { + f32 sp24[3]; + f32 sp20; + f32 sp1C; + + sp20 = arg0[0]; + sp1C = arg0[1]; + + ml_vec3f_pitch_rotate_copy(sp24, D_8037DA40, sp20); + ml_vec3f_yaw_rotate_copy(sp24, sp24, sp1C); + ml_vec3f_scale(sp24, arg2); + ml_vec3f_add(arg3, arg1, sp24); +} diff --git a/src/core2/code_37CD0.c b/src/core2/code_37CD0.c new file mode 100644 index 00000000..c38aa98b --- /dev/null +++ b/src/core2/code_37CD0.c @@ -0,0 +1,50 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +struct { + f32 unk0[3]; + f32 unkC[3]; + f32 unk18[3]; + f32 unk24[3]; +}D_8037DA50; + +/* .code */ +void func_802BEC60(void) { + s32 sp24[3]; + s32 sp18[3]; + + func_8024C5CC(D_8037DA50.unk0); + func_8024C764(D_8037DA50.unkC); + func_80309998(sp24, sp18); + + D_8037DA50.unk18[0] = (f32) sp24[0]; + D_8037DA50.unk18[1] = (f32) sp24[1]; + D_8037DA50.unk18[2] = (f32) sp24[2]; + + D_8037DA50.unk24[0] = (f32) sp18[0]; + D_8037DA50.unk24[1] = (f32) sp18[1]; + D_8037DA50.unk24[2] = (f32) sp18[2]; +} + + +void func_802BED00(void){ + func_8024CD88(D_8037DA50.unk0); + func_8024CE18(D_8037DA50.unkC); +} + +void func_802BED30(void) { + f32 sp24[3]; + f32 sp18[3]; + + sp24[0] = randf2(D_8037DA50.unk18[0], D_8037DA50.unk24[0]);\ + sp24[1] = randf2(D_8037DA50.unk18[1], D_8037DA50.unk24[1]);\ + sp24[2] = randf2(D_8037DA50.unk18[2], D_8037DA50.unk24[2]); + + sp18[0] = randf2(-90.0f, 90.0f);\ + sp18[1] = randf2(0.0f, 360.0f);\ + sp18[2] = 0.0f; + func_8024CD88(sp24); + func_8024CE18(sp18); +} diff --git a/src/core2/code_37E50.c b/src/core2/code_37E50.c new file mode 100644 index 00000000..ade78fb8 --- /dev/null +++ b/src/core2/code_37E50.c @@ -0,0 +1,112 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + u8 map_id; + u8 rgb[3]; + u8 alpha; +}Struct_core2_37E50_0; + +Struct_core2_37E50_0 D_80365D60[] ={ + {MAP_3_UNUSED, {0x00, 0xD0, 0xBF}, 0x50}, + {MAP_B_CC_CLANKERS_CAVERN, {0x78, 0x6D, 0x39}, 0x50}, + {MAP_22_CC_INSIDE_CLANKER, {0x78, 0x6D, 0x39}, 0x50}, + {MAP_31_RBB_RUSTY_BUCKET_BAY, {0x32, 0x32, 0x32}, 0xA0}, + {MAP_8B_RBB_ANCHOR_ROOM, {0x32, 0x32, 0x32}, 0xA0}, + {MAP_35_RBB_WAREHOUSE, {0x32, 0x32, 0x32}, 0xA0}, + {0x00, {0x34, 0x6E, 0xEF}, 0x5A} +}; + +/* .bss */ +struct { + Struct_core2_37E50_0 *unk0; + f32 unk4; + s32 unk8; + s32 unkC; + f32 unk10; +}D_8037DA80; + +/* .code */ +Struct_core2_37E50_0 *func_802BEDE0(enum map_e map_id){ + u8 *temp_v1; + u8 temp_v0; + u8 phi_v0; + u8 *phi_v1; + u8 *phi_v1_2; + Struct_core2_37E50_0 *iPtr; + + phi_v1 = &D_80365D60; + phi_v1_2 = &D_80365D60; + for(iPtr = D_80365D60; iPtr->map_id != 0; iPtr++){ + if(map_id == iPtr->map_id){ + return iPtr; + } + } + return iPtr; +} + +void func_802BEE2C(Gfx **gfx, Mtx **mtx, Vtx **vtx) { + s32 sp44; + s32 i; + f32 phi_f2; + s32 sp30[3]; + + if (!D_8037DA80.unkC) + return; + + phi_f2 = (3000.0f < D_8037DA80.unk4) ? 1.0f : D_8037DA80.unk4 / 3000.0f; + for(i = 0; i < 3; i++){ + sp30[i] = D_8037DA80.unk0->rgb[i] + phi_f2 * 0.4*(-D_8037DA80.unk0->rgb[i]); + } + sp44 = D_8037DA80.unk0->alpha * phi_f2 + D_8037DA80.unk0->alpha; + gcbound_reset(); + gcbound_alpha(sp44); + gcbound_color(sp30[0], sp30[1], sp30[2]); + gcbound_draw(gfx); +} + +bool func_802BEF58(void){ + return D_8037DA80.unk8; +} + +bool func_802BEF64(void){ + return D_8037DA80.unkC; +} + +void func_802BEF70(void){} + +void func_802BEF78(void){ + D_8037DA80.unk0 = func_802BEDE0(map_get()); + D_8037DA80.unk8 = 0; + D_8037DA80.unkC = 0; +} + +void func_802BEFB0(void) { + f32 sp3C[3]; + f32 sp30[3]; + f32 sp24[3]; + Struct5Es *temp_v0; + + if (level_get() == LEVEL_D_CUTSCENE) { + D_8037DA80.unk8 = 0; + D_8037DA80.unkC = 0; + return; + } + D_8037DA80.unk10 += time_getDelta(); + func_8024C5CC(sp30); + sp24[0] = sp30[0]; + sp24[1] = sp30[1] + 10000.0f; + sp24[2] = sp30[2]; + D_8037DA80.unkC = (func_80309B48(sp30, sp24, sp3C, 0xF800FF0F) != NULL); + if (D_8037DA80.unkC) { + D_8037DA80.unk8 = 1; + D_8037DA80.unk4 = sp24[1] - sp30[1]; + return; + } + sp24[0] = sp30[0]; + sp24[1] = sp30[1] - 200.0f; + sp24[2] = sp30[2]; + temp_v0 = func_80309B48(sp30, sp24, sp3C, 0xF800FF0F); + D_8037DA80.unk8 = (temp_v0 != NULL) && (temp_v0->unk8 & 0x1E0000); +} diff --git a/src/core2/code_38150.c b/src/core2/code_38150.c new file mode 100644 index 00000000..d8c8bd43 --- /dev/null +++ b/src/core2/code_38150.c @@ -0,0 +1,57 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +f32 D_8037DAA0; + +/* .code */ +void func_802BF0E0(f32 arg0[3]){ + if(func_8028ECAC() == BSGROUP_5_CLIMB){ + func_802C0150(3); + } + else{ + func_802C0150(1); + } + func_802C02D4(arg0); +} + +void func_802BF12C(void){ + f32 sp34[3]; + f32 sp28[3]; + f32 sp1C[3]; + + func_802BD384(sp34); + func_802BF0E0(sp1C); + ml_vec3f_diff_copy(sp28, sp34, sp1C); + func_8025801C(sp28, &D_8037DAA0); +} + +void func_802BF174(void){ + func_802BE244(4.0f, 16.0f); + func_802BE230(1.1f, 14.0f); + func_802C0150(3); + func_802BF12C(); +} + +void func_802BF1CC(void){} + +void func_802BF1D4(void){ + f32 sp5C[3]; + f32 sp50[3]; + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + s32 pad28; + + player_getVelocity(sp44); + func_802BF0E0(sp5C); + func_80256E24(sp38, 0.0f, D_8037DAA0, 0.0f, 0.0f,func_802BD8D4()); + ml_vec3f_add(sp50, sp5C, sp38); + func_802BE190(sp50); + if(func_802BE60C()){ + func_802BC84C(0); + } + func_802BE6FC(sp2C, sp5C); + func_802BD904(sp2C); +} diff --git a/src/core2/code_382E0.c b/src/core2/code_382E0.c new file mode 100644 index 00000000..30e038c7 --- /dev/null +++ b/src/core2/code_382E0.c @@ -0,0 +1,42 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .data */ +extern f32 D_80365D90; + +/* .code */ +void func_802BF270(void){ + func_802BE244(4.0f, 16.0f); + func_802BE230(1.4f, 14.0f); +} + +void func_802BF2B8(void){} + +void func_802BF2C0(f32 arg0){ + D_80365D90 = arg0; +} + +void func_802BF2CC(void) { + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + f32 sp30[3]; + f32 sp2C; + + player_getPosition(sp3C); + sp3C[1] += 120.0f; + func_802BD384(sp54); + func_80257F18(sp3C, sp54, &sp2C); + func_80256E24(sp30, 0.0f, sp2C, 0.0f, 0.0f, 200.0f); + sp3C[0] += sp30[0]; + sp3C[1] += sp30[1]; + sp3C[2] += sp30[2]; + func_802BE190(sp3C); + func_802BD384(sp54); + player_getPosition(sp3C); + sp3C[1] += D_80365D90; + func_8025727C(sp3C[0], sp3C[1], sp3C[2], sp54[0], sp54[1], sp54[2], &sp48[0], &sp48[1]); + sp48[0] = mlNormalizeAngle(-sp48[0]); + func_802BD904(sp48); +} diff --git a/src/core2/code_38460.c b/src/core2/code_38460.c new file mode 100644 index 00000000..bacf20f1 --- /dev/null +++ b/src/core2/code_38460.c @@ -0,0 +1,47 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +f32 D_8037DAB0[3]; +f32 D_8037DABC; + +/* .code */ +void func_802BF3F0(void) { + func_802BE244(5.0f, 10.0f); + func_802BE230(5.0f, 8.0f); + ml_vec3f_clear(D_8037DAB0); + D_8037DABC = 0.0f; +} + +void func_802BF44C(void){} + +void func_802BF454(void) { + f32 sp74[3]; + f32 sp68[3]; + f32 sp5C[3]; + f32 sp50[3]; + f32 sp44[3]; + f32 sp38[3]; + s32 pad34; + f32 sp30; + + func_802BD384(sp44); + player_getPosition(sp74); + sp74[1] += 60.0f; + ml_vec3f_diff_copy(sp5C, sp44, sp74); + sp30 = ml_map_f(D_8037DABC, 0.2f, 0.5f, gu_sqrtf(sp5C[0] * sp5C[0] + sp5C[1] * sp5C[1] + sp5C[2] * sp5C[2]), 300.0f); + D_8037DABC += time_getDelta(); + ml_vec3f_scale_copy(sp50, D_8037DAB0, sp30); + ml_vec3f_diff_copy(sp68, sp74, sp50); + func_802BE190(sp68); + func_802BD384(sp68); + func_8025727C(sp74[0], sp74[1], sp74[2], sp68[0], sp68[1], sp68[2], &sp38[0], &sp38[1]); + sp38[0] = -sp38[0]; + sp38[2] = 0.0f; + func_802BD904(sp38); +} + +void func_802BF590(f32 arg0[3]){ + ml_vec3f_normalize_copy(D_8037DAB0, arg0); +} diff --git a/src/core2/code_38630.c b/src/core2/code_38630.c new file mode 100644 index 00000000..14beca18 --- /dev/null +++ b/src/core2/code_38630.c @@ -0,0 +1,90 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_802BA40C(void *); +extern f32 func_802BA420(void *); + +/* .bss */ +f32 D_8037DAC0[3]; +f32 D_8037DAD0[3]; +f32 D_8037DADC; +f32 D_8037DAE0; +u8 D_8037DAE4; +u8 D_8037DAE5; +f32 D_8037DAE8; +f32 D_8037DAEC; + +/* .code */ +void func_802BF5C0(void){ + D_8037DAE5 = TRUE; + func_802C0150(1); +} + +void func_802BF5EC(void){} + +void func_802BF5F4(void) { + f32 sp64[3]; + f32 sp58[3]; + f32 sp4C[3]; + f32 sp40[3]; + f32 sp34[3]; + f32 sp30; + f32 sp24[3]; + f32 sp20; + + if (D_8037DAE5 == 0) { + func_802C02D4(sp64); + func_802BD384(sp58); + ml_vec3f_diff_copy(sp24, sp58, sp64); + sp24[1] = 0.0f; + sp20 = gu_sqrtf( sp24[0]*sp24[0] + sp24[2]*sp24[2] ); + if (sp20 < D_8037DAE0) { + sp20 = D_8037DAE0; + } + if (D_8037DADC < sp20) { + sp20 = D_8037DADC; + } + ml_vec3f_diff_copy(sp34, D_8037DAC0, sp64); + sp34[1] = 0.0f; + sp30 = gu_sqrtf(sp34[0]*sp34[0] + sp34[2]*sp34[2]); + if (sp30 < sp20) { + sp20 = sp30; + } + ml_vec3f_set_length_copy(sp24, sp34, sp20); + sp24[0] += sp64[0]; + sp24[2] += sp64[2]; + sp24[1] = D_8037DAC0[1]; + func_802BE190(sp24); + if (D_8037DAE4) { + func_802BE60C(); + } + func_802BD384(sp58); + func_802BC434(sp4C, sp64, sp58); + func_802BC434(sp40, sp64, D_8037DAD0); + if (sp30 < 150.0f) { + sp4C[1] = sp40[1]; + } + func_802BD904(sp4C); + } +} + +void func_802BF798(void) { + f32 sp2C; + f32 sp28; + s32 temp_v0; + + temp_v0 = func_802B9E48(); + D_8037DAE4 = func_802BA4F0(temp_v0); + func_802BA3B8(temp_v0, &D_8037DAD0); + func_802BA434(temp_v0, &D_8037DAC0); + func_802BA480(temp_v0, &sp2C, &sp28); + func_802BE230(sp2C, sp28); + func_802BA4A8(temp_v0, &sp2C, &sp28); + func_802BE244(sp2C, sp28); + D_8037DAE8 = sp2C; + D_8037DAEC = sp28; + D_8037DAE0 = func_802BA420(temp_v0); + D_8037DADC = func_802BA40C(temp_v0); + D_8037DAE5 = 0; +} diff --git a/src/core2/code_388E0.c b/src/core2/code_388E0.c new file mode 100644 index 00000000..a5654504 --- /dev/null +++ b/src/core2/code_388E0.c @@ -0,0 +1,76 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_802BD51C(void); + + +/* .bss */ +f32 D_8037DAF0[3]; +f32 D_8037DB00[3]; +u8 D_8037DB0C; +u8 D_8037DB0D; +u8 D_8037DB0E; + +/* .code */ +void func_802BF870(void){ + D_8037DB0E = TRUE; +} + +void func_802BF880(void){} + +void func_802BF888(void) { + f32 sp5C[3]; + f32 sp50[3]; + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + f32 sp20[3]; + f32 pad1C; + + if(D_8037DB0E) + return; + + func_802BD384(sp44); + sp20[0] = D_8037DB00[0]; + sp20[1] = D_8037DB00[1]; + sp20[2] = D_8037DB00[2]; + sp44[0] = D_8037DAF0[0]; + sp44[2] = D_8037DAF0[2]; + if (D_8037DB0C) { + sp44[1] = D_8037DAF0[1]; + } else { + sp44[1] = func_802BD51C(); + } + func_802BE190(sp44); + if (D_8037DB0D) { + func_802BE60C(); + } + func_802BD384(sp44); + func_802BD4C0(sp5C); + ml_vec3f_diff_copy(sp50, sp5C, sp44); + func_802BC434(sp38, sp5C, sp44); + func_802BC434(sp2C, sp5C, sp20); + if (gu_sqrtf(sp50[0]*sp50[0] + sp50[2]*sp50[2]) < 100.0f) { + sp38[1] = sp2C[1]; + } + func_802BD904(sp38); +} + + +void func_802BF9B8(s32 arg0) { + f32 sp2C; + f32 sp28; + s32 temp_s0; + + temp_s0 = func_802B9E5C(arg0); + D_8037DB0C = func_802BA8BC(temp_s0); + D_8037DB0D = func_802BA87C(temp_s0); + func_802BA7D8(temp_s0, &D_8037DB00); + func_802BA78C(temp_s0, &D_8037DAF0); + func_802BA82C(temp_s0, &sp2C, &sp28); + func_802BE230(sp2C, sp28); + func_802BA854(temp_s0, &sp2C, &sp28); + func_802BE244(sp2C, sp28); + D_8037DB0E = 0; +} diff --git a/src/core2/code_38AD0.c b/src/core2/code_38AD0.c new file mode 100644 index 00000000..9ef8fa4a --- /dev/null +++ b/src/core2/code_38AD0.c @@ -0,0 +1,100 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_80259198(f32, f32); +extern f32 func_8028EBA4(void); +extern f32 func_8028EBE4(void); +extern void func_802BD870(f32, f32, f32, f32); + +void func_802BFE50(f32 arg0, f32 arg1, f32 arg2); +void func_802BFE74(bool); + +/* .bss */ +f32 D_8037DB10; +f32 D_8037DB14; +f32 D_8037DB18; +f32 D_8037DB1C; +f32 D_8037DB20; + +/* .code */ +void func_802BFA60(void) { + func_802BD870(10.0f, 20.0f, 120.0f, 200.0f); + if (map_get() == MAP_90_GL_BATTLEMENTS) { + func_802BFE50(10.0f, 800.0f, 1350.0f); + } else { + func_802BFE50(2.0f, 800.0f, 350.0f); + } + func_802BFE74(0); +} + +void func_802BFAE8(void){} + +void func_802BFAF0(void) { + f32 sp84[3]; + f32 sp78[3]; + f32 sp6C[3]; + f32 sp60[3]; + f32 sp54[3]; + f32 sp48[3]; + f32 sp44; + f32 temp_f10; + f32 sp3C; + f32 sp38; + f32 sp34; + + func_802BD384(sp6C); + func_802BD4C0(sp84); + sp84[1] += 40.0f; + sp34 = func_8028EBE4(); + if (sp34 > 180.0f) { + sp3C = ml_map_f(sp34, 300.0f, 360.0f, 900.0f, D_8037DB18); + sp84[1] += ml_map_f(sp34, 300.0f, 360.0f, -140.0f, 70.0f); + } else { + sp3C = D_8037DB18; + sp84[1] += 70.0f; + } + sp38 = time_getDelta(); + ml_vec3f_diff_copy(sp48, sp6C, sp84); + sp44 = gu_sqrtf(sp48[0]*sp48[0] + sp48[1]*sp48[1] + sp48[2]*sp48[2]); + temp_f10 = (sp3C - sp44) * sp38; + sp44 += func_80259198(temp_f10 * D_8037DB10, sp38 * D_8037DB14); + func_8025727C(sp84[0], sp84[1], sp84[2], sp6C[0], sp6C[1], sp6C[2], &sp54[0], &sp54[1]); + if ((sp34 > 180.0f) && (sp34 < 360.0f)) { + sp34 = min_f(100.0f, (f32) ((f64) (360.0f - sp34) * 1.4)); + } + sp48[0] = mlDiffDegF(mlNormalizeAngle(sp34), sp54[0]); + sp48[1] = mlDiffDegF(mlNormalizeAngle(func_8028EBA4() + 180.0f), sp54[1]); + sp48[2] = 0.0f; + sp48[0] = (f32) ((f64) sp48[0] * ((f64) sp38 * 0.8)); + sp48[1] = sp48[1] * (sp38 * D_8037DB1C); + sp48[0] = func_80259198(sp48[0], sp38 * 40.0f); + sp48[1] = func_80259198(sp48[1], sp38 * D_8037DB20); + sp54[0] = mlNormalizeAngle(sp54[0] + sp48[0]); + sp54[1] = mlNormalizeAngle(sp54[1] + sp48[1]); + + func_80256E24(sp60, -sp54[0], sp54[1], 0.0f, 0.0f, sp44); + ml_vec3f_add(sp78, sp84, sp60); + func_802BD334(sp78); + func_8025727C(sp84[0], sp84[1], sp84[2], sp78[0], sp78[1], sp78[2], &sp54[0], &sp54[1]); + sp54[0] = -sp54[0]; + sp54[2] = 0.0f; + func_802BD720(sp54); +} + +void func_802BFE50(f32 arg0, f32 arg1, f32 arg2){ + D_8037DB10 = arg0; + D_8037DB14 = arg1; + D_8037DB18 = arg2; +} + +void func_802BFE74(bool arg0) { + if (arg0) { + D_8037DB1C = 6.0f; + D_8037DB20 = 270.0f; + } + else{ + D_8037DB1C = 2.0f; + D_8037DB20 = 90.0f; + } +} diff --git a/src/core2/code_38F40.c b/src/core2/code_38F40.c new file mode 100644 index 00000000..69bfe470 --- /dev/null +++ b/src/core2/code_38F40.c @@ -0,0 +1,75 @@ +#include +#include "functions.h" +#include "variables.h" + +/*.bss */ +struct { + f32 unk0; + f32 unk4; + f32 unk8; +}D_8037DB30; + +/* .code */ +void func_802BFED0(void){ + f32 sp34; + f32 sp28[3]; + f32 sp1C[3]; + + player_getPosition(sp28); + func_802BD384(sp1C); + func_80257F18(sp28, sp1C, &sp34); + D_8037DB30.unk8 = sp34; + D_8037DB30.unk4 = 0.0f; +} + +void func_802BFF1C(void) { + func_802BE244(4.0f, 16.0f); + func_802BE230(1.8f, 14.0f); + D_8037DB30.unk0 = 290.0f; + func_802BFED0(); +} + +void func_802BFF78(void){} + +void func_802BFF80(f32 arg0){ + D_8037DB30.unk0 = arg0; +} + +void func_802BFF8C(void) { + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + f32 sp30[3]; + f32 tmp1; + + player_getPosition(sp3C); + sp3C[1] += 160.0f; + tmp1 = D_8037DB30.unk8; + func_80256E24(sp30, D_8037DB30.unk4, tmp1, 0.0f, 0.0f, D_8037DB30.unk0); + sp3C[0] += sp30[0]; + sp3C[1] += sp30[1]; + sp3C[2] += sp30[2]; + func_802BE190(sp3C); + switch(map_get()){ + case MAP_B_CC_CLANKERS_CAVERN: + case MAP_14_GV_SANDYBUTTS_MAZE: + case MAP_27_FP_FREEZEEZY_PEAK: + case MAP_48_FP_MUMBOS_SKULL: + if (!func_802BE834(sp3C)) { + D_8037DB30.unk4 = max_f(D_8037DB30.unk4 - 8.0f, -75.0f); + } + break; + default: + if (func_802BC84C(1)) { + func_802BFED0(); + return; + } + break; + } + func_802BD384(sp54); + player_getPosition(sp3C); + sp3C[1] += 100.0f; + func_8025727C(sp3C[0], sp3C[1], sp3C[2], sp54[0], sp54[1], sp54[2], &sp48[0], &sp48[1]); + sp48[0] = mlNormalizeAngle(-sp48[0]); + func_802BD904(sp48); +} diff --git a/src/core2/code_39190.c b/src/core2/code_39190.c new file mode 100644 index 00000000..31d5ef6f --- /dev/null +++ b/src/core2/code_39190.c @@ -0,0 +1,183 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_802BD51C(void); + + +void func_802C0150(s32 arg0); + +/* .bss */ +u8 D_8037DB40; +f32 D_8037DB48[3]; +f32 D_8037DB58[3]; +f32 D_8037DB70; +f32 D_8037DB78[3]; +f32 D_8037DB84[3]; +f32 D_8037DB90[3]; +f32 D_8037DB9C; + +/* .code */ +void func_802C0120(void){ + D_8037DB40 = 0; + func_802C0150(2); +} + +void func_802C0148(void){} + +void func_802C0150(s32 arg0) { + D_8037DB40 = arg0; + if (arg0 == 6) { + func_802BD4C0(D_8037DB48); + ml_vec3f_clear(D_8037DB58); + } +} + +s32 func_802C0190(void){ + return D_8037DB40; +} + +void func_802C019C(f32 arg0[3]){ + func_802BD3CC(arg0); +} + +void func_802C01BC(f32 arg0[3]){ + func_802BD4C0(arg0); +} + +void func_802C01DC(f32 arg0[3]) { + f32 sp1C[3]; + + func_8028E7EC(sp1C); + player_getPosition(arg0); + arg0[0] = sp1C[0]; + arg0[1] += 90.0f; + arg0[2] = sp1C[2]; +} + +void func_802C0234(f32 arg0[3]) { + player_getPosition(arg0); + arg0[1] += 60.0f; +} + +void func_802C026C(f32 arg0[3]) { + f32 sp1C[3]; + + func_802BD4C0(arg0); + player_getPosition(sp1C); + arg0[1] = sp1C[1]; + arg0[1] += 60.0f; +} + +void func_802C02B4(f32 arg0[3]){ + func_802BD4C0(arg0); +} + +void func_802C02D4(f32 arg0[3]) { + switch(D_8037DB40){ + case 1: + func_802C019C(arg0); + break; + + case 2: + func_802C01BC(arg0); + break; + + case 3: + func_802C01DC(arg0); + break; + + case 4: + func_802C0234(arg0); + break; + + case 5: + func_802C026C(arg0); + break; + + case 6: + func_802C02B4(arg0); + break; + } +} + + +void func_802C0370(){ + func_802BD384(D_8037DB84); +} + +void func_802C0394(f32 src[3]){ + ml_vec3f_copy(D_8037DB90, src); +} + +void func_802C03BC(void) { + f32 sp2C[3]; + f32 sp20[3]; + f32 sp1C; + + func_802BD384(D_8037DB78); + ml_vec3f_diff_copy(sp20, D_8037DB90, D_8037DB84); + ml_vec3f_diff_copy(sp2C, D_8037DB78, D_8037DB84); + ml_vec3f_normalize(sp20); + ml_vec3f_normalize(sp2C); + sp1C = sp20[0]*sp2C[0] + sp20[1]*sp2C[1] + sp20[2]*sp2C[2]; + if (sp1C < 0.0f || D_8037DB9C < 0.0f) { + func_802BD334(D_8037DB84); + } + D_8037DB9C = sp1C; +} + +void func_802C0490(f32 arg0[3]){ + func_802C02D4(arg0); +} + +void func_802C04B0(void) { + f32 sp34[3]; + f32 sp28[3]; + f32 sp1C[3]; + + func_802BD384(sp34); + func_802C0490(sp1C); + ml_vec3f_diff_copy(sp28,sp34, sp1C); + func_8025801C(sp28, &D_8037DB70); +} + +void func_802C04F8(void) { + func_802BE244(5.0f, 10.0f); + func_802BE230(3.0f, 8.0f); + func_802C0150(2); + func_802C04B0(); +} + +void func_802C0550(void){} + +void func_802C0558(void) { + f32 sp4C[3]; + f32 sp40[3]; + f32 sp34[3]; + f32 sp28[3]; + s32 sp24; + + func_802C0370(); + func_802C0490(sp4C); + func_80256E24(sp34, 0.0f, D_8037DB70, 0.0f, 0.0f, func_802BD8D4()); + ml_vec3f_add(sp40, sp4C, sp34); + sp40[1] = func_802BD51C(); + func_802C0394(sp40); + func_802BE190(sp40); + sp24 = 0; + if (func_802BE60C() != 0) { + if (func_802BC84C(1) != 0) { + sp24 = 1; + } else { + func_802C03BC(); + } + func_802C04B0(); + } + func_802C0490(sp4C); + func_802BE6FC(sp28, sp4C); + if (sp24) { + func_802BD35C(sp28); + } + func_802BD904(sp28); +} diff --git a/src/core2/code_396B0.c b/src/core2/code_396B0.c new file mode 100644 index 00000000..bb9169e4 --- /dev/null +++ b/src/core2/code_396B0.c @@ -0,0 +1,90 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern f32 func_8028EBA4(void); +extern f32 func_802BD51C(); +extern void func_802BDB30(f32, f32*, f32*, f32, f32, f32); +extern void func_802C2264(f32); + +void func_802C095C(void); + +/* .bss */ +f32 D_8037DBA0; +f32 D_8037DBA4; +f32 D_8037DBA8; +f32 D_8037DBAC; + +/* .code */ +bool func_802C0640(void){ + return mlAbsF(mlDiffDegF(D_8037DBA4, D_8037DBA8)) < 4.0; +} + +void func_802C0694(void){} + +void func_802C069C(void) { + f32 sp34[3]; + f32 sp28[3]; + f32 sp1C[3]; + + func_802BD384(sp34); + func_802C02D4(sp1C); + ml_vec3f_diff_copy(sp28, sp34, sp1C); + D_8037DBA0 = gu_sqrtf(sp28[0]*sp28[0] + sp28[2]*sp28[2]); + func_8025801C(sp28, &D_8037DBA8); + D_8037DBAC = 0.0f; +} + +void func_802C0710(void) { + func_802BE230(5.0f, 8.0f); + func_802BE244(8.0f, 15.0f); + func_802C0150(6); + func_802C2264(0.5f); + func_802C069C(); + func_802C095C(); +} + +f32 func_802C0780(void){ + return func_802BD51C(); +} + +void func_802C07A0(void) { + f32 sp84[3]; + f32 sp78[3]; + f32 sp6C[3]; + f32 sp60[3]; + f32 sp54[3]; + f32 sp48[3]; + f32 sp44; + f32 sp40; + f32 sp34[3]; + f32 sp28[3]; + + func_802BD384(sp54); + func_802C02D4(sp84); + sp44 = time_getDelta(); + func_802BDB30(D_8037DBA4, &D_8037DBA8, &D_8037DBAC, 800.0f, 160.0f, 100.0f); + ml_vec3f_diff_copy(sp6C, sp54, sp84); + sp40 = gu_sqrtf(sp6C[0] * sp6C[0] + sp6C[2]*sp6C[2]); + sp40 = sp40 + (func_802BD8D4() - sp40)* sp44 * 2; + func_80256E24(sp60, 0.0f, D_8037DBA8, 0.0f, 0.0f, sp40); + ml_vec3f_add(sp78, sp84, sp60); + sp78[1] = sp54[1] + (func_802C0780() - sp54[1]) * sp44 * 2; + func_802BD334(sp78); + if (func_802BE60C() && func_802BC84C(0)) { + func_802C069C(); + } + func_802BE6FC(sp48, sp84); + func_802BD3A8(sp34); + sp28[0] = mlDiffDegF(sp48[0], sp34[0]); + sp28[1] = mlDiffDegF(sp48[1], sp34[1]); + sp28[2] = 0.0f; + sp48[0] = sp34[0] + (sp28[0] * sp44 * 4); + func_802BD35C(sp48); +} + +void func_802C095C(void){ + D_8037DBA4 = mlNormalizeAngle(func_8028EBA4() + 180.0); +} + diff --git a/src/core2/code_39A10.c b/src/core2/code_39A10.c new file mode 100644 index 00000000..64aec2df --- /dev/null +++ b/src/core2/code_39A10.c @@ -0,0 +1,115 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_80259198(f32, f32); +extern void func_802BD870(f32, f32, f32, f32); + +/* .bss */ +f32 D_8037DBB0[3]; +f32 D_8037DBBC; +f32 D_8037DBC0; +f32 D_8037DBC8[3]; + +/* .code */ +void func_802C09A0(void) { + func_802BD870(6.0f, 10.0f, 50.0f, 120.0f); + func_802BD384(D_8037DBC8); +} + +void func_802C09E0(void){} + +f32 func_802C09E8(void) { + f32 sp2C[3]; + f32 sp20[3]; + + player_getPosition(sp20); + sp2C[0] = D_8037DBB0[0] - sp20[0]; + sp2C[1] = 0.0f; + sp2C[2] = D_8037DBB0[2] - sp20[2]; + return min_f(gu_sqrtf(sp2C[0]*sp2C[0] + sp2C[2]*sp2C[2]), D_8037DBBC) / D_8037DBBC; +} + +void func_802C0A60(f32 arg0[3]) { + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + f32 sp30[3]; + + func_802BD4C0(sp54); + func_8025727C(sp54[0], sp54[1], sp54[2], D_8037DBB0[0], D_8037DBB0[1], D_8037DBB0[2], &sp30[0], &sp30[1]); + sp30[1] = mlNormalizeAngle(sp30[1] - 60.0f); + func_80256E24(sp48, 0.0f, sp30[1], 0.0f, 0.0f, D_8037DBC0); + ml_vec3f_add(arg0, D_8037DBB0, sp48); + ml_vec3f_diff_copy(sp3C, sp54, D_8037DBB0); + ml_vec3f_scale(sp3C, 0.3f); + arg0[0] += sp3C[0]; + arg0[1] += sp3C[1]; + arg0[2] += sp3C[2]; +} + +void func_802C0B70(f32 arg0[3], f32 arg1[3]) { + f32 sp3C[3]; + f32 sp30[3]; + f32 sp2C; + + sp2C = time_getDelta(); + func_802BD384(sp30); + ml_vec3f_diff_copy(sp3C, arg1, sp30); + sp3C[0] *= sp2C * 1.5; + sp3C[1] *= sp2C * 1.0; + sp3C[2] *= sp2C * 1.5; + sp3C[0] = func_80259198(sp3C[0], sp2C * 1000.0); + sp3C[1] = func_80259198(sp3C[1], sp2C * 1000.0); + sp3C[2] = func_80259198(sp3C[2], sp2C * 1000.0); + ml_vec3f_add(arg0, sp30, sp3C); + func_802BD334(arg0); +} + +void func_802C0C5C(f32 arg0[3], f32 arg1[3]) { + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + f32 sp38; + f32 temp_f14; + + sp38 = func_802C09E8(); + func_802BD4C0(sp48); + ml_vec3f_diff_copy(sp3C, sp48, D_8037DBB0); + ml_vec3f_scale(sp3C, ml_map_f(sp38, 0.4f, 0.75f, 0.5f, 1.0f)); + ml_vec3f_add(sp54, D_8037DBB0, sp3C); + sp54[1] = sp48[1] + (sp54[1] - sp48[1]) * 0.4; + func_8025727C(sp54[0], sp54[1], sp54[2], arg1[0], arg1[1], arg1[2], &arg0[0], &arg0[1]); + arg0[0] = mlNormalizeAngle(-arg0[0]); + arg0[2] = 0.0f; +} + +void func_802C0D60(void) { + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + f32 sp20[3]; + f32 temp_f0; + + func_802BD384(sp44); + func_802BD3A8(sp38); + if (func_802C09E8() > 0.25){ + func_802C0A60(sp2C); + func_802C0C5C(sp20, sp2C); + temp_f0 = mlNormalizeAngle(sp20[1] - sp38[1]); + if((temp_f0 > 200.0f) || (temp_f0 < 160.0f)) { + ml_vec3f_copy(D_8037DBC8, sp2C); + } + } + func_802C0B70(sp2C, D_8037DBC8); + func_802C0C5C(sp20, sp2C); + func_802BD720(sp20); +} + +void func_802C0E38(f32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4){ + D_8037DBB0[0] = arg0; + D_8037DBB0[1] = arg1; + D_8037DBB0[2] = arg2; + D_8037DBBC = arg3; + D_8037DBC0 = arg4; +} diff --git a/src/core2/code_39D0.c b/src/core2/code_39D0.c new file mode 100644 index 00000000..7095bf84 --- /dev/null +++ b/src/core2/code_39D0.c @@ -0,0 +1,317 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + +extern f32 func_8024DDD8(f32[3], f32); +extern int func_80259254(f32 vec[3], f32 x, f32 z, f32 val); +extern f32 func_8028EBA4(void); + +/* .bss */ +u8 D_8037BF60; +u8 D_8037BF61; +u8 D_8037BF62; + +/* .code */ +s32 can_beak_barge(void){ + return ability_hasLearned(ABILITY_0_BARGE); +} + +s32 can_beak_bomb(void){ + return ability_hasLearned(ABILITY_1_BEAK_BOMB); +} + +s32 can_beak_bust(void){ + return ability_hasLearned(ABILITY_2_BEAK_BUSTER); +} + +s32 func_8028A9C0(void){ + return ability_hasLearned(ABILITY_3_CAMERA_CONTROL); +} + +s32 can_claw(void){ + return ability_hasLearned(ABILITY_4_BEAR_PUNCH); +} + +s32 func_8028AA00(void){ + return ability_hasLearned(ABILITY_5_CLIMB); +} + +int can_dive(void){ + return ability_hasLearned(ABILITY_F_DIVE) + && !func_8029D66C() + && 100.0f < func_80294500() - func_80294438(); +} + +s32 can_egg(void){ + return ability_hasLearned(ABILITY_6_EGGS); +} + +int can_flap(void){ + return miscflag_isFalse(0x12) + && miscflag_isFalse(0x5) + && ability_hasLearned(ABILITY_7_FLAP); +} + +s32 can_flip(void){ + return ability_hasLearned(ABILITY_8_FLIP); +} + +s32 func_8028AB28(void){ + return ability_hasLearned(ABILITY_9_FLY); +} + +s32 func_8028AB48(void){ + return ability_hasLearned(ABILITY_A_HOLD_A_JUMP_HIGHER); +} + +int can_peck(void){ + return miscflag_isFalse(0x5) + && miscflag_isFalse(0x12) + && ability_hasLearned(ABILITY_B_RATATAT_RAP); +} + +int func_8028ABB8(void){ + if(miscflag_isTrue(0x14) || miscflag_isTrue(0x19)) + return 0; + if(bs_getState() == BS_56_RECOIL) + return 0; + return 1; +} + +s32 can_roll(void){ + return ability_hasLearned(ABILITY_C_ROLL); +} + +s32 func_8028AC38(void){ + return ability_hasLearned(ABILITY_D_SHOCK_JUMP); +} + +s32 func_8028AC58(void){ + return ability_hasLearned(ABILITY_E_WADING_BOOTS); +} + +s32 can_trot(void){ + return ability_hasLearned(ABILITY_10_TALON_TROT); +} + +s32 func_8028AC98(void){ + return ability_hasLearned(ABILITY_10_TALON_TROT); +} + +s32 can_wonderwing(void){ + return ability_hasLearned(ABILITY_12_WONDERWING); +} + +int func_8028ACD8(void){ + if( map_get() == MAP_27_FP_FREEZEEZY_PEAK && mapSpecificFlags_get(0xd)){ + return 0; + } + + if(func_802C2B00() == 3) + return 0; + + if(!func_8028B2E8() && !player_inWater()) + return 0; + return 1; +} + +int func_8028AD64(void){ + return bsant_inSet(bs_getState()); +} + +int func_8028AD8C(void){ + return bspumpkin_inSet(bs_getState()); +} + +int func_8028ADB4(void){ + return func_8032190C() && map_get() != MAP_1_SM_SPIRAL_MOUNTAIN; +} + +int func_8028ADF0(void){ + return func_803203FC(0x9d); +} + +bool func_8028AE10(void) { + f32 sp2C; + f32 sp28; + f32 sp1C[3]; + f32 ideal_yaw; + + _player_getPosition(sp1C); + ideal_yaw = yaw_getIdeal(); + sp2C = func_8024DDD8(sp1C, 90.0f); + sp28 = func_8024DDD8(sp1C, 270.0f); + if (sp28 < sp2C) { + return (sp2C < ideal_yaw) || (ideal_yaw < sp28); + } + else{ + return (sp2C < ideal_yaw) && (ideal_yaw < sp28); + } +} + +bool func_8028AED4(f32 arg0[3], f32 arg1) { + f32 sp2C[3]; + f32 sp28; + u16 sp26; + u16 sp24; + s32 temp_v1; + s32 phi_a0; + + _player_getPosition(sp2C); + func_80257F18(arg0, sp2C, &sp28); + sp26 = (u16) (sp28 * 182.044444); + sp24 = (u16) (func_8028EBA4() * 182.044444); + sp26 = (u16)((sp26 - sp24)); + temp_v1 = 0x8000 - sp26; + phi_a0 = (temp_v1 >= 0) ? temp_v1 : -temp_v1; + return (phi_a0 < arg1 * 182.044444); +} + +int func_8028B094(void){ + return (60.0f < player_getYPosition() - func_80294438()); +} + +int player_isInHorizontalRadius(f32 arg0[3], f32 arg1){ + f32 sp1C[3]; + _player_getPosition(sp1C); + return func_80259254(sp1C, arg0[0], arg0[2], arg1); +} + +s32 func_8028B120(void){return 0;} + +int func_8028B128(void){ + return miscflag_isTrue(0x13); +} + +int func_8028B148(void){ + return level_get() == LEVEL_9_RUSTY_BUCKET_BAY; +} + +bool player_isInVerticalRange(f32 position[3], f32 range) { + f32 plyr_pos[3]; + + _player_getPosition(plyr_pos); + return (((position[1] - range) <= plyr_pos[1]) && (plyr_pos[1] <= (position[1] + range))); +} + +int player_shouldSlideTrot(void){ + return func_80291698(6) + || (1.0 == get_slope_timer() && func_80294610(0x40)); +} + +bool func_8028B254(s32 arg0) { + return (func_8028B2E8() || (func_80297AAC() < 0.0f && (player_getYPosition() - func_80294438()) < (f32) arg0)); +} + +int func_8028B2E8(void){ + return D_8037BF60 && func_80297AAC() < 0.0f; +} + +int player_isSliding(void){ + return func_80291698(5) + || 1.0 == get_slope_timer(); +} + +int func_8028B394(void){ + return func_8029CF20(4); +} + +bool func_8028B3B4(void) { + bool sp1C; + bool sp18; + + sp1C = func_80294610(0x10) && miscflag_isFalse(3); + sp18 = func_80294610(0x40) && miscflag_isFalse(4); + if(sp1C || sp18) + return TRUE; + return FALSE; +} + +bool func_8028B424(void){ + s32 sp1C; + + if (func_8028B2E8()) { + return FALSE; + } + if (!func_802931DC(&sp1C)) { + return FALSE; + } + return TRUE; +} + +bool func_8028B470(void){ + bool out; + switch(bs_getState()){ + case BS_2B_DIVE_IDLE: + case BS_2C_DIVE_B: + case BS_2D_SWIM_IDLE: + case BS_2E_SWIM: + case BS_30_DIVE_ENTER: + case BS_39_DIVE_A: + case BS_4C_LANDING_IN_WATER: + out = TRUE; + break; + default: + out = FALSE; + } + return out; +} + +int func_8028B4C4(void){ + return 135.0f < mlAbsF(mlDiffDegF(yaw_getIdeal(), yaw_get())); +} + +int player_inWater(void){ + return D_8037BF61; +} + +int func_8028B528(void){ + return D_8037BF62; +} + +void func_8028B534(void){ + s32 sp1C = func_8028ECAC(); + if(player_inWater()){ + D_8037BF62 = 1; + } + else{ + if(func_8028B2E8() || sp1C == BSGROUP_A_FLYING || sp1C == BSGROUP_5_CLIMB){ + D_8037BF62 = 0; + } + } +} + +void func_8028B59C(void) { + s32 sp24; + + sp24 = D_8037BF61; + if (D_8037BF61) { + D_8037BF61 = (func_80294554() && player_getYPosition() < ((func_80294500() - 50.0f) + 2.0f)); + } else { + D_8037BF61 = (func_80294554() && player_getYPosition() < ((func_80294500() - 50.0f) - 2.0f)); + } + if (map_get() == MAP_6_TTC_NIPPERS_SHELL) { + D_8037BF61 = FALSE; + } + if (!sp24 && D_8037BF61 && (func_80297AAC() < -40.0)) { + func_8029C0D0(); + func_8030E58C(0xF, 0.7f); + } +} + + +void func_8028B6FC(void){ + D_8037BF60 = 1; + D_8037BF61 = 0; + D_8037BF62 = 0; +} + +void func_8028B71C(void){ + func_8028B59C(); + D_8037BF60 = func_80294548(); + func_8028B534(); +} + + diff --git a/src/core2/code_39EF0.c b/src/core2/code_39EF0.c new file mode 100644 index 00000000..d022de0a --- /dev/null +++ b/src/core2/code_39EF0.c @@ -0,0 +1,381 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_802453DC(struct56s *, f32, f32[3], s32); +extern f32 func_80259198(f32, f32); +extern f32 func_802BD51C(void); +extern f32 func_8028EBA4(void); +extern void func_802BE244(f32, f32); +extern void func_802BE230(f32, f32); +extern void func_802BD82C(f32, f32); + +extern void func_802BD870(f32, f32, f32, f32); +extern void func_80323240(struct56s *, f32 , f32[3]); +extern f32 func_803243D0(struct56s *, f32[3]); +extern f32 func_80323540(struct56s *, f32, f32, f32); +extern f32 func_80323F74(struct56s *, f32, f32); +extern struct56s *func_80342038(s32); + + +void func_802C16CC(s32 arg0); + +/* .bss */ +struct { + s32 unk0; + f32 unk4; + f32 unk8; + f32 unkC[3]; + f32 unk18; + f32 unk1C[3]; + s32 unk28; + u8 unk2C; + u8 unk2D; + u8 unk2E; + u8 unk2F; +}D_8037DBE0; +f32 D_8037DC10; + +/* .code */ +bool __is_flying_in_FP(void){ + return (map_get() == MAP_27_FP_FREEZEEZY_PEAK) && (func_8028ECAC() == BSGROUP_A_FLYING); +} + +struct56s *func_802C0EC0(void){ + return func_80342038(D_8037DBE0.unk0); +} + +void func_802C0EE4(void) { + D_8037DBE0.unk0 = -1; + D_8037DBE0.unk28 = 0; + D_8037DBE0.unk2C = 0; + D_8037DBE0.unk2F = 0; + D_8037DBE0.unk2E = 0; + D_8037DBE0.unk4 = 0.0f; + D_8037DBE0.unk8 = 0.0f; + ml_vec3f_clear(D_8037DBE0.unkC); + ml_vec3f_clear(D_8037DBE0.unk1C); + D_8037DBE0.unk18 = 0.0f; +} + +void func_802C0F4C(void){ + func_802C0EE4(); +} + +void func_802C0F6C(void){ + func_802C0150(4); + func_802BE244(5.0f, 10.0f); + func_802BE230(3.0f, 8.0f); + func_802BD82C(100.0f, 100.0f); +} + +void func_802C0FCC(void){ + func_802C0EE4(); + func_802BD840(); +} + +void func_802C0FF4(s32 arg0) { + s32 sp1C; + + sp1C = func_802C0190(); + func_802C0150(5); + func_802C02D4(arg0); + func_802C0150(sp1C); +} + +f32 func_802C1030(struct56s *arg0, f32 arg1[3], f32 arg2[3]) { + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + f32 sp30[3]; + f32 sp2C; + + sp2C = func_803243D0(arg0, arg1); + if ((sp2C == 0.0) || (sp2C == 1.0)) { + func_80323240(arg0, sp2C, sp48); + if (sp2C == 0.0) { + func_80323240(arg0, sp2C + 0.001, sp3C); + } else { + func_80323240(arg0, sp2C - 0.001, sp3C); + } + ml_vec3f_diff_copy(sp30, sp3C, sp48); + ml_vec3f_set_length_copy(sp30, sp30, 400.0f); + ml_vec3f_add(sp3C, sp30, sp48); + func_80259554(sp54, sp48, sp3C, arg1); + return ml_vec3f_distance(sp54, arg2); + } + else{ + func_80323240(arg0, sp2C, sp54); + if (sp2C < D_8037DBE0.unk8) { + return func_80323540(arg0, sp2C, D_8037DBE0.unk8, 15.0f); + } + else{ + return func_80323540(arg0, D_8037DBE0.unk8, sp2C, 15.0f); + } + } +} + +s32 func_802C11C8(f32 arg0[3]) { + f32 sp64[3]; + f32 sp58[3]; + f32 sp4C[3]; + f32 sp48; + f32 sp44; + f32 sp40; + f32 sp3C; + f32 sp38; + f32 sp34; + f32 sp30; + struct56s *sp2C; + f32 sp28; + + sp2C = func_802C0EC0(); + func_802C0FF4(sp4C); + if (func_8028EE84() == BSWATERGROUP_2_UNDERWATER) { + func_802BD82C(20.0f, 200.0f); + } else { + func_802BD82C(80.0f, 200.0f); + } + sp30 = func_802C1030(sp2C, sp4C, arg0); + sp40 = func_80323F74(sp2C, D_8037DBE0.unk8, 1000.0f); + sp3C = func_80323F74(sp2C, D_8037DBE0.unk8, -1000.0f); + func_80323240(sp2C, sp40, sp64); + func_80323240(sp2C, sp3C, sp58); + sp48 = ml_vec3f_distance(sp4C, sp64); + sp44 = ml_vec3f_distance(sp4C, sp58); + sp38 = 0.0f; + sp38 = 0.0f; + if (mlAbsF(sp48 - sp44) > 3.0f) { + sp34 = (sp48 < sp44) ? 1.0f : -1.0f; + if (550.0f < sp30) { + sp38 = ml_map_f(sp30, 550.0f, 650.0f, 0.0f, 1500.0f) * sp34; + } else if (sp30 < 500.0f) { + sp38 = ml_map_f(sp30, 400.0f, 500.0f, 1500.0f, 0.0f) * -sp34; + } + sp28 = mlAbsF(D_8037DBE0.unk4); + if (sp28 < mlAbsF(sp38)) { + D_8037DBE0.unk4 = D_8037DBE0.unk4 + (sp38 - D_8037DBE0.unk4) * 0.08; + } else { + D_8037DBE0.unk4 = sp38; + } + D_8037DBE0.unk8 = func_80323F74(sp2C, D_8037DBE0.unk8, D_8037DBE0.unk4); + if( ((sp38 > 0.0f) && (D_8037DBE0.unk8 == 1.0) && (D_8037DBE0.unk2F == 0)) + || ((sp38 < 0.0f) && (D_8037DBE0.unk8 == 0.0) && (D_8037DBE0.unk2E == 0)) + ) { + return 0; + } + + } + else{ + return 1; + } + + if (sp38 != 0.0f){ + return 1; + } + return 2; +} + +void func_802C14E0(void) { + f32 sp5C[3]; + f32 sp50[3]; + f32 sp4C; + f32 sp40[3]; + f32 sp34[3]; + + if (D_8037DBE0.unk0 != -1) { + if (D_8037DBE0.unk2C == 1) { + D_8037DBE0.unk2C = 2; + } + func_802BD384(sp40); + if ((D_8037DBE0.unk28 == -1) || (func_802C11C8(sp40) == 0) || __is_flying_in_FP()) { + D_8037DBE0.unk28 = 0; + return; + } + func_80323240(func_802C0EC0(), D_8037DBE0.unk8, sp40); + if (D_8037DBE0.unk18 < 1.0) { + sp4C = ml_map_f(D_8037DBE0.unk18, 0.5f, 1.0f, 0.05f, 0.01f); + D_8037DBE0.unk18 += 30.0f * time_getDelta() * sp4C; + if (D_8037DBE0.unk18 < 1.0) { + ml_vec3f_diff_copy(sp50, sp40, D_8037DBE0.unkC); + ml_vec3f_scale(sp50, D_8037DBE0.unk18); + ml_vec3f_add(sp40, D_8037DBE0.unkC, sp50); + } + } + func_802BD334(sp40); + func_802C02D4(sp5C); + func_802BE6FC(sp34, sp5C); + func_802BD904(sp34); + } +} + +void func_802C1674(s32 arg0, s32 arg1){ + if(D_8037DBE0.unk28){ + D_8037DBE0.unk28 = -1; + } +} + +void func_802C169C(void *arg0, s32 arg1){ + func_802C16CC(func_8033451C(*((u16 *)((s32)arg0 + 8)))); +} + +void func_802C16CC(s32 arg0) { + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + s32 sp38; + s32 sp34; + s16 *sp30; + + if ((func_8028ECAC() != 4) && !__is_flying_in_FP()){ + sp38 = func_80334524(arg0); + if(sp38 != D_8037DBE0.unk28 && D_8037DBE0.unk28 != -1){ + player_getPosition(sp54); + ml_vec3f_to_vec3w(sp48, sp54); + sp30 = func_803049CC(sp38, sp48); + if(sp30 != NULL) { + nodeprop_getPosition(sp30, sp54); + switch (func_80304DB8(sp30)) { /* irregular */ + default: + D_8037DBE0.unk2E = 0; + D_8037DBE0.unk2F = 0; + break; + case 1: + D_8037DBE0.unk2E = 1; + D_8037DBE0.unk2F = 0; + break; + case 2: + D_8037DBE0.unk2E = 0; + D_8037DBE0.unk2F = 1; + break; + case 3: + D_8037DBE0.unk2E = 1; + D_8037DBE0.unk2F = 1; + break; + } + D_8037DBE0.unk2D = func_802BD0CC(); + func_802BD384(sp3C); + ml_vec3f_copy(D_8037DBE0.unkC, sp3C); + D_8037DBE0.unk18 = 0.0f; + D_8037DBE0.unk28 = sp38; + D_8037DBE0.unk0 = func_80341EC4(sp54); + D_8037DBE0.unk8 = func_803243D0(func_802C0EC0(), sp3C); + D_8037DBE0.unk8 = func_802453DC(func_802C0EC0(), D_8037DBE0.unk8, sp3C, func_8028D694() | 0x1E0000); + D_8037DBE0.unk2C = 1; + func_80323240(func_802C0EC0(), D_8037DBE0.unk8, D_8037DBE0.unk1C); + if (func_802C11C8(D_8037DBE0.unk1C) == 1) { + func_802BD0D8(0x12); + func_80291488(0xA); + return; + } + D_8037DBE0.unk28 = 0; + } + } + } +} + + +bool func_802C189C(void){ + return D_8037DBE0.unk28 < 1; +} + +void func_802C18B0(void){ + func_802BD870(12.0f, 10.0f, 120.0f, 120.0f); +} + +void func_802C18F0(void){} + +void func_802C18F8(void) { + f32 sp8C[3]; + f32 sp80[3]; + f32 sp74[3]; + f32 sp68[3]; + f32 sp5C[3]; + f32 sp50[3]; + f32 sp4C; + f32 sp48; + f32 temp_f20; + f32 sp40; + f32 sp3C; + + func_802BD384(sp74); + func_802BD4C0(sp8C); + sp3C = func_802BD8D4(); + temp_f20 = time_getDelta(); + ml_vec3f_diff_copy(sp50, sp74, sp8C); + sp4C = gu_sqrtf((sp50[0] * sp50[0]) + (sp50[2] * sp50[2])); + sp4C += func_80259198((sp3C - sp4C) * temp_f20 * 2, temp_f20 * 120.0f); + func_8025801C(sp50, &sp48); + sp40 = func_80259198(mlDiffDegF(mlNormalizeAngle(180.0f + func_8028EBA4()), sp48) * (temp_f20 * 1), temp_f20 * 50.0f); + sp48 = mlNormalizeAngle(sp48 + sp40); + func_80256E24(sp68, 0.0f, sp48, 0.0f, 0.0f, sp4C); + ml_vec3f_add(sp80, sp8C, sp68); + sp80[1] = sp74[1] + ((func_802BD51C() - sp74[1]) * temp_f20 * 2); + func_802BD334(sp80); + func_8025727C(sp8C[0], sp8C[1], sp8C[2], sp80[0], sp80[1], sp80[2], &sp5C[0], &sp5C[1]); + sp5C[0] = -sp5C[0]; + sp5C[2] = 0.0f; + func_802BD720(sp5C); +} + +void func_802C1AD0(void){} + +void func_802C1AD8(void){ + func_802BD870(10.0f, 20.0f, 120.0f, 200.0f); + func_802C0150(4); + D_8037DC10 = 600.0f; +} + +void func_802C1B20(f32 arg0){ + D_8037DC10 = arg0; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_39EF0/func_802C1B2C.s") +#else +void func_802C1B2C(void) { + f32 sp7C[3]; + f32 sp70[3]; + f32 sp64[3]; + f32 sp58[3]; + f32 sp4C[3]; + f32 sp40[3]; + f32 sp3C; + f32 sp34; + f32 sp30; + f32 phi_f0; + + func_802BD384(sp64); + sp34 = D_8037DC10; + func_802C02D4(sp7C); + sp30 = time_getDelta(); + ml_vec3f_diff_copy(sp40, sp64, sp7C); + sp3C = gu_sqrtf(sp40[0]*sp40[0] + sp40[2]*sp40[2]); + sp3C += func_80259198((sp34 - sp3C) * sp30 * 2, sp30 * 800.0f); + func_8025727C(sp7C[0], sp7C[1], sp7C[2], sp64[0], sp64[1], sp64[2], &sp4C[0], &sp4C[1]); + sp40[1] = mlDiffDegF(mlNormalizeAngle(func_8028EBA4() + 180.0f), sp4C[1]) * sp30 * 0.77; + sp40[1] = func_80259198(sp40[1], sp30 * 300.0f); + sp4C[1] = mlNormalizeAngle(sp40[1] + sp4C[1]); + func_80256E24(&sp58, 0.0f, sp4C[1], 0.0f, 0.0f, sp3C); + sp70[0] = sp58[0] + sp7C[0]; + sp70[1] = sp64[1]; + sp70[2] = sp58[2] + sp7C[2]; + sp40[1] = sp7C[1] - sp64[1]; + if (mlAbsF(sp40[1]) > 200.0f) { + if (sp40[1] > 0.0f) { + phi_f0 = 2* sp30 * (200.0f - sp40[1]); + } else { + phi_f0 = sp30 *(-200.0f - sp40[1]) * 2; + + } + sp70[1] = sp64[1] - phi_f0; + } + func_802BD334(sp70); + if (func_802BE60C()) { + func_802BC84C(0); + } + func_802BE6FC(sp4C, sp7C); + func_802BD720(sp4C); + if(sp30); +} +#endif diff --git a/src/core2/code_3AE10.c b/src/core2/code_3AE10.c new file mode 100644 index 00000000..53acd252 --- /dev/null +++ b/src/core2/code_3AE10.c @@ -0,0 +1,139 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_802BD51C(void); +extern void func_802BDCE0(f32, f32*, f32*, f32, f32); +extern void func_802BDE88(f32*, f32*, f32, f32, f32); +extern void func_802589E4(f32[3], f32, f32); +extern void func_802BD0D8(s32); + +/* .data */ +extern f32 D_80365DA0; +extern f32 D_80365DA4; +extern f32 D_80365DA8; +extern f32 D_80365DAC; +extern u8 D_80365DB0; +extern f32 D_80365DB4; + +/* .code */ +void func_802C1DA0(void){} + +void func_802C1DA8(void){} + +bool func_802C1DB0(f32 arg0) { + f32 pad4C; + f32 sp40[3]; + f32 sp34[3]; + f32 sp28[3]; + f32 sp1C[3]; + + + func_802BD384(sp40); + func_802C02D4(sp28); + ml_vec3f_diff_copy(sp34, sp40, sp28); + D_80365DAC = gu_sqrtf(sp34[0]*sp34[0] + sp34[2]*sp34[2]); + func_8025801C(sp34, &D_80365DA4); + D_80365DA8 = 0.0f; + D_80365DA0 = mlNormalizeAngle(D_80365DA4 + arg0); + D_80365DB0 = 0; + pad4C = (arg0 / 5.0); + func_802589E4(sp1C, mlNormalizeAngle(D_80365DA4 + pad4C), D_80365DAC); + sp1C[0] += sp28[0]; + sp1C[2] += sp28[2]; + pad4C = sp40[1]; + sp1C[1] = pad4C; + if (func_802BCE0C(sp40, sp1C)) { + func_802BD0D8(0xA); + return TRUE; + } + return FALSE; +} + +bool func_802C1EE0(void){ + return D_80365DB0; +} + +f32 func_802C1EEC(void){ + f32 sp1C[3]; + + if(func_802C0190() == 3){ + func_802BD384(sp1C); + return sp1C[1]; + } + else{ + return func_802BD51C(); + } +} + +void func_802C1F30(void) { + f32 spB4[3]; + f32 spA8[3]; + f32 sp9C[3]; + f32 sp90[3]; + f32 sp84[3]; + f32 sp80; + s32 sp7C; + s32 sp78; + f32 sp6C[3]; + f32 sp60[3]; + f32 temp_f0; + f32 sp50[3]; + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + s32 phi_a0; + + func_802BD384(sp6C); + func_802BD384(sp9C); + func_802C02D4(spB4); + sp80 = time_getDelta(); + + if(D_80365DB0){ + return; + } + + func_802BDCE0(D_80365DA0, &D_80365DA4, &D_80365DA8, 50.0f, 3.0f); + D_80365DB0 = (mlAbsF(D_80365DA0 - D_80365DA4) < 0.5); + ml_vec3f_diff_copy(sp60, sp9C, spB4); + D_80365DAC = gu_sqrtf(sp60[0]*sp60[0] + sp60[2]*sp60[2]); + func_802BDE88(&D_80365DB4, &D_80365DAC, func_802BD8D4(), 0.01f, 0.008f); + func_80256E24(sp90, 0.0f, D_80365DA4, 0.0f, 0.0f, D_80365DAC); + ml_vec3f_add(spA8, spB4, sp90); + spA8[1] = sp9C[1] + ((func_802C1EEC() - sp9C[1]) * sp80 * 2); + func_802BD334(spA8); + sp78 = 0; + sp7C = 0; + if (func_802BE60C() != 0) { + D_80365DB0 = 1; + D_80365DB4 = 0.0f; + sp7C = 1; + } + phi_a0 = (mlDiffDegF(D_80365DA0, D_80365DA4) > 0.0f) ? 2 : 3; + if (func_802BC84C(phi_a0)) { + D_80365DB4 = 0.0f; + sp78 = 1; + sp7C += 1; + } + func_802BE6FC(sp84, spB4); + if (sp7C != 0) { + func_802BD384(sp44); + ml_vec3f_diff_copy(sp50, sp44, spB4); + D_80365DAC = gu_sqrtf((sp50[0] * sp50[0]) + (sp50[2] * sp50[2])); + } + if (sp78 != 0) { + D_80365DB0 = 1; + func_802BD35C(sp84); + return; + } + func_802BD3A8(sp38); + sp2C[0] = mlDiffDegF(sp84[0], sp38[0]); + sp2C[1] = mlDiffDegF(sp84[1], sp38[1]); + sp2C[2] = 0.0f; + sp84[0] = sp38[0] + (sp2C[0] * sp80 * 4.0f); + sp84[1] = sp38[1] + sp2C[1]; + func_802BD35C(sp84); + if (D_80365DB0 != 0) { + D_80365DB4 = 0.0f; + } +} diff --git a/src/core2/code_3B5C0.c b/src/core2/code_3B5C0.c new file mode 100644 index 00000000..e006ecd9 --- /dev/null +++ b/src/core2/code_3B5C0.c @@ -0,0 +1,134 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802BD780(f32[3], f32[3], f32, f32, f32, f32); +extern f32 func_80257CF8(f32, f32, f32, f32, f32); + +void func_802C29A0(s32 arg0); + +/* .bss */ +struct{ + f32 unk0[3]; + f32 unkC[3]; + f32 unk18[3]; + f32 unk24[3]; + f32 unk30[3]; + f32 unk3C[3]; + f32 unk48; + u8 unk4C; +} D_8037DC60; + +/* .code */ +bool func_802C2550(void) { + return (ml_vec3f_distance(D_8037DC60.unk0, &D_8037DC60.unk18) < 40.0f); +} + +void func_802C2598(f32 arg0[3], f32 arg1[3]) { + s32 i; + + func_80259430(&D_8037DC60.unk48); + for( i = 0; i<3; i++){ + D_8037DC60.unk0[i] = func_80257CF8(D_8037DC60.unk48, 1.0f, 0.0f, D_8037DC60.unk30[i], D_8037DC60.unk18[i]); + D_8037DC60.unkC[i] = mlNormalizeAngle(D_8037DC60.unk3C[i] + func_80257CF8(D_8037DC60.unk48, 0.5f, 0.0f, 0.0f, mlDiffDegF(D_8037DC60.unk24[i], D_8037DC60.unk3C[i]))); + } + if (D_8037DC60.unk48 == 0.0f) { + func_802C29A0(2); + } + if (func_802C2550() && func_8028F150()) { + func_8028FCC8(0); + } + ml_vec3f_copy(arg0, D_8037DC60.unk0); + ml_vec3f_copy(arg1, D_8037DC60.unkC); +} + + +void func_802C26D8(f32 arg0[3], f32 arg1[3]) { + s32 i; + + func_80259430(&D_8037DC60.unk48); + for( i = 0; i<3; i++){ + D_8037DC60.unk0[i] = func_80257CF8(D_8037DC60.unk48, 1.0f, 0.0f, D_8037DC60.unk18[i], arg0[i]); + D_8037DC60.unkC[i] = mlNormalizeAngle(D_8037DC60.unk24[i] + func_80257CF8(D_8037DC60.unk48, 1.0f, 0.5f, 0.0f, mlDiffDegF(arg1[i], D_8037DC60.unk24[i]))); + } + if (D_8037DC60.unk48 == 0.0f) { + func_802C29A0(4); + } + if (!func_802C2550() && !func_8028F150()) { + func_8028FCC8(1); + } + ml_vec3f_copy(arg0, &D_8037DC60.unk0); + ml_vec3f_copy(arg1, &D_8037DC60.unkC); +} + + +void func_802C2838(f32 arg0[3], f32 arg1[3]) { + ml_vec3f_copy(D_8037DC60.unk0, D_8037DC60.unk18); + func_802BD780(D_8037DC60.unk24, D_8037DC60.unkC, 10.0f, 20.0f, 120.0f, 200.0f); + D_8037DC60.unkC[2] = 0.0f; + ml_vec3f_copy(arg0, D_8037DC60.unk0); + ml_vec3f_copy(arg1, D_8037DC60.unkC); +} + +void func_802C28C8(void){ + ml_vec3f_clear(D_8037DC60.unk0); + ml_vec3f_clear(D_8037DC60.unkC); + ml_vec3f_clear(D_8037DC60.unk18); + ml_vec3f_clear(D_8037DC60.unk24); + ml_vec3f_clear(D_8037DC60.unk30); + ml_vec3f_clear(D_8037DC60.unk3C); + D_8037DC60.unk4C = 0; +} + +void func_802C292C(f32 arg0[3], f32 arg1[3]) { + switch (D_8037DC60.unk4C) { + case 1: + func_802C2598(arg0, arg1); + break; + case 2: + func_802C2838(arg0, arg1); + break; + case 3: + func_802C26D8(arg0, arg1); + /* fallthrough */ + case 4: + break; + } +} + +void func_802C29A0(s32 arg0) { + if (arg0 == 1) { + if (D_8037DC60.unk4C == 3) { + ml_vec3f_copy(D_8037DC60.unk30, D_8037DC60.unk0); + ml_vec3f_copy(D_8037DC60.unk3C, D_8037DC60.unkC); + } else { + func_802BD384(D_8037DC60.unk0); + func_802BD3A8(D_8037DC60.unkC); + func_802BD384(D_8037DC60.unk30); + func_802BD3A8(D_8037DC60.unk3C); + } + D_8037DC60.unk48 = 1.0f; + } + if (arg0 == 3) { + D_8037DC60.unk48 = 1.0f; + } + D_8037DC60.unk4C = arg0; +} + +void func_802C2A64(f32 src[3]){ + ml_vec3f_copy(D_8037DC60.unk18, src); +} + +void func_802C2A8C(f32 src[3]){ + D_8037DC60.unk24[0] = mlNormalizeAngle(src[0]); + D_8037DC60.unk24[1] = mlNormalizeAngle(src[1]); + D_8037DC60.unk24[2] = mlNormalizeAngle(src[2]); +} + +void func_802C2ADC(f32 dst[3]){ + ml_vec3f_copy(dst, D_8037DC60.unk24); +} + +s32 func_802C2B00(void){ + return D_8037DC60.unk4C; +} diff --git a/src/core2/code_3BB80.c b/src/core2/code_3BB80.c new file mode 100644 index 00000000..cdadd0cc --- /dev/null +++ b/src/core2/code_3BB80.c @@ -0,0 +1,600 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + + +void func_802E1790(void); + +void func_802C3BDC(void); +void func_802C3BE8(void); + +Actor *func_802D7558(s32 *, s32, ActorInfo*, u32); +Actor *func_802D75B4(s32 *, s32, ActorInfo*, u32); +Actor *func_802D7610(s32 *, s32, ActorInfo*, u32); +Actor *func_802DEB18(s32 *, s32, ActorInfo*, u32); + +extern ActorInfo D_80365E58; //banjo.without_right_hand +extern ActorInfo D_80365EAC; //banjo.playing_gameboy +extern ActorInfo D_80365F00; //banjo.cooking +extern ActorInfo D_80365F60; +extern ActorInfo D_80365F84; //turbotrainers +extern ActorInfo D_80365FB0; //shrapnel +extern ActorInfo D_80365FE0; +extern ActorInfo D_80366090; //bigbutt +extern ActorInfo D_803660B4; //brownbull +extern ActorInfo D_803662A8; //jiggy +extern ActorInfo D_80366300; //jigdance +extern ActorInfo D_80366340; +extern ActorInfo D_80366364; +extern ActorInfo D_80366388; +extern ActorInfo D_803663AC; +extern ActorInfo D_803663D0; +extern ActorInfo D_803663F4; +extern ActorInfo chExtraLife; //extralife +extern ActorInfo D_80366C50; //music_note +extern ActorInfo D_80366C80; //chhoneycarrier +extern ActorInfo D_80366CA4; //chhoney +extern ActorInfo D_80366EC0; +extern ActorInfo D_80366EF0; //large_shadow +extern ActorInfo D_80366F20; //chshockjump +extern ActorInfo D_80366F44; //flight_pad +extern ActorInfo D_803670B8; //snippet +extern ActorInfo D_803670DC; //black_snippet +extern ActorInfo D_80367100; //mutie_snippet +extern ActorInfo D_80367130; //buzzbomb +extern ActorInfo D_80367160; +extern ActorInfo D_80367184; +extern ActorInfo D_80367200; //jingo_blue +extern ActorInfo D_80367224; //jingo_green +extern ActorInfo D_80367248; //jingo_yellow +extern ActorInfo D_8036726C; //jingo_pink +extern ActorInfo D_80367290; //jingo_orange +extern ActorInfo D_803672E0; //chbeehive +extern ActorInfo D_80367310; //chswarm +extern ActorInfo D_80367390; //chwaterfallfx +extern ActorInfo D_80367404; //scrapnel +extern ActorInfo chGloop; //gloop +extern ActorInfo D_803674E0; //mumbo +extern ActorInfo D_80367530; //mumbo_token_sign.5 +extern ActorInfo D_80367554; //mumbo_toke_sign.10 +extern ActorInfo D_80367578; //mumbo_toke_sign.15 +extern ActorInfo D_8036759C; //mumbo_toke_sign.20 +extern ActorInfo D_803675C0; //mumbo_toke_sign.25 +extern ActorInfo D_803675F0; +extern ActorInfo D_80367760; +extern ActorInfo D_80367784; +extern ActorInfo D_803677A8; //ice_key +extern ActorInfo D_803677CC; //mumbo_transform_pad +extern ActorInfo D_803677F0; +extern ActorInfo D_80367814; //SnS_egg +extern ActorInfo D_80367838; //level_entry_disk +extern ActorInfo D_8036785C; //witch_switch.mm; +extern ActorInfo D_80367880; //witch_switch.mmm +extern ActorInfo D_803678A4; //witch_switch.ttc +extern ActorInfo D_803678C8; //witch_switch.rbb +extern ActorInfo D_803678EC; //witch_switch.ccw +extern ActorInfo D_80367910; //witch_switch.fp +extern ActorInfo D_80367934; //witch_switch.cc +extern ActorInfo D_80367958; //witch_switch.bgs +extern ActorInfo D_8036797C; //witch_switch.gv +extern ActorInfo D_80367A20; //wading boots +extern ActorInfo D_80367A50; //chbadshad +extern ActorInfo D_80367AB0; +extern ActorInfo D_80367AD4; +extern ActorInfo D_80367AF8; +extern ActorInfo D_80367B20; //chclimbbase +extern ActorInfo D_80367B80; //orange +extern ActorInfo D_80367BA4; //gold_bullion +extern ActorInfo D_80367BC8; +extern ActorInfo D_80367BEC; +extern ActorInfo D_80367C10; +extern ActorInfo D_80367C60; +extern ActorInfo D_80367C90; //spent_redfeather +extern ActorInfo D_80367CB4; //spent_goldfeather +extern ActorInfo D_80367D00; //egg +extern ActorInfo D_80367D24; //redfeather +extern ActorInfo D_80367D48; //goldfeather +extern ActorInfo D_80367DA0; //bottles +extern ActorInfo D_80367E20; //chmolehill +extern ActorInfo D_80367E70; +extern ActorInfo D_80367F30; +extern ActorInfo D_8036804C;//GAME_OVER +extern ActorInfo D_8036807C;//THE_END +extern ActorInfo D_803680AC;//player_KAZOOIE +extern ActorInfo D_803680DC;//copyright_info +extern ActorInfo D_80368124;//PRESS_START +extern ActorInfo D_80368174;//NO_CONTROLLER) +extern ActorInfo D_803682D0; //jiggy_picture +extern ActorInfo D_8036833C; +extern ActorInfo D_8036838C; +extern ActorInfo D_80368418; //banjos_hand_BB +extern ActorInfo D_80368450; //fire_sparkle +extern ActorInfo D_80368474; +extern ActorInfo D_80368498; +extern ActorInfo D_803684BC; //roysten +extern ActorInfo D_803684E0; //cuckoo_clock +extern ActorInfo D_80368504; +extern ActorInfo D_80368528; +extern ActorInfo D_8036854C; +extern ActorInfo D_80368570; +extern ActorInfo D_803685A0; //mumbotoken +extern ActorInfo D_80368620; //snacker +extern ActorInfo D_80368670; //sirslush +extern ActorInfo D_80368710; //snowball +extern ActorInfo D_803687C0; //sir_slush_hat +extern ActorInfo D_80372810; +extern ActorInfo D_80372840; //grillchompa +extern ActorInfo D_80372870; //clucker +extern ActorInfo D_803728A0; //scarab +extern ActorInfo D_8036D970; //boombox +extern ActorInfo D_80372970; //leaf_particle +extern ActorInfo D_80372994; +extern ActorInfo D_803729B8; //rain +extern ActorInfo D_803729DC; +extern ActorInfo D_80372A00; //snow +extern ActorInfo D_80372A24; +extern ActorInfo D_80372A48; +extern ActorInfo D_80372A6C; +extern ActorInfo gChFireFxInfo; //fire +extern ActorInfo gChDripsInfo;//water_drops +extern ActorInfo D_80372B80; +extern ActorInfo D_80372BA4;//ice_cube +extern ActorInfo D_80372C18; //teehee +extern ActorInfo D_80372C80; //floatsam +extern ActorInfo D_80372D78; //limbo +extern ActorInfo D_80372DF8; //grublin_hood +extern ActorInfo D_80372E78; //mummum +extern ActorInfo D_80372EE0; +extern ActorInfo D_80372F50; //ticker +extern ActorInfo D_80372FC0; +extern ActorInfo D_80372FE4; +extern ActorInfo D_803730D8; //nibbly +extern ActorInfo D_80373100; +extern ActorInfo D_80373134; +extern ActorInfo D_80373158; +extern ActorInfo D_803731B0; +extern ActorInfo D_803732E0; +extern ActorInfo D_80373DC0; + + +typedef struct function_queue_s{ + union { + void (* func0)(void); + void (* func1)(s32); + void (* func2)(s32, s32); + void (* func3)(s32, s32, s32); + void (* func4)(s32, s32, s32, s32); + void (* func5)(s32, s32, s32, s32, s32); + }; + s32 arg[5]; + s32 arg_cnt; +}FunctionQueue; + +/* .data */ +extern u8 D_80365DC0; +extern u8 D_80365DC4; +extern FunctionQueue *D_80365DC8; + +/* .code */ +void func_802C2B10(void){ + u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 0x32: 0xF; + D_80365DC8 = (FunctionQueue *) malloc(tmp * sizeof(FunctionQueue)); +} + +void func_802C2B5C(void){ + s32 loaded_asm_file; + + loaded_asm_file = get_loaded_overlay_id(); + func_802C3BE8(); + D_80365DC4 = 0; + func_802D1724(); + func_802E1790(); + switch(loaded_asm_file){ + case OVERLAY_2_WHALE: + cc_func_803870E0(); + break; + case OVERLAY_4_DESERT: + gv_func_80387118(); + break; + case OVERLAY_5_BEACH: + break; + case OVERLAY_7_SWAMP: + bgs_func_803885DC(); + break; + default: + break; + } + + func_80305D38(); + func_803062D0(); + func_80325F8C(); + spawnableActorList_new(); + spawnableActorList_add(&D_80367160, actor_new, 0x0000000); //cutscene Trigger? + spawnableActorList_add(&D_803675F0, actor_new, 0x0000040); + spawnableActorList_add(&D_80366090, actor_new, 0x2010103); + spawnableActorList_add(&D_803660B4, actor_new, 0x0000103); + spawnableActorList_add(&D_803674E0, actor_new, 0x0000182); + spawnableActorList_add(&D_803672E0, actor_new, 0x2000108); + spawnableActorList_add(&D_80367310, actor_new, 0x0020001); + spawnableActorList_add(&D_80367390, actor_new, 0x0080084); + spawnableActorList_add(&D_80367248, actor_new, 0x0000140); + spawnableActorList_add(&D_80367290, actor_new, 0x0000140); + spawnableActorList_add(&D_80367200, actor_new, 0x0000140); + spawnableActorList_add(&D_8036726C, actor_new, 0x0000140); + spawnableActorList_add(&D_80367224, actor_new, 0x0000140); + spawnableActorList_add(&D_803662A8, actor_new, 0x02000C0); + spawnableActorList_add(&D_80366300, actor_new, 0x0000004); + spawnableActorList_add(&D_80367C60, actor_new, 0x0000004); + spawnableActorList_add(&D_80367A20, actor_new, 0x0000000); + spawnableActorList_add(&D_80366C80, actor_new, 0x0200040); //chhoneycarrier + spawnableActorList_add(&D_80366CA4, actor_new, 0x0200040); //chhoney + spawnableActorList_add(&D_80366C50, actor_new, 0x0200000); //music_note + spawnableActorList_add(&D_80367D00, actor_new, 0x0200000); //egg + spawnableActorList_add(&D_80366340, func_802C8A54, 0x0000004); + spawnableActorList_add(&D_80366364, func_802C8AA8, 0x0000004); + spawnableActorList_add(&D_80366388, func_802C8AF8, 0x0000004); + spawnableActorList_add(&D_803663AC, func_802C8B4C, 0x0000004); + spawnableActorList_add(&D_803663D0, func_802C8BA8, 0x0000004); + spawnableActorList_add(&D_803663F4, func_802C8C04, 0x0000004); + spawnableActorList_add(&D_80367AB0, func_802D7558, 0x0000004); + spawnableActorList_add(&D_80367AD4, func_802D75B4, 0x0000004); + spawnableActorList_add(&D_80367AF8, func_802D7610, 0x0000004); + spawnableActorList_add(&D_80366EC0, actor_new, 0x0000000); + spawnableActorList_add(&D_80365F60, actor_new, 0x0000004); + spawnableActorList_add(&D_80365F84, actor_new, 0x0000004); //turbotrainers + spawnableActorList_add(&D_80367184, actor_new, 0x0000000); + spawnableActorList_add(&chExtraLife, actor_new, 0x0200000); //extralife + spawnableActorList_add(&D_80365FB0, actor_new, 0x0000004); //shrapnel + spawnableActorList_add(&D_80367A50, actor_new, 0x0000004); //chbadshad + spawnableActorList_add(&D_803685A0, actor_new, 0x0000040); //mumbotoken + spawnableActorList_add(&D_80367F30, actor_new, 0x0000400); + spawnableActorList_add(&D_80365FE0, actor_new, 0x0000004); + spawnableActorList_add(&chGloop, actor_new, 0x000008A); //gloop + spawnableActorList_add(&D_80366F20, actor_new, 0x0000000); //chshockjump + spawnableActorList_add(&D_80366F44, actor_new, 0x0000000); //flight_pad + spawnableActorList_add(&D_80367D24, actor_new, 0x0200000); //redfeather + spawnableActorList_add(&D_80367D48, actor_new, 0x0200000); //goldfeather + spawnableActorList_add(&D_80367C90, actor_new, 0x0000004); //spent_redfeather + spawnableActorList_add(&D_80367CB4, actor_new, 0x0000004); //spent_goldfeather + spawnableActorList_add(&D_80367DA0, actor_new, 0x0000180); //bottles + spawnableActorList_add(&D_80367E20, actor_new, 0x44); //chmolehill + spawnableActorList_add(&D_80373DC0, actor_new, 0x80000); + spawnableActorList_add(&D_80367E70, actor_new, 0x0); + spawnableActorList_add(&D_80368620, actor_new, 0x10004); //snacker + spawnableActorList_add(&D_80366EF0, actor_new, 0x20004); //large_shadow + spawnableActorList_add(&D_80367B20, actor_new, 0x80); //chclimbbase + spawnableActorList_add(&D_80367BA4, actor_new, 0x40); //gold_bullion + spawnableActorList_add(&D_80367B80, actor_new, 0x2); //orange + spawnableActorList_add(&D_80372970, actor_new, 0x80); //leaf_particle + spawnableActorList_add(&D_80372994, actor_new, 0x80); + spawnableActorList_add(&D_803729B8, actor_new, 0x80); //rain + spawnableActorList_add(&D_803729DC, actor_new, 0x80); + spawnableActorList_add(&D_80372A00, actor_new, 0x80); //snow + spawnableActorList_add(&D_80372A24, actor_new, 0x80); + spawnableActorList_add(&D_80372A48, actor_new, 0x81); + spawnableActorList_add(&D_80372A6C, actor_new, 0x81); + spawnableActorList_add(&D_8036D970, actor_new, 0x80); //boombox + spawnableActorList_add(&D_803677A8, actor_new, 0x8600); //ice_key + spawnableActorList_add(&D_80367814, actor_new, 0x8600); //SnS_egg + spawnableActorList_add(&gChFireFxInfo, actor_new, 0x0); //fire + spawnableActorList_add(&D_80367838, actor_new, 0x8600); //level_entry_disk + spawnableActorList_add(&D_80367760, actor_new, 0x1000); + spawnableActorList_add(&D_80367784, actor_new, 0x1000); + spawnableActorList_add(&D_80365E58, actor_new, 0x20480); //banjo.without_right_hand + spawnableActorList_add(&D_80365EAC, actor_new, 0x20480); //banjo.playing_gameboy + spawnableActorList_add(&D_80365F00, actor_new, 0x20480); //banjo.cooking + spawnableActorList_add(&D_803677CC, actor_new, 0x8680);//mumbo_transform_pad + spawnableActorList_add(&D_803677F0, actor_new, 0x8680); + spawnableActorList_add(&D_803731B0, actor_new, 0x0); + spawnableActorList_add(&D_80368710, actor_new, 0x100044);//snowball + spawnableActorList_add(&D_803687C0, actor_new, 0x4);//sir_slush_hat + spawnableActorList_add(&gChDripsInfo, actor_new, 0x400);//water_drops + spawnableActorList_add(&D_80372BA4, actor_new, 0x2020141);//ice_cube + spawnableActorList_add(&D_8036804C, actor_new, 0x508604);//GAME_OVER + spawnableActorList_add(&D_8036807C, actor_new, 0x508604);//THE_END + spawnableActorList_add(&D_803680AC, actor_new, 0x508604);//player_KAZOOIE + spawnableActorList_add(&D_803680DC, actor_new, 0x508604);//copyright_info + spawnableActorList_add(&D_80368124, actor_new, 0x508604);//PRESS_START + spawnableActorList_add(&D_803682D0, func_802DEB18, 0x509604);//jiggy_picture + spawnableActorList_add(&D_8036833C, actor_new, 0x508604); + spawnableActorList_add(&D_8036838C, actor_new, 0x509604); + spawnableActorList_add(&D_80368418, actor_new, 0x508644);//banjos_hand_BB + spawnableActorList_add(&D_80368174, actor_new, 0x508604);//NO_CONTROLLER); + spawnableActorList_add(&D_80367530, actor_new, 0x0);//mumbo_token_sign.5 + spawnableActorList_add(&D_80367554, actor_new, 0x0);//mumbo_toke_sign.10 + spawnableActorList_add(&D_80367578, actor_new, 0x0);//mumbo_toke_sign.15 + spawnableActorList_add(&D_8036759C, actor_new, 0x0);//mumbo_toke_sign.20 + spawnableActorList_add(&D_803675C0, actor_new, 0x0);//mumbo_toke_sign.25 + spawnableActorList_add(&D_8036785C, actor_new, 0x0);//witch_switch.mm; + spawnableActorList_add(&D_80367880, actor_new, 0x0);//witch_switch.mmm + spawnableActorList_add(&D_803678A4, actor_new, 0x0);//witch_switch.ttc + spawnableActorList_add(&D_803678C8, actor_new, 0x0);//witch_switch.rbb + spawnableActorList_add(&D_803678EC, actor_new, 0x0);//witch_switch.ccw + spawnableActorList_add(&D_80367910, actor_new, 0x0);//witch_switch.fp + spawnableActorList_add(&D_80367934, actor_new, 0x0);//witch_switch.cc + spawnableActorList_add(&D_80367958, actor_new, 0x0);//witch_switch.bgs + spawnableActorList_add(&D_8036797C, actor_new, 0x400);//witch_switch.gv + spawnableActorList_add(&D_80368450, actor_new, 0x20000);//fire_sparkle + spawnableActorList_add(&D_803684BC, actor_new, 0x180);//roysten + spawnableActorList_add(&D_803684E0, actor_new, 0x0);//cuckoo_clock + spawnableActorList_add(&D_80368504, actor_new, 0x0); + spawnableActorList_add(&D_80368528, actor_new, 0x0); + spawnableActorList_add(&D_8036854C, actor_new, 0x0); + spawnableActorList_add(&D_80368570, actor_new, 0x0); + spawnableActorList_add(&D_80368474, actor_new, 0xC8); + spawnableActorList_add(&D_80368498, actor_new, 0x0); + spawnableActorList_add(&D_803732E0, actor_new, 0x0); + spawnableActorList_add(&D_80372810, actor_new, 0x8008A8); + spawnableActorList_add(&D_80373100, actor_new, 0x28008A8); + spawnableActorList_add(&D_80373134, actor_new, 0x880); + spawnableActorList_add(&D_80373158, actor_new, 0x880); + spawnableActorList_add(&D_80372EE0, actor_new, 0x2000141); + spawnableActorList_addIfMapVisited(&D_80372F50, actor_new, 0x2010101, MAP_2_MM_MUMBOS_MOUNTAIN); //ticker + spawnableActorList_addIfMapVisited(&D_80372C80, actor_new, 0x2010981, MAP_31_RBB_RUSTY_BUCKET_BAY); //floatsam + spawnableActorList_addIfMapVisited(&D_80372C18, actor_new, 0x211A9, MAP_1B_MMM_MAD_MONSTER_MANSION); //teehee + spawnableActorList_addIfMapVisited(&D_80372FC0, actor_new, 0x2010001, MAP_1B_MMM_MAD_MONSTER_MANSION); + spawnableActorList_addIfMapVisited(&D_80372FE4, actor_new, 0x2010401, MAP_1B_MMM_MAD_MONSTER_MANSION); + spawnableActorList_addIfMapVisited(&D_803730D8, actor_new, 0x2200021, MAP_1B_MMM_MAD_MONSTER_MANSION); //nibbly + spawnableActorList_addIfMapVisited(&D_80367130, actor_new, 0x20009a9, MAP_D_BGS_BUBBLEGLOOP_SWAMP); //buzzbomb + spawnableActorList_addIfMapVisited(&D_80372B80, actor_new, 0x2020141, MAP_27_FP_FREEZEEZY_PEAK); + spawnableActorList_addIfMapVisited(&D_80367404, actor_new, 0x2000101, MAP_7_TTC_TREASURE_TROVE_COVE); //scrapnel + spawnableActorList_addIfMapVisited(&D_80372D78, actor_new, 0x3010121, MAP_1B_MMM_MAD_MONSTER_MANSION); //limbo + spawnableActorList_addIfMapVisited(&D_80372DF8, actor_new, 0x2010121, MAP_31_RBB_RUSTY_BUCKET_BAY); //grublin_hood + spawnableActorList_addIfMapVisited(&D_80372E78, actor_new, 0x3010129, MAP_12_GV_GOBIS_VALLEY); //mummum + spawnableActorList_addIfMapVisited(&D_80372840, actor_new, 0x2800960, MAP_B_CC_CLANKERS_CAVERN); //grillchompa + spawnableActorList_addIfMapVisited(&D_803670B8, actor_new, 0x3000121, MAP_7_TTC_TREASURE_TROVE_COVE); //snippet + spawnableActorList_addIfMapVisited(&D_803670DC, actor_new, 0x30000a0, MAP_7_TTC_TREASURE_TROVE_COVE); //black_snippet + spawnableActorList_addIfMapVisited(&D_80367100, actor_new, 0x3001021, MAP_7_TTC_TREASURE_TROVE_COVE); //mutie_snippet + spawnableActorList_addIfMapVisited(&D_80372870, actor_new, 0x2800820, MAP_40_CCW_HUB); //clucker + spawnableActorList_addIfMapVisited(&D_803728A0, actor_new, 0x2000981, MAP_12_GV_GOBIS_VALLEY); //scarab + spawnableActorList_addIfMapVisited(&D_80368670, actor_new, 0x2000460, MAP_27_FP_FREEZEEZY_PEAK); //sirslush + switch(loaded_asm_file){ + default: + break; + case OVERLAY_D_WITCH: + lair_func_8038A0C4(); + break; + case OVERLAY_E_BATTLE: + fight_func_803863F0(); + break; + case OVERLAY_C_INTRO: + cutscene_func_8038C4E0(); + break; + case OVERLAY_B_TRAINING: + sm_func_80386810(); + break; + case OVERLAY_3_HAUNTED: + mmm_func_803890E0(); + break; + case OVERLAY_2_WHALE: + cc_func_80387DA0(); + break; + case OVERLAY_4_DESERT: + gv_func_8038F154(); + break; + case OVERLAY_5_BEACH: + ttc_func_80388AC0(); + break; + case OVERLAY_6_JUNGLE: + mm_func_803888B0(); + break; + case OVERLAY_7_SWAMP: + bgs_func_8038F1E0(); + break; + case OVERLAY_8_SHIP: + rbb_func_80386C48(); + break; + case OVERLAY_9_SNOW: + fp_func_80391324(); + spawnableActorList_add(&D_80367BC8, actor_new, 0x8); + spawnableActorList_add(&D_80367BEC, actor_new, 0x8); + spawnableActorList_add(&D_80367C10, actor_new, 0x8); + break; + case OVERLAY_A_TREE: + ccw_func_8038DB6C(); + break; + } + + if(func_80255D04() == 0 || loaded_asm_file == 0 ){ + func_8030578C(); + } + func_80305990(1); + func_8032A5F8(); + func_802C3BDC(); +} + +void func_802C398C(void){ + spawnableActorList_free(); + func_80326124(); + func_80305D94(); + free(D_80365DC8); + D_80365DC8 = NULL; + D_80365DC4 = 0; + +} + +void func_802C39D4(void){ + func_803268B4(); + if(!levelSpecificFlags_validateCRC2()){ + write_file_blocks(0, 0, 0x80749530, EEPROM_MAXBLOCKS); + } +} + +void func_802C3A18(void){ + func_803283BC(); +} + +void func_802C3A38(void){ + s32 i; + + func_802C3BE8(); + for(i = 0; i < D_80365DC4; i++){ + switch(D_80365DC8[i].arg_cnt){ + case 0: + D_80365DC8[i].func0(); + break; + case 1: + D_80365DC8[i].func1(D_80365DC8[i].arg[0]); + break; + case 2: + D_80365DC8[i].func2(D_80365DC8[i].arg[0], D_80365DC8[i].arg[1]); + break; + case 3: + D_80365DC8[i].func3(D_80365DC8[i].arg[0], D_80365DC8[i].arg[1], D_80365DC8[i].arg[2]); + break; + case 4: + D_80365DC8[i].func4(D_80365DC8[i].arg[0], D_80365DC8[i].arg[1], D_80365DC8[i].arg[2], D_80365DC8[i].arg[3]); + break; + case 5: + D_80365DC8[i].func5(D_80365DC8[i].arg[0], D_80365DC8[i].arg[1], D_80365DC8[i].arg[2], D_80365DC8[i].arg[3], D_80365DC8[i].arg[4]); + break; + default: + break; + } + } + D_80365DC4 = 0; + func_803283D4(); +} + +void func_802C3BDC(void){ + D_80365DC0 = 0; +} + +void func_802C3BE8(void){ + D_80365DC0 = 1; +} + +void func_802C3BF8(void (* arg0)(void)){ + u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 0x32: 0xF; + if(tmp != D_80365DC4){ + D_80365DC8[D_80365DC4].func0 = arg0; + D_80365DC8[D_80365DC4].arg_cnt = 0; + D_80365DC4++; + } +} + +void func_802C3C88(GenMethod_1 arg0, s32 arg1){ + u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 0x32: 0xF; + if(tmp != D_80365DC4){ + D_80365DC8[D_80365DC4].func0 = (void (*)(void))arg0; + D_80365DC8[D_80365DC4].arg[0] = arg1; + D_80365DC8[D_80365DC4].arg_cnt = 1; + D_80365DC4++; + } +} + +void func_802C3D3C(void (* arg0)(void), s32 arg1, s32 arg2){ + u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 0x32: 0xF; + if(tmp != D_80365DC4){ + D_80365DC8[D_80365DC4].func0 = arg0; + D_80365DC8[D_80365DC4].arg[0] = arg1; + D_80365DC8[D_80365DC4].arg[1] = arg2; + D_80365DC8[D_80365DC4].arg_cnt = 2; + D_80365DC4++; + } +} + +void func_802C3E10(void (* arg0)(void), s32 arg1, s32 arg2, s32 arg3){ + u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 0x32: 0xF; + if(tmp != D_80365DC4){ + D_80365DC8[D_80365DC4].func0 = arg0; + D_80365DC8[D_80365DC4].arg[0] = arg1; + D_80365DC8[D_80365DC4].arg[1] = arg2; + D_80365DC8[D_80365DC4].arg[2] = arg3; + D_80365DC8[D_80365DC4].arg_cnt = 3; + D_80365DC4++; + } +} + +void func_802C3F04(GenMethod_4 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4){ + u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 0x32: 0xF; + if(tmp != D_80365DC4){ + D_80365DC8[D_80365DC4].func0 = (void (*)(void))arg0; + D_80365DC8[D_80365DC4].arg[0] = arg1; + D_80365DC8[D_80365DC4].arg[1] = arg2; + D_80365DC8[D_80365DC4].arg[2] = arg3; + D_80365DC8[D_80365DC4].arg[3] = arg4; + D_80365DC8[D_80365DC4].arg_cnt = 4; + D_80365DC4++; + } +} + +void func_802C4014(void (* arg0)(void), s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5){ + u32 tmp = (map_get() == MAP_90_GL_BATTLEMENTS)? 0x32: 0xF; + if(tmp != D_80365DC4){ + D_80365DC8[D_80365DC4].func0 = arg0; + D_80365DC8[D_80365DC4].arg[0] = arg1; + D_80365DC8[D_80365DC4].arg[1] = arg2; + D_80365DC8[D_80365DC4].arg[2] = arg3; + D_80365DC8[D_80365DC4].arg[3] = arg4; + D_80365DC8[D_80365DC4].arg[4] = arg5; + D_80365DC8[D_80365DC4].arg_cnt = 5; + D_80365DC4++; + } +} + +Actor *func_802C4140(enum actor_e actor_id, s32 x, s32 y, s32 z){ + f32 position[3]; + position[0] = reinterpret_cast(f32, x); + position[1] = reinterpret_cast(f32, y); + position[2] = reinterpret_cast(f32, z); + return func_8032813C(reinterpret_cast(enum actor_e, actor_id), position, 0); +} + + +Actor *func_802C418C(enum actor_e actor_id, s32 x, s32 y, s32 z){ + s16 position[3]; + position[0] = reinterpret_cast(s16, x); + position[1] = reinterpret_cast(s16, y); + position[2] = reinterpret_cast(s16, z); + return func_803282AC(reinterpret_cast(enum actor_e, actor_id), position, 0); +} + +Actor *func_802C41D8(enum actor_e actor_id, s32 x, s32 y, s32 z){ + s32 position[3]; + position[0] = reinterpret_cast(s32, x); + position[1] = reinterpret_cast(s32, y); + position[2] = reinterpret_cast(s32, z); + return func_8032811C(reinterpret_cast(enum actor_e, actor_id), position, 0); +} + +Actor *func_802C4218(enum actor_e actor_id, s32 x, s32 y, s32 z){ + f32 position[3]; + position[0] = reinterpret_cast(f32, x); + position[1] = reinterpret_cast(f32, y); + position[2] = reinterpret_cast(f32, z); + return func_802C937C(reinterpret_cast(enum actor_e, actor_id), position); +} + +Actor *func_802C4260(enum actor_e actor_id, s32 x, s32 y, s32 z, s32 yaw){ + f32 position[3]; + position[0] = reinterpret_cast(f32, x); + position[1] = reinterpret_cast(f32, y); + position[2] = reinterpret_cast(f32, z); + func_802C8F70(reinterpret_cast(f32, yaw)); + return func_802C937C(reinterpret_cast(enum actor_e, actor_id), position); + +} + +s32 func_802C42B4(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ + s32 sp1C[3]; + sp1C[0] = reinterpret_cast(s32, arg1); + sp1C[1] = reinterpret_cast(s32, arg2); + sp1C[2] = reinterpret_cast(s32, arg3); + return func_802C8F88(reinterpret_cast(s32, arg0), sp1C); +} + +s32 func_802C42F0(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ + s32 sp1C[3]; + sp1C[0] = arg1; + sp1C[1] = arg2; + sp1C[2] = arg3; + return func_802C8F88(arg0, sp1C); +} + +void func_802C4320(FunctionQueue *arg0){ + if((arg0 = D_80365DC8) != NULL) + D_80365DC8 = (FunctionQueue *)defrag(); +} diff --git a/src/core2/code_3EAD0.c b/src/core2/code_3EAD0.c new file mode 100644 index 00000000..8a21ddb4 --- /dev/null +++ b/src/core2/code_3EAD0.c @@ -0,0 +1,41 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + s32 unk0; +} ActorLocal_Core2_3EAD0; + +void func_802C5A60(Actor *this); + +/* .data */ +s32 D_80365F30[] = { + 1, 1, 2, 2, + 3, 4, 5, 6, + 7, 7, 8, 8 +}; +ActorInfo D_80365F60 = { 0x58, 0x4E, 0x7DE, 0, NULL, func_802C5A60, func_80326224, func_80325934, 0, 0, 0.0f, 0}; +ActorInfo D_80365F84 = { 0x59, 0x4F, 0x7DE, 0, NULL, func_802C5A60, func_80326224, func_80325934, 0, 0, 0.0f, 0}; + +/* .code */ +void func_802C5A60(Actor *this){ + ActorLocal_Core2_3EAD0 *local = (ActorLocal_Core2_3EAD0*)&this->local; + if(!this->initialized){ + switch(this->marker->unk14_20){ + case 0x58: + func_8032AA58(this, 0.35f); + break; + case 0x59: + func_8032AA58(this, 0.4f); + break; + } + this->marker->propPtr->unk8_5 = 0.5 < randf(); + this->position_y += 100.0*this->scale; + actor_collisionOff(this); + this->initialized = TRUE; + }//L802C5B60 + this->marker->propPtr->unk8_15 = D_80365F30[local->unk0]; + local->unk0++; + if(local->unk0 >= 0xC) + marker_despawn(this->marker); +} diff --git a/src/core2/code_3EC30.c b/src/core2/code_3EC30.c new file mode 100644 index 00000000..a497ee0f --- /dev/null +++ b/src/core2/code_3EC30.c @@ -0,0 +1,24 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_802C5BC0(Actor *this); + +/* .data */ +ActorInfo D_80365FB0 = { 0x65, 0xF3, 0x0, 0x0, 0x0, func_802C5BC0, func_80326224, func_80325340, 0, 0, 0.0f, 0}; + +/* .code */ +void func_802C5BC0(Actor *this){ + if(!this->initialized){ + actor_collisionOff(this); + this->unk60 = 0.0f; + this->pitch = 90.0f; + func_802F3554(4, this->position); + this->initialized = TRUE; + } + else{ + this->unk60 += time_getDelta(); + if(2.0 < this->unk60) + marker_despawn(this->marker); + } +} diff --git a/src/core2/code_3ECE0.c b/src/core2/code_3ECE0.c new file mode 100644 index 00000000..55648631 --- /dev/null +++ b/src/core2/code_3ECE0.c @@ -0,0 +1,61 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + s32 unk0; +}ActorLocal_Core2_3ECE0; + +void func_802C5DDC(Actor *this); +extern void func_802F32C4(s32, f32[3], f32, ActorMarker *, void(*)(f32[3], f32, ActorMarker *)); + +/* .data */ +ActorInfo D_80365FE0 = { + 0x6B, 0xE7, 0x704, + 0, NULL, func_802C5DDC, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; + +/* .code */ +int func_802C5C70(f32 arg0[3], f32 arg1, ActorMarker *marker){ + s32 pad2C; + Actor *this = marker_getActor(marker); + ActorLocal_Core2_3ECE0 *local = (ActorLocal_Core2_3ECE0 *) &this->local; + s32 pad20; + s32 sp1C = local->unk0; + + + this->position_x = arg0[0]; + this->position_y = arg0[1] - arg1/2; + this->position_z = arg0[2]; + func_8032AA58(this, arg1/200.0); + this->unk60 -= time_getDelta(); + if(this->unk60 < 0.0f){ + sp1C = 1; + } + if(sp1C) + marker_despawn(marker); + return sp1C; +} + +void func_802C5D54(Actor *this){ + func_8030E988(SFX_C5_TWINKLY_POP, 1.0f, 32000, this->position, 100.0f, 3000.0f); +} + +void func_802C5DA0(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + ActorLocal_Core2_3ECE0 *local = (ActorLocal_Core2_3ECE0 *) &this->local; + local->unk0 = 1; + this_marker->collidable = FALSE; + +} + +void func_802C5DDC(Actor *this){ + if(!this->initialized){ + this->initialized = TRUE; + marker_setCollisionScripts(this->marker, func_802C5DA0, NULL, NULL); + func_803300D8(this->marker, func_802C5D54); + func_802F32C4(func_8032994C(), this->position, 200.0f, this->marker, func_802C5C70); + this->unk60 = 10.0f; + } +} diff --git a/src/core2/code_400F0.c b/src/core2/code_400F0.c new file mode 100644 index 00000000..dc6b7409 --- /dev/null +++ b/src/core2/code_400F0.c @@ -0,0 +1,348 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802BB360(s32, f32); +extern void func_802BB3AC(s32, f32); + +typedef struct { + f32 unk0; + u8 unk4; + f32 unk8; + f32 unkC; +}Struct_Core2_400F0_0; + +typedef struct { + f32 unk0[2]; + f32 unk8[2]; +}ActorLocal_Core2_400F0; + +void func_802C75A0(Actor *actor, s32 arg1); + +/* .data */ +Struct_Core2_400F0_0 D_803660F0[] = { + {2.0f, 1, 1.0f, 0.1f}, + {0.034f, 0, 1.0f, 0.1f}, + {0.1f, 1, 0.0f, 0.1f}, + {0.034f, 0, 0.0f, 0.1f}, + {5.0f, 1, 1.0f, 0.06f}, + {0.034f, 0, 1.0f, 0.06f}, + {0.06f, 1, 0.0f, 0.06f}, + {0.034f, 0, 0.0f, 0.06f}, + {0.2f, 1, 1.0f, 0.09f}, + {0.034f, 0, 1.0f, 0.09f}, + {0.09f, 1, 0.0f, 0.09f}, + {0.034f, 0, 0.0f, 0.09f}, + {1.0f, 1, 1.0f, 0.1f}, + {0.034f, 0, 1.0f, 0.1f}, + {0.1f, 1, 0.0f, 0.1f}, + {0.034f, 0, 0.0f, 0.1f}, + {5.0f, 1, 1.0f, 0.1f}, + {0.034f, 0, 1.0f, 0.1f}, + {0.1f, 1, 0.0f, 0.1f}, + {0.034f, 0, 0.0f, 0.1f}, + {0.0f, 2, 0.0f, 0.0f} +}; + +Struct_Core2_400F0_0 D_80366240[] ={ + {0.0f, 01, 1.0f, 0.1f}, + {0.034f, 00, 1.0f, 0.1f}, + {0.1f, 01, 0.0f, 0.1f}, + {0.034f, 00, 0.0f, 0.1f}, + {0.0f, 02, 0.0f, 0.0f} +}; + +/* .code */ +void func_802C7080(Actor *actor, s32 arg1, f32 arg2, f32 arg3){ + ActorLocal_Core2_400F0 *local = (ActorLocal_Core2_400F0 *) &actor->local; + local->unk8[arg1] = arg2; + if(arg3 != 0.0f){ + actor->unk1C[arg1] = (local->unk8[arg1] - local->unk0[arg1])/arg3; + } + else{ + local->unk0[arg1] = local->unk8[arg1]; + } +} + +void func_802C70DC(Actor *actor, Struct_Core2_400F0_0 * arg1, s32 arg2){ + f32 tmp_f20; + Struct_Core2_400F0_0 *s0; + + tmp_f20 = time_getDelta(); + while(0.0f < tmp_f20){ + actor->unk60 -= tmp_f20; + if(0.0f < actor->unk60) + break; + tmp_f20 = mlAbsF(actor->unk60); + s0 = &arg1[actor->unk154]; + func_802C7080(actor, s0->unk4, s0->unk8, s0->unkC); + s0++; + if(s0->unk4 == 2){ + s0 = arg1; + if(!arg2){ + func_802C75A0(actor, 1); + return; + } + else{//L802C71A4 + actor->unk154 = 0; + } + } + else {//L802C71B0 + actor->unk154++; + } + //L802C71B8 + actor->unk60 = s0->unk0; + }//L802C71CC +} + +void func_802C71F0(Actor *actor){ + ActorLocal_Core2_400F0 *local = (ActorLocal_Core2_400F0 *) &actor->local; + switch(actor->modelCacheIndex){ + case 0x8E: + case 0xAC: + case 0xB8://L802C7254 + func_8033A45C(0x1, (s32)func_80257C48(local->unk0[0], 1.0f, 6.0f)); + func_8033A45C(0x2, (s32)func_80257C48(local->unk0[1], 1.0f, 6.0f)); + break; + + case 0x195: + case 0x196: + case 0x197://L802C72B0 + case 0x2FB://L802C72B4 + func_8033A45C(0x1C, (s32)func_80257C48(local->unk0[0], 1.0f, 8.0f)); + func_8033A45C(0x1D, (s32)func_80257C48(local->unk0[1], 1.0f, 8.0f)); + break; + } +} + +void func_802C7318(Actor *actor){ + ActorLocal_Core2_400F0 *local = (ActorLocal_Core2_400F0 *) &actor->local; + int i; + + for(i = 0; i < 2; i++){ + actor->unk1C[i] = 0.0f; + local->unk0[i] = 0.0f; + local->unk8[i] = 0.0f; + } + actor->unk60 = 0.0f; + actor->unk154 = 0; + actor->unk124_5 = 0; + reinterpret_cast(s32, actor->unkBC) = 1; + switch(actor->modelCacheIndex){ + case 0x195: + case 0x196: + case 0x197: + func_802C75A0(actor, 2); + break; + } +} + +void func_802C73B0(Actor *actor, ActorLocal_Core2_400F0 *local){ + f32 tmp_f0 = time_getDelta(); + int i; + + for(i = 0; i < 2; i++){ + if(local->unk8[i] != local->unk0[i]){ + local->unk0[i] += actor->unk1C[i]*tmp_f0; + + if( ((0.0f < actor->unk1C[i]) && (local->unk8[i] < local->unk0[i])) + || ((actor->unk1C[i] < 0.0f) && (local->unk0[i] < local->unk8[i])) + ){ + local->unk0[i] = local->unk8[i]; + } + }//L802C7460 + } +} + +void func_802C7478(Actor *actor){ + func_802C73B0(actor, &actor->local); + switch(actor->unk124_5){ + case 2://L802C74C4 + func_802C70DC(actor, &D_803660F0, 1); + break; + case 3://L802C74D8 + func_802C70DC(actor, &D_80366240, 0); + break; + case 1://L802C74E4 + break; + } +} + +void func_802C74F4(Actor *actor, s32 arg1, f32 arg2){ + f32 tmp_f0; + switch(reinterpret_cast(s32, actor->unkBC)){ + case 0: + tmp_f0 = 0.35f; + break; + case 2: + tmp_f0 = 0.09f; + break; + case 1: + default: + tmp_f0 = 0.2f; + break; + } + func_802C7080(actor, arg1, arg2, tmp_f0); +} + +void func_802C7568(enum actor_e actor_id, s32 arg1, f32 arg2){ + Actor *actor = func_80326EEC(actor_id); + if(actor) + func_802C74F4(actor, arg1, arg2); +} + +void func_802C75A0(Actor *actor, s32 arg1){ + actor->unk124_5 = arg1; + actor->unk154 = 0; + actor->unk60 = 0.0f; +} + +void func_802C75C8(enum actor_e actor_id, s32 arg1){ + Actor *actor = func_80326EEC(actor_id); + if(actor) + func_802C75A0(actor, arg1); +} + +void func_802C75F8(Actor *actor, s32 arg1){ + reinterpret_cast(s32, actor->unkBC) = arg1; +} + +void func_802C7600(enum actor_e actor_id, s32 arg1){ + Actor *actor = func_80326EEC(actor_id); + if(actor) + func_802C75F8(actor, arg1); +} + +void func_802C7630(enum actor_e actor_id){ + func_802C7600(actor_id, 0); +} + +void func_802C7650(enum actor_e actor_id){ + func_802C7600(actor_id, 1); +} + +void func_802C7670(enum actor_e actor_id){ + func_802C7600(actor_id, 2); +} + +void func_802C7690(enum actor_e actor_id){ + func_802C75C8(actor_id, 1); + func_802C7568(actor_id, 0, 1.0f); + func_802C7568(actor_id, 1, 1.0f); +} + +void func_802C76D4(enum actor_e actor_id){ + func_802C75C8(actor_id, 1); + func_802C7568(actor_id, 0, 0.0f); + func_802C7568(actor_id, 1, 0.0f); +} + +void func_802C7718(enum actor_e actor_id){ + func_802C75C8(actor_id, 1); + func_802C7568(actor_id, 0, 0.5f); + func_802C7568(actor_id, 1, 0.5f); +} + +void func_802C775C(enum actor_e actor_id){ + func_802C75C8(actor_id, 3); +} + +void func_802C777C(enum actor_e actor_id){ + func_802C75C8(actor_id, 2); +} + +int func_802C779C(s32 arg0){ + switch(arg0){ + case 0x10: // 802C77C8 + func_802C7630(0x8E); + func_802C7630(0xB8); + func_802C7630(0x2FB); + return TRUE; + case 0x11: // 802C77E8 + func_802C7650(0x8E); + func_802C7650(0xB8); + func_802C7650(0x2FB); + return TRUE; + case 0x12: // 802C7808 + func_802C7670(0x8E); + func_802C7670(0xB8); + func_802C7670(0x2FB); + return TRUE; + case 0x13: // 802C7828 + func_802C7690(0x8E); + func_802C7690(0xB8); + func_802C7690(0x2FB); + return TRUE; + case 0x14: // 802C7848 + func_802C76D4(0x8E); + func_802C76D4(0xB8); + func_802C76D4(0x2FB); + return TRUE; + case 0x15: // 802C7868 + func_802C7718(0x8E); + func_802C7718(0xB8); + func_802C7718(0x2FB); + return TRUE; + case 0x16: // 802C7888 + func_802C775C(0x8E); + func_802C775C(0xB8); + func_802C775C(0x2FB); + return TRUE; + case 0x17: // 802C78A8 + func_802C777C(0x8E); + func_802C777C(0xB8); + func_802C777C(0x2FB); + return TRUE; + case 0x18: // 802C78C8 + func_802C7630(0xAC); + return TRUE; + case 0x19: // 802C78D8 + func_802C7650(0xAC); + return TRUE; + case 0x1A: // 802C78E8 + func_802C7670(0xAC); + return TRUE; + case 0x1B: // 802C78F8 + func_802C7690(0xAC); + return TRUE; + case 0x1C: // 802C7908 + func_802C76D4(0xAC); + return TRUE; + case 0x1D: // 802C7918 + func_802C7718(0xAC); + return TRUE; + case 0x1E: // 802C7928 + func_802C775C(0xAC); + return TRUE; + case 0x1F: // 802C7938 + func_802C777C(0xAC); + return TRUE; + case 0xD: // 802C7948 + func_802BB360(0, 10.0f); + func_802BB3AC(0, 1.0f); + func_802BB3C4(0); + return TRUE; + case 0xE: // 802C7970 + func_802BB360(0, 35.0f); + func_802BB3AC(0, 1.0f); + func_802BB3C4(0); + return TRUE; + case 0xF: // 802C7998 + func_802BB3AC(0, 0.8f); + return TRUE; + break; + } + return FALSE; +} + + + + +void func_802C79C4(void){ + int i; + for(i = 0; i < 0x20; i++){ + if(mapSpecificFlags_get(i) && func_802C779C(i)){ + mapSpecificFlags_set(i, FALSE); + } + } +} \ No newline at end of file diff --git a/src/core2/code_41460.c b/src/core2/code_41460.c new file mode 100644 index 00000000..2ac6e740 --- /dev/null +++ b/src/core2/code_41460.c @@ -0,0 +1,294 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802EE6CC(f32[3], f32[3], s32[4], s32, f32, f32, s32, s32, s32); + +typedef struct struct_24_s{ + s32 unk0; + BKModelBin *model_bin; + f32 unk8[3]; + f32 unk14[3]; + f32 unk20[3]; + f32 unk2C; + f32 unk30[3]; + ParticleEmitter *unk3C; + s32 unk40[4]; + f32 unk50; +} Struct24s; + +typedef struct struct_25_s{ + Struct24s *begin; + Struct24s *current; + Struct24s *end; + Struct24s data[]; +} Struct25s; + +Actor *func_802C8484(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_802C8C5C(Actor *this); + +/* .data */ +f32 D_80366330 = 0.5f; +f32 D_80366334 = 30.0f; +f32 D_80366338 = 150.0f; +f32 D_8036633C = 25.0f; +ActorInfo D_80366340 = { 0x56, 0x4A, 0x0, 0x2, 0x0, func_802C8C5C, func_80326224, func_802C8484, 0, 0, 0.0f, 0}; +ActorInfo D_80366364 = { 0x56, 0x4B, 0x0, 0x2, 0x0, func_802C8C5C, func_80326224, func_802C8484, 0, 0, 0.0f, 0}; +ActorInfo D_80366388 = { 0x56, 0xD, 0x0, 0x2, 0x0, func_802C8C5C, func_80326224, func_802C8484, 0, 0, 0.0f, 0}; +ActorInfo D_803663AC = { 0x56, 0x11F, 0x0, 0x2, 0x0, func_802C8C5C, func_80326224, func_802C8484, 0, 0, 0.0f, 0}; +ActorInfo D_803663D0 = { 0x56, 0x14F, 0x0, 0x2, 0x0, func_802C8C5C, func_80326224, func_802C8484, 0, 0, 0.0f, 0}; +ActorInfo D_803663F4 = { 0x56, 0x3AD, 0x0, 0x2, 0x0, func_802C8C5C, func_80326224, func_802C8484, 0, 0, 0.0f, 0}; +s32 D_80366418[3] = {0,0,0}; + +/* .bss */ +s32 D_8037DD90; +s32 D_8037DD94; +u32 D_8037DD98; +u32 D_8037DD9C; +u32 D_8037DDA0; +u32 D_8037DDA4; + +/* .code */ +void func_802C83F0(Actor *actor) { + Struct25s *phi_a1; + Struct24s *phi_s0; + + phi_a1 = actor->unk40; + for( phi_s0 = phi_a1->begin; phi_s0 < phi_a1->current; phi_s0++){ + if (phi_s0->model_bin != NULL) { + assetcache_release(phi_s0->model_bin); + } + if (phi_s0->unk3C != 0) { + func_802EE5E8(phi_s0->unk3C); + } + phi_s0->unk3C = NULL; + } + free(actor->unk40); +} + +Actor *func_802C8484(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Struct25s *temp_s1; + Struct24s *phi_s0; + f32 sp5C; + Actor *sp58; + u32 phi_v1; + s32 phi_s4; + + sp58 = func_80325300(marker, &sp5C); + temp_s1 = sp58->unk40; + phi_s4 = FALSE; + for(phi_s0 = temp_s1->begin; phi_s0 < temp_s1->current; phi_s0++){ + if ((phi_s0->unk0 != 0) && (phi_s0->model_bin != NULL)) { + set_model_render_mode(1); + func_803391A4(gfx, mtx, phi_s0->unk8, phi_s0->unk14, phi_s0->unk2C / 10.0f, NULL, phi_s0->model_bin); + phi_s4 = TRUE; + } + } + if (phi_s4 == FALSE) { + marker_despawn(marker); + } + return sp58; +} + +Actor *func_802C8580(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ + Struct25s *s1 = malloc(sizeof(Struct25s) + D_8037DD90 * sizeof(Struct24s)); + Actor *actor = actor_new(position, yaw, actorInfo, flags); + f32 f24; + f32 sp68[3]; + Struct24s * s0; + + actor->marker->collidable = FALSE; + s1->begin = &s1->data[0]; + s1->current = &s1->data[0]; + s1->end = s1->begin + D_8037DD90; + + for(s1->current = s1->begin; s1->current < s1->end; s1->current++){//L802C8670 + f24 = randf2(0.0f, 360.0f); + s0 = s1->current; + s0->unk0 = 2; + s0->unk40[0] = D_8037DD98; + s0->unk40[1] = D_8037DD9C; + s0->unk40[2] = D_8037DDA0; + s0->unk40[3] = D_8037DDA4; + + TUPLE_ASSIGN(s0->unk30, + randf2(100.0f, 250.0f), + randf2(500.0f, 750.0f), + randf2(100.0f, 250.0f) + ); + + s0->unk8[0] = randf2(50.0f, 150.0f); + s0->unk8[1] = 0.0f; + s0->unk8[2] = 0.0f; + switch(D_8037DD94){ + case 1: // 802C8740 + s0->unk30[0] = randf2(125.0f, 175.0f); + s0->unk30[1] = randf2(400.0f, 600.0f); + s0->unk30[2] = randf2(125.0f, 175.0f); + s0->model_bin = (BKModelBin *) assetcache_get(0x2e7); + s0->unk2C = 18.0f; + break; + case 2: // 802C87A8 + s0->model_bin = (BKModelBin *) assetcache_get(0x344); + s0->unk2C = 2.0f; + break; + case 4: // 802C87C4 + s0->model_bin = (BKModelBin *) assetcache_get(0x345); + s0->unk2C = 1.0f; + s0->unk30[0] = randf2(20.0f, 100.0f); + s0->unk30[1] = randf2(400.0f, 740.0f); + s0->unk30[2] = randf2(20.0f, 100.0f); + + s0->unk8[0] = randf2(0.0f, 30.0f); + s0->unk8[1] = 0.0f; + s0->unk8[2] = 0.0f; + break; + case 0: // 802C883C + if(0.5 < randf()) + s0->model_bin = (BKModelBin *) assetcache_get(0x2d1); + else + s0->model_bin = (BKModelBin *) assetcache_get(0x2e5); + + s0->unk2C = randf2(5.0f, 12.0f); + break; + case 3: // 802C88A0 + s0->model_bin = (BKModelBin *) assetcache_get(0x30e); + s0->unk2C = randf2(9.0f, 15.0f); + break; + case 5: // 802C88C8 + s0->model_bin = (BKModelBin *) assetcache_get(0x8a2); + s0->unk2C = 2.0f; + break; + }//L802C88E0 + s0->unk3C = 0; + sp68[0] = (f32)position[0]; + sp68[1] = (f32)position[1]; + sp68[2] = (f32)position[2]; + + sp68[0] += s0->unk30[0]*3.0f; + s0->unk50 = func_80309724(&sp68); + + s0->unk14[2] = 0.0f; + s0->unk14[1] = 0.0f; + s0->unk14[0] = 0.0f; + + s0->unk20[0] = randf2(0.05f, 0.4f); + s0->unk20[1] = randf2(0.05f, 0.4f); + s0->unk20[2] = randf2(0.05f, 0.4f); + + ml_vec3f_yaw_rotate_copy(&s0->unk8, &s0->unk8, f24); + s0->unk8[0] += actor->position_x; + s0->unk8[1] += actor->position_y; + s0->unk8[2] += actor->position_z; + + ml_vec3f_yaw_rotate_copy(&s0->unk30, &s0->unk30, randf2(15.0f, 90.0f) + f24); + }//L802C8A08 + actor->unk40 = s1; + func_803300D8(actor->marker, func_802C83F0); + return actor; +} + +Actor *func_802C8A54(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ + D_8037DD90 = 0xF; + D_8037DD94 = 1; + D_8037DD98 = 0xFA; + *(&D_8037DD98 + 1) = 0xFA; + *(&D_8037DD98 + 2) = 0xFA; + *(&D_8037DD98 + 3) = 0x78; + return func_802C8580(position, yaw, actorInfo, flags); +} + +Actor *func_802C8AA8(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ + D_8037DD90 = 0x19; + D_8037DD94 = 0; + D_8037DD98 = 0xFA; + *(&D_8037DD98 + 1) = 0xFA; + *(&D_8037DD98 + 2) = 0xFA; + *(&D_8037DD98 + 3) = 0x78; + return func_802C8580(position, yaw, actorInfo, flags); +} + +Actor *func_802C8AF8(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ + D_8037DD90 = 0x19; + D_8037DD94 = 3; + D_8037DD98 = 0xFA; + *(&D_8037DD98 + 1) = 0xFA; + *(&D_8037DD98 + 2) = 0xFA; + *(&D_8037DD98 + 3) = 0x78; + return func_802C8580(position, yaw, actorInfo, flags); +} + +Actor *func_802C8B4C(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ + D_8037DD90 = 0xF; + D_8037DD94 = 2; + D_8037DD98 = 0x95; + *(&D_8037DD98 + 1) = 0x55; + *(&D_8037DD98 + 2) = 0x2B; + *(&D_8037DD98 + 3) = 0x9B; + return func_802C8580(position, yaw, actorInfo, flags); +} + +Actor *func_802C8BA8(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ + D_8037DD90 = 0x19; + D_8037DD94 = 4; + D_8037DD98 = 0x95; + *(&D_8037DD98 + 1) = 0x55; + *(&D_8037DD98 + 2) = 0x2B; + *(&D_8037DD98 + 3) = 0x9B; + return func_802C8580(position, yaw, actorInfo, flags); +} + +Actor *func_802C8C04(s32 position[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ + D_8037DD90 = 0xf; + D_8037DD94 = 5; + D_8037DD98 = 0xC8; + *(&D_8037DD98 + 1) = 0xC8; + *(&D_8037DD98 + 2) = 0xA0; + *(&D_8037DD98 + 3) = 0x9B; + return func_802C8580(position, yaw, actorInfo, flags); +} + +void func_802C8C5C(Actor *actor) { + f32 sp94[3]; + f32 temp_f0 = time_getDelta(); + f32 sp84[3]; + Struct25s *temp_s2 = actor->unk40; + Struct24s *phi_s0; + s32 sp70[3] = D_80366418; + + for(phi_s0 = temp_s2->begin; phi_s0 < temp_s2->current; phi_s0++){ + if (phi_s0->unk0 == 2) { + phi_s0->unk30[1] -= 1000.0f * temp_f0; + + phi_s0->unk14[0] += phi_s0->unk20[0] / temp_f0; + phi_s0->unk14[1] += phi_s0->unk20[1] / temp_f0; + phi_s0->unk14[2] += phi_s0->unk20[2] / temp_f0; + + sp94[0] = phi_s0->unk8[0]; + sp94[1] = phi_s0->unk8[1]; + sp94[2] = phi_s0->unk8[2]; + + sp84[0] = phi_s0->unk30[0] * temp_f0; + sp84[1] = phi_s0->unk30[1] * temp_f0; + sp84[2] = phi_s0->unk30[2] * temp_f0; + + phi_s0->unk8[0] = phi_s0->unk8[0] + sp84[0]; + phi_s0->unk8[1] = phi_s0->unk8[1] + sp84[1]; + phi_s0->unk8[2] = phi_s0->unk8[2] + sp84[2]; + + if (phi_s0->unk8[1] <= phi_s0->unk50) { + phi_s0->unk0 = 1; + phi_s0->unk3C = func_802EE5E0(1); + if (phi_s0->unk3C != 0) { + func_802EE6CC(phi_s0->unk8, sp70, phi_s0->unk40, 1, D_80366330, D_80366334, (s32)D_80366338, (s32)D_8036633C, 1); + } + } + } + if (phi_s0->unk0 == 1) { + if (!func_802EE5F0(phi_s0->unk3C)) { + phi_s0->unk0 = 0; + } + phi_s0->unk8[1] -= 2.0f; + } + } +} diff --git a/src/core2/code_41F30.c b/src/core2/code_41F30.c new file mode 100644 index 00000000..923fe752 --- /dev/null +++ b/src/core2/code_41F30.c @@ -0,0 +1,21 @@ +#include +#include "functions.h" +#include "variables.h" + +void chextralife_update(Actor *this); + +ActorInfo chExtraLife = { MARKER_61_EXTRA_LIFE, ACTOR_49_EXTRA_LIFE, ASSET_36E_MODEL_EXTRA_LIFE, + 0x0, NULL, + chextralife_update, func_80326224, func_80325934, + 0, 0, 0.7f, 0 +}; + +void chextralife_update(Actor *this){ + if(!this->initialized){ + func_8032AA58(this, 0.8f); + this->initialized = TRUE; + if(func_803203FC(1) || func_803203FC(2)){ + marker_despawn(this->marker); + } + } +} diff --git a/src/core2/code_41FB0.c b/src/core2/code_41FB0.c new file mode 100644 index 00000000..32fb7ea5 --- /dev/null +++ b/src/core2/code_41FB0.c @@ -0,0 +1,120 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + s16 unk0; + u8 pad2[0x2]; + s32 unk4; + s32 unk8; + u8 padC[0x8]; + f32 unk14; + f32 unk18; + f32 unk1C; + f32 unk20; + f32 unk24; + f32 unk28; + u8 pad2C[0x4]; + f32 unk30; +} struct41FB0s; + +typedef struct { + s32 unk0; + s16 unk4; + s16 unk6; + f32 unk8[3]; + f32 unk14[3]; + f32 unk20; + f32 unk24; + f32 unk28; + u8 unk2C; + u8 unk2D; + u8 unk2E; + u8 unk2F; +} struct41FB0s_1; + +/* .data */ +extern struct41FB0s D_80366460[]; +extern f32 D_80366C4C; + +/* .rodata */ +extern f64 D_80376410; + +/* .bss */ +extern f32 D_8037DDB4; +extern f32 D_8037DDB8; + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_41FB0/func_802C8F40.s") + +void func_802C8F68(void){} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_41FB0/func_802C8F70.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_41FB0/func_802C8F7C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_41FB0/func_802C8F88.s") + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_41FB0/func_802C8FE4.s") +#else +Actor *func_802C8FE4(s32 arg0, f32 position[3], Actor *arg2){ + struct41FB0s * sp74; //s2 + Actor *actor; //s3 + s32 i; + struct41FB0s_1 *s0; + + sp74 = D_80366460 + arg0; + actor = NULL; + for(i = 0; i < sp74->unk8; i++){//L802C90B0 + for( D_8037DDB4 = D_8037DDB4 + 360.0/sp74->unk8; 360.0 <= D_8037DDB4; D_8037DDB4 -= 360.0); + //L802C9114 + actor =(i == 0 && arg2) ? arg2 : func_8032813C(sp74->unk4, position, 0); + actor->unk10_0 = 1; + s0 = (struct41FB0s_1 *) &actor->unkBC; + s0->unk0 = arg0; + s0->unk2F = 1; + s0->unk6 = 1; + ml_vec3f_copy(s0->unk8, actor->position); + ml_vec3f_copy(actor->position, s0->unk8); + if(D_8037DDB8 != 1.0f){ + s0->unk14[0] = sp74->unk14*D_8037DDB8; + s0->unk14[1] = sp74->unk1C + randf2(0.0f, sp74->unk20); + s0->unk14[2] = sp74->unk24*D_8037DDB8; + D_8037DDB8 = 1.0f; + } + else{//L802C91CC + s0->unk14[0] = sp74->unk14 + randf2(0.0f, sp74->unk18); + s0->unk14[1] = sp74->unk1C + randf2(0.0f, sp74->unk20); + s0->unk14[2] = sp74->unk24 + randf2(0.0f, sp74->unk28); + + }//L802C9210 + ml_vec3f_yaw_rotate_copy(s0->unk14, s0->unk14, D_8037DDB4); + s0->unk24 = -1.0f * D_80366C4C; + D_80366C4C = s0->unk24; + actor->unk5C = s0->unk20 = (sp74->unk0 & 0x20) ? sp74->unk30 : randf2(0.0f, 360.0f); + s0->unk28 = 0.0f; + s0->unk2C = 0; + s0->unk2D = 1; + s0->unk4 = sp74->unk0; + s0->unk2E = (sp74->unk0 & 0x1) ? ((0.5 < randf()) ? 1 : 0) : 0 ; + if(sp74->unk0 & 0x200){ + actor->unk5C = s0->unk8[1]; + } + }//L802C92E8 + return actor; +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_41FB0/func_802C9334.s") + +Actor *func_802C937C(s32 arg0, f32 position[3]){ + return func_802C8FE4(arg0, position, 0); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_41FB0/func_802C939C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_41FB0/func_802C96E4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_41FB0/func_802C9C0C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_41FB0/func_802C9C14.s") diff --git a/src/core2/code_42CB0.c b/src/core2/code_42CB0.c new file mode 100644 index 00000000..e451e059 --- /dev/null +++ b/src/core2/code_42CB0.c @@ -0,0 +1,168 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80329904(ActorMarker*, s32, f32*); + +typedef struct{ + s32 uid; + s32 unk4; +}ActorLocal_EmptyHoneycomb; + +void func_802C9E70(Actor *this); + +/* .data */ +ActorInfo D_80366C80 = { MARKER_53_EMPTY_HONEYCOMB, ACTOR_47_EMPTY_HONEYCOMB, ASSET_361_MODEL_EMPTY_HONEYCOMB, + 0, NULL, + func_802C9E70, func_80326224, func_80325888, + 0, 0, 0.8f, 0 +}; + +ActorInfo D_80366CA4 = { MARKER_55_HONEYCOMB, ACTOR_50_HONEYCOMB, ASSET_363_MODEL_HONEYCOMB, + 0, NULL, + func_802C9E70, func_80326224, func_80325888, + 0, 0, 0.8f, 0 +}; + +/* .bss */ +extern enum honeycomb_e D_8037DDC0; +extern array(s32) * D_8037DDC4; +extern s32 D_8037DDC8; +extern u32 D_8037DDCC; +extern s32 D_8037DDD0; + +/* .code */ +enum honeycomb_e func_802C9C40(Actor *this){ + s32 tmp_a0; + s32 sp18[3]; + + if(map_get() == MAP_2_MM_MUMBOS_MOUNTAIN){ + if (2500.0f < this->position_y) + return HONEYCOMB_2_MM_JUJU; + else + return HONEYCOMB_1_MM_HILL; + } + + sp18[0] = (s32)this->position_x; + sp18[1] = (s32)this->position_y; + sp18[2] = (s32)this->position_z; + + tmp_a0 = func_80307164(sp18); + if(tmp_a0 < 0) + return 0; + + return func_80306DBC(tmp_a0) - 0x63; +} + +void func_802C9CF4(Actor *this){ + ActorLocal_EmptyHoneycomb *local = (ActorLocal_EmptyHoneycomb *)&this->local; + + D_8037DDC8--; + func_802EDCDC(D_8037DDC4, local->uid); + D_8037DDCC &= ~(1 << local->uid); + if(D_8037DDC8 == 0){ + array_free(D_8037DDC4); + D_8037DDC4 = NULL; + } +} + +void func_802C9D80(void){ + int i; + ActorMarker **i_marker_ptr; + ActorMarker *i_marker; + Actor *i_actor; + ActorLocal_EmptyHoneycomb *i_local; + u32 s2; + ActorMarker *s5; + s5 = NULL; + s2 = 0xFFFFFFFF; + for(i = 1; i < array_size(D_8037DDC4); i++){ + if(D_8037DDCC & (1 << i)){ + i_marker_ptr = (ActorMarker **)array_at(D_8037DDC4, i); + i_marker = *i_marker_ptr; + i_actor = marker_getActor(i_marker); + i_local = (ActorLocal_EmptyHoneycomb *)&i_actor->local; + if(i_local->unk4 < s2 && !i_actor->despawn_flag){ + s2 = i_local->unk4; + s5 = i_marker; + } + } + } + func_802F373C(&s5->propPtr->x); + marker_despawn(s5); +} + +void func_802C9E70(Actor *this){ + ActorLocal_EmptyHoneycomb *local = (ActorLocal_EmptyHoneycomb *)&this->local; + ActorMarker **tmp_v0; + int i; + + if(!this->initialized){ + this->unk60 = (randf() < 0.5) ? 200.0 : -200.0; + this->initialized = TRUE; + if( this->marker->unk14_20 == MARKER_53_EMPTY_HONEYCOMB){ + if(local->uid == 0) + local->uid = (!this->unk44_2)? D_8037DDC0 : func_802C9C40(this); + if( honeycombscore_get(local->uid) + || func_803203FC(1) + || func_803203FC(2) + ){ + marker_despawn(this->marker); + return; + } + } + }//L802C9F9C + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if( this->marker->unk14_20 == MARKER_55_HONEYCOMB + && !this->unk44_2 + ){ + func_803300D8(this->marker, func_802C9CF4); + D_8037DDC8++; + if(D_8037DDC4 == NULL){ + D_8037DDC4 = (array(s32) *) array_new(sizeof(s32), 10); + } + else if(D_8037DDC8 >= 11){ + func_802C9D80(); + } + tmp_v0 = (ActorMarker **)func_802EDAA4(&D_8037DDC4, this->local); + *tmp_v0 = this->marker; + D_8037DDCC |= 1 << local->uid; + local->unk4 = D_8037DDD0; + D_8037DDD0++; + } + }//L802CA098 + + if(map_get() == MAP_27_FP_FREEZEEZY_PEAK){ + if(func_8038BFA0()){ + this->unk58_0 = FALSE; + actor_collisionOff(this); + return; + } + else{ + this->unk58_0 = TRUE; + actor_collisionOn(this); + } + } + + this->yaw += time_getDelta()*this->unk60; + if(360.0f <= this->yaw) this->yaw -= 360.0f; + if(this->yaw < 0.0f) this->yaw += 360.0f; + + for(i = 0; i < 4; i++){ + if(randf() < 0.03){ + func_8033E73C(this->marker, i+5, func_80329904); + func_8033E3F0(8, this->marker->unk14_21); + } + } +} + +enum honeycomb_e func_802CA1C4(Actor *this){ + ActorLocal_EmptyHoneycomb *local = (ActorLocal_EmptyHoneycomb *)&this->local; + return local->uid; +} + +void func_802CA1CC(enum honeycomb_e id){ + D_8037DDC0 = id; +} diff --git a/src/core2/code_43250.c b/src/core2/code_43250.c new file mode 100644 index 00000000..3d679481 --- /dev/null +++ b/src/core2/code_43250.c @@ -0,0 +1,173 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + s16 unk0; + u8 unk2; + u8 unk3; +}Struct_Core2_43250_1; + +typedef struct { + Struct_Core2_43250_1 *unk0; + s16 unk4; + u8 pad6[2]; +}Struct_Core2_43250_0; + + + +void func_802CA1E0(Actor *this); + +/* .data */ +extern ActorInfo D_80366CD0 = { + 0x3D, 0x183, 0, + 0, NULL, + func_802CA1E0, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; + +extern Struct_Core2_43250_1 D_80366CF4 [16]= { + {SFX_6B_LOCKUP_OPENING, 0x40, 0xFF}, + {SFX_6C_LOCKUP_CLOSING, 0x80, 0xFA}, + {SFX_3F_CAULDRON_SQEAK_1, 0x99, 0x65}, + {SFX_40_CAULDRON_SQEAK_2, 0x99, 0x65}, + {SFX_3F_CAULDRON_SQEAK_1, 0x99, 0x65}, + {SFX_40_CAULDRON_SQEAK_2, 0x99, 0x65}, + {SFX_AD_CATERPILLAR_SQUEAK, 0x80, 0x75}, + {SFX_AD_CATERPILLAR_SQUEAK, 0x8C, 0x94}, + {SFX_C5_TWINKLY_POP, 0x80, 0xFA}, + {SFX_CC_PAUSEMENU_ENTER_SUBMENU, 0xD9, 0xFA}, + {SFX_2F_ORANGE_SPLAT, 0x8C, 0xC3}, + {SFX_12A_GRUNTY_AH, 0x8C, 0xFA}, + {SFX_12A_GRUNTY_AH, 0x8C, 0xFA}, + {SFX_20_METAL_CLANK_1, 0x73, 0x75}, + {SFX_20_METAL_CLANK_1, 0x80, 0x75}, + {SFX_20_METAL_CLANK_1, 0x79, 0x75} +}; + +extern Struct_Core2_43250_1 D_80366D34[4] = { + {SFX_EA_GRUNTY_LAUGH_1, 0x80, 0xFA}, + {SFX_6B_LOCKUP_OPENING, 0x73, 0xFF}, + {SFX_6C_LOCKUP_CLOSING, 0x80, 0xFA}, + {SFX_C_TAKING_FLIGHT_LIFTOFF, 0x66, 0xFA} +}; + +extern Struct_Core2_43250_1 D_80366D44[13] = { + {SFX_C6_SHAKING_MOUTH, 0x80, 0xFF}, + {SFX_2C_PULLING_NOISE, 0x80, 0xFF}, + {SFX_C5_TWINKLY_POP, 0x80, 0xFF}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E} +}; + +extern Struct_Core2_43250_1 D_80366D78[8] = { + {SFX_5D_BANJO_RAAOWW, 0x59, 0xC3}, + {SFX_5E_BANJO_PHEWWW, 0x59, 0xC3}, + {SFX_5D_BANJO_RAAOWW, 0x59, 0xC3}, + {SFX_5E_BANJO_PHEWWW, 0x59, 0xC3}, + {SFX_44_KAZOOIE_AUW, 0x80, 0xFA}, + {SFX_5D_BANJO_RAAOWW, 0x59, 0xC3}, + {SFX_5E_BANJO_PHEWWW, 0x59, 0xC3}, + {SFX_5D_BANJO_RAAOWW, 0x59, 0xC3}, +}; + +extern Struct_Core2_43250_1 D_80366D98[14] = { + {SFX_EA_GRUNTY_LAUGH_1, 0x86, 0xFA}, + {SFX_C_TAKING_FLIGHT_LIFTOFF, 0x59, 0xFA}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_6F_BANJO_HEADSCRATCH, 0x80, 0x4E}, + {SFX_EB_GRUNTY_LAUGH_2, 0x80, 0xFA}, + {SFX_C_TAKING_FLIGHT_LIFTOFF, 0x59, 0xFA} +}; + +extern Struct_Core2_43250_1 D_80366DD0[37] = { + {SFX_15_METALLIC_HIT_2, 0x80, 0xFA}, + {SFX_E_SHOCKSPRING_BOING, 0x80, 0xFA}, + {SFX_8F_SNOWBALL_FLYING, 0x80, 0xFA}, + {SFX_16_HEAVY_FALL_VIBRATO, 0x80, 0xFA}, + {SFX_B6_GLASS_BREAKING_1, 0x80, 0x94}, + {SFX_14_METALLIC_HIT_1, 0x80, 0xFA}, + {SFX_13_BEAKBUSTER_GROUND, 0x80, 0xFA}, + {SFX_2D_KABOING, 0x80, 0xFA}, + {SFX_2C_PULLING_NOISE, 0x80, 0xFA}, + {SFX_103_FLOTSAM_DEATH, 0x80, 0xFA}, + {SFX_5E_BANJO_PHEWWW, 0x59, 0xC3}, + {SFX_5D_BANJO_RAAOWW, 0x59, 0xC3}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_5E_BANJO_PHEWWW, 0x59, 0xC3}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_5D_BANJO_RAAOWW, 0x59, 0xC3}, + {SFX_105_EYRIE_YAWN, 0x4C, 0xC3}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_105_EYRIE_YAWN, 0x4C, 0xC3}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_98_DEAF_THUD, 0xA6, 0xA4}, + {SFX_8B_KAZOOIE_RAWW, 0x80, 0xFA}, + {SFX_8B_KAZOOIE_RAWW, 0x80, 0xFA}, + {SFX_9B_BOULDER_BREAKING_1, 0x80, 0x9C} +}; + +extern Struct_Core2_43250_0 D_80366E64[] = { + {D_80366CF4, 0x10, {00, 00}}, + {D_80366D34, 0x04, {00, 00}}, + {D_80366D44, 0x0D, {00, 00}}, + {D_80366D78, 0x08, {00, 00}}, + {D_80366D98, 0x0E, {00, 00}}, + {D_80366DD0, 0x25, {00, 00}}, +}; + +/* .code */ +void func_802CA1E0(Actor *this){ + s32 tmp_v1; + Struct_Core2_43250_1 *tmp_v0; + s32 phi_a0; + f32 tmp_f4; + s32 phi_a2; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + tmp_v1 = (s32)this->yaw; + this->unk154 = D_80366E64[tmp_v1].unk0; + reinterpret_cast(s32, this->unkBC[4]) = D_80366E64[tmp_v1].unk4; + reinterpret_cast(s32, this->unkBC[0]) = 0; + } + if(func_8025AEEC() && this->unk154){ + tmp_v0 = (Struct_Core2_43250_1 *)this->unk154 + reinterpret_cast(s32, this->unkBC[0]); + phi_a0 = tmp_v0->unk0; + tmp_f4 = tmp_v0->unk2*0.0078125; + phi_a2 = tmp_v0->unk3*128.0; + func_8030E6A4(phi_a0, tmp_f4, phi_a2); + reinterpret_cast(s32, this->unkBC[0])++; + if(reinterpret_cast(s32, this->unkBC[0]) == reinterpret_cast(s32, this->unkBC[4])) + this->unk154 = 0; + } +} diff --git a/src/core2/code_43800.c b/src/core2/code_43800.c new file mode 100644 index 00000000..71dc2c28 --- /dev/null +++ b/src/core2/code_43800.c @@ -0,0 +1,74 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_8028E82C(void); + +Actor *func_802CA7BC(ActorMarker *, Gfx **, Mtx **, Vtx **); +void func_802CA92C(Actor *this); + +extern ActorInfo D_80366EF0 = { + MARKER_32_PLAYER_SHADOW, ACTOR_17_PLAYER_SHADOW, ASSET_3BF_MODEL_PLAYER_SHADOW, + 0x1, 0x0, + func_802CA92C, func_80326224, func_802CA7BC, + 0, 0, 0.0f, 0 +}; + +/* .rodata */ +extern f32 D_80376480; + +/* .code */ +void func_802CA790(Actor *this){ + func_8033A410(0xff); + set_model_render_mode(2); +} + +Actor *func_802CA7BC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this; + f32 sp60; + f32 sp54[3]; + f32 sp48[3]; + f32 sp44; + f32 sp40; + f32 sp34[3]; + + sp60 = (func_8028EE84() == BSWATERGROUP_2_UNDERWATER) ? 8.0f : 4.0f; + this = marker_getActor(marker); + if( !func_8028F070() + || !func_8028F150() + || !func_8028F2DC() + ){ + return this; + } + + player_getPosition(sp54); + sp40 = func_8028E82C(); + func_8028E84C(sp34); + this->position_x = sp54[0]; + this->position_y = sp40 + sp60; + this->position_z = sp54[2]; + + func_80258108(sp34, &this->yaw, &this->pitch); + + sp48[0] = this->pitch; + sp48[1] = this->yaw; + sp48[2] = this->roll; + sp44 = ml_map_f(sp54[1] - sp40, 0.0f, 300.0f, 0.43f, D_80376480); + func_8033A2D4(func_802CA790, this); + func_803391A4(gfx, mtx, this->position, sp48, sp44, NULL, func_80330B1C(marker)); + return this; +} + + +void func_802CA92C(Actor *this){ + f32 sp34[3]; + f32 sp28[3]; + this->marker->collidable = FALSE; + player_getPosition(this->position); + func_8024C5CC(sp34); + ml_vec3f_diff_copy(sp28, sp34, this->position); + ml_vec3f_set_length_copy(sp28, sp28, 180.0f); + this->position_x += sp28[0]; + this->position_y += sp28[1]; + this->position_z += sp28[2]; +} diff --git a/src/core2/code_43A40.c b/src/core2/code_43A40.c new file mode 100644 index 00000000..3e7c705c --- /dev/null +++ b/src/core2/code_43A40.c @@ -0,0 +1,103 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_802CA9D0(Actor *this); +void func_802CAA44(Actor *this); +void func_802CAB70(Actor *this); + +/* .data */ +extern ActorInfo D_80366F20 = { + 0x0D4, ACTOR_B_SHOCKSPRING_PAD, ASSET_489_MODEL_SHOCKSPRING_PAD, + 0, NULL, + func_802CA9D0, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_80366F44 = { + 0x045, ACTOR_E4_FLIGHT_PAD, ASSET_48A_MODEL_FLIGHT_PAD, + 0, NULL, + func_802CAA44, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_80366F68 = { + 0x261, ACTOR_39F_FIGHT_FLIGHT_PAD, ASSET_48A_MODEL_FLIGHT_PAD, + 0, NULL, + func_802CAB70, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + + +extern struct31s D_80366F8C = { + {0.4f, 0.4f}, + {0.0f, 0.0f}, + {0.0f, 0.01f}, + {3.0f, 3.0f}, + 0.0f, 0.35f +}; + + +extern struct43s D_80366FB4 = { + {{-360.0f, 360.0f, -360.0}, {360.0f, 660.0f, 360.0f}}, + {{0.0f, -1200.0f, 0.0f}, {0.0f, -1200.0f, 0.0f}}, + {{0.0f, 0.0f, 0.0f}, {0.0f, 40.0f, 0.0f}} +}; + +/* .code */ +void func_802CA9D0(Actor *this){ + this->marker->propPtr->unk8_3 = TRUE; + if(func_803203FC(UNKFLAGS1_86_SANDCASTLE_SHOCKSPRING_JUMP_UNLOCKED)){ + ability_unlock(ABILITY_D_SHOCK_JUMP); + } + + if(ability_isUnlocked(ABILITY_D_SHOCK_JUMP)){ + actor_setOpacity(this, 0xff); + } + else{ + actor_setOpacity(this, 0x5a); + } +} + +void func_802CAA44(Actor *this){ + this->marker->propPtr->unk8_3 = TRUE; + if(func_803203FC(UNKFLAGS1_8A_SANDCASTLE_FLIGHT_UNLOCKED)){ + ability_unlock(ABILITY_9_FLY); + } + + if(ability_isUnlocked(ABILITY_9_FLY)){ + actor_setOpacity(this, 0xff); + } + else{ + actor_setOpacity(this, 0x5a); + } + + if(map_get() == MAP_12_GV_GOBIS_VALLEY){ + this->unk6C = 352.0f; + this->pitch = 352.0f; + this->yaw_moving = 90.0f; + this->yaw = 90.0f; + } +} + +void func_802CAAF0(f32 position[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(0x18); + particleEmitter_setSprite(pCtrl, ASSET_715_SPRITE_SPARKLE_RED); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80366FB4); + func_802EFB98(pCtrl, &D_80366F8C); + func_802EFA78(pCtrl, 1); + particleEmitter_emitN(pCtrl, 0x18); +} + +void func_802CAB70(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + func_802CAAF0(this->position); + FUNC_8030E8B4(SFX_113_PAD_APPEARS, 1.0f, 32000, this->position, 5000, 12000); + } + this->marker->propPtr->unk8_3 = TRUE; + this->alpha_124_19 = MIN(this->alpha_124_19 + this->unk38_31, 0xFF); + actor_setOpacity(this, this->alpha_124_19); + +} diff --git a/src/core2/code_440B0.c b/src/core2/code_440B0.c new file mode 100644 index 00000000..f18c09b2 --- /dev/null +++ b/src/core2/code_440B0.c @@ -0,0 +1,400 @@ +#include +#include "functions.h" +#include "variables.h" + +extern bool func_80259254(f32[3], f32, f32, f32); + +void func_802CBAAC(Actor *this); + +/* .data */ +ActorAnimationInfo D_80367010[] ={ + { 0, 0.0f}, + {0x1DA, 0.8f}, + { 0x2C, 2.0f}, + { 0x2C, 1.4f}, + { 0x2C, 0.7f}, + { 0x96, 0.5f}, + { 0x97, 0.8f}, + {0x155, 0.55f}, + { 0x2C, 1.4f}, + { 0x2C, 4.0f} +}; + +ActorAnimationInfo D_80367060[] = { + {0x000, 0.0f}, + {0x1DB, 0.8f}, + {0x156, 2.0f}, + {0x156, 1.4f}, + {0x156, 0.7f}, + {0x158, 0.5f}, + {0x157, 0.8f}, + {0x159, 0.55f}, + {0x156, 1.4f}, + {0x156, 2.0f} +}; + +/* .code */ +void func_802CB040(Actor *this) { + this->unk28 = randf2(1.5f, 2.3f); +} + +void func_802CB078(Actor *this) { + u32 temp_t9; + + if ((this->modelCacheIndex != 0xF2) || func_8038B550()) { + temp_t9 = (u32) this->unk38_31 >> 0x16; + if (this->unk38_31 != 0) { + this->unk38_31--; + return; + } + else{ + if( func_80329530(this, 1500) + && ( (this->modelCacheIndex == 0xF2) || func_803292E0(this)) + ) { + this->unk28 = 0.0f; + func_80328A84(this, 3U); + } + } + } +} + +void func_802CB140(Actor *this) { + func_80328A84(this, 2U); + func_802CB040(this); + func_80328CEC(this, (s32) this->yaw_moving, 135, 175); + this->unk38_31 = 150; +} + +void func_802CB1A4(ActorMarker *marker, ActorMarker *other){ + Actor *this; + + this = marker_getActor(marker); + if ((this->state == 4) && func_803294F0(this, 80, func_80329784(this))) { + FUNC_8030E8B4(SFX_1E_HITTING_AN_ENEMY_2, 1.0f, 28000, this->position, 950, 1900); + func_802CB140(this); + func_80328A84(this, 1); + } +} + +void func_802CB22C(ActorMarker *marker, ActorMarker *other) { + Actor *this; + + this = marker_getActor(marker); + this->unk60 = 3.0f; + func_80328A84(this, 6); + actor_playAnimationOnce(this); + if (marker->unk14_20 == 0x13) { + FUNC_8030E8B4(SFX_6E_VILE_EGH, 2.0f, 26000, this->position, 950, 1900); + marker->unk14_20 = 0x16B; + } + if (marker->unk14_20 == 0xDD) { + FUNC_8030E8B4(SFX_6E_VILE_EGH, 2.0f, 26000, this->position, 950, 1900); + marker->unk14_20 = 0xDE; + } +} + +void func_802CB310(ParticleEmitter *p_ctrl, f32 position[3]) { + particleEmitter_setPosition(p_ctrl, position); + func_802EFA70(p_ctrl, 2); + func_802EF9F8(p_ctrl, 0.7f); + func_802EFA18(p_ctrl, 5); + func_802EFA20(p_ctrl, 0.8f, 1.0f); + func_802EF9EC(p_ctrl, 0x1F, 10000); + particleEmitter_setSpawnIntervalRange(p_ctrl, 0.0f, 0.01f); + func_802EFEC0(p_ctrl, 3.5f, 3.5f); + func_802EFA5C(p_ctrl, 0.0f, 0.65f); +} + + +void func_802CB3C8(ParticleEmitter *p_ctrl, f32 position[3], enum asset_e model_id) { + func_802CB310(p_ctrl, position); + particleEmitter_setParticleAccelerationRange(p_ctrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); + particleEmitter_setModel(p_ctrl, model_id); + func_802EFB70(p_ctrl, 0.5f, 0.8f); + func_802EFE24(p_ctrl, -800.0f, -800.0f, -800.0f, 800.0f, 800.0f, 800.0f); + particleEmitter_setParticleVelocityRange(p_ctrl, -200.0f, 850.0f, -200.0f, 400.0f, 1000.0f, 400.0f); + particleEmitter_emitN(p_ctrl, 2); +} + +void func_802CB4B8(ParticleEmitter *p_ctrl, f32 position[3], enum asset_e model_id) { + func_802CB310(p_ctrl, position); + particleEmitter_setParticleAccelerationRange(p_ctrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); + particleEmitter_setModel(p_ctrl, model_id); + func_802EFB70(p_ctrl, 0.5f, 0.8f); + func_802EFE24(p_ctrl, -800.0f, -800.0f, -800.0f, 800.0f, 800.0f, 800.0f); + particleEmitter_setParticleVelocityRange(p_ctrl, -200.0f, 850.0f, -200.0f, 400.0f, 1000.0f, 400.0f); + particleEmitter_emitN(p_ctrl, 6); +} + +void func_802CB5A8(ParticleEmitter *p_ctrl, f32 position[3], enum asset_e model_id) { + func_802CB310(p_ctrl, position); + particleEmitter_setParticleAccelerationRange(p_ctrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); + particleEmitter_setModel(p_ctrl, model_id); + func_802EFB70(p_ctrl, 1.0f, 1.0f); + func_802EFE24(p_ctrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(p_ctrl, -50.0f, 750.0f, -50.0f, 120.0f, 900.0f, 120.0f); + particleEmitter_emitN(p_ctrl, 1); +} + +void func_802CB6A0(void) { + f32 sp1C[3]; + + sp1C[0] = 13814.0f; + sp1C[1] = 3812.0f; + sp1C[2] = 0.0f; + jiggySpawn(0x16U, sp1C); +} + +void func_802CB6E4(ActorMarker *caller, enum asset_e text_id, s32 model_id){ + if (text_id == 0xD33) { + func_80324E38(0.0f, 3); + timed_setCameraToNode(0.0f, 4); + timedFunc_set_0(0.1f, func_802CB6A0); + func_80324E88(3.0f); + func_80324E38(3.0f, 0); + return; + } + levelSpecificFlags_set(0xE, FALSE); +} + +bool func_802CB76C(ActorMarker *marker, ActorMarker *other) { + Actor *this; + + this = marker_getActor(marker); + if ((this->modelCacheIndex == 0xF2) && !func_8038B550()) { + return FALSE; + } + return TRUE; +} + +void func_802CB7C0(ActorMarker *marker, ActorMarker *other){ + Actor *this; + f32 sp48[3]; + f32 sp44; + bool sp40; + bool sp3C; + s32 phi_a2; + ParticleEmitter *p_ctrl; + + this = marker_getActor(marker); + sp40 = this->modelCacheIndex == 0xF5; + sp3C = this->modelCacheIndex == 0xF2; + FUNC_8030E8B4(SFX_79_TICKER_DEATH, 1.0f, 32750, this->position, 950, 1900); + FUNC_8030E8B4(SFX_79_TICKER_DEATH, 1.0f, 28000, this->position, 950, 1900); + func_802C3F04(func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); + this->unk60 = 5.0f; + marker->collidable = FALSE; + this->unk138_27 = 1; + marker_despawn(marker); + if( map_get() == MAP_B_CC_CLANKERS_CAVERN + && func_80259254(this->position, 13778.0f, 0.0f, 3000.0f) + ) { + this->unk124_9 = 2; + if( !jiggyscore_isCollected(JIGGY_16_CC_SNIPPETS) + && ((func_80326D68(this->position, 0xF5, -1, &sp44) == NULL) || (3000.0f < sp44))) { + sp48[0] = 13814.0f; + sp48[1] = 3812.0f; + sp48[2] = 0.0f; + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF); + func_80324DBC(2.25f, 0xD33, 0xF, sp48, NULL, func_802CB6E4, NULL); + } + } + p_ctrl = partEmitList_pushNew(2); + phi_a2 = (sp40) ? 0x392 : (sp3C) ? 0x569 : 0x38C; + func_802CB3C8(p_ctrl, this->position, phi_a2); + + p_ctrl = partEmitList_pushNew(6); + phi_a2 = (sp40) ? 0x391 : (sp3C) ? 0x568 : 0x38D; + func_802CB4B8(p_ctrl, this->position, phi_a2); + + p_ctrl = partEmitList_pushNew(1); + phi_a2 = (sp40) ? 0x390 : (sp3C) ? 0x567 : 0x38E; + func_802CB5A8(p_ctrl, this->position, phi_a2); +} + +void func_802CBA34(Actor *this) { + if (actor_animationIsAt(this, 0.4f)) { + FUNC_8030E8B4(SFX_3D_TICKER_WALKING, 0.85f, 15000, this->position, 950, 1900); + } + if (actor_animationIsAt(this, 0.9f)) { + FUNC_8030E8B4(SFX_3D_TICKER_WALKING, 1.15f, 15000, this->position, 950, 1900); + } +} + +void func_802CBAAC(Actor *this) { + s32 sp34; + f32 sp30; + s32 sp2C; + static s32 D_803670B0 = 0; + static s32 D_803670B4 = 0; + + sp34 = func_8023DB5C(); + sp30 = time_getDelta(); + sp2C = this->modelCacheIndex == 0xF5; + if (!this->unk16C_4) { + marker_setCollisionScripts(this->marker, func_802CB1A4, func_802CB22C, func_802CB7C0); + func_803300C0(this->marker, &func_802CB76C); + this->unk124_0 = this->unk138_31 = FALSE; + this->unk138_24 = FALSE; + this->unk16C_4 = TRUE; + animctrl_setTransitionDuration(this->animctrl, 0.25f); + if (map_get() == MAP_A_TTC_SANDCASTLE) { + if (!jiggyscore_isCollected(JIGGY_10_TTC_SANDCASTLE)) { + mapSpecificFlags_set(1, 0); + } + if (func_803203FC(2)) { + marker_despawn(this->marker); + return; + } + } + } + + if (func_803203FC(0xC1) != 0) { + if (this->unkF4_8 != 1) { + marker_despawn(this->marker); + return; + } + this->yaw_moving = (f32) func_80329784(this); + func_80328FB0(this, 4.0f); + return; + } + if( (map_get() == MAP_B_CC_CLANKERS_CAVERN) + && !mapSpecificFlags_get(0) + && sp2C + && !jiggyscore_isCollected(JIGGY_16_CC_SNIPPETS) + && func_80329530(this, 500) && !func_80329530(this, 200) + && !func_8028ECAC() + ) { + if ((this->state != 6) && (this->state != 5)) { + func_80311480(0xD32, 0xF, this->position, NULL, func_802CB6E4, NULL); + mapSpecificFlags_set(0, TRUE); + levelSpecificFlags_set(0xE, TRUE); + this->unk138_24 = TRUE; + } + } + if (map_get() == MAP_A_TTC_SANDCASTLE) { + if( !mapSpecificFlags_get(0) + && levelSpecificFlags_get(2) + && !func_803203FC(2) + && !jiggyscore_isCollected(JIGGY_10_TTC_SANDCASTLE) + && func_80329530(this, 1600) + ) { + func_80311480(0xA12, 4, this->position, NULL, NULL, NULL); + mapSpecificFlags_set(0, TRUE); + } else if (mapSpecificFlags_get(1)) { + func_80311480(0xA13, 4, this->position, NULL, NULL, NULL); + mapSpecificFlags_set(1, FALSE); + } + } + if (levelSpecificFlags_get(0xE)) { + if ((this->state != 8) && (this->state != 9)) { + func_80328B8C(this, (this->unk138_24) ? 8 : 9, 0.0f, 1); + this->unk138_24 = FALSE; + } + } + + switch(this->state){ + case 1: //L802CBE30 + if (func_80328B38(this, 2, 0.03f)) { + func_802CB040(this); + } + func_802CB078(this); + break; + + case 9: //L802CBE6C + if (!levelSpecificFlags_get(0xE)) { + func_80328B8C(this, 3, 0.0f, 1); + } + break; + + case 2: //L802CBE9C + func_80328FB0(this, 1.0f); + if( func_8032CA80(this, (this->modelCacheIndex == 0xF2)? 0xD: 0) + && func_80329480(this) + ) { + func_80328CEC(this, (s32) this->yaw, 90, 150); + } + func_80328BD4(this, 1, 0.0f, 1, 0.0075f); + func_802CB078(this); + break; + + case 3: //L802CBF44 + this->yaw_moving = (f32) func_80329784(this); + func_80328FB0(this, 4.0f); + if (func_80329480(this)) { + func_80328A84(this, 4); + this->unk28 = 12.0f; + } + break; + + case 8: //L802CBF9C + this->yaw_moving = func_80329784(this) + 90.0; + func_80328FB0(this, 4.0f); + if (func_80329480(this)) { + func_80328A84(this, 9); + this->unk28 = 12.0f; + } else if (!levelSpecificFlags_get(0xE)) { + func_80328B8C(this, 3, 0.0f, 1); + } + break; + + case 4: //L802CC024 + if ((func_8023DB5C() & 0xF) == 9) { + this->yaw_moving = (f32) func_80329784(this); + } + func_80328FB0(this, 7.0f); + if (func_8032CA80(this, (this->modelCacheIndex == 0xF2)? 0xD : 0)) { + func_802CB140(this); + } + break; + + case 5: //L802CC0AC + this->unk60 = MAX(0.0, this->unk60 - sp30); + if (this->unk60 == 0.0f) { + func_80328A84(this, 7); + actor_playAnimationOnce(this); + if (this->marker->unk14_20 == 0x16B) { + this->marker->unk14_20 = 0x13; + } + if (this->marker->unk14_20 == 0xDE) { + this->marker->unk14_20 = 0xDD; + } + } + break; + + case 6: //L802CC18C + if (animctrl_isStopped(this->animctrl)) { + if (this->unk60 == 0.0f) { + func_80326310(this); + } else { + func_80328A84(this, 5); + actor_loopAnimation(this); + } + } + break; + + case 7: //L802CC1E8 + if (animctrl_isStopped(this->animctrl)) { + func_80328A84(this, 1); + actor_loopAnimation(this); + } + break; + } + + if ((this->state == 2) || (this->state == 3) || (this->state == 4)) { + if (sp34 != D_803670B0) { + D_803670B0 = sp34; + D_803670B4 = 1; + func_802CBA34(this); + } + else if (D_803670B4 != 0) { + D_803670B4--; + func_802CBA34(this); + } + } +} + +/* .data */ +ActorInfo D_803670B8 = { 0x13, 0x67, 0x358, 0x1, D_80367010, func_802CBAAC, func_80326224, func_80325888, 1900, 0, 0.8f, 0}; +ActorInfo D_803670DC = { 0xDD, 0xF2, 0x566, 0x1, D_80367010, func_802CBAAC, func_80326224, func_80325888, 1900, 0, 0.8f, 0}; +ActorInfo D_80367100 = { 0x13, 0xF5, 0x38F, 0x1, D_80367060, func_802CBAAC, func_80326224, func_80325888, 1900, 0, 0.8f, 0}; diff --git a/src/core2/code_45310.c b/src/core2/code_45310.c new file mode 100644 index 00000000..7ca7d7ba --- /dev/null +++ b/src/core2/code_45310.c @@ -0,0 +1,526 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_8025715C(f32, f32); +extern f32 func_802575BC(f32); +extern f32 func_80309B24(f32[3]); +extern void func_8030DBB4(u8, f32); +extern void func_802CC340(Actor *, f32[3]); +extern void func_80335A8C(void *, s32); +extern bool func_80320DB0(f32[3], f32, f32[3], u32); + +typedef struct { + u8 unk0; + f32 unk4; + f32 unk8[3]; + f32 unk14; + f32 unk18[3]; + f32 unk24; + f32 unk28; + f32 unk2C; + s16 unk30[3]; + s16 unk36; + u8 unk38; + u8 unk39; + u8 unk3A; +}ActorLocal_Core2_45310; + +Actor *func_802CCA7C(ActorMarker *, Gfx **, Mtx **, Vtx **); +void func_802CCC5C(Actor *this); + +/* .data */ +extern ActorInfo D_80367130 = { + 0xC2, 0x134, 0x3ED, + 0, NULL, + func_802CCC5C, NULL, func_802CCA7C, + 0, 0, 1.0f, 0 +}; + + +/* .code */ +bool func_802CC2A0(Actor *this) { + ActorLocal_Core2_45310 * local; + s32 pad30; + f32 sp2C[3]; + f32 sp20[3]; + + local = (ActorLocal_Core2_45310 *)&this->local; + if (!this->marker->unk14_21) { + return TRUE; + } + func_80255FE4(sp20, local->unk8, local->unk18, func_802575BC(local->unk4 + 0.05)); + sp20[1] += 60.0f; + return func_80320DB0(sp20, 50.0f, sp2C, 0) == 0; +} + +void func_802CC340(Actor *this, f32 arg1[3]) { + ActorLocal_Core2_45310 * local; + f32 phi_f2; + f32 sp1C[3]; + + local = (ActorLocal_Core2_45310 *)&this->local; + local->unk3A = 2; + local->unk4 = 0.0f; + local->unk8[0] = this->position[0];\ + local->unk8[1] = this->position[1];\ + local->unk8[2] = this->position[2]; + local->unk18[0] = arg1[0]; + local->unk18[1] = arg1[1]; + local->unk18[2] = arg1[2]; + local->unk14 = this->yaw; + local->unk14 =(local->unk14 >= 360.0f) ? local->unk14 - 360.0f : local->unk14; + local->unk14 =(local->unk14 <= -360.0f) ? local->unk14 + 360.0f : local->unk14; + local->unk24 = local->unk14; + sp1C[0] = local->unk18[0] - local->unk8[0]; + sp1C[1] = local->unk18[1] - local->unk8[1]; + sp1C[2] = local->unk18[2] - local->unk8[2]; + phi_f2 = func_8025715C(sp1C[0], sp1C[2]); + if ((phi_f2 - local->unk14) > 180.0f) { + phi_f2 = phi_f2 - 360.0f; + } + if ((phi_f2 - local->unk14) < -180.0f) { + phi_f2 = phi_f2 + 360.0f; + } + local->unk24 = phi_f2; +} + + +void func_802CC4A4(Actor *this, f32 arg1[3]) { + ActorLocal_Core2_45310 * local; + f32 sp28; + f32 sp1C[3]; + f32 phi_f2; + f32 phi_f12; + + local = (ActorLocal_Core2_45310 *)&this->local; + local->unk18[0] = arg1[0]; + local->unk18[1] = arg1[1]; + local->unk18[2] = arg1[2]; + sp1C[0] = local->unk18[0] - local->unk8[0]; + sp1C[1] = local->unk18[1] - local->unk8[1]; + sp1C[2] = local->unk18[2] - local->unk8[2]; + phi_f2 = func_8025715C(sp1C[0], sp1C[2]); + phi_f12 = phi_f2 - local->unk14; + if(phi_f12 > 180.0f){ + phi_f2 = phi_f2 - 360.0f; + } + else if(phi_f12 < -180.0f){ + phi_f2 = phi_f2 + 360.0f; + } + local->unk24 = phi_f2; +} + + +bool func_802CC57C(Actor *this, f32 arg1[3]) { + ActorLocal_Core2_45310 * local; + f32 sp40[3]; + f32 sp34[3]; + f32 sp28[3]; + s32 sp24; + + local = (ActorLocal_Core2_45310 *)&this->local; + sp40[0] = arg1[0]; + sp40[1] = arg1[1]; + sp40[2] = arg1[2]; + sp28[0] = this->position[0]; + sp28[1] = this->position[1] + 30.0f; + sp28[2] = this->position[2]; + if (local->unk39 > 0) { + local->unk39--; + return 0; + } + sp24 = func_80309B48(sp28, sp40, sp34, 0); + if (sp24 != 0) { + local->unk39 = randi2(5, 0xA); + } else { + local->unk39 = 0; + } + return sp24 == 0; +} + + +void func_802CC640(Actor *this, s32 next_state) { + ActorLocal_Core2_45310 * local; + s32 phi_s0; + f32 sp54[3]; + f32 sp48[3]; + + local = (ActorLocal_Core2_45310 *)&this->local; + if (this->state == 0) { + func_80335924(this->unk148, 0xF9, 0.0f, 0.45f); + func_80335A8C(this->unk148, 1); + } + this->state = next_state; + local->unk36 = 0; + local->unk28 = 0.0f; + + if (this->state == 1) { + local->unk28 = randf2(0.0f, 2.0f); + } + + if (this->state == 2) { + func_80335924(this->unk148, 0xF9, 0.3f, 0.45f); + func_80335A8C(this->unk148, 1); + for(phi_s0 = 0; phi_s0 < 10; phi_s0++){ + sp54[0] = this->position[0]; + sp54[1] = (f32) local->unk30[1]; + sp54[2] = this->position[2]; + sp54[0] += randf2(-300.0f, 300.0f); + sp54[1] += randf2(100.0f, 300.0f); + sp54[2] += randf2(-300.0f, 300.0f); + if(func_80329210(this, sp54)){ + break; + } + } + if (phi_s0 == 0xA) { + sp54[0] = (f32) local->unk30[0]; + sp54[1] = (f32) local->unk30[1]; + sp54[2] = (f32) local->unk30[2]; + sp54[1] += 200.0f; + } + func_802CC340(this, sp54); + } + if (this->state == 3) { + player_getPosition(sp48); + sp48[1] += 90.0f; + func_802CC340(this, sp48); + } + + if (this->state == 5) { + func_8028F55C(1, this->marker); + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200); + func_80335924(this->unk148, 0xF9, 0.4f, 1.0f); + func_80335A8C(this->unk148, 1); + timed_playSfx(0.8f, 0x3FC, randf2(0.97f, 1.05f), 32000); + local->unk3A = 0; + local->unk28 = 2.0f; + } + + if (this->state == 4) { + local->unk28 = 3.5f; + } + + if (this->state == 6) { + this->unk138_27 = 1; + this->marker->collidable = FALSE; + this->unk10_1 = FALSE; + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200); + func_80335924(this->unk148, 0x110, 0.3f, 0.45f); + func_80335A8C(this->unk148, 1); + local->unk36 = 0x3E8; + local->unk3A = 0; + } + + if (this->state == 7) { + local->unk2C = 0.0f; + } + + if (this->state == 8) { + marker_despawn(this->marker); + } +} + +void func_802CC9FC(ActorMarker *marker, ActorMarker *other){ + Actor *this; + + this = marker_getActor(marker); + if (this->state < 5) { + func_802CC640(this, 5); + } +} + +void func_802CCA3C(ActorMarker *marker, ActorMarker *other){ + Actor *this; + + this = marker_getActor(marker); + if (this->state < 6U) { + func_802CC640(this, 6); + } +} + +Actor *func_802CCA7C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *this; + ActorLocal_Core2_45310 * local; + + this = marker_getActor(marker); + local = (ActorLocal_Core2_45310 *)&this->local; + if (this->state == 0) { + return this; + } + this->unk124_11 = 1; + if (this->state == 7) { + this->alpha_124_19 = (1.0f - local->unk2C) * 255.0f; + } else { + this->alpha_124_19 = 0xff; + } + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_802CCBC8(Actor *this) { + ActorLocal_Core2_45310 * local; + + local = (ActorLocal_Core2_45310 * )&this->local; + if(local->unk0 != 0){ + func_8030DA44(local->unk0); + } +} + +void func_802CCBF4(Actor *this) { + ActorLocal_Core2_45310 * local; + + local = (ActorLocal_Core2_45310 * )&this->local; + local->unk0 = func_8030D90C(); + func_8030DBB4(local->unk0, 0.9f); + sfxsource_setSfxId(local->unk0, 0x3FA); + func_8030DD14(local->unk0, 2); + sfxsource_setSampleRate(local->unk0, 0); +} + +void func_802CCC5C(Actor *this) { + f32 spC4[3]; + ActorLocal_Core2_45310 * local; + s32 spBC; + f32 spB8; + f32 temp_f0; + f32 spB0; + f32 spAC; + f32 spA8; + f32 phi_f12; + f32 phi_f2; + f32 sp9C; + f32 sp30; + f32 sp8C[3]; + f32 sp80[3]; + f32 sp74[3]; + f32 sp68[3]; + f32 sp5C[3]; + f32 sp58; + f32 sp4C[3]; + f32 sp40[3]; + + + spBC = 0; + spB8 = time_getDelta(); + local = (ActorLocal_Core2_45310 * )&this->local; + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->marker->unk30 = func_802CCBC8; + local->unk38 = 0; + local->unk39 = 0; + local->unk3A = 0; + local->unk28 = 0.0f; + marker_setCollisionScripts(this->marker, func_802CC9FC, NULL, func_802CCA3C); + local->unk30[0] = (s16) this->position[0]; + local->unk30[1] = (s16) this->position[1]; + local->unk30[2] = (s16) this->position[2]; + local->unk30[1] = (s16) func_80309724(this->position); + temp_f0 = func_80309B24(this->position); + if (local->unk30[1] < temp_f0) { + local->unk30[1] = (s16) (s32) temp_f0; + } + local->unk0 = 0; + func_802CC640(this, 1); + } + if (!actor_playerIsWithinDist(this, 4000)) { + if (local->unk0 != 0) { + func_8030DA44(local->unk0); + local->unk0 = 0; + } + } else { + if (local->unk0 == 0) { + func_802CCBF4(this); + } + player_getPosition(spC4); + if(this->state != 0){ + if (this->state < 6) { + spB0 = func_8030E200(local->unk0); + if (local->unk3A == 1) { + spAC = 0.9f; + spA8 = 1.0f; + } else { + spAC = 0.8f; + spA8 = 0.9f; + } + if (spB0 < spAC) { + spB0 = spB0 + 0.02; + } else if (spA8 < spB0) { + spB0 = spB0 - 0.02; + } else { + spB0 += randf2(-0.05, 0.05); + spB0 = (spB0 < spAC) ? spAC : MIN(spA8 , spB0); + } + func_8030DBB4(local->unk0, spB0); + phi_f12 = 1.0f - ml_vec3f_distance(spC4, this->position) / 2000.0f; + if(0.0f > phi_f12){ + phi_f12 = 0.0f; + } + if (phi_f12 > 0.0f) { + sfxsource_setSampleRate(local->unk0, (s32) (phi_f12 * 10000.0f)); + func_8030E2C4(local->unk0); + } + } + } + if (this->unk10_25 != 0) { + if (func_8025773C(&local->unk28, spB8) != 0) { + spBC = 2; + } + if (local->unk3A == 2) { + if (this->state == 3) { + local->unk4 += 2 * spB8; + } else { + local->unk4 += 1 * spB8; + } + if (local->unk4 >= 1.0f) { + local->unk4 = 1.0f; + if (func_803203FC(0xC1)) { + local->unk3A = 0; + } else { + if (this->state == 2) { + local->unk3A = 1; + } else if (this->state == 3) { + if (func_8033567C(this->unk148) != 0x10E) { + func_80335924(this->unk148, 0x10E, 0.2f, 0.75f); + func_80335A8C(this->unk148, 2); + } else if (0.575 <= func_80335684(this->unk148)) { + local->unk3A = 1; + } + } + } + } + if (local->unk3A == 2) { + sp9C = func_802575BC(local->unk4); + this->yaw = local->unk14 + (sp9C*(local->unk24 - local->unk14)); + } else { + local->unk4 = 0.0f; + local->unk14 = (f32) local->unk24; + } + } + if (local->unk3A == 1) { + sp30 = 1 * spB8; + if ( !func_802CC2A0(this) + || ((this->state == 3) && !func_80329210(this, this->position))) { + local->unk18[0] = this->position[0]; + local->unk18[1] = this->position[1]; + local->unk18[2] = this->position[2]; + local->unk4 = 1.0f; + } + local->unk4 += sp30; + if (local->unk4 >= 1.0f) { + local->unk3A = 0; + local->unk4 = 1.0f; + } + sp9C = func_802575BC(local->unk4); + func_80255FE4(this->position, local->unk8, local->unk18, sp9C); + this->yaw = local->unk14 + (sp9C * (local->unk24 - local->unk14)); + if ((func_8033567C(this->unk148) == 0x10E) && (func_80335794(this->unk148) > 0)) { + func_80335924(this->unk148, 0x10F, 0.1f, 0.45f); + func_80335A8C(this->unk148, 1); + } + if( (local->unk3A == 0) + || ((func_8033567C(this->unk148) == 0x10F) && (0.7 <= local->unk4))) { + func_80335924(this->unk148, 0xF9, 0.3f, 0.45f); + func_80335A8C(this->unk148, 1); + } + if (this->state == 3) { + if (0.2 <= local->unk4) { + if (0.8 < local->unk4) { + phi_f2 = 0.0f; + } else { + phi_f2 = 1.0 - ((local->unk4 - 0.2) / 0.6); + } + func_8030DBB4(local->unk0, phi_f2 * 0.3999999999999999 + 1.0); + } + } + } + if (this->state == 1) { + player_getPosition(sp8C); + func_8024C5CC(sp80); + func_8024C5A8(sp74); + sp5C[0] = this->position[0] - sp80[0]; + sp5C[1] = this->position[1] - sp80[1]; + sp5C[2] = this->position[2] - sp80[2]; + sp58 = sp74[0] * sp5C[0] + sp74[1] * sp5C[1] + sp74[2] * sp5C[2]; + sp8C[1] += 90.0f; + if( func_80329210(this, sp8C) + && (sp8C[1] < (local->unk30[1] + 0x12C)) + && !func_8028F25C() + && (sp58 > 800.0f) + && (this->marker->unk14_21) + && (func_8028EE84() != BSWATERGROUP_2_UNDERWATER) + && func_802CC57C(this, sp8C) + ) { + sp8C[0] = 0.0f; + sp68[0] = this->position[0]; + sp68[1] = this->position[1]; + sp68[2] = this->position[2]; + sp68[0] = 0.0f; + if (ml_vec3f_distance(sp8C, sp68) < 800.0f) { + spBC = 3; + } + } + } + if ((this->state == 2) && (local->unk3A == 0)) { + spBC = 1; + } + if (this->state == 3) { + if (func_8028F25C() || (func_8028EE84() == BSWATERGROUP_2_UNDERWATER)) { + func_802CC640(this, 4); + } else { + if (local->unk3A == 0) { + local->unk38++; + if (local->unk38 == 3) { + spBC = 4; + local->unk38 = 0; + } else { + spBC = 1; + } + } else if ((local->unk3A == 2) || (local->unk4 < 0.5)) { + sp4C[0] = spC4[0]; + sp4C[1] = spC4[1]; + sp4C[2] = spC4[2]; + sp4C[1] += 50.0f; + func_802CC4A4(this, sp4C); + } + } + } + + if ((this->state == 5) || (this->state == 4)) { + this->position[1] += 50.0f * spB8; + this->yaw += 10.0f * spB8; + } + if (this->state == 6) { + if (func_8033567C(this->unk148) == 0x110) { + sp40[0] = this->position[0] - spC4[0]; + sp40[1] = this->position[1] - spC4[1]; + sp40[2] = this->position[2] - spC4[2]; + sp40[1] = 0.0f; + ml_vec3f_set_length(sp40, 200.0f * spB8); + this->position[0] = this->position[0] + sp40[0]; + this->position[1] = this->position[1] + sp40[1]; + this->position[2] = this->position[2] + sp40[2]; + this->position[1] += local->unk36 * spB8; + local->unk36 -= 3000.0f * spB8; + if (this->position[1] < func_80309724(this->position)) { + this->position[1] = func_80309724(this->position); + func_80335924(this->unk148, 0x111, 0.1f, 1.0f); + func_80335A8C(this->unk148, 2); + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200); + timed_playSfx(0.1f, SFX_66_BIRD_AUUGHH, 1.6f, 32000); + } + } else if (func_80335794(this->unk148) > 0) { + spBC = 7; + } + } + if (this->state == 7) { + local->unk2C += 0.5 * spB8; + if (local->unk2C >= 1.0f) { + spBC = 8; + } + } + if (spBC != 0) { + func_802CC640(this, spBC); + } + } + } +} diff --git a/src/core2/code_47BD0.c b/src/core2/code_47BD0.c new file mode 100644 index 00000000..e9996db1 --- /dev/null +++ b/src/core2/code_47BD0.c @@ -0,0 +1,532 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + f32 unk0[3]; + f32 unkC[3]; + f32 unk18[3]; + f32 unk24[3]; +}Struct_core2_47BD0_0; + +typedef struct{ + s32 unk0; + u8 unk4; + u8 unk5; + u8 unk6; + u8 unk7; + Struct_core2_47BD0_0 *unk8; + f32 unkC[3]; + f32 unk18; + f32 unk1C; + BKModelBin *unk20; + s32 unk24; +}ActorLocal_core2_47BD0; + +void func_802CF83C(Actor *this); +Actor *func_802CEBFC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +extern f32 D_803765E4; + +extern s32 D_8037DCBC; + +/* .data */ +extern ActorInfo D_80367310 = {0x217, ACTOR_34D_BEE_SWARM, 0x49E, + 1, NULL, + func_802CF83C, NULL, func_802CEBFC, + 0, 0, 1.0f, 0 +}; + +/* .rodata */ +extern f32 D_803765E0; + +/* .bss */ +extern s32 D_8037DCBC; + +/* .code */ +void func_802CEB60(Actor *this){ + ActorLocal_core2_47BD0 *local; + + local = (ActorLocal_core2_47BD0 *)&this->local; + if(this->unk16C_4){ + if(local->unk8 != NULL){ + local->unk8 = (Struct_core2_47BD0_0 *)defrag(local->unk8); + } + } +} + +void func_802CEBA8(Actor *this){ + ActorLocal_core2_47BD0 *local; + + local = (ActorLocal_core2_47BD0 *)&this->local; + this->unk100 = NULL; + + free(local->unk8); + local->unk8 = NULL; + + assetcache_release(local->unk20); + local->unk20 = NULL; + + D_8037DCBC = 0; +} + +#ifndef NONMATCHING //requires .rodata defined +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_47BD0/func_802CEBFC.s") +#else +Actor *func_802CEBFC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this; + ActorLocal_core2_47BD0 *local; + BKModelBin *phi_fp; + s32 phi_s2; + f32 sp8C[3]; + f32 sp80[3]; + Struct_core2_47BD0_0 *phi_s0; + + this = marker_getActor(marker); + local = (ActorLocal_core2_47BD0 *)&this->local; + phi_fp = func_80330B1C(marker); + for(phi_s2 = 0, phi_s0 = local->unk8; phi_s2 < local->unk0; phi_s2++){ + sp80[0] = 0.0f; + sp80[1] = phi_s0->unk28 - 90.0f; + sp80[2] = 0.0f; + + sp8C[0] = this->position[0] + phi_s0->unk0[0]; + sp8C[1] = this->position[1] + phi_s0->unk0[1]; + sp8C[2] = this->position[2] + phi_s0->unk0[2]; + + set_model_render_mode(2); + func_8033A410(0xFF); + func_803391A4(gfx, mtx, sp8C, sp80, 0.25f, NULL, phi_fp); + local->unk5 |= func_8033A170(); + if(phi_s2 < 10){ + sp8C[1] = local->unk18 + 6.0f; + func_8033A410(0xC0); + set_model_render_mode(2); + func_803391A4(gfx, mtx, sp8C, sp80, 0.1f, NULL, local->unk20); + local->unk5 |= func_8033A170(); + } + phi_s0++; + } + return this; +} +#endif + +void func_802CEDE4(f32 arg0[3], f32 p_ctrl[3], f32 arg2, f32 *arg3, f32 arg4, f32 arg5){ + s32 phi_s1; + + phi_s1 = 0; + do{ + p_ctrl[0] = randf2(-arg2, arg2); + p_ctrl[1] = randf2(-arg2, arg2); + p_ctrl[2] = randf2(-arg2, arg2); + phi_s1++; + }while(phi_s1 < 10 && ml_vec3f_distance(arg0, p_ctrl) < arg2); + *arg3 = randf2(arg4, arg5); +} + +void func_802CEEA4(Actor *this, Struct_core2_47BD0_0 *arg1) { + u32 temp_t6; + s32 phi_t0; + s32 phi_t1; + s32 phi_v0; + s32 phi_v0_2; + + phi_t0 = (this->state == 4) ? 50 + : (this->state == 3) ? 100 + : 150; + phi_t1 = (this->state == 1) ? 100 : 200; + phi_v0 = (this->state == 1) ? 200 : 400; + func_802CEDE4(arg1->unk0, arg1->unk18, (f32) phi_t0, &arg1->unk24[2], (f32) phi_t1, (f32) phi_v0); +} + + +void func_802CEF54(Actor *this, f32 arg1[3], f32 arg2){ + f32 sp34[3]; + s32 phi_v1; + s32 phi_v0; + + sp34[0] = this->position[0] - arg1[0]; + sp34[1] = this->position[1] - arg1[1]; + sp34[2] = this->position[2] - arg1[2]; + + phi_v1 = (this->state == 5) ? 200 : 50; + phi_v0 = (this->state == 5) ? 200 : 100; + func_802CEDE4(sp34, this->unk1C, arg2, &this->unk28, (f32) phi_v1, (f32) phi_v0); + this->unk1C[0] = this->unk1C[0] + arg1[0]; + this->unk1C[1] = this->unk1C[1] + arg1[1]; + this->unk1C[2] = this->unk1C[2] + arg1[2]; +} + +void func_802CF040(Actor *this) { + Struct_core2_47BD0_0 *phi_s0; + s32 phi_s1; + ActorLocal_core2_47BD0 *local; + + local = (ActorLocal_core2_47BD0 *) &this->local; + local->unk8 = (Struct_core2_47BD0_0 *) malloc(local->unk0 * sizeof(Struct_core2_47BD0_0)); + + for(phi_s1 = 0, phi_s0 = local->unk8; phi_s1 < local->unk0; phi_s1++){ + phi_s0->unk0[0] = randf2(-150.0f, 150.0f); + phi_s0->unk0[1] = randf2(-150.0f, 150.0f); + phi_s0->unk0[2] = randf2(-150.0f, 150.0f); + phi_s0->unkC[0] = phi_s0->unkC[1] = phi_s0->unkC[2] = 0.0f; + phi_s0->unk24[0] = phi_s0->unk24[1] = phi_s0->unk24[2] = 0.0f; + func_802CEEA4(this, phi_s0); + phi_s0++; + } + this->velocity[0] = 0.0f; + this->velocity[1] = 1.0f; + this->velocity[2] = 0.0f; + func_802CEF54(this, local->unkC, 100.0f); +} + +void func_802CF174(f32 arg0[3], f32 arg1, f32 arg2) { + f32 temp_f0; + + if (arg1 != 0.0f) { + temp_f0 = arg2 / arg1; + arg0[0] *= temp_f0; + arg0[1] *= temp_f0; + arg0[2] *= temp_f0; + } +} + +void func_802CF1C8(f32 arg0[3], f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4, f32 *arg5, f32 arg6[3]) { + f32 sp4C; + f32 temp_f12; + f32 sp3C[3]; + + + sp4C = time_getDelta(); + arg6[0] = arg0[0] - arg1[0]; + arg6[1] = arg0[1] - arg1[1]; + arg6[2] = arg0[2] - arg1[2]; + temp_f12 = gu_sqrtf(arg6[0]*arg6[0] + arg6[1]*arg6[1] + arg6[2]*arg6[2]); + if (temp_f12 < (2 * arg4)) { + func_802CF174(arg6, temp_f12, 8 * arg3); + } else { + func_802CF174(arg6, temp_f12, 2 * arg3); + } + arg1[0] += (arg2[0] * sp4C) + (arg6[0] * sp4C * sp4C); + arg1[1] += (arg2[1] * sp4C) + (arg6[1] * sp4C * sp4C); + arg1[2] += (arg2[2] * sp4C) + (arg6[2] * sp4C * sp4C); + + arg2[0] += arg6[0] * sp4C; + arg2[1] += arg6[1] * sp4C; + arg2[2] += arg6[2] * sp4C; + temp_f12 = gu_sqrtf(arg2[0]*arg2[0] + arg2[1]*arg2[1] + arg2[2]*arg2[2]); + if (arg3 < temp_f12) { + func_802CF174(arg2, temp_f12, arg3); + } + if (arg5 != 0) { + sp3C[0] = sp3C[1] = sp3C[2] = 0.0f; + func_8025727C(arg2[0], arg2[1], arg2[2], sp3C[0], sp3C[1], sp3C[2], arg5, arg5 + 1); + } +} + +void func_802CF434(Actor *this) { + ActorLocal_core2_47BD0 *local; + Struct_core2_47BD0_0 *phi_s0; + s32 phi_s2; + f32 *temp_s1; + s32 temp_s2; + f32 sp58; + + local = (ActorLocal_core2_47BD0 *) &this->local; + for(phi_s2 = 0, phi_s0 = local->unk8; phi_s2 < local->unk0; phi_s2++){ + func_802CF1C8(phi_s0->unk18, phi_s0->unk0, phi_s0->unkC, phi_s0->unk24[2], 150.0f, phi_s0->unk24, &sp58); + if (ml_vec3f_distance(phi_s0->unk0, phi_s0->unk18) < 50.0f) { + func_802CEEA4(this, phi_s0); + } + phi_s0++; + } +} + +void func_802CF518(Actor *this) { + if( func_803292E0(this) + && func_80329530(this, 900) + && func_8028EE84() == BSWATERGROUP_0_NONE + && player_getTransformation() != TRANSFORM_6_BEE + ) { + func_80328A84(this, 3); + } +} + +void func_802CF57C(Actor *this) { + ActorLocal_core2_47BD0 *local; + + local = (ActorLocal_core2_47BD0 *) &this->local; + if (!func_803292E0(this) || !func_80329530(this, 900) || func_8028EE84() != BSWATERGROUP_0_NONE) { + func_80328A84(this, 5); + func_802CEF54(this, local->unkC, 100.0f); + } +} + +bool func_802CF5E4(Actor *this){ + ActorLocal_core2_47BD0 *local; + ActorMarker *other; + bool out = 1; + + local = (ActorLocal_core2_47BD0 *) &this->local; + out = (this->unk100 != NULL) ? out = local->unk24 != this->unk100->unk5C + : 1; + return out; +} + +void func_802CF610(Actor *this, ParticleEmitter *p_ctrl, f32 position[3]) { + func_8030E6A4(SFX_66_BIRD_AUUGHH, randf2(1.75f, D_803765E4), 15000); + // func_8030E6A4(SFX_66_BIRD_AUUGHH, randf2(1.75f, 1.85f), 15000); + particleEmitter_setPosition(p_ctrl, position); + func_802EFA70(p_ctrl, 2); + func_802EF9F8(p_ctrl, 0.5f); + func_802EFA18(p_ctrl, 3); + func_802EFA20(p_ctrl, 0.8f, 1.0f); + func_802EF9EC(p_ctrl, 0x1F, 10000); + particleEmitter_setSpawnIntervalRange(p_ctrl, 0.0f, 0.01f); + func_802EFEC0(p_ctrl, 2.0f, 2.5f); + func_802EFA5C(p_ctrl, 0.0f, 0.65f); + particleEmitter_setParticleAccelerationRange(p_ctrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); + particleEmitter_setModel(p_ctrl,this->marker->modelId); + func_802EFB70(p_ctrl, 0.25f, 0.25f); + func_802EFE24(p_ctrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(p_ctrl, -300.0f, 750.0f, -300.0f, 300.0f, 900.0f, 300.0f); + particleEmitter_emitN(p_ctrl, 1); +} + +void func_802CF7CC(Actor *this) { + if (D_8037DCBC == 0) { + this->unk44_31 = func_8030D90C(); + sfxsource_setSfxId(this->unk44_31, 0x3FA); + func_8030DD14(this->unk44_31, 2); + func_8030DD90(this->unk44_31, 2); + D_8037DCBC = 1; + } +} + +#ifndef NONMATCHING +void func_802CF83C(Actor *this); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_47BD0/func_802CF83C.s") +#else +extern f64 D_803765E8; +extern f64 D_80376620; +extern f64 D_80376628; +extern f64 D_80376630; +extern s32 D_8037DCBC; + +void func_802CF83C(Actor *this) { + f32 spB4[3]; + f32 spB0; + f32 spAC; + f32 spA0[3]; + f32 sp94[3]; + f32 sp88[3]; + f32 sp7C[3]; + s32 sp78; + f32 *sp64; + f32 *sp44; + f32 *sp40; + Actor *beehive; + ActorMarker *temp_v0_3; + f32 *temp_a0; + f32 temp_f0; + f32 temp_f14; + f32 temp_f14_2; + f32 temp_f16; + f32 temp_f16_2; + f32 temp_f18; + f32 temp_f18_2; + f32 temp_f8; + f64 temp_f2; + s16 temp_t7; + u32 temp_t0; + u32 temp_t1; + u32 temp_t2; + u32 temp_t3; + u8 temp_a0_2; + ActorLocal_core2_47BD0 *local; + u32 phi_a1; + f64 phi_f2; + f64 phi_f0; + + local = (ActorLocal_core2_47BD0 *)&this->local; + spAC = time_getDelta(); + sp78 = 0; + if (!this->initialized) { + this->initialized = TRUE; + beehive = func_80326D68(this->position, ACTOR_12_BEEHIVE, -1, &spB0); + if (beehive != NULL) { + this->unk100 = beehive->marker; + } else { + this->unk100 = NULL; + } + if (spB0 > 500.0f) { + this->unk100 = NULL; + } + sp78 = 1; + local->unk18 = this->position[1]; + local->unkC[0] = ((this->unk100) ? beehive->position : this->position)[0];\ + local->unkC[1] = ((this->unk100) ? beehive->position : this->position)[1];\ + local->unkC[2] = ((this->unk100) ? beehive->position : this->position)[2]; + + local->unkC[1] += 250.0f; + local->unk0 = this->unkF4_8; + this->position[0] = local->unkC[0]; + this->position[1] = local->unkC[1]; + this->position[2] = local->unkC[2]; + sp94[0] = this->position[0]; sp94[1] = this->position[1]; sp94[2] = this->position[2]; + sp94[1] += 50.0f; + sp88[0] = this->position[0]; sp88[1] = this->position[1]; sp88[2] = this->position[2]; + sp88[1] -= 500.0f; + if (func_80309B48(sp94, sp88, sp7C, 0x5E0000)) { + local->unk18 = sp88[1]; + } + } + + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + func_803300D8(this->marker, func_802CEBA8); + actor_collisionOff(this); + local->unk20 = assetcache_get(0x3BF); + if (sp78 == 0) { + beehive = func_80326D68(this->position, ACTOR_12_BEEHIVE, -1, &spB0); + if (beehive != NULL) { + this->unk100 = beehive->marker; + } else { + this->unk100 = NULL; + } + if (spB0 > 500.0f) { + this->unk100 = NULL; + } + } + temp_v0_3 = this->unk100; + if (temp_v0_3 != NULL) { + local->unk24 = temp_v0_3->unk5C; + } else { + local->unk24 = NULL; + } + local->unk5 = 1; + if (this->unk100 != NULL) { + func_80320004(BKPROG_D_BEEHIVE_TEXT, TRUE); + } + phi_a1 = 2U; + if (this->unk100 != NULL) { + phi_a1 = 1U; + } + func_80328A84(this, phi_a1); + this->unk60 = 0.0f; + func_802CF040(this); + this->unk38_0 = func_803203FC(1) | func_803203FC(0x1F); + } + + if (actor_playerIsWithinDist(this, 0xFA0)) { + if (!actor_playerIsWithinDist(this, 0x5DC) == 0) { + if (this->unk44_31 != 0) { + func_8030DA44(this->unk44_31); + this->unk44_31 = 0; + D_8037DCBC = 0; + } + } + if (map_get() == MAP_27_FP_FREEZEEZY_PEAK) { + if (func_8038BFA0()) { + this->unk58_0 = FALSE; + return; + } + this->unk58_0 = TRUE; + } +block_40: + sp94[0] = this->position[0]; + sp94[1] = this->position[1]; + sp94[2] = this->position[2]; + sp88[0] = (this->velocity[0] * spAC) + this->position[0]; + sp88[1] = (this->velocity[1] * spAC) + this->position[1]; + sp88[2] = (this->velocity[2] * spAC) + this->position[2]; + if (this->state != 7) { + if (func_80309DBC(sp94, sp88, 75.0f, sp7C, 3, 0)) { + ml_vec3f_normalize(&sp7C); + temp_f0 = (this->velocity[0]*sp7C[0] + this->velocity[1]*sp7C[1] + this->velocity[2]*sp7C[2]) * -1.5; + this->velocity[0] += (sp7C[0] * temp_f0); + this->velocity[1] += (sp7C[1] * temp_f0); + this->velocity[2] += (sp7C[2] * temp_f0); + this->unk1C[0] = sp7C[0] * D_803765E8 + this->position[0]; + this->unk1C[1] = sp7C[1] * D_803765E8 + this->position[1]; + this->unk1C[2] = sp7C[2] * D_803765E8 + this->position[2]; + if (this->state != 6) { + local->unk6 = this->state; + func_80328A84(this, 6); + } + } + func_802CF1C8(this->unk1C, this->position, this->velocity, this->unk28, 100.0f, 0, &spA0); + } + if (map_get() == MAP_78_GL_RBB_AND_MMM_PUZZLE) { + if (this->unk38_31++ == 0x1E) { + this->unk38_31 = 0; + sp88[0] = this->position[0]; + sp88[1] = this->position[1]; + sp88[2] = this->position[2]; + sp94[1] += 1000.0f; + sp88[1] -= 1000.0f; + if (func_80309B48(sp94, sp88, sp7C, 0xF800FF0F)) { + local->unk1C = sp88[1]; + } else { + local->unk1C = -16000.0f; + } + if ((this->position[1] - 100.0f) < local->unk1C) { + if (this->state != 7) { + local->unk7 = this->state; + local->unk4 = local->unk0; + func_80328A84(this, 7); + } + } + } + } + func_8028E9C4(5, &spB4); + switch(this->state){ + case 1: + if( !func_8031FF1C(0x8F) + && func_803296B8(this, 0xFA, 0x12C) + && ((func_8028ECAC() == 0) || (func_8028ECAC() == BSGROUP_8_TROT)) + && (player_getTransformation() == TRANSFORM_1_BANJO) + && func_80311480(0xDA6, 0, NULL, NULL, NULL, NULL) + ) { + func_80320004(0x8F, TRUE); + } + if (func_802CF5E4(this)) { + func_80328A84(this, 2); + } + if (ml_vec3f_distance(this->position, this->unk1C) < 50.0f) { + func_802CEF54(this, local->unkC, 100.0f); + } + break; + } + if (local->unk5) { + func_802CF434(this); + } + local->unk5 = FALSE; + + if( (local->unk0 > 0) + && func_80329530(this, 0x5DC) && !this->unk38_0 + ) { + if (!this->unk44_31) { + func_802CF7CC(this); + } + if (this->unk44_31) { + if ((this->state == 3) || (this->state == 4)) { + phi_f2 = 0.0; + } else { + phi_f2 = D_80376620; + } + if ((this->state == 3) || (this->state == 4)) { + phi_f0 = D_80376628; + } else { + phi_f0 = D_80376630; + } + func_8030DBFC(this->unk44_31, phi_f2, phi_f0, 0.05f); + func_8030DEB4(this->unk44_31, 500.0f, 1500.0f); + func_8030DF68(this->unk44_31, this->position); + func_8030E2C4(this->unk44_31); + sfxsource_setSampleRate(this->unk44_31, ((gu_sqrtf(this->velocity[0]*this->velocity[0] + this->velocity[1]*this->velocity[1] + this->velocity[2]*this->velocity[2])/ this->unk28) * 8000.0f) + 2000.0f); + } + } + } +} +#endif diff --git a/src/core2/code_47C0.c b/src/core2/code_47C0.c new file mode 100644 index 00000000..977fa43d --- /dev/null +++ b/src/core2/code_47C0.c @@ -0,0 +1,1069 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" +#include "SnS.h" + +extern void func_803012F8(void); +extern f32 func_8024DDD8(f32[3], f32); +extern f32 ml_vec3f_distance_squared(f32 arg0[3], f32 arg1[3]); +extern void func_8028BA00(s32); +extern void func_802C418C(void); +extern void func_802A6388(f32); +extern f32 chwadingboots_802D6E4C(Actor *); +extern void func_80294AE8(f32); +extern f32 chtrainers_802CA748(Actor *); +extern int func_80259254(f32 vec[3], f32 x, f32 z, f32 val); +extern void func_802EE354(Actor *, s32, s32, s32, f32, f32, f32, f32 arg8[3], s32, f32 arg10[2]); +extern void func_8035644C(s32); +extern void func_8035646C(s32 arg0); +extern void func_80291634(ActorMarker *, ActorMarker *); +extern void func_80291610(ActorMarker *, ActorMarker *); +extern void func_80291AAC(void); +extern void func_8028D7B8(s32 arg0, ActorMarker *arg1, s32 arg2); +extern void func_802EE6CC(f32[3], s32, s32[4], s32, f32, f32, s32,s32,s32); +extern void func_80320ED8(ActorMarker *, f32, s32); + + +typedef struct +{ + f32 unk0; + f32 unk1; + f32 unk2; +} +tmp_struct_type; + +void func_8028D638(s32 arg0, s32 arg1); + +/* .data */ +s32 D_80363630[2] = {0x20, 0x1C}; +s32 D_80363638[2] = {0x1C, 0x16}; +s32 D_80363640[2] = {0x20, 0x01}; +s32 D_80363648[2] = {0x1C, 0x18}; +s32 D_80363650[2] = {0x20, 0x21}; +s32 D_80363658[2] = {0x20, 0x28}; +tmp_struct_type D_80363660 = {350.0f, 0.0f, 600.0f}; +u8 D_8036366C[] = { + 0xff, 0xff, 0x00, + 0xff, 0x00, 0x00, + 0x00, 0xff, 0x00, + 0x00, 0x00, 0xff, + 0xff, 0x00, 0xff, + 0x00, 0xff, 0xff, + 0x00, 0x00 +}; + +s32 D_80363680[4] = {0xff, 0xff, 0xff, 0xc8}; + +/* .bss */ +ActorMarker *playerMarker; +s32 D_8037BF74; +s32 carriedObject_actorID; +s32 D_8037BF7C; +s32 D_8037BF80[2]; +s32 D_8037BF88; +ActorMarker *D_8037BF8C; +u8 D_8037BF90; + +/* .code */ +s32 *func_8028B750(void){ + if(D_8037BF80[0]){ + return D_8037BF80; + } + else{ + switch(player_getTransformation()){ + case TRANSFORM_2_TERMITE: //8028B7A0 + return D_80363638; + break; + + case TRANSFORM_3_PUMPKIN: //8028B7AC + return D_80363640; + break; + + case TRANSFORM_4_WALRUS: //8028B7B8 + return D_80363650; + break; + + case TRANSFORM_5_CROC: //8028B7C4 + return D_80363648; + break; + + case TRANSFORM_6_BEE: //8028B7D0: + return D_80363658; + break; + + case TRANSFORM_1_BANJO: //8028B7DC + default: + return D_80363630; + break; + } + } +} + +void func_8028B7F4(void){ + yaw_setIdeal(func_8029B41C()); + func_802991A8(1); + func_8029957C(3); + func_802978DC(2); + func_80297970(0.0f); + func_8029151C(0xC); +} + +void func_8028B848(void){ + s32 s0 = 0; + if(map_get() == MAP_69_GL_MM_LOBBY){ + s0 = 0xf57; + } + else if(map_get() == MAP_2_MM_MUMBOS_MOUNTAIN){ + s0 = 0xb45; + } + + if(s0){ + if(player_getTransformation() == TRANSFORM_1_BANJO){ + func_8028B7F4(); + } + func_80311480(s0, 0x2A, NULL, NULL, NULL, 0); + } +} + +void func_8028B8DC(void){ + func_8028F918(1); + D_8037BF88 = 1; +} + +void func_8028B904(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ + f32 sp1C[3]; + + sp1C[0] = reinterpret_cast(s16, arg0); + sp1C[1] = reinterpret_cast(s16, arg1); + sp1C[2] = reinterpret_cast(s16, arg2); + + func_80296CC0(&sp1C); + func_80296CB4(arg3); + if(miscflag_isTrue(7)){ + func_8029CDA0(); + } + else{ + if(bs_checkInterrupt(9) == 1){ + func_8029CDA0(); + } + + } +} + + +void func_8028B9A8(s32 arg0){ + s16 *tmp_v0; + s32 ideal_yaw[3]; + + tmp_v0 = func_803049CC(0x1F6, 0); + func_80304D4C(tmp_v0, &ideal_yaw); + func_802CA1CC(arg0); + func_8032811C(0x47, &ideal_yaw, 0); + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + +} + +void func_8028BA00(s32 arg0){ + func_802C3C88(func_8028B9A8, arg0); + if(arg0); +} + + +void func_8028BA2C(s32 arg0) { + if (func_802FADD4(0x1B) == 0) { + item_inc(ITEM_C_NOTE); + } else { + func_803463F4(ITEM_C_NOTE, 1); + } + if (item_getCount(ITEM_C_NOTE) < 100) { + func_8025A6EC(COMUSIC_9_NOTE_COLLECTED, 0x3E80); + timedFunc_set_1(0.75f, func_8035644C, 3); + } + func_802F379C(arg0 + 4); +} + +void func_8028BAB0(enum jiggy_e jiggy_id, s32 arg1, s32 arg2, s32 arg3){ + if(jiggyscore_isCollected(jiggy_id)) + return; + + if(mapSpecificFlags_get(arg1) && mapSpecificFlags_get(arg2)){ + mapSpecificFlags_set(arg3, 1); + } + mapSpecificFlags_set(arg1, 1); + func_8030E6D4(SFX_90_SWITCH_PRESS); +} + +void func_8028BB1C(s32 arg0, u32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6){ + u32 sp24; + if(arg0 != 1) + return; + + if(func_8028ECAC() == 1) + return; + + if(arg1 & 0x400000){ + sp24 = arg1 + 0xFFC00000; + if(!func_803203FC(sp24)){ + func_803204E4(sp24, 1); + func_8030E6D4(SFX_90_SWITCH_PRESS); + func_803204E4(0xBF, 1); + func_802D6264(1.0f, arg2, arg3, arg4, arg5, arg6); + } + } + else{//L8028BBB8 + if(!func_8031FF1C(arg1)){ + func_80320004(arg1, 1); + func_8030E6D4(SFX_90_SWITCH_PRESS); + func_803204E4(0xBF, 1); + func_802D6264(1.0f, arg2, arg3, arg4, arg5, arg6); + } + } +} + +int func_8028BC20(ActorMarker *marker){ + return D_8037BF90 == 1 && player_getActiveHitbox(marker) == HITBOX_5_PECK; +} + +int func_8028BC60(void){ + return D_8037BF90 == 1 && player_getActiveHitbox(NULL) == HITBOX_5_PECK; +} + +void func_8028BCA0(Prop *prop){ + s32 plyr_collision_type; + s32 obj_collision_type; + s32 plyr_hitbox_type; + int i; + ActorMarker *marker; //0xbc + Actor *actor; //0xb8 + f32 spAC[3]; + f32 spA0[3]; + s32 sp9C; + s32 sp98; + volatile s32 sp94; + s32 sp88[3]; //0 + s32 tmp2; + s32 tmp3; + s32 sp7C; //+4 + s32 sp78; //+4 + s32 tmp_v0_2; + f32 tmp_f0; + tmp_struct_type sp64; + s32 tmp1; + + if(*((u32*)(((u32)prop) + 8)) & 1){ + plyr_collision_type = 0; + obj_collision_type = 0; + marker = prop->actorProp.marker; + actor = NULL; + if(marker->unk3E_0){ + actor = marker_getActor(marker); + if(actor->despawn_flag) + return; + + if(actor->unk10_0 && func_802C9C14(actor)) + return; + + }//L8028BD1C + plyr_hitbox_type = player_getActiveHitbox(marker); + if(func_8033D410(playerMarker, marker)) + return; + + switch(marker->unk14_20){ + case 0x125: //L8028BE88 + case 0x126: //L8028BE88 + obj_collision_type = 1; + break; + + case 0x97: //L8028BE94 + plyr_collision_type = 1; + obj_collision_type = 1; + break; + + case 0xBA: //L8028BEA8 + if( marker->unk40_31 == 1 + || marker->unk40_31 == 2 + || marker->unk40_31 == 3 + || marker->unk40_31 == 4 + || marker->unk40_31 == 5 + || marker->unk40_31 == 6 + ){ + obj_collision_type = 1; + } + break; + + case 0xB5: //L8028BEF4 + if(func_8028BC20(marker) != HITBOX_0_NONE) + return; + if(func_802D8E68(prop)){ + marker_despawn(marker); + } + break; + + case 0x1E5: //L8028BF24 + if(func_8028BC20(marker)) + return; + + if(func_802D8EDC(prop)){ + marker_despawn(marker); + } + break; + + case 0x9E: //L8028BF54 + case 0xA1: //L8028BF54 + if(plyr_hitbox_type == HITBOX_1_BEAK_BUSTER){ + func_802A02B4(1); + obj_collision_type = 2; + } + break; + + case 0x28: //L8028BF74 + if( plyr_hitbox_type == HITBOX_6_WONDERWING){ + func_8030E484(SFX_20_METAL_CLANK_1); + } + else{ + func_8030E6D4(SFX_65_METALLIC_SCRATCH); + } + + if(plyr_hitbox_type != HITBOX_6_WONDERWING){ + plyr_collision_type = 2; + } + break; + + case 0xF5: //L8028BFB0 + if(plyr_hitbox_type == HITBOX_1_BEAK_BUSTER) + func_8028BAB0(JIGGY_20_BGS_ELEVATED_WALKWAY, 1, 3, 7); + break; + + case 0xFD: //L8028BFD4 + if(plyr_hitbox_type == HITBOX_1_BEAK_BUSTER) + func_8028BAB0(JIGGY_25_BGS_MAZE, 0xa, 0xc, 8); + break; + + case 0xEC: //L8028BFF8 + if(plyr_hitbox_type == HITBOX_1_BEAK_BUSTER){ + mapSpecificFlags_set(3, 1); + func_8030E6D4(SFX_90_SWITCH_PRESS); + } + break; + + case MARKER_F2_HONEYCOMB_SWITCH: //L8028C01C + if(plyr_hitbox_type == HITBOX_1_BEAK_BUSTER){ + if(!mapSpecificFlags_get(0xD)){ + mapSpecificFlags_set(0xD, 1); + func_8030E6D4(SFX_90_SWITCH_PRESS); + func_802BAFE4(0x14); + timedFunc_set_1(1.5f, func_8028BA00, 0xB); + } + } + break; + + case 0x15F: //L8028C070 + if(plyr_hitbox_type == HITBOX_1_BEAK_BUSTER){ + if(!mapSpecificFlags_get(0)){ + mapSpecificFlags_set(0,1); + func_8030E6D4(SFX_90_SWITCH_PRESS); + func_802BAFE4(0x7E); + timedFunc_set_1(1.5f, func_8028BA00, 0xf); + } + } + break; + + case MARKER_F1_GV_STAR_SWITCH: //L8028C0C8 + if(func_8028ECAC() == 1) + return; + if(!mapSpecificFlags_get(5)){ + mapSpecificFlags_set(5, 1); + func_8030E6D4(SFX_90_SWITCH_PRESS); + } + break; + + case 0x231: //L8028C104 + case 0x244: //L8028C104 + { + + if(func_8028ECAC() == 1) + return; + player_getPosition(spAC); + spAC[1] += 40.0f; + if(func_802458E0(spAC, actor, 0x87) == 0) + return; + func_803204E4(0x1E, 1); + if(func_8031FF1C(((actor->unkF4_8 - 1) ^ 1) + 0x49)){ + actor->unk10_12 = 2; + } + else{ + actor->unk10_12 = 1; + } + } + break; + + case MARKER_FE_MMM_CLOCK_SWITCH: //L8028C1A4 + if(plyr_hitbox_type == HITBOX_1_BEAK_BUSTER){ + if(func_8028ECAC() == 1) + return; + if(!mapSpecificFlags_get(0)){ + mapSpecificFlags_set(0,1); + func_8030E6D4(SFX_90_SWITCH_PRESS); + } + } + break; + + case MARKER_23F_LAIR_FLIGHT_PAD_SWITCH: //L8028C1EC + if(plyr_hitbox_type == HITBOX_1_BEAK_BUSTER){ + if(func_8028ECAC() == 1) + return; + if(!mapSpecificFlags_get(0)){ + mapSpecificFlags_set(0,1); + func_8030E6D4(SFX_90_SWITCH_PRESS); + } + } + break; + + case 0x110: //L8028C238 + if(plyr_hitbox_type == HITBOX_1_BEAK_BUSTER){ + if(func_8028ECAC() == 1) + return; + if(!mapSpecificFlags_get(0)){ + mapSpecificFlags_set(0, 1); + func_8030E6D4(SFX_90_SWITCH_PRESS); + } + } + break; + + case 0x113: //L8028C284 + if(plyr_hitbox_type == HITBOX_1_BEAK_BUSTER){ + if(func_8028ECAC() == 1) + return; + if(!mapSpecificFlags_get(1)){ + mapSpecificFlags_set(1,1); + func_8030E6D4(SFX_90_SWITCH_PRESS); + } + } + break; + + case 0x115: //L8028C2D0 + if(plyr_hitbox_type == HITBOX_1_BEAK_BUSTER){ + if(func_8028ECAC() == 1) + return; + if(!mapSpecificFlags_get(2)){ + mapSpecificFlags_set(2,1); + func_8030E6D4(SFX_90_SWITCH_PRESS); + } + } + break; + + case 0x241: //L8028C31C + func_8028BB1C(plyr_hitbox_type, 0xC6, 0x6E, 0x81, 0x2C, 0xA, 0xC7); + break; + + case MARKER_23C_GV_SNS_SWITCH: //L8028C350 + func_8028BB1C(plyr_hitbox_type, 0xA3, 0x92, 0x7F, 0x1A, 0xA, 0xA4); + break; + + case MARKER_161_GV_WITCH_SWITCH: //L8028C384 + func_8028BB1C(plyr_hitbox_type, 0x4000BE, 0x6E, 0x7D, 0x19, 0x14, 0xA0); + break; + + case MARKER_162_BGS_WITCH_SWITCH: //L8028C3BC + func_8028BB1C(plyr_hitbox_type, 0x4000BD, 0x71, 0x7C, 0x18, 0x14, 0x9F); + break; + case MARKER_166_CC_WITCH_SWITCH: //L8028C3F4 + func_8028BB1C(plyr_hitbox_type, 0x4000BC, 0x6A, 0x7A, 0x17, 0x14, 0x9A); + break; + + case MARKER_22B_FP_WITCH_SWITCH: //L8028C42C + func_8028BB1C(plyr_hitbox_type, 0x4000BB, 0x6F, 0x3A, 0x13, 0x15, 0x47); + break; + + case MARKER_22A_CCW_WITCH_SWITCH: //L8028C464 + func_8028BB1C(plyr_hitbox_type, 0x4000BA, 0x79, 0x39, 0x12, 0x15, 0x46); + break; + + case MARKER_103_MM_WITCH_SWITCH: //L8028C49C + func_8028BB1C(plyr_hitbox_type, 0x4000B6, 0x69, 0x26, 1, 4, 0x18); + break; + + case MARKER_104_MMM_WITCH_SWITCH: //L8028C4D4 + func_8028BB1C(plyr_hitbox_type, 0x4000B7, 0x6F, 0x27, 2, 0x14, 0x19); + break; + + case MARKER_105_TTC_WITCH_SWITCH: //L8028C50C + func_8028BB1C(plyr_hitbox_type, 0x4000B8, 0x6D, 0x28, 3, 0x14, 0x1A); + break; + + case MARKER_106_RBB_WITCH_SWITCH: //L8028C544 + func_8028BB1C(plyr_hitbox_type, 0x4000B9, 0x76, 0x29, 4, 0xe, 0x1C); + break; + + case MARKER_11B_WATER_LEVEL_SWITCH_1: //L8028C57C + func_8028BB1C(plyr_hitbox_type, 0x22, 0x77, 0x2D, 5, 0xA, 0x23); + break; + + case MARKER_11C_WATER_LEVEL_SWITCH_2: //L8028C5B0 + func_8028BB1C(plyr_hitbox_type, 0x24, 0x77, 0x2E, 6, 0xA, 0x25); + break; + + case MARKER_11D_WATER_LEVEL_SWITCH_3: //L8028C5E4 + func_8028BB1C(plyr_hitbox_type, 0x26, 0x76, 0x2F, 0x7, 0xA, 0x27); + break; + + case 0x232: //L8028C618 + func_8028BB1C(plyr_hitbox_type, 0x53, 0x6b, 0x3b, 0x14, 0x12, 0x54); + break; + + case MARKER_F3_GV_KAZOOIE_TARGET: //L8028C64C + if(plyr_hitbox_type == HITBOX_3_BEAK_BOMB){ + mapSpecificFlags_set(6,1); + obj_collision_type = 1; + } + break; + + + case MARKER_52_JIGGY: //L8028C66C + { + if(func_8028BC20(marker)) + return; + + player_getPosition(spA0); + sp9C = func_802C8088(actor); + if( sp9C != JIGGY_2F_FP_XMAS_TREE + || (func_8028B2E8() && !(3600.0f < ml_vec3f_distance_squared(actor->position, spA0))) + ){ + jiggyscore_setCollected(sp9C, 1); + func_803463F4(ITEM_26_JIGGY_TOTAL, 1); + if(sp9C == JIGGY_20_BGS_ELEVATED_WALKWAY || sp9C == JIGGY_25_BGS_MAZE){ + func_802D6924(); + } + if(jiggyscore_total() < 3){ + func_8028B848(); + } + + if(func_8025AD7C(COMUSIC_30_5TH_JINJO_COLLECTED)){ + func_8028B8DC(); + } + + func_802C3F04(func_8028B904, reinterpret_cast(u32, prop->actorProp.x), reinterpret_cast(u32, prop->actorProp.y), reinterpret_cast(u32, prop->actorProp.z), sp9C); + marker_despawn(marker); + } + } + break; + + case MARKER_53_EMPTY_HONEYCOMB: //L8028C774 + { + + if(func_8028BC20(marker)) + return; + sp98 = func_802CA1C4(marker_getActor(marker)); + if(sp98 != HONEYCOMB_12_MMM_FLOORBOARD || player_getTransformation() == TRANSFORM_3_PUMPKIN) + { + honeycombscore_set(sp98, 1); + func_8025A6EC(COMUSIC_17_EMPTY_HONEYCOMB_COLLECTED, 28000); + timedFunc_set_1(2.0f, func_8035644C, 0xB); + item_inc(ITEM_13_EMPTY_HONEYCOMB); + if(!(item_getCount(ITEM_13_EMPTY_HONEYCOMB) < 6)){ + func_80314AC8(0); + } + func_802F36DC(&prop->actorProp.x); + marker_despawn(marker); + } + } + break; + + case 0x54: //L8028C820 + func_8025A6EC(COMUSIC_19_LOW_PITCH_FLUTES, 28000); + func_803012F8(); + func_802C3F04(func_802C418C, 0x4E, reinterpret_cast(u32, prop->actorProp.x), reinterpret_cast(u32, prop->actorProp.y), reinterpret_cast(u32, prop->actorProp.z)); + marker_despawn(marker); + break; + + case MARKER_55_HONEYCOMB: //L8028C86C + if(func_8028BC20(marker)) + return; + + if( map_get() == MAP_8E_GL_FURNACE_FUN + && func_803203FC(0) + && !func_8031FF1C(BKPROG_A6_FURNACE_FUN_COMPLETE) + ){ + func_80356540(BKPROG_A6_FURNACE_FUN_COMPLETE); + func_8030E6D4(SFX_126_AUDIENCE_BOOING); + } + + func_8025A6EC(COMUSIC_16_HONEYCOMB_COLLECTED, 28000); + timedFunc_set_1(0.75f, func_8035644C, 0xA); + item_inc(ITEM_14_HEALTH); + func_802F373C(&prop->actorProp.x); + marker_despawn(marker); + break; + + case MARKER_169_SNS_EGG: //L8028C908 + { //ONLY THIS CASE DOESN'T MATCH + switch (map_get()) + { + case MAP_1D_MMM_CELLAR: //L8028C95C + sns_set_item_and_update_payload(SNS_ITEM_EGG_CYAN, 0, 1); + break; + case MAP_61_CCW_WINTER_NABNUTS_HOUSE: //L8028C974 + sns_set_item_and_update_payload(SNS_ITEM_EGG_YELLOW, 0, 1); + break; + case MAP_2C_MMM_BATHROOM: //L8028C988 + sns_set_item_and_update_payload(SNS_ITEM_EGG_GREEN, 0, 1); + break; + case MAP_3F_RBB_CAPTAINS_CABIN: //L8028C99C + sns_set_item_and_update_payload(SNS_ITEM_EGG_RED, 0, 1); + break; + case MAP_92_GV_SNS_CHAMBER: //L8028C9B0 + sns_set_item_and_update_payload(SNS_ITEM_EGG_BLUE, 0, 1); + break; + case MAP_8F_TTC_SHARKFOOD_ISLAND: //L8028C9C4 + sns_set_item_and_update_payload(SNS_ITEM_EGG_PINK, 0, 1); + break; + } + func_8025A70C(COMUSIC_88_BIG_SNS_FANFARE); + FUNC_8030E624(SFX_114_BRICKWALL_BREAKING, 0.8f, 15000); + tmp_v0_2 = 3*(actor->unkF4_8 - 1); + + tmp_f0 = 0.9f;\ + sp64 = D_80363660; + //+C + sp78 = 0xA; + sp94 = 0xAA; + + for(sp7C = 0; sp7C < 4; sp7C++){ //L8028CA4C + + for(i = 0 ; i < 3; i++){ + sp88[i] = D_8036366C[tmp_v0_2 + i]; + } + func_802EE354(actor, 0x3ED, 0x23, sp78, 0.2f, tmp_f0, 3.0f, sp88, 0, &sp64); + + for(i = 0 ; i < 3; i++){ + sp88[i] = 0xFF; + } + func_802EE354(actor, 0x3ED, 0xe, sp78, 0.2f, tmp_f0, 3.0f, sp88, 0, &sp64); + + sp78 += 0x32; + tmp_f0 += -0.15; + if(tmp_f0 < 0.01){ + tmp_f0 = 0.01f; + } + + sp64.unk0 -= 50.0f; + sp64.unk2 += 260.0f; + sp94 -= 0x1e; + } + + tmp1 = sns_get_item_state(SNS_ITEM_EGG_YELLOW, 0) + sns_get_item_state(SNS_ITEM_EGG_RED, 0) + sns_get_item_state(SNS_ITEM_EGG_GREEN, 0) + + sns_get_item_state(SNS_ITEM_EGG_BLUE, 0) + sns_get_item_state(SNS_ITEM_EGG_PINK, 0) + sns_get_item_state(SNS_ITEM_EGG_CYAN, 0); + if(tmp1 < 3){ + func_80324DBC(2.5f, 0xDB2 + tmp1, 0x20, 0, 0, 0, 0); + } + + marker_despawn(marker); + } + break; + case MARKER_168_ICE_KEY: //L8028CC7C + sns_set_item_and_update_payload(SNS_ITEM_ICE_KEY, 0, 1); + func_8025A70C(COMUSIC_88_BIG_SNS_FANFARE); + func_80324DBC(2.5f, 0xDB5, 0x20, 0, 0, 0, 0); + marker_despawn(marker); + break; + + case MARKER_5F_MUSIC_NOTE: //L8028CCC8 + if(func_8028BC20(marker)) + return; + + func_8028BA2C(prop); + marker_despawn(marker); + break; + + case 0x60: //L8028CCF0 + if(func_8028BC20(marker)) + return; + if(collect_egg(prop)){ + marker_despawn(marker); + } + break; + + case 0x6B: //L8028CD20 + if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER){ + func_803463D4(ITEM_17_AIR, func_80301DBC(2)); + } + break; + + case MARKER_61_EXTRA_LIFE: //L8028CD50 + if(func_8028BC20(marker)) + return; + if( map_get() == MAP_8E_GL_FURNACE_FUN + && func_803203FC(0) + && !func_8031FF1C(BKPROG_A6_FURNACE_FUN_COMPLETE) + ){ + func_80356540(BKPROG_A7_NEAR_PUZZLE_PODIUM_TEXT); + func_8030E6D4(SFX_127_AUDIENCE_MIXED); + } + func_8025A6EC(COMUSIC_15_EXTRA_LIFE_COLLECTED, 0x7FFF); + timedFunc_set_1(1.5f, func_8035646C, 0xC); + func_802F3B3C(&prop->actorProp.x); + item_inc(ITEM_16_LIFE); + marker_despawn(marker); + break; + + + + case 0xD4: //L8028CDEC + case 0x242: //L8028CDEC + if(ability_isUnlocked(ABILITY_D_SHOCK_JUMP)){ + miscflag_set(MISC_FLAG_2_ON_SPRING_PAD); + }else{ + if(!func_80320454(0xC, 1)){ + func_80311480(0xA24, 4, 0, 0, 0, 0); + } + } + break; + + case 0x45: //L8028CE3C + case 0x240: //L8028CE3C + case 0x261: //L8028CE3C + if(ability_isUnlocked(ABILITY_9_FLY)){ + miscflag_set(MISC_FLAG_1_ON_FLIGHT_PAD); + } + else if(! func_80320454(0xD, 1)){ + func_80311480(0xA25, 4, 0, 0, 0, 0); + } + break; + + case MARKER_11_WADING_BOOTS: //L8028CE8C + if(func_8028BC20(marker)) + return; + if(_player_getTransformation() != TRANSFORM_1_BANJO) + return; + if(func_8028F170()) + return; + if(func_8028F25C()) + return; + if(chwadingboots_802D6E0C(actor) == 0) + return; + + miscflag_set(MISC_FLAG_E_TOUCHING_WADING_BOOTS); + func_802A6388(chwadingboots_802D6E4C(actor)); + bs_checkInterrupt(0x1B); + func_802C3F04(func_802C418C, 0x4E, reinterpret_cast(u32, prop->actorProp.x), reinterpret_cast(u32, prop->actorProp.y), reinterpret_cast(u32, prop->actorProp.z)); + chwadingboots_802D6E54(actor); + break; + + case MARKER_38_TURBO_TALON_TRAINERS: //L8028CF38 + if(func_8028BC20(marker)) + return; + + tmp1 = _player_getTransformation(); + if(tmp1 != TRANSFORM_1_BANJO && tmp1 != TRANSFORM_5_CROC) + return; + + if(func_8028F25C()) + return; + + if(func_8028F170()) + return; + + if(chtrainers_802CA708(actor) == 0) + return; + + miscflag_set(MISC_FLAG_10_TOUCHING_TURBO_TRAINERS); + func_80294AE8(chtrainers_802CA748(actor)); + bs_checkInterrupt(0x1A); + func_802C3F04(func_802C418C, 0x4E, reinterpret_cast(u32, prop->actorProp.x), reinterpret_cast(u32, prop->actorProp.y), reinterpret_cast(u32, prop->actorProp.z)); + chtrainers_802CA750(actor); + break; + + case 0x1AE: //L8028CFEC + switch(plyr_hitbox_type){ + case HITBOX_1_BEAK_BUSTER: + case HITBOX_2_BEAK_BARGE: + case HITBOX_5_PECK: + case HITBOX_6_WONDERWING: + obj_collision_type = 2; + break; + default: + plyr_collision_type = 2; + break; + } + break; + + case 0x1B1: //L8028D024 + if(plyr_hitbox_type == HITBOX_1_BEAK_BUSTER) + obj_collision_type = 1; + break; + }//L8028D034 + if(func_80297C6C() == 3){ + plyr_collision_type = 0; + } + if(obj_collision_type){ + miscflag_set(8); + } + func_8032FFF4(playerMarker, marker, plyr_collision_type); + func_8032FFF4(marker, playerMarker, obj_collision_type); + if(marker->unk3E_0){ + func_8032B258(actor, obj_collision_type); + } + } + else if(prop->unk8_1)//L8028D0B0 //PropProp + { + tmp2 = prop->propProp.unk0_31 + 0x2D1; + switch (tmp2) + { + case 0x2E8: + miscflag_set(MISC_FLAG_1_ON_FLIGHT_PAD); //on flight pad + break; + case 0x2DD: //on shock spring pad + miscflag_set(MISC_FLAG_2_ON_SPRING_PAD); + break; + default: + func_80332790(tmp2); + break; + } + } + else{//L8028D10C //SpriteProp + tmp3 = prop->spriteProp.unk0_31 + 0x572; + switch (tmp3) + { + case 0x6D6: //L8028D144 + if(!func_8028BC60()){ + prop->spriteProp.unk8_4 = 0; + func_8028BA2C(prop); + } + break; + case 0x6D7: //L8028D16C + if(!func_8028BC60()){ + prop->spriteProp.unk8_4 = 0; + collect_egg(prop); + } + break; + case 0x580: //L8028D194 + if(!func_8028BC60()){ + prop->spriteProp.unk8_4 = 0; + func_802D8E68(prop); + } + break; + case 0x6D1: //L8028D1BC + if(!func_8028BC60()){ + prop->spriteProp.unk8_4 = 0; + func_802D8EDC(prop); + } + break; + default: + func_80332790(tmp3); + break; + } + } +} + +//player_initMarker +void playerMarker_init(void){ + f32 sp1C[3]; + _player_getPosition(sp1C); + playerMarker = func_8032FBE4(sp1C, func_80291AAC, 1, 0); + playerMarker->unk2C_1 = 1; + marker_setCollisionScripts(playerMarker, NULL, func_80291634, func_80291610); + func_803300B8(playerMarker, func_8028D7B8); + miscflag_clear(MISC_FLAG_1_ON_FLIGHT_PAD); + miscflag_clear(MISC_FLAG_2_ON_SPRING_PAD); + miscflag_clear(8); + func_8028D638(0,0); + func_8033D2F4(); + D_8037BF8C = 0; + D_8037BF90 = 0xff; + +} + +void playerMarker_free(void){ + marker_free(playerMarker); + playerMarker = NULL; +} + + +void func_8028D2E4(void){ + f32 sp174[3]; + f32 sp168[3]; + s32 temp_s0; + int i, j; + Prop *sp58[65]; + s32 *temp_s0_2; + s32 temp_s2; + Prop *temp_s1; + + if ((D_8037BF88 != 0)){ + temp_s0 = func_8024FEEC(func_8025ADD4(COMUSIC_30_5TH_JINJO_COLLECTED) & 0xFF); + if((func_80259B8C() < 4 && temp_s0 >= 0xBB9) || !func_8025AD7C(COMUSIC_30_5TH_JINJO_COLLECTED)){ + func_8028F918(0); + D_8037BF88 = 0; + } + }//L8028D364 + miscflag_clear(8); + if(playerMarker->collidable){ + temp_s0_2 = func_8028B750(); + miscflag_clear(MISC_FLAG_1_ON_FLIGHT_PAD); + miscflag_clear(MISC_FLAG_2_ON_SPRING_PAD); + _player_getPosition(sp168); + func_8032F64C(sp168, playerMarker); + for(D_8037BF8C = NULL, i = 0, temp_s2 = 0; i < 2;i++){//L8028D3DC + D_8037BF90 = i; + func_80292284(sp174, i); //get top of player? + playerMarker->unk38[0] = sp174[0] - sp168[0]; + playerMarker->unk38[1] = sp174[1] - sp168[1]; + playerMarker->unk38[2] = sp174[2] - sp168[2]; + func_80320ED8(playerMarker, temp_s0_2[i], 1); + while(temp_s1 = func_8032F528()){//L8028D480 + if(!temp_s1->unk8_2){ + if(!D_8037BF8C && temp_s1->markerFlag && temp_s1->unk8_1){ + D_8037BF8C = temp_s1->actorProp.marker; + } + func_8028BCA0(temp_s1); + temp_s1->unk8_2 = 1; + sp58[temp_s2] = temp_s1; + temp_s2++; + }//L8028D4E0 + }//L8028D4F0 + } + D_8037BF90 = 0xff; + + for(j = 0; j < temp_s2; j++){//L8028D55C + sp58[j]->unk8_2 = 0; + } + } +} + +ActorMarker *_player_getMarker(void){ //_player_getMarker + return playerMarker; +} + +void func_8028D5DC(void){ //player_collisionOff + playerMarker->collidable = 0; +} + +void func_8028D5F4(void){ //player_collisionOn + playerMarker->collidable = 1; +} + +s32 func_8028D60C(void){ //player_isCollidable + return (playerMarker->collidable)? 1 : 0; +} + +void func_8028D638(s32 arg0, s32 arg1){ + D_8037BF80[0] = arg0; + D_8037BF80[1] = arg1; +} + +void func_8028D64C(s32 arg0){ + D_8037BF74 = arg0; +} + +void carriedObject_setActorID(enum actor_e arg0){ + carriedObject_actorID = arg0; +} + +s32 func_8028D664(void){ + return D_8037BF74; +} + +enum actor_e carriedObject_getActorID(void){ + return carriedObject_actorID; +} + +void func_8028D67C(s32 arg0){ + D_8037BF7C = arg0; +} + +s32 func_8028D688(void){ + return D_8037BF7C; +} + +s32 func_8028D694(void) { + s32 temp_a0; + s32 phi_v1; + + phi_v1 = 0; + if (D_8037BF8C != NULL) { + temp_a0 = D_8037BF8C->unk40_31 - 0xB; + if ((temp_a0 >= 0) && (temp_a0 < 4) && (((1 << temp_a0) & D_8037BF8C->unk40_27))) { + phi_v1 = 0x08000000 << temp_a0; + } + } + return phi_v1 | 0x400000; +} + + +s32 func_8028D6F0(s32 **arg0){ + *arg0 = func_8028B750(); + return 2; +} + +void func_8028D71C(void){ + f32 sp3C[3]; + f32 sp30[3]; + + func_8028E9C4(5, sp30); + player_getPosition(sp3C); + sp3C[1] += (sp30[1] - sp3C[1])*0.75; + func_802EE6CC(sp3C, 0, D_80363680, 1, 0.75f, 0.0f, 0x7d, 0xfa, 0); + +} + +void func_8028D7B8(s32 arg0, ActorMarker *arg1, s32 arg2){ + s32 sp24; + s32 sp20 = func_8033D594(arg2); + s32 sp1C = 0; + Actor *ideal_yaw = marker_getActor(arg1); + s32 tmp_v0; + + if(func_8033D5A4(arg2)) + miscflag_set(8); + + if((func_80297C6C() != 3 && func_8028F1E0()) || !sp20){ + if(!func_8028F25C()){ + sp24 = func_8033D564(arg2); + if(0 < sp24 && sp24 < 6){ + sp1C = 2; + sp20 = MAX(0, sp20 - 1); + }//L8028D884 + + if(6 < sp24 && sp24 < 0xC){ + if(!(1 < func_8033D5A4(arg2)) || (func_8033D574(arg2) != -1 && ideal_yaw->unk164[func_8033D574(arg2)])){ + sp1C = 1; + }//L8028D8E8 + }//L8028D8E8 + + if(sp20){ + if(func_8033D594(arg2) == 3){ + func_803463D4(ITEM_14_HEALTH, -item_getCount(ITEM_14_HEALTH)); + } + else{//L8028D92C + func_803463D4(ITEM_14_HEALTH, -sp20); + } + }//L8028D948 + + if(item_getCount(ITEM_14_HEALTH) == 0){ + sp1C = 2; + } + + switch(sp1C){ + case 1://L8028D98C + sp24 = (7 < ((sp24 < 0xb) ? sp24 : 0xb)) ? ((sp24 < 0xb) ? sp24 : 0xb): 0x7; + sp24 -= 7; + func_8028F428(sp24 +8, arg1); + func_80250D94(0.8f, sp24 + 0.2, 0.3f); + break; + case 2://L8028DA10 + sp24 = (1 < ((sp24 < 5) ? sp24 : 5)) ? ((sp24 < 5) ? sp24 : 5): 1; + sp24--; + func_8028F55C(sp24 + 3, arg1); + func_80250D94(1.0f, sp24 + 0.3, 0.5f); + if(ideal_yaw->unk16C_2 || ideal_yaw->unk16C_1){ + func_8028D71C(); + } + break; + case 0: + break; + } + }//L8028DAB0 + }//L8028DAB0 +} diff --git a/src/core2/code_49A70.c b/src/core2/code_49A70.c new file mode 100644 index 00000000..7ec4a811 --- /dev/null +++ b/src/core2/code_49A70.c @@ -0,0 +1,129 @@ +#include +#include "functions.h" +#include "variables.h" + +#define ABS(s) (((s) >= 0) ? (s) : -(s)) + +extern f32 func_80309B24(f32[3]); + +/* .h */ +void func_802D10A4(Actor *this); + +typedef struct { + s32 unk0; +}ActorLocal_core2_49A70; + + +/* .data */ +extern ActorAnimationInfo D_803673C0[]; +extern ActorInfo D_80367404 = { + 0x65, 0x56, 0x3EC, + 0x1, D_803673C0, + func_802D10A4, func_80326224, func_80325888, + 2500, 0x333, 0.0f, 0 +}; + +/* .rodata */ +extern f32 D_80376640; +extern f64 D_80376648; +extern f64 D_80376650; +extern f64 D_80376658; + +/* .code */ +void func_802D0A00(Actor *this) { + this->unk28 = randf2(1.5f, /*2.3f*/D_80376640); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_49A70/func_802D0A38.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_49A70/func_802D0AB8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_49A70/func_802D0B24.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_49A70/func_802D0B54.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_49A70/func_802D0CB4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_49A70/func_802D0DDC.s") + +extern void func_802D0F30(ActorMarker *marker, ActorMarker *other_marker); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_49A70/func_802D0F30.s") + + +void func_802D0FC8(Actor *this) { + this->unk4C += time_getDelta(); + if (MAX(0.25, (12.0 - this->unk28) / 12.0) < this->unk4C) { + *(s32 *)(&this->local) = NOT(*(s32 *)(&this->local)); + this->unk4C = 0.0f; + if (*(s32 *)(&this->local)) { + FUNC_8030E8B4(SFX_2A_CLOCK_TIC_1, 0.5f, 12000, this->position, 0x4E2, 0x9C4); + } + else{ + FUNC_8030E8B4(SFX_51_CLOCK_TIC_2, 0.5f, 12000, this->position, 0x4E2, 0x9C4); + } + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_49A70/func_802D10A4.s") +#else +void func_802D10A4(Actor *this) { + f32 tick; + f32 player_position[3]; + f32 var_f2; + + tick = time_getDelta(); + if (!this->initialized) { + marker_setCollisionScripts(this->marker, NULL, NULL, func_802D0F30); + this->unk138_25 = TRUE; + this->initialized = TRUE; + this->unk4C = 0.0f; + } + func_802D0FC8(this); + this->unk60 += tick; + if (M_PI <= this->unk60) { + this->unk60 -= M_PI; + } + this->unk1C[0] = this->position[0]; + this->unk1C[1] = this->position[1]; + this->unk1C[2] = this->position[2]; + this->unk1C[1] = func_80309B24(this->position) - 15.0f; + this->position[1] = this->unk1C[1] - (sinf(this->unk60 * 4.0f) * 10.0f); + _player_getPosition(player_position); + switch (this->state) { + case 1: + func_802D0A38(this); + break; + + case 2: + this->yaw_moving = (f32) func_80329784(this); + func_80328FB0(this, 4.0f); + if (func_80329480(this)) { + var_f2 = ABS(player_position[1] - this->unk1C[1]); + if (250.0 > var_f2) { + func_80328A84(this, 3); + actor_loopAnimation(this); + FUNC_8030E8B4(SFX_C4_TWINKLY_MUNCHER_GRR, 0.6f, 32750, this->position, 1250, 2500); + this->unk28 = 4.0f; + } + } + break; + + case 3: + this->yaw_moving = (f32) func_80329784(this); + func_80328FB0(this, this->unk28 / 2); + this->unk28 = MIN( 50.0, (this->unk28 + tick)); + var_f2 = ABS(player_position[1] - this->unk1C[1]); + if ((250.0 <= var_f2) || !func_80329054(this, 0)) { + func_802D0AB8(this); + } + break; + + case 4: + if (animctrl_isStopped(this->animctrl) != 0) { + marker_despawn(this->marker); + } + break; + } +} +#endif diff --git a/src/core2/code_4A6F0.c b/src/core2/code_4A6F0.c new file mode 100644 index 00000000..26d85e2a --- /dev/null +++ b/src/core2/code_4A6F0.c @@ -0,0 +1,526 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80256E24(f32 [3], f32, f32, f32, f32, f32); +extern void func_802EE6CC(f32[3], f32[3], s32[4], s32, f32, f32, s32, s32, s32); +extern void func_803255FC(Actor *); +extern void func_80325760(Actor *); + + +Actor *func_802D2964(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_802D1CF0(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_80367490[]; +extern ActorInfo D_803674E0 = { + 0x6, 0x7, 0x3C6, + 0x1, D_80367490, + func_802D1CF0, func_80326224, func_802D2964, + 0, 0, 0.0f, 0 +}; +extern s32 D_80367504[3]; +extern f32 D_80367510[3]; +extern s32 D_8036751C[4]; + + +/* .bss */ +extern u8 D_8037DDF0; +extern u8 D_8037DDF1; +extern u8 D_8037DDF2; +extern u8 D_8037DDF3; + + +/* .code */ +s32 func_802D1680(s32 arg0) { + f32 var[3]; + + if (func_80304E24(arg0, var) != 0) { + return 1; + } + return 0; +} + +s32 func_802D16AC(void) { + s32 ret = 2; + + func_802D1680(0x1F); + if (func_802D1680(0x20) != 0) { + ret = 3; + } + if (func_802D1680(0x21) != 0) { + ret = 5; + } + if (func_802D1680(0x22) != 0) { + ret = 4; + } + if (func_802D1680(0x23) != 0) { + ret = 6; + } + return ret; +} + +void func_802D1724(void){ + D_8037DDF0 = func_802D16AC(); +} + +s32 func_802D1748(enum transformation_e trans_id){ + switch(trans_id){ + case TRANSFORM_2_TERMITE: + return 5; + case TRANSFORM_5_CROC: + return 10; + case TRANSFORM_4_WALRUS: + return 15; + case TRANSFORM_3_PUMPKIN: + return 20; + case TRANSFORM_6_BEE: + return 25; + } + return 0; +} + + +enum bkprog_e func_802D17A0(enum transformation_e trans_id){ + return (trans_id - TRANSFORM_2_TERMITE) + BKPROG_90_PAID_TERMITE_COST; +} + +bool func_802D17A8(s32 x, s32 z, s32 dist) { + s32 sp1C[3]; + + func_8028EB3C(sp1C); + return (x - sp1C[0]) * (x - sp1C[0]) + (z - sp1C[2]) * (z - sp1C[2]) < dist * dist; +} + + +bool func_802D181C(s32 arg0) { + s32 sp1C[3] = D_80367504; + return (func_803049CC(arg0, sp1C))? TRUE : FALSE; +} + +void func_802D186C(Actor *this) { + if (this->unk44_31 == 0) { + this->unk44_31 = func_8030ED2C(SFX_5F_MUMBO_BUGABUGOW_MUFFLED, 3); + sfxsource_setSampleRate(this->unk44_31, 0x7FFF); + } +} + +void func_802D18B4(Actor *this) { + s32 phi_v0; + + if (map_get() == MAP_7A_GL_CRYPT) { + phi_v0 = func_802D17A8(1107, 0, 188); + } else { + phi_v0 = func_802D17A8(0, -107, 188); + } + if(phi_v0 || func_803203FC(1) || func_803203FC(0x1F)){ + func_80328AC8(this, 2); + if( !func_8031FF1C(BKPROG_11_HAS_MET_MUMBO) + || (!func_8031FF1C(BKPROG_DC_HAS_HAD_ENOUGH_TOKENS_BEFORE) && this->unk38_0) + ) { + func_8028F918(2); + } + } +} + + +void func_802D1970(Actor *this){ + actor_loopAnimation(this); + func_802D18B4(this); +} + +void func_802D1998(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *this; + + this = marker_getActor(caller); + switch(text_id){ + case 0xD8F: //L802D1A04 + func_80311480((this->unk38_0) ? 0xDAA : 0xDAB, 0xe, this->position, this->marker, func_802D1998, NULL); + return; + + case 0xd90: //L802D1A40 + func_80320004(BKPROG_12_HAS_TRANSFORMED_BEFORE, TRUE); + func_80311480(0xD8F + D_8037DDF0, 4, NULL, NULL, NULL, NULL); + func_80314AC8(1); + break; + + case 0xdaa: //L802D1A7C /* fall-through */ + func_80320004(BKPROG_DC_HAS_HAD_ENOUGH_TOKENS_BEFORE, TRUE); + case 0xdab: //L802D1A88 + func_8028F918(0); + break; + + case 0xdaf: //L802D1A98 + this->unk138_24 = FALSE; + if(this->unk38_31 != 0){ + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + func_803463D4(ITEM_1C_MUMBO_TOKEN, -this->unk38_31); + this->unk38_31 = 0; + } + func_80328B8C(this, 5, 0.0f, 1); + return; + + case 0xdb0: //L802D1AF8 + case 0xdb1: //L802D1AF8 + case 0xdb2: //L802D1AF8 + D_8037DDF0 = this->unk10_12; + this->unk10_12 = 1; + if(this->unk38_31){ + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + func_803463D4(ITEM_1C_MUMBO_TOKEN, -this->unk38_31); + } + + case 0xdae: //L802D1B48 + func_80328B8C(this, 5, 0.0f, 1); + return; + + default: //L802D1B64 + func_80314AC8(1); + break; + } + func_80328A84(this, 4); +} + +void func_802D1B8C(Actor *this, enum transformation_e transform_id) { + if (this->unk10_12 != 0) { + func_80311480(func_8031FF44(BK_PROG_BB_MUMBO_MISTAKE_INDEX, 2) + 0xDAF, 0xE, this->position, this->marker, func_802D1998, NULL); + return; + } + if (func_8031FF1C(BKPROG_12_HAS_TRANSFORMED_BEFORE)) { + if (this->velocity[0] == 0.0f) { + func_80311480(transform_id + 0xD8F, 6, this->position, this->marker, func_802D1998, NULL); + return; + } + if (map_get() == MAP_7A_GL_CRYPT && transform_id == TRANSFORM_3_PUMPKIN && !func_8031FF1C(BKPROG_F7_HAS_TRANSFORMED_IN_CRYPT)) { + func_80311480(0xDAD, 6, this->position, this->marker, func_802D1998, NULL); + func_80320004(BKPROG_F7_HAS_TRANSFORMED_IN_CRYPT, TRUE); + return; + } + func_80314AC8(1); + func_80328A84(this, 4U); + return; + } + func_80311480(0xD90, 0xE, this->position, this->marker, func_802D1998, NULL); +} + +void func_802D1CF0(Actor *this) { + s32 sp58[6]; + f32 sp4C[3]; + bool sp48; + bool sp44; + s32 sp40; + f32 temp_f12; + + this->unk130 = func_803255FC; + if( !func_803203FC(1) + && !func_803203FC(0x1F) + && map_get() != MAP_7A_GL_CRYPT) { + func_803463D4(ITEM_1C_MUMBO_TOKEN, 0); + } + if(!this->initialized){ + this->initialized = TRUE; + this->marker->propPtr->unk8_3 = FALSE; + this->unk60 = 0.0f; + if (func_802D181C(0x201)) { + this->unk60 = 1.0f; + func_80328A84(this, 7U); + } else if (func_802D181C(0x202)) { + this->unk60 = 2.0f; + func_80328A84(this, 8U); + } + } + + if(!this->unk16C_4){ + this->unk38_31 = 0; + if( player_getTransformation() == TRANSFORM_1_BANJO + && !func_8031FF1C(func_802D17A0(D_8037DDF0)) + && (map_get() != MAP_7A_GL_CRYPT) + ){ + this->unk38_31 = func_802D1748(D_8037DDF0); + } + this->unk38_0 = (item_getCount(ITEM_1C_MUMBO_TOKEN) >= this->unk38_31); + this->unk10_12 = 0; + this->unk138_24 = 0; + this->unk16C_4 = TRUE; + } + + func_80256E24(sp4C, 0.0f, this->yaw, 0.0f, 0.0f, 10.0f); + sp4C[0] += this->position[0]; + sp4C[1] += this->position[1]; + sp4C[2] += this->position[2]; + func_8028E668(sp4C, 220.0f, -20.0f, 110.0f); + switch(this->state){ + case 1: //L802D1F2C + this->unk130 = func_80325760; + func_802D186C(this); + if (actor_animationIsAt(this, 0.1f) != 0) { + FUNC_8030E624(SFX_5D_BANJO_RAAOWW, 1.0f, 6000); + } + if (actor_animationIsAt(this, 0.4f) != 0) { + FUNC_8030E624(SFX_5E_BANJO_PHEWWW, 1.0f, 6000); + } + func_802D1970(this); + break; + + case 2: //L802D1F90 + if (actor_animationIsAt(this, 0.25f) != 0) { + func_8030E484(0x41); + } + actor_playAnimationOnce(this); + if (actor_animationIsAt(this, 0.999f)) { + if( !func_8031FF1C(BKPROG_11_HAS_MET_MUMBO) + && !func_803203FC(1) + && !func_803203FC(0x1F) + ) { + func_80328A84(this, 3); + func_80311480(0xD8F, 0xE, this->position, this->marker, func_802D1998, NULL); + func_80320004(BKPROG_11_HAS_MET_MUMBO, TRUE); + break; + } + + if( !func_8031FF1C(BKPROG_DC_HAS_HAD_ENOUGH_TOKENS_BEFORE) + && !func_803203FC(1) + && !func_803203FC(0x1F) + && this->unk38_0 + ){ + func_80328A84(this, 3); + func_80311480(0xDAA, 0xE, this->position, this->marker, func_802D1998, NULL); + func_80320004(BKPROG_DC_HAS_HAD_ENOUGH_TOKENS_BEFORE, TRUE); + break; + } + + func_80328A84(this, 4); + } + break; + + case 3: //L802D20D4 + actor_loopAnimation(this); + break; + + case 4: //L802D20E4 + actor_loopAnimation(this); + sp48 = (map_get() == MAP_7A_GL_CRYPT) ? func_802D17A8(0x442, 0, 0x3C) : func_802D17A8(0, -0x5A, 0x3C); + if( sp48 + && func_8028ECAC() == 0 + && func_8028F20C() + && func_8028EFC8() + ){ + func_8024E55C(0, &sp58); + if(sp58[BUTTON_Z] == 1){ + if (D_8037DDF0 == TRANSFORM_7_WISHWASHY) { + this->unk38_31 = 0; + } else if (player_getTransformation() == TRANSFORM_1_BANJO && !func_8031FF1C(func_802D17A0(D_8037DDF0)) && map_get() != MAP_7A_GL_CRYPT){ + this->unk38_31 = func_802D1748(D_8037DDF0); + } + this->unk38_0 = (D_8037DDF0 == TRANSFORM_7_WISHWASHY) || (item_getCount(ITEM_1C_MUMBO_TOKEN) >= this->unk38_31); + if (this->unk38_0) { + sp48 = map_get() != MAP_E_MM_MUMBOS_SKULL; + sp44 = player_getTransformation() == TRANSFORM_1_BANJO; + func_8028F94C(2, this->position); + if ( sp44 && map_get() != MAP_7A_GL_CRYPT + && !func_8031FF1C(0xBA) + && randf() < 0.01 + && sp48 + ) { + func_80311480(0xDAE, 6, NULL, this->marker, func_802D1998, NULL); + func_80320004(0xBA, 1); + this->unk138_24 = TRUE; + func_80328A84(this, 3); + } else if ( + sp44 + && map_get() != MAP_7A_GL_CRYPT + && !this->unk138_23 + && (sp40 = func_8031FF44(0xBB, 2), sp40 < 3) + && randf() < 0.05 + && sp48 + ){ + this->unk138_23 = TRUE; + this->unk10_12 = D_8037DDF0; + D_8037DDF0 = 7; + func_80320044(0xBB, ++sp40, 2); + func_80328A84(this, 5); + } else { + if (this->unk38_31) { + func_8025A6EC(SFX_2B_BULL_MOO_1, 28000); + func_803463D4(ITEM_1C_MUMBO_TOKEN, -this->unk38_31); + } + func_80328A84(this, 5); + } + func_80314AC8(0); + + break; + } + func_8025A6EC(COMUSIC_2C_BUZZER, 22000); + if ((levelSpecificFlags_get(0x3E) == 0) && (func_80311480(0xDAC, 0, NULL, NULL, NULL, NULL) != 0)) { + levelSpecificFlags_set(0x3E, 1); + } + } + } + break; + + case 5: //L802D2488 + actor_playAnimationOnce(this); + if (actor_animationIsAt(this, 0.35f)){ + func_8030E2C4(this->unk44_31); + } + if (actor_animationIsAt(this, 0.56f)) { + func_8030E394(this->unk44_31); + } + if (actor_animationIsAt(this, 0.57f)) { + func_8030E6D4(1); + func_8030E6D4(1); + } + if (actor_animationIsAt(this, 0.01f)) { + func_8025A70C(COMUSIC_1D_MUMBO_TRANSFORMATION); + func_8025A58C(0, 0x3E8); + } + if (actor_animationIsAt(this, 0.01f)) { + + if ( this->unk138_24 + || (this->unk10_12 == 0 + && (player_getTransformation() != TRANSFORM_1_BANJO) + && (player_getTransformation() != TRANSFORM_7_WISHWASHY)) + ) { + func_8028FB88(TRANSFORM_1_BANJO); + } else if (func_8028FB88(D_8037DDF0)) { + if (D_8037DDF0 != TRANSFORM_7_WISHWASHY) { + if (func_8031FF74(func_802D17A0(D_8037DDF0), TRUE)) { + this->velocity[0] = 1.0f; + } + this->unk38_31 = 0; + } + if (this->unk10_12 == 1) { + this->unk10_12 = 0; + } + } + } + if (actor_animationIsAt(this, 0.79f)) { + func_8025A58C(-1, 0x3E8); + } + if (actor_animationIsAt(this, 0.999f)) { + if (!this->unk138_24) { + func_8028F918(0); + } + func_8025A7DC(0x1D); + if (player_getTransformation() != TRANSFORM_1_BANJO) { + func_80328A84(this, 3); + func_802D1B8C(this, D_8037DDF0); + break; + } + if (this->unk138_24) { + func_80328A84(this, 3); + func_80311480(0xDAF, 6, NULL, this->marker, func_802D1998, NULL); + break; + } + func_80314AC8(1); + func_80328A84(this, 4); + } + break; + + case 7: //L802D2704 + func_802D186C(this); + if (func_803203FC(BKPROG_11_HAS_MET_MUMBO) == 0) { + if (map_get() == MAP_7A_GL_CRYPT) { + sp48 = func_802D17A8(0x453, 0, 0xBC); + } else { + sp48 = func_802D17A8(0, -0x6B, 0xBC); + } + if (sp48 != 0) { + func_80311480(0xDA7, 7, NULL, NULL, NULL, NULL); + func_803204E4(BKPROG_11_HAS_MET_MUMBO, TRUE); + } + } + actor_loopAnimation(this); + break; + + case 8: //L802D2790 + func_802D186C(this); + if (func_803203FC(BKPROG_12_HAS_TRANSFORMED_BEFORE) == 0) { + if (map_get() == MAP_7A_GL_CRYPT) { + sp48 = func_802D17A8(0x453, 0, 0xBC); + } else { + sp48 = func_802D17A8(0, -0x6B, 0xBC); + } + if (sp48 != 0) { + func_80311480(0xDA8, 7, NULL, NULL, NULL, NULL); + func_803204E4(BKPROG_12_HAS_TRANSFORMED_BEFORE, TRUE); + } + } + actor_loopAnimation(this); + if (actor_animationIsAt(this, 0.99f)) { + if (randf() < 0.4) { + temp_f12 = (randf() - 0.5) * 0.95300000000000007 * 2; + this->unk1C[0] = temp_f12 + ((temp_f12 >= 0.0f) ? 0.476 : -0.476); + func_80328AEC(this, 9); + break; + } + if (0.6 < randf()) { + animctrl_setDuration(this->animctrl, randf2(0.6f, 1.8f)); + } + } + break; + case 9: //L802D2920 + this->yaw += this->unk1C[0]; + if (actor_animationIsAt(this, 0.99f)) { + func_80328AEC(this, 8); + } + break; + } +} + +Actor *func_802D2964(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *this = marker_getActor(marker); + Actor *out; + f32 sp44[3]; + f32 sp38[3] = D_80367510; + + func_8033A45C(4, (this->unk60 == 0.0f)); + func_8033A45C(5, (this->unk60 == 1.0f)); + func_8033A45C(6, (this->unk60 == 0.0f)); + func_8033A45C(7, (this->unk60 == 1.0f)); + func_8033A45C(8, (this->unk60 == 2.0f)); + func_8033A45C(9, 0); + out = func_80325888(marker, gfx, mtx, vtx); + if( marker->unk14_21 && out->state == 8){ + if( actor_animationIsAt(out, 0.2f) + || actor_animationIsAt(out, 0.28f) + || actor_animationIsAt(out, 0.36f) + ){ + func_8034A174(func_80329934(), 9, sp44); + func_802EE6CC(sp44, sp38, D_8036751C, 0, 0.9f, 0.0f, 0x46, 0x14, 0); + } + } + return out; +} + +void func_802D2B94(s32 this, s32 gfx){ + s32 xform; + xform = player_getTransformation(); + if(xform == TRANSFORM_1_BANJO || xform == TRANSFORM_7_WISHWASHY || D_8037DDF2) + return; + + D_8037DDF2++; + if(D_8037DDF3) + return; + + func_80311480(func_8031FF74(BKPROG_83_MAGIC_GET_WEAK_TEXT, TRUE) ? 0xf5C: 0xf5b, 0xe, NULL, NULL, NULL, NULL); +} + +void func_802D2C24(s32 this, s32 gfx){ + s32 xform; + xform = player_getTransformation(); + if(xform == TRANSFORM_1_BANJO || xform == TRANSFORM_7_WISHWASHY || D_8037DDF1) + return; + func_80311480(func_8031FF74(BKPROG_84_MAGIC_ALL_GONE_TEXT, TRUE) ? 0xf5e: 0xf5d, 0xe, NULL, NULL, NULL, NULL); + D_8037DDF1++; + func_8028FB88(TRANSFORM_1_BANJO); +} + +void func_802D2CB8(void){ + D_8037DDF2 = D_8037DDF3 = D_8037DDF1 = 0; +} + +void func_802D2CDC(void){ + D_8037DDF3 = D_8037DDF2; + D_8037DDF2 = 0; +} diff --git a/src/core2/code_4BD70.c b/src/core2/code_4BD70.c new file mode 100644 index 00000000..964bcb29 --- /dev/null +++ b/src/core2/code_4BD70.c @@ -0,0 +1,27 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_802D2D00(Actor *this); + +/* .data */ +ActorInfo D_80367530 = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_368_5_MUMBO_TOKEN_SIGN, ASSET_301_MODEL_5_MUMBO_TOKEN_SIGN, 0x0, 0x0, func_802D2D00, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +ActorInfo D_80367554 = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_36B_10_MUMBO_TOKEN_SIGN, ASSET_302_MODEL_10_MUMBO_TOKEN_SIGN, 0x0, 0x0, func_802D2D00, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +ActorInfo D_80367578 = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_36A_15_MUMBO_TOKEN_SIGN, ASSET_303_MODEL_15_MUMBO_TOKEN_SIGN, 0x0, 0x0, func_802D2D00, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +ActorInfo D_8036759C = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_369_20_MUMBO_TOKEN_SIGN, ASSET_304_MODEL_20_MUMBO_TOKEN_SIGN, 0x0, 0x0, func_802D2D00, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +ActorInfo D_803675C0 = { MARKER_1E9_MUMBO_COST_SIGN, ACTOR_36C_25_MUMBO_TOKEN_SIGN, ASSET_305_MODEL_25_MUMBO_TOKEN_SIGN, 0x0, 0x0, func_802D2D00, func_80326224, func_80325888, 0, 0, 0.0f, 0}; + +/* .rodata */ +void func_802D2D00(Actor *this) { + if (!this->unk16C_4) { + if( func_8031FF1C(this->modelCacheIndex - ACTOR_368_5_MUMBO_TOKEN_SIGN + BKPROG_90_PAID_TERMITE_COST) + || func_803203FC(0x1F) + ) { + marker_despawn(this->marker); + } + this->unk16C_4 = TRUE; + } + if (func_8031FF1C(this->modelCacheIndex - ACTOR_368_5_MUMBO_TOKEN_SIGN + BKPROG_90_PAID_TERMITE_COST)) { + func_80326310(this); + } +} diff --git a/src/core2/code_4BE10.c b/src/core2/code_4BE10.c new file mode 100644 index 00000000..6a0d7d74 --- /dev/null +++ b/src/core2/code_4BE10.c @@ -0,0 +1,44 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_802D2DA0(Actor *this); + +/* .data */ +extern ActorInfo D_803675F0 = { + 0x16, 0x6A, 0x0, + 0x1, NULL, + func_802D2DA0, func_80326244, func_80325340, + 0, 0, 0.0f, 0 +}; + +extern struct31s D_80367624; +extern struct42s D_8036764C; + + +/* .code */ +void func_802D2DA0(Actor *this) { + ParticleEmitter *pCtrl; + f32 sp70[3]; + s32 phi_s6; + s32 i; + + if (this->state == 2) { + if (--this->unk38_31 == 0) { + marker_despawn(this->marker); + } + pCtrl = partEmitList_pushNew((s32) this->unk60); + for(phi_s6 = 0; phi_s6 < (s32)this->unk60; phi_s6++){ + for(i = 0; i < 3; i++){ + sp70[i] = this->position[i] + randf()*2*this->unkF4_8 - ((i == 1)? 0: this->unkF4_8); + } + + particleEmitter_setSprite(pCtrl, ASSET_710_SPRITE_SPARKLE_PURPLE); + particleEmitter_setStartingFrameRange(pCtrl, 0, 0); + particleEmitter_setPosition(pCtrl, sp70); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8036764C); + func_802EFB98(pCtrl, &D_80367624); + particleEmitter_setSpawnInterval(pCtrl, 1.0f); + } + } +} diff --git a/src/core2/code_4C020.c b/src/core2/code_4C020.c new file mode 100644 index 00000000..111db327 --- /dev/null +++ b/src/core2/code_4C020.c @@ -0,0 +1,1275 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "SnS.h" + +extern f32 func_80258640(f32 [3], f32[3]); +extern void func_8025A788(enum comusic_e, f32, f32); +extern void func_8031CC40(enum map_e, s32); +extern void func_802F363C(f32); +extern void func_802F9D38(s32); +extern void func_802EE6CC(f32[3], f32[3], s32[4], s32, f32, f32, s32, s32, s32); +extern void ml_vec3f_assign(f32[3], f32, f32, f32); + + +void func_802D3D54(Actor *this); +void func_802D3DA4(Actor *this); +Actor *func_802D3F48(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); +void func_802D3FD4(Actor *this); +Actor *func_802D41C4(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); +void func_802D4250(Actor *this); +void func_802D4388(Actor *this); +Actor *func_802D4588(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); +void func_802D4680(Actor *this); +void func_802D4B94(Actor *this); +void func_802D4BBC(Actor *this); +void func_802D4BE4(Actor *this); +void func_802D4C0C(Actor *this); +void func_802D4C34(Actor *this); +void func_802D4C5C(Actor *this); +void func_802D4C84(Actor *this); +void func_802D4CAC(Actor *this); +void func_802D4CD4(Actor *this); +void func_802D68F0(s32 seconds); + +typedef struct { + u8 pad0[4]; + s16 unk4; + s16 unk6; +}Struct_core2_4C020_0; + +/* .data */ +extern ActorAnimationInfo D_803676B0[]; +extern ActorInfo D_80367760 = { 0x26E, 0x2D9, 0x3B4, 0x1, NULL, func_802D3D54, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_80367784 = { 0x26F, 0x2DA, 0x3B5, 0x1, NULL, func_802D3D54, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_803677A8 = { MARKER_168_ICE_KEY, ACTOR_25D_ICE_KEY, ASSET_50C_MODEL_ICE_KEY, 0x1, NULL, func_802D4250, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_803677CC = { 0x233, 0x23D, 0x4DD, 0x12, D_803676B0, func_802D4388, func_80326224, func_802D4588, 0, 0, 0.0f, 0}; +extern ActorInfo D_803677F0 = { 0x16A, 0x242, 0x0, 0x0, NULL, func_802D4680, NULL, func_80325340, 0, 0, 0.0f, 0}; +extern ActorInfo D_80367814 = { MARKER_169_SNS_EGG, ACTOR_25E_SNS_EGG, ASSET_50D_MODEL_SNS_EGG, 0x1, NULL, func_802D3FD4, NULL, func_802D41C4, 0, 0, 0.0f, 0}; +extern ActorInfo D_80367838 = { 0x265, 0x2E4, 0x55A, 0x1, NULL, func_802D3DA4, NULL, func_802D3F48, 0, 0, 0.0f, 0}; +extern ActorInfo D_8036785C = { MARKER_103_MM_WITCH_SWITCH, ACTOR_204_MM_WITCH_SWITCH, ASSET_4DC_MODEL_WITCH_SWITCH, 0x1, D_803676B0, func_802D4B94, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80367880 = { MARKER_104_MMM_WITCH_SWITCH, ACTOR_206_MMM_WITCH_SWITCH, ASSET_4DC_MODEL_WITCH_SWITCH, 0x1, D_803676B0, func_802D4C34, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_803678A4 = { MARKER_105_TTC_WITCH_SWITCH, ACTOR_208_TTC_WITCH_SWITCH, ASSET_4DC_MODEL_WITCH_SWITCH, 0x1, D_803676B0, func_802D4C5C, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_803678C8 = { MARKER_106_RBB_WITCH_SWITCH, ACTOR_20B_RBB_WITCH_SWITCH, ASSET_4DC_MODEL_WITCH_SWITCH, 0x1, D_803676B0, func_802D4C84, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_803678EC = { MARKER_22A_CCW_WITCH_SWITCH, ACTOR_237_CCW_WITCH_SWITCH, ASSET_4DC_MODEL_WITCH_SWITCH, 0x1, D_803676B0, func_802D4CAC, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80367910 = { MARKER_22B_FP_WITCH_SWITCH, ACTOR_239_FP_WITCH_SWITCH, ASSET_4DC_MODEL_WITCH_SWITCH, 0x1, D_803676B0, func_802D4CD4, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80367934 = { MARKER_166_CC_WITCH_SWITCH, ACTOR_25B_CC_WITCH_SWITCH, ASSET_4DC_MODEL_WITCH_SWITCH, 0x1, D_803676B0, func_802D4BBC, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80367958 = { MARKER_162_BGS_WITCH_SWITCH, ACTOR_257_BGS_WITCH_SWITCH, ASSET_4DC_MODEL_WITCH_SWITCH, 0x1, D_803676B0, func_802D4BE4, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_8036797C = { MARKER_161_GV_WITCH_SWITCH, ACTOR_256_GV_WITCH_SWITCH, ASSET_4DC_MODEL_WITCH_SWITCH, 0x1, D_803676B0, func_802D4C0C, func_80326224, func_80325888, 0, 0, 0.0f, 0}; + +extern f32 D_80367680; +extern s32 D_80367684; //enum map_e +extern s32 D_80367688; +extern s32 D_8036768C; +extern s32 D_80367690; +extern s32 D_80367694; //enum map_e +extern s32 D_80367698; +extern s32 D_8036769C; //enum bkprog_e +extern s32 D_803676A0; //enum actor_e +extern s32 D_803676A8; +extern u8 D_803676AC; +extern s32 D_803679A0[4]; +extern s16 D_803679B0[]; +extern Struct_core2_4C020_0 D_803679C8[]; +extern s16 D_803679E0[]; +extern s32 D_803679E8; +extern s32 D_803679EC; +extern f32 D_803679F0; + + +/* .rodata */ +extern f32 D_80376984; +extern f64 D_80376988; +extern f64 D_80376990; +extern f64 D_80376998; +extern f64 D_803769A0; +extern f32 D_803769A8; +extern f32 D_803769AC; + +extern f32 D_803769B0; +extern f64 D_803769B8; //3FA999999999999A +extern f32 D_803769C0; //3F666666 + +extern f32 D_80376A78; +extern f32 D_80376A7C; +extern f32 D_80376A80; +extern f32 D_80376A84; +extern f32 D_80376A88; +extern f64 D_80376A90; +extern f64 D_80376A98; + +// 3ECCCCCD 3ECCCCCD +// 3ECCCCCD 3ECCCCCD 3ECCCCCD +// 4072C00000000000 4072C00000000000 + +/* .bss */ +extern int D_8037DE00; +extern f32 D_8037DE04; +extern f32 D_8037DE08; + +void func_802D6114(void); +void func_802D6264(f32 arg0, enum map_e arg1, s32 arg2, s32 arg3, s32 arg4, enum bkprog_e arg5); +void func_802D6344(void); +void func_802D63D4(void); +void func_802D6750(void); + +/* .code */ +void func_802D2FB0(Actor *this, s32 arg1, s32 arg2, s32 arg3, f32 arg4, s32 arg5, s32 arg6, s32 arg7) { + f32 spA4[3]; + f32 sp98[3]; + s32 i; + + sp98[0] = this->position[0]; + sp98[2] = this->position[2]; + for(i = 0; i < arg1; i++){ + sp98[1] = this->position[1] + randf2((f32) arg2, (f32) arg3); + spA4[1] = randf2(4.0f, 10.0f); + spA4[0] = randf2(-8.0f, 8.0f); + spA4[2] = randf2(-8.0f, 8.0f); + func_802EE6CC(sp98, spA4, D_803679A0, 1, arg4, 50.0f, arg5, randi2(arg6, arg7), 0); + } +} + +void func_802D3138(ActorMarker *marker, ActorMarker *other_marker){ + if(marker->unk14_20 == 0x224 || marker->unk14_20 == 0x225){ + func_8025A70C(COMUSIC_2B_DING_B); + } +} + +void func_802D317C(ActorMarker *marker, enum bkprog_e prog_flag_id){ + func_80320004(prog_flag_id, TRUE); + marker_despawn(marker); +} + +#ifndef NONMATCHING +void func_802D31AC(ActorMarker *marker, ActorMarker *other_marker); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_4C020/func_802D31AC.s") +#else +void func_802D31AC(ActorMarker *marker, ActorMarker *other_marker){ + Actor *sp2C; + + sp2C = marker_getActor(marker); + swtich(marker->unk14_20){ + //L802D3218 x < 0x23a //jmptbl D_80376720 + //L802D3292 x < 0x124 //jmptbl D_80376778 + //L802D32CC x < 0xa2 //jmptbl D_8037686C + + case 0x17d://L802D3308 + func_8030E624(0x599ff882); + func_8030E624(0x4cbff882); + func_802D2FB0(sp2C, 0x14, -0x1e, 0x190, 3.0f, 0x15e, 0x50, 0x96); + sp2C->unk60 = 1.0f; + func_80320004(0xA5, TRUE); + break; + + case 0x163://L802D3558 + break; + + case 0x263://L802D35A8 + break; + + case 0x1f2://L802D3A8C + case 0x1f3://L802D3A8C + break; + + case 0x164://L802D3C68 + case 0x165://L802D3C68 + break; + + + //L802D3CA0 else + + } +} +#endif + +void func_802D3CC8(ActorMarker *marker){ + func_802D31AC(marker, NULL); +} + +void func_802D3CE8(Actor *this){ + if(!this->initialized){ + marker_setCollisionScripts(this->marker, NULL, func_802D3138, func_802D31AC); + this->marker->propPtr->unk8_3 = TRUE; + this->initialized = TRUE; + } +} + +void func_802D3D54(Actor *this){ + func_802D3CE8(this); +} + +void func_802D3D74(Actor *this){ + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); +} + +void func_802D3DA4(Actor *this) { + f32 sp24[3]; + s32 phi_v0; + + if ((*(s32*)OS_PHYSICAL_TO_K1(0x22C) - 0x12600004)) { + return; + } + + if (!this->unk16C_4) { + + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + this->unk38_31 = 0; + } + player_getPosition(sp24); + phi_v0 = ((this->position[1] - 5.0f) <= sp24[1]) && (sp24[1] <= (this->position[1] + 30.0f)) + && (((sp24[0] - this->position[0])*(sp24[0] - this->position[0]) + (sp24[2] - this->position[2])*(sp24[2] - this->position[2])) < D_80376984); + + if ((this->unk38_31 == 0) && (phi_v0 == 0)) { + this->unk38_31 = 1; + } + if ((this->unk38_31 == 1) && (phi_v0 == 1) + && func_8028F20C() && (func_8028F66C(0x37) == 2)) { + this->unk38_31 = 2; + } +} + +Actor *func_802D3F48(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + s32 phi_s2; + Actor *this; + s32 i; + + this = marker_getActor(marker); + phi_s2 = this->unkF4_8; + for(i = 0; i < 9; i++){ + func_8033A45C(i + 1, i+1 == phi_s2); + } + return func_80325E78(marker, gfx, mtx, vtx); +} + +void func_802D3FD4(Actor *this){ + if(!this->initialized){ + this->initialized = TRUE; + func_802D3CE8(this); + switch(map_get()){ + case MAP_1D_MMM_CELLAR: //L802D4058 + if(sns_get_item_state(SNS_ITEM_EGG_CYAN, 1) && !sns_get_item_state(SNS_ITEM_EGG_CYAN, 0)){ + return; + } + break; + + case MAP_61_CCW_WINTER_NABNUTS_HOUSE://L802D4080 + if(sns_get_item_state(SNS_ITEM_EGG_YELLOW, 1) && !sns_get_item_state(SNS_ITEM_EGG_YELLOW, 0)){ + return; + } + break; + + case MAP_2C_MMM_BATHROOM: //L802D40A8 + if(sns_get_item_state(SNS_ITEM_EGG_GREEN, 1) && !sns_get_item_state(SNS_ITEM_EGG_GREEN, 0)){ + return; + } + break; + + case MAP_3F_RBB_CAPTAINS_CABIN: //L802D40D0 + if(sns_get_item_state(SNS_ITEM_EGG_RED, 1) && !sns_get_item_state(SNS_ITEM_EGG_RED, 0)){ + return; + } + break; + + case MAP_92_GV_SNS_CHAMBER: + if(!sns_get_item_state(SNS_ITEM_EGG_BLUE, 0)) + return; + break; + + case MAP_8F_TTC_SHARKFOOD_ISLAND: //L802D4110 + if(!sns_get_item_state(SNS_ITEM_EGG_PINK, 0)) + return; + break; + }//L802D4124 + marker_despawn(this->marker); + return; + }//L802D4134 + + this->yaw += (this->unkF4_8 & 1) ? D_80376988 : D_80376990; + if(this->yaw < 0.0f){ + this->yaw += 360.0f; + } + if(360.0f <= this->yaw){ + this->yaw -= 360.0f; + } +} + +Actor *func_802D41C4(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + s32 sp2C; + Actor *this; + s32 i; + + this = marker_getActor(marker); + sp2C = this->unkF4_8; + for(i = 0; i < 6; i++){ + func_8033A45C(i+1, FALSE); + } + func_8033A45C(sp2C, TRUE); + return func_80325E78(marker, gfx, mtx, vtx); +} + +void func_802D4250(Actor *this){ + if(!this->initialized){ + this->initialized = TRUE; + func_802D3CE8(this); + if(sns_get_item_state(SNS_ITEM_ICE_KEY, FALSE)){ + marker_despawn(this->marker); + } + return; + } + this->yaw += 2.0; + if(360.0f <= this->yaw){ + this->yaw -= 360.0f; + } +} + + + +bool func_802D42F8(Actor *this) { + s32 i; + + for(i = 0; D_803679B0[i] != -1 && this->unkF4_8 != D_803679B0[i]; i+=2){ + } + + if (D_803679B0[i] == -1) { + return FALSE; + } + else{ + return func_8031FF1C(D_803679B0[i + 1]); + } +} + + +void func_802D4388(Actor *this){ + func_802D3CE8(this); + this->unk38_0 = ( map_get() == MAP_7A_GL_CRYPT || item_getCount(ITEM_1C_MUMBO_TOKEN) >= this->unkF4_8 || func_802D42F8(this)) ? TRUE : FALSE; + mapSpecificFlags_set(0x1F, (func_8028F20C() && func_8028FB48(0x78000000)) || func_8028ECAC() == BSGROUP_D_TRANSFORMING); + switch(this->state){ + case 0x12: //L802D4468 + if(this->unk38_0 && mapSpecificFlags_get(0x1F)){ + func_80328B8C(this, 0x13, 0.0f, 1); + actor_playAnimationOnce(this); + func_8030E6D4(SFX_90_SWITCH_PRESS); + } + break; + + case 0x13: //L802D44B0 + if(D_80376998 <= animctrl_getAnimTimer(this->animctrl)){ + func_80328B8C(this, 0x14, 0.66f, 0); + } + break; + + case 0x14: //L802D44F0 + if(!this->unk38_0 || !mapSpecificFlags_get(0x1F)){ + func_80328B8C(this, 0x15, 0.66f, 0); + actor_playAnimationOnce(this); + } + break; + + case 0x15: //L802D4534 + if(animctrl_getAnimTimer(this->animctrl) < D_803769A0){ + func_80328B8C(this, 0x12, 0.0f, 1); + } + break; + }//L802D456C + mapSpecificFlags_set(0x1F, FALSE); +} + +Actor *func_802D4588(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + s32 phi_a1; + + phi_a1 = (marker_getActor(marker)->unk38_0) ? ((func_8023DB5C() & 4) != 0) ? 1 : 2 : 2; + func_8033A45C(1, phi_a1); + return func_80325888(marker, gfx, mtx, vtx); +} + +bool func_802D4608(void){ + return D_803676AC; +} + +void func_802D4614(enum map_e map_id){ + if(D_803676AC) + return; + D_803676AC = TRUE; + func_8028F918(2); + func_8025A788(COMUSIC_69_FF_WARP, 0.0f, 1.7f); + timedFunc_set_2(1.0f, (TFQM2) func_8031CC40, map_id, 2); +} + +void func_802D4680(Actor *this){ + f32 sp1C[3]; + + player_getPosition(sp1C); + switch(this->state){ + case 0: + if(150.0f < func_80258640(this->position, sp1C)){ + func_80328A84(this, 1); + D_803676AC = 0; + } + break; + case 1: + if(func_80258640(this->position, sp1C) < 150.0f && func_8028F20C()){ + if(func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT){ + if(map_get() == MAP_8E_GL_FURNACE_FUN){ + func_803204E4(0, 0); + func_802D4614(MAP_80_GL_FF_ENTRANCE); + } + else{ + func_802D4614(MAP_8E_GL_FURNACE_FUN); + } + } + } + break; + } +} + +void func_802D4794(Actor *this, enum sfx_e sfx_id, f32 arg2, s32 arg3, s32 arg4){ + if(this->unk44_31 != 0) + return; + + this->unk44_31 = func_802F9AA8(sfx_id); + func_802FA060(this->unk44_31, arg3, arg3, 0.0f); + func_802F9DB8(this->unk44_31, arg2, arg2, 0.0f); + func_802F9F80(this->unk44_31, (f32)arg4, 1e+09f, 0.0f); +} + +void func_802D4830(Actor *this, enum sfx_e arg1, f32 arg2){ + func_802D4794(this, arg1, arg2, 32000, 0); +} + +void func_802D485C(Actor *this, enum sfx_e arg1, f32 arg2, s32 arg3){ + func_802D4794(this, arg1, arg2, arg3, 0); +} + +void func_802D4884(Actor *this, enum sfx_e sfx_id, f32 arg2, s32 arg3, f32 arg4){ + func_802D4794(this, sfx_id, arg2, arg3, (s32)arg4); +} + +void func_802D48B8(Actor *this){ + if(this->unk44_31){ + func_802F9D38(this->unk44_31); + this->unk44_31 = 0; + } +} + +void func_802D48F0(void){ + if(D_803676A8){ + func_802F9D38(D_803676A8); + D_803676A8 = 0; + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_4C020/func_802D4928.s") +#else +void func_802D4928(Actor *this, s32 arg1, s32 arg2, s32 arg3) { + s32 sp1C; + + this->marker->propPtr->unk8_3 = TRUE; + sp1C = arg1 & 0xC00000; + if( ( ((sp1C == 0) && mapSpecificFlags_get(arg1 - 0)) + || ((sp1C == 0x800000) && func_8031FF1C(arg1 - 0x800000)) + || ((sp1C == 0x400000) && func_803203FC(arg1 - 0x400000)) + ) + && (arg2 != this->state) + ) { + func_80328B8C(this, arg2, 0.0f, 1); + actor_playAnimationOnce(this); + } + sp1C = arg1 & 0xC00000; + if( ( ((sp1C == 0) && !mapSpecificFlags_get(arg1 - 0)) + || ((sp1C == 0x800000) && !func_8031FF1C(arg1 - 0x800000)) + || ((sp1C == 0x400000) && !func_803203FC(arg1 - 0x400000)) + ) + && (arg2 == this->state) + ) { + func_80328B8C(this, arg3, 0.0f, 1); + actor_playAnimationOnce(this); + } + if(sp1C); +} +#endif + +void func_802D4A9C(Actor *this, s32 arg1){ + func_802D4928(this, arg1, 2, 3); +} + +void func_802D4AC0(Actor *this, s32 arg1, s32 arg2) { + if (func_8031FF1C(arg2)) { + if (arg1 & 0x800000) { + func_80320004(arg1 + 0xFF800000, 1); + } + if (arg1 & 0x400000) { + func_803204E4(arg1 + 0xFFC00000, 1); + } + } + if( (((arg1 & 0x800000) && (func_8031FF1C(arg1 + 0xFF800000))) || ((arg1 & 0x400000) && (func_803203FC(arg1 + 0xFFC00000)))) + && (func_8031FF1C(arg2)) && (this->animctrl == NULL) + ) { + func_80328B8C(this, 8, 0.0f, 1); + } + func_802D4A9C(this, arg1); +} + + +void func_802D4B94(Actor *this){ + func_802D4AC0(this, 0x4000b6, BKPROG_18_MM_WITCH_SWITCH_JIGGY_SPAWNED); +} + +void func_802D4BBC(Actor *this){ + func_802D4AC0(this, 0x4000bc, 0x9A); +} + +void func_802D4BE4(Actor *this){ + func_802D4AC0(this, 0x4000bd, 0x9F); +} + +void func_802D4C0C(Actor *this){ + func_802D4AC0(this, 0x4000be, 0xA0); +} + +void func_802D4C34(Actor *this){ + func_802D4AC0(this, 0x4000b7, BKPROG_19_MMM_WITCH_SWITCH_JIGGY_SPAWNED); +} + +void func_802D4C5C(Actor *this){ + func_802D4AC0(this, 0x4000b8, BKPROG_1A_TTC_WITCH_SWITCH_JIGGY_SPAWNED); +} + +void func_802D4C84(Actor *this){ + func_802D4AC0(this, 0x4000b9, BKPROG_1C_RBB_WITCH_SWITCH_JIGGY_SPAWNED); +} + +void func_802D4CAC(Actor *this){ + func_802D4AC0(this, 0x4000ba, BKPROG_46_CCW_WITCH_SWITCH_JIGGY_SPAWNED); +} + +void func_802D4CD4(Actor *this){ + if(map_get() == MAP_27_FP_FREEZEEZY_PEAK){ + if(func_8038BFA0()){ + this->unk58_0 = FALSE; + return; + }//L802D4D10 + this->unk58_0 = TRUE; + }//L802D4D1C + func_802D4AC0(this, 0x4000bb, 0x47); +} + +void func_802D4D3C(s32 arg0, s32 arg1) { + s32 sp5C[3]; + s32 sp4C[4]; + f32 sp40[3]; + + if (func_80304E24(arg1, &sp5C)) { + func_803331D8(arg0, &sp5C); + func_8025A6EC(COMUSIC_3D_JIGGY_SPAWN, 0x7FFF); + if (arg0 == 0x36) { + + sp4C[3] = 200; + sp4C[0] = sp4C[1] = sp4C[2] = 180;\ + ml_vec3f_assign(&sp40, 0.0f, 0.0f, 0.0f); + func_802EE6CC(&sp5C, &sp40, &sp4C, 0, 6.0f, 200.0f, 200, 100, 0); + + sp4C[3] = 230; + sp4C[0] = sp4C[1] = sp4C[2] = 150; + ml_vec3f_assign(&sp40, 0.0f, 2.0f, 0.0f); + func_802EE6CC(&sp5C, &sp40, &sp4C, 0, 2.0f, 90.0f, 50, 33, 0); + + sp4C[3] = 150; + sp4C[0] = sp4C[1] = sp4C[2] = 230; + ml_vec3f_assign(&sp40, -3.0f, 1.0f, 1.0f); + func_802EE6CC(&sp5C, &sp40, &sp4C, 0, 3.5f, 130.0f, 100, 80, 0); + + sp4C[3] = 200; + sp4C[0] = sp4C[1] = sp4C[2] = 250; + ml_vec3f_assign(&sp40, -1.0f, 3.0f, -3.0f); + func_802EE6CC(&sp5C, &sp40, &sp4C, 0, D_803769A8, 40.0f, 10, 120, 0); + + sp4C[3] = 130; + sp4C[0] = sp4C[1] = sp4C[2] = 130; + ml_vec3f_assign(&sp40, 2.0f, -2.0f, 2.0f); + func_802EE6CC(&sp5C, &sp40, &sp4C, 0, D_803769AC, 180.0f, 20, 160, 0); + func_8030E6D4(SFX_1B_EXPLOSION_1); + } + else{ + func_802C3F04(func_802C4140, 0x4C, + reinterpret_cast(s32, sp5C[0]), + reinterpret_cast(s32, sp5C[1]), + reinterpret_cast(s32, sp5C[2]) + ); + } + } +} + +void func_802D5000(enum map_e map_id){ + if(map_getLevel(map_id) != level_get()) + func_802E4A70(); + func_803228D8(); + func_802E4078(D_80367684, 0x65, 0); +} + +void func_802D5058(enum map_e map_id, s32 arg1, bool arg2) { + func_803204E4(1, 1); + D_80367684 = map_id; + D_80367688 = arg1; + if (arg2) { + D_8036768C = 0x2D; + } else { + D_8036768C = 0x15; + } + D_80367690 = 0; + D_80367694 = map_get(); + D_80367698 = 1; + D_8036769C = 0; + D_803676A0 = 0; + if (map_id != D_80367694) { + timedFunc_set_1(0.25f, func_802D5000, map_id); + } else { + timedFunc_set_0(0.25f, func_802D63D4); + } + func_80314AC8(0); +} + + +void func_802D5140(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + notescore_getLevelScore(func_80320424(0x19, 4)); +} + +void func_802D5178(s32 arg0, enum bkprog_e arg1, s32 arg2, enum map_e arg3, s32 arg4, s32 arg5, enum actor_e arg6, s32 arg7){ + if(levelSpecificFlags_get(arg0) && !func_8031FF1C(arg1)){ + levelSpecificFlags_set(arg0, FALSE); + func_80320004(arg1, TRUE); + func_802D6264(D_803769B0, arg3, arg2, arg4, arg5, 0); + D_803676A0 = arg6; + D_80367690 = arg7; + } +} + +void func_802D520C(Gfx **gfx, Mtx **mtx, Vtx **vtx){ + if(func_803203FC(1) && map_get() != MAP_8E_GL_FURNACE_FUN){ + func_80319214(gfx, mtx, vtx); + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_4C020/func_802D5260.s") +#else +extern f32 D_803676A4; +extern f32 D_803769B4; +void func_802D5260(void) { + s32 sp3C; + s32 sp38; + f32 sp34; + f32 sp28[3]; + s32 phi_v0_2; + s32 phi_v1_2; + + sp3C = (map_get() == MAP_76_GL_640_NOTE_DOOR) ? 0 + : (map_get() == MAP_77_GL_RBB_LOBBY) ? 1 + : (map_get() == MAP_78_GL_RBB_AND_MMM_PUZZLE) ? 2 + : -1; + + if (sp3C == -1) { + levelSpecificFlags_set(0x3C, FALSE); + func_80320004(BKPROG_26_WATER_SWITCH_3_PRESSED, FALSE); + func_80320004(BKPROG_27_LAIR_WATER_LEVEL_3, FALSE); + levelSpecificFlags_set(0x3D, FALSE); + return; + } + sp38 = func_8034C528(sp3C + 0x190); + if( func_8031FF1C(BKPROG_27_LAIR_WATER_LEVEL_3) + && !levelSpecificFlags_get(0x3D) + && !levelSpecificFlags_get(0x3C) + ) { + func_802D68F0(30); + item_set(ITEM_6_HOURGLASS, TRUE); + levelSpecificFlags_set(0x3D, TRUE); + } + if( levelSpecificFlags_get(0x3D) + && !levelSpecificFlags_get(0x3C) + && item_getCount(ITEM_6_HOURGLASS) == FALSE + ) { + levelSpecificFlags_set(0x3C, TRUE); + levelSpecificFlags_set(0x3D, FALSE); + D_803676A4 = 0.0f; + } + if (levelSpecificFlags_get(0x3C)) { + D_803676A4 -= 5.0; + if (D_803676A8 == 0) { + D_803676A8 = func_802F9AA8(SFX_3EC_CCW_DOOR_OPENING); + func_802FA060(D_803676A8, 20000, 20000, 0.0f); + func_802F9F80(D_803676A8, 0.0f, 1.0e8f, 0.0f); + } + if (D_803679C8[sp3C].unk6 + D_803676A4 <= D_803679C8[sp3C].unk4) { + levelSpecificFlags_set(0x3C, FALSE); + func_80320004(BKPROG_26_WATER_SWITCH_3_PRESSED, FALSE); + func_80320004(BKPROG_27_LAIR_WATER_LEVEL_3, FALSE); + func_802F9D38(D_803676A8); + D_803676A8 = 0; + } + } + if (sp38 != 0) { + if (levelSpecificFlags_get(0x3C) != 0) { + sp34 = D_803679C8[sp3C].unk6 + D_803676A4; + } else { + if (func_8031FF1C(BKPROG_27_LAIR_WATER_LEVEL_3)) { + phi_v0_2 = 3; + } else { + if (func_8031FF1C(BKPROG_25_LAIR_WATER_LEVEL_2)) { + phi_v1_2 = 2; + } else { + if (func_8031FF1C(BKPROG_23_LAIR_WATER_LEVEL_1)) { + phi_v0_2 = 1; + } else { + phi_v0_2 = 0; + } + phi_v1_2 = phi_v0_2; + } + phi_v0_2 = phi_v1_2; + } + sp34 = ((s16 *)&D_803679C8[sp3C])[phi_v0_2]; + } + func_8034DEB4(sp38, sp34); + player_getPosition(sp28); + + if (sp3C != -1) { + phi_v1_2 = (sp3C == 2) ? (D_803769B4 < sp28[0]) ? -200 : 0 : 0; + phi_v0_2 = D_803679E0[sp3C] + phi_v1_2; + } + else{ + phi_v0_2 = 0; + } + func_802F363C((f32) phi_v0_2 + sp34); + } +} +#endif + + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_4C020/func_802D5628.s") +#else +void func_802D5628(void){ + s32 sp7C; + s32 sp78; + s32 sp74; + s32 sp70; + s32 sp6C; + s32 sp68; + s32 sp50[6]; + s32 sp4C; + // static s32 D_803679E8 = 0; + // static s32 D_803679EC = 0; + // static f32 D_803679F0 = 0.0f; + + if( map_get() != MAP_8E_GL_FURNACE_FUN + && map_get() != MAP_80_GL_FF_ENTRANCE + ){ + D_803676AC = 0; + } + + if(getGameMode() != GAME_MODE_4_PAUSED){ + if( func_802BB294() == 0x82 + && ! gctransition_8030BDC0() + ){ + D_803679E8++; + if(D_803679EC < D_803679E8){ + D_803679EC--; + D_803679E8 = 0; + if(D_803679EC < 2){ + D_803679EC = 2; + } + func_8030E6A4(SFX_2_CLAW_SWIPE, MIN(2.0,D_803679F0), 20000); + D_803679F0 += D_803769B8; + } + } + else{//L802D5750 + D_803679F0 = 0.9f; + D_803679EC = 0xD; + D_803679E8 = 0; + } + }//L802D5774 + if(D_80367684 && map_get() == D_80367684){ + switch(D_8036768C){ + case 0x1: // L802D57C8 + if(!D_80367690){ + timedFunc_set_2(0.4f, (TFQM2) func_802D4D3C, 0x34, 0x205); + D_80367690++; + } + break; + + case 0x2: // L802D5808 + if(!D_80367690){ + timedFunc_set_2(0.4f, (TFQM2) func_802D4D3C, 0x39, 0x207); + D_80367690++; + } + break; + + case 0x3: // L802D5848 + if(!D_80367690){ + timedFunc_set_2(0.4f, (TFQM2) func_802D4D3C, 0x36, 0x20a); + D_80367690++; + } + break; + + case 0x4: // L802D5888 + func_802D5260(); + if(!D_80367690){ + timedFunc_set_2(0.4f, (TFQM2) func_802D4D3C, 0x3b, 0x20c); + D_80367690++; + } + break; + + case 0x12: // L802D58D0 + if(!D_80367690){ + timedFunc_set_2(0.4f, (TFQM2) func_802D4D3C, 0x3c, 0x238); + D_80367690++; + } + break; + + case 0x5: // L802D5910 + if(!D_80367690){ + sp7C = func_802F9AA8(0x3EC); + sp78 = func_8034C528(0x191); + if(sp78){ + func_8034DE60(sp78, -580.0f, 0.0f, 2.5f, 1); + } + func_802FA060(sp7C, 20000, 20000, 0.0f); + func_802F9F80(sp7C, 0.0f, 2.2f, 0.7f); + D_80367690++; + } + break; + + case 0x6:// L802D599C + if(!D_80367690){ + sp74 = func_802F9AA8(0x3EC); + sp70 = func_8034C528(0x191); + if(sp70){ + func_8034DE60(sp70, 0.0f, 1550.0f, 6.5f, 1); + } + func_802FA060(sp74, 20000, 20000, 0.0f); + func_802F9F80(sp74, 0.0f, 6.2f, 0.5f); + D_80367690++; + } + break; + + case 0x7: // L802D5A28 + if(!D_80367690){ + sp6C = func_802F9AA8(0x3EC); + sp68 = func_8034C528(0x190); + if(sp68){ + func_8034DE60(sp68, 1200.0f, 1900.0f, 3.0f, 1); + } + func_802FA060(sp6C, 20000, 20000, 0.0f); + func_802F9F80(sp6C, 0.0f, 2.7f, 0.5f); + D_80367690++; + } + break; + + case 0x15:// L802D5AB4 + case 0x2d:// L802D5AB4 + if(D_80367684 && D_80367684 == map_get()){ + func_80319EA4(); + if(0.0f < D_8037DE08){ + D_8037DE08 -= time_getDelta(); + } + else{//L802D5B24 + func_8024E55C(0, sp50); //get button inputs + if(sp50[4] == 1){ + func_80324C58(); + func_802D6114(); + } + } + } + break; + + case 0xd: // L802D5B54 + func_802D5260(); + break; + }//L802D6078 + } + else{//L802D5B64 + func_802D5260(); + func_802D5178(0x1C, 0x28, 0x30, MAP_69_GL_MM_LOBBY, 0x8, 0xA, ACTOR_20E_MM_ENTRANCE_DOOR, 0x28); + func_802D5178(0x21, 0x2D, 0x31, MAP_6E_GL_GV_LOBBY, 0xA, 0xA, ACTOR_226_GV_ENTRANCE, 0x12); + func_802D5178(0x1E, 0x2A, 0x32, MAP_70_GL_CC_LOBBY, 0xE, 0xA, ACTOR_212_IRON_BARS, 0xA); + func_802D5178(0x1D, 0x29, 0x33, MAP_6D_GL_TTC_LOBBY, 0x9, 0xB, ACTOR_211_CHEST_LID, 0xA); + func_802D5178(0x1F, 0x2B, 0x34, MAP_72_GL_BGS_LOBBY, 0xB, 0xB, ACTOR_210_BGS_ENTRANCE_DOOR, 0xA); + func_802D5178(0x23, 0x2F, 0x35, MAP_77_GL_RBB_LOBBY, 0xD, 0x5, ACTOR_20F_RBB_ENTRANCE_DOOR, 0xA); + func_802D5178(0x22, 0x2E, 0x36, MAP_75_GL_MMM_LOBBY, 0xC, 0x6, ACTOR_228_INVISIBLE_WALL, 0xA); + func_802D5178(0x24, 0x30, 0x37, MAP_79_GL_CCW_LOBBY, 0xF, 0xB, ACTOR_234_CCW_ENTRANCE_DOOR, 0xA); + func_802D5178(0x20, 0x2C, 0x38, MAP_6F_GL_FP_LOBBY, 0x11, 0xA, ACTOR_235_FP_ENTANCE_DOOR, 0xA); + func_802D5178(0x3F, 0xE2, 0x40, MAP_93_GL_DINGPOT, 0x10, 0xA, ACTOR_2E5_WOODEN_DOOR, 0x28); + if(func_803203FC(0x18)){ + if(!func_8031FF1C(BKPROG_99_PAST_50_NOTE_DOOR_TEXT)){ + func_80311174(0xF75, 0xE, NULL, NULL, NULL, NULL, func_802D5140); + func_80320004(BKPROG_99_PAST_50_NOTE_DOOR_TEXT, TRUE); + func_803204E4(0x18, 0); + } + else{//L802D5DD8 + if(!func_803203FC(0x16)){ + func_80311174(0xF77, 0x4, NULL, NULL, NULL, NULL, func_802D5140); + func_803204E4(0x18, 0); + } + } + }//L802D5E18 + if(level_get() == LEVEL_6_LAIR){ + if( getGameMode() == GAME_MODE_3_NORMAL + || func_802E4A08() + ){ + if( map_get() != MAP_8E_GL_FURNACE_FUN + && map_get() != MAP_90_GL_BATTLEMENTS + && !func_8031FF1C(BKPROG_FC_DEFEAT_GRUNTY) + ){ + D_8037DE04 += time_getDelta(); + if(D_80367680 < D_8037DE04 && !func_803203FC(0x16)){ + if(func_8031FF1C(BKPROG_A6_FURNACE_FUN_COMPLETE)){ + sp4C = 0xF9D; + } + else{ + sp4C = 0xFA5; + } + + if(!D_8037DE00){ + D_8037DE00 = randi2(0xF86, sp4C); + }//L802D5F1C + + if(func_803203FC(0x22)){ + if(func_80311480(0xF82, 4, NULL, NULL, NULL, NULL)){ + func_80320004(0xc1, 1); + func_803204E4(0x22, 0); + D_8037DE04 = 0.0f; + D_80367680 += 60.0; + if(300.0 < D_80367680) + D_80367680 = 130.0f; + } + } + else{//L802D5FCC + if(func_80311480(D_8037DE00, 0, NULL, NULL, NULL, NULL)){ + D_8037DE00++; + if(!(D_8037DE00 < sp4C)){ + D_8037DE00 = 0xF86; + }//L802D6018 + D_8037DE04 = 0.0f; + D_80367680 += 60.0; + if(300.0 < D_80367680) + D_80367680 = 130.0f; + } + } + } + } + } + }//L802D607C + }//L802D607C +} +#endif + +//water_level_atleast_2; +int func_802D6088(void){ + return func_8031FF1C(BKPROG_25_LAIR_WATER_LEVEL_2) + || func_8031FF1C(BKPROG_27_LAIR_WATER_LEVEL_3); +} + +//water_level_atleast_1; +int func_802D60C4(void){ + return func_8031FF1C(BKPROG_23_LAIR_WATER_LEVEL_1) + || func_8031FF1C(BKPROG_25_LAIR_WATER_LEVEL_2) + || func_8031FF1C(BKPROG_27_LAIR_WATER_LEVEL_3); +} + +void func_802D6114(void){ + s32 sp24; + s32 sp20; + + sp24 = D_80367694;\ + sp20 = D_80367698; + if(D_8036769C) + func_80320004(D_8036769C, TRUE); + func_802D6344(); + if(map_get() != sp24){ + if(map_getLevel(sp24) != map_getLevel(map_get())){ + func_802E4A70(); + }//L802D6194 + func_803204E4(0x21, 1); + if(sp24 != 0x1C || !func_8025ADBC(COMUSIC_23_MMM_INSIDE_CHURCH)){ + func_803228D8(); + } + func_802E4078(sp24, sp20, 0); + } + else{//L802D61DC + func_80347A14(1); + func_80314AC8(1); + } +} + +void func_802D61FC(enum map_e arg0){ + if( map_getLevel(arg0) != map_getLevel(map_get())) + func_802E4A70(); + func_803228D8(); + func_802E4078(D_80367684, 0, 0); + func_802D6750(); +} + +void func_802D6264(f32 arg0, enum map_e arg1, s32 arg2, s32 arg3, s32 arg4, enum bkprog_e arg5){ + D_80367684 = arg1; + D_80367688 = arg2; + D_8036768C = arg3; + D_80367690 = 0; + + D_80367694 = map_get(); + D_80367698 = arg4; + D_8036769C = arg5; + D_803676A0 = 0; + + if(arg1 != D_80367694){ + timedFunc_set_1(arg0, (TFQM1) func_802D61FC, arg1); + } + else{ + timedFunc_set_0(arg0, func_802D63D4); + } + func_80314AC8(0); +} + +void func_802D6310(f32 arg0, enum map_e arg1, s32 arg2, s32 arg3, enum bkprog_e arg4){ + func_802D6264(arg0, arg1, arg2, arg3, 0x63, arg4); + func_8028FCE8(); +} + +void func_802D6344(void){ + D_80367684 = 0; + D_80367688 = 0; + D_8036768C = 0; + D_80367690 = 0; + D_80367694 = 0; + D_80367698 = 0; + D_8036769C = 0; + D_803676A0 = 0; +} + +void func_802D6388(void){ + timedFunc_set_0(5.0f, func_802D6114); + func_802BBC58(1); + set_camera_to_node(D_80367688); + D_8037DE08 = 0.5f; +} + +void func_802D63D4(void){ + f32 sp1C[3]; + + if(D_80367684 == 0) + return; + + if(map_get() != D_80367684) + return; + + func_80347A14(0); + switch(D_8036768C){ + case 0x15: //L802D6430 + func_802D6388(); + break; + case 0x2D: //L802D6440 + func_802D6388(); + func_802BAEF4(sp1C); + func_8028F85C(sp1C); + break; + default: //L802D6460 + func_802BAFE4(D_80367688); + timedFuncQueue_update(); + func_803204E4(0xbf, 0); + func_802D6750(); + break; + } +} + + +void func_802D6494(void){ + if( (!D_80367684 || (D_80367684 && (map_get() == D_80367684))) + ){ + switch(D_803676A0){ + case ACTOR_2E5_WOODEN_DOOR: + break; + case ACTOR_20E_MM_ENTRANCE_DOOR:// L802D6510 + FUNC_8030E624(SFX_6B_LOCKUP_OPENING, 0.6f, 32000); + func_8025A6CC(COMUSIC_64_WORLD_OPENING_A, 32000); + break; + case ACTOR_211_CHEST_LID:// L802D6530 + FUNC_8030E624(SFX_6B_LOCKUP_OPENING, 0.6f, 32000); + func_8025A6CC(COMUSIC_64_WORLD_OPENING_A, 32000); + break; + case ACTOR_212_IRON_BARS:// L802D6550 + if(map_get() == MAP_70_GL_CC_LOBBY && !func_803203FC(UNKFLAGS1_7F_SANDCASTLE_OPEN_CC)){ + func_802D4830(func_80326EEC(ACTOR_212_IRON_BARS), SFX_9A_MECHANICAL_CLOSING, 0.5f); + func_8025A6CC(COMUSIC_64_WORLD_OPENING_A, 32000); + } + break; + case ACTOR_234_CCW_ENTRANCE_DOOR:// L802D65A0 + if(map_get() == MAP_79_GL_CCW_LOBBY && !func_803203FC(UNKFLAGS1_93_SANDCASTLE_OPEN_CCW)){ + func_802D485C(func_80326EEC(ACTOR_234_CCW_ENTRANCE_DOOR), SFX_3EC_CCW_DOOR_OPENING, 0.8f, 15000); + func_8025A6CC(COMUSIC_64_WORLD_OPENING_A, 32000); + } + break; + case ACTOR_210_BGS_ENTRANCE_DOOR:// L802D65F8 + if(!func_803203FC(0x84)){ + FUNC_8030E624(SFX_6B_LOCKUP_OPENING, 0.6f, 32000); + func_8025A6CC(COMUSIC_64_WORLD_OPENING_A, 32000); + } + break; + case ACTOR_235_FP_ENTANCE_DOOR:// L802D6624 + if(map_get() == MAP_6F_GL_FP_LOBBY && !func_803203FC(UNKFLAGS1_8B_SANDCASTLE_OPEN_FP)){ + func_802D4830(func_80326EEC(ACTOR_235_FP_ENTANCE_DOOR), SFX_18_BIGBUTT_SLIDE, 0.5f); + func_8025A6CC(COMUSIC_64_WORLD_OPENING_A, 32000); + } + break; + case ACTOR_226_GV_ENTRANCE:// L802D6674 + if(map_get() == MAP_6E_GL_GV_LOBBY && !func_803203FC(UNKFLAGS1_87_SANDCASTLE_OPEN_GV)){ + func_802D485C(func_80326EEC(ACTOR_226_GV_ENTRANCE), SFX_3EC_CCW_DOOR_OPENING, 0.8f, 15000); + func_8025A6CC(COMUSIC_64_WORLD_OPENING_A, 32000); + } + break; + case ACTOR_228_INVISIBLE_WALL:// L802D66CC + if(!func_803203FC(UNKFLAGS1_8C_SANDCASTLE_OPEN_MMM)){ + FUNC_8030E624(SFX_6B_LOCKUP_OPENING, 0.6f, 32000); + func_8025A6CC(COMUSIC_64_WORLD_OPENING_A, 32000); + } + break; + case ACTOR_20F_RBB_ENTRANCE_DOOR:// L802D66F8 + if(map_get() == MAP_77_GL_RBB_LOBBY && !func_803203FC(UNKFLAGS1_90_SANDCASTLE_OPEN_RBB)){ + func_802D4830(func_80326EEC(ACTOR_20F_RBB_ENTRANCE_DOOR), SFX_9A_MECHANICAL_CLOSING, 0.5f); + func_8025A6CC(COMUSIC_64_WORLD_OPENING_A, 32000); + } + break; + } + } +} + +void func_802D6750(void){ + timedFunc_set_0(0.4f, func_802D6494); +} + +enum map_e func_802D677C(enum map_e arg0){ + s32 out; + if(arg0 == -1) + return D_80367684; + out = D_80367684; + D_80367684 = arg0; + return out; +} + +s32 func_802D67AC(s32 arg0){ + s32 out; + if(arg0 == -1) + return D_8036768C; + out = D_8036768C; + D_8036768C = arg0; + return out; +} + +enum actor_e func_802D67DC(enum actor_e arg0){ + s32 out; + if(arg0 == -1) + return D_803676A0; + out = D_803676A0; + D_803676A0 = arg0; + return out; +} + +s32 func_802D680C(s32 arg0){ + s32 out; + if(arg0 == -1) + return D_80367690; + out = D_80367690; + D_80367690 = arg0; + return out; +} + +s32 func_802D683C(s32 arg0){ + s32 out; + if(arg0 == -1) + return D_80367688; + out = D_80367688; + D_80367688 = arg0; + return out; +} + +int func_802D686C(void){ + if(func_803203FC(0x1E)){ + return FALSE; + } + return map_get() == D_80367684; +} + +int func_802D68B4(void){ + return func_802D686C() || func_803203FC(0x21); +} + +//BREAK???? + +//set_hourglass_timer_seconds +void func_802D68F0(s32 seconds){ + item_set(ITEM_0_HOURGLASS_TIMER, seconds*60 - 1); +} + +//hide_hourglass_timer +void func_802D6924(void){ + item_set(ITEM_6_HOURGLASS, 0); +} + +//update_has_entered_level_flags +void func_802D6948(void){ + switch(map_get()){ + case MAP_2_MM_MUMBOS_MOUNTAIN: + func_80320004(BKPROG_B0_HAS_ENTERED_MM, TRUE); + break; + case MAP_7_TTC_TREASURE_TROVE_COVE: + func_80320004(BKPROG_B2_HAS_ENTERED_TTC, TRUE); + break; + case MAP_B_CC_CLANKERS_CAVERN: + func_80320004(BKPROG_B8_HAS_ENTERED_CC, TRUE); + break; + case MAP_D_BGS_BUBBLEGLOOP_SWAMP: + func_80320004(BKPROG_B1_HAS_ENTERED_BGS, TRUE); + break; + case MAP_12_GV_GOBIS_VALLEY: + func_80320004(BKPROG_B3_HAS_ENTERED_GV, TRUE); + break; + case MAP_1B_MMM_MAD_MONSTER_MANSION: + func_80320004(BKPROG_B7_HAS_ENTERED_MMM, TRUE); + break; + case MAP_27_FP_FREEZEEZY_PEAK: + func_80320004(BKPROG_B6_HAS_ENTERED_FP, TRUE); + break; + case MAP_31_RBB_RUSTY_BUCKET_BAY: + func_80320004(BKPROG_B4_HAS_ENTERED_RBB, TRUE); + break; + case MAP_40_CCW_HUB: + func_80320004(BKPROG_B5_HAS_ENTERED_CCW, TRUE); + break; + } +} + +//has entered map and level +int func_802D6A38(enum map_e map_id){ + switch(map_id){ + case MAP_2_MM_MUMBOS_MOUNTAIN: + return func_8031FF1C(BKPROG_B0_HAS_ENTERED_MM); + case MAP_7_TTC_TREASURE_TROVE_COVE: + return func_8031FF1C(BKPROG_B2_HAS_ENTERED_TTC); + case MAP_B_CC_CLANKERS_CAVERN: + return func_8031FF1C(BKPROG_B8_HAS_ENTERED_CC); + case MAP_D_BGS_BUBBLEGLOOP_SWAMP: + return func_8031FF1C(BKPROG_B1_HAS_ENTERED_BGS); + case MAP_12_GV_GOBIS_VALLEY: + return func_8031FF1C(BKPROG_B3_HAS_ENTERED_GV); + case MAP_1B_MMM_MAD_MONSTER_MANSION: + return func_8031FF1C(BKPROG_B7_HAS_ENTERED_MMM); + case MAP_27_FP_FREEZEEZY_PEAK: + return func_8031FF1C(BKPROG_B6_HAS_ENTERED_FP); + case MAP_31_RBB_RUSTY_BUCKET_BAY: + return func_8031FF1C(BKPROG_B4_HAS_ENTERED_RBB); + case MAP_40_CCW_HUB: + return func_8031FF1C(BKPROG_B5_HAS_ENTERED_CCW); + } + return FALSE; +} diff --git a/src/core2/code_50490.c b/src/core2/code_50490.c new file mode 100644 index 00000000..f9b574e5 --- /dev/null +++ b/src/core2/code_50490.c @@ -0,0 +1,109 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802EE6CC(f32[3], f32[3], s32[4], s32, f32, f32, s32, s32, s32); +extern void func_802EE5E8(void *); + +typedef struct{ + s32 unk0; +}ActorLocal_core2_50490; + +Actor *func_802D745C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_802D766C(Actor *this); + +/* .data */ +f32 D_80367A80 = 0.5f; +f32 D_80367A84 = 30.0f; +f32 D_80367A88 = 150.0f; +f32 D_80367A8C = 25.0f; +s32 D_80367A90[4] = {250, 250, 250, 120}; +s32 D_80367AA0 = 0; +f32 D_80367AA4[3] = {0.0f, 0.0f, 0.0f}; + +ActorInfo D_80367AB0 = { + 0x57, 0x4C, 0x0, + 0, NULL, + func_802D766C, func_80326224, func_802D745C, + 0, 0, 0.0f, 0 +}; +ActorInfo D_80367AD4 = { + 0x57, 0x4D, 0x0, + 0, NULL, + func_802D766C, func_80326224, func_802D745C, + 0, 0, 0.0f, 0 +}; +ActorInfo D_80367AF8 = { + 0x57, 0x58, 0x0, + 0, NULL, + func_802D766C, func_80326224, func_802D745C, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_802D7420(Actor *this){ + ActorLocal_core2_50490 * local = (ActorLocal_core2_50490 *)&this->local; + + if(local->unk0 != NULL){ + func_802EE5E8(local->unk0); + } + local->unk0 = NULL; +} + +Actor *func_802D745C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + return marker_getActor(marker); +} + +#ifdef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_50490/func_802D7484.s") +#else +Actor *func_802D7484(s32 position[3], s32 yaw, ActorInfo *arg2, u32 arg3) { + s32 sp3C; + ActorLocal_core2_50490 * local; + Actor *sp34; + + sp3C = func_802EE5E0(D_80367AA0); + sp34 = actor_new(position, yaw, arg2, arg3); + func_802EE6CC(sp34->position, D_80367AA4, D_80367A90, 0, D_80367A80, D_80367A84, D_80367A88, D_80367A8C, D_80367AA0); + local = (ActorLocal_core2_50490 *)&sp34->local; + local->unk0 = sp3C; + sp34->marker->collidable = FALSE; + return sp34; +} +#endif + +Actor * func_802D7558(s32 *arg0, s32 arg1, ActorInfo *arg2, u32 arg3) { + D_80367A80 = 1.2f; + D_80367A84 = 30.0f; + D_80367A88 = 800.0f; + D_80367A8C = 200.0f; + return func_802D7484(arg0, arg1, arg2, arg3); +} + +Actor * func_802D75B4(s32 *arg0, s32 arg1, ActorInfo *arg2, u32 arg3) { + D_80367A80 = 1.2f; + D_80367A84 = 30.0f; + D_80367A88 = 800.0f; + D_80367A8C = 200.0f; + return func_802D7484(arg0, arg1, arg2, arg3); +} + +Actor * func_802D7610(s32 *arg0, s32 arg1, ActorInfo *arg2, u32 arg3) { + D_80367A80 = 0.75f; + D_80367A84 = 30.0f; + D_80367A88 = 600.0f; + D_80367A8C = 200.0f; + return func_802D7484(arg0, arg1, arg2, arg3); +} + +void func_802D766C(Actor *this) { + ActorLocal_core2_50490 * local = (ActorLocal_core2_50490 *)&this->local; + if (!this->initialized) { + func_803300D8(this->marker, func_802D7420); + this->initialized = TRUE; + } + if (func_802EE5F0(local->unk0) == 0) { + func_802D7420(this); + marker_despawn(this->marker); + } +} diff --git a/src/core2/code_509D0.c b/src/core2/code_509D0.c new file mode 100644 index 00000000..3c5b3074 --- /dev/null +++ b/src/core2/code_509D0.c @@ -0,0 +1,376 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8028F7D4(f32, f32); +void func_802D8528(Actor *this); +extern void func_80329904(ActorMarker *, s32, f32*); +extern ActorMarker *func_8028E86C(void); +extern void func_803252D0(f32, s32); +extern void func_8035646C(s32); + +extern ActorAnimationInfo D_80367B50[]; + + +extern ActorInfo D_80367B80 = { + MARKER_36_ORANGE_COLLECTABLE, ACTOR_29_ORANGE_COLLECTABLE, ASSET_2D2_MODEL_ORANGE, + 0x5, NULL, + func_802D8528, func_80326224, func_80325888, + 0, 0, 0.6f,0 +}; + +extern ActorInfo D_80367BA4 = { + MARKER_37_GOLD_BULLION, ACTOR_2A_GOLD_BULLION, ASSET_3C7_MODEL_GOLD_BULLION, + 0x5, NULL, + func_802D8528, func_80326224, func_80325888, + 0, 0, 0.6f, 0 +}; + +extern ActorInfo D_80367BC8 = { + MARKER_1FD_BLUE_PRESENT_COLLECTABLE, ACTOR_1ED_BLUE_PRESENT_COLLECTABLE, ASSET_47F_MODEL_XMAS_GIFT_BLUE, + 0x5, D_80367B50, + func_802D8528, func_80326224, func_80325888, + 0, 0, 1.8f, 0 +}; + +extern ActorInfo D_80367BEC = { + MARKER_1FE_GREEN_PRESENT_COLLECTABLE, ACTOR_1EF_GREEN_PRESENT_COLLECTABLE, ASSET_480_MODEL_XMAS_GIFT_GREEN, + 0x5, D_80367B50, + func_802D8528, func_80326224, func_80325888, + 0, 0, 1.4f, 0 +}; + +extern ActorInfo D_80367C10 = { + MARKER_1FF_RED_PRESENT_COLLECTABLE, ACTOR_1F1_RED_PRESENT_COLLECTABLE, ASSET_481_MODEL_XMAS_GIFT_RED, + 0x5, D_80367B50, + func_802D8528, func_80326224, func_80325888, + 0, 0, 1.4f, 0 +}; +extern struct31s D_80367C34; + +extern f32 D_80376D60; +extern f32 D_80376D64; +extern f32 D_80376D68; +extern f32 D_80376D6C; + +/* .code */ +void func_802D7960(f32 position[3], enum asset_e sprite_id) { + ParticleEmitter *p_emitter; + + p_emitter = partEmitList_pushNew(1); + particleEmitter_setSprite(p_emitter, sprite_id); + particleEmitter_setStartingFrameRange(p_emitter, 0, 7); + particleEmitter_setPosition(p_emitter, position); + particleEmitter_setParticleSpawnPositionRange(p_emitter, -40.0f, 0.0f, -40.0f, 40.0f, 60.0f, 40.0f); + particleEmitter_setParticleAccelerationRange(p_emitter, 0.0f, -1000.0f, 0.0f, 0.0f, -1000.0f, 0.0f); + func_802EFB98(p_emitter, &D_80367C34); + particleEmitter_emitN(p_emitter, 1); +} + +void func_802D7A40(f32 position[3], enum asset_e sprite_id) { + ParticleEmitter *p_emitter; + + p_emitter = partEmitList_pushNew(8); + particleEmitter_setSprite(p_emitter, sprite_id); + particleEmitter_setPosition(p_emitter, position); + particleEmitter_setParticleAccelerationRange(p_emitter, 0.0f, -250.0f, 0.0f, 0.0f, -250.0f, 0.0f); + particleEmitter_setParticleVelocityRange(p_emitter, -100.0f, 200.0f, -100.0f, 100.0f, 350.0f, 100.0f); + func_802EFE24(p_emitter, 0.0f, 0.0f, 200.0f, 0.0f, 0.0f, 240.0f); + func_802EFB70(p_emitter, 0.47f, 0.47f); + func_802EFB84(p_emitter, 0.03f, 0.03f); + func_802EFA5C(p_emitter, 0.4f, 0.8f); + func_802EFEC0(p_emitter, 0.9f, 0.9f); + particleEmitter_emitN(p_emitter, 8); +} + +s32 func_802D7B94(ActorMarker *marker, enum asset_e text_id, s32 arg2) { + return -(levelSpecificFlags_get(0x2A) + levelSpecificFlags_get(0x2B) + levelSpecificFlags_get(0x2C)); +} + + +void func_802D7BE8(enum asset_e text_id){ + func_80311174(text_id, 0, NULL, NULL, NULL, NULL, func_802D7B94); +} + +void func_802D7C24(ActorMarker *marker, ActorMarker *other_marker) { + Actor *this; + f32 pad28; + s32 var_a3; + f32 sp18[3]; + + this = marker_getActor(marker); + var_a3 = 0; + if ((this->state == 1) || (this->state == 2)) { + sp18[0] = this->position[0]; + sp18[1] = this->position[1]; + sp18[2] = this->position[2]; + switch (marker->unk14_20) { + case MARKER_36_ORANGE_COLLECTABLE: + if (mapSpecificFlags_get(1)) + return; + func_8035646C(8); + func_8030E6D4(SFX_B3_ORANGE_TALKING); + var_a3 = 0; + break; + + case MARKER_37_GOLD_BULLION: + func_8025A6EC(COMUSIC_2B_DING_B, 0x7FFF); + timedFunc_set_1(0.5f, func_8035646C, 9); + var_a3 = 0; + break; + + case MARKER_1FD_BLUE_PRESENT_COLLECTABLE: + levelSpecificFlags_set(0x2A, 1); + func_8025A6EC(COMUSIC_2B_DING_B, 0x7FFF); + func_802D7A40(this->position, ASSET_711_SPRITE_SPARKLE_DARK_BLUE); + var_a3 = 0xC20; + break; + + case MARKER_1FE_GREEN_PRESENT_COLLECTABLE: + levelSpecificFlags_set(0x2B, 1); + func_8025A6EC(COMUSIC_2B_DING_B, 0x7FFF); + func_802D7A40(this->position, 0x712); + var_a3 = 0xC21; + break; + + case MARKER_1FF_RED_PRESENT_COLLECTABLE: + levelSpecificFlags_set(0x2C, 1); + func_8025A6EC(COMUSIC_2B_DING_B, 0x7FFF); + func_802D7A40(this->position, ASSET_715_SPRITE_SPARKLE_RED); + var_a3 = 0xC22; + break; + + default: + break; + } + if (var_a3 != 0) { + timedFunc_set_1(0.5f, (TFQM1)func_802D7BE8, var_a3); + } + func_8028F030(this->modelCacheIndex); + marker_despawn(marker); + } +} + +void func_802D7DE8(ActorMarker *marker, f32 arg1[3]) { + Actor *this; + s32 sp50[3]; + s32 sp4C; + f32 var_f12; + f32 var_f14; + f32 var_f18; + + sp4C = marker->unk14_20; + this = marker_getActor(marker); + ml_vec3f_to_vec3w(sp50, arg1); + if (sp4C == 0x37) { + if (mapSpecificFlags_get(0)) { + mapSpecificFlags_set(1, TRUE); + } else { + mapSpecificFlags_set(0, TRUE); + } + } + func_8028F010(this->modelCacheIndex); + func_80328A84(this, 4); + var_f12 = this->position[1]; + var_f14 = 28.0f; + var_f18 = 0.0f; + this->unk1C[0] = arg1[0]; + this->unk1C[1] = arg1[1]; + this->unk1C[2] = arg1[2]; + this->velocity[0] = (f32) sp50[0] - this->position[0]; + this->velocity[1] = 28.0f; + this->velocity[2] = (f32) sp50[2] - this->position[2]; + while (!(var_f12 < sp50[1]) || !(var_f14 < 0.0f)) { + var_f18 += 1.0f; + var_f12 += (var_f14 -= 5.0); + } + this->velocity[0] /= var_f18; + this->velocity[2] /= var_f18; + this->unk38_31 = (u32)var_f18; +} + +void func_802D8030(Actor *this){ + s32 *local; + + local = (s32*)&this->local; + *local = 1; + this->marker->unkC = func_802D7C24; + func_80328A84(this, 2); +} + +void func_802D8068(Actor *this) { + s32 *local; + f32 sp20; + + local = (s32*)&this->local; + if( (this->marker->unk14_20 != MARKER_36_ORANGE_COLLECTABLE) + || (this->unk78_13 == 0) + ) { + this->position[0] += this->velocity[0]; + this->position[1] += (this->velocity[1] -= 5.0); + this->position[2] += this->velocity[2]; + } + if (--this->unk38_31 < 4) { + sp20 = this->unk1C[1]; + } else { + sp20 = this->position[1]; + } + if (this->position[1] < sp20) { + if (this->modelCacheIndex == ACTOR_2A_GOLD_BULLION) { + func_8025A6EC(COMUSIC_2B_DING_B, 32000); + if (mapSpecificFlags_get(1)) { + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 32000); + } + } + this->position[1] = sp20; + if (this->marker->unk14_20 != MARKER_36_ORANGE_COLLECTABLE) { + FUNC_8030E8B4(SFX_21_EGG_BOUNCE_1, 0.76f, 25000, this->position, 1000, 2000); + } else { + FUNC_8030E8B4(SFX_B3_ORANGE_TALKING, 1.0f, 25000, this->position, 1000, 2000); + } + if (this->state == 4) { + switch (this->marker->unk14_20) { + case MARKER_37_GOLD_BULLION: + break; + case MARKER_36_ORANGE_COLLECTABLE: + func_803252D0(1.7f, 2); + func_8025A6EC(COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x7FFF); + break; + case MARKER_1FD_BLUE_PRESENT_COLLECTABLE: + func_8025A6EC(COMUSIC_2B_DING_B, 32000); + levelSpecificFlags_set(0x11, 1); + break; + case MARKER_1FE_GREEN_PRESENT_COLLECTABLE: + func_8025A6EC(COMUSIC_2B_DING_B, 32000); + levelSpecificFlags_set(0x12, 1); + break; + case MARKER_1FF_RED_PRESENT_COLLECTABLE: + func_8025A6EC(COMUSIC_2B_DING_B, 32000); + levelSpecificFlags_set(0x13, 1); + break; + } + } + this->unk138_22 = this->unk138_21 = 0; + func_80328A84(this, 2); + } + switch (this->marker->unk14_20) { + case MARKER_1FD_BLUE_PRESENT_COLLECTABLE: + func_802D7960(this->position, ASSET_711_SPRITE_SPARKLE_DARK_BLUE); + break; + case MARKER_1FE_GREEN_PRESENT_COLLECTABLE: + func_802D7960(this->position, 0x712); + break; + case MARKER_1FF_RED_PRESENT_COLLECTABLE: + func_802D7960(this->position, ASSET_715_SPRITE_SPARKLE_RED); + break; + } + + if (*local != 0) { + *local = 0; + } +} + +void func_802D8374(Actor *this){ + s32 pad2C; + f32 sp20[3]; + + if(func_8028E86C() != this->marker){ + func_8028F050(this->modelCacheIndex); + marker_despawn(this->marker); + } + else{ + if(this->unk138_21){ + func_8028EF28(sp20); + func_802D7DE8(this->marker, sp20); + } + } +} + +void func_802D83EC(Actor *this) { + s32 var_s0; + + // temp_f20 = D_80376D70; + for(var_s0 = 0; var_s0 < 10; var_s0++){ + if (randf() < 0.03) { + func_8033E73C(this->marker, var_s0 + 5, func_80329904); + func_8033E3F0(8, this->marker->unk14_21); + } + } + this->yaw = this->yaw + time_getDelta() * 25.0f; + if (360.0 < this->yaw) { + this->yaw -= 360.0; + } + if (mapSpecificFlags_get(0x1F)) { + marker_despawn(this->marker); + } +} + +void func_802D84F4(Actor *this){ + this->marker->propPtr->unk8_3 = ( this->state == 2 ); +} + +void func_802D8528(Actor *this){ + s32 marker_id; + if(this->despawn_flag) return; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + if( this->marker->unk14_20 == MARKER_1FD_BLUE_PRESENT_COLLECTABLE + || this->marker->unk14_20 == MARKER_1FE_GREEN_PRESENT_COLLECTABLE + || this->marker->unk14_20 == MARKER_1FF_RED_PRESENT_COLLECTABLE + ){ + if(jiggyscore_isCollected(JIGGY_2E_FP_PRESENTS)){ + marker_despawn(this->marker); + return; + } + } + if(this->unk138_22){ + func_8028F7D4(0.0f, 0.0f); + func_80328A84(this, 3); + } + }//L802D85DC + + switch(this->state){ + case 5:// 802D8604 + func_802D8030(this); + break; + + case 1:// 802D8620 + func_802D8068(this); + break; + + case 2:// 802D863C + break; + + case 3:// 802D8650 + func_802D8374(this); + break; + + case 4:// 802D866C + func_802D8068(this); + break; + + default: + break; + } + + marker_id = this->marker->unk14_20; + + switch(this->marker->unk14_20){ + + case MARKER_37_GOLD_BULLION: //L802D86CC + func_802D83EC(this); + break; + case MARKER_36_ORANGE_COLLECTABLE: //L802D86DC + if(mapSpecificFlags_get(3) && map_get() == MAP_2_MM_MUMBOS_MOUNTAIN){ + marker_despawn(this->marker); + } + break; + + case MARKER_1FD_BLUE_PRESENT_COLLECTABLE: + case MARKER_1FE_GREEN_PRESENT_COLLECTABLE: + case MARKER_1FF_RED_PRESENT_COLLECTABLE: + func_802D84F4(this); + break; + } +} diff --git a/src/core2/code_517A0.c b/src/core2/code_517A0.c new file mode 100644 index 00000000..4d45c5a9 --- /dev/null +++ b/src/core2/code_517A0.c @@ -0,0 +1,53 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_8028EF88(void); +void func_802D8730(Actor *this); + +/* .data */ +ActorInfo D_80367C60 = { + 0x15E, 0x188, 0x0, + 0, NULL, + func_802D8730, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; + +s32 D_80367C84[3] = {255, 100, 100}; + +/* .code */ +void func_802D8730(Actor *this) { + f32 sp3C; + f32 sp38; + ParticleEmitter *pCtrl; + + sp3C = time_getDelta(); + if (!func_8032BBE8(this)) { + this->velocity_y = 0.0f; + this->velocity_x = 1.0f; + } else { + this->velocity_x -= sp3C; + } + if (this->velocity_x < 0.0f) { + marker_despawn(this->marker); + return; + } + + sp38 = func_8028EF88(); + player_getPosition(this->position); + if(sp38 < this->position_y) + return; + + func_8024E3A8(this->position, 40.0f); + this->position_y = sp38; + this->velocity_y -= sp3C; + if (this->velocity_y < 0.0f) { + this->velocity_y = 0.07f; + pCtrl = func_802F4094(this->position, 40.0f); + func_802EFB70(pCtrl, 0.05f, 0.06f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -3400.0f, 0.0f, 0.0f, -3400.0f, 0.0f); + func_802EFFA8(pCtrl, D_80367C84); + particleEmitter_setParticleVelocityRange(pCtrl, -180.0f, 200.0f, -180.0f, 180.0f, 400.0f, 180.0f); + particleEmitter_emitN(pCtrl, 9); + } +} diff --git a/src/core2/code_51950.c b/src/core2/code_51950.c new file mode 100644 index 00000000..ec08e281 --- /dev/null +++ b/src/core2/code_51950.c @@ -0,0 +1,93 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_8028EBA4(void); + +void func_802D88E0(Actor *this); + +/* .data */ +ActorInfo D_80367C90 = { + 0x100, 0x1FF, 0x580, + 0x0, NULL, + func_802D88E0, func_80326224, func_80325934, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80367CB4 = { + 0x101, 0x200, 0x6D1, + 0x0, NULL, + func_802D88E0, func_80326224, func_80325934, + 0, 0, 0.0f, 0 +}; + +struct31s D_80367CD8 = { + {0.24f, 0.2f}, + {0.01f, 0.01f}, + {0.0f, 0.0f}, + {0.25f, 0.25f}, + 0.0f, + 0.3f +}; + +/* .code */ +void func_802D88E0(Actor *this) { + int i; + s32 temp_f10; + f32 sp5C[3]; + ParticleEmitter *pCtrl; + + actor_collisionOff(this); + func_80329054(this, 3); + + if (this->unk1C[1] > -100.0f) { + this->unk1C[1] -= 3.5; + } + + if (this->position_y > -16000.0f) { + this->position_y += this->unk1C[1]; + } + if (this->unk60 > 0.5) { + pCtrl = partEmitList_pushNew(1U); + for(i = 0; i < 3; i++){ + sp5C[i] = this->position[i] + (randf()*2)*25 - ((i == 1) ? 0 : 25); + } + particleEmitter_setPosition(pCtrl, &sp5C); + particleEmitter_setSprite(pCtrl, (this->modelCacheIndex == 0x1FF) ? ASSET_715_SPRITE_SPARKLE_RED : ASSET_713_SPRITE_SPARKLE_YELLOW); + particleEmitter_setStartingFrameRange(pCtrl, 0, 0); + func_802EFB98(pCtrl, &D_80367CD8); + func_802EFF50(pCtrl, 1.0f); + particleEmitter_setSpawnInterval(pCtrl, 0.25f); + } + this->unk60 -= time_getDelta(); + if (this->unk60 < 0.0f) { + marker_despawn(this->marker); + return; + } + + temp_f10 = (s32) ml_map_f(this->unk60, 0.0f, 0.3f, 0.0f, 255.0f); + actor_setOpacity(this, temp_f10); + if (temp_f10 == 0) { + marker_despawn(this->marker); + } +} + +void func_802D8B20(enum actor_e actor_id){ + Actor *feather; + f32 plyr_pos[3]; + s32 temp_v0; + f32 temp2; + + player_getPosition(plyr_pos); + temp2 = func_8028EBA4(); + temp_v0 = (randf() > 0.5) ? 0x1E : -0x1E; + feather = func_8032813C(actor_id, plyr_pos, (s32) (temp2 + temp_v0)); + func_8032AA58(feather, 0.45f); + feather->unk28 = 22.0f; + feather->unk1C[1] = 48.0f; + feather->unk60 = 1.2f; +} + +void func_802D8BE4(bool gold_feather){ + func_802C3C88(func_802D8B20, (!gold_feather) ? 0x1FF : 0x200); +} \ No newline at end of file diff --git a/src/core2/code_51C90.c b/src/core2/code_51C90.c new file mode 100644 index 00000000..55f2f392 --- /dev/null +++ b/src/core2/code_51C90.c @@ -0,0 +1,184 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern void actor_setOpacity(Actor*,s32); +extern void func_8035644C(u32); + +bool func_802D8D48(Actor*, u32, enum asset_e, enum comusic_e, enum item_e, f32); +Actor *func_802D8F50(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3); +void func_802D9018(Actor *this); + +/* .data */ +extern ActorInfo D_80367D00 = { + 0x60, 0x52, 0x36D, + 0, NULL, + func_802D9018, func_80326224, func_802D8F50, + 0, 0, 0.7f, 0 +}; + +extern ActorInfo D_80367D24 = { + 0xB5, 0x129, 0x580, + 0, NULL, + func_802D9018, func_80326224, func_802D8F50, + 0, 0, 0.5f, 0 +}; + +extern ActorInfo D_80367D48 = { + 0x1E5, 0x370, 0x6D1, + 0, NULL, + func_802D9018, func_80326224, func_802D8F50, + 0, 0, 0.5f, 0 +}; + +/* .code */ +void func_802D8C20(Actor *arg0, u32 arg1){ + switch(arg1){ + default: + break; + case 1: + arg0->unk28 = 0.0f; + //fall-through + case 3: + actor_collisionOff(arg0); + break; + case 2: + actor_collisionOn(arg0); + break; + } + func_80328A84(arg0, arg1); +} + +void func_802D8C98(Actor *this, s32 arg1) { + s32 phi_v0; + + switch (this->marker->unk14_20) + { + case 0x60: + phi_v0 = TRUE; + break; + + case 0xB5: + phi_v0 = (arg1 == 1) || (arg1 == 2) || (arg1 == 3); + break; + + case 0x1e5: + phi_v0 = TRUE; + break; + + default: + phi_v0 = FALSE; + break; + } + + this->unk10_12 = arg1; + func_802D8C20(this, (phi_v0 ) ? 2 : 3); +} + +//collectItem +bool func_802D8D48(Actor* actor, u32 arg1, enum asset_e dialogId, enum comusic_e sfxId, enum item_e itemId, f32 arg5){ + func_8025A6EC(sfxId,32000); + timedFunc_set_1(0.75f, (TFQM1)func_8035644C, arg1); + if(!func_802FADD4(0x1b)){ + item_inc(itemId); + } else { + func_803463F4(itemId,1); + } + + if(!actor || !actor->unk38_0) + return TRUE; + + actor->unk60 = arg5; + func_802D8C20(actor, 1); + return FALSE; +} + +//egg_collision +s32 collect_egg(ActorProp *arg0){ + Actor *actPtr = NULL; + if(arg0 != NULL){ + func_802F3808(&arg0->x); + if(arg0->unk8_0) + actPtr = marker_getActor(arg0->marker); + } + func_802D8D48(actPtr, 5, 0xD9E, COMUSIC_C_EGG_COLLECTED, 0xD, 2.0f); +} + +//readFeather_collision +void func_802D8E68(ActorProp *arg0){ + Actor *actPtr = NULL; + func_802F38F0(&arg0->x); + if(arg0->unk8_0) + actPtr = marker_getActor(arg0->marker); + func_802D8D48(actPtr, 6, 0xD9F, COMUSIC_B_RED_FEATHER_COLLECTED, 0xF, 4.0f); +} + +//goldFeather_collision +void func_802D8EDC(ActorProp *arg0){ + Actor *actPtr = NULL; + func_802F39D8(&arg0->x); + if(arg0->unk8_0) + actPtr = marker_getActor(arg0->marker); + func_802D8D48(actPtr, 7, 0xDA0, COMUSIC_14_GOLD_FEATHER_COLLECTED, ITEM_10_GOLD_FEATHER, 6.0f); +} + +Actor *func_802D8F50(ActorMarker *this, Gfx **gdl, Mtx **mptr, Vtx **arg3){ + Actor *thisActor = marker_getActor(this); + + if(thisActor->unk28 != 0.0f){ + if(thisActor->unk38_0){ + func_80344C2C(1); + if(thisActor->unk28 == 255.0f){ + func_803262B8(thisActor); + } else{ + actor_setOpacity(thisActor, thisActor->unk28); + } + } + return func_80325934(this, gdl, mptr, arg3); + } + return thisActor; +} + +void func_802D9018(Actor *this) { + f32 temp_f0; + f32 temp_f0_2; + f32 temp_f2; + u32 temp_v0; + + if (!this->initialized) { + if (this->marker->unk14_20 != 0x60) { + func_8032AA58(this, 0.56f); + } + this->unk10_12 = -1; + this->unk38_0 = (map_get() == MAP_90_GL_BATTLEMENTS); + this->unk28 = this->unk38_0 ? 0.0f: 255.0f; + this->initialized = TRUE; + } + if(!this->unk38_0) + return; + + if (func_80320424(0x23, 3) != this->unk10_12) { + func_802D8C98(this, func_80320424(0x23, 3)); + } + + switch (this->state) { + case 1: + if (this->unk60 > 0.0) { + this->unk60 -= time_getDelta(); + } else { + func_802D8C20(this, 2); + } + /* fallthrough */ + case 3: + if (this->unk28 > 0) { + this->unk28 = MAX(this->unk28 - 8, 0); + } + break; + case 2: + if (this->unk28 < 255) { + this->unk28 = MIN(this->unk28 + 8, 255); + } + break; + } +} diff --git a/src/core2/code_53A10.c b/src/core2/code_53A10.c new file mode 100644 index 00000000..7eb5e3d9 --- /dev/null +++ b/src/core2/code_53A10.c @@ -0,0 +1,84 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_802DAA14(Actor *this); +/* .data */ +//000E0EE0 +ActorInfo D_80367E70= { + 0x21B, 0x351, 0, + 0, NULL, + func_802DAA14, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; +//000E0F00 + +/* .code */ +void func_802DA9A0(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + s32 flag; + s32 tmp; + if(level_get() == LEVEL_A_MAD_MONSTER_MANSION){ + flag = BKPROG_15_ENTER_MMM_TEXT; + } + else{ + if(map_get() == MAP_69_GL_MM_LOBBY) + tmp = BKPROG_97_ENTERED_LAIR_TEXT; + else + tmp = BKPROG_98_EXITED_LEVEL_TEXT; + flag = tmp; + } + func_80320004(flag, 1); + FUNC_8030E624(SFX_EA_GRUNTY_LAUGH_1, 1.0f, 30000); +} + +void func_802DAA14(Actor *this){ + s32 flag; + s32 tmp; + s32 text_id; + + if(func_803203FC(1) || func_803203FC(0x1F)){ + marker_despawn(this->marker); + return; + } + + if(level_get() == LEVEL_A_MAD_MONSTER_MANSION){ + flag = BKPROG_15_ENTER_MMM_TEXT; + } + else{ + if(map_get() == MAP_69_GL_MM_LOBBY) + tmp = BKPROG_97_ENTERED_LAIR_TEXT; + else + tmp = BKPROG_98_EXITED_LEVEL_TEXT; + flag = tmp; + } + + if(func_8031FF1C(flag)){ + marker_despawn(this->marker); + return; + } + + if(!this->initialized){ + this->unk60 = 0.5f; + this->initialized = 1; + } + + if(0.0f < this->unk60){ + this->unk60 -= time_getDelta(); + return; + } + + if(!this->unk138_24){ + if(level_get() == LEVEL_A_MAD_MONSTER_MANSION){ + text_id = 0xadc; + } + else{ + if(map_get() == MAP_69_GL_MM_LOBBY) + tmp = 0xf66; + else + tmp = 0xf67; + text_id = tmp; + } + func_80311480(text_id, 4, NULL, this->marker, func_802DA9A0, NULL); + this->unk138_24 = TRUE; + } +} diff --git a/src/core2/code_53C10.c b/src/core2/code_53C10.c new file mode 100644 index 00000000..92854875 --- /dev/null +++ b/src/core2/code_53C10.c @@ -0,0 +1,389 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_80257248(f32[3], f32[3]); + +typedef struct { + f32 unk0; + f32 unk4; + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; + u32 unkC_31:3; + u32 unkC_28:1; + u32 padC_27:28; + s16 unk10; //sfx_id + s16 unk12; + f32 unk14; + f32 unk18; + s16 unk1C; //sfx_id + s16 unk1E; + f32 unk20; + f32 unk24; + s16 unk28; //sfx_id + s16 unk2A; + f32 unk2C; + void (*unk30)(ActorMarker *, ActorMarker *); + void (*unk34)(ActorMarker *, ActorMarker *); + s32 unk38; + f32 unk3C; +}ActorLocal_core2_53C10; + +/* .data */ +extern struct41s D_80367EA0; +extern struct41s D_80367ED0; +extern struct41s D_80367F00; + +/* .rodata */ + + +/* .code */ +void func_802DABA0(ParticleEmitter *pCtrl, f32 position[3], f32 scale, enum asset_e model_id) { + particleEmitter_setPosition(pCtrl, position); + func_802EFA70(pCtrl, 2); + func_802EF9F8(pCtrl, 0.7f); + func_802EFA18(pCtrl, 5); + func_802EFA20(pCtrl, 0.8f, 1.0f); + func_802EF9EC(pCtrl, 0x1F, 6000); + func_802EFB70(pCtrl, scale, scale); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 3.5f, 3.5f); + func_802EFA5C(pCtrl, 0.0f, 0.65f); + particleEmitter_setModel(pCtrl, model_id); +} + +void func_802DAC84(ParticleEmitter *pCtrl, Actor *this, enum asset_e model_id) { + particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_80367EA0); + func_802DABA0(pCtrl, this->position, this->scale, model_id); + func_802EFE24(pCtrl, -800.0f, -800.0f, -800.0f, 800.0f, 800.0f, 800.0f); + particleEmitter_emitN(pCtrl, 6); +} + + +void func_802DAD08(ParticleEmitter *pCtrl, Actor *this, enum asset_e model_id) { + particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_80367ED0); + func_802DABA0(pCtrl, this->position, this->scale, model_id); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_emitN(pCtrl, 1); +} + +void func_802DAD8C(ParticleEmitter *pCtrl, Actor *this, enum asset_e model_id) { + particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_80367F00); + func_802DABA0(pCtrl, this->position, this->scale, model_id); + func_802EFE24(pCtrl, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); + particleEmitter_emitN(pCtrl, 2); +} + +void func_802DAE10(Actor *this){ + ActorLocal_core2_53C10 *local; + + local = (ActorLocal_core2_53C10 *)&this->local; + this->unk28 = randf2(local->unk0, local->unk4); +} + +void func_802DAE40(Actor *this) { + + func_80328A84(this, 2); + func_802DAE10(this); + func_80328CEC(this, (s32) this->yaw_moving, (s32) (this->yaw + 160.0f) % 360, (s32) (this->yaw + 200.0f) % 360); + this->unk38_31 = 0x5A; +} + +void func_802DAF2C(f32 *arg0, f32 arg1, f32 arg2) { + f32 sp1C[3]; + + sp1C[0] = arg2; + sp1C[1] = 0.0f; + sp1C[2] = 0.0f; + ml_vec3f_yaw_rotate_copy(sp1C, sp1C, arg1 - 90.0); + arg0[0] += sp1C[0]; + arg0[1] += sp1C[1]; + arg0[2] += sp1C[2]; +} + +bool func_802DAFBC(Actor *this) { + ActorLocal_core2_53C10 *local; + s32 temp_v0; + f32 sp44; + f32 sp38[3]; + f32 sp34; + + local = (ActorLocal_core2_53C10 *)&this->local; + + sp44 = animctrl_getAnimTimer(this->animctrl) + 0.0333; + if (sp44 >= 1.0) { + sp44 -= 1.0; + } + + temp_v0 = func_8032CA80(this, 0x11); + if ((this->unk38_31 == 0) && this->unk38_0) { + this->unk38_0 = FALSE; + } + if ((temp_v0 == 0) || this->unk38_0) { + return FALSE; + } + if (temp_v0 & 4) { + func_8032C9E0(sp38); + sp34 = func_80257248(sp38, this->position); + if (((func_8023DB5C() - local->unk38) == 0x1E) && ((sp34 - this->yaw_moving < 15.0f) && (sp34 - this->yaw_moving > -15.0f))) { + func_802DAF2C(this->position, this->yaw, this->unk28); + } else { + func_80328CEC(this, (s32) sp34, 0, 0xF); + } + this->unk38_31 = 0x1E; + this->unk38_0 = TRUE; + local->unk38 = func_8023DB5C(); + } else if (temp_v0 & 8) { + func_802DAE10(this); + this->unk38_31 = 0x5A; + func_80328B8C(this, 2, sp44, 1); + func_80328CEC(this, (s32) this->yaw_moving, 0xB3, 0xB4); + this->unk38_0 = TRUE; + } else { + func_802DAE10(this); + this->unk38_31 = 0x5A; + func_80328B8C(this, 8, sp44, 1); + func_80328CEC(this, (s32) this->yaw_moving, 120, 180); + } + return TRUE; +} + +void func_802DB220(Actor *this) { + if (func_80329530(this, 900) && func_803292E0(this)) { + func_80328A84(this, 6); + } +} + +void func_802DB264(Actor *this) { + if (!func_80329530(this, 900) || !func_803292E0(this)) { + func_80328A84(this, 1); + } +} + +void func_802DB2AC(Actor *this) { + ActorLocal_core2_53C10 *local; + + local = (ActorLocal_core2_53C10 *)&this->local; + func_8030E878(local->unk10, local->unk14, local->unk12, this->position, 1250.0f, 2500.0f); +} + +void func_802DB2F8(Actor *this) { + ActorLocal_core2_53C10 *local; + + local = (ActorLocal_core2_53C10 *)&this->local; + if (actor_animationIsAt(this, local->unk18)) { + func_8030E878(local->unk1C, local->unk20, local->unk1E, this->position, 1250.0f, 2500.0f); + } +} + +void func_802DB354(Actor *this) { + ActorLocal_core2_53C10 *local; + + local = (ActorLocal_core2_53C10 *)&this->local; + if (actor_animationIsAt(this, local->unk24)) { + func_8030E878(local->unk28, local->unk2C, local->unk2A, this->position, 1250.0f, 2500.0f); + } +} + +void func_802DB3B0(Actor *this) { + ActorLocal_core2_53C10 *local; + + local = (ActorLocal_core2_53C10 *)&this->local; + if (local->unkC_28 && actor_animationIsAt(this, 0.0f)) { + FUNC_8030E8B4(SFX_8_BANJO_LANDING_04, 1.8f, 8000, this->position, 500, 1500); + } + if (local->unkC_28 && actor_animationIsAt(this, 0.5f)) { + FUNC_8030E8B4(SFX_8_BANJO_LANDING_04, 1.8f, 8000, this->position, 500, 1500); + } +} + +void func_802DB440(ActorMarker *marker, ActorMarker *other_marker) { + Actor *this; + + this = marker_getActor(marker); + if( this->state == 7 + && this->unk28 >= 3.0 + && func_803294F0(this, 0x50, func_80329784(this)) + ) { + FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 1.0f, 20000, this->position, 1250, 2500); + + func_802DAE40(this); + } +} + +void func_802DB4E0(ActorMarker *marker, s32 arg1){ + Actor * actor = marker_getActor(marker); + func_80328B8C(actor, 9, 0.0f, 1); + actor_playAnimationOnce(actor); + actor_collisionOff(actor); + actor->unk60 = randf2(3.0f, 6.0f); +} + +void func_802DB548(ActorMarker *marker, ActorMarker *other_marker) { + Actor *this; + ActorLocal_core2_53C10 *local; + + this = marker_getActor(marker); + local = (ActorLocal_core2_53C10 *)&this->local; + func_8030E878(SFX_8E_GRUNTLING_DAMAGE, local->unk3C, 32000, this->position, 1250.0f, 2500.0f); + func_802DAE40(this); +} + +void func_802DB5A0(Actor *this) { + ActorLocal_core2_53C10 *local; + f32 phi_f14; + + local = (ActorLocal_core2_53C10 *)&this->local; + if (!this->unk16C_4) { + marker_setCollisionScripts(this->marker, &func_802DB440, local->unk30, local->unk34); + this->marker->propPtr->unk8_3 = FALSE; + this->unk60 = 0.0f; + this->unk124_0 = this->unk138_31 = FALSE; + local->unk38 = 0; + this->unk16C_4 = TRUE; + if (func_803203FC(0x1F)) { + func_80328A84(this, 2U); + return; + } + } + if (func_8028EC04()) { + return; + } + if (this->unk38_31 != 0) { + this->unk38_31--; + } + + switch(this->state){ + case 1://L802DB6B8 + if (func_80328B38(this, 2, 0.58f)) { + func_80328CEC(this, (s32) this->yaw, 0xA, 0x2D); + func_802DAE10(this); + } + break; + + case 8://L802DB704 + func_80328FB0(this, 6.0f); + if (func_80329480(this) != 0) { + phi_f14 = animctrl_getAnimTimer(this->animctrl) + 0.0333; + if (phi_f14 >= 1.0) { + phi_f14 -= 1.0; + } + func_80328B8C(this, 2, phi_f14, 1); + this->yaw_moving = this->yaw; + func_802DAE10(this); + } + break; + + case 2://L802DB790 + func_80328FB0(this, 2.0f); + func_802DB3B0(this); + if (this->unk38_31 == 0) { + if (!(func_8023DB5C() & 0xF)) { + func_80328CEC(this, this->yaw_moving, 0xA, 0x14); + } + if (!(func_8023DB5C() & 7)) { + func_80328B38(this, 1, 0.02f); + } + if( !(func_8023DB5C() & 0xF) + && func_80329078(this, (s32) this->yaw_moving, 0x96) + ) { + if (func_80328B38(this, 3, 0.13f) != 0) { + this->unk28 = randf2((f32)local->unk8, (f32)local->unk9); + } + } + func_802DB220(this); + } + func_802DAFBC(this); + break; + + case 6://L802DB8C0 + func_802DB264(this); + this->yaw_moving = (f32) func_80329784(this); + func_80328FB0(this, 4.0f); + if (func_80329480(this)) { + this->unk10_12 = local->unkC_31; + func_80328A84(this, 4); + func_802DB2AC(this); + } + break; + + case 3://L802DB930 + func_80328FB0(this, 3.0f); + func_802DB3B0(this); + if (!(func_8023DB5C() & 0xF) && (func_80328B38(this, 2, 0.08f))) { + func_802DAE10(this); + } + func_802DB220(this); + func_802DAFBC(this); + break; + + case 4://L802DB990 + if (this->unk10_12 < local->unkC_31) { + animctrl_setDuration(this->animctrl, this->unk18[4].duration - ((local->unkC_31 - this->unk10_12) * 0.1)); + } + this->yaw_moving = (f32) func_80329784(this); + if (!func_803294B4(this, 0x21)) { + func_80328A84(this, 6); + } + func_802DB264(this); + if (actor_animationIsAt(this, 0.5f) != 0) { + if (this->unk10_12 != 0) { + this->unk10_12--; + } + } + if( (this->unk10_12 == 0) + || (this->unk10_12 < local->unkC_31 && func_80329530(this, 0xFA)) + ) { + func_80328A84(this, 7); + this->unk28 = (f32)local->unkA; + this->unk38_31 = 0; + } + if(!func_80329078(this, (s32) this->yaw, 0x14)) { + func_802DAE40(this); + } + break; + + case 7://L802DBB4C + if (this->unk38_31 == 0) { + if ((func_8023DB5C() & 0xF) == 9) { + this->yaw_moving = (f32) func_80329784(this); + } + } + func_80328FB0(this, (f32)local->unkB); + func_802DB3B0(this); + func_802DAFBC(this); + break; + + case 5://L802DBBDC + if (animctrl_isStopped(this->animctrl)){ + func_80326310(this); + } + break; + + case 9://L802DBBFC + if (animctrl_getAnimTimer(this->animctrl) != 0.0f) { + func_802DB2F8(this); + } + if (this->unk60 > 0.0f) { + this->unk60 -= time_getDelta(); + break; + } + func_80328B8C(this, 0xA, 0.0f, 1); + actor_playAnimationOnce(this); + break; + + case 10://L802DBC74 + if (animctrl_getAnimTimer(this->animctrl) != 0.0f) { + func_802DB354(this); + } + if (animctrl_isStopped(this->animctrl)) { + func_80328B8C(this, 2, 0.0f, 1); + actor_loopAnimation(this); + actor_collisionOn(this); + } + break; + + } +} diff --git a/src/core2/code_54D50.c b/src/core2/code_54D50.c new file mode 100644 index 00000000..325808f8 --- /dev/null +++ b/src/core2/code_54D50.c @@ -0,0 +1,104 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern int func_8024549C(f32 [3], f32); + +#define _HorzDist3v(v1, v2) ((v1[0]-v2[0])*(v1[0]-v2[0]) + (v1[2]-v2[2])*(v1[2]-v2[2])) + + +typedef struct{ + ParticleEmitter *unk0; +}ActorLocal_Core2_53C10; + +void func_802DC018(Actor *this); + +/* .data */ +ActorInfo D_80367F30= { + 0x1F5, 0x1E5, 0, + 0, NULL, + func_802DC018, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; + +s32 D_80367F54[3] = {0xff, 0xff, 0xff}; +struct40s D_80367F60 = { + { {0.1f, 0.5f}, {1.0f, 1.5f}, {0.0f, 0.01f}, {0.5f, 1.4f}, + 0.0f, 0.01f + }, + 4.0f, 1.0f +}; + +struct43s D_80367F90 ={ + {{0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}}, + {{0.0f, -650.0f, 0.0f}, {0.0f, -650.0f, 0.0f}}, + {{-200.0f, 0.0f, -200.0f}, {200.0f, 0.0f, 200.0f}} +}; + +/* .code */ +void func_802DBCE0(ParticleEmitter *pCtrl, f32 arg1[3]){ + ParticleEmitter *other = partEmitList_pushNew(1); + if(func_8024549C(arg1, 4.0f)){ + arg1[1] += 2.0f; + particleEmitter_setSprite(other, ASSET_70C_SPRITE_RIPPLE); + func_802EFA70(other, 1); + particleEmitter_setPosition(other, arg1); + func_802EFB70(other, 0.1f, 0.1f); + func_802EFB84(other, 1.0f, 1.4f); + func_802EFEC0(other, 1.0f, 1.4f); + func_802EFA5C(other, 0.0f, 0.5f); + particleEmitter_emitN(other, 1); + func_8030E878(SFX_413_UNKNOWN, randf2(1.0f, 1.4f), 0x4e20, arg1, 0.0f, 3500.0f); + } + else{//L802DBDF4 + particleEmitter_setSprite(other, ASSET_700_SPRITE_DUST); + particleEmitter_setStartingFrameRange(other, 0, 7); + func_802EFFA8(other, D_80367F54); + particleEmitter_setPosition(other, arg1); + particleEmitter_setParticleVelocityRange(other, -230.0f, 30.0f, -230.0f, 230.0f, 110.0f, 230.0f); + func_802EFC28(other, &D_80367F60); + FUNC_8030E8B4(SFX_7_BANJO_LANDING_03, 1.0f, 22000, arg1, 1500, 4500); + }//L802DBE8C +} + +void func_802DBE9C(Actor *this, ParticleEmitter *pCtrl){ + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80367F90); + particleEmitter_setModel(pCtrl, 0x344); + particleEmitter_setPosition(pCtrl, this->position); + func_802EFA70(pCtrl, 4); + func_802EFE24(pCtrl, -450.0f, -450.0f, -450.0f, 450.0f, 450.0f, 450.0f); + func_802EFA18(pCtrl, 1); + particleEmitter_setParticleCallback(pCtrl, func_802DBCE0); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 7.0f, 7.0f); + func_802EFA5C(pCtrl, 0.0f, 0.3f); + func_802F0D54(pCtrl); +} + +int func_802DBF94(Actor *this, s32 arg1){ + f32 sp1C[3]; + + player_getPosition(sp1C); + if(_HorzDist3v(this->position, sp1C) < arg1*arg1) + return 1; + return 0; +} + +void func_802DC018(Actor *this){ + ActorLocal_Core2_53C10 *local = (ActorLocal_Core2_53C10 *) &this->local; + f32 tmp_f0; + + if(!this->unk16C_4){ + actor_collisionOff(this); + local->unk0 = partEmitList_pushNew(16); + func_802DBE9C(this, local->unk0); + this->unk16C_4 = TRUE; + } + if(func_802DBF94(this, 600) && randf() < 0.2){ + tmp_f0 = randf2(0.01f, 0.06f); + func_802EFB70(local->unk0, tmp_f0, tmp_f0); + func_802EFB84(local->unk0, tmp_f0, tmp_f0); + particleEmitter_emitN(local->unk0, 1); + }//L802DC0F4 +} diff --git a/src/core2/code_55180.c b/src/core2/code_55180.c new file mode 100644 index 00000000..87ae2cfb --- /dev/null +++ b/src/core2/code_55180.c @@ -0,0 +1,88 @@ +#include +#include "functions.h" +#include "variables.h" + +extern bool func_8024DB50(f32[3], f32); + +void func_802DC208(Actor *this); + +/* .data */ +ActorInfo D_8037FE0 = { + 0x1F6, 0x1E6, 0, + 0, NULL, + func_802DC208, func_80326224, func_80325340, + 3000, 0, 0.0f, 0 +}; + +struct40s D_80368004 = { + {{0.2f, 0.4f}, + {0.8f, 1.0f}, + {0.0f, 0.01f}, + {0.1f, 0.12f}, + 0.0f, 0.7f}, + 4.0f, 1.0f +}; + + /* .rodata */ +extern f64 D_80376EF0; + +/* .code */ +void func_802DC110(f32 *position, enum asset_e sprite_id) { + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, sprite_id); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + particleEmitter_setPosition(pCtrl, position); + func_802EFA70(pCtrl, 0x10); + func_802EFC28(pCtrl, &D_80368004); +} + +bool func_802DC188(void) { + f32 sp1C[3]; + + player_getVelocity(sp1C); + if((sp1C[0] == 0.0) && (sp1C[1] == -1.0) && (sp1C[2] == 0.0)) { + return FALSE; + } + return TRUE; +} + + +void func_802DC208(Actor *this) { + f32 sp2C[3]; + enum asset_e phi_a1; + + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + actor_collisionOff(this); + this->marker->propPtr->unk8_3 = TRUE; + } + if( func_8024DB50(this->position, 50.0f) + && func_802DC188() + && !(func_8023DB5C() & 0x1F) + && randf() < 0.1 + ){ + switch((s32)this->yaw){ + case 0: + phi_a1 = ASSET_710_SPRITE_SPARKLE_PURPLE; + break; + + case 1: + phi_a1 = ASSET_711_SPRITE_SPARKLE_DARK_BLUE; + break; + + case 2: + phi_a1 = 0x712; + break; + + default: + phi_a1 = ASSET_711_SPRITE_SPARKLE_DARK_BLUE; + break; + } + sp2C[0] = this->position[0]; + sp2C[1] = this->position[1]; + sp2C[2] = this->position[2]; + func_802DC110(sp2C, phi_a1); + } +} diff --git a/src/core2/code_55390.c b/src/core2/code_55390.c new file mode 100644 index 00000000..062e0dd3 --- /dev/null +++ b/src/core2/code_55390.c @@ -0,0 +1,110 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern void func_80325794(ActorMarker *); + +Actor *func_802DC320(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_802DC45C(Actor *this); + +/* .data */ +f32 D_80368040[3] = {0.0f, 0.0f, 0.0f}; +ActorInfo D_8036804C = { + 0x174, 0x1DB, 0x54C, + 0x1, NULL, + func_802DC45C, func_80326224, func_802DC320, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +ActorMarker *D_8037DE40; + +/* .code */ +Actor *func_802DC320(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this; + f32 sp58[3]; + f32 sp4C[3]; + f32 sp40[3]; + f32 sp34[3]; + + this = marker_getActor(marker); + func_8033A2D4(func_803253A0, this); + func_8033A2E8(func_80325794, marker); + func_8024E258(); + sp58[0] = 0.0f; + sp58[1] = 0.0f; + sp58[2] = 937.5f; + sp4C[0] = 0.0f; + sp4C[1] = 0.0f; + sp4C[2] = 0.0f; + func_8024CD88(sp58); + func_8024CE18(sp4C); + func_8024CFD4(); + func_8024C904(gfx, mtx); + sp40[0] = 0.0f; + sp40[1] = 0.0f; + sp40[2] = 0.0f; + sp34[0] = 0.0f; + sp34[1] = 137.5f; + sp34[2] = 0.0f; + func_803391A4(gfx, mtx, sp40, NULL, 1.0f, sp34, func_80330B1C(marker)); + func_8024E2FC(); + func_8024C904(gfx, mtx); + return this; +} + + +void func_802DC430(Actor * this){ + D_8037DE40 = NULL; + func_8025A7DC(COMUSIC_31_GAME_OVER); +} + +void func_802DC45C(Actor *this){ + if(!this->initialized){ + + this->initialized = TRUE; + this->unk124_9 = 0; + func_803262E4(this); + actor_collisionOff(this); + func_803300D8(this->marker, func_802DC430); + } +} + +void func_802DC4C4(void) { + Actor *actor; + if (D_8037DE40 == 0) { + actor = func_8032813C(0x1DB, D_80368040, 0); + D_8037DE40 = actor->marker; + func_8025A58C(0, 5000); + func_8025AB00(); + func_8025A6EC(COMUSIC_31_GAME_OVER, -1); + } +} + +void func_802DC528(s32 arg0, s32 arg1){ + if(D_8037DE40 == NULL){ + func_802C3BF8(func_802DC4C4); + } +} + +void func_802DC560(s32 arg0, s32 arg1){ + if(D_8037DE40 != NULL){ + comusic_8025AB44(COMUSIC_31_GAME_OVER, 0, 200); + func_8025AABC(0x31); + func_80326310(marker_getActor(D_8037DE40)); + } +} + +void func_802DC5B8(void){ + if(D_8037DE40 != NULL){ + func_802DC45C(marker_getActor(D_8037DE40)); + func_80326894(marker_getActor(D_8037DE40)); + } +} + +void func_802DC604(Gfx **gfx, Mtx **mtx, Vtx **vtx){ + if(D_8037DE40 != NULL){ + func_802DC320(D_8037DE40, gfx, mtx, vtx); + } +} diff --git a/src/core2/code_556C0.c b/src/core2/code_556C0.c new file mode 100644 index 00000000..7c3dfce7 --- /dev/null +++ b/src/core2/code_556C0.c @@ -0,0 +1,60 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *func_802DC320(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_802DC67C(Actor *this); + +/* .data */ +f32 D_80368070[3] = {0.0f, 0.0f, 0.0f}; +ActorInfo D_8036807C = { + 0x17C, 0x19C, 0x56C, + 0x1, NULL, + func_802DC67C, func_80326224, func_802DC320, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +ActorMarker *D_8037DE50; + +/* .code */ +void func_802DC650(Actor * this){ + D_8037DE50 = NULL; + func_8025A7DC(COMUSIC_AC_GOOD_ENDING); +} + +void func_802DC67C(Actor *this){ + if(!this->initialized){ + + this->initialized = TRUE; + this->unk124_9 = 0; + func_803262E4(this); + actor_collisionOff(this); + func_803300D8(this->marker, func_802DC650); + } +} + +void func_802DC6E4(void) { + Actor *actor; + if (D_8037DE50 == 0) { + actor = func_8032813C(0x19C, D_80368070, 0); + D_8037DE50 = actor->marker; + func_8025A58C(0, 5000); + func_8025AB00(); + func_8025A6EC(COMUSIC_AC_GOOD_ENDING, -1); + } +} + +void func_802DC748(s32 arg0, s32 arg1){ + if(D_8037DE50 == NULL){ + func_802C3BF8(func_802DC6E4); + } +} + +void func_802DC780(s32 arg0, s32 arg1){ + if(D_8037DE50 != NULL){ + comusic_8025AB44(COMUSIC_AC_GOOD_ENDING, 0, 200); + func_8025AABC(0x31); + func_80326310(marker_getActor(D_8037DE50)); + } +} diff --git a/src/core2/code_55850.c b/src/core2/code_55850.c new file mode 100644 index 00000000..0a6fe717 --- /dev/null +++ b/src/core2/code_55850.c @@ -0,0 +1,87 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80325794(ActorMarker *); + +Actor *func_802DC7E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_802DC900(Actor *this); + +/* .data */ +f32 D_803680A0[3] = {0.0f, 0.0f, 0.0f}; +ActorInfo D_803680AC = { + 0x175, 0x1DC, 0x54D, + 0x1, NULL, + func_802DC900, func_80326224, func_802DC7E0, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +ActorMarker *D_8037DE60; + +/* .code */ +Actor *func_802DC7E0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this; + f32 sp58[3]; + f32 sp4C[3]; + f32 sp40[3]; + f32 sp34[3]; + + this = marker_getActor(marker); + func_8033A2D4(func_803253A0, this); + func_8033A2E8(func_80325794, marker); + func_8024E258(); + sp58[0] = 0.0f; + sp58[1] = 0.0f; + sp58[2] = 860.0f; + sp4C[0] = 0.0f; + sp4C[1] = 0.0f; + sp4C[2] = 0.0f; + func_8024CD88(sp58); + func_8024CE18(sp4C); + func_8024CFD4(); + func_8024C904(gfx, mtx); + sp40[0] = 0.0f; + sp40[1] = 0.0f; + sp40[2] = 0.0f; + sp34[0] = 0.0f; + sp34[1] = -87.0f; + sp34[2] = 0.0f; + func_803391A4(gfx, mtx, sp40, NULL, 1.0f, sp34, func_80330B1C(marker)); + func_8024E2FC(); + func_8024C904(gfx, mtx); + return this; +} + +void func_802DC8F0(Actor *this){ + D_8037DE60 = NULL; +} + +void func_802DC900(Actor *this){ + if(!this->initialized){ + this->initialized = TRUE; + this->unk124_9 = 0; + actor_collisionOff(this); + func_803300D8(this->marker, func_802DC8F0); + } +} + +void func_802DC960(void) { + Actor *actor; + if (D_8037DE60 == 0) { + actor = func_8032813C(0x1DC, D_803680A0, 0); + D_8037DE60 = actor->marker; + } +} + +void func_802DC9A4(s32 arg0, s32 arg1){ + if(D_8037DE60 == NULL){ + func_802C3BF8(func_802DC960); + } +} + +void func_802DC9DC(s32 arg0, s32 arg1){ + if(D_8037DE60 != NULL){ + func_80326310(marker_getActor(D_8037DE60)); + } +} diff --git a/src/core2/code_55A90.c b/src/core2/code_55A90.c new file mode 100644 index 00000000..edbf68af --- /dev/null +++ b/src/core2/code_55A90.c @@ -0,0 +1,55 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_802DCA30(Actor *this); + +/* .data */ +f32 D_803680D0[3] = {0.0f, 0.0f, 0.0f}; +ActorInfo D_803680DC = { + 0x176, 0x1DD, 0x54E, + 0x1, NULL, + func_802DCA30, func_80326224, func_802DC7E0, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +s32 D_8037DE70; + +/* .code */ +void func_802DCA20(Actor *this){ + D_8037DE70 = NULL; +} + +void func_802DCA30(Actor *this){ + if(!this->initialized){ + this->initialized = TRUE; + this->unk124_9 = 0; + actor_collisionOff(this); + func_803300D8(this->marker, func_802DCA20); + } +} + + +void func_802DCA90(void) { + Actor *actor; + if (D_8037DE70 == 0) { + actor = func_8032813C(0x1DD, D_803680D0, 0); + D_8037DE70 = actor->marker; + } +} + +void func_802DCAD4(s32 arg0, s32 arg1){ + if(D_8037DE70 == NULL){ + func_802C3BF8(func_802DCA90); + } +} + +void func_802DCB0C(s32 arg0, s32 arg1) { + ActorMarker *temp_a0; + + temp_a0 = D_8037DE70; + if (temp_a0 != 0) { + func_80326310(marker_getActor(temp_a0)); + } +} diff --git a/src/core2/code_55BC0.c b/src/core2/code_55BC0.c new file mode 100644 index 00000000..4584a1fa --- /dev/null +++ b/src/core2/code_55BC0.c @@ -0,0 +1,109 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80328B8C(Actor *, s32, f32, s32); +extern void func_803253A0(Actor *); +extern void func_80325794(ActorMarker *); +extern Actor *func_8032813C(enum actor_e id, f32[3], s32); + + +Actor *func_802DCB50(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_802DCC90(Actor *this); + + +/* .data */ +ActorAnimationInfo D_80368100[] = { + {0, 0.0f}, + {0x284, 1.6f}, + {0x285, 1.6f} +}; + +f32 D_80368118[3] = {0.0f, 0.0f, 0.0f}; + +ActorInfo D_80368124 = { + 0x177, 0x1DE, 0x55C, + 0x0, D_80368100, + func_802DCC90, func_80326224, func_802DCB50, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +ActorMarker *D_8037DE80; +bool D_8037DE84; + +/* .code */ +Actor *func_802DCB50(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **vptr){ + Actor * actor; + f32 sp58[3]; + f32 sp4C[3]; + f32 sp40[3]; + f32 sp34[3]; + + + actor = marker_getActor(marker); + if(D_8037DE84) + return actor; + + func_8033A2D4(func_803253A0, actor); + func_8033A2E8(func_80325794, marker); + func_8024E258(); + {sp58[0] = 0.0f; sp58[1] = 0.0f; sp58[2] = 1312.5f;}; + {sp4C[0] = 0.0f; sp4C[1] = 0.0f; sp4C[2] = 0.0f;}; + func_8024CD88(sp58); + func_8024CE18(sp4C); + func_8024CFD4(); + func_8024C904(gdl, mptr); + {sp40[0] = 0.0f; sp40[1] = 0.0f; sp40[2] = 0.0f;}; + {sp34[0] = 0.0f; sp34[1] = 400.0f; sp34[2] = 0.0f;}; + func_803391A4(gdl, mptr, sp40, 0, 1.0f, sp34, func_80330B1C(marker)); + func_8024E2FC(); + func_8024C904(gdl, mptr); + return actor; +} + +void func_802DCC78(ActorMarker *this){ + D_8037DE80 = 0; + D_8037DE84 = 0; +} + +void func_802DCC90(Actor *this){ + if(!this->initialized){ + this->initialized = 1; + this->unk124_9 = 0; + actor_collisionOff(this); + func_80328B8C(this, 1, 0.0f, 1); + actor_playAnimationOnce(this); + func_803300D8(this->marker, func_802DCC78); + } + + if(animctrl_isStopped(this->animctrl)){ + func_80328B8C(this, 2, 0.0f, 1); + actor_loopAnimation(this); + } +} + +void func_802DCD34(void){ + if(D_8037DE80 == NULL){ + D_8037DE80 = func_8032813C(0x1de, D_80368118, 0)->marker; + } +} + +void func_802DCD78(s32 arg0, s32 arg1){ + if(D_8037DE80 == NULL){ + func_802C3BF8(func_802DCD34); + } +} + +void func_802DCDB0(void){ + D_8037DE84 = TRUE; +} + +void func_802DCDC0(s32 arg0, s32 arg1) { + ActorMarker *temp_a0; + + temp_a0 = D_8037DE80; + if (temp_a0 != 0) { + func_80326310(marker_getActor(temp_a0)); + } +} diff --git a/src/core2/code_55E70.c b/src/core2/code_55E70.c new file mode 100644 index 00000000..abb25711 --- /dev/null +++ b/src/core2/code_55E70.c @@ -0,0 +1,93 @@ +#include +#include "functions.h" +#include "variables.h" + +extern Actor *func_8032813C(enum actor_e, f32[3], s32); +extern void func_80325794(ActorMarker *marker); + +Actor *func_802DCE00(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_802DCF20(Actor *this); + +/* .data */ +ActorAnimationInfo D_80368150[] ={ + {0, 0.0f}, + {0x286, 1.1f}, + {0x287, 1.6f} +}; +f32 D_80368168[3] = {0.0f, 0.0f, 0.0f}; +ActorInfo D_80368174 = { + 0x178, 0x1DF, 0x55D, + 0x0, D_80368150, + func_802DCF20, func_80326224, func_802DCE00, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +ActorMarker *D_8037DE90; + +/* .code */ +Actor *func_802DCE00(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **vptr){ + Actor * actor; + f32 sp58[3]; + f32 sp4C[3]; + f32 sp40[3]; + f32 sp34[3]; + + + actor = marker_getActor(marker); + func_8033A2D4(func_803253A0, actor); + func_8033A2E8(func_80325794, marker); + func_8024E258(); + {sp58[0] = 0.0f; sp58[1] = 0.0f; sp58[2] = 1312.5f;}; + {sp4C[0] = 0.0f; sp4C[1] = 0.0f; sp4C[2] = 0.0f;}; + func_8024CD88(sp58); + func_8024CE18(sp4C); + func_8024CFD4(); + func_8024C904(gdl, mptr); + {sp40[0] = 0.0f; sp40[1] = 0.0f; sp40[2] = 0.0f;}; + {sp34[0] = 0.0f; sp34[1] = 165.0f; sp34[2] = 0.0f;}; + func_803391A4(gdl, mptr, sp40, 0, 1.0f, sp34, func_80330B1C(marker)); + func_8024E2FC(); + func_8024C904(gdl, mptr); + return actor; +} + +void func_802DCF10(Actor *this){ + D_8037DE90 = NULL; +} + +void func_802DCF20(Actor *this) { + if (!this->initialized) { + this->initialized = TRUE; + this->unk124_9 = 0; + actor_collisionOff(this); + func_80328B8C(this, 1, 0.0f, 1); + actor_playAnimationOnce(this); + func_803300D8(this->marker, func_802DCF10); + } + if (animctrl_isStopped(this->animctrl) != 0) { + func_80328B8C(this, 2, 0.0f, 1); + actor_loopAnimation(this); + } +} + +void func_802DCFC4(void){ + if(D_8037DE90 == NULL){ + D_8037DE90 = func_8032813C(0x1df, D_80368168, 0)->marker; + } +} + +void func_802DD008(s32 arg0, s32 arg1){ + if(D_8037DE90 == NULL){ + func_802C3BF8(func_802DCFC4); + } +} + +void func_802DD040(s32 arg0, s32 arg1) { + ActorMarker *temp_a0; + + temp_a0 = D_8037DE90; + if (temp_a0 != 0) { + func_80326310(marker_getActor(temp_a0)); + } +} diff --git a/src/core2/code_560F0.c b/src/core2/code_560F0.c new file mode 100644 index 00000000..b6ec6fd2 --- /dev/null +++ b/src/core2/code_560F0.c @@ -0,0 +1,612 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8025982C(f32[3], f32[3], f32[3], f32); +extern void func_8025A6CC(enum comusic_e arg0, s32 arg1); +extern void func_802DF99C(void); +extern f32 *func_802E05AC(s32); +extern f32 func_802E4B38(void); +extern void func_8033A8F0(s32, s32, f32[4]); +extern f32 func_8033DDB8(void); +BKAnimationList *func_8033A0D4(BKModelBin *arg0); +extern void func_8034BB08(s32); +extern void func_803458E4(f32[4], f32[4], f32[4], f32); + +/* .extern symbols??? */ +extern u8 D_8037DCC0[7]; +extern u8 D_8037DCC7; +extern u8 D_8037DCC8; +extern u8 D_8037DCC9; +extern u8 D_8037DCCA; +extern u8 D_8037DCCB; +extern u8 D_8037DCCC; + +typedef struct { + f32 unk0; +}ActorLocal_core2_560F0; + +typedef struct{ + s32 unk0; + s32 unk4; //text_id + s32 unk8; + s32 anim_id; +}Struct_core2_560F0_0; + +typedef struct{ + f32 unk0[3]; + f32 unkC[4]; + f32 unk1C[3]; +}Struct_core2_560F0_1; + +typedef struct{ + s32 unk0; + u8 pad4[4]; +}Struct_core2_560F0_2; + +extern void item_set(enum item_e, s32); +extern void func_80325794(ActorMarker *); +extern void func_8024CE60(f32, f32); + +Actor *func_802DD188(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_802DE4CC(Actor *this); + +/* .data */ +Struct_core2_560F0_0 D_803681A0[] = { + {0x00, 0x000, 0, 0x211}, + {0x63, 0xE27, 0, 0x2C1}, + {0x63, 0xE29, 0, 0x2C2}, + {0x63, 0xE2B, 0, 0x2C9}, + {0x63, 0xE2D, 0, 0x2C3}, + {0x63, 0xE2F, 0, 0x2C4}, + {0x63, 0xE31, 0, 0x2C5}, + {0x4B, 0xE34, 0, 0x007} +}; + +ActorAnimationInfo D_80368220[] ={ + {0x000, 0.0f}, + {0x211, 9000000000.0f}, + {0x211, 2.0f}, + {0x211, 9000000000.0f}, + {0x211, 9000000000.0f}, + {0x211, 9000000000.0f}, +}; + +f32 D_80368250 = 0.999388993f; + +s32 D_80368254[20] = { + 0x3C, 0x3D, 0x3F, 0x40, + 0x42, 0x41, 0x43, 0x3A, + 0x32, 0x30, 0x2E, 0x3E, + 0x2A, 0x33, 0x2F, 0x31, + 0x2D, 0x34, 0x3B, 0x39 +}; + +s32 D_803682A4[4] = {0xD8, 0xD8, 0xD8, 0xFF}; +s32 D_803682B4[4] = {0xFF, 0x60, 0x50, 0xFF}; +f32 D_803682C4[3] = {0.0f, 0.0f, 0.0f}; + +ActorInfo D_803682D0 = { + 0x179, 0x1E0, 0x46C, + 0x1, D_80368220, + func_802DE4CC, func_80326224, func_802DD188, + 0, 0, 0.0f, 0 +}; + + + +/* .bss */ +ActorMarker *D_8037DEA0; +BKModelBin *D_8037DEA4; +BKModelBin *D_8037DEA8; +BKModel *D_8037DEAC; +s32 D_8037DEB0; +s32 D_8037DEB4; +Struct_core2_560F0_1 *D_8037DEB8; +Struct_core2_560F0_1 *D_8037DEBC; +Struct_core2_560F0_1 *D_8037DEC0; +Struct_core2_560F0_1 *D_8037DEC4; +f32 D_8037DEC8[20]; +f32 D_8037DF18[20]; +s32 D_8037DF68; +f32 D_8037DF70[3]; +f32 D_8037DF80[3]; +s32 D_8037DF90[20]; + +/* .code */ +void func_802DD080(Gfx **gfx, Mtx **mtx) { + f32 sp24[3]; + f32 sp18[3]; + + func_8024E258(); + func_8024CE60(50.0f, 2000.0f); + if (getGameMode() == 0xA) { + sp18[0] = 0.0f; + sp18[1] = 0.0f; + sp18[2] = 0.0f; + sp24[0] = 0.0f; + sp24[1] = 0.0f; + sp24[2] = 400.0f; + } else { + sp24[0] = 248.4125; + sp24[1] = 328.9; + sp24[2] = -186.4; + sp18[0] = 0.0f; + sp18[1] = 270.0f; + sp18[2] = 0.0f; + } + func_8024CD88(sp24); + func_8024CE18(sp18); + func_8024CFD4(); + func_8024C904(gfx, mtx); +} + +void func_802DD158(Gfx **gfx, Mtx** mtx){ + func_8024E2FC(gfx, mtx); + func_8024C904(gfx, mtx); +} + +Actor *func_802DD188(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *sp6C; + f32 sp60[3]; + f32 sp54[3]; + void *sp50; + + sp6C = marker_getActor(marker); + sp50 = func_8030C704(); + if ((sp50 == NULL) || (getGameMode() != GAME_MODE_8_BOTTLES_BONUS)) + return sp6C; + + func_802DD080(gfx, mtx); + {sp60[0] = 0.0f; sp60[1] = 0.0f; sp60[2] = 0.0f;}; + {sp54[0] = 0.0f; sp54[1] = 0.0f; sp54[2] = 0.0f;}; + set_model_render_mode(1); + func_803391A4(gfx, mtx, sp60, NULL, 1.0f, sp54, D_8037DEA4); + func_803391A4(gfx, mtx, sp60, NULL, 1.0f, sp54, D_8037DEA8); + + gDPSetTextureFilter((*gfx)++, G_TF_POINT); + gDPSetColorDither((*gfx)++, G_CD_DISABLE); + func_802DF160(gfx, mtx, vtx); + func_80253190(gfx); + + gDPSetTextureFilter((*gfx)++, G_TF_POINT); + gSPSegment((*gfx)++, 0x04, osVirtualToPhysical(sp50)); + func_8033A2D4(func_803253A0, sp6C); + func_8033A2E8(func_80325794, marker); + + func_803391A4(gfx, mtx, sp60, NULL, D_80368250, sp54, func_80330B1C(marker)); + gDPSetTextureFilter((*gfx)++, G_TF_BILERP); + gDPSetColorDither((*gfx)++, G_CD_MAGICSQ); + func_802DF71C(gfx, mtx, vtx); + func_802DD158(gfx, mtx); + return sp6C; +} + +void func_802DD3CC(Actor *this) { + ActorLocal_core2_560F0 * local; + local = (ActorLocal_core2_560F0 *) &this->local; + + D_8037DEA0 = 0; + if (D_8037DEAC != 0) { + func_8034CF6C(&local->unk0); + model_free(D_8037DEAC); + D_8037DEAC = 0; + } + + if (D_8037DEA4 != 0) { + assetcache_release(D_8037DEA4); + D_8037DEA4 = 0; + } + + if (D_8037DEA8 != 0) { + assetcache_release(D_8037DEA8); + D_8037DEA8 = 0; + } + free(D_8037DEB8); + free(D_8037DEBC); + free(D_8037DEC0); + free(D_8037DEC4); +} + +void func_802DD484(f32 dst[3], f32 arg1, f32 avg, f32 range) { + s32 i; + + for(i = 0; i < 3; i++){ + dst[i] = avg + range * (0.5 + 0.5 * sinf( (2.0*RARE_PI) * func_80257A44((arg1 + 2.0 * ((f32)i / 3.0)), 2.0f))); + } +} + +f32 *func_802DD584(s32 arg0){ + f64 temp_f0; + BKAnimation *temp_v1; + + // temp_f0 = D_80376F48; + sizeof(BKAnimationList); + temp_v1 = (BKAnimation*)(func_8033A0D4(func_80330B1C(D_8037DEA0)) + 1); + D_8037DF70[0] = temp_v1[5 + arg0].unk0[0] * 0.01; + D_8037DF70[1] = temp_v1[5 + arg0].unk0[1] * 0.01; + D_8037DF70[2] = temp_v1[5 + arg0].unk0[2] * 0.01; + return &D_8037DF70; +} + + +f32 *func_802DD60C(s32 arg0) { + s32 temp_v0; + + temp_v0 = func_802E0538(); + if ((temp_v0 != 0) && (temp_v0 != 3)) { + D_8037DF80[0] = func_802E05AC(arg0)[0] * 0.01; + D_8037DF80[1] = func_802E05AC(arg0)[1] * 0.01; + D_8037DF80[2] = func_802E05AC(arg0)[2] * 0.01; + } else { + D_8037DF80[0] = 0.0f; + D_8037DF80[1] = 0.0f; + D_8037DF80[2] = 0.0f; + } + return &D_8037DF80; +} + + +void func_802DD6E0(s32 arg0, s32 arg1, f32 arg2[3]) { + f32 sp1C[3]; + + sp1C[0] = arg2[0] - func_802DD584(arg1)[0]; + sp1C[1] = arg2[1] - func_802DD584(arg1)[1]; + sp1C[2] = arg2[2] - func_802DD584(arg1)[2]; + + func_8033A968(arg0, D_80368254[arg1], sp1C); +} + + +void func_802DD778(s32 arg0, s32 arg1, f32 arg2[3]) { + f32 sp1C[3]; + + func_8033A6B0(arg0, D_80368254[arg1], sp1C); + arg2[0] = sp1C[0] + func_802DD584(arg1)[0]; + arg2[1] = sp1C[1] + func_802DD584(arg1)[1]; + arg2[2] = sp1C[2] + func_802DD584(arg1)[2]; +} + +f32 func_802DD804(f32 arg0) { + arg0 = MAX(0.0, MIN(1.0, arg0)); + return sinf(M_PI * arg0 / 2); +} + +void func_802DD8AC(s32 arg0, s32 arg1) { + s32 i; + f32 spD8[3]; + f32 spD4; + f32 spD0; + Actor *actor; + f32 spBC[4]; + f32 spAC[4]; + f32 sp9C[4]; + f32 sp8C[4]; + f32 sp7C[4]; + + + actor = marker_getActor(D_8037DEA0); + spD4 = func_802E4B38(); + spD0 = func_8033DDB8(); + if (D_8037DEB0 == 0) { + D_8037DEB0 = 1; + for(i = 0; i < 20; i++){ + func_8033A57C(arg0, D_80368254[i], D_8037DEC4[i].unkC); + func_8033A670(arg0, D_80368254[i], D_8037DEC4[i].unk1C); + func_802DD778(arg0, i, D_8037DEC4[i].unk0); + func_802DF460(i + 20, D_8037DEA0, D_8037DEC4[i].unk0); + } + } + + if((actor->state == 4 || actor->state == 5)){ + if (D_8037DEB4 == 0) { + D_8037DEB4 = 1; + for(i = 0; i < 20; i++){ + func_8033A57C(arg0, D_80368254[i], D_8037DEB8[i].unkC); + func_8033A670(arg0, D_80368254[i], D_8037DEB8[i].unk1C); + func_802DD778(arg0, i, D_8037DEB8[i].unk0); + func_80345250(D_8037DEC0[i].unkC, D_8037DEB8[i].unkC); + D_8037DEC0[i].unk0[0] = D_8037DEB8[i].unk0[0]; + D_8037DEC0[i].unk0[1] = D_8037DEB8[i].unk0[1]; + D_8037DEC0[i].unk0[2] = D_8037DEB8[i].unk0[2]; + + D_8037DEC0[i].unk1C[0] = D_8037DEB8[i].unk1C[0]; + D_8037DEC0[i].unk1C[1] = D_8037DEB8[i].unk1C[1]; + D_8037DEC0[i].unk1C[2] = D_8037DEB8[i].unk1C[2]; + + func_802DF460(i, D_8037DEA0, D_8037DEB8[i].unk0); + } + } + + for(i = 0; i < 20; i++){ + spD8[0] = 1.0f; + spD8[1] = 1.0f; + spD8[2] = 1.0f; + switch(func_802E0538(i)){ + case 1://L802DDBB4 + func_802DD484(spD8, spD4, 1.0f, 0.2); + func_8025982C(D_8037DEBC[i].unk0, D_8037DEB8[i].unk0, func_802DD60C(i), func_802DD804(D_8037DEC8[i] / 0.2)); + func_8025982C(D_8037DEBC[i].unk1C, D_8037DEB8[i].unk1C, D_8037DEC4[i].unk1C, func_802DD804(D_8037DEC8[i]/ 0.2)); + func_80345D30(spAC, func_802E068C(i), D_8037DEB8[i].unkC); + func_803458E4(spBC, D_8037DEB8[i].unkC, spAC, func_802DD804(D_8037DEC8[i] / 0.4)); + + func_80345D30(spAC, func_802E0664(i), D_8037DEB8[i].unkC); + func_803458E4(D_8037DEBC[i].unkC, spBC, spAC, func_802DD804(D_8037DF18[i] / 0.2)); + D_8037DEC0[i].unk0[0] = D_8037DEBC[i].unk0[0]; + D_8037DEC0[i].unk0[1] = D_8037DEBC[i].unk0[1]; + D_8037DEC0[i].unk0[2] = D_8037DEBC[i].unk0[2]; + + D_8037DEC0[i].unk1C[0] = D_8037DEBC[i].unk1C[0]; + D_8037DEC0[i].unk1C[1] = D_8037DEBC[i].unk1C[1]; + D_8037DEC0[i].unk1C[2] = D_8037DEBC[i].unk1C[2]; + + func_80345250(D_8037DEC0[i].unkC, D_8037DEBC[i].unkC); + break; + case 2://L802DDD9C + func_802DD484(spD8, spD4, 1.0f, 0.2); + func_8025982C(D_8037DEBC[i].unk0, D_8037DEC4[func_802E0588(i)].unk0, func_802DD60C(i), func_802DD804(D_8037DEC8[i] / 0.2)); + func_80345D30(sp9C, func_802E068C(i), D_8037DEB8[i].unkC); + func_80345D30(sp8C, func_802E0664(i), D_8037DEB8[i].unkC); + func_803458E4(D_8037DEBC[i].unkC, sp9C, sp8C, func_802DD804(D_8037DF18[i] / 0.2)); + D_8037DEC0[i].unk0[0] = D_8037DEBC[i].unk0[0]; + D_8037DEC0[i].unk0[1] = D_8037DEBC[i].unk0[1]; + D_8037DEC0[i].unk0[2] = D_8037DEBC[i].unk0[2]; + + D_8037DEC0[i].unk1C[0] = D_8037DEBC[i].unk1C[0]; + D_8037DEC0[i].unk1C[1] = D_8037DEBC[i].unk1C[1]; + D_8037DEC0[i].unk1C[2] = D_8037DEBC[i].unk1C[2]; + func_80345250(D_8037DEC0[i].unkC, D_8037DEBC[i].unkC); + func_802DF460(40 + i, D_8037DEA0, D_803681A0); + break; + + case 3://L802DDF48 + func_802DF460(40 + i, D_8037DEA0, D_8037DEC4[func_802E0588(i)].unk0); + func_8025982C(D_8037DEBC[i].unk0, D_8037DEC0[i].unk0, D_8037DEC4[func_802E0588(i)].unk0, func_802DD804(D_8037DEC8[i] / 0.4)); + func_8025982C(D_8037DEBC[i].unk1C, D_8037DEC0[i].unk1C, D_8037DEC4[func_802E0588(i)].unk1C, func_802DD804(D_8037DEC8[i] / 0.4)); + func_80345D30(sp7C, func_802E0664(i), D_8037DEB8[i].unkC); + func_803458E4(D_8037DEBC[i].unkC, D_8037DEC0[i].unkC, sp7C, func_802DD804(D_8037DF18[i] / 0.2)); + break; + + case 0://L802DE084 + func_8025982C(D_8037DEBC[i].unk0, D_8037DEC0[i].unk0, D_8037DEB8[i].unk0, func_802DD804(D_8037DEC8[i] / 0.4)); + func_8025982C(D_8037DEBC[i].unk1C, D_8037DEC0[i].unk1C, D_8037DEB8[i].unk1C, func_802DD804(D_8037DEC8[i] / 0.4)); + func_803458E4(D_8037DEBC[i].unkC, D_8037DEC0[i].unkC, D_8037DEB8[i].unkC, func_802DD804(D_8037DEC8[i] / 0.4)); + break; + } + + func_8033A8F0(arg0, D_80368254[i], D_8037DEBC[i].unkC); + spD8[0] = spD8[0] * D_8037DEBC[i].unk1C[0]; + spD8[1] = spD8[1] * D_8037DEBC[i].unk1C[1]; + spD8[2] = spD8[2] * D_8037DEBC[i].unk1C[2]; + func_8033A928(arg0, D_80368254[i], spD8); + func_802DD6E0(arg0, i, D_8037DEBC[i].unk0); + D_8037DEC8[i] += spD0; + D_8037DF18[i] += spD0; + } + } +} + +void func_802DE224(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + func_8034BB08(0); +} + +void func_802DE250(u8 *arg0, enum asset_e text_id) { + Actor *actor; + + actor = marker_getActor(D_8037DEA0); + func_802E06CC(); + func_8025A6CC(COMUSIC_3C_MINIGAME_LOSS, 28000); + actor->state = 5; + item_set(ITEM_6_HOURGLASS, FALSE); + func_802FAD64(0); + if (*arg0 == 0) { + *arg0 = 1; + timedFunc_set_0(2.0f, func_802DF99C); + func_80311714(0); + func_80311480(text_id, 0x86, actor->position, D_8037DEA0, func_802DE224, NULL); + func_80311714(1); + } + else{ + timedFunc_set_1(1.25f, func_8034BB08, 0); + } +} + +void func_802DE340(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + timedFunc_set_1(0.5f, func_8034BB08, 1); + D_8037DF68++; +} + +void func_802DE38C(void) { + Actor *actor; + + actor = marker_getActor(D_8037DEA0); + D_8037DCC0[D_8037DF68] = TRUE; + func_80311714(0); + func_80311480(D_803681A0[D_8037DF68 + 1].unk4, 0x86, actor->position, D_8037DEA0, func_802DE340, NULL); + func_80311714(1); +} + +s32 func_802DE41C(void){ + return D_8037DF68; +} + +void func_802DE428(s32 arg0, s32 arg1, s32 arg2) { + Actor *actor; + + actor = marker_getActor(D_8037DEA0); + actor->state = 4; + actor->unk60 = 0.0f; + timedFunc_set_2(0.25f, item_set, ITEM_6_HOURGLASS, TRUE); + timedFunc_set_2(0.25f, item_set, ITEM_0_HOURGLASS_TIMER, D_803681A0[D_8037DF68 + 1].unk0 * 60 - 1); +} + +void func_802DE4CC(Actor *this) { + ActorLocal_core2_560F0 *local; + f32 sp50; + s32 temp_v0_2; + s32 sp48; + s32 sp44; + s32 sp40; + s32 phi_s0; + s32 phi_s0_2; + + local = (ActorLocal_core2_560F0 *) &this->local; + sp50 = func_8033DDB8(); + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + actor_collisionOff(this); + this->unk60 = 0.0f; + D_8037DEB4 = D_8037DEB0 = 0; + func_803300D8(this->marker, func_802DD3CC); + if (D_8037DEA4 == 0) { + D_8037DEA4 = assetcache_get(0x470); + } + if (D_8037DEA8 == 0) { + D_8037DEA8 = assetcache_get(0x471); + } + if (D_8037DEAC == NULL) { + D_8037DEAC = func_8033F5F8(func_8033A0B0(D_8037DEA4), func_8033A148(D_8037DEA4)); + func_8034CF74(local, 0, D_8037DEAC, 0xF0); + } + func_8028746C(this->animctrl, func_802DD8AC); + for(phi_s0 = 0; phi_s0 < 0x14; phi_s0++){ + func_8034DFB0(func_8034C2C4(this->marker, phi_s0 + 0x190), D_803682B4, D_803682A4, 0.0f); + } + D_8037DEB8 = (Struct_core2_560F0_1 *) malloc(0x14*sizeof(Struct_core2_560F0_1)); + D_8037DEBC = (Struct_core2_560F0_1 *) malloc(0x14*sizeof(Struct_core2_560F0_1)); + D_8037DEC0 = (Struct_core2_560F0_1 *) malloc(0x14*sizeof(Struct_core2_560F0_1)); + D_8037DEC4 = (Struct_core2_560F0_1 *) malloc(0x14*sizeof(Struct_core2_560F0_1)); + } + func_8034CF90(local, D_8037DEAC, 0xF0); + sp48 = func_802E06B4() - 1; + sp44 = func_802E055C(); + for(phi_s0_2 = 0; phi_s0_2 < 0x14; phi_s0_2++){ + sp40 = D_8037DF90[phi_s0_2]; + temp_v0_2 = func_8034C2C4(this->marker, phi_s0_2 + 0x190); + if ((phi_s0_2 == sp48) && (sp44 == 1) && !func_802E0538(phi_s0_2)) { + D_8037DF90[phi_s0_2] = TRUE; + } else { + D_8037DF90[phi_s0_2] = FALSE; + } + if (sp40 != D_8037DF90[phi_s0_2]) { + switch(D_8037DF90[phi_s0_2]){ + case TRUE: + func_8034DFB0(temp_v0_2, D_803682A4, D_803682B4, 0.1f); + break; + + case FALSE: + func_8034DFB0(temp_v0_2, D_803682B4, D_803682A4, 0.3f); + break; + + } + } + } + this->unk60 += sp50; + switch(this->state){ + case 1: + if ((this->unk60 > 2.0) && gctransition_8030BD98()) { + this->unk60 = 0.0f; + func_8025A6EC(COMUSIC_98_BBONUS_PIECES_SHUFFLE, -1); + comusic_8025AB44(COMUSIC_95_BBONUS_A, 0, 2000); + func_8025AABC(COMUSIC_95_BBONUS_A); + func_80328B8C(this, 2, 0.0f, 1); + actor_playAnimationOnce(this); + } + break; + case 2: + if(animctrl_isStopped(this->animctrl)) { + this->state = 3; + func_8025A7DC(COMUSIC_98_BBONUS_PIECES_SHUFFLE); + if (D_8037DCC7 == 0) { + func_80311714(0); + func_80311480(0xE24, 0x87, this->position, D_8037DEA0, func_802DE428, NULL); + func_80311714(1); + D_8037DCC7 = 1; + } + else{ + func_802DE428(NULL, 0, 0); + } + } + break; + case 3: + break; + case 4: + if (this->unk60 > 2.0) { + func_8025AEA0(COMUSIC_94_BBONUS, ((item_getCount(ITEM_0_HOURGLASS_TIMER) * 0x201D2) / (s32) ((D_803681A0[D_8037DF68 + 1].unk0 * 60) - 1)) + 330000); + if ((item_getCount(ITEM_6_HOURGLASS) == 0) && (func_802E06C0() == 0)) { + func_802DE250(&D_8037DCC9, 0xE26); + } + } + break; + case 5: + break; + }//L802DE9A0 +} + +void func_802DE9C8(void){ + Actor *actor; + if(D_8037DEA0 == NULL){ + actor = func_8032813C(0x1E0, D_803682C4, 0); + D_8037DEA0 = actor->marker; + func_802DF8EC(); + func_802DF270(); + } +} + +void func_802DEA18(s32 arg0, s32 arg1){ + if(D_8037DEA0 == NULL){ + func_802C3BF8(func_802DE9C8); + } +} + +void func_802DEA50(s32 arg0){ + D_8037DEC8[arg0] = 0.0f; + D_8037DF18[arg0] = 0.0f; +} + + +void func_802DEA74(s32 arg0){ + D_8037DF18[arg0] = 0.0f; +} + +void func_802DEA8C(s32 arg0, s32 arg1) { + ActorMarker *temp_a0; + + temp_a0 = D_8037DEA0; + if (temp_a0 != 0) { + func_80326310(marker_getActor(temp_a0)); + } +} + +s32 func_802DEACC(void){ + Actor *actor = marker_getActor(D_8037DEA0); + return actor->state; +} + +f32 *func_802DEAF8(s32 arg0){ + return D_8037DEBC[arg0].unkC; +} + +Actor *func_802DEB18(s32 position[3], s32 yaw, ActorInfo *actor_info, u32 flags){ + int i; + + for(i = 1; i < 6; i++){ + D_80368220[i].index = D_803681A0[D_8037DF68].anim_id; + } + return actor_new(position, yaw, actor_info, flags); +} + +void func_802DEB80(void) { + int i; + for(i = 0; i < 7; i++){ + D_8037DCC0[i] = 0; + } + D_8037DCC7 = 0; + D_8037DCC8 = 0; + D_8037DCC9 = 0; + D_8037DCCA = 0; + D_8037DCCB = 0; + D_8037DCCC = 0; + + D_8037DF68 = 0; +} diff --git a/src/core2/code_57C70.c b/src/core2/code_57C70.c new file mode 100644 index 00000000..5ba8f49f --- /dev/null +++ b/src/core2/code_57C70.c @@ -0,0 +1,183 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80325794(ActorMarker *); +extern void func_802DD080(Gfx **, Mtx **); +extern void func_80311714(s32); + +Actor *func_802DEC00(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_802DEE1C(Actor *this); + +/* .data */ +ActorAnimationInfo D_80368300[] ={ + {0x000, 0.0f}, + {0x2C7, 0.6f}, + {0x2C6, 3.0f}, + {0x2C8, 0.6f}, + {0x2C8, 0.6f}, + {0x2C6, 9e+09}, +}; + +f32 D_80368330[3] = {0.0f, 0.0f, 0.0f}; + +ActorInfo D_8036833C = { + 0x294, 0x19B, 0x56D, + 0x1, D_80368300, + func_802DEE1C, func_80326224, func_802DEC00, + 0, 0, 0.0f, 0 +}; + +ActorMarker *D_8037DFE0; +enum level_e D_8037DFE4; +BKModelBin *D_8037DFE8; +f32 D_8037DFF0[3]; + +/* .code */ +Actor *func_802DEC00(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *this; + f32 sp58[3]; + f32 sp4C[3]; + void *sp48; + + + this = marker_getActor(marker); + sp48 = func_8030C704(); + + if ((sp48 == 0) || (getGameMode() != GAME_MODE_A_SNS_PICTURE)) + return this; + + func_802DD080(gfx, mtx); + sp58[0] = 0.0f; + sp58[1] = 0.0f; + sp58[2] = 50.0f; + + sp4C[0] = 0.0f; + sp4C[1] = 0.0f; + sp4C[2] = 0.0f; + + D_8037DFF0[0] = 0.0f; + D_8037DFF0[1] = 270.0f; + D_8037DFF0[2] = 0.0f; + set_model_render_mode(1); + func_803391A4(gfx, mtx, sp58, NULL, 1.0f, sp4C, D_8037DFE8); + gDPSetColorDither((*gfx)++, G_CD_DISABLE); + func_80253190(gfx); + gSPSegment((*gfx)++, 0x04, osVirtualToPhysical(sp48)); + func_8033A2D4(func_803253A0, this); + func_8033A2E8(func_80325794, marker); + func_803391A4(gfx, mtx, this->position, NULL, 4.5f, &sp4C, func_80330B1C(marker)); + gDPSetTextureFilter((*gfx)++, G_TF_BILERP); + gDPSetColorDither((*gfx)++, G_CD_MAGICSQ); + func_802DD158(gfx, mtx); + return this; +} + +void func_802DEDDC(Actor *this){ + D_8037DFE0 = NULL; + if(D_8037DFE8 != NULL){ + assetcache_release(D_8037DFE8); + D_8037DFE8 = NULL; + } +} + + +void func_802DEE1C(Actor *this) { + s32 sp4C; + s32 sp48; + s32 sp44; + f32 sp38; + + if (!this->initialized) { + this->initialized = TRUE; + actor_collisionOff(this); + func_803300D8(this->marker, func_802DEDDC); + actor_playAnimationOnce(this); + if (D_8037DFE8 == NULL) { + D_8037DFE8 = assetcache_get(0x56E); + } + sp4C = map_getLevel(map_get()); + sp44 = sp4C == D_8037DFE4; + if (sp44) { + func_80328B8C(this, 2, 0.0f, 1); + actor_loopAnimation(this); + } + switch(sp4C){ + case LEVEL_2_TREASURE_TROVE_COVE: + sp48 = sp44 + 0xE39; + break; + + case LEVEL_5_FREEZEEZY_PEAK: + sp48 = sp44 + 0xE3B; + break; + + case LEVEL_7_GOBIS_VALLEY: + default: + sp48 = sp44 + 0xE3D; + break; + } + sp38 = (f32) ((f64) (sp44 + 1) * 0.75); + timedFunc_set_1(sp38, func_80311714, 0); + func_80324DBC(sp38, sp48, 0x80, NULL, NULL, NULL, NULL); + timedFunc_set_1(sp38, func_80311714, 1); + D_8037DFE4 = sp4C; + } + switch(this->state){ + case 1: + if (animctrl_isStopped(this->animctrl)) { + func_80328B8C(this, 2, 0.0f, 1); + actor_loopAnimation(this); + } + break; + + case 3: + if(animctrl_isStopped(this->animctrl)) { + func_803204E4(0xC3, 1); + this->state = 4; + } + break; + + case 2: + if(gctransition_8030BDC0()) { + func_80328B8C(this, 5, 0.0f, 1); + } + break; + + case 4: + break; + + case 5: + break; + } + func_803228D8(); +} + +void func_802DF04C(void){ + Actor *this; + if(D_8037DFE0 == NULL){ + this = func_8032813C(0x19B, D_80368330, 0); + D_8037DFE0 = this->marker; + } +} + +void func_802DF090(s32 arg0, s32 arg1){ + if(D_8037DFE0 == NULL){ + func_802C3BF8(func_802DF04C); + } +} + +void func_802DF0C8(void) { + Actor *sp1C; + + sp1C = marker_getActor(D_8037DFE0); + if (sp1C->state != 3) { + func_80328B8C(sp1C, 3, 0.0f, 1); + actor_playAnimationOnce(sp1C); + } +} + +void func_802DF11C(s32 arg0, s32 arg1){ + if(D_8037DFE0 != NULL){ + func_80326310(marker_getActor(D_8037DFE0)); + } +} diff --git a/src/core2/code_581D0.c b/src/core2/code_581D0.c new file mode 100644 index 00000000..ef8146a0 --- /dev/null +++ b/src/core2/code_581D0.c @@ -0,0 +1,87 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80325794(ActorMarker *); + +void func_802DF2C4(Actor *this); + +/* .data */ +f32 D_80368360[3] = {0.0f, 0.0f, 0.0f}; +s32 D_8036836C[4] = {0x60, 0x60, 0x60, 0xFF}; +s32 D_8036837C[4] = {0xFF, 0xFF, 0xFF, 0xFF}; +ActorInfo D_8036838C = { + 0x17B, 0x2B5, 0x472, + 0, NULL, + func_802DF2C4, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +extern ActorMarker *D_8037E000; +extern s32 D_8037E008[20]; + +/* .code */ +Actor *func_802DF160(Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *this; + void *sp38; + + this = marker_getActor(D_8037E000); + sp38 = func_8030C704(); + set_model_render_mode(1); + gDPSetTextureFilter((*gfx)++, G_TF_POINT); + gSPSegment((*gfx)++, 0x04, osVirtualToPhysical(sp38)); + func_8033A2D4(func_803253A0, this); + func_8033A2E8(func_80325794, D_8037E000); + func_803391A4(gfx, mtx, &D_80368360, NULL, 1.0f, NULL, func_80330B1C(D_8037E000)); + gDPSetTextureFilter((*gfx)++, G_TF_BILERP); + return this; +} + +void func_802DF270(void){ + Actor *this; + if(D_8037E000 == NULL){ + this = func_8032813C(0x2B5, D_80368360, 0); + D_8037E000 = this->marker; + } +} + +void func_802DF2B4(Actor *this){ + D_8037E000 = NULL; +} + +void func_802DF2C4(Actor *this) { + s32 temp_fp; + s32 i; + s32 prev_val; + s32 temp_v0; + s32 val; + + + temp_fp = func_802E06B4() - 0x15; + if (!this->initialized) { + this->initialized = TRUE; + actor_collisionOff(this); + for(i = 0; i < 20; i++){ + func_8034DFB0(func_8034C2C4(this->marker, i + 0x190), D_8036837C, D_8036836C, 0.0f); + } + func_803300D8(this->marker, func_802DF2B4); + } + for( i = 0; i < 20; i++){ + prev_val = D_8037E008[i]; + temp_v0 = func_8034C2C4(this->marker, i + 0x190); + D_8037E008[i] = (i == temp_fp) ? TRUE : FALSE; + if (prev_val != D_8037E008[i] ) { + val = D_8037E008[i]; + switch(val){ + case TRUE: + func_8034DFB0(temp_v0, D_8036836C, D_8036837C, 0.05f); + break; + + case FALSE: + func_8034DFB0(temp_v0, D_8036837C, D_8036836C, 0.2f); + break; + } + }//L802DF418 + } +} diff --git a/src/core2/code_584D0.c b/src/core2/code_584D0.c new file mode 100644 index 00000000..a353eb48 --- /dev/null +++ b/src/core2/code_584D0.c @@ -0,0 +1,458 @@ +#include +#include "functions.h" +#include "variables.h" + +#ifndef ABS +#define ABS(d) ((d) >= 0) ? (d) : -(d) +#endif + +extern s16 D_803A5D00[2][0xF660]; //framebuffer +extern u8 D_8037DCC8[]; //bottels bonus flags??? + + +extern void ml_vec3f_assign(f32[3], f32, f32, f32); +extern void func_8025AABC(enum comusic_e); +extern f32 func_8024E420(s32, s32, s32); +extern f32 func_8033DDB8(void); +extern void func_802DEA50(s32); +extern void func_80325794(ActorMarker *); +extern void func_802DE38C(void); + + +typedef struct { + s32 unk0; + s32 unk4; + f32 unk8; //rotation; + f32 unkC[4]; + f32 unk1C[4]; +}Struct_core2_584D0_0; + +typedef struct { + f32 unk0; + f32 unk4; +}Struct_core2_584D0_1; + +void func_802DF99C(void); +void func_802DFA34(Actor *this); + +/* .data */ +ActorAnimationInfo D_803683B0[] = { + {0x000, 0.0f}, + {0x2A2, 1.0f}, + {0x2A5, 1.0f}, + {0x2A4, 0.4f}, + {0x2A3, 0.4f}, + {0x2A1, 0.3f}, + {0x2A7, 0.4f}, + {0x2A1, 0.3f}, + {0x2A6, 2.6f}, + {0x2A8, 2.6f} +}; + +f32 D_80368400[3] = {570.0f, 328.9f, -186.4f}; +f32 D_8036840C[3] = {-11.28f, 3.92f, -52.96f}; + +ActorInfo D_80368418 = { + 0x17A, 0x2B4, 0x565, + 0x1, D_803683B0, + func_802DFA34, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; + +/* .bss */ +ActorMarker *D_8037E060; +f32 D_8037E068[20][2]; +Struct_core2_584D0_0 D_8037E248[20]; +s32 D_8037E5B8; +struct { + s32 unk0; + u8 pad4[0xC]; + f32 unk10[2]; + f32 unk18[2]; + u16 unk20; //buttons + //u8 pad22; + s32 unk24; + f32 unk28; + f32 unk2C; +} D_8037E5C0; +f32 D_8037E5F0; +f32 D_8037E5F4; +f32 D_8037E5F8[3]; + +/* .code */ +void func_802DF460(s32 indx, ActorMarker *caller, f32 arg2[3]) { + f32 sp1C[3]; + + sp1C[0] = arg2[0] * 100.0f; + sp1C[1] = arg2[1] * 100.0f; + sp1C[2] = arg2[2] * 100.0f; + if (func_8024E030(sp1C, D_8037E068[indx]) == 0) { + D_8037E068[indx][0] = D_8037E068[indx][1] = 0.0f; + } +} + +f32 func_802DF4E0(f32 arg0[2], f32 arg1[2]){ + return (arg0[0] - arg1[0])*(arg0[0] - arg1[0]) + (arg0[1] - arg1[1])*(arg0[1] - arg1[1]); +} + +s32 func_802DF50C(void) { + s32 i; + f32 min; + f32 temp_f0; + s32 min_index; + + min = 1000.0f; + min_index = -1; + for(i = 0; i < 60; i++){ + temp_f0 = func_802DF4E0(D_8037E5C0.unk10, D_8037E068[i]); + if (temp_f0 < ((f32)min + (f32)i)) { + min_index = i; + min = temp_f0; + } + } + + if(min < 1000.0f) + return min_index; + return -1; +} + +bool func_802DF5D0(void) { + s32 i; + + D_8037E5C0.unk24 = TRUE; + for(i = 0; i < 20 && D_8037E5C0.unk24 != 0; i++){ + if((D_8037E248[i].unk0 != 3) + || (i != D_8037E248[i].unk4) + || !func_803454D0(func_802DEAF8(i)) + ) { + D_8037E5C0.unk24 = FALSE; + } + } + + if (D_8037E5C0.unk24) { + item_set(ITEM_6_HOURGLASS, FALSE); + timedFunc_set_3(0.25f, comusic_8025AB44, COMUSIC_94_BBONUS, 0, 0x7D0); + timedFunc_set_2(0.3f, func_8025A6EC, COMUSIC_2D_PUZZLE_SOLVED_FANFARE, 0x55F0); + timedFunc_set_0(1.5f, func_802DF99C); + timedFunc_set_0(1.0f, func_802DE38C); + } + return D_8037E5C0.unk24; +} + +void func_802DF71C(Gfx **gfx, Mtx **mtx, Vtx **vtx) { + f32 sp44[3]; + Actor *this; + f32 sp3C; + + this = func_80325300(D_8037E060, &sp44); + func_8033A2D4(func_803253A0, this); + func_8033A2E8(func_80325794, D_8037E060); + set_model_render_mode(1); + actor_setOpacity(this, 0xB9); + func_8024E030(this->position, D_8037E5C0.unk18); + sp3C = (this->scale * 650.0f); + func_80253208(gfx, + (s32)(D_8037E5C0.unk18[0] - sp3C/2), (s32)(D_8037E5C0.unk18[1] - sp3C/2), + (s32)sp3C, (s32)sp3C, + D_803A5D00[func_8024BDA0()] + ); + func_803391A4(gfx, mtx, this->position, sp44, this->scale, NULL, func_80330B1C(D_8037E060)); + func_8024E030(this->position, D_8037E5C0.unk10); + if (this->state == 1) { + D_8037E5C0.unk10[0] -= 24.0f; + D_8037E5C0.unk10[1] -= 8.0f; + } else { + D_8037E5C0.unk10[0] -= 44.0f; + D_8037E5C0.unk10[1] -= 8.0f; + } +} + +ActorMarker *func_802DF8EC(void){ + Actor *this = func_8032813C(0x2B4, D_80368400, 0); + D_8037E060 = this->marker; + return D_8037E060; +} + +void func_802DF928(s32 indx) { + f32 sp24[3]; + + func_80345250(D_8037E248[indx].unk1C, D_8037E248[indx].unkC); + sp24[0] = D_8037E248[indx].unk8; + sp24[1] = 0.0f; + sp24[2] = 0.0f; + func_80345C78(D_8037E248[indx].unkC, sp24); +} + +void func_802DF99C(void){ + func_803228D8(); + func_8025A55C(-1, 2000, 7); +} + +void func_802DF9CC(Actor *this) { + func_8031FBF8(); + func_8031FBA0(); + if (func_8034BAFC() != -1) { + func_802C5A3C(func_8034BAFC()); + func_8033D13C(func_8034BAFC()); + func_80347AA8(); + } + D_8037E060 = 0; +} + +void func_802DFA34(Actor *this) { + OSContPad *sp5C; + f32 sp58; + f32 sp54; + f32 sp50; + Struct_core2_584D0_0 *sp4C; + s32 i; + s32 sp44; + + sp5C = func_8024F3F4(); + sp58 = func_8033DDB8(); + sp4C = &D_8037E248[D_8037E5C0.unk0]; + if (!this->initialized) { + this->initialized = TRUE; + this->scale = 0.18f; + this->pitch = 59.0f; + this->roll = 63.0f; + this->yaw = -6.0f; + D_8037E5C0.unk28 = D_8037E5C0.unk2C = 1.0f; + D_8037E5F4 = 0.0f; + D_8037E5F0 = 0.0f; + D_8037E5C0.unk0 = -1; + D_8037E5B8 = -1; + D_8037E5C0.unk20 = sp5C->button; + D_8037E5C0.unk24 = 0; + timedFunc_set_2(3.0f, func_8025A6EC, COMUSIC_94_BBONUS, 0x5DC0); + timedFunc_set_1(3.0f, func_8025AABC, COMUSIC_94_BBONUS); + for(i = 0; i < 20; i++){ + bzero(&D_8037E248[i], sizeof(Struct_core2_584D0_0)); + D_8037E068[40 + i][0] = D_8037E068[40 + i][1] = 0.0f; + } + func_803300D8(this->marker, func_802DF9CC); + } + + if (this->state != 8 && this->state != 9 && func_802DEACC() == 4) { + if (this->state != 6) { + sp54 = func_8024E420(sp5C->stick_x, 7, 0x3B); + sp50 = func_8024E420(sp5C->stick_y, 7, 0x3D); + if ((sp54 == 0.0f) || (D_8037E5F0 * sp54 < 0.0f)) { + D_8037E5C0.unk28 = 1.0f; + } else { + D_8037E5C0.unk28 *= 1 + (ABS(sp54 * 0.1)); + } + if ((sp50 == 0.0f) || (D_8037E5F4 * sp50 < 0.0f)) { + D_8037E5C0.unk2C = 1.0f; + } else { + D_8037E5C0.unk2C *= 1 + (ABS(sp50 * 0.1)); + } + + D_8037E5F0 = sp54; + D_8037E5F4 = sp50; + + this->unk1C[1] += (((sp50 * sp58) * 150.0) * D_8037E5C0.unk2C); + this->unk1C[2] += (((sp54 * sp58) * 150.0) * D_8037E5C0.unk28); + + this->unk1C[1] = MAX(-100.0f, MIN(this->unk1C[1], 110.0f)); + this->unk1C[2] = MAX(-135.0f, MIN(this->unk1C[2], 180.0f)); + + this->position[0] = D_80368400[0] + this->unk1C[0]; + this->position[1] = D_80368400[1] + this->unk1C[1]; + this->position[2] = D_80368400[2] + this->unk1C[2]; + } + + if ( (sp5C->button & START_BUTTON) && !(D_8037E5C0.unk20 & START_BUTTON) + && func_802DEACC() == 4 + ) { + func_802DE250(&D_8037DCC8, 0xE25); + } + + if(this->state == 2 || this->state == 3 || this->state == 4){ + if((sp5C->button & L_CBUTTONS) && !(D_8037E5C0.unk20 & L_CBUTTONS)){ + sp4C->unk8 = mlNormalizeAngle(sp4C->unk8 - 90.0); + func_802DF928(D_8037E5C0.unk0); + func_802DEA74(D_8037E5C0.unk0); + func_8030E58C(SFX_12D_CAMERA_ZOOM_CLOSEST, 0.9f); + func_80328B8C(this, 3, 0.0f, 1); + actor_playAnimationOnce(this); + } + if((sp5C->button & R_CBUTTONS) && !(D_8037E5C0.unk20 & R_CBUTTONS)){ + sp4C->unk8 = mlNormalizeAngle(sp4C->unk8 + 90.0); + func_802DF928(D_8037E5C0.unk0); + func_802DEA74(D_8037E5C0.unk0); + func_8030E58C(SFX_12D_CAMERA_ZOOM_CLOSEST, 1.0f); + func_80328B8C(this, 4, 0.0f, 1); + actor_playAnimationOnce(this); + } + } + + D_8037E5B8 = func_802DF50C() + 1; + switch(this->state){ + case 1://L802E00AC //no piece in hand + if( (D_8037E5B8 > 0) && (D_8037E5B8 < 0x15) + && ((sp5C->button & A_BUTTON) && !(D_8037E5C0.unk20 & A_BUTTON)) + ){ + if(D_8037E248[D_8037E5B8 - 1].unk0 == 0) { + D_8037E5C0.unk0 = D_8037E5B8 - 1; + func_802DEA50(D_8037E5C0.unk0); + sp4C = &D_8037E248[D_8037E5C0.unk0]; + sp4C->unk0 = 1; + sp4C->unk8 = 0.0f; + func_802DF928(D_8037E5C0.unk0); + func_802DF928(D_8037E5C0.unk0); + func_8025A6EC(COMUSIC_96_BBONUS_PICKUP_PIECE, -1); + func_80328B8C(this, 2, 0.0f, 1); + } + } + + if( ((D_8037E5B8 >= 0x29) && (D_8037E5B8 < 0x3D)) + && ((sp5C->button & A_BUTTON) && !(D_8037E5C0.unk20 & A_BUTTON)) + ) { + if (D_8037E248[D_8037E5B8 - 41].unk0 == 3) { + if( D_8037E5B8 - 41 != D_8037E248[D_8037E5B8 - 41].unk4 + || !func_803454D0(func_802DEAF8(D_8037E5B8 - 41)) + ) { + D_8037E5C0.unk0 = D_8037E5B8 - 41; + func_802DEA50(D_8037E5C0.unk0); + sp4C = &D_8037E248[D_8037E5C0.unk0]; + sp4C->unk0 = 2; + func_802DF928(D_8037E5C0.unk0); + func_8030E484(SFX_112_TINKER_ATTENTION); + func_80328B8C(this, 2, 0.0f, 1); + } + } + } + break; + + //holding piece + case 2://L802E029C + if((sp5C->button & B_BUTTON) && !(D_8037E5C0.unk20 & B_BUTTON)){ + sp4C->unk0 = 0; + func_80328B8C(this, 5, 0.0f, 1); + func_8025A6EC(COMUISC_97_BBONUS_DROP_PIECE, -1); + func_802DEA50(D_8037E5C0.unk0); + D_8037E5C0.unk0 = -1; + break; + } + + if((sp5C->button & A_BUTTON) && !(D_8037E5C0.unk20 & A_BUTTON)){ + if ((D_8037E5B8 >= 21) && (D_8037E5B8 < 41)) { + sp4C->unk0 = 3; + sp4C->unk4 = D_8037E5B8 - 21; + if ((D_8037E5C0.unk0 == sp4C->unk4) && func_803454D0(func_802DEAF8(D_8037E5C0.unk0))) { + sp44 = COMUSIC_2B_DING_B; + func_80328B8C(this, 6, 0.0f, 1); + actor_playAnimationOnce(this); + } else { + sp44 = COMUSIC_2C_BUZZER; + func_80328B8C(this, 1, 0.0f, 1); + } + + if (func_802DF5D0()) { + func_80328B8C(this, 8, 0.0f, 1); + actor_playAnimationOnce(this); + } + + timedFunc_set_2(0.25f, func_8025A6EC, sp44, 26000); + func_802DEA50(D_8037E5C0.unk0); + D_8037E5C0.unk0 = -1; + } + } + break; + + case 3://L802E0420 + if (animctrl_isStopped(this->animctrl) ) { + func_80328B8C(this, 2, 0.0f, 1); + actor_loopAnimation(this); + } + break; + + case 4://L802E0450 + if (animctrl_isStopped(this->animctrl) ) { + func_80328B8C(this, 2, 0.0f, 1); + actor_loopAnimation(this); + } + break; + + case 7://L802E0480 + if (animctrl_isStopped(this->animctrl) ) { + func_80328B8C(this, 2, 0.0f, 1); + actor_loopAnimation(this); + } + break; + + case 5://L802E04B0 + func_80328B8C(this, 1, 0.0f, 1); + break; + + case 6://L802E04CC + if (actor_animationIsAt(this, 0.5f) != 0) { + FUNC_8030E624(SFX_6C_LOCKUP_CLOSING, 1.0f, 24000); + } + if (animctrl_isStopped(this->animctrl) != 0) { + func_80328B8C(this, 1, 0.0f, 1); + actor_loopAnimation(this); + } + break; + + case 8://L802E0510 + break; + case 9://L802E0510 + break; + } + D_8037E5C0.unk20 = sp5C->button; + } +} + + +s32 func_802E0538(s32 indx){ + return D_8037E248[indx].unk0; +} + +//chHand_getState +s32 func_802E055C(void){ + Actor *this; + + this = marker_getActor(D_8037E060); + return this->state; +} + +s32 func_802E0588(s32 indx){ + return D_8037E248[indx].unk4; +} + +f32 *func_802E05AC(s32 indx) { + if (indx == D_8037E5C0.unk0) { + D_8037E5F8[0] = D_8036840C[0] + marker_getActor(D_8037E060)->position[0]; + D_8037E5F8[1] = D_8036840C[1] + marker_getActor(D_8037E060)->position[1]; + D_8037E5F8[2] = D_8036840C[2] + marker_getActor(D_8037E060)->position[2]; + } else { + ml_vec3f_assign(&D_8037E5F8, 0, 0, 0); + } + return &D_8037E5F8; +} + +f32 *func_802E0664(s32 indx){ + return D_8037E248[indx].unkC; +} + +f32 *func_802E068C(s32 indx){ + return D_8037E248[indx].unk1C; +} + +s32 func_802E06B4(void){ + return D_8037E5B8; +} + +bool func_802E06C0(void){ + return D_8037E5C0.unk24; +} + +void func_802E06CC(void){ + Actor *this; + + this = marker_getActor(D_8037E060); + func_80328B8C(this, 9, 0.0f, 1); + actor_playAnimationOnce(this); +} diff --git a/src/core2/code_59780.c b/src/core2/code_59780.c new file mode 100644 index 00000000..5b44b4c7 --- /dev/null +++ b/src/core2/code_59780.c @@ -0,0 +1,148 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802C71F0(Actor *); +extern void func_80325794(ActorMarker *); + +Actor *func_802E0738(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_802E07E0(Actor *this); +void func_802E08F0(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_80368440[]; + +extern ActorInfo D_80368450 = { + 0x72, 0xA2, 0x3AD, + 0x1, D_80368440, + func_802E08F0, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + + +extern ActorInfo D_80368474 = { + 0x8C, 0xBC, 0x45C, + 0, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_80368498 = { + 0x8D, 0xBD, 0x45E, + 0, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_803684BC = { + 0x13D, 0x2F4, 0x46E, + 0, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_803684E0 = { + 0x13E, 0x2F5, 0x46F, + 0, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_80368504 = { + 0x13F, 0x2F6, 0x3BB, + 0, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_80368528 = { + 0x140, 0x2F7, 0x3BB, + 0, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_8036854C = { + 0x141, 0x2F8, 0x3BB, + 0, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +extern ActorInfo D_80368570 = { + 0x142, 0x2F9, 0x3BB, + 0, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_802E0710(Actor *this){ + func_803253A0(this); + func_80361E9C(this); +} + +Actor *func_802E0738(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + f32 sp34[3]; + Actor *this; + + this = func_80325300(marker, &sp34); + func_8033A2D4(func_802E0710, this); + func_8033A2E8(func_80325794, marker); + func_803391A4(gfx, mtx, this->position, &sp34, this->scale, NULL, func_80330B1C(marker)); + return this; +} + + +void func_802E07C0(Actor *this){ + func_80361DC4(this); +} + +void func_802E07E0(Actor *this) { + s32 sp24; + + switch(this->marker->modelId){ + default: + sp24 = 0; + break; + + case 0x451: + case 0x458: + case 0x532: + sp24 = 1; + break; + } + + if(!this->unk16C_4) { + this->unk16C_4 = TRUE; + if (sp24) { + func_802C7318(this); + } + func_80361E10(this); + this->marker->unk30 = func_802E07C0; + } + + func_80326244(this); + if (this->unk48 == 1.0) { + marker_despawn(this->marker); + return; + } + if (sp24) { + this->unk130 = func_802C71F0; + func_802C7478(this); + } + func_80361EE0(this); +} + +void func_802E08F0(Actor *this) { + f32 sp24[3]; + + this->marker->collidable = FALSE; + animctrl_setDuration(this->animctrl, this->unk5C); + animctrl_setPlaybackType(this->animctrl, 1); + if (actor_animationIsAt(this, 0.99f) != 0) { + marker_despawn(this->marker); + } + func_8024C764(sp24); + this->yaw = sp24[1]; +} diff --git a/src/core2/code_599E0.c b/src/core2/code_599E0.c new file mode 100644 index 00000000..4859fe94 --- /dev/null +++ b/src/core2/code_599E0.c @@ -0,0 +1,14 @@ +#include +#include "functions.h" +#include "variables.h" + +s32 func_802E0970(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, bool arg5, f32 arg6[3]) { + f32 temp_f0; + f32 phi_f2; + + phi_f2 = (arg5) ? arg1 : arg2; + + temp_f0 = arg3 * 0.5; + func_8030E878(arg0, randf2(phi_f2 - temp_f0, phi_f2 + temp_f0), arg4, arg6, 1000.0f, 2300.0f); + return NOT(arg5); +} diff --git a/src/core2/code_59A80.c b/src/core2/code_59A80.c new file mode 100644 index 00000000..f7c94569 --- /dev/null +++ b/src/core2/code_59A80.c @@ -0,0 +1,103 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8035644C(s32); + +typedef struct { + s32 unk0; +}ActorLocal_Core2_59A80; + +void func_802E0B10(Actor *this); +s32 func_802E0CB0(Actor *this); + +/* .data */ + ActorInfo D_803685A0 = { + 0x39, 0x2D, 0x41A, + 0, NULL, + func_802E0B10, func_80326224, func_80325934, + 2000, 0, 0.0f, 0 +}; + +/* .bss */ +s32 D_8037E610; + +/* .code */ +void func_802E0A10(ActorMarker *marker, ActorMarker *other_marker){ + Actor *this; + + this = marker_getActor(marker); + mumboscore_set(func_802E0CB0(this), TRUE); + func_8030E760(0x401, 1.0f, 0x7fff); + timedFunc_set_1(0.75f, func_8035644C, 4); + func_802F3AC0(&marker->propPtr->x); + item_inc(ITEM_1C_MUMBO_TOKEN); + marker_despawn(marker); + +} + +s32 func_802E0A90(Actor *this){ + s32 id; + s32 sp18[3]; + + map_get(); + sp18[0] = (s32)this->position[0]; + sp18[1] = (s32)this->position[1]; + sp18[2] = (s32)this->position[2]; + id = func_80307164(sp18, this); + if(id < 0){ + return 0; + } + else{ + return func_80306DBC(id) - 199; + } +} + +void func_802E0B10(Actor *this){ + ActorLocal_Core2_59A80 *local; + f32 sp28[3]; + + local = (ActorLocal_Core2_59A80 *)&this->local; + if(!this->initialized){ + this->initialized = TRUE; + if(local->unk0 == NULL){ + if(!this->unk44_2){ + local->unk0 = D_8037E610; + } + else{ + local->unk0 = func_802E0A90(this); + } + } + if( mumboscore_get(local->unk0) + || func_803203FC(1) + || func_803203FC(2) + || func_803203FC(0x1F) + ){ + marker_despawn(this->marker); + return; + } + }//L802E0BD4 + + if(!func_8032BBE8(this)){ + marker_setCollisionScripts(this->marker, func_802E0A10, NULL, NULL); + } + + if(this->marker->unk14_21 && randf() < 0.1){ + sp28[0] = this->position[0] + randf2(-30.0f, 30.0f); + sp28[1] = this->position[1] + randf2(25.0f, 55.0f); + sp28[2] = this->position[2] + randf2(-30.0f, 30.0f); + func_803525A0(sp28); + } +} + +s32 func_802E0CB0(Actor *this){ + ActorLocal_Core2_59A80 *local; + f32 sp28[3]; + + local = (ActorLocal_Core2_59A80 *)&this->local; + return local->unk0; +} + +void func_802E0CB8(s32 mumbo_token_id){ + D_8037E610 = mumbo_token_id; +} diff --git a/src/core2/code_59D40.c b/src/core2/code_59D40.c new file mode 100644 index 00000000..94846173 --- /dev/null +++ b/src/core2/code_59D40.c @@ -0,0 +1,403 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 ml_vec3f_distance_squared(f32 [3], f32 [3]); +extern f32 func_80309B24(f32[3]); +extern void func_80328FF0(Actor *, f32); +extern void mapSpecificFlags_setN(s32, s32, s32); + +typedef struct { + s32 unk0; + s32 unk4; //opacity + f32 unk8; +}ActorLocal_core2_59D40; + + +void func_802E1168(Actor *this); + +/* .data */ +ActorAnimationInfo D_803685D0[] ={ + {0x000, 0.0f}, + {0x078, 2.0f}, + {0x078, 1.0f}, + {0x078, 0.4f}, + {0x078, 0.4f}, + {0x154, 1.1f}, + {0x078, 0.4f}, + {0x078, 1.0f}, + {0x273, 0.53f}, + {0x274, 1.09f} +}; + +ActorInfo D_80368620 = { + 0x14, 0x68, 0x3B0, + 0x1, D_803685D0, + func_802E1168, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .rodata */ +extern f32 D_80377050; +// extern jmptble D_80377054; +extern f64 D_80377080; +extern f32 D_80377088; +extern f64 D_80377090; +extern f64 D_80377098; + + +/* .bss */ +ActorMarker *D_8037E620; +f32 D_8037E628; +s32 D_8037E62C; +s32 D_8037E630; + +/* .code */ +void func_802E0CD0(Actor *this){ + this->unk28 = 4.0f; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_59D40/func_802E0CE0.s") +#else +void func_802E0CE0(Actor *this) { + s32 temp_v0; + + if (this->unk38_31 != 0) { + this->unk38_31--; + } + else{ + this->unk28 = 0.0f; + if (level_get() == LEVEL_2_TREASURE_TROVE_COVE) { + temp_v0 = mapSpecificFlags_getN(8, 3); + if( !this->unk138_24 ) { + if(temp_v0 < 4) { + if(func_80311480(0xA1B + temp_v0, 0, NULL, NULL, NULL, NULL)){ + mapSpecificFlags_setN(8, temp_v0++, 3); + this->unk138_24 = TRUE; + } + } + } + } + func_80328B8C(this, 3, 0.0f, -1); + } +} +#endif + +bool func_802E0DC0(f32 arg0[3]){ + f32 sp2C[3]; + f32 pad0; + + player_getPosition(sp2C); + // return (4000000.0f < ml_vec3f_distance_squared(sp2C, arg0)) + return (D_80377050 < ml_vec3f_distance_squared(sp2C, arg0)) + || ( (arg0[1] - func_80309724(arg0) < 70.0f) && (func_80309B24(arg0) - arg0[1] < 70.0f)); +} + +void func_802E0E88(Actor *this){ + this->unk28 = 2.0f; + func_80328B8C(this, 5, 0.0f, -1); + actor_playAnimationOnce(this); +} + +void func_802E0EC8(void){ + Actor *this; + ActorLocal_core2_59D40 *local; + + this = marker_getActor(D_8037E620); + local = (ActorLocal_core2_59D40 *)&this->local; + + actor_collisionOff(this); + D_8037E620->propPtr->unk8_3 = FALSE; + if(local->unk0 != 2){ + func_8032BB88(this, -1, 750); + comusic_8025AB44(COMUSIC_34_SNACKER_DANGER, 0, 750); + func_8025AABC(COMUSIC_34_SNACKER_DANGER); + local->unk0 = 2; + } +} + +void func_802E0F60(ActorMarker *marker, ActorMarker *other){ + Actor *this; + + this = marker_getActor(marker); + actor_collisionOff(this); + FUNC_8030E8B4(SFX_179_GRUNTY_DAMAGE, 0.6f, 32750, this->position, 300, 3000); + func_80328B8C(this, 9, 0.0f, 1); + actor_playAnimationOnce(this); +} + +void func_802E0FC4(Actor *this){ + D_8037E620 = NULL; + D_8037E630 = this->unk166; + if(func_8025AD7C(COMUSIC_34_SNACKER_DANGER)){ + func_8025AABC(COMUSIC_34_SNACKER_DANGER); + func_8025A7DC(COMUSIC_34_SNACKER_DANGER); + } +} + +void func_802E1010(ActorMarker *marker, ActorMarker *other){ + Actor *this; + + this = marker_getActor(marker); + func_80328B8C(this, 8, 0.0f, 1); + actor_playAnimationOnce(this); +} + +void func_802E1050(ActorMarker *marker, ActorMarker *other){ + Actor *this; + + this = marker_getActor(marker); + if(level_get() == LEVEL_2_TREASURE_TROVE_COVE && !func_8028F22C()){ + func_80311480(0xA29, 0, NULL, NULL, NULL, NULL); + }//L802E10A4 + + if(this->state == 4){ + if(func_803294F0(this, 80, func_80329784(this))){ + func_802E0E88(this); + } + }//L802E10E0 +} + +f32 func_802E10F0(f32 arg0) { + if ((arg0 >= 180.0f) && (arg0 < 330.0f)) { + return 330.0f; + } + if ((arg0 < 180.0f) && (arg0 > 30.0f)) { + return 30.0f; + } + return arg0; +} + + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_59D40/func_802E1168.s") +#else +void func_802E1168(Actor *this) { + f32 sp5C; + ActorLocal_core2_59D40 *local; + s32 sp54; + f32 sp48[3]; + f32 sp44; + f32 sp40; + s32 tmp; + + local = (ActorLocal_core2_59D40 *)&this->local; + sp5C = time_getDelta(); + + if (!this->initialized) { + this->initialized = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + this->unk138_25 = TRUE; + this->unk154 = 0x085E0000; + marker_setCollisionScripts(this->marker, func_802E1050, func_802E1010, func_802E0F60); + } + _player_getPosition(&sp48); + sp54 = func_8028A94C(); + + if(func_802E0DC0(this->position) || ((sp54 != 1) && (sp54 != 2))) { + local->unk8 = MIN(3.5, local->unk8 + sp5C); + if (3.5 == local->unk8) { + func_802E0EC8(); + } + } else { + local->unk8 = 0.0f; + } + + if(1); + switch(this->state){ + case 1: //802E12C8 + if (func_80328BD4(this, 2, 0.0f, 1, 0.03f) != 0) { + func_802E0CD0(this); + } + func_802E0CE0(this); + break; + + case 2: //802E130C + func_80328FB0(this, 3.0f); + func_80328FF0(this, 3.0f); + func_8032CA80(this, (D_8037E62C) ? 15 : 9); + if (func_80329480(this) != 0) { + func_80328CEC(this, (s32) this->yaw, 0x5A, 0x96); + } + func_80328BD4(this, 1, 0.0f, 1, 0.0075f); + func_802E0CE0(this); + break; + + case 3: //802E13AC + func_803297FC(this, &sp44, &sp40); + this->yaw_moving = sp40; + this->unk6C = func_802E10F0(sp44); + func_80328FB0(this, 4.0f); + func_80328FF0(this, 3.0f); + if (func_80329480(this)) { + func_80328B8C(this, 4, 0.0f, 1); + this->unk28 = 9.0f; + } + break; + + case 4: //802E1424 + func_803297FC(this, &sp44, &sp40); + this->yaw_moving = sp40; + this->unk6C = func_802E10F0(sp44); + func_80328FB0(this, this->unk28 / 2); + func_80328FF0(this, this->unk28 / 2); + this->unk28 = MIN(50.0, this->unk28 + sp5C); + func_8032CA80(this, (D_8037E62C) ? 15 : 9); + break; + + case 5: //802E14F8 + if (actor_animationIsAt(this, 0.25f)) { + FUNC_8030E8B4(SFX_6D_CROC_BITE, 1.0f, 28000, this->position, 300, 3000); + } + if (actor_animationIsAt(this, 0.99f)) { + func_802E0CD0(this); + func_80328CEC(this, (s32) this->yaw_moving, 0x87, 0xAF); + this->unk38_31 = 0x78; + func_80328B8C(this, 2, 0.0f, 1); + actor_loopAnimation(this); + } + func_8032CA80(this, (D_8037E62C) ? 15 : 9); + break; + + case 8: //802E15BC + if (animctrl_isStopped(this->animctrl)) { + func_802E0CD0(this); + func_80328B8C(this, 2, 0.0f, 1); + actor_loopAnimation(this); + } + break; + + case 9: //802E15FC + if (animctrl_isStopped(this->animctrl)) { + D_8037E628 = 60.0f; + D_8037E630 = 0x63; + func_802E0EC8(); + } + break; + }//L802E1630 + + local = (ActorLocal_core2_59D40 *)&this->local; + switch(local->unk0){ + case 0: + local->unk4 = MIN(0xFF, local->unk4 + 8); + if(local->unk4 >= 0x81){ + this->marker->collidable = TRUE; + } + if (local->unk4 == 0xFF) { + local->unk0 = 1; + } + break; + + case 1: + break; + + case 2: + local->unk4 = MAX(0, local->unk4 - 8); + if(local->unk4 < 0x80){ + this->marker->collidable = FALSE; + } + if (local->unk4 == 0) { + marker_despawn(this->marker); + } + break; + } + + actor_setOpacity(this, local->unk4); + this->unk124_9 = (255.0 == local->unk4) ? 1 : 2; +} +#endif + +extern f32 D_8037E624; +void func_802E1790(void){ + D_8037E624 = 0.0f; + D_8037E628 = 1.0f; + D_8037E620 = NULL; + D_8037E62C = (level_get() == LEVEL_9_RUSTY_BUCKET_BAY); + D_8037E630 = 0x63; +} + +void func_802E17E8(void) { + Actor *snacker; + f32 sp50[3]; + f32 sp4C; + ActorLocal_core2_59D40 *local; + s32 pad; + f32 sp38[3]; + f32 sp2C[3]; + f32 sp20[3]; + + + _player_getPosition(sp50); + if (func_803203FC(0xC1) != 0) { + nodeprop_getPosition(func_80304CAC(0x3CB, sp50), sp50); + } + else{ + sp4C = randf2(0.0f, D_80377088); + // temp_f0 = randf2(0.0f, 3.28f); + sp50[0] += D_80377090 * cosf(sp4C); + sp50[2] += D_80377098 * sinf(sp4C); + + sp38[0] = sp50[0]; + sp38[1] = sp50[1]; + sp38[2] = sp50[2]; + sp38[1] += 1000.0f; + + sp2C[0] = sp50[0]; + sp2C[1] = sp50[1]; + sp2C[2] = sp50[2]; + sp2C[1] -= 1000.0f; + + + if (func_80309B48(sp38, sp2C, sp20, 0xF800FF0F)) { + sp50[1] = sp2C[1] - 60.0f; + } + else{ + return; + } + } + + snacker = func_8032813C(0x68, sp50, 0); + D_8037E620 = snacker->marker; + + local = (ActorLocal_core2_59D40 *)&snacker->local; + snacker->unk166 = (s8) D_8037E630; + local->unk0 = 0; + local->unk4 = 0; + local->unk8 = 0.0f; + func_803300D8(D_8037E620, func_802E0FC4); + if (func_8032CA80(snacker, D_8037E62C ? 0x10 : 0xC)) { + marker_despawn(D_8037E620); + return; + } + if (func_803203FC(0xC1) == 0) { + func_8032BB88(snacker, 0x1388, 0x2EE); + func_8024BD08(0); + func_8025A6EC(0x34, 0); + comusic_8025AB44(0x34, 0x7FFF, 0x2EE); + func_8024BD08(1); + } + D_8037E624 = 0.0f; + func_8032CA80(snacker, D_8037E62C ? 15 : 9); +} + +void func_802E1A04(s32 nextState) { + f32 sp1C; + + sp1C = time_getDelta(); + + if( getGameMode() == GAME_MODE_A_SNS_PICTURE + || getGameMode() == 5 + || getGameMode() == GAME_MODE_6_FILE_PLAYBACK + ){ + return; + } + + if ((D_8037E620 == NULL)) { + D_8037E624 += sp1C; + if ((D_8037E628 < D_8037E624) && (nextState != 0)) { + func_802C3BF8(func_802E17E8); + D_8037E628 = 1.0f; + } + } +} diff --git a/src/core2/code_5B6A0.c b/src/core2/code_5B6A0.c new file mode 100644 index 00000000..7b545dd5 --- /dev/null +++ b/src/core2/code_5B6A0.c @@ -0,0 +1,183 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80329904(ActorMarker *, s32, f32 *); +extern int func_80320C94(f32 (*)[3], f32(*)[3], f32, s32, s32, u32); +extern f32 func_8033229C(f32, f32, ActorMarker *, void*); + +typedef struct{ + s32 unk0; + s32 unk4; +}ActorLocal_core2_5B6A0; + +Actor *func_802E2630(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_802E28D0(Actor *this); + +/* .data */ +extern ActorInfo D_80368710 = { + 0xB2, 0x125, 0x378, + 0x1, NULL, + func_802E28D0, func_80326224, func_802E2630, + 0, 0x800, 0.8f, 0 +}; + +extern f32 D_803687A4[4]; +extern struct31s D_80368734; +extern struct43s D_8036875C; + +/* .rodata */ +extern f64 D_803770F0; +extern f64 D_803770F8; + +/* .bss */ +f32 D_8037E640[3]; + +/* .code */ +Actor *func_802E2630(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *this; + + this = func_80325888(marker, gfx, mtx, vtx); + if (marker->unk14_21 && this->state != 2) { + func_8033E73C(marker, 5, func_80329904); + func_8033E3F0(0xD, marker->unk14_21); + } + return this; +} + + +void func_802E26A4(f32 position[3]) { + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(8); + particleEmitter_setModel(pCtrl, 0x37A); + particleEmitter_setPosition(pCtrl, position); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8036875C); + func_802EFE24(pCtrl, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); + func_802EFB98(pCtrl, &D_80368734); + particleEmitter_emitN(pCtrl, 8); +} + +void func_802E2748(Actor *this, s32 arg1) { + if (arg1 != 0) { + D_8037E640[0] = this->position[0]; + D_8037E640[1] = this->position[1]; + D_8037E640[2] = this->position[2]; + D_8037E640[1] -= 40.0f; + func_80359A40(D_8037E640, D_803687A4, 3); + func_802F4200(D_8037E640); + func_802F3FE4(D_8037E640); + func_8030E878(SFX_2F_ORANGE_SPLAT, 1.0f, 10000, this->position, 1250.0f, 2500.0f); + func_8030E878(SFX_F_SMALL_WATER_SPLASH, randf2(0.8f, 1.2f), 32000, this->position, 1250.0f, 2500.0f); + actor_collisionOff(this); + func_80326310(this); + func_80328A84(this, 2U); + } + else{ + func_8030E878(SFX_2F_ORANGE_SPLAT, 1.0f, 32000, this->position, 1250.0f, 2500.0f); + func_802E26A4(this->position); + marker_despawn(this->marker); + } +} + + +void func_802E28A4(ActorMarker *marker, ActorMarker *other_marker){ + Actor *this; + + this = marker_getActor(marker); + func_802E2748(this, 0); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5B6A0/func_802E28D0.s") +#else +void func_802E28D0(Actor *this) { + ActorLocal_core2_5B6A0 *local; + f32 sp7C[3]; + f32 sp70[3]; + f32 sp64[3]; + f32 sp58[3]; + Actor *phi_a1; + u32 *temp_v0_3; + s32 phi_a1_2; + s32 i; + + if(this->unk38_31 == 0 && func_80329530(500)){ + FUNC_8030E8B4(SFX_C_TAKING_FLIGHT_LIFTOFF, 0.85f, 32000, this->position, 1250, 2500); + this->unk38_31 = 1; + } + + phi_a1 = NULL; + local = (ActorLocal_core2_5B6A0 *)&this->local; + + if(!this->initialized){ + marker_setCollisionScripts(this->marker, NULL, NULL, func_802E28A4); + if(local->unk0 == 0){ + player_getPosition(this->unk1C); + return; + } + this->initialized = TRUE; + player_getPosition(sp7C); + sp7C[1] += 1.0f; + phi_a1_2 = (func_8023DB5C() & 1) ? 0x15 : 0x2B; + phi_a1 = &this; + for(i = 0; i < 3; i++){ + sp58[i] = (sp7C[i] - this->unk1C[i]) * phi_a1_2; + } + + this->velocity[0] = (sp58[0] - this->position[0])/32; + this->velocity[1] = (sp58[1] - this->position[1])/32 - -32.0f; + this->velocity[2] = (sp58[2] - this->position[2])/32; + local->unk4 = 0; + this->unk60 = 6.0f; + } + switch (this->state) { + case 1: + sp64[0] = this->position[0]; + sp64[1] = this->position[1]; + sp64[2] = this->position[2]; + this->position[0] += this->velocity[0]; + this->position[1] += this->velocity[1]; + this->position[2] += this->velocity[2]; + + this->pitch += 10.0f; + this->velocity_y -= 2.0f; + this->yaw += 10.0f; + + if(this->pitch > 360.0f){ + this->pitch -= 360.0f; + } + if (this->yaw > 360.0f) { + this->yaw -= 360.0f; + } + if (local->unk4 >= 6) { + temp_v0_3 = func_80320C94(sp64, this->position, func_8033229C(360.0f, 10.0f, this->marker, phi_a1) * 1.2, &sp70, 5, 0); + if (temp_v0_3 != 0) { + func_802E2748(this, *((u32*)temp_v0_3 + 2) & 0x20000); + return; + } + } + local->unk4++; + if (this->unk60 > 0.0) { + this->unk60 -= time_getDelta(); + } else { + marker_despawn(this->marker); + } + + if (this->position_y < -1000.0f) { + marker_despawn(this->marker); + } + break; + case 2: + this->marker->unk40_22 = NOT(func_8028F170()); + this->velocity[0] += 0.7; + this->velocity[1] += 0.7; + this->velocity[2] += 0.7; + this->position[0] += this->velocity[0]; + this->position[1] += this->velocity[1]; + this->position[2] += this->velocity[2]; + break; + } +} +#endif + diff --git a/src/core2/code_5BD90.c b/src/core2/code_5BD90.c new file mode 100644 index 00000000..f480b43e --- /dev/null +++ b/src/core2/code_5BD90.c @@ -0,0 +1,39 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_802E2D20(Actor *this); + +/* .data */ +ActorInfo D_803687C0 = { + 0xB3, 0x126, 0x379, + 0x1, NULL, + func_802E2D20, func_80326224, func_80325888, + 4500, 0, 1.0f, 0 +}; + +/* code */ +void func_802E2D20(Actor *this){ + switch(this->state){ + case 1: + this->position[0] += this->velocity[0]; + this->position[1] += this->velocity[1]; + this->position[2] += this->velocity[2]; + + this->velocity[1] += -3.0f; + + this->pitch += 10.0f; + if( 360.0f <= this->pitch) + this->pitch -= 360.0f; + + if(this->position_y <= func_80309724(this->position)){ + func_80328A84(this, 2); + FUNC_8030E8B4(SFX_1D_HITTING_AN_ENEMY_1, 1.0f, 32750, this->position, 2250, 4500); + } + break; + + case 2: + func_80326310(this); + break; + } +} diff --git a/src/core2/code_5BEB0.c b/src/core2/code_5BEB0.c new file mode 100644 index 00000000..2c077857 --- /dev/null +++ b/src/core2/code_5BEB0.c @@ -0,0 +1,629 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "gc/gctransition.h" + +void func_8024CE60(f32, f32); + + +void func_802E40A8(s32 map, s32 exit); +void func_802E40C4( s32 arg0); +void func_802E40D0(s32 map, s32 exit); +void func_802E40E8(s32 transition); +int func_802E4A08(void); + +f32 func_8033DC20(void); +void func_8033DC9C(f32); +extern void func_80324C58(void); + + +extern f32 D_80377110; +extern f32 D_80377114; + +extern s32 D_8037E8EC; + +extern struct{ + s32 unk0; + s32 game_mode; //game_mode + f32 unk8; + s32 unkC; //freeze_scene_flag (used for pause menu) + f32 unk10; + u8 unk14; // + u8 unk15; //map + u8 unk16; //exit + u8 unk17; //reset_on_map_load + u8 unk18; + u8 unk19; + u8 unk1A; + u8 unk1B; + u8 unk1C; +} D_8037E8E0; + +typedef struct map_savestate_s{ + u32 flags; +}MapSavestate; + +extern MapSavestate *D_8037E650[]; + +void func_802E3BD0(s32 arg0); +int func_802E49F0(void); + +/* .code */ + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E2E40.s") +#else +void func_802E2E40(void){ + int i; + for(i = 0; i < 0x9A; i++){ + D_8037E650[i] = 0; + } +} +#endif + +void mapSavestate_free_all(void){ + int i; + for(i = 0; i < 0x9A; i++){ + if(D_8037E650[i]){ + free(D_8037E650[i]); + D_8037E650[i] = NULL; + } + } +} + +void mapSavestate_defrag_all(void){ + int i; + for(i = 0; i < 0x9A; i++){ + if(D_8037E650[i]){ + D_8037E650[i] = defrag(D_8037E650[i]); + } + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/mapSavestate_save.s") +#else +void mapSavestate_save(enum map_e map){ + u32 wSize; + volatile u32 * sp38; + s32 iBit; + s32 bit_max; + s32 reg_s4; + u32* reg_v1; + u32* valPtr; + + + wSize = 4; + if(D_8037E650[map]) + free(D_8037E650[map]); + + D_8037E650[map] = (MapSavestate *) malloc(4*sizeof(u32)); + sp38 = D_8037E650[map]; + + *sp38 = mapSpecificFlags_getAll(); + + iBit = 0x20; + func_80308230(1, D_8037E650[map]); + func_803083B0(-1); + + for(reg_s4 = func_803083B0(-2); reg_s4 != -1; reg_s4 = func_803083B0(-2, valPtr)){ + if( !(iBit < wSize*sizeof(u32)*8)){ + wSize += 4; + D_8037E650[map] = (MapSavestate *)realloc( D_8037E650[map], wSize*sizeof(u32)); + reg_v1 = ((s32)D_8037E650[map] + wSize*sizeof(u32)); + reg_v1[-1] = 0; + reg_v1[-2] = 0; + reg_v1[-3] = 0; + reg_v1[-4] = 0; + } + valPtr = D_8037E650[map]; + valPtr[(iBit >> 5)] = (reg_s4) + ? valPtr[(iBit >> 5)] | (1 << (iBit & 0x1f)) + : valPtr[(iBit >> 5)] & ~(1 << (iBit & 0x1f)); + + iBit++; + + } + //if(sp38); + D_8037E650[map] = actors_appendToSavestate( D_8037E650[map], (s32)D_8037E650[map] + 16*((iBit + 0x7F) >> 7)); +} +#endif + +//mapSavestate_apply +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/mapSavestate_apply.s") +// void mapSavestate_apply(enum map_e map){ +// u32 **mssp = D_8037E650 + map; +// int s0; +// int val; +// u8 *tmp; +// if(*mssp){ +// mapSpecificFlags_setAll(**mssp); +// func_80308230(1); +// func_803083B0(-1); +// for(s0 = 0x20; func_803083B0((((*mssp)[s0 >> 5]) & (1 << (s0 & 0x1f)))? 1 : 0) != -1; s0++); +// func_80308230(0); +// tmp = *mssp; +// func_8032A09C(tmp, (tmp + 16*((s0 + 0x7f) >> 7))); +// free(*mssp); +// *mssp = NULL; +// } +// } + +//===== BREAK ======// + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E31D0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E329C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E3460.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E3524.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E3580.s") + +void func_802E35D0(void){} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E35D8.s") + +extern void func_8024C510(f32); +extern void func_8024CDF8(f32, f32, f32); +extern void func_8024CE40(f32, f32, f32); + +void func_802E3800(void){ + func_8024CDF8(0.0f, 0.0f, 0.0f); + func_8024CE40(-30.0f, 30.0f, 0.0f); + func_8024C510(D_80377110); + func_8024CFD4(); +} + +void func_802E3854(void){ + int i; + + func_8033B61C(); + func_80254464(); + for(i = 0; i < 0xF; i++){ + func_802E6820(5); + func_8033A4D8(); + mapSavestate_defrag_all(); + gctransition_8030B740(); + func_802F542C(); + func_80350E00(); + func_802FA4E0(); + func_8033B5FC(); + timedFuncQueue_defrag(); + func_8025AF38(); + } +} + +void func_802E38E8(enum map_e map, s32 exit, s32 reset_on_load){ + if(reset_on_load || level_get() != map_getLevel(map)){ + func_8030AFD8(1); + func_80321854(); + func_803216D0(map); //load_map_asm + func_8030AFA0(map); + } + else{ + func_8030AFD8(1); + func_8030AFA0(map); + } + func_802FA508(); + func_80334B20(map, exit, 0); + func_802E3800(); + func_8033DC10(); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E398C.s") + +void func_802E39D0(Gfx **gdl, Mtx **mptr, Vtx **vptr, s32 arg3, s32 arg4){ + Mtx* m_start = *mptr; + Vtx* v_start = *vptr; + + func_802539AC(gdl, arg3); + D_8037E8E0.unkC = FALSE; + func_80334540(gdl, mptr, vptr); + if(!arg4){ + func_802E67AC(); + func_802E3BD0(func_8024BDA0()); + func_802E67C4(); + func_802E5F10(gdl); + } + if( D_8037E8E0.game_mode == GAME_MODE_A_SNS_PICTURE + && D_8037E8E0.unk19 != 6 + && D_8037E8E0.unk19 != 5 + ){ + gctransition_draw(gdl, mptr, vptr); + } + + if( D_8037E8E0.game_mode == GAME_MODE_8_BOTTLES_BONUS + || D_8037E8E0.game_mode == GAME_MODE_A_SNS_PICTURE + ){ + func_8030C2D4(gdl, mptr, vptr); + } + + if(!func_802E49F0() && func_80335134()){ + func_8032D474(gdl, mptr, vptr); + } + + func_80314320(gdl, mptr, vptr); + if(!func_802E49F0()){ + func_8025AFC0(gdl, mptr, vptr); + } + + func_8030F410(gdl, mptr, vptr); + if(!func_802E49F0()){ + func_802FAB54(gdl, mptr, vptr); + } + + printbuffer_draw(gdl, mptr, vptr); + + if( D_8037E8E0.game_mode != GAME_MODE_A_SNS_PICTURE + || D_8037E8E0.unk19 == 6 + || D_8037E8E0.unk19 == 5 + ){ + gctransition_draw(gdl, mptr, vptr); + } + func_80253DE0(gdl); + osWritebackDCache(m_start, sizeof(Mtx)*( *mptr - m_start)); + osWritebackDCache(v_start, sizeof(Vtx)*( *vptr - v_start)); +} + +void func_802E3BD0(s32 arg0){ + func_8024A85C(arg0); +} + +void func_802E3BF0(void){ + return; +} + +//_set_game_mode +void func_802E3BF8(enum game_mode_e next_mode, s32 arg1){ + s32 prev_mode = D_8037E8E0.game_mode; + s32 sp20; + s32 sp1C; + + if( ( ( D_8037E8E0.game_mode == GAME_MODE_3_NORMAL || func_802E4A08()) + && next_mode != GAME_MODE_4_PAUSED + ) + || ( D_8037E8E0.game_mode == GAME_MODE_4_PAUSED && next_mode != GAME_MODE_3_NORMAL ) + ){ + func_80324C58(); + } + + if(D_8037E8E0.game_mode == GAME_MODE_4_PAUSED && next_mode != GAME_MODE_4_PAUSED ){ + func_803117E8(); + } + + //L802E3C84 + if(next_mode == GAME_MODE_8_BOTTLES_BONUS || next_mode == GAME_MODE_A_SNS_PICTURE){ + func_8030C1A0(); + } + else{ + func_8030C204(); + }//L802E3CB4 + + D_8037E8E0.game_mode = next_mode; + + if(next_mode == 2){ + func_80334E1C(3); + } + else if(next_mode == GAME_MODE_3_NORMAL || func_802E4A08()){ + if(prev_mode != GAME_MODE_4_PAUSED) { + func_80334E1C(2); + }//L802E3D18 + if(arg1){ + sp20 = FALSE; + if(next_mode == GAME_MODE_3_NORMAL){ + if(func_803203FC(0x1F)){ + sp20 = TRUE; + sp1C = 7; + } + else if(func_8032190C() + && level_get() != LEVEL_C_BOSS + && level_get() != LEVEL_B_SPIRAL_MOUNTAIN + && level_get() != LEVEL_6_LAIR + && level_get() != LEVEL_D_CUTSCENE + ){ + sp20 = TRUE; + sp1C = 1; + } + } + else if(func_802E4A08()){//L802E3DBC + sp20 = TRUE; + sp1C = func_8034BDA4(D_8037E8E0.unk15, D_8037E8E0.unk16); + } + + if(sp20) + gctransition_8030BEA4(sp1C); + else + gctransition_8030BD4C(); + } + func_80346CA8(); + D_8037E8E0.unk10 = 0.0f; + } + else if(next_mode == GAME_MODE_4_PAUSED){//L802E3E24 + func_80335110(0); + FUNC_8030E624(SFX_C9_PAUSEMENU_ENTER, 1.1f, 32750); + func_8024E7C8(); + func_8025A430(0, 2000, 3); + func_8025A23C(COMUSIC_6F_PAUSE_SCREEN); + func_80312B8C(); + }//L802E3E6C +} + +void func_802E3E7C(enum game_mode_e mode){ + s32 sp34; + s32 sp30; + s32 map; + s32 sp28; + s32 prev_mode; + + func_80254008(); + sp34 = D_8037E8E0.unk18; + sp30 = D_8037E8E0.unk17; + map = D_8037E8E0.unk15; + sp28 = D_8037E8E0.unk16; + prev_mode = D_8037E8E0.unk0; + func_802E3BF8(2, 0); + if(!func_80320454(0x21, 0) || map_getLevel(map_get()) == map_getLevel(D_8037E8E0.unk15)){ + if(!func_803203FC(0x1F)) + mapSavestate_save(map_get()); + } + func_802E398C(1); + func_802E38E8(map, sp28, sp34); + mapSavestate_apply(map); + D_8037E8E0.unk0 = prev_mode; + func_802E3BF8(mode, sp30); + func_80332CCC(); + func_80346CA8(); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E3F80.s") + +//game_draw +void func_802E3F8C(s32 arg0){ + Gfx *sp34; + Gfx *sp30; + Gfx *sp2C; + Mtx *sp28; + Vtx *sp24; + if(arg0){ + func_80254348(); + } + + func_80254404(&sp34, &sp28, &sp24); + if(D_8037E8EC == 1){ + func_80254404(&sp34, &sp28, &sp24); + } + sp30 = sp34; + func_802E39D0(&sp34, &sp28, &sp24, func_8024BDA0(), arg0); + if(D_8037E8EC == 0){ + sp2C = sp34; + func_8024C1DC(); + func_80253EC4(sp30, sp2C); + if(arg0){ + func_80254348(); + } + } +} + +void func_802E4048(s32 map, s32 exit, s32 transition){ + func_802E40A8(map, exit); + func_802E40E8(transition); + func_802E40C4(1); +} + +//take me there +extern void func_802E4078(enum map_e map, s32 exit, s32 transition){ + func_802E40D0(map, exit); + func_802E40E8(transition); + func_802E40C4(1); +} + +void func_802E40A8(s32 map, s32 exit){ + D_8037E8E0.unk18 = 1; + D_8037E8E0.unk15 = map; + D_8037E8E0.unk16 = exit; +} + +void func_802E40C4( s32 arg0){ + D_8037E8E0.unk14 = arg0; +} + +void func_802E40D0(s32 map, s32 exit){ + D_8037E8E0.unk18 = 0; + D_8037E8E0.unk15 = map; + D_8037E8E0.unk16 = exit; +} + +void func_802E40E8(s32 transition){ + D_8037E8E0.unk17 = transition; + D_8037E8E0.unk19 = 0; + if(transition && !gctransition_8030BDC0()){ + gctransition_8030BE60(); + } + +} + +void func_802E412C(s32 arg0, s32 arg1){ + D_8037E8E0.unk17 = arg0; + D_8037E8E0.unk19 = arg1; + if(arg0 && !gctransition_8030BDC0()){ + gctransition_8030BEA4(arg1); + } +} + +void func_802E4170(void){ + func_802E3BF8(2,0); + func_80240844(); + func_802E5F68(); + if(!func_802E4A08()) + func_802F4F64(); + timedFuncQueue_free(); + func_802F9C48(); + func_8033A17C(); + func_80253420(); + func_802E398C(0); + func_8030AFD8(0); + func_80321854(); + func_8031FBF8(); + func_802880C0(); + func_80259B14(); + func_8030D8DC(); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E4214.s") +#else +// //99.9% there +void func_802E4214(s32 arg0){ + D_8037E8E0.unk14 = 0; + D_8037E8E0.unk18 = 0; + D_8037E8E0.unk19 = 0; + D_8037E8E0.unk17 = 0; + D_8037E8E0.unk16 = 0; + D_8037E8E0.unk15 = 0; + D_8037E8E0.unk1A = 0; + D_8037E8E0.unk1B = 0; + D_8037E8E0.unkC = 0; + D_8037E8E0.unk1C = 0; + func_8033C070(); + func_8025B0E4(); + func_8030D86C(); + func_80259A24(); + func_80322764(); + timedFuncQueue_init(); + func_802F9CD8(); + func_8031B62C(); + if(!func_802E4A08()) + func_802F51B8(); + func_802E5F38(); + func_802407C0(); + func_8033A1A4(); + func_80253428(1); + func_80288070(); + func_8024CCC4(); + func_8024CE60(1.0f, D_80377114); + func_8034A6B4(); + func_80254348(); + func_80253FE8(); + func_8033DC70(); + func_8033DC04(); + func_8031FBA0(); + D_8037E8E0.game_mode = 2; + D_8037E8E0.unk8 = 0.0f; + func_8033DC9C(0.0f); + func_8033DD04(0); + func_803216D0(arg0); + func_8030AFA0(arg0); + func_802E3854(); + func_802E38E8(arg0, 0, 0); + D_8037E8E0.unk0 = 0; + func_802E3BF8(3,1); +} +#endif + +void func_802E4384(void){ + if(D_8037E8E0.unk8 == 0.0f){ + func_8033DC9C(0.0f); + } + else{ + func_8033DC18(); + ; + func_8033DD04((s32)(func_8033DC20()*60.0f + 0.5)); + } + func_8033DC10(); + + D_8037E8E0.unk8 += time_getDelta(); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E4424.s") + +void func_802E48B8(enum GAME_MODE_E mode, s32 arg1){ + func_802E3BF8(mode, arg1); +} + +s32 func_802E48D8(void){ + func_802555C4(); + if( !level_get() ) + return NULL; + + func_80343F3C(); + func_80288470(); + func_802F1320(); + func_802BA128(); + func_8033A4D8(); + func_8028FB68(); + func_802F0E58(); + func_8030A298(); + func_803086B4(); + func_8032AF94(); + func_802C4320(); + func_802F3300(); + func_802F542C(); + func_8031169C(); + if(D_8037E8E0.game_mode == 4) + func_80311740(); + switch(get_loaded_overlay_id()){ + case OVERLAY_2_WHALE: + func_803894A0(); + break; + case OVERLAY_D_WITCH: + func_80350E00(); + break; + } + return func_802555D0(); +} + +void func_802E49E0(void){ + D_8037E8E0.unkC = TRUE; +} + +int func_802E49F0(void){ + return D_8037E8E0.unkC; +} + +s32 getGameMode(void){ + return D_8037E8E0.game_mode; +} + +int func_802E4A08(void){ + return (D_8037E8E0.game_mode == GAME_MODE_6_FILE_PLAYBACK) + || (D_8037E8E0.game_mode == 5) + || (D_8037E8E0.game_mode == GAME_MODE_7_ATTRACT_DEMO) + || (D_8037E8E0.game_mode == GAME_MODE_8_BOTTLES_BONUS) + || (D_8037E8E0.game_mode == GAME_MODE_9_BANJO_AND_KAZOOIE) + || (D_8037E8E0.game_mode == GAME_MODE_A_SNS_PICTURE); +} + +void func_802E4A70(void){ + D_8037E8E0.unk1C = 1; +} + +void func_802E4A80(void){ + D_8037E8E0.unk1C = 0; +} + +u8 func_802E4A8C(void){ + return D_8037E8E0.unk1C; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E4A98.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E4AAC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E4AC0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E4AD4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E4AE8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E4AFC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E4B10.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5BEB0/func_802E4B24.s") + +f32 func_802E4B38(void){ + return D_8037E8E0.unk8; +} \ No newline at end of file diff --git a/src/core2/code_5DBC0.c b/src/core2/code_5DBC0.c new file mode 100644 index 00000000..caff8f3a --- /dev/null +++ b/src/core2/code_5DBC0.c @@ -0,0 +1,304 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + void *unk0; + u8 pad4[0x4]; + s32 *unk8; + u8 padC[0x4]; +}struct5DBC0_3s; + +typedef struct { + BKSprite *unk0; + u8 unk4; + // u8 pad5[0x3]; + BKSpriteTextureBlock **unk8; + u8 unkC; + u8 unkD; + u8 padE[0x2]; +}struct5DBC0_2s; + +typedef struct { + s32 unk0; + s32 unk4; + s32 unk8; + u16 unkC; + u8 unkE; + u8 padF[1]; + u8 unk10[0xC]; +}struct5DBC0_1s; + +typedef struct { + struct5DBC0_1s * unk0; + struct5DBC0_2s * unk4; + char * string; + s32 unkC; + s32 unk10; + s32 string_len; + u32 flags; + u8 unk1C[3]; + u8 pad1F[1]; +}struct5DBC0s; + +extern u8 D_80368830[3] = {0,0,0}; + +extern struct5DBC0s * D_8037E900; + +struct5DBC0s *func_802E4B50(void){ + u8 sp24[3] = D_80368830; + D_8037E900 = (struct5DBC0s *)malloc(sizeof(struct5DBC0s)); + D_8037E900->unk0 = (struct5DBC0_1s *) malloc(sizeof(struct5DBC0_1s)); + D_8037E900->unkC = 0; + D_8037E900->unk4 = (struct5DBC0_2s *) malloc(sizeof(struct5DBC0_2s)); + D_8037E900->unk10 = 0; + D_8037E900->string = (char *) malloc(sizeof(char)); + D_8037E900->string_len = 0; + D_8037E900->flags = 0; + D_8037E900->unk1C[0] = sp24[0]; + D_8037E900->unk1C[1] = sp24[1]; + D_8037E900->unk1C[2] = sp24[2]; + return D_8037E900; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E4C0C.s") +// s32 func_802E4C0C(struct5DBC0_3s * arg0, u32 arg1){ +// u32 i, v0; +// for(i = arg1; i > 0; i--){ +// v0 = i - 1; +// assetcache_release(arg0[v0].unk0); +// free(arg0[v0].unk8); +// } +// free(arg0); +// } + +void func_802E4C78(void){ + if(D_8037E900->unk0 != NULL){ + free(D_8037E900->unk0); + } + if(D_8037E900->unk4 != NULL){ + func_802E4C0C(D_8037E900->unk4, D_8037E900->unk10); + } + if(D_8037E900->string != NULL){ + free(D_8037E900->string); + } + free(D_8037E900); + D_8037E900 = NULL; +} + +extern s32 func_802E4CF8(u8); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E4CF8.s") + +BKSpriteTextureBlock *func_802E4D5C(s32 arg0, char arg1){ + return D_8037E900->unk4[arg0].unk8[arg1 - 0x21]; +} + +BKSpriteTextureBlock **func_802E4D8C(BKSprite *sprite) { + BKSpriteFrame *frame; + BKSpriteTextureBlock **chunkPtrArray; + BKSpriteTextureBlock *chunk; + s32 var_v1; + s32 i; + s32 chunk_size; + + frame = spriteGetFramePtr(sprite, 0); + chunkPtrArray = (BKSpriteTextureBlock **)malloc((frame->chunkCnt + 1)*4); + chunk = (BKSpriteTextureBlock *)(frame + 1); + for (i = 0; i < frame->chunkCnt; i++) { + chunkPtrArray[i] = chunk; + chunk_size = (chunk->w * chunk->h); + var_v1 = (s32)(chunk + 1); + while ((var_v1 % 8)) {var_v1++;} + chunk = (BKSpriteTextureBlock *)(var_v1 + chunk_size); + } + return chunkPtrArray; +} + +s32 func_802E4E54(u8 arg0) { + s32 sp24; + + sp24 = func_802E4CF8(arg0); + if (sp24 == -1) { + sp24 = D_8037E900->unk10++; + if (D_8037E900->unk10 > 1) { + D_8037E900->unk4 = (struct5DBC0_2s *)realloc(D_8037E900->unk4, (D_8037E900->unk10 + 1)*sizeof(struct5DBC0_2s)); + } + D_8037E900->unk4[sp24].unk4 = arg0; + D_8037E900->unk4[sp24].unk0 = (BKSprite *)assetcache_get(arg0 + 0x6E9); + D_8037E900->unk4[sp24].unk8 = func_802E4D8C(D_8037E900->unk4[sp24].unk0); + D_8037E900->unk4[sp24].unkC = D_8037E900->unk4[sp24].unk8[0x36]->x/2; + D_8037E900->unk4[sp24].unkD = D_8037E900->unk4[sp24].unk8[0x36]->y; + } + func_802E6820(5); + return sp24; +} + +s32 func_802E4F98(char *arg0) { + s32 sp1C; + s32 temp_a2; + + + sp1C = D_8037E900->string_len; + D_8037E900->string_len += strlen(arg0) + 1; + if (D_8037E900->string_len >= 2) { + D_8037E900->string = (char *)realloc(D_8037E900->string, D_8037E900->string_len + 1); + } + strcpy(D_8037E900->string + sp1C, arg0); + return sp1C; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E502C.s") + +void func_802E5188(void){ + D_8037E900->unkC = 0; + D_8037E900->string_len = 0; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E51A4.s") +#else +s32 func_802E51A4(char *str, s32 arg1, s32 start, u32 flags) { + s32 tab_width; + s32 position; + char *var_s1; + s32 i; + + if (flags & 2) { + return 2 * D_8037E900->unk4[arg1].unkC *strlen(str); + } + + position = start; + for(var_s1 = str; *var_s1 != '\0'; var_s1++){ + if (*var_s1 == ' ') { + position += D_8037E900->unk4[arg1].unkC; + } else if (*var_s1 == '\t') { + position++; + tab_width = 4*D_8037E900->unk4[arg1].unkC; + while (position % tab_width) { position++; }; + } else { + position += func_802E4D5C(arg1, *var_s1)->x; + } + } + return position - start; +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E533C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E57E0.s") + +void func_802E5C98(Gfx **gdl){ + int i; + + gDPPipeSync((*gdl)++); + gSPClearGeometryMode((*gdl)++, G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH); + gSPTexture((*gdl)++, 0, 0, 0, G_TX_RENDERTILE, G_OFF); + gSPSetGeometryMode((*gdl)++, G_TEXTURE_GEN_LINEAR); + gDPSetCycleType((*gdl)++, G_CYC_1CYCLE); + gDPPipelineMode((*gdl)++, G_PM_NPRIMITIVE); + gDPSetTextureLOD((*gdl)++, G_TL_TILE); + gDPSetTextureLUT((*gdl)++, G_TT_NONE); + gDPSetTextureDetail((*gdl)++, G_TD_CLAMP); + gDPSetTexturePersp((*gdl)++, G_TP_NONE); + gDPSetTextureFilter((*gdl)++, G_TF_BILERP); + gDPSetTextureConvert((*gdl)++, G_TC_FILT); + gDPSetAlphaCompare((*gdl)++, G_AC_NONE); + gDPSetRenderMode((*gdl)++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + for(i = 0; i < D_8037E900->unkC; i++){ + D_8037E900->unk0[i].unk4 -= 0x10; + func_802E57E0(D_8037E900->unk0 + i, gdl); + D_8037E900->unk0[i].unk4 += 0x10; + } + gDPSetTexturePersp((*gdl)++, G_TP_PERSP); +} + +void func_802E5F10(Gfx **gdl){ + func_802E5C98(gdl); + func_802E5188(); +} + +void func_802E5F38(void){ + D_8037E900 = func_802E4B50(); + func_802E4E54(0); +} + +void func_802E5F68(void){ + func_802E4C78(); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E5F88.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E5FE4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E6040.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E60D4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E6270.s") + +void func_802E632C(u8 arg0, u8 arg1, u8 arg2){ + D_8037E900->unk1C[0] = arg0; + D_8037E900->unk1C[1] = arg1; + D_8037E900->unk1C[2] = arg2; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E635C.s") +#else +void func_802E635C(u16 arg0){ + D_8037E900->unk1C[0] = (arg0 >> 0xb) << 3; + D_8037E900->unk1C[1] = (arg0 >> 0x1) << 3; + D_8037E900->unk1C[2] = (arg0 >> 0x6) << 3; +} +#endif + +u8 func_802E639C(u8 arg0, f32 arg1){ + s32 var_v1; + + var_v1 = (s32)((f32)(s32)arg0 *arg1); + var_v1 = (var_v1 > 0xFF) ? 0xff : var_v1; + return var_v1; +} + +void func_802E63D8(u8 arg0, u8 arg1, u8 arg2, f32 arg3){ + func_802E632C(func_802E639C(arg0, arg3), func_802E639C(arg1, arg3), func_802E639C(arg2, arg3)); + +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E6440.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E6488.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E6508.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E6558.s") + +void func_802E65E8(char *str){ + func_802E51A4(str, func_802E4E54(0), 0, D_8037E900->flags); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E6628.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E66F0.s") + +void func_802E67AC(void){ + D_8037E900->flags |= 1; +} + +void func_802E67C4(void){ + D_8037E900->flags &= ~(0x1); +} + +void func_802E67E0(s32 arg0){ + D_8037E900->flags |= arg0 & ~(0x1); +} + +void func_802E6800(s32 arg0){ + D_8037E900->flags &= ~arg0 | 0x1; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E6820.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E6A90.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5DBC0/func_802E6BD0.s") diff --git a/src/core2/code_5FD80.c b/src/core2/code_5FD80.c new file mode 100644 index 00000000..4b1aa456 --- /dev/null +++ b/src/core2/code_5FD80.c @@ -0,0 +1,8 @@ +#include +#include "functions.h" +#include "variables.h" + + +UNK_TYPE(s32) func_802E6D10(UNK_TYPE(s32 *) arg0){ + return *arg0; +} diff --git a/src/core2/code_5FD90.c b/src/core2/code_5FD90.c new file mode 100644 index 00000000..04edaa41 --- /dev/null +++ b/src/core2/code_5FD90.c @@ -0,0 +1,762 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "model.h" + +extern void func_80252C08(f32[3],f32[3], f32, f32[3]); +extern void func_80252CC4(f32[3],s32, f32, s32); +extern f32 func_802560D0(f32[3], f32[3], f32[3]); + +typedef struct { + u8 pad0[0x24]; + BKCollisionTri *unk24; +}Struct_core2_5FD90_0; + +typedef struct { + f32 unk0[3]; + f32 unkC[3]; + f32 unk18[3]; + struct { + BKCollisionTri * unk0; + f32 unk4[3][3]; + } + unk24; +}Struct_core2_5FD90_1; + + +/* .rodata */ +extern f32 D_80377180; +extern f32 D_80377184; + +/* .bss */ +extern struct { + BKCollisionGeo *unk0[100]; + BKCollisionGeo **unk190; +}D_8037E910; +extern f32 D_8037EAA8[3][3]; +extern Struct_core2_5FD90_1 D_8037EAD0[]; + +/* .code */ +void func_802E6D20(BKCollisionTri *arg0, BKVertexList *vtx_list) { + Vtx *vtx; + Vtx *i_vtx; + s32 i; + + vtx = (Vtx *)(vtx_list + 1); + + if (arg0 == NULL) + return; + + for(i = 0; i < 3; i++){ + i_vtx = vtx + arg0->unk0[i]; + D_8037EAA8[i][0] = (f32) i_vtx->v.ob[0]; + D_8037EAA8[i][1] = (f32) i_vtx->v.ob[1]; + D_8037EAA8[i][2] = (f32) i_vtx->v.ob[2]; + } + +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5FD90/func_802E6DEC.s") +#else +void func_802E6DEC(BKCollisionList *collision_list, f32 arg1[3], f32 arg2[3], BKCollisionGeo ***arg3, BKCollisionGeo ***arg4) { + s32 sp3C[3]; + s32 sp30[3]; + + s32 i; + s32 x, y, z; + + if (collision_list->unk12 == 0) { + D_8037E910.unk190 = &D_8037E910.unk0[0]; + *(D_8037E910.unk190++) = (s32)collision_list + sizeof(BKCollisionList); + *arg3 = &D_8037E910.unk0[0]; + *arg4 = D_8037E910.unk190; + } + else{ + for(i = 0 ; i < 3; i++){ + if (arg1[i] >= 0.0f) { + sp3C[i] = (s32) arg1[i] / collision_list->unk12; + } else { + sp3C[i] = ((s32) arg1[i] / collision_list->unk12) - 1; + } + + if (arg2[i] >= 0.0f) { + sp30[i] = (s32) arg2[i] / collision_list->unk12; + } else { + sp30[i] = ((s32) arg2[i] / collision_list->unk12) - 1; + } + + if (sp3C[i] < collision_list->unk0[i]) { + sp3C[i] = collision_list->unk0[i]; + } + if (collision_list->unk6[i] < sp3C[i]) { + sp3C[i] = collision_list->unk6[i]; + } + + if (sp30[i] < collision_list->unk0[i]) { + sp30[i] = collision_list->unk0[i]; + } + if (collision_list->unk6[i] < sp30[i]) { + sp30[i] = collision_list->unk6[i]; + } + + sp3C[i] -= collision_list->unk0[i]; + sp30[i] -= collision_list->unk0[i]; + } + + D_8037E910.unk190 = &D_8037E910.unk0[0]; + for(z = sp3C[2]; z <= sp30[2]; z++){ + for(y = sp3C[1]; y <= sp30[1]; y++){ + for(x = sp3C[0]; x <= sp30[0]; x++){ + *(D_8037E910.unk190++) = (BKCollisionGeo *)((s32)collision_list + sizeof(BKCollisionList)) + (collision_list->unkE * z) + (y * collision_list->unkC) + (x); + } + } + } + *arg3 = &D_8037E910.unk0[0]; + *arg4 = D_8037E910.unk190; + } +} +#endif + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5FD90/func_802E70FC.s") +#else +void func_802E70FC(BKCollisionList *collision_list, s32 arg1[3], s32 arg2[3], BKCollisionGeo ***arg3, BKCollisionGeo ***arg4) { + s32 sp3C[3]; + s32 sp30[3]; + + s32 i; + s32 x, y, z; + + if (collision_list->unk12 == 0) { + D_8037E910.unk190 = &D_8037E910.unk0[0]; + *(D_8037E910.unk190++) = (s32)collision_list + sizeof(BKCollisionList); + *arg3 = &D_8037E910.unk0[0]; + *arg4 = D_8037E910.unk190; + } + else{ + for(i = 0 ; i < 3; i++){ + if (arg1[i] >= 0) { + sp3C[i] = (s32) arg1[i] / collision_list->unk12; + } else { + sp3C[i] = ((s32) arg1[i] / collision_list->unk12) - 1; + } + + if (arg2[i] >= 0) { + sp30[i] = (s32) arg2[i] / collision_list->unk12; + } else { + sp30[i] = ((s32) arg2[i] / collision_list->unk12) - 1; + } + + if (sp3C[i] < collision_list->unk0[i]) { + sp3C[i] = collision_list->unk0[i]; + } + if (collision_list->unk6[i] < sp3C[i]) { + sp3C[i] = collision_list->unk6[i]; + } + + if (sp30[i] < collision_list->unk0[i]) { + sp30[i] = collision_list->unk0[i]; + } + if (collision_list->unk6[i] < sp30[i]) { + sp30[i] = collision_list->unk6[i]; + } + + sp3C[i] -= collision_list->unk0[i]; + sp30[i] -= collision_list->unk0[i]; + } + + D_8037E910.unk190 = &D_8037E910.unk0[0]; + for(z = sp3C[2]; z <= sp30[2]; z++){ + for(y = sp3C[1]; y <= sp30[1]; y++){ + for(x = sp3C[0]; x <= sp30[0]; x++){ + *(D_8037E910.unk190++) = (BKCollisionGeo *)((s32)collision_list + sizeof(BKCollisionList)) + (collision_list->unkE * z) + x + (y * collision_list->unkC); + } + } + } + *arg3 = &D_8037E910.unk0[0]; + *arg4 = D_8037E910.unk190; + } +} +#endif + +void func_802E73C8(f32 (*arg0)[3]) { + s32 i; + for(i = 0; i < 3; i++){ + arg0[i][0] = D_8037EAA8[i][0]; + arg0[i][1] = D_8037EAA8[i][1]; + arg0[i][2] = D_8037EAA8[i][2]; + + } +} + +s32 func_802E7408(BKCollisionList *arg0) { + BKCollisionTri *temp_a1; + BKCollisionTri *temp_a2; + BKCollisionTri *phi_a2; + s32 phi_v1; + + phi_v1 = 0; + temp_a2 = (arg0->unk10 * 4) + (s32)arg0 + sizeof(BKCollisionList); + temp_a1 = (arg0->unk14 * 0xC) + (s32)temp_a2; + for(phi_a2 = temp_a2; phi_a2 < temp_a1; phi_a2++){ + if(phi_a2->flags & 0x1E0000){ + phi_v1++; + } + } + return phi_v1; +} + +s32 func_802E7468(BKCollisionList *arg0){ + return arg0->unk14; +} + +void func_802E7470(BKCollisionList *collision_list, BKCollisionTri **begin_ptr, BKCollisionTri **end_ptr){ + *begin_ptr = (collision_list->unk10 * 4) + (s32)collision_list + sizeof(BKCollisionList); + *end_ptr = (collision_list->unk14 * 0xC) + (s32)*begin_ptr; +} + + +bool func_802E74A0(f32 arg0[3], f32 arg1, f32 arg2[3], f32 arg3[3]) { + f32 sp24[3]; + f32 sp20; + + if (arg1 <= func_802560D0(arg2, arg3, arg0)) { + return FALSE; + } + sp24[0] = (arg2[0] + arg3[0]) / 2; + sp24[1] = (arg2[1] + arg3[1]) / 2; + sp24[2] = (arg2[2] + arg3[2]) / 2; + sp20 = ml_vec3f_distance(sp24, arg0); + if ((ml_vec3f_distance(sp24, arg2) + arg1) <= sp20) { + return FALSE; + } + return TRUE; +} + +bool func_802E7588(f32 arg0[3], f32 arg1, f32 arg2[3], f32 arg3) { + return (ml_vec3f_distance(arg0, arg2) < (arg1 + arg3)); +} + +void func_802E75D0(f32 arg0[3], f32 arg1[3], s32 arg2[3], s32 arg3[3], f32 arg4[3]) { + s32 i; + + for(i = 0; i < 3; i++){ + if (arg0[i] < arg1[i]) { + arg2[i] = (s32) arg0[i]; + arg3[i] = (s32) arg1[i]; + } else { + arg2[i] = (s32) arg1[i]; + arg3[i] = (s32) arg0[i]; + } + arg2[i] += -1; + arg3[i] += 1; + } + arg4[0] = (arg1[0] - arg0[0]); + arg4[1] = (arg1[1] - arg0[1]); + arg4[2] = (arg1[2] - arg0[2]); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5FD90/func_802E76B0.s") +#else +BKCollisionTri * *func_802E76B0(BKCollisionList *arg0, BKVertexList *arg1, f32 arg2[3], f32 arg3[3], f32 arg4[3], u32 arg5) { + BKCollisionGeo **sp18C; + BKCollisionGeo **sp188; + BKCollisionGeo **sp184; + BKCollisionTri *sp180; + BKCollisionTri *sp178; + Vtx *sp164[3]; + s32 sp158[3]; + s32 sp14C[3]; + f32 sp140[3]; + f32 sp130[3]; + f32 sp124[3]; + f32 sp118[3]; + f32 sp10C[3]; + f32 spFC[3]; + f32 spF8; + f32 spF4; + f32 spF0; + f32 spEC; + f32 spE8; + f32 spE4; + f32 spBC[3]; + f32 sp90[3][3]; + BKCollisionTri *sp8C; + f32 temp_f0_2; + f32 temp_f12_2; + f32 temp_f12_3; + f32 temp_f12_4; + f32 temp_f14_2; + f32 temp_f18_2; + f32 temp_f20; + f32 temp_f22; + f32 temp_f26; + f32 temp_f2_2; + f32 temp_f2_6; + Vtx *temp_a2; + s32 temp_hi; + s32 temp_hi_2; + Vtx *vtx_pool; + BKCollisionTri *temp_t1; + BKCollisionGeo *temp_v1; + BKCollisionTri *phi_s1; + f32 phi_f0; + f32 phi_f12; + s32 phi_a0_2; + s32 i; + s32 j; + + sp8C = NULL; + temp_f20 = (f32) arg1->unk16; + func_802E75D0(arg2, arg3, sp158, sp14C, sp140); + for(i = 0; i < 3; i++){ + if ((sp14C[i] <= -temp_f20) || (temp_f20 <= sp158[i])) { + return NULL; + } + } + func_802E70FC(arg0, sp158, sp14C, &sp18C, &sp184); + for(sp188 = sp18C; sp188 < sp184; sp188++){ + temp_v1 = *sp188; + // sp180 = (temp_v1->unk0 * 0xC) + (s32)arg0 + (arg0->unk10 * 4) + sizeof(BKCollisionList); + sp180 = (BKCollisionTri *)((BKCollisionGeo *)(arg0 + 1) + arg0->unk10) + temp_v1->start_tri_index; + sp178 = sp180 + temp_v1->tri_count; + for(phi_s1 = sp180; phi_s1 < sp178; phi_s1++){ + if(!(phi_s1->flags & arg5)){ + vtx_pool = (s32)arg1 + sizeof(BKVertexList); + sp164[0] = &vtx_pool[phi_s1->unk0[0]]; + sp164[1] = &vtx_pool[phi_s1->unk0[1]]; + sp164[2] = &vtx_pool[phi_s1->unk0[2]]; + if( !((sp164[0]->v.ob[0] < sp158[0]) && (sp164[1]->v.ob[0] < sp158[0]) && (sp164[2]->v.ob[0] < sp158[0])) + && !((sp14C[0] < sp164[0]->v.ob[0]) && (sp14C[0] < sp164[1]->v.ob[0]) && (sp14C[0] < sp164[2]->v.ob[0])) + && !((sp164[0]->v.ob[2] < sp158[2]) && (sp164[1]->v.ob[2] < sp158[2]) && (sp164[2]->v.ob[2] < sp158[2])) + && !((sp14C[2] < sp164[0]->v.ob[2]) && (sp14C[2] < sp164[1]->v.ob[2]) && (sp14C[2] < sp164[2]->v.ob[2])) + && !((sp164[0]->v.ob[1] < sp158[1]) && (sp164[1]->v.ob[1] < sp158[1]) && (sp164[2]->v.ob[1] < sp158[1])) + && !((sp14C[1] < sp164[0]->v.ob[1]) && (sp14C[1] < sp164[1]->v.ob[1]) && (sp14C[1] < sp164[2]->v.ob[1])) + ){ + for(i = 0; i < 3; i++){ + temp_a2 = &vtx_pool[phi_s1->unk0[i]]; + for(j = 0; j <3; j++){ + sp90[i][j] = temp_a2->v.ob[j]; + } + } + sp130[0] = sp90[1][0] - sp90[0][0];\ + sp130[1] = sp90[1][1] - sp90[0][1];\ + sp130[2] = sp90[1][2] - sp90[0][2]; + + sp124[0] = sp90[2][0] - sp90[0][0];\ + sp124[1] = sp90[2][1] - sp90[0][1];\ + sp124[2] = sp90[2][2] - sp90[0][2]; + + spBC[0] = (sp130[1] * sp124[2]) - (sp124[1] * sp130[2]); + spBC[1] = (sp130[2] * sp124[0]) - (sp124[2] * sp130[0]); + spBC[2] = (sp130[0] * sp124[1]) - (sp124[0] * sp130[1]); + if( (100000.0f < spBC[0]) || (100000.0f < spBC[1]) || (100000.0f < spBC[2]) + || (spBC[0] < -100000.0f) || (spBC[1] < -100000.0f) || (spBC[2] < -100000.0f) + ) { + spBC[0] /= 100000.0f; + spBC[1] /= 100000.0f; + spBC[2] /= 100000.0f; + } + sp118[0] = arg2[0] - sp90[0][0]; + sp118[1] = arg2[1] - sp90[0][1]; + sp118[2] = arg2[2] - sp90[0][2]; + sp10C[0] = arg3[0] - sp90[0][0]; + sp10C[1] = arg3[1] - sp90[0][1]; + sp10C[2] = arg3[2] - sp90[0][2]; + + temp_f12_2 = sp118[0]*spBC[0] + sp118[1]*spBC[1] + sp118[2]*spBC[2]; + temp_f2_2 = sp10C[0]*spBC[0] + sp10C[1]*spBC[1] + sp10C[2]*spBC[2]; + if ((!(temp_f12_2 >= 0.0f) || !(temp_f2_2 >= 0.0f)) && (!(temp_f12_2 <= 0.0f) || !(temp_f2_2 <= 0.0f))) { + if ((phi_s1->flags & 0x10000) && (temp_f12_2 < 0.0f)) { + spBC[0] = -spBC[0]; + spBC[1] = -spBC[1]; + spBC[2] = -spBC[2]; + } + if (spBC[0]*sp140[0] + spBC[1]*sp140[1] + spBC[2]*sp140[2] != 0.0f) { + temp_f0_2 = -((spBC[0]*arg2[0] + spBC[1]*arg2[1] + spBC[2]*arg2[2]) - (sp90[0][0]*spBC[0] + sp90[0][1]*spBC[1] + sp90[0][2]*spBC[2])) / temp_f12_3; + if (!(temp_f0_2 <= 0.0f) && !(temp_f0_2 >= 1.0f)) { + spFC[0] = (sp140[0] * temp_f0_2) + arg2[0]; + spFC[1] = (sp140[1] * temp_f0_2) + arg2[1]; + spFC[2] = (sp140[2] * temp_f0_2) + arg2[2]; + + phi_a0_2 = 1; + phi_f12 = (spBC[0] >= 0.0f) ? spBC[0] : -spBC[0]; + phi_f0 = (spBC[1] >= 0.0f) ? spBC[1] : -spBC[1]; + if (phi_f0 < phi_f12) { + phi_a0_2 = 0; + } + + phi_a0_2 = phi_a0_2; + phi_f12 = (spBC[2] >= 0.0f) ? spBC[2] : -spBC[2]; + phi_f0 = (spBC[phi_a0_2] >= 0.0f) ? spBC[phi_a0_2] : -spBC[phi_a0_2]; + if (phi_f0 < phi_f12) { + phi_a0_2 = 2; + } + + temp_hi = (s32) (phi_a0_2 + 1) % 3; + spF0 = spFC[temp_hi] - sp90[0][temp_hi]; + spF4 = sp130[temp_hi]; + spF8 = sp124[temp_hi]; + temp_hi_2 = (s32) (phi_a0_2 + 2) % 3; + spE4 = spFC[temp_hi_2] - sp90[0][temp_hi_2]; + spE8 = sp130[temp_hi_2]; + spEC = sp124[temp_hi_2]; + temp_f14_2 = (spF4 * spEC) - (sp124[temp_hi] * spE8); + temp_f18_2 = (spF0 * spEC) - (sp124[temp_hi] * spE4); + if (!((temp_f18_2 / temp_f14_2) < 0.0f)) { + temp_f12_4 = temp_f18_2 / temp_f14_2; + if (!(temp_f12_4 > 1.0f)) { + temp_f2_6 = ((spF4 * spE4) - (spF0 * spE8)) / temp_f14_2; + if (!(temp_f2_6 < 0.0f) && !(temp_f2_6 > 1.0f) && !((temp_f12_4 + temp_f2_6) > 1.0f)) { + sp8C = phi_s1; + arg3[0] = spFC[0]; + arg3[1] = spFC[1]; + arg3[2] = spFC[2]; + ml_vec3f_normalize_copy(arg4, spBC); + func_802E75D0(arg2, arg3, sp158, sp14C, sp140); + } + } + } + } + } + } + } + } + } + } + func_802E6D20(sp8C, arg1); + return sp8C; +} +#endif + + +int func_802E805C(BKCollisionList *collision_list, BKVertexList *vtxList, f32 arg2[3], f32 arg3[3], f32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8){ + f32 sp44[3]; + f32 sp38[3]; + int sp34; + int i; + + if(!func_802E74A0(arg2, vtxList->unk16*arg4, arg5, arg6)){ + return 0; + } + else{ + mlMtxIdent(); + func_80252CC4(arg2, arg3, arg4, 0); + func_8025235C(sp44, arg5); + func_8025235C(sp38, arg6); + sp34 = func_802E76B0(collision_list, vtxList, sp44, sp38, arg7, arg8); + if(!sp34){ + return 0; + } + else{ + mlMtxIdent(); + func_80252C08(arg2, arg3, arg4, NULL); + func_8025235C(arg6, sp38); + + mlMtxIdent(); + func_80252C08(NULL, arg3, 1.0f, 0); + func_8025235C(arg7, arg7); + + mlMtxIdent(); + func_80252C08(arg2, arg3, arg4, 0); + + for(i = 0; i < 3; i++){ + func_8025235C(D_8037EAA8[i], D_8037EAA8[i]); + } + + } + } + return sp34; +} + +s32 func_802E81CC(BKCollisionList *collision_list, BKVertexList *vtx_list, f32 arg2[3], f32 arg3[3], f32[3], f32, s32, s32 *, s32 *); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5FD90/func_802E81CC.s") +// s32 func_802E81CC(BKCollisionList *collision_list, BKVertexList *vtx_list, f32 arg2[3], f32 arg3[3], f32 arg4[3], f32 arg5, s32 flags, s32 *arg7, s32 *arg8) { +// BKCollisionGeo **spD4; +// BKCollisionGeo **spD0; +// BKCollisionGeo **spCC; +// f32 spC0[3]; +// f32 spAC[3]; +// f32 spA0[3]; +// //pad8C; +// f32 sp80[3]; +// f32 sp74[3]; +// Struct_core2_5FD90_1 *var_s2; +// ? *var_t0; +// ? *var_v0; +// f32 *temp_v0; +// f32 *var_a0; +// f32 *var_a1; +// f32 *var_v1_3; +// f32 temp_f0; +// f32 temp_f0_2; +// f32 temp_f0_3; +// f32 temp_f0_4; +// f32 temp_f0_5; +// f32 temp_f12; +// f32 temp_f12_2; +// f32 temp_f14; +// f32 temp_f16; +// f32 temp_f18; +// f32 temp_f20; +// f32 temp_f2; +// f32 temp_f2_2; +// f32 temp_f2_3; +// BKCollisionTri *temp_v0_2; +// s16 *var_a3; +// BKCollisionTri *i_tri; +// s16 *var_v1_2; +// s16 var_t8; +// Vtx *vertices; +// s32 var_a0_2; +// s32 var_a2; +// s32 var_t1; +// s32 var_v1; +// u32 temp_t9; +// BKCollisionTri *temp_s7; +// BKCollisionGeo *temp_v1; +// void *var_t0_2; +// void *var_v0_2; +// s32 i; + +// func_8033D5D0(arg2, arg3, arg5, &spAC, &spA0); +// temp_f0 = func_802EC920(vtx_list); +// for(var_v1 = 0; var_v1 < 3; var_v1++){ +// if ((spA0[var_v1] <= -temp_f0) || (temp_f0 <= spAC[var_v1])) { +// return 0; +// } +// } +// func_802E6DEC(collision_list, spAC, spA0, &spD4, &spCC); +// vertices = vtxList_getVertices(vtx_list); +// var_s2 = &D_8037EAD0; +// spD0 = spD4; +// if (spD4 < spCC) { +// do{ +// temp_v1 = *spD0; +// temp_v0_2 = (temp_v1->start_tri_index * sizeof(BKCollisionTri)) + (s32)collision_list + (collision_list->unk10 * 4) + sizeof(BKCollisionList); +// temp_s7 = temp_v0_2 + temp_v1->tri_count; +// for(i_tri = temp_v0_2; i_tri < temp_s7; i_tri++){ +// if ((i_tri->flags & flags) == 0) { +// for(var_a2 = 0; var_a2 < 3; var_a2++){ +// for(var_a0_2 = 0; var_a0_2 < 3; var_a0_2++) +// var_s2->unk24.unk4[var_a2][var_a0_2] = (f32) vertices[i_tri->unk0[var_a2]].v.ob[var_a0_2]; +// } +// } +// var_t1 = 1; +// var_t0_2 = var_s2 + 0xC; +// sp80[0] = var_s2->unk24.unk4[0][0]; +// sp80[1] = var_s2->unk24.unk4[0][1]; +// sp80[2] = var_s2->unk24.unk4[0][2]; +// sp74[0] = var_s2->unk24.unk4[0][0]; +// sp74[1] = var_s2->unk24.unk4[0][1]; +// sp74[2] = var_s2->unk24.unk4[0][2]; +// for(var_t1 = 0; var_t1 < 3; var_t1++){ +// var_a1 = &sp80; +// var_v1_3 = &sp74; +// for(i = 0; i < 3; i++){ +// if ( var_s2->unk24.unk4[i][0] < sp80[i]) { +// sp80[i] = var_s2->unk24.unk4[i][0]; +// } + +// if (sp74[i] < var_s2->unk24.unk4[i][1]) { +// sp80[i] = var_s2->unk24.unk4[i][1]; +// } +// } +// } + +// if ( !((spA0[0] < sp80[0]) || (sp74[0] < spAC[0])) +// && !((spA0[1] < sp80[1]) || (sp74[1] < spAC[1])) +// && !((spA0[2] < sp80[2]) || (sp74[2] < spAC[2])) +// ) { +// var_s2->unk0[0] = var_s2->unk24.unk4[1][0] - var_s2->unk24.unk4[0][0]; +// var_s2->unk0[1] = var_s2->unk24.unk4[1][1] - var_s2->unk24.unk4[0][1]; +// var_s2->unk0[2] = var_s2->unk24.unk4[1][2] - var_s2->unk24.unk4[0][2]; +// var_s2->unkC[0] = var_s2->unk24.unk4[2][0] - var_s2->unk24.unk4[0][0]; +// var_s2->unkC[1] = var_s2->unk24.unk4[2][1] - var_s2->unk24.unk4[0][1]; +// var_s2->unkC[2] = var_s2->unk24.unk4[2][2] - var_s2->unk24.unk4[0][2]; +// var_s2->unk18[0] = (var_s2->unk0[1] * var_s2->unkC[2]) - (var_s2->unkC[1] *var_s2->unk0[2]); +// var_s2->unk18[1] = (var_s2->unk0[2] * var_s2->unkC[0]) - (var_s2->unkC[2] * var_s2->unk0[0]); +// var_s2->unk18[2] = (var_s2->unk0[0] * var_s2->unkC[1]) - (var_s2->unkC[0] * var_s2->unk0[1]); +// ml_vec3f_normalize( var_s2->unk18); +// if (i_tri->flags & 0x10000) { +// spC0[0] = arg2[0] - var_s2->unk24.unk4[0]; +// spC0[1] = arg2[1] - var_s2->unk24.unk4[1]; +// spC0[2] = arg2[2] - var_s2->unk24.unk4[2]; +// if (((spC0[0]*var_s2->unk18[0]) + (spC0[0]*var_s2->unk18[0]) + (spC0[0]*var_s2->unk18[0])) < 0.0f) { +// var_s2->unk18[0] = -var_s2->unk18[0]; +// var_s2->unk18[1] = -var_s2->unk18[1]; +// var_s2->unk18[2] = -var_s2->unk18[2]; +// } +// goto block_31; +// } +// if (!(((var_s2->unk18[0]*arg4[0]) + (var_s2->unk18[1]*arg4[1]) + (var_s2->unk18[2]*arg4[2])) > 0.0f)) { +// block_31: +// var_s2++; +// var_s2->unk24.unk0 = i_tri; +// if ((var_s2 - D_8037EAD0) < 0x65) { +// goto block_32; +// } +// } else { +// goto block_32; +// } +// } else { +// goto block_32; +// } +// } else { +// block_32: +// i_tri++; +// if ((u32) i_tri < (u32) temp_s7) { +// goto loop_8; +// } +// } +// } +// }while(((var_s2 - D_8037EAD0) < 0x65) && (spD0 += 4 < spCC)); +// } +// *arg7 = (s32) D_8037EAD0; +// *arg8 = (s32) var_s2; +// return var_s2 - D_8037EAD0 > 0; +// } + + +Struct_core2_5FD90_0 *func_802E879C(s32, f32[3], f32[3], f32, f32[3]); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5FD90/func_802E879C.s") + +#ifndef NONMATCHING +BKCollisionTri *func_802E8E88(BKCollisionList *collision_list, BKVertexList *vtx_list, f32 arg2[3], f32 arg3[3], f32 arg4, f32 arg5[3], s32 arg6, s32 arg7); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5FD90/func_802E8E88.s") +#else +BKCollisionTri *func_802E8E88(BKCollisionList *collision_list, BKVertexList *vtx_list, f32 arg2[3], f32 arg3[3], f32 arg4, f32 arg5[3], s32 arg6, s32 arg7){ + s32 spC4; + s32 spC0; + f32 spB4[3]; + f32 sp98[3]; + f32 sp8C[3]; + f32 sp78[3]; + f32 temp_f20; + s32 temp_s0; + void *temp_s5; + void *temp_s5_2; + void *temp_v0; + void *temp_v0_2; + f32 phi_f22; + f32 phi_f24; + s32 phi_s0; + Struct_core2_5FD90_0 *phi_s5; + void *phi_s5_2; + + sp78[0] = arg3[0] - arg2[0]; + sp78[1] = arg3[1] - arg2[1]; + sp78[2] = arg3[2] - arg2[2]; + if (!func_802E81CC(collision_list, vtx_list, arg2, arg3, sp78, (f32) ((f64) arg4 + 0.5), arg7, &spC4, &spC0)) { + return NULL; + } + phi_s5 = func_802E879C(spC4, spC0, arg3, arg4, sp8C); + if (phi_s5 == NULL) { + return NULL; + } + arg5[0] = sp8C[0]; + arg5[1] = sp8C[1]; + arg5[2] = sp8C[2]; + spB4[0] = arg3[0] - arg2[0]; + spB4[1] = arg3[1] - arg2[1]; + spB4[2] = arg3[2] - arg2[2]; + arg3[0] = arg2[0]; + arg3[1] = arg2[1]; + arg3[2] = arg2[2]; + phi_f22 = 0.0f; + phi_f24 = 1.0f; + for(phi_s0 = 0; phi_s0 < arg6; phi_s0++){ + temp_f20 = (f64) (phi_f22 + phi_f24) / 2.0; + sp98[0] = (spB4[0] * temp_f20) + arg2[0]; + sp98[1] = (spB4[1] * temp_f20) + arg2[1]; + sp98[2] = (spB4[2] * temp_f20) + arg2[2]; + phi_s5 = func_802E879C(spC4, spC0, &sp98, arg4, &sp8C); + if (phi_s5 != NULL) { + arg5[0] = sp8C[0]; + arg5[1] = sp8C[1]; + arg5[2] = sp8C[2]; + phi_f24 = temp_f20; + } else { + arg3[0] = sp98[0]; + arg3[1] = sp98[1]; + arg3[2] = sp98[2]; + phi_f22 = temp_f20; + } + phi_s5 = phi_s5_2; + } + if (phi_s5 == NULL) { + return NULL; + } + ml_vec3f_normalize(arg5); + func_802E6D20(phi_s5->unk24, vtx_list); + return phi_s5->unk24; +} +#endif + +s32 func_802E9118(BKCollisionList * collision_list, BKVertexList *vtx_list, f32 arg2[3], s32 arg3, f32 arg4, f32 arg5[3], f32 arg6[3], f32 arg7, f32 arg8[3], s32 arg9, s32 argA) { + f32 sp4C[3]; + f32 sp40[3]; + s32 sp3C; + s32 i; + + if (((f32)vtx_list->unk16 * arg4) <= (ml_vec3f_distance(arg6, arg2) - arg7)) { + return 0; + } + mlMtxIdent(); + func_80252CC4(arg2, arg3, arg4, 0); + func_8025235C(&sp4C, arg5); + func_8025235C(&sp40, arg6); + sp3C = func_802E8E88(collision_list, vtx_list, &sp4C, &sp40, arg7 / arg4, arg8, arg9, argA); + if (sp3C == 0) { + return 0; + } + mlMtxIdent(); + func_80252C08(arg2, arg3, arg4, 0); + func_8025235C(arg6, &sp40); + mlMtxIdent(); + func_80252C08(NULL, arg3, 1.0f, 0); + func_8025235C(arg8, arg8); + mlMtxIdent(); + func_80252C08(arg2, arg3, arg4, 0); + for(i = 0; i < 3; i++){ + func_8025235C(D_8037EAA8[i], D_8037EAA8[i]); + } + return sp3C; +} + +s32 func_802E92AC(BKCollisionList *, BKVertexList *, f32[3], f32, f32 [3], s32); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_5FD90/func_802E92AC.s") + + +s32 func_802E9DD8(BKCollisionList *collisionList, BKVertexList *vtxList, f32 arg2[3], f32 *arg3, f32 arg4, f32 arg5[3], f32 arg6, f32 arg7[3], s32 arg8) { + f32 sp34[3]; + s32 sp30; + s32 i; + + if ((vtxList->unk16 * arg4) <= (ml_vec3f_distance(arg5, arg2) - arg6)) { + return 0; + } + mlMtxIdent(); + func_80252CC4(arg2, arg3, arg4, 0); + func_8025235C(sp34, arg5); + sp30 = func_802E92AC(collisionList, vtxList, &sp34, arg6 / arg4, arg7, arg8); + if (sp30 == 0) { + return 0; + } + mlMtxIdent(); + func_80252C08(arg2, arg3, arg4, NULL); + func_8025235C(arg5, sp34); + mlMtxIdent(); + func_80252C08(NULL, arg3, 1.0f, NULL); + func_8025235C(arg7, arg7); + mlMtxIdent(); + func_80252C08(arg2, arg3, arg4, NULL); + + for(i = 0; i < 3; i++){ + func_8025235C(D_8037EAA8[i], D_8037EAA8[i]); + } + return sp30; +} diff --git a/src/core2/code_62FD0.c b/src/core2/code_62FD0.c new file mode 100644 index 00000000..b895d631 --- /dev/null +++ b/src/core2/code_62FD0.c @@ -0,0 +1,44 @@ +#include +#include "functions.h" +#include "variables.h" + +//BKMeshList_getVtxCount +s32 func_802E9F60(BKMeshList *arg0){ + s32 i; + s32 v1 = 0; + BKMesh *v0 = (BKMesh *)(arg0 + 1); + + for(i = 0; i < arg0->meshCount_0; ++i){ + v1 += v0->vtxCount_2; + v0 = (BKMesh *)&((s16*)(v0 +1))[v0->vtxCount_2]; + + } + return v1; +} + +BKMesh * func_802E9F9C(BKMeshList *arg0, s32 mesh_id){ + s32 i; + BKMesh *v1 = (BKMesh *)(arg0 + 1); + + for(i=0; i < arg0->meshCount_0; i++){ + if(v1->uid_0 == mesh_id){ + return v1; + } + v1 = (BKMesh *)&((s16*)(v1 +1 ))[v1->vtxCount_2]; + } + return NULL; +} + +bool func_802E9FEC(BKMeshList * arg0, s32 mesh_id, void *vtx_id){ + s32 i; + BKMesh *v0 = func_802E9F9C(arg0, mesh_id); + + if(v0){ + for(i = 0; i < v0->vtxCount_2; i++){ + if(((s16*)(v0 + 1))[i] == *(s16 *)vtx_id){ + return TRUE; + } + } + } + return FALSE; +} diff --git a/src/core2/code_630D0.c b/src/core2/code_630D0.c new file mode 100644 index 00000000..64ea5b31 --- /dev/null +++ b/src/core2/code_630D0.c @@ -0,0 +1,104 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_802EA060(struct58s **arg0, BKAnimationList *anim_list){ + struct58s * sp24; + Mtx *end_ptr; + Mtx *i_ptr; + + sp24 = *arg0; + if(sp24->capacity_44 < anim_list->cnt_4){ + sp24 = (struct58s *)realloc(sp24, anim_list->cnt_4 * sizeof(Mtx) + sizeof(struct58s)); + sp24->capacity_44 = anim_list->cnt_4; + (*arg0) = sp24; + } + + sp24->size_40 = anim_list->cnt_4; + end_ptr = (Mtx *)(sp24->size_40*sizeof(Mtx) + (s32)sp24 +sizeof(struct58s)); + mlMtxIdent(); + for(i_ptr = sp24->data; i_ptr < end_ptr; i_ptr++){ + func_802513B0(i_ptr); + } +} + +Mtx *func_802EA110(struct58s *this, s32 arg1){ + if (arg1 == -1){ + return &this->mtx_0; + } + return &this->data[arg1]; + +} + +void func_802EA134(struct58s *this){ + free(this); +} + +struct58s *func_802EA154(void){ + struct58s *this = malloc(sizeof(struct58s)); + this->size_40 = 0; + this->capacity_44 = 0; + mlMtxIdent(); + func_802513B0(this); + return this; +} + +s32 func_802EA190(struct58s* this){ + if(this) + return this->size_40; + return 1; +} + +void func_80251BCC(Mtx*); +void func_8033A5B8(s32, s32, f32[3],f32[3], f32[3]); + +void func_802EA1A8(struct58s **arg0, BKAnimationList *anim_list, s32 arg2){ + struct58s * this; + Mtx *start_ptr; + Mtx *end_ptr; + Mtx *i_ptr; + BKAnimation *s0; + f32 tmp_f0; + s32 pad94[1]; + f32 sp88[3]; + s32 pad80[2]; + f32 sp74[3]; + f32 sp68[3]; + f32 sp5C[3]; + s32 sp50[3]; + + //resize animation matrices + this = *arg0; + if(this->capacity_44 < anim_list->cnt_4){ + this = (struct58s *)realloc(this, anim_list->cnt_4 * sizeof(Mtx) + sizeof(struct58s)); + this->capacity_44 = anim_list->cnt_4; + (*arg0) = this; + } + + this->size_40 = anim_list->cnt_4; + start_ptr = this->data; + end_ptr = &start_ptr[this->size_40]; + s0 = anim_list->anim; + for(i_ptr = start_ptr; i_ptr < end_ptr; s0++, i_ptr++){ + func_8033A5B8(arg2, s0->unkC, sp74, sp68, sp5C); + if(s0->unkE == -1) + mlMtxIdent(); + else if(s0->unkE + 1 != i_ptr - start_ptr) + func_80251BCC(&start_ptr[s0->unkE]); + tmp_f0 = anim_list->unk0; + mlMtxTranslate(s0->unk0[0] + tmp_f0*sp5C[0], s0->unk0[1] + tmp_f0*sp5C[1], s0->unk0[2] + tmp_f0*sp5C[2] ); + + if(!func_80345434(sp74)){ + func_80345274(sp74, sp88); + func_802515D4(sp88); + } + + mlMtxScale_xyz(sp68[0], sp68[1], sp68[2]); + mlMtxTranslate(-s0->unk0[0], -s0->unk0[1], -s0->unk0[2]); + func_802513B0(i_ptr); + } +} + +struct58s *func_802EA374(struct58s *this){ + return defrag(this); +} diff --git a/src/core2/code_63410.c b/src/core2/code_63410.c new file mode 100644 index 00000000..aa4811f2 --- /dev/null +++ b/src/core2/code_63410.c @@ -0,0 +1,101 @@ +#include +#include "functions.h" +#include "variables.h" +typedef struct{ + s16 unk0[3]; +} Struct_core2_63410_2; + +typedef struct { + Struct_core2_63410_2 *unk0; + f32 unk4[3]; + f32 unk10[3]; +} Struct_core2_63410_1; + +typedef struct { + Struct_core2_63410_1 *unk0; + Struct_core2_63410_1 *unk4; + Struct_core2_63410_1 *unk8; +} Struct_core2_63410_0; + +/* .code */ +void func_802EA3A0(Struct_core2_63410_0 *arg0){ + //clears vec + arg0->unk4 = arg0->unk0; +} + +s32 func_802EA3AC(Struct_core2_63410_0 *arg0, s32 indx, f32 arg2[3], f32 arg3[3]){ + //get elem at indx + Struct_core2_63410_1 *phi_v1; + + phi_v1 = &arg0->unk0[indx]; + + arg2[0] = phi_v1->unk4[0]; + arg2[1] = phi_v1->unk4[1]; + arg2[2] = phi_v1->unk4[2]; + + arg3[0] = phi_v1->unk10[0]; + arg3[1] = phi_v1->unk10[1]; + arg3[2] = phi_v1->unk10[2]; + return phi_v1->unk0; +} + +s32 func_802EA3F8(Struct_core2_63410_0 *arg0){ + //return size of vector + return arg0->unk4 - arg0->unk0; +} + +void func_802EA418(Struct_core2_63410_0 **arg0, Struct_core2_63410_2 *arg1, f32 arg2[3], f32 arg3[3]) { + /* adds elem (arg1) to vec (arg0), resize if end_ptr == capacity_ptr */ + Struct_core2_63410_1 *phi_v1; + Struct_core2_63410_0 *phi_s1; + s32 sp34; + s32 sp20; + + //check is elem already exists in vec + phi_s1 = *arg0; + for(phi_v1 = phi_s1->unk0; phi_v1 < phi_s1->unk4; phi_v1++){ + if ( (phi_v1->unk0->unk0[0] == arg1->unk0[0]) + && (phi_v1->unk0->unk0[1] == arg1->unk0[1]) + && (phi_v1->unk0->unk0[2] == arg1->unk0[2]) + ){ + return; + } + } + + //check if vector capacity needs to increas + if (phi_s1->unk4 == phi_s1->unk8) { + sp34 = (phi_s1->unk8 - phi_s1->unk0); + sp20 = sp34 * 2; + phi_s1 = (Struct_core2_63410_0 *)realloc(phi_s1, sizeof(Struct_core2_63410_0) + (sizeof(Struct_core2_63410_1)*sp20)); + phi_s1->unk0 = (Struct_core2_63410_1 *)(phi_s1 + 1); + phi_s1->unk4 = phi_s1->unk0 + sp34; + phi_s1->unk8 = phi_s1->unk0 + sp20; + (*arg0) = phi_s1; + } + + //copy arg1, arg2, arg3 over; + phi_s1->unk4->unk0 = arg1; + phi_s1->unk4->unk4[0] = arg2[0]; + phi_s1->unk4->unk4[1] = arg2[1]; + phi_s1->unk4->unk4[2] = arg2[2]; + phi_s1->unk4->unk10[0] = arg3[0]; + phi_s1->unk4->unk10[1] = arg3[1]; + phi_s1->unk4->unk10[2] = arg3[2]; + phi_s1->unk4++; +} + +void func_802EA5C4(Struct_core2_63410_0 *arg0){ + //free vec + free(arg0); +} + +Struct_core2_63410_0 *func_802EA5E4(void){ + //new + Struct_core2_63410_0 *phi_v0; + + phi_v0 = (Struct_core2_63410_0 *)malloc(sizeof(Struct_core2_63410_0) + 2 * sizeof(Struct_core2_63410_1)); + phi_v0->unk0 = (Struct_core2_63410_1 *)(phi_v0 + 1); + phi_v0->unk4 = phi_v0->unk0; + phi_v0->unk8 = phi_v0->unk0 + 2; + return phi_v0; +} diff --git a/src/core2/code_63690.c b/src/core2/code_63690.c new file mode 100644 index 00000000..549c0f56 --- /dev/null +++ b/src/core2/code_63690.c @@ -0,0 +1,69 @@ +#include +#include "functions.h" +#include "variables.h" + + +//textureList_getDataPtr +u8 *func_802EA620(BKTextureList *this){ + return (s32)this + this->cnt_4*sizeof(BKTextureHeader) + sizeof(BKTextureList); +} + +s32 texture_getPixelBitSize(BKTextureHeader *this){ + if(this->type_4 & 1){ + return 4; + } + + if(this->type_4 & 2){ + return 8; + } + + if(this->type_4 & 4){ + return 0x10; + } + + if(this->type_4 & 8){ + return 0x20; + } + return 0; +} + +s32 func_802EA684(BKTextureHeader *this){ + return this->type_4; +} + +s32 texture_getPaletteSize(BKTextureHeader *this){ + if(this->type_4 & 1){ + return 0x20; + } + + if(this->type_4 & 2){ + return 0x200; + } + + if(this->type_4 & 4){ + return 0; + } + + if(this->type_4 & 8){ + return 0; + } + return 0; +} + +// texture_getOffset +s32 func_802EA6DC(BKTextureHeader *this){ + return this->offset_0; +} + +//texture_getSize +s32 func_802EA6E4(BKTextureHeader *this){ + s32 palette_size = texture_getPaletteSize(this); + s32 pixel_size = texture_getPixelBitSize(this); + + return (s32)pixel_size*this->width_8*this->height_9/8 + palette_size; +} + +//textureList_getTexture +BKTextureHeader *func_802EA748(BKTextureList *arg0, s32 indx){ + return (BKTextureHeader *)(arg0 +1) + indx; +} diff --git a/src/core2/code_637D0.c b/src/core2/code_637D0.c new file mode 100644 index 00000000..22042a73 --- /dev/null +++ b/src/core2/code_637D0.c @@ -0,0 +1,291 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80252C08(f32[3], f32[3], f32, f32[3]); +extern void func_80252CC4(f32[3], f32[3], f32, s32); + +bool func_802EA760(BKModelUnk14List *arg0, s32 arg1, f32 arg2[3], f32 arg3[3], f32 arg4, f32 arg5[3], f32 arg6[3], f32 *arg7) { + s32 start; + BKModelUnk14_2 *temp_v0; + + if (arg1 >= arg0->unk4) { + return FALSE; + } + start = sizeof(BKModelUnk14List) + arg0->cnt0*sizeof(BKModelUnk14_0) + (s32)arg0; + temp_v0 = arg0->cnt2*sizeof(BKModelUnk14_1) + start + arg1 *sizeof(BKModelUnk14_2); + + arg6[0] = (f32) temp_v0->unk2[0]; + arg6[1] = (f32) temp_v0->unk2[1]; + arg6[2] = (f32) temp_v0->unk2[2]; + *arg7 = (f32) temp_v0->unk0; + mlMtxIdent(); + func_80252C08(arg2, arg3, arg4, arg5); + func_8025235C(arg6, arg6); + *arg7 /= arg4; + return TRUE; +} + +s32 func_802EA864(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, f32 arg4[3], f32 arg5[3], f32 arg6) { + BKModelUnk14_0 *start_ptr; + f32 spB0[3]; + f32 spA4[3]; + f32 sp98[3]; + f32 sp8C[3]; + BKModelUnk14_0 *end_ptr; + BKModelUnk14_0 *iPtr; + f32 sp78[3]; + s32 j; + + start_ptr = (BKModelUnk14_0 *)(arg0 + 1); + end_ptr = start_ptr + arg0->cnt0; + for(iPtr = start_ptr; iPtr < end_ptr; iPtr++){ + spB0[0] = (f32) iPtr->unkC[0]; + spB0[1] = (f32) iPtr->unkC[1]; + spB0[2] = (f32) iPtr->unkC[2]; + + spA4[0] = (f32) iPtr->unk0[0]; + spA4[1] = (f32) iPtr->unk0[1]; + spA4[2] = (f32) iPtr->unk0[2]; + + sp98[0] = (f32) iPtr->unk6[0]; + sp98[1] = (f32) iPtr->unk6[1]; + sp98[2] = (f32) iPtr->unk6[2]; + + sp8C[0] = (f32)iPtr->unk12[0]; + sp8C[1] = (f32)iPtr->unk12[1]; + sp8C[2] = (f32)iPtr->unk12[2]; + + sp8C[0] *= 2; + sp8C[1] *= 2; + sp8C[2] *= 2; + mlMtxIdent(); + func_80252EC8(spB0, sp8C); + func_80252CC4(position, rotation, scale, arg4); + func_8025235C(&sp78, arg5); + for(j = 0; j < 3; j++){ + if (((sp78[j] + arg6 / scale) <= spA4[j]) || (sp98[j] <= (sp78[j] - arg6 / scale))) + break; + } + if (j == 3) { + return iPtr->unk15; + } + } + return 0; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_637D0/func_802EAB34.s") +#else +s32 func_802EAB34(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, f32 arg4[3], f32 arg5[3], f32 arg6){ + BKModelUnk14_1 *iPtr; + f32 spA0[3]; + f32 sp94[3]; + BKModelUnk14_0 *tmp; + s32 start_ptr; + BKModelUnk14_1 *end_ptr; + f32 temp_f20; + f32 sp78[3]; + f32 temp_f22; + f32 temp_f24; + + // tmp = ; + start_ptr = (s32)(arg0 + 1); + // start_ptr += sizeof(BKModelUnk14List); + start_ptr += arg0->cnt0*sizeof(BKModelUnk14_0); + end_ptr = start_ptr + arg0->cnt2*sizeof(BKModelUnk14_1); + for(iPtr = start_ptr; iPtr < end_ptr; iPtr++){ + spA0[0] = (f32) iPtr->unk4[0]; + spA0[1] = (f32) iPtr->unk4[1]; + spA0[2] = (f32) iPtr->unk4[2]; + + sp94[0] = (f32) ((s32)iPtr->unkA[0] * 2); + sp94[1] = (f32) ((s32)iPtr->unkA[1] * 2); + sp94[2] = (f32) ((s32)iPtr->unkA[2] * 2); + temp_f24 = (f32) iPtr->unk0; + temp_f20 = (f32) iPtr->unk2; + mlMtxIdent(); + func_80252DDC(spA0, sp94); + func_80252CC4(position, rotation, scale, arg4); + func_8025235C(&sp78, arg5); + if (!(temp_f20 / 2 <= (sp78[2] - arg6 / scale)) && !((sp78[2] + arg6 / scale) <= -(temp_f20 / 2))) { + if (!(((arg6 / scale + temp_f24) * (arg6 / scale + temp_f24)) <= ((sp78[0] * sp78[0]) + (sp78[1] * sp78[1])))) { + return iPtr->unkD; + } + } + } + return 0; +} +#endif + + +s32 func_802EAD5C(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, f32 arg6[3], f32 arg7); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_637D0/func_802EAD5C.s") + +s32 func_802EAED4(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, s32 arg5, f32 arg6[3], f32 arg7); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_637D0/func_802EAED4.s") + +s32 func_802EB458(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, s32 arg5, f32 arg6[3], f32 arg7); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_637D0/func_802EB458.s") + +s32 func_802EB8A0(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, s32 arg5, f32 arg6[3], f32 arg7); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_637D0/func_802EB8A0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_637D0/func_802EBA98.s") + +extern Mtx D_80380880; + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_637D0/func_802EBAE0.s") +// s32 func_802EBAE0(BKModelUnk14List *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, s32 arg5, f32 arg6[3], f32 arg7, f32 arg8[3]) { +// f32 sp3C[3]; +// f32 temp_f0; +// s32 phi_v0; + +// sp3C[0] = arg6[0] - position[0]; +// sp3C[1] = arg6[1] - position[1]; +// sp3C[2] = arg6[2] - position[2]; +// temp_f0 = (arg7 + (arg0->unk6 * scale)); +// if( (arg0->unk6 > 0) +// && ((temp_f0 * temp_f0) < (sp3C[0] * sp3C[0]) + (sp3C[1] * sp3C[1]) + (sp3C[2] * sp3C[2])) +// ) { +// return 0; +// } +// if (arg5 != NULL) { +// mlMtxIdent(); +// func_80252C08(position, rotation, scale, arg4); +// func_802513B0(&D_80380880); +// phi_v0 = func_802EB8A0(arg0, position, rotation, scale, arg4, arg5, arg6, arg7); +// if (phi_v0 == 0) { +// phi_v0 = func_802EAED4(arg0, position, rotation, scale, arg4, arg5, arg6, arg7); +// } +// if (phi_v0 == 0) { +// phi_v0 = func_802EB458(arg0, position, rotation, scale, arg4, arg5, arg6, arg7); +// } +// } else { +// phi_v0 = func_802EAD5C(arg0, position, rotation, scale, arg4, arg6, arg7); +// if(phi_v0 == 0){ +// phi_v0 = func_802EA864(arg0, position, rotation, scale, arg4, arg6, arg7); +// } +// if(phi_v0 == 0){ +// phi_v0 = func_802EAB34(arg0, position, rotation, scale, arg4, arg6, arg7); +// } +// } +// if (phi_v0 != 0) { +// arg8[0] = 0.0f; +// arg8[1] = 1.0f; +// arg8[2] = 0.0f; +// } +// return phi_v0; +// } + +#ifndef NONMATCHING +s32 func_802EBD3C(BKModelUnk14List *arg0, f32 arg1[3], f32 arg2[3], f32 arg3, s32 arg4, f32 arg5[3], s32 arg6); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_637D0/func_802EBD3C.s") +#else +s32 func_802EBD3C(BKModelUnk14List *arg0, f32 arg1[3], f32 arg2[3], f32 arg3, s32 arg4, s32 arg5, s32 arg6) { + s32 i; + f32 spA0[3]; + f32 sp94[3]; + f32 sp88[3]; + f32 sp7C[3]; + BKModelUnk14_0 *phi_s0; + BKModelUnk14_0 *temp_s4; + f32 sp68[3]; + BKModelUnk14_0 *temp_s0; + + temp_s0 = (BKModelUnk14_0 *)(arg0 + 1); + temp_s4 = temp_s0 + (arg0->cnt0); + for(phi_s0 = temp_s0; phi_s0 < temp_s4; phi_s0++){ + if ((phi_s0->unk15 != 0) && ((arg6 == 0) || (arg6 == phi_s0->unk15))) { + spA0[0] = (f32) phi_s0->unkC[0]; + spA0[1] = (f32) phi_s0->unkC[1]; + spA0[2] = (f32) phi_s0->unkC[2]; + sp94[0] = (f32) phi_s0->unk0[0]; + sp94[1] = (f32) phi_s0->unk0[1]; + sp94[2] = (f32) phi_s0->unk0[2]; + sp88[0] = (f32) phi_s0->unk6[0]; + sp88[1] = (f32) phi_s0->unk6[1]; + sp88[2] = (f32) phi_s0->unk6[2]; + sp7C[0] = (f32)phi_s0->unk12[0]; + sp7C[1] = (f32)phi_s0->unk12[1]; + sp7C[2] = (f32)phi_s0->unk12[2]; + + sp7C[0] *= 2; + sp7C[1] *= 2; + sp7C[2] *= 2; + mlMtxIdent(); + func_80252EC8(spA0, sp7C); + func_80252CC4(arg1, arg2, arg3, arg4); + func_8025235C(sp68, arg5); + for(i = 0; i < 3; i++){ + if((sp68[i] <= sp94[i]) || (sp88[i] <= sp68[i])){ + break; + } + } + if(i == 3){ + return phi_s0->unk15; + } + } + } + return 0; +} +#endif + +#ifndef NONMATCHING +s32 func_802EC000(BKModelUnk14List *arg0, s32 arg1, s32 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_637D0/func_802EC000.s") +#else +s32 func_802EC000(BKModelUnk14List *arg0, f32 arg1[3], f32 arg2[3], f32 arg3, s32 arg4, f32 arg5[3], s32 arg6){ + BKModelUnk14_1 *temp_s2; + f32 sp90[3]; + f32 sp84[3]; + BKModelUnk14_1 *phi_s0; + f32 temp_f20; + f32 temp_f22; + f32 temp_f0; + f32 sp68[3]; + + phi_s0 = (BKModelUnk14_1 *)(sizeof(BKModelUnk14List) + arg0->cnt0*sizeof(BKModelUnk14_0) + (s32)arg0); + temp_s2 = phi_s0 + arg0->cnt2; + for( ; phi_s0 < temp_s2; phi_s0++){ + if ((phi_s0->unkD != 0) && ((arg6 == 0) || (arg6 == phi_s0->unkD))) { + sp90[0] = (f32) phi_s0->unk4[0]; + sp90[1] = (f32) phi_s0->unk4[1]; + sp90[2] = (f32) phi_s0->unk4[2]; + sp84[0] = (f32) (phi_s0->unkA[0] * 2); + sp84[1] = (f32) (phi_s0->unkA[1] * 2); + sp84[2] = (f32) (phi_s0->unkA[2] * 2); + temp_f20 = (f32) phi_s0->unk0; + temp_f22 = (f32) phi_s0->unk2; + mlMtxIdent(); + func_80252DDC(&sp90, &sp84); + func_80252CC4(arg1, arg2, arg3, arg4); + func_8025235C(&sp68, arg5); + temp_f0 = (f32) (temp_f22 * 0.5); + if (!(temp_f0 <= sp68[2]) && !(sp68[2] <= -temp_f0) && !((temp_f20 * temp_f20) <= (sp68[0] * sp68[0] + sp68[1]*sp68[1]))) { + return phi_s0->unkD; + } + } + } + return 0; +} +#endif + + +s32 func_802EC238(BKModelUnk14List *arg0, s32 arg1, s32 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_637D0/func_802EC238.s") + +s32 func_802EC394(BKModelUnk14List *arg0, s32 arg1, s32 arg2, f32 arg3, s32 arg4, s32 arg5, s32 arg6) { + s32 phi_v0; + + phi_v0 = func_802EBD3C(arg0, arg1, arg2, arg3, arg4, arg5, arg6); + if (phi_v0 != NULL) { + return phi_v0; + } + + phi_v0 = func_802EC000(arg0, arg1, arg2, arg3, arg4, arg5, arg6); + if (phi_v0 != NULL) { + return phi_v0; + } + return func_802EC238(arg0, arg1, arg2, arg3, arg4, arg5, arg6); +} diff --git a/src/core2/code_654C0.c b/src/core2/code_654C0.c new file mode 100644 index 00000000..a4118779 --- /dev/null +++ b/src/core2/code_654C0.c @@ -0,0 +1,383 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80252CC4(f32[3], f32 [3], f32, f32[3]); +extern f32 func_8034A9D0(f32[4], f32); + +/*.bss */ +extern struct { + s32 unk0; + f32 unk4[3]; + f32 unk10[3]; + f32 unk1C; + f32 unk20[3]; +}D_803808C0; +extern f32 D_803808E0; + +/* .code */ +Vtx *vtxList_getVertices(BKVertexList *vtxList){ + return &vtxList->vtx_18[0]; +} + +//vtxList_getBoundingBox_i +void func_802EC458(BKVertexList *vtxList, s32 min[3], s32 max[3]){ + min[0] = vtxList->minCoord_0[0]; + min[1] = vtxList->minCoord_0[1]; + min[2] = vtxList->minCoord_0[2]; + + max[0] = vtxList->maxCoord_6[0]; + max[1] = vtxList->maxCoord_6[1]; + max[2] = vtxList->maxCoord_6[2]; +} + +//vtxList_getBoundingBox_f +void func_802EC48C(BKVertexList *vtxList, f32 min[3], f32 max[3]){ + min[0] = (f32) vtxList->minCoord_0[0]; + min[1] = (f32) vtxList->minCoord_0[1]; + min[2] = (f32) vtxList->minCoord_0[2]; + + max[0] = (f32) vtxList->maxCoord_6[0]; + max[1] = (f32) vtxList->maxCoord_6[1]; + max[2] = (f32) vtxList->maxCoord_6[2]; +} + +void func_802EC508(BKVertexList *arg0, f32 arg1[3], f32 arg2[3]) { + Vtx *start_vtx; + Vtx *end_vtx; + Vtx *i_vtx; + s32 i; + f32 sp44[3]; + + start_vtx = (Vtx *)(arg0 + 1); + end_vtx = start_vtx + arg0->cnt_14; + arg1[0] = (f32) start_vtx->v.ob[0]; + arg1[1] = (f32) start_vtx->v.ob[1]; + arg1[2] = (f32) start_vtx->v.ob[2]; + func_8025235C(arg1, arg1); + arg2[0] = arg1[0]; + arg2[1] = arg1[1]; + arg2[2] = arg1[2]; + + for( i_vtx = start_vtx + 1; i_vtx < end_vtx; i_vtx++){ + sp44[0] = (f32) i_vtx->v.ob[0]; + sp44[1] = (f32) i_vtx->v.ob[1]; + sp44[2] = (f32) i_vtx->v.ob[2]; + func_8025235C(sp44, sp44); + + for(i = 0; i < 3; i++){ + if( sp44[i] < arg1[i]){ + arg1[i] = sp44[i]; + } + if( arg2[i] < sp44[i]){ + arg2[i] = sp44[i]; + } + } + } +} + +void func_802EC680(BKVertexList *arg0, s32 arg1, f32 arg2[3], f32 arg3[3]) { + Vtx *start_vtx; + Vtx *end_vtx; + Vtx *i_vtx; + s32 i; + f32 sp44[3]; + + start_vtx = (Vtx*)(arg0 + 1); + end_vtx = start_vtx + arg0->cnt_14; + + for(i_vtx = start_vtx; i_vtx < end_vtx; i_vtx++){ + sp44[0] = (f32) i_vtx->v.ob[0]; + sp44[1] = (f32) i_vtx->v.ob[1]; + sp44[2] = (f32) i_vtx->v.ob[2]; + func_8025235C(sp44, sp44); + if ((i_vtx == start_vtx) || (sp44[1] < arg2[1])) { + arg2[1] = sp44[1]; + } + } + + arg3[1] = arg2[1]+ (f32) arg1; + + for(i_vtx = start_vtx; i_vtx < end_vtx; i_vtx++){ + sp44[0] = (f32) i_vtx->v.ob[0]; + sp44[1] = (f32) i_vtx->v.ob[1]; + sp44[2] = (f32) i_vtx->v.ob[2]; + func_8025235C(sp44, sp44); + if (sp44[1] < arg3[1]) { + + arg2[0] = sp44[0]; + arg2[2] = sp44[2]; + + arg3[0] = sp44[0]; + arg3[2] = sp44[2]; + break; + } + } + + for(i_vtx = i_vtx + 1; i_vtx < end_vtx; i_vtx++) { + sp44[0] = (f32) i_vtx->v.ob[0]; + sp44[1] = (f32) i_vtx->v.ob[1]; + sp44[2] = (f32) i_vtx->v.ob[2]; + func_8025235C(sp44, sp44); + if (sp44[1] < arg3[1]) { + for(i = 0; i < 3; i+=2){ + if (sp44[i] < arg2[i]) { + arg2[i] = sp44[i]; + } + if (arg3[i] < sp44[i]) { + arg3[i] = sp44[i]; + } + } + } + } +} + +//vtxList_getBeginAndEndPtrs +void func_802EC8FC(BKVertexList *this, Vtx **vtx, Vtx **vtx_end){ + *vtx = &this->vtx_18[0]; + *vtx_end = &(*vtx)[this->cnt_14]; +} + +//vtxList_getVtxCount +s32 func_802EC918(BKVertexList *this){ + return this->cnt_14; +} + +f32 func_802EC920(BKVertexList *this){ + return (f32)this->unk16; +} + +void func_802EC930(BKVertexList *this, f32 arg1[3], f32 *arg2){ + arg1[0] = (f32)this->unkC[0]; + arg1[1] = (f32)this->unkC[1]; + arg1[2] = (f32)this->unkC[2]; + *arg2 = this->unk12; +} + +f32 func_802EC984(BKVertexList *this){ + return (f32)this->unk12; +} + +void vtxList_free(BKVertexList *vtxList){ + free(vtxList); +} + +BKVertexList *vtxList_clone(BKVertexList *vtxList){ + BKVertexList *out_v0; + size_t list_size; + + list_size = sizeof(BKVertexList) + vtxList->cnt_14*sizeof(Vtx); + out_v0 = (BKVertexList *) malloc(list_size); + func_80254630(out_v0, vtxList, list_size); + return out_v0; +} + +// vtxList_copy_colors +void func_802EC9FC(BKVertexList *dst, BKVertexList *src) { + Vtx *start_ptr; + Vtx *end_ptr; + Vtx *i_ptr; + Vtx *src_ptr; + s32 i; + + src_ptr = &src->vtx_18[0]; + start_ptr = &dst->vtx_18[0]; + end_ptr = start_ptr + dst->cnt_14; + for(i_ptr = start_ptr; i_ptr < end_ptr; i_ptr++, src_ptr++){ + i_ptr->v.cn[0] = src_ptr->v.cn[0]; + i_ptr->v.cn[1] = src_ptr->v.cn[1]; + i_ptr->v.cn[2] = src_ptr->v.cn[2]; + i_ptr->v.cn[3] = src_ptr->v.cn[3]; + } + osWritebackDCache(start_ptr, ((s32)(end_ptr - start_ptr)) * sizeof(Vtx)); +} + +void vtxList_tint(BKVertexList *dst, s32 target_color[3], f32 amount, BKVertexList *src) { + Vtx *start_ptr; + Vtx *end_ptr; + Vtx *i_ptr; + Vtx *src_ptr; + s32 i; + + start_ptr = &dst->vtx_18[0]; + end_ptr = start_ptr + dst->cnt_14; + for(i_ptr = start_ptr, src_ptr = &src->vtx_18[0]; i_ptr < end_ptr; i_ptr++, src_ptr++){ + for(i = 0; i < 3; i++){ + i_ptr->v.cn[i] = src_ptr->v.cn[i] + (target_color[i] - src_ptr->v.cn[i]) * amount; + } + } + osWritebackDCache(start_ptr, ((s32)(end_ptr - start_ptr)) * sizeof(Vtx)); +} + +void func_802ECBD4(BKVertexList *dst, BKVertexList *src, f32 arg2[3], f32 arg3[3], f32 arg4[4]) { + f32 sp74[3]; + f32 sp68[3]; + Vtx *dst_vtx; + Vtx *start_vtx; + Vtx *end_vtx; + Vtx *src_vtx; + f32 sp4C[3]; + s32 i; + f32 temp_f0; + s32 pad40; + + func_8024C5CC(sp74); + func_8024C5A8(sp68); + mlMtxIdent(); + func_80252CC4(arg2, arg3, 1.0f, NULL); + func_8025235C(sp74, sp74); + + mlMtxIdent(); + func_80252CC4(NULL, arg3, 1.0f, NULL); + func_8025235C(sp68, sp68); + + start_vtx = (Vtx *)(dst + 1); + end_vtx = start_vtx + dst->cnt_14; + for(dst_vtx = start_vtx, src_vtx = (Vtx *)(src + 1); dst_vtx < end_vtx; dst_vtx++, src_vtx++){ + sp4C[0] = dst_vtx->v.ob[0] - sp74[0]; + sp4C[1] = dst_vtx->v.ob[1] - sp74[1]; + sp4C[2] = dst_vtx->v.ob[2] - sp74[2]; + temp_f0 = sp68[0]*sp4C[0] + sp68[1]*sp4C[1] + sp68[2]*sp4C[2]; + temp_f0 = func_8034A9D0(arg4, temp_f0); + for(i = 0; i < 3; i++){ + dst_vtx->v.cn[i] = temp_f0*src_vtx->v.cn[i]; + } + } + osWritebackDCache(start_vtx, (end_vtx - start_vtx) * sizeof(Vtx)); +} + +void func_802ECE30(BKVertexList *arg0) { + Vtx *start_ptr; + Vtx *end_ptr; + Vtx *i_ptr; + s32 i; + + start_ptr = &arg0->vtx_18[0]; + end_ptr = start_ptr + arg0->cnt_14; + for(i_ptr = start_ptr; i_ptr < end_ptr; i_ptr++){ + for(i = 0; i < 3; i++){ + i_ptr->v.cn[i] = 0; + } + i_ptr->v.cn[0] = randf() * 255.0f; + } + osWritebackDCache(start_ptr, ((s32)(end_ptr - start_ptr)) * sizeof(Vtx)); +} + +void func_802ECF64(BKVertexList *arg0) { + Vtx *start_ptr; + Vtx *end_ptr; + Vtx *i_ptr; + s32 i; + s32 phi_s0; + + start_ptr = &arg0->vtx_18[0]; + end_ptr = start_ptr + arg0->cnt_14; + for(i_ptr = start_ptr; i_ptr < end_ptr; i_ptr++){ + for(i = 0; i < 3; i++){ + phi_s0 = i_ptr->v.cn[i]; + phi_s0 += randf()*21.0f - 10.0f; + phi_s0 = (phi_s0 > 0xff) ? 0xff : phi_s0; + phi_s0 = (phi_s0 < 0) ? 0 : phi_s0; + i_ptr->v.cn[i] = phi_s0; + } + } + osWritebackDCache(start_ptr, ((s32)(end_ptr - start_ptr)) * sizeof(Vtx)); +} + +void vtxList_recolor(BKVertexList *arg0, s32 arg1[3]) { + Vtx *start_ptr; + Vtx *end_ptr; + Vtx *i_ptr; + s32 i; + s32 phi_s0; + + start_ptr = &arg0->vtx_18[0]; + end_ptr = start_ptr + arg0->cnt_14; + for(i_ptr = start_ptr; i_ptr < end_ptr; i_ptr++){ + for(i = 0; i < 3; i++){ + i_ptr->v.cn[i] = arg1[i]; + } + } + osWritebackDCache(start_ptr, ((s32)(end_ptr - start_ptr)) * sizeof(Vtx)); +} + +void func_802ED108(f32 arg0[3]){ + arg0[0] = D_803808C0.unk20[0]; + arg0[1] = D_803808C0.unk20[1]; + arg0[2] = D_803808C0.unk20[2]; +} + +s32 func_802ED12C(void){ + return D_803808C0.unk0; +} + +void func_802ED138(f32 arg0[3], f32 arg1[3], f32 arg2){ + D_803808C0.unk0 = 0; + D_803808C0.unk10[0] = arg0[0]; + D_803808C0.unk10[1] = arg0[1]; + D_803808C0.unk10[2] = arg0[2]; + + D_803808C0.unk4[0] = arg1[0]; + D_803808C0.unk4[1] = arg1[1]; + D_803808C0.unk4[2] = arg1[2]; + + D_803808C0.unk1C = arg2; +} + +void func_802ED180(BKVertexList *arg0, f32 arg1[3], f32 arg2[3], f32 arg3, f32 arg4[3]) { + Vtx *phi_s0; + f32 sp88[3]; + f32 sp7C[3]; + f32 sp70[3]; + Vtx *phi_s1; + Vtx *start; + f32 sp5C[3]; + f32 temp_f20; + f32 temp_f0; + + + mlMtxIdent(); + func_80252CC4(arg1, arg2, arg3, arg4); + func_8025235C(sp88, D_803808C0.unk10); + func_8025235C(sp7C, D_803808C0.unk4); + temp_f20 = D_803808C0.unk1C / arg3; + temp_f20 = temp_f20*temp_f20; + start = (Vtx*)(arg0 + 1); + phi_s1 = start + arg0->cnt_14; + for(phi_s0 = start; phi_s0 < phi_s1; phi_s0++){ + sp70[0] = (f32) phi_s0->v.ob[0]; + sp70[1] = (f32) phi_s0->v.ob[1]; + sp70[2] = (f32) phi_s0->v.ob[2]; + + sp5C[0] = sp70[0] - sp7C[0]; + sp5C[1] = sp70[1] - sp7C[1]; + sp5C[2] = sp70[2] - sp7C[2]; + + temp_f0 = sp5C[0]*sp5C[0] + sp5C[1]*sp5C[1] + sp5C[2]*sp5C[2]; + if (!(temp_f20 <= temp_f0)) { + D_803808C0.unk0 = 1; + mlMtxIdent(); + func_80252C08(arg1, arg2, arg3, arg4); + func_8025235C(D_803808C0.unk20, sp70); + } + } +} + +void func_802ED340(BKVertexList *arg0, s32 indx, f32 dst[3]){ + Vtx *vtx; + + vtx = (s32)(arg0 + 1) + (indx * sizeof(Vtx)); + dst[0] = (f32) vtx->v.ob[0]; + dst[1] = (f32) vtx->v.ob[1]; + dst[2] = (f32) vtx->v.ob[2]; +} + +void func_802ED38C(BKVertexList *arg0, s32 indx, f32 arg2[3]){ + Vtx *vtx; + s32 i; + + vtx = (s32)(arg0 + 1) + (indx * sizeof(Vtx)); + for(i = 0; i < 3; i++){ + vtx->v.ob[i] = (arg2[i] >= 0.0) ? arg2[i] + 0.5 : arg2[i] - 0.5; + } +} diff --git a/src/core2/code_66490.c b/src/core2/code_66490.c new file mode 100644 index 00000000..63deacfd --- /dev/null +++ b/src/core2/code_66490.c @@ -0,0 +1,40 @@ +#include +#include "functions.h" +#include "variables.h" + + +bool func_802ED420(BKModelUnk20List *arg0, u8 *arg1, u32 arg2) { + BKModelUnk20_0 *start_ptr; + + start_ptr = (BKModelUnk20_0 *)(arg0 + 1); + while(arg2 != 0){ + if (start_ptr[*arg1].unkC != 0) { + return TRUE; + } + arg2--; + arg1++; + } + return FALSE; +} + +void func_802ED52C(BKModelUnk20List *arg0, f32 arg1[3], f32 arg2) { + BKModelUnk20_0 *start_ptr; + BKModelUnk20_0 *end_ptr; + BKModelUnk20_0 *i_ptr; + s32 i; + s16 sp18[3]; + + start_ptr = ( BKModelUnk20_0 *)(arg0 + 1); + sp18[0] = (s16) (arg1[0] * (1.0 / arg2)); + sp18[1] = (s16) (arg1[1] * (1.0 / arg2)); + sp18[2] = (s16) (arg1[2] * (1.0 / arg2)); + end_ptr = start_ptr + arg0->unk0; + for(i_ptr = start_ptr; i_ptr < end_ptr; i_ptr++){ + for(i = 0; i < 3; i++){ + if ((sp18[i] < i_ptr->unk0[i]) || (i_ptr->unk6[i] < sp18[i])) { + break; + } + } + i_ptr->unkC = (i == 3); + } +} diff --git a/src/core2/code_66D90.c b/src/core2/code_66D90.c new file mode 100644 index 00000000..33e92107 --- /dev/null +++ b/src/core2/code_66D90.c @@ -0,0 +1,57 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802EFA34(ParticleEmitter *, f32); +extern void func_802EFF5C(ParticleEmitter *, f32, f32, f32); +extern void func_802EFF7C(ParticleEmitter *, f32, f32, f32); +extern void func_802EFF9C(ParticleEmitter *, f32); + +/* .data */ +extern s32 D_80368850[3]; + +/* .bss */ +extern u8 D_803808F0; + +/* .code */ +void func_802EDD20(void){ + func_802F1190(D_803808F0); +} + +void func_802EDD44(void){ + D_803808F0 = func_802F0F78(0x1e); +} + +void func_802EDD68(ParticleEmitter *caller, f32 pos[3]){ + func_802F3554(0, pos); +} + +ParticleEmitter *func_802EDD8C(f32 pos[3], f32 xz_range, f32 arg2){ + ParticleEmitter *pCtrl = func_802F0EF0(D_803808F0); + particleEmitter_setSprite(pCtrl, ASSET_70A_SPRITE_BUBBLE_1); + func_802EFA70(pCtrl, 4); + func_802EF9E4(pCtrl, 0xff); + particleEmitter_setParticleAccelerationRange( pCtrl, + 0.0f, 150.0f, 0.0f, + 0.0f, 150.0f, 0.0f + ); + func_802EFA18(pCtrl, 1); + func_802EFA34(pCtrl, arg2); + particleEmitter_setParticleCallback(pCtrl, func_802EDD68); + func_802EFA5C(pCtrl, 0.0f, 0.8f); + func_802EFEC0(pCtrl, 4.0f, 4.0f); + particleEmitter_setParticleSpawnPositionRange( pCtrl, + -xz_range, 0.0f, -xz_range, + xz_range, 0.0f, xz_range + ); + particleEmitter_setPosition(pCtrl, pos); + func_802EFFA8(pCtrl, D_80368850); + func_802EFB70(pCtrl, 0.05f, 0.09f); + func_802EFB84(pCtrl, 0.05f, 0.09f); + func_802EFF50(pCtrl, 10.0f); + func_802EFF5C(pCtrl, 0.25f, 0.25f, 0.0f); + func_802EFF7C(pCtrl, 0.0f, 0.1f, 0.0f); + func_802EFF9C(pCtrl, 0.2f); + + return pCtrl; +} diff --git a/src/core2/code_66FB0.c b/src/core2/code_66FB0.c new file mode 100644 index 00000000..fc877760 --- /dev/null +++ b/src/core2/code_66FB0.c @@ -0,0 +1,132 @@ +#include +#include "functions.h" +#include "variables.h" +extern void func_802EFF9C(ParticleEmitter *, f32); + +/* .data */ +s32 D_80368860[] = { + 0x360, + 0x50E, + 0x2E7, + 0x427, + 0x50F, + 0x510, + ASSET_896_MODEL_GOLD_ROCK, + 0x516, + 0x535, + 0x536, + 0x537, + 0x88F, + 0x89F, + 0x3AF, + 0x3A8 +}; + +s32 D_8036889C[] = { + 0x608, + ASSET_702_SPRITE_UNKNOWN, + 0x712, + ASSET_713_SPRITE_SPARKLE_YELLOW, + ASSET_717_SPRITE_SPARKLE_YELLOW_2, + ASSET_710_SPRITE_SPARKLE_PURPLE, + ASSET_711_SPRITE_SPARKLE_DARK_BLUE, + 0x714, + ASSET_715_SPRITE_SPARKLE_RED, + ASSET_716_SPRITE_SPARKLE_WHITE, + ASSET_718_SPRITE_SPARKLE_WHITE_2, + ASSET_719_SPRITE_SPARKLE_GREEN_2, + ASSET_71A_SPRITE_SPARKLE_PINK_2, + ASSET_71B_SPRITE_SPARKLE_ORANGE_2 +}; + +/* .code */ +void func_802EDF40(f32 pos[3], s32 arg1, s32 cnt, f32 arg3, f32 arg4, f32 arg5, f32 arg6[3], f32 arg7[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + f32 tmp_f0; + if(arg1 < 0x3e7){ + particleEmitter_setModel(pCtrl, D_80368860[arg1]); + func_802EFB70(pCtrl, arg3 * 0.6, arg3 * 1.1); + func_802EFE24(pCtrl, 400.0f, 400.0f, 400.0f, 800.0f, 800.0f, 800.0f); + } + else{//L802EE008 + particleEmitter_setSprite(pCtrl, D_8036889C[arg1 - 0x3e8]); + if(arg1 == 0x3e9) { + particleEmitter_setStartingFrameRange(pCtrl, 3, 5); + } + else{ + particleEmitter_setStartingFrameRange(pCtrl, 0, 0); + } + func_802EFB70(pCtrl, arg3, arg3); + func_802EFB84(pCtrl, arg3, arg3); + func_802EFE24(pCtrl, 0, 0, 0, 0, 0, 0); + func_802EFF9C(pCtrl, 0); + }//L802EE0B4 + particleEmitter_setParticleAccelerationRange(pCtrl, + 0, -800.0f, 0, + 0, -800.0f, 0 + ); + func_802EF9F8(pCtrl, 0.6f); + func_802EFA18(pCtrl, 0); + particleEmitter_setParticleSpawnPositionRange(pCtrl, + -10.0f, -10.0f, -10.0f, + 10.0f, 10.0f, 10.0f + ); + particleEmitter_setSpawnIntervalRange(pCtrl, 0, 0.01f); + func_802EFEC0(pCtrl, arg5, arg5); + if(arg7){ + tmp_f0 = arg7[0]*arg4; + particleEmitter_setParticleVelocityRange(pCtrl, + -tmp_f0, arg7[1]*arg4, -tmp_f0, + tmp_f0, arg7[2]*arg4, tmp_f0 + ); + } + else{ + particleEmitter_setParticleVelocityRange(pCtrl, + -350.0f*arg4, 350.0f*arg4, -350.0f*arg4, + 350.0f*arg4, 0*arg4, 350.0f*arg4 + ); + } + if(arg6){ + func_802EFFA8(pCtrl, arg6); + func_802EF9E4(pCtrl, reinterpret_cast(s32, arg6[3])); + } + + particleEmitter_setPosition(pCtrl, pos); + particleEmitter_emitN(pCtrl, cnt); + +} + +void func_802EE238(f32 pos[3], s32 arg1, s32 cnt, f32 arg3, f32 arg4){ + func_802EDF40(pos, arg1, cnt, arg3, arg4, 1.5f, NULL, 0); +} + +void func_802EE278(Actor *arg0, s32 arg1, s32 cnt, s32 arg3, f32 arg4, f32 arg5){ + f32 sp2C[3]; + sp2C[0] = arg0->position_x; + sp2C[1] = arg0->position_y + (f32)arg3; + sp2C[2] = arg0->position_z; + func_802EDF40(sp2C, arg1, cnt, arg4, arg5, 1.5f, NULL, 0); +} + +void func_802EE2E8(Actor *arg0, s32 arg1, s32 cnt, s32 arg3, f32 arg4, f32 arg5, f32 arg6){ + f32 sp2C[3]; + sp2C[0] = arg0->position_x; + sp2C[1] = arg0->position_y + (f32)arg3; + sp2C[2] = arg0->position_z; + func_802EDF40(sp2C, arg1, cnt, arg4, arg5, arg6, NULL, 0); +} + +void func_802EE354(Actor* arg0, s32 arg1, s32 cnt, s32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7[3], s32 arg8, f32 arg9[3]){ + f32 sp2C[3]; + + if(arg8){ + func_8034A174(func_80329934(), arg8, sp2C); + sp2C[1] += (f32)arg3; + } + else{ + sp2C[0] = arg0->position_x; + sp2C[1] = arg0->position_y + (f32)arg3; + sp2C[2] = arg0->position_z; + } + func_802EDF40(sp2C, arg1, cnt, arg4, arg5, arg6, arg7, arg9); +} diff --git a/src/core2/code_67650.c b/src/core2/code_67650.c new file mode 100644 index 00000000..00886483 --- /dev/null +++ b/src/core2/code_67650.c @@ -0,0 +1,921 @@ +#include +#include "functions.h" +#include "variables.h" + +extern int func_8024DB50(f32 (*)[3], f32); +extern s32 spriteGetFrameCount(BKSprite *); +extern void func_80344720(s32 SpriteGfx, s32 frame, s32, f32[3], f32[3], f32[3], Gfx **, Mtx **); +extern void func_80344424(s32 SpriteGfx, s32 frame, s32, f32[3], f32[3], f32, Gfx **, Mtx **); + + +void func_802EF9E4(ParticleEmitter *this, s32 arg1); +void func_802EF9EC(ParticleEmitter *this, s32 arg1, s32 arg2); +void func_802EFA04(ParticleEmitter *, f32); +void particleEmitter_setParticleCallback(ParticleEmitter *this, void (*arg1)(ParticleEmitter *this, f32 pos[3])); +void func_802EFA20(ParticleEmitter *, f32, f32); +void func_802EFA34(ParticleEmitter *, f32); +void func_802EFA40(ParticleEmitter *, f32 (*)[3]); +void func_802EFA78(ParticleEmitter *this, s32 arg1); +void func_802EFF5C(ParticleEmitter *, f32, f32, f32); +void func_802EFF7C(ParticleEmitter *, f32, f32, f32); +void func_802EFF9C(ParticleEmitter *, f32); +void func_802F0C78(ParticleEmitter *this); + + +extern s16 D_80368930[] = {0x700, 0x702, 0x70D}; +extern Gfx D_80368940[] = { + gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH), + gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_TEXTURE_GEN_LINEAR | G_SHADING_SMOOTH), + gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON), + gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM), + gsDPSetCycleType(G_CYC_1CYCLE), + gsDPSetRenderMode(Z_CMP | IM_RD | CVG_DST_FULL | ZMODE_OPA | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA), Z_CMP | IM_RD | CVG_DST_FULL | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)), + gsSPEndDisplayList() +}; + +extern Gfx D_80368978[] = { + gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH), + gsSPSetGeometryMode(G_SHADE | G_TEXTURE_GEN_LINEAR | G_SHADING_SMOOTH), + gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON), + gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM), + gsDPSetCycleType(G_CYC_1CYCLE), + gsDPSetRenderMode(G_RM_XLU_SURF, G_RM_XLU_SURF2), + gsSPEndDisplayList() +}; + +ParticleEmitter **D_803689B0; //particlePtrArrayPtr +s32 D_803689B4; //particlePtrArraySize +s32 D_803689B8[3]; + +extern f64 D_803771B0; +extern f64 D_803771B8; +extern f64 D_803771C0; +extern f64 D_803771C8; + +// 000F 0220: C0F86A0000000000 40F86A0000000000 +// 000F 0230: 40F86A0000000000 3F50624DD2F1A9FC +// 000F 0240: 400921FB54524550 0000000000000000 + +extern u8 D_80380910[]; +extern f32 D_80380920; +extern u8 D_80380924; + + + +s32 func_802EE5E0(s32 arg0){ + return arg0; +} + +void func_802EE5E8(ParticleEmitter *this){ + return; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_67650/func_802EE5F0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_67650/func_802EE63C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_67650/func_802EE684.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_67650/func_802EE6CC.s") + +void func_802EE930(ParticleEmitter *this){ + func_8033B388(&this->sprite_1C, &this->unk34); + if(this->model_20) + func_8033BD20(&this->model_20); +} + +int func_802EE974(ParticleEmitter *this, f32 (*arg1)[3], f32 (*arg2)[3], f32 (*arg3)[3], s32 arg4){ + if(-100000.0 == this->unk74 && 100000.0 == this->unk78){ + return func_80309B48(arg1, arg2, arg3, 0); + } + + if(100000.0 != this->unk78 && this->unk78 < (*arg2)[1]){ + (*arg2)[1] = this->unk78; + (*arg3)[2] = 0.0f; + (*arg3)[0] = 0.0f; + (*arg3)[1] = -1.0f; + return 1; + } + + if(this->unk74 != -100000.0 && (*arg2)[1] < this->unk74){ + (*arg2)[1] = this->unk74; + (*arg3)[2] = 0.0f; + (*arg3)[0] = 0.0f; + (*arg3)[1] = 1.0f; + return 1; + } + + return 0; +} + +void __particleEmitter_initParticle(ParticleEmitter *this, Particle *particle){ + particle->unk0[0] = randf2(this->particleAccerationRange_4C_min_x, this->particleAccerationRange_4C_max_x); + particle->unk0[1] = randf2(this->particleAccerationRange_4C_min_y, this->particleAccerationRange_4C_max_y); + particle->unk0[2] = randf2(this->particleAccerationRange_4C_min_z, this->particleAccerationRange_4C_max_z); + particle->unk5C = this->unk64; + + particle->unkC = (0.0f == this->unk10) ? 1.0f : 0; + particle->frame_10 = randf2((f32)this->particleStartingFrameRange_84_min, (f32)this->particleStartingFrameRange_84_max); + particle->framerate_14 = randf2(this->particleFramerateRange_8C_min, this->particleFramerateRange_8C_max); + + particle->position_18[0] = this->postion_28[0]; + particle->position_18[1] = this->postion_28[1]; + particle->position_18[2] = this->postion_28[2]; + + particle->position_18[0] = particle->position_18[0] + randf2(this->particleSpawnPositionRange_94_min_x, this->particleSpawnPositionRange_94_max_x); + particle->position_18[1] = particle->position_18[1] + randf2(this->particleSpawnPositionRange_94_min_y, this->particleSpawnPositionRange_94_max_y); + particle->position_18[2] = particle->position_18[2] + randf2(this->particleSpawnPositionRange_94_min_z, this->particleSpawnPositionRange_94_max_z); + + particle->initialSize_34 = particle->size_30 = randf2(this->particleStartingScaleRange_AC_min, this->particleStartingScaleRange_AC_max); + if(0.0f == this->particleFinalScaleRange_B4_min && 0.0f == this->particleFinalScaleRange_B4_max) + particle->finalSizeDiff = 0.0f; + else + particle->finalSizeDiff = randf2(this->particleFinalScaleRange_B4_min, this->particleFinalScaleRange_B4_max)- particle->initialSize_34; + + particle->unk24[2] = 0.0f; + particle->unk24[1] = 0.0f; + particle->unk24[0] = 0.0f; + + particle->unk3C[0] = randf2(this->unkBC[0], this->unkC8[0]); + particle->unk3C[1] = randf2(this->unkBC[1], this->unkC8[1]); + particle->unk3C[2] = randf2(this->unkBC[2], this->unkC8[2]); + + particle->age_48 = 0.0f; + particle->lifetime_4C = randf2(this->unkDC[0], this->unkDC[1]) + 0.001; + if(!this->sphericalParticleVelocity_48){ + particle->velocity_50[0] = randf2(this->particleVelocityRange_E4.cartisian_min_x, this->particleVelocityRange_E4.cartisian_max_x); + particle->velocity_50[1] = randf2(this->particleVelocityRange_E4.cartisian_min_y, this->particleVelocityRange_E4.cartisian_max_y); + particle->velocity_50[2] = randf2(this->particleVelocityRange_E4.cartisian_min_z, this->particleVelocityRange_E4.cartisian_max_z); + } + else{ + func_80256E24(particle->velocity_50, + mlNormalizeAngle(randf2(this->particleVelocityRange_E4.spherical.pitch_min, this->particleVelocityRange_E4.spherical.pitch_max)), + mlNormalizeAngle(randf2(this->particleVelocityRange_E4.spherical.yaw_min, this->particleVelocityRange_E4.spherical.yaw_max)), + 0.0f, + 0.0f, + randf2(this->particleVelocityRange_E4.spherical.radius_min, this->particleVelocityRange_E4.spherical.radius_max) + ); + } +} + +void func_802EED1C(ParticleEmitter *this, f32 arg1, f32 arg2[3]){ + int i; + f32 tmp_f22; + f32 tmp_f0; + + tmp_f22 = this->unk108*0.5; + for(i = 0; i < 3; i++){ + if(this->unk118[i] != 0.0f){ + tmp_f0 = func_802588B0(this->unk10C[i] + arg1, this->unk108); + tmp_f0 = mlAbsF(tmp_f0 - tmp_f22); + tmp_f0 = ml_map_f(tmp_f0, 0.0f, tmp_f22, 1.0 - this->unk118[i], this->unk118[i] + 1.0); + arg2[i] *= tmp_f0; + } + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_67650/func_802EEE3C.s") +#else +void func_802EEE3C(ParticleEmitter *this, Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg4){ + f32 sp8C[3]; + f32 sp80[3]; + f32 sp74[3]; + Particle *iPtr; + s32 tmp_a0; + s32 tmp_a1; + s32 tmp_a2; + s32 tmp_a3; + + if(arg4 != (this->unk18 & 0x4)) + return; + + if(this->model_20 != NULL){ + for(iPtr = this->pList_start_124; iPtr < this->pList_end_128; iPtr++){ + sp8C[0] = iPtr->position_18[0] + this->unk4[0]; + sp8C[1] = iPtr->position_18[1] + this->unk4[1]; + sp8C[2] = iPtr->position_18[2] + this->unk4[2]; + if( 0.0f != this->unk10 || 1.0 != this->unk14 || this->unk49 != 0xff ){ + func_8033A410((s32) (iPtr->unkC*this->unk49)); + }//L802EEF5C + tmp_a3 = (this->unk18 & 0x10)?0:1; + set_model_render_mode(tmp_a3); + func_803391A4(gfx, mtx, sp8C, iPtr->unk24, iPtr->size_30, NULL, this->model_20); + } + } + else { + if(this->unk34){//L802EEFC4 + if( this->unk3C[0] != 0xff + || this->unk3C[1] != 0xff + || this->unk3C[2] != 0xff + || this->unk49 != 0xff + ){ + tmp_a3 = (this->unk18 & 0x10)? 9: 0xf; + func_803382E4(tmp_a3); + func_80338338(this->unk3C[0], this->unk3C[1], this->unk3C[2]); + tmp_a0 = (this->unk3C[0] < 8)? 0 : this->unk3C[0] - 8; + tmp_a1 = (this->unk3C[1] < 8)? 0 : this->unk3C[1] - 8; + tmp_a2 = (this->unk3C[2] < 8)? 0 : this->unk3C[2] - 8; + tmp_a3 = (this->unk18 & 0x20)? 0xff : this->unk49; + func_803382B4(tmp_a0, tmp_a1, tmp_a2, tmp_a3); + func_80338370(); + func_80335D30(gfx); + } + else if(this->unk18 & 0x10){//L802EF0C0 + gSPDisplayList((*gfx)++, D_80368978); + } + else{//L802EF0EC + gSPDisplayList((*gfx)++, D_80368940); + }//L802EF10C + sp80[0] = 90.0f; + sp80[1] = 0.0f; + sp80[2] = 0.0f; + for(iPtr = this->pList_start_124; iPtr < this->pList_end_128; iPtr++){ + gDPSetPrimColor((*gfx)++, 0, 0, this->unk3C[0], this->unk3C[1], this->unk3C[2], iPtr->unkC*this->unk49); + sp8C[0] = iPtr->position_18[0] + this->unk4[0]; + sp8C[1] = iPtr->position_18[1] + this->unk4[1]; + sp8C[2] = iPtr->position_18[2] + this->unk4[2]; + + sp74[0] = iPtr->size_30; + sp74[1] = iPtr->size_30; + sp74[2] = iPtr->size_30; + if(0.0f != this->unk108){ + func_802EED1C(this, iPtr->age_48, sp74); + } + func_80344C2C(this->unk0_16); + if(this->unk18 & 1){ + func_80344720(this->unk34, (s32)iPtr->frame_10, 0, sp8C, sp80, sp74, gfx, mtx); + }//L802EF2F8 + else{ + func_80344424(this->unk34, (s32)iPtr->frame_10, 0, sp8C, sp74, iPtr->unk24[2], gfx, mtx); + }//L802EF324 + }//L802EF338 + if( this->unk3C[0] != 0xff + || this->unk3C[1] != 0xff + || this->unk3C[2] != 0xff + || this->unk49 != 0xff + ){ + func_8033687C(gfx); + } + } + } +} +#endif + +void func_802EF3A8(ParticleEmitter *this, Gfx **gdl, Mtx **mPtr, Vtx **vPtr){ + func_802EEE3C(this, gdl, mPtr, vPtr, 4); + func_802EEE3C(this, gdl, mPtr, vPtr, 0); +} + +void func_802EF3F4(ParticleEmitter *this, f32 position_min[3], f32 position_max[3], s32 count){ + for(count; count > 0; count--){ + if(this->pList_end_128 < this->pList_capacity_12C){ + __particleEmitter_initParticle(this, this->pList_end_128); + this->pList_end_128->position_18[0] = randf2(position_min[0], position_max[0]); + this->pList_end_128->position_18[1] = randf2(position_min[1], position_max[1]); + this->pList_end_128->position_18[2] = randf2(position_min[2], position_max[2]); + this->pList_end_128++; + } + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_67650/func_802EF4AC.s") +#else +void func_802EF4AC(ParticleEmitter *this, f32 arg1[3], f32 arg2[3], s32 arg3) { + f32 sp3C[3]; + f32 temp_f0; + s32 temp_s4; + s32 i; + + // temp_s4 = arg3 - 1; + sp3C[0] = arg2[0] - arg1[0]; + sp3C[1] = arg2[1] - arg1[1]; + sp3C[2] = arg2[2] - arg1[2]; + for(i = 0; i < arg3 - 1; i++){ + if (this->pList_end_128 < this->pList_capacity_12C) { + __particleEmitter_initParticle(this, this->pList_end_128); + temp_f0 = (f32)i / arg3; + this->pList_end_128->position_18[0] = arg1[0] + sp3C[0]*temp_f0; + this->pList_end_128->position_18[1] = arg1[1] + sp3C[1]*temp_f0; + this->pList_end_128->position_18[2] = arg1[2] + sp3C[2]*temp_f0; + this->pList_end_128++; + } + } +} +#endif + +//particleEmitter_emitN +void particleEmitter_emitN(ParticleEmitter *this, int n){ + for(n; n > 0; n--){ + if(this->pList_end_128 < this->pList_capacity_12C){ + __particleEmitter_initParticle(this, this->pList_end_128++); + } + } +} + +//particleEmitter_particleListLength +int func_802EF628(ParticleEmitter *this){ + return (u32)(this->pList_end_128 - this->pList_start_124); +} + +//particleEmitter_isDone +int func_802EF648(ParticleEmitter *this){ + return (u32)(this->pList_end_128 - this->pList_start_124) < 1 + && this->doneSpawning_0_23 == 1; +} + +//particleEmitter_free +void func_802EF684(ParticleEmitter *this){ + func_802EE930(this); + free(this); +} + +ParticleEmitter * particleEmitter_new(u32 capacity){ + ParticleEmitter *this = malloc(capacity*sizeof(Particle) + sizeof(ParticleEmitter)); + f32 sp40[3]; + + this->unk0_0 = 0; + this->doneSpawning_0_23 = 1; + this->unk18 = 0; + this->sprite_1C = NULL; + this->unk0_16 = 0; + this->model_20 = NULL; + this->unk34 = 0; + this->assetId_0_15 = 0; + this->unk3C[0] = 0xff; + this->unk3C[1] = 0xff; + this->unk3C[2] = 0xff; + this->particleSpawnTimer_24 = 0.0f; + this->spawnIntervalTimer_38 = 0.0f; + sp40[0] = sp40[1] = sp40[2] = 0.0f; + + func_802EFA40(this, &sp40); + func_802EFA5C(this, 0.0f, 1.0f); + func_802EFA70(this, 0); + particleEmitter_setPosition(this, sp40); + particleEmitter_setParticleAccelerationRange(this, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + func_802EF9E4(this, 0xff); + particleEmitter_setParticleSpawnPositionRange(this, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + particleEmitter_setParticleVelocityRange(this, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + func_802EF9EC(this, 0, 0); + func_802EF9F8(this, 0.9f); + func_802EFA04(this, -100000.0f); + func_802EFA34(this, 100000.0f); + particleEmitter_setParticleCallback(this, 0); + func_802EFA18(this, 0); + func_802EFA20(this, 1.0f, 1.0f); + particleEmitter_setStartingFrameRange(this, 0, 0); + particleEmitter_setParticleFramerateRange(this, 0.0f, 0.0f); + func_802EFB70(this, 1.0f, 1.0f); + func_802EFB84(this, 0.0f, 0.0f); + func_802EFE24(this, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + particleEmitter_setSpawnIntervalRange(this, 0.0f, 5.0f); + func_802EFEC0(this, 0.0f, 5.0f); + func_802EFF5C(this, 0.0f, 0.0f, 0.0f); + func_802EFF7C(this, 0.0f, 0.0f, 0.0f); + func_802EFF9C(this, 0.0f); + func_802EFF50(this, 0.0f); + this->unk100 = 0; + this->unk104 = 0; + this->pList_start_124 = &this->data[0]; + this->pList_end_128 = &this->data[0]; + this->pList_capacity_12C = &this->pList_start_124[capacity]; + return this; +} + +void particleEmitter_setSprite(ParticleEmitter *this, enum asset_e sprite_id){ + if(sprite_id != this->assetId_0_15){ + this->assetId_0_15 = sprite_id; + func_802EE930(this); + this->sprite_1C = func_8033B6C4(sprite_id, &this->unk34); + } +} + +void particleEmitter_setParticleAccelerationRange(ParticleEmitter *this, f32 min_x, f32 min_y, f32 min_z, f32 max_x, f32 max_y, f32 max_z){ + this->particleAccerationRange_4C_min_x = min_x; + this->particleAccerationRange_4C_min_y = min_y; + this->particleAccerationRange_4C_min_z = min_z; + this->particleAccerationRange_4C_max_x = max_x; + this->particleAccerationRange_4C_max_y = max_y; + this->particleAccerationRange_4C_max_z = max_z; +} + +void func_802EF9E4(ParticleEmitter *this, s32 arg1){ + this->unk49 = arg1; +} + +void func_802EF9EC(ParticleEmitter *this, s32 arg1, s32 arg2){ + this->unk66 = arg1; + this->unk7C = arg2; +} + +void func_802EF9F8(ParticleEmitter *this, f32 arg1){ + this->unk68 = arg1; +} + +void func_802EFA04(ParticleEmitter *this, f32 arg1){ + this->unk74 = arg1; +} + +void particleEmitter_setParticleCallback(ParticleEmitter *this, void (*arg1)(ParticleEmitter *this, f32 pos[3])){ + this->particleCallback_80 = arg1; +} + +void func_802EFA18(ParticleEmitter *this, s32 arg1){ + this->unk64 = arg1; +} + +void func_802EFA20(ParticleEmitter *this, f32 arg1, f32 arg2){ + this->unk6C = arg1; + this->unk70 = arg2; +} + +void func_802EFA34(ParticleEmitter *this, f32 arg1){ + this->unk78 = arg1; +} + +void func_802EFA40(ParticleEmitter *this, f32 (*arg1)[3]){ + this->unk4[0] = (*arg1)[0]; + this->unk4[1] = (*arg1)[1]; + this->unk4[2] = (*arg1)[2]; +} + +void func_802EFA5C(ParticleEmitter *this, f32 arg1, f32 arg2){ + this->unk10 = arg1; + this->unk14 = arg2; +} + +void func_802EFA70(ParticleEmitter *this, s32 arg1){ + this->unk18 = arg1; +} + +void func_802EFA78(ParticleEmitter *this, s32 arg1){ + this->unk0_16 = arg1; +} + +void particleEmitter_setStartingFrameRange(ParticleEmitter *this, s32 arg1, s32 arg2){ + this->particleStartingFrameRange_84_min = arg1; + this->particleStartingFrameRange_84_max = arg2; +} + +void particleEmitter_setParticleFramerateRange(ParticleEmitter *this, f32 arg1, f32 arg2){ + this->particleFramerateRange_8C_min = arg1; + this->particleFramerateRange_8C_max = arg2; +} + +void func_802EFAB0(ParticleEmitter *this, s32 arg1, f32 arg2){ + this->unk100 = arg1; + this->unk104 = (s16) arg2; +} + +// +void particleEmitter_setModel(ParticleEmitter *this, enum asset_e model_id){ + if(this->assetId_0_15 != model_id){ + this->assetId_0_15 = model_id; + func_802EE930(this); + this->model_20 = assetcache_get(model_id); + } +} + +void particleEmitter_setParticleSpawnPositionRange(ParticleEmitter *this, f32 min_x, f32 min_y, f32 min_z, f32 max_x, f32 max_y, f32 max_z){ + this->particleSpawnPositionRange_94_min_x = min_x; + this->particleSpawnPositionRange_94_min_y = min_y; + this->particleSpawnPositionRange_94_min_z = min_z; + this->particleSpawnPositionRange_94_max_x = max_x; + this->particleSpawnPositionRange_94_max_y = max_y; + this->particleSpawnPositionRange_94_max_z = max_z; +} + +void particleEmitter_setPosition(ParticleEmitter * this, f32 position[3]){ + this->postion_28[0] = position[0]; + this->postion_28[1] = position[1]; + this->postion_28[2] = position[2]; +} + +void func_802EFB70(ParticleEmitter * this, f32 min, f32 max){ + this->particleStartingScaleRange_AC_min = min; + this->particleStartingScaleRange_AC_max = max; +} + +void func_802EFB84(ParticleEmitter * this, f32 min, f32 max){ + this->particleFinalScaleRange_B4_min = min; + this->particleFinalScaleRange_B4_max = max; +} + +void func_802EFB98(ParticleEmitter *this, struct31s *arg1){ + this->particleStartingScaleRange_AC_min = arg1->unk0[0]; + this->particleStartingScaleRange_AC_max = arg1->unk0[1]; + if(-1.0f != arg1->unk8[0]){ + this->particleFinalScaleRange_B4_min = arg1->unk8[0]; + this->particleFinalScaleRange_B4_max = arg1->unk8[1]; + } + particleEmitter_setSpawnIntervalRange(this, arg1->unk10[0], arg1->unk10[1]); + this->unkDC[0] = arg1->unk18[0]; + this->unkDC[1] = arg1->unk18[1]; + this->unk10 = arg1->unk20; + this->unk14 = arg1->unk24; +} + +void func_802EFC28(ParticleEmitter *this, struct40s *arg1){ + func_802EFB98(this, &arg1->unk0); + func_802EFA70(this, (s32)arg1->unk28); + particleEmitter_emitN(this, (s32)arg1->unk2C); +} + +void particleEmitter_setVelocityAndAccelerationRanges(ParticleEmitter *this, struct41s *arg1){ + particleEmitter_setParticleVelocityRange(this, + arg1->unk0.unk0[0], arg1->unk0.unk0[1], arg1->unk0.unk0[2], + arg1->unk0.unkC[0], arg1->unk0.unkC[1], arg1->unk0.unkC[2] + ); + particleEmitter_setParticleAccelerationRange(this, + arg1->unk18.unk0[0], arg1->unk18.unk0[1], arg1->unk18.unk0[2], + arg1->unk18.unkC[0], arg1->unk18.unkC[1], arg1->unk18.unkC[2] + ); +} + +void particleEmitter_setPositionAndVelocityRanges(ParticleEmitter *this, struct42s *arg1){ + particleEmitter_setParticleVelocityRange(this, + arg1->unk0.unk0[0], arg1->unk0.unk0[1], arg1->unk0.unk0[2], + arg1->unk0.unkC[0], arg1->unk0.unkC[1], arg1->unk0.unkC[2] + ); + + particleEmitter_setParticleSpawnPositionRange( this, + arg1->unk18.unk0[0], arg1->unk18.unk0[1], arg1->unk18.unk0[2], + arg1->unk18.unkC[0], arg1->unk18.unkC[1], arg1->unk18.unkC[2] + ); +} + +void particleEmitter_setPositionVelocityAndAccelerationRanges(ParticleEmitter *this, struct43s* arg1){ + particleEmitter_setParticleVelocityRange(this, + arg1->unk0.unk0[0], arg1->unk0.unk0[1], arg1->unk0.unk0[2], + arg1->unk0.unkC[0], arg1->unk0.unkC[1], arg1->unk0.unkC[2] + ); + particleEmitter_setParticleAccelerationRange(this, + arg1->unk18.unk0[0], arg1->unk18.unk0[1], arg1->unk18.unk0[2], + arg1->unk18.unkC[0], arg1->unk18.unkC[1], arg1->unk18.unkC[2] + ); + particleEmitter_setParticleSpawnPositionRange( this, + arg1->unk30.unk0[0], arg1->unk30.unk0[1], arg1->unk30.unk0[2], + arg1->unk30.unkC[0], arg1->unk30.unkC[1], arg1->unk30.unkC[2] + ); +} + +void func_802EFE24(ParticleEmitter *this, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6){ + this->unkBC[0] = arg1; + this->unkBC[1] = arg2; + this->unkBC[2] = arg3; + this->unkC8[0] = arg4; + this->unkC8[1] = arg5; + this->unkC8[2] = arg6; +} + +void particleEmitter_setSpawnIntervalRange(ParticleEmitter *this, f32 min, f32 max){ + this->spawnIntervalRange_D4_min = min; + this->spawnIntervalRange_D4_max = max; + if(0.0f == this->particleSpawnTimer_24 || max < this->particleSpawnTimer_24) + this->particleSpawnTimer_24 = randf2(this->spawnIntervalRange_D4_min, this->spawnIntervalRange_D4_max); +} + +void func_802EFEC0(ParticleEmitter *this, f32 arg1, f32 arg2){ + this->unkDC[0] = arg1; + this->unkDC[1] = arg2; +} + +void particleEmitter_setParticleVelocityRange(ParticleEmitter *this, f32 x_min, f32 x_max, f32 y_min, f32 y_max, f32 z_min, f32 z_max){ + this->sphericalParticleVelocity_48 = FALSE; + this->particleVelocityRange_E4.cartisian_min_x = x_min; + this->particleVelocityRange_E4.cartisian_min_y = x_max; + this->particleVelocityRange_E4.cartisian_min_z = y_min; + this->particleVelocityRange_E4.cartisian_max_x = y_max; + this->particleVelocityRange_E4.cartisian_max_y = z_min; + this->particleVelocityRange_E4.cartisian_max_z = z_max; +} + +void particleEmitter_setSphericalParticleVelocityRange(ParticleEmitter *this, f32 pitch_min, f32 yaw_min, f32 radial_min, f32 pitch_max, f32 yaw_max, f32 radial_max){ + this->sphericalParticleVelocity_48 = TRUE; + this->particleVelocityRange_E4.spherical.yaw_min = yaw_min; + this->particleVelocityRange_E4.spherical.yaw_max = yaw_max; + this->particleVelocityRange_E4.spherical.pitch_min = pitch_min; + this->particleVelocityRange_E4.spherical.pitch_max = pitch_max; + this->particleVelocityRange_E4.spherical.radius_min = radial_min; + this->particleVelocityRange_E4.spherical.radius_max = radial_max; +} + +void func_802EFF50(ParticleEmitter *this, f32 arg1){ + this->unkFC = arg1; +} + +void func_802EFF5C(ParticleEmitter *this, f32 arg1, f32 arg2, f32 arg3){ + this->unk118[0] = arg1; + this->unk118[1] = arg2; + this->unk118[2] = arg3; +} + +void func_802EFF7C(ParticleEmitter *this, f32 arg1, f32 arg2, f32 arg3){ + this->unk10C[0] = arg1; + this->unk10C[1] = arg2; + this->unk10C[2] = arg3; +} + +void func_802EFF9C(ParticleEmitter *this, f32 arg1){ + this->unk108 = arg1; +} + +void func_802EFFA8(ParticleEmitter *this, s32 arg1[3]){ + this->unk3C[0] = arg1[0]; + this->unk3C[1] = arg1[1]; + this->unk3C[2] = arg1[2]; +} + +void particleEmitter_setSpawnInterval(ParticleEmitter *this, f32 arg1){ + this->doneSpawning_0_23 = FALSE; + this->spawnIntervalTimer_38 = arg1; +} + +void func_802EFFDC(ParticleEmitter *this){ + return; +} + +void particleEmitter_update(ParticleEmitter *this){ + Particle *iPtr; + f32 tick = time_getDelta(); + f32 temp_f0; + f32 sp78[3]; + f32 sp6C[3]; + f32 sp68; + + if(D_80380924){ + for(iPtr = this->pList_start_124; iPtr < this->pList_end_128;){//L802F005C + iPtr->age_48 += tick; + if(iPtr->lifetime_4C <= iPtr->age_48){ + memcpy(iPtr, --this->pList_end_128, sizeof(Particle)); + }else{//L802F00A0 + temp_f0 = iPtr->age_48/iPtr->lifetime_4C; + if(temp_f0 < this->unk10) + iPtr->unkC = temp_f0/this->unk10; + else if(temp_f0 <= this->unk14) + iPtr->unkC = 1.0f; + else{ + iPtr->unkC = 1.0f - ((temp_f0 - this->unk14)/(1.0f - this->unk14)); + }//L802F00F0 + iPtr->size_30 = iPtr->initialSize_34 + temp_f0*iPtr->finalSizeDiff; + + if(this->sprite_1C){ + iPtr->frame_10 += iPtr->framerate_14*tick; + if(!((s32)iPtr->frame_10 < spriteGetFrameCount(this->sprite_1C))){ + if(this->unk18 & 8){ + iPtr->frame_10 = spriteGetFrameCount(this->sprite_1C) - 1; + }else{ + iPtr->frame_10 = 0.0f; + } + } + }//L802F0180 + + iPtr->position_18[0] += iPtr->velocity_50[0]*tick; + iPtr->position_18[1] += iPtr->velocity_50[1]*tick; + iPtr->position_18[2] += iPtr->velocity_50[2]*tick; + + iPtr->unk24[0] += iPtr->unk3C[0]*tick; + iPtr->unk24[1] += iPtr->unk3C[1]*tick; + iPtr->unk24[2] += iPtr->unk3C[2]*tick; + + iPtr->velocity_50[0] = iPtr->velocity_50[0] + iPtr->unk0[0]*tick; + iPtr->velocity_50[1] = iPtr->velocity_50[1] + iPtr->unk0[1]*tick; + iPtr->velocity_50[2] = iPtr->velocity_50[2] + iPtr->unk0[2]*tick; + + if(this->unk100){ + iPtr->position_18[1] = func_8034E698(this->unk100) + this->unk104; + }//L802F0254 + + if( 0.0f != this->unkFC + && !func_8024DB50(&iPtr->position_18, this->unkFC) + ){ + memcpy(iPtr, --this->pList_end_128, sizeof(Particle)); + } + else{//L802F029C + if(iPtr->unk5C > 0){ + sp6C[0] = iPtr->position_18[0]; + sp6C[1] = iPtr->position_18[1] + 50.0f; + sp6C[2] = iPtr->position_18[2]; + if(func_802EE974(this, &sp6C, &iPtr->position_18, &sp78, 0)){ + if(this->unk66){ + sp68 = mlAbsF(iPtr->velocity_50[1])/10.0; + if(1.0f < sp68){ + sp68 = 1.0f; + }//L802F0324 + if(D_80380920 == 0.0f){ + func_8030E6A4(this->unk66, randf2(this->unk6C, this->unk70), (s32)((f32)this->unk7C*sp68)); + D_80380920 = 0.25f; + } + }//L802F0384 + iPtr->position_18[1] += 2.0f; + iPtr->velocity_50[1] = mlAbsF(iPtr->velocity_50[1]) * this->unk68; + if((this->unk18 & 0x2) == 0){ + iPtr->initialSize_34 *= this->unk68; + iPtr->finalSizeDiff *= this->unk68; + }//L802F03DC + + iPtr->unk3C[0] *= this->unk68; + iPtr->unk3C[1] *= this->unk68; + iPtr->unk3C[2] *= this->unk68; + if(--iPtr->unk5C == 0){ + if(this->particleCallback_80) + this->particleCallback_80(this, iPtr->position_18); + memcpy(iPtr, --this->pList_end_128, sizeof(Particle)); + continue; + } + } + } + iPtr++; + } + }//L802F045C + }//L802F0468 + if(0.0f < this->spawnIntervalTimer_38){ //if exactly 0.0f (no update) + this->spawnIntervalTimer_38 -= tick; + if(this->spawnIntervalTimer_38 <= 0.0f) //only can stop spawning + this->doneSpawning_0_23 = TRUE; + } + + if(this->doneSpawning_0_23 != TRUE){ + this->particleSpawnTimer_24 -= tick; + if(this->particleSpawnTimer_24 <= 0.0f){ + this->particleSpawnTimer_24 = randf2(this->spawnIntervalRange_D4_min, this->spawnIntervalRange_D4_max); + if(this->pList_end_128 < this->pList_capacity_12C) + __particleEmitter_initParticle(this, this->pList_end_128++); + } + } + }//L802F0514 +} + +void func_802F053C(ParticleEmitter *this, f32 arg1[3]){ + particleEmitter_setSprite(this, ASSET_70E_SPRITE_SMOKE_2); + func_802EFFA8(this, D_803689B8); + func_802EFA5C(this, 0.0f, 0.1f); + particleEmitter_setStartingFrameRange(this, 0, 7); + particleEmitter_setParticleSpawnPositionRange(this, -80.0f, 0.0f, -80.0f, 80.0f, 60.0f, 80.0f); + particleEmitter_setPosition(this, arg1); + func_802EFB70(this, 1.0f, 1.0f); + func_802EFB84(this, 2.0f, 3.0f); + particleEmitter_setSpawnIntervalRange(this, 0.0f, 0.01f); + func_802EFEC0(this, 3.0f, 4.0f); + particleEmitter_setParticleVelocityRange(this, -200.0f, 0.0f, -200.0f, 200.0f, 100.0f, 200.0f); +} + +void func_802F066C(ParticleEmitter *this, f32 arg1[3]){ + particleEmitter_setParticleAccelerationRange(this, 0.0f, -800.0f, 0.0f, 0.0f, -800.0f, 0.0f); + func_802EF9F8(this, 0.6f); + func_802EFA18(this, 3); + particleEmitter_setModel(this, ASSET_896_MODEL_GOLD_ROCK); + particleEmitter_setParticleSpawnPositionRange(this, + -120.0f, -60.0f, -120.0f, + 120.0f, 60.0f, 120.0f + ); + particleEmitter_setPosition(this, arg1); + func_802EFB70(this, 0.2f, 0.3f); + func_802EFE24(this, + -300.0f, -300.0f, -300.0f, + 300.0f, 300.0f, 300.0f + ); + particleEmitter_setSpawnIntervalRange(this, 0.0f, 0.01f); + func_802EFEC0(this, 10.0f, 10.0f); + particleEmitter_setParticleVelocityRange(this, + -500.0f, 150.0f, + -500.0f, 500.0f, + 400.0f, 500.0f + ); +} + +void func_802F07D8(void){ + D_803689B0 = (ParticleEmitter **) malloc(0); + D_803689B4 = 0; +} + +void func_802F0804(void){ + int i; + for(i = 0; i < D_803689B4; i++){ + func_802EF684(D_803689B0[i]); + } + free(D_803689B0); + D_803689B0 = NULL; + D_803689B4 = 0; +} + +void func_802F0898(void){ + return; +} + +void func_802F08A0(void){ + int i; + ParticleEmitter *iPtr; + + D_80380920 = MAX(0.0, D_80380920 - time_getDelta()); + if(D_803689B0){ + for(i = 0; i < D_803689B4; i++){ + iPtr = D_803689B0[i]; + particleEmitter_update(iPtr); + if( iPtr->unk0_0 + && iPtr->doneSpawning_0_23 == TRUE + && iPtr->pList_end_128 == iPtr->pList_start_124 + ){ + iPtr->unk0_1 = TRUE; + } + else{ + iPtr->unk0_1 = FALSE; + } + }//L802F09C0 + for(i = 0; i < D_803689B4;){ + if(D_803689B0[i]->unk0_1){ + func_802F0C78(D_803689B0[i]); + } + else{ + i++; + } + } + }//L802F0A14 +} + +void func_802F0A34(Gfx **gdl, Mtx **mptr, Vtx **vptr){ + int i; + for(i = 0; i < D_803689B4; i++){ + func_802EEE3C(D_803689B0[i], gdl, mptr, vptr, 4); + } +} + +void func_802F0AE8(Gfx **gdl, Mtx **mptr, Vtx **vptr){ + int i; + for(i = 0; i < D_803689B4; i++){ + func_802EEE3C(D_803689B0[i], gdl, mptr, vptr, 0); + } +} + +void func_802F0B98(Gfx **gdl, Mtx **mptr, Vtx **vptr){ + func_802F0A34(gdl, mptr, vptr); + func_802F0AE8(gdl, mptr, vptr); +} + +ParticleEmitter *partEmitList_pushNew(u32 cnt){ + D_803689B0 = realloc(D_803689B0, (++D_803689B4)*4); + D_803689B0[D_803689B4 - 1] = particleEmitter_new(cnt); + D_803689B0[D_803689B4 - 1]->unk0_0 = TRUE; + return D_803689B0[D_803689B4 - 1]; +} + + +void func_802F0C78(ParticleEmitter *this){ + int i = 0; + while(this != D_803689B0[i] && i < D_803689B4){i++;} + if(i == D_803689B4) + return; + + func_802EF684(this); + D_803689B0[i] = D_803689B0[D_803689B4 - 1]; + D_803689B4--; + D_803689B0 = realloc(D_803689B0, D_803689B4*sizeof(ParticleEmitter *)); +} + +void func_802F0D54(ParticleEmitter *this){ + this->unk0_0 = FALSE; +} + +void func_802F0D64(ParticleEmitter *this){ + this->unk0_0 = TRUE; +} + +ParticleEmitter * func_802F0D74(ParticleEmitter *this){ + int i; + s32 a3; + + if(this){ + a3 = (s32)this; + i = 0; + while(D_803689B0[i] != this && i < D_803689B4){ + i++; + } + this = (ParticleEmitter *)defrag(this); + this->pList_start_124 = (Particle *)((s32)this + (u32)((s32)this->pList_start_124 - a3)); + this->pList_end_128 = (Particle *)((s32)this + (u32)((s32)this->pList_end_128 - a3)); + this->pList_capacity_12C = (Particle *)((s32)this + (u32)((s32)this->pList_capacity_12C - a3)); + if(i < D_803689B4){ + D_803689B0[i] = this; + } + + }//L802F0E44 + return this; +} + +void func_802F0E58(void){ + D_803689B0 = (ParticleEmitter **)defrag(D_803689B0); +} + +void func_802F0E80(void* arg0, s32 arg1){ + D_80380924 = (arg1 == 2) ? 1 : 0; +} + +void func_802F0EAC(ParticleEmitter *this, f32 arg1){ + Particle *iPtr; + this->postion_28[1] = arg1; + for(iPtr = this->pList_start_124; iPtr < this->pList_end_128; iPtr++) + iPtr->position_18[1] = arg1; + +} diff --git a/src/core2/code_69F60.c b/src/core2/code_69F60.c new file mode 100644 index 00000000..f5c91bbf --- /dev/null +++ b/src/core2/code_69F60.c @@ -0,0 +1,127 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + f32 unk0; + ParticleEmitter *p_emitter; + u32 unk8_31:1; + u32 capacity:10; + u32 pad8_20:21; +} Struct_Core2_69F60_0; + +void func_802F1190(u8 arg0); + +/* .bss*/ +extern u8 D_80380930; +extern Struct_Core2_69F60_0 D_80380938[]; + +/* .code */ +ParticleEmitter *func_802F0EF0(u8 arg0){ + if(D_80380938[arg0].p_emitter == NULL){ + D_80380930 = arg0; + D_80380938[arg0].p_emitter = partEmitList_pushNew(D_80380938[arg0].capacity); + func_802F0D54(D_80380938[arg0].p_emitter); + D_80380930 = 0; + } + D_80380938[arg0].unk0 = 1.0f; + return D_80380938[arg0].p_emitter; +} + +u8 func_802F0F78(s32 cnt){ + int i; + for(i = 1; i < 16; i++){ + if(D_80380938[i].unk8_31 == 0){ + D_80380938[i].unk8_31++; + D_80380938[i].p_emitter = NULL; + D_80380938[i].capacity = cnt; + return i; + } + } + return 0; +} + +void func_802F10A4(void){ + int i; + for(i = 1; i < 16; i++){ + if(D_80380938[i].unk8_31 != 0){ + func_802F1190(i); + } + } +} + +void func_802F1104(void){ + int i; + for(i = 1; i < 16; i++){ + D_80380938[i].unk8_31 = 0; + } +} + +void func_802F1190(u8 arg0){ + if(D_80380938[arg0].p_emitter){ + func_802F0C78(D_80380938[arg0].p_emitter); + } + D_80380938[arg0].unk8_31 = 0; +} + +void func_802F11E8(void){ + int i; + for(i = 1; i < 16; i++){ + if( D_80380938[i].unk8_31 != 0 + && D_80380938[i].p_emitter != NULL + && func_802EF648(D_80380938[i].p_emitter) + ){ + D_80380938[i].unk0 -= time_getDelta(); + if(D_80380938[i].unk0 <= 0.0f){ + func_802F0C78(D_80380938[i].p_emitter); + D_80380938[i].p_emitter = NULL; + } + } + } +} + +void func_802F1294(void){ + int i; + for(i = 1; i < 16; i++){ + if( D_80380938[i].unk8_31 != 0 + && D_80380938[i].p_emitter != NULL + && i != D_80380930 + ){ + func_802F0C78(D_80380938[i].p_emitter); + D_80380938[i].p_emitter = NULL; + } + } +} + +void func_802F1320(void){ + int i; + for(i = 1; i < 16; i++){ + if( D_80380938[i].unk8_31 != 0 + && D_80380938[i].p_emitter != NULL + ){ + D_80380938[i].p_emitter = func_802F0D74(D_80380938[i].p_emitter); + } + } +} + +void func_802F1388(void){ + func_802EDD20(); + func_802F35B4(); + func_802F1E80(); + func_802F3C64(); + func_802F404C(); + func_802F422C(); + func_802EE684(); + func_802F3CB0(); +} + +void func_802F13E0(void){ + func_802EDD44(); + func_802F35D8(); + func_802F1EA4(); + func_802F3C84(); + func_802F4070(); + func_802F4250(); + func_802EE63C(); + func_802F3CD4(); +} diff --git a/src/core2/code_6A4B0.c b/src/core2/code_6A4B0.c new file mode 100644 index 00000000..c4ec9f52 --- /dev/null +++ b/src/core2/code_6A4B0.c @@ -0,0 +1,24 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6A4B0/func_802F1440.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6A4B0/func_802F1804.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6A4B0/func_802F1858.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6A4B0/func_802F1884.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6A4B0/func_802F18B8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6A4B0/func_802F18F0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6A4B0/func_802F1934.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6A4B0/func_802F1A08.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6A4B0/func_802F1A10.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6A4B0/func_802F1CAC.s") diff --git a/src/core2/code_6AEF0.c b/src/core2/code_6AEF0.c new file mode 100644 index 00000000..34ab1d38 --- /dev/null +++ b/src/core2/code_6AEF0.c @@ -0,0 +1,35 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern s32 D_80368AA0[3]; + + +/* .bss */ +extern u8 D_80380A00; + + +/* .code */ +void func_802F1E80(void){ + func_802F1190(D_80380A00); +} + +void func_802F1EA4(void){ + D_80380A00 = func_802F0F78(0x10); +} + +ParticleEmitter *func_802F1EC8(f32 *position) { + ParticleEmitter *p_emitter; + + p_emitter = func_802F0EF0(D_80380A00); + particleEmitter_setPosition(p_emitter, position); + particleEmitter_setSprite(p_emitter, ASSET_700_SPRITE_DUST); + particleEmitter_setParticleVelocityRange(p_emitter, -10.0f, 10.0f, -10.0f, 10.0f, 240.0f, 10.0f); + func_802EFFA8(p_emitter, D_80368AA0); + func_802EFA5C(p_emitter, 0.2f, 0.3f); + func_802EFB70(p_emitter, 0.2f, 0.4f); + func_802EFB84(p_emitter, 0.85f, 0.9f); + func_802EFEC0(p_emitter, 0.3f, 0.35f); + return p_emitter; +} diff --git a/src/core2/code_6B030.c b/src/core2/code_6B030.c new file mode 100644 index 00000000..41f225b0 --- /dev/null +++ b/src/core2/code_6B030.c @@ -0,0 +1,386 @@ +#include +#include "functions.h" +#include "variables.h" + +extern s16 D_803A5D00[2][0xF660]; + + +extern f32 func_80257680(f32, f32, f32); +extern void func_80252330(f32, f32, f32); + +typedef struct { + s16 unk0; + s16 unk2; +}Struct_core2_6B030_1; + +typedef struct { + void *unk0; + void *unk4; +}Struct_core2_6B030_0; + +/* .data */ +extern Gfx D_80368AC0[]; +extern Struct_core2_6B030_0 *D_80368AB0; +extern s16 D_80368AB4; +extern s16 D_80368AB8; +extern Gfx D_80368B08[]; +extern Struct_core2_6B030_1 D_80368B28[]; + +/* .rodata */ +extern f32 D_803771E0; +extern f32 D_803771E4; + +/* .bss */ +extern f32 *D_80380A10; +extern Mtx D_80380A18; +extern s32 D_80380A58; + +/* .code */ +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6B030/func_802F1FC0.s") +#else +void func_802F1FC0(Struct65s *self, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + f32 temp_f2; + s16 *temp_addr; + f32 spDC[3]; + f32 spD0[3]; + s32 temp_t1_2; + s32 temp_s3; + s32 spC4; + s32 spC0; + s32 spBC; + s32 temp_s5; + s32 spB4; + s32 spB0; + + func_8024C5CC(spDC); + spD0[0] = self->unk0[0] - spDC[0]; + spD0[1] = self->unk0[1] - spDC[1]; + spD0[2] = self->unk0[2] - spDC[2]; + func_80251BCC(func_8024DD90()); + func_80252330(spD0[0], spD0[1], spD0[2]); + mlMtxApply(*mtx); + gSPMatrix((*gfx)++, OS_K0_TO_PHYSICAL((*mtx)++), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + + temp_f2 = D_80380A10[self->unk26] * (self->unk25 / 255.0f); + spBC = (s32) ((f32)self->unk20 * (1.0f + temp_f2)); + temp_s5 = (s32) ((f32)self->unk20 * ((1.0f - (self->unk25 / 255.0f)) + ((self->unk25 / 255.0f) - temp_f2))); + func_80251BCC(&D_80380A18); + func_8025235C(&spD0, &spD0); + spD0[0] = (D_803771E0 * spD0[0]) / spD0[2]; + spD0[1] = (D_803771E4 * spD0[1]) / spD0[2]; + spC4 = (s32) (spD0[0] + (f32) (D_80276588 / 2)); + spC0 = (s32) (spD0[1] + (f32) (D_8027658C / 2)); + if (spC4 < 0) { + spC4 = 0; + } else if (D_80276588 - 0x20 < spC4) { + spC4 = D_80276588 - 0x20; + } + if (spC0 < 0) { + spC0 = 0; + } else if (D_8027658C - 0x20 < spC0) { + spC0 = D_8027658C - 0x20; + } + + gSPDisplayList((*gfx)++, D_80368AC0); + func_80347FC0(gfx, D_80368AB0[1].unk0, 0, 0, 0, 0, 0, NULL, NULL, &spB4, &spB0); + temp_addr = &D_803A5D00[func_8024BD80()][spC0*D_80276588 + (spC4 & 0xFFFC)]; + gDPSetTextureImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_80276588, temp_addr); + gDPSetTile((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 9, 0x0080, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD); + gDPLoadSync((*gfx)++); + gDPLoadTile((*gfx)++, G_TX_LOADTILE, 0, 0, 0x008C, 0x007C); + gDPPipeSync((*gfx)++); + gDPSetTile((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 9, 0x0080, 1, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTileSize((*gfx)++, 1, ((3 - (spC4 % 4)) + 1 - 1)<< 2, 0, (((3 - (spC4 % 4)) + 0x20) - 1)<<2, 0x007C); + gSPVertex((*gfx)++, *vtx, 8, 0); + gSP1Quadrangle((*gfx)++, 0, 1, 3, 2, 0); + func_80349AD0(); + func_80347FC0(gfx, D_80368AB0[self->unk22].unk0, NULL, 0, 0, 0, 0, 2, 2, &spB4, &spB0); + if (D_80368AB0[self->unk22].unk4 != NULL) { + func_80347FC0(gfx, D_80368AB0[self->unk22].unk4, NULL, 0x100, 1, 0, 0, 2, 2, &spB4, &spB0); + } + gSPDisplayList((*gfx)++, D_80368B08); + gSP2Triangles((*gfx)++, 7, 4, 5, 0, 6, 4, 7, 0); + func_80349B1C(gfx); + gDPSetTextureLOD((*gfx)++, G_TL_LOD); + temp_t1_2 = -(spBC >> 1); + temp_s3 = temp_s5 >> 1; + gSPPopMatrix((*gfx)++, G_MTX_MODELVIEW); + for(spC0 = 0; spC0 < 2; spC0++){ + for( spC4 = 0; spC4 < 2; spC4++){ + (*vtx)->v.ob[0] = temp_t1_2 + spC4*spBC; + (*vtx)->v.ob[1] = temp_s3 - spC0*temp_s5; + (*vtx)->v.ob[2] = 0; + (*vtx)->v.tc[0] = (spC4*0x1F) << 6; + (*vtx)->v.tc[1] = (spC0*0x1F) << 6; + (*vtx)->n.n[0] = 0xB4; + (*vtx)->n.n[1] = 0xF0; + (*vtx)->n.n[2] = 0xFF; + (*vtx)->v.cn[3] = 0xA0; + (*vtx)++; + } + } + + for(spC0 = 0; spC0 < 2; spC0++){ + for(spC4 = 0; spC4 < 2; spC4++){ + (*vtx)->v.ob[0] = temp_t1_2 + spC4*spBC; + (*vtx)->v.ob[1] = temp_s3 - spC0*temp_s5; + (*vtx)->v.ob[2] = 0; + (*vtx)->v.tc[0] = ((spC4 ^ 1)*(spB4 - 1)) << 6; + (*vtx)->v.tc[1] = (spC0*(spB0 - 1)) << 6; + (*vtx)->n.n[0] = 0xFF; + (*vtx)->n.n[1] = 0xFF; + (*vtx)->n.n[2] = 0xFF; + (*vtx)->v.cn[3] = 0xFF; + (*vtx)++; + } + } +} +#endif + +void func_802F2740(Struct64s *arg0) { + s32 i; + Struct65s *i_ptr; + Struct65s *end_ptr; + + i = 0; + while (i < arg0->unk4 - 1) { + i_ptr = &arg0->unk0[i]; + if (!(i_ptr->unk23 & 1)) { + // if struct no longer active, + end_ptr = &arg0->unk0[arg0->unk4 - 1]; + if (i_ptr != end_ptr) { + //if current indx not last index + // copy end object to this position and reduce size (dropping this) + memcpy(i_ptr, end_ptr, sizeof(Struct65s)); + } else { + //else increment current index + i++; + } + arg0->unk4 = arg0->unk4 - 1; + + + if (arg0->unk4 != 0) { + //if not empty, shrink struct + arg0->unk0 = (Struct65s *)realloc(arg0->unk0, arg0->unk4 * sizeof(Struct65s)); + } else { + //else (if empty) free struct + free(arg0->unk0); + arg0->unk0 = NULL; + } + } else { + //else (index still active) + //move to next + i++; + } + } +} + +void func_802F283C(Struct65s *arg0) { + f32 sp1C; + s32 sp18; + + sp1C = time_getDelta(); + sp18 = (s32) (200.0f * sp1C + 1.0f); + arg0->unk0[0] += arg0->unk14[0] / 3.0f; + arg0->unk0[1] += arg0->unk14[1] / 3.0f; + arg0->unk0[2] += arg0->unk14[2] / 3.0f; + if (arg0->unk14[0] != arg0->unk1A[0]) { + arg0->unk14[0] += (arg0->unk14[0] < arg0->unk1A[0]) ? sp18 : -sp18; + } + if (arg0->unk14[1] != arg0->unk1A[1]) { + arg0->unk14[1] += (arg0->unk14[1] < arg0->unk1A[1]) ? sp18 : -sp18; + } + if (arg0->unk14[2] != arg0->unk1A[2]) { + arg0->unk14[2] += (arg0->unk14[2] < arg0->unk1A[2]) ? sp18 : -sp18; + } + + if (arg0->unk24 <= 0) { + arg0->unk24 = (s8) ((randf() * 5.0f) + 2.0f); + arg0->unk1A[0] = (s16) ((randf() * 10.0f) + -5.0f); + arg0->unk1A[2] = (s16) ((randf() * 10.0f) + -5.0f); + } else { + arg0->unk24 -= sp18; + } + + if (arg0->unk20 != arg0->unk21) { + arg0->unk20 += (arg0->unk20 < arg0->unk21) ? sp18 : -sp18; + } + arg0->unk26 += ((f32) (arg0->unk27 * 4) * sp1C); +} + +void *func_802F2AEC(void) { + u32 var_s1; + Struct64s *temp_v0; + + + if (D_80368AB4 == 0) { + D_80368AB0 = malloc(0x10); + if (D_80368AB0 == NULL) { + return NULL; + } + + for(var_s1 = 0; var_s1 < 2; var_s1++){ + if (D_80368B28[var_s1].unk0 >= 0) { + (D_80368AB0 + var_s1)->unk0 = assetcache_get(D_80368B28[var_s1].unk0); + } else { + (D_80368AB0 + var_s1)->unk0 = NULL; + } + + if (D_80368B28[var_s1].unk2 >= 0) { + (D_80368AB0 + var_s1)->unk4 = assetcache_get(D_80368B28[var_s1].unk2); + } else { + (D_80368AB0 + var_s1)->unk4 = 0; + } + } + + D_80380A10 = (f32 *)malloc(0x100*sizeof(f32)); + for(var_s1 = 0; var_s1 < 0x100; var_s1++){ + D_80380A10[var_s1] = 0.0f; + }; + } + D_80368AB4++; + temp_v0 = malloc(8); + if (temp_v0 == NULL) { + return NULL; + } + temp_v0->unk0 = 0; + temp_v0->unk4 = 0; + D_80380A58 = heap_get_size() - func_8025496C(); + return temp_v0; +} + +void func_802F2C78(Struct64s *arg0) { + s32 var_s1; + Struct_core2_6B030_0 *i_ptr; + + + if (arg0 != NULL) { + if (arg0->unk0 != NULL) { + free(arg0->unk0); + } + free(arg0); + D_80368AB4 -= 1; + } + if (D_80368AB4 == 0) { + if(D_80368AB0 != NULL){ + for(var_s1 = 0; var_s1 < 2; var_s1++){ + i_ptr = D_80368AB0 + var_s1; + if (i_ptr->unk0 != NULL) { + assetcache_release(i_ptr->unk0); + } + i_ptr = D_80368AB0 + var_s1; + if (i_ptr->unk4 != NULL) { + assetcache_release(i_ptr->unk4); + } + } + free(D_80368AB0); + D_80368AB0 = NULL; + D_80368AB8 = 0; + } + + if (D_80380A10 != NULL) { + free(D_80380A10); + D_80380A10 = NULL; + } + } +} + + +void func_802F2D8C(Struct64s *arg0) { + Struct65s *var_s0; + + if ((arg0 != NULL) && (arg0->unk4 != 0)) { + D_80380A58 = heap_get_size() - func_8025496C(); + for(var_s0 = arg0->unk0; var_s0 < arg0->unk0 + arg0->unk4; var_s0++){ + if (var_s0->unk23 & 1) { + if (var_s0->unk10(var_s0->unk0, (f32)var_s0->unk20, var_s0->unkC) == 0) { + func_802F283C(var_s0); + } else { + var_s0->unk23 &= ~1; + } + } + } + func_802F2740(arg0); + } +} + + +void func_802F2EC0(Struct65s *arg0){ + arg0->unk23 &= ~1; +} + +void func_802F2ED0(Struct64s *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Struct65s *phi_s0; + f32 sp38[3]; + + if (arg0 != NULL && arg0->unk4) { + func_8024C764(sp38); + mlMtxIdent(); + mlMtxRotPitch(-sp38[0]); + mlMtxRotYaw(-sp38[1]); + func_802513B0(&D_80380A18); + for(phi_s0 = arg0->unk0; phi_s0 < arg0->unk0 + arg0->unk4; phi_s0++){ + if (phi_s0->unk23 & 1) { + func_802F1FC0(phi_s0, gfx, mtx, vtx); + } + } + } +} + +void func_802F2FCC(Struct64s *arg0, f32 arg1[3], s16 arg2, f32 arg3, ActorMarker *arg4, s32(*arg5)(f32[3], f32, ActorMarker *)){ + Struct65s *var_v0; + + if (arg0 != NULL) { + if ((arg0->unk4 != 0x20) && (D_80380A58 >= 0x19000)) { + if ( arg0->unk0 != NULL) { + var_v0 = (Struct65s *)realloc(arg0->unk0, (arg0->unk4 + 1)*sizeof(Struct65s)); + } else { + var_v0 = malloc(sizeof(Struct65s)); + } + if (var_v0 != NULL) { + arg0->unk0 = var_v0; + var_v0 += arg0->unk4; + arg0->unk4++; + var_v0->unk0[0] = arg1[0]; + var_v0->unk0[1] = arg1[1]; + var_v0->unk0[2] = arg1[2]; + var_v0->unk14[0] = 0; + var_v0->unk14[1] = 0; + var_v0->unk14[2] = 0; + var_v0->unk1A[0] = 0; + var_v0->unk1A[1] = arg2; + var_v0->unk1A[2] = 0; + var_v0->unk20 = 1; + var_v0->unk21 = (u8) arg3; + var_v0->unk22 = 0; + var_v0->unk23 = 1; + var_v0->unk24 = 0; + var_v0->unk26 = (u8)(randf() * 255.0f); + var_v0->unk27 = 0x14; + var_v0->unk25 = (u8) (func_80257680(1.0f, 50.0f, arg3) * 64.0f); + var_v0->unkC = arg4; + var_v0->unk10 = arg5; + } + } + } +} + +void func_802F32C4(s32 arg0, f32 arg1[3], f32 arg2, ActorMarker *arg3, void(*arg4)(f32[3], f32, ActorMarker *)){ + func_802F2FCC(arg0, arg1, 8, arg2, arg3, arg4); +} + +void func_802F3300(void) { + if (!func_802559A0()) { + if (D_80380A10 != NULL) { + D_80380A10 = defrag(D_80380A10); + } + if (D_80368AB0 != NULL) { + D_80368AB0 = defrag(D_80368AB0); + } + } +} + +s32 func_802F3364(s32 arg0){ + return arg0; +} diff --git a/src/core2/code_6B30.c b/src/core2/code_6B30.c new file mode 100644 index 00000000..ddf85b36 --- /dev/null +++ b/src/core2/code_6B30.c @@ -0,0 +1,167 @@ +#include +#include "functions.h" +#include "variables.h" + +extern Actor *func_8032813C(enum actor_e, f32[3], s32); + +/* .bss */ +u8 D_8037BFA0; + +/* code */ +static s32 __maybe(int arg0, s32 arg1){ + if(arg0) + return arg1; + return 0; +} + +void func_8028DAD8(void){ + D_8037BFA0 = 0; +} + +void func_8028DAE4(void){ + if(D_8037BFA0 != 0) + D_8037BFA0--; +} + +void func_8028DB04(void){ + D_8037BFA0 = 2; +} + +enum hitbox_e func_8028DB14(ActorMarker *arg0){ + s32 retVal; + if(D_8037BFA0) + return HITBOX_3_BEAK_BOMB; + + switch(bs_getState()){ + + case BS_F_BBUSTER: //8028DBA4 + return __maybe(bsbbuster_hitboxActive(),HITBOX_1_BEAK_BUSTER); + break; + case BS_BBARGE://8028DBC0 + return __maybe(bsbbarge_hitboxActive(),HITBOX_2_BEAK_BARGE); + break; + case BS_BOMB://8028DBDC + return __maybe(bsbfly_bombHitboxActive(),HITBOX_3_BEAK_BOMB); + break; + case BS_CLAW://8028DBF8 + if(arg0 && !func_8028AED4(marker_getActor(arg0)->position, 90.0f)) + return HITBOX_0_NONE; + + retVal = __maybe(bsclaw_hitboxActive(),HITBOX_4_CLAW); + if(retVal != 0) + return retVal; + return HITBOX_8_CLAW_DOWN; + break; + case BS_11_BPECK://8028DC50 + if(arg0 && !func_8028AED4(marker_getActor(arg0)->position, 60.0f)) + return HITBOX_0_NONE; + return __maybe(func_802A6510(),HITBOX_5_PECK); + break; + case BS_1A_WONDERWING_ENTER: + case BS_1B_WONDERWING_IDLE: + case BS_1C_WONDERWING_WALK: + case BS_1D_WONDERWING_JUMP: + case BS_1E_WONDERWING_EXIT: + case BS_A4_WONDERWING_DRONE: + case BS_A5_WONDERWING_UNKA5://L8028DC98 + return HITBOX_6_WONDERWING; + break; + //8028DCA0 + case BS_ROLL: + return __maybe(bstwirl_hitboxActive(),HITBOX_7_ROLL); + break; + case BS_6E_CROC_BITE://L8028DCBC + return __maybe(bscroc_hitboxActive(),HITBOX_9_CROC_BITE); + break; + case BS_5_JUMP://8028DCD8 + case BS_3D_FALL_TUMBLING: + if(func_80297AAC() < 0.0f && !func_8028B2E8()) + return HITBOX_A_FAST_FALLING; + case BS_2F_FALL://8028DD10 + if(func_80297AAC() < -1400.0f && !func_8028B2E8()) + return HITBOX_A_FAST_FALLING; + default://8028DD4C + return HITBOX_0_NONE; + break; + } +} + +// break ?? // +bool func_8028DD60(enum actor_e actor_id, Actor **arg1){ + ActorMarker *m1; + ActorMarker *m2; + Actor *actor; + + m1 = (*arg1)->marker; + m2 = func_802948EC(); + if(m2){ + actor = marker_getActor(m2); + } + + if(m2 && actor->modelCacheIndex != actor_id) + return 0; + + carriedObject_setActorID(actor_id); + if(!item_empty(func_80346CF4(actor_id))){ + func_8028F66C(0x12); + } + *arg1 = marker_getActor(m1); + return 1; +} + +void func_8028DE0C(enum actor_e actor_id){ + Actor *actor; + f32 sp20[3]; + + banjo_getPosition(sp20); + actor = func_8032813C(actor_id, sp20, (s32) yaw_get()); + actor->unk138_22 = TRUE; + func_802948F8(actor->marker); + bs_setState(BS_3A_CARRY_IDLE); +} + +void func_8028DE6C(enum actor_e actor_id){ + ActorMarker *marker; + Actor *actor; + + marker = func_802948EC(); + if(marker){ + actor = marker_getActor(marker); + } + + if(marker && actor->modelCacheIndex == actor_id){ + func_802948F8(marker); + } + else{ + func_802C3C88(func_8028DE0C, carriedObject_getActorID()); + } +} + +void func_8028DEEC(enum actor_e actor_id, Actor *actor){ + f32 sp1C[3]; + + nodeprop_getPosition(func_80304C38(actor_id, actor), sp1C); + func_80294AC0(sp1C); +} + +void func_8028DF20(enum actor_e actor_id){ + item_inc(func_80346CF4(actor_id)); +} + +void func_8028DF48(enum actor_e actor_id){ + ActorMarker *marker; + Actor* actor; + + marker = func_802948EC(); + if(marker) + actor = marker_getActor(marker); + + if(marker && actor->modelCacheIndex == actor_id){ + func_802948E0(); + } + item_dec(func_80346CF4(actor_id)); +} + +void func_8028DFB8(enum actor_e actor_id){ + func_803463D4(func_80346CF4(actor_id), 0); +} diff --git a/src/core2/code_6C3E0.c b/src/core2/code_6C3E0.c new file mode 100644 index 00000000..9dc35ea5 --- /dev/null +++ b/src/core2/code_6C3E0.c @@ -0,0 +1,252 @@ +#include +#include "functions.h" +#include "variables.h" + +extern bool func_8024549C(f32[3], f32); +extern void func_802EFAB0(ParticleEmitter *, s32, f32); +extern ParticleEmitter *func_802F3670(s16[3], f32, enum asset_e); +extern void func_802F0EAC(ParticleEmitter *, f32); + +typedef struct { + f32 unk0[2]; + f32 unk8; + f32 unkC[2]; + f32 unk14[2]; + u8 unk1C[3]; + // u8 pad1F[1]; +}Struct_Core2_6C3E0; + +/* .data */ +extern Struct_Core2_6C3E0 D_80368B30[]; +extern struct42s D_80368BD0; +extern struct42s D_80368C00; +extern struct42s D_80368C30; +extern struct42s D_80368C60; +extern struct42s D_80368C90; +extern struct42s D_80368CC0; +extern struct42s D_80368CF0; +extern struct42s D_80368D20; +extern struct42s D_80368D50; + +/* .rodata */ +extern f32 D_803771F0; +extern f32 D_803771F4; +extern f32 D_803771F8; +extern f32 D_803771FC; +extern f32 D_80377200; +extern f32 D_80377204; + +/* .bss */ +extern u8 D_80380A60; + +/* .code */ +bool func_802F3370(f32 arg0[3], s32 *arg1, bool arg2){ + f32 sp1C; + + *arg1 = 0; + if(arg2){ + arg0[1] += 1.0f; + } else { + arg2 = func_8024549C(arg0, 20.0f); + if(!arg2){ + return FALSE; + } + } + + if(func_80245524(arg0, arg2, arg1, &sp1C)){ + arg0[1] = sp1C; + } + return TRUE; +} + +ParticleEmitter *func_802F3404(s32 arg0, f32 arg1[3], bool arg2){ + s32 sp44; + f32 sp38[3]; + ParticleEmitter *p_emitter; + s32 sp28[3]; + Struct_Core2_6C3E0 *var_s0; + + ml_vec3f_copy(sp38, arg1); + if(!func_802F3370(sp38, &sp44, arg2)){ + return NULL; + } + sp38[1] += 3.0f; + p_emitter = func_802F0EF0(D_80380A60); + particleEmitter_setSprite(p_emitter, ASSET_70C_SPRITE_RIPPLE); + func_802EFA70(p_emitter, 1); + if(sp44){ + func_802EFAB0(p_emitter, sp44, sp38[1]); + } + else{ + func_802EFAB0(p_emitter, 0, 0.0f); + } + var_s0 = &D_80368B30[arg0]; + sp28[0] = (s32) var_s0->unk1C[0]; + sp28[1] = (s32) var_s0->unk1C[1]; + sp28[2] = (s32) var_s0->unk1C[2]; + func_802EFA5C(p_emitter, 0.0f, var_s0->unk8); + particleEmitter_setPosition(p_emitter, sp38); + func_802EFFA8(p_emitter, sp28); + func_802EFB70(p_emitter, var_s0->unkC[0], var_s0->unkC[1]); + func_802EFB84(p_emitter, var_s0->unk14[0], var_s0->unk14[1]); + func_802EFEC0(p_emitter, var_s0->unk0[0], var_s0->unk0[1]); + func_802EFF50(p_emitter, 100.0f); + return p_emitter; +} + +void func_802F3554(s32 arg0, f32 arg1[3]){ + ParticleEmitter *p_emitter = func_802F3404(arg0, arg1, 0); + if(p_emitter != NULL){ + particleEmitter_emitN(p_emitter, 1); + } +} + +void func_802F3584(s32 arg0, f32 arg1[3], s32 arg2){ + ParticleEmitter *p_emitter = func_802F3404(arg0, arg1, arg2); + if(p_emitter != NULL){ + particleEmitter_emitN(p_emitter, 1); + } +} + +void func_802F35B4(void){ + func_802F1190(D_80380A60); +} + +void func_802F35D8(void){ + D_80380A60 = func_802F0F78(0x19); +} + +ParticleEmitter *func_802F35FC(s32 arg0, f32 arg1[3]){ + return func_802F3404(arg0, arg1, 0); +} + +ParticleEmitter *func_802F361C(s32 arg0, f32 arg1[3], s32 arg2){ + return func_802F3404(arg0, arg1, arg2); +} + +void func_802F363C(f32 arg0){ + func_802F0EAC(func_802F0EF0(D_80380A60), arg0); +} + +ParticleEmitter *func_802F3670(s16 arg0[3], f32 arg1, enum asset_e sprite_id){ + f32 sp1C[3]; + + sp1C[0] = (f32)arg0[0]; + sp1C[1] = (f32)arg0[1]; + sp1C[2] = (f32)arg0[2]; + sp1C[1] += arg1; + + return func_802F3E98(sp1C, sprite_id); +} + +void func_802F36DC(s16 arg0[3]){ + ParticleEmitter *p_emitter = func_802F3670(arg0, 10.0f, ASSET_713_SPRITE_SPARKLE_YELLOW); + particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368BD0); + func_802EFB70(p_emitter, D_803771F0, D_803771F0); + particleEmitter_emitN(p_emitter, 10); +} + +void func_802F373C(s16 arg0[3]){ + ParticleEmitter *p_emitter = func_802F3670(arg0, 10.0f, ASSET_713_SPRITE_SPARKLE_YELLOW); + particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368C00); + func_802EFB70(p_emitter, D_803771F4, D_803771F4); + particleEmitter_emitN(p_emitter, 7); +} + +void func_802F379C(s16 arg0[3]){ + ParticleEmitter *p_emitter = func_802F3670(arg0, 7.0f, ASSET_713_SPRITE_SPARKLE_YELLOW); + particleEmitter_setParticleVelocityRange(p_emitter, + -70.0f, 100.0f, -70.0f, + 70.0f, 250.0f, 70.0f + ); + particleEmitter_emitN(p_emitter, 5); +} + +void func_802F3808(s16 arg0[3]){ + ParticleEmitter *p_emitter = func_802F3670(arg0, 7.0f, ASSET_716_SPRITE_SPARKLE_WHITE); + particleEmitter_setParticleVelocityRange(p_emitter, + -70.0f, 100.0f, -70.0f, + 70.0f, 250.0f, 70.0f + ); + particleEmitter_emitN(p_emitter, 5); +} + +void func_802F3874(s16 arg0[3]){ + ParticleEmitter *p_emitter = func_802F3670(arg0, 25.0f, ASSET_716_SPRITE_SPARKLE_WHITE); + particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368C30); + func_802EFB70(p_emitter, 0.5f, 0.5f); + particleEmitter_emitN(p_emitter, 12); + func_802EFEC0(p_emitter, 1.5f, 1.5f); +} + +void func_802F38F0(s16 arg0[3]){ + ParticleEmitter *p_emitter = func_802F3670(arg0, 12.0f, ASSET_715_SPRITE_SPARKLE_RED); + particleEmitter_setParticleVelocityRange(p_emitter, + -75.0f, 100.0f, -75.0f, + 75.0f, 250.0f, 75.0f + ); + func_802EFB70(p_emitter, D_803771F8, D_803771F8); + particleEmitter_emitN(p_emitter, 5); +} + +void func_802F3978(s16 arg0[3]){ + ParticleEmitter *p_emitter = func_802F3670(arg0, 40.0f, ASSET_715_SPRITE_SPARKLE_RED); + particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368C60); + func_802EFB70(p_emitter, 0.5f, 0.5f); + particleEmitter_emitN(p_emitter, 10); +} + +void func_802F39D8(s16 arg0[3]){ + ParticleEmitter *p_emitter = func_802F3670(arg0, 7.0f, ASSET_713_SPRITE_SPARKLE_YELLOW); + particleEmitter_setParticleVelocityRange(p_emitter, + -75.0f, 100.0f, -75.0f, + 75.0f, 250.0f, 75.0f + ); + func_802EFB70(p_emitter, D_803771FC, D_803771FC); + particleEmitter_emitN(p_emitter, 5); +} + +void func_802F3A60(s16 arg0[3]){ + ParticleEmitter *p_emitter = func_802F3670(arg0, 40.0f, ASSET_713_SPRITE_SPARKLE_YELLOW); + particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368C90); + func_802EFB70(p_emitter, 0.5f, 0.5f); + particleEmitter_emitN(p_emitter, 10); +} + +void func_802F3AC0(s16 arg0[3]){ + ParticleEmitter *p_emitter = func_802F3670(arg0, 10.0f, ASSET_718_SPRITE_SPARKLE_WHITE_2); + particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368CC0); + func_802EFB70(p_emitter, D_80377200, D_80377200); + particleEmitter_emitN(p_emitter, 7); + func_802EFEC0(p_emitter, 1.5f, 1.5f); +} + +void func_802F3B3C(s16 arg0[3]){ + ParticleEmitter *p_emitter = func_802F3670(arg0, 10.0f, ASSET_713_SPRITE_SPARKLE_YELLOW); + particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368CF0); + func_802EFB70(p_emitter, D_80377204, D_80377204); + particleEmitter_emitN(p_emitter, 5); +} + +void func_802F3B9C(s16 arg0[3]){ + ParticleEmitter *p_emitter = func_802F3670(arg0, 10.0f, ASSET_713_SPRITE_SPARKLE_YELLOW); + particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368D20); + func_802EFB70(p_emitter, 0.25f, 0.3f); + particleEmitter_emitN(p_emitter, 1); +} + +void func_802F3BF4(s16 arg0[3]){ + ParticleEmitter *p_emitter = func_802F3670(arg0, 10.0f, ASSET_713_SPRITE_SPARKLE_YELLOW); + particleEmitter_setPositionAndVelocityRanges(p_emitter, &D_80368D50); + func_802EFB70(p_emitter, 0.45f, 0.6f); + func_802EFEC0(p_emitter, 0.5f, 0.8f); + particleEmitter_emitN(p_emitter, 3); +} + +void func_802F3C64(void){ + func_802F3E50(); +} + +void func_802F3C84(void){ + func_802F3E74(); +} diff --git a/src/core2/code_6CD20.c b/src/core2/code_6CD20.c new file mode 100644 index 00000000..a7fcabfd --- /dev/null +++ b/src/core2/code_6CD20.c @@ -0,0 +1,52 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .data */ +s16 D_80368D80[] = { + ASSET_715_SPRITE_SPARKLE_RED, + ASSET_716_SPRITE_SPARKLE_WHITE, + ASSET_719_SPRITE_SPARKLE_GREEN_2, +}; + +struct43s D_80368D88 = { + {{-300.0f, -300.0f, -300.0f}, {300.0f, 300.0f, 300.0f}}, + {{0.0f, -100.0f, 0.0f}, {0.0f, -100.0f, 0.0f}}, + {{-25.0f, -25.0f, -25.0f}, {25.0f, 25.0f, 25.0f}} +}; + +/* .bss */ +extern u8 D_80380A70; + +/* .code */ +void func_802F3CB0(void){ + func_802F1190(D_80380A70); +} + +void func_802F3CD4(void){ + D_80380A70 = func_802F0F78(0xC); +} + +void func_802F3CF8(f32 arg0[3], s32 arg1, s32 arg2){ + ParticleEmitter *pCtrl; + if(arg2 < 3){ + pCtrl = func_802F0EF0(D_80380A70); + particleEmitter_setSprite(pCtrl, D_80368D80[arg2]); + func_802EFA5C(pCtrl, 0.4f, 0.8f); + particleEmitter_setPosition(pCtrl, arg0); + func_802EFE24(pCtrl, + 0.0f, 0.0f, 200.0f, + 0.0f, 0.0f, 240.0f + ); + func_802EFF50(pCtrl, 1.0f); + func_802EFA5C(pCtrl, 0.1f, 0.5f); + func_802EFB70(pCtrl, 0.1f, 0.2f); + func_802EFB84(pCtrl, 0.4f, 0.5f); + func_802EFEC0(pCtrl, 0.75f, 0.75f); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80368D88); + if(arg1 == 0){ + func_802EFA70(pCtrl, 16); + } + particleEmitter_emitN(pCtrl, 12); + } +} diff --git a/src/core2/code_6CEC0.c b/src/core2/code_6CEC0.c new file mode 100644 index 00000000..ab3fd9c9 --- /dev/null +++ b/src/core2/code_6CEC0.c @@ -0,0 +1,37 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +extern u8 D_80380A80; + +/* .code */ +void func_802F3E50(void){ + func_802F1190(D_80380A80); +} + +void func_802F3E74(void){ + D_80380A80 = func_802F0F78(0xF); +} + +ParticleEmitter *func_802F3E98(f32 pos[3], enum asset_e sprite_id){ + ParticleEmitter *this; + this = func_802F0EF0(D_80380A80); + + particleEmitter_setSprite(this, sprite_id); + particleEmitter_setParticleAccelerationRange(this, + 0.0f, -250.0f, 0.0f, + 0.0f, -250.0f, 0.0f + ); + func_802EFA5C(this, 0.4f, 0.8f); + particleEmitter_setPosition(this, pos); + func_802EFB70(this, 0.22f, 0.22f); + func_802EFB84(this, 0.03f, 0.03f); + func_802EFE24(this, + 0.0f, 0.0f, 200.0f, + 0.0f, 0.0f, 240.0f + ); + func_802EFEC0(this, 0.7f, 0.7f); + func_802EFF50(this, 1.0f); + return this; +} diff --git a/src/core2/code_6D030.c b/src/core2/code_6D030.c new file mode 100644 index 00000000..db338f1f --- /dev/null +++ b/src/core2/code_6D030.c @@ -0,0 +1,63 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802EFA04(ParticleEmitter *, f32); + +ParticleEmitter *func_802F4094(f32 pos[3], f32 arg1); + +/* .data */ +s32 D_80368DD0[3] = {0xff, 0xff, 0xfe}; + +/* .bss */ +u8 D_80380A90; + +/* .code */ +void func_802F3FC0(ParticleEmitter *this, f32 pos[3]){ + func_802F3554(0, pos); +} + +void func_802F3FE4(f32 pos[3]){ + ParticleEmitter *pCtrl; + pCtrl = func_802F4094(pos, 20.0f); + particleEmitter_setParticleVelocityRange(pCtrl, + -180.0f, 400.0f, -180.0f, + 180.0f, 700.0f, 180.0f + ); + particleEmitter_emitN(pCtrl, 20); +} + +void func_802F404C(void){ + func_802F1190(D_80380A90); +} + +void func_802F4070(void){ + D_80380A90 = func_802F0F78(0x1e); +} + +ParticleEmitter *func_802F4094(f32 pos[3], f32 arg1){ + ParticleEmitter *pCtrl; + + pCtrl = func_802F0EF0(D_80380A90); + particleEmitter_setSprite(pCtrl, ASSET_70B_SPRITE_BUBBLE_2); + func_802EF9E4(pCtrl, 180); + particleEmitter_setParticleAccelerationRange(pCtrl, + 0.0f, -1300.0f, 0.0f, + 0.0f, -1300.0f, 0.0f + ); + func_802EFA18(pCtrl, 1); + func_802EFA04(pCtrl, pos[1]); + particleEmitter_setParticleCallback(pCtrl, func_802F3FC0); + func_802EFA5C(pCtrl, 0.0f, 0.8f); + particleEmitter_setParticleSpawnPositionRange(pCtrl, + -arg1, 0.0f, -arg1, + arg1, 0.0f, arg1 + ); + particleEmitter_setPosition(pCtrl, pos); + func_802EFFA8(pCtrl, D_80368DD0); + func_802EFB70(pCtrl, 0.02f, 0.04f); + func_802EFB84(pCtrl, 0.01f, 0.01f); + func_802EFEC0(pCtrl, 2.0f, 2.0f); + func_802EFF50(pCtrl, 10.0f); + return pCtrl; +} diff --git a/src/core2/code_6D270.c b/src/core2/code_6D270.c new file mode 100644 index 00000000..258e4faa --- /dev/null +++ b/src/core2/code_6D270.c @@ -0,0 +1,63 @@ +#include +#include "functions.h" +#include "variables.h" + +extern func_802EFAB0(ParticleEmitter *, s32, f32); + +ParticleEmitter *func_802F4274(f32 arg0[3]); + +/* .data */ +extern s32 D_80368DE0[3]; + +/* .bss */ +extern u8 D_80380AA0; + +/* .code */ +void func_802F4200(f32 arg0[3]){ + particleEmitter_emitN(func_802F4274(arg0), 1); +} + +void func_802F422C(void){ + func_802F1190(D_80380AA0); +} + +void func_802F4250(void){ + D_80380AA0 = func_802F0F78(3); +} + +ParticleEmitter *func_802F4274(f32 arg0[3]) { + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + f32 sp28; + ParticleEmitter *temp_v0; + s32 sp20; + + ml_vec3f_copy(sp2C, arg0); + func_8024559C(sp2C, &sp20, &sp28); + sp2C[1] = sp28 + 14.0f; + func_8024C5CC(sp38); + sp44[0] = sp38[0] - sp2C[0]; + sp44[2] = sp38[2] - sp2C[2]; + sp44[1] = 0.0f; + ml_vec3f_set_length_copy(sp44, sp44, 20.0f); + sp2C[0] += sp44[0]; + sp2C[1] += sp44[1]; + sp2C[2] += sp44[2]; + temp_v0 = func_802F0EF0(D_80380AA0); + if (sp20 != 0) { + func_802EFAB0(temp_v0, sp20, sp2C[1]); + } + particleEmitter_setSprite(temp_v0, 0x42A); + func_802EF9E4(temp_v0, 0xFF); + func_802EFA5C(temp_v0, 0, 0.78f); + particleEmitter_setStartingFrameRange(temp_v0, 0, 0); + particleEmitter_setParticleFramerateRange(temp_v0, 25.7142868f, 25.7142868f); + func_802EFEC0(temp_v0, 0.7f, 0.7f); + particleEmitter_setPosition(temp_v0, sp2C); + func_802EFFA8(temp_v0, D_80368DE0); + func_802EFB70(temp_v0, 0.8, 0.8); + func_802EFB84(temp_v0, 0.8, 0.8); + return temp_v0; +} + diff --git a/src/core2/code_6D490.c b/src/core2/code_6D490.c new file mode 100644 index 00000000..f76f4ece --- /dev/null +++ b/src/core2/code_6D490.c @@ -0,0 +1,233 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void sfxsource_setSampleRate(u8, s32); + +typedef struct { + s16 unk0; + s16 unk2; //sfx_id + f32 unk4; + f32 unk8; + s16 unkC; + //u8 padE[2]; +}LocalStruct_0; + +typedef struct { + s16 unk0; + s16 unk2; //sfx_id + f32 unk4; + f32 unk8; + f32 unkC; + s16 unk10; + //u8 pad12[2]; +}LocalStruct_1; + +void func_802F487C(Struct5Ds *this, void (*arg1)(Struct5Ds *, s32)); +void func_802F4884(Struct5Ds *this, s32 arg1, f32 arg2); +void func_802F48B4(Struct5Ds *this, void (*arg1)(Struct5Ds *, s32)); + +/* .data */ +LocalStruct_1 D_80368DF0[] = { + {0x1, SFX_8_BANJO_LANDING_04, 1.0f, 1.2f, 0.05f, 9000}, + {0x2, SFX_7_BANJO_LANDING_03, 1.0f, 1.2f, 0.05f, 3000}, + {0x3, SFX_B_BANJO_LANDING_06, 1.0f, 1.2f, 0.05f, 11000}, + {0x4, SFX_10_BANJO_LANDING_07, 1.0f, 1.2f, 0.05f, 13000}, + {0x5, SFX_26_BANJO_LANDING_09, 1.0f, 1.2f, 0.05f, 9000}, + {0x6, SFX_6_BANJO_LANDING_02, 1.0f, 1.2f, 0.05f, 7000}, + {0x7, SFX_28_RUSTLING_NOISE, 1.0f, 1.0f, 0.05f, 10000}, + {0x8, SFX_5_BANJO_LANDING_01, 0.7f, 0.8f, 0.05f, 17000}, + {0xB, SFX_10_BANJO_LANDING_07, 0.5f, 0.55f, 0.01f, 16000}, + {0x9, SFX_98_DEAF_THUD, 1.0f, 1.1f, 0.05f, 21000}, + {0xA, SFX_99_METALLIC_THUD, 1.0f, 1.1f, 0.05f, 21000}, + {0xC, SFX_123_BANJO_LANDING_10, 0.85f, 0.89f, 0.05f, 21000}, + {0xD, SFX_3F2_UNKNOWN, 0.96f, 1.04f, 0.02f, 10000}, + {0xE, SFX_10_BANJO_LANDING_07, 1.2f, 1.35f, 0.05f, 13000}, + {0xF, SFX_DC_IDLE_PADDLING, 0.95f, 1.1f, 0.05f, 16000}, + {0} +}; + +LocalStruct_0 D_80368F30[] = { + {0x01, SFX_70_WALKING_NOISE_1, 1.0f, 0.05f, 12000}, + {0x02, SFX_74_WALKING_NOISE_5, 1.0f, 0.05f, 3000}, + {0x03, SFX_B_BANJO_LANDING_06, 1.0f, 0.05f, 14000}, + {0x04, SFX_10_BANJO_LANDING_07, 1.0f, 0.05f, 13000}, + {0x05, SFX_76_WALKING_NOISE_7, 1.0f, 0.05f, 11000}, + {0x06, SFX_72_WALKING_NOISE_3, 1.0f, 0.05f, 10000}, + {0x07, SFX_28_RUSTLING_NOISE, 1.0f, 0.05f, 17000}, + {0x08, SFX_5_BANJO_LANDING_01, 0.7f, 0.05f, 17000}, + {0x0B, SFX_10_BANJO_LANDING_07, 0.5f, 0.03f, 17000}, + {0x09, SFX_98_DEAF_THUD, 1.0f, 0.05f, 22000}, + {0x0A, SFX_99_METALLIC_THUD, 1.0f, 0.05f, 22000}, + {0x0C, SFX_123_BANJO_LANDING_10,0.9f, 0.05f, 22000}, + {0} +}; + +/* .code */ +s32 func_802F4420(Struct5Ds *this){ + f32 f0; + if(this->unk0 == 0) + return 0; + + f0 = this->unk10 - this->unk4[1]; + if(0.0f < f0 && f0 < 60.0f){ + return 4; + } + + return func_803246B4(map_get(), this->unk0); +} + +void func_802F44AC(Struct5Ds *this, enum sfx_e sfx_id, f32 arg2, f32 arg3, s32 arg4){ + u8 s0; + f32 f0; + + s0 = (this->unk1E) ? this->unk1C : this->unk1D; + + sfxsource_setSfxId(s0, sfx_id); + f0 = arg3*0.5; + func_8030DBB4(s0, randf2(arg2 - f0, arg2 + f0)); + sfxsource_setSampleRate(s0, arg4); + func_8030E2C4(s0); + this->unk1E ^= 1; +} + +void func_802F4554(Struct5Ds *this, enum sfx_e sfx_id, f32 arg2, f32 arg3, f32 arg4, s32 arg5){ + f32 sp24; + u8 sp20; + f32 range; + + if(this->unk1E){ + sp20 = this->unk1C; + sp24 = arg2; + } + else{ + sp20 = this->unk1D; + sp24 = arg3; + } + + sfxsource_setSfxId(sp20, sfx_id); + range = arg4*0.5; + func_8030DBB4(sp20, randf2(sp24 - range, sp24 + range)); + sfxsource_setSampleRate(sp20, arg5); + func_8030E2C4(sp20); + this->unk1E ^= 1; + +} + +bool func_802F4604(Struct5Ds *this, f32 arg1, s32 arg2){ + int i; + + for(i = 0; D_80368DF0[i].unk0 != 0; i++ ){ + if(arg2 == D_80368DF0[i].unk0){ + func_802F4554(this, D_80368DF0[i].unk2, D_80368DF0[i].unk4 + arg1, D_80368DF0[i].unk8 + arg1, D_80368DF0[i].unkC, D_80368DF0[i].unk10); + return TRUE; + } + } + return FALSE; +} + +void func_802F4690(Struct5Ds *this, f32 arg1){ + s32 a2 = func_802F4420(this); + if(this->unk1F){ + func_802F4604(this, arg1, a2); + } + if(this->unk14){ + this->unk14(this, a2); + } +} + +void func_802F46F4(Struct5Ds *this){ + int i; + s32 a1; + + a1 = func_802F4420(this); + for(i = 0; D_80368F30[i].unk0 != 0; i++ ){ + if(D_80368F30[i].unk0 == a1){ + if(this->unk18){ + this->unk18(this, a1); + } + if(this->unk1F){ + func_802F44AC(this, D_80368F30[i].unk2, D_80368F30[i].unk4, D_80368F30[i].unk8, D_80368F30[i].unkC); + } + break; + } + } +} + +void func_802F4798(Struct5Ds *this){ + func_8030DA44(this->unk1C); + func_8030DA44(this->unk1D); + free(this); +} + +Struct5Ds *func_802F47D0(void){ + Struct5Ds *this = (Struct5Ds *)malloc(sizeof(Struct5Ds)); + this->unk1E = 0; + this->unk1F = 1; + + this->unk1C = func_8030D90C(); + func_8030DD14(this->unk1C, 3); + func_8030DD90(this->unk1C, 0); + + this->unk1D = func_8030D90C(); + func_8030DD14(this->unk1D, 3); + func_8030DD90(this->unk1D, 0); + + ml_vec3f_clear(this->unk4); + func_802F487C(this, NULL); + func_802F4884(this, 0, 0.0f); + func_802F48B4(this, NULL); + + return this; + +} + +void func_802F487C(Struct5Ds *this, void (*arg1)(Struct5Ds *, s32)){ + this->unk18 = arg1; +} + +void func_802F4884(Struct5Ds *this, s32 arg1, f32 arg2){ + this->unk0 = arg1; + this->unk10 = arg2; +} + +void func_802F4894(Struct5Ds *this, f32 arg1[3]){ + ml_vec3f_copy(this->unk4, arg1); +} + +void func_802F48B4(Struct5Ds *this, void (*arg1)(Struct5Ds *, s32)){ + this->unk14 = arg1; +} + +void func_802F48BC(Struct5Ds *this){ + this->unk1F = 1; + func_802F46F4(this); +} + +void func_802F48E0(Struct5Ds *this){ + this->unk1F = 0; + func_802F46F4(this); +} + +void func_802F4900(Struct5Ds *this, s32 arg1){ + func_802F4604(this, 0.0f, arg1); +} + +void func_802F4924(Struct5Ds *this){ + this->unk1F = 1; + func_802F4690(this, 0.0f); +} + +void func_802F494C(Struct5Ds *this, f32 arg1){ + this->unk1F = 1; + func_802F4690(this, arg1); +} + +void func_802F4978(Struct5Ds *this){ + this->unk1F = 0; + func_802F4690(this, 0.0f); +} + +Struct5Ds *func_802F499C(Struct5Ds *this){ + return (Struct5Ds *)defrag(this); +} \ No newline at end of file diff --git a/src/core2/code_6DA30.c b/src/core2/code_6DA30.c new file mode 100644 index 00000000..5cd3c92d --- /dev/null +++ b/src/core2/code_6DA30.c @@ -0,0 +1,807 @@ +#include +#include "functions.h" +#include "variables.h" + + + +typedef struct{ + s8 pad0[0x20]; +} struct23s; + +typedef struct{ + s16 x; + s16 y; + s16 unk4; + s16 unk6; + u8 fmtString[8]; + f32 unk10; + u8 *string; + u8 rgba[4]; +} PrintBuffer; + +typedef struct font_letter{ + BKSpriteTextureBlock *unk0;//chunkPtr + void *unk4;//palPtr +} FontLetter; + +typedef struct map_font_texture_map{ + s16 mapID; + s16 assetId; +} MapFontTextureMap; + +extern struct { + u8 unk0; + u8 unk1; + u8 unk2; + u8 unk3; +} D_80369078; + +extern s32 D_80369068[]; +extern MapFontTextureMap D_8036907C[]; + +extern u8 D_80369200[]; + +extern Gfx D_80369238[];/* = { + gsDPPipeSync(), + gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH), + gsSPSetGeometryMode(G_SHADE | G_TEXTURE_GEN_LINEAR | G_SHADING_SMOOTH), + gsSPTexture(qu016(0.5), qu016(0.5), 0, G_TX_RENDERTILE, G_ON), + gsDPSetCycleType(G_CYC_1CYCLE), + gsDPSetRenderMode(G_RM_XLU_SURF, G_RM_XLU_SURF2), + gsDPSetTexturePersp(G_TP_NONE), + gsDPSetTextureFilter(G_TF_BILERP), + gsSPEndDisplayList(), +};*/ + +extern u8 D_80377240[4]; +extern u8 D_80377244[4]; +extern u8 D_80377248[4]; +extern u8 D_8037724C[4]; +extern u8 D_80377250[4]; +extern u8 D_80377254[4]; + +extern s8 D_80380AB0; +extern BKSprite *D_80380AB8[0x5]; + +extern FontLetter *print_sFonts[4]; +extern PrintBuffer *print_sPrintBuffer; +extern PrintBuffer *print_sCurrentPtr; +extern struct { + s32 unk0; +}D_80380AE8; + +extern s32 D_80380AEC; +extern s32 D_80380AF0; +extern s32 D_80380AF4; +extern s32 D_80380AF8; +extern s32 D_80380AFC; +extern s32 D_80380B00; +extern s32 D_80380B04; +extern bool print_sInFontFormatMode; +extern s32 D_80380B0C; +extern s32 D_80380B10; +extern s32 D_80380B14; + +extern s32 D_80380B18; +extern s32 D_80380B1C; +extern s8 D_80380B20[0x400]; +extern s8 D_80380F20[0x80]; +extern f32 D_80380FA8[]; + +//returns map texture assetID for current map; +enum asset_e func_802F49C0(void){ + s32 i; + for(i = 0; D_8036907C[i].mapID != 0 ; i++){ + if(map_get() == D_8036907C[i].mapID){ + return D_8036907C[i].assetId; + } + } + return 0x708; +} + +// this function reassigns the referenced font mask pixel +// using the texture @ pixel (x,y) +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6DA30/func_802F4A24.s") +/*void func_802F4A24(BKSpriteTextureBlock *arg0, u32 *arg1, s32 arg2, s32 arg3) { + s32 temp_lo; + s32 temp_t0; + u32 red; + u32 blue; + u32 green; + u32 alpha; + s32 _x = MIN(MAX(0, arg2), arg0->w - 1); + s32 _y = MIN(MAX(0, arg3), arg0->h - 1); + + temp_t0 = ((u16 *) (arg0 + 1))[_x + _y * arg0->w]; + + if(temp_t0); + blue = ((temp_t0 >> 1) & ((1<< 5) - 1)); + green = ((temp_t0 >> 6) & ((1<< 5) - 1)); + red = ((temp_t0 >> 11) & ((1<< 5) - 1)); + temp_lo = (s32) ((*arg1 >> 11) & 0xFF) / 0x1F; + + + *arg1 = (( ((red * temp_lo) << 0x18) | ((green * temp_lo) << 0x10)) | ((blue * temp_lo) << 8)) | (*arg1 & 0xff); +}//*/ + +//this function applies the texture to the font alpha mask. +void func_802F4B58(BKSpriteTextureBlock *alphaMask, BKSpriteTextureBlock *texture){ + s32 y_min; + s32 x_min; + u32 *pxl; + s32 x; + s32 y; + + pxl = (u32*)(alphaMask + 1); + x_min = (texture->w - alphaMask->w) >> 1; + y_min = (texture->h - alphaMask->h) >> 1; + + for(y = y_min; y < alphaMask->h + y_min; y++){ + for(x = x_min; x < alphaMask->w + x_min; x++){ + func_802F4A24(texture, pxl, x, y); + pxl++; + } + } +} + +//This functions seperates the fonts into letters +FontLetter *func_802F4C3C(BKSprite *alphaMask, BKSprite *textureSprite){ + BKSpriteFrame * font = spriteGetFramePtr(alphaMask, 0); + BKSpriteTextureBlock *chunkPtr; + FontLetter * sp2C = malloc((font->chunkCnt + 1)*sizeof(FontLetter)); + u8* palDataPtr; + u8* chunkDataPtr; + s32 chunkSize; + s32 i; + + + switch(alphaMask->type){ + case SPRITE_TYPE_CI8: + {//L802F4CA8 + chunkPtr = (BKSpriteTextureBlock *) (font + 1); + chunkDataPtr = (u8 *)chunkPtr; + while((s32)chunkDataPtr % 8) + chunkDataPtr++; + + palDataPtr = chunkDataPtr; + chunkPtr = (BKSpriteTextureBlock *) (palDataPtr + 2*0x100); + + for(i= 0; i < font->chunkCnt; i++){ + + chunkDataPtr = (u8*)(chunkPtr + 1); + while((s32)chunkDataPtr % 8) + chunkDataPtr++; + + sp2C[i].unk0 = chunkPtr; + sp2C[i].unk4 = palDataPtr; + chunkSize = chunkPtr->w*chunkPtr->h; + chunkPtr = (BKSpriteTextureBlock *)(chunkDataPtr + chunkSize); + } + } + break; + case SPRITE_TYPE_RGBA32://L802F4D80 + { + chunkPtr = (BKSpriteTextureBlock *)(font + 1); + for( i = 0; i < font->chunkCnt; i++){ + func_802F4B58(chunkPtr, (BKSpriteTextureBlock *)(spriteGetFramePtr(textureSprite, 0) + 1)); + sp2C[i].unk0 = chunkPtr; + chunkSize = chunkPtr->w*chunkPtr->h; + chunkDataPtr = (u8*)(chunkPtr + 1); + while((s32)chunkDataPtr % 8) + chunkDataPtr++; + chunkPtr = (BKSpriteTextureBlock *) (chunkDataPtr + chunkSize*4); + } + } + break; + case SPRITE_TYPE_I4://L802F4E24 + { + chunkPtr = (BKSpriteTextureBlock *) (font + 1); + for( i = 0; i < font->chunkCnt; i++){ + sp2C[i].unk0 = chunkPtr; + chunkDataPtr = (u8*)(chunkPtr + 1); + chunkSize = chunkPtr->w*chunkPtr->h; + while((s32)chunkDataPtr % 8) + chunkDataPtr++; + chunkPtr = (BKSpriteTextureBlock *) (chunkDataPtr + chunkSize/2); + } + } + break; + default://L802F4EC0 + { + chunkPtr = (BKSpriteTextureBlock *)(font + 1); + for( i = 0; i < font->chunkCnt; i++){ + chunkDataPtr = (u8*)(chunkPtr + 1); + sp2C[i].unk0 = chunkPtr; + chunkSize = chunkPtr->w*chunkPtr->h; + while((s32)chunkDataPtr % 8) + chunkDataPtr++; + chunkPtr = (BKSpriteTextureBlock *)(chunkDataPtr + chunkSize); + } + } + break; + }; + return sp2C; +} + +void func_802F4F64(void){ + s32 i; + for(i = 0; i< 5; i++){ + assetcache_release(D_80380AB8[i]); + D_80380AB8[i] = NULL; + if(i < 4){ + free(print_sFonts[i]); + print_sFonts[i] = NULL; + } + } + free(print_sPrintBuffer); + print_sPrintBuffer = NULL; +} + +void func_802F5010(void){ + s32 i; + for(i = 0; i < 0x20; i++){ + print_sPrintBuffer[i].string = NULL; + } +} + +void func_802F5060(s32 textureId){ + s32 tmp_a2; + tmp_a2 = func_802546E4(D_80380AB8[1]); + if(tmp_a2 & 0xF) + tmp_a2 += 0x10 - (tmp_a2 & 0xF); + if(!func_8033BDAC(SPRITE_BOLD_FONT_NUMBERS_ALPHAMASK, D_80380AB8[1],tmp_a2)){ + assetcache_release(D_80380AB8[1]); + D_80380AB8[1] = assetcache_get(SPRITE_BOLD_FONT_NUMBERS_ALPHAMASK); + } + if(D_80380AB8[3]){ + tmp_a2 = func_802546E4(D_80380AB8[3]); + if(tmp_a2 & 0xF) + tmp_a2 += 0x10 - (tmp_a2 & 0xF); + if(!func_8033BDAC(SPRITE_BOLD_FONT_LETTERS_ALPHAMASK, D_80380AB8[3],tmp_a2)){ + assetcache_release(D_80380AB8[3]); + D_80380AB8[3] = assetcache_get(SPRITE_BOLD_FONT_LETTERS_ALPHAMASK); + } + }//L802F510C + D_80380AB8[4] = assetcache_get(textureId); + free(print_sFonts[1]); + print_sFonts[1] = func_802F4C3C(D_80380AB8[1], D_80380AB8[4]); + if(D_80380AB8[3]){ + free(print_sFonts[3]); + print_sFonts[3] = func_802F4C3C(D_80380AB8[3], D_80380AB8[4]); + } + assetcache_release(D_80380AB8[4]); + D_80380AB8[4] = NULL; + D_80380B1C = textureId; +} + +void func_802F5188(void){ + func_802F5060(func_802F49C0()); + func_802F5010(); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6DA30/func_802F51B8.s") +/*void func_802F51B8(void){ + s32 i, j; + s32 length; + int found; + + length = strlen(D_80369200); + D_80380AEC = 0; + D_80380AF0 = 0; + D_80380AF4 = 0; + D_80380AF8 = 0; + D_80380AFC = 0; + D_80380B00 = 0; + D_80380B04 = 0; + print_sInFontFormatMode = FALSE; + D_80380B0C = 0; + D_80380B10 = 0; + D_80380B14 = 0; + D_80380AE8.unk0 = 0; + D_80380AB0 = 0; + func_802F7A2C(3); + D_80380AB8[0] = assetcache_get(SPRITE_DIALOG_FONT_ALPHAMASK); + D_80380AB8[1] = assetcache_get(SPRITE_BOLD_FONT_NUMBERS_ALPHAMASK); + D_80380AB8[4] = assetcache_get(func_802F49C0()); + print_sFonts[0] = func_802F4C3C(D_80380AB8[0], D_80380AB8[4]); + print_sFonts[1] = func_802F4C3C(D_80380AB8[1], D_80380AB8[4]); + print_sPrintBuffer = malloc(0x20*sizeof(PrintBuffer)); + func_802F5010(); + + for(i = 0; i < 0x80; i++){//L802F52EC + found = 0; + for(j = 0; j < length && !found; j++){//L802F5304 + if(D_80369200[j] == i){ + D_80380F20[i] = j; + found = 1; + }//L802F531C + }//L802F5330 + if(!found) + D_80380F20[i] = -1; + //L802F533C + } + assetcache_release(D_80380AB8[4]); + D_80380AB8[4] = NULL; + D_80380B1C = func_802F49C0(); +}//*/ + +void func_802F5374(void){ + if(D_80380B18 > 0 && --D_80380B18 == 0){ + assetcache_release(D_80380AB8[3]); + D_80380AB8[3] = 0; + free(print_sFonts[3]); + print_sFonts[3] = NULL; + } +} + +void func_802F53D0(void){ + if(D_80380AB8[3]){ + assetcache_release(D_80380AB8[3]); + D_80380AB8[3] = NULL; + } + if(print_sFonts[3]){ + free(print_sFonts[3]); + print_sFonts[3] = NULL; + } + D_80380B18 = 0; +} + +void func_802F542C(void){ + print_sFonts[0] = (FontLetter *)defrag(print_sFonts[0]); + print_sFonts[1] = (FontLetter *)defrag(print_sFonts[1]); + if(print_sFonts[3]){ + print_sFonts[3] = (FontLetter *)defrag(print_sFonts[3]); + } + print_sPrintBuffer = (PrintBuffer *)defrag(print_sPrintBuffer); +} + +//returns the pixel data and type for a given letter +void *func_802F5494(s32 letterId, s32 *fontType){ + if(D_80380AE8.unk0 != 1 || (D_80380AE8.unk0 == 1 && letterId < 0xA)){ + *fontType = D_80380AB8[D_80380AE8.unk0]->type; + return print_sFonts[D_80380AE8.unk0][letterId].unk0; + } + else{//L802F5510 + if(!D_80380AB8[3]){ + D_80380AB8[3] = assetcache_get(SPRITE_BOLD_FONT_LETTERS_ALPHAMASK); + D_80380AB8[4] = assetcache_get(D_80380B1C); + print_sFonts[3] = func_802F4C3C(D_80380AB8[3], D_80380AB8[4]); + assetcache_release(D_80380AB8[4]); + D_80380AB8[4] = NULL; + }//L802F5568 + D_80380B18 = 5; + *fontType = D_80380AB8[3]->type; + return print_sFonts[3][letterId-10].unk0; + } +} + +//returns the letter's palette +void *func_802F55A8(u8 arg0){ + return print_sFonts[D_80380AE8.unk0][arg0].unk4; +} + +typedef struct{ + u8 unk0; + u8 unk1; + u8 pad2[1]; + s8 unk3; +}Struct_6DA30_0_s; + +extern f32 D_80380FA0; +extern Struct_6DA30_0_s D_80369000[]; + +#ifndef NONMATCHING +void _printbuffer_draw_letter(s32 letter, f32* xPtr, f32* yPtr, f32 arg3, Gfx **gtx, Mtx **mtx, Vtx **vtx); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6DA30/_printbuffer_draw_letter.s") +#else +void _printbuffer_draw_letter(s32 letter, f32* xPtr, f32* yPtr, f32 arg3, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + // u8 letter = arg0; + BKSpriteTextureBlock *sp214; + s32 sp20C; + f32 sp200; + f32 sp1F8; + s32 sp1F4; //font_type; + f32 f18; + f32 f28; + f32 f2; + + int i; + s32 t0; + s8 t1; + + t0 = 0; + f18 = *xPtr; + f28 = *yPtr; + t1 = 0; + + if(!D_80380B04 && !letter){ + D_80380FA0 = 0.0f; + }//L802F563C + + switch(D_80380AE8.unk0){ + case 0: //L802F5678 + if(letter >= '\x21' && letter < '\x5f'){ + sp20C = letter - '\x21'; + t0 = 1; + } + break; + case 1: //L802F56A0 + if(letter < '\x80' && D_80380F20[letter] >= 0){ + for(i = 0; D_80369000[i].unk0 != 0; i++){ + if(letter == D_80369000[i].unk1 && D_80380AB0 == D_80369000[i].unk0){ + t1 = D_80369000[i].unk3; + break; + } + }//L802F5710 + sp20C = D_80380F20[letter]; + t0 = 1; + D_80380AB0 = letter; + f28 += (f32)t1*arg3; + }//L802F5738 + break; + case 2: //L802F5740 + if(D_80380B04){ + t0 = 1; + sp20C = sp20C + (D_80380B04 << 8) - 0x100; + D_80380B04 = 0; + } + else{//L802F5764 + if(sp20C > 0 && sp20C < 0xfD) + t0 = 1; + } + break; + }//L802F5778 + + if(!t0 || print_sInFontFormatMode){ + print_sInFontFormatMode = FALSE; + switch(letter){ + case ' '://802F5818 + *xPtr += arg3*((D_80380AF0) ? D_80369068[D_80380AE8.unk0]: D_80369068[D_80380AE8.unk0]*0.8); + break; + + case 'b': //L802F5890 + //toggle background + D_80380B00 = D_80380B00 ^ 1; + break; + + case 'f': //L802F58A8 + D_80380AEC = D_80380AE8.unk0 = D_80380AE8.unk0 ^ 1; + break; + + case 'l': //L802F58BC + D_80380B10 = 0; + break; + + case 'h': //L802F58C8 + D_80380B10 = 1; + break; + + case 'j': //L802F58D4 + if(D_80380AFC == 0){ + D_80380AFC = 1; + D_80380AEC = D_80380AE8.unk0; + D_80380AE8.unk0 = 2; + // D_80380AE8 = 2; + } + break; + + case 'e': //L802F58FC + if(D_80380AFC){ + D_80380AFC = 0; + D_80380AE8.unk0 = D_80380AEC; + } + break; + + case 'p': //L802F5924 + D_80380AF0 = D_80380AF0 ^1; + break; + + case 'q': //L802F593C + D_80380B14 = D_80380B14^1; + if(D_80380B14){ + gDPSetTextureFilter((*gfx)++, G_TF_POINT); + } + else{//L802F5978 + gDPSetTextureFilter((*gfx)++, G_TF_BILERP); + } + break; + + case 'v': //L802F59A0 + //toggle letter gradient + D_80380AF4 ^= 1; + if(D_80380AF4){ + func_8024C7B8(gfx, mtx); + gDPPipeSync((*gfx)++); + gDPSetTexturePersp((*gfx)++, G_TP_PERSP); + gDPSetPrimColor((*gfx)++, 0, 0, 0x00, 0x00, 0x00, 0xFF); + gDPSetCombineLERP((*gfx)++, 0, 0, 0, TEXEL0, TEXEL0, 0, SHADE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, SHADE, 0); + } + else{//L802F5A44 + gDPSetCombineMode((*gfx)++, G_CC_DECALRGBA, G_CC_DECALRGBA); + gDPSetTexturePersp((*gfx)++, G_TP_NONE); + } + break; + + case 'd': //L802F5A8C + D_80380AF8 ^= 1; + if(D_80380AF8){ + gDPPipeSync((*gfx)++); + gDPSetCycleType((*gfx)++, G_CYC_2CYCLE); + gDPSetRenderMode((*gfx)++, G_RM_PASS, G_RM_XLU_SURF2); + gDPSetTextureLOD((*gfx)++, G_TL_TILE); + gDPSetCombineLERP((*gfx)++, 0, 0, 0, TEXEL0, TEXEL0, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED); + } + else{//L802F5B48 + gDPPipeSync((*gfx)++); + gDPSetCombineMode((*gfx)++, G_CC_DECALRGBA, G_CC_DECALRGBA); + gDPSetCycleType((*gfx)++, G_CYC_1CYCLE); + gDPSetTextureLOD((*gfx)++, G_TL_LOD); + gDPSetRenderMode((*gfx)++, G_RM_XLU_SURF, G_RM_XLU_SURF2); + } + break; + + case 0xfd: //L802F5BEC + print_sInFontFormatMode = TRUE; + break; + + case 0xfe://L802F5BF4 + D_80380B04 = 1; + break; + + case 0xff://L802F5BFC + D_80380B04 = 2; + break; + } + } + else{//L802F5C08 + BKSpriteTextureBlock *phi_t0_2; + u8 *sp210; + f32 phi_f0; + + sp200 = *xPtr; + sp214 = func_802F5494(sp20C, &sp1F4); + if (D_80380B10 != 0) { + sp200 += randf2(-2.0f, 2.0f); + f28 += randf2(-2.0f, 2.0f); + } + if (D_80380AF0 != 0) { + sp1F8 = (f32)D_80369068[D_80380AE8.unk0]; + } else { + sp1F8 = (f32)sp214->x; + } + // temp_f2 = D_80380FA0; + // phi_f2 = temp_f2; + if (D_80380FA0 == 0.0f) { + D_80380FA0 = -sp1F8 * 0.5; + } + sp210 = (u8*)(sp214 + 1); + sp200 += (D_80380FA0 + (sp1F8 - sp214->x) * 0.5); + f28 -= sp214->h*0.5; + while((s32)sp210 % 8){ + sp210++; + } + if (sp1F4 == SPRITE_TYPE_RGBA32) { + gDPLoadTextureTile((*gfx)++, sp210, G_IM_FMT_RGBA, G_IM_SIZ_32b, sp214->w, sp214->h, 0, 0, sp214->x-1, sp214->y - 1, NULL, G_TX_CLAMP, G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + } else if (sp1F4 == SPRITE_TYPE_RGBA16) { + gDPLoadTextureTile((*gfx)++, sp210, G_IM_FMT_RGBA, G_IM_SIZ_16b, sp214->w, sp214->h, 0, 0, sp214->x-1, sp214->y - 1, NULL, G_TX_CLAMP, G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + } else if (sp1F4 == SPRITE_TYPE_CI8) { + gDPLoadTextureTile((*gfx)++, sp210, G_IM_FMT_I, G_IM_SIZ_8b, sp214->w, sp214->h, 0, 0, sp214->x-1, sp214->y - 1, NULL, G_TX_CLAMP, G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + } else if (sp1F4 == SPRITE_TYPE_I4) { + gDPLoadTextureTile_4b((*gfx)++, sp210, G_IM_FMT_I, sp214->w, sp214->h, 0, 0, sp214->x-1, sp214->y-1, NULL, G_TX_CLAMP, G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + } else if (sp1F4 == SPRITE_TYPE_CI8) { + gDPLoadTLUT_pal256((*gfx)++, func_802F55A8(sp20C)); + gDPLoadTextureTile((*gfx)++, sp210, G_IM_FMT_CI, G_IM_SIZ_8b, sp214->w, sp214->h, 0, 0, sp214->x-1, sp214->y-1, NULL, G_TX_CLAMP, G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gDPSetTextureLUT((*gfx)++, G_TT_NONE | 0x80000000); + }//L802F6570 + if (D_80380AF8 != 0) { + + s32 temp_t1 = ((print_sCurrentPtr->unk4 - print_sCurrentPtr->y) - D_80380B0C) + 1; + s32 phi_a0 = MAX(MAX(temp_t1, 0), 1 - D_80380B0C); + gDPSetTextureImage((*gfx)++, G_IM_FMT_I, G_IM_SIZ_8b, 32, &D_80380B20); + gDPSetTile((*gfx)++, G_IM_FMT_I, G_IM_SIZ_8b, (sp214->x + 8) >> 3, 0x0100, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD); + gDPLoadSync((*gfx)++); + gDPLoadTile((*gfx)++, G_TX_LOADTILE, 0, (0-phi_a0) << 2, (sp214->x) << 2, (D_80380B0C - 1) << 2); + gDPPipeSync((*gfx)++); + gDPSetTile((*gfx)++, G_IM_FMT_I, G_IM_SIZ_8b, (sp214->x + 8) >> 3, 0x0100, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTileSize((*gfx)++, 1, 0, 0, ((sp214->x - 1) + 1) << 2, (MIN(temp_t1, 0) -phi_a0)<<2); + + // gDPLoadMultiTile((*gfx)++, &D_80380B20,) + }//L802F677C + if (D_80380AF4 != 0) { + f32 spD0; + f32 spC0; + f32 temp_f24; + f32 temp_f0_3; + + spC0 = f28 - (D_8027658C - 1)*0.5; + temp_f24 = sp214->x - 1.0; + spD0 = sp214->y - 1.0; + gSPVertex((*gfx)++, *vtx, 4, 0); + for(f28 = 0.0f; f28 < 2.0f; f28+= 1.0f){ + for(temp_f0_3 = 0.0f; temp_f0_3 < 2.0f; temp_f0_3 += 1.0f){ + (*vtx)->v.ob[0] = (s16)(((f64)sp214->x*arg3*temp_f0_3 + ((f64)sp200 - D_80276588 * 0.5)) * 4.0); + (*vtx)->v.ob[1] = (s16)(((f64)spD0*arg3*f28 + ((f64)sp200 - D_80276588 * 0.5)) * 4.0); + (*vtx)->v.ob[2] = -0x14; + (*vtx)->v.tc[0] = (s16)(temp_f0_3*temp_f24*64.0f); + (*vtx)->v.tc[1] = (s16)(f28*spD0*64.0f); + if(f28 != 0.0f){ + (*vtx)->v.cn[3] = print_sCurrentPtr->unk6; + } + else{ + (*vtx)->v.cn[3] = print_sCurrentPtr->unk4; + } + (*vtx)++; + } + } + gSP1Quadrangle((*gfx)++, 0, 1, 3, 2, 0); + } else { + gSPScisTextureRectangle((*gfx)++, sp200*4.0f, f28*4.0f, (sp214->x*arg3 + sp200)*4.0f, (sp214->x*arg3 + f28)*4.0f, 0, 0, 0, 1024.0f / arg3, 1024.0f / arg3); + } + *xPtr += sp1F8 * arg3; + } +} +#endif + +f32 func_802F6C90(u8 letter, f32* xPtr, f32 *yPtr, f32 arg3); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_6DA30/func_802F6C90.s") + +void printbuffer_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx) { + s32 j; + f32 _x; + f32 _y; + f32 width; + + gSPDisplayList((*gfx)++, D_80369238); + for(print_sCurrentPtr = print_sPrintBuffer; print_sCurrentPtr < print_sPrintBuffer + 0x20; print_sCurrentPtr++){ + if (print_sCurrentPtr->string != 0) { + _x = (f32) print_sCurrentPtr->x; + _y = (f32) print_sCurrentPtr->y; + //toggle on string format modifiers + for(j = 0; print_sCurrentPtr->fmtString[j] != 0; j++) { + _printbuffer_draw_letter(0xFD, &_x, &_y, 1.0f, gfx, mtx, vtx); + _printbuffer_draw_letter(print_sCurrentPtr->fmtString[j], &_x, &_y, 1.0f, gfx, mtx, vtx); + } + if (D_80380B00 != 0) { + width = (strlen(print_sCurrentPtr->string) -1)*D_80369068[D_80380AE8.unk0]; + gDPPipeSync((*gfx)++); + gDPSetPrimColor((*gfx)++, 0, 0, 0x00, 0x00, 0x00, 0x64); + gDPSetCombineMode((*gfx)++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); + gDPScisFillRectangle((*gfx)++, _x - D_80369068[D_80380AE8.unk0]/2 - 1.0f, _y - D_80369068[D_80380AE8.unk0]/2 - 1.0f, _x + width + D_80369068[D_80380AE8.unk0]/2, _y + D_80369068[D_80380AE8.unk0]/2 + 1.0f); + gDPPipeSync((*gfx)++); + + }//L802F73E8 + if ((D_80380AF8 == 0) && (D_80380AF4 == 0)) { + if (D_80380AE8.unk0 != 0) { + gDPSetCombineMode((*gfx)++, G_CC_DECALRGBA, G_CC_DECALRGBA); + gDPSetPrimColor((*gfx)++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF); + } else { + gDPSetCombineMode((*gfx)++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); + gDPSetPrimColor((*gfx)++, 0, 0, print_sCurrentPtr->rgba[0], print_sCurrentPtr->rgba[1], print_sCurrentPtr->rgba[2], print_sCurrentPtr->rgba[3]); + } + } + if ((D_80380AE8.unk0 == 1) && ((f64) print_sCurrentPtr->unk10 < 0.0)) { + for(j = 0; print_sCurrentPtr->string[j]; j++){ + D_80380FA8[j] = func_802F6C90(print_sCurrentPtr->string[j], &_x, &_y, -print_sCurrentPtr->unk10); + } + while(j >= 0){ + _x = D_80380FA8[j]; + _printbuffer_draw_letter(print_sCurrentPtr->string[j], &_x, &_y, -print_sCurrentPtr->unk10, gfx, mtx, vtx); + j--; + } + } else { + for(j = 0; (print_sCurrentPtr->string[j] != 0) || (D_80380B04 != 0); j++){ + _printbuffer_draw_letter(print_sCurrentPtr->string[j], &_x, &_y, print_sCurrentPtr->unk10, gfx, mtx, vtx); + } + } + //toggle off string format modifiers + for(j = 0; print_sCurrentPtr->fmtString[j] != 0; j++) { + _printbuffer_draw_letter(0xFD, &_x, &_y, 1.0f, gfx, mtx, vtx); + _printbuffer_draw_letter(print_sCurrentPtr->fmtString[j], &_x, &_y, 1.0f, gfx, mtx, vtx); + } + _printbuffer_draw_letter(0, &_x, &_y, 1.0f, gfx, mtx, vtx); + print_sCurrentPtr->string = NULL; + } + } + gDPPipeSync((*gfx)++); + gDPSetTexturePersp((*gfx)++, G_TP_PERSP); + gDPSetTextureFilter((*gfx)++, G_TF_BILERP); + func_8024C904(gfx, mtx); +}//*/ + +//adds a new string to the print buffer and updates string buffer end ptr +void _printbuffer_push_new(s32 x, s32 y, u8 * string) { + for(print_sCurrentPtr = print_sPrintBuffer; print_sCurrentPtr < print_sPrintBuffer + 0x20 && print_sCurrentPtr->string; print_sCurrentPtr++) { + } + if (print_sCurrentPtr == print_sPrintBuffer + 0x20) { + print_sCurrentPtr = NULL; + return; + } + print_sCurrentPtr->x = x; + print_sCurrentPtr->y = y; + print_sCurrentPtr->fmtString[0] = (u8)0; + print_sCurrentPtr->string = string; + print_sCurrentPtr->unk10 = 1.0f; + print_sCurrentPtr->rgba[0] = (u8) D_80369078.unk0; + print_sCurrentPtr->rgba[1] = (u8) D_80369078.unk1; + print_sCurrentPtr->rgba[2] = (u8) D_80369078.unk2; + print_sCurrentPtr->rgba[3] = (u8) D_80369078.unk3; +} + +void print_bold_overlapping(s32 x, s32 y, f32 arg2, u8* string){ + _printbuffer_push_new(x, y, string); + if(print_sCurrentPtr){ + strcpy(print_sCurrentPtr->fmtString, D_80377240); // strcpy(print_sCurrentPtr->fmtString, "fl"); + print_sCurrentPtr->unk10 = arg2; + } +} + +void print_bold_spaced(s32 x, s32 y, u8* string){ + _printbuffer_push_new(x, y, string); + if(print_sCurrentPtr){ + strcpy(print_sCurrentPtr->fmtString, D_80377244); // strcpy(print_sCurrentPtr->fmtString, "f"); + } +} + +void print_dialog(s32 x, s32 y, u8* string){ + _printbuffer_push_new(x, y, string); + if(print_sCurrentPtr){ + strcpy(print_sCurrentPtr->fmtString, D_80377248); // strcpy(print_sCurrentPtr->fmtString, "elq"); + } +} + +void print_dialog_w_bg(s32 x, s32 y, u8* string){ + _printbuffer_push_new(x, y, string); + if(print_sCurrentPtr){ + strcpy(print_sCurrentPtr->fmtString, D_8037724C); // strcpy(print_sCurrentPtr->fmtString, "pb"); + } +} + +void print_dialog_gradient(s32 x, s32 y, u8* string, u8 arg3, u8 arg4){ + _printbuffer_push_new(x, y, string); + if(print_sCurrentPtr){ + print_sCurrentPtr->unk4 = arg3; + print_sCurrentPtr->unk6 = arg4; + strcpy(print_sCurrentPtr->fmtString, D_80377250); // strcpy(print_sCurrentPtr->fmtString, "v"); + } +} + +void func_802F79D0(s32 x, s32 y, u8* string, s32 arg3, s32 arg4){ + _printbuffer_push_new(x, y, string); + if(print_sCurrentPtr){ + print_sCurrentPtr->unk4 = arg3; + print_sCurrentPtr->unk6 = arg4; + strcpy(print_sCurrentPtr->fmtString, D_80377254); // strcpy(print_sCurrentPtr->fmtString, "delq"); + + } +} + +void func_802F7A2C(s32 arg0) { + s8 *phi_v0; + s32 i; + s32 j; + s32 offset; + + D_80380B0C = arg0; + + i = 0; + offset = 0; + while(i < D_80380B0C){ + phi_v0 = offset + D_80380B20; + for(j = 0; j < 0x20; j++){ + phi_v0[j] = (s8) ((i*0xff) / (s32) (D_80380B0C - 1)); + } + i++; + offset+=0x20; + } + osWritebackDCache(&D_80380B20, D_80380B0C*sizeof(struct23s)); +} + +void func_802F7B90(s32 arg0, s32 arg1, s32 arg2){ + D_80369078.unk0 = arg0; + D_80369078.unk1 = arg1; + D_80369078.unk2 = arg2; +} + +void func_802F7BA8(s32 arg0){ + D_80369078.unk3 = arg0; +} diff --git a/src/core2/code_7060.c b/src/core2/code_7060.c new file mode 100644 index 00000000..df2d237f --- /dev/null +++ b/src/core2/code_7060.c @@ -0,0 +1,961 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" +#include "enums.h" + + +extern bool player_isInHorizontalRadius(f32[3], f32); +extern bool player_isInVerticalRange(f32[3], f32); +extern enum bs_e func_80292658(f32 arg0[3], f32 arg1, void(*arg2)(ActorMarker *), ActorMarker *arg3); +extern void miscflag_clear(s32); +extern void func_80294924(f32, f32); +extern void func_80295A8C(void); +extern void climbSet(f32[3], f32[3], f32, u32); +extern void func_80296C90(f32); +extern void func_80296C9C(f32); +extern void func_8029B73C(f32 arg0[3], f32 arg1, f32 arg2, f32 arg3, f32 arg4); + +bool func_8028F4B8(f32 arg0[3], f32 arg1, f32 arg2); +bool func_8028F620(f32 arg0[3], f32 arg1, f32 arg2); +void func_8028F85C(f32 arg0[3]); +void func_8028F8A4(f32 rotation[3]); +void func_8028F918(s32 arg0); + + +/* .data */ +u8 D_80363690 = 0; +u8 D_80363694 = 0; +f32 D_80363698[3] = {0.0f, 0.0f, 0.0f}; +f32 D_803636A4[3] = {0.0f, 0.0f, 0.0f}; +u8 D_803636B0 = 0; +f32 D_803636B4[3] = {0.0f, 0.0f, 0.0f}; +f32 D_803636C0[3] = {-16000.0f, -16000.0f, -16000.0f}; + +/* .bss */ +f32 D_8037BFB0[2]; +u8 D_8037BFB8; +u8 D_8037BFB9; //player_locked +u8 D_8037BFBA; //player_present +s32 D_8037BFBC; +f32 D_8037BFC0[3]; +f32 D_8037BFCC; +f32 D_8037BFD0; + +/* .code */ +bool func_8028DFF0(s32 arg0, s32 arg1[3]) { + if (arg0 >= 0x80) { + arg1[0] = func_802E4A98(arg0); + arg1[1] = func_802E4AAC(arg0); + arg1[2] = func_802E4AC0(arg0); + return TRUE; + } + else{ + return func_80304DD0(func_803084F0(arg0), arg1); + } +} + +bool func_8028E060(s32 arg0, s32 *arg1){ + if(arg0 >= 0x80){ + *arg1 = func_802E4AD4(); + return TRUE; + } + else{ + return func_80305344(func_803084F0(), arg1); + } +} + +void func_8028E0B0(ActorMarker *arg0){ + bs_setState(bs_getIdleState()); + func_8029A980(0); + miscflag_clear(0x16); + miscflag_clear(0x18); +} + +void func_8028E0F0(s32 arg0, s32 arg1[3]) { + f32 sp7C[3]; + f32 sp70[3]; + s32 sp6C; + bool sp68; + bool sp64; + f32 sp58[3]; + f32 sp4C[3]; + f32 sp40[3]; + f32 sp34[3]; + f32 sp28[3]; + f32 sp1C[3]; + + D_8037BFB8 = TRUE; + sp64 = FALSE; + sp68 = FALSE; + sp7C[0] = (f32) arg1[0]; + sp7C[1] = (f32) arg1[1]; + sp7C[2] = (f32) arg1[2]; + switch (D_80363690) { + case 1: + sp68 = 1; + ml_vec3f_copy(sp40, sp7C); + nodeprop_getPosition(func_80304CAC(0x156, sp40), sp58); + nodeprop_getPosition(func_80304CAC(0x157, sp40), sp4C); + sp40[0] = ((sp4C[0] - sp58[0]) * D_8037BFB0[0]) + sp58[0]; + sp40[2] = ((sp4C[2] - sp58[2]) * D_8037BFB0[1]) + sp58[2]; + ml_vec3f_copy(sp7C, sp40); + break; + case 2: + sp64 = 1; + ml_vec3f_copy(sp1C, sp7C); + nodeprop_getPosition(func_80304CAC(0x154, sp1C), sp34); + nodeprop_getPosition(func_80304CAC(0x155, sp1C), sp28); + sp1C[1] = ((sp28[1] - sp34[1]) * D_8037BFB0[0]) + sp34[1]; + ml_vec3f_copy(sp7C, sp1C); + break; + } + + D_80363690 = 0; + switch (map_get()) { + case MAP_27_FP_FREEZEEZY_PEAK: + if (arg0 == 0xD) { + miscflag_set(0x16); + } + break; + case MAP_77_GL_RBB_LOBBY: + if ((arg0 == 2) && func_802D6088()) { + miscflag_set(0x18); + } + break; + case MAP_76_GL_640_NOTE_DOOR: + if ((arg0 == 1) && func_802D60C4()) { + miscflag_set(0x18); + } + break; + } + + D_8037BFBC = arg0; + if (func_80305248(sp70, func_8033452C(arg0), sp7C) && !func_8028ADB4()) { + func_8028F85C(sp7C); + func_80295A8C(); + if (sp68) { + sp70[0] = sp7C[0]; + sp70[2] = sp7C[2]; + } + if (sp64) { + sp70[1] = sp7C[1]; + } + func_8028F85C(sp70); + func_8028E060(arg0, &sp6C); + yaw_setIdeal((f32) sp6C); + yaw_applyIdeal(); + bs_setState(func_80292658(&sp7C, 1.0f, func_8028E0B0, NULL)); + return; + } + func_8028F85C(&sp7C); + func_80295A8C(); + func_8029A980(0); + miscflag_clear(0x16); + miscflag_clear(0x18); + func_8028E060(arg0, &sp6C); + yaw_setIdeal((f32) sp6C); + yaw_applyIdeal(); +} + +s32 func_8028E440(s32 arg0[3]) { + s32 phi_s0; + + phi_s0 = 0; + for(phi_s0 = 0; phi_s0 < 0x1E; phi_s0++){ + if (func_8028DFF0(phi_s0, arg0)) { + return phi_s0; + } + } + return -1; +} + + +s32 func_8028E4A4(void){ + return D_8037BFBC; +} + +void func_8028E4B0(void) { + s32 sp24[3]; + s32 sp20; + + D_8037BFBA = TRUE; + D_8037BFB9 = FALSE; + func_80295914(); + sp20 = func_803348CC(); + D_8037BFB8 = 0; + player_setPosition(D_803636C0); + if (func_803203FC(0xE) || func_802D686C() || (sp20 == 0x65)){ + return; + } + if (sp20 == 0x63) { + func_8028F85C(&D_8037BFC0); + yaw_set(D_8037BFCC); + D_8037BFBC = (s32) D_8037BFD0; + D_8037BFB8 = 1; + func_80295A8C(); + func_8029A980(0); + miscflag_clear(0x16); + yaw_setIdeal(D_8037BFCC); + yaw_applyIdeal(); + } else if (func_8028DFF0(sp20, sp24)) { + func_8028E0F0(sp20, sp24); + } else { + sp20 = func_8028E440(sp24); + if (sp20 != -1) { + func_8028E0F0(sp20, sp24); + } + } + if (D_80363694 != 0) { + D_80363694--; + if (D_80363694 == 0) { + func_8028F85C(D_80363698); + func_8028F8A4(D_803636A4); + } + } + if (D_803636B0) { + D_803636B0 = FALSE; + func_8028F85C(&D_803636B4); + } +} + +void func_8028E644(void){ + func_80295B04(); //loadzone_applyCollision + D_8037BFBA = 0; //player_present +} + +void func_8028E668(f32 arg0[3], f32 arg1, f32 arg2, f32 arg3) { + func_8029B73C(arg0, arg1, arg2, arg3, 1000.0f); +} + + +void func_8028E6A4(Gfx **gfx, Mtx **mtx, Vtx **vtx) { + if (D_8037BFB8) { + eggShatter_draw(gfx, mtx, vtx); + func_80291AF0(gfx, mtx, vtx); + } +} + + +void func_8028E6EC(s32 arg0){ + bs_setState(bs_getIdleState()); + func_8028F918(arg0); +} + +void func_8028E71C(void) { + if (D_8037BFB8 && !D_8037BFB9 && func_80334904() == 2) { + func_80295C14(); + } +} + + +enum hitbox_e player_getActiveHitbox(ActorMarker *marker){ + return func_8028DB14(marker); +} + +AnimCtrl *player_getAnimCtrlPtr(void){ + return _player_getAnimCtrlPtr(); +} + +ActorMarker *player_getMarker(void){ + return _player_getMarker(); +} + +u32 player_getTransformation(void){ + return _player_getTransformation(); +} + +void func_8028E7EC(f32 arg0[3]){ + climbGetBottom(arg0); +} + +f32 func_8028E80C(s32 arg0){ + return func_80291670(arg0); +} + +f32 func_8028E82C(void){ + return func_80294438(); +} + +void func_8028E84C(f32 arg0[3]){ + func_80294480(arg0); +} + +ActorMarker *func_8028E86C(void){ + return func_802948EC(); +} + +s32 func_8028E88C(void){ + ActorMarker *marker; + + marker = func_802948EC(); + if(marker){ + return marker->unk14_20; + } + return 0; +} + +enum actor_e func_8028E8C0(void){ + ActorMarker *marker; + Actor *actor; + + marker = func_802948EC(); + + if(marker){ + actor = marker_getActor(marker); + return actor->modelCacheIndex; + } + return 0; +} + +f32 func_8028E904(void){ + return func_802915D8(); +} + +f32 func_8028E924(f32 arg0[3], s32 arg1){ + s32 *sp1C; + + func_80292284(arg0, arg1); + func_8028D6F0(&sp1C); + return (f32) sp1C[arg1]; +} + +void func_8028E964(f32 arg0[3]){ + func_8028E924(arg0, 0); +} + +f32 func_8028E984(void){ + return func_80291604(); +} + +void player_getPosition(f32 dst[3]){ + _player_getPosition(dst); +} + +void func_8028E9C4(s32 arg0, f32 arg1[3]) { + switch(arg0){ + case 1: //L8028E9EC + banjo_getPosition(arg1); + break; + + case 2: //L8028E9FC + func_802924E8(arg1); + break; + + case 3: //L8028EA0C + func_8029223C(arg1); + break; + + case 4: //L8028EA1C + func_80292260(arg1); + break; + + case 5: //L8028EA2C + _player_getPosition(arg1); + switch(_player_getTransformation()){ + case TRANSFORM_3_PUMPKIN: //L8028EA68 + if(map_get() == MAP_1B_MMM_MAD_MONSTER_MANSION){ + arg1[1] += 100.0f; + } + else{ + arg1[1] += 70.0f; + } + break; + + case TRANSFORM_2_TERMITE: //L8028EAAC + arg1[1] += 110.0f; + break; + + case TRANSFORM_5_CROC: //L8028EAC4 + arg1[1] += 40.0f; + break; + + case TRANSFORM_4_WALRUS: //L8028EADC + arg1[1] += 75.0f; + break; + + case TRANSFORM_6_BEE: //L8028EAF4 + arg1[1] += 85.0f; + break; + + case TRANSFORM_1_BANJO: //L8028EB0C + default: + arg1[1] += 100.0f; + break; + } + break; + + case 0: //L8028EB24 + default: + player_getPosition(arg1); + break; + } +} + + +void func_8028EB3C(s32 arg0[3]){ + f32 plyr_pos[3]; + player_getPosition(plyr_pos); + arg0[0] = (s32)plyr_pos[0]; + arg0[1] = (s32)plyr_pos[1]; + arg0[2] = (s32)plyr_pos[2]; +} + +//player_getYaw +f32 func_8028EBA4(void){ + return yaw_get(); +} + +f32 func_8028EBC4(void){ + return func_802B6F9C(); +} + +f32 func_8028EBE4(void){ + return pitch_get(); +} + +int func_8028EC04(void){ + return func_80298850(); +} + +void player_getRotation(f32 *dst){ + dst[0] = pitch_get(); + dst[1] = yaw_get(); + dst[2] = roll_get(); +} + +f32 func_8028EC64(f32 arg0[3]){ + f32 sp1C; + f32 sp18; + func_80293D2C(&sp18, &sp1C); + _player_getPosition(arg0); + arg0[1] += sp18; + return sp1C; +} + +enum bsgroup_e func_8028ECAC(void) { + enum bs_e state_id; + s32 temp_a1; + + state_id = bs_getState(); + if (miscflag_isTrue(MISC_FLAG_1B_TRANSFORMING)) { + return BSGROUP_D_TRANSFORMING; + } + if (miscflag_isTrue(0x17)) { + return 4; + } + if (bsbfly_inSet(state_id)) { + return BSGROUP_A_FLYING; + } + if (bslongleg_inSet(state_id)) { + return BSGROUP_9_LONG_LEG; + } + if (bsclimb_inSet(state_id)) { + return BSGROUP_5_CLIMB; + } + if (func_802B8190(state_id)) { + return BSGROUP_C_WALRUS_SLED; + } + if (miscflag_isTrue(9) != 0) { + return 1; + } + switch(state_id){ + case BS_E_OW: //L8028EE00 + case BS_34_JIG_NOTEDOOR: //L8028EE00 + case BS_3C: //L8028EE00 + case BS_3F: //L8028EE00 + case BS_41_DIE: //L8028EE00 + case BS_44_JIG_JIGGY: //L8028EE00 + return 1; + + case BS_1A_WONDERWING_ENTER: //L8028EE08 + case BS_1B_WONDERWING_IDLE: //L8028EE08 + case BS_1C_WONDERWING_WALK: //L8028EE08 + case BS_1D_WONDERWING_JUMP: //L8028EE08 + case BS_1E_WONDERWING_EXIT: //L8028EE08 + case BS_A4_WONDERWING_DRONE://L8028EE08 + case BS_A5_WONDERWING_UNKA5://L8028EE08 + return BSGROUP_3_WONDERWING; + + case BS_8_BTROT_JUMP: //L8028EE10 + case BS_15_BTROT_IDLE: //L8028EE10 + case BS_16_BTROT_WALK: //L8028EE10 + case BS_17_BTROT_EXIT: //L8028EE10 + case BS_45_BTROT_SLIDE: //L8028EE10 + if(func_80291698(3)){ + return BSGROUP_6_TURBO_TALON_TRAINERS; + } + return BSGROUP_8_TROT; + + case BS_B_UNKOWN: //L8028EE30 + return 2; + + case BS_6E_CROC_BITE://L8028EE38 + case BS_70_CROC_EAT_GOOD://L8028EE38 + if(func_802AD3A0()) + return 0; + return BSGROUP_7_CROC_ATTACK; + + default: //L8028EE58 + if (player_getActiveHitbox(NULL) != 0) { + return BSGROUP_B_ATTACKING; + } + return 0; + } +} + + +enum bswatergroup_e func_8028EE84(void) { + enum bswatergroup_e state_id; + + state_id = bs_getState(); + if (bsswim_inset(state_id)) { + return BSWATERGROUP_1_SURFACE; + } + if (state_id == BS_5_JUMP) { + if (bsjump_jumpingFromWater()) { + return BSWATERGROUP_1_SURFACE; + } + return BSWATERGROUP_0_NONE; + } + if (bsbswim_inSet(state_id)) { + return BSWATERGROUP_2_UNDERWATER; + } + return BSWATERGROUP_0_NONE; +} + + +f32 func_8028EF08(void){ + return yaw_getIdeal(); +} + +void func_8028EF28(f32 arg0[3]){ + func_80294A1C(arg0); +} + +Struct60s *func_8028EF48(void){ + return func_802946F0(); +} + +void player_getVelocity(f32 dst[3]){ + _get_velocity(dst); +} + +f32 func_8028EF88(void){ + if(func_80294574()){ + return func_80294500(); + } + return player_getYPosition(); +} + +bool func_8028EFC8(void){ + return func_802955A4(BUTTON_B, 2); +} + +bool func_8028EFEC(void){ + return func_802955A4(BUTTON_A, 2); +} + +void func_8028F010(enum actor_e actor_id){ + func_8028DF48(actor_id); +} + +void func_8028F030(enum actor_e actor_id){ + func_8028DF20(actor_id); +} + +void func_8028F050(enum actor_e actor_id){ + func_8028DFB8(actor_id); +} + +bool func_8028F070(void){ + if(!D_8037BFBA){ + return FALSE; + } + return D_8037BFB8; +} + +bool func_8028F098(void){ + switch(func_8028ECAC()){ + case 1: + case 2: + return FALSE; + default: + return TRUE; + } +} + +bool func_8028F0D4(void){ + enum transformation_e xform_id; + + xform_id = _player_getTransformation(); + return xform_id == TRANSFORM_1_BANJO + || xform_id == TRANSFORM_7_WISHWASHY; +} + +bool player_is_in_jiggy_jig(void){ + return bs_getState() == BS_44_JIG_JIGGY; +} + +bool func_8028F12C(void){ + return bs_getState() == BS_B_UNKOWN; +} + +bool func_8028F150(void){ + return func_80292548(); +} + +bool func_8028F170(void){ + return miscflag_isTrue(0x17); +} + +int ability_isUnlocked(enum ability_e uid){ + return ability_hasLearned(uid); +} + +bool func_8028F1B0(void){ + return !func_8028F2FC(); +} + +bool player_is_present(void){ + return D_8037BFBA; +} + +bool func_8028F1E0(void){ + return bsList_getInterruptMethod(bs_getState()) != NULL; +} + +bool func_8028F20C(void){ + return func_8028B2E8(); +} + +bool func_8028F22C(void){ + if(bs_getState() == BS_41_DIE){ + return TRUE; + } + return FALSE; +} + +bool func_8028F25C(void){ + return func_8028EC04() != 0; +} + +bool func_8028F280(void){ + return func_8029453C(); +} + +bool func_8028F2A0(void) { + return (func_8028ECAC() == 0) && !func_80294610(0xE000); +} + + +bool func_8028F2DC(void){ + return func_802949C8(); +} + +bool func_8028F2FC(void){ + return func_8028B528(); +} + +//sets carry actor if player is within a horizantal radius around a point +bool func_8028F31C(f32 position[3], f32 radius, enum actor_e actor_id, Actor **arg3){ + if(player_isInHorizontalRadius(position, radius)){ + return func_8028DD60(actor_id, arg3); + } + return FALSE; +} + +//sets carry actor if player is within a cylinder around a point +bool func_8028F364(f32 position[3], f32 radius, f32 vert_range, enum actor_e actor_id, Actor **arg4) { + if (player_isInVerticalRange(position, vert_range)) { + return func_8028F31C(position, radius, actor_id, arg4); + } + return FALSE; +} + +void ability_unlock(enum ability_e uid){ + func_80295818(uid, TRUE); +} + +void func_8028F3D8(f32 arg0[3], f32 arg1, void(*arg2)(ActorMarker *), ActorMarker *arg3){ + bs_setState(func_80292658(arg0, arg1, arg2, arg3)); +} + +void func_8028F408(f32 arg0[3]){ + func_80297BC4(arg0); +} + +bool func_8028F428(s32 arg0, ActorMarker *marker) { + func_80296CB4(arg0); + func_80296CA8(marker); + return bs_checkInterrupt(0x24) == 2; +} + +bool func_8028F45C(s32 arg0, f32 arg1[3]) { + func_80296CB4(arg0); + func_80296CC0(arg1); + return bs_checkInterrupt(0x23) == 2; +} + +bool func_8028F490(f32 arg0[3]){ + return func_8028F4B8(arg0, 840.0f, -1500.0f); +} + +bool func_8028F4B8(f32 arg0[3], f32 arg1, f32 arg2) { + func_80296C90(arg1); + func_80296C9C(arg2); + func_80296CB4(0xE); + func_80296CC0(arg0); + return bs_checkInterrupt(0x2D) == 2; +} + +bool func_8028F504(s32 arg0) { + func_80296CB4(arg0); + return bs_checkInterrupt(0x1f) == 2; +} + +bool func_8028F530(s32 arg0) { + func_80296CB4(arg0); + return bs_checkInterrupt(0x31) == 2; +} + +bool func_8028F55C(s32 arg0, ActorMarker *marker) { + func_80296CB4(arg0); + func_80296CA8(marker); + return bs_checkInterrupt(0x21) == 2; +} + +bool func_8028F590(s32 arg0, ActorMarker *marker) { + func_80296CB4(arg0); + func_80296CA8(marker); + return bs_checkInterrupt(0x33) == 2; +} + +bool func_8028F5C4(s32 arg0, f32 arg1[3]) { + func_80296CB4(arg0); + func_80296CC0(arg1); + return bs_checkInterrupt(0x20) == 2; +} + +bool func_8028F5F8(f32 arg0[3]){ + return func_8028F620(arg0, 840.0f, -1500.0f); +} + +bool func_8028F620(f32 arg0[3], f32 arg1, f32 arg2) { + func_80296C90(arg1); + func_80296C9C(arg2); + func_80296CB4(0x10); + func_80296CC0(arg0); + return bs_checkInterrupt(0x2E) == 2; +} + +s32 func_8028F66C(s32 arg0){ + return bs_checkInterrupt(arg0); +} + +s32 func_8028F68C(s32 arg0, ActorMarker *marker){ + func_80296CA8(marker); + return bs_checkInterrupt(arg0); +} + +s32 func_8028F6B8(s32 arg0, s32 arg1){ + func_80296CB4(arg1); + return bs_checkInterrupt(arg0); +} + +s32 func_8028F6E4(s32 arg0, f32 arg1[3]){ + func_80296CC0(arg1); + return bs_checkInterrupt(arg0); +} + +void func_8028F710(s32 arg0, f32 arg1){ + func_802917E4(arg0, arg1); +} + +void func_8028F738(f32 bottom[3], f32 top[3], f32 radius, u32 arg3){ + climbSet(bottom, top, radius, arg3); +} + +void func_8028F760(s32 arg0, f32 arg1, f32 arg2){ + D_80363690 = arg0; + D_8037BFB0[0] = arg1; + D_8037BFB0[1] = arg2; +} + +void func_8028F784(bool arg0){ + if(arg0){ + func_802955BC(TRUE); + func_8029B318(TRUE); + } + else{ + func_802955BC(FALSE); + func_8029B318(FALSE); + } +} + +//player_setLocked +void func_8028F7C8(bool arg0){ + D_8037BFB9 = arg0; +} + +void func_8028F7D4(f32 arg0, f32 arg1){ + func_80294924(arg0, arg1); +} + +void func_8028F7F4(s32 arg0, s32 arg1){} + +void func_8028F800(s32 arg0[3]){ + f32 sp1C[3]; + + sp1C[0] = (f32)arg0[0]; + sp1C[1] = (f32)arg0[1]; + sp1C[2] = (f32)arg0[2]; + func_8028F85C(sp1C); +} + +void func_8028F85C(f32 arg0[3]){ + func_80298464(arg0); + func_80293F0C(); + func_8028A8D0(); + func_8028B71C(); + func_80290B6C(); + func_80291358(); +} + +void func_8028F8A4(f32 rotation[3]){ + pitch_setIdeal(rotation[0]); + yaw_setIdeal(rotation[1]); + roll_setIdeal(rotation[2]); + pitch_applyIdeal(); + yaw_applyIdeal(); + roll_applyIdeal(); +} + +void func_8028F8F8(s32 arg0, bool arg1){ + func_8029026C(arg0, arg1); +} + +void func_8028F918(s32 arg0){ + if(arg0 == 0){ + func_80298890(); + } + else{ + func_802988DC(arg0); + } +} + +void func_8028F94C(s32 arg0, f32 arg1[3]){ + func_802988DC(arg0); + func_8029892C(arg1); +} + +void func_8028F974(void){ + func_80294E54(1); +} + +void func_8028F994(void){ + D_803636B0 = 1; + player_getPosition(D_803636B4); + func_802E4078(map_get(), 0, 0); +} + +void func_8028F9DC(s32 arg0){ + D_80363694 = arg0; + player_getPosition(D_80363698); + player_getRotation(D_803636A4); +} + +void func_8028FA14(enum map_e map_id, s32 exit_id){ + func_8029C834(map_id, exit_id); +} + +void func_8028FA34(s32 arg0, Actor *arg1){ + func_8028DEEC(arg0, arg1); +} + +void func_8028FA54(f32 arg0[3]){ + func_80294AC0(arg0); +} + +void func_8028FA74(f32 dst[3]){ + f32 plyr_pos[3]; + f32 sp18[3]; + + _player_getPosition(plyr_pos); + func_80298540(sp18); + ml_vec3f_add(dst, plyr_pos, sp18); +} + +void func_8028FAB0(f32 arg0[3]){ + f32 plyr_pos[3]; + f32 diff[3]; + + _player_getPosition(plyr_pos); + ml_vec3f_diff_copy(diff, arg0, plyr_pos); + func_80298564(diff); +} + +void func_8028FAEC(f32 rotation[3]){ + pitch_setIdeal(rotation[0]); + yaw_setIdeal(rotation[1]); + roll_setIdeal(rotation[2]); +} + +void func_8028FB28(void){ + func_802948E0(); +} + +void func_8028FB48(u32 mask){ + func_80294610(mask); +} + +void func_8028FB68(void){ + func_80295D74(); +} + +bool func_8028FB88(enum transformation_e xform_id) { + if (func_8028ADF0() && xform_id == TRANSFORM_1_BANJO) { + xform_id = TRANSFORM_7_WISHWASHY; + } + func_80294AF4(xform_id); + return bs_checkInterrupt(0xA) == 2; +} + +bool func_8028FBD4(f32 arg0[3]) { + if (func_803114B0() || func_8028ECAC()) { + return FALSE; + } + if (arg0 != NULL) { + func_80294A98(arg0); + } + return bs_checkInterrupt(8) == 2; +} + +bool func_8028FC34(void){ + if (func_8028E86C() && bscarry_inSet(bs_getState())) + return bs_checkInterrupt(0x16) == 2; + return FALSE; +} + +void func_8028FC8C(f32 arg0[3]){ + func_8029892C(arg0); +} + +void func_8028FCAC(void){ + D_8037BFB8 = TRUE; +} + +void func_8028FCBC(void){ + D_8037BFB8 = FALSE; +} + +void func_8028FCC8(bool arg0){ + func_802921C8(arg0); +} + +void func_8028FCE8(void) { + player_getPosition(D_8037BFC0); + D_8037BFCC = yaw_get(); + D_8037BFD0 = D_8037BFBC; +} diff --git a/src/core2/code_70C30.c b/src/core2/code_70C30.c new file mode 100644 index 00000000..85199422 --- /dev/null +++ b/src/core2/code_70C30.c @@ -0,0 +1,97 @@ +#include +#include "functions.h" +#include "variables.h" + +extern struct6s *D_80381030; +extern struct3s *D_80381034; + +void func_802F7BC0(Gfx **gdl, Mtx **mptr, Vtx **vptr){ + if(D_80381030){ + func_802F8A90(D_80381030, gdl, mptr, vptr); + } + if(D_80381034){ + func_802F8110(D_80381034, gdl, mptr, vptr); + } + func_802F962C(gdl, mptr, vptr); +} + +struct6s *func_802F7C38(void){ + if(D_80381030 == NULL){ + D_80381030 = func_802F8BE0(50); //new CCW weather + } + return D_80381030; +} + +struct3s *func_802F7C7C(void){ + if(D_80381034 == NULL){ + D_80381034 = func_802F8264(30); //rain + } + return D_80381034; +} + +void func_802F7CC0(void){ + func_802F9054(); +} + +void func_802F7CE0(void){ + if(D_80381030){ + func_802F8B8C(D_80381030); + } + + if(D_80381034){ + func_802F8214(D_80381034); + } + func_802F8FFC(); +} + +void func_802F7D30(void){ + D_80381030 = NULL; + ((void **)&D_80381030)[1] = NULL; +} + +void func_802F7D44(void){ + if(D_80381030){ + func_802F8C90(D_80381030); + } + + if(D_80381034){ + func_802F8338(D_80381034); + } + func_802F90F4(); +} + +void func_802F7D94(void){ + if(D_80381030){ + func_802F8CB0(D_80381030); + } + + if(D_80381034){ + func_802F8358(D_80381034); + } + func_802F9114(); +} + +void func_802F7DE4(void){ + if(D_80381030){ + func_802F8A70(D_80381030); + func_802F8CB0(D_80381030); + } + + if(D_80381034){ + func_802F80F0(D_80381034); + func_802F8358(D_80381034); + } + func_802F8FF0(); + func_802F9114(); +} + +void func_802F7E54(void){ + if(D_80381030){ + func_802F8CD0(D_80381030); + } + + if(D_80381034){ + func_802F83AC(D_80381034); + } + func_802F919C(); +} diff --git a/src/core2/code_70F20.c b/src/core2/code_70F20.c new file mode 100644 index 00000000..21afef4a --- /dev/null +++ b/src/core2/code_70F20.c @@ -0,0 +1,205 @@ +#include +#include "functions.h" +#include "variables.h" + +extern s32 func_8024DD34(f32,f32, f32); + +/* .code */ +void func_802F7EB0(struct3s *this){ + f32 plyrPos[3]; //sp74 + f32 camNorm[3]; //sp68 + f32 camRot[3]; //sp5C + s32 i; + f32 tmpf; + struct4s * sp50; + f32 sp4C[3]; + + + if(vector_size(this->unk20) >= this->unk24) + return; + + player_getPosition(plyrPos); + func_8024C5A8(camNorm); + func_8024C764(camRot); + sp50 = vector_pushBackNew(&this->unk20); + tmpf = randf2(50.0f, 1100.0f); + sp4C[0] = 0.0f; + sp4C[1] = randf2(200.0f, 300.0f); + sp4C[2] = -tmpf; + + if(gu_sqrtf(this->unk10[0]*this->unk10[0] + this->unk10[1]*this->unk10[1] + this->unk10[2]*this->unk10[2]) < 5.0f){ + ml_vec3f_yaw_rotate_copy(sp4C, sp4C, randf2(0.0f, 360.0f)); + } + else{ + ml_vec3f_yaw_rotate_copy(sp4C, sp4C, camRot[1]+ randf2(-70.0f, 70.0f)); + } + sp4C[0] = plyrPos[0] + sp4C[0]; + sp4C[1] = plyrPos[1] + sp4C[1]; + sp4C[2] = plyrPos[2] + sp4C[2]; + if(tmpf < 550.0) + for(i = 0; (i < 0xa) && func_8024DD34(sp4C[0],sp4C[1]- 10.0f, sp4C[2]); i++){ + sp4C[1] += 100.0f; + } + + sp50->unk0[0] = sp4C[0]; + sp50->unk0[1] = sp4C[1]; + sp50->unk0[2] = sp4C[2]; + sp50->unkC[0] = 0.0f; + sp50->unkC[1] = randf2(-1600.0f, -1500.0f); + sp50->unkC[2] = 0.0f; +} + +void func_802F80E8(struct3s *this, u32 arg1){ + this->unk28 = arg1; +} + +void func_802F80F0(struct3s *this){ + vector_clear(this->unk20); +} + + +void func_802F8110(struct3s *this, Gfx **gdl, Mtx **mptr, u32 arg3){ + struct4s * startPtr; //sp4c + struct4s * endPtr; + struct4s * iPtr; + + startPtr = vector_getBegin(this->unk20); + endPtr = vector_getEnd(this->unk20); + for(iPtr = startPtr; iPtr < endPtr; iPtr++){ + set_model_render_mode(2); + func_803391A4(gdl, mptr, iPtr, 0, 1.0f, 0, this->unk2C); + iPtr->unk18 = func_8033A170(); + } +} + +bool func_802F81D8(struct3s *this){ + return (this->unk28 != 1) && (vector_size(this->unk20) == 0); +} + +void func_802F8214(struct3s * this){ + if(this->unk0) + func_802F9D38(this->unk0); + vector_free(this->unk20); + func_8033BD20(&this->unk2C); + free(this); + +} + +struct3s *func_802F8264(s32 arg0){ + struct3s * ptr = (struct3s *) malloc(sizeof(struct3s)); + ptr->unk0 = 0; + ptr->unk1C = 0; + ptr->unk34 = 0; + ptr->unk4[0] = ptr->unk4[1] = ptr->unk4[2] =0.0f; + ptr->unk10[0] = ptr->unk10[1] = ptr->unk10[2] =0.0f; + ptr->unk20 = vector_new(sizeof(struct4s), arg0); + ptr->unk24 = arg0; + ptr->unk28 = 0; + ptr->unk2C = assetcache_get(0x898); //rain + ptr->unk30 = 0.1f; + return ptr; +} + +void func_802F82F4(struct3s *this, f32 arg1, f32 arg2, f32 arg3, f32 arg4){ + this->unk34 = 1; + this->unk38 = 0.0f; + this->unk3C = 0.1f; + this->unk40[0] = arg1; + this->unk40[1] = arg2; + this->unk40[2] = arg3; + this->unk40[3] = arg4; +} + +void func_802F8338(struct3s *this){ + func_802F80E8(this, 1); +} + +void func_802F8358(struct3s *this){ + void *tmp; + func_802F80E8(this, 2); + if(!(tmp = this->unk0)) + return; + func_802F9FD0(tmp, 0.0f, 0.0f, 3.0f); + this->unk0 = NULL; +} + +void func_802F83AC(struct3s *arg0) { + f32 sp3C[3]; + f32 temp_f20; + struct4s *temp_v0; + s32 phi_s0; + + temp_f20 = time_getDelta(); + player_getPosition(sp3C); + arg0->unk10[0] = sp3C[0] - arg0->unk4[0]; + arg0->unk10[1] = sp3C[1] - arg0->unk4[1]; + arg0->unk10[2] = sp3C[2] - arg0->unk4[2]; + arg0->unk4[0] = sp3C[0]; + arg0->unk4[1] = sp3C[1]; + arg0->unk4[2] = sp3C[2]; + if (func_802BEF64()) { + vector_clear(arg0->unk20); + } + if (vector_size(arg0->unk20) > 0) { + if (arg0->unk0 == 0) { + arg0->unk0 = func_802F9AA8(SFX_BE_WATERFALL); + func_802F9DB8(arg0->unk0, 0.95f, 1.05f, 0.01f); + func_802F9F80(arg0->unk0, 3.0f, 1.296e7f, 0.0f); + func_802FA0B0(arg0->unk0, 2); + func_802FA060(arg0->unk0, 5000, 6000, 5.0f); + } + } else { + if (arg0->unk0 != 0) { + func_802F9D38(arg0->unk0); + arg0->unk0 = 0; + } + } + for(phi_s0 = 0; phi_s0 < vector_size(arg0->unk20); phi_s0++){ + temp_v0 = (struct4s *)vector_at(arg0->unk20, phi_s0); + temp_v0->unk0[0] += temp_v0->unkC[0] * temp_f20; + temp_v0->unk0[1] += temp_v0->unkC[1] * temp_f20; + temp_v0->unk0[2] += temp_v0->unkC[2] * temp_f20; + if ((temp_v0->unk0[1] < (sp3C[1] - 500.0f)) && (temp_v0->unk18 == 0)) { + vector_remove(arg0->unk20, phi_s0); + phi_s0--; + } + } + arg0->unk1C++; + if (arg0->unk1C < vector_size(arg0->unk20)) { + temp_v0 = (struct4s *)vector_at(arg0->unk20, arg0->unk1C); + if (1210.0 < ml_vec3f_distance(temp_v0->unk0, sp3C)) { + vector_remove(arg0->unk20, arg0->unk1C); + } + } else { + arg0->unk1C = 0; + } + + if (arg0->unk34 != 0) { + arg0->unk38 += temp_f20; + if (arg0->unk40[arg0->unk34 - 1] <= arg0->unk38) { + arg0->unk34++; + arg0->unk38 = 0.0f; + if (arg0->unk34 > 4) { + arg0->unk34 = 1; + } + } + if (arg0->unk34 == 1) { + arg0->unk3C = (1.0f - arg0->unk38/arg0->unk40[0]) * 0.1; + } else if (arg0->unk34 == 2) { + arg0->unk3C = 0.01f; + } else if (arg0->unk34 == 3) { + arg0->unk3C = (arg0->unk38 / arg0->unk40[2]) * 0.1; + } else { + arg0->unk3C = 0.01f; + } + if (arg0->unk3C <= 0.01) { + arg0->unk3C = 0.01f; + } + } + if (func_8025773C(&arg0->unk30, temp_f20)) { + if ((arg0->unk28 == 1) && !func_802BEF64() && (arg0->unk34 != 4)) { + func_802F7EB0(arg0); + } + arg0->unk30 = (arg0->unk34 != 0) ? arg0->unk3C : 0.01; + } +} diff --git a/src/core2/code_71820.c b/src/core2/code_71820.c new file mode 100644 index 00000000..d0eb570a --- /dev/null +++ b/src/core2/code_71820.c @@ -0,0 +1,186 @@ +#include +#include "functions.h" +#include "variables.h" + +extern int func_8024DD34(f32, f32, f32); +#define _SQ3(x, y, z) (((x) * (x)) + ((y) * (y)) + ((z) * (z))) +#define _SQ3v1(v) (v[0] * v[0] + v[1] * v[1] + v[2] * v[2]) + +/*.code*/ +void func_802F87B0(struct6s *this){ + f32 plyrPos[3]; //sp7C + f32 camNorm[3]; //sp70 + f32 camRot[3]; //sp64 + struct5s * ptr; + f32 f20; + int i; + f32 sp4C[3]; + + if(vector_size(this->unk1C) >= this->unk20) + return; + + player_getPosition(plyrPos); + func_8024C5A8(camNorm); + func_8024C764(camRot); + ptr = vector_pushBackNew(&this->unk1C); + f20 = randf2(50.0f, 1200.0f); + sp4C[0] = 0.0f; + sp4C[1] = randf2(200.0f, 500.0f); + sp4C[2] = -f20; + + if(gu_sqrtf(_SQ3v1((&this->unkC))) < 5.0f) + { + ml_vec3f_yaw_rotate_copy(sp4C, sp4C, randf2(0.0f, 360.0f)); + } + else{ + ml_vec3f_yaw_rotate_copy(sp4C, sp4C, camRot[1] + randf2(-70.0f, 70.0f)); + }//L802F88F0 + sp4C[0] += plyrPos[0]; + sp4C[1] += plyrPos[1]; + sp4C[2] += plyrPos[2]; + if(f20 < 600.0){ + for(i = 0; i <10 && func_8024DD34(sp4C[0], sp4C[1] - 10.0f, sp4C[2]); i++){ + sp4C[1] += 100.0f; + } + } + ptr->unk4[0] = sp4C[0]; + ptr->unk4[1] = sp4C[1]; + ptr->unk4[2] = sp4C[2]; + + ptr->unk10[0] = 0.0f; + ptr->unk10[1] = randf2(-100.0f, -100.0f); + ptr->unk10[2] = 0.0f; + + ptr->unk1C[0] = ptr->unk1C[1] = ptr->unk1C[2] = 0.0f; + + ptr->unk28[0] = randf2(-300.0f, 300.0f); + ptr->unk28[1] = randf2(-300.0f, 300.0f); + ptr->unk28[2] = randf2(-300.0f, 300.0f); + + this->unk34++; + if(!(this->unk34 < 4)) + this->unk34 = 0; + + ptr->unk0 = this->unk24[this->unk34]; +} + +void func_802F8A68(struct6s *this, s32 arg1){ + this->unk22 = arg1; +} + +void func_802F8A70(struct6s *this){ + vector_clear(this->unk1C); +} + +void func_802F8A90(struct6s *this, Gfx **gdl, Mtx **mptr, Vtx **vptr){ + struct5s * startPtr = vector_getBegin(this->unk1C); + struct5s * iPtr; + struct5s * endPtr = vector_getEnd(this->unk1C); + for(iPtr = startPtr; iPtr < endPtr; iPtr++){ + set_model_render_mode(2); + func_803391A4(gdl, mptr, iPtr->unk4, iPtr->unk1C, 1.0f, NULL, iPtr->unk0); + iPtr->unk34 = func_8033A170(); + } +} + +int func_802F8B50(struct6s *this){ + return this->unk22 != 1 && (u32)vector_size(this->unk1C) < 1; +} + +void func_802F8B8C(struct6s *this){ + vector_free(this->unk1C); + func_8033BD20(&this->unk24[0]); + func_8033BD20(&this->unk24[1]); + func_8033BD20(&this->unk24[2]); + func_8033BD20(&this->unk24[3]); + free(this); +} + +struct6s * func_802F8BE0(s32 arg0){ + struct6s *this = (struct6s *) malloc(sizeof(struct6s)); + vector(struct5s) *vecPtr; + this->unk18 = 0; + this->unk8 = 0.0f; + this->unk4 = 0.0f; + this->unk0 = 0.0f; + this->unk14 = 0.0f; + this->unk10 = 0.0f; + this->unkC = 0.0f; + vecPtr = vector_new(sizeof(struct5s), arg0); + this->unk1C = vecPtr; + this->unk20 = arg0; + this->unk22 = 0; + this->unk24[0] = assetcache_get(0x899); //rain + this->unk24[1] = assetcache_get(0x89A); //red_leaf + this->unk24[2] = assetcache_get(0x89B); //brown_leaf + this->unk24[3] = assetcache_get(0x89C); //green_leaf + this->unk34 = 0; + this->unk38 = 0.1f; + return this; +} + +void func_802F8C90(struct6s *this){ + func_802F8A68(this, 1); +} + +void func_802F8CB0(struct6s *this){ + func_802F8A68(this, 2); +} + +void func_802F8CD0(struct6s * this){ + f32 plyr_pos[3];//sp64 + f32 f20 = time_getDelta(); + int i; + struct5s *iPtr; + + player_getPosition(plyr_pos); + this->unkC = plyr_pos[0] - this->unk0; + this->unk10 = plyr_pos[1] - this->unk4; + this->unk14 = plyr_pos[2] - this->unk8; + this->unk0 = plyr_pos[0]; + this->unk4 = plyr_pos[1]; + this->unk8 = plyr_pos[2]; + if(func_802BEF64()){ + vector_clear(this->unk1C); + } + + for(i = 0; i < vector_size(this->unk1C); i++){ + iPtr; + iPtr = vector_at(this->unk1C, i); + iPtr->unk4[0] += iPtr->unk10[0]*f20; + iPtr->unk4[1] += iPtr->unk10[1]*f20; + iPtr->unk4[2] += iPtr->unk10[2]*f20; + + iPtr->unk10[0] += randf2(-400.0f, 400.0f)*f20; + iPtr->unk10[2] += randf2(-400.0f, 400.0f)*f20; + + iPtr->unk1C[0] += iPtr->unk28[0]*f20; + iPtr->unk1C[1] += iPtr->unk28[1]*f20; + iPtr->unk1C[2] += iPtr->unk28[2]*f20; + + iPtr->unk28[0] += randf2(-300.0f, 300.0f)*f20; + iPtr->unk28[1] += randf2(-300.0f, 300.0f)*f20; + iPtr->unk28[2] += randf2(-300.0f, 300.0f)*f20; + + if(iPtr->unk4[1] < plyr_pos[1] - 500.0f && !iPtr->unk34){ + vector_remove(this->unk1C, i); + i--; + } + } + this->unk18++; + if((s32)this->unk18 < vector_size(this->unk1C)){ + iPtr = vector_at(this->unk1C, this->unk18); + if(1320.0 < ml_vec3f_distance(iPtr->unk4, plyr_pos)){ + vector_remove(this->unk1C, this->unk18); + } + } + else{ + this->unk18 = 0; + } + + if(func_8025773C(&this->unk38, f20)){ + if(this->unk22 == 1 && !func_802BEF64()) + func_802F87B0(this); + this->unk38 = 0.1f; + } +} diff --git a/src/core2/code_72060.c b/src/core2/code_72060.c new file mode 100644 index 00000000..0244e0c0 --- /dev/null +++ b/src/core2/code_72060.c @@ -0,0 +1,153 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + u8 pad0[0xC]; + f32 unkC[3]; +}Struct_core2_72060_0; + +extern void func_80251B5C(f32, f32, f32); +extern void func_80251F8C(f32); +extern void func_8025208C(f32); +extern void func_80252A38(f32, f32, f32); + +extern struct4Cs * D_80369280; +extern s32 D_80369284; +extern void * D_80369288; +extern s32 D_8036928C; +extern Gfx D_80369290[]; + +extern f32 D_80377350; +extern f32 D_80377354; + +extern f32 D_80381050[3]; +extern f32 D_80381060; +extern f32 D_80381064; +extern f32 D_80381070[3]; +extern f32 D_80381080[3]; +extern s32 D_8038108C; +extern Gfx *D_80381090; +extern Struct_core2_72060_0 *D_80381094; + +void func_802F8FF0(void){ + D_80369284 = 0; +} + +void func_802F8FFC(void){ + if(D_80369280){ + free(D_80369280->unk1C); + func_8033BD20(&D_80369288); + free(D_80369280); + D_80369280 = NULL; + D_80369284 = 0; + } +} + +void func_802F9054(void){ + func_802F8FFC(); + D_80369280 = (struct4Cs *) malloc(sizeof(struct4Cs)); + D_80369280->unk0[0] = D_80369280->unk0[1] = D_80369280->unk0[2] = 0.0f; + D_80369280->unkC[0] = D_80369280->unkC[1] = D_80369280->unkC[2] = 0.0f; + D_8036928C = 0; + D_80369280->unk1C = malloc(100*sizeof(struct4Ds)); + D_80369280->unk18 = 0; + D_80369288 = assetcache_get(0x8a1); //2D_light +} + +void func_802F90F4(void){ + if(D_80369280) + D_80369280->unk18 = 1; +} + +void func_802F9114(void){ + if(D_80369280) + D_80369280->unk18 = 2; +} + +void func_802F9134(s32 gfx){ + D_80369284 = D_80369284 - 1; + if(gfx < D_80369284){ + func_80254630(D_80369280->unk1C + gfx, D_80369280->unk1C + D_80369284, sizeof(struct4Ds)); + } +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_72060/func_802F919C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_72060/func_802F962C.s") +// void func_802F962C(Gfx **gfx, Mtx **mtx, Vtx **vtx) { +// u32 temp_s0_3; +// u32 temp_s0_4; +// void *temp_s0; +// void *temp_s0_2; +// void *temp_s3; +// void *temp_s3_2; +// void *temp_s4; +// void *temp_s4_2; +// void *temp_v1; +// void *temp_v1_2; +// void *temp_v1_3; +// void *phi_s0; +// void *phi_s0_2; + +// if ((D_80369280 != NULL) && (D_80369284 != 0)) { +// func_8024C5CC(D_80381050); +// func_8024C764(D_80381060); +// temp_v1 = D_80369288; +// D_80381090 = temp_v1 + temp_v1->unkC + 8; +// temp_s3 = temp_v1 + temp_v1->unk10; +// D_8038108C = func_802EC920(temp_s3); +// func_80349AD0(); +// gSPSegment((*gfx)++, 0x01, osVirtualToPhysical(temp_s3 + 0x18)); +// gSPSegment((*gfx)++, 0x02, osVirtualToPhysical(temp_v1_2 + temp_v1_2->unk8 + 0x18)); +// gSPSetGeometryMode((*gfx)++, G_ZBUFFER); +// gSPDisplayList((*gfx)++, D_80369290); +// gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(&D_803692B0)); + +// temp_v1_3 = D_80369288; +// D_80381094 = temp_v1_3 + temp_v1_3->unk4; +// temp_s0_3 = D_80369280->unk1C; +// phi_s0 = (void *) temp_s0_3; +// if (temp_s0_3 < (u32) (temp_s0_3 + (D_80369284 * 0x18))) { +// do { +// phi_s0_2 = phi_s0; +// if ((func_802F989C(gfx, mtx, phi_s0) == 0) && (phi_s0->unk4 < D_8038104C)) { +// func_802F9134((s32) (phi_s0 - D_80369280->unk1C) / 24); +// phi_s0_2 = phi_s0 - 0x18; +// } +// temp_s0_4 = phi_s0_2 + 0x18; +// phi_s0 = (void *) temp_s0_4; +// } while (temp_s0_4 < (u32) (D_80369280->unk1C + (D_80369284 * 0x18))); +// } +// } +// } + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_72060/func_802F989C.s") +#else +bool func_802F989C(Gfx **gfx, Mtx **mtx, f32 arg2[3]) { + + D_80381070[0] = arg2[0] - D_80381050[0];\ + D_80381070[1] = arg2[1] - D_80381050[1];\ + D_80381070[2] = arg2[2] - D_80381050[2]; + if( ((-17000.0f < D_80381070[0]) &&(D_80381070[0] < 17000.0f)) + && (arg2[1] > -200.0f) + && ((-17000.0f < D_80381070[2]) && (D_80381070[2] < 17000.0f)) + && func_8024DB50(arg2, D_8038108C) + ) { + func_80251B5C(D_80381070[0], D_80381070[1], D_80381070[2]); + mlMtxApply(*mtx); + func_80252434(&D_80381080, D_80381094->unkC); + func_80251B5C(D_80381080[0], D_80381080[1], D_80381080[2]); + func_8025208C(D_80381064); + func_80251F8C(D_80381060); + func_80252A38(-(D_80381094->unkC[0]), -(D_80381094->unkC[1]), -(D_80381094->unkC[2])); + mlMtxApply(*mtx); + gSPMatrix((*gfx)++, (*mtx)++, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList((*gfx)++, osVirtualToPhysical(D_80381090)); + gSPPopMatrix((*gfx)++, G_MTX_MODELVIEW); + return TRUE; + } + return FALSE; +} +#endif diff --git a/src/core2/code_72B10.c b/src/core2/code_72B10.c new file mode 100644 index 00000000..add5ba3d --- /dev/null +++ b/src/core2/code_72B10.c @@ -0,0 +1,272 @@ +#include +#include "functions.h" +#include "variables.h" + +f32 sfx_randf2(f32, f32); + +extern vector(struct4Es) *D_803810A0; + +void func_802F9D38(s32 arg0); +void func_802FA028(s32 arg0, s32 arg1); +void func_802FA0B0(s32 arg0, s32 arg1); + +/*.code */ +void func_802F9AA0(struct4Es *this, s32 arg1){ + this->unk3E = arg1; +} + +s32 func_802F9AA8(enum sfx_e arg0){ + s32 indx; + struct4Es *iPtr; + struct4Es *endPtr; + struct4Es *startPtr; + + + endPtr = vector_getEnd(D_803810A0); + startPtr = vector_getBegin(D_803810A0); + + for(iPtr = startPtr + 1; iPtr < endPtr && iPtr->unk0; iPtr++); + if(iPtr == endPtr) + iPtr = vector_pushBackNew(&D_803810A0); + + iPtr->unk0 = func_8030D90C(); + sfxsource_setSfxId(iPtr->unk0, arg0); + func_8030DD14(iPtr->unk0, 3); + sfxsource_setSampleRate(iPtr->unk0, 0x64); + func_8030E2C4(iPtr->unk0); + startPtr = vector_getBegin(D_803810A0); + indx = iPtr - startPtr; + iPtr->unk3C = 0; + iPtr->unk3E = 0; + iPtr->unk3F = 0; + iPtr->unk4 = 0.0f; + iPtr->unk8 = 0.0f; + func_802F9DB8(indx, 1.0f, 1.0f, 0.0f); + func_802F9F80(indx, 1.0f, 3.0f, 1.0f); + func_802FA028(indx, 0); + func_802FA060(indx, 30000, 30000, 0.0f); + func_802FA0B0(indx, 0); + return indx; +} + +int func_802F9C0C(s32 arg0){ + struct4Es *ptr; + ptr = vector_at(D_803810A0, arg0); + return (ptr->unk0)? 1 : 0; +} + +void func_802F9C48(void){ + struct4Es *iPtr; + struct4Es *startPtr; + struct4Es *endPtr; + + startPtr = vector_getBegin(D_803810A0); + endPtr = vector_getEnd(D_803810A0); + for(iPtr = startPtr; iPtr < endPtr; iPtr++){ + if(iPtr->unk0) + func_802F9D38(iPtr - startPtr); + } + vector_free(D_803810A0); +} + +void func_802F9CD8(void){ + int i; + struct4Es *iPtr; + D_803810A0 = (vector(struct4Es) *) vector_new(sizeof(struct4Es), 0x10); + for(i = 0; i< 0x10; i++){ + iPtr = vector_pushBackNew(&D_803810A0); + iPtr->unk0 = 0; + } +} + +void func_802F9D38(s32 arg0){ + struct4Es *ptr; + ptr = vector_at(D_803810A0, arg0); + if(ptr->unk0){ + func_8030E394(ptr->unk0); + func_8030DA44(ptr->unk0); + ptr->unk0 = 0; + } +} + +s32 func_802F9D8C(s32 arg0){ + struct4Es *ptr; + ptr = vector_at(D_803810A0, arg0); + return ptr->unk0; +} + +void func_802F9DB8(s32 arg0, f32 arg1, f32 arg2, f32 arg3){ + struct4Es *ptr; + ptr = vector_at(D_803810A0, arg0); + func_802F9AA0(ptr, 1); + ptr->unk18 = arg3; + ptr->unk20 = arg1; + ptr->unk1C = arg2; + if(ptr->unk0){ + func_8030DBB4(ptr->unk0, (arg1 + arg2)/2); + } +} + +void func_802F9E44(s32 arg0, f32 arg1, f32 arg2, f32 arg3, f32 arg4){ + struct4Es *ptr; + ptr = vector_at(D_803810A0, arg0); + func_802F9AA0(ptr, 2); + ptr->unk24 = arg1; + ptr->unk28 = arg2; + ptr->unk2C = arg3; + ptr->unk30 = arg4; + if(ptr->unk0){ + func_8030DBB4(ptr->unk0, arg3); + } +} + +void func_802F9EC4(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ + struct4Es *iPtr; + + iPtr = vector_at(D_803810A0, arg0); + if(iPtr->unk0){ + func_8030DEB4(iPtr->unk0, (f32)arg2, (f32)arg3); + func_8030DF68(iPtr->unk0, arg1); + } +} + +void func_802F9F48(s32 arg0, s32 arg1){ + struct4Es *iPtr; + iPtr = vector_at(D_803810A0, arg0); + iPtr->unk3F = arg1; +} + +void func_802F9F80(s32 arg0, f32 arg1, f32 arg2, f32 arg3){ + struct4Es *iPtr; + iPtr = vector_at(D_803810A0, arg0); + iPtr->unkC = arg1; + iPtr->unk10 = arg3; + iPtr->unk14 = arg2; +} + +void func_802F9FD0(s32 arg0, f32 arg1, f32 arg2, f32 arg3){ + struct4Es *iPtr; + iPtr = vector_at(D_803810A0, arg0); + iPtr->unkC = arg1; + iPtr->unk10 = arg3; + iPtr->unk14 = arg2; + iPtr->unk4 = 0.0f; +} + +void func_802FA028(s32 arg0, s32 arg1){ + struct4Es *iPtr; + iPtr = vector_at(D_803810A0, arg0); + iPtr->unk3D = arg1; +} + +void func_802FA060(s32 arg0, s32 arg1, s32 arg2, f32 arg3){ + struct4Es *iPtr; + iPtr = vector_at(D_803810A0, arg0); + iPtr->unk3A = arg1; + iPtr->unk38 = arg2; + iPtr->unk34 = arg3; +} + +void func_802FA0B0(s32 arg0, s32 arg1){ + struct4Es *iPtr; + iPtr = vector_at(D_803810A0, arg0); + if(iPtr->unk0){ + func_8030DD90(iPtr->unk0, arg1); + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_72B10/func_802FA0F8.s") +#else +void func_802FA0F8(void){ + //stack allocation too large + f32 tick; + struct4Es *iPtr; + struct4Es *startPtr; + struct4Es *endPtr; + f32 f20; + + tick = time_getDelta(); + startPtr = vector_getBegin(D_803810A0); + endPtr = vector_getEnd(D_803810A0); + + for(iPtr = startPtr; iPtr < endPtr; iPtr++){//L802FA178 + if(iPtr->unk0){ + iPtr->unk4 += tick; + if( iPtr->unkC + iPtr->unk14 + iPtr->unk10 <= iPtr->unk4){ + func_802F9D38(iPtr - startPtr); + } + else{ + if(iPtr->unk3E == 1){ + f20 = func_8030E200(iPtr->unk0); + f20 += sfx_randf2(-1.0f, 1.0f)*iPtr->unk18; + f20 = MIN(iPtr->unk1C, f20); + f20 = MAX(iPtr->unk20, f20); + } + else if(iPtr->unk3E == 2){//L802FA238 + f20 = ml_map_f(iPtr->unk4, iPtr->unk24, iPtr->unk28, iPtr->unk2C, iPtr->unk30); + } + func_8030DBB4(iPtr->unk0, f20); + + if(iPtr->unk3C){ + if(0.0f == iPtr->unk10){ + iPtr->unk8 = 0.0f; + } + else{ + iPtr->unk8 -= (f32)iPtr->unk38/iPtr->unk10 * tick; + } + if(iPtr->unk8 <= 0.0f){ + func_802F9D38(iPtr - startPtr); + continue; + } + } + else if(iPtr->unk4 < iPtr->unkC){//L802FA2E4 + iPtr->unk8 = ((iPtr->unk4/iPtr->unkC)*((f32)( iPtr->unk3A + iPtr->unk38 )))/2; + } + else if(iPtr->unk4 <= iPtr->unkC + iPtr->unk14){ + if( iPtr->unk8 < iPtr->unk3A + || iPtr->unk38 < iPtr->unk8 + ){ + iPtr->unk8 = (iPtr->unk3A + iPtr->unk38)/2; + } + iPtr->unk8 += sfx_randf2(-1.0f, 1.0f) * iPtr->unk34; + + iPtr->unk8 = MIN(iPtr->unk38, iPtr->unk8); + iPtr->unk8 = MAX(iPtr->unk3A, iPtr->unk8); + } + else{ + iPtr->unk8 = (1.0f - ((iPtr->unk4 - iPtr->unkC) - iPtr->unk14)/iPtr->unk10) * (iPtr->unk3A + iPtr->unk38) / 2; + } + if(iPtr->unk3F && !func_8030E3FC(iPtr->unk0)){ + func_8030E2C4(iPtr->unk0); + } + sfxsource_setSampleRate(iPtr->unk0, (s32)iPtr->unk8); + } + }//L802FA4A0 + }//L802FA4B4 +} +#endif + +void func_802FA4E0(void){ + D_803810A0 = vector_defrag(D_803810A0); +} + +void func_802FA508(void){ + struct4Es *startPtr; + struct4Es *endPtr; + struct4Es *iPtr; + + startPtr = vector_getBegin(D_803810A0); + endPtr = vector_getEnd(D_803810A0); + for(iPtr = startPtr; iPtr < endPtr; iPtr++){ + if(iPtr->unk0){ + if(iPtr->unk3D == 0){ + func_802F9D38(iPtr - startPtr); + } + else if(--iPtr->unk3D == 0){ + iPtr->unk3C = 1; + iPtr->unk4 = 0.0f; + } + } + } +} \ No newline at end of file diff --git a/src/core2/code_73640.c b/src/core2/code_73640.c new file mode 100644 index 00000000..2347b834 --- /dev/null +++ b/src/core2/code_73640.c @@ -0,0 +1,269 @@ +#include +#include "functions.h" +#include "variables.h" + +#define _73640_MAX(s,t) ((s < t)? t: s) +#define _73640_MIN(s,t) ((s > t)? t: s) + +typedef struct item_print_s{ + struct8s *(*unk0)(s32); + void (*unk4)(s32, struct8s *); + void (*unk8)(enum item_e, struct8s *, Gfx**, Mtx**, Vtx**); + void (*unkC)(s32, struct8s *); + s32 unk10; + struct8s *unk14; +} ItemPrint; + + +s32 func_802FAD9C(s32 itemId); +f32 time_getDelta(void); +f32 time_getDelta(void); + + + + +/* .data */ +s16 D_803692E0[6] = { + ASSET_89D_ZOOMBOX_SPRITE, + ASSET_7D9_SPRITE_NOTE, + ASSET_7DD_SPRITE_HEALTH, + ASSET_35F_MODEL_JIGGY, + 0x360, + -1 +}; +s16 D_803692EC[6] = { + ASSET_580_SPRITE_RED_FEATHER, + ASSET_6D1_SPRITE_GOLDFEATHTER, + ASSET_41A_SPRITE_MUMBO_TOKEN, + ASSET_36D_SPRITE_BLUE_EGG, + -1 +}; + +ItemPrint D_803692F8[0x2C] = { + { func_802FD7B0, func_802FD80C, func_802FDAF4, func_802FDC80, 5, NULL }, //ITEM_0_HOURGLASS_TIMER + { func_802FD7B0, func_802FD80C, func_802FDAF4, func_802FDC80, 0, NULL }, // ITEM_1_SKULL_HOURGLASS_TIMER + { func_802FD320, func_802FD330, func_802FD33C, func_802FD350, 0, NULL }, //2 + { func_802FD7B0, func_802FD80C, func_802FDAF4, func_802FDC80, 5, NULL }, //ITEM_3_PROPELLOR_TIMER + { func_802FD320, func_802FD330, func_802FD33C, func_802FD350, 0, NULL }, // + { func_802FD7B0, func_802FD80C, func_802FDAF4, func_802FDC80, 0, NULL }, //ITEM_5_XMAS_TREE_TIMER + { func_802FD320, func_802FD330, func_802FD33C, func_802FD350, 0, NULL }, //ITEM_6_HOURGLASS + { func_802FD320, func_802FD330, func_802FD33C, func_802FD350, 0, NULL }, //ITEM_7_SKULL_HOURGLASS + { func_802FD320, func_802FD330, func_802FD33C, func_802FD350, 0, NULL }, //8 + { func_802FD320, func_802FD330, func_802FD33C, func_802FD350, 0, NULL }, //ITEM_9_PROPELLOR + { func_802FD320, func_802FD330, func_802FD33C, func_802FD350, 0, NULL }, //10 + { func_802FD320, func_802FD330, func_802FD33C, func_802FD350, 0, NULL }, //ITEM_B_XMAS_TREE + { func_802FD7B0, func_802FD80C, func_802FDAF4, func_802FDC80, 1, NULL }, //ITEM_C_NOTE + { func_802FD7B0, func_802FD80C, func_802FDAF4, func_802FDC80, 1, NULL }, //ITEM_D_EGGS + { fxcommon3score_new, fxcommon3score_update, fxcommon3score_draw, fxcommon3score_free, 3, NULL }, //ITEM_14_HEALTH + { func_802FD7B0, func_802FD80C, func_802FDAF4, func_802FDC80, 1, NULL }, //ITEM_F_RED_FEATHER + { func_802FD7B0, func_802FD80C, func_802FDAF4, func_802FDC80, 1, NULL }, //ITEM_10_GOLD_FEATHER + { func_802FD320, func_802FD330, func_802FD33C, func_802FD350, 0, NULL }, //17 + { func_802FF090, func_802FFA50, func_802FF3B8, func_802FF358, 3, NULL }, //ITEM_12_JINJOS + { func_802FDE2C, func_802FE844, func_802FDEE0, func_802FDDC4, 0, NULL }, //ITEM_13_EMPTY_HONEYCOMB + { func_80300CD8, func_80301348, func_80300D0C, func_80300C70, 0, NULL }, //ITEM_14_HEALTH + { func_802FD320, func_802FD330, func_802FD33C, func_802FD350, 0, NULL }, //ITEM_15_HEALTH_TOTAL + { func_802FFE4C, func_803005BC, func_802FFF34, func_802FFED4, 6, NULL }, //ITEM_16_LIFE + { func_8030179C, func_80301DE4, func_803017D0, func_80301754, 0, NULL }, //ITEM_17_AIR + { fxcommon3score_new, fxcommon3score_update, fxcommon3score_draw, fxcommon3score_free, 2, NULL }, //ITEM_18_GOLD_BULLIONS + { fxcommon3score_new, fxcommon3score_update, fxcommon3score_draw, fxcommon3score_free, 2, NULL }, //ITEM_19_ORANGE + { func_802FD7B0, func_802FD80C, func_802FDAF4, func_802FDC80, 6, NULL }, //ITEM_1A_PLAYER_VILE_SCORE + { func_802FD7B0, func_802FD80C, func_802FDAF4, func_802FDC80, 0, NULL }, //ITEM_1B_VILE_VILE_SCORE + { func_802FD7B0, func_802FD80C, func_802FDAF4, func_802FDC80, 2, NULL }, //ITEM_1C_MUMBO_TOKEN + { fxcommon3score_new, fxcommon3score_update, fxcommon3score_draw, fxcommon3score_free, 0, NULL }, //ITEM_1D_GRUMBLIE + { fxcommon3score_new, fxcommon3score_update, fxcommon3score_draw, fxcommon3score_free, 0, NULL }, //ITEM_1E_YUMBLIE + { fxcommon3score_new, fxcommon3score_update, fxcommon3score_draw, fxcommon3score_free, 2, NULL }, //ITEM_1F_GREEN_PRESENT + { fxcommon3score_new, fxcommon3score_update, fxcommon3score_draw, fxcommon3score_free, 2, NULL }, //ITEM_20_BLUE_PRESENT + { fxcommon3score_new, fxcommon3score_update, fxcommon3score_draw, fxcommon3score_free, 2, NULL }, //ITEM_21_RED_PRESENT + { fxcommon3score_new, fxcommon3score_update, fxcommon3score_draw, fxcommon3score_free, 2, NULL }, //ITEM_22_CATERPILLAR + { fxcommon3score_new, fxcommon3score_update, fxcommon3score_draw, fxcommon3score_free, 2, NULL }, //ITEM_23_ACORNS + { fxcommon3score_new, fxcommon3score_update, fxcommon3score_draw, fxcommon3score_free, 0, NULL }, //ITEM_24_TWINKLY_SCORE + { func_802FD7B0, func_802FD80C, func_802FDAF4, func_802FDC80, 4, NULL }, //ITEM_25_MUMBO_TOKEN_TOTAL + { fxcommon3score_new, fxcommon3score_update, fxcommon3score_draw, fxcommon3score_free, 4, NULL }, //ITEM_26_JIGGY_TOTAL + { func_802FD7B0, func_802FD80C, func_802FDAF4, func_802FDC80, 2, NULL }, //ITEM_27_JOKER_CARD + { func_802FD7B0, func_802FD80C, func_802FD33C, func_802FDC80, 5, NULL }, //40 + { func_802FD7B0, func_802FD80C, func_802FD33C, func_802FDC80, 3, NULL }, //41 + { func_802FD7B0, func_802FD80C, func_802FD33C, func_802FDC80, 2, NULL }, //42 + { fxcommon3score_new, fxcommon3score_update, fxcommon3score_draw, fxcommon3score_free, 2, NULL } //43 +}; + +/* .bss */ +extern s32 D_803810B0; +extern f32 D_803810B8[0x2C]; //item_print_value +extern s32 D_80381168[0x2C]; //comusic_e +extern f32 D_80381218[0x2C]; //item_sfx_volume??? +extern s32 D_803812C8[0x2C]; //comusic_e +extern s32 D_80381378[0x2C]; //sfx_e +extern void *D_80381428[]; +extern void *D_80381450[]; +extern s32 D_80381478[0X2C]; + +/* .code */ +void func_802FA5D0(void){ + s32 i; + + for(i = 0; i < 0x2C; i++){ + + D_803810B8[i] = item_getCount(i); + D_80381378[i] = 0; + D_803812C8[i] = 0; + D_80381168[i] = 0; + D_80381218[i] = 0.7f; //D_80377360 + + } +} + +void func_802FA69C(void){ + s32 i; + + D_803810B0 = 1; + for(i = 0; i< 0x2C; i++){ + D_803692F8[i].unk14 = D_803692F8[i].unk0(i); + func_802FB104(D_803692F8[i].unk10, D_803692F8[i].unk14); + } + func_802FA5D0(); +} + +void func_802FA718(s32 arg0){ + D_803810B0 = arg0; +} + + +void func_802FA724(void) { + f32 diff; + s32 i; + f32 sign; + + func_802FB1CC(); + for(i = 0; i< 0x2C; i++){ + if(func_802FAD9C(i)){ + if (item_getCount(i) != (s32) (D_803810B8[i] + 0.01)) { + diff = (f32) item_getCount(i) - D_803810B8[i]; + sign = (diff >= 0.0f) ? 1.0f : -1.0f; + if (D_80381378[i] != 0) { + D_803810B8[i] += sign *_73640_MIN(time_getDelta() * 6.0f, 1.0); + } else { + D_803810B8[i] += (sign * _73640_MIN(time_getDelta() * _73640_MAX(diff, 8.0f), 1.0)); + } + if ((D_80381168[i] != 0) && ((func_8023DB5C() & 7) == 0)) { + func_8025A6EC(D_80381168[i], 32000); + } + if (D_80381378[i] != 0) { + if ((D_80381478[i] != 0) && ((s32) diff != D_80381478[i])) { + if (D_803810B8[i] > 9.0f) { + func_8030E6A4(D_80381378[i], D_80381218[i], 0x7D00); + D_80381218[i] = _73640_MIN(D_80381218[i] + 0.1, 2.0); + } + } + } + D_80381478[i] = diff; + func_802FB020(D_803692F8[i].unk14, 1); + if ((i == ITEM_14_HEALTH) || (i == ITEM_17_AIR)) { + func_802FB020(D_803692F8[0x16].unk14, 1); + } + + if (item_getCount(i) == (s32) (D_803810B8[i] + 0.01)) { + do{ + if (D_803812C8[i] != 0) { + func_8025A6EC(D_803812C8[i], 0x7D00); + } + + D_80381378[i] = 0; + D_803812C8[i] = 0; + D_80381168[i] = 0; + D_80381218[i] = 0.7f; + D_80381478[i] = 0; + }while(0); + } + } + } + } + + for(i = 0; i< 0x2C; i++){ + func_802FB15C(D_803692F8[i].unk10, D_803692F8[i].unk14); + D_803692F8[i].unk4(i, D_803692F8[i].unk14); + } +} + + +void func_802FAB54(Gfx **gdl, Mtx ** mptr, Vtx **vptr){ + s32 i; + if(D_803810B0 && level_get() != LEVEL_D_CUTSCENE){ + for(i = 0; i < 0x2C; i++){ + if(!func_802E4A08() || i < 6){ + if(func_802FB0D4(D_803692F8[i].unk14)){ + D_803692F8[i].unk8(i, D_803692F8[i].unk14, gdl, mptr, vptr); + } + } + } + } +} + +void func_802FAC3C(void){ + s32 i; + for(i = 0; i< 0x2C; i++){ + func_802FB194(D_803692F8[i].unk10, D_803692F8[i].unk14); + D_803692F8[i].unkC(i, D_803692F8[i].unk14); + } +} + + +void func_802FACA4(enum item_e itemId){ + if(func_802FB0D4(D_803692F8[itemId].unk14) == 2 || itemId < 6 || itemId == ITEM_17_AIR ){ + D_803810B8[itemId] += ((f32)item_getCount(itemId) - D_803810B8[itemId] )*0.7; + } + func_802FB020(D_803692F8[itemId].unk14, 1); +} + +void func_802FAD64(enum item_e itemId){ + func_802FB020(D_803692F8[itemId].unk14, 3); +} + +s32 func_802FAD9C(s32 itemId){ + return (func_802FB0D4(D_803692F8[itemId].unk14) == 2); +} + +int func_802FADD4(s32 itemId){ + s32 v0 = func_802FB0D4(D_803692F8[itemId].unk14); + return (v0 == 2)||(v0 == 1); +} + +s32 itemPrint_getValue(s32 itemId){ + return D_803810B8[itemId] + 0.01; +} + +void func_802FAE4C(void){ + s32 i; + s32 sp40; + for(i = 0; D_803692E0[i] != -1; i++){ + D_80381428[i] = assetcache_get(D_803692E0[i]); + } + for(i = 0; D_803692EC[i] != -1; i++){ + D_80381450[i] = func_8033B6C4(D_803692EC[i], &sp40); + } +} + +void func_802FAF0C(void){ + s32 i; + for(i = 0; D_803692E0[i] != -1; i++){ + assetcache_release(D_80381428[i]); + } + for(i = 0; D_803692EC[i] != -1; i++){ + assetcache_release(D_80381450[i]); + } +} + +void func_802FAFAC(enum item_e item_id, enum comusic_e music_id){ + D_80381168[item_id] = music_id; +} + +void func_802FAFC0(enum item_e item_id, enum comusic_e music_id){ + D_803812C8[item_id] = music_id; +} + +void func_802FAFD4(enum item_e item_id, enum sfx_e sfx_id){ + D_80381378[item_id] = sfx_id; +} + +void func_802FAFE8(s32 arg0){ + func_802FCD98(D_803692F8[arg0].unk14); +} diff --git a/src/core2/code_74090.c b/src/core2/code_74090.c new file mode 100644 index 00000000..4a2ee44b --- /dev/null +++ b/src/core2/code_74090.c @@ -0,0 +1,122 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802FB3A0(void); +extern void func_802FB630(void); +extern void func_802FBBC0(void); +extern void func_802FC0D8(void); +extern void func_802FC644(void); +extern void func_802FCAF4(void); +extern void func_802FD064(void); + +extern void func_802FB220(s32, struct8s *); +extern void func_802FB22C(s32, struct8s *); +extern void func_802FB238(s32, struct8s *); +extern void func_802FB244(s32, struct8s *); +extern void func_802FB394(s32, struct8s *); +extern void func_802FB56C(s32, struct8s *); +extern void func_802FB590(s32, struct8s *); +extern void func_802FB5B4(s32, struct8s *); +extern void func_802FB5C8(s32, struct8s *); +extern void func_802FB61C(s32, struct8s *); +extern void func_802FBA54(s32, struct8s *); +extern void func_802FBA78(s32, struct8s *); +extern void func_802FBA9C(s32, struct8s *); +extern void func_802FBAB0(s32, struct8s *); +extern void func_802FBB04(s32, struct8s *); +extern void func_802FC014(s32, struct8s *); +extern void func_802FC038(s32, struct8s *); +extern void func_802FC05C(s32, struct8s *); +extern void func_802FC070(s32, struct8s *); +extern void func_802FC0C4(s32, struct8s *); +extern void func_802FC580(s32, struct8s *); +extern void func_802FC5A4(s32, struct8s *); +extern void func_802FC5C8(s32, struct8s *); +extern void func_802FC5DC(s32, struct8s *); +extern void func_802FC630(s32, struct8s *); +extern void func_802FCA30(s32, struct8s *); +extern void func_802FCA54(s32, struct8s *); +extern void func_802FCA78(s32, struct8s *); +extern void func_802FCA8C(s32, struct8s *); +extern void func_802FCAE0(s32, struct8s *); +extern void func_802FCFA0(s32, struct8s *); +extern void func_802FCFC4(s32, struct8s *); +extern void func_802FCFE8(s32, struct8s *); +extern void func_802FCFFC(s32, struct8s *); +extern void func_802FD050(s32, struct8s *); + +typedef struct { + void (*unk0)(void); + void (* unk4)(s32, struct8s *); + void (* unk8)(s32, struct8s *); + void (* unkC)(s32, struct8s *); + void (* unk10)(s32, struct8s *); + void (* unk14)(s32, struct8s *); +}struct74090s; + +struct74090s D_80369720[7]={ + {func_802FB3A0, func_802FB220, func_802FB22C, func_802FB238, func_802FB244, func_802FB394}, + {func_802FB630, func_802FB56C, func_802FB590, func_802FB5B4, func_802FB5C8, func_802FB61C}, + {func_802FBBC0, func_802FBA54, func_802FBA78, func_802FBA9C, func_802FBAB0, func_802FBB04}, + {func_802FC0D8, func_802FC014, func_802FC038, func_802FC05C, func_802FC070, func_802FC0C4}, + {func_802FC644, func_802FC580, func_802FC5A4, func_802FC5C8, func_802FC5DC, func_802FC630}, + {func_802FCAF4, func_802FCA30, func_802FCA54, func_802FCA78, func_802FCA8C, func_802FCAE0}, + {func_802FD064, func_802FCFA0, func_802FCFC4, func_802FCFE8, func_802FCFFC, func_802FD050} +}; + +void func_802FB104(s32, struct8s *); + +/*.code*/ +void func_802FB020(struct8s *this, s32 arg1){ + if(this->unk0 || arg1 != 3){ + s32 prev = this->unk0; + this->unk0 = arg1; + if(prev != arg1){ + if(arg1 != 0){ + if(arg1 == 1) + D_80369720[this->unk4].unk4(this->unk4, this); + }else{ + D_80369720[this->unk4].unk8(this->unk4, this); + func_802FB104(this->unk4, this); + } + } + } +} + +s32 func_802FB0D4(struct8s *this){ + return this->unk0; +} + +f32 func_802FB0DC(struct8s *this){ + return this->unk8; +} + +f32 func_802FB0E4(struct8s *this){ + return this->unk14 * this->unkC; +} + +void func_802FB104(s32 arg0, struct8s * arg1){ + arg1->unk0 = 0; + arg1->unk4 = arg0; + arg1->unk14 = 1; + arg1->unk8 = 0.0f; + arg1->unkC = 0.0f; + arg1->unk10 = 0.0f; + D_80369720[arg0].unkC(arg0, arg1); +} + +void func_802FB15C(s32 arg0, struct8s * arg1){ + D_80369720[arg0].unk10(arg0, arg1); +} + +void func_802FB194(s32 arg0, struct8s * arg1){ + D_80369720[arg0].unk14(arg0, arg1); +} + +void func_802FB1CC(void){ + int i; + for(i = 0; i < 7; i++){ + D_80369720[i].unk0(); + } +} diff --git a/src/core2/code_74290.c b/src/core2/code_74290.c new file mode 100644 index 00000000..0e15cf55 --- /dev/null +++ b/src/core2/code_74290.c @@ -0,0 +1,62 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802FB020(struct8s *, s32); + +f32 D_803697D0[] = { + 21.0f, 17.0f, 13.0f, 10.0f, 7.0f, + 5.0f, 3.0f, 2.0f, -1.0f, -1.0f +}; + +void func_802FB220(s32 arg0, struct8s *arg1){ + return; +} + +void func_802FB22C(s32 arg0, struct8s *arg1){ + return; +} + +void func_802FB238(s32 arg0, struct8s *arg1){ + arg1->unk18 = 0; +} + +void func_802FB244(s32 arg0, struct8s *arg1){ + f32 tmp_f0; + switch(arg1->unk0){ + case 1://L802FB27C + tmp_f0 = D_803697D0[arg1->unk18]; + arg1->unkC = arg1->unkC + arg1->unk14*tmp_f0; + if(0.0 == tmp_f0){ + arg1->unk10 = 3.0f; + arg1->unk0 = 2; + } + else{ + arg1->unk18++; + } + break; + case 2://L802FB2E4 + if(getGameMode() != GAME_MODE_4_PAUSED){ + arg1->unk10 -= time_getDelta(); + if(arg1->unk10 < 0.0f){ + arg1->unk0 = 3; + } + } + break; + case 3://L802FB338 + if(arg1->unk18 == 0){ + func_802FB020(arg1, 0); + }else{ + arg1->unk18--; + tmp_f0 = D_803697D0[arg1->unk18]; + arg1->unkC = arg1->unkC - arg1->unk14*tmp_f0; + } + break; + } +} + +void func_802FB394(s32 arg0, struct8s *arg1){ + return; +} + +void func_802FB3A0(void){} diff --git a/src/core2/code_74420.c b/src/core2/code_74420.c new file mode 100644 index 00000000..5f950b02 --- /dev/null +++ b/src/core2/code_74420.c @@ -0,0 +1,123 @@ +#include +#include "functions.h" +#include "variables.h" + +extern s32 D_80369824; + +extern struct8s * D_80381530[]; + +f32 func_802FB3B0(struct8s* arg0){ + int i; + f32 f2; + f2 = 0.0f; + for(i = 0; i < D_80369824; i++){ + if(arg0 == (D_80381530[i])){ + return f2; + } + f2 += 32.5; + } + return 0.0f; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FB414.s") +#else +void func_802FB414(void){ + int i; + D_80369824--; + for(i = 0; i < D_80369824; i++){ + D_80381530[i] = D_80381530[i+1]; + } +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FB458.s") + +void func_802FB56C(s32 arg0, struct8s *arg1){ + func_802FB458(arg1); +} + +void func_802FB590(s32 arg0, struct8s *arg1){ + func_802FB414(); +} + +void func_802FB5B4(s32 arg0, struct8s *arg1){ + arg1->unk18 = 0; + arg1->unk1C = 0.0f; +} + +void func_802FB5C8(s32 arg0, struct8s *arg1){ + s32 tmp; + struct8s *ptr = D_80381530[0]; + if(D_80369824){ + arg1->unkC = func_802FB3B0(arg1) + ptr->unk1C; + } +} + +void func_802FB61C(s32 arg0, struct8s *arg1){ + D_80369824 = 0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FB630.s") + +/* ???BREAK??? */ + +extern s32 D_80369884; +extern s32 *D_8038155C[]; + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FB8A0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FB8F8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FB93C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FBA54.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FBA78.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FBA9C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FBAB0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FBB04.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FBB18.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FBBC0.s") + +void func_802FBDFC(void){} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FBE04.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FBE48.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FBE60.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FBEB8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FBEFC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FC014.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FC038.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FC05C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FC070.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FC0C4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_74420/func_802FC0D8.s") + +bool func_802FC390(void){ + s32 *phi_v1 = D_8038155C[1]; + if (D_80369884 == 0) + return 0; + return *phi_v1 == 2; +} + +bool func_802FC3C4(void){ + if (D_80369884 == 0) + return 0; + return (func_802FDD0C(D_8038155C[D_80369884]) == 0xE); +} diff --git a/src/core2/code_75480.c b/src/core2/code_75480.c new file mode 100644 index 00000000..61a140e6 --- /dev/null +++ b/src/core2/code_75480.c @@ -0,0 +1,22 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75480/func_802FC410.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75480/func_802FC468.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75480/func_802FC4AC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75480/func_802FC580.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75480/func_802FC5A4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75480/func_802FC5C8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75480/func_802FC5DC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75480/func_802FC630.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75480/func_802FC644.s") diff --git a/src/core2/code_75930.c b/src/core2/code_75930.c new file mode 100644 index 00000000..cf28344a --- /dev/null +++ b/src/core2/code_75930.c @@ -0,0 +1,28 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FC8C0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FC918.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FC95C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FCA30.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FCA54.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FCA78.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FCA8C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FCAE0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FCAF4.s") + +void func_802FCD4C(void){} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FCD54.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75930/func_802FCD98.s") diff --git a/src/core2/code_75E90.c b/src/core2/code_75E90.c new file mode 100644 index 00000000..65ea2ae8 --- /dev/null +++ b/src/core2/code_75E90.c @@ -0,0 +1,30 @@ +#include +#include "functions.h" +#include "variables.h" + +extern s32 D_80369914; +extern s32 D_8038158C[]; + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FCE20.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FCE88.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FCECC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FCFA0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FCFC4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FCFE8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FCFFC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FD050.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_75E90/func_802FD064.s") + +int func_802FD2D4(void){ + if(!D_80369914) + return 0; + return func_802FDD0C(D_8038158C[D_80369914]) == 0x1A; +} diff --git a/src/core2/code_76390.c b/src/core2/code_76390.c new file mode 100644 index 00000000..0e66c555 --- /dev/null +++ b/src/core2/code_76390.c @@ -0,0 +1,15 @@ +#include +#include "functions.h" +#include "variables.h" + +extern struct8s D_803815A0; + +struct8s *func_802FD320(enum asset_e item_id){ + return &D_803815A0; +} + +void func_802FD330(enum item_e item_id, struct8s *arg1){} + +void func_802FD33C(enum item_e item_id, struct8s *arg1, Gfx **arg2, Mtx **arg3, Vtx **arg4){} + +void func_802FD350(enum item_e item_id, struct8s *arg1){} diff --git a/src/core2/code_763D0.c b/src/core2/code_763D0.c new file mode 100644 index 00000000..000a6a7d --- /dev/null +++ b/src/core2/code_763D0.c @@ -0,0 +1,317 @@ +#include +#include "functions.h" +#include "variables.h" + +f32 time_getDelta(void); +f32 func_802FB0DC(struct8s *); +f32 func_802FB0E4(struct8s *); + +extern Gfx D_80369920[] = { + gsDPPipeSync(), + gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH), + gsSPSetGeometryMode(G_SHADE | G_TEXTURE_GEN_LINEAR | G_SHADING_SMOOTH), + gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON), + gsDPSetCycleType(G_CYC_1CYCLE), + gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA), + gsDPSetRenderMode(G_RM_XLU_SURF, G_RM_XLU_SURF2), + gsSPEndDisplayList(), +}; + +extern struct8s D_80369960[] = { + { + 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + ITEM_C_NOTE, ASSET_7D9_SPRITE_NOTE, 0x1, 0xA, + 0.6f, 1.0f, 212.0f, -8.0f, + 1.0f, 25.0f, 0.0f, 1.0f, + NULL, {0}, 0.0f, + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + ITEM_D_EGGS, ASSET_36D_SPRITE_BLUE_EGG, 0x2, 0x7, + 0.3f, 1.0f, 212.0f, -8.0f, + 0.8f, 25.0f, 0.0f, 1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + ITEM_F_RED_FEATHER, ASSET_580_SPRITE_RED_FEATHER, 0x2, 0xA, + 0.18f, 1.0f, 212.0f, -8.0f, + 0.5f, 25.0f, 0.0f, 1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + ITEM_10_GOLD_FEATHER, ASSET_6D1_SPRITE_GOLDFEATHTER, 0x2, 0xA, + 0.22f, -1.0f, 212.0f, -8.0f, + 0.5f, 25.0f, 0.0f, 1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + ITEM_1A_PLAYER_VILE_SCORE, ASSET_7E7_SPRITE_CROC_BANJO, 0xD, 0x6, + 0.5f, 1.0f, 28.0f, -16.0f, + 1.0f, 28.0f, 0.0f, 1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + ITEM_1B_VILE_VILE_SCORE, ASSET_7E6_SPRITE_VILE, 0xD, 0x6, + 0.5f, 1.0f, 263.0f, -52.0f, + 1.0f, -26.0f, 0.0f, 1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + ITEM_1C_MUMBO_TOKEN, ASSET_41A_SPRITE_MUMBO_TOKEN, 0x2, 0xC, + 0.3f, 1.0f, 224.0f, 224.0f, + 1.1f, 32.0f, 0.0f, -1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + ITEM_0_HOURGLASS_TIMER, ASSET_6DA_SPRITE_HOURGLASS, 0x2, 0x16, + 0.3f, 1.0f, 24.0f, 224.0f, + 1.0f, 20.0f, 0.0f, -1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + ITEM_1_SKULL_HOURGLASS_TIMER, ASSET_6DB_SPRITE_SKULL_HOURGLASS, 0x2, 0x16, + 0.3f, 1.0f, 24.0f, 266.0f, + 1.0f, 20.0f, 0.0f, -1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + ITEM_3_PROPELLOR_TIMER, ASSET_6D9_SPRITE_PROPELLOR_TIMER, 0x2, 0xC, + 0.2f, 1.0f, 36.0f, 224.0f, + 0.8f, 32.0f, 3.0f, -1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + ITEM_5_XMAS_TREE_TIMER, ASSET_6DC_SPRITE_XMAS_TREE_TIMER, 0x1, 0xE, + 0.5f, 1.0f, 24.0f, 256.0f, + 1.0f, 24.0f, 2.0f, -1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + ITEM_25_MUMBO_TOKEN_TOTAL, ASSET_41A_SPRITE_MUMBO_TOKEN, 0x2, 0xC, + 0.3f, 1.0f, 224.0f, 228.0f, + 1.1f, 32.0f, 0.0f, -1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + ITEM_27_JOKER_CARD, ASSET_7EE_JOKER_CARD, 0x2, 0x18, + 0.3f, 1.0f, 224.0f, 224.0f, + 0.8f, 32.0f, 0.0f, -1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + 0x00000028, 0, 0x2, 0x16, + 0.3f, 1.0f, 24.0f, 266.0f, + 1.0f, 20.0f, 0.0f, -1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + 0x0000002A, 0, 0x2, 0x0E, + 0.3f, 1.0f, 224.0f, 224.0f, + 0.6f, 32.0f, 0.0f, -1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + 0x00000029, 0, 0x2, 0x0E, + 0.3f, 1.0f, 224.0f, 224.0f, + 0.6f, 32.0f, 0.0f, -1.0f, + NULL, {0}, 0.0f + }, + { 0, 0, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, + -1, 0, 0x0, 0x00, + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, + NULL, {0}, 0.0f + }, + }; + +extern s32 D_80276588; +extern s32 D_8027658C; + +extern f32 D_803773A0; +extern f32 D_803773A4; + +void func_802FD360(struct8s *arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + s32 tmp_s2 = 0; + s32 tmp_s4; + s32 spAC; + s32 spA8; + f32 tmp_f26; + f32 f2; + + + if(arg0->unk50 == NULL) return; + + gSPDisplayList((*gfx)++, &D_80369920); + if(arg0->unk20 == ITEM_C_NOTE){ + gDPSetCombineMode((*gfx)++, G_CC_MODULATEIA, G_CC_MODULATEIA); + } + func_8024C7B8(gfx, mtx); + gSPVertex((*gfx)++, *vtx, 4, 0); + if(arg0->unk20 == ITEM_0_HOURGLASS_TIMER){ + tmp_s2 = 0xC; + } + func_80347FC0(gfx, arg0->unk50, ((s32)arg0->unk60 + tmp_s2)%arg0->unk2C, 0, 0, 0, 0, 2, 2, &spAC, &spA8); + tmp_f26 = (arg0->unk20 == ITEM_0_HOURGLASS_TIMER && spAC == 0x10) ? 1.0f : 0.0f; + for(tmp_s4 = 0; tmp_s4 < 2; tmp_s4++){//L802FD528 + for(tmp_s2 = 0; tmp_s2 < 2; tmp_s2++){// + (*vtx)->v.ob[0] = ((func_802FB0DC(arg0) + (((spAC*arg0->unk40*tmp_s2 - spAC*arg0->unk40/2) - (f32)D_80276588/2) + arg0->unk38)) + tmp_f26) * 4.0f; + (*vtx)->v.ob[1] = ((((spA8*arg0->unk40/2 - spA8*arg0->unk40*tmp_s4) + (f32)D_8027658C/2) - arg0->unk3C) - func_802FB0E4(arg0)*arg0->unk4C)*4.0f; + (*vtx)->v.ob[2] = -0x14; + (*vtx)->v.tc[0] = ((spAC -1) * tmp_s2) << 6; + (*vtx)->v.tc[1] = ((spA8 -1) * tmp_s4) << 6; + if(arg0->unk20 == ITEM_C_NOTE){ + if(tmp_s4 == 0){ + (*vtx)->v.cn[0] = 0xff; + (*vtx)->v.cn[1] = 0xff; + (*vtx)->v.cn[2] = 0x0; + (*vtx)->v.cn[3] = 0xff; + } + else if(tmp_s2 != 0){ + (*vtx)->v.cn[0] = 0xff; + (*vtx)->v.cn[1] = 100; + (*vtx)->v.cn[2] = 0x0; + (*vtx)->v.cn[3] = 0xff; + } + else{ + (*vtx)->v.cn[0] = 0xff; + (*vtx)->v.cn[1] = 200; + (*vtx)->v.cn[2] = 0x0; + (*vtx)->v.cn[3] = 0xff; + } + } + (*vtx)++; + } + } + gSP1Quadrangle((*gfx)++, 0, 1, 3, 2, 0); + gDPPipeSync((*gfx)++); + gDPSetTextureLUT((*gfx)++, G_TT_NONE); + gDPPipelineMode((*gfx)++, G_PM_NPRIMITIVE); + func_8024C904(gfx, mtx); +} + +struct8s *func_802FD7B0(enum item_e item_id) { + s32 i; + struct8s *v1; + + for(v1 = D_80369960; v1->unk20 != -1; v1++){ + if(item_id == v1->unk20){ + v1->unk14 = v1->unk4C; + return v1; + } + } + return NULL; +} + +void func_802FD80C(s32 arg0, struct8s * arg1){ + s32 tmp; + f32 two = 2.0f; + f32 phi_f16; + f32 tmpf; + + tmp = func_802FB0D4(arg1); + phi_f16 = 1.0f; + if(!tmp) { + func_802FDC80(arg0, arg1); + } + else{ + if(arg1->unk50 == NULL && arg1->unk24){ + arg1->unk50 = assetcache_get(arg1->unk24); + } + + if(arg0 == 0){ + if(arg1->unk60 < 1.0f || arg1->unk60 >= 12.0f) + phi_f16 = D_803773A0; + } + if(arg0 == 1){ + if(arg1->unk60 > 10.0f) + phi_f16 = D_803773A4; + } + if(arg0 < 6){ + if(item_getCount(arg0) < 30){ + arg1->unk28 |= 8; + } + else{ + arg1->unk28 &= ~0xC; + } + } + if((arg1->unk28 & 4) == 0){ + tmpf = arg1->unk2C; + arg1->unk60 = time_getDelta() * (arg1->unk34 * arg1->unk30) * 60.0f * phi_f16 + arg1->unk60; + if(arg1->unk2C <= arg1->unk60){ + if(arg1->unk28 & 1){ + arg1->unk34 *= -1.0f; + arg1->unk60 -= two* arg1->unk30 * time_getDelta() * 60.0f; + } + else{ + arg1->unk60 -= arg1->unk2C; + if (arg1->unk28 & 8) { + arg1->unk28 |= 4; + arg1->unk60 = 0.0f; + } + } + } + else{ + if(arg1->unk60 < 0.0){ + if(arg1->unk28 & 1){ + arg1->unk34 *= -1.0f; + arg1->unk60 += two * arg1->unk30 * time_getDelta() * 60.0f; + } + else{ + arg1->unk60 += arg1->unk2C; + } + if (arg1->unk28 & 8) { + arg1->unk28 |= 4; + arg1->unk60 = 0.0f; + } + } + } + } + } +} + +void func_802FDAF4(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + f32 pad; + s32 sp38; + f32 sp34; + + + sp38 = itemPrint_getValue(item_id); + sp34 = 0.0f; + if(item_id == ITEM_C_NOTE){ + if(level_get() == LEVEL_6_LAIR || level_get() == LEVEL_C_BOSS){ + sp38 = notescore_getTotal(); + } + } + if(item_id < 6){ + sp38 = ((sp38)? 1: 0) + sp38/60; + }//L802FDBA8 + if(item_id == ITEM_1B_VILE_VILE_SCORE && 9 < sp38){ + sp34 = -16.0f; + } + if(item_id == ITEM_1C_MUMBO_TOKEN || item_id == ITEM_25_MUMBO_TOKEN_TOTAL){ + if(sp38 >= 100){ + sp38 = 99; + } + } + arg1->string_54[0] = 0; + //convert to string + strIToA(arg1->string_54, sp38); + //print text (blue egg font) + print_bold_spaced( + (s32)(func_802FB0DC(arg1) + arg1->unk38 + arg1->unk44 + sp34), + (s32)(func_802FB0E4(arg1)*arg1->unk4C + (arg1->unk3C + arg1->unk48)), + arg1->string_54 + ); + //draw sprite? + func_802FD360(arg1, gfx, mtx, vtx); +} + +void func_802FDC80(enum item_e item_id, struct8s *arg1){ + if(arg1->unk50){ + func_8033BD4C(arg1->unk50); //assetCache_free + arg1->unk50 = NULL; + } +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_763D0/func_802FDCB8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_763D0/func_802FDD0C.s") diff --git a/src/core2/code_76D90.c b/src/core2/code_76D90.c new file mode 100644 index 00000000..3028f7ac --- /dev/null +++ b/src/core2/code_76D90.c @@ -0,0 +1,266 @@ +#include +#include "functions.h" +#include "variables.h" + +#define _76D90_MAX(s,t) ((s < t)? t : s) +#define _76D90_MIN(s,t) ((s > t)? t : s) + +f32 time_getDelta(void); +f32 func_802FDE60(f32); +void timedFunc_set_1(f32, void (*)(s32), s32); +void timedFunc_set_2(f32, void (*)(s32,s32), s32, s32); +void item_inc(s32); +void func_80314AC8(s32); +void item_set(s32, s32); + + +f32 func_802FB0E4(s32); + +extern void *D_8036A010; +extern void *D_8036A014; +extern f32 D_8036A018[]; +extern Gfx D_8036A030[]; + + +extern s32 D_803815C0; +extern s32 D_803815C4; +extern f32 D_803815C8; +extern f32 D_803815CC; +extern f32 D_803815D0; +extern f32 D_803815D4; +extern f32 D_803815D8; +extern f32 D_803815DC; +extern f32 D_803815E0; +extern s32 D_803815E4; +extern s32 D_803815E8; +extern s32 D_803815EC; +extern struct8s D_803815F0; +extern s32 D_80381610; + + +/* rodata + !!! NOTE the second half of .rodata is already defined as .rodata + COMBINE IN subyaml/core2.us.v10.yaml +*/ +extern f64 D_803773B0; +extern f64 D_803773B8; +extern f64 D_803773C0; +extern f64 D_803773C8; + +void func_802FDD20(void) { + s32 phi_v1; + + D_803815CC = -272.0f; + D_803815C8 = 1.0f; + D_803815C0 = 0; + D_803815D8 = 60 * ((item_getCount(0x13) <= 0)? 0: item_getCount(0x13)-1); + D_803815DC = 0.0f; + D_803815E0 = 1.0f; + D_803815E8 = 0x50; +} + +void func_802FDDC4(s32 arg0, struct8s *arg1){ + if(D_8036A010){ + func_8033BD4C(D_8036A010); + D_8036A010 = NULL; + } + if(D_8036A014){ + func_8033BD4C(D_8036A014); + D_8036A014 = NULL; + } + D_803815E8 = 0x50; +} + +struct8s *func_802FDE2C(s32 arg0){ + func_802FDD20(); + D_803815D0 = 1.0f; + return &D_803815F0; +} + +f32 func_802FDE60(f32 arg0) { + f32 temp_f2; + f32 phi_f0; + + temp_f2 = (f32) ((f64) (D_803815D4 - 1.0f) * 60.0); + if (arg0 <= temp_f2) { + phi_f0 = temp_f2 - arg0; + } else { + phi_f0 = -(temp_f2 - arg0); + } + if ((f64) phi_f0 < 2.0) { + return temp_f2; + } + return arg0; +} + +#if 1 +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_76D90/func_802FDEE0.s") +#else +void func_802FDEE0(s32 arg0, struct8s *arg1, Gfx **arg2, Mtx **arg3, s32 *arg4){ + s32 sp134; + f32 sp130; + f32 sp124; + s32 phi_a1; + s32 phi_s4; + s32 phi_v0; + s32 phi_v1; + f64 phi_f24; + f32 temp_f30; + s32 i; + + if(!D_8036A010) + return; + + phi_a1 = (D_803815C0 == 2) ? ((D_8036A014) ? D_8036A014: D_8036A010) : D_8036A010; + //func_80347FC0(arg2, phi_a1, 0, 0, 0, 0, 0, 2, 2, &sp13C, &sp138); + func_8024C7B8(arg2, arg3); + gSPDisplayList((*arg2)++, D_8036A030); + phi_s4 = 2; + for(sp134 = 0; sp134 < phi_a1; sp134++){ + gDPPipeSync((*arg2)++); + if(D_803815C0 == 2){ + if(sp134 != 0){ + //func_80347FC0(arg2, D_8036A010, 0, 0, 0, 0, 0, phi_s4, phi_s4, &sp13C, &sp138); + gDPSetPrimColor((*arg2)++, 0, 0, 0x00, 0x00, 0x00, (0xFF - D_803815E4)& 0xFF); + } + else{ + gDPSetPrimColor((*arg2)++, 0, 0, 0x00, 0x00, 0x00, D_803815E4 & 0xFF); + } + } + else{ + if(D_803815D4 < D_8036A018[sp134]){ + gDPSetPrimColor((*arg2)++, 0, 0, 0x00, 0x00, 0x00, 0x50); + }else if(D_803815EC && (D_803815D4 - 1.0f) == D_8036A018[sp134]){ + gDPSetPrimColor((*arg2)++, 0, 0, 0x00, 0x00, 0x00, D_803815E8 & 0xFF); + }else{ + gDPSetPrimColor((*arg2)++, 0, 0, 0x00, 0x00, 0x00, 0xFF); + } + } + + + //if statements here + temp_f30 = 244.0f - ((f32) D_80276588 / 2.0f); + sp124 = (func_802FB0E4(arg1) + ((f32) D_8027658C / 2.0f)) - 246.0f; + guTranslate(*arg3, temp_f30 * 4.0f, sp124, 0); + gSPMatrix((*arg2)++, 0x80000000 + (*arg3)++, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); + + guRotate(*arg3, func_802FDE60(D_803815D8 + D_803815DC), 0, 0, 1.0f); + gSPMatrix((*arg2)++, 0x80000000 + (*arg3)++, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); + + guScale(*arg3, D_803815E0, D_803815E0, D_803815E0); + gSPMatrix((*arg2)++, 0x80000000 + (*arg3)++, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); + + guTranslate(*arg3, -temp_f30 * 4.0f, -sp124 * 4.0f, 0); + gSPMatrix((*arg2)++, 0x80000000 + (*arg3)++, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_MODELVIEW); + + phi_f24 = _76D90_MIN(_76D90_MAX(D_803815C8, 0.0),1.0); + sp134 = temp_f18 = ((f64) cosf((f32) ((f64) (*(void *)0x803815CC + sp110) * D_803773B0)) * (phi_f24 * D_803773B8) * D_803815D0); + gSPVertex((*arg2)++, *arg4, 4, 0); + do{ + for(phi_v0 = 0; phi_v0 < phi_s4; phi_v0++){ + // temp_f24 = (f32) sp13C * D_803815D0; + //(*arg4)->v.ob[0] = ((((temp_f24 * (f32) phi_v0) - (temp_f24 / 2.0f)) + temp_f14) * 4.0f); + // temp_f30_2 = (f32) sp138 * D_803815D0; + //(*arg4)->v.ob[1] = ((((temp_f30_2 * (f32) phi_v0) - (temp_f30_2 / 2.0f)) + temp_f14) * 4.0f); + // (*arg4)->unk4 = (u16)-0x14; + // (*arg4)->unk8 = (s16) (((sp13C - 1) * phi_v0) << 9); + // (*arg4)->unkA = (s16) (((sp138 - 1) * phi_v1) << 9); + // *arg4 = (void *) (*arg4 + 0x10); + //(*arg4)++ + }// loop43 + phi_v1++; + }while(phi_v1 != phi_s4); // loop42 + phi_a1 = (D_803815C0 == 2) ? ((D_8036A014) ? ++phi_s4: 1) : 6; + } + + + + + //L802FE7A0 + //gSP1Quadrangle((*arg2)++, 0, 1, 3, 2, 0); + gDPPipeSync((*arg2)++); + gDPSetTextureLUT((*arg2)++, G_TT_NONE); + gDPPipelineMode((*arg2)++, G_PM_NPRIMITIVE); + func_8024C904(arg2, arg3, arg4); + //L802FE7FC +} +#endif + +extern f64 D_803773E0; +void func_802FE844(s32 arg0, struct8s *arg1){ + f32 sp24; + s32 sp20; + s32 tmp; + + sp24 = time_getDelta(); + sp20 = func_802FB0D4(arg1); + if(sp20){ + D_803815D4 = itemPrint_getValue(arg0); + tmp = ((D_803815D4 - 1.0f) * 60.00000000 == func_802FDE60(D_803815D8)); + if(!D_80381610 && tmp && (D_803815D4 != 1.0f)) + func_8030E760(SFX_90_SWITCH_PRESS, 1.3f, 0x7FF8); + D_803815EC = (D_803815D4 == item_getCount(arg0)); + D_80381610 = tmp; + if(D_803815EC && D_80381610){ + D_803815E8 = _76D90_MIN(D_803815E8 + 0x10, 0xFF); + } + }//L802FE9A0 + //sp24 = time_getDelta(); + switch(sp20){ + case 1: + if(D_8036A010 == NULL) + D_8036A010 = assetcache_get(0x7DC); + break; + case 0: + func_802FDDC4(arg0, arg1); + break; + case 2: + switch(D_803815C0){ + case 0://L802FEA40 + if(D_803815EC){ + if(6.0f <= D_803815D4 && D_80381610 && D_803815E8 == 0xFF){ + D_803815C0 = 1; + D_803815DC = 20.0f; + func_8025A6EC(COMUSIC_18_HEALTH_UPGRADE, 28000); + }else{ + if(1.0f < D_803815D4 && !D_80381610){ + D_803815D8 += _76D90_MAX((((D_803815D4 - 1.0f) * 60.0 - D_803815D8) * sp24 * 3.0), 2.0); + } + } + } + break; + case 1://L802FEB70 + D_803815CC += 240.0f*sp24; + D_803815C8 -= sp24*0.4; + if(D_803815C8 < 0.0f){ + D_803815C0 = 2; + if(D_8036A014 == NULL){ + D_8036A014 = assetcache_get(0x7DD); + } + D_803815C4 = func_8023DB5C(); + D_803815E4 = 0; + D_803815E0 = 0.9999f; + func_803463D4(ITEM_13_EMPTY_HONEYCOMB, -6); + timedFunc_set_2(0.25f, (TFQM2)func_8025A6EC, COMUSIC_2B_DING_B, 28000); + func_803463D4(ITEM_14_HEALTH, 0); + timedFunc_set_1(1.25f, (TFQM1)item_inc, ITEM_15_HEALTH_TOTAL); + timedFunc_set_1(1.25f, (TFQM1)func_8030E484, SFX_3EA_UNKNOWN); + timedFunc_set_2(1.25f, (TFQM2)item_set, ITEM_14_HEALTH, item_getCount(ITEM_15_HEALTH_TOTAL)+1); + timedFunc_set_1(1.5f, (TFQM1)func_80314AC8, 1); + } + break; + case 2://L802FECD4 + D_803815E0 *= gu_sqrtf(D_803815E0); + D_803815DC *= 1.1; + D_803815E4 = _76D90_MIN((D_803815E4 + (400.0*sp24)), 255.0); + if(D_803815E0 < 0.1){ + func_802FDD20(); + func_802FDDC4(arg0, arg1); + } + break; + } + if(D_803815C0 == 1) + func_803463D4(ITEM_13_EMPTY_HONEYCOMB, 0); + break; + } +} diff --git a/src/core2/code_77E50.c b/src/core2/code_77E50.c new file mode 100644 index 00000000..ab33680a --- /dev/null +++ b/src/core2/code_77E50.c @@ -0,0 +1,38 @@ +#include +#include "functions.h" +#include "variables.h" + +extern s16 D_803A5D00[2][0xF660]; + +void func_802FEDE0(BKTextureList *texture_list, s32 indx, s32 x_offset, s32 y_offset){ + u16 *sp24; + u16 *frame_buffer_ptr; + s32 y; + s32 x; + + sp24 = (u16*)func_802EA620(texture_list) + indx*32*32; + frame_buffer_ptr = D_803A5D00[func_8024BDA0()]; + for(y = 0; y < 32; y++){//L802FEE60 + for(x = 0; x < 32; x++){//L802FEE68 + sp24[32*(31 - y) + x] = frame_buffer_ptr[(y_offset + y)*D_80276588 + (x_offset + x)] | 1; //framebuffer to texture??? + }; + }; +} + +//framebuffer_to_texture_list +void func_802FEF48(BKModelBin *model_bin){ + BKTextureList *texture_list; + s32 x, y; + + texture_list = func_8033A104(model_bin); + osInvalDCache((void *)D_803A5D00[func_8024BDA0()], D_80276588 * D_8027658C*2); + + for(y = 0; y < 8; y++){//L802FEFEC + for(x = 0; x < 10; x++){ + //get textures from framebuffer??? + func_802FEDE0(texture_list, 10*y + x, 32*x + (D_80276588 - 10*32)/2, (s32)32*y + (D_8027658C - 8*32)/2); + } + }; + + osWriteBackDCacheAll(); +} diff --git a/src/core2/code_78100.c b/src/core2/code_78100.c new file mode 100644 index 00000000..9e363858 --- /dev/null +++ b/src/core2/code_78100.c @@ -0,0 +1,14 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_78100/func_802FF090.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_78100/func_802FF358.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_78100/func_802FF3B8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_78100/func_802FFA10.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_78100/func_802FFA50.s") diff --git a/src/core2/code_78E50.c b/src/core2/code_78E50.c new file mode 100644 index 00000000..7931b063 --- /dev/null +++ b/src/core2/code_78E50.c @@ -0,0 +1,218 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_802FB0E4(struct8s*); + +/* .code */ +extern s32 D_8036A260[]; +extern Gfx D_8036A278[]; + +/* .bss */ +extern void *D_80381EB0[2]; +extern f32 D_80381EB8; +extern f32 D_80381EBC; +extern s32 D_80381EC0; +extern s32 D_80381EC4; +extern u8 D_80381EC8[]; +extern struct8s D_80381ED0; + +/* .code */ +s32 func_802FFDE0(s32 arg0){ + return D_8036A260[arg0/4]; +} + +s32 func_802FFE04(void){ + s32 v1; + v1 = (5 < itemPrint_getValue(ITEM_14_HEALTH)) ? 5 : itemPrint_getValue(ITEM_14_HEALTH); + return (5 - v1)*4; +} + +struct8s *func_802FFE4C(s32 item_id){ + s32 i; + + D_80381EB8 = 1.0f; + D_80381EBC = (f32)func_802FFE04(); + D_80381EC0 = func_802FFDE0((s32)D_80381EBC); + D_80381EC4 = 0; + for(i = 0; i < 2; i++){ + D_80381EB0[i] = NULL; + } + return &D_80381ED0; +} + +void func_802FFED4(s32 item_id, struct8s *arg1){ + s32 i; + for(i = 0; i < 2; i++){ + if(D_80381EB0[i] != NULL){ + func_8033BD4C(D_80381EB0[i]); + D_80381EB0[i] = NULL; + } + }; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_78E50/func_802FFF34.s") +// void func_802FFF34(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mtx, Vtx **vtx) { +// s32 sp10C; +// Vtx *sp108; +// s32 sp104; +// s32 spF0; +// s32 spEC; +// s32 spE8; +// s32 spE4; +// s32 spE0; +// s32 spDC; +// Gfx *temp_a0; +// Gfx *temp_v0; +// Gfx *temp_v0_2; +// Gfx *temp_v0_3; +// Gfx *temp_v0_4; +// Gfx *temp_v0_6; +// Gfx *temp_v0_7; +// Gfx *temp_v0_8; +// Gfx *temp_v0_9; +// f32 temp_f12; +// f32 temp_f14; +// f32 temp_f18; +// f32 temp_f18_2; +// f32 temp_f18_3; +// f32 temp_f18_4; +// f32 temp_f2; +// s32 temp_a1; +// s32 temp_lo; +// s32 temp_s2; +// s32 temp_s5; +// s32 temp_t4; +// s32 temp_t6; +// s32 temp_v0_5; +// s32 var_a1; +// s32 var_a1_2; +// s32 var_fp; +// s32 var_s2; +// s32 var_s4; +// s32 var_s6; +// s32 var_s7; +// s32 var_v0; +// s32 var_v0_2; +// s32 var_v1; + +// sp10C = -1; +// sp108 = *vtx; +// D_80381EC8[0] = 0; +// if (itemPrint_getValue() >= 10) { +// var_a1 = 9; +// } else { +// var_a1 = itemPrint_getValue(item_id); +// } +// strIToA(&D_80381EC8, var_a1); +// print_bold_spaced(0x4E, (s32) (func_802FB0E4(arg1) + -16.0f + 4.0f), D_80381EC8); +// if (*(&D_80381EB0 + (D_80381EC4 * 4)) != 0) { +// gSPDisplayList((*gfx)++, D_8036A278); +// func_8024C7B8(gfx, mtx); +// gDPPipeSync((*gfx)++); +// gDPSetCombineLERP((*gfx)++, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, TEXEL0, TEXEL0, 0, PRIMITIVE, 0); +// gDPSetPrimColor((*gfx)++, 0, 0, 0x00, 0x00, 0x00, 0xFF); +// var_s2 = 2; +// do { +// func_80348044(gfx, D_80381EB0[D_80381EC4], (s32) D_80381EBC % 4, 0, 0, 0, 0, var_s2, var_s2, &spF0, &spEC, &spE8, &spE4, &spE0, &spDC, &sp10C); +// temp_v0_5 = sp104 + 4; +// if (((*vtx - sp108) & 0xF) == 0) { +// var_s4 = 0; +// var_s6 = 2; +// sp104 = 0; +// var_s7 = 6; +// temp_t4 = (sp10C + 1) * 4; +// if (temp_t4 >= 0x11) { +// var_v0 = 0x10; +// } else { +// var_v0 = temp_t4; +// } +// if (temp_t4 >= 0x11) { +// var_a1_2 = 0x10; +// } else { +// var_a1_2 = temp_t4; +// } +// //var_a1_2 = n +// // temp_a0->words.w0 = ((((var_a1_2 * 0x10) - 1) | (var_v0 << 0xA)) & 0xFFFF) | 0x04000000; +// var_fp = 4; +// // temp_a0->words.w1 = *vtx; +// gSPVertex((*gfx)++, *vtx, var_a1_2, var_v0); +// } else { +// var_s4 = temp_v0_5 * 2; +// var_s6 = var_s4 + 2; +// var_s7 = var_s4 + 6; +// var_fp = var_s4 + 4; +// sp104 = temp_v0_5; +// } +// temp_s5 = (s32) ((40.0f - ((f32) D_80276588 / 2.0f)) + (f32) spE0); +// temp_f12 = (f32) temp_s5; +// temp_f14 = (f32) (s32) (((((f32) D_8027658C / 2.0f) - func_802FB0E4(arg1)) - -16.0f) - (f32) spDC); +// for(var_v1 = 0; var_v1 != var_s2; var_v1++){ +// temp_f2 = (f32) var_v1; +// temp_s2 = var_s2 - 1; +// for(var_v0_2 = 0; var_v0_2 != temp_s2; var_v0_2++) { +// (*vtx)->v.ob[0] = ((((f32) spF0 * D_80381EB8 * (f32) var_v0_2) - (((f32) spE8 * D_80381EB8) / 2.0f)) + temp_f12) * 4.0f; +// (*vtx)->v.ob[1] = (((((f32) spE4 * D_80381EB8) / 2.0f) - ((f32) spEC * D_80381EB8 * temp_f2)) + temp_f14) * 4.0f; +// (*vtx)->v.ob[2] = -20; +// (*vtx)->v.tc[0] = (s16) (((spF0 - 1) * var_v0_2) << 6); +// (*vtx)->v.tc[1] = (s16) (((spEC - 1) * var_v1) << 6); +// (*vtx)++; +// } +// temp_f18_3 = D_80381EB8; +// var_s2 = temp_s2 + 1; +// (*vtx)->v.ob[0] = (s16) (s32) (((((f32) spF0 * D_80381EB8 * (f32) var_v0_2) - (((f32) spE8 * D_80381EB8) / 2.0f)) + temp_f12) * 4.0f); +// (*vtx)->v.ob[1] = (s16) (s32) ((((((f32) spE4 * D_80381EB8) / 2.0f) - ((f32) spEC * D_80381EB8 * temp_f2)) + temp_f14) * 4.0f); +// (*vtx)->v.ob[2] = -20; +// (*vtx)->v.tc[0] = (s16) (((spF0 - 1) * var_v0_2) << 6); +// (*vtx)->v.tc[1] = (s16) (((spEC - 1) * var_v1) << 6); +// (*vtx)++; +// } +// temp_v0_6 = *gfx; +// temp_t6 = (var_s4 & 0xFF) << 0x10; +// temp_a1 = var_s7 & 0xFF; +// *gfx = temp_v0_6 + 8; +// temp_v0_6->words.w1 = temp_t6 | (temp_a1 << 8) | (var_fp & 0xFF); +// temp_v0_6->words.w0 = temp_t6 | ((var_s6 & 0xFF) << 8) | temp_a1 | 0xB1000000; +// } while (sp10C != 0); +// gDPPipeSync((*gfx)++); +// gDPSetTextureLUT((*gfx)++, G_TT_NONE); +// gDPPipelineMode((*gfx)++, G_PM_NPRIMITIVE); +// func_8024C904(gfx, mtx); +// } +// } + +void func_803005BC(s32 item_id, struct8s *arg1) { + s32 var_v0; + s32 sp20; + s32 sp1C; + s32 sp18; + + sp20 = (s32) ((f32) func_802FFE04() - D_80381EBC); + switch (func_802FB0D4(arg1)) { + case 1: + if (D_80381EB0[D_80381EC4] == NULL) { + D_80381EB0[D_80381EC4] = assetcache_get(D_8036A260[(s32) D_80381EBC / 5]); + } + break; + + case 0: + func_802FFED4(item_id, arg1); + break; + + case 2: + if (sp20 != 0) { + var_v0 = (sp20 >= 0) ? sp20 : -sp20; + D_80381EBC = D_80381EBC + (0.5 * (sp20 / var_v0)); + } + sp18 = func_802FFDE0((s32)D_80381EBC); + if (sp18 != D_80381EC0) { + D_80381EC4 = NOT(D_80381EC4); + if (D_80381EB0[D_80381EC4] != 0) { + func_8033BD4C(D_80381EB0[D_80381EC4]); + } + D_80381EB0[D_80381EC4] = assetcache_get(sp18); + D_80381EC0 = sp18; + } + break; + } +} diff --git a/src/core2/code_79C80.c b/src/core2/code_79C80.c new file mode 100644 index 00000000..f20c83ab --- /dev/null +++ b/src/core2/code_79C80.c @@ -0,0 +1,130 @@ +#include +#include "functions.h" +#include "variables.h" + +extern s32 D_80276588; +extern s32 D_8027658C; + +extern BKSprite * D_8036A910; +extern BKSprite * D_8036A914; +extern Gfx D_8036A918[]; + +extern f32 D_80377480; + +extern f32 D_80381EFC; +extern s32 D_80381F00; +extern f32 D_80381F04; +extern f32 D_80381F08[]; +extern struct8s D_80381F30; + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_79C80/func_80300C10.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_79C80/func_80300C70.s") + +struct8s *func_80300CD8(s32 item_id){ + func_80300C10(); + D_80381EFC = D_80377480; + return &D_80381F30; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_79C80/func_80300D0C.s") +#else +void func_80300D0C(enum item_e item_id, struct8s *arg1, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + int i; + int tmp_v1; + s32 spEC; + s32 spE8; + int tmp_v0; + f32 f18; + f32 f14; + f32 f20; + s32 spD4 = 0; + s32 s6; + + if(D_8036A910 == NULL) return; + + gSPDisplayList((*gfx)++, D_8036A918); + func_80347FC0(gfx, D_8036A910, 0, 0, 0, 0, 0, 2, 2, &spEC, &spE8); + func_8024C7B8(gfx, mtx); + //loop over each honeycomb piece + for(i = D_80381F00-1; i >= 0; i--){//L80300E40 + if(i != 0 && (i + 1 != D_80381F00 || D_80381F00 & 1) + ){ + if(i & 1){ + s6 = i +1; + } + else{ + s6 = i -1; + } + } + else{//L80300E84 + s6 = i; + } + gDPPipeSync((*gfx)++); + if(i < D_80381F04){ + if( 8.0f < i && i < D_80381F04 - 8.0f){ + if(!spD4){ + func_80347FC0(gfx, D_8036A914, 0, 0, 0, 0, 0, 2, 2, &spEC, &spE8); + spD4 = TRUE; + } + }//L80300F38 + gDPSetPrimColor((*gfx)++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF); + } + else{//L80300F58 + gDPSetPrimColor((*gfx)++, 0, 0, 0xFF, 0xFF, 0xFF, 0x78); + } + f20 = i*0xd + (96.0f - (f32)D_80276588/2); + f14 = (f32)D_8027658C/2 - func_802FB0E4(arg1); + f14 = (f14 - D_80381F08[s6]) - -48.0f; + f14 = (i & 1) ? f14 + 5.75 : f14 - 5.75; + gSPVertex((*gfx)++, *vtx, 4, 0); + for(tmp_v1 = 0; tmp_v1 < 2; tmp_v1++){//L8030101C + for(tmp_v0 = 0; tmp_v0 < 2; tmp_v0++){//L80301030 + f18 = spEC * D_80381EFC*tmp_v0 - spEC * D_80381EFC/2; + f18 += f20; + f18 *= 4.0f; + (*vtx)->v.ob[0] = f18; + + f18 = spE8 * D_80381EFC/2 - spE8 * D_80381EFC*tmp_v1; + f18 += f14; + f18 *= 4.0f; + (*vtx)->v.ob[1] = f18; + (*vtx)->v.ob[2] = -0x14; + (*vtx)->v.tc[0] = ((spEC - 1) *tmp_v0) << 6; + (*vtx)->v.tc[1] = ((spE8 - 1) *tmp_v1) << 6; + (*vtx)++; + } + } + gSP1Quadrangle((*gfx)++, 0, 1, 3, 2, 0); + } + gDPPipeSync((*gfx)++); + gDPSetTextureLUT((*gfx)++, G_TT_NONE); + gDPPipelineMode((*gfx)++, G_PM_NPRIMITIVE); + func_8024C904(gfx, mtx); +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_79C80/func_803012B8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_79C80/func_803012F8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_79C80/func_80301348.s") + +//BREAK??? + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_79C80/func_803016F0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_79C80/func_80301754.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_79C80/func_8030179C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_79C80/func_803017D0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_79C80/func_80301CE0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_79C80/func_80301D24.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_79C80/func_80301DBC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_79C80/func_80301DE4.s") diff --git a/src/core2/code_7AF80.c b/src/core2/code_7AF80.c new file mode 100644 index 00000000..42c7cca8 --- /dev/null +++ b/src/core2/code_7AF80.c @@ -0,0 +1,1734 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + +extern f32 ml_vec3f_distance_squared(f32[3], f32[3]); +extern f32 func_802586B0(f32[3], f32[3]); + +extern f32 func_803243D0(struct56s *arg0, f32 arg1[3]); +extern void func_802CAF14(u32*, s32, bool); +extern void func_8032D510(Cube *, Gfx **, Mtx **, Vtx **); +extern ActorProp *func_803322F0(Cube *, ActorMarker *, f32, s32, s32 *); +extern Struct66s *func_803319C0(Cube *cube, f32 position[3], f32 radius, f32 arg2[3], u32 flags); +extern Struct66s *func_80331638(Cube *cube, f32 volume_p1[3], f32 volume_p2[3], f32 radius, f32 arg2[3], s32, u32 flags); +typedef struct { + s32 unk0; + NodeProp *unk4; +} Struct_core2_7AF80_0; + +typedef struct{ + s32 unk0[3]; + s32 unkC; + u32 unk10_31: 28; + u32 unk10_3: 3; + u32 unk10_0: 1; + // u8 pad10[0x4]; +} Struct_core2_7AF80_2; + +typedef struct { + s32 unk0; //count + s32 unk4; + Struct_core2_7AF80_2 *unk8; +} Struct_core2_7AF80_1; + + +void cube_positionToIndices(s32 arg0[3], f32 arg1[3]); +void func_80308984(void); +void func_80308D2C(Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80308F0C(Cube *cube); +void func_80308EC8(void); + +/* .data */ + +extern void *D_8036ABA0; +extern void *D_8036ABA4; + +extern ActorInfo D_803675F0; +extern ActorInfo D_80367838; + +extern s32 sSpawnableActorSize; //0x8036A9B0 +extern ActorSpawn *sSpawnableActorList; //0x8036A9B4 + +extern s32 D_8036A9B8; +extern Struct_core2_7AF80_1 *D_8036A9BC; +extern Struct_core2_7AF80_1 *D_8036A9C0; +extern s32 D_8036A9C4; +extern Struct_core2_7AF80_1 *D_8036A9C8; +extern Struct_core2_7AF80_1 *D_8036A9CC; +extern s32 D_8036A9D0; +extern Struct_core2_7AF80_1 *D_8036A9D4; +extern Struct_core2_7AF80_1 *D_8036A9D8; + +extern UNK_TYPE(s32) D_8036A9DC; +extern UNK_TYPE(void *) D_8036A9E0; +extern u8 D_8036A9E4[]; +extern s16 D_8036ABD4; + + + +extern s16 D_8036ABAC[]; +extern s16 D_8036ABC0[]; + +/* .rodata */ + +/* .bss */ +extern struct { + Cube *cube_list; + f32 unk4; + s32 min[3]; + s32 max[3]; + s32 stride[2]; + s32 cubeCnt; + s32 unk2C; + s32 width[3]; + // s32 unk34; + // s32 unk38; + Cube *unk3C; + Cube *unk40; + s32 unk44; +} D_80381FA0; + +extern u8 D_80381FE8[]; +extern s32 D_803820B8[]; //ActorProp *, (maybe Prop *) +extern s32 D_8038213C; +extern s32 D_80382148; +extern s16 D_80382150[]; +extern u32 D_803821E0[0x5B]; + + +/* .code */ +void func_80301F10(Cube *cube, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + func_80308F0C(cube); + func_8032D510(cube, gfx, mtx, vtx); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80301F50.s") +#else +void func_80301F50(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s32 arg5[3]) { + s32 sp54; + s32 sp50; + s32 var_s1; + Cube *var_s0; + Cube *sp44; + Cube *var_fp; + + sp44 = D_80381FA0.cube_list + arg4[1]*D_80381FA0.stride[0]; + for(sp50 = arg4[1]; sp50 < arg3[1]; sp50++) { + var_fp = sp44 + arg4[0]; + for(sp54 = arg4[0]; sp54 < arg3[0]; sp54++) { + + var_s0 = var_fp + arg4[2]*D_80381FA0.stride[1]; + for(var_s1 = arg4[2]; var_s1 < arg3[2]; var_s1++) { + if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) { + func_80301F10(var_s0, gfx, mtx, vtx); + } + var_s0 += D_80381FA0.stride[1]; + } + + var_s0 = var_fp + arg5[2]*D_80381FA0.stride[1]; + for(var_s1 = arg5[2]; var_s1 >= arg3[2]; var_s1--) { + if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) { + func_80301F10(var_s0, gfx, mtx, vtx); + } + var_s0 -= D_80381FA0.stride[1]; + } + var_fp++; + } + + var_fp = sp44 + arg5[0]; + for(sp54 = arg5[0]; sp54 >= arg3[0]; sp54--) { + var_s0 = var_fp + arg4[2]*D_80381FA0.stride[1]; + for(var_s1 = arg4[2]; var_s1 < arg3[2]; var_s1++) { + if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) { + func_80301F10(var_s0, gfx, mtx, vtx); + } + var_s0 += D_80381FA0.stride[1]; + } + + var_s0 = var_fp + arg5[2]*D_80381FA0.stride[1]; + for(var_s1 = arg5[2]; var_s1 >= arg3[2]; var_s1--) { + if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) { + func_80301F10(var_s0, gfx, mtx, vtx); + } + var_s0 -= D_80381FA0.stride[1]; + } + var_fp--; + } + sp44 += D_80381FA0.stride[0]; + } + + sp44 = D_80381FA0.cube_list + arg5[1]*D_80381FA0.stride[0]; + for(sp50 = arg5[1]; sp50 >= arg3[1]; sp50--) { + + var_fp = sp44 + arg4[0]; + for(sp54 = arg4[0]; sp54 < arg3[0]; sp54++) { + + var_s0 = var_fp + arg4[2]*D_80381FA0.stride[1]; + for(var_s1 = arg4[2]; var_s1 < arg3[2]; var_s1++) { + if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) { + func_80301F10(var_s0, gfx, mtx, vtx); + } + var_s0 += D_80381FA0.stride[1]; + } + + var_s0 = var_fp + arg5[2]*D_80381FA0.stride[1]; + for(var_s1 = arg5[2]; var_s1 >= arg3[2]; var_s1--) { + if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) { + func_80301F10(var_s0, gfx, mtx, vtx); + } + var_s0 -= D_80381FA0.stride[1]; + } + var_fp++; + } + + var_fp = sp44 + arg5[0]; + for(sp54 = arg5[0]; sp54 >= arg3[0]; sp54--) { + + var_s0 = var_fp + arg4[2]*D_80381FA0.stride[1]; + for(var_s1 = arg4[2]; var_s1 < arg3[2]; var_s1++) { + if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) { + func_80301F10(var_s0, gfx, mtx, vtx); + } + var_s0 += D_80381FA0.stride[1]; + } + + var_s0 = var_fp + arg5[2]*D_80381FA0.stride[1]; + for(var_s1 = arg5[2]; var_s1 >= arg3[2]; var_s1--) { + if ((var_s0->prop2Cnt != 0) && func_8024D9B0(var_s0) != 0) { + func_80301F10(var_s0, gfx, mtx, vtx); + } + var_s0 -= D_80381FA0.stride[1]; + } + var_fp--; + } + sp44 -= D_80381FA0.stride[0]; + } +} +#endif + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80302634.s") +#else +void func_80302634(Gfx **gfx, Mtx **mtx, Vtx **vtx, s32 arg3[3], s32 arg4[3], s32 arg5[3]) { + s32 sp54; + s32 sp50; + s32 var_s1; + Cube *var_s0; + Cube *sp44; + Cube *var_fp; + + sp44 = D_80381FA0.cube_list + arg4[1]*D_80381FA0.stride[0]; + for(sp50 = arg4[1]; sp50 < arg3[1]; sp50++) { + var_s0 = sp44 + arg4[2]*D_80381FA0.stride[1]; + for(sp54 = arg4[2]; sp54 < arg3[2]; sp54++) { + var_fp = var_s0 + arg4[0]; + for(var_s1 = arg4[0]; var_s1 < arg3[0]; var_s1++) { + if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) { + func_80301F10(var_fp, gfx, mtx, vtx); + } + var_fp++; + } + + var_fp = var_s0 + arg5[0]; + for(var_s1 = arg5[0]; var_s1 >= arg3[0]; var_s1--) { + if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) { + func_80301F10(var_fp, gfx, mtx, vtx); + } + var_fp--; + } + var_s0 += D_80381FA0.stride[1]; + } + + var_s0 = sp44 + arg5[2]*D_80381FA0.stride[1]; + for(sp54 = arg5[2]; sp54 >= arg3[2]; sp54--) { + var_fp = var_s0 + arg4[0]; + for(var_s1 = arg4[0]; var_s1 < arg3[0]; var_s1++) { + if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) { + func_80301F10(var_fp, gfx, mtx, vtx); + } + var_fp++; + } + + var_fp = var_s0 + arg5[0]; + for(var_s1 = arg5[0]; var_s1 >= arg3[0]; var_s1--) { + if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) { + func_80301F10(var_fp, gfx, mtx, vtx); + } + var_fp--; + } + var_s0 -= D_80381FA0.stride[1]; + } + sp44 += D_80381FA0.stride[0]; + } + + sp44 = D_80381FA0.cube_list + arg5[1]*D_80381FA0.stride[0]; + for(sp50 = arg4[1]; sp50 >= arg3[1]; sp50--) { + var_s0 = sp44 + arg4[2]*D_80381FA0.stride[1]; + for(sp54 = arg4[2]; sp54 < arg3[2]; sp54++) { + var_fp = var_s0 + arg4[0]; + for(var_s1 = arg4[0]; var_s1 < arg3[0]; var_s1++) { + if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) { + func_80301F10(var_fp, gfx, mtx, vtx); + } + var_fp++; + } + + var_fp = var_s0 + arg5[0]; + for(var_s1 = arg5[0]; var_s1 >= arg3[0]; var_s1--) { + if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) { + func_80301F10(var_fp, gfx, mtx, vtx); + } + var_fp--; + } + var_s0 += D_80381FA0.stride[1]; + } + + var_s0 = sp44 + arg5[2]*D_80381FA0.stride[1]; + for(sp54 = arg5[2]; sp54 >= arg3[2]; sp54--) { + var_fp = var_s0 + arg4[0]; + for(var_s1 = arg4[0]; var_s1 < arg3[0]; var_s1++) { + if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) { + func_80301F10(var_fp, gfx, mtx, vtx); + } + var_fp++; + } + + var_fp = var_s0 + arg5[0]; + for(var_s1 = arg5[0]; var_s1 >= arg3[0]; var_s1--) { + if ((var_fp->prop2Cnt != 0) && func_8024D9B0(var_fp) != 0) { + func_80301F10(var_fp, gfx, mtx, vtx); + } + var_fp--; + } + var_s0 -= D_80381FA0.stride[1]; + } + sp44 -= D_80381FA0.stride[0]; + } +} +#endif + +void func_80302C94(Gfx **gfx, Mtx **mtx, Vtx **vtx) { + f32 sp6C[3]; + s32 sp60[3]; + f32 sp54[3]; + s32 i; + s32 sp44[3]; + s32 sp38[3]; + f32 temp_f18; + + if (!mapSpecificFlags_validateCRC1()) + return; + + func_8032D3A8(); + func_8024C5CC(sp6C); + func_8024C764(sp54); + func_80256664(sp54); + cube_positionToIndices(sp60, sp6C); + sp60[0] -= D_80381FA0.min[0];\ + sp60[1] -= D_80381FA0.min[1];\ + sp60[2] -= D_80381FA0.min[2]; + func_80308EC8(); + sp44[0] = sp44[1] = sp44[2] = 0; + sp38[0] = D_80381FA0.width[0] - 1;\ + sp38[1] = D_80381FA0.width[1] - 1;\ + sp38[2] = D_80381FA0.width[2] - 1; + if ((sp54[0]> 250.0f) && (sp54[0]< 290.0f)) { + if ((sp54[1] >= 225.0f) && (sp54[1] <= 315.0f)) { + sp44[0] = (sp60[0] > sp44[0]) ? sp60[0] - 1 : sp44[0]; + } else { + if ((sp54[1] >= 45.0f) && (sp54[1] <= 135.0f)) { + sp38[0] = sp60[0]; + } + } + + if ((sp54[0]>= 45.0f) && (sp54[0]<= 135.0f)) { + sp44[1] = sp60[1]; + } else if ((sp54[0]>= 225.0f) && (sp54[0]<= 315.0f)) { + sp38[1] = sp60[1]; + } + if ((sp54[1] >= 135.0f) && (sp54[1] <= 225.0f)) { + sp44[2] = (sp60[2] > sp44[2]) ? sp60[2] - 1 : sp44[2]; + } else if ((315.0f <= sp54[1]) || (sp54[1] <= 45.0f)) { + sp38[2] = sp60[2]; + } + } else { + if ((sp54[1] >= 225.0f) && (sp54[1] <= 315.0f)) { + sp44[0] = sp60[0]; + } else { + if ((sp54[1] >= 45.0f) && (sp54[1] <= 135.0f)) { + sp38[0] = sp60[0]; + } + } + + if ((sp54[0]>= 45.0f) && (sp54[0]<= 135.0f)) { + sp44[1] = sp60[1]; + } else if ((sp54[0]>= 225.0f) && (sp54[0]<= 315.0f)) { + sp38[1] = sp60[1]; + } + + if ((sp54[1] >= 135.0f) && (sp54[1] <= 225.0f)) { + sp44[2] = sp60[2]; + } else if ((315.0f <= sp54[1]) || (sp54[1] <= 45.0f)) { + sp38[2] = sp60[2]; + } + } + + for(i = 0; i < 3; i++){ + if(sp60[i] - sp44[i] >= 5){ + sp44[i] = sp60[i] - 4; + } + if(sp38[i] - sp60[i] >= 5){ + sp38[i] = sp60[i] + 4; + } + } + if (D_80381FA0.unk3C != NULL) { + func_8032D510(D_80381FA0.unk3C, gfx, mtx, vtx); + } + + if (D_80381FA0.unk40 != NULL) { + func_8032D510(D_80381FA0.unk40, gfx, mtx, vtx); + } + if (((45.0f <= sp54[1]) && (sp54[1] <= 135.0f)) || ((225.0f <= sp54[1]) && (sp54[1] <= 315.0f))) { + func_80301F50(gfx, mtx, vtx, &sp60, &sp44, &sp38); + } else { + func_80302634(gfx, mtx, vtx, &sp60, &sp44, &sp38); + } + func_80308D2C(gfx, mtx, vtx); +} + +void cube_positionToIndices(s32 indices[3], f32 position[3]) { + s32 i; + + for(i = 0; i < 3; i++){ + if (position[i] >= 0.0f) { + indices[i] = (s32) (position[i] / 1000.0f); + } else { + indices[i] = (s32) ((position[i] / 1000.0f) + -1.0f); + } + + if (indices[i] < D_80381FA0.min[i]) { + indices[i] = D_80381FA0.min[i]; + } + if (D_80381FA0.max[i] < indices[i]) { + indices[i] = D_80381FA0.max[i]; + } + } +} + +void cube_volumeToIndices(s32 min_indices[3], s32 max_indices[3], f32 vol_p1[3], f32 vol_p2[3], f32 margin) { + s32 i; + f32 phi_f12; + + + for(i = 0; i < 3; i++){ + phi_f12 = (vol_p1[i] <= vol_p2[i]) ? vol_p1[i] : vol_p2[i]; + if (0.0f <= (phi_f12 - margin)) { + min_indices[i] = (phi_f12 - margin) / 1000.0f; + } else { + min_indices[i] = (phi_f12 - margin) / 1000.0f + -1.0f; + } + if (min_indices[i] < D_80381FA0.min[i]) { + min_indices[i] = D_80381FA0.min[i]; + } + + phi_f12 = (vol_p2[i] <= vol_p1[i]) ? vol_p1[i] : vol_p2[i]; + + if ((phi_f12 + margin) >= 0.0f) { + max_indices[i] = (phi_f12 + margin) / 1000.0f; + } else { + max_indices[i] = (phi_f12 + margin) / 1000.0f + -1.0f; + } + + if (D_80381FA0.max[i] < max_indices[i]) { + max_indices[i] = D_80381FA0.max[i]; + } + } +} + +Cube *cube_atIndices(s32 arg0[3]) { + if( (arg0[0] < D_80381FA0.min[0]) || (arg0[1] < D_80381FA0.min[1]) || (arg0[2] < D_80381FA0.min[2]) + || (D_80381FA0.max[0] < arg0[0]) || (D_80381FA0.max[1] < arg0[1]) || (D_80381FA0.max[2] < arg0[2])) { + return D_80381FA0.unk3C; + } + return D_80381FA0.cube_list + (arg0[0] - D_80381FA0.min[0]) + (arg0[1] - D_80381FA0.min[1]) * D_80381FA0.stride[0] + (arg0[2] - D_80381FA0.min[2])*D_80381FA0.stride[1]; +} + +Cube *cube_atPosition_s32(s32 position[3]) { + s32 sp1C[3]; + s32 i; + // Cube *out; + s32 diff[3]; + + + for(i = 0; i < 3; i++){ + sp1C[i] = (position[i] >= 0) ? position[i]/1000 : position[i] / 1000 - 1; + } + if( (sp1C[0] < D_80381FA0.min[0]) || (sp1C[1] < D_80381FA0.min[1]) || (sp1C[2] < D_80381FA0.min[2]) + || (D_80381FA0.max[0] < sp1C[0]) || (D_80381FA0.max[1] < sp1C[1]) || (D_80381FA0.max[2] < sp1C[2]) + ){ + return D_80381FA0.unk3C; + } + diff[0] = sp1C[0] - D_80381FA0.min[0]; + diff[1] = sp1C[1] - D_80381FA0.min[1]; + diff[2] = sp1C[2] - D_80381FA0.min[2]; + return D_80381FA0.cube_list + + diff[0] + + diff[1]*D_80381FA0.stride[0] + + diff[2]*D_80381FA0.stride[1]; +} + +Cube *cube_atPosition_f32(f32 position[3]){ + s32 sp1C[3]; + + sp1C[0] = (s32)position[0]; + sp1C[1] = (s32)position[1]; + sp1C[2] = (s32)position[2]; + return cube_atPosition_s32(sp1C); +} + +Cube *func_8030364C(void){ + return D_80381FA0.unk40; +} + +Cube *func_80303658(void){ + return D_80381FA0.unk3C; +} + +void func_80303664(s32 arg0[3], s32 arg1[3]){ + arg0[0] = D_80381FA0.min[0]; + arg0[1] = D_80381FA0.min[1]; + arg0[2] = D_80381FA0.min[2]; + + arg1[0] = D_80381FA0.max[0]; + arg1[1] = D_80381FA0.max[1]; + arg1[2] = D_80381FA0.max[2]; +} + +//Struct66s * +void * func_803036A0(f32 volume_p1[3], f32 volume_p2[3], f32 arg2[3], u32 arg3) { + s32 cube_indx[3]; + s32 min[3]; + s32 max[3]; + void *temp_v0; + void *var_s5; + + var_s5 = NULL; + cube_volumeToIndices(&min, &max, volume_p1, volume_p2, D_80381FA0.unk4); + for(cube_indx[2] = min[2]; cube_indx[2] <= max[2]; cube_indx[2]++){ + for(cube_indx[1] = min[1]; cube_indx[1] <= max[1]; cube_indx[1]++){ + for(cube_indx[0] = min[0]; cube_indx[0] <= max[0]; cube_indx[0]++){ + temp_v0 = func_803311D4(cube_atIndices(cube_indx), volume_p1, volume_p2, arg2, arg3); + if (temp_v0 != NULL) { + var_s5 = temp_v0; + } + } + } + } + temp_v0 = func_803311D4(func_8030364C(), volume_p1, volume_p2, arg2, arg3); + if (temp_v0 != NULL) { + var_s5 = temp_v0; + } + return var_s5; +} + +void * func_80303800(f32 volume_p1[3], f32 volume_p2[3], f32 arg2[3], u32 arg3) { + s32 cube_indx[3]; + s32 min[3]; + s32 max[3]; + void *temp_v0; + void *var_s5; + + cube_volumeToIndices(&min, &max, volume_p1, volume_p2, D_80381FA0.unk4); + for(cube_indx[0] = min[0]; cube_indx[0] <= max[0]; cube_indx[0]++){ + for(cube_indx[1] = min[1]; cube_indx[1] <= max[1]; cube_indx[1]++){ + for(cube_indx[2] = min[2]; cube_indx[2] <= max[2]; cube_indx[2]++){ + temp_v0 = func_803311D4(cube_atIndices(cube_indx), volume_p1, volume_p2, arg2, arg3); + if (temp_v0 != NULL) { + return temp_v0; + } + } + } + } + temp_v0 = func_803311D4(func_8030364C(), volume_p1, volume_p2, arg2, arg3); + if (temp_v0 != NULL) { + return temp_v0; + } + return NULL; +} + +//Struct66s * +#ifndef NONMATCHING +void * func_80303960(f32 volume_p1[3], f32 volume_p2[3], f32 radius, f32 arg3[3], s32 arg4, u32 arg5); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80303960.s") +#else +void * func_80303960(f32 volume_p1[3], f32 volume_p2[3], f32 radius, f32 arg3[3], s32 arg4, u32 arg5) { + s32 cube_indx[3]; + s32 min[3]; + s32 max[3]; + void *temp_v0; + void *var_s5; + + var_s5 = NULL; + cube_volumeToIndices(min, max, volume_p1, volume_p2, radius + D_80381FA0.unk4); + for(cube_indx[0] = min[0]; cube_indx[0] <= max[0]; cube_indx[0]++){ + for(cube_indx[1] = min[1]; cube_indx[1] <= max[1]; cube_indx[1]++){ + for(cube_indx[2] = min[2]; cube_indx[2] <= max[2]; cube_indx[2]++){ + temp_v0 = func_80331638(cube_atIndices(cube_indx), volume_p1, volume_p2, radius, arg3, arg4, arg5); + if (temp_v0 != NULL) { + var_s5 = temp_v0; + } + } + } + } + temp_v0 = func_80331638(func_8030364C(), volume_p1, volume_p2, radius, arg3, arg4, arg5); + if (temp_v0 != NULL) { + var_s5 = temp_v0; + } + return var_s5; +} +#endif + +//Struct66s * +void * func_80303AF0(f32 position[3], f32 radius, f32 arg2[3], u32 arg3) { + s32 cube_indx[3]; + s32 min[3]; + s32 max[3]; + void *temp_v0; + void *var_s5; + + var_s5 = NULL; + cube_volumeToIndices(min, max, position, position, radius + D_80381FA0.unk4); + for(cube_indx[0] = min[0]; cube_indx[0] <= max[0]; cube_indx[0]++){ + for(cube_indx[1] = min[1]; cube_indx[1] <= max[1]; cube_indx[1]++){ + for(cube_indx[2] = min[2]; cube_indx[2] <= max[2]; cube_indx[2]++){ + temp_v0 = func_803319C0(cube_atIndices(cube_indx), position, radius, arg2, arg3); + if (temp_v0 != NULL) { + var_s5 = temp_v0; + } + } + } + } + temp_v0 = func_803319C0(func_8030364C(), position, radius, arg2, arg3); + if (temp_v0 != NULL) { + var_s5 = temp_v0; + } + return var_s5; +} + +void func_80303C54(Cube *cube, ActorMarker *marker, f32 arg2, s32 arg3, s32 *arg4, s32 *arg5) { + ActorProp *phi_s0; + + if(cube->prop2Cnt == 0) + return; + + *arg4 = 0; + while (*arg4 != -1){ + phi_s0 = func_803322F0(cube, marker, arg2, arg3, arg4); + if (phi_s0 != NULL) { + if (phi_s0->unk8_0 && phi_s0->marker->unk58 != NULL) { + if (phi_s0->marker->unk58(phi_s0->marker, marker) == 0) { + phi_s0 = NULL; + } + } + if (phi_s0 != NULL) { + D_803820B8[*arg5] = phi_s0; + *arg5 += 1; + } + } + }; +} + +void func_80303D78(ActorMarker *arg0, f32 arg1, UNK_TYPE(s32) arg2) { + s32 sp6C[3]; + s32 sp60[3]; + s32 sp5C; + f32 sp50[3]; + + sp5C = 0; + sp50[0] = (f32) arg0->propPtr->x; + sp50[1] = (f32) arg0->propPtr->y; + sp50[2] = (f32) arg0->propPtr->z; + cube_positionToIndices(sp60, sp50); + for(sp6C[2] = sp60[2] - 1; sp6C[2] <= sp60[2] + 1; sp6C[2]++){ + for(sp6C[1] = sp60[1] - 1; sp6C[1] <= sp60[1] + 1; sp6C[1]++){ + for(sp6C[0] = sp60[0] - 1; sp6C[0] <= sp60[0] + 1; sp6C[0]++){ + func_80303C54(cube_atIndices(sp6C), arg0, arg1, arg2, &D_8038213C, &sp5C); + } + } + } + func_80303C54(D_80381FA0.unk40, arg0, arg1, arg2, &D_8038213C, &sp5C); + D_803820B8[sp5C] = 0; +} + +void func_80303F38(void){ + int i; + + for(i = 0; i < 0x50; i++){ + D_80381FE8[i] = 1; + } +} + +void func_80303F6C(s32 indx, s32 arg1){ + D_80381FE8[indx] = arg1; +} + +#ifndef NONMATCHING +Prop *func_80303F7C(ActorMarker *arg0, f32 arg1, s32 arg2, s32 arg3); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80303F7C.s") +#else +ActorProp *func_80303F7C(ActorMarker *arg0, f32 arg1, s32 arg2, s32 arg3) { + s32 temp_v1; + s32 phi_a0; + + // phi_a0 = D_80382148; + if (arg3 == 0) { + func_80303D78(arg0, arg1, arg2); + D_80382148 = 0; + return 0; + } + else{ + phi_a0 = D_80382148; + temp_v1 = *(&D_803820B8 + phi_a0); + phi_a0++; + if (temp_v1 != 0) { + D_80382148 = phi_a0; + } + return temp_v1; + } +} +#endif + +ActorProp *func_80303FE4(ActorMarker *arg0, f32 arg1, s32 arg2) { + func_80303D78(arg0, arg1, arg2); + return D_803820B8[0]; +} + +void cubeList_free(void){ + Cube *iCube; + + for(iCube = D_80381FA0.cube_list; iCube < D_80381FA0.cube_list + D_80381FA0.cubeCnt; iCube++){ + cube_free(iCube); + } + free(D_80381FA0.cube_list); + + if(D_80381FA0.unk3C){ + cube_free(D_80381FA0.unk3C); + free(D_80381FA0.unk3C); + } + + if(D_80381FA0.unk40){ + cube_free(D_80381FA0.unk40); + free(D_80381FA0.unk40); + } + func_802CAEF4(D_8036A9E0); + D_8036A9E0 = NULL; +} + +void cubeList_init(void){ + int indx[3]; + int diff[3]; + Cube *iCube; + + func_80303F38(); + D_80381FA0.unk44 = 0; + func_803097AC(D_80381FA0.min, D_80381FA0.max); + D_80381FA0.unk2C = 0; + D_80381FA0.width[0] = D_80381FA0.max[0] - D_80381FA0.min[0] + 1; + D_80381FA0.width[1] = D_80381FA0.max[1] - D_80381FA0.min[1] + 1; + D_80381FA0.width[2] = D_80381FA0.max[2] - D_80381FA0.min[2] + 1; + D_80381FA0.stride[0] = D_80381FA0.width[0]; + D_80381FA0.stride[1] = D_80381FA0.stride[0]*D_80381FA0.width[1]; + D_80381FA0.cubeCnt = D_80381FA0.stride[1]*D_80381FA0.width[2]; + D_80381FA0.cube_list = (Cube *)malloc(D_80381FA0.cubeCnt*sizeof(Cube)); + for(indx[0] = D_80381FA0.min[0]; D_80381FA0.max[0] >= indx[0]; indx[0]++){ + for(indx[1] = D_80381FA0.min[1]; D_80381FA0.max[1] >= indx[1]; indx[1]++){ + for(indx[2] = D_80381FA0.min[2]; D_80381FA0.max[2] >= indx[2]; indx[2]++){ + diff[0] = indx[0] - D_80381FA0.min[0];\ + diff[1] = indx[1] - D_80381FA0.min[1];\ + diff[2] = indx[2] - D_80381FA0.min[2]; + iCube = D_80381FA0.cube_list + diff[0] + diff[1]*D_80381FA0.stride[0] + diff[2]*D_80381FA0.stride[1]; + iCube->x = indx[0]; + iCube->y = indx[1]; + iCube->z = indx[2]; + iCube->prop2Ptr = NULL; + iCube->prop1Ptr = NULL; + iCube->prop2Cnt = 0; + iCube->prop1Cnt = 0; + iCube->unk0_4 = 0; + } + } + }//L8030432C + D_80381FA0.unk3C = (Cube *)malloc(1*sizeof(Cube)); + D_80381FA0.unk3C->x = 16; + D_80381FA0.unk3C->y = 16; + D_80381FA0.unk3C->z = 16; + D_80381FA0.unk3C->prop2Ptr = NULL; + D_80381FA0.unk3C->prop1Ptr = NULL; + D_80381FA0.unk3C->prop2Cnt = 0; + D_80381FA0.unk3C->prop1Cnt = 0; + D_80381FA0.unk3C->unk0_4 = 0; + + + D_80381FA0.unk40 = (Cube *)malloc(1*sizeof(Cube)); + D_80381FA0.unk40->x = 16; + D_80381FA0.unk40->y = 16; + D_80381FA0.unk40->z = 16; + D_80381FA0.unk40->prop2Ptr = NULL; + D_80381FA0.unk40->prop1Ptr = NULL; + D_80381FA0.unk40->prop2Cnt = 0; + D_80381FA0.unk40->prop1Cnt = 0; + D_80381FA0.unk40->unk0_4 = 0; + + sSpawnableActorSize = 0; + sSpawnableActorList = NULL; + if(map_get() == MAP_21_CC_WITCH_SWITCH_ROOM){ + D_80381FA0.unk4 = 500.0f; + } + else if(map_get() == MAP_12_GV_GOBIS_VALLEY){ + D_80381FA0.unk4 = 500.0f; + } + else if(map_get() == MAP_7F_FP_WOZZAS_CAVE){ + D_80381FA0.unk4 = 500.0f; + } + else if(map_get() == MAP_D_BGS_BUBBLEGLOOP_SWAMP){ + D_80381FA0.unk4 = 700.0f; + } + else if(map_get() == MAP_7_TTC_TREASURE_TROVE_COVE){ + D_80381FA0.unk4 = 400.0f; + } + else if(map_get() == MAP_16_GV_RUBEES_CHAMBER){ + D_80381FA0.unk4 = 400.0f; + } + else if(map_get() == MAP_2_MM_MUMBOS_MOUNTAIN){ + D_80381FA0.unk4 = 250.0f; + } + else if(map_get() == MAP_27_FP_FREEZEEZY_PEAK){ + D_80381FA0.unk4 = 250.0f; + } + else if(map_get() == MAP_92_GV_SNS_CHAMBER){ + D_80381FA0.unk4 = 300.0f; + } + else{ + D_80381FA0.unk4 = 200.0f; + } + func_80320B24(func_803036A0, func_80303960, func_80303AF0); + D_8036A9E0 = func_802CAEBC(0xF0); + func_8032E070(); +} + +void func_803045CC(s32 arg0, s32 arg1){} + +void func_803045D8(void){} + +void func_803045E0(Cube *cube, Struct61s* file_ptr) { + s32 sp2C[3]; + + while(!func_8034AF98(file_ptr, 1)) { + if (func_8034B190(file_ptr, 0, sp2C, 3)) { + func_8034ADB4(file_ptr, sp2C, 3); + } else if (!func_8034B190(file_ptr, 2, &sp2C, 3) && func_8034AF98(file_ptr, 3) + ) { + func_8032EA24(file_ptr, cube); + } + } +} + +void cubeList_fromFile(Struct61s *file_ptr) { + s32 sp5C[3]; + s32 sp50[3]; + s32 sp44[3]; + Cube *cube; //should be cube + NodeProp *iPtr; + + func_8034B190(file_ptr, 1, sp50, 3); + func_8034ADB4(file_ptr, sp44, 3); + for(sp5C[0] = sp50[0]; sp5C[0] <= sp44[0]; sp5C[0]++){ + for(sp5C[1] = sp50[1]; sp5C[1] <= sp44[1]; sp5C[1]++){ + for(sp5C[2] = sp50[2]; sp5C[2] <= sp44[2]; sp5C[2]++){ + func_803045E0(cube_atIndices(sp5C), file_ptr); + } + } + } + func_8034AF98(file_ptr, 0); + func_802CAFA8(D_8036A9E0, 0); + for(sp5C[0] = sp50[0]; sp5C[0] <= sp44[0]; sp5C[0]++){ + for(sp5C[1] = sp50[1]; sp5C[1] <= sp44[1]; sp5C[1]++){ + for(sp5C[2] = sp50[2]; sp5C[2] <= sp44[2]; sp5C[2]++){ + cube = cube_atIndices(sp5C); + if (cube->unk0_4) { + for(iPtr = cube->prop1Ptr; iPtr < &cube->prop1Ptr[cube->unk0_4] ;iPtr++){ + if (!iPtr->unk6_0) { + func_802CAF14(D_8036A9E0, iPtr->unkA, 1); + } + } + } + } + } + } + func_80308984(); +} + +void func_803048E0(s32 arg0[3], s32 arg1[3], s32 arg2, s32 arg3, s32 arg4) { + Cube * var_s0; + + func_8032EE2C(arg0, arg3, arg4); + for(var_s0 = D_80381FA0.cube_list; var_s0 < D_80381FA0.cube_list + D_80381FA0.cubeCnt; var_s0++) { + func_8032EE80(var_s0); + } + func_8032F170(arg1, arg2); +} + +s32 func_80304984(s32 arg0, u32 *arg1) { + NodeProp *temp_v0; + + temp_v0 = func_803049CC(arg0, 0); + if (temp_v0 != 0) { + *arg1 = temp_v0->unk6_15; + return 1; + } + return 0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803049CC.s") + +NodeProp *func_80304C38(enum actor_e actor_id, Actor *arg1){ + s32 vec[3]; + s32 *phi_a1; + + if (arg1 != 0) { + vec[0] = arg1->position_x; + vec[1] = arg1->position_y; + vec[2] = arg1->position_z; + } + if (arg1 == 0) { + phi_a1 = NULL; + } else { + phi_a1 = vec; + } + return func_803049CC(actor_id, phi_a1); +} + +NodeProp *func_80304CAC(s32 arg0, f32 *arg1) { + s32 vec[3]; + + vec[0] = arg1[0]; + vec[1] = arg1[1]; + vec[2] = arg1[2]; + return func_803049CC(arg0, vec); +} + +NodeProp *func_80304D04(s32 arg0, s16 *arg1) { + s32 arr[3]; + + arr[0] = arg1[0]; + arr[1] = arg1[1]; + arr[2] = arg1[2]; + return func_803049CC(arg0, arr); +} + +s32 nodeprop_getRadius(NodeProp *arg0) { + return arg0->unk6_15; +} + +void func_80304D4C(NodeProp *arg0, s32 dst[3]) { + dst[0] = arg0->x; + dst[1] = arg0->y; + dst[2] = arg0->z; +} + +void nodeprop_getPosition(NodeProp *arg0, f32 arg1[3]) { + arg1[0] = arg0->x; + arg1[1] = arg0->y; + arg1[2] = arg0->z; +} + +u32 func_80304DA8(NodeProp *arg0) { + return arg0->unkC_31; +} + +s32 func_80304DB8(NodeProp *arg0) { + return arg0->unkC_22; +} + +s32 func_80304DD0(s32 arg0, s32 *arg1) { + NodeProp *temp_v0; + + temp_v0 = func_803049CC(arg0, 0, arg1); + if (temp_v0 != 0) { + arg1[0] = (s32) temp_v0->x; + arg1[1] = (s32) temp_v0->y; + arg1[2] = (s32) temp_v0->z; + return 1; + } + return 0; +} + +s32 func_80304E24(s32 arg0, f32 *arg1) { + s32 vec[3]; + + if (func_80304DD0(arg0, vec) == 0) { + return 0; + } + arg1[0] = vec[0]; + arg1[1] = vec[1]; + arg1[2] = vec[2]; + return 1; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80304E9C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80304ED0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80304FC4.s") + +s32 func_8030508C(s32 arg0, f32 arg1[3], s32 arg2) { + Cube *phi_s0; + s32 phi_s1; + + phi_s0 = D_80381FA0.cube_list; + phi_s1 = 0; + while(phi_s0 < &D_80381FA0.cube_list[D_80381FA0.cubeCnt]){ + phi_s1 += func_8032E5A8(phi_s0, arg0, (f32 *)(phi_s1*0xC + (s32)arg1), arg2 - phi_s1); + phi_s0++; + } + return phi_s1; +} + +bool func_8030515C(f32 arg0[3], s32 arg1, s32 arg2, f32 (*arg3)(f32[3], f32[3])) { + f32 sp50[20][3]; + f32 phi_f20; + s32 phi_s1; + s32 temp_v0; + f32 temp_f0; + + ml_vec3f_clear(arg0); + phi_f20 = 3.40282347e+38f; + temp_v0 = func_8030508C(arg1, sp50[0], 0x14); + if (temp_v0 == 0) { + return 0; + } + for(phi_s1 = 0; phi_s1 < temp_v0; phi_s1++){ + temp_f0 = arg3(arg2, sp50[phi_s1]); + if (temp_f0 < phi_f20) { + phi_f20 = temp_f0; + ml_vec3f_copy(arg0, sp50[phi_s1]); + } + } + + if (phi_f20 == 3.40282347e+38f) return 0; + + return 1; + +} + +bool func_80305248(f32 arg0[3], s32 arg1, s32 arg2){ + return func_8030515C(arg0, arg1, arg2, ml_vec3f_distance_squared); +} + +bool func_8030526C(f32 arg0[3], s32 arg1, s32 arg2){ + return func_8030515C(arg0, arg1, arg2, func_802586B0); +} + +bool func_80305290(UNK_TYPE(s32) arg0, UNK_TYPE(s32) arg1){ + Cube *phi_s0; + + phi_s0 = D_80381FA0.cube_list; + while (phi_s0 < &D_80381FA0.cube_list[D_80381FA0.cubeCnt]) { + if (func_8032E398(phi_s0, arg0, arg1) == 0) { + return 0; + } + phi_s0++; + } + return 1; +} + +bool func_80305344(s32 arg0, u32 *arg1) { + NodeProp *temp_v0; + + temp_v0 = func_803049CC(arg0, NULL); + if (temp_v0 != NULL) { + *arg1 = temp_v0->unkC_31; + return 1; + } + return 0; +} + +void spawnableActorList_new(void){ + sSpawnableActorList = malloc(0); + sSpawnableActorSize = 0; +} + +void spawnableActorList_free(void){ + free(sSpawnableActorList); + sSpawnableActorList = NULL; + sSpawnableActorSize = 0; +} + +void spawnableActorList_add(ActorInfo *arg0, Actor *(*arg1)(s32[3], s32, ActorInfo *, u32), u32 arg2){ + sSpawnableActorSize++; + sSpawnableActorList = realloc(sSpawnableActorList, sSpawnableActorSize*sizeof(ActorSpawn)); + sSpawnableActorList[sSpawnableActorSize - 1].infoPtr = arg0; + sSpawnableActorList[sSpawnableActorSize - 1].spawnFunc = arg1; + sSpawnableActorList[sSpawnableActorSize - 1].unk8 = arg2; +} + +void spawnableActorList_addIfMapVisited(ActorInfo *arg0, Actor *(*arg1)(s32[3], s32, ActorInfo *, u32), u32 arg2, enum map_e arg3){ + if( level_get() != LEVEL_6_LAIR + || (level_get() == LEVEL_6_LAIR && func_802D6A38(arg3)) + ){ + spawnableActorList_add(arg0, arg1, arg2); + } +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80305510.s") + +Actor * func_803055E0(enum actor_e arg0, s32 arg1[3], s32 arg2, s32 arg3, s32 arg4){ + Actor *actor = func_803056FC(arg0, arg1, arg2); + s16 *tmp; + s32 sp34[3]; + f32 sp28[3]; + + if(actor){ + tmp = func_80305510(arg3); + if(tmp){ + func_80304D4C(tmp, sp34); + actor->unk44_14 = func_80341D5C(arg1, sp34); + } + else{ + actor->unk44_14 = func_80341C78(arg1); + } + if(!(actor->unk44_14 < 0)){ + sp28[0] = (f32)arg1[0]; + sp28[1] = (f32)arg1[1]; + sp28[2] = (f32)arg1[2]; + actor->unk48 = func_803243D0(func_80342038(actor->unk44_14), sp28); + actor->marker->unk2C_2 = TRUE; + } + } + return actor; +} + + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803056FC.s") +#else +Actor *func_803056FC(enum actor_e arg0, s32 arg1[3], s32 arg2) { + s32 i; + + if (func_80320248() == 0) { + arg0 = ACTOR_4_BIGBUTT; + } + for(i=0; i < sSpawnableActorSize; i++){ + if(arg0 == sSpawnableActorList[i].infoPtr->actorId) + return sSpawnableActorList[i].spawnFunc(arg1, arg2, sSpawnableActorList[i].infoPtr, sSpawnableActorList[i].unk8); + } + return NULL; +} +#endif + +void func_8030578C(void){ + int i; + u32 sp40; + Cube *iCube; + + if(getGameMode() != GAME_MODE_7_ATTRACT_DEMO){ + osPiReadIo(0xE38, &sp40); + sp40 ^= 0x828A; + if( (sp40 & 0xffff) + && (sSpawnableActorList != NULL) + ){ + for(i = 0; i < sSpawnableActorSize - 1; i++){ + if(sSpawnableActorList[i].infoPtr == &D_80367838){ + sSpawnableActorList[i].infoPtr = &D_803675F0; + sSpawnableActorList[i].spawnFunc = actor_new; + sSpawnableActorList[i].unk8 = 0; + break; + } + } + } + }//L80305850 + for(iCube = D_80381FA0.cube_list; iCube < D_80381FA0.cube_list + D_80381FA0.cubeCnt; iCube++){ + func_80330208(iCube); + } +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803058C0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80305924.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80305990.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80305BD4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80305C30.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80305C84.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80305CD8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80305D14.s") + +void func_80305D38(void){ + D_8036A9BC = malloc(0); + D_8036A9B8 = 0; + + D_8036A9C8 = malloc(0); + D_8036A9C4 = 0; + + D_8036A9D4 = malloc(0); + D_8036A9D0 = 0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80305D94.s") +// void func_80305D94(void){ +// Struct_core2_7AF80_1 * i; +// s32 j; +// s32 k; +// if(D_8036A9BC != NULL){ +// for(i = D_8036A9BC; i < D_8036A9BC + D_8036A9B8; i++){ +// free(i->unk8); +// } +// free(D_8036A9BC); +// D_8036A9BC = NULL; +// D_8036A9B8 = 0; +// } + +// if(D_8036A9C8 != NULL){ +// for(j = 0; j < D_8036A9C4; j++){ +// free(D_8036A9C8[j].unk8); +// } +// free(D_8036A9C8); +// D_8036A9C8 = NULL; +// D_8036A9C4 = 0; +// } + +// if(D_8036A9D4 != NULL){ +// for(k = 0; k < (u32)D_8036A9D0; k++){ +// free(D_8036A9D4[k].unk8); +// } +// free(D_8036A9D4); +// D_8036A9D4 = NULL; +// D_8036A9D0 = 0; +// } +// } + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80305F04.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803062D0.s") + +void func_80306390(void){ + D_8036A9C0 = D_8036A9BC - 1; +} + +void func_803063A8(void){ + D_8036A9CC = D_8036A9C8 - 1; +} + +void func_803063C0(void){ + D_8036A9D8 = D_8036A9D4 - 1; +} + +Struct_core2_7AF80_1 *func_803063D8(s32 arg0) { + Struct_core2_7AF80_1 *phi_v1; + + D_8036A9C0++; + phi_v1 = D_8036A9C0; + while (D_8036A9C0 < &D_8036A9BC[D_8036A9B8]) { + if (arg0 == D_8036A9C0->unk4) { + return D_8036A9C0; + } + D_8036A9C0++; + } + return NULL; +} + +Struct_core2_7AF80_1 *func_8030644C(s32 arg0) { + Struct_core2_7AF80_1 *phi_v1; + + D_8036A9CC++; + phi_v1 = D_8036A9CC; + while (D_8036A9CC < &D_8036A9C8[D_8036A9C4]) { + if (arg0 == D_8036A9CC->unk4) { + return D_8036A9CC; + } + D_8036A9CC++; + } + return NULL; +} + +Struct_core2_7AF80_1 *func_803064C0(s32 arg0) { + Struct_core2_7AF80_1 *phi_v1; + + D_8036A9D8++; + phi_v1 = D_8036A9D8; + while (D_8036A9D8 < &D_8036A9D4[D_8036A9D0]) { + if (arg0 == D_8036A9D8->unk4) { + return D_8036A9D8; + } + D_8036A9D8++; + } + return NULL; +} + +bool func_80306534(Struct_core2_7AF80_1 *arg0, s32 arg1, s32 arg2[3], s32 arg3) { + Struct_core2_7AF80_2 *iPtr; + + for(iPtr = arg0->unk8; iPtr < &arg0->unk8[arg0->unk0]; iPtr++){ + if(((arg2[0] - iPtr->unk0[0])*(arg2[0] - iPtr->unk0[0]) + (arg2[2] - iPtr->unk0[2])*(arg2[2] - iPtr->unk0[2])) < ((arg3 + iPtr->unkC) * (arg3 + iPtr->unkC))) { + return TRUE; + } + } + return FALSE; +} + +void func_803065E4(s32 arg0, s32 position[3], s32 arg2, s32 arg3, s32 arg4) { + Struct_core2_7AF80_2 *temp_v1; + + func_80306390(); + while(func_803063D8(arg0) != NULL){ + if (func_80306534(D_8036A9C0, arg0, position, arg2)) { + D_8036A9C0->unk0++; + D_8036A9C0->unk8 = realloc(D_8036A9C0->unk8, D_8036A9C0->unk0 * sizeof(Struct_core2_7AF80_2)); + temp_v1 = &D_8036A9C0->unk8[D_8036A9C0->unk0 - 1]; + temp_v1->unk0[0] = position[0]; + temp_v1->unk0[1] = position[1]; + temp_v1->unk0[2] = position[2]; + temp_v1->unkC = arg2; + temp_v1->unk10_31 = arg3; + temp_v1->unk10_0 = arg4; + temp_v1->unk10_3 = 0; + return; + } + } + D_8036A9B8++; + D_8036A9BC = realloc(D_8036A9BC, D_8036A9B8*sizeof(Struct_core2_7AF80_1)); + D_8036A9BC[D_8036A9B8-1].unk0 = 1; + D_8036A9BC[D_8036A9B8-1].unk4 = arg0; + D_8036A9BC[D_8036A9B8-1].unk8 = malloc(sizeof(Struct_core2_7AF80_2)); + temp_v1 = (D_8036A9BC + D_8036A9B8-1)->unk8; + temp_v1->unk0[0] = position[0]; + temp_v1->unk0[1] = position[1]; + temp_v1->unk0[2] = position[2]; + temp_v1->unkC = arg2; + temp_v1->unk10_31 = arg3; + temp_v1->unk10_0 = arg4; + temp_v1->unk10_3 = 0; +} + +s32 func_80306840(s32 arg0){ + switch(arg0){ + case 0: break; + case 1: return 1; + case 2: return 2; + case 3: return 4; + } + return 7; +} + +void func_8030688C(s32 arg0, s32 position[3], s32 arg2, s32 arg3){ + Struct_core2_7AF80_2 *temp_v1; + + func_803063A8(); + while(func_8030644C(arg0) != NULL){ + if (func_80306534(D_8036A9CC, arg0, position, arg2)) { + D_8036A9CC->unk0++; + D_8036A9CC->unk8 = realloc(D_8036A9CC->unk8, D_8036A9CC->unk0 * sizeof(Struct_core2_7AF80_2)); + temp_v1 = &D_8036A9CC->unk8[D_8036A9CC->unk0 - 1]; + temp_v1->unk0[0] = position[0]; + temp_v1->unk0[1] = position[1]; + temp_v1->unk0[2] = position[2]; + temp_v1->unkC = arg2; + temp_v1->unk10_3 = func_80306840(arg3); + return; + } + } + D_8036A9C4++; + D_8036A9C8 = realloc(D_8036A9C8, D_8036A9C4*sizeof(Struct_core2_7AF80_1)); + D_8036A9C8[D_8036A9C4-1].unk0 = 1; + D_8036A9C8[D_8036A9C4-1].unk4 = arg0; + D_8036A9C8[D_8036A9C4-1].unk8 = malloc(sizeof(Struct_core2_7AF80_2)); + temp_v1 = (D_8036A9C8 + D_8036A9C4-1)->unk8; + temp_v1->unk0[0] = position[0]; + temp_v1->unk0[1] = position[1]; + temp_v1->unk0[2] = position[2]; + temp_v1->unkC = arg2; + temp_v1->unk10_3 = func_80306840(arg3); +} + +void func_80306AA8(s32 arg0, s32 position[3], s32 arg2){ + Struct_core2_7AF80_2 *temp_v1; + + func_803063C0(); + while(func_803064C0(arg0) != NULL){ + if (func_80306534(D_8036A9D8, arg0, position, arg2)) { + D_8036A9D8->unk0++; + D_8036A9D8->unk8 = realloc(D_8036A9D8->unk8, D_8036A9D8->unk0 * sizeof(Struct_core2_7AF80_2)); + temp_v1 = &D_8036A9D8->unk8[D_8036A9D8->unk0 - 1]; + temp_v1->unk0[0] = position[0]; + temp_v1->unk0[1] = position[1]; + temp_v1->unk0[2] = position[2]; + temp_v1->unkC = arg2; + temp_v1->unk10_3 = 0; + return; + } + } + D_8036A9D0++; + D_8036A9D4 = realloc(D_8036A9D4, D_8036A9D0*sizeof(Struct_core2_7AF80_1)); + D_8036A9D4[D_8036A9D0-1].unk0 = 1; + D_8036A9D4[D_8036A9D0-1].unk4 = arg0; + D_8036A9D4[D_8036A9D0-1].unk8 = malloc(sizeof(Struct_core2_7AF80_2)); + temp_v1 = (D_8036A9D4 + D_8036A9D0-1)->unk8; + temp_v1->unk0[0] = position[0]; + temp_v1->unk0[1] = position[1]; + temp_v1->unk0[2] = position[2]; + temp_v1->unkC = arg2; + temp_v1->unk10_3 = 0; +} + +bool func_80306C88(s32 arg0) { + Struct_core2_7AF80_1 *phi_v1; + + phi_v1 = D_8036A9BC; + while (phi_v1 < &D_8036A9BC[D_8036A9B8]) { + if (arg0 == phi_v1->unk4) { + return TRUE; + } + phi_v1++; + } + return FALSE; +} + +bool func_80306CE4(s32 arg0) { + Struct_core2_7AF80_1 *phi_v1; + + phi_v1 = D_8036A9C8; + while (phi_v1 < &D_8036A9C8[D_8036A9C4]) { + if (arg0 == phi_v1->unk4) { + return TRUE; + } + phi_v1++; + } + return FALSE; +} + +s32 func_80306D40(s32 arg0){ + Struct_core2_7AF80_1 *phi_v1 = D_8036A9C8 + arg0; + return phi_v1->unk4; +} + +bool func_80306D60(s32 arg0) { + Struct_core2_7AF80_1 *phi_v1; + + phi_v1 = D_8036A9D4; + while (phi_v1 < &D_8036A9D4[D_8036A9D0]) { + if (arg0 == phi_v1->unk4) { + return TRUE; + } + phi_v1++; + } + return FALSE; +} + +s32 func_80306DBC(s32 arg0){ + Struct_core2_7AF80_1 *phi_v1 = D_8036A9D4 + arg0; + return phi_v1->unk4; +} + +s32 func_80306DDC(Struct_core2_7AF80_2 *arg0) { + Struct_core2_7AF80_1 *phi_v1; + Struct_core2_7AF80_2 *phi_a0; + + phi_v1 = D_8036A9BC; + while(phi_v1 < &D_8036A9BC[D_8036A9B8]){ + phi_a0 = phi_v1->unk8; + while(phi_a0 < &phi_v1->unk8[phi_v1->unk0]){ + if (((phi_a0->unk0[1] - 150) < arg0->unk0[1]) && (arg0->unk0[1] < (phi_a0->unk0[1] + 150))) { + if ((((arg0->unk0[0] - phi_a0->unk0[0]) * (arg0->unk0[0] - phi_a0->unk0[0])) + ((arg0->unk0[2] - phi_a0->unk0[2]) * (arg0->unk0[2] - phi_a0->unk0[2]))) < (phi_a0->unkC * phi_a0->unkC)) { + return phi_v1 - D_8036A9BC; + } + } + phi_a0++; + } + phi_v1++; + } + return -1; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80306EF4.s") + +s32 func_80307164(Struct_core2_7AF80_2 *arg0) { + Struct_core2_7AF80_1 *phi_v1; + Struct_core2_7AF80_2 *phi_a0; + + phi_v1 = D_8036A9D4; + while(phi_v1 < &D_8036A9D4[D_8036A9D0]){ + phi_a0 = phi_v1->unk8; + while(phi_a0 < &phi_v1->unk8[phi_v1->unk0]){ + if ((((arg0->unk0[0] - phi_a0->unk0[0]) * (arg0->unk0[0] - phi_a0->unk0[0])) + ((arg0->unk0[2] - phi_a0->unk0[2]) * (arg0->unk0[2] - phi_a0->unk0[2]))) < (phi_a0->unkC * phi_a0->unkC)) { + return phi_v1 - D_8036A9D4; + } + phi_a0++; + } + phi_v1++; + } + return -1; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80307258.s") + +bool func_80307390(s32 arg0, s32 arg1) { + return (D_8036A9BC + arg0)->unk8[arg1].unk10_0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803073CC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80307504.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803077FC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80307948.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80307CA0.s") + +u32 func_80307E1C(void) { + Cube *phi_v0; + s32 i; + u32 phi_v1; + + phi_v1 = 0; + phi_v0 = D_80381FA0.cube_list; + while(phi_v0 < &D_80381FA0.cube_list[D_80381FA0.cubeCnt]){ + i = 0; + while(i < phi_v0->prop1Cnt){ + if (phi_v1 < phi_v0->prop1Ptr[i].unk10_31) { + phi_v1 = phi_v0->prop1Ptr[i].unk10_31; + } + i++; + } + phi_v0++; + } + return phi_v1; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80307EA8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803080C8.s") + +UNK_TYPE(s32) func_80308224(void){ + return D_8036A9DC; +} + +void func_80308230(s32 arg0) { + Cube *iCube; + for(iCube = D_80381FA0.cube_list; iCube < D_80381FA0.cube_list + D_80381FA0.cubeCnt; iCube++){ + if (arg0 == 0) { + func_8032D158(iCube); + } else { + func_8032D120(iCube); + } + } +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803082D8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803083B0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_803084F0.s") + +void func_80308658(Struct_core2_7AF80_1 *arg0, s32 arg1) { + Struct_core2_7AF80_1 * i; + + if(arg0 == NULL) + return; + + for(i = arg0; i < arg0 + arg1; i++){ + i->unk8 = defrag(i->unk8); + } +} + +void func_803086B4(void) { + s32 phi_s1; + Cube *cube; + Prop *prop; + NodeProp *node; + + + cube = &D_80381FA0.cube_list[D_80381FA0.unk44]; + for(phi_s1 = 0xB4; phi_s1 > 0; phi_s1--){ + if (cube->prop2Cnt != 0) { + if (cube->prop2Ptr != NULL) { + prop = cube->prop2Ptr; + cube->prop2Ptr = defrag(cube->prop2Ptr); + if (prop != cube->prop2Ptr) { + func_80330104(cube); + phi_s1 -= 5; + } + } + } + if (cube->prop1Cnt != 0) { + if (cube->prop1Ptr != NULL) { + node = cube->prop1Ptr; + cube->prop1Ptr = defrag(cube->prop1Ptr); + if (node != cube->prop1Ptr) { + phi_s1 -= 5; + } + } + } + D_80381FA0.unk44++; + cube++; + if (D_80381FA0.unk44 >= D_80381FA0.cubeCnt) { + D_80381FA0.unk44 = 0; + cube = D_80381FA0.cube_list; + } + }; + if (func_8023DB5C() & 1) { + if (D_8036ABA0 != NULL) { + D_8036ABA0 = defrag(D_8036ABA0); + } + + if (D_8036ABA4 != NULL) { + D_8036ABA4 = defrag(D_8036ABA4); + } + + if (D_8036A9BC != NULL) { + D_8036A9BC = defrag(D_8036A9BC); + } + + if (D_8036A9C8 != NULL) { + D_8036A9C8 = defrag(D_8036A9C8); + } + + if (D_8036A9D4 != NULL) { + D_8036A9D4 = defrag(D_8036A9D4); + } + + if (sSpawnableActorList != NULL) { + sSpawnableActorList = defrag(sSpawnableActorList); + } + } else { + func_80308658(D_8036A9BC, D_8036A9B8); + func_80308658(D_8036A9C8, D_8036A9C4); + func_80308658(D_8036A9D4, D_8036A9D0); + } +} + +bool func_803088C8(s32 arg0) { + s32 i; + + for(i = 0; D_8036ABAC[i] != -1 && arg0 != D_8036ABAC[i] && arg0 != D_8036ABC0[i]; i++){ + } + + return (D_8036ABAC[i] == -1) ? FALSE : TRUE; +} + +void func_8030895C(s32 arg0){ + D_80382150[D_8036ABD4] = arg0; + D_8036ABD4++; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80308984.s") +#else +void func_80308984(void) { + Cube *iCube; + s16 temp_s4; + s32 sp54; + s32 sp50; + NodeProp *iNode; + s32 i; + Cube *jCube; + NodeProp *jNode; + + + + D_8036ABD4 = 0; + sp54 = 0xF4240; + sp50 = 0; + for(i = 0; (u32)D_8036ABAC[i] != -1; i++){ + sp54 = (D_8036ABAC[i] < sp54)? D_8036ABAC[i] : sp54; + sp50 = (sp50 < D_8036ABAC[i])? D_8036ABAC[i] : sp50; + } + for(iCube = D_80381FA0.cube_list; iCube < D_80381FA0.cube_list + D_80381FA0.cubeCnt; iCube++){ + for(iNode = iCube->prop1Ptr; iNode < iCube->prop1Ptr + iCube->prop1Cnt; iNode++){ + if (iNode->unk6_6 == 6 && !iNode->unk6_0){ + if((iNode->unk8 >= (u32)sp54) && ((u32)sp50 >= iNode->unk8)) { + for(i = 0; iNode->unk8 != (u32)D_8036ABAC[i] && -1 != (u32)D_8036ABAC[i]; i++){ + } + if(-1 != (u32)D_8036ABAC[i]){ + temp_s4 = D_8036ABD4; + func_8030895C(iCube - D_80381FA0.cube_list); + func_8030895C(0); + for(jCube = iCube; jCube < D_80381FA0.cube_list + D_80381FA0.cubeCnt; jCube++){ + for(jNode = jCube->prop1Ptr; jNode < jCube->prop1Ptr + jCube->prop1Cnt; jNode++){ + if( + jNode->unk6_6 == 6 + && !jNode->unk6_0 + && jNode->unk8 == D_8036ABC0[i] + ) { + func_8030895C(jCube - D_80381FA0.cube_list); + D_80382150[temp_s4]++; + } + } + } + } + } + } + } + } +} +#endif + +void func_80308D2C(Gfx **gfx, Mtx **mtx, Vtx **vtx) { + s32 phi_s4; + s32 phi_s0; + s32 sp54[3]; + Cube *temp_s3; + s32 temp_lo; + + func_8032F464(1); + phi_s4 = 0; + if ((s32) D_8036ABD4 > 0) { + do { + if (!func_80308F54(D_80382150[phi_s4])) { + temp_s3 = &D_80381FA0.cube_list[D_80382150[phi_s4]]; + if (func_8024D8F4(temp_s3)) { + func_8024C5F0(sp54); + temp_lo = cube_atPosition_s32(sp54) - D_80381FA0.cube_list; + for(phi_s0 = 0; (phi_s0 < D_80382150[phi_s4 + 1]) && (temp_lo != D_80382150[phi_s0 + 2]); phi_s0++) { + } + if (phi_s0 < (s32) D_80382150[phi_s4 + 1]) { + func_80301F10(temp_s3, gfx, mtx, vtx); + } + } + } + phi_s4 += D_80382150[phi_s4 + 1] + 2; + } while (phi_s4 < (s32) D_8036ABD4); + } + func_8032F464(0); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_7AF80/func_80308EC8.s") +#else +void func_80308EC8(void){ + s32 i; + for(i = 0; i < 0x5B; i++){ + D_803821E0[i] = 0; + } +} +#endif + +void func_80308F0C(Cube *cube) { + s32 *temp_v1; + s32 indx; + + indx = cube - D_80381FA0.cube_list; + D_803821E0[indx >> 5] |= 1 << (indx & 0x1F); +} + +bool func_80308F54(s32 cube_index) { + return D_803821E0[cube_index >> 5] & (1 << (cube_index & 0x1F))? TRUE: FALSE; +} diff --git a/src/core2/code_82000.c b/src/core2/code_82000.c new file mode 100644 index 00000000..1cce21a9 --- /dev/null +++ b/src/core2/code_82000.c @@ -0,0 +1,549 @@ +#include +#include "functions.h" +#include "variables.h" + +extern UNK_TYPE(s32) func_802E8E88(BKCollisionList *, BKVertexList *, f32[3], f32[3], f32, f32[3], s32, s32); +extern UNK_TYPE(s32) func_802E92AC(BKCollisionList *, BKVertexList *, f32[3], f32, f32[3], s32); +extern UNK_TYPE(s32) func_802EC394(BKMeshList *, UNK_TYPE(s32), UNK_TYPE(s32), f32, UNK_TYPE(s32), UNK_TYPE(s32), UNK_TYPE(s32)); +extern void func_802EC458(BKVertexList *, s32[3], s32[3]); + + +BKCollisionTri *func_80309B48(f32 arg0[3], f32 arg1[3], f32 arg2[3], s32 arg3) ; + +typedef struct { + s16 map_id; //enum map_e + s16 model1_id; //enum asset_e level_model_id + s16 model2_id; //enum asset_e level2_model_id + s16 unk6[3]; + s16 unkC[3]; + // u8 pad12[0x2]; + f32 unk14; +}Struct_core2_82000_0; + +/* .data */ +Struct_core2_82000_0 D_8036ABE0[] = { + {MAP_1_SM_SPIRAL_MOUNTAIN, 0x14CF, 0x14D0, {1, 0, 1}, {-3, -4, -2}, 1.0f}, + {MAP_2_MM_MUMBOS_MOUNTAIN, 0x14AA, 0x14AB, {1, 0, 2}, {-2, 0, -2}, 1.0f}, + {MAP_5_TTC_BLUBBERS_SHIP, 0x146F, 0x1470, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_6_TTC_NIPPERS_SHELL, 0x146D, 0x146E, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_7_TTC_TREASURE_TROVE_COVE, 0x146B, 0x146C, {11, 2, 12}, {-12, -4, -5}, 1.0f}, + {MAP_8F_TTC_SHARKFOOD_ISLAND, 0x1473, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_A_TTC_SANDCASTLE, 0x1471, 0x1472, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_B_CC_CLANKERS_CAVERN, 0x14ED, 0x14EE, {0, 0, 0}, {0, -2, -1}, 1.0f}, + {MAP_C_MM_TICKERS_TOWER, 0x14AC, 0x14AD, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_D_BGS_BUBBLEGLOOP_SWAMP, 0x14D1, 0x14D2, {0, 1, 1}, {-1, -1, -1}, 1.0f}, + {MAP_E_MM_MUMBOS_SKULL, 0x14AE, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_10_BGS_MR_VILE, 0x14D3, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_11_BGS_TIPTUP, 0x14D4, 0x14D5, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_12_GV_GOBIS_VALLEY, 0x1474, 0x1475, {4, 0, 4}, {-4, -4, -5}, 1.0f}, + {MAP_92_GV_SNS_CHAMBER, 0x147E, 0, {0, 1, 0}, {0, -1, 0}, 1.0f}, + {MAP_13_GV_MEMORY_GAME, 0x1476, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_14_GV_SANDYBUTTS_MAZE, 0x1478, 0x1479, {0, 0, 1}, {0, -2, 0}, 1.0f}, + {MAP_15_GV_WATER_PYRAMID, 0x147A, 0x147B, {0, 1, 0}, {0, 0, -1}, 1.0f}, + {MAP_16_GV_RUBEES_CHAMBER, 0x147C, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_1A_GV_INSIDE_JINXY, 0x147D, 0, {0, 1, 1}, {0, 0, 0}, 1.0f}, + {MAP_1B_MMM_MAD_MONSTER_MANSION, 0x147F, 0x1480, {2, 0, 2}, {-3, 1, -2}, 1.0f}, + {MAP_1C_MMM_CHURCH, 0x1486, 0x1487, {0, 0, 0}, {0, -1, 0}, 1.0f}, + {MAP_1D_MMM_CELLAR, 0x1482, 0x149B, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_1E_CS_START_NINTENDO, 0x149D, 0x14A1, {0, 1, 0}, {0, -1, 0}, 1.0f}, + {MAP_1F_CS_START_RAREWARE, 0x149E, 0x14A0, {-1, -1, 1}, {1, 1, 1}, 1.0f}, + {MAP_20_CS_END_NOT_100, 0x14A9, 0x14A5, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_21_CC_WITCH_SWITCH_ROOM, 0x14EF, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_22_CC_INSIDE_CLANKER, 0x14F0, 0x14F1, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_23_CC_GOLDFEATHER_ROOM, 0x14F2, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_24_MMM_TUMBLARS_SHED, 0x1488, 0, {0, 1, 0}, {0, -1, 0}, 1.0f}, + {MAP_25_MMM_WELL, 0x1495, 0x1496, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_26_MMM_NAPPERS_ROOM, 0x1485, 0x149A, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_27_FP_FREEZEEZY_PEAK, 0x14C8, 0x14C9, {2, 0, 2}, {-1, -1, -2}, 1.0f}, + {MAP_28_MMM_EGG_ROOM, 0x1489, 0x148A, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_29_MMM_NOTE_ROOM, 0x148B, 0x148C, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_2A_MMM_FEATHER_ROOM, 0x148D, 0x148E, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_2B_MMM_SECRET_CHURCH_ROOM, 0x1483, 0x1484, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_2C_MMM_BATHROOM, 0x148F, 0x1490, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_2D_MMM_BEDROOM, 0x1491, 0x1492, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_2E_MMM_HONEYCOMB_ROOM, 0x1493, 0x1494, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_2F_MMM_WATERDRAIN_BARREL, 0x1481, 0x1497, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_30_MMM_MUMBOS_SKULL, 0x14AE, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_8D_MMM_INSIDE_LOGGO, 0x1498, 0x1499, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_31_RBB_RUSTY_BUCKET_BAY, 0x14B0, 0x14B1, {8, 0, 3}, {-2, -8, -7}, 1.0f}, + {MAP_8B_RBB_ANCHOR_ROOM, 0x14C5, 0x14C6, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_34_RBB_ENGINE_ROOM, 0x14B2, 0x14B3, {0, 0, 0}, {0, -3, 0}, 1.0f}, + {MAP_35_RBB_WAREHOUSE, 0x14B4, 0x14B5, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_36_RBB_BOATHOUSE, 0x14B6, 0x14B7, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_37_RBB_CONTAINER_1, 0x14B8, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_38_RBB_CONTAINER_3, 0x14BA, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_39_RBB_CREW_CABIN, 0x14BD, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_3A_RBB_BOSS_BOOM_BOX, 0x14BE, 0x14BF, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_3B_RBB_STORAGE_ROOM, 0x14C1, 0x14C2, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_3C_RBB_KITCHEN, 0x14C3, 0x14C4, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_3D_RBB_NAVIGATION_ROOM, 0x14C0, 0x14C7, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_3E_RBB_CONTAINER_2, 0x14B9, 0, {0, 0, 0}, {0, 1, 0}, 1.0f}, + {MAP_3F_RBB_CAPTAINS_CABIN, 0x14BB, 0x14BC, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_40_CCW_HUB, 0x14D8, 0x14E3, {0, 0, 0}, {0, -3, 0}, 1.0f}, + {MAP_41_FP_BOGGYS_IGLOO, 0x14CA, 0x14CE, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_7F_FP_WOZZAS_CAVE, 0x14CC, 0x14CD, {0, 0, 0}, {0, -1, 0}, 1.0f}, + {MAP_43_CCW_SPRING, 0x14D9, 0x14E4, {1, 0, 1}, {-1, -5, 0}, 1.0f}, + {MAP_44_CCW_SUMMER, 0x14DA, 0x14E5, {1, 0, 1}, {-1, -5, 0}, 1.0f}, + {MAP_45_CCW_AUTUMN, 0x14DB, 0x14E6, {1, 0, 1}, {-1, -6, 0}, 1.0f}, + {MAP_46_CCW_WINTER, 0x14DC, 0x14E7, {1, 0, 1}, {-1, -5, 0}, 1.0f}, + {MAP_47_BGS_MUMBOS_SKULL, 0x14AE, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_48_FP_MUMBOS_SKULL, 0x14AE, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_4A_CCW_SPRING_MUMBOS_SKULL, 0x14AE, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_4B_CCW_SUMMER_MUMBOS_SKULL, 0x14AE, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_4C_CCW_AUTUMN_MUMBOS_SKULL, 0x14AE, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_4D_CCW_WINTER_MUMBOS_SKULL, 0x14AE, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_53_FP_CHRISTMAS_TREE, 0x14CB, 0, {2, 1, 2}, {-2, -1, -2}, 1.0f}, + {MAP_5A_CCW_SUMMER_ZUBBA_HIVE, 0x14DD, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_5B_CCW_SPRING_ZUBBA_HIVE, 0x14DD, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_5C_CCW_AUTUMN_ZUBBA_HIVE, 0x14DD, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_5E_CCW_SPRING_NABNUTS_HOUSE, 0x14DE, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_5F_CCW_SUMMER_NABNUTS_HOUSE, 0x14DE, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_60_CCW_AUTUMN_NABNUTS_HOUSE, 0x14DE, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_61_CCW_WINTER_NABNUTS_HOUSE, 0x14DE, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_62_CCW_WINTER_HONEYCOMB_ROOM, 0x14E0, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_63_CCW_AUTUMN_NABNUTS_WATER_SUPPLY, 0x14E1, 0x14E2, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_64_CCW_WINTER_NABNUTS_WATER_SUPPLY, 0x14E1, 0x14E2, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_65_CCW_SPRING_WHIPCRACK_ROOM, 0x14DF, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_66_CCW_SUMMER_WHIPCRACK_ROOM, 0x14DF, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_67_CCW_AUTUMN_WHIPCRACK_ROOM, 0x14DF, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_68_CCW_WINTER_WHIPCRACK_ROOM, 0x14DF, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_69_GL_MM_LOBBY, 0x14F3, 0x150B, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_6A_GL_TTC_AND_CC_PUZZLE, 0x14F4, 0x150C, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_6B_GL_180_NOTE_DOOR, 0x14F5, 0x1510, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_6C_GL_RED_CAULDRON_ROOM, 0x14F6, 0x150D, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_6D_GL_TTC_LOBBY, 0x14F7, 0x1512, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_6E_GL_GV_LOBBY, 0x14F8, 0x14A8, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_6F_GL_FP_LOBBY, 0x14F9, 0x14FA, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_74_GL_GV_PUZZLE, 0x14FD, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_70_GL_CC_LOBBY, 0x14FB, 0x1507, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_75_GL_MMM_LOBBY, 0x14FE, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_7A_GL_CRYPT, 0x14FF, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_71_GL_STATUE_ROOM, 0x1500, 0x150E, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_72_GL_BGS_LOBBY, 0x1501, 0x1511, {1, 0, 1}, {0, -2, -1}, 1.0f}, + {MAP_76_GL_640_NOTE_DOOR, 0x1502, 0x1508, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_77_GL_RBB_LOBBY, 0x1503, 0x1509, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_78_GL_RBB_AND_MMM_PUZZLE, 0x1504, 0x150A, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_79_GL_CCW_LOBBY, 0x1505, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_80_GL_FF_ENTRANCE, 0x1506, 0x1514, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_93_GL_DINGPOT, 0x150F, 0x1513, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_90_GL_BATTLEMENTS, 0x14FC, 0x1515, {6, 2, 7}, {-6, -3, -5}, 1.0f}, + {MAP_7B_CS_INTRO_GL_DINGPOT_1, 0x150F, 0, {0, 0, 0}, {0, -1, 0}, 1.6666666f}, + {MAP_7C_CS_INTRO_BANJOS_HOUSE_1, 0x14A2, 0, {0, 0, 0}, {0, 0, 0}, 1.6666666f}, + {MAP_7D_CS_SPIRAL_MOUNTAIN_1, 0x14CF, 0x14D0, {0, 0, 2}, {0, -4, -2}, 1.0f}, + {MAP_7E_CS_SPIRAL_MOUNTAIN_2, 0x14CF, 0x14D0, {0, 0, 2}, {0, -4, -2}, 1.0f}, + {MAP_81_CS_INTRO_GL_DINGPOT_2, 0x150F, 0, {0, 0, 0}, {0, -1, 0}, 1.6666666f}, + {MAP_82_CS_ENTERING_GL_MACHINE_ROOM, 0x150F, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_83_CS_GAME_OVER_MACHINE_ROOM, 0x150F, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_84_CS_UNUSED_MACHINE_ROOM, 0x150F, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_85_CS_SPIRAL_MOUNTAIN_3, 0x14CF, 0x14D0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_86_CS_SPIRAL_MOUNTAIN_4, 0x14CF, 0x14D0, {0, 0, 0}, {0, -4, 0}, 1.0f}, + {MAP_87_CS_SPIRAL_MOUNTAIN_5, 0x14A6, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_88_CS_SPIRAL_MOUNTAIN_6, 0x14CF, 0x14D0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_94_CS_INTRO_SPIRAL_7, 0x14CF, 0x14D0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_98_CS_END_SPIRAL_MOUNTAIN_1, 0x149F, 0x14A3, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_99_CS_END_SPIRAL_MOUNTAIN_2, 0x149F, 0x14A3, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_95_CS_END_ALL_100, 0x14A9, 0x14A5, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_89_CS_INTRO_BANJOS_HOUSE_2, 0x14A2, 0x14A4, {0, 0, 0}, {0, 0, 0}, 1.6666666f}, + {MAP_8A_CS_INTRO_BANJOS_HOUSE_3, 0x14A2, 0x14A4, {0, 0, 0}, {0, 0, 0}, 1.6666666f}, + {MAP_96_CS_END_BEACH_1, 0x14A9, 0x14A5, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_97_CS_END_BEACH_2, 0x14A9, 0x14A5, {2, 0, -3}, {4, 0, -1}, 1.0f}, + {MAP_91_FILE_SELECT, 0x14A2, 0x14A4, {0, 0, 0}, {0, 0, 0}, 1.6666666f}, + {MAP_8C_SM_BANJOS_HOUSE, 0x14A2, 0x14A4, {0, 0, 0}, {0, 0, 0}, 1.0f}, + {MAP_8E_GL_FURNACE_FUN, 0x14E8, 0, {0, 0, 0}, {0, 0, 0}, 1.0f}, + 0 +}; + +/* .rodata */ + +/* .bss */ +struct { + void *unk0; + void *unk4; + BKCollisionList *unk8; + BKCollisionList *unkC; + BKModel *unk10; + BKModel *unk14; + BKModelBin *unk18; + BKModelBin *unk1C; + s32 unk20; + struct5Bs *unk24; + Struct_core2_82000_0 *unk28; + u8 unk2C; + u8 unk2D; + u8 unk2E; + f32 unk30; +}D_80382350; + +/* .code */ +Struct_core2_82000_0 *func_80308F90(enum map_e map_id){ + Struct_core2_82000_0 *i_ptr; + + for(i_ptr = D_8036ABE0; i_ptr->map_id != 0; i_ptr++){ + if(map_id == i_ptr->map_id){ + return i_ptr; + } + } + return NULL; +} + +f32 func_80308FDC(f32 arg0[3], u32 arg1) { + s32 phi_s2; + f32 sp70[3]; + f32 sp64[3]; + f32 sp58[3]; + s32 temp_s1; + s32 phi_s1; + + sp64[0] = arg0[0]; + sp64[1] = arg0[1]; + sp64[2] = arg0[2]; + sp64[1] += 200.0f; + + sp58[0] = arg0[0]; + sp58[1] = arg0[1]; + sp58[2] = arg0[2]; + sp58[1] -= 2000.0f; + if (func_80309B48(&sp64, &sp58, &sp70, arg1)) { + return sp58[1]; + } + phi_s2 = 150; + phi_s1 = 1000; + do{ + sp64[0] = arg0[0]; + sp64[1] = arg0[1]; + sp64[2] = arg0[2]; + sp64[0] += randf2(-1.0f, 1.0f); + sp64[1] += (f32) phi_s2; + sp64[2] += randf2(-1.0f, 1.0f); + sp58[0] = arg0[0]; + sp58[1] = arg0[1]; + sp58[2] = arg0[2]; + sp58[0] += randf2(-1.0f, 1.0f); + sp58[1] -= (f32) phi_s1; + sp58[2] += randf2(-1.0f, 1.0f); + if (func_80309B48(&sp64, &sp58, &sp70, arg1)) { + return sp58[1]; + } + phi_s1 += 2000; + phi_s2 += 300; + }while(phi_s1!= 51000); + return 0.0f; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_82000/func_803091D4.s") +// void func_803091D4(Gfx **gfx, Mtx **mtx, Vtx **vtx){ +// if( func_80320708() +// && levelSpecificFlags_validateCRC2() +// && func_80320248() +// ){ +// if(func_8030A068() == 0x14cf){ +// func_8033A45C(1, 0); +// func_8033A45C(2, 1); +// } + +// switch(map_get()) +// { + +// } +// } +// } + +void func_80309628(Gfx **gfx, Mtx **mtx, Vtx **vtx) { + s32 temp_a0; + + if (D_80382350.unk1C != NULL) { + if (map_get() == MAP_1D_MMM_CELLAR) { + func_8033A45C(1, (func_80326EEC(0x191) != NULL) ? 0 : 1); + } + set_model_render_mode(2); + if (D_80382350.unk4 != 0) { + func_8033A494(D_80382350.unk4); + } + func_8033A388(D_80382350.unk2C, D_80382350.unk2D, D_80382350.unk2E, 0xFF); + func_803391A4(gfx, mtx, NULL, NULL, D_80382350.unk28->unk14, NULL, D_80382350.unk1C); + func_802F7BC0(gfx, mtx, vtx); + } +} + + +void func_80309704(s32 arg0, s32 arg1, s32 arg2){} + +s32 func_80309714(void){ + return D_80382350.unk8->unk12; +} + +f32 func_80309724(f32 arg0[3]){ + return func_80308FDC(arg0, 0x1e0000); +} + +BKModel *func_80309744(s32 arg0){ + return (arg0) ? D_80382350.unk14 : D_80382350.unk10; +} + +s32 func_80309764(s32 arg0){ + if(arg0 == 0) + return D_80382350.unk18; + if(arg0 == 1) + return D_80382350.unk1C; + return 0; +} + +s32 func_80309794(void){ + return D_80382350.unk20; +} + +struct5Bs *func_803097A0(void){ + return D_80382350.unk24; +} + + +void func_803097AC(s32 arg0[3], s32 arg1[3]) { + func_802EC458(func_8033A148(D_80382350.unk18), arg0, arg1); + func_8033ECD8(arg0, arg1, 0x3E8); + arg0[0] = arg0[0] + D_80382350.unk28->unk6[0]; + arg0[1] = arg0[1] + D_80382350.unk28->unk6[1]; + arg0[2] = arg0[2] + D_80382350.unk28->unk6[2]; + arg1[0] = arg1[0] + D_80382350.unk28->unkC[0]; + arg1[1] = arg1[1] + D_80382350.unk28->unkC[1]; + arg1[2] = arg1[2] + D_80382350.unk28->unkC[2]; +} + +void func_80309888(s32 arg0[3], s32 arg1[3]) { + s32 i; + + func_802EC458(func_8033A148(D_80382350.unk18), arg0, arg1); + for(i = 0; i < 3; i++){ + arg0[i] *= D_80382350.unk30; + arg1[i] *= D_80382350.unk30; + } +} + +void func_80309998(s32 arg0[3], s32 arg1[3]) { + s32 i, j; + s32 sp3C[3]; + s32 sp30[3]; + + func_802EC458(func_8033A148(D_80382350.unk18), arg0, arg1); + for(i = 0; i < 3; i++){ + arg0[i] *= D_80382350.unk30; + arg1[i] *= D_80382350.unk30; + } + + if (D_80382350.unk1C != NULL) { + func_802EC458(func_8033A148(D_80382350.unk1C), sp3C, sp30); + for(j = 0; j < 3; j++){ + if(sp3C[j] < arg0[j]){ + arg0[j] = sp3C[j]; + } + if(arg1[j] < sp30[j]){ + arg1[j] = sp30[j]; + } + } + + } +} + +f32 func_80309B24(f32 arg0[3]){ + return func_80308FDC(arg0, 0xf800ff0f); +} + +BKCollisionTri *func_80309B48(f32 arg0[3], f32 arg1[3], f32 arg2[3], s32 arg3) { + BKCollisionTri *sp2C; + BKCollisionTri *temp_v0; + + D_80382350.unk20 = 0; + if (D_80382350.unkC != NULL) { + if ((arg3 & 0x80001F00) == 0x80001F00) { + sp2C = NULL; + } else { + sp2C = func_802E76B0(D_80382350.unk8, func_8033A148(D_80382350.unk18), arg0, arg1, arg2, arg3); + } + temp_v0 = func_802E76B0(D_80382350.unkC, func_8033A148(D_80382350.unk1C), arg0, arg1, arg2, arg3); + if (temp_v0 != NULL) { + D_80382350.unk20 = (s32) D_80382350.unk1C; + return temp_v0; + } + if (sp2C != NULL) { + D_80382350.unk20 = (s32) D_80382350.unk18; + } + return sp2C; + } + else{ + sp2C = func_802E76B0(D_80382350.unk8, func_8033A148(D_80382350.unk18), arg0, arg1, arg2, arg3); + if (sp2C != NULL) { + D_80382350.unk20 = (s32) D_80382350.unk18; + } + } + return sp2C; +} + +BKCollisionTri *func_80309C74(f32 arg0[3], f32 arg1[3], f32 arg2[3], s32 arg3, BKModelBin **arg4) { + BKCollisionTri *sp2C; + BKCollisionTri *phi_v0; + + sp2C = func_802E76B0(D_80382350.unk8, func_8033A148(D_80382350.unk18), arg0, arg1, arg2, arg3); + if (sp2C != NULL) { + *arg4 = D_80382350.unk18; + } + if (D_80382350.unkC == NULL) { + return sp2C; + } + + phi_v0 = func_802E76B0(D_80382350.unkC, func_8033A148(D_80382350.unk1C), arg0, arg1, arg2, arg3); + if (phi_v0 != 0) { + *arg4 = D_80382350.unk1C; + } + return (phi_v0 != NULL) ? phi_v0 : sp2C; +} + +UNK_TYPE(s32) func_80309D58(UNK_TYPE(s32) arg0, UNK_TYPE(s32) arg1) { + BKMeshList *temp_v0; + + temp_v0 = func_8033A12C(D_80382350.unk18); + if (temp_v0 != NULL) { + return func_802EC394(temp_v0, 0, 0, 1.0f, 0, arg0, arg1); + } + return 0; +} + +UNK_TYPE(s32) func_80309DBC(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3[3], s32 arg4, s32 arg5) { + s32 sp34; + s32 temp_v0_2; + + D_80382350.unk20 = 0; + sp34 = func_802E8E88(D_80382350.unk8, func_8033A148(D_80382350.unk18), arg0, arg1, arg2, arg3, arg4, arg5); + if (sp34 != 0) { + D_80382350.unk20 = (s32) D_80382350.unk18; + } + if (D_80382350.unkC == 0) { + return sp34; + } + temp_v0_2 = func_802E8E88(D_80382350.unkC, func_8033A148(D_80382350.unk1C), arg0, arg1, arg2, arg3, arg4, arg5); + if (temp_v0_2 != 0) { + D_80382350.unk20 = (s32) D_80382350.unk1C; + return temp_v0_2; + } + return sp34; +} + +UNK_TYPE(s32) func_80309EB0(f32 arg0[3], f32 arg1, f32 arg2[3], s32 arg3) { + s32 sp24; + s32 temp_v0_2; + + sp24 = func_802E92AC(D_80382350.unk8, func_8033A148(D_80382350.unk18), arg0, arg1, arg2, arg3); + if (D_80382350.unkC == 0) { + return sp24; + } + temp_v0_2 = func_802E92AC(D_80382350.unkC, func_8033A148(D_80382350.unk1C), arg0, arg1, arg2, arg3); + return (temp_v0_2 != 0) ? temp_v0_2 : sp24; +} + +bool func_80309F78(void) { + return (D_80382350.unk18 != NULL) && (D_80382350.unk1C != NULL); +} + +bool func_80309FA4(enum map_e map_id){ + Struct_core2_82000_0 *i_ptr; + + for(i_ptr = D_8036ABE0; i_ptr->map_id != 0; i_ptr++){ + if(map_id == i_ptr->map_id){ + return TRUE; + } + } + return FALSE; +} + +void func_80309FF0(void){ + assetcache_release(D_80382350.unk18); + + if(D_80382350.unk1C) + assetcache_release(D_80382350.unk1C); + + if(D_80382350.unk10) + model_free(D_80382350.unk10); + + if(D_80382350.unk14) + model_free(D_80382350.unk14); + + func_8034A2A8(D_80382350.unk24); +} + +enum asset_e func_8030A068(void){ + return D_80382350.unk28->model1_id; +} + +void func_8030A078(void) { + BKMeshList *sp24; + Struct_core2_82000_0 *temp_v0; + + D_80382350.unk2E = 0xFF; + D_80382350.unk2D = 0xFF; + D_80382350.unk2C = 0xFF; + + temp_v0 = func_80308F90(map_get());; + D_80382350.unk28 = temp_v0; + D_80382350.unk30 = (f32) temp_v0->unk14; + D_80382350.unk18 = (BKModelBin *)assetcache_get(D_80382350.unk28->model1_id); + D_80382350.unk8 = func_8033A084(D_80382350.unk18); + D_80382350.unk20 = 0; + if (D_80382350.unk28->model2_id != 0) { + D_80382350.unk1C = (BKModelBin *)assetcache_get(D_80382350.unk28->model2_id); + D_80382350.unkC = func_8033A084(D_80382350.unk1C); + } else { + D_80382350.unk1C = NULL; + D_80382350.unkC = NULL; + } + sp24 = func_8033A0B0(D_80382350.unk18); + if (sp24 != NULL) { + D_80382350.unk10 = func_8033F5F8(sp24, func_8033A148(D_80382350.unk18)); + } else { + D_80382350.unk10 = NULL; + } + if (D_80382350.unk10 != NULL) { + func_8034C6DC(D_80382350.unk10); + } + + if (D_80382350.unk1C != NULL) { + sp24 = func_8033A0B0(D_80382350.unk1C); + } + else{ + sp24 = NULL; + } + + if (sp24 != NULL) { + D_80382350.unk14 = func_8033F5F8(sp24, func_8033A148(D_80382350.unk1C)); + } else { + D_80382350.unk14 = 0; + } + if (D_80382350.unk14 != NULL) { + func_8034C6DC(D_80382350.unk14); + } + D_80382350.unk24 = func_8034A2C8(); + func_80320B44(func_80309B48, func_80309DBC, func_80309EB0, func_80309794); + + if (( D_80382350.unk18 != NULL) && (func_8033A110( D_80382350.unk18) != NULL)) { + D_80382350.unk0 = func_80349C3C(); + func_80349D00(D_80382350.unk0, func_8033A110(D_80382350.unk18)); + } else { + D_80382350.unk0 = NULL; + } + if ((D_80382350.unk1C != NULL) && (func_8033A110(D_80382350.unk1C) != 0)) { + D_80382350.unk4 = func_80349C3C(); + func_80349D00(D_80382350.unk4, func_8033A110(D_80382350.unk1C)); + } + else{ + D_80382350.unk4 = NULL; + } +} + +void func_8030A280(s32 r, s32 g, s32 b){ + D_80382350.unk2C = r; + D_80382350.unk2D = g; + D_80382350.unk2E = b; +} + +void func_8030A298(void){ + if(D_80382350.unk24 != NULL){ + D_80382350.unk24 = func_8034A348(D_80382350.unk24); + } +} diff --git a/src/core2/code_83340.c b/src/core2/code_83340.c new file mode 100644 index 00000000..2b5cc962 --- /dev/null +++ b/src/core2/code_83340.c @@ -0,0 +1,180 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern f32 func_8033A244(f32); + +typedef struct{ + BKModelBin *unk0; + s32 unk4; + f32 unk8; +}struct_7AF80_0; + +typedef struct{ + BKSprite *unk0; + BKSpriteDisplayData *unk4; + s32 unk8; + f32 unkC; +}struct_7AF80_1; + +BKModelBin *func_8030A428(s32 arg0); + +s32 D_8036B800; +struct_7AF80_0 *D_80382390; //prop models ??? +struct_7AF80_1 *D_80382394; //prop_sprites ??? + +extern f32 D_80377730; + +void func_8030A2D0(Gfx **gfx, Mtx **mtx, Vtx **vtx, f32 arg3[3], f32 arg4[3], f32 arg5, s32 arg6, Cube* arg7){ + BKModelBin * sp2C; + + sp2C = func_8030A428(arg6); + func_8033A244(D_80377730); + func_8033A28C(1); + set_model_render_mode(1); + func_8033A1FC(); + func_803391A4(gfx, mtx, arg3, arg4, arg5, NULL, sp2C); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_83340/func_8030A350.s") + +BKModelBin *func_8030A428(s32 arg0){ + if(D_80382390[arg0].unk0 == NULL){ + D_80382390[arg0].unk0 = assetcache_get(0x2d1 + arg0); + } + D_80382390[arg0].unk4 = func_8023DB5C(); + return D_80382390[arg0].unk0; +} + +BKModelBin *func_8030A4B4(s32 arg0){ + return D_80382390[arg0].unk0; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_83340/func_8030A4D4.s") +#else +BKSpriteDisplayData *func_8030A4D4(s32 arg0){ + struct_7AF80_1 *ptr; + if((ptr = D_80382394[arg0].unk0) == NULL){ + D_80382394[arg0].unk0 = func_8033B6C4(arg0 + 0x572, &ptr->unk4); + } + D_80382394[arg0].unk8 = func_8023DB5C(); + return D_80382394[arg0].unk4; +} +#endif + +BKSprite *func_8030A55C(s32 arg0){ + func_8030A4D4(arg0); + return D_80382394[arg0].unk0; +} + +f32 func_8030A590(Prop *arg0){ + if(arg0->unk8_1){ + PropProp* propProp = &arg0->propProp; + return D_80382390[arg0->spriteProp.unk0_31].unk8; + } + else{//L8030A65C + SpriteProp *spriteProp = &arg0->spriteProp; + return D_80382394[spriteProp->unk0_31].unkC; + } +} + +void func_8030A5EC(Prop *arg0, f32 arg1){ + if(arg0->unk8_1){ + PropProp* propProp = &arg0->propProp; + D_80382390[arg0->spriteProp.unk0_31].unk8 = (f32)propProp->unkA*arg1/100.0f; + } + else{//L8030A65C + SpriteProp *spriteProp = &arg0->spriteProp; + D_80382394[spriteProp->unk0_31].unkC = (f32)spriteProp->unk0_9*arg1/100.0f; + } +} + +void func_8030A6B0(void){//clear + struct_7AF80_0* iPtr; + struct_7AF80_1* jPtr; + + for(iPtr = D_80382390; iPtr < &D_80382390[0x2A2]; iPtr++){ + if(iPtr->unk0){ + assetcache_release(iPtr->unk0); + } + } + for(jPtr = D_80382394; jPtr < &D_80382394[0x168]; jPtr++){ + if(jPtr->unk0){ + func_8033B338(&jPtr->unk0, &jPtr->unk4); + } + } + free(D_80382390); + D_80382390 = NULL; + free(D_80382394); + D_80382394 = NULL; +} + + +void func_8030A78C(void){//init + struct_7AF80_0* iPtr; + struct_7AF80_1* jPtr; + + D_80382390 = (struct_7AF80_0 *)malloc(0x2A2 * sizeof(struct_7AF80_0)); + D_80382394 = (struct_7AF80_1 *)malloc(0x168 * sizeof(struct_7AF80_1)); + D_8036B800 = 0; + for(iPtr = D_80382390; iPtr < &D_80382390[0x2A2]; iPtr++){ + iPtr->unk0 = NULL; + iPtr->unk8 = 0.0f; + } + for(jPtr = D_80382394; jPtr < &D_80382394[0x168]; jPtr++){ + jPtr->unk0 = NULL; + jPtr->unkC = 0.0f; + } +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_83340/func_8030A850.s") + +void func_8030AA6C(void) { + BKModelBin *temp_a0; + s32 phi_s2; + + D_80382394 = defrag(D_80382394); + D_80382390 = defrag(D_80382390); + if (!func_802559A0() && !func_80255AE4() && D_80382390 != NULL) { + for(phi_s2 = 0x14; (phi_s2 != 0) && !func_80255AE4(); phi_s2--){ + D_8036B800++; + if (D_8036B800 >= 0x2A2) { + D_8036B800 = 0; + } + temp_a0 = D_80382390[D_8036B800].unk0; + if (temp_a0 != NULL && (func_802546E4(temp_a0) < 0x2AF8)) { + D_80382390[D_8036B800].unk0 = func_80255888(D_80382390[D_8036B800].unk0); + } + } + } +} + + +void func_8030ABA4(void) { + s32 temp_lo; + s32 temp_t7; + struct_7AF80_1 *phi_s0; + s32 phi_s2; + struct_7AF80_0 *phi_s0_2; + + for(phi_s0 = D_80382394; phi_s0 < D_80382394 + 360; phi_s0++){ + if (phi_s0->unk0 != NULL) { + temp_t7 = phi_s0 - D_80382394; + func_8033B338(&phi_s0->unk0, &phi_s0->unk4); + phi_s2 = temp_t7 *sizeof(struct_7AF80_1); + *(BKSprite **)((s32)D_80382394 + phi_s2) = func_8033B6C4(temp_t7 + 0x572, (BKSpriteDisplayData **)((s32)D_80382394 + phi_s2 + 4)); + } + } + + for(phi_s0_2 = D_80382390; phi_s0_2 < D_80382390 + 674; phi_s0_2++){ + if(phi_s0_2->unk0 != NULL){ + temp_lo = phi_s0_2 - D_80382390; + assetcache_release(phi_s0_2->unk0); + D_80382390[temp_lo].unk0 = (BKModelBin *) assetcache_get(temp_lo + 0x2D1); + + } + } +} + diff --git a/src/core2/code_83D70.c b/src/core2/code_83D70.c new file mode 100644 index 00000000..b27097fc --- /dev/null +++ b/src/core2/code_83D70.c @@ -0,0 +1,123 @@ +#include +#include "functions.h" +#include "variables.h" + + +typedef struct { + s16 level_id; + s16 unk2; + s16 unk4; +}Struct_core2_83D70_1; + +typedef struct map_info{ + s16 map_id; + s16 level_id; + u8* name; +}MapInfo; + +/* .data */ +extern MapInfo D_8036B818[]; +extern Struct_core2_83D70_1 D_8036BCE8[]; + +/* .rodata */ +extern u8 D_80378430[]; +extern u8 D_80378434[]; + +/* .bss */ +extern u8 D_803823A0[]; + +/* .data */ +#ifndef NONMATCHING +MapInfo * func_8030AD00(enum map_e map_id); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_83D70/func_8030AD00.s") +#else +MapInfo * func_8030AD00(enum map_e map_id){ + MapInfo *phi_v1; + + for(phi_v1 = D_8036B818; phi_v1->map_id != 0; phi_v1++){ + if (map_id == phi_v1->map_id) { + return phi_v1; + } + } + return NULL; +} +#endif + +enum level_e map_getLevel(enum map_e map){ + return func_8030AD00(map)->level_id; +}; + +/* returns string containing the map name and index */ +u8 *func_8030AD6C(enum map_e map){ + MapInfo *map_info = func_8030AD00(map); + D_803823A0[0] = 0; + strcat(D_803823A0, map_info->name); + strcat(D_803823A0, D_80378430); + strIToA(D_803823A0, map); + strcat(D_803823A0, D_80378434); + return D_803823A0; +} + +s32 func_8030ADD8(enum level_e level_id) { + Struct_core2_83D70_1 *phi_v1; + + for(phi_v1 = D_8036BCE8; phi_v1->level_id != 0; phi_v1++){ + if (level_id == phi_v1->level_id) { + return phi_v1->unk2; + } + } + return 0; +} + + +s32 func_8030AE24(enum level_e level_id) { + Struct_core2_83D70_1 *phi_v1; + + for(phi_v1 = D_8036BCE8; phi_v1->level_id != 0; phi_v1++){ + if (level_id == phi_v1->level_id) { + return phi_v1->unk4; + } + } + return 0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_83D70/func_8030AE70.s") + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_83D70/func_8030AF58.s") +#else +bool func_8030AF58(s32 arg0) { + Struct_core2_83D70_0 *phi_v0; + s32 i; + + for(i = 0; D_8036B818[i].unk0 != 0; i++) { + phi_v0 = &D_8036B818[i]; + if(phi_v0->unk0 == arg0){ + return TRUE; + } + } + return FALSE; +} +#endif + +void func_8030AFA0(enum map_e arg0){ + s32 level = map_getLevel(arg0); + if(level > 0 && level < LEVEL_C_BOSS){ + func_80332BEC(arg0); + } +} + +void func_8030AFD8(s32 arg0){ + s32 sp1C = level_get(); + func_80321918(0); + if(arg0){ + func_802C5994(); + } + if(sp1C > 0 && sp1C < 0xC){ + func_8033301C(); + } + func_8034789C(); + func_80250FC0(); //stop controller motor + func_80314B24(); + func_80347A70(); +} \ No newline at end of file diff --git a/src/core2/code_840D0.c b/src/core2/code_840D0.c new file mode 100644 index 00000000..e9d4798c --- /dev/null +++ b/src/core2/code_840D0.c @@ -0,0 +1,93 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8024CE60(f32, f32); + +extern struct48s D_8036BD40[]; + +extern f32 D_80378440; + +struct +{ + struct48s *unk0; + BKModel *unk4[3]; + void *unk10[3]; + f32 unk1C; +}D_80382410; + +struct48s * func_8030B060(enum map_e map_id){ + struct48s * v1 = D_8036BD40; + while(v1->map){ + if(map_id == v1->map){ + return v1; + } + v1++; + } + return v1; +} + +void func_8030B0AC(Gfx **arg0, Mtx **arg1, s32 arg2){ + int i; + f32 sp70[3]; + f32 sp64[3]; + void *iAsset; + + func_8024CE60(5.0f, D_80378440); + if(D_80382410.unk10[0]){ + func_80254084(arg0, 0, 0, + (s32)(f32) D_80276588, (s32)(f32)D_8027658C, + 0, 0, 0 + ); + func_8024C904(arg0, arg1); + func_8024C5CC(&sp70); + for(i = 0; i < 3; i++){ + iAsset = D_80382410.unk10[i]; + if(iAsset){ + sp64[0] = 0.0f; + sp64[1] = D_80382410.unk0->unk4[i].unk8 * D_80382410.unk1C; + sp64[2] = 0.0f; + func_803391A4(arg0, arg1, sp70, sp64, D_80382410.unk0->unk4[i].unk4, NULL, iAsset); + } + } + } + else{//L8030B200 + func_80254084(arg0, 0, 0, (s32)(f32) D_80276588, (s32)(f32)D_8027658C, 0, 0, 0); + }//L8030B254 +} + +void func_8030B284(void){ + int i; + + for(i = 0; i < 3; i++){ + if(D_80382410.unk4[i]){ + model_free(D_80382410.unk4[i]); + } + + if(D_80382410.unk10[i]){ + assetcache_release(D_80382410.unk10[i]); + } + } +} + +void func_8030B2EC(void){ + int i; + + D_80382410.unk0 = func_8030B060(map_get()); + for(i = 0; i< 3; i++){ + D_80382410.unk4[i] = 0; + D_80382410.unk10[i] = NULL; + if(D_80382410.unk0->unk4[i].unk0){ + D_80382410.unk10[i] = assetcache_get(D_80382410.unk0->unk4[i].unk0); + if(func_8033A0B0(D_80382410.unk10[i])){ + D_80382410.unk4[i] = func_8033F5F8(func_8033A0B0(D_80382410.unk10[i]), func_8033A148( D_80382410.unk10[i])); + func_8034C6DC(D_80382410.unk4[i]); + } + } + } + D_80382410.unk1C = 0.0f; +} + +void func_8030B3C8(void){ + D_80382410.unk1C += time_getDelta(); +} diff --git a/src/core2/code_851D0.c b/src/core2/code_851D0.c new file mode 100644 index 00000000..3b9f44d2 --- /dev/null +++ b/src/core2/code_851D0.c @@ -0,0 +1,240 @@ +#include +#include "functions.h" +#include "variables.h" + +extern s16 *D_80382450; +extern void *D_80382454; + +extern Gfx D_8036C450[]; +extern Gfx D_8036C4A8[]; + +extern u8 D_803A5D00[2][0x1ecc0]; + +/* .code */ +void func_8030C160(void){ + func_8024F150(); +} + +void func_8030C180(void){ + func_8024F180(); +} + +void func_8030C1A0(void){ + if(D_80382454 == NULL){ + D_80382454 = D_80382450 = malloc(0xA040); + + while((s32)D_80382450 & 0x3F){ + D_80382450++; + } + } +} + +void func_8030C204(void){ + if(D_80382454){ + free(D_80382454); + D_80382454 = NULL; + } + + switch(getGameMode()){ + case GAME_MODE_8_BOTTLES_BONUS: + func_802DEA8C(0, 0); + break; + case GAME_MODE_A_SNS_PICTURE: + func_802DF11C(0, 0); + break; + } +} + +void func_8030C27C(void){ + switch(getGameMode()){ + case GAME_MODE_8_BOTTLES_BONUS: + func_802DEA18(0, 0); + break; + case GAME_MODE_A_SNS_PICTURE: + func_802DF090(0, 0); + break; + + } +} + +void func_8030C2D4(Gfx **gdl, Mtx **mptr, Vtx **vptr){ + func_80254348(); + func_80253640(gdl, D_803A5D00[func_8024BDA0()]); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_851D0/func_8030C33C.s") +#else +void func_8030C33C(Gfx **gfx, Mtx **mtx, Vtx **vtx) { + s32 sp80; + s32 sp74; + s32 sp70; + s32 sp64; + s32 sp60; + s32 sp54; + s32 sp50; + s32 sp48; + s32 sp40; + s16 temp_s4; + s16 temp_t4; + s32 temp_a0; + s32 temp_a1; + s32 temp_a3; + s32 temp_t6; + s32 temp_t8; + void *temp_a1_2; + void *temp_a2; + void *temp_s0; + void *temp_s0_2; + void *temp_s0_3; + void *temp_s0_4; + void *temp_s0_5; + void *temp_s0_6; + void *temp_s0_7; + void *temp_s0_8; + void *temp_s0_9; + void *temp_s2; + s32 phi_ra; + s32 phi_t5; + s32 phi_t4; + s32 phi_t3; + s32 phi_t2; + s32 phi_t1; + s32 phi_s3; + s32 phi_s5; + s16 phi_s6; + s32 phi_v0; + s16 phi_v1; + s16 phi_s4; + s16 phi_t4_2; + s16 phi_v0_2; + s16 phi_v1_2; + s32 phi_v0_3; + s32 phi_a0; + s32 phi_s7; + + gSPDisplayList((*gfx)++, D_8036C450); + sp64 = 0x1F; + sp54 = 0x130; + sp74 = 0; + phi_t4_2 = 0xB0; + do { + phi_ra = sp74 << 5; + phi_t5 = (0x40 + 7); + phi_t4 = (s32) phi_t4_2; + phi_t3 = (s32) sp56; + phi_t2 = (sp64 << 2) & 0xFFF; + phi_t1 = (sp74 << 2) & 0xFFF; + phi_s3 = 0; + phi_s5 = 0x1F; + phi_s6 = 0x188; + phi_s4 = 0x108; + phi_s7 = 0; +loop_2: + sp40 = phi_ra; + sp80 = phi_t5; + sp48 = phi_t4; + sp50 = phi_t3; + sp60 = phi_t2; + sp70 = phi_t1; + + // gDPLoadTextureTile((*gfx)++, &D_80382450, G_IM_FMT_IA, G_IM_SIZ_16b, 160, height, uls, ult, lrs, lrt, pal, cms, cmt, masks, maskt, shifts, shiftt) + + gDPSetTextureImage((*gfx)++, G_IM_FMT_IA, G_IM_SIZ_16b, 160, D_80382450); + // temp_a1 = (((0x40 + 7 >> 3) & 0x1FF) << 9) | 0xF5700000; + // temp_s0_2->unk0 = temp_a1; + // temp_s0_2->unk4 = 0x07080200; + gDPSetTile((*gfx)++, G_IM_FMT_IA, G_IM_SIZ_32b, 427, 0x0101, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, 1, 12, G_TX_NOMIRROR | G_TX_WRAP, 8, 7); + gDPLoadSync((*gfx)++); + // temp_a3 = ((phi_s3 * 4) & 0xFFF) << 0xC; + // temp_a0 = ((phi_s5 * 4) & 0xFFF) << 0xC; + // temp_s0_4->unk0 = (s32) (temp_a3 | 0xF4000000 | phi_t1); + // temp_s0_4->unk4 = (s32) (temp_a0 | 0x07000000 | phi_t2); + gDPLoadTile((*gfx)++, G_TX_LOADTILE, 0, 0, 0, 0); + gDPPipeSync((*gfx)++); + + // temp_s0_6->unk0 = temp_a1; + // temp_s0_6->unk4 = 0x00080200; + gDPSetTile((*gfx)++, G_IM_FMT_IA, G_IM_SIZ_16b, 0, 0x0100, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOLOD); + // temp_s0_7->unk4 = (s32) (temp_a0 | phi_t2); + // temp_s0_7->unk0 = (s32) (temp_a3 | 0xF2000000 | phi_t1); + gDPSetTileSize((*gfx)++, G_TX_RENDERTILE, 0, 0, 0, 0); + temp_a1_2 = *gfx; + *gfx = temp_a1_2 + 8; + if ((s32) phi_s6 > 0) { + phi_v1 = (s16) (phi_s7 + 0x188); + } else { + phi_v1 = 0; + } + if (phi_t3 > 0) { + phi_v0 = phi_t3; + } else { + phi_v0 = 0; + } + temp_a1_2->unk0 = (s32) ((phi_v0 & 0xFFF) | 0xE4000000 | ((phi_v1 & 0xFFF) << 0xC)); + if ((s32) phi_s4 > 0) { + phi_v1_2 = phi_s4; + } else { + phi_v1_2 = 0; + } + if ((s32) phi_t4_2 > 0) { + phi_v0_2 = phi_t4_2; + } else { + phi_v0_2 = 0; + } + temp_a1_2->unk4 = (s32) ((phi_v0_2 & 0xFFF) | ((phi_v1_2 & 0xFFF) << 0xC)); + temp_a2 = *gfx; + *gfx = temp_a2 + 8; + temp_a2->unk0 = 0xB4000000; + phi_s5 += 0x20; + if ((s32) phi_s4 < 0) { + temp_t6 = (s32) (phi_s4 << 0xA) >> 7; + if (temp_t6 < 0) { + phi_a0 = temp_t6; + } else { + phi_a0 = 0; + } + } else { + phi_a0 = 0; + } + if (phi_t4 < 0) { + temp_t8 = (s32) (phi_t4_2 << 0xA) >> 7; + if (temp_t8 < 0) { + phi_v0_3 = temp_t8; + } else { + phi_v0_3 = 0; + } + } else { + phi_v0_3 = 0; + } + temp_a2->unk4 = (s32) (((phi_ra - phi_v0_3) & 0xFFFF) | (((phi_s3 << 5) - phi_a0) << 0x10)); + temp_s0_8 = *gfx; + temp_s4 = phi_s4 + 0x80; + *gfx = temp_s0_8 + 8; + temp_s0_8->unk0 = 0xB3000000; + temp_s0_8->unk4 = 0x04000400; + phi_s3 += 0x20; + phi_s6 += 0x80; + phi_s4 = temp_s4; + phi_s7 += 0x80; + if (temp_s4 != 0x388) { + goto loop_2; + } + temp_t4 = phi_t4 + 0x80; + sp74 += 0x20; + sp54 += 0x80; + sp64 += 0x20; + phi_t4_2 = temp_t4; + } while (temp_t4 != 0x2B0); + gSPDisplayList((*gfx)++, D_8036C4A8); +} +#endif + + +s32 func_8030C704(void){ + return D_80382450; +} + +void func_8030C710(void){ + func_802542F4(0, 0xA0, 0, 0x80); +} diff --git a/src/core2/code_857B0.c b/src/core2/code_857B0.c new file mode 100644 index 00000000..c76823c7 --- /dev/null +++ b/src/core2/code_857B0.c @@ -0,0 +1,19 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +extern s32 D_80382460; + +/* .code */ +void func_8030C740(void){ + f32 sp1C[3]; + D_80382460 = 1; + if(func_80304DD0(0x16, sp1C)){ + D_80382460 = 0; + } +} + +s32 func_8030C77C(void){ + return D_80382460; +} diff --git a/src/core2/code_85800.c b/src/core2/code_85800.c new file mode 100644 index 00000000..833a5e37 --- /dev/null +++ b/src/core2/code_85800.c @@ -0,0 +1,1017 @@ +#include +#include "functions.h" +#include "variables.h" +#include "n_libaudio.h" + +extern f32 func_80256AB4(f32, f32, f32, f32); +extern void func_80335394(s32, f32); +extern f32 sfx_randf2(f32, f32); + +#define SFX_SRC_FLAG_0_UNKOWN (1 << 0) +#define SFX_SRC_FLAG_1_UNKOWN (1 << 1) +#define SFX_SRC_FLAG_2_UNKOWN (1 << 2) +#define SFX_SRC_FLAG_3_UNKOWN (1 << 3) +#define SFX_SRC_FLAG_4_UNKOWN (1 << 4) +#define SFX_SRC_FLAG_5_UNKOWN (1 << 5) +#define SFX_SRC_FLAG_6_UNKOWN (1 << 6) +#define SFX_SRC_FLAG_7_UNKOWN (1 << 7) + +typedef struct { + f32 position[3]; + f32 unkC; //inner_radius_squared + f32 unk10; //outer_radius_squared + s16 unk14; + u8 unk16; + u8 pad17[0x1]; + f32 unk18; + f32 unk1C; + f32 unk20; + f32 unk24; + s16 sfx_uid; + s16 unk2A;//sample_rate + u8 unk2C; + u8 pad2D[3]; + void (*unk30)(u8 indx); + f32 unk34; //volume + f32 unk38; + f32 unk3C; + u8 unk40; + u8 unk41; + u8 busy; + u8 unk43_7:3; + u8 unk43_4:3; + u8 unk43_1:2; +}struct45s; + +u8 func_8030D90C(void); +void sfxsource_setSfxId(u8 indx, enum sfx_e uid); +void sfxsource_setSampleRate(u8, s32); +void func_8030DD90(u8, s32); +void func_8030DCCC(u8, s32); +void func_8030E0B4(u8, f32, f32); +f32 func_8030E200(u8); +void func_8030E2C4(u8); +int func_8030ED70(enum sfx_e uid); +void func_8030EDAC(f32, f32); + +/* .bss */ +struct46s D_80382470[16]; +struct45s D_803824C0[35]; +f32 D_80382E0C; +f32 D_80382E10; + +/* .code */ +void __sfx_getPlayerPositionIfPresent(f32 arg0[3]){ + if(player_is_present()) + player_getPosition(arg0); + else + ml_vec3f_clear(arg0); +} + +void func_8030C7D0(struct45s *arg0, s32 arg1){ + arg0->unk43_7 = arg1; +} + +s32 func_8030C7E8(struct45s *arg0){ + return arg0->unk43_7; +} + +void func_8030C7F8(struct45s *arg0, s32 arg1){ + arg0->unk43_4 = arg1; +} + +int func_8030C814(struct45s *arg0, s32 arg1){ + return arg0->unk43_4 == arg1; +} + +void sfxsource_setFlag(struct45s *arg0, s32 arg1){ + arg0->unk41 |= arg1; +} + +void sfxsource_clearFlag(struct45s *arg0, s32 arg1){ + arg0->unk41 &= ~arg1; +} + +s32 sfxsource_isFlagSet(struct45s *arg0, s32 arg1){ + return arg0->unk41 & arg1; +} + +int sfxsource_isFlagCleared(struct45s *arg0, s32 arg1){ + return (arg0->unk41 & arg1) == 0; +} + +void sfxsource_initAll(void){ + int i; + for(i = 0; i < 35; i++) + D_803824C0[i].busy = FALSE; +} + +struct45s *sfxsource_at(u8 indx){ + return D_803824C0 + indx; +} + +struct46s *func_8030C8DC(s32 indx){ + return D_80382470 + indx - 1; +} + +Struct81s *func_8030C8F4(s32 indx){ + return D_80382470[indx - 1].unk0; +} + +u8 sfxsource_getNewIndex(void){ + int i; + for(i = 1; i < 35; i++){ + if(!D_803824C0[i].busy){ + D_803824C0[i].busy = TRUE; + return i; + } + } + return 0; +} + +void func_8030C9F4(s32 indx){ + D_80382470[indx - 1].unk4 = 0; +} + +void func_8030CA08(void){ + int i; + for(i = 0; i < 10; i++){ + D_80382470[i].unk0 = 0; + D_80382470[i].unk4 = 0; + } +} + +s32 func_8030CA60(void){ + int i; + for(i = 0; i < 10; i++){ + if(D_80382470[i].unk4 == 0 && D_80382470[i].unk0 == 0){ + D_80382470[i].unk4 = 1; + return i+1; + } + + } + return 0; +} + +void sfxsource_free(u8 indx){ + struct45s *ptr = sfxsource_at(indx); + if(ptr->unk40){ + func_8030C9F4(ptr->unk40); + ptr->unk40 = 0; + } + D_803824C0[indx].busy = FALSE; +} + +void func_8030CBD0(struct45s *arg0){ + s32 sp24 = func_8030CA60(); + struct46s *temp_a1; + if(sp24){ + if(arg0->unk40) + func_8030C9F4(arg0->unk40); + arg0->unk40 = sp24; + func_8030C7F8(arg0, 1); + sfxsource_setFlag(arg0, SFX_SRC_FLAG_2_UNKOWN); + sfxsource_setFlag(arg0, SFX_SRC_FLAG_3_UNKOWN); + sfxsource_setFlag(arg0, SFX_SRC_FLAG_4_UNKOWN); + if(arg0->sfx_uid > 0x3e8){ + func_80335354(arg0->sfx_uid - 0x3e9, func_8030C8DC(arg0->unk40)); + } + else{ + func_8033531C(arg0->sfx_uid, func_8030C8DC(arg0->unk40)); + } + }//L8030CC7C +} + +void func_8030CC90(struct45s *arg0){ + if(func_8030C814(arg0, 1)){ + sfxsource_clearFlag(arg0, SFX_SRC_FLAG_5_UNKOWN); + func_8030C7F8(arg0, 2); + if(arg0->unk40){ + func_8033543C(func_8030C8F4(arg0->unk40)); + } + } +} + +s32 func_8030CCF0(struct45s *arg0, s32 arg1){ + f32 plyr_pos[3]; + f32 diff[3]; + f32 dist_sqr; + s32 retVal; + __sfx_getPlayerPositionIfPresent(plyr_pos); + diff[0] = arg0->position[0] - plyr_pos[0]; + diff[1] = arg0->position[1] - plyr_pos[1]; + diff[2] = arg0->position[2] - plyr_pos[2]; + dist_sqr = diff[0]*diff[0] + diff[1]*diff[1] + diff[2]*diff[2]; + if( dist_sqr < arg0->unkC) + retVal = arg1; + else if( dist_sqr < arg0->unk10) + retVal = arg0->unk14 + (((arg0->unk10-dist_sqr))/(arg0->unk10 - arg0->unkC))*(arg1 - arg0->unk14); + else + retVal = arg0->unk14; + return retVal; +} + +s32 func_8030CDE4(struct45s *arg0){ + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + f32 temp_f0; + f32 pad; + + func_8024C5CC(&sp44); + func_8024C5A8(&sp38); + sp2C[0] = arg0->position[0] - sp44[0]; + sp2C[1] = arg0->position[1] - sp44[1]; + sp2C[2] = arg0->position[2] - sp44[2]; + sp2C[1] = 0.0f; + if(sp2C[0]*sp2C[0] + sp2C[1]*sp2C[1] + sp2C[2]*sp2C[2] < 10.0f){ + return 0x40; + } + ml_vec3f_normalize(&sp2C); + sp38[1] = 0.0f; + ml_vec3f_normalize(&sp38); + temp_f0 = func_80256AB4(sp38[0], sp38[2], sp2C[0], sp2C[2]); + if(arg0->unk16){ + arg0->unk18 += 0.07*((f32)(s32)(64.0f - (temp_f0 * 63.0f)) - arg0->unk18); + } + else{ + arg0->unk18 = (f32)(s32)(64.0f - temp_f0*63.0f); + } + return (s32)arg0->unk18; +} + +void func_8030CF68(s32 arg0, s32 arg1){ + if(arg0){ + func_803353F4(func_8030C8F4(arg0), arg1); + } +} + +void func_8030CF9C(s32 arg0, s32 arg1){ + if(arg0){ + func_80335418(func_8030C8F4(arg0), arg1); + } +} + +void func_8030CFD0(s32 arg0, f32 arg1){ + if(arg0){ + func_80335394(func_8030C8F4(arg0), arg1); + } +} + +void func_8030D004(s32 arg0, s32 arg1){ + if(arg0){ + func_803353BC(func_8030C8F4(arg0), (u16) arg1); + } +} + +s32 func_8030D038(struct45s *arg0, s32 arg1){ + if(sfxsource_isFlagSet(arg0,SFX_SRC_FLAG_6_UNKOWN)){ + if(sfxsource_isFlagSet(arg0, SFX_SRC_FLAG_7_UNKOWN)){ + if(player_is_present() && func_8028EE84() == BSWATERGROUP_2_UNDERWATER) + arg1 *= arg0->unk3C; + } + else{//L8030D0B4 + if(player_is_present() && func_8028EE84() != BSWATERGROUP_2_UNDERWATER) + arg1 *= arg0->unk38; + } + } + return arg1; +} + +s32 func_8030D10C(u8 indx){ + s32 sp24; + struct45s * ptr; + s32 tmp_v0; + f32 tmp_f2; + + ptr = sfxsource_at(indx); + sp24 = 0; + if(func_8030C814(ptr, 1)){ + if(sfxsource_isFlagSet(ptr, SFX_SRC_FLAG_2_UNKOWN)){ + func_8030CFD0(ptr->unk40, ptr->unk34); + }//L8030D164 + + if(sfxsource_isFlagSet(ptr,SFX_SRC_FLAG_4_UNKOWN)){ + tmp_f2 = ((f32)ptr->unk2C + D_80382E0C*127.0f)*D_80382E10; + tmp_f2 = MAX(0.0f,MIN(127.0f, tmp_f2)); + func_8030CF68(ptr->unk40, tmp_f2); + } + + //L8030D228 + if(sfxsource_isFlagSet(ptr, SFX_SRC_FLAG_1_UNKOWN)){ + tmp_v0 = func_8030CCF0(ptr, ptr->unk2A); + if(tmp_v0 < 100) + sp24 = 1; + func_8030D004(ptr->unk40, func_8030D038(ptr, tmp_v0)); + func_8030CF9C(ptr->unk40, func_8030CDE4(ptr)); + }else{//L8030D288 + if(sfxsource_isFlagSet(ptr, SFX_SRC_FLAG_3_UNKOWN)){ + tmp_v0 = func_8030D038(ptr, ptr->unk2A); + if(tmp_v0 < 100) + sp24 = 1; + func_8030D004(ptr->unk40, tmp_v0); + } + } + sfxsource_clearFlag(ptr, SFX_SRC_FLAG_2_UNKOWN); + sfxsource_clearFlag(ptr, SFX_SRC_FLAG_3_UNKOWN); + sfxsource_clearFlag(ptr, SFX_SRC_FLAG_4_UNKOWN); + }//L8030D2E0 + if(getGameMode() == GAME_MODE_4_PAUSED) + sp24++; + + return sp24; +} + +void func_8030D310(u8 indx){ + f32 pad0; + s32 sp30; + f32 pad1; + struct45s * ptr; + f32 sp24; + + ptr = sfxsource_at(indx); + + if( func_8030C814(ptr, 1) + && ptr->unk40 + && func_8030C8F4(ptr->unk40) + ){ + switch(ptr->unk43_1){ + case 0: + break; + case 1: //L8030D388[ + ptr->unk34 += ptr->unk1C*time_getDelta(); + if(0.0f < ptr->unk1C) + ptr->unk34 = min_f(ptr->unk34, ptr->unk20); + else + ptr->unk34 = max_f(ptr->unk34, ptr->unk20); + sfxsource_setFlag(ptr, SFX_SRC_FLAG_2_UNKOWN); + break; + case 2: //L8030D3E8 + sp24 = time_getDelta(); + ptr->unk34 += sfx_randf2(-ptr->unk24, ptr->unk24)*sp24; + ptr->unk34 = mlClamp_f(ptr->unk34, ptr->unk20, ptr->unk1C); + sfxsource_setFlag(ptr, SFX_SRC_FLAG_2_UNKOWN); + break; + } + }//L8030D434 + switch(func_8030C7E8(ptr)){ + case 1://L8030D468 + if( func_8030C814(ptr, 0) || (func_8030C814(ptr, 1) && !ptr->unk40)) + func_8030DA44(indx); + break; + case 2://L8030D4A4 + if(func_8030C814(ptr, 1) && sfxsource_isFlagCleared(ptr, 1)) + func_8030E394(indx); + else + sfxsource_clearFlag(ptr, SFX_SRC_FLAG_0_UNKOWN); + break; + case 3://L8030D4E0 + break; + }//L8030D4E0 + sp30 = func_8030D10C(indx); + if( func_8030C814(ptr, 1) + && func_8030ED70(ptr->sfx_uid) + ){ + if(sfxsource_isFlagSet(ptr, SFX_SRC_FLAG_5_UNKOWN)){ + if(sp30 == 0){ + osSetThreadPri(NULL, 0x33); + func_8030CBD0(ptr); + sfxsource_clearFlag(ptr, SFX_SRC_FLAG_5_UNKOWN); + func_8030D10C(indx); + osSetThreadPri(NULL, 0x14); + } + } + else{//L8030D568 + if(sp30){ + func_8030CC90(ptr); + func_8030C7F8(ptr, 1); + sfxsource_setFlag(ptr, SFX_SRC_FLAG_5_UNKOWN); + } + } + }//L8030D594 + if(ptr->unk40 && !func_8030C8F4(ptr->unk40)){ + func_8030C9F4(ptr->unk40); + ptr->unk40 = 0; + } +} + +bool func_8030D5CC(u8 indx){ + struct45s * sp1C = sfxsource_at(indx); + if(!func_8030C814(sp1C, 3)) + return 0; + + if(!sp1C->unk40) + return 1; + + if(func_8030C8F4(sp1C->unk40)) + return 0; + return 1; +} + +void func_8030D644(void){ + int i; + for(i = 1; i < 35; i++){ + if(D_803824C0[i].busy){ + func_8030D310(i); + if(func_8030D5CC(i)) + sfxsource_free(i); + } + } +} + +void func_8030D6C4(enum sfx_e uid, f32 arg1, s32 arg2, s32 arg3, s32 arg4){ + u8 indx = func_8030D90C(); + if(indx){ + sfxsource_setSfxId(indx, uid); + sfxsource_setSampleRate(indx, arg2); + func_8030DBB4(indx, arg1); + func_8030DCCC(indx, arg3); + func_8030DD14(indx, 1); + func_8030DD90(indx, arg4); + func_8030E2C4(indx); + } +} + +void func_8030D750(void){ + func_8030CA08(); + sfxsource_initAll(); + +} + +void func_8030D778(void){ + int i; + int temp_s1; + for(i = 1; i < 35; i++){ + if(D_803824C0[i].busy) + func_8030DA44(i); + } + do{ + temp_s1 = 0; + func_8030D644(); + for(i = 1; i < 35; i++){ + if(D_803824C0[i].busy) + temp_s1++; + } + }while(temp_s1); +} + +void func_8030D86C(void){ + func_8030D750(); + func_80244AB0(); + func_8030EDAC(0.0f, 1.0f); +} + +void func_8030D8A8(s32 arg0, s32 arg){ + return; +} + +void func_8030D8B4(void){ + func_8024FB8C(); + func_8024F83C(); +} + +void func_8030D8DC(void){ + func_80244B3C(); + func_8030D778(); + func_8030D8B4(); +} + +u8 func_8030D90C(void){ + u8 s1 = sfxsource_getNewIndex(); + struct45s *s0; + + if(s1 == 0) + return 0; + + s0 = sfxsource_at(s1); + s0->unk30 = NULL; + s0->sfx_uid = -1; + s0->unk2A = 22000; + s0->unk2C = 0; + s0->unk40 = 0; + s0->unk43_1 = 0; + s0->unk34 = 1.0f; + func_8030C7F8(s0, 0); + func_8030C7D0(s0, 0); + sfxsource_setFlag(s0, SFX_SRC_FLAG_0_UNKOWN); + sfxsource_setFlag(s0, SFX_SRC_FLAG_2_UNKOWN); + sfxsource_setFlag(s0, SFX_SRC_FLAG_3_UNKOWN); + sfxsource_setFlag(s0, SFX_SRC_FLAG_4_UNKOWN); + s0->unkC = 62500.0f; + s0->unk10 = 1440000.0f; + s0->unk14 = 0xa; + s0->unk16 = 0; + s0->unk18 = 64.0f; + ml_vec3f_clear(s0->position); + sfxsource_clearFlag(s0, SFX_SRC_FLAG_1_UNKOWN); + sfxsource_clearFlag(s0, SFX_SRC_FLAG_5_UNKOWN); + func_8030DD90(s1, 2); + func_8030E0B4(s1, 0.2f, 0.1f); + return s1; +} + +void func_8030DA44(u8 indx){ + struct45s * sp1C = sfxsource_at(indx); + func_8030E394(indx); + func_8030C7F8(sp1C, 3); +} + +void sfxsource_setSfxId(u8 indx, enum sfx_e uid){ + if(indx) + sfxsource_at(indx)->sfx_uid = uid; +} + +void sfxsource_setSampleRate(u8 indx, s32 sample_rate){ + struct45s *temp_v0; + if(indx){ + temp_v0 = sfxsource_at(indx); + temp_v0->unk2A = sample_rate; + sfxsource_setFlag(temp_v0, SFX_SRC_FLAG_3_UNKOWN); + } +} + +void func_8030DB04(u8 indx, s32 arg1, f32 arg2[3], f32 min_dist, f32 max_dist){ + f32 sp24[3]; + f32 dist; + f32 temp_f2; + __sfx_getPlayerPositionIfPresent(sp24); + dist = ml_vec3f_distance(arg2, sp24); + if(max_dist <= dist) + temp_f2 = 0.0f; + else{ + if(min_dist <= dist){ + temp_f2 = 1.0f - (dist - min_dist)/(max_dist - min_dist); + } + else{ + temp_f2 = 1.0f; + } + } + sfxsource_setSampleRate(indx, (s32)arg1*temp_f2); +} + +void func_8030DBB4(u8 indx, f32 arg1){ + struct45s *temp_v0; + if(indx){ + temp_v0 = sfxsource_at(indx); + temp_v0->unk34 = arg1; + sfxsource_setFlag(temp_v0, SFX_SRC_FLAG_2_UNKOWN); + } +} + +void func_8030DBFC(u8 indx, f32 arg1, f32 arg2, f32 arg3){ + f32 temp_f2 = func_8030E200(indx); + f32 temp_f0; + if( temp_f2 < arg1){ + temp_f2 += arg3; + } + else if(arg2 < temp_f2){ + temp_f2 -= arg3; + } + else{ + temp_f2 += sfx_randf2(-arg3, arg3); + if(temp_f2 < arg1) + temp_f2 = arg1; + else{ + temp_f0 = MIN(arg2 , temp_f2); + temp_f2 = temp_f0; + } + } + func_8030DBB4(indx, temp_f2); + +} + +void func_8030DCCC(u8 indx, s32 arg1){ + struct45s *temp_v0; + if(indx){ + temp_v0 = sfxsource_at(indx); + temp_v0->unk2C = arg1; + sfxsource_setFlag(temp_v0, SFX_SRC_FLAG_4_UNKOWN); + } +} + +void func_8030DD14(u8 indx, int arg1){ + struct45s *temp_v0; + if(indx){ + temp_v0 = sfxsource_at(indx); + func_8030C7D0(temp_v0, arg1); + } +} + +void func_8030DD54(u8 indx, void (*arg1)(u8)){ + struct45s *temp_v0; + if(indx){ + temp_v0 = sfxsource_at(indx); + temp_v0->unk30 = arg1; + } +} + +void func_8030DD90(u8 indx, s32 arg1){ + struct45s *temp_v0; + if(indx){ + temp_v0 = sfxsource_at(indx); + switch(arg1){ + case 0://L8030DDE4 + sfxsource_clearFlag(temp_v0, SFX_SRC_FLAG_6_UNKOWN); + sfxsource_clearFlag(temp_v0, SFX_SRC_FLAG_7_UNKOWN); + break; + case 1: //L8030DE00 + sfxsource_setFlag(temp_v0, SFX_SRC_FLAG_6_UNKOWN); + sfxsource_clearFlag(temp_v0, SFX_SRC_FLAG_7_UNKOWN); + break; + case 2: //L8030DE1C + sfxsource_setFlag(temp_v0, SFX_SRC_FLAG_6_UNKOWN); + sfxsource_setFlag(temp_v0, SFX_SRC_FLAG_7_UNKOWN); + break; + } + } +} + +void func_8030DE44(u8 indx, s32 arg1, f32 arg2){ + struct45s *ptr; + if(indx){ + ptr = sfxsource_at(indx); + switch(arg1){ + case 0: + break; + case 1://L8030DE98 + ptr->unk38 = arg2; + break; + case 2: + ptr->unk3C = arg2; + break; + } + } +} + +void func_8030DEB4(u8 indx, f32 arg1, f32 arg2){ + struct45s *ptr; + if(indx){ + ptr = sfxsource_at(indx); + ptr->unkC = arg1*arg1; + ptr->unk10 = arg2*arg2; + func_8030DFF0(indx, 1); + } +} + +void func_8030DF18(u8 indx, f32 arg1){ + struct45s *ptr; + if(indx){ + ptr = sfxsource_at(indx); + ptr->unk14 = (s16)arg1; + func_8030DFF0(indx, 1); + } +} + +//sfxsource_setPostion +void func_8030DF68(u8 indx, f32 position[3]){ + struct45s *ptr; + if(indx){ + ptr = sfxsource_at(indx); + ml_vec3f_copy(ptr->position, position); + func_8030DFF0(indx, 1); + } +} + +void func_8030DFB4(u8 indx, s32 arg1){ + struct45s *ptr; + if(indx){ + ptr = sfxsource_at(indx); + ptr->unk16 = arg1; + } +} + +void func_8030DFF0(u8 indx, s32 arg1){ + struct45s *ptr; + if(indx){ + ptr = sfxsource_at(indx); + if(arg1){ + sfxsource_setFlag(ptr, SFX_SRC_FLAG_1_UNKOWN); + } + else{ + sfxsource_clearFlag(ptr, SFX_SRC_FLAG_1_UNKOWN); + } + } +} + +void func_8030E04C(u8 indx, f32 arg1, f32 arg2, f32 arg3){ + struct45s *ptr; + if(indx){ + ptr = sfxsource_at(indx); + ptr->unk43_1 = 1; + ptr->unk1C = arg3; + ptr->unk20 = arg2; + func_8030DBB4(indx, arg1); + } +} + +void func_8030E0B4(u8 indx, f32 arg1, f32 arg2){ + struct45s *ptr; + if(indx){ + ptr = sfxsource_at(indx); + ptr->unk38 = arg1; + ptr->unk3C = arg2; + } +} + +void func_8030E0FC(u8 indx, f32 arg1, f32 arg2, f32 arg3){ + struct45s *ptr; + + if(indx){ + ptr = sfxsource_at(indx); + ptr->unk43_1 = 2; + ptr->unk24 = arg3; + ptr->unk20 = arg1; + ptr->unk1C = arg2; + func_8030DBB4(indx, (arg1 + arg2)/2); + } +} + +enum sfx_e sfxsource_getSfxId(u8 indx){ + struct45s *ptr; + + if(!indx) + return 0; + else{ + ptr = sfxsource_at(indx); + return ptr->sfx_uid; + } +} + +s32 func_8030E1C4(u8 indx){ + struct45s *ptr; + + if(indx == 0) + return 0; + else{ + ptr = sfxsource_at(indx); + return ptr->unk2A; + } +} + +f32 func_8030E200(u8 indx){ + struct45s *ptr; + + if(!indx) + return 1.0f; + else{ + ptr = sfxsource_at(indx); + return ptr->unk34; + } +} + +s32 func_8030E244(u8 indx){ + struct45s *ptr; + + if(!indx) + return 0; + else{ + ptr = sfxsource_at(indx); + return ptr->unk2C; + } +} + +bool func_8030E280(struct45s *arg0){ + int temp_v1; + if(sfxsource_isFlagSet(arg0, SFX_SRC_FLAG_1_UNKOWN)){ + temp_v1 = func_8030CCF0(arg0, arg0->unk2A); + } + else{ + temp_v1 = arg0->unk2A; + } + return (temp_v1 > 100); +} + +void func_8030E2C4(u8 indx){ + struct45s *ptr; + + if(!indx) + return; + + ptr = sfxsource_at(indx); + if(func_8030E280(ptr) || func_8030ED70(ptr->sfx_uid)){ + switch(func_8030C7E8(ptr)){ + case 2: + sfxsource_setFlag(ptr, SFX_SRC_FLAG_0_UNKOWN); + if(func_8030C814(ptr, 1)){ + return; + } + break; + + default: + if(func_8030C814(ptr, 1)){ + func_8030E394(indx); + } + break; + } + osSetThreadPri(NULL, 0x33); + func_8030CBD0(ptr); + func_8030D10C(indx); + osSetThreadPri(NULL, 0x14); + } +} + +void func_8030E394(u8 indx){ + struct45s *ptr; + + if(indx){ + ptr = sfxsource_at(indx); + if(func_8030C814(ptr, 1)){ + func_8030CC90(ptr); + if(ptr->unk30) + ptr->unk30(indx); + } + } +} + + +int func_8030E3FC(u8 indx){ + struct45s *ptr; + + if(!indx) + return 0; + else { + ptr = sfxsource_at(indx); + return indx + && func_8030C814(ptr, 1) + && ptr->unk40 + && func_8030C8F4(ptr->unk40); + } +} + +void func_8030E484(enum sfx_e uid){ + func_8030D6C4(uid, 1.0f, 22000, 0, 2); +} + +void func_8030E4B4(enum sfx_e uid){ + func_8030D6C4(uid, 1.0f, 22000, 0, 1); +} + +void func_8030E4E4(enum sfx_e uid){ + func_8030D6C4(uid, 1.0f, 22000, 0, 0); +} + +void func_8030E510(enum sfx_e uid, s32 arg1){ + func_8030D6C4(uid, 1.0f, arg1, 0, 2); +} + +void func_8030E540(enum sfx_e uid){ + func_8030E510(uid, 0x7ff8); +} + +void func_8030E560(enum sfx_e uid, s32 arg1){ + func_8030D6C4(uid, 1.0f, arg1, 0, 0); +} + +void func_8030E58C(enum sfx_e uid, f32 arg1){ + func_8030D6C4(uid, arg1, 22000, 0, 2); +} + +void func_8030E5C0(enum sfx_e uid, f32 arg1){ + func_8030D6C4(uid, arg1, 22000, 0, 1); +} + +void func_8030E5F4(enum sfx_e uid, f32 arg1){ + func_8030D6C4(uid, arg1, 22000, 0, 0); +} + +void func_8030E624(u32 arg0){ + f32 f6 = (arg0 >> 0x15) & 0x7ff; + func_8030D6C4(arg0 & 0x7FF, f6/1023.0, (arg0 >> 6) & 0x7fe0, 0, 2); +} + +void func_8030E6A4(enum sfx_e uid, f32 arg1, s32 arg2){ + func_8030D6C4(uid, arg1, arg2, 0, 2); +} + +void func_8030E6D4(enum sfx_e uid){ + func_8030D6C4(uid, 1.0f, 0x7ff8, 0, 2); +} + +void func_8030E704(enum sfx_e uid){ + func_8030D6C4(uid, 1.0f, 0x7ff8, 0, 0); +} + +void func_8030E730(enum sfx_e uid, f32 arg1, s32 arg2){ + func_8030D6C4(uid, arg1, arg2, 0, 1); +} + +void func_8030E760(enum sfx_e uid, f32 arg1, s32 arg2){ + func_8030D6C4(uid, arg1, arg2, 0, 0); +} + +void func_8030E78C(enum sfx_e uid, f32 arg1, u32 arg2, f32 position[3], f32 arg4, f32 arg5, s32 arg6){ + u8 s0; + f32 plyr_pos[3]; + + __sfx_getPlayerPositionIfPresent(plyr_pos); + if( !(arg5 <= ml_vec3f_distance(plyr_pos, position)) + && levelSpecificFlags_validateCRC2() + && func_80320240() + ){ + s0 = func_8030D90C(); + if(s0){ + func_8030DD90(s0, arg6); + sfxsource_setSfxId(s0, uid); + sfxsource_setSampleRate(s0, arg2); + func_8030DBB4(s0, arg1); + func_8030DEB4(s0, arg4, arg5); + func_8030DF68(s0, position); + func_8030DD14(s0, 1); + func_8030E2C4(s0); + } + } +} + +void func_8030E878(enum sfx_e id, f32 arg1, u32 arg2, f32 arg3[3], f32 arg4, f32 arg5){ + func_8030E78C(id, arg1, arg2, arg3, arg4, arg5, 2); +} + +void func_8030E8B4(u32 arg0, f32 arg1[3], u32 arg2){ + func_8030E78C( + (arg0 & 0x7ff), (f32)((arg0 >> 0x15) & 0x7ff)/1023.0, ((arg0 >> 0x6) & 0x7fe0), + arg1, (f32)(arg2 & 0xffff), (f32)((arg2 >> 0x10) & 0xffff), + 2 + ); +} + +void func_8030E988(enum sfx_e uid, f32 arg1, u32 arg2, f32 arg3[3], f32 arg4, f32 arg5){ + func_8030E78C(uid, arg1, arg2, arg3, arg4, arg5, 1); +} + +void func_8030E9C4(enum sfx_e uid, f32 arg1, u32 arg2, f32 arg3[3], f32 arg4, f32 arg5){ + func_8030E78C(uid, arg1, arg2, arg3, arg4, arg5, 0); +} + +void func_8030E9FC(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, f32 arg4[3], f32 arg5, f32 arg6){ + func_8030E78C(uid, sfx_randf2(arg1, arg2), arg3, arg4, arg5, arg6, 2); +} + +void func_8030EA54(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, f32 arg4[3], f32 arg5, f32 arg6){ + func_8030E78C(uid, sfx_randf2(arg1, arg2), arg3, arg4, arg5, arg6, 1); +} + +void func_8030EAAC(enum sfx_e uid, f32 arg1, s32 arg2, s32 arg3){ + func_8030D6C4(uid, arg1, arg2, arg3, 2); +} + +void func_8030EAD8(enum sfx_e uid, f32 arg1, s32 arg2, s32 arg3){ + func_8030D6C4(uid, arg1, arg2, arg3, 0); +} + +void func_8030EB00(enum sfx_e uid, f32 arg1, f32 arg2){ + func_8030D6C4(uid, sfx_randf2(arg1, arg2), 22000, 0, 2); +} + +void func_8030EB44(enum sfx_e uid, f32 arg1, f32 arg2){ + func_8030D6C4(uid, sfx_randf2(arg1, arg2), 22000, 0, 1); +} + +void func_8030EB88(enum sfx_e uid, f32 arg1, f32 arg2){ + func_8030D6C4(uid, sfx_randf2(arg1, arg2), 22000, 0, 0); +} + +void func_8030EBC8(enum sfx_e uid, f32 arg1, f32 arg2, s32 arg3, s32 arg4){ + func_8030D6C4(uid, sfx_randf2(arg1, arg2), sfx_randi2(arg3, arg4), 0, 2); +} + +void func_8030EC20(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, u32 arg4){ + func_8030D6C4(uid, sfx_randf2(arg1, arg2), sfx_randi2(arg3, arg4), 0, 0); +} + +void func_8030EC74(enum sfx_e uid, f32 arg1, f32 arg2, u32 arg3, u32 arg4, f32 arg5[3]){ + u8 indx = func_8030D90C(); + if(indx){ + sfxsource_setSfxId(indx, uid); + sfxsource_setSampleRate(indx, sfx_randi2(arg3, arg4)); + func_8030DBB4(indx, sfx_randf2(arg1, arg2)); + func_8030DF68(indx, arg5); + func_8030DD14(indx, 1); + func_8030E2C4(indx); + } +} + +void func_8030ED0C(void){ + func_8030D644(); +} + +u8 func_8030ED2C(enum sfx_e uid, s32 arg1){ + u8 indx = func_8030D90C(); + sfxsource_setSfxId(indx, uid); + func_8030DD14(indx, arg1); + return indx; +} + +int func_8030ED70(enum sfx_e uid){ + if(!(uid < 0x3e9)){ + return func_80335520(uid - 0x3e9); + } + else{ + return func_803354EC(uid); + } +} + +void func_8030EDAC(f32 arg0, f32 arg1){ + D_80382E0C = arg0; + D_80382E10 = arg1; +} + diff --git a/src/core2/code_87E30.c b/src/core2/code_87E30.c new file mode 100644 index 00000000..a23abace --- /dev/null +++ b/src/core2/code_87E30.c @@ -0,0 +1,635 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern void func_803114D0(void ); +extern void func_803184C8(gczoombox_t *, f32, s32, s32, f32, s32, s32); +extern int func_803114B0(void); + +extern s8 D_8036C4D0[]; +extern f32 D_80378534; + +extern struct { + u8 pad0[0x100]; + u8 *unk100; + struct13s *unk104[2]; //string ptr + s32 unk10C[2]; + u8 dialogStringCount[2]; //zoombox string_count + s8 unk116[2]; + u8 unk118[2]; + struct15s unk11A[2]; + gczoombox_t *zoombox[2]; + s16 unk124[2]; + u32 unk128_31:8; + u32 unk128_23:8; + u32 unk128_15:8; + u32 unk128_7:1; + u32 unk128_6:1; + u32 unk128_5:1; + u32 unk128_4:1; + u32 unk128_3:1; + u32 pad128_2:3; + u32 unk12C_31:2; + u32 unk12C_29:2; + u32 unk12C_27:2; + u32 unk12C_25:2; + s32 unk12C_23:8; + u32 unk12C_15:4; + u32 unk12C_11:4; + u32 pad12C_7:8; + s16 unk130; + s8 unk132; + u8 pad133[0x1]; + ActorMarker *caller; + s32 unk138; + void (* unk13C)(ActorMarker *, s32, s32); + void (* unk140)(ActorMarker *, s32, s32); + s32 unk144; + struct14s unk148[4]; +} D_80382E20; + +int func_8030EDC0(ActorMarker *caller, s32 arg1){ + return (arg1 == -1)? 0: caller->unk5C == arg1; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_87E30/func_8030EDE8.s") + +static void _gcdialog_freeZoomboxes(void){ + s32 i; + for(i =0; i < 2; i++){ + gczoombox_free(D_80382E20.zoombox[i]); + D_80382E20.zoombox[i] = NULL; + } +} + +void func_8030F078(void){ + s32 i; + s32 j; + for(i = 0; i <2; i++){ + for(j =0; j < D_80382E20.dialogStringCount[i]; j++){ + D_80382E20.unk104[i][j].str = NULL; + } + D_80382E20.dialogStringCount[i] = 0; + free(D_80382E20.unk104[i]); + D_80382E20.unk104[i] = NULL; + } + if(D_80382E20.unk130 != -1){ + func_8031B6D8(D_80382E20.unk130); + } + D_80382E20.unk100 = NULL; +} + +void func_8030F130(void){ + func_8030F078(); + if(D_80382E20.zoombox[1] != NULL && !D_80382E20.unk11A[1].unk0_7){ + func_80347A14(1); + } + if(!D_80382E20.unk11A[0].unk0_7 && !D_80382E20.unk11A[1].unk0_7){ + _gcdialog_freeZoomboxes(); + } + D_80382E20.unk130 = -1; + D_80382E20.unk128_15 = 0; + D_80382E20.unk128_31 = 0; + D_80382E20.caller = NULL; + D_80382E20.unk13C = NULL; + D_80382E20.unk140 = NULL; + D_80382E20.unk144 = NULL; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_87E30/func_8030F1D0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_87E30/func_8030F218.s") + +void func_8030F338(void){ + if(D_80382E20.unk13C != NULL){ + if(D_80382E20.caller == NULL){ + D_80382E20.unk13C(D_80382E20.caller, D_80382E20.unk130, D_80382E20.unk12C_23); + }else{ + if(func_8030EDC0(D_80382E20.caller, D_80382E20.unk138)){ + D_80382E20.unk13C(D_80382E20.caller, D_80382E20.unk130, D_80382E20.unk12C_23); + } + } + } + if(D_80382E20.unk128_31 & 0x8){ + if((!func_802E4A08() && !func_803203FC(0x1F)) || !D_80382E20.unk128_3){ + func_8028F918(0); + } + }//L8030F3E8 + func_8025A55C(-1, 0x12c, 2); + func_8030F130(); +} + +void func_8030F410(Gfx **arg0, Mtx **arg1, s32 arg2){ + s32 i; + for(i = 0; i<2; i++){ + gczoombox_draw(D_80382E20.zoombox[i], arg0, arg1, arg2); + } +} + +#ifdef NONMATCHING +void func_8030F488(s32 arg0){ + s32 i; + s32 j; + s32 cmd; + + if(6 != D_80382E20.unk128_23 || arg0 != D_80382E20.unk128_23){ + switch(arg0){ + case 1: + for(i = 0; i < 2; i++){ + if(D_80382E20.zoombox[i] != NULL && D_80382E20.unk11A[i].unk0_7 == 0) + gczoombox_open(D_80382E20.zoombox[i]); + } + break; + + case 5: + for(i =0; i < 2; i++){ + if(D_80382E20.zoombox[i] != NULL && D_80382E20.unk11A[i].unk0_7 == 0){ + gczoombox_minimize(D_80382E20.zoombox[i]); + gczoombox_close(D_80382E20.zoombox[i]); + } + } + break; + + case 6: + for(i = 0; i< 2; i++){//L8030F59C + for(j = D_80382E20.unk118[i]; D_80382E20.unk104[i][j].cmd < -4 || D_80382E20.unk104[i][j].cmd >= 0; j++){ + if(D_80382E20.unk104[i][j].cmd == -7 && D_80382E20.unk140){ + if(D_80382E20.caller == NULL){ + D_80382E20.unk140(D_80382E20.caller, D_80382E20.unk130, *D_80382E20.unk104[i][j].str); + }else{ + if(func_8030EDC0(D_80382E20.caller, D_80382E20.unk138)){ + D_80382E20.unk140(D_80382E20.caller, D_80382E20.unk130, *D_80382E20.unk104[i][j].str); + } + } + } + } + } + D_80382E20.unk12C_25 = 0; + for(i=0; i< 2; i++){ + D_80382E20.unk11A[i].unk0_7 = 0; + if(D_80382E20.zoombox[i] != NULL){ + D_80382E20.unk12C_25 += func_803188B4(D_80382E20.zoombox[i]); + + } + } + break; + + case 7: + func_8030F338(); + arg0 = 0; + break; + case 8: + func_8030F338(); + for(i=0; i<2; i++){ + if(D_80382E20.unk11A[i].unk0_7 == 0){ + gczoombox_free(D_80382E20.zoombox[i]); + D_80382E20.zoombox[i] = NULL; + } + } + break; + default: + break; + } + D_80382E20.unk128_23 = arg0; + } +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_87E30/func_8030F488.s") +#endif + +void func_8030F754(s32, s32); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_87E30/func_8030F754.s") +// void func_8030F754(s32 arg0, s32 arg1){ +// f32 sp90[3]; +// f32 sp84[3]; +// if(D_80382E20.unk128_31){ +// func_8024E5A8(0, &sp90); +// func_8024E640(0, &sp84); +// }else{ +// func_8024E55C(0, &sp90); +// func_8024E60C(0, &sp84); +// }//L8030F9F4 +// } + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_87E30/func_8030F990.s") + +//parses text asset into seperate strings +void func_80310574(s32 text_id); +#ifdef NONMATCHING +void func_80310574(s32 text_id){ + s32 i; + s32 j; + u8 *txt; + s32 _v0; + s32 ch; + s32 len; + + txt = D_80382E20.unk100 = func_8031B66C(text_id); + + for(i = 0; i < 2; i++){ + D_80382E20.dialogStringCount[i] = *(txt++); + D_80382E20.unk104[i] = (struct13s *) malloc(D_80382E20.dialogStringCount[i]*sizeof(struct13s)); + for(j = 0; j < D_80382E20.dialogStringCount[i]; j++){//L803105F0 + ch = _v0 = *(txt++); + if(ch > 0 && ch < 0x20){ + _v0 = -ch; + } + else{ + _v0 = (ch >= 0x80)? ch - 0x80 : ch; + } + + D_80382E20.unk104[i][j].cmd = _v0; + len = *(txt++); + D_80382E20.unk104[i][j].str = txt; + txt += len; + + } + //L80310664 + } +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_87E30/func_80310574.s") +#endif + +s32 func_8031068C(s32 arg0){ + return (arg0) ? 0 : 0xA0; +} + +int func_803106A4(s32 arg0){ + return (arg0) ? 1 : 0; +} + +void func_803106BC(s32 text_id, s32 arg1, ActorMarker *marker, void(*callback)(ActorMarker *, s32, s32), void(*arg4)(ActorMarker *, s32, s32), s32 arg5){ + s32 i; + s32 j; + + s32 temp_a2; + + func_80310574(text_id); + D_80382E20.unk12C_29 = 0; + D_80382E20.unk12C_31 = (D_80382E20.unk12C_25 = D_80382E20.unk12C_29); + D_80382E20.unk12C_27 = D_80382E20.unk12C_31; + D_80382E20.unk128_15 = D_80382E20.unk12C_27; + for(j = 0; j < 2; j++){//L80310774 + i = 0; + temp_a2 = D_80382E20.unk104[j][0].cmd; + while(D_80382E20.unk104[j][i].cmd < -4 && i < D_80382E20.dialogStringCount[j]){ + i++; + }; + D_80382E20.unk116[j] = temp_a2; + //L803107C4 + D_80382E20.unk10C[j] = D_80382E20.unk104[j]->str; + D_80382E20.unk118[j] = 0; + D_80382E20.unk124[j] = func_8031068C(j); + D_80382E20.unk11A[j].unk0_5 = 0; + if(D_80382E20.unk104[j][i].cmd >= 0){ + if(!D_80382E20.unk11A[j].unk0_7){ + D_80382E20.zoombox[j] = gczoombox_new(D_80382E20.unk124[j], D_80382E20.unk104[j][i].cmd + 0xC, 0, func_803106A4(j), func_8030F754); + if( j == 1 ){ + func_80347A14(0); + } + } else{//L80310860 + D_80382E20.unk12C_31++; + } //L80310880 + D_80382E20.unk128_15++; + }else{//L80310890 + if(D_80382E20.unk104[j][i].cmd < -2){ + if(D_80382E20.unk11A[j].unk0_7){ + gczoombox_close(D_80382E20.zoombox[j]); + D_80382E20.unk128_15++; + }else{ + D_80382E20.zoombox[j] = NULL; + } + D_80382E20.unk11A[j].unk0_7 = 0; + }else{//L803108D8 + if(D_80382E20.unk11A[j].unk0_7){ + D_80382E20.unk128_15++; + D_80382E20.unk12C_31++; + } + } + }//L80310910 + } + D_80382E20.unk130 = text_id; + D_80382E20.unk128_31 = arg1; + if(D_80382E20.unk116[0] < 0){ + D_80382E20.unk128_7 = 0; + }else{//L80310950 + D_80382E20.unk128_7 = 1; + }//L8031095C + D_80382E20.unk128_6 = 1; + D_80382E20.unk12C_23 = ((func_802E4A08() || func_803203FC(0x1F)) && D_80382E20.unk128_3) ? 1 : -1; + D_80382E20.caller = marker; + D_80382E20.unk13C = callback; + D_80382E20.unk140 = arg4; + D_80382E20.unk144 = arg5; + D_80382E20.unk138 = (marker != NULL )? ((marker->unk5C)? marker->unk5C : -1) : 0; + func_8030F488(((func_802E4A08() || func_803203FC(0x1F)) && D_80382E20.unk128_3) ? 6 : 1); + //L803109EC +} + +void func_80310A5C(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4){ + s32 i; + f32 tmpf; + for(i = 0, tmpf = D_80378534; i< 2; i++){ + if(D_80382E20.zoombox[i]){ + func_803184C8(D_80382E20.zoombox[i], arg2, arg0, arg1, tmpf, arg3, arg4); + } + } +} + +void func_80310B1C(s32 text_id, s32 arg1, ActorMarker *marker, void(*callback)(ActorMarker *, s32, s32), void(*arg4)(ActorMarker *, s32, s32), s32 arg5){ + func_803106BC(text_id, arg1, marker, callback, arg4, arg5); + if(map_get() == MAP_90_GL_BATTLEMENTS && 0x10ec < text_id){ + func_80310A5C( 3, 4, 0x1e, arg1 & 2, arg1 & 0x80); + } + else{ + func_80310A5C( 5, 2, 0xF, arg1 & 2, arg1 & 0x80); + } +} + +void func_80310BB4(s32 arg0, s32 arg1, s32 arg2){ + func_80310A5C(arg1, arg2, arg0, D_80382E20.unk128_31 & 2, D_80382E20.unk128_31 & 0x80); +} + +void func_80310BFC(void){ + s32 ch; + if(D_80382E20.unk128_4){ + D_80382E20.unk132++; + ch = D_8036C4D0[D_80382E20.unk132]; + if(D_80382E20.zoombox[0] != NULL){ + D_80382E20.unk124[0] -= ch; + func_80318B7C(D_80382E20.zoombox[0], D_80382E20.unk124[0]); + }//L80310C60 + + if(D_80382E20.zoombox[1] != NULL){ + D_80382E20.unk124[1] += ch; + func_80318B7C(D_80382E20.zoombox[1], D_80382E20.unk124[1]); + }//L80310C84 + if(D_80382E20.unk132 == 0xC){ + D_80382E20.unk128_5 = 0; + } + }else{//L80310CA4 + D_80382E20.unk132--; + ch = D_8036C4D0[D_80382E20.unk132]; + if(D_80382E20.zoombox[0] != NULL){ + D_80382E20.unk124[0] += ch; + func_80318B7C(D_80382E20.zoombox[0], D_80382E20.unk124[0]); + } + if(D_80382E20.zoombox[1] != NULL){ + D_80382E20.unk124[1] -= ch; + func_80318B7C(D_80382E20.zoombox[1], D_80382E20.unk124[1]); + } + if(D_80382E20.unk132 == 0){ + D_80382E20.unk128_5 = 0; + } + } +} + +void func_80310D2C(void){ + struct14s * sp24; + + if(D_80382E20.unk128_5) + func_80310BFC(); + + if(getGameMode() == GAME_MODE_3_NORMAL || func_802E4A08()){ + if(D_80382E20.unk128_5) + return; + + if(!func_803114B0() && (s32)(D_80382E20.unk12C_15) > 0){ + + sp24 = D_80382E20.unk148 + D_80382E20.unk12C_11; + func_80310B1C(sp24->unk0,sp24->unk2, sp24->unk10, sp24->unk18, sp24->unk1C, sp24->unk20); + + D_80382E20.unk138 = sp24->unk14; + func_8025A55C(8000, 300, 2); + if((sp24->unk2 & 0x8) && !((func_802E4A08() || func_803203FC(0x1F)) && D_80382E20.unk128_3)){//L80310E6C + func_8028F918(0); + if( 0.0f == sp24->unk4_x + && 0.0f == sp24->unk4_y + && 0.0f == sp24->unk4_z + ){ + func_8028F918((D_80382E20.unk116[1] < 0)? 1 : 3); + } + else{//L80310F00 + func_8028F94C((D_80382E20.unk116[1] < 0)? 1 : 3, sp24->unk4); + } + } //L80310F28 + + D_80382E20.unk12C_11++; + if(!((s32) D_80382E20.unk12C_11 < 4)){ + D_80382E20.unk12C_11 = D_80382E20.unk12C_11 - 4; + } + D_80382E20.unk12C_15--; + + }else{//L80310F88 + func_8030F990(); + }//L80310F98 + if( ( D_80382E20.unk128_23 != 0 && D_80382E20.unk128_23 != 5 && D_80382E20.unk128_23 != 7) + || ((!D_80382E20.unk128_23 && (D_80382E20.unk11A[0].unk0_7 || D_80382E20.unk11A[1].unk0_7))) + || D_80382E20.unk12C_15 + ){ + //L80310FF0 + if(func_802FADD4(0)){ + if(item_getCount(ITEM_6_HOURGLASS) != 0) + func_802FACA4(0x28); + else + func_802FAD64(ITEM_0_HOURGLASS_TIMER); + } + else { + if(func_802FADD4(3)){ + if(item_getCount(ITEM_3_PROPELLOR_TIMER) != 0){ + func_802FACA4(0x28); + } + else{ + func_802FAD64(ITEM_3_PROPELLOR_TIMER); + } + } + } + //L80311068 + if(func_802FBE04()) + func_802FACA4(0x2A); + + if(func_802FC390()){ + func_802FACA4(0x29); + } + } + else{//L803110A0 + if(func_802FAD9C(0x28)) + func_802FAD64(0x28); + + if(func_802FAD9C(0x2A)) + func_802FAD64(0x2A); + + if(func_802FAD9C(0x29)) + func_802FAD64(0x29); + + } + } +} + +int func_803110F8(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4){ + func_8025A55C(15000, 300, 2); + func_80311174(arg0 + 0xe57, 0x84, NULL, NULL, NULL, NULL, arg4); + func_80310A5C(arg2, arg3, arg1, 0, 0); + return 1; +} + +int func_80311174(s32 text_id, s32 arg1, f32 *pos, ActorMarker *marker, void(*callback)(ActorMarker *, enum asset_e, s32), void(*arg5)(ActorMarker *, enum asset_e, s32), s32 arg6){ + f32 pad; + s32 temp_v1; + + if(func_803203FC(1) || func_802D686C()) + return 0; + + if(!func_803114B0()){ + func_80310B1C(text_id, arg1, marker, callback, arg5, arg6); + if(arg1 & 8){ + if(!(func_802E4A08() || func_803203FC(0x1f)) || !D_80382E20.unk128_3){//L80311214 + if(pos != NULL){ + func_8028F94C(((D_80382E20.unk116[1] < 0)? 1 : 3), pos); + }else{//L8031126C + func_8028F918(((D_80382E20.unk116[1] < 0)? 1 : 3)); + } + } + }//L8031128C + func_8025A55C(0x1f40, 0x12c, 2); + return 1; + }else{//L803112A0 + if(arg1 & 0x20){ + if(!(D_80382E20.unk128_31 & 0x80)){ + func_803114D0(); + } + else{ + D_80382E20.unk12C_15 = 0; + D_80382E20.unk12C_11 = 0; + } + }//L803112E8 + if(arg1 & 0x04 || arg1 & 0x20){ + + //L80311300 + temp_v1 = D_80382E20.unk12C_11 + D_80382E20.unk12C_15; + temp_v1 = (temp_v1 < 4)?temp_v1 : temp_v1 - 4; + //L80311328 + D_80382E20.unk148[temp_v1].unk0 = text_id; + D_80382E20.unk148[temp_v1].unk2 = arg1; + if(pos){ + D_80382E20.unk148[temp_v1].unk4[0] = pos[0]; + D_80382E20.unk148[temp_v1].unk4[1] = pos[1]; + D_80382E20.unk148[temp_v1].unk4[2] = pos[2]; + } + else{ + D_80382E20.unk148[temp_v1].unk4[2] = 0.0f; + D_80382E20.unk148[temp_v1].unk4[1] = 0.0f; + D_80382E20.unk148[temp_v1].unk4[0] = 0.0f; + } + D_80382E20.unk148[temp_v1].unk10 = marker; + D_80382E20.unk148[temp_v1].unk14 = (marker != NULL )? ((marker->unk5C)? marker->unk5C : -1) : 0; + D_80382E20.unk148[temp_v1].unk18 = callback; + D_80382E20.unk148[temp_v1].unk1C = arg5; + D_80382E20.unk148[temp_v1].unk20 = arg6; + D_80382E20.unk12C_15++; + if(arg1 & 0x08){ + if(!( func_802E4A08() || func_803203FC(0x1f, &D_80382E20)) || !D_80382E20.unk128_3){//L8031141C + if(!func_8028EC04()){ + if(pos != NULL){ + func_8028F94C(2, pos); + } + else{//L80311444 + func_8028F918(2); + } + } + else{//L80311454 + func_8028F918(func_8028EC04()); + } + } + } + return 1; + } + } + return 0; +} + + +bool func_80311480(s32 text_id, s32 arg1, f32 *pos, ActorMarker *marker, void(*callback)(ActorMarker *, enum asset_e, s32), void(*arg5)(ActorMarker *, enum asset_e, s32)){ + return func_80311174(text_id, arg1, pos, marker, callback, arg5, 0); +} + +int func_803114B0(void){ + return (D_80382E20.unk130 + 1) != 0; +} + +int func_803114C4(void){ + return D_80382E20.unk130; +} + +#ifdef NONMATCHING +void func_803114D0(void){ + s32 i; + + if(func_803114B0()){ + func_8030F488(6); + }else{ + if(D_80382E20.unk128_23 != 6){ + D_80382E20.unk12C_25 = 0; + for(i = 0; i< 2; i++){ + D_80382E20.unk11A[i].unk0_7 = 0; + if(D_80382E20.zoombox[i]){ + D_80382E20.unk12C_25 = D_80382E20.unk12C_25 + func_803188B4(D_80382E20.zoombox[i]); + } + } + if(D_80382E20.unk12C_25 != 0){ + D_80382E20.unk128_23 = 6; + } + } + }//L80311594 + D_80382E20.unk12C_15 = 0; + D_80382E20.unk12C_11 = 0; + +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_87E30/func_803114D0.s") +#endif + +int func_803115C4(s32 arg0){ + if(func_803114C4() != arg0){ + return 0; + }else{ + func_8030F488(6); + return 1; + } +} + +void func_80311604(void){ + if(func_803114B0()){ + D_80382E20.unk128_5 = 1; + D_80382E20.unk128_4 = 0; + D_80382E20.unk132++; + } +} + +void func_80311650(void){ + if(func_803114B0()){ + D_80382E20.unk128_5 = 1; + D_80382E20.unk128_4 = 1; + D_80382E20.unk132--; + } +} + +void func_8031169C(void){ + s32 i; + + for(i = 0; i< 2; i++){ + func_80318C0C(D_80382E20.zoombox[i]); + if(D_80382E20.unk104[i]){ + D_80382E20.unk104[i] = (struct13s *)defrag(D_80382E20.unk104[i]); + } + if(D_80382E20.zoombox[i] != NULL){ + D_80382E20.zoombox[i] = (gczoombox_t *)defrag(D_80382E20.zoombox[i]); + } + } +} + +void func_80311714(int arg0){ + D_80382E20.unk128_3 = arg0; +} \ No newline at end of file diff --git a/src/core2/code_8DA0.c b/src/core2/code_8DA0.c new file mode 100644 index 00000000..1d97b649 --- /dev/null +++ b/src/core2/code_8DA0.c @@ -0,0 +1,74 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +u8 D_8037BFE0; +f32 D_8037BFE4; +f32 D_8037BFE8[5]; + +/* .code */ +s32 func_8028FD30(void) { + s32 i; + s32 cnt; + + cnt = 0; + for(i = 0; i < 5; i++){ + if(D_8037BFE8[i] != 0.0f){ + cnt++; + } + } + return cnt; +} + +bool func_8028FDC8(f32 arg0) { + s32 i; + + for(i = 0; i < 5; i++){ + if(arg0 - 0.25 < D_8037BFE8[i]){ + D_8037BFE4 = arg0; + return FALSE; + } + } + for(i = 0; i < 5; i++){ + if (D_8037BFE8[i] == 0.0f) { + D_8037BFE8[i] = arg0; + return TRUE; + } + } + D_8037BFE4 = arg0; + return FALSE; +} + +void func_8028FEF0(void) { + s32 i; + + for(i = 0; i < 5; i++){ + D_8037BFE8[i] = 0.0f; + } + D_8037BFE0 = D_8037BFE4 = 0.0f; +} + +void func_8028FFBC(bool arg0){ + D_8037BFE0 = arg0; + if(!D_8037BFE0){ + func_8028FEF0(); + } +} + +void func_8028FFF0(void) { + f32 temp_f0; + s32 i; + + if (D_8037BFE0 != 0) { + for(i = 0; i < 5; i++){ + func_80259430(&D_8037BFE8[i]); + } + if (D_8037BFE4 != 0.0f) { + temp_f0 = D_8037BFE4; + D_8037BFE4 = 0.0f; + func_8028FDC8(temp_f0); + } + } +} + diff --git a/src/core2/code_8DC20.c b/src/core2/code_8DC20.c new file mode 100644 index 00000000..7ec63991 --- /dev/null +++ b/src/core2/code_8DC20.c @@ -0,0 +1,60 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern Gfx D_8036C630[]; +extern Gfx D_8036C690[]; + +extern s32 D_803830A0; + +extern s16 D_803A5D00[2][0xF660]; + +/* .code */ +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_8DC20/func_80314BB0.s") +#else +void func_80314BB0(Gfx **gfx, Mtx **mtx, Vtx **vtx, void * frame_buffer_1, void *frame_buffer_2) { + s32 x; + s32 y; + + gSPDisplayList((*gfx)++, D_8036C630); + gDPSetColorImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_80276588, OS_PHYSICAL_TO_K0(frame_buffer_1)); + for(y = 0; y < D_8027658C / 32 + 1; y++){ + for(x = 0; x < D_80276588 / 32 + 1; x++){ + gDPLoadTextureTile((*gfx)++, osVirtualToPhysical(frame_buffer_2), G_IM_FMT_RGBA, G_IM_SIZ_16b, D_80276588, D_8027658C, + 0x20*x, 0x20*y, 0x20*(x + 1) - 1, 0x20*(y + 1) - 1, + NULL, G_TX_CLAMP, G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, 0, 0 + ); + gSPScisTextureRectangle((*gfx)++, 0x80*x, 0x80*y, 0x80*(x + 1), 0x80*(y + 1), + G_TX_RENDERTILE, (0x20*x)<<5, (0x20*y)<<5, 0x400, 0x400 + ); + } + } + gSPDisplayList((*gfx)++, D_8036C690); + gDPSetColorImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, D_80276588, OS_PHYSICAL_TO_K0(D_803A5D00[func_8024BDA0()])); +} +#endif + +void func_80315084(Gfx **gfx, Mtx **mtx, Vtx **vtx){ + func_80335128(0); + D_803830A0 = 2; + func_80314BB0(gfx, mtx, vtx, func_80253540(), D_803A5D00[func_8024BDA0()]); +} + +void func_80315110(Gfx **gfx, Mtx **mtx, Vtx **vtx){ + if(!D_803830A0){ + if(map_get() != MAP_90_GL_BATTLEMENTS){ + func_803306C8(2); + func_8032AD7C(2); + } + } + else{ + D_803830A0--; + } + func_80314BB0(gfx, mtx, vtx, D_803A5D00[func_8024BDA0()], func_80253540()); +} + +void func_803151D0(Gfx **gfx, Mtx **mtx, Vtx **vtx){ + func_80335128(1); +} diff --git a/src/core2/code_90E0.c b/src/core2/code_90E0.c new file mode 100644 index 00000000..cfb19f0d --- /dev/null +++ b/src/core2/code_90E0.c @@ -0,0 +1,82 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80292E00(s32, f32); + +typedef struct { + f32 unk0; + u8 unk4; + //u8 pad5[3]; + f32 unk8; +} Struct_core2_7060_0; + +/* .data */ +extern Struct_core2_7060_0 D_803636D0; +extern Struct_core2_7060_0 D_80363754; + +/* .bss */ +struct{ + Struct_core2_7060_0 *unk0; + f32 unk4; + u8 unk8; + u8 unk9; +} D_8037C000; + +/* .code */ +void func_80290070(void){ + D_8037C000.unk0 = NULL; + D_8037C000.unk9 = FALSE; + D_8037C000.unk8 = 0; + D_8037C000.unk4 = 0.0f; +} + +void func_80290090(Struct_core2_7060_0 *arg0){ + D_8037C000.unk0 = arg0; + D_8037C000.unk9 = TRUE; + D_8037C000.unk8 = 0; + D_8037C000.unk4 = arg0->unk0; +} + +void func_802900B4(void){ + func_80290090(&D_803636D0); +} + +void func_802900D8(void){ + func_80290090(&D_80363754); +} + +void func_802900FC(void){ + D_8037C000.unk9 = FALSE; +} + +void func_80290108(void) { + f32 phi_f20; + Struct_core2_7060_0 *phi_s0; + + if (D_8037C000.unk9){ + phi_f20 = time_getDelta(); + while(phi_f20 > 0.0f){ + D_8037C000.unk4 -= phi_f20; + if(D_8037C000.unk4 > 0.0f) + break; + + phi_f20 = mlAbsF(D_8037C000.unk4); + phi_s0 = &D_8037C000.unk0[D_8037C000.unk8]; + func_80292E00(phi_s0->unk4, phi_s0->unk8); + phi_s0++; + if (phi_s0->unk4 == 4) { + if (phi_s0->unk0 == 0.0f) { + D_8037C000.unk9 = FALSE; + return; + } + phi_s0 = D_8037C000.unk0; + D_8037C000.unk8 = 0; + } + else{ + D_8037C000.unk8++; + } + D_8037C000.unk4 = phi_s0->unk0; + } + } +} diff --git a/src/core2/code_91E10.c b/src/core2/code_91E10.c new file mode 100644 index 00000000..419b91a4 --- /dev/null +++ b/src/core2/code_91E10.c @@ -0,0 +1,640 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void item_set(enum item_e, s32); +extern void func_8025A55C(s32, s32, s32); +extern void func_803184C8(gczoombox_t *, f32, s32, s32, f32, bool, bool); + + +typedef struct { + u8 cmd; + u8 string_size; + //u8 str[]; +}StringBin; + +typedef struct { + u8 unk0; + u8 unk1; +}QuizQuestionBin_Struct_1; + +typedef struct { + u8 unk0; + u8 unk1; + u8 unk2; +}QuizQuestionBin; + +typedef struct{ + s32 unk0[4][4]; +}Struct_Core2_91E10_1; + +typedef struct { + s8 unk0; //question_type + s8 unk1; //question_indx + s8 unk2; + u8 unk3; + s32 unk4; + void (*unk8)(s32, s32); + QuizQuestionBin *unkC; //asset_bin + u8 unk10; //state + s8 unk11; + s8 unk12; + u8 unk13; //selected_box_indx + u8 unk14; + u8 unk15; //cursor_cooldown + u8 unk16; + u8 unk17; + u8 unk18[4]; + s8 unk1C[4]; + s8 unk20[4]; //portrait_id + gczoombox_t *unk24[4]; //zoombox + Struct_Core2_91E10_1 unk34; +}Struct_Core2_91E10; + +void func_803197AC(s32 arg0); +void func_80319E20(s32 arg0, s32 arg1); +void func_8031A3E4(void); + +extern u8 D_8036D940[]; + +extern Struct_Core2_91E10 *D_803830E0; + +void func_80318DA0(s8 *ptr, u8 min_indx, u8 max_indx, s32 min_value, s32 max_value){ + s32 i; + s32 j; + s32 unique; + + for(i = min_indx; i <= max_indx; i++){ + /* assign unique random value*/ + do{ + /*assign random value */ + ptr[i] = randi2(min_value, max_value + 1); + unique = TRUE; + /* test uniqueness */ + for(j = min_indx; j < i; j++){ + if (ptr[i] == ptr[j]) { + unique = FALSE; + break; + } + } + }while(unique == FALSE); + } +} + +void func_80318E90(void) { + D_803830E0->unk20[0] = 0; + func_80318DA0(D_803830E0->unk20, 1, 3, 1, 0x2C); +} + +//__gcquiz_get_type_start_id +enum asset_e func_80318ED8(enum ff_question_type_e question_type){ + switch(question_type){ + case FFQT_1_PICTURE: return 0x12DB; + case FFQT_2_SOUND: return 0x13A3; + case FFQT_3_GRUNTY: return 0x1407; + } + return 0x1213; +} + +//__gcquiz_get_type_end_id +enum asset_e func_80318F1C(enum ff_question_type_e question_type){ + switch(question_type){ + case FFQT_1_PICTURE: return 0x12EE; + case FFQT_2_SOUND: return 0x13D6; + case FFQT_3_GRUNTY: return 0x1425; + } + return 0x1277; +} + +s32 func_80318F60(enum ff_question_type_e question_type, s32 q_indx, s32 arg2) { + s32 phi_v1; + s32 phi_a0; + + if (arg2 >= 0) { + phi_v1 = arg2; + } else { + if (question_type == FFQT_3_GRUNTY) { + phi_a0 = func_80320424((q_indx * 2) + 0x26, 2); + } else { + phi_a0 = 0; + } + phi_v1 = phi_a0; + } + return phi_v1; +} + +bool func_80318FB4(enum ff_question_type_e question_type){ + return question_type == FFQT_2_SOUND; +} + +s32 func_80318FC0(s32 arg0){ + switch(arg0){ + case 1: return 40; + case 2: return 80; + case 3: return 120; + } + return 0; +} + +s32 func_80319004(s32 arg0){ + return arg0 == 0 ? 3 : 2; +} + +s32 func_8031901C(s32 arg0){ + return 0; +} + +bool func_80319028(s32 arg0){ + return arg0 != 0 ? FALSE : TRUE; +} + +//__gcquiz_animation_duration +f32 func_80319040(s32 arg0){ + return 0.4f; +} + +void func_80319050(void) { + s32 i; + + D_803830E0 = malloc(0x74); + D_803830E0->unkC = malloc(0x400); + D_803830E0->unk16 = 0x14U; + D_803830E0->unk17 = 0x1E; + D_803830E0->unk20[0] = 0; + D_803830E0->unk24[0] = gczoombox_new(func_80318FC0(0), 0, func_80319004(0), func_8031901C(0), func_80319E20); + func_803184C8(D_803830E0->unk24[0], (f32)D_803830E0->unk16, 5, 2, func_80319040(0), func_80319028(0), 0); + for(i = 1; i < 4; i++){ + D_803830E0->unk20[i] = 0; + D_803830E0->unk24[i] = NULL; + } + func_803197AC(0); +} + +void func_80319190(void) { + s32 i; + + if (D_803830E0 != NULL) { + free(D_803830E0->unkC); + D_803830E0->unkC = NULL; + for(i = 0; i < 4; i++){ + gczoombox_free(D_803830E0->unk24[i]); + D_803830E0->unk24[i] = NULL; + } + free(D_803830E0); + D_803830E0 = NULL; + } +} + +void func_80319214(Gfx **gfx, Mtx **mtx, Vtx **vtx) { + s32 i; + + if (D_803830E0 != NULL) { + for(i = 0; i < 4; i++){ + gczoombox_draw(D_803830E0->unk24[i], gfx, mtx, vtx); + } + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_91E10/func_803192A4.s") +#else +bool func_803192A4(enum ff_question_type_e q_type, s32 q_indx, s32 arg2) { + s32 sp60; + s32 sp54; + s32 sp50; + s32 sp48; + s32 sp44; + s32 sp30; + s32 sp2C; + s32 temp_a1; + s32 temp_a1_2; + s32 temp_a2; + s32 temp_a2_2; + s32 temp_s0; + s32 temp_s2; + s32 temp_v0; + s32 temp_v0_2; + s32 temp_v0_3; + s32 temp_v0_5; + s32 temp_v0_7; + s32 temp_v1; + u8 *temp_s0_7; + u8 temp_t0; + u8 str_cnt; + QuizQuestionBin *q_bin; + QuizQuestionBin_Struct_1 *temp_s0_3; + StringBin *temp_s0_4; + u8 *temp_s0_5; + s32 phi_v1; + s32 phi_v1_2; + s32 phi_v1_3; + s32 phi_a3; + s32 phi_a3_2; + s32 phi_t0; + s32 phi_a2; + s32 phi_a3_3; + s32 phi_a1; + s32 phi_v1_4; + s32 phi_a0; + void *phi_s0; + s32 phi_a0_2; + s32 phi_a0_3; + s32 phi_a1_2; + s32 phi_a0_4; + s32 phi_a0_5; + + temp_s0 = func_80318ED8(q_type) + q_indx; + if (func_8031A3BC() != 0) { + return 0; + } + if (func_8033BDAC(temp_s0, D_803830E0->unkC, 0x400) == 0) { + free(D_803830E0->unkC); + D_803830E0->unkC = (QuizQuestionBin *) assetcache_get(temp_s0); + } + q_bin = D_803830E0->unkC; + sp50 = q_bin->unk2; + phi_v1_4 = 0; + if (q_bin->unk1 >= 2) { + sp54 = q_bin->unk1; + phi_v1_4 = func_80318F60(q_type, q_indx, arg2); + } + temp_s2 = phi_v1_4 + 1; + phi_v1 = sp50 == 0; + if (phi_v1 == 0) { + sp54 = q_bin->unk1; + phi_v1 = func_80318FB4(q_type) != 0; + } + phi_a0_2 = 0; + phi_a0_3 = 0; + if (phi_v1 != 0) { + sp30 = q_bin->unk1 + sp50; + sp2C = temp_s2 - 1; + do { + temp_v0 = randi2(0, sp30); + sp2C = sp2C; + sp48 = temp_v0 + 1; + } while (temp_v0 == sp2C); + do { + temp_v0_2 = randi2(0, sp30); + sp44 = temp_v0_2 + 1; + } while (temp_v0_2 == sp2C || sp44 == sp48); + } else { + sp54 = q_bin->unk1; + sp48 = randi2(0, sp50) + q_bin->unk1 + 1; + phi_t0 = q_bin->unk1; + do { + sp44 = randi2(0, sp50) + sp54 + 1; + } while (sp48 == sp44); + } + temp_s0_3 = (s32)q_bin +sizeof(QuizQuestionBin) + func_8031B5B0()*2; + temp_s0_4 = (s32)D_803830E0->unkC + (temp_s0_3->unk0 + (temp_s0_3->unk1 << 8)) + 1; + str_cnt = *((u8*)temp_s0_4 - 1); + phi_a1_2 = 0; + for(phi_a1 = 0; phi_a1 < 4; phi_a1++){ + D_803830E0->unk18[phi_a1] = 0; + } + + for(phi_a1_2 = 0; phi_a1_2 < str_cnt; phi_a1_2++){ + temp_s0_5 = temp_s0_4 + 1; + temp_v0_3 = temp_s0_4->cmd - 0x80; + phi_a1_2 = 1; + if ((temp_v0_3 == 0) || (temp_v0_3 == temp_s2) || (temp_v0_3 == sp48) || (temp_v0_3 == sp44)) { + if (temp_v0_5 == 0) { + sp60 = 0; + } else if (temp_v0_5 == temp_s2) { + sp60 = 1; + } else if (temp_v0_5 == sp48) { + sp60 = 2; + } else if (temp_v0_5 == sp44) { + sp60 = 3; + } + } + D_803830E0->unk34.unk0[sp60][D_803830E0->unk18[sp60]] = temp_s0_5; + D_803830E0->unk18[sp60]++; + temp_s0_4 = (s32)temp_s0_5 + temp_s0_4->string_size; + } + return TRUE; +} +#endif + + +void func_803196D0(s32 arg0) { + gczoombox_open(D_803830E0->unk24[arg0]); + gczoombox_maximize(D_803830E0->unk24[arg0]); + func_80318284(D_803830E0->unk24[arg0], D_803830E0->unk18[D_803830E0->unk1C[arg0]], D_803830E0->unk34.unk0[D_803830E0->unk1C[arg0]]); +} + +//__gcquiz_set_box_highlight +void func_80319758(s32 indx, bool arg1){ + gczoombox_highlight(D_803830E0->unk24[indx], arg1); + func_80318C48(D_803830E0->unk24[indx], arg1); +} + +void func_803197AC(s32 arg0){ + s32 i; + s32 j; + + switch(arg0){ + case 0: //803197F0 + D_803830E0->unk0 = 0; + D_803830E0->unk1 = 0; + D_803830E0->unk3 = 0; + D_803830E0->unk8 = 0; + D_803830E0->unk12 = -1; + D_803830E0->unk14 = 0; + D_803830E0->unk11 = -2; + func_803184C8(D_803830E0->unk24[0], (f32) D_803830E0->unk16, 5, 2, func_80319040(0), func_80319028(0), 0); + func_80318774(D_803830E0->unk24[0]); + gczoombox_highlight(D_803830E0->unk24[0], 1); + for(i = 0; i < 4; i++){ + D_803830E0->unk1C[i] = -1; + for(j = 0; j < 4; j++){ + D_803830E0->unk34.unk0[i][j] = 0; + } + } + break; + + case 1: //80319910 + gczoombox_open(D_803830E0->unk24[0]); + gczoombox_maximize(D_803830E0->unk24[0]); + func_80318284(D_803830E0->unk24[0], D_803830E0->unk18[0], D_803830E0->unk34.unk0[0]); + break; + + case 2: //8031994C + if (D_803830E0->unk0 != -1) { + func_80318E90(); + for(i = 1; i < 4; i++){ + D_803830E0->unk24[i] = gczoombox_new(func_80318FC0(i), D_8036D940[D_803830E0->unk20[i]], func_80319004(i), func_8031901C(i), func_80319E20); + func_803184C8(D_803830E0->unk24[i], (f32)D_803830E0->unk17, 5, 2, func_80319040(i), func_80319028(i), 0); + } + } else { + for(i = 1; i < 4; i++){ + D_803830E0->unk24[i] = gczoombox_new(func_80318FC0(i), D_803830E0->unk20[i], 1, func_8031901C(i), func_80319E20); + func_803184C8(D_803830E0->unk24[i], (f32)D_803830E0->unk17, 5, 2, func_80319040(i), func_80319028(i), 0); + } + } + timedFunc_set_1(0.0f, func_803197AC, 3); + timedFunc_set_1(0.0f, func_803196D0, 1); + timedFunc_set_1(0.2f, func_803196D0, 2); + timedFunc_set_1(0.4f, func_803196D0, 3); + break; + + case 3: //80319B78 + case 4: //80319B78 + case 5: //80319B78 + if(1){} + break; + + case 6: //80319B84 + item_set(ITEM_0_HOURGLASS_TIMER, D_803830E0->unk3 * 60 - 1); + item_set(ITEM_6_HOURGLASS, TRUE); + D_803830E0->unk15 = 0; + D_803830E0->unk13 = 1U; + for(i = 1; i < 4; i++){ + func_80319758(i, (i == D_803830E0->unk13) ? TRUE : FALSE); + } + break; + + case 7: //80319C0C + if (D_803830E0->unk0 != -1) { + D_803830E0->unk11 = (D_803830E0->unk12 == -1) ? -1 + : (D_803830E0->unk1C[D_803830E0->unk12] == 1) ? 1 + : 0; + } else { + D_803830E0->unk11 = (s8) D_803830E0->unk12; + } + if (D_803830E0->unk12 != -1) { + for(i = 1; i < 4; i++){ + if (i != D_803830E0->unk12) { + gczoombox_minimize(D_803830E0->unk24[i]); + gczoombox_close(D_803830E0->unk24[i]); + } else { + func_80318C48(D_803830E0->unk24[i], 0); + } + } + } + timedFunc_set_1(1.0f, func_803197AC, 8); + item_set(ITEM_6_HOURGLASS, FALSE); + break; + + case 8: //80319CFC + if (D_803830E0->unk0 != -1) { + func_8025A70C((D_803830E0->unk11 == 1)? COMUSIC_2B_DING_B : COMUSIC_2C_BUZZER); + } else { + func_8025A70C(COMUSIC_2B_DING_B); + } + timedFunc_set_1(1.0f, func_803197AC, 9); + break; + + case 9: //80319D6C + func_8031A3E4(); + break; + + case 10: //80319D80 + if (D_803830E0->unk8 != NULL) { + D_803830E0->unk8(D_803830E0->unk4, D_803830E0->unk11); + } + for(i = 1; i < 4; i++){ + gczoombox_free(D_803830E0->unk24[i]); + D_803830E0->unk24[i] = NULL; + } + func_8025A55C(-1, 500, 10); + break; + + default: + break; + } + D_803830E0->unk10 = arg0; +} + +void func_80319E20(s32 arg0, s32 arg1) { + if (arg1 == 3) { + if (arg0 == D_803830E0->unk20[0]) { + if (D_803830E0->unk8 != NULL) { + D_803830E0->unk8(D_803830E0->unk4, D_803830E0->unk11); + } + } else { + func_803197AC(D_803830E0->unk10 + 1); + } + } else if (arg1 == 5) { + D_803830E0->unk14++; + } +} + +void func_80319EA4(void) { + s32 sp58[6]; + f32 sp4C[3]; + s32 phi_s0; + f32 sp44; + + if(getGameMode() != GAME_MODE_3_NORMAL && func_802E4A08() == 0) + return; + + if(D_803830E0 == NULL) + return; + + func_8024E55C(0, sp58); + func_8024E71C(0, sp4C); + for(phi_s0 = 0; phi_s0 < 4; phi_s0++){ + func_80316EF4(D_803830E0->unk24[phi_s0]); + } + + switch (D_803830E0->unk10) { + case 1: + if (func_8028EFC8() && (sp58[BUTTON_Z] == 1)) { + sp44 = func_80319040(0); + func_803184C8(D_803830E0->unk24[0], 100.0f, 2, 4, sp44, func_80319028(0), 0); + return; + } + break; + case 6: + if (D_803830E0->unk15 > 0) { + D_803830E0->unk15--; + } else { + if (sp4C[1] > 0.75) { + if (D_803830E0->unk13 >= 2) { + func_80319758(D_803830E0->unk13, 0); + D_803830E0->unk13--; + func_80319758(D_803830E0->unk13, 1); + func_803160A8(D_803830E0->unk24[D_803830E0->unk13]); + D_803830E0->unk15 = 4U; + } + } else if (sp4C[1] < -0.75) { + if (D_803830E0->unk13 < 3) { + func_80319758(D_803830E0->unk13, 0); + D_803830E0->unk13++; + func_80319758(D_803830E0->unk13, 1); + func_803160A8(D_803830E0->unk24[D_803830E0->unk13]); + D_803830E0->unk15 = 4U; + } + } + } + if ((sp58[BUTTON_START] == 1) || (item_empty(ITEM_0_HOURGLASS_TIMER))) { + D_803830E0->unk12 = (u8) D_803830E0->unk13; + } + if ((s8) D_803830E0->unk12 != -1) { + func_803197AC(7); + return; + } + break; + case 9: + if (D_803830E0->unk14 == 4) { + func_803197AC(0xA); + return; + } + break; + case 10: + func_803197AC(0); + break; + } +} + +bool func_8031A154(enum ff_question_type_e q_type, s32 q_indx, s32 arg2, s32 arg3, s32 arg4, void (*arg5)(s32, s32)) { + if (func_803192A4(q_type, q_indx, arg2) != 0) { + D_803830E0->unk0 = q_type; + D_803830E0->unk1 = q_indx; + D_803830E0->unk2 = arg2; + D_803830E0->unk3 = arg3; + D_803830E0->unk4 = arg4; + D_803830E0->unk8 = arg5; + item_set(ITEM_6_HOURGLASS, FALSE); + func_80318DA0(D_803830E0->unk1C, 1, 3, 1, 3); + func_8025A55C(6000, 500, 10); + func_803197AC(1); + return TRUE; + } + return FALSE; +} + +bool func_8031A22C(u8 *arg0, s8 *arg1, Struct_Core2_91E10_1 *arg2, s32 arg3, void (*arg4)(s32, s32)) { + s32 temp_v0; + s8 *temp_a2; + s8 *temp_s0; + s8 temp_a1; + s8 temp_a1_2; + u8 *phi_t0; + s32 i; + s8 *phi_a2; + s32 *phi_a0; + s32 phi_v1; + s32 j; + s8 *phi_s0; + + if (func_8031A3BC()) { + return 0; + } + for(i = 0; i < 4; i++){ + D_803830E0->unk20[i] = arg0[i]; + D_803830E0->unk18[i] = arg1[i]; + for(j = 0; j < arg1[i]; j++){ + D_803830E0->unk34.unk0[i][j] = arg2->unk0[i][j]; + } + D_803830E0->unk1C[i] = i; + } + if (D_803830E0->unk20[0] != 0) { + func_803189C4(D_803830E0->unk24[0], D_803830E0->unk20[0]); + } + D_803830E0->unk0 = -1; + D_803830E0->unk1 = -1; + D_803830E0->unk2 = -1; + D_803830E0->unk3 = (s8) arg3; + D_803830E0->unk4 = 0; + D_803830E0->unk8 = arg4; + func_8025A55C(6000, 500, 10); + func_803197AC(1); + return TRUE; +} + +void func_8031A388(u8 arg0, u8 arg1) { + if (D_803830E0 != NULL) { + D_803830E0->unk16 = arg0; + D_803830E0->unk17 = arg1; + } +} + +bool func_8031A3BC(void){ + return (D_803830E0 != NULL)? D_803830E0->unk10 != 0: FALSE; +} + +//gcquiz_close +void func_8031A3E4(void){ + s32 i; + if(D_803830E0 != NULL){ + for(i = 0; i < 4; i++){ + gczoombox_minimize(D_803830E0->unk24[i]); + gczoombox_close(D_803830E0->unk24[i]); + } + } +} + +s32 func_8031A454(void){ + return 4; +} + +//__gcquiz_get_type_count +s32 func_8031A45C(enum ff_question_type_e question_type){ + return func_80318F1C(question_type) - func_80318ED8(question_type); +} + +void func_8031A48C(void) { + if ((D_803830E0 != NULL) && (D_803830E0->unk10 == 1)) { + func_803197AC(2); + } +} + +//gcquiz_defrag +void func_8031A4CC(void) { + s32 i; + + if (D_803830E0 != NULL) { + for(i = 0; i < 4; i++){ + func_80318C0C(D_803830E0->unk24[i]); + D_803830E0->unk24[i] = (gczoombox_t *)defrag(D_803830E0->unk24[i]); + } + + if (func_8031A3BC() == 0) { + D_803830E0->unkC = defrag(D_803830E0->unkC); + } + D_803830E0 = (Struct_Core2_91E10 *)defrag(D_803830E0); + } +} diff --git a/src/core2/code_9290.c b/src/core2/code_9290.c new file mode 100644 index 00000000..06f2d841 --- /dev/null +++ b/src/core2/code_9290.c @@ -0,0 +1,55 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +s32 D_8037C010; +s32 D_8037C014; +s32 D_8037C018; +s32 D_8037C01C; +f32 D_8037C020[3]; +u8 D_8037C02C; + +/* .code */ +void func_80290220(void){ + D_8037C010 = D_8037C014 = -1; + D_8037C02C = 0; + D_8037C018 = -1; + _player_getPosition(D_8037C020); +} + +void func_8029026C(s32 arg0, s32 arg1){ + func_80303F6C(arg0, arg1); +} + +void func_8029028C(bool arg0){ + D_8037C02C = arg0; +} + +void func_80290298(void) { + s32 sp24; + s32 sp30; + s32 pad2C; + bool is_pumpkin; + + is_pumpkin = player_getTransformation() == TRANSFORM_3_PUMPKIN; + sp30 = (func_8028B528() && !is_pumpkin) ? 6 : 1; + sp24 = func_8028B528() && !is_pumpkin; + if (D_8037C02C || func_8028B2E8() || sp24 || func_8028ECAC() == BSGROUP_5_CLIMB || bs_getState() == BS_B_UNKOWN) { + _player_getPosition(D_8037C020); + } + + if (func_8028ECAC() == BSGROUP_A_FLYING) { + D_8037C018 = -1; + } + else if (func_803077FC(D_8037C020, &D_8037C010, &D_8037C014, 0x12C, sp30)) { + D_8037C018 = func_80306D40(D_8037C010); + } + else{ + D_8037C018 = -1; + } +} + +s32 func_802903CC(void){ + return D_8037C018; +} diff --git a/src/core2/code_935F0.c b/src/core2/code_935F0.c new file mode 100644 index 00000000..503e7200 --- /dev/null +++ b/src/core2/code_935F0.c @@ -0,0 +1,93 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8031A9E4(Actor *this); + +/* .data */ +extern ActorInfo D_8036D970 = { + 0x1E1, 0x376, 0x0, + 0x1, NULL, + func_8031A9E4, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; + +/* .code */ +int func_8031A580(void){ + switch(map_get()){ + case MAP_3A_RBB_BOSS_BOOM_BOX: + return 0; + case MAP_10_BGS_MR_VILE: + return 1; + case MAP_13_GV_MEMORY_GAME: + return 2; + case MAP_5A_CCW_SUMMER_ZUBBA_HIVE: + case MAP_5B_CCW_SPRING_ZUBBA_HIVE: + case MAP_5C_CCW_AUTUMN_ZUBBA_HIVE: + return 3; + case MAP_11_BGS_TIPTUP: + return 4; + case MAP_A_TTC_SANDCASTLE: + return 5; + } + return 0xf; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_935F0/func_8031A618.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_935F0/func_8031A678.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_935F0/func_8031A794.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_935F0/func_8031A7C4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_935F0/func_8031A7F4.s") + +void func_8031A9BC(Actor *this){ + func_803204E4(3, 0); +} + +void func_8031A9E4(Actor *this){ + if(!this->unk16C_4){ + this->unk16C_4 = 1; + this->unk10_12 = func_8031A580(); + actor_collisionOff(this); + if(!func_803203FC(2)){ + func_8031A678(this); + return; + } + + func_8031A618(this); + func_803300D8(this->marker, func_8031A9BC); + func_8028FAB0(this->position); + this->unk1C[0] = 0.0f; this->unk1C[1] = this->yaw; this->unk1C[2] = 0.0f; + func_8028FAEC(this->unk1C); + this->unk138_24 = 0; + if(this->unk10_12 >= 7){ + marker_despawn(this->marker); + return; + } + func_803204E4(5, 0); + func_803204E4(3, 0); + func_8031A7F4(this, 1); + func_80314AC8(0); + } + if(func_803203FC(2)){ + switch(this->state){ + case 1://L8031AB2C + if(this->unk138_24) + func_8031A7F4(this, 2); + break; + case 2://L8031AB50 + func_8028FA14(0x8E, 2); + if(item_getCount(ITEM_14_HEALTH) == 0) + item_set(ITEM_6_HOURGLASS, FALSE); + if(!func_803203FC(3)){ + func_8031A7F4(this, 3); + } + break; + case 3: + break; + } + }//L8031AB8C +} diff --git a/src/core2/code_93C10.c b/src/core2/code_93C10.c new file mode 100644 index 00000000..e0ade13a --- /dev/null +++ b/src/core2/code_93C10.c @@ -0,0 +1,72 @@ +#include +#include "functions.h" +#include "variables.h" + +extern struct{ + u8 pad0[3]; + s8 unk3; + u8 pad4[3]; + s8 unk7; + u8 pad8[4]; + struct1Cs *unkC; +}D_803830F0; + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_93C10/func_8031ABA0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_93C10/func_8031ABF8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_93C10/func_8031AC8C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_93C10/func_8031AD2C.s") + +void func_8031B010(void){ + func_8031AD2C(6); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_93C10/func_8031B030.s") + +void func_8031B070(s32 arg0){ + struct1Cs *v0 = D_803830F0.unkC; + print_bold_overlapping(v0->x, D_803830F0.unk3, -1.2f, v0->string); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_93C10/func_8031B0B0.s") + +void func_8031B2F0(void){} + +void func_8031B2F8(void){ + func_803204E4(0x20, FALSE); + func_803204E4(0x1F, TRUE); + if(func_80320454(0xC0, 0)) + func_8031AD2C(2); + else + func_8031AD2C(1); + +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_93C10/func_8031B354.s") + +int func_8031B4CC(void){ + return (D_803830F0.unkC && D_803830F0.unkC->unk1 < 0); +} + +int func_8031B4F4(void){ + return (D_803830F0.unkC) ? D_803830F0.unkC[1].unk0 : 0; +} + +void func_8031B51C(void){ + if (func_803203FC(0x1F)) return; + + func_803204E4(0x20, TRUE); + func_8031B354(); +} + +void func_8031B554(void){ + + if (func_803203FC(0x1F)) return; + + func_803204E4(0x20, TRUE); + func_803204E4(0xC0, TRUE); + D_803830F0.unk7 = jiggyscore_total(); + func_8031B354(); +} diff --git a/src/core2/code_9450.c b/src/core2/code_9450.c new file mode 100644 index 00000000..46bd0c9f --- /dev/null +++ b/src/core2/code_9450.c @@ -0,0 +1,128 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_802906A4(s32 arg0); + +/* .bss */ +f32 D_8037C030; +f32 D_8037C034; +f32 D_8037C038; +u8 D_8037C03C; +u8 D_8037C03D; +u8 D_8037C03E; + +/* .code */ +void func_802903E0(void){ + if(D_8037C030 == 0.0f){ + D_8037C030 = 0.09f; + func_80299D2C(0x3ED, randf2(0.5f, 0.7f), 6000); + } +} + +void func_80290444(void){ + D_8037C030 -= time_getDelta(); + if(D_8037C030 < 0.0f){ + D_8037C030 = 0.0f; + } +} + +void func_80290494(void){ + f32 sp2C[3]; + ParticleEmitter *sp28; + if(!D_8037C03D || player_getTransformation() != TRANSFORM_1_BANJO){ + func_802924E8(sp2C); + } + else{ + func_802924B8(sp2C); + } + sp28 = func_8029B950(sp2C, 0.0f); + particleEmitter_setParticleVelocityRange(sp28, -15.0f, 0.0f, -15.0f, 15.0f, 50.0f, 15.0f); + particleEmitter_emitN(sp28, 1); + func_802903E0(); +} + +void func_80290544(void){ + f64 temp_f2; + D_8037C038 = 0.0f; + temp_f2 = randf(); + if(temp_f2 < 0.5){ + D_8037C034 = randf2(0.6f, 0.7f); + D_8037C03C = 1; + } + else if(temp_f2 < 0.7){ + D_8037C034 = randf2(0.7f, 1.0f); + D_8037C03C = randi2(1,4); + } + else{ + D_8037C034 = randf2(2.3f, 2.6f); + D_8037C03C = randi2(6,15); + } +} + +void func_80290638(void){ + D_8037C038 = 0.0f; + D_8037C034 = 0.0f; + D_8037C03C = 1; +} + +void func_8029065C(void){} + +void func_80290664(void){ + D_8037C03C = 0; + D_8037C034 = 2.0f; + D_8037C03E = 0; + func_802906A4(1); +} + +void func_802906A4(s32 arg0){ + if(D_8037C03E == 4){ + D_8037C034 = 0.0f; + D_8037C03C = 0; + } + D_8037C03E = arg0; +} + +void func_802906D8(void){ + f32 sp1C; + int underwater_or_walrus_in_water; + + func_80290444(); + underwater_or_walrus_in_water = (func_8028EE84() == BSWATERGROUP_2_UNDERWATER); + if(!underwater_or_walrus_in_water){ + underwater_or_walrus_in_water = (player_getTransformation() == TRANSFORM_4_WALRUS && player_inWater()); + } + + if(underwater_or_walrus_in_water && D_8037C03E != 4){ + sp1C = time_getDelta(); + if(D_8037C03C){ + D_8037C038 -= sp1C; + if( D_8037C038< 0.0f){ + D_8037C038 = randf2(0.066f, 0.1f); + D_8037C03C--; + func_80290494(); + } + } + D_8037C034 -= sp1C; + if(!(0.0f < D_8037C034)){ + if(D_8037C03E == 3){ + func_80290638(); + } + else{ + func_80290544(); + } + if(D_8037C03E == 2){ + D_8037C03D = 1; + } + else{ + if(0.5 <= randf()){ + D_8037C03D = 0; + } + else{ + D_8037C03D = 1; + } + } + } + }//L8029087C +} diff --git a/src/core2/code_94620.c b/src/core2/code_94620.c new file mode 100644 index 00000000..f527e770 --- /dev/null +++ b/src/core2/code_94620.c @@ -0,0 +1,1982 @@ +#include +#include "functions.h" +#include "variables.h" +#include "structs.h" + +extern s32 D_80383150; +extern u8 D_80383158; + +s32 func_8031B5B0(void) { + return D_80383158; +} + +s32 func_8031B5BC(void){ return 1; } + +void func_8031B5C4(s32 arg0) { + if ((arg0 >= 0) && (arg0 < func_8031B5BC())) { + D_80383158 = (s8) arg0; + } + D_80383150 = 1; +} + +// regalloc +// s32 func_8031B604(u8 *arg0) { +// s32 ret = (arg0[0] == 0xFD) && (arg0[1] == 0x6A); +// return ret; +// } +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031B604.s") + +void func_8031B62C(void) { + D_80383158 = (u8)0; +} + +s32 func_8031B638(void) { + return D_80383150; +} + +// void func_8031B644(void) { +// (s32*)(&D_80383158) = +// } + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031B644.s") + +void func_8031B65C(void){} + +void func_8031B664(void){} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031B66C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031B6D8.s") + +void func_8031B710(void){} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031B718.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031B760.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031B790.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031B908.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031B990.s") + + +/***BREAK***/ + +//f32 mlAbsF(f32, f32); + +void *func_80309B48(f32 *, f32 *, f32 *, u32); +void *func_80309B98(f32 *, f32 *, f32 *, u32); + + +void func_8031C608(struct0 *this); +void *func_8031BABC(f32 *, f32, f32, u32, void*); +void func_8031BD98(struct0 *, f32, s32, s32, f32 *, void *, s32); + +void func_8031BE98(struct0*, f32, s32); +extern f32 D_8036DDC0[]; +extern f32 D_80378D30; +extern f32 D_80378D34; + + +void func_8031B9B0(struct0 *this, s32 arg1){ + if(arg1 == 1) + this->unk5D = 5; + if(arg1 == 4) + this->unk5C = 1; + this->unk5E = arg1; +} + +struct0 *func_8031B9D8(void){ + struct0 *this; + + this = (struct0 *)malloc(0x60); + ml_vec3f_clear(this->unk1C); + ml_vec3f_clear(this->unk28); + this->normX = 0.0f; + this->normZ = 0.0f; + this->normY = 1.0f; + this->posX = D_80378D30; + this->unk4C = 0; + this->unk50 = 0; + this->posY = D_80378D34; + this->unk58 = 0; + this->unk5A = 0; + this->unk59 = 0; + this->unk5B = 0; + this->unk54 = 0; + this->model = NULL; + func_8031C608(this); + this->unk5E = 0; + func_8031B9B0(this, 1); + return this; +} + +void func_8031BA7C(struct0 *this){ + func_8031B9B0(this, 1); +} + +void func_8031BA9C(struct0 *this){ + free(this); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031BABC.s") +// void *func_8031BABC(f32 *arg0, f32 arg1, f32 arg2, u32 arg3, void *arg4) { +// //f32 sp38; +// f32 sp34[3]; +// //f32 sp2C; +// f32 sp28[3]; +// void *sp24; +// void *temp_v1; +// void *phi_v0; + +// ml_vec3f_copy(&sp34, arg0); +// sp34[1] = sp34[1] + arg1; +// ml_vec3f_copy(&sp28, arg0); +// sp28[1] = sp28[1] + arg2; +// if (arg3 == 0xF800FF0F) { +// phi_v0 = func_80309B48(&sp34, &sp28, arg4, arg3); +// } else { +// phi_v0 = func_80320B98(&sp34, &sp28, arg4, arg3); +// } +// temp_v1 = phi_v0; +// if (phi_v0 != 0) { +// arg4->unk10 = (s32) phi_v0->unk8; +// arg4->unk14 = (s16) phi_v0->unk6; +// } else { +// arg4->unk10 = 0; +// arg4->unk14 = (u16)0; +// } +// arg4->unkC = sp28[1]; +// sp24 = temp_v1; +// arg4->unk18 = func_803209EC(); +// return temp_v1; +// } + +s32 *func_8031BBA0(f32 *this, f32 arg1, f32 arg2, u32 arg3, void *arg4) { + s32* phi_v1; + + if (mlAbsF(arg2 - arg1) > 500.0f) { + if (arg1 < arg2) { + phi_v1 = func_8031BABC(this, arg1, arg1 + 500.0f, arg3, arg4); + if (phi_v1 == NULL) { + phi_v1 = func_8031BABC(this, arg1 + 500.0f - 1.0f, arg2, arg3, arg4); + } + } else { + phi_v1 = func_8031BABC(this, arg1, arg1 - 500.0f, arg3, arg4); + if (phi_v1 == NULL) { + phi_v1 = func_8031BABC(this, arg1 - 500.0f + 1.0f, arg2, arg3, arg4); + } + } + } else { + phi_v1 = func_8031BABC(this, arg1, arg2, arg3, arg4); + } + return phi_v1; +} + +s32 func_8031BCF4(struct0 *this) { + f32 temp_f0; + f32 temp_f2; + + if (this->unk59 == 0) { + return 2; + } + if ((this->unk59 != 0) && (this->unk58 == 0)) { + return 4; + } + temp_f0 = this->posY; + if (temp_f0 < this->unk1C[1]) { + return 2; + } + temp_f2 = temp_f0 - this->posX; + if (temp_f2 < -20.0f) { + return 2; + } + if (temp_f2 > 100.0f) { + return 4; + } + return 3; +} + +void func_8031BD98(struct0 *this, f32 arg1, s32 arg2, s32 arg3, f32 *normPtr, void *model, s32 arg6){ + if(arg6){ + func_8024587C(&this->unk4, arg6); + } + this->unk58 = 1; + this->unk4C = arg2; + this->unk50 = arg3; + this->posX = arg1; + this->model = model; + ml_vec3f_copy(&this->normX, normPtr); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031BE0C.s") +// void func_8031BE0C(struct0 *this, s32 *arg1, s32 arg2) { +// s32 a = arg1[4]; +// s32 b = arg1[5]; +// func_8031BD98(this, *(f32*)&arg1[3], a, b, &this->model, arg1[6], arg2); +// // func_8031BD98(this, *(f32*)&arg1[3], arg1[4], arg1[5], this, *(s32*)&this->unk10[4], arg2); +// } + + +void func_8031BE58(struct0 *this){ + func_8031BD98(this, -9000.0f, 0, 0, D_8036DDC0, 0, 0); +} + +void func_8031BE98(struct0 *this, f32 arg1, s32 arg2){ + if(arg2) + func_8024587C(&this->unk10, arg2); + this->unk59 = 1; + this->posY = arg1; +} + +void func_8031BEE0(struct0 *this){ + func_8031BE98(this, -10000.0, 0); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031BF08.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031C1A4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031C29C.s") + +void func_8031C444(struct0 * this){} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031C44C.s") + +u8 func_8031C58C(struct0 *this){ + return this->unk58; +} + +u8 func_8031C594(struct0 *this){ + return this->unk59; +} + +s32 func_8031C59C(struct0 *this){ + return this->unk4C; +} + +s32 func_8031C5A4(struct0 *this){ + return this->unk50; +} + +void func_8031C5AC(struct0 *this, f32 *dst) +{ ml_vec3f_copy(dst, &this->normX); +} + +f32 func_8031C5D4(struct0 *this){ + return this->posX; +} + +BKModelBin *func_8031C5DC(struct0 *this){ + return this->model; +} + +f32 func_8031C5E4(struct0 *this){ + return this->posY; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031C5EC.s") + +Struct60s *func_8031C5F4(struct0* this){ + return &this->unk4; +} + +void func_8031C5FC(struct0* this, f32 arg1){ + this->posZ = arg1; +} + +void func_8031C608(struct0 *this){ + this->posZ = 56.0f; +} + +void func_8031C618(struct0 *this, f32 *arg1){ + ml_vec3f_copy(this->unk1C, arg1); +} + +void func_8031C638(struct0 *this, s32 arg1){ + this->unk54 = arg1; +} + +/**** BREAK ***/ + +void mapSpecificFlags_set(s32, s32); + +u32 func_8031C688(void); +u32 func_8031C6E4(void); +u32 func_8031C640(void); +u32 func_8031C7C8(void); + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031C640.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031C688.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031C6E4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031C7C8.s") + +//checks is a cutscene can be inturrupted and performs take me there +void func_8031C7EC(s32 cs_map, s32 arg1, s32 return_map, s32 return_exit, u32 (* condFunc)(void)){ + if(map_get() != cs_map) + return; + + if((condFunc && condFunc()) || mapSpecificFlags_get(arg1)){ + mapSpecificFlags_set(arg1, 0); + func_802E4078(return_map, (return_exit == -1)? 0: return_exit, 1); + } +} + +//check cutscene interrupts +s32 func_8031C880(void){ + func_8031C7EC(MAP_86_CS_SPIRAL_MOUNTAIN_4, 0, MAP_89_CS_INTRO_BANJOS_HOUSE_2, -1, NULL); + func_8031C7EC(MAP_7D_CS_SPIRAL_MOUNTAIN_1, 0, MAP_7C_CS_INTRO_BANJOS_HOUSE_1, -1, NULL); + func_8031C7EC(MAP_7C_CS_INTRO_BANJOS_HOUSE_1, 0, MAP_86_CS_SPIRAL_MOUNTAIN_4, -1, NULL); + func_8031C7EC(MAP_89_CS_INTRO_BANJOS_HOUSE_2, 0, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, NULL); + func_8031C7EC(MAP_85_CS_SPIRAL_MOUNTAIN_3, 0, MAP_7B_CS_INTRO_GL_DINGPOT_1, -1, NULL); + func_8031C7EC(MAP_7B_CS_INTRO_GL_DINGPOT_1, 1, MAP_81_CS_INTRO_GL_DINGPOT_2, -1, NULL); + func_8031C7EC(MAP_81_CS_INTRO_GL_DINGPOT_2, 0, MAP_7D_CS_SPIRAL_MOUNTAIN_1, -1, NULL); + func_8031C7EC(MAP_82_CS_ENTERING_GL_MACHINE_ROOM, 0, MAP_69_GL_MM_LOBBY, 0x12, func_8031C688); + func_8031C7EC(MAP_83_CS_GAME_OVER_MACHINE_ROOM, 0, MAP_1F_CS_START_RAREWARE, -1, func_8031C6E4); + func_8031C7EC(MAP_87_CS_SPIRAL_MOUNTAIN_5, 0, MAP_88_CS_SPIRAL_MOUNTAIN_6, -1, NULL); + func_8031C7EC(MAP_94_CS_INTRO_SPIRAL_7, 0, MAP_8E_GL_FURNACE_FUN, 4, NULL); + func_8031C7EC(MAP_88_CS_SPIRAL_MOUNTAIN_6, 1, MAP_96_CS_END_BEACH_1, -1, NULL); + func_8031C7EC(MAP_98_CS_END_SPIRAL_MOUNTAIN_1, 0, MAP_1F_CS_START_RAREWARE, -1, NULL); + func_8031C7EC(MAP_99_CS_END_SPIRAL_MOUNTAIN_2, 0, MAP_1F_CS_START_RAREWARE, -1, NULL); + func_8031C7EC(MAP_20_CS_END_NOT_100, 0, MAP_98_CS_END_SPIRAL_MOUNTAIN_1, -1, NULL); + func_8031C7EC(MAP_95_CS_END_ALL_100, 0, MAP_99_CS_END_SPIRAL_MOUNTAIN_2, -1, NULL); + func_8031C7EC(MAP_97_CS_END_BEACH_2, 0, MAP_99_CS_END_SPIRAL_MOUNTAIN_2, -1, func_8031C7C8); + func_8031C7EC(MAP_85_CS_SPIRAL_MOUNTAIN_3, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); + func_8031C7EC(MAP_7B_CS_INTRO_GL_DINGPOT_1, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); + func_8031C7EC(MAP_81_CS_INTRO_GL_DINGPOT_2, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); + func_8031C7EC(MAP_7D_CS_SPIRAL_MOUNTAIN_1, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); + func_8031C7EC(MAP_7C_CS_INTRO_BANJOS_HOUSE_1, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); + func_8031C7EC(MAP_86_CS_SPIRAL_MOUNTAIN_4, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); + func_8031C7EC(MAP_89_CS_INTRO_BANJOS_HOUSE_2, 0xC, MAP_1_SM_SPIRAL_MOUNTAIN, 0x12, func_8031C640); + if(map_get() == MAP_95_CS_END_ALL_100 && mapSpecificFlags_get(1)){ + func_8034B9E4(); + mapSpecificFlags_set(1, 0); + } + return 0; +} + +// Struct pointer returned by func_80304ED0 +struct unkfunc_80304ED0 { + s16 unk0[3]; + u16 unk6; + u16 unk8; + u16 unkA; + u32 unkC; +}; + +s32 func_8031FF1C(s32); +void func_8031FFAC(void); +void func_80320004(s32 index, s32 set); +s32 func_803200A4(u8 *array, s32 index); +s32 func_803200E4(u8 *array, s32 offset, s32 numBits); +void func_8032015C(u8 *array, s32 index, s32 set); +void func_803201C8(u8 *array, s32 startIndex, s32 set, s32 length); +void func_8032048C(void); +void func_803204E4(s32 arg0, s32 arg1); +s32 func_8031FF44(s32 offset, s32 numBits); +void func_8031CE70(f32 *arg0, s32 arg1, s32 arg2); +void ml_vec3h_to_vec3f(f32 *, s32); +void func_8028F3D8(f32 *, f32, void(*)(ActorMarker *), ActorMarker *); +struct unkfunc_80304ED0 *func_80304ED0(void*, f32 *); +void func_8031CD44(s32, s32, f32, f32, s32); +void func_80256E24(f32 *, f32, f32, f32, f32, f32); + +extern u8 D_80383190; +extern u32 D_8036DDD4; + +// probably rodata +extern f32 D_80378D40; +extern f32 D_80378D44; + +void func_8031CB50(enum map_e map_id, s32 arg1, s32 arg2) { + s32 sp1C; + + if ((D_80383190 == 0) && (getGameMode() != 8) && (getGameMode() != 7)) { + sp1C = func_803226E8(map_get()); + if ((func_803226E8(map_id) != sp1C) && (func_80322914() == 0)) { + func_8025A388(0, 0x4E2); + func_8025AB00(); + func_8024BD08(0); + } + if (func_802E4A08() != 0) { + func_802E40D0(map_id, arg1); + func_802E40E8(1); + func_802E40C4(0xB); + } else { + func_802E4078(map_id, arg1, 1); + } + func_80335110(arg2); + } +} + +void func_8031CC40(enum map_e map_id, s32 arg1) { + func_8031CB50(map_id, arg1, 0); +} + +void func_8031CC60(s32 arg0) { + func_8031CB50(arg0 >> 8, arg0 & 0xFF, 1); +} + +void func_8031CC8C(s32 arg0, s32 arg1) { + f32 vec[3]; + f32 unused[3]; + + if ((D_80383190 == 0) && (getGameMode() != 8)) { + if (getGameMode() != 7) { + if (arg0 != 0) { + ml_vec3h_to_vec3f(vec, arg0); + func_8031CE70(vec, arg1 >> 8, arg1 & 0xFF); + } else { + func_8031CE70(NULL, arg1 >> 8, arg1 & 0xFF); + } + } + } +} + +void func_8031CD20(s32 arg0, s32 arg1, s32 arg2) { + func_8031CC8C(arg0, (arg1 << 8) + arg2); +} + +void func_8031CD44(s32 arg0, s32 arg1, f32 arg2, f32 arg3, s32 arg4) { + f32 sp3C[3]; + f32 sp30[3]; + f32 sp24[3]; + + player_getPosition((f32 *) &sp3C); + func_80256E24(sp24, 0.0f, arg3, 0.0f, 0.0f, ml_map_f((f32) arg4, 0.0f, 200.0f, 10.0f, 800.0f)); + sp24[0] = sp3C[0] + sp24[0]; + sp24[1] = sp3C[1] + sp24[1]; + sp24[2] = sp3C[2] + sp24[2]; + sp30[0] = sp24[0]; + sp30[1] = arg2; + sp30[2] = sp24[2]; + func_802BD328(0); + func_8031CB50(arg0, arg1, 1); + func_8028F3D8(sp30, 1.0f, NULL, NULL); +} + +void func_8031CE28(s32 arg0, s32 arg1, f32 arg2) { + f32 vec[3]; + + player_getPosition(vec); + func_8031CD44(arg0, arg1, vec[1], arg2, 0x25); +} + +void func_8031CE70(f32 *arg0, s32 arg1, s32 arg2) { + f32 playerPos[3]; + f32 sp38[3]; + struct unkfunc_80304ED0 *phi_s0; + f32 phi_f2; + + if ((D_80383190 == 0) && (getGameMode() != 8) && (getGameMode() != 7)) { + if (arg0 != 0) { + phi_s0 = func_80304ED0(&D_8036DDD4, arg0); + } else { + phi_s0 = NULL; + } + player_getPosition(playerPos); + if (phi_s0 != NULL) { + nodeprop_getPosition(&phi_s0->unk0, sp38); + phi_f2 = 500.0f; + if (phi_s0->unk8 == 0x186) { + phi_f2 = 1000.0f; + } + if (ml_vec3f_distance(arg0, sp38) < phi_f2) { + if (phi_s0->unk8 == 0x184) { + func_802BD328(0); + func_8031CB50(arg1, arg2, 1); + func_8028F3D8(sp38, 1.0f, NULL, NULL); + } else if (phi_s0->unk8 == 0x185) { + func_8031CD44(arg1, arg2, sp38[1], (f32) (phi_s0->unkC >> 0x17), phi_s0->unkC & 0x7FFFFF); + } else { + func_8031CD44(arg1, arg2, playerPos[1], (f32) (phi_s0->unkC >> 0x17), phi_s0->unkC & 0x7FFFFF); + } + return; + } + } + func_8031CB50(arg1, arg2, 0); + } +} + +void func_8031D04C(s32 arg0, s32 arg1) { + func_8031CB50(arg0, arg1, 0); +} + +void func_8031D06C(s32 arg0, s32 arg1) { + func_8031CB50(0x20, 0, 0); +} + +void func_8031D09C(s32 arg0, s32 arg1) { + func_8034B968(); +} + +void func_8031D0C0(s32 arg0, s32 arg1) { + if (func_8024E698(0) == 1) { + func_802E412C(1, 2); + func_8025A2FC(0, 0x320); + func_8025AB00(); + func_8031D09C(arg0, arg1); + } +} + +void func_8031D11C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0E01); +} + +void func_8031D140(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0201); +} + +void func_8031D164(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0C02); +} + +void func_8031D188(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0202); +} + +void func_8031D1AC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0C01); +} + +void func_8031D1D0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0203); +} + +void func_8031D1F4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1E00); +} + +void func_8031D218(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1506); +} + +void func_8031D23C(s32 arg0, s32 arg1) { + item_set(ITEM_6_HOURGLASS, 0); + func_80244C78(1); + func_8031CC8C(arg0, 0x1607); +} + +void func_8031D27C(s32 arg0, s32 arg1) { + item_set(ITEM_6_HOURGLASS, 0); + func_8031CC8C(arg0, 0x1301); +} + +void func_8031D2B4(s32 arg0, s32 arg1) { + func_80244C78(0); + func_803204E4(0xAC, 1); + func_8031CC8C(arg0, 0x1502); +} + +void func_8031D2F4(s32 arg0, s32 arg1) { + if (func_8031FF44(0xF8, 2) == 3) { + func_8031CC8C(arg0, 0x1401); + } +} + +void func_8031D334(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1203); +} + +void func_8031D358(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1204); +} + +void func_8031D37C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1205); +} + +void func_8031D3A0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1206); +} + +void func_8031D3C4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1101); +} + +void func_8031D3E8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0D03); +} + +void func_8031D40C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0D04); +} + +void func_8031D430(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0D05); +} + +void func_8031D454(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0A01); +} + +void func_8031D478(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x070F); +} + +void func_8031D49C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x070E); +} + +void func_8031D4C0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0505); +} + +void func_8031D4E4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0506); +} + +void func_8031D508(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0708); +} + +void func_8031D52C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0703); +} + +void func_8031D550(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0704); +} + +void func_8031D574(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0705); +} + +void func_8031D598(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0706); +} + +void func_8031D5BC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0707); +} + +void func_8031D5E0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0708); +} + +void func_8031D604(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0709); +} + +void func_8031D628(s32 arg0, s32 arg1) { + Actor *actor; + + actor = func_80326EEC(0x13E); + if (actor) { + marker_despawn(actor->marker); + } + func_8031CB50(7, 0xC, 0); +} + +void func_8031D670(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2601); +} + +void func_8031D694(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2602); +} + +void func_8031D6B8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2501); +} + +void func_8031D6DC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2401); +} + +void func_8031D700(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1D01); +} + +void func_8031D724(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2A01); +} + +void func_8031D748(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2801); +} + +void func_8031D76C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2901); +} + +void func_8031D790(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2E01); +} + +void func_8031D7B4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2D01); +} + +void func_8031D7D8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2C01); +} + +void func_8031D7FC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B01); +} + +void func_8031D820(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B02); +} + +void func_8031D844(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B03); +} + +void func_8031D868(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B04); +} + +void func_8031D88C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B05); +} + +void func_8031D8B0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B06); +} + +void func_8031D8D4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B07); +} + +void func_8031D8F8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B08); +} + +void func_8031D91C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B09); +} + +void func_8031D940(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B0A); +} + +void func_8031D964(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B0B); +} + +void func_8031D988(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B0C); +} + +void func_8031D9AC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B0D); +} + +void func_8031D9D0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B0E); +} + +void func_8031D9F4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B0F); +} + +void func_8031DA18(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B10); +} + +void func_8031DA3C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B11); +} + +void func_8031DA60(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B12); +} + +void func_8031DA84(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2B01); +} + +void func_8031DAA8(s32 arg0, s32 arg1) { + func_8028F918(0); + func_8031CB50(arg0, arg1, 0); +} + +void func_8031DAE0(s32 arg0, s32 arg1) { + if (mapSpecificFlags_get(2) == 0) { + func_803204E4(0xAD, 1); + func_80244C78(0); + mapSpecificFlags_set(2, 1); + func_8025A6EC(COMUSIC_3B_MINIGAME_VICTORY, 0x6D60); + func_8028F918(1); + timedFunc_set_2(D_80378D40, &func_8031DAA8, 0x1C, 1); + func_802D6924(); + } +} + +void func_8031DB64(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3001); +} + +void func_8031DB88(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3001); +} + +void func_8031DBAC(s32 arg0, s32 arg1) { + if (player_getTransformation() == TRANSFORM_3_PUMPKIN) { + func_8031CC8C(arg0, arg1 + 0x2F00); + } +} + +void func_8031DBE8(void) { + func_8031CB50(0x2F, 1, 1); +} + +void func_8031DC10(s32 arg0, s32 arg1) { + f32 vec[3]; + + if (player_getTransformation() == TRANSFORM_3_PUMPKIN) { + ml_vec3h_to_vec3f(vec, arg0); + func_8028F6E4(0x2F, vec); + timedFunc_set_0(D_80378D44, &func_8031DBE8); + } +} + +void func_8031DC68(s32 arg0, s32 arg1) { + func_8031DBAC(arg0, 2); +} + +void func_8031DC8C(s32 arg0, s32 arg1) { + if (player_getTransformation() == TRANSFORM_5_CROC) { + func_8031CC8C(arg0, arg1 + 0x1000); + } +} + +void func_8031DCC8(s32 arg0, s32 arg1) { + func_8031DC8C(arg0, 3); +} + +void func_8031DCEC(s32 arg0, s32 arg1) { + func_8031DC8C(arg0, 4); +} + +// BGS? +void func_8031DD10(s32 arg0, s32 arg1) { + if (func_8038F570() != 0) { + func_8031CC8C(arg0, 0x1101); + } +} + +// TTC? +void func_8031DD44(s32 arg0, s32 arg1) { + if (func_80388A44() != 0) { + func_8031CC8C(arg0, 0x601); + } +} + +void func_8031DD78(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2203); +} + +void func_8031DD9C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2201); +} + +void func_8031DDC0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2202); +} + +void func_8031DDE4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2301); +} + +void func_8031DE08(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0205); +} + +void func_8031DE2C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1A02); +} + +void func_8031DE50(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1202); +} + +void func_8031DE74(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3F01); +} + +void func_8031DE98(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3901); +} + +void func_8031DEBC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3404); +} + +void func_8031DEE0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3401); +} + +void func_8031DF04(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3C01); +} + +void func_8031DF28(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3D01); +} + +void func_8031DF4C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3B01); +} + +void func_8031DF70(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3502); +} + +void func_8031DF94(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3601); +} + +void func_8031DFB8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3701); +} + +void func_8031DFDC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3E01); +} + +void func_8031E000(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3801); +} + +void func_8031E024(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3101); +} + +void func_8031E048(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3102); +} + +void func_8031E06C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3103); +} + +void func_8031E090(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3104); +} + +void func_8031E0B4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3105); +} + +void func_8031E0D8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3106); +} + +void func_8031E0FC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3107); +} + +void func_8031E120(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3108); +} + +void func_8031E144(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3109); +} + +void func_8031E168(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x310A); +} + +void func_8031E18C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x310B); +} + +void func_8031E1B0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x310C); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031E1D4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031E204.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031E2B8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031E2E0.s") + +void func_8031E308(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3206); +} + +void func_8031E32C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x5200); +} + +void func_8031E350(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x5100); +} + +void func_8031E374(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x5101); +} + +void func_8031E398(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4200); +} + +void func_8031E3BC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3201); +} + +void func_8031E3E0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3202); +} + +void func_8031E404(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3203); +} + +void func_8031E428(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3204); +} + +void func_8031E44C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3205); +} + +void func_8031E470(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3207); +} + +void func_8031E494(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3208); +} + +void func_8031E4B8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3209); +} + +void func_8031E4DC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x320A); +} + +void func_8031E500(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x320B); +} + +void func_8031E524(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x320C); +} + +void func_8031E548(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x320D); +} + +void func_8031E56C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x320E); +} + +void func_8031E590(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x320F); +} + +void func_8031E5B4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3210); +} + +void func_8031E5D8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3211); +} + +void func_8031E5FC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3212); +} + +void func_8031E620(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3213); +} + +void func_8031E644(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3214); +} + +void func_8031E668(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3215); +} + +void func_8031E68C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3216); +} + +void func_8031E6B0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3217); +} + +void func_8031E6D4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4001); +} + +void func_8031E6F8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4002); +} + +void func_8031E71C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4003); +} + +void func_8031E740(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4004); +} + +void func_8031E764(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4601); +} + +void func_8031E788(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4301); +} + +void func_8031E7AC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4401); +} + +void func_8031E7D0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4501); +} + +void func_8031E7F4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1207); +} + +void func_8031E818(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0D06); +} + +void func_8031E83C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4701); +} + +void func_8031E860(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0704); +} + +void func_8031E884(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0B05); +} + +void func_8031E8A8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x0D02); +} + +void func_8031E8CC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1208); +} + +void func_8031E8F0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x1B14); +} + +void func_8031E914(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3110); +} + +void func_8031E938(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x070A); +} + +void func_8031E95C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4A01); +} + +void func_8031E980(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4B01); +} + +void func_8031E9A4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4C01); +} + +void func_8031E9C8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4D01); +} + +void func_8031E9EC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4309); +} + +void func_8031EA10(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4409); +} + +void func_8031EA34(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4509); +} + +void func_8031EA58(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4609); +} + +void func_8031EA7C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6501); +} + +void func_8031EAA0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6601); +} + +void func_8031EAC4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6701); +} + +void func_8031EAE8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6801); +} + +void func_8031EB0C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4308); +} + +void func_8031EB30(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4408); +} + +void func_8031EB54(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4508); +} + +void func_8031EB78(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4608); +} + +void func_8031EB9C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x5E01); +} + +void func_8031EBC0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x5F01); +} + +void func_8031EBE4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6001); +} + +void func_8031EC08(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4307); +} + +void func_8031EC2C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4407); +} + +void func_8031EC50(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4507); +} + +void func_8031EC74(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4607); +} + +void func_8031EC98(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6201); +} + +void func_8031ECBC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6301); +} + +void func_8031ECE0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6401); +} + +void func_8031ED04(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4606); +} + +void func_8031ED28(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4506); +} + +void func_8031ED4C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4605); +} + +void func_8031ED70(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4801); +} + +void func_8031ED94(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4101); +} + +void func_8031EDB8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x5301); +} + +void func_8031EDDC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2707); +} + +void func_8031EE00(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2708); +} + +void func_8031EE24(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2709); +} + +void func_8031EE48(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6E01); +} + +void func_8031EE6C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6901); +} + +void func_8031EE90(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6F01); +} + +void func_8031EEB4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6E02); +} + +void func_8031EED8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6E03); +} + +void func_8031EEFC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6902); +} + +void func_8031EF20(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6903); +} + +void func_8031EF44(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6A01); +} + +void func_8031EF68(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7101); +} + +void func_8031EF8C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6A02); +} + +void func_8031EFB0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6B01); +} + +void func_8031EFD4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6B02); +} + +void func_8031EFF8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6C01); +} + +void func_8031F01C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6B03); +} + +void func_8031F040(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6D01); +} + +void func_8031F064(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6B04); +} + +void func_8031F088(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7001); +} + +void func_8031F0AC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7002); +} + +void func_8031F0D0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2701); +} + +void func_8031F0F4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6F03); +} + +void func_8031F118(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6F04); +} + +void func_8031F13C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6B05); +} + +void func_8031F160(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7102); +} + +void func_8031F184(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7401); +} + +void func_8031F1A8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7501); +} + +void func_8031F1CC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7402); +} + +void func_8031F1F0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6F05); +} + +void func_8031F214(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7103); +} + +void func_8031F238(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7201); +} + +void func_8031F25C(s32 arg0, s32 arg1) { + if (player_getTransformation() == TRANSFORM_3_PUMPKIN) { + func_8031CC8C(arg0, 0x7A01); + } +} + +void func_8031F294(s32 arg0, s32 arg1) { + if (player_getTransformation() == TRANSFORM_3_PUMPKIN) { + func_8031CC8C(arg0, 0x7503); + } +} + +void func_8031F2CC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x2706); +} + +void func_8031F2F0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7F01); +} + +void func_8031F314(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7202); +} + +void func_8031F338(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7601); +} + +void func_8031F35C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7602); +} + +void func_8031F380(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7603); +} + +void func_8031F3A4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7604); +} + +void func_8031F3C8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7701); +} + +void func_8031F3EC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7901); +} + +void func_8031F410(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7902); +} + +void func_8031F434(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x5A02); +} + +void func_8031F458(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x5C02); +} + +void func_8031F47C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4306); +} + +void func_8031F4A0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4406); +} + +void func_8031F4C4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4505); +} + +void func_8031F4E8(s32 arg0, s32 arg1) { + if (player_getTransformation() == TRANSFORM_6_BEE) { + func_8031CC8C(arg0, 0x5B01); + } +} + +void func_8031F520(s32 arg0, s32 arg1) { + item_set(ITEM_6_HOURGLASS, 0); + func_8031CC8C(arg0, 0x6F02); +} + +void func_8031F558(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7702); +} + +void func_8031F57C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7703); +} + +void func_8031F5A0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7704); +} + +void func_8031F5C4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7801); +} + +void func_8031F5E8(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7802); +} + +void func_8031F60C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7903); +} + +void func_8031F630(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x8001); +} + +void func_8031F654(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x8C01); +} + +void func_8031F678(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x112); +} + +void func_8031F69C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6912); +} + +void func_8031F6C0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x113); +} + +void func_8031F6E4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x3113); +} + +void func_8031F708(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x8B04); +} + +void func_8031F72C(s32 arg0, s32 arg1) { + if (player_getTransformation() == TRANSFORM_3_PUMPKIN) { + func_8031CC8C(arg0, 0x2504); + } +} + +void func_8031F764(s32 arg0, s32 arg1) { + if (player_getTransformation() == TRANSFORM_3_PUMPKIN) { + func_8031CC8C(arg0, 0x1B13); + } +} + +void func_8031F79C(s32 arg0, s32 arg1) { + if (player_getTransformation() == TRANSFORM_3_PUMPKIN) { + func_8031CC8C(arg0, 0x2C04); + } +} + +void func_8031F7D4(s32 arg0, s32 arg1) { + if (player_getTransformation() == TRANSFORM_3_PUMPKIN) { + func_8031CC60(0x8D04); + } +} + +void func_8031F80C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7502); +} + +void func_8031F830(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6D04); +} + +void func_8031F854(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x7906); +} + +void func_8031F878(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4007); +} + +void func_8031F89C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6F06); +} + +void func_8031F8C0(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x5E02); +} + +void func_8031F8E4(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x5F02); +} + +void func_8031F908(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6002); +} + +void func_8031F92C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x6102); +} + +void func_8031F950(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4304); +} + +void func_8031F974(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4404); +} + +void func_8031F998(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4504); +} + +void func_8031F9BC(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x4604); +} + +void func_8031F9E0(void){} + +void func_8031F9E8(){ + D_80383190 = 0; +} + +void func_8031F9F4(s32 arg0){ + D_80383190 = arg0; +} + +void func_8031FA00(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x780); +} + +void func_8031FA24(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x9205); +} + +void func_8031FA48(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x120A); +} + +void func_8031FA6C(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x9305); +} + +void func_8031FA90(s32 arg0, s32 arg1) { + func_8031CC8C(arg0, 0x8E05); +} + +void func_8031FAB4(s32 arg0, s32 arg1) { + if ((func_8031FF1C(BKPROG_FC_DEFEAT_GRUNTY) != 0) && (jiggyscore_total() == 100)) { + func_8031CC8C(arg0, 0x9501); + } else { + func_8031CC8C(arg0, 0x9001); + } +} + +void func_8031FB14(s32 arg0, s32 arg1) { + if (func_8031FF1C(BKPROG_BD_ENTER_LAIR_CUTSCENE) != 0) { + func_8031CC8C(arg0, 0x6912); + } else { + func_80320004(BKPROG_BD_ENTER_LAIR_CUTSCENE, 1); + func_8031CC8C(arg0, 0x8204); + } +} + +void func_8031FB6C(s32 arg0, s32 arg1) { + func_8030E6D4(SFX_7C_CHEBOOF); + func_8031CC8C(arg0, 0x7104); +} + +void func_8031FBA0(void) { + func_8029A8B0(); + func_8031FFAC(); + func_8034646C(); + jiggyscore_clearAll(); + honeycombscore_clear(); + mumboscore_clear(); + func_8032048C(); + func_802D6344(); +} + +void func_8031FBF8(void) { + mumboscore_debug(); + honeycombscore_debug(); + jiggyscore_debug(); + func_803465DC(); + func_8029A890(); + func_802C5A48(); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031FC40.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031FE40.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_8031FEC0.s") + +struct { + s32 unk0; + s32 unk4; + u8 unk8[37]; +} D_803831A0; + +s32 func_8031FF1C(s32 index) { + return func_803200A4(D_803831A0.unk8, index); +} + +s32 func_8031FF44(s32 offset, s32 numBits) { + return func_803200E4(D_803831A0.unk8, offset, numBits); +} + +s32 func_8031FF74(s32 index, s32 set) { + s32 ret; + + ret = func_8031FF1C(index); + func_80320004(index, set); + return ret; +} + +void func_8031FFAC(void) { + s32 i; + + for (i = 0; i < 37; i++) { + D_803831A0.unk8[i] = 0; + } + func_8031FC40(); + func_8031FEC0(); +} + +void func_80320004(s32 index, s32 set) { + func_8032015C(D_803831A0.unk8, index, set); + func_8031FC40(); + func_8031FEC0(); +} + +void func_80320044(s32 startIndex, s32 set, s32 length) { + func_803201C8(D_803831A0.unk8, startIndex, set, length); + func_8031FC40(); + func_8031FEC0(); +} + +void func_8032008C(s32 *arg0, u8 **arg1) { + *arg0 = 0x25; + *arg1 = D_803831A0.unk8; +} + +// Returns a single bit from a byte array +s32 func_803200A4(u8 *array, s32 index) { + s32 ret; + if (array[index / 8] & (1 << (index & 7))) { + ret = 1; + } else { + ret = 0; + } + return ret; +} + +// Extracts an integer of the given number of bits from a byte array at the starting bit offset +s32 func_803200E4(u8 *array, s32 offset, s32 numBits) { + s32 ret = 0; + s32 i; + + for (i = 0; i < numBits; i++) { + ret |= (func_803200A4(array, offset + i) << i); + } + return ret; +} + +// Sets or clears a single bit in a byte array +void func_8032015C(u8 *array, s32 index, s32 set) { + if (set) { + array[index / 8] |= (1 << (index & 7)); + } else { + array[index / 8] &= ~(1 << (index & 7)); + } +} + +// Sets or clears a range of bits in a byte array +void func_803201C8(u8 *array, s32 startIndex, s32 set, s32 length) { + s32 i; + + for (i = 0; i < length; i++) { + func_8032015C(array, startIndex + i, (1 << i) & set); + } +} + +s32 func_80320240(void){return 1;} + +s32 func_80320248(void){return 1;} + +struct { + s32 unk0; + s32 unk4; + u8 unk8[25]; +} D_803831D0; + +// regalloc +// s32 func_80320250(void) { +// s32 addr = (s32) &D_803831D0.unk8[0]; +// u32 checksum = 0x6CE9E91F; +// s32 len = 25; +// s32 scrambled; +// u32 i; + +// // Scrambles the input address +// scrambled = (addr ^ 0x746DF219) & 0xFF; // scrambled = (low byte of addr) ^ 0x19 +// scrambled += (addr >> 0x18) << 0x18; // scrambled = (high byte of addr | low byte of addr) ^ 0x19 +// scrambled += ((addr >> 8) & 0xFFFF) << 8; // scrambled = addr ^ 0x19 +// // Unscrambles the input address + +// for (i = 0; i < len; i++) { +// s32 val = ((u8*)(scrambled ^ 0x19))[i]; +// checksum = val ^ (((checksum + val & 0xF) << 0x18) ^ (checksum >> 3)); +// } + +// return checksum; +// } +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_80320250.s") + +extern s32 D_8036DDF0; + +void func_803202D0(void) { + s32 addr = (s32) &D_803831D0.unk0; + addr ^= 0x7EDDF5F4; + addr ^= 0x7BEF9D80; + addr ^= 0x5326874; + *(s32*)(addr) = func_80320250(); +} + +s32 func_80320320(void) { + s32 addr = (s32) &D_803831D0.unk8[0]; + s32 checksum = 0x281E421C; + s32 len = 25; + s32 scrambled; + u32 i; + + // Scrambles the address of D_803831D8 + scrambled = (addr >> 8) & 0xFF0000; + scrambled += (addr & 0xFF) << 8; + scrambled = addr ^ scrambled; + // Unscrambles the address of D_803831D8 + addr = (scrambled & 0xFF000000) >> 8; + addr += (scrambled << 8) & 0xFF00; + addr ^= scrambled; + + for (i = 0; i < len; i++) { + checksum += (1 + i) * ((u8*)addr)[i]; + } + + return checksum; +} + +// regalloc +// void func_803203A0(void) { +// s32 addr = (s32) &D_803831D0.unk4; +// s32 scrambled; +// scrambled = (addr ^ 0x746DF219) & 0xFF; // scrambled = (low byte of addr) ^ 0x19 +// scrambled += (addr >> 0x18) << 0x18; // scrambled = (high byte of addr | low byte of addr) ^ 0x19 +// scrambled += ((addr >> 8) & 0xFFFF) << 8; // scrambled = addr ^ 0x19 +// *(s32*)(scrambled ^ 0x19) = func_80320320(); +// } +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_803203A0.s") + +s32 func_803203FC(s32 index) { + return func_803200A4(D_803831D0.unk8, index); +} + +void func_80320424(s32 index, s32 numBits) { + func_803200E4(D_803831D0.unk8, index, numBits); +} + +s32 func_80320454(s32 index, s32 arg1) { + s32 temp_v0; + + temp_v0 = func_803203FC(index); + func_803204E4(index, arg1); + return temp_v0; +} + +void func_8032048C(void) { + s32 i; + for (i = 0; i < 25; i++) { + D_803831D0.unk8[i] = 0; + } + func_803202D0(); + func_803203A0(); +} + +void func_803204E4(s32 index, s32 set) { + func_8032015C(D_803831D0.unk8, index, set); + func_803202D0(); + func_803203A0(); +} + +void func_80320524(s32 startIndex, s32 set, s32 length) { + func_803201C8(D_803831D0.unk8, startIndex, set, length); + func_803202D0(); + func_803203A0(); +} + +s32 func_8032056C(void) { + s32 temp_a0; + s32 temp_a1; + s32 temp_a1_2; + s32 phi_t9; + s32 addr = (s32)&D_803831D0; + s32 temp_v1; + + temp_v1 = ((addr & 0xE0000000) >> 15) + + ((addr & 0x1FC00000) >> 22) + + ((addr & 0x00300000) << 10) + + ((addr & 0x000F0000) << 7) + + ((addr & 0x0000E000) << 14) + + ((addr & 0x00001800) >> 4) + + ((addr & 0x00000780) << 10) + + ((addr & 0x00000060) << 4) + + ((addr & 0x00000018) << 18) + + ((addr & 0x00000007) << 11); + phi_t9 = (temp_v1 & 0x38000000) / (1 << 24); + temp_a0 = ((temp_v1 & 0x1E0600) << 0xB) | ((s32) (temp_v1 & 0x603800) / 8); + temp_a1 = (((temp_v1 & 0x1C07F) << 15) + ((temp_v1 & 0xC7800000) >> 17)) | + (phi_t9 + ((s32) (temp_v1 & 0x180) >> 6)); + temp_a1 = ((temp_a1 & 0x3FE000) << 7) | + (((temp_a0 >> 8) & 7) + ((temp_a1 << 0xA) & 0xFF800)) | + ((((u32) (temp_a0 & 0xF0000000) >> 0x15) + (temp_a1 & 0xE0000000)) ^ ((s32) ((temp_a0 / 0x40) & 0xF000) >> 9)); + return func_80320250() == *(s32*)temp_a1; +} + +s32 func_80320708(void) { + u16 temp_t6; + s32 addr; + + temp_t6 = ((s32) &D_803831D0.unk4 >> 0x10); + addr = (s32) &D_803831D0.unk4 ^ temp_t6; + return func_80320320() == *(s32*)(addr ^ temp_t6); +} + +extern u8 D_803831F8[]; + +// regalloc +// void func_80320748(void) { +// s32 *addr = &D_8036DDF0; +// s32 phi_v0; + +// for (phi_v0 = 0; phi_v0 < *addr; phi_v0++) { +// *(D_803831F8 + phi_v0) = *((u8*)&D_803831D0 + phi_v0); +// } +// } +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_80320748.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_94620/func_80320798.s") diff --git a/src/core2/code_9900.c b/src/core2/code_9900.c new file mode 100644 index 00000000..ea063d09 --- /dev/null +++ b/src/core2/code_9900.c @@ -0,0 +1,79 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +u8 D_8037C040; +struct { + f32 unk0; + s32 unk4; +}D_8037C048; +struct{ + f32 unk0; + s32 unk4; +} D_8037C050; +f32 D_8037C058; + +/* .code */ +f32 func_80290890(f32 arg0){ + f64 temp_f2; + temp_f2 = func_80257A44(arg0, 0.7f); + arg0 = temp_f2 + temp_f2; + if(1.0 <= arg0){ + arg0 = 2.0 - arg0; + } + arg0 = arg0 - 0.5; + return (f64)arg0 * 0.04; +} + +f32 func_80290920(f32 arg0, f32 arg1, f32 arg2){ + f32 tick = time_getDelta(); + if(arg0 < arg1){ + arg0 += tick*arg2; + if(arg1 < arg0){ + arg0 = arg1; + } + } + else{ + arg0-= tick*arg2; + if(arg0 < arg1){ + arg0 = arg1; + } + } + return arg0; +} + +void func_8029099C(void){ + func_8030DA44(D_8037C040); + D_8037C040 = 0; +} + +void func_802909C4(void){ + D_8037C040 = func_8030D90C(); + D_8037C050.unk0 = 1.0f; + + D_8037C048.unk4 = D_8037C050.unk4 = 13000; + D_8037C048.unk0 = D_8037C050.unk0; + sfxsource_setSfxId(D_8037C040, 0x3fa); + func_8030DD14(D_8037C040, 2); + func_8030DBB4(D_8037C040, D_8037C048.unk0); + sfxsource_setSampleRate(D_8037C040, D_8037C048.unk4); + D_8037C058 = 0.0f; +} + +void func_80290A6C(void){ + D_8037C058 += time_getDelta(); + D_8037C048.unk0 = func_80290920(D_8037C048.unk0, D_8037C050.unk0, 0.3f); + D_8037C048.unk4 = func_80290920((f32)D_8037C048.unk4, (f32)D_8037C050.unk4, 100.0f); + func_8030DBB4(D_8037C040, func_80290890(D_8037C058) + D_8037C048.unk0); + sfxsource_setSampleRate(D_8037C040, D_8037C048.unk4); + func_8030E2C4(D_8037C040); +} + +void func_80290B40(f32 arg0){ + D_8037C050.unk0 = arg0; +} + +void func_80290B4C(s32 arg0){ + D_8037C050.unk4 = arg0; +} diff --git a/src/core2/code_99860.c b/src/core2/code_99860.c new file mode 100644 index 00000000..ed8c0459 --- /dev/null +++ b/src/core2/code_99860.c @@ -0,0 +1,35 @@ +#include +#include "functions.h" +#include "variables.h" + +#define CORE2_99860_ARRAY_SIZE 0x33 + +/* .bss */ +extern u8* D_80383220; + +/* .code */ +bool func_803207F0(s32 index){ + return func_803200A4(D_80383220, index); +} + +void func_80320818(void){ + free(D_80383220); + D_80383220 = NULL; +} + +void func_80320840(void){ + int i; + D_80383220 =(u8*) malloc(CORE2_99860_ARRAY_SIZE); + for(i = 0; i < CORE2_99860_ARRAY_SIZE; i++){ + D_80383220[i] = 0; + } +} + +void func_803208C0(s32 index, bool value){ + func_8032015C(D_80383220, index, value); +} + +void func_803208F0(void){ + if(D_80383220 != NULL) + D_80383220 = (u8*)defrag(D_80383220); +} diff --git a/src/core2/code_999A0.c b/src/core2/code_999A0.c new file mode 100644 index 00000000..6dcbaf22 --- /dev/null +++ b/src/core2/code_999A0.c @@ -0,0 +1,180 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80303F7C(ActorMarker *, f32, s32, s32); +extern ActorProp *func_80303FE4(ActorMarker *, f32, s32); + +typedef Struct66s * (*Method_Core2_999A0_0)(f32[3], f32[3], f32[3], u32); +typedef Struct66s * (*Method_Core2_999A0_1)(f32[3], f32[3], f32, f32[3], s32, u32); +typedef Struct66s * (*Method_Core2_999A0_2)(f32[3], f32, f32[3], u32); +typedef void * (*Method_Core2_999A0_3)(void); + +typedef struct { + Method_Core2_999A0_0 unk0; + Method_Core2_999A0_1 unk4; + Method_Core2_999A0_2 unk8; + Method_Core2_999A0_3 unkC; +} Struct_core2_999A0_0; + +struct { + Struct_core2_999A0_0 unk0[0x8]; + Struct_core2_999A0_0 *unk80; + void *unk84; +}D_80383230; + +Struct66s *func_80320B98(f32 arg0[3], f32 arg1[3], f32 arg2[3], u32 arg3); +void func_80320B44(Method_Core2_999A0_0 arg0, Method_Core2_999A0_1 arg1, Method_Core2_999A0_2 arg2, Method_Core2_999A0_3 arg3); + +/* .code */ +f32 func_80320930(f32 arg0[3], f32 arg1, f32 arg2, u32 arg3) { + f32 pad48; + f32 sp3C[2]; + f32 sp30[3]; + f32 sp24[3]; + + sp3C[0] = arg0[0]; + sp3C[1] = arg0[1]; + sp3C[2] = arg0[2]; + sp3C[1] += arg1; + sp30[0] = arg0[0]; + sp30[1] = arg0[1]; + sp30[2] = arg0[2]; + sp30[1] += arg2; + if (func_80320B98(sp3C, sp30, sp24, arg3) != NULL) { + return sp30[1]; + } + return 100.0f; +} + + +f32 func_803209C4(f32 arg0[3]){ + return func_80320930(arg0, 200.0f, -2000.0f, 0x1E0000); +} + +void * func_803209EC(void){ + return D_80383230.unk84; +} + +bool func_803209F8(f32 arg0[3], f32 arg1[3], f32 *arg2, f32 arg3[3]) { + f32 sp34[3]; + f32 sp28[3]; + + *arg2 = 0.0f; + ml_vec3f_clear(arg1); + + arg0[0] = sp34[0] = arg3[0]; + sp34[1] = arg3[1] + 1.0f; + arg0[2] = sp34[2] = arg3[2]; + arg0[1] = arg3[1] - 100.0f; + if (!func_80309B48(sp34, arg0, sp28, 0)) { + arg0[1] = arg3[1] - 2000.0f; + if (!func_80309B48(&sp34, arg0, sp28, 0)) { + return 0; + } + } + arg0[1] += 6.0f; + *arg2 = arg3[1] - arg0[1]; + if (*arg2 < 0.0f) { + *arg2 = 0.0f; + } + func_80258108(sp28, &arg1[1], &arg1[0]); + return 1; +} + +void func_80320B24(Method_Core2_999A0_0 arg0, Method_Core2_999A0_1 arg1, Method_Core2_999A0_2 arg2){ + func_80320B44(arg0, arg1, arg2, NULL); +} + +void func_80320B44(Method_Core2_999A0_0 arg0, Method_Core2_999A0_1 arg1, Method_Core2_999A0_2 arg2, Method_Core2_999A0_3 arg3){ + D_80383230.unk80->unk0 = arg0; + D_80383230.unk80->unk4 = arg1; + D_80383230.unk80->unk8 = arg2; + D_80383230.unk80->unkC = arg3; + D_80383230.unk80++; +} + +void func_80320B7C(void){} + +void func_80320B84(void){ + D_80383230.unk80 = &D_80383230.unk0[0]; + D_80383230.unk84 = NULL; +} + +Struct66s *func_80320B98(f32 arg0[3], f32 arg1[3], f32 arg2[3], u32 arg3) { + Struct_core2_999A0_0 *var_s0; + Struct66s * temp_v0_2; + Struct66s * var_s7; + + var_s7 = NULL; + D_80383230.unk84 = NULL; + for(var_s0 = &D_80383230.unk0[0]; var_s0 < D_80383230.unk80; var_s0++){ + if (var_s0->unk0 != NULL) { + temp_v0_2 = var_s0->unk0(arg0, arg1, arg2, arg3); + if (temp_v0_2 != NULL) { + if (var_s0->unkC != NULL) { + D_80383230.unk84 = var_s0->unkC(); + } else { + D_80383230.unk84 = NULL; + } + } + var_s7 = (temp_v0_2 != NULL) ? temp_v0_2 : var_s7; + } + } + return var_s7; +} + +Struct66s *func_80320C94(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3[3], s32 arg4, u32 arg5) { + Struct_core2_999A0_0 *var_s0; + Struct66s * temp_v0_2; + Struct66s * var_s7; + + var_s7 = NULL; + D_80383230.unk84 = NULL; + for(var_s0 = &D_80383230.unk0[0]; var_s0 < D_80383230.unk80; var_s0++){ + if (var_s0->unk4 != NULL) { + temp_v0_2 = var_s0->unk4(arg0, arg1, arg2, arg3, arg4, arg5); + if (temp_v0_2 != 0) { + if (var_s0->unkC != NULL) { + D_80383230.unk84 = var_s0->unkC(); + } else { + D_80383230.unk84 = 0; + } + } + var_s7 = (temp_v0_2 != 0) ? temp_v0_2 : var_s7; + } + } + return var_s7; +} + +Struct66s *func_80320DB0(f32 arg0[3], f32 arg1, f32 arg2[3], u32 arg3) { + Struct_core2_999A0_0 *var_s0; + Struct66s * temp_v0_2; + Struct66s * var_s7; + + var_s7 = NULL; + D_80383230.unk84 = NULL; + for(var_s0 = &D_80383230.unk0[0]; var_s0 < D_80383230.unk80; var_s0++){ + if (var_s0->unk8 != NULL) { + temp_v0_2 = var_s0->unk8(arg0, arg1, arg2, arg3); + if (temp_v0_2 != NULL) { + if (var_s0->unkC != NULL) { + D_80383230.unk84 = var_s0->unkC(); + } else { + D_80383230.unk84 = NULL; + } + } + var_s7 = (temp_v0_2 != NULL) ? temp_v0_2 : var_s7; + } + } + return var_s7; +} + +ActorProp *func_80320EB0(ActorMarker *marker, f32 arg1, s32 arg2){ + return func_80303FE4(marker, arg1, arg2); +} + +int func_80320ED8(ActorMarker *marker, f32 arg1, s32 arg2){ + func_80303F7C(marker, arg1, arg2, 0); + return 0; +} diff --git a/src/core2/code_9A320.c b/src/core2/code_9A320.c new file mode 100644 index 00000000..ff084b91 --- /dev/null +++ b/src/core2/code_9A320.c @@ -0,0 +1,82 @@ +#include +#include "functions.h" +#include "variables.h" + +#define HONEYCOMB_COUNT 0x19 +#define HONEYCOMBSCORE_SIZE (((HONEYCOMB_COUNT-1 + 7) & ~7)/8) + +void honeycombscore_debug(void); +void honeycombscore_clear(void); + +/* .bss */ +extern u8 sHoneycombScore[3]; + +/* .code */ +void func_803212B0(void){ + honeycombscore_debug(); + honeycombscore_clear(); +} + +u8 *honeycombscore_get_ptr(void){ + return sHoneycombScore; +} + +bool honeycombscore_get(enum honeycomb_e indx){ + if( indx <= 0 || indx >= HONEYCOMB_COUNT) + return 0; + return (sHoneycombScore[(indx - 1) / 8] & (1 << (indx & 7))) != 0; +} + +void honeycombscore_debug(void){} + +void honeycombscore_clear(void){ + s32 i; + for(i = 0; i < HONEYCOMBSCORE_SIZE; i++){ + sHoneycombScore[i] = 0; + } +} + +void honeycombscore_set(enum honeycomb_e indx, bool val){ + if( 0 < indx && indx < HONEYCOMB_COUNT){ + if(val) + sHoneycombScore[(indx - 1) / 8] |= (1 << (indx & 7)); + else + sHoneycombScore[(indx - 1) / 8] &= ~(1 << (indx & 7)); + } +} + +s32 honeycombscore_get_level_total(enum level_e level_id){ + s32 v1; + s32 s2; + int i; + s32 total; + + if(level_id <= 0 || level_id == LEVEL_6_LAIR || level_id >= 0xC) + return 0; + + v1 = level_id*2 - 1; + v1 = (level_id < 7) ? v1 : v1 - 2; + + s2 = (level_id*2 - 1 == 0x15) ? v1 + 6 : v1 + 2; + for(i = v1, total = 0; i +#include "functions.h" +#include "variables.h" + +#define MUMBO_TOKEN_COUNT 126 +#define MUMBOSCORE_SIZE (((MUMBO_TOKEN_COUNT-1 + 7) & ~7)/8) + +void mumboscore_debug(void); +void mumboscore_clear(void); + +extern u8 sMumboTokenScore[MUMBOSCORE_SIZE]; + +void func_80321510(void){ + mumboscore_debug(); + mumboscore_clear(); +} + +u8* func_80321538(void){ + return sMumboTokenScore; +} + +bool mumboscore_get(s32 indx){ + if( indx <= 0 || indx >= MUMBO_TOKEN_COUNT) + return 0; + return (sMumboTokenScore[(indx - 1) / 8] & (1 << (indx & 7))) != 0; +} + +void mumboscore_debug(void){} + +void mumboscore_clear(void){ + s32 i; + for(i = 0; i < MUMBOSCORE_SIZE; i++){ + sMumboTokenScore[i] = 0; + } +} + +void mumboscore_set(s32 indx, bool val){ + if( 0 < indx && indx < MUMBO_TOKEN_COUNT){ + if(val) + sMumboTokenScore[(indx - 1) / 8] |= (1 << (indx & 7)); + else + sMumboTokenScore[(indx - 1) / 8] &= ~(1 << (indx & 7)); + } +} + +s32 mumboscore_get_total(void){ + s32 i = 1; + s32 cnt = 0; + + for(; i < MUMBO_TOKEN_COUNT; i++){ + cnt += mumboscore_get(i); + } + return cnt; +} + +void mumboscore_get_size_and_ptr(s32 *size, u8 **addr){ + *size = MUMBOSCORE_SIZE; + *addr = sMumboTokenScore; +} + diff --git a/src/core2/code_9A740.c b/src/core2/code_9A740.c new file mode 100644 index 00000000..d573eb32 --- /dev/null +++ b/src/core2/code_9A740.c @@ -0,0 +1,99 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8038FEE8(void); //rbb + +typedef struct { + u8 unk0; + u8 unk1; +} struct_9A740; + +extern struct { + u8 unk0; + u8 unk1; +}D_80383300; + +void func_803216D0(enum map_e map){ + s32 prev_lvl = D_80383300.unk1; + D_80383300.unk1 = map_getLevel(map); + load_overlay(level_to_overlay(D_80383300.unk1)); + D_80383300.unk0 = 0; + if(func_802E4A8C()){ + func_802E4A80(); + }else{ + if( D_80383300.unk1 != LEVEL_6_LAIR + && D_80383300.unk1 != LEVEL_C_BOSS + && prev_lvl == LEVEL_6_LAIR + ) + D_80383300.unk0 = 1; + + func_802E2E40(); + func_803464F8(D_80383300.unk1); + jiggyscore_clearAllSpawned(); + levelSpecificFlags_clear(); + func_8029A92C(); + func_803219A8(); + if( func_80320454(0x17, 0) + && getGameMode() != 0 + && D_80383300.unk1 != LEVEL_D_CUTSCENE + && map != MAP_91_FILE_SELECT + ){ + func_803204E4(0x18, TRUE); + } + + if(D_80383300.unk1 == LEVEL_9_RUSTY_BUCKET_BAY){ + func_8038FF18(); + } + + switch(map){ + case MAP_2_MM_MUMBOS_MOUNTAIN: + func_80386C90(); + break; + case MAP_7_TTC_TREASURE_TROVE_COVE: + func_80389E84(); + break; + case MAP_1B_MMM_MAD_MONSTER_MANSION: + func_80387260(); + break; + } + } +} + +void func_80321854(void){ + if(!func_802E4A8C()){ + if( D_80383300.unk1 == LEVEL_9_RUSTY_BUCKET_BAY){ + func_8038FEE8(); + } + + if( D_80383300.unk1 == LEVEL_1_MUMBOS_MOUNTAIN + && getGameMode() != 0 + && func_8031FF1C(BKPROG_31_MM_OPEN) + && !func_8031FF1C(0xC1) + ){ + func_803204E4(0x22, 1); + } + func_8029A924(); //null + func_803465BC(); //null + mapSavestate_free_all(); + func_8032196C(); + } +} + +enum level_e level_get(void){ + return D_80383300.unk1; +} + +int func_8032190C(void){ + return D_80383300.unk0; +} + +void func_80321918(int arg0){ + D_80383300.unk0 = arg0; +} + +void func_80321924(void){ + if(D_80383300.unk1 == LEVEL_9_RUSTY_BUCKET_BAY){ + func_8038FF70(); + } +} diff --git a/src/core2/code_9A9D0.c b/src/core2/code_9A9D0.c new file mode 100644 index 00000000..4f7708f3 --- /dev/null +++ b/src/core2/code_9A9D0.c @@ -0,0 +1,100 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_803219F4(s32 arg0); + +/* .bss */ +extern u8 D_80383310; +extern s32 D_80383314; + +/* .code */ +s32 func_80321960(void){ + return D_80383310; +} + +void func_8032196C(void){ + if( D_80383310 != 3 && D_80383310 != 5 ){ + func_8025A904(); + } +} + +void func_803219A8(void){ + if( D_80383310 != 3 && D_80383310 != 5 ){ + D_80383310 = 0; + func_803219F4(1); + D_80383314 = COMUSIC_57_TURBO_TRAINERS; + } +} + +void func_803219F4(s32 arg0){ + switch(D_80383310){ + case 2: //L80321A30 + func_8025A55C(-1, 4000, 7); + func_8024BD08(1); + comusic_8025AB44(COMUSIC_58_WADING_BOOTS, 0, 4000); + func_8025AABC(COMUSIC_58_WADING_BOOTS); + break; + case 4: //L80321A6C + func_8024BD08(1); + if(D_80383314 == COMUSIC_57_TURBO_TRAINERS){ + func_8025A55C(-1, 4000, 7); + } + comusic_8025AB44(D_80383314, 0, 4000); + func_8025AABC(D_80383314); + break; + case 3: //L80321AC0 + func_8025A55C(-1, 4000, 7); + func_8024BD08(1); + comusic_8025AB44(COMUSIC_95_BBONUS_A, 0, 4000); + func_8025AABC(COMUSIC_95_BBONUS_A); + break; + case 1: //L80321AF8 + case 5: //L80321AF8 + break; + } + D_80383310 = arg0; + + switch(D_80383310){ + case 2: //L80321B28 + func_8024BD08(0); + func_8025A55C(0, 4000, 7); + func_8025A6EC(COMUSIC_58_WADING_BOOTS, -1); + func_8025A8B8(COMUSIC_58_WADING_BOOTS, 1); + break; + case 4: //L80321B60 + if(map_get() == MAP_27_FP_FREEZEEZY_PEAK){ + D_80383314 = COMUSIC_8A_GETTING_TURBO_TRAINERS; + } + else{ + D_80383314 = COMUSIC_57_TURBO_TRAINERS; + } + func_8024BD08(0); + if(D_80383314 == COMUSIC_57_TURBO_TRAINERS){ + func_8025A55C(0, 4000, 7); + } + func_8025A6EC(D_80383314, -1); + func_8025A8B8(D_80383314, 1); + break; + case 3: //L80321BDC + func_803228D8(); + func_8024BD08(0); + func_8025A55C(0, 4000, 7); + func_8025A6EC(COMUSIC_95_BBONUS_A, -1); + func_8025A8B8(COMUSIC_95_BBONUS_A, 1); + break; + case 5: //L80321C1C + func_803228D8(); + break; + case 1: //L80321C24 + break; + } +} + +void func_80321C34(void){ + if( D_80383310 == 4 + && func_8028E80C(3) == 0.0f + ){ + func_803219F4(1); + } +} diff --git a/src/core2/code_9B180.c b/src/core2/code_9B180.c new file mode 100644 index 00000000..90beaf26 --- /dev/null +++ b/src/core2/code_9B180.c @@ -0,0 +1,163 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + u8 pad0[2]; + s16 unk2; +}Struct_core2_9B180_1; + +typedef struct struct_core2_9B180_s{ + s16 unk0; + // u8 pad2[0x2]; + Struct_core2_9B180_1 *unk4; + void (*unk8)(struct struct_core2_9B180_s *); + void (*unkC)(struct struct_core2_9B180_s *); + void (*unk10)(struct struct_core2_9B180_s *); +}Struct_core2_9B180_0; + +extern void func_8024FE44(u8, f32, f32); +extern void func_8030EDAC(f32, f32); + +/* .data */ +extern Struct_core2_9B180_0 D_8036DE00[6]; +extern u8 D_8036DE78; + +/* .bss */ +extern u8 D_80383330; +extern f32 D_80383334; + +/* .code */ +void func_80322110(Struct_core2_9B180_0 *arg0) { + D_80383334 = (f32) arg0->unk4->unk2; +} + +void func_80322130(Struct_core2_9B180_0 *arg0) { + f32 sp1C[3]; + + player_getPosition(sp1C); + if (sp1C[1] < D_80383334) { + if (func_8028F66C(0x2C) == 2) { + arg0->unk4 = 0; + FUNC_8030E624(SFX_96_HOTSAND_EEL_HISS, 1.0f, 32000); + FUNC_8030E624(SFX_A_BANJO_LANDING_05, 1.0f, 32000); + return; + } + sp1C[1] = D_80383334; + func_8028FAB0(sp1C); + func_802BD0D8(6); + } +} + + +void func_803221C4(s32 arg0){ + func_8024FE44(0, 0.2f, 1.25f); +} + +void func_803221F4(s32 arg0){ + func_8030EDAC(0.50999999f, 1.0f); + func_80244A98(0); +} + +void func_8032222C(s32 arg0) { + s32 phi_s0; + + for(phi_s0 = 1; phi_s0 < 5; phi_s0++){ + func_8024FE44(phi_s0, 0.2f, 1.25f); + } +} + +void func_80322298(Struct_core2_9B180_0 *arg0){ + if(D_8036DE78){ + D_8036DE78 = 0; + arg0 ->unk4 = 0; + } +} + +void func_803222BC(s32 ag0){ + if(func_8024E698(0) == 1){ + func_8031D06C(0,0); + } +} + +void func_803222F4(Struct_core2_9B180_0 *arg0){ + if(D_8036DE78){ + D_8036DE78 = 0; + arg0 ->unk4 = 0; + } +} + +void func_80322318(s32 arg0){ + func_8031D0C0(0, 0); +} + +bool func_80322340(s32 arg0) { + f32 sp1C[3]; + + if (func_80304E24(arg0, &sp1C)) { + return 1; + } + return 0; +} + +void func_8032236C(s32 arg0, s32 arg1, s32 *arg2) { + if (func_80322340(arg0) && (*arg2 == 0)) { + *arg2 = arg1; + } +} + +void func_803223AC(void) { + Struct_core2_9B180_0 *i_ptr; + s32 sp28; + + func_80244A98(1); + for(i_ptr = D_8036DE00; i_ptr != &D_8036DE00[6]; i_ptr++){ + i_ptr->unk4 = func_803049CC(i_ptr->unk0, 0); + if(i_ptr->unk4 != 0 && i_ptr->unk8 != NULL){ + i_ptr->unk8(i_ptr); + } + } + + sp28 = 0; + func_8032236C(0x19, 1, &sp28); + func_8032236C(0x1A, 2, &sp28); + func_8032236C(0x1B, 3, &sp28); + func_8032236C(0x1C, 4, &sp28); + func_8032236C(0x1D, 5, &sp28); + sp28 = (sp28 == 0) ? 2 : sp28; + func_8024BF94(sp28); +} + +void func_80322490(void) { + Struct_core2_9B180_0 *i_ptr; + + if (D_80383330 != 0) { + for(i_ptr = D_8036DE00; i_ptr != &D_8036DE00[6]; i_ptr++){ + if(i_ptr->unk4 != 0 && i_ptr->unkC != NULL){ + i_ptr->unkC(i_ptr); + } + } + } +} + + +void func_803224FC(void) { + s32 i; + Struct_core2_9B180_0 *i_ptr; + + for(i_ptr = D_8036DE00; i_ptr != &D_8036DE00[6]; i_ptr++){ + if(i_ptr->unk4 != 0 && i_ptr->unk10 != NULL){ + i_ptr->unk10(i_ptr); + } + } + func_8030EDAC(0.0f, 1.0f); + func_80244A98(1); + for(i = 0; i < 5; i++){ + func_8024FE44(i, 0.0f, 1.0f); + } +} + + +void func_803225B0(s32 arg0, s32 arg1){ + D_80383330 =(arg1 == 2) ? TRUE : FALSE; +} diff --git a/src/core2/code_9B650.c b/src/core2/code_9B650.c new file mode 100644 index 00000000..e67204e4 --- /dev/null +++ b/src/core2/code_9B650.c @@ -0,0 +1,137 @@ +#include +#include "functions.h" +#include "variables.h" +#include "SnS.h" + +typedef struct{ + s16 unk0; + s16 unk2; + s16 unk4; + s16 unk6; +}Struct_Core2_9B650_1s; + +typedef struct{ + s16 map_id; + s16 unk2; + s16 sns_id; +}Struct_Core2_9B650_0s; + +extern Struct_Core2_9B650_0s D_8036E2A0[] = +{ + {MAP_61_CCW_WINTER_NABNUTS_HOUSE, -1, SNS_ITEM_EGG_YELLOW}, + {MAP_3F_RBB_CAPTAINS_CABIN, -2, SNS_ITEM_EGG_RED}, + {MAP_2C_MMM_BATHROOM, -3, SNS_ITEM_EGG_GREEN}, + {0, 0, 1} +}; + +extern Struct_Core2_9B650_1s D_8036DE80[] = { + {-1, 0x87, -1, 0}, + {-2, 0x84, -1, 0}, + {-3, 0x86, -1, 0}, + {0} +}; + +extern struct { + s16 unk0; + s16 unk2; + s16 unk4; +} D_80383340; +extern int D_80383348; + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9B650/func_803225E0.s") +#else +s32 func_803225E0(enum map_e map_id){ + s32 i; + s16 *ptr = D_8036E2A0; + + for(i = 0; D_8036E2A0[i].map_id != 0 && D_8036E2A0[i].map_id != map_id; i++){} + + if( D_8036E2A0[i].map_id != 0 && sns_get_item_state(D_8036E2A0[i].sns_id, 1)){ + map_id = D_8036E2A0[i].unk2; + } + + for(i = 0; D_8036DE80[i].unk0 != 0; i++){ + if( D_8036DE80[i].unk0 == map_id) + return i; + } + + return 0; +} +#endif + +s32 func_803226BC(enum map_e map_id){ + return D_8036DE80[func_803225E0(map_id)].unk6; +} + +s32 func_803226E8(enum map_e map_id){ + return D_8036DE80[func_803225E0(map_id)].unk2; +} + +s32 func_80322714(enum map_e map_id){ + return D_8036DE80[func_803225E0(map_id)].unk4; +} + +s32 func_80322740(void){ + return D_80383340.unk4; +} + +s32 func_8032274C(void){ + return D_80383340.unk0; +} + +s32 func_80322758(void){ + return D_80383340.unk2; +} + +void func_80322764(void){ + D_80383348 = FALSE; + D_80383340.unk0 = D_80383340.unk2 = D_80383340.unk4 = 0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9B650/func_8032278C.s") +// extern s32 D_8036E2B4; + +// void func_8032278C(s32 arg0, s32 arg1) { +// s32 temp_v0; + +// D_80383340.unk4 = func_803226BC(map_get()); +// D_80383340.unk0 = func_803226E8(map_get()); +// D_80383340.unk2 = func_80322714(map_get()); +// if (arg1 == 3) { +// D_8036E2B4 = 1; +// return; +// } +// temp_v0 = func_80322740(); +// if ((arg1 == 2) && ((D_8036E2B4 != 0) || (arg0 != 1))) { +// D_8036E2B4 = 0; +// if (D_80383348 == 0) { +// if ((temp_v0 & 1) != 0) { +// func_8024ADF0(0); +// } else { +// func_8024ADF0(1); +// } +// } else { +// D_80383348 = 0; +// func_8024BD08(1); +// } +// } +// if ((arg0 == 1) && (arg1 == 2)) { +// func_8025A430(-1, 0xFA0, 8); +// } +// if ((arg1 == 1) && (arg0 == 2)) { +// func_8025A430(0, 0xFA0, 8); +// } +// } + + +void func_803228D8(void){ + if(!D_80383348){ + func_8024BD08(0); + D_80383348 = TRUE; + } +} + +int func_80322914(void){ + return D_80383348; +} diff --git a/src/core2/code_9B990.c b/src/core2/code_9B990.c new file mode 100644 index 00000000..55d1e24b --- /dev/null +++ b/src/core2/code_9B990.c @@ -0,0 +1,399 @@ +#include +#include "functions.h" +#include "variables.h" + + +/* !!!!!!!!!!!!!!!!!!!!!!!!!!! BREAK??? !!!!!!!!!!!!!!!!!!!!!!!!!*/ + +void __overlay_mmm_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80322930(void); +void func_80322960(void); +void __overlay_mmm_update(void); +void func_803229C0(s32, s32); + +void __overlay_cc_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80322A00(void); +void func_80322A28(void); +void __overlay_cc_update(void); +void func_80322A78(s32, s32); + +void __overlay_gv_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80322A94(void); +void func_80322ACC(void); +void __overlay_gv_update(void); +void func_80322B3C(s32, s32); + +void __overlay_ttc_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80322B58(void); +void func_80322B78(void); +void __overlay_ttc_update(void); +void func_80322BB8(s32, s32); + +void __overlay_mm_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80322CC8(void); +void func_80322CD0(void); +void __overlay_mm_update(void); +void func_80322CE0(s32, s32); + +void __overlay_bgs_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80322D30(void); +void func_80322D38(void); +void __overlay_bgs_update(void); +void func_80322D94(s32, s32); + +void __overlay_sm_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80322BD4(void); +void func_80322BDC(void); +void __overlay_sm_update(void); +void func_80322BEC(s32, s32); + +void __overlay_lair_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80322C18(void); +void func_80322C38(void); +void __overlay_lair_update(void); +void func_80322C78(s32, s32); + +void __overlay_fight_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80322C94(void); +void func_80322C9C(void); +void __overlay_fight_update(void); +void func_80322CAC(s32, s32); + +void __overlay_intro_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80322CFC(void); +void func_80322D04(void); +void __overlay_intro_update(void); +void func_80322D14(s32, s32); + +void __overlay_fp_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80322DB0(void); +void func_80322DE8(void); +void __overlay_fp_update(void); +void func_80322E58(s32, s32); + +typedef struct{ + s16 level_id; + s16 overlay_id; +}level_overlay_map_elem; + +typedef struct{ + s16 unk0; + u8 unk2; + u8 unk3; + void (*unk4)(void); + void (*unk8)(void); + void (*unkC)(void); + void (*unk10)(Gfx **, Mtx **, Vtx **); + void (*unk14)(s32, s32); +} level_overlay_update_struct; + +/* .data */ +level_overlay_map_elem D_8036E2C0[] = { + {LEVEL_3_CLANKERS_CAVERN, OVERLAY_2_WHALE}, + {LEVEL_A_MAD_MONSTER_MANSION, OVERLAY_3_HAUNTED}, + {LEVEL_7_GOBIS_VALLEY, OVERLAY_4_DESERT}, + {LEVEL_2_TREASURE_TROVE_COVE, OVERLAY_5_BEACH}, + {LEVEL_1_MUMBOS_MOUNTAIN, OVERLAY_6_JUNGLE}, + {LEVEL_4_BUBBLEGLOOP_SWAMP, OVERLAY_7_SWAMP}, + {LEVEL_9_RUSTY_BUCKET_BAY, OVERLAY_8_SHIP}, + {LEVEL_5_FREEZEEZY_PEAK, OVERLAY_9_SNOW}, + {LEVEL_8_CLICK_CLOCK_WOOD, OVERLAY_A_TREE}, + {LEVEL_B_SPIRAL_MOUNTAIN, OVERLAY_B_TRAINING}, + {LEVEL_D_CUTSCENE, OVERLAY_C_INTRO}, + {LEVEL_6_LAIR, OVERLAY_D_WITCH}, + {LEVEL_C_BOSS, OVERLAY_E_BATTLE}, + {0} +}; + +level_overlay_update_struct D_8036E2F8[] = { + { OVERLAY_2_WHALE, 1, 0, func_80322A28, __overlay_cc_update, func_80322A00, __overlay_cc_draw, func_80322A78}, + { OVERLAY_3_HAUNTED, 1, 0, func_80322960, __overlay_mmm_update, func_80322930, __overlay_mmm_draw, func_803229C0}, + { OVERLAY_4_DESERT, 1, 0, func_80322ACC, __overlay_gv_update, func_80322A94, __overlay_gv_draw, func_80322B3C}, + { OVERLAY_5_BEACH, 1, 0, func_80322B78, __overlay_ttc_update, func_80322B58, __overlay_ttc_draw, func_80322BB8}, + { OVERLAY_6_JUNGLE, 1, 0, func_80322CD0, __overlay_mm_update, func_80322CC8, __overlay_mm_draw, func_80322CE0}, + { OVERLAY_7_SWAMP, 1, 0, func_80322D38, __overlay_bgs_update, func_80322D30, __overlay_bgs_draw, func_80322D94}, + { OVERLAY_B_TRAINING, 1, 0, func_80322BDC, __overlay_sm_update, func_80322BD4, __overlay_sm_draw, func_80322BEC}, + { OVERLAY_C_INTRO, 1, 0, func_80322D04, __overlay_intro_update, func_80322CFC, __overlay_intro_draw, func_80322D14}, + { OVERLAY_D_WITCH, 1, 0, func_80322C38, __overlay_lair_update, func_80322C18, __overlay_lair_draw, func_80322C78}, + { OVERLAY_E_BATTLE, 1, 0, func_80322C9C, __overlay_fight_update, func_80322C94, __overlay_fight_draw, func_80322CAC}, + { OVERLAY_9_SNOW, 0, 1, func_80322DE8, __overlay_fp_update, func_80322DB0, __overlay_fp_draw, func_80322E58}, + {0} +}; + +/* .bss */ +extern struct { + u8 unk0; + u8 unk1; + u8 pad2[2]; + void (*unk4)(void); + void (*unk8)(void); + void (*unkC)(void); + void (*unk10)(Gfx **, Mtx **, Vtx **); + void (*unk14)(s32, s32); +} D_80383350; + +/* .code */ +void __overlay_mmm_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } + +void func_80322930(void){ + func_8038953C(); + func_80389CD8(); + func_8038A994(); +} + +void func_80322960(void){ + func_80389544(); + func_80389CE0(); + func_8038A9B4(); +} + +void __overlay_mmm_update(void){ + func_8038966C(); + func_80389FC0(); + func_8038AA44(); +} + +void func_803229C0(s32 arg0, s32 arg1){ + func_80389DF4(arg0, arg1); +} + +void __overlay_cc_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ + func_80388760(gfx, mtx, vtx); +} + +void func_80322A00(void){ + func_80388CB4(); + func_803880D4(); +} + +void func_80322A28(void){ + func_80388D54(); + func_80388104(); +} + +void __overlay_cc_update(void){ + func_80388F4C(); + func_8038817C(); +} + +void func_80322A78(s32 arg0, s32 arg1){ return; } + + +void __overlay_gv_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } + + +void func_80322A94(void){ + func_8038FF60(); + func_803900F8(); + func_803903EC(); //gv_matchingGame_reset + func_803909EC(); +} + +void func_80322ACC(void){ + func_8038FF68(); + func_80390100(); + func_8039040C(); //gv_matchingGame_init + func_803909F4(); +} + +void __overlay_gv_update(void){ + func_8038FFF4(); + func_80390138(); + func_803904A8(); //gv_matchingGame_update + func_80390A94(); +} + +void func_80322B3C(s32 arg0, s32 arg1){ return; } + +void __overlay_ttc_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } + +void func_80322B58(void){ + func_8038B04C(); +} + +void func_80322B78(void){ + func_8038B094(); +} + +void __overlay_ttc_update(void){ + func_8038B2F0(); +} + +void func_80322BB8(s32 arg0, s32 arg1){ return; } + +void __overlay_sm_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } + +void func_80322BD4(void){ return; } + +void func_80322BDC(void){ return; } + +void __overlay_sm_update(void){ return; } + +void func_80322BEC(s32 arg0, s32 arg1){ return; } + +void __overlay_lair_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ + lair_func_8038E768(gfx, mtx, vtx); +} + +void func_80322C18(void){ + lair_func_8038CD48(); +} + +void func_80322C38(void){ + lair_func_8038CF18(); +} + +void __overlay_lair_update(void){ + lair_func_8038E0B0(); +} + +void func_80322C78(s32 arg0, s32 arg1){ return; } + + +void __overlay_fight_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } + +void func_80322C94(void){ return; } + +void func_80322C9C(void){ return; } + +void __overlay_fight_update(void){ return; } + +void func_80322CAC(s32 arg0, s32 arg1){ return; } + +void __overlay_mm_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } + +void func_80322CC8(void){ return; } + +void func_80322CD0(void){ return; } + +void __overlay_mm_update(void){ return; } + +void func_80322CE0(s32 arg0, s32 arg1){ return; } + +void __overlay_intro_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } + +void func_80322CFC(void){ return; } + +void func_80322D04(void){ return; } + +void __overlay_intro_update(void){ return; } + +void func_80322D14(s32 arg0, s32 arg1){ return; } + +void __overlay_bgs_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } + +void func_80322D30(void){ return; } + +void func_80322D38(void){ + if( map_get() == MAP_10_BGS_MR_VILE + && func_803203FC(2) + && func_803203FC(7) + ){ + func_8029A95C(TRANSFORM_5_CROC); + } +} + +void __overlay_bgs_update(void){ return; } + +void func_80322D94(s32 arg0, s32 arg1){ return; } + +void __overlay_fp_draw(Gfx **gfx, Mtx **mtx, Vtx **vtx){ return; } + +void func_80322DB0(void){ + func_8038A888(); + func_8038AA58(); + func_8038B8A8(); + func_8039195C(); +} + +void func_80322DE8(void){ + func_8038A7F0(); + func_8038A9C0(); + func_8038B7A4(); + func_803918C0(); +} + +void __overlay_fp_update(void){ + func_8038A890(); + func_8038AA60(); + func_8038B544(); + func_80391994(); +} + +void func_80322E58(s32 arg0, s32 arg1){ return; } + +void func_80322E64(Gfx **gfx, Mtx **mtx, Vtx **vtx){ + if(D_80383350.unk10) + D_80383350.unk10(gfx, mtx, vtx); +} + +enum overlay_e level_to_overlay(enum level_e lvl){ + int i; + for(i = 0; D_8036E2C0[i].level_id; i++){ + if(D_8036E2C0[i].level_id == lvl) + return D_8036E2C0[i].overlay_id; + } + return 0; +} + +void func_80322EDC(int arg0){ + if(arg0 == D_80383350.unk1 && D_80383350.unkC){ + D_80383350.unkC(); + } +} + +void func_80322F1C(int arg0){ + if(arg0 == D_80383350.unk0 && D_80383350.unk4){ + D_80383350.unk4(); + } +} + +void func_80322F5C(void){ + func_80322EDC(0); +} + +void func_80322F7C(void){ + func_80322EDC(1); +} + +void func_80322F9C(void){ + func_80322F1C(0); +} + +void func_80322FBC(void){ + func_80322F1C(1); +} + +void func_80322FDC(void){ return; } + +void func_80322FE4(void){ + int i; + s32 overlay_id; + func_80356714(); + overlay_id = get_loaded_overlay_id(); + D_80383350.unk4 = D_80383350.unk8 = D_80383350.unkC = NULL; + D_80383350.unk10 = NULL; + D_80383350.unk14 = NULL; + for(i = 0; D_8036E2F8[i].unk0 != 0; i++){ + if(overlay_id == D_8036E2F8[i].unk0){ + D_80383350.unk0 = D_8036E2F8[i].unk2; + D_80383350.unk1 = D_8036E2F8[i].unk3; + D_80383350.unk4 = D_8036E2F8[i].unk4; + D_80383350.unk8 = D_8036E2F8[i].unk8; + D_80383350.unkC = D_8036E2F8[i].unkC; + D_80383350.unk10 = D_8036E2F8[i].unk10; + D_80383350.unk14 = D_8036E2F8[i].unk14; + break; + } + } +} + +void func_80323098(s32 arg0, s32 arg1){ + if(D_80383350.unk14) + D_80383350.unk14(arg0, arg1); +} + +void overlay_update(void){ + if(D_80383350.unk8) + D_80383350.unk8(); +} diff --git a/src/core2/code_9BD0.c b/src/core2/code_9BD0.c new file mode 100644 index 00000000..69298234 --- /dev/null +++ b/src/core2/code_9BD0.c @@ -0,0 +1,322 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80291488(s32 arg0); +void func_802914CC(s32 arg0); + +/* .bss */ +u8 D_8037C060; +u8 D_8037C061; +u8 D_8037C062; +s32 D_8037C064; +s32 D_8037C068; +s32 D_8037C06C; +s32 D_8037C070; +s32 D_8037C074; +s32 D_8037C078; +s32 D_8037C07C; +s32 D_8037C080; +s32 D_8037C084; + +/* .code */ +void func_80290B60(s32 arg0){ + D_8037C061 = arg0; +} + +void func_80290B6C(void){ + func_802BC5CC(); + func_80290220(); + D_8037C060 = 0; + D_8037C062 = 0; + func_80291488(2); + func_80290B60(2); + func_8029E3C0(7, 0.5f); +} + +void func_80290BC0(s32 arg0){ + func_802BC538(arg0, + &D_8037C064,&D_8037C068,&D_8037C06C, + &D_8037C070,&D_8037C074,&D_8037C078, + &D_8037C07C,&D_8037C080,&D_8037C084 + ); + + if(D_8037C061 == 3 && D_8037C07C == 0){ + func_80290B60(2); + } + switch (D_8037C061) + { + case 1://L80290C8C + func_802BD8A4(D_8037C064, D_8037C068, D_8037C06C); + break; + case 2: //L80290CC8 + func_802BD8A4(D_8037C070, D_8037C074, D_8037C078); + break; + case 3://L80290D04 + func_802BD8A4(D_8037C07C, D_8037C080, D_8037C084); + break; + } +} + +int func_80290D48(void){ + int sp2C; + s32 sp28; + s32 sp24; + s32 sp20; + s32 sp1C; + + + sp2C = func_802903CC(); + if(sp2C == -1 || !func_802B9EA8(sp2C)){ + func_80290BC0(0); + return FALSE; + } + + sp1C = bs_getState(); + switch(func_802B9E8C(sp2C)){ + case 4: + sp28 = func_802B9E34(sp2C); + sp24 = func_802BA234(sp28); + func_80290BC0(sp24); + return FALSE; + case 3: //L80290DD8 + if(bsBeeFly_inSet(sp1C) && !func_802BA4D0(func_802B9E48(sp2C))){ + return FALSE; + } + func_802BD0D8(0x11); + func_802BF798(sp2C); + func_80291488(0x9); + return TRUE; + case 1://L80290E28 + if(bsBeeFly_inSet(sp1C) && !func_802BA89C(func_802B9E5C(sp2C))){ + return FALSE; + } + func_802BD0D8(0x8); + func_802BF9B8(sp2C); + func_80291488(0x9); + return TRUE; + default://L80290E7C + return FALSE; + } + + +} + +int func_80290E8C(void){ + if(func_8028EE84() != BSWATERGROUP_2_UNDERWATER) + return FALSE; + + func_802BD0D8(3); + func_80291488(0xB); + if( map_get() == MAP_B_CC_CLANKERS_CAVERN + && player_getYPosition() < 1201.0f + ){ + func_802C1B20(1100.0f); + } + return TRUE; +} + +void func_80290F14(void){ + if( !func_80298850() + && func_8028ECAC() != 4 + && func_8029E270(7) == 0.0f + && should_zoom_out_camera() + ){ + switch(D_8037C061){ + case 1://L80290FA4 + func_80299D2C(SFX_12E_CAMERA_ZOOM_MEDIUM, 1.0f, 12000); + func_80290B60(2); + break; + case 2://L80290FBC + if(D_8037C07C){ + func_80299D2C(SFX_12E_CAMERA_ZOOM_MEDIUM, 1.2f, 12000); + func_80290B60(3); + } + else{ + func_80299D2C(SFX_12D_CAMERA_ZOOM_CLOSEST, 1.0f, 12000); + func_80290B60(1); + } + break; + case 3://L80291008 + func_80299D2C(SFX_12D_CAMERA_ZOOM_CLOSEST, 1.0f, 12000); + func_80290B60(1); + break; + } + func_8029E3C0(0x7, 0.4f); + } +} + +void func_8029103C(void){ + func_80299EB4(); +} + +int func_8029105C(s32 arg0){ + if(func_80298850()) + return FALSE; + + if(should_rotate_camera_left() && func_802C1DB0(-45.0f)){ + func_80291488(arg0); + func_8029103C(); + return TRUE; + } + + if(should_rotate_camera_right() && func_802C1DB0(45.0f)){ + func_80291488(arg0); + func_8029103C(); + return TRUE; + } + + return FALSE; +} + +//_camera_mode_1_update +void func_80291108(void){ + if(!func_80290D48() && func_802BD0CC() == 0x10){ + func_80290F14(); + func_8029105C(8); + } +} + +//_camera_mode_2_3_b_update +void func_80291154(void){ + int tmp; + if(!func_80290D48() && !func_80290E8C()){ + if(button_held(BUTTON_R)){ + func_802BD0D8(0x13); + func_80291488(0x4); + func_80290F14(); + } + else{ + tmp = func_8029105C(7); + func_80290F14(); + if(!tmp) + func_802BD0D8(0xB); + } + } +} + +//_camera_mode_4 and_c_update +void func_802911E0(void){ + if( !func_80290D48() && !func_80290E8C() && !func_8029105C(7)){ + func_80290F14(); + if(button_held(BUTTON_R)){ + func_802C095C(); + } + else{ + if(func_802C0640()) + func_80291488(2); + } + } +} + +//_camera_mode_7_update +void func_80291268(void){ + if( !func_80290D48() && !func_80290E8C()){ + func_80290F14(); + if(!func_8029105C(7) && func_802C1EE0()){ + func_80291488(2); + } + } +} + +//_camera_mode_8_update +void func_802912D0(void){ + if(!func_80290D48()){ + func_80290F14(); + if(!func_8029105C(8) && func_802C1EE0()){ + func_802914CC(0x10); + } + + } +} + +//_camera_mode_A_update +void func_80291328(void){ + if(func_802C189C()){ + func_80291488(2); + } +} + +/* camera update */ +void func_80291358(void){ + func_8029E1A8(7); + func_80290298(); + func_8029028C(0); + switch(D_8037C062){ + case 0x9: //L802913A0 + if(func_80290D48()) + break; + if(D_8037C060){ + func_80291488(1); + func_802BD0D8(D_8037C060); + } + else{ + func_80291488(2); + } + break; + case 0x1: //L802913E8 + func_80291108(); + break; + case 0x7: //L802913F8 + func_80291268(); + break; + case 0x8: //L80291408 + func_802912D0(); + break; + + case 0x4: //L80291418 + case 0xc: //L80291418 + func_802911E0(); + break; + + case 0xa: //L80291428 + func_80291328(); + break; + + default://80291438 + if(D_8037C060){ + func_80291488(1); + func_802BD0D8(D_8037C060); + } + else{ + func_80291154(); + } + break; + + case 0x5: //L8029146C + case 0x6: //L8029146C + case 0x0: //L8029146C + break; + } +} + +s32 func_8029147C(void){ + return D_8037C062; +} + +void func_80291488(s32 arg0){ + if(D_8037C062 == 0xa && arg0 != D_8037C062){ + func_8029028C(1); + } + D_8037C062 = arg0; +} + +void func_802914CC(s32 arg0){ + D_8037C060 = arg0; + if(D_8037C062 != 9 && D_8037C062 != 0xa){ + func_80291488(1); + func_802BD0D8(arg0); + } +} + +void func_8029151C(s32 arg0){ + func_80291488(6); + func_802BD0D8(arg0); +} + +void func_80291548(void){ + D_8037C060 = 0; + if(D_8037C062 != 9 && D_8037C062 != 0xa){ + func_80291488(2); + } +} diff --git a/src/core2/code_9C170.c b/src/core2/code_9C170.c new file mode 100644 index 00000000..20e69077 --- /dev/null +++ b/src/core2/code_9C170.c @@ -0,0 +1,292 @@ +#include +#include "functions.h" +#include "variables.h" + +extern u8 D_80383370; + +/* .code */ +void func_80323100(void){ + func_8024AED8(); +} + +void func_80323120(void){ + func_8024AE74(); +} + +void func_80323140(s32 arg0, s32 arg1){ + func_8024BD40(arg0, arg1); + func_8032278C(arg0, arg1); +} + +void func_80323170(void){ + func_8024AF48(); +} + +void func_80323190(void){ + D_80383370 = func_8030D90C(); + func_8030DD14(D_80383370, 3); + sfxsource_setSfxId(D_80383370, SFX_21_EGG_BOUNCE_1); + sfxsource_setSampleRate(D_80383370, 12000); +} + +void func_803231E8(void){ + func_8030DA44(D_80383370); +} + +void func_8032320C(void){ + func_8030E2C4(D_80383370); +} + +void func_80323230(void){} + +void func_80323238(void){} + + +// BREAK ??? + +extern f32 func_80258708(f32 [3], f32[3]); +extern f32 ml_vec3f_distance_squared(f32 [3], f32 [3]); +extern void func_80341180(f32, s32, s32, f32 *, f32 [3]); + +/* .rodata */ +extern f64 D_80378D90; +extern f32 D_80378D98; +extern f64 D_80378DA0; +extern f32 D_80378DA8; +extern f64 D_80378DC8; +extern f64 D_80378DD0; +extern f32 D_80378DD8; +extern f32 D_80378DDC; +extern f32 D_80378DE0; + +/* .code */ +void func_80323240(struct56s *arg0, f32 arg1, f32 arg2[3]){ + if(arg1 < 0.0f) + arg1 = 0.0f; + else if(1.0f < arg1) + arg1 = 1.0f; + + func_80341180(arg1, arg0->unk0, 3, arg0->unk8, arg2); +} + +f32 func_803232AC(f32 *arg0, f32 arg1, f32 arg2, s32 arg3, f32 arg4) { + f32 sp6C[3]; + f32 sp60[3]; + f32 var_f22; + f32 var_f20; + + var_f22 = 0.0f; + if ((arg2 - arg1) < D_80378D90) { + return 0.0f; + } + var_f20 = arg1; + func_80341180(var_f20, arg3, 3, arg0, &sp6C); + while(var_f20 + arg4 < arg2){ + var_f20 += arg4; + func_80341180(var_f20, arg3, 3, arg0, sp60); + var_f22 += func_80258708(sp6C, sp60); + ml_vec3f_copy(sp6C, sp60); + } + func_80341180(arg2, arg3, 3, arg0, sp60); + var_f22 += func_80258708(sp6C, sp60); + return var_f22; + +} + +#ifndef NONMATCHING //requires .rodata defined +f32 func_803233F8(struct56s *arg0); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9C170/func_803233F8.s") +#else +f32 func_803233F8(struct56s *arg0) { + f32 temp_f0; + f32 temp_f26; + f32 var_f22; + f32 var_f24; + s32 temp_s0; + f32 *var_a0; + + var_f22 = D_80378D98; + var_f24 = 0.0f; + temp_s0 = arg0->unk0; + var_a0 = arg0->unk8; + do{ + temp_f26 = var_f24; + var_f24 = func_803232AC(var_a0, 0.0f, 1.0f, temp_s0, var_f22); + var_f22 *= 0.75; + } + while((D_80378DA0 < var_f22) && (mlAbsF(var_f24 - temp_f26) > 0.5)); + arg0->unk4 = (s32) var_f24; + return var_f24; +} +#endif + +f32 func_803234FC(struct56s *arg0, f32 arg1, f32 arg2) { + s32 var_a3; + f32 *var_a0; + + var_a3 = arg0->unk0; + var_a0 = arg0->unk8; + return func_803232AC(var_a0, arg1, arg2, var_a3, D_80378DA8); +} + +f32 func_80323540(struct56s *arg0, f32 arg1, f32 arg2, f32 arg3) { + s32 var_a3; + f32 *var_a0; + f32 temp_f8; + + var_a3 = arg0->unk0; + var_a0 = arg0->unk8; + temp_f8 = (arg2 - arg1) / arg3; + return func_803232AC(var_a0, arg1, arg2, var_a3, temp_f8); +} + + +f32 func_8032358C(struct56s *arg0, f32[3]); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9C170/func_8032358C.s") + +f32 func_803237E8(struct56s *arg0); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9C170/func_803237E8.s") + +f32 func_80323A48(f32 *, s32, f32, f32, f32); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9C170/func_80323A48.s") + + +f32 func_80323F74(struct56s * arg0, f32 arg1, f32 arg2) { + s32 sp2C; + f32 *sp28; + + sp2C = arg0->unk0; + sp28 = arg0->unk8; + return func_80323A48(sp28, sp2C, arg1, time_getDelta() * arg2, func_803237E8(arg0)); +} + +f32 func_80323FDC(struct56s *arg0, f32 arg1, f32 arg2, s32 *arg3) { + f32 temp_f0; + f32 temp_f2; + + temp_f2 = func_80323F74(arg0, arg1, arg2); + *arg3 = FALSE; + if (arg2 > 0.0f) { + if (temp_f2 < arg1) { + *arg3 = TRUE; + } + } else if ((arg2 < 0.0f) && (arg1 < temp_f2)) { + *arg3 = TRUE; + } + return temp_f2; +} + +f32 func_80324078(struct56s *arg0, f32 arg1, f32 arg2) { + s32 sp24; + + sp24 = arg0->unk0; + return func_80323A48(arg0->unk8, sp24, arg1, (f32) (arg2 * D_80378DC8), func_803237E8(arg0)); +} + +f32 func_803240E0(struct56s *arg0, f32 arg1, f32 arg2, bool *arg3) { + f32 temp_f0; + f32 temp_f2; + + temp_f2 = func_80324078(arg0, arg1, arg2); + *arg3 = FALSE; + if (arg2 > 0.0f) { + if (temp_f2 < arg1) { + *arg3 = TRUE; + } + } else if ((arg2 < 0.0f) && (arg1 < temp_f2)) { + *arg3 = TRUE; + } + return temp_f2; +} + + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9C170/func_8032417C.s") +#else +extern f64 D_80378DD0; +extern f32 func_80323A48(f32 *, s32, f32, f32, f32); +void func_8032417C(struct56s *arg0, f32 arg1, f32 arg2[3], f32 arg3[3]) { + s32 sp64; + f32 sp50[3]; + f32 sp44[3]; + f32 var_f0; + + if ((arg1 + D_80378DD0) >= 1.0) { + arg1 -= D_80378DD0; + } + sp64 = arg0->unk0; + func_80341180(arg1, sp64, 3, arg0->unk8, sp50); + var_f0 = func_80323A48(arg0->unk8, sp64, arg1, 5.0f, func_803237E8(arg0)); + func_80341180(var_f0, sp64, 3, arg0->unk8, sp44); + ml_vec3f_diff_copy(arg2, sp44, sp50); + ml_vec3f_normalize(arg2); + func_8025727C(sp44[0], sp44[1], sp44[2], sp50[0], sp50[1], sp50[2], &arg3[0], &arg3[1]); + arg3[0] = mlNormalizeAngle(-arg3[0]); + arg3[2] = 0.0f; +} +#endif + +f32 func_8032429C(struct56s *this, f32 arg1[3], f32 min, f32 max, f32 step){ + f32 sp74[3]; + f32 sp68[3]; + f32 f22; + f32 f28; + f32 f20; + f32 f24; + f32 f2; + + min = max_f(0.0f, min); + max = min_f(1.0f, max); + f24 = D_80378DD8; + f28 = min; + f20 = min; + do{ + func_80323240(this, f20, sp68); + ml_vec3f_diff_copy(sp74, arg1, sp68); + f2 = sp74[0]*sp74[0] + sp74[1]*sp74[1] + sp74[2]*sp74[2]; + if(f2 < f24){ + f24 = f2; + f28 = f20; + } + + if(f20 == max) + break; + else{ + f20 += step; + if(f20 > max) + f20 = max; + } + }while(1); + return f28; +} + +#ifndef NONMATCHING //needs .rodata defined ? +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9C170/func_803243D0.s") +#else +f32 func_803243D0(struct56s *arg0, f32 arg1[3]){ + f32 sp64[3]; + f32 sp58[3]; + f32 tmp_f0; + f32 tmp_f20; + tmp_f0 = func_8032358C(arg0, arg1); + if(0.0f <= tmp_f0){ + return tmp_f0; + } + else{ + tmp_f20 = D_80378DE0; + tmp_f0 = func_8032429C(arg0, arg1, 0.0f, 1.0f, D_80378DDC); + tmp_f0 = func_8032429C(arg0, arg1, tmp_f0 - tmp_f20, tmp_f0 + tmp_f20, tmp_f20 = (tmp_f20/10.0)*2); + tmp_f0 = func_8032429C(arg0, arg1, tmp_f0 - tmp_f20, tmp_f0 + tmp_f20, tmp_f20 = (tmp_f20/10.0)*2); + tmp_f0 = func_8032429C(arg0, arg1, tmp_f0 - tmp_f20, tmp_f0 + tmp_f20, tmp_f20 = (tmp_f20/10.0)*2); + tmp_f0 = func_8032429C(arg0, arg1, tmp_f0 - tmp_f20, tmp_f0 + tmp_f20, tmp_f20 = (tmp_f20/10.0)*2); + tmp_f0 = func_8032429C(arg0, arg1, tmp_f0 - tmp_f20, tmp_f0 + tmp_f20, tmp_f20 = (tmp_f20/10.0)*2); + tmp_f20 = tmp_f0; + func_80323240(arg0, tmp_f0, sp64); + func_80323240(arg0, 1.0f, sp58); + if(ml_vec3f_distance_squared(arg1, sp64) < ml_vec3f_distance_squared(arg1, sp58)){ + return tmp_f20; + } + return 1.0f; + } +} +#endif diff --git a/src/core2/code_9D640.c b/src/core2/code_9D640.c new file mode 100644 index 00000000..74480578 --- /dev/null +++ b/src/core2/code_9D640.c @@ -0,0 +1,97 @@ +#include +#include "functions.h" +#include "variables.h" + + +typedef struct { + s16 map_id; + u8 unk2[5]; + // u8 pad6[1]; +}Struct_core2_9D640_0; + +typedef struct { + s32 unk0; + s32 unk4; +}Struct_core2_9D640_1; + +extern Struct_core2_9D640_0 D_8036E420[] = { + { MAP_1_SM_SPIRAL_MOUNTAIN, {1, 7, 6, 5, 1}}, + { MAP_2_MM_MUMBOS_MOUNTAIN, {1, 5, 6, 1, 1}}, + { MAP_7_TTC_TREASURE_TROVE_COVE, {2, 5, 6, 1, 1}}, + { MAP_26_MMM_NAPPERS_ROOM, {1, 5, 1, 1, 1}}, + { MAP_B_CC_CLANKERS_CAVERN, {1, 9, 10, 8, 1}}, + { MAP_D_BGS_BUBBLEGLOOP_SWAMP, {8, 11, 1, 1, 1}}, + { MAP_12_GV_GOBIS_VALLEY, {2, 6, 1, 1, 1}}, + { MAP_13_GV_MEMORY_GAME, {6, 1, 1, 6, 1}}, + { MAP_14_GV_SANDYBUTTS_MAZE, {6, 1, 1, 1, 1}}, + { MAP_15_GV_WATER_PYRAMID, {6, 1, 1, 1, 1}}, + { MAP_16_GV_RUBEES_CHAMBER, {6, 1, 1, 1, 1}}, + { MAP_1A_GV_INSIDE_JINXY, {6, 1, 1, 1, 1}}, + { MAP_1B_MMM_MAD_MONSTER_MANSION, {1, 7, 6, 12, 5}}, + { MAP_21_CC_WITCH_SWITCH_ROOM, {1, 9, 10, 8, 1}}, + { MAP_22_CC_INSIDE_CLANKER, {1, 9, 10, 8, 1}}, + { MAP_23_CC_GOLDFEATHER_ROOM, {1, 9, 10, 8, 1}}, + { MAP_27_FP_FREEZEEZY_PEAK, {3, 5, 3, 1, 1}}, + { MAP_31_RBB_RUSTY_BUCKET_BAY, {9, 10, 5, 6, 1}}, + { MAP_46_CCW_WINTER, {3, 1, 1, 1, 1}}, + { MAP_72_GL_BGS_LOBBY, {1, 8, 11, 3, 5}}, + { MAP_6F_GL_FP_LOBBY, {1, 3, 3, 1, 1}}, + { MAP_40_CCW_HUB, {1, 6, 5, 3, 7}}, + {0} +}; +extern Struct_core2_9D640_1 D_8036E4D8[] = { + {0X80000000, 1}, + {0X80000100, 10}, + {0X80000200, 9}, + {0X80000300, 6}, + {0X80000400, 5}, + {0X80000500, 3}, + {0X80000600, 7}, + {0X80000700, 8}, + {0X80000800, 2}, + {0X80000900, 11}, + {0X80000A00, 1}, + {0X80000B00, 1}, + {0X80000C00, 1}, + {0X80000D00, 1}, + {0X80000E00, 1}, + {0X80000F00, 1}, + 00 +}; + +s32 func_803245D0(enum map_e map_id, s32 arg1){ + s32 i; + + for(i = 0; D_8036E4D8[i].unk0; i++){ + if(D_8036E4D8[i].unk0 == (arg1 & 0x80001F00)){ + return D_8036E4D8[i].unk4; + } + } + return TRUE; +} + +s32 func_80324624(enum map_e map_id, s32 arg1){ + s32 i; + s32 sub_indx; + + sub_indx = 0; + if(arg1 & 0x0200){ sub_indx = 1; } + if(arg1 & 0x0400){ sub_indx = 2; } + if(arg1 & 0x0800){ sub_indx = 3; } + if(arg1 & 0x1000){ sub_indx = 4; } + for(i = 0; D_8036E420[i].map_id != 0; i++){ + if(map_id == D_8036E420[i].map_id){ + return D_8036E420[i].unk2[sub_indx]; + } + } + return TRUE; +} + +s32 func_803246B4(enum map_e map_id, s32 arg1){ + if(arg1 & 0x80000000){ + func_803245D0(map_id, arg1); + } + else{ + func_80324624(map_id, arg1); + } +} diff --git a/src/core2/code_9D760.c b/src/core2/code_9D760.c new file mode 100644 index 00000000..5d4becfa --- /dev/null +++ b/src/core2/code_9D760.c @@ -0,0 +1,36 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_803246F0(u8* self, s32 indx){ + self[indx - 1] = 0xff; +} + +void func_80324700(u8* self){ + u8* i_ptr; + + for(i_ptr = self; i_ptr < self + 0x10; i_ptr++){ + if(*i_ptr != 0xFF){ + func_8033A45C((i_ptr - self) + 1, *i_ptr); + } + } +} + +void func_80324770(u8* self, s32 indx, s32 value){ + self[indx - 1] = value; +} + +void func_8032477C(u8 *self){ + free(self); +} + +u8 *func_8032479C(void){ + u8 *self; + s32 i; + + self = (u8*)malloc(0x10); + for(i = 0; i < 0x10; i++){ + self[i] = 0xff; + } + return self; +} diff --git a/src/core2/code_9E370.c b/src/core2/code_9E370.c new file mode 100644 index 00000000..0ae48f4c --- /dev/null +++ b/src/core2/code_9E370.c @@ -0,0 +1,1619 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + +extern f32 func_80258708(f32[3], f32[3]); +extern void func_802D7124(Actor *, f32); +extern void func_802EE6CC(f32[3], s32[4], s32[4], s32, f32, f32, s32, s32, s32); +extern void func_8032B5C0(void); +extern void func_8033A244(f32); +extern void func_8033A410(s32); + + +void func_80328B8C(Actor * this, s32 arg1, f32 arg2, s32 arg3); +void func_8032BB88(Actor *this, s32 arg1, s32 arg2); +int actor_playerIsWithinDist(Actor *this, s32 dist); +extern void func_8033A4A0(enum asset_e mode_id, f32, f32); + +extern void func_80338338(s32, s32, s32); +extern void func_803382FC(s32); +extern void func_803382E4(s32); +extern void func_8033687C(Gfx **); +extern void func_80335D30(Gfx **); +extern void func_80344138(s32, s32, s32, f32[3], f32[3], Gfx **, Mtx **); + +/* .data */ +extern s32 D_803255FC; +extern ActorArray *D_8036E560; //actorArrayPtr +extern s32 D_8036E564; +extern s32 D_8036E568; +extern s32 D_8036E56C; +extern void *D_8036E570; +extern u8 D_8036E574; +extern u8 D_8036E578; +extern u8 D_8036E57C; +extern f32 D_8036E580; +extern f32 D_8036E58C[3]; + + +/* .rodata */ +extern f32 D_80378E50; +extern f64 D_80378E58; + +/* .bss */ +extern Actor *D_80383390; +extern s32 D_80383394; +extern Actor *D_80383398[]; //array of jiggy actor ptrs + + +//marker_getActorAndRotation +Actor * func_80325300(ActorMarker *marker,f32 rotation[3]) +{ Actor *actor = &D_8036E560->data[marker->actrArrayIdx]; + rotation[0] = actor->pitch; + rotation[1] = actor->yaw; + rotation[2] = actor->roll; + return actor; +} + +Actor *func_80325340(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + BKModelBin * model_bin = func_80330DE4(marker); + if(model_bin && func_8033A12C(model_bin)){ + if(marker->collidable) + func_80330B1C(marker); + } + return NULL; +} + +void func_803253A0(Actor *this){ + s32 pad; + BKModelBin *sp48; + bool sp44; + BKVertexList *sp40; + f32 sp34[3]; + + sp48 = func_80330B1C(this->marker); + func_80330534(this); + if(this->animctrl != NULL){ + func_8028781C(this->animctrl, this->position, 1); + } + + if(this->marker->unk20 != NULL){ + sp44 = FALSE; + if(this->unk148 != NULL){ + func_802EA1A8(&this->marker->unk20, func_8033A0D4(sp48), func_803356A0(this->unk148)); + sp44 = TRUE; + }//L8032542C + else if(this->animctrl != NULL && func_8033A0D4(sp48)){ + anim_802897D4(&this->marker->unk20, func_8033A0D4(sp48), animctrl_getAnimPtr(this->animctrl)); + sp44 = TRUE; + }//L80325474 + + if(sp44){ + func_8033A444(this->marker->unk20); + } + }//L8032548C + + if(this->alpha_124_19 < 0xFF){ + func_8033A410(this->alpha_124_19); + } + + set_model_render_mode(this->unk124_9); + if(this->marker->unk44 != 0){ + if((s32)this->marker->unk44 == 1){ + func_8033A450(D_8036E568); + } + else{ + func_8033A450(this->marker->unk44); + } + } + + if(this->unkF4_30){ + sp40 = func_80330C74(this); + if(this->unk138_29){ + sp34[0] = this->pitch; + sp34[1] = this->yaw; + sp34[2] = this->roll; + func_80333D48(sp40, this->position, sp34, this->scale, 0, func_8033A148(sp48)); + }//L80325560 + func_8033A4C0(sp40); + this->unkF4_29 = NOT(this->unkF4_29); + }//L80325594 + + if(this->unk130){ + this->unk130(this); + } + + if(this->unk148 && !this->marker->unk20){ + func_8033A238(func_803356A0(this->unk148)); + } + + func_8033056C(this); + func_8033A494(func_80330C48(this)); +} + +void func_803255FC(Actor *this) { + switch (this->unk124_5) { + default: + break; + + case 0: + if (randf() < 0.03) { + this->unk124_5 = 1; + } + break; + + case 1: + if (this->unk124_3 == 3) { + this->unk124_5 = 2; + } else { + this->unk124_3++; + } + break; + + case 2: + this->unk124_3--; + if (this->unk124_3 == 0) { + this->unk124_5 = 0; + } + break; + } + func_8033A45C(1, this->unk124_3 + 1); + func_8033A45C(2, this->unk124_3 + 1); +} + +void func_80325760(Actor *this) { + func_8033A45C(1, 4); + func_8033A45C(2, 4); +} + +void func_80325794(ActorMarker *marker){ + marker->unk14_21 = TRUE; +} + +void func_803257A4(ActorMarker *marker){ + marker->unk14_21 = TRUE; +} + +bool func_803257B4(ActorMarker *marker) { + Actor *actor; + BKModelBin *model_bin; + BKVertexList *vtx_list; + + actor = marker_getActor(marker); + if ((actor->unk174 == 0.0f) || (actor->unk178 == 0.0f)) { + model_bin = (BKModelBin *) assetcache_get(marker->modelId); + vtx_list = (BKVertexList *)((s32)model_bin + model_bin->vtx_list_offset_10); + actor->unk174 = (f32) vtx_list->unk12 * actor->scale; + actor->unk178 = (f32) vtx_list->unk16 * actor->scale; + assetcache_release(model_bin); + } + func_8033A4A0(marker->modelId, actor->unk174, actor->unk178); + return FALSE; +} + + +Actor *func_80325888(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + f32 sp3C[3]; + Actor *this; + + this = func_80325300(marker, sp3C); + func_8033A2D4(func_803253A0, this); + func_8033A2E8(func_80325794, marker); + func_803391A4(gfx, mtx, this->position, sp3C, this->scale, (this->unk104 != NULL) ? &D_8036E580 : NULL, func_803257B4(marker)); + return this; +} + +Actor *func_80325934(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *this; + f32 scale[3]; + BKSpriteDisplayData *sp3C; + + this = marker_getActor(marker); + sp3C = func_80330F30(marker); + scale[0] = scale[1] = scale[2] = this->scale; + if (this->unk104 != NULL) { + this->position[0] -= D_8036E58C[0]; + this->position[1] -= D_8036E58C[1]; + this->position[2] -= D_8036E58C[2]; + } + func_80338338(0xFF, 0xFF, 0xFF); + if (this->unk124_11 != 0) { + func_803382FC(this->alpha_124_19); + func_803382E4(0xC); + } else if (func_80344C20(sp3C) & 0xB00) { + func_803382E4(0xB); + } else { + func_803382E4(0xE); + } + func_80344C38(&func_803257A4, marker); + func_80335D30(gfx); + func_80344138(sp3C, marker->propPtr->unk8_15, marker->propPtr->unk8_5, this->position, scale, gfx, mtx); + func_8033687C(gfx); + if (this->unk104 != NULL) { + this->position[0] = this->position[0] + D_8036E58C[0]; + this->position[1] = this->position[1] + D_8036E58C[1]; + this->position[2] = this->position[2] + D_8036E58C[2]; + } + return this; +} + +Actor *func_80325AE0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + f32 scale[3]; + f32 rotation[3]; + Actor *this; + s32 sp40; + + this = marker_getActor(marker); + sp40 = func_80330F30(marker); + scale[0] = scale[1] = scale[2] = this->scale; + rotation[0] = this->pitch; + rotation[1] = this->yaw; + rotation[2] = this->roll; + if (this->unk104 != NULL) { + this->position[0] -= D_8036E58C[0]; + this->position[1] -= D_8036E58C[1]; + this->position[2] -= D_8036E58C[2]; + } + func_80338338(0xFF, 0xFF, 0xFF); + if (this->unk124_11 != 0) { + func_803382FC(this->alpha_124_19); + func_803382E4(0xC); + } else if (func_80344C20(sp40) & 0xB00) { + func_803382E4(0xB); + } else { + func_803382E4(0xE); + } + func_80344C38(&func_803257A4, marker); + func_80335D30(gfx); + func_80344720(sp40, marker->propPtr->unk8_15, marker->propPtr->unk8_5, this->position, rotation, &scale, gfx, mtx); + func_8033687C(gfx); + if (this->unk104 != NULL) { + this->position[0] = this->position[0] + D_8036E58C[0]; + this->position[1] = this->position[1] + D_8036E58C[1]; + this->position[2] = this->position[2] + D_8036E58C[2]; + } + return this; +} + +Actor *func_80325CAC(ActorMarker *marker, Gfx **gfx, Gfx **mtx, Vtx **vtx) { + f32 scale[3]; + f32 rotation[3]; + Actor *this; + s32 sp40; + + this = marker_getActor(marker); + sp40 = func_80330F30(marker); + scale[0] = scale[1] = scale[2] = this->scale; + if (this->unk104 != NULL) { + this->position[0] -= D_8036E58C[0]; + this->position[1] -= D_8036E58C[1]; + this->position[2] -= D_8036E58C[2]; + } + func_8024C764(rotation); + rotation[2] += this->roll; + func_80338338(0xFF, 0xFF, 0xFF); + if (this->unk124_11 != 0) { + func_803382FC(this->alpha_124_19); + func_803382E4(0xC); + } else if ((func_80344C20(sp40) & 0xB00) != 0) { + func_803382E4(0xB); + } else { + func_803382E4(0xE); + } + func_80344C38(&func_803257A4, marker); + func_80335D30(gfx); + func_80344720(sp40, marker->propPtr->unk8_15, marker->propPtr->unk8_5, this->position, rotation, scale, gfx, mtx); + + func_8033687C(gfx); + if (this->unk104 != NULL) { + this->position[0] = this->position[0] + D_8036E58C[0]; + this->position[1] = this->position[1] + D_8036E58C[1]; + this->position[2] = this->position[2] + D_8036E58C[2]; + } + return this; +} + +Actor *func_80325E78(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + f32 rotation[3]; + Actor *this; + + this = func_80325300(marker, rotation); + set_model_render_mode(1); + func_8033A2D4(func_803253A0, this); + func_8033A2E8(func_80325794, marker); + func_803391A4(gfx, mtx, this->position, rotation, this->scale, (this->unk104 != NULL) ? &D_8036E580 : NULL, func_803257B4(marker)); + return this; +} + +Actor *func_80325F2C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + func_8033A244(30000.0f); + func_8033A280(2.0f); + return func_80325E78(marker, gfx, mtx, vtx); +} + +void func_80325F84(Actor *this){} + +void func_80325F8C(void) { + D_8036E560 = NULL; + D_8036E568 = func_8034A2C8(); + D_8036E56C = func_802EE5E0(0x10); + D_8036E570 = func_802F2AEC(); + D_8036E574 = 0; + D_8036E578 = 0; + D_8036E57C = 0; +} + +void func_80325FE8(Actor *this) { + ActorMarker *marker; + u8 temp_v0; + + marker = this->marker; + marker->unk14_20 = 0; + if (this->animctrl != NULL) { + animctrl_free(this->animctrl); + } + temp_v0 = this->unk44_31; + if (temp_v0 != 0) { + func_8030DA44(temp_v0); + } + this->animctrl = NULL; + this->unk44_31 = 0; + + if (this->unk138_7 != 0) { + func_8032BB88(this, -1, 8000); + this->unk138_7 = 0; + } + if (marker->unk30 != NULL) { + marker->unk30(this); + marker->unk30 = NULL; + } + if ((s32)marker->unk44 < 0) { + func_8033E7CC(marker); + func_8034A2A8(marker->unk44); + marker->unk44 = 0; + } + if (marker->unk4C != 0) { + func_8034BF54(this->marker); + marker->unk4C = 0; + } + if (marker->unk48 != 0) { + func_8033F784(marker); + marker->unk48 = 0; + } + if (this->unk148 != NULL) { + func_80335874(this->unk148); + this->unk148 = NULL; + } + if (marker->unk50 != 0) { + func_80340690(marker->unk50); + marker->unk50 = 0; + } + func_8032ACA8(this); +} + +//actorArray_free() +void func_80326124(void) { + Actor *var_s0; + + if (D_8036E560 != NULL) { + for(var_s0 = D_8036E560->data; var_s0 < &D_8036E560->data[D_8036E560->cnt]; var_s0++){ + func_80325FE8(var_s0); + if (var_s0->marker != NULL) { + marker_free(var_s0->marker); + } + var_s0->marker = NULL; + } + free(D_8036E560); + D_8036E560 = NULL; + } + func_8034A2A8(D_8036E568); + D_8036E568 = NULL; + func_802EE5E8(D_8036E56C); + D_8036E56C = NULL; + func_802F2C78(D_8036E570); + D_8036E570 = NULL; +} + +s32 func_80326218(void){ + return D_8036E564; +} + +void func_80326224(Actor *this){ + func_80343DEC(this); +} + +void func_80326244(Actor *this){ + actor_collisionOff(this); + this->marker->unk2C_1 = 1; + func_80343DEC(this); +} + +s32 func_8032627C(Actor *this){ + return this->alpha_124_19; +} + +void actor_setOpacity(Actor *this, s32 alpha){ + this->unk124_11 = 3; //blend mode? + this->alpha_124_19 = alpha; +} + +void func_803262B8(Actor *this){ + this->unk124_11 = 0; + this->alpha_124_19 = 0xff; +} + +void func_803262E4(Actor *this){ + this->alpha_124_19 = 0; + this->unk124_11 = 1; +} + +void func_80326310(Actor *this){ + this->unk124_11 = 2; +} + +void func_80326324(Actor *this) { + if (this->marker->unk2C_2) { + this->unk1C[1] += time_getDelta(); + if (this->unk1C[0] < this->unk1C[1]) { + this->unk1C[1] = this->unk1C[0]; + } + switch (this->unk124_11) { /* switch 1; irregular */ + case 1: /* switch 1 */ + this->alpha_124_19 = (this->unk1C[0] != 0.0f) ? (s32)(255.0f *(this->unk1C[1] / this->unk1C[0])) : 0xFF; + if (255.0 == this->alpha_124_19) { + this->unk124_11 = 0; + } + break; + + case 2: /* switch 1 */ + this->alpha_124_19 = (this->unk1C[0] != 0.0f) ? (0xFF - (s32) ((this->unk1C[1] / this->unk1C[0]) * 255.0f)) : 0; + if (this->alpha_124_19 == 0) { + this->unk124_11 = 0; + } + break; + } + } else { + switch (this->unk124_11) { /* irregular */ + case 1: + this->alpha_124_19 = MIN(255.0,this->alpha_124_19 + 7.0); + if (255.0 == this->alpha_124_19) { + this->unk124_11 = 0; + } + break; + + case 2: + this->alpha_124_19 = MAX(0.0, this->alpha_124_19 - 7.0); + if (this->alpha_124_19 == 0) { + marker_despawn(this->marker); + } + break; + } + } +} + +void func_80326894(Actor *this){ + func_80326324(this); +} + +void func_803268B4(void) { + s32 temp_v1; + Actor *actor; + ActorMarker *marker; + AnimCtrl *anim_ctrl; + ActorInfo *actor_info; + s32 position[3]; + s32 rotation[3]; + BKVertexList *temp_v0_3; + bool sp54; + s32 temp_s1; + + + if (D_8036E560 != NULL) { + sp54 = func_803203FC(101); + for(temp_v1 = D_8036E560->cnt - 1; temp_v1 >= 0; temp_v1--){ + actor = &D_8036E560->data[temp_v1]; + actor_info = actor->actor_info; + marker = actor->marker; + anim_ctrl = actor->animctrl; + temp_s1 = actor->actor_info->unk18; + if (marker->propPtr->unk8_4) { + if(sp54){ + if ( actor->actor_info->unk20 && func_803203FC( actor->actor_info->unk20)) { + marker_despawn(marker); + } + } + if (!actor->despawn_flag) { + if (marker->unk2C_2) { + ((void (*)(Actor *)) marker->unk34)(actor); + if (anim_ctrl != NULL) { + actor->sound_timer = animctrl_getAnimTimer(anim_ctrl); + } + } else if (!temp_s1 || (temp_s1 && func_803296D8(actor, temp_s1))) { + if ( marker->unk24 != NULL) { + marker->unk24(actor); + if (anim_ctrl != NULL) { + actor->sound_timer = animctrl_getAnimTimer(anim_ctrl); + } + } + } + actor->unk124_7 = TRUE; + actor->unk138_28 = FALSE; + if (anim_ctrl != NULL) { + animctrl_update(anim_ctrl); + } + if (marker->unk4C) { + temp_v0_3 = func_80330C74(actor); + if (temp_v0_3) { + func_8033F7A4(marker, temp_v0_3); + func_8034C21C(marker); + } + } + position[0] = (s32) actor->position[0]; + position[1] = (s32) actor->position[1]; + position[2] = (s32) actor->position[2]; + rotation[0] = (s32) actor->pitch; + rotation[1] = (s32) actor->yaw; + rotation[2] = (s32) actor->roll; + func_8032F6A4(position, marker, rotation); + if (actor->unk124_11) { + func_80326324(actor); + } + if (actor->unk148) { + if (!actor->despawn_flag) { + func_80335A94(actor->unk148, time_getDelta(), marker->unk14_21); + } else { + func_80335924(actor->unk148, 0, 0.0f, 0.0f); + } + } + if ((actor_info->shadow_scale != 0.0f) && actor->unk124_6 && marker->unk14_21) { + func_802D7124(actor, actor_info->shadow_scale); + } + if (actor->unk10_0) { + actor = &D_8036E560->data[temp_v1]; + func_802C96E4(actor); + } + } + } + } + } + if (D_8036E56C != 0) { + func_802EE5F0(D_8036E56C); + } + if (D_8036E570 != 0) { + func_802F2D8C(D_8036E570); + } +} + +s32 func_80326C18(void){ + return D_80383394; +} + +void func_80326C24(s32 arg0){ + D_80383394 = arg0; +} + +Actor *func_80326C30(enum asset_e model_id) { + Actor *actor_begin; + Actor *i_actor; + + actor_begin = D_8036E560->data; + for(i_actor = actor_begin; (i_actor - actor_begin) < D_8036E560->cnt; i_actor++){ + if ((model_id == i_actor->marker->modelId) && !i_actor->despawn_flag) { + return i_actor; + } + } + return NULL; +} + +Actor *func_80326CCC(s32 arg0) { + Actor *actor_begin; + Actor *i_actor; + + actor_begin = D_8036E560->data; + for(i_actor = actor_begin; i_actor - actor_begin < D_8036E560->cnt; i_actor++) { + if ((arg0 == i_actor->marker->unk14_20) && !i_actor->despawn_flag) { + return i_actor; + } + } + return NULL; +} + +/* + * find the closest actor to position with actor_id and not in state + * returns Actor* and distance (last arg) + */ +Actor *func_80326D68(f32 position[3], enum actor_e actor_id, s32 arg2, f32 *min_distance_ptr) { + Actor *begin; + Actor *i_actor; + f32 i_dist; + f32 min_dist; + s32 *closest_actor; + + if (D_8036E560 != NULL) { + begin = D_8036E560->data; + closest_actor = NULL; + min_dist = D_80378E50; + for(i_actor = begin; (i_actor - begin) < D_8036E560->cnt; i_actor++){ + if ( ((actor_id == i_actor->modelCacheIndex) || (actor_id < 0)) + && (arg2 != i_actor->state) + && (i_actor->modelCacheIndex != ACTOR_17_PLAYER_SHADOW) + && (i_actor->modelCacheIndex != 0x108) + && !i_actor->despawn_flag + ) { + i_dist = func_80258708(position, i_actor->position); + if (i_dist < min_dist) { + min_dist = i_dist; + closest_actor = i_actor; + } + } + } + if (min_distance_ptr != NULL) { + *min_distance_ptr = min_dist; + } + return closest_actor; + } + return NULL; +} + +Actor *func_80326EEC(enum actor_e actor_id) { + Actor *begin; + Actor *end; + Actor *i_actor; + + begin = D_8036E560->data; + end = begin + D_8036E560->cnt; + for(i_actor = begin; i_actor < end; i_actor++){ + if ((actor_id == i_actor->modelCacheIndex) && !i_actor->despawn_flag) { + return i_actor; + } + } + return NULL; +} + +s32 func_80326F58(enum actor_e actor_id) { + Actor *begin; + Actor *end; + Actor *i_actor; + s32 var_v1; + + var_v1 = 0; + begin = D_8036E560->data; + end = begin + D_8036E560->cnt; + for(i_actor = begin; i_actor < end; i_actor++){ + if ((actor_id == i_actor->modelCacheIndex) && !i_actor->despawn_flag) { + var_v1 += 1; + } + } + return var_v1; +} + +Actor **func_80326FC0(void) { + Actor *begin; + Actor *i_actor; + + s32 var_a1; + + begin = D_8036E560->data; + for(i_actor = begin, var_a1 = 0; (D_8036E560 != NULL) && ((i_actor - begin) < D_8036E560->cnt); i_actor++){ + if ((i_actor->modelCacheIndex == ACTOR_46_JIGGY) && !i_actor->despawn_flag) { + D_80383398[var_a1] = i_actor; + var_a1 += 1; + } + } + D_80383398[var_a1] = NULL; + return D_80383398; +} + + + +void func_803270B8(f32 arg0[3], f32 arg1, s32 arg2, int (*arg3)(Actor *), ActorMarker *); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_803270B8.s") + +void func_8032728C(f32 arg0[3], f32 arg1, s32 arg2, int (*arg3)(Actor *)){ + func_803270B8(arg0, arg1, arg2, arg3, _player_getMarker()); +} + +void func_803272D0(f32 arg0[3], f32 arg1, s32 arg2, int (*arg3)(Actor *)){ + func_803270B8(arg0, arg1, arg2, arg3, NULL); +} + +Actor *actor_new(s32 (* position)[3], s32 yaw, ActorInfo* actorInfo, u32 flags){ + ActorAnimationInfo * sp54; + s32 i; + f32 sp44[3]; + + if(D_8036E560 == NULL){ + D_8036E560 = (ActorArray *)malloc(sizeof(ActorArray) + 20*sizeof(Actor)); + D_8036E560->cnt = 0; + D_8036E560->max_cnt = 20; + } + //i = D_8036E560->cnt + 1; + if(D_8036E560->cnt + 1 > D_8036E560->max_cnt){ + D_8036E560->max_cnt = D_8036E560->cnt + 5; + D_8036E560 = (ActorArray *)realloc(D_8036E560, sizeof(ActorArray) + D_8036E560->max_cnt*sizeof(Actor)); + } + ++D_8036E560->cnt; + D_80383390 = &D_8036E560->data[D_8036E560->cnt - 1]; + D_80383390->actor_info = actorInfo; + D_80383390->unk10_25 = 0; + D_80383390->unk10_18 = 0; + D_80383390->state = actorInfo->startAnimation; + D_80383390->position_x = (f32)(*position)[0]; + D_80383390->position_y = (f32)(*position)[1]; + D_80383390->position_z = (f32)(*position)[2]; + D_80383390->unkF4_8 = 0; + D_80383390->yaw = (f32) yaw; + D_80383390->yaw_moving = (f32) yaw; + D_80383390->pitch = 0.0f; + D_80383390->roll = 0.0f; + D_80383390->unk6C = 0.0f; + D_80383390->unk28 = 0.0f; + D_80383390->unk10_12 = 0; + D_80383390->unk38_0 = 0; + D_80383390->unk38_31 = 0; + D_80383390->unk58_0 = 1; + D_80383390->unk40 = 0; + D_80383390->unk44_31 = 0; + D_80383390->despawn_flag = 0; + D_80383390->unk44_14 = -1; + D_80383390->unk48 = 0.0f; + D_80383390->unk4C = 100.0f; + D_80383390->unk10_1 = 1; + D_80383390->unkF4_30 = 0; + D_80383390->unkF4_29 = 0; + D_80383390->scale = 1.0f; + D_80383390->unk124_7 = 0; + D_80383390->unk124_6 = 1; + D_80383390->modelCacheIndex = actorInfo->actorId; + D_80383390->unk44_2 = func_80326C18(); + D_80383390->marker = func_8032F9DC(position, actorInfo->draw_func, (func_8033B64C(actorInfo->modelId) == 1) ? 0 : 1, actorInfo->markerId, (flags & 0x400) ? 1 : 0); + D_80383390->marker->unk3E_0 = 1; + D_80383390->unk138_28 = 1; + D_80383390->unk10_3 = -1; + D_80383390->unk10_4 = 0; + D_80383390->unk10_8 = 0; + D_80383390->unk10_7 = 0; + D_80383390->unk10_6 = 0; + D_80383390->unk54 = 0.0f; + D_80383390->unk58_31 = 0; + D_80383390->unk5C = 0.0f; + D_80383390->unkF4_31 = 0; + D_80383390->unk138_30 = 0; + D_80383390->unk138_3 = 0; + D_80383390->unk38_21 = 0; + D_80383390->unk38_13 = 0; + D_80383390->unk78_22 = 0; + D_80383390->unk78_31 = 0; + D_80383390->unk74 = 0.0f; + D_80383390->unk70 = 0.0f; + D_80383390->unkF4_24 = 0; + D_80383390->unk140 = 0.0f; + D_80383390->unk144 = 0.0f; + D_80383390->unk44_1 = 0; + D_80383390->unk44_0 = 0; + D_80383390->initialized = FALSE; + D_80383390->unk16C_4 = 0; + D_80383390->unk60 = 0.0f; + D_80383390->unk10_0 = 0; + D_80383390->unk104 = NULL; + D_80383390->unk100 = NULL; + D_80383390->unk158[0] = NULL; + D_80383390->unk158[1] = NULL; + D_80383390->unk78_13 = 0; + D_80383390->unk124_31 = 0; + D_80383390->unkF4_20 = 0; + D_80383390->sound_timer = 0.0f; + func_8032FFD4(D_80383390->marker, D_8036E560->cnt - 1); + marker_setModelId(D_80383390->marker, actorInfo->modelId); + func_803300C8(D_80383390->marker, actorInfo->update_func); + func_803300D0(D_80383390->marker, actorInfo->unk10); + ml_vec3f_clear(D_80383390->unk1C); + ml_vec3f_clear(D_80383390->velocity); + ml_vec3f_clear(D_80383390->spawn_position); + D_80383390->stored_animctrl_index = 0; + D_80383390->unk58_2 = 1; + D_80383390->stored_animctrl_playbackType_ = 0; + D_80383390->stored_animctrl_forwards = 0; + D_80383390->stored_animctrl_smoothTransistion = 0; + D_80383390->stored_animctrl_duration = 0.0f; + D_80383390->unkEC = 0.0f; + D_80383390->unk138_19 = 0; + D_80383390->stored_animctrl_subrangeMin = 0.0f; + D_80383390->stored_animctrl_subrangeMax = 1.0f; + D_80383390->unkF4_22 = 0; + D_80383390->unk58_1 = 0; + D_80383390->unk138_29 = 0; + D_80383390->unk18 = actorInfo->animations; + D_80383390->animctrl = NULL; + D_80383390->unkEC = 0.0f; + D_80383390->unk130 = 0; + D_80383390->unk124_5 = 0; + D_80383390->unk124_3 = 0; + D_80383390->unk138_9 = 0; + D_80383390->unk138_8 = 0; + D_80383390->unk138_25 = 0; + D_80383390->unk16C_3 = 0; + D_80383390->unk16C_2 = 0; + D_80383390->unk16C_1 = 0; + D_80383390->unk16C_0 = 0; + D_80383390->unk17C_31 = 0; + D_80383390->unk14C[0] = NULL; + D_80383390->unk14C[1] = NULL; + D_80383390->unk138_27 = 0; + D_80383390->unk138_24 = 0; + D_80383390->unk138_23 = 0; + D_80383390->unk138_22 = 0; + D_80383390->unk138_21 = 0; + D_80383390->unk138_20 = 0; + D_80383390->unk174 = 0.0f; + D_80383390->unk178 = 0.0f; + if( actorInfo->animations){ + sp54 = &D_80383390->unk18[D_80383390->state]; + if(sp54->index != 0){ + D_80383390->animctrl = animctrl_new(0); + animctrl_reset(D_80383390->animctrl); + animctrl_setIndex(D_80383390->animctrl, sp54->index); + animctrl_setDuration(D_80383390->animctrl, sp54->duration); + func_802875AC(D_80383390->animctrl, "subaddie.c", 0x4A5); + } + }//L80327BA8 + D_80383390->unk124_11 = 0; + D_80383390->alpha_124_19 = 0xff; + D_80383390->unk124_9 = 1; + D_80383390->unk124_0 = D_80383390->unk138_31 = 1; + for(i = 0; i < 0x10; i++){ + ((s32 *)D_80383390->unk7C)[i] = 0; + } + for(i = 0; i < 0x0C; i++){ + ((s32 *)D_80383390->unkBC)[i] = 0; + } + if(flags & 1){ + D_80383390->unk10_25 = func_80306DDC(position) + 1; + if(D_80383390->unk10_25 == 0){ + D_80383390->unk10_25 = 0; + }else{ + sp44[0] = (f32)(*position)[0]; + sp44[1] = (f32)(*position)[1]; + sp44[2] = (f32)(*position)[2]; + D_80383390->unk10_18 = func_80307258(&sp44, D_80383390->unk10_25 - 1, 0) + 1; + } + }//L80327D30 + + if(flags & 4){ + D_80383390->unk10_1 = 0; + } + + if(flags & 8){ + D_80383390->unkF4_30 = 1; + } + + if(flags & 2){ + D_80383390->marker->unk44 = 1; + } + else if(flags & 0x40){ + D_80383390->marker->unk44 = func_8034A2C8(); + } + + if(flags & 0x1000){ + func_8033F738(D_80383390->marker); + func_8034BFF8(D_80383390->marker); + } + + D_80383390->unk148 = 0; + if(flags & 0x800){ + D_80383390->unk148 = func_803358B4(); + } + + if(flags & 0x4000){ + D_80383390->marker->unk50 = func_803406B0(); + } + + if(flags & 0x10){ + D_80383390->unk124_31 = -1; + } + + if(flags & 0x80){ + D_80383390->unkF4_22 = 1; + } + + if(flags & 0x80000){ + D_80383390->unk58_1 = 1; + } + + if(flags & 0x100){ + D_80383390->unk130 = &D_803255FC; + } + + if(flags & 0x200){ + D_80383390->marker->unk40_21 = 1; + } + + if(flags & 0x8000){ + D_80383390->marker->unk40_20 = 1; + } + + if(flags & 0x20000){ + D_80383390->marker->unk40_22 = 1; + } + + if(flags & 0x400000){ + D_80383390->marker->unk40_19 = 1; + } + + if(flags & 0x10000){ + D_80383390->unk138_9 = 1; + } + + if(flags & 0x40000){ + D_80383390->unk138_8 = 1; + } + + if(flags & 0x200000){ + D_80383390->unk138_25 = 1; + } + + if(flags & 0x800000){ + D_80383390->unk16C_3 = 1; + } + + if(flags & 0x1000000){ + D_80383390->unk16C_2 = 1; + } + + if(flags & 0x2000000){ + D_80383390->unk16C_1 = 1; + } + + if(flags & 0x4000000){ + D_80383390->unk17C_31 = 1; + } + + if(flags & 0x2000){ + D_80383390->unk138_29 = 1; + } + + if(flags & 0x100000){ + D_80383390->unk58_2 = 0; + } + + D_80383390->unk154 = 0x005e0000; + D_80383390->marker->unk54 = func_8032B5C0; + + + for(i = 0; i < 3; ++i){ + D_80383390->unk164[i] = 0x63; + } + + D_80383390->unk170 = -10.0f; + D_80383390->unk138_7 = 0; + D_80383390->unk3C = flags; + return D_80383390; +} + +static void __actor_free(ActorMarker *arg0, Actor *arg1){ + s32 arrayEnd; + + //copy last actor over actor to delete + arrayEnd = &D_8036E560->data[D_8036E560->cnt - 1]; + func_80325FE8(arg1); + if((s32)arg1 != arrayEnd) + memcpy(arg1, arrayEnd, 0x180); //memcpy + arg1->marker->actrArrayIdx = arg0->actrArrayIdx; + + //remove last actor from actor array + D_8036E560->cnt--; + + //shrink actor array capacity + if(D_8036E560->cnt + 8 <= D_8036E560->max_cnt){ + D_8036E560->max_cnt = D_8036E560->cnt + 4; + D_8036E560 = (ActorArray *)realloc(D_8036E560, D_8036E560->max_cnt*sizeof(Actor) + sizeof(ActorArray)); + } + + marker_free(arg0); +} + +Actor *func_8032811C(enum actor_e id, s32 (* pos)[3], s32 rot){ + return func_803056FC(id, pos, rot); +} + +Actor *func_8032813C(enum actor_e id, f32 pos[3], s32 rot){ + s32 sp24[3]; + int i; + for(i = 0; i< 3; i++){ + sp24[i] = pos[i]; + } + func_803056FC(id, &sp24, rot); +} + +Actor * spawn_child_actor(enum actor_e id, Actor ** parent){ + Actor *child; + ActorMarker * sp28 = (*parent)->marker; + s32 sp1C[3]; + sp1C[0] = (*parent)->position_x; + sp1C[1] = (*parent)->position_y; + sp1C[2] = (*parent)->position_z; + child = func_803056FC(id, sp1C, (*parent)->yaw); + *parent = marker_getActor(sp28); + return child; +} + +Actor *func_80328230(enum actor_e id, f32 pos[3], f32 rot[3]){ + int i; + s32 sp30[3]; + Actor *actor; + + for(i = 0; i < 3; i++){ + sp30[i] = (s32)pos[i]; + } + actor = func_803055E0(id, sp30, (f32) rot[1], 0, 0); + actor->pitch = rot[0]; + return actor; +} + +Actor *func_803282AC(enum actor_e id, s16 (* pos)[3], s32 yaw){ + s32 sp24[3]; + int i; + for(i = 0; i< 3; i++){ + sp24[i] = (*pos)[i]; + } + return func_803056FC(id, &sp24, yaw); +} + +void marker_despawn(ActorMarker *marker){ + Actor * actor = marker_getActor(marker); + if(D_8036E574){ + actor->despawn_flag = 1; + D_8036E578++; + if(actor->unk104 && actor->modelCacheIndex != 0x108){ + marker_getActor(actor->unk104)->despawn_flag = 1; + marker_getActor(actor->unk104)->unk104 = NULL; + D_8036E578++; + actor->unk104 = NULL; + } + } + else{ + __actor_free(marker, actor); + } +} + +void func_803283BC(void){ + D_8036E574 = 1; + D_8036E578 = 0; +} + +//actorArray_flushDespawns +void func_803283D4(void){ + int i; + Actor *iPtr; + if(D_8036E574){ + if(D_8036E578) + for(i = D_8036E560->cnt-1; i >= 0 ; i--){ + iPtr = &D_8036E560->data[i]; + if(iPtr->despawn_flag) + __actor_free(iPtr->marker, iPtr); + } + } + D_8036E574 = 0; + D_8036E578 = 0; + +} + + +void func_80328478(f32 arg0[3], f32 arg1, f32 arg2){ + f32 sp1C[3]; + sp1C[0] = arg2; + sp1C[1] = 0.0f; + sp1C[2] = 0.0f; + ml_vec3f_yaw_rotate_copy(sp1C, sp1C, arg1 - D_80378E58); + + arg0[0] += sp1C[0]; + arg0[1] += sp1C[1]; + arg0[2] += sp1C[2]; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80328508.s") +#else +int func_80328508(Actor * arg0, u32 arg1){ + ActorAnimationInfo *animInfo; + + arg0->state = arg1; + if(!arg0->unk18) + return 0; + else{ + animInfo = &arg0->unk18[arg1]; + if(animInfo->index){ + if(!arg0->animctrl){ + arg0->animctrl = animctrl_new(0); + animctrl_reset(arg0->animctrl); + } + animctrl_setIndex(arg0->animctrl, animInfo->index); + animctrl_setDuration(arg0->animctrl, animInfo->duration); + animctrl_setDirection(arg0->animctrl, mvmt_dir_forwards); + } + else { + if(arg0->animctrl){ + animctrl_setPlaybackType(arg0->animctrl, ANIMCTRL_STOPPED); + animctrl_setDirection(arg0->animctrl, mvmt_dir_forwards); + } + } + return 1; + } +} +#endif + +void func_803285E8(Actor *this, f32 arg1, int direction){ + func_8028774C(this->animctrl, arg1); + if(direction != -1){ + animctrl_setDirection(this->animctrl, direction); + } + this->sound_timer = arg1; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032863C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80328748.s") + +int func_8032881C(Actor *this){ + if(this->animctrl){ + if(animctrl_getPlaybackType(this->animctrl) == ANIMCTRL_ONCE){ + return animctrl_isStopped(this->animctrl); + } + } + return 0; +} + +int actor_animationIsAt(Actor *this, f32 arg1){ + f32 f2 = animctrl_getAnimTimer(this->animctrl); + if(f2 == this->sound_timer){ + return 0; + } + else { + if(animctrl_isPlayedForwards(this->animctrl)){ + if(this->sound_timer < f2){ + return this->sound_timer <= arg1 && arg1 < f2; + } + else{//L8032892C + return this->sound_timer <= arg1 || arg1 < f2; + } + } + else{ + if(f2 < this->sound_timer){ + return arg1 <= this->sound_timer && f2 < arg1; + } + else{//L8032892C + return arg1 <= this->sound_timer || f2 < arg1; + } + } + } +} + +void func_803289EC(Actor *this , f32 arg1, int direction){ + func_803285E8(this, arg1, direction); + func_802875AC(this->animctrl, "subaddie.c", 0x6b1); +} + +int func_80328A2C(Actor *this, f32 arg1, s32 direction, f32 probability){ + if(randf() < probability){ + func_803289EC(this, arg1, direction); + return 1; + } + else{ + return 0; + } +} + +void func_80328A84(Actor * arg0, u32 arg1){ + if(func_80328508(arg0, arg1) && arg0->animctrl){ + func_802875AC(arg0->animctrl, "subaddie.c", 0X6CA); + } +} + +void func_80328AC8(Actor * arg0, s32 arg1){ + func_80328B8C(arg0, arg1, 0.0f, 1); +} + +void func_80328AEC(Actor * arg0, u32 arg1){ + if(func_80328508(arg0, arg1) && arg0->animctrl){ + animctrl_setPlaybackType(arg0->animctrl, ANIMCTRL_LOOP); + func_803289EC(arg0, 0.0f, 1); + } +} + +/* actor - maybe plays actor's animation with set probability */ +int func_80328B38(Actor *this, s32 myAnimId, f32 chance){ + if(randf() < chance){ + func_80328A84(this, myAnimId); + return 1; + } + return 0; +} + +void func_80328B8C(Actor * this, s32 myAnimId, f32 arg2, s32 direction){ + if(func_80328508(this, myAnimId) && this->animctrl) + func_803289EC(this, arg2, direction); +} + +int func_80328BD4(Actor * this, s32 myAnimId, f32 arg2, s32 arg3, f32 arg4){ + if(randf() < arg4){ + if(func_80328508(this, myAnimId) && this->animctrl){ + func_803285E8(this, arg2, arg3); + func_802875AC(this->animctrl, "subaddie.c", 0x705); + } + return 1; + } + return 0; +} + +void func_80328C64(Actor * this, int arg1){ + int retVal = arg1; + while(retVal < 0) retVal += 0x168; + while(retVal >= 0x168) retVal -= 0x168; + this->yaw_moving = retVal; +} + +void func_80328CA8(Actor *arg0, s32 angle) { + s32 fixedAngle = angle; + while (fixedAngle < 0) { + fixedAngle += 360; + } + while (fixedAngle >= 360) { + fixedAngle -= 360; + } + arg0->unk6C = fixedAngle; +} + +void func_80328CEC(Actor * this, s32 arg1, s32 min, s32 max){ + f32 f12; + int abs; + f12 = (randf() - 0.5)*(max - min)*2; + abs = (0.0f <= f12) ? min : -min; + func_80328C64(this, abs + (arg1 + f12)); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80328DAC.s") + +f32 func_80328DCC(Actor *, f32, f32, s32); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80328DCC.s") + +void func_80328FB0(Actor *this, f32 arg1){ + this->yaw = func_80328DCC(this, this->yaw, this->yaw_moving, (s32)arg1); +} + +void func_80328FF0(Actor *arg0, f32 arg1) { + arg0->pitch = func_80328DCC(arg0, arg0->pitch, arg0->unk6C, (s32) arg1); +} + +int func_80329030(Actor *arg0, s32 arg1) { + return !func_8032CA80(arg0, arg1); +} + +s32 func_80329054(s32 arg0, s32 arg1) { + return !func_8032CA80(arg0, arg1 + 4); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329078.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329140.s") + +int func_80329210(Actor * arg0, f32 (* arg1)[3]){ + return arg0->unk10_25 < 1 + || func_80307258(arg1, arg0->unk10_25 - 1, arg0->unk10_18-1) != -1; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329260.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_803292E0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329354.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329384.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032944C.s") + +bool func_80329480(Actor *this){ + s32 v1; + + v1 = this->yaw - this->yaw_moving; + return ((-3 <= v1) && (v1 <= 3)); +} + +bool func_803294B4(Actor *this, s32 arg1){ + s32 v1; + + v1 = this->yaw - this->yaw_moving; + return ((-arg1 <= v1) && (v1 <= arg1)); +} + +bool func_803294F0(Actor *this, s32 arg1, s32 arg2){ + s32 v1; + + v1 = this->yaw - arg2; + return ((-arg1 <= v1) && (v1 <= arg1)); +} + +bool func_80329530(Actor *this, s32 dist){ + if( func_8028F098() + && !func_803203FC(0xBF) + && actor_playerIsWithinDist(this, dist) + ){ + return TRUE; + } + return FALSE; +} + +bool actor_playerIsWithinDist(Actor *this, s32 dist){ + f32 sp24[3]; + f32 sp18[3]; + + func_8028E964(sp24); + _player_getPosition(sp18); + sp24[1] = sp18[1]; + if( ( (this->position_x - sp24[0])*(this->position_x - sp24[0]) + + (this->position_y - sp24[1])*(this->position_y - sp24[1]) + + (this->position_z - sp24[2])*(this->position_z - sp24[2]) + ) < dist*dist + ){ + return TRUE; + } + return FALSE; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329628.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_803296B8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_803296D8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032970C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329784.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_803297C8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_803297FC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329878.s") + +void actor_playAnimationOnce(Actor *this){ + if(this->animctrl) + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_ONCE); +} + +void actor_loopAnimation(Actor *this){ + if(this->animctrl) + animctrl_setPlaybackType(this->animctrl, ANIMCTRL_LOOP); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329904.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329934.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_80329940.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032994C.s") + +//marker_getActorPtr +Actor *marker_getActor(ActorMarker *this){ + return &(D_8036E560->data[this->actrArrayIdx]); +} + +//actor_getChild +Actor *func_80329980(Actor *this){ + if(this->unk100 == NULL) + return NULL; + return marker_getActor(this->unk100); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_803299B4.s") + +void func_80329B68(Actor *this){ + if(this->animctrl == NULL) + return; + + if(this->stored_animctrl_playbackType_){ + animctrl_setPlaybackType(this->animctrl, this->stored_animctrl_playbackType_); + } + animctrl_setIndex(this->animctrl, this->stored_animctrl_index); + animctrl_setDirection(this->animctrl, this->stored_animctrl_forwards); + animctrl_setSmoothTransition(this->animctrl, this->stored_animctrl_smoothTransistion); + animctrl_setDuration(this->animctrl, this->stored_animctrl_duration); + func_8028774C(this->animctrl, this->unkEC); + animctrl_setSubRange(this->animctrl, this->stored_animctrl_subrangeMin, this->stored_animctrl_subrangeMax); + func_802875AC(this->animctrl, "subaddie.c", 0x8fd); + animctrl_setTimer(this->animctrl, this->sound_timer); +} + +void actor_copy(Actor *dst, Actor *src){ + dst->marker = src->marker; + dst->animctrl = src->animctrl; + dst->unk44_14 = src->unk44_14; + dst->unk148 = src->unk148; + dst->unk14C[0] = src->unk14C[0]; + dst->unk14C[1] = src->unk14C[1]; + memcpy(src, dst, sizeof(Actor)); +} + +void *actors_appendToSavestate(void * begin, u32 end){ + void *sp3C = begin; + Actor* s0; + Actor* s1; + u32 sp30; //SavedActorDataSize + u32 sp2C; //SavedActorDataOffset + + if(D_8036E560){ + sp30 = 0; + for(s1 = D_8036E560->data; s1 < &D_8036E560->data[(u32) D_8036E560->cnt]; s1++){ + if( s1->marker + && s1->unk10_1 == 1 + && s1->despawn_flag == 0 + && s1->unk40 == 0 + ){ + sp30++; + } + } + sp2C = end - (u32)sp3C; + sp3C = realloc(sp3C, sp2C + sizeof(u32) + sp30*sizeof(Actor)); + + end = (u32)sp3C + sp2C; + *(u32 *)end = sp30; + s0 = (Actor *)((u8*)end + sizeof(u32)); + for(s1 = D_8036E560->data; s1 < &D_8036E560->data[(u32) D_8036E560->cnt]; s1++){ + if( s1->marker + && s1->unk10_1 == 1 + && s1->despawn_flag == 0 + && s1->unk40 == 0 + ){ + memcpy(s0, s1, sizeof(Actor)); + s0->unk40 = 0; + s0->unk138_28 = 1; + s0->unk14C[0] =s0->unk14C[1] = NULL; + // s0->unk14C = NULL; + s0->unk148 = NULL; + s0->unk16C_4 = 0; + s0->unk44_31 = 0; + s0->unk104 = NULL; + s0->unk100 = NULL; + s0->unk158[0] = NULL; + s0->unk158[1] = NULL; + s0->unk138_19 = s1->marker->unk14_20; + s0->unk108 = s1->marker->unkC; + s0->unk10C = s1->marker->unk10; + s0->unk134 = s1->marker->unk1C; + s0->unk160 = s1->marker->unk54; + s0->unk168 = s1->marker->unk58; + s0->unk13C = s1->marker->unk30; + s0->unk16C_31 = s1->marker->unk5C; + s0->unkF4_26 = s1->marker->unk2C_1; + s0->stored_marker_collidable = s1->marker->collidable; + s0->unkF4_28 = s1->marker->propPtr->unk8_3; + s0->unkF4_27 = s1->marker->propPtr->unk8_2; + //80329F94 + if(s0->animctrl){ + s0->stored_animctrl_index = animctrl_getIndex(s0->animctrl); + s0->stored_animctrl_playbackType_ = animctrl_getPlaybackType(s0->animctrl); + s0->stored_animctrl_forwards = animctrl_isPlayedForwards(s0->animctrl); + s0->stored_animctrl_smoothTransistion = animctrl_isSmoothTransistion(s0->animctrl); + s0->stored_animctrl_duration = animctrl_getDuration(s0->animctrl); + s0->unkEC = animctrl_getAnimTimer(s0->animctrl); + animctrl_getSubRange(s0->animctrl, &s0->stored_animctrl_subrangeMin, &s0->stored_animctrl_subrangeMax); + } + s0->animctrl = NULL; + s0->marker = NULL; + s0++; + } + } + } + return sp3C; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032A09C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032A5F8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032A6A8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032A7AC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032A82C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032A88C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032A95C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032A9E4.s") + +//actor_setScale +void func_8032AA58(Actor *this, f32 arg1){ + this->scale = arg1; + this->marker->unk14_10 = 0; +} + +void actor_collisionOff(Actor* this){ + this->marker->collidable = 0; +} + +void actor_collisionOn(Actor* this){ + this->marker->collidable = 1; +} + +void func_8032AA9C(void){ + func_802C3BDC(); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032AABC.s") +#else +void func_8032AABC(void) +{ + int i; + Actor * sp18 = (s32)D_8036E560 + sizeof(ActorArray); + s32 a2; + + func_802C3BE8(); + + + if(D_8036E560 == NULL) + return; + a2 = D_8036E560->cnt; + + for(i = 0; i != a2; i++){ + sp18->marker->unk14_21 = 0; + sp18++; + } + +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032AB84.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032ACA8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032AD7C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032AEB4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032AF94.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032B16C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032B258.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032B38C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032B3A0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032B4DC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_9E370/func_8032B5C0.s") + +void func_8032BB88(Actor *this, s32 arg1, s32 arg2){ + s32 sp1C; + + sp1C = this->unk138_7; + func_8025A4C4(arg1, arg2, &sp1C); + this->unk138_7 = sp1C; +} + +bool func_8032BBE8(Actor *this){ + if(this->unk16C_4){ + return TRUE; + } + this->unk16C_4 = TRUE; + return FALSE; +} + +void func_8032BC18(Actor *this){ + func_80287784(this->animctrl, 0); +} + +void func_8032BC3C(Actor *this, f32 arg1){ + this->unk48 = arg1; + func_80344040(this); +} + +void func_8032BC60(Actor *this, s32 arg1, f32 arg2[3]){ + func_8034A174(this->marker->unk44, arg1, arg2); +} diff --git a/src/core2/code_A4D00.c b/src/core2/code_A4D00.c new file mode 100644 index 00000000..14da77d6 --- /dev/null +++ b/src/core2/code_A4D00.c @@ -0,0 +1,1657 @@ +#include +#include "functions.h" +#include "variables.h" +#include "structs.h" + +extern f32 func_8030A590(void); +extern void func_8030A5EC(Prop *, f32); + +Prop *func_80303F7C(s32, f32, s32, s32); +s32 func_8032D9C0(Cube*, Prop*); +void func_80332B2C(ActorMarker * arg0); +s32 func_803058C0(f32); +void func_80305CD8(s32, s32); +void func_80330104(Cube*); +ActorMarker * func_80332A60(void); +extern void func_8032F3D4(s32 [3], ActorMarker *, s32); +extern void func_8030A350(Gfx **, Mtx **, Vtx **, f32[3], f32, s32, Cube*,s32 ,s32, s32, s32, s32); +extern void func_8030A2D0(Gfx **, Mtx **, Vtx **, f32[3], f32[3], f32, s32, Cube*); + +typedef union{ + struct{ + u32 pad31: 27; + u32 unk4: 1; + u32 pad3: 1; + u32 unk2: 1; + u32 unk1: 1; + u32 unk0: 1; + }; + u32 word; +} tmp_bitfield; + +s32 func_80320DB0(f32[3], f32, f32[3], u32); +extern void func_80320EB0(ActorMarker *, f32, s32); +extern void func_80320ED8(ActorMarker *, f32, s32); +f32 func_8033229C(ActorMarker *marker); +s32 func_803327A8(s32 arg0); +void func_8032CD60(Prop *); +f32 func_8033A244(f32); +void func_8032F64C(f32 *pos, ActorMarker * marker); + +/* .data */ +extern s32 D_8036E7B0; + +/* .rodata */ +extern f32 D_80378EA0; +extern f32 D_80378EA4; + +/* .bss */ +extern f32 D_803833D8[3]; +extern ModelCache *modelCache; //model pointer array pointer +extern u32 D_80383444; +extern int D_80383448; +vector(ActorMarker *) *D_80383550; +vector(ActorMarker *) *D_80383554; + +/* .code */ +bool func_8032BC90(Actor *actor, s32 arg1, s32 arg2, s32 arg3) { + f32 sp44[3]; + bool sp40; + s32 phi_v0; + f32 sp30[3]; + + sp40 = actor->marker->propPtr->unk8_3; + func_8028E964(sp30); + + actor->marker->propPtr->unk8_3 = 0; + phi_v0 = func_80320B98(&sp30, actor->position, &sp44, actor->unk154); + if (phi_v0 == 0) { + phi_v0 = func_80320DB0(actor->position, func_8033229C(actor->marker), &sp44, actor->unk154); + } + + actor->marker->propPtr->unk8_3 = sp40; + return (phi_v0)? 1 : 0; +} + +void func_8032BD64(f32 arg0[3]){ + ml_vec3f_copy(arg0, D_803833D8); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032BD88.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032C280.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032C2F0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032C404.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032C4AC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032C660.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032C6E0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032C79C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032C850.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032C99C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032C9C0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032C9E0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032CA40.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032CA80.s") + +extern int func_802E74A0(f32[3], f32, s32, s32); +extern f32 func_802EC920(BKVertexList *); +extern void func_802C39D4(void); +extern bool func_80340020(s32, f32[3], f32[3], f32, s32, BKVertexList *, f32[3], f32[3]); +extern void func_80340200(s32, f32[3], f32[3], f32, s32, s32, BKVertexList *, s32); + +extern f64 D_80378EB0; + + +extern f32 D_80383410[3]; +extern ActorMarker *D_8038341C; +extern s32 D_80383420; + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032CB50.s") +// extern s32 D_80383450[]; + +// void func_8032CB50(Cube *cube, s32 arg1) { +// s32 sp4C[3]; +// // ? *temp_a0; +// s32 temp_a1; +// s32 temp_a1_2; +// s32 temp_a2; +// s32 temp_a2_2; +// s32 temp_t6; +// s32 temp_t7; +// s32 temp_v0; +// s32 temp_v0_2; +// u32 temp_t2; +// u32 temp_t4; +// u32 temp_t5; +// void *temp_v1; +// Prop *phi_v1; +// // ? *phi_a0; +// u32 phi_t2; +// Prop *phi_a3; +// Prop *phi_t0; +// s32 *phi_a0_2; +// u32 phi_a3_2; +// Prop *phi_v1_2; +// u32 phi_a3_3; +// u32 phi_t1; +// u32 phi_a3_4; +// u32 phi_t0_2; +// s32 i; +// Prop tmp; + +// if (cube->prop2Cnt < 2U) +// return; +// if (arg1 == 0) { +// func_8024C5F0(sp4C); +// } else { +// sp4C[0] = 0; +// sp4C[1] = 0; +// sp4C[2] = 0; +// } +// phi_v1 = cube->prop2Ptr; +// phi_t2 = 0U; +// phi_t1 = cube->prop2Cnt; +// for(phi_t2 = 0; phi_t2 < cube->prop2Cnt; phi_t2++){ +// temp_v0 = cube->prop2Ptr[phi_t2].actorProp.x - sp4C[0]; +// temp_a1 = cube->prop2Ptr[phi_t2].actorProp.y - sp4C[1]; +// temp_a2 = cube->prop2Ptr[phi_t2].actorProp.z - sp4C[2]; +// D_80383450[phi_t2] = temp_v0*temp_v0 + temp_a1*temp_a1 + temp_a2*temp_a2; +// } +// phi_a3 = cube->prop2Ptr; +// phi_t0 = &cube->prop2Ptr[cube->prop2Cnt - 1]; +// do { +// phi_a3_2 = 0U; +// // phi_t0_2 = phi_t0; +// for(phi_v1_2 = phi_a3; phi_v1_2 < phi_t0; phi_v1_2++){ +// phi_a0_2 = &D_80383450[phi_v1_2 - cube->prop2Ptr]; +// temp_a1_2 = phi_a0_2[0]; +// temp_a2_2 = phi_a0_2[1]; +// // phi_a3_4 = phi_a3_2; +// // phi_a3_4 = phi_a3_2; +// if (phi_a0_2[0] < phi_a0_2[1]) { +// phi_t0 = phi_v1_2 + 1; +// if (phi_a3_2 != 0) { +// phi_t0_2 = (u32) phi_v1_2; +// } else { +// phi_a3_2 = phi_v1_2 - 1; +// if (phi_v1_2 == cube->prop2Ptr) { +// phi_a3_4 = (u32) phi_v1_2; +// } +// } +// phi_a0_2[0] = temp_a2_2; +// phi_a0_2[0] = temp_a1_2; + +// tmp = phi_v1_2[0]; +// phi_v1_2[0] = phi_v1_2[1]; +// phi_v1_2[1] = tmp; +// } +// // temp_v1 = phi_v1_2 + 0xC; +// // phi_a0_2 += 4; +// // phi_a3_2 = phi_a3_4; +// // phi_v1_2 = temp_v1; +// // phi_a3_3 = phi_a3_4; +// // phi_t0 = phi_t0_2; +// } + +// phi_a3 = phi_a3_3; +// } while (phi_a3_3 != 0); +// func_80330104(cube); +// } + + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032CD60.s") +// void func_8032CD60(Prop *prop){ +// s32 tmp_v0; +// if(prop->markerFlag){ +// tmp_v0 = func_80330F50(prop->actorProp.marker); +// } +// else{ +// tmp_v0 = func_8030A55C(prop->propProp.unk0_31); +// } + +// if(tmp_v0 == 0) return; + +// } + +void func_8032D120(Cube *cube){ + if(cube->prop2Cnt >= 2) + func_8032CB50(cube, 1); +} + +void func_8032D158(Cube *cube){ + if(cube->prop2Cnt >= 2) + func_8032CB50(cube, 0); +} + +void __marker_draw(ActorMarker *this, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *actor; + u32 draw_dist; + f32 draw_dist_f; + f32 percentage; + if(!this->unk3E_0){ + this->unk8(this, gfx, mtx, vtx); + return; + } + actor = marker_getActor(this); + func_8033A28C(actor->unk58_2); + if( actor->unk58_2 && !this->unk40_23 && !this->unk40_21 && !D_8036E7B0){ + func_8033A244(D_80378EA0); + } + + if(actor->unk124_7 && !actor->despawn_flag && actor->unk58_0){ + draw_dist = actor->actor_info->draw_distance; + if(draw_dist != 0){ + percentage = (f32)draw_dist*(1/(f64)0x400); + } + else if(this->unk40_21){ + percentage = 2.0f; + } + else{ + percentage = 1.0f; + } + func_8033A280(percentage); + this->unk8(this, gfx, mtx, vtx); + }//L8032D300 + func_8033A244(D_80378EA4); + func_8033A280(1.0f); +} + +void func_8032D330(void){ + D_80383550 = vector_new(sizeof(ActorMarker *),2); + D_80383554 = vector_new(sizeof(u32),2); +} + +void func_8032D36C(void){ + vector_free(D_80383550); + D_80383550 = NULL; + vector_free(D_80383554); + D_80383554 = NULL; +} + +void func_8032D3A8(void){ + vector_clear(D_80383550); + vector_clear(D_80383554); +} + +void func_8032D3D8(Gfx **gdl, Mtx **mptr, Vtx **vptr){ + int i; + for(i = 0; i < vector_size(D_80383550); i++){ + __marker_draw(*(u32*) vector_at(D_80383550, i), gdl, mptr, vptr); + } +} + +void func_8032D474(Gfx **gdl, Mtx **mptr, Vtx **vptr){ + int i; + for(i = 0; i < vector_size(D_80383554); i++){ + __marker_draw(*(u32*) vector_at(D_80383554, i), gdl, mptr, vptr); + } +} + +void func_8032D510(Cube *cube, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Prop *iProp; + int i; + f32 sp94[3]; + f32 sp88[3]; + tmp_bitfield tmp_v0; + int iOffset; + ActorMarker **markerPtr; + + if(cube->prop2Cnt == 0 ) return; + + func_8032CB50(cube, 0); + iOffset = 0; + for(i = 0; i < cube->prop2Cnt; i++){//L8032D5A0 + iOffset = i*0xC; + iProp = ((s32)cube->prop2Ptr + iOffset); + tmp_v0.word = *(u32 *)((s32)iProp + 0x8); + if(!tmp_v0.unk4){ + + }else{ + if(!tmp_v0.unk1){ + func_8032CD60(iProp); + } + tmp_v0.word = *(u32 *)((s32)iProp + 0x8); + if(tmp_v0.unk0){//actorProp; + if(iProp->actorProp.marker->unk40_22){ + markerPtr = (ActorMarker **)vector_pushBackNew(&D_80383550); + *markerPtr = iProp->actorProp.marker; + } + else if(iProp->actorProp.marker->unk40_19){ + markerPtr = (ActorMarker **)vector_pushBackNew(&D_80383554); + *markerPtr = iProp->actorProp.marker; + } + else{ + __marker_draw(iProp->actorProp.marker, gfx, mtx, vtx); + }//L8032D62C + } + else{//L8032D640 + sp94[0] = (f32)iProp->propProp.unk4[0]; + sp94[1] = (f32)iProp->propProp.unk4[1]; + sp94[2] = (f32)iProp->propProp.unk4[2]; + if(iProp->unk8_1){ + sp88[0] = 0.0f; + sp88[1] = (f32)((s32)iProp->propProp.unk0_15*2); + sp88[2] = (f32)((s32)iProp->propProp.unk0_7*2); + func_8030A2D0(gfx, mtx, vtx, + sp94, sp88, (f32)iProp->propProp.unkA/100.0, + iProp->propProp.unk0_31, cube + ); + } + else{//L8032D72C + func_8030A350( gfx, mtx, vtx, + sp94, (f32)iProp->spriteProp.unk0_9/100.0, iProp->spriteProp.unk0_31, cube, + iProp->spriteProp.unk0_18, iProp->spriteProp.unk0_15, iProp->spriteProp.unk0_12, + iProp->spriteProp.unk0_1, iProp->spriteProp.unk8_15 + ); + } + }//L8032D7C4 + } + iOffset+=0xC; + }//L8032D7D4 +} + +ActorProp *func_8032D80C(Cube *cube) { + ActorProp *sp1C; + + if (cube->prop2Ptr != NULL) { + cube->prop2Cnt++; + cube->prop2Ptr = realloc(cube->prop2Ptr, cube->prop2Cnt * sizeof(Prop)); + } else { + cube->prop2Cnt = 1; + cube->prop2Ptr = malloc(sizeof(Prop)); + } + sp1C = &cube->prop2Ptr[cube->prop2Cnt-1]; + sp1C->unk8_0 = FALSE; + func_80330104(cube); + return sp1C; +} + +NodeProp *func_8032D8F0(Cube *cube) { + if (cube->prop1Ptr != 0) { + cube->prop1Cnt++; + cube->prop1Ptr = realloc(cube->prop1Ptr, cube->prop1Cnt * sizeof(NodeProp)); + } else { + cube->prop1Cnt = 1; + cube->prop1Ptr = malloc(sizeof(NodeProp)); + } + return &cube->prop1Ptr[cube->prop1Cnt - 1]; +} + +//cube_removeProp +s32 func_8032D9C0(Cube *cube, Prop* prop){ + s32 sp24; + s32 tmp; + + sp24 = 0; + if(cube->prop2Cnt != 0){ + sp24 = prop->unk8_1; + if(func_80305D14()){ + func_80305CD8(func_803058C0(prop->unk4[1]), -1); + } + if((prop - cube->prop2Ptr) < (cube->prop2Cnt - 1)){ + memcpy(prop, prop + 1, (s32)(&cube->prop2Ptr[cube->prop2Cnt-1]) - (s32)(prop)); + } + cube->prop2Cnt--; + if(cube->prop2Cnt){ + cube->prop2Ptr = realloc(cube->prop2Ptr, cube->prop2Cnt*sizeof(Prop)); + func_80330104(cube); + }else{ + free(cube->prop2Ptr); + cube->prop2Ptr = NULL; + } + return sp24; + } + return 0; +} + +void func_8032DB2C(Cube *cube, NodeProp *arg1) { + s32 sp24; + + if(cube->prop1Cnt == NULL) + return; + + sp24 = arg1 - cube->prop1Ptr; + if (sp24 < cube->prop1Cnt - 1) { + memcpy(arg1, arg1 + 1, (s32)&cube->prop1Ptr[cube->prop1Cnt] - (s32)arg1 - sizeof(NodeProp)); + } + if (sp24 < cube->unk0_4) { + cube->unk0_4--; + } + + cube->prop1Cnt--; + if (cube->prop1Cnt != 0) { + cube->prop1Ptr = realloc(cube->prop1Ptr, cube->prop1Cnt * sizeof(NodeProp)); + } + else{ + free(cube->prop1Ptr); + cube->prop1Ptr = NULL; + cube->unk0_4 = 0; + } +} + +void func_8032DC70(void) { + NodeProp *sp1C; + s32 temp_v0; + + sp1C = func_803080C8(); + if (sp1C != NULL) { + func_8032DB2C(func_80308224(), sp1C); + } +} + +ActorMarker *func_8032DCAC(void){ + return D_8038341C; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DCB8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DDD8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DE2C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DE48.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DE5C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DE78.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DE8C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DEA0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DECC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DEE0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DEFC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DF04.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DF10.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DF24.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DF40.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DF4C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DF60.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DFA0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DFBC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DFD8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032DFF4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032E010.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032E02C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032E070.s") + +void cube_free(Cube *cube){ + Prop *iProp; + + if(cube->prop2Ptr){ + for(iProp = cube->prop2Ptr; iProp < cube->prop2Ptr +cube->prop2Cnt; iProp++){ + if(iProp->markerFlag){ + func_80332B2C(iProp->actorProp.marker); + } + } + free(cube->prop2Ptr); + cube->prop2Ptr = NULL; + } + if(cube->prop1Ptr){ + free(cube->prop1Ptr); + cube->prop1Ptr = NULL; + } + cube->prop2Cnt = 0; + cube->prop1Cnt = 0; + cube->unk0_4 = 0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032E178.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032E230.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032E2D4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032E398.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032E49C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032E5A8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032E6CC.s") + +void func_8032E784(Cube *cube, s32 cnt){ + if(cube->prop1Ptr != NULL){ + free(cube->prop1Ptr); + } + cube->prop1Cnt = cnt; + cube->unk0_4 = 0; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032E7E8.s") +#else +void func_8032E7E8(NodeProp *node, Cube *cube, s32 cnt) { + s32 temp_a0; + s32 temp_s2; + s32 temp_s2_2; + s32 actor; + s32 model_cache_ptr; + u32 temp_t8; + void *actor_2; + void *actor_3; + void *actor_4; + void *actor_5; + void *model_cache_ptr_2; + void *phi_s0; + NodeProp *iPtr; + s32 phi_s3; + s32 phi_s2; + s32 phi_a0; + s32 phi_s2_2; + s32 phi_a0_2; + void *i; + void *i_2; + void *i_3; + s32 phi_s2_3; + s32 i; + s32 val; + + cube->unk0_4 = 0; + phi_s3 = cnt - 1; + for(i = 0; i < cnt; i++){ + if( (node[i].unk4_6 == 6) + || (node[i].unk4_6 == 8) + || (node[i].unk4_6 == 7) + || (node[i].unk4_6 == 9) + || (node[i].unk4_6 == 0xA) + || (node[i].unk4_0 == 1) + ){ + memcpy(&cube->prop1Ptr[phi_s3], &node[i], sizeof(NodeProp)); + phi_s3--; + } else { + memcpy(&cube->prop1Ptr[cube->prop1Cnt], &node[i], sizeof(NodeProp)); + cube->unk0_4++; + } + } + free(node); + + for(i = 0; i < cnt; i++){ + iPtr = &cube->prop1Ptr[i]; + if(!iPtr->unk4_0){ + iPtr->unk10_6 = TRUE; + } + } +} +#endif + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032EA24.s") +#else +void func_8032EA24(Struct61s *file_ptr, Cube *cube) { + u8 sp47; + u8 sp46; + s32 sp34; + s32 sp2C; + s32 temp_s0_3; + s32 actor_4; + s32 actor_5; + u8 temp_t1; + NodeProp *temp_a0; + NodeProp *temp_s0; + NodeProp *i; + Prop *i_2; + + cube_free(cube); + if (func_8034B040(file_ptr, 0xA, sp46)) { + func_8032E784(cube, sp46); + cube->prop1Ptr = malloc(sp46 *sizeof(NodeProp)); + temp_s0 = malloc(sp46*sizeof(NodeProp)); + func_8034B080(file_ptr, 0xB, temp_s0, cube->prop1Cnt * sizeof(NodeProp)); + func_8032E7E8(temp_s0, cube, sp46); + } else if (func_8034B040(file_ptr, 6, sp46)) { + func_8032E784(cube, sp46); + cube->prop1Ptr = malloc(sp46 *sizeof(NodeProp)); + temp_s0 = malloc(sp46*sizeof(NodeProp)); + func_8034B080(file_ptr, 7, temp_s0, cube->prop1Cnt * sizeof(NodeProp)); + for(i = temp_s0; i < temp_s0 + sp46; i++){ + if (i->unk4_0 && !i->unkC_0) { + i->unk4_17 = 0; + i->unk10_4 = 0; + } + } + func_8032E7E8(temp_s0, cube, sp46); + } + if (func_8034B040(file_ptr, 8, &sp47)) { + temp_s0_3 = func_803203FC(2); + sp2C = func_803203FC(1); + sp34 = func_803203FC(0x1F) + sp2C + temp_s0_3; + if (sp34 != 0) { + if (func_8031B4CC() != 0) { + sp34 = 0; + } + } + if (cube->prop2Ptr != 0) { + free(cube->prop2Ptr); + } + cube->prop2Cnt = sp47; + cube->prop2Ptr = (Prop *) malloc(sp47 * sizeof(Prop)); + func_8034B080(file_ptr, 9, cube->prop2Ptr, cube->prop2Cnt * sizeof(Prop)); + for(i_2 = cube->prop2Ptr; i_2 < cube->prop2Ptr + sp47; i_2++){ + i_2->unk8_4 = 1; + if(i_2->unk8_1){ + i_2->actorProp.unk8_5 = 0; + } + if(sp34){ + if(!i_2->markerFlag && !i_2->unk8_1){ + switch(i_2->spriteProp.unk0_31 + 0x572){ + case 0x580: + case 0x6D1: + case 0x6D6: + case 0x6D7: + i_2->spriteProp.unk8_4 = 0; + break; + } + } + } + } + + } + + if ((cube->prop2Ptr != NULL) && (cube->prop2Cnt == 0)) { + free(cube->prop2Ptr); + cube->prop2Ptr = NULL; + } + + if ((cube->prop1Ptr != NULL) && (cube->prop1Cnt == 0)) { + free(cube->prop1Ptr); + cube->prop1Ptr = NULL; + cube->unk0_4 = 0; + } +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032EE0C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032EE20.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032EE2C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032EE80.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032F170.s") + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032F194.s") +#else +void func_8032F194(ActorMarker *marker, s32 position[3], Cube *cube) { + ActorProp sp24; + + ((s32*)&sp24)[2] = ((s32*)marker->propPtr)[2]; + sp24.x = (s16) position[0]; + sp24.y = (s16) position[1]; + sp24.z = (s16) position[2]; + func_8032F21C(cube, position, marker, func_8032D9C0(marker->cubePtr, marker->propPtr)); + ((s32*)marker->propPtr)[1] = ((s32*)&sp24)[1]; + ((s32*)marker->propPtr)[2] = ((s32*)&sp24)[2]; +} +#endif + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032F21C.s") +#else +void func_8032F21C(Cube *cube, s32 position[3], ActorMarker *marker, bool arg3) { + ActorProp *sp1C; + u8 temp_t0; + u8 temp_t2; + u8 temp_t6; + u8 temp_t8; + + sp1C = func_8032D80C(cube); + sp1C->unk8_0 = TRUE; + sp1C->x = (s16) position[0]; + sp1C->y = (s16) position[1]; + sp1C->z = (s16) position[2]; + sp1C->marker = marker; + sp1C->unk8_15 = 0; + sp1C->unk8_1 = arg3; + sp1C->unk8_5 = FALSE; + + sp1C->unk8_10 = (func_802E4A08(position)) ? 0xF : (u8)(randf() * 32); + sp1C->unk8_3 = FALSE; + sp1C->unk8_2 = FALSE; + sp1C->unk8_4 = TRUE; + marker->propPtr = sp1C; + marker->cubePtr = cube; + if (func_80305D14()) { + func_80305CD8(func_803058C0((f32)position[1]), 1); + } +} +#endif + +void func_8032F3D4(s32 arg0[3], ActorMarker *marker, s32 arg2){ + func_8032F21C((marker->unk40_23)? func_8030364C() : cube_atPosition_s32(arg0), arg0, marker, arg2); +} + +void marker_free(ActorMarker *this){ + func_8032D9C0(this->cubePtr, (Prop *)this->propPtr); + func_80332B2C(this); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8032F464.s") + +void func_8032F470(s32 *pos, ActorMarker *arg1){ + Cube *cubePtr; + + cubePtr = (arg1->unk40_23)? func_8030364C(): cube_atPosition_s32(pos); + + if(cubePtr == arg1->cubePtr){ + arg1->propPtr->x = pos[0]; + arg1->propPtr->y = pos[1]; + arg1->propPtr->z = pos[2]; + } + else{ + func_8032F194(arg1, pos, cubePtr); + } + + if(arg1->unk2C_1) + func_80307CA0(arg1); +} + +Prop *func_8032F528(void){ + Prop * prop = func_80303F7C(0, 0, 0, 1); + if(prop != NULL){ + D_80383448 = TRUE; + } + else{ + D_80383448 = FALSE; + } + return prop; +} + +void func_8032F578(f32 position[3], ActorMarker *marker, f32 arg2, s32 arg3) { + func_8032F64C(position, marker); + func_80320ED8(marker, arg2, arg3); +} + +void func_8032F5B0(f32 position[3], ActorMarker *marker, f32 arg2, s32 arg3) { + func_8032F64C(position, marker); + func_80320EB0(marker, arg2, arg3); +} + +void func_8032F5E8(s32 arg0[3], s32 arg1, f32 arg2, s32 arg3) { + f32 sp1C[3]; + + sp1C[0] = arg0[0]; + sp1C[1] = arg0[1]; + sp1C[2] = arg0[2]; + func_8032F5B0(sp1C, arg1, arg2, arg3); +} + +void func_8032F64C(f32 *pos, ActorMarker * marker){ + s32 pos_w[3]; + + pos_w[0] = pos[0]; + pos_w[1] = pos[1]; + pos_w[2] = pos[2]; + func_8032F470(pos_w, marker); +} + +void func_8032F6A4(s32 *pos, ActorMarker * marker, s32 *rot){ + s32 rot_w[3]; + + rot_w[0] = (s32)rot[0] % 360; + if(rot_w[0] < 0) + rot_w[0] += 360; + + rot_w[1] = (s32)rot[1] % 360; + if(rot_w[1] < 0) + rot_w[1] += 360; + + rot_w[2] = (s32)rot[2] % 360; + if(rot_w[2] < 0) + rot_w[2] += 360; + + marker->yaw = rot_w[1]; + marker->pitch = rot_w[0]; + marker->roll = rot_w[2]; + func_8032F470(pos, marker); +} + +void func_8032F7EC(f32 position[3], ActorMarker *marker, f32 rotation[3]) { + marker->yaw = rotation[1]; + marker->pitch = rotation[0]; + marker->roll = rotation[2]; + func_8032F64C(position, marker); +} + +ActorMarker * func_8032F9DC(s32 *pos, MarkerDrawFunc arg1, int arg2, int arg3, int arg4){ + ActorMarker * marker = func_80332A60(); + marker->propPtr = NULL; + marker->cubePtr = NULL; + marker->unk8 = arg1; + marker->unk14_20 = arg3; + marker->unk40_23 = arg4; + func_8032F3D4(pos, marker, arg2); + marker->actrArrayIdx = 0; + marker->unk14_10 = 0; + marker->modelId = 0; + marker->unk3E_1 = 0; + marker->unk14_22 = 0; + marker->unk14_21 = 0; + marker->yaw = 0; + marker->pitch = 0; + marker->roll = 0; + marker->unk2C_2 = 0; + marker->unk2C_1 = 0; + marker->collidable = 1; + marker->unk3E_0 = 0; + marker->unk40_22 = 0; + marker->unk40_19 = 0; + marker->unk40_21 = 0; + marker->unkC = NULL; + marker->unk10 = NULL; + marker->unk1C = NULL; + marker->unk54 = NULL; + marker->unk58 = 0; + marker->unk18 = 0; + marker->unk24 = 0; + marker->unk30 = NULL; + marker->unk28 = 0; + marker->unk34 = 0; + marker->unk38[0] = 0; + marker->unk38[1] = 0; + marker->unk38[2] = 0; + marker->unk44 = 0; + marker->unk20 = 0; + marker->unk50 = 0; + marker->unk48 = 0; + marker->unk4C = 0; + marker->unk40_20 = 0; + marker->unk40_31 = 0; + return marker; +} + +ActorMarker * func_8032FB80(f32 *pos, MarkerDrawFunc arg1, int arg2, enum asset_e model_id, int arg4){ + s32 sp24[3]; + sp24[0] = pos[0]; + sp24[1] = pos[1]; + sp24[2] = pos[2]; + func_8032F9DC(sp24, arg1, arg2, model_id, arg4); +} + +ActorMarker * func_8032FBE4(f32 *pos, MarkerDrawFunc arg1, int arg2, enum asset_e model_id){ + return func_8032FB80(pos, arg1, arg2, model_id, 0); +} + +void func_8032FC04(ActorMarker *marker, f32 rotation[3]) { + marker->pitch = rotation[0]; + marker->yaw = rotation[1]; + marker->roll = rotation[2]; +} + +void func_8032FDDC(f32 rotation[3], ActorMarker *marker) { + marker->pitch = rotation[0]; + marker->yaw = rotation[1]; + marker->roll = rotation[2]; +} + +int func_8032FFB4(ActorMarker *this, s32 arg1){ + this->unk14_20 = arg1; +} + +//marker_setActorArrayIndex +void func_8032FFD4(ActorMarker *this, s32 arg1){ + this->actrArrayIdx = arg1; +} + +void func_8032FFEC(ActorMarker *this, s32 arg1){ + this->unk28 = arg1; +} + +void func_8032FFF4(ActorMarker *this, ActorMarker *other, s32 type){ + switch(type){ + case 0: //ow + if(this->unkC) + this->unkC(this, other); + break; + case 1: + if(this->unk10) + this->unk10(this, other); + break; + case 2: //die + if(this->unk1C) + this->unk1C(this, other); + break; + } +} + +void func_80330078(ActorMarker *marker, ActorMarker *other_marker, s16 *arg2){ + if(marker != NULL && marker->unk54 != NULL){ + marker->unk54(marker, other_marker, arg2); + } +} + +//marker_setCollisionMethods +void marker_setCollisionScripts(ActorMarker *this, MarkerCollisionFunc ow_func, MarkerCollisionFunc arg2, MarkerCollisionFunc die_func){ + this->unkC = ow_func; + this->unk10 = arg2; + this->unk1C = die_func; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_803300B8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_803300C0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_803300C8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_803300D0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_803300D8.s") + +#define AssetCacheSize 0x3D5 + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_803300E0.s") + +void marker_setModelId(ActorMarker *this, enum asset_e modelIndex){ + this->modelId = modelIndex; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_80330104.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_80330208.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_803303B8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_80330534.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_8033056C.s") + +//modelCache_Init +void func_803305AC(void){ + s32 i; + + modelCache = (ModelCache *)malloc(AssetCacheSize * sizeof(ModelCache)); + for(i = 0; ipropPtr->x; + position[1] = (f32) marker->propPtr->y; + position[2] = (f32) marker->propPtr->z; + + rotation[0] = (f32)marker->pitch; + rotation[1] = (f32)marker->yaw; + rotation[2] = (f32)marker->roll; + + scale = (marker->unk3E_0) ? marker_getActor(marker)->scale : 1.0f; + if (func_802EA190(marker->unk20)) { + return func_802EBAE0(sp58, position, rotation, scale, 0, marker->unk20, arg1, arg2, arg3); + } + return 0; +} + + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_80330B10.s") + +//marker_loadModelBin +BKModelBin *func_80330B1C(ActorMarker *this){ + Actor* thisActor; + BKModelBin * model; + ModelCache *modelInfo; + + if(this->modelId == 0) + return NULL; + + thisActor = marker_getActor(this); + if((modelInfo = &modelCache[thisActor->modelCacheIndex])->modelPtr == NULL){ + model = assetcache_get(this->modelId); + modelInfo->modelPtr = model; + if(func_8033A110(model)){ + modelInfo->unkC = func_80349C3C(); + func_80349D00(modelInfo->unkC, func_8033A110(modelInfo->modelPtr)); + } + func_8032ACA8(thisActor); + } + func_8032AB84(thisActor); + if(!this->unk18 && this->propPtr->unk8_1 && modelInfo->modelPtr && func_8033A12C(modelInfo->modelPtr)){ + this->unk18 = func_80330B10(); + } + modelInfo->unk10 = func_8023DB5C(); + return modelInfo->modelPtr; +} + +s32 func_80330C48(Actor *actor){ + ModelCache *model_cache_ptr = &modelCache[actor->modelCacheIndex]; + return model_cache_ptr->unkC; +} + +BKVertexList *func_80330C74(Actor *actor){ + ModelCache *model_cache_ptr; + model_cache_ptr = &modelCache[actor->modelCacheIndex]; + if(model_cache_ptr->modelPtr == NULL) + return NULL; + + if(actor->unkF4_30 && actor->unk14C[actor->unkF4_29]){ + return actor->unk14C[actor->unkF4_29]; + }else{ + return func_8033A148(model_cache_ptr->modelPtr); + } +} + +BKVertexList *func_80330CFC(Actor *this, s32 arg1){ + ModelCache *model_cache_ptr; + model_cache_ptr = &modelCache[this->modelCacheIndex]; + if(model_cache_ptr->modelPtr == NULL){ + func_80330B1C(this->marker); + } + if(this->unkF4_30 && this->unk14C[this->unkF4_29 ^ arg1] != NULL) + return this->unk14C[this->unkF4_29 ^ arg1]; + return func_8033A148(model_cache_ptr->modelPtr); +} + +BKVertexList * func_80330DA4(Actor *this){ + return func_80330CFC(this, 0); +} + +BKVertexList * func_80330DC4(Actor *this){ + return func_80330CFC(this, 1); +} + +BKModelBin *func_80330DE4(ActorMarker *this){ + Actor *thisActor = marker_getActor(this); + return (modelCache + thisActor->modelCacheIndex)->modelPtr; +} + +BKModelBin *func_80330E28(Actor* this){ + return (modelCache + this->modelCacheIndex)->modelPtr; +} + +BKSpriteDisplayData *func_80330E54(ActorMarker *marker, BKSprite **sprite_ptr) { + ModelCache *model_cache_ptr; + + if (marker->modelId == 0) { + if (*sprite_ptr != NULL) { + *sprite_ptr = NULL; + } + return 0; + } + model_cache_ptr = &modelCache[marker_getActor(marker)->modelCacheIndex]; + if (model_cache_ptr->unk4 == 0) { + model_cache_ptr->unk4 = func_8033B6C4(marker->modelId, &model_cache_ptr->unk8); + } + model_cache_ptr->unk10 = func_8023DB5C(); + if (sprite_ptr != NULL) { + *sprite_ptr = model_cache_ptr->unk4; + } + return model_cache_ptr->unk8; +} + +BKSpriteDisplayData *func_80330F30(ActorMarker *marker){ + return func_80330E54(marker, NULL); +} + +BKSprite *func_80330F50(ActorMarker * marker){ + BKSprite *sp1C; + func_80330E54(marker, &sp1C); + return sp1C; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_80330F74.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_80330F7C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_80330F8C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_80330F94.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_80330FBC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_80330FC4.s") + +void func_80330FCC(ActorMarker *marker, s32 arg1[3]){ + arg1[0] = marker->propPtr->x; + arg1[1] = marker->propPtr->y; + arg1[2] = marker->propPtr->z; +} + +void func_80330FF4(void){ + Actor *phi_s0; + f32 sp48[3]; + f32 scale[3]; + + if(func_80334904() == 1) + return; + + if(D_8038341C != NULL){ + phi_s0 = marker_getActor(D_8038341C); + player_getPosition(sp48); + scale[0] = phi_s0->pitch; + scale[1] = phi_s0->yaw; + scale[2] = phi_s0->roll; + func_80340200(D_8038341C->unk50, phi_s0->position, scale, 1.0f, NULL, D_80383420, func_80330DA4(phi_s0), D_80383410); + }//L8033108C + + func_802C39D4(); + if(D_8038341C != NULL){ + phi_s0 = marker_getActor(D_8038341C); + player_getPosition(sp48); + scale[0] = phi_s0->pitch;\ + scale[1] = phi_s0->yaw;\ + scale[2] = phi_s0->roll; + if(func_80340020(D_8038341C->unk50, phi_s0->position, scale, 1.0f, NULL, func_80330DC4(phi_s0), sp48, sp48)){ + sp48[1] -= 10.0f; + func_8028FAB0(sp48); + } + } + if(D_8038341C != NULL){ + D_8038341C = NULL; + } + //L80331144 +} + +bool func_80331158(ActorMarker *arg0, s32 arg1, s32 arg2) { + Actor *actor; + u32 temp_a0; + + actor = marker_getActor(arg0); + if ((actor->unk3C & 0x400) && ((s32)actor->unk3C << 4) >= 0){ + return func_802E74A0(actor->position, actor->unk178 * D_80378EB0, arg1, arg2) == 0; + } + return FALSE; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_803311D4.s") +#else +extern int func_802E805C(BKCollisionList *, BKVertexList *, f32[3], f32[3], f32, f32[3], f32[3], f32[3], u32); +s32 func_803311D4(Cube *arg0, f32 *arg1, f32 *arg2, f32 *arg3, u32 arg4) { + f32 spAC[3]; + f32 spA0[3]; + f32 sp88[3]; + f32 sp7C[3]; + Actor *temp_s2_2; + Actor *temp_v0_6; + ActorMarker *temp_a0; + ActorMarker *temp_a0_2; + BKModelBin *temp_v0_2; + BKModelBin *temp_v0_3; + BKModelBin *var_a0; + BKModelBin *var_s0; + BKModelBin *var_v0_2; + BKVertexList *temp_a1; + Prop *var_s1; + Struct6Cs *temp_v0_8; + f32 var_f10; + f32 var_f4; + f32 var_f6; + s32 (*temp_v1_2)(struct actor_marker_s *, f32 [3], f32, f32 [3], s32); + s32 temp_s0; + s32 temp_s0_2; + BKCollisionList *temp_s2; + s32 temp_v0; + s32 temp_v0_4; + s32 temp_v0_5; + s32 temp_v0_7; + s32 temp_v1; + s32 var_s6; + s32 var_v0; + u32 temp_t3; + u32 temp_t6; + u32 temp_t9; + u32 var_s5; + + var_s5 = arg0->prop2Cnt; + var_s6 = 0; + var_s1 = arg0->prop2Ptr; + for(var_s5 = arg0->prop2Cnt; var_s5 > 0; var_s5--) { + if (!var_s1->markerFlag && var_s1->unk8_1 && var_s1->unk8_4) { //propProp + var_s0 = func_8030A4B4(var_s1->propProp.unk0_31); + if ((var_s0 != NULL) || (func_8028F280() && ((var_s0 = func_8030A428(var_s1->propProp.unk0_31)) != NULL))) { + temp_s2 = func_8033A084(var_s0); + if (temp_s2 != 0) { + spAC[0] = (f32) var_s1->propProp.unk4[0]; + spAC[1] = (f32) var_s1->propProp.unk4[1]; + spAC[2] = (f32) var_s1->propProp.unk4[2]; + spA0[0] = 0.0f; + spA0[1] = (f32) (var_s1->propProp.unk0_15 * 2); + spA0[2] = (f32) (var_s1->propProp.unk0_7 * 2); + var_v0 = func_802E805C(temp_s2, func_8033A148(var_s0), spAC, spA0, var_s1->propProp.unkA / 100.0, arg1, arg2, arg3, arg4); + if (var_v0 != 0) { + var_s6 = var_v0; + } + } + } + } else if (var_s1->markerFlag && var_s1->unk8_3 && var_s1->unk8_4 && !func_80331158(var_s1->actorProp.marker, arg1, arg2)) { + temp_a0 = var_s1->actorProp.marker; + if (temp_a0->collidable && (marker_getActor(temp_a0)->unk3C & 0x000010000)) { + var_a0 = func_80330B1C(var_s1->actorProp.marker); + } else { + var_a0 = func_80330DE4(var_s1->actorProp.marker); + } + if (var_a0 == NULL && func_8028F280(var_a0)) { + var_a0 = func_80330B1C(var_s1->actorProp.marker); + } + temp_s0 = func_8033A084(var_a0); + if (temp_s0 != 0) { + temp_s2_2 = marker_getActor(var_s1->actorProp.marker); + temp_a1 = func_80330C74(temp_s2_2); + sp88[0] = (f32) var_s1->actorProp.x; + sp88[1] = (f32) var_s1->actorProp.y; + sp88[2] = (f32) var_s1->actorProp.z; + sp7C[0] = (f32) var_s1->actorProp.marker->pitch; + sp7C[1] = (f32) var_s1->actorProp.marker->yaw; + sp7C[2] = (f32) var_s1->actorProp.marker->roll; + temp_s0_2 = func_802E805C(temp_s0, temp_a1, &sp88, &sp7C, temp_s2_2->scale, arg1, arg2, arg3, arg4); + if ((temp_s0_2 != 0) && (func_8029453C() != 0)) { + func_80330B1C(var_s1->actorProp.marker); + if (var_s1->actorProp.marker->unk50 != 0) { + D_80383410[0] = (f32) arg2[0]; + D_80383410[1] = (f32) arg2[1]; + D_80383410[2] = (f32) arg2[2]; + D_8038341C = var_s1->actorProp.marker; + D_80383420 = temp_s0_2; + } + } + if (temp_s0_2 != 0) { + var_s6 = temp_s0_2; + } + } + } else if (var_s1->markerFlag) { + temp_a0_2 = var_s1->actorProp.marker; + if (temp_a0_2->unk18 != NULL) { + if (temp_a0_2->unk18->unk0 != NULL) { + var_v0 = temp_a0_2->unk18->unk0(temp_a0_2, arg1, arg2, arg3, arg4); + if (var_v0 != 0) { + var_s6 = var_v0; + } + } + } + } + var_s1++; + } + return var_s6; +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_80331638.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_A4D00/func_803319C0.s") + +f32 func_80331D20(BKSprite *sprite) { + BKSpriteFrame *frame; + s32 temp_lo; + s32 temp_lo_2; + s32 phi_v0; + + if (sprite == 0) { + return 1.0f; + } + frame = spriteGetFramePtr(sprite, 0); + temp_lo = (s32) (((frame->unk10 - frame->unkC) + 1) * sprite->unk8) / (s32) frame->w; + temp_lo_2 = (s32) (((frame->unk12 - frame->unkE) + 1) * sprite->unkA) / (s32) frame->h; + phi_v0 = (temp_lo_2 < temp_lo) ? temp_lo : temp_lo_2; + return (phi_v0 <= 0) ? 1 : phi_v0; +} + + +f32 func_80331E34(Prop *arg0){ + return func_80331D20(func_8030A55C(arg0->spriteProp.unk0_31)); +} + +f32 func_80331E64(ActorMarker *marker) { + f32 sp24; + + if (marker->modelId == 0) { + return 0.0f; + } + sp24 = func_80331D20(func_80330F50(marker)); + marker->unk38[1] = (s16) (sp24 / 2); + if (marker->unk3E_0) { + marker->unk38[1] *= marker_getActor(marker)->scale; + } + return sp24; +} + + +f32 func_80331F1C(Prop *arg0){ + return func_802EC920(func_8033A148(func_8030A428(arg0->propProp.unk0_31))); +} + +f32 func_80331F54(ActorMarker *marker) { + f32 sp34; + f32 sp28[3]; + BKModelBin *model; + + model = func_80330B1C(marker); + if (model == NULL) { + return 1.0f; + } + func_802EC930(func_8033A148(model), sp28, &sp34); + if (marker->unk3E_0) { + sp28[0] = sp28[0] * marker_getActor(marker)->scale;\ + sp28[1] = sp28[1] * marker_getActor(marker)->scale;\ + sp28[2] = sp28[2] * marker_getActor(marker)->scale; + } + marker->unk38[0] = (s16) sp28[0];\ + marker->unk38[1] = (s16) sp28[1];\ + marker->unk38[2] = (s16) sp28[2]; + return sp34 * 2; +} + +f32 func_80332050(Prop *prop, ActorMarker *marker, s32 arg2) { + ActorMarker * phi_v0; + f32 phi_f2; + + phi_v0 =(prop->markerFlag) ? prop->actorProp.marker : NULL; + phi_f2 = prop->unk4[arg2] - (&marker->propPtr->x)[arg2] - marker->unk38[arg2]; + if (phi_v0 != NULL) { + phi_f2 += phi_v0->unk38[arg2]; + } + return phi_f2; +} + + +f32 func_803320BC(ActorProp *prop, f32 (*arg1)(ActorMarker *)) { + ActorMarker *marker; + f32 sp18; + + marker = prop->marker; + sp18 = (f32)marker->unk14_10; + if (sp18 == 0.0f) { + sp18 = marker->unk14_10 = arg1(marker) * 0.5; + } + if (marker->unk3E_0) { + sp18 *= marker_getActor(marker)->scale; + } + return sp18; +} + +f32 func_80332220(Prop * prop, f32 (*arg1)(Prop *)) { + f32 phi_f12; + + phi_f12 = func_8030A590(); + if (phi_f12 == 0.0f) { + func_8030A5EC(prop, phi_f12 = arg1(prop) * 0.5); + } + return phi_f12; +} + + +f32 func_8033229C(ActorMarker *marker) { + ActorProp *prop; + + prop = marker->propPtr; + if (prop->unk8_1) { + return func_803320BC(prop, func_80331F54); + } + else{ + return func_803320BC(prop, func_80331E64); + } +} + +extern u8 *D_8036E7C4; +extern ActorMarker *D_8036E7C8; +extern s16 D_8036E7E0[]; +extern s16 D_8036E7FC[]; +//extern s32 D_8036E800; +// extern u32 D_8036E804[8]; + +extern u8 D_80383428[0x1C]; + +Prop *func_803322F0(Cube *cube, ActorMarker *marker, f32 arg2, s32 arg3, s32 *arg4) { + Prop *phi_s1; + f32 phi_f24; + f32 phi_f20; + f32 phi_f22; + f32 phi_f2; + s32 phi_s3; + f32 sp74[3]; + f32 sp68[3]; + + phi_s3 = cube->prop2Cnt - *arg4; + if (marker->collidable) { + phi_s1 = &cube->prop2Ptr[(*arg4)++]; + for(phi_s3 = phi_s3; phi_s3 != 0; phi_s3--){ + if (phi_s1->unk8_4) { + if( phi_s1->markerFlag && (!phi_s1->actorProp.marker->unk3E_0 || !marker_getActor(phi_s1->actorProp.marker)->despawn_flag)){ + if (phi_s1->actorProp.marker->collidable && (marker != phi_s1->actorProp.marker)) { + if( (phi_s1->actorProp.marker->modelId) + && (func_803327A8(phi_s1->actorProp.marker->modelId) & arg3) + ) { + if( phi_s1->actorProp.unk8_1 + && (phi_s1->actorProp.marker->unk18 != NULL) + && (phi_s1->actorProp.marker->unk18->unkC != NULL) + ) { + func_803320BC(phi_s1, &func_80331F54); + sp68[0] = (f32) (marker->unk38[0] + marker->propPtr->x); + sp68[1] = (f32) (marker->unk38[1] + marker->propPtr->y); + sp68[2] = (f32) (marker->unk38[2] + marker->propPtr->z); + if ((phi_s1->actorProp.marker->unk40_31 = phi_s1->actorProp.marker->unk18->unkC(phi_s1->actorProp.marker, sp68, arg2, sp74, 0)) != 0) { + return phi_s1; + } + } else{ + phi_f24 = func_80332050(phi_s1, marker, 0); + phi_f22 = func_80332050(phi_s1, marker, 2); + if (phi_s1->actorProp.unk8_1) { + phi_f20 = func_80332050(phi_s1, marker, 1); + phi_f2 = func_803320BC(phi_s1, func_80331F54); + } else { + phi_f20 = func_80332050(phi_s1, marker, 1); + phi_f2 = func_803320BC(phi_s1, &func_80331E64); + } + phi_f2 = phi_f2 + arg2; + if ((phi_f24*phi_f24 + phi_f20*phi_f20 + phi_f22*phi_f22) < phi_f2*phi_f2) { + return phi_s1; + } + } + } + } + } + else if (phi_s1->unk8_1) {//PropProp + if (func_803327A8(phi_s1->propProp.unk0_31 + 0x2D1) & arg3) { + phi_f24 = func_80332050(phi_s1, marker, 0); + phi_f20 = func_80332050(phi_s1, marker, 1) + func_80332220(phi_s1, &func_80331F1C); + phi_f22 = func_80332050(phi_s1, marker, 2); + phi_f2 = func_80332220(phi_s1, &func_80331F1C) + arg2; + if (( (phi_f24 * phi_f24) + (phi_f20 * phi_f20) + (phi_f22 * phi_f22)) < (phi_f2 * phi_f2)) { + return phi_s1; + } + } + } + else{ + if (func_803327A8(phi_s1->spriteProp.unk0_31 + 0x572) & arg3) { + phi_f24 = func_80332050(phi_s1, marker, 0);\ + phi_f20 = func_80332050(phi_s1, marker, 1) + func_80332220(phi_s1, &func_80331E34);\ + phi_f22 = func_80332050(phi_s1, marker, 2); + phi_f2 = func_80332220(phi_s1, &func_80331E34) + arg2; + if (((phi_f24 * phi_f24) + (phi_f20 * phi_f20) + (phi_f22 * phi_f22)) < (phi_f2 * phi_f2)) { + return phi_s1; + } + } + } + } + phi_s1++; + (*arg4)++; + } + } + *arg4 = -1; + return NULL; +} + + +void func_80332764(s32 arg0, s32 arg1) { + u8 *actor; + + D_8036E7C4[arg0 >> 2] |= arg1 << ((arg0 & 3) * 2); +} + +void func_80332790(s32 arg0){ + D_8036E7C4[arg0 >> 2] = 0; +} + +s32 func_803327A8(s32 arg0) { + return ((s32) D_8036E7C4[arg0 >> 2] >> ((arg0 & 3) * 2)) & 3; +} + +void func_803327D4(s16 *arg0, s32 arg1) { + s32 i; + + for(i = 0; arg0[i] != -1; i++){ + func_80332764(arg0[i], arg1); + } +} + +void func_8033283C(s32 arg0, s32 arg1, s32 arg2) { + s32 i; + + for(i = arg0; i < arg1; i++){ + func_80332764(i, arg2); + } +} + +void func_80332894(void) { + s32 size; + s32 i; + + size = 0x579; + D_8036E7C4 = malloc(size); + i = 0; + do{ + D_8036E7C4[i] = 0; + i++; + }while(i != size); + func_8033283C(0x34D, 0x3A6, 3); + func_8033283C(0x3A6, 0x572, 3); + func_803327D4(&D_8036E7E0, 1); + func_803327D4(&D_8036E7FC, 2); + func_8032D330(); +} + +void func_8033297C(void){ + free(D_8036E7C4); + D_8036E7C4 = NULL; + func_8032D36C(); +} + +//MarkerList_Init +void func_803329AC(void){ + s32 i; + + D_8036E7C8 = (ActorMarker *)malloc(0xE0*sizeof(ActorMarker)); + + for( i = 0; i < 0x1C; i++){ + D_80383428[i] = 0; + } + + for(i =0; i<0xE0; i++){ + D_8036E7C8[i].unk5C = 0; + } +} + +void func_80332A38(void){ + free(D_8036E7C8); + D_8036E7C8 = NULL; +} + +//MarkerList_getFreeMarker +ActorMarker * func_80332A60(void){ + static s32 D_8036E800 = 0x387FB; + int i; + int j; + int tmp_a2; + ActorMarker *marker; + + for(i = 0; i < 0x1C && D_80383428[i] == 0xff; i++); + if(i == 0x1C) + return NULL; + + tmp_a2 = 0x80; + for(j = 0; D_80383428[i] & tmp_a2; j++){tmp_a2 >>= 1;} + D_80383428[i] |= tmp_a2; + marker = D_8036E7C8 + 8*i + j; + marker->unk5C = D_8036E800; + D_8036E800++; + return marker; +} + +void func_80332B2C(ActorMarker * arg0){ + static s32 D_8036E804[8] = {0x7F, 0xBF, 0xDF, 0xEF, 0xF7, 0xFB, 0xFD, 0xFE}; + + s32 index = (arg0 - D_8036E7C8); + arg0->unk5C = 0; + D_80383428[index >> 3] = D_80383428[index >> 3] & D_8036E804[index & 7]; +} + +void func_80332B7C(void){ + return; +} diff --git a/src/core2/code_A600.c b/src/core2/code_A600.c new file mode 100644 index 00000000..a0975176 --- /dev/null +++ b/src/core2/code_A600.c @@ -0,0 +1,55 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_802915B8(void); +void func_802915E4(void); + +/* .bss */ +f32 D_8037C090; +f32 D_8037C094; +s32 D_8037C098; + +/* .code */ +void func_80291590(void){ + func_802915B8(); + func_802915E4(); +} + +void func_802915B8(void){ + D_8037C090 = 30.0f; +} + +void func_802915CC(f32 arg0){ + D_8037C090 = arg0; +} + +f32 func_802915D8(void){ + return D_8037C090; +} + +void func_802915E4(void){ + D_8037C094 = 100.0f; +} + +void func_802915F8(f32 arg0){ + D_8037C094 = arg0; +} + +f32 func_80291604(void){ + return D_8037C094; +} + +void func_80291610(ActorMarker *this_marker, ActorMarker *other_marker){ + func_8028F55C(1, other_marker); +} + +void func_80291634(ActorMarker *this_marker, ActorMarker *other_marker){ + func_8028F428(2, other_marker); +} + +void func_80291658(s32 arg0){ return; } + +s32 func_80291660(void){ + return D_8037C098; +} diff --git a/src/core2/code_A6E0.c b/src/core2/code_A6E0.c new file mode 100644 index 00000000..b18fd488 --- /dev/null +++ b/src/core2/code_A6E0.c @@ -0,0 +1,65 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + f32 unk0; + f32 unk4; +}Struct_Core2_A600_0; + +/* .bss */ +Struct_Core2_A600_0 D_8037C0A0[8]; + +/* .code */ +f32 func_80291670(s32 arg0){ + return D_8037C0A0[arg0].unk0; +} + +f32 func_80291684(s32 arg0){ + return D_8037C0A0[arg0].unk4; +} + +int func_80291698(s32 arg0){ + return D_8037C0A0[arg0].unk0 != 0.0f; +} + +int func_802916CC(s32 arg0){ + return D_8037C0A0[arg0].unk0 == 0.0f; +} + +int func_80291700(s32 arg0, f32 arg1){ + return (D_8037C0A0[arg0].unk0 < arg1) && (arg1 <= D_8037C0A0[arg0].unk4); +} + +void func_8029175C(void){} + +void func_80291764(void){ + int i; + for(i = 0; i < 7; i++){ + D_8037C0A0[i].unk0 = 0.0f; + D_8037C0A0[i].unk4 = 0.0f; + } +} + +void func_802917C4(s32 arg0){ + func_802917E4(arg0, 0.0f); +} + +void func_802917E4(s32 arg0, f32 arg1){ + D_8037C0A0[arg0].unk0 = arg1; + D_8037C0A0[arg0].unk4 = arg1; +} + +void func_80291804(void){ + int i; + f32 delta = time_getDelta(); + for(i = 0; i < 7; i++){ + D_8037C0A0[i].unk4 = D_8037C0A0[i].unk0; + if(0.0f != D_8037C0A0[i].unk4){ + D_8037C0A0[i].unk0 -= delta; + if(D_8037C0A0[i].unk0 < 0.0f){ + D_8037C0A0[i].unk0 = 0.0f; + } + } + } +} diff --git a/src/core2/code_A960.c b/src/core2/code_A960.c new file mode 100644 index 00000000..44c3607c --- /dev/null +++ b/src/core2/code_A960.c @@ -0,0 +1,34 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80291930(s32); + +int func_802918F0(void){ + return miscflag_isTrue(0x15); +} + +void func_80291910(void){ + func_80291930(0); +} + +void func_80291930(s32 arg0){ + if(!func_802918F0()){ + miscflag_set(0x15); + if(arg0){ + func_8029E3C0(5, 2.0f); + func_8029C984(); + bs_setState(BS_5A_LOADZONE); + func_802921C8(0); + func_802978DC(7); + func_8029151C(6); + } + } +} + +void func_802919A0(void){ + if(func_802918F0() && func_8029E1A8(5)){ + func_8029B890(); + func_80291930(0); + } +} diff --git a/src/core2/code_AA60.c b/src/core2/code_AA60.c new file mode 100644 index 00000000..c8ef1ace --- /dev/null +++ b/src/core2/code_AA60.c @@ -0,0 +1,392 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80254008(void); +extern void func_80256E24(f32[3], f32, f32, f32, f32, f32); +void assetcache_release(void *); //assetcache_free +extern void ml_vec3f_assign(f32[3], f32, f32, f32); +void func_8033A280(f32); + + +void func_80292048(s32, f32, f32, f32); +void func_80292090(s32 arg0); +void func_802920FC(f32); +void func_8029217C(f32); +void func_802921C8(s32 arg0); + + +extern s32 D_80000310; + +/* .data */ +struct5Bs *D_80363780 = NULL; + +/* .bss */ +void *D_8037C0E0; //playerModelPtr +s16 D_8037C0E4; //playerModel asset_id +u8 D_8037C0E6; +u8 D_8037C0E7; +u8 D_8037C0E8; +f32 D_8037C0EC; +f32 D_8037C0F0; +f32 D_8037C0F4; +f32 D_8037C0F8; +f32 D_8037C100[3]; +f32 D_8037C110[3]; +f32 D_8037C120[3]; +void (*D_8037C12C)(Gfx **gfx, Mtx **mtx, Vtx **vtx); +f32 D_8037C130[2][4]; +struct { + u8 unk0; + f32 unk4[3]; +} D_8037C150; + +//public +void playerModel_set(s32 asset_id); + +//.data +void func_802919F0(void){ + switch(D_8037C0E7){ + case 2: + D_8037C0F8 = mlNormalizeAngle(yaw_get() + 180.0f); + break; + default: + D_8037C0F8 = yaw_get(); + break; + case 3: + break; + } +} + +void func_80291A60(s32 arg0, f32 arg1[3]){ + func_8034A174(D_80363780, arg0, arg1); + if(func_802582EC(arg1)){ + _player_getPosition(arg1); + } +} + +int func_80291AAC(s32 arg0, s32 arga, s32 arg2, s32 arg3){ + return 0; +} + +void func_80291AC4(int arg0){ + _player_getMarker()->unk14_21 = 1; +} + +void func_80291AF0(Gfx **gfx, Mtx **mtx, Vtx **vtx){ + f32 sp5C[3]; + s32 sp50[3]; + f32 plyr_pos[3]; //sp44 + f32 sp38[3]; + + if(!D_8037C0E8) + return; + + func_802919F0(); + D_8037C0F4 = roll_get(); + D_8037C0F0 = pitch_get(); + _player_getPosition(plyr_pos); + plyr_pos[1] += 2.0f; + ml_vec3f_assign(sp5C, D_8037C0F0, D_8037C0F8, D_8037C0F4); + func_8029A47C(sp50); + ml_vec3f_copy(sp38, D_8037C100); + + plyr_pos[0] += D_8037C120[0];\ + plyr_pos[1] += D_8037C120[1];\ + plyr_pos[2] += D_8037C120[2]; + + sp38[0] += D_8037C120[0];\ + sp38[1] += D_8037C120[1];\ + sp38[2] += D_8037C120[2]; + + if(D_8037C0E0){ + func_80289F30(); + func_8029DD6C(); + func_8033A388(sp50[0], sp50[1], sp50[2], D_8037C0E6); + func_8033A280(2.0f); + func_8033A2D4(func_80291AC4, 0); + func_8033A450(D_80363780); + set_model_render_mode(1); + if(D_8037C150.unk0){ + D_8037C150.unk0 = 0; + func_803391A4(gfx, mtx, D_8037C150.unk4, sp5C, D_8037C0EC, sp38, D_8037C0E0); + } + else{ + func_803391A4(gfx, mtx, plyr_pos, sp5C, D_8037C0EC, sp38, D_8037C0E0); + } + }//L80291CD4 + + if(D_8037C12C){ + D_8037C12C(gfx, mtx, vtx); + } +} + +void func_80291D04(void){ + playerModel_set(func_802985F0()); +} + +void func_80291D2C(void){ + f32 plyr_pos[3]; + int i; + for(i = 0; i < 2 ; i++){ + func_80292048(i, 0.0f, 0.0f, 0.0f); + func_80292078(i, 0.0f); + } + D_8037C0E6 = -1; + D_8037C0E0 = NULL; + D_8037C0E4 = 0; + D_8037C12C = 0; + D_80363780 = func_8034A2C8(); + func_8034A130(D_80363780); + ml_vec3f_clear(D_8037C100); + ml_vec3f_clear(D_8037C110); + ml_vec3f_clear(D_8037C120); + D_8037C0F8 = D_8037C0F4 = D_8037C0F0 = 0.0f; + D_8037C150.unk0 = 0; + func_802921C8(1); + func_802920FC(1.0f); + D_8037C0E7 = 0; + func_80292090(1); + if(!func_8028ADB4()) + func_80291D04(); + player_getPosition(plyr_pos); + func_802C3F04(func_802C4140, 0x17, + reinterpret_cast(s32, plyr_pos[0]), + reinterpret_cast(s32, plyr_pos[1]), + reinterpret_cast(s32, plyr_pos[2]) + ); +} + +void func_80291E88(void){ + assetcache_release(D_8037C0E0); + D_8037C0E0 = NULL; + D_8037C0E4 = 0; + func_8034A2A8(D_80363780); + D_80363780 = NULL; +} + +void func_80291ECC(void){ + f32 sp1C; + f32 temp_f0; + + sp1C = D_8037C110[1] - D_8037C100[1]; + temp_f0 = mlAbsF(sp1C); + if( temp_f0 < 0.01){ + D_8037C100[1] = D_8037C110[1]; + } + else{ + if(5.0f < temp_f0){ + temp_f0 = 1.0f; + } + if(0.0f < sp1C){ + D_8037C100[1] += temp_f0; + } + else{ + D_8037C100[1] -= temp_f0; + } + {//L80291F7C + _player_getMarker()->unk14_21 = 0; + } + } +} + +BKModelBin *func_80291FA0(void){ + return D_8037C0E0; +} + +enum asset_e func_80291FAC(void){ + return D_8037C0E4; +} + +void func_80291FB8(s32 arg0){ + D_8037C0E6 = arg0; +} + +void playerModel_set(s32 asset_id){ + if(asset_id != D_8037C0E4){ + if(D_8037C0E0){ + func_80254008(); + assetcache_release(D_8037C0E0); + D_8037C0E0 = NULL; + } + D_8037C0E4 = asset_id; + if(D_8037C0E4) + D_8037C0E0 = assetcache_get(D_8037C0E4); + } +} + +void func_80292048(s32 arg0, f32 arg1, f32 arg2, f32 arg3){ + D_8037C130[arg0][2] = arg1; + D_8037C130[arg0][3] = arg2; + D_8037C130[arg0][1] = arg3; +} + +void func_80292078(s32 arg0, f32 arg1){ + D_8037C130[arg0][0] = arg1; +} + +void func_80292090(s32 arg0){ + if(arg0 != D_8037C0E7){ + if(arg0 == 2 || 2 == D_8037C0E7){ + yaw_setIdeal(mlNormalizeAngle(yaw_get() + 180.0f)); + yaw_applyIdeal(); + } + } + D_8037C0E7 = arg0; +} + +void func_802920FC(f32 arg0){ + if(D_80000310 + -0x17D7){ + arg0 = arg0*0.25; + } + D_8037C0EC = arg0; +} + +void func_80292134(f32 arg0){ + D_8037C0F8 = mlNormalizeAngle(arg0); +} + +void func_80292158(f32 arg0){ + D_8037C100[1] = arg0; + func_8029217C(arg0); +} + +void func_8029217C(f32 arg0){ + D_8037C110[1] = arg0; +} + +void func_80292188(void (*draw_func)(Gfx **gfx, Mtx **mtx, Vtx **vtx)){ + D_8037C12C = draw_func; +} + +void func_80292194(f32 arg0[3]){ + ml_vec3f_copy(D_8037C120, arg0); +} + +void func_802921BC(f32 arg0){ + D_8037C120[1] = arg0; +} + +void func_802921C8(s32 arg0){ + D_8037C0E8 = arg0; +} + +void func_802921D4(f32 arg0[3]){ + if(func_8028EE84() == BSWATERGROUP_0_NONE){ + D_8037C150.unk0 = 1; + D_8037C150.unk4[0] = arg0[0]; + D_8037C150.unk4[1] = arg0[1]; + D_8037C150.unk4[2] = arg0[2]; + } +} + +f32 func_80292224(void){ + return D_8037C0F8; +} + +f32 func_80292230(void){ + return D_8037C100[1]; +} + +void func_8029223C(f32 arg0[3]){ + func_80291A60(8, arg0); +} + +void func_80292260(f32 arg0[3]){ + func_80291A60(7, arg0); +} + +void func_80292284(f32 arg0[3], s32 arg1){ + f32 sp44[3]; + f32 sp38[3]; + + if(_player_getMarker()->unk14_21 && D_8037C0E8){ + switch(func_80291FAC()){ + case 0x34D: + case 0x34E: + case ASSET_34F_MODEL_BANJO_TERMITE: //802922E8 + case ASSET_359_MODEL_BANJO_WALRUS: //802922E8 + case ASSET_362_MODEL_BANJO_BEE: + case ASSET_36F_MODEL_BANJO_PUMPKIN: + case ASSET_374_MODEL_BANJO_CROC: + func_8034A174(D_80363780, arg1 + 1, arg0); + if(func_802582EC(arg0)){ + _player_getPosition(arg0); + } + + arg0[1] += D_8037C130[arg1][0]; + if(D_8037C130[arg1][1] != 0.0f){ + func_80256E24(sp44, D_8037C130[arg1][2], mlNormalizeAngle(yaw_get() + D_8037C130[arg1][3]), 0.0f, 0.0f, D_8037C130[arg1][1]); + arg0[0] += sp44[0]; + arg0[1] += sp44[1]; + arg0[2] += sp44[2]; + } + func_802976C0(sp38); + arg0[0] = arg0[0] + sp38[0]; + arg0[1] = arg0[1] + sp38[1]; + arg0[2] = arg0[2] + sp38[2]; + break; + default: ////80292400 + _player_getPosition(arg0); + break; + } + } + else{//L80292410 + _player_getPosition(arg0); + if(arg1){ + arg0[1] += 33.0f; + } + else{ + arg0[1] += 75.0f; + } + } +} + +void banjo_getPosition(f32* dst){ + f32 tmp1[3]; + f32 tmp2[3]; + func_80291A60(5,tmp1); + func_80291A60(6,tmp2); + ml_vec3f_add(dst, tmp1, tmp2); + ml_vec3f_scale(dst, 0.5); +} + +void func_802924B8(f32 arg0[3]){ + func_80291A60(0xA, arg0); +} + +s32 func_802924DC(void){ + return D_8037C0E7; +} + +void func_802924E8(f32 arg0[3]){ + switch(player_getTransformation()){ + case TRANSFORM_5_CROC: + func_80291A60(5, arg0); + break; + case TRANSFORM_4_WALRUS: //L80292520 + func_80291A60(0xB, arg0); + break; + default: //L80292530 + func_80291A60(0x9, arg0); + break; + } +} + +s32 func_80292548(void){ + return D_8037C0E8; +} + +void func_80292554(f32 arg0[3]){ + func_80291A60(0x9, arg0); +} + +void func_80292578(f32 arg0[3]){ + func_80291A60(0xA, arg0); +} + +void func_8029259C(void){ + if(D_80363780){ + D_80363780 = func_8034A348(D_80363780); + } +} diff --git a/src/core2/code_ABC00.c b/src/core2/code_ABC00.c new file mode 100644 index 00000000..0c5a232e --- /dev/null +++ b/src/core2/code_ABC00.c @@ -0,0 +1,34 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/func_80332B90.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/func_80332BB0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/func_80332BEC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/func_80332CCC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/func_80332D98.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/func_80332E08.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/func_80332F4C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/func_8033301C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/jiggySpawn.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/func_803331D8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/func_80333270.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/func_803332D0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/func_80333334.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/func_80333388.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_ABC00/func_803333DC.s") diff --git a/src/core2/code_AC520.c b/src/core2/code_AC520.c new file mode 100644 index 00000000..6bb7fb53 --- /dev/null +++ b/src/core2/code_AC520.c @@ -0,0 +1,276 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern void func_80252CC4(f32[3], f32[3], f32, f32[3]); + +void func_80333918(void); +void func_8033393C(void); + +typedef struct struct_22_s{ + f32 unk0[3]; + f32 unkC[3]; + f32 unk18; + f32 unk1C; + f32 unk20; + f32 unk24; + s32 unk28[3]; + u8 unk34; + u8 pad35[0x3]; +} Struct_core2_AC520_0;//size 0x38 + +extern s32 D_8036F970[3]; + +extern struct { + vector(Struct_core2_AC520_0) *unk0; + Struct_core2_AC520_0 *unk4[0x10]; + Struct_core2_AC520_0 **unk44; + Struct_core2_AC520_0 **unk48; +} D_80383570; + +//.code +extern void func_803334B0(f32 position[3], f32 rotation[3], f32 scale, f32 arg3[3], f32 arg4){ + Struct_core2_AC520_0 * start_ptr; + Struct_core2_AC520_0 * end_ptr; + Struct_core2_AC520_0 * iPtr; + + start_ptr = (Struct_core2_AC520_0 *)vector_getBegin(D_80383570.unk0); + end_ptr = (Struct_core2_AC520_0 *)vector_getEnd(D_80383570.unk0); + mlMtxIdent(); + func_80252CC4(position, rotation, scale, arg3); + D_80383570.unk44 = &D_80383570.unk4; + iPtr = start_ptr; + for(; iPtr < end_ptr && D_80383570.unk44 < D_80383570.unk48; iPtr++){ + if(iPtr->unk34 && ml_vec3f_distance(position, iPtr->unk0) < iPtr->unk1C + arg4){ + func_8025235C(iPtr->unkC, iPtr->unk0); + iPtr->unk20 = iPtr->unk18/scale; + iPtr->unk24 = iPtr->unk1C/scale; + *D_80383570.unk44 = iPtr; + D_80383570.unk44++; + }//L803335B0 + } +} + + +void func_803335F4(void){ + func_80333918(); + func_8033393C(); +} + +s32 func_8033361C(void){ + Struct_core2_AC520_0 *startPtr = vector_getBegin(D_80383570.unk0); + Struct_core2_AC520_0 *endPtr = vector_getEnd(D_80383570.unk0); + Struct_core2_AC520_0 *iPtr; + + for(iPtr = startPtr; iPtr < endPtr; iPtr++){ + if(iPtr->unk34){ + return (iPtr-startPtr) + 1; + } + } + return 0; +} + +s32 func_80333698(s32 index){ + Struct_core2_AC520_0 *startPtr = vector_getBegin(D_80383570.unk0); + Struct_core2_AC520_0 *iPtr = vector_at(D_80383570.unk0, index - 1); + Struct_core2_AC520_0 *endPtr = vector_getEnd(D_80383570.unk0); + + for(++iPtr; iPtr < endPtr; iPtr++){ + if(iPtr->unk34){ + return (iPtr-startPtr) + 1; + } + } + return 0; +} + +void func_80333734(s32 index, f32 *arg1){ + Struct_core2_AC520_0 *v0 = vector_at(D_80383570.unk0, index-1); + arg1[0] = v0->unk0[0]; + arg1[1] = v0->unk0[1]; + arg1[2] = v0->unk0[2]; +} + +void func_80333784(s32 index, f32 *arg1){ + Struct_core2_AC520_0 *v0 = vector_at(D_80383570.unk0, index-1); + arg1[0] = v0->unk18; + arg1[1] = v0->unk1C; +} + +void func_803337C8(s32 index, s32 *arg1){ + Struct_core2_AC520_0 *v0 = vector_at(D_80383570.unk0, index-1); + arg1[0] = v0->unk28[0]; + arg1[1] = v0->unk28[1]; + arg1[2] = v0->unk28[2]; +} + +s32 func_80333818(void){ + return vector_size(D_80383570.unk0); +} + +s32 func_8033383C(void){ + Struct_core2_AC520_0 *beginPtr = vector_getBegin(D_80383570.unk0); + Struct_core2_AC520_0 *endPtr = vector_getEnd(D_80383570.unk0); + Struct_core2_AC520_0 *iPtr; + + for(iPtr = beginPtr; iPtr < endPtr; iPtr++){ + if(!iPtr->unk34) + break; + } + if(iPtr == endPtr) + iPtr = vector_pushBackNew(&D_80383570.unk0); + + iPtr->unk34 = 1; + iPtr->unk28[0] = 0xff; + iPtr->unk28[1] = 0xff; + iPtr->unk28[2] = 0xff; + iPtr->unk0[2] = 0.0f; + iPtr->unk0[1] = 0.0f; + iPtr->unk0[0] = 0.0f; + iPtr->unk18 = 150.0f; + iPtr->unk1C = 300.0f; + return (iPtr - (Struct_core2_AC520_0 *)vector_getBegin(D_80383570.unk0)) + 1; +} + + +void func_80333918(void){ + vector_free(D_80383570.unk0); +} + +void func_8033393C(void){ + D_80383570.unk0 = vector_new(sizeof(Struct_core2_AC520_0), 0x10); + D_80383570.unk48 = &D_80383570.unk44; +} + +void func_80333974(s32 index){ + Struct_core2_AC520_0 *v0 = vector_at(D_80383570.unk0, index-1); + v0->unk34 = 0; +} + +s32 func_803339A4(s32 arg0){ + Struct_core2_AC520_0 *beginPtr = vector_getBegin(D_80383570.unk0); + Struct_core2_AC520_0 *endPtr = vector_getEnd(D_80383570.unk0); + Struct_core2_AC520_0 *iPtr; + Struct_core2_AC520_0 *tmp_s0 = NULL; + + for(iPtr = beginPtr; iPtr < endPtr; iPtr++){ + if(iPtr->unk34){ + if(!tmp_s0 || ml_vec3f_distance(arg0, iPtr) < ml_vec3f_distance(arg0, tmp_s0)){ + tmp_s0 = iPtr; + } + } + } + return (tmp_s0) ? tmp_s0 + 1 - beginPtr : 0; +} + +void func_80333A94(s32 index , f32 *arg1){ + Struct_core2_AC520_0 *v0 = vector_at(D_80383570.unk0, index-1); + v0->unk0[0] = arg1[0]; + v0->unk0[1] = arg1[1]; + v0->unk0[2] = arg1[2]; +} + +void func_80333AE4(s32 index , f32 *arg1){ + Struct_core2_AC520_0 *v0 = vector_at(D_80383570.unk0, index-1); + v0->unk18 = arg1[0]; + v0->unk1C = arg1[1]; +} + +void func_80333B28(s32 index , s32 *arg1){ + Struct_core2_AC520_0 *v0 = vector_at(D_80383570.unk0, index-1); + v0->unk28[0] = arg1[0]; + v0->unk28[1] = arg1[1]; + v0->unk28[2] = arg1[2]; +} + +void func_80333B78(Struct61s *file_ptr){ + f32 sp4C[3]; + f32 sp44[2]; + s32 sp38[3]; + s32 indx; + func_803335F4(); + while(!func_8034AF98(file_ptr, 0)){ + if( func_8034AF98(file_ptr, 1) + && func_8034B108(file_ptr, 2, sp4C, 3) + && func_8034B108(file_ptr, 3, sp44, 2) + && func_8034B190(file_ptr, 4, sp38, 3) + ){ + indx = func_8033383C(); + func_80333A94(indx, sp4C); + func_80333AE4(indx, sp44); + func_80333B28(indx, sp38); + } + } +} + +s32 func_80333C78(s32 arg0){ + Struct_core2_AC520_0 *beginPtr = vector_getBegin(D_80383570.unk0); + Struct_core2_AC520_0 *endPtr = vector_getEnd(D_80383570.unk0); + Struct_core2_AC520_0 *iPtr; + + for(iPtr = beginPtr; iPtr < endPtr; iPtr++){ + if(iPtr->unk34){ + func_8034AF98(arg0, 1); + func_8034B108(arg0, 2, &iPtr->unk0, 3); + func_8034B108(arg0, 3, &iPtr->unk18, 2); + func_8034B190(arg0, 4, &iPtr->unk28, 3); + } + } + + return func_8034AF98(arg0, 0); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AC520/func_80333D48.s") +#else +extern void func_803334B0(f32 position[3], f32 rotation[3], f32 scale, f32[3], f32); +extern f32 func_802EC920(BKVertexList *arg0); + +void func_80333D48(BKVertexList *arg0, f32 position[3], f32 rotation[3], f32 scale, s32 arg4, BKVertexList *arg5) { + Vtx *i_ptr; + Vtx *end_ptr; + Vtx *ref_ptr; + Struct_core2_AC520_0 **struct_ptr_ptr; + f32 sp74[3]; + f32 sp68[3]; + Struct_core2_AC520_0 *struct_ptr; + f32 temp_f0; + s8* tmp; + + func_803334B0(position, rotation, scale, arg4, func_802EC920(arg0)); + if (D_80383570.unk44 == (&D_80383570.unk4[0])) { + vtxList_recolor(arg0, &D_8036F970); + return; + } + ref_ptr = vtxList_getVertices(arg5); + func_802EC8FC(arg0, &i_ptr, &end_ptr); + for(; i_ptr < end_ptr; i_ptr++, ref_ptr++){ + + sp68[0] = sp68[1] = sp68[2] = 0.0f; + sp74[0] = ref_ptr->v.ob[0];\ + sp74[1] = ref_ptr->v.ob[1];\ + sp74[2] = ref_ptr->v.ob[2]; + + for(struct_ptr_ptr = &D_80383570.unk4[0]; struct_ptr_ptr < D_80383570.unk44;struct_ptr_ptr++){ + struct_ptr = *struct_ptr_ptr; + temp_f0 = ml_vec3f_distance(struct_ptr->unkC, sp74); + if (!(struct_ptr->unk24 <= temp_f0)) { + if (temp_f0 <= struct_ptr->unk20) { + sp68[0] = sp68[0] + struct_ptr->unk28[0]; + sp68[1] = sp68[1] + struct_ptr->unk28[1]; + sp68[2] = sp68[2] + struct_ptr->unk28[2]; + } else { + temp_f0 = 1.0f - ((temp_f0 - struct_ptr->unk20) / (struct_ptr->unk24 - struct_ptr->unk20)); + sp68[0] += temp_f0 * struct_ptr->unk28[0]; + sp68[1] += temp_f0 * struct_ptr->unk28[1]; + sp68[2] += temp_f0 * struct_ptr->unk28[2]; + } + } + } + + i_ptr->v.cn[0] = (s8)((ref_ptr->v.cn[0]*sp68[0])/256.0); + i_ptr->v.cn[1] = (s8)((ref_ptr->v.cn[1]*sp68[1])/256.0); + i_ptr->v.cn[2] = (s8)((ref_ptr->v.cn[2]*sp68[2])/256.0); + } +} +#endif; diff --git a/src/core2/code_AD0.c b/src/core2/code_AD0.c new file mode 100644 index 00000000..edd90769 --- /dev/null +++ b/src/core2/code_AD0.c @@ -0,0 +1,156 @@ +#include +#include "functions.h" +#include "variables.h" + + +/* .bss */ +u8 D_80379B90[0x10]; +struct54s D_80379BA0[40]; + +/* .code */ +void func_80287A60(struct54s *arg0){ + arg0->unk4 += arg0->unk0[arg0->unkC_24].unk1*0.03333333333333333*arg0->unk8; +} + +void func_80287ACC(struct54s *arg0){ + arg0->unk4 -= time_getDelta(); + while(arg0->unk4 <= 0.0f){ + arg0->unkC_24++; + if(arg0->unkC_24 >= arg0->unkC_31) + arg0->unkC_24 = 0; + func_80287A60(arg0); + } +} + +void func_80287B84(struct54s *arg0){ + arg0->unk4 -= time_getDelta(); + while(arg0->unk4 <= 0.0f){ + arg0->unkC_24++; + if(arg0->unkC_31 <= arg0->unkC_24){ + arg0->unkC_24--; + arg0->unkC_3 = 3; + } + func_80287A60(arg0); + } +} + +void func_80287C58(void){ + int i; + for(i = 0; i < 40; i++){ + D_80379BA0[i].unkC_0 = 0; + } +} + +struct54s * func_80287CA8(void){ + int i; + for(i = 0; i < 40; i++){ + if(!D_80379BA0[i].unkC_0){ + D_80379BA0[i].unkC_0 = 1; + D_80379BA0[i].unkC_24 = 0; + D_80379BA0[i].unkC_3 = 0; + D_80379BA0[i].unkC_31 = 1; + D_80379BA0[i].unkC_17 = 0; + D_80379BA0[i].unk0 = 0; + D_80379BA0[i].unkC_1 = 1; + D_80379BA0[i].unk4 = 0.0f; + D_80379BA0[i].unk8 = 1.0f; + D_80379BA0[i].unkC_10 = 0; + return &D_80379BA0[i]; + } + } + return NULL; +} + +void func_80287D60(struct54s *arg0){ + arg0->unkC_0 = 0; +} + +void func_80287D70(void){ + int i; + for(i = 0; i < 40; i++){ + if(D_80379BA0[i].unkC_0){ + func_80287D60(&D_80379BA0[i]); + } + } +} + +void func_80287DC8(struct54s *arg0){ + switch(arg0->unkC_3){ + case 0: + break; + case 1: + func_80287B84(arg0); + arg0->unkC_10 = arg0->unk0[arg0->unkC_24].unk0; + break; + case 2: + func_80287ACC(arg0); + arg0->unkC_10 = arg0->unk0[arg0->unkC_24].unk0; + break; + case 3: + break; + } +} + +void func_80287E9C(struct54s *arg0){ + arg0->unkC_24 = 0; + arg0->unk4 = 0.0f; + func_80287F50(arg0, 0, 1); + func_80287FD0(arg0, 1.0f); + func_80287FDC(arg0, 0); + func_80287F7C(arg0, 2); + func_80287F98(arg0, 1); +} + +void func_80287F10(struct54s *arg0){ + arg0->unkC_24 = arg0->unkC_17; + func_80287A60(arg0); +} + +void func_80287F50(struct54s *arg0, struct53s *arg1, s32 arg2){ + arg0->unk0 = arg1; + arg0->unkC_31 = arg2/2; +} + +void func_80287F7C(struct54s *arg0, s32 arg1){ + arg0->unkC_3 = arg1; +} + +void func_80287F98(struct54s *arg0, s32 arg1){ + arg0->unkC_1 = arg1; +} + +void func_80287FB4(struct54s *arg0, s32 arg1){ + arg0->unkC_10 = arg1; +} + +void func_80287FD0(struct54s *arg0, f32 arg1){ + arg0->unk8 = arg1; +} + +void func_80287FDC(struct54s *arg0, s32 arg1){ + arg0->unkC_17 = arg1; +} + +s32 func_80287FFC(struct54s *arg0){ + return arg0->unkC_10; +} + +s32 func_8028800C(struct54s *arg0){ + return arg0->unkC_3; +} + +s32 func_8028801C(struct54s *arg0){ + return arg0->unkC_1; +} + +f32 func_8028802C(struct54s *arg0){ + return arg0->unk8; +} + +int func_80288034(struct54s *arg0){ + return func_8028800C(arg0) == 3; +} + +int func_80288058(struct54s *arg0, s32 arg1){ + return arg0->unkC_24 == arg1; +} diff --git a/src/core2/code_AD110.c b/src/core2/code_AD110.c new file mode 100644 index 00000000..8f442034 --- /dev/null +++ b/src/core2/code_AD110.c @@ -0,0 +1,590 @@ +#include +#include "functions.h" +#include "variables.h" + +//these funtions include references to overlay functions +/* +extern void func_802DC528(s32, s32); +extern void func_802DC560(s32, s32); +extern void func_802DC748(s32, s32); +extern void func_802DC780(s32, s32); +extern void func_802DCD78(s32, s32); +extern void func_802DCDC0(s32, s32); +extern void func_8031D06C(s32, s32); +extern void func_8031D09C(s32, s32); +extern void func_8031D11C(s32, s32); +extern void func_8031D140(s32, s32); +extern void func_8031D164(s32, s32); +extern void func_8031D188(s32, s32); +extern void func_8031D1AC(s32, s32); +extern void func_8031D1D0(s32, s32); +extern void func_8031D1F4(s32, s32); +extern void func_8031DD10(s32, s32); +extern void func_8031DD44(s32, s32); +extern void func_8031DE2C(s32, s32); +extern void func_8031DE50(s32, s32); +extern void func_8031E818(s32, s32); +extern void func_8031E83C(s32, s32); +extern void func_8031E860(s32, s32); +extern void func_8031E884(s32, s32); +extern void func_8031E8A8(s32, s32); +extern void func_8031E8CC(s32, s32); +extern void func_8031E8F0(s32, s32); +extern void func_8031E914(s32, s32); +extern void func_8031E938(s32, s32); +extern void func_8031EA7C(s32, s32); +extern void func_8031EAA0(s32, s32); +extern void func_8031EAC4(s32, s32); +extern void func_8031EAE8(s32, s32); +extern void func_8031EC98(s32, s32); +extern void func_8031ECBC(s32, s32); +extern void func_8031ECE0(s32, s32); +extern void func_8031ED04(s32, s32); +extern void func_8031ED28(s32, s32); +extern void func_8031ED4C(s32, s32); +extern void func_8031ED70(s32, s32); +extern void func_8031ED94(s32, s32); +extern void func_8031EDB8(s32, s32); +extern void func_8031EDDC(s32, s32); +extern void func_8031EE00(s32, s32); +extern void func_8031EE24(s32, s32); +extern void func_8031EEFC(s32, s32); +extern void func_8031EF20(s32, s32); +extern void func_8031EF44(s32, s32); +extern void func_8031EF68(s32, s32); +extern void func_8031EF8C(s32, s32); +extern void func_8031EFB0(s32, s32); +extern void func_8031EFD4(s32, s32); +extern void func_8031EFF8(s32, s32); +extern void func_8031F01C(s32, s32); +extern void func_8031F040(s32, s32); +extern void func_8031F064(s32, s32); +extern void func_8031F088(s32, s32); +extern void func_8031F0AC(s32, s32); +extern void func_8031F13C(s32, s32); +extern void func_8031F160(s32, s32); +extern void func_8031F57C(s32, s32); +extern void func_8031F5A0(s32, s32); +extern void func_80334430(s32, s32); +extern void func_80363388(s32, s32); +extern void func_80386744(s32, s32); +extern void func_80388BEC(s32, s32); +extern void func_80388C00(s32, s32); +extern void func_80388C28(s32, s32); +extern void func_80388C50(s32, s32); +extern void func_80388C78(s32, s32); +extern void func_8038A0E4(s32, s32); +extern void func_8038A150(s32, s32); +extern void func_8038F10C(s32, s32); +extern void func_8038F130(s32, s32); + +extern void func_8031EE48(s32, s32); +extern void func_8031EE6C(s32, s32); +extern void func_8031EE90(s32, s32); +extern void func_8031EED8(s32, s32); +extern void func_8031EEB4(s32, s32); +extern void func_8031EB0C(s32, s32); +extern void func_8031EB30(s32, s32); +extern void func_8031EB54(s32, s32); +extern void func_8031EB78(s32, s32); +extern void func_8031D27C(s32, s32); +extern void func_8031D2F4(s32, s32); +extern void func_8031D2B4(s32, s32); +extern void func_8031D218(s32, s32); +extern void func_8031D23C(s32, s32); +extern void func_8031D334(s32, s32); +extern void func_8031D358(s32, s32); +extern void func_8031D37C(s32, s32); +extern void func_8031D3A0(s32, s32); +extern void func_8031D3C4(s32, s32); +extern void func_8031DCC8(s32, s32); +extern void func_8031DCEC(s32, s32); +extern void func_8031D3E8(s32, s32); +extern void func_8031D40C(s32, s32); +extern void func_8031D430(s32, s32); +extern void func_8031D454(s32, s32); +extern void func_8031D478(s32, s32); +extern void func_8031D49C(s32, s32); +extern void func_8031D4C0(s32, s32); +extern void func_8031D4E4(s32, s32); +extern void func_8031D628(s32, s32); +extern void func_8031D508(s32, s32); +extern void func_8031D52C(s32, s32); +extern void func_8031F0D0(s32, s32); +extern void func_8031FAB4(s32, s32); +extern void func_8031D598(s32, s32); +extern void func_8031D5BC(s32, s32); +extern void func_8031FA6C(s32, s32); +extern void func_8031FA90(s32, s32); +extern void func_8031D670(s32, s32); +extern void func_8031D694(s32, s32); +extern void func_8031D6B8(s32, s32); +extern void func_8031D6DC(s32, s32); +extern void func_8031DAE0(s32, s32); +extern void func_8031DA84(s32, s32); +extern void func_8031DC10(s32, s32); +extern void func_8031DC68(s32, s32); +extern void func_8031D700(s32, s32); +extern void func_8031D724(s32, s32); +extern void func_8031D748(s32, s32); +extern void func_8031D76C(s32, s32); +extern void func_8031D790(s32, s32); +extern void func_8031D7B4(s32, s32); +extern void func_8031D7D8(s32, s32); +extern void func_8031D7FC(s32, s32); +extern void func_8031D820(s32, s32); +extern void func_8031D844(s32, s32); +extern void func_8031D868(s32, s32); +extern void func_8031D88C(s32, s32); +extern void func_8031D8B0(s32, s32); +extern void func_8031D8D4(s32, s32); +extern void func_8031D8F8(s32, s32); +extern void func_8031D91C(s32, s32); +extern void func_8031D940(s32, s32); +extern void func_8031D964(s32, s32); +extern void func_8031D988(s32, s32); +extern void func_8031D9AC(s32, s32); +extern void func_8031D9D0(s32, s32); +extern void func_8031D9F4(s32, s32); +extern void func_8031DA18(s32, s32); +extern void func_8031DA3C(s32, s32); +extern void func_8031DA60(s32, s32); +extern void func_8031DB88(s32, s32); +extern void func_8031DD78(s32, s32); +extern void func_8031DD9C(s32, s32); +extern void func_8031DDC0(s32, s32); +extern void func_8031DDE4(s32, s32); +extern void func_8031DE08(s32, s32); +extern void func_8031DE74(s32, s32); +extern void func_8031DE98(s32, s32); +extern void func_8031DEBC(s32, s32); +extern void func_8031DF04(s32, s32); +extern void func_8031DF28(s32, s32); +extern void func_8031DF4C(s32, s32); +extern void func_8031DEE0(s32, s32); +extern void func_8031DF70(s32, s32); +extern void func_8031DF94(s32, s32); +extern void func_8031DFB8(s32, s32); +extern void func_8031DFDC(s32, s32); +extern void func_8031E000(s32, s32); +extern void func_8031E024(s32, s32); +extern void func_8031E048(s32, s32); +extern void func_8031E06C(s32, s32); +extern void func_8031E090(s32, s32); +extern void func_8031E0B4(s32, s32); +extern void func_8031E0D8(s32, s32); +extern void func_8031E0FC(s32, s32); +extern void func_8031E120(s32, s32); +extern void func_8031E144(s32, s32); +extern void func_8031E168(s32, s32); +extern void func_8031E18C(s32, s32); +extern void func_8031E1B0(s32, s32); +extern void func_8031E1D4(s32, s32); +extern void func_8031E2B8(s32, s32); +extern void func_8031E2E0(s32, s32); +extern void func_8031E308(s32, s32); +extern void func_8031E32C(s32, s32); +extern void func_8031E350(s32, s32); +extern void func_8031E374(s32, s32); +extern void func_8031E398(s32, s32); +extern void func_8031E3BC(s32, s32); +extern void func_8031E3E0(s32, s32); +extern void func_8031E404(s32, s32); +extern void func_8031E428(s32, s32); +extern void func_8031E44C(s32, s32); +extern void func_8031E470(s32, s32); +extern void func_8031E494(s32, s32); +extern void func_8031E4B8(s32, s32); +extern void func_8031E4DC(s32, s32); +extern void func_8031E500(s32, s32); +extern void func_8031E524(s32, s32); +extern void func_8031E548(s32, s32); +extern void func_8031E56C(s32, s32); +extern void func_8031E590(s32, s32); +extern void func_8031E5B4(s32, s32); +extern void func_8031E5D8(s32, s32); +extern void func_8031E5FC(s32, s32); +extern void func_8031E620(s32, s32); +extern void func_8031E644(s32, s32); +extern void func_8031E668(s32, s32); +extern void func_8031E68C(s32, s32); +extern void func_8031E6B0(s32, s32); +extern void func_8031E6D4(s32, s32); +extern void func_8031E6F8(s32, s32); +extern void func_8031E71C(s32, s32); +extern void func_8031E740(s32, s32); +extern void func_8031E764(s32, s32); +extern void func_8031E788(s32, s32); +extern void func_8031E7AC(s32, s32); +extern void func_8031E7D0(s32, s32); +extern void func_8031E7F4(s32, s32); +extern void func_8031E9EC(s32, s32); +extern void func_8031EA10(s32, s32); +extern void func_8031EA34(s32, s32); +extern void func_8031EA58(s32, s32); +extern void func_8031E95C(s32, s32); +extern void func_8031E980(s32, s32); +extern void func_8031E9A4(s32, s32); +extern void func_8031E9C8(s32, s32); +extern void func_8031EB9C(s32, s32); +extern void func_8031EBC0(s32, s32); +extern void func_8031EBE4(s32, s32); +extern void func_8031EC08(s32, s32); +extern void func_8031EC2C(s32, s32); +extern void func_8031EC50(s32, s32); +extern void func_8031EC74(s32, s32); +extern void func_8031F0F4(s32, s32); +extern void func_8031F118(s32, s32); +extern void func_8031F184(s32, s32); +extern void func_8031FA00(s32, s32); +extern void func_8031F558(s32, s32); +extern void func_8031F314(s32, s32); +extern void func_8031F2CC(s32, s32); +extern void func_8031F2F0(s32, s32); +extern void func_8031F25C(s32, s32); +extern void func_8031F294(s32, s32); +extern void func_8031F214(s32, s32); +extern void func_8031F238(s32, s32); +extern void func_8031F1A8(s32, s32); +extern void func_8031F1CC(s32, s32); +extern void func_8031F1F0(s32, s32); +extern void func_8031F338(s32, s32); +extern void func_8031F35C(s32, s32); +extern void func_8031F380(s32, s32); +extern void func_8031F3A4(s32, s32); +extern void func_8031F3C8(s32, s32); +extern void func_8031F3EC(s32, s32); +extern void func_8031F410(s32, s32); +extern void func_8031F520(s32, s32); +extern void func_8031F4E8(s32, s32); +extern void func_8031F434(s32, s32); +extern void func_8031F458(s32, s32); +extern void func_8031F47C(s32, s32); +extern void func_8031F4A0(s32, s32); +extern void func_8031F4C4(s32, s32); +extern void func_8031F5C4(s32, s32); +extern void func_8031F5E8(s32, s32); +extern void func_8031FB6C(s32, s32); +extern void func_8031F60C(s32, s32); +extern void func_8031F630(s32, s32); +extern void func_8031F654(s32, s32); +extern void func_8031F678(s32, s32); +extern void func_8031F69C(s32, s32); +extern void func_8031F6C0(s32, s32); +extern void func_8031F6E4(s32, s32); +extern void func_8031F708(s32, s32); +extern void func_8031F72C(s32, s32); +extern void func_8031F764(s32, s32); +extern void func_8031F79C(s32, s32); +extern void func_8031F7D4(s32, s32); +extern void func_8031F878(s32, s32); +extern void func_8031F8C0(s32, s32); +extern void func_8031F8E4(s32, s32); +extern void func_8031F908(s32, s32); +extern void func_8031F92C(s32, s32); +extern void func_8031F950(s32, s32); +extern void func_8031F974(s32, s32); +extern void func_8031F998(s32, s32); +extern void func_8031F9BC(s32, s32); +extern void func_8031FA24(s32, s32); +extern void func_8031FA48(s32, s32); +extern void func_8031FB14(s32, s32); + +extern void func_802C1674(s32, s32); +extern void func_802C169C(s32, s32); +extern void func_80389BFC(s32, s32); +extern void func_80389C24(s32, s32); +extern void func_80389C4C(s32, s32); +extern void func_80389C74(s32, s32); +extern void func_80389C9C(s32, s32); +extern void func_80389CC4(s32, s32); +extern void func_802D2B94(s32, s32); +extern void func_802D2C24(s32, s32); +extern void func_8033443C(s32, s32); +*/ + +typedef struct { + f32 unk0[3]; + f32 unkC[3]; + f32 unk18; + u8 unk1C; + u8 pad1D[3]; +}Struct_core2_AD110_0; + +typedef void (*Method_core2_AD110)(s32, s32); + +/* .data */ +Method_core2_AD110 D_8036F980[]; /*= { + func_80388BEC, func_80334430, func_80386744, func_80386744, + func_80386744, func_8031DE2C, func_8031DE50, func_8038F10C, + func_8038F130, func_8031E83C, func_8031E818, func_8031E938, + func_8031E860, func_8031E884, func_8031E8A8, func_8031E8CC, + func_8031E8F0, func_8031E914, func_8031EA7C, func_8031EAA0, + func_8031EAC4, func_8031EAE8, func_8031D11C, func_8031D140, + func_8031D164, func_8031D188, func_8031D1AC, func_8031D1D0, + func_8031D1F4, func_8031D09C, func_8031D06C, func_80334430, + func_80334430, func_80334430, func_8031F13C, func_8031F160, + func_8031F0AC, func_8031F088, func_8031F064, func_8031F01C, + func_8031F040, func_8031EC98, func_8031ECBC, func_8031ECE0, + func_8031ED04, func_8031ED28, func_8031ED4C, func_80388C00, + func_80388C28, func_80388C50, func_80388C78, func_80334430, + func_80334430, func_80334430, func_802DC748, func_802DC780, + func_8031F57C, func_8031F5A0, func_8031EFD4, func_8031EFF8, + func_8031EF8C, func_8031EFB0, func_8031EF68, func_8031EF44, + func_8031ED70, func_8031ED94, func_8031EDB8, func_8031EDDC, + func_8031EE00, func_8031EE24, func_8031DD10, func_8031DD44, + func_80363388, func_8038A0E4, func_8038A150, func_80334430, + func_802DCD78, func_802DCDC0, func_802DC528, func_802DC560, + func_8031EF20, func_8031EEFC, func_80334430, func_8031EED8, + func_8031EEB4, func_8031EE90, func_8031EE6C, func_8031EE48, + func_8031EB0C, func_8031EB30, func_8031EB54, func_8031EB78, + func_8031D27C, func_8031D2F4, func_8031D2B4, func_8031D218, + func_8031D23C, func_8031D334, func_8031D358, func_8031D37C, + func_8031D3A0, func_8031D3C4, func_8031DCC8, func_8031DCEC, + func_8031D3E8, func_8031D40C, func_8031D430, func_8031D454, + func_8031D478, func_8031D49C, func_8031D4C0, func_8031D4E4, + func_8031D628, func_8031D508, func_8031D52C, func_8031F0D0, + func_8031FAB4, func_8031D598, func_8031D5BC, func_8031FA6C, + func_8031FA90, func_8031D670, func_8031D694, func_8031D6B8, + func_8031D6DC, func_8031DAE0, func_8031DA84, func_8031DC10, + func_8031DC68, func_8031D700, func_8031D724, func_8031D748, + func_8031D76C, func_8031D790, func_8031D7B4, func_8031D7D8, + func_8031D7FC, func_8031D820, func_8031D844, func_8031D868, + func_8031D88C, func_8031D8B0, func_8031D8D4, func_8031D8F8, + func_8031D91C, func_8031D940, func_8031D964, func_8031D988, + func_8031D9AC, func_8031D9D0, func_8031D9F4, func_8031DA18, + func_8031DA3C, func_8031DA60, func_8031DB88, func_8031DD78, + func_8031DD9C, func_8031DDC0, func_8031DDE4, func_8031DE08, + func_8031DE74, func_8031DE98, func_8031DEBC, func_8031DF04, + func_8031DF28, func_8031DF4C, func_8031DEE0, func_8031DF70, + func_8031DF94, func_8031DFB8, func_8031DFDC, func_8031E000, + func_8031E024, func_8031E048, func_8031E06C, func_8031E090, + func_8031E0B4, func_8031E0D8, func_8031E0FC, func_8031E120, + func_8031E144, func_8031E168, func_8031E18C, func_8031E1B0, + func_8031E1D4, func_8031E2B8, func_8031E2E0, func_8031E308, + func_8031E32C, func_8031E350, func_8031E374, func_8031E398, + func_8031E3BC, func_8031E3E0, func_8031E404, func_8031E428, + func_8031E44C, func_8031E470, func_8031E494, func_8031E4B8, + func_8031E4DC, func_8031E500, func_8031E524, func_8031E548, + func_8031E56C, func_8031E590, func_8031E5B4, func_8031E5D8, + func_8031E5FC, func_8031E620, func_8031E644, func_8031E668, + func_8031E68C, func_8031E6B0, func_8031E6D4, func_8031E6F8, + func_8031E71C, func_8031E740, func_8031E764, func_8031E788, + func_8031E7AC, func_8031E7D0, func_8031E7F4, func_8031E9EC, + func_8031EA10, func_8031EA34, func_8031EA58, func_8031E95C, + func_8031E980, func_8031E9A4, func_8031E9C8, func_8031EB9C, + func_8031EBC0, func_8031EBE4, func_80334430, func_8031EC08, + func_8031EC2C, func_8031EC50, func_8031EC74, func_8031F0F4, + func_8031F118, func_8031F184, func_80334430, func_80334430, + func_80334430, func_80334430, func_80334430, func_80334430, + func_80334430, func_8031FA00, func_8031F558, func_8031F314, + func_8031F2CC, func_8031F2F0, func_8031F25C, func_8031F294, + func_8031F214, func_8031F238, func_8031F1A8, func_8031F1CC, + func_8031F1F0, func_8031F338, func_8031F35C, func_8031F380, + func_8031F3A4, func_8031F3C8, func_8031F3EC, func_8031F410, + func_8031F520, func_8031F4E8, func_8031F434, func_8031F458, + func_8031F47C, func_8031F4A0, func_8031F4C4, func_8031F5C4, + func_8031F5E8, func_8031FB6C, func_8031F60C, func_8031F630, + func_8031F654, func_8031F678, func_8031F69C, func_8031F6C0, + func_8031F6E4, func_8031F708, func_8031F72C, func_8031F764, + func_8031F79C, func_8031F7D4, func_8031F878, func_8031F8C0, + func_8031F8E4, func_8031F908, func_8031F92C, func_8031F950, + func_8031F974, func_8031F998, func_8031F9BC, func_8031FA24, + func_8031FA48, func_8031FB14, func_80334430, func_80334430, + func_80334430, func_80334430, func_80334430, func_80334430, + func_80334430, func_80334430, func_80334430, +};*/ + +Method_core2_AD110 D_8036FE5C[]; /* ={ + func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_802C169C, func_802C169C, func_802C169C, + func_802C169C, func_802C169C, func_802C169C, func_802C169C, + func_802C169C, func_802C169C, func_802C169C, func_802C169C, + func_802C169C, func_802C169C, func_802C169C, func_802C169C, + func_802C169C, func_802C169C, func_802C169C, func_802C169C, + func_802C169C, func_802C1674, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_80389BFC, func_80389C24, func_80389C4C, + func_80389C74, func_80389C9C, func_80389CC4, func_802D2B94, + func_802D2C24, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C, func_8033443C, func_8033443C, + func_8033443C, func_8033443C +}; +*/ + +/* .bss */ +vector(Struct_core2_AD110_0) *D_803835C0; + +/* .code */ +bool func_803340A0(f32 arg0[3], f32 arg1[3], f32 arg2) { + f32 sp4C[3]; + f32 sp40[3]; + Struct_core2_AD110_0 *begin_ptr; + Struct_core2_AD110_0 *i_ptr; + Struct_core2_AD110_0 *end_ptr; + s32 i; + + for(i = 0; i < 3; i++){ + if (arg0[i] <= arg1[i]) { + sp4C[i] = arg0[i] - arg2; + sp40[i] = arg1[i] + arg2; + } else { + sp4C[i] = arg1[i] - arg2; + sp40[i] = arg0[i] + arg2; + } + } + + end_ptr = (Struct_core2_AD110_0 *)vector_getEnd(D_803835C0); + begin_ptr = (Struct_core2_AD110_0 *)vector_getBegin(D_803835C0); + for(i_ptr = begin_ptr; i_ptr < end_ptr; i_ptr++) { + if( (i_ptr->unk1C == 1) + && ((!((i_ptr->unk0[0] + i_ptr->unk18) <= sp4C[0])) || !((i_ptr->unkC[0] + i_ptr->unk18) <= sp4C[0])) + && ((!((i_ptr->unk0[1] + i_ptr->unk18) <= sp4C[1])) || !((i_ptr->unkC[1] + i_ptr->unk18) <= sp4C[1])) + && ((!((i_ptr->unk0[2] + i_ptr->unk18) <= sp4C[2])) || !((i_ptr->unkC[2] + i_ptr->unk18) <= sp4C[2])) + && (!(sp40[0] <= (i_ptr->unk0[0] - i_ptr->unk18)) || !(sp40[0] <= (i_ptr->unkC[0] - i_ptr->unk18))) + && (!(sp40[1] <= (i_ptr->unk0[1] - i_ptr->unk18)) || !(sp40[1] <= (i_ptr->unkC[1] - i_ptr->unk18))) + && (!(sp40[2] <= (i_ptr->unk0[2] - i_ptr->unk18)) || !(sp40[2] <= (i_ptr->unkC[2] - i_ptr->unk18)))) { + return FALSE; + } + } + return TRUE; +} + +s32 func_803342AC(f32 arg0[3], f32 arg1[3], f32 arg2){ + Struct_core2_AD110_0 * iPtr; + Struct_core2_AD110_0 * end_ptr; + + if(!func_803340A0(arg0, arg1, arg2)) + return 0; + + end_ptr = (Struct_core2_AD110_0 *)vector_getEnd(D_803835C0); + for(iPtr = (Struct_core2_AD110_0 *)vector_getBegin(D_803835C0); iPtr < end_ptr; iPtr++){ + if(iPtr->unk1C == 0) + break; + } + if(iPtr == end_ptr){ + iPtr = (Struct_core2_AD110_0 *)vector_pushBackNew(&D_803835C0); + } + iPtr->unk1C = 1; + + iPtr->unk0[0] = arg0[0]; + iPtr->unk0[1] = arg0[1]; + iPtr->unk0[2] = arg0[2]; + + iPtr->unkC[0] = arg1[0]; + iPtr->unkC[1] = arg1[1]; + iPtr->unkC[2] = arg1[2]; + + iPtr->unk18 = arg2; + return (iPtr - (Struct_core2_AD110_0 *)vector_getBegin(D_803835C0)) + 1; +} + + +void func_803343AC(void){ + vector_free(D_803835C0); +} + +void func_803343D0(void){ + D_803835C0 = vector_new(sizeof(Struct_core2_AD110_0), 2); +} + +void func_803343F8(s32 indx){ + Struct_core2_AD110_0 *elem; + elem = (Struct_core2_AD110_0 *)vector_at(D_803835C0, indx - 1); + elem->unk1C = 0; +} + +void func_80334428(void){} + +void func_80334430(s32 arg0, s32 arg1){} + +void func_8033443C(s32 arg0, s32 arg1){} + +void func_80334448(s32 arg0, s32 arg1) { + s32 sp24; + + switch(func_80330F7C()) { + case 3: //L80334480 + sp24 = func_8023DB5C(); + if ((func_80330FC4(arg0) + 1) != sp24) { + D_8036F980[func_80330F8C(arg0)](arg0, arg1); + } + func_80330FBC(arg0, sp24); + break; + + case 4: //L803344E0 + D_8036FE5C[func_80330F8C(arg0)](arg0, arg1); + break; + + case 0: //L80334508 + case 1: //L80334508 + case 2: //L80334508 + case 5: //L80334508 + break; + + } +} + + +s32 func_8033451C(s32 arg0){ + return arg0 - 0x16; +} + +s32 func_80334524(s32 arg0){ + return arg0 + 0xcc; +} + +s32 func_8033452C(s32 arg0){ + return arg0 + 0x19d; +} diff --git a/src/core2/code_AD5B0.c b/src/core2/code_AD5B0.c new file mode 100644 index 00000000..e3cf0e97 --- /dev/null +++ b/src/core2/code_AD5B0.c @@ -0,0 +1,397 @@ +#include +#include "functions.h" +#include "variables.h" + +extern u8 D_80370250; +extern struct { + s32 unk0; + s32 map_4; + s32 unk8; +}D_803835D0; +extern s32 D_803835DC; +extern u32 D_803835E0; + +void func_80335110(s32); +void func_80335128(s32); +void func_8024CE60(f32, f32); +void func_80335140(enum map_e); +void func_8033520C(s32); + +void func_80334540(Gfx** gdl, Mtx **mptr, Vtx **vptr) { + f32 sp44; + f32 sp40; + + if (D_803835E0 == 0) { + func_80254084(gdl, 0, 0, D_80276588, D_8027658C, 0, 0, 0); + func_802BBD2C(&sp44, &sp40); + func_8024CE60(sp44, sp40); + func_8024C904(gdl, mptr); + return; + } + if (func_80320708() == 0) { + write_file_blocks(0, 0, 0x80BC7230, EEPROM_MAXBLOCKS); + } + func_802C3BDC(); + func_8030B0AC(gdl, mptr, vptr); + func_802BBD2C(&sp44, &sp40); + func_8024CE60(sp44, sp40); + func_8024C904(gdl, mptr); + if (func_80309F78() != 0) { + func_803091D4(gdl, mptr, vptr); + if (func_802E49F0() == 0) { + func_80322E64(gdl, mptr, vptr); + } + if (func_802E49F0() == 0) { + func_8028E6A4(gdl, mptr, vptr); + } + if (func_802E49F0() == 0) { + func_80302C94(gdl, mptr, vptr); + } + if (func_802E49F0() == 0) { + func_80332F4C(gdl, mptr, vptr); + } + if (func_802E49F0() == 0) { + func_803500D8(gdl, mptr, vptr); + } + if (func_802E49F0() == 0) { + func_802F2ED0(func_8032994C(), gdl, mptr, vptr); + } + if (func_802E49F0() == 0) { + func_802F0A34(gdl, mptr, vptr); + } + if (func_802E49F0() == 0) { + func_80309628(gdl, mptr, vptr); + } + if (func_802E49F0() == 0) { + func_8032D3D8(gdl, mptr, vptr); + } + if (func_802E49F0() == 0) { + func_802F0AE8(gdl, mptr, vptr); + } + if (func_802E49F0() == 0) { + func_8034F6F0(gdl, mptr, vptr); + } + func_802D520C(gdl, mptr, vptr); + } else { + func_803091D4(gdl, mptr, vptr); + func_80322E64(gdl, mptr, vptr); + func_8034F6F0(gdl, mptr, vptr); + func_8028E6A4(gdl, mptr, vptr); + func_80302C94(gdl, mptr, vptr); + func_8032D3D8(gdl, mptr, vptr); + func_80332F4C(gdl, mptr, vptr); + func_803500D8(gdl, mptr, vptr); + func_802F2ED0(func_8032994C(), gdl, mptr, vptr); + func_802D520C(gdl, mptr, vptr); + func_802F0B98(gdl, mptr, vptr); + } + if (func_802E49F0() == 0) { + func_80350818(gdl, mptr, vptr); + } + if (func_802E49F0() == 0) { + func_802BBD0C(gdl, mptr, vptr); + } + func_802C3BE8(); +} + +void func_803348B0(s32 arg0, s32 arg1, s32 arg2){ +} + +enum map_e map_get(void){ + return D_803835D0.map_4; +} + +s32 func_803348CC(){ + return D_803835D0.unk8; +} + +void func_803348D8(s32 arg0) { + func_802E4078(D_803835D0.map_4, arg0, 1); +} + +s32 func_80334904(){ + return D_803835D0.unk0; +} + +void func_80334E1C(s32); + +void func_80334910(void) { + func_80255A14(); + func_80334E1C(3); + func_8034F734(); + func_803500E8(); + func_80350BC8(); + func_8030F1D0(); + func_8031B2F0();//null + func_80322F7C(); + func_803518E8(); + func_802D48F0(); + func_803224FC(); + func_8028E644(); + func_80322F5C(); + func_80341A54(); + func_802C398C(); + func_802F53D0(); + func_802FAC3C(); + func_802C8F68(); + func_8033E184(); + func_8033FA24(); + func_80344C80(); + func_80287D70(); + animcache_free(); + func_802BC10C(); + func_802B9D80(); + func_802F1388(); + func_802F10A4(); + func_802F0804(); + func_802F7CE0(); + func_8031F9E0(); + func_80323100(); + cubeList_free(); + func_8031B710(); + func_80309FF0(); + func_8030A6B0(); + func_80333918(); + func_8030B284(); + func_8034C8D8(); + func_80323238(); + func_803343AC(); + func_803308A0(); + func_8032AEB4(); + func_8033297C(); + func_803231E8(); + func_80320B7C(); + func_802BAF20(); + func_80305BD4(); + func_80332A38(); + if (func_802E4A08() == 0) { + func_802FAF0C(); + } + func_8031B664(); + func_802986D0(); + if (func_80322914() == 0) { + func_8024F7C4(func_803226E8(D_803835D0.map_4)); + } + func_80244B3C(); + func_80349C8C(); + func_80322FDC(); + func_8033BD6C(); + func_80255198();//heap_flush_free_queue + func_802881AC(); +} + +void func_80334B20(enum map_e arg0, s32 arg1, s32 arg2) { + D_803835D0.unk0 = 3; + D_803835D0.map_4 = arg0; + D_803835D0.unk8 = arg1; + func_80322FE4(); + func_80335110(1); + func_80335128(1); + func_802D2CB8(); + func_80244AB0(); + if (map_get() == MAP_8E_GL_FURNACE_FUN) { + func_8038E7C4(); + } + if (func_80322914() == 0) { + func_8024F764(func_803226E8(D_803835D0.map_4)); + } + func_80320B84(); + func_80349CB0(); + func_8034C97C(); + func_8030A078(); + func_8031B718(); + func_80298700(); + if (func_802E4A08() == 0) { + func_802FAE4C(); + } + func_8031B644(); + func_802C2B10(); + func_803329AC(); + func_80350BFC(); + func_80323190(); + func_80332894(); + func_803305AC(); + func_8031F9E8(); + func_80323230(); + commonParticleType_init(); + animcache_init(); + func_80287C58(); + func_80344C50(); + func_8033F9C0(); + func_802B9D40(); + func_802BC044(); + func_802F07D8(); + func_802F1104(); + func_802F13E0(); + func_802F7D30(); + func_8030A78C(); + func_8033393C(); + func_8030B2EC(); + func_803343D0(); + cubeList_init(); + func_802FA69C(); + func_8033DEA0(); + if (arg2 == 0) { + func_80335140(arg0); + } + func_80305990(0); + func_8030C740(); + func_8030EDE8(); + mapSpecificFlags_clearAll(); + func_803411B0(); + func_802C2B5C(); + func_80322FBC(); + func_8028E4B0(); + func_80322F9C(); + func_80323120(); + func_803223AC(); + func_802C8F40(); + func_8034F774(); + func_80350174(); + func_8031B354(); + func_80351998(); + func_802BC2CC(D_803835D0.unk8); + func_802D63D4(); + func_80255A04(); + func_802D6948(); + if (func_802E4A08() == 0) { + func_802F5188(); + } + if (arg0 != 0x1F) { + func_8024F150(); + } +} + +void func_80334DC0(void) { + func_80334910(); + func_80334B20(D_803835D0.map_4, D_803835D0.unk8, 1); +} + +void func_80334DF8(void) { + func_8033520C(D_803835D0.map_4); +} + +void func_80334E1C(s32 arg0) { + func_80254008(); + func_802BC21C(D_803835D0.unk0, arg0); + func_8028F7F4(D_803835D0.unk0, arg0); + func_8030D8A8(D_803835D0.unk0, arg0); + func_803045CC(D_803835D0.unk0, arg0); + func_80323140(D_803835D0.unk0, arg0); + func_80351A1C(D_803835D0.unk0, arg0); + func_803225B0(D_803835D0.unk0, arg0); + func_80323098(D_803835D0.unk0, arg0); + func_802F0E80(D_803835D0.unk0, arg0); + func_8033EA78(D_803835D0.unk0, arg0); + D_803835D0.unk0 = arg0; +} + +s32 func_80334ECC(void) { + s32 phi_v1; + s32 phi_v0; + + func_80356734(); + func_802D5628(); + func_802FA724(); + if (getGameMode() != 4) { + func_802F7E54(); + } + if (D_803835DC == 0) { + return 1; + } else { + func_802BAF40(); + func_8032AA9C(); + func_80323170(); + func_80351C48(); + func_80330FF4(); + func_8028E71C(); + phi_v0 = func_8023DB5C(); + if (D_80370250) { + phi_v1 = 0xF; + } else { + phi_v1 = 0x1F; + } + if (((phi_v1 & phi_v0) == 3) && (get_loaded_overlay_id() == OVERLAY_5_BEACH)) { + if ((ttc_func_8038BF8C() == 0) || (D_80370250 != 0)) { + D_80370250 = (u8)1; + for (phi_v0 = 0; phi_v0 != 0x8F0D180; phi_v0++){ + } + } + } + func_8033E1E0(); + func_802F11E8(); + func_80288210(); + func_80288834(); + func_802BC14C(); + func_803045D8(); + func_80332E08(); + func_803465E4(); + func_8031B790(); + func_8034C9D4(); + func_8030A850(1); + func_8030B3C8(); + func_802F08A0(); + func_8034F918(); + func_80350250(); + if (mapSpecificFlags_validateCRC1() == 0) { + func_8028FCBC(); + } + func_80349D60(); + func_80350CA4(); + func_8031B65C(); + func_80310D2C(); + func_8031B0B0(); + overlay_update(); + func_80321924(); + func_80334428(); + func_8031C880(); + func_802D2CDC(); + func_803306C8(1); + func_8032AD7C(1); + func_80322490(); + if (map_getLevel(D_803835D0.map_4) == LEVEL_D_CUTSCENE) { + func_802C79C4(); + } + func_8032AABC(); + sns_stub(); + return 1; + } +} + +void func_80335110(s32 arg0){ + D_803835DC = arg0; +} + +s32 func_8033511C(){ + return D_803835DC; +} + +void func_80335128(s32 arg0){ + D_803835E0 = arg0; +} + +s32 func_80335134(){ + return D_803835E0; +} + +void func_80335140(enum map_e map_id) { + Struct61s *fp; + + func_80254008(); + fp = func_8034AB6C(map_id); //LevelSetupFile_Open + while (func_8034AF98(fp, 0) == 0) { + if (func_8034AF98(fp, 2)) { + + } else if (func_8034AF98(fp, 1)) { + cubeList_fromFile(fp); + } else if (func_8034AF98(fp, 3)) { + func_802BA0AC(fp); + } else if (func_8034AF98(fp, 4)) { + func_80333B78(fp); + } + } + func_8034AAB0(fp); //file close +} + +void func_8033520C(s32 arg0){ +} diff --git a/src/core2/code_AE290.c b/src/core2/code_AE290.c new file mode 100644 index 00000000..344db62a --- /dev/null +++ b/src/core2/code_AE290.c @@ -0,0 +1,98 @@ +#include +#include "functions.h" +#include "variables.h" +#include "n_libaudio.h" + +extern ALBank *func_8024F758(void); + +extern struct { + s32 unk0; //sound state cnt + s32 unk4; + s32 unk8; //maxSounds + ALHeap *unkC; //heap + s16 unk10; +} D_803835F0; +extern ALBank * D_80383604; +extern u8 D_D846C0; +extern u8 D_D954B0; + +/* .code */ +void func_80335220(void){ + ALBank *bnk; + s32 size; + ALInstrument *inst; + ALBankFile * bnkf; + + + size = &D_D954B0 - &D_D846C0; + bnkf = (ALBankFile *)malloc(size); + osWritebackDCache(bnkf, size); + osPiStartDma(func_802405D0(), 0, 0, &D_D846C0, bnkf, size, func_802405C4()); + osRecvMesg(func_802405C4(), NULL, 1); + alBnkfNew(bnkf, &D_D954B0); + bnk = bnkf->bankArray[0]; + inst = bnk->instArray[0]; + D_803835F0.unk0 = inst->soundCount; + D_803835F0.unk4 = 0x100; + D_803835F0.unk10 = 0x40; + D_803835F0.unk8 = 0x18; + D_803835F0.unkC = func_802405B8(); + func_80243070(&D_803835F0); + D_80383604 = bnk; +} + +int func_8033531C(enum sfx_e uid, struct46s *arg1){ + return func_80244608(D_80383604, (s16) (uid + 1), arg1); +} + +int func_80335354(int uid, struct46s *arg1){ + return func_80244608(func_8024F758(), (s16) (uid + 1), arg1); +} + +void func_80335394(s32 arg0, f32 arg1){ + func_80244978(arg0, 0x10, reinterpret_cast(s32, arg1)); +} + +void func_803353BC(s32 arg0, u16 arg1){ + if(arg1 > 0x7fff) + arg1 = 0x7fff; + func_80244978(arg0, 0x8, arg1); +} + +void func_803353F4(s32 arg0, s32 arg1){ + func_80244978(arg0, 0x100, arg1); +} + +void func_80335418(s32 arg0, s32 arg1){ + func_80244978(arg0, 0x4, arg1); +} + +void func_8033543C(Struct81s *arg0){ + if(arg0 != NULL && func_802445AC(arg0) != 0){ + func_80244814(arg0); + } +} + +bool func_80335470(Struct81s *arg0){ + return func_802445AC(arg0) != 0; +} + +u32 func_80335494(Struct81s *arg0){ + return func_802445AC(arg0); +} + +s32 func_803354B4(void){ + return D_80383604->instArray[0]->soundCount; +} + +s32 func_803354C8(void){ + return func_8024F758()->instArray[0]->soundCount; +} + +bool func_803354EC(enum sfx_e sfx_id){ + return func_802445C4(D_80383604, (s16)(sfx_id + 1)); +} + +bool func_80335520(s32 arg0){ + return func_802445C4(func_8024F758(), (s16)(arg0 + 1)); +} diff --git a/src/core2/code_AE5D0.c b/src/core2/code_AE5D0.c new file mode 100644 index 00000000..3329fa91 --- /dev/null +++ b/src/core2/code_AE5D0.c @@ -0,0 +1,272 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "animation.h" + +extern void func_8033AA50(void *, f32, s32); +extern void func_8033A750(s32, s32, s32, f32); + +/* .code */ +void func_80335560(Struct80s *self){ + if(self->unk0 != NULL){ + func_8033A6F0(self->unk0); + self->unk0 = NULL; + } + + if(self->unk4 != NULL){ + assetcache_release(self->unk4); + self->unk4 = NULL; + } + + if(self->unk24 != NULL){ + func_8033A6F0(self->unk24); + self->unk24 = NULL; + } + + if(self->unk28 != NULL){ + func_8033A6F0(self->unk28); + self->unk28 = NULL; + } + + self->unk2C = 0.0f; +} + +void func_803355F8(Struct7Fs* arg0){ + if(arg0->unk4 == 0){ + ((void(*)(void))(arg0->unk8))(); + } + else if(arg0->unk4 == 1){ + ((void(*)(s32))(arg0->unk8))(arg0->unkC); + } +} + +void func_80335650(Struct80s *self){ + if(self->unk10 != NULL){ + vector_clear(self->unk10); + } +} + +enum asset_e func_8033567C(Struct80s *self){ + return self->unk16; +} + +f32 func_80335684(Struct80s *self){ + return self->unk8; +} + +void func_8033568C(Struct80s *self, f32 *arg1, f32 *arg2){ + *arg1 = self->unk1C; + *arg2 = self->unk8; +} + +s32 func_803356A0(Struct80s *self){ + self->unk14 = 0; + if(self->unk0 == 0){ + self->unk0 = func_8033A710(); + } + + if(self->unk30 != 0){ + self->unk30 = 0; + return self->unk0; + } + + if(self->unk16 == 0){ + return self->unk0; + } + + if(self->unk4 == NULL){ + self->unk4 = (AnimationFile *)assetcache_get(self->unk16); + } + + if(0.0f == self->unk2C){ + func_8033AA50(self->unk4, self->unk8, self->unk0); + return self->unk0; + } + + if(self->unk28 == 0){ + self->unk28 = func_8033A710(); + } + func_8033AA50(self->unk4, self->unk8, self->unk28); + func_8033A750(self->unk0, self->unk24, self->unk28, self->unk20); + return self->unk0; +} + +s32 func_80335794(Struct80s *self){ + return self->unk18; +} + +void func_8033579C(Struct80s *self, f32 arg1, void(*arg2)(void)){ + Struct7Fs *ptr; + if(self->unk10 == NULL){ + self->unk10 = vector_new(sizeof(Struct7Fs), 8); + } + ptr = (Struct7Fs *)vector_pushBackNew(&self->unk10); + ptr->unk0 = arg1; + ptr->unk4 = 0; + ptr->unk8 = arg2; + ptr->unkC = 0; +} + +void func_80335800(Struct80s *self, f32 arg1, void(*arg2)(ActorMarker *), ActorMarker *arg3){ + Struct7Fs *ptr; + if(self->unk10 == NULL){ + self->unk10 = vector_new(sizeof(Struct7Fs), 8); + } + ptr = (Struct7Fs *)vector_pushBackNew(&self->unk10); + ptr->unk0 = arg1; + ptr->unk4 = 1; + ptr->unk8 = arg2; + ptr->unkC = arg3; +} + +void func_80335874(Struct80s *self){ + VLA * temp_a0; + func_80335560(self); + temp_a0 = self->unk10; + if(temp_a0 != NULL){ + vector_free(temp_a0); + } + free(self); +} + +Struct80s *func_803358B4(void){ + Struct80s *self; + + self = (Struct80s *)malloc(sizeof(Struct80s)); + self->unk0 = 0; + self->unk4 = NULL; + self->unk10 = 0; + self->unk14 = 0; + self->unk15 = 1; + self->unk18 = 0; + self->unk16 = 0; + self->unk30 = 0; + self->unk24 = 0; + self->unk28 = 0; + self->unk8 = 0.0f; + self->unkC = 0.0f; + self->unk1C = 0.0f; + self->unk20 = 0.0f; + self->unk2C = 0.0f; + + return self; +} + +void func_80335918(Struct80s *self){ + self->unk30 = 1; +} + +void func_80335924(Struct80s *self, enum asset_e anim_id, f32 arg2, f32 arg3){ + if(self->unk4 != NULL && anim_id != self->unk16){ + assetcache_release(self->unk4); + self->unk4 = NULL; + } + + if(self->unk10 != NULL && anim_id != self->unk16){ + vector_free(self->unk10); + self->unk10 = NULL; + } + + self->unk8 = 0.0f; + self->unkC = arg3; + self->unk18 = 0; + self->unk16 = anim_id; + self->unk1C = 0.0f; + self->unk20 = 0.0f; + self->unk2C = arg2; + if(0.0f < arg2){ + if(self->unk0 != 0 ){ + s32 tmp; + tmp = self->unk24; + self->unk24 = self->unk0; + self->unk0 = tmp; + if(self->unk28 != 0){ + func_8033A510(self->unk28); + } + } else { + self->unk2C = 0.0f; + } + } +} + +void func_80335A24(Struct80s *self, enum asset_e anim_id, f32 arg2, f32 arg3){ + f32 sp1C; + sp1C = func_80335684(self); + func_80335924(self, anim_id, arg2, arg3); + func_80335A74(self, sp1C); +} + +void func_80335A74(Struct80s *self, f32 arg1){ + self->unk8 = arg1; +} + +void func_80335A80(Struct80s *self, f32 arg1){ + self->unkC = arg1; +} + +void func_80335A8C(Struct80s *self, s32 arg1){ + self->unk15 = arg1; +} + +void func_80335A94(Struct80s *self, f32 arg1, s32 arg2) { + f32 pad2C; + Struct7Fs *begin_ptr; + Struct7Fs *end_ptr; + Struct7Fs *i_ptr; + + if (arg2 == 0) { + if (self->unk14 < 10) { + self->unk14++; + if (self->unk14 == 0xA) { + func_80335560(self); + } + } + } + if (self->unk16 != 0) { + self->unk1C = self->unk8; + if ( self->unkC > 0.0f) { + if (self->unk15 == 1) { + self->unk8 += arg1 / self->unkC; + while (self->unk8 >= 1.0f) { + self->unk8 -= 1.0f; + self->unk18++; + } + } else if ((self->unk15 == 2) && (self->unk18 == 0)) { + self->unk8 += (arg1 / self->unkC); + if (self->unk8 >= 1.0f) { + self->unk8 = 0.99999f; + self->unk18++; + } + } else if ((self->unk15 == 3) && (self->unk8 > 0.0f)) { + self->unk8 -= (arg1 / self->unkC); + if (self->unk8 < 0.0f) { + self->unk8 = 0.0f; + } + } + } + + if (self->unk10 != NULL) { + begin_ptr = vector_getBegin(self->unk10); + end_ptr = vector_getEnd(self->unk10); + for(i_ptr = begin_ptr; i_ptr < end_ptr; i_ptr++) { + if (((self->unk1C < i_ptr->unk0) || (self->unk8 < self->unk1C)) && ( i_ptr->unk0 <= self->unk8)) { + func_803355F8(i_ptr); + } + } + } + if (self->unk2C > 0.0f) { + if (self->unk20 < 1.0f) { + self->unk20 += arg1 / self->unk2C; + if (self->unk20 >= 1.0f) { + self->unk20 = 1.0f; + } + } else { + self->unk2C = 0.0f; + if (self->unk0 != 0) { + func_8033A510(self->unk0); + } + } + } + } +} diff --git a/src/core2/code_AEDA0.c b/src/core2/code_AEDA0.c new file mode 100644 index 00000000..cc295ea8 --- /dev/null +++ b/src/core2/code_AEDA0.c @@ -0,0 +1,312 @@ +#include +#include "functions.h" +#include "variables.h" + +extern u8 D_80370338[]; + +extern u32 D_80383634; +extern u32 D_80383638; +extern s32 D_8038363C; +extern s32 D_80383640; +extern s32 D_80383644; + +/* .code */ +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AEDA0/func_80335D30.s") + +void func_8033687C( Gfx **gfx ) + { + /* Turn off texturing */ + gDPPipeSync((*gfx)++); + if (D_80370338[0] == 0) { + gDPSetColorDither((*gfx)++, 0); + D_80370338[0] = 1; + } + + if(D_80383634 == 0x0E){ + gDPSetAlphaCompare((*gfx)++, G_AC_NONE); + } + } + +void func_80336904(Gfx **gfx, Vtx **vtx, BKSprite *sp, u32 frame){ + func_80336924(gfx, vtx, sp, frame, 0); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AEDA0/func_80336924.s") +/*func_80336924(Gfx **gfx, Vtx **vtx, BKSprite *sp, u32 frame, u32 segment){ + u32 chkDataSize_1C0; + s32 i_1BC; + Gfx *sp1B4; + Vtx *sp1B0; + void *sp1A8; + BKSpriteFrame *framePtr_18c; + Vtx *sp184; + + s32 sp48; + s32 sp44; + + s32 sp_type; + BKSpriteTextureBlock *chunkPtr; + u32 chunk_block; + u32 chunkSize; + u16* palPtr; + s32 s2; + sp184 = *vtx; + + func_80349AD0(); + + if (sp->type & SPRITE_TYPE_CI4) { + chkDataSize_1C0 = 1; + } else if (sp->type & SPRITE_TYPE_CI8) { + chkDataSize_1C0 = 2; + } else if (sp->type & 0x40){ + chkDataSize_1C0 = 2; + } else if (sp->type & 0x100){ + chkDataSize_1C0 = 2; + } else if (sp->type & SPRITE_TYPE_RGBA16) { + chkDataSize_1C0 = 4; + } else if (sp->type & SPRITE_TYPE_RGBA32){ + chkDataSize_1C0 = 8; + } + + func_80335D30(gfx); + if(D_80383638 || (sp->type & SPRITE_TYPE_CI8)){ + gDPPipelineMode((*gfx)++, G_PM_1PRIMITIVE); + } + + framePtr_18c = spriteGetFramePtr(sp, frame); + + // //load Palettes for CI4 and CI8 + chunkPtr = ((u32) (framePtr_18c + 1)); + if (sp->type & SPRITE_TYPE_CI4) { //CI4 + gDPSetTextureLUT((*gfx)++, G_TT_RGBA16); + gDPSetTextureImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, chunkPtr = (u32)chunkPtr & -8); + gDPTileSync((*gfx)++); + gDPSetTile((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 0x0100, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + // sp1d0 = sp; + gDPLoadSync((*gfx)++); + gDPLoadTLUTCmd((*gfx)++, G_TX_LOADTILE, 15); + gDPPipeSync((*gfx)++); + chunkPtr = (u32) chunkPtr + 0x10 * sizeof(u16); + } else if (sp->type & SPRITE_TYPE_CI8) {//CI8 + // //L80336B28 + gDPSetTextureLUT((*gfx)++, G_TT_RGBA16); + gDPSetTextureImage((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, chunkPtr = (u32)chunkPtr & -8); + gDPTileSync((*gfx)++); + gDPSetTile((*gfx)++, G_IM_FMT_RGBA, G_IM_SIZ_4b, 0, 0x0100, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); + gDPLoadSync((*gfx)++); + gDPLoadTLUTCmd((*gfx)++, G_TX_LOADTILE, 255); + gDPPipeSync((*gfx)++); + chunkPtr = (u32) chunkPtr + 0x100 * sizeof(u16); + }//L80336C0C + + s2 = 0; + sp1B0 = *vtx; + sp1B4 = *gfx; + if(segment){ + gSPVertex((*gfx)++, SEGMENT_ADDR(segment, (s32)sp1B0 - (s32)sp184), 0, 0); + }else{ + gSPVertex((*gfx)++, sp1B0, 0, 0); + } + + for(i_1BC = 0; i_1BC < framePtr_18c->chunkCnt; i_1BC++){ + //L80336CA0 + //temp_ra = phi_t2->unk6; + sp1A8 = ((s32)chunkPtr + 0xF) & ~7; +// // // temp_a0_3 = arg2->unk2; +// // // temp_s3 = phi_s2 * 2; + +// / temp_fp = temp_s3 + 2; + sp1A8 = (((u32) (chunkPtr + 1) + 0xF) & 0xFFFFFFF8); + if(sp->type & SPRITE_TYPE_RGBA16) { //RGBA16 + gDPLoadTextureBlock((*gfx)++, sp1A8, G_IM_FMT_RGBA, G_IM_SIZ_16b, + chunkPtr->w, chunkPtr->h, 0, 0, 0, 0, 0, 0, 0); + } else if (sp->type & SPRITE_TYPE_RGBA32) { //RGBA32 //L80336E78 + gDPLoadTextureBlock((*gfx)++, sp1A8, G_IM_FMT_RGBA, G_IM_SIZ_32b, + chunkPtr->w, chunkPtr->h, 0, 0, 0, 0, 0, 0, 0); + } else if (sp->type & 1) { //CI4 //L80337020 + gDPLoadTextureBlock((*gfx)++, chunk_block, G_IM_FMT_CI, G_IM_SIZ_16b, + chunkPtr->w, chunkPtr->h, 0, 0, 0, 0, 0, 0, 0); + } else if (sp->type & 4) { //CI8 //L803371C4 + gDPLoadTextureBlock((*gfx)++, chunk_block, G_IM_FMT_CI, G_IM_SIZ_16b, + chunkPtr->w, chunkPtr->h, 0, 0, 0, 0, 0, 0, 0); + } else if (sp->type & 0x100) { + gDPLoadTextureBlock((*gfx)++, chunk_block, G_IM_FMT_I, G_IM_SIZ_16b, + chunkPtr->w, chunkPtr->h, 0, 0, 0, 0, 0, 0, 0); + } else if (sp->type & 0x40) { + gDPLoadTextureBlock((*gfx)++, chunk_block, G_IM_FMT_I, G_IM_SIZ_8b, + chunkPtr->w, chunkPtr->h, 0, 0, 0, 0, 0, 0, 0); + }//L803376A8 + gSP2Triangles((*gfx)++, 0, 1, 2, 0, 2, 1, 0, 0); + //L803376E4 +// // // // temp_a2 = *arg0; +// // // // temp_v1_69 = temp_s3 & 0xFF; +// // // // *arg0 = (void *) (temp_a2 + 8); +// // // // if (phi_s2 == 0) { +// // // // temp_t9 = sp48 & 0xFF; +// // // // phi_a0_7 = (temp_v1_69 << 0x10) | ((temp_fp & 0xFF) << 8) | temp_t9; +// // // // phi_v1_3 = temp_v1_69; +// // // // phi_a1 = temp_t9; +// // // // } else { +// // // // if (phi_s2 == 1) { +// // // // temp_t6 = sp48 & 0xFF; +// // // // temp_v1_70 = temp_s3 & 0xFF; +// // // // phi_t1_8 = ((temp_fp & 0xFF) << 0x10) | (temp_t6 << 8) | temp_v1_70; +// // // // phi_v1_3 = temp_v1_70; +// // // // phi_a1 = temp_t6; +// // // // } else { +// // // // temp_t8_5 = sp48 & 0xFF; +// // // // temp_v1_71 = temp_s3 & 0xFF; +// // // // phi_t1_8 = (temp_t8_5 << 0x10) | (temp_v1_71 << 8) | (temp_fp & 0xFF); +// // // // phi_v1_3 = temp_v1_71; +// // // // phi_a1 = temp_t8_5; +// // // // } +// // // // phi_a0_7 = phi_t1_8; +// // // // } +// // // // temp_a2->unk0 = (s32) (phi_a0_7 | 0xB1000000); +// // // // if (phi_s2 == 0) { +// // // // temp_a2->unk4 = (s32) ((phi_v1_3 << 0x10) | (phi_a1 << 8) | (sp44 & 0xFF)); +// // // // } else { +// // // // if (phi_s2 == 1) { +// // // // phi_a0_8 = (phi_a1 << 0x10) | ((sp44 & 0xFF) << 8) | phi_v1_3; +// // // // } else { +// // // // phi_a0_8 = ((sp44 & 0xFF) << 0x10) | (phi_v1_3 << 8) | phi_a1; +// // // // } +// // // // temp_a2->unk4 = phi_a0_8; +// // // // } +// // // // temp_a2_2 = phi_t2->unk0 - temp_v0->unk0; +// // // // temp_f0 = (f32) D_80383640 / (f32) temp_v0->unk4; +// // // // phi_t1_7 = temp_v0->unk2 - phi_t2->unk2; +// // // // phi_t0 = 0; +// // // // loop_95: +// // // // temp_a1 = ((temp_ra << 6) * phi_t0) - 0x20; +// // // // temp_f4 = (s32) ((f32) phi_t1_7 * ((f32) D_80383644 / (f32) temp_v0->unk6)); +// // // // temp_t3 = phi_t3 - 1; +// // // // temp_lo = (phi_t2->unk4 - 1) * 0; +// // // // phi_a3 = phi_a3_4; +// // // // phi_lo = temp_lo; +// // // // phi_v1_4 = 0; +// // // // phi_a3_2 = phi_a3_4; +// // // // phi_lo_2 = temp_lo; +// // // // phi_v1_5 = 0; +// // // // if (temp_t3 != 0) { +// // // // loop_96: +// // // // phi_a3->unk2 = (s16) temp_f4; +// // // // phi_a3->unk4 = (u16)0; +// // // // temp_a3_2 = phi_a3 + 0x10; +// // // // temp_a3_2->unk-10 = (s16) (s32) ((f32) (phi_lo + temp_a2_2) * temp_f0); +// // // // temp_a3_2->unk-6 = temp_a1; +// // // // temp_a3_2->unk-4 = 0x7F80; +// // // // temp_v1_72 = phi_v1_4 + 1; +// // // // temp_a3_2->unk-8 = (s16) (((phi_t2->unk4 << 6) * phi_v1_4) - 0x20); +// // // // temp_lo_2 = (phi_t2->unk4 - 1) * temp_v1_72; +// // // // phi_a3 = temp_a3_2; +// // // // phi_lo = temp_lo_2; +// // // // phi_v1_4 = temp_v1_72; +// // // // phi_a3_2 = temp_a3_2; +// // // // phi_lo_2 = temp_lo_2; +// // // // phi_v1_5 = temp_v1_72; +// // // // if (temp_v1_72 != temp_t3) { +// // // // goto loop_96; +// // // // } +// // // // } +// // // // phi_a3_2->unk2 = (s16) temp_f4; +// // // // phi_a3_2->unk4 = (u16)0; +// // // // temp_t3_2 = temp_t3 + 1; +// // // // temp_a3_3 = phi_a3_2 + 0x10; +// // // // temp_a3_3->unk-10 = (s16) (s32) ((f32) (phi_lo_2 + temp_a2_2) * temp_f0); +// // // // temp_a3_3->unk-6 = temp_a1; +// // // // temp_a3_3->unk-4 = 0x7F80; +// // // // temp_a3_3->unk-8 = (s16) (((phi_t2->unk4 << 6) * phi_v1_5) - 0x20); +// // // // temp_t0 = phi_t0 + 1; +// // // // phi_t3 = temp_t3_2; +// // // // phi_t1_7 = (phi_t1_7 - temp_ra) + 1; +// // // // phi_t0 = temp_t0; +// // // // phi_a3_4 = temp_a3_3; +// // // // if (temp_t0 != temp_t3_2) { +// // // // goto loop_95; +// // // // } +// // // // temp_s2_2 = phi_s2 + 4; +// // // // phi_s2_3 = temp_s2_2; +// // // // if (temp_s2_2 == 0x10) { + if (segment != 0) { + gSPVertex((*gfx)++, SEGMENT_ADDR(segment, *vtx - sp184, 16, 0); + } else { + gSPVertex((*gfx)++, 0x80001234, 16, 0); + } +// // // // temp_v1_73 = *arg0; +// // // // sp1B0 = temp_a3_3; +// // // // sp1B4 = temp_v1_73; +// // // if (arg4 != 0) { +// // // // *arg0 = (void *) (temp_v1_73 + 8); +// // // // temp_v1_73->unk0 = 0x400FFFF; +// // // // temp_v1_73->unk4 = (void *) ((arg4 << 0x18) + (temp_a3_3 - sp184)); +// // // // phi_s2_3 = 0; +// // // } else { +// // // // *arg0 = (void *) (temp_v1_73 + 8); +// // // // temp_v1_73->unk0 = 0x400FFFF; +// // // // temp_v1_73->unk4 = temp_a3_3; +// // // // phi_s2_3 = 0; +// // // } +// // // // } + chunkSize = chunkPtr->w * chunkPtr->h * chkDataSize_1C0; + chunkPtr = (s32)sp1A8 + chunkSize/2; + } + + gDPPipeSync((*gfx)++); +// if((sp->type & SPRITE_TYPE_CI4) || (sp->type & SPRITE_TYPE_CI8)){ //CI4 or CI8 //L80337AD8 +// gDPSetTextureLUT((*gfx)++, G_TT_NONE); +// } +// if( D_80383638 || sp->type & SPRITE_TYPE_CI8){ +// //L80337B18 +// gDPPipelineMode((*gfx)++, G_PM_NPRIMITIVE); +// }//L80337B30 +// func_8033687C(gfx); + + if(chkDataSize_1C0); +}//*/ + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AEDA0/func_80337B68.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AEDA0/func_80338048.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AEDA0/func_803380A0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AEDA0/func_803380F8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AEDA0/func_803381B4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AEDA0/func_80338270.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AEDA0/func_803382B4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AEDA0/func_803382D8.s") + +void func_803382E4(s32 arg0){ + D_80383634 = arg0; +} + +void func_803382F0(s32 arg0){ + D_80383638 = arg0; +} + +void func_803382FC(s32 arg0){ + D_8038363C = arg0; +} + +void func_80338308(s32 arg0, s32 arg1){ + D_80383640 = arg0; + D_80383644 = arg1; +} + +void func_8033831C(s32 *arg0, s32 *arg1){ + *arg0 = D_80383640; + *arg1 = D_80383644; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AEDA0/func_80338338.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AEDA0/func_80338354.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AEDA0/func_80338370.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_AEDA0/func_8033837C.s") diff --git a/src/core2/code_B1400.c b/src/core2/code_B1400.c new file mode 100644 index 00000000..9016f821 --- /dev/null +++ b/src/core2/code_B1400.c @@ -0,0 +1,1307 @@ +#include +#include "functions.h" +#include "variables.h" +#include "animation.h" + +extern void func_8024128C(Mtx *, s32, f32, f32, f32, f32, f32, f32, f32, f32, f32); +extern void func_802ED52C(s32, f32[3], f32); +extern void func_80252AF0(f32[3], f32[3], f32[3], f32, f32[3]); +extern void mlMtxRotate(f32, f32, f32); +extern void func_8024C5CC(f32[3]); +extern void func_8024C764(f32[3]); +extern void func_8024CD88(f32[3]); +extern void func_8024CE18(f32[3]); +extern void func_8024CFD4(void); +extern void func_8033BD4C(BKModelBin *); +extern s32 func_8024DB50(f32[3], f32); +extern void func_80251788(f32, f32, f32); +extern void mlMtxScale(f32); +extern void mlMtxApply(Mtx* mtx); + +typedef struct{ + s32 env[4]; + s32 prim[4]; +} Struct_Core2_B1400_0; + +typedef struct{ + void (* unk0)(Actor *); + Actor *unk4; +} Struct_Core2_B1400_1; + + +typedef struct{ + f32 unk0[3]; + f32 unkC[3]; + s32 unk18; + f32 unk1C[3]; + f32 unk28[3]; +} Struct_Core2_B1400_2; + +typedef void (*GeoListFunc)(Gfx **, Mtx **, void *); + +typedef struct { + s32 cmd_0; + s32 size_4; + s16 unk8; + s16 unkA; + f32 unkC[3]; +}GeoCmd0; + +typedef struct { + s32 cmd_0; + s32 size_4; + f32 unk8[3]; + f32 unk14[3]; + s16 unk20; + s16 unk22; + s32 unk24; +}GeoCmd1; + +typedef struct { + s32 cmd_0; + s32 size_4; + u8 unk8; + s8 unk9; +}GeoCmd2; + +typedef struct { + s32 cmd_0; + s32 size_4; + s16 unk8; +}GeoCmd3; + +typedef struct { + s32 cmd_0; + s32 size_4; + s16 unk8[]; +}GeoCmd5; + +typedef struct { + s32 cmd_0; + s32 size_4; + s32 unk8; +}GeoCmd6; + +typedef struct { + s32 cmd_0; + s32 size_4; + u8 pad8; + s16 unkA; +}GeoCmd7; + +typedef struct { + s32 cmd_0; + s32 size_4; + f32 max_8; + f32 min_C; + f32 unk10[3]; + s32 subgeo_offset_1C; +}GeoCmd8; + +typedef struct { + s32 cmd_0; + s32 size_4; + s16 unk8; + s16 unkA; + f32 unkC[3]; +}GeoCmd9; + +typedef struct { + s32 cmd_0; + s32 size_4; + s16 unk8; + s16 unkA; + s32 unkC[]; +}GeoCmdC; + +typedef struct { + s32 cmd_0; + s32 size_4; + s16 unk8[3]; + s16 unkE[3]; + s16 unk14; +}GeoCmdD; + +typedef struct { + s32 cmd_0; + s32 size_4; + s16 unk8[3]; + s16 unkE; + s16 unk10; + s16 unk12; +}GeoCmdE; + +typedef struct { + s32 cmd_0; + s32 size_4; + s16 unk8; + u8 unkA; + u8 unkB; + f32 unkC[3]; +}GeoCmdF; + +typedef struct { + s32 cmd_0; + s32 size_4; + s32 unk8; +}GeoCmd10; + +void func_80338390(void); +void func_803384A8(Gfx **, Mtx **, void *); +void func_803385BC(Gfx **, Mtx **, void *); +void func_803387F8(Gfx **, Mtx **, void *); +void func_80338904(Gfx **, Mtx **, void *); +void func_80338498(Gfx **, Mtx **, void *); +void func_80338970(Gfx **, Mtx **, void *); +void func_80338AC4(Gfx **, Mtx **, void *); +void func_80338AE8(Gfx **, Mtx **, GeoCmd7 *cmd); +void func_80338498(Gfx **, Mtx **, void *); +void func_8033878C(Gfx **, Mtx **, void *); +void func_80338B50(Gfx **, Mtx **, void *); +void func_80338BFC(Gfx **, Mtx **, void *); +void func_80338CD0(Gfx **, Mtx **, void *); +void func_80338DCC(Gfx **, Mtx **, void *); +void func_80338EB8(Gfx **, Mtx **, void *); +void func_8033909C(Gfx **, Mtx **, void *); +void func_80339124(Gfx **, Mtx **, BKGeoList *); +void func_8033A410(s32 a); +void func_8033A45C(s32 arg0, s32 arg1); + + +extern Gfx D_80370340[] = +{ + gsDPPipeSync(), + gsDPPipelineMode(G_PM_1PRIMITIVE), + gsDPSetCycleType(G_CYC_2CYCLE), + gsDPSetBlendColor(0x00, 0x00, 0x00, 0x80), + gsSPEndDisplayList() +}; + +extern Gfx D_80370368[] = +{ + gsDPPipeSync(), + gsDPPipelineMode(G_PM_1PRIMITIVE), + gsDPSetCycleType(G_CYC_2CYCLE), + gsDPSetPrimColor(0, 0, 0x00, 0x00, 0x00, 0x00), + gsDPSetBlendColor(0x00, 0x00, 0x00, 0x80), + gsSPEndDisplayList() +}; + +extern Gfx D_80370398[] = +{ + gsDPPipeSync(), + gsDPPipelineMode(G_PM_1PRIMITIVE), + gsDPSetCycleType(G_CYC_2CYCLE), + gsDPSetEnvColor(0xFF, 0xFF, 0xFF, 0xFF), + gsDPSetBlendColor(0x00, 0x00, 0x00, 0x80), + gsSPEndDisplayList() +}; + +extern Gfx D_803703C8[] = +{ + gsDPPipeSync(), + gsDPPipelineMode(G_PM_1PRIMITIVE), + gsDPSetCycleType(G_CYC_2CYCLE), + gsDPSetBlendColor(0x00, 0x00, 0x00, 0x80), + gsSPEndDisplayList() +}; + +extern Gfx D_803703F0[] = +{ + gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2), + gsSPEndDisplayList() +}; + +// 000E 9470: B9 00 03 1D 0C 19 20 48 B8 00 00 00 00 00 00 00 ...... H ........ +// 000E 9480: B9 00 03 1D 0C 18 42 40 B8 00 00 00 00 00 00 00 ......B@ ........ +// 000E 9490: B9 00 03 1D 0C 18 41 C8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 94A0: B9 00 03 1D 0C 18 42 40 B8 00 00 00 00 00 00 00 ......B@ ........ +// 000E 94B0: B9 00 03 1D 0C 18 41 C8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 94C0: B9 00 03 1D 0F 0A 40 00 B8 00 00 00 00 00 00 00 ......@. ........ +// 000E 94D0: B9 00 03 1D 0C 19 20 48 B8 00 00 00 00 00 00 00 ...... H ........ +// 000E 94E0: B9 00 03 1D 0C 18 42 40 B8 00 00 00 00 00 00 00 ......B@ ........ +// 000E 94F0: B9 00 03 1D 0C 18 41 C8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 9500: B9 00 03 1D 0C 18 42 40 B8 00 00 00 00 00 00 00 ......B@ ........ +// 000E 9510: B9 00 03 1D 0C 18 41 C8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 9520: B9 00 03 1D 0C 18 43 C8 B8 00 00 00 00 00 00 00 ......C. ........ + + +extern Gfx D_803704C0[] = { + gsDPSetRenderMode(Z_CMP | Z_UPD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | G_RM_PASS, Z_CMP | Z_UPD | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)), + gsSPEndDisplayList() +}; +// 000E 9540: B9 00 03 1D 0C 19 20 78 B8 00 00 00 00 00 00 00 ...... x ........ +// 000E 9550: B9 00 03 1D 0C 18 42 70 B8 00 00 00 00 00 00 00 ......Bp ........ +// 000E 9560: B9 00 03 1D 0C 18 41 F8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 9570: B9 00 03 1D 0C 18 42 70 B8 00 00 00 00 00 00 00 ......Bp ........ +// 000E 9580: B9 00 03 1D 0C 18 41 F8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 9590: B9 00 03 1D 0F 0A 40 10 B8 00 00 00 00 00 00 00 ......@. ........ +// 000E 95A0: B9 00 03 1D 0C 19 20 58 B8 00 00 00 00 00 00 00 ...... X ........ +// 000E 95B0: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 95C0: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 95D0: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 95E0: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 95F0: B9 00 03 1D 0C 18 43 D8 B8 00 00 00 00 00 00 00 ......C. ........ + + +extern Gfx D_80370590[] = +{ + gsDPSetRenderMode(Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | G_RM_PASS, Z_CMP | CVG_DST_CLAMP | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1)), + gsSPEndDisplayList() +}; + +// 000E 9610: B9 00 03 1D 0C 19 20 58 B8 00 00 00 00 00 00 00 ...... X ........ +// 000E 9620: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 9630: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 9640: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 9650: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 9660: B9 00 03 1D 0F 0A 40 10 B8 00 00 00 00 00 00 00 ......@. ........ +// 000E 9670: B9 00 03 1D 0C 19 20 58 B8 00 00 00 00 00 00 00 ...... X ........ + + +extern Gfx D_80370600[] = +{ + gsDPSetRenderMode(AA_EN | Z_CMP | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | ALPHA_CVG_SEL | G_RM_PASS, AA_EN | Z_CMP | IM_RD | CVG_DST_CLAMP | ZMODE_OPA | ALPHA_CVG_SEL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)), + gsSPEndDisplayList() +}; + +// 000E 9680: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 9690: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 96A0: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 96B0: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 96C0: B9 00 03 1D 0C 18 43 D8 B8 00 00 00 00 00 00 00 ......C. ........ + +extern Gfx D_80370660[]; +// B9 00 03 1D 0C 18 42 40 B8 00 00 00 00 00 00 00 ......B@ ........ +// B9 00 03 1D 0C 18 41 C8 B8 00 00 00 00 00 00 00 ......A. ........ +// B9 00 03 1D 0C 18 42 40 B8 00 00 00 00 00 00 00 ......B@ ........ +// B9 00 03 1D 0C 18 41 C8 B8 00 00 00 00 00 00 00 ......A. ........ +// B9 00 03 1D 0C 18 42 40 B8 00 00 00 00 00 00 00 ......B@ ........ +// B9 00 03 1D 0C 18 41 C8 B8 00 00 00 00 00 00 00 ......A. ........ +// B9 00 03 1D 0C 18 42 40 B8 00 00 00 00 00 00 00 ......B@ ........ +// B9 00 03 1D 0C 18 41 C8 B8 00 00 00 00 00 00 00 ......A. ........ +// B9 00 03 1D 0C 18 42 40 B8 00 00 00 00 00 00 00 ......B@ ........ +// B9 00 03 1D 0C 18 41 C8 B8 00 00 00 00 00 00 00 ......A. ........ +// B9 00 03 1D 0C 18 42 40 B8 00 00 00 00 00 00 00 ......B@ ........ +// B9 00 03 1D 0C 18 41 C8 B8 00 00 00 00 00 00 00 ......A. ........ +// B9 00 03 1D 0C 18 43 C8 B8 00 00 00 00 00 00 00 ......C. ........ + +extern u8 D_80370730; +// 000E 97A0: B9 00 03 1D 0C 18 42 70 B8 00 00 00 00 00 00 00 ......Bp ........ +// 000E 97B0: B9 00 03 1D 0C 18 41 F8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 97C0: B9 00 03 1D 0C 18 42 70 B8 00 00 00 00 00 00 00 ......Bp ........ +// 000E 97D0: B9 00 03 1D 0C 18 41 F8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 97E0: B9 00 03 1D 0C 18 42 70 B8 00 00 00 00 00 00 00 ......Bp ........ +// 000E 97F0: B9 00 03 1D 0C 18 41 F8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 9800: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 9810: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 9820: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 9830: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 9840: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 9850: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 9860: B9 00 03 1D 0C 18 43 D8 B8 00 00 00 00 00 00 00 ......C. ........ + +extern u8 D_80370800; + +// 000E 9870: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 9880: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 9890: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 98A0: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 98B0: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 98C0: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 98D0: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 98E0: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 98F0: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 9900: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 9910: B9 00 03 1D 0C 18 42 50 B8 00 00 00 00 00 00 00 ......BP ........ +// 000E 9920: B9 00 03 1D 0C 18 41 D8 B8 00 00 00 00 00 00 00 ......A. ........ +// 000E 9930: B9 00 03 1D 0C 18 43 D8 B8 00 00 00 00 00 00 00 ......C. ........ + +extern Gfx D_803708D0[] = +{ + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, 2, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD), + gsDPSetTileSize(2, 0, 0, 0x007C, 0x007C), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0100, 3, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, 1, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, 1), + gsDPSetTileSize(3, 0, 0, 0x003C, 0x003C), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0104, 4, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, 2, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, 2), + gsDPSetTileSize(4, 0, 0, 0x001C, 0x001C), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0106, 5, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, 3, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, 3), + gsDPSetTileSize(5, 0, 0, 0x000C, 0x000C), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0107, 6, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, 4, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, 4), + gsDPSetTileSize(6, 0, 0, 0x0004, 0x0004), + gsSPEndDisplayList() +}; + +extern Gfx D_80370928[] = +{ + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0000, 2, 0, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, 5, G_TX_NOLOD), + gsDPSetTileSize(2, 0, 0, 0x007C, 0x007C), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0100, 3, 0, G_TX_NOMIRROR | G_TX_WRAP, 4, 1, G_TX_NOMIRROR | G_TX_WRAP, 4, 1), + gsDPSetTileSize(3, 0, 0, 0x003C, 0x003C), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0104, 4, 0, G_TX_NOMIRROR | G_TX_WRAP, 3, 2, G_TX_NOMIRROR | G_TX_WRAP, 3, 2), + gsDPSetTileSize(4, 0, 0, 0x001C, 0x001C), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0106, 5, 0, G_TX_NOMIRROR | G_TX_WRAP, 2, 3, G_TX_NOMIRROR | G_TX_WRAP, 2, 3), + gsDPSetTileSize(5, 0, 0, 0x000C, 0x000C), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0x0107, 6, 0, G_TX_NOMIRROR | G_TX_WRAP, 1, 4, G_TX_NOMIRROR | G_TX_WRAP, 1, 4), + gsDPSetTileSize(6, 0, 0, 0x0004, 0x0004), + gsDPSetTextureDetail(G_TD_CLAMP), + gsDPSetTextureLOD(G_TL_LOD), + gsSPEndDisplayList() +}; + +extern s32 D_80370990 = 0; + +extern GeoListFunc D_80370994[] = { + func_803384A8, + func_803385BC, + func_803387F8, + func_80338904, + func_80338498, //empty_4 + func_80338970, + func_80338AC4, + func_80338AE8, + func_80338B50, + func_80338498, //empty_9 + func_80338BFC, + func_80338498, //empty_B + func_80338CD0, + func_80338DCC, + func_80338EB8, + func_8033909C, + func_8033878C +}; + +/* .rodata */ +extern f32 D_80378F40; +extern f32 D_80378F44; +extern f32 D_80378F48; +extern f32 D_80378F4C; + +/* .bss */ +extern s32 D_80383650; +extern s32 D_80383658[0x2A]; +extern s32 D_80383700; +extern bool D_80383704; +extern f32 D_80383708; +extern f32 D_8038370C; +extern s32 D_80383710; +extern s32 D_80383714; +extern BKGfxList *D_80383718; +extern struct58s *D_8038371C; +extern BKTextureList *D_80383720; +extern s32 D_80383724; +extern BKVertexList *D_80383728; +extern s32 D_8038372C; +extern struct58s *D_80383730; +extern f32 D_80383734; +extern Struct_Core2_B1400_0 D_80383738; +extern s32 D_80383754; +extern Struct_Core2_B1400_2 D_80383758; +extern s32 D_80383770; +extern f32 D_80383774[3]; +extern f32 D_80383780[3]; +extern struct{ + void (* unk0)(Actor *); + Actor *unk4; + void (* unk8)(ActorMarker *); + ActorMarker *unkC; +} D_80383790; +extern Struct_Core2_B1400_0 D_803837A0; +extern struct { + s32 unk0; + f32 unk4[3]; +}D_803837B0; +extern u8 D_803837C0; +extern struct { + s32 unk0; //model_asset_index + f32 unk4; + f32 unk8; +} D_803837C8; +extern s32 D_803837D8; +extern struct { + LookAt unk0[32]; + LookAt *unk400; + LookAt *unk404; + f32 unk408[3]; +} D_803837E0; +extern Mtx D_80383BF8; +extern f32 D_80383C38[3]; +extern f32 D_80383C48[3]; +extern BKModelBin *D_80383C54; +extern f32 D_80383C58[3]; +extern f32 D_80383C64; +extern f32 D_80383C68[3]; +extern f32 D_80383C78[3]; +extern f32 D_80383C88[3]; +extern f32 D_80383C98[3]; + +void func_80338390(void){ + D_80383700 = 0; + D_80383708 = D_80378F40; + D_80383704 = TRUE; + D_8038370C = 1.0f; + D_80383710 = FALSE; + D_80383714 = 2; + D_80383650 = 0; + D_80383718 = NULL; + D_8038371C = NULL; + D_80383720 = 0; + D_80383724 = 0; + D_80383728 = 0; + D_8038372C = 0; + D_80383790.unk0 = NULL; + D_80383790.unk8 = NULL; + D_803837B0.unk0 = 0; + D_803837C8.unk0 = 0; + D_803837D8 = 0; + func_8033A45C(1,1); + func_8033A45C(2,0); + if(D_80383770){ + func_8024CD88(D_80383774); + func_8024CE18(D_80383780); + func_8024CFD4(); + } +} + +//empty cmd, +void func_80338498(Gfx **gfx, Mtx **mtx, void *arg2){ + return; +} + +//cmd0_??? +void func_803384A8(Gfx **gfx, Mtx **mtx, void *arg2){ + GeoCmd0 *cmd = (GeoCmd0 *)arg2; + f32 sp30[3]; + + if(cmd->unk8){ + func_8025235C(sp30, cmd->unkC); + func_80251788(sp30[0], sp30[1], sp30[2]); + mlMtxRotYaw(D_80383C48[1]); + if(!cmd->unkA){ + mlMtxRotPitch(D_80383C48[0]); + } + mlMtxScale(D_80383734); + mlMtxTranslate(-cmd->unkC[0], -cmd->unkC[1], -cmd->unkC[2]); + mlMtxApply(*mtx); + gSPMatrix((*gfx)++, (*mtx)++, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + func_80339124(gfx, mtx, (s32)cmd + cmd->unk8); + mlMtxPop(); + gSPPopMatrix((*gfx)++, G_MTX_MODELVIEW); + } +} + +//cmd1_SORT +void func_803385BC(Gfx **gfx, Mtx **mtx, void *arg2){ + GeoCmd1 *cmd = (GeoCmd1 *)arg2; + f32 f14; + s32 tmp_v0; + + func_8025235C(D_80383C78, cmd->unk8); + func_8025235C(D_80383C88, cmd->unk14); + + D_80383C68[0] = D_80383C88[0] - D_80383C78[0]; + D_80383C68[1] = D_80383C88[1] - D_80383C78[1]; + D_80383C68[2] = D_80383C88[2] - D_80383C78[2]; + + f14 = D_80383C68[0]*D_80383C78[0] + D_80383C68[1]*D_80383C78[1] + D_80383C68[2]*D_80383C78[2]; + f14 = -f14; + if(cmd->unk20 & 1){ + if(0.0f <= f14 && (tmp_v0 = cmd->unk24)){ + D_80383C64 = f14; + func_80339124(gfx, mtx, (s32)cmd + tmp_v0); + } + else{ + D_80383C64 = f14; + if(f14 < 0.0f){ + if(cmd->unk22) + func_80339124(gfx, mtx, (s32)cmd + cmd->unk22); + } + } + } + else{ + D_80383C64 = f14; + if(0.0f <= f14){ + if(cmd->unk22) + func_80339124(gfx, mtx, (s32)cmd + cmd->unk22); + + if(cmd->unk24) + func_80339124(gfx, mtx, (s32)cmd + cmd->unk24); + } + else{ + if(cmd->unk24) + func_80339124(gfx, mtx, (s32)cmd + cmd->unk24); + + if(cmd->unk22) + func_80339124(gfx, mtx, (s32)cmd + cmd->unk22); + } + } +} + +//cmd10_??? +void func_8033878C(Gfx **gfx, Mtx **mtx, void *arg2){ + GeoCmd10 *cmd = (GeoCmd10 *)arg2; + + switch(cmd->unk8){ + case 1: + gSPDisplayList((*gfx)++, &D_803708D0); + break; + case 2: + gSPDisplayList((*gfx)++, &D_80370928); + break; + } +} + +//cmd2_BONE +void func_803387F8(Gfx **gfx, Mtx **mtx, void *arg2){ + GeoCmd2 *cmd = (GeoCmd2 *)arg2; + + if(D_8038371C){ + func_802519C8(&D_80383BF8, func_802EA110(D_8038371C, cmd->unk9)); + if(D_80370990){ + mlMtxApply(*mtx); + gSPMatrix((*gfx)++, (*mtx)++, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + } + }//L80338890 + if(cmd->unk8){ + func_80339124(gfx, mtx, (u8*)cmd + cmd->unk8); + } + if(D_8038371C){ + mlMtxPop(); + if(D_80370990){ + gSPPopMatrix((*gfx)++, G_MTX_MODELVIEW); + } + } +} + +//cmd3_LOAD_DL +void func_80338904(Gfx **gfx, Mtx **mtx, void *arg2){ + GeoCmd3 *cmd = (GeoCmd3 *)arg2; + s32 vptr; + + if(D_80370990){ + vptr = (s32)D_80383718 + sizeof(Gfx)*cmd->unk8 + sizeof(BKGfxList); + gSPDisplayList((*gfx)++, osVirtualToPhysical(vptr)); + } +} + +//Cmd5_SKINNING +void func_80338970(Gfx **gfx, Mtx **mtx, void *arg2){ + GeoCmd5 *cmd = (GeoCmd5 *)arg2; + int i; + + if(D_80370990){ + gSPDisplayList((*gfx)++, osVirtualToPhysical((s32)D_80383718 + sizeof(Gfx)*cmd->unk8[0] + sizeof(BKGfxList))); + } + + if(D_80370990){ + for(i = 1; cmd->unk8[i]; i++){ + mlMtxApply(*mtx); + gSPMatrix((*gfx)++, (*mtx)++, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList((*gfx)++, osVirtualToPhysical((s32)D_80383718 + sizeof(Gfx)*cmd->unk8[i] + sizeof(BKGfxList))); + } + } +} + +//Cmd6_??? +void func_80338AC4(Gfx **gfx, Mtx **mtx, void *arg2){ + GeoCmd6 *cmd = (GeoCmd6 *)arg2; + func_80339124(gfx, mtx, (s32)cmd + cmd->unk8); +} + +//Cmd7_LOAD_DL??? +void func_80338AE8(Gfx **gfx, Mtx **mtx, GeoCmd7 *cmd){ + if(D_80370990){ + gSPDisplayList((*gfx)++, osVirtualToPhysical((s32)D_80383718 + sizeof(Gfx)*cmd->unkA + sizeof(BKGfxList))); + } +} + +//Cmd8_LOD +void func_80338B50(Gfx **gfx, Mtx **mtx, void *arg2){ + GeoCmd8 *cmd = (GeoCmd8 *)arg2; + f32 dist; + + if(cmd->subgeo_offset_1C){ + func_8025235C(D_80383C98, cmd->unk10); + dist = gu_sqrtf(D_80383C98[0]*D_80383C98[0] + D_80383C98[1]*D_80383C98[1] + D_80383C98[2]*D_80383C98[2]); + if(cmd->min_C < dist && dist <= cmd->max_8){ + func_80339124(gfx, mtx, (s32)cmd + cmd->subgeo_offset_1C); + } + } +} + +//CmdA_REFERENCE_POINT +void func_80338BFC(Gfx **gfx, Mtx **mtx, void *arg2){ + GeoCmd9 *cmd = (GeoCmd9 *)arg2; + f32 sp20[3]; + + if(D_80383650){ + if(D_8038371C){ + func_802519C8(&D_80383BF8, func_802EA110(D_8038371C, cmd->unkA)); + func_8025235C(sp20, cmd->unkC); + mlMtxPop(); + } + else{ + func_8025235C(sp20, cmd->unkC); + } + sp20[0] += D_80383C38[0]; + sp20[1] += D_80383C38[1]; + sp20[2] += D_80383C38[2]; + func_8034A308(D_80383650, cmd->unk8, sp20); + } +} + +//CmdC_SELECTOR +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_80338CD0.s") +#else +void func_80338CD0(Gfx **gfx, Mtx **mtx, void *arg2){ + GeoCmdC *cmd = (GeoCmdC *)arg2; + s32 tmp_v0; + s32 indx; + s32 indx2; + s32 s2; + s32 s1; + s32* s0; + + tmp_v0 = cmd->unkA; + indx = D_80383658[cmd->unkA]; + if(cmd->unkA){ + if(indx == 0){ + + }else if(indx > 0){ + if(cmd->unk8 >= indx){ + func_80339124(gfx, mtx, (s32)cmd + cmd->unkC[indx-1]); + } + + }else{//L80338D5C + s1 = -indx; + s0 = cmd->unkC; + for(s2 = 0; s2 < cmd->unk8; s2++){//L80338D6C + if(s1 & 1){ + func_80339124(gfx, mtx, (s32)cmd + *s0); + } + s1 >>= 1; + s0++; + } + } + }//L80338DA8 +} +#endif + +//CmdD_DRAW_DISTANCE +void func_80338DCC(Gfx ** gfx, Mtx ** mtx, void *arg2){ + f32 sp2C[3]; + f32 sp20[3]; + GeoCmdD * cmd = (GeoCmdD *)arg2; + if(cmd->unk14){ + sp2C[0] = (f32)cmd->unk8[0] * D_80383734; + sp2C[1] = (f32)cmd->unk8[1] * D_80383734; + sp2C[2] = (f32)cmd->unk8[2] * D_80383734; + + sp20[0] = (f32)cmd->unkE[0] * D_80383734; + sp20[1] = (f32)cmd->unkE[1] * D_80383734; + sp20[2] = (f32)cmd->unkE[2] * D_80383734; + if(func_8024D374(sp2C, sp20)){ + func_80339124(gfx, mtx, (s32)cmd + cmd->unk14); + } + } +} + +//cmdE_??? +void func_80338EB8(Gfx ** gfx, Mtx ** mtx, void *arg2){ + f32 sp34[3]; + f32 sp30; + GeoCmdE * cmd = (GeoCmdE *)arg2; + + if(cmd->unk12 == -1){ + sp34[0] = (f32)cmd->unk8[0] * D_80383734; + sp34[1] = (f32)cmd->unk8[1] * D_80383734; + sp34[2] = (f32)cmd->unk8[2] * D_80383734; + sp30 = (f32)cmd->unkE*D_80383734; + if(func_8024DB50(sp34, sp30) && cmd->unk10){ + func_80339124(gfx, mtx, (s32)cmd + cmd->unk10); + } + } + else{ + sp34[0] = (f32)cmd->unk8[0]; + sp34[1] = (f32)cmd->unk8[1]; + sp34[2] = (f32)cmd->unk8[2]; + + sp30 = (f32)cmd->unkE*D_80383734; + if(D_8038371C){ + func_802519C8(&D_80383BF8, func_802EA110(D_8038371C, cmd->unk12)); + func_8025235C(sp34, sp34); + mlMtxPop(); + } + else{ + func_8025235C(sp34, sp34); + } + + sp34[0] += D_80383C38[0]; + sp34[1] += D_80383C38[1]; + sp34[2] += D_80383C38[2]; + if(func_8024DB50(sp34, sp30) && cmd->unk10){ + func_80339124(gfx, mtx, (s32)cmd + cmd->unk10); + } + + }//L8033908C + +} + +//cmdF_??? (processes model_setup offset_0x20) +void func_8033909C(Gfx ** gfx, Mtx ** mtx, void *arg2){ + GeoCmdF *cmd = (GeoCmdF *)arg2; + int tmp_v0 = func_802ED420(D_8038372C, cmd->unkC, cmd->unkA); + if( (!tmp_v0 && (cmd->unkB & 1)) + || (tmp_v0 && (cmd->unkB & 2)) + ){ + if(cmd->unk8 != 0) + func_80339124(gfx, mtx, (s32)cmd + cmd->unk8); + } + +} + +//render_GeoList +void func_80339124(Gfx ** gfx, Mtx ** mtx, BKGeoList *geo_list){ + do{ + D_80370994[geo_list->cmd_0](gfx, mtx, geo_list); + if(geo_list->size_4 == 0) + return; + geo_list = ((s32)geo_list + geo_list->size_4); + }while(1); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_803391A4.s") +#else +int func_803391A4(Gfx **gfx, Mtx **mtx, f32 position[3], f32 arg3[3], f32 scale, f32*arg5, BKModelBin* model_bin){ + f32 spF4[3]; + f32 spF0; + f32 padEC; + f32 spE0[3]; + s32 spDC; + s32 spD8; + f32 spD4; + f32 spD0; + BKVertexList *tmp_v1; + f32 tmp_f0; + s32 alpha; + f32 padB8; + int i; //spB4 + s32 spB0; + + if( (!model_bin && !D_803837C8.unk0) + || (model_bin && D_803837C8.unk0) + ){ + func_80338390(); + return 0; + } + + D_80370990 = 0; + func_8024C5CC(D_80383C38); + func_8024C764(D_80383C48); + if(D_80383758.unk18){ + D_80383758.unk1C[0] = D_80383C38[0]; + D_80383758.unk1C[1] = D_80383C38[1]; + D_80383758.unk1C[2] = D_80383C38[2]; + + D_80383758.unk28[0] = D_80383C48[0];\ + D_80383758.unk28[1] = D_80383C48[1];\ + D_80383758.unk28[2] = D_80383C48[2]; + }//L80339274 + + if(position){ + spE0[0] = position[0]; + spE0[1] = position[1]; + spE0[2] = position[2]; + } + else{//L803392A8 + spE0[0] = spE0[1] = spE0[2] = 0.0f; + }//L803392BC + + spF4[0] = spE0[0] - D_80383C38[0]; + spF4[1] = spE0[1] - D_80383C38[1]; + spF4[2] = spE0[2] - D_80383C38[2]; + + if( ((spF4[0] < D_80378F44) || (D_80378F48 < spF4[0])) + || ((spF4[1] < D_80378F44) || (D_80378F48 < spF4[1])) + || ((spF4[2] < D_80378F44) || (D_80378F48 < spF4[2])) + ){ + func_80338390(); + return 0; + } + + if(D_80383758.unk18){ + D_80383C38[0] = D_80383758.unk0[0]; + D_80383C38[1] = D_80383758.unk0[1]; + D_80383C38[2] = D_80383758.unk0[2]; + + D_80383C48[0] = D_80383758.unkC[0];\ + D_80383C48[1] = D_80383758.unkC[1];\ + D_80383C48[2] = D_80383758.unkC[2]; + func_8024CD88(D_80383C38); + func_8024CE18(D_80383C48); + func_8024CFD4(); + spF4[0] = spE0[0] - D_80383C38[0]; + spF4[1] = spE0[1] - D_80383C38[1]; + spF4[2] = spE0[2] - D_80383C38[2]; + }//L803393E8 + + if(model_bin){ + tmp_v1 = D_80383728 ? D_80383728 : (BKVertexList *)((s32)model_bin + model_bin->vtx_list_offset_10); + spD0 = tmp_v1->unk16; + spD4 = tmp_v1->unk12; + } + else{//L80339434 + spD0 = D_803837C8.unk8; + spD4 = D_803837C8.unk4; + }//L80339440 + spF0 = gu_sqrtf(spF4[0]*spF4[0] + spF4[1]*spF4[1] + spF4[2]*spF4[2]); + if( 4000.0f <= spF0 && spD4*scale*D_8038370C*50.0f < D_80383708){ + D_80383708 = spD4*scale*D_8038370C*50.0f; + }//L803394C8 + + if(D_80383708 <= spF0){ + func_80338390(); + return 0; + } + + D_80370990 = (D_80383704) ? func_8024DB50(spE0, spD0*scale) : 1; + if(D_80370990 == 0){ + func_80338390(); + return 0; + } + + if(D_80383790.unk0){ + D_80383790.unk0(D_80383790.unk4); + } + func_80349AD0(); + if(model_bin == NULL){ + model_bin = assetcache_get(D_803837C8.unk0); + } + D_80383C54 = model_bin; + D_80383718 = D_80383718 ? D_80383718 : (BKGfxList *)((s32)D_80383C54 + D_80383C54->gfx_list_offset_C); + D_80383720 = D_80383720 ? D_80383720 : (BKTextureList *)((s32)D_80383C54 + D_80383C54->texture_list_offset_8); + D_80383728 = D_80383728 ? D_80383728 : (BKVertexList *)((s32)D_80383C54 + D_80383C54->vtx_list_offset_10); + if(D_80383C54->unk20 == NULL){ + D_8038372C = NULL; + } + else{ + D_8038372C = (s32)model_bin + model_bin->unk20; + } + + if(D_80383710){ + tmp_f0 = D_80383708 - 500.0f; + if(tmp_f0 < spF0){ + alpha = (s32)((1.0f - (spF0 - tmp_f0)/500.0f)*255.0f); + if(D_80383714 == 0){ + D_80383738.prim[3] = (D_80383738.prim[3] * alpha) / 0xff; + } + else if(D_80383714 == 1){//L803396DC + D_803837A0.env[3] = (D_803837A0.env[3] * alpha)/0xff; + } + else if(D_80383714 == 2){//L80339710 + func_8033A410(alpha); + } + else if(D_80383714 == 3){ + D_803837C0 = (D_803837C0 *alpha)/0xff; + } + }////L80339764 + }//L80339764 + + gSPSegment((*gfx)++, 0x01, osVirtualToPhysical((void*)((s32)D_80383728 + sizeof(BKVertexList)))); + gSPSegment((*gfx)++, 0x02, osVirtualToPhysical((void*)((s32)D_80383720 + D_80383720->cnt_4*sizeof(BKTextureHeader) + sizeof(BKTextureList)))); + + if(D_80383724){ + for(i = 0; i < 4; i++){ + if(func_80349BB0(D_80383724, i, &spB0)) + gSPSegment((*gfx)++, 15-i, osVirtualToPhysical((void*)((s32) D_80383720 + D_80383720->cnt_4*sizeof(BKTextureHeader) + spB0 + sizeof(BKTextureList)))); + } + } + + if(D_803837D8){ + gSPSetGeometryMode((*gfx)++, G_ZBUFFER); + } + else{//L803398C0 + gSPClearGeometryMode((*gfx)++, G_ZBUFFER); + } + + //select RenderMode + if(D_803837D8 == 0){ + spDC = &D_803703F0; + spD8 = &D_80370660; + } + else if(D_803837D8 == 1){ + spDC = &D_803704C0; + spD8 = &D_80370730; + } + else if(D_803837D8 == 2){ + spDC = &D_80370590; + spD8 = &D_80370800; + }//L80339948 + + if(D_80383714 == 0){ + + alpha = ((0xFF - D_80383738.prim[3])*D_80383738.env[3])/0xff + D_80383738.prim[3]; + gSPDisplayList((*gfx)++, D_80370340); + gDPSetEnvColor((*gfx)++, D_80383738.env[0], D_80383738.env[1], D_80383738.env[2], alpha); + gDPSetPrimColor((*gfx)++, 0, 0, D_80383738.prim[0], D_80383738.prim[1], D_80383738.prim[2], 0); + if(alpha == 0xFF){ + gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(spDC)); + } + else{ + gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(spD8)); + } + //TODO + } + else if(D_80383714 == 1){//L80339AC0 + gSPDisplayList((*gfx)++, D_80370368); + gDPSetEnvColor((*gfx)++, D_803837A0.env[0], D_803837A0.env[1], D_803837A0.env[2], D_803837A0.env[3]); + if(D_803837A0.env[3] == 0xFF){ + gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(spDC)); + } + else{ + gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(spD8)); + } + } + else if(D_80383714 == 2){ + gSPDisplayList((*gfx)++, D_80370398); + gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(spDC)); + } + else if(D_80383714 == 3){ + gSPDisplayList((*gfx)++, D_803703C8); + gDPSetEnvColor((*gfx)++, 0xFF, 0xFF, 0xFF, D_803837C0); + gSPSegment((*gfx)++, 0x03, osVirtualToPhysical(spDC)); + }//L80339C80 + + if(D_80383C54->geo_typ_A & 2){ //trilinear mipmapping + gSPDisplayList((*gfx)++, D_80370928); + }//L80339CC8 + + if(D_80383C54->geo_typ_A & 4){ //env mapping + if(0.0f == spF4[2]){ + spF4[2] = D_80378F4C; + } + func_8024128C(*mtx, D_803837E0.unk400, D_803837E0.unk408[0], D_803837E0.unk408[1], D_803837E0.unk408[2], spF4[0], spF4[1], spF4[2], 0.0f, 1.0f, 0.0f); + gSPLookAt((*gfx)++, D_803837E0.unk400); + osWritebackDCache(D_803837E0.unk400, sizeof(LookAt)); + D_803837E0.unk400++; + if(D_803837E0.unk400 == D_803837E0.unk404) + D_803837E0.unk400 = &D_803837E0.unk0; + }//L80339DBC + + if(D_8038371C && !D_80383C54->animation_list_offset_18){ + D_8038371C = 0; + } + else if(D_8038371C == 0 && D_80383C54->animation_list_offset_18){ + if(D_80383700 == 0){ + func_802EA060(&D_80383730, (s32)model_bin + model_bin->animation_list_offset_18); + } + else{//L80339E38 + func_802EA1A8(&D_80383730, (s32)model_bin + model_bin->animation_list_offset_18, D_80383700); + }//L80339E48 + D_8038371C = D_80383730; + }//L80339E58 + + if(D_8038372C){ + func_802ED52C(D_8038372C, D_80383C38, scale); + }//L80339E74 + + if(model_bin->unk28 && D_8038371C){ + func_802E6BD0((s32)D_80383C54 + D_80383C54->unk28, D_80383728); + }//L80339EAC + + mlMtxIdent(); + if(D_80383770){ + func_80252AF0(&D_80383774, spE0, arg3, scale, arg5); + } + else{ + func_80252AF0(D_80383C38, spE0, arg3, scale, arg5); + }//L80339F08 + + if(D_803837B0.unk0){ + mlMtxRotate(D_803837B0.unk4[0], D_803837B0.unk4[1], D_803837B0.unk4[2]); + }//L80339F2C + + func_802513B0(&D_80383BF8); + mlMtxApply(*mtx); + gSPMatrix((*gfx)++, (*mtx)++, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + D_80383734 = scale; + + if(arg3){ + D_80383C58[0] = arg3[0]; + D_80383C58[1] = arg3[1]; + D_80383C58[2] = arg3[2]; + } + else{ + D_80383C58[0] = D_80383C58[1] = D_80383C58[2] = 0.0f; + } + + func_80339124(gfx, mtx, (s32)model_bin + model_bin->geo_list_offset_4); + gSPPopMatrix((*gfx)++, G_MTX_MODELVIEW); + + if(D_80383790.unk8){ + D_80383790.unk8(D_80383790.unkC); + } + + if(D_803837C8.unk0){ + func_8033BD4C(model_bin); + } + + func_80338390(); + return model_bin; +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A048.s") + +s32 func_8033A064(void){ + return D_80383700; +} + +s32 func_8033A070(BKModelBin *arg0){ + return arg0->geo_typ_A; +} + +BKGfxList *func_8033A078(BKModelBin *arg0){ + return (BKGfxList *)((s32)arg0 + arg0->gfx_list_offset_C); +} + +BKCollisionList *func_8033A084(BKModelBin *arg0){ + if(arg0 == NULL) + return NULL; + + if(arg0->collision_list_offset_1C == 0) + return NULL; + + return (BKCollisionList *)((s32)arg0 + arg0->collision_list_offset_1C); +} + +BKEffectsList *func_8033A0B0(BKModelBin *arg0){ + if(arg0->effects_list_setup_24 == 0) + return NULL; + + return (BKEffectsList *)((s32)arg0 + arg0->effects_list_setup_24); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A0CC.s") + +BKAnimationList *func_8033A0D4(BKModelBin *arg0){ + if(arg0->animation_list_offset_18 == 0) + return NULL; + + return (BKAnimationList *)((s32)arg0 + arg0->animation_list_offset_18); +} + +s32 func_8033A0F0(s32 arg0){ + return D_80383658[arg0]; +} + +BKTextureList *func_8033A104(BKModelBin *arg0){ + return (BKTextureList *)((s32)arg0 + arg0->texture_list_offset_8); +} + +void *func_8033A110(BKModelBin *arg0){ + if(arg0->unk2C == 0) + return NULL; + return (s32)arg0 + arg0->unk2C; +} + +BKModelUnk14List *func_8033A12C(BKModelBin *this){ + if(this->unk14 == 0) + return 0; + return (BKModelUnk14List *)((s32)this + this->unk14); +} + +BKVertexList *func_8033A148(BKModelBin *arg0){ + return (BKVertexList *)((s32)arg0 + arg0->vtx_list_offset_10); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A154.s") + +s32 func_8033A170(void){ + return D_80370990; +} + +void func_8033A17C(void){ + func_802EA134(D_80383730); + D_80383730 = NULL; +} + +void func_8033A1A4(void){ + func_80338390(); + D_80383770 = 0; + D_803837E0.unk400 = &D_803837E0.unk0[0]; + D_803837E0.unk404 = D_803837E0.unk400 + 32; + D_803837E0.unk408[0] = D_803837E0.unk408[1] = D_803837E0.unk408[2] = 0.0f; + D_80383730 = func_802EA154(); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A1FC.s") +#else +void func_8033A1FC(void){ + s32 i; + for(i = 0; i < 0x2A; i++){ + D_80383658[i] = 0; + } +} +#endif + +void func_8033A238(s32 arg0){ + D_80383700 = arg0; +} + +f32 func_8033A244(f32 arg0){ + f32 out = D_80383708; + D_80383708 = arg0; + return out; +} + +void func_8033A25C(bool arg0){ + D_80383704 = arg0 ? TRUE : FALSE; +} + +void func_8033A280(f32 arg0){ + D_8038370C = arg0; +} + +void func_8033A28C(bool arg0){ + D_80383710 = arg0; +} + +void func_8033A298(bool arg0){ + D_80383758.unk18 = arg0; + if(arg0){ + func_8024C5CC(D_80383758.unk0); + func_8024C764(D_80383758.unkC); + } +} + +void func_8033A2D4(void(*func)(Actor *), Actor* actor){ + D_80383790.unk0 = func; + D_80383790.unk4 = actor; +} + +void func_8033A2E8(void(*func)(ActorMarker *), ActorMarker* marker){ + D_80383790.unk8 = func; + D_80383790.unkC = marker; +} + +void func_8033A2FC(BKGfxList *gfx_list){ + D_80383718 = gfx_list; +} + +void func_8033A308(f32 arg0[3]){ + D_803837B0.unk0 = TRUE; + D_803837B0.unk4[0] = arg0[0]; + D_803837B0.unk4[1] = arg0[1]; + D_803837B0.unk4[2] = arg0[2]; +} + +void func_8033A334(s32 env[4], s32 prim[4]){ + D_80383714 = 0; + + D_80383738.env[0] = env[0]; + D_80383738.env[1] = env[1]; + D_80383738.env[2] = env[2]; + D_80383738.env[3] = env[3]; + + D_80383738.prim[0] = prim[0]; + D_80383738.prim[1] = prim[1]; + D_80383738.prim[2] = prim[2]; + D_80383738.prim[3] = prim[3]; +} + +void func_8033A388(s32 r, s32 g, s32 b, s32 a){ + D_80383714 = 1; + + D_803837A0.env[0] = MIN(0xFF, r); + D_803837A0.env[1] = MIN(0xFF, g); + D_803837A0.env[2] = MIN(0xFF, b); + D_803837A0.env[3] = MIN(0xFF, a); +} + +void func_8033A410(s32 a){ + if(a == 0xff){ + D_80383714 = 2; + } + else{ + D_80383714 = 3; + D_803837C0 = a; + } +} + +void func_8033A444(struct58s *arg0){ + D_8038371C = arg0; +} + +void func_8033A450(s32 arg0){ + D_80383650 = arg0; +} + +void func_8033A45C(s32 arg0, s32 arg1){ + D_80383658[arg0] = arg1; +} + +void func_8033A470(s32 arg0, s32 arg1){ + D_80383658[arg0] = -arg1; +} + +void func_8033A488(BKTextureList *arg0){ + D_80383720 = arg0; +} + +void func_8033A494(s32 arg0){ + D_80383724 = arg0; +} + +void func_8033A4A0(enum asset_e model_id, f32 arg1, f32 arg2){ + D_803837C8.unk0 = model_id; + D_803837C8.unk4 = arg1; + D_803837C8.unk8 = arg2; +} + +void func_8033A4C0(BKVertexList *vertex_list){ + D_80383728 = vertex_list; +} + +void set_model_render_mode(s32 renderMode){ + D_803837D8 = renderMode; +} + +void func_8033A4D8(void){ + if(D_80383730 != NULL){ + D_80383730 = func_802EA374(D_80383730); + } +} + +///BREAk??? + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A510.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A57C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A5B8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A670.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A6B0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A6F0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A710.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A750.s") + +void func_8033A8F0(Struct_B1400 **arg0, s32 arg1, f32 arg2[4]){ + func_80345250(*arg0 + arg1, arg2); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A928.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A968.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A9A8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B1400/func_8033A9E4.s") diff --git a/src/core2/code_B3A80.c b/src/core2/code_B3A80.c new file mode 100644 index 00000000..32f1dee8 --- /dev/null +++ b/src/core2/code_B3A80.c @@ -0,0 +1,518 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "assets.h" +#include "animation.h" + +extern f32 func_80340A4C(f32, s32, f32 *); + +extern f32 D_803709E0[]; +extern u8 D_80370A1C; +extern u8 D_80370A14; //assetCache_size; +extern u8 D_80370A18; +extern s32 D_80370A10; + +extern f32 D_80378F50; + +extern s32 D_80383CB0; +extern AssetROMHead *D_80383CC0; +extern AssetFileMeta *D_80383CC4; +extern u32 D_80383CC8; +extern s32 D_80383CCC; //asset_data_rom_offset +extern void** D_80383CD0; //assetCache_ptrs; +extern BKSpriteDisplayData **D_80383CD4; +extern u8* assetCache_depCount; //assetCache_dependencies; +extern s16 *D_80383CDC; //assetCache_indexs + +extern vector(struct21s) *D_80383CE0[2]; +s32 assetcache_release(void * arg0); + +f32 func_8033ABA0(AnimationFile *anim_file, f32 arg1); +f32 func_8033AC38(AnimationFile *anim_file, AnimationFileElement *arg1, f32 arg2); +s32 func_8033AC0C(AnimationFile *this); +void func_8033BAB0(enum asset_e asset_id, s32 offset, s32 size, void *dst_ptr); + +/* .core2 */ +f32 func_8033AA10(AnimationFile *this, s32 arg1){ + if(arg1 == this->unk2) + return D_80378F50; + return (f32)(arg1 - this->unk0)/(f32)(this->unk2 - this->unk0); +} + +void func_8033AA50(AnimationFile *anim_file, f32 arg1, s32 arg2){ + s32 tmp_s1; + int i; + f32 tmp_f22; + AnimationFileElement *tmp_s0; + f32 sp54[3][3]; + + tmp_f22 = func_8033ABA0(anim_file, arg1); + tmp_s0 = (s32)anim_file + sizeof(AnimationFile); + tmp_s1 = 0; + for(i = 0; i < anim_file->elem_cnt; i++){//L8033AAB8 + if(tmp_s0->unk0_15 != tmp_s1){ + if(tmp_s1) + func_8033AFB8(arg2, tmp_s1, sp54); + tmp_s1 = tmp_s0->unk0_15; + sp54[0][0] = sp54[0][1] = sp54[0][2] = 0.0f; + sp54[1][0] = sp54[1][1] = sp54[1][2] = 1.0f; + sp54[2][0] = sp54[2][1] = sp54[2][2] = 0.0f; + } + sp54[0][tmp_s0->unk0_3] = func_8033AC38(anim_file, tmp_s0, tmp_f22); + tmp_s0 += tmp_s0->data_cnt; + tmp_s0++; + }//L8033AB60 + func_8033AFB8(arg2, tmp_s1, sp54); +} + +f32 func_8033ABA0(AnimationFile *this, f32 arg1){ + return this->unk0 + arg1*(this->unk2 - this->unk0); +} + +f32 func_8033ABCC(AnimationFile *this){ + f32 tmp = func_8033AC0C(this); + return (tmp - 1.0)/tmp; +} + +s32 func_8033AC0C(AnimationFile *this){ + return this->unk2; +} + +s32 func_8033AC14(AnimationFile *this){ + return this->unk0; +} + +s32 func_8033AC1C(AnimationFile *this){ + return this->unk2 - this->unk0 + 1; +} + +s32 func_8033AC30(AnimationFile *this){ + return this->elem_cnt; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B3A80/func_8033AC38.s") +// f32 func_8033AC38(AnimationFile *this, AnimationFileElement *elem, f32 arg2){ +// f32 sp38[4]; +// AnimationFileData *tmp_a0; +// int i; + +// if((s32)arg2 < elem->data[0].unk0_13){ +// sp38[0] = sp38[1] = D_803709E0[elem->unk0_3]; +// sp38[2] = (f32)elem->data[0].unk2/64; +// sp38[3] = (elem->data[0].unk0_15 == 1 && elem->unk2 >= 2) ? (f32)elem->data[1].unk2/64 : sp38[2]; +// return func_80340A4C((arg2 - this->unk0)/(elem->data[0].unk0_13 - this->unk0), 4, sp38); +// }////L8033AD30 + +// tmp_a0 = &elem->data[elem->unk2]; +// if(!((s32)arg2 < tmp_a0[-1].unk0_13)){ +// sp38[1] = (f32)tmp_a0->unk2/ 64; +// sp38[0] = (tmp_a0->unk0_15 == 1 && tmp_a0->unk2 >= 2) ? (f32)elem->data[-1].unk2/64 : sp38[1]; +// sp38[2] = sp38[3] = sp38[1]; +// return func_80340A4C(64.0f - (f32)tmp_a0->unk0_13, 4, sp38); +// }//L8033AE0C +// } + +func_8033AFB8(Struct_B1400 *arg0, s32 arg1, f32 arg2[3][3]){ + f32 sp18[4]; + func_80345CD4(sp18, arg2[0]); + func_8033A8F0(arg0, arg1, sp18); + func_8033A928(arg0, arg1, arg2[1]); + func_8033A968(arg0, arg1, arg2[2]); +} + +void func_8033B020(void *ptr){ + struct21s *start_ptr; + struct21s *end_ptr; + struct21s *iPtr; + + end_ptr = (struct21s *) vector_getEnd(D_80383CE0[0]); + start_ptr = (struct21s *) vector_getBegin(D_80383CE0[0]); + for(iPtr = start_ptr; iPtr < end_ptr && ptr != iPtr->unk1; iPtr++); + if (iPtr < end_ptr) { + iPtr->unk0++; + } + else{ + iPtr = (struct21s *)vector_pushBackNew(&D_80383CE0[0]); + iPtr->unk0 = 1; + iPtr->unk1 = ptr; + } +} + +bool func_8033B0D0(void *arg0) { + struct21s *start_ptr; + struct21s *end_ptr; + struct21s *iPtr; + s32 j; + + for(j = 0; j < 2; j++){ + end_ptr = (struct21s *) vector_getEnd(D_80383CE0[j]); + start_ptr = (struct21s *) vector_getBegin(D_80383CE0[j]); + for(iPtr = start_ptr; iPtr < end_ptr && arg0 != iPtr->unk1; iPtr++){ + } + if (iPtr < end_ptr){ + return TRUE; + } + } + return FALSE; +} + +void func_8033B180(void){ + D_80383CE0[0] = vector_new(sizeof(struct21s), 0x10); + D_80383CE0[1] = vector_new(sizeof(struct21s), 0x10); +} + +void func_8033B1BC(void){ + struct21s *tmp_a0; + struct21s *iPtr; + struct21s *start_ptr; + struct21s *endPtr; + int i; + + tmp_a0 = D_80383CE0[0]; + D_80383CE0[0] = D_80383CE0[1]; + D_80383CE0[1] = tmp_a0; + + endPtr = (struct21s *) vector_getEnd(D_80383CE0[0]); + start_ptr = (struct21s *) vector_getBegin(D_80383CE0[0]); + for(iPtr = start_ptr; iPtr < endPtr; iPtr++){ + for(i = 0; i < iPtr->unk0; i++) + assetcache_release(iPtr->unk1); + } + + vector_clear(D_80383CE0[0]); +} + +void func_8033B268(void){ + D_80383CE0[0] = defrag(D_80383CE0[0]); + D_80383CE0[1] = defrag(D_80383CE0[1]); +} + +void func_8033B2A4(s32 arg0) { + D_80383CD0[D_80370A14] = malloc(arg0); + D_80383CD4[D_80370A14] = NULL; + assetCache_depCount[D_80370A14] = 1; + D_80383CDC[D_80370A14] = -1; + D_80370A14 += 1; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B3A80/func_8033B338.s") +#else +bool func_8033B338(BKSprite **sprite_ptr, BKSpriteDisplayData **arg1) { + if (*sprite_ptr == NULL) { + return FALSE; + } + assetcache_release(*sprite_ptr); + *sprite_ptr = NULL; + *arg1 = NULL; + return TRUE; +} +#endif + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B3A80/func_8033B388.s") +#else +bool func_8033B388(BKSprite **sprite_ptr, BKSpriteDisplayData **arg1){ + if(*sprite_ptr == NULL) + return FALSE; + + func_8033B020(*sprite_ptr); + *sprite_ptr = NULL; + *arg1 = NULL; + return TRUE; +} +#endif + +s32 assetcache_release(void * arg0){ + s32 i; + if(arg0){ + for(i = 0; i < D_80370A14 && arg0 != D_80383CD0[i]; i++); + + if(i == D_80370A14) + return 2; + + D_80370A18 = i; + if(assetCache_depCount[i] == 1){ + if(D_80383CD4[i]) + func_803449DC(D_80383CD4[i]); + free(arg0); + D_80370A14--; + assetCache_depCount[i] = assetCache_depCount[D_80370A14]; + D_80383CD0[i] = D_80383CD0[D_80370A14]; + D_80383CD4[i] = D_80383CD4[D_80370A14]; + D_80383CDC[i] = D_80383CDC[D_80370A14]; + return 0; + } + else{ + assetCache_depCount[i]--; + return 1; + } + } else{ + return 3; + } +} + +void assetcache_update_ptr(void * arg0, void* arg1){ + s32 i; + + if((arg0 == NULL) || (arg1 == NULL) || (arg0 == arg1)) + return; + + for(i = 0; i < D_80370A14 && arg0 != D_80383CD0[i]; i++); + + if(i != D_80370A14 && arg1 != D_80383CD0[i]) + D_80383CD0[i] = arg1; +} + +void func_8033B5FC(void){ + func_8033B268(); +} + +void func_8033B61C(void){ + func_80254008(); + func_8033B1BC(); + func_8033B1BC(); +} + +s32 func_8033B64C(s32 arg0){ + return D_80383CC4[arg0].unk6; +} + +s32 func_8033B664(void){//asset get rom count + return D_80383CC0->count-1; +} + +s32 func_8033B678(void ){//static last asset decompressed size + return D_80370A10; +} + +s32 func_8033B684(s32 arg0){ //asset_size + return D_80383CC4[arg0+1].offset - D_80383CC4[arg0].offset; +} + +s32 func_8033B6A4(enum asset_e arg0){ //asset_compressed? + return (D_80383CC4[arg0].compFlag & 1) !=0; +} + +//returns raw sprite(as saved in ROM) and points arg1 to a parsed sprite(?) +BKSprite *func_8033B6C4(enum asset_e sprite_id, BKSpriteDisplayData **arg1){ + BKSprite *s0; + s0 = assetcache_get(sprite_id); + if(D_80383CD4[D_80370A18] == NULL){ + func_803382E4(-1); + func_80338308(func_802510A0(s0), func_802510A8(s0)); + D_80383CD4[D_80370A18] = func_80344A1C(s0); + } + *arg1 = D_80383CD4[D_80370A18]; + return s0; +} + +void func_8033B788(void ){ + D_80370A1C = 1; +} + +void *assetcache_get(s32 arg0) { + s32 comp_size;//sp_44 + s32 i; + volatile s32 sp3C; //sp3C + s32 uncomp_size; //sp38 + void *uncompressed_file;//sp34 + u8 sp33; //sp33 + void *compressed_file;//sp2C + s32 sp28;//sp28 + + sp28 = (s32 )D_80370A1C; + D_80370A1C = (u8)0U; + for(i = 0; i < D_80370A14 && arg0 != D_80383CDC[i]; i++); + D_80370A18 = i; + if(i == 0x96) + return NULL; + + if(i < D_80370A14){ //asset exists in array; + assetCache_depCount[i]++; + return D_80383CD0[i]; + } + comp_size = D_80383CC4[arg0+1].offset - D_80383CC4[arg0].offset; + if(comp_size & 1) + comp_size++; + sp3C = comp_size; + + if(D_80383CC4[arg0].compFlag & 0x0001){//compressed + func_8033BAB0(arg0, 0, 0x10, &D_80383CB0); + D_80370A10 = rarezip_get_uncompressed_size(&D_80383CB0); + uncomp_size = D_80370A10; + if(uncomp_size & 0xF){ + uncomp_size -= uncomp_size & 0xF; + uncomp_size += 0x10; + } + + if (func_8025498C((u32)comp_size + uncomp_size) && !sp28) { + sp33 = 1; + uncompressed_file = malloc((u32)comp_size + uncomp_size); + compressed_file = (s32) uncompressed_file + uncomp_size; + } else { + sp33 = 2; + if (sp28 != 0) { + func_80254C98(); + } + uncompressed_file = malloc(uncomp_size); + compressed_file = malloc(comp_size); + } + } else { //uncompressed + uncompressed_file = malloc(comp_size); + compressed_file = uncompressed_file; + } + func_802405F0(compressed_file, D_80383CC4[arg0].offset + D_80383CCC, sp3C); + if(D_80383CC4[arg0].compFlag & 0x0001){//decompress + rarezip_inflate(compressed_file, uncompressed_file); + realloc(uncompressed_file, D_80370A10); + osWritebackDCache(uncompressed_file, D_80370A10); + if (sp33 == 2) { + free(compressed_file); + } + } + D_80370A18 = D_80370A14; + assetCache_depCount[D_80370A14] = 1; + D_80383CD0[D_80370A14] = uncompressed_file; + D_80383CD4[D_80370A14] = 0; + D_80383CDC[D_80370A14] = arg0; + D_80370A14++; + return uncompressed_file; +} + +void func_8033BAB0(enum asset_e asset_id, s32 offset, s32 size, void *dst_ptr) { + func_802405F0(dst_ptr, D_80383CC4[asset_id].offset + D_80383CCC + offset, size); +} + +void func_8033BB00(void *arg0, s32 arg1){ + s32 tmp; + s32 i; + + for(i = 0; i < D_80370A14 && arg0 != D_80383CD0[i]; i++); + D_80383CD0[i] = realloc(arg0, arg1); +} + +//assetCache_init +void func_8033BB84(void){ + D_80370A1C = 0; + func_8033B180(); + D_80383CD0 = malloc(600); + D_80383CD4 = malloc(600); + assetCache_depCount = malloc(150); + D_80383CDC = malloc(150*sizeof(s16)); + D_80370A14 = 0; + D_80383CC0 = malloc(sizeof(AssetROMHead)); + D_80383CC8 = (u32) &D_5E90; + func_802405F0(D_80383CC0, D_80383CC8, sizeof(AssetROMHead)); + D_80383CC4 = malloc(D_80383CC0->count*sizeof(AssetFileMeta)); + func_802405F0(D_80383CC4, D_80383CC8 + sizeof(AssetROMHead),D_80383CC0->count*sizeof(AssetFileMeta)); + D_80383CCC = D_80383CC8 + sizeof(AssetROMHead) + D_80383CC0->count*sizeof(AssetFileMeta); +} + +s32 func_8033BC94(s32 arg0){ //asset_compressedSize + return D_80383CC4[arg0+1].offset - D_80383CC4[arg0].offset; +} + +s32 func_8033BCB4(s32 arg0){ //asset_getDependencyCount + s32 i; + + for(i = 0; i < D_80370A14 && arg0 != D_80383CDC[i]; i++); + if(i < D_80370A14){ + return assetCache_depCount[i]; + } + return 0; +} + +void func_8033BD20(BKModelBin **arg0){ + func_8033B020(*arg0); + *arg0 = NULL; +} + +void func_8033BD4C(void *arg0){ + func_8033B020(arg0); +} + +void func_8033BD6C(void){ + func_8033B1BC(); +} + +void func_8033BD8C(void* arg0){ + func_8033B0D0(arg0); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B3A80/func_8033BDAC.s") +#else +void *func_8033BDAC(enum asset_e id, void *dst, s32 size) { + s32 comp_size; + u8 sp2B; + s32 aligned_decomp_size; + s32 sp20; + s16 *temp_a0; + s32 temp_s0; + s32 temp_s1; + s32 temp_t0; + s32 temp_v0; + s32 temp_v0_3; + s32 temp_v1_2; + s32 temp_v1_3; + u8 temp_v1; + void *temp_v0_2; + s32 phi_v0; + s8 phi_v0_2; + s32 decomp_ptr; + s32 phi_v1; + + //find asset in cache + for(phi_v0 = 0; phi_v0 < D_80370A14 && id != D_80383CDC[phi_v0]; phi_v0++); + D_80370A18 = phi_v0; + if (phi_v0 == 0x96) { + return 0; + } + temp_v1_2 = D_80383CC4[id].offset; + comp_size = D_80383CC4[id + 1].offset; - temp_v1_2; + phi_v1 = temp_v1_2; + if (comp_size & 1) { + comp_size++; + } + if (D_80383CC4[id].compFlag & 1) { + func_8033BAB0(id, 0, 0x10, &D_80383CB0); + D_80370A10 = rarezip_get_uncompressed_size(&D_80383CB0); + + // get aligned uncompressed size + aligned_decomp_size = D_80370A10; + if (aligned_decomp_size & 0xF) { + aligned_decomp_size = (aligned_decomp_size - (aligned_decomp_size & 0xF)) + 0x10; + } + + if (size >= (comp_size + aligned_decomp_size)) { + sp2B = 1; + decomp_ptr = (s32)dst + aligned_decomp_size; + } + else if(size >= aligned_decomp_size) { + sp2B = 2; + decomp_ptr = malloc(size); + } + else{ + return 0; + } + } + else{ + if (comp_size & (0x10 -1)) { + comp_size = (comp_size - (comp_size & (0x10 -1))) + 0x10; + } + if(size < comp_size) + return 0; + } + func_802405F0(decomp_ptr, D_80383CC4[id].offset + D_80383CCC, comp_size); + if (D_80383CC4[id].compFlag & 1) { + rarezip_inflate(decomp_ptr, dst); + osWritebackDCache(dst, D_80370A10); + if (sp2B == 2) { + free(decomp_ptr); + } + } + return decomp_ptr; +} +#endif diff --git a/src/core2/code_B5040.c b/src/core2/code_B5040.c new file mode 100644 index 00000000..b9be7d9f --- /dev/null +++ b/src/core2/code_B5040.c @@ -0,0 +1,376 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "save.h" + +typedef struct { + s16 unk0; + s16 unk2; +}Struct_B5040; + +void savedata_clear(u8 *savedata); +s32 savedata_verify(s32 arg0, SaveData *savedata); + +extern Struct_B5040 D_80370A20[]; +extern s32 D_80383CF0; +extern s32 D_80383CF4; //jiggy_offset +extern s32 D_80383CF8; //honeycomb_offset +extern s32 D_80383CFC; //mumbotoken_offset +extern s32 D_80383D00; //notescores_offset +extern s32 D_80383D04; //timescores_offset +extern s32 D_80383D08; //savedata_jiggy_offset +extern s32 D_80383D0C; //saved_item_offset +extern s32 D_80383D10; //abilities_offset +extern s32 D_80383D14; //end_offset + +extern u8 D_80383D18; + +/* .code */ +void savedata_update_crc(s32 buffer, s32 size){ + u32 sp20[2]; + u32 sum; + glcrc_calc_checksum(buffer, buffer + size - 4, sp20); + sum = sp20[0] ^ sp20[1]; + *(u32*)(buffer + size - 4) = sum; +} + +int _savedata_verify(SaveData *savedata, s32 size){ + u32 result[2]; //sp28 + u32 *crc_ptr; + u32 expect_crc; //sp20 + + crc_ptr = (u32*)((s32)savedata + size) - 1; + expect_crc = *crc_ptr; + glcrc_calc_checksum(savedata, crc_ptr, result); + *crc_ptr = expect_crc; + if((result[0]^result[1]) != expect_crc) + return 0x6e382; + return 0; +} + +void func_8033C070(void){ //savedata_init + s32 sp54; + s32 sp50; + s32 sp4C; + s32 sp48 = 0; + s32 sp44 = 0; + s32 sp40; + s32 sp3C; + s32 sp38; + u8 *sp34; + u8 *sp30; + u8 *sp2C; + u8 *sp28; + u8 *sp24; + u8 *sp20; + u8 *sp1C; + u8 *sp18; + + jiggyscore_info(&sp54, &sp34); + honeycombscore_get_size_and_ptr(&sp50, &sp30); + mumboscore_get_size_and_ptr(&sp4C, &sp2C); + func_8032008C(&sp40, &sp28); + func_80346F44(&sp48, &sp24); + func_8034722C(&sp44, &sp20); + func_80347630(&sp3C, &sp1C); + func_8029587C(&sp38, &sp18); + D_80383CF0 = 0; + D_80383CF4 = D_80383CF0 + 2; + D_80383CF8 = D_80383CF4 + sp54; + D_80383CFC = D_80383CF8 + sp50; + D_80383D00 = D_80383CFC + sp4C; + D_80383D04 = D_80383D00 + sp48; + D_80383D08 = D_80383D04 + sp44; + D_80383D0C = D_80383D08 + sp40; + D_80383D10 = D_80383D0C + sp3C; + D_80383D14 = D_80383D10 + sp38; +} + +void __savedata_load_jiggyScore(u8 *savedata){ + s32 sp2C; + u8 *sp28; + int i; + + jiggyscore_info(&sp2C, &sp28); + for(i = D_80383CF4; i < D_80383CF4 + sp2C; i++){ + sp28[i - D_80383CF4] = savedata[i]; + } + func_8034798C(); +} + +void __savedata_load_honeycombScore(u8 *savedata){ //savedata_save_honeycomb + s32 sp2C; + u8 *sp28; + int i; + + honeycombscore_get_size_and_ptr(&sp2C, &sp28); + for(i = D_80383CF8; i < D_80383CF8 + sp2C; i++){ + sp28[i - D_80383CF8] = savedata[i]; + } + func_80347958(); +} + +void __savedata_load_mumboScore(u8 *savedata){ + s32 sp2C; + u8 *sp28; + int i; + + mumboscore_get_size_and_ptr(&sp2C, &sp28); + for(i = D_80383CFC; i < D_80383CFC + sp2C; i++){ + sp28[i - D_80383CFC] = savedata[i]; + } + func_80347984(); +} + +void func_8033C348(u8 *savedata){ + s32 sp2C; + u8 *sp28; + int i; + + func_80346F44(&sp2C, &sp28); + for(i = D_80383D00; i < D_80383D00 + sp2C; i++){ + sp28[i - D_80383D00] = savedata[i]; + } + func_803476B0(sp28); +} + +void func_8033C3D4(u8 *savedata){ + s32 sp2C; + u8 *sp28; + int i; + + func_8034722C(&sp2C, &sp28); + for(i = D_80383D04; i < D_80383D04 + sp2C; i++){ + sp28[i - D_80383D04] = savedata[i]; + } + func_8034774C(sp28); +} + +void func_8033C460(u8 *savedata){ //global_progress + s32 sp2C; + u8 *sp28; + int i; + + func_8032008C(&sp2C, &sp28); + for(i = D_80383D08; i < D_80383D08 + sp2C; i++){ + sp28[i - D_80383D08] = savedata[i]; + } +} + +void func_8033C4E4(u8 *savedata){ //saveddata_load_collectibles + s32 sp2C; + u8 *sp28; + int i; + + func_80347630(&sp2C, &sp28); + for(i = D_80383D0C; i < D_80383D0C + sp2C; i++){ + sp28[i - D_80383D0C] = savedata[i]; + } + func_803479C0(sp28); +} + +void func_8033C570(u8 *savedata){ //savedata_load_abilities + s32 sp2C; + u8 *sp28; + int i; + + func_8029587C(&sp2C, &sp28); + for(i = D_80383D10; i < D_80383D10 + sp2C; i++){ + sp28[i - D_80383D10] = savedata[i]; + } +} + +void func_8033C5F4(u8 *savedata){ + savedata[D_80383CF0] = 0x11; +} + +void __savedata_save_jiggyScore(u8 *savedata){ //savedata_save_jiggies + s32 sp2C; + u8 *sp28; + int i; + + jiggyscore_info(&sp2C, &sp28); + for(i = D_80383CF4; i < D_80383CF4 + sp2C; i++){ + savedata[i] = sp28[i - D_80383CF4]; + } +} + +void __savedata_save_honeycombScore(u8 *savedata){ //savedata_save_honeycomb + s32 sp2C; + u8 *sp28; + int i; + + honeycombscore_get_size_and_ptr(&sp2C, &sp28); + for(i = D_80383CF8; i < D_80383CF8 + sp2C; i++){ + savedata[i] = sp28[i - D_80383CF8]; + } +} + +void __savedata_save_mumboScore(u8 *savedata){ + s32 sp2C; + u8 *sp28; + int i; + + mumboscore_get_size_and_ptr(&sp2C, &sp28); + for(i = D_80383CFC; i < D_80383CFC + sp2C; i++){ + savedata[i] = sp28[i - D_80383CFC]; + } +} + +void func_8033C798(u8 *savedata){ + s32 sp2C; + u8 *sp28; + int i; + + func_80346F44(&sp2C, &sp28); + for(i = D_80383D00; i < D_80383D00 + sp2C; i++){ + savedata[i] = sp28[i - D_80383D00]; + } +} + +void func_8033C81C(u8 *savedata){ + s32 sp2C; + u8 *sp28; + int i; + + func_8034722C(&sp2C, &sp28); + for(i = D_80383D04; i < D_80383D04 + sp2C; i++){ + savedata[i] = sp28[i - D_80383D04]; + } +} + +void func_8033C8A0(u8 *savedata){ //global_progress + s32 sp2C; + u8 *sp28; + int i; + + func_8032008C(&sp2C, &sp28); + for(i = D_80383D08; i < D_80383D08 + sp2C; i++){ + savedata[i] = sp28[i - D_80383D08]; + } +} + +void func_8033C924(u8 *savedata){ //saveddata_save_collectibles + s32 sp2C; + u8 *sp28; + int i; + + func_80347630(&sp2C, &sp28); + for(i = D_80383D0C; i < D_80383D0C + sp2C; i++){ + savedata[i] = sp28[i - D_80383D0C]; + } +} + +void func_8033C9A8(u8 *savedata){ //savedata_save_abilities + s32 sp2C; + u8 *sp28; + int i; + + func_8029587C(&sp2C, &sp28); + for(i = D_80383D10; i < D_80383D10 + sp2C; i++){ + savedata[i] = sp28[i - D_80383D10]; + } +} + +s32 func_8033CA2C(s32 filenum, SaveData *save_data){ + s32 sp1C; + + sp1C = load_file_blocks(filenum, 0, save_data, 0xF); + if( sp1C + || savedata_verify(0x78, save_data) + || ((u8*)save_data)[D_80383CF0] != 0x11 + ){ + sp1C = 2; + } + return sp1C; +} + +s32 func_8033CA9C(SaveData *savedata){ + s32 sp1C; + + sp1C = load_file_blocks(0, 0x3C, savedata, 0x4); + if( sp1C + || savedata_verify(0x20, savedata) + ){ + sp1C = 2; + } + return sp1C; +} + +s32 savedata_verify(s32 size, SaveData *savedata){ + s32 v1; + + v1 = _savedata_verify(savedata, size); + if(v1) + v1 = 3; + return v1; +} + +void saveData_load(SaveData *savedata){ + int i; + func_8033C460(savedata); + __savedata_load_jiggyScore(savedata); + __savedata_load_honeycombScore(savedata); + __savedata_load_mumboScore(savedata); + func_8033C348(savedata); + func_8033C3D4(savedata); + func_8033C4E4(savedata); + func_8033C570(savedata); + for(i = 0; D_80370A20[i].unk0 != -1; i++){ + func_803204E4(D_80370A20[i].unk0, func_8031FF1C(D_80370A20[i].unk2)); + } +} + +void saveData_create(SaveData *savedata){ + int i; + for(i = 0; D_80370A20[i].unk0 != -1; i++){ + func_80320004(D_80370A20[i].unk2, func_803203FC(D_80370A20[i].unk0)); + } + savedata_clear(savedata); + func_8033C5F4(savedata); + __savedata_save_jiggyScore(savedata); + __savedata_save_honeycombScore(savedata); + __savedata_save_mumboScore(savedata); + func_8033C798(savedata); + func_8033C81C(savedata); + func_8033C8A0(savedata); + func_8033C924(savedata); + func_8033C9A8(savedata); + savedata_update_crc(savedata, sizeof(SaveData)); +} + +int func_8033CC98(s32 filenum, u8 *buffer){ + int out; + out = write_file_blocks(filenum, 0, buffer, 0xF); + if(out){ + out = 1; + } + return out; +} + +int func_8033CCD0(s32 filenum){ + int out; + out = write_file_blocks(filenum, 0, &D_80383D18, 1); + if(out){ + out = 1; + } + return out; +} + +int func_8033CD0C(u8 *buffer){ + int out; + savedata_update_crc(buffer, 0x20); + out = write_file_blocks(0, 0x3C, buffer, 4); + if(out){ + out = 1; + } + return out; +} + +void savedata_clear(u8 *savedata){ + int i; + for(i = 0; i < sizeof(SaveData); i++){ + savedata[i] = 0; + } +} diff --git a/src/core2/code_B5E00.c b/src/core2/code_B5E00.c new file mode 100644 index 00000000..2a6329b8 --- /dev/null +++ b/src/core2/code_B5E00.c @@ -0,0 +1,135 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "save.h" + +extern SaveData D_80383D20[4]; //save_data +extern s8 D_80383F00[4]; //gamenum to filenum +extern s32 D_80383F04; + +/* .code */ +int func_8033CD90(s32 filenum){ + int i; + s32 tmp_v1; + void *s2; + s2 = &D_80383D20[filenum]; + i = 3; + while(i != 0){ + tmp_v1 = func_8033CA2C(filenum, s2); + if(!tmp_v1) + break; + i--; + } + if(tmp_v1) + savedata_clear(s2); + return tmp_v1; +} + +void func_8033CE14(s32 gamenum){ + func_8033CD90(D_80383F00[gamenum]); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B5E00/func_8033CE40.s") +#else +void func_8033CE40(void) { + s32 sp48[4]; + s32 var_s0; + s32 var_s0_2; + s32 i; + + sp48[3] = 0; + D_80383F04 = -1; + for(i = 0; i < 3; i++){ + D_80383F00[i] = -1; + sp48[i] = 0; + } + for(var_s0 = 0; var_s0 < 4; var_s0++){ + if( (func_8033CD90(var_s0) == 0) + && (D_80383F00[D_80383D20[var_s0].unk1 - 1] == -1)) { + D_80383F00[D_80383D20[var_s0].unk1 - 1] = var_s0; + sp48[var_s0] = 1; + } else { + D_80383F04 = var_s0; + } + } + for(i = 0; i < 3; i++){ + for(var_s0_2 = 0; (var_s0_2 < 4) && (D_80383F00[i] == -1); var_s0_2++){ + if (sp48[var_s0_2] == 0) { + sp48[var_s0_2] = 1; + D_80383F00[i] = var_s0_2; + } + } + } +} +#endif + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B5E00/func_8033CFD4.s") +#else +int func_8033CFD4(s32 gamenum){ + s32 prev = D_80383F00[gamenum]; + s32 next = D_80383F04; + u32 i; + s32 tmp_s1; + SaveData *tmp_s2; + + D_80383F00[gamenum] = next; + bcopy(&D_80383D20[D_80383F00[prev]], &D_80383D20[next], 0x78); + tmp_s2 = &D_80383D20[D_80383F04]; + tmp_s2->unk1 = gamenum + 1; + savedata_update_crc(tmp_s2, 0x78); + for(i = 3; i > 0; i--){//L8033D070 + tmp_s1 = func_8033CC98(next, tmp_s2); + if(!tmp_s1){ + func_8033CE14(gamenum); + } + if(!tmp_s1) + break; + } + if(!tmp_s1){ + for(i = 3; i > 0; i--){//L8033D070 + tmp_s1 = func_8033CCD0(prev); + if(!tmp_s1) + break; + } + } + if(tmp_s1){ + D_80383F00[gamenum] = prev; + } + else{ + D_80383F04 = prev; + } + return tmp_s1; +} +#endif + +void func_8033D0FC(s32 gamenum){ + s32 filenum = D_80383F00[gamenum]; + savedata_clear(&D_80383D20[filenum]); +} + +void func_8033D13C(s32 gamenum){ + s32 filenum = D_80383F00[gamenum]; + saveData_load(&D_80383D20[filenum]); +} + +void func_8033D17C(s32 gamenum){ + s32 filenum = D_80383F00[gamenum]; + saveData_create(&D_80383D20[filenum]); +} + +bool func_8033D1BC(s32 gamenum){ + s32 filenum = D_80383F00[gamenum]; + return D_80383D20[filenum].unk0 != 0; +} + +bool func_8033D1EC(void){ + int i; + for(i = 0; i < 3; i++){ + if(func_8033D1BC(i)) + return TRUE; + } + return FALSE; +} diff --git a/src/core2/code_B62B0.c b/src/core2/code_B62B0.c new file mode 100644 index 00000000..3edce061 --- /dev/null +++ b/src/core2/code_B62B0.c @@ -0,0 +1,110 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + u16 unk0; + u16 unk2; + u16 unk4[11]; +} Struct_core2_B62B0_0; + +typedef struct{ + s32 (*unk0)(ActorMarker *, ActorMarker *); + s32 unk4; +} Struct_core2_B62B0_1; + +extern Struct_core2_B62B0_0 D_80370AC0[]; +extern Struct_core2_B62B0_1 D_80371DC0[]; + +extern s16 D_80383F10[]; + + +s32 func_8033D240(ActorMarker *arg0, ActorMarker *arg1){ + if(arg0){ + if(!arg0->unk14_20 && player_getActiveHitbox(arg1) == HITBOX_6_WONDERWING) + return -1; + return arg0->unk14_20; + } + return -1; +} + +s32 func_8033D2A8(ActorMarker *arg0, ActorMarker *arg1){ + if(!arg0) + return HITBOX_6_WONDERWING; + + if(!arg0->unk14_20) + return player_getActiveHitbox(arg1); + return HITBOX_0_NONE; +} + +void func_8033D2F4(void) { + s32 var_a0; + bool var_a1; + s32 var_v1; + s32 var_v0 = 0xBB; + + for(var_v1 = 0; var_v1 < 0x2A9; var_v1++) { + for(((var_a0 = 0), (var_a1 = FALSE), (D_80383F10[var_v1] = -1)); (var_a0 < var_v0) && !var_a1; var_a0++){ + if (var_v1 == D_80370AC0[var_a0].unk0) { + D_80383F10[var_v1] = var_a0; + var_a1 = TRUE; + } + } + } + + for(var_a0 = 0; var_a0 < var_v0; var_a0++) { + for(var_v1 = 0; var_v1 < 10; var_v1++){ + D_80370AC0[var_a0].unk4[var_v1] |= D_80370AC0[var_a0].unk2; + } + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B62B0/func_8033D410.s") +#else +bool func_8033D410(ActorMarker *arg0, ActorMarker *arg1) { + s32 sp38; + s16 temp_t0; + s32 temp_s0; + s32 var_s2; + s16 *var_s0; + + sp38 = D_80383F10[arg1->unk14_20]; + if (sp38 == -1) { + return FALSE; + } + var_s0 = D_80370AC0[sp38].unk4; + for(var_s2 = 0; var_s2 < 11; var_s2++){ + if ((var_s0[var_s2] != 0) && (D_80371DC0[var_s2].unk0(arg0, arg1) == D_80371DC0[var_s2].unk4)) { + func_80330078(arg1, arg0, &D_80370AC0[sp38].unk4[var_s2]); + func_80330078(arg0, arg1, &D_80370AC0[sp38].unk4[var_s2]); + break; + } + } + return TRUE; +} +#endif + +s32 func_8033D564(struct5Cs *arg0){ + return arg0->unk0_15; +} + +s32 func_8033D574(struct5Cs *arg0){ + return arg0->unk0_11; +} + +s32 func_8033D584(struct5Cs *arg0){ + return arg0->unk0_9; +} + +s32 func_8033D594(struct5Cs *arg0){ + return arg0->unk0_6; +} + +s32 func_8033D5A4(struct5Cs *arg0){ + return arg0->unk0_4; +} + +s32 func_8033D5B4(struct5Cs *arg0){ + return arg0->unk0_1; +} diff --git a/src/core2/code_B650.c b/src/core2/code_B650.c new file mode 100644 index 00000000..3821af4e --- /dev/null +++ b/src/core2/code_B650.c @@ -0,0 +1,75 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +struct { + u8 unk0; + u8 pad1[3]; + f32 unk4; + f32 unk8[3]; + void (*unk14)(ActorMarker *); + ActorMarker *unk18; +}D_8037C160; + +/* .code */ +void func_802925E0(s32 arg0){ + D_8037C160.unk0 = arg0; +} + +s32 func_802925EC(void){ + return D_8037C160.unk0; +} + +void func_802925F8(f32 arg0[3], f32 *arg1){ + ml_vec3f_copy(arg0, D_8037C160.unk8); + *arg1 = D_8037C160.unk4; +} + +enum bs_e func_80292630(void){ + func_802925E0(5); + return func_8029BD90(); +} + +enum bs_e func_80292658(f32 arg0[3], f32 arg1, void (*arg2)(ActorMarker *), ActorMarker *arg3){ + ml_vec3f_copy(D_8037C160.unk8, arg0); + D_8037C160.unk4 = arg1; + D_8037C160.unk14 = arg2; + D_8037C160.unk18 = arg3; + func_802925E0(1); + return func_8029BD90(); +} + +enum bs_e func_802926C0(void){ + func_802925E0(2); + return func_8029BD90(); +} + +enum bs_e func_802926E8(void){ + func_802925E0(0x3); + return func_8029BD90(); +} + +enum bs_e func_80292710(void){ + func_802925E0(0x6); + return func_8029BD90(); +} + +enum bs_e func_80292738(void){ + miscflag_clear(0x19); + func_802925E0(0x4); + return func_8029BD90(); +} + +void func_80292768(void){ + if(D_8037C160.unk14){ + D_8037C160.unk14(D_8037C160.unk18); + } +} + +void func_8029279C(void){ + D_8037C160.unk0 = 0; + D_8037C160.unk14 = 0; + D_8037C160.unk4 = 0.1f; + ml_vec3f_clear(D_8037C160.unk8); +} diff --git a/src/core2/code_B6640.c b/src/core2/code_B6640.c new file mode 100644 index 00000000..5203ab1c --- /dev/null +++ b/src/core2/code_B6640.c @@ -0,0 +1,21 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_8033D5D0(f32 arg0[3], f32 arg1[3], f32 margin, f32 min[3], f32 max[3]) { + s32 i; + + i = 0; + for(i = 0; i < 3; i++){ + if (arg0[i] < arg1[i]) { + min[i] = arg0[i]; + max[i] = arg1[i]; + } else { + min[i] = arg1[i]; + max[i] = arg0[i]; + } + min[i] -= margin; + max[i] += margin; + } +} diff --git a/src/core2/code_B6C60.c b/src/core2/code_B6C60.c new file mode 100644 index 00000000..784313ad --- /dev/null +++ b/src/core2/code_B6C60.c @@ -0,0 +1,29 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .rodata */ +extern f64 D_80378F80; + +/* .bss */ +extern s32 D_80384470; + +/* .code */ +f32 func_8033DBF0(void){ + return (f32)D_80384470; +} + +void func_8033DC04(void){ + D_80384470 = 0; +} + +void func_8033DC10(void){} + +void func_8033DC18(void){} + +f32 func_8033DC20(void){ + f32 out; + D_80384470 = func_8024BD94(); + out = D_80378F80*D_80384470; + return out; +} diff --git a/src/core2/code_B6CE0.c b/src/core2/code_B6CE0.c new file mode 100644 index 00000000..6421f56a --- /dev/null +++ b/src/core2/code_B6CE0.c @@ -0,0 +1,51 @@ +#include +#include "functions.h" +#include "variables.h" + +/*.data*/ +f32 D_80371E20 = 1.0f; + +/* .bss */ +extern f32 D_80384480; +extern s32 D_80384484; + +/* .code */ +void func_8033DC70(void){ + D_80384480 = 0.01f; + D_80371E20 = 1.0f; + D_80384484 = 0; +} + +void func_8033DC9C(f32 arg0){ + if(arg0 != 0.0f){ + D_80384480 = MIN(arg0, 0.05); + } + else{ + D_80384480 = 0.01f; + } +} + +void func_8033DD04(s32 arg0){ + D_80384484 = MAX(MIN(0xf, arg0) , 1); + func_8033DC9C(D_80384484*(1/60.0)); +} + +s32 func_8033DD90(void){ + return D_80384484; +} + +f32 time_getDelta(void){ + return D_80384480*D_80371E20; +} + +f32 func_8033DDB8(void){ + return func_8024BD94()*(1/60.0); +} + +f32 func_8033DDEC(void){ + return time_getDelta()*30.0; +} + +void func_8033DE20(f32 arg0){ + D_80371E20 = arg0; +} diff --git a/src/core2/code_B6EA0.c b/src/core2/code_B6EA0.c new file mode 100644 index 00000000..beb8ba37 --- /dev/null +++ b/src/core2/code_B6EA0.c @@ -0,0 +1,342 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "code_B6EA0.h" + +extern s32 func_8033FA84(void); +extern s32 func_8035287C(void); +extern s32 func_80344CDC(void); +extern void func_8032FFEC(s32, s32); +extern void func_80352A38(s32, u32); +extern void func_8033FFB8(s32 , s32); +extern void projectile_getPosition(s32 , f32[3]); +extern void func_8032F64C(f32[3] , ActorMarker *); +extern void func_8033FB64(s32); +extern void func_80287D60(s32); +extern void func_803529DC(s32); +extern void func_80344D70(s32); +extern void func_80352B20(s32); +extern ActorMarker * func_8032FBE4(f32 *pos, MarkerDrawFunc arg1, int arg2, enum asset_e model_id); + +extern void (*func_80352614)(void); +extern void (*func_8035261C)(void); +extern void (*func_803526DC)(void); +extern void (*func_80355D58)(void); +extern void (*func_80355E80)(void); +extern void (*func_80355D50)(void); +extern void (*fxegg_head_spawn)(void); +extern void (*fxegg_head_update)(void); +extern void (*fxegg_head_destroy)(void); +extern void (*func_803546E8)(void); +extern void (*func_8035489C)(void); +extern void (*func_80354990)(void); +extern void (*fxegg_ass_spawn)(void); +extern void (*fxegg_ass_update)(void); +extern void (*fxegg_ass_destroy)(void); +extern void (*func_8035611C)(void); +extern void (*func_803562E8)(void); +extern void (*func_80356364)(void); +extern void (*func_80352DE4)(void); +extern void (*func_80352F58)(void); +extern void (*func_80352FF4)(void); +extern void (*func_80354998)(void); +extern void (*func_80354C18)(void); +extern void (*func_80354DC8)(void); +extern void (*func_80354DD0)(void); +extern void (*func_80354EEC)(void); +extern void (*func_80355004)(void); +extern void (*func_8035500C)(void); +extern void (*func_80355134)(void); +extern void (*func_80355294)(void); +extern void (*func_803540B4)(void); +extern void (*func_803541D8)(void); +extern void (*func_803540AC)(void); +extern void (*func_8035529C)(void); +extern void (*func_803553E8)(void); +extern void (*func_80355548)(void); +extern void (*func_80355550)(void); +extern void (*func_8035570C)(void); +extern void (*func_8035585C)(void); +extern void (*func_803543FC)(void); +extern void (*func_8035451C)(void); +extern void (*func_803543F4)(void); +extern void (*func_80355864)(void); +extern void (*func_80355B00)(void); +extern void (*func_80355C4C)(void); + +typedef struct { + u8 unk0; + u8 unk1; + //u8 pad2[0x2]; + f32 unk4; +}Struct_Core2_B6CE0_1; + +void func_8033E6D4(s32 arg0); + +/* .data */ +Struct_Core2_B6CE0_1 D_80371E30[] ={ + {0, 0, 0.0f}, + {1, 0, 0.07f}, + {2, 1, 0.29f}, + {3, 2, 0.15f}, + {4, 1, 0.05f} +}; + +/* .bss */ +extern ParticleStruct0s D_80384490[]; +extern s32 D_80384FD0; +extern struct { + s32 unk0; + s32 unk4; +} D_80384FD8; +extern u8 D_80384FE0; + +/* .code */ +f32 func_8033DE30(s32 arg0){ + return D_80371E30[arg0].unk4; +} + +s32 func_8033DE44(s32 arg0){ + return D_80371E30[arg0].unk1 & 1; +} + +Actor *func_8033DE60(ActorMarker *marker){ + int indx = marker->unk28; + func_8033F7F0(D_80384490[indx].unk45); + if(marker); + return 0; +} + +void func_8033DEA0(void){ + int i; + for(i = 0; i < 40 ;i++){ + D_80384490[i].unk44 = 0; + } + D_80384FD8.unk0 = D_80384FD8.unk4 = 0; + commonParticleType_set(COMMON_PARTICLE_1_EGG_HEAD, &fxegg_head_spawn, &fxegg_head_update, &fxegg_head_destroy, 0, 1); //bsbEggAss + commonParticleType_set(0x2, &func_803546E8, &func_8035489C, &func_80354990, 0, 8); //bsbWhirl //aka wonderwing + commonParticleType_set(COMMON_PARTICLE_4_EGG_ASS, &fxegg_ass_spawn, &fxegg_ass_update, &fxegg_ass_destroy, 0, 1); + commonParticleType_set(0x6, &func_8035611C, &func_803562E8, &func_80356364, 0, 8); + commonParticleType_set(0x7, &func_80352DE4, &func_80352F58, &func_80352FF4, 0, 8); + commonParticleType_set(0x8, &func_80354998, &func_80354C18, &func_80354DC8, 0, 8); + commonParticleType_set(0x9, &func_80354DD0, &func_80354EEC, &func_80355004, 0, 8); //orange_pad? + commonParticleType_set(0xa, &func_8035500C, &func_80355134, &func_80355294, 0, 8); + commonParticleType_set(0xb, &func_803540B4, &func_803541D8, &func_803540AC, 0, 8); + commonParticleType_set(0xc, &func_8035529C, &func_803553E8, &func_80355548, 0, 8); + commonParticleType_set(0xd, &func_80355550, &func_8035570C, &func_8035585C, 0, 8); + commonParticleType_set(0xe, &func_803543FC, &func_8035451C, &func_803543F4, 0, 8); + commonParticleType_set(0xf, &func_80355864, &func_80355B00, &func_80355C4C, 0, 8); + commonParticleType_set(0x10, &func_80355D58, &func_80355E80, &func_80355D50, 0, 8); + commonParticleType_set(0x11, &func_8035261C, &func_803526DC, &func_80352614, 0, 8); //mumbotoken sparkle +} + +void func_8033E184(void){ + int i; + for(i = 0; i < 40; i++){ + if(D_80384490[i].unk44){ + func_8033E6D4(i); + } + } +} + +//commonParticle_update +void func_8033E1E0(void){ + f32 sp4C[3]; + int i; + if(D_80384FE0){ + for(i = 0; i < 40; i++){ + if(D_80384490[i].unk44){ + D_80384FD0 = i; + func_80352B20(D_80384490[D_80384FD0].unk46); + if(D_80384490[D_80384FD0].unk44){ + projectile_getPosition(D_80384490[D_80384FD0].unk45, sp4C); + func_803451B0(D_80384490[D_80384FD0].unk47, sp4C); + projectile_setPosition(D_80384490[D_80384FD0].unk45, sp4C); + func_80287DC8(D_80384490[D_80384FD0].unk34); + func_8033FFB8(D_80384490[D_80384FD0].unk45, func_80287FFC(D_80384490[D_80384FD0].unk34)); + func_8032F64C(sp4C, D_80384490[D_80384FD0].marker_30); + } + else{ + func_8033E6D4(i); + } + } + } + } +} + +//commonParticle_findFree +s32 func_8033E368(void){ + int i; + for(i = 0; i < 40; i++){ + if(D_80384490[i].unk44 == 0){ + D_80384490[i].unk44++; + return i; + } + } + return -1; +} + +//commonParticle_new +int func_8033E3F0(enum common_particle_e particle_id, int arg1){ + f32 sp34[3]; + s32 a0; + + if(arg1 == 0) + return -1; + + ml_vec3f_clear(sp34); + D_80384FD0 = func_8033E368(); + if(D_80384FD0 < 0) + return -1; + + + D_80384490[D_80384FD0].unk45 = func_8033FA84(); + D_80384490[D_80384FD0].unk34 = func_80287CA8(); + D_80384490[D_80384FD0].unk46 = func_8035287C(); + D_80384490[D_80384FD0].unk47 = func_80344CDC(); + + if( ( !(a0 = D_80384490[D_80384FD0].unk45) + || !D_80384490[D_80384FD0].unk34 + || !D_80384490[D_80384FD0].unk46 + || !D_80384490[D_80384FD0].unk47 + ) + ){//L8033E4DC + if(a0){ + func_8033FB64(a0); + } + a0 = D_80384490[D_80384FD0].unk34; + if(a0){ + func_80287D60(a0); + } + a0 = D_80384490[D_80384FD0].unk46; + if(a0){ + func_803529DC(a0); + } + a0 = D_80384490[D_80384FD0].unk47; + if(a0){ + func_80344D70(a0); + } + D_80384490[D_80384FD0].unk44 = 0; + return -1; + } + + //L8033E5B4 + D_80384490[D_80384FD0].marker_30 = func_8032FBE4(sp34, func_8033DE60, 1, commonParticleType_80352C7C(particle_id)); + D_80384490[D_80384FD0].marker_30->unk40_22 = 1; + func_8032FFEC(D_80384490[D_80384FD0].marker_30, (u32)D_80384FD0); + D_80384490[D_80384FD0].marker_30->collidable = FALSE; + func_80352A38(D_80384490[D_80384FD0].unk46, particle_id); + func_8033FFB8(D_80384490[D_80384FD0].unk45, func_80287FFC(D_80384490[D_80384FD0].unk34)); + projectile_getPosition(D_80384490[D_80384FD0].unk45, sp34); + func_8032F64C(sp34, D_80384490[D_80384FD0].marker_30); + return D_80384FD0; + +} + +void func_8033E6D4(s32 arg0){ + func_803529DC(D_80384490[arg0].unk46); + func_80344D70(D_80384490[arg0].unk47); + func_8033FB64(D_80384490[arg0].unk45); + func_80287D60(D_80384490[arg0].unk34); + marker_free(D_80384490[arg0].marker_30); + D_80384490[arg0].marker_30 = NULL; + D_80384490[arg0].unk38 = 0; + D_80384490[arg0].unk44 = 0; +} + +void func_8033E73C(s32 arg0, s32 arg1, FuncUnk40 arg2){ + s32 tmp_v0 = func_8033E368(); + D_80384490[tmp_v0].unk44--; + D_80384490[tmp_v0].unk38 = arg0; + D_80384490[tmp_v0].unk3C = arg1; + D_80384490[tmp_v0].unk40 = arg2; +} + +void func_8033E79C(s32 arg0, s32 arg1, FuncUnk40 arg2){ + D_80384490[D_80384FD0].unk38 = arg0; + D_80384490[D_80384FD0].unk3C = arg1; + D_80384490[D_80384FD0].unk40 = arg2; +} + +void func_8033E7CC(s32 arg0){ + int i; + for(i = 0; i < 40; i++){ + if(D_80384490[i].unk44 && arg0 == (s32)D_80384490[i].unk38){ + func_8033E6D4(i); + } + } +} + +ActorMarker *func_8033E840(void){ + return D_80384490[D_80384FD0].marker_30; +} + +ActorMarker *func_8033E864(void){ + return D_80384490[D_80384FD0].unk38; +} + +FuncUnk40 func_8033E888(void){ + return D_80384490[D_80384FD0].unk40; +} + +s32 func_8033E8AC(void){ + return D_80384490[D_80384FD0].unk3C; +} + +u8 func_8033E8D0(void){ + return D_80384490[D_80384FD0].unk45; +} + +struct54s * func_8033E8F4(void){ + return D_80384490[D_80384FD0].unk34; +} + +u8 func_8033E918(void){ + return D_80384490[D_80384FD0].unk46; +} + +u8 func_8033E93C(void){ + return D_80384490[D_80384FD0].unk47; +} + +ParticleStruct0s *func_8033E960(void){ + return &D_80384490[D_80384FD0]; +} + +void func_8033E984(void){ + D_80384490[D_80384FD0].unk44 = 0; +} + +void func_8033E9A8(s32 arg0){ + func_8033E6D4(arg0); +} + +void func_8033E9C8(s32 arg0){ + D_80384FD0 = arg0; +} + +void func_8033E9D4(void){ + D_80384FD8.unk4 = D_80384FD8.unk0; + D_80384FD8.unk0 = D_80384FD0; +} + +void func_8033E9F4(void){ + D_80384FD0 = D_80384FD8.unk0; + D_80384FD8.unk0 = D_80384FD8.unk4; +} + +f32 func_8033EA14(s32 arg0){ + return *((f32 *)func_8033E960() + arg0); +} + +void func_8033EA40(s32 arg0, f32 arg1){ + *((f32 *)func_8033E960() + arg0) = arg1; +} + +void func_8033EA78(s32 arg0, s32 arg1){ + if(arg1 == 2) + D_80384FE0 = 1; + else + D_80384FE0 = 0; +} diff --git a/src/core2/code_B6EA0.h b/src/core2/code_B6EA0.h new file mode 100644 index 00000000..a7d48f25 --- /dev/null +++ b/src/core2/code_B6EA0.h @@ -0,0 +1,52 @@ +#ifndef CORE2_B6EA0_H +#define CORE2_B6EA0_H + +#include +#include "functions.h" +#include "variables.h" + +typedef s32 (*FuncUnk40)(ActorMarker *, s32, f32[3]); + +typedef struct particle_struct_0_s{ + f32 unk0; + f32 unk4; + f32 unk8; + f32 unkC; + f32 unk10; + f32 unk14; + u8 pad18[8]; + s32 unk20; + s32 unk24; + s32 unk28; + u8 pad24[0x4]; + ActorMarker *marker_30; + struct54s *unk34; + ActorMarker *unk38; + s32 unk3C; + FuncUnk40 unk40; + u8 unk44; + u8 unk45; + u8 unk46; + u8 unk47; +} ParticleStruct0s; + +ActorMarker *func_8033E864(void); +FuncUnk40 func_8033E888(void); +u8 func_8033E8D0(void); +struct54s *func_8033E8F4(void); +ParticleStruct0s *func_8033E960(void); +void func_8033E984(void); +void projectile_setSprite(u8, enum asset_e); +void func_8033FC34(u8, s32); +void func_8033FC60(u8, s32, s32, s32); +void func_8033FCD8(u8, s32); +void func_8033FD98(u8, f32[3]); +void func_8033FE2C(u8, f32); +void projectile_setPosition(u8, f32[3]); +void func_8033FFE4(u8, s32, s32); +void func_80344E18(u8, s32); +void func_80344E3C(u8, f32[3]); +void func_80344D94(u8, f32[3]); +void func_80344EE4(u8, f32, f32); + +#endif diff --git a/src/core2/code_B7B20.c b/src/core2/code_B7B20.c new file mode 100644 index 00000000..42ca3626 --- /dev/null +++ b/src/core2/code_B7B20.c @@ -0,0 +1,16 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B7B20/func_8033EAB0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B7B20/func_8033EAF8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B7B20/func_8033EC10.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B7B20/func_8033EC70.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B7B20/func_8033ECD8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B7B20/func_8033EDF0.s") diff --git a/src/core2/code_B7F40.c b/src/core2/code_B7F40.c new file mode 100644 index 00000000..f098b389 --- /dev/null +++ b/src/core2/code_B7F40.c @@ -0,0 +1,54 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8033EF08(void); +void func_8033EF10(void); + +/* .data */ +void *D_80371E60 = NULL; + +/* .code */ +void func_8033EED0(void){ + func_8033EF10(); + func_8033EF08(); +} + +void func_8033EEF8(void){} + +void func_8033EF00(void){} + +void func_8033EF08(void){} + +void func_8033EF10(void){} + +void func_8033EF18(s32 arg0, s32 arg1){ + return; +} + +void func_8033EF24(void){ + if(D_80371E60){ + free(D_80371E60); + } + D_80371E60 = NULL; +} + +void func_8033EF58(void){ + D_80371E60 = malloc(0x50); +} + +void func_8033EF7C(s32 arg0){ + return; +} + +void func_8033EF84(void){} + +void func_8033EF8C(void){} + +void func_8033EF94(s32 arg0){ + return; +} + +void func_8033EF9C(s32 arg0){ + return; +} diff --git a/src/core2/code_B8020.c b/src/core2/code_B8020.c new file mode 100644 index 00000000..9e320956 --- /dev/null +++ b/src/core2/code_B8020.c @@ -0,0 +1,6 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B8020/func_8033EFB0.s") diff --git a/src/core2/code_B8070.c b/src/core2/code_B8070.c new file mode 100644 index 00000000..501d801c --- /dev/null +++ b/src/core2/code_B8070.c @@ -0,0 +1,5 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8033F000(const char *string, const char *file){} diff --git a/src/core2/code_B8080.c b/src/core2/code_B8080.c new file mode 100644 index 00000000..71aaf724 --- /dev/null +++ b/src/core2/code_B8080.c @@ -0,0 +1,226 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_8033F2B4(BKModel *model, s32 mesh_id, s16 arg2[3], s16 arg3[3]); +s32 func_8033F3E8(BKModel *model, f32 position[3], s32 min_id, s32 max_id); +/* .code */ +//performs operation "fn" for every vtx in every mesh of a model +void func_8033F010(BKModel *model, void (*fn)(s32, BKVtxRef *, Vtx *, s32), s32 arg3) { + s32 i; + BKMesh *iMesh; + BKVtxRef *iVtx; + BKVtxRef *start_vtx_ref; + BKVtxRef *end_vtx_ref; + Vtx *verts; + + verts = vtxList_getVertices(model->vtxList_4); + iMesh = (BKMesh *)(model + 1); + for(i = 0; i < model->meshList_0->meshCount_0; i++){ + start_vtx_ref = (BKVtxRef *)(iMesh + 1); + end_vtx_ref = start_vtx_ref + iMesh->vtxCount_2; + for(iVtx = start_vtx_ref; iVtx < end_vtx_ref; iVtx++){ + fn(iMesh->uid_0, iVtx, &verts[iVtx->unk10], arg3); + } + iMesh = (BKMesh*) (((BKVtxRef *)(iMesh + 1)) + iMesh->vtxCount_2); + }; +} + +//performs operation "fn" for every vtx in a model's mesh +void func_8033F120(BKModel *model, s32 mesh_id, void (*fn)(s32, BKVtxRef *, Vtx *, s32), s32 arg3) { + s32 i; + BKMesh *iMesh; + BKVtxRef *iVtx; + BKVtxRef *start_vtx_ref; + BKVtxRef *end_vtx_ref; + Vtx *verts; + + verts = vtxList_getVertices(model->vtxList_4); + iMesh = (BKMesh *)(model + 1); + for(i = 0; i < model->meshList_0->meshCount_0; i++){ + if (mesh_id == iMesh->uid_0) { + start_vtx_ref = (BKVtxRef *)(iMesh + 1); + end_vtx_ref = start_vtx_ref + iMesh->vtxCount_2; + for(iVtx = start_vtx_ref; iVtx < end_vtx_ref; iVtx++){ + fn(iMesh->uid_0, iVtx, &verts[iVtx->unk10], arg3); + } + return; + } + iMesh = (BKMesh*) (((BKVtxRef *)(iMesh + 1)) + iMesh->vtxCount_2); + }; +} + +//BKModel_getAveragePositionOfMesh +void func_8033F220(BKModel *model, s32 mesh_id, s16 arg2[3]) { + s16 min[3]; + s16 max[3]; + + func_8033F2B4(model, mesh_id, min, max); + arg2[0] = (min[0] + max[0]) / 2; + arg2[1] = (min[1] + max[1]) / 2; + arg2[2] = (min[2] + max[2]) / 2; +} + + +BKMeshList *func_8033F2AC(BKModel *arg0){ + return arg0->meshList_0; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B8080/func_8033F2B4.s") +#else +void func_8033F2B4(BKModel *model, s32 mesh_id, s16 arg2[3], s16 arg3[3]) { + BKMesh *mesh; + s16 *mesh_begin; + s16 *mesh_end; + s16 *phi_t4; + Vtx *i_vtx; + Vtx *vtx_pool; + s32 i; + + mesh = func_802E9F9C(model->meshList_0, mesh_id); + vtx_pool = vtxList_getVertices(model->vtxList_4); + if (mesh == NULL) return; + + mesh_begin = (s16*)(mesh + 1); + mesh_end = mesh_begin + (mesh->vtxCount_2); + for(phi_t4 = mesh_begin; phi_t4 < mesh_end; phi_t4++){ + i_vtx = &vtx_pool[*phi_t4]; + for(i = 0; i < 3; i++){ + if (phi_t4 == (s16*)(mesh + 1)) { + arg2[i] = arg3[i] = i_vtx->v.ob[i]; + } else { + arg2[i] = MIN(i_vtx->v.ob[i], arg2[i]); + arg3[i] = MAX(i_vtx->v.ob[i], arg3[i]); + } + } + } +} +#endif + +//return mesh id "position" is over/under +s32 func_8033F3C0(BKModel *model, f32 position[3]){ + return func_8033F3E8(model, position, 0, 100000); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B8080/func_8033F3E8.s") +#else +s32 func_8033F3E8(BKModel *arg0, f32 arg1[3], s32 min_id, s32 max_id) { + int i; + int j; + int k; + s16 sp64[3]; + s16 sp5C[3]; + s16 sp54[3]; + s16 temp_v1_3; + Vtx *temp_v0; + BKMesh *phi_t3; + Vtx *phi_a1; + s32 mesh_cnt; + s32 vtx_cnt; + s16 *tmp; + s16 t8; + + temp_v0 = vtxList_getVertices(arg0->vtxList_4); + sp54[0] = (s16) arg1[0]; + sp54[1] = (s16) arg1[1]; + sp54[2] = (s16) arg1[2]; + phi_t3 = (BKMesh *)(arg0->meshList_0 + 1); + for(k = 0; k < arg0->meshList_0->meshCount_0; k++){ + if ((min_id > phi_t3->uid_0 || phi_t3->uid_0 >= max_id)){ + vtx_cnt = phi_t3->vtxCount_2; + } + else{ + t8 = *(s16*)(phi_t3 + 1); + phi_a1 = temp_v0 + t8; + for(i = 0; &sp64[i] < &sp64[3]; i++){ + temp_v1_3 = phi_a1->v.ob[i]; + sp64[i] = temp_v1_3; + sp5C[i] = temp_v1_3; + }; + + tmp = (s16*)(phi_t3 + 1); + for(j = 0; j < phi_t3->vtxCount_2; j++){ + phi_a1 = temp_v0 + tmp[j]; + for(i = 0; i < 3; i++){ + temp_v1_3 = phi_a1->v.ob[i]; + sp64[i] = (temp_v1_3 < sp64[i]) ? temp_v1_3 : sp64[i]; + sp5C[i] = (sp5C[i] < temp_v1_3) ? temp_v1_3 : sp5C[i]; + }; + } + if( (sp64[0] < sp54[0] && sp54[0] < sp5C[0]) + && (sp64[2] < sp54[2] && sp54[2] < sp5C[2]) + ){ + return phi_t3->uid_0; + } + vtx_cnt = phi_t3->vtxCount_2; + } + phi_t3 = &(((s16 *)(phi_t3 + 1))[vtx_cnt]); + } + return 0; +} + +#endif + +void model_free(void *arg0){ + free(arg0); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B8080/func_8033F5F8.s") +#else +BKModel *func_8033F5F8(BKMeshList *arg0, BKVertexList *arg1) { + BKModel *sp40; + s32 temp_s1; + s32 temp_s6; + void *temp_v0; + BKMesh *phi_s3; + BKMesh *phi_s5; + s16 *phi_s2; + BKVtxRef *phi_s0; + s32 phi_s1; + s32 phi_s6; + + sp40 = (BKModel *)malloc((func_802E9F60() * sizeof(BKVtxRef)) + (arg0->meshCount_0 * sizeof(BKMesh)) + sizeof(BKModel)); + sp40->meshList_0 = arg0; + sp40->vtxList_4 = arg1; + phi_s3 = arg0 + 1; + phi_s5 = (sp40 + 1); + for(phi_s6 = 0; phi_s6 < arg0->meshCount_0; phi_s6++){ + phi_s5->uid_0 = (s16) phi_s3->uid_0; + phi_s5->vtxCount_2 = (s16) phi_s3->vtxCount_2; + phi_s2 = (s16*)(phi_s3 + 1); + phi_s0 = (BKVtxRef *)(phi_s5 + 1); + for(phi_s1 = 0; phi_s1 < phi_s3->vtxCount_2; phi_s1++){ + phi_s0[phi_s1].unk10 = phi_s2[phi_s1]; + memcpy(&phi_s0->v, arg1 + (phi_s0->unk10 * sizeof(Vtx)) + sizeof(BKVertexList), sizeof(Vtx)); + } + phi_s3 = (s32)phi_s3 + (phi_s3->vtxCount_2 * sizeof(Vtx)) + sizeof(BKMesh); + phi_s5 = (s32)phi_s5 + (phi_s5->vtxCount_2 * sizeof(BKVtxRef)) + sizeof(BKMesh); + } + return sp40; +} +#endif + +void func_8033F738(ActorMarker *arg0) { + BKModelBin *sp1C; + s32 sp18; + + sp1C = func_80330B1C(arg0); + sp18 = func_8033A0B0(sp1C); + arg0->unk48 = func_8033F5F8(sp18, func_8033A148(sp1C)); +} + + +void func_8033F784(ActorMarker *arg0){ + model_free(arg0->unk48); +} + +void func_8033F7A4(ActorMarker *arg0, BKVertexList *arg1) { + arg0->unk48->meshList_0 = func_8033A0B0(func_80330DE4(arg0)); + arg0->unk48->vtxList_4 = arg1; +} + +void func_8033F7E8(s32 arg0){} diff --git a/src/core2/code_B850.c b/src/core2/code_B850.c new file mode 100644 index 00000000..467316c8 --- /dev/null +++ b/src/core2/code_B850.c @@ -0,0 +1,74 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void ml_vec3f_assign(f32[3], f32, f32, f32); + +/* .data */ +s32 D_80363790 = 0; + +/* .code */ +void func_802927E0(f32 arg0, f32 arg1){ + f32 sp24[3]; + f32 sp18[3]; + + arg1 *= 0.51; + _player_getPosition(sp18); + sp18[1] += 10.0f; + func_802589E4(sp24, arg0, arg1); + sp24[1] = 40.0f; + func_80352CF4(sp18, sp24, 10.0f, 150.0f); +} + +void func_80292864(f32 arg0, f32 arg1){ + f32 sp34[3]; + f32 sp28[3]; + f32 sp1C[3]; + + ml_vec3f_assign(sp1C, 0.0f, 40.0f, 0.0f); + _player_getPosition(sp28); + func_802589E4(sp34, arg0, arg1); + sp34[1] = 10.0f; + sp28[0] += sp34[0]; sp28[1] += sp34[1]; sp28[2] += sp34[2]; + func_80352CF4(sp28, sp1C, 10.0f, 150.0f); +} + +void func_80292900(f32 arg0, f32 arg1){ + f32 sp24[3]; + f32 sp18[3]; + + arg1 *= 0.51; + _player_getPosition(sp18); + func_802589E4(sp24, arg0, arg1); + sp24[1] = 40.0f; + func_80352CF4(sp18, sp24, 10.0f, 150.0f); +} + +void func_80292974(f32 arg0, f32 arg1, f32 arg2){ + f32 sp24[3]; + f32 sp18[3]; + arg1 *= 0.51; + _player_getPosition(sp18); + sp18[1] += 10.0f; + func_802589E4(sp24, arg0, arg1); + sp24[1] = arg2; + func_80352CF4(sp18, sp24, 150.0f, 10.0f); +} + +void func_802929F8(void){ + switch (D_80363790) { + case 0: //L80292A2C + func_80292864(func_80297A7C() - 20.0f, 40.0f); + break; + case 1: //L80292A2C + func_80292864(func_80297A7C() + 20.0f, 40.0f); + break; + case 2: //L80292A94 + func_80292864(func_80297A7C(), 30.0f); + break; + default: //L80292AC0 + break; + } + if(++D_80363790 >= 3) + D_80363790 = 0; +} diff --git a/src/core2/code_B8860.c b/src/core2/code_B8860.c new file mode 100644 index 00000000..5249df55 --- /dev/null +++ b/src/core2/code_B8860.c @@ -0,0 +1,195 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void mlMtxRotate(f32, f32, f32); +extern void func_80252330(f32, f32, f32); +extern void mlMtxApply(Mtx *); + +typedef struct { + BKSprite *sprite_0; + f32 unk4[3]; + f32 unk10[3]; + f32 unk1C; + s16 unk20[2]; + u8 color[3]; + u8 unk27; + u32 frame_28_31:8; + u32 unk28_23:2; + u32 unk28_21:8; + u32 unk28_13:1; + u32 unk28_12:1; + u32 pad28_11:12; +} Struct_B8860_0s; + +void func_8033FE6C(u8 arg0, f32 arg1); +f32 func_8033FE9C(u8 arg0); +void func_8033FB64(u8 arg0); + +/* .bss */ +extern Struct_B8860_0s D_80385000[]; + +/* .code */ +void func_8033F7F0(u8 arg0, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Struct_B8860_0s *sp54; + f32 sp48[3]; + f32 sp3C[3]; + f32 sp30[3]; + + sp54 = &D_80385000[arg0]; + if(sp54->unk28_23 != 1){ + ml_vec3f_copy(sp48, sp54->unk4); + sp48[1] += (sp54->unk1C*sp54->unk20[1])/100.0; + func_8024C5CC(sp3C); + ml_vec3f_diff_copy(sp30, sp48, sp3C); + if(sp54->unk28_12){ + func_80251BCC(func_8024DD90()); + } + else{ + mlMtxIdent(); + } + mlMtxRotate(sp54->unk10[0], sp54->unk10[1], sp54->unk10[2]); + func_80252330(sp30[0], sp30[1], sp30[2]); + mlMtxApply(*mtx); + gSPMatrix((*gfx)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + func_803382E4(sp54->unk28_21); + func_80338338(sp54->color[0], sp54->color[1],sp54->color[2]); + func_803382FC(sp54->unk27); + func_80338308(sp54->unk20[0], sp54->unk20[1]); + func_8033837C(1); + func_80338370(); + func_80336904(gfx, vtx, sp54->sprite_0, sp54->frame_28_31); + gSPPopMatrix((*gfx)++, G_MTX_MODELVIEW); + } +} + +void func_8033F9C0(void){ + int i; + for(i = 1; i < 0x32; i++){ + D_80385000[i].unk28_13 = 0; + } +} + +void func_8033FA24(void){ + int i; + for(i = 1; i < 0x32; i++){ + if(D_80385000[i].unk28_13){ + func_8033FB64(i); + } + } +} + +u8 func_8033FA84(void){ + int i; + for(i = 1; i < 0x32; i++){ + if(!D_80385000[i].unk28_13){ + ml_vec3f_clear(D_80385000[i].unk4); + ml_vec3f_clear(D_80385000[i].unk10); + D_80385000[i].frame_28_31 = 0; + D_80385000[i].unk28_13 = TRUE; + D_80385000[i].unk28_23 = 0; + D_80385000[i].unk28_21 = 0xb; + D_80385000[i].sprite_0 = NULL; + D_80385000[i].unk28_12 = TRUE; + D_80385000[i].unk20[0] = 100; + D_80385000[i].unk20[1] = 100; + D_80385000[i].color[0] = 0xff; + D_80385000[i].color[1] = 0xff; + D_80385000[i].color[2] = 0xff; + D_80385000[i].unk27 = 0xff; + D_80385000[i].unk1C = 0.0f; + return i; + } + } + return 0; +} + +void func_8033FB64(u8 arg0){ + if(D_80385000[arg0].sprite_0){ + func_8033BD4C(D_80385000[arg0].sprite_0); + } + D_80385000[arg0].sprite_0 = NULL; + D_80385000[arg0].unk28_13 = 0; +} + +void projectile_setSprite(u8 arg0, enum asset_e arg1){ + if(D_80385000[arg0].sprite_0){ + func_8033BD4C(D_80385000[arg0].sprite_0); + } + D_80385000[arg0].sprite_0 = assetcache_get(arg1); +} + +void func_8033FC34(u8 arg0, s32 arg1){ + D_80385000[arg0].unk27 = arg1; +} + +void func_8033FC60(u8 arg0, s32 r, s32 g, s32 b){ + D_80385000[arg0].color[0] = r; + D_80385000[arg0].color[1] = g; + D_80385000[arg0].color[2] = b; +} + +void func_8033FC98(u8 arg0, s32 arg1){ + D_80385000[arg0].unk28_23 = arg1; +} + +void func_8033FCD8(u8 arg0, s32 arg1){ + D_80385000[arg0].unk28_21 = arg1; +} + +void func_8033FD20(u8 arg0, s32 arg1){ + D_80385000[arg0].unk28_12 = arg1; +} + +s32 func_8033FD64(u8 arg0){ + return D_80385000[arg0].unk28_23; +} + +//projectile?_setRotation +void func_8033FD98(u8 arg0, f32 arg1[3]){ + ml_vec3f_copy(D_80385000[arg0].unk10, arg1); +} + +//projectile?_getRotation +void func_8033FDE0(u8 arg0, f32 arg1[3]){ + ml_vec3f_copy(arg1, D_80385000[arg0].unk10); +} + +void func_8033FE2C(u8 arg0, f32 arg1){ + func_8033FE6C(arg0, mlNormalizeAngle(func_8033FE9C(arg0) + arg1)); +} + +//projectile?_setRoll +void func_8033FE6C(u8 arg0, f32 arg1){ + D_80385000[arg0].unk10[2] = arg1; +} + +//projectile?_getRoll +f32 func_8033FE9C(u8 arg0){ + return D_80385000[arg0].unk10[2]; +} + +void projectile_setPosition(u8 arg0, f32 arg1[3]){ + ml_vec3f_copy(D_80385000[arg0].unk4, arg1); +} + +void projectile_getPosition(u8 arg0, f32 arg1[3]){ + ml_vec3f_copy(arg1, D_80385000[arg0].unk4); +} + +void func_8033FF5C(u8 arg0, f32 arg1){ + D_80385000[arg0].unk1C = arg1; +} + +f32 func_8033FF8C(u8 arg0){ + return D_80385000[arg0].unk1C; +} + +void func_8033FFB8(u8 arg0, s32 frame){ + D_80385000[arg0].frame_28_31 = frame; +} + +void func_8033FFE4(u8 arg0, s32 arg1, s32 arg2){ + D_80385000[arg0].unk20[0] = arg1; + D_80385000[arg0].unk20[1] = arg2; +} diff --git a/src/core2/code_B9090.c b/src/core2/code_B9090.c new file mode 100644 index 00000000..16801325 --- /dev/null +++ b/src/core2/code_B9090.c @@ -0,0 +1,14 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9090/func_80340020.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9090/func_80340200.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9090/func_80340690.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9090/func_803406B0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9090/func_803406D4.s") diff --git a/src/core2/code_B9770.c b/src/core2/code_B9770.c new file mode 100644 index 00000000..9e4960f3 --- /dev/null +++ b/src/core2/code_B9770.c @@ -0,0 +1,291 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern void sfxsource_setSampleRate(u8, s32); +extern bool func_80323240(struct56s *, f32, f32[3]); +extern f32 func_803237E8(struct56s *); +extern f32 func_80323FDC(struct56s *, f32, f32, s32 *); +extern f32 func_803240E0(struct56s *, f32, f32, s32 *); + +extern struct56s **D_80371E70; +extern void **D_80371E74; +extern s32 D_80371E78; +extern s32 D_80371E7C; + +extern s16 *D_803858A0; + + +f32 func_80340700(f32, f32, f32); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80340700.s") + +bool func_80340748(s32 arg0, s32 arg1, s32 arg2, s32 arg3){ + return FALSE; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80340760.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80340A4C.s") +// f32 func_80340A4C(f32 arg0, s32 arg1, f32 *arg2){ +// s32 tmp_v1; +// s32 sp30; +// f32 sp24[3]; +// f32 f20; + +// sp30 = arg1 - 3; +// f20 = func_80340700( arg0, 0.0f, 1.0f)*sp30; +// tmp_v1 = f20; +// arg1 -= 4; +// tmp_v1 = MIN(tmp_v1, arg1); +// arg2 += tmp_v1; +// f20 -= tmp_v1; +// sp24[2] = -0.5*arg2[0] + 1.5*arg2[1] + -1.5*arg2[2] + 0.5*arg2[3]; +// sp24[1] = 1.0*arg2[0] + -2.5*arg2[1] + 2.0*arg2[2] + -0.5*arg2[3]; +// sp24[0] = -0.5*arg2[0] + 0.5*arg2[2]; +// return f20*(sp24[0] + f20*(sp24[1] + f20*sp24[2])) + (f64)arg2[1]; +// } + +void func_80340BE4(f32 arg0, s32 arg1, s32 arg2, s32 arg3, f32 * arg4, f32 arg5[3]); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80340BE4.s") + +void func_80341180(f32 arg0, s32 arg1, s32 arg2, f32 * arg3, f32 arg4[3]){ + func_80340BE4(arg0, arg1, arg2, arg2, arg3, arg4); +} + + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_803411B0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80341A54.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80341BA0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80341BC8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80341C78.s") + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80341D5C.s") +#else +s32 func_80341D5C(s32 arg0[3], s32 arg1[3]){ + int i, j; + struct56s *a0; + f32 (*a2)[3]; + f32 spC[3]; + f32 sp0[3]; + + spC[0] = (f32)arg0[0]; + spC[1] = (f32)arg0[1]; + spC[2] = (f32)arg0[2]; + + sp0[0] = (f32)arg1[0]; + sp0[1] = (f32)arg1[1]; + sp0[2] = (f32)arg1[2]; + + for(i = 0; i < D_80371E78; i++){ + a2 = D_80371E70[i]->unk8; + for(j = 0; j < D_80371E70[i]->unk0; j++){ + if( spC[0] == a2[j][0] + && spC[1] == a2[j][1] + && spC[2] == a2[j][2] + && sp0[0] == a2[j +1][0] + && sp0[1] == a2[j +1][1] + && sp0[2] == a2[j +1][2] + ){ + return i; + } + } + } + return -1; +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80341EC4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80341EF0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80341F2C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80341F64.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80341FB0.s") + +struct56s *func_80342038(s32 indx){ + if(indx == -1) + return NULL; + return D_80371E70[indx]; +} + +int func_80342064(s32 arg0){ + return 0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80342070.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_803420BC.s") + +s32 func_803421A4(s32, f32); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_803421A4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80342244.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80342260.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_803422AC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_803422D4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_803430B4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_803431D0.s") + +s32 func_80343654(Actor *this){ + s32 tmp_v1; + s32 tmp_a0; + tmp_v1 = this->unk10_8 ? 0x800 : 0x100; + tmp_a0 = this->unk10_7 ? 0x1000 : 0x200; + return tmp_a0 + tmp_v1; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_80343694.s") + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_B9770/func_803438E0.s") +#else +s32 func_803438E0(Actor *actor, s32 arg1, s32 arg2, s32 arg3) { + s32 sp4C; + s32 sp48; + s32 sp44; + f32 sp40; + s32 sp3C; + s32 temp_v0; + s32 sp28; + + sp44 = 0; + sp40 = actor->unk4C; + sp28 = actor->unk44_14; + if (sp28 == -1) { + return 0; + } + sp4C = func_803421A4(sp28, actor->unk48); + if ((actor->unk54 == 0.0f) && (actor->unk138_3 == 0)) { + if (actor->marker->unk14_20 == 0xB0) { + actor->unk48 = func_803240E0(D_80371E70[actor->unk44_14], actor->unk48, sp40, &sp44); + } else { + actor->unk48 = func_80323FDC(D_80371E70[actor->unk44_14], actor->unk48, sp40, &sp44); + } + func_80323240(D_80371E70[actor->unk44_14], actor->unk48, actor->position); + } else { + if (actor->unk54 != 0.0f) { + actor->unk54 -= time_getDelta(); + if (actor->unk54 < 0.0f) { + actor->unk54 = 0.0f; + } + } + if ((actor->unk138_3 != 0) && func_802501A0(0, actor->unk138_3 + 0x69, 0)) { + func_80250170(0, actor->unk138_3 + 0x69, 0); + actor->unk138_3 = 0; + } + } + sp48 = func_803421A4(actor->unk44_14, actor->unk48); + if (!actor->unk44_1) { + actor->unk44_1 = TRUE; + actor->yaw = actor->yaw_moving; + actor->pitch = actor->unk6C; + } + if ((sp4C == sp48) && (sp44 == 0)) { + func_803431D0(actor, arg1, arg2, arg3); + } else { + sp3C = func_80343654(actor); + if (sp40 > 0.0f) { + if (sp44 == 0) { + if (func_80343694(actor, actor->unk44_14, sp4C, sp48, 0, 1) == 2) { + D_80371E7C = 1; + } + } else if (func_80343694(actor, actor->unk44_14, sp4C, -0x270F, 0, 1) == 0) { + func_80343694(actor, actor->unk44_14, func_803421A4(actor->unk44_14, func_803237E8(func_80342038(actor->unk44_14))), sp48, 0, 1); + } + } else if (sp40 < 0.0f) { + if (sp44 == 0) { + func_80343694(actor, actor->unk44_14, sp4C - 1, sp48 - 1, 0, -1); + } else if (!func_80343694(actor, actor->unk44_14, sp4C - 1, -1, 0, -1)) { + func_80343694(actor, actor->unk44_14, -0x270F, sp48 - 1, 0, -1); + } + } + temp_v0 = func_80343654(actor); + if ((sp3C == temp_v0) || ((sp3C != temp_v0) && (sp3C != (arg1 & 0x3F00)))) { + func_803431D0(actor, arg1, arg2, arg3); + } else { + func_803431D0(actor, (arg1 & ~0x3F00) | (temp_v0 & 0x3F00), arg2, arg3); + } + } + return 1; +} +#endif + +int func_80343D50(Actor *this, s32 arg1, s32 arg2, s32 arg3){ + s32 s0; + s0 = 0; + do{ + D_80371E7C = 0; + s0 += func_803438E0(this, arg1, arg2, arg3); + }while(D_80371E7C); + return s0 ? 1 : 0; +} + +void func_80343DEC(Actor *this){ + func_80343D50(this, func_80343654(this), 0x19, 0x19); +} + +void func_80343E20(s32 arg0, s32 arg1, f32 arg2, s32 arg3) { + u8 temp_v0; + + if (func_8030ED70(func_80255D44()) != 0) { + temp_v0 = func_8030D90C(); + if (temp_v0 != 0) { + sfxsource_setSfxId(temp_v0, func_80255D44(arg0)); + func_8030DBB4(temp_v0, arg2); + sfxsource_setSampleRate(temp_v0, arg1); + func_8030E2C4(temp_v0); + if (D_803858A0[arg3] != 0) { + func_8030DA44(D_803858A0[arg3]); + } + D_803858A0[arg3] = temp_v0; + } + } else { + func_8030E6A4(func_80255D44(arg0), arg2, arg1); + } +} + +struct56s *func_80343F00(s32 indx, f32 arg1[3]){ + struct56s *out; + + out = func_80342038(indx); + out->unk8[0][0] = arg1[0]; + out->unk8[0][1] = arg1[1]; + out->unk8[0][2] = arg1[2]; + return out; +} + +void func_80343F3C(void) { + s32 i; + + if (D_80371E70 != 0) { + D_80371E70 = (struct56s *)defrag(D_80371E70); + } + if (D_80371E74 != 0) { + D_80371E74 = defrag(D_80371E74); + } + if (D_803858A0 != 0) { + D_803858A0 = defrag(D_803858A0); + } + + for(i = 0; i < D_80371E78; i++){ + D_80371E74[i] = defrag(D_80371E74[i]); + D_80371E70[i] = defrag(D_80371E70[i]); + } +} + +bool func_80344040(Actor *this){ + return func_80323240(D_80371E70[this->unk44_14], this->unk48, this->position); +} diff --git a/src/core2/code_BB50.c b/src/core2/code_BB50.c new file mode 100644 index 00000000..154e4563 --- /dev/null +++ b/src/core2/code_BB50.c @@ -0,0 +1,49 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .data */ +struct43s D_803637A0 = { + {{-200.0f, 200.0f, -200.0f}, {200.0f, 400.0f, 200.0f}}, + {{0.0f, -800.0, 0.0f}, {0.0f, -800.0f, 0.0f}}, + {{-10.0f, -10.0f, -10.0f}, {10.0f, 10.0f, 10.0f}} +}; + +/* .bss */ +ParticleEmitter *gEggShatter_controller; + +/*.code */ +void eggShatter_draw(Gfx **gPtr, Mtx **mPtr, Vtx **vPtr){ + func_802EF3A8(gEggShatter_controller, gPtr, mPtr, vPtr); +} + +void eggShatter_free(void){ + func_802EF684(gEggShatter_controller); +} + +void eggShatter_init(void){ + gEggShatter_controller = particleEmitter_new(20); + particleEmitter_setModel(gEggShatter_controller, 0x360); + func_802EF9F8(gEggShatter_controller, 0.6f); + func_802EFA18(gEggShatter_controller, 0); + func_802EFB70(gEggShatter_controller, 0.8f, 1.0f); + func_802EFE24(gEggShatter_controller, 400.0f, 400.0f, 400.0f, 800.0f, 800.0f, 800.0f); + particleEmitter_setSpawnIntervalRange(gEggShatter_controller, 0.0f, 0.01f); + func_802EFEC0(gEggShatter_controller, 1.5f, 1.5f); + particleEmitter_setPositionVelocityAndAccelerationRanges(gEggShatter_controller, &D_803637A0); +} + +void eggShatter_update(void){ + particleEmitter_update(gEggShatter_controller); +} + +void eggShatter_new(f32 position[3]){ + particleEmitter_setPosition(gEggShatter_controller, position); + particleEmitter_emitN(gEggShatter_controller, 5); +} + +void eggShatter_defrag(void){ + if(gEggShatter_controller != NULL){ + gEggShatter_controller = func_802F0D74(gEggShatter_controller); + } +} diff --git a/src/core2/code_BD100.c b/src/core2/code_BD100.c new file mode 100644 index 00000000..749ad0d8 --- /dev/null +++ b/src/core2/code_BD100.c @@ -0,0 +1,143 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80336924(Gfx*, Vtx*, BKSprite *, s32, s32); + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BD100/func_80344090.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BD100/func_80344124.s") + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BD100/func_80344138.s") +#else +extern f32 D_80379080; +extern f32 D_80379084; +extern struct { + void (*unk0)(void *); + void *unk4; +}D_80371EC0; +extern f32 D_80371ECC; +extern u8 D_803858B0; + +extern void func_80252330(f32, f32, f32); + +void func_80344138(BKSpriteDisplayData *self, s32 frame, s32 arg2, f32 position[3], f32 arg4[3], Gfx **gfx, Mtx **mtx) { + f32 sp6C[3]; + f32 sp60[3]; + f32 temp_f14; + f32 sp50[3]; + BKSprite *temp_v0; + f32 var_f2_2; + BKSpriteFrameDisplayData *temp_a3; + f32 sp30[3]; + + func_8024C5CC(&sp6C); + func_8024C5A8(&sp60); + sp50[0] = position[0] - sp6C[0]; + sp50[1] = position[1] - sp6C[1]; + sp50[2] = position[2] - sp6C[2]; + temp_f14 = sp60[0]*sp50[0] + sp60[1]*sp50[1] + sp60[2]*sp50[2]; + if ((temp_f14 < 0.0f) || (D_80379080 < temp_f14)) { + func_80344124(); + return; + } + if (arg4 != NULL) { + sp30[0] = arg4[0]; + sp30[1] = arg4[1]; + sp30[2] = arg4[2]; + } else { + sp30[0] = sp30[1] = sp30[2] = 1.0f; + } + + + var_f2_2 = (self->sprite->unkA * sp30[2] <= self->sprite->unk8 * sp30[0]) ? self->sprite->unk8 * sp30[0] : self->sprite->unkA * sp30[2]; + if ((D_80379084 < temp_f14) && ((var_f2_2 / temp_f14) < D_80371ECC) && (D_803858B0 == 0)) { + func_80344124(); + return; + } + if (D_80371EC0.unk0 != NULL) { + D_80371EC0.unk0(D_80371EC0.unk4); + } + func_80251BCC(func_8024DD90()); + func_80252330(sp50[0], sp50[1], sp50[2]); + if ((arg4 != NULL) || (arg2 != 0)) { + mlMtxScale_xyz((arg2 != 0) ? -arg4[0] : arg4[0], sp30[2], sp30[1]); + } + mlMtxApply(*mtx); + gSPMatrix((*gfx)++, (*mtx)++, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + temp_a3 = &self->frame[frame]; + gSPSegment((*gfx)++, 1, osVirtualToPhysical(temp_a3->vtx)); + gSPDisplayList((*gfx)++, temp_a3->gfx); + if(temp_a3); + gSPPopMatrix((*gfx)++, G_MTX_MODELVIEW); + func_80349AD0(); + func_80344124(); +} +#endif + + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BD100/func_80344424.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BD100/func_80344720.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BD100/func_803449DC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BD100/func_803449FC.s") + + + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BD100/func_80344A1C.s") +#else +BKSpriteDisplayData * func_80344A1C(BKSprite *arg0){ + s32 header_size; //s7 + BKSpriteDisplayData *s6; + Gfx *gfx_end; //sp394 + Vtx* vtx_start; //s4 + Gfx *gfx_start; //s5 + s16 frame_vtx_size[200]; //sp1FC + s16 frame_gfx_size[200]; //sp6C; + int i; + s32 s1; + BKSpriteFrameDisplayData *v1; + Vtx* vtx_end; //sp5C + + header_size = ALIGN(sizeof(BKSpriteDisplayData)+ sizeof(BKSpriteFrameDisplayData)*arg0->frameCnt, 0x10); + s1 = 0; + s6 = (BKSpriteDisplayData *) malloc(header_size); + s6->unk0 = arg0; + for(i = 0; i < arg0->frameCnt; i++){//L80344A88 + s1 = ALIGN(s1, 0x10); + s6 = realloc(s6, header_size + s1 + 0x12C0); + vtx_start = (s32)s6 + header_size + s1; + gfx_start = vtx_start + 200; + vtx_end = vtx_start; + gfx_end = gfx_start; + func_80336924(&gfx_end, &vtx_end, arg0, i, 1); + gSPEndDisplayList(gfx_end++); + frame_vtx_size[i] = ALIGN(sizeof(Vtx)*(vtx_end - vtx_start), 0x10); + frame_gfx_size[i] = sizeof(Gfx)*(gfx_end - gfx_start); + s1 += frame_vtx_size[i] + frame_gfx_size[i]; + memcpy((s32)vtx_start + frame_vtx_size[i], gfx_start, frame_gfx_size[i]); + s6 = realloc(s6, header_size + s1); + }//L80344B6C + osWritebackDCache(s6, header_size + s1); + s1 = 0; + v1 = s6->frame + for(i = 0; i < arg0->frameCnt; i++){//L80344B94 + v1[i].unk4 = ((s32)s6 + header_size) + s1; + v1[i].unk0 = (s32)v1[i].unk4 + frame_vtx_size[i]; + s1 += ALIGN(frame_vtx_size[i] + frame_gfx_size[i], 0x10); + }//L80344BE0 + return s6; +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BD100/func_80344C14.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BD100/func_80344C20.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BD100/func_80344C2C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BD100/func_80344C38.s") diff --git a/src/core2/code_BD20.c b/src/core2/code_BD20.c new file mode 100644 index 00000000..f60934f1 --- /dev/null +++ b/src/core2/code_BD20.c @@ -0,0 +1,124 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + f32 unk0; + u8 unk4; + u8 pad5[3]; +} struct_BD20; + +/* .bss */ +struct_BD20 D_8037C190[4]; + +/* .code */ +f32 func_80292CB0(s32 arg0){ + switch (arg0) { + case 0: + return func_8029DFC8(); + case 1: + return func_8029DFD4(); + case 2: + return 0.0f; + case 3: + return 0.0f; + default: + return 0.0f; + } +} + + +void func_80292D2C(s32 arg0, f32 arg1){ + switch(arg0){ + case 0: + func_8029E0C4(arg1); + break; + case 1: + func_8029E0D0(arg1); + break; + case 2: + break; + case 3: + default: + break; + } +} + +void func_80292D88(void){ + int i; + for(i = 0; i < 4; i++){ + D_8037C190[i].unk0 = 1.0f; + D_8037C190[i].unk4 = 0; + func_80292D2C(i, 0.0f); + } +} + +void func_80292E00(s32 arg0, f32 arg1){ + D_8037C190[arg0].unk4 = 1; + D_8037C190[arg0].unk0 = arg1; +} + +void func_80292E24(s32 arg0, f32 arg1){ + D_8037C190[arg0].unk4 = 5; + D_8037C190[arg0].unk0 = arg1; +} + + +void func_80292E48(void){ + func_80292E24(0, 0.09f); + func_80292E24(1, 0.09f); +} + +void func_80292E80(s32 arg0, f32 arg1){ + D_8037C190[arg0].unk4 = 4; + D_8037C190[arg0].unk0 = arg1; +} + +void func_80292EA4(void){ + func_80292E80(0, 0.034f); + func_80292E80(1, 0.034f); +} + +void func_80292EDC(void){ + f32 temp_f22; + f32 temp_f0; + int i; + + temp_f22 = time_getDelta(); + for(i = 0; i < 4; i++){ + temp_f0 = func_80292CB0(i); + switch(D_8037C190[i].unk4){ + case 1://L80292F78 + temp_f0 += temp_f22/D_8037C190[i].unk0; + if(1.0 < temp_f0){ + temp_f0 = 1.0f; + D_8037C190[i].unk4 = 2; + } + func_80292D2C(i, temp_f0); + break; + case 2://L80292FB4 + D_8037C190[i].unk4 = 3; + break; + case 3://L80292FBC + case 4://L80292FBC + temp_f0 -= temp_f22/D_8037C190[i].unk0; + if(temp_f0 < 0.0){ + temp_f0 = 0.0f; + D_8037C190[i].unk4 = 0; + } + func_80292D2C(i, temp_f0); + break; + case 5://L80292FF8 + temp_f0 += temp_f22/D_8037C190[i].unk0; + if(1.0 < temp_f0){ + temp_f0 = 1.0f; + D_8037C190[i].unk4 = 0; + } + func_80292D2C(i, temp_f0); + break; + case 0://L8029302C + default://L8029302C + break; + } + } +} diff --git a/src/core2/code_BDCC0.c b/src/core2/code_BDCC0.c new file mode 100644 index 00000000..845172f5 --- /dev/null +++ b/src/core2/code_BDCC0.c @@ -0,0 +1,178 @@ +#include +#include "functions.h" +#include "variables.h" + +extern bool func_80244D94(f32[3], f32[3], f32[3], u32, f32); + +typedef struct struct_core2_bd100_0_s{ + f32 unk0; + f32 unk4[3]; + f32 unk10[3]; + f32 unk1C; + f32 unk20; + u8 unk24; + u8 unk25; + u8 unk26; + u8 pad27[1]; +} Struct_Core2_BD100_0; + +/* .h */ +void func_80344D70(u8 index); + +/* .bss */ +Struct_Core2_BD100_0 D_803858C0[42]; + +/* .code */ +void func_80344C50(void){ + s32 i; + for(i = 1; i < 41; i++){ + D_803858C0[i].unk26 = 0; + } +} + +void func_80344C80(void) { + s32 i; + for(i = 1; i < 41; i++){ + if(D_803858C0[i].unk26 != 0){ + func_80344D70(i); + } + } +} + +u8 func_80344CDC(void) { + s32 i; + + for(i = 1; i < 41; i++){ + if(D_803858C0[i].unk26 == 0){ + D_803858C0[i].unk0 = 0.0f; + ml_vec3f_clear(D_803858C0[i].unk4); + ml_vec3f_clear(D_803858C0[i].unk10); + D_803858C0[i].unk26 = 1U; + D_803858C0[i].unk25 = 0; + D_803858C0[i].unk24 = 0; + D_803858C0[i].unk1C = 0.0f; + D_803858C0[i].unk20 = 0.0f; + return i; + } + } + return 0; +} + +void func_80344D70(u8 index){ + D_803858C0[index].unk26 = 0; +} + +void func_80344D94(u8 index, f32 src[3]){ + ml_vec3f_copy(D_803858C0[index].unk4, src); +} + +void func_80344DD4(u8 index, f32 dst[3]){ + ml_vec3f_copy(dst, D_803858C0[index].unk4); +} + +void func_80344E18(u8 index, s32 arg1){ + D_803858C0[index].unk25 = arg1; +} + +void func_80344E3C(u8 index, f32 src[3]){ + ml_vec3f_copy(D_803858C0[index].unk10, src); +} + +void func_80344E7C(u8 index, f32 dst[3]){ + ml_vec3f_copy(dst, D_803858C0[index].unk10); +} + +s32 func_80344EC0(u8 index){\ + return D_803858C0[index].unk24; +} + +void func_80344EE4(u8 index, f32 arg1, f32 arg2){ + D_803858C0[index].unk1C = arg1; + D_803858C0[index].unk20 = arg2; +} + +f32 func_80344F18(u8 index){ + return D_803858C0[index].unk4[1] - D_803858C0[index].unk0; +} + +void func_80344F48(Struct_Core2_BD100_0 *self, f32 arg1[3], f32 arg2[3]) { + f32 sp24[3]; + + self->unk10[1] += self->unk1C * time_getDelta(); + if (self->unk10[1] < (time_getDelta() * self->unk20)) { + self->unk10[1] = time_getDelta() * self->unk20; + } + ml_vec3f_copy(sp24, self->unk10); + ml_vec3f_scale(sp24, time_getDelta()); + ml_vec3f_add(arg2, arg1, sp24); +} + +f32 func_80344FF0(f32 self[3]){ + return -9000.0f; +} + +void func_80345000(Struct_Core2_BD100_0 *self, f32 arg1[3]) { + f32 sp3C[3]; + f32 sp30[3]; + void *temp_a0; + + self->unk24 = FALSE; + func_80344F48(self, arg1, sp30); + temp_a0 = self + 0x10; + if (func_80244D94(arg1, sp30, sp3C, 0x025E0080, 15.0f)) { + func_80257DB0(self->unk10, self->unk10, sp3C); + self->unk10[1] = max_f(self->unk10[1], 250.0f); + self->unk24 = TRUE; + } + self->unk0 = func_80344FF0(sp30); + ml_vec3f_copy(self->unk4, sp30); + ml_vec3f_copy(arg1, sp30); +} + +void func_803450B0(Struct_Core2_BD100_0 *self, f32 arg1[3]) { + f32 sp34[3]; + f32 sp28[3]; + s32 pad; + + func_80344F48(self, arg1, sp28); + if (func_80244D94(arg1, sp28, sp34, 0x025E0080, 15.0f)) { + ml_vec3f_clear(self->unk10); + } + ml_vec3f_copy(self->unk4, sp28); + ml_vec3f_copy(arg1, sp28); + self->unk0 = func_80344FF0(sp28); +} + +void func_80345138(Struct_Core2_BD100_0 *self, f32 arg1[3]) { + f32 sp1C[3]; + + ml_vec3f_copy(sp1C, self->unk10); + ml_vec3f_scale(sp1C, time_getDelta()); + arg1[0] += sp1C[0]; + arg1[1] += sp1C[1]; + arg1[2] += sp1C[2]; +} + +void func_803451B0(u8 index, f32 arg1[3]) { + + switch(D_803858C0[index].unk25){ + case 1: //L80345200 + func_803450B0(&D_803858C0[index], arg1); + break; + + case 2: //L80345210 + func_80345138(&D_803858C0[index], arg1); + break; + + case 4: //L80345220 + func_80345000(&D_803858C0[index], arg1); + break; + + case 5: //L80345230 + func_80344F48(&D_803858C0[index], arg1, arg1); + break; + + case 3: //L8034523C + break; + } +} diff --git a/src/core2/code_BE2C0.c b/src/core2/code_BE2C0.c new file mode 100644 index 00000000..44ed94f5 --- /dev/null +++ b/src/core2/code_BE2C0.c @@ -0,0 +1,32 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BE2C0/func_80345250.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BE2C0/func_80345274.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BE2C0/func_80345434.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BE2C0/func_803454D0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BE2C0/func_80345630.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BE2C0/func_80345650.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BE2C0/func_803458E4.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BE2C0/func_80345A44.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BE2C0/func_80345C78.s") + +void func_80345CD4(f32 arg0[4], f32 arg1[4]){ + mlMtxIdent(); + mlMtxRotRoll(arg1[2]); + mlMtxRotYaw(arg1[1]); + mlMtxRotPitch(arg1[0]); + func_80345A44(arg0, func_80251488()); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BE2C0/func_80345D30.s") diff --git a/src/core2/code_BEF20.c b/src/core2/code_BEF20.c new file mode 100644 index 00000000..f4894b67 --- /dev/null +++ b/src/core2/code_BEF20.c @@ -0,0 +1,437 @@ +#include +#include "functions.h" +#include "variables.h" + +f32 time_getDelta(void); +void func_80346DB4(s32); + +s32 func_803463D4(enum item_e item, s32 diff); +s32 notescore_getLevelScore(enum level_e lvl_id); +void func_80347060(void); + +extern s32 D_80385F30[]; +extern s32 D_80385FE0; +extern s32 D_80385FE4; +extern s32 D_80385FE8; +extern f32 D_80385FEC; +extern u8 D_80385FF0[]; +extern f32 D_80386000[]; + +void func_80345EB0(enum item_e item){ + if(func_802FAFE8(item)){ + func_803463D4(item, (s32)(-time_getDelta()*60.0f * 1.1)); + }else{ + func_802FACA4(item); + } +} + +void item_inc(enum item_e item){ + func_803463D4(item, 1); +} + +void item_dec(enum item_e item){ + if(!func_802E4A08()) + func_803463D4(item, -1); +} + +s32 item_empty(enum item_e item){ + return (D_80385F30[item] != 0)? 0 : 1; +} + +s32 item_getCount(enum item_e item){ + return D_80385F30[item]; +} + + +#ifdef NONMATCHING +/* &D_80385F30[item] saving to sp18 but should be sp1C, +cannot access sp1C with newVal at sp18. +may be -O3 issue given func_803465DC() is null +*/ +s32 func_80345FB4(enum item_e item, s32 diff, s32 arg2){ + s32 oldVal; + s32 sp40; + s32 sp3C; + s32 sp38; + s32 sp34; + s32 sp30; + s32 sp2C; + s32 sp28; + s32 sp24; + s32 newVal; + + oldVal = D_80385F30[item]; + + if(func_80255D04()) + diff = 0; + + if(diff < 0){ + if( (item == ITEM_D_EGGS && func_803203FC(UNKFLAGS1_74_SANDCASTLE_INFINITE_EGGS)) + || (item == ITEM_16_LIFE && func_803203FC(UNKFLAGS1_73_SANDCASTLE_INFINITE_LIVES)) + || (item == ITEM_F_RED_FEATHER && func_803203FC(UNKFLAGS1_75_SANDCASTLE_INFINITE_RED_FEATHERS)) + || (item == ITEM_10_GOLD_FEATHER && func_803203FC(UNKFLAGS1_76_SANDCASTLE_INFINITE_GOLD_FEATHERS)) + || (item == ITEM_17_AIR && func_803203FC(UNKFLAGS1_96_SANDCASTLE_INFINITE_AIR))) + diff = 0; + } + newVal = MAX(0, D_80385F30[item] + diff); + D_80385F30[item] = newVal; + + sp34 = (func_8031FF1C(BKPROG_B9_DOUBLE_HEALTH))? 2 : 1 ; + D_80385F30[ITEM_15_HEALTH_TOTAL] = MIN(sp34*8, D_80385F30[ITEM_15_HEALTH_TOTAL]); + D_80385F30[ITEM_14_HEALTH]= MIN(D_80385F30[ITEM_15_HEALTH_TOTAL], D_80385F30[ITEM_14_HEALTH]); + D_80385F30[ITEM_17_AIR] = MIN(3600, D_80385F30[ITEM_17_AIR]); + D_80385F30[ITEM_25_MUMBO_TOKEN_TOTAL] = D_80385F30[ITEM_1C_MUMBO_TOKEN]; + D_80385F30[ITEM_16_LIFE] = MIN(0xFF, D_80385F30[ITEM_16_LIFE]); + + switch(item){ + case ITEM_D_EGGS: + sp38 = (func_8031FF1C(BKPROG_BE_CHEATO_BLUEEGGS))? 200 : 100; + break; + + case ITEM_F_RED_FEATHER: + sp38 = (func_8031FF1C(BKPROG_BF_CHEATO_REDFEATHERS))? 100 : 50; + break; + + case ITEM_10_GOLD_FEATHER: + sp38 = (func_8031FF1C(BKPROG_C0_CHEATO_GOLDFEATHERS))? 20 : 10; + break; + + default: + sp38 = 0; + break; + } + if(sp38){ + D_80385F30[item] = MIN(sp38, D_80385F30[item]); + } + if(!arg2){ + func_802FACA4(item); //displays item on HUD + if(item == ITEM_14_HEALTH || item == ITEM_17_AIR) + func_802FACA4(ITEM_16_LIFE); + } + + sp3C = item_empty(item); + if(item < 6 && sp3C) + D_80385F30[item + ITEM_6_HOURGLASS] = 0; + + switch(item){ + case ITEM_14_HEALTH: + if(sp3C) + D_80385FE4 = 1; + break; + case ITEM_17_AIR: + sp30 = func_80301D24(oldVal); + sp2C = func_80301D24(newVal); + if(sp3C){ + bs_checkInterrupt(0x11); + D_80385FE4 = 1; + } + if(sp2C && sp30 != sp2C ){ + if(sp2C < sp30){ + func_8025A6EC(SFX_AIR_METER_DROPPING, 28000); + } + else{ + func_8030E760(0x3e9, 1.2f, 28000); + } + } + break; + case ITEM_C_NOTE: + sp28 = notescore_getLevelScore(level_get()); + func_80346DB4(D_80385F30[item]); + if(D_80385F30[item] == 100 && sp28 != 100){ + func_8025A6EC(COMUSIC_36_100TH_NOTE_COLLECTED, 20000); + item_inc(ITEM_16_LIFE); + } + break; + case ITEM_26_JIGGY_TOTAL: + D_80385F30[0x2b] += diff; + break; + } + return D_80385F30[item]; +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80345FB4.s") +#endif + +s32 func_803463D4(enum item_e item, s32 diff){ + func_80345FB4(item, diff, 0); +} + +void func_803463F4(enum item_e item, s32 diff){ + func_80345FB4(item, diff, 1); +} + +void item_set(s32 item, s32 val){ + func_803463D4(item, val - item_getCount(item)); +} + +void func_80346448(s32 item){ + func_803463D4(item, 9999999); +} + +void func_8034646C(void){ + int i; + for(i = 0; i < 0x2C; i++){ + D_80385F30[i] = 0; + } + D_80385F30[ITEM_D_EGGS] = 0; + D_80385F30[ITEM_F_RED_FEATHER] = 0; + D_80385F30[ITEM_10_GOLD_FEATHER] = 0; + D_80385F30[ITEM_14_HEALTH] = D_80385F30[ITEM_15_HEALTH_TOTAL] = 5; + D_80385F30[ITEM_16_LIFE] = 3; + D_80385F30[ITEM_17_AIR] = 3600; + D_80385F30[ITEM_1C_MUMBO_TOKEN] = 0; + D_80385F30[0x2B] = 0; + D_80385F30[ITEM_26_JIGGY_TOTAL] = 0; + func_80346D78(); + func_80347060(); + D_80385FE4 = FALSE; +} + +void func_803464F8(s32 level){ + int i; + + for(i = 0; i < 6; i++){ + D_80385F30[ITEM_0_HOURGLASS_TIMER + i] = 0; + D_80385F30[ITEM_6_HOURGLASS + i] = 0; + } + + D_80385F30[ITEM_C_NOTE] = 0; + D_80385F30[ITEM_E_JIGGY] = jiggyscore_leveltotal(level); + D_80385F30[ITEM_12_JINJOS] = 0; + D_80385F30[ITEM_17_AIR] = 3600; + D_80385F30[ITEM_18_GOLD_BULLIONS] = 0; + D_80385F30[ITEM_19_ORANGE] = 0; + D_80385F30[ITEM_23_ACORNS] = 0; + D_80385F30[ITEM_1A_PLAYER_VILE_SCORE] = 0; + D_80385F30[ITEM_1B_VILE_VILE_SCORE] = 0; + D_80385F30[ITEM_1F_GREEN_PRESENT] = 0; + D_80385F30[ITEM_20_BLUE_PRESENT] = 0; + D_80385F30[ITEM_21_RED_PRESENT] = 0; + D_80385F30[ITEM_22_CATERPILLAR] = 0; + func_802FA5D0(); + D_80385FE8 = 1; +} + +void func_803465BC(void){ + func_802FBDFC(); +} + +void func_803465DC(void){} + +void func_803465E4(void){ + s32 sp54 = bs_getState(); + s32 sp50 = 0; + s32 sp4C = level_get(); + s32 i; + int is_underwater; + int is_on_water_surface; + int is_in_polluted_or_winter_water; + + if(func_80334904() != 2) return; + if(D_80385FE8){ + if( func_802BC248() != 3 + && func_8028F070() + && map_get() != MAP_33_UNUSED + && map_get() != MAP_91_FILE_SELECT + ){ + D_80385FE0 = TRUE; + }//L80346674 + D_80385FE8 = FALSE; + }//L8034667C + + if(D_80385FE0){ + if(gctransition_8030BD98() || func_803203FC(0)){ + if(D_80385FE4){ + item_dec(ITEM_16_LIFE); + func_802FACA4(ITEM_14_HEALTH); + } + D_80385FE4 = FALSE; + sp50 = TRUE; + D_80385FE0 = FALSE; + } + } + else{//L803466E8 + if( D_80385F30[ITEM_14_HEALTH] != 0 + && D_80385F30[ITEM_14_HEALTH] < 3 + && func_80347A4C() + ){ + sp50 = TRUE; + } + }//L80346710 + + if(sp50){ + func_803463D4(ITEM_14_HEALTH, 0); + } + + if(sp54 == BS_24_FLY || sp54 == BS_23_FLY_ENTER){ + func_803463D4(ITEM_F_RED_FEATHER, 0); + } + + if(!func_8028EC04() && func_8028F070()){ + if(level_get() != LEVEL_2_TREASURE_TROVE_COVE || !levelSpecificFlags_get(5)){ + is_underwater = (func_8028EE84() == BSWATERGROUP_2_UNDERWATER); + is_on_water_surface = (func_8028EE84() == BSWATERGROUP_1_SURFACE); + is_in_polluted_or_winter_water = ((level_get() == LEVEL_9_RUSTY_BUCKET_BAY) || (map_get() == MAP_46_CCW_WINTER)); + if( is_in_polluted_or_winter_water && (is_underwater || is_on_water_surface)){ //L803467EC + D_80385FEC = 2.0f; + } + else{//L80346804 + D_80385FEC = MAX(0.0, D_80385FEC - time_getDelta()); + }//L80346870 + if( (!is_in_polluted_or_winter_water && is_underwater) || (is_in_polluted_or_winter_water && is_on_water_surface) ){//L80346894 + func_803463D4(ITEM_17_AIR, (s32)((f64)((-time_getDelta())*60.0f)*1.1)); + } + else{ + if(is_in_polluted_or_winter_water && is_underwater){//L803468D8 + func_803463D4(ITEM_17_AIR, (s32)(f64)((-time_getDelta()*60.0f)*2.1)); + }//L80346930 + if(!is_in_polluted_or_winter_water || D_80385FEC == 0.0f){ + if(!D_80385FE4 && D_80385F30[ITEM_17_AIR] < 3600){ + func_803463D4(ITEM_17_AIR, (s32)(((time_getDelta()*60.0f)*100.0)*1.1)); + D_80385F30[ITEM_17_AIR] = MIN(D_80385F30[ITEM_17_AIR], 3600); + } + } + } + }//L803469E4 + }//L803469E4 + + if(!func_803203FC(0xbf)){ + for(i = 0; i < 6; i++){ + if(D_80385F30[ITEM_6_HOURGLASS + i]){ + func_80345EB0(ITEM_0_HOURGLASS_TIMER + i); + } + } + }//L80346A2C + + if( getGameMode() != GAME_MODE_4_PAUSED + && func_8028F070() + ){ + if(sp4C == 0xC) + sp4C = 6; + if(sp4C > 0 && sp4C < 0xC && map_get() != MAP_91_FILE_SELECT){ + D_80386000[sp4C] = MAX(1.0, MIN(65535.0, D_80386000[sp4C] + time_getDelta())); + } + }//L80346B6C + + if((func_8023DB5C() & 7) == 6){ + if(!func_80320708() || !func_80320248()){ + D_80385F30[randi2(0, 0x2C)] = 1; + D_80385FF0[randi2(0, 0xE)] = 1; + D_80386000[randi2(0, 0xE)] = 1.0f; + } + } +} + +void func_80346C10(enum bs_e *retVal, enum bs_e fail_state, enum bs_e success_state, enum item_e item_id, int use_item){ + if(item_empty(item_id)){ + func_803463D4(item_id, 0); + func_8025A6EC(COMUSIC_2C_BUZZER, 22000); + if(fail_state != -1){ + *retVal = fail_state; + } + } + else{ + if(use_item){ + item_dec(item_id); + } + if(success_state != -1) + *retVal = success_state; + } +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80346CA8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80346CE8.s") + +enum item_e func_80346CF4(enum actor_e actor_id){ + switch(actor_id){ + case ACTOR_29_ORANGE_COLLECTABLE: return ITEM_19_ORANGE; + case ACTOR_2A9_ACORN: return ITEM_23_ACORNS; + case ACTOR_2A2_CATERPILLAR: return ITEM_22_CATERPILLAR; + case ACTOR_2A_GOLD_BULLION: return ITEM_18_GOLD_BULLIONS; + case ACTOR_1ED_BLUE_PRESENT_COLLECTABLE: return ITEM_20_BLUE_PRESENT; + case ACTOR_1EF_GREEN_PRESENT_COLLECTABLE: return ITEM_1F_GREEN_PRESENT; + case ACTOR_1F1_RED_PRESENT_COLLECTABLE: return ITEM_21_RED_PRESENT; + } + return 0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80346D78.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80346DB4.s") + +s32 notescore_getTotal(void){ + int i = 1; + s32 total = 0; + do{ + total += D_80385FF0[i++]; + }while(i < 0xe); + return total; +} + +s32 notescore_getLevelScore(enum level_e lvl_id){ + return D_80385FF0[lvl_id]; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80346F44.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80347018.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80347060.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_803470A0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_8034717C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_8034722C.s") + +extern u8 D_80386060[]; //saved item array +extern s32 D_80385F68; + +//itemscore_getSavedItemArray +void func_80347630(s32 *size, u8 **buffer){ + D_80386060[0] = item_getCount(ITEM_1C_MUMBO_TOKEN); + D_80386060[1] = item_getCount(ITEM_D_EGGS); + D_80386060[2] = item_getCount(ITEM_F_RED_FEATHER); + D_80386060[3] = item_getCount(ITEM_10_GOLD_FEATHER); + D_80386060[4] = item_getCount(ITEM_26_JIGGY_TOTAL); + *size = 5; + *buffer = D_80386060; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_803476B0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_8034774C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_8034789C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80347958.s") + +void func_80347984(void){} + +void func_8034798C(void){ + D_80385F68 = jiggyscore_leveltotal(level_get()); + func_802FA5D0(); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_803479C0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80347A14.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80347A4C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80347A70.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80347A7C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80347AA8.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80347B10.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80347B54.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_BEF20/func_80347B80.s") + +void func_80347C5C(s32 arg0, s32 arg1, s32 arg2, s32 arg3){} + +void func_80347C70(s32 arg0){} \ No newline at end of file diff --git a/src/core2/code_C0CF0.c b/src/core2/code_C0CF0.c new file mode 100644 index 00000000..f3c67932 --- /dev/null +++ b/src/core2/code_C0CF0.c @@ -0,0 +1,270 @@ +#include +#include "functions.h" +#include "variables.h" + +#define rare_gDPLoadMultiBlock(pkt, timg, tmem, rtile, fmt, siz, width, height, \ + uls, ult, \ + pal, cms, cmt, masks, maskt, shifts, shiftt) \ +{ \ + gDPSetTextureImage(pkt, fmt, siz##_LOAD_BLOCK, 1, timg); \ + gDPSetTile(pkt, fmt, siz##_LOAD_BLOCK, 0, tmem, G_TX_LOADTILE, 0,\ + cmt, maskt, shiftt, cms, masks, shifts); \ + gDPLoadSync(pkt); \ + gDPLoadBlock(pkt, G_TX_LOADTILE, 0, 0, \ + (((width)*(height) + siz##_INCR) >> siz##_SHIFT)-1, \ + CALC_DXT(width, siz##_BYTES)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, siz, (((width) * siz##_LINE_BYTES)+7)>>3, \ + tmem, rtile, pal, cmt, \ + maskt, shiftt, cms, masks, shifts); \ + gDPSetTileSize(pkt, rtile, \ + (uls)<>2)-1, \ + CALC_DXT_4b(width)); \ + gDPPipeSync(pkt); \ + gDPSetTile(pkt, fmt, G_IM_SIZ_4b, ((((width)>>1)+7)>>3), tmem, \ + rtile, pal, cmt, maskt, shiftt, cms, masks, \ + shifts); \ + gDPSetTileSize(pkt, rtile, \ + (uls)<w; + *argC = (s32) temp_v0->h; + if (*argF == -1) { + *argF = (s32) temp_v0->chunkCnt; + } + (*argF)--; + chunk_count = *argF; + if (sprite->type & SPRITE_TYPE_CI4) { + for(palette_addr = (s32)(temp_v0 + 1); palette_addr % 8; palette_addr++); + gDPSetTextureLUT((*gfx)++, G_TT_RGBA16); + gDPLoadTLUT_pal16((*gfx)++, 0, palette_addr); + D_803860B0 = TRUE; + D_803860B4 = 0; + D_80386074 = NULL; + D_8038607C = 0; + D_80386098 = 0; + } else if (sprite->type & SPRITE_TYPE_CI8) { + gDPPipelineMode((*gfx)++, G_PM_1PRIMITIVE); + for(palette_addr = (s32)(temp_v0 + 1); palette_addr % 8; palette_addr++); + D_803860B0 = TRUE; + D_803860B4 = 1; + D_80386074 = NULL; + D_8038607C = 0; + var_v1 = palette_addr + 0x200; + D_80386098 = 0; + for(var_a0 = 0; var_a0 < chunk_count; var_a0++) { + var_v1 = (s32)var_v1 + (var_v1->w * var_v1->h) + sizeof(BKSpriteTextureBlock); + } + *argD = var_v1->x; + *argE = var_v1->y; + gDPSetTextureLUT((*gfx)++, G_TT_RGBA16); + gDPLoadTLUT_pal256((*gfx)++, palette_addr); + } else { + D_803860B0 = FALSE; + var_v1 = temp_v0 + 0x14; + } + + if ((D_8038607C == 0) || (tmem == D_80386078)) { + D_80386078 = tmem; + D_80386070 = temp_v0; + D_80386080 = arg5; + D_80386084 = arg6; + sp144 = 0; + D_80386088 = rtile; + } else { + D_80386094 = tmem; + D_80386074 = temp_v0; + D_8038609C = arg5; + D_803860A0 = arg6; + sp144 = 1; + D_803860A4 = rtile; + } + + *width = (s32) var_v1->w; + *height = (s32) var_v1->h; + for(timg = (s32)(var_v1 + 1); timg % 8; timg++); + + if (sp144 == 0) { + D_8038608C = *width; + D_80386090 = *height; + D_8038607C = D_8038608C * D_80386090; + } else { + D_803860A8 = *width; + D_803860AC = *height; + D_80386098 = D_803860A8 * D_803860AC; + } + + var_v0 = *width - 1; + if ((*width & 7) == 0) { + masks = 0; + while (var_v0 != 0) { + masks++; + var_v0 >>= 1; + } + } else { + masks = 0; + } + + var_v0 = *height - 1; + if ((*height & 7) == 0) { + maskt = 0; + while (var_v0 != 0) { + maskt++; + var_v0 >>= 1; + } + } else { + maskt = 0; + } + + if ( sprite->type & SPRITE_TYPE_I4) { + rare_gDPLoadMultiBlock_4b((*gfx)++, timg, tmem, rtile, G_IM_FMT_I, *width, *height, arg5, arg6, 0, cms, cmt, masks, maskt, G_TX_NOLOD, G_TX_NOLOD); + if (sp144 == 0) { + D_8038607C = (s32) D_8038607C >> 4; + } else { + D_80386098 = (s32) D_80386098 >> 4; + } + } else if (sprite->type & SPRITE_TYPE_IA4) { + rare_gDPLoadMultiBlock_4b((*gfx)++, timg, tmem, rtile, G_IM_FMT_IA, *width, *height, arg5, arg6, 0, cms, cmt, masks, maskt, G_TX_NOLOD, G_TX_NOLOD); + if (sp144 == 0) { + D_8038607C = (s32) D_8038607C >> 4; + } else { + D_80386098 = (s32) D_80386098 >> 4; + } + } else if (sprite->type & SPRITE_TYPE_I8) { + rare_gDPLoadMultiBlock((*gfx)++, timg, tmem, rtile, G_IM_FMT_I, G_IM_SIZ_8b, *width, *height, arg5, arg6, 0, cms, cmt, masks, maskt, G_TX_NOLOD, G_TX_NOLOD); + if (sp144 == 0) { + D_8038607C = (s32) D_8038607C >> 3; + } else { + D_80386098 = (s32) D_80386098 >> 3; + } + } else if (sprite->type & SPRITE_TYPE_IA8) { + rare_gDPLoadMultiBlock((*gfx)++, timg, tmem, rtile, G_IM_FMT_IA, G_IM_SIZ_8b, *width, *height, arg5, arg6, 0, cms, cmt, masks, maskt, G_TX_NOLOD, G_TX_NOLOD); + if (sp144 == 0) { + D_8038607C = (s32) D_8038607C >> 3; + } else { + D_80386098 = (s32) D_80386098 >> 3; + } + } else if (sprite->type & SPRITE_TYPE_RGBA16) { + rare_gDPLoadMultiBlock((*gfx)++, timg, tmem, rtile, G_IM_FMT_RGBA, G_IM_SIZ_16b, *width, *height, arg5, arg6, 0, cms, cmt, masks, maskt, G_TX_NOLOD, G_TX_NOLOD); + if (sp144 == 0) { + D_8038607C = (s32) D_8038607C >> 2; + } else { + D_80386098 = (s32) D_80386098 >> 2; + } + } else if (sprite->type & SPRITE_TYPE_RGBA32) { + rare_gDPLoadMultiBlock((*gfx)++, timg, tmem, rtile, G_IM_FMT_RGBA, G_IM_SIZ_32b, *width, *height, arg5, arg6, 0, cms, cmt, masks, maskt, G_TX_NOLOD, G_TX_NOLOD); + if (sp144 == 0) { + D_8038607C = (s32) D_8038607C >> 1; + } else { + D_80386098 = (s32) D_80386098 >> 1; + } + } else if (sprite->type & SPRITE_TYPE_CI4) { + rare_gDPLoadMultiBlock((*gfx)++, timg, tmem, rtile, G_IM_FMT_CI, G_IM_SIZ_4b, *width, *height, arg5, arg6, 0, cms, cmt, masks, maskt, G_TX_NOLOD, G_TX_NOLOD); + D_8038607C = D_8038607C >> 4; + } else if (sprite->type & SPRITE_TYPE_CI8) { + rare_gDPLoadMultiBlock((*gfx)++, timg, tmem, rtile, G_IM_FMT_CI, G_IM_SIZ_8b, *width, *height, arg5, arg6, 0, cms, cmt, masks, maskt, G_TX_NOLOD, G_TX_NOLOD); + D_8038607C = (s32) D_8038607C >> 3; + } + + if ((D_8038607C != 0) && (D_80386098 != 0) && (D_80386094 < (D_80386078 + D_8038607C))) { + D_80386074 = NULL; + D_80386098 = 0; + } +} +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C0CF0/func_80349AD0.s") + +void func_80349B1C(Gfx **gfx) { + void *temp_v1; + void *temp_v1_2; + void *temp_v1_3; + + if (D_803860B0) { + gDPPipeSync((*gfx)++); + gDPSetTextureLUT((*gfx)++, G_TT_NONE); + D_803860B0 = FALSE; + if (D_803860B4) { + gDPPipelineMode((*gfx)++, G_PM_NPRIMITIVE); + D_803860B4 = FALSE; + } + } +} diff --git a/src/core2/code_C0E0.c b/src/core2/code_C0E0.c new file mode 100644 index 00000000..021731d4 --- /dev/null +++ b/src/core2/code_C0E0.c @@ -0,0 +1,142 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + s32 unk0; + s32 unk4; +} struct_C0E0; + +typedef struct{ + s16 unk0; + u8 unk2; + u8 unk3; +} struct_C0E0_1; + +typedef struct{ + u8 pad0[0xC]; + struct_C0E0_1 unkC[]; +} struct_C0E0_2; + +void func_80293350(void); + +/* .data */ +struct_C0E0_2 D_803637F0 ={ + { 0x03, 0xE8, 0x00, 0x00, + 0x05, 0xDC, 0x00, 0x00, + 0x07, 0xD0, 0x00, 0x00 + }, + { + {7000, 8, 2}, + {6000, 7, 1}, + {5000, 6, 1}, + {4000, 5, 1}, + {3000, 4, 1}, + {2000, 3, 1}, + {1000, 2, 1}, + {0, 1, 1}, + {-1, 0, 0} + }, +}; + +/* .bss */ +f32 D_8037C1B0[3]; +u8 D_8037C1BC; +struct_C0E0 D_8037C1C0; + +/* .code */ +s32 func_80293070(struct_C0E0 *arg0, s32 arg1, struct_C0E0_2 *arg2){ + struct_C0E0_1 *iPtr; + for(iPtr = arg2->unkC; iPtr->unk0 >= 0; iPtr++){ + if(iPtr->unk0 + 1000 < arg1){ + arg0->unk0 = iPtr->unk2; + return iPtr->unk3; + } + } + return 0; +} + +s32 func_802930C0(struct_C0E0 *arg0, s32 arg1){ + arg0->unk0 = 0; + if(arg1 < 0) + return 0; + else{ + switch(_player_getTransformation()){ + case TRANSFORM_2_TERMITE: //L80293110 + return func_80293070(arg0, arg1, &D_803637F0); + case TRANSFORM_3_PUMPKIN: //L80293124 + return func_80293070(arg0, arg1, &D_803637F0); + case TRANSFORM_5_CROC: //L80293138 + return func_80293070(arg0, arg1, &D_803637F0); + case TRANSFORM_4_WALRUS: //L8029314C + return func_80293070(arg0, arg1, &D_803637F0); + case TRANSFORM_6_BEE: //L80293160 + return func_80293070(arg0, arg1, &D_803637F0); + default: + return func_80293070(arg0, arg1, &D_803637F0); + break; + } + } +} + +void func_80293190(void){ + f32 sp1C[3]; + s32 temp_a1; + + player_getPosition(sp1C); + temp_a1 = D_8037C1B0[1] - sp1C[1]; + D_8037C1C0.unk4 = func_802930C0(&D_8037C1C0, temp_a1); +} + +s32 func_802931DC(s32 *arg0){ + *arg0 = D_8037C1C0.unk0; + return D_8037C1C0.unk4; +} + +f32 func_802931F4(void){ + f32 sp1C[3]; + s32 temp_v0; + + player_getPosition(sp1C); + temp_v0 = D_8037C1B0[1] - sp1C[1]; + return temp_v0; +} + +s32 func_80293234(void){ + return D_8037C1BC; +} + +void func_80293240(s32 arg0){ + D_8037C1BC = arg0; + if(D_8037C1BC == 2 || D_8037C1BC == 3) + func_80293350(); +} + +void func_80293284(f32 arg0[3]){ + ml_vec3f_copy(D_8037C1B0, arg0); +} + +void func_802932AC(void){ + _player_getPosition(D_8037C1B0); + D_8037C1BC = 0; + func_80293240(1); + D_8037C1C0.unk0 = 0; + D_8037C1C0.unk4 = 0; +} + +void func_802932EC(void){ + s32 sp1C; + sp1C = func_8028ECAC(); + if(func_8028B2E8() || (func_8028EE84() != BSWATERGROUP_0_NONE) || sp1C == BSGROUP_A_FLYING){ + func_80293350(); + func_80293240(1); + } + func_80293190(); +} + +void func_80293350(void){ + f32 sp1C[3]; + + _player_getPosition(sp1C); + func_80293284(sp1C); +} diff --git a/src/core2/code_C2C20.c b/src/core2/code_C2C20.c new file mode 100644 index 00000000..c7431098 --- /dev/null +++ b/src/core2/code_C2C20.c @@ -0,0 +1,88 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct{ + s16 unk0; + s16 unk2; + f32 unk4; +}Struct_core2_C2C20_1; + +typedef struct { + Struct_core2_C2C20_1 unk0[4]; + f32 unk20[4]; +}Struct_core2_C2C20_0; + +/* .bss */ +array(Struct_core2_C2C20_0) *D_803860C0; + +/* .code */ +bool func_80349BB0(s32 arg0, s32 arg1, s32 *arg2) { + Struct_core2_C2C20_0 * temp_v0; + + temp_v0 = (Struct_core2_C2C20_0 *)array_at(D_803860C0, arg0); + if (temp_v0->unk0[arg1].unk0 != 0) { + *arg2 = (s32)temp_v0->unk20[arg1] * temp_v0->unk0[arg1].unk0; + return TRUE; + } + return FALSE; +} + +s32 func_80349C3C(void){ + Struct_core2_C2C20_0 *phi_v0; + s32 sp20; + s32 i; + + phi_v0 = (Struct_core2_C2C20_0 *)func_802EDAA4(&D_803860C0, &sp20); + for(i = 0; i < 4; i++){ + phi_v0->unk0[i].unk0 = 0; + phi_v0->unk20[i] = 0.0f; + } + return sp20; +} + +void func_80349C8C(void){ + array_free(D_803860C0); +} + +void func_80349CB0(void){ + D_803860C0 = (array(Struct_core2_C2C20_0) *)array_new(sizeof(Struct_core2_C2C20_0), 2); +} + +void func_80349CD8(s32 arg0){ + func_802EDCDC(D_803860C0, arg0); +} + +void func_80349D00(s32 arg0, BKModelUnk2C *arg1){ + Struct_core2_C2C20_0 * sp1C; + s32 i; + + + sp1C = (Struct_core2_C2C20_0 *) array_at(D_803860C0, arg0); + memcpy(sp1C, arg1, 0x20); + for(i = 0; i < 4; i++){ + sp1C->unk20[i] = 0.0f; + } +} + +void func_80349D60(void) { + f32 temp_f20; + s32 phi_s1; + Struct_core2_C2C20_0 *phi_a0; + s32 i; + + temp_f20 = time_getDelta(); + for(phi_s1 = 1; phi_s1 unk0[i].unk0 != 0) { + phi_a0->unk20[i] += (phi_a0->unk0[i].unk4 * temp_f20); + if ((s32) phi_a0->unk20[i] >= phi_a0->unk0[i].unk2) { + phi_a0->unk20[i] -= phi_a0->unk0[i].unk2; + } + } + } + } + } +} diff --git a/src/core2/code_C2F30.c b/src/core2/code_C2F30.c new file mode 100644 index 00000000..bc1686a0 --- /dev/null +++ b/src/core2/code_C2F30.c @@ -0,0 +1,103 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct struct_23_s{ + u16 unk0; + s8 unk2; + s8 unk3; +}struct23s; + +typedef struct demo_input{ + u8 unk0; + u8 unk1; + u16 unk2; + u8 unk4; + u8 unk5; +}DemoInput; + +typedef struct demo_file_header{ + u8 pad0[0x4]; + DemoInput inputs[]; +} DemoFileHeader; + + + +void demo_free(void); + +extern DemoInput D_80371EF0; + +extern DemoInput *D_803860D0; //demo_input_ptr +extern DemoFileHeader * D_803860D4; //demo_file_ptr + +extern s32 D_803860D8;//current_input +extern s32 D_803860DC;//total_inputs + +/* .code */ +s32 func_80349EC0(s32 arg0){ + s32 sp1C[3]; + + return func_80304DD0(arg0 + 0x1CC, &sp1C); +} + +int demo_readInput(OSContPad* arg0, s32* arg1){ + DemoInput *input_ptr = &D_803860D0[D_803860D8++]; + int not_eof = D_803860D8 < D_803860DC; + + if(!not_eof) + input_ptr = &D_80371EF0; + + arg0->stick_x = input_ptr->unk0; + arg0->stick_y = input_ptr->unk1; + arg0->button = input_ptr->unk2; + *arg1 = input_ptr->unk4; + + return not_eof; +} + +int demo_writeInput(OSContPad* arg0, s32* arg1){ + DemoInput *input_ptr = D_803860D0 + D_803860D8; + input_ptr->unk0 = arg0->stick_x; + input_ptr->unk1 = arg0->stick_y; + input_ptr->unk2 = arg0->button; + input_ptr->unk4 = *arg1; + D_803860D8++; + return D_803860D8 < D_803860DC; +} + +void func_80349FB0(DemoInput *input_ptr, u32 size, int arg2){ + D_803860D0 = input_ptr; + D_803860DC = size/sizeof(DemoInput); + D_803860D8 = 0; + if(input_ptr); + + func_8030AFD8(0); + func_80321854(); + func_8031FBF8(); + func_8031FBA0(); + func_803216D0(map_get()); + func_8030AFA0(map_get()); + func_803204E4(0xc4, 1); + func_8024F224(); + func_8034A6B4(); + func_8023DB68(); +}//*/ + +/* returns offset of current input */ +u32 func_8034A054(void){ + return D_803860D8*sizeof(DemoInput); +} + +void demo_load(enum map_e map, s32 demo_id){ + if(D_803860D4) + demo_free(); + D_803860D4 = assetcache_get(0x504 + map_getLevel(map) + demo_id*0xD); + func_80349FB0(D_803860D4->inputs, func_8033B678() - sizeof(DemoFileHeader), 0); +} + +void demo_free(void){ + if(D_803860D4){ + assetcache_release(D_803860D4); + D_803860D4 = NULL; + } +} diff --git a/src/core2/code_C31A0.c b/src/core2/code_C31A0.c new file mode 100644 index 00000000..716cf1c2 --- /dev/null +++ b/src/core2/code_C31A0.c @@ -0,0 +1,58 @@ +#include +#include "functions.h" +#include "variables.h" + +#define CORE2_C31A0_VEC_COUNT 0x21 + +void func_8034A130(struct5Bs *this){ + f32 (*iPtr)[3]; + for(iPtr = this->unk0; iPtr < this->unk4; iPtr++){ + (*iPtr)[0] = (*iPtr)[1] = (*iPtr)[2] = 0.0f; + } +} + +void func_8034A174(struct5Bs *this, s32 indx,f32 dst[3]){ + dst[0] = this->unk0[indx][0]; + dst[1] = this->unk0[indx][1]; + dst[2] = this->unk0[indx][2]; +} + +void func_8034A1B4(struct5Bs *this, s32 indx, s32 dst[3]){ + dst[0] = (s32)this->unk0[indx][0]; + dst[1] = (s32)this->unk0[indx][1]; + dst[2] = (s32)this->unk0[indx][2]; +} + +void func_8034A214(struct5Bs *this, s32 indx1, s32 indx2, f32 dst[3]){ + dst[0] = this->unk0[indx2][0] - this->unk0[indx1][0]; + dst[1] = this->unk0[indx2][1] - this->unk0[indx1][1]; + dst[2] = this->unk0[indx2][2] - this->unk0[indx1][2]; + ml_vec3f_normalize(dst); +} + +void func_8034A2A8(struct5Bs *this){ + free(this); +} + +struct5Bs *func_8034A2C8(void){ + struct5Bs *this = (struct5Bs *)malloc(sizeof(struct5Bs) + sizeof(f32[3])*CORE2_C31A0_VEC_COUNT); + this->unk0 = (f32(*)[3])((s32)this + sizeof(struct5Bs)); + this->unk4 = (f32(*)[3])((s32)this->unk0 + sizeof(f32[3])*CORE2_C31A0_VEC_COUNT); + func_8034A130(this); + return this; +} + +void func_8034A308(struct5Bs *this, s32 indx, f32 arg2[3]){ + this->unk0[indx][0] = arg2[0]; + this->unk0[indx][1] = arg2[1]; + this->unk0[indx][2] = arg2[2]; +} + +struct5Bs *func_8034A348(struct5Bs *this){ + if(this){ + this = (struct5Bs *)defrag(this); + this->unk0 = (f32(*)[3])(((s32)this + sizeof(struct5Bs))); + this->unk4 = (f32(*)[3])((s32)this->unk0 + sizeof(f32[3])*CORE2_C31A0_VEC_COUNT); + } + return this; +} diff --git a/src/core2/code_C3A40.c b/src/core2/code_C3A40.c new file mode 100644 index 00000000..ca0b7cb2 --- /dev/null +++ b/src/core2/code_C3A40.c @@ -0,0 +1,31 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .rodata */ +extern f32 D_80379170; + +/* .code */ +f32 func_8034A9D0(f32 arg0[4], f32 arg1) { + if (arg0[1] <= arg1) { + return 0.0f; + } + if (arg0[0] <= arg1) { + return (arg0[1] - arg1) / (arg0[1] - arg0[0]); + } + if (arg0[3] <= arg1) { + return 1.0f; + } + if (arg0[2] <= arg1) { + return (arg1 - arg0[2]) / (arg0[3] - arg0[2]); + } + return 0.0f; +} + + +void func_8034AA70(f32 arg0[4]){ + arg0[1] = D_80379170; + arg0[0] = 4000.0f; + arg0[3] = 2000.0f; + arg0[2] = -500.0f; +} diff --git a/src/core2/code_C3B20.c b/src/core2/code_C3B20.c new file mode 100644 index 00000000..1a6803fa --- /dev/null +++ b/src/core2/code_C3B20.c @@ -0,0 +1,264 @@ +#include +#include "functions.h" +#include "variables.h" + +#define CORE2_C3B20_DEFAULT_SIZE 0x20 + + + +void func_8034AE08(Struct61s *arg0, void *arg1, s32 arg2); + +/* .code */ +void func_8034AAB0(Struct61s * arg0){ + if(arg0->unk14 == 2){ + assetcache_release(arg0->unk0); + } + free(arg0); +} + +Struct61s *func_8034AAF4(enum asset_e asset_id) { + Struct61s * this; + + this = (Struct61s *) malloc(sizeof(Struct61s)); + if (this == NULL) { + return NULL; + } + this->unk14 = 2; + this->unk7C = -1; + this->unk80 = -1; + this->unk0 = assetcache_get(asset_id); + this->unk4 = this->unk0; + if (this->unk4 != NULL) { + return this; + } + free(this); + return NULL; +} + +//open map file stream +Struct61s *func_8034AB6C(enum map_e map_id){ + return func_8034AAF4(map_id + 0x71C); +} + +Struct61s *func_8034AB8C(s32 indx, enum asset_e base_indx){ + indx += base_indx; + return func_8034AAF4(indx); +} + +Struct61s *func_8034ABAC(void *ptr, s32 size){ + Struct61s * this; + this = (Struct61s *) malloc(sizeof(Struct61s)); + this->unk14 = 3; + this->unk7C = -1; + this->unk80 = -1; + this->unk8 = ptr; + this->unkC = this->unk8; + this->unk10 = (u32)this->unk8 + size; + return this; +} + + +Struct61s *func_8034AC04(void){ + Struct61s *this; + this = (Struct61s *) malloc(sizeof(Struct61s)); + this->unk14 = 4; + this->unk7C = -1; + this->unk80 = -1; + this->unk8 = malloc(CORE2_C3B20_DEFAULT_SIZE); + this->unkC = this->unk8; + this->unk10 = (u32)this->unk8 + CORE2_C3B20_DEFAULT_SIZE; + return this; +} + +void func_8034AC5C(Struct61s *arg0, void **arg1, s32 *size){ + *size = ((u32)arg0->unkC - (u32)arg0->unk8); + *arg1 = realloc(arg0->unk8, *size); + arg0->unk8 = NULL; + func_8034AAB0(arg0); +} + +void func_8034ACAC(Struct61s *arg0, u8 *arg1){ + func_8034AE08(arg0, arg1, 1); +} + +void func_8034ACCC(Struct61s *arg0, u8 *arg1, s32 cnt){ + while(cnt > 0){ + func_8034ACAC(arg0, arg1); + cnt--; + arg1++; + } +} + +void func_8034AD20(Struct61s *arg0, f32 *arg1){ + func_8034AE08(arg0, arg1, 4); +} + +void func_8034AD40(Struct61s *arg0, f32 *arg1, s32 cnt){ + while(cnt > 0){ + func_8034AD20(arg0, arg1); + cnt--; + arg1++; + } +} + +void func_8034AD94(Struct61s *arg0, s32 *arg1){ + func_8034AE08(arg0, arg1, 4); +} + +void func_8034ADB4(Struct61s *arg0, s32 *arg1, s32 cnt){ + while(cnt > 0){ + func_8034AD94(arg0, arg1); + cnt--; + arg1++; + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C3B20/func_8034AE08.s") +#else +void func_8034AE08(Struct61s *arg0, void *arg1, s32 arg2) { + u32 capacity; + u32 curr_offset; + u32 end_ptr; + + if (arg0->unk14 == 2) { //read asset + memcpy(arg1, arg0->unk4, arg2); + arg0->unk4 = (void *) ((u32)arg0->unk4 + arg2); + } + else if (arg0->unk14 == 3) { //read bin??? + memcpy(arg1, arg0->unkC, arg2); + arg0->unkC = (void *) ((u32)arg0->unkC + arg2); + } + else if (arg0->unk14 == 4) { // write bin??? + if ((u32)arg0->unk10 < (u32)arg0->unkC + arg2) { + curr_offset = (u32)arg0->unkC - (u32)arg0->unk8; + capacity = ((u32)arg0->unk10 - (u32)arg0->unk8); + capacity *= 2; + while (((u32)arg0->unk8 + capacity) < (u32)arg0->unkC + arg2) { + capacity *= 2; + } + arg0->unk8 = realloc(arg0->unk8, capacity); + arg0->unkC = (u32)arg0->unk8 + curr_offset; + arg0->unk10 = (u32)arg0->unk8 + capacity; + } + memcpy(arg0->unkC, arg1, arg2); + arg0->unkC = (u32)arg0->unkC + arg2; + } +} +#endif + +void func_8034AF24(Struct61s *arg0, s16 *arg1){ + func_8034AE08(arg0, arg1, sizeof(s16)); +} + +void func_8034AF44(Struct61s *arg0, s16 *arg1, s32 cnt){ + while(cnt > 0){ + func_8034AF24(arg0, arg1); + cnt--; + arg1++; + } +} + +bool func_8034AF98(Struct61s *arg0, s32 arg1) { + u8 sp1F; + + sp1F = arg1; + if ((arg0->unk14 == 1) || (arg0->unk14 == 4)) { + func_8034ACAC(arg0, &sp1F); + return 1; + } + if (arg0->unk7C == -1) { + func_8034ACAC(arg0, &sp1F); + if (arg1 == sp1F) { + return 1; + } + arg0->unk7C = sp1F; + return 0; + } + if (arg1 == arg0->unk7C) { + arg0->unk7C = -1; + return 1; + } + return 0; +} + +bool func_8034B040(Struct61s * arg0, s32 arg1, u8 *arg2){ + if(!func_8034AF98(arg0, arg1)){ + return FALSE; + } else{ + func_8034ACAC(arg0, arg2); + return TRUE; + } +} + +bool func_8034B080(Struct61s * arg0, s32 arg1, u8 *arg2, s32 arg3){ + if(!func_8034AF98(arg0, arg1)){ + return FALSE; + } else{ + func_8034ACCC(arg0, arg2, arg3); + return TRUE; + } +} + +bool func_8034B0C8(Struct61s * arg0, s32 arg1, f32 *arg2){ + if(!func_8034AF98(arg0, arg1)){ + return FALSE; + } else{ + func_8034AD20(arg0, arg2); + return TRUE; + } +} + +bool func_8034B108(Struct61s * arg0, s32 arg1, f32 *arg2, s32 arg3){ + if(!func_8034AF98(arg0, arg1)){ + return FALSE; + } else{ + func_8034AD40(arg0, arg2, arg3); + return TRUE; + } +} + +bool func_8034B150(Struct61s * arg0, s32 arg1, s32 *arg2){ + if(!func_8034AF98(arg0, arg1)){ + return FALSE; + } else{ + func_8034AD94(arg0, arg2); + return TRUE; + } +} + +bool func_8034B190(Struct61s * arg0, s32 arg1, s32 *arg2, s32 arg3){ + if(!func_8034AF98(arg0, arg1)){ + return FALSE; + } else{ + func_8034ADB4(arg0, arg2, arg3); + return TRUE; + } +} + +bool func_8034B1D8(Struct61s * arg0, s32 arg1, void *arg2, s32 arg3){ + if(!func_8034AF98(arg0, arg1)){ + return FALSE; + } else{ + func_8034AE08(arg0, arg2, arg3); + return TRUE; + } +} + +bool func_8034B220(Struct61s * arg0, s32 arg1, s16 *arg2){ + if(!func_8034AF98(arg0, arg1)){ + return FALSE; + } else{ + func_8034AF24(arg0, arg2); + return TRUE; + } +} + +bool func_8034B260(Struct61s * arg0, s32 arg1, s16 *arg2, s32 arg3){ + if(!func_8034AF98(arg0, arg1)){ + return FALSE; + } else{ + func_8034AF44(arg0, arg2, arg3); + return TRUE; + } +} diff --git a/src/core2/code_C3F0.c b/src/core2/code_C3F0.c new file mode 100644 index 00000000..04022ee9 --- /dev/null +++ b/src/core2/code_C3F0.c @@ -0,0 +1,41 @@ +#include +#include "functions.h" +#include "variables.h" + +void miscflag_clear(enum misc_flag_e arg0); + +/*.bss */ +u8 D_8037C1D0[0x1C]; + +/* code */ +void miscflag_clearAll(void){ + int i; + for(i = 1; i < 0x1C; i++){ + miscflag_clear(i); + } +} + +int miscflag_isTrue(s32 arg0){ + return D_8037C1D0[arg0]; +} + +int miscflag_isFalse(s32 arg0){ + return !D_8037C1D0[arg0]; +} + +void miscflag_set(enum misc_flag_e arg0){ + D_8037C1D0[arg0] = TRUE; +} + +void miscflag_clear(enum misc_flag_e arg0){ + D_8037C1D0[arg0] = FALSE; +} + +void miscflag_toggle(enum misc_flag_e arg0){ + if(D_8037C1D0[arg0]){ + D_8037C1D0[arg0] = FALSE; + } + else { + D_8037C1D0[arg0] = TRUE; + } +} diff --git a/src/core2/code_C4320.c b/src/core2/code_C4320.c new file mode 100644 index 00000000..15e45ce2 --- /dev/null +++ b/src/core2/code_C4320.c @@ -0,0 +1,365 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802E40A8(enum map_e, s32 exit); + +typedef struct { + u8 unk0; + u8 unk1; + u8 unk2; + u8 unk3; + u8 unk4; + u8 unk5; +}Struct_core2_C4320_0; + +s32 func_8034BAFC(void); + +/* .data*/ +//EAF70: +extern Struct_core2_C4320_0 D_80371F00[] ={ + {MAP_2_MM_MUMBOS_MOUNTAIN, 4, 0x5B, 1, 2, 2}, + {MAP_22_CC_INSIDE_CLANKER, 7, 0x5B, 1, 2, 2}, + {MAP_D_BGS_BUBBLEGLOOP_SWAMP, 4, 0x5B, 1, 3, 3}, + {MAP_1C_MMM_CHURCH, 7, 0x5B, 1, 2, 2}, + {MAP_1F_CS_START_RAREWARE, 1, 0x00, 1, 2, 2}, + {MAP_6_TTC_NIPPERS_SHELL, 4, 0x5B, 1, 2, 2}, + {MAP_46_CCW_WINTER, 7, 0x5B, 1, 2, 2}, + {MAP_34_RBB_ENGINE_ROOM, 4, 0x5B, 1, 2, 2}, + {MAP_12_GV_GOBIS_VALLEY, 7, 0x5B, 1, 2, 2}, + {MAP_1F_CS_START_RAREWARE, 1, 0x00, 1, 2, 2}, + {MAP_91_FILE_SELECT, 0, 0x00, 1, 2, 2} +}; + +extern Struct_core2_C4320_0 D_80371F44[] = { + {MAP_8C_SM_BANJOS_HOUSE, 0, 0x5C, 0xA, 3, 3,}, + {MAP_41_FP_BOGGYS_IGLOO, 0, 0x5C, 0xA, 3, 3,}, + {MAP_3F_RBB_CAPTAINS_CABIN, 0, 0x5C, 0xA, 3, 3,}, + {MAP_5E_CCW_SPRING_NABNUTS_HOUSE, 0, 0x5C, 0xA, 3, 3,}, + {MAP_11_BGS_TIPTUP, 0, 0x5C, 0xA, 3, 3,}, + {MAP_2D_MMM_BEDROOM, 0, 0x5C, 0xA, 3, 3,}, + {MAP_5C_CCW_AUTUMN_ZUBBA_HIVE, 0, 0x5C, 0xA, 3, 3,} +}; + +extern Struct_core2_C4320_0 D_80371F70 = {MAP_41_FP_BOGGYS_IGLOO, 6, 0x5D, 7, 8, 3}; + +extern Struct_core2_C4320_0 D_80371F78[] ={ + {MAP_7_TTC_TREASURE_TROVE_COVE, 0, 0x5F, 6, 9, 9}, + {MAP_27_FP_FREEZEEZY_PEAK, 0, 0x5F, 9, 9, 9}, + {MAP_12_GV_GOBIS_VALLEY, 0, 0x5F, 9, 5, 9} +}; + +extern s32 D_80371F8C = 0xA; //attract demo count +extern s32 D_80371F90 = 0x7; //bottles bonus demo count +extern s32 D_80371F94 = 1; +extern s32 D_80371F98 = 3; +extern s32 D_80371F9C = 1; +extern u16 D_80371FA0[] = { 3, 4, 5, 6, 7, 8, 9, 0xA, 0xB, 0xC }; +//EB030: + +/* .bss */ +extern s32 D_80386110; //current attract demo index +extern Struct_core2_C4320_0 *D_80386114; //current attract demo ptr +extern s32 D_80386118; +extern s32 D_8038611C; +extern bool D_80386120; +extern s32 D_80386124; +extern f32 D_80386128; + +/* .code */ +void func_8034B2B0(s32 arg0) { + Struct_core2_C4320_0 *sp18; + + sp18 = &D_80371F00[arg0]; + func_802E40A8(sp18->unk0, sp18->unk2); + if ((map_getLevel(sp18->unk0) == LEVEL_D_CUTSCENE) || (arg0 == D_80371F8C)) { + func_802E40C4(1); + } else { + func_802E40C4(6); + } + func_802E40E8(1); +} + +void func_8034B33C(s32 arg0) { + Struct_core2_C4320_0 *sp18; + + sp18 = &D_80371F44[arg0]; + func_802E40A8(sp18->unk0, sp18->unk2); + func_802E412C(1, 0xB); + func_802E40C4(7); + D_80386114 = sp18; + D_80386124 = func_802C5A30(); +} + +void func_8034B3A4(enum map_e map_id, s32 exit_id) { + func_802E40A8(map_id, exit_id); + func_802E412C(1, 8); + func_802E40C4(8); + D_80386114 = &D_80371F70; + D_80386124 = func_802C5A30(); +} + + +void func_8034B3F0(s32 arg0) { + Struct_core2_C4320_0 *temp_s0; + + temp_s0 = &D_80371F78[arg0]; + func_802E40A8(temp_s0->unk0, temp_s0->unk2); + if (temp_s0 == &D_80371F78[0]) { + func_802E412C(1, 5); + } else { + func_802E40E8(0); + } + func_802E40C4(0xC); + D_80386114 = temp_s0; + D_80386124 = func_802C5A30(); +} + + +void func_8034B474(void) { + D_80386114 = &D_80371F00[D_80386110]; + D_80386110 = (D_80386110 + 1) % D_80371F8C; +} + +void func_8034B4E4(s32 arg0){ + D_80386128 = 0; + if(getGameMode() == GAME_MODE_8_BOTTLES_BONUS || getGameMode() == GAME_MODE_A_SNS_PICTURE){ + return; + } + + switch(arg0){ + case 1: //L8034B544 + case 3: //L8034B544 + case 4: //L8034B544 + func_802DC9A4(0,0); + /* fall-through */ + case 2: //L8034B550 + case 7: //L8034B550 + func_802DCAD4(0,0); + break; + + case 5: //L8034B564 + func_802DC9A4(0,0); + break; + } +} + +void func_8034B580(s32 arg0) { + f32 sp1C; + + sp1C = D_80386128; + if (gctransition_8030BD98() != 0) { + D_80386128 += time_getDelta(); + } + if ((getGameMode() != GAME_MODE_8_BOTTLES_BONUS) && (getGameMode() != GAME_MODE_A_SNS_PICTURE)) { + switch (arg0) { + case 4: + if ((D_80386128 >= 2.5) && (sp1C < 2.5) && (D_80371F9C == 0)) { + func_802DCB0C(0, 0); + } + /* fallthrough */ + case 3: + if ((D_80386128 >= 2.5) && (sp1C < 2.5) && (D_80371F9C == 0)) { + func_802DC9DC(0, 0); + } + if ((D_80386128 >= 4.0) && (sp1C < 4.0) && (func_8024F12C() == 0)) { + func_802DCD78(0, 0); + if (D_80371F9C != 0) { + func_802DCDB0(); + return; + } + } + break; + case 7: + if ((D_80386128 >= 2.5) && (sp1C < 2.5)) { + func_802DCB0C(0, 0); + } + if ((D_80386128 >= 4.0) && (sp1C < 4.0) && (func_8024F12C() == 0)) { + func_802DCD78(0, 0); + } + break; + } + } +} + +void func_8034B7F0(s32 arg0) { + func_802DC9DC(0, 0); + func_802DCB0C(0, 0); + func_802DCDC0(0, 0); + D_80371F9C = 0; +} + +void func_8034B834(void) { + s32 i; + + item_set(ITEM_D_EGGS, 100); + item_set(ITEM_F_RED_FEATHER, 50); + item_set(ITEM_10_GOLD_FEATHER, 10); + item_set(ITEM_1C_MUMBO_TOKEN, 25); + func_80295864(-1); + func_80295870(-1); + for(i = 0; i < 10; i++){ + func_80320004(D_80371FA0[i], 1); + } +} + +void func_8034B8C0(enum map_e map_id, s32 demo_id) { + demo_load(map_id,demo_id); + D_80386118 = D_8038611C = 0; + if (D_80386114->unk1 == 6) { + func_803204E4(0x1F, 1); + func_802E4A70(); + } + if ((demo_id == 0x5B) || (demo_id == 0x5F)) { + func_8025BC04(); + } +} + +void func_8034B940(void){ + demo_free(); + func_8025BCEC(); +} + +void func_8034B968(void){ + func_8034B2B0(D_80386110); + func_8034B474(); +} + +void func_8034B994(void){ + func_8034B2B0(D_80371F8C); + D_80386110 = 0; +} + +void func_8034B9BC(s32 arg0) { + func_80347A7C(); + func_8034B33C(arg0); +} + +void func_8034B9E4(void){ + func_803219F4(5); + func_8034B3F0(D_80386110); + D_80386110++; +} + +void func_8034BA20(void) { + func_803219F4(5); + func_802E412C(1, 5); + func_802E40A8(MAP_97_CS_END_BEACH_2, 0); + func_802E40C4(1); + if (func_8025AD7C(5)) { + func_8025A7DC(5); + } + D_80386110 = 0; +} + +void func_8034BA7C(enum map_e map_id, s32 exit_id){ + func_8034B3A4(map_id, exit_id); +} + +void func_8034BA9C(void) { + if (func_8034BAFC() != -1) { + func_802C5A3C(func_8034BAFC()); + func_8033D13C(func_8034BAFC()); + func_80347AA8(); + } + func_8031B010(); + D_80386110 = 0; +} + +s32 func_8034BAFC(void){ + return D_80386124; +} + +void func_8034BB08(bool arg0) { + D_80386120 = arg0; + func_802E412C(1, 3); + func_802E40A8(MAP_8C_SM_BANJOS_HOUSE, 2); + func_802E40C4(1); +} + +bool func_8034BB48(void) { + if (D_80386120 && gctransition_8030BD98()) { + D_80386120 = FALSE; + return TRUE; + } + return FALSE; +} + +void func_8034BB90(void) { + s32 sp1C; + s32 sp18; + + sp1C = gctransition_8030BDC0(); + sp18 = gctransition_8030BD98(); + if (!D_80386118) { + func_8034B834(); + func_8034B4E4(D_80386114->unk1); + D_80386118 = 1; + } + func_8034B580(D_80386114->unk1); + if (func_803203FC(0xC3)) { + func_803204E4(0xC3, 0); + func_8034B9E4(); + } + if( !sp1C + && sp18 + && !D_8038611C + && (getGameMode() != GAME_MODE_8_BOTTLES_BONUS) + && ((func_803203FC(0x64) && (getGameMode() != GAME_MODE_A_SNS_PICTURE)) + || func_803203FC(0x63)) + ) { + func_8034B7F0(D_80386114->unk1); + if (getGameMode() == GAME_MODE_9_BANJO_AND_KAZOOIE) { + func_8034BA9C(); + } else if (getGameMode() == GAME_MODE_A_SNS_PICTURE) { + if (D_80386110 == D_80371F98) { + func_8034BA20(); + } else { + func_802DF0C8(); + } + } else if (func_803203FC(0x64)) { + func_802E412C(1, D_80386114->unk5); + func_8034B994(); + } else { + func_802E412C(1, D_80386114->unk4); + func_8034B2B0(D_80386110); + func_8034B474(); + } + if (getGameMode() != GAME_MODE_A_SNS_PICTURE) { + func_8025A58C(0, 800); + func_8025AB00(); + } + func_803204E4(0x64, 0); + func_803204E4(0x63, 0); + D_8038611C = 1; + } +} + +s32 func_8034BDA4(enum map_e map_id, s32 exit_id) { + s32 phi_v0; + + if (func_803203FC(0x1F)) { + return D_80371F70.unk3; + } + + + for(phi_v0 = 0; phi_v0 < D_80371F8C; phi_v0++){ + if( map_id == D_80371F00[phi_v0].unk0 && exit_id == D_80371F00[phi_v0].unk2){ + return D_80371F00[phi_v0].unk3; + } + } + + for(phi_v0 = 0; phi_v0 < D_80371F90; phi_v0++){ + if( map_id == D_80371F44[phi_v0].unk0 && exit_id == D_80371F44[phi_v0].unk2){ + return D_80371F44[phi_v0].unk3; + } + } + + for(phi_v0 = 0; phi_v0 < D_80371F98; phi_v0++){ + if( map_id == D_80371F78[phi_v0].unk0 && exit_id == D_80371F78[phi_v0].unk2){ + return D_80371F78[phi_v0].unk3; + } + } + + return 4; +} diff --git a/src/core2/code_C4B0.c b/src/core2/code_C4B0.c new file mode 100644 index 00000000..d99a792f --- /dev/null +++ b/src/core2/code_C4B0.c @@ -0,0 +1,401 @@ +#include +#include "functions.h" +#include "variables.h" + +extern int func_80258424(f32 vec[3], f32 minX, f32 minY, f32 minZ, f32 maxX, f32 maxY, f32 maxZ); +extern f32 func_8031C5D4(struct0*); +extern void func_8031C5AC(struct0 *, f32 *); +extern f32 func_8031C5E4(struct0*); +extern void func_8031C5FC(struct0 *, f32); +extern f32 func_80255D70(f32 arg0); +extern s32 func_8029463C(void); + +void func_80294378(s32 arg0); +void func_80294384(s32 arg0); +void func_80294390(void); + +typedef struct { + f32 unk0[3]; + f32 unkC[3]; + u8 pad18[0x78]; +}Struct_core2_C4B0_0; + +/* .rodata */ +extern f64 D_80374760; +extern f64 D_80374768; + +/* .bss */ +f32 D_8037C1F0[2]; +f32 D_8037C1F8[2]; +struct0 * D_8037C200; +Struct60s * D_8037C204; +Struct60s D_8037C208; +f32 D_8037C218[3]; +f32 D_8037C228[3]; +f32 D_8037C238[3]; +f32 D_8037C248[3]; +f32 D_8037C258[3]; +f32 D_8037C268[3]; +s32 D_8037C274; +u8 D_8037C278; +u8 D_8037C279; +u8 D_8037C27A; +u8 D_8037C27B; +u8 D_8037C27C; +u8 D_8037C27D; +u8 D_8037C27E; +u8 D_8037C27F; +u8 D_8037C280; +s32 D_8037C284; + +/* .code */ +void func_80293440(void){ + f32 sp34[3]; + f32 bottomY = climbGetBottomY(); + f32 topY = climbGetTopY(); + f32 sp28; + f32 diff; + + if(topY < D_8037C218[1]){ + D_8037C218[1] = topY; + } + if(D_8037C218[1] < bottomY) + D_8037C218[1] = bottomY; + + climbGetBottom(sp34); + func_80257F18(D_8037C218, sp34, &sp28); + diff = mlDiffDegF(sp28, yaw_get()); + diff = mlAbsF(diff); + if(1.0f < diff){ + yaw_setIdeal(sp28); + yaw_applyIdeal(); + } +} + +void func_8029350C(f32 *arg0) { + f32 sp3C[3]; + f32 sp38; + u8 temp_v0; + + func_8031C618(D_8037C200, arg0); + func_8031C638(D_8037C200, func_8028D694()); + func_8031C44C(D_8037C200); + sp38 = func_8031C5D4(D_8037C200); + func_8031C5AC(D_8037C200, sp3C); + temp_v0 = D_8037C279; + D_8037C279 = FALSE; + if (!(sp3C[1] < D_80374760)) { + if (arg0[1] <= sp38) { + arg0[1] = sp38; + D_8037C279 = TRUE; + } + else if ((temp_v0 != 0) && (D_8037C238[1] < 0.0f)) { + if (sp3C[1] < D_80374768) { + if (arg0[1] < (sp38 + 30.0f)) { + arg0[1] = sp38; + D_8037C279 = TRUE; + } + } else if (arg0[1] < (sp38 + 5.0f)) { + arg0[1] = sp38; + D_8037C279 = TRUE; + } + } + } +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C4B0/func_80293668.s") + + +void func_80293D2C(f32 *arg0, f32 * arg1){ + *arg0 = D_8037C1F8[0]; + *arg1 = D_8037C1F8[1]; +} + +void func_80293D48(f32 arg0, f32 arg1){ + D_8037C1F0[0] = arg0; + D_8037C1F0[1] = arg1; + D_8037C1F8[0] = D_8037C1F0[0]; + D_8037C1F8[1] = D_8037C1F0[1]; +} + +void func_80293D74(void){ func_80293D48(80.0f, 35.0f);} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C4B0/func_80293DA4.s") +#else +void func_80293DA4(void){ + D_8037C278 = 0; + D_8037C279 = 0; + D_8037C27B = 0; + D_8037C27C = 0; + D_8037C27E = 0; + D_8037C280 = 0; + D_8037C200 = func_8031B9D8(); + ml_vec3f_clear(&D_8037C268); + ml_vec3f_clear(&D_8037C218); + ml_vec3f_clear(&D_8037C228); + ml_vec3f_clear(&D_8037C258); + D_8037C204 = 0; + D_8037C27F = 0; + func_80293D74(); + + D_8037C1F8[0] = D_8037C1F0[0]; + D_8037C1F8[1] = D_8037C1F0[1]; + func_80294384(1); + D_8037C274 = 0; + func_80294378(1); +} +#endif + +void func_80293E88(void){ + func_8031BA9C(D_8037C200); +} + +//__clamp to_range_within_point +f32 func_80293EAC(f32 arg0, f32 arg1, f32 arg2){ + if(arg1 < arg0){ + arg1 = min_f(arg0, arg1+arg2); + } + else if(arg0 < arg1){ + arg1 = max_f(arg0, arg1-arg2); + } + return arg1; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C4B0/func_80293F0C.s") +#else +void func_80293F0C(void){ + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + + _player_getPosition(sp44); + if(map_get() == MAP_34_RBB_ENGINE_ROOM && func_80258424(sp44, -900.0f, -940.0f, 200.0f, 900.0f, 940.0f, 800.0f)){ + func_8031C5FC(D_8037C200, 150.0f); + } else{ + func_8031C608(D_8037C200); + } + D_8037C27C = 0; + D_8037C27A = 1; + D_8037C27D = 0; + D_8037C204 = NULL; + D_8037C27B = D_8037C279; + D_8037C27E = 0; + D_8037C1F8[0] = func_80293EAC(D_8037C1F0[0], D_8037C1F8[0], 1.0f); + D_8037C1F8[1] = func_80293EAC(D_8037C1F0[1], D_8037C1F8[1], 1.0f); + + switch(D_8037C274){//D_80374788 + case 1: + case 3: + case 4: + _player_getPosition(D_8037C218); + func_80298504(D_8037C228); + ml_vec3f_diff_copy(D_8037C238, D_8037C218, D_8037C228); + if ((D_8037C274 == 3) && func_8031C594(D_8037C200) && ((func_8031C5E4(D_8037C200) - 70.0f) < D_8037C218[1])) { + D_8037C218[1] = func_8031C5E4(D_8037C200) - 70.0f; + D_8037C27E = 1; + player_setYVelocity(1.0f); + } + func_80293668(); + player_setPosition(&D_8037C218); + break; + + case 5: + _player_getPosition(D_8037C218); + func_80298504(D_8037C228); + func_80293668(); + func_80293440(); + player_setPosition(D_8037C218); + break; + + case 2: + break; + }//L80294148 + if (func_8031C594(D_8037C200)) { + D_8037C278 = (D_8037C218[1] < func_8031C5E4(D_8037C200)); + } + ml_vec3f_diff_copy(D_8037C248, D_8037C218, D_8037C228); + ml_vec3f_diff(D_8037C248, D_8037C238); + if (func_80294560()) { + D_8037C279 = 1; + } + + if(D_8037C278 && D_8037C218[1] < (func_8031C5E4(D_8037C200) - 70.0f)){ + func_80294384(3); + if(D_8037C279 && func_80297AAC() < 0.0f) { + player_setYVelocity(-1.0f); + } + } + else if(D_8037C279){ + func_80294390(); + if (func_80297AAC() < 0.0f) { + player_setYVelocity(-1.0f); + } + } else { + func_80294384(1); + } + + if (D_8037C27F) { + player_setPosition(sp44); + } + + D_8037C27A = 0; + + if (D_8037C27C) { + D_8037C280 = func_80258948(D_8037C280 + 1, 3); + } else { + D_8037C280 = 0; + } + func_80298504(sp2C); + _player_getPosition(sp38); + ml_vec3f_diff_copy(D_8037C268, sp38, sp2C); + // temp_a1 = D_8037C204; + if (D_8037C204) { + func_8024587C(&D_8037C208, D_8037C204); + D_8037C204 = &D_8037C208; + } +} +#endif + +void func_8029436C(s32 arg0){ + D_8037C27F = arg0; +} + +void func_80294378(s32 arg0){ + D_8037C274 = arg0; +} + +void func_80294384(s32 arg0){ + D_8037C284 = arg0; +} + +void func_80294390(void) { + void *sp1C; + + sp1C = func_8029463C(); + if (sp1C != 0) { + if (func_803246B4(map_get(), ((s32*)sp1C)[2]) == 3) { + func_80294384(4); + } + else{ + func_80294384(2); + } + }else{ + func_80294384(2); + } +} + +f32 func_80294404(void){ + return player_getYPosition() - func_8031C5D4(D_8037C200); +} + +f32 func_80294438(void){ + return func_8031C5D4(D_8037C200); +} + +void func_8029445C(f32 arg0[3]){ + ml_vec3f_copy(arg0, D_8037C268); +} + +void func_80294480(f32 arg0[3]){ + func_8031C5AC(D_8037C200, arg0); +} + +f32 func_802944A8(void){ + f32 sp1C[3]; + func_80294480(sp1C); + return func_80255D70(sp1C[1]); +} + +void func_802944D0(f32 dst[3]){ + ml_vec3f_copy(dst, D_8037C258); +} + +s32 func_802944F4(void){ + return D_8037C284; +} + +f32 func_80294500(void){ + return func_8031C5E4(D_8037C200); +} + +s32 func_80294524(void){ + return D_8037C27E; +} + +s32 func_80294530(void){ + return D_8037C27D; +} + +s32 func_8029453C(void){ + return D_8037C27A; +} + +s32 func_80294548(void){ + return D_8037C279; +} + +s32 func_80294554(void){ + return D_8037C278; +} + +int func_80294560(void){ + return D_8037C280 == 3; +} + +void func_80294574(void){ + func_8031C594(D_8037C200); +} + +bool func_80294598(void) { + return (D_8037C248[0] != 0.0f) || (D_8037C248[1] != 0.0f) || (D_8037C248[2] != 0.0f); +} + +u32 func_80294610(u32 mask){ + return func_8031C59C(D_8037C200) & mask; +} + +s32 func_8029463C(void){ + return func_8031C5F4(D_8037C200); +} + +u32 func_80294660(void){ + return func_8031C59C(D_8037C200); +} + +void func_80294684(void){ + func_8031C5A4(D_8037C200); +} + +void func_802946A8(void){ + func_8031C5DC(D_8037C200); +} + +void func_802946CC(void){ + func_8031C5EC(D_8037C200); +} + +Struct60s *func_802946F0(void){ + return D_8037C204; +} + +int func_802946FC(s32 arg0, s32 arg1){ + if(arg1 == 0){ + return 0; + } + else{ + func_802E73C8(arg0); + return 1; + } +} + +void func_8029472C(void){ + func_8031BA7C(D_8037C200); +} + +void func_80294750(void){ + if(D_8037C200){ + D_8037C200 = (struct0 *)defrag(D_8037C200); + } +} diff --git a/src/core2/code_C4F40.c b/src/core2/code_C4F40.c new file mode 100644 index 00000000..4a901a40 --- /dev/null +++ b/src/core2/code_C4F40.c @@ -0,0 +1,158 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8034CB64(Struct70s *, s32, BKModel *, s32); +extern void func_8034CD30(Struct70s *, s32, BKModel *, s32); +extern void func_8034CF74(Struct70s *, s32, BKModel *, s32); +extern void func_8034D170(Struct70s *, s32, BKModel *, s32); +extern void func_8034DD74(Struct70s *, s32, BKModel *, s32); +extern void func_8034E6A8(Struct70s *, s32, BKModel *, s32); +extern void func_8034EE2C(Struct70s *, s32, BKModel *, s32); +extern void func_8034F570(Struct70s *, s32, BKModel *, s32); +extern void func_8034CB9C(Struct70s *, BKModel *, s32); +extern void func_8034CF90(Struct70s *, BKModel *, s32); +extern void func_8034CD8C(Struct70s *, BKModel *, s32); +extern void func_8034D048(Struct70s *, BKModel *, s32); +extern void func_8034D194(Struct70s *, BKModel *, s32); +extern void func_8034E26C(Struct70s *, BKModel *, s32); +extern void func_8034E8E4(Struct70s *, BKModel *, s32); +extern void func_8034EF60(Struct70s *, BKModel *, s32); +extern void func_8034F5B0(Struct70s *, BKModel *, s32); +extern void func_8034CB5C(Struct70s *); +extern void func_8034CD28(Struct70s *); +extern void func_8034CF6C(Struct70s *); +extern void func_8034D168(Struct70s *); +extern void func_8034DD48(Struct70s *); +extern void func_8034E6A0(Struct70s *); +extern void func_8034EE24(Struct70s *); +extern void func_8034F568(Struct70s *); + +typedef struct{ + void (*unk0)(Struct70s *, s32, BKModel *, s32); + void (*unk4)(Struct70s *, BKModel *, s32); + void (*unk8)(Struct70s *); //free function +}Struct_core2_C4F40_1; + +/* .data */ +Struct_core2_C4F40_1 D_80371FC0[] = { + {func_8034CF74, func_8034CF90, func_8034CF6C}, + {func_8034CF74, func_8034D048, func_8034CF6C}, + {func_8034D170, func_8034D194, func_8034D168}, + {func_8034DD74, func_8034E26C, func_8034DD48}, + {func_8034E6A8, func_8034E8E4, func_8034E6A0}, + {func_8034CB64, func_8034CB9C, func_8034CB5C}, + {func_8034EE2C, func_8034EF60, func_8034EE24}, + {func_8034CD30, func_8034CD8C, func_8034CD28}, + {func_8034F570, func_8034F5B0, func_8034F568} +}; + +/* .bss */ +extern vector(Struct6Es) *D_80386130; + +/* .code */ +Struct6Es *func_8034BED0(ActorMarker *marker, s32 arg1, s32 arg2, s32 arg3) { + Struct6Es *sp1C; + s32 temp_a2; + + sp1C = (Struct6Es *)vector_pushBackNew(&marker->unk4C); + sp1C->unk0 = arg2; + sp1C->unk4 = marker->unk48; + sp1C->unk8 = arg1; + D_80371FC0[sp1C->unk0].unk0(&sp1C->unkC, arg3, sp1C->unk4, sp1C->unk8); + return sp1C; +} + +void func_8034BF54(ActorMarker *marker) { + Struct6Es *begin_ptr; + Struct6Es *end_ptr; + Struct6Es *i_ptr; + + end_ptr = (Struct6Es *)vector_getEnd(marker->unk4C); + begin_ptr = (Struct6Es *)vector_getBegin(marker->unk4C); + for(i_ptr = begin_ptr; i_ptr < end_ptr; i_ptr++){ + D_80371FC0[i_ptr->unk0].unk8(&i_ptr->unkC); + } + vector_free(marker->unk4C); +} + +void func_8034BFF8(ActorMarker *marker) { + BKMeshList *sp2C; + BKMesh *phi_s1; + s32 phi_s2; + + if (marker->unk48 != NULL) { + marker->unk4C = vector_new(sizeof(Struct6Es), 0); + sp2C = func_8033F2AC(marker->unk48); + phi_s1 = (BKMesh *)(sp2C + 1); + for(phi_s2 = 0; phi_s2 < sp2C->meshCount_0; phi_s2++){ + if ((phi_s1->uid_0 >= 0x65) && (phi_s1->uid_0 < 0xC8)) { + func_8034BED0(marker, phi_s1->uid_0, 2, phi_s1->uid_0 - 0x64); + } else if ((phi_s1->uid_0 >= 0xC8) && (phi_s1->uid_0 < 0x12C)) { + if (func_802E4A08()) { + func_8034BED0(marker, phi_s1->uid_0, 1, phi_s1->uid_0 - 0xC8); + } else { + func_8034BED0(marker, phi_s1->uid_0, 0, phi_s1->uid_0 - 0xC8); + } + } else if ((phi_s1->uid_0 >= 0x12C) && (phi_s1->uid_0 < 0x190)) { + func_8034BED0(marker, phi_s1->uid_0, 4, phi_s1->uid_0 - 0x12C); + } else if ((phi_s1->uid_0 >= 0x190) && (phi_s1->uid_0 < 0x1F4)) { + func_8034BED0(marker, phi_s1->uid_0, 3, phi_s1->uid_0 - 0x190); + } else if ((phi_s1->uid_0 >= 0x1F4) && (phi_s1->uid_0 < 0x258)) { + func_8034BED0(marker, phi_s1->uid_0, 5, phi_s1->uid_0 - 0x1F4); + } else if ((phi_s1->uid_0 >= 0x258) && (phi_s1->uid_0 < 0x2BC)) { + func_8034BED0(marker, phi_s1->uid_0, 3, phi_s1->uid_0 - 0x258); + } else if ((phi_s1->uid_0 >= 0x2BC) && (phi_s1->uid_0 < 0x320)) { + func_8034BED0(marker, phi_s1->uid_0, 6, phi_s1->uid_0 - 0x2BC); + } else if ((phi_s1->uid_0 >= 0x320) && (phi_s1->uid_0 < 0x384)) { + func_8034BED0(marker, phi_s1->uid_0, 7, phi_s1->uid_0 - 0x320); + } else if ((phi_s1->uid_0 >= 0x384) && (phi_s1->uid_0 < 0x3E8)) { + func_8034BED0(marker, phi_s1->uid_0, 8, phi_s1->uid_0 - 0x384); + } + phi_s1 = (BKMesh *)((s32)phi_s1 + phi_s1->vtxCount_2*sizeof(s16) + sizeof(BKMesh)); + } + } +} + +void func_8034C21C(ActorMarker *marker) { + Struct6Es *i_ptr; + Struct6Es *end_ptr; + Struct6Es *begin_ptr; + + end_ptr = (Struct6Es *)vector_getEnd(marker->unk4C); + D_80386130 = marker->unk4C; + begin_ptr = (Struct6Es *)vector_getBegin(marker->unk4C); + for(i_ptr = begin_ptr; i_ptr < end_ptr; i_ptr++){ + D_80371FC0[i_ptr->unk0].unk4(&i_ptr->unkC, i_ptr->unk4, i_ptr->unk8); + } +} + +Struct70s *func_8034C2C4(ActorMarker *marker, s32 arg1) { + Struct6Es *i_ptr; + Struct6Es *end_ptr; + Struct6Es *begin_ptr; + + end_ptr = (Struct6Es *)vector_getEnd(marker->unk4C); + begin_ptr = (Struct6Es *)vector_getBegin(marker->unk4C); + for(i_ptr = begin_ptr; i_ptr < end_ptr; i_ptr++){ + if ((i_ptr->unk0 == 3) && (arg1 == i_ptr->unk8)) { + return &i_ptr->unkC; + } + } + return NULL; +} + +Struct70s *func_8034C344(s32 arg0) { + Struct6Es *i_ptr; + Struct6Es *end_ptr; + Struct6Es *begin_ptr; + + end_ptr = (Struct6Es *)vector_getEnd(D_80386130); + begin_ptr = (Struct6Es *)vector_getBegin(D_80386130); + for(i_ptr = begin_ptr; i_ptr < end_ptr; i_ptr++){ + if ((i_ptr->unk0 == 8) && (arg0 == i_ptr->unk8)) { + return &i_ptr->unkC; + } + } + return NULL; +} diff --git a/src/core2/code_C5440.c b/src/core2/code_C5440.c new file mode 100644 index 00000000..3cf4bbc6 --- /dev/null +++ b/src/core2/code_C5440.c @@ -0,0 +1,184 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8034CF74(void *arg0, s32 arg1, s32 arg2, s32 arg3); +extern void func_8034D170(void *arg0, s32 arg1, s32 arg2, s32 arg3); +extern void func_8034DD74(void *arg0, s32 arg1, s32 arg2, s32 arg3); +extern void func_8034E6A8(void *arg0, s32 arg1, s32 arg2, s32 arg3); +extern void func_8034CB64(void *arg0, s32 arg1, s32 arg2, s32 arg3); +extern void func_8034EE2C(void *arg0, s32 arg1, s32 arg2, s32 arg3); +extern void func_8034CD30(void *arg0, s32 arg1, s32 arg2, s32 arg3); +extern void func_8034F250(void *arg0, s32 arg1, s32 arg2, s32 arg3); +extern void func_8034F570(void *arg0, s32 arg1, s32 arg2, s32 arg3); + +extern void func_8034CF90(void *arg0, s32 arg1, s32 arg2); +extern void func_8034D194(void *arg0, s32 arg1, s32 arg2); +extern void func_8034E26C(void *arg0, s32 arg1, s32 arg2); +extern void func_8034E8E4(void *arg0, s32 arg1, s32 arg2); +extern void func_8034CB9C(void *arg0, s32 arg1, s32 arg2); +extern void func_8034EF60(void *arg0, s32 arg1, s32 arg2); +extern void func_8034CD8C(void *arg0, s32 arg1, s32 arg2); +extern void func_8034F268(void *arg0, s32 arg1, s32 arg2); +extern void func_8034F5B0(void *arg0, s32 arg1, s32 arg2); + +extern void func_8034CF6C(void *arg0); +extern void func_8034D168(void *arg0); +extern void func_8034DD48(void *arg0); +extern void func_8034E6A0(void *arg0); +extern void func_8034CB5C(void *arg0); +extern void func_8034EE24(void *arg0); +extern void func_8034CD28(void *arg0); +extern void func_8034F248(void *arg0); +extern void func_8034F568(void *arg0); + +struct1Es D_80372030[] = { + {func_8034CF74, func_8034CF90, func_8034CF6C}, + {func_8034D170, func_8034D194, func_8034D168}, + {func_8034DD74, func_8034E26C, func_8034DD48}, + {func_8034E6A8, func_8034E8E4, func_8034E6A0}, //water? + {func_8034CB64, func_8034CB9C, func_8034CB5C}, + {func_8034EE2C, func_8034EF60, func_8034EE24}, + {func_8034CD30, func_8034CD8C, func_8034CD28}, + {func_8034F250, func_8034F268, func_8034F248}, + {func_8034F570, func_8034F5B0, func_8034F568}, //lightning? +}; + +extern struct { + u8 unk0; + vector(struct1Ds) *unk4; +} D_80386140; + +void func_8034C9B0(int arg0); + +//.code +func_8034C3D0(BKModel *arg0, s32 arg1, s32 vtx_xform_id, s32 arg3){ + struct1Ds * v0 = vector_pushBackNew(&D_80386140.unk4); + v0->unk6 = vtx_xform_id; + v0->unk0 = arg0; + v0->unk4 = arg1; + D_80372030[v0->unk6].unk0(&v0->pad8[0], arg3, v0->unk0, v0->unk4); +} + +void * func_8034C448(s32 arg0){ + struct1Ds *iPtr; + struct1Ds *endPtr = vector_getEnd(D_80386140.unk4); + + for(iPtr = vector_getBegin(D_80386140.unk4); iPtr < endPtr; iPtr++){ + if(iPtr->unk6 == 8 && iPtr->unk4 == arg0) + return &iPtr->pad8[0]; + } + return NULL; +} + +int func_8034C4CC(void){ + return D_80386140.unk0 ? 1 : 0; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C5440/func_8034C4F0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C5440/func_8034C50C.s") + +Struct6Ds * func_8034C528(s32 arg0){ + struct1Ds *iPtr; + struct1Ds *endPtr = vector_getEnd(D_80386140.unk4); + + for(iPtr = vector_getBegin(D_80386140.unk4); iPtr < endPtr; iPtr++){ + if(iPtr->unk6 == 2 && iPtr->unk4 == arg0) + return &iPtr->pad8[0]; + } + return NULL; +} + +Struct73s *func_8034C5AC(s32 arg0){ + struct1Ds *iPtr; + struct1Ds *endPtr = vector_getEnd(D_80386140.unk4); + + for(iPtr = vector_getBegin(D_80386140.unk4); iPtr < endPtr; iPtr++){ + if(iPtr->unk6 == 3 && iPtr->unk4 == arg0) + return &iPtr->pad8[0]; + } + return NULL; +} + +void * func_8034C630(s32 arg0){ + struct1Ds *iPtr; + struct1Ds *endPtr = vector_getEnd(D_80386140.unk4); + + for(iPtr = vector_getBegin(D_80386140.unk4); iPtr < endPtr; iPtr++){ + if( (iPtr->unk6 == 3) + && func_802E9FEC(func_8033F2AC(iPtr->unk0), iPtr->unk4, arg0) + ){ + return &iPtr->pad8[0]; + } + } + return NULL; +} + +void func_8034C6DC(BKModel *arg0){ + BKMeshList * sp2C = func_8033F2AC(arg0); + s32 i; + BKMesh * s1 = (sp2C + 1); + for(i = 0; i < sp2C->meshCount_0; i++){ + if(s1->uid_0 >= 0x65 && s1->uid_0 < 0xC8){ + func_8034C3D0(arg0, s1->uid_0, 1, s1->uid_0 - 0x64); + } + else if(s1->uid_0 >= 0xc8 && s1->uid_0 < 0x12c){ + func_8034C3D0(arg0, s1->uid_0, 0, s1->uid_0 - 0xc8); + } + else if(s1->uid_0 >= 0x12c && s1->uid_0 < 0x190){ + func_8034C3D0(arg0, s1->uid_0, 3, s1->uid_0 - 0x12c); + } + else if(s1->uid_0 >= 0x190 && s1->uid_0 < 0x1F4){ + func_8034C3D0(arg0, s1->uid_0, 2, s1->uid_0 - 0x190); + } + else if(s1->uid_0 >= 0x1F4 && s1->uid_0 < 0x258){ + func_8034C3D0(arg0, s1->uid_0, 4, s1->uid_0 - 0x1F4); + } + else if(s1->uid_0 >= 0x258 && s1->uid_0 < 0x2bc){ + func_8034C3D0(arg0, s1->uid_0, 2, s1->uid_0 - 0x258); + } + else if(s1->uid_0 >= 0x2bc && s1->uid_0 < 0x320){ + func_8034C3D0(arg0, s1->uid_0, 5, s1->uid_0 - 0x2bc); + } + else if(s1->uid_0 >= 0x320 && s1->uid_0 < 0x384){ + func_8034C3D0(arg0, s1->uid_0, 6, s1->uid_0 - 0x320); + } + else if(s1->uid_0 >= 0x384 && s1->uid_0 < 0x3e8){ + func_8034C3D0(arg0, s1->uid_0, 8, s1->uid_0 - 0x384); + } + else if(s1->uid_0 >= 0x3e8 && s1->uid_0 < 0x44c){ + func_8034C3D0(arg0, s1->uid_0, 7, s1->uid_0 - 0x3e8); + } + s1 = &((s16*)(s1 + 1))[s1->vtxCount_2]; + } +} + +void * func_8034C8D8(void){ + struct1Ds *iPtr; + struct1Ds *endPtr = vector_getEnd(D_80386140.unk4); + + for(iPtr = vector_getBegin(D_80386140.unk4); iPtr < endPtr; iPtr++){ + D_80372030[iPtr->unk6].unk8(&iPtr->pad8[0]); + } + vector_free(D_80386140.unk4); +} + +void func_8034C97C(void){ + D_80386140.unk4 = vector_new(sizeof(struct1Ds), 0x10); + func_8034C9B0(1); +} + +void func_8034C9B0(int arg0){ + D_80386140.unk0 = arg0 ? 1 : 0; +} + +void * func_8034C9D4(void){ + struct1Ds *iPtr; + struct1Ds *endPtr = vector_getEnd(D_80386140.unk4); + + for(iPtr = vector_getBegin(D_80386140.unk4); iPtr < endPtr; iPtr++){ + D_80372030[iPtr->unk6].unk4(&iPtr->pad8[0], iPtr->unk0, iPtr->unk4); + } + +} \ No newline at end of file diff --git a/src/core2/code_C5AF0.c b/src/core2/code_C5AF0.c new file mode 100644 index 00000000..8e834e8c --- /dev/null +++ b/src/core2/code_C5AF0.c @@ -0,0 +1,30 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .code */ +void func_8034CA80(s32 arg0, BKVtxRef *arg1, Vtx *arg2, Struct6Fs *arg3){ + s32 i; + for(i = 0; i < 3; i++){ + arg2->v.cn[i] = arg1->v.v.cn[i]*arg3->unk0; + } +} + +void func_8034CB5C(Struct6Fs *arg0){} + +void func_8034CB64(Struct6Fs *arg0, s32 arg1, BKModel *model, s32 arg3){ + arg0->unk0 = 0.5f; + arg0->unk4 = (arg1 +1)*0.01; +} + +void func_8034CB9C(Struct6Fs *arg0, BKModel *model, s32 mesh_id) { + arg0->unk0 += arg0->unk4 * time_getDelta(); + if (arg0->unk0 >= 1.0f) { + arg0->unk0 = 1.0f; + arg0->unk4 = -arg0->unk4; + } else if (arg0->unk0 < 0.3) { + arg0->unk0 = 0.3f; + arg0->unk4 = -arg0->unk4; + } + func_8033F120(model, mesh_id, func_8034CA80, (s32) arg0); +} diff --git a/src/core2/code_C5CC0.c b/src/core2/code_C5CC0.c new file mode 100644 index 00000000..267810bd --- /dev/null +++ b/src/core2/code_C5CC0.c @@ -0,0 +1,49 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .code */ +void func_8034CC50(s32 arg0, BKVtxRef *arg1, Vtx *arg2, Struct71s *arg3){ + arg2->v.cn[3] = arg1->v.v.cn[3] * arg3->unk4; +} + +void func_8034CD08(Struct71s *arg0, s32 arg1){ + if(arg1 == 2){ + arg0->unkC = 1.0f; + } + arg0->unk0 = arg1; +} + +void func_8034CD28(Struct71s *arg0){} + +void func_8034CD30(Struct71s *arg0, s32 arg1, BKModel *arg2, s32 arg3){ + arg0->unk0 = 0; + arg0->unk4 = 0.5f; + arg0->unk8 = (arg1 + 1)*0.01; + func_8034CD08(arg0, 1); + +} + +void func_8034CD8C(Struct71s *arg0, BKModel *arg1, s32 arg2) { + f32 temp_f14; + + temp_f14 = time_getDelta(); + if (arg0->unk0 == 1) { + arg0->unk4 += arg0->unk8 * temp_f14; + if (arg0->unk4 >= 1.0f) { + arg0->unk4 = 1.0f; + arg0->unk8 = -arg0->unk8; + } + else if (arg0->unk4 < 0.0f) { + arg0->unk4 = 0.0f; + arg0->unk8 = -arg0->unk8; + func_8034CD08(arg0, 2); + return; + } + } + + if ((arg0->unk0 == 2) && func_8025773C(&arg0->unkC, temp_f14)) { + func_8034CD08(arg0, 1); + } + func_8033F120(arg1, arg2, func_8034CC50, (s32) arg0); +} diff --git a/src/core2/code_C5F00.c b/src/core2/code_C5F00.c new file mode 100644 index 00000000..321c1ada --- /dev/null +++ b/src/core2/code_C5F00.c @@ -0,0 +1,32 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8034CE90(s32 arg0, BKVtxRef *arg1, Vtx *arg2, Struct72s *arg3){ + s32 i; + + for(i = 0; i < 3; i++){ + arg2->v.cn[i] = arg1->v.v.cn[i] * arg3->unk0; + } +} + +void func_8034CF6C(Struct72s *arg0){} + +void func_8034CF74(Struct72s *arg0, s32 arg1, BKModel *arg2, s32 arg3){ + arg0->unk0 = 1.0f; +} + +void func_8034CF90(Struct72s *arg0, BKModel *arg1, s32 arg2) { + arg0->unk0 += randf2(-0.04f, 0.04f); + arg0->unk0 = (arg0->unk0 > 1.0f) ? 1.0f : arg0->unk0; + arg0->unk0 = (arg0->unk0 < 0.8) ? 0.8 : arg0->unk0; + func_8033F120(arg1, arg2, func_8034CE90, (s32) arg0); +} + +void func_8034D048(Struct72s *arg0, BKModel *arg1, s32 arg2) { + arg0->unk0 -= 0.04; + arg0->unk0 += (osGetCount() & 0x1F) / 387.5; + arg0->unk0 = (arg0->unk0 > 1.0f) ? 1.0f : arg0->unk0; + arg0->unk0 = (arg0->unk0 < 0.8) ? 0.8 : arg0->unk0; + func_8033F120(arg1, arg2, func_8034CE90, (s32) arg0); +} diff --git a/src/core2/code_C61C0.c b/src/core2/code_C61C0.c new file mode 100644 index 00000000..9cea1f41 --- /dev/null +++ b/src/core2/code_C61C0.c @@ -0,0 +1,32 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + f32 unk0; + s16 unk4; + u8 pad6[2]; + f32 unk8; + f32 unkC; +}Struct_core2_C61C0_0; + +void func_8034D150(s32 mesh_id, BKVtxRef *src, Vtx *dst, Struct_core2_C61C0_0 *arg3){ + dst->v.tc[1] = src->v.v.tc[1] + arg3->unk4; +} + +void func_8034D168(Struct_core2_C61C0_0 * arg0){} + +void func_8034D170(Struct_core2_C61C0_0 *arg0, s32 arg1, BKModel *model, s32 arg3){ + arg0->unk0 = 0.0f; + arg0->unk8 = (f32)arg1; + arg0->unkC = 0.0f; +} + +void func_8034D194(Struct_core2_C61C0_0 *arg0, BKModel *model, s32 mesh_id) { + arg0->unk0 += arg0->unk8 * 64.0f * time_getDelta(); + if ((s32)arg0->unk0 >= 0x4001) { + arg0->unk0 -= 16384.0f; + } + arg0->unk4 = (s16)arg0->unk0; + func_8033F120(model, mesh_id, func_8034D150, (s32) arg0); +} diff --git a/src/core2/code_C62B0.c b/src/core2/code_C62B0.c new file mode 100644 index 00000000..531c6180 --- /dev/null +++ b/src/core2/code_C62B0.c @@ -0,0 +1,384 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_8034E174(Struct6Ds *arg0); +void func_8033F120(BKModel *, s32, void (*)(s32, BKVtxRef*, Vtx*, s32), s32); + +extern f32 D_80379200; +extern f64 D_80379208; +extern f64 D_80379210; +extern f64 D_80379218; +extern f64 D_80379220; +extern f64 D_80379228; + +/* .code */ +void func_8034D240(s32 *mesh_id, BKVtxRef *src, Vtx *dst, Struct6Ds *arg3) { + f32 temp_f0; + + temp_f0 = arg3->unk70 / arg3->unk74; + dst->v.cn[0] = (arg3->unk50[0] + temp_f0 * (arg3->unk60[0] - arg3->unk50[0])) * src->v.v.cn[0]; + dst->v.cn[1] = (arg3->unk50[1] + temp_f0 * (arg3->unk60[1] - arg3->unk50[1])) * src->v.v.cn[1]; + dst->v.cn[2] = (arg3->unk50[2] + temp_f0 * (arg3->unk60[2] - arg3->unk50[2])) * src->v.v.cn[2]; + dst->v.cn[3] = (arg3->unk50[3] + temp_f0 * (arg3->unk60[3] - arg3->unk50[3])) * src->v.v.cn[3]; +} + +void func_8034D554(s32 *mesh_id, BKVtxRef *src, Vtx *dst, Struct6Ds *arg3){ + f32 temp_f0; + f32 sp18[3]; + + temp_f0 = arg3->unk44 / arg3->unk48; + temp_f0 = temp_f0 * temp_f0 * temp_f0 * temp_f0; + func_80255FE4(sp18, arg3->unk2C, arg3->unk38, temp_f0); + dst->v.ob[0] = (s16)(src->v.v.ob[0] + sp18[0]); + dst->v.ob[1] = (s16)(src->v.v.ob[1] + sp18[1]); + dst->v.ob[2] = (s16)(src->v.v.ob[2] + sp18[2]); +} + +void func_8034D634(s32 *mesh_id, BKVtxRef *src, Vtx *dst, Struct6Ds *arg3){ + f32 temp_f0; + f32 sp18[3]; + + temp_f0 = arg3->unk44 / arg3->unk48; + func_80255FE4(sp18, arg3->unk2C, arg3->unk38, temp_f0); + dst->v.ob[0] = (s16)(src->v.v.ob[0] + sp18[0]); + dst->v.ob[1] = (s16)(src->v.v.ob[1] + sp18[1]); + dst->v.ob[2] = (s16)(src->v.v.ob[2] + sp18[2]); +} + +#ifndef NONMATCHING +void func_8034D700(s32 *mesh_id, BKVtxRef *src, Vtx *dst, Struct6Ds *arg3); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C62B0/func_8034D700.s") +#else +void func_8034D700(s32 *mesh_id, BKVtxRef *src, Vtx *dst, Struct6Ds *arg3){ + dst->v.ob[1] = src->v.v.ob[1] + (s32)(arg3->unk4 + ((arg3->unk44 / arg3->unk48) * (arg3->unk8 - arg3->unk4))); +} +#endif + +void func_8034D740(s32 *mesh_id, BKVtxRef *src, Vtx *dst, Struct6Ds *arg3){ + f32 temp_f0; + f32 temp_f12; + f32 temp_f14; + f32 temp_f16; + f32 temp_f2; + + temp_f0 = arg3->unk98 / arg3->unk9C; + dst->v.cn[0] = (arg3->unk78[0] + ((arg3->unk88[0] - arg3->unk78[0]) * temp_f0)); + dst->v.cn[1] = (arg3->unk78[1] + ((arg3->unk88[1] - arg3->unk78[1]) * temp_f0)); + dst->v.cn[2] = (arg3->unk78[2] + ((arg3->unk88[2] - arg3->unk78[2]) * temp_f0)); + dst->v.cn[3] = (((arg3->unk94 - arg3->unk84) * temp_f0) + arg3->unk84); +} + +void func_8034D9C8(s32 *mesh_id, BKVtxRef *src, Vtx *dst, Struct6Ds *arg3) { + f32 temp_f0; + + temp_f0 = arg3->unk98 / arg3->unk9C; + dst->v.cn[3] = (((arg3->unk94 - arg3->unk84) * temp_f0) + arg3->unk84); +} + +void func_8034DA7C(s32 *mesh_id, BKVtxRef *src, Vtx *dst, Struct6Ds *arg3) { + f32 sp24[3]; + f32 sp18[3]; + + sp24[0] = (f32) (arg3->unk14[0] + arg3->unk1A[0]); + sp24[1] = (f32) (arg3->unk14[1] + arg3->unk1A[1]); + sp24[2] = (f32) (arg3->unk14[2] + arg3->unk1A[2]); + sp24[0] /= 2; + sp24[1] /= 2; + sp24[2] /= 2; + + sp18[0] = (f32) src->v.v.ob[0] - sp24[0]; + sp18[1] = (f32) src->v.v.ob[1] - sp24[1]; + sp18[2] = 0.0f; + ml_vec3f_roll_rotate_copy(sp18, sp18, arg3->unk4 + ((arg3->unk44 / arg3->unk48) * (arg3->unk8 - arg3->unk4))); + dst->v.ob[0] = (s16) (s32) (sp24[0] + sp18[0]); + dst->v.ob[1] = (s16) (s32) (sp24[1] + sp18[1]); +} + +void func_8034DBB8(Struct6Ds *arg0){ + if(arg0->unk48 == 0.0f){ + arg0->unk48 = D_80379200; + } + + if(arg0->unkC != NULL){ + arg0->unkC(arg0); + } +} + +void func_8034DC08(Struct6Ds *arg0, f32 arg1[3], f32 arg2[3], f32 arg3, s32 arg4){ + arg0->unk2C[0] = arg1[0]; + arg0->unk2C[1] = arg1[1]; + arg0->unk2C[2] = arg1[2]; + arg0->unk38[0] = arg2[0]; + arg0->unk38[1] = arg2[1]; + arg0->unk38[2] = arg2[2]; + arg0->unk29 = 1; + arg0->unk4C = 0; + arg0->unk48 = arg3; + arg0->unk44 = 0.0f; + arg0->unk4E = (s16) arg4; + func_8034DBB8(arg0); +} + +s32 func_8034DC78(Struct6Ds *arg0){ + return arg0->unk4C; +} + +bool func_8034DC80(Struct6Ds *arg0, f32 arg1[3]) { + return (arg0->unk14[0] <= arg1[0]) && (arg1[0] < arg0->unk1A[0]) + && (arg0->unk14[2] <= arg1[2]) && (arg1[2] < arg0->unk1A[2]); +} + +void func_8034DD48(Struct6Ds *arg0){ + if(arg0->unk0 != 0){ + func_8030DA44(arg0->unk0); + } +} + +void func_8034DD74(Struct6Ds *arg0, s32 arg1, BKModel *model, s32 mesh_id) { + arg0->unk0 = 0; + arg0->unkC = NULL; + arg0->unk10 = NULL; + arg0->unk29 = 0; + arg0->unk28 = 0; + arg0->unk4C = 0; + arg0->unk4E = 0; + arg0->unk70 = 0.0f; + arg0->unk74 = 0.0f; + arg0->unk9C = 0.0f; + arg0->unk98 = 0.0f; + arg0->unk44 = 0.0f; + arg0->unk48 = 0.0f; + func_8033F2B4(model, mesh_id, arg0->unk14, arg0->unk1A); +} + +void func_8034DDF0(Struct6Ds *arg0, f32 arg1[3], f32 arg2[3], f32 arg3, s32 arg4){ + arg0->unk2C[0] = arg1[0]; + arg0->unk2C[1] = arg1[1]; + arg0->unk2C[2] = arg1[2]; + arg0->unk38[0] = arg2[0]; + arg0->unk38[1] = arg2[1]; + arg0->unk38[2] = arg2[2]; + arg0->unk29 = 2; + arg0->unk4C = 0; + arg0->unk48 = arg3; + arg0->unk44 = 0.0f; + arg0->unk4E = arg4; + func_8034DBB8(arg0); +} + +void func_8034DE60(Struct6Ds *arg0, f32 arg1, f32 arg2, f32 arg3,s32 arg4){ + arg0->unk29 = 3; + arg0->unk4 = arg1; + arg0->unk44 = 0.0f; + arg0->unk48 = arg3; + arg0->unk8 = arg2; + arg0->unk4C = 0; + arg0->unk4E = arg4; + func_8034DBB8(arg0); +} + +void func_8034DEB4(Struct6Ds *arg0, f32 arg1){ + func_8034DE60(arg0, arg1, arg1, 0.0f, 1); +} + +void func_8034DEE8(Struct6Ds *arg0, f32 arg1, f32 arg2, f32 arg3,s32 arg4){ + func_8034E174(arg0); + func_8034DE60(arg0, arg1, arg2, arg3, arg4); +} + +void func_8034DF30(Struct6Ds *arg0, f32 arg1[4], f32 arg2[4], f32 arg3) { + arg0->unk50[0] = arg1[0]; + arg0->unk50[1] = arg1[1]; + arg0->unk50[2] = arg1[2]; + arg0->unk50[3] = arg1[3]; + arg0->unk60[0] = arg2[0]; + arg0->unk60[1] = arg2[1]; + arg0->unk60[2] = arg2[2]; + arg0->unk60[3] = arg2[3]; + arg0->unk70 = 0.0f; + arg0->unk28 = 0; + if (arg3 > 0.0f) { + arg0->unk74 = (f32) (f64) arg3; + } + else{ + arg0->unk74 = (f32) D_80379208; + } +} + +void func_8034DFB0(Struct6Ds *arg0, s32 arg1[4], s32 arg2[4], f32 arg3) { + arg0->unk78[0] = (f32) arg1[0]; + arg0->unk78[1] = (f32) arg1[1]; + arg0->unk78[2] = (f32) arg1[2]; + arg0->unk84 = (f32) arg1[3]; + arg0->unk88[0] = (f32) arg2[0]; + arg0->unk88[1] = (f32) arg2[1]; + arg0->unk88[2] = (f32) arg2[2]; + arg0->unk94 = (f32) arg2[3]; + arg0->unk28 = 0; + if (arg3 > 0.0f) { + arg0->unk9C = (f32) (f64) arg3; + } else { + arg0->unk9C = (f32) D_80379210; + } + arg0->unk98 = 0.0f; +} + +void func_8034E088(Struct6Ds *arg0, s32 arg1, s32 arg2, f32 arg3){ + arg0->unk78[0] = arg0->unk78[1] = arg0->unk78[2] = 0.0f; + arg0->unk88[0] = arg0->unk88[1] = arg0->unk88[2] = 0.0f; + arg0->unk29 = 5; + arg0->unk28 = 0; + arg0->unk84 = (f32) arg1; + arg0->unk94 = (f32) arg2; + if (arg3 > 0.0f) { + arg0->unk9C = (f32) (f64) arg3; + } else { + arg0->unk9C = (f32) D_80379218; + } + arg0->unk98 = 0.0f; +} + +void func_8034E0FC(Struct6Ds *arg0, s32 arg1){ + func_8034E088(arg0, arg1, arg1, 0.0f); +} + +void func_8034E120(Struct6Ds *arg0, f32 arg1, f32 arg2, f32 arg3,s32 arg4){ + arg0->unk29 = 4; + arg0->unk4 = arg1; + arg0->unk44 = 0.0f; + arg0->unk48 = arg3; + arg0->unk8 = arg2; + arg0->unk4C = 0; + arg0->unk4E = arg4; + func_8034DBB8(arg0); +} + +void func_8034E174(Struct6Ds *arg0){ + func_8034E1A4(arg0, 0x3ec, 0.7f, 0.9f); +} + +void func_8034E1A4(Struct6Ds *arg0, enum sfx_e sfx_id, f32 arg2, f32 arg3){ + if(arg0->unk0 == 0){ + arg0->unk0 = func_8030D90C(); + } + arg0->unk20 = arg2; + arg0->unk24 = arg3; + sfxsource_setSfxId(arg0->unk0, sfx_id); + func_8030DD14(arg0->unk0, 3); + func_8030DBB4(arg0->unk0, (arg2 +arg3)/2); + sfxsource_setSampleRate(arg0->unk0, 32000); + func_8030E2C4(arg0->unk0); +} + +void func_8034E254(Struct6Ds *arg0, void (*arg1)(Struct6Ds *)){ + arg0->unkC = arg1; +} + +void func_8034E25C(Struct6Ds *arg0, void (*arg1)(void)){ + arg0->unk10 = arg1; +} + +void func_8034E264(Struct6Ds *arg0, s32 arg1){ + arg0->unk4C = arg1; +} + +void func_8034E26C(Struct6Ds *arg0, BKModel *model, s32 mesh_id) { + f32 sp2C; + f32 sp28; + f32 sp24; + s32 sp20; + + sp2C = time_getDelta(); + if (arg0->unk74 > 0.0f) { + arg0->unk70 += sp2C; + if (arg0->unk74 <= arg0->unk70) { + arg0->unk70 = arg0->unk74; + if (arg0->unk28 == 0) { + arg0->unk28 = 2; + } + } + func_8033F120(model, mesh_id, func_8034D240, (s32) arg0); + if (arg0->unk28 != 0) { + arg0->unk28--; + if (arg0->unk28 == 0) { + arg0->unk74 = 0.0f; + } + } + } + + if (arg0->unk9C > 0.0f) { + arg0->unk98 += sp2C; + if (arg0->unk9C <= arg0->unk98) { + arg0->unk98 = arg0->unk9C; + if (arg0->unk28 == 0) { + arg0->unk28 = 2; + } + } + + if (arg0->unk29 == 5) { + func_8033F120(model, mesh_id, func_8034D9C8, (s32) arg0); + } else { + func_8033F120(model, mesh_id, func_8034D740, (s32) arg0); + } + + if (arg0->unk28 != 0) { + arg0->unk28--; + if (arg0->unk28 == 0) { + arg0->unk9C = 0.0f; + } + } + } + if ((arg0->unk29 == 0) || (arg0->unk29 == 5)) { + return; + } + arg0->unk44 += sp2C; + if (arg0->unk48 < arg0->unk44) { + arg0->unk44 = arg0->unk48; + } + + if (arg0->unk0 != 0) { + sp28 = arg0->unk44 / arg0->unk48; + sp24 = func_8030E200(arg0->unk0); + sp20 = func_8030E1C4(arg0->unk0); + + sp24 += (randf2(-1.0f, 1.0f) * sp2C); + sp24 = MAX(arg0->unk20, sp24); + sp24 = MIN(arg0->unk24, sp24); + + sp20 += randi2(-0xF, 0xF); + sp20 = MIN (0x7FFF, sp20); + sp20 = MAX(31000, sp20); + if (D_80379220 <= sp28) { + sp20 = (1.0 - ((sp28 - D_80379220) / D_80379228)) * sp20; + } + func_8030DBB4(arg0->unk0, sp24); + sfxsource_setSampleRate(arg0->unk0, sp20); + } + switch (arg0->unk29) { + case 1: + func_8033F120(model, mesh_id, func_8034D554, (s32) arg0); + break; + case 2: + func_8033F120(model, mesh_id, func_8034D634, (s32) arg0); + break; + case 3: + func_8033F120(model, mesh_id, func_8034D700, (s32) arg0); + break; + case 4: + func_8033F120(model, mesh_id, func_8034DA7C, (s32) arg0); + break; + } + if (arg0->unk48 <= arg0->unk44) { + arg0->unk29 = 0; + arg0->unk4C = arg0->unk4E; + if (arg0->unk10 != NULL) { + arg0->unk10(arg0); + } + if (arg0->unk0 != 0) { + func_8030DA44(arg0->unk0); + arg0->unk0 = 0; + } + } +} diff --git a/src/core2/code_C76D0.c b/src/core2/code_C76D0.c new file mode 100644 index 00000000..5315ed01 --- /dev/null +++ b/src/core2/code_C76D0.c @@ -0,0 +1,122 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .code */ +void func_8034E660(s32 arg0, BKVtxRef *src, Vtx *dst, Struct73s *arg3) { + dst->v.ob[1] = src->v.v.ob[1] + arg3->dy; + dst->v.tc[0] = src->v.v.tc[0] + arg3->d_tc[0]; + dst->v.tc[1] = src->v.v.tc[1] + arg3->d_tc[1]; +} + +s32 func_8034E698(Struct73s *arg0){ + return arg0->dy; +} + +void func_8034E6A0(Struct73s *arg0){} + +void func_8034E6A8(Struct73s *arg0, s32 arg1, BKModel *arg2, s32 arg3) { + arg0->d_tc[0] = 0; + arg0->d_tc[1] = 0; + arg0->unk4 = randf2(0.0f, 1.0f); + arg0->unk8 = arg1; + arg0->unkC = 0; + arg0->unkE = 0; + arg0->dy = 0; + arg0->unk14 = 0.0f; + arg0->unk18 = 0.0f; + arg0->unk1C = 0.0f; +} + +void func_8034E71C(Struct73s *arg0, s32 arg1, f32 arg2) { + s32 pad1C; + BKModel *sp18; + + arg0->unkE = arg1; + arg0->unk1C = arg2; + arg0->unk14 = 0.0f; + arg0->unkC = arg0->dy; + if (arg2 == 0.0f) { + arg0->dy = arg1; + sp18 = func_8034C4F0(arg0); + func_8033F120(sp18, func_8034C50C(arg0), func_8034E660, (s32) arg0); + } +} + +void func_8034E78C(Struct73s *arg0, s32 arg1, f32 arg2){ + func_8034E7B8(arg0, arg1, arg2, 1, arg2); +} + +#ifndef NONMATCHING //.matches but requires .rodata +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C76D0/func_8034E7B8.s") +#else +void func_8034E7B8(Struct73s *arg0, s32 arg1, f32 arg2, s32 arg3, f32 arg4) { + f32 var_f0; + s32 temp_s0; + + func_8034E71C(arg0, arg1, arg2); + if ((arg4 > 0.0f)){ + temp_s0 = func_802F9AA8(SFX_3EC_CCW_DOOR_OPENING); + func_802F9DB8(temp_s0, 0.7f, 0.9f, 0.03f); + func_802FA028(temp_s0, arg3); + func_802FA060(temp_s0, 0x7918, 0x7FFF, 15.0f); + func_802F9F80(temp_s0, 0.0f, arg4, 0.0f); + for(var_f0 = 0.5f; var_f0 > 0.0f; var_f0 -= 0.1){ + if (var_f0 < arg4) { + func_802F9F80(temp_s0, var_f0 / 2, arg4 - var_f0, var_f0 / 2); + return; + } + } + } +} +#endif + + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C76D0/func_8034E8E4.s") +#else +// extern f64 D_80379238; +// extern f64 D_80379240; +// extern f64 D_80379248; +// extern f64 D_80379250; +// extern f64 D_80379258; +// extern f64 D_80379260; +// extern f64 D_80379268; + +void func_8034E8E4(Struct73s *arg0, BKModel *arg1, s32 arg2) { + f32 sp38; + f32 sp30[2]; + f32 sp28; + f32 cos; + f32 sin; + + sp38 = time_getDelta(); + arg0->unk4 += sp38; + cos = cosf(arg0->unk4 * 0.2 * RARE_PI); + sin = sinf(arg0->unk4 * 0.08 * RARE_PI); + sp30[0] = (sin*100.0f + 150.0f*cos)*0.8; + + + sin = sinf(arg0->unk4 * 0.5 * RARE_PI); + cos = cosf(arg0->unk4 * 0.22 * RARE_PI); + sp30[1] = (cos* 100.0f + 50.0f*sin)*0.8; + + arg0->d_tc[0] = (sp30[0] >= 0.0) ? sp30[0] + 0.5 : sp30[0] - 0.5; + arg0->d_tc[1] = (sp30[1] >= 0.0) ? sp30[1] + 0.5 : sp30[1] - 0.5; + + cos = cosf(arg0->unk4 * 0.5 * RARE_PI); + sin = sinf(arg0->unk4 * 0.11 * RARE_PI); + sp28 = sin*(arg0->unk8 * 0.25) + (arg0->unk8* 0.75)*cos; + + if (arg0->unk14 < arg0->unk1C) { + arg0->unk18 = arg0->unk14; + arg0->unk14 += sp38; + if (arg0->unk1C < arg0->unk14) { + arg0->unk14 = arg0->unk1C; + } + } + sp28 += (arg0->unk14 < arg0->unk1C) ? arg0->unkC + ((arg0->unk14 / arg0->unk1C) * (arg0->unkE - arg0->unkC)) : arg0->unkE; + arg0->dy = (sp28 >= 0.0) ? sp28 + 0.5 : sp28 - 0.5; + func_8033F120(arg1, arg2, func_8034E660, (s32) arg0); +} +#endif diff --git a/src/core2/code_C7CC0.c b/src/core2/code_C7CC0.c new file mode 100644 index 00000000..e1bfaa6a --- /dev/null +++ b/src/core2/code_C7CC0.c @@ -0,0 +1,39 @@ +#include +#include "functions.h" +#include "variables.h" + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C7CC0/func_8034EC50.s") +#else +void func_8034EC50(s32 arg0, BKVtxRef *ref, Vtx *dst, Struct74s *arg3) { + f32 cos; + f32 sin; + f32 temp_f2; + s32 temp_f16; + f32 tmp0; + f32 tmp1; + f32 d0; + f32 d1; + + tmp0 = (dst->v.ob[0] - arg3->unk10)*200.0f; + tmp1 = (dst->v.ob[2] - arg3->unk14)*200.0f; + tmp0 += arg3->unk4; + tmp1 += arg3->unk8; + sin = sinf(tmp0); + cos = cosf(tmp1); + temp_f2 = (cos + sin) * arg3->unk20; + dst->v.ob[1] = arg3->unkC + temp_f2; + temp_f16 = (s32) (((temp_f2 / arg3->unk24) * 50.0f) + 205.0f); + dst->v.cn[0] = (s32)(ref->v.v.cn[0] * temp_f16) / 255; + dst->v.cn[1] = (s32)(ref->v.v.cn[1] * temp_f16) / 255; + dst->v.cn[2] = (s32)(ref->v.v.cn[2] * temp_f16) / 255; + dst->v.tc[0] = ref->v.v.tc[0] + arg3->unk28[0]; + dst->v.tc[1] = ref->v.v.tc[1] + arg3->unk28[1]; +} +#endif + +void func_8034EE24(s32 arg0){} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C7CC0/func_8034EE2C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C7CC0/func_8034EF60.s") diff --git a/src/core2/code_C8230.c b/src/core2/code_C8230.c new file mode 100644 index 00000000..89740a6f --- /dev/null +++ b/src/core2/code_C8230.c @@ -0,0 +1,32 @@ +#include +#include "functions.h" +#include "variables.h" + + +void func_8034F1C0(s32 arg0, BKVtxRef *ref, Vtx *dst, Struct75s *arg3) { + s32 temp_f4; + s32 i; + + for(i = 0; i < 3; i++){ + temp_f4 = (s32) (ref->v.v.cn[i] + arg3->unk0 * 50.0f); + dst->v.cn[i] = (temp_f4 < 0xFF) ? temp_f4 : 0xFF; + } +} + +void func_8034F248(Struct75s arg0){} + +func_8034F250(Struct75s *arg0, UNK_TYPE(s32) arg1, UNK_TYPE(s32) arg2, UNK_TYPE(s32) arg3){ + arg0->unk0 = 0.0f; +} + +void func_8034F268(Struct75s *arg0, BKModel *arg1, s32 arg2) { + void *temp_v0; + + temp_v0 = func_8034C448(arg2 - 0x64); + if (temp_v0 != NULL) { + arg0->unk0 = func_8034F560(temp_v0) / 255.0; + } else { + arg0->unk0 = 0.0f; + } + func_8033F120(arg1, arg2, func_8034F1C0, (s32) arg0); +} diff --git a/src/core2/code_C8360.c b/src/core2/code_C8360.c new file mode 100644 index 00000000..88659e74 --- /dev/null +++ b/src/core2/code_C8360.c @@ -0,0 +1,36 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct struct_core2_C8360_0{ + f32 unk0; +}struct_core2_C8360_0; + +/* .code */ +void func_8034F2F0(s32 arg0, BKVtxRef *ref, Vtx *dst, struct_core2_C8360_0 *arg3) { + s32 temp_f4; + s32 i; + + for(i = 0; i < 3; i++){ + temp_f4 = ref->v.v.cn[i] + (arg3->unk0 * 50.0f); + dst->v.cn[i] = (temp_f4 < 0xFF) ? temp_f4 : 0xFF; + } +} + +void func_8034F378(struct_core2_C8360_0 *arg0){} + +void func_8034F380(struct_core2_C8360_0 *arg0, s32 arg1, s32 arg2, s32 arg3){ + arg0->unk0 = 0.0f; +} + +void func_8034F398(f32 *arg0, BKModel *arg1, s32 arg2) { + void *temp_v0; + + temp_v0 = func_8034C344(arg2 - 0x64); + if (temp_v0 != 0) { + *arg0 = func_8034F560(temp_v0) / 255.0; + } else { + *arg0 = 0.0f; + } + func_8033F120(arg1, arg2, func_8034F2F0, (s32) arg0); +} diff --git a/src/core2/code_C8490.c b/src/core2/code_C8490.c new file mode 100644 index 00000000..f5b7283f --- /dev/null +++ b/src/core2/code_C8490.c @@ -0,0 +1,71 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .code */ +void func_8034F420(s32 arg0, BKVtxRef *ref, Vtx *dst, Struct76s *arg3){ + dst->v.cn[3] = arg3->alpha; +} + +void func_8034F434(Struct76s *arg0, s32 arg1) { + f32 var_f0; + + if (arg1 == 1) { + arg0->alpha = 0; + arg0->unk2 = randi2(200, 255); + arg0->unk4 = (s32) (arg0->unk4 + 1); + arg0->unk14 = arg0->unk10 = randf2(0.08f, 0.12f); + if ((arg0->unk4 == 1) && func_8034C4CC()) { + func_8030E6A4(SFX_B5_THUNDERBOLT, randf2(0.9f, 1.1f), randi2(10000, 20000)); + } + } + if (arg1 == 0) { + arg0->alpha = 0; + if ((arg0->unk4 > 0) && (arg0->unk4 < arg0->unk8)) { + arg0->unk10 = randf2(0.1f, 0.2f); + } else { + arg0->unk4 = 0; + arg0->unk8 = randi2(1, 4); + arg0->unk10 = randf2(4.0f, 6.0f); + } + } + arg0->unkC = arg1; +} + +s32 func_8034F560(Struct76s *arg0){ + return arg0->alpha; +} + +void func_8034F568(Struct76s *arg0){} + +void func_8034F570(Struct76s *arg0, s32 arg1, s32 arg2, s32 arg3){ + arg0->alpha = 0; + arg0->unk4 = 0; + arg0->unk8 = 2; + arg0->unkC = 0; + func_8034F434(arg0, 0); +} + +void func_8034F5B0(Struct76s *arg0, BKModel *arg1, s32 arg2){ + f32 sp24; + + sp24 = time_getDelta(); + if ((arg0->unkC == 0) && (func_8025773C(&arg0->unk10, sp24))) { + func_8034F434(arg0, 1); + } + if (arg0->unkC == 1) { + if (arg0->unk10 <= 0.04) { + arg0->alpha = (arg0->unk10 / 0.04) * arg0->unk2; + } else { + if (arg0->unk10 < (arg0->unk14 - 0.04)) { + arg0->alpha = arg0->unk2; + } else { + arg0->alpha = ((arg0->unk14 - arg0->unk10) / 0.04) * arg0->unk2; + } + } + if (func_8025773C(&arg0->unk10, sp24)) { + func_8034F434(arg0, 0); + } + } + func_8033F120(arg1, arg2, func_8034F420, (s32) arg0); +} diff --git a/src/core2/code_C8760.c b/src/core2/code_C8760.c new file mode 100644 index 00000000..5a646a36 --- /dev/null +++ b/src/core2/code_C8760.c @@ -0,0 +1,68 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8030DE44(u8, s32, f32); + +struct { + ParticleEmitter *unk0; + u8 unk4; + u8 unk5; + u8 pad6[2]; +}D_803720A0; + +extern f32 D_803792F0; + +void func_8034F6F0(Gfx **gdl, Mtx **mptr, s32 vptr){ + if(D_803720A0.unk0){ + func_802EF3A8(D_803720A0.unk0, gdl, mptr, vptr); + } +} + +void func_8034F734(void){ + if(D_803720A0.unk0){ + func_8030DA44(D_803720A0.unk5); + func_802EF684(D_803720A0.unk0); + } +} + +void func_8034F774(void){ + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + int s0; + int s1; + + s0 = func_80304E24(0x2F, &sp38); + s1 = func_80304E24(0x30, &sp2C); + if( !s0 || !s1){ + D_803720A0.unk0 = NULL; + }else{ + D_803720A0.unk0 = particleEmitter_new(0xA); + particleEmitter_setSprite(D_803720A0.unk0, ASSET_70E_SPRITE_SMOKE_2); + particleEmitter_setStartingFrameRange(D_803720A0.unk0, 0, 4); + particleEmitter_setParticleFramerateRange(D_803720A0.unk0, 15.0f, 30.0f); + particleEmitter_setSpawnIntervalRange(D_803720A0.unk0, 0.0f, 1.0f); + func_802EFEC0(D_803720A0.unk0, D_803792F0, D_803792F0); + func_802EFB70(D_803720A0.unk0, 1.8f, 2.2f); + func_802EF4AC(D_803720A0.unk0, &sp38, &sp2C, 0xA); + particleEmitter_setSpawnInterval(D_803720A0.unk0, 0.0f); + D_803720A0.unk5 = func_8030D90C(); + + sp44[0] = (sp38[0] + sp2C[0])/2; + sp44[1] = (sp38[1] + sp2C[1])/2; + sp44[2] = (sp38[2] + sp2C[2])/2; + sfxsource_setSfxId(D_803720A0.unk5, 0x3EC); + func_8030DD14(D_803720A0.unk5, 3); + func_8030DFF0(D_803720A0.unk5, 1); + func_8030DF68(D_803720A0.unk5, &sp44); + func_8030DEB4(D_803720A0.unk5, 400.0f, 3200.0f); + func_8030DE44(D_803720A0.unk5, 2, 0.5f); + func_8030E2C4(D_803720A0.unk5); + } +} + +void func_8034F918(void){ + if(D_803720A0.unk0) + particleEmitter_update(D_803720A0.unk0); +} diff --git a/src/core2/code_C89C0.c b/src/core2/code_C89C0.c new file mode 100644 index 00000000..73cdf34b --- /dev/null +++ b/src/core2/code_C89C0.c @@ -0,0 +1,327 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8032F64C(f32[3], s32); +extern void func_80323240(struct56s *, f32, f32[3]); +extern f32 func_80323F74(struct56s *, f32, f32); +extern f32 func_80256AB4(f32, f32, f32, f32); + +typedef struct { + s32 unk0; + s32 unk4; //bool + s32 unk8; + f32 unkC[3]; + f32 unk18; + s32 unk1C; + f32 unk20; + f32 unk24; + f32 unk28; + f32 unk2C; +}Struct_core2_C89C0_1; + +typedef struct { + ActorMarker *unk0; + Struct_core2_C89C0_1 *unk4; + f32 unk8[3]; + f32 unk14; + f32 unk18; + f32 unk1C; + f32 unk20; + f32 unk24[3]; + f32 unk30; + f32 unk34; + f32 unk38; +}Struct_core2_C89C0_0; + +/* .rodata */ +extern f32 D_80379300; +extern f32 D_80379304; +extern f32 D_80379308; +extern f64 D_80379310; +extern f32 D_80379318; +extern f64 D_80379320; +extern f32 D_80379328; +extern f32 D_8037932C; +extern f32 D_80379330; + +/* .bss */ +extern struct { + void *unk0; //2D_fish_bin + void *unk4; //green_ball_bin + Struct_core2_C89C0_1 *unk8; + Struct_core2_C89C0_1 *unkC; + Struct_core2_C89C0_1 *unk10; + Struct_core2_C89C0_0 *unk14; + Struct_core2_C89C0_0 *unk18; + Struct_core2_C89C0_0 *unk1C; +}D_80386150; + +/* .code */ +void func_8034F950(Struct_core2_C89C0_0 *arg0) { + f32 sp7C[3]; + f32 sp70[3]; + f32 temp_f0; + s32 i; + + sp7C[0] = arg0->unk4->unkC[0] + arg0->unk24[0]; + sp7C[1] = arg0->unk4->unkC[1] + arg0->unk24[1]; + sp7C[2] = arg0->unk4->unkC[2] + arg0->unk24[2]; + sp7C[0] -= arg0->unk8[0]; + sp7C[1] -= arg0->unk8[1]; + sp7C[2] -= arg0->unk8[2]; + + for(i = 0; i < 3; i++){ + sp7C[i] += randf2(-40.0f, 40.0f); + if (i != 1) { + arg0->unk24[i] += randf2(-40.0f, 40.0f); + arg0->unk24[i] = (arg0->unk24[i] > 100.0f) ? 100.0f : arg0->unk24[i]; + arg0->unk24[i] = (arg0->unk24[i] < -100.0f) ? -100.0f : arg0->unk24[i]; + } + } + temp_f0 = gu_sqrtf(sp7C[0]*sp7C[0] + sp7C[1]*sp7C[1] + sp7C[2]*sp7C[2]); + arg0->unk34 = (temp_f0 > 200.0f) ? 1.0f : (f32)(temp_f0 / 200.0); + sp70[0] = -1.0f; + sp70[1] = 0.0f; + sp70[2] = 0.0f; + ml_vec3f_yaw_rotate_copy(sp70, sp70, arg0->unk14); + ml_vec3f_normalize(sp7C); + if ((sp70[0]*sp7C[0] + sp70[1]*sp7C[1] + sp70[2]*sp7C[2]) < 0.0f) { + arg0->unk34 = randf2(D_80379300, D_80379304); + arg0->unk30 = randf2(0.5f, 1.0f); + } else { + arg0->unk30 = (randf2(D_80379308, 1.0f) * func_80256AB4(sp70[0], sp70[2], sp7C[0], sp7C[2])); + } + arg0->unk30 = (arg0->unk30 > 1.0f) ? 1.0f : arg0->unk30; + arg0->unk30 = (arg0->unk30 < -1.0f) ? -1.0f : arg0->unk30; + + if (sp7C[1] > 0.0f) { + arg0->unk38 = (f32) (sp7C[1] / 10.0f); + if (arg0->unk38 > 1.0f) { + arg0->unk38 = 1.0f; + } + } else if (sp7C[1] < 0.0f) { + arg0->unk38 = (f32) (sp7C[1] / 10.0f); + if (arg0->unk38 < -1.0f) { + arg0->unk38 = -1.0f; + } + } +} + +Actor* func_8034FCDC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + f32 sp2C[3]; + Struct_core2_C89C0_0 *sp28; + + sp28 = D_80386150.unk14 + marker->actrArrayIdx; + if (sp28->unk4->unk4 == 0) { + return NULL; + } + + sp2C[0] = 0.0f; + sp2C[1] = sp28->unk14; + sp2C[2] = 0.0f; + set_model_render_mode(2); + func_803391A4(gfx, mtx, sp28->unk8, sp2C, sp28->unk18 * D_80379310, NULL, D_80386150.unk0); + + return NULL; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C89C0/func_8034FDA0.s") +#else +void func_8034FDA0(s32 arg0) { + s32 sp34; + s32 sp24; + + if (D_80386150.unkC == D_80386150.unk10) { + sp34 = D_80386150.unkC - D_80386150.unk8; + sp24 = sp34 * 2; + D_80386150.unk8 = (Struct_core2_C89C0_1*) realloc(D_80386150.unk8, sp24 * sizeof(Struct_core2_C89C0_1)); + D_80386150.unkC = D_80386150.unk8 + sp34; + D_80386150.unk10 = D_80386150.unk8 + sp24; + } + D_80386150.unkC->unk0 = 1; + D_80386150.unkC->unk4 = 0; + D_80386150.unkC->unk8 = 0x14; + D_80386150.unkC->unk18 = 1000.0f; + D_80386150.unkC->unk1C = arg0; + D_80386150.unkC->unk20 = 10.0f; + D_80386150.unkC->unk24 = 20.0f; + D_80386150.unkC->unk28 = D_80379318; + D_80386150.unkC->unk2C = 0.0f; + func_80323240(func_80342038(D_80386150.unkC->unk1C), D_80386150.unkC->unk2C, D_80386150.unkC->unkC); + D_80386150.unkC++; +} +#endif + +void func_8034FEE0(Struct_core2_C89C0_1 *arg0) { + s32 sp2C; + s32 sp20; + + if (D_80386150.unk18 == D_80386150.unk1C) { + sp2C = D_80386150.unk18 - D_80386150.unk14; + sp20 = sp2C * 2; + D_80386150.unk14 = (Struct_core2_C89C0_0 *) realloc(D_80386150.unk14, sp20 * sizeof(Struct_core2_C89C0_0)); + D_80386150.unk18 = D_80386150.unk14 + sp2C; + D_80386150.unk1C = D_80386150.unk14 + sp20; + } + D_80386150.unk18->unk4 = arg0; + D_80386150.unk18->unk8[0] = arg0->unkC[0]; + D_80386150.unk18->unk8[1] = arg0->unkC[1]; + D_80386150.unk18->unk8[2] = arg0->unkC[2]; + D_80386150.unk18->unk14 = 0.0f; + D_80386150.unk18->unk18 = randf2(1.0f, 2.0f); + D_80386150.unk18->unk1C = 0.0f; + D_80386150.unk18->unk20 = 0.0f; + D_80386150.unk18->unk24[0] = randf2(-100.0f, 100.0f); + D_80386150.unk18->unk24[1] = randf2(-100.0f, 100.0f); + D_80386150.unk18->unk24[2] = randf2(-100.0f, 100.0f); + D_80386150.unk18->unk0 = func_8032FBE4(D_80386150.unk18->unk8, &func_8034FCDC, 1, 0x46); + D_80386150.unk18->unk0->collidable = FALSE; + D_80386150.unk18->unk0->actrArrayIdx = D_80386150.unk18 - D_80386150.unk14; + D_80386150.unk18++; +} + +void func_803500D8(Gfx **gfx, Mtx **mtx, Vtx **vtx){} + +void func_803500E8(void) { + s32 i; + Struct_core2_C89C0_0 *var_s0; + + if (D_80386150.unk0 != NULL) { + for(var_s0 = D_80386150.unk14; var_s0 < D_80386150.unk18; var_s0++) { + marker_free(var_s0->unk0); + } + assetcache_release(D_80386150.unk0); + assetcache_release(D_80386150.unk4); + free(D_80386150.unk8); + free(D_80386150.unk14); + } +} + + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C89C0/func_80350174.s") +#else +void func_80350174(void) { + s32 temp_t6; + s32 temp_t7; + s32 temp_v0_3; + s32 var_s0; + s32 var_s0_2; + void *temp_v0; + void *temp_v0_2; + s32 i; + + + for(i = 0x31; i != 0x36; i++){ + if (func_80341F64(i)) + break; + } + if(i >= 0x36){ + D_80386150.unk0 = NULL; + return; + } + + D_80386150.unk0 = assetcache_get(0x87C); //ASSET_87C_2D_FISH + D_80386150.unk4 = assetcache_get(0x7BC); //ASSET_7BC_GREEN_BALL + D_80386150.unk8 = malloc(0x60); + D_80386150.unkC = D_80386150.unk8; + D_80386150.unk10 = (s32)D_80386150.unk8 + 0x60; + D_80386150.unk14 = malloc(2*sizeof(Struct_core2_C89C0_0)); + D_80386150.unk18 = D_80386150.unk14; + D_80386150.unk1C = (s32)D_80386150.unk14 + 2*sizeof(Struct_core2_C89C0_0); + for(i = 0x31; i < 0x36; i++){ + temp_v0_3 = func_80341F2C(i); + if (temp_v0_3 >= 0) + func_8034FDA0(temp_v0_3); + } +} +#endif + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C89C0/func_80350250.s") +#else +void func_80350250(void) { + f32 sp7C[3]; + f32 sp70[3]; + f32 temp_f22; + Struct_core2_C89C0_1 *var_s0; + Struct_core2_C89C0_0 *var_s0_2; + + temp_f22 = time_getDelta(); + if ((D_80386150.unk0 != 0) && (func_80334904() == 2)) { + player_getPosition(sp7C); + for(var_s0 = D_80386150.unk8; var_s0 < D_80386150.unkC; var_s0++) { + var_s0->unk4 = (ml_vec3f_distance(var_s0->unkC, sp7C) < 2000.0f); + if (var_s0->unk4) { + if (var_s0->unk8 > 0) { + var_s0->unk28 -= temp_f22; + if (var_s0->unk28 <= 0.0f) { + var_s0->unk28 = randf2(0.01f, 0.2f); + func_8034FEE0((void *) var_s0); + var_s0->unk8--; + } + } + var_s0->unk18 = randf2(0.0f, 10000.0f); + var_s0->unk24 -= temp_f22; + if (var_s0->unk24 <= 0.0f) { + var_s0->unk24 = randf2(10.0f, 20.0f); + if (0.05 < var_s0->unk2C) { + var_s0->unk2C -= 0.05; + } + } + var_s0->unk20 = (f32) (var_s0->unk20 - temp_f22); + if (var_s0->unk20 <= 0.0f) { + if (var_s0->unk0 == 0) { + var_s0->unk0 = (randf() >= 0.5) ? 1 : -1; + var_s0->unk20 = randf2(20.0f, 40.0f); + } else { + var_s0->unk0 = 0; + var_s0->unk20 = randf2(5.0f, 10.0f); + } + } + var_s0->unk2C = func_80323F74(func_80342038(var_s0->unk1C), var_s0->unk2C, (f32) var_s0->unk0 * var_s0->unk18 * temp_f22); + var_s0->unk2C = (var_s0->unk2C < 0.0f) ? 1.0f - var_s0->unk2C : var_s0->unk2C; + var_s0->unk2C = (var_s0->unk2C >= 1.0f) ? var_s0->unk2C - 1.0f : var_s0->unk2C; + func_80323240(func_80342038(var_s0->unk1C), var_s0->unk2C, var_s0->unkC); + } + } + + for(var_s0_2 = D_80386150.unk14; var_s0_2 < D_80386150.unk18; var_s0_2++) { + if (var_s0_2->unk4->unk4 != 0) { + func_8034F950(var_s0_2); + var_s0_2->unk1C += var_s0_2->unk34 * (3.0f - var_s0_2->unk18) * 100.0f * temp_f22; + var_s0_2->unk20 += var_s0_2->unk38 * (3.0f - var_s0_2->unk18) * 20.0f * temp_f22; + var_s0_2->unk14 += var_s0_2->unk30 * (3.0f - var_s0_2->unk18) * 180.0f * temp_f22; + if (var_s0_2->unk1C > 0.0f) { + var_s0_2->unk1C -= var_s0_2->unk1C * temp_f22; + if (var_s0_2->unk1C < 0.0f) { + var_s0_2->unk1C = 0.0f; + } + } + var_s0_2->unk20 = var_s0_2->unk20 - var_s0_2->unk20 * temp_f22; + sp70[0] = -var_s0_2->unk1C * temp_f22; + sp70[1] = sp70[2] = 0.0f; + ml_vec3f_yaw_rotate_copy(&sp70, &sp70, var_s0_2->unk14); + var_s0_2->unk8[0] = var_s0_2->unk8[0] + sp70[0]; + var_s0_2->unk8[1] = var_s0_2->unk8[1] + sp70[1]; + var_s0_2->unk8[2] = var_s0_2->unk8[2] + sp70[2]; + var_s0_2->unk8[1] = var_s0_2->unk20 * temp_f22; + func_8032F64C(var_s0_2->unk8, var_s0_2->unk0); + } + } + } +} +#endif + +void func_803506DC(void){ + s32 sp1C = D_80386150.unk8; + s32 sp18 = D_80386150.unk14; + D_80386150.unk8 = (Struct_core2_C89C0_1 *)defrag(sp1C); + D_80386150.unkC = ((s32)D_80386150.unkC - (s32)sp1C) + (s32)D_80386150.unk8; + D_80386150.unk10 = ((s32)D_80386150.unk10 - (s32)sp1C) + (s32)D_80386150.unk8; + D_80386150.unk14 = (Struct_core2_C89C0_0 *)defrag(D_80386150.unk14); + D_80386150.unk18 = ((s32)D_80386150.unk18 - (s32)sp18) + (s32)D_80386150.unk14; + D_80386150.unk1C = ((s32)D_80386150.unk1C - (s32)sp18) + (s32)D_80386150.unk14; +} diff --git a/src/core2/code_C97F0.c b/src/core2/code_C97F0.c new file mode 100644 index 00000000..8ad81866 --- /dev/null +++ b/src/core2/code_C97F0.c @@ -0,0 +1,191 @@ +#include +#include "functions.h" +#include "variables.h" + +extern bool func_8028F170(f32, f32); +extern void func_8024C5CC(f32[3]); + +typedef struct { + f32 unk0; + s32 unk4[4]; + f32 unk14; +}Struct_core2_C97F0_2; + +typedef struct { + u8 unk0; + u8 pad1[3]; + Struct_core2_C97F0_2 unk4[15]; +}Struct_core2_C97F0_1; + +typedef struct { + s16 unk0; + u8 pad2[0x2]; + f32 unk4[3]; + u8 unk10; + u8 pad11[0x3]; +}Struct_core2_C97F0_0; + +/* .data */ +extern Struct_core2_C97F0_1 D_803720B0[]; +extern Struct_core2_C97F0_0 D_803724F4[]; +extern s32 D_803725A8[4]; + +/* .rodata */ +extern f64 D_80379340; +extern f64 D_80379348; + +/* .bss */ +extern struct{ + Struct_core2_C97F0_1 *unk0; + Struct_core2_C97F0_0 *unk4; + void *unk8; +} D_80386170; +extern struct { + u8 unk0; + u8 unk1; +}D_8038617C; + +/* .code */ +Struct_core2_C97F0_1 *func_80350780(s32 arg0) { + Struct_core2_C97F0_1 *i_ptr; + + for(i_ptr = D_803720B0; i_ptr->unk0 != 0; i_ptr++){ + if(arg0 == i_ptr->unk0){ + return i_ptr; + } + } + return i_ptr; +} + +Struct_core2_C97F0_0 *func_803507CC(enum map_e map_id) { + Struct_core2_C97F0_0 *i_ptr; + + for(i_ptr = D_803724F4; i_ptr->unk0 != 0; i_ptr++){ + if(map_id == i_ptr->unk0){ + return i_ptr; + } + } + return NULL; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C97F0/func_80350818.s") +#else +void func_80350818(Gfx **gfx, Mtx **mtx, Vtx **vtx) { + f32 spDC[3]; + f32 spD0[3]; + f32 spC4[3]; + f32 spB8[3]; + Struct_core2_C97F0_0 *temp_s1; + Struct_core2_C97F0_1 *temp_s2; + f32 var_f22; + s32 i; + f32 sp9C[3]; + f32 sp90[3]; + s32 sp80[4]; + + if(D_80386170.unk8); + temp_s1 = D_80386170.unk4; + temp_s2 = D_80386170.unk0; + if (( temp_s1 != NULL) && D_8038617C.unk0) { + func_8024C5CC(spDC); + func_8024C764(spD0); + sp9C[0] = temp_s1->unk4[0]; + sp9C[1] = temp_s1->unk4[1]; + sp9C[2] = temp_s1->unk4[2]; + ml_vec3f_yaw_rotate_copy(sp9C, sp9C, -spD0[1]); + ml_vec3f_pitch_rotate_copy(sp9C, sp9C, -spD0[0]); + if (!(((1.2 * (f32)D_80276588) / 2) < sp9C[0]) && !(sp9C[0] < ((-1.2 * (f32)D_80276588) / 2))) { + if (!(((1.2 * (f32)D_8027658C) / 2) < sp9C[1]) && !(sp9C[1] < ((-1.2 * (f32)D_8027658C) / 2))) { + sp90[0] = -sp9C[0]; + sp90[1] = -sp9C[1]; + sp90[2] = sp9C[2]; + ml_vec3f_pitch_rotate_copy(sp90, sp90, spD0[0]); + ml_vec3f_yaw_rotate_copy(sp90, sp90, spD0[1]); + var_f22 = 1.0f - (((sp9C[0] * sp9C[0]) + (sp9C[1] * sp9C[1])) / ((f32)D_8027658C * (f32)D_8027658C)); + if (var_f22 < 0.0f) { + var_f22 = 0.0f; + } + if (var_f22 > 1.0f) { + var_f22 = 1.0f; + } + spC4[0] = sp90[0] - temp_s1->unk4[0]; + spC4[1] = sp90[1] - temp_s1->unk4[1]; + spC4[2] = sp90[2] - temp_s1->unk4[2]; + for(i = 0; temp_s2->unk4[i].unk0 != 0.0f; i++){ + spB8[0] = (spDC[0] + temp_s1->unk4[0]) + (temp_s2->unk4[i].unk0 * spC4[0]); + spB8[1] = (spDC[1] + temp_s1->unk4[1]) + (temp_s2->unk4[i].unk0 * spC4[1]); + spB8[2] = (spDC[2] + temp_s1->unk4[2]) + (temp_s2->unk4[i].unk0 * spC4[2]); + sp80[0] = temp_s2->unk4[i].unk4[0]; + sp80[1] = temp_s2->unk4[i].unk4[1]; + sp80[2] = temp_s2->unk4[i].unk4[2]; + sp80[3] = temp_s2->unk4[i].unk4[3]; + sp80[3] *= var_f22; + func_8033A334(sp80, D_803725A8); + func_803391A4(gfx, mtx, spB8, spD0, temp_s2->unk4[i].unk14*0.25, NULL, D_80386170.unk8); + } + } + } + } +} +#endif + +void func_80350BC8(void){ + if(D_80386170.unk4 != NULL){ + assetcache_release(D_80386170.unk8); + } +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C97F0/func_80350BFC.s") +#else +void func_80350BFC(void) { + D_80386170.unk4 = func_803507CC(map_get()); + if (D_80386170.unk4 != NULL) { + D_80386170.unk0 = func_80350780(D_80386170.unk4->unk10); + D_80386170.unk8 = assetcache_get(0x882); + ml_vec3f_set_length(D_80386170.unk4->unk4, (2.0f*D_80276588) / 2.0f); + D_8038617C.unk0 = 1; + D_8038617C.unk1 = 0; + } +} +#endif + + +void func_80350CA4(void) { + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + f32 sp30[3]; + f32 sp24[3]; + s32 var_v0; + + if (D_80386170.unk4 != NULL) { + func_8024C5CC(sp54); + sp48[0] = D_80386170.unk4->unk4[0]; + sp48[1] = D_80386170.unk4->unk4[1]; + sp48[2] = D_80386170.unk4->unk4[2]; + ml_vec3f_set_length(sp48, 1000.0f); + sp30[0] = sp54[0] + (sp48[0] * D_8038617C.unk1); + sp30[1] = sp54[1] + (sp48[1] * D_8038617C.unk1); + sp30[2] = sp54[2] + (sp48[2] * D_8038617C.unk1); + sp24[0] = sp30[0] + sp48[0]; + sp24[1] = sp30[1] + sp48[1]; + sp24[2] = sp30[2] + sp48[2]; + if (func_8028F170(sp48[1], sp48[2])) { + var_v0 = func_80320B98(&sp30, &sp24, &sp3C, 0x01000000); + } else { + var_v0 = func_80309B48(&sp30, &sp24, &sp3C, 0x01000000); + } + if (var_v0 != 0) { + D_8038617C.unk0 = 0; + D_8038617C.unk1 = 0; + } else { + D_8038617C.unk1++; + if (D_8038617C.unk1 >= 0xB) { + D_8038617C.unk0 = 1; + D_8038617C.unk1 = 0; + } + } + } +} diff --git a/src/core2/code_C9E70.c b/src/core2/code_C9E70.c new file mode 100644 index 00000000..a295746a --- /dev/null +++ b/src/core2/code_C9E70.c @@ -0,0 +1,21 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "core2/code_C9E70.h" + +struct FF_StorageStruct *D_8037DCB8; + +void func_80350E00(void){ + func_803208F0(); + func_8031A4CC(); + if(D_8037DCB8 == NULL) + return; + + if(D_8037DCB8->unk20){ + func_80318C0C(D_8037DCB8->unk20); + D_8037DCB8->unk20 = (gczoombox_t *)defrag(D_8037DCB8->unk20); + } + D_8037DCB8->unk48 = (struct FF_StorageStruct_48 *)defrag(D_8037DCB8->unk48); + D_8037DCB8 = (struct FF_StorageStruct *) defrag(D_8037DCB8); +} diff --git a/src/core2/code_C9F00.c b/src/core2/code_C9F00.c new file mode 100644 index 00000000..752ad94b --- /dev/null +++ b/src/core2/code_C9F00.c @@ -0,0 +1,488 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80252CC4(f32[3], f32[3], f32, s32); +extern int func_802E805C(BKCollisionList *arg0, BKVertexList *vtxList, f32 arg2[3], f32 arg3[3], f32 arg4, s32 arg5, s32 arg6, s32 arg7, s32 arg8); +extern int func_802E9118(BKCollisionList *arg0, BKVertexList *vtxList, f32 arg2[3], f32 arg3[3], f32 arg4, s32 arg5, s32 arg6, f32 arg7, s32 arg8, s32 arg9, s32 arg10); +extern int func_802E9DD8(BKCollisionList *arg0, BKVertexList *vtxList, f32 arg2[3], f32 arg3[3], f32 arg4, s32 arg5, f32 arg6, s32 arg7, s32 arg8); +extern s32 func_802EA760(BKModelUnk14List *, s32, f32[3], f32[3], f32, s32, f32*, f32*); +extern bool func_80309DBC(f32[3], f32[3], f32, f32 sp54[3], s32, s32); + +void func_80351954(Struct68s *arg); +void func_80351AD0(Struct68s *arg0, enum asset_e model_id); + +typedef struct { + s16 unk0; + s16 unk2; + s16 unk4; + u32 pad6_15:9; + u32 unk6_6:6; + u32 pad6_4:1; + u16 unk8; + u16 padA_15:10; + u16 unkA_5:1; + u16 unkA_4:1; + u16 padA_3:2; + u16 unkA_1:1; + u16 padA_0:1; +}Struct_Core2_C9F00_2; + +typedef struct { + s16 unk0; + u8 unk2; + u8 unk3; +}Struct_Core2_C9F00_1; + +typedef struct { + void (*unk0)(void *, Struct68s *); + void (*unk4)(void *, Struct68s *, f32); +}Struct_Core2_C9F00_0; + +extern Struct_Core2_C9F00_1 D_803725C0[]; +extern Struct_Core2_C9F00_0 D_803725F4[]; + +/* .rodata */ +extern f64 D_80379350; +extern f64 D_80379358; +extern f64 D_80379360; +extern f64 D_80379368; +extern f64 D_80379370; +extern f64 D_80379378; + +/* .bss */ +extern struct { + Struct68s *unk0; + Struct6Cs unk4; + f32 unk14[3]; + s32 unk20[3]; + Struct68s *unk2C; +}D_80386180; + +extern struct { + s32 unk0; + Struct68s *unk4; //start + Struct68s *unk8; //end + Struct68s *unkC; //capacity_end +}D_803861B0; + + +/* .code */ +Actor *func_80350E90(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Struct68s *temp_s0; + BKModelBin *temp_v0; + void *temp_a2; + + temp_s0 = &D_803861B0.unk4[marker->actrArrayIdx]; + temp_v0 = temp_s0->unkC; + if (temp_v0 == NULL) { + return 0; + } else { + if (temp_s0->unk8 != NULL) { + temp_s0->unk8(&temp_s0->local, temp_s0, temp_s0->unk14, temp_s0->unk20, temp_s0->unk2C, temp_v0, gfx, mtx, vtx); + } else { + set_model_render_mode(1); + func_803391A4(gfx, mtx, temp_s0->unk14, temp_s0->unk20, temp_s0->unk2C, NULL, temp_s0->unkC); + } + } + return 0; +} + +s32 func_80350F7C(ActorMarker *marker, s32 arg1, f32 arg2[3], s32 arg3, s32 arg4) { + s32 sp4C; + Struct68s *temp_s0; + BKVertexList *sp44; + BKCollisionList *sp40; + + temp_s0 = &D_803861B0.unk4[marker->actrArrayIdx]; + if ((temp_s0->unkC == NULL) || (temp_s0->unk30 & 1)) { + return 0; + } + + sp40 = func_8033A084(temp_s0->unkC); + sp44 = func_8033A148(temp_s0->unkC); + sp4C = func_802E805C(sp40, sp44, temp_s0->unk14, temp_s0->unk20, temp_s0->unk2C, arg1, arg2, arg3, arg4); + if (sp4C != 0) { + if (func_8029453C()) { + D_80386180.unk20[0] = (s32) arg2[0]; + D_80386180.unk20[1] = (s32) arg2[1]; + D_80386180.unk20[2] = (s32) arg2[2]; + D_80386180.unk2C = temp_s0; + } + } + return sp4C; +} + +s32 func_803510B4(ActorMarker *marker, s32 arg1, f32 arg2[3], f32 arg3, s32 arg4, s32 arg5, s32 arg6) { + s32 pad44; + Struct68s *sp40; + BKVertexList *sp3C; + BKCollisionList *sp38; + + sp40 = &D_803861B0.unk4[marker->actrArrayIdx]; + if ((sp40->unkC == NULL) || (sp40->unk30 & 1)) { + return 0; + } + sp38 = func_8033A084(sp40->unkC); + sp3C = func_8033A148(sp40->unkC); + return func_802E9118(sp38, sp3C, sp40->unk14, sp40->unk20, sp40->unk2C, arg1, arg2, arg3, arg4, arg5, arg6); +} + +s32 func_80351198(ActorMarker *marker, s32 arg1, f32 arg2, s32 arg3, s32 arg4) { + s32 pad3C; + Struct68s *sp38; + BKVertexList *sp34; + BKCollisionList *sp30; + + sp38 = &D_803861B0.unk4[marker->actrArrayIdx]; + if ((sp38->unkC == NULL) || (sp38->unk30 & 1)) { + return 0; + } + sp30 = func_8033A084(sp38->unkC); + sp34 = func_8033A148(sp38->unkC); + return func_802E9DD8(sp30, sp34, sp38->unk14, sp38->unk20, sp38->unk2C, arg1, arg2, arg3, arg4); +} + + +Struct68s * func_8035126C(f32 arg0[3], f32 arg1[3], f32 arg2, s32 arg3, enum asset_e arg4) { + s32 sp2C; + s32 sp1C; + + sp2C = arg3; + if (D_803861B0.unk8 == D_803861B0.unkC) { + sp2C = D_803861B0.unk8 - D_803861B0.unk4; + sp1C = sp2C * 2; + D_803861B0.unk4 = (Struct68s *)realloc(D_803861B0.unk4, sp1C * sizeof(Struct68s)); + D_803861B0.unk8 = D_803861B0.unk4 + sp2C; + D_803861B0.unkC = D_803861B0.unk4 + sp1C; + } + D_803861B0.unk8->unk0 = 0; + D_803861B0.unk8->unk30 = 0; + D_803861B0.unk8->unk8 = NULL; + D_803861B0.unk8->unkC = NULL; + D_803861B0.unk8->unk2C = arg2; + D_803861B0.unk8->unk31 = arg3; + D_803861B0.unk8->unk14[0] = arg0[0]; + D_803861B0.unk8->unk14[1] = arg0[1]; + D_803861B0.unk8->unk14[2] = arg0[2]; + D_803861B0.unk8->unk20[0] = arg1[0]; + D_803861B0.unk8->unk20[1] = arg1[1]; + D_803861B0.unk8->unk20[2] = arg1[2]; + func_80351AD0(D_803861B0.unk8, arg4); + return D_803861B0.unk8++; + +} + +void func_803513EC(PropProp *arg0, s32 arg1) { + f32 sp3C[3]; + s32 pad30; + f32 sp2C[3]; + + arg0->unkB_5 = TRUE; + arg0->unkB_4 = FALSE; + sp3C[0] = (f32) arg0->unk4[0]; + sp3C[1] = (f32) arg0->unk4[1]; + sp3C[2] = (f32) arg0->unk4[2]; + sp2C[0] = 0.0f; + sp2C[1] = (f32) (arg0->unk0_15 * 2); + sp2C[2] = (f32) (arg0->unk0_7 * 2); + func_8035126C(sp3C, sp2C, (f32) (arg0->unkA / 100.0), arg1, arg0->unk0_31 + 0x2D1); +} + + +void func_803514F4(Struct68s *arg0){ + func_80351954(arg0); + marker_free(arg0->unk4); + if(arg0->unkC){ + assetcache_release(arg0->unkC); + } +} + +void func_80351538(Struct68s *arg0){ + arg0->unk4 = (ActorMarker *)func_8032FBE4(arg0->unk14, func_80350E90, 1, 0x47); + ((ActorMarker *)arg0->unk4)->collidable = FALSE; + ((ActorMarker *)arg0->unk4)->actrArrayIdx = (arg0 - D_803861B0.unk4); + ((ActorMarker *)arg0->unk4)->unk18 = &D_80386180.unk4; + if (D_803725F4[arg0->unk31].unk0 != NULL) { + D_803725F4[arg0->unk31].unk0(&arg0->local, arg0); + } +} + +bool func_803515EC(Struct_Core2_C9F00_2 *arg0) { + Struct_Core2_C9F00_1 *phi_s0; + s32 sp48[3]; + s32 sp44; + PropProp *sp40; + s16 temp_v0; + s16 phi_v0; + + + if (arg0->unk6_6 != 6) { + return 1; + } else { + for(phi_s0 = D_803725C0; phi_s0->unk0 != 0; phi_s0++){ + if( (arg0->unk8 == phi_s0->unk0) + && ((phi_s0->unk3 == 0) || (map_get() == phi_s0->unk3)) + ){ + sp48[0] = (s32) arg0->unk0; + sp48[1] = (s32) arg0->unk2; + sp48[2] = (s32) arg0->unk4; + if(func_803048E0(&sp48, &sp44, &sp40, 2, 0x1F4)){ + func_803513EC(sp40, phi_s0->unk2); + break; + } + } + } + } + return TRUE; +} + +#ifndef NONMATCHING +bool func_80351700(Struct_Core2_C9F00_2 * arg0); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C9F00/func_80351700.s") +#else +bool func_80351700(Struct_Core2_C9F00_2 * arg0){ + // if ((arg0->unkA << 0x1E) < 0) { + if (arg0->unkA_1) { + return 1; + } + return 1; +} +#endif + +#ifndef NONMATCHING +bool func_80351724(Struct_Core2_C9F00_2 * arg0); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_C9F00/func_80351724.s") +#else +bool func_80351724(Struct_Core2_C9F00_2 * arg0){ + // if (arg0->unkA_1 && arg0->unkA_5) { + if (((arg0->unkA << 0x1E) < 0) && ((arg0->unkA << 0x1A) < 0)) { + arg0->unkA_5 = FALSE; + arg0->unkA_4 = TRUE; + } + return 1; +} +#endif + +s32 func_80351758(Struct68s *arg0){ + if(arg0->unk0 == 0){ + arg0->unk0 = func_8030D90C(); + } + return arg0->unk0; +} + +ActorMarker *func_80351794(Struct68s *arg0){ + return arg0->unk4; +} + +void func_8035179C(Struct68s* arg0, f32 arg1[3]) { + arg1[0] = arg0->unk14[0]; + arg1[1] = arg0->unk14[1]; + arg1[2] = arg0->unk14[2]; +} + +void * func_803517B8(s32 arg0){ + return &D_803861B0.unk4[arg0].local; +} + +Struct68s * func_803517E8(s32 arg0){ + return &D_803861B0.unk4[arg0]; +} + +void func_80351814(Struct68s *arg0, f32 arg1[3]) { + arg1[0] = arg0->unk20[0]; + arg1[1] = arg0->unk20[1]; + arg1[2] = arg0->unk20[2]; +} + +f32 func_80351830(Struct68s *arg0) { + return arg0->unk2C; +} + + +s32 func_80351838(f32 arg0[3], s32 arg1, s32 arg2) { + f32 sp2C[3]; + Struct68s *sp28; + + sp2C[0] = sp2C[1] = sp2C[2] = 0.0f; + sp28 = func_8035126C(arg0, &sp2C, 1.0f, 4, arg1 + 0x884); + func_80351538(sp28); + func_8038B5D8(&sp28->local, sp28, arg1, arg2); + return sp28 - D_803861B0.unk4; +} + + +bool func_803518C0(Struct68s *arg0){ + return arg0 == D_80386180.unk0; +} + +bool func_803518D4(Struct68s *arg0){ + return arg0 == D_80386180.unk2C; +} + +void func_803518E8(void){ + Struct68s *phi_s0; + + for(phi_s0 = D_803861B0.unk4; phi_s0 < D_803861B0.unk8; phi_s0++){ + func_803514F4(phi_s0); + } + free(D_803861B0.unk4); +} + +void func_80351954(Struct68s *arg0){ + if(arg0->unk0){ + func_8030E394(arg0->unk0); + func_8030DA44(arg0->unk0); + arg0->unk0 = 0; + } +} + +void func_80351998(void) { + + D_803861B0.unk4 = (Struct68s*)malloc(2*sizeof(Struct68s)); + D_803861B0.unk8 = D_803861B0.unk4; + D_803861B0.unkC = D_803861B0.unk4 + 2; + + D_80386180.unk0 = NULL; + D_80386180.unk4.unk0 = func_80350F7C; + D_80386180.unk4.unk4 = func_803510B4; + D_80386180.unk4.unk8 = func_80351198; + D_80386180.unk4.unkC = NULL; + D_80386180.unk2C = NULL; +} + + +void func_80351A04(Struct68s *arg0, s32 arg1) { + arg0->unk30 = (u8)(arg0->unk30 | arg1); +} + +void func_80351A14(Struct68s *arg0, Struct68DrawMethod arg1) { + arg0->unk8 = arg1; +} + +void func_80351A1C(s32 arg0, s32 arg1) { + Struct68s *phi_s0; + + if (arg0 == 2) { + func_80305290(NULL, func_80351724); + func_803518E8(); + func_80351998(); + } + if (arg1 == 2) { + func_803518E8(); + func_80351998(); + func_80305290(&func_803515EC, &func_80351700); + for(phi_s0 = D_803861B0.unk4; phi_s0 < D_803861B0.unk8; phi_s0++){ + func_80351538(phi_s0); + + } + } +} + +void func_80351AD0(Struct68s *arg0, enum asset_e model_id) { + if (arg0->unkC != NULL) { + assetcache_release(arg0->unkC); + arg0->unkC = NULL; + } + if (model_id != 0) { + arg0->unkC = assetcache_get(model_id); + } +} + + + +void func_80351B28(Struct68s *arg0, f32 arg1[3]) { + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + f32 sp38; + BKModelUnk14List *sp34; + + if(arg0->unkC != NULL){ + sp34 = func_8033A12C(arg0->unkC); + if(sp34 != NULL){ + if(func_802EA760(sp34, 0, arg0->unk14, arg0->unk20, arg0->unk2C, 0, &sp48, &sp38)){ + func_802EA760(sp34, 0, arg1, arg0->unk20, arg0->unk2C, 0, &sp3C, &sp38); + if(func_80309DBC(&sp48, &sp3C, sp38, &sp54, 3, 0)){ + return; + } + } + } + } + arg0->unk14[0] = arg1[0]; + arg0->unk14[1] = arg1[1]; + arg0->unk14[2] = arg1[2]; + func_8032F64C(arg0->unk14, arg0->unk4); +} + + +void func_80351C2C(Struct68s *arg0, f32 arg1[3]){ + arg0->unk20[0] = arg1[0]; + arg0->unk20[1] = arg1[1]; + arg0->unk20[2] = arg1[2]; +} + +void func_80351C48(void) { + f32 sp4C[3]; + f32 temp_f20; + Struct68s *phi_s0; + s32 sp38[3]; + + temp_f20 = time_getDelta(); + D_80386180.unk0 = NULL; + if (D_80386180.unk2C != NULL) { + func_8028EB3C(&sp38); + if ((sp38[0] == D_80386180.unk20[0]) && (sp38[1] == D_80386180.unk20[1]) && (sp38[2] == D_80386180.unk20[2])) { + player_getPosition(sp4C); + mlMtxIdent(); + func_80252CC4(D_80386180.unk2C->unk14, D_80386180.unk2C->unk20, D_80386180.unk2C->unk2C, 0); + func_8025235C(D_80386180.unk14, sp4C); + if (func_8029FC4C() != 0) { + D_80386180.unk0 = D_80386180.unk2C; + } else { + D_80386180.unk0 = NULL; + } + } else { + D_80386180.unk2C = NULL; + } + } + + for(phi_s0 = D_803861B0.unk4; phi_s0 < D_803861B0.unk8; phi_s0++){ + if (D_803725F4[phi_s0->unk31].unk4 != NULL) { + D_803725F4[phi_s0->unk31].unk4(&phi_s0->local, phi_s0, temp_f20); + } + } + if (D_80386180.unk2C != NULL) { + mlMtxIdent(); + func_80252C08(D_80386180.unk2C->unk14, D_80386180.unk2C->unk20, D_80386180.unk2C->unk2C, NULL); + func_8025235C(&sp4C, &D_80386180.unk14); + func_8028FAB0(&sp4C); + } + D_80386180.unk2C = NULL; +} + +void func_80351DE0(Struct6Bs *arg0, Struct68s *arg1) { + arg0->unk0 = randf2(80.0f, 100.0f); + arg0->unk4[0] = arg0->unk4[1] = arg0->unk4[2] = 0.0f; + arg0->unk10[0] = arg0->unk10[1] = arg0->unk10[2] = 0.0f; + func_8035179C(arg1, arg0->unk1C); + func_80351814(arg1, arg0->unk28); + arg0->unk34 = 0.0f; +} + +void func_80351E60(Struct6Bs *arg0, Struct68s *arg1, f32 arg2) { + f32 sp24[3]; + + arg0->unk34 += arg2; + arg0->unk10[1] = sinf(((arg0->unk34 * arg0->unk0) / D_80379350) * D_80379358) * 20.0f; + arg0->unk4[0] = cosf(((arg0->unk34 * arg0->unk0) / D_80379360) * D_80379368) * 7.5; + arg0->unk4[1] = sinf(((arg0->unk34 * arg0->unk0) / D_80379370) * D_80379378) * 3.0f; + sp24[0] = arg0->unk1C[0] + arg0->unk10[0]; + sp24[1] = arg0->unk1C[1] + arg0->unk10[1]; + sp24[2] = arg0->unk1C[2] + arg0->unk10[2]; + func_80351B28(arg1, &sp24); + sp24[0] = arg0->unk28[0] + arg0->unk4[0]; + sp24[1] = arg0->unk28[1] + arg0->unk4[1]; + sp24[2] = arg0->unk28[2] + arg0->unk4[2]; + func_80351C2C(arg1, &sp24); +} diff --git a/src/core2/code_CB050.c b/src/core2/code_CB050.c new file mode 100644 index 00000000..33c61649 --- /dev/null +++ b/src/core2/code_CB050.c @@ -0,0 +1,8 @@ +#include +#include "functions.h" +#include "variables.h" + + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_CB050/func_80351FE0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_CB050/func_80352114.s") diff --git a/src/core2/code_CB610.c b/src/core2/code_CB610.c new file mode 100644 index 00000000..2ab496f9 --- /dev/null +++ b/src/core2/code_CB610.c @@ -0,0 +1,83 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "code_B6EA0.h" + +extern u8 func_8033E8D0(void); + +/* .rodata */ +extern f32 D_803793F0; +extern f64 D_803793F8; +extern f32 D_80379400; + +/* .code */ +void func_803525A0(f32 arg0[3]){ + u8 sp1F; + u8 sp1E; + f32 *sp18; + if(func_8033E3F0(0x11, 1) >= 0){ + sp1E = func_8033E8D0(); + sp1F = func_8033E93C(); + sp18 = func_8033E960(); + projectile_setPosition(sp1E, arg0); + func_80344D94(sp1F, arg0); + sp18[1] = D_803793F0; + } + +} + +void func_80352614(void){} + +void func_8035261C(void) { + ParticleStruct0s *sp2C; + u8 sp2B; + struct54s *sp24; + u8 sp23; + s32 sp1C; + f32 temp_f6; + s32 temp_f16; + + sp2C = func_8033E960(); + sp2B = func_8033E8D0(); + sp24 = func_8033E8F4(); + sp23 = func_8033E93C(); + sp1C = (s32) (randf() * 20.0f + 60.0f); + sp2C->unk20 = sp1C; + sp2C->unk0 = 0.0f; + projectile_setSprite(sp2B, ASSET_718_SPRITE_SPARKLE_WHITE_2); + func_8033FFE4(sp2B, sp1C, sp1C); + func_8033FCD8(sp2B, 0xC); + func_80287E9C(sp24); + func_80287F7C(sp24, 3); + func_80344E18(sp23, 3); +} + + +void func_803526DC(void) { + ParticleStruct0s *temp_s0; + u8 sp43; + s32 temp_f16; + f32 sp38; + f32 temp_f20; + f32 sp30; + + temp_s0 = func_8033E960(); + sp43 = func_8033E8D0(); + sp38 = temp_s0->unk4; + temp_f20 = temp_s0->unk0; + sp30 =temp_s0->unk20; + func_8033FE2C(sp43, 9.0f); + temp_f16 = (s32) ml_map_f(temp_f20, 0.0f, sp38, sp30, 10.0f); + func_8033FFE4(sp43, temp_f16, temp_f16); + if (temp_f20 < D_803793F8) { + func_8033FC34(sp43, (s32) ml_map_f(temp_f20, 0.0f, 0.08f, 20.0f, 255.0f)); + } else { + func_8033FC34(sp43, (s32) ml_map_f(temp_f20, D_80379400, sp38, 255.0f, 20.0f)); + } + temp_f20 += time_getDelta(); + temp_s0->unk0 = temp_f20; + if (sp38 < temp_f20) { + func_8033E984(); + } +} diff --git a/src/core2/code_CB8A0.c b/src/core2/code_CB8A0.c new file mode 100644 index 00000000..b32b0d95 --- /dev/null +++ b/src/core2/code_CB8A0.c @@ -0,0 +1,86 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern GenMethod_0 commonParticleType_getFreeMethod(enum common_particle_e); +extern GenMethod_0 commonParticleType_getUpdateMethod(enum common_particle_e); + +typedef struct { + u8 unk0; //prev_particle_type + u8 unk1; //current_particle_type + u8 unk2; //next_particle_type + u8 occupied; +}Struct_Core2_CB610_0; + +/* .bss */ +Struct_Core2_CB610_0 D_803861C0[40]; + +/* .rodata */ +void func_80352830(void){ + s32 i; + for(i = 1; i < 40; i++){ + D_803861C0[i].occupied = FALSE; + } +} + +void func_80352874(void){ return; } + +u8 func_8035287C(void){ + s32 i; + for(i = 1; i < 40; i++){ + if(!D_803861C0[i].occupied){ + D_803861C0[i].occupied++; + D_803861C0[i].unk0 = 0; + D_803861C0[i].unk1 = 0; + D_803861C0[i].unk2 = 0; + return i; + } + } + return 0; +} + +void func_803529DC(u8 arg0) { + if (commonParticleType_getFreeMethod(D_803861C0[arg0].unk1) != NULL) { + commonParticleType_getFreeMethod(D_803861C0[arg0].unk1)(); + } + D_803861C0[arg0].occupied = 0; +} + +void func_80352A38(u8 arg0, enum common_particle_e arg1){ + void (*funcPtr)(void); + if(arg1){ + D_803861C0[arg0].unk2 = arg1; + if(commonParticleType_getFreeMethod(D_803861C0[arg0].unk1)){ + funcPtr = commonParticleType_getFreeMethod(D_803861C0[arg0].unk1); + funcPtr(); + } + + D_803861C0[arg0].unk0 = D_803861C0[arg0].unk1; + D_803861C0[arg0].unk1 = D_803861C0[arg0].unk2; + D_803861C0[arg0].unk2 = 0; + if(commonParticleType_getInitMethod(D_803861C0[arg0].unk1)){ + funcPtr = commonParticleType_getInitMethod(D_803861C0[arg0].unk1); + funcPtr(); + } + + } +} + +s32 func_80352ACC(u8 arg0){ + return D_803861C0[arg0].unk0; +} + +s32 func_80352AE8(u8 arg0){ + return D_803861C0[arg0].unk1; +} + +s32 func_80352B04(u8 arg0){ + return D_803861C0[arg0].unk2; +} + +void func_80352B20(u8 arg0) { + if (commonParticleType_getUpdateMethod(D_803861C0[arg0].unk1) != NULL) { + commonParticleType_getUpdateMethod(D_803861C0[arg0].unk1)(); + } +} diff --git a/src/core2/code_CBBF0.c b/src/core2/code_CBBF0.c new file mode 100644 index 00000000..71df3c86 --- /dev/null +++ b/src/core2/code_CBBF0.c @@ -0,0 +1,55 @@ +#include +#include "functions.h" +#include "variables.h" + + +typedef struct{ + GenMethod_0 init_method; + GenMethod_0 update_method; + GenMethod_0 free_method; + s32 unkC; + s32 unk10; +}CommonParticleType; + +void commonParticleType_set(enum common_particle_e arg0, GenMethod_0 init_method, s32 update_method, GenMethod_0 free_method, s32 arg4, s32 arg5); + +/* .bss */ +extern CommonParticleType D_80386260[]; + + +/* .code */ +void commonParticleType_init(void){ + int i; + for(i = 1; i < 0x12; i++){ + commonParticleType_set(i, NULL, NULL, NULL, 0, 0); + } +} + +void commonParticleType_set(enum common_particle_e id, GenMethod_0 init_method, s32 update_method, GenMethod_0 free_method, s32 arg4, s32 arg5){ + D_80386260[id].init_method = init_method; + D_80386260[id].update_method = update_method; + D_80386260[id].free_method = free_method; + D_80386260[id].unkC = arg4; + D_80386260[id].unk10 = arg5; +} + +GenMethod_0 commonParticleType_getInitMethod(enum common_particle_e id) +{ + return D_80386260[id].init_method; +} + +GenMethod_0 commonParticleType_getUpdateMethod(enum common_particle_e id){ + return D_80386260[id].update_method; +} + +GenMethod_0 commonParticleType_getFreeMethod(enum common_particle_e id){ + return D_80386260[id].free_method; +} + +s32 commonParticleType_80352C60(enum common_particle_e id){ + return D_80386260[id].unkC; +} + +s32 commonParticleType_80352C7C(enum common_particle_e id){ + return D_80386260[id].unk10; +} diff --git a/src/core2/code_CBD10.c b/src/core2/code_CBD10.c new file mode 100644 index 00000000..28cc6df7 --- /dev/null +++ b/src/core2/code_CBD10.c @@ -0,0 +1,118 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "code_B6EA0.h" + +extern f32 func_8033DDEC(void); +extern u8 func_8033E8D0(void); +extern void func_8033FFE4(u8, s32, s32); +extern void func_8033FC34(u8, s32); +extern void projectile_setPosition(u8, f32[3]); +extern void func_80344D94(u8, f32[3]); +extern void func_80344E3C(u8, f32[3]); + +/* .data */ +extern struct53s D_80372670; + +/* .code */ +void func_80352CA0(u8 arg0, f32 *arg1){ + func_8033FFE4(arg0, (s32)arg1[0], (s32)arg1[0]); + func_8033FC34(arg0, (s32)arg1[2]); +} + +void func_80352CF4(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3) { + f32 *sp1C; + u8 sp1B; + u8 sp1A; + + + if (func_8033E3F0(7, 1) >= 0) { + sp1A = func_8033E8D0(); + sp1B = func_8033E93C(); + sp1C = func_8033E960(); + sp1C[0] = arg2; + sp1C[1] = (arg3 - arg2) / 20.0f; + projectile_setPosition(sp1A, arg0); + func_80344D94(sp1B, arg0); + func_80344E3C(sp1B, arg1); + func_80352CA0(sp1A, sp1C); + } +} + +s32 func_80352D9C(void) { + return (s32) ((randf() * 10.0) + 245.0); +} + +void func_80352DE4(void) { + u8 temp_s0; + struct54s *sp58; + u8 sp57; + ParticleStruct0s *temp_s1; + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + + temp_s0 = func_8033E8D0(); + sp58 = func_8033E8F4(); + sp57 = func_8033E93C(); + temp_s1 = func_8033E960(); + player_getPosition(sp44); + temp_s1->unk0 = 10.0f; + temp_s1->unk4 = 8.0f; + temp_s1->unk8 = 255.0f; + temp_s1->unkC = -11.0f; + projectile_setSprite(temp_s0, ASSET_70D_SPRITE_SMOKE_1); + func_8033FCD8(temp_s0, 0xC); + func_8033FC60(temp_s0, func_80352D9C(), func_80352D9C(), func_80352D9C()); + projectile_setPosition(temp_s0, sp44); + sp2C[0] = 0.0f; + sp2C[1] = 0.0f; + sp2C[2] = randf() * 359.0f; + func_8033FD98(temp_s0, sp2C); + func_80287E9C(sp58); + func_80287F7C(sp58, 1); + func_80287F50(sp58, &D_80372670, 0x28); + func_80287F10(sp58); + sp38[0] = 0.0f; + sp38[1] = 40.0f; + sp38[2] = 0.0f; + func_80344E18(sp57, 2); + func_80344E3C(sp57, sp38); + func_80344D94(sp57, sp44); + func_80352CA0(temp_s0, temp_s1); +} + +void func_80352F58(void){ + f32 *sp2C = func_8033E960(); + struct54s *sp28 = func_8033E8F4(); + u8 sp27 = func_8033E8D0(); + f32 sp20 = func_8033DDEC(); + if(func_80288034(sp28)){ + func_8033E984(); + } + else{ + sp2C[0] += sp2C[1]*sp20; + sp2C[2] = max_f(0.0f, sp2C[2] + sp2C[3]*sp20); + func_80352CA0(sp27, sp2C); + } +} + +void func_80352FF4(void){} + +void func_80352FFC(f32 arg0[3], f32 arg1, f32 arg2, f32 arg3){ + f32 sp1C[3]; + func_802589E4(sp1C, arg1, arg2); + sp1C[1] = arg3; + func_80352CF4(arg0, sp1C, randf2(380.0f, 250.0f), 4.0f); +} + +void func_80353064(f32 arg0[3], f32 arg1){ + f32 tmp_f22; + arg0[1] += arg1; + for(tmp_f22 = 0.0f; tmp_f22 < 359.0; tmp_f22 += 60.0){ + func_80352FFC(arg0, tmp_f22, 730.0f, 120.0f); + func_80352FFC(arg0, mlNormalizeAngle(tmp_f22 + 30.0f), 470.0f, 60.0f); + } + arg0[1] -= arg1; +} diff --git a/src/core2/code_CC1E0.c b/src/core2/code_CC1E0.c new file mode 100644 index 00000000..6f269b49 --- /dev/null +++ b/src/core2/code_CC1E0.c @@ -0,0 +1,376 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "code_B6EA0.h" + +extern void func_80244D94(f32[3], f32[3], f32[3], u32, f32); + +extern void func_80256E24(f32[3], f32, f32, f32, f32, f32); + +extern f32 func_8033EA14(s32); +extern void func_8033EA40(s32, f32); +extern void projectile_setSprite(u8, enum asset_e); +extern void func_8033FCD8(u8, s32); +extern void projectile_setPosition(u8, f32[3]); +extern void projectile_getPosition(u8, f32[3]); +extern void func_8033FFE4(u8, s32, s32); +extern void func_80344E18(u8, s32); +extern void func_80344E3C(u8, f32[3]); +extern void func_80344EE4(u8, f32, f32); +extern void func_80354030(f32[3], f32); +extern bool func_80344EC0(u8); +extern ActorMarker *func_8033E840(void); +extern ActorProp *func_80320EB0(ActorMarker *, f32, s32); + + +void fxegg_collide(s32 arg0, ActorMarker *arg1, s32 arg2); + +/* .data */ +extern struct53s D_803726A0; + +/* .rodata */ +extern f32 D_80379430; +extern f32 D_80379434; +extern f32 D_80379438; +extern f64 D_80379440; +extern f64 D_80379448; + +/* .code */ +void fxegg_shatter(u8 projectile_indx){ + f32 position[3]; + projectile_getPosition(projectile_indx, position); + func_8030EBC8(SFX_D_EGGSHELL_BREAKING, 1.6f, 1.7f, 13000, 13000); + eggShatter_new(position); +} + +s32 func_803531C8(u8 projectile_indx, s32 arg1){ + ActorProp *prop; + f32 sp40[3]; + ActorMarker * marker; + ActorMarker * other_marker; + s32 sp34; + f32 temp_f2; + Actor *other_actor; + s32 pad; + s32 sp20; + + + marker = func_8033E840(); + sp34 = 0; + projectile_getPosition(projectile_indx, sp40); + marker->unk38[1] = 0x1E; + prop = func_80320EB0(marker, 30.0f, 1); + if(prop != NULL && prop->unk8_0){ + other_marker = prop->marker; + sp34 =other_marker->unk14_20; + if(!func_8033D410(marker, other_marker)){ + switch(sp34){ + case MARKER_FC_CROCTUS: //L803532C4 + other_actor = marker_getActor(other_marker); + if(other_actor->unk38_31 == 0){ + temp_f2 = animctrl_getAnimTimer(other_actor->animctrl); + if(0.25 <= temp_f2 && temp_f2 <= 0.75){ + other_actor->unk38_31 = 1; + } + func_8033E984(); + fxegg_shatter(projectile_indx); + } + break; + + case MARKER_33_LEAKY: //L80353350 + if(func_802458A8(sp40, other_marker, 0x32) && func_80389364(other_marker)){ + func_8033E984(); + } + break; + + case MARKER_4C_CLANKER_TOKEN_TOOTH_EXT: //L80353384 + func_8033E984(); + func_803870EC(1); + break; + + case 0x1ae: //L8035339C //zubba? + func_8033E984(); + fxegg_shatter(projectile_indx); + break; + + case MARKER_4D_CLANKER_JIGGY_TOOTH_EXT: //L803533B4 + func_8033E984(); + func_803870EC(2); + break; + + case MARKER_182_RBB_EGG_TOLL: //L803533CC + func_8033E984(); + func_8038685C(other_marker); + break; + + case 0xbb: //L803533E4 //"BIG_JINXYHEAD" + other_actor = marker_getActor(other_marker); + *(s32 *)&other_actor->local = 1; + func_8033E984(); + break; + + case MARKER_34_CEMETARY_POT: //L80353400 + if(func_802458A8(sp40, other_marker, 0x3C) && func_80387340(other_marker)){ + func_8033E984(); + } + break; + + case MARKER_AB_RUBEES_EGG_POT: //L80353434 + if(func_802458A8(sp40, other_marker, 0x1E) && (func_8038E178() < func_8038E184())){ + func_8033E984(); + func_8038E140(); + } + break; + + case 0xae: //L80353480 //big_jynxy_head + if(func_8038E344(other_marker)){ + func_8033E984(); + func_8038E2FC(other_marker); + } + break; + } + func_8032B258(marker_getActor(other_marker), COLLISION_0_TOUCH); + } + } + return sp34; +} + +bool fxegg_isCollidingWithPlayer(f32 arg0[3]){ + f32 sp2C[3]; + f32 sp20[3]; + + player_getPosition(sp2C); + ml_vec3f_diff_copy(sp20, sp2C, arg0); + return (sp2C[1] < arg0[1]) && (arg0[1] < sp2C[1] + 100.0f) + && (sp20[0]*sp20[0] + sp20[2]*sp20[2] < D_80379430); +} + +void func_80353580(ActorMarker *marker){ + func_8033E9A8(marker->unk28); +} + +void fxegg_head_spawn(void){ + u8 projectile_indx = func_8033E8D0(); + struct54s *sp78 = func_8033E8F4(); + u8 sp77 = func_8033E93C(); + f32 sp68[3]; + f32 sp5C[3]; + f32 sp50[3]; + f32 sp44[3]; + f32 other_marker[3]; + ActorMarker *marker = func_8033E840(); + f32 tmp_f8 = 20.0f; + + marker->unk2C_1 = 1; + marker->collidable = 1; + func_803300B8(marker, fxegg_collide); + func_8033EA40(0, 20.0f); + func_8033EA40(1, 0.0f); + func_8033EA40(2, 0.0f); + _player_getPosition(sp50); + sp50[1] += 80.0f; + ml_vec3f_copy(sp68, sp50); + player_getRotation(sp44); + func_80256E24(sp5C, 0.0f, sp44[1], 0.0f, 0.0f, 70.0f); + sp50[0] += sp5C[0]; + sp50[1] += sp5C[1]; + sp50[2] += sp5C[2]; + func_80244D94(sp68, sp50, other_marker, 0x25e0080, 15.0f); + + projectile_setSprite(projectile_indx, ASSET_708_SPRITE_EGG_PROJECTILE); + func_8033FFE4(projectile_indx, (s32)tmp_f8, (s32)tmp_f8); + projectile_setPosition(projectile_indx, sp50); + func_8033FCD8(projectile_indx, 0xe); + + func_80287E9C(sp78); + func_80287F50(sp78, &D_803726A0, 0x14); + func_80287F10(sp78); + + func_80344E18(sp77, 1); + func_80344EE4(sp77, 0.0f, 0.0f); + func_80344D94(sp77, sp50); + sp44[1] += 4.0; + func_80256E24(sp5C, 0.0f, sp44[1], 0.0f, 0.0f, 800.0f); + sp5C[1] = 0.0f; + func_80344E3C(sp77, sp5C); +} + +void fxegg_head_update(void){ + u8 projectile_indx; + u8 sp96; + f32 sp88[3]; + f32 sp7C[3]; + f32 sp78; + f32 tmp_f24; + ActorMarker *s0; + f32 sp6C; + f32 sp60[3]; + f32 sp54[3]; + f32 tmp_f20; + + projectile_indx = func_8033E8D0(); + sp96 = func_8033E93C(); + sp78 = func_8033EA14(1); + tmp_f24 = func_8033EA14(2); + tmp_f24 -= time_getDelta(); + sp6C = ml_map_f(sp78, 0.0f, 2.0f, 0.0333f, D_80379434); + while(tmp_f24 <= 0.0f){//L80353868 + tmp_f24 += sp6C; + projectile_getPosition(projectile_indx, sp7C); + func_8033E9D4(); + sp7C[0] += randf2(-8.0f, 8.0f); + sp7C[1] += randf2(-8.0f, 8.0f); + sp7C[2] += randf2(-8.0f, 8.0f); + if(randf() < 0.5){ + func_803541C0(1); + } + else{ + func_803541C0(6); + } + func_803541CC(0x32); + func_80354030(sp7C, 0.15f); + func_8033E9F4(); + }//L80353930 + func_8033EA40(2, tmp_f24); + func_803531C8(projectile_indx, 0); + func_80344E7C(sp96, sp88); + if(func_802582EC(sp88)){ + s0 = func_8033E840(); + projectile_getPosition(projectile_indx, sp60); + sp54[0] = (f32)s0->propPtr->x; + sp54[1] = (f32)s0->propPtr->y; + sp54[2] = (f32)s0->propPtr->z; + func_8033E984(); + fxegg_shatter(projectile_indx); + }//L803539D4 + func_80344E3C(sp96, sp88); + tmp_f20 = func_8033EA14(0); + func_8033FFE4(projectile_indx, (s32) tmp_f20, (s32) tmp_f20); + func_8033EA40(0, min_f(tmp_f20 + 4.0f, 50.0f)); + sp78 += time_getDelta(); + func_8033EA40(1, sp78); + if(2.0 < sp78){ + func_8033E984(); + } +} + +void fxegg_head_destroy(void){} + +void fxegg_ass_spawn(void) { + u8 projectile_indx; + struct54s *sp58; + u8 sp57; + f32 sp48[3]; + f32 marker[3]; + f32 sp30[3]; + f32 temp_f2; + f32 temp_f18; + + projectile_indx = func_8033E8D0(); + sp58 = func_8033E8F4(); + sp57 = func_8033E93C(); + func_8033E840()->unk2C_1 = TRUE; + func_8033E840()->collidable = TRUE; + func_803300B8(func_8033E840(), &fxegg_collide); + func_8033EA40(1, 0); + func_8033EA40(0, 20.0f); + func_8033EA40(2, 0); + _player_getPosition(marker); + player_getRotation(sp30); + sp30[1] = mlNormalizeAngle(sp30[1] + 180.0f); + func_80256E24(sp48, 0.0f, sp30[1], 0.0f, 0.0f, -18.0f); + marker[0] += sp48[0]; + marker[1] += sp48[1]; + marker[2] += sp48[2]; + marker[1] += 60.0f; + projectile_setSprite(projectile_indx, ASSET_708_SPRITE_EGG_PROJECTILE); + temp_f18 = 20.0f; + func_8033FFE4(projectile_indx, (s32)temp_f18, (s32)temp_f18); + projectile_setPosition(projectile_indx, marker); + func_8033FCD8(projectile_indx, 0xE); + func_80287E9C(sp58); + func_80287F50(sp58, &D_803726A0, 0x14); + func_80287F10(sp58); + func_80344E18(sp57, 4); + func_80344EE4(sp57, -2200.0f, -22000.0f); + func_80344D94(sp57, marker); + temp_f2 = ((randf() * 6.0f) - 3.0f); + sp30[1] = sp30[1] + temp_f2; + func_80256E24(sp48, 0.0f, sp30[1], 0, 0, 200.0f); + sp48[1] = (randf() * 20.0f) + 700.0f; + func_80344E3C(sp57, sp48); +} + +void fxegg_ass_update(void) { + u8 projectile_indx; + u8 sp8E; + f32 sp80[3]; + f32 sp74[3]; + f32 sp68[3]; + f32 sp64; + f32 temp_f20; + f32 temp_f2; + f32 sp58; + f32 var_f22; + + projectile_indx = func_8033E8D0(); + sp8E = func_8033E93C(); + sp64 = func_8033EA14(1); + var_f22 = func_8033EA14(2); + var_f22 -= time_getDelta(); + sp58 = ml_map_f(sp64, 0.0f, 3.0f, 0.0333f, D_80379438); + while (var_f22 <= 0.0f) { + var_f22 += sp58; + projectile_getPosition(projectile_indx, sp68); + func_8033E9D4(); + sp68[0] += randf2(-8.0f, 8.0f); + sp68[1] += randf2(-8.0f, 8.0f); + sp68[2] += randf2(-8.0f, 8.0f); + if (randf() < 0.5) { + func_803541C0(1); + } else { + func_803541C0(6); + } + func_803541CC(0x32); + func_80354030(sp68, 0.15); + func_8033E9F4(); + } + func_8033EA40(2, var_f22); + if (func_80344EC0(sp8E)) { + func_8032320C(); + } + func_803531C8(projectile_indx, 1); + func_80344E7C(sp8E, sp74); + if (D_80379440 < func_8033EA14(1)) { + projectile_getPosition(projectile_indx, sp80); + if (fxegg_isCollidingWithPlayer(sp80)) { + collect_egg(NULL); + func_8033E984(); + } + } + func_80344E3C(sp8E, sp74); + temp_f20 = func_8033EA14(0); + func_8033FFE4(projectile_indx, (s32)temp_f20, (s32)temp_f20); + func_8033EA40(0, min_f(temp_f20 + 8.0f, 50.0f)); + sp64 += time_getDelta(); + func_8033EA40(1, sp64); + if ((D_80379448 < sp64) && (func_80344EC0(sp8E) || (sp64 > 3.5))) { + func_8033E984(); + fxegg_shatter(projectile_indx); + } +} + +void fxegg_ass_destroy(void){} + +void fxegg_collide(s32 arg0, ActorMarker *marker, s32 arg2) { + Actor *actor; + + actor = marker_getActor(marker); + if (func_8033D5A4(arg2) != 0) { + func_8033E984(); + if (actor->modelCacheIndex != 0x29D) { + fxegg_shatter(func_8033E8D0()); + } + } +} diff --git a/src/core2/code_CD0A0.c b/src/core2/code_CD0A0.c new file mode 100644 index 00000000..6292006d --- /dev/null +++ b/src/core2/code_CD0A0.c @@ -0,0 +1,92 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "code_B6EA0.h" + +extern struct{ + s32 unk0; + s32 unk4; +} D_803863D0; + +void func_80354030(f32 position[3], f32 arg1){ + u8 sp1F; + u8 sp1E; + ParticleStruct0s *sp18; + + if(func_8033E3F0(0xb, 1) < 0) + return; + + sp1E = func_8033E8D0(); + sp1F = func_8033E93C(); + sp18 = func_8033E960(); + projectile_setPosition(sp1E, position); + func_80344D94(sp1F, position); + sp18->unk4 = arg1; + sp18->unk0 = 0.0f; +} + +void func_803540AC(void){} + +void func_803540B4(void){ + ParticleStruct0s *sp34; + u8 sp33; + struct54s *sp2C; + u8 sp2B; + f32 sp1C[3]; + + sp34 = func_8033E960(); + sp33 = func_8033E8D0(); + sp2C = func_8033E8F4(); + sp2B = func_8033E93C(); + sp34->unk20 = D_803863D0.unk4; + projectile_setSprite(sp33, D_803863D0.unk0 + 0x710); + func_8033FFE4(sp33, D_803863D0.unk4, D_803863D0.unk4); + func_8033FCD8(sp33, 0xC); + func_80287E9C(sp2C); + func_80287F7C(sp2C, 3); + sp1C[0] = randf2(-100.0f, 100.0f); + sp1C[1] = randf2(-100.0f, 100.0f); + sp1C[2] = randf2(-100.0f, 100.0f); + func_80344E18(sp2B, 5); + func_80344EE4(sp2B, -600.0f, -22000.0f); + func_80344E3C(sp2B, sp1C); +} + +void func_803541C0(s32 arg0){ + D_803863D0.unk0 = arg0; +} + +void func_803541CC(s32 arg0){ + D_803863D0.unk4 = arg0; +} + +void func_803541D8(void) { + ParticleStruct0s *sp44; + u8 sp43; + f32 temp_f20; + f32 temp_f22; + s32 temp_f10; + f32 sp30; + + sp44 = func_8033E960(); + sp43 = func_8033E8D0(); + temp_f22 = sp44->unk4; + temp_f20 = sp44->unk0; + sp30 = (f32) sp44->unk20; + func_8033FE2C(sp43, 8.0f); + temp_f10 = (s32) ml_map_f(temp_f20, 0.0f, temp_f22, sp30, 20.0f); + func_8033FFE4(sp43, temp_f10, temp_f10); + if ((f64) temp_f22 < 0.3) { + func_8033FC34(sp43, (s32) ml_map_f(temp_f20, 0.0f, temp_f22, 255.0f, 20.0f)); + } else if ((f64) temp_f20 < 0.1) { + func_8033FC34(sp43, (s32) ml_map_f(temp_f20, 0.0f, 0.1f, 20.0f, 255.0f)); + } else { + func_8033FC34(sp43, (s32) ml_map_f(temp_f20, 0.1f, temp_f22, 255.0f, 20.0f)); + } + temp_f20 += time_getDelta(); + sp44->unk0 = temp_f20; + if (temp_f22 < temp_f20) { + func_8033E984(); + } +} diff --git a/src/core2/code_CD3F0.c b/src/core2/code_CD3F0.c new file mode 100644 index 00000000..d7242d99 --- /dev/null +++ b/src/core2/code_CD3F0.c @@ -0,0 +1,82 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "code_B6EA0.h" + +extern f64 D_80379470; +extern f32 D_80379478; + +void func_80354380(f32 arg0[3], f32 arg1) { + u8 sp1F; + u8 sp1E; + ParticleStruct0s* sp18; + + if (func_8033E3F0(0xE, 1) >= 0) { + sp1E = func_8033E8D0(); + sp1F = func_8033E93C(); + sp18 = func_8033E960(); + projectile_setPosition(sp1E, arg0); + func_80344D94(sp1F, arg0); + sp18->unk4 = arg1; + } +} + +void func_803543F4(void){} + +void func_803543FC(void) { + ParticleStruct0s* sp3C; + u8 sp3B; + struct54s* sp34; + u8 sp33; + f32 sp24[3]; + s32 temp_f16; + + sp3C = func_8033E960(); + sp3B = func_8033E8D0(); + sp34 = func_8033E8F4(); + sp33 = func_8033E93C(); + temp_f16 = ((randf() * 20.0f) + 80.0f); + sp3C->unk0 = 0.0f; + sp3C->unk20 = temp_f16; + projectile_setSprite(sp3B, ASSET_710_SPRITE_SPARKLE_PURPLE); + func_8033FFE4(sp3B, temp_f16, temp_f16); + func_8033FCD8(sp3B, 0xC); + func_80287E9C(sp34); + func_80287F7C(sp34, 3); + sp24[0] = randf2(-100.0f, 100.0f); + sp24[1] = 250.0f; + sp24[2] = randf2(-100.0f, 100.0f); + func_80344E18(sp33, 5); + func_80344EE4(sp33, -800.0f, -22000.0f); + func_80344E3C(sp33, sp24); +} + +void func_8035451C(void) { + ParticleStruct0s* temp_s0; + u8 temp_v0; + f32 sp3c; + f32 sp38; + f32 temp_f20; + f32 sp30; + s32 temp_f16; + + temp_s0 = func_8033E960(); + temp_v0 = func_8033E8D0(); + sp38 = temp_s0->unk4; + temp_f20 = temp_s0->unk0; + sp30 = temp_s0->unk20; + func_8033FE2C(temp_v0, 9.0f); + temp_f16 = ml_map_f(temp_f20, 0.0f, sp38, sp30, 20.0f); + func_8033FFE4(temp_v0, temp_f16, temp_f16); + if (temp_f20 < D_80379470) { + func_8033FC34(temp_v0, ml_map_f(temp_f20, 0.0f, 0.1f, 20.0f, 210.0f)); + } else { + func_8033FC34(temp_v0, ml_map_f(temp_f20, D_80379478, sp38, 210.0f, 20.0f)); + } + temp_f20 += time_getDelta(); + temp_s0->unk0 = temp_f20; + if (sp38 < temp_f20) { + func_8033E984(); + } +} diff --git a/src/core2/code_CD6E0.c b/src/core2/code_CD6E0.c new file mode 100644 index 00000000..1ef7ad56 --- /dev/null +++ b/src/core2/code_CD6E0.c @@ -0,0 +1,477 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "code_B6EA0.h" + +extern f32 func_8028EBA4(void); +extern void projectile_getPosition(u8 arg0, f32 arg1[3]); +extern void func_8033FC98(u8 arg0, s32 arg1); + +extern u8 D_803726D4[]; +extern f32 D_803726EC; +extern f64 D_80379480; + +void func_80354670(u8 arg0, s32 arg1) { + func_8033FFE4(arg0, D_803726D4[arg1], D_803726D4[arg1]); + func_8033FC34(arg0, ml_map_f(arg1, 0.0f, 8.0f, 40.0f, 255.0f)); +} + +void func_803546E8(void) { + u8 sp4F; + struct54s* sp48; + u8 sp47; + ParticleStruct0s* temp_s0; + f32 sp34[3]; + f32 sp28[3]; + + sp4F = func_8033E8D0(); + sp48 = func_8033E8F4(); + sp47 = func_8033E93C(); + temp_s0 = func_8033E960(); + player_getPosition(sp34); + temp_s0->unk0 = randf2(-10.0f, 10.0f); + temp_s0->unk4 = (randf() * 35.0f) + 50.0f; + temp_s0->unk8 = randf2(-10.0f, 10.0f); + func_802589E4(sp28, func_8028EBA4(), 48.0f); + sp28[1] = 0.0f; + temp_s0->unk0 += sp28[0]; + temp_s0->unk4 += sp28[1]; + temp_s0->unk8 += sp28[2]; + projectile_setSprite(sp4F, ASSET_713_SPRITE_SPARKLE_YELLOW); + projectile_setPosition(sp4F, sp34); + func_8033FCD8(sp4F, 0xC); + func_80287E9C(sp48); + func_80287F7C(sp48, 3); + func_80344E18(sp47, 5); + func_80344EE4(sp47, -700.0f, -22000.0f); + func_802589E4(sp28, D_803726EC, 250.0f); + sp28[1] = 250.0f; + D_803726EC = mlNormalizeAngle((f32) ((f64) D_803726EC + D_80379480)); + func_80344E3C(sp47, sp28); + func_80344D94(sp47, sp34); + temp_s0->unk20 = 0x14; + func_80354670(sp4F, 0x14); +} + +void func_8035489C(void) { + ParticleStruct0s* temp_s0; + u8 temp_v0; + f32 playerVelocity[3]; + f32 playerPosition[3]; + + temp_s0 = func_8033E960(); + temp_v0 = func_8033E8D0(); + func_8033FE2C(temp_v0, 7.0f); + temp_s0->unk20--; + if (temp_s0->unk20 < 0) { + func_8033E984(); + return; + } + func_80354670(temp_v0, temp_s0->unk20); + if (temp_s0->unk20 >= 0x10) { + player_getPosition(playerPosition); + player_getVelocity(playerVelocity); + playerVelocity[1] = 0.0f; + playerPosition[0] += playerVelocity[0] * time_getDelta(); + playerPosition[2] += playerVelocity[2] * time_getDelta(); + playerPosition[0] += temp_s0->unk0; + playerPosition[1] += temp_s0->unk4; + playerPosition[2] += temp_s0->unk8; + projectile_setPosition(temp_v0, playerPosition); + } +} + +void func_80354990(void){} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_CD6E0/func_80354998.s") + +void func_80354C18(void) { + ParticleStruct0s* temp_s0; + s32 pad; + ActorMarker *sp4C; + u8 sp4B; + FuncUnk40 sp44; + s32 sp40; + f32 sp34[3]; + f32 sp28[3]; + u8 temp_s1; + + temp_s0 = func_8033E960(); + temp_s1 = func_8033E8D0(); + sp4C = func_8033E864(); + sp4B = func_8033E93C(); + sp44 = func_8033E888(); + sp40 = func_8033E8AC(); + func_8033FE2C(temp_s1, 7.0f); + temp_s0->unk20--; + if (temp_s0->unk20 < 0) { + func_8033E984(); + } else { + func_80354670(temp_s1, temp_s0->unk20); + if (temp_s0->unk20 >= 0x10) { + if (sp44(sp4C, sp40, sp34) != 0) { + func_8033FC98(temp_s1, 0); + } else { + func_8033FC98(temp_s1, 1); + } + } else { + projectile_getPosition(temp_s1, sp34); + } + func_80344E7C(sp4B, sp28); + sp28[0] += temp_s0->unkC; + sp28[1] += temp_s0->unk10; + sp28[2] += temp_s0->unk14; + func_80344E3C(sp4B, sp28); + temp_s0->unk0 += sp28[0]; + temp_s0->unk4 += sp28[1]; + temp_s0->unk8 += sp28[2]; + sp34[0] += temp_s0->unk0; + sp34[1] += temp_s0->unk4; + sp34[2] += temp_s0->unk8; + projectile_setPosition(temp_s1, sp34); + } + func_8033FC34(temp_s1, 0xB4); + func_8033FCD8(temp_s1, 0xC); +} + +void func_80354DC8(void){} + +void func_80354DD0(void) { + ParticleStruct0s* temp_s0; + struct54s* sp40; + u8 sp3F; + u8 pad3C[3]; + u8 temp_s1; + f32 sp2C[3]; + f32 sp20[3]; + + temp_s1 = func_8033E8D0(); + sp40 = func_8033E8F4(); + sp3F = func_8033E93C(); + temp_s0 = func_8033E960(); + ml_vec3f_clear(sp2C); + temp_s0->unk0 = randf2(-50.0f, 50.0f); + temp_s0->unk4 = randf2(-65.0f, -65.0f); + temp_s0->unk8 = randf2(-50.0f, 50.0f); + projectile_setSprite(temp_s1, ASSET_710_SPRITE_SPARKLE_PURPLE); + func_8033FC60(temp_s1, 0xE1, 0xFF, 0); + projectile_setPosition(temp_s1, sp2C); + func_80287E9C(sp40); + func_80287F7C(sp40, 3); + func_80344E18(sp3F, 3); + sp20[0] = 0.0f; + sp20[1] = 0.0f; + sp20[2] = 0.0f; + func_80344E3C(sp3F, sp20); + func_80344D94(sp3F, sp2C); + temp_s0->unk20 = 0x14; + func_80354670(temp_s1, 0x14); +} + +void func_80354EEC(void) { + ParticleStruct0s* temp_s0; + s32 pad; + ActorMarker *sp3C; + FuncUnk40 sp38; + s32 sp34; + f32 sp28[3]; + u8 temp_s1; + + temp_s0 = func_8033E960(); + temp_s1 = func_8033E8D0(); + sp3C = func_8033E864(); + sp38 = func_8033E888(); + sp34 = func_8033E8AC(); + temp_s0->unk20--; + if (temp_s0->unk20 < 0) { + func_8033E984(); + } else { + func_80354670(temp_s1, temp_s0->unk20); + if (temp_s0->unk20 >= 0x10) { + if (sp38(sp3C, sp34, sp28) != 0) { + func_8033FC98(temp_s1, 0); + } else { + func_8033FC98(temp_s1, 1); + } + sp28[0] += temp_s0->unk0; + sp28[1] += temp_s0->unk4; + sp28[2] += temp_s0->unk8; + projectile_setPosition(temp_s1, sp28); + } + } + func_8033FC34(temp_s1, 0xBE); + func_8033FCD8(temp_s1, 0xC); +} + +void func_80355004(void){} + +void func_8035500C(void) { + u8 sp47; + struct54s* sp40; + u8 sp3F; + ParticleStruct0s* temp_s0; + f32 sp2C[3]; + f32 sp20[3]; + + sp47 = func_8033E8D0(); + sp40 = func_8033E8F4(); + sp3F = func_8033E93C(); + temp_s0 = func_8033E960(); + ml_vec3f_clear(sp2C); + temp_s0->unk0 = randf2(-40.0f, 40.0f); + temp_s0->unk4 = randf2(-40.0f, 40.0f); + temp_s0->unk8 = randf2(-40.0f, 40.0f); + projectile_setSprite(sp47, 0x70F); + func_8033FC60(sp47, 0xFF, 0xE6, 0xF5); + projectile_setPosition(sp47, sp2C); + func_80287E9C(sp40); + func_80287F7C(sp40, 3); + func_80287FB4(sp40, 0); //set frame + func_80344E18(sp3F, 3); + sp20[0] = 0.0f; + sp20[1] = 0.0f; + sp20[2] = 0.0f; + func_80344E3C(sp3F, sp20); + func_80344D94(sp3F, sp2C); + temp_s0->unk20 = 0x14; + func_80354670(sp47, 0x14); +} + +void func_80355134(void) { + ParticleStruct0s* temp_s0; + u8 temp_s1; + ActorMarker *sp3C; + FuncUnk40 sp38; + s32 sp34; + f32 sp28[3]; + + temp_s0 = func_8033E960(); + temp_s1 = func_8033E8D0(); + sp3C = func_8033E864(); + sp38 = func_8033E888(); + sp34 = func_8033E8AC(); + if ((func_8023DB5C() & 1) == 0) { + temp_s0->unk20--; + } + if (temp_s0->unk20 < 0) { + func_8033E984(); + } else { + func_80354670(temp_s1, temp_s0->unk20); + if (temp_s0->unk20 >= 0x13) { + sp38(sp3C, sp34, sp28); + temp_s0->unk4 -= time_getDelta() * 200.0f; + sp28[0] += temp_s0->unk0; + sp28[1] += temp_s0->unk4; + sp28[2] += temp_s0->unk8; + projectile_setPosition(temp_s1, sp28); + } else { + projectile_getPosition(temp_s1, sp28); + sp28[1] -= time_getDelta() * 200.0f; + projectile_setPosition(temp_s1, sp28); + } + } + func_8033FC34(temp_s1, 0xFF); + func_8033FCD8(temp_s1, 0xC); +} + +void func_80355294(void){} + +void func_8035529C(void) { + u8 sp4F; + struct54s* sp48; + u8 sp47; + ParticleStruct0s* sp40; + f32 sp34[3]; + f32 sp28[3]; + + sp4F = func_8033E8D0(); + sp48 = func_8033E8F4(); + sp47 = func_8033E93C(); + sp40 = func_8033E960(); + ml_vec3f_clear(sp34); + sp40->unk0 = randf2(-40.0f, 40.0f); + sp40->unk4 = 0.0f; + sp40->unk8 = randf2(-40.0f, 40.0f); + projectile_setSprite(sp4F, 0x70F); + func_8033FC60(sp4F, randi2(0xD2, 0xFF), randi2(0xBE, 0xFF), randi2(0xC8, 0xFF)); + projectile_setPosition(sp4F, sp34); + func_80287E9C(sp48); + func_80287F7C(sp48, 3); + func_80287FB4(sp48, 0); + func_80344E18(sp47, 3); + sp28[0] = 0.0f; + sp28[1] = 0.0f; + sp28[2] = 0.0f; + func_80344E3C(sp47, sp28); + func_80344D94(sp47, sp34); + sp40->unk20 = 0xE; + func_80354670(sp4F, 0xE); +} + +void func_803553E8(void) { + ParticleStruct0s* temp_s0; + u8 temp_s1; + ActorMarker *sp3C; + FuncUnk40 sp38; + s32 sp34; + f32 sp28[3]; + + temp_s0 = func_8033E960(); + temp_s1 = func_8033E8D0(); + sp3C = func_8033E864(); + sp38 = func_8033E888(); + sp34 = func_8033E8AC(); + if ((func_8023DB5C() & 1) == 0) { + temp_s0->unk20--; + } + if (temp_s0->unk20 < 0) { + func_8033E984(); + } else { + func_80354670(temp_s1, temp_s0->unk20); + if (temp_s0->unk20 >= 0xD) { + sp38(sp3C, sp34, sp28); + temp_s0->unk4 -= time_getDelta() * 40.0f; + sp28[0] += temp_s0->unk0; + sp28[1] += temp_s0->unk4; + sp28[2] += temp_s0->unk8; + projectile_setPosition(temp_s1, sp28); + } else { + projectile_getPosition(temp_s1, sp28); + sp28[1] -= time_getDelta() * 40.0f; + projectile_setPosition(temp_s1, sp28); + } + } + func_8033FC34(temp_s1, 0xFF); + func_8033FCD8(temp_s1, 0xC); +} + +void func_80355548(void){} + +//Static var not defined properly +#ifdef NON_MATCHING +void func_80355550(void) { + static s32 D_803863E0; + u8 sp3F; + struct54s *sp38; + u8 sp37; + ParticleStruct0s *sp30; + f32 sp24[3]; + f32 sp18[3]; + + sp3F = func_8033E8D0(); + sp38 = func_8033E8F4(); + sp37 = func_8033E93C(); + sp30 = func_8033E960(); + ml_vec3f_clear(sp24); + sp30->unk0 = randf2(-30.0f, 30.0f); + sp30->unk4 = randf2(-30.0f, 30.0f); + sp30->unk8 = randf2(-30.0f, 30.0f); + if ((f64) randf() < 0.25) { + projectile_setSprite(sp3F, ASSET_711_SPRITE_SPARKLE_DARK_BLUE); + } else if ((f64) randf() < 0.5) { + projectile_setSprite(sp3F, ASSET_716_SPRITE_SPARKLE_WHITE); + } else { + projectile_setSprite(sp3F, ASSET_710_SPRITE_SPARKLE_PURPLE); + } + func_8033FC60(sp3F, 0xFF, 0xFF, 0xFF); + projectile_setPosition(sp3F, sp24); + func_80287E9C(sp38); + func_80287F7C(sp38, 3); + func_80287FB4(sp38, 0); + if (D_803863E0 >= 4) { + D_803863E0 = 0; + } + func_80344E18(sp37, 3); + sp18[0] = 0.0f; + sp18[1] = 0.0f; + sp18[2] = 0.0f; + func_80344E3C(sp37, sp18); + func_80344D94(sp37, sp24); + sp30->unk20 = 0x14; + func_80354670(sp3F, 0x14); +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_CD6E0/func_80355550.s") +#endif + +void func_8035570C(void) { + ParticleStruct0s* temp_s0; + u8 temp_s1; + ActorMarker *sp3C; + FuncUnk40 sp38; + s32 sp34; + f32 sp28[3]; + + temp_s0 = func_8033E960(); + temp_s1 = func_8033E8D0(); + sp3C = func_8033E864(); + sp38 = func_8033E888(); + sp34 = func_8033E8AC(); + temp_s0->unk20--; + if (temp_s0->unk20 < 0) { + func_8033E984(); + } else { + func_80354670(temp_s1, temp_s0->unk20); + if (temp_s0->unk20 >= 0x13) { + sp38(sp3C, sp34, sp28); + temp_s0->unk4 -= time_getDelta() * 80.0f; + sp28[0] += temp_s0->unk0; + sp28[1] += temp_s0->unk4; + sp28[2] += temp_s0->unk8; + projectile_setPosition(temp_s1, sp28); + } else { + projectile_getPosition(temp_s1, sp28); + sp28[1] -= time_getDelta() * 200.0f; + projectile_setPosition(temp_s1, sp28); + } + } + func_8033FC34(temp_s1, 0xFF); + func_8033FCD8(temp_s1, 0xC); +} + +void func_8035585C(void){} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_CD6E0/func_80355864.s") + +void func_80355B00(void) { + ParticleStruct0s *sp44; + u8 sp43; + ActorMarker *pad40; + Actor *sp38; + f32 *sp34; + f32 sp28[3]; + + sp44 = func_8033E960(); + sp43 = func_8033E8D0(); + pad40 = func_8033E864(); + sp38 = marker_getActor(pad40); + sp34 = func_802C9C0C(sp38); + func_8033FE2C(sp43, 7.0f); + sp28[0] = sp38->position[0]; + sp28[1] = sp38->position[1]; + sp28[2] = sp38->position[2]; + if (sp44->unk28 > 0) { + sp44->unk20 = (s32) (sp44->unk20 - 1); + } + if (sp44->unk24 != 0) { + sp44->unk28 = (s32) -sp44->unk28; + } + + if (sp44->unk20 < 0) { + func_8033E984(); + return; + } + func_80354670(sp43, sp44->unk20); + if (sp44->unk20 >= 0x10) { + sp28[0] += sp34[0] * time_getDelta(); + sp28[2] += sp34[2] * time_getDelta(); + + sp28[0] += sp44->unk0; + sp28[1] += sp44->unk4; + sp28[2] += sp44->unk8; + projectile_setPosition(sp43, sp28); + } +} + +void func_80355C4C(void){} diff --git a/src/core2/code_CECD0.c b/src/core2/code_CECD0.c new file mode 100644 index 00000000..bb59d7b9 --- /dev/null +++ b/src/core2/code_CECD0.c @@ -0,0 +1,99 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "code_B6EA0.h" + +typedef struct { + s32 unk0;//asset_id + s32 unk4; +} Struct_Core2_CECD0_0; + +/* .data */ +extern Struct_Core2_CECD0_0 D_803726F0; + +/* .code */ +void func_80355C60(f32 arg0[3], f32 arg1){ + u8 sp2F; + u8 sp2E; + ParticleStruct0s *sp28; + f32 sp1C[3]; + + if(func_8033E3F0(0x10, 1) < 0) + return; + + sp2E = func_8033E8D0(); + sp2F = func_8033E93C(); + sp28 = func_8033E960(); + + sp1C[0] = arg0[0] + randf2(-30.0f, 30.0f); + sp1C[1] = arg0[1] + randf2(0.0f, 30.0f) + 25.0f; + sp1C[2] = arg0[2] + randf2(-30.0f, 30.0f); + projectile_setPosition(sp2E, sp1C); + func_80344D94(sp2F, sp1C); + sp28->unk4 = arg1; + sp28->unk0 = 0.0f; +} + +void func_80355D50(void){} + +void func_80355D58(void){ + ParticleStruct0s * sp3C; + u8 sp3B; + struct54s *sp34; + u8 temp_s0; + f32 sp24[3]; + + sp3C = func_8033E960(); + sp3B = func_8033E8D0(); + sp34 = func_8033E8F4(); + temp_s0 = func_8033E93C(); + sp3C->unk20 = D_803726F0.unk4; + projectile_setSprite(sp3B, D_803726F0.unk0 + ASSET_710_SPRITE_SPARKLE_PURPLE); + func_8033FFE4(sp3B, D_803726F0.unk4, D_803726F0.unk4); + func_8033FCD8(sp3B, 0xC); + func_80287E9C(sp34); + func_80287F7C(sp34, 3); + + sp24[0] = randf2(-40.0f, 40.0f); + sp24[1] = randf2(-40.0f, 40.0f); + sp24[2] = randf2(-40.0f, 40.0f); + func_80344E18(temp_s0, 3); + func_80344E18(temp_s0, 2); + func_80344E18(temp_s0, 5); + func_80344EE4(temp_s0, -200.0f, -22000.0f); + func_80344E3C(temp_s0, sp24); +} + +void func_80355E80(void){ + ParticleStruct0s *sp44; + u8 sp43; + f32 f22; + f32 f20; + s32 temp_a1; + f32 sp30; + + sp44 = func_8033E960(); + sp43 = func_8033E8D0(); + f20 = sp44->unk0;\ + f22 = sp44->unk4;\ + sp30 = (f32)sp44->unk20; + func_8033FE2C(sp43, 8.0f); + temp_a1 = (s32) ml_map_f(f20, 0.0f, f22, sp30, 20.0f); + func_8033FFE4(sp43, temp_a1, temp_a1); + + if(f22 < 0.3){ + func_8033FC34(sp43, (s32)ml_map_f(f20, 0.0f, f22, 255.0f, 20.0f)); + } + else if(f20 < 0.1){ + func_8033FC34(sp43, (s32)ml_map_f(f20, 0.0f, 0.1f, 20.0f, 255.0f)); + }else{ + func_8033FC34(sp43, (s32)ml_map_f(f20, 0.1f, f22, 255.0f, 20.0f)); + } + + f20 += time_getDelta(); + sp44->unk0 = f20; + if(f22 < sp44->unk0){ + func_8033E984(); + } +} diff --git a/src/core2/code_CF090.c b/src/core2/code_CF090.c new file mode 100644 index 00000000..1b7a2dc5 --- /dev/null +++ b/src/core2/code_CF090.c @@ -0,0 +1,94 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "code_B6EA0.h" + +/* .data */ +extern struct53s *D_80372700; + +/* .code */ +void func_80356020(u8 arg0, f32 arg1[4]){ + func_8033FFE4(arg0, (s32)arg1[0], (s32)arg1[0]); + func_8033FC34(arg0, (s32)arg1[2]); +} + +void func_80356074(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3){ + ParticleStruct0s *sp1C; + u8 sp1B; + u8 sp1A; + + if(func_8033E3F0(6, 1) < 0) + return; + + sp1A = func_8033E8D0(); + sp1B = func_8033E93C(); + sp1C = func_8033E960(); + sp1C->unk0 = arg2; + sp1C->unk4 = (arg3 - sp1C->unk0)/20.0f; + projectile_setPosition(sp1A, arg0); + func_80344D94(sp1B, arg0); + func_80344E3C(sp1B, arg1); + func_80356020(sp1A, sp1C); +} + +void func_8035611C(void){ + u8 temp_s0; + struct54s *sp58; + u8 sp57; + ParticleStruct0s *sp54; + f32 sp44[3]; + f32 sp38[3]; + f32 sp2C[3]; + + temp_s0 = (u8)func_8033E8D0(); + sp58 = func_8033E8F4(); + sp57 = func_8033E93C(); + sp54 = func_8033E960(); + player_getPosition(sp44); + sp54->unk0 = 10.0f; + sp54->unk4 = 8.0f; + sp54->unk8 = 255.0f; + sp54->unkC = -6.0f; + projectile_setSprite(temp_s0, ASSET_70D_SPRITE_SMOKE_1); + func_8033FCD8(temp_s0, 5); + + func_8033FC60(temp_s0, (s32)(randf()*30.0f + 60.0f) ,(s32)(randf()*20.0f + 210.0f), (s32)(randf()*30.0f + 140.0f)); + projectile_setPosition(temp_s0, sp44); + sp2C[0] = 0.0f; + sp2C[1] = 0.0f; + sp2C[2] = randf()*359.0f; + func_8033FD98(temp_s0, sp2C); + func_80287E9C(sp58); + func_80287F7C(sp58, 1); + func_80287F50(sp58, &D_80372700, 0x28); + func_80287F10(sp58); + + sp38[0] = 0.0f; + sp38[1] = 40.0f; + sp38[2] = 0.0f; + func_80344E18(sp57, 2); + func_80344E3C(sp57, sp38); + func_80344D94(sp57, sp44); + func_80356020(temp_s0, sp54); +} + +void func_803562E8(void){ + ParticleStruct0s *sp24; + struct54s *sp20; + u8 sp1F; + + sp24 = func_8033E960(); + sp20 = func_8033E8F4(); + sp1F = func_8033E8D0(); + if(func_80288034(sp20)){ + func_8033E984(); + } + else{ + sp24->unk0 += sp24->unk4; + sp24->unk8 += sp24->unkC; + func_80356020(sp1F, sp24); + } +} + +void func_80356364(void){} diff --git a/src/core2/code_CF3E0.c b/src/core2/code_CF3E0.c new file mode 100644 index 00000000..cff7c543 --- /dev/null +++ b/src/core2/code_CF3E0.c @@ -0,0 +1,160 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + s16 a; + s16 b; +} unkD_80372730; +// Needs to be a struct to match, s16 array doesn't work +extern unkD_80372730 D_80372730[]; +extern unkD_80372730 D_80372798[]; + +s32 func_80356370(unkD_80372730 *arg0, s32 arg1) { + s32 phi_v1 = 0; + + while (arg0[phi_v1].a >= 0) { + if (arg1 == arg0[phi_v1].a) { + return phi_v1; + } + phi_v1++; + } + return -1; +} + +s32 func_803563B8(s32 arg0, s32 arg1) { + s32 temp_v0; + + if (func_8031FF1C(arg0) != 0) { + return 0; + } else { + temp_v0 = func_80356370(D_80372730, arg0); + if (temp_v0 != -1) { + if (func_80311480(D_80372730[temp_v0].b, arg1, 0, 0, 0, 0) != 0) { + func_80320004(arg0, 1); + } + return func_8031FF1C(arg0); + } + return 0; + } +} + +void func_8035644C(s32 arg0){ + func_803563B8(arg0, 0); +} + +void func_8035646C(s32 arg0) { + func_803563B8(arg0, 4); +} + +s32 func_8035648C(s32 arg0, s32 arg1) { + s32 temp_v0; + + if (func_803203FC() != 0) { + return 0; + } else { + temp_v0 = func_80356370(D_80372798, arg0); + if (temp_v0 != -1) { + if (func_80311480(D_80372798[temp_v0].b, arg1, 0, 0, 0, 0) != 0) { + func_803204E4(arg0, 1); + } + return func_803203FC(arg0); + } + return 0; + } +} + +void func_80356520(s32 arg0) { + func_8035648C(arg0, 0); +} + +void func_80356540(s32 arg0) { + func_8035648C(arg0, 4); +} + +void func_80356560(s32 arg0) { + func_8035648C(arg0, 0xE); +} + +//THIS VALUE +#ifndef CORE2_CODE_CRC2 + #define CORE2_CODE_CRC2 0 +#endif + +// bk_boot segment start (skipping entry function) +extern u8 D_00001050[]; +// bk_boot segment end +extern u8 D_00005E70[]; + +// bk_boot segment crc next word +s32 D_803727F0 = 0; +s32 D_803727F4 = CORE2_CODE_CRC2; +s32 D_803727F8 = 0; +s32 D_803727FC = 0; + +// bk_boot segment crc values +s32 D_80372800 = 0; +s32 D_80372804 = 0; + +// bk_boot segment crc remaining words +s32 D_80372808 = 0; + +// init bk_boot crc +void func_80356580(void) { + D_803727FC = (s32) D_00001050; + D_80372800 = 0; + D_80372804 = -1; + D_80372808 = (s32) (D_00005E70 - D_00001050); +} + +// advance bk_boot crc by one word +s32 func_803565BC(void) { + u32 crc1; + u32 crc2; + u8 romBytes[4]; + u8 curByte; + + if (D_803727FC != 0) { + if (D_80372808 != 0) { + crc1 = D_80372800; + crc2 = D_80372804; + osPiReadIo(D_803727FC, (u32*)romBytes); + curByte = romBytes[0]; + crc1 += curByte; + crc2 ^= curByte << (crc1 & 0x17); + curByte = romBytes[1]; + crc1 += curByte; + crc2 ^= curByte << (crc1 & 0x17); + curByte = romBytes[2]; + crc1 += curByte; + crc2 ^= curByte << (crc1 & 0x17); + curByte = romBytes[3]; + crc1 += curByte; + crc2 ^= curByte << (crc1 & 0x17); + D_80372800 = crc1; + D_80372804 = crc2; + D_803727FC = D_803727FC + 4; + D_80372808 = D_80372808 - 4; + } else { + D_803727FC = 0; + osPiReadIo((u32)D_00005E70 + 0, &crc1); + if (crc1 != D_80372800) + return 0; + osPiReadIo((u32)D_00005E70 + 4, &crc2); + if (crc2 != D_80372804) + return 0; + } + } + return 1; +} + +void func_80356714(void) { + func_80356580(); +} + +void func_80356734(void) { + func_803565BC(); + if (func_803565BC() == 0) { + func_80295864(0x10); + } +} diff --git a/src/core2/code_D0CA0.c b/src/core2/code_D0CA0.c new file mode 100644 index 00000000..e82dacf5 --- /dev/null +++ b/src/core2/code_D0CA0.c @@ -0,0 +1,540 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80335A8C(Struct80s *, s32); +extern f32 func_8025715C(f32, f32); +extern f32 func_802575BC(f32); +extern void func_80255FE4(f32[3], f32[3], f32[3], f32); +extern bool func_80320DB0(f32[3], f32, f32[3], u32); +/* .h */ +Actor *func_80358344(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80358684(Actor *this); + +typedef struct { + u8 unk0; + // u8 pad1[0x3]; + f32 unk4; + f32 unk8[3]; + f32 unk14; + f32 unk18[3]; + f32 unk24; + f32 unk28; + f32 unk2C; + s16 unk30[3]; + s16 unk36; + u8 unk38; + u8 unk39; +}ActorLocal_core2_D0CA0; + +/* .data */ +extern ActorInfo D_803728A0 = { + 0x253, ACTOR_380_SCARAB_BEETLE, ASSET_51B_MODEL_SCARAB_BEETLE, + 0, NULL, + func_80358684, NULL, func_80358344, + 0, 0, 1.0f, 0 +}; + +extern struct31s D_803728C4; +extern struct43s D_803728EC; + +/* .rodata */ +extern f64 D_80379600; +extern f32 D_80379608; +extern f32 D_8037960C; +extern f32 D_80379610; +extern f32 D_80379614; +extern f32 D_80379618; +extern f32 D_8037961C; +extern f64 D_80379620; +extern f64 D_80379628; +extern f32 D_80379630; +extern f32 D_80379634; +extern f32 D_80379638; +extern f64 D_80379640; +extern f64 D_80379648; +extern f64 D_80379650; +extern f64 D_80379658; +extern f64 D_80379660; +extern f64 D_80379668; +extern f32 D_80379670; +extern f32 D_80379674; + +/* .code */ +bool func_80357C30(Actor *this) { + ActorLocal_core2_D0CA0 *local; + f32 pad; + f32 sp2C[3]; + f32 sp20[3]; + + local = (ActorLocal_core2_D0CA0 *)&this->local; + if (!this->marker->unk14_21) { + return TRUE; + } + func_80255FE4(sp20, local->unk8, local->unk18, func_802575BC(local->unk4 + D_80379600)); + sp20[1] += 60.0f; + return !func_80320DB0(sp20, 50.0f, sp2C, 0); +} + +void func_80357CD0(Actor *this, f32 arg1[3]) { + ActorLocal_core2_D0CA0 *local; + f32 var_f2; + f32 sp1C[3]; + + local = (ActorLocal_core2_D0CA0 *)&this->local; + local->unk39 = 2; + local->unk4 = 0.0f; + local->unk8[0] = this->position[0];\ + local->unk8[1] = this->position[1];\ + local->unk8[2] = this->position[2]; + local->unk18[0] = arg1[0]; + local->unk18[1] = arg1[1]; + local->unk18[2] = arg1[2]; + local->unk14 = this->yaw; + local->unk14 = (local->unk14 >= 360.0f) ? local->unk14 - 360.0f : local->unk14; + local->unk14 = (local->unk14 <= -360.0f) ? local->unk14 + 360.0f : local->unk14; + local->unk24 = local->unk14; + sp1C[0] = local->unk18[0] - local->unk8[0]; + sp1C[1] = local->unk18[1] - local->unk8[1]; + sp1C[2] = local->unk18[2] - local->unk8[2]; + var_f2 = func_8025715C(sp1C[0], sp1C[2]); + if ((var_f2 - local->unk14) > 180.0f) { + var_f2 -= 360.0f; + } + if ((var_f2 - local->unk14) < -180.0f) { + var_f2 += 360.0f; + } + local->unk24 = var_f2; +} + +void func_80357E34(Actor *this, f32 arg1[3]) { + f32 temp_f12; + f32 var_f2; + f32 sp1C[3]; + ActorLocal_core2_D0CA0 *local; + + local = (ActorLocal_core2_D0CA0 *)&this->local; + local->unk18[0] = arg1[0]; + local->unk18[1] = arg1[1]; + local->unk18[2] = arg1[2]; + sp1C[0] = local->unk18[0] - local->unk8[0]; + sp1C[1] = local->unk18[1] - local->unk8[1]; + sp1C[2] = local->unk18[2] - local->unk8[2]; + var_f2 = func_8025715C(sp1C[0], sp1C[2]); + temp_f12 = var_f2 - local->unk14; + if (temp_f12 > 180.0f) { + var_f2 -= 360.0f; + } else if (temp_f12 < -180.0f) { + var_f2 += 360.0f; + } + local->unk24 = var_f2; +} + + +void func_80357F0C(Actor *this, s32 next_state) { + ActorLocal_core2_D0CA0 *local; + s32 var_s0; + f32 sp54[3]; + f32 sp48[3]; + + local = (ActorLocal_core2_D0CA0 *)&this->local; + if (this->state == 0) { + func_80335924(this->unk148, 0x23A, 0.0f, 0.45f); + func_80335A8C(this->unk148, 1); + } + + this->state = next_state; + local->unk36 = 0; + local->unk28 = 0.0f; + if (this->state == 1) { + local->unk28 = randf2(0.0f, 2.0f); + } + if (this->state == 2) { + func_80335924(this->unk148, 0x23A, 0.3f, 0.45f); + func_80335A8C(this->unk148, 1); + for(var_s0 = 0; var_s0 < 10; var_s0++){ + sp54[0] = this->position[0]; + sp54[1] = this->position[1]; + sp54[2] = this->position[2]; + sp54[1] = (f32) local->unk30[1]; + sp54[0] += randf2(-300.0f, 300.0f); + sp54[1] += randf2(-100.0f, 100.0f); + sp54[2] += randf2(-300.0f, 300.0f); + if (func_80329210(this, sp54)) + break; + } + if (var_s0 == 0xA) { + sp54[0] = (f32) local->unk30[0]; + sp54[1] = (f32) local->unk30[1]; + sp54[2] = (f32) local->unk30[2]; + } + func_80357CD0(this, sp54); + } + if (this->state == 3) { + player_getPosition(sp48); + sp48[1] += 50.0f; + func_80357CD0(this, sp48); + } + if (this->state == 5) { + func_8028F55C(1, this->marker); + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200); + func_80335924(this->unk148, 0x23A, 0.4f, 1.0f); + func_80335A8C(this->unk148, 1); + timed_playSfx(D_80379610, 0x3FC, randf2(D_80379608, D_8037960C), 32000); + local->unk39 = 0; + local->unk28 = 2.0f; + } + if (this->state == 4) { + local->unk28 = 3.5f; + } + if (this->state == 6) { + this->unk138_27 = 1; + this->marker->collidable = FALSE; + this->unk10_1 = FALSE; + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200); + func_80335924(this->unk148, 0x23D, 0.3f, 0.45f); + func_80335A8C(this->unk148, 1); + local->unk36 = 0x3E8; + local->unk39 = 0; + } + if (this->state == 7) { + local->unk2C = 0.0f; + } + if (this->state == 8) { + marker_despawn(this->marker); + } +} + +void func_803582C4(ActorMarker *marker, ActorMarker *other_marker){ + Actor *this; + + this = marker_getActor(marker); + if(this->state < 5){ + func_80357F0C(this, 5); + } +} + +void func_80358304(ActorMarker *marker, ActorMarker *other_marker){ + Actor *this; + + this = marker_getActor(marker); + if(this->state < 6){ + func_80357F0C(this, 6); + } +} + +Actor *func_80358344(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *this; + ActorLocal_core2_D0CA0 *local; + + this = marker_getActor(marker); + local = (ActorLocal_core2_D0CA0 *)&this->local; + if (this->state == 0) { + return this; + } + this->unk124_11 = 1; + if (this->state == 7) { + this->alpha_124_19 = (1.0f - local->unk2C)*255.0f; + } else { + this->alpha_124_19 = 0xff; + } + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_80358490(Actor *this) { + ActorLocal_core2_D0CA0 *local; + + local = (ActorLocal_core2_D0CA0 *)&this->local; + if(local->unk0 != 0){ + func_8030DA44(local->unk0); + } +} + +void func_803584BC(Actor *this) { + ActorLocal_core2_D0CA0 *local; + + local = (ActorLocal_core2_D0CA0 *)&this->local; + local->unk0 = func_8030D90C(); + func_8030DBB4(local->unk0, 0.9f); + sfxsource_setSfxId(local->unk0, 0x3FA); + func_8030DD14(local->unk0, 2); + sfxsource_setSampleRate(local->unk0, 0); +} + + +void func_80358524(f32 position[3], s32 count, enum asset_e model_id) { + ParticleEmitter *p_ctrl; + ParticleEmitter *temp_v0; + + temp_v0 = partEmitList_pushNew(count); + p_ctrl = temp_v0; + particleEmitter_setModel(temp_v0, model_id); + particleEmitter_setPosition(p_ctrl, position); + func_802EFE24(p_ctrl, -400.0f, -400.0f, -400.0f, 400.0f, 400.0f, 400.0f); + func_802EF9F8(p_ctrl, 0.01f); + func_802EFA18(p_ctrl, 3); + func_802EFA20(p_ctrl, 1.0f, 1.3f); + func_802EF9EC(p_ctrl, 0x2F, 16000); + particleEmitter_setPositionVelocityAndAccelerationRanges(p_ctrl, &D_803728EC); + func_802EFB98(p_ctrl, &D_803728C4); + particleEmitter_emitN(p_ctrl, count); +} + +void func_80358610(Actor *this) { + func_80358524(this->position, 1, 0x51C); + func_80358524(this->position, 2, 0x51D); + func_80358524(this->position, 2, 0x51E); + func_80358524(this->position, 1, 0x51F); + func_80358524(this->position, 4, 0x520); +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_D0CA0/func_80358684.s") +#else +void func_80358684(Actor *this) { + ActorLocal_core2_D0CA0 *local; + f32 sp94[4]; + s32 next_state; + f32 sp88; + f32 sp84; + f32 sp80; + f32 sp7C; + f32 sp70; + f32 sp60[3]; + f32 sp54[3]; + f32 sp48[3]; + f32 sp3C[3]; + f32 *sp30; + f32 sp2C; + f32 temp_a3; + f32 temp_f0; + f32 temp_f0_2; + f32 temp_f2; + f32 temp_f2_2; + f32 temp_f2_3; + f32 temp_f2_4; + f32 var_f0; + f32 var_f12; + f32 var_f16; + f32 var_f18; + f32 var_f2; + f32 var_f2_2; + f64 temp_f0_3; + f64 temp_f12; + u32 temp_t1; + u32 temp_t2; + u32 temp_t3; + u32 var_v0; + + local = (ActorLocal_core2_D0CA0 *)&this->local; + next_state = 0; + sp88 = time_getDelta(); + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->marker->unk30 = func_80358490; + local->unk38 = 0; + local->unk39 = 0; + local->unk28 = 0.0f; + local->unk30[0] = (s16) (s32) this->position[0]; + local->unk30[1] = (s16) (s32) this->position[1]; + local->unk30[2] = (s16) (s32) this->position[2]; + local->unk30[1] += 0xC8; + marker_setCollisionScripts(this->marker, func_803582C4, NULL, func_80358304); + local->unk0 = 0; + func_80357F0C(this, 1); + } + + if (!actor_playerIsWithinDist(this, 4000)) { + if (local->unk0 != 0) { + func_8030DA44(local->unk0); + local->unk0 = 0U; + } + return; + } + + if (local->unk0 == 0) { + func_803584BC(this); + } + player_getPosition(sp94); + if (this->state != 0 && (this->state < 6)) { + temp_f0 = func_8030E200(local->unk0); + if (local->unk39 == 1) { + var_f16 = D_80379614; + var_f18 = 1.0f; + } else { + var_f16 = D_80379618; + var_f18 = D_8037961C; + } + if (temp_f0 < var_f16) { + var_f2 = (f32) ((f64) temp_f0 + D_80379620); + } else if (var_f18 < temp_f0) { + var_f2 = (f32) ((f64) temp_f0 - D_80379628); + } else { + sp84 = temp_f0; + sp80 = var_f16; + sp7C = var_f18; + temp_f2 = temp_f0 + randf2(D_80379630, D_80379634); + if (temp_f2 < var_f16) { + var_f2 = var_f16; + } else { + if (var_f18 < temp_f2) { + var_f0 = var_f18; + } else { + var_f0 = temp_f2; + } + var_f2 = var_f0; + } + } + func_8030DBB4(local->unk0, var_f2); + temp_f2_2 = ml_vec3f_distance(sp94, this->position) / 2000.0f; + var_f12 = 1.0f - temp_f2_2; + if (temp_f2_2 > 1.0f) { + var_f12 = 0.0f; + } + if (var_f12 > 0.0f) { + sfxsource_setSampleRate(var_f12, local->unk0, (s32) (var_f12 * D_80379638)); + func_8030E2C4(local->unk0); + } + } + if (this->unk10_25) { + if (func_8025773C(&local->unk28, sp88)) { + next_state = 2; + } + if (local->unk39 == 2) { + if (this->state == 3) { + local->unk4 += 2 * sp88; + } else { + local->unk4 += 1 * sp88; + } + if (local->unk4 >= 1.0f) { + local->unk4 = 1.0f; + if (func_803203FC(0xC1)) { + local->unk39 = 0; + } else { + if (this->state == 2) { + local->unk39 = 1; + } else if (this->state == 3) { + if (func_8033567C(this->unk148) != 0x23B) { + func_80335924(this->unk148, 0x23B, 0.2f, 0.75f); + func_80335A8C(this->unk148, 2); + } else if (D_80379640 <= func_80335684(this->unk148)) { + local->unk39 = 1U; + } + } + } + } + if (local->unk39 == 2) { + this->yaw = local->unk14 + (func_802575BC(local->unk4) * (local->unk24 - local->unk14)); + } else { + local->unk4 = 0.0f; + local->unk14 = local->unk24; + } + } + if (local->unk39 == 1) { + sp30 = this + 4; + sp2C = 1.0f * sp88; + if ((func_80357C30(this) == 0) || ((this->state == 3) && (func_80329210(this, sp30) == 0))) { + local->unk18[0] = (f32) this->position[0]; + local->unk18[1] = (f32) this->position[1]; + local->unk18[2] = (f32) this->position[2]; + local->unk4 = 1.0f; + } + local->unk4 = (f32) (local->unk4 + sp2C); + if (local->unk4 >= 1.0f) { + local->unk39 = 0U; + local->unk4 = 1.0f; + } + sp70 = func_802575BC(local->unk4); + func_80255FE4(sp30, local->unk8, local->unk18, sp70); + this->yaw = local->unk14 + (sp70 * (local->unk24 - local->unk14)); + if ((func_8033567C(this->unk148) == 0x23B) && (func_80335794(this->unk148) > 0)) { + func_80335924(this->unk148, 0x23C, 0.1f, 0.45f); + func_80335A8C(this->unk148, 1); + } + if ((local->unk39 == 0) || ((func_8033567C(this->unk148) == 0x23C) && (D_80379648 <= (f64) local->unk4))) { + func_80335924(this->unk148, 0x23A, 0.3f, 0.45f); + func_80335A8C(this->unk148, 1); + } + if (this->state == 3) { + temp_f12 = D_80379650; + temp_f0_3 = (f64) local->unk4; + if (temp_f12 <= temp_f0_3) { + if (D_80379658 < temp_f0_3) { + var_f2_2 = 0.0f; + } else { + var_f2_2 = (f32) (1.0 - ((temp_f0_3 - temp_f12) / D_80379660)); + } + func_8030DBB4(local->unk0, (f32) (((f64) var_f2_2 * D_80379668) + 1.0)); + } + } + } + if (this->state == 1) { + player_getPosition(sp60); + sp60[1] += 50.0f; + if (func_80329210(this, sp60) && (sp60[1] < (local->unk30[1] + 300)) && !func_8028F25C() && this->marker->unk14_21) { + sp60[0] = 0.0f; + sp54[0] = this->position[0]; + sp54[1] = this->position[1]; + sp54[2] = this->position[2]; + sp54[0] = 0.0f; + if (ml_vec3f_distance(sp60, sp54) < 800.0f) { + next_state = 3; + } + } + } + if ((this->state == 2) && (local->unk39 == 0)) { + next_state = 1; + } + if (this->state == 3) { + if (local->unk39 == 0) { + local->unk38++; + if (local->unk38 == 3) { + next_state = 4; + local->unk38 = 0; + } else { + next_state = 1; + } + } else if ((this->state == 2) || (local->unk4 < 0.5)) { + sp48[0] = sp94[0]; + sp48[1] = sp94[1] + 50.0f; + sp48[2] = sp94[2]; + func_80357E34(this, &sp48); + } + } + if ((this->state == 5) || (this->state == 4)) { + this->position[1] += 50.0f * sp88; + this->yaw += 10.0f * sp88; + } + if (this->state == 6) { + if (func_8033567C(this->unk148) == 0x23D) { + sp3C[0] = this->position[0] - sp94[0]; + sp3C[1] = this->position[1] - sp94[1]; + sp3C[2] = this->position[2] - sp94[2]; + sp3C[1] = 0.0f; + ml_vec3f_set_length(sp3C, 200.0f * sp88); + this->position[0] += sp3C[0]; + this->position[1] += sp3C[1]; + this->position[2] += sp3C[2]; + this->position[1] += local->unk36; + local->unk36 -= D_80379670 * sp88; + if (this->position[1] < func_80309724(this->position)) { + this->position[1] = func_80309724(this->position); + next_state = 7; + FUNC_8030E624(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200); + timed_playSfx(D_80379674, SFX_66_BIRD_AUUGHH, 1.6f, 32000); + } + } else if (func_80335794(this->unk148) > 0) { + next_state = 7; + } + } + if (this->state == 7) { + next_state = 8; + func_80358610(this); + } + + if (next_state != 0) { + func_80357F0C(this, next_state); + } + } +} +#endif diff --git a/src/core2/code_D2180.c b/src/core2/code_D2180.c new file mode 100644 index 00000000..c58e414f --- /dev/null +++ b/src/core2/code_D2180.c @@ -0,0 +1,136 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802F82F4(s32, f32, f32, f32, f32); + +typedef struct { + s16 unk0; + //u8 pad[0x2]; + int (*unk4)(Actor *); +} Struct_Core2_D2180_0; + +typedef struct { + Struct_Core2_D2180_0 *unk0; +} ActorLocal_core2_D2180; + +int func_80359110(Actor *); +int func_8035911C(Actor *); +int func_80359110(Actor *); +int func_80359160(Actor *); +int func_80359110(Actor *); +int func_803591A4(Actor *); +void func_8035933C(Actor *this); +void func_80359424(Actor *this); +void func_80359454(Actor *this); + +/* .data */ +Struct_Core2_D2180_0 D_80372940[] ={ + {2, func_80359110}, + {2, func_8035911C}, + {3, func_80359110}, + {3, func_80359160}, + {4, func_80359110}, + {4, func_803591A4} +}; + +ActorInfo D_80372970 = { 0x1C1, 0x2AE, 0x0, 0, NULL, func_8035933C, NULL, func_80325340, 0, 0, 0.0f, 0}; +ActorInfo D_80372994 = { 0x1C1, 0x2AF, 0x0, 0, NULL, func_8035933C, NULL, func_80325340, 0, 0, 0.0f, 0}; +ActorInfo D_803729B8 = { 0x1C1, 0x2B0, 0x0, 0, NULL, func_8035933C, NULL, func_80325340, 0, 0, 0.0f, 0}; +ActorInfo D_803729DC = { 0x1C1, 0x2B1, 0x0, 0, NULL, func_8035933C, NULL, func_80325340, 0, 0, 0.0f, 0}; +ActorInfo D_80372A00 = { 0x1C1, 0x2B2, 0x0, 0, NULL, func_8035933C, NULL, func_80325340, 0, 0, 0.0f, 0}; +ActorInfo D_80372A24 = { 0x1C1, 0x2B3, 0x0, 0, NULL, func_8035933C, NULL, func_80325340, 0, 0, 0.0f, 0}; +ActorInfo D_80372A48 = { 0x1C1, 0x316, 0x0, 0, NULL, func_80359424, NULL, func_80325340, 0, 0, 0.0f, 0}; +ActorInfo D_80372A6C = { 0x1C1, 0x317, 0x0, 0, NULL, func_80359454, NULL, func_80325340, 0, 0, 0.0f, 0}; + +/* .code */ +int func_80359110(Actor *this){ + return TRUE; +} + +int func_8035911C(Actor *this){ + f32 plyr_pos[3]; + + player_getPosition(plyr_pos); + return (plyr_pos[2] < -1700.0f); +} + +int func_80359160(Actor *this){ + f32 plyr_pos[3]; + + player_getPosition(plyr_pos); + return (1700.0f < plyr_pos[2]); +} + +int func_803591A4(Actor *this){ + f32 plyr_pos[3]; + + player_getPosition(plyr_pos); + return (1700.0f < plyr_pos[0]); +} + +void func_803591E8(Actor *this, s32 next_state){ + ActorLocal_core2_D2180 * local = (ActorLocal_core2_D2180 *) &this->local; + s32 sp20; + + if(next_state == 2) + func_802F8C90(func_802F7C38()); + + if(this->state == 2) + func_802F8CB0(func_802F7C38()); + + if(next_state == 3){ + sp20 = func_802F7C7C(); + func_802F8338(sp20); + if(local->unk0->unk4 == func_80359110) + func_802F82F4(sp20, 5.0f, 30.0f, 5.0f, 30.0f); + } + + if(this->state == 3) + func_802F8358(func_802F7C7C()); + + if(next_state == 4){ + func_802F7CC0(); + func_802F90F4(); + } + if(this->state == 4){ + func_802F7CC0(); + func_802F9114(); + } + + + this->state = next_state; +} + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_D2180/func_8035933C.s") +#else +void func_8035933C(Actor *this){ + ActorLocal_core2_D2180 * local = (ActorLocal_core2_D2180 *) &this->local; + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + local->unk0 = &D_80372940[(this->modelCacheIndex - 0x2AE)]; + func_803591E8(this, 1); + } + if(this->state == 1){ + if(local->unk0->unk4(this)){ + func_803591E8(this, local->unk0->unk0); + } + } + if(this->state != 1){ + if(!local->unk0->unk4(this)){ + func_803591E8(this, 1); + } + } +} +#endif + +void func_80359424(Actor *this){ + if(func_803292E0(this)) + func_802F7D44(); +} + +void func_80359454(Actor *this){ + if(func_803292E0(this)) + func_802F7DE4(); +} diff --git a/src/core2/code_D5D10.c b/src/core2/code_D5D10.c new file mode 100644 index 00000000..26d484fa --- /dev/null +++ b/src/core2/code_D5D10.c @@ -0,0 +1,101 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802DB4E0(s32, s32); +extern void func_802DABA0(ParticleEmitter *pCtrl, f32 position[3], f32 scale, enum asset_e model_id); + +typedef struct { + f32 unk0; + f32 unk4; + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; + u32 unkC_31:3; + u32 unkC_28:1; + u32 padC_27:28; + s16 unk10; + s16 unk12; + f32 unk14; + f32 unk18; + s16 unk1C; + s16 unk1E; + f32 unk20; + f32 unk24; + s16 unk28; + s16 unk2A; + f32 unk2C; + void (*unk30)(s32, s32); + void (*unk34)(s32, s32); +}ActorLocal_Skeleton; + +void chskeleton_update(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_80372D20[]; +extern ActorInfo D_80372D78 = { + 0x218, 0x34E, 0x4CC, + 0x1, D_80372D20, + chskeleton_update, func_80326224, func_80325888, + 2500, 0, 1.0f, 0 +}; + +/* .code */ +void func_8035CCA0(ParticleEmitter *pCtrl, Actor *this, enum asset_e model_id) { + func_802DABA0(pCtrl, this->position, this->scale, model_id); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -50.0f, 750.0f, -50.0f, 120.0f, 900.0f, 120.0f); + particleEmitter_emitN(pCtrl, 4); +} + + +void func_8035CD80(ActorMarker *marker, s32 arg1) { + Actor *this; + + this = marker_getActor(marker); + func_802DAC84(partEmitList_pushNew(2), this, 0x4CE); + func_802DAD08(partEmitList_pushNew(1), this, 0x4CF); + func_802DAD8C(partEmitList_pushNew(2), this, 0x4CD); + func_8035CCA0(partEmitList_pushNew(4), this, 0x4D0); + FUNC_8030E8B4(SFX_119_FISH_DEATH, 1.0f, 32000, this->position, 1250, 2500); + func_802C3F04(func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); + marker_despawn(marker); +} + +void func_8035CE50(Actor *this) { + ActorLocal_Skeleton *local; + + local = (ActorLocal_Skeleton *)&this->local; + + local->unk0 = 3.0f; + local->unk4 = 6.0f; + local->unk8 = 4; + local->unk9 = 8; + local->unkA = 0xA; + local->unkB = 7; + local->unkC_31 = 1; + local->unk10 = 0x10C; + local->unk12 = 20000; + local->unk14 = 1.7f; + local->unk18 = 0.2f; + local->unk1C = 0x117; + local->unk1E = 32000; + local->unk20 = 1.0f; + local->unk24 = 0.35f; + local->unk28 = 0x118; + local->unk2A = 32000; + local->unk2C = 1.0f; + local->unkC_28 = TRUE; + local->unk30 = func_802DB4E0; + local->unk34 = func_8035CD80; + +} + +void chskeleton_update(Actor *this){ + if(!this->unk16C_4){ + func_8035CE50(this); + } + func_802DB5A0(this); +} diff --git a/src/core2/code_D5FD0.c b/src/core2/code_D5FD0.c new file mode 100644 index 00000000..39fc7b33 --- /dev/null +++ b/src/core2/code_D5FD0.c @@ -0,0 +1,91 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802DB548(s32, s32); + +typedef struct { + f32 unk0; + f32 unk4; + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; + u32 unkC_31:3; + u32 unkC_28:1; + u32 padC_27:28; + s16 unk10; + s16 unk12; + f32 unk14; + f32 unk18; + s16 unk1C; + s16 unk1E; + f32 unk20; + f32 unk24; + s16 unk28; + s16 unk2A; + f32 unk2C; + void (*unk30)(ActorMarker *, s32); + void (*unk34)(ActorMarker *, s32); + u8 pad38[4]; + f32 unk3C; +}ActorLocal_core2_D5FD0; + +void func_8035D058(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_80372DA0[]; +extern ActorInfo D_80372DF8 = { + 0x21A, 0x350, 0x49D, + 0x1, D_80372DA0, + func_8035D058, func_80326224, func_80325888, + 2500, 0, 1.0f, 0 +}; + +/* .code */ +void func_8035CF60(ActorMarker * marker, s32 arg1) { + Actor *actor; + + actor = marker_getActor(marker); + func_80328B8C(actor, 5, 0.0f, 1); + actor_playAnimationOnce(actor); + FUNC_8030E8B4(SFX_C2_GRUBLIN_EGH, 1.0f, 32000, actor->position, 1250, 2500); + actor_collisionOff(actor); +} + +void func_8035CFC4(Actor *this) { + ActorLocal_core2_D5FD0 *local; + + local = (ActorLocal_core2_D5FD0 *)&this->local; + local->unk0 = 4.0f; + local->unk4 = 8.0f; + + local->unk8 = 6; + local->unk9 = 0xA; + local->unkA = 0xE; + local->unkB = 9; + local->unkC_31 = 1; + local->unk10 = 0x11A; + local->unk12 = 25000; + local->unk14 = 1.0f; + local->unkC_28 = TRUE; + local->unk30 = func_802DB548; + local->unk34 = func_8035CF60; + local->unk3C = 1.5f; +} + +void func_8035D058(Actor *this) { + if (!this->unk16C_4) { + func_8035CFC4(this); + } + func_802DB5A0(this); + if (this->state == 5) { + if (actor_animationIsAt(this, 0.18f) != 0) { + FUNC_8030E8B4(SFX_2_CLAW_SWIPE, 1.0f, 28000, this->position, 0x4E2, 0x9C4); + } + if (actor_animationIsAt(this, 0.7f) != 0) { + FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 1.0f, 28000, this->position, 0x4E2, 0x9C4); + + } + } +} diff --git a/src/core2/code_D6180.c b/src/core2/code_D6180.c new file mode 100644 index 00000000..f21c5833 --- /dev/null +++ b/src/core2/code_D6180.c @@ -0,0 +1,146 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_8035D3D8(Actor *this); +extern void func_802DABA0(ParticleEmitter *, f32 position[3], f32 scale, enum asset_e model_id); + +typedef struct { + f32 unk0; + f32 unk4; + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; + u32 unkC_31:3; + u32 unkC_28:1; + u32 padC_27:28; + s16 unk10; + s16 unk12; + f32 unk14; + f32 unk18; + s16 unk1C; + s16 unk1E; + f32 unk20; + f32 unk24; + s16 unk28; + s16 unk2A; + f32 unk2C; + void (*unk30)(ActorMarker *, s32); + void (*unk34)(ActorMarker *, s32); +}ActorLocal_core2_D6180; + +/* .data */ +extern ActorAnimationInfo D_80372E20[]; +extern ActorInfo D_80372E78 = { + 0x219, 0x34F, 0x4C7, + 0x1, D_80372E20, + func_8035D3D8, func_80326224, func_80325888, + 2500, 0, 1.0f, 0 +}; + +/* .rodata */ +extern f32 D_80379860; +extern f32 D_80379864; +extern f32 D_80379868; + +/* .code */ +void func_8035D110(ParticleEmitter *p_emitter, Actor *this, enum asset_e model_id) { + func_802DABA0(p_emitter, this->position, this->scale, model_id); + particleEmitter_setParticleAccelerationRange(p_emitter, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); + func_802EFE24(p_emitter, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(p_emitter, -50.0f, 750.0f, -50.0f, 120.0f, 900.0f, 120.0f); + particleEmitter_emitN(p_emitter, 1); +} + + +void func_8035D1F0(ActorMarker *arg0, s32 arg1) { + Actor *this; + + this = marker_getActor(arg0); + func_802DAC84(partEmitList_pushNew(2), this, 0x4C9); + func_802DAD08(partEmitList_pushNew(1), this, 0x4CA); + func_802DAD8C(partEmitList_pushNew(2), this, 0x4C8); + func_8035D110(partEmitList_pushNew(1), this, 0x4CB); + FUNC_8030E8B4(SFX_119_FISH_DEATH, 0.8f, 32000, this->position, 1250, 2500); + func_802C3F04((GenMethod_4) func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); + marker_despawn(arg0); +} + +void func_8035D2C0(ActorMarker *marker, s32 arg1){ + Actor *actor = marker_getActor(marker); + func_802DB4E0(marker, arg1); + actor_collisionOn(actor); +} + +void func_8035D2FC(Actor *this) { + ActorLocal_core2_D6180 *local; + u8 temp_t6; + + local = (ActorLocal_core2_D6180 *)&this->local; + local->unk0 = 2.0f; + local->unk4 = 4.0f; + local->unk8 = 3; + local->unk9 = 6; + local->unkA = 8; + local->unkB = 4; + local->unkC_31 = 0; + local->unk10 = 0x10C; //SFX_10C_MUMMY_TALKING + local->unk12 = 20000; + local->unk14 = 1.5f; + local->unk18 = D_80379860; + local->unk1C = 0x10D; //SFX_10D_ANCIENT_ONE_TALKING + local->unk1E = 20000; + local->unk20 = D_80379864; + local->unk24 = D_80379868; + local->unk28 = 0xC5; //SFX_C5_TWINKLY_POP + local->unk2A = 20000; + local->unk2C = 1.0f; + local->unkC_28 = TRUE; + local->unk30 = func_8035D2C0; + local->unk34 = func_8035D1F0; + this->unk154 |= 0x08000000; +} + +void func_8035D3D8(Actor *this) { + if (!this->unk16C_4) { + func_8035D2FC(this); + } + func_802DB5A0(this); + if (this->state == 9) { + if (this->marker->unk14_20 != 0x298) { + this->marker->unk14_20 = 0x298; + } + } else { + if (this->marker->unk14_20 != 0x219) { + this->marker->unk14_20 = 0x219; + } + } +} + +/* BREAK??? */ +void func_8035D490(ActorMarker *marker){ + Actor *sp1C; + + if (map_get() == MAP_13_GV_MEMORY_GAME) { + sp1C = marker_getActor(marker); + if (func_80329530(sp1C, 250) != 0) { + func_802C9334(0x1C, sp1C); + func_8035D2C0(marker, 0); + } + } +} + +void func_8035D4F0(ActorMarker *marker, s32 arg1){ + s32 pad; + Actor *actor; + if(map_get() == MAP_13_GV_MEMORY_GAME){ + actor = marker_getActor(marker); + if(actor->state != 9){ + if(func_8033F3E8(func_80309744(0), actor->position, 0x190, 0x1A0) == arg1){ + func_802C9334(0x1C, actor); + func_8035D2C0(marker, 0); + } + } + } +} \ No newline at end of file diff --git a/src/core2/code_D6600.c b/src/core2/code_D6600.c new file mode 100644 index 00000000..214e5457 --- /dev/null +++ b/src/core2/code_D6600.c @@ -0,0 +1,224 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80328FF0(Actor *, f32); +extern f32 func_80309B24(f32[3]); +extern ParticleEmitter *func_802EDD8C(f32[3], f32, f32); + +typedef struct { + s32 unk0; + s32 unk4; +}ActorLocal_core2_D6600; + +#define LOCAL_D6600(actor) ((ActorLocal_core2_D6600*)&actor->local) + +void func_8035DA1C(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_80372EA0[]; +extern ActorInfo D_80372EE0 = { + 0x69, 0xA, 0x36B, + 0x2, D_80372EA0, + func_8035DA1C, func_80326224, func_80325888, + 3000, 0, 0.0f, 0 +}; + +/* .code */ +f32 func_8035D590(f32 arg0) { + if ((arg0 >= 180.0f) && (arg0 < 330.0f)) { + return 330.0f; + } + if ((arg0 < 180.0f) && (arg0 > 30.0f)) { + return 30.0f; + } + return arg0; +} + + +bool func_8035D608(Actor *this) { + f32 sp1C[3]; + + player_getPosition(sp1C); + if (LOCAL_D6600(this)->unk4 == 8) { + return TRUE; + } + return func_80309D58(&sp1C, this->unk10_18); +} + + +void func_8035D65C(Actor *this) { + if (this->unk38_31 != 0) { + this->unk38_31--; + return; + } + if (func_80329530(this, 500) && func_8028B470() && func_8035D608(this)) { + this->unk28 = 2.0f; + func_80328B8C(this, 4, 0.0f, -1); + } +} + +void func_8035D6FC(Actor *this) { + func_80328B8C(this, 3, 0.0f, -1); + this->unk28 = 2.0f; + func_80328C64(this, (s32) (randf2(-45.0f, 45.0f) + (this->yaw + 180.0f))); + func_80328CA8(this, (s32) func_8035D590(randf2(-45.0f, 45.0f) + (360.0f - this->pitch))); + this->unk38_31 = 0x78; +} + +void func_8035D7CC(Actor *this) { + func_80328B8C(this, 3, 0.0f, -1); + this->unk28 = 2.0f; + func_80328C64(this, (s32) (randf2(-45.0f, 45.0f) + (this->yaw + 180.0f))); + func_80328CA8(this, (s32) func_8035D590(randf2(-45.0f, 45.0f) + (360.0f - this->pitch))); +} + +void func_8035D88C(ActorMarker *marker, ActorMarker *other_marker){ + Actor *this; + + this = marker_getActor(marker); + func_80328B8C(this, 7, 0.0f, -1); + actor_playAnimationOnce(this); + FUNC_8030E8B4(SFX_115_BUZZBOMB_DEATH, 0.8f, 30000, this->position, 1500, 3000); + actor_collisionOff(this); +} + +void func_8035D8F0(ActorMarker *marker, ActorMarker *other_marker){ + Actor *this; + + this = marker_getActor(marker); + if (this->state >= 5U) { + if (func_803294F0(this, 0x50, func_80329784(this))) { + func_8030E58C(SFX_6D_CROC_BITE, 1.3f); + func_8035D6FC(this); + } + } +} + +void func_8035D95C(ActorMarker *marker) { + f32 sp34[3]; + ParticleEmitter *pCtrl; + + if (marker->unk14_21) { + func_8034A174(marker->unk44, 5, sp34); + pCtrl = func_802EDD8C(sp34, 20.0f, func_80309B24(sp34)); + particleEmitter_setParticleVelocityRange(pCtrl, -50.0f, -50.0f, -50.0f, 50.0f, 50.0f, 50.0f); + func_802EFB70(pCtrl, 0.1f, 0.2f); + func_802EFB84(pCtrl, 0.1f, 0.2f); + particleEmitter_emitN(pCtrl, 3); + } +} + +void func_8035DA1C(Actor *this) { + f32 sp44; + f32 sp40; + s32 sp3C; + bool sp38; + + if (!this->initialized) { + this->initialized = TRUE; + this->unk138_25 = TRUE; + this->unk28 = 4.0f; + LOCAL_D6600(this)->unk4 =(map_get() == MAP_71_GL_STATUE_ROOM) ? 8 : 0xf; + if (func_803203FC(0xC1)) { + this->unk28 = 0.0f; + func_80328B8C(this, 1, 0.0f, 1); + } + func_8032CA80(this, LOCAL_D6600(this)->unk4); + marker_setCollisionScripts(this->marker, func_8035D8F0, NULL, func_8035D88C); + } + + this->marker->unk14_20 = 0x69; //nice + if (randf() < 0.01) { + LOCAL_D6600(this)->unk0 = 5; + } + if (LOCAL_D6600(this)->unk0 != 0 && !(func_8023DB5C() & 0xF)) { + LOCAL_D6600(this)->unk0--; + func_8035D95C(this->marker); + } + switch(this->state){ + case 1://L8035DB78 + func_80328FB0(this, 0.5f); + func_80328FF0(this, 0.5f); + func_8032CA80(this, LOCAL_D6600(this)->unk4); + if (func_80328B38(this, 2, 0.05f) && !func_803203FC(0xC1)) { + this->unk28 = 4.0f; + } + func_8035D65C(this); + break; + + case 2://L8035DBE4 + func_80328FB0(this, 0.5f); + func_80328FF0(this, 0.5f); + if (func_80329480(this) && randf() < 0.01) { + func_80328C64(this, (s32)(this->yaw + randf2(-45.0f, 45.0f))); + } + if (func_8032944C(this) && randf() < 0.01) { + func_80328CA8(this, (s32)func_8035D590(this->pitch + randf2(-45.0f, 45.0f))); + } + sp3C = func_8032CA80(this, LOCAL_D6600(this)->unk4); + if (sp3C & ~2) { + func_8035D7CC(this); + } + if (sp3C & 2) { + func_80328CA8(this, 0); + } + if (func_80328BD4(this, 1, 0.0f, 1, 0.005f)) { + this->unk28 = 2.0f; + } + func_8035D65C(this); + break; + + case 3://L8035DD54 + func_80328FB0(this, 3.0f); + func_80328FF0(this, 3.0f); + func_8032CA80(this, LOCAL_D6600(this)->unk4); + if (func_80329480(this) && func_8032944C(this)) { + func_80328B8C(this, 2, 0.0f, -1); + this->unk28 = 4.0f; + } + break; + + case 4://L8035DDB8 + func_803297FC(this, &sp40, &sp44); + func_80328C64(this, (s32) sp44); + func_80328CA8(this, (s32) func_8035D590(sp40)); + func_80328FB0(this, 10.0f); + func_80328FF0(this, 10.0f); + func_8032CA80(this, LOCAL_D6600(this)->unk4); + if (func_80329480(this) && func_8032944C(this)) { + func_80328B8C(this, 5, 0.0f, -1); + this->unk28 = 10.5f; + } + break; + + case 6://L8035DE60 + if (actor_animationIsAt(this, 0.5f)) { + func_8030E6A4(SFX_6D_CROC_BITE, 1.1f, 10000); + } + case 5://L8035DE84 + this->marker->unk14_20 = 0x173; + func_803297FC(this, &sp40, &sp44); + func_80328C64(this, (s32) sp44); + func_80328CA8(this, (s32) func_8035D590(sp40)); + func_80328FB0(this, 10.0f); + func_80328FF0(this, 10.0f); + sp38 = func_80329530(this, 0x12C); + if ((this->state == 5) && sp38) { + func_80328B8C(this, 6, 0.0f, -1); + } + if ((this->state == 6) && !sp38) { + func_80328B8C(this, 5, 0.0f, -1); + } + if ((func_8032CA80(this, LOCAL_D6600(this)->unk4) & ~2)) { + func_8035D7CC(this); + } + break; + + case 7://L8035DFA0 + if(actor_animationIsAt(this, 0.5f)) { + func_80326310(this); + } + break; + } +} diff --git a/src/core2/code_D7040.c b/src/core2/code_D7040.c new file mode 100644 index 00000000..846e344d --- /dev/null +++ b/src/core2/code_D7040.c @@ -0,0 +1,243 @@ +#include +#include "functions.h" +#include "variables.h" + +bool func_8034A6FC(f32, f32); +void func_8035E84C(Actor *this); + +/* .data */ +ActorAnimationInfo D_80372F10[] ={ + {0, 0.0f}, + {0x5E, 1.2f}, + {0x5F, 0.7f}, + {0x5E, 1.2f}, + {0x5F, 0.7f}, + {0, 0.0f}, + {0x256, 0.7f}, +}; + +/* .code */ +void func_8035DFD0(Actor *this) { + this->velocity[0] = randf2(5.0f, 12.0f); +} + +void func_8035E008(Actor *this) { + if ((this->velocity[0] - 0.1 <= this->unk28) && (this->unk28 <= this->velocity[0] + 0.1)) { + this->unk28 = this->velocity[0]; + } else { + this->unk28 += (this->velocity[0] < this->unk28)? -0.2 : 0.2; + } + animctrl_setDuration(this->animctrl, ml_map_f(this->unk28, 5.0f, 12.0f, 0.54f, 0.36f)); +} + +void func_8035E0D0(Actor *this) { + this->velocity[1] = ((2*randf() * 3.1) - 3.1); + this->velocity[1] += (this->velocity[1] >= 0.0f) ? 3.1 : -3.1; +} + +void func_8035E150(Actor *this) { + s32 temp_f10; + s32 phi_v1; + + temp_f10 = (s32) (this->velocity[1] + this->yaw); + if (temp_f10 >= 0x168) { + this->yaw = (f32) (temp_f10 - 0x168); + return; + } + phi_v1 = (temp_f10 < 0) ? temp_f10 + 0x168 : temp_f10; + this->yaw = (f32) phi_v1; +} + +void func_8035E1B0(Actor *this) { + f32 sp24[3]; + f32 sp20; + + func_8024C5CC(&sp24); + sp20 = ml_map_f( (300.0f - sp24[0])*(300.0f - sp24[0]) + (this->position[1] - sp24[1])*(this->position[1] - sp24[1]) + (-858.0f - sp24[2])*(-858.0f - sp24[2]) + , 7617600.0f, 8236900.0f + , 8000.0f, 1000.0f + ); + if (actor_animationIsAt(this, 0.4f)) { + func_8030E6A4(SFX_3D_TICKER_WALKING, 0.85f, (s32) sp20); + } + if (actor_animationIsAt(this, 0.9f)) { + func_8030E6A4(SFX_3D_TICKER_WALKING, 1.15f, (s32) sp20); + } +} + +void func_8035E2A8(ParticleEmitter *pCtrl, f32 position[3]){ + particleEmitter_setPosition(pCtrl, position); + func_802EFA70(pCtrl, 2); + func_802EF9F8(pCtrl, 0.7f); + func_802EFA18(pCtrl, 5); + func_802EFA20(pCtrl, 0.8f, 1.0f); + func_802EF9EC(pCtrl, 0x1F, 10000); + particleEmitter_setSpawnIntervalRange(pCtrl, 0.0f, 0.01f); + func_802EFEC0(pCtrl, 3.5f, 3.5f); + func_802EFA5C(pCtrl, 0.0f, 0.65f); +} + +void func_8035E360(ParticleEmitter *pCtrl, f32 position[3]){ + func_8035E2A8(pCtrl, position); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); + particleEmitter_setModel(pCtrl, 0x393); + func_802EFB70(pCtrl, 0.5f, 0.8f); + func_802EFE24(pCtrl, -800.0f, -800.0f, -800.0f, 800.0f, 800.0f, 800.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -200.0f, 850.0f, -200.0f, 400.0f, 1000.0f, 400.0f); + particleEmitter_emitN(pCtrl, 6); +} + +void func_8035E44C(ParticleEmitter *pCtrl, f32 position[3]){ + func_8035E2A8(pCtrl, position); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); + particleEmitter_setModel(pCtrl, 0x394); + func_802EFB70(pCtrl, 1.0f, 1.0f); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -50.0f, 750.0f, -50.0f, 120.0f, 900.0f, 120.0f); + particleEmitter_emitN(pCtrl, 1); +} + +void func_8035E540(ParticleEmitter *pCtrl, f32 position[3]){ + func_8035E2A8(pCtrl, position); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1800.0f, 0.0f, 0.0f, -1800.0f, 0.0f); + particleEmitter_setModel(pCtrl, 0x395); + func_802EFB70(pCtrl, 1.0f, 1.0f); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -50.0f, 750.0f, -50.0f, 120.0f, 900.0f, 120.0f); + particleEmitter_emitN(pCtrl, 1); +} + +void func_8035E634(ParticleEmitter *pCtrl, f32 position[3]){ + func_8035E2A8(pCtrl, position); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1400.0f, 0.0f, 0.0f, -1400.0f, 0.0f); + particleEmitter_setModel(pCtrl, 0x396); + func_802EFB70(pCtrl, 1.0f, 1.0f); + func_802EFE24(pCtrl, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -80.0f, 400.0f, -80.0f, 160.0f, 860.0f, 160.0f); + particleEmitter_emitN(pCtrl, 2); +} + + +void func_8035E724(ActorMarker *marker, ActorMarker *other_marker){ + Actor *this; + + this = marker_getActor(marker); + func_80328AC8(this, 6); +} + +void func_8035E750(ActorMarker *marker, ActorMarker *other_marker){ + Actor *this; + + this = marker_getActor(marker); + func_8035E360(partEmitList_pushNew(6), this->position); + func_8035E44C(partEmitList_pushNew(1), this->position); + func_8035E540(partEmitList_pushNew(1), this->position); + func_8035E634(partEmitList_pushNew(2), this->position); + marker->collidable = FALSE; + this->unk138_27 = 1; + FUNC_8030E624(SFX_D1_SNORKEL_WAH, 1.4f, 32750); + marker_despawn(marker); +} +void func_8035E810(ActorMarker *caller, enum asset_e text_id, s32 arg2){ + Actor *this; + + this = marker_getActor(caller); + this->unk138_24 = FALSE; + levelSpecificFlags_set(0xd, FALSE); +} + +void func_8035E84C(Actor *this) { + s32 sp34; + static s32 D_80372F48 = 0; + static s32 D_80372F4C = 0; + + sp34 = func_8023DB5C(); + if (!this->unk16C_4) { + marker_setCollisionScripts(this->marker, NULL, func_8035E724, func_8035E750); + this->unk124_0 = this->unk138_31 = FALSE; + this->unk138_24 = FALSE; + this->unk16C_0 = TRUE; + this->unk16C_4 = TRUE; + } + if( map_get() == MAP_C_MM_TICKERS_TOWER + && !mapSpecificFlags_get(0) + && func_80329530(this, 700) + && !func_80329530(this, 150) + && func_8028ECAC() == 0 + && player_getTransformation() == TRANSFORM_1_BANJO + ) { + func_80311480(0xB43, 7, this->position, this->marker, func_8035E810, NULL); + mapSpecificFlags_set(0, TRUE); + levelSpecificFlags_set(0xD, TRUE); + this->unk138_24 = TRUE; + } + + if( func_80329530(this, 300) + && !func_80329530(this, 150) + && func_8028ECAC() == 0 + && player_getTransformation() == TRANSFORM_2_TERMITE + ) { + if (!levelSpecificFlags_get(0xB)) { + if (func_80311480(0xB41, 0, NULL, NULL, NULL, NULL)) { + levelSpecificFlags_set(0xB, TRUE); + this->unk138_23 = TRUE; + } + } else if (!levelSpecificFlags_get(0xC) && !this->unk138_23 && (func_80311480(0xB42, 0, NULL, NULL, NULL, NULL))) { + levelSpecificFlags_set(0xC, TRUE); + } + } + switch (this->state) { + case 1: + if (func_80328BD4(this, 2, 0.0f, 1, 0.06f)) { + func_8035E0D0(this); + func_8035DFD0(this); + this->unk28 = 0.0f; + return; + } + return; + case 2: + if (sp34 != D_80372F48) { + D_80372F48 = sp34; + D_80372F4C = 1; + func_8035E1B0(this); + } else if (D_80372F4C != 0) { + D_80372F4C--; + func_8035E1B0(this); + } + if (this->unk38_31 != 0) { + this->unk38_31--; + } else { + func_8035E150(this); + if ((sp34 & 0x1F) == 0xE && 0.45 < randf()) { + func_8035E0D0(this); + } + if (func_8034A6FC(0.73f, 0.76f) && func_80329078(this, (s32) this->yaw, 750) ) { + this->yaw_moving = this->yaw; + this->velocity[0] = 35.0f; + this->unk28 = 19.4444447f; + this->unk38_31 = 0x3A; + } + if ((sp34 & 0x1F) == 3 && 0.58 < (f64) randf()) { + func_8035DFD0(this); + } + } + func_8035E008(this); + func_80329030(this, 0); + func_80328BD4(this, 1, 0.0f, 1, 0.047f); + return; + case 6: + if (actor_animationIsAt(this, 0.95f) != 0) { + func_80328AC8(this, 1); + } + break; + } +} + +// this data struct is at the end of the file so the local static vars +// in func_8035E84C are in correct .data location +ActorInfo D_80372F50 = { + 0x4, 0x5, 0x350, + 0x1, D_80372F10, + func_8035E84C, func_80326224, func_80325888, + 2000, 0, 0.0f, 0 +}; diff --git a/src/core2/code_D7D10.c b/src/core2/code_D7D10.c new file mode 100644 index 00000000..d501bc72 --- /dev/null +++ b/src/core2/code_D7D10.c @@ -0,0 +1,317 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *func_8035ECA0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_8035F138(Actor *this); +extern void func_80325794(ActorMarker *); +extern f32 func_80257204(f32, f32, f32, f32); + +typedef struct { + s32 unk0; +}ActorLocal_core2_D7D10; + +/* .data */ +extern ActorAnimationInfo D_80372F80[]; + +extern ActorInfo D_80372FC0 = { + 0x96, 0xC7, 0x3C9, + 0x1, D_80372F80, + func_8035F138, func_80326224, func_8035ECA0, + 3500, 0, 1.2f, 0 +}; + +extern ActorInfo D_80372FE4 = { + 0x297, 0x3C2, 0x3C9, + 0x1, D_80372F80, + func_8035F138, func_80326224, func_8035ECA0, + 14000, 0, 3.2f, 0 +}; + +extern f32 D_80373008[3]; +extern s32 D_80373014[3]; +extern struct31s D_80373020; +extern struct43s D_80373048; + +/* .rodata */ +extern f32 D_80379920; + +/* .code */ +Actor *func_8035ECA0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + f32 rotation[3]; + Actor *this; + ActorLocal_core2_D7D10 *local; + + this = func_80325300(marker, rotation); + local = (ActorLocal_core2_D7D10 *)&this->local; + func_8033A45C(3, (s32) this->velocity[1]); + func_8033A45C(4, local->unk0); + func_8033A2D4(func_803253A0, this); + func_8033A2E8(func_80325794, marker); + func_803391A4(gfx, mtx, this->position, rotation, this->scale, D_80373008, func_803257B4(marker)); + return this; +} + +bool func_8035ED60(Actor *this) { + f32 temp_f0; + f32 temp_f2; + + temp_f0 = this->position[0] - this->unk1C[0]; + temp_f2 = this->position[2] - this->unk1C[2]; + if (((temp_f0 * temp_f0) + (temp_f2 * temp_f2)) < 110.0f) { + return TRUE; + } + return FALSE; +} + +void func_8035EDB0(f32 position[3], s32 count, enum asset_e sprite) { + ParticleEmitter *p_ctrl; + + p_ctrl = partEmitList_pushNew(count); + func_802EFFA8(p_ctrl, D_80373014); + particleEmitter_setSprite(p_ctrl, sprite); + particleEmitter_setPosition(p_ctrl, position); + particleEmitter_setPositionVelocityAndAccelerationRanges(p_ctrl, &D_80373048); + func_802EFB98(p_ctrl, &D_80373020); + func_802EFA70(p_ctrl, 0x10); + particleEmitter_emitN(p_ctrl, count); +} + +void func_8035EE48(Actor *this){ + u8 val = this->unk44_31; + if(val != 0){ + func_8030DA44(val); + this->unk44_31 = 0; + } +} + +void func_8035EE80(Actor *this){ + func_80328A84(this, 3); + actor_loopAnimation(this); + this->unk28 = 10.5f; + func_8035EE48(this); +} + +void func_8035EEC0(Actor *this){ + func_80328A84(this, 4); + actor_loopAnimation(this); + this->unk28 = 9.0f; + func_8035EE48(this); +} + +void func_8035EF00(Actor *this, f32 arg1){ + this->yaw_moving = (f32)func_80329784(this); + func_80328FB0(this, arg1); +} + +void func_8035EF3C(Actor *this) { + if( actor_animationIsAt(this, 0.2f) + || actor_animationIsAt(this, 0.7f) + ) { + FUNC_8030E8B4(SFX_123_BANJO_LANDING_10, 0.5f, 24000, this->position, 1750, 3500); + } +} + +void func_8035EF9C(ActorMarker *marker, ActorMarker *other_marker) { + Actor *this; + ActorLocal_core2_D7D10 *local; + + this = marker_getActor(marker); + local = (ActorLocal_core2_D7D10 *)&this->local; + this->velocity[2] = 0.0f; + func_80328B8C(this, 7, 0.02f, 1); + actor_playAnimationOnce(this); + local->unk0 = 2; + actor_collisionOff(this); + FUNC_8030E8B4(SFX_115_BUZZBOMB_DEATH, 0.6f, 32000, this->position, 1750, 3500); + FUNC_8030E8B4(SFX_1D_HITTING_AN_ENEMY_1, 0.9f, 22000, this->position, 1750, 3500); + func_8035EE48(this); +} + +void func_8035F048(ActorMarker *marker, ActorMarker *other_marker) { + Actor *this; + ActorLocal_core2_D7D10 *local; + + this = marker_getActor(marker); + local = (ActorLocal_core2_D7D10 *)&this->local; + + FUNC_8030E8B4(SFX_F9_GRUNTLING_NOISE_1, 1.2f, 22000, this->position, 1750, 3500); + FUNC_8030E8B4(SFX_1D_HITTING_AN_ENEMY_1, 0.9f, 22000, this->position, 1750, 3500); + this->velocity[2] = 0.0f; + func_80328B8C(this, 6, 0.02f, 1); + actor_playAnimationOnce(this); + local->unk0 = 2; + func_8035EE48(this); +} + +void func_8035F0E8(ActorMarker *marker, ActorMarker *other_marker) { + Actor *this; + ActorLocal_core2_D7D10 *local; + + this = marker_getActor(marker); + local = (ActorLocal_core2_D7D10 *)&this->local; + FUNC_8030E8B4(SFX_1D_HITTING_AN_ENEMY_1, 0.9f, 22000, this->position, 1750, 3500); + this->velocity[2] = 0.8f; + func_8035EE80(this); +} + +void func_8035F138(Actor *this) { + f32 sp2C; + ActorLocal_core2_D7D10 *local; + + + local = (ActorLocal_core2_D7D10 *)&this->local; + sp2C = time_getDelta(); + if ((this->state == 1) && (animctrl_getAnimTimer(this->animctrl) < 0.04)) { + this->velocity[1] = 2.0f; + } else { + this->velocity[1] = 1.0f; + } + if (this->velocity[2] <= 0.0) { + this->velocity[2] = 0.0f; + } + else{ + this->velocity[2] -= sp2C; + return; + } + switch(this->state){ + case 1: //L8035F20C + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + marker_setCollisionScripts(this->marker, func_8035F0E8, func_8035F048, func_8035EF9C); + local->unk0 = 1; + this->unk1C[0] = this->position[0]; + this->unk28 = 0.0f; + this->velocity[1] = 0.0f; + this->unk1C[2] = this->position[2]; + this->velocity[0] = this->yaw; + } + animctrl_setAnimTimer(this->animctrl, 0.0f); + if (func_80329530(this, (s32) (this->scale * 650.0f)) && func_803292E0(this)) { + func_80328A84(this, 2U); + actor_playAnimationOnce(this); + this->unk1C[1] = 1.0f; + this->unk44_31 = func_8030ED2C(SFX_2C_PULLING_NOISE, 3); + func_8030E2C4(this->unk44_31); + } + break; + + case 2: //L8035F2F4 + if (this->unk1C[1] < 1.9) { + this->unk1C[1] += 0.1; + } + func_8030DBB4(this->unk44_31, this->unk1C[1]); + if (actor_animationIsAt(this, 0.66f)) { + FUNC_8030E8B4(SFX_F9_GRUNTLING_NOISE_1, 0.8f, 32000, this->position, 1750, 3500); + + } + if (0.99 <= animctrl_getAnimTimer(this->animctrl)) { + func_8035EE80(this); + break; + } + func_8035EF00(this, 7.0f); + break; + + case 3: //L8035F3AC + func_8035EF3C(this); + if (!func_80329530(this, (s32) (this->scale * 1050.0f)) || !func_803292E0(this)) { + func_8035EEC0(this); + break; + } + + func_8035EF00(this, 6.0f); + if ((func_80329030(this, 2) == 0) && (func_80329480(this) != 0)) { + func_8035EEC0(this); + this->unk38_31 = 3; + break; + } + + if (((this->unk28 + 0.28) <= 18.0) && ( 0.36 <= animctrl_getDuration(this->animctrl) - 0.0056000000000000008)) { + this->unk28 += 0.28; + animctrl_setDuration(this->animctrl, animctrl_getDuration(this->animctrl) - 0.0056000000000000008); + } + break; + + case 4: //L8035F4FC + func_8035EF3C(this); + if (((f64)this->unk38_31 <= 0.0) && func_80329530(this, (s32) (this->scale * 1050.0f)) && func_803292E0(this)) { + func_8035EE80(this); + break; + } + this->unk38_31 -= sp2C; + if (func_8035ED60(this)) { + func_80328B8C(this, 5, 0.99f, 0); + actor_playAnimationOnce(this); + this->unk28 = 0.0f; + this->unk1C[1] = 1.9f; + this->unk44_31 = func_8030ED2C(SFX_2C_PULLING_NOISE, 3); + break; + } + + this->yaw_moving = (f32)(s32)func_80257204(this->position[0], this->position[2], this->unk1C[0], this->unk1C[2]); + func_80328FB0(this, 7.0f); + func_80329030(this, 2); + break; + + case 5: //L8035F6F4 + if (actor_animationIsAt(this, 0.36f) != 0) { + func_8030E2C4(this->unk44_31); + } + if ((this->unk44_31 != 0) && func_8030E3FC(this->unk44_31)) { + if (this->unk1C[1] > 1.0) { + this->unk1C[1] -= 0.1; + } + func_8030DBB4(this->unk44_31, this->unk1C[1]); + } + if (animctrl_getAnimTimer(this->animctrl) <= 0.02) { + func_80328B8C(this, 1, 0.02f, 1); + actor_playAnimationOnce(this); + this->unk28 = 0.0f; + func_8035EE48(this); + break; + } + this->yaw_moving = this->velocity[0]; + func_80328FB0(this, 7.5f); + func_80329030(this, 2); + break; + + case 6: //L8035F7F0 + if (actor_animationIsAt(this, 0.64f)) { + local->unk0 = 1; + } + if (0.99 <= animctrl_getAnimTimer(this->animctrl)) { + func_8035EEC0(this); + } + break; + + case 7: //L8035F840 + if (actor_animationIsAt(this, 0.3f)) { + FUNC_8030E8B4(SFX_1E_HITTING_AN_ENEMY_2, 0.6f, 32000, this->position, 1750, 3500); + FUNC_8030E8B4(SFX_1D_HITTING_AN_ENEMY_1, 0.9f, 26000, this->position, 1750, 3500); + } + + if( actor_animationIsAt(this, 0.5f) + || actor_animationIsAt(this, 0.7f) + ) { + FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 16000, this->position, 1750, 3500); + } + + if (actor_animationIsAt(this, 0.8f)) { + FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 14000, this->position, 1750, 3500); + } + + if (actor_animationIsAt(this, 0.9f)) { + FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 0.8f, 12000, this->position, 1750, 3500); + } + + if (actor_animationIsAt(this, 0.25f)) { + func_8035EDB0(this->position, 12, ASSET_700_SPRITE_DUST); + } + + if (actor_animationIsAt(this, 0.5f) != 0) { + func_80326310(this); + } + break; + } + +} diff --git a/src/core2/code_D800.c b/src/core2/code_D800.c new file mode 100644 index 00000000..c090ac11 --- /dev/null +++ b/src/core2/code_D800.c @@ -0,0 +1,79 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + + +void func_80294924(f32 arg0, f32 arg1); + +/* .bss */ +struct { + f32 unk0; + f32 unk4; +} D_8037C290; +ActorMarker* D_8037C298; +u8 D_8037C29C; + +/* .code */ +void func_80294790(void){ + D_8037C298 = NULL; + D_8037C29C = 0; + func_80294924(0.0f, 0.0f); +} + +void func_802947C4(void){} + +void func_802947CC(ActorMarker *marker, f32 arg1[3], f32 arg2[3]){ + Actor * actor = marker_getActor(marker); + if(actor->unk138_22){ + actor->position_x = arg1[0]; + actor->position_y = arg1[1]; + actor->position_z = arg1[2]; + + actor->yaw = arg2[1]; + } +} + +void func_80294828(void){ + f32 banjoPos[3]; + f32 banjoRot[3]; + + + player_getRotation(banjoRot); + banjo_getPosition(banjoPos); + banjoRot[1] = mlNormalizeAngle(banjoRot[1] + D_8037C290.unk4); + banjoPos[1] += D_8037C290.unk0; + func_802947CC(D_8037C298, banjoPos, banjoRot); +} + +int func_80294890(void){ + if(D_8037C298){ + if(D_8037C29C == 0){ + D_8037C298 = NULL; + } + else{ + func_80294828(); + D_8037C29C = 0; + } + } +} + +void func_802948E0(void){ + D_8037C298 = NULL; +} + +ActorMarker *func_802948EC(void){ + return D_8037C298; +} + +void func_802948F8(ActorMarker *arg0){ + D_8037C298 = arg0; + func_80294828(); + D_8037C29C = 1; +} + +void func_80294924(f32 arg0, f32 arg1){ + D_8037C290.unk0 = arg0; + D_8037C290.unk4 = arg1; +} diff --git a/src/core2/code_D89E0.c b/src/core2/code_D89E0.c new file mode 100644 index 00000000..00e12ce4 --- /dev/null +++ b/src/core2/code_D89E0.c @@ -0,0 +1,492 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern f32 func_80309724(f32[3]); +extern f32 func_80257204(f32, f32, f32, f32); + +typedef struct { + f32 unk0; + f32 unk4; +} ActorLocal_Core2_D89E0; + +void func_80360828(Actor *this); + +/* .data */ +extern ActorAnimationInfo D_80373090[]; +extern ActorInfo D_803730D8 = { + 0x127, 0x163, 0x3CA, + 0x1, D_80373090, + func_80360828, func_80326224, func_80325888, + 2500, 0, 0.9f, 0 +}; + + +/* .rodata */ +extern f64 D_803799C0; +extern f64 D_803799C8; +extern f64 D_803799D0; +extern f64 D_803799D8; +extern f64 D_803799E0; +extern f64 D_803799E8; + +/* .code */ +void func_8035F970(Actor *this){ + func_80328A84(this, 1); + actor_loopAnimation(this); +} + +void func_8035F99C(Actor *this){ + if(!func_803203FC(0xC1)){ + func_80328B8C(this, 2, 0.01f, 1); + actor_playAnimationOnce(this); + this->unk28 = 5.0f; + FUNC_8030E8B4(SFX_419_UNKNOWN, 1.0f, 28000, this->position, 0x4e2, 0x9c4); + } +} + +void func_8035FA0C(Actor *this){ + func_80328A84(this, 3); + actor_loopAnimation(this); + this->unk28 = 5.0f; +} + +void func_8035FA48(Actor *this){ + func_80328A84(this, 4); + actor_loopAnimation(this); +} + +void func_8035FA74(Actor *this){ + ActorLocal_Core2_D89E0 *local = (ActorLocal_Core2_D89E0 *)&this->local; + this->yaw_moving = local->unk4; + func_80328A84(this, 5); + actor_loopAnimation(this); +} + +void func_8035FAA8(Actor *this){ + func_80328B8C(this, 6, 0.99f, 0); + actor_playAnimationOnce(this); +} + +void func_8035FAE0(Actor *this){ + func_80328B8C(this, 7, 0.01f, 1); + actor_loopAnimation(this); + this->yaw += 180.0f; + this->unk28 = 20.0f; + this->velocity_x = 300.0f; + +} + +int func_8035FB48(Actor * this, s32 dist){ + f32 f0 = this->position_x - this->unk1C_x; + f32 f2 = this->position_z - this->unk1C_z; + if(f0*f0 + f2*f2 < dist*dist) + return 1; + + return 0; +} + +bool func_8035FBA8(Actor *arg0, s32 arg1) { + if( (arg0->position[1] < ( arg0->unk1C[1] + 0.5)) + && (( arg0->unk1C[1] - 0.5) < arg0->position[1]) + ) { + return func_80329480(arg0) != 0; + } + return FALSE; +} + +void func_8035FC20(Actor *this, f32 arg1, f32 arg2){ + if(this->position[1] < arg1){ + this->position[1] += arg2; + if(arg1 < this->position[1]){ + this->position[1] = arg1; + } + } + else if(arg1 < this->position[1]){ + this->position[1] -= arg2; + if(this->position[1] < arg1){ + this->position[1] = arg1; + } + } +} + +bool func_8035FC98(Actor *this, f32 arg1){ + f32 sp34[3]; + f32 sp28[3]; + f32 sp1C[3]; + + if(this->unk38_0) + return FALSE; + + sp28[0] = this->position[0]; + sp28[1] = this->position[1]; + sp28[2] = this->position[2]; + + sp1C[0] = sp28[0]; + sp1C[1] = sp28[1]; + sp1C[2] = sp28[2]; + sp1C[1] += arg1; + + if (func_80309B48(sp28, sp1C, sp34, 0x5E0000) != NULL) + return TRUE; + return FALSE; + +} + +bool func_8035FD28(Actor *this){ + this->velocity[0] -= 2.5; + if(func_8035FC98(this, this->velocity[0]*2)){ + return FALSE; + } + this->position[1] += this->velocity[0]; + return TRUE; +} + +bool func_8035FDA4(Actor *this) { + f32 sp24[3]; + + player_getPosition(sp24); + sp24[1] += 50.0f; + if (this->unk38_0){ + if(!func_80329260(this, sp24)){ + return FALSE; + } + } else{ + if(!func_80329210(this, sp24)){ + return FALSE; + } + } + + if (this->unk38_31 != 0) { + if (func_80329530(this, 0) && (sp24[1] <= (this->unk1C[1] - 40.0f))) { + return TRUE; + } + this->unk38_31--; + return FALSE; + } + if (func_80329530(this, 800) && (sp24[1] <= (this->unk1C[1] - 40.0f))) { + return TRUE; + } + + return FALSE; +} + +bool func_8035FEDC(Actor *this){ + if(func_8032CA80(this, this->unk38_0?0x13:4)){ + if(this->unk38_0){ + return FALSE; + } + + if(func_80329480(this)){ + this->unk28 = 0.0f; + return FALSE; + } + } + return TRUE; +} + +bool func_8035FF5C(Actor *this){ + if(func_8032CA80(this, 5) && func_80329480(this)){ + this->unk28 = 0.0f; + return FALSE; + } + return TRUE; +} + +void func_8035FFAC(Actor *this, f32 arg1){ + if(arg1 < 0.0f && randf() < D_803799C0){ + this->velocity_y = 0.0f; + } + else if(randf() < D_803799C8){ + this->velocity_y = 1.0f; + } +} + +void func_80360044(Actor *this) { + f32 var_f0; + + var_f0 = this->yaw_moving - this->yaw; + if (var_f0 >= 180.0f) { + var_f0 -= 360.0f; + } + if (var_f0 < -180.0f) { + var_f0 += 360.0f; + } + this->velocity[2] = -var_f0; + if (( this->roll < this->velocity[2]) && ( this->roll < 55.0f)) { + this->roll += 2.0f; + } + if ((this->velocity[2] < this->roll) && (this->roll > -55.0f)) { + this->roll -= 2.0f; + } +} + +void func_80360130(Actor *this){ + if(0.0f < this->roll){ + this->roll -= 2.0; + } + else if(this->roll < 0.0f){ + this->roll += 2.0; + } +} + +bool func_80360198(Actor *this) { + f32 var_f16; + f64 temp_f0; + f64 var_f0; + f64 var_f0_2; + + func_80328FB0(this, 5.0f); + func_80360044(this); + this->unk28 += (this->velocity[1] * D_803799D0) - (D_803799D8 * this->unk28); + if (this->unk28 > 13.0) { + this->unk28 = 13.0f; + } + if (this->unk28 < -13.0) { + this->unk28 = -13.0f; + } + + this->velocity[0] += ((this->velocity[1] * D_803799E0) - D_803799E8); + if (this->velocity[0] > 6.0) { + this->velocity[0] = 6.0f; + } + if (this->velocity[0] < -6.0) { + this->velocity[0] = -6.0f; + } + + if (func_8035FC98(this, 2 * this->velocity[0]) == 0) { + this->position[1] += this->velocity[0]; + } else { + this->velocity[0] *= -3.0f; + this->position[1] += this->velocity[0]; + } + + if (this->state == 4) { + if (func_8035FF5C(this) == 0) { + return FALSE; + } + } else if (func_8035FEDC(this) == 0) { + return FALSE; + } + return TRUE; +} + +#ifndef NONMATCHING +f32 func_803603AC(Actor *this, s32 arg1, u8 arg2); +#pragma GLOBAL_ASM("asm/nonmatchings/core2/code_D89E0/func_803603AC.s") +#else +f32 func_803603AC(Actor *this, s32 arg1, u8 arg2){ + f32 sp20[3]; + f32 num; + f32 den; + f32 phi_f2; + + switch (arg2) { + case 1: + player_getPosition(sp20); + break; + + case 2: + sp20[0] = this->unk1C[0]; + sp20[1] = this->unk1C[1]; + sp20[2] = this->unk1C[2]; + break; + } + + den = (this->position[0] - sp20[0])*(this->position[0] - sp20[0]) + (this->position[2] - sp20[2])*(this->position[2] - sp20[2]); + num = (this->position[1] - sp20[1]) - (f32)arg1; + if(num == 0.0 || den == 0.0) + return 0.0f; + phi_f2 = -num/den; + return (phi_f2 >= 4.0f) ? 4.0f + : (phi_f2 <= -4.0f) ? -4.0f + : phi_f2; +} +#endif + +int func_803604E8(Actor *this){ + f32 tmp_f0; + this->yaw_moving = (f32) func_80329784(this); + tmp_f0 = func_803603AC(this, 170, 1); + func_8035FFAC(this, tmp_f0); + if(!func_80360198(this)){ + return 0; + } + return 1; +} + +bool func_8036054C(Actor *this) { + s32 phi_v0; + s32 phi_s1; + s32 phi_s2; + + if (this->unk60 == 0.0f) { + this->yaw_moving = func_80257204(this->position[0], this->position[2], this->unk1C[0], this->unk1C[2]); + func_8035FFAC(this, func_803603AC(this, -110, 2)); + } + else{ + func_80328FB0(this, 5.0f); + func_80360044(this); + if (func_80329480(this) != 0) { + this->unk60 = 0.0f; + } else { + return TRUE; + } + } + for(phi_s2 = 0; !func_80360198(this) && phi_s2 < 1; phi_s2++){ + this->unk60 = 45.0f; + func_80328CEC(this, (s32) this->yaw, 90, 180); + phi_s1 = 0; + do{ + if (this->unk38_0) { + phi_v0 = func_80329140(this, (s32) this->yaw_moving, 0xC8); + } else { + phi_v0 = func_80329078(this, (s32) this->yaw_moving, 0xC8); + } + + if(phi_v0 == 0){ + phi_s1++; + this->yaw_moving += 30.0f; + if (this->yaw_moving >= 360.0f) { + this->yaw_moving -= 360.0f; + } + } + } while ( phi_v0 == 0 && phi_s1 < 0xC); + } + if (this->position[1] < (this->unk1C[1] + -110.0f)) { + this->velocity[1] = 1.0f; + } else { + this->velocity[1] = (f32) randi2(0, 0); + } + if (this->position[1] <= func_80309724(this->position)) { + this->velocity[0] = 3.0f; + } + return TRUE; +} + +void func_80360790(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + ActorLocal_Core2_D89E0 *local = (ActorLocal_Core2_D89E0 *)&this->local; + func_8035FAE0(this); + local->unk0 = 0.0f; + this->marker->collidable = FALSE; + FUNC_8030E8B4(SFX_115_BUZZBOMB_DEATH, 1.3f, 26000, this->position, 1250, 2500); +} + +void func_803607FC(ActorMarker *this_marker, ActorMarker *other_marker){ + Actor *this = marker_getActor(this_marker); + ActorLocal_Core2_D89E0 *local = (ActorLocal_Core2_D89E0 *)&this->local; + local->unk0 = 0.8f; +} + +void func_80360828(Actor *this){ + f32 sp3C = time_getDelta(); + ActorLocal_Core2_D89E0 *local = (ActorLocal_Core2_D89E0 *)&this->local; + f32 sp34; + + if(!this->initialized){ + this->initialized = TRUE; + marker_setCollisionScripts(this->marker, NULL, func_803607FC, func_80360790); + this->unk38_0 = FALSE; + this->unk28 = 0.0f; + this->velocity_x = 0.0f; + this->unk1C_x = this->position_x; + this->unk1C_y = this->position_y; + this->unk1C_z = this->position_z; + local->unk4 = this->yaw; + } + if(local->unk0 <= 0.0){ + local->unk0 = 0.0f; + }else{//L80360910 + local->unk0 -= sp3C; + return; + } + + switch(this->state){ + case 1: //L80360918 + if(func_8035FDA4(this)){ + func_8035F99C(this); + } + break; + case 2: //L80360938 + if( 0.98 < animctrl_getAnimTimer(this->animctrl) + || !func_8035FD28(this) + ){ + func_8035FA0C(this); + } + break; + case 3: //L8036097C + animctrl_setDuration(this->animctrl, 1.2 - this->velocity_y); + if(!func_8035FDA4(this)){ + func_8035FA48(this); + } + else if(!func_803604E8(this)){ + func_8035FA48(this); + this->unk38_31 = 0x3C; + } + else{ + if(!(func_8023DB5C() & 0xf)){ + if(randf() < 0.35){ + FUNC_8030E8B4(SFX_419_UNKNOWN, 1.0f, 28000, this->position, 1250, 2500); + } + } + }//L80360A40 + if(actor_animationIsAt(this, 0.5f)){ + func_8030E878(SFX_2_CLAW_SWIPE, randf2(1.0f, 1.2f), 10000, this->position, 833.0f, 2500.0f); + } + break; + case 4: //L80360A9C + if(func_8035FDA4(this)){ + func_8035FA0C(this); + } else if(func_8035FB48(this, 0x14)){ + func_8035FA74(this); + } else{ + func_8036054C(this); + }//L80360AE8 + + if(actor_animationIsAt(this, 0.5f)){ + func_8030E878(SFX_2_CLAW_SWIPE, randf2(1.0f, 1.2f), 10000, this->position, 833.0f, 2500.0f); + } + break; + case 5: //L80360B3C + if(func_8035FDA4(this)){ + func_8035FA0C(this); + } else if(func_8035FBA8(this, 1)){ + func_8035FAA8(this); + } else{ + func_80328FB0(this, 5.0f); + func_8035FC20(this, this->unk1C_y, 2.0f); + func_80360130(this); + }//L80360BA0 + + if(actor_animationIsAt(this, 0.5f)){ + func_8030E878(SFX_2_CLAW_SWIPE, randf2(1.0f, 1.2f), 10000, this->position, 833.0f, 2500.0f); + } + break; + case 6: //L80360BF4 + if(animctrl_getAnimTimer(this->animctrl) < 0.01){ + func_8035F970(this); + } + break; + case 7: //L80360C28 + sp34 = time_getDelta(); + func_8032CA80(this, this->unk38_0 ? 0x13 : 0x4); + if(func_8035FC98(this, this->velocity_x * sp34)){ + this->position_y = func_80309724(this->position); + func_80328B8C(this, 8, 0.01f, 1); + actor_playAnimationOnce(this); + func_8030E6A4(SFX_1F_HITTING_AN_ENEMY_3, 1.2f, 32200); + } + else{//L80360CC4 + this->position_y += this->velocity_x * sp34; + this->velocity_x -= 1600.0f * sp34; + } + break; + case 8: //L80360CF0 + if(actor_animationIsAt(this, 0.3f)){ + func_80326310(this); + } + break; + } +} diff --git a/src/core2/code_D9B0.c b/src/core2/code_D9B0.c new file mode 100644 index 00000000..5007b065 --- /dev/null +++ b/src/core2/code_D9B0.c @@ -0,0 +1,198 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_802944A8(void); + +/* .bss */ +f32 D_8037C2A0[3]; //recoil_target_position +f32 D_8037C2B0[3]; //talk_target_position +f32 D_8037C2C0[3]; //throw_target_position +f32 D_8037C2CC; +enum transformation_e D_8037C2D0; +f32 D_8037C2D8[3]; +f32 D_8037C2E4; +enum asset_e D_8037C2E8; +u8 D_8037C2ED; +u8 D_8037C2EC; + +struct{ + f32 unk0; + f32 unk4; + u8 unk8; +}D_8037C2F0; + +/* .code */ +f32 func_80294940(void){ + return D_8037C2F0.unk0; +} + +f32 func_8029494C(void){ + return D_8037C2F0.unk0 - func_80294500(); +} + +enum asset_e func_80294974(void){ + return D_8037C2E8; +} + +void func_80294980(f32 dst[3]){ + ml_vec3f_copy(dst, D_8037C2A0); +} + +void func_802949A4(f32 dst[3]){ + ml_vec3f_copy(dst, D_8037C2D8); +} + +int func_802949C8(void){ + return D_8037C2EC; +} + +f32 get_slope_timer(void){ + return D_8037C2E4 * (f64)1; +} + +void func_802949F8(f32 dst[3]){ + ml_vec3f_copy(dst, D_8037C2B0); +} + +void func_80294A1C(f32 dst[3]){ + ml_vec3f_copy(dst, D_8037C2C0); +} + +f32 func_80294A40(void){ + return D_8037C2CC; +} + +enum transformation_e func_80294A4C(void){ + return D_8037C2D0; +} + +void func_80294A58(enum asset_e asset_id){ + D_8037C2E8 = asset_id; +} + +void func_80294A64(f32 src[3]) +{ ml_vec3f_copy(D_8037C2A0, src); +} + +void func_80294A8C(int arg0){ + D_8037C2EC = arg0; +} + +void func_80294A98(f32 src[3]) +{ ml_vec3f_copy(D_8037C2B0, src); +} + +void func_80294AC0(f32 src[3]) +{ ml_vec3f_copy(D_8037C2C0, src); +} + +void func_80294AE8(f32 arg0){ + D_8037C2CC = arg0; +} + +void func_80294AF4(enum transformation_e xform){ + D_8037C2D0 = xform; +} + +void func_80294B00(int arg0){ + D_8037C2F0.unk8 = arg0; +} + +void func_80294B0C(void){ + f32 sp1C = player_getYPosition(); + int sp18 = func_8028ECAC(); + if( func_8028B2E8() + || player_inWater() + || (sp18 == BSGROUP_A_FLYING && player_getActiveHitbox(0) != HITBOX_3_BEAK_BOMB) + || sp18 == BSGROUP_5_CLIMB + ){////L80294B74 + func_80294B00(1); + } + else{ + func_80294B00(2); + } + + if(D_8037C2F0.unk8 != 2 || !(sp1C <= D_8037C2F0.unk4)){ + D_8037C2F0.unk0 = D_8037C2F0.unk4; + D_8037C2F0.unk4 = sp1C; + } +} + +void func_80294BDC(void) { + Struct60s *temp_v0; + f32 sp30; + f32 sp2C; + f32 sp28; + s32 sp24; + + sp28 = time_getDelta(); + sp2C = func_802944A8(); + sp24 = func_80294660(); + if ((map_get() == MAP_34_RBB_ENGINE_ROOM) && ((sp24 * 0x10) < 0)) { + D_8037C2ED = 1; + } + if (D_8037C2ED != 0) { + D_8037C2E4 = (sp2C > 35.0f) ? 1.0f : 0.0f; + } else { + sp30 = ml_map_f(sp2C, 20.0f, 60.0f, 0.6f, 1.3f); + if (!func_80294548() && !(sp24 & 0x50)) { + temp_v0 = func_802946F0(); + if (temp_v0) { + if (temp_v0->unk8 & 0x50) { + sp24 = temp_v0->unk8; + } + } + } + if (map_get() == MAP_C_MM_TICKERS_TOWER) { + sp28 *= 2.0; + } + if ((sp24 & 0x50) && !player_inWater()) { + D_8037C2E4 = min_f((sp28 * sp30) + D_8037C2E4, 1.0f); + } else { + D_8037C2E4 = 0.0f; + } + if (D_8037C2E4 == 1.0) { + if (sp24 & 0x10) { + func_802917E4(5, 0.18f); + } else if (sp24 & 0x40) { + func_802917E4(6, 0.18f); + } + } + } + D_8037C2ED = 0; +} + +void func_80294DD8(void){ + ml_vec3f_clear(D_8037C2A0); + ml_vec3f_clear(D_8037C2B0); + _player_getPosition(D_8037C2D8); + D_8037C2ED = 0; + D_8037C2E4 = 0.0f; + D_8037C2EC = 1; + D_8037C2F0.unk8 = 0; + D_8037C2F0.unk4 = D_8037C2F0.unk0 = player_getYPosition(); +} + +void func_80294E54(int arg0){ + D_8037C2ED = arg0; +} + +void func_80294E60(void){ + if(func_8028B2E8()){ + _player_getPosition(D_8037C2D8); + } + + if(func_8028B2E8() || bsclimb_inSet(bs_getState())){ + miscflag_clear(5); + miscflag_clear(0x12); + } + + if(player_inWater()){ + miscflag_clear(5); + miscflag_clear(0x12); + } + + func_80294BDC(); + func_80294B0C(); +} diff --git a/src/core2/code_DA3A0.c b/src/core2/code_DA3A0.c new file mode 100644 index 00000000..f871a127 --- /dev/null +++ b/src/core2/code_DA3A0.c @@ -0,0 +1,113 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + u8 *unk0; + f32 unk4; +} ActorLocal_Core2_DA3A0; + +void func_8036158C(Actor *this); + +/* .data */ +u8 D_80373130[] = {0, 1, 0, 0}; + +ActorInfo D_80373134 = { + 0x1a6, 0x289, 0x431, + 0x0, NULL, + func_8036158C, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_80373158 = { + 0x1a6, 0x28f, 0x431, + 0x0, NULL, + func_8036158C, NULL, func_80325888, + 0, 0, 0.0f, 0 +}; + +struct31s D_8037317C = { + {0.01f, 0.01f}, + {2.5f, 3.0f}, + {0.05f, 0.05f}, + {0.4f, 0.7f}, + 0.1f, 0.5f +}; + +/* .code */ +void func_80361330(Actor *this, s32 next_state){ + ActorLocal_Core2_DA3A0 *local = (ActorLocal_Core2_DA3A0 *)&this->local; + ParticleEmitter *pctrl; + s32 tmp_s0; + f32 sp40[3]; + + if(next_state == 1) + local->unk4 = 3.0f; + + if(next_state == 2){ + pctrl = partEmitList_pushNew(6); + sp40[0] = 1000.0f; + sp40[1] = 100.0f; + sp40[2] = 0.0f; + ml_vec3f_roll_rotate_copy(sp40, sp40, this->roll); + ml_vec3f_yaw_rotate_copy(sp40, sp40, this->yaw); + particleEmitter_setSprite(pctrl, ASSET_70E_SPRITE_SMOKE_2); + particleEmitter_setParticleAccelerationRange(pctrl, 0.0f, 200.0f, 0.0f, 0.0f, 1000.0f, 0.0f); + particleEmitter_setStartingFrameRange(pctrl, 0, 7); + particleEmitter_setParticleSpawnPositionRange(pctrl, -20.0f, -20.0f, -20.0f, 20.0f, 20.0f, 20.0f); + particleEmitter_setPosition(pctrl, this->position); + func_802EFB98(pctrl, &D_8037317C); + particleEmitter_setParticleVelocityRange(pctrl, + sp40[0] *0.6, sp40[1]*0.6, sp40[2]*0.6, + sp40[0], sp40[1], sp40[2] + ); + particleEmitter_setSpawnInterval(pctrl, 0.5f); + tmp_s0 = func_802F9AA8(SFX_B0_SIZZLING_NOISE); + func_802F9DB8(tmp_s0, 0.7f, 0.7f, 0.0f); + func_802F9EC4(tmp_s0, this->position, 0x1f4, 0x5dc); + func_802F9F80(tmp_s0, 0.0f, 0.2f, 0.6f); + func_802FA060(tmp_s0, 27000, 27000, 0.0f); + local->unk4 = 0.6f; + func_80335924(this->unk148, 0x169, 0.0f, 0.6f); + func_80335A8C(this->unk148, 2); + + }//L8036155C + this->state = next_state; +} + +void func_8036158C(Actor *this){ + ActorLocal_Core2_DA3A0 *local = (ActorLocal_Core2_DA3A0 *)&this->local; + f32 sp30; + f32 sp24[3]; + + sp30 = time_getDelta(); + + if(!this->unk16C_4){ + this->marker->propPtr->unk8_3 = TRUE; + this->unk16C_4 = TRUE; + local->unk0 = &D_80373130[this->modelCacheIndex - 0x289]; + if(*local->unk0){ + this->roll = this->yaw; + this->yaw = 0.0f; + } + func_80361330(this, 1); + } + + if(this->state == 1){ + player_getPosition(sp24); + actor_collisionOff(this); + if( ml_vec3f_distance(this->position, sp24) < 1000.0f + && func_8024DC04(this->position_x, this->position_y, this->position_z) + && func_8025773C(&local->unk4, sp30) + ){ + func_80361330(this, 2); + } + }//L803616A0 + + if(this->state == 2){ + actor_collisionOn(this); + if(func_8025773C(&local->unk4, sp30)){ + func_80361330(this, 1); + } + } +} diff --git a/src/core2/code_DA760.c b/src/core2/code_DA760.c new file mode 100644 index 00000000..5a88b2f3 --- /dev/null +++ b/src/core2/code_DA760.c @@ -0,0 +1,72 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80361870(Actor *this); + +/* .data */ +ActorInfo D_803731B0 = { + 0x1E4, 0x373, 0, + 0, NULL, + func_80361870, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; + +/* .code */ +int func_803616F0(Actor *this){ + switch(this->unkF4_8){ + case 1:// L80361728 + return func_8031FF1C(BKPROG_31_MM_OPEN) && !func_802D9220(LEVEL_1_MUMBOS_MOUNTAIN); + case 2:// L80361750 + return func_8031FF1C(BKPROG_32_TTC_OPEN) && !func_802D9220(LEVEL_2_TREASURE_TROVE_COVE); + case 3:// L80361778 + return func_8031FF1C(BKPROG_33_CC_OPEN) && !func_802D9220(LEVEL_3_CLANKERS_CAVERN); + case 4:// L803617A0 + return func_8031FF1C(BKPROG_34_BGS_OPEN) && !func_802D9220(LEVEL_4_BUBBLEGLOOP_SWAMP); + case 5:// L803617C8 + return func_8031FF1C(BKPROG_35_FP_OPEN) && !func_802D9220(LEVEL_5_FREEZEEZY_PEAK); + case 6:// L803617F0 + return func_8031FF1C(BKPROG_36_GV_OPEN) && !func_802D9220(LEVEL_7_GOBIS_VALLEY); + default: + return FALSE; + } +} + +void func_80361828(Actor *this){ + if(func_803203FC(0x16) && level_get() == LEVEL_6_LAIR){ + func_803204E4(0x16, 0); + } +} + +void func_80361870(Actor *this){ + s32 text_id; + s32 sp28; + if(!this->unk16C_4){ + func_803300D8(this->marker, func_80361828); + this->unk16C_4 = 1; + } + + if(!this->unk138_24 && func_80329530(this, 400) && !func_80329530(this, 50)){ + if(this->unkF4_8 == 1 && !func_8031FF1C(BKPROG_31_MM_OPEN) && level_get() == LEVEL_6_LAIR){ + text_id = func_8031FF1C(BKPROG_A7_NEAR_PUZZLE_PODIUM_TEXT)? 0xF80 : 0xF7F; + if(func_80311480(text_id, 0, 0, 0, 0, 0)){ + this->unk138_24 = TRUE; + } + } + else if(func_803616F0(this)){ + sp28 = (func_803203FC(0x16)?0xf6e:0xf68) + this->unkF4_8 - 1; + if(!func_803203FC(0x16) && level_get() == LEVEL_6_LAIR){ + this->unk138_24 = TRUE; + } + else{ + if(func_80311480(sp28, 0, 0, 0, 0, 0)){ + this->unk138_24 = TRUE; + func_803204E4(0x16, 0); + } + } + } + else{//L80361A14 + func_803204E4(0x16, 0); + } + }//L80361A20 +} diff --git a/src/core2/code_DAAA0.c b/src/core2/code_DAAA0.c new file mode 100644 index 00000000..89dc7e42 --- /dev/null +++ b/src/core2/code_DAAA0.c @@ -0,0 +1,161 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80288C7C(VLA**); +extern void func_80288D84(s32, f32, void (*)(s32,s32), s32, s32); +extern void func_80288DCC(s32 , f32, void (*)(s32, s32,s32), s32, s32, s32); + +extern Struct62s D_803731E0[0x20]; + +/* .code */ +void func_80361A30(f32 arg0[3], s32 arg1){ + if(func_8024DD0C(arg0)){ + func_8030E6A4(arg1 >> 16, ((arg1 >> 8) & 0xff)*0.0078125, (arg1 & 0xff)*128.0); + } +} + +void func_80361AB0(s32 marker, s32 arg1){ + Actor *actor; + + actor = marker_getActor(reinterpret_cast(ActorMarker *,marker)); + func_80361A30(actor->position, arg1); +} + +void func_80361AE0(s32 arg0, s32 arg1, s32 arg2){ + Actor *this; + f32 sp20[3]; + ActorMarker *marker; + struct5Bs *tmp; + + marker = reinterpret_cast(ActorMarker *,arg0); + this = marker_getActor(marker); + tmp = this->marker->unk44; + if(tmp){ + func_8034A174(tmp, arg1, sp20); + if(func_802582EC(sp20)){ + ml_vec3f_copy(sp20, this->position); + } + } else {//L80361B44 + ml_vec3f_copy(sp20, this->position); + } + func_80361A30(sp20, arg2); +} + +void func_80361B68(s32 arg0, s32 arg1){ + ActorMarker *marker; + f32 arg1_f; + Actor *actor; + + marker = reinterpret_cast(ActorMarker *,arg0); + actor = marker_getActor(marker); + func_803246F0(actor->unk160, arg1); +} + +void func_80361B98(s32 arg0, s32 arg1, s32 arg2){ + ActorMarker *marker; + f32 arg1_f; + Actor *actor; + + marker = reinterpret_cast(ActorMarker *,arg0); + actor = marker_getActor(marker); + func_80324770(actor->unk160, arg1, arg2); +} + +void func_80361BD0(s32 arg0, s32 arg1, s32 arg2){ + ActorMarker *marker; + f32 arg1_f; + Actor *actor; + + marker = reinterpret_cast(ActorMarker *,arg0); + actor = marker_getActor(marker); + arg1_f = reinterpret_cast(f32,arg1); + + actor->unk1C[0] = arg1_f; + actor->unk1C[1] = 0.0f; + actor->unk124_11 = arg2; +} + +void func_80361C24(s32 arg0, f32 arg1, s32 arg2, f32 arg3){ + func_80288D84(arg0, arg1, func_80361B68, reinterpret_cast(s32, arg2), reinterpret_cast(s32, arg3)); +} + +void func_80361C64(s32 arg0, f32 arg1, s32 arg2, s32 arg3, s32 arg4){ + func_80288DCC(arg0, arg1, func_80361B98, reinterpret_cast(s32, arg2), reinterpret_cast(s32, arg3), arg4); +} + +void func_80361CAC(s32 arg0, f32 arg1, s32 arg2, f32 arg3){ + func_80288DCC(arg0, arg1, func_80361BD0, reinterpret_cast(s32, arg2), reinterpret_cast(s32, arg3), 1); +} + +void func_80361CF4(s32 arg0, f32 arg1, s32 arg2, f32 arg3){ + func_80288DCC(arg0, arg1, func_80361BD0, reinterpret_cast(s32, arg2), reinterpret_cast(s32, arg3), 2); +} + +void func_80361D3C(s32 arg0, f32 arg1, s32 arg2, s32 arg3){ + func_80288D84(arg0, arg1, func_80361AB0, reinterpret_cast(s32, arg2), reinterpret_cast(s32, arg3)); +} + +void func_80361D7C(s32 arg0, f32 arg1, s32 arg2, s32 arg3, u32 arg4){ + func_80288DCC(arg0, arg1, func_80361AE0, reinterpret_cast(s32, arg2), arg3, arg4); +} + +void func_80361DC4(Actor *this){ + if(this->unk134){ + func_802890D0(this->unk134); + } + this->unk134 = NULL; + + if(this->unk160){ + func_8032477C(this->unk160); + } +} + +void func_80361E10(Actor *this) { + s32 phi_v0; + + for(phi_v0 = 0; phi_v0 < 0x20; phi_v0++){ + if(D_803731E0[phi_v0].unk0 == this->modelCacheIndex){ + this->unk108 = &D_803731E0[phi_v0]; + this->unk134 = func_802890FC(); + this->unk160 = func_8032479C(); + this->unk10C = 0; + return; + } + } + this->unk134 = 0; + this->unk160 = 0; +} + + +void func_80361E9C(Actor *this){ + if( this->animctrl != NULL + && this->unk134 != NULL + && this->unk160 != NULL + ){ + func_80324700(this->unk160); + } +} + +void func_80361EE0(Actor *this) { + s32 i; + s32 sp28; + Struct62s *sp24; + Struct63s *sp20; + + if (this->animctrl != NULL && this->unk134 != NULL) { + sp24 = this->unk108; + sp28 = animctrl_getIndex(this->animctrl); + if (sp28 != this->unk10C) { + this->unk10C = sp28; + func_80288C7C(this->unk134); + for(sp20 = sp24->unk4; sp20->unk4 != NULL; sp20++){ + if (sp28 == sp20->unk0) { + sp20->unk4(this->unk134, this->marker); + break; + } + } + } + func_8028914C(this->unk134, this->animctrl); + } +} diff --git a/src/core2/code_DB010.c b/src/core2/code_DB010.c new file mode 100644 index 00000000..bc85aa84 --- /dev/null +++ b/src/core2/code_DB010.c @@ -0,0 +1,735 @@ +#include +#include "functions.h" +#include "variables.h" + +extern int func_8024DB50(f32[3], f32 ); +extern void func_802EFF5C(ParticleEmitter *, f32, f32, f32); +extern void func_802EFF7C(ParticleEmitter *, f32, f32, f32); +extern void func_802EFF9C(ParticleEmitter *, f32); + +void func_80363310(Actor *this); +void func_80363330(Actor *this); + +//this may be the inner structs of a prop(?) +typedef struct{ + s16 x; + s16 y; + s16 z; + u16 unk8_7:9; + u16 pad8_6:7; +}struct_core2_DB010; + +/* .data */ +extern ActorInfo D_803732E0= { + 0x1F7, 0x1E7, 0, + 0, NULL, + func_80363310, func_80363330, func_80325340, + 0, 0, 0.0f, 0 +}; + +extern struct40s D_80373304; +// 000E C370: 3E CC CC CD 3F B3 33 33 00 00 00 00 +// 000E C380: 00 00 00 00 00 00 00 00 3C 23 D7 0A 40 80 00 00 +// 000E C390: 40 80 00 00 3F 00 00 00 3F 33 33 33 40 80 00 00 +// 000E C3A0: 41 70 00 00 + +extern struct43s D_80373334; +// C3 7A 00 00 44 16 00 00 C3 7A 00 00 +// 000E C3B0: 43 AF 00 00 44 70 00 00 43 AF 00 00 00 00 00 00 +// 000E C3C0: C4 96 00 00 00 00 00 00 00 00 00 00 C4 96 00 00 +// 000E C3D0: 00 00 00 00 C2 70 00 00 C1 F0 00 00 C2 70 00 00 +// 000E C3E0: 42 70 00 00 41 F0 00 00 42 70 00 00 + +extern s32 D_8037337C[3] = {50, 255, 50}; + +extern struct40s D_80373388; +// 3E 99 99 9A 3C F5 C2 8F +// 000E C400: 3F 00 00 00 3F 00 00 00 00 00 00 00 3C 23 D7 0A +// 000E C410: 3F C0 00 00 40 00 00 00 3D 75 C2 8F 3F 33 33 33 +// 000E C420: 40 80 00 00 3F 80 00 00 + +extern struct42s D_803733B8; +// C0 A0 00 00 42 C8 00 00 +// 000E C430: C0 A0 00 00 40 A0 00 00 42 C8 00 00 40 A0 00 00 +// 000E C440: C2 70 00 00 00 00 00 00 C2 70 00 00 42 70 00 00 +// 000E C450: 40 A0 00 00 42 70 00 00 + +extern s32 D_803733E8[3] = {0xb4, 0xe6, 0xff}; + + +extern struct40s D_803733F4; +// 3F 80 00 00 3F E6 66 66 40 0C CC CD +// 000E C470: 40 2C CC CD 00 00 00 00 3C 23 D7 0A 3F 4C CC CD +// 000E C480: 3F 99 99 9A 3E D1 EB 85 3F 3A E1 48 40 80 00 00 +// 000E C490: 41 70 00 00 + +extern struct43s D_80373424; +// C3 96 00 00 44 16 00 00 C3 96 00 00 +// 000E C4A0: 43 96 00 00 44 7A 00 00 43 96 00 00 00 00 00 00 +// 000E C4B0: C4 96 00 00 00 00 00 00 00 00 00 00 C4 C8 00 00 +// 000E C4C0: 00 00 00 00 C1 20 00 00 00 00 00 00 C1 20 00 00 +// 000E C4D0: 41 20 00 00 00 00 00 00 41 20 00 00 + +extern struct40s D_8037346C; +// 3E 99 99 9A +// 000E C4E0: 3E CC CC CD 3F 00 00 00 3F 00 00 00 00 00 00 00 +// 000E C4F0: 3C 23 D7 0A 3F 4C CC CD 3F 99 99 9A 3F 68 F5 C3 +// 000E C500: 3F 7D 70 A4 40 80 00 00 41 90 00 00 + +extern struct43s D_8037349C; +// C3 48 00 00 +// 000E C510: 44 61 00 00 C3 48 00 00 43 48 00 00 44 AF 00 00 +// 000E C520: 43 48 00 00 00 00 00 00 C4 E1 00 00 00 00 00 00 +// 000E C530: 00 00 00 00 C5 16 00 00 00 00 00 00 C1 20 00 00 +// 000E C540: C1 A0 00 00 C1 20 00 00 41 20 00 00 C1 A0 00 00 +// 000E C550: 41 20 00 00 + +extern struct40s D_803734E4; +// 40 4C CC CD 40 59 99 9A 00 00 00 00 +// 000E C560: 00 00 00 00 00 00 00 00 3C 23 D7 0A 40 00 00 00 +// 000E C570: 40 00 00 00 00 00 00 00 3E 99 99 9A 40 80 00 00 +// 000E C580: 41 70 00 00 C4 6D 80 00 44 48 00 00 C3 7A 00 00 +// 000E C590: C4 09 80 00 44 AA 00 00 42 48 00 00 C4 2F 00 00 +// 000E C5A0: C4 D4 80 00 00 00 00 00 C4 61 00 00 C4 D4 80 00 +// 000E C5B0: 00 00 00 00 C2 70 00 00 00 00 00 00 C2 70 00 00 +// 000E C5C0: 42 70 00 00 41 F0 00 00 42 70 00 00 40 40 00 00 +// 000E C5D0: 40 59 99 9A 00 00 00 00 00 00 00 00 00 00 00 00 +// 000E C5E0: 3C 23 D7 0A 40 80 00 00 40 80 00 00 00 00 00 00 +// 000E C5F0: 3E 99 99 9A 40 80 00 00 41 70 00 00 C3 E1 00 00 +// 000E C600: 44 16 00 00 C2 48 00 00 C3 16 00 00 44 89 80 00 +// 000E C610: 42 48 00 00 C4 2F 00 00 C4 D4 80 00 00 00 00 00 +// 000E C620: C4 48 00 00 C4 D4 80 00 00 00 00 00 C2 70 00 00 +// 000E C630: 00 00 00 00 C2 70 00 00 42 70 00 00 41 F0 00 00 +// 000E C640: 42 70 00 00 3F 8C CC CD 3F 8C CC CD 40 89 99 9A +// 000E C650: 40 89 99 9A 00 00 00 00 3D 4C CC CD 3E 99 99 9A +// 000E C660: 3F 00 00 00 3D 75 C2 8F 3E 99 99 9A 40 80 00 00 +// 000E C670: 3F 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +// 000E C680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +// 000E C690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +// 000E C6A0: 00 00 00 00 00 00 00 0A 00 00 00 FF 00 00 00 0A +// 000E C6B0: 40 00 00 00 40 00 00 00 40 40 00 00 40 60 00 00 +// 000E C6C0: 00 00 00 00 3C 23 D7 0A 40 00 00 00 40 20 00 00 +// 000E C6D0: 3D CC CC CD 3E CC CC CD 40 80 00 00 3F 80 00 00 +// 000E C6E0: 00 00 00 00 42 20 00 00 00 00 00 00 00 00 00 00 +// 000E C6F0: 42 B4 00 00 00 00 00 00 C3 C8 00 00 00 00 00 00 +// 000E C700: C3 C8 00 00 43 C8 00 00 00 00 00 00 43 C8 00 00 +// 000E C710: 00 00 00 FF 00 00 00 FF 00 00 00 FF 3C 23 D7 0A +// 000E C720: 3C 23 D7 0A 3F C0 00 00 3F CC CC CD 3D 4C CC CD +// 000E C730: 3F 33 33 33 3F 33 33 33 3F A6 66 66 3D CC CC CD +// 000E C740: 3F 4C CC CD 40 80 00 00 41 C8 00 00 3F 33 33 33 +// 000E C750: 3F 66 66 66 3E CC CC CD 3F 00 00 00 00 00 00 00 +// 000E C760: 3C 23 D7 0A 3F 4C CC CD 3F 80 00 00 3E 19 99 9A +// 000E C770: 3E 99 99 9A 00 00 00 00 3F 80 00 00 C1 20 00 00 +// 000E C780: C1 20 00 00 C1 20 00 00 41 20 00 00 41 20 00 00 +// 000E C790: 41 20 00 00 00 00 00 00 41 F0 00 00 00 00 00 00 +// 000E C7A0: 00 00 00 00 41 F0 00 00 00 00 00 00 3D 4C CC CD +// 000E C7B0: 3D CC CC CD 3D CC CC CD 3E 4C CC CD 00 00 00 00 +// 000E C7C0: 3C 23 D7 0A 3F B3 33 33 3F C0 00 00 3C 23 D7 0A +// 000E C7D0: 3F 33 33 33 00 00 00 00 3F 80 00 00 C0 A0 00 00 +// 000E C7E0: C0 A0 00 00 C0 A0 00 00 40 A0 00 00 40 A0 00 00 +// 000E C7F0: 40 A0 00 00 00 00 00 00 C2 48 00 00 00 00 00 00 +// 000E C800: 00 00 00 00 C2 B4 00 00 00 00 00 00 C1 F0 00 00 +// 000E C810: 41 F0 00 00 C1 F0 00 00 41 F0 00 00 42 70 00 00 +// 000E C820: 41 F0 00 00 00 00 00 FF 00 00 00 FF 00 00 00 00 +// 000E C830: 3D CC CC CD 3E 99 99 9A 3F 19 99 9A 3F 33 33 33 +// 000E C840: 00 00 00 00 3C 23 D7 0A 3E 99 99 9A 3E CC CC CD +// 000E C850: 3C 23 D7 0A 3E 99 99 9A 40 80 00 00 41 80 00 00 +// 000E C860: C4 16 00 00 C4 16 00 00 C4 16 00 00 44 16 00 00 +// 000E C870: 44 16 00 00 44 16 00 00 00 00 00 00 41 F0 00 00 +// 000E C880: 00 00 00 00 00 00 00 00 41 F0 00 00 00 00 00 00 + + + +extern s32 D_80373514; + +extern s32 D_8037355C; + +extern s32 D_8037358C; + +extern s32 D_803735D4; + +extern struct42s D_80373604; + +extern s32 D_80373634; + +extern s32 D_80373640; + +extern struct42s D_80373670; + +extern s32 D_803736A0[3]; + +extern struct40s D_803736AC; + +extern s32 D_803736DC; + +extern struct42s D_8037370C; + +extern s32 D_8037373C; + +extern s32 D_8037376C; + +extern s32 D_803737B4; + +extern s32 D_803737C0; + +extern struct42s D_803737F0; + + +extern s32 D_80373820[3] = {130, 155, 40}; +extern struct40s D_8037382C; +// 40 53 33 33 +// 000E C8A0: 40 53 33 33 40 90 00 00 40 96 66 66 00 00 00 00 +// 000E C8B0: 3C 23 D7 0A 3F E6 66 66 40 4C CC CD 3E 9E B8 52 +// 000E C8C0: 3F 3A E1 48 40 80 00 00 41 30 00 00 + +extern struct43s D_8037385C; +// C3 48 00 00 +// 000E C8D0: 42 F0 00 00 C3 48 00 00 43 48 00 00 43 02 00 00 +// 000E C8E0: 43 48 00 00 00 00 00 00 C2 C8 00 00 00 00 00 00 +// 000E C8F0: 00 00 00 00 C2 C8 00 00 00 00 00 00 C1 F0 00 00 +// 000E C900: 00 00 00 00 C1 F0 00 00 41 F0 00 00 00 00 00 00 +// 000E C910: 41 F0 00 00 + +extern s32 D_803738A4[3] = {91, 142, 0}; +extern struct40s D_803738B0; +// 000E C920: 3E 4C CC CD 3F 66 66 66 3E CC CC CD 3F 66 66 66 +// 000E C930: 00 00 00 00 3C 23 D7 0A 3F E6 66 66 40 86 66 66 +// 000E C940: 3E 9E B8 52 3F 3A E1 48 40 80 00 00 41 50 00 00 + +extern struct43s D_803738E0; +// 000E C950: C3 C8 00 00 44 02 00 00 C3 C8 00 00 43 C8 00 00 +// 000E C960: 44 3B 80 00 43 C8 00 00 00 00 00 00 C4 96 00 00 +// 000E C970: 00 00 00 00 00 00 00 00 C4 C8 00 00 00 00 00 00 +// 000E C980: C1 F0 00 00 00 00 00 00 C1 F0 00 00 41 F0 00 00 +// 000E C990: 00 00 00 00 41 F0 00 00 + +extern s32 D_80373928[3] = {0, 255, 0}; +extern struct40s D_80373934; + // 3F B3 33 33 3F F3 33 33 40 19 99 9A +// 000E C9B0: 40 39 99 9A 00 00 00 00 40 4C CC CD 41 0C CC CD +// 000E C9C0: 41 13 33 33 3E 9E B8 52 3F 3A E1 48 40 80 00 00 +// 000E C9D0: 41 50 00 00 + +extern struct43s D_80373964; +// C2 70 00 00 42 C8 00 00 C2 70 00 00 +// 000E C9E0: 42 70 00 00 43 2A 00 00 42 70 00 00 00 00 00 00 +// 000E C9F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +// 000E CA00: 00 00 00 00 C1 F0 00 00 00 00 00 00 C1 F0 00 00 +// 000E CA10: 41 F0 00 00 00 00 00 00 41 F0 00 00 + +extern s32 D_803739AC[3] = {255, 255, 255}; +extern struct40s D_803739B8; +// 3E 4C CC CD 3F 66 66 66 +// 000E CA30: 3E 99 99 9A 3E CC CC CD 00 00 00 00 3E 4C CC CD +// 000E CA40: 3F 80 00 00 3F 99 99 9A 3E 9E B8 52 3F 3A E1 48 +// 000E CA50: 40 80 00 00 41 50 00 00 + +extern struct43s D_803739E8; +// C4 16 00 00 00 00 00 00 +// 000E CA60: C4 16 00 00 44 16 00 00 00 00 00 00 44 16 00 00 +// 000E CA70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +// 000E CA80: 00 00 00 00 00 00 00 00 00 00 00 00 42 20 00 00 +// 000E CA90: 00 00 00 00 00 00 00 00 42 20 00 00 00 00 00 00 + +extern s32 D_80373A30[3] = {255, 255, 255}; +extern struct40s D_80373A3C; +// 3F C0 00 00 +// 000E CAB0: 3F CC CC CD 40 20 00 00 40 39 99 9A 00 00 00 00 +// 000E CAC0: 3C 23 D7 0A 40 00 00 00 40 20 00 00 3D CC CC CD +// 000E CAD0: 3E CC CC CD 40 80 00 00 3F 80 00 00 + +extern struct43s D_80373A6C; +// 00 00 00 00 +// 000E CAE0: 42 20 00 00 00 00 00 00 00 00 00 00 42 B4 00 00 +// 000E CAF0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +// 000E CB00: 00 00 00 00 00 00 00 00 00 00 00 00 C0 A0 00 00 +// 000E CB10: 00 00 00 00 C0 A0 00 00 40 A0 00 00 00 00 00 00 +// 000E CB20: 40 A0 00 00 + + +extern s32 D_80373AB4[3] = {30, 30, 30}; +extern struct40s D_80373AC0; +// 000E CB30: 40 40 00 00 40 59 99 9A 40 79 99 9A 40 83 33 33 +// 000E CB40: 00 00 00 00 3C 23 D7 0A 40 00 00 00 40 20 00 00 +// 000E CB50: 3E 99 99 9A 3F 00 00 00 40 80 00 00 3F 80 00 00 + +extern struct43s D_80373AF0; +// 000E CB60: 42 C8 00 00 42 20 00 00 42 C8 00 00 42 C8 00 00 +// 000E CB70: 42 B4 00 00 42 C8 00 00 00 00 00 00 00 00 00 00 +// 000E CB80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +// 000E CB90: C0 A0 00 00 00 00 00 00 C0 A0 00 00 40 A0 00 00 +// 000E CBA0: 00 00 00 00 40 A0 00 00 + +extern s32 D_80373B38[3] = {130, 130, 130}; +extern struct40s D_80373B44; +// 40 00 00 00 40 19 99 9A 40 79 99 9A +// 000E CBC0: 40 83 33 33 00 00 00 00 3C 23 D7 0A 40 00 00 00 +// 000E CBD0: 40 20 00 00 3E 4C CC CD 3F 33 33 33 40 80 00 00 +// 000E CBE0: 3F 80 00 00 + +extern struct43s D_80373B74; +// 42 C8 00 00 42 20 00 00 42 C8 00 00 +// 000E CBF0: 42 C8 00 00 42 B4 00 00 42 C8 00 00 00 00 00 00 +// 000E CC00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +// 000E CC10: 00 00 00 00 C0 A0 00 00 00 00 00 00 C0 A0 00 00 +// 000E CC20: 40 A0 00 00 00 00 00 00 40 A0 00 00 + +extern s32 D_80373BBC[3] = {0xff, 0xff, 0xff}; +extern struct40s D_80373BC8; +// 3F 00 00 00 3F 19 99 9A +// 000E CC40: 3F C0 00 00 3F F3 33 33 00 00 00 00 3C 23 D7 0A +// 000E CC50: 40 80 00 00 40 90 00 00 3D CC CC CD 3F 4C CC CD +// 000E CC60: 00 00 00 00 3F 80 00 00 + +extern struct43s D_80373BF8; +// 00 00 00 00 42 20 00 00 +// 000E CC70: 00 00 00 00 00 00 00 00 42 B4 00 00 00 00 00 00 +// 000E CC80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +// 000E CC90: 00 00 00 00 00 00 00 00 C0 A0 00 00 00 00 00 00 +// 000E CCA0: C0 A0 00 00 40 A0 00 00 00 00 00 00 40 A0 00 00 + +extern s32 D_80373C40[3] = {160, 170, 170}; +extern struct40s D_80373C4C; +// 40 20 00 00 +// 000E CCC0: 40 26 66 66 40 60 00 00 40 79 99 9A 00 00 00 00 +// 000E CCD0: 3C 23 D7 0A 3E 99 99 9A 3F 00 00 00 3D CC CC CD +// 000E CCE0: 3F 4C CC CD 40 80 00 00 3F 80 00 00 + +extern struct43s D_80373C7C; +// C2 70 00 00 +// 000E CCF0: C2 70 00 00 C2 70 00 00 42 70 00 00 42 70 00 00 +// 000E CD00: 42 70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 +// 000E CD10: 00 00 00 00 00 00 00 00 00 00 00 00 C2 48 00 00 +// 000E CD20: C2 48 00 00 C2 48 00 00 42 48 00 00 42 48 00 00 +// 000E CD30: 42 48 00 00 + +extern s32 D_80373CC4[] = {90, 90, 90}; +extern struct40s D_80373CD0; +// 3FC00000 3FCCCCCD 40200000 4039999A +// 00000000 3C23D70A 3E99999A 3F000000 +// 3DCCCCCD 3F4CCCCD 40800000 3F800000 + +extern struct43s D_80373D00 = { + {{-60.0f, -60.0f, -60.0f}, {60.0f, 60.0f, 60.0f}}, + {{0.0f, -0.0f, -0.0f}, {-0.0f, -0.0f, -0.0f}}, + {{-50.0f, -50.0f, -50.0f}, {50.0f, 50.0f, 50.0f}} +}; + +extern struct40s D_80373D48 = { + { {1.8f, 3.5f}, {1.8f, 3.5f}, {0.0f, 0.01f}, {5.0f, 5.0f}, 0.0f, 0.9f}, + 4.0f, + 15.0f +}; + +extern struct43s D_80373D78 = { + {{-450.0f, 700.0f, -450.0f}, {450.0f, 1100.0f, 450.0f}}, + {{ 0.0f, -900.0f, 0.0f}, { 0.0f, -900.0f, 0.0f}}, + {{-150.0f, -100.0f, -150.0f}, {150.0f, 5.0f, 150.0f}} +}; + + + +/* .code */ +void func_80361FA0(f32 arg0[3]) { + ParticleEmitter *pCtrl = partEmitList_pushNew(0xFU); + particleEmitter_setModel(pCtrl, 0x441); + particleEmitter_setPosition(pCtrl, arg0); + func_802EFE24(pCtrl, -200.0f, 200.0f, -200.0f, 200.0f, 200.0f, 200.0f); + func_802EF9F8(pCtrl, 0.01f); + func_802EFA18(pCtrl, 3); + func_802EFA20(pCtrl, 1.0f, 1.3f); + func_802EF9EC(pCtrl, 0x2F, 0x3E80); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80373334); + func_802EFC28(pCtrl, &D_80373304); + FUNC_8030E624(SFX_7C_CHEBOOF, 0.6f, 29000); +} + +void func_80362084(f32 position[3]) { + ParticleEmitter *pCtrl; + + pCtrl = partEmitList_pushNew(1U); + particleEmitter_setSprite(pCtrl, 0x702); + particleEmitter_setStartingFrameRange(pCtrl, 3, 5); + func_802EFFA8(pCtrl, D_8037337C); + func_802EF9E4(pCtrl, 0xA0); + particleEmitter_setPosition(pCtrl, position); + func_802EFF5C(pCtrl, 0.1f, 0.2f, 0.0f); + func_802EFF7C(pCtrl, 0.0f, 0.25f, 0.0f); + func_802EFF9C(pCtrl, 0.5f); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_803733B8); + func_802EFC28(pCtrl, &D_80373388); +} + + +void func_8036215C(f32 arg0[3]) { + ParticleEmitter *pCtrl = partEmitList_pushNew(0xFU); + particleEmitter_setSprite(pCtrl, 0x700); + particleEmitter_setStartingFrameRange(pCtrl, 3, 4); + func_802EFFA8(pCtrl, D_803733E8); + func_802EF9E4(pCtrl, 0x28); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80373424); + func_802EFC28(pCtrl, &D_803733F4); +} + +void func_803621F0(f32 arg0[3]) { + ParticleEmitter *pCtrl = partEmitList_pushNew(0x12U); + particleEmitter_setSprite(pCtrl, 0x702); + particleEmitter_setStartingFrameRange(pCtrl, 3, 5); + func_802EF9E4(pCtrl, 0xD2); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8037349C); + func_802EFC28(pCtrl, &D_8037346C); +} + +void func_80362274(f32 arg0[3]) { + ParticleEmitter *pCtrl = partEmitList_pushNew(0xFU); + particleEmitter_setModel(pCtrl, 0x89B); + particleEmitter_setPosition(pCtrl, arg0); + func_802EFE24(pCtrl, -400.0f, -200.0f, -400.0f, 400.0f, -400.0f, 400.0f); + func_802EF9F8(pCtrl, 0.01f); + func_802EFA18(pCtrl, 3); + func_802EFA20(pCtrl, 1.0f, 1.3f); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80373514); + func_802EFC28(pCtrl, &D_803734E4); +} + +void func_8036233C(f32 arg0[3]) { + ParticleEmitter *pCtrl = partEmitList_pushNew(0xFU); + particleEmitter_setModel(pCtrl, 0x89A); + particleEmitter_setPosition(pCtrl, arg0); + func_802EFE24(pCtrl, -200.0f, 200.0f, -200.0f, 200.0f, 200.0f, 200.0f); + func_802EF9F8(pCtrl, 0.01f); + func_802EFA18(pCtrl, 3); + func_802EFA20(pCtrl, 1.0f, 1.3f); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8037358C); + func_802EFC28(pCtrl, &D_8037355C); +} + +void func_80362404(f32 arg0[3]) { + ParticleEmitter *pCtrl = partEmitList_pushNew(1U); + particleEmitter_setSprite(pCtrl, 0x6DD); + particleEmitter_setStartingFrameRange(pCtrl, 2, 2); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_80373604); + func_802EFC28(pCtrl, &D_803735D4); +} + +void func_8036247C(f32 arg0[3]) { + ParticleEmitter *pCtrl = partEmitList_pushNew(1U); + particleEmitter_setSprite(pCtrl, 0x70D); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, &D_80373634); + func_802EF9E4(pCtrl, 0x64); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_80373670); + func_802EFC28(pCtrl, &D_80373640); +} + +void func_80362510(Actor *actor) { + ParticleEmitter *pCtrl; + f32 sp30[3]; + + pCtrl = partEmitList_pushNew(0x19U); + particleEmitter_setSprite(pCtrl, 0x70D); + particleEmitter_setStartingFrameRange(pCtrl, 0, 5); + func_802EFFA8(pCtrl, D_803736A0); + func_802EF9E4(pCtrl, 0x1E); + particleEmitter_setPosition(pCtrl, actor->position); + particleEmitter_setParticleSpawnPositionRange(pCtrl, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + sp30[0] = 1000.0f; + sp30[1] = 100.0f; + sp30[2] = 0.0f; + ml_vec3f_roll_rotate_copy(sp30, sp30, actor->roll); + ml_vec3f_yaw_rotate_copy(sp30, sp30, actor->yaw); + particleEmitter_setParticleVelocityRange(pCtrl, + sp30[0] * 0.01, sp30[1] * 0.01, sp30[2] * 0.01, + sp30[0] * 0.4, sp30[1] * 0.4, sp30[2] * 0.4 + ); + func_802EFC28(pCtrl, &D_803736AC); +} + + +void func_80362680(f32 arg0[3]) { + ParticleEmitter *pCtrl = partEmitList_pushNew(1U); + particleEmitter_setSprite(pCtrl, 0x45A); + particleEmitter_setStartingFrameRange(pCtrl, 2, 2); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8037370C); + func_802EFC28(pCtrl, &D_803736DC); +} + +void func_803626F8(f32 arg0[3]) { + ParticleEmitter *pCtrl = partEmitList_pushNew(1U); + + particleEmitter_setSprite(pCtrl, 0x713); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8037376C); + func_802EFC28(pCtrl, &D_8037373C); +} + + +void func_80362770(f32 arg0[3]) { + ParticleEmitter *pCtrl = partEmitList_pushNew(0x10U); + + particleEmitter_setSprite(pCtrl, 0x714); + particleEmitter_setStartingFrameRange(pCtrl, 7, 8); + func_802EFFA8(pCtrl, &D_803737B4); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_803737F0); + func_802EFC28(pCtrl, &D_803737C0); +} + +void func_803627F8(f32 arg0[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(11); + particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_80373820); + func_802EF9E4(pCtrl, 120); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_8037385C); + func_802EFC28(pCtrl, &D_8037382C); +} + +void func_8036288C(f32 arg0[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(0xd); + particleEmitter_setSprite(pCtrl, ASSET_702_SPRITE_UNKNOWN); + particleEmitter_setStartingFrameRange(pCtrl, 3, 4); + func_802EFFA8(pCtrl, D_803738A4); + func_802EF9E4(pCtrl, 255); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_803738E0); + func_802EFC28(pCtrl, &D_803738B0); +} + +void func_80362920(f32 arg0[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(0xd); + particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_80373928); + func_802EF9E4(pCtrl, 60); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80373964); + func_802EFC28(pCtrl, &D_80373934); +} + +void func_803629B4(f32 arg0[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(0xd); + particleEmitter_setSprite(pCtrl, ASSET_713_SPRITE_SPARKLE_YELLOW); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_803739AC); + func_802EF9E4(pCtrl, 255); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_803739E8); + func_802EFC28(pCtrl, &D_803739B8); +} + +void func_80362A48(f32 arg0[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_80373A30); + func_802EF9E4(pCtrl, 40); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80373A6C); + func_802EFC28(pCtrl, &D_80373A3C); +} + +void func_80362ADC(f32 arg0[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_80373AB4); + func_802EF9E4(pCtrl, 40); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80373AF0); + func_802EFC28(pCtrl, &D_80373AC0); +} + +void func_80362B70(f32 arg0[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_80373B38); + func_802EF9E4(pCtrl, 110); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80373B74); + func_802EFC28(pCtrl, &D_80373B44); +} + +void func_80362C04(f32 arg0[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_80373BBC); + func_802EF9E4(pCtrl, 40); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80373BF8); + func_802EFC28(pCtrl, &D_80373BC8); +} + +void func_80362C98(f32 arg0[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_80373C40); + func_802EF9E4(pCtrl, 140); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80373C7C); + func_802EFC28(pCtrl, &D_80373C4C); +} + +void func_80362D2C(f32 arg0[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, ASSET_70D_SPRITE_SMOKE_1); + particleEmitter_setStartingFrameRange(pCtrl, 4, 6); + func_802EFFA8(pCtrl, D_80373CC4); + func_802EF9E4(pCtrl, 140); + particleEmitter_setPosition(pCtrl, arg0); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80373D00); + func_802EFC28(pCtrl, &D_80373CD0); +} + +void func_80362DC0(f32 arg0[3]){ + ParticleEmitter *pCtrl = partEmitList_pushNew(0xF); + particleEmitter_setModel(pCtrl, ASSET_47B_MODEL_ROCK); + particleEmitter_setPosition(pCtrl, arg0); + func_802EFE24(pCtrl, -200.0f, 200.0f, -200.0f, 200.0f, 200.0f, 200.0f); + func_802EF9F8(pCtrl, 0.4f); + func_802EFA18(pCtrl, 3); + func_802EFA20(pCtrl, 1.0f, 1.3f); + func_802EFA70(pCtrl, 2); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80373D78); + func_802EFC28(pCtrl, &D_80373D48); +} + +void func_80362E94(Actor *this){ + f32 tick = time_getDelta(); + + switch(this->unkF4_8){ + case 0x3: //L80362ED8 + if(func_8024DB50(this->position, 50.0f) && randf() < 0.2){ + func_80362084(this->position); + } + break; + case 0xa: //L80362F24 + if(func_8024DB50(this->position, 50.0f) && randf() < 0.1){ + func_8036247C(this->position); + } + break; + case 0xc: //L80362F70 + if(func_8024DB50(this->position, 50.0f)){ + if(randf() < 0.4) + func_80362680(this->position); + if(randf() < 0.8) + func_803626F8(this->position); + } + break; + case 0x10://L80362FE8 + if(func_8024DB50(this->position, 50.0f) && randf() < 0.1){ + func_80362A48(this->position); + } + break; + case 0x11://L80363034 + if(func_8024DB50(this->position, 50.0f) && randf() < 0.06){ + func_80362ADC(this->position); + } + break; + case 0x12://L80363080 + if(func_8024DB50(this->position, 50.0f) && randf() < 0.06){ + func_80362C04(this->position); + } + break; + case 0x13://L803630CC + if(func_8024DB50(this->position, 50.0f) && randf() < 0.4){ + func_80362B70(this->position); + } + break; + case 0x14://L80363118 + if(func_8024DB50(this->position, 300.0f)){ + if(randf() < 0.01) + func_80362C98(this->position); + func_80362D2C(this->position); + } + break; + default: //L8036316C + if(!this->unk16C_4){ + this->unk16C_4 = 1; + this->unk60 = this->scale*10.0; + } + + this->unk60 = MAX(0.0, this->unk60 - tick); + if(0.0f == this->unk60){ + switch(this->unkF4_8){ + case 2: //L8036325C + func_80361FA0(this->position); + break; + case 7: //L8036326C + func_8036215C(this->position); + func_803621F0(this->position); + break; + case 8: //L80363288 + func_80362274(this->position); + func_8036233C(this->position); + break; + case 0x2A: //L803632A4 + func_80362510(this); + break; + case 0x2B: //L803632B4 + func_803627F8(this->position); + func_8036288C(this->position); + func_803629B4(this->position); + break; + case 0x2C: //L803632D8 + func_80362920(this->position); + break; + case 0x2D: //L803632E8 + func_80362DC0(this->position); + break; + } + marker_despawn(this->marker); + } + break; + } +} + +void func_80363310(Actor *this){ + func_80362E94(this); +} + +void func_80363330(Actor *this){ + func_80343DEC(this); + func_80362E94(this); + if(this->unk48 == 1.0) + marker_despawn(this->marker); +} + +void func_80363388(struct_core2_DB010 *arg0, s32 arg1){ + f32 sp2C[3]; + s32 sp20[3]; + s32 tmp_v0 = func_80330F94(arg0, sp20); + sp2C[0] = (f32)sp20[0]; + sp2C[1] = (f32)sp20[1]; + sp2C[2] = (f32)sp20[2]; + switch(tmp_v0){ + case 0x29: //L803633F0 + func_80362770(sp2C); + break; + case 0x34: //L80363400 + func_80361FA0(sp2C); + break; + case 0x35: //L80363410 + func_80362274(sp2C); + func_8036233C(sp2C); + break; + case 0x36: //L80363428 + func_80362404(sp2C); + break; + case 0x2A: + //case used to force switch to have proper functions + // could be any unused value(s) between (0x29 and 0x36) + break; + } + +} \ No newline at end of file diff --git a/src/core2/code_DC4B0.c b/src/core2/code_DC4B0.c new file mode 100644 index 00000000..595e0c67 --- /dev/null +++ b/src/core2/code_DC4B0.c @@ -0,0 +1,47 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80363500(Actor *this); + +/* .data */ +ActorInfo D_80373DC0= { + 0x1EE, ACTOR_3BA_UNKOWN, 0, + 0, NULL, + func_80363500, func_80326224, func_80325340, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_80363440(void){ + func_8034DEB4(func_8034C528(0x1F1), -5000.0f); +} + +void func_80363470(void){ + func_8034DEB4(func_8034C528(0x1F2), -5000.0f); + func_8034DEB4(func_8034C528(0x1F3), 0.0f); + func_80363440(); +} + +void func_803634BC(void){ + func_8034DEB4(func_8034C528(0x1F3), -5000.0f); + func_8034DEB4(func_8034C528(0x1F2), 0.0f); +} + +void func_80363500(Actor *this){ + if(!this->unk16C_4){ + if(!func_802DA498()){ + func_803634BC(); + } + else{ + func_80363440(); + marker_despawn(this->marker); + } + this->unk16C_4 = 1; + }//L8036355C + + if(func_802DA498()){ + func_80363470(); + marker_despawn(this->marker); + } +} diff --git a/src/core2/code_DF70.c b/src/core2/code_DF70.c new file mode 100644 index 00000000..4fe072ae --- /dev/null +++ b/src/core2/code_DF70.c @@ -0,0 +1,93 @@ +#include +#include "functions.h" +#include "variables.h" + +u32 D_8037C300; +f32 D_8037C304; + +int should_beak_barge(void){ + return button_pressed(BUTTON_B) && can_beak_barge(); +} + +int should_beak_bust(void){ + return button_pressed(BUTTON_Z) && can_beak_bust(); +} + +int func_80294F78(void){ + return button_pressed(BUTTON_C_UP) && func_8028ACD8(); +} + +int should_rotate_camera_left(void){ + return button_pressed(BUTTON_C_LEFT) && func_802951FC(0); +} + +int should_rotate_camera_right(void){ + return button_pressed(BUTTON_C_RIGHT) && func_802951FC(1); +} + +int should_zoom_out_camera(void){ + return button_pressed(BUTTON_C_DOWN) && func_802951FC(5); +} + +int should_poop_egg(void){ + return button_pressed(BUTTON_C_DOWN) && can_egg(); +} + +int should_shoot_egg(void){ + return button_pressed(BUTTON_C_UP) && can_egg(); +} + +int should_flap(void){ + return button_pressed(BUTTON_A) && can_flap(); +} + +int should_flip(void){ + return button_pressed(BUTTON_A) && can_flip(); +} + +int should_peck(void){ + return button_pressed(BUTTON_B) && can_peck(); +} + +int should_dive(void){ + return button_pressed(BUTTON_B) && (D_8037C304 == 0.0f) && can_dive(); +} + +int func_802951FC(s32 arg0){ + return D_8037C300 & (1 << arg0); +} + +int should_trot(void){ + return button_pressed(BUTTON_C_LEFT) && can_trot(); +} + +int should_wonderwing(void){ + return button_pressed(BUTTON_C_RIGHT) && can_wonderwing(); +} + +void func_8029528C(void){ + D_8037C300 = -1; + D_8037C304 = 0.0f; +} + +void func_802952A8(s32 arg0, int arg1){ + if(arg1) + D_8037C300 |= (1 < +#include "functions.h" +#include "variables.h" + +/* .bss */ +struct { + u32 unk0[0xE]; + u32 unk38[0xE]; + u8 unk70[0xE]; + u8 unk7E[0xE]; +} D_8037C310; + + +/* .code */ +void func_802953A0(void){ + s32 i; + + for(i = 0; i<0xe; i++){ + D_8037C310.unk0[i] = D_8037C310.unk38[i] = 0; + D_8037C310.unk70[i] = D_8037C310.unk7E[i] = 0; + } +} + +void func_80295448(void){ + s32 i; + + D_8037C310.unk0[0] = func_8024E67C(BUTTON_START); + func_8024E60C(0, &D_8037C310.unk0[1]); + func_8024E6E0(0, &D_8037C310.unk0[4]); + func_8024E55C(0, &D_8037C310.unk0[8]); + for(i=0; i<0xE; i++){//L802954A8 + D_8037C310.unk7E[i] = D_8037C310.unk70[i]; + if(D_8037C310.unk70[i]){ + D_8037C310.unk0[i] = 0; + if(D_8037C310.unk70[i] == 2) + D_8037C310.unk70[i] = 0; + } + D_8037C310.unk38[i] = (D_8037C310.unk0[i])? 0: D_8037C310.unk38[i] + 1 ; + } + if(gctransition_8030BDC0()){ + func_802953A0(); + } +} + + +int func_8029551C(s32 button_indx){ + return D_8037C310.unk0[button_indx]; +} + +int func_80295530(s32 button_indx){ + return D_8037C310.unk38[button_indx]; +} + +int button_pressed(s32 button_indx){ + return D_8037C310.unk0[button_indx] == 1; +} + +int func_80295560(s32 button_indx){ + return D_8037C310.unk38[button_indx] == 1; +} + +u32 button_held(s32 button_indx){ + return D_8037C310.unk0[button_indx]; +} + +int button_released(s32 button_indx){ + return D_8037C310.unk38[button_indx]; +} + +int func_802955A4(s32 button_indx, s32 val){ + D_8037C310.unk70[button_indx] = val; + return D_8037C310.unk7E[button_indx]; +} + +void func_802955BC(s32 arg0){ + s32 i; + for(i=0; i<0xe; i++){ + func_802955A4(i, arg0); + } +} diff --git a/src/core2/code_E680.c b/src/core2/code_E680.c new file mode 100644 index 00000000..d81c456e --- /dev/null +++ b/src/core2/code_E680.c @@ -0,0 +1,117 @@ +#include +#include "functions.h" +#include "variables.h" + +s32 D_8037C3A0; +s32 D_8037C3A4; + +void ability_use(s32 arg0){ + s32 sp2C; + s32 sp28; + + sp2C = 0; + sp28 = 1; + + if(D_8037C3A4 & (1 << arg0)) + return; + + switch(arg0){ + case 0x0://L80295660 //jump + mapSpecificFlags_set(8, TRUE); + sp28 = 1; + break; + case 0x1://L80295674 //flap + mapSpecificFlags_set(9, TRUE); + sp28 = 1; + break; + case 0x2://L80295688 //bust + mapSpecificFlags_set(0xa, TRUE); + sp28 = 1; + break; + case 0x3://L8029569C // + if(map_get() == MAP_1_SM_SPIRAL_MOUNTAIN){ + sp2C = 0xDFC; + } + break; + case 0x4://L802956B8 // + if(map_get() == MAP_1_SM_SPIRAL_MOUNTAIN){ + sp2C = 0xE02; + } + break; + case 0x5://L802956D4 //barge + if(map_get() == MAP_1_SM_SPIRAL_MOUNTAIN){ + sp2C = 0xE05; + } + break; + case 0x6://L802956F0 //slide + sp28 = 0; + if(!ability_isUnlocked(ABILITY_10_TALON_TROT)){ + if(map_get() == MAP_2_MM_MUMBOS_MOUNTAIN){ + sp2C = 0xB4D; + } + else + return; + } + else{ + D_8037C3A4 |= (1 << arg0); + } + break; + case 0x8://L80295738 //fly + sp2C = 0xA26; + break; + case 0x7://L80295740 //egg + case 0x9://L80295740 //shock + break; + }//L80295744 + if(sp28) + func_8025A70C(COMUSIC_2B_DING_B); + + if(sp2C) + func_80311480(sp2C, 4, NULL, NULL, NULL, 0); + + D_8037C3A4 |= (1 << arg0); +} + +int ability_hasUsed(enum ability_e move){ + return (1 << move) & D_8037C3A4; +} + +void ability_setHasUsed(enum ability_e move){ + D_8037C3A4 |= (1 << move); +} + +int ability_hasLearned(enum ability_e move){ + return (1 << move) & D_8037C3A0; +} + +s32 func_802957F0(void){ + return D_8037C3A0; +} + +void func_802957FC(void){} + +void func_80295804(void){ + D_8037C3A0 = 0; + D_8037C3A4 = 0; +} + +void func_80295818(s32 move, s32 val){ + if(val){ + D_8037C3A0 |= (1 << move); + }else{ + D_8037C3A0 &= ~(1 << move); + } +} + +void func_80295864(s32 val){ + D_8037C3A0 = val; +} + +void func_80295870(s32 val){ + D_8037C3A4 = val; +} + +void func_8029587C(s32 *size, u8 **addr){ + *size = 8; + *addr = &D_8037C3A0; +} diff --git a/src/core2/code_E910.c b/src/core2/code_E910.c new file mode 100644 index 00000000..675dbb81 --- /dev/null +++ b/src/core2/code_E910.c @@ -0,0 +1,329 @@ +#include +#include "functions.h" +#include "variables.h" +#include "bsint.h" +#include "bs_funcs.h" + + +u8 D_80363820 = 0; +bsMap D_80363824[] ={ + {BS_1_IDLE, bsstand_init, bsstand_update, bsstand_end, func_802B5350}, + {BS_2_WALK_SLOW, bswalk_slow_init, bswalk_slow_upate, NULL, func_802B5350}, + {BS_WALK, bswalk_init, bswalk_update, NULL, func_802B5350}, + {BS_WALK_FAST, bswalk_fast_init, bswalk_fast_update, bswalk_fast_end, func_802B5350}, + {BS_5_JUMP, bsjump_init, bsjump_update, bsjump_end, func_80296608}, + {BS_CLAW, bsclaw_init, bsclaw_update, bsclaw_end, func_80296608}, + {BS_CROUCH, bscrouch_init, bscrouch_update, bscrouch_end, func_802B5350}, + {BS_8_BTROT_JUMP, bsbtrot_jump_init, bsbtrot_jump_update,bsbtrot_jump_end, func_802B5350}, + {BS_SKID, bsturn_init, bsturn_update, bsturn_end, func_802B5350}, + {BS_D_TIMEOUT, func_802B63F8, func_802B64D0, func_802B6500, func_80296590}, + {BS_E_OW, bsow_init, bsow_update, bsow_end, func_80296590}, + {BS_F_BBUSTER, bsbbuster_init, bsbbuster_update, bsbbuster_end, func_80296608}, + {BS_BFLAP, bsbflap_init, bsbflap_update, bsbflap_end, func_80296608}, + {BS_11_BPECK, bsbpeck_init, bsbpeck_update, bsbpeck_end, func_80296608}, + {BS_12_BFLIP, bsbflip_init, bsbflip_update, bsbflip_end, func_80296608}, + {BS_BBARGE, bsbarge_init, bsbarge_update, bsbarge_end, func_80296608}, + {BS_14_BTROT_ENTER, bsbtrot_enter_init, bsbtrot_enter_update, bsbtrot_enter_end, func_802B5350}, + {BS_15_BTROT_IDLE, bsbtrot_stand_init, bsbtrot_stand_update, bsbtrot_stand_end, func_802B5350}, + {BS_16_BTROT_WALK, bsbtrot_walk_init, bsbtrot_walk_update, bsbtrot_walk_end, func_802B5350}, + {BS_17_BTROT_EXIT, bsbtrot_exit_init, bsbtrot_exit_update, bsbtrot_exit_end, func_802B5350}, + {BS_18_FLY_KNOCKBACK, func_802A4D90, func_802A4EC8, func_802A4F44, func_80296608}, + {BS_1A_WONDERWING_ENTER, bsbwhirl_enter_init, bsbwhirl_enter_update, bsbwhirl_enter_end, func_80296608}, + {BS_1B_WONDERWING_IDLE, bsbwhirl_stand_init, bsbwhirl_stand_update, bsbwhirl_stand_end, func_80296608}, + {BS_1C_WONDERWING_WALK, bsbwhirl_walk_init, bsbwhirl_walk_update, bsbwhirl_walk_end, func_80296608}, + {BS_1D_WONDERWING_JUMP, bsbwhirl_jump_init, bsbwhirl_jump_update, bsbwhirl_jump_end, func_80296608}, + {BS_1E_WONDERWING_EXIT, bsbwhirl_exit_init, bsbwhirl_exit_update, bsbwhirl_exit_end, func_80296608}, + {BS_9_EGG_HEAD, bsegghead_init, bsegghead_update, bsegghead_end, func_802B5350}, + {BS_A_EGG_ASS, bseggass_init, bseggass_update, bseggass_end, func_802B5350}, + {BS_WALK_CREEP, bswalk_creep_init, bswalk_creep_update, NULL, func_802B5350}, + {BS_20_LANDING, bsstand_landing_init, bsstand_landing_update, NULL, func_802B5350}, + {BS_BSHOCK_CHARGE, bsbshock_charge_init, bsbshock_charge_update, bsbshock_charge_end, func_80296608}, + {BS_BSHOCK_JUMP, bsbshock_init, bsbshock_update, bsbshock_end, func_80296608}, + {BS_23_FLY_ENTER, bsbfly_enter_init, bsbfly_enter_update, bsbfly_enter_end, func_802A505C}, + {BS_24_FLY, bsbfly_init, bsbfly_update, func_802A3F70, func_802A505C}, + {BS_25_LONGLEG_ENTER, bsblongleg_enter_init, bsblongleg_enter_update, bsblongleg_enter_end, func_802B5350}, + {BS_26_LONGLEG_IDLE, bsblongleg_stand_enter, bsblongleg_stand_update, bsblongleg_stand_end, func_802B5350}, + {BS_LONGLEG_WALK, bsblongleg_walk_init, bsblongleg_walk_update, bsblongleg_walk_end, func_802B5350}, + {BS_LONGLEG_JUMP, bsblongleg_jump_init, bsblongleg_jump_update, bsblongleg_jump_end, func_80296608}, + {BS_LONGLEG_EXIT, bsblongleg_exit_init, bsblongleg_exit_update, bsblongleg_exit_end, func_802B5350}, + {BS_BOMB, func_802A3F9C, func_802A411C, func_802A4404, func_802A505C}, + {BS_2B_DIVE_IDLE, func_802A762C, func_802A7674, func_802A7718, func_80296608}, + {BS_2C_DIVE_B, func_802A7738, func_802A7838, func_802A7A2C, func_80296608}, + {BS_2D_SWIM_IDLE, func_802B5774, func_802B5950, func_802B5AF8, func_80296608}, + {BS_2E_SWIM, func_802B5B18, func_802B5C40, func_802B5E10, func_80296608}, + {BS_2F_FALL, bsjump_fall_init, bsjump_fall_update, bsjump_fall_end, func_80296608}, + {BS_30_DIVE_ENTER, func_802A7DAC, func_802A7E2C, func_802A7F4C, func_80296608}, + {BS_ROLL, bstwirl_init, bstwirl_update, bstwirl_end, func_802B5350}, + {BS_SLIDE, bsslide_init, bsslide_update, bsslide_end, func_802B5350}, + {0x33, func_802B9ACC, func_802B9B14, func_802B9AAC, func_802B9D00}, + {BS_34_JIG_NOTEDOOR, bsjig_notedoor_init, bsjig_notedoor_update, bsjig_notedoor_end, func_80296590}, + {BS_35_ANT_IDLE, bsant_idle_init, bsant_idle_update, bsant_idle_end, func_802B5350}, + {BS_ANT_WALK, bsant_walk_init, bsant_walk_update, bsant_walk_end, func_802B5350}, + {BS_ANT_JUMP, bsant_jump_init, bsant_jump_update, bsant_jump_end, func_802B5350}, + {BS_39_DIVE_A, func_802A7A54, func_802A7AB0, func_802A7BA8, func_80296608}, + {BS_3A_CARRY_IDLE, bscarry_idle_init, bscarry_idle_update, bscarry_idle_end, bscarry_interrupt}, + {BS_CARRY_WALK, bscarry_walk_init, bscarry_walk_update, bscarry_walk_end, bscarry_interrupt}, + {0x3C, func_802B6130, func_802B61E0, func_802B6218, func_802B6220}, + {BS_3D_FALL_TUMBLING, bsjump_tumble_init, bsjump_tumble_update, bsjump_tumble_end, func_80296608}, + {BS_38_ANT_FALL, bsant_fall_init, bsant_fall_update, bsant_fall_end, func_80296590}, + {BS_3E_ANT_OW, bsant_ow_init, bsant_ow_update, bsant_ow_end, func_80296590}, + {0x3F, func_802B1BF4, func_802B1CF8, func_802B1DA4, func_80296590}, + {0x40, func_802B2BF0, func_802B2C58, func_802B2D50, func_80296590}, + {BS_41_DIE, bsdie_init, bsdie_update, bsdie_end, func_80296590}, + {BS_42_DINGPOT, func_802A5120, func_802A5190, func_802A51C0, func_80296590}, + {BS_43_ANT_DIE, bsant_die_init, bsant_die_update, bsant_die_end, func_80296590}, + {BS_44_JIG_JIGGY, bsjig_jiggy_init, bsjig_jiggy_update, bsjig_jiggy_end, bsjig_jiggy_interrupt}, + {BS_45_BTROT_SLIDE, bsbtrot_slide_init, bsbtrot_slide_update, bsbtrot_slide_end, func_802B5350}, + {0x46, func_802A2098, func_802A2130, func_802A2054, func_80296590}, + {BS_48_PUMPKIN_IDLE, func_802B2384, func_802B242C, func_802B24AC, func_802B5350}, + {BS_49_PUMPKIN_WALK, func_802B24D4, func_802B2580, func_802B2610, func_802B5350}, + {BS_4A_PUMPKIN_JUMP, func_802B2638, func_802B2750, func_802B2990, func_802B5350}, + {BS_4B_PUMPKIN_FALL, func_802B29C0, func_802B2A5C, func_802B2BD0, func_802B5350}, + {BS_4C_LANDING_IN_WATER, func_802A846C, func_802A85EC, func_802A872C, func_80296608}, + {BS_4D_PUMPKIN_OW, func_802B2FDC, func_802B2FFC, func_802B301C, func_80296590}, + {BS_4E_PUMPKIN_DIE, func_802B309C, func_802B3240, func_802B3448, func_80296590}, + {BS_4F_CLIMB_IDLE, bsclimb_idle_init, bsclimb_idle_update, bsclimb_idle_end, func_802ABD60}, + {BS_50_CLIMB_MOVE, bsclimb_move_init, bsclimb_move_update, bsclimb_move_end, func_802ABD60}, + {BS_51_CLIMB_EXIT, func_802B1928, func_802B1A54, func_802B1BCC, func_80296608}, + {0x52, func_802B5FD0, func_802B6064, func_802B60D0, func_802B60D8}, + {BS_53_TIMEOUT, func_802B6270, func_802B6314, func_802B63C8, func_80296590}, + {BS_LONGLEG_SLIDE, bsblongleg_slide_init, bsblongleg_slide_update, bsblongleg_slide_end, func_802B5350}, + {BS_56_RECOIL, func_802B3868, func_802B3954, func_802B3A20, func_80296590}, + {BS_57_BOMB_END, func_802A4430, func_802A4548, func_802A4664, func_802A505C}, + {0x58, func_802A4748, func_802A48B4, func_802A4A40, func_80296590}, + {0x59, func_802A4CD0, func_802A4CF0, func_802A4D10, func_802A505C}, + {BS_54_SWIM_DIE, func_802A7F6C, func_802A8098, func_802A82D4, func_80296590}, + {BS_CARRY_THROW, bsthrow_init, bsthrow_update, bsthrow_end, bsthrow_interrupt}, + {BS_5E_CROC_IDLE, bscroc_idle_init, bscroc_idle_update, bscroc_idle_end, func_802B5350}, + {BS_CROC_WALK, bscroc_walk_init, bscroc_walk_update, bscroc_walk_end, func_802B5350}, + {BS_CROC_JUMP, bscroc_jump_init, bscroc_jump_update, bscroc_jump_end, func_802B5350}, + {BS_61_CROC_FALL, bscroc_fall_init, bscroc_fall_update, bscroc_fall_end, func_802B5350}, + {BS_LONGLEG_UNK62, func_802A6394, func_802A63F0, func_802A6450, func_80296608}, + {BS_CROC_OW, bscroc_ow_init, bscroc_ow_update, bscroc_ow_end, func_80296590}, + {BS_CROC_DIE, bscroc_die_init, bscroc_die_update, bscroc_die_end, func_80296590}, + {BS_67_WALRUS_IDLE, bswalrus_idle_init, bswalrus_idle_update, bswalrus_idle_end, func_802B5350}, + {BS_WALRUS_WALK, bswalrus_walk_init, bswalrus_walk_update, bswalrus_walk_end, func_802B5350}, + {BS_WALRUS_JUMP, bswalrus_jump_init, bswalrus_jump_update, bswalrus_jump_end, func_802B5350}, + {BS_6A_WALRUS_FALL, bswalrus_fall_init, bswalrus_fall_update, bswalrus_fall_end, func_802B5350}, + {0x6B, func_802A1F6C, func_802A1FC8, func_802A2014, func_80296608}, + {BS_WALRUS_OW, bswalrus_ow_init, bswalrus_ow_update, bswalrus_ow_end, func_80296590}, + {BS_WALRUS_DIE, bswalrus_die_init, bswalrus_die_update, bswalrus_die_end, func_80296590}, + {BS_6E_CROC_BITE, bscroc_bite_init, bscroc_bite_update, bscroc_bite_end, func_802B5350}, + {BS_CROC_EAT_BAD, bscroc_eat_bad_init, bscroc_eat_bad_update, bscroc_eat_bad_end, func_802B5350}, + {BS_70_CROC_EAT_GOOD, bscroc_eat_good_init, bscroc_eat_good_update, bscroc_eat_good_end, func_802B5350}, + {BS_71_BTROT_FALL, bsbtrot_fall_init, bsbtrot_fall_update, bsbtrot_fall_end, func_80296608}, + {BS_SPLAT, bssplat_init, bssplat_update, bssplat_end, func_80296590}, + {0x00000073, func_802B3CEC, func_802B3D1C, func_802B3D6C, func_80296608}, + {0x00000074, func_802B3E2C, func_802B3E64, func_802B3EF4, func_80296608}, + {0x00000075, func_802B3D8C, func_802B3DBC, func_802B3E0C, func_80296608}, + {0x00000076, func_802A4F74, func_802A4FC8, func_802A503C, func_80296608}, + {0x00000077, func_802B5E8C, func_802B5EFC, func_802B5F38, func_80296608}, + {0x00000078, func_802A83C0, func_802A8410, func_802A844C, func_80296608}, + {0x00000079, bsbtrot_unk79_init, bsbtrot_unk79_update, bsbtrot_unk79_end, func_80296608}, + {BS_WALK_MUD, bswalk_mud_init, bswalk_mud_update, NULL, func_80296608}, + {BS_BTROT_OW, bsbtrot_ow_init, bsbtrot_ow_update, bsbtrot_ow_end, func_80296590}, + {BS_7C_SLED, bssled_init, bssled_update, bssled_end, bssled_interrupt}, + {BS_7D_WALRUS_SLED, bswalrus_sled_init, bswalrus_sled_update, bswalrus_sled_end, func_802B98C0}, + {BS_7E_WALRUS_SLED, bswalrus_sled_jump_init, bswalrus_sled_jump_update, bswalrus_sled_jump_end, func_802B98C0}, + {BS_7F_DIVE_OW, func_802A7BD0, func_802A7CA8, func_802A7D74, func_80296590}, + {0x00000080, func_802B978C, func_802B9830, func_802B9880, func_80296590}, + {0x00000081, func_802B90D0, func_802B9130, func_802B917C, func_802B98C0}, + {0x00000082, func_802B95A0, func_802B963C, func_802B976C, func_802B98C0}, + {BS_85_BEE_IDLE, func_802A1080, func_802A10D4, func_802A117C, func_802B5350}, + {BS_BEE_WALK, func_802A11A4, func_802A1214, func_802A12D4, func_802B5350}, + {BS_BEE_JUMP, func_802A12FC, func_802A1438, func_802A163C, func_802B5350}, + {BS_88_BEE_FALL, func_802A1664, func_802A170C, func_802A18C8, func_802B5350}, + {BS_BEE_OW, func_802A1B68, func_802A1B88, func_802A1BA8, func_802B5350}, + {BS_BEE_DIE, bsbeemain_die_init, func_802A1DD8, func_802A1F2C, func_80296590}, + {0x0000008B, func_802A0590, func_802A0630, func_802A0704, func_802B5350}, + {BS_BEE_FLY, bsbeefly_enter, bsbeefly_update, bsbeefly_end, func_802B5350}, + {BS_CROC_LOCKED, func_802AD56C, func_802AD5C0, func_802AD614, func_802B5350}, + {0x0000008E, func_8029F398, func_8029F3F4, func_8029F440, func_802B5350}, + {BS_8F_PUMPKIN_LOCKED, func_802B34A0, func_802B34F8, func_802B353C, func_802B5350}, + {BS_FLY_OW, func_802A4D30, func_802A4D50, func_802A4D70, func_802A505C}, + {BS_ANT_DRONE, bsant_drone_init, bsant_drone_update, bsant_drone_end, bsdrone_interrupt}, + {BS_93_PUMPKIN_DRONE, bspumpkin_drone_init, bspumpkin_drone_update, bspumpkin_drone_end, bsdrone_interrupt}, + {BS_CROC_DRONE, bscroc_drone_init, bscroc_drone_update, bscroc_drone_end, bsdrone_interrupt}, + {BS_WALRUS_DRONE, bswalrus_drone_init, bswalrus_drone_update, bswalrus_drone_end, bsdrone_interrupt}, + {BS_96_SWIM_LOCKED, func_802B5F58, func_802B5F80, func_802B5FA0, bsdrone_interrupt}, + {BS_97_DIVE_LOCKED, func_802A874C, func_802A8774, func_802A8794, bsdrone_interrupt}, + {BS_WALK_DRONE, bswalk_drone_init, bswalk_drone_update, bswalk_drone_end, bsdrone_interrupt}, + {0x00000099, func_802A50B0, func_802A50D8, func_802A50F8, bsdrone_interrupt}, + {BS_BTROT_DRONE, bsbtrot_drone_init, bsbtrot_drone_update, bsbtrot_drone_end, bsdrone_interrupt}, + {BS_LONGLEG_DRONE, bsblongleg_drone_init, bsblongleg_drone_update, bsblongleg_drone_end, bsdrone_interrupt}, + {0x0000009C, bswalrus_sled_drone_init, bswalrus_sled_drone_update, bswalrus_sled_drone_end, bsdrone_interrupt}, + {BS_BEE_DRONE, bsbee_drone_init, bsbee_drone_update, bsbee_drone_end, bsdrone_interrupt}, + {0x0000009E, func_802ABCCC, func_802ABD0C, func_802ABD40, func_802ABD60}, + {BS_ANT_BOUNCE, bsant_bounce_init, bsant_bounce_update, bsant_bounce_end, func_80296590}, + {BS_PUMPKIN_BOUNCE, func_802B303C, func_802B305C, func_802B307C, func_80296590}, + {BS_CROC_BOUNCE, bscroc_bounce_init, bscroc_bounce_update, bscroc_bounce_end, func_80296590}, + {BS_WALRUS_BOUNCE, bswalrus_bounce_init, bswalrus_bounce_update, bswalrus_bounce_end, func_80296590}, + {BS_BEE_BOUNCE, func_802A1BC8, func_802A1BE8, func_802A1C08, func_80296590}, + {BS_A4_WONDERWING_DRONE, bsbwhirl_drone_init, bsbwhirl_drone_update, bsbwhirl_drone_end, func_80296608}, + {BS_A5_WONDERWING_UNKA5, func_802AADBC, func_802AAE08, func_802AAE4C, func_80296608}, + {0} +}; + +/* .bss */ +void (*D_8037C3B0)(); + +/* .code */ +void func_802958A0(void){ + s32 i; + bsMap *iPtr; + + for(i = 0; D_80363824[i].uid != 0; i++){ + bsList_setInitMethod(D_80363824[i].uid, D_80363824[i].behavior.init_func); + bsList_setUpdateMethod(D_80363824[i].uid, D_80363824[i].behavior.update_func); + bsList_setEndMethod(D_80363824[i].uid, D_80363824[i].behavior.end_func); + bsList_setInterruptMethod(D_80363824[i].uid, D_80363824[i].behavior.interrupt_func); + } +} + +void func_80295914(void){ + D_80363820 = 1; + D_8037C3B0 = NULL; + func_8029C608(); + func_802983F0(); + func_8028A410(); + func_80291910(); + func_8029279C(); + func_802932AC(); + miscflag_clearAll(); + func_8028B6FC(); + func_80291590(); + func_802953A0(); + func_8029B11C(); + func_8029528C(); + bsList_clearAll(); + bs_clearState(); + func_80295DD0(); + func_80296C30(); + func_802976E4(); + func_80297C78(); + pitch_reset(); + climbClear(); + func_8029887C(); + roll_reset(); + func_802992F0(); + func_80294DD8(); + func_8029CF6C(); + func_8029DFF8(); + func_80290B6C(); + func_80292D88(); + func_80290070(); + func_80290664(); + func_80291764(); + eggShatter_init(); + func_80294790(); + func_80293DA4(); + func_80289D1C(); + func_80291D2C(); + playerMarker_init(); + func_80299900(); + func_8029A4D0(); + func_8029ADCC(); + func_8029D01C(); + func_802958A0(); +} + +void func_80295A8C(void){ + + func_802917E4(2, func_8029A900()); + func_802917E4(3, func_8029A90C()); + if(func_8028ADB4()) + bs_setState(func_80292630()); + else + bs_setState(bs_getIdleState()); + +} + +void func_80295B04(void){ + f32 sp24; + enum bs_e sp20 = bs_getState(); + int tmp_a1; + + sp24 = (bslongleg_inSet(sp20)) ? func_80291670(2) : 0.0f; + func_8029A968(sp24); + sp24 = 0.0f; + tmp_a1 = 0; + if(bsbtrot_inSet(sp20)){ + sp24 = func_80291670(3); + tmp_a1 = 1; + } + + func_8029A980(tmp_a1); + func_8029A974(sp24); + bs_setState(BS_5A_LOADZONE); + playerMarker_free(); + func_8029065C(); + func_8029175C(); + eggShatter_free(); + func_80291E88(); + func_80289DDC(); + func_80293E88(); + func_802947C4(); + func_80299A20(); + func_8029A54C(); + func_8029ADA8(); + func_8029CFF8(); + D_80363820 = 0; +} + +void func_80295C08(void (* arg0)(void)){ + D_8037C3B0 = arg0; +} + +void func_80295C14(void){ + func_802964B8(); + func_80298A84(); + func_80291804(); + func_8029E100(); + func_8024E7C8();//controller_update + func_8023E06C(); + func_80295448(); + func_8029B174(); + func_8029533C(); //dive_cooldown_update + bs_updateState(); + func_80297744(); + func_8029858C(); + func_802932EC(); + func_80293F0C(); + pitch_update(); + roll_update(); + func_802993C8();//yaw update + func_802906D8(); + func_80289E00(); + func_8029A554(); + func_80298344(); //climb_cooldown_update + func_80290108(); + eggShatter_update(); + func_80292EDC(); + func_80291ECC(); + func_8029842C(); + func_8028D2E4(); + func_80294890(); + func_8028A8D0(); + func_8028B71C(); + func_8029D968(); + func_80297CF8(); + func_80294E60(); + func_80291358();//camera_update + func_802919A0(); + if(D_8037C3B0){ + D_8037C3B0(); + D_8037C3B0 = NULL; + } + func_80299A8C(); + func_80295E74();//voidOut_update +} + +void func_80295D74(void){ + if(D_80363820){ + func_80289E74(); + func_8029259C(); + eggShatter_defrag(); + func_80294750(); + func_8029AF1C(); + } +} diff --git a/src/core2/code_EE40.c b/src/core2/code_EE40.c new file mode 100644 index 00000000..1a36f06b --- /dev/null +++ b/src/core2/code_EE40.c @@ -0,0 +1,44 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +struct{ + f32 unk0[3]; + f32 unkC[3]; + u8 unk18; + u8 pad19[3]; +} D_8037C3C0; + +/* .code */ +void func_80295DD0(void){ + s32 sp24[3]; + s32 sp18[3]; + + func_80309998(sp18, sp24); + ml_vec3w_to_vec3f(D_8037C3C0.unkC, sp18); + ml_vec3w_to_vec3f(D_8037C3C0.unk0, sp24); + D_8037C3C0.unkC[0] -= 400.0f; + D_8037C3C0.unkC[1] = -8000.0f; + D_8037C3C0.unkC[2] -= 400.0f; + D_8037C3C0.unk0[0] += 400.0f; + D_8037C3C0.unk0[1] += 1000.0f; + D_8037C3C0.unk0[2] += 400.0f; + D_8037C3C0.unk18 = 0; + + +} + +void func_80295E74(void){ + f32 sp1C[3]; + _player_getPosition(sp1C); + if(!func_802584FC(sp1C, D_8037C3C0.unkC, D_8037C3C0.unk0)){ + if(D_8037C3C0.unk18 == 0){ + D_8037C3C0.unk18 = 1; + func_8029B6F0(); + } + else{ + func_802978DC(7); + } + } +} diff --git a/src/core2/code_EF50.c b/src/core2/code_EF50.c new file mode 100644 index 00000000..cedede20 --- /dev/null +++ b/src/core2/code_EF50.c @@ -0,0 +1,557 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80256E24(f32[3], f32, f32, f32, f32, f32); +extern f32 func_8028EBA4(void); +extern void func_802C82C0(Actor *, s32); +extern void bsjig_setJiggyMarkerPtr(ActorMarker *); + +typedef struct{ + f32 unk0; + f32 unk4; + f32 unk8[3]; + ActorMarker *unk14; + s32 unk18; + s32 unk1C; +} struct_EE40; + +void func_80296C90(f32 arg0); +void func_80296C9C(f32 arg0); +void func_80296CA8(ActorMarker *arg0); +void func_80296CB4(s32 arg0); +void func_80296CC0(f32 arg0[3]); + +/* .bss */ +struct_EE40 D_8037C3E0; +struct_EE40 D_8037C400[5]; + +/* .code */ +enum bs_e func_80295EE0(enum bs_e arg0){ + int sp34; + f32 pad30; + s32 sp2C; + s32 sp28; + s16 sp20[3]; + Actor *sp1C; + + sp2C = 0; + sp28 = 0; + sp34 = bs_getState(); + if(player_getTransformation() != TRANSFORM_1_BANJO || func_8028EE84() != BSWATERGROUP_0_NONE){ + sp2C = 1; + } + if(bsjig_inJiggyJig(sp34)){ + sp28 = 1; + } + + switch(func_8028ECAC()){ + case 6://L80295F5C + if(D_8037C3E0.unk18 != 0x3E){ + sp2C++; + } + break; + case 9://L80295F78 + sp2C++; + break; + } + if(sp28){ + func_8029CDA0(); + } + else{ + miscflag_set(7); + if(sp2C){ + func_8029CCC4(); + } + else{ + ml_vec3f_to_vec3h(sp20, D_8037C3E0.unk8); + sp1C = func_803282AC(ACTOR_5A_JIGGY_IN_HAND, sp20, 0); + func_802C82C0(sp1C, 3); + bsjig_setJiggyMarkerPtr(sp1C->marker); + sp1C->unk38_31 = D_8037C3E0.unk18; + arg0 = func_8029B504(); + } + } + return arg0; +} + +enum bs_e func_80296038(void){ + switch(_player_getTransformation()){ + case TRANSFORM_3_PUMPKIN:// L8029606C + return BS_PUMPKIN_BOUNCE; + case TRANSFORM_2_TERMITE:// L80296074 + return BS_ANT_BOUNCE; + case TRANSFORM_5_CROC:// L8029607C + return BS_CROC_BOUNCE; + case TRANSFORM_4_WALRUS:// L80296084 + return BS_WALRUS_BOUNCE; + case TRANSFORM_6_BEE:// L8029608C + return BS_BEE_BOUNCE; + case TRANSFORM_1_BANJO:// L80296094 + default: + if(func_8028ECAC() == BSGROUP_A_FLYING) + return BS_18_FLY_KNOCKBACK; + return BS_56_RECOIL; + } +} + +void func_802960C4(s32 arg0){ + s32 sp3C[3]; + f32 sp30[3]; + f32 sp24[3]; + + switch(arg0){ + case 0://L802960F4 + func_80330FCC(D_8037C3E0.unk14, sp3C); + ml_vec3w_to_vec3f(sp30, sp3C); + func_80294A64(sp30); + break; + case 1: //L80296120 + func_80294A64(D_8037C3E0.unk8); + break; + case 2: //L80296134 + player_getPosition(sp30); + func_802589E4(sp24, func_8028EBA4(), 100.0f); + sp24[1] = 0.0f; + sp30[0] += sp24[0]; + sp30[1] += sp24[1]; + sp30[2] += sp24[2]; + func_80294A64(sp30); + break; + case 3: //L80296198 + func_80294A64(D_8037C3E0.unk8); + break; + } +} + +void func_802961B4(s32 arg0){ + s32 sp2C[3]; + f32 sp20[3]; + + func_80330FCC(func_80291660(), sp2C); + sp20[0] = sp2C[0]; + sp20[1] = sp2C[1]; + sp20[2] = sp2C[2]; + func_80294A64(sp20); + if(arg0){ + item_dec(ITEM_14_HEALTH); + } + +} + +void func_8029622C(void){ + f32 sp34[3]; + f32 sp28[3]; + + _player_getPosition(sp28); + func_80256E24(sp34, 0.0f, yaw_get(), 0.0f, 0.0f, 100.0f); + sp28[0] += sp34[0]; + sp28[1] += sp34[1]; + sp28[2] += sp34[2]; + func_80294A64(sp28); + item_dec(ITEM_14_HEALTH); +} + +enum bs_e func_802962BC(u32 arg0){ + u32 sp24; + int sp1C; + + sp24 = item_getCount(ITEM_14_HEALTH); + sp1C = arg0 < 1 && sp24 != 0; + switch(_player_getTransformation()){ + case TRANSFORM_2_TERMITE: //L80296314 + if(sp1C) + return BS_3E_ANT_OW; + else + return BS_43_ANT_DIE; + case TRANSFORM_3_PUMPKIN: //L8029632C + if(sp1C) + return BS_4D_PUMPKIN_OW; + else + return BS_4E_PUMPKIN_DIE; + case TRANSFORM_5_CROC: //L80296344 + if(sp1C) + return BS_CROC_OW; + else + return BS_CROC_DIE; + case TRANSFORM_4_WALRUS: //L8029635C + if(sp1C) + return BS_WALRUS_OW; + else + return BS_WALRUS_DIE; + case TRANSFORM_6_BEE: //L80296374 + if(sp1C) + return BS_BEE_OW; + return BS_BEE_DIE; + case TRANSFORM_1_BANJO: //L8029638C + default: + if(sp1C){ + if(bsbtrot_inSet(bs_getState())) + return BS_BTROT_OW; + + if(func_8028EE84() == BSWATERGROUP_2_UNDERWATER) + return BS_7F_DIVE_OW; + + if(func_8028ECAC() == BSGROUP_A_FLYING) + return BS_FLY_OW; + return BS_E_OW; + } + return BS_41_DIE; + } +} + +void func_80296404(s32 arg0){ + int i; + for(i = 0; i <5; i++){ + if(D_8037C400[i].unk1C == arg0) + return; + } + + for(i = 0; i <5; i++){ + if(D_8037C400[i].unk1C == 0){ + D_8037C400[i].unk1C = arg0; + D_8037C400[i].unk18 = D_8037C3E0.unk18; + D_8037C400[i].unk0 = D_8037C3E0.unk0; + D_8037C400[i].unk4 = D_8037C3E0.unk4; + D_8037C400[i].unk14 = D_8037C3E0.unk14; + ml_vec3f_copy(D_8037C400[i].unk8, D_8037C3E0.unk8); + return; + } + } +} + +void func_802964B8(void){ + int i; + s32 tmp; + for(i = 0; i < 5; i++){ + if(D_8037C400[i].unk1C){ + func_80296C90(D_8037C400[i].unk0); + func_80296C9C(D_8037C400[i].unk4); + func_80296CA8(D_8037C400[i].unk14); + func_80296CB4(D_8037C400[i].unk18); + func_80296CC0(D_8037C400[i].unk8); + tmp = D_8037C400[i].unk1C; + D_8037C400[i].unk1C = 0; + bs_checkInterrupt(tmp); + break; + } + } +} + +f32 func_8029653C(void){ + return D_8037C3E0.unk0; +} + +f32 func_80296548(void){ + return D_8037C3E0.unk4; +} + +ActorMarker *func_80296554(void){ + return D_8037C3E0.unk14; +} + +s32 func_80296560(void){ + return D_8037C3E0.unk18; +} + +void func_8029656C(f32 dst[3]){ + ml_vec3f_copy(dst, D_8037C3E0.unk8); +} + +void func_80296590(void){ + s32 temp_a0 = bs_getInterruptType(); + switch (temp_a0) { + case 0xF : //L802965C8 + case 0x13 : //L802965C8 + case 0x26 : //L802965C8 + case 0x2a : //L802965C8 + case 0x2c : //L802965C8 + case 0x30 : //L802965C8 + func_80296404(temp_a0); + break; + case 0x31 : //L802965D8 + case 0x32 : //L802965D8 + case 0x33 : //L802965D8 + func_80296608(); + return; + default: + + break; + } + func_8029A86C(1); + bs_setState(0); +} + +void func_80296608(void){ + s32 sp2C; + s32 sp28; + s32 sp24; + s32 sp1C; + + sp2C = 1; + sp24 = 0; + sp28 = bs_getState(); + switch(bs_getInterruptType()){ + case 0x18: //L80296654 + func_802AD318(); + sp2C = 2; + break; + case 0xa: //L8029666C + sp2C = 2; + if(func_8028B2E8()){ + sp24 = func_80292738(); + } + else{ + miscflag_set(0x19); + sp24 = func_8029B504(); + } + break; + case 0x36: //L802966A8 + sp24 = BS_42_DINGPOT; + sp2C = 2; + break; + case 0x24: //L802966B8 + func_802960C4(0); + sp24 = func_80296038(); + sp2C = 2; + break; + case 0x23: //L802966D8 + func_802960C4(1); + sp24 = func_80296038(); + sp2C = 2; + break; + case 0x2d: //L802966F8 + func_802960C4(3); + sp24 = func_80296038(); + sp2C = 2; + break; + case 0x5: //L80296718 + func_802961B4(0); + sp24 = func_80296038(); + sp2C = 2; + break; + case 0x2c: //L80296738 + item_set(ITEM_14_HEALTH, 0); + func_80291930(1); + sp2C = 2; + break; + case 0x13: //L80296760 + item_set(ITEM_14_HEALTH, 0); + /* missing break ? */ + case 0xb: //L8029676C + func_8029622C(); + sp24 = func_802962BC(0); + sp2C = 2; + break; + case 0x26: //L8029678C + item_set(ITEM_14_HEALTH, 0); + func_8029B930(); + func_8029B890(); + sp2C = 2; + break; + case 0x19: //L802967BC + sp24 = func_8029B504(); + sp2C = 2; + break; + case 0x11: //L802967D4 + sp24 = BS_54_SWIM_DIE; + sp2C = 2; + break; + case 0x17: //L802967E4 + func_80294A58(D_8037C3E0.unk18); + sp24 = BS_70_CROC_EAT_GOOD; + sp2C = 2; + break; + case 0x2f: //L80296800 + sp24 = 0x40; + sp2C = 2; + break; + case 0x9: //L80296810 + sp2C = 2; + sp24 = func_80295EE0(0); + break; + case 0x1a: //L80296828 + if(!bsbtrot_inSet(sp28)){ + sp24 = func_8029B504(); + } + sp2C = 2; + break; + case 0x1b: //L80296850 + sp24 = func_8029B504(); + sp2C = 2; + break; + case 0x1f: //L80296868 + if(func_80297C6C() != 3 && func_8028D60C()){ + case 0x31: //L8029688C + func_802960C4(2); + item_dec(ITEM_14_HEALTH); + sp24 = func_802962BC(0); + sp2C = 2; + } + break; + case 0x21: //L802968B4 + if(func_80297C6C() != 3){ + case 0x33: //L802968C8 + func_802960C4(0); + item_dec(ITEM_14_HEALTH); + sp24 = func_802962BC(0); + sp2C = 2; + } + break; + case 0x20: //L802968F0 + if(func_80297C6C() != 3){ + func_802960C4(1); + item_dec(ITEM_14_HEALTH); + sp24 = func_802962BC(0); + sp2C = 2; + } + break; + case 0x2e: //L8029692C + func_802960C4(3); + item_dec(ITEM_14_HEALTH); + sp24 = func_802962BC(0); + sp2C = 2; + break; + case 0x4: //L80296954 + func_802961B4(1); + sp24 = func_802962BC(0); + sp2C = 2; + break; + case 0x14: //L80296974 + sp24 = BS_5_JUMP; + sp2C = 2; + break; + case 0x35: //L80296984 + miscflag_set(0x1a); + sp24 = func_8029B504(); + sp2C = 2; + break; + case 0x34: //L802969A4 + sp24 = func_802926E8(); + sp2C = 2; + break; + case 0x27: //L802969BC + sp24 = 0x7C; + sp2C = 2; + break; + case 0xc: //L802969CC + sp1C = player_getTransformation(); + sp1C = !((sp1C == TRANSFORM_1_BANJO) || (sp1C == TRANSFORM_7_WISHWASHY)); + if( + !func_80298850() + && !sp1C + && !miscflag_isTrue(0xf) + && !func_8028B2E8() + ){ + sp24 = BS_4F_CLIMB_IDLE; + sp2C = 2; + + } + break; + case 0x1e: //L80296A44 + if(func_8028ABB8()){ + sp2C = 2; + sp24 = func_8029BE5C(); + } + break; + case 0x1d: //L80296A68 + if(func_8028ABB8()){ + sp2C = 2; + sp24 = func_8029BF4C(); + } + break; + case 0x1c: //L80296A8C + if(func_8028ABB8()){ + sp2C = 2; + sp24 = func_8029BED4(); + } + break; + case 0x15: //L80296AB0 + sp2C = 2; + if(bsbfly_inSet(sp28)){ + sp24 = BS_24_FLY; + } + else{ + switch(func_8028EE84()){ + case BSWATERGROUP_1_SURFACE: + sp24 = BS_2D_SWIM_IDLE; + break; + case BSWATERGROUP_2_UNDERWATER: + sp24 = BS_2B_DIVE_IDLE; + break; + case BSWATERGROUP_0_NONE://L80296B0C + if(func_8028B2E8()) + sp24 = bs_getIdleState(); + else + sp24 = func_8029BA80(); + break; + + } + } + func_80297970(0.0f); + func_80297A0C(0); + break; + case 0x25: //L80296B54 + sp2C = 2; + sp24 = func_8029BED4(); + break; + case 0xf: //L80296B68 + miscflag_set(6); + sp24 = func_8029B504(); + sp2C = 2; + break; + case 0x30: //L80296B88 + item_set(ITEM_14_HEALTH, 0); + miscflag_set(6); + sp24 = func_8029B504(); + sp2C = 2; + break; + case 0x37: //L80296BB4 + sp24 = func_80292710(); + sp2C = 2; + break; + case 0x2a: //L80296BCC + sp2C = 2; + sp24 = func_8029B504(); + miscflag_set(0x14); + break; + case 0x29: //L80296BEC + if(player_getTransformation() == TRANSFORM_4_WALRUS){ + sp24 = BS_7D_WALRUS_SLED; + sp2C = 2; + } + break; + }//L80296C0C + func_8029A86C(sp2C); + bs_setState(sp24); +} + +void func_80296C30(void){ + int i; + D_8037C3E0.unk18 = 0; + D_8037C3E0.unk14 = 0; + ml_vec3f_clear(D_8037C3E0.unk8); + for(i = 0; i<5; i++) + D_8037C400[i].unk1C = 0; +} + +void func_80296C90(f32 arg0){ + D_8037C3E0.unk0 = arg0; +} + +void func_80296C9C(f32 arg0){ + D_8037C3E0.unk4 = arg0; +} + +void func_80296CA8(ActorMarker *arg0){ + D_8037C3E0.unk14 = arg0; +} + +void func_80296CB4(s32 arg0){ + D_8037C3E0.unk18 = arg0; +} + + +void func_80296CC0(f32 arg0[3]) +{ ml_vec3f_copy(D_8037C3E0.unk8, arg0); +} diff --git a/src/core2/code_FD60.c b/src/core2/code_FD60.c new file mode 100644 index 00000000..3eaad47b --- /dev/null +++ b/src/core2/code_FD60.c @@ -0,0 +1,432 @@ +#include +#include "functions.h" +#include "variables.h" + +#define _SQ3v1(v) (v[0] * v[0] + v[1] * v[1] + v[2] * v[2]) + +extern f32 ml_sin_deg(f32); +extern f32 ml_vec3f_dot_product(f32[3], f32[3]); +extern void func_80256D0C(f32, f32, f32, f32, f32, f32 *, f32 *, f32 *); +extern void func_80256E24(f32[3], f32, f32, f32, f32, f32); +extern f32 climbGetRadius(void); +extern f32 func_8029CED0(void); + +void func_80297A0C(f32 arg0[3]); +void gravity_reset(void); +void func_80297B3C(void); +void func_80297B94(void); + + +/* .data */ +f32 D_80364440 = -2700.0f; //defaultGravity +f32 D_80364444 = -4000.0f; + +/* .bss */ +s32 D_8037C4A0; +f32 D_8037C4A8[3]; +f32 D_8037C4B8[3]; //velocity? +f32 D_8037C4C8[3]; +f32 D_8037C4D8[3]; +f32 D_8037C4E4; +f32 D_8037C4E8; //gravity +f32 D_8037C4EC; +f32 D_8037C4F0; +f32 D_8037C4F4; //angle +f32 D_8037C4F8; +f32 D_8037C4FC; +f32 D_8037C500; + +struct { + u8 unk0; + u8 pad1[0x3]; + f32 unk4[3]; + f32 unk10[3]; + f32 unk1C; + f32 unk20; +} D_8037C508; + +/* .code */ +void func_80296CF0(void){ + f32 sp84[3]; + f32 sp78[3]; + f32 sp6C[3]; + f32 sp60[3]; + f32 sp54[3]; + f32 sp48[3]; + f32 sp44; + f32 sp40; + + + func_80256D0C(0.0f, D_8037C4F4, 0.0f, 0.0f, D_8037C4F0, &D_8037C4C8[0], &D_8037C4C8[1], &D_8037C4C8[2]); + sp6C[0] = D_8037C4B8[0];\ + sp6C[1] = 0.0f;\ + sp6C[2] = D_8037C4B8[2]; + // sp6C[1] = D_8037C4B8[1]; + + ml_vec3f_copy(sp60, D_8037C4C8); + sp60[1] = 0.0f; + if(func_80294548()){ + func_80294480(sp54); + ml_vec3f_normalize_copy(sp48, sp60); + sp44 = ml_vec3f_dot_product(sp48, sp54); + sp40 = get_slope_timer(); + if(sp44 != 0.0f){ + if(sp44 < 0){ + //sp44 = 0.0f; + if(func_8028B3B4()){ + sp40 = ml_map_f(sp40, 0.0f, 1.0f, sp44*0.5, -1.0f); + } + else{//L80296E3C + sp40 = 0.5*sp44; + }//L80296E54 + ml_vec3f_scale(sp60, 1.0 + sp40); + } + else{//L80296E84 + sp40 = sp44*0.2; + ml_vec3f_scale(sp60, sp40 + 1.0); + } + }//L80296EBC + }//L80296EBC + + ml_vec3f_scale_copy(sp84, sp60, func_8029CED0()); + ml_vec3f_scale_copy(sp78, sp6C, func_8029CED0()); + ml_vec3f_diff(sp84, sp78); + ml_vec3f_scale(sp84, time_getDelta()/0.0333333); + D_8037C4B8[0] += sp84[0];\ + D_8037C4B8[1] += sp84[1];\ + D_8037C4B8[2] += sp84[2]; + + sp6C[0] = D_8037C4B8[0]; + sp6C[2] = D_8037C4B8[2]; + ml_vec3f_scale_copy(D_8037C4D8, sp6C, 1.0f); + if(mlAbsF(D_8037C4B8[0]) < 0.0001) + D_8037C4B8[0] = 0; + + if(mlAbsF(D_8037C4B8[2]) < 0.0001) + D_8037C4B8[2] = 0; + + D_8037C4B8[1] = D_8037C4B8[1] + time_getDelta()*D_8037C4E8 ; + if(D_8037C4B8[1] < D_8037C4EC) + D_8037C4B8[1] = D_8037C4EC; + + D_8037C4D8[1] = D_8037C4D8[1] + D_8037C4B8[1]; + ml_vec3f_scale(D_8037C4D8, time_getDelta()); + D_8037C4A8[0] += D_8037C4D8[0];\ + D_8037C4A8[1] += D_8037C4D8[1];\ + D_8037C4A8[2] += D_8037C4D8[2]; +} + +void func_80297094(void){ + f32 sp24[3]; + ml_vec3f_diff_copy(sp24, D_8037C4C8, D_8037C4B8); + ml_vec3f_scale(sp24, time_getDelta()*D_8037C4F8); + if(_SQ3v1(sp24) < 0.02){ + ml_vec3f_copy(D_8037C4B8, D_8037C4C8); + } + else{ + D_8037C4B8[0] += sp24[0];\ + D_8037C4B8[1] += sp24[1];\ + D_8037C4B8[2] += sp24[2]; + } + D_8037C4D8[0] = D_8037C4B8[0];\ + D_8037C4D8[1] = D_8037C4B8[1];\ + D_8037C4D8[2] = D_8037C4B8[2]; + ml_vec3f_scale( D_8037C4D8, time_getDelta()); + + D_8037C4A8[0] += D_8037C4D8[0];\ + D_8037C4A8[1] += D_8037C4D8[1];\ + D_8037C4A8[2] += D_8037C4D8[2]; +} + +void func_802971DC(void){ + D_8037C4B8[1] = D_8037C4B8[1] + time_getDelta()*D_8037C4E8; + if(D_8037C4B8[1] < D_8037C4EC) + D_8037C4B8[1] = D_8037C4EC; + + D_8037C4D8[0] = D_8037C4B8[0];\ + D_8037C4D8[1] = D_8037C4B8[1];\ + D_8037C4D8[2] = D_8037C4B8[2]; + ml_vec3f_scale(D_8037C4D8, time_getDelta()); + + D_8037C4A8[0] += D_8037C4D8[0];\ + D_8037C4A8[1] += D_8037C4D8[1];\ + D_8037C4A8[2] += D_8037C4D8[2]; +} + +void func_802972AC(void){ + f32 sp34[3]; + f32 sp28[3]; + + climbGetBottom(sp28); + D_8037C4A8[0] = sp28[0]; + D_8037C4A8[2] = sp28[2]; + func_80256E24(sp34, 0.0f, yaw_get(), 0.0f, 0.0f, -climbGetRadius()); + + D_8037C4B8[2] = 0.0f; + D_8037C4A8[0] += sp34[0];\ + D_8037C4A8[1] += sp34[1];\ + D_8037C4A8[2] += sp34[2]; + + + D_8037C4B8[0] = D_8037C4C8[0] = D_8037C4C8[2] = D_8037C4B8[2]; + func_80297094(); +} + +void func_8029737C(void){ + D_8037C4D8[0] = D_8037C4B8[0]; + D_8037C4D8[1] = D_8037C4B8[1]; + D_8037C4D8[2] = D_8037C4B8[2]; + ml_vec3f_scale(D_8037C4D8, time_getDelta()); + D_8037C4A8[0] += D_8037C4D8[0]; + D_8037C4A8[1] += D_8037C4D8[1]; + D_8037C4A8[2] += D_8037C4D8[2]; +} + +void func_8029740C(void){ + D_8037C4D8[0] = D_8037C4B8[0]; + D_8037C4D8[1] = D_8037C4B8[1]; + D_8037C4D8[2] = D_8037C4B8[2]; + ml_vec3f_clear(D_8037C4B8); + ml_vec3f_scale(D_8037C4D8, time_getDelta()); + D_8037C4A8[0] += D_8037C4D8[0]; + D_8037C4A8[1] += D_8037C4D8[1]; + D_8037C4A8[2] += D_8037C4D8[2]; +} + +void func_802974A0(void){ + f32 sp2C; + + switch(D_8037C508.unk0){ + case 0: //L80297628 + break; + case 1: //L802974E8 + D_8037C508.unk0 = 2; + _player_getPosition(D_8037C508.unk4); + D_8037C508.unk20 = 0.0f; + func_80297A0C(0); + break; + case 2: //L80297510 + D_8037C508.unk20 += time_getDelta(); + sp2C = ml_map_f(D_8037C508.unk20, 0.0f, D_8037C508.unk1C, 0.0f, 1.0f); + ml_vec3f_copy(D_8037C4B8, D_8037C4A8); + D_8037C4A8[0] = func_80257C48(sp2C, D_8037C508.unk4[0], D_8037C508.unk10[0]); + D_8037C4A8[1] = func_80257C48(sp2C, D_8037C508.unk4[1], D_8037C508.unk10[1]); + D_8037C4A8[2] = func_80257C48(sp2C, D_8037C508.unk4[2], D_8037C508.unk10[2]); + ml_vec3f_diff_copy(D_8037C4B8, D_8037C4A8, D_8037C4B8); + ml_vec3f_scale(D_8037C4B8, 1.0/time_getDelta()); + if(1.0 == sp2C){ + func_80297A0C(0); + D_8037C508.unk0 = 3; + } + break; + case 3: //L80297628 + break; + } +} + +void func_80297638(void){ + f32 temp_f0; + + D_8037C500 += time_getDelta(); + temp_f0 = func_80257A44(D_8037C500, 1.2f); + temp_f0 = ml_sin_deg(temp_f0*360.0f); + D_8037C4A8[1] = 5.0*temp_f0 + D_8037C4FC; +} + +void func_802976C0(f32 arg0[3]){ + ml_vec3f_copy(arg0, D_8037C4D8); +} + +void func_802976E4(void){ + D_8037C4A0 = 0; + ml_vec3f_clear(D_8037C4B8); + ml_vec3f_clear(D_8037C4C8); + ml_vec3f_clear(D_8037C4D8); + ml_vec3f_clear(D_8037C4A8); + D_8037C4E4 = 0.0f; + func_80297B3C(); +} + +void func_80297744(void){ + _player_getPosition(D_8037C4A8); + switch(D_8037C4A0){ + case 0xc: //L80297780 + func_802974A0(); + break; + case 0xb: //L80297790 + func_80297638(); + break; + case 0x8: //L802977A0 + func_8029737C(); + break; + case 0x1: //L802977B0 + func_802971DC(); + break; + case 0x9: //L802977C0 + func_80297094(); + break; + case 0x2: //L802977D0 + func_8029797C(yaw_getIdeal()); + func_80296CF0(); + break; + case 0x5: //L802977F0 + func_8029797C(mlNormalizeAngle(yaw_getIdeal() + 180.0f)); + func_80296CF0(); + break; + case 0x3: //L80297820 + func_80296CF0(); + break; + case 0x4: //L80297830 + func_8029740C(); + break; + case 0x6: //L80297840 + if(0.0f < func_8029B2E8()){ + func_8029797C(func_8029B33C()); + } + func_80296CF0(); + break; + case 0xa: //L80297880 + func_802972AC(); + break; + case 0: + default: + break; + } + player_setPosition(D_8037C4A8); +} + +void func_802978A4(void){ + func_80297970(0.0f); + D_8037C4B8[0] = D_8037C4B8[2] = 0.0f; +} + +void func_802978DC(int arg0){ + if(arg0 == 0xB && arg0 != D_8037C4A0){ + D_8037C4FC = D_8037C4A8[1]; + D_8037C500 = 0.0f; + } + if(arg0 == 0xC){ + D_8037C508.unk0 = 1; + } + D_8037C4A0 = arg0; +} + +void func_80297930(f32 arg0[3]){ + if(arg0) + ml_vec3f_copy(D_8037C4C8, arg0); + else + ml_vec3f_clear(D_8037C4C8); +} + +void func_80297970(f32 arg0){ + D_8037C4F0 = arg0; +} + +void func_8029797C(f32 arg0){ + D_8037C4F4 = mlNormalizeAngle(arg0); +} + +void player_setYVelocity(f32 arg0){ + D_8037C4B8[1] = arg0; +} + +void func_802979AC(f32 arg0, f32 arg1) +{ func_80256D0C(0.0f, arg0, 0.0f, 0.0f, arg1, &D_8037C4B8[0], &D_8037C4B8[1], &D_8037C4B8[2]); +} + +void func_80297A0C(f32 arg0[3]){ + if(arg0) + ml_vec3f_copy(D_8037C4B8, arg0); + else + ml_vec3f_clear(D_8037C4B8); +} + +f32 func_80297A4C(void){ + return D_8037C4E8; +} + +s32 func_80297A58(void){ + return D_8037C4A0; +} + +f32 func_80297A64(void){ + return D_8037C4F0; +} + +f32 func_80297A70(void){ + return D_8037C4C8[1]; +} + +f32 func_80297A7C(void){ + return D_8037C4F4; +} + +void _get_velocity(f32 dst[3]){ + ml_vec3f_copy(dst, D_8037C4B8); +} + +f32 func_80297AAC(void){ + return D_8037C4B8[1]; +} + +f32 func_80297AB8(void){ + return gu_sqrtf(D_8037C4B8[0]*D_8037C4B8[0] + D_8037C4B8[2]*D_8037C4B8[2]); +} + +f32 func_80297AF0(void){ + f32 temp_f2; + f32 temp_f0; + f32 temp_f12; + + temp_f2 = func_80297AB8(); + temp_f0 = func_80297A64(); + + if(temp_f2 < temp_f0){ + temp_f12 = temp_f2/temp_f0; + } + else{ + temp_f12 = 1.0f; + } + return temp_f12; +} + +void func_80297B3C(void){ + gravity_reset(); + func_80297B94(); +} + +void func_80297B64(f32 arg0){ + D_8037C4F8 = arg0; +} + +void gravity_reset(void){ + gravity_set(D_80364440); +} + +void func_80297B94(void){ + func_80297BF8(D_80364444); +} + +void func_80297BB8(f32 arg0){ + D_8037C508.unk1C = arg0; +} + +void func_80297BC4(f32 src[3]) +{ ml_vec3f_copy(D_8037C508.unk10, src); +} + +void gravity_set(f32 arg0){ + D_8037C4E8 = arg0; +} + +void func_80297BF8(f32 arg0){ + D_8037C4EC = arg0; +} + +int func_80297C04(f32 arg0){ + return D_8037C4B8[0]*D_8037C4B8[0] + D_8037C4B8[2]*D_8037C4B8[2] <= (arg0*arg0); +} + +int func_80297C48(void){ + return D_8037C508.unk0 == 3; +} diff --git a/src/core2/done/bs/talk.c b/src/core2/done/bs/talk.c new file mode 100644 index 00000000..2669fb5b --- /dev/null +++ b/src/core2/done/bs/talk.c @@ -0,0 +1,51 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +s32 D_8037D570; + +/* .code */ +void func_802B6130(void){ + AnimCtrl *plyr_mvmt; + f32 yaw; + f32 plyr_pos[3]; + f32 target_pos[3]; + + plyr_mvmt = _player_getAnimCtrlPtr(); + animctrl_reset(plyr_mvmt); + func_8029C848(plyr_mvmt); + animctrl_setPlaybackType(plyr_mvmt, ANIMCTRL_LOOP); + func_802875AC(plyr_mvmt, "bstalk.c", 0x38); + _player_getPosition(plyr_pos); + func_802949F8(target_pos); + func_80257F18(plyr_pos, target_pos, &yaw); + yaw_setIdeal(yaw); + func_80289F10(1); + func_802991A8(1); + func_8029957C(3); + func_802978DC(2); + func_80297970(0.0f); + D_8037D570 = 1; +} + +void func_802B61E0(void){ + s32 tmp = 0; + + if (D_8037D570 == 0) + tmp = BS_1_IDLE; + D_8037D570 = 0; + bs_setState(tmp); +} + +void func_802B6218(void){} + +void func_802B6220(void){ + if(bs_getInterruptType() == 8){ + D_8037D570 = 1; + func_8029A86C(2); + } + else{ + func_80296608(); + } +} diff --git a/src/core2/done/climb.c b/src/core2/done/climb.c new file mode 100644 index 00000000..7be4c979 --- /dev/null +++ b/src/core2/done/climb.c @@ -0,0 +1,67 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +f32 climbPoleBottom[3]; +f32 climbPoleTop[3]; +f32 climbRadius;//climbRadius +f32 D_8037C580[3]; +f32 D_8037C58C; +u8 D_8037C590; //bool climbing +u8 D_8037C591; + +/* .code */ +void climbClear(void){ //climbClear + ml_vec3f_clear(climbPoleBottom); + ml_vec3f_clear(climbPoleTop); + D_8037C590 = 0; + D_8037C58C = 0.0f; + +} + +void climbGetBottom(f32 dst[3]){ //climbGetBottom + ml_vec3f_copy(dst, climbPoleBottom); +} + +f32 climbGetBottomY(void){ //climbGetBottomY + return climbPoleBottom[1]; +} + +f32 climbGetRadius(void){ //climbGetRadius + return climbRadius; +} + +u8 func_8029825C(void){ //climb_2098250 + return D_8037C591; +} + +f32 climbGetTopY(void){ //climbGetTopY + return climbPoleTop[1]; +} + +climbSet(f32 bottom[3], f32 top[3], f32 radius, u32 arg3){ + if( !(D_8037C58C > 0.0f) || D_8037C580[0] != bottom[0] + || D_8037C580[1] != bottom[1] || D_8037C580[2] != bottom[2]) + { + ml_vec3f_copy(climbPoleBottom, bottom); + ml_vec3f_copy(climbPoleTop, top); + climbRadius = radius; + D_8037C591 = arg3; + D_8037C590 = 1; + } +} + +void func_80298344(void){ //climbUpdateRegrab + D_8037C58C = max_f(D_8037C58C - time_getDelta(), 0.0f); + if(D_8037C590 && ability_hasLearned(ABILITY_5_CLIMB)){ + bs_checkInterrupt(0xC); + } + D_8037C590 = 0; +} + +void climbRelease(void){ //climbRelease + D_8037C590 = 0; + ml_vec3f_copy(D_8037C580, climbPoleBottom); + D_8037C58C = 0.6f; +} diff --git a/src/core2/done/code_3B2C0.c b/src/core2/done/code_3B2C0.c new file mode 100644 index 00000000..4ee6c03f --- /dev/null +++ b/src/core2/done/code_3B2C0.c @@ -0,0 +1,97 @@ +#include +#include "functions.h" +#include "variables.h" + + +f32 mlDiffDegF(f32, f32); + + +/* .bss */ +f32 D_8037DC20[3]; +f32 D_8037DC30[3]; +f32 D_8037DC3C; +f32 D_8037DC40; +u8 D_8037DC44; +f32 D_8037DC50[3]; + +/* .code */ +void func_802C2250(void){} + +void func_802C2258(void){ + D_8037DC44 = 0; +} + +void func_802C2264(f32 arg0){ + D_8037DC40 = arg0; + D_8037DC3C = D_8037DC40; + func_802BD384(D_8037DC20); + func_802BD3A8(D_8037DC30); + D_8037DC44 = 1; +} + +void func_802C22B4(void){ + D_8037DC44 = 0; +} + + +void func_802C22C0(f32 *arg0, f32 *arg1){ + f32 tmpf_1[3]; + f32 tmpf_2[3]; + f32 tmp; + + if(D_8037DC44 == 0) + return; + + if(D_8037DC44 == 1){ + ml_vec3f_diff(D_8037DC20, arg0); + D_8037DC30[0] = mlDiffDegF(D_8037DC30[0], arg1[0]); + D_8037DC30[1] = mlDiffDegF(D_8037DC30[1], arg1[1]); + D_8037DC30[2] = 0.0f; + D_8037DC44 = 2; + } + D_8037DC3C -= time_getDelta(); + if(D_8037DC3C <= 0.0f) + D_8037DC44 = 0; + else { + tmp = ml_map_f(D_8037DC3C, 0.0f, D_8037DC40, 0.0f, 1.0f); + ml_vec3f_scale_copy(tmpf_1, D_8037DC20, tmp); + ml_vec3f_scale_copy(tmpf_2, D_8037DC30, tmp); + arg0[0] += tmpf_1[0]; + arg0[1] += tmpf_1[1]; + arg0[2] += tmpf_1[2]; + arg1[0] += tmpf_2[0]; + arg1[1] += tmpf_2[1]; + arg1[2] += tmpf_2[2]; + arg1[0] = mlNormalizeAngle(arg1[0]); + arg1[1] = mlNormalizeAngle(arg1[1]); + arg1[2] = 0.0f; + } + +} + +void func_802C2460(void){ + f32 sp24[3]; + f32 sp12[3]; + + func_8024C5CC(sp24); + func_8024C764(sp12); + func_802BD334(sp24); + func_802BD35C(sp12); + player_getPosition(D_8037DC50); + func_80291488(5); +} + +void func_802C24AC(void){} + +void func_802C24B4(void){ + f32 sp24[3]; + f32 sp18[3]; + + player_getPosition(sp24); + ml_vec3f_diff_copy(sp18, D_8037DC50, sp24); + if( !(gu_sqrtf(sp18[0]*sp18[0] + sp18[1]*sp18[1] + sp18[2]*sp18[2]) < 2.0f)){ + func_80291488(2); + func_802BD0D8(0xB); + func_802BE720(); + } +} diff --git a/src/core2/fxcommon3score.c b/src/core2/fxcommon3score.c new file mode 100644 index 00000000..0016661d --- /dev/null +++ b/src/core2/fxcommon3score.c @@ -0,0 +1,232 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_8024DE1C(f32, f32, f32[3], f32[3]); +extern f32 func_802EC920(BKVertexList *); +extern void func_80253208(Gfx **gdl, s32 x, s32 y, s32 w, s32 h, void *color_buffer); + +extern s16 D_803A5D00[2][0xF660]; +extern f32 func_802FB0E4(struct8s*); + +typedef struct { + u8 pad0[0x14]; + s32 unk14; + u8 pad18[0x8]; + s32 item_id; //item_id + s32 model_id; //model_id + s32 anim_id; //anim_id + f32 anim_duration; //anim_duration + f32 unk30; + f32 unk34; + f32 unk38; + f32 unk3C; //scale? + f32 unk40; + f32 unk44; + f32 unk48; + f32 unk4C; + f32 unk50; + f32 unk54; + BKModelBin *model; + char value_string[0xC]; + f32 unk68; + f32 unk6C; + AnimCtrl *anim_ctrl; +}Struct_core2_79830_0; + +Struct_core2_79830_0 D_8036A2B0[] = { + { {0}, 0, {0}, + ITEM_E_JIGGY, ASSET_35F_MODEL_JIGGY, 0, 0.0f, + 136.0f, 236.0f, 0.0f, 0.375f, + 28.0f, -10.0f, 300.0f, 20.0f, + -1.0f, -1.0f, NULL, {'\0'}, + 0.0f, 0.0f, NULL + }, + { {0}, 0, {0}, + ITEM_18_GOLD_BULLIONS, ASSET_3C7_MODEL_GOLD_BULLION, 0, 0.0f, + 224.0f, 226.0f, 10.0f, 0.3f, + 32.0f, 0.0f, 100.0f, 20.0f, + -1.0f, -1.0f, NULL, {'\0'}, + 0.0f, 0.0f, NULL + }, + { {0}, 0, {0}, + ITEM_19_ORANGE, ASSET_2D2_MODEL_ORANGE, 0, 0.0f, + 224.0f, 226.0f, 25.0f, 0.4f, + 32.0f, 0.0f, 100.0f, 20.0f, + -1.0f, -1.0f, NULL, {'\0'}, + 0.0f, 0.0f, NULL + }, + { {0}, 0, {0}, + ITEM_1D_GRUMBLIE, ASSET_3F7_MODEL_GRUMBLIE, ASSET_12A_ANIM_GRUMBLIE_IDLE, 0.85f, + 150.0f, -20.0f, 0.0f, 0.4275f, + 200.0f, -10.0f, 100.0f, 10.0f, + -1.0f, 1.0f, NULL, {'\0'}, + 0.0f, 0.0f, NULL + }, + { {0}, 0, {0}, + ITEM_1E_YUMBLIE, ASSET_3F6_MODEL_YUMBLIE, ASSET_127_ANIM_YUMBLIE_IDLE, 0.85f, + 150.0f, -25.0f, 0.0f, 0.3825f, + 200.0f, -10.0f, 100.0f, 10.0f, + -1.0f, 1.0f, NULL, {'\0'}, + 0.0f, 0.0f, NULL + }, + { {0}, 0, {0}, + ITEM_1F_GREEN_PRESENT, ASSET_480_MODEL_XMAS_GIFT_GREEN, 0, 0.0f, + 224.0f, 226.0f, 25.0f, 0.23f, + 32.0f, 0.0f, 100.0f, 20.0f, + -1.0f, -1.0f, NULL, {'\0'}, + 0.0f, 0.0f, NULL + }, + { {0}, 0, {0}, + ITEM_20_BLUE_PRESENT, ASSET_47F_MODEL_XMAS_GIFT_BLUE, 0, 0.0f, + 224.0f, 226.0f, 12.0f, 0.21f, + 32.0f, 0.0f, 100.0f, 20.0f, + -1.0f, -1.0f, NULL, {'\0'}, + 0.0f, 0.0f, NULL + }, + { {0}, 0, {0}, + ITEM_21_RED_PRESENT, ASSET_481_MODEL_XMAS_GIFT_RED, 0, 0.0f, + 224.0f, 226.0f, 43.0f, 0.2f, + 32.0f, 0.0f, 100.0f, 20.0f, + -1.0f, -1.0f, NULL, {'\0'}, + 0.0f, 0.0f, NULL + }, + { {0}, 0, {0}, + ITEM_22_CATERPILLAR, ASSET_485_MODEL_CATERPILLAR, ASSET_18E_ANIM_CATERPILLAR_IDLE, 1.0f, + 224.0f, 226.0f, 12.0f, 0.28f, + 32.0f, 0.0f, 100.0f, 20.0f, + -1.0f, -1.0f, NULL, {'\0'}, + 0.0f, 0.0f, NULL + }, + { {0}, 0, {0}, + ITEM_23_ACORNS, ASSET_48E_MODEL_ACORN, ASSET_25B_ANIM_ACORN_IDLE, 1.0f, + 224.0f, 226.0f, 38.0f, 0.4f, + 32.0f, 0.0f, 100.0f, 20.0f, + -1.0f, -1.0f, NULL, {'\0'}, + 0.0f, 0.0f, NULL + }, + { {0}, 0, {0}, + ITEM_24_TWINKLY_SCORE, ASSET_448_MODEL_TWINKLY_BLUE, ASSET_17C_ANIM_TWINKLY_IDLE, 1.0f, + 134.0f, -32.0f, 0.0f, 0.325f, + 24.0f, -18.0f, 100.0f, 30.0f, + -1.0f, 1.0f, NULL, {'\0'}, + 0.0f, 0.0f, NULL + }, + { {0}, 0, {0}, + ITEM_26_JIGGY_TOTAL, ASSET_35F_MODEL_JIGGY, 0, 0.0f, + 208.0f, 238.0f, 0.0f, 0.325f, + 29.0f, -10.0f, 300.0f, 15.0f, + -1.0f, -1.0f, NULL, {'\0'}, + 0.0f, 0.0f, NULL + }, + { {0}, 0, {0}, + ITEM_2B_UNKNOWN, ASSET_35F_MODEL_JIGGY, 0, 0.0f, + 208.0f, 238.0f, 0.0f, 0.325f, + 29.0f, -10.0f, 300.0f, 15.0f, + -1.0f, -1.0f, NULL, {'\0'}, + 0.0f, 0.0f, NULL + }, + { {0}, 0, {0}, + -1 + } +}; + +/* .code */ +void *fxcommon3score_new(enum item_e item_id){ + Struct_core2_79830_0 *i_ptr; + + for(i_ptr = &D_8036A2B0[0]; i_ptr->item_id != -1; i_ptr++){ + if(i_ptr->item_id == item_id){ + i_ptr->unk14 = i_ptr->unk50; + return i_ptr; + } + } + return NULL; +} + +void fxcommon3score_update(enum item_e arg0, void *arg1) { + Struct_core2_79830_0 *a1 = (Struct_core2_79830_0 *)arg1; + f32 pad28; + f32 sp24; + f32 sp20; + + sp24 = ((a1 - &D_8036A2B0[0]) & 1) ? -1.0f : 1.0f; + sp20 = time_getDelta(); + switch (func_802FB0D4(a1)) { + case 1: + if (a1->model == NULL) { + a1->model = assetcache_get(a1->model_id); + } + if ((a1->anim_id != 0) && (a1->anim_ctrl == NULL)) { + a1->anim_ctrl = animctrl_new(0); + animctrl_reset(a1->anim_ctrl); + animctrl_setIndex(a1->anim_ctrl, (enum asset_e) a1->anim_id); + animctrl_setDuration(a1->anim_ctrl, a1->anim_duration); + func_802875AC(a1->anim_ctrl, "fxcommon3score.c", 0x74); + } + /* fallthrough */ + case 2: + case 3: + a1->unk68 += sp24 * sp20 * a1->unk48; + if ( a1->anim_ctrl != NULL) { + animctrl_update( a1->anim_ctrl); + } + break; + case 0: + fxcommon3score_free(arg0, a1); + break; + } +} + +void fxcommon3score_draw(enum item_e item_id, void *arg1, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Struct_core2_79830_0 *a1 = (Struct_core2_79830_0 *)arg1; + f32 sp68[3]; + f32 sp5C[3]; + f32 sp50[3]; + f32 sp44[3]; + f32 sp40; + f32 sp3C; + + sp40 = func_802FB0E4(arg1)*a1->unk54 + a1->unk34; + if(a1->model != NULL && func_802FB0D4(arg1)){ + a1->value_string[0] = '\0'; + strIToA(a1->value_string, itemPrint_getValue(item_id)); + print_bold_spaced(a1->unk30 + a1->unk40, sp40 + a1->unk44, a1->value_string); + sp3C = func_8024DE1C(a1->unk30, sp40, sp5C, sp68); + + sp44[0] = 0.0f; + sp44[1] = a1->unk38; + sp44[2] = 0.0f; + + sp50[0] = 0.0f; + sp50[1] = a1->unk68; + sp50[2] = 0.0f; + func_8033A308(sp50); + if(getGameMode() != GAME_MODE_4_PAUSED){ + set_model_render_mode(1); + } + sp68[0] += a1->unk4C; + if(a1->unk6C == 0.0f){ + a1->unk6C = 1.1*(func_802EC920(func_8033A148(a1->model)) * a1->unk3C); + } + func_80253208(gfx, a1->unk30 - a1->unk6C, sp40 - a1->unk6C, 2*a1->unk6C, 2*a1->unk6C, D_803A5D00[func_8024BDA0()]); + if(a1->anim_ctrl != NULL){ + func_8028781C(a1->anim_ctrl, sp5C, 1); + } + func_803391A4(gfx, mtx, sp5C, sp68, a1->unk3C*sp3C, sp44, a1->model); + }//L80300BA4 +} + +void fxcommon3score_free(enum item_e item_id, void *arg1){ + Struct_core2_79830_0 *a1 = (Struct_core2_79830_0 *)arg1; + if(a1->anim_ctrl != NULL){ + animctrl_free(a1->anim_ctrl); + a1->anim_ctrl = NULL; + } + + if(a1->model != NULL){ + func_8033BD4C(a1->model); + a1->model = NULL; + a1->unk6C = 0.0f; + } +} diff --git a/src/core2/gc/bound.c b/src/core2/gc/bound.c new file mode 100644 index 00000000..f64a85d6 --- /dev/null +++ b/src/core2/gc/bound.c @@ -0,0 +1,52 @@ +#include +#include "functions.h" +#include "variables.h" +#include "gc/gcbound.h" + +/* .data */ +extern s32 D_803688E0 = 0; //_gcBoundAlpha +extern Gfx D_803688E8[] = { + gsDPPipeSync(), + gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH), + gsSPTexture(0, 0, 0, G_TX_RENDERTILE, G_OFF), + gsDPSetCycleType(G_CYC_1CYCLE), + gsDPPipelineMode(G_PM_NPRIMITIVE), + gsDPSetAlphaCompare(G_AC_NONE), + gsDPSetCombineLERP(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), + gsDPSetRenderMode(IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c1(G_BL_CLR_FOG, G_BL_A_FOG, G_BL_CLR_MEM, G_BL_1MA), IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | G_RM_NOOP2), + gsSPEndDisplayList(), +}; //_gcBoundDisplayList + +/* .bss */ +extern u8 _gcbound_red; //D_80380900 +extern u8 _gcbound_green; //D_80380901 +extern u8 _gcbound_blue; //D_80380902 + +/* .code */ +void _gcbound_draw(Gfx** dl, s32 a, s32 r, s32 g, s32 b){ + gSPDisplayList((*dl)++, &D_803688E8); + gDPSetFogColor((*dl)++, r, g, b, a); + gSPTextureRectangle((*dl)++, 0, 0, (D_80276588-1)<<2, (D_8027658C-1)<<2, 0, 0, 0, 0x100, 0x100); +} + +void gcbound_draw(Gfx** dl){ + _gcbound_draw(dl, D_803688E0, _gcbound_red, _gcbound_green, _gcbound_blue); +} + +void gcbound_alpha(s32 a){ + D_803688E0 = a; + D_803688E0 = (D_803688E0 < 0) ? 0 : D_803688E0; + D_803688E0 = (D_803688E0 > 0xff) ? 0xff : D_803688E0; +} + +void gcbound_color(s32 r, s32 g, s32 b){ + _gcbound_red = r; + _gcbound_green = g; + _gcbound_blue = b; + +} + +void gcbound_reset(void){ + gcbound_alpha(0); + gcbound_color(0,0,0); +} diff --git a/src/core2/gc/pauseMenu.c b/src/core2/gc/pauseMenu.c new file mode 100644 index 00000000..d02d6559 --- /dev/null +++ b/src/core2/gc/pauseMenu.c @@ -0,0 +1,1177 @@ +#include +#include "functions.h" +#include "variables.h" + +#ifndef MIN +#define MIN(s,t) (((s) < t)?(s):(t)) +#endif + +#ifndef MAX +#define MAX(s,t) (((s) > t)?(s):(t)) +#endif + +void func_803204E4(s32, s32); +f32 func_8024DE1C(f32, f32, f32 *, f32 *); +void mlMtxApply(Mtx*); +void func_80310D2C(void); + +s32 level_get(void); +void func_80316EF4(gczoombox_t *); +void func_8024E6E0(s32, void *); +void func_8024E60C(s32, void *); +void func_8024E71C(s32, void *); +void func_8024E55C(s32, void *); +s32 getGameMode(void); +void func_803120FC(s32); + +void gczoombox_highlight(gczoombox_t *, int); + +extern s32 D_80383084; + +extern struct1As D_8036C4E0[4]; +extern struct1As D_8036C520[4]; +extern struct1Bs D_8036C560[0xD]; +extern struct1Cs D_8036C58C[0xC]; +extern u8 D_8036C604[7]; +extern const char D_8036C618[] = ""; +extern int D_8036C620; + + + +extern struct{ + u32 unk0_31:8; //menu state + u32 unk0_23:8; + u32 unk0_15:8; //menu page + u32 unk0_7:1; + u32 unk0_6:1; + u32 unk0_5:1; + u32 pad0_4:1; + u32 unk0_3:1; + u32 unk0_2:1; + u32 unk0_1:1; + u32 pad0_0:1; + s8 unk4; + s8 unk5; + u8 unk6; + u8 unk7; + s8 unk8; + s8 unk9; + s8 unkA; //joystick frame + u8 unkB; //joystick total frames + f32 unkC; + gczoombox_t *zoombox[4]; + f32 unk20; + BKSprite * unk24; //joystick sprite + f32 unk28; + BKSprite * unk2C; //B-button sprite + u8 unk30; //B-button frame + u8 unk31; //B-button total frames + s16 unk32; //B-button alpha + s16 unk34; //left joystick alpha + s16 unk36; //right joystick alpha + u8 pad38[0x2]; + u8 unk3A; + u8 pad3B[1]; + s16 unk3C[7]; + s16 unk4A[7]; + u8 pad58[0x4]; + void * unk5C; //SnS Egg Model + void * unk60; //Ice key model + u8 pad64[0xC]; + u32 unk70_31:1; + u32 unk70_30:1; + u32 unk70_29:1; + u32 pad70_28:29; +}D_80383010; + +extern char D_80383088[]; + +void func_803129DC(s32,s32); +void func_803184C8(gczoombox_t *, f32, s32, s32, f32, s32, s32); +void func_80318640(gczoombox_t *, s32, f32, f32, s32); +void func_80318734(gczoombox_t *, f32); + +/* .rodata */ +extern char D_803786B0[]; // "" +extern char D_803786B4[]; // ":" +extern char D_803786B8[]; // "0" +extern char D_803786BC[]; // ":" +extern char D_803786C0[]; // "0" +extern char D_803786C4[]; // "" +extern char D_803786C8[]; // "/" +extern char D_803786CC[]; // "/" +extern char D_803786D0[]; // "/" +extern char D_803786D4[]; //"ARE YOU SURE?" +extern char D_803786E4[]; //"A - YES, B - NO" +extern f32 D_803786F4; +extern f32 D_803786F8; +extern f32 D_803786FC; +extern f32 D_80378700; +extern f32 D_80378704; +// jump table D_80378708; +extern f64 D_80378850; +extern f64 D_80378858; +extern f64 D_80378860; +extern f64 D_80378868; +extern f32 D_80378870; +extern f32 D_80378874; + + +void func_80311740(void){ + s32 i; + for(i =0; i< 4; i++){ + if(D_80383010.zoombox[i]){ + func_80318C0C(D_80383010.zoombox[i]); + D_80383010.zoombox[i] = defrag(D_80383010.zoombox[i]); + } + } +} + +//_gcpausemenu_freeZoomboxes +void func_803117A0(void){ + s32 i; + for(i =0; i< 4; i++){ + gczoombox_free(D_80383010.zoombox[i]); + D_80383010.zoombox[i] = NULL; + } +} + +void func_803117E8(void){ + s32 i; + for( i=0; i<2; i++){ + assetcache_release(D_80383010.unk24); + D_80383010.unk24 = NULL; + assetcache_release(D_80383010.unk2C); + D_80383010.unk2C = NULL; + } + func_803117A0(); + func_80311650(); +} + +//gc_zoombox_init +#ifdef NONMATCHING +//MATCHING, but needs .rodata +void func_80311854(void){ + s32 i; + for(i = 0; i<4; i++){ + D_80383010.zoombox[i] = gczoombox_new(D_8036C4E0[i].unkC,D_8036C4E0[i].unkE, 2, 0,func_803129DC); + func_803184C8(D_80383010.zoombox[i], 60.0f, 5, 2, 0.3f, 0, 0); + func_80318640(D_80383010.zoombox[i], 0x1C, 0.75f, 0.9f, 0); + func_80318760(D_80383010.zoombox[i], 8000); + } +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_80311854.s") +#endif + +#ifdef NONMATCHING +//MATCHING, but needs .rodata +void func_80311954(void){ + s32 i; + + for(i = 0; i<4; i++){ + D_80383010.zoombox[i] = gczoombox_new(D_8036C520[i].unkC,D_8036C520[i].unkE, (i == 3) ? 1 : 2 , 0,func_803129DC); + func_803184C8(D_80383010.zoombox[i], 40.0f, 5, 2, 0.3f, 0, 0); + func_80318640(D_80383010.zoombox[i], 0x46, 0.9f, 0.7f, 1); + func_80318760(D_80383010.zoombox[i], 8000); + } + func_80318734(D_80383010.zoombox[3], 24.0f); +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_80311954.s") +#endif + +void func_80311A84(void){ + s32 i; + + func_802FA5D0(); + for(i = 0; i< 7; i++){ + func_802FACA4(D_8036C604[i]); + } + + if(func_802FC3C4()){ + D_80383010.unk70_31 = 1; + func_802FAD64(ITEM_12_JINJOS); + }else{ + func_802FACA4(ITEM_12_JINJOS); + } + + if(func_802FD2D4()){ + D_80383010.unk70_30 = 1; + func_802FAD64(ITEM_16_LIFE); + }else{ + func_802FACA4(ITEM_16_LIFE); + } +} + + +void func_80311B44(void){ + s32 i; + + for(i = 0; i<7; i++){ + func_802FAD64(D_8036C604[i]); + } + func_802FAD64(ITEM_12_JINJOS); + func_802FAD64(ITEM_16_LIFE); +} + +void func_80311B9C(s32 level, s32 *valPtr, s32 *maxPtr){ + *valPtr = notescore_getLevelScore(level); //get note highscore + *maxPtr = 100; +} + +void func_80311BD4(s32 level, s32 *valPtr, s32 *maxPtr){ + *valPtr = jiggyscore_leveltotal(level); //get note highscore + *maxPtr = 10; +} + +void func_80311C0C(s32 level, s32 *valPtr, s32 *maxPtr){ + *valPtr = honeycombscore_get_level_total(level); + *maxPtr = (level == LEVEL_B_SPIRAL_MOUNTAIN)? 6 : 2; +} + +u8 *func_80311C64(int time){ + s32 hours; + s32 minutes; + s32 seconds; + + strcpy(D_80383088, D_803786B0); //strcpy(D_80383088, ""); + strIToA(D_80383088, time/3600); + strcat(D_80383088, D_803786B4); //strcat(D_80383088, ":"); + minutes = (time/60)%60; + if(minutes < 10){ + strcat(D_80383088, D_803786B8); //strcat(D_80383088, "0"); + } + strIToA(D_80383088, minutes); + strcat(D_80383088, D_803786BC); //strcat(D_80383088, ":"); + seconds = time % 60; + if(seconds < 10){ + strcat(D_80383088, D_803786C0); //strcat(D_80383088, "0"); + } + strIToA(D_80383088, seconds); //strcat(D_80383088, ":"); + strcat(D_80383088, D_803786C4); //strcpy(D_80383088, ""); + return D_80383088; +} + +#if NONMATCING +//MATCHING NEEDS .data defined +void func_80311D74(s32 level){ + s32 val; + s32 max; + const char empty[] = ""; //D_8036C618 + + //note ratio 2 string + func_80311B9C(level, &val, &max); + strcpy(D_8036C520[0].str, empty); + strIToA(D_8036C520[0].str, val); + strcat(D_8036C520[0].str, D_803786C8); + strIToA(D_8036C520[0].str, max); + strcat(D_8036C520[0].str, empty); + + //jiggy_ratio_2_string + func_80311BD4(level, &val, &max); + strcpy(D_8036C520[1].str, empty); + strIToA(D_8036C520[1].str, val); + strcat(D_8036C520[1].str, D_803786CC); + strIToA(D_8036C520[1].str, max); + strcat(D_8036C520[1].str, empty); + + //honeycomb_ratio_2_string + func_80311C0C(level, &val, &max); + strcpy(D_8036C520[2].str, empty); + strIToA(D_8036C520[2].str, val); + strcat(D_8036C520[2].str, D_803786D0); + strIToA(D_8036C520[2].str, max); + strcat(D_8036C520[2].str, empty); + + //gametime_2_sting + strcpy(D_8036C520[3].str, empty); + strcat(D_8036C520[3].str, func_80311C64(func_8034717C(level))); +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_80311D74.s") +#endif + +void func_80311ED0(s32 *dst){ + *dst = notescore_getTotal(); //note_total +} + +void func_80311EF8(s32 *dst){ + *dst = jiggyscore_total(); +} + +void func_80311F20(s32 *dst){ + *dst = honeycombscore_get_total(); //honeycomb_total +} + +#ifdef NONMATCHING +//MATCHING NEEDS .data defined +void func_80311F48(void){ + s32 val; + const char empty[] = ""; //D_8036C618 + + //note ratio 2 string + func_80311ED0(&val); + strcpy(D_8036C520[0].str, empty); + strIToA(D_8036C520[0].str, val); + strcat(D_8036C520[0].str, empty); + + //jiggy_ratio_2_string + func_80311EF8(&val); + strcpy(D_8036C520[1].str, empty); + strIToA(D_8036C520[1].str, val); + strcat(D_8036C520[1].str, empty); + + //honeycomb_ratio_2_string + func_80311F20(&val); + strcpy(D_8036C520[2].str, empty); + strIToA(D_8036C520[2].str, val); + strcat(D_8036C520[2].str, empty); + + //gametime_2_sting + strcpy(D_8036C520[3].str, empty); + strcat(D_8036C520[3].str, func_80311C64(func_803470A0())); +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_80311F48.s") +#endif + +#ifdef NONMATCHING +//MATCHING but need .rodata +s32 func_80312034(s32 arg0){ + switch (arg0) + { + case 1: + case 2: + case 3: + case 4: + case 5: + return arg0 +2; + + case 6: + case 12: + return 2; + case 7: + return 8; + case 8: + return 11; + case 9: + return 10; + case 10: + return 9; + case 11: + return 1; + default: + return 0; + } +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_80312034.s") +#endif + +void func_8031209C(struct1As *arg0, s32 arg1){ + s32 i; + s32 j; + + for(i = 0; i < arg1; i++){//L803120B8 + arg0[i].unkF = 0; + } +} + +#ifdef NONMATCHING +void func_803120FC(s32 arg0){ + s32 i; + int _t; + switch(arg0){ + case 0: + func_80311A84(); + D_80383010.unk0_23 = 0; + D_80383010.unk0_2 = D_80383010.unk0_7 = D_80383010.unk4 = 0; + D_80383010.unk0_15 = D_80383010.unk4; + D_80383010.unk0_3 = D_80383010.unk0_2; + break; + + case 1: + D_80383010.unkC = D_80383010.unk0_6 = D_80383010.unk7 = 0; + func_8031209C(D_8036C4E0, 4); + + for(i = 0; i < 4; i++){ + gczoombox_highlight(D_80383010.zoombox[i], 1); + } + if(D_80383010.unk70_29){ + gczoombox_highlight(D_80383010.zoombox[1],0); + } + break; + + case 2: + D_80383010.unk0_6 = 0; + break; + + case 3: + func_80311B44(); + D_80383010.unkC = D_80383010.unk0_6 = 0; + D_80383010.unk5 = 3; + func_8031209C(D_8036C4E0, 4); + break; + + case 5:/* 8B334 803122C4 3C128038 */ + D_80383010.unkC = 3.0f; + D_80383010.unk5 = D_80383010.unk0_6 = 0; + func_8031209C(D_8036C4E0, 4); + for(i = 0; i < 4; i++){ + D_80383010.unk5 += func_803188B4(D_80383010.zoombox[i]); + } + break; + + case 6:/* 8B3A8 80312338 0C0C46D1 */ + func_80311B44(); + D_80383010.unk0_15 = 0; + D_80383010.unk4 = 0; + D_80383010.unkC = 0.0f; + for(i = 0; i < 4; i++){ + func_80318964(D_80383010.zoombox[i]); + } + break; + + case 7:/* 8B3F4 80312384 44803000 */ + D_80383010.unk20 = D_80383010.unk28 = 0.0f; + D_80383010.unk0_23 = 1; + D_80383010.unk0_1 = 1; + func_803117A0(); + func_80311954(); + if(D_80383010.unk0_15 == func_80312034(level_get())){ + func_802F5060(0x6e7); + } + if(D_80383010.unk0_15 != 0){ + func_80311D74(D_8036C58C[D_80383010.unk0_15].unk0); + }else{ + func_80311F48(); + } + + for(i = 0; i<4; i++){//L80312420 + + if(D_8036C58C[D_80383010.unk0_15].unk0 == 6){ + _t = (!(i == 0) && !(i == 2)); + gczoombox_highlight(D_80383010.zoombox[i], _t); + } + else if(D_8036C58C[D_80383010.unk0_15].unk0 == 0xB){ + _t = (!(i == 0) && !(i == 1)); + gczoombox_highlight(D_80383010.zoombox[i], _t); + } + else{ + gczoombox_highlight(D_80383010.zoombox[i], 1); + } + } + break; + + case 8: /* 8B54C 803124DC 44809000 */ + D_80383010.unk4 = 0; + D_80383010.unkC = 0.0f; + func_8031209C(D_8036C520, 4); + D_80383010.unk8 = -0x10; + D_80383010.unk6 = 0xFF; + D_80383010.unk0_5 = 1; + break; + + case 0xA: + D_80383010.unk0_5 = 1; + D_80383010.unk5 = 4; + D_80383010.unkC = 0.0f; + if(D_80383010.unk9 != 0xC){ + D_80383010.unk0_2 = 0; + } + func_8031209C(D_8036C520, 4); + break; + + case 0xB: + if(D_80383010.unk0_15 != 0 && D_80383010.unk0_15 == func_80312034(level_get())){ + func_802F5188(); + } + func_803117A0(); + func_80311854(); + break; + + case 0xC: + D_80383010.unk0_23 = 2; + D_80383010.unk6++; + D_80383010.unk0_5 = 1; + D_80383010.unk5 = 0; + for(i = 0; i<4; i++){ + D_80383010.unk5 += func_803188B4(D_80383010.zoombox[i]); + } + break; + + case 0xD:/* 8B694 80312624 3C128038 */ + D_80383010.unk6 = 0xFF; + D_80383010.unk0_5 = 1; + if(D_80383010.unk0_15 != 0 && D_80383010.unk0_15 == func_80312034(level_get())){ + func_802F5188(); + } + D_80383010.unk0_15 = D_80383010.unk9; + if(D_80383010.unk0_15 != 0 && D_80383010.unk0_15 == func_80312034(level_get())){ + func_802F5060(0x6e7); + } + if(D_80383010.unk0_15 != 0) + func_80311D74(D_8036C58C[D_80383010.unk0_15].unk0); + else{ + func_80311F48(); + } + for(i = 0; i < 4; i++){//L803126D8 + //L80312764 + if(D_8036C58C[D_80383010.unk0_15].unk0 == 6){ + _t = (!(i == 0) || !(i == 2)); + gczoombox_highlight(D_80383010.zoombox[i], _t); + } + else if(D_8036C58C[D_80383010.unk0_15].unk0 == 0xB){//L80312728 + _t = (!(i == 0) && !(i == 1)); + gczoombox_highlight(D_80383010.zoombox[i], _t); + } + else{ + gczoombox_highlight(D_80383010.zoombox[i], 1); + } + if(func_80318604(D_80383010.zoombox[i])){ + gczoombox_maximize(D_80383010.zoombox[i]); + func_803183A4( D_80383010.zoombox[i], D_8036C520[i].str); + } + //L8031279C + } + break; + + case 0xE:/* 8B824 803127B4 3C128038 */ + D_80383010.unk0_23 = 4; + D_80383010.unk0_15 = D_80383010.unk9; + D_80383010.unk9 = -1; + D_80383010.unk5C = assetcache_get(0x50D); + D_80383010.unk60 = assetcache_get(0x50C); + for(i = 0; i < 7; i++){ + D_80383010.unk3C[i+1] = randf2(0.0f, 360.0f); + D_80383010.unk4A[i] = ((i & 1)? -1.0: 1.0)*randf2( 60.0f, 180.0f); + } + break; + + case 0xF: /* 8B8FC 8031288C 3C128038 */ + D_80383010.unk8 = -0x10; + D_80383010.unk6 = 0xff; + D_80383010.unk0_5 = D_80383010.unk3A = 1; + break; + + case 0x10: + break; + + case 0x11: /* 8B944 803128D4 3C128038 */ + D_80383010.unk0_5 = 1; + D_80383010.unk3A = 0; + if(D_80383010.unk9 == -1) + D_80383010.unk0_1 = 0; + break; + + case 0x12: /* 8B978 80312908 3C128038 */ + D_80383010.unk0_15 = D_80383010.unk9; + func_8033BD20(D_80383010.unk5C); + func_8033BD20(D_80383010.unk60); + break; + + case 0x13: /* 8B9A8 80312938 3C128038 */ + D_80383010.unk0_7 = 0; + break; + + case 0x14: /* 8B9C0 80312950 3C128038 */ + D_80383010.unk0_6 = 0; + D_80383010.unk0_7 = D_80383010.unk0_6; + D_80383010.unkC = 0.0; + func_8025A430(-1, 0x7D0, 3); + func_8025A2B0(); + func_802DC528(0,0); + break; + default: + break; + } + D_80383010.unk0_31 = arg0; +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_803120FC.s") +#endif + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_803129DC.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_80312B04.s") + +s32 func_80312B84(void){ return 1; } + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_80312B8C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_80312D78.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_80312E80.s") + +func_80312F88(s32 arg0){ + struct1Cs *v0 = D_8036C58C + arg0; + print_bold_overlapping(v0->x, D_80383010.unk8, -1.05f, v0->string); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_80312FD0.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_80313070.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_8031307C.s") + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_80313134.s") + + +#ifdef NONMATCHING +s32 func_80313380(void){ + s32 temp; + s32 sp6C[6]; + s32 sp60[3]; + s32 sp50[4]; + f32 sp48[2]; + s32 level = level_get(); //sp44 + s32 i; + + + if(getGameMode() != GAME_MODE_4_PAUSED) + return 0; + + func_8024E55C(0, sp6C); + func_8024E71C(0, sp48); + func_8024E60C(0, sp60); + func_8024E6E0(0, sp50); + func_80310D2C(); + for(i = 0; i < 4; i++){ + func_80316EF4(D_80383010.zoombox[i]);//gczoombox_update; + } + + + D_80383010.unkC += time_getDelta(); + switch(D_80383010.unk0_31){ + case 0: //closed + func_803120FC(1); + break; + case 1: //opening + if(func_80312D78(D_8036C4E0, 4) == 4){ + if(((D_80383010.unk70_29)? 3: 4 ) == D_80383010.unk4){ + D_80383010.unk4 = 0; + func_803120FC(2); + } + } + if(func_8024E67C(BUTTON_START) == 1){ + func_803120FC(6); + } + break; + case 2: //open + if(D_80383010.unk70_31 && !func_802FC3C4()){ + func_802FACA4(ITEM_12_JINJOS); + D_80383010.unk70_31 = 0; + }//L8031350C + if(D_80383010.unk70_30 && !func_802FD2D4()){ + func_802FACA4(ITEM_16_LIFE); + D_80383010.unk70_30 = 0; + } + if(func_8024E67C(BUTTON_START) == 1){ + func_803120FC(6); + }else if(sp6C[0] == 1){ + switch(D_80383010.unk0_15){ + case 1://L80313594 + if(level > 0 && level < 0xC) + if(D_8036C560[level-1].map != -1) + func_803120FC(5); + break; + case 3://L803135D0 + func_803120FC(5); + break; + default://L803135E4 + func_803120FC(3); + break; + } + } + else if(sp6C[1] == 1){//L803135F8 + gczoombox_highlight(D_80383010.zoombox[D_80383010.unk0_15], 0); + D_80383010.unk0_15 = 0; + gczoombox_highlight(D_80383010.zoombox[D_80383010.unk0_15], 1); + func_803120FC(3); + } + else if(D_80383010.unk7 > 0) {//L8031364C + D_80383010.unk7--; + }//L80313664 + else { + if( D_80383010.unk0_15 == 2 && !D_80383010.unk0_6){ + func_803160A8(D_80383010.zoombox[D_80383010.unk0_15]); + D_80383010.unk0_6 = 1; + } + if(0.75 < sp48[1]){ + if((s32)D_80383010.unk0_15 > 0){ + gczoombox_highlight(D_80383010.zoombox[D_80383010.unk0_15], 0); + D_80383010.unk0_15--; + if(D_80383010.unk70_29 && D_80383010.unk0_15 == 1) + D_80383010.unk0_15 --; + gczoombox_highlight(D_80383010.zoombox[D_80383010.unk0_15], 1); + func_803160A8(D_80383010.zoombox[D_80383010.unk0_15]); + D_80383010.unk0_6 = 0; + D_80383010.unk7 = 6; + } + }else if(sp48[1] < -0.75){ + if((s32)D_80383010.unk0_15 < 3){ + gczoombox_highlight(D_80383010.zoombox[D_80383010.unk0_15], 0); + D_80383010.unk0_15++; + if(D_80383010.unk70_29 && D_80383010.unk0_15 == 1) + D_80383010.unk0_15++; + gczoombox_highlight(D_80383010.zoombox[D_80383010.unk0_15], 1); + func_803160A8(D_80383010.zoombox[D_80383010.unk0_15]); + D_80383010.unk0_6 = 0; + D_80383010.unk7 = 6; + } + } + } + temp = D_80383010.unk0_15; + if(temp == 2 && !D_80383010.unk0_6 && D_80383010.unk7 == 3){ + func_803160A8(D_80383010.zoombox[D_80383010.unk0_15]); + D_80383010.unk0_6 = 1; + } + break; + + case 3: //returning to game + func_80312E80(D_8036C4E0,4); + if(D_80383010.unk5 <= 0){ + for(i = 0; i<4; i++){ + gczoombox_close(D_80383010.zoombox[i]); + } + D_80383010.unk5 = 0x7F; + } + if(D_80383010.unk4 == 4){ + D_80383010.unk4 = 0; + func_803120FC(4); + } + break; + case 4: + switch(D_80383010.unk0_15){ + case 0://L803138FC + D_80383010.unk0_7 = 1; + break; + case 1://L80313908 //return to lair + func_803204E4(0x16, 1); + if(map_get() == MAP_LAIR_FURNACE_FUN){ + func_803204E4(0,0); + func_802E4078(MAP_LAIR_FF_ENTRANCE, 2, 1); + }else{ + func_802E4078(D_8036C560[level-1].map, D_8036C560[level-1].exit, 1); + } + func_803120FC(0x13); + break; + case 2://L80313978 + D_80383010.unk0_15 = func_80312034(level_get()); + func_803120FC(7); + break; + case 3://L8031399C + func_802C5994(); + func_803204E4(0,0); + if(!func_8031FF1C(BKPROG_BD_ENTER_LAIR_CUTSCENE) || func_8031FF1C(BKPROG_A6_FURNACE_FUN_COMPLETE)){ + func_803120FC(0x14); + }else{ + func_802E412C(1,0); + func_802E4078(MAP_CUTSCENE_GAMEOVER, 0, 1); + func_803120FC(0x13); + } + break; + } + break; + case 5: + if(3.0 < D_80383010.unkC){ + if( D_8036C4E0[D_80383010.unk0_15].unkF){ + gczoombox_minimize(D_80383010.zoombox[D_80383010.unk0_15]); + } + D_80383010.unk0_6 ^= 1; + gczoombox_maximize(D_80383010.zoombox[D_80383010.unk0_15]); + if(D_8036C4E0[D_80383010.unk0_15].unkF = func_803183A4(D_80383010.zoombox[D_80383010.unk0_15], (D_80383010.unk0_6)? "ARE YOU SURE?" : "A - YES, B - NO")) + D_80383010.unkC = 0.0; + }//L80313AF4 + if(func_8024E67C(BUTTON_START) == 1){ + func_803120FC(6); + }else if(sp6C[1] == 1){ + D_80383010.unk4 = (D_80383010.unk70_29)? 3 : 4; + func_803188B4(D_80383010.zoombox[D_80383010.unk0_15]); + func_803120FC(1); + }else if(sp6C[0] == 1){//L80313B68 + func_803120FC(3); + } + break; + + case 6://80313B80 + if(D_80383010.unk4 == 4){ + if(0.2 < D_80383010.unkC){ + D_80383010.unk4 = 0; + func_803120FC(4); + } + } + break; + + case 7: + func_803120FC(8); + break; + case 8: + func_80312F88(D_80383010.unk0_15); + func_80312FD0(1); + func_80312D78(D_8036C520,4); + func_80313134(); + if(D_80383010.unk4 == 4){ + D_80383010.unk4 = 0; + func_803120FC(9); + } + break; + case 9: + func_80312F88(D_80383010.unk0_15); + func_80312FD0(1); + func_80313134(); + if(func_8024E67C(BUTTON_START) == 1){ + D_80383010.unk0_23 = 3; + func_803120FC(0xA); + }else if(sp6C[1] == 1){ + func_803120FC(0xA); + }else if(0.75 < sp48[0]){ + if((s32)D_80383010.unk0_15 < func_80313070()) + func_8031307C(1); + }else if(sp48[0] < -0.75){//L80313CCC + if((s32)D_80383010.unk0_15 > 0){ + func_8031307C(-1); + } + } + break; + + case 0xA://80313D00 + func_80312F88(D_80383010.unk0_15); + func_80312FD0(-1); + func_80312E80(D_8036C520, 4); + func_80313134(); + if(D_80383010.unk9 != 0xC){ + D_80383010.unk0_3 = 0; + D_80383010.unk0_2 = 0; + }//L80313D50 + if(!D_80383010.unk5){ + for(i = 0; i < 4; i++){ + gczoombox_close(D_80383010.zoombox[i]); + } + D_80383010.unk5 = 1; + }//L80313D8C + if( D_80383010.unk4 == 4){ + D_80383010.unk4 = 0; + func_803120FC(0xB); + } + break; + + case 0xB: + if(D_80383010.unk0_23 == 3){ + D_80383010.unk0_7 = 1; + } + else{ + func_803120FC((D_80383010.unk9 == 0xC)? 0xE : 0); + } + break; + + case 0xC: + func_80312F88(D_80383010.unk0_15); + func_80312FD0(-1); + func_80313134(); + if(D_80383010.unk5 == 0 && !D_80383010.unk0_5){ + func_803120FC(0xd); + } + break; + + case 0xD: + func_80312F88(D_80383010.unk0_15); + func_80312FD0(1); + func_80313134(); + if(D_80383010.unk7 > 0) + D_80383010.unk7--; + else + func_803120FC(9); + break; + + case 0xE: + func_803120FC(0xF); + break; + + case 0xF: + func_80312F88(D_80383010.unk0_15); + func_80312FD0(1); + func_80313134(); + if(!D_80383010.unk0_5){ + func_803120FC(0x10); + } + break; + + case 0x10: + func_80312F88(D_80383010.unk0_15); + func_80313134(); + if(func_8024E67C(BUTTON_START) == 1){ + D_80383010.unk0_23 = 3; + func_803120FC(0x11); + }//L80313EFC + else if(sp6C[1] == 1){ + func_803120FC(0x11); + } + else if(sp48[0] < -0.75){ + func_8031307C(-1); + func_803120FC(0x11); + } + break; + + case 0x11: + func_80312F88(D_80383010.unk0_15); + func_80312FD0(-1); + func_80313134(); + if(D_80383010.unk9 == -1){ + D_80383010.unk0_3 = 0; + D_80383010.unk0_2 = 0; + } + if(D_80383010.unk3C[0] == 0){ + func_803120FC(0x12); + } + break; + + case 0x12: + if(D_80383010.unk0_23 == 3){ + D_80383010.unk0_7 = 1; + }else{ + func_803120FC((D_80383010.unk9 != -1)?7:0); + } + break; + + case 0x14: + func_802DC5B8(); + if( 5.0 < D_80383010.unkC){ + if(!D_80383010.unk0_6){ + func_802DC560(0,0); + func_802E412C(1,0); + func_802E4078(0x1f, 0, 1); + D_80383010.unk0_6 = 1; + } + } + break; + + } + return D_80383010.unk0_7; +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_80313380.s") +#endif + +void __pause_drawSprite(Gfx** gdl, Mtx** mptr, void* vptr, BKSprite* sprite, s32 frame, f32 x, f32 y, f32 w, f32 h, u8 a){ + f32 sp5C[3]; + f32 sp50[3]; + f32 sp44[3]; + f32 sp38[3]; + f32 sp34; + BKSpriteFrame *_frame; + f32 sp2C; + f32 sp28; + + _frame = spriteGetFramePtr(sprite, frame); + sp2C = _frame->w; + sp28 = _frame->h; + func_803382E4(5); + func_80338338(0xFF, 0xFF, 0xFF); + func_803382FC(a); + func_8033837C(0); + func_8024C5CC(sp50); + + sp34 = func_8024DE1C(x, y, sp5C, sp44); + mlMtxIdent(); //matrix_stack_identity + sp38[0] = sp5C[0] - sp50[0]; + sp38[1] = sp5C[1] - sp50[1]; + sp38[2] = sp5C[2] - sp50[2]; + mlMtxTranslate(sp38[0], sp38[1], sp38[2]); //mtx_translate + mlMtxRotYaw(sp44[1]); //mtx_rot_yaw + mlMtxRotPitch(sp44[0]); //mtx_rot_pitch + mlMtxRotRoll(sp44[2]); //mtx_rot_roll + mlMtxScale_xyz((sp34 * w)/sp2C, (sp34 * h)/sp28, sp34); + mlMtxApply(*mptr); //add matrix; + gSPMatrix((*gdl)++, (*mptr)++, G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + func_80338308((s32)sp2C, (s32)sp28); + func_80336904(gdl, vptr, sprite, frame); + gSPPopMatrix((*gdl)++, G_MTX_MODELVIEW); +} + + +void func_80314234(Gfx** gdl, Mtx** mptr, s32 vptr, BKSprite *sprite, s32 frame, f32 x, f32 y, s32 mirror, u8 a){ + BKSpriteFrame *_frame; + s32 w; + s32 h; + _frame = spriteGetFramePtr(sprite, frame); + w = ((mirror)? -1 : 1) * _frame->w; + h = _frame->h; + __pause_drawSprite(gdl, mptr, vptr, sprite, frame, (x - w * 0.5), (y - h * 0.5), w, h, a); +} + +#ifdef NONMATCHING +void func_80314320(Gfx **gdl, Mtx **mptr, s32 arg2){ + f32 sp98[3]; + f32 sp8C[3]; + f32 sp80[3]; + s32 i; + s32 j; + f32 sp7C; + + if(getGameMode() != GAME_MODE_4_PAUSED){ + if(!D_8036C620) + func_803151D0(gdl, mptr, arg2); + D_8036C620 = 1; + }else{ + if(D_8036C620){ + func_8033B61C(); + func_80315084(gdl, mptr, arg2); //viBuffer_2_zBuffer + D_8036C620 = 0; + }else{ + func_80315110(gdl, mptr, arg2); //zBuffer_2_viBuffer + }//L803143D8 + + //draw_zoomboxes + for(i = 0; i < 4; i++){ + gczoombox_draw(D_80383010.zoombox[i], gdl, mptr, arg2); + } + + //draw_control_stick_sprites + func_80314234(gdl, mptr, arg2, D_80383010.unk24, D_80383010.unkA, 30.0f, 196.0f, 1, D_80383010.unk34); + func_80314234(gdl, mptr, arg2, D_80383010.unk24, D_80383010.unkA, (f32)(D_80276588 - 30), 196.0f, 0, D_80383010.unk36); + if(D_80383010.unk0_3 && D_80383010.unk34 < 0xFF){ + D_80383010.unk34 = MIN(D_80383010.unk34 + 0xC, 0xFF); + } + if(!D_80383010.unk0_3 && D_80383010.unk34 > 0){ + D_80383010.unk34 = MAX(D_80383010.unk34 - 0xC, 0); + } + if(D_80383010.unk0_2 && D_80383010.unk36 < 0xFF){ + D_80383010.unk36 = MIN(D_80383010.unk36 + 0xC, 0xFF); + } + if(!D_80383010.unk0_2 && D_80383010.unk36 > 0){ + D_80383010.unk36 = MAX(D_80383010.unk36 - 0xC, 0); + } + + //draw_b_button + func_80314234(gdl, mptr, arg2, D_80383010.unk2C, D_80383010.unk30, D_80276588 * 0.5, 196.0f, 0, D_80383010.unk32); + if(D_80383010.unk0_1 && D_80383010.unk32 < 0xFF){ + D_80383010.unk32 = MIN(D_80383010.unk32 + 0xC, 0xFF); + } + if(!D_80383010.unk0_1 && D_80383010.unk32 > 0){ + D_80383010.unk32 = MAX(D_80383010.unk32 - 0xC, 0); + } + + //L80314664 + if(D_80383010.unk3C[0]){//L80314690 + sp7C = time_getDelta(); + for(i = 1; i<7; i++){ + if(sns_get_item_state(i, 0)){ + D_80383010.unk3C[i] = (s16) ((f32)D_80383010.unk3C[i] + D_80383010.unk4A[i]*sp7C); + if(360.0 < (f64)D_80383010.unk3C[i]){ + D_80383010.unk3C[i] = D_80383010.unk3C[i] - 360.0; + }//L80314728 + if((f64)D_80383010.unk3C[i] < 0.0){ + D_80383010.unk3C[i] = D_80383010.unk3C[i] + 360.0; + }//L80314748 + + func_8024E258(); + sp98[0] = ((i-1)*0.4)*360.0 + -360.0; + sp98[1] = 0.0f; + sp98[2] = 1000.0f; + sp8C[0] = 0.0f; + sp8C[1] = 0.0f; + sp8C[2] = 0.0f; + + func_8024CD88(sp98); + func_8024CE18(sp8C); + func_8024CFD4(); + func_8024C904(gdl, mptr); + for(j = 1; j < 7 ; j++){ + func_8033A45C(j, 0); + } + func_8033A45C(i, 1); + + sp98[0] = 0.0f; + sp98[1] = 0.0f; + sp98[2] = 0.0f; + sp8C[0] = 0.0f; + sp8C[1] = 0.0f; + sp8C[2] = 0.0f; + sp80[0] = 0.0f; + sp80[1] = -50.0f; + sp80[2] = 0.0f; + + set_model_render_mode(0); + func_8033A410(D_80383010.unk3C[0]); + func_803391A4(gdl, mptr, sp98, sp8C, 0.8f, sp80, D_80383010.unk5C); + func_8024E2FC(); + func_8024C904(gdl, mptr); + } + }//L80314880 + if(sns_get_item_state(7,0)){ + D_80383010.unk3C[1] += D_80383010.unk4A[1] * sp7C; + if(360.0 < D_80383010.unk3C[1]){ + D_80383010.unk3C[1] -= 360.0; + } + if(D_80383010.unk3C[1] > 0.0){ + D_80383010.unk3C[1] += 360.0; + } + func_8024E258(); + sp98[0] = 0.0f; + sp98[1] = 0.0f; + sp98[2] = 1000.0f; + sp8C[0] = 0.0f; + sp8C[1] = 0.0f; + sp8C[2] = 0.0f; + func_8024CD88(sp98); + func_8024CE18(sp8C); + func_8024CFD4(); + func_8024C904(gdl, mptr); + + sp98[0] = 0.0f; + sp98[1] = 0.0f; + sp98[2] = 0.0f; + sp8C[0] = 0.0f; + sp8C[1] = D_80383010.unk3C[1]; + sp8C[2] = 0.0f; + sp80[0] = 0.0f; + sp80[1] = 120.0f; + sp80[2] = 0.0f; + set_model_render_mode(0); + func_8033A410(D_80383010.unk3C[0]); + func_803391A4(gdl, mptr, sp98, sp8C, 0.8f, sp80, D_80383010.unk60); + func_8024E2FC(); + func_8024C904(gdl, mptr); + }//L80314A20 + } + //L80314A20 + if(D_80383010.unk3A && D_80383010.unk3C[0] < 0xFF){ + D_80383010.unk3C[0] = MIN(D_80383010.unk3C[0] + 0xC, 0xFF); + } + if(!D_80383010.unk3A && D_80383010.unk3C[0] > 0){ + D_80383010.unk3C[0] = MAX(D_80383010.unk3C[0] - 0xC, 0); + } + if(D_80383010.unk0_31 == 0x14){ + func_802DC604(gdl, mptr, arg2); + } + + } +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/pauseMenu/func_80314320.s") +#endif + +void func_80314AC8(int arg0){ + if(arg0) + D_80383084--; + else + D_80383084++; +} + +int func_80314B00(void){ + return (!D_80383084) ? 1: 0; +} + +void func_80314B24(void){ + D_80383084 = 0; +} + +void func_80314B30(void){ + s32 level = level_get(); + if(0 < level && level < 0xC && D_8036C560[level-1].map != -1){ + func_803204E4(0x16, 1); + func_802E4078(D_8036C560[level-1].map, D_8036C560[level-1].exit, 1); + } +} diff --git a/src/core2/gc/transition.c b/src/core2/gc/transition.c new file mode 100644 index 00000000..afd3b12e --- /dev/null +++ b/src/core2/gc/transition.c @@ -0,0 +1,364 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "gc/gctransition.h" + +void animctrl_setAnimTimer(AnimCtrl*, f32); +void func_8025AC20(s32, s32, s32, f32, char*, s32); +f32 func_80257618(void); +void func_8024CE60(f32, f32); + +struct{ + s32 unk0; //times drawn? + struct9s *unk4; + u8 unk8; //state + u8 pad9[3]; //not needed + void * unkC; //asset_ptr + f32 rotation; + f32 timer; + AnimCtrl *animctrl; + s32 unk1C; //times update called? +} D_80382430; + +extern struct9s D_8036C150[0x16]; +extern struct9s D_8036C308[0xC]; +extern struct10s D_8036C3F8[0x18]; +extern f32 D_8036C440; +extern f32 D_8036C444; + +struct9s *_gctranstion_8030B400(s32 arg0){ + struct9s * i; + for(i = D_8036C150; i->uid != 0; i++){ + if(i->uid == arg0) + return i; + } + return NULL; +} + +struct10s *_gctranstion_8030B44C(s32 map_indx){ + struct10s * i; + for(i = D_8036C3F8; i->map_indx != 0; i++){ + if(i->map_indx == map_indx) + return i; + } + return i; +} + +void _gctranstion_changeState(s32 state, struct9s *arg1){ + if(D_80382430.unkC != NULL){ + func_8033BD20(&D_80382430.unkC); + } + + if(D_80382430.animctrl != NULL){ + animctrl_free(D_80382430.animctrl); + D_80382430.animctrl = NULL; + } + + D_80382430.unk0 = 0; + D_80382430.unk4 = arg1; + D_80382430.unk8 = state; + D_80382430.timer = 0.0f; + if(state == 1) + D_80382430.unkC = assetcache_get(0x7D2); + else if(state == 6) + D_80382430.unkC = assetcache_get(0x7D3); + else if(arg1 != NULL && arg1->unk8 != 0) + D_80382430.unkC = assetcache_get(arg1->unk8); + + if(arg1 != NULL && arg1->unkC != NULL){ + D_80382430.animctrl = animctrl_new(0); + animctrl_reset(D_80382430.animctrl); + animctrl_setIndex(D_80382430.animctrl, arg1->unkC); + animctrl_setDuration(D_80382430.animctrl, arg1->unk4); + animctrl_setPlaybackType(D_80382430.animctrl, ANIMCTRL_ONCE); + if(state == 5){ + animctrl_setDirection(D_80382430.animctrl, 0); + func_8028F7C8(1); //player_noControl(true) + func_80335110(0); //objects_update(false) + } + else{ + osViBlack(1); + animctrl_setAnimTimer(D_80382430.animctrl, 0.25f); //set animation timer + } + func_802875AC(D_80382430.animctrl, "gctransition.c", 0x125); + } + + if(state == 4){ + if(func_802D4608()==0){ + func_8025A70C(COMUSIC_4E_IN_TRANSITION); + func_8025AC20(COMUSIC_4E_IN_TRANSITION, 0, 1000, 0.4f, "gctransition.c", 0x12d); + func_8025AABC(COMUSIC_4E_IN_TRANSITION); + } + }//L8030B67C + else if(state == 5){ + if(D_80382430.unk4->uid == 0xA){ + func_8030E704(SFX_EB_GRUNTY_LAUGH_2); + } + else{ + if(func_802D4608() == 0){ + func_8025A70C(COMUSIC_4F_OUT_TRANSITION); + func_8025AC20(COMUSIC_4F_OUT_TRANSITION, 0, 1000, 0.2f, "gctransition.c", 0x13a); + func_8025AABC(COMUSIC_4F_OUT_TRANSITION); + } + } + } + else if(state == 0){ + func_80335128(1); + func_80335110(1); + if(func_8028F070()) + func_8028F7C8(0); + } + D_80382430.unk1C = 0; +} + +void gctransition_8030B740(void){ + if(D_80382430.unkC != NULL) + D_80382430.unkC = defrag_asset(D_80382430.unkC); +} + +void gctransition_draw(Gfx **gdl, Mtx **mptr, Vtx **vptr){ + f32 sp74[3]; + f32 sp68[3]; + f32 sp64; + f32 sp58[3]; + f32 tmp; + + D_80382430.unk0++; + if(D_80382430.unk8 == 0) + return; + + func_8024E258(); + if(D_80382430.animctrl != NULL){ + sp74[0] = 0.0f; + sp74[1] = 0.0f; + sp74[2] = 350.0f; + }else{ + sp74[0] = 0.0f; + sp74[1] = 0.0f; + sp74[2] = 300.0f; + } + + sp68[0] = 0.0f; + sp68[1] = 0.0f; + sp68[2] = 0.0f; + func_8024CE60(D_8036C440, D_8036C444); + func_8024CD88(sp74); //camera_setPosition + func_8024CE18(sp68); //camera_setRotation + func_8024CFD4(); //camera_updateNormal + func_8024C904(gdl, mptr); + + sp58[0] = 0.0f; + sp58[1] = 0.0f; + sp58[2] = 0.0f; + if(D_80382430.animctrl != NULL){ + gDPSetTextureFilter((*gdl)++, G_TF_POINT); + gDPSetColorDither((*gdl)++, G_CD_DISABLE); + func_8028781C(D_80382430.animctrl, sp58, 1); + set_model_render_mode(1); + } + if(D_80382430.unk8 == 1 || D_80382430.unk8 == 6){ + func_803391A4(gdl, mptr, sp58, sp68, 1.0f, 0, D_80382430.unkC); + if(D_80382430.animctrl != NULL){ + gDPSetTextureFilter((*gdl)++, G_TF_BILERP); + gDPSetColorDither((*gdl)++, G_CD_MAGICSQ); + } + } + else{ + sp64 = D_80382430.timer/(D_80382430.unk4->unk4); + if(D_80382430.unk8 == 4){ + + if(D_80382430.unk4->uid == 0x10){ + tmp = D_80382430.unk4->unk10; + + } + else{ + sp68[2] = D_80382430.rotation - 90.0f*sp64; + tmp = sp64*D_80382430.unk4->unk10 + 0.1; + } + func_803391A4(gdl, mptr, sp58, sp68, tmp, 0, D_80382430.unkC); + } + else if(D_80382430.unk8 == 5){//L8030B9EC + switch (D_80382430.unk4->uid) + { + default: + sp68[2] = D_80382430.rotation - 90.0f*sp64; + tmp = (1.0f - sp64)*D_80382430.unk4->unk10 + 0.1; + break; + case 0x11: + tmp = D_80382430.unk4->unk10; + break; + case 0xA: + sp68[2] = 0.0f; + tmp = (1.0f - func_80257618())*D_80382430.unk4->unk10 + 0.1; + break; + } + if(!(D_80382430.unk1C < 3) || D_80382430.unk4->uid != 0x11){ + func_803391A4(gdl, mptr, sp58, sp68, tmp, 0, D_80382430.unkC); + } + else{ + func_80338390(); + } + + } + else if(D_80382430.unk8 == 2){//L8030BAF4 + gcbound_reset(); + gcbound_alpha((1.0f - sp64)*255.0f + 0.5); + gcbound_color(0,0,0); + gcbound_draw(gdl); + } + else if(D_80382430.unk8 == 3){//L8030BB6C + gcbound_reset(); + gcbound_alpha(sp64*255.0f + 0.5); + gcbound_color(0,0,0); + gcbound_draw(gdl); + } + else if(D_80382430.unk8 == 7){//L8030BBD8 + sp64 = (sp64 <= 0.5)? 1.0 : 1.0 - (sp64-0.5)/0.5; + gcbound_reset(); + gcbound_alpha(sp64*255.0f + 0.5); + gcbound_color(0xff,0xff,0xff); + gcbound_draw(gdl); + } + else if(D_80382430.unk8 == 8){//L8030BC8C + + gcbound_reset(); + gcbound_alpha(sp64*255.0f + 0.5); + gcbound_color(0xff,0xff,0xff); + gcbound_draw(gdl); + }//L8030BD00 + else{ + + } + if(D_80382430.animctrl != NULL){ + gDPSetTextureFilter((*gdl)++, G_TF_BILERP); + } + func_8024E2FC(); + func_8024C904(gdl, mptr); + } +} + +void gctransition_8030BD4C(void){ + struct10s *tmp_10s; + struct9s *tmp_a1; + tmp_10s = _gctranstion_8030B44C(map_get()); + tmp_a1 = _gctranstion_8030B400(tmp_10s->unk1); + _gctranstion_changeState(tmp_a1->unk1, tmp_a1); +} + +f32 gctransition_8030BD88(void){ + return 300.0f; +} + +int gctransition_8030BD98(void){ + return D_80382430.unk8 == 0; +} + +int gctransition_8030BDAC(void){ + return D_80382430.unk8 != 0; +} + +int gctransition_8030BDC0(void){ + return ( D_80382430.unk8 == 0x3) + || (( D_80382430.unk8 == 1) && (D_80382430.unk0 < 2)) + || ( D_80382430.unk8 == 5) + || ( D_80382430.unk8 == 8) + || (( D_80382430.unk8 == 6) && (D_80382430.unk0 < 2)); +} + +void gctransition_8030BE3C(void){ + _gctranstion_changeState(0, NULL); +} + +void gctransition_8030BE60(void){ + struct9s *tmp_a1; + tmp_a1 = _gctranstion_8030B400(_gctranstion_8030B44C(map_get())->unk2); + func_8030C180(); + _gctranstion_changeState(tmp_a1->unk1, tmp_a1); +} + +void gctransition_8030BEA4(s32 arg0){ + _gctranstion_changeState(D_8036C308[arg0].unk1, &D_8036C308[arg0]); +} + +void gctransition_reset(void){ + D_80382430.unk4 = NULL; + D_80382430.unk8 = 0; + D_80382430.unkC = NULL; + D_80382430.rotation = 0.0f; + _gctranstion_changeState(0,0); +} + +void gctransition_update(void){ + f32 sp24; + f32 tmp; + + + sp24 = time_getDelta(); + if(D_80382430.unk4 == NULL) + return; + + if(D_80382430.animctrl != NULL){ + animctrl_update(D_80382430.animctrl); + if(D_80382430.unk8 == 4){ + switch(D_80382430.unk1C){ + case 0: + break; + case 1: + func_8028F7C8(1); + func_80335110(0); + break; + case 2: + func_80335128(0); + break; + case 3: + func_802FEF48(D_80382430.unkC); //framebuffer to model texture list + break; + case 4: + osViBlack(0); + break; + default: + D_80382430.timer += sp24; + break; + } + } + else{//L8030BFEC + switch(D_80382430.unk1C){ + default: + D_80382430.timer += sp24; + break; + case 0: + case 1: + break; + case 2: + func_80335128(0); + func_802FEF48(D_80382430.unkC); //framebuffer to model texture list + break; + + } + + } + } + else{//L8030C034 + D_80382430.timer += sp24; + } + if(D_80382430.unk4->unk4 < D_80382430.timer + || (D_80382430.animctrl!= NULL && animctrl_isStopped(D_80382430.animctrl)) + ){ + D_80382430.timer = D_80382430.unk4->unk4; + if(D_80382430.unk8 == 4 || D_80382430.unk8 == 5){ + D_80382430.rotation -= 90.0f; + if (D_80382430.rotation < -360.0f) + D_80382430.rotation += 360.0f; + if (360.0f < D_80382430.rotation) + D_80382430.rotation -= 360.0f; + }//L8030C104 + _gctranstion_changeState(D_80382430.unk4->unk2, 0); + if(D_80382430.unk8 == 4) + func_8030C180(); + + if(D_80382430.animctrl != NULL) + func_80334ECC(); + } + D_80382430.unk1C++; +} diff --git a/src/core2/gc/zoombox.c b/src/core2/gc/zoombox.c new file mode 100644 index 00000000..a548bf17 --- /dev/null +++ b/src/core2/gc/zoombox.c @@ -0,0 +1,1451 @@ +#include +#include "functions.h" +#include "variables.h" +#include "gc/gczoombox.h" + +extern f32 func_8024DE1C(f32, f32, f32[3], f32[3]); +void func_80252330(f32, f32, f32); +extern f32 func_8033DDB8(void); +extern void func_8024E60C(s32, void *); +extern void func_8024E640(s32, void *); +extern void func_8024E5A8(s32, void *); + +extern struct17s D_8036C6C0[]; +extern s32 D_8036D924[]; + + +extern char D_80378880[]; +extern f64 D_80378890; +extern f64 D_80378898; +extern f64 D_803788A0; +extern f32 D_803788A8; +extern f32 D_803788AC; +extern f32 D_803788B0; +extern f64 D_803788B8; +extern f64 D_803788C0; +extern f64 D_803788E0; +extern f64 D_803788F0; +extern f32 D_80378938; +extern f32 D_8037893C; +extern f32 D_80378940; +extern u8 D_803830B0[]; + +void func_8030DA44(u8); +void func_80338338(s32, s32, s32); +void func_803382FC(u8); + + + +s32 func_80316ED4(u8*); +void func_8031843C(gczoombox_t *this); +void func_80318478(gczoombox_t *this); +void func_80318488(gczoombox_t *this); +void func_80318498(gczoombox_t *this); +void gczoombox_resolve_minimize(gczoombox_t *this); +void func_803184C8(gczoombox_t *, f32, s32, s32, f32, bool, bool); +void func_80318760(gczoombox_t *this, s32 arg1); + + +/* .code */ +void func_80315200(gczoombox_t *this){ + s32 s1 = 0; + if(-1.0f == this->unk110[0]){ + if(func_8025AD7C(this->unk108[0])){ + func_8025A7DC(this->unk108[0]); + } + }else{ + for(s1 =0; s1 < 5; s1++){ + if(this->unk108[s1]){ + func_8030DA44(this->unk108[s1]); + this->unk13B--; + } + } + } + for(s1 = 0; s1 < 5; s1 ++){ + this->unk108[s1] = 0; + } +} + +void func_803152C4(gczoombox_t *this){ + if(this->unk100 != NULL){ + func_8033BD20(&this->unk100); + this->unk100 = NULL; + } +} + +void func_80315300(gczoombox_t *this){ + if(this->unkF0 != NULL){ + func_8033BD20(&this->unkF0); + this->unkF0 = NULL; + } + if(this->unkF4 != NULL){ + animctrl_free(this->unkF4); + this->unkF4 = NULL; + } + if(this->unkF8 != NULL){ + func_8033BD20(&this->unkF8); + this->unkF8 = NULL; + } + func_803152C4(this); +} + +void gczoombox_free(gczoombox_t *this){ + if(this){ + func_80315200(this); + func_80315300(this); + free(this); + } +} + +void func_803153A8(u8 * arg0, u8 * arg1, s32 arg2, s32 arg3){ + int i; + for(i = arg2; i < arg3; i++){ + arg1[i - arg2] = arg0[i]; + } +} + +void _gczoombox_memClear(u8 *arg0, s32 size){ + s32 i; + + for(i = 0; i< size; i++){ + arg0[i] = 0; + } +} + +void func_80315484(gczoombox_t *this){ + if( this->unk1A4_31 && !this->unk1A4_26){ + this->unk16C = 0.5 * ((this->unk1A4_19) ? 0xf : 0xc) * this->unk198 + this->unk166; + } + else{//L803154F4 + this->unk16C = this->unk166; + this->unk16E = this->unk16C + ((this->unk1A4_19) ? 0xf : 0xc); + } +} + +void func_80315524(gczoombox_t *this){ + if(this->unk1A4_26 || this->unk1A4_31){ + this->unk135 = 3; + this->unk181 = this->unk182; + } + else{ + this->unk135 = 4; + } + this->unk15E = this->unk15C; + this->unk1A4_23 = 0; +} + +void func_8031556C(gczoombox_t *this){ + this->unk135 = 5; + animctrl_setPlaybackType(this->unkF4, ANIMCTRL_ONCE); + animctrl_setDirection(this->unkF4, 1); + this->unk134 = 0; + this->unk1A4_16 = 1; + func_80318498(this); +} + +void func_803155C8(gczoombox_t *this){ + int i; + + this->unk135 = 6; + animctrl_setPlaybackType(this->unkF4, ANIMCTRL_ONCE); + animctrl_setDirection(this->unkF4, 0); + this->unk1A4_16 = 1; + this->unk1A4_23 = 0; + _gczoombox_memClear(this->unk0, 0x30); + _gczoombox_memClear(this->unk30, 0x30); + this->unk1A4_30 = 0; + this->unk1A4_29 = 0; + this->unk1A4_27 = 0; + this->unk1A4_26 = 0; + this->unk1A4_31 = 0; + if(-1.0f == this->unk110[0]){ + if(func_8025AD7C(this->unk108[0])){ + func_8025A7DC(this->unk108[0]); + } + }else{ + if(this->unk13B){ + for(i = 0; i < 5; i++){ + if(func_8030E3FC(this->unk108[i])){ + func_8030E394(this->unk108[i]); + } + } + } + }//L803156CC + this->unk134 = 0; + gczoombox_resolve_minimize(this); +} + +int func_803156F0(u8 arg0, u8 arg1){ + if(arg1 == 0){ + return arg0 == '.' || arg0 == '!' || arg0 == ',' || arg0 == '-' || arg0 == '?'; + } + else{//L80315754 + return arg0 == '\1' || arg0 == '4' || arg0 == '@' || arg0 == 'B'; + } +} + +int func_80315794(u8 *arg0, s32 len){ + int i; + s32 phi_v1 = 0; + s32 phi_v0 = 0; + for(i = 0; i < len; i++){ + if(arg0[i] == 0xFD){ + phi_v0 = 1; + }else if(phi_v0 == 0){ + phi_v1++; + } + else{ + phi_v0 = 0; + } + } + return phi_v1; +} + +//_gczoombox_findLineBreak +s32 func_803158AC(u8 *arg0, s32 arg1){ + s32 i; + for(i = func_80316ED4(arg0); (arg1 < (func_80315794(arg0, i)) || (' ' != arg0[i] )); i--); + return i; +} + +void func_8031594C(gczoombox_t * this, u8 *str, s32 arg2, s32 arg3){ + s32 s0; + gczoombox_t *s4; + s32 s5; + s32 s3; + s32 s2; + s32 s1; + f32 f22; + + s0 = arg2; + s4 = this; + s1 = 0; + f22 = (this->portrait_id == 0x5F) ? 0.4 : 0.8; + + if(getGameMode() == GAME_MODE_9_BANJO_AND_KAZOOIE){ + func_8034A900(); + } + for(s2 = arg2; s2 <= arg3; s2++){ + if(s1){ + if(randf() < 0.5){ + if(randf() < f22){ + this->unk90[s1] = 1; + } + else{//L80315A40 + this->unk90[s1] = 0; + } + s1++; + }//L80315A54 + } + else{//L80315A48 + this->unk90[s1] = 1; + s1++; + } + }//L80315A5C + this->unk90[s1++] = 0; + this->unk185 = s1; + s1 = 0; + for(s5 = 0; s5 < this->unk185; s5++){ + if(this->unk90[s5] == 1){ + if(this->unk90[s5 + 1] == 1){ + if(this->unk90[s5 + 2] == 1){ + if(randf() < 0.3){ + this->unkB0[s1] = 1; + } + else{ + this->unkB0[s1] = 2; + } + } + else{//L80315AF4 + if(randf() < 0.5){ + this->unkB0[s1] = 2; + } + else{//L80315B1C + this->unkB0[s1] = (this->unk188 - 4)/2; + } + } + } + else{//L80315B3C + this->unkB0[s1] = this->unk188 - 6; + } + s1++; + } + this->unkB0[s1] = 0; + s1++; + }//L80315B6C + this->unk189 = s1; + this->unk187 = 0; + if(getGameMode() == GAME_MODE_9_BANJO_AND_KAZOOIE){ + func_8034A964(); + } +} + +u8 func_80315BC0(gczoombox_t *this, enum sfx_e uid, s32 arg2){ + u8 sp1F = func_8030ED2C(uid, arg2) & 0xff; + func_8030DD90(sp1F, 0); + if(this->portrait_id == 0x66){ + func_8030DCCC(sp1F, 0x40); + } + return sp1F; +} + +void func_80315C1C(gczoombox_t *this){ + int i; + func_80315200(this); + func_80315300(this); + for(i = 0 ; i < 8; i++){ + this->unk13C[i] = NULL; + } + this->unk135 = 0; + this->unk137 = this->unk1A4_20 = 0; +} + +void func_80315C90(gczoombox_t *this, s32 arg1) { + s32 phi_s1; + s32 phi_s4; + f32 phi_f12; + f32 phi_f2; + f32 phi_f18; + f32 phi_f14; + s32 phi_s1_3; + s32 phi_s2; + s32 phi_a0; + s32 phi_a1; + + phi_s4 = 0U; + if (this != NULL && this->unk13B != 0 && this->unk1A4_11) { + if (this->portrait_id == 0x15) { + for(phi_s1 = 0; phi_s1 < 5; phi_s1++){ + if(func_8030E3FC(this->unk108[phi_s1])) + return; + } + } + + if (this->unk110[0] == -1.0f) { + if (func_8025AD7C(this->unk108[0]) == 0) { + func_8025A70C(this->unk108[0]); + } + } else { + + for(phi_s1 = 0; phi_s1 < 5; phi_s1++){ + if (func_8030E3FC(this->unk108[phi_s1])) { + func_8030E394(this->unk108[phi_s1]); + } + } + if (this->unk13B != 1) { + do { + phi_s4 = randi2(0, this->unk13B); + } while (phi_s4 == this->unk18B || this->unk124[phi_s4] == 0); + } + this->unk18B = phi_s4; + + if (arg1 != 0) { + phi_s1_3 = 15000; + phi_s2 = 11000; + phi_f2 = -0.1f; + phi_f18 = -0.4f; + } else { + phi_s1_3 = 6000; + phi_s2 = 0; + phi_f2 = 0.2f; + phi_f18 = 0.0f; + } + phi_f14 = this->unk110[phi_s4]; + if (phi_f14 < -1.0f) { + do { + phi_f12 = (f32) randi2(-12, 0); + } while (phi_f12 == -11.0 || phi_f12 == -9.0 || phi_f12 == -7.0 || phi_f12 == -6.0 || phi_f12 == -4.0 || phi_f12 == -2.0 || phi_f12 == -1.0); + + phi_f14 = this->unk110[phi_s4]; + if ( -2.0f > phi_f14) { + phi_f12 -= (phi_f14 - -2.0f); + } + func_8030DBB4(this->unk108[phi_s4], alCents2Ratio(phi_f12 *100.0f)); + } else { + phi_f12 = (phi_f14 - phi_f2 < 0.1) ? 0.1 : phi_f14 - phi_f2; + phi_f12 = (phi_f12 >= 2.0)? 1.99 : phi_f12; + + phi_f14 = (phi_f14 - phi_f18 < 2.0) ? phi_f14 - phi_f18 : 2.0; + phi_f14 = (0.1 < phi_f14) ? phi_f14 : 0.1; + + func_8030DBB4(this->unk108[phi_s4], randf2(phi_f12, phi_f14)); + } + + phi_a0 = (this->unk124[phi_s4] - phi_s1_3 < 0)? 0 : this->unk124[phi_s4] - phi_s1_3; + phi_a1 = (this->unk124[phi_s4] - phi_s2 < 0) ? 0 : this->unk124[phi_s4] - phi_s2; + sfxsource_setSampleRate(this->unk108[phi_s4], randi2(phi_a0, phi_a1)); + func_8030E2C4(this->unk108[phi_s4]); + } + } +} + +void func_803160A8(gczoombox_t *this) { + f32 temp_f14; + f32 phi_f14; + s32 phi_a0; + s32 sp50; + s32 phi_a1; + s32 sound_index; + f32 tmp_f16; + f32 sp40; + f32 sp3C; + + phi_a0 = 0; + phi_a1 = 0; + tmp_f16 = 0; + if (D_8036C6C0[this->portrait_id].soundInfo[0].unk4 != -1.0f) { + do { + sound_index = randi2(0, 5); + sp50 = D_8036C6C0[this->portrait_id].soundInfo[sound_index].unk2; + } while ( sp50 == 0); + temp_f14 = D_8036C6C0[this->portrait_id].soundInfo[sound_index].unk4; + sp40 = (temp_f14 - 0.2f < 0.1) ? 0.1 : temp_f14 - 0.2f; + sp40 = (sp40 >= 2.0) ? 1.99 : sp40; + + sp3C = temp_f14 - tmp_f16; + sp3C = (sp3C < 2.0) ? sp3C : 2.0; + sp3C = (0.1 < sp3C) ? sp3C : 0.1; + if (func_8030ED70(D_8036C6C0[this->portrait_id].soundInfo[sound_index].uid) == 0) { + func_8030E760(D_8036C6C0[this->portrait_id].soundInfo[sound_index].uid, randf2(sp40, sp3C), randi2((sp50 - 6000 < 0) ? 0 : sp50 - 6000, (sp50 - phi_a1 < 0) ? 0: sp50 - phi_a1)); + } + } +} + +void func_803162B4(gczoombox_t *this){ + func_802F7B90(this->unk168, this->unk168, this->unk168); + if(this->unk1A4_30){ + if(this->unk1A4_17){ + func_802F79D0(this->unk16A, this->unk16C, this->unk0, this->unk166, -1); + } + else if(this->unk1A4_15){ + print_bold_spaced(this->unk16A, this->unk16C, this->unk0); + }else{ + print_dialog(this->unk16A, this->unk16C, this->unk0); + } + } + if(this->unk1A4_29){ + if(this->unk1A4_15){ + print_bold_spaced(this->unk16A, this->unk16E, this->unk30); + }else{ + print_dialog(this->unk16A, this->unk16E, this->unk30); + } + } + func_802F7B90(0xff, 0xff, 0xff); +} + +void func_803163A8(gczoombox_t *this, Gfx **gfx, Mtx **mtx) { + f32 sp5C[3]; + f32 sp50[3]; + f32 sp44[3]; + f32 sp38[3]; + f32 sp34; + + sp34 = func_8024DE1C(this->unk170, this->unk172, sp50, sp5C); + if (this->unk1A4_24) { + sp5C[1] += 180.0f; + sp5C[0] -= 2*sp5C[0]; + } + sp38[0] = 0.0f; sp38[1] = 0.0f; sp38[2] = 0.0f; + sp44[0] = 0.0f; sp44[1] = 0.0f; sp44[2] = 0.0f; + func_8033A308(sp44); + set_model_render_mode(0); + if (this->unkF4 != NULL) { + func_8028781C(this->unkF4, sp50, 1); + } + func_803391A4(gfx, mtx, sp50, sp5C, this->unk198 * sp34, &sp38, this->unkF0); +} + +void func_803164B0(gczoombox_t *this, Gfx **gfx, Mtx **mtx, s32 arg3, s32 arg4, s32 arg5, f32 arg6) { + f32 sp2C[3]; + f32 temp_f12; + + if (this->portrait_id == 0x46) { + arg6 = 0.75f; + } + func_80338338(0xFF, 0xFF, 0xFF); + func_803382FC(this->unk168 * arg6); + func_803382E4(5); + func_80335D30(gfx); + func_8024C7B8(gfx, mtx); + mlMtxIdent(); + if (this->unk1A4_24) { + mlMtxRotYaw(180.0f); + sp2C[0] = (f32) this->unk170 - ((f32) arg3 * this->unk198); + } else { + sp2C[0] = (f32) this->unk170 + ((f32) arg3 * this->unk198); + } + sp2C[1] = this->unk172 + ((f32) arg4 * this->unk198); + sp2C[2] = -10.0f; + func_80252330((sp2C[0] * 4.0f) - ((f32)D_80276588 * 2), ((f32)D_8027658C * 2) - (sp2C[1] * 4.0f), sp2C[2]); + temp_f12 = (f32) ((f64) this->unk198 * 0.8); + mlMtxScale_xyz(temp_f12, temp_f12, 1.0f); + mlMtxApply(*mtx); + gSPMatrix((*gfx)++, (*mtx)++, G_MTX_LOAD | G_MTX_MODELVIEW); + set_model_render_mode(0); + func_80344090(arg5, this->unk186, gfx); + func_8033687C(gfx); + func_8024C904(gfx, mtx); +} + +void func_80316764(gczoombox_t *this, s32 arg1) { + s32 sp38[6]; + f32 phi_f0; + s32 sp2C[2]; + f32 pad0; + + if (!this->unk1A4_10 ) { + func_8024E55C(0, sp38); + func_8024E60C(0, sp2C); + phi_f0 = time_getDelta(); + } else { + func_8024E5A8(0, sp38); + func_8024E640(0, sp2C); + phi_f0 = func_8033DDB8(); + } + + if (this->unkFC == NULL) + return; + + if (this->unk139 == 1) { + this->unk19C += phi_f0; + while (this->unk1A0 < this->unk19C) { + this->unk186 += 1; + if (this->unk186 >= (s32) this->unk188) { + this->unk186 = 0; + } + this->unk19C -= this->unk1A0; + }; + return; + } + + if (arg1 && this->unk1A4_12 && sp38[BUTTON_START]) { + if (this->unk110[0] == -1.0f) { + func_80315C90(this, 1); + } else { + this->unk186++; + this->unk186 = this->unk186 % 4; + if (this->unk186 == 0) { + func_80315C90(this, 1); + } + } + } + else if (this->unk1A4_22 != 0) { + if (this->unk1A4_21) { + this->unk186--; + if ((this->unk188 - 4) >= this->unk186) { + this->unk1A4_21 = FALSE; + this->unk1A4_22 = FALSE; + this->unk186 = 0; + } + } else { + this->unk186++; + if (this->unk186 >= this->unk188) { + this->unk1A4_21 = TRUE; + this->unk186--; + } + } + } + else if (arg1) { + if (!this->unk1A4_12 || (sp2C[0] == 0) || !(func_8023DB5C() & 1)){ + if (this->unk110[0] == -1.0f) { + func_80315C90(this, 1); + } + else if (this->unk13B != 0) { + if ((this->unk186 == 0) && (this->unk186 < this->unkB0[this->unk187])) { + func_80315C90(this, 0); + } + } + this->unk1A4_22 = FALSE; + this->unk1A4_21 = FALSE; + if (this->unk186 == this->unkB0[this->unk187]) { + this->unk187++; + if (this->unk187 >= this->unk189) { + this->unk187 = 0; + this->unk1A4_23 = FALSE; + if (randf() < 0.4) { + this->unk1A4_22 = TRUE; + this->unk186 = this->unk188 - 4; + } + } + } else if (this->unk186 < this->unkB0[this->unk187]) { + this->unk186++; + } else { + this->unk186--; + } + } + else{return;} + } else if (this->unk1A4_22 == 0) { + if (this->unk186 > 0) { + this->unk186--; + } else { + // if (randf() < 0.01) { /* USE ONCE .RODATA DEFINED */ + if (randf() < D_803788F0) { + this->unk1A4_22 = TRUE; + this->unk186 = this->unk188 - 4; + } + } + } + if (this->unk186 < 0) { + this->unk186 = 0; + } + if (this->unk186 >= this->unk188) { + this->unk186 = this->unk188 - 1; + } +} + + +void gczoombox_draw(gczoombox_t *this, Gfx **gdl, Mtx ** mptr, void *vptr){ + if(!this) + return; + + if(getGameMode() == GAME_MODE_9_BANJO_AND_KAZOOIE) + func_8034A900(); + //L80316BCC + if(this->unk1A4_28 && this->unk135 && this->unkF0){ + func_803162B4(this); + func_803163A8(this, gdl, mptr); + if( this->unk139 == 2 + || ( getGameMode() != GAME_MODE_3_NORMAL + && getGameMode() != GAME_MODE_8_BOTTLES_BONUS + && getGameMode() != GAME_MODE_A_SNS_PICTURE + && !func_803203FC(0x1F)) + ){//L80316C64 + func_80316764(this, 0); + } + else{ //L80316C74 + func_80316764(this, this->unk1A4_23); + }//L80316C8C + + if(!this->unk1A4_13){ + func_803164B0(this, gdl, mptr, this->unk176, this->unk177, this->unkFC, 1.0f); + }else{ + func_803164B0(this, gdl, mptr, this->unk176, this->unk177, this->unkFC, 1.0 - this->unk17C); + func_803164B0(this, gdl, mptr, this->unk178, this->unk179, this->unk104, this->unk17C); + }//L80316D40 + + if( !this->unk1A4_18 && !(this->unk168 < 0x81) + ){ + this->unk168 -= 0xC; + this->unk168 = !(this->unk168 < 0x81) ? this->unk168 : 0x80; + } + + if(this->unk1A4_18 && this->unk168 < 0xff){ + this->unk168 += 0xC; + this->unk168 = MIN(this->unk168, 0xff); + } + }//L80316DD8 + if(getGameMode() == GAME_MODE_9_BANJO_AND_KAZOOIE){ + func_8034A964(); + } + + +} + +void func_80316E08(gczoombox_t *this) { + this->unk135 = 8; + func_80318478(this); + if (this->unk1A4_24) { + this->unk170 = this->unk174 + 0x8B; + } + else{ + this->unk170 = this->unk174 - 0x8B; + } +} + +void func_80316E60(gczoombox_t *this){ + this->unk135 = 9; + func_80318488(this); +} + +void func_80316E84(gczoombox_t *this, s32 arg1){ + if(this->unk134 != arg1){ + if(this->unk130 != NULL){ + this->unk130(this->portrait_id, arg1); + } + this->unk134 = arg1; + } +} + +s32 func_80316ED4(u8 *arg0){ + return strlen(arg0); +} + +#ifndef NONMATCHING //matches requires .rodata which requires gczoombox_new() matching +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/zoombox/func_80316EF4.s") +#else +void func_80316EF4(gczoombox_t *this){ + s32 sp58[6]; + s32 sp4C[3]; + s32 sp48; + f32 sp44; + f32 tmp_f0; + sp48 = func_8033DD90(); + if(this == NULL) + return; + + if( !this->unk1A4_10 ){ + func_8024E55C(0, sp58); + func_8024E60C(0, sp4C); + tmp_f0 = time_getDelta(); + } + else{ + func_8024E5A8(0, sp58); + func_8024E640(0, sp4C); + tmp_f0 = func_8033DDB8(); + } + + switch(this->unk135){ + case 0x1: //L80316F90 + if(this->unk15D){ + this->unk160 += this->unk15C + 1; + } + else{ + this->unk160 = this->unk13C[this->unk138]; + this->unk1A4_19 = func_8031B604(this->unk160); + this->unk166 = ((this->unk1A4_19) ? 0x11 : 0x14) * this->unk198 + this->unk164; + } + this->unk15C = func_80316ED4(this->unk160); + if(this->unk15C >= 0x18){ + this->unk15C = func_803158AC(this->unk160, 0x18); + this->unk15D = 1; + } + else{ + this->unk15D = 0; + } + func_803153A8(this->unk160, this->unk60, 0, this->unk15C); + this->unk60[this->unk15C] = 0; + if(!this->unk15D){ + this->unk138++; + } + + if(this->unk15D || this->unk138 < this->unk137){ + this->unk1A4_25 = 0; + this->unk1A4_31 = 0; + } + else{ + this->unk1A4_25 = 1; + this->unk1A4_31 = 1; + } + + if(this->unk1A4_27){ + this->unk1A4_26 = 1; + this->unk1A4_30 = 1; + this->unk1A4_29 = 0; + } + else{ + this->unk1A4_26 = 0; + } + + func_8031594C(this, this->unk60, 0, this->unk15C); + this->unk135 = 2; + this->unk180 = this->unk15E = 0; //wrong reg + this->unk18C = 0.0f; + if(this->unk1A4_19){ + this->unk15E += 2; + } + this->unk1A4_23 = 1; + func_80315484(this); + break; + case 0x2: //L80317190 + { + sp44 = this->unk190; + if(this->unk1A4_19){ + sp44 *= 1.5; + } + if(sp58[BUTTON_START] && this->unk1A4_12){ + sp44 *= 0.5; + } + else if(sp4C[0] && this->unk1A4_12){ + sp44 *= 2.0; + } + this->unk18C += tmp_f0; + while(sp44 < this->unk18C && this->unk15C >= this->unk15E){ + this->unk15E++; + if(func_803156F0(this->unk60[this->unk15E], this->unk1A4_19)){ + this->unk18C -= (sp58[BUTTON_START] && this->unk1A4_12) ? 0.05 : 0.1; + }//L803172B4 + this->unk18C -= sp44; + }//L803172EC + if(this->unk1A4_26){ + func_803153A8(this->unk60, this->unk30, 0, this->unk15E); + this->unk1A4_29 = 1; + } + else{//L80317320 + func_803153A8(this->unk60, this->unk0, 0, this->unk15E); + this->unk1A4_27 = 1; + this->unk1A4_30 = 1; + }//L8031733C + if(this->unk15C < this->unk15E){ + func_80315524(this); + } + } + break; + case 0x3: //L80317360 + if((sp58[BUTTON_START] && this->unk1A4_12) || this->unk181 < 0){ + this->unk135 = 4; + this->unk183 = 0.5*sp48*this->unk184; + + }else{//L80317468 + this->unk181--; + } + break; + case 0x4: //L80317470 + if(sp58[BUTTON_START] && this->unk1A4_12){ + this->unk183 = 0.5*sp48*(this->unk184 + 2); + this->unk1A4_23 = 0; + } + else if(this->unk1A4_12 && sp4C[0]){//L8031755C + this->unk183 = 0.5*sp48*(this->unk184 - 1); + }//L80317630 + this->unk1A4_17 = 0; + if(this->unk1A4_26 || this->unk1A4_31){//L80317650 + if(this->unk1A4_25){ + func_8031843C(this); + this->unk135 = 0xA; + } + if(!this->unk1A4_23 && !this->unk1A4_25){ + this->unk1A4_17 = 1; + this->unk16C -= this->unk183; + this->unk16E -= this->unk183; + + }//L803176C8 + if(this->unk1A4_25 == 0){ + if(this->unk166 - ((this->unk1A4_19)? 0xf : 0xc) >= this->unk16C){ + func_803153A8(this->unk30, this->unk0, 0, 0x30); + _gczoombox_memClear(this->unk30, 0x30); + this->unk16C = this->unk166; + this->unk16E = ((this->unk1A4_19) ? 0xf : 0xc) + this->unk16C; + this->unk1A4_30 = 1; + this->unk1A4_29 = 0; + this->unk135 = 1; + } + } + } + else{//L80317764 + if(!this->unk1A4_23) + this->unk135 = 1; + } + break; + case 0xa: //L8031777C + func_80316E84(this, 3); + if(this->unk13A & 0x8){ + this->unk1A4_27 = 0; + func_803155C8(this); + } + else if(this->unk13A & 4){//L803177B4 + this->unk1A4_25 = 0; + this->unk134 = 0; + this->unk135 = 4; + } + break; + case 0x5: //L803177D4 + if(this->unk1A4_16){ + animctrl_update(this->unkF4); + if(this->unk1A4_14){ + this->unk17C = 1.0 - animctrl_getAnimTimer(this->unkF4)/this->unk194; + } + }//L8031782C + if(this->unk1A4_11 && animctrl_isAt(this->unkF4, 0.1f)){ + func_8030E760(SFX_CC_PAUSEMENU_ENTER_SUBMENU, 1.1f, this->unk12E); + }//L80317864 + if(this->unk1A4_16 && animctrl_isAt(this->unkF4, this->unk194)){ + animctrl_setPlaybackType(this->unkF4, ANIMCTRL_STOPPED); + animctrl_setAnimTimer(this->unkF4, this->unk194); + animctrl_update(this->unkF4); + if(this->unk1A4_14) + func_803152C4(this); + this->unk1A4_14 = this->unk1A4_13 = 0; + this->unk1A4_16 = 0; + }//L803178F4 + if(!this->unk1A4_16){ + func_80316E84(this, 2); + if(this->unk13A & 4){ + this->unk135 = 1; + } + else if(this->unk13A & 8){ + func_803155C8(this); + } + } + break; + case 0x6: //L80317940 + if(this->unk1A4_16){ + animctrl_update(this->unkF4); + if(this->unk1A4_14){ + this->unk17C = animctrl_getAnimTimer(this->unkF4)/this->unk194; + } + } + if(this->unk1A4_11 && animctrl_isAt(this->unkF4, 0.9f)){ + func_8030E6A4(SFX_CD_PAUSEMENU_LEAVE_SUBMENU, 1.1f, this->unk12E); + } + if(this->unk1A4_16 && animctrl_isStopped(this->unkF4)){ + if(this->unk1A4_14){ + func_803152C4(this); + } + this->unk1A4_14 = this->unk1A4_13 = 0; + this->unk1A4_16 = 0; + } + if(!this->unk1A4_16){ + func_80316E84(this, 4); + if(this->unk13A & 0x10){ + func_80316E60(this); + } + else if(this->unk13A & 0x2){ + func_8031556C(this); + } + } + break; + case 0x7: //L80317A78 + func_80315C1C(this); + func_80316E84(this, 6); + break; + case 0x8: //L80317A94 + if(this->unk18A == 0){ + this->unk1A4_28 = 1; + } + if(this->unk1A4_11 && this->unk18A == 1){ + func_8030E760(SFX_CF_PAUSEMENU_SHWOOP, 1.0f, this->unk12E); + } + if(this->unk1A4_24){ + this->unk170 -= D_8036D924[this->unk18A]; + } + else{ + this->unk170 += D_8036D924[this->unk18A]; + } + if(this->unk18A == 6){ + this->unk170 = this->unk174; + func_80316E84(this, 1); + if(this->unk13A & 2){ + func_8031556C(this); + } + else if(this->unk13A & 0x10){ + func_80316E60(this); + } + } + else{ + this->unk18A++; + } + break; + case 0x9: //L80317B8C + if(this->unk1A4_11 && this->unk18A == 6){ + func_8030E760(SFX_CE_PAUSEMENU_HOIP, 1.0f, this->unk12E); + } + if(this->unk1A4_24){ + this->unk170 += D_8036D924[this->unk18A]; + } + else{ + this->unk170 -= D_8036D924[this->unk18A]; + } + if(this->unk18A == 0){ + this->unk1A4_28 = 0; + func_80316E84(this, 5); + if(this->unk13A & 0x20){ + this->unk135 = 7; + } + else if(this->unk13A & 0x1) { + func_80316E08(this); + } + } + else{//L80317C5C + this->unk18A--; + } + break; + case 0xb: //L80317C64 + if(this->unk13A & 1){ + func_80316E08(this); + } + break; + } +} +#endif + +//_gczoombox_loadSprite +void func_80317C90(gczoombox_t *this, s32 portrait_id){ + this->unkF8 = func_8033B6C4(D_8036C6C0[portrait_id].uid, &this->unkFC); + this->unk188 = this->unkF8->frameCnt; + func_803382E4(-1); + + func_80338308(func_802510A0(this->unkF8), func_802510A8(this->unkF8)); +} + +//_gczoombox_loadsfx +void func_80317D10(gczoombox_t *this, s32 portrait_id){ + s32 i; + + this->unk13B = 0; + for(i = 0; i < 5; i++){ + this->unk108[i] = 0; + this->unk124[i] = 0; + this->unk110[i] = 0.0f; + } + if(this->unk139 != 2 && this->unk139 != 1){ + if(D_8036C6C0[portrait_id].soundInfo[0].unk4 == -1.0f){ + this->unk108[0] = D_8036C6C0[portrait_id].soundInfo[0].uid; + this->unk110[0] = -1.0f; + + } + else{ + for(i = 0; i < 5; i++){//L80317DFC + if(D_8036C6C0[portrait_id].soundInfo[i].unk2){ + this->unk108[i] = func_80315BC0(this, D_8036C6C0[portrait_id].soundInfo[i].uid, 3); + this->unk124[i] = D_8036C6C0[portrait_id].soundInfo[i].unk2; + this->unk110[i] = D_8036C6C0[portrait_id].soundInfo[i].unk4; + this->unk13B++; + } + //L80317E48 + } + this->unk18B = randi2(0,this->unk13B); + } + } +} + +#ifdef NONMATCHING +gczoombox_t *gczoombox_new(s32 arg0, s32 portrait_id, s32 arg2, s32 arg3, void (*arg4)(s32, s32)){ + gczoombox_t *this; + s32 i; + s32 temp_v1_2; + + this = (gczoombox_t *)malloc(sizeof(gczoombox_t)); + this->unk130 = arg4; + this->unk135 = 0xB; + this->portrait_id = portrait_id; + this->unk134 = this->unk137 = this->unk138 = 0; + this->unk139 = arg2; + this->unk13A = 0x20; + for(i = 0; i < 8; i++){ + this->unk13C[i] = NULL; + } + this->unk15E = 0; + this->unk15D = 0; + this->unk1A4_19 = 0; + this->unk15C = 0; + this->unk160 = 0; + this->unk166 = this->unk1A4_19; + this->unk164 = arg0; + this->unk168 = 0xFF; + this->unk1A4_24 = arg3; + if(this->unk1A4_24){ + this->unk16A = 0x2D; + this->unk174 = D_80276588 - 0x25; + this->unk170 = D_80276588 + 0x66; + }else{ + this->unk16A = 0x47; + this->unk174 = 0x25; + this->unk170 = -0x66; + } + this->unk18A = 0; + this->unk189 = 0; + this->unk187 = 0; + this->unk186 = 0; + this->unk185 = 0; + this->unk181 = 0; + this->unk180 = 0; + this->unk172 = this->unk164; + this->unk18C = 0.0f; + this->unk194 = 0.999f; + // this->unk194 = D_80378938; + this->unk198 = 1.0f; + this->unk19C = 0.0f; + this->unk1A0 = 0.0333333f; + // this->unk1A0 = D_8037893C; + + // this->unk1A4_31 = \ + // this->unk1A4_30 = \ + // this->unk1A4_29 = \ + // this->unk1A4_28 = \ + // this->unk1A4_27 = \ + // this->unk1A4_26 = \ + // this->unk1A4_25 = \ + // this->unk1A4_23 = \ + // this->unk1A4_22 = \ + // this->unk1A4_21 = \ + // this->unk1A4_20 = \ + // this->unk1A4_17 = \ + // this->unk1A4_16 = \ + // this->unk1A4_15 = \ + // this->unk1A4_14 = \ + // this->unk1A4_13 = \ + // 0; + + // this->unk1A4_11 = this->unk1A4_18 = 1; + + + this->unk1A4_25 = \ + this->unk1A4_23 = \ + this->unk1A4_22 = \ + this->unk1A4_21 = \ + this->unk1A4_20 = \ + this->unk1A4_17 = \ + this->unk1A4_16 = \ + this->unk1A4_15 = \ + this->unk1A4_14 = \ + this->unk1A4_13 = FALSE; + + temp_v1_2 = this->unk1A4_13; + + + + this->unk1A4_31 = \ + this->unk1A4_30 = \ + this->unk1A4_29 = \ + this->unk1A4_28 = \ + this->unk1A4_27 = \ + this->unk1A4_26 = temp_v1_2; + + this->unk1A4_18 = TRUE; + this->unk1A4_11 = this->unk1A4_18; + + this->unkF0 = assetcache_get(0x89d); + func_80317C90(this, portrait_id); + this->unkF4 = animctrl_new(0); + animctrl_reset(this->unkF4); + animctrl_setIndex(this->unkF4, ASSET_138_ANIM_ZOOMBOX); + func_802875AC(this->unkF4, "gczoombox.c", 0x6fd); + + func_803184C8(this, 15.0f, 5, 2, 0.4f, 0, 0); //func_803184C8(this, 15.0f, 5, 2, D_80378940, 0, 0); + this->unk176 = D_8036C6C0[portrait_id].unk2; + this->unk177 = D_8036C6C0[portrait_id].unk3; + this->unk100 = 0; + this->unk104 = 0; + this->unk17C = 1.0f; + this->unk178 = this->unk179 = 0; + + func_80317D10(this, portrait_id); + func_80318760(this, 18000); + _gczoombox_memClear( this->unk0, 0x30); + _gczoombox_memClear( this->unk30, 0x30); + _gczoombox_memClear( &this->unk60, 0x30); + _gczoombox_memClear( &this->unk90, 0x20); + _gczoombox_memClear( &this->unkB0, 0x40); + return this; +} +#else +#pragma GLOBAL_ASM("asm/nonmatchings/core2/gc/zoombox/gczoombox_new.s") +#endif + +bool func_80318284(gczoombox_t *this, s32 arg1, u8 **arg2) { + s32 phi_v0; + + if ((this->unk13A & 4) || (arg2 == NULL) || (arg1 == 0)) { + return FALSE; + } + this->unk138 = 0; + this->unk137 = arg1; + for(phi_v0 = 0; phi_v0 < arg1; phi_v0++){ + this->unk13C[phi_v0] = arg2[phi_v0]; + } + + for(phi_v0 = arg1; phi_v0 < 8; phi_v0++){ + this->unk13C[phi_v0] = NULL; + } + + this->unk13A |= 4; + return 1; +} + +bool func_803183A4(gczoombox_t *this, u8 *arg1) { + u8 *sp1C; + + if ((this->unk13A & 4) || (arg1 == NULL)) { + return FALSE; + } + sp1C = arg1; + return func_80318284(this, 1, &sp1C); +} + + +void gczoombox_open(gczoombox_t *this){ + this->unk13A |= 0x1; +} + +void gczoombox_close(gczoombox_t *this){ + this->unk13A |= 0x10; +} + +void gczoombox_maximize(gczoombox_t *this){ + this->unk13A |= 0x2; +} + +void gczoombox_minimize(gczoombox_t *this){ + this->unk13A |= 0x8; +} + +void func_8031842C(gczoombox_t *this){ + this->unk13A |= 0x20; +} + +void func_8031843C(gczoombox_t *this){ + void *temp_v1; + void *phi_v1; + s32 phi_v0; + + for(phi_v0 = 0; phi_v0 < 8; phi_v0++){ + this->unk13C[phi_v0] = NULL; + }; + this->unk137 = 0; + this->unk13A &= 0xfb; +} + +void func_80318478(gczoombox_t *this){ + this->unk13A &= 0xfe; +} + +void func_80318488(gczoombox_t *this){ + this->unk13A &= 0xef; +} + +void func_80318498(gczoombox_t *this){ + this->unk13A &= 0xfd; +} + +void gczoombox_resolve_minimize(gczoombox_t *this){ + this->unk13A &= 0xf7; +} + +void func_803184B8(gczoombox_t *this){ + this->unk13A &= 0xdf; +} + +void func_803184C8(gczoombox_t *this, f32 arg1, s32 arg2, s32 arg3, f32 arg4, bool arg5, bool arg6) { + + if (this != NULL) { + this->unk182 = arg2; + this->unk184 = arg3; + this->unk190 = 1.0 / arg1; + if (this->unkF4 != NULL) { + animctrl_setDuration(this->unkF4, arg4); + } + this->unk1A4_12 = arg5 ? TRUE : FALSE; + this->unk1A4_10 = arg6 ? TRUE : FALSE; + } +} + +bool func_8031857C(gczoombox_t *this, u8 *str){ + if(func_803183A4(this, str)){ + gczoombox_open(this); + gczoombox_maximize(this); + gczoombox_minimize(this); + gczoombox_close(this); + return TRUE; + } + return FALSE; +} + +void gczoombox_highlight(gczoombox_t *this, bool arg1){ + if(arg1) + this->unk1A4_18 = 1; + else + this->unk1A4_18 = 0; +} + +//gczoombox_isHiglighted +bool func_80318604(gczoombox_t *this){ + return this->unk1A4_18; +} + +void func_80318614(gczoombox_t *this, int arg1){ + if(arg1) + this->unk1A4_11 = 1; + else + this->unk1A4_11 = 0; +} + +void func_80318640(gczoombox_t *this, s32 arg1, f32 arg2, f32 arg3, s32 arg4) { + s32 phi_v0; + + if (this != NULL) { + if (this->unk1A4_24) { + this->unk174 = D_80276588 - arg1; + this->unk16A = arg1 + (8.0f * arg2); + this->unk170 = (D_80276588 - arg1) + 0x8B; + } else { + this->unk174 = arg1; + phi_v0 = arg4 ? 0x28 : 0x22; + this->unk16A = phi_v0 * arg2 + arg1; + this->unk170 = arg1 - 0x8B; + } + this->unk198 = arg2; + this->unk194 = arg3; + this->unk1A4_15 = (arg4) ? TRUE : FALSE; + } +} + + +void func_80318734(gczoombox_t *this, f32 arg1){ + if(this) + this->unk1A0 = 1.0/arg1; +} + +void func_80318760(gczoombox_t *this, s32 arg1){ + if(this) + this->unk12E = arg1; +} + +void func_80318774(gczoombox_t *this){ + this->unk13A = 0; +} + +bool func_8031877C(gczoombox_t *this){ + if( this == NULL + || this->unk135 == 0 || this->unk135 == 0xb || this->unk135 == 0x9 || this->unk135 == 0x6 || this->unk135 == 0x7 + ){ + return FALSE; + } + _gczoombox_memClear(this->unk0, 0x30); + _gczoombox_memClear(this->unk30, 0x30); + + this->unk1A4_30 = this->unk1A4_29 =\ + this->unk1A4_27 = this->unk1A4_26 =\ + this->unk1A4_31 =\ + this->unk1A4_23 =\ + this->unk15D = 0; + + if( this->unk135 == 10 || this->unk135 == 0x1 || this->unk135 == 0x2 || this->unk135 == 0x3 || this->unk135 == 0x4 ){ + this->unk135 = 10; + this->unk134 = 3; + } + func_8031843C(this); + return TRUE; +} + +bool func_803188B4(gczoombox_t *this) { + + if ((this == NULL) || (this->unk135 == 0) || (this->unk135 == 7) || (this->unk135 == 9)) { + return FALSE; + } + if ((this->unk135 == 6) && (this->unk134 == 4)) { + return FALSE; + } + if (this->unk135 == 8) { + this->unk1A4_16 = FALSE; + this->unk135 = 6; + } else if (this->unk135 != 6) { + func_803155C8(this); + } + func_8031843C(this); + func_80318498(this); + return TRUE; +} + + +bool func_80318964(gczoombox_t *this) { + if (this == NULL || this->unk135 == 0 || this->unk135 == 7 || this->unk135 == 9) { + return FALSE; + } + gczoombox_close(this); + func_8031842C(this); + func_803155C8(this); + return TRUE; +} + +bool func_803189C4(gczoombox_t *this, s32 arg1){ + if( this == NULL + || arg1 == this->portrait_id + || ( this->unk135 != 6 + && this->unk135 != 0xa + && this->unk135 != 0xb + && this->unk135 != 0x9 + )){ + return FALSE; + } + + if(this->unk135 == 0xb || this->unk135 == 0x9){ + if(this->unkF8){ + assetcache_release(this->unkF8); + this->unkF8 = NULL; + } + func_803152C4(this); + func_80317C90(this, arg1); + this->unk176 = D_8036C6C0[arg1].unk2; + this->unk177 = D_8036C6C0[arg1].unk3; + func_80315200(this); + func_80317D10(this, arg1); + this->portrait_id = arg1; + } + else{//L80318AAC + if(this->unk100){ + assetcache_release(this->unk100); + this->unk100 = NULL; + } + if(this->unkF8){ + this->unk100 = this->unkF8; + } + if(this->unkFC){ + this->unk104 = this->unkFC; + } + this->unk178 = this->unk176; + this->unk179 = this->unk177; + func_80317C90(this, arg1); + this->unk176 = D_8036C6C0[arg1].unk2; + this->unk177 = D_8036C6C0[arg1].unk3; + func_80315200(this); + func_80317D10(this, arg1); + this->unk1A4_14 = 1; + this->portrait_id = arg1; + this->unk1A4_13 = 1; + this->unk17C = 1.0f; + }//L80318B64 + return TRUE; +} + +void func_80318B7C(gczoombox_t *this, s32 arg1) { + s32 phi_v0; + + if (this != NULL) { + this->unk164 = arg1; + this->unk172 = arg1; + phi_v0 = (this->unk1A4_19) ? 0x11 : 0x14; + this->unk166 = phi_v0 * this->unk198 + this->unk164; + func_80315484(this); + } +} + +bool func_80318BEC(gczoombox_t *this){ + return this != NULL && !this->unk135; +} + +void func_80318C0C(gczoombox_t *this) { + AnimCtrl *temp_a0; + + if (this != NULL) { + if (this->unkF4 != NULL) { + this->unkF4 = animctrl_defrag(this->unkF4); + } + } +} + +void func_80318C48(gczoombox_t *this, s32 arg1) { + if (this != NULL) { + if (this->unk1A4_30) { + if (arg1 != 0) { + if (this->unk0[0] == 0xFD) { + this->unk0[1] = 0x68; + } else { + func_803153A8(&this->unk0[0], &D_803830B0, 0, 0x30); + this->unk0[0] = 0xFD; + this->unk0[1] = 0x68; + func_803153A8(&D_803830B0, &this->unk0[2], 0, 0x2E); + } + } + else if (this->unk0[0] == 0xFD) { + this->unk0[1] = 0x6C; + } + } + if (this->unk1A4_29) { + if (arg1 != 0) { + if (this->unk30[0] == 0xFD) { + this->unk30[1] = 0x68; + return; + } + else{ + func_803153A8(&this->unk30[0], &D_803830B0, 0, 0x30); + this->unk30[0] = 0xFD; + this->unk30[1] = 0x68; + func_803153A8(&D_803830B0, &this->unk30[2], 0, 0x2E); + } + } + else if (this->unk30[0] == 0xFD) { + this->unk30[1] = 0x6C; + } + } + } +} diff --git a/src/core2/jiggyscore.c b/src/core2/jiggyscore.c new file mode 100644 index 00000000..2b36e74a --- /dev/null +++ b/src/core2/jiggyscore.c @@ -0,0 +1,108 @@ +#include +#include "functions.h" +#include "variables.h" + +u32 jiggyscore_isCollected(enum jiggy_e); +void jiggyscore_debug(void); +void jiggyscore_clearAll(void); +void jiggyscore_setSpawned(s32, s32); + +extern struct { + u8 D_803832C0[0xD]; + u8 D_803832CD[0xD]; +}jiggyscore; + +void jiggyscore_clearAll_debug(void){ //jiggyscore_clearAll + jiggyscore_debug(); + jiggyscore_clearAll(); +} + +void *jiggyscore_clearAllSpawned(void) { + s32 i; + for(i = 0; i < 0x0D; i++){ + jiggyscore.D_803832CD[i] = 0; + } +} + +u8* jiggyscore_getPtr(void){ + return jiggyscore.D_803832C0; +} + +int jiggyscore_isSpawned(enum jiggy_e jiggy_id) { + return ((jiggyscore.D_803832CD[(jiggy_id - 1) / 8] & (1 << (jiggy_id & 7))) != 0) + || (jiggyscore_isCollected(jiggy_id) != 0); +} + +u32 jiggyscore_isCollected(enum jiggy_e jiggy_id){ + if( jiggy_id <= 0 || jiggy_id >= 0x65) + return 0; + return (jiggyscore.D_803832C0[(jiggy_id - 1) / 8] & (1 << (jiggy_id & 7))) != 0; +} + +void jiggyscore_debug(void){} + +void jiggyscore_clearAll(void){ + s32 i; + for(i = 0; i < 0x0D; i++){ + jiggyscore.D_803832C0[i] = 0; + } + jiggyscore_clearAllSpawned(); +} + +void jiggyscore_setCollected(s32 indx, s32 val){ + if( 0 < indx && indx < 0x65){ + if(val) + jiggyscore.D_803832C0[(indx - 1) / 8] |= (1 << (indx & 7)); + else + jiggyscore.D_803832C0[(indx - 1) / 8] &= ~(1 << (indx & 7)); + } +} + +void jiggyscore_setSpawned(s32 indx, s32 val) { + u8 *temp_v0; + u8 *temp_v0_2; + + if (val) { + temp_v0 = (u8*)(((s32) (indx - 1) / 8) + 0xD); + temp_v0 += (s32) jiggyscore.D_803832C0; + *temp_v0 |= (1 << (indx & 7)); + return; + } + temp_v0_2 = (u8*)(((s32) (indx - 1) / 8) + 0xD); + temp_v0_2 += (s32)jiggyscore.D_803832C0; + *temp_v0_2 &= ~(1 << (indx & 7)); +} + +s32 jiggyscore_leveltotal(s32 lvl) { + s32 i; + s32 start; + s32 end; + s32 cnt; + + if (lvl <= 0 || lvl == 0xB || lvl >= 0xB) + return 0; + + cnt = 0; + start = (lvl - 1)*10 + 1; + end = (lvl)*10 + 1; + for(i = start; i < end; i++ ){ + if(jiggyscore_isCollected(i)) + cnt++; + } + return cnt; +} + +s32 jiggyscore_total(void) { + s32 i; + s32 cnt; + + for(i = 0, cnt = 0; i < 0xC; i++){ + cnt += jiggyscore_leveltotal(i); + } + return cnt; +} + +void jiggyscore_info(s32 *size, u8 **addr){ + *size = 0x0D; + *addr = jiggyscore.D_803832C0; +} diff --git a/src/core2/levelspecificflags.c b/src/core2/levelspecificflags.c new file mode 100644 index 00000000..765a65c8 --- /dev/null +++ b/src/core2/levelspecificflags.c @@ -0,0 +1,65 @@ +#include +#include "functions.h" +#include "variables.h" + +void levelSpecificFlags_set(arg0, arg1); + + +//levelSpecificFlags +extern u8 D_80383328[]; +extern u32 D_80383320; +extern u32 D_80383324; + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/levelspecificflags/_levelSpecificFlags_calcCRC1.s") + +void _levelSpecificFlags_updateCRC1(void) { + s32 temp_a0; + + temp_a0 = (s32) &D_80383320 ^ ((((s32) &D_80383320 >> 8) & 0xFF0000) + (((s32) &D_80383320 & 0xFF) << 8)); + *(u32 *)((((u32) (temp_a0 & 0xFF000000) >> 8) + ((temp_a0 << 8) & 0xFF00)) ^ temp_a0) = _levelSpecificFlags_calcCRC1(); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/levelspecificflags/_levelSpecificFlags_calcCRC2.s") + +void _levelSpecificFlags_updateCRC2(void) { + *(u32 *)(((((s32) (((((s32) &D_80383324 >> 0x10) & 0xFFFF) ^ 0x195D) * 0x2F) / 0x2F) << 0x10) + ((s32) ((((s32) &D_80383324 & 0xFFFF) ^ 0xA832) << 0xD) / 0x2000)) ^ 0x195DA832) = _levelSpecificFlags_calcCRC2(); +} + +s32 levelSpecificFlags_get(s32 i){ + return func_803200A4(D_80383328, i); +} + +s32 levelSpecificFlags_getN(s32 i, s32 n){ + return func_803200E4(D_80383328, i, n); +} + +s32 levelSpecificFlags_getSet(s32 arg0, s32 arg1){ + s32 retVal = levelSpecificFlags_get(arg0); + levelSpecificFlags_set(arg0, arg1); + return retVal; +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/levelspecificflags/levelSpecificFlags_clear.s") + +void levelSpecificFlags_set(s32 index, s32 val){ + func_8032015C(&D_80383328, index, val); + _levelSpecificFlags_updateCRC1(); + _levelSpecificFlags_updateCRC2(); +} + +void levelSpecificFlags_setN(s32 index, s32 val, s32 n){ + func_803201C8(&D_80383328, index, val, n); + _levelSpecificFlags_updateCRC1(); + _levelSpecificFlags_updateCRC2(); +} + +s32 levelSpecificFlags_validateCRC1(void) { + s32 temp_a0; + + temp_a0 = (((s32) &D_80383320 & 0x55555555) * 2) + ((u32) ((s32) &D_80383320 & 0xAAAAAAAA) >> 1); + return _levelSpecificFlags_calcCRC1() == *(u32*)(((temp_a0 & 0x55555555) * 2) | ((u32) (temp_a0 & 0xAAAAAAAA) >> 1)); +} + +s32 levelSpecificFlags_validateCRC2(void){ + return _levelSpecificFlags_calcCRC2() == *(u32 *)((s32)&D_80383324 ^ 0x7EDDF5F4 ^ 0x7BEF9D80 ^ 0x5326874); +} \ No newline at end of file diff --git a/src/core2/mapspecificflags.c b/src/core2/mapspecificflags.c new file mode 100644 index 00000000..1bcd9383 --- /dev/null +++ b/src/core2/mapspecificflags.c @@ -0,0 +1,109 @@ +#include +#include "functions.h" +#include "variables.h" + +void mapSpecificFlags_set(s32 i, s32 val); + +/* .data */ +extern u32 D_80367000; + +/* .bss */ +extern u32 D_8037DDE0; +extern u32 D_8037DDE4; +extern u32 D_8037DDE8; + +/* .code */ +u32 _mapSpecificFlags_calcCRC1(void){ + return D_80367000 ^ 0x1195E97; +} + +void _mapSpecificFlags_updateCRCs(void){ + D_8037DDE4 = D_80367000 ^ 0xA84E38C8; + D_8037DDE0 = _mapSpecificFlags_calcCRC1(); + D_8037DDE8 = D_80367000 ^ 0x3973e4d9; +} + +void mapSpecificFlags_clearAll(void){ + D_80367000 = 0; + _mapSpecificFlags_updateCRCs(); +} + +s32 mapSpecificFlags_get(s32 i){ + return (D_80367000 & (1 << i))? 1 : 0; +} + +u32 mapSpecificFlags_getN(s32 idx, s32 n){ + s32 i; + u32 ret_val = 0; + for(i = 0; i < n; i++){ + ret_val |= mapSpecificFlags_get(idx + i) << i; + } + return ret_val; +} + +u32 mapSpecificFlags_getClear(s32 i){ + u32 ret_val = mapSpecificFlags_get(i); + mapSpecificFlags_set(i, 0); + return ret_val; +} + +void mapSpecificFlags_set(s32 i, s32 val){ + if(val) + D_80367000 |= 1 << i; + else + D_80367000 &= ~(1 << i); + _mapSpecificFlags_updateCRCs(); +} + +void mapSpecificFlags_setN(s32 idx, s32 val, s32 n){ + s32 i; + for(i = 0; i < n; i++){ + mapSpecificFlags_set(idx + i, (1 << i) & val); + } +} + +u32 mapSpecificFlags_getAll(void){ + return D_80367000; +} + +void mapSpecificFlags_setAll(u32 arg0){ + D_80367000 = arg0; + _mapSpecificFlags_updateCRCs(); +} + +s32 *func_802CAEBC(s32 arg0){ + s32 *phi_v0; + + phi_v0 = (s32*)malloc( (((arg0 + 0x1F)>>5) + 1)*sizeof(s32)); + *phi_v0 = arg0; + return phi_v0; +} + +void func_802CAEF4(s32 *arg0){ + free(arg0); +} + +void func_802CAF14(s32 *arg0, s32 arg1, bool arg2){ + if(arg2){ + arg0[(arg1 >> 5) + 1] |= 1 << (arg1 & (0x1F)); + } + else{ + arg0[(arg1 >> 5) + 1] -= arg0[(arg1 >> 5) + 1] & (1 << (arg1 & 0x1F)); + } +} + +bool func_802CAF70(s32 *arg0, s32 arg1){ + return (arg0[(arg1 >> 5) + 1] & (1 << (arg1 & 0x1F))) ? TRUE : FALSE; +} + +void func_802CAFA8(s32 *arg0, bool arg1) { + s32 i; + + for(i = 0; i < *arg0; i++){ + func_802CAF14(arg0, i, arg1); + } +} + +s32 mapSpecificFlags_validateCRC1(void){ + return _mapSpecificFlags_calcCRC1() == D_8037DDE0; +} diff --git a/src/core2/pitch.c b/src/core2/pitch.c new file mode 100644 index 00000000..07c5871b --- /dev/null +++ b/src/core2/pitch.c @@ -0,0 +1,70 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +f32 D_8037C540; //pitch degrees +f32 D_8037C544; //idealPitch degrees +f32 D_8037C548; //pitchAngularVelocityLimit +f32 D_8037C54C; //PitchAngularVelocity + +/* .code */ +static void __pitch_update(f32 limit, f32 angVel){ + f32 diff; + f32 val; + f32 tick = time_getDelta(); + f32 max; + + max = limit*tick; + diff = D_8037C544 - D_8037C540; + if(180.0f < mlAbsF(diff)){ + diff += (diff < 0.0f)? 360.0: -360.0; + } + + val = diff * angVel * tick; + val = (val < 0) ? mlClamp_f(val, -max, -0.1f) : mlClamp_f(val, 0.1f, max); + + D_8037C540 =( mlAbsF(val) <= mlAbsF(diff)) ? D_8037C540 + val : D_8037C544; + + if(D_8037C540 < 360.0){ + if(D_8037C540 < 0.0) + D_8037C540 += 360.0; + } + else + D_8037C540 -= 360.0; +} + +void pitch_reset(void){ + D_8037C540 = 0.0f; + D_8037C544 = 0.0f; + pitch_setAngVel(500.0f, 0.8f); +} + +void pitch_update(void){ + __pitch_update(D_8037C548, D_8037C54C); +} + +void pitch_setIdeal(f32 ideal_pitch_deg){ + D_8037C544 = mlNormalizeAngle(ideal_pitch_deg); +} + +void pitch_set(f32 pitch_deg){ + D_8037C540 = mlNormalizeAngle(pitch_deg); +} + +void pitch_applyIdeal(void){ + D_8037C540 = D_8037C544; +} + +f32 pitch_get(void){ + return D_8037C540; +} + +f32 pitch_getIdeal(void){ + return D_8037C544; +} + +void pitch_setAngVel(f32 limit, f32 angVel){ + D_8037C548 = limit; + D_8037C54C = angVel; +} diff --git a/src/core2/rand.c b/src/core2/rand.c new file mode 100644 index 00000000..8d701e6a --- /dev/null +++ b/src/core2/rand.c @@ -0,0 +1,132 @@ +#include +#include "functions.h" +#include "variables.h" + +/* .bss */ +extern s32 D_803860E0; +extern s32 D_803860E4; +extern s32 D_803860E8; +extern s32 D_803860EC; +extern s32 D_803860F0; +extern s32 D_803860F4; + +extern s32 D_803860F8; +extern s32 D_803860FC; +extern s32 D_80386100; +extern s32 D_80386104; +extern s32 D_80386108; +extern s32 D_8038610C; + +/* .code */ +f32 randf(void){ + f32 out; + if(D_803860E4 & 3){ + D_803860E4 = ((D_803860E8++) + (D_803860E4 >> 2)) + (D_803860E0 >> 6); + out = ((D_803860E0 + D_803860E4) % 0x2710) / 10000.0; + } + else{ + (D_803860E0 = (D_803860E0*0xCDD/100)); + D_803860E4 += (D_803860E0 >> 8) + (D_803860E8 >> 0xd); + D_803860E8 *= (D_803860E4 & 0x30f1); + D_803860E8 = (D_803860E8 ^ 0x3fffffff) >> 2; + + D_803860E8 &= 0x7fffff; + D_803860E4 = (D_803860E4 + D_803860E8) & 0xfffff; + D_803860E0 ^= D_803860E4; + D_803860E0 = (D_803860E0 >> (D_803860E8 & 3)) & 0x3fffffff; + out = (D_803860E0 % 0x186A0)/100000.0; + } + return out; +} + +//only used in some sfx instances; +f32 sfx_rand(void){ + f32 out; + if(D_803860F0 & 3){ + D_803860F0 = ((D_803860F4++) + (D_803860F0 >> 2)) + (D_803860EC >> 6); + out = ((D_803860EC + D_803860F0) % 0x2710) / 10000.0; + } + else{ + (D_803860EC = (D_803860EC*0xCDD/100)); + D_803860F0 += (D_803860EC >> 8) + (D_803860F4 >> 0xd); + D_803860F4 *= (D_803860F0 & 0x30f1); + D_803860F4 = (D_803860F4 ^ 0x3fffffff) >> 2; + + D_803860F4 &= 0x7fffff; + D_803860F0 = (D_803860F0 + D_803860F4) & 0xfffff; + D_803860EC ^= D_803860F0; + D_803860EC = (D_803860EC >> (D_803860F4 & 3)) & 0x3fffffff; + out = (D_803860EC % 0x186A0)/100000.0; + } + return out; +} + +f32 func_8034A668(void){ + f32 out; + D_803860E8 = (D_803860E8 >> 8) ^ D_803860E8; + out = (f32)(D_803860E8 & 0x1ffff)/131072.0; + return out; +} + +void func_8034A6B4(void){ + D_803860E0 = 0x86D; + D_803860E4 = 0x2c060731; + D_803860E8 = 0x19f0458b; + D_803860EC = 0x86D; + D_803860F0 = 0x2c060731; + D_803860F4 = 0x19f0458b; +} + +int func_8034A6FC(f32 min, f32 max){ + f32 val = randf(); + return (min <= val) && (val < max); +} + +f32 randf2(f32 min, f32 max){ + return min + randf()*(max - min); +} + +f32 sfx_randf2(f32 min, f32 max){ + return min + sfx_rand()*(max - min); +} + +s32 randi2(s32 min, s32 max){ + return min + randf()*(max - min); +} + +s32 sfx_randi2(s32 min, s32 max){ + return min + sfx_rand()*(max - min); +} + +void func_8034A85C(void){ + int i; + int start = randf()*3.0f; + for(i = 2 + start; i != 0; i--){ + randf(); + } +} + +void func_8034A8BC(s32 arg0){ + func_8034A6B4(); + for(arg0; arg0 > 0; arg0--){ + randf(); + } +} + +void func_8034A900(void){ + D_803860F8 = D_803860E0; + D_803860FC = D_803860E4; + D_80386100 = D_803860E8; + D_80386104 = D_803860EC; + D_80386108 = D_803860F0; + D_8038610C = D_803860F4; +} + +void func_8034A964(void){ + D_803860E0 = D_803860F8; + D_803860E4 = D_803860FC; + D_803860E8 = D_80386100; + D_803860EC = D_80386104; + D_803860F0 = D_80386108; + D_803860F4 = D_8038610C; +} diff --git a/src/core2/roll.c b/src/core2/roll.c new file mode 100644 index 00000000..63c10351 --- /dev/null +++ b/src/core2/roll.c @@ -0,0 +1,68 @@ +#include +#include "functions.h" +#include "variables.h" + +f32 D_8037C680; //roll +f32 D_8037C684; //roll_ideal +f32 D_8037C688; //roll_angular_velocity_limit +f32 D_8037C68C; //roll_ideal + +static void __roll_update(f32 limit, f32 step_percent){ + f32 diff; + f32 val; + f32 tick = time_getDelta(); + f32 max; + + max = limit*tick; + diff = D_8037C684 - D_8037C680; + if(180.0f < mlAbsF(diff)){ + diff += (diff < 0.0f)? 360.0: -360.0; + } + + val = diff * step_percent * tick; + val = (val < 0) ? mlClamp_f(val, -max, -0.1f) : mlClamp_f(val, 0.1f, max); + + D_8037C680 =( mlAbsF(val) <= mlAbsF(diff)) ? D_8037C680 + val : D_8037C684; + + if(D_8037C680 < 360.0){ + if(D_8037C680 < 0.0) + D_8037C680 += 360.0; + } + else + D_8037C680 -= 360.0; +} + +void roll_reset(void){ + D_8037C680 = 0.0f; + D_8037C684 = 0.0f; + roll_setAngularVelocity(700.0f, 7.5f); +} + +void roll_update(void){ + __roll_update(D_8037C688, D_8037C68C); +} + +void roll_setIdeal(f32 arg0){ + D_8037C684 = mlNormalizeAngle(arg0); +} + +void roll_set(f32 arg0){ + D_8037C680 = mlNormalizeAngle(arg0); +} + +void roll_applyIdeal(void){ + D_8037C680 = D_8037C684; +} + +f32 roll_get(void){ + return D_8037C680; +} + +f32 roll_getIdeal(void){ + return D_8037C684; +} + +void roll_setAngularVelocity(f32 limit, f32 rate){ + D_8037C688 = limit; + D_8037C68C = rate; +} diff --git a/src/core2/sla.c b/src/core2/sla.c new file mode 100644 index 00000000..876f0575 --- /dev/null +++ b/src/core2/sla.c @@ -0,0 +1,70 @@ +#include +#include "functions.h" +#include "variables.h" + +// Static Length Array + +/* .code */ +void array_clear(SLA *this){ + int i; + s32 ptr = (s32)(this + 1); + for(i = 1; i < this->elem_cnt; i++){ + *(s16 *)ptr = i; + ptr += this->elem_size; + } + *(s16 *)ptr = 0; +} + +void *array_at(SLA *this, s32 indx){ + return (void *)((s32)(this + 1) + indx*this->elem_size); +} + +s32 array_size(SLA *this){ + return this->elem_cnt; +} + +void *array_begin(SLA *this){ + return (void*)(this + 1); +} + +#pragma GLOBAL_ASM("asm/nonmatchings/core2/sla/func_802EDAA4.s") + +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/core2/sla/func_802EDC18.s") +#else +int func_802EDC18(SLA *this, s32 arg1){ + s32 tmp_v0 = this->unk4; + s16 *v1; + s32 offset; + for(v1 = (s16*)tmp_v0; *v1; ){ + if(*v1 == arg1) + return 0; + v1 = (s16*)(tmp_v0 + ((s32)*v1*this->elem_size)); + } + return 1; +} +#endif + +void array_free(SLA *this){ + free(this); +} + +SLA *array_new(s32 size, s32 cnt){ + SLA *this; + cnt++; + this = (SLA *) malloc(size*cnt + sizeof(SLA)); + this->elem_size = size; + this->elem_cnt = cnt; + array_clear(this); + return this; +} + +void func_802EDCDC(SLA *this, s32 indx){ + void* *ptr_n = ((s32)(this + 1) + indx*this->elem_size); + *(s16 *)ptr_n = *(s16 *)(this +1); + *(s16 *)(this +1) = indx; +} + +SLA *array_defrag(SLA *this){ + return defrag(this); +} diff --git a/src/core2/string.c b/src/core2/string.c new file mode 100644 index 00000000..ae794853 --- /dev/null +++ b/src/core2/string.c @@ -0,0 +1,168 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "string.h" + +void strcat(char *dst, char *src){ + while(*(dst) != '\0'){ + dst++; + } + while(*(src) != '\0'){ + *(dst++) = *(src++); + } + *(dst) = 0; +} + +void strcatc(char *dst, char src){ + while(*(dst) != '\0'){ + dst++; + } + *(dst++) = src; + *(dst) = 0; +} + +void strFToA(char *dst, f32 val){ + s32 decimal; + if (val < (f32) 0.0){ + strcat(dst, "-"); + val = -val; + } + strIToA(dst, (s32)val); + strcat(dst, "."); + decimal = (s32)((val - (f32)((s32)val))*(f32)100.0); + if(decimal < 10){ + strcat(dst, "0"); + } + strIToA(dst, decimal); +} + +void _strFToA(char *dst, f32 val, s32 decPlaces){ + u32 i; + if (val < 0.0f){ + strcat(dst, "-"); + val = -val; + } + strIToA(dst, val); + if (decPlaces != 0){ + strcat(dst, "."); + for(i = decPlaces--; i > 0; i = decPlaces--) { + val -= (s32)val; + val *= 10; + strIToA(dst, val); + } + } +} + +void strIToA(char *str, s32 num){ + _strIToA(str, num, 0); +} + +void _strIToA(char *str, s32 num, char prefix){ + s32 i; + + //Find end of string to concatinate onto + while(*str != '\0'){ + str++; + } + + // Check for a negative number, and if is prepend the '-' and make it positive + if (num < 0) { + *str = '-'; + str++; + num = -num; + } else if (prefix != 0){ + *str = prefix; + str++; + } + for (i = 1000000000; num < i; i/=10) {} + if (i == 0){ + *str = '0'; + str++; + } else{ + while (i > 0){ + *str = '0' + (num / i); + num %= i; + str++; + i /= 10; + } + } + //Terminate the string with NULL + *str = '\0'; +} + +s32 strcmp(const char *str1, const char *str2){ + while (*str1 && *str2 && *str1 == *str2) { + str1++; + str2++; + } + + if (*str1 == *str2) + return 0; + else if (*str1 == '\0' || *str1 < *str2) + return -1; + else + return 1; +} + +void strcpy(char *dst, char *src){ + while(*(src) != '\0'){ + *(dst++) = *(src++); + } + *(dst) = 0; +} + + +s32 strlen(char *str){ + char v0; + s32 len; + + len = 0; + v0 = *(str++); + while(v0 != '\0'){ + len++; + v0 = *(str++); + } + return len; +} + +s32 strcmpToTok(char *str1, char* str2, char* str3){ + while (*str2 == *str3) { + str2++; + str3++; + if ((*str2 == '\0' || *str2 == *str1) && (*str3 == '\0' || *str3 == *str1)){ + return 1; + } + } + return 0; +} + +char *strtok(char *str, const char *delim){ + while (*delim != '\0' && *delim != *str){ + delim++; + } + if (*delim == *str){ + delim++; + } + return delim; +} + +void strcpyToTok(char *arg0, char *arg1, char *arg2){ + while ((*arg2 != '\0') && (*arg2 != *arg0)){ + *arg1 = *arg2; + arg2++; + arg1++; + } + *arg1 = '\0'; +} + +void strToUpper(char *str){ + char *ret = str; + while (*ret != '\0'){ + if ((*ret >= 0x61) && (*ret < 0x7B)){ + *ret -= 0x20; + } + ret++; + } + str = ret; +} diff --git a/src/core2/timedfuncqueue.c b/src/core2/timedfuncqueue.c new file mode 100644 index 00000000..ce294fcd --- /dev/null +++ b/src/core2/timedfuncqueue.c @@ -0,0 +1,328 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "core2/timedfunc.h" + +void func_802BAE4C(void); +void set_camera_to_node(s32); + +typedef struct timed_function_queue_s{ + f32 time; + u8 arg_cnt; + u8 pad5[3]; + union { + TFQM0 func0; + TFQM1 func1; + TFQM2 func2; + TFQM3 func3; + TFQM4 func4; + TFQM5 func5; + TFQM6 func6; + }; + s32 arg[25]; + +}TimedFunction; + +typedef struct tfq_struct_2_s{ + u32 unk0; + f32 unk4; + u32 unk8; + f32 unkC[3]; + f32 unk18; + f32 unk1C; +}timefuncqueue_Struct2; + +typedef struct timed_func_array_s{ + VLA *ptr; + f32 time; +}TimedFunctionArray; + +typedef struct delayed_jiggy_s{ + u32 id; + f32 pos[3]; +} DelayedJiggyInfo; + +typedef struct { + enum asset_e text_id; + s32 unk4; + f32 position[3]; + ActorMarker *caller; + void (*callback_method_1)(ActorMarker *, enum asset_e, s32); + void (*callback_method_2)(ActorMarker *, enum asset_e, s32); +}DelayedTextCallback; + +//void __spawnjiggy(DelayedJiggyInfo *); +TimedFunction* __timedFuncQueue_insert(f32, s32, void *funcPtr, s32, s32, s32, s32, s32); +void func_80324BA0(s32); + +void func_802BE720(void); + +/* .bss */ +extern TimedFunctionArray D_80383380; + +/* .code */ +TimedFunction* __timedFuncQueue_insert(f32 time, s32 cnt, void *funcPtr, s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4){ + TimedFunction * startPtr; + TimedFunction *retVal; + TimedFunction * iPtr; + TimedFunction * endPtr; + + startPtr = (TimedFunction * )vector_getBegin(D_80383380.ptr); + endPtr = (TimedFunction * )vector_getEnd(D_80383380.ptr); + if(endPtr == startPtr){ + D_80383380.time = 0.0f; + } + else{ + time += D_80383380.time; + } + for(iPtr = startPtr; iPtr < endPtr; iPtr++){ + if(iPtr->time > time) + break; + } + retVal = (TimedFunction * )vector_insertNew((vector(TimedFunction)**)&D_80383380, ((s32)iPtr - (s32)startPtr)/(s32)sizeof(TimedFunction)); + retVal->time = time; + retVal->arg_cnt = cnt; + retVal->func5 = (TFQM5) funcPtr; + retVal->arg[0] = arg0; + retVal->arg[1] = arg1; + retVal->arg[2] = arg2; + retVal->arg[3] = arg3; + retVal->arg[4] = arg4; + return retVal; +} + +void __timedFunc_execute(TimedFunction *arg0){ + if(arg0->arg_cnt == 0) + arg0->func0(); + else if(arg0->arg_cnt == 1) + arg0->func1(arg0->arg[0]); + else if(arg0->arg_cnt == 2) + arg0->func2(arg0->arg[0], arg0->arg[1]); + else if(arg0->arg_cnt == 3) + arg0->func3(arg0->arg[0], arg0->arg[1], arg0->arg[2]); + else if(arg0->arg_cnt == 4) + arg0->func4(arg0->arg[0], arg0->arg[1], arg0->arg[2], arg0->arg[3]); + else if(arg0->arg_cnt == 5) + arg0->func5(arg0->arg[0], arg0->arg[1], arg0->arg[2], arg0->arg[3], arg0->arg[4]); + else if(arg0->arg_cnt == 6) + arg0->func6(&arg0->arg[5]); +} + +void func_80324A28(s32 soundId, s32 volume){ + func_8025A6EC(soundId, volume); +} + +void func_80324A48(enum comusic_e arg0){ + func_8025A7DC(arg0); +} + +void func_80324A68(enum sfx_e arg0, s32 arg1, s32 arg2){ + func_8030E760(arg0, arg1/1000.0f, arg2); +} + +void func_80324AA4(timefuncqueue_Struct2 *arg0){ + func_8030E9C4(arg0->unk0, arg0->unk4, arg0->unk8, arg0->unkC, arg0->unk18, arg0->unk1C); +} + +void func_80324AEC(DelayedTextCallback *arg0) { + if ((arg0->position[0] == 0.0f) && (arg0->position[1] == 0.0f) && (arg0->position[2] == 0.0f)) { + func_80311480(arg0->text_id, arg0->unk4, NULL, arg0->caller, arg0->callback_method_1, arg0->callback_method_2); + } + else{ + func_80311480(arg0->text_id, arg0->unk4, arg0->position, arg0->caller, arg0->callback_method_1, arg0->callback_method_2); + } +} + +void func_80324BA0(s32 arg0){ + if(arg0 == 1) + func_8028F918(1); + else if(arg0 == 2) + func_8028F918(3); + else if(arg0 == 3) + func_8028F918(2); + else{ + if(arg0 == 0) + func_8028F918(0); + else if (arg0 == 4) + func_802D6114(); + } +} + +void __spawnjiggy(DelayedJiggyInfo *jigInfo){ + jiggySpawn(jigInfo->id, jigInfo->pos); +} + +void func_80324C58(void){ + vector_clear(D_80383380.ptr); +} + +f32 func_80324C7C(void){ + return D_80383380.time; +} + +void timed_playSfx(f32 time, enum sfx_e arg0, f32 arg1, s32 arg2){ + timedFunc_set_3(time, (TFQM3)func_80324A68, arg0, (s32)(arg1*1000.0f), arg2); +} + +void func_80324CD8(f32 time){ + timedFunc_set_0(time, func_802BE720); +} + +void func_80324CFC(f32 time, s32 id, s32 volume){ + timedFunc_set_2(time, (TFQM2)func_80324A28, id, volume); +} + +void func_80324D2C(f32 time, enum comusic_e arg0){ + timedFunc_set_1(time, (TFQM1) func_80324A48, arg0); +} + +void func_80324D54(f32 time, enum sfx_e sfx_id, f32 arg2, s32 arg3, f32 position[3], f32 arg5, f32 arg6){ + timefuncqueue_Struct2 argStruct; + argStruct.unk0 = sfx_id; + argStruct.unk4 = arg2; + argStruct.unk8 = arg3; + argStruct.unk18 = arg5; + argStruct.unk1C = arg6; + argStruct.unkC[0] = position[0]; + argStruct.unkC[1] = position[1]; + argStruct.unkC[2] = position[2]; + + timedFunc_set_6(time, (TFQM6) func_80324AA4, (void *) &argStruct); +} + +void func_80324DBC(f32 time, enum asset_e text_id, s32 arg2, f32 position[3], ActorMarker *caller, void (*callback_method_1)(ActorMarker *, enum asset_e, s32), void (*callback_method_2)(ActorMarker *, enum asset_e, s32)) { + DelayedTextCallback sp20; + s32 pad; + + sp20.text_id = text_id; + sp20.unk4 = arg2; + sp20.caller = caller; + sp20.callback_method_1 = callback_method_1; + sp20.callback_method_2 = callback_method_2; + if (position != NULL) { + sp20.position[0] = position[0]; + sp20.position[1] = position[1]; + sp20.position[2] = position[2]; + } else { + sp20.position[0] = sp20.position[1] = sp20.position[2] = 0.0f; + } + timedFunc_set_6(time, (TFQM6) func_80324AEC, (void *) &sp20); +} + + +void func_80324E38(f32 time, s32 arg0){ + timedFunc_set_1(time, (TFQM1) func_80324BA0, arg0); +} + +void timed_setCameraToNode(f32 time, s32 arg0){ + timedFunc_set_1(time, (TFQM1) set_camera_to_node, arg0); +} + +void func_80324E88(f32 time){ + timedFunc_set_0(time, (TFQM0) func_802BAE4C); +} + +void timedFunc_set_0(f32 time, TFQM0 funcPtr){ + __timedFuncQueue_insert(time, 0, (void *) funcPtr, 0, 0, 0, 0, 0); +} + +void timedFunc_set_1(f32 time, TFQM1 funcPtr, s32 arg0){ + __timedFuncQueue_insert(time, 1, (void *) funcPtr, arg0, 0, 0, 0, 0); +} + +void timedFunc_set_2(f32 time, TFQM2 funcPtr, s32 arg0, s32 arg1){ + __timedFuncQueue_insert(time, 2, (void *) funcPtr, arg0, arg1, 0, 0, 0); +} + +void timedFunc_set_3(f32 time, TFQM3 funcPtr, s32 arg0, s32 arg1, s32 arg2){ + __timedFuncQueue_insert(time, 3, (void *) funcPtr, arg0, arg1, arg2, 0, 0); +} + +void timedFunc_set_4(f32 time, TFQM4 funcPtr, s32 arg0, s32 arg1, s32 arg2, s32 arg3){ + __timedFuncQueue_insert(time, 4, (void *) funcPtr, arg0, arg1, arg2, arg3, 0); +} + +void timedFunc_set_5(f32 time, TFQM5 funcPtr, s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4){ + __timedFuncQueue_insert(time, 5, (void *) funcPtr, arg0, arg1, arg2, arg3, arg4); +} + +void timedFunc_set_6(f32 time, TFQM6 funcPtr, void* argPtr ){ + TimedFunction *q = __timedFuncQueue_insert(time, 6, funcPtr, 0, 0, 0, 0, 0); + memcpy(&q->arg[5], argPtr, 0x50); +} + +//timedJiggySpawn +void timedJiggySpawn(f32 time, s32 jiggyId, f32 *position){ + DelayedJiggyInfo jiggyInfo; + jiggyInfo.id = jiggyId; + jiggyInfo.pos[0] = position[0]; + jiggyInfo.pos[1] = position[1]; + jiggyInfo.pos[2] = position[2]; + + timedFunc_set_6(time, (TFQM6) __spawnjiggy, (void*) &jiggyInfo); +} + +bool timedFuncQueue_is_empty(void){ + return !vector_size(D_80383380.ptr); +} + +/* + * Executes all the functions in the timed + * function queue and clears the queue + */ +void timedFuncQueue_flush(void){ + TimedFunction *iPtr; + TimedFunction iFunc; + + while(vector_size(D_80383380.ptr) > 0){ + iPtr = vector_getBegin(D_80383380.ptr); + memcpy(&iFunc, iPtr, sizeof(TimedFunction)); + vector_remove(D_80383380.ptr, 0); + __timedFunc_execute(&iFunc); + } +} + +void timedFuncQueue_free(void){ + vector_free(D_80383380.ptr); +} + +void timedFuncQueue_init(void){ + D_80383380.ptr = vector_new(0x70, 0x10); + D_80383380.time = 0.0f; +} + +/* + * Executed any methods in timed function queue + * ready to be executed. + */ +void timedFuncQueue_update(void){ + TimedFunction *iPtr; + TimedFunction iFunc; + + if(vector_size(D_80383380.ptr) == 0) + return; + + D_80383380.time += time_getDelta(); + + while(vector_size(D_80383380.ptr) > 0){ + iPtr = vector_getBegin(D_80383380.ptr); + if(D_80383380.time < iPtr->time) + break; + memcpy(&iFunc, iPtr, sizeof(TimedFunction)); + vector_remove(D_80383380.ptr, 0); + __timedFunc_execute(&iFunc); + } +} + +void timedFuncQueue_defrag(void){ + D_80383380.ptr = vector_defrag(D_80383380.ptr); +} + +void func_803252B0(s32 arg0){ + mapSpecificFlags_set(arg0, 1); +} + +void func_803252D0(f32 time, s32 arg0){ + timedFunc_set_1(time, func_803252B0, arg0); +} diff --git a/src/core2/vla.c b/src/core2/vla.c new file mode 100644 index 00000000..fdf15a9f --- /dev/null +++ b/src/core2/vla.c @@ -0,0 +1,107 @@ +#include +#include "functions.h" +#include "variables.h" + +/* VARIABLE LENGTH ARRAY */ + +void vector_clear(VLA *this){ + this->end = this->begin; +} + +void *vector_getBegin(VLA *this){ + return this->begin; +} + +void *vector_at(VLA *this, u32 n){ + return (void *)((u32) this->begin + n*this->elem_size); +} + +s32 vector_getIndex(VLA *this, void *elemPtr){ + return ((s32)elemPtr - (s32)this->begin)/(s32)this->elem_size; +} + +s32 vector_size(VLA *this){ + return ((s32)this->end - (s32)this->begin)/this->elem_size; +} + +void *vector_getEnd(VLA *this){ + return this->end; +} + +void *vector_pushBackNew(VLA **thisPtr){ + void *retVal; + VLA* this; + s32 size; + s32 mem_size; + + this = *thisPtr; + if(this->end == this->mem_end){ + size = ((s32)this->end - (s32)this->begin)/this->elem_size; + mem_size = size + 5; + this = realloc(this, mem_size*this->elem_size + sizeof(VLA)); + this->begin = &this->data; + this->end = (u8 *)this->begin + size* this->elem_size; + this->mem_end = (u8 *)this->begin + mem_size* this->elem_size; + *thisPtr = this; + } + retVal = this->end; + this->end = (void *)((s32)this->end + this->elem_size); + return retVal; +} + +void *vector_insertNew(VLA **thisPtr, s32 indx){ + VLA *this; + s32 i; + + vector_pushBackNew(thisPtr); + this = *thisPtr; + i = ((s32)this->end - (s32)this->begin)/this->elem_size; + while(indx < --i){ + memcpy((s32)this->begin + (i)*this->elem_size, (s32)this->begin + (i -1)*this->elem_size, this->elem_size); + } + return (void *)((s32)this->begin + indx*this->elem_size); +} + +void vector_free(VLA *this){ + free(this); +} + +VLA *vector_new(u32 elemSize, u32 cnt){ + VLA *this = malloc(cnt*elemSize + sizeof(VLA)); + this->elem_size = elemSize; + this->begin = &this->data; + this->end = &this->data; + this->mem_end = (u8*)this->end + cnt*elemSize; + return this; +} + +void vector_remove(VLA *this, u32 indx){ + u32 elemOffset = (u32)this->begin + indx * this->elem_size;\ + u32 nextOffset = (u32)this->begin + (indx + 1) * this->elem_size;\ + u32 size = (u32)this->end - (u32)this->begin; + + memcpy( elemOffset, nextOffset, size - (indx + 1) * this->elem_size); + this->end = (u32)this->end - this->elem_size; +} + + +void vector_popBack_n(VLA *this, u32 n){ + this->end = (void *)((u32)this->end - n * this->elem_size); +} + +void vector_assign(VLA *this, s32 indx, void* value){ + memcpy((s32)this->begin + indx * this->elem_size, value, this->elem_size); +} + +VLA * vector_defrag(VLA *this){ + s32 oldSize; + s32 oldMemSize; + + oldSize = (s32) this->end - (s32)this->begin; + oldMemSize = (s32) this->mem_end - (s32)this->begin; + this = (VLA *)defrag(this); + this->begin = &this->data; + this->end = (void *)((s32)this->begin + oldSize); + this->mem_end = (void *)((s32)this->begin + oldMemSize); + return this; +} diff --git a/src/core2/yaw.c b/src/core2/yaw.c new file mode 100644 index 00000000..9e17abe0 --- /dev/null +++ b/src/core2/yaw.c @@ -0,0 +1,136 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80299248(f32); +void func_802991A8(s32); + +f32 D_8037C690; //yaw +f32 D_8037C694; //yaw_ideal +s32 D_8037C698; //yaw_update_type +f32 D_8037C69C; //yaw_update2_angular_velocity +f32 D_8037C6A0; //yaw_update3_angular_velocity_limit +f32 D_8037C6A4; //yaw_update3_angular_velocity_percentage + +void func_80298D70(f32 arg0) { + f32 sp24; + f32 sp20; + + arg0 *= time_getDelta(); + sp24 = D_8037C694 - D_8037C690; + if (mlAbsF(sp24) > 180.0f) { + sp24 += (sp24 < 0.0f) ? 360.0 : -360.0; + } + + sp20 = (mlAbsF(sp24) > 180.0f) ? arg0 : ((sp24 < 0.0f)? -arg0: arg0); + + if(mlAbsF(sp20) <= mlAbsF(sp24)) + D_8037C690 += sp20; + else + D_8037C690 = D_8037C694; + + if (D_8037C690 < 360.0) { + if (D_8037C690 < 0.0) { + D_8037C690 = (f32) (D_8037C690 + 360.0); + } + } else { + D_8037C690 = (f32) (D_8037C690 - 360.0); + } +} + +static void func_80298F14(f32 limit, f32 step_percent){ + f32 diff; + f32 val; + f32 tick = time_getDelta(); + f32 max; + + max = limit*tick; + diff = D_8037C694 - D_8037C690; + if(180.0f < mlAbsF(diff)){ + diff += (diff < 0.0f)? 360.0: -360.0; + } + + val = diff * step_percent * tick; + val = (val < 0) ? mlClamp_f(val, -max, -0.1f) : mlClamp_f(val, 0.1f, max); + + D_8037C690 =( mlAbsF(val) <= mlAbsF(diff)) ? D_8037C690 + val : D_8037C694; + + if(D_8037C690 < 360.0){ + if(D_8037C690 < 0.0) + D_8037C690 += 360.0; + } + else + D_8037C690 -= 360.0; +} + +void func_802990B4(void){ + D_8037C690 = 0.0f; + D_8037C694 = 0.0f; + func_80299234(700.0f, 7.5f); + func_80299248(360.0f); + D_8037C698 = 0; + func_802991A8(1); +} + +void func_80299118(void){ + switch(D_8037C698){ + case 0: + break; + case 1: + func_80298F14(700.0f, 7.5f); + break; + case 2: + func_80298D70(D_8037C69C); + break; + case 3: + func_80298F14(D_8037C6A0, D_8037C6A4); + break; + } +} + +void func_802991A8(s32 arg0){ + D_8037C698 = arg0; +} + +void yaw_setIdeal(f32 arg0){ + D_8037C694 = mlNormalizeAngle(arg0); +} + +void func_802991D8(f32 arg0){ + D_8037C690 = mlNormalizeAngle(arg0); +} + +void yaw_applyIdeal(void){ + D_8037C690 = D_8037C694; +} + +s32 func_80299210(void){ + return D_8037C698; +} + +f32 yaw_get(void){ + return D_8037C690; +} + +f32 yaw_getIdeal(void){ + return D_8037C694; +} + +void func_80299234(f32 arg0, f32 arg1){ + D_8037C6A0 = arg0; + D_8037C6A4 = arg1; +} + +void func_80299248(f32 arg0){ + D_8037C69C = arg0; +} + +void func_80299254(f32 arg0){ + f32 diff = D_8037C694 - D_8037C690; + if(180.0f < mlAbsF(diff)){ + diff += (diff < 0.0f)? 360.0: -360.0; + } + + D_8037C69C = mlAbsF(diff/arg0); +} + diff --git a/src/cutscenes/code_0.c b/src/cutscenes/code_0.c new file mode 100644 index 00000000..2ae39e8b --- /dev/null +++ b/src/cutscenes/code_0.c @@ -0,0 +1,1472 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern void func_80288D08(s32, f32, void(*)(void)); +extern void func_80288D40(s32, f32, void(*)(s32), s32); +extern void func_80288D84(s32, f32, void(*)(s32,s32), s32, s32); +extern void func_80288EB0(s32, f32, s32, f32, f32); +extern void func_80288EF8(s32, f32, s32, f32); +extern void func_80288F38(s32, f32, s32, f32); +extern void func_80288E68(s32, f32, s32, f32, f32); +extern void func_80288F78(s32, f32, u32); +extern void func_80288FA8(s32, f32, s32); +extern void func_80288FD8(s32, f32, u32); +extern void func_80289090(s32, f32, u32, f32); +extern void func_802EFF5C(ParticleEmitter*, f32, f32, f32); +extern void func_802EFF7C(ParticleEmitter*, f32, f32, f32); +extern void func_802EFF9C(ParticleEmitter*, f32); +extern void func_802F9E44(s32, f32, f32, f32, f32); +extern void func_80361C24(s32, f32, s32, s32); +extern void func_80361C64(s32, f32, s32, s32, s32); +extern void func_80361CF4(s32, f32, s32, f32); +extern void func_80361D7C(s32, f32, s32, s32, u32); + + +/* .data */ +extern struct31s D_8038D350; +extern struct31s D_8038D378; +extern struct31s D_8038D3A0; +extern struct31s D_8038D3C8; +extern struct31s D_8038D3F0; +extern struct31s D_8038D418; +extern struct31s D_8038D440; +extern struct42s D_8038D470; +extern s32 D_8038D4A0[3]; +extern struct31s D_8038D4AC; +extern struct42s D_8038D4DC; +extern struct31s D_8038D50C; +extern struct31s D_8038D534; +extern struct31s D_8038D55C; +extern s32 D_8038D584[3]; +extern struct31s D_8038D590; +extern struct42s D_8038D5C0; +extern struct31s D_8038D5F0; +extern struct31s D_8038D618; +extern struct31s D_8038D640; +extern struct42s D_8038D670; +extern s32 D_8038D6A0[3]; +extern struct31s D_8038D6AC; +extern struct42s D_8038D6DC; +extern struct31s D_8038D70C; +extern struct42s D_8038D73C; +extern s32 D_8038D76C[3]; +extern struct31s D_8038D778; +extern struct42s D_8038D7A8; +extern struct31s D_8038D7D8; +extern struct42s D_8038D808; +extern s32 D_8038D838[3]; +extern struct31s D_8038D844; +extern struct42s D_8038D874; +extern struct31s D_8038D8A4; +extern struct42s D_8038D8D4; + +/* .code */ +void func_803863F0(void){ + func_8025A2D8(); +} + +void func_80386410(void){ + func_8025A2FC(0, 0x96); +} + +void func_80386434(void){ + comusic_8025AB44(COMUSIC_43_ENTER_LEVEL_GLITTER, 0, 300); +} + +void func_8038645C(void){ + comusic_8025AB44(COMUSIC_32_STARTUP_LOGO_SCENE, 25000, 2000); +} + +void func_80386484(void){ + comusic_8025AB44(COMUSIC_32_STARTUP_LOGO_SCENE, 0, 2000); +} + +void func_803864AC(void){ + s32 sp1C; + + sp1C = func_802F9AA8(SFX_93_MICROWAVE); + func_802F9F80(sp1C, 0.3f, 2.3f, 0.7f); + func_802FA060(sp1C, 20000, 20000, 0.0f); +} + +void func_80386504(void){ + s32 sp1C; + + sp1C = func_802F9AA8(SFX_134_FREEZING_SHIVER); + func_802F9F80(sp1C, 0.05f, 4.0f, 0.95f); + func_802FA060(sp1C, 15000, 15000, 0.0f); + func_802F9DB8(sp1C, 1.2f, 1.2f, 0.0f); +} + +void func_80386578(s32 arg0){ + s32 sp1C; + + sp1C = func_802F9AA8(SFX_134_FREEZING_SHIVER); + func_802F9F80(sp1C, 0.1f, 3.5f, 0.95f); + func_802FA060(sp1C, 8000, 8000, 0.0f); + func_802F9DB8(sp1C, 1.1f, 1.2f, 0.01f); +} + +void func_803865F0(void){ + s32 sp1C; + + sp1C = func_802F9AA8(SFX_B0_SIZZLING_NOISE); + func_802F9F80(sp1C, 0.05f, 0.8f, 0.95f); + func_802FA060(sp1C, 20000, 20000, 0.0f); + func_802F9DB8(sp1C, 1.0f, 1.0f, 0.0f); +} + +void func_80386668(void){ + s32 indx; + + indx = func_802F9AA8(SFX_141_MECHANICAL_WINCH); + func_802F9F80(indx, 0.25f, 20.8f, 0.95f); + func_802FA060(indx, 28000, 28000, 0.0f); + func_802F9E44(indx, 0.0f, 5.0f, 0.2f, 0.5f); +} + +void func_803866E0(void){ + s32 indx; + + indx = func_802F9AA8(SFX_141_MECHANICAL_WINCH); + func_802F9F80(indx, 0.25f, 14.0f, 0.85f); + func_802FA060(indx, 20000, 20000, 0.0f); + func_802F9E44(indx, 0.0f, 14.0f, 0.2f, 0.2f); +} + +void func_80386750(void){ + s32 indx; + + indx = func_802F9AA8(SFX_141_MECHANICAL_WINCH); + func_802F9F48(indx, 1); + func_802F9F80(indx, 0.25f, 5.5f, 0.8f); + func_802FA060(indx, 15000, 15000, 0.0f); + func_802F9E44(indx, 0.0f, 4.0f, 0.2f, 0.6f); +} + +void func_803867D0(void){ + s32 indx; + + indx = func_802F9AA8(SFX_17A_SHIPHORN); + func_802F9F48(indx, 1); + func_802F9F80(indx, 0.25f, 5.5f, 0.8f); + func_802FA060(indx, 18000, 18000, 0.0f); + func_802F9E44(indx, 0.0f, 5.5f, 0.5f, 1.4f); +} + +void func_8038684C(void){ + s32 indx; + + indx = func_802F9AA8(SFX_41A_UNKNOWN); + func_802F9F80(indx, 0.25f, 4.0f, 0.5f); + func_802FA060(indx, 15000, 15000, 0.0f); + func_802F9E44(indx, 0.0f, 14.0f, 1.0f, 0.1f); +} + +void func_803868B8(void){ + s32 indx; + + indx = func_802F9AA8(SFX_41A_UNKNOWN); + func_802F9F80(indx, 0.25f, 2.0f, 0.5f); + func_802FA060(indx, 15000, 15000, 0.0f); + func_802F9E44(indx, 0.0f, 3.0f, 1.0f, 0.1f); +} + +void func_80386924(void){ + s32 indx; + + indx = func_802F9AA8(SFX_191_STATIC); + func_802F9F80(indx, 0.3f, 5.0f, 1.5f); + func_802FA060(indx, 12000, 12000, 0.0f); + func_802F9DB8(indx, 1.0f, 1.1f, 0.04f); +} + +void func_80386990(void){ + s32 indx; + + indx = func_802F9AA8(SFX_191_STATIC); + func_802F9F80(indx, 0.3f, 4.0f, 0.5f); + func_802FA060(indx, 15000, 15000, 0.0f); + func_802F9DB8(indx, 0.6f, 0.7f, 0.04f); +} + +void func_80386A00(void){ + s32 indx; + + indx = func_802F9AA8(SFX_191_STATIC); + func_802F9F80(indx, 0.3f, 4.0f, 0.5f); + func_802FA060(indx, 15000, 15000, 0.0f); + func_802F9DB8(indx, 1.0f, 1.1f, 0.04f); + func_802F9E44(indx, 1.0f, 4.0f, 1.1f, 0.6f); +} + +void func_80386A90(s32 marker, s32 duration) { + Actor * actor = marker_getActor(reinterpret_cast(ActorMarker *, marker)); + f32 duration_f = reinterpret_cast(f32, duration); + animctrl_setTransitionDuration(actor->animctrl, duration_f); +} + +void func_80386AC8(s32 arg0) { + Actor *actor; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + actor = marker_getActor(reinterpret_cast(ActorMarker *, arg0)); + pCtrl = partEmitList_pushNew(10); + func_8034A174((struct5Bs *)actor->marker->unk44, 0xA, sp34); + particleEmitter_setPosition(pCtrl, sp34); + particleEmitter_setModel(pCtrl, 0x47B); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -350.0f, -400.0f, -350.0f, 350.0f, 450.0f, 350.0f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1100.0f, 0.0f, 0.0f, -1100.0f, 0.0f); + particleEmitter_setParticleSpawnPositionRange(pCtrl, -50.0f, 600.0f, -50.0f, 50.0f, 600.0f, 50.0f); + func_802EF9F8(pCtrl, 0.01f); + func_802EFA18(pCtrl, 3); + func_802EFB98(pCtrl, &D_8038D350); + particleEmitter_emitN(pCtrl, 10); +} + +void func_80386C34(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(15); + func_8034A174((struct5Bs *)sp44->marker->unk44, 0xA, sp34); + particleEmitter_setPosition(pCtrl, sp34); + particleEmitter_setModel(pCtrl, 0x47B); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -350.0f, -400.0f, -350.0f, 350.0f, 450.0f, 350.0f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1100.0f, 0.0f, 0.0f, -1100.0f, 0.0f); + particleEmitter_setParticleSpawnPositionRange(pCtrl, -50.0f, 600.0f, -50.0f, 50.0f, 600.0f, 50.0f); + func_802EF9F8(pCtrl, 0.01f); + func_802EFA18(pCtrl, 3); + func_802EFB98(pCtrl, &D_8038D378); + particleEmitter_emitN(pCtrl, 15); +} + +void func_80386DA0(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(1); + func_8034A174((struct5Bs *) (struct5Bs *)sp44->marker->unk44, 0xA, sp34); + particleEmitter_setPosition(pCtrl, sp34); + particleEmitter_setModel(pCtrl, 0x47B); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(pCtrl, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -700.0f, 0.0f, 0.0f, -700.0f, 0.0f); + particleEmitter_setParticleSpawnPositionRange(pCtrl, -50.0f, 1500.0f, -50.0f, 50.0f, 1500.0f, 50.0f); + func_802EF9F8(pCtrl, 0.01f); + func_802EFA18(pCtrl, 3); + func_802EFB98(pCtrl, &D_8038D3A0); + particleEmitter_emitN(pCtrl, 1); +} + +void func_80386EF8(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(8U); + func_8034A174((struct5Bs *)sp44->marker->unk44, 5, sp34); + particleEmitter_setPosition(pCtrl, sp34); + particleEmitter_setModel(pCtrl, 0x344); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -150.0f, 150.0f, -150.0f, 150.0f, 360.0f, 150.0f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -600.0f, 0.0f, 0.0f, -600.0f, 0.0f); + func_802EF9F8(pCtrl, 0.01f); + func_802EFA18(pCtrl, 3); + func_802EFB98(pCtrl, &D_8038D3C8); + particleEmitter_emitN(pCtrl, 8); +} + +void func_8038702C(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(8U); + particleEmitter_setSprite(pCtrl, 0x712); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_8034A174((struct5Bs *)sp44->marker->unk44, 5, sp34); + particleEmitter_setPosition(pCtrl, sp34); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -250.0f, 250.0f, -250.0f, 250.0f, 360.0f, 250.0f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -800.0f, 0.0f, 0.0f, -800.0f, 0.0f); + func_802EF9F8(pCtrl, 0.4f); + func_802EFA18(pCtrl, 3); + func_802EFB98(pCtrl, &D_8038D3F0); + particleEmitter_emitN(pCtrl, 8); +} + +void func_80387170(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(8); + particleEmitter_setSprite(pCtrl, 0x712); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_8034A174((struct5Bs *)sp44->marker->unk44, 6, sp34); + particleEmitter_setPosition(pCtrl, sp34); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -250.0f, 250.0f, -250.0f, 250.0f, 360.0f, 250.0f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -800.0f, 0.0f, 0.0f, -800.0f, 0.0f); + func_802EF9F8(pCtrl, 0.4f); + func_802EFA18(pCtrl, 3); + func_802EFB98(pCtrl, &D_8038D418); + particleEmitter_emitN(pCtrl, 8); +} + +void func_803872B4(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(4); + particleEmitter_setSprite(pCtrl, 0x70D); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EF9E4(pCtrl, 0x82); + func_8034A174((struct5Bs *)sp44->marker->unk44, 7, sp34); + particleEmitter_setPosition(pCtrl, sp34); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D470); + func_802EFB98(pCtrl, &D_8038D440); + particleEmitter_emitN(pCtrl, 4); +} + +void func_80387364(s32 arg0) { + Actor *sp34; + ParticleEmitter *pCtrl; + f32 sp24[3]; + + sp34 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, 0x70D); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_8038D4A0); + func_802EF9E4(pCtrl, 0x82); + func_8034A174((struct5Bs *) sp34->marker->unk44, 8, sp24); + particleEmitter_setPosition(pCtrl, sp24); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D4DC); + func_802EFB98(pCtrl, &D_8038D4AC); + particleEmitter_emitN(pCtrl, 1); +} + +void func_80387424(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(8); + particleEmitter_setSprite(pCtrl, 0x713); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EF9E4(pCtrl, 0x64); + func_8034A174((struct5Bs *) sp44->marker->unk44, 5, sp34); + particleEmitter_setPosition(pCtrl, sp34); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -30.0f, 130.0f, -30.0f, 130.0f, 45.0f, 30.0f); + func_802EFB98(pCtrl, &D_8038D50C); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -300.0f, 0.0f, 0.0f, -300.0f, 0.0f); + particleEmitter_emitN(pCtrl, 8); +} + +void func_80387560(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(11); + particleEmitter_setModel(pCtrl, 0x478); + func_8034A174((struct5Bs *) sp44->marker->unk44, 5, sp34); + particleEmitter_setPosition(pCtrl, sp34); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -30.0f, 130.0f, -30.0f, 130.0f, 45.0f, 30.0f); + func_802EFB98(pCtrl, &D_8038D534); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -500.0f, 0.0f, 0.0f, -500.0f, 0.0f); + particleEmitter_emitN(pCtrl, 11); +} + +void func_80387680(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(11); + particleEmitter_setSprite(pCtrl, 0x70B); + func_8034A174((struct5Bs *) sp44->marker->unk44, 5, sp34); + particleEmitter_setPosition(pCtrl, sp34); + func_802EFE24(pCtrl, -600.0f, -600.0f, -600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setParticleVelocityRange(pCtrl, -30.0f, 130.0f, -30.0f, 130.0f, 45.0f, 30.0f); + func_802EFB98(pCtrl, &D_8038D55C); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -500.0f, 0.0f, 0.0f, -500.0f, 0.0f); + particleEmitter_emitN(pCtrl, 11); +} + +void func_803877A0(s32 arg0) { + Actor *sp34; + ParticleEmitter *pCtrl; + f32 sp24[3]; + + sp34 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, 0x475); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_8038D584); + func_802EF9E4(pCtrl, 0xFF); + func_802EFF5C(pCtrl, 0.1f, 0.2f, 0.0f); + func_802EFF7C(pCtrl, 0.0f, 0.25f, 0.0f); + func_802EFF9C(pCtrl, 0.5f); + func_8034A174((struct5Bs *) sp34->marker->unk44, 6, sp24); + particleEmitter_setPosition(pCtrl, sp24); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D5C0); + func_802EFB98(pCtrl, &D_8038D590); + particleEmitter_emitN(pCtrl, 1); +} + +void func_803878A4(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(1); + func_8034A174((struct5Bs *) sp44->marker->unk44, 8, sp34); + particleEmitter_setPosition(pCtrl, sp34); + particleEmitter_setModel(pCtrl, 0x47A); + func_802EFE24(pCtrl, -10.0f, -10.0f, -10.0f, 10.0f, 10.0f, 10.0f); + particleEmitter_setParticleVelocityRange(pCtrl, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1000.0f, 0.0f, 0.0f, -1000.0f, 0.0f); + func_802EF9F8(pCtrl, 0.3f); + func_802EFA18(pCtrl, 3); + func_802EFA70(pCtrl, 2); + func_802EFB98(pCtrl, &D_8038D5F0); + func_802EF9EC(pCtrl, 0x21, 0x3A98); + particleEmitter_emitN(pCtrl, 1); +} + +void func_803879E0(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(2); + func_8034A174((struct5Bs *) sp44->marker->unk44, 8, sp34); + particleEmitter_setPosition(pCtrl, sp34); + particleEmitter_setModel(pCtrl, 0x47A); + func_802EFE24(pCtrl, -10.0f, -10.0f, -10.0f, 10.0f, 10.0f, 10.0f); + particleEmitter_setParticleVelocityRange(pCtrl, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + particleEmitter_setParticleSpawnPositionRange(pCtrl, -40.0f, 0.0f, -40.0f, 40.0f, 20.0f, 40.0f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -1000.0f, 0.0f, 0.0f, -1000.0f, 0.0f); + func_802EF9F8(pCtrl, 0.3f); + func_802EFA18(pCtrl, 3); + func_802EFA70(pCtrl, 2); + func_802EFB98(pCtrl, &D_8038D618); + func_802EF9EC(pCtrl, 0x21, 0x3A98); + particleEmitter_emitN(pCtrl, 2); +} + +void func_80387B58(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, 0x702); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EF9E4(pCtrl, 0x3C); + func_802EFE24(pCtrl, -60.0f, -60.0f, -60.0f, 60.0f, 60.0f, 60.0f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -290.0f, 0.0f, 0.0f, -290.0f, 0.0f); + func_8034A174((struct5Bs *) sp44->marker->unk44, 5, sp34); + particleEmitter_setPosition(pCtrl, sp34); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D670); + func_802EFB98(pCtrl, &D_8038D640); + particleEmitter_emitN(pCtrl, 1); +} + +void func_80387C64(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + func_8034A174((struct5Bs *) sp44->marker->unk44, 5, sp34); + if (func_802582EC(sp34) == 0) { + pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, 0x70D); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_8038D6A0); + func_802EF9E4(pCtrl, 0x64); + func_802EFE24(pCtrl, -60.0f, -60.0f, -60.0f, 60.0f, 60.0f, 60.0f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -30.0f, 0.0f, 0.0f, -30.0f, 0.0f); + particleEmitter_setPosition(pCtrl, sp34); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D6DC); + func_802EFB98(pCtrl, &D_8038D6AC); + particleEmitter_emitN(pCtrl, 1); + } +} + +void func_80387D88(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + func_8034A174((struct5Bs *) sp44->marker->unk44, 5, sp34); + if (func_802582EC(sp34) == 0) { + pCtrl = partEmitList_pushNew(25); + particleEmitter_setSprite(pCtrl, 0x713); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EF9E4(pCtrl, 0xFF); + func_802EFE24(pCtrl, -60.0f, -60.0f, -60.0f, 60.0f, 60.0f, 60.0f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -30.0f, 0.0f, 0.0f, -30.0f, 0.0f); + particleEmitter_setPosition(pCtrl, sp34); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D73C); + func_802EFB98(pCtrl, &D_8038D70C); + particleEmitter_emitN(pCtrl, 25); + } +} + +void func_80387E9C(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + func_8034A174((struct5Bs *) sp44->marker->unk44, 5, sp34); + if (func_802582EC(sp34) == 0) { + pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, 0x70D); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EF9E4(pCtrl, 0xC8); + func_802EFFA8(pCtrl, D_8038D76C); + func_802EFE24(pCtrl, -60.0f, -60.0f, -60.0f, 60.0f, 60.0f, 60.0f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, -30.0f, 0.0f, 0.0f, -30.0f, 0.0f); + particleEmitter_setPosition(pCtrl, sp34); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D7A8); + func_802EFB98(pCtrl, &D_8038D778); + particleEmitter_emitN(pCtrl, 1); + } +} + +void func_80387FC0(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + func_8034A174((struct5Bs *) sp44->marker->unk44, 5, sp34); + if (func_802582EC(sp34) == 0) { + pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, 0x70D); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EF9E4(pCtrl, 0x64); + func_802EFE24(pCtrl, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, 200.0f, 0.0f, 0.0f, 200.0f, 0.0f); + particleEmitter_setPosition(pCtrl, sp34); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D808); + func_802EFB98(pCtrl, &D_8038D7D8); + particleEmitter_emitN(pCtrl, 1); + } +} + +void func_803880C8(s32 arg0) { + Actor *sp34; + ParticleEmitter *pCtrl; + f32 sp24[3]; + + sp34 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + pCtrl = partEmitList_pushNew(1); + particleEmitter_setSprite(pCtrl, 0x47C); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EFFA8(pCtrl, D_8038D838); + func_802EF9E4(pCtrl, 0x82); + func_802EFF5C(pCtrl, 0.1f, 0.2f, 0); + func_802EFF7C(pCtrl, 0, 0.25f, 0); + func_802EFF9C(pCtrl, 0.5f); + func_8034A174((struct5Bs *) sp34->marker->unk44, 5, sp24); + particleEmitter_setPosition(pCtrl, sp24); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D874); + func_802EFB98(pCtrl, &D_8038D844); + particleEmitter_emitN(pCtrl, 1); +} + +void func_803881CC(s32 arg0) { + Actor *sp44; + ParticleEmitter *pCtrl; + f32 sp34[3]; + + sp44 = marker_getActor(reinterpret_cast(ActorMarker *,arg0)); + func_8034A174((struct5Bs *) sp44->marker->unk44, 5, sp34); + if (func_802582EC(sp34) == 0) { + pCtrl = partEmitList_pushNew(2); + particleEmitter_setSprite(pCtrl, 0x70D); + particleEmitter_setStartingFrameRange(pCtrl, 1, 6); + func_802EF9E4(pCtrl, 0x50); + func_802EFE24(pCtrl, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + particleEmitter_setParticleAccelerationRange(pCtrl, 0.0f, 100.0f, 0.0f, 0.0f, 300.0f, 0.0f); + particleEmitter_setPosition(pCtrl, sp34); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038D8D4); + func_802EFB98(pCtrl, &D_8038D8A4); + particleEmitter_emitN(pCtrl, 2); + } +} + +void func_803882D4(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.0952f, 0xAD8075U); + func_80288F78(arg0, 0.5279f, 0xAD8C94U); + func_8028913C(arg0, 1); + func_80288F78(arg0, 0.55f, 0xC580FAU); + func_80288F78(arg0, 0.8658f, 0xCCD9FAU); + func_80288F78(arg0, 0.9485f, 0x2F8CC3U); +} + +void func_8038837C(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.03f, 0x012A8CFAU); +} + +void func_803883AC(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.0282f, 0x012A8CFAU); + func_80288F78(arg0, 0.6107f, 0x207375U); + func_80288F78(arg0, 0.6107f, 0xF9534EU); + func_80288F78(arg0, 0.6664f, 0x208075U); + func_80288F78(arg0, 0.6664f, 0xF9594EU); + func_80288F78(arg0, 0.7421f, 0x207975U); + func_80288F78(arg0, 0.7421f, 0xF9554EU); + func_80288F78(arg0, 0.9772f, 0x2794EU); +} + +void func_80388490(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.025f, 0x69936U); + func_80288F78(arg0, 0.52f, 0x67336U); +} + +void func_803884DC(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.001f, arg1, 3, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.001f, arg1, 4, 0); + func_8028913C(arg0, 1); + func_80288D08(arg0, 0.01f, func_8038684C); + func_8028913C(arg0, 7); + func_80288EB0(arg0, 0.02f, 0, 35.0f, 0.8f); + func_8028913C(arg0, 7); + func_80288D40(arg0, 0.02f, func_80386C34, arg1); + func_8028913C(arg0, 0xB); + func_80288D40(arg0, 0.5f, func_80386AC8, arg1); + func_8028913C(arg0, 0xB); + func_80288D40(arg0, 0.7f, func_80386DA0, arg1); + func_8028913C(arg0, 5); + func_80288F78(arg0, 0.149f, 0x017C80FA); + func_8028913C(arg0, 0xB); + func_80288F78(arg0, 0.2f, 0x017D80FA); +} + +void func_80388660(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.001f, arg1, 3, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.001f, arg1, 4, 0); + func_8028913C(arg0, 1); + func_80288D08(arg0, 0.01f, func_803868B8); + func_8028913C(arg0, 1); + func_80288F78(arg0, 0.149f, 0x017C80FAU); + func_80288F78(arg0, 0.79f, 0x280C3U); +} + +void func_80388734(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.001f, arg1, 3, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.001f, arg1, 4, 0); +} + +void func_803887A0(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.001f, arg1, 3, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.001f, arg1, 4, 1); +} + +void func_80388814(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.001f, arg1, 4, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.001f, arg1, 5, 1); + func_80288F78(arg0, 0.016f, 0x87955U); + func_80288F78(arg0, 0.18f, 0x88C55U); + func_80288F78(arg0, 0.34f, 0x88055U); + func_80288F78(arg0, 0.498f, 0x88655U); + func_80288F78(arg0, 0.68f, 0x88C55U); + func_80288F78(arg0, 0.831f, 0x87955U); +} + +void func_80388920(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.021f, arg1, 4, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.021f, arg1, 5, 1); + func_80288F78(arg0, 0.49f, 0x8D93EU); + func_80288F78(arg0, 0.99f, 0x8C03EU); +} + +void func_803889CC(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.05f, arg1, 4, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.05f, arg1, 5, 1); + func_8028913C(arg0, 1); + func_80288D08(arg0, 0.05f, func_80386504); +} + +void func_80388A6C(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.02f, arg1, 4, 2); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.02f, arg1, 5, 2); + func_80361D7C(arg0, 0.13f, arg1, 5, 0x4CA675U); + func_80361D7C(arg0, 0.48f, arg1, 5, 0x4CA675U); + func_80361D7C(arg0, 0.57f, arg1, 5, 0x4CA675U); +} + +void func_80388B58(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.021f, arg1, 4, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.021f, arg1, 5, 1); +} + +void func_80388BCC(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.021f, arg1, 4, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.021f, arg1, 5, 1); +} + +void func_80388C40(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.151f, 0x5D59C3U); + func_80288F78(arg0, 0.5662f, 0x5E59C3U); + func_80288D40(arg0, 0.56f, func_803880C8, arg1); + func_80288D40(arg0, 0.71f, func_803880C8, arg1); + func_80288D40(arg0, 0.86f, func_803880C8, arg1); +} + +void func_80388CE4(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.16f, 0x01054CC3U); + func_80288F78(arg0, 0.7496f, 0x01054CC3U); +} + +void func_80388D30(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.0257f, 0x6B40FFU); + func_80288F78(arg0, 0.6287f, 0x6C80FAU); + func_80288F78(arg0, 0.7126f, 0x3F9965U); + func_80288F78(arg0, 0.77f, 0x409965U); + func_80288F78(arg0, 0.8079f, 0x3F9965U); + func_80288F78(arg0, 0.9142f, 0x409965U); +} + +void func_80388DE4(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.0145f, 0x6B73FFU); + func_80288F78(arg0, 0.6245f, 0x6C80FAU); +} + +void func_80388E30(s32 arg0, s32 arg1) { + f32 sp2C; + + sp2C = 0.8f; + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 3, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 4, 0); + func_8028913C(arg0, 1); + func_80288D84(arg0, 0.01f, func_80386A90, arg1, reinterpret_cast(s32, sp2C)); +} + +void func_80388EE0(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 3, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 4, 0); + func_80288F78(arg0, 0.1667f, 0xC680FFU); + func_80288F78(arg0, 0.4114f, 0x2C80FFU); + func_80288F78(arg0, 0.8132f, 0xC580FFU); +} + +void func_80388F9C(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 3, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 4, 0); + func_80361D7C(arg0, 0.2452f, arg1, 5, 0x6F804EU); + func_80361D7C(arg0, 0.2858f, arg1, 5, 0x6F804EU); + func_80361D7C(arg0, 0.4616f, arg1, 5, 0x6F804EU); + func_80361D7C(arg0, 0.4826f, arg1, 5, 0x6F804EU); + func_80361D7C(arg0, 0.7155f, arg1, 5, 0x6F804EU); + func_80361D7C(arg0, 0.7384f, arg1, 5, 0x6F804EU); +} + +void func_803890CC(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, reinterpret_cast(s32, arg1), 3, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 4, 1); + func_80361D7C(arg0, 0.08f, arg1, 5, 0x6DB375U); + func_80288D40(arg0, 0.08f, func_80387560, arg1); + func_80361D7C(arg0, 0.2f, arg1, 5, 0x6DB375U); + func_80288D40(arg0, 0.2f, func_80387560, arg1); + func_80361D7C(arg0, 0.3f, arg1, 5, 0x6DB375U); + func_80288D40(arg0, 0.3f, func_80387560, arg1); +} + +void func_80389204(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, reinterpret_cast(s32, arg1), 3, 2); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 4, 1); + func_80361D7C(arg0, 0.08f, arg1, 5, 0x6DB34EU); + func_80288D40(arg0, 0.08f, func_80387680, arg1); + func_80361D7C(arg0, 0.2f, arg1, 5, 0x6DB34EU); + func_80288D40(arg0, 0.2f, func_80387680, arg1); + func_80361D7C(arg0, 0.3f, arg1, 5, 0x6DB34EU); + func_80288D40(arg0, 0.3f, func_80387680, arg1); +} + +void func_8038933C(s32 arg0, s32 arg1) { + func_80288FD8(arg0, 0.1f, 0xA60000U); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 2, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 3, 1); + func_80361D7C(arg0, 0.3f, arg1, 5, 0xB4B3EAU); + func_80361D7C(arg0, 0.6f, arg1, 5, 0x1F809CU); + func_80361D7C(arg0, 0.65f, arg1, 5, 0x98A675U); + func_80361D7C(arg0, 0.81f, arg1, 5, 0x98A675U); + func_80361D7C(arg0, 0.93f, arg1, 5, 0x98A675U); + func_80288FA8(arg0, 0.99f, 0xA6); +} + +void func_80389498(s32 arg0, s32 arg1) { + func_80288D40(arg0, 0.06f, func_80386EF8, reinterpret_cast(s32, arg1)); + func_80288F78(arg0, 0.06f, 0x03F9B3FAU); +} + +void func_803894E8(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.1961f, 0x98A6A4U); + func_80288F78(arg0, 0.2914f, 0x98A6A4U); + func_80288F78(arg0, 0.3741f, 0x98A6A4U); + func_80288F78(arg0, 0.4627f, 0x98A6A4U); + func_80288F78(arg0, 0.5551f, 0x98A6A4U); + func_80288F78(arg0, 0.6374f, 0x98A6A4U); + func_80288F78(arg0, 0.7178f, 0x98A6A4U); + func_80288F78(arg0, 0.8202f, 0x98A6A4U); + func_80288F78(arg0, 0.9137f, 0x98A6A4U); +} + +void func_803895CC(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.204f, 0x98A6A4U); + func_80288F78(arg0, 0.304f, 0x98A6A4U); + func_80288F78(arg0, 0.3977f, 0x98A6A4U); + func_80288F78(arg0, 0.5139f, 0x98A6A4U); + func_80288F78(arg0, 0.6923f, 0x98A6A4U); + func_80288F78(arg0, 0.9106f, 0x8B80FAU); + func_80288F78(arg0, 0.9109f, 0x8B80FAU); +} + +void func_80389698(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.0221f, 0x4480FAU); +} + +void func_803896C8(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.001f, reinterpret_cast(s32, arg1), 1, 1); + func_80361C64(arg0, 0.023f, arg1, 6, 1); + func_80361C64(arg0, 0.023f, arg1, 5, 0); + func_80361C64(arg0, 0.023f, arg1, 7, 0); + func_80288EB0(arg0, 0.035f, 0, 30.0f, 0.4f); + func_80361C64(arg0, 0.3f, arg1, 7, 1); + func_80361C24(arg0, 0.31f, arg1, 6); + func_80288EB0(arg0, 0.3209f, 0, 30.0f, 0.4f); + func_80361C64(arg0, 0.66f, arg1, 5, 1); + func_80288D40(arg0, 0.66f, func_80387E9C, arg1); + func_80288F78(arg0, 0.66f, 0x3080FAU); + func_80361C24(arg0, 0.65f, arg1, 7); +} + +void func_80389850(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.36f, arg1, 7, 0); + func_80361C64(arg0, 0.618f, arg1, 7, 1); + func_80361C64(arg0, 0.696f, arg1, 5, 1); +} + +void func_803898C8(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.03f, reinterpret_cast(s32, arg1), 7, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.03f, arg1, 5, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.03f, arg1, 4, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.03f, arg1, 6, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.03f, arg1, 8, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.1f, arg1, 9, 1); + func_80288F78(arg0, 0.08f, 0x6080C3U); + func_80288F78(arg0, 0.35f, 0x280D2U); + func_80288D40(arg0, 0.45f, func_803877A0, arg1); + func_80288F78(arg0, 0.45f, 0x03ED8027U); + func_80288D40(arg0, 0.55f, func_803877A0, arg1); + func_80288F78(arg0, 0.55f, 0x03ED8027U); + func_80288D40(arg0, 0.65f, func_803877A0, arg1); + func_80288F78(arg0, 0.65f, 0x03ED8027U); + func_80288D40(arg0, 0.75f, func_803877A0, arg1); + func_80288F78(arg0, 0.75f, 0x03ED8027U); +} + +void func_80389AD0(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.03f, arg1, 7, 0); + func_80361C64(arg0, 0.03f, arg1, 5, 0); + func_80361C64(arg0, 0.03f, arg1, 4, 0); + func_80361C64(arg0, 0.03f, arg1, 6, 0); + func_80361C64(arg0, 0.03f, arg1, 8, 0); +} + +void func_80389B84(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.001f, 0x1F73D2U); + func_80288D40(arg0, 0.001f, func_80387D88, arg1); + func_80288F78(arg0, 0.001f, 0x8299D2U); + func_80288F78(arg0, 0.003f, 0x66CCFAU); + func_80288EB0(arg0, 0.001f, 2, 50.0f, 0.5f); +} + +void func_80389C30(s32 arg0, s32 arg1) { + func_80288D40(arg0, 0.1f, func_80387C64, reinterpret_cast(s32, arg1)); + func_80288D40(arg0, 0.2f, func_80387C64, arg1); + func_80288D40(arg0, 0.3f, func_80387C64, arg1); + func_80288D40(arg0, 0.4f, func_80387C64, arg1); + func_80288D40(arg0, 0.5f, func_80387C64, arg1); + func_80288D40(arg0, 0.6f, func_80387C64, arg1); + func_80288D40(arg0, 0.7f, func_80387C64, arg1); + func_80288D40(arg0, 0.8f, func_80387C64, arg1); + func_80288D40(arg0, 0.9f, func_80387C64, arg1); +} + +void func_80389D34(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.02f, arg1, 1, 0); +} + +void func_80389D78(s32 arg0, s32 arg1) { + func_80288D08(arg0, 0.01f, func_803864AC); + func_80288D08(arg0, 0.0f, func_803865F0); + func_80288F78(arg0, 0.9f, 0x7F80EAU); + func_80288EB0(arg0, 0.9f, 0, 5.0f, 0.8f); +} + +void func_80389DFC(s32 arg0, s32 arg1) { + func_80288D08(arg0, 0.01f, func_803864AC); + func_80288D08(arg0, 0.01f, func_803865F0); + func_80288D40(arg0, 0.8f, func_803872B4, arg1); + func_80288F78(arg0, 0.9f, 0x7F80EAU); + func_80288EB0(arg0, 0.9f, 0, 5.0f, 0.8f); +} + +void func_80389EA8(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.023f, arg1, 1, 1); + func_8028913C(arg0, 2); + func_80288EF8(arg0, 0.6f, 0, 0.1f); + func_8028913C(arg0, 2); + func_80288E68(arg0, 0.6f, 0, 8.0f, 8.0f); + func_80289090(arg0, 0.2f, 0xFF0000U, 0.4f); + func_80289090(arg0, 0.2f, 0xFF00U, 0.4f); + func_80289090(arg0, 0.2f, 0xFFU, 0.4f); + func_80289090(arg0, 0.2f, 0xFFFFFFU, 0.4f); + func_80288D40(arg0, 0.4f, func_8038702C, arg1); + func_80288D40(arg0, 0.4f, func_80387170, arg1); + func_8028913C(arg0, 5); + func_80288F38(arg0, 0.95f, 0, 0.8f); +} + +void func_8038A018(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.023f, arg1, 1, 0); +} + +void func_8038A05C(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.02f, arg1, 1, 0); +} + +void func_8038A0A0(s32 arg0, s32 arg1) { + func_80288D08(arg0, 0.01f, func_803864AC); + func_80288D08(arg0, 0.0f, func_803865F0); + func_80288F78(arg0, 0.8f, 0xB1C075U); + func_80288F78(arg0, 0.95f, 0xB1B375U); + func_80288F78(arg0, 0.97f, 0x7F80EAU); + func_80288EB0(arg0, 0.97f, 0, 5.0f, 0.8f); +} + +void func_8038A15C(s32 arg0, s32 arg1) { + func_80288D08(arg0, 0.01f, func_803864AC); + func_80288D08(arg0, 0.01f, func_803865F0); + func_80288D40(arg0, 0.01f, func_80387364, arg1); + func_80288D40(arg0, 0.15f, func_80387364, arg1); + func_80288D40(arg0, 0.3f, func_80387364, arg1); + func_80288D40(arg0, 0.5f, func_80387364, arg1); + func_80288F78(arg0, 0.97f, 0x7F80EAU); + func_80288EB0(arg0, 0.97f, 0, 5.0f, 0.8f); +} + +void func_8038A254(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.001f, arg1, 1, 1); + func_80288D40(arg0, 0.4f, func_8038702C, arg1); + func_80288D40(arg0, 0.4f, func_80387170, arg1); + func_8028913C(arg0, 3); + func_80288F78(arg0, 0.5f, 0x041B809CU); +} + +void func_8038A2F0(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.023f, arg1, 1, 0); +} + +void func_8038A334(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.01f, arg1, 1, 0); + func_80288EB0(arg0, 0.1f, 0, 3.0f, 0.8f); + func_80288F78(arg0, 0.1f, 0x9880C3U); + func_80288EB0(arg0, 0.13f, 0, 3.0f, 0.8f); + func_80288F78(arg0, 0.13f, 0x9880C3U); + func_80288EB0(arg0, 0.35f, 0, 3.0f, 0.8f); + func_80288F78(arg0, 0.35f, 0x9880C3U); + func_80288EB0(arg0, 0.39f, 0, 3.0f, 0.8f); + func_80288F78(arg0, 0.391f, 0x9880C3U); + func_80288EB0(arg0, 0.43f, 0, 3.0f, 0.8f); + func_80288F78(arg0, 0.43f, 0x9880C3U); + func_80288EB0(arg0, 0.46f, 0, 3.0f, 0.8f); + func_80288F78(arg0, 0.46f, 0x9880C3U); + func_80288EB0(arg0, 0.7f, 0, 3.0f, 0.8f); + func_80288F78(arg0, 0.7f, 0x9880C3U); + func_80288EB0(arg0, 0.78f, 0, 3.0f, 0.8f); + func_80288F78(arg0, 0.78f, 0x9880C3U); + func_80288EB0(arg0, 0.93f, 0, 3.0f, 0.8f); + func_80288F78(arg0, 0.93f, 0x9880C3U); +} + +void func_8038A54C(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.23f, 0x013973A4U); + func_80288F78(arg0, 0.36f, 0x01398CA4U); + func_80288D08(arg0, 0.53f, func_80386668); + func_80288F78(arg0, 0.53f, 0x013980A4U); +} + +void func_8038A5C8(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.0511f, 0x6594EU); + func_80288F78(arg0, 0.53f, 0x6804EU); + func_8028913C(arg0, 1); + func_80288F78(arg0, 0.6636f, 0xFA4C7DU); + func_8028913C(arg0, 8); + func_80288F78(arg0, 0.6636f, 0xFA4C7DU); + func_8028913C(arg0, 0xF); + func_80288F78(arg0, 0.6636f, 0xFA4C7DU); + func_8028913C(arg0, 0x17); + func_80288F78(arg0, 0.6636f, 0xFA4C7DU); + func_8028913C(arg0, 0x1F); + func_80288F78(arg0, 0.6636f, 0xFA4C7DU); +} + +void func_8038A6D0(s32 arg0, s32 arg1) { + func_8028913C(arg0, 3); + func_80288F78(arg0, 0.05f, 0xFA4C7DU); + func_8028913C(arg0, 0xA); + func_80288F78(arg0, 0.05f, 0xFA467DU); +} + +void func_8038A734(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.18f, 0xD3595DU); + func_80288F78(arg0, 0.31f, 0xD3605DU); + func_80288F78(arg0, 0.49f, 0xD3595DU); + func_80288F78(arg0, 0.65f, 0xD3605DU); + func_80288F78(arg0, 0.83f, 0xD3595DU); + func_80288F78(arg0, 0.99f, 0xD3605DU); +} + +void func_8038A7E8(s32 arg0, s32 arg1) { + func_80288D08(arg0, 0.01f, func_803866E0); + func_80288F78(arg0, 0.23f, 0x013973A4U); + func_80288F78(arg0, 0.36f, 0x01398CA4U); + func_80288F78(arg0, 0.53f, 0x013980A4U); +} + +void func_8038A864(s32 arg0, s32 arg1) { + func_80361CF4(arg0, 0.001f, arg1, 0.7f); + func_8028913C(arg0, 2); + func_80288D40(arg0, 0.7f, func_80386578, arg1); + func_8028913C(arg0, 2); + func_80288F78(arg0, 0.7f, 0x0416736DU); + func_8028913C(arg0, 3); + func_80288F78(arg0, 0.6f, 0x0416736DU); + func_8028913C(arg0, 4); + func_80288F78(arg0, 0.6f, 0x0416736DU); + func_80361CAC(arg0, 0x3F19999A, arg1, 0x3F333333); +} + +void func_8038A954(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.53f, 0x6995DU); + func_80288F78(arg0, 0.99f, 0x6B35DU); +} + +void func_8038A9A0(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.377f, 0x014280FAU); +} + +void func_8038A9D0(s32 arg0, s32 arg1) { + func_80288EB0(arg0, 0.001f, 0, 6.0f, 0.4f); + func_80288F78(arg0, 0.001f, 0x9880B3U); + func_80288EB0(arg0, 0.5069f, 0, 6.0f, 0.4f); + func_80288F78(arg0, 0.5069f, 0x988CB3U); +} + +void func_8038AA64(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.05f, 0xFB999CU); + func_80288F78(arg0, 0.12f, 0x2809CU); + func_80288F78(arg0, 0.33f, 0x2869CU); + func_80288F78(arg0, 0.65f, 0xFB939CU); + func_80288F78(arg0, 0.75f, 0x2799CU); +} + +void func_8038AAFC(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.28f, 0x908CFAU); + func_80288D08(arg0, 0.4f, func_80386750); + func_80288D08(arg0, 0.4f, func_803867D0); +} + +void func_8038AB60(s32 arg0, s32 arg1) { + func_80361D7C(arg0, 0.21f, reinterpret_cast(s32, arg1), 5, 0x96804EU); + func_80361D7C(arg0, 0.43f, arg1, 5, 0x96864EU); + func_80361D7C(arg0, 0.65f, arg1, 5, 0x96884EU); + func_80361D7C(arg0, 0.8f, arg1, 5, 0x012D889CU); + func_80288D40(arg0, 0.98f, func_80387424, arg1); + func_80361D7C(arg0, 0.99f, arg1, 5, 0x9680C3U); +} + +void func_8038AC54(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 3, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 4, 2); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 5, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 6, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 7, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 9, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 8, 1); + func_80361D7C(arg0, 0.06f, arg1, 5, 0x03EA809CU); + func_80361D7C(arg0, 0.12f, arg1, 5, 0x4E9E9CU); + func_80361D7C(arg0, 0.24f, arg1, 5, 0x019080C3U); + func_80361D7C(arg0, 0.32f, arg1, 5, 0x019088C3U); + func_80361D7C(arg0, 0.36f, arg1, 5, 0x01908CC3U); + func_80361D7C(arg0, 0.44f, arg1, 5, 0x4C809CU); + func_80361D7C(arg0, 0.44f, arg1, 5, 0x9780EAU); + func_80361D7C(arg0, 0.47f, arg1, 5, 0x4C809CU); + func_80361D7C(arg0, 0.55f, arg1, 5, 0x019080C3U); + func_80361D7C(arg0, 0.6f, arg1, 5, 0x4C809CU); + func_80361D7C(arg0, 0.62f, arg1, 5, 0x019088C3U); + func_80361D7C(arg0, 0.65f, arg1, 5, 0x4C809CU); +} + +void func_8038AF5C(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 8, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 3, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 4, 2); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 5, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 6, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 7, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 9, 0); +} + +void func_8038B098(s32 arg0, s32 arg1) { + f32 sp34 = 0.8f; + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, reinterpret_cast(s32, arg1), 3, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 4, 2); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 5, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 6, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 7, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 9, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 8, 1); + func_8028913C(arg0, 1); + func_80288D84(arg0, 0.01f, func_80386A90, arg1, reinterpret_cast(s32, sp34)); +} + +void func_8038B214(s32 arg0, s32 arg1) { + func_80288FD8(arg0, 0.03f, 0xA40000U); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 3, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 4, 2); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 5, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 6, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 7, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 9, 1); + func_80288F78(arg0, 0.21f, 0x3780C3U); + func_80288F78(arg0, 0.04f, 0x018F80FAU); + func_80288EB0(arg0, 0.59f, 0, 10.0f, 0.95f); + func_80288F78(arg0, 0.59f, 0x1180C3U); + func_80288F78(arg0, 0.59f, 0xD80C3U); + func_80288F78(arg0, 0.6f, 0x3680C3U); + func_80288FA8(arg0, 0.99f, 0xA4); +} + +void func_8038B404(s32 arg0, s32 arg1) { + func_80288FD8(arg0, 0.03f, 0xA70000U); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 3, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 4, 2); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 5, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 6, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 7, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.01f, arg1, 9, 1); + func_80361D7C(arg0, 0.4f, arg1, 5, 0x218CFAU); + func_80361D7C(arg0, 0.49f, arg1, 5, 0x2193FAU); + func_80361D7C(arg0, 0.58f, arg1, 5, 0x2195FAU); + func_80361D7C(arg0, 0.66f, arg1, 5, 0x6280FAU); + func_80288FA8(arg0, 0.73f, 0xA7); + func_80288FD8(arg0, 0.73f, 0x570000U); +} + +void func_8038B5FC(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.0f, arg1, 3, 0); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.0f, arg1, 4, 2); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.0f, arg1, 5, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.0f, arg1, 6, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.0f, arg1, 7, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.0f, arg1, 9, 1); + func_8028913C(arg0, 1); + func_80361C64(arg0, 0.0f, arg1, 8, 1); +} + +void func_8038B744(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.01f, arg1, 6, 0); + func_80361C64(arg0, 0.01f, arg1, 4, 0); + func_80361C64(arg0, 0.01f, arg1, 5, 0); +} + +void func_8038B7B4(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.01f, arg1, 6, 0); + func_80361C64(arg0, 0.01f, arg1, 4, 0); + func_80361C64(arg0, 0.01f, arg1, 5, 0); + func_80288FD8(arg0, 0.03f, 0xA50000); + func_80288EF8(arg0, 0.07f, 2, 5.0f); + func_80288F78(arg0, 0.1f, 0x013159EAU); + func_80288F38(arg0, 0.51f, 2, 0.8f); + func_80288F78(arg0, 0.97f, 0x1F809CU); + func_80288FA8(arg0, 0.99f, 0xA5); +} + + +void func_8038B8B8(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.01f, arg1, 6, 0); + func_80361C64(arg0, 0.01f, arg1, 4, 1); + func_80361C64(arg0, 0.01f, arg1, 5, 1); + func_80288F78(arg0, 0.09f, 0x288075U); + func_80288F78(arg0, 0.12f, 0x288075U); + func_80288F78(arg0, 0.15f, 0x287975U); + func_80288F78(arg0, 0.18f, 0x287975U); + func_80288D40(arg0, 0.4f, func_803878A4, arg1); +} + +void func_8038B9B4(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.01f, reinterpret_cast(s32, arg1), 6, 0); + func_80361C64(arg0, 0.01f, arg1, 4, 1); + func_80361C64(arg0, 0.01f, arg1, 5, 1); + func_80288F78(arg0, 0.068f, 0x6180C3U); + func_80288F78(arg0, 0.66f, 0x1F8075U); + func_80288EB0(arg0, 0.66f, 0, 20.0f, 0.8f); + func_80288D40(arg0, 0.7f, func_803878A4, arg1); + func_80288F78(arg0, 0.76f, 0x1F8075U); + func_80288D40(arg0, 0.77f, func_803879E0, arg1); + func_80288D40(arg0, 0.86f, func_803879E0, arg1); + func_80288EB0(arg0, 0.86f, 0, 20.0f, 0.9f); + func_80288D40(arg0, 0.96f, func_803879E0, arg1); +} + + +void func_8038BB30(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.01f, arg1, 6, 0); + func_80361C64(arg0, 0.01f, arg1, 4, 1); + func_80361C64(arg0, 0.01f, arg1, 5, 1); + func_80288F78(arg0, 0.3f, 0x698075U); + func_80288F78(arg0, 0.6f, 0x698675U); + func_80288F78(arg0, 0.94f, 0x697975U); +} + +void func_8038BBF8(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.01f, arg1, 6, 1); + func_80288F78(arg0, 0.5f, 0x21809CU); + func_80288EB0(arg0, 0.5f, 0, 5.0f, 0.9f); + func_80288F78(arg0, 0.56f, 0x21839CU); + func_80288EB0(arg0, 0.56f, 0, 5.0f, 0.9f); + func_80288F78(arg0, 0.65f, 0x217C9CU); + func_80288EB0(arg0, 0.65f, 0, 5.0f, 0.9f); + func_80288F78(arg0, 0.76f, 0xD3739CU); + func_80288F78(arg0, 0.83f, 0xD3799CU); + func_80288F78(arg0, 0.9f, 0xD3669CU); +} + +void func_8038BD2C(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.01f, arg1, 6, 0); + func_80361C64(arg0, 0.01f, arg1, 4, 0); + func_80361C64(arg0, 0.01f, arg1, 5, 0); +} + +void func_8038BD9C(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.01f, arg1, 6, 1); + func_80361C64(arg0, 0.01f, arg1, 4, 1); + func_80361C64(arg0, 0.01f, arg1, 5, 1); + func_80288F78(arg0, 0.85f, 0x666C3U); +} + +void func_8038BE30(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.01f, arg1, 6, 1); + func_80288F78(arg0, 0.32f, 0x03F280C3U); + func_80288F78(arg0, 0.4f, 0x1F8055U); + func_80288F78(arg0, 0.44f, 0x03F280C3U); + func_80288F78(arg0, 0.5f, 0x1F8655U); + func_80288F78(arg0, 0.54f, 0x03F280C3U); + func_80288F78(arg0, 0.6f, 0x1F7955U); + func_80288F78(arg0, 0.82f, 0x280FAU); + func_80288F78(arg0, 0.87f, 0x7805DU); + func_80288F78(arg0, 0.92f, 0x7865DU); + func_80288F78(arg0, 0.96f, 0x7805DU); +} + +void func_8038BF5C(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.01f, reinterpret_cast(s32, arg1), 4, 1); + func_8028913C(arg0, 1); + func_80288D08(arg0, 0.05f, func_80386924); + func_80288D40(arg0, 0.05f, func_80387B58, arg1); + func_80288D40(arg0, 0.15f, func_80387B58, arg1); + func_80288D40(arg0, 0.25f, func_80387B58, arg1); + func_80288D40(arg0, 0.35f, func_80387B58, arg1); + func_80288D40(arg0, 0.45f, func_80387B58, arg1); + func_80288D40(arg0, 0.55f, func_80387B58, arg1); + func_80288D40(arg0, 0.65f, func_80387B58, arg1); + func_80288D40(arg0, 0.75f, func_80387B58, arg1); + func_80288D40(arg0, 0.85f, func_80387B58, arg1); + func_80288D40(arg0, 0.95f, func_80387B58, arg1); + func_8028913C(arg0, 0x14); + func_80288D08(arg0, 0.05f, func_80386A00); +} + +void func_8038C0DC(s32 arg0, s32 arg1) { + func_80361C64(arg0, 0.01f, arg1, 4, 1); + func_8028913C(arg0, 1); + func_80288D08(arg0, 0.02f, func_80386990); + func_80288F78(arg0, 0.25f, 0x8C80C3U); + func_80288F78(arg0, 0.66f, 0x8C86C3U); +} + + +void func_8038C16C(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.2f, 0x17808CU); +} + +void func_8038C19C(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80288D08(arg0, 0.02f, func_803863F0); + func_8028913C(arg0, 1); + func_80288D08(arg0, 0.97f, func_80386410); +} + +void func_8038C200(s32 arg0, s32 arg1) { + func_8028913C(arg0, 1); + func_80288D08(arg0, 0.02f, func_8038645C); + func_8028913C(arg0, 1); + func_80288D08(arg0, 0.97f, func_80386484); +} + + +void func_8038C264(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.2f, 0x98808CU); + func_80288F78(arg0, 0.27f, 0x98868CU); + func_80288F78(arg0, 0.5f, 0x98798CU); + func_80288F78(arg0, 0.65f, 0x98868CU); + func_80288F78(arg0, 0.9f, 0x98808CU); + func_80288F78(arg0, 0.95f, 0x98798CU); +} + + +void func_8038C314(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.14f, 0x3F803EU); + func_80288F78(arg0, 0.75f, 0x40803EU); +} + + +void func_8038C35C(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.09f, 0xD0668CU); + func_80288F78(arg0, 0.25f, 0xD0338CU); + func_80288F78(arg0, 0.84f, 0x3F868CU); +} + +void func_8038C3BC(s32 arg0, s32 arg1) { + func_80288FD8(arg0, 0.01f, 0x430000); + func_80288D08(arg0, 0.4f, func_80386434); +} + +void func_8038C404(s32 arg0, s32 arg1) { + func_80288F78(arg0, 0.74f, 0x1580FAU); + func_80288D40(arg0, 0.74f, func_80387FC0, arg1); +} + +void func_8038C454(s32 arg0, s32 arg1) { + func_80288D40(arg0, 0.2f, func_803881CC, arg1); + func_80288F78(arg0, 0.2f, 0x1E808CU); + func_80288D40(arg0, 0.3f, func_803881CC, arg1); + func_80288D40(arg0, 0.35f, func_803881CC, arg1); +} diff --git a/src/cutscenes/code_60F0.c b/src/cutscenes/code_60F0.c new file mode 100644 index 00000000..01a9ee60 --- /dev/null +++ b/src/cutscenes/code_60F0.c @@ -0,0 +1,687 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802E07E0(Actor *); +extern Actor* func_802E0738(ActorMarker *, Gfx **, Mtx**, Vtx **); + +extern ActorInfo D_80366CD0; +extern ActorInfo D_8038E718; +extern ActorInfo D_8038E7A0; +extern ActorInfo D_8038E8A8; + + +/* .data */ +ActorInfo D_8038DC90 = +{ + 0x017, 0x08E, 0x355, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 5.0f, 0 +}; + +ActorInfo D_8038DCB4 = +{ + 0x01A, 0x091, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DCD8 = +{ + 0x019, 0x090, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DCFC = +{ + 0x018, 0x08F, 0x3B1, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 5.0f, 0 +}; + +ActorInfo D_8038DD20 = +{ + 0x01B, 0x092, 0x35A, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 3.0f, 0 +}; + +ActorInfo D_8038DD44 = +{ + 0x01C, 0x093, 0x3A6, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DD68 = +{ + 0x01D, 0x094, 0x3A7, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DD8C = +{ + 0x01E, 0x095, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DDB0 = +{ + 0x01F, 0x096, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DDD4 = +{ + 0x020, 0x097, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DDF8 = +{ + 0x021, 0x098, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DE1C = +{ + 0x022, 0x099, 0x3AA, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DE40 = +{ + 0x023, 0x09A, 0x3AB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DE64 = +{ + 0x024, 0x09B, 0x354, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 3.0f, 0 +}; + +ActorInfo D_8038DE88 = +{ + 0x025, 0x09C, 0x369, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.4f, 0 +}; + +ActorInfo D_8038DEAC = +{ + 0x026, 0x09D, 0x353, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 4.0f, 0 +}; + +ActorInfo D_8038DED0 = +{ + 0x027, 0x09E, 0x53D, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DEF4 = +{ + 0x06F, 0x09F, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DF18 = +{ + 0x070, 0x0A0, 0x34D, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DF3C = +{ + 0x071, 0x0A1, 0x3AC, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DF60 = +{ + 0x073, 0x0A3, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DF84 = +{ + 0x074, 0x0A4, 0x433, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DFA8 = +{ + 0x075, 0x0A5, 0x3ED, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038DFCC = +{ + 0x076, 0x0A6, 0x398, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.5f, 0 +}; + +ActorInfo D_8038DFF0 = +{ + 0x077, 0x0A7, 0x473, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E014 = +{ + 0x078, 0x0A8, 0x474, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E038 = +{ + 0x079, 0x0A9, 0x454, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E05C = +{ + 0x07A, 0x0AA, 0x453, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E080 = +{ + 0x07B, 0x0AB, 0x452, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E0A4 = +{ + 0x07C, 0x0AC, 0x451, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E0C8 = +{ + 0x07D, 0x0AD, 0x3CA, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E0EC = +{ + 0x07E, 0x0AE, 0x450, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E110 = +{ + 0x07F, 0x0AF, 0x44F, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E134 = +{ + 0x080, 0x0B0, 0x387, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E158 = +{ + 0x081, 0x0B1, 0x388, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E17C = +{ + 0x082, 0x0B2, 0x347, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E1A0 = +{ + 0x084, 0x0B4, 0x35B, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E1C4 = +{ + 0x085, 0x0B5, 0x456, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E1E8 = +{ + 0x086, 0x0B6, 0x457, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E20C = +{ + 0x087, 0x0B7, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E230 = +{ + 0x088, 0x0B8, 0x458, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E254 = +{ + 0x089, 0x0B9, 0x459, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E278 = +{ + 0x08A, 0x0BA, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E29C = +{ + 0x08B, 0x0BB, 0x45B, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E2C0 = +{ + 0x08E, 0x0BE, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E2E4 = +{ + 0x08F, 0x0BF, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E308 = +{ + 0x090, 0x0C0, 0x460, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E32C = +{ + 0x091, 0x0C1, 0x467, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E350 = +{ + 0x092, 0x0C2, 0x468, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E374 = +{ + 0x093, 0x0C3, 0x469, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E398 = +{ + 0x136, 0x2ED, 0x340, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E3BC = +{ + 0x137, 0x2EE, 0x46A, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E3E0 = +{ + 0x138, 0x2EF, 0x35B, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E404 = +{ + 0x139, 0x2F0, 0x341, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E428 = +{ + 0x13A, 0x2F1, 0x46B, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E44C = +{ + 0x13B, 0x2F2, 0x340, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E470 = +{ + 0x13C, 0x2F3, 0x46D, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E494 = +{ + 0x143, 0x2FA, 0x46A, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E4B8 = +{ + 0x144, 0x2FB, 0x532, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E4DC = +{ + 0x145, 0x2FC, 0x3C6, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E500 = +{ + 0x146, 0x2FD, 0x3B0, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E524 = +{ + 0x147, 0x2FE, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E548 = +{ + 0x148, 0x2FF, 0x461, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E56C = +{ + 0x149, 0x300, 0x479, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E590 = +{ + 0x14A, 0x301, 0x370, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E5B4 = +{ + 0x14B, 0x302, 0x47B, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E5D8 = +{ + 0x14C, 0x303, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E5FC = +{ + 0x14D, 0x304, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E620 = +{ + 0x14E, 0x305, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E644 = +{ + 0x14F, 0x306, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E668 = +{ + 0x150, 0x307, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E68C = +{ + 0x151, 0x308, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E6B0 = +{ + 0x152, 0x309, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + +ActorInfo D_8038E6D4 = +{ + 0x153, 0x30A, 0x3BB, + 1, NULL, + NULL, func_802E07E0, func_802E0738, + 0, 0, 0.0f, 0 +}; + + +void func_8038C4E0(void){ + spawnableActorList_add(&D_8038DC90, actor_new, 0X40); + spawnableActorList_add(&D_8038DCFC, actor_new, 0X140); + spawnableActorList_add(&D_8038DCD8, actor_new, 0X2000); + spawnableActorList_add(&D_8038DCB4, actor_new, 0X2000); + spawnableActorList_add(&D_8038DD20, actor_new, 0X100); + spawnableActorList_add(&D_8038DD44, actor_new, 8); + spawnableActorList_add(&D_8038DD68, actor_new, 0X48); + spawnableActorList_add(&D_8038DD8C, actor_new, 0); + spawnableActorList_add(&D_8038DDB0, actor_new, 0); + spawnableActorList_add(&D_8038DDD4, actor_new, 0); + spawnableActorList_add(&D_8038DDF8, actor_new, 0); + spawnableActorList_add(&D_8038DE1C, actor_new, 0); + spawnableActorList_add(&D_8038DE40, actor_new, 0); + spawnableActorList_add(&D_8038DE64, actor_new, 0); + spawnableActorList_add(&D_8038DE88, actor_new, 0); + spawnableActorList_add(&D_8038DEAC, actor_new, 0); + spawnableActorList_add(&D_8038DED0, actor_new, 0X8648); + spawnableActorList_add(&D_8038DEF4, actor_new, 0); + spawnableActorList_add(&D_8038DF18, actor_new, 0); + spawnableActorList_add(&D_8038DF3C, actor_new, 0); + spawnableActorList_add(&D_8038DF60, actor_new, 0X2008); + spawnableActorList_add(&D_8038DF84, actor_new, 0); + spawnableActorList_add(&D_8038DFA8, actor_new, 0X148); + spawnableActorList_add(&D_8038DFCC, actor_new, 0); + spawnableActorList_add(&D_8038DFF0, actor_new, 0X8748); + spawnableActorList_add(&D_8038E014, actor_new, 0X140); + spawnableActorList_add(&D_8038E038, actor_new, 8); + spawnableActorList_add(&D_8038E05C, actor_new, 8); + spawnableActorList_add(&D_8038E080, actor_new, 8); + spawnableActorList_add(&D_8038E0A4, actor_new, 0X8608); + spawnableActorList_add(&D_8038E0C8, actor_new, 0); + spawnableActorList_add(&D_8038E0EC, actor_new, 0X8748); + spawnableActorList_add(&D_8038E110, actor_new, 0X3008); + spawnableActorList_add(&D_8038E134, actor_new, 0X140); + spawnableActorList_add(&D_8038E158, actor_new, 0X40); + spawnableActorList_add(&D_8038E17C, actor_new, 0X1000); + spawnableActorList_add(&D_8038E1A0, actor_new, 0X140); + spawnableActorList_add(&D_8038E1C4, actor_new, 8); + spawnableActorList_add(&D_8038E1E8, actor_new, 0X8608); + spawnableActorList_add(&D_8038E20C, actor_new, 0X8608); + spawnableActorList_add(&D_8038E230, actor_new, 0X40); + spawnableActorList_add(&D_8038E254, actor_new, 8); + spawnableActorList_add(&D_8038E278, actor_new, 0); + spawnableActorList_add(&D_8038E29C, actor_new, 0X100); + spawnableActorList_add(&D_8038E2C0, actor_new, 0); + spawnableActorList_add(&D_8038E2E4, actor_new, 0); + spawnableActorList_add(&D_8038E308, actor_new, 0X8608); + spawnableActorList_add(&D_8038E32C, actor_new, 0); + spawnableActorList_add(&D_8038E350, actor_new, 0X8608); + spawnableActorList_add(&D_8038E374, actor_new, 0X100); + spawnableActorList_add(&D_8038E398, actor_new, 0X1048); + spawnableActorList_add(&D_8038E3BC, actor_new, 0X100); + spawnableActorList_add(&D_8038E3E0, actor_new, 0X140); + spawnableActorList_add(&D_8038E404, actor_new, 0X40); + spawnableActorList_add(&D_8038E428, actor_new, 0X1000); + spawnableActorList_add(&D_8038E44C, actor_new, 0X40); + spawnableActorList_add(&D_8038E470, actor_new, 0X9608); + spawnableActorList_add(&D_8038E494, actor_new, 0X100); + spawnableActorList_add(&D_8038E4B8, actor_new, 0X40); + spawnableActorList_add(&D_8038E4DC, actor_new, 0X40); + spawnableActorList_add(&D_8038E500, actor_new, 0); + spawnableActorList_add(&D_8038E524, actor_new, 0X100); + spawnableActorList_add(&D_8038E548, actor_new, 0X9600); + spawnableActorList_add(&D_8038E56C, actor_new, 0); + spawnableActorList_add(&D_8038E590, actor_new, 0X8748); + spawnableActorList_add(&D_8038E5B4, actor_new, 0X8608); + spawnableActorList_add(&D_8038E5D8, actor_new, 0); + spawnableActorList_add(&D_8038E5FC, actor_new, 0); + spawnableActorList_add(&D_8038E620, actor_new, 0); + spawnableActorList_add(&D_8038E644, actor_new, 0); + spawnableActorList_add(&D_8038E668, actor_new, 0); + spawnableActorList_add(&D_8038E68C, actor_new, 0); + spawnableActorList_add(&D_8038E6B0, actor_new, 0); + spawnableActorList_add(&D_8038E6D4, actor_new, 0); + spawnableActorList_add(&D_80366CD0, actor_new, 0); + spawnableActorList_add(&D_8038E718, actor_new, 2); + spawnableActorList_add(&D_8038E7A0, actor_new, 0X8648); + spawnableActorList_add(&D_8038E8A8, actor_new, 2); +} diff --git a/src/cutscenes/code_6730.c b/src/cutscenes/code_6730.c new file mode 100644 index 00000000..cc4694dc --- /dev/null +++ b/src/cutscenes/code_6730.c @@ -0,0 +1,97 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + ParticleEmitter *unk0; +}ActorLocal_cutscenes_6730; + +void func_8038CCA8(Actor *); +Actor* func_8038CBCC(ActorMarker *, Gfx **, Mtx**, Vtx **); + +/* .data */ +extern ActorAnimationInfo D_8038E700[] ={ + {0x000, 0.0f}, + {0x168, 10000.0f}, + {0x168, 3.0f} +}; + +extern ActorInfo D_8038E718 = { + 0x1F8, 0x1E8, 0x439, + 1, D_8038E700, + func_8038CCA8, func_80326224, func_8038CBCC, + 0, 0, 0.0f, 0 +}; + +extern s32 D_8038E73C[3] = {0xff, 0xff, 0xff}; + +extern struct31s D_8038E748 = { + {0.1f, 0.3f}, + {0.0f, 0.0f}, + {0.0f, 0.01f}, + {1.4f, 1.5f}, + 0.05f, 0.9f +}; + +extern struct41s D_8038E770 ={ + { {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f} }, + { {0.0f, -200.0f, 0.0f}, {0.0f, -200.0f, 0.0f} } +}; + +/* .code */ +void func_8038CB20(ParticleEmitter *pCtrl){ + particleEmitter_setSprite(pCtrl, ASSET_713_SPRITE_SPARKLE_YELLOW); + func_802EFFA8(pCtrl, D_8038E73C); + func_802EF9E4(pCtrl, 230); + func_802EFE24(pCtrl, -600.0f, -600.0f,-600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038E770); + func_802EFB98(pCtrl, &D_8038E748); + func_802EFA70(pCtrl, 4); + func_802F0D54(pCtrl); +} + +Actor* func_8038CBCC(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *actor = func_80325888(marker, gfx, mtx, vtx); + ActorLocal_cutscenes_6730 *local = (ActorLocal_cutscenes_6730 *)&actor->local; + f32 sp3C[3]; + int i; + + if(marker->unk14_21 && actor->state == 2){ + for(i = 5; i < 0xF; i++){ + if(randf() < 0.8){ + func_8034A174(func_80329934(), i, sp3C); + particleEmitter_setPosition(local->unk0, sp3C); + particleEmitter_emitN(local->unk0, 1); + } + } + } + return actor; +} + +void func_8038CCA8(Actor *this){ + f32 sp24 = time_getDelta(); + ActorLocal_cutscenes_6730 *local = (ActorLocal_cutscenes_6730 *)&this->local; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + animctrl_setSmoothTransition(this->animctrl, 0); + this->unk60 = this->yaw/4; + local->unk0 = partEmitList_pushNew(0xA0); + func_8038CB20(local->unk0); + } + + switch(this->state){ + case 1: + this->unk60 = MAX(0.0, this->unk60 - sp24); + if(0.0f == this->unk60){ + func_80328AC8(this, 2); + actor_playAnimationOnce(this); + } + break; + case 2://L8038CDA4 + if(actor_animationIsAt(this, 0.999f)){ + marker_despawn(this->marker); + } + break; + } +} diff --git a/src/cutscenes/code_69F0.c b/src/cutscenes/code_69F0.c new file mode 100644 index 00000000..728da6ab --- /dev/null +++ b/src/cutscenes/code_69F0.c @@ -0,0 +1,106 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + ParticleEmitter *unk0; + ParticleEmitter *unk4; +} ActorLocal_cutscenes_69F0; + +extern void func_8038CF50(Actor *this); + +/* .data */ +ActorInfo D_8038E7A0 = { + 0x211, 0x341, 0x45D, + 1, NULL, + NULL, func_8038CF50, func_80325888, + 0, 0xA000, 0.0f, 0 +}; + +s32 D_8038E7C4[3] = {0xFF, 0xFF, 0xFF}; + +struct31s D_8038E7D0 = { + {0.7f, 0.9f}, + {0.4f, 0.5f}, + {0.0f, 0.01f}, + {0.4f, 0.7f}, + 0.15f, 0.3f +}; + +struct42s D_8038E7F8 ={ + { {-10.0f, -10.0f, -10.0f}, {10.0f, 10.0f, 10.0f} }, + { {0.0f, 30.0f, 0.0f}, {0.0f, 30.0f, 0.0f} } +}; + +s32 D_8038E828[3] = {0xFF, 0xFF, 0xFF}; + +struct31s D_8038E834 = { + {0.05f, 0.1f}, + {0.1f, 0.2f}, + {0.0f, 0.01f}, + {1.4f, 1.5f}, + 0.01f, 0.3f +}; + +struct42s D_8038E85C ={ + { {-5.0f, -5.0f, -5.0f}, {5.0f, 5.0f, 5.0f} }, + { {0.0f, 30.0f, 0.0f}, {0.0f, 30.0f, 0.0f} } +}; + + +/* .code */ +void func_8038CDE0(ParticleEmitter *pCtrl){ + particleEmitter_setSprite(pCtrl, ASSET_45A_SPRITE_GREEN_GLOW); + func_802EFFA8(pCtrl, D_8038E7C4); + func_802EF9E4(pCtrl, 0xff); + func_802EFE24(pCtrl, -600.0f, -600.0f,-600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038E7F8); + func_802EFB98(pCtrl, &D_8038E7D0); + func_802EFA78(pCtrl, 1); + func_802EFA70(pCtrl, 4); + func_802F0D54(pCtrl); +} + +void func_8038CE98(ParticleEmitter *pCtrl){ + particleEmitter_setSprite(pCtrl, ASSET_713_SPRITE_SPARKLE_YELLOW); + func_802EFFA8(pCtrl, D_8038E828); + func_802EF9E4(pCtrl, 0xff); + func_802EFE24(pCtrl, -600.0f, -600.0f,-600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setPositionAndVelocityRanges(pCtrl, &D_8038E85C); + func_802EFB98(pCtrl, &D_8038E834); + func_802EFA78(pCtrl, 1); + func_802EFA70(pCtrl, 4); + func_802F0D54(pCtrl); +} + +extern void func_8038CF50(Actor *this){ + ActorLocal_cutscenes_69F0 *local = (ActorLocal_cutscenes_69F0 *) &this->local; + f32 sp40[3]; + int i; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + local->unk0 = partEmitList_pushNew(6); + local->unk4 = partEmitList_pushNew(6); + + func_8038CDE0(local->unk0); + func_8038CE98(local->unk4); + }//L8038CFBC + + func_80343DEC(this); + + if(this->marker->unk14_21){ + for(i = 5; i < 6; i++){ + if(randf() < 0.4){ + func_8034A174(this->marker->unk44, i, sp40); + particleEmitter_setPosition(local->unk0, sp40); + particleEmitter_emitN(local->unk0, 1); + + particleEmitter_setPosition(local->unk4, sp40); + particleEmitter_emitN(local->unk4, 1); + + } + } + }//L8038D05C +} + diff --git a/src/cutscenes/code_6C90.c b/src/cutscenes/code_6C90.c new file mode 100644 index 00000000..c315ea5b --- /dev/null +++ b/src/cutscenes/code_6C90.c @@ -0,0 +1,98 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + ParticleEmitter *unk0; +}ActorLocal_cutscenes_6C90; + +void func_8038D218(Actor *); +Actor* func_8038D13C(ActorMarker *, Gfx **, Mtx**, Vtx **); + +/* .data */ +ActorAnimationInfo D_8038E890[] ={ + {0x000, 0.0f}, + {0x1F6, 10000.0f}, + {0x1F6, 5.0f}, +}; + +ActorInfo D_8038E8A8 = { + 0x212, 0x342, 0x45F, + 1, D_8038E890, + func_8038D218, func_80326224, func_8038D13C, + 3000, 0, 0.0f, 0 +}; + +s32 D_8038E8CC[3] = {0xff, 0xff, 0xff}; + +struct31s D_8038E8D8 = { + {0.6f, 0.6f}, + {0.9f, 0.9f}, + {0.0f, 0.01f}, + {2.0f, 2.0f}, + 0.05f, 0.9f +}; + +struct41s D_8038E900 = { + { {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}}, + { {0.0f, -30.0f, 0.0f}, {0.0f, -30.0f, 0.0f}} +}; + +/*.code */ +void func_8038D080(ParticleEmitter *pCtrl){ + particleEmitter_setSprite(pCtrl, ASSET_702_SPRITE_UNKNOWN); + particleEmitter_setStartingFrameRange(pCtrl, 3, 5); + func_802EFFA8(pCtrl, D_8038E8CC); + func_802EF9E4(pCtrl, 60); + func_802EFE24(pCtrl, -600.0f, -600.0f,-600.0f, 600.0f, 600.0f, 600.0f); + particleEmitter_setVelocityAndAccelerationRanges(pCtrl, &D_8038E900); + func_802EFB98(pCtrl, &D_8038E8D8); + func_802EFA70(pCtrl, 4); + func_802F0D54(pCtrl); +} + +Actor* func_8038D13C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + Actor *actor = func_80325888(marker, gfx, mtx, vtx); + ActorLocal_cutscenes_6C90 *local = (ActorLocal_cutscenes_6C90 *)&actor->local; + f32 sp3C[3]; + int i; + + if(marker->unk14_21 && actor->state == 2){ + for(i = 5; i < 0x6; i++){ + if(randf() < 0.8){ + func_8034A174(func_80329934(), i, sp3C); + particleEmitter_setPosition(local->unk0, sp3C); + particleEmitter_emitN(local->unk0, 1); + } + } + } + return actor; +} + +void func_8038D218(Actor *this){ + f32 sp24 = time_getDelta(); + ActorLocal_cutscenes_6C90 *local = (ActorLocal_cutscenes_6C90 *)&this->local; + + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + animctrl_setSmoothTransition(this->animctrl, 0); + this->unk60 = this->yaw/4; + local->unk0 = partEmitList_pushNew(0x100); + func_8038D080(local->unk0); + } + + switch(this->state){ + case 1: + this->unk60 = MAX(0.0, this->unk60 - sp24); + if(0.0f == this->unk60){ + func_80328AC8(this, 2); + actor_playAnimationOnce(this); + } + break; + case 2://L8038CDA4 + if(actor_animationIsAt(this, 0.999f)){ + marker_despawn(this->marker); + } + break; + } +} diff --git a/src/done/bk_boot_1050.c b/src/done/bk_boot_1050.c new file mode 100644 index 00000000..2932d9b1 --- /dev/null +++ b/src/done/bk_boot_1050.c @@ -0,0 +1,40 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "rarezip.h" + +#define ENTRY_STACK_LEN 0x2000 +#define ENTRY_STACK_LEN_U64 (ENTRY_STACK_LEN / sizeof(u64)) + +u64 gEntryStack[ENTRY_STACK_LEN_U64]; + +extern u8 core1_us_v10_rzip_ROM_START[]; +extern u8 core1_us_v10_rzip_ROM_END[]; +extern u8 D_8002D500; +extern u8 D_8023DA20; +extern u32 D_803FFE00[4]; + +void func_80000594(u8 *, u8 *); +void func_8023DA20(s32); + +void func_80000450(s32 arg0){ + u8 *tmp; + u8 *dst; + + tmp = &D_8002D500; + dst = &D_8023DA20; + osInitialize(); + osPiRawStartDma(OS_READ, core1_us_v10_rzip_ROM_START, tmp, core1_us_v10_rzip_ROM_END - core1_us_v10_rzip_ROM_START); + while(osPiGetStatus() & PI_STATUS_DMA_BUSY); + func_8000055C(); + func_80000594(&tmp, &dst); + D_803FFE00[0] = crc1; + D_803FFE00[1] = crc2; + func_80000594(&tmp, &dst); + D_803FFE00[2] = crc1; + D_803FFE00[3] = crc2; + overlay_table_init(); + (&func_8023DA20)(arg0); + +} diff --git a/src/done/cartrominit.c b/src/done/cartrominit.c new file mode 100644 index 00000000..b23a9d43 --- /dev/null +++ b/src/done/cartrominit.c @@ -0,0 +1,34 @@ +#include +#include "functions.h" +#include "variables.h" + +OSPiHandle CartRomHandle; +OSPiHandle *osCartRomInit(void) +{ + u32 domain; + u32 saveMask; + + domain = 0; + + if (CartRomHandle.baseAddress == PHYS_TO_K1(PI_DOM1_ADDR2)) + return &CartRomHandle; + + CartRomHandle.type = DEVICE_TYPE_CART; + CartRomHandle.baseAddress = PHYS_TO_K1(PI_DOM1_ADDR2); + osPiRawReadIo(NULL, &domain); + CartRomHandle.latency = domain & 0xff; + CartRomHandle.pulse = (domain >> 8) & 0xff; + CartRomHandle.pageSize = (domain >> 0x10) & 0xf; + CartRomHandle.relDuration = (domain >> 0x14) & 0xf; + CartRomHandle.domain = PI_DOMAIN1; + CartRomHandle.speed = 0; + + bzero(&CartRomHandle.transferInfo, sizeof(__OSTranxInfo)); + + saveMask = __osDisableInt(); + CartRomHandle.next = __osPiTable; + __osPiTable = &CartRomHandle; + __osRestoreInt(saveMask); + + return &CartRomHandle; +} diff --git a/src/done/createmesgqueue.c b/src/done/createmesgqueue.c new file mode 100644 index 00000000..683ffc0c --- /dev/null +++ b/src/done/createmesgqueue.c @@ -0,0 +1,15 @@ +#include +#include "functions.h" +#include "variables.h" + +extern OSThread __osThreadTail; + +void osCreateMesgQueue(OSMesgQueue *mq, OSMesg *msg, s32 msgCount) +{ + mq->mtqueue = (OSThread *)&__osThreadTail; + mq->fullqueue = (OSThread *)&__osThreadTail; + mq->validCount = 0; + mq->first = 0; + mq->msgCount = msgCount; + mq->msg = msg; +} diff --git a/src/done/createthread.c b/src/done/createthread.c new file mode 100644 index 00000000..889830f4 --- /dev/null +++ b/src/done/createthread.c @@ -0,0 +1,32 @@ +#include +#include "functions.h" +#include "variables.h" + +#define __osCleanupThread __osCleanupThread + +void __osCleanupThread(void); +extern OSThread *__osActiveQueue; +void osCreateThread(OSThread *t, OSId id, void (*entry)(void *), void *arg, void *sp, OSPri p) +{ + register u32 saveMask; + OSIntMask mask; + t->id = id; + t->priority = p; + t->next = NULL; + t->queue = NULL; + t->context.pc = (u32)entry; + t->context.a0 = (u64)arg; + t->context.sp = (u64)sp - 16; + t->context.ra = (u64)__osCleanupThread; + mask = OS_IM_ALL; + t->context.sr = SR_IMASK | SR_EXL | SR_IE; + t->context.rcp = (mask & RCP_IMASK) >> RCP_IMASKSHIFT; + t->context.fpcsr = (u32)(FPCSR_FS | FPCSR_EV); + t->fp = 0; + t->state = OS_STATE_STOPPED; + t->flags = 0; + saveMask = __osDisableInt(); + t->tlnext = __osActiveQueue; + __osActiveQueue = t; + __osRestoreInt(saveMask); +} diff --git a/src/done/destroythread.c b/src/done/destroythread.c new file mode 100644 index 00000000..03182f46 --- /dev/null +++ b/src/done/destroythread.c @@ -0,0 +1,45 @@ +#include +#include "osint.h" + +void osDestroyThread(OSThread *t) +{ + register u32 saveMask; + register OSThread *pred; + register OSThread *succ; + saveMask = __osDisableInt(); + if (t == NULL) + { + t = __osRunningThread; + } + else + { + if (t->state != OS_STATE_STOPPED) + { + __osDequeueThread(t->queue, t); + } + } + if (__osActiveQueue == t) + { + __osActiveQueue = __osActiveQueue->tlnext; + } + else + { + pred = __osActiveQueue; + succ = pred->tlnext; + while (succ) + { + if (succ == t) + { + pred->tlnext = t->tlnext; + break; + } + pred = succ; + succ = pred->tlnext; + } + } + if (t == __osRunningThread) + { + __osDispatchThread(); + } + __osRestoreInt(saveMask); +} diff --git a/src/done/devmgr.c b/src/done/devmgr.c new file mode 100644 index 00000000..d0dc1c0b --- /dev/null +++ b/src/done/devmgr.c @@ -0,0 +1,113 @@ +#include +#include "piint.h" + +void __osDevMgrMain(void *args) +{ + OSIoMesg *mb; + OSMesg em; + OSMesg dummy; + s32 ret; + OSDevMgr *dm; + s32 messageSend; + + messageSend = 0; + mb = NULL; + ret = 0; + dm = (OSDevMgr *)args; + while (TRUE) + { + osRecvMesg(dm->cmdQueue, (OSMesg)&mb, OS_MESG_BLOCK); + if (mb->piHandle != NULL && + mb->piHandle->type == DEVICE_TYPE_64DD && + (mb->piHandle->transferInfo.cmdType == LEO_CMD_TYPE_0 || + mb->piHandle->transferInfo.cmdType == LEO_CMD_TYPE_1)) + { + __OSBlockInfo *blockInfo; + __OSTranxInfo *info; + info = &mb->piHandle->transferInfo; + blockInfo = &info->block[info->blockNum]; + info->sectorNum = -1; + if (info->transferMode != LEO_SECTOR_MODE) + { + blockInfo->dramAddr = (void *)((u32)blockInfo->dramAddr - blockInfo->sectorSize); + } + if (info->transferMode == LEO_TRACK_MODE && mb->piHandle->transferInfo.cmdType == LEO_CMD_TYPE_0) + messageSend = 1; + else + messageSend = 0; + osRecvMesg(dm->acsQueue, &dummy, OS_MESG_BLOCK); + __osResetGlobalIntMask(OS_IM_PI); + osEPiRawWriteIo(mb->piHandle, LEO_BM_CTL, (info->bmCtlShadow | 0x80000000)); + while (TRUE) + { + + osRecvMesg(dm->evtQueue, &em, OS_MESG_BLOCK); + info = &mb->piHandle->transferInfo; + blockInfo = &info->block[info->blockNum]; + if (blockInfo->errStatus == LEO_ERROR_29) + { + u32 stat; + osEPiRawWriteIo(mb->piHandle, LEO_BM_CTL, info->bmCtlShadow | LEO_BM_CTL_RESET); //TODO: remove magic constants + osEPiRawWriteIo(mb->piHandle, LEO_BM_CTL, info->bmCtlShadow); + osEPiRawReadIo(mb->piHandle, LEO_STATUS, &stat); + + if (stat & LEO_STATUS_MECHANIC_INTERRUPT) //TODO: remove magic constants + { + osEPiRawWriteIo(mb->piHandle, LEO_BM_CTL, info->bmCtlShadow | LEO_BM_CTL_CLR_MECHANIC_INTR); + } + + blockInfo->errStatus = LEO_ERROR_4; + IO_WRITE(PI_STATUS_REG, PI_CLR_INTR); + __osSetGlobalIntMask(OS_IM_PI | SR_IBIT4); + } + osSendMesg(mb->hdr.retQueue, mb, OS_MESG_NOBLOCK); + + if (messageSend != 1) + break; + if (mb->piHandle->transferInfo.block[0].errStatus != LEO_ERROR_GOOD) + break; + messageSend = 0; + } + osSendMesg(dm->acsQueue, NULL, OS_MESG_NOBLOCK); + if (mb->piHandle->transferInfo.blockNum == 1) + osYieldThread(); + } + else + { + switch (mb->hdr.type) + { + case OS_MESG_TYPE_DMAREAD: + osRecvMesg(dm->acsQueue, &dummy, OS_MESG_BLOCK); + ret = dm->dma(OS_READ, mb->devAddr, mb->dramAddr, mb->size); + break; + case OS_MESG_TYPE_DMAWRITE: + osRecvMesg(dm->acsQueue, &dummy, OS_MESG_BLOCK); + ret = dm->dma(OS_WRITE, mb->devAddr, mb->dramAddr, mb->size); + break; + case OS_MESG_TYPE_EDMAREAD: + osRecvMesg(dm->acsQueue, &dummy, OS_MESG_BLOCK); + ret = dm->edma(mb->piHandle, OS_READ, mb->devAddr, mb->dramAddr, + mb->size); + break; + case OS_MESG_TYPE_EDMAWRITE: + osRecvMesg(dm->acsQueue, &dummy, OS_MESG_BLOCK); + ret = dm->edma(mb->piHandle, OS_WRITE, mb->devAddr, mb->dramAddr, + mb->size); + break; + case OS_MESG_TYPE_LOOPBACK: + osSendMesg(mb->hdr.retQueue, mb, OS_MESG_NOBLOCK); + ret = -1; + break; + default: + ret = -1; + break; + } + if (ret == 0) + { + osRecvMesg(dm->evtQueue, &em, OS_MESG_BLOCK); + osSendMesg(mb->hdr.retQueue, mb, OS_MESG_NOBLOCK); + osSendMesg(dm->acsQueue, NULL, OS_MESG_NOBLOCK); + } + } + } +} diff --git a/src/done/epirawdma.c b/src/done/epirawdma.c new file mode 100644 index 00000000..8c316803 --- /dev/null +++ b/src/done/epirawdma.c @@ -0,0 +1,29 @@ +#include +#include "functions.h" +#include "variables.h" +#include "piint.h" + +extern OSPiHandle *__osCurrentHandle[2]; + +s32 osEPiRawStartDma(OSPiHandle *pihandle, s32 direction, u32 devAddr, void *dramAddr, u32 size) +{ + u32 stat; + u32 domain; + + EPI_SYNC(pihandle, stat, domain); + + IO_WRITE(PI_DRAM_ADDR_REG, osVirtualToPhysical(dramAddr)); + IO_WRITE(PI_CART_ADDR_REG, K1_TO_PHYS(pihandle->baseAddress | devAddr)); + switch (direction) + { + case OS_READ: + IO_WRITE(PI_WR_LEN_REG, size - 1); + break; + case OS_WRITE: + IO_WRITE(PI_RD_LEN_REG, size - 1); + break; + default: + return -1; + } + return 0; +} diff --git a/src/done/epirawread.c b/src/done/epirawread.c new file mode 100644 index 00000000..75766a72 --- /dev/null +++ b/src/done/epirawread.c @@ -0,0 +1,14 @@ +#include +#include +#include "piint.h" + +s32 osEPiRawReadIo(OSPiHandle *pihandle, u32 devAddr, u32 *data) +{ + register u32 stat; + register u32 domain; + + WAIT_ON_IOBUSY(stat); + + *data = IO_READ(pihandle->baseAddress | devAddr); + return 0; +} diff --git a/src/done/epirawwrite.c b/src/done/epirawwrite.c new file mode 100644 index 00000000..e7e474f0 --- /dev/null +++ b/src/done/epirawwrite.c @@ -0,0 +1,13 @@ +#include +#include "piint.h" + +s32 osEPiRawWriteIo(OSPiHandle *pihandle, u32 devAddr, u32 data) +{ + register u32 stat; + register u32 domain; + + WAIT_ON_IOBUSY(stat); + + IO_WRITE(pihandle->baseAddress | devAddr, data); + return 0; +} diff --git a/src/done/getthreadpri.c b/src/done/getthreadpri.c new file mode 100644 index 00000000..adb1da40 --- /dev/null +++ b/src/done/getthreadpri.c @@ -0,0 +1,11 @@ +#include +#include "functions.h" +#include "variables.h" +#include "osint.h" + +OSPri osGetThreadPri(OSThread *thread) +{ + if (thread == NULL) + thread = __osRunningThread; + return thread->priority; +} diff --git a/src/done/inflate.c b/src/done/inflate.c new file mode 100644 index 00000000..12594afd --- /dev/null +++ b/src/done/inflate.c @@ -0,0 +1,588 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "rarezip.h" + +u8 border[] = { /* Order of the bit length code lengths */ + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; +/*static*/ u16 cplens[] = { /* Copy lengths for literal codes 257..285 */ + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; + /* note: see note #13 above about the 258 in this list. */ + +/*static*/ u8 cplext[] = { /* Extra bits for literal codes 257..285 */ + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99}; /* 99==invalid */ + +/*static*/ u16 cpdist[] = { /* Copy offsets for distance codes 0..29 */ + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577}; + +/*static*/ u8 cpdext[] = { /* Extra bits for distance codes */ + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13}; + +u16 mask_bits[] = { + 0x0000, + 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, + 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff +}; + +s32 lbits = 9; +s32 dbits = 6; + +u8 *inbuf; +u8 *D_80007284; +u32 inptr; +u32 wp; +struct huft *D_80007290; //unk +u32 bb; +u32 bk; +u32 crc1; +u32 crc2; +u32 hufts; + +int huft_build(b, n, s, d, e, t, m) +unsigned *b; /* code lengths in bits (all assumed <= BMAX) */ +unsigned n; /* number of codes (assumed <= N_MAX) */ +unsigned s; /* number of simple-valued codes (0..s-1) */ +u16 *d; /* list of base values for non-simple codes */ +u16 *e; /* list of extra bits for non-simple codes */ +struct huft **t; /* result: starting table */ +int *m; /* maximum lookup bits, returns actual */ +/* Given a list of code lengths and a maximum table size, make a set of + tables to decode that set of codes. Return zero on success, one if + the given code set is incomplete (the tables are still built in this + case), two if the input is invalid (all zero length codes or an + oversubscribed set of lengths), and three if not enough memory. */ +{ + unsigned a; /* counter for codes of length k */ + unsigned c[BMAX+1]; /* bit length count table */ + unsigned f; /* i repeats in table every f entries */ + int g; /* maximum code length */ + int h; /* table level */ + register unsigned i; /* counter, current code */ + register unsigned j; /* counter */ + register int k; /* number of bits in current code */ + int l; /* bits per table (returned in m) */ + register unsigned *p; /* pointer into c[], b[], or v[] */ + register struct huft *q; /* points to current table */ + struct huft r; /* table entry for structure assignment */ + struct huft *u[BMAX]; /* table stack */ + unsigned v[N_MAX]; /* values in order of bit length */ + register int w; /* bits before this table == (l * h) */ + unsigned x[BMAX+1]; /* bit offsets, then code stack */ + unsigned *xp; /* pointer into x */ + int y; /* number of dummy codes added */ + unsigned z; /* number of entries in current table */ + + + /* Generate counts for each bit length */ + bzero(c, sizeof(c)); + p = b; i = n; + do { + c[*p]++; /* assume all entries <= BMAX */ + p++; /* Can't combine with above line (Solaris bug) */ + } while (--i); + if (c[0] == n) /* null input--all zero length codes */ + { + *t = (struct huft *)NULL; + *m = 0; + return 0; + } + + + /* Find minimum and maximum length, bound *m by those */ + l = *m; + for (j = 1; j <= BMAX; j++) + if (c[j]) + break; + k = j; /* minimum code length */ + if ((unsigned)l < j) + l = j; + for (i = BMAX; i; i--) + if (c[i]) + break; + g = i; /* maximum code length */ + if ((unsigned)l > i) + l = i; + *m = l; + + + /* Adjust last length count to fill out codes, if needed */ + for (y = 1 << j; j < i; j++, y <<= 1){ + (y -= c[j]); + } + y -= c[i]; + c[i] += y; + + + /* Generate starting offsets into the value table for each length */ + x[1] = j = 0; + p = c + 1; xp = x + 2; + while (--i) { /* note that i == g from above */ + *xp++ = (j += *p++); + } + + + /* Make a table of values in order of bit lengths */ + p = b; i = 0; + do { + if ((j = *p++) != 0) + v[x[j]++] = i; + } while (++i < n); + + + /* Generate the Huffman codes and for each, make the table entries */ + x[0] = i = 0; /* first Huffman code is zero */ + p = v; /* grab values in bit order */ + h = -1; /* no tables yet--level -1 */ + w = -l; /* bits decoded == (l * h) */ + u[0] = (struct huft *)NULL; /* just to keep compilers happy */ + q = (struct huft *)NULL; /* ditto */ + z = 0; /* ditto */ + + /* go through the bit lengths (k already is bits in shortest code) */ + for (; k <= g; k++) + { + a = c[k]; + while (a--) + { + /* here i is the Huffman code of length k bits for value *p */ + /* make tables up to required level */ + while (k > w + l) + { + h++; + w += l; /* previous table always l bits */ + + /* compute minimum size table less than or equal to l bits */ + z = (z = g - w) > (unsigned)l ? l : z; /* upper limit on table size */ + if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ + { /* too few codes for k-w bit table */ + f -= a + 1; /* deduct codes from patterns left */ + xp = c + k; + while (++j < z) /* try smaller tables up to z bits */ + { + if ((f <<= 1) <= *++xp) + break; /* enough codes to use up j bits */ + f -= *xp; /* else deduct codes from patterns */ + } + } + z = 1 << j; /* table entries for j-bit table */ + + /* allocate and link in new table */ + q = D_80007290 + hufts; + + hufts += z + 1; /* track memory usage */ + *t = q + 1; /* link to list for huft_free() */ + *(t = &(q->v.t)) = (struct huft *)NULL; + u[h] = ++q; /* table starts after link */ + + /* connect to last table, if there is one */ + if (h) + { + x[h] = i; /* save pattern for backing up */ + r.b = (u8)l; /* bits to dump before this table */ + r.e = (u8)(16 + j); /* bits in this table */ + r.v.t = q; /* pointer to this table */ + j = i >> (w - l); /* (get around Turbo C bug) */ + u[h-1][j] = r; /* connect to last table */ + } + } + + /* set up table entry in r */ + r.b = (u8)(k - w); + if (p >= v + n) + r.e = 99; /* out of values--invalid code */ + else if (*p < s) + { + r.e = (u8)(*p < 256 ? 16 : 15); /* 256 is end-of-block code */ + r.v.n = *p; /* simple code is just the value */ + p++; /* one compiler does not like *p++ */ + } + else + { + r.e = *((u8 *)e + (*p - s)); /* non-simple--look up in lists */ + r.v.n = d[*p++ - s]; + } + + /* fill code-like entries with r */ + f = 1 << (k - w); + for (j = i >> w; j < z; j += f) + q[j] = r; + + /* backwards increment the k-bit code i */ + for (j = 1 << (k - 1); i & j; j >>= 1) + i ^= j; + i ^= j; + + /* backup over finished tables */ + while ((i & ((1 << w) - 1)) != x[h]) + { + h--; /* don't need to update q */ + w -= l; + } + } + } + + + /* Return true (1) if we were given an incomplete table */ + return y != 0 && g != 1; +} + +//^inflate_codes +/* static */ int inflate_codes(struct huft *tl, struct huft *td, s32 bl, s32 bd) +{ + register unsigned e; /* table entry flag/number of extra bits */ + unsigned n, d; /* length and index for copy */ + unsigned w; /* current window position */ + struct huft *t; /* pointer to table entry */ + unsigned ml, md; /* masks for bl and bd bits */ + register u32 b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + register u8 tmp; + + /* make local copies of globals */ + b = bb; /* initialize bit buffer */ + k = bk; + w = wp; /* initialize window position */ + + /* inflate the coded data */ + ml = mask_bits[bl]; /* precompute masks for speed */ + md = mask_bits[bd]; + + for (;;) /* do until end of block */ + {//L80000D78 + NEEDBITS((unsigned)bl) + if ((e = (t = tl + ((unsigned)b & ml))->e) > 16) + do { + DUMPBITS(t->b) + e -= 16; + NEEDBITS(e) + } while ((e = (t = t->v.t + ((unsigned)b & mask_bits[e]))->e) > 16); + DUMPBITS(t->b) + if (e == 16) /* then it's a literal */ + { + + tmp = (u8)t->v.n; + D_80007284[w++] = tmp; + crc1 += tmp; + crc2 ^= tmp << (crc1 & 0x17); + } + else /* it's an EOB or a length */ + {//L80000EAC + /* exit if end of block */ + if (e == 15) + break; + + /* get length of block to copy */ + NEEDBITS(e) //L80000EAC - L80000ED8 + n = t->v.n + ((unsigned)b & mask_bits[e]); + DUMPBITS(e); + + /* decode distance of block to copy */ + NEEDBITS((unsigned)bd)//L80000F04 - L80000F2C + if ((e = (t = td + ((unsigned)b & md))->e) > 16) + do { + DUMPBITS(t->b) + e -= 16; + NEEDBITS(e) + } while ((e = (t = t->v.t + ((unsigned)b & mask_bits[e]))->e) > 16); + //L80000FC8 + DUMPBITS(t->b) + NEEDBITS(e) //L80000FE0 - L80001008 + d = w - t->v.n - ((unsigned)b & mask_bits[e]); + DUMPBITS(e) + + /* do the copy */ + do{ + tmp = D_80007284[d++]; + D_80007284[w++] = tmp; + crc1 += tmp; + crc2 ^= tmp << (crc1 & 0x17); + }while(--n); + } + } + /* restore the globals from the locals */ + wp = w; /* restore global window pointer */ + bb = b; /* restore global bit buffer */ + bk = k; + /* done */ + return 0; +} + +/* static */ int inflate_stored(void) +/* "decompress" an inflated type 0 (stored) block. */ +{ + unsigned n; /* number of bytes in block */ + unsigned w; /* current window position */ + register u32 b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + + /* make local copies of globals */ + b = bb; /* initialize bit buffer */ + k = bk; + w = wp; /* initialize window position */ + + + /* go to byte boundary */ + n = k & 7; + DUMPBITS(n); + + + /* get the length and its complement */ + NEEDBITS(16) + n = ((unsigned)b & 0xffff); + DUMPBITS(16) + NEEDBITS(16) + DUMPBITS(16) + + + /* read and output the compressed data */ + while (n--) + { + NEEDBITS(8) + D_80007284[w++] = (u8) b; + crc1 += b & 0xFF; + crc2 ^= (b &0xFF) << (crc1 & 0x17); + DUMPBITS(8) + } + + /* restore the globals from the locals */ + wp = w; /* restore global window pointer */ + bb = b; /* restore global bit buffer */ + bk = k; + return 0; +} + +/* static */ int inflate_fixed(void) +/* decompress an inflated type 1 (fixed Huffman codes) block. We should + either replace this with a custom decoder, or at least precompute the + Huffman tables. */ +{ + int i; /* temporary variable */ + struct huft *tl; /* literal/length code table */ + struct huft *td; /* distance code table */ + int bl; /* lookup bits for tl */ + int bd; /* lookup bits for td */ + unsigned l[288]; /* length list for huft_build */ + + + /* set up literal table */ + for (i = 0; i < 144; i++) + l[i] = 8; + for (; i < 256; i++) + l[i] = 9; + for (; i < 280; i++) + l[i] = 7; + for (; i < 288; i++) /* make a complete, but wrong code set */ + l[i] = 8; + bl = 7; + huft_build(l, 288, 257, cplens, cplext, &tl, &bl); + + /* set up distance table */ + for (i = 0; i < 30; i++) /* make an incomplete code set */ + l[i] = 5; + bd = 5; + huft_build(l, 30, 0, cpdist, cpdext, &td, &bd); + + /* decompress until an end-of-block code */ + inflate_codes(tl, td, bl, bd); + + return 0; +} + +/* static */ int inflate_dynamic(void)/* decompress an inflated type 2 (dynamic Huffman codes) block. */ +{ + int i; /* temporary variables */ + unsigned j; + unsigned l; /* last length */ + unsigned m; /* mask for bit lengths table */ + unsigned n; /* number of lengths to get */ + struct huft *tl; /* literal/length code table */ + struct huft *td; /* distance code table */ + int bl; /* lookup bits for tl */ + int bd; /* lookup bits for td */ + unsigned nb; /* number of bit length codes */ + unsigned nl; /* number of literal/length codes */ + unsigned nd; /* number of distance codes */ + + register unsigned k; /* number of bits in bit buffer */ + + register u32 b; /* bit buffer */ + + unsigned ll[286+30]; /* literal/length and distance code lengths */ + + /* make local bit buffer */ + b = bb; + k = bk; + + + /* read in table lengths */ + NEEDBITS(5) + nl = 257 + ((unsigned)b & 0x1f); /* number of literal/length codes */ + DUMPBITS(5) + NEEDBITS(5) + nd = 1 + ((unsigned)b & 0x1f); /* number of distance codes */ + DUMPBITS(5) + NEEDBITS(4) + nb = 4 + ((unsigned)b & 0xf); /* number of bit length codes */ + DUMPBITS(4) + + /* read in bit-length-code lengths */ + for (j = 0; j < nb; j++) + { + NEEDBITS(3) + ll[border[j]] = (unsigned)b & 7; + DUMPBITS(3) + } + for (; j < 19; j++) + ll[border[j]] = 0; + + + /* build decoding table for trees--single level, 7 bit lookup */ + bl = 7; + huft_build(ll, 19, 19, NULL, NULL, &tl, &bl); + + + /* read in literal and distance code lengths */ + n = nl + nd; + m = mask_bits[bl]; + i = l = 0; + while ((unsigned)i < n) + { + NEEDBITS((unsigned)bl) + j = (td = tl + ((unsigned)b & m))->b; + DUMPBITS(j) + j = td->v.n; + if (j < 16) /* length of code in bits (0..15) */ + ll[i++] = l = j; /* save last length in l */ + else if (j == 16) /* repeat last length 3 to 6 times */ + { + NEEDBITS(2) + j = 3 + ((unsigned)b & 3); + DUMPBITS(2) + while (j--) + ll[i++] = l; + } + else if (j == 17) /* 3 to 10 zero length codes */ + { + NEEDBITS(3) + j = 3 + ((unsigned)b & 7); + DUMPBITS(3) + while (j--) + ll[i++] = 0; + l = 0; + } + else /* j == 18: 11 to 138 zero length codes */ + { + NEEDBITS(7) + j = 11 + ((unsigned)b & 0x7f); + DUMPBITS(7) + while (j--) + ll[i++] = 0; + l = 0; + } + } + + /* restore the global bit buffer */ + bb = b; + bk = k; + + /* build the decoding tables for literal/length and distance codes */ + bl = lbits; + huft_build(ll, nl, 257, cplens, cplext, &tl, &bl); + bd = dbits; + huft_build(ll + nl, nd, 0, cpdist, cpdext, &td, &bd); + + /* decompress until an end-of-block code */ + inflate_codes(tl, td, bl, bd); + + return 0; +} + +/* static */ int inflate_block(int *e) +/* decompress an inflated block */ +{ + u32 t; /* block type */ + register u32 b; /* bit buffer */ + register unsigned k; /* number of bits in bit buffer */ + + + /* make local bit buffer */ + b = bb; + k = bk; + + + /* read in last block bit */ + NEEDBITS(1) + *e = (int)b & 1; + DUMPBITS(1) + + + /* read in block type */ + NEEDBITS(2) + t = (unsigned)b & 3; + DUMPBITS(2) + + + /* restore the global bit buffer */ + bb = b; + bk = k; + + + /* inflate that block type */ + if (t == 2) + return inflate_dynamic(); + if (t == 0) + return inflate_stored(); + if (t == 1) + return inflate_fixed(); + + + /* bad block type */ + return 2; +} + +/* decompress an inflated entry */ +int bkboot_inflate(void) //int inflate() +{ + int e; /* last block flag */ + int r; /* result code */ + unsigned h; /* maximum struct huft's malloc'ed */ + + /* initialize window, bit buffer */ + wp = 0; + bk = 0; + bb = 0; + + crc1 = 0; + crc2 = -1; + + /* decompress until the last block */ + h = 0; + do { + hufts = 0; + if ((r = inflate_block(&e)) != 0) + return r; + if (hufts > h) + h = hufts; + } while (!e); + + /* Undo too much lookahead. The next read will be byte aligned so we + * can discard unused bits in the last meaningful byte. + */ + while (bk >= 8) { + bk -= 8; + inptr--; + } + + /* return success */ + #ifdef DEBUG + fprintf(stderr, "<%u> ", h); + #endif /* DEBUG */ + return 0; +} diff --git a/src/done/initialize.c b/src/done/initialize.c new file mode 100644 index 00000000..dbc4f6e2 --- /dev/null +++ b/src/done/initialize.c @@ -0,0 +1,68 @@ +#include +#include "functions.h" +#include "variables.h" + +OSTime osClockRate = OS_CLOCK_RATE; +s32 osViClock = VI_NTSC_CLOCK; +u32 __osShutdown = 0; +u32 __OSGlobalIntMask = OS_IM_ALL; + +u32 __osFinalrom; + +typedef struct +{ + /* 0x0 */ unsigned int inst1; + /* 0x4 */ unsigned int inst2; + /* 0x8 */ unsigned int inst3; + /* 0xC */ unsigned int inst4; +} __osExceptionVector; +extern __osExceptionVector __osExceptionPreamble; + +// osInitialize +void __osInitialize_common() +{ + u32 pifdata; + u32 clock = 0; + __osFinalrom = TRUE; + __osSetSR(__osGetSR() | SR_CU1); //enable fpu + __osSetFpcCsr(FPCSR_FS | FPCSR_EV); //flush denorm to zero, enable invalid operation + + while (__osSiRawReadIo(PIF_RAM_END - 3, &pifdata)) //last byte of joychannel ram + { + ; + } + while (__osSiRawWriteIo(PIF_RAM_END - 3, pifdata | 8)) + { + ; //todo: magic contant + } + *(__osExceptionVector *)UT_VEC = __osExceptionPreamble; + *(__osExceptionVector *)XUT_VEC = __osExceptionPreamble; + *(__osExceptionVector *)ECC_VEC = __osExceptionPreamble; + *(__osExceptionVector *)E_VEC = __osExceptionPreamble; + osWritebackDCache((void *)UT_VEC, E_VEC - UT_VEC + sizeof(__osExceptionVector)); + osInvalICache((void *)UT_VEC, E_VEC - UT_VEC + sizeof(__osExceptionVector)); + osMapTLBRdb(); + osPiRawReadIo(4, &clock); //TODO: remove magic constant; + clock &= ~0xf; //clear lower 4 bits + if (clock != 0) + { + osClockRate = clock; + } + osClockRate = osClockRate * 3 / 4; + if (osResetType == 0 /*cold reset */) + { + bzero(osAppNMIBuffer, OS_APP_NMI_BUFSIZE); + } + if (osTvType == OS_TV_PAL) + { + osViClock = VI_PAL_CLOCK; + } + else if (osTvType == OS_TV_MPAL) + { + osViClock = VI_MPAL_CLOCK; + } + else + { + osViClock = VI_NTSC_CLOCK; + } +} diff --git a/src/done/kdebugserver.c b/src/done/kdebugserver.c new file mode 100644 index 00000000..3c42a6e9 --- /dev/null +++ b/src/done/kdebugserver.c @@ -0,0 +1,3 @@ +#include + +OSThread __osThreadSave; diff --git a/src/done/leodiskinit.c b/src/done/leodiskinit.c new file mode 100644 index 00000000..a0381c88 --- /dev/null +++ b/src/done/leodiskinit.c @@ -0,0 +1,29 @@ +#include +#include +#include + +OSPiHandle LeoDiskHandle; +OSPiHandle *__osDiskHandle; +OSPiHandle *osLeoDiskInit() +{ + u32 saveMask; + LeoDiskHandle.type = DEVICE_TYPE_64DD; + LeoDiskHandle.baseAddress = PHYS_TO_K1(PI_DOM2_ADDR1); + LeoDiskHandle.latency = 3; + LeoDiskHandle.pulse = 6; + LeoDiskHandle.pageSize = 6; + LeoDiskHandle.relDuration = 2; + LeoDiskHandle.domain = PI_DOMAIN2; + IO_WRITE(PI_BSD_DOM2_LAT_REG, LeoDiskHandle.latency); + IO_WRITE(PI_BSD_DOM2_PWD_REG, LeoDiskHandle.pulse); + IO_WRITE(PI_BSD_DOM2_PGS_REG, LeoDiskHandle.pageSize); + IO_WRITE(PI_BSD_DOM2_RLS_REG, LeoDiskHandle.relDuration); + LeoDiskHandle.speed = 0; + bzero(&LeoDiskHandle.transferInfo, sizeof(__OSTranxInfo)); + saveMask = __osDisableInt(); + LeoDiskHandle.next = __osPiTable; + __osPiTable = &LeoDiskHandle; + __osDiskHandle = &LeoDiskHandle; + __osRestoreInt(saveMask); + return &LeoDiskHandle; +} diff --git a/src/done/leointerrupt.c b/src/done/leointerrupt.c new file mode 100644 index 00000000..4e9a1b2f --- /dev/null +++ b/src/done/leointerrupt.c @@ -0,0 +1,215 @@ +#include +#include "osint.h" +#include "piint.h" + +#define WAIT_ON_IOBUSY2(stat) \ + stat = IO_READ(PI_STATUS_REG); \ + while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) \ + stat = IO_READ(PI_STATUS_REG); + +static void __osLeoResume(void); +static void __osLeoAbnormalResume(void); + +extern OSThread *__osRunQueue; +extern OSIntMask __OSGlobalIntMask; +extern OSPiHandle *__osDiskHandle; + +u8 leoDiskStack[OS_PIM_STACKSIZE]; + +s32 __osLeoInterrupt() +{ + u32 stat; + volatile u32 pi_stat; + u32 bm_stat; + __OSTranxInfo *info; + __OSBlockInfo *blockInfo; + stat = 0; + info = &__osDiskHandle->transferInfo; + blockInfo = &info->block[info->blockNum]; + pi_stat = IO_READ(PI_STATUS_REG); + if (pi_stat & PI_STATUS_DMA_BUSY) + { + __OSGlobalIntMask = __OSGlobalIntMask & ~SR_IBIT4; //cartridge interrupt + blockInfo->errStatus = LEO_ERROR_29; + __osLeoResume(); + return 1; + } + WAIT_ON_IOBUSY(pi_stat); + stat = IO_READ(LEO_STATUS); + if (stat & LEO_STATUS_MECHANIC_INTERRUPT) + { + WAIT_ON_IOBUSY(pi_stat); + IO_WRITE(LEO_BM_CTL, info->bmCtlShadow | LEO_BM_CTL_CLR_MECHANIC_INTR); + blockInfo->errStatus = LEO_ERROR_GOOD; + return 0; + } + if (info->cmdType == LEO_CMD_TYPE_2) + return 1; + if (stat & LEO_STATUS_BUFFER_MANAGER_ERROR) + { + WAIT_ON_IOBUSY(pi_stat); + stat = IO_READ(LEO_STATUS); + blockInfo->errStatus = LEO_ERROR_22; + __osLeoResume(); + IO_WRITE(PI_STATUS_REG, PI_STATUS_CLR_INTR); + __OSGlobalIntMask |= OS_IM_PI; + return 1; + } + if (info->cmdType == LEO_CMD_TYPE_1) + { + if ((stat & LEO_STATUS_DATA_REQUEST) == 0) + { + if (info->sectorNum + 1 != info->transferMode * 85) + { + blockInfo->errStatus = LEO_ERROR_24; + __osLeoAbnormalResume(); + return 1; + } + IO_WRITE(PI_STATUS_REG, PI_STATUS_CLR_INTR); + __OSGlobalIntMask |= OS_IM_PI; + blockInfo->errStatus = LEO_ERROR_GOOD; + __osLeoResume(); + return 1; + } + blockInfo->dramAddr = (void *)((u32)blockInfo->dramAddr + blockInfo->sectorSize); + info->sectorNum++; + osEPiRawStartDma(__osDiskHandle, OS_WRITE, LEO_SECTOR_BUFF, blockInfo->dramAddr, blockInfo->sectorSize); + return 1; + } + if (info->cmdType == LEO_CMD_TYPE_0) + { + if (info->transferMode == LEO_SECTOR_MODE) + { + if ((s32)blockInfo->C1ErrNum + 17 < info->sectorNum) + { + blockInfo->errStatus = LEO_ERROR_GOOD; + __osLeoAbnormalResume(); + return 1; + } + if ((stat & LEO_STATUS_DATA_REQUEST) == 0) + { + blockInfo->errStatus = LEO_ERROR_23; + __osLeoAbnormalResume(); + return 1; + } + } + else + { + blockInfo->dramAddr = (void *)((u32)blockInfo->dramAddr + blockInfo->sectorSize); + } + bm_stat = IO_READ(LEO_BM_STATUS); + if ((bm_stat & LEO_BM_STATUS_C1SINGLE && bm_stat & LEO_BM_STATUS_C1DOUBLE) || bm_stat & LEO_BM_STATUS_MICRO) + { + if (blockInfo->C1ErrNum > 3) + { + if (info->transferMode != LEO_SECTOR_MODE || info->sectorNum > 0x52) + { + blockInfo->errStatus = LEO_ERROR_23; + __osLeoAbnormalResume(); + return 1; + } + } + else + { + int errNum = blockInfo->C1ErrNum; + blockInfo->C1ErrSector[errNum] = info->sectorNum + 1; + } + blockInfo->C1ErrNum += 1; + } + if (stat & LEO_STATUS_C2_TRANSFER) + { + if (info->sectorNum + 1 != 88) + { + blockInfo->errStatus = LEO_ERROR_24; + __osLeoAbnormalResume(); + } + if (info->transferMode == LEO_TRACK_MODE && info->blockNum == 0) + { + info->blockNum = 1; + info->sectorNum = -1; + info->block[1].dramAddr = (void *)((u32)info->block[1].dramAddr - info->block[1].sectorSize); + + blockInfo->errStatus = LEO_ERROR_22; + } + else + { + IO_WRITE(PI_STATUS_REG, PI_STATUS_CLR_INTR); + __OSGlobalIntMask |= OS_IM_PI; + info->cmdType = LEO_CMD_TYPE_2; + blockInfo->errStatus = LEO_ERROR_GOOD; + } + osEPiRawStartDma(__osDiskHandle, OS_READ, LEO_C2_BUFF, blockInfo->C2Addr, blockInfo->sectorSize * 4); + return 1; + } + + if (info->sectorNum == -1 && info->transferMode == LEO_TRACK_MODE && info->blockNum == 1) + { + __OSBlockInfo *bptr = &info->block[0]; + if (bptr->C1ErrNum == 0) + { + if (((u32 *)bptr->C2Addr)[0] | ((u32 *)bptr->C2Addr)[1] | ((u32 *)bptr->C2Addr)[2] | ((u32 *)bptr->C2Addr)[3]) + { + bptr->errStatus = LEO_ERROR_24; + __osLeoAbnormalResume(); + return 1; + } + } + bptr->errStatus = 0; + __osLeoResume(); + } + info->sectorNum++; + if (stat & LEO_STATUS_DATA_REQUEST) + { + if (info->sectorNum > 0x54) + { + blockInfo->errStatus = LEO_ERROR_24; + __osLeoAbnormalResume(); + return 1; + } + osEPiRawStartDma(__osDiskHandle, 0, LEO_SECTOR_BUFF, blockInfo->dramAddr, blockInfo->sectorSize); + blockInfo->errStatus = LEO_ERROR_GOOD; + return 1; + } + if (info->sectorNum <= 0x54) + { + blockInfo->errStatus = LEO_ERROR_24; + __osLeoAbnormalResume(); + return 1; + } + return 1; + } + blockInfo->errStatus = LEO_ERROR_4; + __osLeoAbnormalResume(); + return 1; +} + +static void __osLeoAbnormalResume(void) +{ + __OSTranxInfo *info; + u32 pi_stat; + info = &__osDiskHandle->transferInfo; + pi_stat = pi_stat; + WAIT_ON_IOBUSY2(pi_stat); + IO_WRITE(LEO_BM_CTL, info->bmCtlShadow | LEO_BM_CTL_RESET); + WAIT_ON_IOBUSY2(pi_stat); + IO_WRITE(LEO_BM_CTL, info->bmCtlShadow); + __osLeoResume(); + IO_WRITE(PI_STATUS_REG, PI_STATUS_CLR_INTR); + __OSGlobalIntMask |= OS_IM_PI; +} + +static void __osLeoResume(void) +{ + __OSEventState *es; + OSMesgQueue *mq; + s32 last; + es = &__osEventStateTab[OS_EVENT_PI]; + mq = es->messageQueue; + if (mq == NULL || MQ_IS_FULL(mq)) + return; + last = (mq->first + mq->validCount) % mq->msgCount; + mq->msg[last] = es->message; + mq->validCount++; + if (mq->mtqueue->next != NULL) + __osEnqueueThread(&__osRunQueue, __osPopThread(&mq->mtqueue)); +} diff --git a/src/done/ll.c b/src/done/ll.c new file mode 100644 index 00000000..d183b3eb --- /dev/null +++ b/src/done/ll.c @@ -0,0 +1,57 @@ +#include +#include "functions.h" +#include "variables.h" + +unsigned long long __ull_rshift(unsigned long long a0, unsigned long long a1) +{ + return a0 >> a1; +} +unsigned long long __ull_rem(unsigned long long a0, unsigned long long a1) +{ + return a0 % a1; +} +unsigned long long __ull_div(unsigned long long a0, unsigned long long a1) +{ + return a0 / a1; +} + +unsigned long long __ll_lshift(unsigned long long a0, unsigned long long a1) +{ + return a0 << a1; +} + +long long __ll_rem(unsigned long long a0, long long a1) +{ + return a0 % a1; +} + +long long __ll_div(long long a0, long long a1) +{ + return a0 / a1; +} + +unsigned long long __ll_mul(unsigned long long a0, unsigned long long a1) +{ + return a0 * a1; +} + +void __ull_divremi(unsigned long long *div, unsigned long long *rem, unsigned long long a2, unsigned short a3) +{ + *div = a2 / a3; + *rem = a2 % a3; +} +long long __ll_mod(long long a0, long long a1) +{ + long long tmp = a0 % a1; + if ((tmp < 0 && a1 > 0) || (tmp > 0 && a1 < 0)) + { + + tmp += a1; + } + return tmp; +} + +long long __ll_rshift(long long a0, long long a1) +{ + return a0 >> a1; +} diff --git a/src/done/overlays.c b/src/done/overlays.c new file mode 100644 index 00000000..7db4666c --- /dev/null +++ b/src/done/overlays.c @@ -0,0 +1,44 @@ +#include +#include "functions.h" +#include "variables.h" + +#define OVERLAY(ovl, _) \ + extern u8 ovl##_us_v10_rzip_ROM_START[]; \ + extern u8 ovl##_us_v10_rzip_ROM_END[]; +#include +#undef OVERLAY + +// This doesn't match as macros, even if two macros are used per overlay. +// Look into autogenerating this table in the long run for a cleaner solution. +void overlay_table_init(void) { + gOverlayTable[ 0].start = core2_us_v10_rzip_ROM_START; + gOverlayTable[ 0].end = core2_us_v10_rzip_ROM_END; + gOverlayTable[ 1].start = emptyLvl_us_v10_rzip_ROM_START; + gOverlayTable[ 1].end = emptyLvl_us_v10_rzip_ROM_END; + gOverlayTable[ 2].start = CC_us_v10_rzip_ROM_START; + gOverlayTable[ 2].end = CC_us_v10_rzip_ROM_END; + gOverlayTable[ 3].start = MMM_us_v10_rzip_ROM_START; + gOverlayTable[ 3].end = MMM_us_v10_rzip_ROM_END; + gOverlayTable[ 4].start = GV_us_v10_rzip_ROM_START; + gOverlayTable[ 4].end = GV_us_v10_rzip_ROM_END; + gOverlayTable[ 5].start = TTC_us_v10_rzip_ROM_START; + gOverlayTable[ 5].end = TTC_us_v10_rzip_ROM_END; + gOverlayTable[ 6].start = MM_us_v10_rzip_ROM_START; + gOverlayTable[ 6].end = MM_us_v10_rzip_ROM_END; + gOverlayTable[ 7].start = BGS_us_v10_rzip_ROM_START; + gOverlayTable[ 7].end = BGS_us_v10_rzip_ROM_END; + gOverlayTable[ 8].start = RBB_us_v10_rzip_ROM_START; + gOverlayTable[ 8].end = RBB_us_v10_rzip_ROM_END; + gOverlayTable[ 9].start = FP_us_v10_rzip_ROM_START; + gOverlayTable[ 9].end = FP_us_v10_rzip_ROM_END; + gOverlayTable[10].start = CCW_us_v10_rzip_ROM_START; + gOverlayTable[10].end = CCW_us_v10_rzip_ROM_END; + gOverlayTable[11].start = SM_us_v10_rzip_ROM_START; + gOverlayTable[11].end = SM_us_v10_rzip_ROM_END; + gOverlayTable[12].start = cutscenes_us_v10_rzip_ROM_START; + gOverlayTable[12].end = cutscenes_us_v10_rzip_ROM_END; + gOverlayTable[13].start = lair_us_v10_rzip_ROM_START; + gOverlayTable[13].end = lair_us_v10_rzip_ROM_END; + gOverlayTable[14].start = fight_us_v10_rzip_ROM_START; + gOverlayTable[14].end = fight_us_v10_rzip_ROM_END; +} diff --git a/src/done/piacs.c b/src/done/piacs.c new file mode 100644 index 00000000..69938b2c --- /dev/null +++ b/src/done/piacs.c @@ -0,0 +1,24 @@ +#include + +#define PI_Q_BUF_LEN 1 +u32 __osPiAccessQueueEnabled = 0; +static OSMesg piAccessBuf[PI_Q_BUF_LEN]; +OSMesgQueue __osPiAccessQueue; +void __osPiCreateAccessQueue(void) +{ + + __osPiAccessQueueEnabled = 1; + osCreateMesgQueue(&__osPiAccessQueue, piAccessBuf, PI_Q_BUF_LEN); + osSendMesg(&__osPiAccessQueue, NULL, OS_MESG_NOBLOCK); +} +void __osPiGetAccess(void) +{ + OSMesg dummyMesg; + if (!__osPiAccessQueueEnabled) + __osPiCreateAccessQueue(); + osRecvMesg(&__osPiAccessQueue, &dummyMesg, OS_MESG_BLOCK); +} +void __osPiRelAccess(void) +{ + osSendMesg(&__osPiAccessQueue, NULL, OS_MESG_NOBLOCK); +} diff --git a/src/done/pigetstat.c b/src/done/pigetstat.c new file mode 100644 index 00000000..d6e339b3 --- /dev/null +++ b/src/done/pigetstat.c @@ -0,0 +1,7 @@ +#include +#include "functions.h" +#include "variables.h" + +u32 osPiGetStatus(void) { + return IO_READ(PI_STATUS_REG); +} diff --git a/src/done/pimgr.c b/src/done/pimgr.c new file mode 100644 index 00000000..b4e5cc64 --- /dev/null +++ b/src/done/pimgr.c @@ -0,0 +1,50 @@ +#include +#include "piint.h" + + +extern u32 __osPiAccessQueueEnabled; + +OSDevMgr __osPiDevMgr = {0}; +OSPiHandle *__osPiTable = NULL; +OSPiHandle *__osCurrentHandle[2] = {&CartRomHandle, &LeoDiskHandle}; +static OSThread piThread; +static char piThreadStack[OS_PIM_STACKSIZE]; +static OSMesgQueue piEventQueue; +static OSMesg piEventBuf; + +void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt) +{ + u32 savedMask; + OSPri oldPri; + OSPri myPri; + if (!__osPiDevMgr.active) + { + osCreateMesgQueue(cmdQ, cmdBuf, cmdMsgCnt); + osCreateMesgQueue(&piEventQueue, (OSMesg*)&piEventBuf, 1); + if (!__osPiAccessQueueEnabled) + __osPiCreateAccessQueue(); + osSetEventMesg(OS_EVENT_PI, &piEventQueue, (OSMesg)0x22222222); + oldPri = -1; + myPri = osGetThreadPri(NULL); + if (myPri < pri) + { + oldPri = myPri; + osSetThreadPri(NULL, pri); + } + savedMask = __osDisableInt(); + __osPiDevMgr.active = 1; + __osPiDevMgr.thread = &piThread; + __osPiDevMgr.cmdQueue = cmdQ; + __osPiDevMgr.evtQueue = &piEventQueue; + __osPiDevMgr.acsQueue = &__osPiAccessQueue; + __osPiDevMgr.dma = osPiRawStartDma; + __osPiDevMgr.edma = osEPiRawStartDma; + osCreateThread(&piThread, 0, __osDevMgrMain, &__osPiDevMgr, &piThreadStack[OS_PIM_STACKSIZE], pri); + osStartThread(&piThread); + __osRestoreInt(savedMask); + if (oldPri != -1) + { + osSetThreadPri(NULL, oldPri); + } + } +} diff --git a/src/done/pirawdma.c b/src/done/pirawdma.c new file mode 100644 index 00000000..4db24a95 --- /dev/null +++ b/src/done/pirawdma.c @@ -0,0 +1,28 @@ +#include +#include "functions.h" +#include "variables.h" + +#define WAIT_ON_IOBUSY(stat) \ + stat = IO_READ(PI_STATUS_REG); \ + while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY)) \ + stat = IO_READ(PI_STATUS_REG); + +s32 osPiRawStartDma(s32 direction, u32 devAddr, void *dramAddr, u32 size) +{ + register u32 stat; + WAIT_ON_IOBUSY(stat); + IO_WRITE(PI_DRAM_ADDR_REG, osVirtualToPhysical(dramAddr)); + IO_WRITE(PI_CART_ADDR_REG, K1_TO_PHYS((u32)osRomBase | devAddr)); + switch (direction) + { + case OS_READ: + IO_WRITE(PI_WR_LEN_REG, size - 1); + break; + case OS_WRITE: + IO_WRITE(PI_RD_LEN_REG, size - 1); + break; + default: + return -1; + } + return 0; +} diff --git a/src/done/pirawread.c b/src/done/pirawread.c new file mode 100644 index 00000000..33795911 --- /dev/null +++ b/src/done/pirawread.c @@ -0,0 +1,11 @@ +#include +#include "piint.h" + +s32 osPiRawReadIo(u32 devAddr, u32 *data) +{ + register u32 stat; + WAIT_ON_IOBUSY(stat); + *data = IO_READ((u32)osRomBase | devAddr); + return 0; +} + diff --git a/src/done/rarezip.c b/src/done/rarezip.c new file mode 100644 index 00000000..1e5efb8c --- /dev/null +++ b/src/done/rarezip.c @@ -0,0 +1,51 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "rarezip.h" + +struct huft *D_80007270; + +u32 func_800005C0(u8*, u8*, struct huft *); +u32 func_80000618(u8**, u8**, struct huft *); + +extern void *D_803FBE00; + +u32 func_80000550(u8*arg0){ + return *((u32*)(arg0 +2)); +} + +void func_8000055C(void){ + D_80007270 = (struct huft*) &D_803FBE00; +} + +u32 func_80000570(u8 *inPtr, u8 *outPtr){ + return func_800005C0(inPtr, outPtr, D_80007270); +} + +//rareunzip +u32 func_80000594(u8 **inPtr, u8 **outPtr){ + return func_80000618(inPtr, outPtr, D_80007270); +} + +void func_800005B8(void){} + +u32 func_800005C0(u8* in, u8* out, struct huft *arg2){ + inbuf = in; //inbuf + D_80007284 = out; //slide + D_80007290 = arg2; + inbuf += 6; //skip 6 byte bk header + wp = 0; //wp + inptr = 0; //inptr + + bkboot_inflate(); //inflate + return wp; //return uncompressed size +} + +u32 func_80000618(u8 **inPtr, u8 **outPtr, struct huft *arg2){ + u32 size = func_800005C0(*inPtr, *outPtr, arg2); + *outPtr += wp; + *outPtr = ((u32)(*outPtr) & 0xF) ? ((u32)(*outPtr) & ~0xF) + 0x10 : *outPtr; + *inPtr += inptr + 6; + return size; +} diff --git a/src/done/recvmesg.c b/src/done/recvmesg.c new file mode 100644 index 00000000..26509ad3 --- /dev/null +++ b/src/done/recvmesg.c @@ -0,0 +1,32 @@ +#include +#include "osint.h" + +s32 osRecvMesg(OSMesgQueue *mq, OSMesg *msg, s32 flags) +{ + register u32 saveMask; + saveMask = __osDisableInt(); + + while (MQ_IS_EMPTY(mq)) + { + if (flags == OS_MESG_NOBLOCK) + { + __osRestoreInt(saveMask); + return -1; + } + __osRunningThread->state = OS_STATE_WAITING; + __osEnqueueAndYield(&mq->mtqueue); + } + + if (msg != NULL) + { + *msg = mq->msg[mq->first]; + } + mq->first = (mq->first + 1) % mq->msgCount; + mq->validCount--; + if (mq->fullqueue->next != NULL) + { + osStartThread(__osPopThread(&mq->fullqueue)); + } + __osRestoreInt(saveMask); + return 0; +} diff --git a/src/done/resetglobalintmask.c b/src/done/resetglobalintmask.c new file mode 100644 index 00000000..d849dfd7 --- /dev/null +++ b/src/done/resetglobalintmask.c @@ -0,0 +1,13 @@ +#include +#include + +void __osResetGlobalIntMask(OSHWIntr interrupt) +{ + register u32 saveMask = __osDisableInt(); + + //not sure about these constants, SR_IBIT3 is external level 3 INT0, which I think corresponds to the rcp + //os.h has several masks defined that end in 401 but non that are just 401 + __OSGlobalIntMask &= ~(interrupt & ~(SR_IBIT3 | SR_IE)); + + __osRestoreInt(saveMask); +} diff --git a/src/done/sendmesg.c b/src/done/sendmesg.c new file mode 100644 index 00000000..b0588ce4 --- /dev/null +++ b/src/done/sendmesg.c @@ -0,0 +1,31 @@ +#include +#include "osint.h" + +s32 osSendMesg(OSMesgQueue *mq, OSMesg msg, s32 flags) +{ + register u32 saveMask; + register s32 last; + saveMask = __osDisableInt(); + while (MQ_IS_FULL(mq)) + { + if (flags == OS_MESG_BLOCK) + { + __osRunningThread->state = OS_STATE_WAITING; + __osEnqueueAndYield(&mq->fullqueue); + } + else + { + __osRestoreInt(saveMask); + return -1; + } + } + last = (mq->first + mq->validCount) % mq->msgCount; + mq->msg[last] = msg; + mq->validCount++; + if (mq->mtqueue->next != NULL) + { + osStartThread(__osPopThread(&mq->mtqueue)); + } + __osRestoreInt(saveMask); + return 0; +} diff --git a/src/done/seteventmesg.c b/src/done/seteventmesg.c new file mode 100644 index 00000000..5911e2f5 --- /dev/null +++ b/src/done/seteventmesg.c @@ -0,0 +1,13 @@ +#include +#include "osint.h" +__OSEventState __osEventStateTab[OS_NUM_EVENTS]; +void osSetEventMesg(OSEvent event, OSMesgQueue *mq, OSMesg msg) +{ + register u32 saveMask = __osDisableInt(); + __OSEventState *es; + + es = &__osEventStateTab[event]; + es->messageQueue = mq; + es->message = msg; + __osRestoreInt(saveMask); +} diff --git a/src/done/setglobalintmask.c b/src/done/setglobalintmask.c new file mode 100644 index 00000000..3fda389a --- /dev/null +++ b/src/done/setglobalintmask.c @@ -0,0 +1,9 @@ +#include +#include + +void __osSetGlobalIntMask(OSHWIntr mask) +{ + register u32 saveMask = __osDisableInt(); + __OSGlobalIntMask |= mask; + __osRestoreInt(saveMask); +} diff --git a/src/done/setthreadpri.c b/src/done/setthreadpri.c new file mode 100644 index 00000000..b80f9b3d --- /dev/null +++ b/src/done/setthreadpri.c @@ -0,0 +1,24 @@ +#include +#include "osint.h" + +void osSetThreadPri(OSThread *t, OSPri pri) +{ + register u32 saveMask = __osDisableInt(); + if (t == NULL) + t = __osRunningThread; + if (t->priority != pri) + { + t->priority = pri; + if (t != __osRunningThread && t->state != OS_STATE_STOPPED) + { + __osDequeueThread(t->queue, t); + __osEnqueueThread(t->queue, t); + } + if (__osRunningThread->priority < __osRunQueue->priority) + { + __osRunningThread->state = OS_STATE_RUNNABLE; + __osEnqueueAndYield(&__osRunQueue); + } + } + __osRestoreInt(saveMask); +} diff --git a/src/done/si.c b/src/done/si.c new file mode 100644 index 00000000..8f821b6f --- /dev/null +++ b/src/done/si.c @@ -0,0 +1,11 @@ +#include +#include "functions.h" +#include "variables.h" + +int __osSiDeviceBusy() +{ + register u32 stat = IO_READ(SI_STATUS_REG); + if (stat & (SI_STATUS_DMA_BUSY | SI_STATUS_RD_BUSY)) + return 1; + return 0; +} diff --git a/src/done/sirawread.c b/src/done/sirawread.c new file mode 100644 index 00000000..5cecb6c9 --- /dev/null +++ b/src/done/sirawread.c @@ -0,0 +1,9 @@ +#include + +s32 __osSiRawReadIo(u32 devAddr, u32 *data) +{ + if (__osSiDeviceBusy()) + return -1; + *data = IO_READ(devAddr); + return 0; +} diff --git a/src/done/sirawwrite.c b/src/done/sirawwrite.c new file mode 100644 index 00000000..bf64a5b4 --- /dev/null +++ b/src/done/sirawwrite.c @@ -0,0 +1,9 @@ +#include + +s32 __osSiRawWriteIo(u32 devAddr, u32 data) +{ + if (__osSiDeviceBusy()) + return -1; + IO_WRITE(devAddr, data); + return 0; +} diff --git a/src/done/startthread.c b/src/done/startthread.c new file mode 100644 index 00000000..8103a989 --- /dev/null +++ b/src/done/startthread.c @@ -0,0 +1,40 @@ +#include +#include "osint.h" + +void osStartThread(OSThread *t) +{ + register u32 saveMask = __osDisableInt(); + switch (t->state) + { + case OS_STATE_WAITING: + t->state = OS_STATE_RUNNABLE; + __osEnqueueThread(&__osRunQueue, t); + break; + case OS_STATE_STOPPED: + if (t->queue == NULL || t->queue == &__osRunQueue) + { + t->state = OS_STATE_RUNNABLE; + __osEnqueueThread(&__osRunQueue, t); + } + else + { + t->state = OS_STATE_WAITING; + __osEnqueueThread(t->queue, t); + __osEnqueueThread(&__osRunQueue, __osPopThread(t->queue)); + } + break; + } + if (__osRunningThread == NULL) + { + __osDispatchThread(); + } + else + { + if (__osRunningThread->priority < __osRunQueue->priority) + { + __osRunningThread->state = OS_STATE_RUNNABLE; + __osEnqueueAndYield(&__osRunQueue); + } + } + __osRestoreInt(saveMask); +} diff --git a/src/done/thread.c b/src/done/thread.c new file mode 100644 index 00000000..f413c573 --- /dev/null +++ b/src/done/thread.c @@ -0,0 +1,25 @@ +#include +#include "osint.h" + +struct __osThreadTail __osThreadTail = {0, -1}; +OSThread *__osRunQueue = (OSThread *)&__osThreadTail; +OSThread *__osActiveQueue = (OSThread *)&__osThreadTail; +OSThread *__osRunningThread = {0}; +OSThread *__osFaultedThread = {0}; +void __osDequeueThread(OSThread **queue, OSThread *t) +{ + register OSThread *pred; + register OSThread *succ; + pred = (OSThread *)queue; //this is actually legit.. + succ = pred->next; + while (succ != NULL) + { + if (succ == t) + { + pred->next = t->next; + return; + } + pred = succ; + succ = pred->next; + } +} diff --git a/src/done/virtualtophysical.c b/src/done/virtualtophysical.c new file mode 100644 index 00000000..e952a60b --- /dev/null +++ b/src/done/virtualtophysical.c @@ -0,0 +1,19 @@ +#include +#include +#include "osint.h" + +u32 osVirtualToPhysical(void *addr) +{ + if (IS_KSEG0(addr)) + { + return K0_TO_PHYS(addr); + } + else if (IS_KSEG1(addr)) + { + return K1_TO_PHYS(addr); + } + else + { + return __osProbeTLB(addr); + } +} diff --git a/src/done/yieldthread.c b/src/done/yieldthread.c new file mode 100644 index 00000000..9dcf6c72 --- /dev/null +++ b/src/done/yieldthread.c @@ -0,0 +1,9 @@ +#include +#include "osint.h" + +void osYieldThread(void){ + register u32 saveMask = __osDisableInt(); + __osRunningThread->state = OS_STATE_RUNNABLE; + __osEnqueueAndYield(&__osRunQueue); + __osRestoreInt(saveMask); +} diff --git a/src/fight/code_0.c b/src/fight/code_0.c new file mode 100644 index 00000000..5349133b --- /dev/null +++ b/src/fight/code_0.c @@ -0,0 +1,40 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" +extern ActorInfo D_80366F68; + +extern ActorInfo D_80391500; +extern ActorInfo D_80391840; +extern ActorInfo D_80391864; +extern ActorInfo D_80391888; +extern ActorInfo D_803918AC; +extern ActorInfo D_80391990; +extern ActorInfo D_80391A10; +extern ActorInfo D_80391A40; +extern ActorInfo D_80391AD0; +extern ActorInfo D_80391B00; +extern ActorInfo D_80391B24; +extern ActorInfo D_80391DC0; +extern ActorInfo D_80392018; +extern ActorInfo D_80392090; + +void func_803863F0(void) +{ + spawnableActorList_add(&D_80391B00, actor_new, 0X108444); + spawnableActorList_add(&D_80391DC0, actor_new, 0X108444); + spawnableActorList_add(&D_80391500, actor_new, 0X300468); + spawnableActorList_add(&D_80391840, actor_new, 0X8464); + spawnableActorList_add(&D_80391864, actor_new, 0X8464); + spawnableActorList_add(&D_80391888, actor_new, 0X8464); + spawnableActorList_add(&D_803918AC, actor_new, 0X8464); + spawnableActorList_add(&D_80391A10, actor_new, 0X20004); + spawnableActorList_add(&D_80391990, actor_new, 0X800100C); + spawnableActorList_add(&D_80391A40, actor_new, 0X8009404); + spawnableActorList_add(&D_80391B24, actor_new, 0X108444); + spawnableActorList_add(&D_80391AD0, actor_new, 0X101404); + spawnableActorList_add(&D_80366F68, actor_new, 0X100404); + spawnableActorList_add(&D_80392018, actor_new, 0X9464); + spawnableActorList_add(&D_80392090, actor_new, 0X100404); +} diff --git a/src/fight/code_180.c b/src/fight/code_180.c new file mode 100644 index 00000000..34d64498 --- /dev/null +++ b/src/fight/code_180.c @@ -0,0 +1,2409 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_8025715C(f32, f32); +extern void func_8025727C(f32, f32, f32, f32, f32, f32, f32*, f32*); +extern void func_8028F4B8(f32[3], f32, f32); +extern void func_80320ED8(ActorMarker *, f32, s32); + +Actor *func_80386570(ActorMarker *arg0, Gfx **arg1, Mtx **arg2, Vtx **arg3); +void func_80387110(ActorMarker *, f32[3], f32, s32); +void func_8038856C(Actor *actor, f32 *arg1); +void func_8038BCF0(Actor *this); +void func_802C8F70(f32); +s32 func_803297C8(Actor*, f32*); +Actor *func_8032813C(); +void func_803900DC(ActorMarker *, f32 *, f32, f32); +extern Actor* func_80329958(ActorMarker *this, s32 arg1); +extern void func_803298D8(); +void func_80324E88(f32); +extern void func_80324E60(Actor*, s32, f32); +extern void func_80324CFC(f32, enum comusic_e, s32); +extern void sfxsource_setSampleRate(u8, s32); +extern void func_80328FF0(Actor *arg0, f32 arg1); +extern f32 func_80257204(f32, f32, f32, f32); +extern void func_8028F85C(f32[3]); +extern void func_8028FAEC(f32[3]); +extern f32 func_8033229C(ActorMarker *); + + +void func_80388184(Actor *arg0, s32 arg1); +ActorMarker *func_8038A4E8(Actor *, f32); +void func_8038AC88(Actor *, s32); +void func_8038B780(); +void func_8038C5F0(Actor *, s32, s32, f32); +void func_80391070(ActorMarker *, s32 arg1, s32 arg2); +void func_803911F8(ActorMarker *); + +typedef struct ch_fight_180_s{ + u8 unk0; + u8 unk1; + u8 unk2; + u8 unk3; + u8 unk4; + u8 unk5; + u8 unk6; + u8 unk7; + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; + u8 unkC; + u8 unkD; + u8 unkE; + u8 unkF; + s32 unk10; + f32 unk14; + f32 unk18; + f32 unk1C; + f32 unk20; + u8 pad24[4]; + f32 unk28; + f32 unk2C; +}ActorLocal_fight_180; + +/* .data */ +f32 D_80391380[4] = {1.0f, 1.0f, 1.0f, 1.0f}; +f32 D_80391390[4] = {0.33f, 0.33f, 0.33f, 1.0f}; +ActorAnimationInfo D_803913A0[] = { + { 0, 0.0f}, + { 0x1C5, 0.6f}, + { 0x1C5, 0.6f}, + { 0x1C5, 0.6f}, + { 0x1C5, 0.8f}, + { 0x1C5, 0.6f}, + { 0x25C, 1.0f}, + { 0x25C, 1.0f}, + { 0x25E, 6.5f}, + { 0x25E, 6.5f}, + { 0x25A, 1.1f}, + { 0x1C5, 1.0f}, + { 0x257, 2.5f}, + { 0x259, 1.4f}, + { 0x1C5, 0.6f}, + { 0x1C5, 0.8f}, + { 0x25A, 1.1f}, + { 0x257, 2.5f}, + { 0x1C5, 0.8f}, + { 0x258, 1.0f}, + { 0x259, 1.4f}, + { 0x1C5, 0.6f}, + { 0x1C5, 0.8f}, + { 0x1C5, 0.8f}, + { 0x25A, 1.1f}, + { 0x259, 1.4f}, + { 0x267, 3.0f}, + { 0x1C5, 0.8f}, + { 0x1C5, 0.6f}, + { 0x1C5, 0.8f}, + { 0x25A, 1.1f}, + { 0x1C5, 0.8f}, + { 0x259, 1.4f}, + { 0x263, 0.5f}, + { 0x25D, 7.0f}, + { 0x25F, 1.0f}, + { 0x25F, 1.0f}, + { 0x260, 1.1f}, + { 0x261, 2.5f}, + { 0x25F, 1.0f}, + { 0x279, 3.0f}, + { 0x283, 0.25f}, + { 0x27A, 1.0f}, + { 0x266, 4.0f} +}; + +ActorInfo D_80391500 = { + 0x25E, 0x38B, 0x53D, + 1, D_803913A0, + func_8038BCF0, func_80326224, func_80386570, + 0, 0, 0.0f, 0 +}; +f32 D_80391524[3] = {0.0f, -8.0f, 400.0f}; + +f32 D_80391530[3] = {0.0f, -8.0f, 0.0f}; + +struct31s D_8039153C ={ + {1.0f, 1.0f}, + {1.0f, 1.0f}, + {0.0f, 0.01f}, + {2.8f, 3.2f}, + 0.5f, 0.7f +}; + +struct43s D_80391564 ={ + {{-300.0f, -300.0f, -300.0f}, {300.0f, 500.0f, 300.0f}}, + {{0.0f, -1200.0f, 0.0f}, {0.0f, -1200.0f, 0.0f}}, + {{-100.0f, -20.0f, -100.0f},{100.0f, 100.0f, 100.0f}} +}; + +s32 D_803915AC[3] = {0x24, 0x24, 0x24}; + +struct42s D_803915B8 = { + {{-70.0f, -50.0f, -70.0f}, {70.0f, 50.0f, 70.0f}}, + {{-100.0f, -20.0f, -100.0f},{100.0f, 100.0f, 100.0f}} +}; + +struct40s D_803915E8 ={ + { + {1.8f, 2.1f}, + {1.3f, 1.4f}, + {0.0f, 0.01f}, + {1.1f, 1.3f}, + 0.15f, 0.3f + }, + 4.0f, 1.0f +}; + +struct42s D_80391618 = { + {{-10.0f, -10.0f, -10.0f}, {10.0f, 10.0f, 10.0f,}}, + {{0.0f, 30.0f, 0.0f}, {0.0f, 30.0f, 0.0f}} +}; + +struct40s D_80391648 = { + {{0.2f, 0.3f}, {0.5f, 0.6f}, {0.0f, 0.01f}, {1.1f, 1.3f}, 0.01, 0.7}, 4.0f, 1.0f +}; + +struct43s D_80391678 = { + {{-50, -50, -50}, {50, 50, 50}}, + {{0, -50, 0}, {0, -50, 0}}, + {{-60, 60, -60}, {60, 60, 60}} +}; + +s32 D_803916C0[3] = {0xff, 0xff, 0xff}; +s32 D_803916CC[3] = {0xff, 0, 0}; +s32 D_803916D8[3] = {0x4B, 0x4B, 0x4B}; + +f32 D_803916E4[4] = {0.1f, 0.2f, 1.9f, 3.9f}; + +f32 D_803916F4[3] = {0.0f, 0.0f, 0.0f}; +f32 D_80391700[3] = {0.0f, 0.0f, 0.0f}; +s32 D_8039170C = 0; +f32 D_80391710[3] = {0.0f, 0.0f, 600.0f}; +f32 D_8039171C[3] = {0.0f, 0.0f, -600.0f}; +f32 D_80391728[4] = {0.1f, 0.2f, 3.9f, 4.9f}; +s32 D_80391738[4] = {0xCE4, 0x10C2, 0x14A0, 0x187E}; +f32 D_80391748[4] = {1.4f, 1.1f, 0.8f, 0.5f}; +f32 D_80391758[4] = {1000.0f, 1100.0f, 1200.0f, 1300.0f}; +f32 D_80391768[3] = {-1290.0f, 0.0f, 1290.0f}; +f32 D_80391774[3] = {-1290.0f, 0.0f, -1290.0f}; +f32 D_80391780[3] = {1290.0f, 0.0f, -1290.0f}; +f32 D_8039178C[3] = {1290.0f, 0.0f, 1290.0f}; +f32 D_80391798[3] = {0.0f, 0.0f, 0.0f}; +f32 D_803917A4[4] = {500.0f, 650.0f, 800.0f, 950.0f}; +f32 D_803917B4[4] = {3.75f, 3.0f, 2.25f, 1.5f}; +s32 D_803917C4[3] = {230, 230, 230}; +f32 D_803917D0[4] = {2.4f, 2.1f, 1.8f, 1.5f}; +f32 D_803917E0[3] = {0.0f, 186.0f, 0.0f}; +f32 D_803917EC[3] = {-827.0f, 793.0f, 1700.0f}; +f32 D_803917F8[3] = {827.0f, 793.0f, -1700.0f}; +f32 D_80391804[3] = {0.0f, 0.0f, 1350.0f}; + + +/* .rodata */ +// jtbl_80392280 +// jtbl_80392310 +// jtbl_80392388 +// jtbl_803923F4 +// jtbl_8039242C +// jtbl_803924B8 + +extern f32 D_80392440; +extern f32 D_80392444; +extern f32 D_80392448; +extern f32 D_8039244C; +extern f32 D_80392450; +// jtbl_80392454 + +extern f64 D_80392470; +extern f32 D_80392478; + + + +/* .bss */ +// u8 pad_80392740[0x10]; +// f32 D_80392750; +extern f32 D_80392758[3]; +extern f32 D_80392768[3]; +extern f32 D_80392778[3]; +extern f32 D_80392788[3]; +extern f32 D_80392798[3]; +extern ActorMarker *D_803927A4; +extern ActorMarker *D_803927A8; +extern ActorMarker *D_803927B0[4]; +extern u8 D_803927C4; +extern u8 D_803927C5; +extern u8 D_803927C6; +extern u8 D_803927C7; +extern u8 D_803927C8; +extern u8 D_803927C9; +extern f32 D_803927D0[3][3]; +extern f32 D_803928B8[3]; +extern f32 D_803927C0; +extern s32 D_803928C4; +extern f32 D_803928C8[3]; + + +/* .code */ +Actor *func_80386570(ActorMarker *arg0, Gfx **arg1, Mtx **arg2, Vtx **arg3) { + Actor *temp_v0; + ActorLocal_fight_180 *localActor; + + temp_v0 = marker_getActor(arg0); + localActor = (ActorLocal_fight_180 *)&temp_v0->local; + func_8033A45C(3, localActor->unkD); + func_8033A45C(4, localActor->unkE); + func_8033A45C(5, localActor->unkC); + if (localActor->unk0 == 1) { + func_8033A25C(0); + } + return func_80325888(arg0, arg1, arg2, arg3); +} + +void func_80386600(ActorMarker *arg0, s32 arg1) { + Actor *this; + ActorLocal_fight_180 *local; + + this = marker_getActor(arg0); + local = (ActorLocal_fight_180 *)&this->local; + local->unkC = arg1; +} + +void func_80386628(ActorMarker *arg0, s32 arg1) { + Actor *temp_v0; + ActorLocal_fight_180 *local; + + + temp_v0 = marker_getActor(arg0); + local = (ActorLocal_fight_180 *)&temp_v0->local; + local->unkD = arg1; + local->unkE = arg1; +} + +void func_8034DF30(Struct6Ds *, f32[3], f32[3], f32); + +void func_80386654(f32 arg0, f32 arg1[4], f32 arg2[4]) { + Struct6Ds *temp_v0; + + temp_v0 = func_8034C528(0x190); + if (temp_v0 != NULL) { + func_8034DF30(temp_v0, arg1, arg2, arg0); + } +} + +void func_80386698(f32 arg0) { + Struct6Ds * temp_v0; + + temp_v0 = func_8034C528(0x19A); + if (temp_v0 != NULL) { + func_8034DDF0(temp_v0, D_80391524, D_80391530, arg0, 1); + } +} + +void func_803866E4(f32 position[3], enum asset_e model_id, s32 n) { + ParticleEmitter *temp_s0; + + temp_s0 = partEmitList_pushNew(n); + particleEmitter_setModel(temp_s0, model_id); + particleEmitter_setPosition(temp_s0, position); + func_802EFE24(temp_s0, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); + particleEmitter_setPositionVelocityAndAccelerationRanges(temp_s0, &D_80391564); + func_802EFB98(temp_s0, &D_8039153C); + func_802EFA78(temp_s0, 1); + particleEmitter_emitN(temp_s0, n); +} + +void func_8038679C(f32 arg0[3], s32 arg1, f32 arg2[4]) { + ParticleEmitter *temp_s0; + ParticleEmitter *temp_v0; + + temp_v0 = partEmitList_pushNew(arg1); + temp_s0 = temp_v0; + particleEmitter_setSprite(temp_v0, ASSET_70E_SPRITE_SMOKE_2); + func_802EFFA8(temp_s0, D_803915AC); + particleEmitter_setStartingFrameRange(temp_s0, 0, 7); + particleEmitter_setPosition(temp_s0, arg0); + particleEmitter_setPositionAndVelocityRanges(temp_s0, &D_803915B8); + func_802EFB70(temp_s0, arg2[0], arg2[1]); + func_802EFB84(temp_s0, arg2[2], arg2[3]); + particleEmitter_setSpawnIntervalRange(temp_s0, 0.0f, 0.01f); + func_802EFEC0(temp_s0, 2.8f, 3.2f); + func_802EFA5C(temp_s0, 0.3f, 0.4f); + func_802EFA78(temp_s0, 1); + particleEmitter_emitN(temp_s0, arg1); +} + +void func_803868A0(f32 arg0[3], s32 arg1[3]) { + ParticleEmitter * temp_s0; + + temp_s0 = partEmitList_pushNew(1); + particleEmitter_setSprite(temp_s0, ASSET_45A_SPRITE_GREEN_GLOW); + particleEmitter_setStartingFrameRange(temp_s0, 2, 2); + func_802EFFA8(temp_s0, arg1); + particleEmitter_setPosition(temp_s0, arg0); + func_802EFA78(temp_s0, 1); + particleEmitter_setPositionAndVelocityRanges(temp_s0, &D_80391618); + func_802EFC28(temp_s0, &D_803915E8); +} + +void func_80386934(f32 position[3], enum asset_e sprite_id) { + ParticleEmitter * temp_s0; + + temp_s0 = partEmitList_pushNew(1); + particleEmitter_setSprite(temp_s0, sprite_id); + particleEmitter_setStartingFrameRange(temp_s0, 1, 6); + particleEmitter_setPosition(temp_s0, position); + func_802EFA78(temp_s0, 1); + particleEmitter_setPositionVelocityAndAccelerationRanges(temp_s0, &D_80391678); + func_802EFC28(temp_s0, &D_80391648); +} + + +void func_803869BC(Actor *this) { + s32 sp3C; + s32 sp30[3]; + s32 sp2C; + f32 sp20[3]; + u32 temp_t3; + + if (this->marker->unk14_21) { + sp3C = func_8023DB5C(); + temp_t3 = (u32) this->state; + if ((temp_t3 == 6) || (temp_t3 == 7)) { + sp30[0] = D_803916CC[0]; + sp30[1] = D_803916CC[1]; + sp30[2] = D_803916CC[2]; + sp2C = 0x715; + } else if ((temp_t3 == 8) || (temp_t3 == 9)) { + sp30[0] = D_803916D8[0]; + sp30[1] = D_803916D8[1]; + sp30[2] = D_803916D8[2]; + sp2C = 0x000; + } else { + sp30[0] = D_803916C0[0]; + sp30[1] = D_803916C0[1]; + sp30[2] = D_803916C0[2]; + sp2C = 0x713; + } + func_8034A174(this->marker->unk44, 7, sp20); + if (((sp2C == 0x715) && ((sp3C & 1) != 0)) || ((sp2C == 0x713) && ((sp3C & 3) == 0))) { + func_803868A0(sp20, sp30); + } + if (sp2C == 0) { + func_8038856C(this, D_803916E4); + } + if ((sp2C != 0) && ((sp2C == 0x715) || (sp2C = sp2C, (randf() < 0.62)))) { + func_80386934(sp20, sp2C); + } + } +} + +void func_80386B54(f32 *arg0, f32 arg1) { + f32 sp34; + f32 sp28[3]; + s32 i; + + sp34 = time_getDelta(); + player_getPosition(sp28); + for(i = 0; i < 3; i++){ + arg0[i] = (i == 1) ? sp28[i] : sp28[i] + ((sp28[i] - D_80392788[i]) * arg1) / sp34; + } +} + +bool func_80386BEC(Actor *this, f32 arg1) { + this->yaw_moving = (f32) func_80329784(this); + func_80328FB0(this, arg1); + if ((this->yaw_moving < (this->yaw + arg1)) && ((this->yaw - arg1) < this->yaw_moving)) { + return TRUE; + } + return FALSE; +} + +bool func_80386C68(Actor *this, f32 arg1) { + f32 sp2C[3]; + + func_8039129C(&sp2C); + this->yaw_moving = (f32) func_803297C8(this, sp2C); + func_80328FB0(this, arg1); + + if ((this->yaw_moving < ( this->yaw + arg1)) && (( this->yaw - arg1) < this->yaw_moving)) { + return TRUE; + } + return FALSE; +} + +void func_80386CF8(Actor *actor) { + f32 sp4C[3]; + f32 sp40[3]; + f32 sp34[3]; + f32 sp28[3]; + + sp28[0] = actor->position[0]; + sp28[1] = actor->position[1]; + sp28[2] = actor->position[2]; + sp28[1] += 220.0f; + sp34[1] = 0.0f; + sp34[0] = 0.0f; + sp34[2] = 1000.0f; + ml_vec3f_yaw_rotate_copy(sp34, sp34, actor->yaw); + sp4C[0] = sp28[0] + sp34[0]; + sp4C[1] = sp28[1] + sp34[1]; + sp4C[2] = sp28[2] + sp34[2]; + func_8025727C(sp28[0], sp28[1], sp28[2], sp4C[0], sp4C[1], sp4C[2], &sp40[0], &sp40[1]); + sp40[0] = 360.0f - sp40[0]; + sp40[2] = 0.0f; + func_802BAE6C(sp4C, sp40); +} + +void func_80386DE4(ActorMarker *arg0) { + Actor *actor; + + actor = marker_getActor(arg0); + func_802C8F70(func_803297C8(actor, D_803916F4)); + func_802C937C(0x14, actor->position); +} + +void func_80386E34(void) { + marker_despawn(D_803927A8); + D_803927A8 = NULL; +} + +void func_80386E5C(s32 arg0) { + s16 *temp_v1; + Actor *temp_v0; + + temp_v0 = func_8032813C(0x39F, D_80391700, D_8039170C); + temp_v0->alpha_124_19 = 0; + temp_v0->unk38_31 = 6; + D_803927A8 = temp_v0->marker; +} + +void func_80386EC0(s32 arg0) { + ActorMarker *marker; + + marker = func_8032813C(0x38A, D_80392758, 0)->marker; + func_8030E878(SFX_147_GRUNTY_SPELL_ATTACK_2, randf2(0.95f, 1.05f), 32000, D_80392758, 5000.0f, 12000.0f); + func_803900DC(marker, D_80392758, D_80392768[1], D_80392768[2]); +} + +void func_80386F5C(ActorMarker * arg0, f32 arg1[3], f32 arg2, f32 arg3) { + arg1[1] += 100.0f; + D_80392758[0] = (f32) arg1[0]; + D_80392758[1] = (f32) arg1[1]; + D_80392758[2] = (f32) arg1[2]; + D_80392768[1] = arg2; + D_80392768[2] = arg3; + func_802C3C88(func_80386EC0, reinterpret_cast(s32, arg0)); +} + +void func_80386FD8(s32 arg0) { + ActorMarker *marker; + + marker = func_8032813C(0x389, D_80392758, 0)->marker; + func_8030E878(SFX_146_GRUNTY_SPELL_ATTACK_1, randf2(0.95f, 1.05f), 0x7D00, D_80392758, 5000.0f, 12000.0f); + func_8038FB84(marker, D_80392758, D_80392768, D_80392778); +} + +void func_80387074(s32 arg0) { + ActorMarker *marker; + + marker = func_8032813C(0x3AA, D_80392758, 0)->marker; + func_8030E878(SFX_146_GRUNTY_SPELL_ATTACK_1, randf2(0.95f, 1.05f), 32000, D_80392758, 5000.0f, 12000.0f); + func_8038FB84(marker, D_80392758, D_80392768, D_80392778); +} + +void func_80387110(ActorMarker *marker, f32 arg1[3], f32 arg2, s32 arg3) { + Actor *temp_v0; + ActorLocal_fight_180 *local; + f32 sp2C[3]; + s32 i; + + temp_v0 = (Actor*) marker_getActor(marker); + local = (ActorLocal_fight_180 *)&temp_v0->local; + D_80392758[0] = arg1[0]; + D_80392758[1] = arg1[1]; + D_80392758[2] = arg1[2]; + D_80392758[1] += 80.0f; + + if (arg3 == 0) { + func_80386B54(sp2C, arg2); + } else if (local->unk7 == 0) { + sp2C[0] = D_80391710[0]; + sp2C[1] = D_80391710[1]; + sp2C[2] = D_80391710[2]; + } else { + sp2C[0] = D_8039171C[0]; + sp2C[1] = D_8039171C[1]; + sp2C[2] = D_8039171C[2]; + } + + D_80392778[0] = 0.0f; + D_80392778[1] = (arg3 == 0) ? -1000.0 : -500.0; + D_80392778[2] = 0.0f; + + for(i = 0; i < 3; i++){ + D_80392768[i] = (sp2C[i] - arg1[i]) / arg2 - (D_80392778[i] * arg2 / 2); + } + if (arg3 == 0) { + func_802C3C88((GenMethod_1)func_80386FD8, reinterpret_cast(s32, marker)); + } + else{ + func_802C3C88((GenMethod_1)func_80387074, reinterpret_cast(s32, marker)); + } +} + +void func_803872F8(Actor *arg0) { + f32 vec[3]; + + func_8034A174(arg0->marker->unk44, 0xA, vec); + func_80387110(arg0->marker, vec, 3.0f, 1); +} + +s32 func_80387340(Actor *this, f32 arg1) { + f32 sp24[3]; + + if (actor_animationIsAt(this, 0.50f) != 0) { + if (this->marker->unk14_21) { + func_8034A174(this->marker->unk44, 5, sp24); + } else { + sp24[0] = this->position_x; + sp24[1] = this->position_y; + sp24[2] = this->position_z; + } + func_80387110(this->marker, sp24, arg1, 0); + return 1; + } + return 0; +} + +void func_803873DC(Actor *actor, f32 arg1, f32 arg2) { + f32 vec[3]; + ActorMarker *marker; + + if (actor_animationIsAt(actor, 0.5f) != 0) { + marker = actor->marker; + if (marker->unk14_21) { + func_8034A174(marker->unk44, 6, vec); + } else { + vec[0] = actor->position[0]; + vec[1] = actor->position[1]; + vec[2] = actor->position[2]; + } + func_80386F5C(actor->marker, vec, arg1, arg2); + } +} + +s32 func_80387470(Actor *this, f32 arg1[3], f32 v_max, f32 arg3, f32 arg4, f32 arg5, f32 arg6) { + f32 dt; + TUPLE(f32, vec) diff; + TUPLE(f32, pos) temp; + TUPLE(f32, pos) next; + dt = time_getDelta(); + + diff.vec_x = arg1[0] - this->position_x; + diff.vec_y = arg1[1] - this->position_y; + diff.vec_z = arg1[2] - this->position_z; + + if (arg5 != 0.00f) { + if (ml_vec3f_distance(this->position, arg1) < arg5) { + ml_vec3f_set_length(diff.vec, arg3 * 4.00f); + } else { + ml_vec3f_set_length(diff.vec, arg3 * 1.00f); + } + } else { + ml_vec3f_set_length(diff.vec, arg3); + } + + this->position_x += (this->velocity_x * dt) + (diff.vec_x * dt * dt); + this->position_y += (this->velocity_y * dt) + (diff.vec_y * dt * dt); + this->position_z += (this->velocity_z * dt) + (diff.vec_z * dt * dt); + + this->velocity_x += (diff.vec_x * dt); + this->velocity_y += (diff.vec_y * dt); + this->velocity_z += (diff.vec_z * dt); + + // has to be z^2 + (x^2 + y^2) for whacky compiler reasons ? Is there a Macro for this ? + if (v_max < gu_sqrtf( + (this->velocity_z * this->velocity_z) + + ((this->velocity_x * this->velocity_x) + + (this->velocity_y * this->velocity_y)) )) { + + ml_vec3f_set_length(this->velocity, v_max); + } + + next.pos_x = this->velocity_x + this->position_x; + next.pos_y = this->velocity_y + this->position_y; + next.pos_z = this->velocity_z + this->position_z; + + func_80258A4C(this->position, this->yaw - 90.0f, &next.pos_x, &temp.pos_z, &temp.pos_y, &temp.pos_x); + + this->yaw += (arg4 * temp.pos_x * dt); + + if (ml_vec3f_distance(this->position, arg1) < arg6) { + return 1; + } + return 0; +} + +void func_8038770C(Actor *actor) { + ActorLocal_fight_180 *local; + + local = (ActorLocal_fight_180 *)&actor->local; + local->unk1 = 0; + local->unk2 = 0; + local->unk3 = 0; + local->unk4 = 0; + local->unk6 = 0; + local->unkA = 0; +} + +void func_80387728(ActorMarker *this, u32 arg1) +{ + Actor *actor = marker_getActor(this); + ActorLocal_fight_180 *local = (ActorLocal_fight_180 *) &actor->local; + + local->unk0 = arg1; + func_8038770C(actor); + func_80386600(actor->marker, 0); + func_80386628(actor->marker, 1); + + switch(arg1) + { + case 0: + func_80328B8C(actor, 1, 0.0001f, 1); + timed_setCameraToNode(0.0f, 0); + func_80324E88(2.0f); + timed_setCameraToNode(2.0f, 1); + timedFunc_set_1(2.0f, (TFQM1)func_8038B780, reinterpret_cast(s32, actor->marker)); + return; + + case 1: + func_80328B8C(actor, 2, 0.0001f, 1); + func_8030E878(SFX_EA_GRUNTY_LAUGH_1, randf2(0.95f, 1.05f), 32000, actor->position, 5000.0f, 12000.0f); + local->unk5 = 0x0; + actor->unk1C_x = D_803927D0[(local->unk5)][0]; + actor->unk1C_y = D_803927D0[(local->unk5)][1]; + actor->unk1C_z = D_803927D0[(local->unk5)][2]; + local->unk10 = 0; + if (actor->unk44_31 == 0) + { + actor->unk44_31 = (u8)func_8030D90C(); + sfxsource_setSfxId(actor->unk44_31, SFX_152_MOTOR_BREAKDOWN_01); + func_8030DD14(actor->unk44_31, 3); + func_8030DBB4(actor->unk44_31, 1.0f); + sfxsource_setSampleRate(actor->unk44_31, 0x7D00); + } + return; + + case 2: + func_80328B8C(actor, 0xE, 0.0001f, 1); + local->unk5 = 0x8; + actor->unk1C_x = D_803927D0[(local->unk5)][0]; + actor->unk1C_y = D_803927D0[(local->unk5)][1]; + actor->unk1C_z = D_803927D0[(local->unk5)][2]; + func_80311480(randi2(0, 5) + 0x1106, 4, NULL, NULL, NULL, NULL); + return; + + + case 3: + func_80328B8C(actor, 0x15, 0.0001f, 1); + local->unk5 = 0xC; + actor->unk1C_x = D_803927D0[(local->unk5)][0]; + actor->unk1C_y = D_803927D0[(local->unk5)][1]; + actor->unk1C_z = D_803927D0[(local->unk5)][2]; + actor->unk60 = 15.0f; + return; + + case 4: + func_80328B8C(actor, 0x1C, 0.0001f, 1); + local->unk5 = 0x10; + actor->unk1C_x = D_803927D0[(local->unk5)][0]; + actor->unk1C_y = D_803927D0[(local->unk5)][1]; + actor->unk1C_z = D_803927D0[(local->unk5)][2]; + return; + + case 5: + func_80386628(actor->marker, 0); + func_8038AC88(actor, 0x24); + actor_loopAnimation(actor); + } +} + +void func_80387ACC(Actor *arg0, f32 arg1) { + func_80328CA8(arg0, 0); + func_80328FF0(arg0, arg1); +} + +void func_80387B00(Actor *this) { + ActorLocal_fight_180 *local; + f32 sp28[3]; + + local = (ActorLocal_fight_180 *) this->local; + + func_80386B54(sp28, 0.80f); + this->unk1C_x = sp28[0]; + this->unk1C_y = sp28[1]; + this->unk1C_z = sp28[2]; + this->unk1C_y = 0; + + this->velocity_x = this->position_x - sp28[0]; + this->velocity_y = this->position_y - sp28[1]; + this->velocity_z = this->position_z - sp28[2]; + this->velocity_y = 0; + + local->unk14 = gu_sqrtf( + (this->velocity_z * this->velocity_z) + + ((this->velocity_x * this->velocity_x) + + (this->velocity_y * (this->velocity_y))) + ); + + ml_vec3f_normalize(this->velocity); + this->yaw_moving = func_8025715C(this->velocity_x, this->velocity_z) + 180.0f; + + local->unk18 = this->position_y; + local->unk1C = (f64) sp28[1]; + local->unk20 = local->unk14; +} + +void func_80387BFC(Actor *this, f32 arg1) { + ActorLocal_fight_180 *local; + f32 sp58; + f32 sp54; + f32 sp50; + f32 sp44[3]; + + local = (ActorLocal_fight_180 *) this->local; + sp58 = local->unk14 * local->unk14; + sp54 = local->unk20 * local->unk20; + sp50 = local->unk18 - local->unk1C; + func_80328CA8(this, (s32)func_8025715C((2.0 * local->unk20 * sp50), sp58)); + func_80328FF0(this, arg1); + this->position[0] = this->unk1C[0] + this->velocity[0] * local->unk20; + this->position[1] = this->unk1C[1] + this->velocity[1] * local->unk20; + this->position[2] = this->unk1C[2] + this->velocity[2] * local->unk20; + this->position[1] = local->unk1C + ((sp50 * sp54) / sp58); + sp44[0] = this->velocity[0] * sp58; + sp44[1] = 2.0 * local->unk20 * sp50; + sp44[2] = this->velocity[2] * sp58; + ml_vec3f_normalize(sp44); + sp44[0] *= this->unk28; + sp44[1] *= this->unk28; + sp44[2] *= this->unk28; +} + +void func_80387D4C(Actor *actor) { + ActorLocal_fight_180 *local; + f32 sp20[3]; + + local = (ActorLocal_fight_180 *) actor->local; + + actor->position[0] = actor->unk1C[0] + actor->velocity[0] * local->unk20; + actor->position[2] = actor->unk1C[2] + actor->velocity[2] * local->unk20; + actor->position[1] = local->unk1C - local->unk2C * local->unk20; + + sp20[0] = actor->velocity[0] * local->unk14; + sp20[1] = -2.0 * (100.0f - local->unk1C); + sp20[2] = actor->velocity[2] * local->unk14; + + ml_vec3f_normalize(sp20, actor); + sp20[0] = sp20[0] * actor->unk28; + sp20[1] = sp20[1] * actor->unk28; + sp20[2] = sp20[2] * actor->unk28; +} + +void func_80387E1C(Actor *this, f32 arg1[3]) { + ActorLocal_fight_180 *local; + f32 dz; + f32 distance; + f32 dx; + f32 min_distance; + s32 i; + + local = (ActorLocal_fight_180 *)&this->local; + min_distance = 1e+8f; + for(i = 0; i < 8; i++){ + dx = D_803927D0[i][0] - this->position[0]; + dz = D_803927D0[i][2] - this->position[2]; + distance = (dx * dx) + (dz * dz); + if (distance < min_distance) { + local->unk5 = i; + min_distance = distance; + arg1[0] = D_803927D0[local->unk5][0]; + arg1[1] = D_803927D0[local->unk5][1]; + arg1[2] = D_803927D0[local->unk5][2]; + } + } +} + + + +void func_80387F70(Actor *actor, f32 *arg1, f32 arg2) { + ActorLocal_fight_180 *temp_v0; + f32 vec[3]; + f32 playerPos[3]; + + temp_v0 = (ActorLocal_fight_180 *) &actor->local; + player_getPosition(playerPos); + vec[0] = D_803927D0[temp_v0->unk5][0] - playerPos[0]; + vec[1] = D_803927D0[temp_v0->unk5][1] - playerPos[1]; + vec[2] = D_803927D0[temp_v0->unk5][2] - playerPos[2]; + ml_vec3f_normalize(vec); + arg1[0] = D_803927D0[temp_v0->unk5][0] + (arg2 * vec[0]); + arg1[1] = D_803927D0[temp_v0->unk5][1] + (arg2 * vec[1]); + arg1[2] = D_803927D0[temp_v0->unk5][2] + (arg2 * vec[2]); +} + +void func_803880A0(Actor *actor, f32 arg1) { + actor->velocity[2] = arg1; + actor->velocity[1] = 0.0f; + actor->velocity[0] = 0.0f; + ml_vec3f_yaw_rotate_copy(actor->velocity, actor->velocity, actor->yaw); +} + +void func_803880E0(ActorMarker *marker, enum asset_e text_id, s32 arg2) { + func_80388184(marker_getActor(marker), 0xC); +} + +void func_80388110(ActorMarker *marker, enum asset_e text_id, s32 arg2) { + Actor *actor; + ActorLocal_fight_180 *actorLocal; + + actor = marker_getActor(marker); + actorLocal = (ActorLocal_fight_180 *)&actor->local; + func_802BAE4C(); + func_80311480(randi2(0, 5) + 0x1101, 4, NULL, actor->marker, func_803880E0, NULL); + actorLocal->unk9 = (u8)1; +} + +void func_80388184(Actor *this, s32 next_state) { + ActorLocal_fight_180 *local; + s32 sp40; + f32 sp3C; + f32 temp_f12; + + local = (ActorLocal_fight_180 *)&this->local; + sp40 = func_8023DB5C(); + sp3C = animctrl_getAnimTimer(this->animctrl); + local->unk0 = 1; + func_80328B8C(this, next_state, 0.0001f, 1); + actor_loopAnimation(this); + func_80386600(this->marker, 0); + if (next_state != 9) { + if (func_8030E3FC(this->unk44_31)) { + func_8030E394(this->unk44_31); + FUNC_8030E624(SFX_162_MOTOR_RUCKUS, 1.0f, 32000); + + } + } + switch (next_state) { + case 2: + func_80387E1C(this, this->unk1C); + break; + case 5: + if ((sp40 & 1) == 0) { + func_8030E878(SFX_142_GRUNTY_LAUGH_3, randf2(0.95f, 1.05f), 32000, this->position, 5000.0f, 12000.0f); + } else { + func_8030E878(SFX_14B_GRUNTY_LAUGH_4, randf2(0.95f, 1.05f), 32000, this->position, 5000.0f, 12000.0f); + } + this->unk28 = 0.0f; + this->unk60 = 0.0f; + break; + case 6: + local = local; + func_80386600(this->marker, 1); + func_80324D54(0.4f, SFX_C1_BUZZBOMB_ATTACK, 0.85f, 32000, this->position, 5000.0f, 12000.0f); + this->unk28 = 0.0f; + func_80387B00(this); + local->unkA = 0; + break; + case 7: + local->unk14 = (local->unk14 > 2000.0f) ? local->unk14 : 2000.0f; + local->unk14 = (local->unk14 < 2700.0f) ? local->unk14 : 2700.0f; + local->unk18 = 400.0f; + local->unk28 = (-this->unk28 * this->unk28) / (2.0 * local->unk14); + func_80386600(this->marker, 1); + animctrl_setAnimTimer(this->animctrl, sp3C); + break; + case 8: + temp_f12 = 1150.0f; + local->unk28 = (-this->unk28 * this->unk28) / (2.0 * temp_f12); + local->unk2C = (100.0f - local->unk1C) / temp_f12; + break; + case 9: + actor_playAnimationOnce(this); + animctrl_setAnimTimer(this->animctrl, sp3C); + break; + case 10: + func_8030E878(SFX_EA_GRUNTY_LAUGH_1, randf2(0.95f, 1.05f), 32000, this->position, 5000.0f, 12000.0f); + break; + case 12: + func_8025A6EC(SFX_GRUNTY_SPELL_POWERUP, 30000); + break; + case 13: + func_8030E878(SFX_131_GRUNTY_WEEEGH, randf2(0.95f, 1.05f), 32000, this->position, 5000.0f, 12000.0f); + if ((s32) local->unk1 >= 4) { + func_802C3C88((GenMethod_1)func_80386DE4, reinterpret_cast(s32, this->marker)); + func_80388110(this->marker, 0, 0); + } + break; + } +} + + +void func_8038856C(Actor *actor, f32 *arg1) { + f32 vec[3]; + ActorMarker *marker; + + marker = actor->marker; + if (marker->unk14_21) { + func_8034A174(marker->unk44, 7, vec); + } else { + vec[0] = actor->position[0]; + vec[1] = actor->position[1]; + vec[2] = actor->position[2]; + } + func_8038679C(vec, 2, arg1); +} + +void func_803885DC(Actor *this) { + s32 sp24 = func_8023DB5C(); + + if (func_8030E3FC(this->unk44_31) == 0) { + func_8030E2C4(this->unk44_31); + } + if (((sp24 & 7) == 0) && (randf() < 0.5)) { + func_8038856C(this, D_80391728); + } + if ((actor_animationIsAt(this, 0.30f) != 0) || (actor_animationIsAt(this, 0.78f) != 0)) { + FUNC_8030E8B4(SFX_1E_HITTING_AN_ENEMY_2, 1.0f, 25000, this->position, 2000, 10000); + FUNC_8030E8B4(SFX_8E_GRUNTLING_DAMAGE, 1.0f, 25000, this->position, 2000, 10000); + } + if ((actor_animationIsAt(this, 0.40f) != 0) || (actor_animationIsAt(this, 0.88f) != 0)) { + FUNC_8030E8B4(SFX_1E_HITTING_AN_ENEMY_2, 1.0f, 25000, this->position, 2000, 10000); + FUNC_8030E8B4(SFX_8E_GRUNTLING_DAMAGE, 0.9f, 25000, this->position, 2000, 10000); + + } +} + +s32 func_8038871C(Actor *arg0, f32 arg1, f32 arg2) { + if (arg0->position[1] + arg2 > arg1) { + arg0->position[1] = arg1; + return 1; + } + else + { + arg0->position[1] = arg0->position[1] + arg2; + return 0; + } +} + +void func_80388758(ActorMarker *marker) { + Actor *this; + ActorLocal_fight_180 *local; + f32 sp54; + f32 sp50; + s32 var_a0; + f32 sp40[3]; + + this = marker_getActor(marker); + local = (ActorLocal_fight_180 *)&this->local; + sp54 = time_getDelta(); + switch (this->state) { + case 2: + func_80386600(this->marker, 0); + func_803869BC(this); + func_80387ACC(this, 60.0f * sp54); + func_80387F70(this, this->unk1C, 950.0f); + if (func_80387470(this, this->unk1C, 1000.0f, 1800.0f, 200.0f, 1000.0f, 600.0f)) { + func_80388184(this, 3); + this->unk1C[0] = D_803927D0[local->unk5][0]; + this->unk1C[1] = D_803927D0[local->unk5][1]; + this->unk1C[2] = D_803927D0[local->unk5][2]; + } + break; + case 3: + func_80386600(this->marker, 0); + func_803869BC(this); + sp50 = ml_map_f(ml_vec3f_distance(this->position, this->unk1C), 300.0f, 1000.0f, 100.0f, 1000.0f); + func_80387ACC(this, 60.0f * sp54); + if (func_80387470(this, this->unk1C, sp50, 1800.0f, 200.0f, 500.0f, 300.0f)) { + func_80388184(this, 4); + } + break; + case 4: + func_80386600(this->marker, 0); + func_803869BC(this); + func_80387ACC(this, 60.0f * sp54); + if (func_80386BEC(this, 240.0f * sp54)) { + func_80388184(this, 5); + func_80386654(1.0f, D_80391380, D_80391390); + } + break; + case 5: + func_80387B00(this); + this->unk60 += sp54; + if (this->unk60 < 0.3333333333333333) { + this->unk28 += 3300.0 * sp54; + } else if (0.7333333333333334 < this->unk60) { + this->unk28 -= 3300.0 * sp54; + } + local->unk20 += this->unk28 * sp54; + func_80387BFC(this, 45.0f * sp54); + func_80328FB0(this, 30.0f * sp54); + if (this->unk60 > 1.0) { + func_80388184(this, 6); + } + break; + case 6: + func_803869BC(this); + if (local->unk4 >= (local->unk1 + 1)) { + this->unk28 += (D_80391738[local->unk1] * sp54) * 0.66; + } else { + this->unk28 += D_80391738[local->unk1] * sp54; + } + local->unk20 -= this->unk28 * sp54; + func_80387BFC(this, 180.0f * sp54); + func_80328FB0(this, 30.0f * sp54); + if ((local->unkA == 0) && (local->unk20 < (local->unk14 * 0.65))) { + local->unkA = 1U; + FUNC_8030E8B4(SFX_C4_TWINKLY_MUNCHER_GRR, 0.6f, 28000, this->position, 2000, 10000); + } + if ((local->unk14 * 0.75) < local->unk20) { + func_80386B54(sp40, 0); + this->unk1C[0] = sp40[0]; + this->unk1C[1] = sp40[1]; + this->unk1C[2] = sp40[2]; + this->unk1C[1] = 0.0f; + this->velocity[0] = this->position[0] - sp40[0]; + this->velocity[1] = this->position[1] - sp40[1]; + this->velocity[2] = this->position[2] - sp40[2]; + this->velocity[1] = 0.0f; + ml_vec3f_normalize(this->velocity); + this->yaw_moving = func_8025715C(this->velocity[0], this->velocity[2]) + 180.0f; + } + if (local->unk20 < 0.0) { + var_a0 = (local->unk1 == 0) ? 1 : 0; + if (local->unk4 >= (var_a0 + local->unk1)) { + func_80388184(this, 8); + local->unk4 = 0; + } + else{ + func_80388184(this, 7); + local->unk4++; + } + } + break; + case 7: + func_803869BC(this); + this->unk28 = this->unk28 + local->unk28 * sp54; + local->unk20 = local->unk20 - this->unk28 * sp54; + func_80387BFC(this, 180.0f * sp54); + func_80328FB0(this, 30.0f * sp54); + if (this->unk28 < 0) { + func_80388184(this, 4); + func_80386654(1.5f, D_80391390, D_80391380); + } + break; + case 8: + func_803885DC(this); + func_803869BC(this); + this->unk28 = this->unk28 + local->unk28 * sp54; + local->unk20 = local->unk20 - this->unk28 * sp54; + func_80387ACC(this, 60.0f * sp54); + func_80387D4C(this); + func_80328FB0(this, 30.0f * sp54); + if (this->unk28 < 0) { + func_80388184(this, 9); + func_80386654(2.0f, D_80391390, D_80391380); + this->unk60 = 4.0f; + } + break; + case 9: + func_803885DC(this); + if (this->unk60 > 0.0) { + this->unk60 -= sp54; + } + else{ + if (actor_animationIsAt(this, 0.9999f)) { + func_80388184(this, 2); + func_803880A0(this, 2000.0f); + } + } + break; + case 10: + func_80387ACC(this, 60.0f * sp54); + func_80386BEC(this, 30.0f); + func_8038871C(this, 460.0f, 400.0f * sp54); + func_80387340(this, 1.0f); + if (actor_animationIsAt(this, 0.9999f)) { + func_80388184(this, 2); + func_803880A0(this, 2000.0f); + } + break; + case 11: + func_80387ACC(this, 60.0f * sp54); + func_80386BEC(this, 30.0f); + if (local->unk9) { + func_8038871C(this, 460.0f, 400.0f * sp54); + } + break; + case 12: + func_80387ACC(this, 60.0f * sp54); + func_80386BEC(this, 30.0f); + func_8038871C(this, 460.0f, 400.0f * sp54); + func_803873DC(this, 600.0f, 2000.0f); + if (actor_animationIsAt(this, 0.9999f)) { + func_8030DA44(this->unk44_31); + this->unk44_31 = 0U; + func_80387728(this->marker, 2); + } + break; + case 13: + func_80387ACC(this, 60.0f * sp54); + func_80386BEC(this, 30.0f); + if (actor_animationIsAt(this, 0.9999f)) { + if (local->unk1 >= 4) { + func_80388184(this, 0xB); + } + else{ + func_80388184(this, 0xA); + } + } + break; + } +} + +void func_803891E4(Actor *this, s32 arg1){ + ActorLocal_fight_180 *local; + s32 sp28; + + local = (ActorLocal_fight_180 *)&this->local; + sp28 = func_8023DB5C(); + local->unk0 = 2; + func_80328B8C(this, arg1, 0.0001f, 1); + actor_loopAnimation(this); + switch (arg1) { + case 14: + local->unk5 = local->unk1 + 8; + this->unk1C[0] = D_803927D0[local->unk5][0]; + this->unk1C[1] = D_803927D0[local->unk5][1]; + this->unk1C[2] = D_803927D0[local->unk5][2]; + break; + case 19: + if (sp28 & 1) { + FUNC_8030E8B4(SFX_132_GRUNTY_YOW, 1.0f, 32000, this->position, 7000, 12000); + } + else{ + FUNC_8030E8B4(SFX_133_GRUNTY_OHW, 1.0f, 32000, this->position, 7000, 12000); + } + break; + case 20: + FUNC_8030E8B4(SFX_131_GRUNTY_WEEEGH, 1.0f, 32000, this->position, 5000, 12000); + + local->unkA = 0; + break; + case 17: + func_8025A6EC(SFX_GRUNTY_SPELL_POWERUP, 30000); + break; + } +} + +void func_80389358(ActorMarker *marker, enum asset_e text_id, s32 arg2) { + func_802C3C88((GenMethod_1)func_80386E5C, reinterpret_cast(s32, marker)); +} + +void func_8038938C(ActorMarker *marker) { + Actor *this; + ActorLocal_fight_180 *local; + f32 sp4C; + s32 sp48; + + this = marker_getActor(marker); + local = (ActorLocal_fight_180 *)&this->local; + sp4C = time_getDelta(); + sp48 = local->unk1; + switch (this->state) { + case 14: + func_803869BC(this); + func_80387ACC(this, 30.0f * sp4C); + if (func_80387470(this, this->unk1C, ml_map_f(ml_vec3f_distance(this->position, this->unk1C), 70.0f, 1000.0f, 100.0f, D_80391758[sp48]), D_80391758[sp48] * 2, 160.0f, 500.0f, 70.0f)) { + local->unkA = 1; + func_803891E4(this, 0xF); + } + break; + + case 15: + if (func_80386BEC(this, 9.0f)) { + func_803891E4(this, 0x10); + } + break; + case 16: + func_80386BEC(this, 3.0f); + func_80387340(this, 1.3f); + if (actor_animationIsAt(this, 0.9999f)) { + func_803891E4(this, 0x12); + local->unk3++; + if (local->unk3 >= 4) { + local->unk3 = 0U; + this->unk60 = D_80391748[sp48] * 3.0f; + } + else{ + this->unk60 = D_80391748[sp48]; + } + } + break; + case 17: + func_80386BEC(this, 3.0f); + func_803873DC(this, 1200.0f, 2400.0f); + if (actor_animationIsAt(this, 0.9999f)) { + func_80387728(this->marker, 3); + } + break; + case 18: + func_80386BEC(this, 3.0f); + if (this->unk60 > 0.0) { + this->unk60 = this->unk60 - sp4C; + break; + } + if (func_80386BEC(this, 3.0f)) { + func_803891E4(this, 0x10); + } + break; + case 19: + if (actor_animationIsAt(this, 0.9999f)) { + func_803891E4(this, 0xE); + } + break; + case 20: + if (actor_animationIsAt(this, 0.9999f)) { + if (local->unk1 >= 4) { + func_80311480(randi2(0, 5) + 0x1115, 0x20, NULL, NULL, NULL, NULL); + func_80311480(randi2(0, 3) + 0x111A, 4, NULL, this->marker, NULL, func_80389358); + func_803891E4(this, 0x11); + } + else{ + func_803891E4(this, 0xE); + func_803880A0(this, 2000.0f); + } + } + break; + } +} + +void func_80389720(s32 arg0) { + static u8 pad[0x10]; + static f32 D_80392750; + s32 pad24; + s32 pad20; + Actor *sp1C; + ActorLocal_fight_180 *local; + // f32 tmp_a2; + + local = (ActorLocal_fight_180 *)&func_80326EEC(0x38B)->local; + + switch (arg0) { + case 1: + sp1C = func_8032813C(0x3A2, D_80391768, 0x87); + D_803927B0[0] = sp1C->marker; + break; + case 2: + sp1C = func_8032813C(0x3A2, D_80391774, 0x2D); + D_803927B0[1] = sp1C->marker; + break; + case 3: + sp1C = func_8032813C(0x3A2, D_80391780, 0x13B); + D_803927B0[2] = sp1C->marker; + break; + case 4: + sp1C = func_8032813C(0x3A2, D_8039178C, 0xE1); + D_803927B0[3] = sp1C->marker; + break; + case 5: + //closest non-static match + // D_80392750 = tmp_a2 = ((local->unk7) ? 0.0f : 180.0f); + // sp1C = func_8032813C(0x3A9, D_80391798, (s32)tmp_a2); + D_80392750 = ((local->unk7) ? 0.0f : 180.0f); + sp1C = func_8032813C(0x3A9, D_80391798, (s32)D_80392750); + break; + } + sp1C->unk60 = (arg0 == 5) ? 5.25f : 1.54f; + sp1C->unkF4_8 = arg0; +} + +void func_803898A4(s32 arg0) { + s32 *arg0ptr = &arg0; // Does not match without the pointer + func_802C3C88(&func_80389720, *arg0ptr); +} + +void func_803898D0(ActorMarker *marker) { + Actor *actor; + + actor = marker_getActor(marker); + actor->unk100 = spawn_child_actor(0x3AB, &actor)->marker; + D_803927C5 = (u8)1; +} + +void func_80389918(ActorMarker *arg0) { + func_802C3C88((GenMethod_1)func_803898D0, reinterpret_cast(s32, arg0)); +} + +void func_80389944(ActorMarker *marker, enum asset_e text_id, s32 arg2) { + Actor *actor; + + actor = marker_getActor(marker); + func_802BAE4C(); + func_80324E38(0, 0); + func_80387728(actor->marker, 4); +} + +void func_8038998C(Actor *this, s32 arg1) { + ActorLocal_fight_180 *local; + s32 i; + + local = (ActorLocal_fight_180 *)&this->local; + local->unk0 = 3; + func_80328B8C(this, arg1, 0.0001f, 1); + switch (arg1) { + case 21: + if((local->unk5 + 1) < 0x10) { + local->unk5++; + } else{ + local->unk5 = 0xC; + } + this->unk1C[0] = D_803927D0[local->unk5][0]; + this->unk1C[1] = D_803927D0[local->unk5][1]; + this->unk1C[2] = D_803927D0[local->unk5][2]; + for(i = 0; i < 3; i++){ + this->unk1C[i] += randf2(-120.0f, 120.0f); + }; + break; + case 24: + local->unk3 = 0; + break; + case 25: + FUNC_8030E8B4(SFX_131_GRUNTY_WEEEGH, 1.0f, 32000, this->position, 5000, 12000); + break; + case 26: + func_80386CF8(this); + func_80324E38(0.0f, 1); + func_80311480(randi2(0, 5) + 0x112C, 0xA8, NULL, this->marker, func_80389944, NULL); + break; + } +} + +void func_80389B44(ActorMarker *marker) { + func_802C3C88((GenMethod_1)func_80386DE4, reinterpret_cast(s32, marker)); +} + +void func_80389B70(ActorMarker *marker) { + Actor *this; + ActorLocal_fight_180 *local; + f32 sp3C; + s32 sp38; + f32 sp34; + Actor *temp_v0; + f32 temp_f0; + f64 temp_f0_2; + u32 temp_t0; + u8 temp_v0_2; + + this = marker_getActor(marker); + local = (ActorLocal_fight_180 *)&this->local; + sp3C = time_getDelta(); + sp38 = local->unk1; + sp34 = animctrl_getAnimTimer(this->animctrl); + switch (this->state) { + case 21: + func_803869BC(this); + this->unk60 -= sp3C; + if (this->unk60 < 0.0) { + if (local->unkA) { + func_8038998C(this, 0x17); + } else { + func_8038998C(this, 0x16); + this->unk60 = D_803917B4[local->unk1]; + } + local->unkA = NOT(local->unkA); + break; + } + if (func_80387470(this, this->unk1C, D_803917A4[sp38], D_803917A4[sp38], 120.0f, 520.0f, 350.0f)) { + func_8038998C(this, 0x15); + if (local->unkB == 0) { + local->unkB = 1; + timedFunc_set_1(1.2f, (TFQM1)func_80389B44, (s32) this->marker); + } + } + break; + case 22: + this->unk60 -= sp3C; + if (this->unk60 < 0.0) { + func_8038998C(this, 0x15); + this->unk60 = 5.0f; + } + break; + case 23: + if (func_80386BEC(this, 9.0f) && (func_80297C6C() != 3)) { + func_8038998C(this, 0x18); + } + break; + case 24: + func_80386BEC(this, 3.0f); + if (func_80387340(this, 1.3f)) { + local->unk3++; + } + if (actor_animationIsAt(this, 0.9999f)) { + if (local->unk3 >= local->unk1) { + if (local->unk1 >= 4) { + func_8038998C(this, 0x1A); + } + else{ + this->unk60 = 5.0f; + func_8038998C(this, 0x15); + } + } + } + break; + case 25: + if (actor_animationIsAt(this, 0.9999f)) { + func_8038998C(this, 0x17); + } + break; + case 26: + if (actor_animationIsAt(this, 0.1f) != 0) { + func_80324CFC(0.0f, COMUSIC_43_ENTER_LEVEL_GLITTER, 0x7FFF); + } + if ((0.1 < sp34) && (sp34 < 0.8)) { + func_8034A174(this->marker->unk44, 8, D_803928B8); + func_80386934(D_803928B8, 0x716); + func_8034A174(this->marker->unk44, 9, D_803928B8); + func_80386934(D_803928B8, 0x716); + } + if (actor_animationIsAt(this, 0.38f) ) { + func_80389918(this->marker); + } + if (actor_animationIsAt(this, 0.9999f)) { + func_80324D2C(0.0f, COMUSIC_43_ENTER_LEVEL_GLITTER); + func_80386E34(); + func_8038998C(this, 0x1B); + } + break; + case 27: + break; + } +} + + +void func_80389F54(void) { + func_80320004(0xD2, 1); + D_803927C4 = (u8)0; +} + +#ifndef NONMATCHING //matches if .bss defined +#pragma GLOBAL_ASM("asm/nonmatchings/fight/code_180/func_80389F7C.s") +#else + +void func_80389F7C(Actor *this, s32 arg1) { + ActorLocal_fight_180 *local; + f32 sp48; + f32 sp3C[3]; + s32 i; + static s32 D_803928C4; + // static u8 pad[0x180]; + + local = (ActorLocal_fight_180 *)&this->local; + sp48 = animctrl_getAnimTimer(this->animctrl); + local->unk0 = 4; + func_80328B8C(this, arg1, 0.0001f, 1); + switch (arg1) { + case 28: + animctrl_setAnimTimer(this->animctrl, sp48); + this->unk1C[0] = D_803927D0[0x10][0]; + this->unk1C[1] = D_803927D0[0x10][1]; + this->unk1C[2] = D_803927D0[0x10][2]; + break; + + case 30: + if ((local->unk3 == 2) && (local->unkA == 0)) { + D_803927C8 = 1; + func_80311480(randi2(0, 5) + 0x1136, 4, NULL, NULL, NULL, NULL); + if (func_8031FF1C(0xD2) == 0) { + local->unkA = 1U; + D_803927C4 = 1; + func_80324E38(0.0f, 1); + timedFunc_set_1(0.0f, func_803898A4, 1); + timed_setCameraToNode(0.0f, 4); + func_80324E88(2.2f); + timedFunc_set_1(2.2f, func_803898A4, 2); + timed_setCameraToNode(2.2f, 5); + func_80324E88(4.4f); + timedFunc_set_1(4.4f, func_803898A4, 3); + timed_setCameraToNode(4.4f, 6); + func_80324E88(6.6f); + timedFunc_set_1(6.6f, func_803898A4, 4); + timed_setCameraToNode(6.6f, 7); + func_80324E88(8.8f); + timedFunc_set_0(8.8f, func_80389F54); + func_80324E38(8.8f, 0); + break; + } + for(D_803928C4 = 1; D_803928C4 < 5; D_803928C4++){ + func_803898A4(D_803928C4); + } + } + break; + + case 32: + func_8030E878(SFX_131_GRUNTY_WEEEGH, randf2(0.95f, 1.05f), 32000, this->position, 5000.0f, 12000.0f); + func_802C9334(0x24, this); + return; + case 33: + FUNC_8030E624(SFX_131_GRUNTY_WEEEGH, 1.0f, 32000); + timed_playSfx(0.6f, SFX_61_CARTOONY_FALL, 1.0f, 32000); + func_802C3C88(func_80386DE4, this->marker); + FUNC_8030E624(SFX_D9_WOODEN_CRATE_BREAKING_1, 1.0f, 32000); + func_80386628(this->marker, 0); + func_803866E4(this->position, 0x552, 1); + func_803866E4(this->position, 0x553, 0xC); + func_803866E4(this->position, 0x554, 0x14); + func_803866E4(this->position, 0x555, 2); + sp3C[0] = D_803927D0[local->unk7 + 0x11][0] - this->position[0]; + sp3C[1] = D_803927D0[local->unk7 + 0x11][1] - this->position[1]; + sp3C[2] = D_803927D0[local->unk7 + 0x11][2] - this->position[2]; + this->velocity[0] = sp3C[0] / 1.7; + this->velocity[1] = sp3C[1] / 1.7 - -1190.0; + this->velocity[2] = sp3C[2] / 1.7; + func_8028F94C(2, this->position, local); + if (local->unk7 == 0) { + timed_setCameraToNode(0.0f, 0xA); + func_80324E88(1.7f); + timed_setCameraToNode(1.7f, 0xB); + } + else{ + timed_setCameraToNode(0.0f, 0xC); + func_80324E88(1.7f); + timed_setCameraToNode(1.7f, 0xD); + } + break; + case 34: + actor_playAnimationOnce(this); + func_80311480(randi2(0, 5) + 0x1145, 0x20, NULL, NULL, NULL, NULL); + func_8030E6A4(SFX_1F_HITTING_AN_ENEMY_3, randf2(0.95f, 1.05f), 32000); + func_8030E6A4(SFX_133_GRUNTY_OHW, randf2(0.95f, 1.05f), 32000); + this->unk44_31 = func_8030D90C(); + D_803927C0 = 1.0f; + sfxsource_setSfxId(this->unk44_31, SFX_2C_PULLING_NOISE); + func_8030DD14(this->unk44_31, 2); + func_8030DBB4(this->unk44_31, D_803927C0); + sfxsource_setSampleRate(this->unk44_31, 26000); + for(i = 0; i < 4; i++){ + if(D_803927B0[i] != NULL){ + marker_despawn(D_803927B0[i]); + D_803927B0[i] = NULL; + } + } + break; + } +} +#endif + +ActorMarker *func_8038A4E8(Actor *this, f32 arg1) { + Actor *actor; + Prop *prop; + u32 temp_t0; + + func_80320ED8(this->marker, arg1, 1); + prop = func_8032F528(); + while(prop !=NULL){ + if (prop->markerFlag){ + actor = marker_getActor(prop->actorProp.marker); + temp_t0 = actor->marker->unk14_20; + if((temp_t0 == 0x27B) || (temp_t0 == 0x27C) || (temp_t0 == 0x27D) || (temp_t0 == 0x27E) || (temp_t0 == 0x285)) { + while (func_8032F528() != NULL) {} + return actor->marker; + } + } + prop = func_8032F528(); + } + return NULL; +} + +#ifndef NONMATCHING //matches if .rodata defined +void func_8038A5F4(ActorMarker *marker); +#pragma GLOBAL_ASM("asm/nonmatchings/fight/code_180/func_8038A5F4.s") +#else +void func_8038A5F4(ActorMarker *marker) { + Actor *this; + ActorLocal_fight_180 *local; + f32 sp74; + s32 sp70; + ActorMarker *sp6C; + f32 temp_f2; + f32 sp5C[3]; + f32 sp58; + u32 temp_t6; + u8 var_a0; + u8 var_v1; + + this = marker_getActor(marker); + local = (ActorLocal_fight_180 *) &this->local; + sp74 = time_getDelta(); + sp70 = local->unk1; + sp6C = func_8038A4E8(this, func_8033229C(this->marker)); + if (sp6C != NULL) { + func_8038D214(sp6C); + if (!func_8031FF1C(0xD1)) { + func_80320004(0xD1, 1); + D_803927C4 = 0; + func_80324E88(1.0f); + func_80324E38(1.0f, 0); + } + if (local->unk1 == 0) { + func_80311480(randi2(0, 5) + 0x1140, 0x20, NULL, NULL, NULL, NULL); + } + if ((local->unk1 + 1) < 4) { + local->unk1++; + func_80389F7C(this, 0x20); + return; + } + temp_t6 = marker_getActor(sp6C)->marker->unk14_20; + if ((temp_t6 == 0x27B) || (temp_t6 == 0x27E)) { + local->unk7 = FALSE; + } else { + local->unk7 = TRUE; + } + func_80389F7C(this, 0x21); + return; + } + switch (this->state) { + case 28: + func_803869BC(this); + if (func_80387470(this, this->unk1C, 500.0f, 1000.0f, 140.0f, 500.0f, 120.0f)) { + func_80389F7C(this, 0x1D); + } + break; + + case 29: + if ((func_80386BEC(this, 9.0f)) && (func_80297C6C() != 3) && (D_803927C4 == 0)) { + func_80389F7C(this, 0x1E); + } + break; + + case 30: + func_80386BEC(this, 3.0f); + if (D_803927C4 == 0) { + func_80387340(this, 1.0f); + if (actor_animationIsAt(this, 0.9999f)) { + local->unk3++; + func_80389F7C(this, 0x1F); + this->unk60 = D_803917D0[sp70]; + } + } else { + func_80389F7C(this, 0x1D); + } + break; + + case 31: + func_80386BEC(this, 3.0f); + if (this->unk60 > 0.0) { + this->unk60 -= sp74; + } + if (func_80386BEC(this, 3.0f)) { + func_80389F7C(this, 0x1E); + } + break; + + case 32: + if (actor_animationIsAt(this, 0.9999f)) { + func_80389F7C(this, 0x1C); + } + break; + + case 33: + func_80386BEC(this, 3.0f); + sp5C[0] = this->position[0] + (this->velocity[0] * sp74); + sp5C[1] = this->position[1] + (this->velocity[1] * sp74); + sp5C[2] = this->position[2] + (this->velocity[2] * sp74); + temp_f2 = func_80309724(&sp5C); + if (sp5C[1] < temp_f2) { + this->position[0] = sp5C[0]; + this->position[1] = sp5C[1]; + this->position[2] = sp5C[2]; + this->position[1] = temp_f2; + func_80389F7C(this, 0x22); + func_8030E6A4(SFX_1F_HITTING_AN_ENEMY_3, randf2(0.95f, 1.05f), 0x7D00); + func_8030E6A4(SFX_132_GRUNTY_YOW, randf2(0.95f, 1.05f), 0x7D00); + } + else{ + this->position[0] = sp5C[0]; + this->position[1] = sp5C[1]; + this->position[2] = sp5C[2]; + this->velocity[1] += -1400.0f * sp74; + } + break; + + case 34: + sp58 = animctrl_getAnimTimer(this->animctrl); + if (actor_animationIsAt(this, 0.17f) != 0) { + func_8030E6A4(SFX_1F_HITTING_AN_ENEMY_3, randf2(0.95f, 1.05f), 0x7D00); + func_8030E6A4(SFX_133_GRUNTY_OHW, randf2(0.95f, 1.05f), 0x7D00); + } + if (actor_animationIsAt(this, 0.1f) != 0) { + func_8030E6A4(SFX_1F_HITTING_AN_ENEMY_3, randf2(0.95f, 1.05f), 0x7D00); + func_8030E6A4(SFX_12A_GRUNTY_AH, randf2(0.95f, 1.05f), 0x7D00); + } + if ((sp58 >= 0.4) && (sp58 <= 0.65)) { + func_8030DBB4(this->unk44_31, ((D_803927C0 += 0.005) > 1.99) ? 1.99 : (D_803927C0 += 0.005)); + func_8030E2C4(this->unk44_31); + } + if (actor_animationIsAt(this, 0.56f)) { + func_8030E6A4(SFX_C5_TWINKLY_POP, randf2(0.95f, 1.05f), 0x7D00); + } + else if (actor_animationIsAt(this, 0.9999f)) { + func_80324E88(0.0f); + func_80324E38(0.0f, 0); + func_80387728(this->marker, 5); + func_8030DA44(this->unk44_31); + this->unk44_31 = 0U; + } + break; + } +} +#endif + +void func_80328B8C(Actor *, s32, f32, s32); + +void func_8038AC50(ActorMarker *arg0) { + func_80328B8C(marker_getActor(arg0), 0x24, 0.0001f, 1); +} + +#ifndef NONMATCHING //matches but requires .rodata +void func_8038AC88(Actor *this, s32 arg1); +#pragma GLOBAL_ASM("asm/nonmatchings/fight/code_180/func_8038AC88.s") +#else +void func_8038AC88(Actor *this, s32 arg1) { + ActorLocal_fight_180 *local; + s32 sp28; + u8 temp_v0; + u8 temp_v0_2; + + + local = (ActorLocal_fight_180 *)&this->local; + sp28 = 0x12; + local->unk0 = 5; + func_80328B8C(this, arg1, 0.0001f, 1); + switch (arg1) { + case 35: + func_80311480(randi2(0, 5) + 0x114F, 4, NULL, NULL, NULL, NULL); + if (local->unk7) { + sp28 = 0x13; + } + func_8028F94C(2, this->position); + timedFunc_set_1(0.0f, func_803898A4, 5); + timed_setCameraToNode(0.0f, sp28); + func_80324E88(7.5f); + timedFunc_set_1(7.5f, func_8038AC50, (s32) this->marker); + func_80324E38(7.5f, 0); + break; + + case 36: + func_8038AC50((s32) this->marker); + break; + + case 37: + local->unk3 = 0; + break; + + case 40: + func_802BB41C(0); + if (this->unk44_31 == 0) { + this->unk44_31 = func_8030D90C(); + sfxsource_setSfxId(this->unk44_31, SFX_134_FREEZING_SHIVER); + func_8030DD14(this->unk44_31, 2); + func_8030DBB4(this->unk44_31, 1.0f); + sfxsource_setSampleRate(this->unk44_31, 0x4268); + } + break; + + case 41: + this->unk7C[2] = 0; + if (this->unk44_31 == 0) { + this->unk44_31 = func_8030D90C(); + sfxsource_setSfxId(this->unk44_31, SFX_134_FREEZING_SHIVER); + func_8030DD14(this->unk44_31, 3); + func_8030DBB4(this->unk44_31, 1.0f); + sfxsource_setSampleRate(this->unk44_31, 0x4268); + func_8030E2C4(this->unk44_31); + } + break; + + case 42: + if (randf() < 0.5) { + func_8030E878(SFX_131_GRUNTY_WEEEGH, randf2(0.95f, 1.05f), 32000, this->position, 5000.0f, 12000.0f); + } + else{ + func_8030E878(SFX_179_GRUNTY_DAMAGE, randf2(0.95f, 1.05f), 32000, this->position, 5000.0f, 12000.0f); + } + break; + + case 38: + func_8025A6EC(SFX_GRUNTY_SPELL_POWERUP, 30000); + break; + + case 43: + func_8030E878(SFX_131_GRUNTY_WEEEGH, randf2(0.95f, 1.05f), 32000, this->position, 5000.0f, 12000.0f); + actor_playAnimationOnce(this); + break; + } +} +#endif + +void func_8038AF84(ActorMarker *arg0) { + func_8038AC88(marker_getActor(arg0), 0x29); +} + +void func_8038AFB0(void) { + func_802E4078(MAP_87_CS_SPIRAL_MOUNTAIN_5, 0, 1); +} + +#ifndef NONMATCHING //matches but requires .rodata +void func_8038AFD8(ActorMarker *marker); +#pragma GLOBAL_ASM("asm/nonmatchings/fight/code_180/func_8038AFD8.s") +#else +void func_8038AFD8(ActorMarker *marker) { + Actor *this; + ActorLocal_fight_180 *local; + f32 sp3C; + s32 sp38; + f32 sp34; + ActorMarker *other_marker; + s32 sp2C; + s32 tmp_v0; + + this = marker_getActor(marker); + local = (ActorLocal_fight_180 *)&this->local; + sp3C = time_getDelta(); + sp38 = 0x14; + sp34 = animctrl_getAnimTimer(this->animctrl); + other_marker = func_8038A4E8(this, func_8033229C(this->marker) / 3.0f); + if ((other_marker != NULL) && (other_marker->unk14_20 == 0x285)) { + if (func_8039125C(other_marker)) { + D_803927C6++; + if (local->unk7) { + sp38 = 0x23; + } + if (0xA > D_803927C6) { + func_802BB3DC(0, 18.0f, 0.9f); + func_80324E88(0.6f); + timed_setCameraToNode(0.6f, sp38 + 3 + D_803927C6); + func_80391070(other_marker, D_803927C6, local->unk7); + func_8038AC88(this, 0x2A); + if (D_803927C6 == 9) { + sp2C = 0x16; + if(local->unk7) sp2C = 0x25; + timedFunc_set_1(2.4f, func_8038AF84, (s32) this->marker); + timed_setCameraToNode(2.4f, sp2C); + func_80324E88(4.4f); + timed_setCameraToNode(4.4f, sp38 + 3 + D_803927C6); + } + } else { + func_802BB3DC(0, 63.0f, 0.9f); + func_803911F8(other_marker); + func_8030E6D4(SFX_HEAVY_THUNDERSTORM_01); + func_8025A6EC(SFX_JINJONATOR_HITS_GRUNTY_J, 0x4E20); + func_8038AC88(this, 0x2B); + func_80324E88(0.0f); + timed_setCameraToNode(0.0f, sp38 + 0xD); + func_8028F85C(D_803917E0); + D_803928C8[0] = 0.0f; + D_803928C8[1] = func_80257204(D_803917E0[0], D_803917E0[2], this->position[0], this->position[2]); + D_803928C8[2] = 0.0f; + func_8028FAEC(&D_803928C8); + } + if (D_803927C6 == 3) { + func_80311480(randi2(0, 5) + 0x1159, 0x20, NULL, NULL, NULL, NULL); + } + } + } + switch (this->state) { + case 35: + func_80386BEC(this, 3.0f); + break; + + case 36: + if (func_80386BEC(this, 9.0f) && (func_80297C6C() != 3)) { + func_8038AC88(this, 0x25); + } + break; + + case 37: + func_80386BEC(this, 3.0f); + if (func_80297C6C() == 3) { + func_8038AC88(this, 0x24); + break; + } + if (func_80387340(this, 1.0f)) { + local->unk3++; + } + if ((actor_animationIsAt(this, 0.9999f)) && (local->unk3 >= 5)) { + func_8038AC88(this, 0x26); + } + break; + + case 38: + func_80386BEC(this, 3.0f); + func_803873DC(this, 700.0f, 2400.0f); + if (actor_animationIsAt(this, 0.9999f)) { + func_8038AC88(this, 0x27); + this->unk60 = 4.0f; + } + break; + + case 39: + if (local->unk8) { + func_80386C68(this, 4.5f); + } else { + func_80386BEC(this, 3.0f); + } + if (this->unk60 > 0.0) { + this->unk60 -= sp3C; + break; + } + if (local->unk8 == 0) { + if (!D_803927C9) { + D_803927C9 = TRUE; + func_8038AC88(this, 0x23); + } + else{ + func_8038AC88(this, 0x25); + } + } + break; + + case 40: + if (actor_animationIsAt(this, 0.21f)) { + FUNC_8030E8B4(SFX_163_GRUNTY_WILD_SCREAM, 1.0f, 32000, this->position, 5000, 12000); + } + if ((0.56 < sp34) && (sp34 < 0.99)) { + func_8030E2C4(this->unk44_31); + } + if (actor_animationIsAt(this, 0.9999f)) { + func_8038AC88(this, 0x27); + func_8030DA44(this->unk44_31); + this->unk44_31 = 0; + } + break; + + case 41: + if (actor_animationIsAt(this, 0.9999f)) { + local->unk2++; + if (local->unk2 == 8) { + u8 v0; + func_802BB3DC(0, 12.0f, 1.0f); + v0 = this->unk44_31; + if (v0 != 0) { + func_8030E394(v0); + func_8030DA44(this->unk44_31); + this->unk44_31 = 0; + } + } + } + break; + + case 42: + if (actor_animationIsAt(this, 0.9999f)) { + func_8038AC88(this, 0x27); + } + break; + + case 43: + if ((actor_animationIsAt(this, 0.1f)) || (actor_animationIsAt(this, 0.24f))) { + func_8038C5F0(this, 0x718, 0x6C2, 2.0f); + } + if (actor_animationIsAt(this, 0.3f)) { + FUNC_8030E624(SFX_164_EH, 1.0f, 25000); + } + if (actor_animationIsAt(this, 0.4f)) { + // func_8030E624(0x89786964U); + FUNC_8030E624(SFX_164_EH, 1.075f, 25000); + } + if (actor_animationIsAt(this, 0.6f)) { + FUNC_8030E624(SFX_164_EH, 1.1f, 25000); + } + if (actor_animationIsAt(this, 0.7f)) { + // func_8030E624(0x93186964U); + FUNC_8030E624(SFX_164_EH, 1.5f, 25000); + } + if (actor_animationIsAt(this, 0.81f)) { + FUNC_8030E624(SFX_130_GRUNTY_ECHOING_CRY, 1.0f, 32000); + } + if (actor_animationIsAt(this, 0.85f)) { + func_803872F8(this); + } + if (actor_animationIsAt(this, 0.9f)) { + func_802BAE4C(); + if (local->unk7 == 0) { + func_802BAEB4(&D_803917EC, this->position); + } else { + func_802BAEB4(&D_803917F8, this->position); + } + func_8038FC2C(1); + timedFunc_set_0(4.8, func_8038AFB0); + } + if (actor_animationIsAt(this, 0.9999f)) { + marker_despawn(this->marker); + } + break; + } +} +#endif + +void func_8038B730(ActorMarker *marker, enum asset_e text_id, s32 arg2) { + Actor *sp1C; + + sp1C = marker_getActor(marker); + func_802BE720(); + func_80324E88(0); + func_8028F784(0); + func_80387728(sp1C->marker, 1); +} + +void func_8038B780(ActorMarker *marker) { + Actor *sp24; + + sp24 = marker_getActor(marker); + if (!func_8031FF1C(0xCF)) { + sp24 = sp24; + func_80320004(0xCF, 1); + func_80311480(0x10E7, 0x2A, sp24->position, sp24->marker, func_8038B730, NULL); + return; + } + sp24 = sp24; + func_80311480(randi2(0, 5) + 0x10E8, 0x2B, sp24->position, sp24->marker, func_8038B730, NULL); +} + +void func_8038B82C(ActorMarker *marker) { return; } + +#ifndef NONMATCHING //matches but requires .rodata +void func_8038B834(ActorMarker *, ActorMarker *); +#pragma GLOBAL_ASM("asm/nonmatchings/fight/code_180/func_8038B834.s") +#else +bool func_8038B834(ActorMarker *marker, ActorMarker * arg1) { + Actor *this; + ActorLocal_fight_180 *local; + + this = marker_getActor(marker); + local = (ActorLocal_fight_180 *)&this->local; + switch (local->unk0) { + case 1: + if ((this->state == 6) || (this->state == 7)) { + marker->unk14_20 = 0x260; + } else { + marker->unk14_20 = 0x25E; + } + break; + case 2: + if (local->unkA == 0) { + marker->unk14_20 = 0x260; + } else { + marker->unk14_20 = 0x281; + } + break; + case 3: + marker->unk14_20 = 0x282; + break; + case 4: + marker->unk14_20 = 0x283; + break; + case 5: + marker->unk14_20 = 0x283; + break; + default: + marker->unk14_20 = 0x25E; + break; + } + return TRUE; +} +#endif + +void func_8038B9AC(ActorMarker *marker, ActorMarker *other_marker) { + Actor *this; + ActorLocal_fight_180 *local; + + this = marker_getActor(marker); + local = (ActorLocal_fight_180 *)&this->local; + switch (local->unk0) { + case 1: + if (local->unk1 == 0) { + func_80311480(randi2(0, 5) + 0x10F7, 0x20, NULL, NULL, NULL, NULL); + } + if ((local->unk1 + 1) < 5) { + local->unk1++; + func_80388184(this, 0xD); + local->unk4 = 0; + } + break; + + case 2: + if (this->state != 0x14) { + if ((local->unk2 + 1) >= 3) { + local->unk2 = 0; + if (local->unk1 == 0) { + func_80311480(randi2(0, 5) + 0x1110, 0x20, NULL, NULL, NULL, NULL); + } + if ((local->unk1 + 1) < 5) { + local->unk1++; + func_803891E4(this, 0x14); + } + } else { + local->unk2++; + func_803891E4(this, 0x13); + } + } + break; + case 3: + if (local->unk1 == 0) { + func_80311480(randi2(0, 5) + 0x1127, 0x20, NULL, NULL, NULL, NULL); + } + if ((local->unk1 + 1) < 5) { + local->unk1++; + func_8038998C(this, 0x19); + if (local->unk1 == 4) { + func_802C3C88((GenMethod_1)func_80386DE4, reinterpret_cast(s32, this->marker)); + } + } + break; + } +} + +void func_8038BB8C(ActorMarker *marker, ActorMarker *other_marker) { + Actor *this; + ActorLocal_fight_180 *local; + u8 temp_v0_2; + + this = marker_getActor(marker); + local = (ActorLocal_fight_180 *)&this->local; + if (local->unk0 == 1) { + func_8030E878(SFX_EA_GRUNTY_LAUGH_1, randf2(D_80392440, D_80392444), 32000, this->position, D_80392448, D_8039244C); + if (local->unk10 == 0) { + if (func_80311480(randi2(0, 5) + 0x10ED, 0, NULL, NULL, NULL, NULL)) { + local->unk10++; + } + } + } + if (local->unk0 == 3) { + temp_v0_2 = local->unk6; + if ((local->unk6 == 0) && (this->state != 0x1A)) { + local->unk6++; + func_80311480(randi2(0, 5) + 0x111D, 0, NULL, NULL, NULL, NULL); + } + } +} + +void func_8038BCB8(ActorMarker *marker) { + Actor *sp1C; + + sp1C = marker_getActor(marker); + D_803927A4 = spawn_child_actor(0x3AF, &sp1C)->marker; +} + +#ifndef NONMATHCING +#pragma GLOBAL_ASM("asm/nonmatchings/fight/code_180/func_8038BCF0.s") +#else +void func_8038BCF0(Actor *this){ + ActorLocal_fight_180 *local; + s32 i; + s32 tmp_s0; + Actor *other; + f32 sp4C[3]; + f32 sp40[3]; + f32 sp34[3]; + + local = (ActorLocal_fight_180 *) &this->local; + if(!this->unk16C_4){ + this->unk16C_4 = TRUE; + func_803300C0(this->marker, func_8038B834); + marker_setCollisionScripts(this->marker, func_8038BB8C, func_8038B9AC, NULL); + this->marker->propPtr->unk8_3 = 0; + actor_collisionOn(this); + for(i = 0x38C; i < 0x39F; i++){ + func_80304E24(i, D_803927D0[i - 0x38C]); + } + D_803927A8 = NULL; + D_803927A4 = NULL; + D_803927C4 = 0; + D_803927C5 = 0; + D_803927C6 = 0; + D_803927C7 = 0; + D_803927C8 = 0; + D_803927C9 = 0; + + local->unk8 = 0; + local->unk9 = 0; + local->unkB = 0; + + for(i = 0; i < 4; i++){ D_803927B0[i] = NULL;} + // D_803927B0[1] = NULL; + // D_803927B0[0] = NULL; + // D_803927B0[2] = NULL; + // D_803927B0[3] = NULL; + + func_802C3C88(func_8038BCB8, this->marker); + func_80387728(this->marker, 0); + local->unk1 = 0; + func_80386600(this->marker, 0); + func_80386628(this->marker, 1); + func_8038FC00(); + + func_80386654(1.0f, D_80391380, D_80391390); + func_8028F784(1); + func_8028F4B8(&D_80391804, 2000.0f, -2800.0f); + func_8028FA14(0x93, 2); + func_8034C9B0(0); + func_80386698(2.0f); + tmp_s0 = func_802F9AA8(SFX_9A_MECHANICAL_CLOSING); + func_802F9DB8(tmp_s0, D_80392450, D_80392450, 0.0f); + func_802F9FD0(tmp_s0, 0.0f, 2.0f, 0.0f); + func_802FA060(tmp_s0, 25000, 25000, 0); + timed_playSfx(2.0f, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 32000); + }//L8038BF0C + switch(local->unk0){ + case 0: + func_8038B82C(this->marker); + break; + case 1: + func_80388758(this->marker); + break; + case 2: + func_8038938C(this->marker); + break; + case 3: + func_80389B70(this->marker); + break; + case 4: + func_8038A5F4(this->marker); + break; + case 5: + func_8038AFD8(this->marker); + break; + } + func_80320524(0x23, local->unk0, 3); + player_getPosition(D_80392788); + D_80392798[0] = this->position[0]; + D_80392798[1] = this->position[1]; + D_80392798[2] = this->position[2]; + if(this->unk100 && D_803927C5){ + func_8038EB90(this->unk100, this->position); + } + + if(D_803927A4){ + other = marker_getActor(D_803927A4); + sp4C[0] = this->position[0];\ + sp4C[1] = this->position[1];\ + sp4C[2] = this->position[2]; + sp4C[1] = 200.0f; + + sp34[0] = this->position[0];\ + sp34[1] = this->position[1];\ + sp34[2] = this->position[2]; + sp34[1] = -50.0f; + if(func_80309B48(sp4C, sp34, sp40, 0)){ + sp34[1] += 6.0f; + other->position[0] = sp34[0];\ + other->position[1] = sp34[1];\ + other->position[2] = sp34[2]; + other->unk1C[0] = this->position_y - sp34[1]; + other->scale = this->scale; + other->unk58_0 = 1; + } + else{//L8038C0B8 + other->unk58_0 = 0; + } + }//L8038C0C8 +} +#endif + +void func_8038C0DC(f32 (*arg0)[3]) { + (*arg0)[0] = D_80392798[0]; + (*arg0)[1] = D_80392798[1]; + (*arg0)[2] = D_80392798[2]; +} + +void func_8038C100() { + D_803927C5 = 0; +} + +void func_8038C10C(s32 arg0) { + func_8038AC88(marker_getActor((ActorMarker*)arg0), 0x28); +} + +void func_8038C138() { + D_803927C7 = 1; +} + +f32 func_80391234(); +f32 func_8038DFA0(); +void func_80324E88(f32); +f32 func_80391240(); + + +// Very minor stack diff +#ifndef NONMATCHING +#pragma GLOBAL_ASM("asm/nonmatchings/fight/code_180/func_8038C148.s") +#else +void func_8038C148(void) { + Actor *sp4C; + ActorLocal_fight_180 *sp48; + f32 temp_f20; + f32 sp40; + f32 temp_f12; + s32 phi_s0; + f32 sp34; + f32 temp_f12_2; + + sp4C = func_80326EEC(0x38B); + sp48 = (ActorLocal_fight_180 *)&sp4C->local; + sp34 = func_8038DFA0(); + temp_f20 = sp34 + func_80391234(); + sp40 = func_80391240(); + phi_s0 = 0x14; + func_80320004(0xFC, 1); + if (sp48->unk7 != 0) { + phi_s0 = 0x23; + } + func_8038AC88(sp4C, 0x27); + sp48->unk8 = (u8)1; + func_80324E38(0, 1); + timed_setCameraToNode(0, phi_s0); + func_80324E88(temp_f20); + timedFunc_set_0(temp_f20 * D_80392470, &func_8038C138); + timed_setCameraToNode(temp_f20, phi_s0 + 1); + temp_f12 = temp_f20 + sp40; + func_80324E88(temp_f12); + timedFunc_set_1(temp_f12, func_8038C10C, (s32)sp4C->marker); + timed_setCameraToNode(temp_f12, phi_s0 + 2); + temp_f12_2 = temp_f12 + D_80392478; + func_80324E88(temp_f12_2); + timed_setCameraToNode(temp_f12_2, phi_s0 + 3); +} +#endif + +void func_8038C27C(s32 arg0) { + D_803927C4 = arg0; +} + +f32 func_8038C288() { + return 3.0f; +} + +s32 func_8038C298() { + return D_803927C7; +} + +s32 func_8038C2A4() { + return D_803927C8; +} + +s32 func_8038C2B0() { + return D_803927C9; +} + diff --git a/src/fight/code_5ED0.c b/src/fight/code_5ED0.c new file mode 100644 index 00000000..065085f4 --- /dev/null +++ b/src/fight/code_5ED0.c @@ -0,0 +1,405 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8024C5CC(f32 (*)[3]); +extern void func_80328B8C(Actor *, s32, f32, s32); +extern void func_80386654(f32 arg0, f32 (*arg1)[4], f32 (*arg2)[4]); +extern void func_80324CFC(f32, enum comusic_e, s32); +extern void func_80387470(Actor *, f32 [3], f32, f32, f32, f32, f32); +extern void func_80329904(ActorMarker*, s32, f32*); + + +void func_8038C840(Actor *this); +void func_8038D014(Actor *this); + +/* .data */ +ActorAnimationInfo D_80391810[] = { + {0, 0.0f}, + {0x264, 1000000.0f}, + {0x264, 2.26f}, + {0x130, 1.75f}, + {0x131, 2.13333f}, + {0x262, 2.0f} +}; + +ActorInfo D_80391840 = { + 0x27B, 0x3A5, 0x3BC, 0x1, D_80391810, + func_8038C840, func_8038D014, func_80325888, + 0, 0, 1.0f, 0 +}; + +ActorInfo D_80391864 = { + 0x27C, 0x3A6, 0x3C2, 0x1, D_80391810, + func_8038C840, func_8038D014, func_80325888, + 0, 0, 1.0f, 0 +}; + +ActorInfo D_80391888 = { + 0x27D, 0x3A7, 0x3C1, 0x1, D_80391810, + func_8038C840, func_8038D014, func_80325888, + 0, 0, 1.0f, 0 +}; + +ActorInfo D_803918AC = { + 0x27E, 0x3A8, 0x3BB, 0x1, D_80391810, + func_8038C840, func_8038D014, func_80325888, + 0, 0, 1.0f, 0 +}; + +struct43s D_803918D0 = { + { {-420.0f, 410.0f, -420.0f}, {480.0f, 860.0f, 480.0f}}, + {{0.0f, -1200.0f, 0.0f}, {0.0f, -1200.0f, 0.0f}}, + {{0.0f, -20.0f, 0.0f}, {0.0f, 20.0f, 0.0f}} +}; + +struct42s D_80391918 = { + { {0.0f, 0.0f, 0.0f}, {0.0f, 0.0f, 0.0f}}, + { {-80.0f, -80.0f, -80.0f}, {80.0f, 80.0f, 80.0f}} +}; + +f32 D_80391948[4] = {1.0f, 1.0f, 1.0f, 1.0f}; + +f32 D_80391958[4] = {0.33f, 0.33f, 0.33f, 1.0f}; + +struct31s D_80391968 = { + {0.1f, 0.1f}, {10.0f, 10.0f}, {0.0f, 0.01f}, {0.8f, 0.8f}, 0.1f, 0.1f +}; + +/* .code */ +void func_8038C2C0(f32 position[3], s32 count, enum asset_e id, f32 arg3){ + ParticleEmitter * temp_s0 = partEmitList_pushNew(count); + f32 sp24; + + particleEmitter_setSprite(temp_s0, id); + particleEmitter_setStartingFrameRange(temp_s0, 1, 6); + particleEmitter_setPosition(temp_s0, position); + func_802EFE24(temp_s0, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); + func_802EFB70(temp_s0, arg3*0.35, arg3*0.65); + func_802EFB84(temp_s0, 0.0f, 0.0f); + func_802EF9F8(temp_s0, 0.5f); + func_802EFA18(temp_s0, 3); + particleEmitter_setSpawnIntervalRange(temp_s0, 0.0f, 0.01f); + func_802EFEC0(temp_s0, 3.0f, 3.3f); + func_802EFA5C(temp_s0, 0.0f, 0.35f); + particleEmitter_setPositionVelocityAndAccelerationRanges(temp_s0, &D_803918D0); + func_802EFA70(temp_s0, 4); + particleEmitter_emitN(temp_s0, count); +} + +void func_8038C424(f32 position[3], s32 count, enum asset_e id, f32 arg3){ + ParticleEmitter * temp_s0 = partEmitList_pushNew(count); + f32 sp24; + + particleEmitter_setSprite(temp_s0, id); + particleEmitter_setStartingFrameRange(temp_s0, 0, 9); + particleEmitter_setParticleFramerateRange(temp_s0, 12.0f, 12.0f); + particleEmitter_setPosition(temp_s0, position); + particleEmitter_setPositionAndVelocityRanges(temp_s0, &D_80391918); + sp24 = arg3 * 5.0; + func_802EFB70(temp_s0, sp24, sp24); + func_802EFB84(temp_s0, sp24, sp24); + particleEmitter_setSpawnIntervalRange(temp_s0, 0.0f, 0.0f); + func_802EFEC0(temp_s0, (arg3*0.5), (arg3*0.5)*1.5); + func_802EFA5C(temp_s0, 0.7f, 0.8f); + func_802EFA70(temp_s0, 0x10); + particleEmitter_emitN(temp_s0, count); +} + +void func_8038C588(void){ + func_80386654(1.0f, &D_80391958, &D_80391948); +} + +void func_8038C5BC(void){ + func_80386654(1.0f, &D_80391948, &D_80391958); +} + +void func_8038C5F0(Actor *this, enum asset_e arg1, enum asset_e arg2, f32 arg3){ + f32 sp1C[3]; + func_8038C0DC(&sp1C); + func_8038C2C0(this->position, 0x20, arg1, arg3); + func_8038C424(this->position, 4, arg2, arg3); + timedFunc_set_0(0.0f, func_8038C588); + timedFunc_set_0(0.3f, func_8038C5BC); +} + +void func_8038C674(Actor *this){ + s32 a1; + s32 a2; + switch(this->marker->unk14_20){ + default: + a1 = ASSET_718_SPRITE_SPARKLE_WHITE_2; + a2 = ASSET_6C2_SPRITE_SMOKE_WHITE; + break; + case 0x27b: + a1 = ASSET_71B_SPRITE_SPARKLE_ORANGE_2; + a2 = ASSET_6C5_SPRITE_SMOKE_ORANGE; + break; + case 0x27c: + a1 = ASSET_719_SPRITE_SPARKLE_GREEN_2; + a2 = ASSET_6C3_SPRITE_SMOKE_GREEN; + break; + case 0x27d: + a1 = ASSET_71A_SPRITE_SPARKLE_PINK_2; + a2 = ASSET_6C6_SPRITE_SMOKE_PINK; + break; + case 0x27e: + a1 = ASSET_717_SPRITE_SPARKLE_YELLOW_2; + a2 = ASSET_6C4_SPRITE_SMOKE_YELLOW; + break; + } + func_8038C5F0(this, a1, a2, 1.0f); +} + + +void func_8038C6FC(Actor *this, s16 arg1){ + f32 temp_f2 = this->yaw; + f32 tick = time_getDelta(); + + + temp_f2 -= (tick*arg1)/45.0; + if(360.0f <= temp_f2){ + temp_f2 -= 360.0f; + } + else{ + if(temp_f2 < 0.0f) + temp_f2 += 360.0f; + } + this->yaw = temp_f2; +} + +void func_8038C79C(Actor *this){ + int i; + for(i = 0; i < 4; i++){ + if(randf() < 0.3){ + func_8033E73C(this->marker, i + 5, func_80329904); + func_8033E3F0(8, this->marker->unk14_21); + } + } +} + +void func_8038C840(Actor *this){ + f32 sp74 = time_getDelta(); + f32 sp68[3]; + f32 sp5C[3]; + f32 sp50[3]; + f32 sp4C; + int sp48; + s32 sp44; + s16 sp42; + s16 sp40; + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + func_80324CFC(0.0f, SFX_JINJO_STATUE_POWERUP, 32000); + func_80324D2C(this->unk60 + 2.26, SFX_JINJO_STATUE_POWERUP); + }//L8038C8A4 + func_8028E964(sp68); + func_80257F18(this->position, sp68, &sp4C); + sp40 = (this->yaw * 182.04444); + sp42 = sp40 - (s16)(sp4C*182.04444); + switch(this->state){ + case 1: //8038C92C + animctrl_setAnimTimer(this->animctrl, 0.0f); + if(this->unk60 < 0.0) + func_80328B8C(this, 2, 0.001f, 1); + else//L8038C974 + this->unk60 -= sp74; + + break; + + case 2: // 8038C980 + if(actor_animationIsAt(this, 0.44f)) + func_8030E878(SFX_105_EYRIE_YAWN, randf2(0.95f, 1.05f), 32000, this->position, 1000.0f, 5000.0f); + + if(actor_animationIsAt(this, 0.999f)){ + func_80328B8C(this, 3, 0.001f, 1); + func_8030E878(0x3ee, randf2(0.95f, 1.05f), 32000, this->position, 5000.0f, 12000.0f); + } + break; + case 3: // 8038CA48 + case 4: // 8038CA48 + sp48 = (this->state == 3); + if(!sp48 || 0.1 < animctrl_getAnimTimer(this->animctrl)){//L8038CA7C + player_getVelocity(&sp5C); + sp5C[0] *= sp74 * 6.0f; + sp5C[1] *= sp74 * 6.0f; + sp5C[2] *= sp74 * 6.0f; + + sp5C[0] = sp5C[0] + sp68[0]; + sp5C[1] = sp5C[1] + sp68[1]; + sp5C[2] = sp5C[2] + sp68[2]; + + sp5C[0] -= this->position_x; + sp5C[1] -= this->position_y; + sp5C[2] -= this->position_z; + + sp5C[0] *= sp74*3.0f; + sp5C[1] *= sp74*3.0f; + sp5C[2] *= sp74*3.0f; + + this->position_x = sp5C[0] + this->position_x; + this->position_y = sp5C[1] + this->position_y; + this->position_z = sp5C[2] + this->position_z; + if(sp48 || animctrl_getAnimTimer(this->animctrl) < 0.8) + func_8038C79C(this); + }//L8038CB9C + if(sp48){ + if(animctrl_getAnimTimer(this->animctrl) < 0.2){ + func_8038C6FC(this, sp42); + } + + if(actor_animationIsAt(this, 0.1f)){ + this->unk44_31 = func_8030ED2C(0x18, 3); + func_8030E2C4(this->unk44_31); + func_8025A6EC(COMUSIC_43_ENTER_LEVEL_GLITTER, 0x7fff); + FUNC_8030E8B4(SFX_C7_SHWOOP, 0.8f, 32750, this->position, 300, 2000); + }//L8038CC2C + + if(actor_animationIsAt(this, 0.434f)){ + FUNC_8030E8B4(SFX_C7_SHWOOP, 0.9f, 32750, this->position, 300, 2000); + }//L8038CC58 + + if(actor_animationIsAt(this, 0.811f)){ + FUNC_8030E8B4(SFX_C7_SHWOOP, 1.0f, 32750, this->position, 300, 2000); + } + } + else{//L8038CC8C + if(actor_animationIsAt(this, 0.214f)){ + FUNC_8030E8B4(SFX_C7_SHWOOP, 1.1f, 32750, this->position, 300, 2000); + }//L8038CCB0 + + if(actor_animationIsAt(this, 0.55f)){ + FUNC_8030E8B4(SFX_53_BANJO_HUIII, 1.5f, 32750, this->position, 300, 2000); + }//L8038CCDC + + if(actor_animationIsAt(this, 0.85f)){ + if(func_8030E3FC(this->unk44_31)) + func_8030E394(this->unk44_31); + func_8030E484(SFX_19_BANJO_LANDING_08); + func_8025A7DC(0x43); + }//L8038CD20 + } + + if(sp48){ + if(actor_animationIsAt(this, 0.96f)){ + func_80328B8C(this, 4, 0.0f, -1); + actor_playAnimationOnce(this); + } + } + else{//L8038CD68 + if(actor_animationIsAt(this, 0.9f)){ + animctrl_setSmoothTransition(this->animctrl, FALSE); + func_80328B8C(this, 5, 0.001f, 1); + FUNC_8030E8B4(SFX_135_CARTOONY_SPRING, 1.0f, 32000, this->position, 10000, 16000); + func_80324D54(0.1f, SFX_C1_BUZZBOMB_ATTACK, 0.85f, 32000, this->position, 5000.0f, 12000.0f); + func_8034A174(this->marker->unk44, 0x1f, this->position); + this->velocity_x = (this->position_x - this->unk1C[0])/ sp74; + this->velocity_y = (this->position_y - this->unk1C[1])/ sp74; + this->velocity_z = (this->position_z - this->unk1C[2])/ sp74; + + } + else{//L8038CE50 + func_8034A174(this->marker->unk44, 0x1f, this->unk1C); + } + } + break; + case 5: // 8038CE68 + func_8038C0DC(&sp50); + sp50[1] += 100.0f; + func_80387470(this, sp50, 1200.0f, 3840.0f, 200.0f, 2500.0f, 70.0f); + func_8038C79C(this); + break; + }//L8038CEC8 +} + +void func_8038CED8(f32 arg0[3], s32 arg1, f32 arg2, f32 arg3){ + ParticleEmitter *s0 = partEmitList_pushNew(1); + f32 sp40[3]; + f32 sp34[3]; + + func_8024C5CC(&sp40); + + sp34[0] = sp40[0] - arg0[0]; + sp34[1] = sp40[1] - arg0[1]; + sp34[2] = sp40[2] - arg0[2]; + ml_vec3f_set_length(sp34, 20.0f); + + particleEmitter_setModel(s0, arg1); + particleEmitter_setPosition(s0, arg0); + particleEmitter_setParticleVelocityRange(s0, sp34[0], sp34[1], sp34[2], sp34[0], sp34[1], sp34[2]); + D_80391968.unk20 = arg3; + D_80391968.unk0[0] *= arg2; + D_80391968.unk24 = arg3; + D_80391968.unk0[1] *= arg2; + D_80391968.unk8[0] *= arg2; + D_80391968.unk8[1] *= arg2; + func_802EFB98(s0, &D_80391968); + func_802EFA70(s0, 0x10); + func_802EFA78(s0, 1); + particleEmitter_emitN(s0, 1); +} + +void func_8038D014(Actor *this){ + s32 temp_a1; + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + this->marker->propPtr->unk8_3 = 0; + actor_collisionOff(this); + this->alpha_124_19 = 0x7d; + actor_setOpacity(this, this->alpha_124_19); + this->scale = (f64)this->scale + this->scale; + func_80328B8C(this, 5, 0.001f, 1); + func_80343DEC(this); + }//L8038D0B8 + + if(!func_8038C298()){ + this->unk58_0 = 0; + }else{//L8038D0DC + this->unk58_0 = 1; + func_80343DEC(this); + if(this->state == 5){ + if(this->marker->unk14_21) + func_8038C79C(this); + + if(0.98 < this->unk48){ + func_8030E6A4(0x3ee, randf2(1.0f, 1.15f), 32000); + timed_playSfx(0.1f, 0x416, 0.6f, 32000); + marker_despawn(this->marker); + switch (this->marker->unk14_20) + { + case 0x27b: + temp_a1 = 0x557; + break; + case 0x27c: + temp_a1 = 0x558; + break; + case 0x27d: + temp_a1 = 0x559; + break; + case 0x27e: + temp_a1 = 0x556; + break; + default: + temp_a1 = 0x556; + break; + } + func_8038CED8(this->position, temp_a1, 1.0f, 0.1f); + func_802BB3DC(0, 12.0f, 0.4f); + } + } + }//L8038D200 +} + + +void func_8038D214(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + func_8038C674(actor); + FUNC_8030E8B4(SFX_1B_EXPLOSION_1, 1.0f, 32000, actor->position, 1000, 6500); + marker_despawn(actor->marker); +} + +f32 func_8038D268(void){ + return 2.26f; +} diff --git a/src/fight/code_6E90.c b/src/fight/code_6E90.c new file mode 100644 index 00000000..8a7be719 --- /dev/null +++ b/src/fight/code_6E90.c @@ -0,0 +1,171 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + u8 unk0; +}ActorLocal_fight_6E90; + +void func_8038D568(Actor *this); + +/* .data */ +ActorInfo D_80391990 = { + 0x27A, 0x3A2, 0x543, 0x1, NULL, + func_8038D568, func_80326224, func_80325888, + 0, 0x800, 0.0f, 0 +}; + +s32 D_803919B4[3] = {0xC8, 0xC8, 0xA0}; + +struct31s D_803919C0 = { + {1.0f, 1.0f}, + {1.7f, 2.7f}, + {0.0f, 0.05f}, + {2.6f, 3.4f}, + 0.0f, 0.1f +}; + +/* .code */ +void func_8038D280(ActorMarker *arg0) { + Actor *sp1C = marker_getActor(arg0); + Actor *temp_v0 = spawn_child_actor(0x3A1, &sp1C); + + temp_v0->unkF4_8 = sp1C->unkF4_8; + temp_v0->position_y = temp_v0->position_y + 172.0f; + sp1C->unk100 = temp_v0->marker; +} + +void func_8038D2EC(f32 arg0[3], s32 arg1) { + ParticleEmitter *temp_v0 = partEmitList_pushNew(arg1); + + particleEmitter_setSprite(temp_v0, ASSET_70E_SPRITE_SMOKE_2); + func_802EFFA8(temp_v0, D_803919B4); + particleEmitter_setStartingFrameRange(temp_v0, 0, 7); + particleEmitter_setPosition(temp_v0, arg0); + particleEmitter_setParticleSpawnPositionRange(temp_v0, -90.0f, 0.0f, -80.0f, 80.0f, 60.0f, 80.0f); + particleEmitter_setParticleVelocityRange(temp_v0, -170.0f, 0.0f, -170.0f, 170.0f, 100.0f, 170.0f); + func_802EFB98(temp_v0, &D_803919C0); + particleEmitter_emitN(temp_v0, arg1); +} + +void func_8038D3DC(Actor* this, s32 arg1, f32 arg2, f32 arg3, f32 arg4){ + s32 tmp = func_8034C2C4(this->marker, arg1); + + if(tmp){ + func_8034DE60(tmp, arg2, arg3, arg4, 1); + } +} + +void func_8038D428(ActorMarker *arg0, ActorMarker *arg1) { + Actor *temp_v0; + Actor *s0; + + temp_v0 = marker_getActor(arg0); + if (temp_v0->state != 3) { + func_8025A70C(COMUSIC_2B_DING_B); + temp_v0->unk38_31++; + if (temp_v0->unk38_31 >= 3) { + func_80328A84(temp_v0, 3); + func_8038DE98(temp_v0->unk100); + func_8038D3DC(temp_v0, 0x19A, -100.0f, 0.0f, 1.2f); + func_80324D54(1.2f, SFX_90_SWITCH_PRESS, 1.0f, 32000, temp_v0->position, 1000.0f, 2000.0f); + } + } +} + +void func_8038D510(Actor *arg0) { + ActorLocal_fight_6E90 *sp18 = (ActorLocal_fight_6E90 *)&arg0->local; + + if ((u8)arg0->unk44_31 != 0) { + func_8030DA44(arg0->unk44_31); + arg0->unk44_31 = 0; + } + if (sp18->unk0 != 0) { + func_8030DA44(sp18->unk0); + sp18->unk0 = 0; + } +} + +void func_8038D568(Actor *this){ + ActorLocal_fight_6E90 *local = (ActorLocal_fight_6E90 *)&this->local; + + f32 sp48 = time_getDelta(); + u32 sp44 = func_8023DB5C() & 0xF; + Actor *other; //sp40 + f32 sp3C; + f32 sp30[3]; + + this->unkF4_29 = 0; + func_80330B1C(this->marker); + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + marker_setCollisionScripts(this->marker, NULL, func_8038D428, NULL); + func_803300D8(this->marker, func_8038D510); + this->marker->propPtr->unk8_3 = 1; + actor_collisionOn(this); + this->unk38_31 = 0; + this->unk44_31 = func_8030D90C(); + sfxsource_setSfxId(this->unk44_31, 0x3f9); + func_8030DD14(this->unk44_31, 2); + func_8030DBB4(this->unk44_31, 1.4f); + sfxsource_setSampleRate(this->unk44_31, 32000); + + local->unk0 = func_8030D90C(); + sfxsource_setSfxId(local->unk0, 0x405); + func_8030DD14(local->unk0, 2); + func_8030DBB4(local->unk0, 0.7f); + sfxsource_setSampleRate(local->unk0, 12000); + FUNC_8030E624(SFX_3F6_UNKNOWN, 0.6f, 20000); + func_8038D3DC(this, 0x19a, 0.0f, -200.0f, 0.0f); + TUPLE_COPY(this->unk1C, this->position); + this->position_y = -400.0f; + if(0.0f != this->unk60) + this->velocity_y = 400.0f/this->unk60; + else + this->velocity_y = 100.0f; + + func_802BB3DC(0, 8.0f, 0.92f); + func_802C3F04((GenMethod_4)func_802C4140, 0x3ad, *(s32*)&this->unk1C[0], *(s32*)&this->unk1C[1], *(s32*)&this->unk1C[2]); + func_8038D2EC(this->unk1C, 0x10); + func_802C3C88((GenMethod_1)func_8038D280, reinterpret_cast(s32, this->marker)); + } + else{//L8038D774 + if(this->state == 1){ + other = marker_getActor(this->unk100); + sp3C = this->velocity_y * sp48; + if(this->position_y + sp3C < this->unk1C[1]){ + if(!func_8031FF1C(0xd2) || this->unkF4_8 == 1){ + func_8030E2C4(this->unk44_31); + func_8030E2C4(local->unk0); + } + sp30[0] = (sp44 & 1) ? 3.0f : -3.0f; + sp30[1] = sp3C; + sp30[2] = (sp44 & 2) ? 3.0f : -3.0f; + + this->position_x = this->unk1C[0]; + this->position_z = this->unk1C[2]; + this->position_x = sp30[0] + this->position_x; + this->position_y = sp30[1] + this->position_y; + this->position_z = sp30[2] + this->position_z; + + other->position_x = this->unk1C[0]; + other->position_z = this->unk1C[2]; + other->position_x = sp30[0] + other->position_x; + other->position_y = sp30[1] + other->position_y; + other->position_z = sp30[2] + other->position_z; + + } + else{//L8038D8E0 + func_80328A84(this, 2); + func_8030DA44(this->unk44_31); + this->unk44_31 = 0; + func_8030DA44(local->unk0); + local->unk0 = 0; + TUPLE_COPY(this->position, this->unk1C); + TUPLE_COPY(other->position, this->unk1C); + other->position_y += 172.0f; + } + } + }//L8038D954 +} diff --git a/src/fight/code_7580.c b/src/fight/code_7580.c new file mode 100644 index 00000000..f191a7f2 --- /dev/null +++ b/src/fight/code_7580.c @@ -0,0 +1,134 @@ +#include +#include "functions.h" +#include "variables.h" + +extern Actor *func_80326EEC(); +extern void func_80328B8C(Actor*, s32, f32, s32); +extern f32 func_8038D268(void); + +void func_8038DA04(Actor *); + +/* .data */ +ActorAnimationInfo D_803919F0[] ={ + {0, 0.0f}, + {0x265, 1e+8f}, + {0x265, 1e+8f}, + {0x265, 1e+8f}, +}; +ActorInfo D_80391A10 = { 0x276, 0x3A1, 0x545, 0x1, D_803919F0, func_8038DA04, func_80326224, func_80325888, 0, 0x800, 1.0f, 0}; + + +/* .code */ +void func_8038D970(ActorMarker *arg0) { + Actor *temp_v0; + Actor *phi_v0; + + temp_v0 = marker_getActor(arg0); + if (temp_v0->unkF4_8 == 5) { + phi_v0 = spawn_child_actor(0x3AC, &temp_v0); + } else { + phi_v0 = spawn_child_actor((temp_v0->unkF4_8) + 0x3A4, &temp_v0); + } + phi_v0->unkF4_8 = temp_v0->unkF4_8; + phi_v0->unk60 = temp_v0->unk1C[0]; + phi_v0->scale = temp_v0->scale; +} + +void func_8038DA04(Actor *this) { + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + actor_collisionOff(this); + if (this->unkF4_8 == 5) { + this->marker->unk40_23 = TRUE; + this->marker->unk40_20 = TRUE; + this->unk1C[0] = 6.0f; + this->scale *= 4.0; + } else { + this->unk1C[0] = 2.0f; + this->scale *= 1.8; + } + } + switch (this->state) { + case 1: + animctrl_setAnimTimer(this->animctrl, 0.0f); + break; + case 2: + if (this->unkF4_8 != 5) { + if (actor_animationIsAt(this, 0.001f)) { + FUNC_8030E8B4(SFX_D_EGGSHELL_BREAKING, 1.2f, 25000, this->position, 1000, 5000); + func_8030E878(SFX_80_YUMYUM_CLACK, randf2(0.6f, 0.8f), 20000, this->position, 1000.0f, 5000.0f); + } + if( actor_animationIsAt(this, 0.26f) + || actor_animationIsAt(this, 0.43f) + || actor_animationIsAt(this, 0.55f) + || actor_animationIsAt(this, 0.62f) + || actor_animationIsAt(this, 0.77f) + ) { + func_8030E878(SFX_80_YUMYUM_CLACK, randf2(0.6f, 0.8f), 20000, this->position, 1000.0f, 5000.0f); + } + } else { + if (actor_animationIsAt(this, 0.001f)) { + FUNC_8030E8B4(SFX_D_EGGSHELL_BREAKING, 1.2f, 25000, this->position, 1000, 5000); + func_8030E878(SFX_80_YUMYUM_CLACK, randf2(0.4f, 0.6f), 20000, this->position, 1000.0f, 5000.0f); + } + if( actor_animationIsAt(this, 0.26f) + || actor_animationIsAt(this, 0.43f) + || actor_animationIsAt(this, 0.55f) + || actor_animationIsAt(this, 0.62f) + || actor_animationIsAt(this, 0.77f) + ) { + func_8030E878(SFX_80_YUMYUM_CLACK, randf2(0.4f, 0.6f), 20000, this->position, 1000.0f, 5000.0f); + } + if( actor_animationIsAt(this, 0.1f) + || actor_animationIsAt(this, 0.23f) + || actor_animationIsAt(this, 0.34f) + || actor_animationIsAt(this, 0.45f) + || actor_animationIsAt(this, 0.55f) + || actor_animationIsAt(this, 0.65f) + || actor_animationIsAt(this, 0.78f) + || actor_animationIsAt(this, 0.83f) + || actor_animationIsAt(this, 0.9f) + || actor_animationIsAt(this, 0.98f) + ) { + func_8030E6A4(SFX_3_DULL_CANNON_SHOT, randf2(1.2f, 1.4f), 0x4E20); + } + } + if (actor_animationIsAt(this, 0.999f) != 0) { + func_80328B8C(this, 3, 0.99999f, 1); + actor_playAnimationOnce(this); + func_80326310(this); + } + break; + } +} + +void func_8038DE98(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + s32 sp38; + f32 sp34; + f32 sp30; + f32 sp24[3]; + + if(actor->state != 2){ + func_80328B8C(actor, 2, 0.0f, 1); + actor_playAnimationOnce(actor); + animctrl_setDuration(actor->animctrl, actor->unk1C[0]); + func_802C3C88((GenMethod_1)func_8038D970, reinterpret_cast(s32, actor->marker)); + if(!func_8031FF1C(0xD1) && actor->unkF4_8 != 5){ + sp38 = 0x30 + actor->unkF4_8*2; + sp34 = func_8038D268(); + sp30 = actor->unk1C[0] + sp34; + func_8038C0DC(&sp24); + func_8028F94C(2, &sp24); + func_8038C27C(1); + timed_setCameraToNode(0 * sp30, sp38); + func_80324E88(1 * sp30); + timed_setCameraToNode(1 * sp30, sp38 + 1); + } + }//L8038DF8C +} + +f32 func_8038DFA0(void) { + return func_80326EEC(0x3A1)->unk1C_x; +} diff --git a/src/fight/code_7BE0.c b/src/fight/code_7BE0.c new file mode 100644 index 00000000..f819e97a --- /dev/null +++ b/src/fight/code_7BE0.c @@ -0,0 +1,206 @@ +#include +#include "functions.h" +#include "variables.h" + +typedef struct { + u8 unk0[4]; +}ActorLocal_fight_7BE0; + +void func_8038E2FC(Actor *); + +/* .data */ +ActorInfo D_80391A40 = { + 0x27F, 0x3A9, 0x544, 0x1, NULL, + func_8038E2FC, func_80326224, func_80325888, + 0, 0x800, 0.0f, 0 +}; + +s32 D_80391A64[3] = {0xC8, 0xC8, 0xA0}; + +struct31s D_80391A70 = { + {1.0f, 1.0f}, + {1.7f, 2.7f}, + {0.0f, 0.05f}, + {2.6f, 3.4f}, + 0.0f, 0.1f +}; + +struct42s D_80391A98 = { + { {-170.0f, 0.0f, -170.0f}, {170.0f, 100.0f, 170.0f}}, + { {-90.0f, 0.0f, -80.0f}, + {80.0f, 60.0f, 80.0f} + } +}; + +/* .code */ +void func_8038DFD0(ActorMarker *arg0) { + Actor *sp1C; + Actor *temp_v0; + + sp1C = marker_getActor(arg0); + temp_v0 = spawn_child_actor(0x3A1, &sp1C); + temp_v0->unkF4_8 = sp1C->unkF4_8; + temp_v0->position_y = temp_v0->position_y + 155.0f; + sp1C->unk100 = temp_v0->marker; +} + +void func_8038E03C(f32 arg0[3], u32 arg1) { + ParticleEmitter *temp_v0 = partEmitList_pushNew(arg1); + + particleEmitter_setSprite(temp_v0, ASSET_70E_SPRITE_SMOKE_2); + func_802EFFA8(temp_v0, D_80391A64); + particleEmitter_setStartingFrameRange(temp_v0, 0, 7); + particleEmitter_setPosition(temp_v0, arg0); + particleEmitter_setPositionAndVelocityRanges(temp_v0, &D_80391A98); + func_802EFB98(temp_v0, &D_80391A70); + particleEmitter_emitN(temp_v0, arg1); +} + +void func_8038E0D4(Actor *arg0, s32 arg1, f32 arg2, f32 arg3, f32 arg4) { + s32 temp_v0 = func_8034C2C4(arg0->marker, arg1); + + if (temp_v0) { + func_8034DE60(temp_v0, arg2, arg3, arg4, 1); + } +} + +void func_8038E120(ActorMarker * marker, ActorMarker *arg1){ + Actor *actor = marker_getActor(marker); + ActorLocal_fight_7BE0 * local = (ActorLocal_fight_7BE0 *)&actor->local; + int indx; + s32 remaining; + f32 pad; + + + indx = marker->unk40_31 - 1; + if(actor->state != 3){ + if(local->unk0[indx]){ + local->unk0[indx]--; + func_8025A70C(COMUSIC_2B_DING_B); + if(local->unk0[indx] <= 0){ + func_8038E0D4(actor, indx + 0x19a, -100.0f, 0.0f, 1.2f); + func_80324D54(1.2f, SFX_90_SWITCH_PRESS, 1.0f, 32000, actor->position, 1000.0f, 2000.0f); + } + }//L8038E210 + remaining = local->unk0[0] + local->unk0[1] + local->unk0[2] + local->unk0[3]; + if( remaining <= 0){ + func_8038C148(); + func_80328A84(actor, 3); + func_8038DE98(actor->unk100); + } + }//L8038E24C +} + + +void func_8038E260(ActorMarker *arg0) { + Actor *sp24 = marker_getActor(arg0); + + func_802BB3DC(0, 18.0f, 0.92f); + func_802C3F04((GenMethod_4) func_802C4140, 0x3AD, *(u32 *)(&sp24->unk1C_x), *(u32 *)(&sp24->unk1C_y), *(u32 *)(&sp24->unk1C_z)); + func_8038E03C(sp24->unk1C, 0x10); +} + +void func_8038E2CC(ActorMarker *arg0) { + func_8032BB88(marker_getActor(arg0), -1, 0x7FFF); +} + +void func_8038E2FC(Actor *this){ + ActorLocal_fight_7BE0 *local = (ActorLocal_fight_7BE0 *)&this->local; + f32 sp58 = time_getDelta(); + s32 temp_s1 = func_8023DB5C() & 0xf; + s32 temp_s0; + int i; + Actor *other; + f32 temp_f20; + f32 sp38[3]; + + + func_80330B1C(this->marker); + if(!this->unk16C_4){ + this->unk16C_4 = 1; + marker_setCollisionScripts(this->marker, NULL, func_8038E120, NULL); + this->marker->propPtr->unk8_3 = 1; + actor_collisionOn(this); + for(i = 0; i < 4; i++){ + local->unk0[i] = 5; + func_8038E0D4(this, 0x19a + i, 0.0f, -300.0f, 0.0f); + } + this->unk44_31 = func_8030D90C(); + sfxsource_setSfxId(this->unk44_31, 0x3f9); + func_8030DD14(this->unk44_31, 3); + func_8030DBB4(this->unk44_31, 1.0f); + sfxsource_setSampleRate(this->unk44_31, 26000); + func_8030E2C4(this->unk44_31); + temp_s0 = func_802F9AA8(0x3EC); + func_802F9DB8(temp_s0, 0.5f, 0.5f, 0.0f); + func_802F9EC4(temp_s0, this->position, 5000, 15000); + func_802F9FD0(temp_s0, 0.25f, this->unk60 - 1.0, 1); + func_802FA060(temp_s0, 17000, 17000, 0.0f); + func_8025A6EC(JINGLE_MENACING_GRUNTILDA_A, 15000); + func_8032BB88(this, 0, 0x7fff); + timedFunc_set_1(8.0f, (TFQM1)func_8038E2CC, (s32)this->marker); + this->unk1C[0] = this->position_x; + this->unk1C[1] = this->position_y; + this->unk1C[2] = this->position_z; + this->position_y = -600.0f; + FUNC_8030E624(SFX_3F6_UNKNOWN, 0.6f, 25000); + if(0.0f != this->unk60){ + this->velocity_y = 600.0f/this->unk60; + }else{ + this->velocity_y = 100.0f; + } + timedFunc_set_1(this->unk60* 0.05, (TFQM1)func_8038E260, (s32)this->marker); + timedFunc_set_1(this->unk60* 0.28, (TFQM1) func_8038E260, (s32)this->marker); + timedFunc_set_1(this->unk60* 0.46, (TFQM1) func_8038E260, (s32)this->marker); + timedFunc_set_1(this->unk60* 0.58, (TFQM1) func_8038E260, (s32)this->marker); + func_802C3C88((GenMethod_1)func_8038DFD0, reinterpret_cast(s32,this->marker)); + } + else{//L8038E5CC + if(this->state == 1){ + other = marker_getActor(this->unk100); + temp_f20 = this->velocity_y * sp58; + if(this->position_y + temp_f20 < this->unk1C[1]){ + if(!func_8030E3FC(this->unk44_31)){ + func_8030E2C4(this->unk44_31); + } + + sp38[0] = (temp_s1 & 1) ? 3.0f : -3.0f; + sp38[1] = temp_f20; + sp38[2] = (temp_s1 & 2) ? 3.0f : -3.0f; + + this->position_x = this->unk1C[0]; + this->position_z = this->unk1C[2]; + + this->position_x = sp38[0] + this->position_x; + this->position_y = sp38[1] + this->position_y; + this->position_z = sp38[2] + this->position_z; + + other->position_x = this->unk1C[0]; + other->position_z = this->unk1C[2]; + + other->position_x = sp38[0] + other->position_x; + other->position_y = sp38[1] + other->position_y; + other->position_z = sp38[2] + other->position_z; + } + else{//L8038E6FC + func_80328A84(this, 2); + FUNC_8030E624(SFX_7F_HEAVYDOOR_SLAM, 0.8f, 32000); + func_8030E394(this->unk44_31); + func_8030DA44(this->unk44_31); + this->unk44_31 = 0; + this->position_x = this->unk1C[0]; + this->position_y = this->unk1C[1]; + this->position_z = this->unk1C[2]; + + other->position_x = this->unk1C[0]; + other->position_y = this->unk1C[1]; + other->position_z = this->unk1C[2]; + + other->position_y += 155.0f; + + } + } + }//L8038E768 +} + + diff --git a/src/fight/code_8390.c b/src/fight/code_8390.c new file mode 100644 index 00000000..34ce45e6 --- /dev/null +++ b/src/fight/code_8390.c @@ -0,0 +1,134 @@ +#include +#include "functions.h" +#include "variables.h" + + +extern ActorMarker *func_8038A4E8(Actor*, f32); +void func_80386654(f32 arg0, f32 (*arg1)[4], f32 (*arg2)[4]); + +typedef struct { + s32 unk0; + u8 unk4; + u8 unk5; + u8 unk6; + u8 unk7; + u8 unk8; + u8 unk9; + u8 unkA; + u8 unkB; + u8 unkC; + u8 unkD; + u8 unkE; + u8 unkF; + u8 unk10; +} ActorLocal_fight_8390; + +void func_8038E844(Actor *this); + +/* .data */ +ActorInfo D_80391AD0 = { + 0x284, 0x3AB, 0x546, 0x1, NULL, + func_8038E844, func_80326224, func_80325888, + 0, 0, 0.0f, 0 +}; + +/* .code */ +void func_8038E780(ActorMarker *arg0, ActorMarker *arg1) { + Actor *sp1C; + ActorLocal_fight_8390 *sp18; + + sp1C = marker_getActor(arg0); + sp18 = (ActorLocal_fight_8390 *) &sp1C->local; + sp18->unk0 = 0xFF; + sp18->unk4 = 0; + if (func_8030E3FC(sp18->unk10) == 0) { + func_8030E2C4(sp18->unk10); + } + if (func_8030E3FC(sp1C->unk44_31) == 0) { + func_8030E2C4(sp1C->unk44_31); + } +} + +void func_8038E7EC(Actor *arg0) { + ActorLocal_fight_8390 *temp_v0 = (ActorLocal_fight_8390 *)&arg0->local; + + if ((u8)arg0->unk44_31) { + func_8030DA44(arg0->unk44_31); + arg0->unk44_31 = 0; + } + if (temp_v0->unk10 != 0) { + func_8030DA44(temp_v0->unk10); + temp_v0->unk10 = (u8)0; + } +} + +void func_8038E844(Actor *this){ + ActorLocal_fight_8390 *local = (ActorLocal_fight_8390 *)&this->local; + f32 sp38 = time_getDelta(); + ActorMarker *temp_v0; + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + marker_setCollisionScripts(this->marker, NULL, func_8038E780, NULL); + func_803300D8(this->marker, func_8038E7EC); + this->marker->propPtr->unk8_3 = 0; + actor_collisionOn(this); + local->unk0 = 0; + local->unk4 = 1; + this->unk124_9 = 0; + this->scale = 0.0f; + this->unk44_31 = func_8030ED2C(SFX_142_GRUNTY_LAUGH_3, 3); + func_8030DB04(this->unk44_31, 32000, this->position, 4000.0f, 12000.0f); + func_8030DBB4(this->unk44_31, 1.0f); + local->unk10 = func_8030ED2C(0x415, 3); + func_8030DB04(local->unk10, 32000, this->position, 4000.0f, 12000.0f); + func_8030DBB4(local->unk10, 1.0f); + FUNC_8030E8B4(SFX_416, 0.8f, 32000, this->position, 10000, 25000); + }//L8038E97C + temp_v0 = func_8038A4E8(this, 600.0f); + if(temp_v0){ + if(temp_v0->unk14_20 == 0x285){ + marker_despawn(this->marker); + func_8038C100(); + return; + } + else{ + local->unk0 = 0; + local->unk4 = 1; + actor_setOpacity(this, 0); + this->unk58_0 = 0; + this->unk60 = 2.0f; + } + } //L8038E9F4 + if(this->state == 1){ + this->yaw += 30.0f*sp38; + if(this->scale < 1.0){ + this->scale = MIN(1.0, this->scale + ((f64)sp38 + (f64)sp38)); + }//L8038EA68 + + if(0.0 < this->unk60){ + this->unk58_0 = 0; + this->unk60 -= sp38; + } + else{ //L8038EAA4 + this->unk58_0 = 1; + if(local->unk4){ + local->unk0 = MIN(0x64, local->unk0 + (s32)(60.0f*sp38)); + if(local->unk0 >= 0x64){ + local->unk0 = 0x64; + local->unk4 = 0; + } + } + else{//L8038EB20 + local->unk0 = MAX(0, local->unk0 - (s32)(60.0f*sp38)); + if(local->unk0 <= 0){ + local->unk0 = 0; + local->unk4 = 1; + this->unk60 = 0.25f; + } + }//L8038EB74 + actor_setOpacity(this, local->unk0); + } + } + //L8038EB80 +} diff --git a/src/fight/code_87A0.c b/src/fight/code_87A0.c new file mode 100644 index 00000000..be9804dd --- /dev/null +++ b/src/fight/code_87A0.c @@ -0,0 +1,410 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80324CFC(f32, s32, s32); +extern void func_80386654(f32 arg0, f32 arg1[4], f32 arg2[4]); +extern void func_8038E03C(f32*, u32); +extern Actor *func_80325CAC(ActorMarker*, Gfx**, Mtx**, Vtx **); +bool func_80320C94(f32 [3], f32[3], f32, f32[3], s32, u32); +f32 func_8033229C(ActorMarker *); +void func_8038CED8(f32 [3], s32, f32, f32); +void func_8038C5F0(Actor *, s32, s32, f32); + +typedef struct { + f32 unk0; +}ActorLocal_fight_87A0; + +void func_8038F620(Actor *this); + +/* .data */ +ActorInfo D_80391B00 = { + 0x25C, 0x389, 0x541, 0x1, NULL, + func_8038F620, func_80326224, func_80325888, + 0, 0, 1.0f, 0 +}; + +ActorInfo D_80391B24 = { + 0x280, 0x3AA, 0x6C9, 0x1, NULL, + func_8038F620, func_80326224, func_80325CAC, + 0, 0, 1.0f, 0 +}; + +s32 D_80391B48[3] = {0xBA, 0xBA, 0xBA}; +struct42s D_80391B54 = { + { {-70.0f, 50.0f, -70.0f}, {70.0f, 100.0f, 70.0f}}, + { {-55.0f, 0.0f, -55.0f}, {55.0f, 20.0f, 55.0f}} +}; +f32 D_80391B84[4] = {1.0f, 1.0f, 1.0f, 1.0f}; +f32 D_80391B94[4] = {0.3f, 0.3f, 0.3f, 1.0f}; +s32 D_80391BA4[2] = {1, 9}; +f32 D_80391BAC[4] = {4.5f, 4.5f, 4.5f, 4.5f}; +f32 D_80391BBC[4] = {0.0f, 0.0f, 1.0f, 1.0f}; +f32 D_80391BCC[4] = {0.0f, 0.0f, 0.85f, 1.35f}; +f32 D_80391BDC[2] = {0.6f, 0.7f}; +f32 D_80391BE4[6] = {-130.0f, 0.0f, -130.0f, 130.0f, 0.0f, 130.0f}; +f32 D_80391BFC[4] = {1.1f, 1.1f, 4.0f, 5.4f}; + +f32 D_80391C0C[6] = {-20.0f, 0.0f, -20.0f, 20.0f, 40.0f, 20.0f}; +f32 D_80391C24[6] = {0.0f, -1200.0f, 0.0f, 0.0f, -1200.0f, 0.0f}; +f32 D_80391C3C[6] = {-420.0f, 410.0f, -420.0f, 480.0f, 860.0f, 480.0f}; +f32 D_80391C54[4] = {0.35f, 0.65f, 0.0f, 0.0f}; +f32 D_80391C64[4] = {0.0f, 0.01f, 2.0f, 2.3f}; +f32 D_80391C74[2] = {0.0f, 0.35f}; + +f32 D_80391C7C[6] = {0.0f, 50.0f, 0.0f, 0.0f, 50.0f, 0.0f}; +f32 D_80391C94[4] = {0.0f, 0.0f, 0.0f, 0.0f}; +f32 D_80391CA4[4] = {0.0f, 0.0f, 0.0f, 0.0f}; +f32 D_80391CB4[2] = {0.0f, 0.0f}; +f32 D_80391CBC[4] = {0.0f, 0.0f, 0.2f, 0.25f}; +f32 D_80391DCC[2] = {2.3f, 2.5f}; +f32 D_80391DD4[6] = {0.0f, 0.0f, 0.34f, 0.34f, 0.7f, 0.8f}; + +s32 D_80391CEC[2] = {2, 0xf}; +f32 D_80391CF4[4] = {2.0f, 2.0f, 0.4f, 0.4f}; +f32 D_80391D04[4] = {0.0f, 0.0f, 0.24f, 0.24f}; +f32 D_80391D14[2] = {0.1f, 0.2f}; +f32 D_80391D1C[4] = {0.0f, 0.0f, 0.44f, 0.44f}; +f32 D_80391D2C[2] = {0.4f, 0.5f}; +f32 D_80391D34[6] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}; + +f32 D_80391D4C[6] = {-50.0f, -50.0f, -50.0f, 50.0f, 50.0f, 50.0f}; +f32 D_80391D64[6] = {0.0f, -1200.0f, 0.0f, 0.0f, -1200.0f, 0.0f}; +f32 D_80391D7C[6] = {-260.0f, -260.0f, -260.0f, 260.0f, 260.0f, 260.0f}; +f32 D_80391D94[4] = {0.15f, 0.3f, 0.0f, 0.0f}; +f32 D_80391DA4[4] = {0.0f, 0.01f, 0.7f, 0.8f}; +f32 D_80391DB4[2] = {0.0f, 0.65f}; + +/* .bss */ +u8 pad[0x180]; //TODO!!!! define other file .bss sections +u8 D_803928E0; +u8 D_803928E1; +u8 D_803928E2; +u8 D_803928E3; +u8 D_803928E4; +u8 D_803928E5; +f32 D_803928E8[3]; +f32 D_803928F8[3]; +f32 D_80392908[3]; +extern f32 D_80392914; + +/* .code */ +void func_8038EB90(ActorMarker *arg0, f32 *arg1) { + Actor *temp_v0; + + temp_v0 = marker_getActor(arg0); + temp_v0->position_x = arg1[0]; + temp_v0->position_y = arg1[1]; + temp_v0->position_z = arg1[2]; + temp_v0->position_y = temp_v0->position_y + 210.0f; +} + +void func_8038EBE0(f32 arg0[3], u32 arg1, enum asset_e arg2, f32 arg3[6], f32 arg4[6], f32 arg5[6], f32 arg6[4], f32 arg7[4], f32 arg8[2]) { + ParticleEmitter *temp_v0 = partEmitList_pushNew(arg1); + + particleEmitter_setSprite(temp_v0, arg2); + particleEmitter_setStartingFrameRange(temp_v0, 1, 6); + particleEmitter_setPosition(temp_v0, arg0); + particleEmitter_setParticleSpawnPositionRange(temp_v0, arg3[0], arg3[1], arg3[2], arg3[3], arg3[4], arg3[5]); + particleEmitter_setParticleAccelerationRange(temp_v0, arg4[0], arg4[1], arg4[2], arg4[3], arg4[4], arg4[5]); + particleEmitter_setParticleVelocityRange(temp_v0, arg5[0], arg5[1], arg5[2], arg5[3], arg5[4], arg5[5]); + func_802EFE24(temp_v0, -300.0f, -300.0f, -300.0f, 300.0f, 300.0f, 300.0f); + func_802EFB70(temp_v0, arg6[0], arg6[1]); + func_802EFB84(temp_v0, arg6[2], arg6[3]); + func_802EF9F8(temp_v0, 0.5f); + func_802EFA18(temp_v0, 3); + particleEmitter_setSpawnIntervalRange(temp_v0, arg7[0], arg7[1]); + func_802EFEC0(temp_v0, arg7[2], arg7[3]); + func_802EFA5C(temp_v0, arg8[0], arg8[1]); + func_802EFA78(temp_v0, 1); + func_802EFA70(temp_v0, 4); + particleEmitter_emitN(temp_v0, arg1); +} + +void func_8038ED9C(f32 arg0[3], u32 arg1, s32 arg2, s32 arg3[2], f32 arg4[6], f32 arg5[4], f32 arg6[4], f32 arg7[2]) { + ParticleEmitter *temp_v0 = partEmitList_pushNew(arg2); + + particleEmitter_setSprite(temp_v0, arg1); + particleEmitter_setStartingFrameRange(temp_v0, arg3[0], arg3[1]); + particleEmitter_setParticleFramerateRange(temp_v0, 8.0f, 8.0f); + particleEmitter_setPosition(temp_v0, arg0); + particleEmitter_setParticleSpawnPositionRange(temp_v0, arg4[0], arg4[1], arg4[2], arg4[3], arg4[4], arg4[5]); + particleEmitter_setParticleVelocityRange(temp_v0, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f); + func_802EFB70(temp_v0, arg5[0], arg5[1]); + func_802EFB84(temp_v0, arg5[2], arg5[3]); + particleEmitter_setSpawnIntervalRange(temp_v0, arg6[0], arg6[1]); + func_802EFEC0(temp_v0, arg6[2], arg6[3]); + func_802EFA5C(temp_v0, arg7[0], arg7[1]); + func_802EFA70(temp_v0, 0x10); + func_802EFA78(temp_v0, 1); + particleEmitter_emitN(temp_v0, arg2); +} + +void func_8038EEFC(f32 arg0[3], u32 arg1, f32 *arg2) { + ParticleEmitter *temp_v0 = partEmitList_pushNew(arg1); + + particleEmitter_setSprite(temp_v0, ASSET_70E_SPRITE_SMOKE_2); + func_802EFFA8(temp_v0, D_80391B48); + func_802EF9E4(temp_v0, 0xEB); + particleEmitter_setStartingFrameRange(temp_v0, 0, 7); + particleEmitter_setPosition(temp_v0, arg0); + particleEmitter_setPositionAndVelocityRanges(temp_v0, &D_80391B54); + func_802EFB70(temp_v0, 0.1f, 0.2f); + func_802EFB84(temp_v0, 3.6f, 4.6f); + particleEmitter_setSpawnIntervalRange(temp_v0, arg2[0], arg2[1]); + func_802EFEC0(temp_v0, arg2[2], arg2[3]); + func_802EFA5C(temp_v0, 0.05f, 0.1f); + func_802EFA70(temp_v0, 0x10); + func_802EFA78(temp_v0, 1); + particleEmitter_emitN(temp_v0, arg1); +} + +void func_8038F01C(void) { + func_80386654(1.0f, D_80391B94, D_80391B84); +} + +void func_8038F050(void) { + func_80386654(1.0f, D_80391B84, D_80391B94); +} + +void func_8038F084(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + ActorLocal_fight_87A0 *local = (ActorLocal_fight_87A0 *)&actor->local; + + D_803928E8[0] = actor->position_x; + D_803928E8[1] = actor->position_y; + D_803928E8[2] = actor->position_z; + + D_803928E8[1] += 120.0f; + + if(actor->state != 2){//L8038F39C + FUNC_8030E8B4(SFX_148_GRUNTY_SPELL_LANDING, 1.0f, 32000, actor->position, 1000, 3500); + timedFunc_set_0(0.0f, func_8038F01C); + timedFunc_set_0(0.3f, func_8038F050); + actor->unk58_0 = 0; + actor->scale *= 1.6; + if(actor->marker->unk14_20 != 0x280){ + func_8038EBE0(actor->position, 4, ASSET_713_SPRITE_SPARKLE_YELLOW, + D_80391C0C, D_80391C24, D_80391C3C, + D_80391C54, D_80391C64, D_80391C74 + ); + func_8038EBE0(actor->position, 4, ASSET_715_SPRITE_SPARKLE_RED, + D_80391C0C, D_80391C24, D_80391C3C, + D_80391C54, D_80391C64, D_80391C74 + ); + func_8038EEFC(actor->position, 3, D_80391BFC); + func_8038ED9C(D_803928E8, ASSET_4A0_SPRITE_EXPLOSION, 1, D_80391BA4, D_80391BE4, + D_80391BAC, D_80391BBC, D_80391BDC + + ); + D_803928E8[1] -= 50.0f; + func_8038ED9C(D_803928E8, ASSET_6C1_SPRITE_SMOKE, 2, D_80391BA4, D_80391BE4, + D_80391BAC, D_80391BBC, D_80391BDC + + ); + } + else{//L8038F304 + func_8038EBE0(actor->position, 4, ASSET_713_SPRITE_SPARKLE_YELLOW, + D_80391C0C, D_80391C24, D_80391C3C, + D_80391C54, D_80391BCC, D_80391C74 + ); + func_8038EEFC(actor->position, 3, D_80391BFC); + func_8038CED8(actor->position, 0x558, 0.15f, 0.5f); + actor->position_y += 260.0f; + func_8038C5F0(actor, 0x712, ASSET_6C3_SPRITE_SMOKE_GREEN, 1.6f); + } + local->unk0 = 0.66f; + func_80328A84(actor, 2); + }//L8038F39C +} + +void func_8038F3B4(ActorMarker *marker, ActorMarker *other){ + if( other->unk14_20 == 0x276 + || other->unk14_20 == 0x27A + || other->unk14_20 == 0x27F + ) return; + + func_8038F084(marker); + switch(func_80320424(0x23, 3)){ + case 1: //8038F41C + if(!D_803928E0 && func_80311480(randi2(0, 5) + 0x10f2, 0, 0, 0, 0, 0)) + D_803928E0 = 1; + break; + case 2: //8038F468 + if(!D_803928E1 && func_80311480(randi2(0, 5) + 0x110b, 0, 0, 0, 0, 0)) + D_803928E1 = 1; + break; + case 3: //8038F4B4 + if(!D_803928E2 && func_80311480(randi2(0, 5) + 0x1122, 0, 0, 0, 0, 0)) + D_803928E2 = 1; + break; + case 4: //8038F500 + if( !D_803928E3 + && func_8038C2A4() + && func_80311480(randi2(0, 5) + 0x113b, 0, 0, 0, 0, 0) + ) + D_803928E3 = 1; + break; + case 5: + if( !D_803928E4 + && func_8038C2B0() + && func_80311480(randi2(0, 5) + 0x1154, 0, 0, 0, 0, 0) + ) + D_803928E4 = 1; + break; + }//L8038F5B0 + +} + +s32 func_8038F5BC(f32 *arg0, f32 arg1) { + if (((arg0[0] * arg0[0]) + (arg0[2] * arg0[2])) < arg1) { + return 1; + } + return 0; +} + +void func_8038F5F8(Actor *arg0) { + func_80324D2C(0.0f, COMUSIC_43_ENTER_LEVEL_GLITTER); +} + +void func_8038F620(Actor *this){ + ActorLocal_fight_87A0 * local = (ActorLocal_fight_87A0 *)&this->local; + f32 sp40 = time_getDelta(); + static f32 D_80392914; + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + marker_setCollisionScripts(this->marker, NULL, NULL, func_8038F3B4); + this->marker->propPtr->unk8_3 = 0; + actor_collisionOn(this); + this->unk60 = 8.0f; + this->scale = 0.1f; + if( this->marker->unk14_20 == 0x280){ + actor_collisionOff(this); + func_803300D8(this->marker, func_8038F5F8); + func_80324CFC(0.0f, COMUSIC_43_ENTER_LEVEL_GLITTER, 32000); + timed_playSfx(0.0f, SFX_113_PAD_APPEARS, 1.0f, 32000); + timed_playSfx(0.75f, 0x415, 1.0f, 32000); + timed_playSfx(2.0f, 0x415, 1.0f, 32000); + + + } + else{//L8038F738 + func_80324D54(0.26f, SFX_14F_FIREWORK_WHISTLING, 1.0f, 0x61A8, + this->position, 1000.0f, 7500.0f + ); + + func_80324D54(0.4f, SFX_14E_SOFT_EXPLOSION, 1.0f, 0x61A8, + this->position, 500.0f, 4500.0f + ); + } + }//L8038F79C + if(D_803928E5 && this->marker->unk14_20 == 0x280){ + func_802BAD08(this->position); + }//L8038F7D4 + + switch(this->state){ + case 1://L8038F7F8 + { // TODO: get rid of f0, maybe D_80392914 is static? + // f32 temp_f0; + + D_80392914 = sp40*1.4; + // temp_f0 = this->scale + D_80392914; + this->scale = (this->scale + D_80392914 < 1.0) ? this->scale + D_80392914 : 1.0f; + } + + switch(this->marker->unk14_20){ + case 0x25C://L8038F8AC + func_8038ED9C(this->position, ASSET_4A0_SPRITE_EXPLOSION, 1, + D_80391CEC, D_80391D34, + D_80391CF4, D_80391D04, D_80391D14 + ); + break; + case 0x280://L8038F8C8 + func_8038ED9C(this->position, ASSET_6C9_SPRITE_SMOKE_GREEN_BIG, 1, + D_80391CEC, D_80391D34, + D_80391CF4, D_80391D1C, D_80391D2C + ); + func_8023DB5C(); + break; + }//L8038F918 + D_803928F8[0] = this->position[0]; + D_803928F8[1] = this->position[1]; + D_803928F8[2] = this->position[2]; + + this->position[0] += this->velocity_x*sp40; + this->position[1] += this->velocity_y*sp40; + this->position[2] += this->velocity_z*sp40; + + this->velocity[0] += this->unk1C[0]*sp40; + this->velocity[1] += this->unk1C[1]*sp40; + this->velocity[2] += this->unk1C[2]*sp40; + + this->pitch += 200.0f*sp40; + this->yaw += 200.0f*sp40; + + if( this->position_y < -2500.0f + || 5000.0f < this->position_y + || !func_8038F5BC(this->position, 100000000.0f) + ){ + marker_despawn(this->marker); + } + else{ + if(this->position_y < 300.0f + && func_8038F5BC(this->position, 16000000.0f) + ){ + if(func_80320C94(D_803928F8, this->position, func_8033229C(this->marker), D_80392908, 8, 0x40000000)){ + func_8038F084(this->marker); + return; + } + } + } + // L8038FABC + if( this->marker->unk14_20 != 0x280 + && func_8028F25C() + ){ + func_8038F084(this->marker); + } + else { + if(0.0 <= this->unk60){ + this->unk60 -= sp40; + }else{ + func_8038F084(this->marker); + } + } + break; + case 2://L8038FB34 + if(local->unk0 < 0.0){ + marker_despawn(this->marker); + }else{ + local->unk0 -= sp40; + } + break; + }//L8038FB74 +} + +void func_8038FB84(ActorMarker *arg0, f32 *arg1, f32 *arg2, f32 *arg3) { + Actor *temp_v0 = marker_getActor(arg0); + + temp_v0->position_x = arg1[0]; + temp_v0->position_y = arg1[1]; + temp_v0->position_z = arg1[2]; + temp_v0->velocity_x = arg2[0]; + temp_v0->velocity_y = arg2[1]; + temp_v0->velocity_z = arg2[2]; + temp_v0->unk1C_x = arg3[0]; + temp_v0->unk1C_y = arg3[1]; + temp_v0->unk1C_z = arg3[2]; +} + +void func_8038FC00(void) { + D_803928E0 = (u8)0; + D_803928E1 = (u8)0; + D_803928E2 = (u8)0; + D_803928E3 = (u8)0; + D_803928E4 = (u8)0; +} + +void func_8038FC2C(s32 arg0) { + D_803928E5 = arg0; +} diff --git a/src/fight/code_9850.c b/src/fight/code_9850.c new file mode 100644 index 00000000..88199fda --- /dev/null +++ b/src/fight/code_9850.c @@ -0,0 +1,142 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80386654(f32 arg0, f32 (*arg1)[4], f32 (*arg2)[4]); +extern void func_80387470(Actor *, f32 [3], f32, f32, f32, f32, f32); +extern Actor *func_80325CAC(ActorMarker *, Gfx **, Mtx **, Vtx**); + +void func_8038FE94(Actor *this); +Actor *func_8038FC40(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3); + +/* .data */ +ActorInfo D_80391DC0 = { + 0x25D, 0x38A, 0x6C7, 0x1, NULL, + func_8038FE94, func_80326224, func_8038FC40, + 0, 0, 1.0f, 0 +}; + +f32 D_80391DE4[4] = {0.6f, 1.0f, 1.0f, 1.0f}; +f32 D_80391DF4[4] = {0.3f, 0.3f, 0.3f, 1.0f}; +s32 D_80391E04[2] = {1, 9}; +f32 D_80391E0C[4] = {4.5f, 4.5f, 4.5f, 4.5f}; +f32 D_80391E1C[4] = {0.0f, 0.0f, 0.85f, 1.35f}; +f32 D_80391E2C[2] = {0.6f, 0.7f}; +f32 D_80391E34[6] = {-130.0f, 0.0f, -130.0f, 130.0f, 0.0f, 130.0f}; +f32 D_80391E4C[4] = {1.1f, 1.1f, 4.0f, 5.4f}; + +f32 D_80391E5C[6] = {-20.0f, 0.0f, -20.0f, 20.0f, 40.0f, 20.0f}; +f32 D_80391E74[6] = {0.0f, -1200.0f, 0.0f, 0.0f, -1200.0f, 0.0f}; +f32 D_80391E8C[6] = {-420.0f, 410.0f, -420.0f, 480.0f, 860.0f, 480.0f}; +f32 D_80391EA4[4] = {0.35f, 0.65f, 0.0f, 0.0f}; +f32 D_80391EB4[4] = {0.0f, 0.01f, 2.0f, 2.3f}; +f32 D_80391EC4[2] = { 0.0f, 0.35f}; + +f32 D_80391ECC[6] = {0.0f, 50.0f, 0.0f, 0.0f, 50.0f, 0.0f}; +f32 D_80391EE4[6] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}; +f32 D_80391EFC[6] = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}; +f32 D_80391F14[4] = {0.2f, 0.25f, 2.3f, 2.5f}; +f32 D_80391F24[4] = {0.0f, 0.0f, 0.34f, 0.34f}; +f32 D_80391F34[2] = {0.7f, 0.8f}; + +f32 D_80391F3C[6] = { -50.0f, -50.0f, -50.0f, 50.0f, 50.0f, 50.0f}; +f32 D_80391F54[6] = { 0.0f, -1200.0f, 0.0f, 0.0f, -1200.0f, 0.0f}; +f32 D_80391F6C[6] = { -260.0f, -260.0f, -260.0f, 260.0f, 260.0f, 260.0f}; +f32 D_80391F84[4] = {0.15f, 0.3f, 0.0f, 0.0f}; +f32 D_80391F94[4] = {0.0f, 0.01f, 0.7f, 0.8f}; +f32 D_80391FA4[2] = {0.0f, 0.65f}; + +/* .code */ +Actor *func_8038FC40(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3){ + Actor *actor = marker_getActor(marker); + func_80344C2C(1); + return func_80325CAC(marker, gdl, mptr, arg3); +} + +void func_8038FC88(void){ + func_80386654(1.0f, &D_80391DF4, &D_80391DE4); +} + +void func_8038FCBC(void){ + func_80386654(1.0f, &D_80391DE4, &D_80391DF4); +} + +void func_8038FCF0(ActorMarker *marker, ActorMarker *other_marker){ + Actor *actor = marker_getActor(marker); + f32 sp38[3]; + sp38[0] = actor->position_x; + sp38[1] = actor->position_y; + sp38[2] = actor->position_z; + sp38[1] += 160.0f; + FUNC_8030E8B4(SFX_1B_EXPLOSION_1, 1.0f, 32000, actor->position, 1000, 3500); + timedFunc_set_0(0.0f, func_8038FC88); + timedFunc_set_0(0.3f, func_8038FCBC); + func_8038EBE0(actor->position, 4, ASSET_710_SPRITE_SPARKLE_PURPLE, + &D_80391E5C, &D_80391E74, &D_80391E8C, + &D_80391EA4, &D_80391EB4, &D_80391EC4 + ); + func_8038EBE0(actor->position, 4, ASSET_711_SPRITE_SPARKLE_DARK_BLUE, + &D_80391E5C, &D_80391E74, &D_80391E8C, + &D_80391EA4, &D_80391EB4, &D_80391EC4 + ); + func_8038EEFC(actor->position, 3, &D_80391E4C); + func_8038ED9C(&sp38, 0x6C8, 3, + &D_80391E04, &D_80391E34, + &D_80391E0C, &D_80391E1C, &D_80391E2C + ); + marker_despawn(actor->marker); +} + +void func_8038FE94(Actor *this){ + f32 sp54 = time_getDelta(); + f32 sp48[3]; + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + marker_setCollisionScripts(this->marker, NULL, NULL, func_8038FCF0); + this->marker->propPtr->unk8_3 = 0; + actor_collisionOn(this); + this->unk60 = 10.0f; + this->scale = (f64)this->scale + this->scale; + }//L8038FF18 + this->roll += 20.0f; + if(func_8023DB5C()%4 == 1){ + if(randf() < 0.5){ + func_8038EBE0(this->position, 4, ASSET_718_SPRITE_SPARKLE_WHITE_2, + &D_80391F3C, &D_80391F54, &D_80391F6C, + &D_80391F84, &D_80391F94, &D_80391FA4 + ); + } + else{//L8038FFE0 + func_8038EBE0(this->position, 4, ASSET_719_SPRITE_SPARKLE_GREEN_2, + &D_80391F3C, &D_80391F54, &D_80391F6C, + &D_80391F84, &D_80391F94, &D_80391FA4 + ); + } + }//L80390020 + player_getPosition(sp48); + sp48[1] += 50.0f; + func_80387470(this, sp48, this->unk1C[0], this->unk1C[1], 0.0f, 1400.0f, 70.0f); + + if(func_8028F25C()){ + func_8038FCF0(this->marker, 0); + } + else{ + if(0.0 <= this->unk60){ + this->unk60 -= sp54; + } + else{ + func_8038FCF0(this->marker, 0); + } + } +} + +void func_803900DC(ActorMarker *marker, f32 (*arg1)[3], f32 arg2, f32 arg3){ + Actor *actor = marker_getActor(marker); + actor->position_x = (*arg1)[0]; + actor->position_y = (*arg1)[1]; + actor->position_z = (*arg1)[2]; + + actor->unk1C[0] = arg2; + actor->unk1C[1] = arg3; +} diff --git a/src/fight/code_9D40.c b/src/fight/code_9D40.c new file mode 100644 index 00000000..5b96fc22 --- /dev/null +++ b/src/fight/code_9D40.c @@ -0,0 +1,420 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_8038C288(void); +extern void func_80328B8C(Actor *, s32, f32, s32); +extern void func_80324CFC(f32, s32, s32); +extern void func_802F9E44(s32, f32, f32, f32, f32); +extern void func_80387470(Actor *, f32 [3], f32, f32, f32, f32, f32); +extern void func_8038C0DC(f32[3]); + +extern void func_8038C5F0(Actor *, enum asset_e, enum asset_e, f32); + +typedef struct{ + f32 unk0; + f32 unk4; + f32 unk8[3]; + f32 unk14; + f32 unk18; + f32 unk1C; + s32 unk20; + s32 unk24; + s32 unk28; +}ActorLocal_fight_9850; + +void func_8039049C(Actor *this); + +/* .data */ + +//BBC0 +ActorAnimationInfo D_80391FB0[] = { + {0x000, 00000000}, + {0x275, 1000000.0f}, + {0x275, 3.3f}, + {0x276, 0.67f}, + {0x277, 1.167f}, + {0x27E, 2.5f}, + {0x27F, 4.0f}, + {0x262, 2.0f}, + {0x278, 1.75f}, + {0x27B, 2.25f}, + {0x27C, 0.33f}, + {0x27D, 0.8f}, + {0x280, 0.4f} +}; + +ActorInfo D_80392018 = { + 0x285, 0x3AC, 0x551, 0x1, D_80391FB0, + func_8039049C, func_80326224, func_80325888, + 0, 0, 1.0f, 0 +}; + +s32 D_8039203C[] = {0xDC, 0x96, 0x82, 0xB4, 0xD2, 0xAA, 0xC8, 0x96, 0xB4}; +s32 D_80392060[] = {0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, 0xA0, 0xA1, 0xA2}; + +/* .bss */ +f32 D_80392720; +f32 D_80392724; +f32 D_80392920[3]; + +/* .code */ +void func_80390130(f32 position[3], int count, enum asset_e sprite_id){ + ParticleEmitter *s0 = partEmitList_pushNew(count); + particleEmitter_setSprite(s0, sprite_id); + particleEmitter_setStartingFrameRange(s0, 1, 6); + particleEmitter_setPosition(s0, position); + particleEmitter_setParticleAccelerationRange(s0, 0.0f, -200.0f, 0.0f, 0.0f, -200.0f, 0.0f); + particleEmitter_setParticleVelocityRange(s0, -100.0f, -100.0f, -100.0f, 100.0f, 100.0f, 100.0f); + func_802EFB70(s0, 0.5f, 0.65f); + func_802EFB84(s0, 0.0f, 0.0f); + particleEmitter_setSpawnIntervalRange(s0, 0.0f, 0.01f); + func_802EFEC0(s0, 0.65f, 0.85f); + func_802EFA5C(s0, 0.0f, 0.35f); + func_802EFA78(s0, 1); + func_802EFA70(s0, 4); + particleEmitter_emitN(s0, count); +} + +void func_80390278(Actor *this){ + f32 sp34[3]; + int i; + for(i = 0; i < 4; i++){ + if(randf() < 0.3){ + func_8034A174(this->marker->unk44, i + 5, sp34); + func_80390130(sp34, 1, ASSET_718_SPRITE_SPARKLE_WHITE_2); + } + } +} + +void func_80390318(Actor *this, s32 arg1){ + s32 sp1C; + s32 sp18; + + switch(arg1){ + case 1: + case 5: + sp1C = ASSET_71B_SPRITE_SPARKLE_ORANGE_2; + sp18 = ASSET_6C5_SPRITE_SMOKE_ORANGE; + break; + case 2: + case 6: + sp1C = ASSET_719_SPRITE_SPARKLE_GREEN_2; + sp18 = ASSET_6C3_SPRITE_SMOKE_GREEN; + break; + case 3: + case 7: + sp1C = ASSET_71A_SPRITE_SPARKLE_PINK_2; + sp18 = ASSET_6C6_SPRITE_SMOKE_PINK; + break; + case 4: + case 8: + sp1C = ASSET_717_SPRITE_SPARKLE_YELLOW_2; + sp18 = ASSET_6C4_SPRITE_SMOKE_YELLOW; + break; + case 9: + case 10: + sp1C = ASSET_718_SPRITE_SPARKLE_WHITE_2; + sp18 = ASSET_6C2_SPRITE_SMOKE_WHITE; + break; + } + func_8038C5F0(this, sp1C, sp18, 2.0f); +} + +void func_803903C4(Actor *this){ + animctrl_setSmoothTransition(this->animctrl, FALSE); + func_80328B8C(this, 7, 0.001f, 1); + actor_loopAnimation(this); +} + +void func_8039040C(Actor *this){ + ActorLocal_fight_9850 *local = (ActorLocal_fight_9850 *)&this->local; + f32 tick = time_getDelta(); + + local->unk14 = MIN(1.99, local->unk14 + local->unk18*tick); + func_8030DBB4(this->unk44_31, local->unk14); + if(func_8030E3FC(this->unk44_31) == 0) + func_8030E2C4(this->unk44_31); +} + +void func_8039049C(Actor *this){ + ActorLocal_fight_9850 *local = (ActorLocal_fight_9850 *)&this->local; + f32 sp58; + f32 sp54; + f32 sp50; + s32 sp4C; + f32 sp48; + + + sp58 = time_getDelta(); + sp54 = animctrl_getDuration(this->animctrl); + + if(!this->unk16C_4){ + this->unk16C_4 = 1; + local->unk18 = 0.40000000000000013 / (this->unk60 + 3.3); + local->unk14 = 0.7f; + func_8025A6EC(JINGLE_MENACING_GRUNTILDA_B, 20000); + func_8025A58C(0, 0x7fff); + this->unk44_31 = func_8030ED2C(SFX_17A_SHIPHORN, 3); + sfxsource_setSampleRate(this->unk44_31, 25000); + func_8030DBB4(this->unk44_31, local->unk14); + func_8030E2C4(this->unk44_31); + local->unk28 = 0xC; + }//L80390574 + + if(0.0 < local->unk4){ + local->unk4 -= sp58; + return; + } + + + switch(this->state){ + case 1: //803905D4 + func_8039040C(this); + animctrl_setAnimTimer(this->animctrl, 0.0f); + this->unk60 -= sp58; + if(this->unk60 < 0.0){ + func_80328B8C(this, 2, 0.001f, 1); + actor_playAnimationOnce(this); + } + break; + + case 2: //80390648 + func_8039040C(this); + if(actor_animationIsAt(this, 0.27f)) + FUNC_8030E624(SFX_D0_GRIMLET_SQUEAK, 0.7f, 29000); + + if(actor_animationIsAt(this, 0.44f)){ + FUNC_8030E624(SFX_176_JINJONATOR_JINJOOO_1, 1.0f, 25000); + timed_playSfx(0.66f, SFX_176_JINJONATOR_JINJOOO_1, 0.9f, 25000); + } + + if(actor_animationIsAt(this, 0.999f)){ + func_80328B8C(this, 3, 0.001f, 1); + actor_playAnimationOnce(this); + func_8030E394(this->unk44_31); + func_8030DA44(this->unk44_31); + this->unk44_31 = 0; + local->unk0 = (320.0f - this->position_y) * 0.5; + func_80324CFC(0.0f, 0x8c, 0x7d00); + } + break; + + case 3: //8039073C + func_80390278(this); + if(this->position_y < 320.0f){ + this->position_y = MIN(320.0f, this->position_y + local->unk0*sp58); + }//L803907A0 + + if(320.0f == this->position_y){ + func_80328B8C(this, 4, 0.001f, 1); + actor_loopAnimation(this); + local->unk4 = func_8038C288(); + } + break; + + case 4: //803907D4 + func_80390278(this); + func_80328B8C(this, 5, 0.001f, 1); + actor_playAnimationOnce(this); + break; + + case 5: //80390804 + func_80390278(this); + if(actor_animationIsAt(this, 0.998f)){ + animctrl_setSmoothTransition(this->animctrl, FALSE); + func_80328B8C(this, 6, 0.0001f, 1); + actor_loopAnimation(this); + if(this->unk44_31 == 0){ + local->unk18 = 0.1f; + local->unk14 = 0.4f; + this->unk44_31 = func_8030ED2C(0x416, 3); + sfxsource_setSampleRate(this->unk44_31, 26000); + func_8030DBB4(this->unk44_31, local->unk14); + func_8030E2C4(this->unk44_31); + }//L803908AC + local->unk1C = 0.5f; + } + break; + + case 6: //803908BC + this->position[1] = MIN(1e+8f, this->position[1] + 80.0f*sp58); + animctrl_setDuration(this->animctrl, MAX(0.4, sp54 - (0.5*sp58))); + func_80390278(this); + if(actor_animationIsAt(this, 0.25f) || actor_animationIsAt(this, 0.75f)){ + FUNC_8030E624(SFX_2_CLAW_SWIPE, local->unk1C, 26000); + local->unk1C += 0.04; + }//L80390A4C + func_8039040C(this); + if(actor_animationIsAt(this, 0.5f)){ + if(--local->unk28 <= 0){ + func_803903C4(this); + FUNC_8030E8B4(SFX_135_CARTOONY_SPRING, 1.0f, 32000, this->position, 10000, 16000); + func_80324D54(0.1f, SFX_C1_BUZZBOMB_ATTACK, 0.85f, 32000, this->position, 5000.0f, 12000.0f); + if((u8)this->unk44_31){ + func_8030E394(this->unk44_31); + func_8030DA44(this->unk44_31); + this->unk44_31 = 0; + } + func_80324D2C(0.0f, COMUSIC_8C_JINJONATOR_POWERUP); + func_8034A174(this->marker->unk44, 0x1f, this->position); + this->velocity[0] = (this->position[0] - this->unk1C[0]) / sp58; + this->velocity[1] = (this->position[1] - this->unk1C[1]) / sp58; + this->velocity[2] = (this->position[2] - this->unk1C[2]) / sp58; + } + + }//L80390B60 + else{ + func_8034A174(this->marker->unk44, 0x1f, this->unk1C); + } + break; + case 7: //80390B78 + sp50 = local->unk24*0.11 + 1.0; + func_80390278(this); + func_8038C0DC(local->unk8); + local->unk8[1] += 100.0f; + func_80387470(this, local->unk8, sp50*2400.0f, sp50*2400.0f*4.2, 170.0f, sp50*2500.0f, 0.0f); + break; + case 8: //80390C48 + if(actor_animationIsAt(this, 0.16f) || actor_animationIsAt(this, 0.47f)) + FUNC_8030E624(SFX_2_CLAW_SWIPE, 1.0f, 28000); + + if(actor_animationIsAt(this, 0.999f)){ + func_8034A174(this->marker->unk44, 0x1f, this->position); + func_803903C4(this); + FUNC_8030E8B4(SFX_135_CARTOONY_SPRING, 1.0f, 32000, this->position, 10000, 16000); + func_80324D54(0.1f, SFX_C1_BUZZBOMB_ATTACK, 0.85f, 32000, this->position, 5000.0f, 12000.0f); + this->velocity[2] = 0.0f; + this->velocity[1] = 0.0f; + this->velocity[0] = 0.0f; + + } + + break; + + case 9: //80390D20 + if(actor_animationIsAt(this, 0.16f) || actor_animationIsAt(this, 0.47f)) + FUNC_8030E624(SFX_2_CLAW_SWIPE, 1.0f, 28000); + + + if(actor_animationIsAt(this, 0.8f)){ + sp4C = func_802F9AA8(SFX_141_MECHANICAL_WINCH); + func_802F9F80(sp4C, 0.0f, 5.92f, 0.0f); + func_802F9E44(sp4C, 0.1f, 5.92f, 0.3f, 1.0f); + func_802FA060(sp4C, 32000, 32000, 0.0f); + } + + if(actor_animationIsAt(this, 0.999f)){ + func_80328B8C(this, 0xA, 0.001f, 1); + actor_loopAnimation(this); + local->unk20 = 0xE; + } + break; + + case 10: //80390E1C + if(actor_animationIsAt(this, 0.999f)){ + local->unk20--; + } + + if(local->unk20 == 2 && actor_animationIsAt(this, 0.1f)){ + FUNC_8030E624(SFX_176_JINJONATOR_JINJOOO_1, 1.0f, 32000); + timed_playSfx(0.66f, SFX_176_JINJONATOR_JINJOOO_1, 0.9f, 32000); + }//L80390E90 + + if(local->unk20 <= 0){ + s32 text_id; + func_80328B8C(this, 0xB, 0.001f, 1); + actor_playAnimationOnce(this); + func_802BB41C(0); + text_id = 0x115e + randi2(0,5); + func_80311480(text_id, 0x20, 0, 0, 0, 0); + } + break; + case 11: //80390EF8 + if(actor_animationIsAt(this, 0.999f)){ + func_8034A174(this->marker->unk44, 0x1f, this->position); + FUNC_8030E624(SFX_17B_AIRPLANE_FALLING, 1.0f, 32000); + FUNC_8030E624(SFX_147_GRUNTY_SPELL_ATTACK_2, 1.0f, 32000); + animctrl_setSmoothTransition(this->animctrl, 0); + func_80328B8C(this, 0xC, 0.001f, 1); + actor_playAnimationOnce(this); + this->velocity[2] = 0.0f; + this->velocity[1] = 0.0f; + this->velocity[0] = 0.0f; + + } + break; + case 12: //80390F7C + sp48 = local->unk24*0.11 + 1.0; + func_80390278(this); + func_8038C0DC(local->unk8); + local->unk8[1] += 100.0f; + func_80387470(this, local->unk8, sp48*2400.0f, sp48*2400.0f*4.2, 170.0f, sp48*2500.0f, 0.0f); + break; + }//L80391044 + func_8034A174(this->marker->unk44, 0x1f, D_80392920); +} + +void func_80391070(ActorMarker *marker, s32 arg1, s32 arg2) { + Actor *temp_s0; + ActorLocal_fight_9850 *local; + s32 pad; + + temp_s0 = marker_getActor(marker); + local = (ActorLocal_fight_9850 *)&temp_s0->local; + + func_8025A6EC(D_80392060[arg1-1], 20000); + + func_80390318(temp_s0, arg1); + FUNC_8030E8B4(SFX_1B_EXPLOSION_1, 1.0f, 32000, temp_s0->position, 1000, 6500); + + temp_s0->velocity[2] = 0.0f; + temp_s0->velocity[1] = 0.0f; + temp_s0->velocity[0] = 0.0f; + + temp_s0->yaw = (f32)D_8039203C[arg1-1]; + if (arg2 != 0) { + temp_s0->yaw = (f32) (temp_s0->yaw + 180.0f); + } + local->unk24 = arg1; + animctrl_setSmoothTransition(temp_s0->animctrl, 1); + actor_playAnimationOnce(temp_s0); + if (&D_8039203C[arg1] >= D_80392060) { + func_80328B8C(temp_s0, 9, 0.001f, 1); + return; + } + func_80328B8C(temp_s0, 8, 0.001f, 1); + animctrl_setDuration(temp_s0->animctrl, (f32) (1.75 - 0.11 * local->unk24)); +} + +void func_803911F8(ActorMarker *marker){ + Actor *actor = marker_getActor(marker); + func_80390318(actor, 0xa); + marker_despawn(actor->marker); +} + +f32 func_80391234(void){ + return 3.3f; +} + +f32 func_80391240(void){ + return 2.0; +} + +f32 func_80391250(void){ + return 4.62f; +} + +s32 func_8039125C(ActorMarker *marker){ + u32 state = (u32) (marker_getActor(marker))->state; + if (state == 0x7 || state == 0xC) { + return 1; + } + return 0; +} + +void func_8039129C(f32 arg0[3]) { + arg0[0] = D_80392920[0]; + arg0[1] = D_80392920[1]; + arg0[2] = D_80392920[2]; +} diff --git a/src/fight/code_AED0.c b/src/fight/code_AED0.c new file mode 100644 index 00000000..9ebd5654 --- /dev/null +++ b/src/fight/code_AED0.c @@ -0,0 +1,30 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *func_803912C0(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3); +void func_80391360(Actor *this); + +/* .data */ +ActorInfo D_80392090 = { + 0x288, 0x3AF, 0x3BF, 0x1, NULL, + func_80391360, func_80326224, func_803912C0, + 0, 0, 0.0f, 0 +}; + +/* .code */ +Actor *func_803912C0(ActorMarker *marker, Gfx **gdl, Mtx **mptr, Vtx **arg3){ + f32 sp34[3]; + f32 sp30; + Actor *sp2C; + sp2C = func_80325300(marker, sp34); + sp30 = sp2C->scale * ml_map_f(sp2C->unk1C[0], 0.0f, 1000.0f, 1.75f, 0.9f); + set_model_render_mode(2); + func_803391A4(gdl, mptr, sp2C->position, sp34, sp30, NULL, func_80330B1C(marker)); + return sp2C; +} + + +void func_80391360(Actor *this){ + actor_collisionOff(this); +} diff --git a/src/lair/code_0.c b/src/lair/code_0.c new file mode 100644 index 00000000..01aaf481 --- /dev/null +++ b/src/lair/code_0.c @@ -0,0 +1,1885 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "prop.h" + +extern void func_8028F918(s32); +extern void func_802D2FB0(Actor *, s32, s32, s32, f32, s32, s32, s32); +extern void func_802D3CE8(Actor *); +extern void func_802D3D54(Actor *); +extern void func_802D3D74(Actor *this); +extern void func_802D4830(Actor *, s32, f32); +extern void func_802EE6CC(f32[3], f32[3], s32[4], s32, f32, f32, s32, s32, s32); +extern void func_80324CFC(f32, enum comusic_e, s32); +extern int func_8032886C(Actor *, f32); +extern void func_80328B8C(Actor *, s32, f32, s32); +extern void func_8033A45C(s32, s32); +extern void func_8034E0FC(void *, s32); +extern void *func_8034C2C4(ActorMarker *, s32); + + + +void func_803863F0(Actor *this); +void func_803864B0(Actor *this); +void func_80386550(Actor *this); +Actor *func_8038664C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80386D78(Actor *this); +void SM_CRCs_are_valid(Actor *this); +void func_803867A8(Actor *this); +void func_80386D20(Actor *this); +void func_803870DC(Actor *this); +Actor *func_80387560(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80387730(Actor *this); +void func_803880BC(Actor *this); +void func_8038824C(Actor *this); +void func_803882B0(Actor *this); +void func_80388524(Actor *this); +void func_80388FC8(Actor *this); +void func_80389204(Actor *this); +void func_803893B8(Actor *this); +void func_803894B0(Actor *this); +void func_8038982C(Actor *this); +void func_80389898(Actor *this); +void func_80389D08(Actor *this); +void func_803875F0(Actor *this); +Actor *func_80387DA8(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_803896D4(Actor *this); +void func_803896F4(Actor *this); +void func_80389714(Actor *this); +void func_80389734(Actor *this); +void func_8038975C(Actor *this); +void func_80389784(Actor *this); +void func_803897AC(Actor *this); +void func_80389934(Actor *this); +Actor *func_80389E10(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80389FF4(Actor *this); +void func_8038A014(Actor *this); +void func_8038A034(Actor *this); +void func_8038A064(Actor *this); +void func_8038A084(Actor *this); +void func_8038A0A4(Actor *this); + +extern ActorInfo D_80393560; +extern ActorInfo D_80393584; +extern ActorInfo D_803947B0; +extern ActorInfo D_803947D4; +extern ActorInfo D_80393730; +extern ActorInfo D_80394A80; +extern ActorInfo D_80394AB0; +extern ActorInfo D_80394870; +extern ActorInfo D_80394894; +extern ActorInfo D_803948B8; +extern ActorInfo D_80394910; +extern ActorInfo D_80394934; +extern ActorInfo D_80394958; +extern ActorInfo D_80394A08; +extern ActorInfo D_80394A2C; +extern ActorInfo D_80394A50; +extern ActorInfo D_80394980; +extern ActorInfo D_80394C28; +extern ActorInfo D_80394C4C; +extern ActorInfo D_80394C70; +extern ActorInfo D_80394D20; +extern ActorInfo D_80394CF0; +extern ActorInfo D_80394C94; + +/* .data */ +extern ActorAnimationInfo D_80392CB0[]; +extern ActorInfo D_80392D90 = { 0x270, 0x2D8, 0x3B2, 0x1, NULL, func_802D3D54, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_80392DB4 = { 0x110, 0x214, 0x4AB, 0x1, D_80392CB0, func_803896D4, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80392DD8 = { 0x113, 0x217, 0x4A9, 0x1, D_80392CB0, func_803896F4, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80392DFC = { 0x115, 0x219, 0x4AA, 0x1, D_80392CB0, func_80389714, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80392E20 = { 0x11B, 0x221, 0x4B5, 0x1, D_80392CB0, func_80389734, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80392E44 = { 0x11C, 0x222, 0x4B2, 0x1, D_80392CB0, func_8038975C, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80392E68 = { 0x11D, 0x223, 0x4B0, 0x1, D_80392CB0, func_80389784, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80392E8C = { 0x232, 0x23C, 0x4B8, 0x1, D_80392CB0, func_803897AC, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80392EB0 = { 0x23F, 0x246, 0x534, 0x1, D_80392CB0, func_80386D20, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80392ED4 = { 0x241, 0x248, 0x540, 0x1, D_80392CB0, SM_CRCs_are_valid, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80392EF8 = { 0x109, 0x20D, 0x4A1, 0x1, D_80392CB0, func_80386550, func_80326224, func_80325888, 0, 0, 0.0f, 0x85}; +extern ActorInfo D_80392F1C = { 0x264, 0x2E5, 0x550, 0x19, D_80392CB0, func_80388524, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80392F40 = { 0x224, 0x230, 0x4BF, 0xB, D_80392CB0, func_803863F0, func_80326224, func_80325888, 0, 0, 0.0f, 0x88}; +extern ActorInfo D_80392F64 = { 0x225, 0x231, 0x4D5, 0xE, D_80392CB0, func_803864B0, func_80326224, func_80325888, 0, 0, 0.0f, 0x88}; +extern ActorInfo D_80392F88 = { 0x111, 0x215, 0x4A4, 0x1, NULL, func_80388FC8, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_80392FAC = { 0x112, 0x216, 0x4A5, 0x1, NULL, func_80388FC8, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_80392FD0 = { 0x114, 0x218, 0x4A6, 0x1, NULL, func_80389204, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_80392FF4 = { 0x10D, 0x211, 0x4A3, 0x1, NULL, func_80388524, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_80393018 = { 0x22C, 0x23A, 0x4D9, 0x1, NULL, func_803882B0, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_8039303C = { 0x164, 0x259, 0x507, 0x1, NULL, func_803880BC, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_80393060 = { 0x165, 0x25A, 0x508, 0x1, NULL, func_8038824C, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_80393084 = { 0x240, 0x247, 0x48A, 0x1, NULL, func_80386D78, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_803930A8 = { 0x242, 0x249, 0x2DD, 0x1, NULL, func_803867A8, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_803930CC = { 0x11F, 0x225, 0x4B3, 0x1, NULL, func_8038A064, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_803930F0 = { 0x10A, 0x20E, 0x4A2, 0x1, NULL, func_80388524, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_80393114 = { 0x11A, 0x220, 0x4B7, 0x1, NULL, func_80389FF4, func_80326224, func_80325E78, 0, 0, 0.0f, 0x91}; +extern ActorInfo D_80393138 = { 0x11E, 0x224, 0x4AF, 0x1, NULL, func_8038A014, func_80326224, func_80325E78, 0, 0, 0.0f, 0x83}; +extern ActorInfo D_8039315C = { 0x227, 0x234, 0x4D6, 0x1, NULL, func_80388524, func_80326224, func_80325E78, 0, 0, 0.0f, 0x93}; +extern ActorInfo D_80393180 = { 0x228, 0x235, 0x4D7, 0x1, NULL, func_80388524, func_80326224, func_80325E78, 0, 0, 0.0f, 0x8B}; +extern ActorInfo D_803931A4 = { 0x229, 0x236, 0x4D8, 0x1, NULL, func_80388524, func_80326224, func_80325E78, 0, 0, 0.0f, 0x8B}; +extern ActorInfo D_803931C8 = { 0x121, 0x227, 0x4BD, 0x1, NULL, func_8038A034, func_80326224, func_80325888, 0, 0, 0.0f, 0x89}; +extern ActorInfo D_803931EC = { 0x116, 0x21A, 0x4AC, 0x1, NULL, func_803893B8, func_80326224, func_80325E78, 0, 0, 0.0f, 0x82}; +extern ActorInfo D_80393210 = { 0x117, 0x21B, 0x4AD, 0x1, NULL, func_803894B0, func_80326224, func_80325E78, 0, 0, 0.0f, 0x82}; +extern ActorInfo D_80393234 = { 0x10B, 0x20F, 0x4B4, 0x1, NULL, func_80388524, func_80326224, func_80325E78, 0, 0, 0.0f, 0x90}; +extern ActorInfo D_80393258 = { 0x10C, 0x210, 0x4AE, 0x1, NULL, func_80388524, func_80326224, func_80325E78, 0, 0, 0.0f, 0x84}; +extern ActorInfo D_8039327C = { 0x10E, 0x212, 0x4A7, 0x1, NULL, func_80388524, func_80326224, func_80325E78, 0, 0, 0.0f, 0x7F}; +extern ActorInfo D_803932A0 = { 0x120, 0x226, 0x4BC, 0x1, NULL, func_80388524, func_80326224, func_80325E78, 0, 0, 0.0f, 0x87}; +extern ActorInfo D_803932C4 = { 0x122, 0x228, 0x4BE, 0x1, NULL, func_80388524, func_80326224, func_80325E78, 0, 0, 0.0f, 0x8C}; +extern ActorInfo D_803932E8 = { 0x10F, 0x213, 0x4A8, 0x1, NULL, func_803875F0, func_80326224, func_80325E78, 0, 0, 0.0f, 0x80}; +extern ActorInfo D_8039330C = { 0x118, 0x21E, 0x4B1, 0x1, NULL, func_8038A084, func_80326224, func_80325E78, 0, 0, 0.0f, 0x8F}; +extern ActorInfo D_80393330 = { 0x119, 0x21F, 0x4B6, 0x1, NULL, func_8038A0A4, func_80326224, func_80325E78, 0, 0, 0.0f, 0x92}; +extern ActorInfo D_80393354 = { 0x266, 0x2E3, 0x563, 0x1, NULL, func_803870DC, func_80326224, func_80387560, 0, 0, 0.0f, 0}; +extern ActorInfo D_80393378 = { 0x17D, 0x1E1, 0x517, 0x1, NULL, func_80389D08, func_80326224, func_80389E10, 0, 0, 0.0f, 0x8D}; +extern ActorInfo D_8039339C = { 0x234, 0x23E, 0x4E1, 0x12, D_80392CB0, func_8038982C, func_80326224, func_80325E78, 0, 0, 0.0f, 0}; +extern ActorInfo D_803933C0 = { 0x163, 0x258, 0x511, 0x12, D_80392CB0, func_80389898, func_80326224, func_8038664C, 0, 0, 0.0f, 0x8E}; +extern ActorInfo D_803933E4 = { 0x160, 0x255, 0x509, 0x15, D_80392CB0, func_80389934, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +extern ActorInfo D_80393408 = { 0x102, 0x203, 0x491, 0x1, D_80392CB0, func_80387730, func_80326224, func_80387DA8, 0, 0, 0.0f, 0}; +extern struct31s D_8039342C; +extern s16 D_80393452[]; //enum bkprog_e +extern s16 D_80393466[]; +extern s16 D_8039347A[]; //notedoor_notes_required_to_open +extern s16 D_80393490[]; +extern s32 D_803934A0[3]; +extern struct31s D_803934AC; +extern struct42s D_803934D4; +extern s32 D_80393504[4]; + +/* .rodata */ +extern f32 D_80394D50; +extern f64 D_80394D58; +extern f32 D_80394D60; +extern f32 D_80394D64; +extern f32 D_80394D68; +extern f32 D_80394D6C; +extern f32 D_80394D70; +extern f32 D_80394D74; +extern f32 D_80394D78; +extern f32 D_80394D7C; + +extern f64 D_80394F88; + +extern f32 D_80394D80; +extern f32 D_80394D84; +extern f32 D_80394D88; +extern f32 D_80394D8C; //! .rodata : 0.9f +extern f64 D_80394D90; //! .rodata : 1.7 +extern f64 D_80394D98; //! .rodata : 1.1 +extern f32 D_80394FC0; +extern f32 D_80394FC4; +extern f32 D_80394FC8; +extern f32 D_80394FCC; +extern f32 D_80394FD0; +extern f32 D_80394FD4; +extern f32 D_80394FD8; +extern f32 D_80394FDC; +extern f32 D_80394FE0; +extern f32 D_80394FE4; +extern f32 D_80394FE8; +extern f32 D_80394FEC; +extern f32 D_80394FF0; + +/* .bss */ + + +//chcobweb +void func_803863F0(Actor *this) +{ + if(!this->initialized) + { + func_802D3CE8(this); + + if (func_8031FF1C(this->unkF4_8 == 1 ? 0xCB : 0xCC)) + { + marker_despawn(this->marker); + return; + } + } + + if (this->state == 0xC) + { + if (actor_animationIsAt(this, 0.95f)) + { + func_80328B8C(this, 0xD, 0.98f, 1); + func_80326310(this); + } + } +} + +//chbigyellowcobweb +void func_803864B0(Actor *this) +{ + if (!this->initialized) + { + func_802D3CE8(this); + + if (func_8031FF1C(0xCA)) + { + marker_despawn(this->marker); + return; + } + } + + if (this->state == 0xF) + { + if (actor_animationIsAt(this, 0.9f)) + { + func_80328B8C(this, 0x10, 0.98f, 1); + func_80326310(this); + } + } +} + +void func_80386550(Actor *this) +{ + if (!this->initialized) + { + func_802D3CE8(this); + + if (func_8031FF1C(this->unkF4_8 == 1 ? 0xC8 : 0xC9)) + { + marker_despawn(this->marker); + return; + } + } + + switch (this->state) + { + case 9: + { + this->pitch -= 2; + this->position_y--; + + if (func_8032886C(this, 0.95f)) + { + func_80326310(this); + func_80328B8C(this, 10, 0.98f, 1); + + this->pitch = 270.f; + } + + break; + } + default: + break; + } +} + +Actor *func_8038664C(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) +{ + u32 val; + Actor *actor; + + actor = marker_getActor(marker); + val = actor->unk10_12; + + func_8033A45C(3, val == 1 ? 1 : 0); + func_8033A45C(4, val == 0 ? 1 : 0); + + return func_80325888(marker, gfx, mtx, vtx); +} + +ParticleEmitter *func_803866D8(s32 a0) +{ + + void *ptr; + s32 colour[3]; + + ptr = partEmitList_pushNew(0x28); + + func_802F0D54(ptr); + particleEmitter_setSprite(ptr, ASSET_710_SPRITE_SPARKLE_PURPLE); + func_802EFB98(ptr, &D_8039342C); + particleEmitter_setParticleVelocityRange(ptr, 0.f, 70.f, 0.f, 0.f, 140.f, 0.f); + + colour[0] = a0 * 0xFF; + colour[1] = 0xFF; + colour[2] = 0; + + func_802EFFA8(ptr, colour); + + return ptr; +} + +void SM_CRCs_are_valid(Actor *this) +{ + func_802D4AC0(this, 0x8000C6, 0xC7); +} + +void func_803867A8(Actor *this) { + f32 sp5C[3]; + f32 sp50[3]; + f32 phi_f0; + s32 phi_v0; + ParticleEmitter *sp44; + + if (!this->initialized) { + func_802D3CE8(this); + this->unk1C[0] = this->position[0]; + this->unk1C[1] = this->position[1]; + this->unk1C[2] = this->position[2]; + this->position[1] -= 300.0f; + + this->initialized = TRUE; + this->alpha_124_19 = 0; + + this->unk60 = this->yaw; + this->yaw = 0.0f; + this->velocity[0] = 0.0f; + return; + } + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->unk158[0] = func_803866D8(0); + this->unk158[1] = func_803866D8(1); + if (func_803203FC(0x86)) { + ability_unlock(ABILITY_D_SHOCK_JUMP); + func_80320004(0xC6, TRUE); + func_80320004(0xC7, TRUE); + } + } + if ((this->unk1C[1] - 150.0f) <= this->position[1]) { + if (this->alpha_124_19 < 0xFF) { + if (this->unk38_31 != 0) { + this->unk38_31--; + } else { + phi_v0 = this->alpha_124_19 + 3; + if(phi_v0 >= 0x100){ + phi_v0 = 0xFF; + } + this->alpha_124_19 = phi_v0; + if (this->alpha_124_19 < 0xAA){ + this->velocity[0] += 1.0f; + if((this->velocity[0] < 0.0f) || (this->velocity[0] > 19.0f)) { + this->velocity[0] = 0.0f; + func_8030E6A4(SFX_3F6_UNKNOWN, 0.5f, this->alpha_124_19*0x25 + 0x3840); + } + } + } + } else { + this->velocity[0] += 1.0f; + if ((this->velocity[0] < 0.0f) || (this->velocity[0] > 19.0f)) { + this->velocity[0] = 0.0f; + FUNC_8030E8B4(SFX_3F6_UNKNOWN, 0.5f, 24000, this->position, 100, 2300); + + } + } + this->unk60 += 2.5; + while(this->unk60 >= 360.0f){ this->unk60 -= 360.0f;} + + this->position_y = this->unk1C[1]; + sp5C[1] = sp5C[2] =0.0f; + sp5C[0] = this->unkF4_8*2; + ml_vec3f_yaw_rotate_copy(sp5C, sp5C, this->unk60); + this->position[0] = this->unk1C[0] + sp5C[0]; + this->position[2] = this->unk1C[2] + sp5C[2]; + if (this->marker->unk14_21) { + sp44 = this->unk158[func_8023DB5C() & 1]; + if (sp44 != NULL) { + func_802EF9E4(sp44, this->alpha_124_19); + phi_f0 = this->unk60 - 10.0f; + while(phi_f0 < 0.0f) {phi_f0 += 360.0f;} + + sp50[1] = this->unk1C[1]; + sp5C[1] = sp5C[2] = 0.0f; + sp5C[0] = this->unkF4_8*2; + ml_vec3f_yaw_rotate_copy(sp5C, sp5C, phi_f0); + sp50[0] = this->unk1C[0] + sp5C[0]; + sp50[2] = this->unk1C[2] + sp5C[2]; + particleEmitter_setPosition(sp44, sp50); + particleEmitter_setParticleSpawnPositionRange(sp44, -25.0f, 0.0f, -25.0f, 25.0f, 6.0f, 25.0f); + particleEmitter_emitN(sp44, 1); + particleEmitter_setParticleSpawnPositionRange(sp44, -75.0f, 0.0f, -75.0f, 75.0f, 6.0f, 75.0f); + particleEmitter_emitN(sp44, 1); + } + } + } else if (func_8031FF1C(0xC6)) { + this->position_y = this->unk1C[1]; + + if (func_8031FF1C(0xC7)) { + this->unk38_31 = 0; + this->alpha_124_19 = 0xFF; + } + else{ + this->unk38_31 = 0x18; + this->alpha_124_19 = 0; + } + } +} + +void func_80386D20(Actor *this) +{ + func_802D4A9C(this, 0); +} + +void chwasp_setState(void) +{ + func_802D68F0(0xC); + item_set(ITEM_6_HOURGLASS, TRUE); + mapSpecificFlags_set(1, TRUE); +} + +void func_80386D78(Actor *this) { + f32 phi_f2; + + if (!this->initialized) { + func_802D3CE8(this); + this->initialized = TRUE; + this->unk1C[1] = this->position[1]; + this->position[1] -= 300.0f; + this->scale = 0.0001f; + return; + } + + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + if (func_803203FC(0x8A)) { + ability_unlock(ABILITY_9_FLY); + mapSpecificFlags_set(0, TRUE); + this->unk60 = 0.0f; + this->position[1] = this->unk1C[1]; + this->scale = 1.0f; + } + } + if ((this->unk1C[1] - 150.0f) <= this->position[1]) { + if (!func_803203FC(0x8A)) { + if (this->unk60 != 0.0f) { + this->unk60 -= 1.0f; + if (this->unk60 == 0.0f) { + FUNC_8030E624(SFX_25_METAL_SLIDING_OVER_SMTH, 0.8f, 32000); + } + } else { + this->scale = (this->scale < 1.0) ? this->scale + 0.04 : 1.0; + if (this->scale < 1.0) { + this->yaw_moving += 8.0; + if (this->yaw_moving >= 360.0f) { + phi_f2 = this->yaw_moving - 360.0f; + } else { + phi_f2 = this->yaw_moving; + } + this->yaw_moving = phi_f2; + this->yaw = phi_f2; + } + } + if (mapSpecificFlags_get(1) && (item_getCount(ITEM_6_HOURGLASS) == 0)) { + func_802EE278(this, 8, 0x32, 0x46, 0.24f, 1.2f); + func_802EE278(this, 9, 0x28, 0x64, 0.24f, 0.8f); + func_802EE278(this, 0xA, 0x28, 0x28, 0.24f, 1.5f); + func_802D2FB0(this, 0xA, -0x1E, 0xB4, 2.0f, 0x96, 0x28, 0x64); + FUNC_8030E624(SFX_11_WOOD_BREAKING_1, 0.8f, 25000); + func_8030E6D4(SFX_B6_GLASS_BREAKING_1); + this->position[1] = this->unk1C[1] - 300.0f; + mapSpecificFlags_set(1, FALSE); + mapSpecificFlags_set(0, FALSE); + } + } + } else if (mapSpecificFlags_get(0)) { + this->scale = 0.0001f; + this->unk60 = 26.0f; + this->position[1] = this->unk1C[1]; + func_802BAFE4(0x80); + timedFunc_set_0(3.0f, chwasp_setState); + } +} + +void func_803870DC(Actor *this) { + s32 phi_v1; + ParticleEmitter *temp_s5; + s32 i; + f32 sp90[3]; + f32 sp84[3]; + u32 phi_a0; + s32 phi_s4; + s32 sp70[3]; + f32 sp64[3]; + s32 temp_s7; + + phi_v1 = func_8031FF1C(D_80393452[this->unkF4_8]) + || (D_80393466[this->unkF4_8] != 0 && func_803203FC(D_80393466[this->unkF4_8])); + + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + if (phi_v1) { + this->alpha_124_19 = 0xFF; + } else { + this->alpha_124_19 = 0; + } + } + if ((this->alpha_124_19 == 0) && (phi_v1)) { + this->alpha_124_19 = 1; + this->unk60 = 23.0f; + } + + phi_a0 = this->alpha_124_19; + if (phi_a0 == 1) { + this->unk60 -= 1.0f; + if (this->unk60 == 0.0f) { + this->alpha_124_19 = 2; + func_80324CFC(0, COMUSIC_43_ENTER_LEVEL_GLITTER, 32700); + func_80324D2C(1.3f, COMUSIC_43_ENTER_LEVEL_GLITTER); + } + } + + if (this->alpha_124_19 >= 2U) { + if (this->alpha_124_19 < 0xFF) { + phi_v1 = this->alpha_124_19 + 8; + if (phi_v1 >= 0x100) { + phi_v1 = 0xFF; + } + this->alpha_124_19 = phi_v1; + temp_s7 = (s32)((f32)this->alpha_124_19 / 5.0) - 0xC; + if (this->marker->unk14_21 && (temp_s7 > 0)) { + temp_s5 = partEmitList_pushNew(temp_s7); + func_8034A174(func_80329934(), 5, sp90); + func_8034A174(func_80329934(), 6, sp84); + particleEmitter_setSprite(temp_s5, ASSET_710_SPRITE_SPARKLE_PURPLE); + func_802EFB70(temp_s5, 0.13f, 0.18f); + func_802EFB84(temp_s5, 0.08f, 0.13f); + particleEmitter_setParticleAccelerationRange(temp_s5, -500.0f, -1800.0f, -500.0f, 500.0f, 1800.0f, 500.0f); + particleEmitter_setSpawnIntervalRange(temp_s5, 0.0f, 0.01f); + func_802EFEC0(temp_s5, 0.9f, 0.9f); + particleEmitter_setParticleVelocityRange(temp_s5, -400.0f, 400.0f, -400.0f, 400.0f, -400.0f, 400.0f); + func_802EF9E4(temp_s5, this->alpha_124_19); + for(phi_s4 = 0; phi_s4 < temp_s7; phi_s4++){ + for(i = 0; i < 3; i++){ + sp64[i] = randf2(sp90[i], sp84[i]); + } + particleEmitter_setPosition(temp_s5, sp64); + sp70[0] = (s32) ((randf() * 130.0f) + 125.0f); + sp70[2] = sp70[1] = (s32) ((randf() * 170.0f) + 85.0f); + sp70[(randf() > 0.5) ? 2 : 1] = 0; + func_802EFFA8(temp_s5, sp70); + particleEmitter_emitN(temp_s5, 1); + } + } + } + } +} + +Actor *func_80387560(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) +{ + Actor *actor = marker_getActor(marker); + u32 i; + + for (i = 0; i != 10; i++) + func_8033A45C(i + 1, actor->unkF4_8 + 1 == i + 2); + + return func_80325E78(marker, gfx, mtx, vtx); +} + +//circular grate +void func_803875F0(Actor * this) +{ + func_802D3D74(this); + + if (!this->unk16C_4) + { + if (func_8031FF1C(0x1E)) + { + marker_despawn(this->marker); + return; + } + + if (mapSpecificFlags_get(0)) + { + this->unk1C_y = this->position_y; + func_802BAFE4(0x2A); + func_80320004(0x1E, TRUE); + this->unk16C_4 = TRUE; + this->unk38_31 = 0x0C; + } + } + else + { + if (this->unk38_31) + { + this->unk38_31--; + + if (this->unk38_31) + return; + + func_802D4830(this, 0x9A, 0.5f); + } + + this->position_y += 4.0f; + + if (this->position_y > this->unk1C_y + 380.0f) + { + func_802D48B8(this); + FUNC_8030E624(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 17000); + marker_despawn(this->marker); + } + } +} + + +//chnotedoor_update +void func_80387730(Actor *this) { + f32 spAC[3]; + ParticleEmitter *temp_s5; + f32 sp9C[3]; + f32 sp90[3]; + f32 sp84[3]; + s32 i; + f32 phi_f20; + s32 phi_s4; + s32 sp6C[3]; + f32 sp60[3]; + + func_802D3D74(this); + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + this->alpha_124_19 = 0xFF; + this->unk1C[1] = 0.0f; + this->unk1C[2] = 3.5f; + if (func_8031FF1C(this->unkF4_8 + 0x39)) { + marker_despawn(this->marker); + return; + } + if ((this->unkF4_8 >= 2U) && (this->unkF4_8 < 8U) && func_803203FC(D_80393490[this->unkF4_8])) { + marker_despawn(this->marker); + return; + } + } + + this->unk1C[1] += this->unk1C[2]; + if (this->unk1C[1] >= 255.0f) { + this->unk1C[1] = 255.0f; + this->unk1C[2] = -3.5f; + } + if (this->unk1C[1] <= 0.0f) { + this->unk1C[1] = 0.0f; + this->unk1C[2] = 3.5f; + } + if (!func_8031FF1C(this->unkF4_8 + 0x39) && ability_isUnlocked(ABILITY_13_1ST_NOTEDOOR)) { + player_getPosition(spAC); + if ((ml_vec3f_distance(spAC, this->position) < 500.0f) && (func_803114C4() != 0xF64)) { + func_802FACA4(0xC); + } + if (notescore_getTotal() >= D_8039347A[this->unkF4_8]) { + if (this->marker->unk14_21) { + func_8032BC60(this, 5, sp90); + func_8032BC60(this, 6, sp84); + sp9C[0] = (sp90[0] + sp84[0]) / 2; + sp9C[2] = (sp90[2] + sp84[2]) / 2; + phi_f20 = 140.0f; + } else { + sp9C[0] = this->position[0]; + sp9C[2] = this->position[2]; + phi_f20 = 290.0f; + } + sp9C[1] = this->position[1]; + if ((ml_vec3f_distance(spAC, sp9C) < phi_f20) || (this->alpha_124_19 != 0xFF)) { + if (this->alpha_124_19 == 0xFF) { + func_80324CFC(0.0f, COMUSIC_43_ENTER_LEVEL_GLITTER, 32700); + func_80324D2C(2.4f, COMUSIC_43_ENTER_LEVEL_GLITTER); + func_8028F918(2); + } + if (this->alpha_124_19 < 7U) { + this->alpha_124_19 = 0; + } else { + this->alpha_124_19 -= 7; + } + if (this->alpha_124_19 == 0) { + func_80320004(this->unkF4_8 + 0x39, TRUE); + marker_despawn(this->marker); + func_8028F918(0); + func_8028F66C(0x35); + return; + } + if (this->marker->unk14_21) { + temp_s5 = partEmitList_pushNew((s32)((f32) this->alpha_124_19 / 11.0)); + sp6C[2] = 0; + particleEmitter_setSprite(temp_s5, ASSET_710_SPRITE_SPARKLE_PURPLE); + func_802EFB70(temp_s5, 0.13f, 0.18f); + func_802EFB84(temp_s5, 0.08f, 0.13f); + particleEmitter_setParticleAccelerationRange(temp_s5, -10.0f, 0.0f, -10.0f, 10.0f, 1600.0f, 10.0f); + particleEmitter_setSpawnIntervalRange(temp_s5, 0.0f, 0.01f); + func_802EFEC0(temp_s5, 1.4f, 1.4f); + particleEmitter_setParticleVelocityRange(temp_s5, -100.0f, 100.0f, -100.0f, 100.0f, 0.0f, 100.0f); + func_802EF9E4(temp_s5, this->alpha_124_19); + for(phi_s4 = 0; phi_s4 < (s32) ((f32)this->alpha_124_19 / 11.0); phi_s4++){ + for(i = 0; i < 3; i++){ + sp60[i] = randf2(sp90[i], sp84[i]); + } + particleEmitter_setPosition(temp_s5, sp60); + sp6C[0] = (s32) ((randf() * 60.0f) + 195.0f); + sp6C[1] = (s32) ((randf() * 130.0f) + 125.0f); + func_802EFFA8(temp_s5, sp6C); + particleEmitter_emitN(temp_s5, 1); + } + } + } + } else if ((this->unkF4_8 >= 2) && (ml_vec3f_distance(spAC, this->position) < 290.0f)) { + func_80356520(0xB0); + } + } +} + + + +//chnotedoor_draw +Actor *func_80387DA8(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) +{ + // TODO: Think of a better way of doing this, similar to the SM64 one + #define NUM_NOTE_DOORS (12) + #define noteDoorIdx unkF4_8 + #define opacityTimer unk1C[1] + + Actor *actor; + void *var1; + void *var2; + s32 i, idx; + + actor = marker_getActor(marker); + var1 = func_8034C2C4(marker, 0x1F3); + var2 = func_8034C2C4(marker, 0x1F2); + + /** + * Sets opacity of the "note" symbol + */ + if (var2) + func_8034E0FC(var2, actor->opacityTimer); + + /** + * Sets opacity of note door numbers + */ + if (var1) + func_8034E0FC(var1, 0xFF - (s32)actor->opacityTimer); + + /** + * Hides all note door graphics that don't match this note door's index + * e.g. for the 50 note door, hides 180, 260, etc. + */ + for (i = 0; i != NUM_NOTE_DOORS; i++) + func_8033A45C(i + 1, actor->noteDoorIdx + 1 == i + 2); + + /** + * Draw the note door + */ + return func_80325E78(marker, gfx, mtx, vtx); +} + +void func_80387E94(s32 arg0) +{ + ActorMarker *marker; + Actor *actor1; + Actor *actorNew; + Actor *actor2; + + marker = reinterpret_cast(ActorMarker *, arg0); + actor1 = marker_getActor(marker); + actorNew = func_8032813C(0x25A, actor1->position, actor1->yaw); + + // Grab the same pointer again for good measure :^) + actor2 = marker_getActor(marker); + + actorNew->unkF4_20 = actor2->unk78_13; + + actor2->unk100 = actorNew->marker; + + actorNew->unk1C[0] = 0; +} + +void func_80387F1C(void) +{ + f32 tmp[3]; + + func_802BAFE4(0x7B); + + if (func_80304E24(400, tmp)) + { + jiggySpawn(JIGGY_35_LAIR_CC_WITCH_SWITCH, tmp); + // FIXME: macro? + func_802C3F04((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, *(s32 *)&tmp[0], *(s32 *)&tmp[1], *(s32 *)&tmp[2]); + } +} + +void func_80387F78(Actor *this, u32 flag) +{ + if (this->unk1C[0] != 2.f) + { + if (this->unk1C[0] != 0 && func_8031FF1C(0x9B)) + { + u32 flagState = func_8031FF1C(flag); + func_80320004(flag, TRUE); + + if (flagState == FALSE + && !jiggyscore_isSpawned(JIGGY_35_LAIR_CC_WITCH_SWITCH) + && func_8031FF1C(0x9C) + && func_8031FF1C(0x9D)) + { + func_8025A6EC(0x2D, 0x7FFF); + timedFunc_set_0(0.9f, func_80387F1C); + } + } + + if (func_8031FF1C(flag)) + { + this->position_y -= 4.5; // f64 + + if (this->position_y < this->unk1C[1] - 51.f) + { + this->position_y = -1000.f; + this->unk1C[0] = 2.f; + } + } + } +} + +void func_803880BC(Actor *this) +{ + + if (!this->unk16C_4) + { + func_802D3CE8(this); + + this->unk16C_4 = TRUE; + + this->unk1C[1] = this->position_y; + this->position_y -= 51.f; + this->unk1C[0] = 0; + + func_802C3C88((GenMethod_1)func_80387E94, reinterpret_cast(s32, this->marker)); + + if (func_803203FC(0xBC) && !func_8031FF1C(0x9A)) + FUNC_8030E624(SFX_3F6_UNKNOWN, 0.75f, 30000); + } + + if (func_8031FF1C(0x9B)) + { + if (!func_8031FF1C(0x9C)) + { + this->position_y = this->unk1C[1]; + actor_collisionOn(this); + } + + if (this->unk100 != NULL && !func_8031FF1C(0x9D)) + { + Actor *actor = marker_getActor(this->unk100); + actor->position_y = this->unk1C[1]; + actor_collisionOn(actor); + } + } + + if (func_803203FC(0xBC) && !func_8031FF1C(0x9B)) + { + this->position_y += 1.7; + + if (this->position_y >= this->unk1C[1]) + { + this->position_y = this->unk1C[1]; + func_80320004(0x9B, TRUE); + } + + if (this->unk100 != NULL) + { + Actor *actor = marker_getActor(this->unk100); + actor->position_y = this->position_y; + } + } + + func_80387F78(this, 0x9C); +} + +void func_8038824C(Actor *this) +{ + func_802D3CE8(this); + func_80387F78(this, 0x9D); +} + + +void func_80388278(Actor *this) +{ + void func_802F9D38(s32); + + if (!this->unk44_31) + return; + + func_802F9D38(this->unk44_31); + this->unk44_31 = 0; +} + +void func_803882B0(Actor *this) +{ + if (!this->unk16C_4) + { + func_802D3D74(this); + + this->unk16C_4 = TRUE; + + if (func_8031FF1C(0x48)) + this->pitch = 90.f; + + this->unk60 = 0; + } + + if (this->pitch == 90.f || !func_803203FC(0xBB)) + return; + + if (this->pitch == 0) + func_802D4830(this, 0x18, 0.5f); + + this->pitch += 1.1; + + if (this->unk60 == 0 && this->pitch > 42.f) + { + this->unk60 = 1.f; + func_8025A6EC(COMUSIC_3D_JIGGY_SPAWN, 0x7FFF); + } + + if (this->pitch > 90.f) + { + this->pitch = 90.f; + func_80320004(0x48, TRUE); + func_802D48B8(this); + } +} + +void func_80388404(enum bkprog_e flag, enum sfx_e sfx, f32 a2, s32 a3) +{ + if (func_8031FF1C(flag) == FALSE) + func_8030E6A4(sfx, a2, a3); + + func_80320004(flag, TRUE); +} + +void func_80388450(Actor *actor1, Actor *actor2) +{ + f32 vec1[3]; + f32 vec2[3]; + void *actor3 = func_80304C38(0x22A, actor1); + s32 val = func_80304DA8(actor3); + + actor2->yaw = val; + actor1->yaw = val; + + vec1[0] = actor1->unk1C[0] + 252.f; + vec1[1] = 0; + vec1[2] = 0; + + ml_vec3f_yaw_rotate_copy(vec2, vec1, actor1->yaw); + nodeprop_getPosition(actor3, vec1); + + actor1->position_x = vec1[0] - vec2[0]; + actor1->position_z = vec1[2] - vec2[2]; + actor2->position_x = vec1[0] + vec2[0]; + actor2->position_z = vec1[2] + vec2[2]; +} + +void func_80388524(Actor *this) { + s32 sp34; + Actor *sp30; + ParticleEmitter *sp2C; + Actor *sp28; + + sp34 = func_802D677C(-1) + && (func_802D677C(-1) == map_get()) + && (func_802D67AC(-1) >= 8) + && (func_802D67AC(-1) < 0x12) + && (func_802D67DC(-1) == this->modelCacheIndex) + ; + + func_802D3D74(this); + if (!this->initialized) { + if (!sp34) { + switch(this->modelCacheIndex){ + case 0x2E5://L80388630 + if (!func_8031FF1C(0xE2) && func_8038EAE0(0xA)) { + func_80320004(0xE2, TRUE); + } + break; + + case 0x20e: //L80388660 + if (!func_8031FF1C(0x31) && func_8038EAE0(1)) { + func_80320004(0x31, TRUE); + } + break; + + case 0x226: //L80388690 + if (!func_8031FF1C(0x36) && func_8038EAE0(6)) { + func_80320004(0x36, TRUE); + } + break; + + case 0x212: //L803886C0 + if (!func_8031FF1C(0x33) && func_8038EAE0(3)) { + func_80320004(0x33, TRUE); + } + break; + + case 0x211: //L803886F0 + if (!func_8031FF1C(0x32) && func_8038EAE0(2)) { + func_80320004(0x32, TRUE); + } + break; + + case 0x210: //L80388720 + if (!func_8031FF1C(0x34) && func_8038EAE0(4)) { + func_80320004(0x34, TRUE); + } + break; + + case 0x20f: //L80388750 + if (!func_8031FF1C(0x38) && func_8038EAE0(8)) { + func_80320004(0x38, TRUE); + } + break; + + case 0x228: //L80388780 + if (!func_8031FF1C(0x37) && func_8038EAE0(7)) { + func_80320004(0x37, TRUE); + } + break; + + case 0x234: //L803887B0 + if (!func_8031FF1C(0x39) && func_8038EAE0(9)) { + func_80320004(0x39, TRUE); + } + break; + + case 0x235: //L803887E0 + if (!func_8031FF1C(0x35) && func_8038EAE0(5)) { + func_80320004(0x35, TRUE); + } + break; + }//L80388808 + } + this->initialized = TRUE; + } + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + switch(this->modelCacheIndex){ + case 0x2E5: //L80388880 + if (func_8031FF1C(0xE2) && (this->state == 0x19)) { + func_80328B8C(this, 0x1B, 0.999f, 1); + } + break; + + case 0x20e://L803888C0 + if(func_8031FF1C(0x31)){ + this->yaw = 270.0f; + } + break; + + case 0x226://L803888DC + if(func_8031FF1C(0x36)){ + marker_despawn(this->marker); + return; + } + this->unk1C[1] = this->position[1] + 300.0f; + break; + + case 0x212://L80388914 + if(func_8031FF1C(0x33)){ + marker_despawn(this->marker); + return; + } + this->unk1C[1] = this->position[1] + 365.0f; + break; + + case 0x211://L80388948 + if(func_8031FF1C(0x32)){ + this->pitch = 90.0f; + } + break; + + case 0x210://L8038896C + if(func_8031FF1C(0x34)){ + this->yaw = 90.0f; + } + break; + + case 0x20f://L80388990 + if(func_8031FF1C(0x38)){ + marker_despawn(this->marker); + return; + } + this->unk1C[1] = this->position[1] + 290.0f; + break; + + case 0x228://L803889C8 + if(func_8031FF1C(0x37)){ + this->yaw = 90.0f; + } + break; + + case 0x234://L803889EC + if(func_8031FF1C(0x39)){ + marker_despawn(this->marker); + return; + } + this->unk1C[1] = this->position[1] + 270.0f; + break; + + case 0x235://L80388A24 + sp30 = func_80326EEC(0x236); + if(func_8031FF1C(0x35)){ + marker_despawn(this->marker); + marker_despawn(sp30->marker); + return; + } + this->unk1C[0] = 0.0f; + func_80388450(this, sp30); + break; + + }//L80388A70 + } + + if (sp34) { + if (func_802D680C(-1) != 0) { + func_802D680C(func_802D680C(-1) - 1); + return; + } + + switch(this->modelCacheIndex){ + case 0x2E5: + switch (this->state) { + case 0x19: //L80388B34 + func_80328B8C(this, 0x1A, 0.0f, 1); + func_8025A6EC(JINGLE_END_OF_INTRO, -1); + break; + + case 26: //L80388B54 + if (actor_animationIsAt(this, 0.4f)) { + FUNC_8030E624(SFX_6B_LOCKUP_OPENING, 0.6f, 32675); + } + if (actor_animationIsAt(this, 0.42f)) { + func_8030E6D4(SFX_1B_EXPLOSION_1); + } + if (actor_animationIsAt(this, 0.97f)) { + func_80328B8C(this, 0x1B, 0.999f, 1); + func_80320004(0xE2, 1); + func_8030E6D4(SFX_6C_LOCKUP_CLOSING); + } + if (animctrl_getAnimTimer(this->animctrl) < 0.68) { + sp2C = partEmitList_pushNew(3U); + particleEmitter_setSprite(sp2C, ASSET_70D_SPRITE_SMOKE_1); + particleEmitter_setStartingFrameRange(sp2C, 1, 6); + func_802EFFA8(sp2C, D_803934A0); + func_802EF9E4(sp2C, 0x3C); + particleEmitter_setPosition(sp2C, this->position); + particleEmitter_setPositionAndVelocityRanges(sp2C, &D_803934D4); + func_802EFB98(sp2C, &D_803934AC); + particleEmitter_emitN(sp2C, 3); + } + break; + case 27://L80388FB8 + break; + } + break; + + case 0x20e://L80388C7C + this->yaw += 1.4; + if (this->yaw > 270.0f) { + this->yaw = 270.0f; + func_80388404(0x31, SFX_6C_LOCKUP_CLOSING, 1.0f, 15000); + } + break; + + case 0x226://L80388CDC + this->position[1] += 5.0f; + if (this->unk1C[1] < this->position[1]) { + func_80388404(0x36, SFX_6C_LOCKUP_CLOSING, 1.0f, 15000); + func_80388278(this); + marker_despawn(this->marker); + } + break; + + case 0x212://L80388D34 + this->position[1] += 5.0f; + if (this->unk1C[1] < this->position[1]) { + func_80388404(0x33, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 17000); + func_80388278(this); + marker_despawn(this->marker); + } + break; + + case 0x211://L80388D8C + this->pitch += 1.4; + if (this->pitch > 90.0f) { + this->pitch = 90.0f; + func_80388404(0x32, SFX_6C_LOCKUP_CLOSING, 1.0f, 15000); + } + break; + + case 0x210://L80388DDC + this->yaw += 1.4; + if (this->yaw > 90.0f) { + this->yaw = 90.0f; + func_80388404(0x34, SFX_6C_LOCKUP_CLOSING, 1.0f, 15000); + } + break; + + case 0x20f://L80388E2C + this->position[1] += 5.0f; + if (this->unk1C[1] < this->position[1]) { + func_80388404(0x38, SFX_7F_HEAVYDOOR_SLAM, 1.0f, 17000); + func_80388278(this); + marker_despawn(this->marker); + } + break; + + case 0x228://L80388E84 + this->yaw += 1.4; + if (this->yaw > 90.0f) { + this->yaw = 90.0f; + func_80388404(0x37, SFX_6C_LOCKUP_CLOSING, 1.0f, 20000); + } + break; + + case 0x234://L80388ED4 + this->position[1] += 3.2; + if (this->unk1C[1] <= this->position[1]) { + func_80388404(0x39, SFX_6C_LOCKUP_CLOSING, 1.0f, 20000); + func_80388278(this); + marker_despawn(this->marker); + } + break; + + case 0x235://L80388F34 + { + sp28 = func_80326EEC(0x236); + this->unk1C[0] += 3.6; + if (this->unk1C[0] > 250.0f) { + func_80388278(this); + marker_despawn(this->marker); + marker_despawn(sp28->marker); + func_80320004(0x35, TRUE); + return; + } + func_80388450(this, sp28); + } + break; + default: + break; + } + } +} + +void func_80388FC8(Actor *this) +{ + func_802D3D74(this); + + if (!this->initialized) + { + this->initialized = TRUE; + + this->unk1C[1] = this->position_y; + this->position_y -= 500.f; + + this->unk60 = 0; + + if (func_803203FC(0x7D)) + { + this->position_y = this->unk1C[1]; + this->unk60 = 1.f; + } + } + + if (this->unk60) + return; + + if (!this->unk16C_4) + { + if (func_8031FF1C(this->modelCacheIndex == 0x215 ? BKPROG_1F_CC_LOBBY_PIPE_1_RAISED : BKPROG_20_CC_LOBBY_PIPE_2_RAISED)) + { + this->position_y = this->unk1C[1]; + return; + } + + if (mapSpecificFlags_get(1)) + { + if (this->modelCacheIndex == 0x215) + { + func_802BAFE4(0x2B); + if (1); // oof + } + + func_80320004(this->modelCacheIndex == 0x215 ? BKPROG_1F_CC_LOBBY_PIPE_1_RAISED : BKPROG_20_CC_LOBBY_PIPE_2_RAISED, TRUE); + + this->unk16C_4 = 1; + this->unk38_31 = 12; + } + } + else + { + if (this->unk38_31) + { + this->unk38_31--; + + if (this->unk38_31) + return; + + if (this->modelCacheIndex == 0x215) + { + FUNC_8030E624(SFX_25_METAL_SLIDING_OVER_SMTH, 0.6f, 28000); + func_802D4830(this, 0x3EC, 0.1f); + } + } + + this->position_y += 6.f; + + if (this->position_y >= this->unk1C[1]) + { + this->position_y = this->unk1C[1]; + + if (this->modelCacheIndex == 0x215) + { + func_802D48B8(this); + func_8030E540(SFX_7F_HEAVYDOOR_SLAM); + } + + this->unk60 = 1.f; + } + } +} + +void func_80389204(Actor *this) +{ + func_802D3D74(this); + + if (!this->initialized) + { + this->initialized = TRUE; + + this->unk1C[1] = this->position_y; + this->position_y -= 280.f; + this->unk60 = 0; + + if (func_803203FC(0x7E)) + { + this->position_y = this->unk1C[1]; + this->unk60 = 1.f; + } + } + + if (this->unk60) + return; + + if (!this->unk16C_4) + { + if (func_8031FF1C(BKPROG_21_CC_LOBBY_PIPE_3_RAISED)) + { + this->position_y = this->unk1C[1]; + return; + } + + if (mapSpecificFlags_get(2)) + { + func_802BAFE4(0x2C); + func_80320004(BKPROG_21_CC_LOBBY_PIPE_3_RAISED, TRUE); + + this->unk16C_4 = 1; + this->unk38_31 = 12; + } + } + else + { + if (this->unk38_31) + { + this->unk38_31--; + + if (this->unk38_31) + return; + FUNC_8030E624(SFX_25_METAL_SLIDING_OVER_SMTH, 0.7f, 28000); + func_802D4830(this, 0x3EC, 0.2f); + } + + this->position_y += 3.f; + + if (this->position_y >= this->unk1C[1]) + { + this->position_y = this->unk1C[1]; + + func_802D48B8(this); + func_8030E540(SFX_7F_HEAVYDOOR_SLAM); + + this->unk60 = 1.f; + } + } +} + +void func_803893B8(Actor *this) +{ + func_802D3D74(this); + + if (!this->unk16C_4) + { + this->unk16C_4 = TRUE; + + if (jiggyscore_isCollected(JIGGY_37_LAIR_BGS_WITCH_SWITCH)) + { + marker_despawn(this->marker); + return; + } + + this->unk1C[1] = this->position_y; + } + + if (jiggyscore_isCollected(JIGGY_37_LAIR_BGS_WITCH_SWITCH)) + { + f32 *posY = &this->position_y; + + if (this->unk1C[1] == *posY) + func_802D4830(this, 0x9A, 0.5f); + + this->position_y += 3.f; + + if (this->position_y > this->unk1C[1] + 200.f) + { + func_802D48B8(this); + FUNC_8030E624(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 29000); + marker_despawn(this->marker); + } + } +} + +void func_803894B0(Actor *this) +{ + void func_802EE2E8(Actor *, s32, s32, s32, f32, f32, f32); + func_802D3D74(this); + + if (!this->unk16C_4) + { + this->unk16C_4 = TRUE; + this->unk1C[0] = 0; + + if (func_8031FF1C(BKPROG_A1_STATUE_HAT_OPEN)) + { + marker_despawn(this->marker); + return; + } + + this->unk1C[0] = func_803203FC(0xBD) ? 22 : 0; + } + + if (!this->unk1C[0]) + return; + + if (--this->unk1C[0] == 0) + { + func_80320004(0xA1, TRUE); + timed_playSfx(0.5f, SFX_3F9_UNKNOWN, 1.f, 32000); + FUNC_8030E624(SFX_114_BRICKWALL_BREAKING, 0.8f, 32000); + func_802EE2E8(this, 0xB, 0x19, 0x000, 0.6f, 1.8f, 3.f); + func_802EE2E8(this, 0xB, 0x17, 0x0B4, 0.5f, 1.55f, 3.f); + func_802EE2E8(this, 0xB, 0x15, 0x168, 0.4f, 1.3f, 3.f); + func_802EE2E8(this, 0xB, 0x13, 0x21C, 0.3f, 1.05f, 3.f); + func_802EE2E8(this, 0xB, 0x11, 0x2D0, 0.2f, 0.8f, 3.f); + marker_despawn(this->marker); + } +} + +void func_803896D4(Actor *this) +{ + func_802D4A9C(this, 0); +} + +void func_803896F4(Actor *this) +{ + func_802D4A9C(this, 1); +} + +void func_80389714(Actor *this) +{ + func_802D4A9C(this, 2); +} + +void func_80389734(Actor *this) +{ + func_802D4AC0(this, 0x800022, 0x23); +} + +void func_8038975C(Actor *this) +{ + func_802D4AC0(this, 0x800024, 0x25); +} + +void func_80389784(Actor *this) +{ + func_802D4AC0(this, 0x800026, 0x27); +} + +void func_803897AC(Actor *this) +{ + func_802D4AC0(this, 0x800053, 0x54); +} + +void func_803897D4(s32 arg0) +{ + ActorMarker *marker1, *marker2; + Actor *actor1, *actor2; + + marker1 = reinterpret_cast(ActorMarker *, arg0); + actor1 = marker_getActor(marker1); + + actor1 = func_8032813C(0x258, actor1->position, actor1->yaw); + + // Grab the same pointer again for good measure + actor2 = marker_getActor(marker1); + + actor1->scale = actor2->scale; +} + +void func_8038982C(Actor *this) +{ + if (!this->initialized) + { + func_802D3CE8(this); + actor_collisionOff(this); + + this->initialized = TRUE; + + if (!func_8031FF1C(BKPROG_9E_CRYPT_COFFIN_LID_OPEN)) + func_802C3C88((GenMethod_1)func_803897D4, reinterpret_cast(s32, this->marker)); + } +} + +void func_80389898(Actor *this) +{ + func_802D3CE8(this); + + switch (this->state) + { + case 18: + { + if (this->unk10_12) + { + func_80328AC8(this, 0x13); + func_803298AC(this); + func_80320004(BKPROG_9E_CRYPT_COFFIN_LID_OPEN, TRUE); + } + + break; + } + case 19: + { + if (func_8032886C(this, 0.7f)) + marker_despawn(this->marker); + + break; + } + default: + break; + } +} + +void func_80389934(Actor *this) +{ + if (!this->unk16C_4) + { + func_802D3CE8(this); + actor_collisionOff(this); + + this->unk16C_4 = TRUE; + + if (func_8031FF1C(BKPROG_A2_GV_LOBBY_COFFIN_OPEN)) + func_80328B8C(this, 0x18, 0.999f, 1); + } + + switch (this->state) + { + case 21: + { + if (func_803203FC(0xBE)) + { + this->unk1C[0] = 25; + + func_80328AC8(this, 0x16); + func_80320004(BKPROG_A2_GV_LOBBY_COFFIN_OPEN, TRUE); + } + + break; + } + case 22: + { + if (--this->unk1C[0] == 0) + { + func_80328AC8(this, 0x17); + func_803298AC(this); + FUNC_8030E624(SFX_3F6_UNKNOWN, 0.6f, 32000); + func_8025A6EC(COMUSIC_3D_JIGGY_SPAWN, 0x7FFF); + } + + break; + } + case 23: + { + if (func_8032886C(this, 0.95f)) + { + func_80328B8C(this, 0x18, 0.999f, 1); + FUNC_8030E624(SFX_7F_HEAVYDOOR_SLAM, 1.0f, 26000,); + } + + break; + } + case 24: // unused + default: + break; + } +} + +f32 func_80389AAC(Actor *this, f32 a1) +{ + // defs + f32 func_8034A754(f32, f32); + void *func_80309B48(f32 *, f32 *, f32 *, u32); + + f32 vec3[3]; // $sp + 54 + f32 vec2[3]; // $sp + 48 + f32 vec1[3]; // $sp + 3C + + if (!this->unk38_31) + { + this->unk38_31 = 1; + this->unk1C[1] = 71; + } + + this->position_x -= 26; + + vec1[0] = vec3[0] = this->position_x; + vec3[1] = this->position_y; + vec1[2] = vec3[2] = this->position_z; + + this->position_y += this->unk1C[1]; + + this->unk1C[1] -= 7.0; // f64 + + vec1[1] = this->position_y - 400; + + if (this->unk1C[1] < 0 && func_80309B48(vec3, vec1, vec2, 0) && this->position_y <= vec1[1]) + { + this->position_y = vec1[1] + 6; + + switch (this->unk38_31) + { + case 1: + { + this->unk38_31 = 2; + this->unk1C[1] = 38; + + break; + } + case 2: + { + this->unk38_31 = 3; + this->unk1C[1] = 11; + + break; + } + case 3: + { + func_80328A84(this, 5); + + break; + } + default: + break; + } + + func_8030E878(SFX_82_METAL_BREAK, func_8034A754(0.93f, 1.07f), 32760, this->position, 100, 1350.0f); + + this->unk60 = 1; + } + + a1 -= 4.5; // f64 + + while (a1 < 0) + a1 += 360; + + return a1 <= 230 ? 230 : a1; +} + +void func_80389D08(Actor *this) +{ + if (!this->unk16C_4) + { + func_802D3CE8(this); + + this->unk16C_4 = TRUE; + this->unk60 = 0; + + if (func_8031FF1C(0xA5)) + { + marker_despawn(this->marker); + return; + } + } + + switch (this->state) + { + case 1: + { + if (this->unk60) + { + func_80328AC8(this, 4); + + this->unk38_31 = 0; + this->unk60 = 0; + } + + break; + } + case 4: + { + this->pitch = func_80389AAC(this, this->pitch); + this->roll--; + + break; + } + case 5: + { + func_80326310(this); + + break; + } + default: + break; + } +} + +Actor *func_80389E10(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *this; + f32 sp90[3]; + f32 sp84[3]; + f32 sp78[3]; + f32 sp6C[3]; + static u8 D_80395350[0x10]; //padding + static s32 D_80395360; + + + this = func_80325E78(marker, gfx, mtx, vtx); + if (marker->unk14_21 && (this->unk60 != 0.0f)) { + func_8034A174((struct5Bs *) marker->unk44, 5, sp84); + func_8034A174((struct5Bs *) marker->unk44, 6, sp78); + + for(D_80395360 = 0; D_80395360 < 8; D_80395360++){ + sp6C[0] =sp6C[2] = 0.0f; + sp6C[1] = randf2(5.0f, 20.0f); + + sp90[0] = sp84[0] + ((sp78[0] - sp84[0]) * randf()); + sp90[1] = sp84[1]; + sp90[2] = sp84[2] + ((sp78[2] - sp84[2]) * randf()); + + + func_802EE6CC(sp90, sp6C, D_80393504, 1, 0.3f, 50.0f, 180, randi2(130, 200), 0); + }; + } + return this; +} + +void func_80389FA8(Actor *this, enum bkprog_e flag) +{ + if (!this->initialized) + { + func_802D3D54(this); + + if (func_8031FF1C(flag)) + marker_despawn(this->marker); + } +} + +void func_80389FF4(Actor *this) +{ + func_80389FA8(this, BKPROG_C2_GRATE_TO_RBB_PUZZLE_OPEN); +} + +void func_8038A014(Actor *this) +{ + func_80389FA8(this, BKPROG_C3_ICE_BALL_TO_CHEATO_BROKEN); +} + +void func_8038A034(Actor *this) +{ + this->unk124_9 = 2; + + func_80389FA8(this, BKPROG_C4_STATUE_EYE_BROKEN); +} + +void func_8038A064(Actor *this) +{ + func_80389FA8(this, BKPROG_C5_RAREWARE_BOX_BROKEN); +} + +void func_8038A084(Actor *this) +{ + func_80389FA8(this, BKPROG_CD_GRATE_TO_WATER_SWITCH_3_OPEN); +} + +void func_8038A0A4(Actor *this) +{ + func_80389FA8(this, BKPROG_CE_GRATE_TO_MMM_PUZZLE_OPEN); +} + +void func_8038A0C4(void) +{ + spawnableActorList_add(&D_80392F40, actor_new, 0x18628); + spawnableActorList_add(&D_80392F64, actor_new, 0x18608); + spawnableActorList_add(&D_803932E8, actor_new, 0x8600); + spawnableActorList_add(&D_80393408, actor_new, 0x96C0); + spawnableActorList_add(&D_80392F88, actor_new, 0x8600); + spawnableActorList_add(&D_80392FAC, actor_new, 0x8600); + spawnableActorList_add(&D_80392FD0, actor_new, 0x8600); + spawnableActorList_add(&D_80393018, actor_new, 0x8600); + spawnableActorList_add(&D_8039303C, actor_new, 0x8600); + spawnableActorList_add(&D_80393060, actor_new, 0x8604); + spawnableActorList_add(&D_803931EC, actor_new, 0x8600); + spawnableActorList_add(&D_80393210, actor_new, 0x8600); + spawnableActorList_add(&D_80392EF8, actor_new, 0x8600); + spawnableActorList_add(&D_8039339C, actor_new, 0x8600); + spawnableActorList_add(&D_803933C0, actor_new, 0x8600); + spawnableActorList_add(&D_80392DB4, actor_new, 0x8608); + spawnableActorList_add(&D_80392DD8, actor_new, 0x8608); + spawnableActorList_add(&D_80392DFC, actor_new, 0x8608); + spawnableActorList_add(&D_80392E20, actor_new, 0x8608); + spawnableActorList_add(&D_80392E44, actor_new, 0x8608); + spawnableActorList_add(&D_80392E68, actor_new, 0x8608); + spawnableActorList_add(&D_80392E8C, actor_new, 0x8608); + spawnableActorList_add(&D_803930F0, actor_new, 0x8600); + spawnableActorList_add(&D_80393234, actor_new, 0x8600); + spawnableActorList_add(&D_80393258, actor_new, 0x8600); + spawnableActorList_add(&D_80392FF4, actor_new, 0x8600); + spawnableActorList_add(&D_8039327C, actor_new, 0x8600); + spawnableActorList_add(&D_803932A0, actor_new, 0x8600); + spawnableActorList_add(&D_803932C4, actor_new, 0x8600); + spawnableActorList_add(&D_8039315C, actor_new, 0x8600); + spawnableActorList_add(&D_80393180, actor_new, 0x8600); + spawnableActorList_add(&D_803931A4, actor_new, 0x8600); + spawnableActorList_add(&D_8039330C, actor_new, 0x8600); + spawnableActorList_add(&D_80393330, actor_new, 0x8600); + spawnableActorList_add(&D_80393114, actor_new, 0); + spawnableActorList_add(&D_80393138, actor_new, 0x8600); + spawnableActorList_add(&D_803930CC, actor_new, 0x8600); + spawnableActorList_add(&D_803931C8, actor_new, 0x28600); + spawnableActorList_add(&D_80393560, actor_new, 0x97AA); + spawnableActorList_add(&D_80393584, actor_new, 0x87AA); + spawnableActorList_add(&D_803933E4, actor_new, 0x8608); + spawnableActorList_add(&D_80393378, actor_new, 0x8640); + spawnableActorList_add(&D_803947B0, actor_new, 0xA1480); + spawnableActorList_add(&D_803947D4, actor_new, 0xA1480); + spawnableActorList_add(&D_80393730, actor_new, 0x140); + spawnableActorList_add(&D_80394A80, actor_new, 0); + spawnableActorList_add(&D_80394AB0, actor_new, 0x44); + spawnableActorList_add(&D_80392EB0, actor_new, 0x8608); + spawnableActorList_add(&D_80393084, actor_new, 0x8680); + spawnableActorList_add(&D_80392ED4, actor_new, 0x8608); + spawnableActorList_add(&D_803930A8, actor_new, 0xC680); + spawnableActorList_add(&D_80394870, actor_new, 0x1A0); + spawnableActorList_add(&D_80394894, actor_new, 0x1A0); + spawnableActorList_add(&D_803948B8, actor_new, 0x1A0); + spawnableActorList_add(&D_80394910, actor_new, 0x10C0); + spawnableActorList_add(&D_80394934, actor_new, 200); + spawnableActorList_add(&D_80394958, actor_new, 200); + spawnableActorList_add(&D_80392F1C, actor_new, 0x8608); + spawnableActorList_add(&D_80394A08, actor_new, 0x2010129); + spawnableActorList_add(&D_80394A2C, actor_new, 0x2010129); + spawnableActorList_add(&D_80394A50, actor_new, 0x2010129); + spawnableActorList_add(&D_80394980, actor_new, 0x80); + spawnableActorList_add(&D_80394C28, actor_new, 0x400); + spawnableActorList_add(&D_80394C4C, actor_new, 0x400); + spawnableActorList_add(&D_80394C70, actor_new, 0x400); + spawnableActorList_add(&D_80394D20, actor_new, 0); + spawnableActorList_add(&D_80394CF0, actor_new, 0x80508); + spawnableActorList_add(&D_80394C94, actor_new, 0x500); + spawnableActorList_add(&D_80393354, actor_new, 0x8602); + spawnableActorList_add(&D_80392D90, actor_new, 0x20000); +} diff --git a/src/lair/code_42A0.c b/src/lair/code_42A0.c new file mode 100644 index 00000000..eeb8cdac --- /dev/null +++ b/src/lair/code_42A0.c @@ -0,0 +1,424 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8028F4B8(f32[3], f32, f32); +extern void func_8028F66C(s32); +extern void func_802D6310(f32, enum map_e, s32, s32, enum bkprog_e); +extern void func_802EE354(Actor *, s32, s32, s32, f32, f32, f32, s32[4], s32, s32); +extern void func_80324CFC(f32, enum comusic_e, s32); +extern void func_8034DF30(s32, f32[4], f32[4], f32); + +/* .h */ +typedef struct { + u8 unk0; + u8 unk1; + u8 unk2; + u8 unk3; + u8 pad4[0x2]; + s16 unk6; +}Struct_lair_42A0_0; + +void func_8038AE2C(Actor *this); +Actor *func_8038B898(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +extern ActorAnimationInfo D_80393520[]; +extern ActorInfo D_80393560 = { 0x231, 0x23B, 0x4DF, 0x1, D_80393520, func_8038AE2C, func_80326224, func_8038B898, 0, 0, 3.0f, 0}; +extern ActorInfo D_80393584 = { 0x244, 0x2DB, 0x450, 0x1, D_80393520, func_8038AE2C, func_80326224, func_8038B898, 0, 0, 3.0f, 0}; +extern f32 D_803935A8[][2][3]; +extern Struct_lair_42A0_0 D_80393620[]; +extern f32 D_80393670[]; +extern f32 D_80393688[]; +extern f32 D_803936A8[]; +extern f32 D_803936E4[]; + +/* .code */ +bool func_8038A690(Actor *this) { + if (this->unkF4_8 != 3) { + return func_803296B8(this, 0x190, 0x5A); + } + else{ + return func_80329628(this, 0x1F4, 0x104, 0x5A); + } +} + +enum bkprog_e func_8038A6DC(Actor *this){ + return this->unkF4_8 + 0x48; +} + +enum bkprog_e func_8038A6EC(Actor *this){ + return ((this->unkF4_8 - 1) ^ 1) + 0x49; +} + +void func_8038A704(Actor *this){ + func_80328B8C(this, 3, 0.99f, 1); +} + +void func_8038A730(Actor *this, f32 *arg1, enum sfx_e arg2, enum sfx_e arg3, u32 arg4) { + s32 i; + + for(i = 0; arg1[i] != -1.0f; i++){ + if (actor_animationIsAt(this, arg1[i])) { + if (arg3 != SFX_0_BLOOP) { + func_8030E878((randf() < 0.5) ? arg2 : arg3, randf2(1.0f, 1.1f), arg4, this->position, 0.0f, 1200.0f); + } + else{ + func_8030E878(arg2, 1.0f, arg4, this->position, 0.0f, 1200.0f); + } + return; + } + } +} + +void func_8038A864(Actor *this) { + switch (this->state) { + case 2: + func_8038A730(this, D_80393670, SFX_3F_CAULDRON_SQEAK_1, SFX_40_CAULDRON_SQEAK_2, 11000); + break; + case 3: + func_8038A730(this, D_80393688, SFX_3F_CAULDRON_SQEAK_1, SFX_40_CAULDRON_SQEAK_2, 11000); + break; + case 5: + if (actor_animationIsAt(this, 0.5f)) { + FUNC_8030E624(SFX_C5_TWINKLY_POP, 0.8f, 32000); + + } + if (actor_animationIsAt(this, 0.596f)) { + FUNC_8030E624(SFX_2D_KABOING, 0.85f, 32000); + } + break; + case 4: + func_8038A730(this, D_803936A8, SFX_3F_CAULDRON_SQEAK_1, SFX_40_CAULDRON_SQEAK_2, 11000); + break; + } +} + +void func_8038A96C(Actor *this, s32 arg1) { + s32 sp5C; + s32 i; + f32 sp48[4]; + f32 sp38[4]; + + if( ( (arg1 != 3) || ( (this->unk1C[1] == 0.0f) && (this->marker->unk14_21 == 1))) + && (this->modelCacheIndex == 0x23B) + && ((arg1 != 0) || func_8031FF1C(func_8038A6DC(this))) + ){ + sp5C = func_8034C2C4(this->marker, 0x1C3); + if(sp5C != 0){ + for(i = 0; i < 3; i++){ + sp48[i] = D_803935A8[(((s32)this->unkF4_8 - 1)>>1)][0][i]; + sp38[i] = D_803935A8[(((s32)this->unkF4_8 - 1)>>1)][1][i]; + + } + sp48[3] = 1.0f; + sp38[3] = 1.0f; + if (arg1 == 2) { + func_8034DF30(sp5C, sp38, sp38, 0.3f); + } + else{ + func_8034DF30(sp5C, sp48, sp38, func_8031FF1C(func_8038A6DC(this)) ? 0.3 : 3.0); + } + } + } +} + +void func_8038AB90(Actor *this, s32 arg1, s32 arg2, enum sfx_e sfx_id, f32 sfx_timing) { + if (arg2 == this->unk10_12) { + if (this->unkF4_8 == 7) { + func_80324CFC(0.5f, COMUSIC_8C_JINJONATOR_POWERUP, 32000); + func_80324D2C(7.0f, COMUSIC_8C_JINJONATOR_POWERUP); + } + this->unk10_12 = 0; + func_80328AC8(this, arg1); + actor_playAnimationOnce(this); + func_8028FCBC(); + if (sfx_id != SFX_0_BLOOP) { + timed_playSfx(sfx_timing, sfx_id, 1.0f, 32000); + if (arg2 == 2) { + func_8025A6CC(COMUSIC_3F_MAGIC_CARPET_RISING, 32000); + func_80324D2C(2.6f, COMUSIC_3F_MAGIC_CARPET_RISING); + func_8030E540(SFX_7C_CHEBOOF); + } + } + } +} +void func_8038AC7C(Actor *this) { + s32 sp2C; + u32 sp28; + + if( + (func_803114C4() != 0xFAD) + && func_80329530(this, 1200) + && !func_8031FF1C(0xFC) + ) { + this->unk60 += time_getDelta(); + if (35.0 < this->unk60) { + sp2C = (func_8031FF1C(0xCF)) ? 0xFB7 : 0xFAE; + sp28 = (func_8031FF1C(0xCF)) ? 0xFBC : 0xFB7; + if (func_80311480(sp2C + this->unk38_31, 0, NULL, NULL, NULL, NULL)) { + this->unk38_31++; + this->unk60 = 0.0f; + if (sp2C + this->unk38_31 >= sp28) { + this->unk38_31 = 0; + } + } + } + } +} + + +void func_8038ADC0(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + func_80320004(0xF3, TRUE); +} + +bool func_8038ADF0(s32 arg0, s32 arg1) { + s32 phi_v1; + + phi_v1 = arg1 - arg0; + while (phi_v1 < 0) { phi_v1 += 360; } + while (phi_v1 >= 360) { phi_v1 -= 360;} + return phi_v1 < 70; +} + +void func_8038AE2C(Actor *this) { + f32 sp54[3]; + s32 sp50; + s32 sp4C; + s32 phi_v0; + enum sfx_e phi_a0; + f32 temp_f0; + s32 sp3C; + s32 sp38; + f32 sp34; + + func_8038A864(this); + if (!this->unk16C_4) { + sp50 = FALSE; + this->unk16C_4 = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + this->unk1C[1] = 0.0f; + this->velocity[0] = this->yaw; + if (this->modelCacheIndex == 0x2DB) { + if (func_8031FF1C(0xF3)) { + sp4C = (func_8031FF1C(0xCF)) ? 0xFB7 : 0xFAE; + phi_v0 = (func_8031FF1C(0xCF)) ? 0xFBC : 0xFB7; + this->unk60 = 35.0f; + this->unk38_31 = randi2(0, phi_v0 - sp4C); + } + this->scale = 1.8f; + func_80328B8C(this, 6, 0.99f, 1); + func_802D09B8(this, 2); + } + if (func_8031FF1C(func_8038A6DC(this))) { + func_8038A704(this); + func_802D09B8(this, 2); + func_8038A96C(this, 2); + sp50 = TRUE; + if( ( func_802D677C(-1) != 0 + && (func_802D677C(-1) == D_80393620[this->unkF4_8 - 1].unk0) + && (func_802D67AC(-1) == MAP_16_GV_RUBEES_CHAMBER) + && (func_802D680C(-1) == this->unkF4_8) + ) + || (func_803348CC() == D_80393620[this->unkF4_8 - 1].unk2) + ) { + func_8028F85C(this->position); + this->unk10_12 = 1; + func_8038AB90(this, 5, 1, 0, 0.0f); + } + if (!func_8031FF1C(0xF5) && func_8031FF1C(func_8038A6EC(this))) { + if (func_802D677C(-1) != map_get()) { + func_80311480(0xF7A, 4, NULL, NULL, NULL, NULL); + func_80320004(0xF5, 1); + } + } + } + if (sp50 == 0) { + this->unk10_12 = 0; + func_8038A96C(this, 0); + } + } + switch(this->state){ + case 1: //L8038B0F4 + if (func_8038A690(this)) { + func_8028F918(2); + func_80328AC8(this, 2); + this->unk38_0 = FALSE; + func_8038A96C(this, 1); + func_802BAFE4(D_80393620[this->unkF4_8 - 1].unk3); + func_802D09B8(this, 2); + phi_a0 = (func_8031FF1C(func_8038A6EC(this)) != 0) ? SFX_107_CAULDRON_ACTIVATION_1 : SFX_108_CAULDRON_ACTIVATION_2; + func_8030E510(phi_a0, 0x7D00); + if (!func_8031FF1C(0xF5) && !func_8031FF1C(func_8038A6EC(this))) { + func_80311480(0xF79, 4, NULL, NULL, NULL, NULL); + } + if (func_8031FF1C(func_8038A6EC(this))){ + switch(this->unkF4_8){ + case 2://L8038B204 + func_802D6310(2.0f, MAP_6A_GL_TTC_AND_CC_PUZZLE, 0x62, 0x22, 0); + break; + + case 1://L8038B228 + func_802D6310(2.0f, MAP_6F_GL_FP_LOBBY, 0x63, 0x23, 0); + break; + + case 4://L8038B24C + func_802D6310(2.0f, MAP_6F_GL_FP_LOBBY, 0x64, 0x24, 0); + break; + + case 3://L8038B270 + func_802D6310(2.0f, MAP_77_GL_RBB_LOBBY, 0x65, 0x25, 0); + break; + + case 6://L8038B294 + func_802D6310(2.0f, MAP_6C_GL_RED_CAULDRON_ROOM, 0x66, 0x26, 0); + break; + + case 5://L8038B2B8 + func_802D6310(2.0f, MAP_79_GL_CCW_LOBBY, 0x67, 0x27, 0); + break; + + case 10://L8038B2DC + func_802D6310(2.0f, MAP_8E_GL_FURNACE_FUN, 0x8C, 0x29, 0); + break; + + case 9://L8038B300 + func_802D6310(2.0f, MAP_93_GL_DINGPOT, 0x8D, 0x2A, 0); + break; + } + } + } + break; + + case 2: //L8038B324 + temp_f0 = animctrl_getAnimTimer(this->animctrl); + for(sp3C = 0; D_803936E4[sp3C] < temp_f0; sp3C++) + ; + + this->unk38_0 = (sp3C & 1) ? TRUE : FALSE; + if (actor_animationIsAt(this, 0.95f)) { + func_8038A704(this); + func_80320004(func_8038A6DC(this), 1); + func_8028F918(0); + this->unk1C[2] = 4.0f; + } + break; + + case 3: //L8038B3DC + this->unk38_0 = TRUE; + if (this->unk1C[2] != 0.0f) { + this->unk1C[2] = this->unk1C[2] - 1.0f; + } else { + func_8038AB90(this, 5, 1, 0, 0.0f); + func_8038AB90(this, 4, 2, 0xA6, 2.6f); + } + func_8038A96C(this, 3); + break; + + case 7: //L8038B460 + this->unk38_0 = TRUE; + if (actor_animationIsAt(this, 0.62f)) { + func_8030E6D4(SFX_1B_EXPLOSION_1); + } + case 5: //L8038B48C + func_8038A96C(this, 3); + if (actor_animationIsAt(this, 0.01f)) { + func_8030E540(SFX_7C_CHEBOOF); + } + if (actor_animationIsAt(this, 0.63f)) { + func_803204E4(0x1E, 0); + func_802D677C(0); + func_8028FCAC(); + nodeprop_getPosition(func_80304C38(D_80393620[this->unkF4_8 - 1].unk6, this), sp54); + if (this->unkF4_8 == 7) { + func_8028F66C(0x36); + func_802BAFE4(0x82); + } else { + func_8028F4B8(sp54, 1620.0f, -4100.0f); + } + } + if (actor_animationIsAt(this, 0.98f)) { + func_8038A704(this); + actor_loopAnimation(this); + } + break; + + case 4: //L8038B584 + func_8038A96C(this, 3); + if (actor_animationIsAt(this, 0.99f)) { + func_802D6344(); + func_802D677C(D_80393620[((this->unkF4_8 - 1) ^ 1)].unk0); + func_802D67AC(0x16); + func_802D680C(((this->unkF4_8 - 1) ^ 1) + 1); + func_802D683C(D_80393620[((this->unkF4_8 - 1) ^ 1)].unk1); + func_8031CC40(D_80393620[((this->unkF4_8 - 1) ^ 1)].unk0, D_80393620[((this->unkF4_8 - 1) ^ 1)].unk2); + } + break; + + case 6: //L8038B64C + if (func_8038A690(this) && !func_8031FF1C(0xF3)) { + func_80311480(0xFAD, 0xA, this->position, NULL, func_8038ADC0, NULL); + } + this->unk38_0 = TRUE; + + sp3C = 0; + if (func_8031FF1C(0xFC)){ + if(jiggyscore_total() == 0x64){ + sp3C = 1; + } + } + else{ + sp3C = 1; + } + if (sp3C != 0) { + func_8038AB90(this, 7, 1, 0, 0.0f); + } + func_8038AC7C(this); + sp38 = func_80329784(this); + if( func_8038ADF0(sp38, (s32) this->velocity[0]) + || func_8038ADF0((s32) this->velocity[0], sp38) + ) { + this->yaw_moving = (f32) sp38; + } + func_80328FB0(this, 3.0f); + if( actor_animationIsAt(this, 0.114f) + || actor_animationIsAt(this, 0.217f) + || actor_animationIsAt(this, 0.321f) + ) { + sp34 = randf2(0.85f, 0.95f); + func_8030E878(SFX_20_METAL_CLANK_1, sp34, 16000, this->position, 100.0f, 1750.0f); + } + if( actor_animationIsAt(this, 0.49f) + || actor_animationIsAt(this, 0.68f) + ) { + sp34 = randf2(0.65f, 0.75f); + func_8030E878(SFX_F9_GRUNTLING_NOISE_1, sp34, 16000, this->position, 100.0f, 1750.0f); + } + break; + + }//L8038B854 + + this->unk1C[1] = (f32)this->marker->unk14_21; +} + +Actor *func_8038B898(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx) { + Actor *this; + s32 sp3C[4]; + + this = marker_getActor(marker); + if(this->modelCacheIndex == 0x23B) { + func_8033A45C(3, this->unk38_0 ? TRUE : FALSE); + func_8033A45C(4, this->unk38_0 ? FALSE : TRUE); + } + this = func_80325888(marker, gfx, mtx, vtx); + if (marker->unk14_21 && this->unk38_0 && (getGameMode() != GAME_MODE_4_PAUSED)) { + sp3C[1] = randi2(200, 255); + sp3C[0] = randi2(150, sp3C[1]); + sp3C[2] = 0; + sp3C[3] = randi2(40, 80); + if (func_8023DB5C() & 1) { + func_802EE354(this, 0x3E9, 5, randi2(-10, 90), randf2(0.3f, 0.7f), 0.28f, 0.45f, sp3C, 5, 0); + } + } + return this; +} diff --git a/src/lair/code_5640.c b/src/lair/code_5640.c new file mode 100644 index 00000000..28fd6756 --- /dev/null +++ b/src/lair/code_5640.c @@ -0,0 +1,210 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 func_80258640(f32[3], f32[3]); + +typedef struct { + s32 unk0; +} ActorLocal_lair_5640; + +void func_8038BCF0(Actor *this); + +/* .data */ +ActorAnimationInfo D_80393710[] ={ + {0, 0.0f}, + {0x26B, 4.0f}, + {0x26C, 4.0f}, + {0x26B, 4.0f}, +}; +ActorInfo D_80393730 = { 0x1E0, 0x348, 0x539, 0x1, D_80393710, func_8038BCF0, func_80326224, func_80325888, 2000, 0, 2.0f, 0}; + +/* .code */ +void func_8038BA30(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *this; + s32 phi_v1; + + this = marker_getActor(marker); + phi_v1 = this->unk10_12*2; + func_80320424(0x20 + this->unkF4_8*6 + phi_v1, 2); +} + +void func_8038BA88(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *this; + + this = marker_getActor(marker); + item_set(ITEM_14_HEALTH, item_getCount(ITEM_15_HEALTH_TOTAL)); + func_80320004(this->unkF4_8 + 0xE8, TRUE); +} + +void func_8038BADC(ActorMarker *marker, enum asset_e text_id, s32 arg2) { + Actor *this; + + this = marker_getActor(marker); + if (text_id == ((ActorLocal_lair_5640 *)&this->local)->unk0 + 2) { + if (!func_8031FF1C(this->unkF4_8 + 0xE8)) { + if (item_getCount(ITEM_14_HEALTH) < item_getCount(ITEM_15_HEALTH_TOTAL)) { + func_80311480(0x10A2, 0xF, this->position, this->marker, func_8038BADC, func_8038BA88); + return; + } + } + func_80311480(0xD38, 0xC, this->position, this->marker, func_8038BADC, NULL); + return; + } + func_80328A84(this, 1); +} + +void func_8038BBC0(Actor *this) { + if (this->unk38_0) { + comusic_8025AB44(COMUSIC_7A_BRENTILDA, 0, 10000); + func_8025AABC(COMUSIC_7A_BRENTILDA); + func_8032BB88(this, -1, 10000); + this->unk38_0 = FALSE; + } +} + +void func_8038BC24(void) { + s32 temp_v0; + s32 phi_s0; + s32 phi_s1; + + if (func_8031FF1C(0x5C) && !func_803203FC(0x62)) { + func_8034A8BC(func_8031FF44(0xD3, 8)); + for(phi_s1 = 0; phi_s1 < func_8031A45C(3); phi_s1++){ + phi_s0 = 0x26 + 2*phi_s1; + temp_v0 = randi2(0, 3); + if (phi_s0 >= 0x61) { + func_80320524(0x26, temp_v0, 2); + } else { + func_80320524(phi_s0, temp_v0, 2); + } + } + func_803204E4(0x62, 1); + } +} + + +void func_8038BCF0(Actor *this) { + s32 sp78[6]; + s32 sp74; + ActorLocal_lair_5640 *local; + f32 sp64[3]; + f32 temp_f0; + f32 phi_f2; + f32 sp50[3]; + s16 sp48[3]; + + + local = (ActorLocal_lair_5640 *)&this->local; + if (!this->initialized) { + func_803300D8(this->marker, func_8038BBC0); + actor_collisionOff(this); + this->unk10_12 = 2; + if (!func_8031FF1C(0x5C)) { + func_80320044(0xD3, randi2(0, 0x100), 8); + func_80320004(0x5C, TRUE); + } + func_8038BC24(); + actor_setOpacity(this, 0x40); + this->initialized = TRUE; + } + + if (!this->unk16C_4) { + local->unk0 = this->unkF4_8*3 + 0x1080; + this->unk16C_4 = TRUE; + } + + func_8028E668(this->position, 280.0f, -40.0f, 160.0f); + this->yaw_moving = (f32) func_80329784(this); + func_80328FB0(this, 3.0f); + func_8024E55C(0, sp78); + player_getPosition(sp64); + temp_f0 = sp64[1] - this->position[1]; + if ((temp_f0 > -100.0f) && (temp_f0 < 350.0f)) { + phi_f2 = func_80258640(sp64, this->position); + } else { + phi_f2 = 2000.0f; + } + if ((phi_f2 < 500.0) && (this->unk38_31 & 1)) { + func_80329904(this->marker, 0x1F, sp50); + sp48[0] = (s16)sp50[0]; + sp48[1] = (s16)sp50[1]; + sp48[2] = (s16)sp50[2]; + func_802F3B9C(sp48); + } + + this->unk38_31++; + switch (this->state) { + case 1: + sp74 = func_8032627C(this); + if (phi_f2 < 500.0) { + if (sp74 < 0xFF) { + sp74 = (sp74 + 0xC < 0xFF) ? sp74 + 0xC : 0xFF; + if (!this->unk138_24) { + func_8025A70C(COMUSIC_81_ACTIVATING_BRENTILDA); + func_80324D2C(1.0f, COMUSIC_81_ACTIVATING_BRENTILDA); + this->unk138_24 = TRUE; + this->unk138_23 = FALSE; + } + } + } + + if (500.0 < phi_f2) { + if (sp74 >= 0x41) { + sp74 = (sp74 - 0xC >= 0x41) ? sp74 - 0xC : 0x40; + if (!this->unk138_23) { + func_8025A70C(COMUSIC_8B_DEACTIVATE_BRENTILDA); + func_80324D2C(1.0f, COMUSIC_8B_DEACTIVATE_BRENTILDA); + this->unk138_23 = TRUE; + this->unk138_24 = FALSE; + } + } + } + actor_setOpacity(this, sp74); + if (!func_803203FC(0x1F)) { + if ((phi_f2 < 600.0) && !this->unk38_0) { + comusic_8025AB44(COMUSIC_7A_BRENTILDA, -1, 0x1F4); + func_8032BB88(this, 0, 0x1F4); + this->unk38_0 = TRUE; + } + if ((600.0 < phi_f2) && this->unk38_0) { + comusic_8025AB44(COMUSIC_7A_BRENTILDA, 0, 0x1F4); + func_8025AABC(0x7A); + func_8032BB88(this, -1, 0x1F4); + this->unk38_0 = FALSE; + } + } + if( (phi_f2 < 300.0) + && (func_8028ECAC() == 0) + && func_8028F20C() + && !func_803114B0()) { + if (!func_8031FF1C(0x96)) { + func_80311480(0x10A1, 0xA, this->position, this->marker, func_8038BADC, NULL); + func_80320004(0x96, TRUE); + func_80328A84(this, 2); + return; + } + if (func_8028EFC8() && (sp78[BUTTON_Z] == 1)) { + this->unk10_12++; + this->unk10_12 %= 3; + func_80311174(local->unk0 + this->unk10_12, 0xB, this->position, this->marker, func_8038BADC, NULL, func_8038BA30); + func_80328A84(this, 2); + return; + } + } else { + return; + } + break; + case 2: + if (actor_animationIsAt(this, 0.999f)) { + func_80328A84(this, 3); + return; + } + break; + case 3: + if (actor_animationIsAt(this, 0.999f)) { + func_80328A84(this, 2); + } + break; + } +} diff --git a/src/lair/code_5ED0.c b/src/lair/code_5ED0.c new file mode 100644 index 00000000..4582246f --- /dev/null +++ b/src/lair/code_5ED0.c @@ -0,0 +1,1224 @@ +#include +#include "functions.h" +#include "variables.h" + +#include "core2/code_C9E70.h" + +#define ARRLEN(x) ((s32)(sizeof(x) / sizeof(x[0]))) + +// ? FF question flags +#define FF_QNF_START (401) +#define FF_QNF_END (496) +#define FF_QNF_CNT (96) + +struct FF_QuestionTypeInfo +{ + s16 startingFlagIdx; + s16 totalQuestionCount; +}; + +enum FF_TileType +{ + FFTT_0_NIL, + FFTT_1_BANJO, + FFTT_2_PICTURE, + FFTT_3_MUSIC, + FFTT_4_MINIGAME, + FFTT_5_GRUNTY, + FFTT_6_SKULL, + FFTT_7_JOKER +}; + +//this is states not actions +//actions occur when state is changed/set +enum FF_Action +{ + FFA_0_NIL, + FFA_1_UNK, + FFA_2_ON_BOARD_FORGET_MOVES, + FFA_3_TRIGGER_QUESTION, + // clearing sound?? + FFA_4_UNK, + FFA_5_FORGET_MOVES_2, + FFA_6_TRIGGER_QUESTION_POST_EFFECTS, + FFA_7_UNK, + FFA_8_FURNACE_FUN_COMPLETE +}; + + +/* .h */ +void func_8038D670(enum FF_Action next_state);// ff_set_state +void func_8038C6BC(void); + +/* extern */ +extern void func_802FACA4(enum item_e); +extern void func_8028FA14(enum map_e, s32); +extern void func_803208C0(u32, int); // ff_isAsked_flag_set +extern int func_803207F0(u32); // ff_isAsked_flag_get + +extern void func_8033F220(BKModel *model, s32 mesh_id, s16 [3]); //! $a2 type unk + +extern s32 func_803203FC(s32); // get volatile flag +extern void func_80295864(s32); // set unlocked moves bitfield +extern s32 func_802957F0(void); // get unlocked moves bitfield + +extern s32 func_80345FA0(s32); // item count get +extern void func_803463F4(s32, s32); // item count set + +extern void func_80318614(gczoombox_t *, s32); +extern bool func_803183A4(gczoombox_t *, u8 *); +extern void func_8031841C(gczoombox_t *); +extern void func_803183FC(gczoombox_t *); + +extern void func_8025AB44(s32, s32, s32); +extern void func_80250530(s32, u16, f32); + +extern void func_8025A55C(s32, s32, s32); + +extern void func_80324CFC(f32, s16, s16); +extern void func_803183EC(gczoombox_t *); +extern void func_8031840C(gczoombox_t *); + +extern void *func_80309744(s32); +extern void func_8029A95C(s32); // set transformation + +//typedef migrated to "inlcude/core2/code_C9E70.h" +extern struct FF_StorageStruct *D_8037DCB8; + +/* .data */ +extern Struct_lair_5ED0_0 D_80393760[FF_QNF_CNT - 1]; +extern struct FF_QuestionTypeInfo FF_QuestionTypeInfoArr[5]; //D_80394340 + +extern struct { + u8 unk0; + // u8 pad1[1]; + s16 unk2; + + s16 unk4; + u8 UNK_06; + u8 UNK_07; + + f32 unk8; +} D_80394354[]; // unk size + +// ? +extern struct { + s16 unk0; + s16 UNK_01; +} D_803945B8[]; + +extern struct { + s16 unk0; + s16 UNK_01; +} D_803945D0[]; + +/* .code */ +// FF: get total number of questions per type +s16 func_8038C2C0(enum ff_question_type_e type) +{ + return FF_QuestionTypeInfoArr[type].totalQuestionCount; +} + +// FF: clear isAsked flags for current question type +void func_8038C2D4(enum ff_question_type_e type) +{ + s32 i; + + for (i = 0; i < FF_QuestionTypeInfoArr[type].totalQuestionCount; i++) + func_803208C0(FF_QuestionTypeInfoArr[type].startingFlagIdx + i, FALSE); +} + +// FF: set isAsked flag for type and question +void func_8038C338(enum ff_question_type_e type, s32 questionIdx, int val) +{ + func_803208C0(FF_QuestionTypeInfoArr[type].startingFlagIdx + questionIdx, val); +} + +// FF: get isAsked flag for type and question +int func_8038C370(enum ff_question_type_e type, s32 questionIdx) +{ + return func_803207F0(FF_QuestionTypeInfoArr[type].startingFlagIdx + questionIdx); +} + +// i love stupid shit like this. these 3 lines of C compile into 150 lines of asm for type handling +void func_8038C3A0(u32 a0, BKVtxRef *a1, Vtx *a2, Struct_lair_5ED0_0 *a3) +{ + a2->v.cn[0] = a1->v.v.cn[0] * a3->unk10; + a2->v.cn[1] = a1->v.v.cn[1] * a3->unk10; + a2->v.cn[2] = a1->v.v.cn[2] * a3->unk10; +} + +void *func_8038C5B8(s32 a0) +{ + Struct_lair_5ED0_0 *ptr; + + s32 v0; + + if (!a0) + return NULL; + + v0 = FF_QNF_START; + ptr = D_80393760; + + while (v0 < a0) + { + v0++; + ptr++; + } + + return ptr; +} + +void func_8038C610(s32 a0) +{ + func_8034DEB4(func_8034C528(a0 + 200), -3000); +} + +void func_8038C640(s32 a0, Struct_lair_5ED0_0 *a1) +{ + s32 i; + + for (i = 0; i < ARRLEN(a1->unk0); i++) + if (a1->unk0[i]) + func_8038C610(a1->unk0[i]); + + a1->unk9 = 1; + + func_803208C0(a0 - FF_QNF_CNT, TRUE); +} + +void func_8038C6BC(void) +{ + s32 s1, s3; + + Struct_lair_5ED0_0 *ptr; + + s3 = 1; + + for (ptr = D_80393760, s1 = FF_QNF_START; s1 != FF_QNF_END; s1++, ptr++) + { + ptr->unk9 = func_803207F0(s1 - FF_QNF_CNT) ? 1 : 0; + + if (ptr->unk9 == s3) + { + ptr->unk10 = 0.95f; + func_8038C640(s1, ptr); + } + else + { + ptr->unk10 = 0.45f; + } + + func_8033F220(D_8037DCB8->unk0, s1, &ptr->unkA); + } +} + +void func_8038C7A0(u32 a0, BKVtxRef *a1, Vtx *a2, Struct_lair_5ED0_0 *a3) +{ + a2->v.cn[0] = a1->v.v.cn[0] * D_8037DCB8->unk14; + a2->v.cn[1] = a1->v.v.cn[1] * D_8037DCB8->unk14; + a2->v.cn[2] = a1->v.v.cn[2] * D_8037DCB8->unk14; +} + +void func_8038C9D0(void) { + u8 temp_v0; + Struct_lair_5ED0_0 *phi_s0; + s32 phi_s1; + + for(phi_s0 = D_80393760, phi_s1 = 0x191; phi_s1 < 0x1F0; phi_s1++){ + if ((phi_s0->unk9 == 0) && (0.45 < phi_s0->unk10)) { + phi_s0->unk10 = MAX(phi_s0->unk10 - 0.05, 0.45); + } else if ((phi_s0->unk9 != 0) && (phi_s0->unk10 < 0.95)) { + phi_s0->unk10 = MIN(phi_s0->unk10 + 0.05, 0.95); + } + func_8033F120(D_8037DCB8->unk0, phi_s1, func_8038C3A0, (s32) phi_s0); + phi_s0++; + } + + func_8033F120(D_8037DCB8->unk0, 0x1F1, func_8038C7A0, (s32) phi_s0); + if ( !((D_8037DCB8->currFfMode != FFA_3_TRIGGER_QUESTION) && (D_8037DCB8->currFfMode != FFA_4_UNK)) + && (0.5 < D_8037DCB8->unk14) + ) { + D_8037DCB8->unk14 = MAX(D_8037DCB8->unk14 - 0.01 , 0.5); + } + else if ((D_8037DCB8->currFfMode != FFA_3_TRIGGER_QUESTION) && (D_8037DCB8->currFfMode != FFA_4_UNK) + &&(D_8037DCB8->unk14 < 1.0) + ){ + D_8037DCB8->unk14 = MIN(D_8037DCB8->unk14 + 0.01 , 1.0); + } +} + +void func_8038CC10(void) +{ + if (D_8037DCB8->UNK_18) + return; + + D_8037DCB8->UNK_18 = func_8030ED2C(0x1C, 3); + func_8030DD90(D_8037DCB8->UNK_18, 0); + sfxsource_setSampleRate(D_8037DCB8->UNK_18, 32760); + func_8030DBB4(D_8037DCB8->UNK_18, 0.7f); + func_8030E2C4(D_8037DCB8->UNK_18); +} + +void func_8038CC9C(void) +{ + if (!D_8037DCB8->UNK_18) + return; + + func_8030E394(D_8037DCB8->UNK_18); + func_8030DA44(D_8037DCB8->UNK_18); + D_8037DCB8->UNK_18 = 0; +} + +void func_8038CCEC(void) +{ + free(D_8037DCB8->unk48); + D_8037DCB8->unk48 = NULL; + + free(D_8037DCB8); + D_8037DCB8 = NULL; + + func_80319190(); + func_80320818(); + func_802C5994(); +} + +void func_8038CD48(void) +{ + if (D_8037DCB8 == NULL) + return; + + /** + * //! EXPLOIT: FFM (Furnace Fun Moves) + * Sets moves upon entering SM or MM from the Lair, FF asm code stays + * latent until then + */ + func_80295864(D_8037DCB8->unlockedMoves); + + D_8037DCB8->unk0 = NULL; + + gczoombox_free(D_8037DCB8->unk20); + D_8037DCB8->unk20 = NULL; + + if (D_8037DCB8->UNK_18) + func_8038CC9C(); + + if (!func_803203FC(1) && !func_803203FC(2)) + func_803204E4(0, FALSE); + + if (!func_803203FC(0)) + func_8038CCEC(); +} + +void func_8038CE00(void) +{ + func_802BBC58(1); + func_802BAE20(0); +} + +void func_8038CE28(void) +{ + s32 i; + + func_80319050(); + D_8037DCB8 = malloc(sizeof(struct FF_StorageStruct)); + func_80320840(); + + // dump currently unlocked moves to storage + D_8037DCB8->unlockedMoves = func_802957F0(); + + for (i = 0; i < ARRLEN(D_8037DCB8->unk3C); i++) + D_8037DCB8->unk3C[i] = 0; + + // set joker card count to 0 + func_803463F4(ITEM_27_JOKER_CARD, func_80345FA0(0x27) * -1); + + D_8037DCB8->unk8 = 0; + D_8037DCB8->unk4 = NULL; + D_8037DCB8->unk20 = NULL; + D_8037DCB8->unk14 = 1.f; + D_8037DCB8->UNK_18 = 0; + D_8037DCB8->currFfMode = 1; + D_8037DCB8->unk48 = malloc(0x90); + + func_8038BC24(); +} + +void func_8038CF18(void) +{ + s32 i; + + struct FF_StorageStruct_48_sub *ptr; + + if (map_get() != MAP_8E_GL_FURNACE_FUN) + return; + + D_8037DCB8->unk0 = func_80309744(0); + D_8037DCB8->unk11 = 0; + + if (func_803203FC(2) && !func_803203FC(4)) + { + func_80320818(); + func_80320840(); + + for (i = 0; i < ARRLEN(D_8037DCB8->unk3C); i++) + D_8037DCB8->unk3C[i] = 0; + + // set joker card count to 0 + func_803463F4(ITEM_27_JOKER_CARD, func_80345FA0(ITEM_27_JOKER_CARD) * -1); + } + + func_8038C6BC(); + + ptr = D_8037DCB8->unk48->data; + +#if 0 + for (i = 0; i < ARRLEN(D_8037DCB8->unk48->data); i++) + ptr[i].unk20 = 0; +#else + // FIXME: weird + ptr[1].unk20 = 0; + ptr[2].unk20 = 0; + ptr += 3; + ptr[0].unk20 = 0; + ptr[-3].unk20 = 0; +#endif + + func_8029A95C(TRANSFORM_1_BANJO); + + func_80347A14(0); + + if (func_803203FC(1)) + { + levelSpecificFlags_clear(); + func_8038CE00(); + func_8038D670(FFA_4_UNK); + } + else + { + if (func_803203FC(2)) + { + levelSpecificFlags_clear(); + func_8038D670(FFA_5_FORGET_MOVES_2); + } + else + { + if (func_8031FF1C(BKPROG_A6_FURNACE_FUN_COMPLETE)) + func_8038D670(FFA_8_FURNACE_FUN_COMPLETE); + else + func_8038D670(FFA_1_UNK); + } + } +} + +s32 func_8038D0AC(s32 questionType, s32 a1) +{ + // :morphone: tf + return 10; +} + +void func_8038D0BC(s32 a0, s32 a1) +{ + if (a1 == 2) + { + func_80318614(D_8037DCB8->unk20, 1); + func_803183A4(D_8037DCB8->unk20, "THIS IS A SLIGHTLY LONGER PIECE OF TEXT FOR THE QUIZ DIALOGS!"); + } + + if (a1 == 3) + { + func_80318614(D_8037DCB8->unk20, 0); + func_8031841C(D_8037DCB8->unk20); + func_803183FC(D_8037DCB8->unk20); + } + + if (a1 == 6) + { + func_8038D670(FFA_4_UNK); + } +} + +void func_8038D16C(s32 a0, u16 a1) +{ + func_8025A6EC(a0, 0); + func_8025AB44(a0, 28000, 500); + func_80250530(func_8025ADD4(a0), a1, 0); +} + +void func_8038D1BC(void) +{ + func_8025A55C(-1, 500, 9); +} + +void func_8038D1E4(void) +{ + f32 cleanupDelay = -1.f; + + func_8025A55C(0, 500, 9); + + switch (D_80394354[D_8037DCB8->unkC].unk0) + { + case 0: + { + timed_playSfx( + 1.f, + D_80394354[D_8037DCB8->unkC].unk2, + D_80394354[D_8037DCB8->unkC].unk8, + D_80394354[D_8037DCB8->unkC].unk4 + ); + + cleanupDelay = 2.5f; + + break; + } + case 2: + { + D_8037DCB8->unk20 = gczoombox_new( + -100, + D_80394354[D_8037DCB8->unkC].unk2, + 0, 0, func_8038D0BC + ); + func_80318614(D_8037DCB8->unk20, 0); + func_803183EC(D_8037DCB8->unk20); + func_8031840C(D_8037DCB8->unk20); + + break; + } + case 1: + { + func_80324CFC( + 1.f, + D_80394354[D_8037DCB8->unkC].unk2, + D_80394354[D_8037DCB8->unkC].unk4 + ); + + cleanupDelay = D_80394354[D_8037DCB8->unkC].unk8; + + break; + } + case 3: + { + timedFunc_set_2( + 0.5f, (TFQM2)func_8038D16C, + D_80394354[D_8037DCB8->unkC].unk2, + D_80394354[D_8037DCB8->unkC].unk4 + ); + + cleanupDelay = D_80394354[D_8037DCB8->unkC].unk8; + + break; + } + } + + if (cleanupDelay > 0.0) // f64 + timedFunc_set_1(cleanupDelay, (TFQM1)func_8038D670, FFA_4_UNK); +} + +void func_8038D394(void) +{ + D_8037DCB8->unk12 = 1; + func_802D5058( + D_803945D0[D_8037DCB8->unkC].unk0, + D_803945D0[D_8037DCB8->unkC].UNK_01, + D_8037DCB8->unkD >= 9 + ); +} + +void func_8038D3F0(s32 a0, s32 a1) +{ + if (a1 == -2) + { + D_8037DCB8->unk12 = 0; + + if (D_8037DCB8->ffQuestionType == FFQT_2_SOUND) + func_8038D1E4(); + else if (D_8037DCB8->ffQuestionType == FFQT_1_PICTURE) + func_8038D394(); + else + func_8038D670(FFA_4_UNK); + } + else + { + D_8037DCB8->unkF = a1; + func_8038D670(FFA_6_TRIGGER_QUESTION_POST_EFFECTS); + } +} + +void func_8038D48C(void) +{ + func_8028F918(0); + func_802BAE4C(); + func_802BC280(); +} + +void func_8038D4BC(void) +{ + func_803204E4(2, TRUE); + func_802E4A70(); + + // restore moves after a delay + timedFunc_set_1(0.25f, + func_80295864, + D_8037DCB8->unlockedMoves + ); + + // trigger warp after a delay + timedFunc_set_3(0.25f, + (TFQM3)func_802E4078, + D_803945B8[D_8037DCB8->unkC].unk0, + D_803945B8[D_8037DCB8->unkC].UNK_01, + 1 + ); +} + +void func_8038D548(s32 a0) +{ + s32 s0; + + for (s0 = FF_QNF_START; s0 != FF_QNF_END; s0++) + func_8038C610(s0); + + if (a0) + func_8038C610(296); +} + +void func_8038D5A0(void) +{ + s32 s0; + Struct_lair_5ED0_0 *ptr = D_80393760; + + for (s0 = FF_QNF_START; s0 != FF_QNF_END; s0++, ptr++) + { + func_8038C610(s0); + + ptr->unk9 = 1; + + func_803208C0(s0 - FF_QNF_CNT, TRUE); + } +} + +s32 func_8038D60C(s32 a0) +{ + switch (a0) + { + // question bypass/replacement?? + + case 405: return 400; + case 413: return 401; + case 417: return 402; + case 460: return 403; + case 479: return 404; + default: + return -1; + } +} + +// FF: process ff action +void func_8038D670(enum FF_Action next_state) { + s32 pad3C; + f32 sp30[3]; + + switch(next_state){ + case FFA_1_UNK: //L8038D6A0 + if ((D_8037DCB8->currFfMode != FFA_5_FORGET_MOVES_2) && (D_8037DCB8->currFfMode != FFA_1_UNK)) { + func_802FAD64(ITEM_14_HEALTH); + func_802FAD64(ITEM_16_LIFE); + } + func_802FAD64(ITEM_27_JOKER_CARD); + D_8037DCB8->unkF = -2; + func_80295864(D_8037DCB8->unlockedMoves); + func_80347A14(1); + break; + + case FFA_2_ON_BOARD_FORGET_MOVES: //L8038D70C + func_80295864(0); + break; + + case FFA_3_TRIGGER_QUESTION: //L8038D720 + func_802FAD64(ITEM_14_HEALTH); + func_802FAD64(ITEM_16_LIFE); + D_8037DCB8->unk12 = 1; + func_8030E6D4(SFX_12C_FF_QUESTION_START); + func_8028F918(2); + if (D_8037DCB8->ffQuestionType != FFQT_4_MINIGAME) { + func_8038CE00(); + func_8031A154(D_8037DCB8->ffQuestionType, D_8037DCB8->unkD, D_8037DCB8->unkE, func_8038D0AC(D_8037DCB8->ffQuestionType, D_8037DCB8->unkC), 0, &func_8038D3F0); + } else { + func_8038D4BC(); + } + break; + + case FFA_4_UNK: //L8038D7CC + if (D_8037DCB8->ffQuestionType == FFQT_2_SOUND) { + switch(D_80394354[D_8037DCB8->unkC].unk0){ + case 3: + comusic_8025AB44(D_80394354[D_8037DCB8->unkC].unk2, 0, 0x1F4); + func_8025AABC(D_80394354[D_8037DCB8->unkC].unk2); + timedFunc_set_0(1.5f, func_8038D1BC); + break; + case 1: //L8038D870 + if (func_8025AD7C(D_80394354[D_8037DCB8->unkC].unk2)) { + comusic_8025AB44(D_80394354[D_8037DCB8->unkC].unk2, 0, 0x1F4); + timedFunc_set_0(1.5f, func_8038D1BC); + } else { + func_8025A55C(-1, 0x1F4, 9); + } + func_8025AABC(D_80394354[D_8037DCB8->unkC].unk2); + break; + case 2: //L8038D908 + gczoombox_free(D_8037DCB8->unk20); + D_8037DCB8->unk20 = 0; + default: + func_8025A55C(-1, 0x1F4, 9); + break; + }//L8038D91C + } + func_8031A48C(); + break; + + case FFA_6_TRIGGER_QUESTION_POST_EFFECTS: //L8038D940 + func_8038D48C(); + if (D_8037DCB8->unkF == 1) { + func_8038C640(D_8037DCB8->unk8, D_8037DCB8->unk4); + func_8038C338(D_8037DCB8->ffQuestionType, D_8037DCB8->unkC, 1); + D_8037DCB8->unk3C[D_8037DCB8->ffQuestionType]++; + if (func_8038C2C0(D_8037DCB8->ffQuestionType) == D_8037DCB8->unk3C[D_8037DCB8->ffQuestionType]) { + D_8037DCB8->unk3C[D_8037DCB8->ffQuestionType] = 0; + func_8038C2D4(D_8037DCB8->ffQuestionType); + } + if (((s32) D_8037DCB8->unk4->unk8 >= 7) && (func_803207F0(func_8038D60C(D_8037DCB8->unk8)) == 0)) { + func_803463D4(ITEM_27_JOKER_CARD, D_8037DCB8->unk4->unk8 - 6); + func_803208C0(func_8038D60C(D_8037DCB8->unk8), TRUE); + func_80356540(0xA8); + } + if (D_8037DCB8->unk8 != 0x1EF) { + func_8030E6A4(SFX_126_AUDIENCE_BOOING, 1.0f, 0x7FF8); + if (D_8037DCB8->unk4->unk8 == FFTT_5_GRUNTY) { + func_80356540(0xA2); + } + if (func_803203FC(0xA0)) { + func_80356540(0xA1); + } + func_80356540(0xA0); + } + } else { + if (D_8037DCB8->unk4->unk8 == FFTT_6_SKULL) { + func_80314AC8(0); + if (func_80305248(sp30, 0x377, D_8037DCB8->playerPosition)) { + func_8038D548(1); + func_8028F5F8(sp30); + } else { + func_8038D548(0); + func_8028F66C(0x13); + } + func_8030E6D4(SFX_125_AUDIENCE_CHEERING_2); + } else { + if (D_8037DCB8->unkF != -2) { + if (item_getCount(ITEM_14_HEALTH) == 1) { + func_8038D548(0); + } + func_8028F530(0xD); + } + func_8030E6D4(SFX_124_AUDIENCE_CHEERING_1); + } + if (D_8037DCB8->unk4->unk8 >= 7) { + func_803208C0(func_8038D60C(D_8037DCB8->unk8), TRUE); + func_8038C640(D_8037DCB8->unk8, D_8037DCB8->unk4); + } + if (func_803203FC(0xA3)) { + func_80356540(0xA4); + } + func_80356540(0xA3); + } + break; + + case FFA_5_FORGET_MOVES_2: //L8038DBEC + func_80295864(0); + break; + + case FFA_8_FURNACE_FUN_COMPLETE: //L8038DC00 + if (func_8031FF1C(0xA6) == 0) { + func_8025A55C(0, 0x1388, 0xB); + func_8025AB00(); + func_8025A70C(JINGLE_DOOR_OF_GRUNTY_OPENED); + func_80320004(0xA6, TRUE); + func_803204E4(0, FALSE); + func_803204E4(0xA6, TRUE); + func_803204E4(0xA7, TRUE); + next_state = 9; + mapSpecificFlags_set(0xA, TRUE); + func_8028F918(2); + func_80347A14(0); + } + func_8038D5A0(); + func_80295864(D_8037DCB8->unlockedMoves); + func_80347A14(1); + func_802FAD64(ITEM_27_JOKER_CARD); + break; + default: + break; + + } + D_8037DCB8->currFfMode = next_state; + if(D_8037DCB8); +} + +// FF: get question type +enum ff_question_type_e func_8038DCD4(enum FF_TileType tile) +{ + switch (tile) + { + case FFTT_1_BANJO: return FFQT_0_TEXT; + case FFTT_2_PICTURE: return FFQT_1_PICTURE; + case FFTT_3_MUSIC: return FFQT_2_SOUND; + case FFTT_4_MINIGAME: return FFQT_4_MINIGAME; + case FFTT_5_GRUNTY: return FFQT_3_GRUNTY; + default: // joker/skull squares + { + f32 rng = randf(); + + if (rng < 0.5) return FFQT_0_TEXT; // 50% chance + else if (rng < 0.7) return FFQT_1_PICTURE; // 20% chance of killing the run + else if (rng < 0.8999999999999999) return FFQT_2_SOUND; // 20% chance + else return FFQT_3_GRUNTY; // 10% chance + } + } +} + +// FF: choose level (enum level_e) for picture question (?) +s32 func_8038DDAC(void) +{ + f32 rng = randf(); + + if (rng < 0.333333) return randi2(0, 4); + else if (rng < 0.666666) return randi2(0, 4) + 4; + else return randi2(0, 4) + 8; +} + +// FF: prepare random unasked question for type +void func_8038DE34(enum ff_question_type_e type) +{ + s32 randQuestionIdx; + s32 rand; + s32 tmp; + + D_8037DCB8->unkE = -1; + + if (type == FFQT_0_TEXT + || type == FFQT_3_GRUNTY + || type == FFQT_4_MINIGAME + || type == FFQT_2_SOUND) + { + /** + * Handle normal questions, fetch from specific question pool + */ + + do + { + // Generate random question index in the valid range for the type + randQuestionIdx = randi2(0, func_8038C2C0(type)); + + // Try again if question already asked + } while (func_8038C370(type, randQuestionIdx)); + + // Save to storage struct + D_8037DCB8->unkC = randQuestionIdx; + D_8037DCB8->unkD = D_8037DCB8->unkC; + } + else if (type == FFQT_1_PICTURE) + { + /** + * Handle picture question (choosing a level, then choosing a pre-set angle within it) + */ + + D_8037DCB8->unkD = D_8037DCB8->unkC; + + do + { + rand = randi2(0, 10); + tmp = rand * 0xC; + + if (rand == 9) + { + D_8037DCB8->unkC = randi2(0, 10) + tmp; + D_8037DCB8->unkD = D_8037DCB8->unkC - tmp + 9; + } + else + { + D_8037DCB8->unkC = func_8038DDAC() + tmp; + D_8037DCB8->unkD = D_8037DCB8->unkC / 0xC; + } + + // Try again if question already asked + } while (func_8038C370(type, D_8037DCB8->unkC)); + } +} + +// FF: play timer square sounds +void func_8038DFBC(void) +{ + if (D_8037DCB8->UNK_18) + return; + + timed_playSfx(0.f, 0x2A, 0.5f, 32760); + timed_playSfx(0.25f, 0x51, 0.5f, 32760); + timed_playSfx(0.5f, 0x2A, 0.5f, 32760); + timed_playSfx(0.75f, 0x51, 0.5f, 32760); + + timedFunc_set_0(1.0f, func_8038CC10); + timedFunc_set_0(2.2f, func_8038CC9C); +} + +void func_8038E070(void) +{ + func_8028F85C(&D_8037DCB8->playerPosition); + func_8028F8A4(&D_8037DCB8->playerRotation); + func_8028F918(2); +} + +void func_8038E0B0(void) { + s32 sp48[6]; //buttons + s32 temp_v0; + s32 sp3C[2]; //joystick + s32 sp38; + s32 sp28; + + if( (map_get() == MAP_8E_GL_FURNACE_FUN) + && (D_8037DCB8 != NULL) + && (D_8037DCB8->unk0 != NULL) + ){ + func_80319EA4(); + func_8038C9D0(); + func_8024E55C(0, sp48); + func_8024E60C(0, sp3C); + if (D_8037DCB8->currFfMode < 3) { + player_getPosition(D_8037DCB8->playerPosition); + temp_v0 = func_8033F3E8(D_8037DCB8->unk0, D_8037DCB8->playerPosition, 0x191, 0x1F0); + if ((temp_v0 != D_8037DCB8->unk8) && (D_8037DCB8->unk8 != 0)) { + if (D_8037DCB8->unk4->unk9 == 2) { + D_8037DCB8->unk4->unk9 = 0U; + } + } + D_8037DCB8->unk8 = temp_v0; + D_8037DCB8->unk4 = func_8038C5B8(D_8037DCB8->unk8); + } + sp38 = MIN((D_8037DCB8->unk8 != 0) ? D_8037DCB8->unk4->unk8 : -1, FFTT_7_JOKER); + if ((D_8037DCB8->unk8 != 0) && (D_8037DCB8->unk4->unk9 == 0) && func_8028F20C()) { + D_8037DCB8->unk4->unk9 = 2; + if (D_8037DCB8->unk11) { + switch(sp38){ + case FFTT_6_SKULL://L8038E26C + func_8025A70C(COMUSIC_7B_STEP_ON_SKULL_TILE); + break; + + case FFTT_5_GRUNTY://L8038E280 + func_8025A70C(COMUSIC_7C_STEP_ON_GRUNTY_TILE); + break; + + case FFTT_1_BANJO://L8038E294 + func_8025A70C(COMUSIC_7D_STEP_ON_BK_TILE); + break; + + case FFTT_7_JOKER://L8038E2A8 + func_8025A70C(COMUSIC_7E_STEP_ON_MINIGAME_TILE); + break; + + case FFTT_3_MUSIC://L8038E2BC + func_8025A70C(COMUSIC_7F_STEP_ON_JOKER_TILE); + break; + + case FFTT_2_PICTURE://L8038E2D0 + func_8030E6D4(SFX_144_DOUBLE_CAMERA_CLICK); + break; + + case FFTT_4_MINIGAME://L8038E2E4 + func_8038DFBC(); + break; + } + D_8037DCB8->unk11 = FALSE; + } + } else { + D_8037DCB8->unk11 = TRUE; + } + + if ((D_8037DCB8->currFfMode >= 2) && (D_8037DCB8->currFfMode < 8) + && (item_getCount(ITEM_27_JOKER_CARD) != 0) + ) { + func_802FACA4(ITEM_27_JOKER_CARD); + } + func_8028FA14(MAP_8E_GL_FURNACE_FUN, 2); + switch(D_8037DCB8->currFfMode){ + case 1://L8038E388 + if(D_8037DCB8->unk8 != 0){ + func_80347A14(0); + func_8038D670(2); + } + break; + + case 2://L8038E3AC + if (D_8037DCB8->unk8 == 0) { + func_8038D670(1); + break; + } + func_802FACA4(0x14); + func_802FACA4(0x16); + if (sp38 != FFTT_0_NIL) { + sp28 = sp38 + 0x54; + if (!func_8031FF1C(sp28) && func_80311480(sp38 + 0x101E, 0, NULL, NULL, NULL, NULL)) { + func_80320004(sp28, TRUE); + } + if ((sp38 == FFTT_6_SKULL) && (item_getCount(ITEM_16_LIFE) == 1)) { + func_80356540(0xAB); + } else if (item_getCount(ITEM_14_HEALTH) == 1) { + func_80356540(0xAA); + } + if ((D_8037DCB8->unk4->unk9 == 2) && (func_8028ECAC() == 0)) { + if (func_8028EFEC() && (sp48[BUTTON_START] == 1)) { + func_803114D0(); + player_getRotation(D_8037DCB8->playerRotation); + D_8037DCB8->ffQuestionType = func_8038DCD4(sp38); + func_8038DE34(D_8037DCB8->ffQuestionType); + func_8038D670(3); + return; + } + if (func_8028EFC8() && (sp48[BUTTON_Z] == 1)) { + if ((item_getCount(ITEM_27_JOKER_CARD) > 0) && (sp28 < 0x5B)) { + func_8038C640(D_8037DCB8->unk8, D_8037DCB8->unk4); + item_dec(ITEM_27_JOKER_CARD); + func_8030E6D4(SFX_3EA_UNKNOWN); + func_80356540(0xA9); + if (D_8037DCB8->unk8 == 0x1EF) { + func_8038D670(8); + } + } else { + func_8025A70C(COMUSIC_2C_BUZZER); + } + } + } + } else { + if (D_8037DCB8->unk4->unk9 == 2) { + func_8038C640(D_8037DCB8->unk8, D_8037DCB8->unk4); + } + } + break; + + case 3://L8038E5C8 + if ((D_8037DCB8->ffQuestionType == 2) && D_80394354[D_8037DCB8->unkC].unk0 == 2){ + func_80316EF4(D_8037DCB8->unk20); + } + if ((D_8037DCB8->unk12 == 0) && func_8028EFC8() && (sp48[BUTTON_Z] == 1)) { + func_80324C58(); + func_8038D670(4); + } + break; + + case 4://L8038E64C + if (func_803203FC(1)) { + func_803204E4(1, 0); + func_8038E070(); + func_8025A55C(6000, 500, 0xA); + } + break; + + case 5://L8038E684 + if (func_803203FC(2)) { + if (func_803203FC(4)) { + func_8038E070(); + D_8037DCB8->unkF = func_803203FC(5); + func_8038D670(6); + } else { + func_8038D670(1); + } + func_803204E4(2, FALSE); + func_803204E4(4, FALSE); + } + break; + + case 6://L8038E6F8 + if ((D_8037DCB8->unk8 == 0x1EF) && ( D_8037DCB8->unkF == 1)) { + func_8038D670(8); + } + else{ + func_8038D670(2); + } + break; + + case 9://L8038E738 + if (!func_8025AD7C(0x78)) { + mapSpecificFlags_set(6, TRUE); + func_8038D670(0); + } + break; + } + } +} + +void func_8038E768(Gfx **dl, Mtx **m, Vtx **v) +{ + if (map_get() != MAP_8E_GL_FURNACE_FUN) + return; + + func_80319214(dl, m, v); + gczoombox_draw(D_8037DCB8->unk20, dl, m, v); +} + +void func_8038E7C4(void) +{ + if (func_803203FC(0)) + return; + + func_8038CE28(); + func_803204E4(0, TRUE); +} + +/** + * // TODO: Fix this so it doesn't look like it was written while writhing in epileptic shock + */ +s32 func_8038E800(void) +{ + struct FF_StorageStruct_48_sub *ptr = D_8037DCB8->unk48->data; + +#if 0 + //! doesn't match! + { + s32 i, j; + + for (i = 0; i < ARRLEN(D_8037DCB8->unk48->data); i++, ptr++) + { + if (ptr->unk20 == 0) + { + ptr->unk20 = 1; + + for (j = 0; j < ARRLEN(ptr->unk14); j++) + ptr->unk14[j] = 0xFF; + + for (j = 0; j < ARRLEN(ptr->unk0); j++) + ptr->unk0[j] = 0; + + ptr->unkC = 500; + ptr->UNK_10 = 1000; + + return i; + } + } + } +#else + //! why does a loop not match but this bs does? grant kirkhope pls + + if (ptr->unk20 == 0) + { + ptr->unk14[0] = 0xFF; + + ptr->unkC = 500; + + ptr->unk14[1] = 0xFF; + ptr->unk14[2] = 0xFF; + + ptr->unk20 = 1; + + ptr->unk0[2] = 0; + ptr->unk0[1] = 0; + ptr->unk0[0] = 0; + + ptr->UNK_10 = 1000; + + return 0; + } + + ptr++; + + if (ptr->unk20 == 0) + { + ptr->unkC = 500; + + ptr->unk20 = 1; + + ptr->unk14[0] = 0xFF; + ptr->unk14[1] = 0xFF; + ptr->unk14[2] = 0xFF; + + ptr->unk0[2] = 0; + ptr->unk0[1] = 0; + ptr->unk0[0] = 0; + + ptr->UNK_10 = 1000; + + return 1; + } + + ptr++; + + if (ptr->unk20 == 0) + { + ptr->unkC = 500; + + ptr->unk20 = 1; + + ptr->unk14[0] = 0xFF; + ptr->unk14[1] = 0xFF; + ptr->unk14[2] = 0xFF; + + ptr->unk0[2] = 0; + ptr->unk0[1] = 0; + ptr->unk0[0] = 0; + + ptr->UNK_10 = 1000; + + return 2; + } + + ptr++; + + if (ptr->unk20 == 0) + { + ptr->unk20 = 1; + + ptr->unk14[0] = 0xFF; + ptr->unk14[1] = 0xFF; + + //! real match! yea just kidding + do {ptr->unk14[2] = 0xFF; ptr->unk0[2] = 0; ptr->unk0[1] = 0; ptr->unk0[0] = 0; ptr->unkC = 500; + ptr->UNK_10 = 1000; + } while (0); + + return 3; + } +#endif + + return -1; +} + +void func_8038E968(s32 idx) +{ + if (D_8037DCB8 != NULL && D_8037DCB8->unk48 != NULL && idx >= 0) + D_8037DCB8->unk48->data[idx].unk20 = 0; +} + +void func_8038E9A4(s32 idx, f32 a1[3]) +{ + if (D_8037DCB8 != NULL && D_8037DCB8->unk48 != NULL && idx >= 0) + { + D_8037DCB8->unk48->data[idx].unk0[0] = a1[0]; + D_8037DCB8->unk48->data[idx].unk0[1] = a1[1]; + D_8037DCB8->unk48->data[idx].unk0[2] = a1[2]; + } +} + +void func_8038EA10(s32 idx, f32 a1[3]) +{ + if (D_8037DCB8 != NULL && D_8037DCB8->unk48 != NULL && idx >= 0) + { + D_8037DCB8->unk48->data[idx].unkC = a1[0]; + D_8037DCB8->unk48->data[idx].UNK_10 = a1[1]; + } +} + +void func_8038EA68(s32 idx, s32 a1[3]) +{ + if (D_8037DCB8 != NULL && D_8037DCB8->unk48 != NULL && idx >= 0) + { + D_8037DCB8->unk48->data[idx].unk14[0] = a1[0]; + D_8037DCB8->unk48->data[idx].unk14[1] = a1[1]; + D_8037DCB8->unk48->data[idx].unk14[2] = a1[2]; + } +} diff --git a/src/lair/code_86F0.c b/src/lair/code_86F0.c new file mode 100644 index 00000000..fd03f32a --- /dev/null +++ b/src/lair/code_86F0.c @@ -0,0 +1,550 @@ +#include +#include "functions.h" +#include "variables.h" + +extern f32 ml_vec3f_distance_squared(f32[3], f32[3]); +extern void func_8028F3D8(f32[3], f32, void(*)(ActorMarker *), ActorMarker *); +extern void func_80324CFC(f32, enum comusic_e, s32); +extern void func_8034A8BC(s32); +extern void func_8034DF30(s32, f32[3], f32[3], f32); +extern void func_8034E088(s32, s32, s32,f32); + +typedef struct { + s32 unk0; + s32 unk4; + s32 unk8; +}ActorLocal_lair_86F0; + +typedef struct { + u8 unk0; + u8 unk1; + u16 unk2; +}Struct_lair_86F0_0; + +void func_8038F350(Actor *this, s32 next_state); +void func_8038F924(Actor *this); + +/* .data */ +ActorInfo D_803947B0 = { 0x1EB, 0x3B7, 0x48B, 0x1, NULL, func_8038F924, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +ActorInfo D_803947D4 = { 0x1EB, 0x3BC, 0x538, 0x1, NULL, func_8038F924, func_80326224, func_80325888, 0, 0, 0.0f, 0}; +Struct_lair_86F0_0 D_803947F8[0xb] ={ + {0x01, 0x1, 0x5D}, + {0x02, 0x2, 0x5E}, + {0x05, 0x3, 0x60}, + {0x07, 0x3, 0x63}, + {0x08, 0x4, 0x66}, + {0x09, 0x4, 0x6A}, + {0x0A, 0x4, 0x6E}, + {0x0C, 0x4, 0x72}, + {0x0F, 0x4, 0x76}, + {0x19, 0x5, 0x7A}, + {0x04, 0x3, 0x7F} +}; +s32 D_80394824[3] = {0xff, 0xff, 0}; +struct31s D_80394830 = { + {0.17f, 0.24f}, + {0.08f, 0.13f}, + {0.0f, 0.01f}, + {0.9f, 0.9f}, + 0.0f, 0.0f +}; + +/* .code */ +bool func_8038EAE0(s32 arg0) { + return func_8031FF44(D_803947F8[arg0 -1].unk2, D_803947F8[arg0 -1].unk1) == D_803947F8[arg0 -1].unk0; +} + +s32 func_8038EB24(Actor *this){ + return (this->unkF4_8 != 0 && this->unkF4_8 < 0xC) ? D_803947F8[this->unkF4_8 - 1].unk0 : 0; +} + +bool func_8038EB58(Actor *this){ + ActorLocal_lair_86F0 *local; + + local = (ActorLocal_lair_86F0*)&this->local; + return func_8038EB24(this) == local->unk4; +} + +s32 func_8038EB84(Actor *this){ + return this->unkF4_8 + 0x1B; +} + +void func_8038EB94(void){ + func_802FAFD4(ITEM_14_HEALTH, 0x417); + func_802FAFC0(ITEM_14_HEALTH, COMUSIC_2B_DING_B); + func_80320004(BKPROG_B9_DOUBLE_HEALTH, TRUE); + func_80347958(); + func_803463D4(ITEM_14_HEALTH, 0); + func_80314AC8(1); +} + +void func_8038EBEC(ActorMarker *marker) { + Actor *this; + u32 temp_t6; + + this = marker_getActor(reinterpret_cast(ActorMarker *, marker)); + if (this->unkF4_8 < 0xAU) { + levelSpecificFlags_set(func_8038EB84(this), TRUE); + return; + } + if (this->unkF4_8 == 0xA) { + func_8028F918(0); + func_8028F918(2); + levelSpecificFlags_set(0x3F, TRUE); + return; + } + if (this->unkF4_8 == 0xB) { + timedFunc_set_0(1.5f, func_8038EB94); + func_80314AC8(0); + } +} + +void func_8038EC94(ActorMarker *marker, ActorMarker *other_marker){ + marker->unk3E_1 = TRUE; +} + +bool func_8038ECA8(ActorMarker *marker) { + return func_8028F20C() && func_8028FB48(0x08000000) && marker->unk3E_1; +} + +s32 func_8038ECFC(Actor *this, s32 arg1){ + ActorLocal_lair_86F0 *local; + + local = (ActorLocal_lair_86F0*)&this->local; + return local->unk0 & (1 << arg1); +} + +s32 func_8038ED10(Actor *this, s32 arg1){ + s32 phi_v1; + switch (this->unkF4_8){ + case 7: + phi_v1 = (arg1 == 2) ? 0x1a4 : 0x190; + break; + + case 3: + phi_v1 = 0x192; + break; + + case 8: + phi_v1 = 0x19A; + break; + + case 11: + phi_v1 = 0x1AE; + break; + default: + phi_v1 = 0x190; + break; + } + return phi_v1 + arg1; +} + +s32 func_8038ED88(Actor *this){ + switch (this->unkF4_8){ + case 3: + case 8: + case 0xb: + return 0x1F; + } + return 0x1E; +} + +void func_8038EDBC(Actor *this) { + s32 sp44; + s32 sp40; + ActorLocal_lair_86F0 *local; + s32 sp38; + f32 sp34; + f32 sp28[3]; + + local = (ActorLocal_lair_86F0*)&this->local; + sp38 = (this->modelCacheIndex == 0x3B7)? 0x190 : 0x192; + sp44 = func_8034C2C4(this->marker, sp38); + sp40 = func_8034C2C4(this->marker, sp38 + 1); + if ((sp44 != 0) && (sp40 != 0) && (this->marker->unk14_21)) { + sp28[0] = 1.0f; + sp28[1] = 1.0f; + sp28[2] = 1.0f; + if (func_8038ECA8(this->marker) && local->unk8 < 0xFF) { + local->unk8 = (local->unk8 + 8 < 0xFF) ? local->unk8 + 8 : 0xFF; + } + else if (!func_8038ECA8(this->marker) && (local->unk8 > 0)) { + local->unk8 = (local->unk8 - 8 > 0) ? local->unk8 - 8 : 0; + } + sp34 = (0xFF - local->unk8) / 255.0; + func_8034DF30(sp44, sp28, sp28, 0); + sp34 = 1.0 - sp34; + func_8034DF30(sp40, sp28, sp28, 0); + if(sp34); + } +} + + +void func_8038EF58(ActorMarker *marker) { + f32 sp24[3]; + Actor *this; + + this = marker_getActor(marker); + func_8034A174(func_803097A0(), func_8038ED88(this), sp24); + func_8028E6EC(2); + func_8028F918(0); + func_8028F94C(4, sp24); + func_8038F350(this, func_8031FF1C(0x17) ? 4 : 3); +} + +void func_8038EFD8(Actor *this) { + s32 pad3C; + f32 sp30[3]; + f32 sp24[3]; + + this->unk138_24 = FALSE; + player_getPosition(sp30); + sp24[0] = this->position[0]; + sp24[1] = this->position[1]; + sp24[2] = this->position[2]; + sp24[1] += 50.0f; + func_8028F3D8(sp24, ml_vec3f_distance(sp30, sp24) / 150.0, func_8038EF58, this->marker); +} + +void func_8038F078(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *this; + + this = marker_getActor(marker); + func_8038F350(this, (text_id == 0xf58) ? 1 : 4); +} + +void func_8038F0C0(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + func_8030E6D4(SFX_EA_GRUNTY_LAUGH_1); +} + +s32 func_8038F0EC(Actor *this) { + ActorLocal_lair_86F0 *local; + s32 phi_s0; + s32 sp34; + s32 phi_s2; + + phi_s0 = 0; + local = (ActorLocal_lair_86F0*)&this->local; + func_8034A8BC(this->unkF4_8); + if (this->unkF4_8 >= 0xA) { + for(phi_s2 = 0; phi_s2 < local->unk4; phi_s2++){ + sp34 = phi_s2; + phi_s0 |= (1 << sp34); + } + } else { + for(phi_s2 = 0; phi_s2 < local->unk4; phi_s2++){ + do{ + sp34 = randi2(0, func_8038EB24(this)); + } + while(1 << sp34 & phi_s0); + phi_s0 |= 1 << sp34; + } + } + return sp34; +} + + +void func_8038F1EC(Actor *this, s32 arg1, bool arg2) { + s32 temp_v0; + + temp_v0 = func_8034C528(func_8038ED10(this, arg1)); + if (temp_v0 != 0) { + func_8034E088(temp_v0, arg2 ? 0 : 0xff, arg2 ? 0xff : 0, 1.0f); + } +} + +void func_8038F250(Actor *this){ + ActorLocal_lair_86F0 *local; + + local = (ActorLocal_lair_86F0*)&this->local; + if( (this->unkF4_8 >= 2) + && (local->unk4 > 0) + && !func_8038EB58(this) + && !func_8031FF1C(0xDF) + ) { + if (func_80311480(0xF7C, 2, NULL, NULL, NULL, NULL)) { + func_80320004(0xDF, TRUE); + } + } else if ((this->unkF4_8 >= 3) + && (local->unk4 >= 2) + && !func_8038EB58(this) + && !func_8031FF1C(0xE0) + ){ + if(func_80311480(0xF7D, 2, NULL, NULL, NULL, NULL)) { + func_80320004(0xE0, TRUE); + } + } +} + +void func_8038F350(Actor *this, s32 next_state){ + ActorLocal_lair_86F0 *local; + f32 sp50[3]; + s32 sp4C; + s32 temp_s1; + s32 phi_s0; + + local = (ActorLocal_lair_86F0*)&this->local; + func_8034A174(func_803097A0(), func_8038ED88(this), sp50); + switch (next_state) { + case 1: //L8038F3BC + func_8028F918(0); + break; + + case 2: //L8038F3CC + func_8038EFD8(this); + FUNC_8030E8B4(SFX_112_TINKER_ATTENTION, 1.0f, 32000, this->position, 500, 1000); + break; + + case 3: //L8038F3F4 + func_803115C4(0xF7B); + func_803115C4(0xF80); + func_803115C4(0xF7F); + if (item_getCount(ITEM_26_JIGGY_TOTAL) > 0) { + func_80311480(func_8031FF1C(0x16) ? 0xF5A : 0xF59, 6, sp50, this->marker, func_8038F078, NULL); + func_80320004(0x17, 1); + } else { + func_80311480(0xF58, 6, sp50, this->marker, func_8038F078, NULL); + } + func_80320004(0x16, 1); + func_80320004(0xA7, 1); + break; + + case 8: //L8038F4AC + if (local->unk4 > 0) { + func_8025A70C(SFX_REMOVE_JIGGY); + this->unk60 = 1.0f; + temp_s1 = func_8038F0EC(this); + func_8038F1EC(this, temp_s1, 0); + local->unk4--; + local->unk0 &= ~(1 << temp_s1); + func_80320044(D_803947F8[this->unkF4_8 - 1].unk2, local->unk4, D_803947F8[this->unkF4_8 - 1].unk1); + func_803463F4(ITEM_26_JIGGY_TOTAL, 1); + } + break; + + case 5: //L8038F550 + if (local->unk4 < func_8038EB24(this)) { + func_8025A70C(COMUSIC_67_INSERTING_JIGGY); + this->unk60 = 1.0f; + local->unk4++; + temp_s1 = func_8038F0EC(this); + func_8038F1EC(this, temp_s1, 1); + local->unk0 |= (1 << temp_s1); + func_80320044(D_803947F8[this->unkF4_8 - 1].unk2, local->unk4, D_803947F8[this->unkF4_8 - 1].unk1); + func_803463F4(ITEM_26_JIGGY_TOTAL, -1); + func_8038F250(this); + } + break; + + case 6: //L8038F604 + if (local->unk4 < func_8038EB24(this)) { + if(item_getCount(ITEM_26_JIGGY_TOTAL) > func_8038EB24(this) - local->unk4){ + sp4C = func_8038EB24(this) - local->unk4; + } + else{ + sp4C = item_getCount(ITEM_26_JIGGY_TOTAL); + } + func_8025A70C(COMUSIC_67_INSERTING_JIGGY); + this->unk60 = 1.0f; + for(phi_s0 = 0; phi_s0 < sp4C; phi_s0++){ + local->unk4++; + temp_s1 = func_8038F0EC(this); + func_8038F1EC(this, temp_s1, 1); + local->unk0 |= (1 << temp_s1); + func_803463F4(ITEM_26_JIGGY_TOTAL, -1); + } + func_80320044(D_803947F8[this->unkF4_8 - 1].unk2, local->unk4, D_803947F8[this->unkF4_8 - 1].unk1); + func_8038F250(this); + } + break; + + case 7: //L8038F724 + func_8025A70C(COMUSIC_65_WORLD_OPENING_B); + if (this->unkF4_8 == 1) { + func_80324DBC(1.0f, 0xF7E, 4, NULL, this->marker, func_8038F0C0, NULL); + } else if (this->unkF4_8 == 0xA) { + func_80324DBC(1.0f, 0xFAC, 4, NULL, this->marker, func_8038F0C0, NULL); + } + timedFunc_set_1(2.0f, (TFQM1) func_8038EBEC, (s32) this->marker); + this->unk60 = 3.0f; + break; + } + func_80328A84(this, next_state); +} + + +void func_8038F800(Actor *this) { + s32 temp_v0; + s32 phi_s0; + + for(phi_s0 = 0; phi_s0 < func_8038EB24(this); phi_s0++){ + temp_v0 = func_8034C528(func_8038ED10(this, phi_s0)); + if (temp_v0 != 0) { + func_8034E0FC(temp_v0, func_8038ECFC(this, phi_s0) ? 0xff : 0); + } + } +} + +void func_8038F894(Actor *this, s32 arg1) { + if (item_getCount(ITEM_26_JIGGY_TOTAL) > 0) { + func_8038F350(this, arg1); + return; + } + func_8025A70C(COMUSIC_2C_BUZZER); + if (func_8031FF1C(0xDE) != 0) { + func_8038F350(this, 1); + return; + } + func_80311480(0xFBC, 4, NULL, NULL, NULL, NULL); + func_80320004(0xDE, 1); +} + +void func_8038F924(Actor *this) { + ActorLocal_lair_86F0 *local; + s32 sp7C[6]; //buttons + s32 phi_v1; + s32 phi_a0; + s32 sp6C[2]; //joystick + f32 sp68; + s32 sp64; + + + local = (ActorLocal_lair_86F0*)&this->local; + sp68 = time_getDelta(); + if (!this->initialized) { + this->initialized = TRUE; + } + + if (!this->unk16C_4) { + // temp_v0 = &D_803947F8[this->unkF4_8 - 1]; + sp64 = func_8031FF44(D_803947F8[this->unkF4_8 - 1].unk2, D_803947F8[this->unkF4_8 - 1].unk1); + local->unk0 = 0; + local->unk4 = 0; + local->unk8 = (func_8038ECA8(this->marker)) ? 0xff : 1; + this->unk138_24 = TRUE; + for(phi_v1 = 0; phi_v1 < sp64; phi_v1 ++){ + local->unk4++; + local->unk0 |= (1 << func_8038F0EC(this)); + } + func_8038F800(this); + marker_setCollisionScripts(this->marker, func_8038EC94, NULL, NULL); + this->marker->propPtr->unk8_3 = TRUE; + this->unk16C_4 = TRUE; + if (this->unkF4_8 == 9) { + this->unk1C[0] = 8.0f; + if (!func_8031FF1C(0x53)) { + marker_despawn(this->marker); + return; + } + if (!func_8031FF1C(0x54)) { + func_802C9334(0x20, this); + func_80324CFC(0.0f, COMUSIC_43_ENTER_LEVEL_GLITTER, 0x7FFF); + func_80324D2C(2.1f, COMUSIC_43_ENTER_LEVEL_GLITTER); + func_8030E6D4(SFX_113_PAD_APPEARS); + } + } + } + + if ((this->unkF4_8 == 9) && !func_8031FF1C(0x54)) { + this->yaw += this->unk1C[0]; + while(this->yaw >= 360.0f){ + this->yaw -= 360.0f; + } + this->unk1C[0] -= 0.089888; + if (this->unk1C[0] < 0.0f) { + this->unk1C[0] = 0.0f; + } + if (this->marker->unk14_21) { + s32 sp58[3] = D_80394824; + ParticleEmitter *sp54; + sp54 = partEmitList_pushNew(6); + particleEmitter_setSprite(sp54, ASSET_710_SPRITE_SPARKLE_PURPLE); + func_802EF9E4(sp54, 0xFF); + func_802EFB98(sp54, &D_80394830); + particleEmitter_setPosition(sp54, this->position); + sp58[2] = randf() * 255.0f; + func_802EFFA8(sp54, sp58); + particleEmitter_setParticleSpawnPositionRange(sp54, -30.0f, -40.0f, -30.0f, 30.0f, 20.0f, 30.0f); + particleEmitter_emitN(sp54, 6); + } + } + func_8024E55C(0, sp7C); + func_8024E60C(0, sp6C); + func_8038EDBC(this); + switch(this->state){ + case 1://L8038FCD0 + if (!this->unk138_24 && (!func_8028F20C() || !func_8028FB48(0x08000000))) { + this->unk138_24 = TRUE; + } + if (func_80329530(this, 300)) { + if ((this->unkF4_8 == 0xA) && !func_8031FF1C(0xF6)) { + phi_a0 = (item_getCount(ITEM_26_JIGGY_TOTAL) < D_803947F8[this->unkF4_8 - 1].unk0) ? 0xFAB : 0xFC0; + if (func_80311480(phi_a0, 0, NULL, NULL, NULL, NULL)) { + func_80320004(0xF6, TRUE); + } + } else if (this->unkF4_8 == 1) { + func_8035644C(0xA7); + } + } + if (func_8038ECA8(this->marker) && this->unk138_24 && !func_8038EB58(this) && (func_8028ECAC() == 0 || func_8028ECAC() == BSGROUP_8_TROT)) { + func_8038F350(this, 2); + } + break; + + case 4: //L8038FE28 + if ((func_803114C4() != 0xF7C) && (func_803114C4() != 0xF7D)) { + if (sp7C[BUTTON_START] == 1) { + func_8038F894(this, 5); + } else if (sp7C[BUTTON_Z] == 1) { + func_8038F350(this, 1); + } else if ((sp6C[0] == 1) && func_8031FF1C(0xE0)) { + func_8038F894(this, 6); + } else if (sp7C[BUTTON_R] == 1) { + if (local->unk4) { + func_8038F350(this, 8); + } else { + func_8025A70C(COMUSIC_2C_BUZZER); + func_8038F350(this, 1); + } + } + } + break; + + case 5: //L8038FF00 + case 6: //L8038FF00 + case 8: //L8038FF00 + if (this->unk60 > 0.0f) { + this->unk60 -= sp68; + } else { + func_8038F350(this, func_8038EB58(this) ? 7 :4); + } + break; + + case 7: //L8038FF50 + if (this->unk60 > 0.0f) { + this->unk60 -= sp68; + } else { + func_8038F350(this, 1); + } + break; + } + + { + s32 pad; + f32 sp44[3]; + s32 pad2; + this->marker->unk3E_1 = FALSE; + player_getPosition(sp44); + if (ml_vec3f_distance_squared(sp44, this->position) < 250000.0f) { + if (!this->unk38_0) { + func_802FA5D0(); + this->unk38_0 = TRUE; + } + func_802FACA4(0x2B); + } + else if (this->unk38_0) { + func_802FAD64(0x2B); + this->unk38_0 = FALSE; + } + } +} diff --git a/src/lair/code_9C40.c b/src/lair/code_9C40.c new file mode 100644 index 00000000..fb002e72 --- /dev/null +++ b/src/lair/code_9C40.c @@ -0,0 +1,123 @@ +#include +#include "functions.h" +#include "variables.h" + +extern bool func_80259384(f32[3], f32[3], f32); + +void func_803902B8(Actor *this); +Actor *func_80390030(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorAnimationInfo D_80394860[] = { + {0, 0.0f}, + {0x272, 0.8f} +}; +ActorInfo D_80394870 = { 0x16D, 0x1D5, 0x54F, 0x1, D_80394860, func_803902B8, func_80326224, func_80390030, 2500, 0, 1.2f, 0}; +ActorInfo D_80394894 = { 0x16E, 0x1D6, 0x54F, 0x1, D_80394860, func_803902B8, func_80326224, func_80390030, 2500, 0, 1.2f, 0}; +ActorInfo D_803948B8 = { 0x16F, 0x1D7, 0x54F, 0x1, D_80394860, func_803902B8, func_80326224, func_80390030, 2500, 0, 1.2f, 0}; + +/* .code */ +Actor *func_80390030(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + func_8033A45C(3, 1); + func_8033A45C(4, 1); + func_80325888(marker, gfx, mtx, vtx); +} + +s32 func_80390084(void) { + s32 phi_s0; + s32 phi_s1; + + for(phi_s0 = 0, phi_s1 = 0; phi_s0 < 3; phi_s0++){ + if (func_8031FF1C(phi_s0 + 0xAD)) { + phi_s1++; + } + } + return phi_s1; +} + +void func_803900DC(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + +} + +void func_803900EC(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + s32 sp1C; + + sp1C = marker->unk14_20 - 0x16D; + func_8028F918(0); + if (!func_8031FF1C(sp1C + 0xAD)) { + func_80320004(sp1C + 0xAD, 1); + func_8025A6EC(COMUSIC_2B_DING_B, 28000); + } +} + +s32 func_80390158(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + s32 phi_v1; + phi_v1 = marker->unk14_20 - 0x16D; + return phi_v1; +} + +void func_80390174(ActorMarker *marker, s32 arg1) { + Actor *this; + s32 sp28; + + this = marker_getActor(marker); + sp28 = this->marker->unk14_20 - 0x16D; + func_8028F94C(2, this->position); + if (func_8031FF1C(sp28 + 0xAD)) { + func_80311480(sp28 + 0xF83, 0xE, this->position, this->marker, func_803900EC, func_803900DC); + return; + } + func_80311174(func_80390084() + 0xFA5, 0xE, this->position, this->marker, func_803900EC, func_803900DC, func_80390158); +} + +void func_8039024C(Actor *this){ + if(this->unk38_0){ + func_8032BB88(this, -1, 0x1f4); + comusic_8025AB44(COMUSIC_79_CHEATO, 0, 500); + func_8025AABC(COMUSIC_79_CHEATO); + } +} + +void func_80390298(Actor *this) { + func_8039024C(this); +} + +void func_803902B8(Actor *this) { + f32 sp5C[3]; + s32 sp58; + s32 sp54; + s32 sp3C[6]; + + sp54 = this->marker->unk14_20 - 0x16D; + if (!this->initialized) { + func_803300D8(this->marker, func_80390298); + this->unk138_24 = func_803203FC(0x1F); + this->initialized = TRUE; + } + _player_getPosition(sp5C); + sp58 = func_80259384(this->position, sp5C, 1750.0f) && !this->unk138_24; + if (sp58 && !this->unk38_0) { + func_8032BB88(this, 0, 0x1F4); + func_8025A6EC(COMUSIC_79_CHEATO, 0); + comusic_8025AB44(COMUSIC_79_CHEATO, -1, 0x1F4); + } + else if (!sp58 && this->unk38_0) { + func_8039024C(this); + } + this->unk38_0 = sp58; + sp58 = func_80259384(this->position, sp5C, 400.0f); + if (func_8031FF1C(sp54 + 0xAD)) { + func_8024E55C(0, sp3C); + sp58 &= (sp3C[BUTTON_Z] == TRUE) || func_8028EC04(); + } + if (sp58 && !*(s32 *)&this->local) { + func_80390174(this->marker, 0); + } + if (actor_animationIsAt(this, 0.01f)) { + func_8030E878(SFX_F1_CHEATO_IDLE_2, randf()*0.1 + 0.95, 20000, this->position, 200.0f, 1500.f); + } + if (actor_animationIsAt(this, 0.25f)) { + func_8030E878(SFX_F0_CHEATO_IDLE_1, randf()*0.1 + 0.95, 20000, this->position, 200.0f, 1500.0f); + } + *(s32 *)&this->local = sp58; +} diff --git a/src/lair/code_A170.c b/src/lair/code_A170.c new file mode 100644 index 00000000..a91b2d9e --- /dev/null +++ b/src/lair/code_A170.c @@ -0,0 +1,89 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_80329904(ActorMarker*, s32, f32*); + +void func_803906A0(Actor *this); +Actor *func_80390560(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorAnimationInfo D_803948E0[] = { + {0, 0.0f}, + {0x268, 1.6f}, +}; +ActorAnimationInfo D_803948F0[] = { + {0, 0.0f}, + {0x269, 1.6f}, +}; +ActorAnimationInfo D_80394900[] = { + {0, 0.0f}, + {0x26A, 1.6f}, +}; +ActorInfo D_80394910 = { 0x170, 0x1D8, 0x547, 0x1, D_803948E0, func_803906A0, func_80326224, func_80390560, 0, 0, 0.7f, 0}; +ActorInfo D_80394934 = { 0x171, 0x1D9, 0x548, 0x1, D_803948F0, func_803906A0, func_80326224, func_80390560, 0, 0, 0.5f, 0}; +ActorInfo D_80394958 = { 0x172, 0x1DA, 0x549, 0x1, D_80394900, func_803906A0, func_80326224, func_80390560, 0, 0, 0.5f, 0}; + +/* .code */ +Actor *func_80390560(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + func_8033A45C(3, marker->collidable); + func_8033A45C(4, marker->collidable); + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_803905CC(ActorMarker *marker, ActorMarker *other_marker){ + switch (marker->unk14_20) { + case 0x170: + func_80346448(ITEM_D_EGGS); + func_802F3874(&marker->propPtr->x); + func_8025A6EC(SFX_EGG_REFILL, -1); + break; + case 0x171: + func_80346448(ITEM_F_RED_FEATHER); + func_802F3978(&marker->propPtr->x); + func_8025A6EC(SFX_RED_FEATHER_REFILL, -1); + break; + case 0x172: + func_80346448(ITEM_10_GOLD_FEATHER); + func_802F3A60(&marker->propPtr->x); + func_8025A6EC(SFX_GOLD_FEATHER_REFILL, -1); + break; + } + marker->collidable = FALSE; +} + +void func_803906A0(Actor *this) { + s32 phi_s0; + s32 phi_s2; + s32 phi_s4; + + if (!this->initialized) { + marker_setCollisionScripts(this->marker, func_803905CC, NULL, NULL); + this->initialized = TRUE; + this->marker->propPtr->unk8_3 = TRUE; + } + if (this->marker->unk14_21 && this->marker->collidable) { + switch (this->marker->modelId) { + default: + break; + case 0x547: + phi_s2 = 4; + phi_s4 = 8; + break; + case 0x548: + phi_s2 = 4; + phi_s4 = 8; + break; + case 0x549: + phi_s2 = 4; + phi_s4 = 8; + break; + } + for(phi_s0 = 0; phi_s0 < phi_s2; phi_s0++){ + if (randf() < ((1.0 / (f64) phi_s2) / 15.0)) { + func_8033E73C(this->marker, phi_s0 + 5, &func_80329904); + func_8033E3F0(phi_s4, 1); + } + } + } +} diff --git a/src/lair/code_A430.c b/src/lair/code_A430.c new file mode 100644 index 00000000..bf2c0ace --- /dev/null +++ b/src/lair/code_A430.c @@ -0,0 +1,19 @@ +#include +#include "functions.h" +#include "variables.h" + +void func_80390820(Actor *this); + +/* .data */ +ActorInfo D_80394980 = { 0x299, 0x3C3, 0x0, 0x0, NULL, func_80390820, func_80326224, func_80325340, 0, 0, 0.0f, 0}; + +/* .code */ +void func_80390820(Actor *this) +{ + if (!this->unk38_0 && func_80329530(this, 200)) + { + FUNC_8030E624(SFX_61_CARTOONY_FALL, 0.8f, 32000); + timed_playSfx(0.5f, SFX_31_BANJO_OHHWAAOOO, 1, 32000); + this->unk38_0 = TRUE; + } +} diff --git a/src/lair/code_A4A0.c b/src/lair/code_A4A0.c new file mode 100644 index 00000000..a2504581 --- /dev/null +++ b/src/lair/code_A4A0.c @@ -0,0 +1,101 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_802DB548(ActorMarker *, ActorMarker *); + +typedef struct { + f32 unk0; + f32 unk4; + s8 unk8; + s8 unk9; + s8 unkA; + s8 unkB; + u32 unkC_31:3; + u32 unkC_28:1; + u32 unkC_27:28; + s16 unk10; + s16 unk12; + f32 unk14; + u8 pad18[0x18]; + void (*unk30)(ActorMarker *, ActorMarker *); + void (*unk34)(ActorMarker *, ActorMarker *); + u8 pad38[0x4]; + f32 unk3C; +} ActorLocal_lair_A4A0; + +void func_80390AE8(Actor *this); + +/* .data */ +ActorAnimationInfo D_803949B0[] ={ + {0x000, 0.0f}, + {0x26D, 4.0f}, + {0x26D, 0.7f}, + {0x26F, 0.7f}, + {0x26E, 0.9f}, + {0x270, 1.6f}, + {0x26D, 1.5f}, + {0x26F, 0.5f}, + {0x26D, 1.5f}, + {0x26D, 1000000.0f}, + {0x26D, 1000000.0f}, +}; +ActorInfo D_80394A08 = { 0x1EA, 0x367, 0x54A, 0x1, D_803949B0, func_80390AE8, func_80326224, func_80325888, 2500, 0, 1.0f, 0}; +ActorInfo D_80394A2C = { 0x295, 0x3BF, 0x561, 0x1, D_803949B0, func_80390AE8, func_80326224, func_80325888, 2500, 0, 1.0f, 0}; +ActorInfo D_80394A50 = { 0x1F1, 0x3C0, 0x562, 0x1, D_803949B0, func_80390AE8, func_80326224, func_80325888, 2500, 0, 1.0f, 0}; + +/* .code */ +void func_80390890(ActorMarker *marker, ActorMarker *other_marker) { + Actor *this; + ActorLocal_lair_A4A0 *local; + + this = marker_getActor(marker); + local = (ActorLocal_lair_A4A0 *)&this->local; + func_80328B8C(this, 5, 0.0f, 1); + actor_playAnimationOnce(this); + func_8030E878(SFX_C2_GRUBLIN_EGH, local->unkC_27*0.1 + 0.8, 32000, this->position, 1250.0f, 2500.0f); + func_802C3F04((GenMethod_4)func_802C4140, ACTOR_4C_STEAM, reinterpret_cast(s32, this->position[0]), reinterpret_cast(s32, this->position[1]), reinterpret_cast(s32, this->position[2])); + actor_collisionOff(this); + this->unk138_24 = TRUE; +} + +void func_80390994(Actor *this) { + ActorLocal_lair_A4A0 *local; + + local = (ActorLocal_lair_A4A0 *)&this->local; + local->unk0 = 5 - local->unkC_27; + local->unk4 = 8 - local->unkC_27 * 2; + local->unk8 = 6 - local->unkC_27; + local->unk9 = 0xC - local->unkC_27 * 2; + local->unkA = 0x10 - (local->unkC_27 * 3); + local->unkB = 8 - local->unkC_27; + local->unkC_31 = 1; + local->unk10 = 0xFB; + local->unk12 = 0x7530; + local->unk14 = local->unkC_27 * 0.1 + 0.8; + local->unk3C = local->unkC_27 * 0.2 + 1.1; + local->unkC_28 = TRUE; + local->unk30 = func_802DB548; + local->unk34 = func_80390890; +} + +void func_80390AE8(Actor *this) { + ActorLocal_lair_A4A0 *local; + + local = (ActorLocal_lair_A4A0 *)&this->local; + if (!this->unk16C_4) { + local->unkC_27 = (this->modelCacheIndex == 0x367) ? 2 + : (this->modelCacheIndex == 0x3bf) ? 1 + : 0; + func_80390994(this); + } + func_802DB5A0(this); + if (this->state == 5) { + if (actor_animationIsAt(this, 0.18f)) { + FUNC_8030E8B4(SFX_2_CLAW_SWIPE, 1.0f, 28000, this->position, 1250, 2500); + } + if (actor_animationIsAt(this, 0.7f)) { + FUNC_8030E8B4(SFX_1F_HITTING_AN_ENEMY_3, 1.0f, 28000, this->position, 1250, 2500); + } + } +} diff --git a/src/lair/code_A810.c b/src/lair/code_A810.c new file mode 100644 index 00000000..59c6c356 --- /dev/null +++ b/src/lair/code_A810.c @@ -0,0 +1,148 @@ +#include +#include "functions.h" +#include "variables.h" + +extern func_80391EA8(ActorMarker *, ActorMarker *, f32 [3], f32, f32, s32); + +typedef struct { + f32 unk0[4][3]; +}ActorLocal_lair_A810; + + +void func_80390E28(Actor *this); + +/* .data */ +ActorInfo D_80394A80 = { 0x1EC, 0x377, 0x0, 0x0, NULL, func_80390E28, func_80326224, func_80325340, 3000, 0, 0.0f, 0}; + +/* .bss */ +extern f32 D_80395370[14][3]; +extern s32 D_80395460; + +/* .code */ +void func_80390C00(ActorMarker *marker) +{ + Actor *actor; + Actor *newActor; + s32 pad; + + actor = marker_getActor(reinterpret_cast(ActorMarker *, marker)); + newActor = spawn_child_actor(0x3BB, &actor); + + func_80391EA8( + newActor->marker, actor->marker, actor->unk1C, + randf2(1400, 1800), + randf2(0.2f, 0.6f), + randf() < 0.5 ? 1 : 0 + ); +} + +void func_80390CB4(ActorMarker *marker) +{ + Actor *actor; + Actor *newActor; + s32 pad; + + actor = marker_getActor(reinterpret_cast(ActorMarker *, marker)); + newActor = spawn_child_actor(0x3BB, &actor); + + func_80391EA8( + newActor->marker, actor->marker, actor->unk1C, + randf2(1200, 1400), + randf2(0.8f, 1), + -1 + ); +} + +void func_80390D3C(Actor *this, s32 val) +{ + ActorLocal_lair_A810 *local; + + local = (ActorLocal_lair_A810 *)&this->local; + func_80328A84(this, val); + + switch (val) + { + case 2: + { + if (this->unk10_12 != 0) + { + s32 rand = randi2(0, this->unk10_12); + this->unk1C[0] = local->unk0[rand][0]; + this->unk1C[1] = local->unk0[rand][1]; + this->unk1C[2] = local->unk0[rand][2]; + } + else + { + this->unk1C[0] = this->position_x; + this->unk1C[1] = this->position_y; + this->unk1C[2] = this->position_z; + } + + func_802C3C88((GenMethod_1)func_80390C00, reinterpret_cast(s32, this->marker)); + + break; + } + case 1: + { + this->unk1C[0] = this->position_x; + this->unk1C[1] = this->position_y; + this->unk1C[2] = this->position_z; + + func_802C3C88((GenMethod_1)func_80390CB4, reinterpret_cast(s32, this->marker)); + + break; + } + default: + break; + } +} + +void func_80390E28(Actor *this) { + ActorLocal_lair_A810 *local; + bool sp38; + s32 i; + f32 temp_f0; + + local = (ActorLocal_lair_A810 *)&this->local; + sp38 = mapSpecificFlags_getN(0, 2); + if (!this->initialized) { + if (D_80395460 == 0) { + D_80395460 = func_8030508C(0x377, D_80395370[0], 0x14); + } + this->unk10_12 = 0; + for(i = 0; (i < D_80395460) && (this->unk10_12 < 4); i++){ + temp_f0 = ml_vec3f_distance(this->position, D_80395370[i]); + if ((temp_f0 > 400.0f) && (temp_f0 < 1200.0f)) { + local->unk0[this->unk10_12][0] = D_80395370[i][0]; + local->unk0[this->unk10_12][1] = D_80395370[i][1]; + local->unk0[this->unk10_12][2] = D_80395370[i][2]; + this->unk10_12++; + } + } + this->initialized = TRUE; + } + if (!this->unk16C_4) { + if (sp38 != 0) { + mapSpecificFlags_setN(0, 0, 2); + } + this->unk16C_4 = TRUE; + return; + } + + switch (this->state) { + case 0: + if( !func_8031A3BC() && (sp38 < 2) && (randf() < 0.1) && !mapSpecificFlags_get(0xA) && !func_803203FC(0x1F)) { + sp38++; + mapSpecificFlags_setN(0, sp38, 2); + func_80390D3C(this, (randf() < 0.5) ? 2 :1); + } + break; + case 1: + case 2: + if (this->unk38_0) { + func_80390D3C(this, 0); + this->unk38_0 = FALSE; + } + break; + } +} diff --git a/src/lair/code_AD70.c b/src/lair/code_AD70.c new file mode 100644 index 00000000..4d84bbf7 --- /dev/null +++ b/src/lair/code_AD70.c @@ -0,0 +1,317 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8038EA68(s32, s32[3]); +extern void func_8038EA10(s32, f32[3]); +extern void func_8038E9A4(s32, f32[3]); + +typedef struct { + f32 unk0; + f32 unk4; + f32 unk8; + s32 unkC; + s32 unk10; +} ActorLocal_lair_AD70; + +void func_80391B04(Actor *this); + +/* .data */ +ActorInfo D_80394AB0 = { 0x1EF, 0x3BB, 0x54B, 0x1, NULL, func_80391B04, func_80326224, func_80325340, 0, 0, 0.0f, 0}; +s32 D_80394AD4[3] = {0xBA, 0xBA, 0xBA}; +struct31s D_80394AE0 = { + {0.1f, 0.2f}, + {3.6f, 4.6f}, + {1.0f, 1.0f}, + {3.0f, 3.0f}, + 0.05f, 0.1f +}; + +struct31s D_80394B08 = { + {0.3f, 0.5f}, + {0.0f, 0.0f}, + {0.0f, 0.1f}, + {3.0f, 3.5f}, + 0.4f, 0.6f, +}; + +struct43s D_80394B30 = { + {{-400.0f, 400.0f, -400.0f}, {400.0f, 800.0f, 400.0f}}, + {{0.0f, -1000.0f, 0.0f}, {0.0f, -1000.0f, 0.0f}}, + {{-20.0f, -20.0f, -20.0f}, {20.0f, 20.0f, 20.0f}} +}; + +struct43s D_80394B78 = { + {{-50.0f, 200.0f, -50.0f}, {50.0f, 400.0f, 50.0f}}, + {{0.0f, -500.0f, 0.0f}, {0.0f, -500.0f, 0.0f}}, + {{-40.0f, -40.0f, -40.0f}, {40.0f, 40.0f, 40.0f}} +}; +f32 D_80394BC0[2] = {1000.0f, 2000.0f}; +s32 D_80394BC8[3] = {0xC0, 0xC0, 0xC0}; +s32 D_80394BD4[3] = {0xff, 0x80, 0x80}; + +/* .rodata */ +extern f32 D_803952D0; // .rodata : 0.2f +extern f64 D_803952D8; // 4.0 +extern f64 D_803952E0; +extern f64 D_803952E8; + + +/* .code */ +void func_80391160(f32 pos[3], u32 count) +{ + ParticleEmitter *p = partEmitList_pushNew(count); + particleEmitter_setSprite(p, 0x70E); + func_802EFFA8(p, D_80394AD4); + func_802EF9E4(p, 0xEB); + particleEmitter_setStartingFrameRange(p, 0, 7); + particleEmitter_setPosition(p, pos); + particleEmitter_setParticleSpawnPositionRange(p, -55, -55, -55, 55, 55, 55); + particleEmitter_setParticleVelocityRange(p, -70, -70, -70, 70, 70, 70); + func_802EFB98(p, &D_80394AE0); + particleEmitter_emitN(p, count); +} + +void func_80391254(f32 pos[3], u32 count, enum asset_e sprite) +{ + ParticleEmitter *p = partEmitList_pushNew(count); + particleEmitter_setSprite(p, sprite); + func_802EFA70(p, 8); + particleEmitter_setStartingFrameRange(p, 0, 2); + particleEmitter_setParticleFramerateRange(p, 4, 6); + particleEmitter_setParticleSpawnPositionRange(p, -80, 0, -80, 80, 0, 80); + particleEmitter_setPosition(p, pos); + func_802EFA5C(p, 0.6f, 0.7f); + func_802EFB70(p, 3, 3); + func_802EFB84(p, 4, 4); + func_802EFEC0(p, 1, 1); + particleEmitter_emitN(p, count); +} + +void func_8039137C(f32 pos[3], u32 count, enum asset_e sprite) +{ + ParticleEmitter *p = partEmitList_pushNew(count); + particleEmitter_setSprite(p, sprite); + particleEmitter_setPosition(p, pos); + func_802EF9F8(p, 0.3f); + func_802EFA18(p, 3); + func_802EFE24(p, 0, 0, 600, 0, 0, 900); + particleEmitter_setPositionVelocityAndAccelerationRanges(p, &D_80394B30); + func_802EFB98(p, &D_80394B08); + func_802EFA70(p, 2); + particleEmitter_emitN(p, count); +} + +void func_8039144C(f32 pos[3], u32 count) +{ + ParticleEmitter *p = partEmitList_pushNew(count); + particleEmitter_setSprite(p, 0x713); + particleEmitter_setPosition(p, pos); + particleEmitter_setParticleSpawnPositionRange(p, -40, -40, -40, 40, 40, 40); + func_802EFA70(p, 4); + func_802EFE24(p, 0, 0, 200, 0, 0, 300); + func_802EFA5C(p, 0.1f, 0.2f); + func_802EFEC0(p, 0.75f, 0.75f); + func_802EFB70(p, 0.5f, 0.5f); + func_802EFB84(p, 0.2f, 0.2f); + particleEmitter_setParticleAccelerationRange(p, 0, -50, 0, 0, -100, 0); + particleEmitter_emitN(p, count); +} + +void func_803915A4(f32 pos[3], s32 count, f32 scale) +{ + ParticleEmitter *p = partEmitList_pushNew(count); + particleEmitter_setSprite(p, 0x4A0); + func_802EFA5C(p, 0.1f, 0.2f); + func_802EFA70(p, 8); + particleEmitter_setStartingFrameRange(p, 2, 8); + particleEmitter_setParticleFramerateRange(p, 8, 8); + particleEmitter_setPosition(p, pos); + func_802EFB70(p, scale * 2.0, scale * 2.0); + func_802EFB84(p, scale * 0.4, scale * 0.4); + func_802EFEC0(p, 0.5f, 0.5f); + particleEmitter_emitN(p, count); +} + + +void func_803916BC(f32 position[3], s32 cnt){ + ParticleEmitter *pCtrl = partEmitList_pushNew(cnt); + particleEmitter_setSprite(pCtrl, ASSET_4A0_SPRITE_EXPLOSION); + func_802EFA5C(pCtrl, 0.1f, 0.3f); + func_802EFA70(pCtrl, 8); + particleEmitter_setStartingFrameRange(pCtrl, 0, 6); + particleEmitter_setParticleFramerateRange(pCtrl, 5.0f, 8.0f); + particleEmitter_setPosition(pCtrl, position); + func_802EFB70(pCtrl, 2.0f, 2.0f); + func_802EFB84(pCtrl, 4.0f, 4.0f); + func_802EFEC0(pCtrl, 1.0f, 1.5f); + particleEmitter_setPositionVelocityAndAccelerationRanges(pCtrl, &D_80394B78); + particleEmitter_emitN(pCtrl, cnt); +} + +void func_803917B0(Actor *actor) +{ + Actor *unk = func_80329980(actor); + + unk->unk38_0 = TRUE; +} + +void func_803917DC(void) +{ + u32 flags = mapSpecificFlags_getN(0, 2); + mapSpecificFlags_setN(0, flags - 1, 2); +} + +void func_80391810(Actor *this, s32 next_state) { + ActorLocal_lair_AD70 *local; + f32 sp38[3]; + f32 sp34; + + local = (ActorLocal_lair_AD70 *)&this->local; + switch (next_state) { + case 1: + sp34 = (this->position[1] + this->unk28) - this->unk1C[1]; + this->velocity[1] = gu_sqrtf(this->unk28 * 2000.0); + local->unk0 = -this->velocity[1] / -1000.0f; + local->unk0 += gu_sqrtf((sp34 * -2.0) / -1000.0); + this->velocity[0] = this->unk1C[0] - this->position[0]; + this->velocity[2] = this->unk1C[2] - this->position[2]; + this->velocity[0] /= local->unk0; + this->velocity[2] /= local->unk0; + local->unk4 *= local->unk0; + this->unk60 = 0.0f; + local->unk8 = this->position[1] * 0.5; + sp38[0] = this->position[0]; + sp38[1] = this->position[1]; + sp38[2] = this->position[2]; + sp38[1] += 100.0f; + func_803916BC(sp38, 3); + break; + case 2: + FUNC_8030E8B4(SFX_148_GRUNTY_SPELL_LANDING, 1.0f, 20000, this->position, 1500, 3000); + func_80391254(this->position, 2, 0x4A0); + func_80391254(this->position, 2, 0x6C1); + func_80391160(this->position, 4); + func_8039137C(this->position, 4, 0x711); + func_8039137C(this->position, 4, 0x712); + func_803917B0(this); + timedFunc_set_0(4.0f, func_803917DC); + this->unk60 = 4.0f; + break; + case 3: + FUNC_8030E8B4(SFX_96_HOTSAND_EEL_HISS, 0.8f, 25000, this->position, 1500, 3000); + sp38[0] = this->position[0]; + sp38[1] = this->position[1]; + sp38[2] = this->position[2]; + sp38[1] += 100.0f; + func_803916BC(sp38, 3); + func_80391160(sp38, 4); + func_8039137C(sp38, 4, 0x714); + func_8039137C(sp38, 4, 0x715); + func_803917B0(this); + func_803917DC(); + break; + case 4: + func_803917B0(this); + func_803917DC(); + break; + } + func_80328A84(this, next_state); +} + + +void func_80391AE4(Actor *actor) +{ + func_8038E968(*(s32 *)&actor->unk7C[0x10]); +} + +void func_80391B04(Actor *this) { + f32 sp44; + ActorLocal_lair_AD70 *local; + f32 sp34[3]; + f32 temp_f0_2; + + local = (ActorLocal_lair_AD70 *)&this->local; + sp44 = time_getDelta(); + if (!this->unk16C_4) { + local->unk10 = func_8038E800(); + func_8038EA68(local->unk10, D_80394BC8); + func_8038EA10(local->unk10, D_80394BC0); + this->unk58_2 = FALSE; + func_80391810(this, 1); + func_803300D8(this->marker, func_80391AE4); + this->unk16C_4 = TRUE; + } + + func_8038E9A4(local->unk10, this->position); + switch (this->state) { /* irregular */ + case 1: + if (func_8031A3BC() || mapSpecificFlags_get(0xA)) { + func_80391810(this, 4); + break; + } + this->position[0] += this->velocity[0] * sp44; + this->position[1] += this->velocity[1] * sp44; + this->position[2] += this->velocity[2] * sp44; + this->velocity[1] += -1000.0f * sp44; + this->yaw += this->yaw_moving * sp44; + this->pitch += this->unk6C * sp44; + if ((this->velocity[1] < 0.0) && (this->position[1] < this->unk1C[1])) { + func_80391810(this, 3); + } + func_803915A4(this->position, 1, (f32)local->unkC); + if (func_80329904(this->marker, 5, sp34)) { + func_8039144C(sp34, 1); + } + if (local->unk4 > 0.0) { + this->unk60 += sp44; + if (local->unk4 < this->unk60) { + func_80391810(this, 2); + } + } + if ((local->unk8 < this->position[1]) && !this->unk138_24) { + FUNC_8030E8B4(SFX_14E_SOFT_EXPLOSION, 1.0f, 20000, this->position, 1500, 3000); + this->unk138_24 = TRUE; + } + break; + case 3: + case 4: + marker_despawn(this->marker); + break; + case 2: + this->unk60 -= sp44; + if (this->unk60 > 0.0f) { + temp_f0_2 = (f32) ((f64) this->unk60 * 0.25); + D_80394BD4[0] = (s32) ((f32) D_80394BD4[0] * temp_f0_2); + D_80394BD4[1] = (s32) ((f32) D_80394BD4[1] * temp_f0_2); + D_80394BD4[2] = (s32) ((f32) D_80394BD4[2] * temp_f0_2); + func_8038EA68(local->unk10, D_80394BD4); + break; + } + marker_despawn(this->marker); + break; + } +} + +void func_80391EA8(ActorMarker *marker, ActorMarker *a1, f32 a2[3], f32 f1, f32 scale, s32 f2) +{ + Actor *actor = marker_getActor(marker); + u8 *unk = actor->unk7C; + + actor->unk1C[0] = a2[0]; + actor->unk1C[1] = a2[1]; + actor->unk1C[2] = a2[2]; + + actor->unk28 = f1; + + actor->yaw_moving = randf2( 240, 480); + actor->unk6C = randf2(-240, -480); + + actor->scale = scale; + + actor->unk100 = a1; + + *(f32 *)(unk + 0x04) = f2 > 0 ? 0.5 : 0.0; + *(s32 *)(unk + 0x0C) = f2 < 0 ? 2.5 : 1.0; +} + diff --git a/src/lair/code_BBD0.c b/src/lair/code_BBD0.c new file mode 100644 index 00000000..fd9c0ef9 --- /dev/null +++ b/src/lair/code_BBD0.c @@ -0,0 +1,146 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8030E9FC(enum sfx_e, f32, f32, s32, f32[3], f32, f32); + +void func_8039217C(Actor *this); +Actor *func_80391FC0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); + +/* .data */ +ActorAnimationInfo D_80394BE0[] = { + {0x000, 0.0f}, + {0x28A, 1000000.0f}, + {0x28A, 1.5f}, + {0x28C, 1000000.0f}, + {0x28C, 2.0f}, + {0x1D5, 1000000.0f}, + {0x1D5, 0.25}, + {0x28E, 2.0f}, + {0x1D0, 3.0f}, +}; +ActorInfo D_80394C28 = { 0x29A, 0x3C4, 0x55F, 0x1, D_80394BE0, func_8039217C, func_80326224, func_80325888, 0, 0, 3.0f, 0}; +ActorInfo D_80394C4C = { 0x29A, 0x3C7, 0x560, 0x3, D_80394BE0, func_8039217C, func_80326224, func_80325888, 0, 0, 1.0f, 0}; +ActorInfo D_80394C70 = { 0x29A, 0x3C6, 0x34C, 0x0, D_80394BE0, func_8039217C, func_80326224, func_80325888, 0, 0, 3.0f, 0}; +ActorInfo D_80394C94 = { 0x29A, 0x3C8, 0x35B, 0x5, D_80394BE0, func_8039217C, func_80326224, func_80391FC0, 0, 0, 1.0f, 0}; + +/* .code */ +Actor *func_80391FC0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + func_8033A45C(4, 1); + func_8033A45C(5, 1); + return func_80325888(marker, gfx, mtx, vtx); +} + +void func_80392014(Actor *this, enum sfx_e sfx_id, f32 arg2, f32 arg3, s32 arg4) { + if (mapSpecificFlags_get(0xA) || func_803203FC(0x1F)) { + arg4 = arg4 * 0.5; + } + if (mapSpecificFlags_get(5)) { + func_8030EBC8(sfx_id, arg2, arg3, arg4, arg4); + return; + } + func_8030E9FC(sfx_id, arg2, arg3, arg4, this->position, 1000.0f, 2000.0f); +} + +void func_803920E0(Actor *this, enum sfx_e sfx_id, f32 arg2, f32 arg3, s32 arg4, f32 arg5) { + s32 sp1C; + + sp1C = func_802F9AA8(sfx_id); + func_802F9F80(sp1C, 0.1f, arg5, 0.2f); + func_802FA060(sp1C, arg4, arg4, 0.0f); + func_802F9DB8(sp1C, arg2, arg3, 0.01f); + if (!mapSpecificFlags_get(5)) { + func_802F9EC4(sp1C, this->position, 1000, 2000); + } +} + +void func_8039217C(Actor *this) { + if (!this->initialized) { + this->initialized = TRUE; + if (func_8031FF1C(0xA6)) { + marker_despawn(this->marker); + return; + } + } + switch(this->state){ + case 1: //L803921F4 + if (randf() < 0.01) { + func_80328A84(this, 2U); + } + break; + + case 2: //L8039222C + if (actor_animationIsAt(this, 0.2f)) { + func_80392014(this, SFX_20_METAL_CLANK_1, 0.95f, 1.05f, 15000); + } + if (actor_animationIsAt(this, 0.45f)) { + func_80392014(this, SFX_20_METAL_CLANK_1, 0.95f, 1.05f, 15000); + } + if (actor_animationIsAt(this, 0.9f)) { + func_80392014(this, SFX_20_METAL_CLANK_1, 0.95f, 1.05f, 15000); + } + if (actor_animationIsAt(this, 0.999f)) { + func_80328A84(this, 1U); + } + break; + + case 3: //L803922FC + if (randf() < 0.01) { + func_80328A84(this, 4U); + } + break; + + case 4: //L80392334 + if (actor_animationIsAt(this, 0.15f)) { + func_80392014(this, SFX_9_SQUEAKY_TOY, 1.25f, 1.35f, 28000); + } + if (actor_animationIsAt(this, 0.5f)) { + func_80392014(this, SFX_9_SQUEAKY_TOY, 1.25f, 1.35f, 28000); + } + if (actor_animationIsAt(this, 0.999f)) { + func_80328A84(this, 3U); + } + break; + + case 5: //L803923C0 + if (func_803203FC(0x1F)) { + func_80328A84(this, 8U); + break; + } + if (mapSpecificFlags_get(9)) { + mapSpecificFlags_set(5, 0); + func_80328A84(this, 8U); + break; + } + if ((randf() < 0.1) || mapSpecificFlags_get(5)) { + this->unk38_0 = mapSpecificFlags_get(5); + this->unk60 = randf2(2.0f, 4.0f); + func_80328A84(this, 6U); + func_803920E0(this, SFX_134_FREEZING_SHIVER, 1.1f, 1.2f, 15000, this->unk60); + break; + } + if (randf() < 0.1) { + func_80328A84(this, 7U); + } + break; + + case 6: //L803924EC + if (this->unk60 > 0.0f) { + this->unk60 -= time_getDelta(); + break; + } + if (actor_animationIsAt(this, 0.999f) || (mapSpecificFlags_get(5) != this->unk38_0)) { + func_80328A84(this, 5U); + } + break; + + case 7: //L8039255C + if ((actor_animationIsAt(this, 0.999f)) || (mapSpecificFlags_get(5) != this->unk38_0)) { + func_80328A84(this, 5U); + } + break; + + case 8: //L80392594 + break; + } +} diff --git a/src/lair/code_C1C0.c b/src/lair/code_C1C0.c new file mode 100644 index 00000000..889823d7 --- /dev/null +++ b/src/lair/code_C1C0.c @@ -0,0 +1,121 @@ +#include +#include "functions.h" +#include "variables.h" + +Actor *func_803925B0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx); +void func_80392700(Actor *this); +void func_80392918(Actor *this); + +/* .data */ +ActorAnimationInfo D_80394CC0[] = { + {0x000, 0.0f}, + {0x28B, 8.0f}, + {0x28D, 0.5f}, + {0x2AC, 3.0f}, + {0x2AD, 14.0f}, + {0x28D, 0.5f}, +}; +ActorInfo D_80394CF0 = { 0x29B, 0x3C5, 0x53D, 0x1, D_80394CC0, func_80392700, func_80392918, func_803925B0, 0, 0, 3.0f, 0}; + +/* .code */ +Actor *func_803925B0(ActorMarker *marker, Gfx **gfx, Mtx **mtx, Vtx **vtx){ + func_8033A45C(3, 0); + func_8033A45C(4, 0); + func_8033A45C(5, 0); + return func_80325888(marker, gfx, mtx, vtx); +} + + +void func_80392610(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + if(arg2 == 0xA){ + mapSpecificFlags_set(5, TRUE); + } + else{ + mapSpecificFlags_set(5, FALSE); + } + set_camera_to_node(arg2); +} + +void func_80392664(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + func_802BBC58(2); +} + +void func_80392690(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + Actor *this; + + this = marker_getActor(marker); + func_8030E6D4(SFX_EA_GRUNTY_LAUGH_1); + func_80328B8C(this, 5, 0.0f, 1); + actor_loopAnimation(this); + this->yaw_moving = 79.0f; + animctrl_setTransitionDuration(this->animctrl, 0.4f); +} + +void func_80392700(Actor *this) { + if (mapSpecificFlags_get(4)) { + if (func_8031FF1C(0xF4)) { + func_80311480(0x1031, 0xF, this->position, this->marker, func_80392664, func_80392610); + } else { + func_802BC280(); + set_camera_to_node(0x1F); + func_80311480(0x102C, 0xE, this->position, this->marker, func_80392664, func_80392610); + func_80320004(0xF4, 1); + } + mapSpecificFlags_set(4, 0); + } + if (mapSpecificFlags_get(6)) { + func_8025A70C(MUSIC_KLUNGO_BY_FALLEN_GRUNTY); + func_802BC280(); + set_camera_to_node(9); + mapSpecificFlags_set(9, 1); + func_8028F94C(2, this->position); + func_80311480(0x103F, 0x2A, this->position, this->marker, func_80392690, func_80392610); + mapSpecificFlags_set(6, 0); + func_80328B8C(this, 3, 0.0f, 1); + actor_playAnimationOnce(this); + } + if ((this->state == 3) && (actor_animationIsAt(this, 0.999f) != 0)) { + func_80328B8C(this, 4, 0.0f, 1); + actor_loopAnimation(this); + } + if (this->state == 5) { + func_80328FB0(this, 12.0f); + if (func_80329480(this) != 0) { + func_80328B8C(this, 5, 0.0f, 1); + this->marker->unk2C_2 = TRUE; + } + } + this->unk58_0 = !func_8031A3BC(); +} + + +void func_80392918(Actor *this) { + if (!this->unk16C_4) { + if ((func_8031FF1C(0xF4) != 0) && (func_8028E4A4() == 2)) { + mapSpecificFlags_set(4, 1); + } + this->unk4C = 400.0f; + this->marker->unk2C_2 = FALSE; + this->unk16C_4 = TRUE; + if (func_8031FF1C(0xA6) != 0) { + marker_despawn(this->marker); + } + return; + } + func_80326224(this); + if ((this->unk48 > 0.5) && !this->unk138_24) { + this->unk138_24 = TRUE; + set_camera_to_node(0x1E); + } + if ((0.999 < this->unk48) && !this->unk38_0) { + comusic_8025AB44(MUSIC_KLUNGO_BY_FALLEN_GRUNTY, 0, 2000); + func_8025AABC(0xA8); + this->unk38_0 = TRUE; + mapSpecificFlags_set(7, TRUE); + mapSpecificFlags_set(5, TRUE); + } + if (this->unk48 == 1.0) { + marker_despawn(this->marker); + } + +} diff --git a/src/lair/code_C6C0.c b/src/lair/code_C6C0.c new file mode 100644 index 00000000..5b2a2794 --- /dev/null +++ b/src/lair/code_C6C0.c @@ -0,0 +1,57 @@ +#include +#include "functions.h" +#include "variables.h" + +extern void func_8028F3D8(f32[3], f32, void(*)(ActorMarker *), ActorMarker *); + +void func_80392B6C(Actor *this); + +/* .data */ +ActorInfo D_80394D20 = { 0x29C, 0x3C9, 0x0, 0x0, NULL, func_80392B6C, func_80326224, func_80325340, 0, 0, 0.0f, 0}; + +/* .code */ +void func_80392AB0(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + comusic_8025AB44(COMUSIC_A9_TOOTY, 0, 2000); + func_8025AABC(0xA9); + func_8031B51C(); +} + +void func_80392AF4(ActorMarker *marker, enum asset_e text_id, s32 arg2){ + set_camera_to_node(arg2); +} + +void func_80392B1C(ActorMarker *marker) { + func_8028E6EC(0); + func_80311480(0x1040, 8, NULL, marker, func_80392AB0, func_80392AF4); +} + +void func_80392B6C(Actor *this) { + NodeProp* phi_a0; + s32 sp28; + + if (!this->unk16C_4) { + this->unk16C_4 = TRUE; + if (func_8031FF1C(0xA6) != 0) { + marker_despawn(this->marker); + return; + } + phi_a0 = func_80304C38(0x3BE, this); + if (this == NULL) { + this->unk1C[0] = -1300.0f; + this->unk1C[1] = 250.0f; + this->unk1C[2] = -3422.0f; + } else { + nodeprop_getPosition(phi_a0, this->unk1C); + } + } + if (mapSpecificFlags_get(7) != 0) { + sp28 = ml_vec3f_distance(this->position, this->unk1C) / 350.0; + func_8025A70C(COMUSIC_A9_TOOTY); + mapSpecificFlags_set(7, 0); + mapSpecificFlags_set(9, 1); + set_camera_to_node(0x10); + func_8028F918(0); + func_8028F85C(this->position); + func_8028F3D8(this->unk1C, (f32) sp28, &func_80392B1C, this->marker); + } +} diff --git a/subyaml/BGS.jp.yaml b/subyaml/BGS.jp.yaml new file mode 100644 index 00000000..e75eb569 --- /dev/null +++ b/subyaml/BGS.jp.yaml @@ -0,0 +1,33 @@ +options: + basename: BGS + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: BGS-code + dir: BGS + type: code + start: 0x00000000 + vram: 0x80386F40 + subsegments: + - [0x00000000, asm] + - name: BGS-data + dir: BGS + type: code + start: 0x0000A2A0 + vram: 0x803911E0 + subsegments: + - [0x0000A2A0, bin, data_A2A0] + - [0x0000AE40] \ No newline at end of file diff --git a/subyaml/BGS.pal.yaml b/subyaml/BGS.pal.yaml new file mode 100644 index 00000000..d6031cea --- /dev/null +++ b/subyaml/BGS.pal.yaml @@ -0,0 +1,33 @@ +options: + basename: BGS + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt +segments: + - name: BGS-code + dir: BGS + type: code + start: 0x00000000 + vram: 0x80386DD0 + subsegments: + - [0x00000000, asm] + - name: BGS-data + dir: BGS + type: code + start: 0x0000A2A0 + vram: 0x80391070 + subsegments: + - [0x0000A2A0, bin, data_A2A0] + - [0x0000AE40] \ No newline at end of file diff --git a/subyaml/BGS.us.v10.yaml b/subyaml/BGS.us.v10.yaml new file mode 100644 index 00000000..309bead2 --- /dev/null +++ b/subyaml/BGS.us.v10.yaml @@ -0,0 +1,94 @@ +options: + basename: BGS + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.BGS.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.BGS.us.v10.txt + base_path: . + target_path: build/us.v10/BGS.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: + - name: BGS-code + dir: BGS + type: code + start: 0x00000000 + vram: 0x803863F0 + # after: core2-data + subsegments: + - [0x0, c, ch/flibbit] #DONE + - [0x15F0, c, done/ch/pinkegg] #DONE + - [0x18A0, c, ch/croctus] #DONE + - [0x2270, c, done/ch/code_2270] #DONE + - [0x3030, c, code_3030] #DONE + - [0x3420, c, code_3420] + - [0x4D70, c, ch/yumblie] #DONE + - [0x5600, c, ch/mrvile] #DONE + - [0x6730, c, done/ch/code_6730] #DONE + - [0x6DF0, c, ch/yellowflibbit] #DONE + - [0x8640, c, done/ch/mudhut] #DONE + - [0x8A60, c, done/ch/code_8A60] #DONE + - [0x8DF0, c, done/code_8DF0] #DONE + - [0x9080, c, ch/tanktup] + - [0x9750, c, code_9750] #DONE + - [0x98C0, c, done/ch/bigalligator] #DONE + - [0x9920, c, ch/leafboat] #DONE + - name: BGS-data + dir: BGS + type: code + start: 0x0000A2A0 + vram: 0x80390690 + subsegments: + #80390a40 #80390a70 + - [0x0000A2A0, .data, ch/flibbit] + - [0x0000A2D0, .data, done/ch/pinkegg] + - [0x0000A3C0, .data, ch/croctus] + - [0x0000A440, .data, done/ch/code_2270] + - [0x0000A490, .data, code_3030] + - [0x0000A570, .data, code_3420] + - [0x0000A650, .data, ch/yumblie] + - [0x0000A680, .data, ch/mrvile] + - [0x0000A6C0, .data, done/ch/code_6730] + - [0x0000A6F0, .data, ch/yellowflibbit] + - [0x0000A730, bin, data_A730] + - [0x0000A740, .data, done/ch/mudhut] + - [0x0000A7A0, .data, done/ch/code_8A60] + - [0x0000A830, .data, ch/tanktup] + - [0x0000A860, .data, code_9750] + - [0x0000A980, .data, done/ch/bigalligator] + - [0x0000A9B0, .data, ch/leafboat] + - [0x0000A9E0, .rodata, ch/flibbit] + - [0x0000AAF0, .rodata, ch/croctus] + - [0x0000AB80, .rodata, done/ch/code_2270] + - [0x0000ABF0, .rodata, code_3030] + - [0x0000AC00, .rodata, code_3420] + - [0x0000AC20, .rodata, ch/yumblie] + - [0x0000AC50, .rodata, ch/mrvile] + - [0x0000ACA0, .rodata, done/ch/code_6730] + - [0x0000ACB0, .rodata, ch/yellowflibbit] + - [0x0000ADA0, .rodata, done/ch/mudhut] + - [0x0000ADB0, .rodata, done/ch/code_8A60] + - [0x0000ADC0, bin, data_ADC0] # .rodata, ch/tanktup] + - [0x0000ADD0, .rodata, code_9750] + - [0x0000ADE0, .rodata, ch/leafboat] + - name: BGS-bss + dir: BGS + type: code + start: 0x0000AE40 + vram: 0x80391230 + subsegments: + - [0x0000AE40, .bss, done/ch/code_6730] + - [0x0000AE40] \ No newline at end of file diff --git a/subyaml/BGS.us.v11.yaml b/subyaml/BGS.us.v11.yaml new file mode 100644 index 00000000..47cfd27d --- /dev/null +++ b/subyaml/BGS.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: BGS + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: BGS-code + dir: BGS + type: code + start: 0x00000000 + vram: 0x80385610 + subsegments: + - [0x00000000, asm] + - name: BGS-data + dir: BGS + type: code + start: 0x0000A2A0 + vram: 0x8038F8B0 + subsegments: + - [0x0000A2A0, bin, data_A2A0] + - [0x0000AE40] \ No newline at end of file diff --git a/subyaml/CC.jp.yaml b/subyaml/CC.jp.yaml new file mode 100644 index 00000000..da94b21f --- /dev/null +++ b/subyaml/CC.jp.yaml @@ -0,0 +1,33 @@ +options: + basename: CC + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: CC-code + dir: CC + type: code + start: 0x00000000 + vram: 0x80386F40 + subsegments: + - [0x00000000, asm] + - name: CC-data + dir: CC + type: code + start: 0x000036B0 + vram: 0x8038A5F0 + subsegments: + - [0x000036B0, bin, data_36B0] + - [0x00003B80] \ No newline at end of file diff --git a/subyaml/CC.pal.yaml b/subyaml/CC.pal.yaml new file mode 100644 index 00000000..4e11b2dd --- /dev/null +++ b/subyaml/CC.pal.yaml @@ -0,0 +1,33 @@ +options: + basename: CC + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt +segments: + - name: CC-code + dir: CC + type: code + start: 0x00000000 + vram: 0x80386DD0 + subsegments: + - [0x00000000, asm] + - name: CC-data + dir: CC + type: code + start: 0x000036B0 + vram: 0x8038A480 + subsegments: + - [0x000036B0, bin, data_36B0] + - [0x00003B80] \ No newline at end of file diff --git a/subyaml/CC.us.v10.yaml b/subyaml/CC.us.v10.yaml new file mode 100644 index 00000000..48bb1e15 --- /dev/null +++ b/subyaml/CC.us.v10.yaml @@ -0,0 +1,61 @@ +options: + basename: CC + find_file_boundaries: no + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.CC.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.CC.us.v10.txt + base_path: . + target_path: build/us.v10/CC.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: + - name: CC-code + dir: CC + type: code + start: 0x00000000 + vram: 0x803863F0 + subsegments: + - [0x00000000, c, code_0] + - [0x530, c, code_530] #Done + - [0xBF0, c, code_BF0] #Done + - [0x1120, c, ch/tooth] #Done + - [0x13C0, c, code_13C0] #DONE + - [0x19B0, c, code_19B0] #Done + - [0x1B90, c, code_1B90] #Done + - [0x1F70, c, code_1F70] #DONE + - [0x3130, c, ch/sawblade] #Done + - [0x3400, c, code_3400] #Done + - name: CC-data + dir: CC + type: code + start: 0x000036B0 + vram: 0x80389AA0 + subsegments: + - [0x000036B0, .data, code_0] + - [0x000036E0, .data, code_530] + - [0x00003710, .data, code_BF0] + - [0x00003760, .data, ch/tooth] + - [0x000037F0, bin, data_37F0] + - [0x00003800, .data, code_1B90] + - [0x00003810, .data, code_1F70] + - [0x00003840, bin, ch/sawblade] + - [0x00003A50, .data, code_3400] + - [0x00003AC0, bin, rodata_0] # - [0x00003AC0, .rodata, code_0] + - [0x00003B10, .rodata, code_530] + - [0x00003B20, .rodata, ch/tooth] + - [0x00003B30, .rodata, code_1B90] + - [0x00003B40, .rodata, code_1F70] + - [0x00003B80] \ No newline at end of file diff --git a/subyaml/CC.us.v11.yaml b/subyaml/CC.us.v11.yaml new file mode 100644 index 00000000..a3b57763 --- /dev/null +++ b/subyaml/CC.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: CC + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: CC-code + dir: CC + type: code + start: 0x00000000 + vram: 0x80385610 + subsegments: + - [0x00000000, asm] + - name: CC-data + dir: CC + type: code + start: 0x000036B0 + vram: 0x80388CC0 + subsegments: + - [0x000036B0, bin, data_36B0] + - [0x00003B80] \ No newline at end of file diff --git a/subyaml/CCW.jp.yaml b/subyaml/CCW.jp.yaml new file mode 100644 index 00000000..5e6ff1ec --- /dev/null +++ b/subyaml/CCW.jp.yaml @@ -0,0 +1,33 @@ +options: + basename: CCW + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: CCW-code + dir: CCW + type: code + start: 0x00000000 + vram: 0x80386F40 + subsegments: + - [0x00000000, asm] + - name: CCW-data + dir: CCW + type: code + start: 0x00008790 + vram: 0x8038F6D0 + subsegments: + - [0x00008790, bin, data_8790] + - [0x00009A10] \ No newline at end of file diff --git a/subyaml/CCW.pal.yaml b/subyaml/CCW.pal.yaml new file mode 100644 index 00000000..35e2ddc8 --- /dev/null +++ b/subyaml/CCW.pal.yaml @@ -0,0 +1,33 @@ +options: + basename: CCW + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt +segments: + - name: CCW-code + dir: CCW + type: code + start: 0x00000000 + vram: 0x80386DD0 + subsegments: + - [0x00000000, asm] + - name: CCW-data + dir: CCW + type: code + start: 0x00008760 + vram: 0x8038F530 + subsegments: + - [0x00008760, bin, data_8760] + - [0x000099E0] \ No newline at end of file diff --git a/subyaml/CCW.us.v10.yaml b/subyaml/CCW.us.v10.yaml new file mode 100644 index 00000000..ea8dde14 --- /dev/null +++ b/subyaml/CCW.us.v10.yaml @@ -0,0 +1,92 @@ +options: + basename: CCW + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.CCW.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.CCW.us.v10.txt + base_path: . + target_path: build/us.v10/CCW.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: + - name: CCW-code + dir: CCW + type: code + start: 0x00000000 + vram: 0x803863F0 + subsegments: + - [0x00000000, c, code_0] #DONE + - [0x160, c, code_160] #DONE + - [0x950, c, code_950] #DONE + - [0x14B0, c, code_14B0] #DONE + - [0x1B20, c, code_1B20] #DONE + - [0x21A0, c, code_21A0] #DONE + - [0x2270, c, code_2270] #DONE + - [0x2B00, c, code_2B00] #DONE + - [0x3050, c, code_3050] #DONE + - [0x3310, c, code_3310] #DONE + - [0x3DA0, c, code_3DA0] #DONE + - [0x4530, c, code_4530] #DONE + - [0x4960, c, code_4960] #DONE + - [0x4D00, c, code_4D00] #DONE + - [0x50D0, c, code_50D0] #DONE + - [0x5540, c, code_5540] #DONE + - [0x5BF0, c, code_5BF0] #DONE + - [0x61E0, c, code_61E0] #DONE + - [0x6620, c, code_6620] #DONE + - [0x6AC0, c, code_6AC0] #DONE + - [0x6EC0, c, code_6EC0] #DONE + - [0x7120, c, code_7120] #DONE + - [0x7570, c, code_7570] #DONE + - [0x76C0, c, code_76C0] #DONE + - [0x7BC0, c, code_7BC0] #DONE + - [0x7BF0, c, code_7BF0] #DONE + - [0x8050, c, code_8050] #DONE + - [0x8670, c, code_8670] #DONE + - name: CCW-data + dir: CCW + type: code + start: 0x00008760 + vram: 0x8038EB50 + subsegments: + - [0x00008760, bin, data_8760] + - [0x00008920, .data, code_2B00] + - [0x00008A80, bin, data_8A80] + - [0x00008D70, .data, code_3DA0] + - [0x00008DA0, bin, data_8DA0] + - [0x00008E80, bin, data_8E80] #.data, code_4D00] + - [0x00008F10, .data, code_50D0] + - [0x00008F60, bin, data_8F60] + - [0x00009640, .rodata, code_160] + - [0x00009660, .rodata, code_950] + - [0x000096C0, .rodata, code_1B20] + - [0x000096F0, .rodata, code_2270] + - [0x00009720, .rodata, code_2B00] + - [0x00009750, .rodata, code_3310] + - [0x00009770, .rodata, code_3DA0] + - [0x000097B0, .rodata, code_4530] + - [0x000097F0, .rodata, code_4960] + - [0x00009800, .rodata, code_4D00] + - [0x00009830, .rodata, code_50D0] + - [0x00009870, .rodata, code_5540] + - [0x00009890, .rodata, code_5BF0] + - [0x000098D0, .rodata, code_61E0] + - [0x000098F0, .rodata, code_6620] + - [0x00009900, .rodata, code_6AC0] + - [0x00009920, .rodata, code_76C0] + - [0x00009930, .rodata, code_7BF0] + - [0x00009940, .rodata, code_8050] + - [0x000099E0] \ No newline at end of file diff --git a/subyaml/CCW.us.v11.yaml b/subyaml/CCW.us.v11.yaml new file mode 100644 index 00000000..e7863e98 --- /dev/null +++ b/subyaml/CCW.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: CCW + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: CCW-code + dir: CCW + type: code + start: 0x00000000 + vram: 0x80385610 + subsegments: + - [0x00000000, asm] + - name: CCW-data + dir: CCW + type: code + start: 0x00008790 + vram: 0x8038DDA0 + subsegments: + - [0x00008790, bin, data_8790] + - [0x00009A10] \ No newline at end of file diff --git a/subyaml/FP.jp.yaml b/subyaml/FP.jp.yaml new file mode 100644 index 00000000..8aa84107 --- /dev/null +++ b/subyaml/FP.jp.yaml @@ -0,0 +1,33 @@ +options: + basename: FP + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: FP-code + dir: FP + type: code + start: 0x00000000 + vram: 0x80386F40 + subsegments: + - [0x00000000, asm] + - name: FP-data + dir: FP + type: code + start: 0x0000B600 + vram: 0x80392540 + subsegments: + - [0x0000B600, bin, data_B600] + - [0x0000CB20] \ No newline at end of file diff --git a/subyaml/FP.pal.yaml b/subyaml/FP.pal.yaml new file mode 100644 index 00000000..ab0cb045 --- /dev/null +++ b/subyaml/FP.pal.yaml @@ -0,0 +1,33 @@ +options: + basename: FP + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt +segments: + - name: FP-code + dir: FP + type: code + start: 0x00000000 + vram: 0x80386DD0 + subsegments: + - [0x00000000, asm] + - name: FP-data + dir: FP + type: code + start: 0x0000B600 + vram: 0x803923D0 + subsegments: + - [0x0000B600, bin, data_B600] + - [0x0000CB20] \ No newline at end of file diff --git a/subyaml/FP.us.v10.yaml b/subyaml/FP.us.v10.yaml new file mode 100644 index 00000000..08c28f9e --- /dev/null +++ b/subyaml/FP.us.v10.yaml @@ -0,0 +1,100 @@ +options: + basename: FP + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.FP.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.FP.us.v10.txt + base_path: . + target_path: build/us.v10/FP.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: + - name: FP-code + dir: FP + type: code + start: 0x00000000 + vram: 0x803863F0 + subsegments: + - [0x0, c, code_0] #DONE + - [0x4D0, c, code_4D0] #DONE + - [0x790, c, code_790] #DONE + - [0xA40, c, code_A40] #DONE + - [0x11F0, c, code_11F0] #DONE + - [0x19E0, c, code_19E0] + - [0x1FF0, c, code_1FF0] #DONE + - [0x2350, c, code_2350] #DONE + - [0x3E00, c, code_3E00] #DONE + - [0x4400, c, code_4400] #DONE + - [0x45D0, c, code_45D0] + - [0x4770, c, code_4770] #DONE + - [0x5CC0, c, code_5CC0] + - [0x6AE0, c, code_6AE0] #DONE + - [0x7980, c, code_7980] #DONE + - [0x8330, c, code_8330] #DONE + - [0x87E0, c, code_87E0] #DONE + - [0x8D00, c, code_8D00] #DONE + - [0x8E20, c, code_8E20] #DONE + - [0x9B10, c, ch/wozzasjig] #DONE + - [0x9EA0, c, code_9EA0] #DONE + - [0xA1C0, c, code_A1C0] #DONE + - [0xA240, c, code_A240] #DONE + - [0xA500, c, code_A500] #DONE + - [0xA880, c, code_A880] #DONE + - [0xABD0, c, code_ABD0] #DONE + - [0xB4D0, c, code_B4D0] #DONE + - name: FP-data + dir: FP + type: code + start: 0x0000B600 + vram: 0x803919F0 + subsegments: + - [0x0000B600, .data, code_0] + - [0x0000B650, .data, code_4D0] + - [0x0000B6A0, .data, code_790] + - [0x0000B760, .data, code_A40] + - [0x0000B790, .data, code_11F0] + - [0x0000B810, .data, code_19E0] + - [0x0000B850, .data, code_1FF0] + - [0x0000B890, .data, code_2350] + - [0x0000BA00, .data, code_3E00] + - [0x0000BAC0, bin, data_BAC0] + - [0x0000BCD0, .data, code_6AE0] + - [0x0000BFA0, .data, code_7980] + - [0x0000C010, bin, data_C010] + - [0x0000C080, .data, code_87E0] + - [0x0000C0B0, .data, code_8D00] + - [0x0000C130, bin, data_C130] + - [0x0000C2D0, .data, code_A1C0] + - [0x0000C300, .data, code_A240] + - [0x0000C340, bin, data_C340] + - [0x0000C4F0, .data, code_ABD0] + - [0x0000C790, .rodata, code_0] + - [0x0000C7A0, .rodata, code_A40] + - [0x0000C800, .rodata, code_11F0] + - [0x0000C820, .rodata, code_19E0] + - [0x0000C830, .rodata, code_1FF0] + - [0x0000C840, .rodata, code_2350] + - [0x0000C920, .rodata, code_3E00] + - [0x0000C940, .rodata, code_4770] + - [0x0000C990, bin, data_C990] + - [0x0000CA10, .rodata, code_6AE0] + - [0x0000CA50, .rodata, code_7980] + - [0x0000CA80, .rodata, code_87E0] + - [0x0000CA90, .rodata, code_8E20] + - [0x0000CAE0, .rodata, ch/wozzasjig] + - [0x0000CB00, .rodata, code_A500] + - [0x0000CB10, .rodata, code_A880] + - [0x0000CB20] \ No newline at end of file diff --git a/subyaml/FP.us.v11.yaml b/subyaml/FP.us.v11.yaml new file mode 100644 index 00000000..feb707a7 --- /dev/null +++ b/subyaml/FP.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: FP + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: FP-code + dir: FP + type: code + start: 0x00000000 + vram: 0x80385610 + subsegments: + - [0x00000000, asm] + - name: FP-data + dir: FP + type: code + start: 0x0000B600 + vram: 0x80390C10 + subsegments: + - [0x0000B600, bin, data_B600] + - [0x0000CB20] \ No newline at end of file diff --git a/subyaml/GV.jp.yaml b/subyaml/GV.jp.yaml new file mode 100644 index 00000000..e8117046 --- /dev/null +++ b/subyaml/GV.jp.yaml @@ -0,0 +1,33 @@ +options: + basename: GV + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: GV-code + dir: GV + type: code + start: 0x00000000 + vram: 0x80386F40 + subsegments: + - [0x00000000, asm] + - name: GV-data + dir: GV + type: code + start: 0x0000A8F0 + vram: 0x80391830 + subsegments: + - [0x0000A8F0, bin, data_A8F0] + - [0x0000B740] \ No newline at end of file diff --git a/subyaml/GV.pal.yaml b/subyaml/GV.pal.yaml new file mode 100644 index 00000000..28c4d697 --- /dev/null +++ b/subyaml/GV.pal.yaml @@ -0,0 +1,33 @@ +options: + basename: GV + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt +segments: + - name: GV-code + dir: GV + type: code + start: 0x00000000 + vram: 0x80386DD0 + subsegments: + - [0x00000000, asm] + - name: GV-data + dir: GV + type: code + start: 0x0000A7E0 + vram: 0x803915B0 + subsegments: + - [0x0000A7E0, bin, data_A7E0] + - [0x0000B630] \ No newline at end of file diff --git a/subyaml/GV.us.v10.yaml b/subyaml/GV.us.v10.yaml new file mode 100644 index 00000000..b346fd6f --- /dev/null +++ b/subyaml/GV.us.v10.yaml @@ -0,0 +1,118 @@ +options: + basename: GV + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.GV.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.GV.us.v10.txt + base_path: . + target_path: build/us.v10/GV.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: + - name: GV-code + dir: GV + type: code + start: 0x00000000 + vram: 0x803863F0 + subsegments: + - [0x0, c, code_0] #DONE + - [0x230, c, code_230] #DONE + - [0xD60, c, code_D60] #DONE + - [0x1570, c, code_1570] #DONE + - [0x1E80, c, code_1E80] #DONE + - [0x24D0, c, code_24D0] #DONE + - [0x2730, c, code_2730] #DONE + - [0x2B80, c, code_2B80] #DONE + - [0x2EE0, c, code_2EE0] #DONE + - [0x30C0, c, code_30C0] #DONE + - [0x3630, c, code_3630] #DONE + - [0x3AA0, c, code_3AA0] #DONE + - [0x3B10, c, code_3B10] #DONE + - [0x3BB0, c, code_3BB0] #DONE + - [0x3D90, c, code_3D90] #DONE + - [0x43B0, c, code_43B0] #DONE + - [0x4740, c, code_4740] #DONE + - [0x5570, c, code_5570] #DONE + - [0x61E0, c, code_61E0] #DONE + - [0x6370, c, code_6370] #DONE + - [0x6F80, c, code_6F80] #DONE + - [0x7060, c, code_7060] #DONE + - [0x7530, c, code_7530] #DONE + - [0x7D50, c, code_7D50] #DONE + - [0x7DB0, c, code_7DB0] #DONE + - [0x7FC0, c, code_7FC0] #DONE + - [0x7FF0, c, code_7FF0] #DONE + - [0x9130, c, code_9130] #DONE + - [0x9860, c, code_9860] #DONE + - [0x9B70, c, code_9B70] #DONE + - [0x9C10, c, code_9C10] #DONE + - [0x9DB0, c, code_9DB0] #DONE + - [0xA490, c, code_A490] #DONE + - name: GV-data + dir: GV + type: code + start: 0x0000A7E0 + vram: 0x80390BD0 + subsegments: + - [0x0000A7E0, .data, code_0] + - [0x0000A830, .data, code_230] + - [0x0000A890, .data, code_D60] + - [0x0000A8C0, .data, code_1570] + - [0x0000A910, .data, code_1E80] + - [0x0000A940, .data, code_24D0] + - [0x0000A970, .data, code_2730] + - [0x0000A9A0, .data, code_2B80] + - [0x0000A9D0, .data, code_2EE0] + - [0x0000AA10, .data, code_30C0] + - [0x0000AAB0, .data, code_3630] + - [0x0000AB10, .data, code_3AA0] + - [0x0000AB40, .data, code_3B10] + - [0x0000AB50, .data, code_3BB0] + - [0x0000ABB0, .data, code_3D90] + - [0x0000AC10, .data, code_43B0] + - [0x0000AC50, .data, code_4740] + - [0x0000AD30, .data, code_5570] + - [0x0000ADA0, .data, code_61E0] + - [0x0000AE00, .data, code_6370] + - [0x0000AE70, .data, code_6F80] + - [0x0000AEA0, .data, code_7060] + - [0x0000AEF0, .data, code_7530] + - [0x0000AF50, .data, code_7DB0] + - [0x0000AF90, .data, code_7FC0] + - [0x0000AFF0, .data, code_7FF0] + - [0x0000B1D0, .data, code_9130] + - [0x0000B230, .data, code_9860] + - [0x0000B260, .data, code_9DB0] + - [0x0000B300, .rodata, code_230] + - [0x0000B320, .rodata, code_D60] + - [0x0000B330, .rodata, code_1570] + - [0x0000B350, .rodata, code_1E80] + - [0x0000B390, .rodata, code_2730] + - [0x0000B3A0, .rodata, code_30C0] + - [0x0000B3B0, .rodata, code_3BB0] + - [0x0000B3C0, .rodata, code_3D90] + - [0x0000B3D0, .rodata, code_43B0] + - [0x0000B3E0, .rodata, code_4740] + - [0x0000B450, .rodata, code_5570] + - [0x0000B4A0, .rodata, code_6370] + - [0x0000B500, .rodata, code_7060] + - [0x0000B520, .rodata, code_7530] + - [0x0000B550, .rodata, code_7FF0] + - [0x0000B5B0, .rodata, code_9130] + - [0x0000B5D0, .rodata, code_9860] + - [0x0000B610, .rodata, code_9DB0] + - [0x0000B620, .rodata, code_A490] + - [0x0000B630] \ No newline at end of file diff --git a/subyaml/GV.us.v11.yaml b/subyaml/GV.us.v11.yaml new file mode 100644 index 00000000..a1364bb6 --- /dev/null +++ b/subyaml/GV.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: GV + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: GV-code + dir: GV + type: code + start: 0x00000000 + vram: 0x80385610 + subsegments: + - [0x00000000, asm] + - name: GV-data + dir: GV + type: code + start: 0x0000A820 + vram: 0x8038FE30 + subsegments: + - [0x0000A820, bin, data_A820] + - [0x0000B670] \ No newline at end of file diff --git a/subyaml/MM.jp.yaml b/subyaml/MM.jp.yaml new file mode 100644 index 00000000..ec9ad841 --- /dev/null +++ b/subyaml/MM.jp.yaml @@ -0,0 +1,33 @@ +options: + basename: MM + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: MM-code + dir: MM + type: code + start: 0x00000000 + vram: 0x80386F40 + subsegments: + - [0x00000000, asm] + - name: MM-data + dir: MM + type: code + start: 0x000034A0 + vram: 0x8038A3E0 + subsegments: + - [0x000034A0, bin, data_34A0] + - [0x00003890] \ No newline at end of file diff --git a/subyaml/MM.pal.yaml b/subyaml/MM.pal.yaml new file mode 100644 index 00000000..87718872 --- /dev/null +++ b/subyaml/MM.pal.yaml @@ -0,0 +1,33 @@ +options: + basename: MM + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt +segments: + - name: MM-code + dir: MM + type: code + start: 0x00000000 + vram: 0x80386DD0 + subsegments: + - [0x00000000, asm] + - name: MM-data + dir: MM + type: code + start: 0x000034A0 + vram: 0x8038A270 + subsegments: + - [0x000034A0, bin, data_34A0] + - [0x00003890] \ No newline at end of file diff --git a/subyaml/MM.us.v10.yaml b/subyaml/MM.us.v10.yaml new file mode 100644 index 00000000..ea18f7dc --- /dev/null +++ b/subyaml/MM.us.v10.yaml @@ -0,0 +1,66 @@ +options: + basename: MM + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.MM.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.MM.us.v10.txt + base_path: . + target_path: build/us.v10/MM.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: + - name: MM-code + dir: MM + type: code + start: 0x00000000 + vram: 0x803863F0 + subsegments: + - [0x0, c, ch/orangepad] + - [0x570, c, ch/hut] + - [0x8B0, c, ch/chimpystump] + - [0xAE0, c, ch/conga] + - [0x1AD0, c, code_1AD0] + - [0x1BA0, c, ch/orange] + - [0x1F10, c, ch/lmonkey] #chimpy + - [0x24C0, c, code_24C0] + - [0x25B0, c, ch/grublin] + - [0x2740, c, ch/jujuhitbox] + - [0x2BE0, c, ch/juju] + - name: MM-data + dir: MM + type: code + start: 0x000034A0 + vram: 0x80389890 + subsegments: + - [0x34A0, .data, ch/orangepad] + - [0x34D0, .data, ch/hut] + - [0x3530, .data, ch/chimpystump] + - [0x3560, .data, ch/conga] + - [0x35D0, .data, code_1AD0] + - [0x35E0, .data, ch/orange] + - [0x3620, .data, ch/lmonkey] + - [0x3670, .data, ch/grublin] + - [0x36F0, .data, ch/jujuhitbox] + - [0x3720, .data, ch/juju] + - [0x3750, .rodata, ch/orangepad] + - [0x3760, .rodata, ch/hut] + - [0x3770, .rodata, ch/conga] + - [0x37F0, .rodata, ch/orange] + - [0x3810, .rodata, ch/lmonkey] + - [0x3860, .rodata, ch/grublin] + - [0x3870, .rodata, ch/jujuhitbox] + - [0x3880, .rodata, ch/juju] + - [0x00003890] \ No newline at end of file diff --git a/subyaml/MM.us.v11.yaml b/subyaml/MM.us.v11.yaml new file mode 100644 index 00000000..f480d23a --- /dev/null +++ b/subyaml/MM.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: MM + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: MM-code + dir: MM + type: code + start: 0x00000000 + vram: 0x80385610 + subsegments: + - [0x00000000, asm] + - name: MM-data + dir: MM + type: code + start: 0x000034A0 + vram: 0x80388AB0 + subsegments: + - [0x000034A0, bin, data_34A0] + - [0x00003890] \ No newline at end of file diff --git a/subyaml/MMM.jp.yaml b/subyaml/MMM.jp.yaml new file mode 100644 index 00000000..5b03da65 --- /dev/null +++ b/subyaml/MMM.jp.yaml @@ -0,0 +1,33 @@ +options: + basename: MMM + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: MMM-code + dir: MMM + type: code + start: 0x00000000 + vram: 0x80386F40 + subsegments: + - [0x00000000, asm] + - name: MMM-data + dir: MMM + type: code + start: 0x000055F0 + vram: 0x8038C530 + subsegments: + - [0x000055F0, bin, data_55F0] + - [0x000060D0] \ No newline at end of file diff --git a/subyaml/MMM.pal.yaml b/subyaml/MMM.pal.yaml new file mode 100644 index 00000000..458902bb --- /dev/null +++ b/subyaml/MMM.pal.yaml @@ -0,0 +1,33 @@ +options: + basename: MMM + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt +segments: + - name: MMM-code + dir: MMM + type: code + start: 0x00000000 + vram: 0x80386DD0 + subsegments: + - [0x00000000, asm] + - name: MMM-data + dir: MMM + type: code + start: 0x000055F0 + vram: 0x8038C3C0 + subsegments: + - [0x000055F0, bin, data_55F0] + - [0x000060D0] \ No newline at end of file diff --git a/subyaml/MMM.us.v10.yaml b/subyaml/MMM.us.v10.yaml new file mode 100644 index 00000000..a6ded42c --- /dev/null +++ b/subyaml/MMM.us.v10.yaml @@ -0,0 +1,77 @@ +options: + basename: MMM + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.MMM.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.MMM.us.v10.txt + base_path: . + target_path: build/us.v10/MMM.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: + - name: MMM-code + dir: MMM + type: code + start: 0x00000000 + vram: 0x803863F0 + subsegments: + - [0x0000, c, ch/loggo] #DONE + - [0x0570, c, ch/napper] #DONE + - [0x0DC0, c, code_DC0] #DONE + - [0x1020, c, ch/motzhand] #DONE + - [0x16B0, c, code_16B0] #DONE + - [0x2040, c, code_2040] #DONE + - [0x2F60, c, code_2F60] #DONE + - [0x3120, c, code_3120] #DONE + - [0x3420, c, code_3420] #DONE + - [0x3D50, c, code_3D50] #DONE + - [0x47D0, c, code_47D0] #DONE + - [0x5000, c, code_5000] #DONE + - name: MMM-data + dir: MMM + type: code + start: 0x000055F0 + vram: 0x8038B9E0 + subsegments: + - [0x000055F0, .data, ch/loggo] + - [0x00005630, .data, ch/napper] + - [0x00005660, .data, code_DC0] + - [0x000056A0, .data, ch/motzhand] + - [0x000056E0, bin, data_56E0] #.data, code_16B0] + - [0x000057F0, .data, code_2040] + - [0x00005A40, .data, code_2F60] + - [0x00005B30, .data, code_3420] + - [0x00005E00, .data, code_3D50] + - [0x00005F10, bin, data_5F10] + - [0x00005F20, .data, code_5000] + - [0x00005F50, .rodata, ch/loggo] + - [0x00005F80, .rodata, ch/napper] + - [0x00005FA0, .rodata, ch/motzhand] + - [0x00005FC0, .rodata, code_16B0] + - [0x00006010, .rodata, code_2040] + - [0x00006050, .rodata, code_3120] + - [0x00006060, .rodata, code_3420] + - [0x00006070, .rodata, code_3D50] + - [0x00006090, .rodata, code_47D0] + - [0x000060C0, .rodata, code_5000] + - name: MMM-bss + dir: MMM + type: code + start: 0x000060D0 + vram: 0x8038C4C0 + subsegments: + - [0x60D0, .bss, code_2040] + - [0x000060D0] \ No newline at end of file diff --git a/subyaml/MMM.us.v11.yaml b/subyaml/MMM.us.v11.yaml new file mode 100644 index 00000000..484b3904 --- /dev/null +++ b/subyaml/MMM.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: MMM + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: MMM-code + dir: MMM + type: code + start: 0x00000000 + vram: 0x80385610 + subsegments: + - [0x00000000, asm] + - name: MMM-data + dir: MMM + type: code + start: 0x000055F0 + vram: 0x8038AC00 + subsegments: + - [0x000055F0, bin, data_55F0] + - [0x000060D0] \ No newline at end of file diff --git a/subyaml/RBB.jp.yaml b/subyaml/RBB.jp.yaml new file mode 100644 index 00000000..0477197c --- /dev/null +++ b/subyaml/RBB.jp.yaml @@ -0,0 +1,33 @@ +options: + basename: RBB + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: RBB-code + dir: RBB + type: code + start: 0x00000000 + vram: 0x80386F40 + subsegments: + - [0x00000000, asm] + - name: RBB-data + dir: RBB + type: code + start: 0x00009C80 + vram: 0x80390BC0 + subsegments: + - [0x00009C80, bin, data_9C80] + - [0x0000AEA0] \ No newline at end of file diff --git a/subyaml/RBB.pal.yaml b/subyaml/RBB.pal.yaml new file mode 100644 index 00000000..82d5ec07 --- /dev/null +++ b/subyaml/RBB.pal.yaml @@ -0,0 +1,33 @@ +options: + basename: RBB + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt +segments: + - name: RBB-code + dir: RBB + type: code + start: 0x00000000 + vram: 0x80386DD0 + subsegments: + - [0x00000000, asm] + - name: RBB-data + dir: RBB + type: code + start: 0x00009C80 + vram: 0x80390A50 + subsegments: + - [0x00009C80, bin, data_9C80] + - [0x0000AEA0] \ No newline at end of file diff --git a/subyaml/RBB.us.v10.yaml b/subyaml/RBB.us.v10.yaml new file mode 100644 index 00000000..3259c98f --- /dev/null +++ b/subyaml/RBB.us.v10.yaml @@ -0,0 +1,121 @@ +options: + basename: RBB + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.RBB.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.RBB.us.v10.txt + base_path: . + target_path: build/us.v10/RBB.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: + - name: RBB-code + dir: RBB + type: code + start: 0x00000000 + vram: 0x803863F0 + subsegments: + - [0x00000000, c, code_0] + - [0x640, c, code_640] + - [0xCA0, c, code_CA0] + - [0x1570, c, code_1570] + - [0x1FC0, c, code_1FC0] + - [0x27E0, c, code_27E0] + - [0x2A70, c, code_2A70] + - [0x2E90, c, code_2E90] + - [0x34B0, c, code_34B0] + - [0x36A0, c, code_36A0] + - [0x3CB0, c, code_3CB0] + - [0x40F0, c, code_40F0] + - [0x47D0, c, code_47D0] + - [0x4C70, c, code_4C70] + - [0x5060, c, code_5060] + - [0x52F0, c, code_52F0] + - [0x5490, c, code_5490] + - [0x5AB0, c, code_5AB0] + - [0x5C10, c, code_5C10] + - [0x5F10, c, code_5F10] + - [0x5F80, c, code_5F80] + - [0x7A60, c, code_7A60] + - [0x7B20, c, code_7B20] + - [0x7FD0, c, code_7FD0] + - [0x8520, c, code_8520] + - [0x9670, c, code_9670] + - [0x9840, c, code_9840] + - [0x99F0, c, code_99F0] + - name: RBB-data + dir: RBB + type: code + start: 0x00009C60 + vram: 0x80390050 + subsegments: + - [0x00009C60, .data, code_0] + - [0x00009CE0, .data, code_640] + - [0x00009E10, .data, code_CA0] + - [0x00009E80, .data, code_1570] + - [0x00009F90, .data, code_1FC0] + - [0x00009FC0, .data, code_27E0] + - [0x0000A040, .data, code_2A70] + - [0x0000A140, .data, code_2E90] + - [0x0000A2C0, .data, code_34B0] + - [0x0000A2F0, .data, code_36A0] + - [0x0000A330, .data, code_3CB0] + - [0x0000A370, .data, code_40F0] + - [0x0000A480, .data, code_47D0] + - [0x0000A560, .data, code_4C70] + - [0x0000A660, .data, code_5060] + - [0x0000A690, .data, code_52F0] + - [0x0000A6C0, .data, code_5490] + - [0x0000A6F0, .data, code_5AB0] + - [0x0000A720, .data, code_5C10] + - [0x0000A750, .data, code_5F10] + - [0x0000A780, .data, code_5F80] + - [0x0000A900, .data, code_7A60] + - [0x0000A930, .data, code_7B20] + - [0x0000A960, .data, code_7FD0] + - [0x0000A990, .data, code_8520] + - [0x0000AA10, .data, code_9670] + - [0x0000AA40, .data, code_9840] + - [0x0000AA90, .rodata, code_640] + - [0x0000AAA0, .rodata, code_CA0] + - [0x0000AAC0, .rodata, code_1570] + - [0x0000AB20, .rodata, code_1FC0] + - [0x0000AB80, .rodata, code_2A70] + - [0x0000AB90, .rodata, code_34B0] + - [0x0000ABA0, .rodata, code_36A0] + - [0x0000ABC0, .rodata, code_3CB0] + - [0x0000ABD0, .rodata, code_4C70] + - [0x0000ABE0, .rodata, code_5060] + - [0x0000AC00, .rodata, code_5490] + - [0x0000ACD0, .rodata, code_5AB0] + - [0x0000ACE0, .rodata, code_5C10] + - [0x0000ACF0, .rodata, code_5F80] + - [0x0000AD80, .rodata, code_7B20] + - [0x0000ADB0, .rodata, code_7FD0] + - [0x0000AE00, .rodata, code_8520] + - [0x0000AE70, .rodata, code_9670] + - name: RBB-bss + dir: RBB + type: code + start: 0x0000AE80 + vram: 0x80391270 + subsegments: + - [0xAE80, .bss, code_5F80] + - [0xAE80, .bss, code_8520] + - [0xAE80, .bss, code_8520] + - [0xAE80, .bss, code_9670] + - [0xAE80, .bss, code_99F0] + - [0x0000AE80] \ No newline at end of file diff --git a/subyaml/RBB.us.v11.yaml b/subyaml/RBB.us.v11.yaml new file mode 100644 index 00000000..647408dc --- /dev/null +++ b/subyaml/RBB.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: RBB + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: RBB-code + dir: RBB + type: code + start: 0x00000000 + vram: 0x80385610 + subsegments: + - [0x00000000, asm] + - name: RBB-data + dir: RBB + type: code + start: 0x00009C80 + vram: 0x8038F290 + subsegments: + - [0x00009C80, bin, data_9C80] + - [0x0000AEA0] \ No newline at end of file diff --git a/subyaml/SM.jp.yaml b/subyaml/SM.jp.yaml new file mode 100644 index 00000000..26c6c26d --- /dev/null +++ b/subyaml/SM.jp.yaml @@ -0,0 +1,33 @@ +options: + basename: SM + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: SM-code + dir: SM + type: code + start: 0x00000000 + vram: 0x80386F40 + subsegments: + - [0x00000000, asm] + - name: SM-data + dir: SM + type: code + start: 0x000046D0 + vram: 0x8038B610 + subsegments: + - [0x000046D0, bin, data_46D0] + - [0x00004F30] \ No newline at end of file diff --git a/subyaml/SM.pal.yaml b/subyaml/SM.pal.yaml new file mode 100644 index 00000000..62db85d6 --- /dev/null +++ b/subyaml/SM.pal.yaml @@ -0,0 +1,72 @@ +options: + basename: SM + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt + undefined_funcs_auto_path: undefined_funcs_auto.SM.pal.txt + undefined_syms_auto_path: undefined_syms_auto.SM.pal.txt + base_path: . + target_path: build/pal/SM.pal.bin + asset_path: bin + build_path: build/pal +segments: + - name: SM-code + dir: SM + type: code + start: 0x00000000 + vram: 0x80386DD0 + subsegments: + - [0x00000000, c, code_0] + - [0xF0, c, code_F0] + - [0x5B0, c, code_5B0] + - [0xBF0, c, code_BF0] + - [0xD60, c, ch/attacktutorial] + - [0x1520, c, ch/vegetables] + - [0x2900, c, code_2900] + - [0x2990, c, code_2990] + - [0x3FC0, c, code_3FC0] + - [0x4070, c, code_4070] + - [0x44D0, c, code_44D0] + - [0x46C0, c, code_46C0] + - name: SM-data + dir: SM + type: code + start: 0x00004910 + vram: 0x8038B6E0 + subsegments: + - [0x00004910, .data, code_0] + - [0x00004930, .data, code_F0] + - [0x00004940, .data, code_5B0] + - [0x00004A40, .data, code_BF0] + - [0x00004A70, .data, ch/attacktutorial] + - [0x00004AA0, .data, ch/vegetables] + - [0x00004DB0, .data, code_2990] + - [0x00004E40, .data, code_3FC0] + - [0x00004F00, .data, code_4070] + - [0x00004F30, .data, code_44D0] + - [0x00004F60, .rodata, code_5B0] + - [0x00004F80, .rodata, ch/attacktutorial] + - [0x00005020, .rodata, ch/vegetables] + - [0x00005050, .rodata, code_2990] + - [0x00005160, .rodata, code_44D0] + - name: SM-bss + dir: SM + type: code + start: 0x00005160 + vram: 0x8038BF30 + subsegments: + - [0x00005160, .bss, code_F0] + - [0x00005160, .bss, code_46C0] + - [0x00005160] diff --git a/subyaml/SM.us.v10.yaml b/subyaml/SM.us.v10.yaml new file mode 100644 index 00000000..2109e319 --- /dev/null +++ b/subyaml/SM.us.v10.yaml @@ -0,0 +1,71 @@ +options: + basename: SM + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.SM.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.SM.us.v10.txt + base_path: . + target_path: build/us.v10/SM.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: + - name: SM-code + dir: SM + type: code + start: 0x00000000 + vram: 0x803863F0 + subsegments: + - [0x00000000, c, code_0] + - [0xF0, c, code_F0] + - [0x5B0, c, code_5B0] + - [0xBF0, c, code_BF0] + - [0xD60, c, ch/attacktutorial] + - [0x1520, c, ch/vegetables] + - [0x2900, c, code_2900] + - [0x2990, c, code_2990] + - [0x3FC0, c, code_3FC0] + - [0x4070, c, code_4070] + - [0x44D0, c, code_44D0] + - [0x46C0, c, code_46C0] + - name: SM-data + dir: SM + type: code + start: 0x000046D0 + vram: 0x8038AAC0 + subsegments: + - [0x000046D0, .data, code_0] + - [0x000046F0, .data, code_F0] + - [0x00004700, .data, code_5B0] + - [0x00004800, .data, code_BF0] + - [0x00004830, .data, ch/attacktutorial] + - [0x00004860, .data, ch/vegetables] + - [0x00004B70, .data, code_2990] + - [0x00004C00, .data, code_3FC0] + - [0x00004CC0, .data, code_4070] + - [0x00004CF0, .data, code_44D0] + - [0x00004D20, .rodata, code_5B0] + - [0x00004D40, .rodata, ch/attacktutorial] + - [0x00004DE0, .rodata, ch/vegetables] + - [0x00004E10, .rodata, code_2990] + - [0x00004F20, .rodata, code_44D0] + - name: SM-bss + dir: SM + type: code + start: 0x00004F30 + vram: 0x8038B320 + subsegments: + - [0x00004F30, .bss, code_F0] + - [0x00004F30] \ No newline at end of file diff --git a/subyaml/SM.us.v11.yaml b/subyaml/SM.us.v11.yaml new file mode 100644 index 00000000..73f8e347 --- /dev/null +++ b/subyaml/SM.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: SM + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: SM-code + dir: SM + type: code + start: 0x00000000 + vram: 0x80385610 + subsegments: + - [0x00000000, asm] + - name: SM-data + dir: SM + type: code + start: 0x000046D0 + vram: 0x80389CE0 + subsegments: + - [0x000046D0, bin, data_46D0] + - [0x00004F30] \ No newline at end of file diff --git a/subyaml/TTC.jp.yaml b/subyaml/TTC.jp.yaml new file mode 100644 index 00000000..75e04c14 --- /dev/null +++ b/subyaml/TTC.jp.yaml @@ -0,0 +1,33 @@ +options: + basename: TTC + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: TTC-code + dir: TTC + type: code + start: 0x00000000 + vram: 0x80386F40 + subsegments: + - [0x00000000, asm] + - name: TTC-data + dir: TTC + type: code + start: 0x00005FF0 + vram: 0x8038CF30 + subsegments: + - [0x00005FF0, bin, data_5FF0] + - [0x00007330] \ No newline at end of file diff --git a/subyaml/TTC.pal.yaml b/subyaml/TTC.pal.yaml new file mode 100644 index 00000000..9df26d9f --- /dev/null +++ b/subyaml/TTC.pal.yaml @@ -0,0 +1,33 @@ +options: + basename: TTC + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt +segments: + - name: TTC-code + dir: TTC + type: code + start: 0x00000000 + vram: 0x80386DD0 + subsegments: + - [0x00000000, asm] + - name: TTC-data + dir: TTC + type: code + start: 0x00005FC0 + vram: 0x8038CD90 + subsegments: + - [0x00005FC0, bin, data_5FC0] + - [0x00007300] \ No newline at end of file diff --git a/subyaml/TTC.us.v10.yaml b/subyaml/TTC.us.v10.yaml new file mode 100644 index 00000000..4854fd6b --- /dev/null +++ b/subyaml/TTC.us.v10.yaml @@ -0,0 +1,69 @@ +options: + basename: TTC + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.TTC.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.TTC.us.v10.txt + base_path: . + target_path: build/us.v10/TTC.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: + - name: TTC-code + dir: TTC + type: code + start: 0x00000000 + vram: 0x803863F0 + subsegments: + - [0x0, c, code_0] #DONE + - [0x10A0, c, code_10A0] #DONE + - [0x19D0, c, code_19D0] #DONE + - [0x26D0, c, code_26D0] #DONE + - [0x2B80, c, code_2B80] #DONE + - [0x3040, c, code_3040] #DONE + - [0x30D0, c, ch/lockup] #DONE + - [0x35D0, c, code_35D0] #DONE + - [0x3E30, c, code_3E30] + - [0x5BD0, c, ch/treasure] #DONE + - name: TTC-data + dir: TTC + type: code + start: 0x00005FC0 + vram: 0x8038C3B0 + subsegments: + - [0x00005FC0, bin, ttc_data_5FC0] + - [0x00006370, .data, ch/lockup] + - [0x00006430, .data, code_35D0] + - [0x00006590, bin, ttc_data_6590] + - [0x000068A0, .data, ch/treasure] + - [0x000068F0, .rodata, code_0] + - [0x00006950, .rodata, code_10A0] + - [0x00006980, .rodata, code_19D0] + - [0x000069A0, .rodata, code_26D0] + - [0x000069E0, bin, ttc_data_69E0] + - [0x00006A00, .rodata, ch/lockup] + - [0x00006A30, .rodata, code_35D0] #- [0x6A30, bin, ttc_data_6A30] # + - [0x00006A60, bin, data_6A60] + - [0x000072B0, .rodata, ch/treasure] + - name: TTC-bss + dir: TTC + type: code + start: 0x00007300 + vram: 0x8038D6F0 + subsegments: + - [0x7300, .bss, code_3040] + - [0x7300, .bss, code_35D0] + - [0x00007300] diff --git a/subyaml/TTC.us.v11.yaml b/subyaml/TTC.us.v11.yaml new file mode 100644 index 00000000..f1164f67 --- /dev/null +++ b/subyaml/TTC.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: TTC + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: TTC-code + dir: TTC + type: code + start: 0x00000000 + vram: 0x80385610 + subsegments: + - [0x00000000, asm] + - name: TTC-data + dir: TTC + type: code + start: 0x00005FC0 + vram: 0x8038B5D0 + subsegments: + - [0x00005FC0, bin, data_5FC0] + - [0x00007300] \ No newline at end of file diff --git a/subyaml/core1.jp.yaml b/subyaml/core1.jp.yaml new file mode 100644 index 00000000..4cabd328 --- /dev/null +++ b/subyaml/core1.jp.yaml @@ -0,0 +1,33 @@ +options: + basename: core1 + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: core1-code + dir: core1 + type: code + start: 0x00000000 + vram: 0x8023D680 + subsegments: + - [0x00000000, asm] + - name: core1-data + dir: core1 + type: code + start: 0x00036E50 + vram: 0x80275470 + subsegments: + - [0x00036EF0, bin, data_36EF0] + - [0x0003B8F0] \ No newline at end of file diff --git a/subyaml/core1.pal.yaml b/subyaml/core1.pal.yaml new file mode 100644 index 00000000..22d42ea1 --- /dev/null +++ b/subyaml/core1.pal.yaml @@ -0,0 +1,33 @@ +options: + basename: core1 + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt +segments: + - name: core1-code + dir: core1 + type: code + start: 0x00000000 + vram: 0x8023E620 + subsegments: + - [0x00000000, asm] + - name: core1-data + dir: core1 + type: code + start: 0x00036E50 + vram: 0x80275470 + subsegments: + - [0x00036E50, bin, data_36E50] + - [0x0003B850] \ No newline at end of file diff --git a/subyaml/core1.us.v10.yaml b/subyaml/core1.us.v10.yaml new file mode 100644 index 00000000..df0e167c --- /dev/null +++ b/subyaml/core1.us.v10.yaml @@ -0,0 +1,337 @@ +options: + basename: core1 + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.core1.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.core1.us.v10.txt + base_path: . + target_path: build/us.v10/core1.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: +- name: core1-code + dir: core1 + type: code + start: 0x00000000 + vram: 0x8023DA20 # via https://hack64.net/wiki/doku.php?id=player_kazooie:ram_map + subalign: 4 + subsegments: + - [0x00000000, c, code_0] + - [0x0660, c, code_660] #DONE + - [0x07C0, c, inflate] #DONE + - [0x1D00, c, code_1D00] + - [0x2BD0, c, code_2BD0] + - [0x2DA0, c, code_2DA0] #DONE + - [0x2FA0, c, code_2FA0] #DONE + - [0x31C0, c, code_31C0] + - [0x3A70, c, code_3A70] + - [0x7090, c, code_7090] #DONE + - [0x72B0, c, code_72B0] + - [0x7F60, c, code_7F60] + - [0x8C50, c, code_8C50] + - [0x9D30, c, code_9D30] + - [0xCE60, c, done/code_CE60] #DONE + - [0xE360, c, code_E360] + - [0xEAF0, c, code_EAF0] + - [0x11AC0, c, code_11AC0] + - [0x12F10, c, code_12F10] #DONE + - [0x13640, c, code_13640] #DONE + - [0x13680, c, code_13680] + - [0x136D0, c, code_136D0] + - [0x13990, c, code_13990] + - [0x15770, c, code_15770] + - [0x15B30, c, code_15B30] #DONE + - [0x16A50, c, memory] + - [0x18110, c, code_18110] #DONE + - [0x18210, c, code_18210] #DONE + - [0x18310, c, code_18310] #DONE + - [0x18350, c, code_18350] #DONE + - [0x1BE90, c, code_1BE90] #DONE + - [0x1D590, c, done/code_1D590] #DONE + - [0x1D5C0, hasm, code_1D5C0] #DONE + - [0x1D5D0, c, code_1D5D0] #DONE + - [0x1E360, c, done/code_1E360] #DONE + - [0x1E6E0, c, code_1E6E0] #DONE + - [0x1E820, c, code_1E820] + - [0x1E8C0, c, done/code_1E8C0] #DONE + - [0x1E950, c, done/audio/n_synthesizer] #DONE + - [0x1F330, c, done/audio/event] #DONE + - [0x1F610, c, done/audio/n_synaddplayer] #DONE + - [0x1F7E0, c, done/audio/n_synallocvoice] #DONE + - [0x1F9E0, c, done/audio/n_synsetvol] #DONE + - [0x1FA80, c, done/audio/n_synstartvoice] #DONE + - [0x1FB00, c, done/audio/n_synsetpan] #DONE + - [0x1FB80, c, done/audio/n_synsetpitch] #DONE + - [0x1FC00, c, done/audio/n_synsetfxmix] #DONE + - [0x1FC90, c, done/audio/n_synstopvoice] #DONE + - [0x1FD00, c, done/audio/n_synfreevoice] #DONE + - [0x1FDA0, c, audio/n_csplayer] + - [0x21210, c, done/audio/cspsetbank] #DONE + - [0x21250, c, done/audio/cspstop] #DONE + - [0x21280, c, done/audio/n_csq] #DONE + - [0x21920, c, done/audio/cspsetseq] #DONE + - [0x21960, c, done/audio/cspplay] #DONE + - [0x21990, c, done/audio/cspsetvol] #DONE + - [0x219D0, c, done/audio/code_219D0] #DONE + - [0x21A10, c, done/audio/cspsettempo] #DONE + - [0x21A80, c, done/audio/code_21A80] #DONE + - [0x21AB0, c, done/audio/cspgettempo] #DONE + - [0x21AF0, c, done/audio/code_21AF0] #DONE + - [0x21B50, c, done/audio/code_21B50] #DONE + - [0x21C50, c, done/audio/n_synallocfx] #DONE + - [0x21CB0, c, n_reverb] + - [0x22740, c, done/audio/n_auxbus] #DONE + - [0x227F0, c, done/audio/n_drvrNew] #DONE + - [0x22D50, c, done/audio/n_save] #DONE + - [0x22DA0, c, done/audio/n_envresample] #DONE + - [0x22E40, c, code_22E40] + - [0x25360, c, done/audio/n_synstartvoiceparam] #DONE + - [0x25440, c, done/audio/n_mainbus] #DONE + - [0x254C0, c, done/audio/n_load] #DONE + - [0x25680, c, audio/n_adpcm] + - [0x25C40, c, done/audio/n_resample] #DONE + - [0x25E20, c, code_25E20] + - [0x26110, c, code_26110] #DONE + - [0x26120, asm, os/invaldcache] #DONE + - [0x261C0, asm, os/writebackdcacheall] #DONE + - [0x261F0, c, os/initialize] #DONE + - [0x26480, c, done/os/createthread] #DONE + - [0x265D0, c, done/gu/sinf] #DONE + - [0x26790, c, done/audio/cents2ratio] #DONE + - [0x267E0, c, done/audio/heapinit] #DONE + - [0x26820, bin, padding] # 0x60 bytes of zeroes? + - [0x26880, c, done/os/createmesgqueue] #DONE + - [0x268B0, c, done/io/aisetfreq] #DONE + - [0x26A10, c, done/audio/sl] #DONE + - [0x26AD0, c, done/audio/heapalloc] #DONE + - [0x26B30, c, done/os/recvmesg] #DONE + - [0x26C70, c, done/io/aigetlen] #DONE + - [0x26C80, c, done/os/virtualtophysical] #DONE + - [0x26D00, c, done/io/aisetnextbuf] #DONE + - [0x26DB0, c, done/os/pidma] #DONE + - [0x26EC0, c, done/os/stopthread] #DONE + - [0x26F80, c, done/os/startthread] #DONE + - [0x270D0, c, os/writebackdcache] + - [0x27150, hasm, invaldcache] #DONE + - [0x27200, c, done/io/pimgr] #DONE + - [0x27390, c, done/os/destroythread] #DONE + - [0x27490, c, done/os/sendmesg] #DONE + - [0x275E0, c, done/os/settreadpri] #DONE + - [0x276C0, c, gu/mtxutil] + - [0x27930, c, done/gu/sqrtf] #DONE + - [0x27940, c, gu/cosf] + - [0x27AB0, hasm, ultra/setintmask] #DONE + - [0x27B50, c, done/io/dpsetstat] #DONE + - [0x27B60, c, done/io/sptask] #DONE + - [0x27E50, c, done/io/dpgetstat] #DONE + - [0x27E50, c, done/io/vigetcurrframebuf] #DONE + - [0x27EA0, c, done/os/stoptimer] #DONE + - [0x27F90, c, done/os/settimer] #DONE + - [0x28070, c, done/ll] #DONE + - [0x28330, c, done/io/sptaskyielded] #DONE + - [0x283B0, c, done/io/sptaskyield] #DONE + - [0x283D0, c, done/io/visetmode] #DONE + - [0x28440, c, done/os/seteventmesg] #DONE + - [0x284B0, c, done/io/vimgr] #DONE + - [0x28810, c, done/io/visetspecial] #DONE + - [0x289D0, c, done/io/viswapbuf] #DONE + - [0x28A20, c, done/io/visetevent] #DONE + - [0x28A90, c, done/io/vigetnextframebuf] #DONE + - [0x28AD0, c, done/io/viblack] #DONE + - [0x28B40, c, done/gu/ortho] #DONE + - [0x28D00, c, done/gu/translate] #DONE + - [0x28DA0, c, gu/rotate] + - [0x28F90, c, done/io/contreaddata] #DONE + - [0x291F0, c, done/io/controller] #DONE + - [0x295B0, c, done/io/contsetch] #DONE + - [0x29620, c, done/audio/bnkf] #DONE + - [0x29870, c, done/os/gettime] #DONE + - [0x29900, c, done/audio/cseq] #DONE + - [0x2A3C0, c, done/io/motor] #DONE + - [0x2A9E0, c, done/io/pfsinit] #DONE + - [0x2AAA0, hasm, invalicache] #DONE + - [0x2AB20, c, done/io/conteeplongwrite] #DONE + - [0x2AC50, c, done/io/conteeplongread] #DONE + - [0x2ACE0, c, done/io/piread] #DONE + - [0x2AD20, c, done/audio/copy] #DONE + - [0x2ADA0, c, done/audio/drvrNew] #DONE + - [0x2B540, c, done/audio/reverb] #DONE + - [0x2C190, c, done/syncprintf] #DONE + - [0x2C1D0, c, done/audio/seq] #DONE + - [0x2C7F0, hasm, setsr] #DONE + - [0x2C800, hasm, getsr] #DONE + - [0x2C810, hasm, setfpccsr] #DONE + - [0x2C820, c, done/io/sirawread] #DONE + - [0x2C870, c, done/io/sirawwrite] #DONE + - [0x2C8C0, c, exceptasm] + - [0x2D230, c, done/io/pirawread] #DONE + - [0x2D290, hasm, interrupt] + - [0x2D2D0, c, done/os/thread] #DONE + - [0x2D310, c, done/audio/synthesizer] #DONE + - [0x2D9F0, c, done/audio/syndelete] #DONE + - [0x2DA00, hasm, probetlb] + - [0x2DAC0, c, done/io/ai] #DONE + - [0x2DAF0, c, done/os/jammesg] #DONE + - [0x2DC40, c, done/io/pigetcmdq] #DONE + - [0x2DC70, c, done/io/cartrominit] #DONE + - [0x2DD70, c, done/io/leodiskinit] #DONE + - [0x2DE70, c, done/io/piacs] #DONE + - [0x2DF30, c, done/os/getthreadpri] #DONE + - [0x2DF50, c, done/io/pirawdma] #DONE + - [0x2E030, c, done/io/epirawdma] #DONE + - [0x2E260, c, done/io/devmgr] #DONE + - [0x2E6F0, hasm, bcopy] #DONE + - [0x2EA00, c, done/io/spsetstat] #DONE + - [0x2EA10, c, done/io/spsetpc] #DONE + - [0x2EA50, c, done/io/sprawdma] #DONE + - [0x2EAE0, c, done/io/sp] #DONE + - [0x2EB10, c, done/io/vi] #DONE + - [0x2EC50, c, done/os/timerintr] #DONE + - [0x2F050, hasm, setcompare] #DONE + - [0x2F060, c, done/io/spgetstat] #DONE + - [0x2F070, c, done/io/vigetcurrcontext] #DONE + - [0x2F080, c, done/io/viswapcontext] #DONE + - [0x2F3E0, hasm, getcount] #DONE + - [0x2F3F0, c, done/gu/normalize] #DONE + - [0x2F480, c, done/io/siacs] #DONE + - [0x2F540, c, done/io/sirawdma] #DONE + - [0x2F5F0, c, done/io/pfsisplug] #DONE + - [0x2F960, c, done/io/crc] #DONE + - [0x2FAE0, c, done/io/contramwrite] #DONE + - [0x2FE60, c, done/io/contramread] #DONE + - [0x301F0, c, done/io/pfsgetstatus] #DONE + - [0x30300, c, done/io/contpfs] #DONE + - [0x31060, c, done/io/pfschecker] #DONE + - [0x31AC0, c, done/io/conteepwrite] #DONE + - [0x32010, c, done/io/conteepread] #DONE + - [0x32370, c, done/audio/filter] #DONE + - [0x32390, c, done/audio/env] #DONE + - [0x32F10, c, done/audio/load] #DONE + - [0x33A60, c, done/audio/resample] #DONE + - [0x33D60, c, done/audio/auxbus] #DONE + - [0x33E70, c, done/audio/mainbus] #DONE + - [0x33FC0, c, done/audio/save] #DONE + - [0x34080, c, done/io/si] #DONE + - [0x340B0, c, done/io/leointerrupt] #DONE + - [0x34930, c, done/audio/synallocfx] #DONE + - [0x349D0, c, done/os/resetglobalintmask] #DONE + - [0x34A30, c, done/io/epirawwrite] #DONE + - [0x34A80, c, done/io/epirawread] #DONE + - [0x34AD0, c, done/os/setglobalintmask] #DONE + - [0x34B20, c, done/os/yieldthread] #DONE +- name: core1-mips3 + dir: core1 + type: code + start: 0x34B70 + vram: 0x80272590 + subsegments: + - [0x34B70, bin, data_34B70] +- name: core1-data + dir: core1 + type: code + start: 0x000037BF0 + vram: 0x80275610 + subsegments: + - [0x37BF0, bin, data_37BF0] #data Section + - [0x37C50, .data, code_660] + - [0x37D50, .data, code_1D00] + - [0x37E30, bin, data_37E30] #data Section + - [0x37E40, .data, code_2FA0] + - [0x37E50, .data, code_31C0] + - [0x37E60, bin, data_37E60] + - [0x381F0, bin, data_381F0] # .data, done/code_CE60] + - [0x38260, bin, data_38260] + - [0x38BA0, .data, code_18310] + - [0x39290, bin, data_39290] + - [0x39470, .data, done/audio/n_drvrNew] + - [0x39600, bin, data_39600] + - [0x39730, .data, done/io/aisetnextbuf] + - [0x39740, .data, done/io/pimgr] + - [0x39770, .data, done/io/vimgr] + - [0x39790, .data, done/io/controller] + - [0x397A0, .data, done/audio/drvrNew] + - [0x39930, bin, data_39930] # .data, ultra/exceptasm] + - [0x39950, .data, done/os/thread] + - [0x39970, .data, done/io/piacs] + - [0x39980, .data, done/io/vi] + - [0x399F0, .data, done/os/timerintr] + - [0x39A00, .data, done/io/siacs] + - [0x39A10, .data, done/audio/env] + - [0x39B10, .data, done/io/vimodepallan1] + - [0x39B60, .data, done/io/vimodempallan1] + - [0x39B60, .data, done/io/vimodentsclan1] + - [0x39C00, bin, data_39C00] # .rodata, code_1D00] + - [0x39C20, bin, data_39C20] # .rodata, code_31C0] + - [0x39C30, bin, data_39C30] # .rodata, code_3A70] + - [0x39CA0, bin, data_39CA0] # .rodata, code_72B0] + - [0x39CD0, bin, data_39CD0] # .rodata, code_7F60] + - [0x39CE0, bin, data_39CE0] # .rodata, code_9D30] + - [0x39D00, .rodata, done/code_CE60] + - [0x39FD0, .rodata, code_EAF0] + - [0x39FE0, bin, data_39FD0] # .rodata, code_EAF0] #continued + - [0x3A760, bin, data_3A760] # .rodata, code_11AC0] + - [0x3A800, bin, data_3A800] # .rodata, code_13990] + - [0x3A820, .rodata, code_18350] + - [0x3A920, .rodata, code_1BE90] + - [0x3A950, .rodata, code_1D5D0] + - [0x3A9B0, .rodata, done/audio/n_synthesizer] + - [0x3A9C0, bin, data_3A9C0] # .rodata, done/audio/n_csplayer] + - [0x3AD30, bin, data_3AD30] + - [0x3AD60, .rodata, done/audio/n_drvrNew] + - [0x3AD80, bin, data_3AD80] + - [0x3B180, .rodata, done/audio/n_resample] + - [0x3B190, .rodata, done/gu/sinf] + - [0x3B1E0, .rodata, done/audio/cents2ratio] + - [0x3B1F0, bin, data_3B1F0] # .rodata, ultra/setintmask] # splat bug preventing this from linking correctly + - [0x3B2C0, bin, data_3B2C0] # .rodata, gu/rotate] # need to resolve .data section first + - [0x3B2D0, .rodata, done/audio/cseq] + - [0x3B2E0, .rodata, done/audio/drvrNew] + - [0x3B300, .rodata, done/audio/reverb] + - [0x3B330, .rodata, done/audio/seq] + - [0x3B340, bin, data_3B340] # .rodata, ultra/exceptasm] + - [0x3B390, hasm, ultra/libm_vals] # Nothing in this file, just here so splat sees it's ASM + - [0x3B390, .rodata, ultra/libm_vals] + - [0x3B3A0, .rodata, done/audio/synthesizer] + - [0x3B3B0, .rodata, done/io/devmgr] + - [0x3B3D0, .rodata, done/audio/env] + - [0x3B420, .rodata, done/audio/resample] + - [0x3B460, bin, data_3B460] +- type: code + name: core1-bbs + dir: core1 + start: 0x00003C710 + vram: 0x8027A130 + subsegments: + - [0x3c710, .bss, code_0] + - [0x3c710, .bss, code_660] + - [0x3c710, .bss, inflate] + - [0x3c710, .bss, code_1D00] + - [0x3c710, .bss, code_2BD0] + - [0x3c710, .bss, code_2DA0] + - [0x3c710, .bss, code_31C0] + - [0x3c710, .bss, code_3A70] + - [0x3c710, .bss, code_7090] + - [0x3c710, .bss, code_72B0] + - [0x3c710, .bss, code_8C50] + - [0x3c710, .bss, code_9D30] + - [0x3c710, .bss, done/code_CE60] + - [0x3c710, .bss, code_E360] + - [0x3c710, .bss, code_EAF0] + - [0x3c710, .bss, code_11AC0] + - [0x3c710, .bss, code_12F10] + - [0x3c710, .bss, code_13640] + - [0x3c710, .bss, code_136D0] +- [0x3c710] # core1 end diff --git a/subyaml/core1.us.v11.yaml b/subyaml/core1.us.v11.yaml new file mode 100644 index 00000000..77863892 --- /dev/null +++ b/subyaml/core1.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: core1 + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: core1-code + dir: core1 + type: code + start: 0x00000000 + vram: 0x8023D680 + subsegments: + - [0x00000000, asm] + - name: core1-data + dir: core1 + type: code + start: 0x00036EF0 + vram: 0x80274570 + subsegments: + - [0x00036EF0, bin, data_36EF0] + - [0x0003B8F0] \ No newline at end of file diff --git a/subyaml/core2.jp.yaml b/subyaml/core2.jp.yaml new file mode 100644 index 00000000..82912e6a --- /dev/null +++ b/subyaml/core2.jp.yaml @@ -0,0 +1,33 @@ +options: + basename: core2 + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: core2-code + dir: core2 + type: code + start: 0x00000000 + vram: 0x80285DD0 + subsegments: + - [0x00000000, asm] + - name: core2-data + dir: core2 + type: code + start: 0x000DDD00 + vram: 0x80363AD0 + subsegments: + - [0x000DDD00, bin, data_DDD00] + - [0x000F48C0] \ No newline at end of file diff --git a/subyaml/core2.pal.yaml b/subyaml/core2.pal.yaml new file mode 100644 index 00000000..55fcb99b --- /dev/null +++ b/subyaml/core2.pal.yaml @@ -0,0 +1,31 @@ +options: + basename: core2 + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt +segments: + - name: core2-code + type: code + start: 0x00000000 + vram: 0x80286DB0 + subsegments: + - [0x00000000, asm] + - name: core2-data + type: code + start: 0x000DCC50 + vram: 0x80363A00 + subsegments: + - [0x000DCC50, bin, data_DCC50] + - [0x000F37B0] \ No newline at end of file diff --git a/subyaml/core2.us.v10.yaml b/subyaml/core2.us.v10.yaml new file mode 100644 index 00000000..25dc50bf --- /dev/null +++ b/subyaml/core2.us.v10.yaml @@ -0,0 +1,931 @@ +options: + basename: core2 + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.core2.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.core2.us.v10.txt + base_path: . + target_path: build/us.v10/core2.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: +- name: core2-code + dir: core2 + type: code + start: 0x00000 + vram: 0x80286F90 # via https://hack64.net/wiki/doku.php?id=player_kazooie:ram_map + subsegments: + - [0x0, c, animctrl] #DONE + - [0x0AD0, c, code_AD0] #DONE + - [0x10E0, c, code_10E0] #DONE + - [0x1550, c, code_1550] #DONE + - [0x1930, c, code_1930] + - [0x2240, c, code_2240] #DONE + - [0x2890, c, code_2890] #DONE + - [0x3480, c, code_3480] #DONE + - [0x39D0, c, code_39D0] #DONE + - [0x47C0, c, code_47C0] #DONE + - [0x6B30, c, code_6B30] #DONE + - [0x7060, c, code_7060] #DONE + - [0x8DA0, c, code_8DA0] #DONE + - [0x90E0, c, code_90E0] #DONE + - [0x9290, c, code_9290] #DONE + - [0x9450, c, code_9450] #DONE + - [0x9900, c, code_9900] #DONE + - [0x9BD0, c, code_9BD0] #DONE + - [0xA600, c, code_A600] #DONE + - [0xA6E0, c, code_A6E0] #DONE + - [0xA960, c, code_A960] #DONE + - [0xAA60, c, code_AA60] #DONE + - [0xB650, c, code_B650] #DONE + - [0xB850, c, code_B850] #DONE + - [0xBB50, c, code_BB50] #DONE + - [0xBD20, c, code_BD20] #DONE + - [0xC0E0, c, code_C0E0] #DONE + - [0xC3F0, c, code_C3F0] #DONE + - [0xC4B0, c, code_C4B0] + - [0xD800, c, code_D800] #DONE + - [0xD9B0, c, code_D9B0] #DONE + - [0xDF70, c, code_DF70] #DONE + - [0xE410, c, code_E410] #DONE + - [0xE680, c, code_E680] #DONE + - [0xE910, c, code_E910] #DONE + - [0xEE40, c, code_EE40] #DONE + - [0xEF50, c, code_EF50] #DONE + - [0xFD60, c, code_FD60] #DONE + - [0x10CD0, c, code_10CD0] #DONE + - [0x10DA0, c, pitch] #DONE + - [0x11040, c, code_11040] #DONE + - [0x11250, c, done/climb] #DONE + - [0x11460, c, code_11460] #DONE + - [0x11660, c, code_11660] #DONE + - [0x117D0, c, code_117D0] #DONE + - [0x11870, c, code_11870] #DONE + - [0x11B40, c, roll] #DONE + - [0x11DE0, c, yaw] #DONE + - [0x12360, c, code_12360] #DONE + - [0x126C0, c, code_126C0] #DONE + - [0x12F30, c, code_12F30] + - [0x13670, c, bsList] #DONE + - [0x13780, c, code_13780] #DONE + - [0x13900, c, code_13900] #DONE + - [0x13A00, c, code_13A00] #DONE + - [0x13FC0, c, code_13FC0] #DONE + - [0x13FC0, c, code_14420] #DONE + - [0x15F20, c, code_15F20] #DONE + - [0x16010, c, code_16010] #DONE + - [0x16C60, c, code_16C60] #DONE + - [0x171F0, c, code_171F0] #DONE + - [0x17450, c, bs/ant] #DONE + - [0x18550, c, bs/bBarge] #DONE + - [0x18B90, c, bs/bbuster] #DONE + - [0x19330, c, bs/bee] #DONE + - [0x19560, c, bs/beeFly] #DONE + - [0x1A000, c, bs/beeMain] #DONE + - [0x1B1E0, c, bs/bEggAss] #DONE + - [0x1B450, c, bs/bEggHead] #DONE + - [0x1B700, c, bs/bFlap] #DONE + - [0x1BDD0, c, bs/bFlip] #DONE + - [0x1C3C0, c, bs/bFly] #DONE + - [0x1E240, c, bs/bLongLeg] #DONE + - [0x1F580, c, bs/bPeck] #DONE + - [0x1FA20, c, bs/bShock] #DONE + - [0x201B0, c, bs/bSwim] #DONE + - [0x21830, c, bs/bTrot] #DONE + - [0x23470, c, bs/bWhirl] #DONE + - [0x23EF0, c, bs/carry] #DONE + - [0x242F0, c, bs/claw] #DONE + - [0x24630, c, bs/climb] #DONE + - [0x24E30, c, bs/croc] #DONE + - [0x26740, c, bs/crouch] #DONE + - [0x26E70, c, bs/die] #DONE + - [0x273E0, c, bs/drone] #DONE + - [0x27550, c, code_27550] #DONE #drone_enter??? + - [0x27BD0, c, bs/dronegoto] #DONE + - [0x27F40, c, code_27F40] #DONE #dronelook??? + - [0x28220, c, code_28220] #DONE #dronevanish??? + - [0x28810, c, bs/dronexform] #DONE + - [0x29AD0, c, bs/jig] #DONE + - [0x2A170, c, bs/jump] #DONE + - [0x2B040, c, bs/ow] #DONE + - [0x2B240, c, bs/pumpkin] #DONE + - [0x2C640, c, bs/rebound] #DONE + - [0x2CAC0, c, bs/rest] #DONE + - [0x2CF90, c, bs/sled] #DONE + - [0x2D140, c, bs/slide] #DONE + - [0x2D5E0, c, bs/splat] #DONE + - [0x2D8E0, c, bs/stand] #DONE + - [0x2E4F0, c, bs/swim] #DONE + - [0x2F040, c, bs/surf] #DONE + - [0x2F1A0, c, done/bs/talk] #DONE + - [0x2F2E0, c, bs/timeout] #DONE + - [0x2F5B0, c, bs/throw] #DONE + - [0x2F7D0, c, bs/turn] #DONE + - [0x2FAB0, c, bs/twirl] #DONE + - [0x2FD70, c, bs/walk] #DONE + - [0x30E70, c, bs/walrus] #DONE + - [0x329F0, c, bs/washy] #DONE + - [0x32DB0, c, code_32DB0] #DONE + - [0x33250, c, code_33250] #DONE + - [0x33250, c, code_33310] #DONE + - [0x336F0, c, code_336F0] #DONE + - [0x33AB0, c, code_33AB0] #DONE + - [0x33C30, c, code_33C30] #DONE + - [0x33D40, c, code_33D40] #DONE + - [0x33F90, c, code_33F90] #DONE + - [0x34310, c, code_34310] #DONE + - [0x34790, c, code_34790] #DONE + - [0x35520, c, code_35520] #DONE + - [0x356B0, c, code_356B0] #DONE + - [0x379B0, c, code_379B0] + - [0x37CD0, c, code_37CD0] #DONE + - [0x37E50, c, code_37E50] #DONE + - [0x38150, c, code_38150] #DONE + - [0x382E0, c, code_382E0] #DONE + - [0x38460, c, code_38460] #DONE + - [0x38630, c, code_38630] #DONE + - [0x388E0, c, code_388E0] #DONE + - [0x38AD0, c, code_38AD0] #DONE + - [0x38F40, c, code_38F40] #DONE + - [0x39190, c, code_39190] #DONE + - [0x396B0, c, code_396B0] #DONE + - [0x39A10, c, code_39A10] #DONE + - [0x39EF0, c, code_39EF0] + - [0x3AE10, c, code_3AE10] #DONE + - [0x3B2C0, c, done/code_3B2C0] #DONE + - [0x3B5C0, c, code_3B5C0] #DONE + - [0x3BB80, c, code_3BB80] #DONE + - [0x3D3D0, c, ch/gameSelect] #DONE + - [0x3EAD0, c, code_3EAD0] #DONE + - [0x3EC30, c, code_3EC30] #DONE + - [0x3ECE0, c, code_3ECE0] #DONE + - [0x3EEF0, c, ch/bigbutt] #DONE + - [0x400F0, c, code_400F0] #DONE + - [0x40AA0, c, ch/jiggy] #DONE + - [0x41130, c, ch/jigsawdance] #DONE + - [0x41460, c, code_41460] #DONE + - [0x41F30, c, code_41F30] #DONE + - [0x41FB0, c, code_41FB0] + - [0x42CA0, c, ch/musicnote] #DONE + - [0x42CB0, c, code_42CB0] #DONE + - [0x43250, c, code_43250] #DONE + - [0x43390, c, ch/trainers] #DONE + - [0x43800, c, code_43800] #DONE + - [0x43A40, c, code_43A40] #DONE + - [0x43CD0, c, mapspecificflags] #DONE + - [0x440B0, c, code_440B0] #DONE + - [0x45310, c, code_45310] #DONE + - [0x468E0, c, ch/code_468E0] #DONE + - [0x46BC0, c, ch/jinjo] + - [0x47850, c, ch/beehive] #DONE + - [0x47BD0, c, code_47BD0] + - [0x49570, c, ch/soundsource] #DONE + - [0x49A70, c, code_49A70] #DONE + - [0x4A420, c, ch/gloop] #DONE + - [0x4A6F0, c, code_4A6F0] #DONE + - [0x4BD70, c, code_4BD70] #DONE + - [0x4BE10, c, code_4BE10] #DONE + - [0x4C020, c, code_4C020] + - [0x4FB80, c, ch/wadingboots] #DONE + - [0x4FF10, c, ch/badShad] #DONE + - [0x50490, c, code_50490] #DONE + - [0x50750, c, ch/climbBase] #DONE + - [0x509D0, c, code_509D0] #DONE + - [0x517A0, c, code_517A0] #DONE + - [0x51950, c, code_51950] #DONE + - [0x51C90, c, code_51C90] #DONE + - [0x52290, c, ch/mole] #DONE + - [0x535D0, c, ch/molehill] #DONE + - [0x53A10, c, code_53A10] #DONE + - [0x53C10, c, code_53C10] #DONE + - [0x54D50, c, code_54D50] #DONE + - [0x55180, c, code_55180] #DONE + - [0x55390, c, code_55390] #DONE + - [0x556C0, c, code_556C0] #DONE + - [0x55850, c, code_55850] #DONE + - [0x55A90, c, code_55A90] #DONE + - [0x55BC0, c, code_55BC0] #DONE + - [0x55E20, c, code_55E70] #DONE + - [0x560F0, c, code_560F0] #DONE + - [0x57C70, c, code_57C70] #DONE + - [0x581D0, c, code_581D0] #DONE + - [0x584D0, c, code_584D0] #DONE + - [0x59780, c, code_59780] #DONE + - [0x599E0, c, code_599E0] #DONE + - [0x59A80, c, code_59A80] #DONE + - [0x59D40, c, code_59D40] + - [0x5AB30, c, ch/code_5AB30] #DONE + - [0x5B6A0, c, code_5B6A0] + - [0x5BD90, c, code_5BD90] #DONE + - [0x5BEB0, c, code_5BEB0] + - [0x5DBC0, c, code_5DBC0] + - [0x5FD80, c, code_5FD80] #DONE + - [0x5FD90, c, code_5FD90] + - [0x62FD0, c, code_62FD0] #DONE + - [0x630D0, c, code_630D0] #DONE + - [0x63410, c, code_63410] #DONE + - [0x63690, c, code_63690] #DONE + - [0x637D0, c, code_637D0] + - [0x654C0, c, code_654C0] #DONE + - [0x66490, c, code_66490] #DONE + - [0x66690, c, vla] #DONE + - [0x66AB0, c, sla] + - [0x66D90, c, code_66D90] #DONE + - [0x66FB0, c, code_66FB0] #DONE + - [0x67490, c, gc/bound] #DONE + - [0x67650, c, code_67650] + - [0x69F60, c, code_69F60] #DONE + - [0x6A4B0, c, code_6A4B0] #DONE + - [0x6AEF0, c, code_6AEF0] #DONE + - [0x6B030, c, code_6B030] + - [0x6C3E0, c, code_6C3E0] #DONE + - [0x6CD20, c, code_6CD20] #DONE + - [0x6CEC0, c, code_6CEC0] #DONE + - [0x6D030, c, code_6D030] #DONE + - [0x6D270, c, code_6D270] #DONE + - [0x6D490, c, code_6D490] #DONE + - [0x6DA30, c, code_6DA30] + - [0x70C30, c, code_70C30] #DONE + - [0x70F20, c, code_70F20] #DONE + - [0x71820, c, code_71820] #DONE + - [0x72060, c, code_72060] + - [0x72B10, c, code_72B10] + - [0x73640, c, code_73640] #DONE + - [0x74090, c, code_74090] #DONE + - [0x74290, c, code_74290] #DONE + - [0x74420, c, code_74420] + - [0x75480, c, code_75480] + - [0x75930, c, code_75930] + - [0x75E90, c, code_75E90] + - [0x76390, c, code_76390] #DONE + - [0x763D0, c, code_763D0] + - [0x76D90, c, code_76D90] + - [0x77E50, c, code_77E50] #DONE + - [0x78100, c, code_78100] + - [0x78E50, c, code_78E50] + - [0x79830, c, fxcommon3score] #DONE + - [0x79C80, c, code_79C80] + - [0x7AF80, c, code_7AF80] + - [0x82000, c, code_82000] + - [0x83340, c, code_83340] + - [0x83D70, c, code_83D70] + - [0x840D0, c, code_840D0] + - [0x84470, c, gc/transition] #DONE + - [0x851D0, c, code_851D0] + - [0x857B0, c, code_857B0] #DONE + - [0x85800, c, code_85800] #DONE + - [0x87E30, c, code_87E30] + - [0x8A7B0, c, gc/pauseMenu] + - [0x8DC20, c, code_8DC20] + - [0x8E270, c, gc/zoombox] + - [0x91E10, c, code_91E10] + - [0x935F0, c, code_935F0] + - [0x93C10, c, code_93C10] + - [0x94620, c, code_94620] + - [0x99860, c, code_99860] #DONE + - [0x999A0, c, code_999A0] #DONE + - [0x99F80, c, jiggyscore] #DONE + - [0x9A320, c, code_9A320] #DONE + - [0x9A580, c, code_9A580] #DONE + - [0x9A740, c, code_9A740] #DONE + - [0x9A9D0, c, code_9A9D0] #DONE + - [0x9AD00, c, levelspecificflags] + - [0x9B180, c, code_9B180] #DONE + - [0x9B650, c, code_9B650] + - [0x9B990, c, code_9B990] #DONE + - [0x9C170, c, code_9C170] + - [0x9D640, c, code_9D640] #DONE + - [0x9D760, c, code_9D760] #DONE + - [0x9D860, c, timedfuncqueue] #DONE + - [0x9E370, c, code_9E370] + - [0xA4D00, c, code_A4D00] + - [0xABC00, c, code_ABC00] + - [0xAC520, c, code_AC520] + - [0xAD110, c, code_AD110] #DONE + - [0xAD5B0, c, code_AD5B0] #DONE + - [0xAE290, c, code_AE290] #DONE + - [0xAE5D0, c, code_AE5D0] #DONE + - [0xAEDA0, c, code_AEDA0] + - [0xB1400, c, code_B1400] + - [0xB3A80, c, code_B3A80] + - [0xB5040, c, code_B5040] #DONE + - [0xB5E00, c, code_B5E00] + - [0xB62B0, c, code_B62B0] + - [0xB6640, c, code_B6640] #DONE + - [0xB66D0, c, string] #DONE + - [0xB6C60, c, code_B6C60] #DONE + - [0xB6CE0, c, code_B6CE0] #DONE + - [0xB6EA0, c, code_B6EA0] #DONE + - [0xB7B20, c, code_B7B20] + - [0xB7F40, c, code_B7F40] #DONE + - [0xB8020, c, code_B8020] + - [0xB8070, c, code_B8070] #DONE + - [0xB8080, c, code_B8080] + - [0xB8860, c, code_B8860] #DONE + - [0xB9090, c, code_B9090] + - [0xB9770, c, code_B9770] + - [0xBD100, c, code_BD100] + - [0xBDCC0, c, code_BDCC0] #DONE + - [0xBE2C0, c, code_BE2C0] + - [0xBEF20, c, code_BEF20] + - [0xC0CF0, c, code_C0CF0] + - [0xC2C20, c, code_C2C20] #DONE + - [0xC2F30, c, code_C2F30] #DONE + - [0xC31A0, c, code_C31A0] #DONE + - [0xC3400, c, rand] #DONE + - [0xC3A40, c, code_C3A40] #DONE + - [0xC3B20, c, code_C3B20] + - [0xC4320, c, code_C4320] #DONE + - [0xC4F40, c, code_C4F40] #DONE + - [0xC5440, c, code_C5440] + - [0xC5AF0, c, code_C5AF0] #DONE + - [0xC5CC0, c, code_C5CC0] #DONE + - [0xC5F00, c, code_C5F00] #DONE + - [0xC61C0, c, code_C61C0] #DONE + - [0xC62B0, c, code_C62B0] + - [0xC76D0, c, code_C76D0] + - [0xC7CC0, c, code_C7CC0] + - [0xC8230, c, code_C8230] #DONE + - [0xC8360, c, code_C8360] #DONE + - [0xC8490, c, code_C8490] #DONE + - [0xC8760, c, code_C8760] #DONE + - [0xC89C0, c, code_C89C0] + - [0xC97F0, c, code_C97F0] + - [0xC9E70, c, code_C9E70] #DONE + - [0xC9F00, c, code_C9F00] + - [0xCB050, c, code_CB050] + - [0xCB610, c, code_CB610] #DONE + - [0xCB8A0, c, code_CB8A0] #DONE + - [0xCBBF0, c, code_CBBF0] #DONE + - [0xCBD10, c, code_CBD10] #DONE + - [0xCC1E0, c, code_CC1E0] #DONE + - [0xCD0A0, c, code_CD0A0] #DONE + - [0xCD3F0, c, code_CD3F0] #DONE + - [0xCD6E0, c, code_CD6E0] + - [0xCECD0, c, code_CECD0] #DONE + - [0xCF090, c, code_CF090] #DONE + - [0xCF3E0, c, code_CF3E0] #DONE + - [0xCF7E0, c, ch/clankerwhipcrack] #DONE + - [0xCFA60, c, ch/code_CFA60] #DONE + - [0xD01C0, c, ch/clucker] #DONE + - [0xD0CA0, c, code_D0CA0] + - [0xD2180, c, code_D2180] + - [0xD2500, c, ch/firefx] #DONE + - [0xD2AB0, c, ch/drips] #DONE + - [0xD2E10, c, ch/icecube] #DONE + - [0xD4050, c, ch/ghost] #DONE + - [0xD50F0, c, ch/flotsam] #DONE + - [0xD5D10, c, code_D5D10] #DONE + - [0xD5FD0, c, code_D5FD0] #DONE + - [0xD6180, c, code_D6180] #DONE + - [0xD6600, c, code_D6600] #DONE + - [0xD7040, c, code_D7040] #DONE + - [0xD7D10, c, code_D7D10] #DONE + - [0xD89E0, c, code_D89E0] + - [0xD9DA0, c, ch/whipcrack] #DONE + - [0xDA3A0, c, code_DA3A0] #DONE + - [0xDA760, c, code_DA760] #DONE + - [0xDAAA0, c, code_DAAA0] #DONE + - [0xDB010, c, code_DB010] #DONE + - [0xDC4B0, c, code_DC4B0] #DONE +- type: code + name: core2-data + dir: core2 + start: 0xDC600 + vram: 0x80363590 + subsegments: + - [0xDC600, bin, data_DC600] + - [0xDC630, .data, code_1550] + - [0xDC650, .data, code_2890] + - [0xDC680, .data, code_3480] + - [0xDC6A0, .data, code_47C0] + - [0xDC700, .data, code_7060] + - [0xDC740, bin, data_DC740] #.data, code_90E0 + - [0xDC7F0, .data, code_AA60] + - [0xDC7F0, .data, code_B850] + - [0xDC810, .data, code_BB50] + - [0xDC860, .data, code_C0E0] + - [0xDC890, .data, code_E910] + - [0xDD4B0, .data, code_FD60] + - [0xDD4C0, .data, code_117D0] + - [0xDD5D0, .data, code_126C0] + - [0xDD5F0, bin, data_DD5F0] + - [0xDD9D0, .data, bs/ant] + - [0xDDA00, .data, bs/bbuster] + - [0xDDA20, .data, bs/beeFly] + - [0xDDA50, .data, bs/beeMain] + - [0xDDA80, .data, bs/bFlap] + - [0xDDA90, .data, bs/bFlip] + - [0xDDAB0, .data, bs/bLongLeg] + - [0xDDAD0, .data, bs/bPeck] + - [0xDDAE0, .data, bs/bShock] + - [0xDDAF0, bin, data_DDAF0] + - [0xDDB00, .data, bs/bTrot] + - [0xDDB40, .data, bs/bWhirl] + - [0xDDB60, .data, bs/carry] + - [0xDDB70, .data, bs/croc] + - [0xDDBA0, .data, bs/drone] + - [0xDDC20, bin, data_DDC20] #.data, bs/dronexform] + - [0xDDD40, .data, bs/jump] + - [0xDDD60, .data, bs/pumpkin] + - [0xDDD90, .data, bs/stand] + - [0xDDDB0, .data, bs/swim] + - [0xDDDE0, .data, bs/walk] + - [0xDDE30, .data, bs/walrus] + - [0xDDE70, bin, data_DDE70] + - [0xDE8A0, .data, code_35520] + - [0xDED40, bin, data_DED40] + - [0xDEDD0, .data, code_37E50] + - [0xDEE00, bin, data_DEE00] + - [0xDEE40, .data, ch/gameSelect] + - [0xDEFA0, .data, code_3EAD0] + - [0xDF020, .data, code_3EC30] + - [0xDF050, .data, code_3ECE0] + - [0xDF080, .data, ch/bigbutt] + - [0xDF160, .data, code_400F0] + - [0xDF300, .data, ch/jiggy] + - [0xDF340, .data, ch/jigsawdance] + - [0xDF3A0, .data, code_41460] + - [0xDF4A0, .data, code_41F30] + - [0xDF4D0, bin, data_DF4D0] + - [0xDFCC0, .data, ch/musicnote] + - [0xDFCF0, .data, code_42CB0] + - [0xDFD40, bin, data_DFD40] + - [0xDFF90, .data, code_43A40] + - [0xE0070, bin, data_E0070] + - [0xE0080, .data, code_440B0] + - [0xE01A0, bin, data_E01A0] + - [0xE01D0, .data, ch/code_468E0] + - [0xE0220, bin, data_E0220] + - [0xE0330, .data, ch/beehive] + - [0xE0380, bin, data_E0380] + - [0xE03B0, .data, ch/soundsource] + - [0xE0430, bin, data_E0430] + - [0xE04A0, .data, ch/gloop] + - [0xE0500, bin, data_E0500] + - [0xE05A0, .data, code_4BD70] + - [0xE0660, bin, data_E0660] + - [0xE0AC0, .data, ch/badShad] + - [0xE0AF0, .data, code_50490] + - [0xE0B90, bin, data_E0B90] + - [0xE0CD0, .data, code_517A0] + - [0xE0D00, .data, code_51950] + - [0xE0D70, .data, code_51C90] + - [0xE0DE0, .data, ch/mole] + - [0xE0E70, .data, ch/molehill] + - [0xE0EE0, .data, code_53A10] + - [0xE0F10, bin, data_E0F10] + - [0xE0FA0, .data, code_54D50] + - [0xE1050, bin, data_E1050] #.data, code_55180] + - [0xE10B0, .data, code_55390] + - [0xE10E0, .data, code_556C0] + - [0xE1110, .data, code_55850] + - [0xE1140, .data, code_55A90] + - [0xE1170, .data, code_55BC0] + - [0xE11C0, .data, code_55E70] + - [0xE1210, .data, code_560F0] + - [0xE1370, .data, code_57C70] + - [0xE13D0, .data, code_581D0] + - [0xE1420, .data, code_584D0] + - [0xE14B0, bin, data_E14B0] + - [0xE1610, .data, code_59A80] + - [0xE1640, .data, code_59D40] + - [0xE16C0, .data, ch/code_5AB30] + - [0xE1780, bin, data_E1780] + - [0xE1830, .data, code_5BD90] + - [0xE1860, bin, data_E1860] + - [0xE18D0, .data, code_66FB0] + - [0xE1950, .data, gc/bound] + - [0xE19A0, bin, data_E19A0] + - [0xE1DF0, .data, code_6CD20] + - [0xE1E40, .data, code_6D030] + - [0xE1E50, bin, data_E1E50] + - [0xE1E60, .data, code_6D490] + - [0xE2070, bin, data_E2070] + - [0xE2350, .data, code_73640] + - [0xE2790, .data, code_74090] + - [0xE2840, .data, code_74290] + - [0xE2870, bin, data_E2870] + - [0xE3320,.data, fxcommon3score] + - [0xE3980, bin, data_E3980] + - [0xE3C50, .data, code_82000] + - [0xE4870, bin, data_E4870] + - [0xE7330, .data, code_9B990] + - [0xE7490, .data, code_9D640] + - [0xE75D0, bin, data_E75D0] + - [0xE7870, .data, code_A4D00] + - [0xE78A0, bin, data_E78A0] + - [0xE89F0, bin, data_E89F0] # .data, code_AD110] + - [0xE92C0, bin, data_E92C0] + - [0xEAE90, .data, code_B6CE0] + - [0xEAEA0, .data, code_B6EA0] + - [0xEAED0, .data, code_B7F40] + - [0xEAEE0, bin, data_EAEE0] + - [0xEAF70, .data, code_C4320] + - [0xEB030, .data, code_C4F40] + - [0xEB0A0, .data, code_C5440] + - [0xEB110, bin, data_EB120] + - [0xEB860, .data, code_CF3E0] + - [0xEB880, .data, ch/clankerwhipcrack] + - [0xEB8B0, .data, ch/code_CFA60] + - [0xEB8E0, .data, ch/clucker] + - [0xEB910, bin, data_EB910] + - [0xEB9B0, .data, code_D2180] + - [0xEBB00, .data, ch/firefx] + - [0xEBB30, .data, ch/drips] + - [0xEBBC0, .data, ch/icecube] + - [0xEBC50, .data, ch/ghost] + - [0xEBCF0, .data, ch/flotsam] + - [0xEBD90, bin, data_EBD90] + - [0xEBF80, .data, code_D7040] + - [0xEBFF0, bin, data_EBFF0] + - [0xEC170, .data, ch/whipcrack] + - [0xEC1A0, .data, code_DA3A0] + - [0xEC220, .data, code_DA760] + - [0xEC250, bin, code_EC250] + - [0xEC350, bin, code_EC350] #.data, code_DB010.c] + - [0xECE30, .data, code_DC4B0] + - [0xECE60, ".rodata", animctrl] + - [0xECE90, .rodata, code_AD0] + - [0xECEA0, .rodata, code_1930] + - [0xECF20, .rodata, code_2890] + - [0xECF30, .rodata, code_3480] + - [0xECF40, .rodata, code_39D0] + - [0xECFE0, .rodata, code_47C0] + - [0xED410, .rodata, code_6B30] + - [0xED500, .rodata, code_7060] + - [0xED630, .rodata, code_9450] + - [0xED660, .rodata, code_9900] + - [0xED670, .rodata, code_9BD0] + - [0xED6B0, .rodata, code_AA60] + - [0xED760, .rodata, code_B650] + - [0xED770, .rodata, code_B850] + - [0xED790, .rodata, code_BD20] + - [0xED7B0, .rodata, code_C0E0] + - [0xED7D0, bin, data_ED7D0] + - [0xED7F0, bin, data_ED7F0] #.rodata, code_C4B0] + - [0xED810, .rodata, code_D9B0] + - [0xED820, .rodata, code_E680] + - [0xED850, .rodata, code_EF50] + - [0xED9F0, .rodata, code_FD60] + - [0xEDA50, .rodata, code_10CD0] + - [0xEDA60, .rodata, pitch] + - [0xEDA90, .rodata, code_11040] + - [0xEDAA0, .rodata, done/climb] + - [0xEDAB0, .rodata, code_11660] + - [0xEDC70, .rodata, code_11870] + - [0xEDC80, .rodata, roll] + - [0xEDCA0, .rodata, yaw] + - [0xEDD00, .rodata, code_12360] + - [0xEDD30, .rodata, code_126C0] + - [0xEDD60, bin, data_EDD60] # .rodata, code_12F30 + - [0xEDD80, .rodata, code_13FC0] + - [0xEDD90, .rodata, code_14420] + - [0xEDE10, .rodata, code_16010] + - [0xEE270, .rodata, code_16C60] + - [0xEE310, .rodata, bs/ant] + - [0xEE340, .rodata, bs/bBarge] + - [0xEE380, .rodata, bs/bbuster] + - [0xEE3C0, .rodata, bs/beeFly] + - [0xEE3F0, .rodata, bs/beeMain] + - [0xEE460, .rodata, bs/bEggAss] + - [0xEE480, .rodata, bs/bEggHead] + - [0xEE4A0, .rodata, bs/bFlap] + - [0xEE510, .rodata, bs/bFlip] + - [0xEE560, .rodata, bs/bFly] + - [0xEE5C0, .rodata, bs/bLongLeg] + - [0xEE650, .rodata, bs/bPeck] + - [0xEE680, .rodata, bs/bShock] + - [0xEE6A0, .rodata, bs/bSwim] + - [0xEE710, .rodata, bs/bTrot] + - [0xEE780, .rodata, bs/bWhirl] + - [0xEE7B0, .rodata, bs/carry] + - [0xEE7D0, .rodata, bs/claw] + - [0xEE810, .rodata, bs/climb] + - [0xEE820, .rodata, bs/croc] + - [0xEE880, .rodata, bs/crouch] + - [0xEE8B0, .rodata, bs/die] + - [0xEE8C0, .rodata, code_27550] + - [0xEE8D0, .rodata, bs/dronegoto] + - [0xEE8E0, .rodata, code_27F40] + - [0xEE8F0, .rodata, code_28220] + - [0xEE900, .rodata, bs/dronexform] + - [0xEE9B0, .rodata, bs/jig] + - [0xEE9D0, .rodata, bs/jump] + - [0xEEA20, .rodata, bs/ow] + - [0xEEA30, .rodata, bs/pumpkin] + - [0xEEAB0, .rodata, bs/rebound] + - [0xEEAC0, .rodata, bs/rest] + - [0xEEAD0, .rodata, bs/slide] + - [0xEEAE0, .rodata, bs/stand] + - [0xEEB10, .rodata, bs/swim] + - [0xEEB60, .rodata, bs/surf] + - [0xEEB70, .rodata, done/bs/talk] + - [0xEEB80, .rodata, bs/timeout] + - [0xEEB90, .rodata, bs/throw] + - [0xEEBA0, .rodata, bs/turn] + - [0xEEBC0, .rodata, bs/twirl] + - [0xEEBE0, .rodata, bs/walk] + - [0xEEC70, .rodata, bs/walrus] + - [0xEECD0, .rodata, bs/washy] + - [0xEED30, .rodata, code_32DB0] + - [0xEED80, .rodata, code_33F90] + - [0xEEDA0, .rodata, code_34310] + - [0xEEDB0, .rodata, code_34790] + - [0xEEDE0, .rodata, code_356B0] + - [0xEEF30, .rodata, code_37E50] + - [0xEEF50, .rodata, code_38150] + - [0xEEF60, .rodata, code_382E0] + - [0xEEF70, .rodata, code_38460] + - [0xEEF80, .rodata, code_38AD0] + - [0xEEF90, .rodata, code_38F40] + - [0xEEFA0, .rodata, code_39190] + - [0xEEFC0, .rodata, code_396B0] + - [0xEEFD0, .rodata, code_39A10] + - [0xEEFF0, .rodata, code_39EF0] + - [0xEF020, bin, data_EF020] #.rodata, code_39EF0] + - [0xEF030, .rodata, code_3AE10] + - [0xEF040, .rodata, code_3BB80] + - [0xEF090, .rodata, ch/gameSelect] + - [0xEF210, .rodata, code_3ECE0] + - [0xEF220, .rodata, ch/bigbutt] + - [0xEF300, .rodata, code_400F0] + - [0xEF360, .rodata, ch/jiggy] + - [0xEF3E0, .rodata, ch/jigsawdance] + - [0xEF450, .rodata, code_41460] + #- [0xEF480, .rodata, code_41FB0] #temp + - [0xEF480, bin, data_EF480] + - [0xEF4C0, .rodata, ch/musicnote] + - [0xEF4D0, .rodata, code_42CB0] + - [0xEF4E0, bin, data_EF4E0] + - [0xEF500, .rodata, code_440B0] + - [0xEF550, .rodata, code_45310] + - [0xEF5D0, .rodata, ch/jinjo] + - [0xEF5F0, bin, data_EF5F0] #part of ch/jinjo .rodata + - [0xEF640, .rodata, ch/beehive] + - [0xEF650, bin, data_EF650] + - [0xEF6B0, bin, EF6B0] # .rodata, code_49A70] + - [0xEF6D0, .rodata, ch/gloop] + - [0xEF6E0, .rodata, code_4A6F0] + - [0xEF790, bin, data_EF790] + - [0xEFB10, .rodata, code_4C020] + - [0xEFDB0, .rodata, ch/badShad] + - [0xEFDC0, .rodata, code_50490] + - [0xEFDD0, .rodata, code_509D0] + - [0xEFE10, .rodata, code_517A0] + - [0xEFE20, .rodata, code_51950] + - [0xEFE30, .rodata, ch/mole] + - [0xEFED0, .rodata, code_53C10] + - [0xEFF40, .rodata, code_54D50] + - [0xEFF60, .rodata, code_55180] + - [0xEFF70, .rodata, code_55390] + - [0xEFF80, .rodata, code_55BC0] + - [0xEFF90, .rodata, code_55E70] + - [0xEFFA0, .rodata, code_560F0] + - [0xF0010, .rodata, code_57C70] + - [0xF0030, .rodata, code_581D0] + - [0xF0040, .rodata, code_584D0] + - [0xF00A0, .rodata, code_599E0] + - [0xF00B0, .rodata, code_59A80] + - [0xF00C0, bin, data_F00C0] #.rodata, code_59D40] + - [0xF0110, .rodata, ch/code_5AB30] + - [0xF0140, .rodata, code_5B6A0] + - [0xF0160, bin, data_F0160] #.rodata, code_5B6A0] + - [0xF0170, bin, data_F0170] + #- [0xF0180, .rodata, code_5BEB0] + - [0xF0180, bin, data_F0180] + - [0xF01F0, bin, data_F01F0] #.rodata, code_5FD90] + - [0xF0200, .rodata, code_66FB0] + - [0xF0210, bin, data_F0210] + - [0xF0220, .rodata, code_67650] + - [0xF0240, bin, data_F0240] + - [0xF0280, .rodata, code_6CEC0] + - [0xF0290, .rodata, code_6D030] + - [0xF02A0, .rodata, code_6D270] + - [0xF02B0, bin, data_F02B0] #.rodata, code_6DA30] + - [0xF0330, .rodata, code_70F20] + - [0xF0390, .rodata, code_71820] + - [0xF03B0, bin, data_F03B0] + # - [0xF03C0, .rodata, code_72060] + - [0xF03D0, .rodata, code_73640] + - [0xF0400, .rodata, code_74420] + - [0xF0410, bin, data_F0410] + - [0xF0420, bin, data_F0420] #this is first part of [.rodata, code_76D90], COMBINE WITH FOLLOWING SECTION ONCE CODE DONE + - [0xF0440, .rodata, code_76D90] + - [0xF0470, bin, data_F0470] + - [0xF04D0, .rodata, fxcommon3score] + - [0xF04F0, bin, data_F04F0] + - [0xF0520, .rodata, code_7AF80] + - [0xF0540, bin, data_F0540] + - [0xF14C0, .rodata, gc/transition] + - [0xF1520, .rodata, code_85800] + - [0xF1540, bin, data_F1540] + # - [0xF18F0, .rodata, gc/zoombox] + - [0xF1900, .rodata, gc/zoombox] + - [0xF1960, bin, data_F1960] + - [0xF19C0, .rodata, code_91E10] + - [0xF1A00, bin, data_F1A00] + - [0xF1DC0, .rodata, code_9A9D0] + - [0xF1DF0, .rodata, code_9B180] + - [0xF1E00, bin, data_F1E00] + - [0xF1E60, .rodata, code_9E370] + - [0xF1EC0, bin, data_F1EC0] + - [0xF1F30, .rodata, code_AD110] + - [0xF1F50, .rodata, code_AE5D0] + - [0xF1F60, bin, data_F1F60] + - [0xF1FD0, .rodata, string] + - [0xF1FF0, bin, code_B6C60] + - [0xF2000, .rodata, code_B6CE0] + - [0xF2030, bin, data_F2030] + - [0xF2110, .rodata, code_BDCC0] + - [0xF2130, bin, data_F2130] + - [0xF2170, .rodata, code_BEF20] + - [0xF21B0, bin, data_F21B0] + - [0xF21C0, .rodata, rand] + - [0xF21E0, bin, data_F21E0] + - [0xF21F0, .rodata, code_C4320] + - [0xF2210, .rodata, code_C5AF0] + - [0xF2230, .rodata, code_C5CC0] + - [0xF2240, .rodata, code_C5F00] + - [0xF2270, bin, data_F2230] + - [0xF22A0, bin, data_F22A0] # .rodata, code_C76D0] + - [0xF22E0, bin, data_F22E0] + - [0xF2320, .rodata, code_C8230] + - [0xF2330, .rodata, code_C8360] + - [0xF2340, .rodata, code_C8490] + - [0xF2360, bin, data_F2360] + - [0xF2390, bin, data_F2390] # .rodata, code_C89C0] + - [0xF23B0, bin, data_C97F0] # .rodata, code_C97F0] + - [0xF23C0, bin, data_F23C0] + - [0xF2480, .rodata, code_CBD10] + - [0xF24A0, bin, data_F24A0] + - [0xF24C0, .rodata, code_CD0A0] + - [0xF24E0, bin, data_F24E0] + - [0xF2530, .rodata, code_CECD0] + - [0xF2550, .rodata, code_CF090] + - [0xF2560, .rodata, ch/clankerwhipcrack] + - [0xF2580, .rodata, ch/code_CFA60] + - [0xF25D0, .rodata, ch/clucker] + - [0xF2670, bin, data_F2670] + - [0xF26F0, .rodata, code_D2180] + - [0xF2700, .rodata, ch/firefx] + - [0xF2740, .rodata, ch/drips] + - [0xF2760, .rodata, ch/icecube] + - [0xF2810, .rodata, ch/ghost] + - [0xF2880, .rodata, ch/flotsam] + - [0xF28C0, .rodata, code_D5D10] + - [0xF28D0, bin, data_F28D0] + - [0xF28E0, .rodata, code_D6600] + - [0xF2920, .rodata, code_D7040] + - [0xF2990, .rodata, code_D7D10] + - [0xF2A30, bin, data_F2A30] + - [0xF2A60, .rodata, code_D89E0] + - [0xF2AD0, .rodata, ch/whipcrack] + - [0xF2AF0, .rodata, code_DA3A0] + - [0xF2B00, .rodata, code_DA760] + - [0xF2B20, .rodata, code_DB010] +- type: code + name: core2-bbs + dir: core2 + start: 0xf2c00 + vram: 0x80379B90 + subsegments: + - [0xf2c00, .bss, code_AD0] + - [0xf2c00, .bss, code_10E0] + - [0xf2c00, .bss, code_1550] + - [0xf2c00, .bss, code_1930] + - [0xf2c00, .bss, code_2890] + - [0xf2c00, .bss, code_3480] + - [0xf2c00, .bss, code_39D0] + - [0xf2c00, .bss, code_47C0] + - [0xf2c00, .bss, code_6B30] + - [0xf2c00, .bss, code_7060] + - [0xf2c00, .bss, code_8DA0] + - [0xf2c00, .bss, code_90E0] + - [0xf2c00, .bss, code_9290] + - [0xf2c00, .bss, code_9450] + - [0xf2c00, .bss, code_9900] + - [0xf2c00, .bss, code_9BD0] + - [0xf2c00, .bss, code_A600] + - [0xf2c00, .bss, code_A6E0] + - [0xf2c00, .bss, code_AA60] + - [0xf2c00, .bss, code_B650] + - [0xf2c00, .bss, code_BB50] + - [0xf2c00, .bss, code_BD20] + - [0xf2c00, .bss, code_C0E0] + - [0xf2c00, .bss, code_C3F0] + - [0xf2c00, .bss, code_C4B0] + - [0xf2c00, .bss, code_D800] + - [0xf2c00, .bss, code_D9B0] + - [0xf2c00, .bss, code_DF70] + - [0xf2c00, .bss, code_E410] + - [0xf2c00, .bss, code_E680] + - [0xf2c00, .bss, code_E910] + - [0xf2c00, .bss, code_EE40] + - [0xf2c00, .bss, code_EF50] + - [0xf2c00, .bss, code_FD60] + - [0xf2c00, .bss, code_10CD0] + - [0xf2c00, .bss, pitch] + - [0xf2c00, .bss, code_11040] + - [0xf2c00, .bss, done/climb] + - [0xf2c00, .bss, code_11460] + - [0xf2c00, .bss, code_11660] + - [0xf2c00, .bss, code_117D0] + - [0xf2c00, .bss, code_11870] + - [0xf2c00, .bss, roll] + - [0xf2c00, .bss, yaw] + - [0xf2c00, .bss, code_12360] + - [0xf2c00, .bss, code_126C0] + - [0xf2c00, .bss, code_12F30] + - [0xf2c00, .bss, bsList] + - [0xf2c00, .bss, code_13780] + - [0xf2c00, .bss, code_13900] + - [0xf2c00, .bss, code_13A00] + - [0xf2c00, .bss, code_13FC0] + - [0xf2c00, .bss, code_14420] + - [0xf2c00, .bss, code_15F20] + - [0xf2c00, .bss, code_16010] + - [0xf2c00, .bss, code_16C60] + - [0xf2c00, .bss, code_171F0] + - [0xf2c00, .bss, bs/ant] + - [0xf2c00, .bss, bs/bBarge] + - [0xf2c00, .bss, bs/bbuster] + - [0xf2c00, .bss, bs/beeFly] + - [0xf2c00, .bss, bs/beeMain] + - [0xf2c00, .bss, bs/bEggAss] + - [0xf2c00, .bss, bs/bEggHead] + - [0xf2c00, .bss, bs/bFlap] + - [0xf2c00, .bss, bs/bFlip] + - [0xf2c00, .bss, bs/bFly] + - [0xf2c00, .bss, bs/bLongLeg] + - [0xf2c00, .bss, bs/bPeck] + - [0xf2c00, .bss, bs/bShock] + - [0xf2c00, .bss, bs/bSwim] + - [0xf2c00, .bss, bs/bTrot] + - [0xf2c00, .bss, bs/bWhirl] + - [0xf2c00, .bss, bs/claw] + - [0xf2c00, .bss, bs/climb] + - [0xf2c00, .bss, bs/croc] + - [0xf2c00, .bss, bs/crouch] + - [0xf2c00, .bss, bs/die] + - [0xf2c00, .bss, code_27550] + - [0xf2c00, .bss, bs/dronegoto] + - [0xf2c00, .bss, code_28220] + - [0xf2c00, .bss, bs/dronexform] + - [0xf2c00, .bss, bs/jig] + - [0xf2c00, .bss, bs/jump] + - [0xf2c00, .bss, bs/ow] + - [0xf2c00, .bss, bs/pumpkin] + - [0xf2c00, .bss, bs/rebound] + - [0xf2c00, .bss, bs/sled] + - [0xf2c00, .bss, bs/slide] + - [0xf2c00, .bss, bs/splat] + - [0xf2c00, .bss, bs/stand] + - [0xf2c00, .bss, bs/swim] + - [0xf2c00, .bss, bs/surf] + - [0xf2c00, .bss, done/bs/talk] + - [0xf2c00, .bss, bs/throw] + - [0xf2c00, .bss, bs/turn] + - [0xf2c00, .bss, bs/twirl] + - [0xf2c00, .bss, bs/walk] + - [0xf2c00, .bss, bs/walrus] + - [0xf2c00, .bss, bs/washy] + - [0xf2c00, .bss, code_32DB0] + - [0xf2c00, .bss, code_33C30] + - [0xf2c00, .bss, code_33D40] + - [0xf2c00, .bss, code_34310] + - [0xf2c00, .bss, code_34790] + - [0xf2c00, .bss, code_35520] + - [0xf2c00, .bss, code_356B0] + - [0xf2c00, .bss, code_379B0] + - [0xf2c00, .bss, code_37CD0] + - [0xf2c00, .bss, code_37E50] + - [0xf2c00, .bss, code_38150] + - [0xf2c00, .bss, code_38460] + - [0xf2c00, .bss, code_38630] + - [0xf2c00, .bss, code_388E0] + - [0xf2c00, .bss, code_38AD0] + - [0xf2c00, .bss, code_38F40] + - [0xf2c00, .bss, code_39190] + - [0xf2c00, .bss, code_396B0] + - [0xf2c00, .bss, code_39A10] + - [0xf2c00, .bss, code_39EF0] + - [0xf2c00, .bss, done/code_3B2C0] + - [0xf2c00, .bss, code_3B5C0] + - [0xf2c00, .bss, ch/gameSelect] + - [0xf2c00, .bss, code_41460] + # - [0xf2c00, .bss, code_CD6E0] //D_803863E0 +- [0xf2c00] # core2 end diff --git a/subyaml/core2.us.v11.yaml b/subyaml/core2.us.v11.yaml new file mode 100644 index 00000000..4ade5fd4 --- /dev/null +++ b/subyaml/core2.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: core2 + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: core2-code + dir: core2 + type: code + start: 0x00000000 + vram: 0x80285DD0 + subsegments: + - [0x00000000, asm] + - name: core2-data + dir: core2 + type: code + start: 0x000DC9C0 + vram: 0x80362790 + subsegments: + - [0x000DC9C0, bin, data_DC9C0] + - [0x000F2FC0] \ No newline at end of file diff --git a/subyaml/cutscenes.jp.yaml b/subyaml/cutscenes.jp.yaml new file mode 100644 index 00000000..5155253a --- /dev/null +++ b/subyaml/cutscenes.jp.yaml @@ -0,0 +1,32 @@ +options: + basename: cutscenes + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: cutscenes-code + dir: cutscenes + type: code + start: 0x00000000 + vram: 0x80386F40 + subsegments: + - [0x00000000, asm] + - name: cutscenes-data + type: code + start: 0x00006F60 + vram: 0x8038DEA0 + subsegments: + - [0x00006F60, bin, data_6F60] + - [0x000085F0] \ No newline at end of file diff --git a/subyaml/cutscenes.pal.yaml b/subyaml/cutscenes.pal.yaml new file mode 100644 index 00000000..56a3bdb9 --- /dev/null +++ b/subyaml/cutscenes.pal.yaml @@ -0,0 +1,33 @@ +options: + basename: cutscenes + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt +segments: + - name: cutscenes-code + dir: cutscenes + type: code + start: 0x00000000 + vram: 0x80386DD0 + subsegments: + - [0x00000000, asm] + - name: cutscenes-data + dir: cutscenes + type: code + start: 0x00006F60 + vram: 0x8038DD30 + subsegments: + - [0x00006F60, bin, data_6F60] + - [0x000085F0] \ No newline at end of file diff --git a/subyaml/cutscenes.us.v10.yaml b/subyaml/cutscenes.us.v10.yaml new file mode 100644 index 00000000..0dfb6ff1 --- /dev/null +++ b/subyaml/cutscenes.us.v10.yaml @@ -0,0 +1,51 @@ +options: + basename: cutscenes + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.cutscenes.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.cutscenes.us.v10.txt + base_path: . + target_path: build/us.v10/cutscenes.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: + - name: cutscenes-code + dir: cutscenes + type: code + start: 0x00000000 + vram: 0x803863F0 + subsegments: + - [0x00000000, c, code_0] + - [0x60F0, c, code_60F0] #DONE + - [0x6730, c, code_6730] #DONE + - [0x69F0, c, code_69F0] #DONE + - [0x6C90, c, code_6C90] #DONE + - name: cutscenes-data + dir: cutscenes + type: code + start: 0x00006F60 + vram: 0x8038D350 + subsegments: + - [0x00006F60, bin, data_6F60] + - [0x000078A0, .data, code_60F0] + - [0x00008310, .data, code_6730] + - [0x000083B0, .data, code_69F0] + - [0x000084A0, .data, code_6C90] + - [0x00008540, .rodata, code_0] + - [0x000085C0, .rodata, code_6730] + - [0x000085D0, .rodata, code_69F0] + - [0x000085E0, .rodata, code_6C90] + - [0x000085F0] \ No newline at end of file diff --git a/subyaml/cutscens.us.v11.yaml b/subyaml/cutscens.us.v11.yaml new file mode 100644 index 00000000..3a3e08b5 --- /dev/null +++ b/subyaml/cutscens.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: cutscenes + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: cutscenes-code + dir: cutscenes + type: code + start: 0x00000000 + vram: 0x80385610 + subsegments: + - [0x00000000, asm] + - name: cutscenes-data + dir: cutscenes + type: code + start: 0x00006F60 + vram: 0x8038C570 + subsegments: + - [0x00006F60, bin, data_6F60] + - [0x000085F0] \ No newline at end of file diff --git a/subyaml/fight.jp.yaml b/subyaml/fight.jp.yaml new file mode 100644 index 00000000..17eaebb2 --- /dev/null +++ b/subyaml/fight.jp.yaml @@ -0,0 +1,33 @@ +options: + basename: fight + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: fight-code + dir: fight + type: code + start: 0x00000000 + vram: 0x80386F40 + subsegments: + - [0x00000000, asm] + - name: fight-data + dir: fight + type: code + start: 0x0000B010 + vram: 0x80391F50 + subsegments: + - [0x0000B010, bin, data_B010] + - [0x0000C3D0] \ No newline at end of file diff --git a/subyaml/fight.pal.yaml b/subyaml/fight.pal.yaml new file mode 100644 index 00000000..3c868d8c --- /dev/null +++ b/subyaml/fight.pal.yaml @@ -0,0 +1,33 @@ +options: + basename: fight + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt +segments: + - name: fight-code + dir: fight + type: code + start: 0x00000000 + vram: 0x80386DD0 + subsegments: + - [0x00000000, asm] + - name: fight-data + dir: fight + type: code + start: 0x0000B010 + vram: 0x80391DE0 + subsegments: + - [0x0000B010, bin, data_B010] + - [0x0000C3D0] \ No newline at end of file diff --git a/subyaml/fight.us.v10.yaml b/subyaml/fight.us.v10.yaml new file mode 100644 index 00000000..1dc32492 --- /dev/null +++ b/subyaml/fight.us.v10.yaml @@ -0,0 +1,77 @@ +options: + basename: fight + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + asm_data_macro: "dlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.fight.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.fight.us.v10.txt + base_path: . + target_path: build/us.v10/fight.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: + - name: fight + dir: fight + type: code + start: 0x00000000 + vram: 0x803863F0 + subsegments: + - [0x0, linker, code] # Code section + - [0x0, c, code_0] #DONE + - [0x180, c, code_180] + - [0x5ED0, c, code_5ED0] #DONE + - [0x6E90, c, code_6E90] #DONE + - [0x7580, c, code_7580] #DONE + - [0x7BE0, c, code_7BE0] #DONE + - [0x8390, c, code_8390] #DONE + - [0x87A0, c, code_87A0] #DONE + - [0x9850, c, code_9850] #DONE + - [0x9D40, c, code_9D40] #DONE + - [0xAED0, c, code_AED0] #DONE + + - [0xAF90, linker, data] # Data section + - [0xAF90, .data, code_180] + - [0xB420, .data, code_5ED0] + - [0xB5A0, .data, code_6E90] + - [0xB600, .data, code_7580] + - [0xB650, .data, code_7BE0] + - [0xB6E0, .data, code_8390] + - [0xB710, .data, code_87A0] + - [0xB9D0, .data, code_9850] + - [0xBBC0, .data, code_9D40] + - [0xBCA0, .data, code_AED0] + - [0xBCD0, .rodata, code_180] + - [0xBE90, bin, fight_data_BE90] + - [0xBF20, bin, fight_data_BF20] + - [0xC090, .rodata, code_5ED0] + - [0xC140, .rodata, code_6E90] + - [0xC150, .rodata, code_7580] + - [0xC190, .rodata, code_7BE0] + - [0xC1C0, .rodata, code_8390] + - [0xC1D0, .rodata, code_87A0] + - [0xC220, .rodata, code_9850] + - [0xC230, .rodata, code_9D40] + - [0xC340, .rodata, code_AED0] + - type: code + name: fight-bbs + dir: fight + start: 0xC350 + vram: 0x80392740 + subsegments: + - [0x0000C350, .bss, code_180] + - [0x0000C350, .bss, code_87A0] + - [0x0000C350, .bss, code_9D40] + - [0x0000C350] \ No newline at end of file diff --git a/subyaml/fight.us.v11.yaml b/subyaml/fight.us.v11.yaml new file mode 100644 index 00000000..d9e6d2d9 --- /dev/null +++ b/subyaml/fight.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: fight + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: fight-code + dir: fight + type: code + start: 0x00000000 + vram: 0x80385610 + subsegments: + - [0x00000000, asm] + - name: fight-data + dir: fight + type: code + start: 0x0000B010 + vram: 0x80390620 + subsegments: + - [0x0000B010, bin, data_B010] + - [0x0000C3D0] \ No newline at end of file diff --git a/subyaml/fight.us.v12.yaml b/subyaml/fight.us.v12.yaml new file mode 100644 index 00000000..46070456 --- /dev/null +++ b/subyaml/fight.us.v12.yaml @@ -0,0 +1,72 @@ +options: + basename: fight + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + asm_data_macro: "dlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.fight.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.fight.us.v10.txt + base_path: . + target_path: build/us.v10/fight.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: + - name: fight + dir: fight + type: code + start: 0x00000000 + vram: 0x803863F0 + subsegments: + - [0x0, linker, code] # Code section + - [0x0, c, code_0] #DONE + - [0x180, c, code_180] + - [0x5ED0, c, code_5ED0] + - [0x6E90, c, code_6E90] + - [0x7580, c, code_7580] + - [0x7BE0, c, code_7BE0] + - [0x8390, c, code_8390] + - [0x87A0, c, code_87A0] + - [0x9850, c, code_9850] #DONE + - [0x9D40, c, code_9D40] + - [0xAED0, c, code_AED0] #DONE + + - [0xAF90, linker, data] # Data section + - [0xAF90, data, fight_data_AF90] + - [0xB420, .data, code_5ED0] + - [0xB5A0, .data, code_6E90] + - [0xB600, data, fight_data_B620] + - [0xB650, .data, code_7BE0] + - [0xB6E0, .data, code_8390] + - [0xB710, .data, code_87A0] + - [0xB9D0, .data, code_9850] + - [0xBBC0, data, fight_data_BBC0] + - [0xBCA0, .data, code_AED0] + - [0xBCD0, rodata, fight_data_BCD0] + + - [0xBD10, data, code_180] + #- [0xBD30, .rodata, code_180] + + - [0xC140, .rodata, code_6E90] + - [0xC150, rodata, fight_data_C150] + - [0xC190, .rodata, code_7BE0] + - [0xC1C0, .rodata, code_8390] + - [0xC1D0, rodata, fight_data_C1D0] #- [0xC1D0, .rodata, code_87A0] + - [0xC220, .rodata, code_9850] + - [0xC230, .rodata, code_9D40] + #- [0x0000C260, .rodata, code_9850] + #- [0x0000C270, .rodata, code_9850] + - [0x0000C260, rodata, fight_data_C2B0] + - [0x0000C340, .rodata, code_AED0] + - [0x0000C350] \ No newline at end of file diff --git a/subyaml/lair.jp.yaml b/subyaml/lair.jp.yaml new file mode 100644 index 00000000..b918acc6 --- /dev/null +++ b/subyaml/lair.jp.yaml @@ -0,0 +1,33 @@ +options: + basename: lair + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.jp.txt + symbol_addrs_path: symbol_addrs.jp.txt +segments: + - name: lair-code + dir: lair + type: code + start: 0x00000000 + vram: 0x80386F40 + subsegments: + - [0x00000000, asm] + - name: lair-data + dir: lair + type: code + start: 0x0000C960 + vram: 0x803938A0 + subsegments: + - [0x0000C960, bin, data_C960] + - [0x0000F000] \ No newline at end of file diff --git a/subyaml/lair.pal.yaml b/subyaml/lair.pal.yaml new file mode 100644 index 00000000..5e32a499 --- /dev/null +++ b/subyaml/lair.pal.yaml @@ -0,0 +1,33 @@ +options: + basename: lair + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.pal.txt + symbol_addrs_path: symbol_addrs.pal.txt +segments: + - name: lair-code + dir: lair + type: code + start: 0x00000000 + vram: 0x80386DD0 + subsegments: + - [0x00000000, asm] + - name: lair-data + dir: lair + type: code + start: 0x0000C8C0 + vram: 0x80393690 + subsegments: + - [0x0000C8C0, bin, data_C8C0] + - [0x0000EF60] \ No newline at end of file diff --git a/subyaml/lair.us.v10.yaml b/subyaml/lair.us.v10.yaml new file mode 100644 index 00000000..241b7ffe --- /dev/null +++ b/subyaml/lair.us.v10.yaml @@ -0,0 +1,84 @@ +options: + basename: lair + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v10.txt + symbol_addrs_path: symbol_addrs.us.v10.txt + undefined_funcs_auto_path: undefined_funcs_auto.lair.us.v10.txt + undefined_syms_auto_path: undefined_syms_auto.lair.us.v10.txt + base_path: . + target_path: build/us.v10/lair.us.v10.bin + asset_path: bin + build_path: build/us.v10 +segments: + - name: lair-code + dir: lair + type: code + start: 0x00000000 + vram: 0x803863F0 + subsegments: + - [0x0, c, code_0] #DONE + - [0x42A0, c, code_42A0] #DONE + - [0x5640, c, code_5640] #DONE + - [0x5ED0, c, code_5ED0] #DONE + - [0x86F0, c, code_86F0] #DONE + - [0x9C40, c, code_9C40] #DONE + - [0xA170, c, code_A170] #DONE + - [0xA430, c, code_A430] #DONE + - [0xA4A0, c, code_A4A0] #DONE + - [0xA810, c, code_A810] #DONE + - [0xAD70, c, code_AD70] #DONE + - [0xBBD0, c, code_BBD0] #DONE + - [0xC1C0, c, code_C1C0] #DONE + - [0xC6C0, c, code_C6C0] #DONE + - name: lair-data + dir: lair + type: code + start: 0x0000C8C0 + vram: 0x80392CB0 + subsegments: + - [0x0000C8C0, bin, data_C8C0] #.data, code_0] + - [0x0000D130, bin, data_D130] #.data, code_42A0] + - [0x0000D320, .data, code_5640] + - [0x0000D370, bin, data_D370] #.data, code_5ED0] + - [0x0000E3C0, .data, code_86F0] + - [0x0000E470, .data, code_9C40] + - [0x0000E4F0, .data, code_A170] + - [0x0000E590, .data, code_A430] + - [0x0000E5C0, .data, code_A4A0] + - [0x0000E690, .data, code_A810] + - [0x0000E6C0, .data, code_AD70] + - [0x0000E7F0, .data, code_BBD0] + - [0x0000E8D0, .data, code_C1C0] + - [0x0000E930, .data, code_C6C0] + - [0x0000E960, .rodata, code_0] + - [0x0000EC10, .rodata, code_42A0] + - [0x0000ECA0, .rodata, code_5640] + - [0x0000ECD0, .rodata, code_5ED0] + - [0x0000EDE0, .rodata, code_86F0] + - [0x0000EE50, .rodata, code_9C40] + - [0x0000EE80, .rodata, code_A4A0] + - [0x0000EEC0, .rodata, code_A810] + - [0x0000EEE0, .rodata, code_AD70] + - [0x0000EF00, .rodata, code_BBD0] + - [0x0000EF40, .rodata, code_C1C0] + - [0x0000EF50, .rodata, code_C6C0] + - name: lair-bss + dir: lair + type: code + start: 0x0000EF60 + vram: 0x80395350 + subsegments: + - [0x0000EF60, .bss, code_0] + - [0x0000EF60] \ No newline at end of file diff --git a/subyaml/lair.us.v11.yaml b/subyaml/lair.us.v11.yaml new file mode 100644 index 00000000..b9f0770d --- /dev/null +++ b/subyaml/lair.us.v11.yaml @@ -0,0 +1,33 @@ +options: + basename: lair + find_file_boundaries: yes + compiler: "IDO" + platform: n64 + asm_endlabels: "endlabel" + cpp_args: + - "-Iinclude" + - "-Iinclude/2.0L" + - "-D_LANGUAGE_C" + generated_c_preamble: | + #include + #include "functions.h" + #include "variables.h" + create_detected_syms: yes + undefined_syms_path: undefined_syms.us.v11.txt + symbol_addrs_path: symbol_addrs.us.v11.txt +segments: + - name: lair-code + dir: lair + type: code + start: 0x00000000 + vram: 0x80385610 + subsegments: + - [0x00000000, asm] + - name: lair-data + dir: lair + type: code + start: 0x0000C900 + vram: 0x80391F10 + subsegments: + - [0x0000C900, bin, data_C900] + - [0x0000EFA0] \ No newline at end of file diff --git a/symbol_addrs.boot.us.v10.txt b/symbol_addrs.boot.us.v10.txt new file mode 100644 index 00000000..09f67e06 --- /dev/null +++ b/symbol_addrs.boot.us.v10.txt @@ -0,0 +1,10 @@ +bzero = 0x800020F0; +__osSetSR = 0x80002190; +__osGetSR = 0x800021A0; +__osSetFpcCsr = 0x800021B0; +osWritebackDCache = 0x80002B70; +osInvalICache = 0x80002BF0; +osMapTLBRdb = 0x80002C70; +__osProbeTLB = 0x80003BD0; +__osDisableInt = 0x80003FC0; +__osRestoreInt = 0x80003FE0; diff --git a/symbol_addrs.core1.us.v10.txt b/symbol_addrs.core1.us.v10.txt new file mode 100644 index 00000000..1ccf2ad1 --- /dev/null +++ b/symbol_addrs.core1.us.v10.txt @@ -0,0 +1,513 @@ +func_801241304 = 0x801241304; +func_8023DA20 = 0x8023DA20; +func_8023E06C = 0x8023E06C; +rarezip_get_uncompressed_size = 0x8023E080; +rarezip_init = 0x8023E08C; +rarezip_inflate = 0x8023E0A0; +rarezip_uncompress = 0x8023E0C4; +inflate = 0x8023F630; +func_802405F0 = 0x802405F0; +guScaleF = 0x80240DF8; +guScale = 0x80241304; +_guMtxIdentF_80245D44 = 0x80245D44; +guRotateRPYF = 0x80241348; +guPerspective = 0x802462D4; +spriteGetFrameCount = 0x802510C0; +spriteGetFramePtr = 0x802510C8; +get_loaded_overlay_id = 0x80251230; +is_overlay_loaded = 0x8025123C; +load_overlay = 0x80251250; +mlMtxApply = 0x80251494; +mlMtxPop = 0x802516C8; +mlMtxIdent = 0x80251B0C; +mlMtxRotate = 0x80252188; +mlMtxRotPitch = 0x80251C78; +mlMtxRotYaw = 0x80251D84; +mlMtxRotRoll = 0x80251E80; +mlMtxScale_xyz = 0x802521C0; +mlMtxScale = 0x80252280; +mlMtxTranslate = 0x80252980; + +memcpy = 0x80254608; +_heap_defragEmptyBlock = 0x8025449C; +heap_get_size = 0x802546D0; +heap_init = 0x80254710; +_heap_sortEmptyBlock = 0x80254FD0; + +malloc = 0x80254CA8; +free = 0x802550F0; +realloc = 0x80255358; +defrag = 0x802555DC; +defrag_asset = 0x80255724; + +ml_vec3f_dot_product = 0x80256034; +ml_vec3f_distance = 0x80256064; +ml_vec3f_distance_squared = 0x80256280; +ml_vec2f_length = 0x80256378; +ml_vec3f_normalize_copy = 0x802563B8; +ml_vec3f_normalize = 0x80256450; +ml_vec2f_normalize = 0x802564F0; +ml_3f_normalize = 0x80256558; +ml_vec3f_set_length_copy = 0x802565E0; +ml_vec3f_pitch_rotate_copy = 0x8025686C; +ml_vec3f_yaw_rotate_copy = 0x80256900; +ml_vec3f_roll_rotate_copy = 0x80256990; +ml_vec3f_set_length = 0x80256A24; +ml_acosf = 0x80256FE0; +ml_map_f = 0x80257B18; +mlClamp_f = 0x80257ED8; +func_802586B0 = 0x802586B0; +ml_sin_deg = 0x802587BC; +ml_cos_deg = 0x802587EC; +mlNormalizeAngle = 0x8025881C; +ml_acosValTbl = 0x80276CBC; +max_f = 0x802588DC; +min_f = 0x80258904; +mlAbsF = 0x80258964; +ml_abs_w = 0x802589CC; +func_802589E4 = 0x802589E4; +ml_vec3f_clear = 0x80258B8C; +ml_vec3f_copy = 0x80258BA4; +ml_vec3f_diff_copy = 0x80258BC0; +ml_vec3f_diff = 0x80258BF4; +ml_vec3f_assign = 0x80258C28; +ml_vec3f_add = 0x80258C48; +ml_vec3f_scale = 0x80258C7C; +ml_vec3f_scale_copy = 0x80258CB0; +ml_vec3w_to_vec3f = 0x80258D68; +ml_vec3h_to_vec3f = 0x80258DA8; +ml_vec3f_to_vec3w = 0x80258DE8; +ml_vec3f_to_vec3h = 0x80258E24; +mlDiffDegF = 0x802591D8; +comusic_8025AB44 = 0x8025AB44; +comusic_8025AB78 = 0x8025AB78; +___osGetSR = 0x8025AFE0; +_n_timeToSamples = 0x8025C378; +_n_freePVoice = 0x8025C3D8; +_n_collectPVoices = 0x8025C40C; +__n_freeParam = 0x8025C470; +__n_allocParam = 0x8025C490; +n_alAudioFrame = 0x8025C4C8; +n_alSynNew = 0x8025CA30; +alEvtqFlushType = 0x8025CD50; +alEvtqPostEvent = 0x8025CDFC; +alEvtqNextEvent = 0x8025CF20; +alEvtqNew = 0x8025CFAC; +n_alSynAddSeqPlayer = 0x8025D030; +n_alSynAddSndPlayer = 0x8025D130; +n_alSynAddPlayer = 0x8025D1A4; +n_alSynStartVoice = 0x8025D4A0; +n_alSynAllocFX = 0x8025F670; +n_alFxNew = 0x80260338; +n_alAuxBusPull = 0x80260160; +n_alEnvmixerPull = 0x80260C3C; +alN_PVoiceNew = 0x80260210; +n_alSavePull = 0x80260770; +n_alMainBusPull = 0x80262E60; +n_alResamplePull = 0x80263684; +_n_allocatePVoice = 0x8025D200; +n_alSynAllocVoice = 0x8025D208; +n_alSynSetVol = 0x8025D400; +n_alSynSetPan = 0x8025D520; +n_alSynSetPitch = 0x8025D5A0; +n_alSynSetFXMix = 0x8025D620; +n_alSynStopVoice = 0x8025D6B0; +n_alSynFreeVoice = 0x8025D720; +__n_CSPVoiceHandler = 0x8025E438; +n_alCSPNew = 0x8025EABC; +alCSPSetBank = 0x8025EC30; +alCSPStop = 0x8025EC70; +n_alCSeqNextEvent = 0x8025EDC4; +n_alCSeqNew = 0x8025F0BC; +n_alCSeqNewMarker = 0x8025F1D0; +alCSPSetSeq = 0x8025F340; +alCSPPlay = 0x8025F380; +alCSPSetVol = 0x8025F3B0; +alCSPSetTempo = 0x8025F430; +alCSPGetTempo = 0x8025F4D0; +n_alEnvmixerResampleParam = 0x802607C0; +__postNextSeqEvent = 0x80261210; +__setInstChanState = 0x802612EC; +__initFromBank = 0x802613DC; +__vsDelta = 0x80261498; +__vsVol = 0x802614BC; +__seqpReleaseVoice = 0x80261560; +__voiceNeedsNoteKill = 0x80261688; +__unmapVoice = 0x80261730; +__vsPan = 0x80261818; +__lookupVoice = 0x80261868; +__mapVoice = 0x802618DC; +__lookupSoundQuick = 0x8026194C; +__seqpStopOsc = 0x80262A88; +__initChanState = 0x80262B8C; +n_alSynStartVoiceParams = 0x80262D80; +n_alLoadParam = 0x80262EE0; +_n_decodeChunk = 0x802630A0; +n_alAdpcmPull = 0x802631BC; +n_alSynSetPriority = 0x80263B30; +bzero = 0x80263B40; +osWriteBackDCacheAll = 0x80263BE0; +__osInitialize_common = 0x80263C10; +osCreateThread = 0x80263EA0; +alCents2Ratio = 0x802641B0; +osCreateMesgQueue = 0x802642A0; +alUnlink = 0x80264430; +alLink = 0x80264460; +alClose = 0x80264484; +alInit = 0x802644BC; +alHeapDBAlloc = 0x802644F0; +osVirtualToPhysical = 0x802646A0; +osRecvMesg = 0x80264550; +osPiStartDma = 0x802647D0; +osStopThread = 0x802648E0; +osStartThread = 0x802649A0; +osWritebackDCache = 0x80264AF0; +osInvalDCache = 0x80264B70; +osCreatePiManager = 0x80264C20; +osDestroyThread = 0x80264DB0; +osSendMesg = 0x80264EB0; +osSetThreadPri = 0x80265000; +guMtxF2L = 0x802650E0; +guMtxIdentF = 0x802651E0; +guMtxIdent = 0x80265268; +guMtxL2F = 0x80265298; +gu_sqrtf = 0x80265350; +cosf = 0x80265360; +osSetTimer = 0x802659B0; +osSetEventMesg = 0x80265E60; +osCreateViManager = 0x80265ED0; +osViSwapBuffer = 0x802663F0; +osViSetEvent = 0x80266440; +osViGetNextFrameBuffer = 0x802664B0; +osViGetCurrFrameBuffer = 0x80265880; +osSetIntMask = 0x802654D0; +osViBlack = 0x802664F0; +guOrthoF = 0x80266560; +guOrtho = 0x802666B4; +guTranslateF = 0x80266720; +guTranslate = 0x80266768; +guRotateF = 0x802667C0; +guRotate = 0x80266954; +osContInit = 0x80266C10; +__osContGetInitData = 0x80266E08; +__osPackRequestData = 0x80266ED8; +osContSetCh = 0x80266FD0; +_bnkfPatchInst = 0x80267050; +alBnkfNew = 0x80267144; +alSeqFileNew = 0x80267248; +osGetTime = 0x80267290; +__alCSeqNextDelta = 0x80267C6C; +osMotorStop = 0x80267DE0; +osMotorStart = 0x80267F48; +_MakeMotorData = 0x802680B4; +osMotorInit = 0x80268230; +osPfsInit = 0x80268400; +osInvalICache = 0x802684C0; +osEepromLongWrite = 0x80268540; +osEepromLongRead = 0x80268670; +osPiReadIo = 0x80268700; +alCopy = 0x80268740; +alSaveNew = 0x802687C0; +alMainBusNew = 0x80268804; +alAuxBusNew = 0x80268858; +alResampleNew = 0x802688AC; +alLoadNew = 0x80268934; +alEnvmixerNew = 0x802689DC; +_init_lpfilter = 0x80268A80; +alFxNew = 0x80268B20; +alFxParamHdl = 0x802695F8; +alFxParam = 0x80269854; +alFxPull = 0x8026986C; +alSeqGetLoc = 0x80269BF0; +alSeqSetLoc = 0x80269C0C; +alSeqGetTicks = 0x80269C28; +readVarLen = 0x80269C38; +alSeqNextEvent = 0x80269C84; +alSeqNewMarker = 0x80269E08; +alSeqSecToTicks = 0x80269F28; +alSeqTicksToSec = 0x8026A00C; +__alSeqNextDelta = 0x8026A060; +read32 = 0x8026A0B8; +read16 = 0x8026A108; +alSeqNew = 0x8026A138; +__osSetFpcCsr = 0x8026A230; +__osSiRawReadIo = 0x8026A240; +__osSiRawWriteIo = 0x8026A290; +__osEnqueueAndYield = 0x8026A90C; +__osEnqueueThread = 0x8026AA0C; +__osPopThread = 0x8026AA54; +__osDispatchThread = 0x8026AA64; +__osCleanupThread = 0x8026ABE0; +osMapTLBRdb = 0x8026ABF0; +osPiRawReadIo = 0x8026AC50; +__osDisableInt = 0x8026ACB0; +__osRestoreInt = 0x8026ACD0; +__osDequeueThread = 0x8026ACF0; +__freePVoice = 0x8026AD90; +__freeParam = 0x8026AE28; +alAudioFrame = 0x8026AE78; +alSynNew = 0x8026B110; +alSynDelete = 0x8026B410; +osJamMesg = 0x8026B510; +osPiGetCmdQueue = 0x8026B660; +osCartRomInit = 0x8026B690; +__osPiCreateAccessQueue = 0x8026B890; +__osPiGetAccess = 0x8026B8E0; +__osPiRelAccess = 0x8026B924; +osGetThreadPri = 0x8026B950; +osPiRawStartDma = 0x8026B970; +osEPiRawStartDma = 0x8026BA50; +__osDevMgrMain = 0x8026BC80; +guNormalize = 0x8026CE10; +__osSiCreateAccessQueue = 0x8026CEA0; +__osSiGetAccess = 0x8026CEF0; +__osSiRelAccess = 0x8026CF34; +__osSiRawStartDma = 0x8026CF60; +osPfsIsPlug = 0x8026D010; +__osPfsRequestData = 0x8026D1B0; +__osPfsGetInitData = 0x8026D2AC; +__osContAddressCrc = 0x8026D380; +__osContDataCrc = 0x8026D430; +__osContRamWrite = 0x8026D500; +__osPackRamWriteData = 0x8026D704; +__osContRamRead = 0x8026D880; +__osPackRamReadData = 0x8026DA9C; + +__osSumcalc = 0x8026DD20; +__osIdCheckSum = 0x8026DD7C; +__osRepairPackId = 0x8026DDE4; +__osCheckPackId = 0x8026E1FC; +__osGetId = 0x8026E394; +__osCheckId = 0x8026E5F0; +__osPfsRWInode = 0x8026E6EC; +__osPfsSelectBank = 0x8026EA0C; +osPfsChecker = 0x8026EA80; +corrupted_init = 0x8026F144; +corrupted = 0x8026F2F8; +osEepromWrite = 0x8026F4E0; +__osPackEepWriteData = 0x8026F704; +__osEepStatus = 0x8026F810; +osEepromRead = 0x8026FA30; +__osPackEepReadData = 0x8026FC84; +alFilterNew = 0x8026FD90; +alEnvmixerParam = 0x8026FEC4; +alEnvmixerPull = 0x802702F0; +alLoadParam = 0x80270930; +alAdpcmPull = 0x80270FDC; +alResampleParam = 0x80271480; +alResamplePull = 0x8027156C; +alAuxBusParam = 0x80271780; +alAuxBusPull = 0x802717B0; +alMainBusParam = 0x80271890; +alMainBusPull = 0x802718C0; +alSaveParam = 0x802719E0; +alSavePull = 0x80271A14; +__osSiDeviceBusy = 0x80271AA0; +__osLeoInterrupt = 0x80271AD0; +__osLeoAbnormalResume = 0x80272174; +__osLeoResume = 0x8027225C; +alSynAllocFX = 0x80272350; +D_80275844 = 0x80275844; +D_80275848 = 0x80275848; +D_802759F8 = 0x802759F8; +D_80276588 = 0x80276588; +D_8027658C = 0x8027658C; +n_syn = 0x80276E84; +alGlobals = 0x80277140; +__osPiTable = 0x8027717C; +__osPiDevMgr = 0x80277160; +__osCurrentHandle = 0x80277180; +__osThreadTail = 0x80277370; +__osRunQueue = 0x80277378; +__osActiveQueue = 0x8027737C; +__osRunningThread = 0x80277380; +__osFaultedThread = 0x80277384; +__osPiAccessQueueEnabled = 0x80277390; +__osViNext = 0x80277404; +__osViCurr = 0x80277400; +__osSiAccessQueueEnabled = 0x80277420; +D_8027D020 = 0x8027D020; +D_8027D100 = 0x8027D100; +D_80280690 = 0x80280690; +piThread = 0x80283450; +piThreadStack = 0x80283600; +piEventQueue = 0x80284600; +piEventBuf = 0x80284618; +osAiGetLength = 0x80264690; +osDpSetStatus = 0x80265570; +tmp_task = 0x80284620; +bcopy = 0x8026C110; +__osSpSetPc = 0x8026C430; +__osSpRawStartDma = 0x8026C470; +osDpGetStatus = 0x80265870; +__osSetCompare = 0x8026CA70; + +__osEepromTimer = 0x80285958; +__osEepromTimerQ = 0x80285978; +__osEepromTimerMsg = 0x80285990; +CartRomHandle = 0x80285BE0; +piAccessBuf = 0x80285CE0; +__osPiAccessQueue = 0x80285CE8; +siAccessBuf = 0x80285D40; +__osSiAccessQueue = 0x80285D48; +__osSpSetStatus = 0x8026C420; +__osSpDeviceBusy = 0x8026C500; +osSpTaskLoad = 0x8026569C; +osSpTaskStartGo = 0x8026582C; +osStopTimer = 0x802658C0; +__osTimerList = 0x80277410; +osSpTaskYielded = 0x80265D50; +osSpTaskYield = 0x80265DD0; +osViSetMode = 0x80265DF0; +__osSpGetStatus = 0x8026CA80; +__ull_rshift = 0x80265A90; +__ull_rem = 0x80265ABC; +__ull_div = 0x80265AF8; +__ll_lshift = 0x80265B34; +__ll_rem = 0x80265B60; +__ll_div = 0x80265B9C; +__ll_mul = 0x80265BF8; +__ull_divremi = 0x80265C28; +__ll_mod = 0x80265C88; +__ll_rshift = 0x80265D24; +osViSetSpecialFeatures = 0x80266230; +__osPackReadData = 0x80266B1C; +osContStartReadData = 0x802669B0; +osContGetReadData = 0x80266A74; +__osContLastCmd = 0x80285950; +__osContPifRam = 0x80285910; +__osMaxControllers = 0x80285951; +__osResetGlobalIntMask = 0x802723F0; +osEPiRawWriteIo = 0x80272450; +osEPiRawReadIo = 0x802724A0; +__osSetGlobalIntMask = 0x802724F0; +osYieldThread = 0x80272540; +__osViInit = 0x8026C530; +__osViSwapContext = 0x8026CAA0; +osViModePalLan1 = 0x80277530; +osViModeMpalLan1 = 0x80277580; +osViModeNtscLan1 = 0x802775D0; +__osTimerServicesInit = 0x8026C670; +__osTimerInterrupt = 0x8026C6FC; +__osSetTimerIntr = 0x8026C874; +__osInsertTimer = 0x8026C8E8; +__osCurrentTime = 0x80285D20; +__osBaseCounter = 0x80285D28; +__osViIntrCount = 0x80285D2C; +__osTimerCounter = 0x80285D30; +osGetCount = 0x8026CE00; +__osBaseTimer = 0x80285D00; +__osViGetCurrentContext = 0x8026CA90; +__osPfsPifRam = 0x80285D60; +__osPfsGetStatus = 0x8026DC10; +__OSGlobalIntMask = 0x80277130; +osLeoDiskInit = 0x8026B790; +LeoDiskHandle = 0x80285C60; +__osDiskHandle = 0x80285CD4; +__osAiDeviceBusy = 0x8026B4E0; +osAiSetNextBuf = 0x80264720; +osAiSetFrequency = 0x802642D0; +osViClock = 0x80277128; +__osProbeTLB = 0x8026B420; +viMgrMain = 0x80266058; +__osViDevMgr = 0x80277190; +viThread = 0x802846E0; +viThreadStack = 0x80284890; +viEventQueue = 0x80285890; +viEventBuf = 0x802858A8; +viRetraceMsg = 0x802858C0; +viCounterMsg = 0x802858D8; +retrace = 0x802858F0; +__osEventStateTab = 0x80284660; +__osRcpImTable = 0x80278C60; +osSyncPrintf = 0x80269BB0; +rmonPrintf = 0x80269BCC; +dtor = 0x80285900; +__osContinitialized = 0x802771B0; +osClockRate = 0x80277120; +_MotorStopData = 0x802859A0; +_MotorStartData = 0x80285AA0; +_motorstartbuf = 0x80285BC0; +_motorstopbuf = 0x80285BA0; +__osSetSR = 0x8026A210; +__osGetSR = 0x8026A220; +__osEepPifRam = 0x80285DA0; + + +alCSeqGetLoc = 0x80267320; +alCSeqSetLoc = 0x802673C0; +alCSeqNextEvent = 0x80267584; +alCSeqNew = 0x8026787C; +alCSeqNewMarker = 0x80267990; +alCSeqSecToTicks = 0x80267B04; +alCSeqTicksToSec = 0x80267C00; +alHeapInit = 0x80264200; + +sinf = 0x80263FF0; +__libm_qnan_f = 0x80278DB0; + +write_file_blocks = 0x80255B30; +load_file_blocks = 0x80255BAC; + +sns_init_base_payloads = 0x8025B280; +sns_get_or_set_key = 0x8025B2EC; +sns_unlock_parsed_items = 0x8025B69C; +sns_generate_payload = 0x8025B6C0; +sns_write_payload_over_heap = 0x8025B700; +sns_stub = 0x8025B808; +DEBUG_use_special_bootmap = 0x8025B810; +sns_get_item_state = 0x8025B820; +sns_set_item_state = 0x8025B998; +sns_set_item_and_update_payload = 0x8025BBD4; +snspayload_validate = 0x8025BE30; +snspayload_find_payload_in_ram = 0x8025BE84; +snspayload_rewind_incoming = 0x8025C010; +snspayload_get_next_key = 0x8025C01C; + +heap_occupiedBytes = 0x80276590; + + +snsToRestoreItems = 0x80276E40; +snsBasePayloadPtr1 = 0x80276E44; +snsBasePayloadPtr2 = 0x80276E48; +snsBasePayloadPtr3 = 0x80276E4C; +snsBasePayloadPtr4 = 0x80276E50; +snsPayloadOutCurrPos = 0x80276E60; + +g_AudioManager = 0x8027BF40; + +freeOscStateList = 0x8027DD84; +oscStates = 0x8027DD88; + +D_80283008 = 0x80283008; +heap_requested_size = 0x80283230; +snsParsedKeys = 0x80283390; +gSaveData = 0x80283400; +snsMinKeyToParse = 0x80283420; +snsMaxKeyToParse = 0x80283424; +snsParsedCurrPos = 0x80283428; +snsBackedUpItems = 0x8028342C; +snsPayloadInCurrPos = 0x80283430; +__osFinalrom = 0x80283440; + +glcrc_calc_checksum = 0x8025C100; + +D_8027BEEC = 0x8027BEEC; +D_803688E0 = 0x803688E0; +D_803688E8 = 0x803688E8; +D_80373DF0 = 0x80373DF0; +D_80373DF8 = 0x80373DF8; +D_80373E00 = 0x80373E00; +D_80373E18 = 0x80373E18; +D_80378F60 = 0x80378F60; +D_80378F64 = 0x80378F64; +D_80378F68 = 0x80378F68; +carriedObject_actorID = 0x8037BF78; +D_8037C564 = 0x8037C564; +D_80397AD0 = 0x80397AD0; + +D_80277A74 = 0x80277A74; + +D_A0000238 = 0xA0000238; + +D_80278278 = 0x80278278; diff --git a/symbol_addrs.core2.us.v10.txt b/symbol_addrs.core2.us.v10.txt new file mode 100644 index 00000000..3be14f6d --- /dev/null +++ b/symbol_addrs.core2.us.v10.txt @@ -0,0 +1,513 @@ +animctrl_new = 0x802872E0; +animctrl_free = 0x80287394; +animctrl_update = 0x802873C0; +animctrl_defrag = 0x80287434; +animctrl_setIndex = 0x8028745C; +animctrl_getAnimPtr = 0x80287464; +animctrl_reset = 0x802874AC; +_func_802875AC = 0x802875AC; +animctrl_setAnimTimer = 0x8028764C; +animctrl_setPlaybackType = 0x80287674; +animctrl_setDirection = 0x8028767C; +animctrl_setSmoothTransition = 0x80287684; +animctrl_setDuration = 0x8028768C; +animctrl_setTransitionDuration = 0x802876C0; +animctrl_setSubRange = 0x802876CC; +animctrl_getSubRange = 0x80287738; +animctrl_getIndex = 0x80287790; +animctrl_getPlaybackType = 0x802877B0; +animctrl_isPlayedForwards = 0x802877B8; +animctrl_isSmoothTransistion = 0x802877C0; +animctrl_getDuration = 0x802877C8; +animctrl_getTransitionDuration = 0x802877D0; +animctrl_getAnimTimer = 0x802877D8; +animctrl_isStopped = 0x802878C4; +animctrl_isAt = 0x802878E8; +animctrl_isContiguous = 0x80287A40; +animctrl_isAt = 0x802878E8; +anim_getIndex = 0x80289688; +anim_setIndex = 0x8028977C; +anim_setTimer = 0x80289784; + +_player_getAnimCtrlPtr = 0x80289F64; +player_isSliding = 0x8028B338; +player_getTransformation = 0x8028E7CC; +ability_isUnlocked = 0x8028F190; +ability_unlock = 0x8028F3B8; +can_beak_barge = 0x8028A960; +can_beak_bust = 0x8028A9A0; +can_claw = 0x8028A9E0; +can_dive = 0x8028AA20; +can_egg = 0x8028AA98; +can_flap = 0x8028AAB8; +can_flip = 0x8028AB08; +can_peck = 0x8028AB68; +can_trot = 0x8028AC78; +can_wonderwing = 0x8028ACB8; +player_shouldSlideTrot = 0x8028B1E0; +player_inWater = 0x8028B51C; +_player_getMarker = 0x8028D5D0; +carriedObject_setActorID = 0x8028D658; +carriedObject_getActorID = 0x8028D670; +player_getActiveHitbox = 0x8028E76C; +player_getAnimCtrlPtr = 0x8028E78C; +player_getMarker = 0x8028E7AC; +func_8028E7EC9 = 0x8028E7EC9; +player_getPosition = 0x8028E9A4; +player_getRotation = 0x8028EC24; +player_getVelocity = 0x8028EF68; +player_is_in_jiggy_jig = 0x8028F108; +player_is_present = 0x8028F1D4; +func_8028F45C = 0x8028F45C; +func_80291A60 = 0x80291A60; +banjo_getPosition = 0x80292468; +func_802947CC = 0x802947CC; +get_slope_timer = 0x802949D4; +should_beak_barge = 0x80294F00; +should_beak_bust = 0x80294F3C; +should_poop_egg = 0x80295068; +should_shoot_egg = 0x802950A4; +should_flap = 0x802950E0; +should_flip = 0x8029511C; +should_peck = 0x80295158; +should_dive = 0x80295194; +should_trot = 0x80295214; +should_wonderwing = 0x80295250; +button_pressed = 0x80295544; +button_held = 0x8029557C; +button_released = 0x80295590; +ability_use = 0x80295610; +ability_hasUsed = 0x802957A0; +ability_setHasUsed = 0x802957B8; +ability_hasLearned = 0x802957D8; +player_setYVelocity = 0x802979A0; +_get_velocity = 0x80297A88; +gravity_reset = 0x80297B70; +gravity_set = 0x80297BEC; +__pitch_update = 0x80297D30; +pitch_reset = 0x80297ED0; +pitch_update = 0x80297F10; +pitch_setIdeal = 0x80297F3C; +pitch_set = 0x80297F60; +pitch_applyIdeal = 0x80297F84; +pitch_get = 0x80297F98; +pitch_getIdeal = 0x80297FA4; +pitch_setAngVel = 0x80297FB0; +climbClear = 0x802981E0; +climbGetBottom = 0x80298220; +climbGetBottomY = 0x80298244; +climbGetRadius = 0x80298250; +climbGetTopY = 0x80298268; +climbSet = 0x80298274; +climbRelease = 0x802983AC; +player_setPosition = 0x802984A0; +player_setYPosition = 0x802984C8; +_player_getPosition = 0x802984D4; +player_getYPosition = 0x802984F8; +__roll_update = 0x80298AD0; +roll_reset = 0x80298C70; +roll_update = 0x80298CB4; +roll_setIdeal = 0x80298CE0; +roll_set = 0x80298D04; +roll_applyIdeal = 0x80298D28; +roll_get = 0x80298D3C; +roll_getIdeal = 0x80298D48; +roll_setAngularVelocity = 0x80298D54; +yaw_update = 0x80299118; +yaw_setIdeal = 0x802991B4; +yaw_set = 0x802991D8; +yaw_applyIdeal = 0x802991FC; +yaw_get = 0x8029921C; +yaw_getIdeal = 0x80299228; +bsList_clearAll = 0x8029A600; +bsList_setInitMethod = 0x8029A668; +bsList_setUpdateMethod = 0x8029A67C; +bsList_setEndMethod = 0x8029A690; +bsList_setInterruptMethod = 0x8029A6A4; +bsList_getInitMethod = 0x8029A6B8; +bsList_getUpdateMethod = 0x8029A6CC; +bsList_getEndMethod = 0x8029A6E0; +bsList_getInterruptMethod = 0x8029A6F4; +bs_clearState = 0x8029A710; +bs_setState = 0x8029A72C; +bs_getPrevState = 0x8029A7BC; +bs_getState = 0x8029A7C8; +bs_getNextState = 0x8029A7D4; +bs_updateState = 0x8029A7E0; +bs_checkInterrupt = 0x8029A81C; +bs_getInterruptType = 0x8029A878; +_player_getTransformation = 0x8029A8F4; +bsdrone_init = 0x802AE3D0; +bsdrone_update = 0x802AE410; +bsdrone_end = 0x802AE450; +bsdrone_interrupt = 0x802AE490; +bsant_inSet = 0x8029E598; +bsbarge_init = 0x8029F650; +bsbarge_update = 0x8029F77C; +bsbarge_end = 0x8029FAE8; +bsbeefly_enter = 0x802A0A2C; +bsbeefly_update = 0x802A0B14; +bsbeefly_end = 0x802A0F58; +bsBeeFly_inSet =0x802A0F78; +bsbeemain_die_init = 0x802A1C28; +bsbfly_inSet = 0x802A3778; +bslongleg_inSet = 0x802A52AC; +bsbtrot_inSet = 0x802A9B98; +bscarry_inSet = 0x802AB184; +bsclimb_inSet = 0x802AB800; +bsjig_inJiggyJig = 0x802B0A60; +bsjig_setJiggyMarkerPtr = 0x802B0A6C; +bspumpkin_inSet = 0x802B2304; +bsstand_init = 0x802B4998; +bsstand_update = 0x802B4D20; +bsstand_end = 0x802B5248; +bstwirl_hitboxActive = 0x802B6A40; +set_camera_to_node = 0x802BAE20; +func_802C4140 = 0x802C4140; +func_802C418C = 0x802C418C; +func_802C4218 = 0x802C4218; +_mapSpecificFlags_calcCRC1 = 0x802CAC60; +_mapSpecificFlags_updateCRCs = 0x802CAC7C; +mapSpecificFlags_clearAll = 0x802CACD4; +mapSpecificFlags_get = 0x802CACF8; +mapSpecificFlags_getN = 0x802CAD24; +mapSpecificFlags_getClear = 0x802CAD8C; +mapSpecificFlags_set = 0x802CADC0; +mapSpecificFlags_setN = 0x802CAE24; +mapSpecificFlags_getAll = 0x802CAE8C; +mapSpecificFlags_setAll = 0x802CAE98; +mapSpecificFlags_validateCRC1 = 0x802CB00C; +func_802D1724 = 0x802D1724; +func_802D94B4 = 0x802D94B4; +func_802DA498 = 0x802DA498; +func_802DB548 = 0x802DB548; +func_802E0738 = 0x802E0738; +func_802E07E0 = 0x802E07E0; +mapSavestate_free_all = 0x802E2E7C; +mapSavestate_defrag_all = 0x802E2ED4; +mapSavestate_save = 0x802E2F2C; +mapSavestate_apply = 0x802E30AC; +getGameMode = 0x802E49FC; +vtxList_getVertices = 0x802EC450; +vtxList_free = 0x802EC994; +vtxList_clone = 0x802EC9B4; +vtxList_tint = 0x802ECA7C; +vtxList_recolor = 0x802ED074; + +array_clear = 0x802EDA40; +array_at = 0x802EDA7C; +array_size = 0x802EDA94; +array_begin = 0x802EDA9C; +array_free = 0x802EDC64; +array_new = 0x802EDC84; +array_defrag = 0x802EDD00; + +__particleEmitter_initParticle = 0x802EEA9C; +particleEmitter_emitN = 0x802EF5C8; +particleEmitter_new = 0x802EF6AC; +particleEmitter_setSprite = 0x802EF950; +particleEmitter_setParticleAccelerationRange = 0x802EF9AC; +particleEmitter_setParticleCallback = 0x802EFA10; +particleEmitter_setStartingFrameRange = 0x802EFA90; +particleEmitter_setParticleFramerateRange = 0x802EFA9C; +particleEmitter_setModel = 0x802EFAC8; +particleEmitter_setParticleSpawnPositionRange = 0x802EFB1C; +particleEmitter_setPosition = 0x802EFB54; +particleEmitter_setVelocityAndAccelerationRanges = 0x802EFC84; +particleEmitter_setPositionAndVelocityRanges = 0x802EFD00; +particleEmitter_setPositionVelocityAndAccelerationRanges = 0x802EFD7C; +particleEmitter_setSpawnIntervalRange = 0x802EFE5C; +particleEmitter_setParticleVelocityRange = 0x802EFED4; +particleEmitter_setSphericalParticleVelocityRange = 0x802EFF10; +particleEmitter_setSpawnInterval = 0x802EFFC4; +particleEmitter_update = 0x802EFFE4; +partEmitList_pushNew = 0x802F0BD0; + +vector_clear = 0x802ED620; +vector_getBegin = 0x802ED62C; +vector_at = 0x802ED634; +vector_getIndex = 0x802ED650; +vector_size = 0x802ED690; +vector_getEnd = 0x802ED6D4; +vector_pushBackNew = 0x802ED6DC; +vector_insertNew = 0x802ED7C0; +vector_free = 0x802ED8A4; +vector_new = 0x802ED8C4; +vector_remove = 0x802ED914; +vector_popBack_n = 0x802ED984; +vector_assign = 0x802ED9A0; +vector_defrag = 0x802ED9E0; +_gcbound_draw = 0x802EE420; +gcbound_draw = 0x802EE508; +gcbound_alpha = 0x802EE548; +gcbound_color = 0x802EE590; +gcbound_reset = 0x802EE5AC; +_printbuffer_draw_letter = 0x802F55D8; +printbuffer_draw = 0x802F6E94; +_printbuffer_push_new = 0x802F77A8; +print_bold_spaced = 0x802F78C0; +print_dialog = 0x802F78FC; +print_dialog_w_bg = 0x802F7938; +print_dialog_gradient = 0x802F7974; +itemPrint_getValue = 0x802FAE1C; +func_802FDCB8 = 0x802FDCB8; +cube_positionToIndices = 0x80303174; +cube_volumeToIndices = 0x80303228; +cube_atIndices = 0x80303384; +cube_atPosition_s32 = 0x80303470; +nodeprop_getRadius = 0x80304D3C; +nodeprop_getPosition = 0x80304D68; +spawnableActorList_add = 0x803053E8; +map_getLevel = 0x8030AD48; +gctransition_8030B740 = 0x8030B740; +gctransition_draw = 0x8030B778; +gctransition_8030BD4C = 0x8030BD4C; +gctransition_8030BD88 = 0x8030BD88; +gctransition_8030BD98 = 0x8030BD98; +gctransition_8030BDAC = 0x8030BDAC; +gctransition_8030BDC0 = 0x8030BDC0; +gctransition_8030BE60 = 0x8030BE60; +gctransition_8030BEA4 = 0x8030BEA4; +gctransition_reset = 0x8030BEDC; +gctransition_update = 0x8030BF1C; +sfxsource_setSfxId = 0x8030DA80; +sfxsource_setSampleRate = 0x8030DABC; +gczoombox_free = 0x80315374; +_gczoombox_memClear = 0x80315430; +gczoombox_draw = 0x80316B8C; +gczoombox_new = 0x80317E8C; +gczoombox_open = 0x803183EC; +gczoombox_close = 0x803183FC; +gczoombox_maximize = 0x8031840C; +gczoombox_minimize = 0x8031841C; +gczoombox_highlight = 0x803185D8; +jiggyscore_clearAll_debug = 0x80320F10; +jiggyscore_clearAllSpawned = 0x80320F38; +jiggyscore_getPtr = 0x80320F70; +jiggyscore_isSpawned = 0x80320F7C; +jiggyscore_isCollected = 0x80320FE0; +jiggyscore_debug = 0x80321034; +jiggyscore_clearAll = 0x8032103C; +jiggyscore_setCollected = 0x8032108C; +jiggyscore_setSpawned = 0x80321120; +jiggyscore_leveltotal = 0x803211AC; +jiggyscore_total = 0x8032123C; +jiggyscore_info = 0x8032128C; +honeycombscore_get = 0x803212E4; +honeycombscore_get_level_total = 0x803213F8; +honeycombscore_get_total = 0x8032149C; +mumboscore_get = 0x80321544; +mumboscore_debug = 0x80321598; +mumboscore_set = 0x803215D0; +level_get = 0x80321900; +_levelSpecificFlags_calcCRC1 = 0x80321C90; +_levelSpecificFlags_updateCRC1 = 0x80321D34; +_levelSpecificFlags_calcCRC2 = 0x80321D98; +_levelSpecificFlags_updateCRC2 = 0x80321E3C; +levelSpecificFlags_get = 0x80321EE4; +levelSpecificFlags_getN = 0x80321F0C; +levelSpecificFlags_getSet = 0x80321F3C; +levelSpecificFlags_clear = 0x80321F74; +levelSpecificFlags_set = 0x80321FC4; +levelSpecificFlags_setN = 0x80322004; +levelSpecificFlags_validateCRC1 = 0x8032204C; +levelSpecificFlags_validateCRC2 = 0x803220B4; +level_to_overlay = 0x80322E94; +timed_playSfx = 0x80324C88; +timed_setCameraToNode = 0x80324E60; +timedFunc_set_0 = 0x80324EAC; +timedFunc_set_1 = 0x80324EE4; +timedFunc_set_2 = 0x80324F20; +timedFunc_set_3 = 0x80324F64; +timedFunc_set_4 = 0x80324FAC; +timedFunc_set_5 = 0x80324FF8; +timedFunc_set_6 = 0x80325048; +timedJiggySpawn = 0x80325098; +timedFuncQueue_is_empty = 0x803250DC; +timedFuncQueue_flush = 0x80325104; +timedFuncQueue_init = 0x803251A0; +timedFuncQueue_update = 0x803251D4; +func_80325340 = 0x80325340; +func_80325E78 = 0x80325E78; +func_80325F2C = 0x80325F2C; +func_80326224 = 0x80326224; +actor_setOpacity = 0x8032628C; +actor_new = 0x803272F8; +spawn_child_actor = 0x8032818C; +marker_despawn = 0x803282F4; +actor_animationIsAt = 0x8032886C; +actor_playerIsWithinDist = 0x80329588; +actor_playAnimationOnce = 0x803298AC; +actor_loopAnimation = 0x803298D8; +marker_getActor = 0x80329958; +actor_copy = 0x80329C40; +actors_appendToSavestate = 0x80329CBC; +actor_collisionOff = 0x8032AA74; +actor_collisionOn = 0x8032AA88; +__marker_draw = 0x8032D190; +cube_free = 0x8032E07C; +marker_free = 0x8032F430; +marker_setCollisionScripts = 0x803300A8; +map_get = 0x803348C0; +jiggySpawn = 0x803330C0; +set_model_render_mode = 0x8033A4CC; +assetcache_release = 0x8033B3D8; +assetcache_update_ptr = 0x8033B574; +assetcache_get = 0x8033B798; +savedata_update_crc = 0x8033BFD0; +strcat = 0x8033D660; +strcatc = 0x8033D6A8; +strFToA = 0x8033D6E0; +_strFToA = 0x8033D7B0; +strIToA = 0x8033D884; +_strIToA = 0x8033D8A4; +strcmp = 0x8033D9D4; +strcpy = 0x8033DA54; +strlen = 0x8033DA80; +strcmpToTok = 0x8033DAB0; +strtok = 0x8033DB18; +strcpyToTok = 0x8033DB60; +strToUpper = 0x8033DBA4; +time_getDelta = 0x8033DD9C; +projectile_setSprite = 0x8033FBC8; +projectile_setPosition = 0x8033FEC8; +projectile_getPosition = 0x8033FF10; +item_inc = 0x80345F24; +item_dec = 0x80345F44; +item_empty = 0x80345F74; +item_getCount = 0x80345FA0; +item_set = 0x80346414; +notescore_getTotal = 0x80346EEC; +notescore_getLevelScore = 0x80346F34; +demo_readInput = 0x80349EE4; +demo_load = 0x8034A06C; +demo_free = 0x8034A0EC; +randf = 0x8034A390; +randf2 = 0x8034A754; +randi2 = 0x8034A7BC; +D_80364564 = 0x80364564; +D_8036497C = 0x8036497C; +D_80364A94 = 0x80364A94; +D_80364AA4 = 0x80364AA4; +D_80364AA8 = 0x80364AA8; +D_80364B04 = 0x80364B04; +D_80364B24 = 0x80364B24; +D_80364D0C = 0x80364D0C; +D_80364DF4 = 0x80364DF4; +D_803657E0 = 0x803657E0; +D_80365D50 = 0x80365D50; +D_80365D58 = 0x80365D58; +D_80366240 = 0x80366240; +D_80366338 = 0x80366338; +D_8036633C = 0x8036633C; +D_80367DC4 = 0x80367DC4; +D_803682D0 = 0x803682D0; +D_803688E0 = 0x803688E0; +D_803688E8 = 0x803688E8; +sSpawnableActorSize = 0x8036A9B0; +sSpawnableActorList = 0x8036A9B4; +D_8036B810 = 0x8036B810; +D_8036D940 = 0x8036D940; +modelCache = 0x8036E7C0; +D_80370990 = 0x80370990; +D_80371E30 = 0x80371E30; +D_803745D0 = 0x803745D0; +D_803745DC = 0x803745DC; +D_80374980 = 0x80374980; +D_803749F8 = 0x803749F8; +D_80374A00 = 0x80374A00; +D_80374A28 = 0x80374A28; +D_803758D8 = 0x803758D8; +D_80375D58 = 0x80375D58; +D_80375F88 = 0x80375F88; +D_803762F0 = 0x803762F0; +D_80376468 = 0x80376468; +D_803765E4 = 0x803765E4; +D_80376650 = 0x80376650; +D_80376658 = 0x80376658; +D_803772D0 = 0x803772D0; +D_80373DF0 = 0x80373DF0; +D_80373DF8 = 0x80373DF8; +D_80373E00 = 0x80373E00; +D_80373E18 = 0x80373E18; +D_80374C80 = 0x80374C80; +D_80376410 = 0x80376410; +D_80376990 = 0x80376990; +D_80377320 = 0x80377320; +D_803774B0 = 0x803774B0; +D_803774B8 = 0x803774B8; +D_80378440 = 0x80378440; +D_80378DDC = 0x80378DDC; +D_80378F48 = 0x80378F48; +D_80378F60 = 0x80378F60; +D_80378F64 = 0x80378F64; +D_80378F68 = 0x80378F68; +D_80379080 = 0x80379080; +D_80379084 = 0x80379084; +D_80379308 = 0x80379308; +D_80379318 = 0x80379318; +D_80379328 = 0x80379328; +D_80379348 = 0x80379348; +D_80379530 = 0x80379530; +D_80379538 = 0x80379538; +D_80379630 = 0x80379630; +D_80379638 = 0x80379638; +D_80379660 = 0x80379660; +D_80379670 = 0x80379670; +playerMarker = 0x8037BF70; +carriedObject_actorID = 0x8037BF78; +D_8037C078 = 0x8037C078; +climbPoleBottom = 0x8037C560; +D_8037C564 = 0x8037C564; +climbPoleTop = 0x8037C570; +climbRadius = 0x8037C57C; +player_position = 0x8037C5A0; +_bsclawHitboxActive = 0x8037D3C0; +_bscrocHitboxActive = 0x8037D3E4; +_bstwirlHitboxActive = 0x8037D5A5; +D_8037DDA0 = 0x8037DDA0; +D_8037DDA4 = 0x8037DDA4; +_gcbound_red = 0x80380900; +_gcbound_green = 0x80380901; +_gcbound_blue = 0x80380902; +func_80320044 = 0x80320044; +D_80370600 = 0x80370600; +D_803837D0 = 0x803837D0; +D_80374388 = 0x80374388; +D_80374CD8 = 0x80374CD8; +D_80374CF0 = 0x80374CF0; +D_80375528 = 0x80375528; +D_803757A8 = 0x803757A8; +D_80375F60 = 0x80375F60; +D_80376180 = 0x80376180; +D_80376188 = 0x80376188; +D_80376290 = 0x80376290; +D_80376668 = 0x80376668; +D_803766F8 = 0x803766F8; +D_80376F68 = 0x80376F68; +D_80376FE8 = 0x80376FE8; +D_80377088 = 0x80377088; +D_80377318 = 0x80377318; +D_803788C0 = 0x803788C0; +D_803788F0 = 0x803788F0; +D_80378E38 = 0x80378E38; +D_803791A8 = 0x803791A8; +D_80379208 = 0x80379208; +D_80379210 = 0x80379210; +D_80379400 = 0x80379400; +D_80379458 = 0x80379458; +D_80379460 = 0x80379460; +D_80379478 = 0x80379478; +D_803794C8 = 0x803794C8; +D_803794D0 = 0x803794D0; +D_80379508 = 0x80379508; +D_80379A78 = 0x80379A78; +D_8037DB38 = 0x8037DB38; +print_sFonts = 0x80380AD0; +print_sPrintBuffer = 0x80380AE0; +print_sCurrentPtr = 0x80380AE4; +print_sInFontFormatMode = 0x80380B08; +jiggyscore = 0x803832C0; +sHoneycombScore = 0x803832E0; +sMumboTokenScore = 0x803832F0; +assetCache_depCount = 0x80383CD8; diff --git a/symbol_addrs.global.us.v10.txt b/symbol_addrs.global.us.v10.txt new file mode 100644 index 00000000..1c64af3c --- /dev/null +++ b/symbol_addrs.global.us.v10.txt @@ -0,0 +1,68 @@ +D_A00001D8 = 0xA00001D8; +D_5E90 = 0x5E90; +D_D846C0 = 0xD846C0; +D_D954B0 = 0xD954B0; +D_EA3EB0 = 0xEA3EB0; +D_EADE60 = 0xEADE60; +D_1048560 = 0x1048560; + +osRomBase = 0x80000308; + + +bkboot_inflate = 0x80001B00; + +func_800020DC = 0x800020DC; + +func_802D3D54 = 0x802D3D54; + +D_80363590 = 0x80363590; + +D_803772C8 = 0x803772C8; +D_803772D0 = 0x803772D0; + +D_8037536C = 0x8037536C; + + + +__freePVoice = 0x8026AD90; + +__heap_align = 0x80254470; +osViGetNextFrameBuffer = 0x802664B0; +osViGetCurrFrameBuffer = 0x80265880; +__osEnqueueAndYield = 0x8026A90C; +__osEnqueueThread = 0x8026AA0C; +__osPopThread = 0x8026AA54; +__osDispatchThread = 0x8026AA64; +__osCleanupThread = 0x8026ABE0; +__osDisableInt = 0x8026ACB0; +__osRestoreInt = 0x8026ACD0; +D_A0000238 = 0xA0000238; +D_803682D0 = 0x803682D0; + +D_80004FF4 = 0x80004FF4; + +D_8023DA20 = 0x8023DA20; +func_8023DA20 = 0x8023DA20; + +D_8027BEF0 = 0x8027BEF0; + + +func_8028F9DC = 0x8028F9DC; +func_80295864 = 0x80295864; + + +func_802DA498 = 0x802DA498; + +func_80325888 = 0x80325888; + +D_80390C1E = 0x80390C1E; +D_80391738 = 0x80391738; +D_80391780 = 0x80391780; +D_803917A4 = 0x803917A4; +D_80392DA8 = 0x80392DA8; +D_80392DB8 = 0x80392DB8; +D_80392DC8 = 0x80392DC8; +D_803923E4 = 0x803923E4; +D_80392914 = 0x80392914; +D_80394D50 = 0x80394D50; +D_803907B0 = 0x803907B0; \ No newline at end of file diff --git a/tools/asm-differ b/tools/asm-differ new file mode 160000 index 00000000..eaf72269 --- /dev/null +++ b/tools/asm-differ @@ -0,0 +1 @@ +Subproject commit eaf72269cf7329bc061e50d8788229575f656f06 diff --git a/tools/asm-processor b/tools/asm-processor new file mode 160000 index 00000000..56ecf52f --- /dev/null +++ b/tools/asm-processor @@ -0,0 +1 @@ +Subproject commit 56ecf52f2c7977af411461f6425624d8f625fc43 diff --git a/tools/bk_asset_tool b/tools/bk_asset_tool new file mode 160000 index 00000000..2e759b57 --- /dev/null +++ b/tools/bk_asset_tool @@ -0,0 +1 @@ +Subproject commit 2e759b5716b42649ebb90429c6eb8c593370034f diff --git a/tools/bk_crc/bk_crc b/tools/bk_crc/bk_crc new file mode 100755 index 00000000..541419ab Binary files /dev/null and b/tools/bk_crc/bk_crc differ diff --git a/tools/bk_crc/bk_crc.cpp b/tools/bk_crc/bk_crc.cpp new file mode 100644 index 00000000..e8d838d4 --- /dev/null +++ b/tools/bk_crc/bk_crc.cpp @@ -0,0 +1,73 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef enum{ + BINARY, + DEFINES, +} OutType; + +typedef std::pair CRC; + +CRC bk_crc(const std::vector &buffer){ + CRC crc = {0, 0xFFFFFFFF}; + for (auto byte : buffer){ + crc.first += byte; + crc.second ^= (byte << (crc.first & 0x17)); + } + return crc; +} + +/* calculate Banjo-Kazooie CRC and write value to bin OR txt file with gcc defines */ +/// -D output as defines +int main(int argc, char *argv[]){ + struct { + OutType type; + std::string name; + } config = {BINARY, ""}; + + //parse arguments + for(int i = 1; i < argc - 1; i++){ + std::string argi = argv[i]; + if(argi == "-D" || argi == "-d") //no loop + config.type = DEFINES; + config.name = argv[++i]; + std::transform(config.name.begin(), config.name.end(), config.name.begin(), ::toupper); + } + + std::string in_bin = argv[argc -1]; + std::ifstream in_f(in_bin, std::ios::in | std::ios::binary | std::ios::ate); + size_t in_size = in_f.tellg(); + in_f.seekg(0); + std::vector in_data; + in_data.resize(in_size); + in_f.read(reinterpret_cast(in_data.data()), in_size); + + auto result = bk_crc(in_data); + + switch(config.type){ + case OutType::BINARY: + std::cout << (char)((result.first >> 24) & 0xff) << (char)((result.first >> 16) & 0xff) << (char)((result.first >> 8) & 0xff) << (char)((result.first >> 0) & 0xff); + std::cout << (char)((result.second >> 24) & 0xff) << (char)((result.second >> 16) & 0xff) << (char)((result.second >> 8) & 0xff) << (char)((result.second >> 0) & 0xff); + std::cout << std::flush; + break; + + case OutType::DEFINES: + std::cout << "-D'" << config.name << "_CRC1=0x"; + std::cout << std::hex < str: + in_file = os.path.relpath(in_file, root_dir) + cpp_command = ["gcc", "-E", "-P", "-dM", *CPP_FLAGS, in_file] + cpp_command2 = ["gcc", "-E", "-P", *CPP_FLAGS, in_file] + + out_text = "" + try: + out_text += subprocess.check_output(cpp_command, cwd=root_dir, encoding="utf-8") + out_text += subprocess.check_output(cpp_command2, cwd=root_dir, encoding="utf-8") + except subprocess.CalledProcessError: + print( + "Failed to preprocess input file, when running command:\n" + + cpp_command, + file=sys.stderr, + ) + sys.exit(1) + + if not out_text: + print("Output is empty - aborting") + sys.exit(1) + return out_text + +def main(): + parser = argparse.ArgumentParser( + description="""Create a context file which can be used for mips_to_c""" + ) + parser.add_argument( + "c_file", + help="""File from which to create context""", + ) + args = parser.parse_args() + + output = import_c_file(args.c_file) + + with open(os.path.join(root_dir, "ctx.c"), "w", encoding="UTF-8") as f: + f.write(output) + + +if __name__ == "__main__": + main() diff --git a/tools/mips_to_c_ctx.sh b/tools/mips_to_c_ctx.sh new file mode 100755 index 00000000..f67e595b --- /dev/null +++ b/tools/mips_to_c_ctx.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +./tools/m2ctx.py $1 + +sed -i 's/\[\]/\[0\]/g' ctx.c +sed -i 's/sizeof(long)/8/g' ctx.c diff --git a/tools/n64splat b/tools/n64splat new file mode 160000 index 00000000..c17b8ee1 --- /dev/null +++ b/tools/n64splat @@ -0,0 +1 @@ +Subproject commit c17b8ee10d1de84d4f70530c642baf7f8c36c858 diff --git a/tools/progress.py b/tools/progress.py new file mode 100644 index 00000000..356745a0 --- /dev/null +++ b/tools/progress.py @@ -0,0 +1,87 @@ +import argparse +import os +import re +import sys +import subprocess +import glob + +def get_functions(elffile, section, ending=None): + try: + result = subprocess.run(['objdump', '-x', elffile], stdout=subprocess.PIPE) + nm_lines = result.stdout.decode().split("\n") + except: + sys.stderr.write(f"Error: Could not run objdump on {elffile} - make sure that the project is built") + sys.exit(1) + + functions = {} + + for line in nm_lines: + if f"g F {section}" in line or "g F *ABS* " in line: + components = line.split() + size = int(components[4], 16) + name = components[5] + functions[name] = {"function": name, "length": size} + + return functions + +def generate_csv(functions, nonmatching_funcs, version, section): + ret = [] + ret.append("version,section,function,length,matching") + for func in functions: + length = functions[func]["length"] + if length > 0: + matching = "no" if func in nonmatching_funcs else "yes" + ret.append(f"{version},{section},{func},{length},{matching}") + return "\n".join(ret) + +def get_nonmatching_funcs(basedir, subcode): + grepstr = r'#pragma GLOBAL_ASM\(.*/\K.*(?=\.s)' + if subcode: + try: + funcs = set(subprocess.check_output(['grep', '-ohPR', grepstr, basedir + '/src/' + subcode]).decode('ascii').split()) + except subprocess.CalledProcessError as grepexc: + if grepexc.returncode != 1: + raise grepexc + funcs = set() + else: + args = ['grep', '-ohPs', '-d', 'skip', grepstr] + args.extend(glob.glob(basedir + '/src/*')) + try: + funcs = set(subprocess.check_output(args).decode('ascii').split()) + except subprocess.CalledProcessError as grepexc: + if grepexc.returncode != 1: + raise grepexc + funcs = set() + try: + funcs = funcs.union(set(subprocess.check_output(['grep', '-ohPR', grepstr, basedir + '/src/done']).decode('ascii').split())) + except subprocess.CalledProcessError as grepexc: + if grepexc.returncode != 1: + raise grepexc + return funcs + + +def main(basedir, elffile, section, ending, version, subcode): + functions = get_functions(elffile, section, ending) + section_name = section.split("_")[-1] # .code_game -> game + nonmatching_funcs = get_nonmatching_funcs(basedir, subcode) + csv = generate_csv(functions, nonmatching_funcs, version, section_name) + print(csv) + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Create progress csv based on map file', + formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument('basedir', type=str, + help="base directory (containing src/)") + parser.add_argument('elffile', type=str, + help=".elf file to be read") + parser.add_argument('section', type=str, + help=".text section of the map") + parser.add_argument('--ending', type=str, + help="section name that marks the end of 'section'") + parser.add_argument('--version', type=str, default='us', + help="ROM version, us, eu, debug, ects") + parser.add_argument('--subcode', type=str, default=None, + help="Subcode for section to get progress of") + args = parser.parse_args() + + main(args.basedir, args.elffile, args.section, args.ending, args.version, args.subcode) \ No newline at end of file diff --git a/tools/progress_read.py b/tools/progress_read.py new file mode 100644 index 00000000..7ff682ba --- /dev/null +++ b/tools/progress_read.py @@ -0,0 +1,77 @@ +import argparse +import os +import re +import sys +import csv +import anybadge + +# Read using `mips-linux-gnu-readelf -S` +overlay_sizes = { + 'bk_boot' : (0x5BE0 - 0x1000), + 'core1' : 0x034b70 + 0x003080, + 'core2' : 0x0dc600, + 'CC' : 0x0036b0, + 'MMM' : 0x0055f0, + 'GV' : 0x00a7e0, + 'TTC' : 0x005fc0, + 'MM' : 0x0034a0, + 'BGS' : 0x00a2a0, + 'RBB' : 0x009c60, + 'FP' : 0x00b600, + 'SM' : 0x0046d0, + 'cutscenes' : 0x006f60, + 'lair' : 0x00c8c0, + 'fight' : 0x00af90, + 'CCW' : 0x008760, +} + +def RGB_to_hex(RGB): + ''' [255,255,255] -> "#FFFFFF" ''' + # Components need to be integers for hex to make sense + RGB = [int(x) for x in RGB] + return "#"+"".join(["0{0:x}".format(v) if v < 16 else + "{0:x}".format(v) for v in RGB]) + +def main(csv_name, version, overlay): + with open(csv_name, mode='r') as csv_file: + csv_reader = csv.DictReader(csv_file) + line_count = 0 + total_func = 0 + incomplete_func = 0 + if overlay == 'total': + total_byte = sum(overlay_sizes.values()) + else: + total_byte = overlay_sizes[overlay] + incomplete_byte = 0 + for row in csv_reader: + if(row["version"] == version): + total_func += 1 + if row['matching'] != 'yes': + incomplete_func += 1 + incomplete_byte += int(row['length']) + done_byte = total_byte - incomplete_byte + done_func = total_func - incomplete_func + percent = ((done_byte/total_byte) * 100) + print("%s: bytes: %3.4f%% (%d/%d), nonstatic funcs: %3.4f%% (%d/%d)" % (overlay, percent, done_byte, total_byte,((done_func/total_func) *100), done_func, total_func )) + green = min(255, round(min(1, (percent / 100) * 2) * 224)) + red = min(255, round(min(1, ((100 - percent) / 100) * 2) * 224)) + color = RGB_to_hex([red, green, 0]) + if overlay == 'total': + badge = anybadge.Badge("Banjo-Kazooie (us.v10)", "%3.4f%%" % (percent), default_color=color) + else: + badge = anybadge.Badge(overlay, "%3.4f%%" % (percent), default_color=color) + badge.write_badge('progress/progress_' + overlay + '.svg',overwrite=True) + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Create progress csv based on map file', + formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument('csv_name', type=str, + help="csv to read") + parser.add_argument('ver_str', type=str, + help="version") + parser.add_argument('overlay', type=str, + help="overlay name") + args = parser.parse_args() + + main(args.csv_name, args.ver_str, args.overlay) \ No newline at end of file diff --git a/tools/rareunzip.py b/tools/rareunzip.py new file mode 100644 index 00000000..4613fc1c --- /dev/null +++ b/tools/rareunzip.py @@ -0,0 +1,28 @@ +import sys +import zlib + + +def runzip_with_leftovers(data): + d = zlib.decompressobj(wbits=-15) # raw deflate bytestream + res = d.decompress(data[4:]) # drop 4 byte length header + return (res, d.unused_data) + +def runzip(data): + res, leftovers = runzip_with_leftovers(data) + return res + +def main(): + with open(sys.argv[1], "rb") as f: + with open(sys.argv[2], "wb") as o: + data = f.read() + # banjo header + if data[:2] == b'\x11\x72': + data = data[2:] + o.write(runzip(data)) + + +if __name__ == '__main__': + if len(sys.argv) < 3: + print("usage %s infile outfile" % sys.argv[0]) + else: + main() diff --git a/tools/set_o32abi_bit.py b/tools/set_o32abi_bit.py new file mode 100755 index 00000000..f488bd6b --- /dev/null +++ b/tools/set_o32abi_bit.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 +import argparse, struct, sys + +if __name__ == '__main__': + parser = argparse.ArgumentParser() + + parser.add_argument('file', help='input file') + args = parser.parse_args() + + with open(args.file, 'r+b') as f: + magic = struct.unpack('>I', f.read(4))[0] + if magic != 0x7F454C46: + print('Error: Not an ELF file') + sys.exit(1) + + f.seek(36) + flags = struct.unpack('>I', f.read(4))[0] + if flags & 0xF0000000 != 0x20000000: # test for mips3 + print('Error: Architecture not mips3') + sys.exit(1) + + flags |= 0x00001000 # set EF_MIPS_ABI_O32 + f.seek(36) + f.write(struct.pack('>I', flags)) + diff --git a/tools/sound_func_val_unwrap b/tools/sound_func_val_unwrap new file mode 100755 index 00000000..0b23d7b5 --- /dev/null +++ b/tools/sound_func_val_unwrap @@ -0,0 +1,6 @@ +#!/bin/bash + +SFX_ID=$(( $1 & 0x7ff)) +VOLUME=$(echo "$((($1 >> 21) & 0x7ff)).0 / 1023.0" | bc -l) +SAMPLE_RATE=$(((($1 >> 11) & 0x3ff)<<5)) +printf "SFX_%X, %f, %d\n" $SFX_ID $VOLUME $SAMPLE_RATE diff --git a/tools/splat_inputs.py b/tools/splat_inputs.py new file mode 100755 index 00000000..e3064f85 --- /dev/null +++ b/tools/splat_inputs.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 +# Script to get a list of input files that are referenced by a splat file +import argparse +import sys +sys.path.append("./tools/n64splat") + +from split import * + +def main(config_path): + # Load config + with open(config_path) as f: + config = yaml.load(f.read(), Loader=yaml.SafeLoader) + + options.initialize(config, config_path, None, None) + options.set("modes", []) + options.set("verbose", False) + + all_segments = initialize_segments(config["segments"]) + + objs = "" + + for segment in all_segments: + linker_entries = segment.get_linker_entries() + for entry in linker_entries: + src_paths = entry.src_paths + for path in src_paths: + objs += str(path) + " " + + return objs + + +if __name__ == '__main__': + parser = argparse.ArgumentParser(description='Get objects for splat file', + formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument('yamls', nargs='+', help="Splat files") + args = parser.parse_args() + + obj_lists = map(main, args.yamls) + # map(print, obj_lists) + for obj_list in obj_lists: + print(obj_list) + diff --git a/undefined_syms.libultra.txt b/undefined_syms.libultra.txt new file mode 100644 index 00000000..d660374c --- /dev/null +++ b/undefined_syms.libultra.txt @@ -0,0 +1,7 @@ +osTvType = 0x80000300; +osRomBase = 0x80000308; +osResetType = 0x8000030C; +osAppNMIBuffer = 0x8000031C; +D_8023DA20 = 0x8023DA20; +gOverlayTable = 0x803FFE10; +func_8023DA20 = 0x8023DA20; diff --git a/undefined_syms.us.v10.txt b/undefined_syms.us.v10.txt new file mode 100644 index 00000000..e0a7404b --- /dev/null +++ b/undefined_syms.us.v10.txt @@ -0,0 +1,172 @@ +D_8023DF9C = 0x8023DF9C; +__heap_align = 0x80254470; +func_8025FE6C = 0x8025FE6C; +n_alAuxBusPull = 0x80260160; +func_8026A2E0 = 0x8026A2E0; +osPiRawStartDma = 0x8026B970; +osEPiRawStartDma = 0x8026BA50; +alEnvmixerParam = 0x8026FEC4; +alEnvmixerPull = 0x802702F0; +alLoadParam = 0x80270930; +alAdpcmPull = 0x80270FDC; +alResampleParam = 0x80271480; +func_8027156C = 0x8027156C; +alAuxBusParam = 0x80271780; +alAuxBusPull = 0x802717B0; +alMainBusParam = 0x80271890; +alMainBusPull = 0X802718C0; +alSaveParam = 0x802719E0; +alSavePull = 0x80271A14; +func_80272590 = 0x80272590; +D_80276E84 = 0x80276E84; +func_80291610 = 0x80291610; +func_80291AAC = 0x80291AAC; +func_802C71F0 = 0x802C71F0; +func_802C8A54 = 0x802C8A54; +func_802C8AA8 = 0x802C8AA8; +func_802C8AF8 = 0x802C8AF8; +func_802C8B4C = 0x802C8B4C; +func_802C8BA8 = 0x802C8BA8; +func_802C8C04 = 0x802C8C04; +func_802D7558 = 0x802D7558; +func_802D75B4 = 0x802D75B4; +func_802D7610 = 0x802D7610; +func_802DEB18 = 0x802DEB18; +func_802DF99C = 0x802DF99C; +func_802E4078 = 0x802E4078; +func_8030E484 = 0x8030E484; +func_8030E510 = 0x8030E510; +func_80311714 = 0x80311714; +func_80314AC8 = 0x80314AC8; +func_8031CC40 = 0x8031CC40; +func_8031F678 = 0x8031F678; +func_8031FB14 = 0x8031FB14; +func_803253A0 = 0x803253A0; +func_803255FC = 0x803255FC; +func_80325760 = 0x80325760; +func_80325794 = 0x80325794; +actor_new = 0x803272F8; +func_80329958 = 0x80329958; +func_80329904 = 0x80329904; +func_80335110 = 0x80335110; +item_inc = 0x80345F24; +item_set = 0x80346414; +func_80347B54 = 0x80347B54; +func_80347B80 = 0x80347B80; +func_80347C5C = 0x80347C5C; +func_80347C70 = 0x80347C70; +func_80347CC8 = 0x80347CC8; +func_80347CF4 = 0x80347CF4; +func_80347DD0 = 0x80347DD0; +func_80347DE4 = 0x80347DE4; +func_8034BB08 = 0x8034BB08; +func_80352614 = 0x80352614; +func_803526DC = 0x803526DC; +func_80352F58 = 0x80352F58; +func_80352FF4 = 0x80352FF4; +fxegg_head_destroy = 0x80353A90; +fxegg_ass_update = 0x80353CC8; +fxegg_ass_destroy = 0x80353FB4; +func_803540AC = 0x803540AC; +func_803541D8 = 0x803541D8; +func_803543F4 = 0x803543F4; +func_8035451C = 0x8035451C; +func_8035489C = 0x8035489C; +func_80354990 = 0x80354990; +func_80354C18 = 0x80354C18; +func_80354DC8 = 0x80354DC8; +func_80354EEC = 0x80354EEC; +func_80355004 = 0x80355004; +func_80355134 = 0x80355134; +func_80355294 = 0x80355294; +func_803553E8 = 0x803553E8; +func_80355548 = 0x80355548; +func_8035570C = 0x8035570C; +func_8035585C = 0x8035585C; +func_80355B00 = 0x80355B00; +func_80355C4C = 0x80355C4C; +func_80355D50 = 0x80355D50; +func_80355E80 = 0x80355E80; +func_803562E8 = 0x803562E8; +func_80356364 = 0x80356364; +func_8035644C = 0x8035644C; +func_8035646C = 0x8035646C; +func_803298D8 = 0x803298D8; +func_8038FE30 = 0x8038FE30; +D_803649FC = 0x803649FC; +D_80364998 = 0x80364998; +D_80364CD0 = 0x80364CD0; +D_80375788 = 0x80375788; +D_803773D0 = 0x803773D0; +D_80389B60 = 0x80389B60; +D_80378534 = 0x80378534; +D_80389C00 = 0x80389C00; +D_80389B88 = 0x80389B88; +//D_80389C78 = 0x80389C78; +D_8036C4D0 = 0x8036C4D0; +D_80008720 = 0x80008720; +__osDispatchThread = 0x8026AA64; +D_80005180 = 0x80005180; +D_800051A0 = 0x800051A0; +piThreadStack = 0x80283600; +chorangepadInfo = 0x80389890; +chhutInfo = 0x803898F0; + +chchimpystump = 0x80389920; +chcongaInfo = 0x80389998; +chorangeInfo = 0x803899D0; +chlmonkeyInfo = 0x80389A38; +chgrublinInfo = 0x80389AB8; +chjujuhitboxInfo = 0x80389AE0; +chjujuInfo = 0x80389B10; +D_80389B8C = 0x80389B8C; + +D_8037C38E = 0x8037C38E; + +D_80390854 = 0x80390854; +bgs_D_803907B8 = 0x803907B8; +bgs_D_80391190 = 0x80391190; +bgs_D_80391220 = 0x80391220; +bgs_D_80391228 = 0x80391228; + +D_80391728 = 0x80391728; + +D_8038B1C0 = 0x8038B1C0; +D_8038B1D8 = 0x8038B1D8; + +D_00005E70 = 0x00005E70; + + +D_803907AE = 0x803907AE; +D_80389A5C = 0x80389A5C; + +D_00001050 = 0x00001050; + +func_8025F610 = 0x8025F610; + +func_8025C29C = 0x8025C29C; +func_80324E60 = 0x80324E60; +func_80324EE4 = 0x80324EE4; +func_803298AC = 0x803298AC; +func_8032886C = 0x8032886C; +func_8034A754 = 0x8034A754; +func_8034A7BC = 0x8034A7BC; + +func_802DA498 = 0x802DA498; + +/* lair */ +FF_QuestionTypeInfoArr = 0x80394340; +D_80395104 = 0x80395104; +func_802BAE20 = 0x802BAE20; +func_80345FA0 = 0x80345FA0; +func_8031841C = 0x8031841C; +func_803183FC = 0x803183FC; +debugStr_quiz_longText = 0x803950C0; +func_8025AB44 = 0x8025AB44; +func_803183EC = 0x803183EC; +func_8031840C = 0x8031840C; +D_80395168 = 0x80395168; +D_80395170 = 0x80395170; +D_80395180 = 0x80395180; +D_80395118 = 0x80395118; +